fleet-commander-ai 0.0.12 → 0.0.14

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.
Files changed (161) hide show
  1. package/dist/client/assets/index-COIsRr4s.js +187 -0
  2. package/dist/client/assets/index-COIsRr4s.js.map +1 -0
  3. package/dist/client/assets/index-Db5eXbcB.css +1 -0
  4. package/dist/client/index.html +2 -2
  5. package/dist/server/config.d.ts +3 -0
  6. package/dist/server/config.d.ts.map +1 -1
  7. package/dist/server/config.js +7 -1
  8. package/dist/server/config.js.map +1 -1
  9. package/dist/server/db.d.ts +10 -0
  10. package/dist/server/db.d.ts.map +1 -1
  11. package/dist/server/db.js +35 -0
  12. package/dist/server/db.js.map +1 -1
  13. package/dist/server/index.js +6 -1
  14. package/dist/server/index.js.map +1 -1
  15. package/dist/server/mcp/index.d.ts.map +1 -1
  16. package/dist/server/mcp/index.js +18 -0
  17. package/dist/server/mcp/index.js.map +1 -1
  18. package/dist/server/mcp/tools/add-blocked-by.d.ts +9 -0
  19. package/dist/server/mcp/tools/add-blocked-by.d.ts.map +1 -0
  20. package/dist/server/mcp/tools/add-blocked-by.js +49 -0
  21. package/dist/server/mcp/tools/add-blocked-by.js.map +1 -0
  22. package/dist/server/mcp/tools/add-child.d.ts +8 -0
  23. package/dist/server/mcp/tools/add-child.d.ts.map +1 -0
  24. package/dist/server/mcp/tools/add-child.js +48 -0
  25. package/dist/server/mcp/tools/add-child.js.map +1 -0
  26. package/dist/server/mcp/tools/get-relations.d.ts +9 -0
  27. package/dist/server/mcp/tools/get-relations.d.ts.map +1 -0
  28. package/dist/server/mcp/tools/get-relations.js +48 -0
  29. package/dist/server/mcp/tools/get-relations.js.map +1 -0
  30. package/dist/server/mcp/tools/install-project.d.ts +9 -0
  31. package/dist/server/mcp/tools/install-project.d.ts.map +1 -0
  32. package/dist/server/mcp/tools/install-project.js +47 -0
  33. package/dist/server/mcp/tools/install-project.js.map +1 -0
  34. package/dist/server/mcp/tools/remove-blocked-by.d.ts +8 -0
  35. package/dist/server/mcp/tools/remove-blocked-by.d.ts.map +1 -0
  36. package/dist/server/mcp/tools/remove-blocked-by.js +48 -0
  37. package/dist/server/mcp/tools/remove-blocked-by.js.map +1 -0
  38. package/dist/server/mcp/tools/remove-child.d.ts +8 -0
  39. package/dist/server/mcp/tools/remove-child.d.ts.map +1 -0
  40. package/dist/server/mcp/tools/remove-child.js +48 -0
  41. package/dist/server/mcp/tools/remove-child.js.map +1 -0
  42. package/dist/server/mcp/tools/remove-parent.d.ts +8 -0
  43. package/dist/server/mcp/tools/remove-parent.d.ts.map +1 -0
  44. package/dist/server/mcp/tools/remove-parent.js +47 -0
  45. package/dist/server/mcp/tools/remove-parent.js.map +1 -0
  46. package/dist/server/mcp/tools/remove-project.d.ts +9 -0
  47. package/dist/server/mcp/tools/remove-project.d.ts.map +1 -0
  48. package/dist/server/mcp/tools/remove-project.js +47 -0
  49. package/dist/server/mcp/tools/remove-project.js.map +1 -0
  50. package/dist/server/mcp/tools/set-parent.d.ts +8 -0
  51. package/dist/server/mcp/tools/set-parent.d.ts.map +1 -0
  52. package/dist/server/mcp/tools/set-parent.js +48 -0
  53. package/dist/server/mcp/tools/set-parent.js.map +1 -0
  54. package/dist/server/providers/github-issue-provider.d.ts +35 -30
  55. package/dist/server/providers/github-issue-provider.d.ts.map +1 -1
  56. package/dist/server/providers/github-issue-provider.js +189 -165
  57. package/dist/server/providers/github-issue-provider.js.map +1 -1
  58. package/dist/server/providers/index.d.ts.map +1 -1
  59. package/dist/server/providers/index.js +1 -23
  60. package/dist/server/providers/index.js.map +1 -1
  61. package/dist/server/providers/jira-issue-provider.d.ts +33 -1
  62. package/dist/server/providers/jira-issue-provider.d.ts.map +1 -1
  63. package/dist/server/providers/jira-issue-provider.js +159 -0
  64. package/dist/server/providers/jira-issue-provider.js.map +1 -1
  65. package/dist/server/routes/issue-relations.d.ts +4 -0
  66. package/dist/server/routes/issue-relations.d.ts.map +1 -0
  67. package/dist/server/routes/issue-relations.js +223 -0
  68. package/dist/server/routes/issue-relations.js.map +1 -0
  69. package/dist/server/routes/issue-sources.d.ts.map +1 -1
  70. package/dist/server/routes/issue-sources.js +99 -4
  71. package/dist/server/routes/issue-sources.js.map +1 -1
  72. package/dist/server/schema.sql +5 -1
  73. package/dist/server/services/github-poller.d.ts.map +1 -1
  74. package/dist/server/services/github-poller.js +39 -2
  75. package/dist/server/services/github-poller.js.map +1 -1
  76. package/dist/server/services/issue-fetcher.d.ts +38 -0
  77. package/dist/server/services/issue-fetcher.d.ts.map +1 -1
  78. package/dist/server/services/issue-fetcher.js +135 -12
  79. package/dist/server/services/issue-fetcher.js.map +1 -1
  80. package/dist/server/services/issue-relations-service.d.ts +43 -0
  81. package/dist/server/services/issue-relations-service.d.ts.map +1 -0
  82. package/dist/server/services/issue-relations-service.js +298 -0
  83. package/dist/server/services/issue-relations-service.js.map +1 -0
  84. package/dist/server/services/retry-scheduler.d.ts +20 -0
  85. package/dist/server/services/retry-scheduler.d.ts.map +1 -0
  86. package/dist/server/services/retry-scheduler.js +118 -0
  87. package/dist/server/services/retry-scheduler.js.map +1 -0
  88. package/dist/server/services/sse-broker.d.ts +12 -3
  89. package/dist/server/services/sse-broker.d.ts.map +1 -1
  90. package/dist/server/services/sse-broker.js.map +1 -1
  91. package/dist/server/services/team-manager.d.ts.map +1 -1
  92. package/dist/server/services/team-manager.js +13 -2
  93. package/dist/server/services/team-manager.js.map +1 -1
  94. package/dist/server/services/team-service.d.ts.map +1 -1
  95. package/dist/server/services/team-service.js +1 -0
  96. package/dist/server/services/team-service.js.map +1 -1
  97. package/dist/server/services/usage-tracker.d.ts +5 -0
  98. package/dist/server/services/usage-tracker.d.ts.map +1 -1
  99. package/dist/server/services/usage-tracker.js +7 -0
  100. package/dist/server/services/usage-tracker.js.map +1 -1
  101. package/dist/shared/issue-provider.d.ts +34 -0
  102. package/dist/shared/issue-provider.d.ts.map +1 -1
  103. package/dist/shared/issue-provider.js.map +1 -1
  104. package/dist/shared/state-machine.d.ts.map +1 -1
  105. package/dist/shared/state-machine.js +10 -0
  106. package/dist/shared/state-machine.js.map +1 -1
  107. package/dist/shared/types.d.ts +17 -0
  108. package/dist/shared/types.d.ts.map +1 -1
  109. package/hooks/on_notification.sh +1 -1
  110. package/hooks/on_post_tool_use.sh +1 -1
  111. package/hooks/on_pre_compact.sh +1 -1
  112. package/hooks/on_session_end.sh +1 -1
  113. package/hooks/on_session_start.sh +1 -1
  114. package/hooks/on_stop.sh +1 -1
  115. package/hooks/on_stop_failure.sh +1 -1
  116. package/hooks/on_subagent_start.sh +1 -1
  117. package/hooks/on_subagent_stop.sh +1 -1
  118. package/hooks/on_task_created.sh +1 -1
  119. package/hooks/on_teammate_idle.sh +1 -1
  120. package/hooks/on_tool_error.sh +1 -1
  121. package/hooks/run-hook.sh +1 -1
  122. package/hooks/send_event.sh +1 -1
  123. package/package.json +1 -1
  124. package/prompts/default-prompt.md +1 -1
  125. package/prompts/documentation-prompt.md +1 -1
  126. package/prompts/fleet-commander-prompt.md +1 -1
  127. package/prompts/{caddy-prompt.md → international-relations-agent-prompt.md} +5 -3
  128. package/prompts/{chat-prompt.md → pump-ahead-prompt.md} +5 -3
  129. package/prompts/{cortex-admin-prompt.md → traffit-mcp-prompt.md} +5 -3
  130. package/scripts/bump-version.sh +129 -0
  131. package/templates/agents/fleet-dev.md +14 -8
  132. package/templates/agents/fleet-planner.md +23 -14
  133. package/templates/agents/fleet-reviewer.md +47 -16
  134. package/templates/guides/api-design.md +1 -1
  135. package/templates/guides/csharp-conventions.md +1 -1
  136. package/templates/guides/devops-conventions.md +1 -1
  137. package/templates/guides/fsharp-conventions.md +1 -1
  138. package/templates/guides/python-conventions.md +1 -1
  139. package/templates/guides/sql-database.md +1 -1
  140. package/templates/guides/testing-strategies.md +1 -1
  141. package/templates/guides/typescript-conventions.md +1 -1
  142. package/templates/workflow.md +60 -48
  143. package/dist/client/assets/index-BK1CdmRk.css +0 -1
  144. package/dist/client/assets/index-Dxxk3Uzw.js +0 -184
  145. package/dist/client/assets/index-Dxxk3Uzw.js.map +0 -1
  146. package/prompts/ai-demo-platform-prompt.md +0 -17
  147. package/prompts/cortex-box-prototype-prompt.md +0 -17
  148. package/prompts/cortex-document-parser-prompt.md +0 -17
  149. package/prompts/cortex-proxy-prompt.md +0 -17
  150. package/prompts/devops-prompt.md +0 -17
  151. package/prompts/fakturomat-prompt.md +0 -17
  152. package/prompts/fm-content-generator-prompt.md +0 -17
  153. package/prompts/geo-calc-prompt.md +0 -17
  154. package/prompts/idp-prompt.md +0 -17
  155. package/prompts/idp-worker-prompt.md +0 -17
  156. package/prompts/invoice-supervisor-prompt.md +0 -17
  157. package/prompts/keycloak-prompt.md +0 -17
  158. package/prompts/prosty-jezyk-prompt.md +0 -17
  159. package/prompts/rag-qa-engine-fork-prompt.md +0 -17
  160. package/prompts/rag-qa-engine-prompt.md +0 -17
  161. package/prompts/whoami-prompt.md +0 -17
@@ -0,0 +1,187 @@
1
+ var I9=Object.defineProperty;var $9=(e,n,r)=>n in e?I9(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var rd=(e,n,r)=>$9(e,typeof n!="symbol"?n+"":n,r);function B9(e,n){for(var r=0;r<n.length;r++){const i=n[r];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}})();function oi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mv={exports:{}},lu={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var uS;function F9(){if(uS)return lu;uS=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(i,a,l){var s=null;if(l!==void 0&&(s=""+l),a.key!==void 0&&(s=""+a.key),"key"in a){l={};for(var c in a)c!=="key"&&(l[c]=a[c])}else l=a;return a=l.ref,{$$typeof:e,type:i,key:s,ref:a!==void 0?a:null,props:l}}return lu.Fragment=n,lu.jsx=r,lu.jsxs=r,lu}var cS;function U9(){return cS||(cS=1,mv.exports=F9()),mv.exports}var g=U9(),pv={exports:{}},ze={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var fS;function q9(){if(fS)return ze;fS=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function x(F){return F===null||typeof F!="object"?null:(F=y&&F[y]||F["@@iterator"],typeof F=="function"?F:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function j(F,X,ae){this.props=F,this.context=X,this.refs=k,this.updater=ae||_}j.prototype.isReactComponent={},j.prototype.setState=function(F,X){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,X,"setState")},j.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function C(){}C.prototype=j.prototype;function N(F,X,ae){this.props=F,this.context=X,this.refs=k,this.updater=ae||_}var O=N.prototype=new C;O.constructor=N,S(O,j.prototype),O.isPureReactComponent=!0;var T=Array.isArray;function A(){}var P={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function z(F,X,ae){var se=ae.ref;return{$$typeof:e,type:F,key:X,ref:se!==void 0?se:null,props:ae}}function D(F,X){return z(F.type,X,F.props)}function U(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function q(F){var X={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(ae){return X[ae]})}var L=/\/+/g;function $(F,X){return typeof F=="object"&&F!==null&&F.key!=null?q(""+F.key):X.toString(36)}function G(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(A,A):(F.status="pending",F.then(function(X){F.status==="pending"&&(F.status="fulfilled",F.value=X)},function(X){F.status==="pending"&&(F.status="rejected",F.reason=X)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function B(F,X,ae,se,ve){var we=typeof F;(we==="undefined"||we==="boolean")&&(F=null);var ce=!1;if(F===null)ce=!0;else switch(we){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(F.$$typeof){case e:case n:ce=!0;break;case m:return ce=F._init,B(ce(F._payload),X,ae,se,ve)}}if(ce)return ve=ve(F),ce=se===""?"."+$(F,0):se,T(ve)?(ae="",ce!=null&&(ae=ce.replace(L,"$&/")+"/"),B(ve,X,ae,"",function(pe){return pe})):ve!=null&&(U(ve)&&(ve=D(ve,ae+(ve.key==null||F&&F.key===ve.key?"":(""+ve.key).replace(L,"$&/")+"/")+ce)),X.push(ve)),1;ce=0;var Se=se===""?".":se+":";if(T(F))for(var me=0;me<F.length;me++)se=F[me],we=Se+$(se,me),ce+=B(se,X,ae,we,ve);else if(me=x(F),typeof me=="function")for(F=me.call(F),me=0;!(se=F.next()).done;)se=se.value,we=Se+$(se,me++),ce+=B(se,X,ae,we,ve);else if(we==="object"){if(typeof F.then=="function")return B(G(F),X,ae,se,ve);throw X=String(F),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ce}function Y(F,X,ae){if(F==null)return F;var se=[],ve=0;return B(F,se,"","",function(we){return X.call(ae,we,ve++)}),se}function ee(F){if(F._status===-1){var X=F._result;X=X(),X.then(function(ae){(F._status===0||F._status===-1)&&(F._status=1,F._result=ae)},function(ae){(F._status===0||F._status===-1)&&(F._status=2,F._result=ae)}),F._status===-1&&(F._status=0,F._result=X)}if(F._status===1)return F._result.default;throw F._result}var H=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},re={map:Y,forEach:function(F,X,ae){Y(F,function(){X.apply(this,arguments)},ae)},count:function(F){var X=0;return Y(F,function(){X++}),X},toArray:function(F){return Y(F,function(X){return X})||[]},only:function(F){if(!U(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return ze.Activity=p,ze.Children=re,ze.Component=j,ze.Fragment=r,ze.Profiler=a,ze.PureComponent=N,ze.StrictMode=i,ze.Suspense=f,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,ze.__COMPILER_RUNTIME={__proto__:null,c:function(F){return P.H.useMemoCache(F)}},ze.cache=function(F){return function(){return F.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(F,X,ae){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var se=S({},F.props),ve=F.key;if(X!=null)for(we in X.key!==void 0&&(ve=""+X.key),X)!R.call(X,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&X.ref===void 0||(se[we]=X[we]);var we=arguments.length-2;if(we===1)se.children=ae;else if(1<we){for(var ce=Array(we),Se=0;Se<we;Se++)ce[Se]=arguments[Se+2];se.children=ce}return z(F.type,ve,se)},ze.createContext=function(F){return F={$$typeof:s,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:l,_context:F},F},ze.createElement=function(F,X,ae){var se,ve={},we=null;if(X!=null)for(se in X.key!==void 0&&(we=""+X.key),X)R.call(X,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ve[se]=X[se]);var ce=arguments.length-2;if(ce===1)ve.children=ae;else if(1<ce){for(var Se=Array(ce),me=0;me<ce;me++)Se[me]=arguments[me+2];ve.children=Se}if(F&&F.defaultProps)for(se in ce=F.defaultProps,ce)ve[se]===void 0&&(ve[se]=ce[se]);return z(F,we,ve)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(F){return{$$typeof:c,render:F}},ze.isValidElement=U,ze.lazy=function(F){return{$$typeof:m,_payload:{_status:-1,_result:F},_init:ee}},ze.memo=function(F,X){return{$$typeof:d,type:F,compare:X===void 0?null:X}},ze.startTransition=function(F){var X=P.T,ae={};P.T=ae;try{var se=F(),ve=P.S;ve!==null&&ve(ae,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(A,H)}catch(we){H(we)}finally{X!==null&&ae.types!==null&&(X.types=ae.types),P.T=X}},ze.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},ze.use=function(F){return P.H.use(F)},ze.useActionState=function(F,X,ae){return P.H.useActionState(F,X,ae)},ze.useCallback=function(F,X){return P.H.useCallback(F,X)},ze.useContext=function(F){return P.H.useContext(F)},ze.useDebugValue=function(){},ze.useDeferredValue=function(F,X){return P.H.useDeferredValue(F,X)},ze.useEffect=function(F,X){return P.H.useEffect(F,X)},ze.useEffectEvent=function(F){return P.H.useEffectEvent(F)},ze.useId=function(){return P.H.useId()},ze.useImperativeHandle=function(F,X,ae){return P.H.useImperativeHandle(F,X,ae)},ze.useInsertionEffect=function(F,X){return P.H.useInsertionEffect(F,X)},ze.useLayoutEffect=function(F,X){return P.H.useLayoutEffect(F,X)},ze.useMemo=function(F,X){return P.H.useMemo(F,X)},ze.useOptimistic=function(F,X){return P.H.useOptimistic(F,X)},ze.useReducer=function(F,X,ae){return P.H.useReducer(F,X,ae)},ze.useRef=function(F){return P.H.useRef(F)},ze.useState=function(F){return P.H.useState(F)},ze.useSyncExternalStore=function(F,X,ae){return P.H.useSyncExternalStore(F,X,ae)},ze.useTransition=function(){return P.H.useTransition()},ze.version="19.2.4",ze}var dS;function Qo(){return dS||(dS=1,pv.exports=q9()),pv.exports}var b=Qo();const Jo=oi(b),H9=B9({__proto__:null,default:Jo},[b]);var gv={exports:{}},ou={},vv={exports:{}},yv={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var hS;function G9(){return hS||(hS=1,(function(e){function n(B,Y){var ee=B.length;B.push(Y);e:for(;0<ee;){var H=ee-1>>>1,re=B[H];if(0<a(re,Y))B[H]=Y,B[ee]=re,ee=H;else break e}}function r(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var Y=B[0],ee=B.pop();if(ee!==Y){B[0]=ee;e:for(var H=0,re=B.length,F=re>>>1;H<F;){var X=2*(H+1)-1,ae=B[X],se=X+1,ve=B[se];if(0>a(ae,ee))se<re&&0>a(ve,ae)?(B[H]=ve,B[se]=ee,H=se):(B[H]=ae,B[X]=ee,H=X);else if(se<re&&0>a(ve,ee))B[H]=ve,B[se]=ee,H=se;else break e}}return Y}function a(B,Y){var ee=B.sortIndex-Y.sortIndex;return ee!==0?ee:B.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var f=[],d=[],m=1,p=null,y=3,x=!1,_=!1,S=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function O(B){for(var Y=r(d);Y!==null;){if(Y.callback===null)i(d);else if(Y.startTime<=B)i(d),Y.sortIndex=Y.expirationTime,n(f,Y);else break;Y=r(d)}}function T(B){if(S=!1,O(B),!_)if(r(f)!==null)_=!0,A||(A=!0,q());else{var Y=r(d);Y!==null&&G(T,Y.startTime-B)}}var A=!1,P=-1,R=5,z=-1;function D(){return k?!0:!(e.unstable_now()-z<R)}function U(){if(k=!1,A){var B=e.unstable_now();z=B;var Y=!0;try{e:{_=!1,S&&(S=!1,C(P),P=-1),x=!0;var ee=y;try{t:{for(O(B),p=r(f);p!==null&&!(p.expirationTime>B&&D());){var H=p.callback;if(typeof H=="function"){p.callback=null,y=p.priorityLevel;var re=H(p.expirationTime<=B);if(B=e.unstable_now(),typeof re=="function"){p.callback=re,O(B),Y=!0;break t}p===r(f)&&i(f),O(B)}else i(f);p=r(f)}if(p!==null)Y=!0;else{var F=r(d);F!==null&&G(T,F.startTime-B),Y=!1}}break e}finally{p=null,y=ee,x=!1}Y=void 0}}finally{Y?q():A=!1}}}var q;if(typeof N=="function")q=function(){N(U)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,$=L.port2;L.port1.onmessage=U,q=function(){$.postMessage(null)}}else q=function(){j(U,0)};function G(B,Y){P=j(function(){B(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(B){switch(y){case 1:case 2:case 3:var Y=3;break;default:Y=y}var ee=y;y=Y;try{return B()}finally{y=ee}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(B,Y){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ee=y;y=B;try{return Y()}finally{y=ee}},e.unstable_scheduleCallback=function(B,Y,ee){var H=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?H+ee:H):ee=H,B){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=ee+re,B={id:m++,callback:Y,priorityLevel:B,startTime:ee,expirationTime:re,sortIndex:-1},ee>H?(B.sortIndex=ee,n(d,B),r(f)===null&&B===r(d)&&(S?(C(P),P=-1):S=!0,G(T,ee-H))):(B.sortIndex=re,n(f,B),_||x||(_=!0,A||(A=!0,q()))),B},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(B){var Y=y;return function(){var ee=y;y=Y;try{return B.apply(this,arguments)}finally{y=ee}}}})(yv)),yv}var mS;function K9(){return mS||(mS=1,vv.exports=G9()),vv.exports}var xv={exports:{}},on={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var pS;function V9(){if(pS)return on;pS=1;var e=Qo();function n(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(f,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:f,containerInfo:d,implementation:m}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return on.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,on.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return l(f,d,null,m)},on.flushSync=function(f){var d=s.T,m=i.p;try{if(s.T=null,i.p=2,f)return f()}finally{s.T=d,i.p=m,i.d.f()}},on.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(f,d))},on.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},on.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,p=c(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?i.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:x}):m==="script"&&i.d.X(f,{crossOrigin:p,integrity:y,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},on.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(f)},on.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=c(m,d.crossOrigin);i.d.L(f,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},on.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);i.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(f)},on.requestFormReset=function(f){i.d.r(f)},on.unstable_batchedUpdates=function(f,d){return f(d)},on.useFormState=function(f,d,m){return s.H.useFormState(f,d,m)},on.useFormStatus=function(){return s.H.useHostTransitionStatus()},on.version="19.2.4",on}var gS;function FO(){if(gS)return xv.exports;gS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),xv.exports=V9(),xv.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var vS;function Y9(){if(vS)return ou;vS=1;var e=K9(),n=Qo(),r=FO();function i(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function l(o){var u=o,h=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(h=u.return),o=u.return;while(o)}return u.tag===3?h:null}function s(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function c(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function f(o){if(l(o)!==o)throw Error(i(188))}function d(o){var u=o.alternate;if(!u){if(u=l(o),u===null)throw Error(i(188));return u!==o?null:o}for(var h=o,v=u;;){var w=h.return;if(w===null)break;var E=w.alternate;if(E===null){if(v=w.return,v!==null){h=v;continue}break}if(w.child===E.child){for(E=w.child;E;){if(E===h)return f(w),o;if(E===v)return f(w),u;E=E.sibling}throw Error(i(188))}if(h.return!==v.return)h=w,v=E;else{for(var M=!1,I=w.child;I;){if(I===h){M=!0,h=w,v=E;break}if(I===v){M=!0,v=w,h=E;break}I=I.sibling}if(!M){for(I=E.child;I;){if(I===h){M=!0,h=E,v=w;break}if(I===v){M=!0,v=E,h=w;break}I=I.sibling}if(!M)throw Error(i(189))}}if(h.alternate!==v)throw Error(i(190))}if(h.tag!==3)throw Error(i(188));return h.stateNode.current===h?o:u}function m(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=m(o),u!==null)return u;o=o.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function q(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var L=Symbol.for("react.client.reference");function $(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===L?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case j:return"Profiler";case k:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case z:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case _:return"Portal";case N:return o.displayName||"Context";case C:return(o._context.displayName||"Context")+".Consumer";case O:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case P:return u=o.displayName||null,u!==null?u:$(o.type)||"Memo";case R:u=o._payload,o=o._init;try{return $(o(u))}catch{}}return null}var G=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},H=[],re=-1;function F(o){return{current:o}}function X(o){0>re||(o.current=H[re],H[re]=null,re--)}function ae(o,u){re++,H[re]=o.current,o.current=u}var se=F(null),ve=F(null),we=F(null),ce=F(null);function Se(o,u){switch(ae(we,u),ae(ve,o),ae(se,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?Mk(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=Mk(u),o=Pk(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}X(se),ae(se,o)}function me(){X(se),X(ve),X(we)}function pe(o){o.memoizedState!==null&&ae(ce,o);var u=se.current,h=Pk(u,o.type);u!==h&&(ae(ve,o),ae(se,h))}function Ee(o){ve.current===o&&(X(se),X(ve)),ce.current===o&&(X(ce),nu._currentValue=ee)}var he,Be;function Me(o){if(he===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);he=u&&u[1]||"",Be=-1<h.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+he+o+Be}var J=!1;function ye(o,u){if(!o||J)return"";J=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(u){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var ie=oe}Reflect.construct(o,[],de)}else{try{de.call()}catch(oe){ie=oe}o.call(de.prototype)}}else{try{throw Error()}catch(oe){ie=oe}(de=o())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&ie&&typeof oe.stack=="string")return[oe.stack,ie.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=v.DetermineComponentFrameRoot(),M=E[0],I=E[1];if(M&&I){var V=M.split(`
44
+ `),ne=I.split(`
45
+ `);for(w=v=0;v<V.length&&!V[v].includes("DetermineComponentFrameRoot");)v++;for(;w<ne.length&&!ne[w].includes("DetermineComponentFrameRoot");)w++;if(v===V.length||w===ne.length)for(v=V.length-1,w=ne.length-1;1<=v&&0<=w&&V[v]!==ne[w];)w--;for(;1<=v&&0<=w;v--,w--)if(V[v]!==ne[w]){if(v!==1||w!==1)do if(v--,w--,0>w||V[v]!==ne[w]){var ue=`
46
+ `+V[v].replace(" at new "," at ");return o.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",o.displayName)),ue}while(1<=v&&0<=w);break}}}finally{J=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Me(h):""}function K(o,u){switch(o.tag){case 26:case 27:case 5:return Me(o.type);case 16:return Me("Lazy");case 13:return o.child!==u&&u!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return ye(o.type,!1);case 11:return ye(o.type.render,!1);case 1:return ye(o.type,!0);case 31:return Me("Activity");default:return""}}function ge(o){try{var u="",h=null;do u+=K(o,h),h=o,o=o.return;while(o);return u}catch(v){return`
47
+ Error generating stack: `+v.message+`
48
+ `+v.stack}}var be=Object.prototype.hasOwnProperty,Le=e.unstable_scheduleCallback,Re=e.unstable_cancelCallback,Je=e.unstable_shouldYield,Ae=e.unstable_requestPaint,De=e.unstable_now,Ze=e.unstable_getCurrentPriorityLevel,di=e.unstable_ImmediatePriority,hs=e.unstable_UserBlockingPriority,Qn=e.unstable_NormalPriority,Dn=e.unstable_LowPriority,d2=e.unstable_IdlePriority,b8=e.log,w8=e.unstable_setDisableYieldValue,ms=null,Rn=null;function ia(o){if(typeof b8=="function"&&w8(o),Rn&&typeof Rn.setStrictMode=="function")try{Rn.setStrictMode(ms,o)}catch{}}var Ln=Math.clz32?Math.clz32:S8,_8=Math.log,k8=Math.LN2;function S8(o){return o>>>=0,o===0?32:31-(_8(o)/k8|0)|0}var Bc=256,Fc=262144,Uc=4194304;function Ha(o){var u=o&42;if(u!==0)return u;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function qc(o,u,h){var v=o.pendingLanes;if(v===0)return 0;var w=0,E=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var I=v&134217727;return I!==0?(v=I&~E,v!==0?w=Ha(v):(M&=I,M!==0?w=Ha(M):h||(h=I&~o,h!==0&&(w=Ha(h))))):(I=v&~E,I!==0?w=Ha(I):M!==0?w=Ha(M):h||(h=v&~o,h!==0&&(w=Ha(h)))),w===0?0:u!==0&&u!==w&&(u&E)===0&&(E=w&-w,h=u&-u,E>=h||E===32&&(h&4194048)!==0)?u:w}function ps(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function j8(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function h2(){var o=Uc;return Uc<<=1,(Uc&62914560)===0&&(Uc=4194304),o}function np(o){for(var u=[],h=0;31>h;h++)u.push(o);return u}function gs(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function E8(o,u,h,v,w,E){var M=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var I=o.entanglements,V=o.expirationTimes,ne=o.hiddenUpdates;for(h=M&~h;0<h;){var ue=31-Ln(h),de=1<<ue;I[ue]=0,V[ue]=-1;var ie=ne[ue];if(ie!==null)for(ne[ue]=null,ue=0;ue<ie.length;ue++){var oe=ie[ue];oe!==null&&(oe.lane&=-536870913)}h&=~de}v!==0&&m2(o,v,0),E!==0&&w===0&&o.tag!==0&&(o.suspendedLanes|=E&~(M&~u))}function m2(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var v=31-Ln(u);o.entangledLanes|=u,o.entanglements[v]=o.entanglements[v]|1073741824|h&261930}function p2(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var v=31-Ln(h),w=1<<v;w&u|o[v]&u&&(o[v]|=u),h&=~w}}function g2(o,u){var h=u&-u;return h=(h&42)!==0?1:rp(h),(h&(o.suspendedLanes|u))!==0?0:h}function rp(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function ip(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function v2(){var o=Y.p;return o!==0?o:(o=window.event,o===void 0?32:nS(o.type))}function y2(o,u){var h=Y.p;try{return Y.p=o,u()}finally{Y.p=h}}var aa=Math.random().toString(36).slice(2),Wt="__reactFiber$"+aa,kn="__reactProps$"+aa,$l="__reactContainer$"+aa,ap="__reactEvents$"+aa,C8="__reactListeners$"+aa,N8="__reactHandles$"+aa,x2="__reactResources$"+aa,vs="__reactMarker$"+aa;function lp(o){delete o[Wt],delete o[kn],delete o[ap],delete o[C8],delete o[N8]}function Bl(o){var u=o[Wt];if(u)return u;for(var h=o.parentNode;h;){if(u=h[$l]||h[Wt]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=Bk(o);o!==null;){if(h=o[Wt])return h;o=Bk(o)}return u}o=h,h=o.parentNode}return null}function Fl(o){if(o=o[Wt]||o[$l]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function ys(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(i(33))}function Ul(o){var u=o[x2];return u||(u=o[x2]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Ut(o){o[vs]=!0}var b2=new Set,w2={};function Ga(o,u){ql(o,u),ql(o+"Capture",u)}function ql(o,u){for(w2[o]=u,o=0;o<u.length;o++)b2.add(u[o])}var O8=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),_2={},k2={};function A8(o){return be.call(k2,o)?!0:be.call(_2,o)?!1:O8.test(o)?k2[o]=!0:(_2[o]=!0,!1)}function Hc(o,u,h){if(A8(u))if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var v=u.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+h)}}function Gc(o,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+h)}}function hi(o,u,h,v){if(v===null)o.removeAttribute(h);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(u,h,""+v)}}function Jn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function S2(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function T8(o,u,h){var v=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var w=v.get,E=v.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return w.call(this)},set:function(M){h=""+M,E.call(this,M)}}),Object.defineProperty(o,u,{enumerable:v.enumerable}),{getValue:function(){return h},setValue:function(M){h=""+M},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function op(o){if(!o._valueTracker){var u=S2(o)?"checked":"value";o._valueTracker=T8(o,u,""+o[u])}}function j2(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),v="";return o&&(v=S2(o)?o.checked?"true":"false":o.value),o=v,o!==h?(u.setValue(o),!0):!1}function Kc(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var M8=/[\n"\\]/g;function er(o){return o.replace(M8,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function sp(o,u,h,v,w,E,M,I){o.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.type=M:o.removeAttribute("type"),u!=null?M==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+Jn(u)):o.value!==""+Jn(u)&&(o.value=""+Jn(u)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),u!=null?up(o,M,Jn(u)):h!=null?up(o,M,Jn(h)):v!=null&&o.removeAttribute("value"),w==null&&E!=null&&(o.defaultChecked=!!E),w!=null&&(o.checked=w&&typeof w!="function"&&typeof w!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?o.name=""+Jn(I):o.removeAttribute("name")}function E2(o,u,h,v,w,E,M,I){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),u!=null||h!=null){if(!(E!=="submit"&&E!=="reset"||u!=null)){op(o);return}h=h!=null?""+Jn(h):"",u=u!=null?""+Jn(u):h,I||u===o.value||(o.value=u),o.defaultValue=u}v=v??w,v=typeof v!="function"&&typeof v!="symbol"&&!!v,o.checked=I?o.checked:!!v,o.defaultChecked=!!v,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M),op(o)}function up(o,u,h){u==="number"&&Kc(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Hl(o,u,h,v){if(o=o.options,u){u={};for(var w=0;w<h.length;w++)u["$"+h[w]]=!0;for(h=0;h<o.length;h++)w=u.hasOwnProperty("$"+o[h].value),o[h].selected!==w&&(o[h].selected=w),w&&v&&(o[h].defaultSelected=!0)}else{for(h=""+Jn(h),u=null,w=0;w<o.length;w++){if(o[w].value===h){o[w].selected=!0,v&&(o[w].defaultSelected=!0);return}u!==null||o[w].disabled||(u=o[w])}u!==null&&(u.selected=!0)}}function C2(o,u,h){if(u!=null&&(u=""+Jn(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+Jn(h):""}function N2(o,u,h,v){if(u==null){if(v!=null){if(h!=null)throw Error(i(92));if(G(v)){if(1<v.length)throw Error(i(93));v=v[0]}h=v}h==null&&(h=""),u=h}h=Jn(u),o.defaultValue=h,v=o.textContent,v===h&&v!==""&&v!==null&&(o.value=v),op(o)}function Gl(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var P8=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function O2(o,u,h){var v=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?v?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":v?o.setProperty(u,h):typeof h!="number"||h===0||P8.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function A2(o,u,h){if(u!=null&&typeof u!="object")throw Error(i(62));if(o=o.style,h!=null){for(var v in h)!h.hasOwnProperty(v)||u!=null&&u.hasOwnProperty(v)||(v.indexOf("--")===0?o.setProperty(v,""):v==="float"?o.cssFloat="":o[v]="");for(var w in u)v=u[w],u.hasOwnProperty(w)&&h[w]!==v&&O2(o,w,v)}else for(var E in u)u.hasOwnProperty(E)&&O2(o,E,u[E])}function cp(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var D8=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),R8=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vc(o){return R8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function mi(){}var fp=null;function dp(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Kl=null,Vl=null;function T2(o){var u=Fl(o);if(u&&(o=u.stateNode)){var h=o[kn]||null;e:switch(o=u.stateNode,u.type){case"input":if(sp(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+er(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var v=h[u];if(v!==o&&v.form===o.form){var w=v[kn]||null;if(!w)throw Error(i(90));sp(v,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(u=0;u<h.length;u++)v=h[u],v.form===o.form&&j2(v)}break e;case"textarea":C2(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Hl(o,!!h.multiple,u,!1)}}}var hp=!1;function M2(o,u,h){if(hp)return o(u,h);hp=!0;try{var v=o(u);return v}finally{if(hp=!1,(Kl!==null||Vl!==null)&&(Rf(),Kl&&(u=Kl,o=Vl,Vl=Kl=null,T2(u),o)))for(u=0;u<o.length;u++)T2(o[u])}}function xs(o,u){var h=o.stateNode;if(h===null)return null;var v=h[kn]||null;if(v===null)return null;h=v[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(o=o.type,v=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!v;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(i(231,u,typeof h));return h}var pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mp=!1;if(pi)try{var bs={};Object.defineProperty(bs,"passive",{get:function(){mp=!0}}),window.addEventListener("test",bs,bs),window.removeEventListener("test",bs,bs)}catch{mp=!1}var la=null,pp=null,Yc=null;function P2(){if(Yc)return Yc;var o,u=pp,h=u.length,v,w="value"in la?la.value:la.textContent,E=w.length;for(o=0;o<h&&u[o]===w[o];o++);var M=h-o;for(v=1;v<=M&&u[h-v]===w[E-v];v++);return Yc=w.slice(o,1<v?1-v:void 0)}function Wc(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function Xc(){return!0}function D2(){return!1}function Sn(o){function u(h,v,w,E,M){this._reactName=h,this._targetInst=w,this.type=v,this.nativeEvent=E,this.target=M,this.currentTarget=null;for(var I in o)o.hasOwnProperty(I)&&(h=o[I],this[I]=h?h(E):E[I]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Xc:D2,this.isPropagationStopped=D2,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Xc)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Xc)},persist:function(){},isPersistent:Xc}),u}var Ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zc=Sn(Ka),ws=p({},Ka,{view:0,detail:0}),L8=Sn(ws),gp,vp,_s,Qc=p({},ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xp,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==_s&&(_s&&o.type==="mousemove"?(gp=o.screenX-_s.screenX,vp=o.screenY-_s.screenY):vp=gp=0,_s=o),gp)},movementY:function(o){return"movementY"in o?o.movementY:vp}}),R2=Sn(Qc),z8=p({},Qc,{dataTransfer:0}),I8=Sn(z8),$8=p({},ws,{relatedTarget:0}),yp=Sn($8),B8=p({},Ka,{animationName:0,elapsedTime:0,pseudoElement:0}),F8=Sn(B8),U8=p({},Ka,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),q8=Sn(U8),H8=p({},Ka,{data:0}),L2=Sn(H8),G8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},V8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y8(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=V8[o])?!!u[o]:!1}function xp(){return Y8}var W8=p({},ws,{key:function(o){if(o.key){var u=G8[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=Wc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?K8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xp,charCode:function(o){return o.type==="keypress"?Wc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Wc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),X8=Sn(W8),Z8=p({},Qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),z2=Sn(Z8),Q8=p({},ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xp}),J8=Sn(Q8),eR=p({},Ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),tR=Sn(eR),nR=p({},Qc,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),rR=Sn(nR),iR=p({},Ka,{newState:0,oldState:0}),aR=Sn(iR),lR=[9,13,27,32],bp=pi&&"CompositionEvent"in window,ks=null;pi&&"documentMode"in document&&(ks=document.documentMode);var oR=pi&&"TextEvent"in window&&!ks,I2=pi&&(!bp||ks&&8<ks&&11>=ks),$2=" ",B2=!1;function F2(o,u){switch(o){case"keyup":return lR.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U2(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Yl=!1;function sR(o,u){switch(o){case"compositionend":return U2(u);case"keypress":return u.which!==32?null:(B2=!0,$2);case"textInput":return o=u.data,o===$2&&B2?null:o;default:return null}}function uR(o,u){if(Yl)return o==="compositionend"||!bp&&F2(o,u)?(o=P2(),Yc=pp=la=null,Yl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return I2&&u.locale!=="ko"?null:u.data;default:return null}}var cR={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function q2(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!cR[o.type]:u==="textarea"}function H2(o,u,h,v){Kl?Vl?Vl.push(v):Vl=[v]:Kl=v,u=Uf(u,"onChange"),0<u.length&&(h=new Zc("onChange","change",null,h,v),o.push({event:h,listeners:u}))}var Ss=null,js=null;function fR(o){Ek(o,0)}function Jc(o){var u=ys(o);if(j2(u))return o}function G2(o,u){if(o==="change")return u}var K2=!1;if(pi){var wp;if(pi){var _p="oninput"in document;if(!_p){var V2=document.createElement("div");V2.setAttribute("oninput","return;"),_p=typeof V2.oninput=="function"}wp=_p}else wp=!1;K2=wp&&(!document.documentMode||9<document.documentMode)}function Y2(){Ss&&(Ss.detachEvent("onpropertychange",W2),js=Ss=null)}function W2(o){if(o.propertyName==="value"&&Jc(js)){var u=[];H2(u,js,o,dp(o)),M2(fR,u)}}function dR(o,u,h){o==="focusin"?(Y2(),Ss=u,js=h,Ss.attachEvent("onpropertychange",W2)):o==="focusout"&&Y2()}function hR(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Jc(js)}function mR(o,u){if(o==="click")return Jc(u)}function pR(o,u){if(o==="input"||o==="change")return Jc(u)}function gR(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var zn=typeof Object.is=="function"?Object.is:gR;function Es(o,u){if(zn(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var h=Object.keys(o),v=Object.keys(u);if(h.length!==v.length)return!1;for(v=0;v<h.length;v++){var w=h[v];if(!be.call(u,w)||!zn(o[w],u[w]))return!1}return!0}function X2(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Z2(o,u){var h=X2(o);o=0;for(var v;h;){if(h.nodeType===3){if(v=o+h.textContent.length,o<=u&&v>=u)return{node:h,offset:u-o};o=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=X2(h)}}function Q2(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?Q2(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function J2(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Kc(o.document);u instanceof o.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)o=u.contentWindow;else break;u=Kc(o.document)}return u}function kp(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var vR=pi&&"documentMode"in document&&11>=document.documentMode,Wl=null,Sp=null,Cs=null,jp=!1;function ew(o,u,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;jp||Wl==null||Wl!==Kc(v)||(v=Wl,"selectionStart"in v&&kp(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Cs&&Es(Cs,v)||(Cs=v,v=Uf(Sp,"onSelect"),0<v.length&&(u=new Zc("onSelect","select",null,u,h),o.push({event:u,listeners:v}),u.target=Wl)))}function Va(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Xl={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},Ep={},tw={};pi&&(tw=document.createElement("div").style,"AnimationEvent"in window||(delete Xl.animationend.animation,delete Xl.animationiteration.animation,delete Xl.animationstart.animation),"TransitionEvent"in window||delete Xl.transitionend.transition);function Ya(o){if(Ep[o])return Ep[o];if(!Xl[o])return o;var u=Xl[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in tw)return Ep[o]=u[h];return o}var nw=Ya("animationend"),rw=Ya("animationiteration"),iw=Ya("animationstart"),yR=Ya("transitionrun"),xR=Ya("transitionstart"),bR=Ya("transitioncancel"),aw=Ya("transitionend"),lw=new Map,Cp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cp.push("scrollEnd");function jr(o,u){lw.set(o,u),Ga(u,[o])}var ef=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},tr=[],Zl=0,Np=0;function tf(){for(var o=Zl,u=Np=Zl=0;u<o;){var h=tr[u];tr[u++]=null;var v=tr[u];tr[u++]=null;var w=tr[u];tr[u++]=null;var E=tr[u];if(tr[u++]=null,v!==null&&w!==null){var M=v.pending;M===null?w.next=w:(w.next=M.next,M.next=w),v.pending=w}E!==0&&ow(h,w,E)}}function nf(o,u,h,v){tr[Zl++]=o,tr[Zl++]=u,tr[Zl++]=h,tr[Zl++]=v,Np|=v,o.lanes|=v,o=o.alternate,o!==null&&(o.lanes|=v)}function Op(o,u,h,v){return nf(o,u,h,v),rf(o)}function Wa(o,u){return nf(o,null,null,u),rf(o)}function ow(o,u,h){o.lanes|=h;var v=o.alternate;v!==null&&(v.lanes|=h);for(var w=!1,E=o.return;E!==null;)E.childLanes|=h,v=E.alternate,v!==null&&(v.childLanes|=h),E.tag===22&&(o=E.stateNode,o===null||o._visibility&1||(w=!0)),o=E,E=E.return;return o.tag===3?(E=o.stateNode,w&&u!==null&&(w=31-Ln(h),o=E.hiddenUpdates,v=o[w],v===null?o[w]=[u]:v.push(u),u.lane=h|536870912),E):null}function rf(o){if(50<Ws)throw Ws=0,Ig=null,Error(i(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var Ql={};function wR(o,u,h,v){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(o,u,h,v){return new wR(o,u,h,v)}function Ap(o){return o=o.prototype,!(!o||!o.isReactComponent)}function gi(o,u){var h=o.alternate;return h===null?(h=In(o.tag,u,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=u,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,u=o.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function sw(o,u){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=u,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,u=h.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function af(o,u,h,v,w,E){var M=0;if(v=o,typeof o=="function")Ap(o)&&(M=1);else if(typeof o=="string")M=E9(o,h,se.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case z:return o=In(31,h,u,w),o.elementType=z,o.lanes=E,o;case S:return Xa(h.children,w,E,u);case k:M=8,w|=24;break;case j:return o=In(12,h,u,w|2),o.elementType=j,o.lanes=E,o;case T:return o=In(13,h,u,w),o.elementType=T,o.lanes=E,o;case A:return o=In(19,h,u,w),o.elementType=A,o.lanes=E,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:M=10;break e;case C:M=9;break e;case O:M=11;break e;case P:M=14;break e;case R:M=16,v=null;break e}M=29,h=Error(i(130,o===null?"null":typeof o,"")),v=null}return u=In(M,h,u,w),u.elementType=o,u.type=v,u.lanes=E,u}function Xa(o,u,h,v){return o=In(7,o,v,u),o.lanes=h,o}function Tp(o,u,h){return o=In(6,o,null,u),o.lanes=h,o}function uw(o){var u=In(18,null,null,0);return u.stateNode=o,u}function Mp(o,u,h){return u=In(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var cw=new WeakMap;function nr(o,u){if(typeof o=="object"&&o!==null){var h=cw.get(o);return h!==void 0?h:(u={value:o,source:u,stack:ge(u)},cw.set(o,u),u)}return{value:o,source:u,stack:ge(u)}}var Jl=[],eo=0,lf=null,Ns=0,rr=[],ir=0,oa=null,zr=1,Ir="";function vi(o,u){Jl[eo++]=Ns,Jl[eo++]=lf,lf=o,Ns=u}function fw(o,u,h){rr[ir++]=zr,rr[ir++]=Ir,rr[ir++]=oa,oa=o;var v=zr;o=Ir;var w=32-Ln(v)-1;v&=~(1<<w),h+=1;var E=32-Ln(u)+w;if(30<E){var M=w-w%5;E=(v&(1<<M)-1).toString(32),v>>=M,w-=M,zr=1<<32-Ln(u)+w|h<<w|v,Ir=E+o}else zr=1<<E|h<<w|v,Ir=o}function Pp(o){o.return!==null&&(vi(o,1),fw(o,1,0))}function Dp(o){for(;o===lf;)lf=Jl[--eo],Jl[eo]=null,Ns=Jl[--eo],Jl[eo]=null;for(;o===oa;)oa=rr[--ir],rr[ir]=null,Ir=rr[--ir],rr[ir]=null,zr=rr[--ir],rr[ir]=null}function dw(o,u){rr[ir++]=zr,rr[ir++]=Ir,rr[ir++]=oa,zr=u.id,Ir=u.overflow,oa=o}var Xt=null,dt=null,Ke=!1,sa=null,ar=!1,Rp=Error(i(519));function ua(o){var u=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Os(nr(u,o)),Rp}function hw(o){var u=o.stateNode,h=o.type,v=o.memoizedProps;switch(u[Wt]=o,u[kn]=v,h){case"dialog":qe("cancel",u),qe("close",u);break;case"iframe":case"object":case"embed":qe("load",u);break;case"video":case"audio":for(h=0;h<Zs.length;h++)qe(Zs[h],u);break;case"source":qe("error",u);break;case"img":case"image":case"link":qe("error",u),qe("load",u);break;case"details":qe("toggle",u);break;case"input":qe("invalid",u),E2(u,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":qe("invalid",u);break;case"textarea":qe("invalid",u),N2(u,v.value,v.defaultValue,v.children)}h=v.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||v.suppressHydrationWarning===!0||Ak(u.textContent,h)?(v.popover!=null&&(qe("beforetoggle",u),qe("toggle",u)),v.onScroll!=null&&qe("scroll",u),v.onScrollEnd!=null&&qe("scrollend",u),v.onClick!=null&&(u.onclick=mi),u=!0):u=!1,u||ua(o,!0)}function mw(o){for(Xt=o.return;Xt;)switch(Xt.tag){case 5:case 31:case 13:ar=!1;return;case 27:case 3:ar=!0;return;default:Xt=Xt.return}}function to(o){if(o!==Xt)return!1;if(!Ke)return mw(o),Ke=!0,!1;var u=o.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||Jg(o.type,o.memoizedProps)),h=!h),h&&dt&&ua(o),mw(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(i(317));dt=$k(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(i(317));dt=$k(o)}else u===27?(u=dt,ka(o.type)?(o=iv,iv=null,dt=o):dt=u):dt=Xt?or(o.stateNode.nextSibling):null;return!0}function Za(){dt=Xt=null,Ke=!1}function Lp(){var o=sa;return o!==null&&(Nn===null?Nn=o:Nn.push.apply(Nn,o),sa=null),o}function Os(o){sa===null?sa=[o]:sa.push(o)}var zp=F(null),Qa=null,yi=null;function ca(o,u,h){ae(zp,u._currentValue),u._currentValue=h}function xi(o){o._currentValue=zp.current,X(zp)}function Ip(o,u,h){for(;o!==null;){var v=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,v!==null&&(v.childLanes|=u)):v!==null&&(v.childLanes&u)!==u&&(v.childLanes|=u),o===h)break;o=o.return}}function $p(o,u,h,v){var w=o.child;for(w!==null&&(w.return=o);w!==null;){var E=w.dependencies;if(E!==null){var M=w.child;E=E.firstContext;e:for(;E!==null;){var I=E;E=w;for(var V=0;V<u.length;V++)if(I.context===u[V]){E.lanes|=h,I=E.alternate,I!==null&&(I.lanes|=h),Ip(E.return,h,o),v||(M=null);break e}E=I.next}}else if(w.tag===18){if(M=w.return,M===null)throw Error(i(341));M.lanes|=h,E=M.alternate,E!==null&&(E.lanes|=h),Ip(M,h,o),M=null}else M=w.child;if(M!==null)M.return=w;else for(M=w;M!==null;){if(M===o){M=null;break}if(w=M.sibling,w!==null){w.return=M.return,M=w;break}M=M.return}w=M}}function no(o,u,h,v){o=null;for(var w=u,E=!1;w!==null;){if(!E){if((w.flags&524288)!==0)E=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var M=w.alternate;if(M===null)throw Error(i(387));if(M=M.memoizedProps,M!==null){var I=w.type;zn(w.pendingProps.value,M.value)||(o!==null?o.push(I):o=[I])}}else if(w===ce.current){if(M=w.alternate,M===null)throw Error(i(387));M.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(o!==null?o.push(nu):o=[nu])}w=w.return}o!==null&&$p(u,o,h,v),u.flags|=262144}function of(o){for(o=o.firstContext;o!==null;){if(!zn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ja(o){Qa=o,yi=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Zt(o){return pw(Qa,o)}function sf(o,u){return Qa===null&&Ja(o),pw(o,u)}function pw(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},yi===null){if(o===null)throw Error(i(308));yi=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else yi=yi.next=u;return h}var _R=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(h,v){o.push(v)}};this.abort=function(){u.aborted=!0,o.forEach(function(h){return h()})}},kR=e.unstable_scheduleCallback,SR=e.unstable_NormalPriority,Tt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bp(){return{controller:new _R,data:new Map,refCount:0}}function As(o){o.refCount--,o.refCount===0&&kR(SR,function(){o.controller.abort()})}var Ts=null,Fp=0,ro=0,io=null;function jR(o,u){if(Ts===null){var h=Ts=[];Fp=0,ro=Hg(),io={status:"pending",value:void 0,then:function(v){h.push(v)}}}return Fp++,u.then(gw,gw),u}function gw(){if(--Fp===0&&Ts!==null){io!==null&&(io.status="fulfilled");var o=Ts;Ts=null,ro=0,io=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function ER(o,u){var h=[],v={status:"pending",value:null,reason:null,then:function(w){h.push(w)}};return o.then(function(){v.status="fulfilled",v.value=u;for(var w=0;w<h.length;w++)(0,h[w])(u)},function(w){for(v.status="rejected",v.reason=w,w=0;w<h.length;w++)(0,h[w])(void 0)}),v}var vw=B.S;B.S=function(o,u){ek=De(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&jR(o,u),vw!==null&&vw(o,u)};var el=F(null);function Up(){var o=el.current;return o!==null?o:st.pooledCache}function uf(o,u){u===null?ae(el,el.current):ae(el,u.pool)}function yw(){var o=Up();return o===null?null:{parent:Tt._currentValue,pool:o}}var ao=Error(i(460)),qp=Error(i(474)),cf=Error(i(542)),ff={then:function(){}};function xw(o){return o=o.status,o==="fulfilled"||o==="rejected"}function bw(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(mi,mi),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,_w(o),o;default:if(typeof u.status=="string")u.then(mi,mi);else{if(o=st,o!==null&&100<o.shellSuspendCounter)throw Error(i(482));o=u,o.status="pending",o.then(function(v){if(u.status==="pending"){var w=u;w.status="fulfilled",w.value=v}},function(v){if(u.status==="pending"){var w=u;w.status="rejected",w.reason=v}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,_w(o),o}throw nl=u,ao}}function tl(o){try{var u=o._init;return u(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(nl=h,ao):h}}var nl=null;function ww(){if(nl===null)throw Error(i(459));var o=nl;return nl=null,o}function _w(o){if(o===ao||o===cf)throw Error(i(483))}var lo=null,Ms=0;function df(o){var u=Ms;return Ms+=1,lo===null&&(lo=[]),bw(lo,o,u)}function Ps(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function hf(o,u){throw u.$$typeof===y?Error(i(525)):(o=Object.prototype.toString.call(u),Error(i(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function kw(o){function u(Q,W){if(o){var te=Q.deletions;te===null?(Q.deletions=[W],Q.flags|=16):te.push(W)}}function h(Q,W){if(!o)return null;for(;W!==null;)u(Q,W),W=W.sibling;return null}function v(Q){for(var W=new Map;Q!==null;)Q.key!==null?W.set(Q.key,Q):W.set(Q.index,Q),Q=Q.sibling;return W}function w(Q,W){return Q=gi(Q,W),Q.index=0,Q.sibling=null,Q}function E(Q,W,te){return Q.index=te,o?(te=Q.alternate,te!==null?(te=te.index,te<W?(Q.flags|=67108866,W):te):(Q.flags|=67108866,W)):(Q.flags|=1048576,W)}function M(Q){return o&&Q.alternate===null&&(Q.flags|=67108866),Q}function I(Q,W,te,fe){return W===null||W.tag!==6?(W=Tp(te,Q.mode,fe),W.return=Q,W):(W=w(W,te),W.return=Q,W)}function V(Q,W,te,fe){var Te=te.type;return Te===S?ue(Q,W,te.props.children,fe,te.key):W!==null&&(W.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===R&&tl(Te)===W.type)?(W=w(W,te.props),Ps(W,te),W.return=Q,W):(W=af(te.type,te.key,te.props,null,Q.mode,fe),Ps(W,te),W.return=Q,W)}function ne(Q,W,te,fe){return W===null||W.tag!==4||W.stateNode.containerInfo!==te.containerInfo||W.stateNode.implementation!==te.implementation?(W=Mp(te,Q.mode,fe),W.return=Q,W):(W=w(W,te.children||[]),W.return=Q,W)}function ue(Q,W,te,fe,Te){return W===null||W.tag!==7?(W=Xa(te,Q.mode,fe,Te),W.return=Q,W):(W=w(W,te),W.return=Q,W)}function de(Q,W,te){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Tp(""+W,Q.mode,te),W.return=Q,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return te=af(W.type,W.key,W.props,null,Q.mode,te),Ps(te,W),te.return=Q,te;case _:return W=Mp(W,Q.mode,te),W.return=Q,W;case R:return W=tl(W),de(Q,W,te)}if(G(W)||q(W))return W=Xa(W,Q.mode,te,null),W.return=Q,W;if(typeof W.then=="function")return de(Q,df(W),te);if(W.$$typeof===N)return de(Q,sf(Q,W),te);hf(Q,W)}return null}function ie(Q,W,te,fe){var Te=W!==null?W.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Te!==null?null:I(Q,W,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return te.key===Te?V(Q,W,te,fe):null;case _:return te.key===Te?ne(Q,W,te,fe):null;case R:return te=tl(te),ie(Q,W,te,fe)}if(G(te)||q(te))return Te!==null?null:ue(Q,W,te,fe,null);if(typeof te.then=="function")return ie(Q,W,df(te),fe);if(te.$$typeof===N)return ie(Q,W,sf(Q,te),fe);hf(Q,te)}return null}function oe(Q,W,te,fe,Te){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Q=Q.get(te)||null,I(W,Q,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return Q=Q.get(fe.key===null?te:fe.key)||null,V(W,Q,fe,Te);case _:return Q=Q.get(fe.key===null?te:fe.key)||null,ne(W,Q,fe,Te);case R:return fe=tl(fe),oe(Q,W,te,fe,Te)}if(G(fe)||q(fe))return Q=Q.get(te)||null,ue(W,Q,fe,Te,null);if(typeof fe.then=="function")return oe(Q,W,te,df(fe),Te);if(fe.$$typeof===N)return oe(Q,W,te,sf(W,fe),Te);hf(W,fe)}return null}function ke(Q,W,te,fe){for(var Te=null,Ye=null,je=W,$e=W=0,Ge=null;je!==null&&$e<te.length;$e++){je.index>$e?(Ge=je,je=null):Ge=je.sibling;var We=ie(Q,je,te[$e],fe);if(We===null){je===null&&(je=Ge);break}o&&je&&We.alternate===null&&u(Q,je),W=E(We,W,$e),Ye===null?Te=We:Ye.sibling=We,Ye=We,je=Ge}if($e===te.length)return h(Q,je),Ke&&vi(Q,$e),Te;if(je===null){for(;$e<te.length;$e++)je=de(Q,te[$e],fe),je!==null&&(W=E(je,W,$e),Ye===null?Te=je:Ye.sibling=je,Ye=je);return Ke&&vi(Q,$e),Te}for(je=v(je);$e<te.length;$e++)Ge=oe(je,Q,$e,te[$e],fe),Ge!==null&&(o&&Ge.alternate!==null&&je.delete(Ge.key===null?$e:Ge.key),W=E(Ge,W,$e),Ye===null?Te=Ge:Ye.sibling=Ge,Ye=Ge);return o&&je.forEach(function(Na){return u(Q,Na)}),Ke&&vi(Q,$e),Te}function Pe(Q,W,te,fe){if(te==null)throw Error(i(151));for(var Te=null,Ye=null,je=W,$e=W=0,Ge=null,We=te.next();je!==null&&!We.done;$e++,We=te.next()){je.index>$e?(Ge=je,je=null):Ge=je.sibling;var Na=ie(Q,je,We.value,fe);if(Na===null){je===null&&(je=Ge);break}o&&je&&Na.alternate===null&&u(Q,je),W=E(Na,W,$e),Ye===null?Te=Na:Ye.sibling=Na,Ye=Na,je=Ge}if(We.done)return h(Q,je),Ke&&vi(Q,$e),Te;if(je===null){for(;!We.done;$e++,We=te.next())We=de(Q,We.value,fe),We!==null&&(W=E(We,W,$e),Ye===null?Te=We:Ye.sibling=We,Ye=We);return Ke&&vi(Q,$e),Te}for(je=v(je);!We.done;$e++,We=te.next())We=oe(je,Q,$e,We.value,fe),We!==null&&(o&&We.alternate!==null&&je.delete(We.key===null?$e:We.key),W=E(We,W,$e),Ye===null?Te=We:Ye.sibling=We,Ye=We);return o&&je.forEach(function(z9){return u(Q,z9)}),Ke&&vi(Q,$e),Te}function at(Q,W,te,fe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case x:e:{for(var Te=te.key;W!==null;){if(W.key===Te){if(Te=te.type,Te===S){if(W.tag===7){h(Q,W.sibling),fe=w(W,te.props.children),fe.return=Q,Q=fe;break e}}else if(W.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===R&&tl(Te)===W.type){h(Q,W.sibling),fe=w(W,te.props),Ps(fe,te),fe.return=Q,Q=fe;break e}h(Q,W);break}else u(Q,W);W=W.sibling}te.type===S?(fe=Xa(te.props.children,Q.mode,fe,te.key),fe.return=Q,Q=fe):(fe=af(te.type,te.key,te.props,null,Q.mode,fe),Ps(fe,te),fe.return=Q,Q=fe)}return M(Q);case _:e:{for(Te=te.key;W!==null;){if(W.key===Te)if(W.tag===4&&W.stateNode.containerInfo===te.containerInfo&&W.stateNode.implementation===te.implementation){h(Q,W.sibling),fe=w(W,te.children||[]),fe.return=Q,Q=fe;break e}else{h(Q,W);break}else u(Q,W);W=W.sibling}fe=Mp(te,Q.mode,fe),fe.return=Q,Q=fe}return M(Q);case R:return te=tl(te),at(Q,W,te,fe)}if(G(te))return ke(Q,W,te,fe);if(q(te)){if(Te=q(te),typeof Te!="function")throw Error(i(150));return te=Te.call(te),Pe(Q,W,te,fe)}if(typeof te.then=="function")return at(Q,W,df(te),fe);if(te.$$typeof===N)return at(Q,W,sf(Q,te),fe);hf(Q,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,W!==null&&W.tag===6?(h(Q,W.sibling),fe=w(W,te),fe.return=Q,Q=fe):(h(Q,W),fe=Tp(te,Q.mode,fe),fe.return=Q,Q=fe),M(Q)):h(Q,W)}return function(Q,W,te,fe){try{Ms=0;var Te=at(Q,W,te,fe);return lo=null,Te}catch(je){if(je===ao||je===cf)throw je;var Ye=In(29,je,null,Q.mode);return Ye.lanes=fe,Ye.return=Q,Ye}finally{}}}var rl=kw(!0),Sw=kw(!1),fa=!1;function Hp(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gp(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function da(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ha(o,u,h){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(Qe&2)!==0){var w=v.pending;return w===null?u.next=u:(u.next=w.next,w.next=u),v.pending=u,u=rf(o),ow(o,null,h),u}return nf(o,v,u,h),rf(o)}function Ds(o,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var v=u.lanes;v&=o.pendingLanes,h|=v,u.lanes=h,p2(o,h)}}function Kp(o,u){var h=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var w=null,E=null;if(h=h.firstBaseUpdate,h!==null){do{var M={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};E===null?w=E=M:E=E.next=M,h=h.next}while(h!==null);E===null?w=E=u:E=E.next=u}else w=E=u;h={baseState:v.baseState,firstBaseUpdate:w,lastBaseUpdate:E,shared:v.shared,callbacks:v.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=u}var Vp=!1;function Rs(){if(Vp){var o=io;if(o!==null)throw o}}function Ls(o,u,h,v){Vp=!1;var w=o.updateQueue;fa=!1;var E=w.firstBaseUpdate,M=w.lastBaseUpdate,I=w.shared.pending;if(I!==null){w.shared.pending=null;var V=I,ne=V.next;V.next=null,M===null?E=ne:M.next=ne,M=V;var ue=o.alternate;ue!==null&&(ue=ue.updateQueue,I=ue.lastBaseUpdate,I!==M&&(I===null?ue.firstBaseUpdate=ne:I.next=ne,ue.lastBaseUpdate=V))}if(E!==null){var de=w.baseState;M=0,ue=ne=V=null,I=E;do{var ie=I.lane&-536870913,oe=ie!==I.lane;if(oe?(He&ie)===ie:(v&ie)===ie){ie!==0&&ie===ro&&(Vp=!0),ue!==null&&(ue=ue.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var ke=o,Pe=I;ie=u;var at=h;switch(Pe.tag){case 1:if(ke=Pe.payload,typeof ke=="function"){de=ke.call(at,de,ie);break e}de=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Pe.payload,ie=typeof ke=="function"?ke.call(at,de,ie):ke,ie==null)break e;de=p({},de,ie);break e;case 2:fa=!0}}ie=I.callback,ie!==null&&(o.flags|=64,oe&&(o.flags|=8192),oe=w.callbacks,oe===null?w.callbacks=[ie]:oe.push(ie))}else oe={lane:ie,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ue===null?(ne=ue=oe,V=de):ue=ue.next=oe,M|=ie;if(I=I.next,I===null){if(I=w.shared.pending,I===null)break;oe=I,I=oe.next,oe.next=null,w.lastBaseUpdate=oe,w.shared.pending=null}}while(!0);ue===null&&(V=de),w.baseState=V,w.firstBaseUpdate=ne,w.lastBaseUpdate=ue,E===null&&(w.shared.lanes=0),ya|=M,o.lanes=M,o.memoizedState=de}}function jw(o,u){if(typeof o!="function")throw Error(i(191,o));o.call(u)}function Ew(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)jw(h[o],u)}var oo=F(null),mf=F(0);function Cw(o,u){o=Ni,ae(mf,o),ae(oo,u),Ni=o|u.baseLanes}function Yp(){ae(mf,Ni),ae(oo,oo.current)}function Wp(){Ni=mf.current,X(oo),X(mf)}var $n=F(null),lr=null;function ma(o){var u=o.alternate;ae(Ct,Ct.current&1),ae($n,o),lr===null&&(u===null||oo.current!==null||u.memoizedState!==null)&&(lr=o)}function Xp(o){ae(Ct,Ct.current),ae($n,o),lr===null&&(lr=o)}function Nw(o){o.tag===22?(ae(Ct,Ct.current),ae($n,o),lr===null&&(lr=o)):pa()}function pa(){ae(Ct,Ct.current),ae($n,$n.current)}function Bn(o){X($n),lr===o&&(lr=null),X(Ct)}var Ct=F(0);function pf(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||nv(h)||rv(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var bi=0,Ie=null,rt=null,Mt=null,gf=!1,so=!1,il=!1,vf=0,zs=0,uo=null,CR=0;function kt(){throw Error(i(321))}function Zp(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!zn(o[h],u[h]))return!1;return!0}function Qp(o,u,h,v,w,E){return bi=E,Ie=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,B.H=o===null||o.memoizedState===null?f_:hg,il=!1,E=h(v,w),il=!1,so&&(E=Aw(u,h,v,w)),Ow(o),E}function Ow(o){B.H=Bs;var u=rt!==null&&rt.next!==null;if(bi=0,Mt=rt=Ie=null,gf=!1,zs=0,uo=null,u)throw Error(i(300));o===null||Pt||(o=o.dependencies,o!==null&&of(o)&&(Pt=!0))}function Aw(o,u,h,v){Ie=o;var w=0;do{if(so&&(uo=null),zs=0,so=!1,25<=w)throw Error(i(301));if(w+=1,Mt=rt=null,o.updateQueue!=null){var E=o.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}B.H=d_,E=u(h,v)}while(so);return E}function NR(){var o=B.H,u=o.useState()[0];return u=typeof u.then=="function"?Is(u):u,o=o.useState()[0],(rt!==null?rt.memoizedState:null)!==o&&(Ie.flags|=1024),u}function Jp(){var o=vf!==0;return vf=0,o}function eg(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function tg(o){if(gf){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}gf=!1}bi=0,Mt=rt=Ie=null,so=!1,zs=vf=0,uo=null}function mn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Ie.memoizedState=Mt=o:Mt=Mt.next=o,Mt}function Nt(){if(rt===null){var o=Ie.alternate;o=o!==null?o.memoizedState:null}else o=rt.next;var u=Mt===null?Ie.memoizedState:Mt.next;if(u!==null)Mt=u,rt=o;else{if(o===null)throw Ie.alternate===null?Error(i(467)):Error(i(310));rt=o,o={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Mt===null?Ie.memoizedState=Mt=o:Mt=Mt.next=o}return Mt}function yf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Is(o){var u=zs;return zs+=1,uo===null&&(uo=[]),o=bw(uo,o,u),u=Ie,(Mt===null?u.memoizedState:Mt.next)===null&&(u=u.alternate,B.H=u===null||u.memoizedState===null?f_:hg),o}function xf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Is(o);if(o.$$typeof===N)return Zt(o)}throw Error(i(438,String(o)))}function ng(o){var u=null,h=Ie.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var v=Ie.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(u={data:v.data.map(function(w){return w.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=yf(),Ie.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(o),v=0;v<o;v++)h[v]=D;return u.index++,h}function wi(o,u){return typeof u=="function"?u(o):u}function bf(o){var u=Nt();return rg(u,rt,o)}function rg(o,u,h){var v=o.queue;if(v===null)throw Error(i(311));v.lastRenderedReducer=h;var w=o.baseQueue,E=v.pending;if(E!==null){if(w!==null){var M=w.next;w.next=E.next,E.next=M}u.baseQueue=w=E,v.pending=null}if(E=o.baseState,w===null)o.memoizedState=E;else{u=w.next;var I=M=null,V=null,ne=u,ue=!1;do{var de=ne.lane&-536870913;if(de!==ne.lane?(He&de)===de:(bi&de)===de){var ie=ne.revertLane;if(ie===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),de===ro&&(ue=!0);else if((bi&ie)===ie){ne=ne.next,ie===ro&&(ue=!0);continue}else de={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},V===null?(I=V=de,M=E):V=V.next=de,Ie.lanes|=ie,ya|=ie;de=ne.action,il&&h(E,de),E=ne.hasEagerState?ne.eagerState:h(E,de)}else ie={lane:de,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},V===null?(I=V=ie,M=E):V=V.next=ie,Ie.lanes|=de,ya|=de;ne=ne.next}while(ne!==null&&ne!==u);if(V===null?M=E:V.next=I,!zn(E,o.memoizedState)&&(Pt=!0,ue&&(h=io,h!==null)))throw h;o.memoizedState=E,o.baseState=M,o.baseQueue=V,v.lastRenderedState=E}return w===null&&(v.lanes=0),[o.memoizedState,v.dispatch]}function ig(o){var u=Nt(),h=u.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=o;var v=h.dispatch,w=h.pending,E=u.memoizedState;if(w!==null){h.pending=null;var M=w=w.next;do E=o(E,M.action),M=M.next;while(M!==w);zn(E,u.memoizedState)||(Pt=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),h.lastRenderedState=E}return[E,v]}function Tw(o,u,h){var v=Ie,w=Nt(),E=Ke;if(E){if(h===void 0)throw Error(i(407));h=h()}else h=u();var M=!zn((rt||w).memoizedState,h);if(M&&(w.memoizedState=h,Pt=!0),w=w.queue,og(Dw.bind(null,v,w,o),[o]),w.getSnapshot!==u||M||Mt!==null&&Mt.memoizedState.tag&1){if(v.flags|=2048,co(9,{destroy:void 0},Pw.bind(null,v,w,h,u),null),st===null)throw Error(i(349));E||(bi&127)!==0||Mw(v,u,h)}return h}function Mw(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=Ie.updateQueue,u===null?(u=yf(),Ie.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function Pw(o,u,h,v){u.value=h,u.getSnapshot=v,Rw(u)&&Lw(o)}function Dw(o,u,h){return h(function(){Rw(u)&&Lw(o)})}function Rw(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!zn(o,h)}catch{return!0}}function Lw(o){var u=Wa(o,2);u!==null&&On(u,o,2)}function ag(o){var u=mn();if(typeof o=="function"){var h=o;if(o=h(),il){ia(!0);try{h()}finally{ia(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:o},u}function zw(o,u,h,v){return o.baseState=h,rg(o,rt,typeof v=="function"?v:wi)}function OR(o,u,h,v,w){if(kf(o))throw Error(i(485));if(o=u.action,o!==null){var E={payload:w,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){E.listeners.push(M)}};B.T!==null?h(!0):E.isTransition=!1,v(E),h=u.pending,h===null?(E.next=u.pending=E,Iw(u,E)):(E.next=h.next,u.pending=h.next=E)}}function Iw(o,u){var h=u.action,v=u.payload,w=o.state;if(u.isTransition){var E=B.T,M={};B.T=M;try{var I=h(w,v),V=B.S;V!==null&&V(M,I),$w(o,u,I)}catch(ne){lg(o,u,ne)}finally{E!==null&&M.types!==null&&(E.types=M.types),B.T=E}}else try{E=h(w,v),$w(o,u,E)}catch(ne){lg(o,u,ne)}}function $w(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(v){Bw(o,u,v)},function(v){return lg(o,u,v)}):Bw(o,u,h)}function Bw(o,u,h){u.status="fulfilled",u.value=h,Fw(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,Iw(o,h)))}function lg(o,u,h){var v=o.pending;if(o.pending=null,v!==null){v=v.next;do u.status="rejected",u.reason=h,Fw(u),u=u.next;while(u!==v)}o.action=null}function Fw(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function Uw(o,u){return u}function qw(o,u){if(Ke){var h=st.formState;if(h!==null){e:{var v=Ie;if(Ke){if(dt){t:{for(var w=dt,E=ar;w.nodeType!==8;){if(!E){w=null;break t}if(w=or(w.nextSibling),w===null){w=null;break t}}E=w.data,w=E==="F!"||E==="F"?w:null}if(w){dt=or(w.nextSibling),v=w.data==="F!";break e}}ua(v)}v=!1}v&&(u=h[0])}}return h=mn(),h.memoizedState=h.baseState=u,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uw,lastRenderedState:u},h.queue=v,h=s_.bind(null,Ie,v),v.dispatch=h,v=ag(!1),E=dg.bind(null,Ie,!1,v.queue),v=mn(),w={state:u,dispatch:null,action:o,pending:null},v.queue=w,h=OR.bind(null,Ie,w,E,h),w.dispatch=h,v.memoizedState=o,[u,h,!1]}function Hw(o){var u=Nt();return Gw(u,rt,o)}function Gw(o,u,h){if(u=rg(o,u,Uw)[0],o=bf(wi)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var v=Is(u)}catch(M){throw M===ao?cf:M}else v=u;u=Nt();var w=u.queue,E=w.dispatch;return h!==u.memoizedState&&(Ie.flags|=2048,co(9,{destroy:void 0},AR.bind(null,w,h),null)),[v,E,o]}function AR(o,u){o.action=u}function Kw(o){var u=Nt(),h=rt;if(h!==null)return Gw(u,h,o);Nt(),u=u.memoizedState,h=Nt();var v=h.queue.dispatch;return h.memoizedState=o,[u,v,!1]}function co(o,u,h,v){return o={tag:o,create:h,deps:v,inst:u,next:null},u=Ie.updateQueue,u===null&&(u=yf(),Ie.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=o.next=o:(v=h.next,h.next=o,o.next=v,u.lastEffect=o),o}function Vw(){return Nt().memoizedState}function wf(o,u,h,v){var w=mn();Ie.flags|=o,w.memoizedState=co(1|u,{destroy:void 0},h,v===void 0?null:v)}function _f(o,u,h,v){var w=Nt();v=v===void 0?null:v;var E=w.memoizedState.inst;rt!==null&&v!==null&&Zp(v,rt.memoizedState.deps)?w.memoizedState=co(u,E,h,v):(Ie.flags|=o,w.memoizedState=co(1|u,E,h,v))}function Yw(o,u){wf(8390656,8,o,u)}function og(o,u){_f(2048,8,o,u)}function TR(o){Ie.flags|=4;var u=Ie.updateQueue;if(u===null)u=yf(),Ie.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function Ww(o){var u=Nt().memoizedState;return TR({ref:u,nextImpl:o}),function(){if((Qe&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}function Xw(o,u){return _f(4,2,o,u)}function Zw(o,u){return _f(4,4,o,u)}function Qw(o,u){if(typeof u=="function"){o=o();var h=u(o);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function Jw(o,u,h){h=h!=null?h.concat([o]):null,_f(4,4,Qw.bind(null,u,o),h)}function sg(){}function e_(o,u){var h=Nt();u=u===void 0?null:u;var v=h.memoizedState;return u!==null&&Zp(u,v[1])?v[0]:(h.memoizedState=[o,u],o)}function t_(o,u){var h=Nt();u=u===void 0?null:u;var v=h.memoizedState;if(u!==null&&Zp(u,v[1]))return v[0];if(v=o(),il){ia(!0);try{o()}finally{ia(!1)}}return h.memoizedState=[v,u],v}function ug(o,u,h){return h===void 0||(bi&1073741824)!==0&&(He&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=nk(),Ie.lanes|=o,ya|=o,h)}function n_(o,u,h,v){return zn(h,u)?h:oo.current!==null?(o=ug(o,h,v),zn(o,u)||(Pt=!0),o):(bi&42)===0||(bi&1073741824)!==0&&(He&261930)===0?(Pt=!0,o.memoizedState=h):(o=nk(),Ie.lanes|=o,ya|=o,u)}function r_(o,u,h,v,w){var E=Y.p;Y.p=E!==0&&8>E?E:8;var M=B.T,I={};B.T=I,dg(o,!1,u,h);try{var V=w(),ne=B.S;if(ne!==null&&ne(I,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ue=ER(V,v);$s(o,u,ue,qn(o))}else $s(o,u,v,qn(o))}catch(de){$s(o,u,{then:function(){},status:"rejected",reason:de},qn())}finally{Y.p=E,M!==null&&I.types!==null&&(M.types=I.types),B.T=M}}function MR(){}function cg(o,u,h,v){if(o.tag!==5)throw Error(i(476));var w=i_(o).queue;r_(o,w,u,ee,h===null?MR:function(){return a_(o),h(v)})}function i_(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:ee},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function a_(o){var u=i_(o);u.next===null&&(u=o.alternate.memoizedState),$s(o,u.next.queue,{},qn())}function fg(){return Zt(nu)}function l_(){return Nt().memoizedState}function o_(){return Nt().memoizedState}function PR(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=qn();o=da(h);var v=ha(u,o,h);v!==null&&(On(v,u,h),Ds(v,u,h)),u={cache:Bp()},o.payload=u;return}u=u.return}}function DR(o,u,h){var v=qn();h={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},kf(o)?u_(u,h):(h=Op(o,u,h,v),h!==null&&(On(h,o,v),c_(h,u,v)))}function s_(o,u,h){var v=qn();$s(o,u,h,v)}function $s(o,u,h,v){var w={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(kf(o))u_(u,w);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var M=u.lastRenderedState,I=E(M,h);if(w.hasEagerState=!0,w.eagerState=I,zn(I,M))return nf(o,u,w,0),st===null&&tf(),!1}catch{}finally{}if(h=Op(o,u,w,v),h!==null)return On(h,o,v),c_(h,u,v),!0}return!1}function dg(o,u,h,v){if(v={lane:2,revertLane:Hg(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},kf(o)){if(u)throw Error(i(479))}else u=Op(o,h,v,2),u!==null&&On(u,o,2)}function kf(o){var u=o.alternate;return o===Ie||u!==null&&u===Ie}function u_(o,u){so=gf=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function c_(o,u,h){if((h&4194048)!==0){var v=u.lanes;v&=o.pendingLanes,h|=v,u.lanes=h,p2(o,h)}}var Bs={readContext:Zt,use:xf,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};Bs.useEffectEvent=kt;var f_={readContext:Zt,use:xf,useCallback:function(o,u){return mn().memoizedState=[o,u===void 0?null:u],o},useContext:Zt,useEffect:Yw,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,wf(4194308,4,Qw.bind(null,u,o),h)},useLayoutEffect:function(o,u){return wf(4194308,4,o,u)},useInsertionEffect:function(o,u){wf(4,2,o,u)},useMemo:function(o,u){var h=mn();u=u===void 0?null:u;var v=o();if(il){ia(!0);try{o()}finally{ia(!1)}}return h.memoizedState=[v,u],v},useReducer:function(o,u,h){var v=mn();if(h!==void 0){var w=h(u);if(il){ia(!0);try{h(u)}finally{ia(!1)}}}else w=u;return v.memoizedState=v.baseState=w,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:w},v.queue=o,o=o.dispatch=DR.bind(null,Ie,o),[v.memoizedState,o]},useRef:function(o){var u=mn();return o={current:o},u.memoizedState=o},useState:function(o){o=ag(o);var u=o.queue,h=s_.bind(null,Ie,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:sg,useDeferredValue:function(o,u){var h=mn();return ug(h,o,u)},useTransition:function(){var o=ag(!1);return o=r_.bind(null,Ie,o.queue,!0,!1),mn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var v=Ie,w=mn();if(Ke){if(h===void 0)throw Error(i(407));h=h()}else{if(h=u(),st===null)throw Error(i(349));(He&127)!==0||Mw(v,u,h)}w.memoizedState=h;var E={value:h,getSnapshot:u};return w.queue=E,Yw(Dw.bind(null,v,E,o),[o]),v.flags|=2048,co(9,{destroy:void 0},Pw.bind(null,v,E,h,u),null),h},useId:function(){var o=mn(),u=st.identifierPrefix;if(Ke){var h=Ir,v=zr;h=(v&~(1<<32-Ln(v)-1)).toString(32)+h,u="_"+u+"R_"+h,h=vf++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=CR++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:fg,useFormState:qw,useActionState:qw,useOptimistic:function(o){var u=mn();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=dg.bind(null,Ie,!0,h),h.dispatch=u,[o,u]},useMemoCache:ng,useCacheRefresh:function(){return mn().memoizedState=PR.bind(null,Ie)},useEffectEvent:function(o){var u=mn(),h={impl:o};return u.memoizedState=h,function(){if((Qe&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}},hg={readContext:Zt,use:xf,useCallback:e_,useContext:Zt,useEffect:og,useImperativeHandle:Jw,useInsertionEffect:Xw,useLayoutEffect:Zw,useMemo:t_,useReducer:bf,useRef:Vw,useState:function(){return bf(wi)},useDebugValue:sg,useDeferredValue:function(o,u){var h=Nt();return n_(h,rt.memoizedState,o,u)},useTransition:function(){var o=bf(wi)[0],u=Nt().memoizedState;return[typeof o=="boolean"?o:Is(o),u]},useSyncExternalStore:Tw,useId:l_,useHostTransitionStatus:fg,useFormState:Hw,useActionState:Hw,useOptimistic:function(o,u){var h=Nt();return zw(h,rt,o,u)},useMemoCache:ng,useCacheRefresh:o_};hg.useEffectEvent=Ww;var d_={readContext:Zt,use:xf,useCallback:e_,useContext:Zt,useEffect:og,useImperativeHandle:Jw,useInsertionEffect:Xw,useLayoutEffect:Zw,useMemo:t_,useReducer:ig,useRef:Vw,useState:function(){return ig(wi)},useDebugValue:sg,useDeferredValue:function(o,u){var h=Nt();return rt===null?ug(h,o,u):n_(h,rt.memoizedState,o,u)},useTransition:function(){var o=ig(wi)[0],u=Nt().memoizedState;return[typeof o=="boolean"?o:Is(o),u]},useSyncExternalStore:Tw,useId:l_,useHostTransitionStatus:fg,useFormState:Kw,useActionState:Kw,useOptimistic:function(o,u){var h=Nt();return rt!==null?zw(h,rt,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:ng,useCacheRefresh:o_};d_.useEffectEvent=Ww;function mg(o,u,h,v){u=o.memoizedState,h=h(v,u),h=h==null?u:p({},u,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var pg={enqueueSetState:function(o,u,h){o=o._reactInternals;var v=qn(),w=da(v);w.payload=u,h!=null&&(w.callback=h),u=ha(o,w,v),u!==null&&(On(u,o,v),Ds(u,o,v))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var v=qn(),w=da(v);w.tag=1,w.payload=u,h!=null&&(w.callback=h),u=ha(o,w,v),u!==null&&(On(u,o,v),Ds(u,o,v))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=qn(),v=da(h);v.tag=2,u!=null&&(v.callback=u),u=ha(o,v,h),u!==null&&(On(u,o,h),Ds(u,o,h))}};function h_(o,u,h,v,w,E,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(v,E,M):u.prototype&&u.prototype.isPureReactComponent?!Es(h,v)||!Es(w,E):!0}function m_(o,u,h,v){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,v),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,v),u.state!==o&&pg.enqueueReplaceState(u,u.state,null)}function al(o,u){var h=u;if("ref"in u){h={};for(var v in u)v!=="ref"&&(h[v]=u[v])}if(o=o.defaultProps){h===u&&(h=p({},h));for(var w in o)h[w]===void 0&&(h[w]=o[w])}return h}function p_(o){ef(o)}function g_(o){console.error(o)}function v_(o){ef(o)}function Sf(o,u){try{var h=o.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(v){setTimeout(function(){throw v})}}function y_(o,u,h){try{var v=o.onCaughtError;v(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function gg(o,u,h){return h=da(h),h.tag=3,h.payload={element:null},h.callback=function(){Sf(o,u)},h}function x_(o){return o=da(o),o.tag=3,o}function b_(o,u,h,v){var w=h.type.getDerivedStateFromError;if(typeof w=="function"){var E=v.value;o.payload=function(){return w(E)},o.callback=function(){y_(u,h,v)}}var M=h.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(o.callback=function(){y_(u,h,v),typeof w!="function"&&(xa===null?xa=new Set([this]):xa.add(this));var I=v.stack;this.componentDidCatch(v.value,{componentStack:I!==null?I:""})})}function RR(o,u,h,v,w){if(h.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(u=h.alternate,u!==null&&no(u,h,w,!0),h=$n.current,h!==null){switch(h.tag){case 31:case 13:return lr===null?Lf():h.alternate===null&&St===0&&(St=3),h.flags&=-257,h.flags|=65536,h.lanes=w,v===ff?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([v]):u.add(v),Fg(o,v,w)),!1;case 22:return h.flags|=65536,v===ff?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([v])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([v]):h.add(v)),Fg(o,v,w)),!1}throw Error(i(435,h.tag))}return Fg(o,v,w),Lf(),!1}if(Ke)return u=$n.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=w,v!==Rp&&(o=Error(i(422),{cause:v}),Os(nr(o,h)))):(v!==Rp&&(u=Error(i(423),{cause:v}),Os(nr(u,h))),o=o.current.alternate,o.flags|=65536,w&=-w,o.lanes|=w,v=nr(v,h),w=gg(o.stateNode,v,w),Kp(o,w),St!==4&&(St=2)),!1;var E=Error(i(520),{cause:v});if(E=nr(E,h),Ys===null?Ys=[E]:Ys.push(E),St!==4&&(St=2),u===null)return!0;v=nr(v,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=w&-w,h.lanes|=o,o=gg(h.stateNode,v,o),Kp(h,o),!1;case 1:if(u=h.type,E=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(xa===null||!xa.has(E))))return h.flags|=65536,w&=-w,h.lanes|=w,w=x_(w),b_(w,o,h,v),Kp(h,w),!1}h=h.return}while(h!==null);return!1}var vg=Error(i(461)),Pt=!1;function Qt(o,u,h,v){u.child=o===null?Sw(u,null,h,v):rl(u,o.child,h,v)}function w_(o,u,h,v,w){h=h.render;var E=u.ref;if("ref"in v){var M={};for(var I in v)I!=="ref"&&(M[I]=v[I])}else M=v;return Ja(u),v=Qp(o,u,h,M,E,w),I=Jp(),o!==null&&!Pt?(eg(o,u,w),_i(o,u,w)):(Ke&&I&&Pp(u),u.flags|=1,Qt(o,u,v,w),u.child)}function __(o,u,h,v,w){if(o===null){var E=h.type;return typeof E=="function"&&!Ap(E)&&E.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=E,k_(o,u,E,v,w)):(o=af(h.type,null,v,u,u.mode,w),o.ref=u.ref,o.return=u,u.child=o)}if(E=o.child,!jg(o,w)){var M=E.memoizedProps;if(h=h.compare,h=h!==null?h:Es,h(M,v)&&o.ref===u.ref)return _i(o,u,w)}return u.flags|=1,o=gi(E,v),o.ref=u.ref,o.return=u,u.child=o}function k_(o,u,h,v,w){if(o!==null){var E=o.memoizedProps;if(Es(E,v)&&o.ref===u.ref)if(Pt=!1,u.pendingProps=v=E,jg(o,w))(o.flags&131072)!==0&&(Pt=!0);else return u.lanes=o.lanes,_i(o,u,w)}return yg(o,u,h,v,w)}function S_(o,u,h,v){var w=v.children,E=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((u.flags&128)!==0){if(E=E!==null?E.baseLanes|h:h,o!==null){for(v=u.child=o.child,w=0;v!==null;)w=w|v.lanes|v.childLanes,v=v.sibling;v=w&~E}else v=0,u.child=null;return j_(o,u,E,h,v)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&uf(u,E!==null?E.cachePool:null),E!==null?Cw(u,E):Yp(),Nw(u);else return v=u.lanes=536870912,j_(o,u,E!==null?E.baseLanes|h:h,h,v)}else E!==null?(uf(u,E.cachePool),Cw(u,E),pa(),u.memoizedState=null):(o!==null&&uf(u,null),Yp(),pa());return Qt(o,u,w,h),u.child}function Fs(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function j_(o,u,h,v,w){var E=Up();return E=E===null?null:{parent:Tt._currentValue,pool:E},u.memoizedState={baseLanes:h,cachePool:E},o!==null&&uf(u,null),Yp(),Nw(u),o!==null&&no(o,u,v,!0),u.childLanes=w,null}function jf(o,u){return u=Cf({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function E_(o,u,h){return rl(u,o.child,null,h),o=jf(u,u.pendingProps),o.flags|=2,Bn(u),u.memoizedState=null,o}function LR(o,u,h){var v=u.pendingProps,w=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(Ke){if(v.mode==="hidden")return o=jf(u,v),u.lanes=536870912,Fs(null,o);if(Xp(u),(o=dt)?(o=Ik(o,ar),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:oa!==null?{id:zr,overflow:Ir}:null,retryLane:536870912,hydrationErrors:null},h=uw(o),h.return=u,u.child=h,Xt=u,dt=null)):o=null,o===null)throw ua(u);return u.lanes=536870912,null}return jf(u,v)}var E=o.memoizedState;if(E!==null){var M=E.dehydrated;if(Xp(u),w)if(u.flags&256)u.flags&=-257,u=E_(o,u,h);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(i(558));else if(Pt||no(o,u,h,!1),w=(h&o.childLanes)!==0,Pt||w){if(v=st,v!==null&&(M=g2(v,h),M!==0&&M!==E.retryLane))throw E.retryLane=M,Wa(o,M),On(v,o,M),vg;Lf(),u=E_(o,u,h)}else o=E.treeContext,dt=or(M.nextSibling),Xt=u,Ke=!0,sa=null,ar=!1,o!==null&&dw(u,o),u=jf(u,v),u.flags|=4096;return u}return o=gi(o.child,{mode:v.mode,children:v.children}),o.ref=u.ref,u.child=o,o.return=u,o}function Ef(o,u){var h=u.ref;if(h===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(i(284));(o===null||o.ref!==h)&&(u.flags|=4194816)}}function yg(o,u,h,v,w){return Ja(u),h=Qp(o,u,h,v,void 0,w),v=Jp(),o!==null&&!Pt?(eg(o,u,w),_i(o,u,w)):(Ke&&v&&Pp(u),u.flags|=1,Qt(o,u,h,w),u.child)}function C_(o,u,h,v,w,E){return Ja(u),u.updateQueue=null,h=Aw(u,v,h,w),Ow(o),v=Jp(),o!==null&&!Pt?(eg(o,u,E),_i(o,u,E)):(Ke&&v&&Pp(u),u.flags|=1,Qt(o,u,h,E),u.child)}function N_(o,u,h,v,w){if(Ja(u),u.stateNode===null){var E=Ql,M=h.contextType;typeof M=="object"&&M!==null&&(E=Zt(M)),E=new h(v,E),u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=pg,u.stateNode=E,E._reactInternals=u,E=u.stateNode,E.props=v,E.state=u.memoizedState,E.refs={},Hp(u),M=h.contextType,E.context=typeof M=="object"&&M!==null?Zt(M):Ql,E.state=u.memoizedState,M=h.getDerivedStateFromProps,typeof M=="function"&&(mg(u,h,M,v),E.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(M=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),M!==E.state&&pg.enqueueReplaceState(E,E.state,null),Ls(u,v,E,w),Rs(),E.state=u.memoizedState),typeof E.componentDidMount=="function"&&(u.flags|=4194308),v=!0}else if(o===null){E=u.stateNode;var I=u.memoizedProps,V=al(h,I);E.props=V;var ne=E.context,ue=h.contextType;M=Ql,typeof ue=="object"&&ue!==null&&(M=Zt(ue));var de=h.getDerivedStateFromProps;ue=typeof de=="function"||typeof E.getSnapshotBeforeUpdate=="function",I=u.pendingProps!==I,ue||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(I||ne!==M)&&m_(u,E,v,M),fa=!1;var ie=u.memoizedState;E.state=ie,Ls(u,v,E,w),Rs(),ne=u.memoizedState,I||ie!==ne||fa?(typeof de=="function"&&(mg(u,h,de,v),ne=u.memoizedState),(V=fa||h_(u,h,V,v,ie,ne,M))?(ue||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(u.flags|=4194308)):(typeof E.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=v,u.memoizedState=ne),E.props=v,E.state=ne,E.context=M,v=V):(typeof E.componentDidMount=="function"&&(u.flags|=4194308),v=!1)}else{E=u.stateNode,Gp(o,u),M=u.memoizedProps,ue=al(h,M),E.props=ue,de=u.pendingProps,ie=E.context,ne=h.contextType,V=Ql,typeof ne=="object"&&ne!==null&&(V=Zt(ne)),I=h.getDerivedStateFromProps,(ne=typeof I=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==de||ie!==V)&&m_(u,E,v,V),fa=!1,ie=u.memoizedState,E.state=ie,Ls(u,v,E,w),Rs();var oe=u.memoizedState;M!==de||ie!==oe||fa||o!==null&&o.dependencies!==null&&of(o.dependencies)?(typeof I=="function"&&(mg(u,h,I,v),oe=u.memoizedState),(ue=fa||h_(u,h,ue,v,ie,oe,V)||o!==null&&o.dependencies!==null&&of(o.dependencies))?(ne||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(v,oe,V),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(v,oe,V)),typeof E.componentDidUpdate=="function"&&(u.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof E.componentDidUpdate!="function"||M===o.memoizedProps&&ie===o.memoizedState||(u.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&ie===o.memoizedState||(u.flags|=1024),u.memoizedProps=v,u.memoizedState=oe),E.props=v,E.state=oe,E.context=V,v=ue):(typeof E.componentDidUpdate!="function"||M===o.memoizedProps&&ie===o.memoizedState||(u.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&ie===o.memoizedState||(u.flags|=1024),v=!1)}return E=v,Ef(o,u),v=(u.flags&128)!==0,E||v?(E=u.stateNode,h=v&&typeof h.getDerivedStateFromError!="function"?null:E.render(),u.flags|=1,o!==null&&v?(u.child=rl(u,o.child,null,w),u.child=rl(u,null,h,w)):Qt(o,u,h,w),u.memoizedState=E.state,o=u.child):o=_i(o,u,w),o}function O_(o,u,h,v){return Za(),u.flags|=256,Qt(o,u,h,v),u.child}var xg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bg(o){return{baseLanes:o,cachePool:yw()}}function wg(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=Un),o}function A_(o,u,h){var v=u.pendingProps,w=!1,E=(u.flags&128)!==0,M;if((M=E)||(M=o!==null&&o.memoizedState===null?!1:(Ct.current&2)!==0),M&&(w=!0,u.flags&=-129),M=(u.flags&32)!==0,u.flags&=-33,o===null){if(Ke){if(w?ma(u):pa(),(o=dt)?(o=Ik(o,ar),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:oa!==null?{id:zr,overflow:Ir}:null,retryLane:536870912,hydrationErrors:null},h=uw(o),h.return=u,u.child=h,Xt=u,dt=null)):o=null,o===null)throw ua(u);return rv(o)?u.lanes=32:u.lanes=536870912,null}var I=v.children;return v=v.fallback,w?(pa(),w=u.mode,I=Cf({mode:"hidden",children:I},w),v=Xa(v,w,h,null),I.return=u,v.return=u,I.sibling=v,u.child=I,v=u.child,v.memoizedState=bg(h),v.childLanes=wg(o,M,h),u.memoizedState=xg,Fs(null,v)):(ma(u),_g(u,I))}var V=o.memoizedState;if(V!==null&&(I=V.dehydrated,I!==null)){if(E)u.flags&256?(ma(u),u.flags&=-257,u=kg(o,u,h)):u.memoizedState!==null?(pa(),u.child=o.child,u.flags|=128,u=null):(pa(),I=v.fallback,w=u.mode,v=Cf({mode:"visible",children:v.children},w),I=Xa(I,w,h,null),I.flags|=2,v.return=u,I.return=u,v.sibling=I,u.child=v,rl(u,o.child,null,h),v=u.child,v.memoizedState=bg(h),v.childLanes=wg(o,M,h),u.memoizedState=xg,u=Fs(null,v));else if(ma(u),rv(I)){if(M=I.nextSibling&&I.nextSibling.dataset,M)var ne=M.dgst;M=ne,v=Error(i(419)),v.stack="",v.digest=M,Os({value:v,source:null,stack:null}),u=kg(o,u,h)}else if(Pt||no(o,u,h,!1),M=(h&o.childLanes)!==0,Pt||M){if(M=st,M!==null&&(v=g2(M,h),v!==0&&v!==V.retryLane))throw V.retryLane=v,Wa(o,v),On(M,o,v),vg;nv(I)||Lf(),u=kg(o,u,h)}else nv(I)?(u.flags|=192,u.child=o.child,u=null):(o=V.treeContext,dt=or(I.nextSibling),Xt=u,Ke=!0,sa=null,ar=!1,o!==null&&dw(u,o),u=_g(u,v.children),u.flags|=4096);return u}return w?(pa(),I=v.fallback,w=u.mode,V=o.child,ne=V.sibling,v=gi(V,{mode:"hidden",children:v.children}),v.subtreeFlags=V.subtreeFlags&65011712,ne!==null?I=gi(ne,I):(I=Xa(I,w,h,null),I.flags|=2),I.return=u,v.return=u,v.sibling=I,u.child=v,Fs(null,v),v=u.child,I=o.child.memoizedState,I===null?I=bg(h):(w=I.cachePool,w!==null?(V=Tt._currentValue,w=w.parent!==V?{parent:V,pool:V}:w):w=yw(),I={baseLanes:I.baseLanes|h,cachePool:w}),v.memoizedState=I,v.childLanes=wg(o,M,h),u.memoizedState=xg,Fs(o.child,v)):(ma(u),h=o.child,o=h.sibling,h=gi(h,{mode:"visible",children:v.children}),h.return=u,h.sibling=null,o!==null&&(M=u.deletions,M===null?(u.deletions=[o],u.flags|=16):M.push(o)),u.child=h,u.memoizedState=null,h)}function _g(o,u){return u=Cf({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function Cf(o,u){return o=In(22,o,null,u),o.lanes=0,o}function kg(o,u,h){return rl(u,o.child,null,h),o=_g(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function T_(o,u,h){o.lanes|=u;var v=o.alternate;v!==null&&(v.lanes|=u),Ip(o.return,u,h)}function Sg(o,u,h,v,w,E){var M=o.memoizedState;M===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:v,tail:h,tailMode:w,treeForkCount:E}:(M.isBackwards=u,M.rendering=null,M.renderingStartTime=0,M.last=v,M.tail=h,M.tailMode=w,M.treeForkCount=E)}function M_(o,u,h){var v=u.pendingProps,w=v.revealOrder,E=v.tail;v=v.children;var M=Ct.current,I=(M&2)!==0;if(I?(M=M&1|2,u.flags|=128):M&=1,ae(Ct,M),Qt(o,u,v,h),v=Ke?Ns:0,!I&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&T_(o,h,u);else if(o.tag===19)T_(o,h,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(w){case"forwards":for(h=u.child,w=null;h!==null;)o=h.alternate,o!==null&&pf(o)===null&&(w=h),h=h.sibling;h=w,h===null?(w=u.child,u.child=null):(w=h.sibling,h.sibling=null),Sg(u,!1,w,h,E,v);break;case"backwards":case"unstable_legacy-backwards":for(h=null,w=u.child,u.child=null;w!==null;){if(o=w.alternate,o!==null&&pf(o)===null){u.child=w;break}o=w.sibling,w.sibling=h,h=w,w=o}Sg(u,!0,h,null,E,v);break;case"together":Sg(u,!1,null,null,void 0,v);break;default:u.memoizedState=null}return u.child}function _i(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),ya|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(no(o,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(i(153));if(u.child!==null){for(o=u.child,h=gi(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=gi(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function jg(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&of(o)))}function zR(o,u,h){switch(u.tag){case 3:Se(u,u.stateNode.containerInfo),ca(u,Tt,o.memoizedState.cache),Za();break;case 27:case 5:pe(u);break;case 4:Se(u,u.stateNode.containerInfo);break;case 10:ca(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Xp(u),null;break;case 13:var v=u.memoizedState;if(v!==null)return v.dehydrated!==null?(ma(u),u.flags|=128,null):(h&u.child.childLanes)!==0?A_(o,u,h):(ma(u),o=_i(o,u,h),o!==null?o.sibling:null);ma(u);break;case 19:var w=(o.flags&128)!==0;if(v=(h&u.childLanes)!==0,v||(no(o,u,h,!1),v=(h&u.childLanes)!==0),w){if(v)return M_(o,u,h);u.flags|=128}if(w=u.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),ae(Ct,Ct.current),v)break;return null;case 22:return u.lanes=0,S_(o,u,h,u.pendingProps);case 24:ca(u,Tt,o.memoizedState.cache)}return _i(o,u,h)}function P_(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Pt=!0;else{if(!jg(o,h)&&(u.flags&128)===0)return Pt=!1,zR(o,u,h);Pt=(o.flags&131072)!==0}else Pt=!1,Ke&&(u.flags&1048576)!==0&&fw(u,Ns,u.index);switch(u.lanes=0,u.tag){case 16:e:{var v=u.pendingProps;if(o=tl(u.elementType),u.type=o,typeof o=="function")Ap(o)?(v=al(o,v),u.tag=1,u=N_(null,u,o,v,h)):(u.tag=0,u=yg(null,u,o,v,h));else{if(o!=null){var w=o.$$typeof;if(w===O){u.tag=11,u=w_(null,u,o,v,h);break e}else if(w===P){u.tag=14,u=__(null,u,o,v,h);break e}}throw u=$(o)||o,Error(i(306,u,""))}}return u;case 0:return yg(o,u,u.type,u.pendingProps,h);case 1:return v=u.type,w=al(v,u.pendingProps),N_(o,u,v,w,h);case 3:e:{if(Se(u,u.stateNode.containerInfo),o===null)throw Error(i(387));v=u.pendingProps;var E=u.memoizedState;w=E.element,Gp(o,u),Ls(u,v,null,h);var M=u.memoizedState;if(v=M.cache,ca(u,Tt,v),v!==E.cache&&$p(u,[Tt],h,!0),Rs(),v=M.element,E.isDehydrated)if(E={element:v,isDehydrated:!1,cache:M.cache},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){u=O_(o,u,v,h);break e}else if(v!==w){w=nr(Error(i(424)),u),Os(w),u=O_(o,u,v,h);break e}else{switch(o=u.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(dt=or(o.firstChild),Xt=u,Ke=!0,sa=null,ar=!0,h=Sw(u,null,v,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Za(),v===w){u=_i(o,u,h);break e}Qt(o,u,v,h)}u=u.child}return u;case 26:return Ef(o,u),o===null?(h=Hk(u.type,null,u.pendingProps,null))?u.memoizedState=h:Ke||(h=u.type,o=u.pendingProps,v=qf(we.current).createElement(h),v[Wt]=u,v[kn]=o,Jt(v,h,o),Ut(v),u.stateNode=v):u.memoizedState=Hk(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return pe(u),o===null&&Ke&&(v=u.stateNode=Fk(u.type,u.pendingProps,we.current),Xt=u,ar=!0,w=dt,ka(u.type)?(iv=w,dt=or(v.firstChild)):dt=w),Qt(o,u,u.pendingProps.children,h),Ef(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Ke&&((w=v=dt)&&(v=h9(v,u.type,u.pendingProps,ar),v!==null?(u.stateNode=v,Xt=u,dt=or(v.firstChild),ar=!1,w=!0):w=!1),w||ua(u)),pe(u),w=u.type,E=u.pendingProps,M=o!==null?o.memoizedProps:null,v=E.children,Jg(w,E)?v=null:M!==null&&Jg(w,M)&&(u.flags|=32),u.memoizedState!==null&&(w=Qp(o,u,NR,null,null,h),nu._currentValue=w),Ef(o,u),Qt(o,u,v,h),u.child;case 6:return o===null&&Ke&&((o=h=dt)&&(h=m9(h,u.pendingProps,ar),h!==null?(u.stateNode=h,Xt=u,dt=null,o=!0):o=!1),o||ua(u)),null;case 13:return A_(o,u,h);case 4:return Se(u,u.stateNode.containerInfo),v=u.pendingProps,o===null?u.child=rl(u,null,v,h):Qt(o,u,v,h),u.child;case 11:return w_(o,u,u.type,u.pendingProps,h);case 7:return Qt(o,u,u.pendingProps,h),u.child;case 8:return Qt(o,u,u.pendingProps.children,h),u.child;case 12:return Qt(o,u,u.pendingProps.children,h),u.child;case 10:return v=u.pendingProps,ca(u,u.type,v.value),Qt(o,u,v.children,h),u.child;case 9:return w=u.type._context,v=u.pendingProps.children,Ja(u),w=Zt(w),v=v(w),u.flags|=1,Qt(o,u,v,h),u.child;case 14:return __(o,u,u.type,u.pendingProps,h);case 15:return k_(o,u,u.type,u.pendingProps,h);case 19:return M_(o,u,h);case 31:return LR(o,u,h);case 22:return S_(o,u,h,u.pendingProps);case 24:return Ja(u),v=Zt(Tt),o===null?(w=Up(),w===null&&(w=st,E=Bp(),w.pooledCache=E,E.refCount++,E!==null&&(w.pooledCacheLanes|=h),w=E),u.memoizedState={parent:v,cache:w},Hp(u),ca(u,Tt,w)):((o.lanes&h)!==0&&(Gp(o,u),Ls(u,null,null,h),Rs()),w=o.memoizedState,E=u.memoizedState,w.parent!==v?(w={parent:v,cache:v},u.memoizedState=w,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=w),ca(u,Tt,v)):(v=E.cache,ca(u,Tt,v),v!==w.cache&&$p(u,[Tt],h,!0))),Qt(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function ki(o){o.flags|=4}function Eg(o,u,h,v,w){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(w&335544128)===w)if(o.stateNode.complete)o.flags|=8192;else if(lk())o.flags|=8192;else throw nl=ff,qp}else o.flags&=-16777217}function D_(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Wk(u))if(lk())o.flags|=8192;else throw nl=ff,qp}function Nf(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?h2():536870912,o.lanes|=u,po|=u)}function Us(o,u){if(!Ke)switch(o.tailMode){case"hidden":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var v=null;h!==null;)h.alternate!==null&&(v=h),h=h.sibling;v===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:v.sibling=null}}function ht(o){var u=o.alternate!==null&&o.alternate.child===o.child,h=0,v=0;if(u)for(var w=o.child;w!==null;)h|=w.lanes|w.childLanes,v|=w.subtreeFlags&65011712,v|=w.flags&65011712,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)h|=w.lanes|w.childLanes,v|=w.subtreeFlags,v|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=v,o.childLanes=h,u}function IR(o,u,h){var v=u.pendingProps;switch(Dp(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(u),null;case 1:return ht(u),null;case 3:return h=u.stateNode,v=null,o!==null&&(v=o.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),xi(Tt),me(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(to(u)?ki(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Lp())),ht(u),null;case 26:var w=u.type,E=u.memoizedState;return o===null?(ki(u),E!==null?(ht(u),D_(u,E)):(ht(u),Eg(u,w,null,v,h))):E?E!==o.memoizedState?(ki(u),ht(u),D_(u,E)):(ht(u),u.flags&=-16777217):(o=o.memoizedProps,o!==v&&ki(u),ht(u),Eg(u,w,o,v,h)),null;case 27:if(Ee(u),h=we.current,w=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==v&&ki(u);else{if(!v){if(u.stateNode===null)throw Error(i(166));return ht(u),null}o=se.current,to(u)?hw(u):(o=Fk(w,v,h),u.stateNode=o,ki(u))}return ht(u),null;case 5:if(Ee(u),w=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==v&&ki(u);else{if(!v){if(u.stateNode===null)throw Error(i(166));return ht(u),null}if(E=se.current,to(u))hw(u);else{var M=qf(we.current);switch(E){case 1:E=M.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:E=M.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":E=M.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":E=M.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":E=M.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof v.is=="string"?M.createElement("select",{is:v.is}):M.createElement("select"),v.multiple?E.multiple=!0:v.size&&(E.size=v.size);break;default:E=typeof v.is=="string"?M.createElement(w,{is:v.is}):M.createElement(w)}}E[Wt]=u,E[kn]=v;e:for(M=u.child;M!==null;){if(M.tag===5||M.tag===6)E.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===u)break e;for(;M.sibling===null;){if(M.return===null||M.return===u)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}u.stateNode=E;e:switch(Jt(E,w,v),w){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&ki(u)}}return ht(u),Eg(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==v&&ki(u);else{if(typeof v!="string"&&u.stateNode===null)throw Error(i(166));if(o=we.current,to(u)){if(o=u.stateNode,h=u.memoizedProps,v=null,w=Xt,w!==null)switch(w.tag){case 27:case 5:v=w.memoizedProps}o[Wt]=u,o=!!(o.nodeValue===h||v!==null&&v.suppressHydrationWarning===!0||Ak(o.nodeValue,h)),o||ua(u,!0)}else o=qf(o).createTextNode(v),o[Wt]=u,u.stateNode=o}return ht(u),null;case 31:if(h=u.memoizedState,o===null||o.memoizedState!==null){if(v=to(u),h!==null){if(o===null){if(!v)throw Error(i(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(i(557));o[Wt]=u}else Za(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ht(u),o=!1}else h=Lp(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(Bn(u),u):(Bn(u),null);if((u.flags&128)!==0)throw Error(i(558))}return ht(u),null;case 13:if(v=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(w=to(u),v!==null&&v.dehydrated!==null){if(o===null){if(!w)throw Error(i(318));if(w=u.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(i(317));w[Wt]=u}else Za(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ht(u),w=!1}else w=Lp(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=w),w=!0;if(!w)return u.flags&256?(Bn(u),u):(Bn(u),null)}return Bn(u),(u.flags&128)!==0?(u.lanes=h,u):(h=v!==null,o=o!==null&&o.memoizedState!==null,h&&(v=u.child,w=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(w=v.alternate.memoizedState.cachePool.pool),E=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(E=v.memoizedState.cachePool.pool),E!==w&&(v.flags|=2048)),h!==o&&h&&(u.child.flags|=8192),Nf(u,u.updateQueue),ht(u),null);case 4:return me(),o===null&&Yg(u.stateNode.containerInfo),ht(u),null;case 10:return xi(u.type),ht(u),null;case 19:if(X(Ct),v=u.memoizedState,v===null)return ht(u),null;if(w=(u.flags&128)!==0,E=v.rendering,E===null)if(w)Us(v,!1);else{if(St!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(E=pf(o),E!==null){for(u.flags|=128,Us(v,!1),o=E.updateQueue,u.updateQueue=o,Nf(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)sw(h,o),h=h.sibling;return ae(Ct,Ct.current&1|2),Ke&&vi(u,v.treeForkCount),u.child}o=o.sibling}v.tail!==null&&De()>Pf&&(u.flags|=128,w=!0,Us(v,!1),u.lanes=4194304)}else{if(!w)if(o=pf(E),o!==null){if(u.flags|=128,w=!0,o=o.updateQueue,u.updateQueue=o,Nf(u,o),Us(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!Ke)return ht(u),null}else 2*De()-v.renderingStartTime>Pf&&h!==536870912&&(u.flags|=128,w=!0,Us(v,!1),u.lanes=4194304);v.isBackwards?(E.sibling=u.child,u.child=E):(o=v.last,o!==null?o.sibling=E:u.child=E,v.last=E)}return v.tail!==null?(o=v.tail,v.rendering=o,v.tail=o.sibling,v.renderingStartTime=De(),o.sibling=null,h=Ct.current,ae(Ct,w?h&1|2:h&1),Ke&&vi(u,v.treeForkCount),o):(ht(u),null);case 22:case 23:return Bn(u),Wp(),v=u.memoizedState!==null,o!==null?o.memoizedState!==null!==v&&(u.flags|=8192):v&&(u.flags|=8192),v?(h&536870912)!==0&&(u.flags&128)===0&&(ht(u),u.subtreeFlags&6&&(u.flags|=8192)):ht(u),h=u.updateQueue,h!==null&&Nf(u,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==h&&(u.flags|=2048),o!==null&&X(el),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),xi(Tt),ht(u),null;case 25:return null;case 30:return null}throw Error(i(156,u.tag))}function $R(o,u){switch(Dp(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return xi(Tt),me(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 31:if(u.memoizedState!==null){if(Bn(u),u.alternate===null)throw Error(i(340));Za()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(Bn(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(i(340));Za()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return X(Ct),null;case 4:return me(),null;case 10:return xi(u.type),null;case 22:case 23:return Bn(u),Wp(),o!==null&&X(el),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return xi(Tt),null;case 25:return null;default:return null}}function R_(o,u){switch(Dp(u),u.tag){case 3:xi(Tt),me();break;case 26:case 27:case 5:Ee(u);break;case 4:me();break;case 31:u.memoizedState!==null&&Bn(u);break;case 13:Bn(u);break;case 19:X(Ct);break;case 10:xi(u.type);break;case 22:case 23:Bn(u),Wp(),o!==null&&X(el);break;case 24:xi(Tt)}}function qs(o,u){try{var h=u.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var w=v.next;h=w;do{if((h.tag&o)===o){v=void 0;var E=h.create,M=h.inst;v=E(),M.destroy=v}h=h.next}while(h!==w)}}catch(I){nt(u,u.return,I)}}function ga(o,u,h){try{var v=u.updateQueue,w=v!==null?v.lastEffect:null;if(w!==null){var E=w.next;v=E;do{if((v.tag&o)===o){var M=v.inst,I=M.destroy;if(I!==void 0){M.destroy=void 0,w=u;var V=h,ne=I;try{ne()}catch(ue){nt(w,V,ue)}}}v=v.next}while(v!==E)}}catch(ue){nt(u,u.return,ue)}}function L_(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{Ew(u,h)}catch(v){nt(o,o.return,v)}}}function z_(o,u,h){h.props=al(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(v){nt(o,u,v)}}function Hs(o,u){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var v=o.stateNode;break;case 30:v=o.stateNode;break;default:v=o.stateNode}typeof h=="function"?o.refCleanup=h(v):h.current=v}}catch(w){nt(o,u,w)}}function $r(o,u){var h=o.ref,v=o.refCleanup;if(h!==null)if(typeof v=="function")try{v()}catch(w){nt(o,u,w)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(w){nt(o,u,w)}else h.current=null}function I_(o){var u=o.type,h=o.memoizedProps,v=o.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&v.focus();break e;case"img":h.src?v.src=h.src:h.srcSet&&(v.srcset=h.srcSet)}}catch(w){nt(o,o.return,w)}}function Cg(o,u,h){try{var v=o.stateNode;o9(v,o.type,h,u),v[kn]=u}catch(w){nt(o,o.return,w)}}function $_(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ka(o.type)||o.tag===4}function Ng(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||$_(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&ka(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Og(o,u,h){var v=o.tag;if(v===5||v===6)o=o.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(o),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=mi));else if(v!==4&&(v===27&&ka(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(Og(o,u,h),o=o.sibling;o!==null;)Og(o,u,h),o=o.sibling}function Of(o,u,h){var v=o.tag;if(v===5||v===6)o=o.stateNode,u?h.insertBefore(o,u):h.appendChild(o);else if(v!==4&&(v===27&&ka(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(Of(o,u,h),o=o.sibling;o!==null;)Of(o,u,h),o=o.sibling}function B_(o){var u=o.stateNode,h=o.memoizedProps;try{for(var v=o.type,w=u.attributes;w.length;)u.removeAttributeNode(w[0]);Jt(u,v,h),u[Wt]=o,u[kn]=h}catch(E){nt(o,o.return,E)}}var Si=!1,Dt=!1,Ag=!1,F_=typeof WeakSet=="function"?WeakSet:Set,qt=null;function BR(o,u){if(o=o.containerInfo,Zg=Xf,o=J2(o),kp(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var w=v.anchorOffset,E=v.focusNode;v=v.focusOffset;try{h.nodeType,E.nodeType}catch{h=null;break e}var M=0,I=-1,V=-1,ne=0,ue=0,de=o,ie=null;t:for(;;){for(var oe;de!==h||w!==0&&de.nodeType!==3||(I=M+w),de!==E||v!==0&&de.nodeType!==3||(V=M+v),de.nodeType===3&&(M+=de.nodeValue.length),(oe=de.firstChild)!==null;)ie=de,de=oe;for(;;){if(de===o)break t;if(ie===h&&++ne===w&&(I=M),ie===E&&++ue===v&&(V=M),(oe=de.nextSibling)!==null)break;de=ie,ie=de.parentNode}de=oe}h=I===-1||V===-1?null:{start:I,end:V}}else h=null}h=h||{start:0,end:0}}else h=null;for(Qg={focusedElem:o,selectionRange:h},Xf=!1,qt=u;qt!==null;)if(u=qt,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,qt=o;else for(;qt!==null;){switch(u=qt,E=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)w=o[h],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&E!==null){o=void 0,h=u,w=E.memoizedProps,E=E.memoizedState,v=h.stateNode;try{var ke=al(h.type,w);o=v.getSnapshotBeforeUpdate(ke,E),v.__reactInternalSnapshotBeforeUpdate=o}catch(Pe){nt(h,h.return,Pe)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,h=o.nodeType,h===9)tv(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":tv(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(i(163))}if(o=u.sibling,o!==null){o.return=u.return,qt=o;break}qt=u.return}}function U_(o,u,h){var v=h.flags;switch(h.tag){case 0:case 11:case 15:Ei(o,h),v&4&&qs(5,h);break;case 1:if(Ei(o,h),v&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(M){nt(h,h.return,M)}else{var w=al(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(w,u,o.__reactInternalSnapshotBeforeUpdate)}catch(M){nt(h,h.return,M)}}v&64&&L_(h),v&512&&Hs(h,h.return);break;case 3:if(Ei(o,h),v&64&&(o=h.updateQueue,o!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{Ew(o,u)}catch(M){nt(h,h.return,M)}}break;case 27:u===null&&v&4&&B_(h);case 26:case 5:Ei(o,h),u===null&&v&4&&I_(h),v&512&&Hs(h,h.return);break;case 12:Ei(o,h);break;case 31:Ei(o,h),v&4&&G_(o,h);break;case 13:Ei(o,h),v&4&&K_(o,h),v&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=WR.bind(null,h),p9(o,h))));break;case 22:if(v=h.memoizedState!==null||Si,!v){u=u!==null&&u.memoizedState!==null||Dt,w=Si;var E=Dt;Si=v,(Dt=u)&&!E?Ci(o,h,(h.subtreeFlags&8772)!==0):Ei(o,h),Si=w,Dt=E}break;case 30:break;default:Ei(o,h)}}function q_(o){var u=o.alternate;u!==null&&(o.alternate=null,q_(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&lp(u)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var vt=null,jn=!1;function ji(o,u,h){for(h=h.child;h!==null;)H_(o,u,h),h=h.sibling}function H_(o,u,h){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(ms,h)}catch{}switch(h.tag){case 26:Dt||$r(h,u),ji(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Dt||$r(h,u);var v=vt,w=jn;ka(h.type)&&(vt=h.stateNode,jn=!1),ji(o,u,h),Js(h.stateNode),vt=v,jn=w;break;case 5:Dt||$r(h,u);case 6:if(v=vt,w=jn,vt=null,ji(o,u,h),vt=v,jn=w,vt!==null)if(jn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(h.stateNode)}catch(E){nt(h,u,E)}else try{vt.removeChild(h.stateNode)}catch(E){nt(h,u,E)}break;case 18:vt!==null&&(jn?(o=vt,Lk(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),ko(o)):Lk(vt,h.stateNode));break;case 4:v=vt,w=jn,vt=h.stateNode.containerInfo,jn=!0,ji(o,u,h),vt=v,jn=w;break;case 0:case 11:case 14:case 15:ga(2,h,u),Dt||ga(4,h,u),ji(o,u,h);break;case 1:Dt||($r(h,u),v=h.stateNode,typeof v.componentWillUnmount=="function"&&z_(h,u,v)),ji(o,u,h);break;case 21:ji(o,u,h);break;case 22:Dt=(v=Dt)||h.memoizedState!==null,ji(o,u,h),Dt=v;break;default:ji(o,u,h)}}function G_(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ko(o)}catch(h){nt(u,u.return,h)}}}function K_(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ko(o)}catch(h){nt(u,u.return,h)}}function FR(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new F_),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new F_),u;default:throw Error(i(435,o.tag))}}function Af(o,u){var h=FR(o);u.forEach(function(v){if(!h.has(v)){h.add(v);var w=XR.bind(null,o,v);v.then(w,w)}})}function En(o,u){var h=u.deletions;if(h!==null)for(var v=0;v<h.length;v++){var w=h[v],E=o,M=u,I=M;e:for(;I!==null;){switch(I.tag){case 27:if(ka(I.type)){vt=I.stateNode,jn=!1;break e}break;case 5:vt=I.stateNode,jn=!1;break e;case 3:case 4:vt=I.stateNode.containerInfo,jn=!0;break e}I=I.return}if(vt===null)throw Error(i(160));H_(E,M,w),vt=null,jn=!1,E=w.alternate,E!==null&&(E.return=null),w.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)V_(u,o),u=u.sibling}var Er=null;function V_(o,u){var h=o.alternate,v=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:En(u,o),Cn(o),v&4&&(ga(3,o,o.return),qs(3,o),ga(5,o,o.return));break;case 1:En(u,o),Cn(o),v&512&&(Dt||h===null||$r(h,h.return)),v&64&&Si&&(o=o.updateQueue,o!==null&&(v=o.callbacks,v!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?v:h.concat(v))));break;case 26:var w=Er;if(En(u,o),Cn(o),v&512&&(Dt||h===null||$r(h,h.return)),v&4){var E=h!==null?h.memoizedState:null;if(v=o.memoizedState,h===null)if(v===null)if(o.stateNode===null){e:{v=o.type,h=o.memoizedProps,w=w.ownerDocument||w;t:switch(v){case"title":E=w.getElementsByTagName("title")[0],(!E||E[vs]||E[Wt]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=w.createElement(v),w.head.insertBefore(E,w.querySelector("head > title"))),Jt(E,v,h),E[Wt]=o,Ut(E),v=E;break e;case"link":var M=Vk("link","href",w).get(v+(h.href||""));if(M){for(var I=0;I<M.length;I++)if(E=M[I],E.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&E.getAttribute("rel")===(h.rel==null?null:h.rel)&&E.getAttribute("title")===(h.title==null?null:h.title)&&E.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){M.splice(I,1);break t}}E=w.createElement(v),Jt(E,v,h),w.head.appendChild(E);break;case"meta":if(M=Vk("meta","content",w).get(v+(h.content||""))){for(I=0;I<M.length;I++)if(E=M[I],E.getAttribute("content")===(h.content==null?null:""+h.content)&&E.getAttribute("name")===(h.name==null?null:h.name)&&E.getAttribute("property")===(h.property==null?null:h.property)&&E.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&E.getAttribute("charset")===(h.charSet==null?null:h.charSet)){M.splice(I,1);break t}}E=w.createElement(v),Jt(E,v,h),w.head.appendChild(E);break;default:throw Error(i(468,v))}E[Wt]=o,Ut(E),v=E}o.stateNode=v}else Yk(w,o.type,o.stateNode);else o.stateNode=Kk(w,v,o.memoizedProps);else E!==v?(E===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):E.count--,v===null?Yk(w,o.type,o.stateNode):Kk(w,v,o.memoizedProps)):v===null&&o.stateNode!==null&&Cg(o,o.memoizedProps,h.memoizedProps)}break;case 27:En(u,o),Cn(o),v&512&&(Dt||h===null||$r(h,h.return)),h!==null&&v&4&&Cg(o,o.memoizedProps,h.memoizedProps);break;case 5:if(En(u,o),Cn(o),v&512&&(Dt||h===null||$r(h,h.return)),o.flags&32){w=o.stateNode;try{Gl(w,"")}catch(ke){nt(o,o.return,ke)}}v&4&&o.stateNode!=null&&(w=o.memoizedProps,Cg(o,w,h!==null?h.memoizedProps:w)),v&1024&&(Ag=!0);break;case 6:if(En(u,o),Cn(o),v&4){if(o.stateNode===null)throw Error(i(162));v=o.memoizedProps,h=o.stateNode;try{h.nodeValue=v}catch(ke){nt(o,o.return,ke)}}break;case 3:if(Kf=null,w=Er,Er=Hf(u.containerInfo),En(u,o),Er=w,Cn(o),v&4&&h!==null&&h.memoizedState.isDehydrated)try{ko(u.containerInfo)}catch(ke){nt(o,o.return,ke)}Ag&&(Ag=!1,Y_(o));break;case 4:v=Er,Er=Hf(o.stateNode.containerInfo),En(u,o),Cn(o),Er=v;break;case 12:En(u,o),Cn(o);break;case 31:En(u,o),Cn(o),v&4&&(v=o.updateQueue,v!==null&&(o.updateQueue=null,Af(o,v)));break;case 13:En(u,o),Cn(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Mf=De()),v&4&&(v=o.updateQueue,v!==null&&(o.updateQueue=null,Af(o,v)));break;case 22:w=o.memoizedState!==null;var V=h!==null&&h.memoizedState!==null,ne=Si,ue=Dt;if(Si=ne||w,Dt=ue||V,En(u,o),Dt=ue,Si=ne,Cn(o),v&8192)e:for(u=o.stateNode,u._visibility=w?u._visibility&-2:u._visibility|1,w&&(h===null||V||Si||Dt||ll(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){V=h=u;try{if(E=V.stateNode,w)M=E.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{I=V.stateNode;var de=V.memoizedProps.style,ie=de!=null&&de.hasOwnProperty("display")?de.display:null;I.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ke){nt(V,V.return,ke)}}}else if(u.tag===6){if(h===null){V=u;try{V.stateNode.nodeValue=w?"":V.memoizedProps}catch(ke){nt(V,V.return,ke)}}}else if(u.tag===18){if(h===null){V=u;try{var oe=V.stateNode;w?zk(oe,!0):zk(V.stateNode,!1)}catch(ke){nt(V,V.return,ke)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}v&4&&(v=o.updateQueue,v!==null&&(h=v.retryQueue,h!==null&&(v.retryQueue=null,Af(o,h))));break;case 19:En(u,o),Cn(o),v&4&&(v=o.updateQueue,v!==null&&(o.updateQueue=null,Af(o,v)));break;case 30:break;case 21:break;default:En(u,o),Cn(o)}}function Cn(o){var u=o.flags;if(u&2){try{for(var h,v=o.return;v!==null;){if($_(v)){h=v;break}v=v.return}if(h==null)throw Error(i(160));switch(h.tag){case 27:var w=h.stateNode,E=Ng(o);Of(o,E,w);break;case 5:var M=h.stateNode;h.flags&32&&(Gl(M,""),h.flags&=-33);var I=Ng(o);Of(o,I,M);break;case 3:case 4:var V=h.stateNode.containerInfo,ne=Ng(o);Og(o,ne,V);break;default:throw Error(i(161))}}catch(ue){nt(o,o.return,ue)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function Y_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;Y_(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function Ei(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)U_(o,u.alternate,u),u=u.sibling}function ll(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:ga(4,u,u.return),ll(u);break;case 1:$r(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&z_(u,u.return,h),ll(u);break;case 27:Js(u.stateNode);case 26:case 5:$r(u,u.return),ll(u);break;case 22:u.memoizedState===null&&ll(u);break;case 30:ll(u);break;default:ll(u)}o=o.sibling}}function Ci(o,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var v=u.alternate,w=o,E=u,M=E.flags;switch(E.tag){case 0:case 11:case 15:Ci(w,E,h),qs(4,E);break;case 1:if(Ci(w,E,h),v=E,w=v.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ne){nt(v,v.return,ne)}if(v=E,w=v.updateQueue,w!==null){var I=v.stateNode;try{var V=w.shared.hiddenCallbacks;if(V!==null)for(w.shared.hiddenCallbacks=null,w=0;w<V.length;w++)jw(V[w],I)}catch(ne){nt(v,v.return,ne)}}h&&M&64&&L_(E),Hs(E,E.return);break;case 27:B_(E);case 26:case 5:Ci(w,E,h),h&&v===null&&M&4&&I_(E),Hs(E,E.return);break;case 12:Ci(w,E,h);break;case 31:Ci(w,E,h),h&&M&4&&G_(w,E);break;case 13:Ci(w,E,h),h&&M&4&&K_(w,E);break;case 22:E.memoizedState===null&&Ci(w,E,h),Hs(E,E.return);break;case 30:break;default:Ci(w,E,h)}u=u.sibling}}function Tg(o,u){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&As(h))}function Mg(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&As(o))}function Cr(o,u,h,v){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)W_(o,u,h,v),u=u.sibling}function W_(o,u,h,v){var w=u.flags;switch(u.tag){case 0:case 11:case 15:Cr(o,u,h,v),w&2048&&qs(9,u);break;case 1:Cr(o,u,h,v);break;case 3:Cr(o,u,h,v),w&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&As(o)));break;case 12:if(w&2048){Cr(o,u,h,v),o=u.stateNode;try{var E=u.memoizedProps,M=E.id,I=E.onPostCommit;typeof I=="function"&&I(M,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(V){nt(u,u.return,V)}}else Cr(o,u,h,v);break;case 31:Cr(o,u,h,v);break;case 13:Cr(o,u,h,v);break;case 23:break;case 22:E=u.stateNode,M=u.alternate,u.memoizedState!==null?E._visibility&2?Cr(o,u,h,v):Gs(o,u):E._visibility&2?Cr(o,u,h,v):(E._visibility|=2,fo(o,u,h,v,(u.subtreeFlags&10256)!==0||!1)),w&2048&&Tg(M,u);break;case 24:Cr(o,u,h,v),w&2048&&Mg(u.alternate,u);break;default:Cr(o,u,h,v)}}function fo(o,u,h,v,w){for(w=w&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var E=o,M=u,I=h,V=v,ne=M.flags;switch(M.tag){case 0:case 11:case 15:fo(E,M,I,V,w),qs(8,M);break;case 23:break;case 22:var ue=M.stateNode;M.memoizedState!==null?ue._visibility&2?fo(E,M,I,V,w):Gs(E,M):(ue._visibility|=2,fo(E,M,I,V,w)),w&&ne&2048&&Tg(M.alternate,M);break;case 24:fo(E,M,I,V,w),w&&ne&2048&&Mg(M.alternate,M);break;default:fo(E,M,I,V,w)}u=u.sibling}}function Gs(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=o,v=u,w=v.flags;switch(v.tag){case 22:Gs(h,v),w&2048&&Tg(v.alternate,v);break;case 24:Gs(h,v),w&2048&&Mg(v.alternate,v);break;default:Gs(h,v)}u=u.sibling}}var Ks=8192;function ho(o,u,h){if(o.subtreeFlags&Ks)for(o=o.child;o!==null;)X_(o,u,h),o=o.sibling}function X_(o,u,h){switch(o.tag){case 26:ho(o,u,h),o.flags&Ks&&o.memoizedState!==null&&C9(h,Er,o.memoizedState,o.memoizedProps);break;case 5:ho(o,u,h);break;case 3:case 4:var v=Er;Er=Hf(o.stateNode.containerInfo),ho(o,u,h),Er=v;break;case 22:o.memoizedState===null&&(v=o.alternate,v!==null&&v.memoizedState!==null?(v=Ks,Ks=16777216,ho(o,u,h),Ks=v):ho(o,u,h));break;default:ho(o,u,h)}}function Z_(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function Vs(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var v=u[h];qt=v,J_(v,o)}Z_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Q_(o),o=o.sibling}function Q_(o){switch(o.tag){case 0:case 11:case 15:Vs(o),o.flags&2048&&ga(9,o,o.return);break;case 3:Vs(o);break;case 12:Vs(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,Tf(o)):Vs(o);break;default:Vs(o)}}function Tf(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var v=u[h];qt=v,J_(v,o)}Z_(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:ga(8,u,u.return),Tf(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,Tf(u));break;default:Tf(u)}o=o.sibling}}function J_(o,u){for(;qt!==null;){var h=qt;switch(h.tag){case 0:case 11:case 15:ga(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var v=h.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:As(h.memoizedState.cache)}if(v=h.child,v!==null)v.return=h,qt=v;else e:for(h=o;qt!==null;){v=qt;var w=v.sibling,E=v.return;if(q_(v),v===h){qt=null;break e}if(w!==null){w.return=E,qt=w;break e}qt=E}}}var UR={getCacheForType:function(o){var u=Zt(Tt),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return Zt(Tt).controller.signal}},qR=typeof WeakMap=="function"?WeakMap:Map,Qe=0,st=null,Ue=null,He=0,tt=0,Fn=null,va=!1,mo=!1,Pg=!1,Ni=0,St=0,ya=0,ol=0,Dg=0,Un=0,po=0,Ys=null,Nn=null,Rg=!1,Mf=0,ek=0,Pf=1/0,Df=null,xa=null,Lt=0,ba=null,go=null,Oi=0,Lg=0,zg=null,tk=null,Ws=0,Ig=null;function qn(){return(Qe&2)!==0&&He!==0?He&-He:B.T!==null?Hg():v2()}function nk(){if(Un===0)if((He&536870912)===0||Ke){var o=Fc;Fc<<=1,(Fc&3932160)===0&&(Fc=262144),Un=o}else Un=536870912;return o=$n.current,o!==null&&(o.flags|=32),Un}function On(o,u,h){(o===st&&(tt===2||tt===9)||o.cancelPendingCommit!==null)&&(vo(o,0),wa(o,He,Un,!1)),gs(o,h),((Qe&2)===0||o!==st)&&(o===st&&((Qe&2)===0&&(ol|=h),St===4&&wa(o,He,Un,!1)),Br(o))}function rk(o,u,h){if((Qe&6)!==0)throw Error(i(327));var v=!h&&(u&127)===0&&(u&o.expiredLanes)===0||ps(o,u),w=v?KR(o,u):Bg(o,u,!0),E=v;do{if(w===0){mo&&!v&&wa(o,u,0,!1);break}else{if(h=o.current.alternate,E&&!HR(h)){w=Bg(o,u,!1),E=!1;continue}if(w===2){if(E=u,o.errorRecoveryDisabledLanes&E)var M=0;else M=o.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){u=M;e:{var I=o;w=Ys;var V=I.current.memoizedState.isDehydrated;if(V&&(vo(I,M).flags|=256),M=Bg(I,M,!1),M!==2){if(Pg&&!V){I.errorRecoveryDisabledLanes|=E,ol|=E,w=4;break e}E=Nn,Nn=w,E!==null&&(Nn===null?Nn=E:Nn.push.apply(Nn,E))}w=M}if(E=!1,w!==2)continue}}if(w===1){vo(o,0),wa(o,u,0,!0);break}e:{switch(v=o,E=w,E){case 0:case 1:throw Error(i(345));case 4:if((u&4194048)!==u)break;case 6:wa(v,u,Un,!va);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((u&62914560)===u&&(w=Mf+300-De(),10<w)){if(wa(v,u,Un,!va),qc(v,0,!0)!==0)break e;Oi=u,v.timeoutHandle=Dk(ik.bind(null,v,h,Nn,Df,Rg,u,Un,ol,po,va,E,"Throttled",-0,0),w);break e}ik(v,h,Nn,Df,Rg,u,Un,ol,po,va,E,null,-0,0)}}break}while(!0);Br(o)}function ik(o,u,h,v,w,E,M,I,V,ne,ue,de,ie,oe){if(o.timeoutHandle=-1,de=u.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mi},X_(u,E,de);var ke=(E&62914560)===E?Mf-De():(E&4194048)===E?ek-De():0;if(ke=N9(de,ke),ke!==null){Oi=E,o.cancelPendingCommit=ke(dk.bind(null,o,u,E,h,v,w,M,I,V,ue,de,null,ie,oe)),wa(o,E,M,!ne);return}}dk(o,u,E,h,v,w,M,I,V)}function HR(o){for(var u=o;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var v=0;v<h.length;v++){var w=h[v],E=w.getSnapshot;w=w.value;try{if(!zn(E(),w))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function wa(o,u,h,v){u&=~Dg,u&=~ol,o.suspendedLanes|=u,o.pingedLanes&=~u,v&&(o.warmLanes|=u),v=o.expirationTimes;for(var w=u;0<w;){var E=31-Ln(w),M=1<<E;v[E]=-1,w&=~M}h!==0&&m2(o,h,u)}function Rf(){return(Qe&6)===0?(Xs(0),!1):!0}function $g(){if(Ue!==null){if(tt===0)var o=Ue.return;else o=Ue,yi=Qa=null,tg(o),lo=null,Ms=0,o=Ue;for(;o!==null;)R_(o.alternate,o),o=o.return;Ue=null}}function vo(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,c9(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),Oi=0,$g(),st=o,Ue=h=gi(o.current,null),He=u,tt=0,Fn=null,va=!1,mo=ps(o,u),Pg=!1,po=Un=Dg=ol=ya=St=0,Nn=Ys=null,Rg=!1,(u&8)!==0&&(u|=u&32);var v=o.entangledLanes;if(v!==0)for(o=o.entanglements,v&=u;0<v;){var w=31-Ln(v),E=1<<w;u|=o[w],v&=~E}return Ni=u,tf(),h}function ak(o,u){Ie=null,B.H=Bs,u===ao||u===cf?(u=ww(),tt=3):u===qp?(u=ww(),tt=4):tt=u===vg?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Fn=u,Ue===null&&(St=1,Sf(o,nr(u,o.current)))}function lk(){var o=$n.current;return o===null?!0:(He&4194048)===He?lr===null:(He&62914560)===He||(He&536870912)!==0?o===lr:!1}function ok(){var o=B.H;return B.H=Bs,o===null?Bs:o}function sk(){var o=B.A;return B.A=UR,o}function Lf(){St=4,va||(He&4194048)!==He&&$n.current!==null||(mo=!0),(ya&134217727)===0&&(ol&134217727)===0||st===null||wa(st,He,Un,!1)}function Bg(o,u,h){var v=Qe;Qe|=2;var w=ok(),E=sk();(st!==o||He!==u)&&(Df=null,vo(o,u)),u=!1;var M=St;e:do try{if(tt!==0&&Ue!==null){var I=Ue,V=Fn;switch(tt){case 8:$g(),M=6;break e;case 3:case 2:case 9:case 6:$n.current===null&&(u=!0);var ne=tt;if(tt=0,Fn=null,yo(o,I,V,ne),h&&mo){M=0;break e}break;default:ne=tt,tt=0,Fn=null,yo(o,I,V,ne)}}GR(),M=St;break}catch(ue){ak(o,ue)}while(!0);return u&&o.shellSuspendCounter++,yi=Qa=null,Qe=v,B.H=w,B.A=E,Ue===null&&(st=null,He=0,tf()),M}function GR(){for(;Ue!==null;)uk(Ue)}function KR(o,u){var h=Qe;Qe|=2;var v=ok(),w=sk();st!==o||He!==u?(Df=null,Pf=De()+500,vo(o,u)):mo=ps(o,u);e:do try{if(tt!==0&&Ue!==null){u=Ue;var E=Fn;t:switch(tt){case 1:tt=0,Fn=null,yo(o,u,E,1);break;case 2:case 9:if(xw(E)){tt=0,Fn=null,ck(u);break}u=function(){tt!==2&&tt!==9||st!==o||(tt=7),Br(o)},E.then(u,u);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:xw(E)?(tt=0,Fn=null,ck(u)):(tt=0,Fn=null,yo(o,u,E,7));break;case 5:var M=null;switch(Ue.tag){case 26:M=Ue.memoizedState;case 5:case 27:var I=Ue;if(M?Wk(M):I.stateNode.complete){tt=0,Fn=null;var V=I.sibling;if(V!==null)Ue=V;else{var ne=I.return;ne!==null?(Ue=ne,zf(ne)):Ue=null}break t}}tt=0,Fn=null,yo(o,u,E,5);break;case 6:tt=0,Fn=null,yo(o,u,E,6);break;case 8:$g(),St=6;break e;default:throw Error(i(462))}}VR();break}catch(ue){ak(o,ue)}while(!0);return yi=Qa=null,B.H=v,B.A=w,Qe=h,Ue!==null?0:(st=null,He=0,tf(),St)}function VR(){for(;Ue!==null&&!Je();)uk(Ue)}function uk(o){var u=P_(o.alternate,o,Ni);o.memoizedProps=o.pendingProps,u===null?zf(o):Ue=u}function ck(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=C_(h,u,u.pendingProps,u.type,void 0,He);break;case 11:u=C_(h,u,u.pendingProps,u.type.render,u.ref,He);break;case 5:tg(u);default:R_(h,u),u=Ue=sw(u,Ni),u=P_(h,u,Ni)}o.memoizedProps=o.pendingProps,u===null?zf(o):Ue=u}function yo(o,u,h,v){yi=Qa=null,tg(u),lo=null,Ms=0;var w=u.return;try{if(RR(o,w,u,h,He)){St=1,Sf(o,nr(h,o.current)),Ue=null;return}}catch(E){if(w!==null)throw Ue=w,E;St=1,Sf(o,nr(h,o.current)),Ue=null;return}u.flags&32768?(Ke||v===1?o=!0:mo||(He&536870912)!==0?o=!1:(va=o=!0,(v===2||v===9||v===3||v===6)&&(v=$n.current,v!==null&&v.tag===13&&(v.flags|=16384))),fk(u,o)):zf(u)}function zf(o){var u=o;do{if((u.flags&32768)!==0){fk(u,va);return}o=u.return;var h=IR(u.alternate,u,Ni);if(h!==null){Ue=h;return}if(u=u.sibling,u!==null){Ue=u;return}Ue=u=o}while(u!==null);St===0&&(St=5)}function fk(o,u){do{var h=$R(o.alternate,o);if(h!==null){h.flags&=32767,Ue=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){Ue=o;return}Ue=o=h}while(o!==null);St=6,Ue=null}function dk(o,u,h,v,w,E,M,I,V){o.cancelPendingCommit=null;do If();while(Lt!==0);if((Qe&6)!==0)throw Error(i(327));if(u!==null){if(u===o.current)throw Error(i(177));if(E=u.lanes|u.childLanes,E|=Np,E8(o,h,E,M,I,V),o===st&&(Ue=st=null,He=0),go=u,ba=o,Oi=h,Lg=E,zg=w,tk=v,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,ZR(Qn,function(){return vk(),null})):(o.callbackNode=null,o.callbackPriority=0),v=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||v){v=B.T,B.T=null,w=Y.p,Y.p=2,M=Qe,Qe|=4;try{BR(o,u,h)}finally{Qe=M,Y.p=w,B.T=v}}Lt=1,hk(),mk(),pk()}}function hk(){if(Lt===1){Lt=0;var o=ba,u=go,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=B.T,B.T=null;var v=Y.p;Y.p=2;var w=Qe;Qe|=4;try{V_(u,o);var E=Qg,M=J2(o.containerInfo),I=E.focusedElem,V=E.selectionRange;if(M!==I&&I&&I.ownerDocument&&Q2(I.ownerDocument.documentElement,I)){if(V!==null&&kp(I)){var ne=V.start,ue=V.end;if(ue===void 0&&(ue=ne),"selectionStart"in I)I.selectionStart=ne,I.selectionEnd=Math.min(ue,I.value.length);else{var de=I.ownerDocument||document,ie=de&&de.defaultView||window;if(ie.getSelection){var oe=ie.getSelection(),ke=I.textContent.length,Pe=Math.min(V.start,ke),at=V.end===void 0?Pe:Math.min(V.end,ke);!oe.extend&&Pe>at&&(M=at,at=Pe,Pe=M);var Q=Z2(I,Pe),W=Z2(I,at);if(Q&&W&&(oe.rangeCount!==1||oe.anchorNode!==Q.node||oe.anchorOffset!==Q.offset||oe.focusNode!==W.node||oe.focusOffset!==W.offset)){var te=de.createRange();te.setStart(Q.node,Q.offset),oe.removeAllRanges(),Pe>at?(oe.addRange(te),oe.extend(W.node,W.offset)):(te.setEnd(W.node,W.offset),oe.addRange(te))}}}}for(de=[],oe=I;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<de.length;I++){var fe=de[I];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Xf=!!Zg,Qg=Zg=null}finally{Qe=w,Y.p=v,B.T=h}}o.current=u,Lt=2}}function mk(){if(Lt===2){Lt=0;var o=ba,u=go,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=B.T,B.T=null;var v=Y.p;Y.p=2;var w=Qe;Qe|=4;try{U_(o,u.alternate,u)}finally{Qe=w,Y.p=v,B.T=h}}Lt=3}}function pk(){if(Lt===4||Lt===3){Lt=0,Ae();var o=ba,u=go,h=Oi,v=tk;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Lt=5:(Lt=0,go=ba=null,gk(o,o.pendingLanes));var w=o.pendingLanes;if(w===0&&(xa=null),ip(h),u=u.stateNode,Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(ms,u,void 0,(u.current.flags&128)===128)}catch{}if(v!==null){u=B.T,w=Y.p,Y.p=2,B.T=null;try{for(var E=o.onRecoverableError,M=0;M<v.length;M++){var I=v[M];E(I.value,{componentStack:I.stack})}}finally{B.T=u,Y.p=w}}(Oi&3)!==0&&If(),Br(o),w=o.pendingLanes,(h&261930)!==0&&(w&42)!==0?o===Ig?Ws++:(Ws=0,Ig=o):Ws=0,Xs(0)}}function gk(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,As(u)))}function If(){return hk(),mk(),pk(),vk()}function vk(){if(Lt!==5)return!1;var o=ba,u=Lg;Lg=0;var h=ip(Oi),v=B.T,w=Y.p;try{Y.p=32>h?32:h,B.T=null,h=zg,zg=null;var E=ba,M=Oi;if(Lt=0,go=ba=null,Oi=0,(Qe&6)!==0)throw Error(i(331));var I=Qe;if(Qe|=4,Q_(E.current),W_(E,E.current,M,h),Qe=I,Xs(0,!1),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(ms,E)}catch{}return!0}finally{Y.p=w,B.T=v,gk(o,u)}}function yk(o,u,h){u=nr(h,u),u=gg(o.stateNode,u,2),o=ha(o,u,2),o!==null&&(gs(o,2),Br(o))}function nt(o,u,h){if(o.tag===3)yk(o,o,h);else for(;u!==null;){if(u.tag===3){yk(u,o,h);break}else if(u.tag===1){var v=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(xa===null||!xa.has(v))){o=nr(h,o),h=x_(2),v=ha(u,h,2),v!==null&&(b_(h,v,u,o),gs(v,2),Br(v));break}}u=u.return}}function Fg(o,u,h){var v=o.pingCache;if(v===null){v=o.pingCache=new qR;var w=new Set;v.set(u,w)}else w=v.get(u),w===void 0&&(w=new Set,v.set(u,w));w.has(h)||(Pg=!0,w.add(h),o=YR.bind(null,o,u,h),u.then(o,o))}function YR(o,u,h){var v=o.pingCache;v!==null&&v.delete(u),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,st===o&&(He&h)===h&&(St===4||St===3&&(He&62914560)===He&&300>De()-Mf?(Qe&2)===0&&vo(o,0):Dg|=h,po===He&&(po=0)),Br(o)}function xk(o,u){u===0&&(u=h2()),o=Wa(o,u),o!==null&&(gs(o,u),Br(o))}function WR(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),xk(o,h)}function XR(o,u){var h=0;switch(o.tag){case 31:case 13:var v=o.stateNode,w=o.memoizedState;w!==null&&(h=w.retryLane);break;case 19:v=o.stateNode;break;case 22:v=o.stateNode._retryCache;break;default:throw Error(i(314))}v!==null&&v.delete(u),xk(o,h)}function ZR(o,u){return Le(o,u)}var $f=null,xo=null,Ug=!1,Bf=!1,qg=!1,_a=0;function Br(o){o!==xo&&o.next===null&&(xo===null?$f=xo=o:xo=xo.next=o),Bf=!0,Ug||(Ug=!0,JR())}function Xs(o,u){if(!qg&&Bf){qg=!0;do for(var h=!1,v=$f;v!==null;){if(o!==0){var w=v.pendingLanes;if(w===0)var E=0;else{var M=v.suspendedLanes,I=v.pingedLanes;E=(1<<31-Ln(42|o)+1)-1,E&=w&~(M&~I),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(h=!0,kk(v,E))}else E=He,E=qc(v,v===st?E:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(E&3)===0||ps(v,E)||(h=!0,kk(v,E));v=v.next}while(h);qg=!1}}function QR(){bk()}function bk(){Bf=Ug=!1;var o=0;_a!==0&&u9()&&(o=_a);for(var u=De(),h=null,v=$f;v!==null;){var w=v.next,E=wk(v,u);E===0?(v.next=null,h===null?$f=w:h.next=w,w===null&&(xo=h)):(h=v,(o!==0||(E&3)!==0)&&(Bf=!0)),v=w}Lt!==0&&Lt!==5||Xs(o),_a!==0&&(_a=0)}function wk(o,u){for(var h=o.suspendedLanes,v=o.pingedLanes,w=o.expirationTimes,E=o.pendingLanes&-62914561;0<E;){var M=31-Ln(E),I=1<<M,V=w[M];V===-1?((I&h)===0||(I&v)!==0)&&(w[M]=j8(I,u)):V<=u&&(o.expiredLanes|=I),E&=~I}if(u=st,h=He,h=qc(o,o===u?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),v=o.callbackNode,h===0||o===u&&(tt===2||tt===9)||o.cancelPendingCommit!==null)return v!==null&&v!==null&&Re(v),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||ps(o,h)){if(u=h&-h,u===o.callbackPriority)return u;switch(v!==null&&Re(v),ip(h)){case 2:case 8:h=hs;break;case 32:h=Qn;break;case 268435456:h=d2;break;default:h=Qn}return v=_k.bind(null,o),h=Le(h,v),o.callbackPriority=u,o.callbackNode=h,u}return v!==null&&v!==null&&Re(v),o.callbackPriority=2,o.callbackNode=null,2}function _k(o,u){if(Lt!==0&&Lt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(If()&&o.callbackNode!==h)return null;var v=He;return v=qc(o,o===st?v:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),v===0?null:(rk(o,v,u),wk(o,De()),o.callbackNode!=null&&o.callbackNode===h?_k.bind(null,o):null)}function kk(o,u){if(If())return null;rk(o,u,!0)}function JR(){f9(function(){(Qe&6)!==0?Le(di,QR):bk()})}function Hg(){if(_a===0){var o=ro;o===0&&(o=Bc,Bc<<=1,(Bc&261888)===0&&(Bc=256)),_a=o}return _a}function Sk(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Vc(""+o)}function jk(o,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,o.id&&h.setAttribute("form",o.id),u.parentNode.insertBefore(h,u),o=new FormData(o),h.parentNode.removeChild(h),o}function e9(o,u,h,v,w){if(u==="submit"&&h&&h.stateNode===w){var E=Sk((w[kn]||null).action),M=v.submitter;M&&(u=(u=M[kn]||null)?Sk(u.formAction):M.getAttribute("formAction"),u!==null&&(E=u,M=null));var I=new Zc("action","action",null,v,w);o.push({event:I,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(_a!==0){var V=M?jk(w,M):new FormData(w);cg(h,{pending:!0,data:V,method:w.method,action:E},null,V)}}else typeof E=="function"&&(I.preventDefault(),V=M?jk(w,M):new FormData(w),cg(h,{pending:!0,data:V,method:w.method,action:E},E,V))},currentTarget:w}]})}}for(var Gg=0;Gg<Cp.length;Gg++){var Kg=Cp[Gg],t9=Kg.toLowerCase(),n9=Kg[0].toUpperCase()+Kg.slice(1);jr(t9,"on"+n9)}jr(nw,"onAnimationEnd"),jr(rw,"onAnimationIteration"),jr(iw,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(yR,"onTransitionRun"),jr(xR,"onTransitionStart"),jr(bR,"onTransitionCancel"),jr(aw,"onTransitionEnd"),ql("onMouseEnter",["mouseout","mouseover"]),ql("onMouseLeave",["mouseout","mouseover"]),ql("onPointerEnter",["pointerout","pointerover"]),ql("onPointerLeave",["pointerout","pointerover"]),Ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),r9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zs));function Ek(o,u){u=(u&4)!==0;for(var h=0;h<o.length;h++){var v=o[h],w=v.event;v=v.listeners;e:{var E=void 0;if(u)for(var M=v.length-1;0<=M;M--){var I=v[M],V=I.instance,ne=I.currentTarget;if(I=I.listener,V!==E&&w.isPropagationStopped())break e;E=I,w.currentTarget=ne;try{E(w)}catch(ue){ef(ue)}w.currentTarget=null,E=V}else for(M=0;M<v.length;M++){if(I=v[M],V=I.instance,ne=I.currentTarget,I=I.listener,V!==E&&w.isPropagationStopped())break e;E=I,w.currentTarget=ne;try{E(w)}catch(ue){ef(ue)}w.currentTarget=null,E=V}}}}function qe(o,u){var h=u[ap];h===void 0&&(h=u[ap]=new Set);var v=o+"__bubble";h.has(v)||(Ck(u,o,2,!1),h.add(v))}function Vg(o,u,h){var v=0;u&&(v|=4),Ck(h,o,v,u)}var Ff="_reactListening"+Math.random().toString(36).slice(2);function Yg(o){if(!o[Ff]){o[Ff]=!0,b2.forEach(function(h){h!=="selectionchange"&&(r9.has(h)||Vg(h,!1,o),Vg(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[Ff]||(u[Ff]=!0,Vg("selectionchange",!1,u))}}function Ck(o,u,h,v){switch(nS(u)){case 2:var w=T9;break;case 8:w=M9;break;default:w=uv}h=w.bind(null,u,h,o),w=void 0,!mp||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(w=!0),v?w!==void 0?o.addEventListener(u,h,{capture:!0,passive:w}):o.addEventListener(u,h,!0):w!==void 0?o.addEventListener(u,h,{passive:w}):o.addEventListener(u,h,!1)}function Wg(o,u,h,v,w){var E=v;if((u&1)===0&&(u&2)===0&&v!==null)e:for(;;){if(v===null)return;var M=v.tag;if(M===3||M===4){var I=v.stateNode.containerInfo;if(I===w)break;if(M===4)for(M=v.return;M!==null;){var V=M.tag;if((V===3||V===4)&&M.stateNode.containerInfo===w)return;M=M.return}for(;I!==null;){if(M=Bl(I),M===null)return;if(V=M.tag,V===5||V===6||V===26||V===27){v=E=M;continue e}I=I.parentNode}}v=v.return}M2(function(){var ne=E,ue=dp(h),de=[];e:{var ie=lw.get(o);if(ie!==void 0){var oe=Zc,ke=o;switch(o){case"keypress":if(Wc(h)===0)break e;case"keydown":case"keyup":oe=X8;break;case"focusin":ke="focus",oe=yp;break;case"focusout":ke="blur",oe=yp;break;case"beforeblur":case"afterblur":oe=yp;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=R2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=I8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=J8;break;case nw:case rw:case iw:oe=F8;break;case aw:oe=tR;break;case"scroll":case"scrollend":oe=L8;break;case"wheel":oe=rR;break;case"copy":case"cut":case"paste":oe=q8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=z2;break;case"toggle":case"beforetoggle":oe=aR}var Pe=(u&4)!==0,at=!Pe&&(o==="scroll"||o==="scrollend"),Q=Pe?ie!==null?ie+"Capture":null:ie;Pe=[];for(var W=ne,te;W!==null;){var fe=W;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||Q===null||(fe=xs(W,Q),fe!=null&&Pe.push(Qs(W,fe,te))),at)break;W=W.return}0<Pe.length&&(ie=new oe(ie,ke,null,h,ue),de.push({event:ie,listeners:Pe}))}}if((u&7)===0){e:{if(ie=o==="mouseover"||o==="pointerover",oe=o==="mouseout"||o==="pointerout",ie&&h!==fp&&(ke=h.relatedTarget||h.fromElement)&&(Bl(ke)||ke[$l]))break e;if((oe||ie)&&(ie=ue.window===ue?ue:(ie=ue.ownerDocument)?ie.defaultView||ie.parentWindow:window,oe?(ke=h.relatedTarget||h.toElement,oe=ne,ke=ke?Bl(ke):null,ke!==null&&(at=l(ke),Pe=ke.tag,ke!==at||Pe!==5&&Pe!==27&&Pe!==6)&&(ke=null)):(oe=null,ke=ne),oe!==ke)){if(Pe=R2,fe="onMouseLeave",Q="onMouseEnter",W="mouse",(o==="pointerout"||o==="pointerover")&&(Pe=z2,fe="onPointerLeave",Q="onPointerEnter",W="pointer"),at=oe==null?ie:ys(oe),te=ke==null?ie:ys(ke),ie=new Pe(fe,W+"leave",oe,h,ue),ie.target=at,ie.relatedTarget=te,fe=null,Bl(ue)===ne&&(Pe=new Pe(Q,W+"enter",ke,h,ue),Pe.target=te,Pe.relatedTarget=at,fe=Pe),at=fe,oe&&ke)t:{for(Pe=i9,Q=oe,W=ke,te=0,fe=Q;fe;fe=Pe(fe))te++;fe=0;for(var Te=W;Te;Te=Pe(Te))fe++;for(;0<te-fe;)Q=Pe(Q),te--;for(;0<fe-te;)W=Pe(W),fe--;for(;te--;){if(Q===W||W!==null&&Q===W.alternate){Pe=Q;break t}Q=Pe(Q),W=Pe(W)}Pe=null}else Pe=null;oe!==null&&Nk(de,ie,oe,Pe,!1),ke!==null&&at!==null&&Nk(de,at,ke,Pe,!0)}}e:{if(ie=ne?ys(ne):window,oe=ie.nodeName&&ie.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ie.type==="file")var Ye=G2;else if(q2(ie))if(K2)Ye=pR;else{Ye=hR;var je=dR}else oe=ie.nodeName,!oe||oe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&cp(ne.elementType)&&(Ye=G2):Ye=mR;if(Ye&&(Ye=Ye(o,ne))){H2(de,Ye,h,ue);break e}je&&je(o,ie,ne),o==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&up(ie,"number",ie.value)}switch(je=ne?ys(ne):window,o){case"focusin":(q2(je)||je.contentEditable==="true")&&(Wl=je,Sp=ne,Cs=null);break;case"focusout":Cs=Sp=Wl=null;break;case"mousedown":jp=!0;break;case"contextmenu":case"mouseup":case"dragend":jp=!1,ew(de,h,ue);break;case"selectionchange":if(vR)break;case"keydown":case"keyup":ew(de,h,ue)}var $e;if(bp)e:{switch(o){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else Yl?F2(o,h)&&(Ge="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(Ge="onCompositionStart");Ge&&(I2&&h.locale!=="ko"&&(Yl||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Yl&&($e=P2()):(la=ue,pp="value"in la?la.value:la.textContent,Yl=!0)),je=Uf(ne,Ge),0<je.length&&(Ge=new L2(Ge,o,null,h,ue),de.push({event:Ge,listeners:je}),$e?Ge.data=$e:($e=U2(h),$e!==null&&(Ge.data=$e)))),($e=oR?sR(o,h):uR(o,h))&&(Ge=Uf(ne,"onBeforeInput"),0<Ge.length&&(je=new L2("onBeforeInput","beforeinput",null,h,ue),de.push({event:je,listeners:Ge}),je.data=$e)),e9(de,o,ne,h,ue)}Ek(de,u)})}function Qs(o,u,h){return{instance:o,listener:u,currentTarget:h}}function Uf(o,u){for(var h=u+"Capture",v=[];o!==null;){var w=o,E=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||E===null||(w=xs(o,h),w!=null&&v.unshift(Qs(o,w,E)),w=xs(o,u),w!=null&&v.push(Qs(o,w,E))),o.tag===3)return v;o=o.return}return[]}function i9(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function Nk(o,u,h,v,w){for(var E=u._reactName,M=[];h!==null&&h!==v;){var I=h,V=I.alternate,ne=I.stateNode;if(I=I.tag,V!==null&&V===v)break;I!==5&&I!==26&&I!==27||ne===null||(V=ne,w?(ne=xs(h,E),ne!=null&&M.unshift(Qs(h,ne,V))):w||(ne=xs(h,E),ne!=null&&M.push(Qs(h,ne,V)))),h=h.return}M.length!==0&&o.push({event:u,listeners:M})}var a9=/\r\n?/g,l9=/\u0000|\uFFFD/g;function Ok(o){return(typeof o=="string"?o:""+o).replace(a9,`
49
+ `).replace(l9,"")}function Ak(o,u){return u=Ok(u),Ok(o)===u}function it(o,u,h,v,w,E){switch(h){case"children":typeof v=="string"?u==="body"||u==="textarea"&&v===""||Gl(o,v):(typeof v=="number"||typeof v=="bigint")&&u!=="body"&&Gl(o,""+v);break;case"className":Gc(o,"class",v);break;case"tabIndex":Gc(o,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":Gc(o,h,v);break;case"style":A2(o,v,E);break;case"data":if(u!=="object"){Gc(o,"data",v);break}case"src":case"href":if(v===""&&(u!=="a"||h!=="href")){o.removeAttribute(h);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){o.removeAttribute(h);break}v=Vc(""+v),o.setAttribute(h,v);break;case"action":case"formAction":if(typeof v=="function"){o.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof E=="function"&&(h==="formAction"?(u!=="input"&&it(o,u,"name",w.name,w,null),it(o,u,"formEncType",w.formEncType,w,null),it(o,u,"formMethod",w.formMethod,w,null),it(o,u,"formTarget",w.formTarget,w,null)):(it(o,u,"encType",w.encType,w,null),it(o,u,"method",w.method,w,null),it(o,u,"target",w.target,w,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){o.removeAttribute(h);break}v=Vc(""+v),o.setAttribute(h,v);break;case"onClick":v!=null&&(o.onclick=mi);break;case"onScroll":v!=null&&qe("scroll",o);break;case"onScrollEnd":v!=null&&qe("scrollend",o);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(i(61));if(h=v.__html,h!=null){if(w.children!=null)throw Error(i(60));o.innerHTML=h}}break;case"multiple":o.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":o.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){o.removeAttribute("xlink:href");break}h=Vc(""+v),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?o.setAttribute(h,""+v):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":v&&typeof v!="function"&&typeof v!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":v===!0?o.setAttribute(h,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?o.setAttribute(h,v):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?o.setAttribute(h,v):o.removeAttribute(h);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?o.removeAttribute(h):o.setAttribute(h,v);break;case"popover":qe("beforetoggle",o),qe("toggle",o),Hc(o,"popover",v);break;case"xlinkActuate":hi(o,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":hi(o,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":hi(o,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":hi(o,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":hi(o,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":hi(o,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":hi(o,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":hi(o,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":hi(o,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":Hc(o,"is",v);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=D8.get(h)||h,Hc(o,h,v))}}function Xg(o,u,h,v,w,E){switch(h){case"style":A2(o,v,E);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(i(61));if(h=v.__html,h!=null){if(w.children!=null)throw Error(i(60));o.innerHTML=h}}break;case"children":typeof v=="string"?Gl(o,v):(typeof v=="number"||typeof v=="bigint")&&Gl(o,""+v);break;case"onScroll":v!=null&&qe("scroll",o);break;case"onScrollEnd":v!=null&&qe("scrollend",o);break;case"onClick":v!=null&&(o.onclick=mi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!w2.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(w=h.endsWith("Capture"),u=h.slice(2,w?h.length-7:void 0),E=o[kn]||null,E=E!=null?E[h]:null,typeof E=="function"&&o.removeEventListener(u,E,w),typeof v=="function")){typeof E!="function"&&E!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(u,v,w);break e}h in o?o[h]=v:v===!0?o.setAttribute(h,""):Hc(o,h,v)}}}function Jt(o,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",o),qe("load",o);var v=!1,w=!1,E;for(E in h)if(h.hasOwnProperty(E)){var M=h[E];if(M!=null)switch(E){case"src":v=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,u));default:it(o,u,E,M,h,null)}}w&&it(o,u,"srcSet",h.srcSet,h,null),v&&it(o,u,"src",h.src,h,null);return;case"input":qe("invalid",o);var I=E=M=w=null,V=null,ne=null;for(v in h)if(h.hasOwnProperty(v)){var ue=h[v];if(ue!=null)switch(v){case"name":w=ue;break;case"type":M=ue;break;case"checked":V=ue;break;case"defaultChecked":ne=ue;break;case"value":E=ue;break;case"defaultValue":I=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,u));break;default:it(o,u,v,ue,h,null)}}E2(o,E,I,V,ne,M,w,!1);return;case"select":qe("invalid",o),v=M=E=null;for(w in h)if(h.hasOwnProperty(w)&&(I=h[w],I!=null))switch(w){case"value":E=I;break;case"defaultValue":M=I;break;case"multiple":v=I;default:it(o,u,w,I,h,null)}u=E,h=M,o.multiple=!!v,u!=null?Hl(o,!!v,u,!1):h!=null&&Hl(o,!!v,h,!0);return;case"textarea":qe("invalid",o),E=w=v=null;for(M in h)if(h.hasOwnProperty(M)&&(I=h[M],I!=null))switch(M){case"value":v=I;break;case"defaultValue":w=I;break;case"children":E=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(91));break;default:it(o,u,M,I,h,null)}N2(o,v,w,E);return;case"option":for(V in h)if(h.hasOwnProperty(V)&&(v=h[V],v!=null))switch(V){case"selected":o.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:it(o,u,V,v,h,null)}return;case"dialog":qe("beforetoggle",o),qe("toggle",o),qe("cancel",o),qe("close",o);break;case"iframe":case"object":qe("load",o);break;case"video":case"audio":for(v=0;v<Zs.length;v++)qe(Zs[v],o);break;case"image":qe("error",o),qe("load",o);break;case"details":qe("toggle",o);break;case"embed":case"source":case"link":qe("error",o),qe("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in h)if(h.hasOwnProperty(ne)&&(v=h[ne],v!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,u));default:it(o,u,ne,v,h,null)}return;default:if(cp(u)){for(ue in h)h.hasOwnProperty(ue)&&(v=h[ue],v!==void 0&&Xg(o,u,ue,v,h,void 0));return}}for(I in h)h.hasOwnProperty(I)&&(v=h[I],v!=null&&it(o,u,I,v,h,null))}function o9(o,u,h,v){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,E=null,M=null,I=null,V=null,ne=null,ue=null;for(oe in h){var de=h[oe];if(h.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":V=de;default:v.hasOwnProperty(oe)||it(o,u,oe,null,v,de)}}for(var ie in v){var oe=v[ie];if(de=h[ie],v.hasOwnProperty(ie)&&(oe!=null||de!=null))switch(ie){case"type":E=oe;break;case"name":w=oe;break;case"checked":ne=oe;break;case"defaultChecked":ue=oe;break;case"value":M=oe;break;case"defaultValue":I=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,u));break;default:oe!==de&&it(o,u,ie,oe,v,de)}}sp(o,M,I,V,ne,ue,E,w);return;case"select":oe=M=I=ie=null;for(E in h)if(V=h[E],h.hasOwnProperty(E)&&V!=null)switch(E){case"value":break;case"multiple":oe=V;default:v.hasOwnProperty(E)||it(o,u,E,null,v,V)}for(w in v)if(E=v[w],V=h[w],v.hasOwnProperty(w)&&(E!=null||V!=null))switch(w){case"value":ie=E;break;case"defaultValue":I=E;break;case"multiple":M=E;default:E!==V&&it(o,u,w,E,v,V)}u=I,h=M,v=oe,ie!=null?Hl(o,!!h,ie,!1):!!v!=!!h&&(u!=null?Hl(o,!!h,u,!0):Hl(o,!!h,h?[]:"",!1));return;case"textarea":oe=ie=null;for(I in h)if(w=h[I],h.hasOwnProperty(I)&&w!=null&&!v.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:it(o,u,I,null,v,w)}for(M in v)if(w=v[M],E=h[M],v.hasOwnProperty(M)&&(w!=null||E!=null))switch(M){case"value":ie=w;break;case"defaultValue":oe=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:w!==E&&it(o,u,M,w,v,E)}C2(o,ie,oe);return;case"option":for(var ke in h)if(ie=h[ke],h.hasOwnProperty(ke)&&ie!=null&&!v.hasOwnProperty(ke))switch(ke){case"selected":o.selected=!1;break;default:it(o,u,ke,null,v,ie)}for(V in v)if(ie=v[V],oe=h[V],v.hasOwnProperty(V)&&ie!==oe&&(ie!=null||oe!=null))switch(V){case"selected":o.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:it(o,u,V,ie,v,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Pe in h)ie=h[Pe],h.hasOwnProperty(Pe)&&ie!=null&&!v.hasOwnProperty(Pe)&&it(o,u,Pe,null,v,ie);for(ne in v)if(ie=v[ne],oe=h[ne],v.hasOwnProperty(ne)&&ie!==oe&&(ie!=null||oe!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,u));break;default:it(o,u,ne,ie,v,oe)}return;default:if(cp(u)){for(var at in h)ie=h[at],h.hasOwnProperty(at)&&ie!==void 0&&!v.hasOwnProperty(at)&&Xg(o,u,at,void 0,v,ie);for(ue in v)ie=v[ue],oe=h[ue],!v.hasOwnProperty(ue)||ie===oe||ie===void 0&&oe===void 0||Xg(o,u,ue,ie,v,oe);return}}for(var Q in h)ie=h[Q],h.hasOwnProperty(Q)&&ie!=null&&!v.hasOwnProperty(Q)&&it(o,u,Q,null,v,ie);for(de in v)ie=v[de],oe=h[de],!v.hasOwnProperty(de)||ie===oe||ie==null&&oe==null||it(o,u,de,ie,v,oe)}function Tk(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s9(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=0,h=performance.getEntriesByType("resource"),v=0;v<h.length;v++){var w=h[v],E=w.transferSize,M=w.initiatorType,I=w.duration;if(E&&I&&Tk(M)){for(M=0,I=w.responseEnd,v+=1;v<h.length;v++){var V=h[v],ne=V.startTime;if(ne>I)break;var ue=V.transferSize,de=V.initiatorType;ue&&Tk(de)&&(V=V.responseEnd,M+=ue*(V<I?1:(I-ne)/(V-ne)))}if(--v,u+=8*(E+M)/(w.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Zg=null,Qg=null;function qf(o){return o.nodeType===9?o:o.ownerDocument}function Mk(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Pk(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Jg(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var ev=null;function u9(){var o=window.event;return o&&o.type==="popstate"?o===ev?!1:(ev=o,!0):(ev=null,!1)}var Dk=typeof setTimeout=="function"?setTimeout:void 0,c9=typeof clearTimeout=="function"?clearTimeout:void 0,Rk=typeof Promise=="function"?Promise:void 0,f9=typeof queueMicrotask=="function"?queueMicrotask:typeof Rk<"u"?function(o){return Rk.resolve(null).then(o).catch(d9)}:Dk;function d9(o){setTimeout(function(){throw o})}function ka(o){return o==="head"}function Lk(o,u){var h=u,v=0;do{var w=h.nextSibling;if(o.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"||h==="/&"){if(v===0){o.removeChild(w),ko(u);return}v--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")v++;else if(h==="html")Js(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,Js(h);for(var E=h.firstChild;E;){var M=E.nextSibling,I=E.nodeName;E[vs]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&E.rel.toLowerCase()==="stylesheet"||h.removeChild(E),E=M}}else h==="body"&&Js(o.ownerDocument.body);h=w}while(h);ko(u)}function zk(o,u){var h=o;o=0;do{var v=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),v&&v.nodeType===8)if(h=v.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=v}while(h)}function tv(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":tv(h),lp(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function h9(o,u,h,v){for(;o.nodeType===1;){var w=h;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!v&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(v){if(!o[vs])switch(u){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(E=o.getAttribute("rel"),E==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(E!==w.rel||o.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||o.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||o.getAttribute("title")!==(w.title==null?null:w.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(E=o.getAttribute("src"),(E!==(w.src==null?null:w.src)||o.getAttribute("type")!==(w.type==null?null:w.type)||o.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&E&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var E=w.name==null?null:""+w.name;if(w.type==="hidden"&&o.getAttribute("name")===E)return o}else return o;if(o=or(o.nextSibling),o===null)break}return null}function m9(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=or(o.nextSibling),o===null))return null;return o}function Ik(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=or(o.nextSibling),o===null))return null;return o}function nv(o){return o.data==="$?"||o.data==="$~"}function rv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function p9(o,u){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||h.readyState!=="loading")u();else{var v=function(){u(),h.removeEventListener("DOMContentLoaded",v)};h.addEventListener("DOMContentLoaded",v),o._reactRetry=v}}function or(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var iv=null;function $k(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return or(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function Bk(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return o;u--}else h!=="/$"&&h!=="/&"||u++}o=o.previousSibling}return null}function Fk(o,u,h){switch(u=qf(h),o){case"html":if(o=u.documentElement,!o)throw Error(i(452));return o;case"head":if(o=u.head,!o)throw Error(i(453));return o;case"body":if(o=u.body,!o)throw Error(i(454));return o;default:throw Error(i(451))}}function Js(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);lp(o)}var sr=new Map,Uk=new Set;function Hf(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ai=Y.d;Y.d={f:g9,r:v9,D:y9,C:x9,L:b9,m:w9,X:k9,S:_9,M:S9};function g9(){var o=Ai.f(),u=Rf();return o||u}function v9(o){var u=Fl(o);u!==null&&u.tag===5&&u.type==="form"?a_(u):Ai.r(o)}var bo=typeof document>"u"?null:document;function qk(o,u,h){var v=bo;if(v&&typeof u=="string"&&u){var w=er(u);w='link[rel="'+o+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),Uk.has(w)||(Uk.add(w),o={rel:o,crossOrigin:h,href:u},v.querySelector(w)===null&&(u=v.createElement("link"),Jt(u,"link",o),Ut(u),v.head.appendChild(u)))}}function y9(o){Ai.D(o),qk("dns-prefetch",o,null)}function x9(o,u){Ai.C(o,u),qk("preconnect",o,u)}function b9(o,u,h){Ai.L(o,u,h);var v=bo;if(v&&o&&u){var w='link[rel="preload"][as="'+er(u)+'"]';u==="image"&&h&&h.imageSrcSet?(w+='[imagesrcset="'+er(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(w+='[imagesizes="'+er(h.imageSizes)+'"]')):w+='[href="'+er(o)+'"]';var E=w;switch(u){case"style":E=wo(o);break;case"script":E=_o(o)}sr.has(E)||(o=p({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),sr.set(E,o),v.querySelector(w)!==null||u==="style"&&v.querySelector(eu(E))||u==="script"&&v.querySelector(tu(E))||(u=v.createElement("link"),Jt(u,"link",o),Ut(u),v.head.appendChild(u)))}}function w9(o,u){Ai.m(o,u);var h=bo;if(h&&o){var v=u&&typeof u.as=="string"?u.as:"script",w='link[rel="modulepreload"][as="'+er(v)+'"][href="'+er(o)+'"]',E=w;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=_o(o)}if(!sr.has(E)&&(o=p({rel:"modulepreload",href:o},u),sr.set(E,o),h.querySelector(w)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(tu(E)))return}v=h.createElement("link"),Jt(v,"link",o),Ut(v),h.head.appendChild(v)}}}function _9(o,u,h){Ai.S(o,u,h);var v=bo;if(v&&o){var w=Ul(v).hoistableStyles,E=wo(o);u=u||"default";var M=w.get(E);if(!M){var I={loading:0,preload:null};if(M=v.querySelector(eu(E)))I.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":u},h),(h=sr.get(E))&&av(o,h);var V=M=v.createElement("link");Ut(V),Jt(V,"link",o),V._p=new Promise(function(ne,ue){V.onload=ne,V.onerror=ue}),V.addEventListener("load",function(){I.loading|=1}),V.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Gf(M,u,v)}M={type:"stylesheet",instance:M,count:1,state:I},w.set(E,M)}}}function k9(o,u){Ai.X(o,u);var h=bo;if(h&&o){var v=Ul(h).hoistableScripts,w=_o(o),E=v.get(w);E||(E=h.querySelector(tu(w)),E||(o=p({src:o,async:!0},u),(u=sr.get(w))&&lv(o,u),E=h.createElement("script"),Ut(E),Jt(E,"link",o),h.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},v.set(w,E))}}function S9(o,u){Ai.M(o,u);var h=bo;if(h&&o){var v=Ul(h).hoistableScripts,w=_o(o),E=v.get(w);E||(E=h.querySelector(tu(w)),E||(o=p({src:o,async:!0,type:"module"},u),(u=sr.get(w))&&lv(o,u),E=h.createElement("script"),Ut(E),Jt(E,"link",o),h.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},v.set(w,E))}}function Hk(o,u,h,v){var w=(w=we.current)?Hf(w):null;if(!w)throw Error(i(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=wo(h.href),h=Ul(w).hoistableStyles,v=h.get(u),v||(v={type:"style",instance:null,count:0,state:null},h.set(u,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=wo(h.href);var E=Ul(w).hoistableStyles,M=E.get(o);if(M||(w=w.ownerDocument||w,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,M),(E=w.querySelector(eu(o)))&&!E._p&&(M.instance=E,M.state.loading=5),sr.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},sr.set(o,h),E||j9(w,o,h,M.state))),u&&v===null)throw Error(i(528,""));return M}if(u&&v!==null)throw Error(i(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=_o(h),h=Ul(w).hoistableScripts,v=h.get(u),v||(v={type:"script",instance:null,count:0,state:null},h.set(u,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,o))}}function wo(o){return'href="'+er(o)+'"'}function eu(o){return'link[rel="stylesheet"]['+o+"]"}function Gk(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function j9(o,u,h,v){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?v.loading=1:(u=o.createElement("link"),v.preload=u,u.addEventListener("load",function(){return v.loading|=1}),u.addEventListener("error",function(){return v.loading|=2}),Jt(u,"link",h),Ut(u),o.head.appendChild(u))}function _o(o){return'[src="'+er(o)+'"]'}function tu(o){return"script[async]"+o}function Kk(o,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var v=o.querySelector('style[data-href~="'+er(h.href)+'"]');if(v)return u.instance=v,Ut(v),v;var w=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return v=(o.ownerDocument||o).createElement("style"),Ut(v),Jt(v,"style",w),Gf(v,h.precedence,o),u.instance=v;case"stylesheet":w=wo(h.href);var E=o.querySelector(eu(w));if(E)return u.state.loading|=4,u.instance=E,Ut(E),E;v=Gk(h),(w=sr.get(w))&&av(v,w),E=(o.ownerDocument||o).createElement("link"),Ut(E);var M=E;return M._p=new Promise(function(I,V){M.onload=I,M.onerror=V}),Jt(E,"link",v),u.state.loading|=4,Gf(E,h.precedence,o),u.instance=E;case"script":return E=_o(h.src),(w=o.querySelector(tu(E)))?(u.instance=w,Ut(w),w):(v=h,(w=sr.get(E))&&(v=p({},h),lv(v,w)),o=o.ownerDocument||o,w=o.createElement("script"),Ut(w),Jt(w,"link",v),o.head.appendChild(w),u.instance=w);case"void":return null;default:throw Error(i(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(v=u.instance,u.state.loading|=4,Gf(v,h.precedence,o));return u.instance}function Gf(o,u,h){for(var v=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=v.length?v[v.length-1]:null,E=w,M=0;M<v.length;M++){var I=v[M];if(I.dataset.precedence===u)E=I;else if(E!==w)break}E?E.parentNode.insertBefore(o,E.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(o,u.firstChild))}function av(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function lv(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var Kf=null;function Vk(o,u,h){if(Kf===null){var v=new Map,w=Kf=new Map;w.set(h,v)}else w=Kf,v=w.get(h),v||(v=new Map,w.set(h,v));if(v.has(o))return v;for(v.set(o,null),h=h.getElementsByTagName(o),w=0;w<h.length;w++){var E=h[w];if(!(E[vs]||E[Wt]||o==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var M=E.getAttribute(u)||"";M=o+M;var I=v.get(M);I?I.push(E):v.set(M,[E])}}return v}function Yk(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function E9(o,u,h){if(h===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return o=u.disabled,typeof u.precedence=="string"&&o==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function Wk(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function C9(o,u,h,v){if(h.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var w=wo(v.href),E=u.querySelector(eu(w));if(E){u=E._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Vf.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=E,Ut(E);return}E=u.ownerDocument||u,v=Gk(v),(w=sr.get(w))&&av(v,w),E=E.createElement("link"),Ut(E);var M=E;M._p=new Promise(function(I,V){M.onload=I,M.onerror=V}),Jt(E,"link",v),h.instance=E}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Vf.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var ov=0;function N9(o,u){return o.stylesheets&&o.count===0&&Wf(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var v=setTimeout(function(){if(o.stylesheets&&Wf(o,o.stylesheets),o.unsuspend){var E=o.unsuspend;o.unsuspend=null,E()}},6e4+u);0<o.imgBytes&&ov===0&&(ov=62500*s9());var w=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Wf(o,o.stylesheets),o.unsuspend)){var E=o.unsuspend;o.unsuspend=null,E()}},(o.imgBytes>ov?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(v),clearTimeout(w)}}:null}function Vf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wf(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Yf=null;function Wf(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Yf=new Map,u.forEach(O9,o),Yf=null,Vf.call(o))}function O9(o,u){if(!(u.state.loading&4)){var h=Yf.get(o);if(h)var v=h.get(null);else{h=new Map,Yf.set(o,h);for(var w=o.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<w.length;E++){var M=w[E];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(h.set(M.dataset.precedence,M),v=M)}v&&h.set(null,v)}w=u.instance,M=w.getAttribute("data-precedence"),E=h.get(M)||v,E===v&&h.set(null,w),h.set(M,w),this.count++,v=Vf.bind(this),w.addEventListener("load",v),w.addEventListener("error",v),E?E.parentNode.insertBefore(w,E.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(w,o.firstChild)),u.state.loading|=4}}var nu={$$typeof:N,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function A9(o,u,h,v,w,E,M,I,V){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=np(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=np(0),this.hiddenUpdates=np(null),this.identifierPrefix=v,this.onUncaughtError=w,this.onCaughtError=E,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function Xk(o,u,h,v,w,E,M,I,V,ne,ue,de){return o=new A9(o,u,h,M,V,ne,ue,de,I),u=1,E===!0&&(u|=24),E=In(3,null,null,u),o.current=E,E.stateNode=o,u=Bp(),u.refCount++,o.pooledCache=u,u.refCount++,E.memoizedState={element:v,isDehydrated:h,cache:u},Hp(E),o}function Zk(o){return o?(o=Ql,o):Ql}function Qk(o,u,h,v,w,E){w=Zk(w),v.context===null?v.context=w:v.pendingContext=w,v=da(u),v.payload={element:h},E=E===void 0?null:E,E!==null&&(v.callback=E),h=ha(o,v,u),h!==null&&(On(h,o,u),Ds(h,o,u))}function Jk(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function sv(o,u){Jk(o,u),(o=o.alternate)&&Jk(o,u)}function eS(o){if(o.tag===13||o.tag===31){var u=Wa(o,67108864);u!==null&&On(u,o,67108864),sv(o,67108864)}}function tS(o){if(o.tag===13||o.tag===31){var u=qn();u=rp(u);var h=Wa(o,u);h!==null&&On(h,o,u),sv(o,u)}}var Xf=!0;function T9(o,u,h,v){var w=B.T;B.T=null;var E=Y.p;try{Y.p=2,uv(o,u,h,v)}finally{Y.p=E,B.T=w}}function M9(o,u,h,v){var w=B.T;B.T=null;var E=Y.p;try{Y.p=8,uv(o,u,h,v)}finally{Y.p=E,B.T=w}}function uv(o,u,h,v){if(Xf){var w=cv(v);if(w===null)Wg(o,u,v,Zf,h),rS(o,v);else if(D9(w,o,u,h,v))v.stopPropagation();else if(rS(o,v),u&4&&-1<P9.indexOf(o)){for(;w!==null;){var E=Fl(w);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var M=Ha(E.pendingLanes);if(M!==0){var I=E;for(I.pendingLanes|=2,I.entangledLanes|=2;M;){var V=1<<31-Ln(M);I.entanglements[1]|=V,M&=~V}Br(E),(Qe&6)===0&&(Pf=De()+500,Xs(0))}}break;case 31:case 13:I=Wa(E,2),I!==null&&On(I,E,2),Rf(),sv(E,2)}if(E=cv(v),E===null&&Wg(o,u,v,Zf,h),E===w)break;w=E}w!==null&&v.stopPropagation()}else Wg(o,u,v,null,h)}}function cv(o){return o=dp(o),fv(o)}var Zf=null;function fv(o){if(Zf=null,o=Bl(o),o!==null){var u=l(o);if(u===null)o=null;else{var h=u.tag;if(h===13){if(o=s(u),o!==null)return o;o=null}else if(h===31){if(o=c(u),o!==null)return o;o=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return Zf=o,null}function nS(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ze()){case di:return 2;case hs:return 8;case Qn:case Dn:return 32;case d2:return 268435456;default:return 32}default:return 32}}var dv=!1,Sa=null,ja=null,Ea=null,ru=new Map,iu=new Map,Ca=[],P9="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function rS(o,u){switch(o){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":ja=null;break;case"mouseover":case"mouseout":Ea=null;break;case"pointerover":case"pointerout":ru.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":iu.delete(u.pointerId)}}function au(o,u,h,v,w,E){return o===null||o.nativeEvent!==E?(o={blockedOn:u,domEventName:h,eventSystemFlags:v,nativeEvent:E,targetContainers:[w]},u!==null&&(u=Fl(u),u!==null&&eS(u)),o):(o.eventSystemFlags|=v,u=o.targetContainers,w!==null&&u.indexOf(w)===-1&&u.push(w),o)}function D9(o,u,h,v,w){switch(u){case"focusin":return Sa=au(Sa,o,u,h,v,w),!0;case"dragenter":return ja=au(ja,o,u,h,v,w),!0;case"mouseover":return Ea=au(Ea,o,u,h,v,w),!0;case"pointerover":var E=w.pointerId;return ru.set(E,au(ru.get(E)||null,o,u,h,v,w)),!0;case"gotpointercapture":return E=w.pointerId,iu.set(E,au(iu.get(E)||null,o,u,h,v,w)),!0}return!1}function iS(o){var u=Bl(o.target);if(u!==null){var h=l(u);if(h!==null){if(u=h.tag,u===13){if(u=s(h),u!==null){o.blockedOn=u,y2(o.priority,function(){tS(h)});return}}else if(u===31){if(u=c(h),u!==null){o.blockedOn=u,y2(o.priority,function(){tS(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qf(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var h=cv(o.nativeEvent);if(h===null){h=o.nativeEvent;var v=new h.constructor(h.type,h);fp=v,h.target.dispatchEvent(v),fp=null}else return u=Fl(h),u!==null&&eS(u),o.blockedOn=h,!1;u.shift()}return!0}function aS(o,u,h){Qf(o)&&h.delete(u)}function R9(){dv=!1,Sa!==null&&Qf(Sa)&&(Sa=null),ja!==null&&Qf(ja)&&(ja=null),Ea!==null&&Qf(Ea)&&(Ea=null),ru.forEach(aS),iu.forEach(aS)}function Jf(o,u){o.blockedOn===u&&(o.blockedOn=null,dv||(dv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R9)))}var ed=null;function lS(o){ed!==o&&(ed=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ed===o&&(ed=null);for(var u=0;u<o.length;u+=3){var h=o[u],v=o[u+1],w=o[u+2];if(typeof v!="function"){if(fv(v||h)===null)continue;break}var E=Fl(h);E!==null&&(o.splice(u,3),u-=3,cg(E,{pending:!0,data:w,method:h.method,action:v},v,w))}}))}function ko(o){function u(V){return Jf(V,o)}Sa!==null&&Jf(Sa,o),ja!==null&&Jf(ja,o),Ea!==null&&Jf(Ea,o),ru.forEach(u),iu.forEach(u);for(var h=0;h<Ca.length;h++){var v=Ca[h];v.blockedOn===o&&(v.blockedOn=null)}for(;0<Ca.length&&(h=Ca[0],h.blockedOn===null);)iS(h),h.blockedOn===null&&Ca.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(v=0;v<h.length;v+=3){var w=h[v],E=h[v+1],M=w[kn]||null;if(typeof E=="function")M||lS(h);else if(M){var I=null;if(E&&E.hasAttribute("formAction")){if(w=E,M=E[kn]||null)I=M.formAction;else if(fv(w)!==null)continue}else I=M.action;typeof I=="function"?h[v+1]=I:(h.splice(v,3),v-=3),lS(h)}}}function oS(){function o(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(M){return w=M})},focusReset:"manual",scroll:"manual"})}function u(){w!==null&&(w(),w=null),v||setTimeout(h,20)}function h(){if(!v&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,w=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){v=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),w!==null&&(w(),w=null)}}}function hv(o){this._internalRoot=o}td.prototype.render=hv.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(i(409));var h=u.current,v=qn();Qk(h,v,o,u,null,null)},td.prototype.unmount=hv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;Qk(o.current,2,null,o,null,null),Rf(),u[$l]=null}};function td(o){this._internalRoot=o}td.prototype.unstable_scheduleHydration=function(o){if(o){var u=v2();o={blockedOn:null,target:o,priority:u};for(var h=0;h<Ca.length&&u!==0&&u<Ca[h].priority;h++);Ca.splice(h,0,o),h===0&&iS(o)}};var sS=n.version;if(sS!=="19.2.4")throw Error(i(527,sS,"19.2.4"));Y.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(i(188)):(o=Object.keys(o).join(","),Error(i(268,o)));return o=d(u),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var L9={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{ms=nd.inject(L9),Rn=nd}catch{}}return ou.createRoot=function(o,u){if(!a(o))throw Error(i(299));var h=!1,v="",w=p_,E=g_,M=v_;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(E=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError)),u=Xk(o,1,!1,null,null,h,v,null,w,E,M,oS),o[$l]=u.current,Yg(o),new hv(u)},ou.hydrateRoot=function(o,u,h){if(!a(o))throw Error(i(299));var v=!1,w="",E=p_,M=g_,I=v_,V=null;return h!=null&&(h.unstable_strictMode===!0&&(v=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onUncaughtError!==void 0&&(E=h.onUncaughtError),h.onCaughtError!==void 0&&(M=h.onCaughtError),h.onRecoverableError!==void 0&&(I=h.onRecoverableError),h.formState!==void 0&&(V=h.formState)),u=Xk(o,1,!0,u,h??null,v,w,V,E,M,I,oS),u.context=Zk(null),h=u.current,v=qn(),v=rp(v),w=da(v),w.callback=null,ha(h,w,v),h=v,u.current.lanes=h,gs(u,h),Br(u),o[$l]=u.current,Yg(o),new td(u)},ou.version="19.2.4",ou}var yS;function W9(){if(yS)return gv.exports;yS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),gv.exports=Y9(),gv.exports}var X9=W9();const Z9=oi(X9);/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var xS="popstate";function bS(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Q9(e={}){function n(i,a){var d;let l=(d=a.state)==null?void 0:d.masked,{pathname:s,search:c,hash:f}=l||i.location;return Ey("",{pathname:s,search:c,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function r(i,a){return typeof a=="string"?a:qu(a)}return e6(n,r,null,e)}function wt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function ti(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function J9(){return Math.random().toString(36).substring(2,10)}function wS(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ey(e,n,r=null,i,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?es(n):n,state:r,key:n&&n.key||i||J9(),unstable_mask:a}}function qu({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function es(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(n.search=e.substring(i),e=e.substring(0,i)),e&&(n.pathname=e)}return n}function e6(e,n,r,i={}){let{window:a=document.defaultView,v5Compat:l=!1}=i,s=a.history,c="POP",f=null,d=m();d==null&&(d=0,s.replaceState({...s.state,idx:d},""));function m(){return(s.state||{idx:null}).idx}function p(){c="POP";let k=m(),j=k==null?null:k-d;d=k,f&&f({action:c,location:S.location,delta:j})}function y(k,j){c="PUSH";let C=bS(k)?k:Ey(S.location,k,j);d=m()+1;let N=wS(C,d),O=S.createHref(C.unstable_mask||C);try{s.pushState(N,"",O)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;a.location.assign(O)}l&&f&&f({action:c,location:S.location,delta:1})}function x(k,j){c="REPLACE";let C=bS(k)?k:Ey(S.location,k,j);d=m();let N=wS(C,d),O=S.createHref(C.unstable_mask||C);s.replaceState(N,"",O),l&&f&&f({action:c,location:S.location,delta:0})}function _(k){return t6(k)}let S={get action(){return c},get location(){return e(a,s)},listen(k){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(xS,p),f=k,()=>{a.removeEventListener(xS,p),f=null}},createHref(k){return n(a,k)},createURL:_,encodeLocation(k){let j=_(k);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:x,go(k){return s.go(k)}};return S}function t6(e,n=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),wt(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:qu(e);return i=i.replace(/ $/,"%20"),!n&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function UO(e,n,r="/"){return n6(e,n,r,!1)}function n6(e,n,r,i){let a=typeof n=="string"?es(n):n,l=Hi(a.pathname||"/",r);if(l==null)return null;let s=qO(e);r6(s);let c=null;for(let f=0;c==null&&f<s.length;++f){let d=m6(l);c=d6(s[f],d,i)}return c}function qO(e,n=[],r=[],i="",a=!1){let l=(s,c,f=a,d)=>{let m={relativePath:d===void 0?s.path||"":d,caseSensitive:s.caseSensitive===!0,childrenIndex:c,route:s};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&f)return;wt(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let p=Qr([i,m.relativePath]),y=r.concat(m);s.children&&s.children.length>0&&(wt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),qO(s.children,n,y,p,f)),!(s.path==null&&!s.index)&&n.push({path:p,score:c6(p,s.index),routesMeta:y})};return e.forEach((s,c)=>{var f;if(s.path===""||!((f=s.path)!=null&&f.includes("?")))l(s,c);else for(let d of HO(s.path))l(s,c,!0,d)}),n}function HO(e){let n=e.split("/");if(n.length===0)return[];let[r,...i]=n,a=r.endsWith("?"),l=r.replace(/\?$/,"");if(i.length===0)return a?[l,""]:[l];let s=HO(i.join("/")),c=[];return c.push(...s.map(f=>f===""?l:[l,f].join("/"))),a&&c.push(...s),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function r6(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:f6(n.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var i6=/^:[\w-]+$/,a6=3,l6=2,o6=1,s6=10,u6=-2,_S=e=>e==="*";function c6(e,n){let r=e.split("/"),i=r.length;return r.some(_S)&&(i+=u6),n&&(i+=l6),r.filter(a=>!_S(a)).reduce((a,l)=>a+(i6.test(l)?a6:l===""?o6:s6),i)}function f6(e,n){return e.length===n.length&&e.slice(0,-1).every((i,a)=>i===n[a])?e[e.length-1]-n[n.length-1]:0}function d6(e,n,r=!1){let{routesMeta:i}=e,a={},l="/",s=[];for(let c=0;c<i.length;++c){let f=i[c],d=c===i.length-1,m=l==="/"?n:n.slice(l.length)||"/",p=Ud({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!p&&d&&r&&!i[i.length-1].route.index&&(p=Ud({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!p)return null;Object.assign(a,p.params),s.push({params:a,pathname:Qr([l,p.pathname]),pathnameBase:y6(Qr([l,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(l=Qr([l,p.pathnameBase]))}return s}function Ud(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=h6(e.path,e.caseSensitive,e.end),a=n.match(r);if(!a)return null;let l=a[0],s=l.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:i.reduce((d,{paramName:m,isOptional:p},y)=>{if(m==="*"){let _=c[y]||"";s=l.slice(0,l.length-_.length).replace(/(.)\/+$/,"$1")}const x=c[y];return p&&!x?d[m]=void 0:d[m]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:s,pattern:e}}function h6(e,n=!1,r=!0){ti(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,c,f,d,m)=>{if(i.push({paramName:c,isOptional:f!=null}),f){let p=m.charAt(d+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,n?void 0:"i"),i]}function m6(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return ti(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Hi(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}var p6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function g6(e,n="/"){let{pathname:r,search:i="",hash:a=""}=typeof e=="string"?es(e):e,l;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?l=kS(r.substring(1),"/"):l=kS(r,n)):l=n,{pathname:l,search:x6(i),hash:b6(a)}}function kS(e,n){let r=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function bv(e,n,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(i)}]. 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 v6(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function GO(e){let n=v6(e);return n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase)}function Wx(e,n,r,i=!1){let a;typeof e=="string"?a=es(e):(a={...e},wt(!a.pathname||!a.pathname.includes("?"),bv("?","pathname","search",a)),wt(!a.pathname||!a.pathname.includes("#"),bv("#","pathname","hash",a)),wt(!a.search||!a.search.includes("#"),bv("#","search","hash",a)));let l=e===""||a.pathname==="",s=l?"/":a.pathname,c;if(s==null)c=r;else{let p=n.length-1;if(!i&&s.startsWith("..")){let y=s.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}c=p>=0?n[p]:"/"}let f=g6(a,c),d=s&&s!=="/"&&s.endsWith("/"),m=(l||s===".")&&r.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var Qr=e=>e.join("/").replace(/\/\/+/g,"/"),y6=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),x6=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,b6=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,w6=class{constructor(e,n,r,i=!1){this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function _6(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function k6(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var KO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function VO(e,n){let r=e;if(typeof r!="string"||!p6.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,a=!1;if(KO)try{let l=new URL(window.location.href),s=r.startsWith("//")?new URL(l.protocol+r):new URL(r),c=Hi(s.pathname,n);s.origin===l.origin&&c!=null?r=c+s.search+s.hash:a=!0}catch{ti(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:a,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var YO=["POST","PUT","PATCH","DELETE"];new Set(YO);var S6=["GET",...YO];new Set(S6);var ts=b.createContext(null);ts.displayName="DataRouter";var rm=b.createContext(null);rm.displayName="DataRouterState";var j6=b.createContext(!1),WO=b.createContext({isTransitioning:!1});WO.displayName="ViewTransition";var E6=b.createContext(new Map);E6.displayName="Fetchers";var C6=b.createContext(null);C6.displayName="Await";var _r=b.createContext(null);_r.displayName="Navigation";var fc=b.createContext(null);fc.displayName="Location";var Qi=b.createContext({outlet:null,matches:[],isDataRoute:!1});Qi.displayName="Route";var Xx=b.createContext(null);Xx.displayName="RouteError";var XO="REACT_ROUTER_ERROR",N6="REDIRECT",O6="ROUTE_ERROR_RESPONSE";function A6(e){if(e.startsWith(`${XO}:${N6}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function T6(e){if(e.startsWith(`${XO}:${O6}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new w6(n.status,n.statusText,n.data)}catch{}}function M6(e,{relative:n}={}){wt(dc(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=b.useContext(_r),{hash:a,pathname:l,search:s}=hc(e,{relative:n}),c=l;return r!=="/"&&(c=l==="/"?r:Qr([r,l])),i.createHref({pathname:c,search:s,hash:a})}function dc(){return b.useContext(fc)!=null}function Ba(){return wt(dc(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(fc).location}var ZO="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function QO(e){b.useContext(_r).static||b.useLayoutEffect(e)}function P6(){let{isDataRoute:e}=b.useContext(Qi);return e?K6():D6()}function D6(){wt(dc(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(ts),{basename:n,navigator:r}=b.useContext(_r),{matches:i}=b.useContext(Qi),{pathname:a}=Ba(),l=JSON.stringify(GO(i)),s=b.useRef(!1);return QO(()=>{s.current=!0}),b.useCallback((f,d={})=>{if(ti(s.current,ZO),!s.current)return;if(typeof f=="number"){r.go(f);return}let m=Wx(f,JSON.parse(l),a,d.relative==="path");e==null&&n!=="/"&&(m.pathname=m.pathname==="/"?n:Qr([n,m.pathname])),(d.replace?r.replace:r.push)(m,d.state,d)},[n,r,l,a,e])}b.createContext(null);function hc(e,{relative:n}={}){let{matches:r}=b.useContext(Qi),{pathname:i}=Ba(),a=JSON.stringify(GO(r));return b.useMemo(()=>Wx(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function R6(e,n){return JO(e,n)}function JO(e,n,r){var k;wt(dc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(_r),{matches:a}=b.useContext(Qi),l=a[a.length-1],s=l?l.params:{},c=l?l.pathname:"/",f=l?l.pathnameBase:"/",d=l&&l.route;{let j=d&&d.path||"";tA(c,!d||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${j}">) 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.
59
+
60
+ Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let m=Ba(),p;if(n){let j=typeof n=="string"?es(n):n;wt(f==="/"||((k=j.pathname)==null?void 0:k.startsWith(f)),`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 "${f}" but pathname "${j.pathname}" was given in the \`location\` prop.`),p=j}else p=m;let y=p.pathname||"/",x=y;if(f!=="/"){let j=f.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(j.length).join("/")}let _=UO(e,{pathname:x});ti(d||_!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),ti(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=B6(_&&_.map(j=>Object.assign({},j,{params:Object.assign({},s,j.params),pathname:Qr([f,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?f:Qr([f,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),a,r);return n&&S?b.createElement(fc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},S):S}function L6(){let e=G6(),n=_6(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i},l={padding:"2px 4px",backgroundColor:i},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},n),r?b.createElement("pre",{style:a},r):null,s)}var z6=b.createElement(L6,null),eA=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=T6(e.digest);r&&(e=r)}let n=e!==void 0?b.createElement(Qi.Provider,{value:this.props.routeContext},b.createElement(Xx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(I6,{error:e},n):n}};eA.contextType=j6;var wv=new WeakMap;function I6({children:e,error:n}){let{basename:r}=b.useContext(_r);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let i=A6(n.digest);if(i){let a=wv.get(n);if(a)throw a;let l=VO(i.location,r);if(KO&&!wv.get(n))if(l.isExternal||i.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:i.replace}));throw wv.set(n,s),s}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function $6({routeContext:e,match:n,children:r}){let i=b.useContext(ts);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Qi.Provider,{value:e},r)}function B6(e,n=[],r){let i=r==null?void 0:r.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(n.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,l=i==null?void 0:i.errors;if(l!=null){let m=a.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);wt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let m=0;m<a.length;m++){let p=a[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=m),p.route.id){let{loaderData:y,errors:x}=i,_=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||_){r.isStatic&&(s=!0),c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let f=r==null?void 0:r.onError,d=i&&f?(m,p)=>{var y,x;f(m,{location:i.location,params:((x=(y=i.matches)==null?void 0:y[0])==null?void 0:x.params)??{},unstable_pattern:k6(i.matches),errorInfo:p})}:void 0;return a.reduceRight((m,p,y)=>{let x,_=!1,S=null,k=null;i&&(x=l&&p.route.id?l[p.route.id]:void 0,S=p.route.errorElement||z6,s&&(c<0&&y===0?(tA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,k=null):c===y&&(_=!0,k=p.route.hydrateFallbackElement||null)));let j=n.concat(a.slice(0,y+1)),C=()=>{let N;return x?N=S:_?N=k:p.route.Component?N=b.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=m,b.createElement($6,{match:p,routeContext:{outlet:m,matches:j,isDataRoute:i!=null},children:N})};return i&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?b.createElement(eA,{location:i.location,revalidation:i.revalidation,component:S,error:x,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:d}):C()},null)}function Zx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function F6(e){let n=b.useContext(ts);return wt(n,Zx(e)),n}function U6(e){let n=b.useContext(rm);return wt(n,Zx(e)),n}function q6(e){let n=b.useContext(Qi);return wt(n,Zx(e)),n}function Qx(e){let n=q6(e),r=n.matches[n.matches.length-1];return wt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function H6(){return Qx("useRouteId")}function G6(){var i;let e=b.useContext(Xx),n=U6("useRouteError"),r=Qx("useRouteError");return e!==void 0?e:(i=n.errors)==null?void 0:i[r]}function K6(){let{router:e}=F6("useNavigate"),n=Qx("useNavigate"),r=b.useRef(!1);return QO(()=>{r.current=!0}),b.useCallback(async(a,l={})=>{ti(r.current,ZO),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:n,...l}))},[e,n])}var SS={};function tA(e,n,r){!n&&!SS[e]&&(SS[e]=!0,ti(!1,r))}b.memo(V6);function V6({routes:e,future:n,state:r,isStatic:i,onError:a}){return JO(e,void 0,{state:r,isStatic:i,onError:a})}function hl(e){wt(!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 Y6({basename:e="/",children:n=null,location:r,navigationType:i="POP",navigator:a,static:l=!1,unstable_useTransitions:s}){wt(!dc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=b.useMemo(()=>({basename:c,navigator:a,static:l,unstable_useTransitions:s,future:{}}),[c,a,l,s]);typeof r=="string"&&(r=es(r));let{pathname:d="/",search:m="",hash:p="",state:y=null,key:x="default",unstable_mask:_}=r,S=b.useMemo(()=>{let k=Hi(d,c);return k==null?null:{location:{pathname:k,search:m,hash:p,state:y,key:x,unstable_mask:_},navigationType:i}},[c,d,m,p,y,x,i,_]);return ti(S!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:b.createElement(_r.Provider,{value:f},b.createElement(fc.Provider,{children:n,value:S}))}function W6({children:e,location:n}){return R6(Cy(e),n)}function Cy(e,n=[]){let r=[];return b.Children.forEach(e,(i,a)=>{if(!b.isValidElement(i))return;let l=[...n,a];if(i.type===b.Fragment){r.push.apply(r,Cy(i.props.children,l));return}wt(i.type===hl,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),wt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let s={id:i.props.id||l.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(s.children=Cy(i.props.children,l)),r.push(s)}),r}var Ad="get",Td="application/x-www-form-urlencoded";function im(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function X6(e){return im(e)&&e.tagName.toLowerCase()==="button"}function Z6(e){return im(e)&&e.tagName.toLowerCase()==="form"}function Q6(e){return im(e)&&e.tagName.toLowerCase()==="input"}function J6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function e7(e,n){return e.button===0&&(!n||n==="_self")&&!J6(e)}var id=null;function t7(){if(id===null)try{new FormData(document.createElement("form"),0),id=!1}catch{id=!0}return id}var n7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _v(e){return e!=null&&!n7.has(e)?(ti(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Td}"`),null):e}function r7(e,n){let r,i,a,l,s;if(Z6(e)){let c=e.getAttribute("action");i=c?Hi(c,n):null,r=e.getAttribute("method")||Ad,a=_v(e.getAttribute("enctype"))||Td,l=new FormData(e)}else if(X6(e)||Q6(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(i=f?Hi(f,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Ad,a=_v(e.getAttribute("formenctype"))||_v(c.getAttribute("enctype"))||Td,l=new FormData(c,e),!t7()){let{name:d,type:m,value:p}=e;if(m==="image"){let y=d?`${d}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else d&&l.append(d,p)}}else{if(im(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ad,i=null,a=Td,s=e}return l&&a==="text/plain"&&(s=l,l=void 0),{action:i,method:r.toLowerCase(),encType:a,formData:l,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jx(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function i7(e,n,r,i){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${i}`:a.pathname=`${a.pathname}.${i}`:a.pathname==="/"?a.pathname=`_root.${i}`:n&&Hi(a.pathname,n)==="/"?a.pathname=`${n.replace(/\/$/,"")}/_root.${i}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${i}`,a}async function a7(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function l7(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function o7(e,n,r){let i=await Promise.all(e.map(async a=>{let l=n.routes[a.route.id];if(l){let s=await a7(l,r);return s.links?s.links():[]}return[]}));return f7(i.flat(1).filter(l7).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function jS(e,n,r,i,a,l){let s=(f,d)=>r[d]?f.route.id!==r[d].route.id:!0,c=(f,d)=>{var m;return r[d].pathname!==f.pathname||((m=r[d].route.path)==null?void 0:m.endsWith("*"))&&r[d].params["*"]!==f.params["*"]};return l==="assets"?n.filter((f,d)=>s(f,d)||c(f,d)):l==="data"?n.filter((f,d)=>{var p;let m=i.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(s(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function s7(e,n,{includeHydrateFallback:r}={}){return u7(e.map(i=>{let a=n.routes[i.route.id];if(!a)return[];let l=[a.module];return a.clientActionModule&&(l=l.concat(a.clientActionModule)),a.clientLoaderModule&&(l=l.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(l=l.concat(a.hydrateFallbackModule)),a.imports&&(l=l.concat(a.imports)),l}).flat(1))}function u7(e){return[...new Set(e)]}function c7(e){let n={},r=Object.keys(e).sort();for(let i of r)n[i]=e[i];return n}function f7(e,n){let r=new Set;return new Set(n),e.reduce((i,a)=>{let l=JSON.stringify(c7(a));return r.has(l)||(r.add(l),i.push({key:l,link:a})),i},[])}function nA(){let e=b.useContext(ts);return Jx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function d7(){let e=b.useContext(rm);return Jx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var eb=b.createContext(void 0);eb.displayName="FrameworkContext";function rA(){let e=b.useContext(eb);return Jx(e,"You must render this element inside a <HydratedRouter> element"),e}function h7(e,n){let r=b.useContext(eb),[i,a]=b.useState(!1),[l,s]=b.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:p}=n,y=b.useRef(null);b.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let S=j=>{j.forEach(C=>{s(C.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return y.current&&k.observe(y.current),()=>{k.disconnect()}}},[e]),b.useEffect(()=>{if(i){let S=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(S)}}},[i]);let x=()=>{a(!0)},_=()=>{a(!1),s(!1)};return r?e!=="intent"?[l,y,{}]:[l,y,{onFocus:su(c,x),onBlur:su(f,_),onMouseEnter:su(d,x),onMouseLeave:su(m,_),onTouchStart:su(p,x)}]:[!1,y,{}]}function su(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function m7({page:e,...n}){let{router:r}=nA(),i=b.useMemo(()=>UO(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?b.createElement(g7,{page:e,matches:i,...n}):null}function p7(e){let{manifest:n,routeModules:r}=rA(),[i,a]=b.useState([]);return b.useEffect(()=>{let l=!1;return o7(e,n,r).then(s=>{l||a(s)}),()=>{l=!0}},[e,n,r]),i}function g7({page:e,matches:n,...r}){let i=Ba(),{future:a,manifest:l,routeModules:s}=rA(),{basename:c}=nA(),{loaderData:f,matches:d}=d7(),m=b.useMemo(()=>jS(e,n,d,l,i,"data"),[e,n,d,l,i]),p=b.useMemo(()=>jS(e,n,d,l,i,"assets"),[e,n,d,l,i]),y=b.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let S=new Set,k=!1;if(n.forEach(C=>{var O;let N=l.routes[C.route.id];!N||!N.hasLoader||(!m.some(T=>T.route.id===C.route.id)&&C.route.id in f&&((O=s[C.route.id])!=null&&O.shouldRevalidate)||N.hasClientLoader?k=!0:S.add(C.route.id))}),S.size===0)return[];let j=i7(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&j.searchParams.set("_routes",n.filter(C=>S.has(C.route.id)).map(C=>C.route.id).join(",")),[j.pathname+j.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,i,l,m,n,e,s]),x=b.useMemo(()=>s7(p,l),[p,l]),_=p7(p);return b.createElement(b.Fragment,null,y.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),x.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),_.map(({key:S,link:k})=>b.createElement("link",{key:S,nonce:r.nonce,...k,crossOrigin:k.crossOrigin??r.crossOrigin})))}function v7(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var y7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{y7&&(window.__reactRouterVersion="7.13.1")}catch{}function x7({basename:e,children:n,unstable_useTransitions:r,window:i}){let a=b.useRef();a.current==null&&(a.current=Q9({window:i,v5Compat:!0}));let l=a.current,[s,c]=b.useState({action:l.action,location:l.location}),f=b.useCallback(d=>{r===!1?c(d):b.startTransition(()=>c(d))},[r]);return b.useLayoutEffect(()=>l.listen(f),[l,f]),b.createElement(Y6,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:l,unstable_useTransitions:r})}var iA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,aA=b.forwardRef(function({onClick:n,discover:r="render",prefetch:i="none",relative:a,reloadDocument:l,replace:s,unstable_mask:c,state:f,target:d,to:m,preventScrollReset:p,viewTransition:y,unstable_defaultShouldRevalidate:x,..._},S){let{basename:k,navigator:j,unstable_useTransitions:C}=b.useContext(_r),N=typeof m=="string"&&iA.test(m),O=VO(m,k);m=O.to;let T=M6(m,{relative:a}),A=Ba(),P=null;if(c){let G=Wx(c,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);k!=="/"&&(G.pathname=G.pathname==="/"?k:Qr([k,G.pathname])),P=j.createHref(G)}let[R,z,D]=h7(i,_),U=_7(m,{replace:s,unstable_mask:c,state:f,target:d,preventScrollReset:p,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:x,unstable_useTransitions:C});function q(G){n&&n(G),G.defaultPrevented||U(G)}let L=!(O.isExternal||l),$=b.createElement("a",{..._,...D,href:(L?P:void 0)||O.absoluteURL||T,onClick:L?q:n,ref:v7(S,z),target:d,"data-discover":!N&&r==="render"?"true":void 0});return R&&!N?b.createElement(b.Fragment,null,$,b.createElement(m7,{page:T})):$});aA.displayName="Link";var lA=b.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:i="",end:a=!1,style:l,to:s,viewTransition:c,children:f,...d},m){let p=hc(s,{relative:d.relative}),y=Ba(),x=b.useContext(rm),{navigator:_,basename:S}=b.useContext(_r),k=x!=null&&C7(p)&&c===!0,j=_.encodeLocation?_.encodeLocation(p).pathname:p.pathname,C=y.pathname,N=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(C=C.toLowerCase(),N=N?N.toLowerCase():null,j=j.toLowerCase()),N&&S&&(N=Hi(N,S)||N);const O=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let T=C===j||!a&&C.startsWith(j)&&C.charAt(O)==="/",A=N!=null&&(N===j||!a&&N.startsWith(j)&&N.charAt(j.length)==="/"),P={isActive:T,isPending:A,isTransitioning:k},R=T?n:void 0,z;typeof i=="function"?z=i(P):z=[i,T?"active":null,A?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let D=typeof l=="function"?l(P):l;return b.createElement(aA,{...d,"aria-current":R,className:z,ref:m,style:D,to:s,viewTransition:c},typeof f=="function"?f(P):f)});lA.displayName="NavLink";var b7=b.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:i,replace:a,state:l,method:s=Ad,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...x},_)=>{let{unstable_useTransitions:S}=b.useContext(_r),k=j7(),j=E7(c,{relative:d}),C=s.toLowerCase()==="get"?"get":"post",N=typeof c=="string"&&iA.test(c),O=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let A=T.nativeEvent.submitter,P=(A==null?void 0:A.getAttribute("formmethod"))||s,R=()=>k(A||T.currentTarget,{fetcherKey:n,method:P,navigate:r,replace:a,state:l,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y});S&&r!==!1?b.startTransition(()=>R()):R()};return b.createElement("form",{ref:_,method:C,action:j,onSubmit:i?f:O,...x,"data-discover":!N&&e==="render"?"true":void 0})});b7.displayName="Form";function w7(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oA(e){let n=b.useContext(ts);return wt(n,w7(e)),n}function _7(e,{target:n,replace:r,unstable_mask:i,state:a,preventScrollReset:l,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let m=P6(),p=Ba(),y=hc(e,{relative:s});return b.useCallback(x=>{if(e7(x,n)){x.preventDefault();let _=r!==void 0?r:qu(p)===qu(y),S=()=>m(e,{replace:_,unstable_mask:i,state:a,preventScrollReset:l,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f});d?b.startTransition(()=>S()):S()}},[p,m,y,r,i,a,n,e,l,s,c,f,d])}var k7=0,S7=()=>`__${String(++k7)}__`;function j7(){let{router:e}=oA("useSubmit"),{basename:n}=b.useContext(_r),r=H6(),i=e.fetch,a=e.navigate;return b.useCallback(async(l,s={})=>{let{action:c,method:f,encType:d,formData:m,body:p}=r7(l,n);if(s.navigate===!1){let y=s.fetcherKey||S7();await i(y,r,s.action||c,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:m,body:p,formMethod:s.method||f,formEncType:s.encType||d,flushSync:s.flushSync})}else await a(s.action||c,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:m,body:p,formMethod:s.method||f,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:r,flushSync:s.flushSync,viewTransition:s.viewTransition})},[i,a,n,r])}function E7(e,{relative:n}={}){let{basename:r}=b.useContext(_r),i=b.useContext(Qi);wt(i,"useFormAction must be used inside a RouteContext");let[a]=i.matches.slice(-1),l={...hc(e||".",{relative:n})},s=Ba();if(e==null){l.search=s.search;let c=new URLSearchParams(l.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(p=>p).forEach(p=>c.append("index",p));let m=c.toString();l.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Qr([r,l.pathname])),qu(l)}function C7(e,{relative:n}={}){let r=b.useContext(WO);wt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=oA("useViewTransitionState"),a=hc(e,{relative:n});if(!r.isTransitioning)return!1;let l=Hi(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=Hi(r.nextLocation.pathname,i)||r.nextLocation.pathname;return Ud(a.pathname,s)!=null||Ud(a.pathname,l)!=null}var am=FO();function N7(e={}){const[n,r]=b.useState(!1),[i,a]=b.useState(null),[l,s]=b.useState(null),c=b.useRef(e.onEvent),f=b.useRef(1e3),d=b.useRef(null),m=b.useRef(null),p=b.useRef(!0),y=b.useRef(0);c.current=e.onEvent;const x=b.useCallback(()=>{if(!p.current)return;const _=new EventSource("/api/stream");m.current=_,_.onopen=()=>{p.current&&(r(!0),f.current=1e3)};const S=["snapshot","team_status_changed","team_event","team_output","pr_updated","team_launched","team_stopped","usage_updated","project_added","project_updated","project_removed","project_cleanup","dependency_resolved","heartbeat","team_thinking_start","team_thinking_stop","task_updated"],k=j=>{var O,T;if(!p.current)return;let C="message",N=null;try{const A=JSON.parse(j.data);C=A.type??j.type??"message",typeof A.team_id=="number"&&(N=A.team_id),(O=c.current)==null||O.call(c,C,A)}catch{(T=c.current)==null||T.call(c,"message",j.data)}if(C!=="team_output"&&C!=="team_thinking_start"&&C!=="team_thinking_stop"){const A=Date.now();A-y.current>1e3&&(y.current=A,a(new Date(A)),s(N))}};for(const j of S)_.addEventListener(j,k);_.onmessage=k,_.onerror=()=>{if(!p.current)return;r(!1),_.close(),m.current=null;const j=f.current;d.current=setTimeout(()=>{p.current&&x()},j),f.current=Math.min(j*2,3e4)}},[]);return b.useEffect(()=>(p.current=!0,x(),()=>{p.current=!1,m.current&&(m.current.close(),m.current=null),d.current&&(clearTimeout(d.current),d.current=null)}),[x]),{connected:n,lastEvent:i,lastEventTeamId:l}}const sA=b.createContext(null),uA=b.createContext(null),cA=b.createContext(null),fA=b.createContext(null),dA=b.createContext(null),O7=45e3;function A7({children:e}){const[n,r]=b.useState([]),[i,a]=b.useState(null),[l,s]=b.useState(null),c=b.useRef(null),f=b.useRef(0),d=b.useRef(new Set),[m,p]=b.useState(0),y=b.useRef(new Map),x=b.useCallback((D,U)=>{const q=y.current;return q.has(D)||q.set(D,new Set),q.get(D).add(U),()=>{const L=q.get(D);L&&(L.delete(U),L.size===0&&q.delete(D))}},[]),_=b.useMemo(()=>({subscribe:x}),[x]),S=b.useCallback(async()=>{try{const D=await fetch("/api/teams");if(!D.ok){f.current+=1,f.current>=2&&a(`Server error: ${D.status} ${D.statusText}`);return}const U=await D.json(),q=Array.isArray(U)?U:U.data;r(q),f.current=0,a(null)}catch(D){f.current+=1,f.current>=2&&a(D instanceof Error?D.message:"Network error")}},[]),k=b.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,S()},500)},[S]),j=b.useCallback((D,U)=>{if(D==="snapshot"){const L=U;Array.isArray(L.teams)&&(r(L.teams),f.current=0,a(null))}else if(D==="team_status_changed"){const L=U;typeof L.team_id=="number"&&r($=>$.map(G=>{if(G.id!==L.team_id)return G;const B={...G};return typeof L.status=="string"&&(B.status=L.status),typeof L.phase=="string"&&(B.phase=L.phase),L.tokens&&(typeof L.tokens.input=="number"&&(B.totalInputTokens=L.tokens.input),typeof L.tokens.output=="number"&&(B.totalOutputTokens=L.tokens.output),typeof L.tokens.cacheCreation=="number"&&(B.totalCacheCreationTokens=L.tokens.cacheCreation),typeof L.tokens.cacheRead=="number"&&(B.totalCacheReadTokens=L.tokens.cacheRead)),typeof L.idle_minutes=="number"&&(B.idleMin=L.idle_minutes),B.lastEventAt=new Date().toISOString(),B}))}else if(D==="team_launched")k();else if(D==="team_stopped"){k();const L=U;typeof L.team_id=="number"&&d.current.has(L.team_id)&&(d.current.delete(L.team_id),p($=>$+1))}else if(D==="pr_updated"){const L=U;typeof L.team_id=="number"&&r($=>$.map(G=>{if(G.id!==L.team_id)return G;const B={...G};return typeof L.pr_number=="number"&&(B.prNumber=L.pr_number),typeof L.state=="string"&&(B.prState=L.state),typeof L.ci_status=="string"&&(B.ciStatus=L.ci_status),typeof L.merge_status=="string"&&(B.mergeStatus=L.merge_status),B}))}else if(D==="team_thinking_start"){const L=U;typeof L.team_id=="number"&&(d.current.add(L.team_id),p($=>$+1))}else if(D==="team_thinking_stop"){const L=U;typeof L.team_id=="number"&&(d.current.delete(L.team_id),p($=>$+1))}const q=y.current.get(D);if(q)for(const L of q)try{L(D,U)}catch($){console.error("[FleetProvider] SSE subscriber error:",$)}},[k]),{connected:C,lastEvent:N,lastEventTeamId:O}=N7({onEvent:j});b.useEffect(()=>{S()},[S]),b.useEffect(()=>{const D=setInterval(S,O7);return()=>clearInterval(D)},[S]),b.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const T=b.useCallback(D=>d.current.has(D),[]),A=b.useMemo(()=>({teams:n,fetchError:i}),[n,i]),P=b.useMemo(()=>({selectedTeamId:l,setSelectedTeamId:s}),[l]),R=b.useMemo(()=>({connected:C,lastEvent:N,lastEventTeamId:O}),[C,N,O]),z=b.useMemo(()=>({isThinking:T}),[T,m]);return g.jsx(sA.Provider,{value:_,children:g.jsx(uA.Provider,{value:A,children:g.jsx(cA.Provider,{value:P,children:g.jsx(fA.Provider,{value:R,children:g.jsx(dA.Provider,{value:z,children:e})})})})})}function mc(){const e=b.useContext(uA);if(!e)throw new Error("useTeams must be used within a FleetProvider");return e}function hA(){const e=b.useContext(cA);if(!e)throw new Error("useSelection must be used within a FleetProvider");return e}function mA(){const e=b.useContext(fA);if(!e)throw new Error("useConnection must be used within a FleetProvider");return e}function pA(){const e=b.useContext(dA);if(!e)throw new Error("useThinking must be used within a FleetProvider");return e}function T7(){const e=b.useContext(sA);if(!e)throw new Error("useSSEDispatch must be used within a FleetProvider");return e}class M7 extends b.Component{constructor(r){super(r);rd(this,"handleReload",()=>{window.location.reload()});this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,i){console.error("[ErrorBoundary] Uncaught error:",r,i)}render(){return this.state.hasError?g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#0d1117",color:"#e6edf3",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',padding:"2rem",textAlign:"center"},children:[g.jsx("h1",{style:{fontSize:"1.5rem",fontWeight:600,color:"#F85149",marginBottom:"1rem"},children:"Something went wrong"}),this.state.error&&g.jsx("p",{style:{fontSize:"0.875rem",color:"#8b949e",maxWidth:"36rem",marginBottom:"1.5rem",wordBreak:"break-word"},children:this.state.error.message}),g.jsx("button",{type:"button",onClick:this.handleReload,style:{padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:500,color:"#e6edf3",backgroundColor:"transparent",border:"1px solid #30363d",borderRadius:"6px",cursor:"pointer"},children:"Reload"})]}):this.props.children}}class gA extends Error{constructor(n,r,i){super(i??`API error: ${n} ${r}`),this.status=n,this.statusText=r,this.name="ApiError"}}async function uu(e,n,r){const i=`/api/${n.replace(/^\//,"")}`,a={method:e};r!==void 0?(a.headers={"Content-Type":"application/json"},a.body=JSON.stringify(r)):(e==="POST"||e==="PUT")&&(a.headers={"Content-Type":"application/json"},a.body="{}");const l=await fetch(i,a);if(!l.ok){let s;try{const c=await l.json();s=c.message??c.error??void 0}catch{}throw new gA(l.status,l.statusText,s)}return l.json()}function Ot(){const e=b.useCallback(l=>uu("GET",l),[]),n=b.useCallback((l,s)=>uu("POST",l,s),[]),r=b.useCallback((l,s)=>uu("PUT",l,s),[]),i=b.useCallback((l,s)=>uu("PATCH",l,s),[]),a=b.useCallback(l=>uu("DELETE",l),[]);return b.useMemo(()=>({get:e,post:n,put:r,patch:i,del:a}),[e,n,r,i,a])}const qd=new Set(["done","failed"]);function Gn(e,n){return!n||n==="github"?`#${e}`:e}function P7(e){const n=[],r=i=>{for(const a of i)n.push({number:a.number,title:a.title,state:a.state,labels:a.labels,activeTeam:a.activeTeam,issueKey:a.issueKey,issueProvider:a.issueProvider}),a.children.length>0&&r(a.children)};return r(e),n}function D7(e){var a,l,s,c;if(!e)return{health:"blocked",warnings:[],errors:["Install status unavailable"]};const n=[],r=[];return e.hooks.installed||(e.hooks.files.some(d=>d.hasCrlf)?n.push("Hook scripts have CRLF line endings — reinstall to fix"):n.push(`Hooks not installed (${e.hooks.found}/${e.hooks.total})`)),e.prompt.installed||n.push("Prompt file not installed"),e.agents.installed||n.push("Agent files not installed"),(a=e.settings)!=null&&a.exists||n.push("Settings file not installed"),(l=e.gitCommitStatus)!=null&&l.gitignored&&n.push(".claude/ is in .gitignore"),((s=e.gitCommitStatus)==null?void 0:s.health)==="red"&&!e.gitCommitStatus.gitignored&&n.push("Files not committed to default branch"),e.outdatedCount>0&&n.push(`${e.outdatedCount} file(s) outdated — reinstall to update`),((c=e.gitCommitStatus)==null?void 0:c.health)==="amber"&&n.push("Committed files are outdated"),{health:n.length>0?"blocked":r.length>0?"warn":"ready",warnings:r,errors:n}}function R7({message:e,onDone:n}){return b.useEffect(()=>{const r=setTimeout(n,2500);return()=>clearTimeout(r)},[n]),g.jsx("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-[60] px-4 py-2 rounded bg-[#3FB950]/20 border border-[#3FB950]/40 text-[#3FB950] text-sm font-medium shadow-lg animate-fade-in",children:e})}function L7(e){switch(e){case"queued":return"Creating worktree...";case"launching":return"Starting Claude Code...";case"running":return"Team running";case"idle":return"Team idle";case"done":return"Completed";case"failed":return"Failed";case"stuck":return"Stuck";default:return e}}function z7(e){switch(e){case"assistant":return"text-[#58A6FF]";case"tool_use":return"text-[#D29922]";case"tool_result":return"text-[#A371F7]";case"result":return"text-[#3FB950]";default:return"text-[#8B949E]"}}function I7(e){var n,r,i;switch(e.type){case"assistant":{const a=(n=e.message)==null?void 0:n.content;if(Array.isArray(a)){const l=((r=a.find(s=>s.type==="text"))==null?void 0:r.text)??"";return l.substring(0,100)+(l.length>100?"...":"")}return""}case"tool_use":return((i=e.tool)==null?void 0:i.name)??"unknown";case"tool_result":return"completed";case"result":return"session complete";default:return""}}function $7({teamId:e,issueKey:n,issueProvider:r,onClose:i}){const a=Ot(),[l,s]=b.useState("queued"),[c,f]=b.useState([]),[d,m]=b.useState([]),[p,y]=b.useState(null),x=b.useRef(null),_=b.useRef(null),S=b.useRef("queued");b.useEffect(()=>{let N=!1,O=null;async function T(){if(!N&&!qd.has(S.current)){try{const A=await a.get(`teams/${e}`);if(N)return;s(A.status),S.current=A.status,A.status==="failed"&&y(`Team failed${A.stoppedAt?` at ${new Date(A.stoppedAt).toLocaleTimeString()}`:""}`);const P=await a.get(`teams/${e}/output?lines=50`);if(N)return;f(P.lines);const R=await a.get(`teams/${e}/stream-events`);if(N)return;m(R)}catch{}!N&&!qd.has(S.current)&&(O=setTimeout(T,2e3))}}return T(),()=>{N=!0,O!==null&&clearTimeout(O)}},[a,e,l]),b.useEffect(()=>{var N;(N=x.current)==null||N.scrollIntoView({behavior:"smooth"})},[c]),b.useEffect(()=>{var N;(N=x.current)==null||N.scrollIntoView({behavior:"smooth"})},[d]);const k=b.useRef(i);b.useEffect(()=>{k.current=i},[i]),b.useEffect(()=>{l==="running"&&!_.current&&(_.current=setTimeout(()=>k.current(),3e3))},[l]),b.useEffect(()=>()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]);const j=(()=>{switch(l){case"queued":case"launching":return"text-[#D29922]";case"running":return"text-[#3FB950]";case"failed":return"text-[#F85149]";default:return"text-dark-muted"}})(),C=l==="queued"||l==="launching";return g.jsxs("div",{className:"px-5 py-4 space-y-3",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[C&&g.jsxs("svg",{className:"animate-spin h-4 w-4 text-[#D29922]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),l==="running"&&g.jsx("svg",{className:"h-4 w-4 text-[#3FB950]",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),l==="failed"&&g.jsx("svg",{className:"h-4 w-4 text-[#F85149]",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}),g.jsx("span",{className:`text-sm font-medium ${j}`,children:L7(l)}),g.jsxs("span",{className:"text-xs text-dark-muted ml-auto",children:[Gn(n,r)," · Team #",e]})]}),g.jsxs("div",{className:"space-y-1",children:[g.jsx(ad,{label:"Team queued",done:!0}),g.jsx(ad,{label:"Creating worktree...",done:l!=="queued",active:l==="queued"}),g.jsx(ad,{label:"Starting Claude Code...",done:l==="running"||l==="done"||l==="idle",active:l==="launching"}),g.jsx(ad,{label:"Team running",done:l==="running"||l==="done"||l==="idle",active:!1})]}),p&&g.jsx("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:p}),d.length>0&&g.jsxs("div",{className:"bg-[#0D1117] border border-dark-border rounded p-2 max-h-[200px] overflow-y-auto font-mono text-xs",children:[d.slice(-30).map((N,O)=>{var T;return g.jsxs("div",{className:"py-0.5 leading-relaxed",children:[g.jsx("span",{className:"text-dark-muted",children:((T=N.timestamp)==null?void 0:T.substring(11,19))??"--:--:--"})," ",g.jsx("span",{className:z7(N.type),children:N.type})," ",g.jsx("span",{className:"text-dark-text",children:I7(N)})]},O)}),g.jsx("div",{ref:x})]}),d.length===0&&c.length>0&&g.jsxs("div",{className:"bg-dark-base border border-dark-border rounded p-2 max-h-[200px] overflow-y-auto font-mono text-xs text-dark-muted",children:[c.map((N,O)=>g.jsx("div",{className:"whitespace-pre-wrap break-all leading-relaxed",children:N},O)),g.jsx("div",{ref:x})]}),l==="running"&&g.jsx("p",{className:"text-xs text-[#3FB950]/70",children:"Auto-closing in 3 seconds..."})]})}function ad({label:e,done:n,active:r}){return g.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n?g.jsx("svg",{className:"h-3 w-3 text-[#3FB950]",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):r?g.jsxs("svg",{className:"animate-spin h-3 w-3 text-[#D29922]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):g.jsx("div",{className:"h-3 w-3 rounded-full border border-dark-border"}),g.jsx("span",{className:n?"text-dark-text":r?"text-[#D29922]":"text-dark-muted",children:e})]})}function B7({open:e,onClose:n}){const r=Ot(),[i,a]=b.useState(!1),[l,s]=b.useState(!0),[c,f]=b.useState(""),[d,m]=b.useState(""),[p,y]=b.useState(""),[x,_]=b.useState("15000"),[S,k]=b.useState(!1),[j,C]=b.useState(null),[N,O]=b.useState(null),[T,A]=b.useState([]),[P,R]=b.useState(""),[z,D]=b.useState([]),[U,q]=b.useState(!1),[L,$]=b.useState(null),[G,B]=b.useState(""),[Y,ee]=b.useState("green"),[H,re]=b.useState(null),[F,X]=b.useState(null),[ae,se]=b.useState(null),ve=b.useRef(null),we=b.useRef(null);b.useEffect(()=>{if(e&&!H){const K=setTimeout(()=>{var ge;return(ge=ve.current)==null?void 0:ge.focus()},50);return()=>clearTimeout(K)}},[e,i,H]),b.useEffect(()=>{e&&(r.get("projects").then(K=>{A(K),K.length===1&&R(String(K[0].id))}).catch(()=>{A([])}),r.get("usage").then(K=>{const ge=Math.max(K.dailyPercent,K.weeklyPercent,K.sonnetPercent,K.extraPercent);ge>80?ee("red"):ge>=50?ee("yellow"):ee("green")}).catch(()=>{ee("green")}))},[e,r]),b.useEffect(()=>{if(!P){D([]),$(null);return}let K=!1;return q(!0),$(null),r.get(`projects/${P}/issues`).then(ge=>{if(K)return;const be=P7(ge.tree);D(be)}).catch(ge=>{if(K)return;const be=ge instanceof Error?ge.message:String(ge);$(be||"Failed to fetch issues"),D([])}).finally(()=>{K||q(!1)}),()=>{K=!0}},[P,r]),b.useEffect(()=>{e&&(f(""),m(""),y(""),_("15000"),C(null),a(!1),s(!0),R(""),re(null),X(null),se(null),ee("green"),D([]),$(null),B(""))},[e]),b.useEffect(()=>{if(!e)return;function K(ge){ge.key==="Escape"&&n()}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[e,n]);const ce=b.useCallback(K=>{we.current&&!we.current.contains(K.target)&&n()},[n]),Se=b.useMemo(()=>{if(!G.trim())return z;const K=G.toLowerCase().trim(),ge=K.startsWith("#")?parseInt(K.slice(1),10):/^\d+$/.test(K)?parseInt(K,10):NaN;return z.filter(be=>!isNaN(ge)&&be.number===ge||be.title.toLowerCase().includes(K)||String(be.number).includes(K)||be.issueKey&&be.issueKey.toLowerCase().includes(K))},[z,G]),me=b.useMemo(()=>{const K=new Map;for(const ge of T)K.set(ge.id,D7(ge.installStatus));return K},[T]),pe=b.useMemo(()=>P?me.get(parseInt(P,10))??null:null,[P,me]),Ee=(pe==null?void 0:pe.health)==="blocked",he=b.useCallback(K=>{f(K.issueKey??String(K.number)),B("")},[]),Be=b.useCallback(async K=>{if(C(null),T.length>0&&!P){C("Please select a project");return}const ge=c.trim();if(!ge){C("Issue key is required");return}const be=parseInt(ge,10),Le=!isNaN(be)&&be>0&&String(be)===ge,Re=p.trim()||void 0,Je=P?parseInt(P,10):void 0;k(!0);try{const Ae=await r.post("teams/launch",{issueNumber:Le?be:0,issueKey:ge,prompt:Re,projectId:Je,headless:l,...K?{force:!0}:{}});re(Ae.id),X(ge);const De=z.find(Ze=>Ze.issueKey===ge||String(Ze.number)===ge);se((De==null?void 0:De.issueProvider)??(Le?"github":null))}catch(Ae){const De=Ae instanceof Error?Ae.message:String(Ae);C(De||"Failed to launch team")}finally{k(!1)}},[c,p,r,T,P,l,z]),Me=b.useCallback(async()=>{C(null);const K=d.trim();if(!K){C("Enter at least one issue number");return}const ge=K.split(/[,\s]+/).map(Ae=>Ae.trim()).filter(Boolean);if(ge.length===0){C("Enter at least one issue key");return}const be=parseInt(x.trim(),10);if(isNaN(be)||be<0){C("Stagger delay must be a non-negative number (ms)");return}if(T.length>0&&!P){C("Please select a project");return}const Le=ge.map(Ae=>{const De=parseInt(Ae,10);return{number:!isNaN(De)&&De>0&&String(De)===Ae?De:0,issueKey:Ae}}),Re=p.trim()||void 0,Je=P?parseInt(P,10):void 0;k(!0);try{await r.post("teams/launch-batch",{issues:Le,prompt:Re,delayMs:be,projectId:Je,headless:l}),O(`Launched ${ge.length} team${ge.length>1?"s":""}`),n()}catch(Ae){const De=Ae instanceof Error?Ae.message:String(Ae);C(De||"Failed to launch batch")}finally{k(!1)}},[d,x,p,r,n,T,P,l]),J=b.useCallback(K=>{K.key==="Enter"&&!S&&(i?Me():Be())},[i,S,Be,Me]);if(!e&&!N)return null;const ye=H!==null&&F!==null;return g.jsxs(g.Fragment,{children:[N&&g.jsx(R7,{message:N,onDone:()=>O(null)}),e&&g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:ce,children:g.jsxs("div",{ref:we,className:"w-[480px] max-w-[95vw] max-h-[90vh] flex flex-col bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true","aria-label":ye?"Launch Progress":"Launch Team",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:ye?"Launch Progress":"Launch Team"}),g.jsx("button",{onClick:n,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",title:"Close (Esc)",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),ye?g.jsx($7,{teamId:H,issueKey:F,issueProvider:ae,onClose:n}):g.jsxs("div",{className:"px-5 py-4 space-y-4 overflow-y-auto",children:[T.length>0?g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Project ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsxs("select",{value:P,onChange:K=>R(K.target.value),className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:S,children:[g.jsx("option",{value:"",children:"Select a project..."}),T.map(K=>{const ge=me.get(K.id),be=(ge==null?void 0:ge.health)==="blocked",Le=be?" (not ready — fix on Projects page)":(ge==null?void 0:ge.health)==="warn"?" (warnings)":"";return g.jsxs("option",{value:K.id,disabled:be,children:[K.name,Le]},K.id)})]})]}):g.jsx("div",{className:"px-3 py-2 rounded border border-[#D29922]/30 bg-[#D29922]/10 text-[#D29922] text-sm",children:"Add a project first"}),(pe==null?void 0:pe.health)==="blocked"&&g.jsxs("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:[g.jsx("p",{className:"font-medium",children:"Project not ready for launch"}),g.jsx("ul",{className:"mt-1 list-disc list-inside text-xs",children:pe.errors.map((K,ge)=>g.jsx("li",{children:K},ge))}),g.jsx("p",{className:"mt-1 text-xs opacity-80",children:"Fix these issues on the Projects page before launching."})]}),(pe==null?void 0:pe.health)==="warn"&&g.jsxs("div",{className:"px-3 py-2 rounded border border-[#D29922]/30 bg-[#D29922]/10 text-[#D29922] text-sm",children:[g.jsx("p",{className:"font-medium",children:"Project has warnings"}),g.jsx("ul",{className:"mt-1 list-disc list-inside text-xs",children:pe.warnings.map((K,ge)=>g.jsx("li",{children:K},ge))})]}),g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[g.jsx("input",{type:"checkbox",checked:i,onChange:K=>a(K.target.checked),className:"w-4 h-4 rounded border-dark-border bg-dark-base text-dark-accent focus:ring-dark-accent/50 focus:ring-offset-0 accent-[#58A6FF]"}),g.jsx("span",{className:"text-sm text-dark-muted",children:"Batch mode"})]}),g.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",title:l?"Runs Claude Code in the background with no visible window":"Opens Claude Code in a visible terminal window",children:[g.jsx("input",{type:"checkbox",checked:l,onChange:K=>s(K.target.checked),className:"w-4 h-4 rounded border-dark-border bg-dark-base text-dark-accent focus:ring-dark-accent/50 focus:ring-offset-0 accent-[#58A6FF]"}),g.jsx("span",{className:"text-sm text-dark-muted",children:"Run headless (background)"}),!l&&g.jsx("span",{className:"text-xs text-dark-muted/60",children:"— opens in a visible terminal window"})]})]}),i?g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Issue numbers ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsx("input",{ref:ve,type:"text",value:d,onChange:K=>m(K.target.value),onKeyDown:J,placeholder:"e.g. 763, 812, 756",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:S}),g.jsx("p",{className:"text-xs text-dark-muted mt-1",children:"Comma or space separated"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"Stagger delay (ms)"}),g.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:x,onChange:K=>_(K.target.value),placeholder:"15000",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:S})]})]}):g.jsxs("div",{className:"space-y-2",children:[P&&g.jsxs("div",{children:[g.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"Select issue"}),U&&g.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-dark-muted",children:[g.jsxs("svg",{className:"animate-spin h-3 w-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading issues..."]}),L&&g.jsx("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-xs",children:L}),!U&&!L&&z.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"relative mb-1",children:[g.jsx("input",{type:"text",value:G,onChange:K=>B(K.target.value),placeholder:"Filter issues... (#number or title)",className:"w-full px-3 py-1.5 text-xs rounded border border-dark-border bg-[#0D1117] text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:S}),G&&g.jsx("button",{onClick:()=>B(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-dark-muted hover:text-dark-text transition-colors","aria-label":"Clear search",children:g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})})})]}),g.jsx("div",{className:"max-h-[200px] overflow-y-auto border border-dark-border rounded bg-[#0D1117]",children:Se.length===0?g.jsxs("div",{className:"px-3 py-2 text-xs text-dark-muted",children:["No issues match “",G,"”"]}):Se.map(K=>{const ge=c===String(K.number),be=!!K.activeTeam;return g.jsxs("button",{onClick:()=>he(K),disabled:S,className:`w-full text-left px-3 py-1.5 text-xs flex items-center gap-2 transition-colors border-b border-dark-border/30 last:border-b-0 ${ge?"bg-dark-accent/15 text-dark-accent":"hover:bg-dark-surface text-dark-text"}`,children:[K.state==="open"?g.jsxs("svg",{className:"w-3.5 h-3.5 text-[#3FB950] shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"})]}):g.jsxs("svg",{className:"w-3.5 h-3.5 text-[#A371F7] shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5Z"}),g.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z"})]}),g.jsxs("span",{className:"text-dark-muted shrink-0",children:["#",K.number]}),g.jsx("span",{className:"truncate",children:K.title}),be&&g.jsx("span",{className:"ml-auto shrink-0 px-1.5 py-0.5 rounded text-[10px] font-medium bg-[#D29922]/15 text-[#D29922] border border-[#D29922]/30",children:K.activeTeam.status}),ge&&g.jsx("svg",{className:"w-3.5 h-3.5 text-dark-accent ml-auto shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},K.number)})}),g.jsxs("p",{className:"text-xs text-dark-muted mt-1",children:[z.length," issue",z.length!==1?"s":""," found",G&&Se.length!==z.length&&` (${Se.length} matching)`]})]}),!U&&!L&&z.length===0&&g.jsx("div",{className:"px-3 py-2 text-xs text-dark-muted",children:"No issues found for this project"})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Issue key ",g.jsx("span",{className:"text-[#F85149]",children:"*"}),P&&z.length>0&&g.jsx("span",{className:"text-dark-muted/50 text-xs ml-1",children:"(or type manually)"})]}),g.jsx("input",{ref:ve,type:"text",value:c,onChange:K=>f(K.target.value),onKeyDown:J,placeholder:"e.g. 763 or PROJ-123",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:S})]})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Prompt ",g.jsx("span",{className:"text-dark-muted/50",children:"(optional)"})]}),g.jsx("input",{type:"text",value:p,onChange:K=>y(K.target.value),onKeyDown:J,placeholder:"Custom prompt (default: project prompt file)",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:S}),g.jsxs("p",{className:"text-xs text-dark-muted mt-1",children:["Leave empty to use the project's prompt file (with ",g.jsx("code",{className:"text-dark-accent/70",children:"{{ISSUE_NUMBER}}"})," replaced automatically)."]})]}),Y==="red"&&g.jsx("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:'Usage is in the red zone (>80%). New launches will be queued instead of started immediately. Use "Force Launch" to override.'}),j&&g.jsx("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:j})]}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-4 border-t border-dark-border",children:[g.jsx("button",{onClick:n,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:ye?"Close":"Cancel"}),!ye&&g.jsxs(g.Fragment,{children:[g.jsx("button",{onClick:()=>i?Me():void Be(),disabled:S||T.length===0||Ee,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:S?"Launching...":Y==="red"?i?"Queue All":"Queue":i?"Launch All":"Launch"}),Y==="red"&&!i&&g.jsx("button",{onClick:()=>void Be(!0),disabled:S||T.length===0||Ee,className:"px-4 py-1.5 text-sm font-medium rounded border border-[#F85149]/40 text-[#F85149] bg-[#F85149]/10 hover:bg-[#F85149]/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:"Force launch ignoring red zone usage limits",children:"Force Launch"})]})]})]})})]})}function F7({size:e=20,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),g.jsx("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),g.jsx("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}),g.jsx("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"})]})}function U7({size:e=20,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("line",{x1:"6",x2:"6",y1:"3",y2:"15"}),g.jsx("circle",{cx:"18",cy:"6",r:"3"}),g.jsx("circle",{cx:"6",cy:"18",r:"3"}),g.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]})}function q7({size:e=20,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M3 3v18h18"}),g.jsx("path",{d:"M18 17V9"}),g.jsx("path",{d:"M13 17V5"}),g.jsx("path",{d:"M8 17v-3"})]})}function H7({size:e=20,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5"}),g.jsx("circle",{cx:"13",cy:"12",r:"2"}),g.jsx("path",{d:"M18 19c-2.8 0-5-2.2-5-5v8"}),g.jsx("circle",{cx:"20",cy:"19",r:"2"})]})}function G7({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),g.jsx("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),g.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),g.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})}function K7({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})})}function tb({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),g.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function V7({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),g.jsx("path",{d:"M21 3v5h-5"}),g.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),g.jsx("path",{d:"M8 16H3v5"})]})}function Y7({size:e=20,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})})}function W7({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("circle",{cx:"12",cy:"12",r:"1"})]})}function X7({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})})}function Z7({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),g.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}function Q7({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("polyline",{points:"12 6 12 12 16 14"})]})}function Ny({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"})})}function J7({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"1"}),g.jsx("circle",{cx:"19",cy:"12",r:"1"}),g.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}function eL({size:e=14,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),g.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function tL({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("path",{d:"m9 18 6-6-6-6"})})}function vA({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function yA({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M15.04 7.3L8.7.96 8 .26 2.67 5.6.96 7.3a.33.33 0 000 .47l4.57 4.57L8 14.8l5.33-5.33.24-.24 1.47-1.47a.33.33 0 000-.47zM8 10.27L5.73 8 8 5.73 10.27 8 8 10.27z"})})}function nL({size:e=14,className:n}){return g.jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M.34 9.14a7.97 7.97 0 006.52 6.52L.34 9.14zm-.28-1.6a8.03 8.03 0 018.4-7.48L.06 7.54zm1.28-3.82A8 8 0 0114.28 12.66L1.34 3.72zM8 0a8 8 0 110 16A8 8 0 018 0z"})})}function xA({size:e=20,className:n}){return g.jsxs("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"6",cy:"6",r:"3"}),g.jsx("circle",{cx:"18",cy:"6",r:"3"}),g.jsx("circle",{cx:"12",cy:"18",r:"3"}),g.jsx("line",{x1:"8.7",y1:"7.5",x2:"9.3",y2:"16.5"}),g.jsx("line",{x1:"15.3",y1:"7.5",x2:"14.7",y2:"16.5"}),g.jsx("line",{x1:"9",y1:"6",x2:"15",y2:"6"})]})}function bA({size:e=14,className:n}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,children:[g.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),g.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}function wA({size:e=14,className:n}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,children:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Iu({provider:e,size:n=14,className:r}){switch(e){case"github":return g.jsx(vA,{size:n,className:r});case"jira":return g.jsx(yA,{size:n,className:r});case"linear":return g.jsx(nL,{size:n,className:r});default:return g.jsx(W7,{size:n,className:r})}}const Vr={queued:"#8B949E",launching:"#D29922",running:"#3FB950",idle:"#D29922",stuck:"#F85149",done:"#A371F7",failed:"#F85149"};function _A(e,n){const r=Math.max(0,n-10);return e>=n?"#F85149":e>=r?"#D29922":"#3FB950"}const ES={"team-lead":"#58A6FF",coordinator:"#58A6FF",tl:"#58A6FF",analyst:"#D29922",dev:"#3FB950",developer:"#3FB950",reviewer:"#A371F7"},CS=["#58A6FF","#3FB950","#D29922","#A371F7","#F778BA","#79C0FF","#7EE787","#E3B341","#D2A8FF","#FF7B72"];function pc(e,n){if(n){const a=ES[n.toLowerCase()];if(a)return a}const r=ES[e.toLowerCase()];if(r)return r;let i=0;for(let a=0;a<e.length;a++)i=(i<<5)-i+e.charCodeAt(a)|0;return CS[Math.abs(i)%CS.length]}function Oy(e){if(!e)return null;const n=new Date(e).getTime()-Date.now();if(n<=0)return null;const r=Math.floor(n/36e5),i=Math.floor(n%36e5/6e4);return r>0?`Resets in ${r}h ${i}m`:`Resets in ${i}m`}const rL={daily:85,weekly:95,sonnet:95,extra:95};function iL(){const{teams:e}=mc(),n=Ot(),[r,i]=b.useState(!1),[a,l]=b.useState(null),s=b.useCallback(async()=>{try{const y=await n.get("usage");l(y)}catch{}},[n]);b.useEffect(()=>{s();const y=setInterval(s,3e4);return()=>clearInterval(y)},[s]);const c=e.reduce((y,x)=>(y[x.status]=(y[x.status]||0)+1,y),{}),f=(a==null?void 0:a.redThresholds)??rL,d=a?[{key:"daily",label:"Daily",percent:a.dailyPercent,redThreshold:f.daily,resetLabel:Oy(a.dailyResetsAt)},{key:"weekly",label:"Weekly",percent:a.weeklyPercent,redThreshold:f.weekly,resetLabel:Oy(a.weeklyResetsAt)},{key:"sonnet",label:"Sonnet",percent:a.sonnetPercent,redThreshold:f.sonnet,resetLabel:null},{key:"extra",label:"Extra",percent:a.extraPercent,redThreshold:f.extra,resetLabel:null}]:[],m=[{label:"running",count:c.running||0,color:Vr.running},{label:"queued",count:c.queued||0,color:Vr.queued},{label:"launching",count:c.launching||0,color:Vr.launching},{label:"idle",count:c.idle||0,color:Vr.idle},{label:"stuck",count:c.stuck||0,color:Vr.stuck}].filter(y=>y.count>0),p=(a==null?void 0:a.zone)==="red";return g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:"h-12 min-h-[48px] bg-dark-surface border-b border-dark-border flex items-center px-4 justify-between shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("img",{src:"/logo.svg",alt:"Fleet Commander logo",width:20,height:20}),g.jsx("h1",{className:"text-sm font-semibold text-dark-text tracking-wide",children:"Fleet Commander"})]}),g.jsxs("div",{className:"flex items-center gap-3",children:[m.map((y,x)=>g.jsxs("span",{className:"text-xs font-medium",children:[g.jsx("span",{style:{color:y.color},children:y.count}),g.jsx("span",{className:"text-dark-muted ml-1",children:y.label}),x<m.length-1&&g.jsx("span",{className:"text-dark-muted ml-3",children:"·"})]},y.label)),d.length>0&&m.length>0&&g.jsx("span",{className:"text-dark-muted mx-1",children:"|"}),d.map(y=>g.jsxs("span",{className:"text-xs font-medium",title:y.resetLabel??void 0,children:[g.jsx("span",{className:"text-dark-muted",children:y.label})," ",g.jsxs("span",{style:{color:_A(y.percent,y.redThreshold)},children:[y.percent.toFixed(0),"%"]})]},y.key)),p&&g.jsx("span",{className:"text-xs font-bold animate-pulse",style:{color:"#F85149"},children:"PAUSED"}),g.jsxs("button",{type:"button",onClick:y=>{y.stopPropagation(),y.preventDefault(),i(!0)},className:"ml-2 px-3 py-1 text-xs font-medium rounded border border-dark-accent/40 text-dark-accent hover:bg-dark-accent/10 transition-colors inline-flex items-center gap-1.5",title:"Launch a new team",children:[g.jsx(G7,{size:14}),"Launch Team"]})]})]}),am.createPortal(g.jsx(B7,{open:r,onClose:()=>i(!1)}),document.body)]})}const aL=[{to:"/",label:"Fleet Grid",icon:g.jsx(F7,{})},{to:"/issues",label:"Issue Tree",icon:g.jsx(U7,{})},{to:"/usage",label:"Usage View",icon:g.jsx(q7,{})},{to:"/projects",label:"Projects",icon:g.jsx(H7,{})},{to:"/lifecycle",label:"Lifecycle",icon:g.jsx(Y7,{size:20})},{to:"/settings",label:"Settings",icon:g.jsx(tb,{size:20})}];function lL(){return g.jsx("nav",{className:"w-14 min-w-[56px] bg-dark-surface border-r border-dark-border flex flex-col items-center pt-2 gap-1",children:aL.map(e=>g.jsx(lA,{to:e.to,end:e.to==="/",title:e.label,className:({isActive:n})=>`w-10 h-10 flex items-center justify-center rounded-md text-lg transition-colors ${n?"text-dark-accent bg-dark-accent/10":"text-dark-muted hover:text-dark-text hover:bg-dark-border/50"}`,children:e.icon},e.to))})}function oL(){const{connected:e,lastEvent:n}=mA(),{fetchError:r}=mc(),[i,a]=b.useState(null),[l,s]=b.useState(null);return b.useEffect(()=>{fetch("/api/health").then(c=>c.json()).then(c=>{c.version&&s(c.version)}).catch(()=>{})},[]),b.useEffect(()=>{if(!n){a(null);return}const c=()=>{a(Math.floor((Date.now()-n.getTime())/1e3))};c();const f=setInterval(c,1e3);return()=>clearInterval(f)},[n]),g.jsxs("footer",{className:"h-6 min-h-[24px] bg-dark-base border-t border-dark-border flex items-center px-3 text-xs text-dark-muted select-none",children:[g.jsx("span",{className:`inline-block w-2 h-2 rounded-full mr-2 ${e?"bg-green-500":"bg-red-500"}`}),g.jsx("span",{children:e?"Connected":"Disconnected"}),r&&g.jsx("span",{className:"ml-3",style:{color:"#F0C674"},children:"Stale"}),i!==null&&g.jsxs("span",{className:"ml-4",children:["Last update: ",i,"s ago"]}),l&&g.jsxs("span",{className:"ml-auto",children:["v",l]})]})}function Hu(e,n){const{subscribe:r}=T7(),i=b.useRef(n);i.current=n,b.useEffect(()=>{const a=Array.isArray(e)?e:[e],l=(c,f)=>{i.current(c,f)},s=a.map(c=>r(c,l));return()=>{for(const c of s)c()}},[r,JSON.stringify(e)])}const kv=3e4,sL=2e3;function uL(e,n,r){const i=Ot(),[a,l]=b.useState(null),[s,c]=b.useState([]),[f,d]=b.useState([]),[m,p]=b.useState([]),[y,x]=b.useState(!1),[_,S]=b.useState(null),k=b.useRef(e),j=b.useRef(null),C=b.useRef(null),N=b.useRef(null),O=b.useRef(null);b.useEffect(()=>{k.current=e},[e]),b.useEffect(()=>{if(e==null){l(null),c([]),d([]),p([]),C.current=null,N.current=null,O.current=null;return}let A=!1;async function P(){x(!0),S(null);const[R,z,D,U]=await Promise.allSettled([i.get(`teams/${e}`),i.get(`teams/${e}/transitions`),i.get(`teams/${e}/roster`),i.get(`teams/${e}/messages/summary`)]);if(!A){if(R.status==="fulfilled")l(R.value);else{const q=R.reason;S(q instanceof Error?q.message:"Failed to load team detail"),l(null)}z.status==="fulfilled"?(c(z.value),C.current={data:z.value,fetchedAt:Date.now()}):c([]),D.status==="fulfilled"?(d(D.value),N.current={data:D.value,fetchedAt:Date.now()}):d([]),U.status==="fulfilled"?(p(U.value),O.current={data:U.value,fetchedAt:Date.now()}):p([]),x(!1)}}return P(),()=>{A=!0}},[e,i]);const T=b.useCallback(()=>{const A=k.current;if(A==null)return;const P=Date.now(),R=[],z=i.get(`teams/${A}`);R.push(z);const D=!C.current||P-C.current.fetchedAt>=kv,U=!N.current||P-N.current.fetchedAt>=kv,q=!O.current||P-O.current.fetchedAt>=kv;D&&R.push(i.get(`teams/${A}/transitions`)),U&&R.push(i.get(`teams/${A}/roster`)),q&&R.push(i.get(`teams/${A}/messages/summary`)),Promise.allSettled(R).then(L=>{if(k.current!==A)return;let $=0;const G=L[$++];if(G&&G.status==="fulfilled"&&l(G.value),D){const B=L[$++];if(B&&B.status==="fulfilled"){const Y=B.value;c(Y),C.current={data:Y,fetchedAt:Date.now()}}}if(U){const B=L[$++];if(B&&B.status==="fulfilled"){const Y=B.value;d(Y),N.current={data:Y,fetchedAt:Date.now()}}}if(q){const B=L[$++];if(B&&B.status==="fulfilled"){const Y=B.value;p(Y),O.current={data:Y,fetchedAt:Date.now()}}}})},[i]);return b.useEffect(()=>{if(!(e==null||!n)&&r===e)return j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{T()},sL),()=>{j.current&&(clearTimeout(j.current),j.current=null)}},[n,r,e,T]),{detail:a,transitions:s,roster:f,messageEdges:m,loading:y,error:_,refreshDetail:T}}const cL={queued:"Queued",running:"Running",stuck:"Stuck",idle:"Idle",done:"Done",failed:"Failed",launching:"Launching"};function nb({status:e,retryCount:n,maxRetries:r}){const i=Vr[e]??"#8B949E",a=cL[e]??e;let l="";e==="stuck"?l="animate-pulse-stuck":e==="launching"&&(l="animate-blink");let s=null;return e==="failed"&&n!==void 0&&n>0&&(r!==void 0&&n>=r?s="(permanent)":s=`(retry ${n})`),g.jsxs("span",{className:"inline-flex items-center gap-2",children:[g.jsx("span",{className:`inline-block w-2.5 h-2.5 rounded-full shrink-0 ${l}`,style:{backgroundColor:i}}),g.jsx("span",{className:"text-sm font-medium",style:{color:i},children:a}),s&&g.jsx("span",{className:"text-xs text-dark-muted",children:s})]})}function fL(e,n){return e==="success"?{icon:"✓",color:"#3FB950"}:e==="failure"?{icon:"✕",color:"#F85149"}:e==="cancelled"?{icon:"―",color:"#8B949E"}:n==="in_progress"||n==="queued"||n==="pending"?{icon:"○",color:"#D29922"}:{icon:"○",color:"#8B949E"}}function kA({checks:e}){return e.length===0?g.jsx("p",{className:"text-dark-muted text-sm",children:"No CI checks available"}):g.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map((n,r)=>{const{icon:i,color:a}=fL(n.conclusion,n.status),l=n.conclusion==="success"?"rgba(63, 185, 80, 0.15)":n.conclusion==="failure"?"rgba(248, 81, 73, 0.15)":n.conclusion==="cancelled"?"rgba(139, 148, 158, 0.15)":"rgba(210, 153, 34, 0.15)";return g.jsxs("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full max-w-[10rem]",style:{backgroundColor:l},title:n.name,children:[g.jsx("span",{className:"font-bold leading-none shrink-0",style:{color:a},children:i}),g.jsx("span",{className:"truncate",style:{color:a},children:n.name})]},`${n.name}-${r}`)})})}const rb="__pm__",ib="__fc__";function dL(e){return e===rb?"You":e===ib?"FC":e==="team-lead"||e==="tl"?"TL":e.charAt(0).toUpperCase()+e.slice(1)}const hL={[rb]:"#3FB950",[ib]:"#D29922"};function mL({roster:e,activeFilters:n,onFiltersChange:r,hasUserEntries:i,hasFcEntries:a}){const l=b.useMemo(()=>{const d=new Set;d.add("team-lead");for(const p of e)d.add(p.name.toLowerCase());const m=Array.from(d).sort((p,y)=>p==="team-lead"?-1:y==="team-lead"?1:p.localeCompare(y));return i&&m.push(rb),a&&m.push(ib),m},[e,i,a]);if(l.length<=1)return null;const s=n.size===0||n.size===l.length,c=()=>{r(new Set)},f=d=>{const m=new Set(n);if(s){r(new Set([d]));return}if(m.has(d)){if(m.delete(d),m.size===0){r(new Set);return}}else if(m.add(d),m.size===l.length){r(new Set);return}r(m)};return g.jsxs("div",{className:"flex items-center gap-1 mb-2 flex-wrap",children:[g.jsx("button",{onClick:c,className:"px-2 py-0.5 text-[10px] font-medium rounded-full border transition-all duration-150",style:s?{color:"#C9D1D9",borderColor:"#C9D1D960",backgroundColor:"#C9D1D918"}:{color:"#484F58",borderColor:"#484F5840",opacity:.7},children:"All"}),l.map(d=>{const m=hL[d]??pc(d,d),p=!s&&n.has(d);return g.jsxs("button",{onClick:()=>f(d),className:"px-2 py-0.5 text-[10px] font-medium rounded-full border transition-all duration-150 flex items-center gap-1",style:p?{color:m,borderColor:m+"60",backgroundColor:m+"18"}:{color:"#484F58",borderColor:"#484F5840",opacity:.5},children:[g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:p?m:"#484F58"}}),dL(d)]},d)})]})}function vl(e){return!e||e==="team-lead"||e==="tl"?"TL":e.charAt(0).toUpperCase()+e.slice(1)}const pL={assistant:{color:"#58A6FF",label:"TL"},user:{color:"#3FB950",label:"You"},fc:{color:"#D29922",label:"FC"},system:{color:"#8B949E",label:"system"},tool_use:{color:"#D29922",label:"tool"},tool_result:{color:"#A371F7",label:"result"},result:{color:"#3FB950",label:"done"},rate_limit_event:{color:"#D29922",label:"rate-limit"}};function Hd(e){return pL[e]??{color:"#8B949E",label:e}}const gL={initial_prompt:"prompt",origin_sync:"sync",idle_nudge:"idle",stuck_nudge:"nudge",ci_green:"CI pass",ci_red:"CI fail",ci_blocked:"CI blocked",pr_merged_shutdown:"shutdown",subagent_crash:"crash"};function SA(e){return e?gL[e]??e:null}const jA=new Set(["assistant","user","fc"]);function EA(e){var r;if(!jA.has(e.streamType))return"";const n=(r=e.message)==null?void 0:r.content;return Array.isArray(n)?n.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join(`
61
+ `):""}const vL=new Set(["SessionStart","SessionEnd","Stop","SubagentStart","SubagentStop"]),yL=new Set(["ToolError","StopFailure"]);function xL(e){if(!e)return null;try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="string")return n.error}catch{}return null}function Li(e){try{return new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit"})}catch{return"--:--"}}function NS(e){if(e.streamType==="user")return{label:"You",color:"#3FB950"};if(e.streamType==="fc")return{label:"FC",color:"#D29922"};if(e.agentName&&(e.streamType==="assistant"||e.streamType==="tool_use")){const n=vl(e.agentName),r=pc(e.agentName,e.agentName);return{label:n,color:r}}return Hd(e.streamType)}function bL(e){if(e.agentName){const n=vl(e.agentName),r=pc(e.agentName,e.agentName);return{label:n,color:r}}return{label:"System",color:"#8B949E"}}const wL=120;function So(e,n=wL){return e.length<=n?e:e.slice(0,n)+"..."}function CA(e){var i;if(e.streamType!=="tool_use"||!((i=e.tool)!=null&&i.name)||!e.tool.input)return null;const n=e.tool.input;switch(e.tool.name){case"Bash":{const a=n.command;return typeof a=="string"?So(a):null}case"Read":{const a=n.file_path;return typeof a=="string"?a:null}case"Write":{const a=n.file_path;return typeof a=="string"?a:null}case"Edit":{const a=n.file_path,l=n.old_string,s=n.new_string,c=[];return typeof a=="string"&&c.push(a),typeof l=="string"&&typeof s=="string"&&c.push(So(l,50)+" -> "+So(s,50)),c.length>0?c.join(" "):null}case"Grep":{const a=n.pattern,l=n.path,s=[];return typeof a=="string"&&s.push(`/${a}/`),typeof l=="string"&&s.push(l),s.length>0?s.join(" in "):null}case"Glob":{const a=n.pattern;return typeof a=="string"?a:null}case"SendMessage":{const a=n.to,l=n.message,s=[];return typeof a=="string"&&s.push(`to ${a}`),typeof l=="string"&&s.push(So(l,80)),s.length>0?s.join(": "):null}case"Agent":{const a=n.name,l=n.message,s=[];return typeof a=="string"&&s.push(a),typeof l=="string"&&s.push(So(l,80)),s.length>0?s.join(": "):null}default:{try{const a=JSON.stringify(n);if(a.length>2)return So(a)}catch{}return null}}}function _L(e,n,r){var s;const i=n.timestamp??new Date().toISOString(),l=[{id:`sse-stream-${r}`,source:"stream",timestamp:i,teamId:e,streamType:n.type,subtype:n.subtype,message:n.message,tool:n.tool,...n.agentName?{agentName:n.agentName}:{},...n.description?{description:n.description}:{},...n.lastToolName?{lastToolName:n.lastToolName}:{}}];if(n.type==="assistant"&&((s=n.message)!=null&&s.content))for(let c=0;c<n.message.content.length;c++){const f=n.message.content[c];f.type==="tool_use"&&f.name&&l.push({id:`sse-stream-${r}-tool-${c}`,source:"stream",timestamp:i,teamId:e,streamType:"tool_use",tool:{name:f.name,input:f.input},...n.agentName?{agentName:n.agentName}:{}})}return l}function kL(e,n){return{id:`event-${n.event_id}`,source:"hook",timestamp:n.timestamp??new Date().toISOString(),teamId:e,eventType:n.event_type,toolName:n.tool_name??void 0,agentName:n.agent_name??void 0}}const SL=new Set(["stream_event","content_block_start","content_block_delta","content_block_stop"]),OS=600,AS=100;function jL(e,n){switch(n.type){case"INIT":{const r=new Set(n.entries.map(i=>i.id));return{entries:n.entries,idSet:r}}case"APPEND_STREAM":{const r=n.entries.filter(l=>!e.idSet.has(l.id));if(r.length===0)return e;const i=new Set(e.idSet);for(const l of r)i.add(l.id);let a=[...e.entries,...r];if(a.length>OS){const l=a.slice(AS),s=new Set(l.map(c=>c.id));return{entries:l,idSet:s}}return{entries:a,idSet:i}}case"APPEND_HOOK":{if(e.idSet.has(n.entry.id))return e;const r=new Set(e.idSet);r.add(n.entry.id);let i=[...e.entries,n.entry];if(i.length>OS){const a=i.slice(AS),l=new Set(a.map(s=>s.id));return{entries:a,idSet:l}}return{entries:i,idSet:r}}case"SYNC":{const r=new Set(n.entries.map(i=>i.id));return{entries:n.entries,idSet:r}}}}const EL={entries:[],idSet:new Set};function CL({entry:e}){var s,c;const[n,r]=b.useState(!1),i=EA(e),a=i.includes(`
62
+ `),l=CA(e);if(e.streamType==="system"&&(e.subtype==="task_progress"||e.subtype==="task_notification")){const f=vl(e.agentName),d=e.agentName?pc(e.agentName,e.agentName):"#8B949E",m=e.lastToolName??((s=e.tool)==null?void 0:s.name),p=e.description;return g.jsxs("div",{className:"py-0 leading-snug flex items-center gap-1.5 text-dark-muted",children:[g.jsx("span",{children:Li(e.timestamp)}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:d}}),g.jsx("span",{style:{color:d},className:"font-medium",children:f}),m&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-dark-muted",children:g.jsx(tb,{size:10})}),g.jsx("span",{className:"text-dark-muted",children:m})]}),p&&g.jsx("span",{className:"text-dark-muted truncate",children:p})]})}if(jA.has(e.streamType)&&i){const{label:f,color:d}=NS(e);return g.jsxs("div",{className:"py-0.5 leading-relaxed",children:[g.jsx("span",{className:"text-dark-muted",children:Li(e.timestamp)})," ",g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full mr-0.5 align-middle",style:{backgroundColor:d}}),g.jsx("span",{style:{color:d},className:"font-semibold",children:f}),e.streamType==="fc"&&e.subtype&&g.jsxs("span",{className:"text-dark-muted text-[10px] ml-1",children:["[",SA(e.subtype),"]"]})," ",a?g.jsx("span",{className:"text-dark-text whitespace-pre-wrap",children:i}):g.jsx("span",{className:"text-dark-text",children:i})]})}if(e.streamType==="tool_use"&&((c=e.tool)!=null&&c.name)){const{label:f,color:d}=NS(e),m=l!==null;return g.jsxs("div",{children:[g.jsxs("div",{className:"py-0 leading-snug flex items-center gap-1.5",children:[g.jsx("span",{className:"text-dark-muted",children:Li(e.timestamp)}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:d}}),g.jsx("span",{style:{color:d},className:"font-semibold",children:f}),g.jsx("span",{className:`text-dark-muted bg-dark-border/30 px-1.5 py-0.5 rounded${m?" cursor-pointer border-b border-dotted border-dark-border hover:bg-dark-border/50":""}`,onClick:m?()=>r(p=>!p):void 0,onKeyDown:m?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(y=>!y))}:void 0,role:m?"button":void 0,tabIndex:m?0:void 0,"aria-expanded":m?n:void 0,children:e.tool.name})]}),n&&l&&g.jsx("div",{className:"text-dark-muted pl-6 pb-0.5 font-mono truncate",title:l,children:l})]})}if(e.streamType==="result"||e.streamType==="tool_result"){const{color:f,label:d}=Hd(e.streamType);return g.jsxs("div",{className:"py-0 leading-snug text-dark-muted",children:[g.jsx("span",{className:"text-dark-muted",children:Li(e.timestamp)})," ",g.jsx("span",{style:{color:f},className:"font-semibold",children:d})]})}if(i){const{color:f,label:d}=Hd(e.streamType);return g.jsxs("div",{className:"py-0 leading-snug text-dark-muted",children:[g.jsx("span",{className:"text-dark-muted",children:Li(e.timestamp)})," ",g.jsx("span",{style:{color:f},className:"font-semibold",children:d})," ",g.jsx("span",{className:"text-dark-text",children:i})]})}return null}function NL({entry:e}){const n=vL.has(e.eventType),r=yL.has(e.eventType),i=r?xL(e.payload):null,{label:a,color:l}=bL(e),[s,c]=b.useState(!1);if(n){const f=e.eventType==="SessionStart"||e.eventType==="SubagentStart"?"#3FB950":"#8B949E";return g.jsxs("div",{className:"py-0 leading-snug flex items-center gap-1.5 text-dark-muted",children:[g.jsx("span",{children:Li(e.timestamp)}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:l}}),g.jsx("span",{style:{color:l},className:"font-medium",children:a}),g.jsx("span",{className:"font-normal px-1.5 rounded",style:{color:f,backgroundColor:f+"18"},children:e.eventType})]})}if(r){const f=i!==null;return g.jsxs("div",{className:"py-0 leading-snug text-dark-muted",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{children:Li(e.timestamp)}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:l}}),g.jsx("span",{style:{color:l},className:"font-medium",children:a}),g.jsx("span",{className:`font-normal bg-red-500/20 text-red-400 px-1.5 py-0.5 rounded${f?" cursor-pointer border-b border-dotted border-red-400/40 hover:bg-red-500/30":""}`,onClick:f?()=>c(d=>!d):void 0,onKeyDown:f?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c(m=>!m))}:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,"aria-expanded":f?s:void 0,children:e.eventType}),e.toolName&&g.jsx("span",{className:"text-dark-muted bg-dark-border/30 px-1.5 rounded",children:e.toolName})]}),s&&i&&g.jsx("div",{className:"ml-[52px] text-[#F85149] mt-0.5 line-clamp-2",children:i})]})}return g.jsxs("div",{className:"py-0 leading-snug flex items-center gap-1.5 text-dark-muted",children:[g.jsx("span",{children:Li(e.timestamp)}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:l}}),g.jsx("span",{style:{color:l},className:"font-medium",children:a}),g.jsx("span",{className:"text-dark-text font-normal",children:e.eventType}),e.toolName&&g.jsx("span",{className:"text-dark-muted bg-dark-border/30 px-1.5 rounded",children:e.toolName})]})}function OL(e){return e.source==="stream"?e.streamType==="user"?"__pm__":e.streamType==="fc"?"__fc__":e.agentName:e.agentName}const AL=6e4;function TL({teamId:e,teamStatus:n,isThinking:r,roster:i,agentFilters:a,onAgentFiltersChange:l}){const s=Ot(),[c,f]=b.useReducer(jL,EL),[d,m]=b.useState(!1),[p,y]=b.useState(!1),x=b.useRef(null),_=b.useRef(null),S=b.useRef(!0),k=b.useRef(e);k.current=e;const j=b.useRef(0),C=b.useCallback(()=>{const z=x.current;if(!z)return;const D=z.scrollHeight-z.scrollTop-z.clientHeight<40;S.current=D},[]);b.useEffect(()=>{let z=!1,D=null;j.current=0;async function U(q){if(!z)try{const L=await s.get(`teams/${e}/timeline?limit=500`);z||f({type:q?"INIT":"SYNC",entries:L})}catch{}}return U(!0),qd.has(n)||(D=setInterval(()=>U(!1),AL)),()=>{z=!0,D!==null&&clearInterval(D)}},[s,e,n]);const N=b.useCallback((z,D)=>{if(z==="team_output"){const U=D;if(U.team_id!==k.current||SL.has(U.event.type))return;const q=j.current++,L=_L(k.current,U.event,q);f({type:"APPEND_STREAM",entries:L})}else if(z==="team_event"){const U=D;if(U.team_id!==k.current)return;const q=kL(k.current,U);f({type:"APPEND_HOOK",entry:q})}},[]);Hu(["team_output","team_event"],N);const{entries:O}=c,T=b.useMemo(()=>!a||a.size===0?O:O.filter(z=>{const D=OL(z);return D?a.has(D):!0}),[O,a]);b.useEffect(()=>{var z;S.current&&((z=_.current)==null||z.scrollIntoView({behavior:"smooth"}))},[T.length]);const A=b.useCallback(()=>{var D;const z=[];for(const U of T){const q=Li(U.timestamp);if(U.source==="stream"){const L=EA(U);if(L){const $=U.agentName?vl(U.agentName):Hd(U.streamType).label,G=U.streamType==="fc"&&U.subtype?` [${SA(U.subtype)}]`:"";z.push(`[${q}] ${$}${G}: ${L}`)}else if(U.streamType==="tool_use"&&((D=U.tool)!=null&&D.name)){const $=U.agentName?vl(U.agentName):"tool",G=CA(U),B=G?` — ${G}`:"";z.push(`[${q}] ${$}: ${U.tool.name}${B}`)}else if(U.streamType==="system"&&U.description){const $=U.agentName?vl(U.agentName):"system";z.push(`[${q}] ${$}: ${U.lastToolName??""} ${U.description}`)}}else{const L=U,$=L.agentName?vl(L.agentName):"System";let G=L.eventType;L.toolName&&(G+=` (${L.toolName})`),z.push(`[${q}] ${$}: ${G}`)}}navigator.clipboard.writeText(z.join(`
63
+ `)).then(()=>{m(!0),setTimeout(()=>m(!1),2e3)}).catch(()=>{y(!0),setTimeout(()=>y(!1),2e3)})},[T]),P=b.useMemo(()=>O.some(z=>z.source==="stream"&&z.streamType==="user"),[O]),R=b.useMemo(()=>O.some(z=>z.source==="stream"&&z.streamType==="fc"),[O]);if(O.length===0){const z=qd.has(n);return g.jsx("div",{className:"text-[11px] text-dark-muted italic py-2",children:z?"No session log captured.":"No events yet. Events appear when Claude Code is running."})}return g.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[i&&l&&g.jsx(mL,{roster:i,activeFilters:a??new Set,onFiltersChange:l,hasUserEntries:P,hasFcEntries:R}),g.jsx("button",{onClick:A,className:"absolute top-1.5 right-1.5 z-10 px-2 py-0.5 text-[10px] rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted bg-[#0D1117] transition-colors",title:"Copy full log to clipboard",children:d?"Copied!":p?"Failed":"Copy"}),g.jsxs("div",{ref:x,onScroll:C,className:`flex-1 min-h-0 font-mono text-[11px] overflow-y-auto bg-[#0D1117] p-2 rounded border border-dark-border custom-scrollbar${r?" thinking-glow":""}`,children:[T.map(z=>z.source==="stream"?g.jsx(CL,{entry:z},z.id):g.jsx(NL,{entry:z},z.id)),r&&g.jsxs("div",{className:"py-1 flex items-center gap-1.5",children:[g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[#E8976C] animate-thinking-dot"}),g.jsx("span",{className:"text-[#E8976C] text-[10px] italic",children:"thinking..."})]}),g.jsx("div",{ref:_})]})]})}function ML({teamId:e,disabled:n=!1}){const r=Ot(),[i,a]=b.useState(""),[l,s]=b.useState(!1),[c,f]=b.useState(null),d=b.useRef(null),m=b.useRef(null);b.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const p=x=>{f(x),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{f(null),m.current=null},3e3)},y=async x=>{var S;x.preventDefault();const _=i.trim();if(!(!_||l)){s(!0),f(null);try{await r.post(`teams/${e}/send-message`,{message:_}),a(""),p({type:"success",message:"Message sent"}),(S=d.current)==null||S.focus()}catch(k){if(k instanceof gA&&k.status===422)p({type:"warning",message:"Team is not running — message not delivered"});else{const j=k instanceof Error?k.message:"Failed to send message";p({type:"error",message:j})}}finally{s(!1)}}};return g.jsxs("div",{children:[g.jsxs("form",{onSubmit:y,className:"flex items-center gap-2",children:[g.jsx("input",{ref:d,type:"text",value:i,onChange:x=>a(x.target.value),disabled:n||l,placeholder:n?"Team is not running":"Send message to team...",className:"flex-1 bg-dark-base border border-dark-border rounded px-3 py-2 text-sm text-dark-text placeholder-dark-muted focus:outline-none focus:border-dark-accent transition-colors disabled:opacity-50"}),g.jsx("button",{type:"submit",disabled:n||l||!i.trim(),className:"px-4 py-2 text-sm font-medium rounded bg-dark-accent text-white hover:bg-dark-accent/80 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:l?"Sending...":"Send"})]}),c&&g.jsx("div",{className:`mt-2 text-xs px-2 py-1 rounded ${c.type==="success"?"text-[#3FB950] bg-[#3FB950]/10":c.type==="warning"?"text-[#D29922] bg-[#D29922]/10":"text-[#F85149] bg-[#F85149]/10"}`,children:c.message})]})}function PL(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,a,l,s,c=[],f=!0,d=!1;try{if(l=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(i=l.call(r)).done)&&(c.push(i.value),c.length!==n);f=!0);}catch(m){d=!0,a=m}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw a}}return c}}function DL(e,n,r){return n=UL(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function TS(e,n){return zL(e)||PL(e,n)||NA(e,n)||BL()}function RL(e){return LL(e)||IL(e)||NA(e)||$L()}function LL(e){if(Array.isArray(e))return Ay(e)}function zL(e){if(Array.isArray(e))return e}function IL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NA(e,n){if(e){if(typeof e=="string")return Ay(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ay(e,n)}}function Ay(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function $L(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
64
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FL(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function UL(e){var n=FL(e,"string");return typeof n=="symbol"?n:String(n)}var qL=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(RL(Object.entries(n).filter(function(a){var l=TS(a,1),s=l[0];return!i.has(s)}).map(function(a){var l=TS(a,2),s=l[0],c=l[1];return DL({},s,c)}))))};function Ty(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function HL(e){if(Array.isArray(e))return e}function GL(e){if(Array.isArray(e))return Ty(e)}function KL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VL(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,a,l,s,c=[],f=!0,d=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(f=(i=l.call(r)).done)&&(c.push(i.value),c.length!==n);f=!0);}catch(m){d=!0,a=m}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw a}}return c}}function YL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
66
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
67
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XL(e,n){return HL(e)||VL(e,n)||OA(e,n)||YL()}function MS(e){return GL(e)||KL(e)||OA(e)||WL()}function OA(e,n){if(e){if(typeof e=="string")return Ty(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ty(e,n):void 0}}function ZL(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.wrapperElementType,i=r===void 0?"div":r,a=n.nodeMapper,l=a===void 0?function(m){return m}:a,s=n.methodNames,c=s===void 0?[]:s,f=n.initPropNames,d=f===void 0?[]:f;return b.forwardRef(function(m,p){var y=b.useRef(),x=b.useMemo(function(){var k=Object.fromEntries(d.filter(function(j){return m.hasOwnProperty(j)}).map(function(j){return[j,m[j]]}));return e(k)},[]);PS(function(){x(l(y.current))},b.useLayoutEffect),PS(function(){return x._destructor instanceof Function?x._destructor:void 0});var _=b.useCallback(function(k){for(var j=arguments.length,C=new Array(j>1?j-1:0),N=1;N<j;N++)C[N-1]=arguments[N];return x[k]instanceof Function?x[k].apply(x,C):void 0},[x]),S=b.useRef({});return Object.keys(qL(m,[].concat(MS(c),MS(d)))).filter(function(k){return S.current[k]!==m[k]}).forEach(function(k){return _(k,m[k])}),S.current=m,b.useImperativeHandle(p,function(){return Object.fromEntries(c.map(function(k){return[k,function(){for(var j=arguments.length,C=new Array(j),N=0;N<j;N++)C[N]=arguments[N];return _.apply(void 0,[k].concat(C))}]}))},[_]),Jo.createElement(i,{ref:y})})}function PS(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.useEffect,r=b.useRef(),i=b.useRef(!1),a=b.useRef(!1),l=b.useState(0),s=XL(l,2);s[0];var c=s[1];i.current&&(a.current=!0),n(function(){return i.current||(r.current=e(),i.current=!0),c(function(f){return f+1}),function(){a.current&&r.current&&r.current()}},[])}var My="http://www.w3.org/1999/xhtml";const DS={svg:"http://www.w3.org/2000/svg",xhtml:My,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function lm(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),DS.hasOwnProperty(n)?{space:DS[n],local:e}:e}function QL(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===My&&n.documentElement.namespaceURI===My?n.createElement(e):n.createElementNS(r,e)}}function JL(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function AA(e){var n=lm(e);return(n.local?JL:QL)(n)}function ez(){}function ab(e){return e==null?ez:function(){return this.querySelector(e)}}function tz(e){typeof e!="function"&&(e=ab(e));for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a)for(var l=n[a],s=l.length,c=i[a]=new Array(s),f,d,m=0;m<s;++m)(f=l[m])&&(d=e.call(f,f.__data__,m,l))&&("__data__"in f&&(d.__data__=f.__data__),c[m]=d);return new Wn(i,this._parents)}function nz(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rz(){return[]}function TA(e){return e==null?rz:function(){return this.querySelectorAll(e)}}function iz(e){return function(){return nz(e.apply(this,arguments))}}function az(e){typeof e=="function"?e=iz(e):e=TA(e);for(var n=this._groups,r=n.length,i=[],a=[],l=0;l<r;++l)for(var s=n[l],c=s.length,f,d=0;d<c;++d)(f=s[d])&&(i.push(e.call(f,f.__data__,d,s)),a.push(f));return new Wn(i,a)}function MA(e){return function(){return this.matches(e)}}function PA(e){return function(n){return n.matches(e)}}var lz=Array.prototype.find;function oz(e){return function(){return lz.call(this.children,e)}}function sz(){return this.firstElementChild}function uz(e){return this.select(e==null?sz:oz(typeof e=="function"?e:PA(e)))}var cz=Array.prototype.filter;function fz(){return Array.from(this.children)}function dz(e){return function(){return cz.call(this.children,e)}}function hz(e){return this.selectAll(e==null?fz:dz(typeof e=="function"?e:PA(e)))}function mz(e){typeof e!="function"&&(e=MA(e));for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a)for(var l=n[a],s=l.length,c=i[a]=[],f,d=0;d<s;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new Wn(i,this._parents)}function DA(e){return new Array(e.length)}function pz(){return new Wn(this._enter||this._groups.map(DA),this._parents)}function Gd(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Gd.prototype={constructor:Gd,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function gz(e){return function(){return e}}function vz(e,n,r,i,a,l){for(var s=0,c,f=n.length,d=l.length;s<d;++s)(c=n[s])?(c.__data__=l[s],i[s]=c):r[s]=new Gd(e,l[s]);for(;s<f;++s)(c=n[s])&&(a[s]=c)}function yz(e,n,r,i,a,l,s){var c,f,d=new Map,m=n.length,p=l.length,y=new Array(m),x;for(c=0;c<m;++c)(f=n[c])&&(y[c]=x=s.call(f,f.__data__,c,n)+"",d.has(x)?a[c]=f:d.set(x,f));for(c=0;c<p;++c)x=s.call(e,l[c],c,l)+"",(f=d.get(x))?(i[c]=f,f.__data__=l[c],d.delete(x)):r[c]=new Gd(e,l[c]);for(c=0;c<m;++c)(f=n[c])&&d.get(y[c])===f&&(a[c]=f)}function xz(e){return e.__data__}function bz(e,n){if(!arguments.length)return Array.from(this,xz);var r=n?yz:vz,i=this._parents,a=this._groups;typeof e!="function"&&(e=gz(e));for(var l=a.length,s=new Array(l),c=new Array(l),f=new Array(l),d=0;d<l;++d){var m=i[d],p=a[d],y=p.length,x=wz(e.call(m,m&&m.__data__,d,i)),_=x.length,S=c[d]=new Array(_),k=s[d]=new Array(_),j=f[d]=new Array(y);r(m,p,S,k,j,x,n);for(var C=0,N=0,O,T;C<_;++C)if(O=S[C]){for(C>=N&&(N=C+1);!(T=k[N])&&++N<_;);O._next=T||null}}return s=new Wn(s,i),s._enter=c,s._exit=f,s}function wz(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _z(){return new Wn(this._exit||this._groups.map(DA),this._parents)}function kz(e,n,r){var i=this.enter(),a=this,l=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),r==null?l.remove():r(l),i&&a?i.merge(a).order():a}function Sz(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,a=r.length,l=i.length,s=Math.min(a,l),c=new Array(a),f=0;f<s;++f)for(var d=r[f],m=i[f],p=d.length,y=c[f]=new Array(p),x,_=0;_<p;++_)(x=d[_]||m[_])&&(y[_]=x);for(;f<a;++f)c[f]=r[f];return new Wn(c,this._parents)}function jz(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],a=i.length-1,l=i[a],s;--a>=0;)(s=i[a])&&(l&&s.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(s,l),l=s);return this}function Ez(e){e||(e=Cz);function n(p,y){return p&&y?e(p.__data__,y.__data__):!p-!y}for(var r=this._groups,i=r.length,a=new Array(i),l=0;l<i;++l){for(var s=r[l],c=s.length,f=a[l]=new Array(c),d,m=0;m<c;++m)(d=s[m])&&(f[m]=d);f.sort(n)}return new Wn(a,this._parents).order()}function Cz(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function Nz(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Oz(){return Array.from(this)}function Az(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,l=i.length;a<l;++a){var s=i[a];if(s)return s}return null}function Tz(){let e=0;for(const n of this)++e;return e}function Mz(){return!this.node()}function Pz(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var a=n[r],l=0,s=a.length,c;l<s;++l)(c=a[l])&&e.call(c,c.__data__,l,a);return this}function Dz(e){return function(){this.removeAttribute(e)}}function Rz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lz(e,n){return function(){this.setAttribute(e,n)}}function zz(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function Iz(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function $z(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Bz(e,n){var r=lm(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?Rz:Dz:typeof n=="function"?r.local?$z:Iz:r.local?zz:Lz)(r,n))}function RA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Fz(e){return function(){this.style.removeProperty(e)}}function Uz(e,n,r){return function(){this.style.setProperty(e,n,r)}}function qz(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Hz(e,n,r){return arguments.length>1?this.each((n==null?Fz:typeof n=="function"?qz:Uz)(e,n,r??"")):Uo(this.node(),e)}function Uo(e,n){return e.style.getPropertyValue(n)||RA(e).getComputedStyle(e,null).getPropertyValue(n)}function Gz(e){return function(){delete this[e]}}function Kz(e,n){return function(){this[e]=n}}function Vz(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Yz(e,n){return arguments.length>1?this.each((n==null?Gz:typeof n=="function"?Vz:Kz)(e,n)):this.node()[e]}function LA(e){return e.trim().split(/^|\s+/)}function lb(e){return e.classList||new zA(e)}function zA(e){this._node=e,this._names=LA(e.getAttribute("class")||"")}zA.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function IA(e,n){for(var r=lb(e),i=-1,a=n.length;++i<a;)r.add(n[i])}function $A(e,n){for(var r=lb(e),i=-1,a=n.length;++i<a;)r.remove(n[i])}function Wz(e){return function(){IA(this,e)}}function Xz(e){return function(){$A(this,e)}}function Zz(e,n){return function(){(n.apply(this,arguments)?IA:$A)(this,e)}}function Qz(e,n){var r=LA(e+"");if(arguments.length<2){for(var i=lb(this.node()),a=-1,l=r.length;++a<l;)if(!i.contains(r[a]))return!1;return!0}return this.each((typeof n=="function"?Zz:n?Wz:Xz)(r,n))}function Jz(){this.textContent=""}function eI(e){return function(){this.textContent=e}}function tI(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function nI(e){return arguments.length?this.each(e==null?Jz:(typeof e=="function"?tI:eI)(e)):this.node().textContent}function rI(){this.innerHTML=""}function iI(e){return function(){this.innerHTML=e}}function aI(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function lI(e){return arguments.length?this.each(e==null?rI:(typeof e=="function"?aI:iI)(e)):this.node().innerHTML}function oI(){this.nextSibling&&this.parentNode.appendChild(this)}function sI(){return this.each(oI)}function uI(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cI(){return this.each(uI)}function fI(e){var n=typeof e=="function"?e:AA(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function dI(){return null}function hI(e,n){var r=typeof e=="function"?e:AA(e),i=n==null?dI:typeof n=="function"?n:ab(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function mI(){var e=this.parentNode;e&&e.removeChild(this)}function pI(){return this.each(mI)}function gI(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function vI(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function yI(e){return this.select(e?vI:gI)}function xI(e){return arguments.length?this.property("__data__",e):this.node().__data__}function bI(e){return function(n){e.call(this,n,this.__data__)}}function wI(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function _I(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,a=n.length,l;r<a;++r)l=n[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):n[++i]=l;++i?n.length=i:delete this.__on}}}function kI(e,n,r){return function(){var i=this.__on,a,l=bI(n);if(i){for(var s=0,c=i.length;s<c;++s)if((a=i[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=r),a.value=n;return}}this.addEventListener(e.type,l,r),a={type:e.type,name:e.name,value:n,listener:l,options:r},i?i.push(a):this.__on=[a]}}function SI(e,n,r){var i=wI(e+""),a,l=i.length,s;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,m;f<d;++f)for(a=0,m=c[f];a<l;++a)if((s=i[a]).type===m.type&&s.name===m.name)return m.value}return}for(c=n?kI:_I,a=0;a<l;++a)this.each(c(i[a],n,r));return this}function BA(e,n,r){var i=RA(e),a=i.CustomEvent;typeof a=="function"?a=new a(n,r):(a=i.document.createEvent("Event"),r?(a.initEvent(n,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function jI(e,n){return function(){return BA(this,e,n)}}function EI(e,n){return function(){return BA(this,e,n.apply(this,arguments))}}function CI(e,n){return this.each((typeof n=="function"?EI:jI)(e,n))}function*NI(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,l=i.length,s;a<l;++a)(s=i[a])&&(yield s)}var FA=[null];function Wn(e,n){this._groups=e,this._parents=n}function gc(){return new Wn([[document.documentElement]],FA)}function OI(){return this}Wn.prototype=gc.prototype={constructor:Wn,select:tz,selectAll:az,selectChild:uz,selectChildren:hz,filter:mz,data:bz,enter:pz,exit:_z,join:kz,merge:Sz,selection:OI,order:jz,sort:Ez,call:Nz,nodes:Oz,node:Az,size:Tz,empty:Mz,each:Pz,attr:Bz,style:Hz,property:Yz,classed:Qz,text:nI,html:lI,raise:sI,lower:cI,append:fI,insert:hI,remove:pI,clone:yI,datum:xI,on:SI,dispatch:CI,[Symbol.iterator]:NI};function pr(e){return typeof e=="string"?new Wn([[document.querySelector(e)]],[document.documentElement]):new Wn([[e]],FA)}function AI(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Gr(e,n){if(e=AI(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}var TI={value:()=>{}};function vc(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Md(r)}function Md(e){this._=e}function MI(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",a=r.indexOf(".");if(a>=0&&(i=r.slice(a+1),r=r.slice(0,a)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Md.prototype=vc.prototype={constructor:Md,on:function(e,n){var r=this._,i=MI(e+"",r),a,l=-1,s=i.length;if(arguments.length<2){for(;++l<s;)if((a=(e=i[l]).type)&&(a=PI(r[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++l<s;)if(a=(e=i[l]).type)r[a]=RS(r[a],e.name,n);else if(n==null)for(a in r)r[a]=RS(r[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Md(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var r=new Array(a),i=0,a,l;i<a;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,l=i.length;a<l;++a)i[a].value.apply(n,r)}};function PI(e,n){for(var r=0,i=e.length,a;r<i;++r)if((a=e[r]).name===n)return a.value}function RS(e,n,r){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=TI,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const DI={passive:!1},Gu={capture:!0,passive:!1};function Sv(e){e.stopImmediatePropagation()}function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function UA(e){var n=e.document.documentElement,r=pr(e).on("dragstart.drag",Io,Gu);"onselectstart"in n?r.on("selectstart.drag",Io,Gu):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function qA(e,n){var r=e.document.documentElement,i=pr(e).on("dragstart.drag",null);n&&(i.on("click.drag",Io,Gu),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const ld=e=>()=>e;function Py(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:l,x:s,y:c,dx:f,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}Py.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function RI(e){return!e.ctrlKey&&!e.button}function LI(){return this.parentNode}function zI(e,n){return n??{x:e.x,y:e.y}}function II(){return navigator.maxTouchPoints||"ontouchstart"in this}function $I(){var e=RI,n=LI,r=zI,i=II,a={},l=vc("start","drag","end"),s=0,c,f,d,m,p=0;function y(O){O.on("mousedown.drag",x).filter(i).on("touchstart.drag",k).on("touchmove.drag",j,DI).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(O,T){if(!(m||!e.call(this,O,T))){var A=N(this,n.call(this,O,T),O,T,"mouse");A&&(pr(O.view).on("mousemove.drag",_,Gu).on("mouseup.drag",S,Gu),UA(O.view),Sv(O),d=!1,c=O.clientX,f=O.clientY,A("start",O))}}function _(O){if(Io(O),!d){var T=O.clientX-c,A=O.clientY-f;d=T*T+A*A>p}a.mouse("drag",O)}function S(O){pr(O.view).on("mousemove.drag mouseup.drag",null),qA(O.view,d),Io(O),a.mouse("end",O)}function k(O,T){if(e.call(this,O,T)){var A=O.changedTouches,P=n.call(this,O,T),R=A.length,z,D;for(z=0;z<R;++z)(D=N(this,P,O,T,A[z].identifier,A[z]))&&(Sv(O),D("start",O,A[z]))}}function j(O){var T=O.changedTouches,A=T.length,P,R;for(P=0;P<A;++P)(R=a[T[P].identifier])&&(Io(O),R("drag",O,T[P]))}function C(O){var T=O.changedTouches,A=T.length,P,R;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),P=0;P<A;++P)(R=a[T[P].identifier])&&(Sv(O),R("end",O,T[P]))}function N(O,T,A,P,R,z){var D=l.copy(),U=Gr(z||A,T),q,L,$;if(($=r.call(O,new Py("beforestart",{sourceEvent:A,target:y,identifier:R,active:s,x:U[0],y:U[1],dx:0,dy:0,dispatch:D}),P))!=null)return q=$.x-U[0]||0,L=$.y-U[1]||0,function G(B,Y,ee){var H=U,re;switch(B){case"start":a[R]=G,re=s++;break;case"end":delete a[R],--s;case"drag":U=Gr(ee||Y,T),re=s;break}D.call(B,O,new Py(B,{sourceEvent:Y,subject:$,target:y,identifier:R,active:re,x:U[0]+q,y:U[1]+L,dx:U[0]-H[0],dy:U[1]-H[1],dispatch:D}),P)}}return y.filter=function(O){return arguments.length?(e=typeof O=="function"?O:ld(!!O),y):e},y.container=function(O){return arguments.length?(n=typeof O=="function"?O:ld(O),y):n},y.subject=function(O){return arguments.length?(r=typeof O=="function"?O:ld(O),y):r},y.touchable=function(O){return arguments.length?(i=typeof O=="function"?O:ld(!!O),y):i},y.on=function(){var O=l.on.apply(l,arguments);return O===l?y:O},y.clickDistance=function(O){return arguments.length?(p=(O=+O)*O,y):Math.sqrt(p)},y}function ob(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function HA(e,n){var r=Object.create(e.prototype);for(var i in n)r[i]=n[i];return r}function yc(){}var Ku=.7,Kd=1/Ku,$o="\\s*([+-]?\\d+)\\s*",Vu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",BI=/^#([0-9a-f]{3,8})$/,FI=new RegExp(`^rgb\\(${$o},${$o},${$o}\\)$`),UI=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),qI=new RegExp(`^rgba\\(${$o},${$o},${$o},${Vu}\\)$`),HI=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${Vu}\\)$`),GI=new RegExp(`^hsl\\(${Vu},${Jr},${Jr}\\)$`),KI=new RegExp(`^hsla\\(${Vu},${Jr},${Jr},${Vu}\\)$`),LS={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};ob(yc,El,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zS,formatHex:zS,formatHex8:VI,formatHsl:YI,formatRgb:IS,toString:IS});function zS(){return this.rgb().formatHex()}function VI(){return this.rgb().formatHex8()}function YI(){return GA(this).formatHsl()}function IS(){return this.rgb().formatRgb()}function El(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=BI.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?$S(n):r===3?new Tn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?od(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?od(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=FI.exec(e))?new Tn(n[1],n[2],n[3],1):(n=UI.exec(e))?new Tn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=qI.exec(e))?od(n[1],n[2],n[3],n[4]):(n=HI.exec(e))?od(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=GI.exec(e))?US(n[1],n[2]/100,n[3]/100,1):(n=KI.exec(e))?US(n[1],n[2]/100,n[3]/100,n[4]):LS.hasOwnProperty(e)?$S(LS[e]):e==="transparent"?new Tn(NaN,NaN,NaN,0):null}function $S(e){return new Tn(e>>16&255,e>>8&255,e&255,1)}function od(e,n,r,i){return i<=0&&(e=n=r=NaN),new Tn(e,n,r,i)}function WI(e){return e instanceof yc||(e=El(e)),e?(e=e.rgb(),new Tn(e.r,e.g,e.b,e.opacity)):new Tn}function Dy(e,n,r,i){return arguments.length===1?WI(e):new Tn(e,n,r,i??1)}function Tn(e,n,r,i){this.r=+e,this.g=+n,this.b=+r,this.opacity=+i}ob(Tn,Dy,HA(yc,{brighter(e){return e=e==null?Kd:Math.pow(Kd,e),new Tn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ku:Math.pow(Ku,e),new Tn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Tn(_l(this.r),_l(this.g),_l(this.b),Vd(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:BS,formatHex:BS,formatHex8:XI,formatRgb:FS,toString:FS}));function BS(){return`#${yl(this.r)}${yl(this.g)}${yl(this.b)}`}function XI(){return`#${yl(this.r)}${yl(this.g)}${yl(this.b)}${yl((isNaN(this.opacity)?1:this.opacity)*255)}`}function FS(){const e=Vd(this.opacity);return`${e===1?"rgb(":"rgba("}${_l(this.r)}, ${_l(this.g)}, ${_l(this.b)}${e===1?")":`, ${e})`}`}function Vd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _l(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yl(e){return e=_l(e),(e<16?"0":"")+e.toString(16)}function US(e,n,r,i){return i<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new Ar(e,n,r,i)}function GA(e){if(e instanceof Ar)return new Ar(e.h,e.s,e.l,e.opacity);if(e instanceof yc||(e=El(e)),!e)return new Ar;if(e instanceof Ar)return e;e=e.rgb();var n=e.r/255,r=e.g/255,i=e.b/255,a=Math.min(n,r,i),l=Math.max(n,r,i),s=NaN,c=l-a,f=(l+a)/2;return c?(n===l?s=(r-i)/c+(r<i)*6:r===l?s=(i-n)/c+2:s=(n-r)/c+4,c/=f<.5?l+a:2-l-a,s*=60):c=f>0&&f<1?0:s,new Ar(s,c,f,e.opacity)}function ZI(e,n,r,i){return arguments.length===1?GA(e):new Ar(e,n,r,i??1)}function Ar(e,n,r,i){this.h=+e,this.s=+n,this.l=+r,this.opacity=+i}ob(Ar,ZI,HA(yc,{brighter(e){return e=e==null?Kd:Math.pow(Kd,e),new Ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ku:Math.pow(Ku,e),new Ar(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*n,a=2*r-i;return new Tn(jv(e>=240?e-240:e+120,a,i),jv(e,a,i),jv(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Ar(qS(this.h),sd(this.s),sd(this.l),Vd(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 e=Vd(this.opacity);return`${e===1?"hsl(":"hsla("}${qS(this.h)}, ${sd(this.s)*100}%, ${sd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qS(e){return e=(e||0)%360,e<0?e+360:e}function sd(e){return Math.max(0,Math.min(1,e||0))}function jv(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const sb=e=>()=>e;function QI(e,n){return function(r){return e+r*n}}function JI(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(i){return Math.pow(e+i*n,r)}}function e$(e){return(e=+e)==1?KA:function(n,r){return r-n?JI(n,r,e):sb(isNaN(n)?r:n)}}function KA(e,n){var r=n-e;return r?QI(e,r):sb(isNaN(e)?n:e)}const Yd=(function e(n){var r=e$(n);function i(a,l){var s=r((a=Dy(a)).r,(l=Dy(l)).r),c=r(a.g,l.g),f=r(a.b,l.b),d=KA(a.opacity,l.opacity);return function(m){return a.r=s(m),a.g=c(m),a.b=f(m),a.opacity=d(m),a+""}}return i.gamma=e,i})(1);function t$(e,n){n||(n=[]);var r=e?Math.min(n.length,e.length):0,i=n.slice(),a;return function(l){for(a=0;a<r;++a)i[a]=e[a]*(1-l)+n[a]*l;return i}}function n$(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function r$(e,n){var r=n?n.length:0,i=e?Math.min(r,e.length):0,a=new Array(i),l=new Array(r),s;for(s=0;s<i;++s)a[s]=ns(e[s],n[s]);for(;s<r;++s)l[s]=n[s];return function(c){for(s=0;s<i;++s)l[s]=a[s](c);return l}}function i$(e,n){var r=new Date;return e=+e,n=+n,function(i){return r.setTime(e*(1-i)+n*i),r}}function Or(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}function a$(e,n){var r={},i={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?r[a]=ns(e[a],n[a]):i[a]=n[a];return function(l){for(a in r)i[a]=r[a](l);return i}}var Ry=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ev=new RegExp(Ry.source,"g");function l$(e){return function(){return e}}function o$(e){return function(n){return e(n)+""}}function VA(e,n){var r=Ry.lastIndex=Ev.lastIndex=0,i,a,l,s=-1,c=[],f=[];for(e=e+"",n=n+"";(i=Ry.exec(e))&&(a=Ev.exec(n));)(l=a.index)>r&&(l=n.slice(r,l),c[s]?c[s]+=l:c[++s]=l),(i=i[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,f.push({i:s,x:Or(i,a)})),r=Ev.lastIndex;return r<n.length&&(l=n.slice(r),c[s]?c[s]+=l:c[++s]=l),c.length<2?f[0]?o$(f[0].x):l$(n):(n=f.length,function(d){for(var m=0,p;m<n;++m)c[(p=f[m]).i]=p.x(d);return c.join("")})}function ns(e,n){var r=typeof n,i;return n==null||r==="boolean"?sb(n):(r==="number"?Or:r==="string"?(i=El(n))?(n=i,Yd):VA:n instanceof El?Yd:n instanceof Date?i$:n$(n)?t$:Array.isArray(n)?r$:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?a$:Or)(e,n)}function ub(e,n){return e=+e,n=+n,function(r){return Math.round(e*(1-r)+n*r)}}var HS=180/Math.PI,Ly={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function YA(e,n,r,i,a,l){var s,c,f;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(f=e*r+n*i)&&(r-=e*f,i-=n*f),(c=Math.sqrt(r*r+i*i))&&(r/=c,i/=c,f/=c),e*i<n*r&&(e=-e,n=-n,f=-f,s=-s),{translateX:a,translateY:l,rotate:Math.atan2(n,e)*HS,skewX:Math.atan(f)*HS,scaleX:s,scaleY:c}}var ud;function s$(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Ly:YA(n.a,n.b,n.c,n.d,n.e,n.f)}function u$(e){return e==null||(ud||(ud=document.createElementNS("http://www.w3.org/2000/svg","g")),ud.setAttribute("transform",e),!(e=ud.transform.baseVal.consolidate()))?Ly:(e=e.matrix,YA(e.a,e.b,e.c,e.d,e.e,e.f))}function WA(e,n,r,i){function a(d){return d.length?d.pop()+" ":""}function l(d,m,p,y,x,_){if(d!==p||m!==y){var S=x.push("translate(",null,n,null,r);_.push({i:S-4,x:Or(d,p)},{i:S-2,x:Or(m,y)})}else(p||y)&&x.push("translate("+p+n+y+r)}function s(d,m,p,y){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),y.push({i:p.push(a(p)+"rotate(",null,i)-2,x:Or(d,m)})):m&&p.push(a(p)+"rotate("+m+i)}function c(d,m,p,y){d!==m?y.push({i:p.push(a(p)+"skewX(",null,i)-2,x:Or(d,m)}):m&&p.push(a(p)+"skewX("+m+i)}function f(d,m,p,y,x,_){if(d!==p||m!==y){var S=x.push(a(x)+"scale(",null,",",null,")");_.push({i:S-4,x:Or(d,p)},{i:S-2,x:Or(m,y)})}else(p!==1||y!==1)&&x.push(a(x)+"scale("+p+","+y+")")}return function(d,m){var p=[],y=[];return d=e(d),m=e(m),l(d.translateX,d.translateY,m.translateX,m.translateY,p,y),s(d.rotate,m.rotate,p,y),c(d.skewX,m.skewX,p,y),f(d.scaleX,d.scaleY,m.scaleX,m.scaleY,p,y),d=m=null,function(x){for(var _=-1,S=y.length,k;++_<S;)p[(k=y[_]).i]=k.x(x);return p.join("")}}}var c$=WA(s$,"px, ","px)","deg)"),f$=WA(u$,", ",")",")"),d$=1e-12;function GS(e){return((e=Math.exp(e))+1/e)/2}function h$(e){return((e=Math.exp(e))-1/e)/2}function m$(e){return((e=Math.exp(2*e))-1)/(e+1)}const p$=(function e(n,r,i){function a(l,s){var c=l[0],f=l[1],d=l[2],m=s[0],p=s[1],y=s[2],x=m-c,_=p-f,S=x*x+_*_,k,j;if(S<d$)j=Math.log(y/d)/n,k=function(P){return[c+P*x,f+P*_,d*Math.exp(n*P*j)]};else{var C=Math.sqrt(S),N=(y*y-d*d+i*S)/(2*d*r*C),O=(y*y-d*d-i*S)/(2*y*r*C),T=Math.log(Math.sqrt(N*N+1)-N),A=Math.log(Math.sqrt(O*O+1)-O);j=(A-T)/n,k=function(P){var R=P*j,z=GS(T),D=d/(r*C)*(z*m$(n*R+T)-h$(T));return[c+D*x,f+D*_,d*z/GS(n*R+T)]}}return k.duration=j*1e3*n/Math.SQRT2,k}return a.rho=function(l){var s=Math.max(.001,+l),c=s*s,f=c*c;return e(s,c,f)},a})(Math.SQRT2,2,4);function g$(e,n){n===void 0&&(n=e,e=ns);for(var r=0,i=n.length-1,a=n[0],l=new Array(i<0?0:i);r<i;)l[r]=e(a,a=n[++r]);return function(s){var c=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return l[c](s-c)}}var qo=0,Au=0,cu=0,XA=1e3,Wd,Tu,Xd=0,Cl=0,om=0,Yu=typeof performance=="object"&&performance.now?performance:Date,ZA=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cb(){return Cl||(ZA(v$),Cl=Yu.now()+om)}function v$(){Cl=0}function Zd(){this._call=this._time=this._next=null}Zd.prototype=fb.prototype={constructor:Zd,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?cb():+r)+(n==null?0:+n),!this._next&&Tu!==this&&(Tu?Tu._next=this:Wd=this,Tu=this),this._call=e,this._time=r,zy()},stop:function(){this._call&&(this._call=null,this._time=1/0,zy())}};function fb(e,n,r){var i=new Zd;return i.restart(e,n,r),i}function y$(){cb(),++qo;for(var e=Wd,n;e;)(n=Cl-e._time)>=0&&e._call.call(void 0,n),e=e._next;--qo}function KS(){Cl=(Xd=Yu.now())+om,qo=Au=0;try{y$()}finally{qo=0,b$(),Cl=0}}function x$(){var e=Yu.now(),n=e-Xd;n>XA&&(om-=n,Xd=e)}function b$(){for(var e,n=Wd,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Wd=r);Tu=e,zy(i)}function zy(e){if(!qo){Au&&(Au=clearTimeout(Au));var n=e-Cl;n>24?(e<1/0&&(Au=setTimeout(KS,e-Yu.now()-om)),cu&&(cu=clearInterval(cu))):(cu||(Xd=Yu.now(),cu=setInterval(x$,XA)),qo=1,ZA(KS))}}function VS(e,n,r){var i=new Zd;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,r),i}var w$=vc("start","end","cancel","interrupt"),_$=[],QA=0,YS=1,Iy=2,Pd=3,WS=4,$y=5,Dd=6;function sm(e,n,r,i,a,l){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;k$(e,r,{name:n,index:i,group:a,on:w$,tween:_$,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:QA})}function db(e,n){var r=Rr(e,n);if(r.state>QA)throw new Error("too late; already scheduled");return r}function si(e,n){var r=Rr(e,n);if(r.state>Pd)throw new Error("too late; already running");return r}function Rr(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function k$(e,n,r){var i=e.__transition,a;i[n]=r,r.timer=fb(l,0,r.time);function l(d){r.state=YS,r.timer.restart(s,r.delay,r.time),r.delay<=d&&s(d-r.delay)}function s(d){var m,p,y,x;if(r.state!==YS)return f();for(m in i)if(x=i[m],x.name===r.name){if(x.state===Pd)return VS(s);x.state===WS?(x.state=Dd,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete i[m]):+m<n&&(x.state=Dd,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete i[m])}if(VS(function(){r.state===Pd&&(r.state=WS,r.timer.restart(c,r.delay,r.time),c(d))}),r.state=Iy,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Iy){for(r.state=Pd,a=new Array(y=r.tween.length),m=0,p=-1;m<y;++m)(x=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(a[++p]=x);a.length=p+1}}function c(d){for(var m=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(f),r.state=$y,1),p=-1,y=a.length;++p<y;)a[p].call(e,m);r.state===$y&&(r.on.call("end",e,e.__data__,r.index,r.group),f())}function f(){r.state=Dd,r.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function Rd(e,n){var r=e.__transition,i,a,l=!0,s;if(r){n=n==null?null:n+"";for(s in r){if((i=r[s]).name!==n){l=!1;continue}a=i.state>Iy&&i.state<$y,i.state=Dd,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}l&&delete e.__transition}}function S$(e){return this.each(function(){Rd(this,e)})}function j$(e,n){var r,i;return function(){var a=si(this,e),l=a.tween;if(l!==r){i=r=l;for(var s=0,c=i.length;s<c;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}a.tween=i}}function E$(e,n,r){var i,a;if(typeof r!="function")throw new Error;return function(){var l=si(this,e),s=l.tween;if(s!==i){a=(i=s).slice();for(var c={name:n,value:r},f=0,d=a.length;f<d;++f)if(a[f].name===n){a[f]=c;break}f===d&&a.push(c)}l.tween=a}}function C$(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=Rr(this.node(),r).tween,a=0,l=i.length,s;a<l;++a)if((s=i[a]).name===e)return s.value;return null}return this.each((n==null?j$:E$)(r,e,n))}function hb(e,n,r){var i=e._id;return e.each(function(){var a=si(this,i);(a.value||(a.value={}))[n]=r.apply(this,arguments)}),function(a){return Rr(a,i).value[n]}}function JA(e,n){var r;return(typeof n=="number"?Or:n instanceof El?Yd:(r=El(n))?(n=r,Yd):VA)(e,n)}function N$(e){return function(){this.removeAttribute(e)}}function O$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function A$(e,n,r){var i,a=r+"",l;return function(){var s=this.getAttribute(e);return s===a?null:s===i?l:l=n(i=s,r)}}function T$(e,n,r){var i,a=r+"",l;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===i?l:l=n(i=s,r)}}function M$(e,n,r){var i,a,l;return function(){var s,c=r(this),f;return c==null?void this.removeAttribute(e):(s=this.getAttribute(e),f=c+"",s===f?null:s===i&&f===a?l:(a=f,l=n(i=s,c)))}}function P$(e,n,r){var i,a,l;return function(){var s,c=r(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),f=c+"",s===f?null:s===i&&f===a?l:(a=f,l=n(i=s,c)))}}function D$(e,n){var r=lm(e),i=r==="transform"?f$:JA;return this.attrTween(e,typeof n=="function"?(r.local?P$:M$)(r,i,hb(this,"attr."+e,n)):n==null?(r.local?O$:N$)(r):(r.local?T$:A$)(r,i,n))}function R$(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function L$(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function z$(e,n){var r,i;function a(){var l=n.apply(this,arguments);return l!==i&&(r=(i=l)&&L$(e,l)),r}return a._value=n,a}function I$(e,n){var r,i;function a(){var l=n.apply(this,arguments);return l!==i&&(r=(i=l)&&R$(e,l)),r}return a._value=n,a}function $$(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var i=lm(e);return this.tween(r,(i.local?z$:I$)(i,n))}function B$(e,n){return function(){db(this,e).delay=+n.apply(this,arguments)}}function F$(e,n){return n=+n,function(){db(this,e).delay=n}}function U$(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?B$:F$)(n,e)):Rr(this.node(),n).delay}function q$(e,n){return function(){si(this,e).duration=+n.apply(this,arguments)}}function H$(e,n){return n=+n,function(){si(this,e).duration=n}}function G$(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?q$:H$)(n,e)):Rr(this.node(),n).duration}function K$(e,n){if(typeof n!="function")throw new Error;return function(){si(this,e).ease=n}}function V$(e){var n=this._id;return arguments.length?this.each(K$(n,e)):Rr(this.node(),n).ease}function Y$(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;si(this,e).ease=r}}function W$(e){if(typeof e!="function")throw new Error;return this.each(Y$(this._id,e))}function X$(e){typeof e!="function"&&(e=MA(e));for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a)for(var l=n[a],s=l.length,c=i[a]=[],f,d=0;d<s;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new Gi(i,this._parents,this._name,this._id)}function Z$(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,a=r.length,l=Math.min(i,a),s=new Array(i),c=0;c<l;++c)for(var f=n[c],d=r[c],m=f.length,p=s[c]=new Array(m),y,x=0;x<m;++x)(y=f[x]||d[x])&&(p[x]=y);for(;c<i;++c)s[c]=n[c];return new Gi(s,this._parents,this._name,this._id)}function Q$(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function J$(e,n,r){var i,a,l=Q$(n)?db:si;return function(){var s=l(this,e),c=s.on;c!==i&&(a=(i=c).copy()).on(n,r),s.on=a}}function eB(e,n){var r=this._id;return arguments.length<2?Rr(this.node(),r).on.on(e):this.each(J$(r,e,n))}function tB(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function nB(){return this.on("end.remove",tB(this._id))}function rB(e){var n=this._name,r=this._id;typeof e!="function"&&(e=ab(e));for(var i=this._groups,a=i.length,l=new Array(a),s=0;s<a;++s)for(var c=i[s],f=c.length,d=l[s]=new Array(f),m,p,y=0;y<f;++y)(m=c[y])&&(p=e.call(m,m.__data__,y,c))&&("__data__"in m&&(p.__data__=m.__data__),d[y]=p,sm(d[y],n,r,y,d,Rr(m,r)));return new Gi(l,this._parents,n,r)}function iB(e){var n=this._name,r=this._id;typeof e!="function"&&(e=TA(e));for(var i=this._groups,a=i.length,l=[],s=[],c=0;c<a;++c)for(var f=i[c],d=f.length,m,p=0;p<d;++p)if(m=f[p]){for(var y=e.call(m,m.__data__,p,f),x,_=Rr(m,r),S=0,k=y.length;S<k;++S)(x=y[S])&&sm(x,n,r,S,y,_);l.push(y),s.push(m)}return new Gi(l,s,n,r)}var aB=gc.prototype.constructor;function lB(){return new aB(this._groups,this._parents)}function oB(e,n){var r,i,a;return function(){var l=Uo(this,e),s=(this.style.removeProperty(e),Uo(this,e));return l===s?null:l===r&&s===i?a:a=n(r=l,i=s)}}function e4(e){return function(){this.style.removeProperty(e)}}function sB(e,n,r){var i,a=r+"",l;return function(){var s=Uo(this,e);return s===a?null:s===i?l:l=n(i=s,r)}}function uB(e,n,r){var i,a,l;return function(){var s=Uo(this,e),c=r(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),Uo(this,e))),s===f?null:s===i&&f===a?l:(a=f,l=n(i=s,c))}}function cB(e,n){var r,i,a,l="style."+n,s="end."+l,c;return function(){var f=si(this,e),d=f.on,m=f.value[l]==null?c||(c=e4(n)):void 0;(d!==r||a!==m)&&(i=(r=d).copy()).on(s,a=m),f.on=i}}function fB(e,n,r){var i=(e+="")=="transform"?c$:JA;return n==null?this.styleTween(e,oB(e,i)).on("end.style."+e,e4(e)):typeof n=="function"?this.styleTween(e,uB(e,i,hb(this,"style."+e,n))).each(cB(this._id,e)):this.styleTween(e,sB(e,i,n),r).on("end.style."+e,null)}function dB(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function hB(e,n,r){var i,a;function l(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&dB(e,s,r)),i}return l._value=n,l}function mB(e,n,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,hB(e,n,r??""))}function pB(e){return function(){this.textContent=e}}function gB(e){return function(){var n=e(this);this.textContent=n??""}}function vB(e){return this.tween("text",typeof e=="function"?gB(hb(this,"text",e)):pB(e==null?"":e+""))}function yB(e){return function(n){this.textContent=e.call(this,n)}}function xB(e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&yB(a)),n}return i._value=e,i}function bB(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,xB(e))}function wB(){for(var e=this._name,n=this._id,r=t4(),i=this._groups,a=i.length,l=0;l<a;++l)for(var s=i[l],c=s.length,f,d=0;d<c;++d)if(f=s[d]){var m=Rr(f,n);sm(f,e,r,d,s,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Gi(i,this._parents,e,r)}function _B(){var e,n,r=this,i=r._id,a=r.size();return new Promise(function(l,s){var c={value:s},f={value:function(){--a===0&&l()}};r.each(function(){var d=si(this,i),m=d.on;m!==e&&(n=(e=m).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(f)),d.on=n}),a===0&&l()})}var kB=0;function Gi(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function t4(){return++kB}var Ti=gc.prototype;Gi.prototype={constructor:Gi,select:rB,selectAll:iB,selectChild:Ti.selectChild,selectChildren:Ti.selectChildren,filter:X$,merge:Z$,selection:lB,transition:wB,call:Ti.call,nodes:Ti.nodes,node:Ti.node,size:Ti.size,empty:Ti.empty,each:Ti.each,on:eB,attr:D$,attrTween:$$,style:fB,styleTween:mB,text:vB,textTween:bB,remove:nB,tween:C$,delay:U$,duration:G$,ease:V$,easeVarying:W$,end:_B,[Symbol.iterator]:Ti[Symbol.iterator]};function SB(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var jB={time:null,delay:0,duration:250,ease:SB};function EB(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function CB(e){var n,r;e instanceof Gi?(n=e._id,e=e._name):(n=t4(),(r=jB).time=cb(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var s=i[l],c=s.length,f,d=0;d<c;++d)(f=s[d])&&sm(f,e,n,d,s,r||EB(f,n));return new Gi(i,this._parents,e,n)}gc.prototype.interrupt=S$;gc.prototype.transition=CB;const cd=e=>()=>e;function NB(e,{sourceEvent:n,target:r,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Ii(e,n,r){this.k=e,this.x=n,this.y=r}Ii.prototype={constructor:Ii,scale:function(e){return e===1?this:new Ii(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ii(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var mb=new Ii(1,0,0);Hr.prototype=Ii.prototype;function Hr(e){for(;!e.__zoom;)if(!(e=e.parentNode))return mb;return e.__zoom}function Cv(e){e.stopImmediatePropagation()}function fu(e){e.preventDefault(),e.stopImmediatePropagation()}function OB(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function AB(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function XS(){return this.__zoom||mb}function TB(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function MB(){return navigator.maxTouchPoints||"ontouchstart"in this}function PB(e,n,r){var i=e.invertX(n[0][0])-r[0][0],a=e.invertX(n[1][0])-r[1][0],l=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),s>l?(l+s)/2:Math.min(0,l)||Math.max(0,s))}function DB(){var e=OB,n=AB,r=PB,i=TB,a=MB,l=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,f=p$,d=vc("start","zoom","end"),m,p,y,x=500,_=150,S=0,k=10;function j($){$.property("__zoom",XS).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",D).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function($,G,B,Y){var ee=$.selection?$.selection():$;ee.property("__zoom",XS),$!==ee?T($,G,B,Y):ee.interrupt().each(function(){A(this,arguments).event(Y).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},j.scaleBy=function($,G,B,Y){j.scaleTo($,function(){var ee=this.__zoom.k,H=typeof G=="function"?G.apply(this,arguments):G;return ee*H},B,Y)},j.scaleTo=function($,G,B,Y){j.transform($,function(){var ee=n.apply(this,arguments),H=this.__zoom,re=B==null?O(ee):typeof B=="function"?B.apply(this,arguments):B,F=H.invert(re),X=typeof G=="function"?G.apply(this,arguments):G;return r(N(C(H,X),re,F),ee,s)},B,Y)},j.translateBy=function($,G,B,Y){j.transform($,function(){return r(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof B=="function"?B.apply(this,arguments):B),n.apply(this,arguments),s)},null,Y)},j.translateTo=function($,G,B,Y,ee){j.transform($,function(){var H=n.apply(this,arguments),re=this.__zoom,F=Y==null?O(H):typeof Y=="function"?Y.apply(this,arguments):Y;return r(mb.translate(F[0],F[1]).scale(re.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof B=="function"?-B.apply(this,arguments):-B),H,s)},Y,ee)};function C($,G){return G=Math.max(l[0],Math.min(l[1],G)),G===$.k?$:new Ii(G,$.x,$.y)}function N($,G,B){var Y=G[0]-B[0]*$.k,ee=G[1]-B[1]*$.k;return Y===$.x&&ee===$.y?$:new Ii($.k,Y,ee)}function O($){return[(+$[0][0]+ +$[1][0])/2,(+$[0][1]+ +$[1][1])/2]}function T($,G,B,Y){$.on("start.zoom",function(){A(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(Y).end()}).tween("zoom",function(){var ee=this,H=arguments,re=A(ee,H).event(Y),F=n.apply(ee,H),X=B==null?O(F):typeof B=="function"?B.apply(ee,H):B,ae=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),se=ee.__zoom,ve=typeof G=="function"?G.apply(ee,H):G,we=f(se.invert(X).concat(ae/se.k),ve.invert(X).concat(ae/ve.k));return function(ce){if(ce===1)ce=ve;else{var Se=we(ce),me=ae/Se[2];ce=new Ii(me,X[0]-Se[0]*me,X[1]-Se[1]*me)}re.zoom(null,ce)}})}function A($,G,B){return!B&&$.__zooming||new P($,G)}function P($,G){this.that=$,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply($,G),this.taps=0}P.prototype={event:function($){return $&&(this.sourceEvent=$),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function($,G){return this.mouse&&$!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&$!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&$!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function($){var G=pr(this.that).datum();d.call($,this.that,new NB($,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:d}),G)}};function R($,...G){if(!e.apply(this,arguments))return;var B=A(this,G).event($),Y=this.__zoom,ee=Math.max(l[0],Math.min(l[1],Y.k*Math.pow(2,i.apply(this,arguments)))),H=Gr($);if(B.wheel)(B.mouse[0][0]!==H[0]||B.mouse[0][1]!==H[1])&&(B.mouse[1]=Y.invert(B.mouse[0]=H)),clearTimeout(B.wheel);else{if(Y.k===ee)return;B.mouse=[H,Y.invert(H)],Rd(this),B.start()}fu($),B.wheel=setTimeout(re,_),B.zoom("mouse",r(N(C(Y,ee),B.mouse[0],B.mouse[1]),B.extent,s));function re(){B.wheel=null,B.end()}}function z($,...G){if(y||!e.apply(this,arguments))return;var B=$.currentTarget,Y=A(this,G,!0).event($),ee=pr($.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",ae,!0),H=Gr($,B),re=$.clientX,F=$.clientY;UA($.view),Cv($),Y.mouse=[H,this.__zoom.invert(H)],Rd(this),Y.start();function X(se){if(fu(se),!Y.moved){var ve=se.clientX-re,we=se.clientY-F;Y.moved=ve*ve+we*we>S}Y.event(se).zoom("mouse",r(N(Y.that.__zoom,Y.mouse[0]=Gr(se,B),Y.mouse[1]),Y.extent,s))}function ae(se){ee.on("mousemove.zoom mouseup.zoom",null),qA(se.view,Y.moved),fu(se),Y.event(se).end()}}function D($,...G){if(e.apply(this,arguments)){var B=this.__zoom,Y=Gr($.changedTouches?$.changedTouches[0]:$,this),ee=B.invert(Y),H=B.k*($.shiftKey?.5:2),re=r(N(C(B,H),Y,ee),n.apply(this,G),s);fu($),c>0?pr(this).transition().duration(c).call(T,re,Y,$):pr(this).call(j.transform,re,Y,$)}}function U($,...G){if(e.apply(this,arguments)){var B=$.touches,Y=B.length,ee=A(this,G,$.changedTouches.length===Y).event($),H,re,F,X;for(Cv($),re=0;re<Y;++re)F=B[re],X=Gr(F,this),X=[X,this.__zoom.invert(X),F.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==X[2]&&(ee.touch1=X,ee.taps=0):(ee.touch0=X,H=!0,ee.taps=1+!!m);m&&(m=clearTimeout(m)),H&&(ee.taps<2&&(p=X[0],m=setTimeout(function(){m=null},x)),Rd(this),ee.start())}}function q($,...G){if(this.__zooming){var B=A(this,G).event($),Y=$.changedTouches,ee=Y.length,H,re,F,X;for(fu($),H=0;H<ee;++H)re=Y[H],F=Gr(re,this),B.touch0&&B.touch0[2]===re.identifier?B.touch0[0]=F:B.touch1&&B.touch1[2]===re.identifier&&(B.touch1[0]=F);if(re=B.that.__zoom,B.touch1){var ae=B.touch0[0],se=B.touch0[1],ve=B.touch1[0],we=B.touch1[1],ce=(ce=ve[0]-ae[0])*ce+(ce=ve[1]-ae[1])*ce,Se=(Se=we[0]-se[0])*Se+(Se=we[1]-se[1])*Se;re=C(re,Math.sqrt(ce/Se)),F=[(ae[0]+ve[0])/2,(ae[1]+ve[1])/2],X=[(se[0]+we[0])/2,(se[1]+we[1])/2]}else if(B.touch0)F=B.touch0[0],X=B.touch0[1];else return;B.zoom("touch",r(N(re,F,X),B.extent,s))}}function L($,...G){if(this.__zooming){var B=A(this,G).event($),Y=$.changedTouches,ee=Y.length,H,re;for(Cv($),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),H=0;H<ee;++H)re=Y[H],B.touch0&&B.touch0[2]===re.identifier?delete B.touch0:B.touch1&&B.touch1[2]===re.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(re=Gr(re,this),Math.hypot(p[0]-re[0],p[1]-re[1])<k)){var F=pr(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return j.wheelDelta=function($){return arguments.length?(i=typeof $=="function"?$:cd(+$),j):i},j.filter=function($){return arguments.length?(e=typeof $=="function"?$:cd(!!$),j):e},j.touchable=function($){return arguments.length?(a=typeof $=="function"?$:cd(!!$),j):a},j.extent=function($){return arguments.length?(n=typeof $=="function"?$:cd([[+$[0][0],+$[0][1]],[+$[1][0],+$[1][1]]]),j):n},j.scaleExtent=function($){return arguments.length?(l[0]=+$[0],l[1]=+$[1],j):[l[0],l[1]]},j.translateExtent=function($){return arguments.length?(s[0][0]=+$[0][0],s[1][0]=+$[1][0],s[0][1]=+$[0][1],s[1][1]=+$[1][1],j):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},j.constrain=function($){return arguments.length?(r=$,j):r},j.duration=function($){return arguments.length?(c=+$,j):c},j.interpolate=function($){return arguments.length?(f=$,j):f},j.on=function(){var $=d.on.apply(d,arguments);return $===d?j:$},j.clickDistance=function($){return arguments.length?(S=($=+$)*$,j):Math.sqrt(S)},j.tapDistance=function($){return arguments.length?(k=+$,j):k},j}function za(e,n){return e==null||n==null?NaN:e<n?-1:e>n?1:e>=n?0:NaN}function RB(e,n){return e==null||n==null?NaN:n<e?-1:n>e?1:n>=e?0:NaN}function pb(e){let n,r,i;e.length!==2?(n=za,r=(c,f)=>za(e(c),f),i=(c,f)=>e(c)-f):(n=e===za||e===RB?e:LB,r=e,i=e);function a(c,f,d=0,m=c.length){if(d<m){if(n(f,f)!==0)return m;do{const p=d+m>>>1;r(c[p],f)<0?d=p+1:m=p}while(d<m)}return d}function l(c,f,d=0,m=c.length){if(d<m){if(n(f,f)!==0)return m;do{const p=d+m>>>1;r(c[p],f)<=0?d=p+1:m=p}while(d<m)}return d}function s(c,f,d=0,m=c.length){const p=a(c,f,d,m-1);return p>d&&i(c[p-1],f)>-i(c[p],f)?p-1:p}return{left:a,center:s,right:l}}function LB(){return 0}function n4(e){return e===null?NaN:+e}function*zB(e,n){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const IB=pb(za),xc=IB.right;pb(n4).center;class ZS extends Map{constructor(n,r=FB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),n!=null)for(const[i,a]of n)this.set(i,a)}get(n){return super.get(QS(this,n))}has(n){return super.has(QS(this,n))}set(n,r){return super.set($B(this,n),r)}delete(n){return super.delete(BB(this,n))}}function QS({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):r}function $B({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function BB({_intern:e,_key:n},r){const i=n(r);return e.has(i)&&(r=e.get(i),e.delete(i)),r}function FB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function UB(e=za){if(e===za)return r4;if(typeof e!="function")throw new TypeError("compare is not a function");return(n,r)=>{const i=e(n,r);return i||i===0?i:(e(r,r)===0)-(e(n,n)===0)}}function r4(e,n){return(e==null||!(e>=e))-(n==null||!(n>=n))||(e<n?-1:e>n?1:0)}const qB=Math.sqrt(50),HB=Math.sqrt(10),GB=Math.sqrt(2);function Qd(e,n,r){const i=(n-e)/Math.max(0,r),a=Math.floor(Math.log10(i)),l=i/Math.pow(10,a),s=l>=qB?10:l>=HB?5:l>=GB?2:1;let c,f,d;return a<0?(d=Math.pow(10,-a)/s,c=Math.round(e*d),f=Math.round(n*d),c/d<e&&++c,f/d>n&&--f,d=-d):(d=Math.pow(10,a)*s,c=Math.round(e/d),f=Math.round(n/d),c*d<e&&++c,f*d>n&&--f),f<c&&.5<=r&&r<2?Qd(e,n,r*2):[c,f,d]}function By(e,n,r){if(n=+n,e=+e,r=+r,!(r>0))return[];if(e===n)return[e];const i=n<e,[a,l,s]=i?Qd(n,e,r):Qd(e,n,r);if(!(l>=a))return[];const c=l-a+1,f=new Array(c);if(i)if(s<0)for(let d=0;d<c;++d)f[d]=(l-d)/-s;else for(let d=0;d<c;++d)f[d]=(l-d)*s;else if(s<0)for(let d=0;d<c;++d)f[d]=(a+d)/-s;else for(let d=0;d<c;++d)f[d]=(a+d)*s;return f}function Fy(e,n,r){return n=+n,e=+e,r=+r,Qd(e,n,r)[2]}function Uy(e,n,r){n=+n,e=+e,r=+r;const i=n<e,a=i?Fy(n,e,r):Fy(e,n,r);return(i?-1:1)*(a<0?1/-a:a)}function Jd(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r<i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let a of e)(a=n(a,++i,e))!=null&&(r<a||r===void 0&&a>=a)&&(r=a)}return r}function eh(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let a of e)(a=n(a,++i,e))!=null&&(r>a||r===void 0&&a>=a)&&(r=a)}return r}function i4(e,n,r=0,i=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),i=Math.floor(Math.min(e.length-1,i)),!(r<=n&&n<=i))return e;for(a=a===void 0?r4:UB(a);i>r;){if(i-r>600){const f=i-r+1,d=n-r+1,m=Math.log(f),p=.5*Math.exp(2*m/3),y=.5*Math.sqrt(m*p*(f-p)/f)*(d-f/2<0?-1:1),x=Math.max(r,Math.floor(n-d*p/f+y)),_=Math.min(i,Math.floor(n+(f-d)*p/f+y));i4(e,n,x,_,a)}const l=e[n];let s=r,c=i;for(du(e,r,n),a(e[i],l)>0&&du(e,r,i);s<c;){for(du(e,s,c),++s,--c;a(e[s],l)<0;)++s;for(;a(e[c],l)>0;)--c}a(e[r],l)===0?du(e,r,c):(++c,du(e,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}return e}function du(e,n,r){const i=e[n];e[n]=e[r],e[r]=i}function KB(e,n,r){if(e=Float64Array.from(zB(e)),!(!(i=e.length)||isNaN(n=+n))){if(n<=0||i<2)return eh(e);if(n>=1)return Jd(e);var i,a=(i-1)*n,l=Math.floor(a),s=Jd(i4(e,l).subarray(0,l+1)),c=eh(e.subarray(l+1));return s+(c-s)*(a-l)}}function VB(e,n,r=n4){if(!(!(i=e.length)||isNaN(n=+n))){if(n<=0||i<2)return+r(e[0],0,e);if(n>=1)return+r(e[i-1],i-1,e);var i,a=(i-1)*n,l=Math.floor(a),s=+r(e[l],l,e),c=+r(e[l+1],l+1,e);return s+(c-s)*(a-l)}}function YB(e,n,r){e=+e,n=+n,r=(a=arguments.length)<2?(n=e,e=0,1):a<3?1:+r;for(var i=-1,a=Math.max(0,Math.ceil((n-e)/r))|0,l=new Array(a);++i<a;)l[i]=e+i*r;return l}function WB(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var XB=typeof global=="object"&&global&&global.Object===Object&&global,ZB=typeof self=="object"&&self&&self.Object===Object&&self,a4=XB||ZB||Function("return this")(),th=a4.Symbol,l4=Object.prototype,QB=l4.hasOwnProperty,JB=l4.toString,hu=th?th.toStringTag:void 0;function eF(e){var n=QB.call(e,hu),r=e[hu];try{e[hu]=void 0;var i=!0}catch{}var a=JB.call(e);return i&&(n?e[hu]=r:delete e[hu]),a}var tF=Object.prototype,nF=tF.toString;function rF(e){return nF.call(e)}var iF="[object Null]",aF="[object Undefined]",JS=th?th.toStringTag:void 0;function lF(e){return e==null?e===void 0?aF:iF:JS&&JS in Object(e)?eF(e):rF(e)}function oF(e){return e!=null&&typeof e=="object"}var sF="[object Symbol]";function uF(e){return typeof e=="symbol"||oF(e)&&lF(e)==sF}var cF=/\s/;function fF(e){for(var n=e.length;n--&&cF.test(e.charAt(n)););return n}var dF=/^\s+/;function hF(e){return e&&e.slice(0,fF(e)+1).replace(dF,"")}function nh(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var ej=NaN,mF=/^[-+]0x[0-9a-f]+$/i,pF=/^0b[01]+$/i,gF=/^0o[0-7]+$/i,vF=parseInt;function tj(e){if(typeof e=="number")return e;if(uF(e))return ej;if(nh(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=nh(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=hF(e);var r=pF.test(e);return r||gF.test(e)?vF(e.slice(2),r?2:8):mF.test(e)?ej:+e}var Nv=function(){return a4.Date.now()},yF="Expected a function",xF=Math.max,bF=Math.min;function o4(e,n,r){var i,a,l,s,c,f,d=0,m=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError(yF);n=tj(n)||0,nh(r)&&(m=!!r.leading,p="maxWait"in r,l=p?xF(tj(r.maxWait)||0,n):l,y="trailing"in r?!!r.trailing:y);function x(A){var P=i,R=a;return i=a=void 0,d=A,s=e.apply(R,P),s}function _(A){return d=A,c=setTimeout(j,n),m?x(A):s}function S(A){var P=A-f,R=A-d,z=n-P;return p?bF(z,l-R):z}function k(A){var P=A-f,R=A-d;return f===void 0||P>=n||P<0||p&&R>=l}function j(){var A=Nv();if(k(A))return C(A);c=setTimeout(j,S(A))}function C(A){return c=void 0,y&&i?x(A):(i=a=void 0,s)}function N(){c!==void 0&&clearTimeout(c),d=0,i=f=a=c=void 0}function O(){return c===void 0?s:C(Nv())}function T(){var A=Nv(),P=k(A);if(i=arguments,a=this,f=A,P){if(c===void 0)return _(f);if(p)return clearTimeout(c),c=setTimeout(j,n),x(f)}return c===void 0&&(c=setTimeout(j,n)),s}return T.cancel=N,T.flush=O,T}var wF="Expected a function";function _F(e,n,r){var i=!0,a=!0;if(typeof e!="function")throw new TypeError(wF);return nh(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),o4(e,n,{leading:i,maxWait:n,trailing:a})}var kl=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-kl.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?kl.Bounce.In(e*2)*.5:kl.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),Mu=function(){return performance.now()},s4=(function(){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,n)}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var a=0,l=r;a<l.length;a++){var s=l[a];(n=s._group)===null||n===void 0||n.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var l=a[i];l._group=void 0,delete this._tweens[l.getId()],delete this._tweensAddedDuringUpdate[l.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(n){return!n.isPlaying()})},e.prototype.update=function(n,r){n===void 0&&(n=Mu()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var l=this._tweens[i[a]],s=!r;l&&l.update(n,s)===!1&&!r&&this.remove(l)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),qy={Linear:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),l=qy.Utils.Linear;return n<0?l(e[0],e[1],i):n>1?l(e[r],e[r-1],r-i):l(e[a],e[a+1>r?r:a+1],i-a)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},u4=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Hy=new s4,nj=(function(){function e(n,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=kl.Linear.None,this._interpolationFunction=qy.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=u4.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=n,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=Hy,Hy.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=Mu()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var a={};for(var l in this._valuesEnd)a[l]=this._valuesEnd[l];this._valuesEnd=a}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,a,l){for(var s in i){var c=n[s],f=Array.isArray(c),d=f?"array":typeof c,m=!f&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(m){var p=i[s];if(p.length===0)continue;for(var y=[c],x=0,_=p.length;x<_;x+=1){var S=this._handleRelativeValue(c,p[x]);if(isNaN(S)){m=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(S)}m&&(i[s]=y)}if((d==="object"||f)&&c&&!m){r[s]=f?[]:{};var k=c;for(var j in k)r[s][j]=k[j];a[s]=f?[]:{};var p=i[s];if(!this._isDynamic){var C={};for(var j in p)C[j]=p[j];i[s]=p=C}this._setupProperties(k,r[s],p,a[s],l)}else(typeof r[s]>"u"||l)&&(r[s]=c),f||(r[s]*=1),m?a[s]=i[s].slice().reverse():a[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(n){return n===void 0&&(n=Mu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this)},e.prototype.resume=function(n){return n===void 0&&(n=Mu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n?(n.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var n;return(n=this._group)===null||n===void 0||n.remove(this),this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=kl.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=qy.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,a;if(n===void 0&&(n=Mu()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var l;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=n-this._startTime,c=this._duration+((a=this._repeatDelayTime)!==null&&a!==void 0?a:this._delayTime),f=this._duration+this._repeat*c,d=function(){if(i._duration===0||s>f)return 1;var S=Math.trunc(s/c),k=s-S*c,j=Math.min(k/i._duration,1);return j===0&&s===i._duration?1:j},m=d(),p=this._easingFunction(m);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,p),this._onUpdateCallback&&this._onUpdateCallback(this._object,m),this._duration===0||s>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((s-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(l in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[l]=="string"&&(this._valuesStartRepeat[l]=this._valuesStartRepeat[l]+parseFloat(this._valuesEnd[l])),this._yoyo&&this._swapEndStartRepeatValues(l),this._valuesStart[l]=this._valuesStartRepeat[l];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var x=0,_=this._chainedTweens.length;x<_;x++)this._chainedTweens[x].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,a){for(var l in i)if(r[l]!==void 0){var s=r[l]||0,c=i[l],f=Array.isArray(n[l]),d=Array.isArray(c),m=!f&&d;m?n[l]=this._interpolationFunction(c,a):typeof c=="object"&&c?this._updateProperties(n[l],s,c,a):(c=this._handleRelativeValue(s,c),typeof c=="number"&&(n[l]=s+(c-s)*a))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e.autoStartOnUpdate=!1,e})();u4.nextId;var ni=Hy;ni.getAll.bind(ni);ni.removeAll.bind(ni);ni.add.bind(ni);ni.remove.bind(ni);ni.update.bind(ni);function rj(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function kF(e){if(Array.isArray(e))return e}function SF(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function jF(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function EF(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,a,l,s,c=[],f=!0,d=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(f=(i=l.call(r)).done)&&(c.push(i.value),c.length!==n);f=!0);}catch(m){d=!0,a=m}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw a}}return c}}function CF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
68
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NF(e,n){return kF(e)||EF(e,n)||OF(e,n)||CF()}function OF(e,n){if(e){if(typeof e=="string")return rj(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rj(e,n):void 0}}var AF=jF(function e(n,r){var i=r.default,a=i===void 0?null:i,l=r.triggerUpdate,s=l===void 0?!0:l,c=r.onChange,f=c===void 0?function(d,m){}:c;SF(this,e),this.name=n,this.defaultVal=a,this.triggerUpdate=s,this.onChange=f});function gb(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,a=i===void 0?{}:i,l=e.methods,s=l===void 0?{}:l,c=e.aliases,f=c===void 0?{}:c,d=e.init,m=d===void 0?function(){}:d,p=e.update,y=p===void 0?function(){}:p,x=Object.keys(a).map(function(_){return new AF(_,a[_])});return function _(){for(var S=arguments.length,k=new Array(S),j=0;j<S;j++)k[j]=arguments[j];var C=!!(this instanceof _&&this.constructor),N=C?k.shift():void 0,O=k[0],T=O===void 0?{}:O,A=Object.assign({},r instanceof Function?r(T):r,{initialised:!1}),P={};function R(U){return z(U,T),D(),R}var z=function(q,L){m.call(R,q,A,L),A.initialised=!0},D=o4(function(){A.initialised&&(y.call(R,A,P),P={})},1);return x.forEach(function(U){R[U.name]=q(U);function q(L){var $=L.name,G=L.triggerUpdate,B=G===void 0?!1:G,Y=L.onChange,ee=Y===void 0?function(F,X){}:Y,H=L.defaultVal,re=H===void 0?null:H;return function(F){var X=A[$];if(!arguments.length)return X;var ae=F===void 0?re:F;return A[$]=ae,ee.call(R,ae,A,X),!P.hasOwnProperty($)&&(P[$]=X),B&&D(),R}}}),Object.keys(s).forEach(function(U){R[U]=function(){for(var q,L=arguments.length,$=new Array(L),G=0;G<L;G++)$[G]=arguments[G];return(q=s[U]).call.apply(q,[R,A].concat($))}}),Object.entries(f).forEach(function(U){var q=NF(U,2),L=q[0],$=q[1];return R[L]=R[$]}),R.resetProps=function(){return x.forEach(function(U){R[U.name](U.defaultVal)}),R},R.resetProps(),A._rerender=D,C&&N&&R(N),R}}var et=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function rh(e){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rh(e)}var TF=/^\s+/,MF=/\s+$/;function Oe(e,n){if(e=e||"",n=n||{},e instanceof Oe)return e;if(!(this instanceof Oe))return new Oe(e,n);var r=PF(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}Oe.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,i,a,l,s,c;return r=n.r/255,i=n.g/255,a=n.b/255,r<=.03928?l=r/12.92:l=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),a<=.03928?c=a/12.92:c=Math.pow((a+.055)/1.055,2.4),.2126*l+.7152*s+.0722*c},setAlpha:function(n){return this._a=c4(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=aj(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=aj(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+a+"%)":"hsva("+r+", "+i+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=ij(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=ij(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+a+"%)":"hsla("+r+", "+i+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return lj(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return zF(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(yt(this._r,255)*100)+"%",g:Math.round(yt(this._g,255)*100)+"%",b:Math.round(yt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(yt(this._r,255)*100)+"%, "+Math.round(yt(this._g,255)*100)+"%, "+Math.round(yt(this._b,255)*100)+"%)":"rgba("+Math.round(yt(this._r,255)*100)+"%, "+Math.round(yt(this._g,255)*100)+"%, "+Math.round(yt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:WF[lj(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+oj(this._r,this._g,this._b,this._a),i=r,a=this._gradientType?"GradientType = 1, ":"";if(n){var l=Oe(n);i="#"+oj(l._r,l._g,l._b,l._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+r+",endColorstr="+i+")"},toString:function(n){var r=!!n;n=n||this._format;var i=!1,a=this._a<1&&this._a>=0,l=!r&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return l?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return Oe(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(FF,arguments)},brighten:function(){return this._applyModification(UF,arguments)},darken:function(){return this._applyModification(qF,arguments)},desaturate:function(){return this._applyModification(IF,arguments)},saturate:function(){return this._applyModification($F,arguments)},greyscale:function(){return this._applyModification(BF,arguments)},spin:function(){return this._applyModification(HF,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(VF,arguments)},complement:function(){return this._applyCombination(GF,arguments)},monochromatic:function(){return this._applyCombination(YF,arguments)},splitcomplement:function(){return this._applyCombination(KF,arguments)},triad:function(){return this._applyCombination(sj,[3])},tetrad:function(){return this._applyCombination(sj,[4])}};Oe.fromRatio=function(e,n){if(rh(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=Pu(e[i]));e=r}return Oe(e,n)};function PF(e){var n={r:0,g:0,b:0},r=1,i=null,a=null,l=null,s=!1,c=!1;return typeof e=="string"&&(e=JF(e)),rh(e)=="object"&&(Mi(e.r)&&Mi(e.g)&&Mi(e.b)?(n=DF(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Mi(e.h)&&Mi(e.s)&&Mi(e.v)?(i=Pu(e.s),a=Pu(e.v),n=LF(e.h,i,a),s=!0,c="hsv"):Mi(e.h)&&Mi(e.s)&&Mi(e.l)&&(i=Pu(e.s),l=Pu(e.l),n=RF(e.h,i,l),s=!0,c="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=c4(r),{ok:s,format:e.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function DF(e,n,r){return{r:yt(e,255)*255,g:yt(n,255)*255,b:yt(r,255)*255}}function ij(e,n,r){e=yt(e,255),n=yt(n,255),r=yt(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),l,s,c=(i+a)/2;if(i==a)l=s=0;else{var f=i-a;switch(s=c>.5?f/(2-i-a):f/(i+a),i){case e:l=(n-r)/f+(n<r?6:0);break;case n:l=(r-e)/f+2;break;case r:l=(e-n)/f+4;break}l/=6}return{h:l,s,l:c}}function RF(e,n,r){var i,a,l;e=yt(e,360),n=yt(n,100),r=yt(r,100);function s(d,m,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?d+(m-d)*6*p:p<1/2?m:p<2/3?d+(m-d)*(2/3-p)*6:d}if(n===0)i=a=l=r;else{var c=r<.5?r*(1+n):r+n-r*n,f=2*r-c;i=s(f,c,e+1/3),a=s(f,c,e),l=s(f,c,e-1/3)}return{r:i*255,g:a*255,b:l*255}}function aj(e,n,r){e=yt(e,255),n=yt(n,255),r=yt(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),l,s,c=i,f=i-a;if(s=i===0?0:f/i,i==a)l=0;else{switch(i){case e:l=(n-r)/f+(n<r?6:0);break;case n:l=(r-e)/f+2;break;case r:l=(e-n)/f+4;break}l/=6}return{h:l,s,v:c}}function LF(e,n,r){e=yt(e,360)*6,n=yt(n,100),r=yt(r,100);var i=Math.floor(e),a=e-i,l=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),f=i%6,d=[r,s,l,l,c,r][f],m=[c,r,r,s,l,l][f],p=[l,l,c,r,r,s][f];return{r:d*255,g:m*255,b:p*255}}function lj(e,n,r,i){var a=[Pr(Math.round(e).toString(16)),Pr(Math.round(n).toString(16)),Pr(Math.round(r).toString(16))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function zF(e,n,r,i,a){var l=[Pr(Math.round(e).toString(16)),Pr(Math.round(n).toString(16)),Pr(Math.round(r).toString(16)),Pr(f4(i))];return a&&l[0].charAt(0)==l[0].charAt(1)&&l[1].charAt(0)==l[1].charAt(1)&&l[2].charAt(0)==l[2].charAt(1)&&l[3].charAt(0)==l[3].charAt(1)?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}function oj(e,n,r,i){var a=[Pr(f4(i)),Pr(Math.round(e).toString(16)),Pr(Math.round(n).toString(16)),Pr(Math.round(r).toString(16))];return a.join("")}Oe.equals=function(e,n){return!e||!n?!1:Oe(e).toRgbString()==Oe(n).toRgbString()};Oe.random=function(){return Oe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function IF(e,n){n=n===0?0:n||10;var r=Oe(e).toHsl();return r.s-=n/100,r.s=um(r.s),Oe(r)}function $F(e,n){n=n===0?0:n||10;var r=Oe(e).toHsl();return r.s+=n/100,r.s=um(r.s),Oe(r)}function BF(e){return Oe(e).desaturate(100)}function FF(e,n){n=n===0?0:n||10;var r=Oe(e).toHsl();return r.l+=n/100,r.l=um(r.l),Oe(r)}function UF(e,n){n=n===0?0:n||10;var r=Oe(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),Oe(r)}function qF(e,n){n=n===0?0:n||10;var r=Oe(e).toHsl();return r.l-=n/100,r.l=um(r.l),Oe(r)}function HF(e,n){var r=Oe(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,Oe(r)}function GF(e){var n=Oe(e).toHsl();return n.h=(n.h+180)%360,Oe(n)}function sj(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Oe(e).toHsl(),i=[Oe(e)],a=360/n,l=1;l<n;l++)i.push(Oe({h:(r.h+l*a)%360,s:r.s,l:r.l}));return i}function KF(e){var n=Oe(e).toHsl(),r=n.h;return[Oe(e),Oe({h:(r+72)%360,s:n.s,l:n.l}),Oe({h:(r+216)%360,s:n.s,l:n.l})]}function VF(e,n,r){n=n||6,r=r||30;var i=Oe(e).toHsl(),a=360/r,l=[Oe(e)];for(i.h=(i.h-(a*n>>1)+720)%360;--n;)i.h=(i.h+a)%360,l.push(Oe(i));return l}function YF(e,n){n=n||6;for(var r=Oe(e).toHsv(),i=r.h,a=r.s,l=r.v,s=[],c=1/n;n--;)s.push(Oe({h:i,s:a,v:l})),l=(l+c)%1;return s}Oe.mix=function(e,n,r){r=r===0?0:r||50;var i=Oe(e).toRgb(),a=Oe(n).toRgb(),l=r/100,s={r:(a.r-i.r)*l+i.r,g:(a.g-i.g)*l+i.g,b:(a.b-i.b)*l+i.b,a:(a.a-i.a)*l+i.a};return Oe(s)};Oe.readability=function(e,n){var r=Oe(e),i=Oe(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};Oe.isReadable=function(e,n,r){var i=Oe.readability(e,n),a,l;switch(l=!1,a=eU(r),a.level+a.size){case"AAsmall":case"AAAlarge":l=i>=4.5;break;case"AAlarge":l=i>=3;break;case"AAAsmall":l=i>=7;break}return l};Oe.mostReadable=function(e,n,r){var i=null,a=0,l,s,c,f;r=r||{},s=r.includeFallbackColors,c=r.level,f=r.size;for(var d=0;d<n.length;d++)l=Oe.readability(e,n[d]),l>a&&(a=l,i=Oe(n[d]));return Oe.isReadable(e,i,{level:c,size:f})||!s?i:(r.includeFallbackColors=!1,Oe.mostReadable(e,["#fff","#000"],r))};var Gy=Oe.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},WF=Oe.hexNames=XF(Gy);function XF(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function c4(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function yt(e,n){ZF(e)&&(e="100%");var r=QF(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function um(e){return Math.min(1,Math.max(0,e))}function Hn(e){return parseInt(e,16)}function ZF(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function QF(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Pr(e){return e.length==1?"0"+e:""+e}function Pu(e){return e<=1&&(e=e*100+"%"),e}function f4(e){return Math.round(parseFloat(e)*255).toString(16)}function uj(e){return Hn(e)/255}var Nr=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",a="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Mi(e){return!!Nr.CSS_UNIT.exec(e)}function JF(e){e=e.replace(TF,"").replace(MF,"").toLowerCase();var n=!1;if(Gy[e])e=Gy[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Nr.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Nr.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Nr.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Nr.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Nr.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Nr.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Nr.hex8.exec(e))?{r:Hn(r[1]),g:Hn(r[2]),b:Hn(r[3]),a:uj(r[4]),format:n?"name":"hex8"}:(r=Nr.hex6.exec(e))?{r:Hn(r[1]),g:Hn(r[2]),b:Hn(r[3]),format:n?"name":"hex"}:(r=Nr.hex4.exec(e))?{r:Hn(r[1]+""+r[1]),g:Hn(r[2]+""+r[2]),b:Hn(r[3]+""+r[3]),a:uj(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=Nr.hex3.exec(e))?{r:Hn(r[1]+""+r[1]),g:Hn(r[2]+""+r[2]),b:Hn(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function eU(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function Ky(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function tU(e){if(Array.isArray(e))return Ky(e)}function d4(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function nU(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rU(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function ur(e,n){return e.get(d4(e,n))}function cj(e,n,r){nU(e,n),n.set(e,r)}function fj(e,n,r){return e.set(d4(e,n),r),r}function iU(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,cU(i.key),i)}}function aU(e,n,r){return n&&iU(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
69
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sU(e){return tU(e)||lU(e)||fU(e)||oU()}function uU(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function cU(e){var n=uU(e,"string");return typeof n=="symbol"?n:n+""}function fU(e,n){if(e){if(typeof e=="string")return Ky(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ky(e,n):void 0}}var dU=123,hU=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},h4=function(n,r,i){return(n<<16)+(r<<8)+i},mU=function(n){var r=Oe(n).toRgb(),i=r.r,a=r.g,l=r.b;return h4(i,a,l)},dj=function(n,r){return n*dU%Math.pow(2,r)},sl=new WeakMap,Pi=new WeakMap,pU=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;rU(this,e),cj(this,sl,void 0),cj(this,Pi,void 0),fj(Pi,this,n),this.reset()}return aU(e,[{key:"reset",value:function(){fj(sl,this,["__reserved for background__"])}},{key:"register",value:function(r){if(ur(sl,this).length>=Math.pow(2,24-ur(Pi,this)))return null;var i=ur(sl,this).length,a=dj(i,ur(Pi,this)),l=hU(i+(a<<24-ur(Pi,this)));return ur(sl,this).push(r),l}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?mU(r):h4.apply(void 0,sU(r));if(!i)return null;var a=i&Math.pow(2,24-ur(Pi,this))-1,l=i>>24-ur(Pi,this)&Math.pow(2,ur(Pi,this))-1;return dj(a,ur(Pi,this))!==l||a>=ur(sl,this).length?null:ur(sl,this)[a]}}])})(),bc,xt,m4,p4,Ma,hj,g4,v4,y4,vb,Vy,Yy,ih={},ah=[],gU=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,cm=Array.isArray;function Yr(e,n){for(var r in n)e[r]=n[r];return e}function yb(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vU(e,n,r){var i,a,l,s={};for(l in n)l=="key"?i=n[l]:l=="ref"?a=n[l]:s[l]=n[l];if(arguments.length>2&&(s.children=arguments.length>3?bc.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(l in e.defaultProps)s[l]===void 0&&(s[l]=e.defaultProps[l]);return $u(e,s,i,a,null)}function $u(e,n,r,i,a){var l={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++m4,__i:-1,__u:0};return a==null&&xt.vnode!=null&&xt.vnode(l),l}function fm(e){return e.children}function Ld(e,n){this.props=e,this.context=n}function Ho(e,n){if(n==null)return e.__?Ho(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ho(e):null}function yU(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],l=Yr({},n);l.__v=n.__v+1,xt.vnode&&xt.vnode(l),xb(e.__P,l,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??Ho(n),!!(32&n.__u),a),l.__v=n.__v,l.__.__k[l.__i]=l,_4(i,l,a),n.__e=n.__=null,l.__e!=r&&x4(l)}}function x4(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),x4(e)}function mj(e){(!e.__d&&(e.__d=!0)&&Ma.push(e)&&!lh.__r++||hj!=xt.debounceRendering)&&((hj=xt.debounceRendering)||g4)(lh)}function lh(){try{for(var e,n=1;Ma.length;)Ma.length>n&&Ma.sort(v4),e=Ma.shift(),n=Ma.length,yU(e)}finally{Ma.length=lh.__r=0}}function b4(e,n,r,i,a,l,s,c,f,d,m){var p,y,x,_,S,k,j,C=i&&i.__k||ah,N=n.length;for(f=xU(r,n,C,f,N),p=0;p<N;p++)(x=r.__k[p])!=null&&(y=x.__i!=-1&&C[x.__i]||ih,x.__i=p,k=xb(e,x,y,a,l,s,c,f,d,m),_=x.__e,x.ref&&y.ref!=x.ref&&(y.ref&&bb(y.ref,null,x),m.push(x.ref,x.__c||_,x)),S==null&&_!=null&&(S=_),(j=!!(4&x.__u))||y.__k===x.__k?f=w4(x,f,e,j):typeof x.type=="function"&&k!==void 0?f=k:_&&(f=_.nextSibling),x.__u&=-7);return r.__e=S,f}function xU(e,n,r,i,a){var l,s,c,f,d,m=r.length,p=m,y=0;for(e.__k=new Array(a),l=0;l<a;l++)(s=n[l])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[l]=$u(null,s,null,null,null):cm(s)?s=e.__k[l]=$u(fm,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[l]=$u(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[l]=s,f=l+y,s.__=e,s.__b=e.__b+1,c=null,(d=s.__i=bU(s,r,f,p))!=-1&&(p--,(c=r[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(a>m?y--:a<m&&y++),typeof s.type!="function"&&(s.__u|=4)):d!=f&&(d==f-1?y--:d==f+1?y++:(d>f?y--:y++,s.__u|=4))):e.__k[l]=null;if(p)for(l=0;l<m;l++)(c=r[l])!=null&&(2&c.__u)==0&&(c.__e==i&&(i=Ho(c)),S4(c,c));return i}function w4(e,n,r,i){var a,l;if(typeof e.type=="function"){for(a=e.__k,l=0;a&&l<a.length;l++)a[l]&&(a[l].__=e,n=w4(a[l],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=Ho(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function bU(e,n,r,i){var a,l,s,c=e.key,f=e.type,d=n[r],m=d!=null&&(2&d.__u)==0;if(d===null&&c==null||m&&c==d.key&&f==d.type)return r;if(i>(m?1:0)){for(a=r-1,l=r+1;a>=0||l<n.length;)if((d=n[s=a>=0?a--:l++])!=null&&(2&d.__u)==0&&c==d.key&&f==d.type)return s}return-1}function pj(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||gU.test(n)?r:r+"px"}function fd(e,n,r,i,a){var l,s;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)r&&n in r||pj(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||pj(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")l=n!=(n=n.replace(y4,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=r,r?i?r.u=i.u:(r.u=vb,e.addEventListener(n,l?Yy:Vy,l)):e.removeEventListener(n,l?Yy:Vy,l);else{if(a=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function gj(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=vb++;else if(n.t<r.u)return;return r(xt.event?xt.event(n):n)}}}function xb(e,n,r,i,a,l,s,c,f,d){var m,p,y,x,_,S,k,j,C,N,O,T,A,P,R,z=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(f=!!(32&r.__u),l=[c=n.__e=r.__e]),(m=xt.__b)&&m(n);e:if(typeof z=="function")try{if(j=n.props,C=z.prototype&&z.prototype.render,N=(m=z.contextType)&&i[m.__c],O=m?N?N.props.value:m.__:i,r.__c?k=(p=n.__c=r.__c).__=p.__E:(C?n.__c=p=new z(j,O):(n.__c=p=new Ld(j,O),p.constructor=z,p.render=_U),N&&N.sub(p),p.state||(p.state={}),p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),C&&p.__s==null&&(p.__s=p.state),C&&z.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Yr({},p.__s)),Yr(p.__s,z.getDerivedStateFromProps(j,p.__s))),x=p.props,_=p.state,p.__v=n,y)C&&z.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),C&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(C&&z.getDerivedStateFromProps==null&&j!==x&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(j,O),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(j,p.__s,O)===!1){n.__v!=r.__v&&(p.props=j,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(D){D&&(D.__=n)}),ah.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(j,p.__s,O),C&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(x,_,S)})}if(p.context=O,p.props=j,p.__P=e,p.__e=!1,T=xt.__r,A=0,C)p.state=p.__s,p.__d=!1,T&&T(n),m=p.render(p.props,p.state,p.context),ah.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,T&&T(n),m=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++A<25);p.state=p.__s,p.getChildContext!=null&&(i=Yr(Yr({},i),p.getChildContext())),C&&!y&&p.getSnapshotBeforeUpdate!=null&&(S=p.getSnapshotBeforeUpdate(x,_)),P=m!=null&&m.type===fm&&m.key==null?k4(m.props.children):m,c=b4(e,cm(P)?P:[P],n,r,i,a,l,s,c,f,d),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),k&&(p.__E=p.__=null)}catch(D){if(n.__v=null,f||l!=null)if(D.then){for(n.__u|=f?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;l[l.indexOf(c)]=null,n.__e=c}else{for(R=l.length;R--;)yb(l[R]);Wy(n)}else n.__e=r.__e,n.__k=r.__k,D.then||Wy(n);xt.__e(D,n,r)}else l==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=wU(r.__e,n,r,i,a,l,s,f,d);return(m=xt.diffed)&&m(n),128&n.__u?void 0:c}function Wy(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Wy))}function _4(e,n,r){for(var i=0;i<r.length;i++)bb(r[i],r[++i],r[++i]);xt.__c&&xt.__c(n,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(l){l.call(a)})}catch(l){xt.__e(l,a.__v)}})}function k4(e){return typeof e!="object"||e==null||e.__b>0?e:cm(e)?e.map(k4):Yr({},e)}function wU(e,n,r,i,a,l,s,c,f){var d,m,p,y,x,_,S,k=r.props||ih,j=n.props,C=n.type;if(C=="svg"?a="http://www.w3.org/2000/svg":C=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),l!=null){for(d=0;d<l.length;d++)if((x=l[d])&&"setAttribute"in x==!!C&&(C?x.localName==C:x.nodeType==3)){e=x,l[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(j);e=document.createElementNS(a,C,j.is&&j),c&&(xt.__m&&xt.__m(n,l),c=!1),l=null}if(C==null)k===j||c&&e.data==j||(e.data=j);else{if(l=l&&bc.call(e.childNodes),!c&&l!=null)for(k={},d=0;d<e.attributes.length;d++)k[(x=e.attributes[d]).name]=x.value;for(d in k)x=k[d],d=="dangerouslySetInnerHTML"?p=x:d=="children"||d in j||d=="value"&&"defaultValue"in j||d=="checked"&&"defaultChecked"in j||fd(e,d,null,x,a);for(d in j)x=j[d],d=="children"?y=x:d=="dangerouslySetInnerHTML"?m=x:d=="value"?_=x:d=="checked"?S=x:c&&typeof x!="function"||k[d]===x||fd(e,d,x,k[d],a);if(m)c||p&&(m.__html==p.__html||m.__html==e.innerHTML)||(e.innerHTML=m.__html),n.__k=[];else if(p&&(e.innerHTML=""),b4(n.type=="template"?e.content:e,cm(y)?y:[y],n,r,i,C=="foreignObject"?"http://www.w3.org/1999/xhtml":a,l,s,l?l[0]:r.__k&&Ho(r,0),c,f),l!=null)for(d=l.length;d--;)yb(l[d]);c||(d="value",C=="progress"&&_==null?e.removeAttribute("value"):_!=null&&(_!==e[d]||C=="progress"&&!_||C=="option"&&_!=k[d])&&fd(e,d,_,k[d],a),d="checked",S!=null&&S!=e[d]&&fd(e,d,S,k[d],a))}return e}function bb(e,n,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(a){xt.__e(a,r)}}function S4(e,n,r){var i,a;if(xt.unmount&&xt.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||bb(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(l){xt.__e(l,n)}i.base=i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&S4(i[a],n,r||typeof e.type!="function");r||yb(e.__e),e.__c=e.__=e.__e=void 0}function _U(e,n,r){return this.constructor(e,r)}function kU(e,n,r){var i,a,l,s;n==document&&(n=document.documentElement),xt.__&&xt.__(e,n),a=(i=!1)?null:n.__k,l=[],s=[],xb(n,e=n.__k=vU(fm,null,[e]),a||ih,ih,n.namespaceURI,a?null:n.firstChild?bc.call(n.childNodes):null,l,a?a.__e:n.firstChild,i,s),_4(l,e,s)}function j4(e,n,r){var i,a,l,s,c=Yr({},e.props);for(l in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)l=="key"?i=n[l]:l=="ref"?a=n[l]:c[l]=n[l]===void 0&&s!=null?s[l]:n[l];return arguments.length>2&&(c.children=arguments.length>3?bc.call(arguments,2):r),$u(e.type,c,i||e.key,a||e.ref,null)}bc=ah.slice,xt={__e:function(e,n,r,i){for(var a,l,s;n=n.__;)if((a=n.__c)&&!a.__)try{if((l=a.constructor)&&l.getDerivedStateFromError!=null&&(a.setState(l.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,i||{}),s=a.__d),s)return a.__E=a}catch(c){e=c}throw e}},m4=0,p4=function(e){return e!=null&&e.constructor===void 0},Ld.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Yr({},this.state),typeof e=="function"&&(e=e(Yr({},r),this.props)),e&&Yr(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),mj(this))},Ld.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),mj(this))},Ld.prototype.render=fm,Ma=[],g4=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,v4=function(e,n){return e.__v.__b-n.__v.__b},lh.__r=0,y4=/(PointerCapture)$|Capture$/i,vb=0,Vy=gj(!1),Yy=gj(!0);function vj(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function SU(e){if(Array.isArray(e))return e}function jU(e,n,r){return(n=TU(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function EU(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,a,l,s,c=[],f=!0,d=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(f=(i=l.call(r)).done)&&(c.push(i.value),c.length!==n);f=!0);}catch(m){d=!0,a=m}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw a}}return c}}function CU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yj(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function NU(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yj(Object(r),!0).forEach(function(i){jU(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yj(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function OU(e,n){return SU(e)||EU(e,n)||MU(e,n)||CU()}function AU(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function TU(e){var n=AU(e,"string");return typeof n=="symbol"?n:n+""}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},oh(e)}function MU(e,n){if(e){if(typeof e=="string")return vj(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vj(e,n):void 0}}var Xy=function(n){if(oh(n)!=="object")return n;var r=j4(n);if(r.props){var i;r.props=NU({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(Xy):Xy(r.props.children))}return r},PU=function(n){return p4(j4(n))},DU=function(n,r){delete r.__k,kU(Xy(n),r)};function RU(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",r==="top"&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}var LU=`.float-tooltip-kap {
71
+ position: absolute;
72
+ width: max-content; /* prevent shrinking near right edge */
73
+ max-width: max(50%, 150px);
74
+ padding: 3px 5px;
75
+ border-radius: 3px;
76
+ font: 12px sans-serif;
77
+ color: #eee;
78
+ background: rgba(0,0,0,0.6);
79
+ pointer-events: none;
80
+ }
81
+ `;RU(LU);var zU=gb({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.style,l=a===void 0?{}:a,s=!!n&&oh(n)==="object"&&!!n.node&&typeof n.node=="function",c=pr(s?n.node():n);c.style("position")==="static"&&c.style("position","relative"),r.tooltipEl=c.append("div").attr("class","float-tooltip-kap"),Object.entries(l).forEach(function(d){var m=OU(d,2),p=m[0],y=m[1];return r.tooltipEl.style(p,y)}),r.tooltipEl.style("left","-10000px").style("display","none");var f="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,c.on("mousemove.".concat(f),function(d){r.mouseInside=!0;var m=Gr(d),p=c.node(),y=p.offsetWidth,x=p.offsetHeight,_=[r.offsetX===null||r.offsetX===void 0?"-".concat(m[0]/y*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?x>130&&x-m[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",m[0]+"px").style("top",m[1]+"px").style("transform","translate(".concat(_.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),c.on("mouseover.".concat(f),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),c.on("mouseout.".concat(f),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):PU(n.content)?(n.tooltipEl.text(""),DU(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});function IU(e,n,r){var i,a=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function l(){var s,c=i.length,f,d=0,m=0,p=0;for(s=0;s<c;++s)f=i[s],d+=f.x||0,m+=f.y||0,p+=f.z||0;for(d=(d/c-e)*a,m=(m/c-n)*a,p=(p/c-r)*a,s=0;s<c;++s)f=i[s],d&&(f.x-=d),m&&(f.y-=m),p&&(f.z-=p)}return l.initialize=function(s){i=s},l.x=function(s){return arguments.length?(e=+s,l):e},l.y=function(s){return arguments.length?(n=+s,l):n},l.z=function(s){return arguments.length?(r=+s,l):r},l.strength=function(s){return arguments.length?(a=+s,l):a},l}function $U(e){const n=+this._x.call(null,e);return E4(this.cover(n),n,e)}function E4(e,n,r){if(isNaN(n))return e;var i,a=e._root,l={data:r},s=e._x0,c=e._x1,f,d,m,p,y;if(!a)return e._root=l,e;for(;a.length;)if((m=n>=(f=(s+c)/2))?s=f:c=f,i=a,!(a=a[p=+m]))return i[p]=l,e;if(d=+e._x.call(null,a.data),n===d)return l.next=a,i?i[p]=l:e._root=l,e;do i=i?i[p]=new Array(2):e._root=new Array(2),(m=n>=(f=(s+c)/2))?s=f:c=f;while((p=+m)==(y=+(d>=f)));return i[y]=a,i[p]=l,e}function BU(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let i=1/0,a=-1/0;for(let l=0,s;l<n;++l)isNaN(s=+this._x.call(null,e[l]))||(r[l]=s,s<i&&(i=s),s>a&&(a=s));if(i>a)return this;this.cover(i).cover(a);for(let l=0;l<n;++l)E4(this,r[l],e[l]);return this}function FU(e){if(isNaN(e=+e))return this;var n=this._x0,r=this._x1;if(isNaN(n))r=(n=Math.floor(e))+1;else{for(var i=r-n||1,a=this._root,l,s;n>e||e>=r;)switch(s=+(e<n),l=new Array(2),l[s]=a,a=l,i*=2,s){case 0:r=n+i;break;case 1:n=r-i;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._x1=r,this}function UU(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function qU(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function Fi(e,n,r){this.node=e,this.x0=n,this.x1=r}function HU(e,n){var r,i=this._x0,a,l,s=this._x1,c=[],f=this._root,d,m;for(f&&c.push(new Fi(f,i,s)),n==null?n=1/0:(i=e-n,s=e+n);d=c.pop();)if(!(!(f=d.node)||(a=d.x0)>s||(l=d.x1)<i))if(f.length){var p=(a+l)/2;c.push(new Fi(f[1],p,l),new Fi(f[0],a,p)),(m=+(e>=p))&&(d=c[c.length-1],c[c.length-1]=c[c.length-1-m],c[c.length-1-m]=d)}else{var y=Math.abs(e-+this._x.call(null,f.data));y<n&&(n=y,i=e-y,s=e+y,r=f.data)}return r}function GU(e){if(isNaN(f=+this._x.call(null,e)))return this;var n,r=this._root,i,a,l,s=this._x0,c=this._x1,f,d,m,p,y;if(!r)return this;if(r.length)for(;;){if((m=f>=(d=(s+c)/2))?s=d:c=d,n=r,!(r=r[p=+m]))return this;if(!r.length)break;n[p+1&1]&&(i=n,y=p)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,a?(l?a.next=l:delete a.next,this):n?(l?n[p]=l:delete n[p],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[y]=r:this._root=r),this):(this._root=l,this)}function KU(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function VU(){return this._root}function YU(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function WU(e){var n=[],r,i=this._root,a,l,s;for(i&&n.push(new Fi(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,l=r.x0,s=r.x1)&&i.length){var c=(l+s)/2;(a=i[1])&&n.push(new Fi(a,c,s)),(a=i[0])&&n.push(new Fi(a,l,c))}return this}function XU(e){var n=[],r=[],i;for(this._root&&n.push(new Fi(this._root,this._x0,this._x1));i=n.pop();){var a=i.node;if(a.length){var l,s=i.x0,c=i.x1,f=(s+c)/2;(l=a[0])&&n.push(new Fi(l,s,f)),(l=a[1])&&n.push(new Fi(l,f,c))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function ZU(e){return e[0]}function QU(e){return arguments.length?(this._x=e,this):this._x}function wb(e,n){var r=new _b(n??ZU,NaN,NaN);return e==null?r:r.addAll(e)}function _b(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function xj(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Pn=wb.prototype=_b.prototype;Pn.copy=function(){var e=new _b(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=xj(n),e;for(r=[{source:n,target:e._root=new Array(2)}];n=r.pop();)for(var a=0;a<2;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=new Array(2)}):n.target[a]=xj(i));return e};Pn.add=$U;Pn.addAll=BU;Pn.cover=FU;Pn.data=UU;Pn.extent=qU;Pn.find=HU;Pn.remove=GU;Pn.removeAll=KU;Pn.root=VU;Pn.size=YU;Pn.visit=WU;Pn.visitAfter=XU;Pn.x=QU;function JU(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return C4(this.cover(n,r),n,r,e)}function C4(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,l=e._root,s={data:i},c=e._x0,f=e._y0,d=e._x1,m=e._y1,p,y,x,_,S,k,j,C;if(!l)return e._root=s,e;for(;l.length;)if((S=n>=(p=(c+d)/2))?c=p:d=p,(k=r>=(y=(f+m)/2))?f=y:m=y,a=l,!(l=l[j=k<<1|S]))return a[j]=s,e;if(x=+e._x.call(null,l.data),_=+e._y.call(null,l.data),n===x&&r===_)return s.next=l,a?a[j]=s:e._root=s,e;do a=a?a[j]=new Array(4):e._root=new Array(4),(S=n>=(p=(c+d)/2))?c=p:d=p,(k=r>=(y=(f+m)/2))?f=y:m=y;while((j=k<<1|S)===(C=(_>=y)<<1|x>=p));return a[C]=l,a[j]=s,e}function eq(e){var n,r,i=e.length,a,l,s=new Array(i),c=new Array(i),f=1/0,d=1/0,m=-1/0,p=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(l=+this._y.call(null,n))||(s[r]=a,c[r]=l,a<f&&(f=a),a>m&&(m=a),l<d&&(d=l),l>p&&(p=l));if(f>m||d>p)return this;for(this.cover(f,d).cover(m,p),r=0;r<i;++r)C4(this,s[r],c[r],e[r]);return this}function tq(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,l=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,l=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,f,d;r>e||e>=a||i>n||n>=l;)switch(d=(n<i)<<1|e<r,f=new Array(4),f[d]=c,c=f,s*=2,d){case 0:a=r+s,l=i+s;break;case 1:r=a-s,l=i+s;break;case 2:a=r+s,i=l-s;break;case 3:r=a-s,i=l-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=l,this}function nq(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function rq(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function pn(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function iq(e,n,r){var i,a=this._x0,l=this._y0,s,c,f,d,m=this._x1,p=this._y1,y=[],x=this._root,_,S;for(x&&y.push(new pn(x,a,l,m,p)),r==null?r=1/0:(a=e-r,l=n-r,m=e+r,p=n+r,r*=r);_=y.pop();)if(!(!(x=_.node)||(s=_.x0)>m||(c=_.y0)>p||(f=_.x1)<a||(d=_.y1)<l))if(x.length){var k=(s+f)/2,j=(c+d)/2;y.push(new pn(x[3],k,j,f,d),new pn(x[2],s,j,k,d),new pn(x[1],k,c,f,j),new pn(x[0],s,c,k,j)),(S=(n>=j)<<1|e>=k)&&(_=y[y.length-1],y[y.length-1]=y[y.length-1-S],y[y.length-1-S]=_)}else{var C=e-+this._x.call(null,x.data),N=n-+this._y.call(null,x.data),O=C*C+N*N;if(O<r){var T=Math.sqrt(r=O);a=e-T,l=n-T,m=e+T,p=n+T,i=x.data}}return i}function aq(e){if(isNaN(m=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e)))return this;var n,r=this._root,i,a,l,s=this._x0,c=this._y0,f=this._x1,d=this._y1,m,p,y,x,_,S,k,j;if(!r)return this;if(r.length)for(;;){if((_=m>=(y=(s+f)/2))?s=y:f=y,(S=p>=(x=(c+d)/2))?c=x:d=x,n=r,!(r=r[k=S<<1|_]))return this;if(!r.length)break;(n[k+1&3]||n[k+2&3]||n[k+3&3])&&(i=n,j=k)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,a?(l?a.next=l:delete a.next,this):n?(l?n[k]=l:delete n[k],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[j]=r:this._root=r),this):(this._root=l,this)}function lq(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function oq(){return this._root}function sq(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function uq(e){var n=[],r,i=this._root,a,l,s,c,f;for(i&&n.push(new pn(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,l=r.x0,s=r.y0,c=r.x1,f=r.y1)&&i.length){var d=(l+c)/2,m=(s+f)/2;(a=i[3])&&n.push(new pn(a,d,m,c,f)),(a=i[2])&&n.push(new pn(a,l,m,d,f)),(a=i[1])&&n.push(new pn(a,d,s,c,m)),(a=i[0])&&n.push(new pn(a,l,s,d,m))}return this}function cq(e){var n=[],r=[],i;for(this._root&&n.push(new pn(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var l,s=i.x0,c=i.y0,f=i.x1,d=i.y1,m=(s+f)/2,p=(c+d)/2;(l=a[0])&&n.push(new pn(l,s,c,m,p)),(l=a[1])&&n.push(new pn(l,m,c,f,p)),(l=a[2])&&n.push(new pn(l,s,p,m,d)),(l=a[3])&&n.push(new pn(l,m,p,f,d))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function fq(e){return e[0]}function dq(e){return arguments.length?(this._x=e,this):this._x}function hq(e){return e[1]}function mq(e){return arguments.length?(this._y=e,this):this._y}function kb(e,n,r){var i=new Sb(n??fq,r??hq,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Sb(e,n,r,i,a,l){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=l,this._root=void 0}function bj(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var xn=kb.prototype=Sb.prototype;xn.copy=function(){var e=new Sb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=bj(n),e;for(r=[{source:n,target:e._root=new Array(4)}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=new Array(4)}):n.target[a]=bj(i));return e};xn.add=JU;xn.addAll=eq;xn.cover=tq;xn.data=nq;xn.extent=rq;xn.find=iq;xn.remove=aq;xn.removeAll=lq;xn.root=oq;xn.size=sq;xn.visit=uq;xn.visitAfter=cq;xn.x=dq;xn.y=mq;function pq(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return N4(this.cover(n,r,i),n,r,i,e)}function N4(e,n,r,i,a){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var l,s=e._root,c={data:a},f=e._x0,d=e._y0,m=e._z0,p=e._x1,y=e._y1,x=e._z1,_,S,k,j,C,N,O,T,A,P,R;if(!s)return e._root=c,e;for(;s.length;)if((O=n>=(_=(f+p)/2))?f=_:p=_,(T=r>=(S=(d+y)/2))?d=S:y=S,(A=i>=(k=(m+x)/2))?m=k:x=k,l=s,!(s=s[P=A<<2|T<<1|O]))return l[P]=c,e;if(j=+e._x.call(null,s.data),C=+e._y.call(null,s.data),N=+e._z.call(null,s.data),n===j&&r===C&&i===N)return c.next=s,l?l[P]=c:e._root=c,e;do l=l?l[P]=new Array(8):e._root=new Array(8),(O=n>=(_=(f+p)/2))?f=_:p=_,(T=r>=(S=(d+y)/2))?d=S:y=S,(A=i>=(k=(m+x)/2))?m=k:x=k;while((P=A<<2|T<<1|O)===(R=(N>=k)<<2|(C>=S)<<1|j>=_));return l[R]=s,l[P]=c,e}function gq(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),i=new Float64Array(n),a=new Float64Array(n);let l=1/0,s=1/0,c=1/0,f=-1/0,d=-1/0,m=-1/0;for(let p=0,y,x,_,S;p<n;++p)isNaN(x=+this._x.call(null,y=e[p]))||isNaN(_=+this._y.call(null,y))||isNaN(S=+this._z.call(null,y))||(r[p]=x,i[p]=_,a[p]=S,x<l&&(l=x),x>f&&(f=x),_<s&&(s=_),_>d&&(d=_),S<c&&(c=S),S>m&&(m=S));if(l>f||s>d||c>m)return this;this.cover(l,s,c).cover(f,d,m);for(let p=0;p<n;++p)N4(this,r[p],i[p],a[p],e[p]);return this}function vq(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var i=this._x0,a=this._y0,l=this._z0,s=this._x1,c=this._y1,f=this._z1;if(isNaN(i))s=(i=Math.floor(e))+1,c=(a=Math.floor(n))+1,f=(l=Math.floor(r))+1;else{for(var d=s-i||1,m=this._root,p,y;i>e||e>=s||a>n||n>=c||l>r||r>=f;)switch(y=(r<l)<<2|(n<a)<<1|e<i,p=new Array(8),p[y]=m,m=p,d*=2,y){case 0:s=i+d,c=a+d,f=l+d;break;case 1:i=s-d,c=a+d,f=l+d;break;case 2:s=i+d,a=c-d,f=l+d;break;case 3:i=s-d,a=c-d,f=l+d;break;case 4:s=i+d,c=a+d,l=f-d;break;case 5:i=s-d,c=a+d,l=f-d;break;case 6:s=i+d,a=c-d,l=f-d;break;case 7:i=s-d,a=c-d,l=f-d;break}this._root&&this._root.length&&(this._root=m)}return this._x0=i,this._y0=a,this._z0=l,this._x1=s,this._y1=c,this._z1=f,this}function yq(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function xq(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function ut(e,n,r,i,a,l,s){this.node=e,this.x0=n,this.y0=r,this.z0=i,this.x1=a,this.y1=l,this.z1=s}function bq(e,n,r,i){var a,l=this._x0,s=this._y0,c=this._z0,f,d,m,p,y,x,_=this._x1,S=this._y1,k=this._z1,j=[],C=this._root,N,O;for(C&&j.push(new ut(C,l,s,c,_,S,k)),i==null?i=1/0:(l=e-i,s=n-i,c=r-i,_=e+i,S=n+i,k=r+i,i*=i);N=j.pop();)if(!(!(C=N.node)||(f=N.x0)>_||(d=N.y0)>S||(m=N.z0)>k||(p=N.x1)<l||(y=N.y1)<s||(x=N.z1)<c))if(C.length){var T=(f+p)/2,A=(d+y)/2,P=(m+x)/2;j.push(new ut(C[7],T,A,P,p,y,x),new ut(C[6],f,A,P,T,y,x),new ut(C[5],T,d,P,p,A,x),new ut(C[4],f,d,P,T,A,x),new ut(C[3],T,A,m,p,y,P),new ut(C[2],f,A,m,T,y,P),new ut(C[1],T,d,m,p,A,P),new ut(C[0],f,d,m,T,A,P)),(O=(r>=P)<<2|(n>=A)<<1|e>=T)&&(N=j[j.length-1],j[j.length-1]=j[j.length-1-O],j[j.length-1-O]=N)}else{var R=e-+this._x.call(null,C.data),z=n-+this._y.call(null,C.data),D=r-+this._z.call(null,C.data),U=R*R+z*z+D*D;if(U<i){var q=Math.sqrt(i=U);l=e-q,s=n-q,c=r-q,_=e+q,S=n+q,k=r+q,a=C.data}}return a}const wq=(e,n,r,i,a,l)=>Math.sqrt((e-i)**2+(n-a)**2+(r-l)**2);function _q(e,n,r,i){const a=[],l=e-i,s=n-i,c=r-i,f=e+i,d=n+i,m=r+i;return this.visit((p,y,x,_,S,k,j)=>{if(!p.length)do{const C=p.data;wq(e,n,r,this._x(C),this._y(C),this._z(C))<=i&&a.push(C)}while(p=p.next);return y>f||x>d||_>m||S<l||k<s||j<c}),a}function kq(e){if(isNaN(y=+this._x.call(null,e))||isNaN(x=+this._y.call(null,e))||isNaN(_=+this._z.call(null,e)))return this;var n,r=this._root,i,a,l,s=this._x0,c=this._y0,f=this._z0,d=this._x1,m=this._y1,p=this._z1,y,x,_,S,k,j,C,N,O,T,A;if(!r)return this;if(r.length)for(;;){if((C=y>=(S=(s+d)/2))?s=S:d=S,(N=x>=(k=(c+m)/2))?c=k:m=k,(O=_>=(j=(f+p)/2))?f=j:p=j,n=r,!(r=r[T=O<<2|N<<1|C]))return this;if(!r.length)break;(n[T+1&7]||n[T+2&7]||n[T+3&7]||n[T+4&7]||n[T+5&7]||n[T+6&7]||n[T+7&7])&&(i=n,A=T)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,a?(l?a.next=l:delete a.next,this):n?(l?n[T]=l:delete n[T],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[A]=r:this._root=r),this):(this._root=l,this)}function Sq(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function jq(){return this._root}function Eq(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Cq(e){var n=[],r,i=this._root,a,l,s,c,f,d,m;for(i&&n.push(new ut(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(i=r.node,l=r.x0,s=r.y0,c=r.z0,f=r.x1,d=r.y1,m=r.z1)&&i.length){var p=(l+f)/2,y=(s+d)/2,x=(c+m)/2;(a=i[7])&&n.push(new ut(a,p,y,x,f,d,m)),(a=i[6])&&n.push(new ut(a,l,y,x,p,d,m)),(a=i[5])&&n.push(new ut(a,p,s,x,f,y,m)),(a=i[4])&&n.push(new ut(a,l,s,x,p,y,m)),(a=i[3])&&n.push(new ut(a,p,y,c,f,d,x)),(a=i[2])&&n.push(new ut(a,l,y,c,p,d,x)),(a=i[1])&&n.push(new ut(a,p,s,c,f,y,x)),(a=i[0])&&n.push(new ut(a,l,s,c,p,y,x))}return this}function Nq(e){var n=[],r=[],i;for(this._root&&n.push(new ut(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();){var a=i.node;if(a.length){var l,s=i.x0,c=i.y0,f=i.z0,d=i.x1,m=i.y1,p=i.z1,y=(s+d)/2,x=(c+m)/2,_=(f+p)/2;(l=a[0])&&n.push(new ut(l,s,c,f,y,x,_)),(l=a[1])&&n.push(new ut(l,y,c,f,d,x,_)),(l=a[2])&&n.push(new ut(l,s,x,f,y,m,_)),(l=a[3])&&n.push(new ut(l,y,x,f,d,m,_)),(l=a[4])&&n.push(new ut(l,s,c,_,y,x,p)),(l=a[5])&&n.push(new ut(l,y,c,_,d,x,p)),(l=a[6])&&n.push(new ut(l,s,x,_,y,m,p)),(l=a[7])&&n.push(new ut(l,y,x,_,d,m,p))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function Oq(e){return e[0]}function Aq(e){return arguments.length?(this._x=e,this):this._x}function Tq(e){return e[1]}function Mq(e){return arguments.length?(this._y=e,this):this._y}function Pq(e){return e[2]}function Dq(e){return arguments.length?(this._z=e,this):this._z}function jb(e,n,r,i){var a=new Eb(n??Oq,r??Tq,i??Pq,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?a:a.addAll(e)}function Eb(e,n,r,i,a,l,s,c,f){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=a,this._z0=l,this._x1=s,this._y1=c,this._z1=f,this._root=void 0}function wj(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var an=jb.prototype=Eb.prototype;an.copy=function(){var e=new Eb(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=wj(n),e;for(r=[{source:n,target:e._root=new Array(8)}];n=r.pop();)for(var a=0;a<8;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=new Array(8)}):n.target[a]=wj(i));return e};an.add=pq;an.addAll=gq;an.cover=vq;an.data=yq;an.extent=xq;an.find=bq;an.findAllWithinRadius=_q;an.remove=kq;an.removeAll=Sq;an.root=jq;an.size=Eq;an.visit=Cq;an.visitAfter=Nq;an.x=Aq;an.y=Mq;an.z=Dq;function gn(e){return function(){return e}}function mr(e){return(e()-.5)*1e-6}function Ov(e){return e.x+e.vx}function _j(e){return e.y+e.vy}function Rq(e){return e.z+e.vz}function O4(e){var n,r,i,a,l=1,s=1;typeof e!="function"&&(e=gn(e==null?1:+e));function c(){for(var m,p=n.length,y,x,_,S,k,j,C,N=0;N<s;++N)for(y=(r===1?wb(n,Ov):r===2?kb(n,Ov,_j):r===3?jb(n,Ov,_j,Rq):null).visitAfter(f),m=0;m<p;++m)x=n[m],j=i[x.index],C=j*j,_=x.x+x.vx,r>1&&(S=x.y+x.vy),r>2&&(k=x.z+x.vz),y.visit(O);function O(T,A,P,R,z,D,U){var q=[A,P,R,z,D,U],L=q[0],$=q[1],G=q[2],B=q[r],Y=q[r+1],ee=q[r+2],H=T.data,re=T.r,F=j+re;if(H){if(H.index>x.index){var X=_-H.x-H.vx,ae=r>1?S-H.y-H.vy:0,se=r>2?k-H.z-H.vz:0,ve=X*X+ae*ae+se*se;ve<F*F&&(X===0&&(X=mr(a),ve+=X*X),r>1&&ae===0&&(ae=mr(a),ve+=ae*ae),r>2&&se===0&&(se=mr(a),ve+=se*se),ve=(F-(ve=Math.sqrt(ve)))/ve*l,x.vx+=(X*=ve)*(F=(re*=re)/(C+re)),r>1&&(x.vy+=(ae*=ve)*F),r>2&&(x.vz+=(se*=ve)*F),H.vx-=X*(F=1-F),r>1&&(H.vy-=ae*F),r>2&&(H.vz-=se*F))}return}return L>_+F||B<_-F||r>1&&($>S+F||Y<S-F)||r>2&&(G>k+F||ee<k-F)}}function f(m){if(m.data)return m.r=i[m.data.index];for(var p=m.r=0;p<Math.pow(2,r);++p)m[p]&&m[p].r>m.r&&(m.r=m[p].r)}function d(){if(n){var m,p=n.length,y;for(i=new Array(p),m=0;m<p;++m)y=n[m],i[y.index]=+e(y,m,n)}}return c.initialize=function(m,...p){n=m,a=p.find(y=>typeof y=="function")||Math.random,r=p.find(y=>[1,2,3].includes(y))||2,d()},c.iterations=function(m){return arguments.length?(s=+m,c):s},c.strength=function(m){return arguments.length?(l=+m,c):l},c.radius=function(m){return arguments.length?(e=typeof m=="function"?m:gn(+m),d(),c):e},c}function Lq(e){return e.index}function kj(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function zq(e){var n=Lq,r=y,i,a=gn(30),l,s,c,f,d,m,p=1;e==null&&(e=[]);function y(j){return 1/Math.min(f[j.source.index],f[j.target.index])}function x(j){for(var C=0,N=e.length;C<p;++C)for(var O=0,T,A,P,R=0,z=0,D=0,U,q;O<N;++O)T=e[O],A=T.source,P=T.target,R=P.x+P.vx-A.x-A.vx||mr(m),c>1&&(z=P.y+P.vy-A.y-A.vy||mr(m)),c>2&&(D=P.z+P.vz-A.z-A.vz||mr(m)),U=Math.sqrt(R*R+z*z+D*D),U=(U-l[O])/U*j*i[O],R*=U,z*=U,D*=U,P.vx-=R*(q=d[O]),c>1&&(P.vy-=z*q),c>2&&(P.vz-=D*q),A.vx+=R*(q=1-q),c>1&&(A.vy+=z*q),c>2&&(A.vz+=D*q)}function _(){if(s){var j,C=s.length,N=e.length,O=new Map(s.map((A,P)=>[n(A,P,s),A])),T;for(j=0,f=new Array(C);j<N;++j)T=e[j],T.index=j,typeof T.source!="object"&&(T.source=kj(O,T.source)),typeof T.target!="object"&&(T.target=kj(O,T.target)),f[T.source.index]=(f[T.source.index]||0)+1,f[T.target.index]=(f[T.target.index]||0)+1;for(j=0,d=new Array(N);j<N;++j)T=e[j],d[j]=f[T.source.index]/(f[T.source.index]+f[T.target.index]);i=new Array(N),S(),l=new Array(N),k()}}function S(){if(s)for(var j=0,C=e.length;j<C;++j)i[j]=+r(e[j],j,e)}function k(){if(s)for(var j=0,C=e.length;j<C;++j)l[j]=+a(e[j],j,e)}return x.initialize=function(j,...C){s=j,m=C.find(N=>typeof N=="function")||Math.random,c=C.find(N=>[1,2,3].includes(N))||2,_()},x.links=function(j){return arguments.length?(e=j,_(),x):e},x.id=function(j){return arguments.length?(n=j,x):n},x.iterations=function(j){return arguments.length?(p=+j,x):p},x.strength=function(j){return arguments.length?(r=typeof j=="function"?j:gn(+j),S(),x):r},x.distance=function(j){return arguments.length?(a=typeof j=="function"?j:gn(+j),k(),x):a},x}const Iq=1664525,$q=1013904223,Sj=4294967296;function Bq(){let e=1;return()=>(e=(Iq*e+$q)%Sj)/Sj}var jj=3;function Av(e){return e.x}function Ej(e){return e.y}function Fq(e){return e.z}var Uq=10,qq=Math.PI*(3-Math.sqrt(5)),Hq=Math.PI*20/(9+Math.sqrt(221));function Gq(e,n){n=n||2;var r=Math.min(jj,Math.max(1,Math.round(n))),i,a=1,l=.001,s=1-Math.pow(l,1/300),c=0,f=.6,d=new Map,m=fb(x),p=vc("tick","end"),y=Bq();e==null&&(e=[]);function x(){_(),p.call("tick",i),a<l&&(m.stop(),p.call("end",i))}function _(j){var C,N=e.length,O;j===void 0&&(j=1);for(var T=0;T<j;++T)for(a+=(c-a)*s,d.forEach(function(A){A(a)}),C=0;C<N;++C)O=e[C],O.fx==null?O.x+=O.vx*=f:(O.x=O.fx,O.vx=0),r>1&&(O.fy==null?O.y+=O.vy*=f:(O.y=O.fy,O.vy=0)),r>2&&(O.fz==null?O.z+=O.vz*=f:(O.z=O.fz,O.vz=0));return i}function S(){for(var j=0,C=e.length,N;j<C;++j){if(N=e[j],N.index=j,N.fx!=null&&(N.x=N.fx),N.fy!=null&&(N.y=N.fy),N.fz!=null&&(N.z=N.fz),isNaN(N.x)||r>1&&isNaN(N.y)||r>2&&isNaN(N.z)){var O=Uq*(r>2?Math.cbrt(.5+j):r>1?Math.sqrt(.5+j):j),T=j*qq,A=j*Hq;r===1?N.x=O:r===2?(N.x=O*Math.cos(T),N.y=O*Math.sin(T)):(N.x=O*Math.sin(T)*Math.cos(A),N.y=O*Math.cos(T),N.z=O*Math.sin(T)*Math.sin(A))}(isNaN(N.vx)||r>1&&isNaN(N.vy)||r>2&&isNaN(N.vz))&&(N.vx=0,r>1&&(N.vy=0),r>2&&(N.vz=0))}}function k(j){return j.initialize&&j.initialize(e,y,r),j}return S(),i={tick:_,restart:function(){return m.restart(x),i},stop:function(){return m.stop(),i},numDimensions:function(j){return arguments.length?(r=Math.min(jj,Math.max(1,Math.round(j))),d.forEach(k),i):r},nodes:function(j){return arguments.length?(e=j,S(),d.forEach(k),i):e},alpha:function(j){return arguments.length?(a=+j,i):a},alphaMin:function(j){return arguments.length?(l=+j,i):l},alphaDecay:function(j){return arguments.length?(s=+j,i):+s},alphaTarget:function(j){return arguments.length?(c=+j,i):c},velocityDecay:function(j){return arguments.length?(f=1-j,i):1-f},randomSource:function(j){return arguments.length?(y=j,d.forEach(k),i):y},force:function(j,C){return arguments.length>1?(C==null?d.delete(j):d.set(j,k(C)),i):d.get(j)},find:function(){var j=Array.prototype.slice.call(arguments),C=j.shift()||0,N=(r>1?j.shift():null)||0,O=(r>2?j.shift():null)||0,T=j.shift()||1/0,A=0,P=e.length,R,z,D,U,q,L;for(T*=T,A=0;A<P;++A)q=e[A],R=C-q.x,z=N-(q.y||0),D=O-(q.z||0),U=R*R+z*z+D*D,U<T&&(L=q,T=U);return L},on:function(j,C){return arguments.length>1?(p.on(j,C),i):p.on(j)}}}function Kq(){var e,n,r,i,a,l=gn(-30),s,c=1,f=1/0,d=.81;function m(_){var S,k=e.length,j=(n===1?wb(e,Av):n===2?kb(e,Av,Ej):n===3?jb(e,Av,Ej,Fq):null).visitAfter(y);for(a=_,S=0;S<k;++S)r=e[S],j.visit(x)}function p(){if(e){var _,S=e.length,k;for(s=new Array(S),_=0;_<S;++_)k=e[_],s[k.index]=+l(k,_,e)}}function y(_){var S=0,k,j,C=0,N,O,T,A,P=_.length;if(P){for(N=O=T=A=0;A<P;++A)(k=_[A])&&(j=Math.abs(k.value))&&(S+=k.value,C+=j,N+=j*(k.x||0),O+=j*(k.y||0),T+=j*(k.z||0));S*=Math.sqrt(4/P),_.x=N/C,n>1&&(_.y=O/C),n>2&&(_.z=T/C)}else{k=_,k.x=k.data.x,n>1&&(k.y=k.data.y),n>2&&(k.z=k.data.z);do S+=s[k.data.index];while(k=k.next)}_.value=S}function x(_,S,k,j,C){if(!_.value)return!0;var N=[k,j,C][n-1],O=_.x-r.x,T=n>1?_.y-r.y:0,A=n>2?_.z-r.z:0,P=N-S,R=O*O+T*T+A*A;if(P*P/d<R)return R<f&&(O===0&&(O=mr(i),R+=O*O),n>1&&T===0&&(T=mr(i),R+=T*T),n>2&&A===0&&(A=mr(i),R+=A*A),R<c&&(R=Math.sqrt(c*R)),r.vx+=O*_.value*a/R,n>1&&(r.vy+=T*_.value*a/R),n>2&&(r.vz+=A*_.value*a/R)),!0;if(_.length||R>=f)return;(_.data!==r||_.next)&&(O===0&&(O=mr(i),R+=O*O),n>1&&T===0&&(T=mr(i),R+=T*T),n>2&&A===0&&(A=mr(i),R+=A*A),R<c&&(R=Math.sqrt(c*R)));do _.data!==r&&(P=s[_.data.index]*a/R,r.vx+=O*P,n>1&&(r.vy+=T*P),n>2&&(r.vz+=A*P));while(_=_.next)}return m.initialize=function(_,...S){e=_,i=S.find(k=>typeof k=="function")||Math.random,n=S.find(k=>[1,2,3].includes(k))||2,p()},m.strength=function(_){return arguments.length?(l=typeof _=="function"?_:gn(+_),p(),m):l},m.distanceMin=function(_){return arguments.length?(c=_*_,m):Math.sqrt(c)},m.distanceMax=function(_){return arguments.length?(f=_*_,m):Math.sqrt(f)},m.theta=function(_){return arguments.length?(d=_*_,m):Math.sqrt(d)},m}function Vq(e,n,r,i){var a,l,s=gn(.1),c,f;typeof e!="function"&&(e=gn(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function d(p){for(var y=0,x=a.length;y<x;++y){var _=a[y],S=_.x-n||1e-6,k=(_.y||0)-r||1e-6,j=(_.z||0)-i||1e-6,C=Math.sqrt(S*S+k*k+j*j),N=(f[y]-C)*c[y]*p/C;_.vx+=S*N,l>1&&(_.vy+=k*N),l>2&&(_.vz+=j*N)}}function m(){if(a){var p,y=a.length;for(c=new Array(y),f=new Array(y),p=0;p<y;++p)f[p]=+e(a[p],p,a),c[p]=isNaN(f[p])?0:+s(a[p],p,a)}}return d.initialize=function(p,...y){a=p,l=y.find(x=>[1,2,3].includes(x))||2,m()},d.strength=function(p){return arguments.length?(s=typeof p=="function"?p:gn(+p),m(),d):s},d.radius=function(p){return arguments.length?(e=typeof p=="function"?p:gn(+p),m(),d):e},d.x=function(p){return arguments.length?(n=+p,d):n},d.y=function(p){return arguments.length?(r=+p,d):r},d.z=function(p){return arguments.length?(i=+p,d):i},d}function Yq(e){var n=gn(.1),r,i,a;typeof e!="function"&&(e=gn(e==null?0:+e));function l(c){for(var f=0,d=r.length,m;f<d;++f)m=r[f],m.vy+=(a[f]-m.y)*i[f]*c}function s(){if(r){var c,f=r.length;for(i=new Array(f),a=new Array(f),c=0;c<f;++c)i[c]=isNaN(a[c]=+e(r[c],c,r))?0:+n(r[c],c,r)}}return l.initialize=function(c){r=c,s()},l.strength=function(c){return arguments.length?(n=typeof c=="function"?c:gn(+c),s(),l):n},l.y=function(c){return arguments.length?(e=typeof c=="function"?c:gn(+c),s(),l):e},l}const{abs:mu,cos:Di,sin:jo,acos:Wq,atan2:pu,sqrt:Oa,pow:hr}=Math;function gu(e){return e<0?-hr(-e,1/3):hr(e,1/3)}const A4=Math.PI,dd=2*A4,Aa=A4/2,Xq=1e-6,Tv=Number.MAX_SAFE_INTEGER||9007199254740991,Mv=Number.MIN_SAFE_INTEGER||-9007199254740991,Zq={x:0,y:0,z:0},xe={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),Oa(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const a=1-e;let l=n;if(i===0)return n[0].t=e,n[0];if(i===1){const c={x:a*l[0].x+e*l[1].x,y:a*l[0].y+e*l[1].y,t:e};return r&&(c.z=a*l[0].z+e*l[1].z),c}if(i<4){let c=a*a,f=e*e,d,m,p,y=0;i===2?(l=[l[0],l[1],l[2],Zq],d=c,m=a*e*2,p=f):i===3&&(d=c*a,m=c*e*3,p=a*f*3,y=e*f);const x={x:d*l[0].x+m*l[1].x+p*l[2].x+y*l[3].x,y:d*l[0].y+m*l[1].y+p*l[2].y+y*l[3].y,t:e};return r&&(x.z=d*l[0].z+m*l[1].z+p*l[2].z+y*l[3].z),x}const s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let c=0;c<s.length-1;c++)s[c]={x:s[c].x+(s[c+1].x-s[c].x)*e,y:s[c].y+(s[c+1].y-s[c].y)*e},typeof s[c].z<"u"&&(s[c].z=s[c].z+(s[c+1].z-s[c].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,n,r,i){const a=1-e,l=r,s=n;let c=l[0],f=l[1],d=l[2],m=l[3],p;if(c*=a,f*=e,s.length===2)return p=c+f,{x:(c*s[0].x+f*s[1].x)/p,y:(c*s[0].y+f*s[1].y)/p,z:i?(c*s[0].z+f*s[1].z)/p:!1,t:e};if(c*=a,f*=2*a,d*=e*e,s.length===3)return p=c+f+d,{x:(c*s[0].x+f*s[1].x+d*s[2].x)/p,y:(c*s[0].y+f*s[1].y+d*s[2].y)/p,z:i?(c*s[0].z+f*s[1].z+d*s[2].z)/p:!1,t:e};if(c*=a,f*=1.5*a,d*=3*a,m*=e*e*e,s.length===4)return p=c+f+d+m,{x:(c*s[0].x+f*s[1].x+d*s[2].x+m*s[3].x)/p,y:(c*s[0].y+f*s[1].y+d*s[2].y+m*s[3].y)/p,z:i?(c*s[0].z+f*s[1].z+d*s[2].z+m*s[3].z)/p:!1,t:e}},derive:function(e,n){const r=[];for(let i=e,a=i.length,l=a-1;a>1;a--,l--){const s=[];for(let c=0,f;c<l;c++)f={x:l*(i[c+1].x-i[c].x),y:l*(i[c+1].y-i[c].y)},n&&(f.z=l*(i[c+1].z-i[c].z)),s.push(f);r.push(s),i=s}return r},between:function(e,n,r){return n<=e&&e<=r||xe.approximately(e,n)||xe.approximately(e,r)},approximately:function(e,n,r){return mu(e-n)<=(r||Xq)},length:function(e){const r=xe.Tvalues.length;let i=0;for(let a=0,l;a<r;a++)l=.5*xe.Tvalues[a]+.5,i+=xe.Cvalues[a]*xe.arcfn(l,e);return .5*i},map:function(e,n,r,i,a){const l=r-n,s=a-i,c=e-n,f=c/l;return i+s*f},lerp:function(e,n,r){const i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+"/"+e.y;return typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(xe.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const i=n.x-e.x,a=n.y-e.y,l=r.x-e.x,s=r.y-e.y,c=i*s-a*l,f=i*l+a*s;return pu(c,f)},round:function(e,n){const r=""+e,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){const r=e.x-n.x,i=e.y-n.y;return Oa(r*r+i*i)},closest:function(e,n){let r=hr(2,63),i,a;return e.forEach(function(l,s){a=xe.dist(n,l),a<r&&(r=a,i=s)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=hr(e,n)+hr(1-e,n),i=r-1;return mu(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=hr(1-e,n),i=hr(e,n)+r;return r/i},lli8:function(e,n,r,i,a,l,s,c){const f=(e*i-n*r)*(a-s)-(e-r)*(a*c-l*s),d=(e*i-n*r)*(l-c)-(n-i)*(a*c-l*s),m=(e-r)*(l-c)-(n-i)*(a-s);return m==0?!1:{x:f/m,y:d/m}},lli4:function(e,n,r,i){const a=e.x,l=e.y,s=n.x,c=n.y,f=r.x,d=r.y,m=i.x,p=i.y;return xe.lli8(a,l,s,c,f,d,m,p)},lli:function(e,n){return xe.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new mt(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=Tv,r=Tv,i=Mv,a=Mv;return e.forEach(function(l){const s=l.bbox();n>s.x.min&&(n=s.x.min),r>s.y.min&&(r=s.y.min),i<s.x.max&&(i=s.x.max),a<s.y.max&&(a=s.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+a)/2,max:a,size:a-r}}},shapeintersections:function(e,n,r,i,a){if(!xe.bboxoverlap(n,i))return[];const l=[],s=[e.startcap,e.forward,e.back,e.endcap],c=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(f){f.virtual||c.forEach(function(d){if(d.virtual)return;const m=f.intersects(d,a);m.length>0&&(m.c1=f,m.c2=d,m.s1=e,m.s2=r,l.push(m))})}),l},makeshape:function(e,n,r){const i=n.points.length,a=e.points.length,l=xe.makeline(n.points[i-1],e.points[0]),s=xe.makeline(e.points[a-1],n.points[0]),c={startcap:l,forward:e,back:n,endcap:s,bbox:xe.findbbox([l,e,n,s])};return c.intersections=function(f){return xe.shapeintersections(c,c.bbox,f,f.bbox,r)},c},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=Tv,a=Mv,l,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let c=0,f=r.length;c<f;c++)l=r[c],s=e.get(l),s[n]<i&&(i=s[n]),s[n]>a&&(a=s[n]);return{min:i,mid:(i+a)/2,max:a,size:a-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,a=-pu(n.p2.y-i,n.p2.x-r),l=function(s){return{x:(s.x-r)*Di(a)-(s.y-i)*jo(a),y:(s.x-r)*jo(a)+(s.y-i)*Di(a)}};return e.map(l)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=xe.align(e,n),a=function(P){return 0<=P&&P<=1};if(r===2){const P=i[0].y,R=i[1].y,z=i[2].y,D=P-2*R+z;if(D!==0){const U=-Oa(R*R-P*z),q=-P+R,L=-(U+q)/D,$=-(-U+q)/D;return[L,$].filter(a)}else if(R!==z&&D===0)return[(2*R-z)/(2*R-2*z)].filter(a);return[]}const l=i[0].y,s=i[1].y,c=i[2].y,f=i[3].y;let d=-l+3*s-3*c+f,m=3*l-6*s+3*c,p=-3*l+3*s,y=l;if(xe.approximately(d,0)){if(xe.approximately(m,0))return xe.approximately(p,0)?[]:[-y/p].filter(a);const P=Oa(p*p-4*m*y),R=2*m;return[(P-p)/R,(-p-P)/R].filter(a)}m/=d,p/=d,y/=d;const x=(3*p-m*m)/3,_=x/3,S=(2*m*m*m-9*m*p+27*y)/27,k=S/2,j=k*k+_*_*_;let C,N,O,T,A;if(j<0){const P=-x/3,R=P*P*P,z=Oa(R),D=-S/(2*z),U=D<-1?-1:D>1?1:D,q=Wq(U),L=gu(z),$=2*L;return O=$*Di(q/3)-m/3,T=$*Di((q+dd)/3)-m/3,A=$*Di((q+2*dd)/3)-m/3,[O,T,A].filter(a)}else{if(j===0)return C=k<0?gu(-k):-gu(k),O=2*C-m/3,T=-C-m/3,[O,T].filter(a);{const P=Oa(j);return C=gu(-k+P),N=gu(k+P),[C-N-m/3].filter(a)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],a=n-2*r+i;if(a!==0){const l=-Oa(r*r-n*i),s=-n+r,c=-(l+s)/a,f=-(-l+s)/a;return[c,f]}else if(r!==i&&a===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,a){let l,s,c,f,d=0,m=0;const p=xe.compute(e,n),y=xe.compute(e,r),x=p.x*p.x+p.y*p.y;if(i?(l=Oa(hr(p.y*y.z-y.y*p.z,2)+hr(p.z*y.x-y.z*p.x,2)+hr(p.x*y.y-y.x*p.y,2)),s=hr(x+p.z*p.z,3/2)):(l=p.x*y.y-p.y*y.x,s=hr(x,3/2)),l===0||s===0)return{k:0,r:0};if(d=l/s,m=s/l,!a){const _=xe.curvature(e-.001,n,r,i,!0).k,S=xe.curvature(e+.001,n,r,i,!0).k;f=(S-d+(d-_))/2,c=(mu(S-d)+mu(d-_))/2}return{k:d,r:m,dk:f,adk:c}},inflections:function(e){if(e.length<4)return[];const n=xe.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,a=n[1].x*n[2].y,l=n[3].x*n[2].y,s=18*(-3*r+2*i+3*a-l),c=18*(3*r-i-3*a),f=18*(a-r);if(xe.approximately(s,0)){if(!xe.approximately(c,0)){let y=-f/c;if(0<=y&&y<=1)return[y]}return[]}const d=2*s;if(xe.approximately(d,0))return[];const m=c*c-4*s*f;if(m<0)return[];const p=Math.sqrt(m);return[(p-c)/d,-(c+p)/d].filter(function(y){return 0<=y&&y<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let a=0,l,s,c,f;a<i;a++)if(l=r[a],s=e[l].mid,c=n[l].mid,f=(e[l].size+n[l].size)/2,mu(s-c)>=f)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const i=e.bbox(),a=n.bbox(),l=1e5,s=r||.5;if(i.x.size+i.y.size<s&&a.x.size+a.y.size<s)return[(l*(e._t1+e._t2)/2|0)/l+"/"+(l*(n._t1+n._t2)/2|0)/l];let c=e.split(.5),f=n.split(.5),d=[{left:c.left,right:f.left},{left:c.left,right:f.right},{left:c.right,right:f.right},{left:c.right,right:f.left}];d=d.filter(function(p){return xe.bboxoverlap(p.left.bbox(),p.right.bbox())});let m=[];return d.length===0||(d.forEach(function(p){m=m.concat(xe.pairiteration(p.left,p.right,s))}),m=m.filter(function(p,y){return m.indexOf(p)===y})),m},getccenter:function(e,n,r){const i=n.x-e.x,a=n.y-e.y,l=r.x-n.x,s=r.y-n.y,c=i*Di(Aa)-a*jo(Aa),f=i*jo(Aa)+a*Di(Aa),d=l*Di(Aa)-s*jo(Aa),m=l*jo(Aa)+s*Di(Aa),p=(e.x+n.x)/2,y=(e.y+n.y)/2,x=(n.x+r.x)/2,_=(n.y+r.y)/2,S=p+c,k=y+f,j=x+d,C=_+m,N=xe.lli8(p,y,S,k,x,_,j,C),O=xe.dist(N,e);let T=pu(e.y-N.y,e.x-N.x),A=pu(n.y-N.y,n.x-N.x),P=pu(r.y-N.y,r.x-N.x),R;return T<P?((T>A||A>P)&&(T+=dd),T>P&&(R=P,P=T,T=R)):P<A&&A<T?(R=P,P=T,T=R):P+=dd,N.s=T,N.e=P,N.r=O,N},numberSort:function(e,n){return e-n}};class Bu{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return xe.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),i=1;i<n.length;i++)xe.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new Bu(r)}}const{abs:vu,min:Cj,max:Nj,cos:Qq,sin:Jq,acos:eH,sqrt:yu}=Math,tH=Math.PI;class mt{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const x=[];r.forEach(function(_){["x","y","z"].forEach(function(S){typeof _[S]<"u"&&x.push(_[S])})}),r=x}let a=!1;const l=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");a=!0}}else if(l!==6&&l!==8&&l!==9&&l!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const s=this._3d=!a&&(l===9||l===12)||n&&n[0]&&typeof n[0].z<"u",c=this.points=[];for(let x=0,_=s?3:2;x<l;x+=_){var f={x:r[x],y:r[x+1]};s&&(f.z=r[x+2]),c.push(f)}const d=this.order=c.length-1,m=this.dims=["x","y"];s&&m.push("z"),this.dimlen=m.length;const p=xe.align(c,{p1:c[0],p2:c[d]}),y=xe.dist(c[0],c[d]);this._linear=p.reduce((x,_)=>x+vu(_.y),0)<y/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,a){if(typeof a>"u"&&(a=.5),a===0)return new mt(r,r,i);if(a===1)return new mt(n,r,r);const l=mt.getABC(2,n,r,i,a);return new mt(n,l.A,i)}static cubicFromPoints(n,r,i,a,l){typeof a>"u"&&(a=.5);const s=mt.getABC(3,n,r,i,a);typeof l>"u"&&(l=xe.dist(r,s.C));const c=l*(1-a)/a,f=xe.dist(n,i),d=(i.x-n.x)/f,m=(i.y-n.y)/f,p=l*d,y=l*m,x=c*d,_=c*m,S={x:r.x-p,y:r.y-y},k={x:r.x+x,y:r.y+_},j=s.A,C={x:j.x+(S.x-j.x)/(1-a),y:j.y+(S.y-j.y)/(1-a)},N={x:j.x+(k.x-j.x)/a,y:j.y+(k.y-j.y)/a},O={x:n.x+(C.x-n.x)/a,y:n.y+(C.y-n.y)/a},T={x:i.x+(N.x-i.x)/(1-a),y:i.y+(N.y-i.y)/(1-a)};return new mt(n,O,T,i)}static getUtils(){return xe}getUtils(){return mt.getUtils()}static get PolyBezier(){return Bu}valueOf(){return this.toString()}toString(){return xe.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,a=["M",r,i,this.order===2?"Q":"C"];for(let l=1,s=n.length;l<s;l++)a.push(n[l].x),a.push(n[l].y);return a.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=xe.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=xe.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return xe.length(this.derivative.bind(this))}static getABC(n=2,r,i,a,l=.5){const s=xe.projectionratio(l,n),c=1-s,f={x:s*r.x+c*a.x,y:s*r.y+c*a.y},d=xe.abcratio(l,n);return{A:{x:i.x+(i.x-f.x)/d,y:i.y+(i.y-f.y)/d},B:i,C:f,S:r,E:a}}getABC(n,r){r=r||this.get(n);let i=this.points[0],a=this.points[this.order];return mt.getABC(this.order,i,r,a,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,a;r<n;r++)a=r/(n-1),i=this.compute(a),i.t=a,this._lut.push(i);return this._lut}on(n,r){r=r||5;const i=this.getLUT(),a=[];for(let l=0,s,c=0;l<i.length;l++)s=i[l],xe.dist(s,n)<r&&(a.push(s),c+=l/i.length);return a.length?t/=a.length:!1}project(n){const r=this.getLUT(),i=r.length-1,a=xe.closest(r,n),l=a.mpos,s=(l-1)/i,c=(l+1)/i,f=.1/i;let d=a.mdist,m=s,p=m,y;d+=1;for(let x;m<c+f;m+=f)y=this.compute(m),x=xe.dist(n,y),x<d&&(d=x,p=m);return p=p<0?0:p>1?1:p,y=this.compute(p),y.t=p,y.d=d,y}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?xe.computeWithRatios(n,this.points,this.ratios,this._3d):xe.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let a=1,l,s;a<i;a++)l=n[a],s=n[a-1],r[a]={x:(i-a)/i*l.x+a/i*s.x,y:(i-a)/i*l.y+a/i*s.y};return r[i]=n[i-1],new mt(r)}derivative(n){return xe.compute(n,this.dpoints[0],this._3d)}dderivative(n){return xe.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new mt(xe.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return xe.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return xe.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=yu(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/i,y:r.x/i}}__normal3(n){const r=this.derivative(n),i=this.derivative(n+.01),a=yu(r.x*r.x+r.y*r.y+r.z*r.z),l=yu(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=a,r.y/=a,r.z/=a,i.x/=l,i.y/=l,i.z/=l;const s={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},c=yu(s.x*s.x+s.y*s.y+s.z*s.z);s.x/=c,s.y/=c,s.z/=c;const f=[s.x*s.x,s.x*s.y-s.z,s.x*s.z+s.y,s.x*s.y+s.z,s.y*s.y,s.y*s.z-s.x,s.x*s.z-s.y,s.y*s.z+s.x,s.z*s.z];return{t:n,x:f[0]*r.x+f[1]*r.y+f[2]*r.z,y:f[3]*r.x+f[4]*r.y+f[5]*r.z,z:f[6]*r.x+f[7]*r.y+f[8]*r.z}}hull(n){let r=this.points,i=[],a=[],l=0;for(a[l++]=r[0],a[l++]=r[1],a[l++]=r[2],this.order===3&&(a[l++]=r[3]);r.length>1;){i=[];for(let s=0,c,f=r.length-1;s<f;s++)c=xe.lerp(n,r[s],r[s+1]),a[l++]=c,i.push(c);r=i}return a}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const i=this.hull(n),a={left:this.order===2?new mt([i[0],i[3],i[5]]):new mt([i[0],i[4],i[7],i[9]]),right:this.order===2?new mt([i[5],i[4],i[2]]):new mt([i[9],i[8],i[6],i[3]]),span:i};return a.left._t1=xe.map(0,0,1,this._t1,this._t2),a.left._t2=xe.map(n,0,1,this._t1,this._t2),a.right._t1=xe.map(n,0,1,this._t1,this._t2),a.right._t2=xe.map(1,0,1,this._t1,this._t2),r?(r=xe.map(r,n,1,0,1),a.right.split(r).left):a}extrema(){const n={};let r=[];return this.dims.forEach((function(i){let a=function(s){return s[i]},l=this.dpoints[0].map(a);n[i]=xe.droots(l),this.order===3&&(l=this.dpoints[1].map(a),n[i]=n[i].concat(xe.droots(l))),n[i]=n[i].filter(function(s){return s>=0&&s<=1}),r=r.concat(n[i].sort(xe.numberSort))}).bind(this)),n.values=r.sort(xe.numberSort).filter(function(i,a){return r.indexOf(i)===a}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=xe.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return xe.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),a=this.normal(n),l={c:i,n:a,x:i.x+a.x*r,y:i.y+a.y*r};return this._3d&&(l.z=i.z+a.z*r),l}if(this._linear){const i=this.normal(0),a=this.points.map(function(l){const s={x:l.x+n*i.x,y:l.y+n*i.y};return l.z&&i.z&&(s.z=l.z+n*i.z),s});return[new mt(a)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const a=xe.angle(this.points[0],this.points[3],this.points[1]),l=xe.angle(this.points[0],this.points[3],this.points[2]);if(a>0&&l<0||a<0&&l>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),vu(eH(i))<tH/3}reduce(){let n,r=0,i=0,a=.01,l,s=[],c=[],f=this.extrema().values;for(f.indexOf(0)===-1&&(f=[0].concat(f)),f.indexOf(1)===-1&&f.push(1),r=f[0],n=1;n<f.length;n++)i=f[n],l=this.split(r,i),l._t1=r,l._t2=i,s.push(l),r=i;return s.forEach(function(d){for(r=0,i=0;i<=1;)for(i=r+a;i<=1+a;i+=a)if(l=d.split(r,i),!l.simple()){if(i-=a,vu(r-i)<a)return[];l=d.split(r,i),l._t1=xe.map(r,0,1,d._t1,d._t2),l._t2=xe.map(i,0,1,d._t1,d._t2),c.push(l),r=i;break}r<1&&(l=d.split(r,1),l._t1=xe.map(r,0,1,d._t1,d._t2),l._t2=d._t2,c.push(l))}),c}translate(n,r,i){i=typeof i=="number"?i:r;const a=this.order;let l=this.points.map((s,c)=>(1-c/a)*r+c/a*i);return new mt(this.points.map((s,c)=>({x:s.x+n.x*l[c],y:s.y+n.y*l[c]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const a=this.clockwise,l=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const s=i?i(0):n,c=i?i(1):n,f=[this.offset(0,10),this.offset(1,10)],d=[],m=xe.lli4(f[0],f[0].c,f[1],f[1].c);if(!m)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(p){const y=d[p*r]=xe.copy(l[p*r]);y.x+=(p?c:s)*f[p].n.x,y.y+=(p?c:s)*f[p].n.y}),i?([0,1].forEach(function(p){if(!(r===2&&p)){var y=l[p+1],x={x:y.x-m.x,y:y.y-m.y},_=i?i((p+1)/r):n;i&&!a&&(_=-_);var S=yu(x.x*x.x+x.y*x.y);x.x/=S,x.y/=S,d[p+1]={x:y.x+_*x.x,y:y.y+_*x.y}}}),new mt(d)):([0,1].forEach(p=>{if(r===2&&p)return;const y=d[p*r],x=this.derivative(p),_={x:y.x+x.x,y:y.y+x.y};d[p+1]=xe.lli4(y,_,m,l[p+1])}),new mt(d))}outline(n,r,i,a){if(r=r===void 0?n:r,this._linear){const T=this.normal(0),A=this.points[0],P=this.points[this.points.length-1];let R,z,D;i===void 0&&(i=n,a=r),R={x:A.x+T.x*n,y:A.y+T.y*n},D={x:P.x+T.x*i,y:P.y+T.y*i},z={x:(R.x+D.x)/2,y:(R.y+D.y)/2};const U=[R,z,D];R={x:A.x-T.x*r,y:A.y-T.y*r},D={x:P.x-T.x*a,y:P.y-T.y*a},z={x:(R.x+D.x)/2,y:(R.y+D.y)/2};const q=[D,z,R],L=xe.makeline(q[2],U[0]),$=xe.makeline(U[2],q[0]),G=[L,new mt(U),$,new mt(q)];return new Bu(G)}const l=this.reduce(),s=l.length,c=[];let f=[],d,m=0,p=this.length();const y=typeof i<"u"&&typeof a<"u";function x(T,A,P,R,z){return function(D){const U=R/P,q=(R+z)/P,L=A-T;return xe.map(D,0,1,T+U*L,T+q*L)}}l.forEach(function(T){const A=T.length();y?(c.push(T.scale(x(n,i,p,m,A))),f.push(T.scale(x(-r,-a,p,m,A)))):(c.push(T.scale(n)),f.push(T.scale(-r))),m+=A}),f=f.map(function(T){return d=T.points,d[3]?T.points=[d[3],d[2],d[1],d[0]]:T.points=[d[2],d[1],d[0]],T}).reverse();const _=c[0].points[0],S=c[s-1].points[c[s-1].points.length-1],k=f[s-1].points[f[s-1].points.length-1],j=f[0].points[0],C=xe.makeline(k,_),N=xe.makeline(S,j),O=[C].concat(c).concat([N]).concat(f);return new Bu(O)}outlineshapes(n,r,i){r=r||n;const a=this.outline(n,r).curves,l=[];for(let s=1,c=a.length;s<c/2;s++){const f=xe.makeshape(a[s],a[c-s],i);f.startcap.virtual=s>1,f.endcap.virtual=s<c/2-1,l.push(f)}return l}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof mt&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=Cj(n.p1.x,n.p2.x),i=Cj(n.p1.y,n.p2.y),a=Nj(n.p1.x,n.p2.x),l=Nj(n.p1.y,n.p2.y);return xe.roots(this.points,n).filter(s=>{var c=this.get(s);return xe.between(c.x,r,a)&&xe.between(c.y,i,l)})}selfintersects(n){const r=this.reduce(),i=r.length-2,a=[];for(let l=0,s,c,f;l<i;l++)c=r.slice(l,l+1),f=r.slice(l+2),s=this.curveintersects(c,f,n),a.push(...s);return a}curveintersects(n,r,i){const a=[];n.forEach(function(s){r.forEach(function(c){s.overlaps(c)&&a.push({left:s,right:c})})});let l=[];return a.forEach(function(s){const c=xe.pairiteration(s.left,s.right,i);c.length>0&&(l=l.concat(c))}),l}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,a){const l=(a-i)/4,s=this.get(i+l),c=this.get(a-l),f=xe.dist(n,r),d=xe.dist(n,s),m=xe.dist(n,c);return vu(d-f)+vu(m-f)}_iterate(n,r){let i=0,a=1,l;do{l=0,a=1;let s=this.get(i),c,f,d,m,p=!1,y=!1,x,_=a,S=1;do if(y=p,m=d,_=(i+a)/2,c=this.get(_),f=this.get(a),d=xe.getccenter(s,c,f),d.interval={start:i,end:a},p=this._error(d,s,i,a)<=n,x=y&&!p,x||(S=a),p){if(a>=1){if(d.interval.end=S=1,m=d,a>1){let j={x:d.x+d.r*Qq(d.e),y:d.y+d.r*Jq(d.e)};d.e+=xe.angle({x:d.x,y:d.y},j,this.get(1))}break}a=a+(a-i)/2}else a=_;while(!x&&l++<100);if(l>=100)break;m=m||d,r.push(m),i=S}while(a<1);return r}}function Zy(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function nH(e){if(Array.isArray(e))return e}function rH(e){if(Array.isArray(e))return Zy(e)}function iH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aH(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,a,l,s,c=[],f=!0,d=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(f=(i=l.call(r)).done)&&(c.push(i.value),c.length!==n);f=!0);}catch(m){d=!0,a=m}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw a}}return c}}function lH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
82
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oH(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
83
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sH(e,n){if(e==null)return{};var r,i,a=uH(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function uH(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;r[i]=e[i]}return r}function cH(e,n){return nH(e)||aH(e,n)||T4(e,n)||lH()}function fH(e){return rH(e)||iH(e)||T4(e)||oH()}function dH(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hH(e){var n=dH(e,"string");return typeof n=="symbol"?n:n+""}function T4(e,n){if(e){if(typeof e=="string")return Zy(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zy(e,n):void 0}}var mH=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(c){return{keyAccessor:c,isProp:!(c instanceof Function)}}),l=e.reduce(function(c,f){var d=c,m=f;return a.forEach(function(p,y){var x=p.keyAccessor,_=p.isProp,S;if(_){var k=m,j=k[x],C=sH(k,[x].map(hH));S=j,m=C}else S=x(m,y);y+1<a.length?(d.hasOwnProperty(S)||(d[S]={}),d=d[S]):r?(d.hasOwnProperty(S)||(d[S]=[]),d[S].push(m)):d[S]=m}),c},{});r instanceof Function&&(function c(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;d===a.length?Object.keys(f).forEach(function(m){return f[m]=r(f[m])}):Object.values(f).forEach(function(m){return c(m,d+1)})})(l);var s=l;return i&&(s=[],(function c(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];d.length===a.length?s.push({keys:d,vals:f}):Object.entries(f).forEach(function(m){var p=cH(m,2),y=p[0],x=p[1];return c(x,[].concat(fH(d),[y]))})})(l),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function kr(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e);break}return this}function Ji(e,n){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof n=="function"?this.interpolator(n):this.range(n);break}}return this}const Qy=Symbol("implicit");function dm(){var e=new ZS,n=[],r=[],i=Qy;function a(l){let s=e.get(l);if(s===void 0){if(i!==Qy)return i;e.set(l,s=n.push(l)-1)}return r[s%r.length]}return a.domain=function(l){if(!arguments.length)return n.slice();n=[],e=new ZS;for(const s of l)e.has(s)||e.set(s,n.push(s)-1);return a},a.range=function(l){return arguments.length?(r=Array.from(l),a):r.slice()},a.unknown=function(l){return arguments.length?(i=l,a):i},a.copy=function(){return dm(n,r).unknown(i)},kr.apply(a,arguments),a}function Cb(){var e=dm().unknown(void 0),n=e.domain,r=e.range,i=0,a=1,l,s,c=!1,f=0,d=0,m=.5;delete e.unknown;function p(){var y=n().length,x=a<i,_=x?a:i,S=x?i:a;l=(S-_)/Math.max(1,y-f+d*2),c&&(l=Math.floor(l)),_+=(S-_-l*(y-f))*m,s=l*(1-f),c&&(_=Math.round(_),s=Math.round(s));var k=YB(y).map(function(j){return _+l*j});return r(x?k.reverse():k)}return e.domain=function(y){return arguments.length?(n(y),p()):n()},e.range=function(y){return arguments.length?([i,a]=y,i=+i,a=+a,p()):[i,a]},e.rangeRound=function(y){return[i,a]=y,i=+i,a=+a,c=!0,p()},e.bandwidth=function(){return s},e.step=function(){return l},e.round=function(y){return arguments.length?(c=!!y,p()):c},e.padding=function(y){return arguments.length?(f=Math.min(1,d=+y),p()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),p()):f},e.paddingOuter=function(y){return arguments.length?(d=+y,p()):d},e.align=function(y){return arguments.length?(m=Math.max(0,Math.min(1,y)),p()):m},e.copy=function(){return Cb(n(),[i,a]).round(c).paddingInner(f).paddingOuter(d).align(m)},kr.apply(p(),arguments)}function M4(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return M4(n())},e}function pH(){return M4(Cb.apply(null,arguments).paddingInner(1))}function gH(e){return function(){return e}}function sh(e){return+e}var Oj=[0,1];function vn(e){return e}function Jy(e,n){return(n-=e=+e)?function(r){return(r-e)/n}:gH(isNaN(n)?NaN:.5)}function vH(e,n){var r;return e>n&&(r=e,e=n,n=r),function(i){return Math.max(e,Math.min(n,i))}}function yH(e,n,r){var i=e[0],a=e[1],l=n[0],s=n[1];return a<i?(i=Jy(a,i),l=r(s,l)):(i=Jy(i,a),l=r(l,s)),function(c){return l(i(c))}}function xH(e,n,r){var i=Math.min(e.length,n.length)-1,a=new Array(i),l=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),n=n.slice().reverse());++s<i;)a[s]=Jy(e[s],e[s+1]),l[s]=r(n[s],n[s+1]);return function(c){var f=xc(e,c,1,i)-1;return l[f](a[f](c))}}function wc(e,n){return n.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function hm(){var e=Oj,n=Oj,r=ns,i,a,l,s=vn,c,f,d;function m(){var y=Math.min(e.length,n.length);return s!==vn&&(s=vH(e[0],e[y-1])),c=y>2?xH:yH,f=d=null,p}function p(y){return y==null||isNaN(y=+y)?l:(f||(f=c(e.map(i),n,r)))(i(s(y)))}return p.invert=function(y){return s(a((d||(d=c(n,e.map(i),Or)))(y)))},p.domain=function(y){return arguments.length?(e=Array.from(y,sh),m()):e.slice()},p.range=function(y){return arguments.length?(n=Array.from(y),m()):n.slice()},p.rangeRound=function(y){return n=Array.from(y),r=ub,m()},p.clamp=function(y){return arguments.length?(s=y?!0:vn,m()):s!==vn},p.interpolate=function(y){return arguments.length?(r=y,m()):r},p.unknown=function(y){return arguments.length?(l=y,p):l},function(y,x){return i=y,a=x,m()}}function Nb(){return hm()(vn,vn)}function bH(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function uh(e,n){if(!isFinite(e)||e===0)return null;var r=(e=n?e.toExponential(n-1):e.toExponential()).indexOf("e"),i=e.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+e.slice(r+1)]}function Go(e){return e=uh(Math.abs(e)),e?e[1]:NaN}function wH(e,n){return function(r,i){for(var a=r.length,l=[],s=0,c=e[0],f=0;a>0&&c>0&&(f+c+1>i&&(c=Math.max(1,i-f)),l.push(r.substring(a-=c,a+c)),!((f+=c+1)>i));)c=e[s=(s+1)%e.length];return l.reverse().join(n)}}function _H(e){return function(n){return n.replace(/[0-9]/g,function(r){return e[+r]})}}var kH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wu(e){if(!(n=kH.exec(e)))throw new Error("invalid format: "+e);var n;return new Ob({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}Wu.prototype=Ob.prototype;function Ob(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ob.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 SH(e){e:for(var n=e.length,r=1,i=-1,a;r<n;++r)switch(e[r]){case".":i=a=r;break;case"0":i===0&&(i=r),a=r;break;default:if(!+e[r])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(a+1):e}var ch;function jH(e,n){var r=uh(e,n);if(!r)return ch=void 0,e.toPrecision(n);var i=r[0],a=r[1],l=a-(ch=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=i.length;return l===s?i:l>s?i+new Array(l-s+1).join("0"):l>0?i.slice(0,l)+"."+i.slice(l):"0."+new Array(1-l).join("0")+uh(e,Math.max(0,n+l-1))[0]}function Aj(e,n){var r=uh(e,n);if(!r)return e+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}const Tj={"%":(e,n)=>(e*100).toFixed(n),b:e=>Math.round(e).toString(2),c:e=>e+"",d:bH,e:(e,n)=>e.toExponential(n),f:(e,n)=>e.toFixed(n),g:(e,n)=>e.toPrecision(n),o:e=>Math.round(e).toString(8),p:(e,n)=>Aj(e*100,n),r:Aj,s:jH,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Mj(e){return e}var Pj=Array.prototype.map,Dj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function EH(e){var n=e.grouping===void 0||e.thousands===void 0?Mj:wH(Pj.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",l=e.numerals===void 0?Mj:_H(Pj.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function d(p,y){p=Wu(p);var x=p.fill,_=p.align,S=p.sign,k=p.symbol,j=p.zero,C=p.width,N=p.comma,O=p.precision,T=p.trim,A=p.type;A==="n"?(N=!0,A="g"):Tj[A]||(O===void 0&&(O=12),T=!0,A="g"),(j||x==="0"&&_==="=")&&(j=!0,x="0",_="=");var P=(y&&y.prefix!==void 0?y.prefix:"")+(k==="$"?r:k==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),R=(k==="$"?i:/[%p]/.test(A)?s:"")+(y&&y.suffix!==void 0?y.suffix:""),z=Tj[A],D=/[defgprs%]/.test(A);O=O===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function U(q){var L=P,$=R,G,B,Y;if(A==="c")$=z(q)+$,q="";else{q=+q;var ee=q<0||1/q<0;if(q=isNaN(q)?f:z(Math.abs(q),O),T&&(q=SH(q)),ee&&+q==0&&S!=="+"&&(ee=!1),L=(ee?S==="("?S:c:S==="-"||S==="("?"":S)+L,$=(A==="s"&&!isNaN(q)&&ch!==void 0?Dj[8+ch/3]:"")+$+(ee&&S==="("?")":""),D){for(G=-1,B=q.length;++G<B;)if(Y=q.charCodeAt(G),48>Y||Y>57){$=(Y===46?a+q.slice(G+1):q.slice(G))+$,q=q.slice(0,G);break}}}N&&!j&&(q=n(q,1/0));var H=L.length+q.length+$.length,re=H<C?new Array(C-H+1).join(x):"";switch(N&&j&&(q=n(re+q,re.length?C-$.length:1/0),re=""),_){case"<":q=L+q+$+re;break;case"=":q=L+re+q+$;break;case"^":q=re.slice(0,H=re.length>>1)+L+q+$+re.slice(H);break;default:q=re+L+q+$;break}return l(q)}return U.toString=function(){return p+""},U}function m(p,y){var x=Math.max(-8,Math.min(8,Math.floor(Go(y)/3)))*3,_=Math.pow(10,-x),S=d((p=Wu(p),p.type="f",p),{suffix:Dj[8+x/3]});return function(k){return S(_*k)}}return{format:d,formatPrefix:m}}var hd,Ab,P4;CH({thousands:",",grouping:[3],currency:["$",""]});function CH(e){return hd=EH(e),Ab=hd.format,P4=hd.formatPrefix,hd}function NH(e){return Math.max(0,-Go(Math.abs(e)))}function OH(e,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Go(n)/3)))*3-Go(Math.abs(e)))}function AH(e,n){return e=Math.abs(e),n=Math.abs(n)-e,Math.max(0,Go(n)-Go(e))+1}function D4(e,n,r,i){var a=Uy(e,n,r),l;switch(i=Wu(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(n));return i.precision==null&&!isNaN(l=OH(a,s))&&(i.precision=l),P4(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(l=AH(a,Math.max(Math.abs(e),Math.abs(n))))&&(i.precision=l-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(l=NH(a))&&(i.precision=l-(i.type==="%")*2);break}}return Ab(i)}function Fa(e){var n=e.domain;return e.ticks=function(r){var i=n();return By(i[0],i[i.length-1],r??10)},e.tickFormat=function(r,i){var a=n();return D4(a[0],a[a.length-1],r??10,i)},e.nice=function(r){r==null&&(r=10);var i=n(),a=0,l=i.length-1,s=i[a],c=i[l],f,d,m=10;for(c<s&&(d=s,s=c,c=d,d=a,a=l,l=d);m-- >0;){if(d=Fy(s,c,r),d===f)return i[a]=s,i[l]=c,n(i);if(d>0)s=Math.floor(s/d)*d,c=Math.ceil(c/d)*d;else if(d<0)s=Math.ceil(s*d)/d,c=Math.floor(c*d)/d;else break;f=d}return e},e}function R4(){var e=Nb();return e.copy=function(){return wc(e,R4())},kr.apply(e,arguments),Fa(e)}function L4(e){var n;function r(i){return i==null||isNaN(i=+i)?n:i}return r.invert=r,r.domain=r.range=function(i){return arguments.length?(e=Array.from(i,sh),r):e.slice()},r.unknown=function(i){return arguments.length?(n=i,r):n},r.copy=function(){return L4(e).unknown(n)},e=arguments.length?Array.from(e,sh):[0,1],Fa(r)}function z4(e,n){e=e.slice();var r=0,i=e.length-1,a=e[r],l=e[i],s;return l<a&&(s=r,r=i,i=s,s=a,a=l,l=s),e[r]=n.floor(a),e[i]=n.ceil(l),e}function Rj(e){return Math.log(e)}function Lj(e){return Math.exp(e)}function TH(e){return-Math.log(-e)}function MH(e){return-Math.exp(-e)}function PH(e){return isFinite(e)?+("1e"+e):e<0?0:e}function DH(e){return e===10?PH:e===Math.E?Math.exp:n=>Math.pow(e,n)}function RH(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),n=>Math.log(n)/e)}function zj(e){return(n,r)=>-e(-n,r)}function Tb(e){const n=e(Rj,Lj),r=n.domain;let i=10,a,l;function s(){return a=RH(i),l=DH(i),r()[0]<0?(a=zj(a),l=zj(l),e(TH,MH)):e(Rj,Lj),n}return n.base=function(c){return arguments.length?(i=+c,s()):i},n.domain=function(c){return arguments.length?(r(c),s()):r()},n.ticks=c=>{const f=r();let d=f[0],m=f[f.length-1];const p=m<d;p&&([d,m]=[m,d]);let y=a(d),x=a(m),_,S;const k=c==null?10:+c;let j=[];if(!(i%1)&&x-y<k){if(y=Math.floor(y),x=Math.ceil(x),d>0){for(;y<=x;++y)for(_=1;_<i;++_)if(S=y<0?_/l(-y):_*l(y),!(S<d)){if(S>m)break;j.push(S)}}else for(;y<=x;++y)for(_=i-1;_>=1;--_)if(S=y>0?_/l(-y):_*l(y),!(S<d)){if(S>m)break;j.push(S)}j.length*2<k&&(j=By(d,m,k))}else j=By(y,x,Math.min(x-y,k)).map(l);return p?j.reverse():j},n.tickFormat=(c,f)=>{if(c==null&&(c=10),f==null&&(f=i===10?"s":","),typeof f!="function"&&(!(i%1)&&(f=Wu(f)).precision==null&&(f.trim=!0),f=Ab(f)),c===1/0)return f;const d=Math.max(1,i*c/n.ticks().length);return m=>{let p=m/l(Math.round(a(m)));return p*i<i-.5&&(p*=i),p<=d?f(m):""}},n.nice=()=>r(z4(r(),{floor:c=>l(Math.floor(a(c))),ceil:c=>l(Math.ceil(a(c)))})),n}function I4(){const e=Tb(hm()).domain([1,10]);return e.copy=()=>wc(e,I4()).base(e.base()),kr.apply(e,arguments),e}function Ij(e){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/e))}}function $j(e){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*e}}function Mb(e){var n=1,r=e(Ij(n),$j(n));return r.constant=function(i){return arguments.length?e(Ij(n=+i),$j(n)):n},Fa(r)}function $4(){var e=Mb(hm());return e.copy=function(){return wc(e,$4()).constant(e.constant())},kr.apply(e,arguments)}function Bj(e){return function(n){return n<0?-Math.pow(-n,e):Math.pow(n,e)}}function LH(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zH(e){return e<0?-e*e:e*e}function Pb(e){var n=e(vn,vn),r=1;function i(){return r===1?e(vn,vn):r===.5?e(LH,zH):e(Bj(r),Bj(1/r))}return n.exponent=function(a){return arguments.length?(r=+a,i()):r},Fa(n)}function Db(){var e=Pb(hm());return e.copy=function(){return wc(e,Db()).exponent(e.exponent())},kr.apply(e,arguments),e}function IH(){return Db.apply(null,arguments).exponent(.5)}function Fj(e){return Math.sign(e)*e*e}function $H(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function B4(){var e=Nb(),n=[0,1],r=!1,i;function a(l){var s=$H(e(l));return isNaN(s)?i:r?Math.round(s):s}return a.invert=function(l){return e.invert(Fj(l))},a.domain=function(l){return arguments.length?(e.domain(l),a):e.domain()},a.range=function(l){return arguments.length?(e.range((n=Array.from(l,sh)).map(Fj)),a):n.slice()},a.rangeRound=function(l){return a.range(l).round(!0)},a.round=function(l){return arguments.length?(r=!!l,a):r},a.clamp=function(l){return arguments.length?(e.clamp(l),a):e.clamp()},a.unknown=function(l){return arguments.length?(i=l,a):i},a.copy=function(){return B4(e.domain(),n).round(r).clamp(e.clamp()).unknown(i)},kr.apply(a,arguments),Fa(a)}function F4(){var e=[],n=[],r=[],i;function a(){var s=0,c=Math.max(1,n.length);for(r=new Array(c-1);++s<c;)r[s-1]=VB(e,s/c);return l}function l(s){return s==null||isNaN(s=+s)?i:n[xc(r,s)]}return l.invertExtent=function(s){var c=n.indexOf(s);return c<0?[NaN,NaN]:[c>0?r[c-1]:e[0],c<r.length?r[c]:e[e.length-1]]},l.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let c of s)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(za),a()},l.range=function(s){return arguments.length?(n=Array.from(s),a()):n.slice()},l.unknown=function(s){return arguments.length?(i=s,l):i},l.quantiles=function(){return r.slice()},l.copy=function(){return F4().domain(e).range(n).unknown(i)},kr.apply(l,arguments)}function U4(){var e=0,n=1,r=1,i=[.5],a=[0,1],l;function s(f){return f!=null&&f<=f?a[xc(i,f,0,r)]:l}function c(){var f=-1;for(i=new Array(r);++f<r;)i[f]=((f+1)*n-(f-r)*e)/(r+1);return s}return s.domain=function(f){return arguments.length?([e,n]=f,e=+e,n=+n,c()):[e,n]},s.range=function(f){return arguments.length?(r=(a=Array.from(f)).length-1,c()):a.slice()},s.invertExtent=function(f){var d=a.indexOf(f);return d<0?[NaN,NaN]:d<1?[e,i[0]]:d>=r?[i[r-1],n]:[i[d-1],i[d]]},s.unknown=function(f){return arguments.length&&(l=f),s},s.thresholds=function(){return i.slice()},s.copy=function(){return U4().domain([e,n]).range(a).unknown(l)},kr.apply(Fa(s),arguments)}function q4(){var e=[.5],n=[0,1],r,i=1;function a(l){return l!=null&&l<=l?n[xc(e,l,0,i)]:r}return a.domain=function(l){return arguments.length?(e=Array.from(l),i=Math.min(e.length,n.length-1),a):e.slice()},a.range=function(l){return arguments.length?(n=Array.from(l),i=Math.min(e.length,n.length-1),a):n.slice()},a.invertExtent=function(l){var s=n.indexOf(l);return[e[s-1],e[s]]},a.unknown=function(l){return arguments.length?(r=l,a):r},a.copy=function(){return q4().domain(e).range(n).unknown(r)},kr.apply(a,arguments)}const Pv=new Date,Dv=new Date;function Bt(e,n,r,i){function a(l){return e(l=arguments.length===0?new Date:new Date(+l)),l}return a.floor=l=>(e(l=new Date(+l)),l),a.ceil=l=>(e(l=new Date(l-1)),n(l,1),e(l),l),a.round=l=>{const s=a(l),c=a.ceil(l);return l-s<c-l?s:c},a.offset=(l,s)=>(n(l=new Date(+l),s==null?1:Math.floor(s)),l),a.range=(l,s,c)=>{const f=[];if(l=a.ceil(l),c=c==null?1:Math.floor(c),!(l<s)||!(c>0))return f;let d;do f.push(d=new Date(+l)),n(l,c),e(l);while(d<l&&l<s);return f},a.filter=l=>Bt(s=>{if(s>=s)for(;e(s),!l(s);)s.setTime(s-1)},(s,c)=>{if(s>=s)if(c<0)for(;++c<=0;)for(;n(s,-1),!l(s););else for(;--c>=0;)for(;n(s,1),!l(s););}),r&&(a.count=(l,s)=>(Pv.setTime(+l),Dv.setTime(+s),e(Pv),e(Dv),Math.floor(r(Pv,Dv))),a.every=l=>(l=Math.floor(l),!isFinite(l)||!(l>0)?null:l>1?a.filter(i?s=>i(s)%l===0:s=>a.count(0,s)%l===0):a)),a}const fh=Bt(()=>{},(e,n)=>{e.setTime(+e+n)},(e,n)=>n-e);fh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Bt(n=>{n.setTime(Math.floor(n/e)*e)},(n,r)=>{n.setTime(+n+r*e)},(n,r)=>(r-n)/e):fh);fh.range;const $i=1e3,vr=$i*60,Bi=vr*60,Ki=Bi*24,Rb=Ki*7,Uj=Ki*30,Rv=Ki*365,xl=Bt(e=>{e.setTime(e-e.getMilliseconds())},(e,n)=>{e.setTime(+e+n*$i)},(e,n)=>(n-e)/$i,e=>e.getUTCSeconds());xl.range;const Lb=Bt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$i)},(e,n)=>{e.setTime(+e+n*vr)},(e,n)=>(n-e)/vr,e=>e.getMinutes());Lb.range;const zb=Bt(e=>{e.setUTCSeconds(0,0)},(e,n)=>{e.setTime(+e+n*vr)},(e,n)=>(n-e)/vr,e=>e.getUTCMinutes());zb.range;const Ib=Bt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$i-e.getMinutes()*vr)},(e,n)=>{e.setTime(+e+n*Bi)},(e,n)=>(n-e)/Bi,e=>e.getHours());Ib.range;const $b=Bt(e=>{e.setUTCMinutes(0,0,0)},(e,n)=>{e.setTime(+e+n*Bi)},(e,n)=>(n-e)/Bi,e=>e.getUTCHours());$b.range;const _c=Bt(e=>e.setHours(0,0,0,0),(e,n)=>e.setDate(e.getDate()+n),(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*vr)/Ki,e=>e.getDate()-1);_c.range;const mm=Bt(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/Ki,e=>e.getUTCDate()-1);mm.range;const H4=Bt(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/Ki,e=>Math.floor(e/Ki));H4.range;function Rl(e){return Bt(n=>{n.setDate(n.getDate()-(n.getDay()+7-e)%7),n.setHours(0,0,0,0)},(n,r)=>{n.setDate(n.getDate()+r*7)},(n,r)=>(r-n-(r.getTimezoneOffset()-n.getTimezoneOffset())*vr)/Rb)}const pm=Rl(0),dh=Rl(1),BH=Rl(2),FH=Rl(3),Ko=Rl(4),UH=Rl(5),qH=Rl(6);pm.range;dh.range;BH.range;FH.range;Ko.range;UH.range;qH.range;function Ll(e){return Bt(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-e)%7),n.setUTCHours(0,0,0,0)},(n,r)=>{n.setUTCDate(n.getUTCDate()+r*7)},(n,r)=>(r-n)/Rb)}const gm=Ll(0),hh=Ll(1),HH=Ll(2),GH=Ll(3),Vo=Ll(4),KH=Ll(5),VH=Ll(6);gm.range;hh.range;HH.range;GH.range;Vo.range;KH.range;VH.range;const Bb=Bt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,n)=>{e.setMonth(e.getMonth()+n)},(e,n)=>n.getMonth()-e.getMonth()+(n.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Bb.range;const Fb=Bt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCMonth(e.getUTCMonth()+n)},(e,n)=>n.getUTCMonth()-e.getUTCMonth()+(n.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Fb.range;const Vi=Bt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n)},(e,n)=>n.getFullYear()-e.getFullYear(),e=>e.getFullYear());Vi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Bt(n=>{n.setFullYear(Math.floor(n.getFullYear()/e)*e),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,r)=>{n.setFullYear(n.getFullYear()+r*e)});Vi.range;const Yi=Bt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n)},(e,n)=>n.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Yi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Bt(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/e)*e),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,r)=>{n.setUTCFullYear(n.getUTCFullYear()+r*e)});Yi.range;function G4(e,n,r,i,a,l){const s=[[xl,1,$i],[xl,5,5*$i],[xl,15,15*$i],[xl,30,30*$i],[l,1,vr],[l,5,5*vr],[l,15,15*vr],[l,30,30*vr],[a,1,Bi],[a,3,3*Bi],[a,6,6*Bi],[a,12,12*Bi],[i,1,Ki],[i,2,2*Ki],[r,1,Rb],[n,1,Uj],[n,3,3*Uj],[e,1,Rv]];function c(d,m,p){const y=m<d;y&&([d,m]=[m,d]);const x=p&&typeof p.range=="function"?p:f(d,m,p),_=x?x.range(d,+m+1):[];return y?_.reverse():_}function f(d,m,p){const y=Math.abs(m-d)/p,x=pb(([,,k])=>k).right(s,y);if(x===s.length)return e.every(Uy(d/Rv,m/Rv,p));if(x===0)return fh.every(Math.max(Uy(d,m,p),1));const[_,S]=s[y/s[x-1][2]<s[x][2]/y?x-1:x];return _.every(S)}return[c,f]}const[YH,WH]=G4(Yi,Fb,gm,H4,$b,zb),[XH,ZH]=G4(Vi,Bb,pm,_c,Ib,Lb);function Lv(e){if(0<=e.y&&e.y<100){var n=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return n.setFullYear(e.y),n}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function zv(e){if(0<=e.y&&e.y<100){var n=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return n.setUTCFullYear(e.y),n}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function xu(e,n,r){return{y:e,m:n,d:r,H:0,M:0,S:0,L:0}}function QH(e){var n=e.dateTime,r=e.date,i=e.time,a=e.periods,l=e.days,s=e.shortDays,c=e.months,f=e.shortMonths,d=bu(a),m=wu(a),p=bu(l),y=wu(l),x=bu(s),_=wu(s),S=bu(c),k=wu(c),j=bu(f),C=wu(f),N={a:Y,A:ee,b:H,B:re,c:null,d:Yj,e:Yj,f:wG,g:TG,G:PG,H:yG,I:xG,j:bG,L:K4,m:_G,M:kG,p:F,q:X,Q:Zj,s:Qj,S:SG,u:jG,U:EG,V:CG,w:NG,W:OG,x:null,X:null,y:AG,Y:MG,Z:DG,"%":Xj},O={a:ae,A:se,b:ve,B:we,c:null,d:Wj,e:Wj,f:IG,g:YG,G:XG,H:RG,I:LG,j:zG,L:Y4,m:$G,M:BG,p:ce,q:Se,Q:Zj,s:Qj,S:FG,u:UG,U:qG,V:HG,w:GG,W:KG,x:null,X:null,y:VG,Y:WG,Z:ZG,"%":Xj},T={a:D,A:U,b:q,B:L,c:$,d:Kj,e:Kj,f:mG,g:Gj,G:Hj,H:Vj,I:Vj,j:cG,L:hG,m:uG,M:fG,p:z,q:sG,Q:gG,s:vG,S:dG,u:rG,U:iG,V:aG,w:nG,W:lG,x:G,X:B,y:Gj,Y:Hj,Z:oG,"%":pG};N.x=A(r,N),N.X=A(i,N),N.c=A(n,N),O.x=A(r,O),O.X=A(i,O),O.c=A(n,O);function A(me,pe){return function(Ee){var he=[],Be=-1,Me=0,J=me.length,ye,K,ge;for(Ee instanceof Date||(Ee=new Date(+Ee));++Be<J;)me.charCodeAt(Be)===37&&(he.push(me.slice(Me,Be)),(K=qj[ye=me.charAt(++Be)])!=null?ye=me.charAt(++Be):K=ye==="e"?" ":"0",(ge=pe[ye])&&(ye=ge(Ee,K)),he.push(ye),Me=Be+1);return he.push(me.slice(Me,Be)),he.join("")}}function P(me,pe){return function(Ee){var he=xu(1900,void 0,1),Be=R(he,me,Ee+="",0),Me,J;if(Be!=Ee.length)return null;if("Q"in he)return new Date(he.Q);if("s"in he)return new Date(he.s*1e3+("L"in he?he.L:0));if(pe&&!("Z"in he)&&(he.Z=0),"p"in he&&(he.H=he.H%12+he.p*12),he.m===void 0&&(he.m="q"in he?he.q:0),"V"in he){if(he.V<1||he.V>53)return null;"w"in he||(he.w=1),"Z"in he?(Me=zv(xu(he.y,0,1)),J=Me.getUTCDay(),Me=J>4||J===0?hh.ceil(Me):hh(Me),Me=mm.offset(Me,(he.V-1)*7),he.y=Me.getUTCFullYear(),he.m=Me.getUTCMonth(),he.d=Me.getUTCDate()+(he.w+6)%7):(Me=Lv(xu(he.y,0,1)),J=Me.getDay(),Me=J>4||J===0?dh.ceil(Me):dh(Me),Me=_c.offset(Me,(he.V-1)*7),he.y=Me.getFullYear(),he.m=Me.getMonth(),he.d=Me.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),J="Z"in he?zv(xu(he.y,0,1)).getUTCDay():Lv(xu(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(J+5)%7:he.w+he.U*7-(J+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,zv(he)):Lv(he)}}function R(me,pe,Ee,he){for(var Be=0,Me=pe.length,J=Ee.length,ye,K;Be<Me;){if(he>=J)return-1;if(ye=pe.charCodeAt(Be++),ye===37){if(ye=pe.charAt(Be++),K=T[ye in qj?pe.charAt(Be++):ye],!K||(he=K(me,Ee,he))<0)return-1}else if(ye!=Ee.charCodeAt(he++))return-1}return he}function z(me,pe,Ee){var he=d.exec(pe.slice(Ee));return he?(me.p=m.get(he[0].toLowerCase()),Ee+he[0].length):-1}function D(me,pe,Ee){var he=x.exec(pe.slice(Ee));return he?(me.w=_.get(he[0].toLowerCase()),Ee+he[0].length):-1}function U(me,pe,Ee){var he=p.exec(pe.slice(Ee));return he?(me.w=y.get(he[0].toLowerCase()),Ee+he[0].length):-1}function q(me,pe,Ee){var he=j.exec(pe.slice(Ee));return he?(me.m=C.get(he[0].toLowerCase()),Ee+he[0].length):-1}function L(me,pe,Ee){var he=S.exec(pe.slice(Ee));return he?(me.m=k.get(he[0].toLowerCase()),Ee+he[0].length):-1}function $(me,pe,Ee){return R(me,n,pe,Ee)}function G(me,pe,Ee){return R(me,r,pe,Ee)}function B(me,pe,Ee){return R(me,i,pe,Ee)}function Y(me){return s[me.getDay()]}function ee(me){return l[me.getDay()]}function H(me){return f[me.getMonth()]}function re(me){return c[me.getMonth()]}function F(me){return a[+(me.getHours()>=12)]}function X(me){return 1+~~(me.getMonth()/3)}function ae(me){return s[me.getUTCDay()]}function se(me){return l[me.getUTCDay()]}function ve(me){return f[me.getUTCMonth()]}function we(me){return c[me.getUTCMonth()]}function ce(me){return a[+(me.getUTCHours()>=12)]}function Se(me){return 1+~~(me.getUTCMonth()/3)}return{format:function(me){var pe=A(me+="",N);return pe.toString=function(){return me},pe},parse:function(me){var pe=P(me+="",!1);return pe.toString=function(){return me},pe},utcFormat:function(me){var pe=A(me+="",O);return pe.toString=function(){return me},pe},utcParse:function(me){var pe=P(me+="",!0);return pe.toString=function(){return me},pe}}}var qj={"-":"",_:" ",0:"0"},Kt=/^\s*\d+/,JH=/^%/,eG=/[\\^$*+?|[\]().{}]/g;function Xe(e,n,r){var i=e<0?"-":"",a=(i?-e:e)+"",l=a.length;return i+(l<r?new Array(r-l+1).join(n)+a:a)}function tG(e){return e.replace(eG,"\\$&")}function bu(e){return new RegExp("^(?:"+e.map(tG).join("|")+")","i")}function wu(e){return new Map(e.map((n,r)=>[n.toLowerCase(),r]))}function nG(e,n,r){var i=Kt.exec(n.slice(r,r+1));return i?(e.w=+i[0],r+i[0].length):-1}function rG(e,n,r){var i=Kt.exec(n.slice(r,r+1));return i?(e.u=+i[0],r+i[0].length):-1}function iG(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.U=+i[0],r+i[0].length):-1}function aG(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.V=+i[0],r+i[0].length):-1}function lG(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.W=+i[0],r+i[0].length):-1}function Hj(e,n,r){var i=Kt.exec(n.slice(r,r+4));return i?(e.y=+i[0],r+i[0].length):-1}function Gj(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),r+i[0].length):-1}function oG(e,n,r){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(r,r+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),r+i[0].length):-1}function sG(e,n,r){var i=Kt.exec(n.slice(r,r+1));return i?(e.q=i[0]*3-3,r+i[0].length):-1}function uG(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.m=i[0]-1,r+i[0].length):-1}function Kj(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.d=+i[0],r+i[0].length):-1}function cG(e,n,r){var i=Kt.exec(n.slice(r,r+3));return i?(e.m=0,e.d=+i[0],r+i[0].length):-1}function Vj(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.H=+i[0],r+i[0].length):-1}function fG(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.M=+i[0],r+i[0].length):-1}function dG(e,n,r){var i=Kt.exec(n.slice(r,r+2));return i?(e.S=+i[0],r+i[0].length):-1}function hG(e,n,r){var i=Kt.exec(n.slice(r,r+3));return i?(e.L=+i[0],r+i[0].length):-1}function mG(e,n,r){var i=Kt.exec(n.slice(r,r+6));return i?(e.L=Math.floor(i[0]/1e3),r+i[0].length):-1}function pG(e,n,r){var i=JH.exec(n.slice(r,r+1));return i?r+i[0].length:-1}function gG(e,n,r){var i=Kt.exec(n.slice(r));return i?(e.Q=+i[0],r+i[0].length):-1}function vG(e,n,r){var i=Kt.exec(n.slice(r));return i?(e.s=+i[0],r+i[0].length):-1}function Yj(e,n){return Xe(e.getDate(),n,2)}function yG(e,n){return Xe(e.getHours(),n,2)}function xG(e,n){return Xe(e.getHours()%12||12,n,2)}function bG(e,n){return Xe(1+_c.count(Vi(e),e),n,3)}function K4(e,n){return Xe(e.getMilliseconds(),n,3)}function wG(e,n){return K4(e,n)+"000"}function _G(e,n){return Xe(e.getMonth()+1,n,2)}function kG(e,n){return Xe(e.getMinutes(),n,2)}function SG(e,n){return Xe(e.getSeconds(),n,2)}function jG(e){var n=e.getDay();return n===0?7:n}function EG(e,n){return Xe(pm.count(Vi(e)-1,e),n,2)}function V4(e){var n=e.getDay();return n>=4||n===0?Ko(e):Ko.ceil(e)}function CG(e,n){return e=V4(e),Xe(Ko.count(Vi(e),e)+(Vi(e).getDay()===4),n,2)}function NG(e){return e.getDay()}function OG(e,n){return Xe(dh.count(Vi(e)-1,e),n,2)}function AG(e,n){return Xe(e.getFullYear()%100,n,2)}function TG(e,n){return e=V4(e),Xe(e.getFullYear()%100,n,2)}function MG(e,n){return Xe(e.getFullYear()%1e4,n,4)}function PG(e,n){var r=e.getDay();return e=r>=4||r===0?Ko(e):Ko.ceil(e),Xe(e.getFullYear()%1e4,n,4)}function DG(e){var n=e.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Xe(n/60|0,"0",2)+Xe(n%60,"0",2)}function Wj(e,n){return Xe(e.getUTCDate(),n,2)}function RG(e,n){return Xe(e.getUTCHours(),n,2)}function LG(e,n){return Xe(e.getUTCHours()%12||12,n,2)}function zG(e,n){return Xe(1+mm.count(Yi(e),e),n,3)}function Y4(e,n){return Xe(e.getUTCMilliseconds(),n,3)}function IG(e,n){return Y4(e,n)+"000"}function $G(e,n){return Xe(e.getUTCMonth()+1,n,2)}function BG(e,n){return Xe(e.getUTCMinutes(),n,2)}function FG(e,n){return Xe(e.getUTCSeconds(),n,2)}function UG(e){var n=e.getUTCDay();return n===0?7:n}function qG(e,n){return Xe(gm.count(Yi(e)-1,e),n,2)}function W4(e){var n=e.getUTCDay();return n>=4||n===0?Vo(e):Vo.ceil(e)}function HG(e,n){return e=W4(e),Xe(Vo.count(Yi(e),e)+(Yi(e).getUTCDay()===4),n,2)}function GG(e){return e.getUTCDay()}function KG(e,n){return Xe(hh.count(Yi(e)-1,e),n,2)}function VG(e,n){return Xe(e.getUTCFullYear()%100,n,2)}function YG(e,n){return e=W4(e),Xe(e.getUTCFullYear()%100,n,2)}function WG(e,n){return Xe(e.getUTCFullYear()%1e4,n,4)}function XG(e,n){var r=e.getUTCDay();return e=r>=4||r===0?Vo(e):Vo.ceil(e),Xe(e.getUTCFullYear()%1e4,n,4)}function ZG(){return"+0000"}function Xj(){return"%"}function Zj(e){return+e}function Qj(e){return Math.floor(+e/1e3)}var Eo,X4,Z4;QG({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 QG(e){return Eo=QH(e),X4=Eo.format,Eo.parse,Z4=Eo.utcFormat,Eo.utcParse,Eo}function JG(e){return new Date(e)}function eK(e){return e instanceof Date?+e:+new Date(+e)}function Ub(e,n,r,i,a,l,s,c,f,d){var m=Nb(),p=m.invert,y=m.domain,x=d(".%L"),_=d(":%S"),S=d("%I:%M"),k=d("%I %p"),j=d("%a %d"),C=d("%b %d"),N=d("%B"),O=d("%Y");function T(A){return(f(A)<A?x:c(A)<A?_:s(A)<A?S:l(A)<A?k:i(A)<A?a(A)<A?j:C:r(A)<A?N:O)(A)}return m.invert=function(A){return new Date(p(A))},m.domain=function(A){return arguments.length?y(Array.from(A,eK)):y().map(JG)},m.ticks=function(A){var P=y();return e(P[0],P[P.length-1],A??10)},m.tickFormat=function(A,P){return P==null?T:d(P)},m.nice=function(A){var P=y();return(!A||typeof A.range!="function")&&(A=n(P[0],P[P.length-1],A??10)),A?y(z4(P,A)):m},m.copy=function(){return wc(m,Ub(e,n,r,i,a,l,s,c,f,d))},m}function tK(){return kr.apply(Ub(XH,ZH,Vi,Bb,pm,_c,Ib,Lb,xl,X4).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function nK(){return kr.apply(Ub(YH,WH,Yi,Fb,gm,mm,$b,zb,xl,Z4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vm(){var e=0,n=1,r,i,a,l,s=vn,c=!1,f;function d(p){return p==null||isNaN(p=+p)?f:s(a===0?.5:(p=(l(p)-r)*a,c?Math.max(0,Math.min(1,p)):p))}d.domain=function(p){return arguments.length?([e,n]=p,r=l(e=+e),i=l(n=+n),a=r===i?0:1/(i-r),d):[e,n]},d.clamp=function(p){return arguments.length?(c=!!p,d):c},d.interpolator=function(p){return arguments.length?(s=p,d):s};function m(p){return function(y){var x,_;return arguments.length?([x,_]=y,s=p(x,_),d):[s(0),s(1)]}}return d.range=m(ns),d.rangeRound=m(ub),d.unknown=function(p){return arguments.length?(f=p,d):f},function(p){return l=p,r=p(e),i=p(n),a=r===i?0:1/(i-r),d}}function Ua(e,n){return n.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q4(){var e=Fa(vm()(vn));return e.copy=function(){return Ua(e,Q4())},Ji.apply(e,arguments)}function J4(){var e=Tb(vm()).domain([1,10]);return e.copy=function(){return Ua(e,J4()).base(e.base())},Ji.apply(e,arguments)}function e3(){var e=Mb(vm());return e.copy=function(){return Ua(e,e3()).constant(e.constant())},Ji.apply(e,arguments)}function qb(){var e=Pb(vm());return e.copy=function(){return Ua(e,qb()).exponent(e.exponent())},Ji.apply(e,arguments)}function rK(){return qb.apply(null,arguments).exponent(.5)}function t3(){var e=[],n=vn;function r(i){if(i!=null&&!isNaN(i=+i))return n((xc(e,i,1)-1)/(e.length-1))}return r.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let a of i)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(za),r},r.interpolator=function(i){return arguments.length?(n=i,r):n},r.range=function(){return e.map((i,a)=>n(a/(e.length-1)))},r.quantiles=function(i){return Array.from({length:i+1},(a,l)=>KB(e,l/i))},r.copy=function(){return t3(n).domain(e)},Ji.apply(r,arguments)}function ym(){var e=0,n=.5,r=1,i=1,a,l,s,c,f,d=vn,m,p=!1,y;function x(S){return isNaN(S=+S)?y:(S=.5+((S=+m(S))-l)*(i*S<i*l?c:f),d(p?Math.max(0,Math.min(1,S)):S))}x.domain=function(S){return arguments.length?([e,n,r]=S,a=m(e=+e),l=m(n=+n),s=m(r=+r),c=a===l?0:.5/(l-a),f=l===s?0:.5/(s-l),i=l<a?-1:1,x):[e,n,r]},x.clamp=function(S){return arguments.length?(p=!!S,x):p},x.interpolator=function(S){return arguments.length?(d=S,x):d};function _(S){return function(k){var j,C,N;return arguments.length?([j,C,N]=k,d=g$(S,[j,C,N]),x):[d(0),d(.5),d(1)]}}return x.range=_(ns),x.rangeRound=_(ub),x.unknown=function(S){return arguments.length?(y=S,x):y},function(S){return m=S,a=S(e),l=S(n),s=S(r),c=a===l?0:.5/(l-a),f=l===s?0:.5/(s-l),i=l<a?-1:1,x}}function n3(){var e=Fa(ym()(vn));return e.copy=function(){return Ua(e,n3())},Ji.apply(e,arguments)}function r3(){var e=Tb(ym()).domain([.1,1,10]);return e.copy=function(){return Ua(e,r3()).base(e.base())},Ji.apply(e,arguments)}function i3(){var e=Mb(ym());return e.copy=function(){return Ua(e,i3()).constant(e.constant())},Ji.apply(e,arguments)}function Hb(){var e=Pb(ym());return e.copy=function(){return Ua(e,Hb()).exponent(e.exponent())},Ji.apply(e,arguments)}function iK(){return Hb.apply(null,arguments).exponent(.5)}function aK(e){for(var n=e.length/6|0,r=new Array(n),i=0;i<n;)r[i]="#"+e.slice(i*6,++i*6);return r}const lK=aK("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function oK(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",r==="top"&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}var sK=`.force-graph-container canvas {
84
+ display: block;
85
+ user-select: none;
86
+ outline: none;
87
+ -webkit-tap-highlight-color: transparent;
88
+ }
89
+
90
+ .force-graph-container .clickable {
91
+ cursor: pointer;
92
+ }
93
+
94
+ .force-graph-container .grabbable {
95
+ cursor: move;
96
+ cursor: grab;
97
+ cursor: -moz-grab;
98
+ cursor: -webkit-grab;
99
+ }
100
+
101
+ .force-graph-container .grabbable:active {
102
+ cursor: grabbing;
103
+ cursor: -moz-grabbing;
104
+ cursor: -webkit-grabbing;
105
+ }
106
+ `;oK(sK);function ex(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function uK(e){if(Array.isArray(e))return e}function cK(e){if(Array.isArray(e))return ex(e)}function Jj(e,n,r){if(a3())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,n);var a=new(e.bind.apply(e,i));return a}function Xu(e,n,r){return(n=gK(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function a3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(a3=function(){return!!e})()}function fK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dK(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,a,l,s,c=[],f=!0,d=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(f=(i=l.call(r)).done)&&(c.push(i.value),c.length!==n);f=!0);}catch(m){d=!0,a=m}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw a}}return c}}function hK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
107
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
108
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eE(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Co(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?eE(Object(r),!0).forEach(function(i){Xu(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eE(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Fu(e,n){return uK(e)||dK(e,n)||l3(e,n)||hK()}function gr(e){return cK(e)||fK(e)||l3(e)||mK()}function pK(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function gK(e){var n=pK(e,"string");return typeof n=="symbol"?n:n+""}function tx(e){"@babel/helpers - typeof";return tx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},tx(e)}function l3(e,n){if(e){if(typeof e=="string")return ex(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ex(e,n):void 0}}var vK=dm(lK);function tE(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=vK(n(i))})}function yK(e,n){var r=e.nodes,i=e.links,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=a.nodeFilter,s=l===void 0?function(){return!0}:l,c=a.onLoopError,f=c===void 0?function(x){throw"Invalid DAG structure! Found cycle in node path: ".concat(x.join(" -> "),".")}:c,d={};r.forEach(function(x){return d[n(x)]={data:x,out:[],depth:-1,skip:!s(x)}}),i.forEach(function(x){var _=x.source,S=x.target,k=O(_),j=O(S);if(!d.hasOwnProperty(k))throw"Missing source node with id: ".concat(k);if(!d.hasOwnProperty(j))throw"Missing target node with id: ".concat(j);var C=d[k],N=d[j];C.out.push(N);function O(T){return tx(T)==="object"?n(T):T}});var m=[];y(Object.values(d));var p=Object.assign.apply(Object,[{}].concat(gr(Object.entries(d).filter(function(x){var _=Fu(x,2),S=_[1];return!S.skip}).map(function(x){var _=Fu(x,2),S=_[0],k=_[1];return Xu({},S,k.depth)}))));return p;function y(x){for(var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,k=function(){var O=x[j];if(_.indexOf(O)!==-1){var T=[].concat(gr(_.slice(_.indexOf(O))),[O]).map(function(A){return n(A.data)});return m.some(function(A){return A.length===T.length&&A.every(function(P,R){return P===T[R]})})||(m.push(T),f(T)),1}S>O.depth&&(O.depth=S,y(O.out,[].concat(gr(_),[O]),S+(O.skip?0:1)))},j=0,C=x.length;j<C;j++)k()}}var xK=2,sn=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},nE=function(n,r){if(!r.isShadow){var i=et(r.linkDirectionalParticles);r.graphData.links.forEach(function(a){var l=Math.round(Math.abs(i(a)));l?a.__photons=gr(Array(l)).map(function(){return{}}):delete a.__photons})}},mh=gb({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,nE(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:sn},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:sn},nodeColor:{default:"color",triggerUpdate:!1,onChange:sn},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:sn},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:sn},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:sn},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:sn},linkColor:{default:"color",triggerUpdate:!1,onChange:sn},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:sn},linkWidth:{default:1,triggerUpdate:!1,onChange:sn},linkCurvature:{default:0,triggerUpdate:!1,onChange:sn},linkCanvasObject:{triggerUpdate:!1,onChange:sn},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:sn},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:sn},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:sn},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:sn},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:nE},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),a(),!n.isShadow&&l(),!n.isShadow&&s(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var c=et(n.nodeVisibility),f=et(n.nodeVal),d=et(n.nodeColor),m=et(n.nodeCanvasObjectMode),p=n.ctx,y=n.isShadow/n.globalScale,x=n.graphData.nodes.filter(c);p.save(),x.forEach(function(_){var S=m(_);if(n.nodeCanvasObject&&(S==="before"||S==="replace")&&(n.nodeCanvasObject(_,p,n.globalScale),S==="replace")){p.restore();return}var k=Math.sqrt(Math.max(0,f(_)||1))*n.nodeRelSize+y;p.beginPath(),p.arc(_.x,_.y,k,0,2*Math.PI,!1),p.fillStyle=d(_)||"rgba(31, 120, 180, 0.92)",p.fill(),n.nodeCanvasObject&&S==="after"&&n.nodeCanvasObject(_,n.ctx,n.globalScale)}),p.restore()}function a(){var c=et(n.linkVisibility),f=et(n.linkColor),d=et(n.linkWidth),m=et(n.linkLineDash),p=et(n.linkCurvature),y=et(n.linkCanvasObjectMode),x=n.ctx,_=n.isShadow*2,S=n.graphData.links.filter(c);S.forEach(A);var k=[],j=[],C=S;if(n.linkCanvasObject){var N=[],O=[];S.forEach(function(P){return({before:k,after:j,replace:N}[y(P)]||O).push(P)}),C=[].concat(gr(k),j,O),k=k.concat(N)}x.save(),k.forEach(function(P){return n.linkCanvasObject(P,x,n.globalScale)}),x.restore();var T=mH(C,[f,d,m]);x.save(),Object.entries(T).forEach(function(P){var R=Fu(P,2),z=R[0],D=R[1],U=!z||z==="undefined"?"rgba(0,0,0,0.15)":z;Object.entries(D).forEach(function(q){var L=Fu(q,2),$=L[0],G=L[1],B=($||1)/n.globalScale+_;Object.entries(G).forEach(function(Y){var ee=Fu(Y,2);ee[0];var H=ee[1],re=m(H[0]);x.beginPath(),H.forEach(function(F){var X=F.source,ae=F.target;if(!(!X||!ae||!X.hasOwnProperty("x")||!ae.hasOwnProperty("x"))){x.moveTo(X.x,X.y);var se=F.__controlPoints;se?x[se.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(x,gr(se).concat([ae.x,ae.y])):x.lineTo(ae.x,ae.y)}}),x.strokeStyle=U,x.lineWidth=B,x.setLineDash(re||[]),x.stroke()})})}),x.restore(),x.save(),j.forEach(function(P){return n.linkCanvasObject(P,x,n.globalScale)}),x.restore();function A(P){var R=p(P);if(!R){P.__controlPoints=null;return}var z=P.source,D=P.target;if(!(!z||!D||!z.hasOwnProperty("x")||!D.hasOwnProperty("x"))){var U=Math.sqrt(Math.pow(D.x-z.x,2)+Math.pow(D.y-z.y,2));if(U>0){var q=Math.atan2(D.y-z.y,D.x-z.x),L=U*R,$={x:(z.x+D.x)/2+L*Math.cos(q-Math.PI/2),y:(z.y+D.y)/2+L*Math.sin(q-Math.PI/2)};P.__controlPoints=[$.x,$.y]}else{var G=R*70;P.__controlPoints=[D.x,D.y-G,D.x+G,D.y]}}}}function l(){var c=1.6,f=.2,d=et(n.linkDirectionalArrowLength),m=et(n.linkDirectionalArrowRelPos),p=et(n.linkVisibility),y=et(n.linkDirectionalArrowColor||n.linkColor),x=et(n.nodeVal),_=n.ctx;_.save(),n.graphData.links.filter(p).forEach(function(S){var k=d(S);if(!(!k||k<0)){var j=S.source,C=S.target;if(!(!j||!C||!j.hasOwnProperty("x")||!C.hasOwnProperty("x"))){var N=Math.sqrt(Math.max(0,x(j)||1))*n.nodeRelSize,O=Math.sqrt(Math.max(0,x(C)||1))*n.nodeRelSize,T=Math.min(1,Math.max(0,m(S))),A=y(S)||"rgba(0,0,0,0.28)",P=k/c/2,R=S.__controlPoints&&Jj(mt,[j.x,j.y].concat(gr(S.__controlPoints),[C.x,C.y])),z=R?function(B){return R.get(B)}:function(B){return{x:j.x+(C.x-j.x)*B||0,y:j.y+(C.y-j.y)*B||0}},D=R?R.length():Math.sqrt(Math.pow(C.x-j.x,2)+Math.pow(C.y-j.y,2)),U=N+k+(D-N-O-k)*T,q=z(U/D),L=z((U-k)/D),$=z((U-k*(1-f))/D),G=Math.atan2(q.y-L.y,q.x-L.x)-Math.PI/2;_.beginPath(),_.moveTo(q.x,q.y),_.lineTo(L.x+P*Math.cos(G),L.y+P*Math.sin(G)),_.lineTo($.x,$.y),_.lineTo(L.x-P*Math.cos(G),L.y-P*Math.sin(G)),_.fillStyle=A,_.fill()}}}),_.restore()}function s(){var c=et(n.linkDirectionalParticles),f=et(n.linkDirectionalParticleSpeed),d=et(n.linkDirectionalParticleOffset),m=et(n.linkDirectionalParticleWidth),p=et(n.linkVisibility),y=et(n.linkDirectionalParticleColor||n.linkColor),x=n.ctx;x.save(),n.graphData.links.filter(p).forEach(function(_){var S=c(_);if(!(!_.hasOwnProperty("__photons")||!_.__photons.length)){var k=_.source,j=_.target;if(!(!k||!j||!k.hasOwnProperty("x")||!j.hasOwnProperty("x"))){var C=f(_),N=Math.abs(d(_)),O=_.__photons||[],T=Math.max(0,m(_)/2)/Math.sqrt(n.globalScale),A=y(_)||"rgba(0,0,0,0.28)";x.fillStyle=A;var P=_.__controlPoints?Jj(mt,[k.x,k.y].concat(gr(_.__controlPoints),[j.x,j.y])):null,R=0,z=!1;O.forEach(function(D){var U=!!D.__singleHop;if(D.hasOwnProperty("__progressRatio")||(D.__progressRatio=U?0:(R+N)/S),!U&&R++,D.__progressRatio+=C,D.__progressRatio>=1)if(!U)D.__progressRatio=D.__progressRatio%1;else{z=!0;return}var q=D.__progressRatio,L=P?P.get(q):{x:k.x+(j.x-k.x)*q||0,y:k.y+(j.y-k.y)*q||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(L.x,L.y,_,x,n.globalScale):(x.beginPath(),x.arc(L.x,L.y,T,0,2*Math.PI,!1),x.fill())}),z&&(_.__photons=_.__photons.filter(function(D){return!D.__singleHop||D.__progressRatio<=1}))}}}),x.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Gq().force("link",zq()).force("charge",Kq()).force("center",IU()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&tE(n.graphData.nodes,et(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&tE(n.graphData.links,et(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(y){y.source=y[n.linkSource],y.target=y[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(y){return y[n.nodeId]}).links(n.graphData.links);var a=n.dagMode&&yK(n.graphData,function(y){return y[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),l=Math.max.apply(Math,gr(Object.values(a||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(l||1)*xK*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var c=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(y){return delete y[c]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var f=["rl","bu"].includes(n.dagMode),d=function(x){return(a[x[n.nodeId]]-l/2)*s*(f?-1:1)},m=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(y){return y[m]=d(y)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?Vq(function(y){var x=a[y[n.nodeId]]||-1;return(n.dagMode==="radialin"?l-x:x)*s}).strength(function(y){return n.dagNodeFilter(y)?1:0}):null);for(var p=0;p<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);p++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function o3(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(l){return{default:i[l](),onChange:function(c,f){r.forEach(function(d){return f[d][l](c)})},triggerUpdate:!1}},linkMethod:function(l){return function(s){for(var c=arguments.length,f=new Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];var m=[];return r.forEach(function(p){var y=s[p],x=y[l].apply(y,f);x!==y&&m.push(x)}),m.length?m[0]:this}}}}var bK=800,wK=4,_K=5,s3=o3("forceGraph",mh),kK=o3(["forceGraph","shadowGraph"],mh),SK=Object.assign.apply(Object,gr(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return Xu({},e,s3.linkProp(e))})).concat(gr(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return Xu({},e,kK.linkProp(e))})))),jK=Object.assign.apply(Object,gr(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return Xu({},e,s3.linkMethod(e))})));function Iv(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(l){l.style.width="".concat(e.width,"px"),l.style.height="".concat(e.height,"px"),l.width=e.width*i,l.height=e.height*i,!n&&!r&&l.getContext("2d").scale(i,i)});var a=Hr(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/a,(e.height-r)/2/a),e.needsRedraw=!0}}function u3(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function rE(e,n,r){e.save(),u3(e),e.clearRect(0,0,n,r),e.restore()}var EK=gb({props:Co({width:{default:window.innerWidth,onChange:function(n,r){return Iv(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return Iv(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(a){return(a||[]).every(function(l){return!l.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(a){var l=a.type,s=a.objs;s.filter(function(c){if(!c.hasOwnProperty("__indexColor"))return!0;var f=r.colorTracker.lookup(c.__indexColor);return!f||!f.hasOwnProperty("d")||f.d!==c}).forEach(function(c){c.__indexColor=r.colorTracker.register({type:l,d:c})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,a,l){return n(i,i.__indexColor,a,l)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,a,l){return n(i,i.__indexColor,a,l)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},SK),aliases:{stopAnimation:"pauseAnimation"},methods:Co({graph2ScreenCoords:function(n,r,i){var a=Hr(n.canvas);return{x:r*a.k+a.x,y:i*a.k+a.y}},screen2GraphCoords:function(n,r,i){var a=Hr(n.canvas);return{x:(r-a.x)/a.k,y:(i-a.y)/a.k}},centerAt:function(n,r,i,a){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var l=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return a?n.tweenGroup.add(new nj(s()).to(l,a).easing(kl.Quadratic.Out).onUpdate(c).onComplete(function(){n.tweenGroup.remove(this)}).start()):c(l),this}return s();function s(){var f=Hr(n.canvas);return{x:(n.width/2-f.x)/f.k,y:(n.height/2-f.y)/f.k}}function c(f){var d=f.x,m=f.y;n.zoom.translateTo(n.zoom.__baseElem,d===void 0?s().x:d,m===void 0?s().y:m),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new nj({k:a()}).to({k:r},i).easing(kl.Quadratic.Out).onUpdate(function(s){var c=s.k;return l(c)}).onComplete(function(){n.tweenGroup.remove(this)}).start()):l(r),this;return a();function a(){return Hr(n.canvas).k}function l(s){n.zoom.scaleTo(n.zoom.__baseElem,s),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,a=arguments.length,l=new Array(a>3?a-3:0),s=3;s<a;s++)l[s-3]=arguments[s];var c=this.getGraphBbox.apply(this,l);if(c){var f={x:(c.x[0]+c.x[1])/2,y:(c.y[0]+c.y[1])/2},d=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(c.x[1]-c.x[0]),(n.height-i*2)/(c.y[1]-c.y[0])));this.centerAt(f.x,f.y,r),this.zoom(d,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=et(n.nodeVal),a=function(c){return Math.sqrt(Math.max(0,i(c)||1))*n.nodeRelSize},l=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:a(s)}});return l.length?{x:[eh(l,function(s){return s.x-s.r}),Jd(l,function(s){return s.x+s.r})],y:[eh(l,function(s){return s.y-s.r}),Jd(l,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},jK),stateInit:function(){return{lastSetZoom:1,zoom:DB(),forceGraph:new mh,shadowGraph:new mh().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new pU,tweenGroup:new s4}},init:function(n,r){var i=this;n.innerHTML="";var a=document.createElement("div");a.classList.add("force-graph-container"),a.style.position="relative",n.appendChild(a),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),a.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var l=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),c={x:-1e12,y:-1e12},f=function(){var p=null,y=window.devicePixelRatio,x=c.x>0&&c.y>0?s.getImageData(c.x*y,c.y*y,1,1):null;return x&&(p=r.colorTracker.lookup(x.data)),p};pr(r.canvas).call($I().subject(function(){if(!r.enableNodeDrag)return null;var m=f();return m&&m.type==="Node"?m.d:null}).on("start",function(m){var p=m.subject;p.__initialDragPos={x:p.x,y:p.y,fx:p.fx,fy:p.fy},m.active||(p.fx=p.x,p.fy=p.y),r.canvas.classList.add("grabbable")}).on("drag",function(m){var p=m.subject,y=p.__initialDragPos,x=m,_=Hr(r.canvas).k,S={x:y.x+(x.x-y.x)/_-p.x,y:y.y+(x.y-y.y)/_-p.y};["x","y"].forEach(function(k){return p["f".concat(k)]=p[k]=y[k]+(x[k]-y[k])/_}),!(!p.__dragged&&_K>=Math.sqrt(WB(["x","y"].map(function(k){return Math.pow(m[k]-y[k],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,p.__dragged=!0,r.onNodeDrag(p,S))}).on("end",function(m){var p=m.subject,y=p.__initialDragPos,x={x:p.x-y.x,y:p.y-y.y};y.fx===void 0&&(p.fx=void 0),y.fy===void 0&&(p.fy=void 0),delete p.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,p.__dragged&&(delete p.__dragged,r.onNodeDragEnd(p,x))})),r.zoom(r.zoom.__baseElem=pr(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(m){return!m.button&&r.enableZoomPanInteraction&&(m.type!=="wheel"||et(r.enableZoomInteraction)(m))&&(m.type==="wheel"||et(r.enablePanInteraction)(m))}).on("zoom",function(m){var p=m.transform;[l,s].forEach(function(y){u3(y),y.translate(p.x,p.y),y.scale(p.k,p.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Co(Co({},p),i.centerAt())),r.needsRedraw=!0}).on("end",function(m){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Co(Co({},m.transform),i.centerAt()))}),Iv(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){Hr(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=wK/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new zU(a),["pointermove","pointerdown"].forEach(function(m){return a.addEventListener(m,function(p){m==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=p),!r.isPointerDragging&&p.type==="pointermove"&&r.onBackgroundClick&&(p.pressure>0||r.isPointerPressed)&&(p.pointerType==="mouse"||p.movementX===void 0||[p.movementX,p.movementY].some(function(_){return Math.abs(_)>1}))&&(r.isPointerDragging=!0);var y=x(a);c.x=p.pageX-y.left,c.y=p.pageY-y.top;function x(_){var S=_.getBoundingClientRect(),k=window.pageXOffset||document.documentElement.scrollLeft,j=window.pageYOffset||document.documentElement.scrollTop;return{top:S.top+j,left:S.left+k}}},{passive:!0})}),a.addEventListener("pointerup",function(m){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var p=[m,r.pointerDownEvent];requestAnimationFrame(function(){if(m.button===0)if(r.hoverObj){var y=r["on".concat(r.hoverObj.type,"Click")];y&&y.apply(void 0,[r.hoverObj.d].concat(p))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,p);if(m.button===2)if(r.hoverObj){var x=r["on".concat(r.hoverObj.type,"RightClick")];x&&x.apply(void 0,[r.hoverObj.d].concat(p))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,p)})}},{passive:!0}),a.addEventListener("contextmenu",function(m){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(m.preventDefault(),!1)}),r.forceGraph(l),r.shadowGraph(s);var d=_F(function(){rE(s,r.width,r.height),r.shadowGraph.linkWidth(function(p){return et(r.linkWidth)(p)+r.linkHoverPrecision});var m=Hr(r.canvas);r.shadowGraph.globalScale(m.k).tickFrame()},bK);r.flushShadowCanvas=d.flush,(this._animationCycle=function m(){var p=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(N){return N.__photons&&N.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var y=r.isPointerDragging?null:f();if(y!==r.hoverObj){var x=r.hoverObj,_=x?x.type:null,S=y?y.type:null;if(_&&_!==S){var k=r["on".concat(_,"Hover")];k&&k(null,x.d)}if(S){var j=r["on".concat(S,"Hover")];j&&j(y.d,_===S?x.d:null)}r.tooltip.content(y&&et(r["".concat(y.type.toLowerCase(),"Label")])(y.d)||null),r.canvas.classList[(y&&r["on".concat(S,"Click")]||!y&&r.onBackgroundClick)&&et(r.showPointerCursor)(y==null?void 0:y.d)?"add":"remove"]("clickable"),r.hoverObj=y}p&&d()}if(p){rE(l,r.width,r.height);var C=Hr(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(l,C),r.forceGraph.globalScale(C).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(l,C)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(m)})()},update:function(n){}}),$v={exports:{}},Bv,iE;function CK(){if(iE)return Bv;iE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Bv=e,Bv}var Fv,aE;function NK(){if(aE)return Fv;aE=1;var e=CK();function n(){}function r(){}return r.resetWarningCache=n,Fv=function(){function i(s,c,f,d,m,p){if(p!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:n};return l.PropTypes=l,l},Fv}var lE;function OK(){return lE||(lE=1,$v.exports=NK()()),$v.exports}var AK=OK();const Z=oi(AK),xm={width:Z.number,height:Z.number,graphData:Z.shape({nodes:Z.arrayOf(Z.object).isRequired,links:Z.arrayOf(Z.object).isRequired}),backgroundColor:Z.string,nodeRelSize:Z.number,nodeId:Z.string,nodeLabel:Z.oneOfType([Z.string,Z.func]),nodeVal:Z.oneOfType([Z.number,Z.string,Z.func]),nodeVisibility:Z.oneOfType([Z.bool,Z.string,Z.func]),nodeColor:Z.oneOfType([Z.string,Z.func]),nodeAutoColorBy:Z.oneOfType([Z.string,Z.func]),onNodeHover:Z.func,onNodeClick:Z.func,linkSource:Z.string,linkTarget:Z.string,linkLabel:Z.oneOfType([Z.string,Z.func]),linkVisibility:Z.oneOfType([Z.bool,Z.string,Z.func]),linkColor:Z.oneOfType([Z.string,Z.func]),linkAutoColorBy:Z.oneOfType([Z.string,Z.func]),linkWidth:Z.oneOfType([Z.number,Z.string,Z.func]),linkCurvature:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalArrowLength:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalArrowColor:Z.oneOfType([Z.string,Z.func]),linkDirectionalArrowRelPos:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalParticles:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalParticleSpeed:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalParticleOffset:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalParticleWidth:Z.oneOfType([Z.number,Z.string,Z.func]),linkDirectionalParticleColor:Z.oneOfType([Z.string,Z.func]),onLinkHover:Z.func,onLinkClick:Z.func,dagMode:Z.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:Z.number,dagNodeFilter:Z.func,onDagError:Z.func,d3AlphaMin:Z.number,d3AlphaDecay:Z.number,d3VelocityDecay:Z.number,warmupTicks:Z.number,cooldownTicks:Z.number,cooldownTime:Z.number,onEngineTick:Z.func,onEngineStop:Z.func,getGraphBbox:Z.func},c3={zoomToFit:Z.func,onNodeRightClick:Z.func,onNodeDrag:Z.func,onNodeDragEnd:Z.func,onLinkRightClick:Z.func,linkHoverPrecision:Z.number,onBackgroundClick:Z.func,onBackgroundRightClick:Z.func,showPointerCursor:Z.oneOfType([Z.bool,Z.func]),enablePointerInteraction:Z.bool,enableNodeDrag:Z.bool},Gb={showNavInfo:Z.bool,nodeOpacity:Z.number,nodeResolution:Z.number,nodeThreeObject:Z.oneOfType([Z.object,Z.string,Z.func]),nodeThreeObjectExtend:Z.oneOfType([Z.bool,Z.string,Z.func]),nodePositionUpdate:Z.func,linkOpacity:Z.number,linkResolution:Z.number,linkCurveRotation:Z.oneOfType([Z.number,Z.string,Z.func]),linkMaterial:Z.oneOfType([Z.object,Z.string,Z.func]),linkThreeObject:Z.oneOfType([Z.object,Z.string,Z.func]),linkThreeObjectExtend:Z.oneOfType([Z.bool,Z.string,Z.func]),linkPositionUpdate:Z.func,linkDirectionalArrowResolution:Z.number,linkDirectionalParticleResolution:Z.number,linkDirectionalParticleThreeObject:Z.oneOfType([Z.object,Z.string,Z.func]),forceEngine:Z.oneOf(["d3","ngraph"]),ngraphPhysics:Z.object,numDimensions:Z.oneOf([1,2,3])},TK=Object.assign({},xm,c3,{linkLineDash:Z.oneOfType([Z.arrayOf(Z.number),Z.string,Z.func]),nodeCanvasObjectMode:Z.oneOfType([Z.string,Z.func]),nodeCanvasObject:Z.func,nodePointerAreaPaint:Z.func,linkCanvasObjectMode:Z.oneOfType([Z.string,Z.func]),linkCanvasObject:Z.func,linkPointerAreaPaint:Z.func,linkDirectionalParticleCanvasObject:Z.func,autoPauseRedraw:Z.bool,minZoom:Z.number,maxZoom:Z.number,enableZoomInteraction:Z.oneOfType([Z.bool,Z.func]),enablePanInteraction:Z.oneOfType([Z.bool,Z.func]),onZoom:Z.func,onZoomEnd:Z.func,onRenderFramePre:Z.func,onRenderFramePost:Z.func});Object.assign({},xm,c3,Gb,{enableNavigationControls:Z.bool,controlType:Z.oneOf(["trackball","orbit","fly"]),rendererConfig:Z.object,extraRenderers:Z.arrayOf(Z.shape({render:Z.func.isRequired}))});Object.assign({},xm,Gb,{nodeDesc:Z.oneOfType([Z.string,Z.func]),linkDesc:Z.oneOfType([Z.string,Z.func])});Object.assign({},xm,Gb,{markerAttrs:Z.object,yOffset:Z.number,glScale:Z.number});const bm=ZL(EK,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});bm.displayName="ForceGraph2D";bm.propTypes=TK;function md(e){let n=e.trim().toLowerCase();return n.startsWith("fleet-")&&(n=n.slice(6)),n}const Uv=16,MK=4,PK=14,DK=10;function RK({edges:e,agents:n}){const r=b.useRef(void 0),i=b.useRef(null),[a,l]=b.useState({width:500,height:380}),s=b.useRef([]);b.useEffect(()=>{const j=i.current;if(!j)return;const C=new ResizeObserver(O=>{for(const T of O){const{width:A,height:P}=T.contentRect;A>0&&P>0&&l({width:Math.floor(A),height:Math.floor(P)})}});C.observe(j);const N=j.getBoundingClientRect();return N.width>0&&N.height>0&&l({width:Math.floor(N.width),height:Math.floor(N.height)}),()=>C.disconnect()},[]);const c=b.useMemo(()=>{const j=n.find(C=>{const N=md(C.name);return N==="team-lead"||N==="coordinator"||N==="tl"});return(j==null?void 0:j.name)??(n.length>0?n[0].name:null)},[n]),f=b.useMemo(()=>{const j=n.map(O=>{const T=O.name===c;return{id:O.name,name:O.name,role:O.role,color:pc(O.name,O.role),isActive:O.isActive,isTL:T,...T?{fx:0,fy:-40}:{}}}),C=[],N=new Map;for(const O of n)N.set(md(O.name),O.name);for(const O of e){const T=N.get(md(O.sender))??O.sender,A=N.get(md(O.recipient))??O.recipient,P=n.some(z=>z.name===T),R=n.some(z=>z.name===A);!P||!R||C.push({source:T,target:A,count:O.count,lastSummary:O.lastSummary})}return{nodes:j,links:C}},[n,e,c]);b.useEffect(()=>{const j=r.current;if(!j||!e.length)return;const C=s.current,N=new Map;for(const O of C)N.set(`${O.sender}->${O.recipient}`,O.count);for(const O of e){const T=`${O.sender}->${O.recipient}`,A=N.get(T)??0;if(O.count>A){const P=f.links.find(R=>{const z=typeof R.source=="object"?R.source.id:R.source,D=typeof R.target=="object"?R.target.id:R.target;return z===O.sender&&D===O.recipient});if(P)try{j.emitParticle(P)}catch{}}}s.current=e},[e,f.links]),b.useEffect(()=>{const j=r.current;if(!j||n.length===0)return;const C=j.d3Force("charge");C&&typeof C.strength=="function"&&C.strength(-200),j.d3Force("collide",O4(Uv+20)),j.d3Force("y",Yq(60).strength(.1)),j.d3ReheatSimulation()},[n.length]),b.useEffect(()=>{const j=r.current;if(!j||n.length===0)return;const C=setTimeout(()=>{j.zoomToFit(400,60)},500);return()=>clearTimeout(C)},[n.length]);const d=b.useCallback((j,C,N)=>{const O=j.x??0,T=j.y??0,A=Uv,P=PK/N,R=DK/N;C.beginPath(),C.arc(O,T,A,0,2*Math.PI),C.fillStyle=j.color+"66",C.fill(),C.strokeStyle=j.isActive?j.color:"#484F58",C.lineWidth=2/N,C.stroke();const z=O+A*.65,D=T-A*.65,U=MK/N;C.beginPath(),C.arc(z,D,U,0,2*Math.PI),C.fillStyle=j.isActive?"#3FB950":"#484F58",C.fill(),C.strokeStyle="#0D1117",C.lineWidth=1.5/N,C.stroke(),C.font=`bold ${P}px sans-serif`,C.textAlign="center",C.textBaseline="middle",C.fillStyle=j.isActive?j.color:"#484F58",C.fillText(j.name.charAt(0).toUpperCase(),O,T),C.font=`${R}px sans-serif`,C.fillStyle="#8B949E",C.fillText(j.name,O,T+A+10/N),j.role&&(C.font=`${R*.85}px sans-serif`,C.fillStyle="#484F58",C.fillText(j.role,O,T+A+20/N))},[]),m=b.useCallback((j,C,N)=>{const O=j.x??0,T=j.y??0;N.beginPath(),N.arc(O,T,Uv+4,0,2*Math.PI),N.fillStyle=C,N.fill()},[]),p=b.useCallback(j=>j.count>=9?3.5:j.count>=4?2:1,[]),y=b.useCallback(j=>"#8B949E",[]),x=b.useCallback(j=>null,[]),_=b.useCallback(j=>{const C=j.lastSummary?`<br/><i>${j.lastSummary}</i>`:"";return`<div style="padding:4px 8px;background:#161B22;border:1px solid #30363D;border-radius:4px;font-size:11px;color:#E6EDF3;">
109
+ <b>${typeof j.source=="object"?j.source.id:j.source}</b>
110
+ &rarr;
111
+ <b>${typeof j.target=="object"?j.target.id:j.target}</b>
112
+ <br/>${j.count} message${j.count!==1?"s":""}${C}
113
+ </div>`},[]),S=b.useCallback(j=>j.count>=6?3:j.count>=3?2:j.count>0?1:0,[]),k=b.useCallback(j=>6,[]);return n.length===0?g.jsx("div",{className:"flex items-center justify-center h-full text-dark-muted text-sm",children:"Waiting for agents to join the team..."}):g.jsx("div",{ref:i,className:"relative w-full h-full min-h-[300px]",children:g.jsx(bm,{ref:r,graphData:f,width:a.width,height:a.height,backgroundColor:"transparent",nodeCanvasObject:d,nodeCanvasObjectMode:()=>"replace",nodePointerAreaPaint:m,linkWidth:p,linkColor:y,linkLineDash:x,linkLabel:_,linkDirectionalParticles:S,linkDirectionalParticleWidth:3,linkDirectionalParticleSpeed:.005,linkDirectionalArrowLength:k,linkDirectionalArrowRelPos:1,linkDirectionalArrowColor:y,linkCurvature:.15,d3AlphaDecay:.02,d3VelocityDecay:.3,cooldownTicks:100,enableZoomInteraction:!0,enablePanInteraction:!0,enableNodeDrag:!0,minZoom:.5,maxZoom:4})})}function LK(e){if(e==null||e<0)return"0m";const n=Math.floor(e/60),r=Math.round(e%60);return n>0?`${n}h ${r}m`:`${r}m`}function zK(){var we;const{selectedTeamId:e,setSelectedTeamId:n}=hA(),{lastEvent:r,lastEventTeamId:i}=mA(),{isThinking:a}=pA(),l=Ot(),{detail:s,transitions:c,roster:f,messageEdges:d,loading:m,error:p,refreshDetail:y}=uL(e,r,i),[x,_]=b.useState(null),[S,k]=b.useState(null),[j,C]=b.useState(null),[N,O]=b.useState("session-log"),[T,A]=b.useState([]),[P,R]=b.useState(!1),[z,D]=b.useState(!1),[U,q]=b.useState(new Set),L=b.useRef(null),$=b.useRef(null),G=b.useRef(e),B=b.useRef(N),Y=e!==null;b.useEffect(()=>{G.current=e},[e]),b.useEffect(()=>{B.current=N},[N]),b.useEffect(()=>{O("session-log"),D(!1),q(new Set)},[e]),b.useEffect(()=>{((s==null?void 0:s.status)==="done"||(s==null?void 0:s.status)==="failed")&&D(!0)},[s==null?void 0:s.status]),b.useEffect(()=>{if(N!=="tasks"||!e)return;let ce=!1;return R(!0),l.get(`teams/${e}/tasks`).then(Se=>{ce||A(Se)}).catch(()=>{ce||A([])}).finally(()=>{ce||R(!1)}),()=>{ce=!0}},[N,e,l]);const ee=b.useCallback((ce,Se)=>{const me=Se,pe=G.current;B.current!=="tasks"||!pe||me.team_id===pe&&l.get(`teams/${pe}/tasks`).then(Ee=>A(Ee)).catch(()=>{})},[l]);Hu("task_updated",ee);const H=b.useCallback(()=>{n(null)},[n]);b.useEffect(()=>{function ce(Se){Se.key==="Escape"&&Y&&H()}return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[Y,H]);const re=b.useCallback(ce=>{$.current&&!$.current.contains(ce.target)&&H()},[H]),F=b.useCallback(async ce=>{if(!(!e||x)){_(ce);try{await l.post(`teams/${e}/${ce}`),y()}catch{}finally{_(null)}}},[e,x,l,y]),X=b.useCallback(async ce=>{if(!(!e||!s||S)){k(ce);try{let me;const pe=L.current;pe&&Date.now()-pe.fetchedAt<6e4?me=pe.data:(me=await l.get("message-templates"),L.current={data:me,fetchedAt:Date.now()});const Ee=me.find(Be=>Be.id===ce);if(!Ee||!Ee.enabled)return;let he=Ee.template;he=he.replace(/\{\{ISSUE_NUMBER\}\}/g,s.issueKey??String(s.issueNumber)),s.prNumber&&(he=he.replace(/\{\{PR_NUMBER\}\}/g,String(s.prNumber))),await l.post(`teams/${e}/send-message`,{message:he}),C(ce),setTimeout(()=>C(Be=>Be===ce?null:Be),1500)}catch{}finally{k(null)}}},[e,s,S,l]),ae=(s==null?void 0:s.status)==="running"||(s==null?void 0:s.status)==="idle"||(s==null?void 0:s.status)==="stuck"||(s==null?void 0:s.status)==="launching",se=(s==null?void 0:s.status)==="failed",ve=s!=null&&s.pr&&s.pr.state!=="merged"&&s.pr.state!=="closed"?s.pr.mergeStatus??null:null;return g.jsxs(g.Fragment,{children:[Y&&g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 transition-opacity",onClick:re,"aria-hidden":"true"}),g.jsxs("div",{ref:$,className:`fixed top-0 right-0 h-full w-[960px] max-w-full bg-dark-surface border-l border-dark-border z-50 flex flex-col shadow-2xl transition-transform duration-300 ease-in-out ${Y?"translate-x-0":"translate-x-full"}`,children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border shrink-0",children:[g.jsx("h2",{className:"text-lg font-semibold text-dark-text truncate",children:"Team Detail"}),g.jsx("button",{onClick:H,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",title:"Close panel (Esc)",children:g.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[m&&!s&&g.jsx("div",{className:"flex items-center justify-center py-16",children:g.jsx("span",{className:"text-dark-muted",children:"Loading..."})}),p&&!s&&g.jsx("div",{className:"flex items-center justify-center py-16",children:g.jsx("span",{className:"text-[#F85149]",children:p})}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"shrink-0",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-3 cursor-pointer hover:bg-dark-border/10 transition-colors",onClick:()=>D(ce=>!ce),children:[g.jsxs("h3",{className:"text-base font-semibold text-dark-text",children:[g.jsx("span",{className:"text-dark-muted mr-1.5",children:Gn(s.issueKey??String(s.issueNumber),s.issueProvider??null)}),s.issueTitle??"Untitled"]}),g.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[g.jsx(nb,{status:s.status,retryCount:s.retryCount}),g.jsx("svg",{className:`w-4 h-4 text-dark-muted transition-transform duration-200 ${z?"":"rotate-180"}`,viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),g.jsx("div",{className:`overflow-y-auto custom-scrollbar transition-all duration-200 ${z?"max-h-0 overflow-hidden":"max-h-[2000px]"}`,children:g.jsxs("div",{className:"px-5 pb-4 space-y-4",children:[g.jsxs("section",{children:[g.jsxs("div",{className:"flex items-center gap-4 mt-3 text-sm",children:[g.jsxs("span",{className:"text-dark-muted",children:["Duration: ",g.jsx("span",{className:"text-dark-text",children:LK(s.durationMin)})]}),s.lastEventAt&&!se&&g.jsxs("span",{className:"text-dark-muted",children:["Last activity: ",g.jsx("span",{className:"text-dark-text",children:(()=>{const ce=Math.floor((Date.now()-new Date(s.lastEventAt).getTime())/6e4);return ce<1?"just now":`${ce}m ago`})()})]})]}),g.jsxs("div",{className:"mt-2 text-xs text-dark-muted",children:[g.jsxs("span",{children:["Worktree: ",s.worktreeName]}),s.branchName&&g.jsxs("span",{className:"ml-3",children:["Branch: ",s.branchName]}),g.jsxs("span",{className:"ml-3",children:["Model: ",s.model??"—"]})]}),s.totalInputTokens+s.totalOutputTokens>0&&g.jsxs("div",{className:"mt-3 flex items-center gap-4 text-sm",children:[g.jsxs("span",{className:"text-dark-muted",children:["Input: ",g.jsx("span",{className:"text-dark-text",children:s.totalInputTokens.toLocaleString()})]}),g.jsxs("span",{className:"text-dark-muted",children:["Output: ",g.jsx("span",{className:"text-dark-text",children:s.totalOutputTokens.toLocaleString()})]}),s.totalCacheCreationTokens+s.totalCacheReadTokens>0&&g.jsxs("span",{className:"text-dark-muted",children:["Cache: ",g.jsx("span",{className:"text-dark-text",children:(s.totalCacheCreationTokens+s.totalCacheReadTokens).toLocaleString()})]}),s.totalCostUsd>0&&g.jsxs("span",{className:"text-dark-muted",children:["Cost: ",g.jsxs("span",{className:"text-[#3FB950]",children:["$",s.totalCostUsd.toFixed(4)]})]})]})]}),c.length>0&&g.jsxs("section",{className:"min-w-0",children:[g.jsx("h4",{className:"text-sm font-semibold text-dark-text mb-2 border-b border-dark-border/50 pb-1",children:"State Transitions"}),g.jsx("div",{className:"flex items-center gap-0 overflow-x-auto pb-1 custom-scrollbar max-w-full",children:c.map((ce,Se)=>{const me=Se===0,pe=Vr[ce.toStatus]??"#8B949E",Ee=(()=>{try{return new Date(ce.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}})();return g.jsxs("div",{className:"flex items-center shrink-0",children:[me&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex flex-col items-center",children:g.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded",style:{color:Vr[ce.fromStatus]??"#8B949E",backgroundColor:(Vr[ce.fromStatus]??"#8B949E")+"18"},children:ce.fromStatus})}),g.jsx("svg",{className:"w-3 h-3 text-dark-muted shrink-0 mx-0.5",viewBox:"0 0 12 12",fill:"currentColor",children:g.jsx("path",{d:"M4.5 2l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})})]}),g.jsxs("div",{className:"flex flex-col items-center group relative",children:[g.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded",style:{color:pe,backgroundColor:pe+"18"},children:ce.toStatus}),g.jsx("span",{className:"text-[9px] text-dark-muted mt-0.5 leading-none",children:Ee}),ce.reason&&g.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 px-2 py-1 bg-dark-surface border border-dark-border rounded text-[10px] text-dark-text whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 shadow-lg max-w-[240px] truncate",children:ce.reason})]}),Se<c.length-1&&g.jsx("svg",{className:"w-3 h-3 text-dark-muted shrink-0 mx-0.5",viewBox:"0 0 12 12",fill:"currentColor",children:g.jsx("path",{d:"M4.5 2l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})})]},ce.id)})})]}),s.pr&&g.jsxs("section",{children:[g.jsx("h4",{className:"text-sm font-semibold text-dark-text mb-2 border-b border-dark-border/50 pb-1",children:"Pull Request"}),g.jsxs("div",{className:"flex items-center gap-3 mb-3 text-sm",children:[g.jsxs("span",{className:"text-dark-accent font-medium",children:["PR #",s.pr.number]}),g.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded border",style:{color:s.pr.state==="merged"?"#A371F7":s.pr.state==="open"?"#3FB950":s.pr.state==="closed"?"#F85149":"#8B949E",borderColor:(s.pr.state==="merged"?"#A371F7":s.pr.state==="open"?"#3FB950":s.pr.state==="closed"?"#F85149":"#8B949E")+"40"},children:((we=s.pr.state)==null?void 0:we.toUpperCase())??"UNKNOWN"}),ve&&g.jsxs("span",{className:"text-xs text-dark-muted",children:["Merge: ",ve]}),s.pr.autoMerge&&g.jsx("span",{className:"text-xs text-[#3FB950]",children:"Auto-merge"})]}),g.jsxs("div",{className:"ml-1",children:[g.jsx("p",{className:"text-xs text-dark-muted mb-1.5 uppercase tracking-wide",children:"CI Checks"}),g.jsx("div",{className:"max-h-[120px] overflow-y-auto custom-scrollbar",children:g.jsx(kA,{checks:s.pr.checks??[]})})]})]}),!s.pr&&s.prNumber&&g.jsxs("section",{children:[g.jsx("h4",{className:"text-sm font-semibold text-dark-text mb-2 border-b border-dark-border/50 pb-1",children:"Pull Request"}),g.jsxs("p",{className:"text-sm text-dark-muted",children:["PR #",s.prNumber," (details loading...)"]})]})]})})]}),g.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[g.jsxs("div",{className:"shrink-0 flex items-center gap-0 px-5 border-b border-dark-border",children:[g.jsx("button",{onClick:()=>O("session-log"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${N==="session-log"?"border-dark-accent text-dark-text":"border-transparent text-dark-muted hover:text-dark-text"}`,children:"Session Log"}),g.jsxs("button",{onClick:()=>O("tasks"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${N==="tasks"?"border-dark-accent text-dark-text":"border-transparent text-dark-muted hover:text-dark-text"}`,children:["Tasks",T.length>0&&g.jsxs("span",{className:"ml-1.5 text-xs text-dark-muted",children:["(",T.filter(ce=>ce.status==="completed").length,"/",T.length,")"]})]}),g.jsx("button",{onClick:()=>O("team"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${N==="team"?"border-dark-accent text-dark-text":"border-transparent text-dark-muted hover:text-dark-text"}`,children:"Team"})]}),N==="session-log"&&g.jsx("div",{className:"flex-1 min-h-0 flex flex-col px-5 py-3",children:g.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:g.jsx(TL,{teamId:s.id,teamStatus:s.status,isThinking:a(s.id),roster:f,agentFilters:U,onAgentFiltersChange:q})})}),N==="tasks"&&g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar px-5 py-3",children:[P&&T.length===0&&g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx("span",{className:"text-dark-muted",children:"Loading tasks..."})}),!P&&T.length===0&&g.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[g.jsx("svg",{className:"w-10 h-10 text-dark-muted/40 mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:g.jsx("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",strokeLinecap:"round",strokeLinejoin:"round"})}),g.jsx("p",{className:"text-sm text-dark-muted",children:"No tasks yet."}),g.jsx("p",{className:"text-xs text-dark-muted/60 mt-1",children:"Tasks appear when the TL creates a task list."})]}),T.length>0&&g.jsx("div",{className:"space-y-1",children:T.map(ce=>g.jsxs("div",{className:`flex items-start gap-2.5 px-3 py-2 rounded border transition-colors ${ce.status==="completed"?"border-dark-border/30 bg-dark-border/5":ce.status==="in_progress"?"border-[#58A6FF]/30 bg-[#58A6FF]/5":"border-dark-border/50 bg-transparent"}`,children:[g.jsxs("div",{className:"shrink-0 mt-0.5",children:[ce.status==="completed"&&g.jsx("svg",{className:"w-4 h-4 text-[#3FB950]",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z",clipRule:"evenodd"})}),ce.status==="in_progress"&&g.jsxs("svg",{className:"w-4 h-4 text-[#58A6FF] animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("circle",{cx:"8",cy:"8",r:"6",strokeOpacity:"0.3"}),g.jsx("path",{d:"M8 2a6 6 0 014.9 9.4"})]}),ce.status==="pending"&&g.jsx("svg",{className:"w-4 h-4 text-dark-muted",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})})]}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("p",{className:`text-sm leading-snug ${ce.status==="completed"?"text-dark-muted line-through":"text-dark-text"}`,children:ce.subject}),ce.description&&g.jsx("p",{className:"text-xs text-dark-muted mt-0.5 truncate",children:ce.description})]}),g.jsx("span",{className:"shrink-0 text-[10px] text-dark-muted px-1.5 py-0.5 rounded bg-dark-border/20",children:ce.owner})]},ce.id))})]}),N==="team"&&g.jsx("div",{className:"flex-1 min-h-0 px-5 py-3",children:g.jsx(RK,{edges:d,agents:f})})]}),g.jsxs("div",{className:"shrink-0 border-t border-dark-border px-5 py-4 space-y-4",children:[g.jsx(ML,{teamId:s.id,disabled:!ae}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[g.jsx("span",{className:"text-xs text-dark-muted mr-1",children:"Quick:"}),[{id:"nudge_progress",label:"Status?",color:"#58A6FF"},{id:"check_ci",label:"Fix CI",color:"#F85149",show:!!(s!=null&&s.prNumber)}].filter(ce=>ce.show!==!1).map(ce=>g.jsx("button",{onClick:()=>X(ce.id),disabled:!ae||S!==null,className:"px-2.5 py-1 text-xs rounded-full border transition-colors disabled:opacity-40",style:{color:ce.color,borderColor:ce.color+"40"},title:`Send "${ce.label}" message to TL`,children:S===ce.id?"...":j===ce.id?"Sent!":ce.label},ce.id))]}),g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[ae&&g.jsx("button",{onClick:()=>F("stop"),disabled:x!==null,className:"px-3 py-1.5 text-sm rounded border border-[#F85149]/40 text-[#F85149] hover:bg-[#F85149]/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:x==="stop"?"Stopping...":"Stop"}),se&&g.jsx("button",{onClick:()=>F("resume"),disabled:x!==null,className:"px-3 py-1.5 text-sm rounded border border-[#3FB950]/40 text-[#3FB950] hover:bg-[#3FB950]/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:x==="resume"?"Resuming...":"Resume"}),(s==null?void 0:s.status)!=="done"&&g.jsx("button",{onClick:()=>F("restart"),disabled:x!==null,className:"px-3 py-1.5 text-sm rounded border border-dark-accent/40 text-dark-accent hover:bg-dark-accent/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:x==="restart"?"Restarting...":"Restart"}),g.jsxs("button",{onClick:()=>{window.open(`/api/teams/${s.id}/export?format=txt`,"_blank")},className:"px-3 py-1.5 text-sm rounded border border-dark-muted/40 text-dark-muted hover:text-dark-text hover:bg-dark-border/30 transition-colors flex items-center gap-1.5",title:"Export team log as text file",children:[g.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"}),g.jsx("path",{d:"M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"})]}),"Export Log"]})]})]})]})]})]})]})}const IK=new Set(["launching","running","idle","stuck"]);function $K(e){if(!e)return[];try{const n=JSON.parse(e);return!Array.isArray(n)||n.length===0?[]:n.map(r=>String(r))}catch{return[]}}function BK(e,n){return`https://github.com/${e}/issues/${n}`}function qv(e){return/^\d+$/.test(e)}function FK({team:e}){const{teams:n}=mc(),r=b.useMemo(()=>{const s=$K(e.blockedByJson);if(s.length>0){const c=s.map(d=>{const m=n.find(p=>p.projectId!==e.projectId?!1:!!(p.issueKey&&p.issueKey===d||qv(d)&&p.issueNumber===Number(d)));return{key:d,failed:(m==null?void 0:m.status)==="failed"}}),f=c.some(d=>d.failed);return{type:"dependency",blockers:c,hasFailedBlocker:f}}return e.maxActiveTeams!=null&&n.filter(f=>f.projectId===e.projectId&&IK.has(f.status)).length>=e.maxActiveTeams?{type:"slot"}:null},[e.blockedByJson,e.projectId,e.maxActiveTeams,n]);if(!r)return null;if(r.type==="slot")return g.jsx("span",{className:"block text-xs text-dark-muted mt-0.5",children:"Waiting for slot"});const{blockers:i,hasFailedBlocker:a}=r,l=a?"text-[#F85149]":"text-[#D29922]";return g.jsxs("span",{className:`block text-xs ${l} mt-0.5`,children:["Blocked by ",i.map((s,c)=>{const f=s.failed?"FAILED ":"",d=qv(s.key)?`${f}#${s.key}`:`${f}${s.key}`,m=e.githubRepo&&qv(s.key)?g.jsx("a",{href:BK(e.githubRepo,s.key),target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-dark-text",onClick:p=>p.stopPropagation(),children:d},s.key):g.jsx("span",{children:d},s.key);return g.jsxs("span",{children:[c>0&&", ",m]},s.key)})]})}const UK={open:{color:"#3FB950",label:"OPEN"},merged:{color:"#A371F7",label:"MERGED"},closed:{color:"#8B949E",label:"CLOSED"},draft:{color:"#8B949E",label:"DRAFT"}},qK={clean:"#3FB950",behind:"#D29922",blocked:"#F85149",dirty:"#F85149",unstable:"#D29922",has_hooks:"#D29922",draft:"#8B949E",unknown:"#8B949E"};function HK({prNumber:e,teamId:n,onClose:r,githubRepo:i}){const a=Ot(),[l,s]=b.useState(null),[c,f]=b.useState(!0),[d,m]=b.useState(null),[p,y]=b.useState(null),x=b.useRef(null);b.useEffect(()=>{let A=!1;async function P(){f(!0),m(null);try{const R=await a.get(`teams/${n}`);A||s(R)}catch(R){A||m(R instanceof Error?R.message:"Failed to load PR detail")}finally{A||f(!1)}}return P(),()=>{A=!0}},[n,a]),b.useEffect(()=>{function A(P){P.key==="Escape"&&r()}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[r]),b.useEffect(()=>{function A(R){x.current&&!x.current.contains(R.target)&&r()}const P=setTimeout(()=>{document.addEventListener("mousedown",A)},0);return()=>{clearTimeout(P),document.removeEventListener("mousedown",A)}},[r]);const _=b.useCallback(async A=>{if(p)return;const P=A?"enable-auto-merge":"disable-auto-merge";y(P);try{await a.post(`prs/${e}/${P}`);const R=await a.get(`teams/${n}`);s(R)}catch{}finally{y(null)}},[p,a,e,n]),S=b.useCallback(async()=>{if(!p){y("update-branch");try{await a.post(`prs/${e}/update-branch`);const A=await a.get(`teams/${n}`);s(A)}catch{}finally{y(null)}}},[p,a,e,n]),k=(l==null?void 0:l.pr)??null,j=i??(l==null?void 0:l.githubRepo)??null,C=j&&k?`https://github.com/${j}/pull/${k.number}`:null,N=UK[(k==null?void 0:k.state)??""]??{color:"#8B949E",label:"UNKNOWN"},O=qK[((k==null?void 0:k.mergeStatus)??"unknown").toLowerCase()]??"#8B949E",T=(k==null?void 0:k.state)==="open";return g.jsxs("div",{ref:x,className:"absolute top-full left-0 mt-1.5 z-50 w-[360px] bg-[#1C2128] border border-dark-border rounded-lg shadow-2xl",onClick:A=>A.stopPropagation(),children:[c&&g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx("span",{className:"text-dark-muted text-sm",children:"Loading PR details..."})}),d&&!c&&g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx("span",{className:"text-[#F85149] text-sm",children:d})}),!c&&!d&&k&&g.jsxs("div",{className:"p-4 space-y-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[C?g.jsxs("a",{href:C,target:"_blank",rel:"noopener noreferrer",onClick:A=>A.stopPropagation(),className:"text-sm font-semibold text-dark-accent hover:underline",children:["PR #",k.number]}):g.jsxs("span",{className:"text-sm font-semibold text-dark-accent",children:["PR #",k.number]}),g.jsx("button",{onClick:r,className:"text-dark-muted hover:text-dark-text transition-colors p-0.5 rounded hover:bg-dark-border/30",title:"Close",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded border",style:{color:N.color,borderColor:N.color+"40",backgroundColor:N.color+"10"},children:N.label}),k.mergeStatus&&k.state!=="merged"&&k.state!=="closed"&&g.jsx("span",{className:"text-xs px-2 py-0.5 rounded border",style:{color:O,borderColor:O+"40",backgroundColor:O+"10"},children:k.mergeStatus.toUpperCase()}),k.autoMerge&&g.jsxs("span",{className:"text-xs text-[#3FB950] flex items-center gap-1",children:[g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z"})}),"Auto-merge"]})]}),g.jsxs("div",{children:[g.jsxs("p",{className:"text-xs text-dark-muted mb-1.5 uppercase tracking-wide font-medium",children:["CI Checks",k.ciFailCount>0&&g.jsxs("span",{className:"ml-1.5 text-[#F85149] normal-case",children:["(",k.ciFailCount," failing)"]})]}),g.jsx("div",{className:"max-h-[200px] overflow-y-auto custom-scrollbar",children:g.jsx(kA,{checks:k.checks??[]})})]}),T&&g.jsx("div",{className:"pt-2 border-t border-dark-border/50",children:g.jsxs("div",{className:"flex items-center gap-2",children:[k.autoMerge?g.jsx("button",{onClick:()=>_(!1),disabled:p!==null,className:"px-2.5 py-1 text-xs rounded border border-dark-border text-dark-muted hover:text-[#F85149] hover:border-[#F85149]/50 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p==="disable-auto-merge"?"Disabling...":"Disable Auto-merge"}):g.jsx("button",{onClick:()=>_(!0),disabled:p!==null,className:"px-2.5 py-1 text-xs rounded border border-[#3FB950]/40 text-[#3FB950] hover:bg-[#3FB950]/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p==="enable-auto-merge"?"Enabling...":"Enable Auto-merge"}),g.jsx("button",{onClick:S,disabled:p!==null,className:"px-2.5 py-1 text-xs rounded border border-dark-accent/40 text-dark-accent hover:bg-dark-accent/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p==="update-branch"?"Updating...":"Update Branch"})]})})]}),!c&&!d&&!k&&g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsxs("span",{className:"text-dark-muted text-sm",children:["PR #",e," details not available"]})})]})}const oE={passing:{icon:"✓",color:"#3FB950"},failing:{icon:"✕",color:"#F85149"},pending:{icon:"○",color:"#D29922"},none:{icon:"—",color:"#8B949E"}},GK={open:"#3FB950",merged:"#A371F7",closed:"#8B949E",draft:"#8B949E"};function f3({prNumber:e,ciStatus:n,teamId:r,prState:i,githubRepo:a}){const[l,s]=b.useState(!1),[c,f]=b.useState(!1),d=b.useCallback(S=>{S.stopPropagation(),e!=null&&r!=null&&s(k=>!k)},[e,r]),m=b.useCallback(()=>{s(!1)},[]);if(e==null)return g.jsx("span",{className:"text-dark-muted text-sm",children:"—"});const p=i==="merged"?{icon:"✓",color:"#A371F7"}:oE[n??"none"]??oE.none,y=r!=null,x=GK[i??""]??"#8B949E",_=i?i.toUpperCase():null;return g.jsxs("span",{className:"relative inline-flex items-center gap-1.5",children:[g.jsxs("button",{type:"button",onClick:d,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:`inline-flex items-center gap-1.5 ${y?"cursor-pointer hover:bg-dark-border/30 rounded px-1.5 py-0.5 -mx-1.5 -my-0.5 transition-colors":""}`,title:y?"Click to view PR details":void 0,children:[g.jsxs("span",{className:"text-sm text-dark-accent",children:["#",e]}),g.jsx("span",{className:"text-sm font-bold",style:{color:p.color},children:p.icon})]}),c&&!l&&_&&g.jsx("span",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 px-2 py-0.5 text-xs rounded whitespace-nowrap bg-[#1C2128] border border-dark-border shadow-lg pointer-events-none",style:{color:x},children:_}),l&&r!=null&&g.jsx(HK,{prNumber:e,teamId:r,onClose:m,githubRepo:a})]})}function KK(e){if(e<0)return"0m";const n=Math.floor(e/60),r=Math.round(e%60);return n>0?`${n}h ${r}m`:`${r}m`}function VK(e,n){return e.length<=n?e:e.slice(0,n-1)+"…"}function Hv(e){return e<1e3?String(e):e<1e6?(e/1e3).toFixed(e<1e4?1:0)+"K":(e/1e6).toFixed(1)+"M"}function YK(e){return e<.01?"<$0.01":"$"+e.toFixed(2)}function WK(e,n){if(e.selected!==n.selected||e.isThinking!==n.isThinking||e.onSelect!==n.onSelect)return!1;const r=e.team,i=n.team;return r.id===i.id&&r.status===i.status&&r.phase===i.phase&&r.lastEventAt===i.lastEventAt&&r.prNumber===i.prNumber&&r.ciStatus===i.ciStatus&&r.prState===i.prState&&r.mergeStatus===i.mergeStatus&&r.totalInputTokens===i.totalInputTokens&&r.totalOutputTokens===i.totalOutputTokens&&r.totalCacheCreationTokens===i.totalCacheCreationTokens&&r.totalCacheReadTokens===i.totalCacheReadTokens&&r.totalCostUsd===i.totalCostUsd&&r.durationMin===i.durationMin&&r.model===i.model&&r.issueTitle===i.issueTitle&&r.projectName===i.projectName&&r.issueNumber===i.issueNumber&&r.issueKey===i.issueKey&&r.issueProvider===i.issueProvider&&r.githubRepo===i.githubRepo&&r.retryCount===i.retryCount&&r.blockedByJson===i.blockedByJson&&r.maxActiveTeams===i.maxActiveTeams}const XK=b.memo(function({team:n,selected:r,isThinking:i,onSelect:a}){const l=Ot(),[s,c]=b.useState(!1),[f,d]=b.useState(!1),[m,p]=b.useState(!1),[y,x]=b.useState(!1),_=async R=>{if(R.stopPropagation(),!s){c(!0);try{await l.post(`teams/${n.id}/stop`)}catch{}finally{c(!1)}}},S=async R=>{if(R.stopPropagation(),!f){d(!0);try{await l.post(`teams/${n.id}/force-launch`)}catch{}finally{d(!1)}}},k=async R=>{if(R.stopPropagation(),!m){p(!0);try{await l.post(`teams/${n.id}/resume`)}catch{}finally{p(!1)}}},j=async R=>{if(R.stopPropagation(),!y){x(!0);try{await l.post(`teams/${n.id}/restart`)}catch{}finally{x(!1)}}},C=()=>{a(n.id)},N=n.status==="running"||n.status==="stuck"||n.status==="idle"||n.status==="launching",O=n.issueTitle?VK(n.issueTitle,40):"Untitled",T=n.status==="done"||n.status==="failed";let A="—",P="text-dark-muted";if(n.lastEventAt&&!T){const R=Date.now()-new Date(n.lastEventAt).getTime(),z=Math.floor(R/6e4);z<1?(A="just now",P="text-[#3FB950]"):z<5?(A=`${z}m ago`,P="text-[#3FB950]"):z<15?(A=`${z}m ago`,P="text-[#D29922]"):(A=`${z}m ago`,P="text-[#F85149]")}return g.jsxs("tr",{onClick:C,className:`h-16 border-b border-dark-border cursor-pointer transition-colors group ${r?"bg-dark-accent/10":"bg-dark-surface hover:bg-[#1C2128]"}`,children:[g.jsxs("td",{className:"px-4 whitespace-nowrap",children:[g.jsx(nb,{status:n.status,retryCount:n.retryCount}),n.status==="queued"&&g.jsx(FK,{team:n})]}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:g.jsx("span",{className:"text-sm text-dark-muted",children:n.projectName??"—"})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:g.jsxs("span",{className:"text-sm",children:[g.jsx("span",{className:"text-dark-muted mr-1.5",children:Gn(n.issueKey??String(n.issueNumber),n.issueProvider)}),g.jsx("span",{className:"text-dark-text",children:O})]})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:g.jsx("span",{className:"text-sm text-dark-muted",children:n.model??"—"})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:g.jsx("span",{className:"text-sm text-dark-muted",children:KK(n.durationMin??0)})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:i?g.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm text-[#E8976C]",children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-[#E8976C] animate-thinking-dot"}),"thinking..."]}):g.jsx("span",{className:`text-sm ${P}`,title:n.lastEventAt??void 0,children:A})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:n.totalInputTokens+n.totalOutputTokens>0?g.jsx("span",{className:"text-sm text-dark-muted",title:`Input: ${Hv(n.totalInputTokens)}, Output: ${Hv(n.totalOutputTokens)}, Cache: ${Hv(n.totalCacheCreationTokens+n.totalCacheReadTokens)}`,children:YK(n.totalCostUsd)}):g.jsx("span",{className:"text-sm text-dark-muted",children:"—"})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:g.jsx(f3,{prNumber:n.prNumber,ciStatus:n.ciStatus,teamId:n.id,prState:n.prState,githubRepo:n.githubRepo})}),g.jsx("td",{className:"px-4 whitespace-nowrap",children:g.jsxs("span",{className:"inline-flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.status==="queued"&&g.jsx("button",{onClick:S,disabled:f,className:"px-2 py-1 text-xs rounded border border-dark-border text-dark-muted hover:text-[#D29922] hover:border-[#D29922]/50 transition-colors disabled:opacity-50",title:"Launch immediately despite usage limit",children:f?"Launching…":"Force Launch"}),N&&g.jsx("button",{onClick:_,disabled:s,className:"px-2 py-1 text-xs rounded border border-dark-border text-dark-muted hover:text-[#F85149] hover:border-[#F85149]/50 transition-colors disabled:opacity-50",title:"Stop team",children:s?"Stopping…":"Stop"}),n.status==="failed"&&g.jsxs(g.Fragment,{children:[g.jsx("button",{onClick:k,disabled:m,className:"px-2 py-1 text-xs rounded border border-dark-border text-dark-muted hover:text-[#3FB950] hover:border-[#3FB950]/50 transition-colors disabled:opacity-50",title:"Re-queue team (respects queue order)",children:m?"Retrying…":"Retry"}),g.jsx("button",{onClick:j,disabled:y,className:"px-2 py-1 text-xs rounded border border-dark-border text-dark-muted hover:text-dark-accent hover:border-dark-accent/50 transition-colors disabled:opacity-50",title:"Restart team (bypasses queue)",children:y?"Restarting…":"Restart"})]})]})})]})},WK),ZK=["Status","Project","Issue","Model","Duration","Activity","Cost","PR","Actions"];function QK({teams:e,selectedTeamId:n,onSelectTeam:r}){const{isThinking:i}=pA(),a=b.useCallback(l=>{r(l)},[r]);return g.jsx("div",{className:"w-full overflow-x-auto",children:g.jsxs("table",{className:"w-full table-auto",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-dark-border",children:ZK.map(l=>g.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-dark-muted uppercase tracking-wider",children:l},l))})}),g.jsx("tbody",{children:e.map(l=>g.jsx(XK,{team:l,selected:n===l.id,isThinking:i(l.id),onSelect:a},l.id))})]})})}function sE(e){if(e<1)return"<1m";const n=Math.floor(e/60),r=Math.round(e%60);return n>0?`${n}h ${r}m`:`${r}m`}function JK(e,n){return e.toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit"})}function eV(e,n){return e.length<=n?e:e.slice(0,n-1)+"…"}function tV({teams:e}){const[n,r]=b.useState(null),[i,a]=b.useState(()=>Date.now());b.useEffect(()=>{const d=setInterval(()=>a(Date.now()),15e3);return()=>clearInterval(d)},[]);const l=b.useMemo(()=>e.filter(d=>d.launchedAt).map(d=>{const m=new Date(d.launchedAt).getTime(),p=d.status==="running"||d.status==="launching"||d.status==="idle"||d.status==="stuck",y=(d.durationMin??0)*6e4,x=p?i:m+y;return{team:d,startMs:m,endMs:x,isRunning:p}}).sort((d,m)=>d.startMs-m.startMs),[e,i]),{rangeStart:s,rangeTotal:c}=b.useMemo(()=>{if(l.length===0)return{rangeStart:i-36e5,rangeTotal:36e5};const d=Math.min(...l.map(x=>x.startMs)),p=Math.max(...l.map(x=>x.endMs),i)-d||36e5,y=p*.05;return{rangeStart:d-y,rangeTotal:p+y*2}},[l,i]),f=b.useMemo(()=>{const m=c/5,p=[];for(let y=0;y<6;y++){const x=s+m*y,_=(x-s)/c*100;p.push({pct:_,text:JK(new Date(x))})}return p},[s,c,i]);return l.length===0?g.jsx("div",{className:"flex items-center justify-center h-40 text-dark-muted text-sm",children:"No teams with timeline data"}):g.jsx("div",{className:"w-full overflow-x-auto",children:g.jsxs("div",{className:"min-w-[600px]",children:[l.map(({team:d,startMs:m,endMs:p,isRunning:y})=>{const x=(m-s)/c*100,_=(p-m)/c*100,S=Math.max(_,.5),k=Vr[d.status]??"#8B949E",j=n===d.id,C=d.issueTitle?eV(d.issueTitle,30):"Untitled";return g.jsxs("div",{className:"flex items-center h-8 group",onMouseEnter:()=>r(d.id),onMouseLeave:()=>r(null),children:[g.jsx("div",{className:"w-[120px] min-w-[120px] pr-2 text-right text-xs text-dark-muted truncate shrink-0",children:Gn(d.issueKey??String(d.issueNumber),d.issueProvider)}),g.jsxs("div",{className:"relative flex-1 h-5 bg-dark-base rounded overflow-visible",children:[g.jsx("div",{className:`absolute top-0 h-full rounded transition-opacity ${y?"timeline-bar-pulse":""}`,style:{left:`${x}%`,width:`${S}%`,backgroundColor:k,opacity:j?1:.8},children:S>8&&g.jsxs("span",{className:"absolute inset-0 flex items-center px-1.5 text-[10px] font-medium text-dark-base truncate",children:[Gn(d.issueKey??String(d.issueNumber),d.issueProvider)," ",sE(d.durationMin??0)]})}),j&&g.jsxs("div",{className:"absolute z-50 bottom-full mb-1 px-2.5 py-1.5 rounded bg-dark-surface border border-dark-border text-xs text-dark-text whitespace-nowrap shadow-lg pointer-events-none",style:{left:`${Math.min(x+S/2,90)}%`,transform:"translateX(-50%)"},children:[g.jsxs("div",{className:"font-medium",children:[Gn(d.issueKey??String(d.issueNumber),d.issueProvider)," ",C]}),g.jsxs("div",{className:"text-dark-muted mt-0.5",children:[d.status," · ",sE(d.durationMin??0)]}),d.prNumber&&g.jsxs("div",{className:"text-dark-muted",children:["PR #",d.prNumber," · CI: ",d.ciStatus??"none"]})]})]})]},d.id)}),g.jsxs("div",{className:"flex items-center h-6 mt-1",children:[g.jsx("div",{className:"w-[120px] min-w-[120px] shrink-0"}),g.jsx("div",{className:"relative flex-1 h-full border-t border-dark-border",children:f.map((d,m)=>g.jsx("span",{className:"absolute top-1 text-[10px] text-dark-muted -translate-x-1/2",style:{left:`${d.pct}%`},children:d.text},m))})]})]})})}const uE={stuck:0,running:1,idle:2,launching:3,queued:4,failed:5,done:6};function nV(e){return[...e].sort((n,r)=>{const i=uE[n.status]??99,a=uE[r.status]??99;if(i!==a)return i-a;const l=n.launchedAt?new Date(n.launchedAt).getTime():0;return(r.launchedAt?new Date(r.launchedAt).getTime():0)-l})}function rV(){const{teams:e}=mc(),{selectedTeamId:n,setSelectedTeamId:r}=hA(),[i,a]=b.useState("grid"),l=b.useMemo(()=>nV(e),[e]);return l.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[g.jsx("svg",{className:"w-12 h-12 text-dark-muted/40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})}),g.jsx("p",{className:"text-dark-muted text-lg",children:"No teams"}),g.jsx("p",{className:"text-dark-muted/60 text-sm",children:"Launch a team to get started"})]}):g.jsxs("div",{className:"p-4",children:[g.jsxs("div",{className:"flex items-center justify-between mb-3 px-4",children:[g.jsxs("div",{className:"text-xs text-dark-muted",children:[l.length," team",l.length!==1?"s":""]}),g.jsxs("div",{className:"inline-flex rounded border border-dark-border text-xs overflow-hidden",children:[g.jsx("button",{onClick:()=>a("grid"),className:`px-3 py-1 transition-colors ${i==="grid"?"bg-dark-accent/20 text-dark-accent":"text-dark-muted hover:text-dark-text"}`,children:"Grid"}),g.jsx("button",{onClick:()=>a("timeline"),className:`px-3 py-1 border-l border-dark-border transition-colors ${i==="timeline"?"bg-dark-accent/20 text-dark-accent":"text-dark-muted hover:text-dark-text"}`,children:"Timeline"})]})]}),i==="grid"?g.jsx(QK,{teams:l,selectedTeamId:n,onSelectTeam:r}):g.jsx(tV,{teams:l})]})}function d3(e){const n=[];for(const r of e)r.state==="open"&&n.push({number:r.number,title:r.title}),r.children.length>0&&n.push(...d3(r.children));return n}function h3(e){const n=[];for(const r of e)r.children.length>0?n.push(...h3(r.children)):r.state==="open"&&n.push({number:r.number,title:r.title});return n}function Kb(e,n){return[...e].map(r=>({...r,children:Kb(r.children,n)})).sort((r,i)=>{var s,c;const a=((s=n.get(r.number))==null?void 0:s.priority)??999,l=((c=n.get(i.number))==null?void 0:c.priority)??999;return a-l})}function m3(){const e=Ot(),[n,r]=b.useState({priorityMap:new Map,loading:!1,error:null,costUsd:null,durationMs:null,checkedIssues:new Set}),i=b.useCallback(async m=>{const p=d3(m);if(p.length!==0){r(y=>({...y,loading:!0,error:null}));try{const y=await e.post("query/prioritizeIssues",{issues:p});if(!y.success||!y.data){const S=y.error??"Prioritization returned no data",k=y.text?`
114
+
115
+ CC output: ${y.text}`:"";r(j=>({...j,loading:!1,error:S+k}));return}const x=new Map;for(const S of y.data)x.set(S.number,S);const _=new Set(y.data.map(S=>S.number));r({priorityMap:x,loading:!1,error:null,costUsd:y.costUsd,durationMs:y.durationMs,checkedIssues:_})}catch(y){r(x=>({...x,loading:!1,error:y instanceof Error?y.message:String(y)}))}}},[e]),a=b.useCallback(async m=>{const p=h3(m);if(p.length!==0){r(y=>({...y,loading:!0,error:null}));try{const y=await e.post("query/prioritizeIssues",{issues:p});if(!y.success||!y.data){const x=y.error??"Prioritization returned no data",_=y.text?`
116
+
117
+ CC output: ${y.text}`:"";r(S=>({...S,loading:!1,error:x+_}));return}r(x=>{const _=new Map(x.priorityMap),S=new Set(x.checkedIssues);for(const k of y.data)_.set(k.number,k),S.add(k.number);return{priorityMap:_,loading:!1,error:null,costUsd:y.costUsd,durationMs:y.durationMs,checkedIssues:S}})}catch(y){r(x=>({...x,loading:!1,error:y instanceof Error?y.message:String(y)}))}}},[e]),l=b.useCallback(()=>{r({priorityMap:new Map,loading:!1,error:null,costUsd:null,durationMs:null,checkedIssues:new Set})},[]),s=b.useCallback((m,p)=>{r(y=>{const x=new Set(y.checkedIssues);return p?x.add(m):x.delete(m),{...y,checkedIssues:x}})},[]),c=n.priorityMap.size>0,f=c?[...n.priorityMap.entries()].sort((m,p)=>m[1].priority-p[1].priority).map(([m])=>m):[],d=f.filter(m=>n.checkedIssues.has(m));return{...n,prioritize:i,prioritizeSubtree:a,reset:l,toggleCheck:s,hasPriority:c,sortedIssueNumbers:f,checkedSortedIssueNumbers:d}}const Vb="fleet-issue-tree-collapsed";function iV(){try{return localStorage.getItem(Vb)!==null}catch{return!1}}function aV(){try{const e=localStorage.getItem(Vb);if(!e)return new Set;const n=JSON.parse(e);if(Array.isArray(n))return new Set(n.filter(r=>typeof r=="string"))}catch{}return new Set}function lV(e){try{localStorage.setItem(Vb,JSON.stringify([...e]))}catch{}}function oV(){const[e,n]=b.useState(()=>aV()),r=b.useRef(!1),i=b.useRef(!1),a=b.useRef(iV());b.useEffect(()=>{if(!r.current){r.current=!0;return}lV(e)},[e]);const l=b.useCallback(m=>{n(p=>{const y=new Set(p);return y.has(m)?y.delete(m):y.add(m),y})},[]),s=b.useCallback(()=>{n(new Set)},[]),c=b.useCallback(m=>{n(new Set(m))},[]),f=b.useCallback(m=>e.has(m),[e]),d=b.useCallback(m=>{i.current||a.current||(i.current=!0,m.length>0&&n(new Set(m)))},[]);return{collapsedNodes:e,toggleCollapse:l,expandAll:s,collapseAll:c,isCollapsed:f,seedDefaults:d}}function p3(e,n,r,i=0){const a=[];for(const l of e){const s=l.number.toString();if(a.push({node:l,depth:i,key:s}),l.children.length>0&&(r||!n.has(s))){const f=p3(l.children,n,r,i+1);for(const d of f)a.push(d)}}return a}function Yb(e,n,r){return b.useMemo(()=>p3(e,n,r),[e,n,r])}function No(e,n,r){let i=r.initialDeps??[],a,l=!0;function s(){var c,f,d;let m;r.key&&((c=r.debug)!=null&&c.call(r))&&(m=Date.now());const p=e();if(!(p.length!==i.length||p.some((_,S)=>i[S]!==_)))return a;i=p;let x;if(r.key&&((f=r.debug)!=null&&f.call(r))&&(x=Date.now()),a=n(...p),r.key&&((d=r.debug)!=null&&d.call(r))){const _=Math.round((Date.now()-m)*100)/100,S=Math.round((Date.now()-x)*100)/100,k=S/16,j=(C,N)=>{for(C=String(C);C.length<N;)C=" "+C;return C};console.info(`%c⏱ ${j(S,5)} /${j(_,5)} ms`,`
118
+ font-size: .6rem;
119
+ font-weight: bold;
120
+ color: hsl(${Math.max(0,Math.min(120-120*k,120))}deg 100% 31%);`,r==null?void 0:r.key)}return r!=null&&r.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(a),l=!1,a}return s.updateDeps=c=>{i=c},s}function cE(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const sV=(e,n)=>Math.abs(e-n)<1.01,uV=(e,n,r)=>{let i;return function(...a){e.clearTimeout(i),i=e.setTimeout(()=>n.apply(this,a),r)}},fE=e=>{const{offsetWidth:n,offsetHeight:r}=e;return{width:n,height:r}},cV=e=>e,fV=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),i=[];for(let a=n;a<=r;a++)i.push(a);return i},dV=(e,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const a=s=>{const{width:c,height:f}=s;n({width:Math.round(c),height:Math.round(f)})};if(a(fE(r)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(s=>{const c=()=>{const f=s[0];if(f!=null&&f.borderBoxSize){const d=f.borderBoxSize[0];if(d){a({width:d.inlineSize,height:d.blockSize});return}}a(fE(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},dE={passive:!0},hE=typeof window>"u"?!0:"onscrollend"in window,hV=(e,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;let a=0;const l=e.options.useScrollendEvent&&hE?()=>{}:uV(i,()=>{n(a,!1)},e.options.isScrollingResetDelay),s=m=>()=>{const{horizontal:p,isRtl:y}=e.options;a=p?r.scrollLeft*(y&&-1||1):r.scrollTop,l(),n(a,m)},c=s(!0),f=s(!1);r.addEventListener("scroll",c,dE);const d=e.options.useScrollendEvent&&hE;return d&&r.addEventListener("scrollend",f,dE),()=>{r.removeEventListener("scroll",c),d&&r.removeEventListener("scrollend",f)}},mV=(e,n,r)=>{if(n!=null&&n.borderBoxSize){const i=n.borderBoxSize[0];if(i)return Math.round(i[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},pV=(e,{adjustments:n=0,behavior:r},i)=>{var a,l;const s=e+n;(l=(a=i.scrollElement)==null?void 0:a.scrollTo)==null||l.call(a,{[i.options.horizontal?"left":"top"]:s,behavior:r})};class gV{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var r,i,a;return((a=(i=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:i.now)==null?void 0:a.call(i))??Date.now()},this.observer=(()=>{let r=null;const i=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(a=>{a.forEach(l=>{const s=()=>{const c=l.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var a;(a=i())==null||a.disconnect(),r=null},observe:a=>{var l;return(l=i())==null?void 0:l.observe(a,{box:"border-box"})},unobserve:a=>{var l;return(l=i())==null?void 0:l.unobserve(a)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([i,a])=>{typeof a>"u"&&delete r[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cV,rangeExtractor:fV,onChange:()=>{},measureElement:mV,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var i,a;(a=(i=this.options).onChange)==null||a.call(i,this,r)},this.maybeNotify=No(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,i)=>{const a=new Map,l=new Map;for(let s=i-1;s>=0;s--){const c=r[s];if(a.has(c.lane))continue;const f=l.get(c.lane);if(f==null||c.end>f.end?l.set(c.lane,c):c.end<f.end&&a.set(c.lane,!0),a.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((s,c)=>s.end===c.end?s.index-c.index:s.end-c.end)[0]:void 0},this.getMeasurementOptions=No(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(r,i,a,l,s,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:i,scrollMargin:a,getItemKey:l,enabled:s,lanes:c}),{key:!1}),this.getMeasurements=No(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:i,scrollMargin:a,getItemKey:l,enabled:s,lanes:c},f)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const y of this.laneAssignments.keys())y>=r&&this.laneAssignments.delete(y);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(y=>{this.itemSizeCache.set(y.key,y.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,d),p=new Array(c).fill(void 0);for(let y=0;y<d;y++){const x=m[y];x&&(p[x.lane]=y)}for(let y=d;y<r;y++){const x=l(y),_=this.laneAssignments.get(y);let S,k;if(_!==void 0&&this.options.lanes>1){S=_;const O=p[S],T=O!==void 0?m[O]:void 0;k=T?T.end+this.options.gap:i+a}else{const O=this.options.lanes===1?m[y-1]:this.getFurthestMeasurement(m,y);k=O?O.end+this.options.gap:i+a,S=O?O.lane:y%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(y,S)}const j=f.get(x),C=typeof j=="number"?j:this.options.estimateSize(y),N=k+C;m[y]={index:y,start:k,size:C,end:N,key:x,lane:S},p[S]=y}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=No(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,i,a,l)=>this.range=r.length>0&&i>0?vV({measurements:r,outerSize:i,scrollOffset:a,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=No(()=>{let r=null,i=null;const a=this.calculateRange();return a&&(r=a.startIndex,i=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,i]},(r,i,a,l,s)=>l===null||s===null?[]:r({startIndex:l,endIndex:s,overscan:i,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const i=this.options.indexAttribute,a=r.getAttribute(i);return a?parseInt(a,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const a=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(a!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,a-l),c=Math.min(this.options.count-1,a+l);return r>=s&&r<=c}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((s,c)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(c))});return}const i=this.indexFromElement(r),a=this.options.getItemKey(i),l=this.elementsCache.get(a);l!==r&&(l&&this.observer.unobserve(l),this.observer.observe(r),this.elementsCache.set(a,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,i)=>{var a;const l=this.measurementsCache[r];if(!l)return;const s=this.itemSizeCache.get(l.key)??l.size,c=i-s;c!==0&&(((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,c,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,i)),this.notify(!1))},this.getVirtualItems=No(()=>[this.getVirtualIndexes(),this.getMeasurements()],(r,i)=>{const a=[];for(let l=0,s=r.length;l<s;l++){const c=r[l],f=i[c];a.push(f)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const i=this.getMeasurements();if(i.length!==0)return cE(i[g3(0,i.length-1,a=>cE(i[a]).start,r)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(r,i,a=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),s=this.getScrollOffset();i==="auto"&&(i=r>=s+l?"end":"start"),i==="center"?r+=(a-l)/2:i==="end"&&(r-=l);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,r),0)},this.getOffsetForIndex=(r,i="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const a=this.getSize(),l=this.getScrollOffset(),s=this.measurementsCache[r];if(!s)return;if(i==="auto")if(s.end>=l+a-this.options.scrollPaddingEnd)i="end";else if(s.start<=l+this.options.scrollPaddingStart)i="start";else return[l,i];if(i==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,s.size),i]},this.scrollToOffset=(r,{align:i="start",behavior:a="auto"}={})=>{const l=this.getOffsetForAlignment(r,i),s=this.now();this.scrollState={index:null,align:i,behavior:a,startedAt:s,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:i="auto",behavior:a="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const l=this.getOffsetForIndex(r,i);if(!l)return;const[s,c]=l,f=this.now();this.scrollState={index:r,align:c,behavior:a,startedAt:f,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:i="auto"}={})=>{const a=this.getScrollOffset()+r,l=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var r;const i=this.getMeasurements();let a;if(i.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((r=i[i.length-1])==null?void 0:r.end)??0;else{const l=Array(this.options.lanes).fill(null);let s=i.length-1;for(;s>=0&&l.some(c=>c===null);){const c=i[s];l[c.lane]===null&&(l[c.lane]=c.end),s--}a=Math.max(...l.filter(c=>c!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:i,behavior:a})=>{this.options.scrollToFn(r,{behavior:a,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(n)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,a=i?i[0]:this.scrollState.lastTargetOffset,l=1,s=a!==this.scrollState.lastTargetOffset;if(!s&&sV(a,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,s&&(this.scrollState.lastTargetOffset=a,this.scrollState.behavior="auto",this._scrollToOffset(a,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const g3=(e,n,r,i)=>{for(;e<=n;){const a=(e+n)/2|0,l=r(a);if(l<i)e=a+1;else if(l>i)n=a-1;else return a}return e>0?e-1:0};function vV({measurements:e,outerSize:n,scrollOffset:r,lanes:i}){const a=e.length-1,l=f=>e[f].start;if(e.length<=i)return{startIndex:0,endIndex:a};let s=g3(0,a,l,r),c=s;if(i===1)for(;c<a&&e[c].end<r+n;)c++;else if(i>1){const f=Array(i).fill(0);for(;c<a&&f.some(m=>m<r+n);){const m=e[c];f[m.lane]=m.end,c++}const d=Array(i).fill(r+n);for(;s>=0&&d.some(m=>m>=r);){const m=e[s];d[m.lane]=m.start,s--}s=Math.max(0,s-s%i),c=Math.min(a,c+(i-1-c%i))}return{startIndex:s,endIndex:c}}const mE=typeof document<"u"?b.useLayoutEffect:b.useEffect;function yV({useFlushSync:e=!0,...n}){const r=b.useReducer(()=>({}),{})[1],i={...n,onChange:(l,s)=>{var c;e&&s?am.flushSync(r):r(),(c=n.onChange)==null||c.call(n,l,s)}},[a]=b.useState(()=>new gV(i));return a.setOptions(i),mE(()=>a._didMount(),[]),mE(()=>a._willUpdate()),a}function xV(e){return yV({observeElementRect:dV,observeElementOffset:hV,scrollToFn:pV,...e})}function Gv({placeholder:e,onSubmit:n,loading:r}){const[i,a]=b.useState(""),l=s=>{s.preventDefault();const c=i.trim();c&&(n(c),a(""))};return g.jsxs("form",{onSubmit:l,className:"flex items-center gap-1 mt-1",children:[g.jsx("input",{type:"text",value:i,onChange:s=>a(s.target.value),placeholder:e,disabled:r,className:"w-24 px-1.5 py-0.5 text-xs bg-dark-bg border border-dark-border rounded text-dark-text placeholder-dark-muted/50 focus:outline-none focus:border-dark-accent"}),g.jsx("button",{type:"submit",disabled:r||!i.trim(),className:"px-1.5 py-0.5 text-xs rounded border border-dark-border text-dark-muted hover:text-dark-accent hover:border-dark-accent/50 disabled:opacity-50 disabled:cursor-not-allowed",children:r?g.jsxs("svg",{className:"animate-spin w-3 h-3",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):"Add"})]})}function pd({relRef:e,issueProvider:n,onRemove:r,removing:i}){const a=Gn(e.key,n),l=e.state==="closed";return g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 group/ref",children:[g.jsx("span",{className:`text-xs ${l?"text-dark-muted/60 line-through":"text-dark-text"}`,title:`${e.title} (${e.state})`,children:a}),g.jsx("span",{className:"text-xs text-dark-muted truncate max-w-[120px]",title:e.title,children:e.title}),r&&g.jsx("button",{onClick:s=>{s.stopPropagation(),r()},disabled:i,className:"opacity-0 group-hover/ref:opacity-100 transition-opacity text-dark-muted hover:text-[#F85149] disabled:opacity-50",title:"Remove",children:i?g.jsxs("svg",{className:"animate-spin w-3 h-3",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):g.jsx(wA,{size:10})})]})}const bV=Jo.memo(function({issueKey:n,projectId:r,issueProvider:i,relations:a,onClose:l,onRelationChanged:s}){const c=Ot(),[f,d]=b.useState(null),[m,p]=b.useState(null),y=`projects/${r}/issues/${n}`,x=b.useCallback(A=>{const P=A instanceof Error?A.message:String(A);p(P),setTimeout(()=>p(null),3e3)},[]),_=b.useCallback(async(A,P)=>{d(A),p(null);try{await P(),s()}catch(R){x(R)}finally{d(null)}},[s,x]),S=b.useCallback(A=>_(`add-blocker-${A}`,()=>c.post(`${y}/blocked-by`,{blockerKey:A}).then(()=>{})),[c,y,_]),k=b.useCallback(A=>_(`rm-blocker-${A}`,()=>c.del(`${y}/blocked-by/${A}`).then(()=>{})),[c,y,_]),j=b.useCallback(A=>_(`set-parent-${A}`,()=>c.post(`${y}/parent`,{parentKey:A}).then(()=>{})),[c,y,_]),C=b.useCallback(()=>_("rm-parent",()=>c.del(`${y}/parent`).then(()=>{})),[c,y,_]),N=b.useCallback(A=>_(`add-child-${A}`,()=>c.post(`${y}/children`,{childKey:A}).then(()=>{})),[c,y,_]),O=b.useCallback(A=>_(`rm-child-${A}`,()=>c.del(`${y}/children/${A}`).then(()=>{})),[c,y,_]),T=f!==null;return g.jsxs("div",{className:"bg-dark-surface/60 border border-dark-border rounded-md p-2 mt-1 mb-1 text-xs",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("span",{className:"text-dark-muted font-medium flex items-center gap-1",children:[g.jsx(bA,{size:12}),"Relations for ",Gn(n,i)]}),g.jsx("button",{onClick:l,className:"text-dark-muted hover:text-dark-text transition-colors",title:"Close relations panel",children:g.jsx(wA,{size:12})})]}),m&&g.jsx("div",{className:"text-[#F85149] text-xs mb-2 px-1",children:m}),g.jsxs("div",{className:"mb-2",children:[g.jsx("div",{className:"text-dark-muted font-medium mb-0.5",children:"Parent"}),a.parent?g.jsx(pd,{relRef:a.parent,issueProvider:i,onRemove:C,removing:f==="rm-parent"}):g.jsx("div",{className:"text-dark-muted/60 italic",children:"None"}),!a.parent&&g.jsx(Gv,{placeholder:i==="github"?"Issue #":"Issue key",onSubmit:j,loading:T})]}),g.jsxs("div",{className:"mb-2",children:[g.jsx("div",{className:"text-dark-muted font-medium mb-0.5",children:"Children"}),a.children.length>0?a.children.map(A=>g.jsx(pd,{relRef:A,issueProvider:i,onRemove:()=>O(A.key),removing:f===`rm-child-${A.key}`},A.key)):g.jsx("div",{className:"text-dark-muted/60 italic",children:"None"}),g.jsx(Gv,{placeholder:i==="github"?"Child issue #":"Child key",onSubmit:N,loading:T})]}),g.jsxs("div",{className:"mb-2",children:[g.jsx("div",{className:"text-dark-muted font-medium mb-0.5",children:"Blocked by"}),a.blockedBy.length>0?a.blockedBy.map(A=>g.jsx(pd,{relRef:A,issueProvider:i,onRemove:()=>k(A.key),removing:f===`rm-blocker-${A.key}`},A.key)):g.jsx("div",{className:"text-dark-muted/60 italic",children:"None"}),g.jsx(Gv,{placeholder:i==="github"?"Blocker issue #":"Blocker key",onSubmit:S,loading:T})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-dark-muted font-medium mb-0.5",children:"Blocking"}),a.blocking.length>0?a.blocking.map(A=>g.jsx(pd,{relRef:A,issueProvider:i,removing:!1},A.key)):g.jsx("div",{className:"text-dark-muted/60 italic",children:"None"})]})]})});function wV({completed:e,total:n}){if(n<=0)return null;const r=Math.round(e/n*100),i=r===100?"#3FB950":r>=50?"#D29922":"#58A6FF";return g.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-dark-muted",children:[g.jsx("span",{className:"relative w-16 h-1.5 bg-dark-border rounded-full overflow-hidden",children:g.jsx("span",{className:"absolute inset-y-0 left-0 rounded-full transition-all duration-300",style:{width:`${r}%`,backgroundColor:i}})}),g.jsxs("span",{children:[e,"/",n]})]})}function _V({state:e}){return e==="open"?g.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-[#3FB950]",children:g.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"})]})}):g.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-dark-muted",children:g.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5Z"}),g.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z"})]})})}function kV({dependencies:e}){return!e.blockedBy||e.blockedBy.length===0||e.resolved||e.openCount===0?null:g.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-dark-muted cursor-default flex-wrap",children:[g.jsx(eL,{size:12,className:"text-[#F85149] shrink-0"}),g.jsx("span",{children:"blocked by"}),e.blockedBy.map((n,r)=>{const i=n.url??`https://github.com/${n.owner}/${n.repo}/issues/${n.number}`,a=n.state==="closed",l=n.issueKey??`#${n.number}`,s=n.title?`${n.title} (${n.state})`:`${l} (${n.state})`,c=n.issueKey??`${n.owner}/${n.repo}#${n.number}`;return g.jsxs("span",{children:[i?g.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",title:s,className:`hover:text-dark-accent transition-colors ${a?"line-through text-dark-muted/60":"text-dark-muted"}`,onClick:f=>f.stopPropagation(),children:l}):g.jsx("span",{title:s,className:a?"line-through text-dark-muted/60":"text-dark-muted",children:l}),r<e.blockedBy.length-1&&g.jsx("span",{className:"text-dark-muted",children:","})]},c)})]})}function SV({provider:e}){return e==="jira"?g.jsx("span",{className:"inline-flex items-center shrink-0",title:"Jira",children:g.jsx(yA,{size:12,className:"text-[#2684FF]"})}):e==="github"?g.jsx("span",{className:"inline-flex items-center shrink-0",title:"GitHub",children:g.jsx(vA,{size:12,className:"text-dark-muted"})}):null}function jV({data:e}){let n,r;return e.priority<=3?(n="rgba(248, 81, 73, 0.15)",r="#F85149"):e.priority<=6?(n="rgba(210, 153, 34, 0.15)",r="#D29922"):(n="rgba(139, 148, 158, 0.15)",r="#8B949E"),g.jsxs("span",{className:"inline-flex items-center gap-1 shrink-0 px-1.5 py-0.5 rounded text-xs font-medium cursor-default",style:{backgroundColor:n,color:r},title:`Priority ${e.priority}/10 (${e.category}): ${e.reason}`,children:["P",e.priority]})}const EV=Jo.memo(function({node:n,depth:r,onLaunch:i,launchingIssues:a,launchErrors:l,projectId:s,priorityMap:c,checkedIssues:f,onCheckChange:d,onPrioritizeSubtree:m,prioritizing:p,collapsedNodes:y,onToggleCollapse:x,relationsOpenKeys:_,onToggleRelations:S,relationsMap:k,onRelationChanged:j}){var $;const C=n.number.toString(),N=n.issueKey??String(n.number),O=y?!y.has(C):!0,T=n.children.length>0,A=n.activeTeam!=null,P=!!(n.dependencies&&!n.dependencies.resolved&&n.dependencies.openCount>0),R=a.has(n.number),z=l.get(n.number)??null,D=(_==null?void 0:_.has(N))??!1,U=(k==null?void 0:k.get(N))??null,q=async G=>{G.stopPropagation(),!R&&await i(n.number,n.title,s,n.issueKey??void 0,n.issueProvider??void 0)},L=(($=n.prReferences)==null?void 0:$[0])??null;return g.jsxs("div",{children:[g.jsxs("div",{className:`flex items-center gap-2 py-1.5 px-2 rounded hover:bg-dark-surface/80 group transition-colors ${P?"opacity-60 border-l-2 border-[#F85149]":""}`,style:{paddingLeft:`${Math.min(r*20,200)+8}px`},children:[g.jsx("button",{disabled:!T,onClick:()=>{x&&x(C)},className:`w-4 h-4 flex items-center justify-center text-dark-muted shrink-0 transition-transform duration-150 ${T?"cursor-pointer hover:text-dark-text":"invisible"} ${O?"rotate-90":""}`,"aria-label":O?"Collapse":"Expand",tabIndex:T?0:-1,children:g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"})})}),d&&c&&g.jsx("input",{type:"checkbox",checked:(f==null?void 0:f.has(n.number))??!1,onChange:G=>{G.stopPropagation(),d(n.number,G.target.checked)},className:"w-3.5 h-3.5 shrink-0 accent-dark-accent cursor-pointer","aria-label":`Select issue ${Gn(n.issueKey??String(n.number),n.issueProvider??null)}`}),g.jsx(_V,{state:n.state}),n.issueProvider&&g.jsx(SV,{provider:n.issueProvider}),g.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-dark-muted hover:text-dark-accent transition-colors shrink-0",onClick:G=>G.stopPropagation(),children:Gn(n.issueKey??String(n.number),n.issueProvider??null)}),g.jsx("span",{className:`text-sm truncate ${n.state==="closed"?"text-dark-muted line-through":"text-dark-text"}`,children:n.title}),n.boardStatus&&n.issueProvider&&n.issueProvider!=="github"&&g.jsx("span",{className:"shrink-0 ml-1 px-1.5 py-0.5 text-[10px] rounded bg-dark-border/40 text-dark-muted",children:n.boardStatus}),(c==null?void 0:c.get(n.number))&&g.jsx("span",{className:"shrink-0 ml-1",children:g.jsx(jV,{data:c.get(n.number)})}),R&&g.jsx("span",{className:"shrink-0 ml-1 text-xs text-dark-accent/70 animate-pulse",children:"Launching..."}),A&&g.jsx("span",{className:"shrink-0 ml-1",children:g.jsx(nb,{status:n.activeTeam.status})}),n.dependencies&&!n.dependencies.resolved&&g.jsx("span",{className:"shrink-0 ml-1",children:g.jsx(kV,{dependencies:n.dependencies})}),S&&s!==void 0&&g.jsx("button",{onClick:G=>{G.stopPropagation(),S(N)},className:`shrink-0 ml-1 transition-opacity px-1 py-0.5 rounded ${D?"text-dark-accent opacity-100":"text-dark-muted opacity-0 group-hover:opacity-100 hover:text-dark-accent"}`,title:D?"Hide relations":"Manage relations",children:g.jsx(bA,{size:12})}),L&&g.jsx("span",{className:"shrink-0 ml-1",children:g.jsx(f3,{prNumber:L.number,ciStatus:L.state??null})}),n.subIssueSummary&&n.subIssueSummary.total>0&&g.jsx("span",{className:"shrink-0 ml-1",children:g.jsx(wV,{completed:n.subIssueSummary.completed,total:n.subIssueSummary.total})}),T&&m&&g.jsxs("button",{onClick:G=>{G.stopPropagation(),m(n.children)},disabled:p,className:`ml-auto shrink-0 transition-opacity inline-flex items-center gap-1 px-1.5 py-0.5 text-xs rounded border border-[#A371F7]/50 text-[#A371F7] hover:bg-[#A371F7]/10 disabled:opacity-50 disabled:cursor-not-allowed ${p?"opacity-100":"opacity-0 group-hover:opacity-100"}`,title:`Prioritize sub-issues under ${Gn(n.issueKey??String(n.number),n.issueProvider??null)}`,children:[p?g.jsxs("svg",{className:"animate-spin w-3 h-3",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M7.823.9l4.584 4.584-7.636 7.636L.187 8.536 7.823.9ZM14.2 6.1l-1.3 1.3-4.584-4.584L9.6 1.5a1.5 1.5 0 012.122 0L14.2 3.978a1.5 1.5 0 010 2.122Z"})}),"Prioritize"]}),!A&&n.state==="open"&&!T&&g.jsx("button",{onClick:q,disabled:R,className:`ml-auto shrink-0 transition-opacity px-1.5 py-0.5 text-xs rounded border disabled:opacity-70 disabled:cursor-not-allowed ${R?"opacity-100":"opacity-0 group-hover:opacity-100"} ${P?"border-[#D29922]/50 text-[#D29922] hover:text-[#D29922] hover:border-[#D29922]":"border-dark-border text-dark-muted hover:text-[#3FB950] hover:border-[#3FB950]/50"}`,title:P?`Launch team for ${Gn(n.issueKey??String(n.number),n.issueProvider??null)} (blocked — will prompt for confirmation)`:`Launch team for ${Gn(n.issueKey??String(n.number),n.issueProvider??null)}`,children:R?g.jsxs("svg",{className:"animate-spin w-3 h-3",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):g.jsx(K7,{size:12})})]}),z&&g.jsxs("div",{className:"flex items-center gap-1.5 py-1 text-xs text-[#F85149]",style:{paddingLeft:`${Math.min(r*20,200)+32}px`},children:[g.jsx("svg",{className:"w-3 h-3 shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2.343 13.657A8 8 0 1 1 13.657 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"})}),g.jsx("span",{children:z})]}),D&&U&&s!==void 0&&S&&j&&g.jsx("div",{style:{paddingLeft:`${Math.min(r*20,200)+32}px`},children:g.jsx(bV,{issueKey:N,projectId:s,issueProvider:n.issueProvider??"github",relations:U,onClose:()=>S(N),onRelationChanged:()=>j(N)})})]})}),CV=32,NV=15,Wb=Jo.memo(function({rows:n,onLaunch:r,launchingIssues:i,launchErrors:a,projectId:l,priorityMap:s,checkedIssues:c,onCheckChange:f,onPrioritizeSubtree:d,prioritizing:m,collapsedNodes:p,onToggleCollapse:y,relationsOpenKeys:x,onToggleRelations:_,relationsMap:S,onRelationChanged:k,className:j}){const C=b.useRef(null),N=xV({count:n.length,getScrollElement:()=>C.current,estimateSize:()=>CV,overscan:NV,getItemKey:A=>n[A].key}),O=b.useCallback(A=>{A&&N.measureElement(A)},[N]),T=N.getVirtualItems();return g.jsx("div",{ref:C,className:`overflow-auto ${j??""}`,style:{contain:"content"},children:g.jsx("div",{style:{height:`${N.getTotalSize()}px`,width:"100%",position:"relative"},children:T.map(A=>{const P=n[A.index];return g.jsx("div",{ref:O,"data-index":A.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${A.start}px)`},children:g.jsx(EV,{node:P.node,depth:P.depth,onLaunch:r,launchingIssues:i,launchErrors:a,projectId:l,priorityMap:s,checkedIssues:c,onCheckChange:f,onPrioritizeSubtree:d,prioritizing:m,collapsedNodes:p,onToggleCollapse:y,relationsOpenKeys:x,onToggleRelations:_,relationsMap:S,onRelationChanged:k})},P.key)})})})}),Kv=20,OV=14,AV=10,pE="#3FB950",gE="#D29922",gd="#F85149",Vv="#484F58",TV="#8B949E";function MV(e){const n=[];function r(i){for(const a of i)n.push(a),a.children.length>0&&r(a.children)}return r(e),n}function PV(e,n){return e.length<=n?e:e.slice(0,n-1)+"…"}function DV(e,n){const r=[];function i(a){for(const l of a){for(const s of l.children){const c=String(l.number),f=String(s.number);n.has(c)&&n.has(f)&&r.push({source:c,target:f,type:"parent"})}l.children.length>0&&i(l.children)}}return i(e),r}function RV({issues:e,projectName:n}){const r=b.useRef(void 0),i=b.useRef(null),[a,l]=b.useState({width:800,height:500});b.useEffect(()=>{const S=i.current;if(!S)return;const k=new ResizeObserver(C=>{for(const N of C){const{width:O,height:T}=N.contentRect;O>0&&T>0&&l({width:Math.floor(O),height:Math.floor(T)})}});k.observe(S);const j=S.getBoundingClientRect();return j.width>0&&j.height>0&&l({width:Math.floor(j.width),height:Math.floor(j.height)}),()=>k.disconnect()},[]);const s=b.useMemo(()=>{const S=MV(e),k=new Map;for(const A of S)k.has(A.number)||k.set(A.number,A);const j=new Set([...k.keys()].map(String)),C=[...k.values()].map(A=>{const P=A.dependencies?A.dependencies.openCount>0:!1;let R;return A.state==="closed"?R=pE:P?R=gd:R=gE,{id:String(A.number),number:A.number,title:A.title,state:A.state,isBlocked:P,color:R,url:A.url,issueKey:A.issueKey,issueProvider:A.issueProvider}}),N=[],O=new Set;for(const A of k.values())if(A.dependencies)for(const P of A.dependencies.blockedBy){const R=String(P.number),z=String(A.number);if(j.has(R)&&j.has(z)){const D=`blockedBy:${R}->${z}`;O.has(D)||(O.add(D),N.push({source:R,target:z,type:"blockedBy"}))}}const T=DV(e,j);for(const A of T){const P=`parent:${A.source}->${A.target}`;O.has(P)||(O.add(P),N.push(A))}return{nodes:C,links:N}},[e]);b.useEffect(()=>{const S=r.current;if(!S||s.nodes.length===0)return;const k=S.d3Force("charge");k&&typeof k.strength=="function"&&k.strength(-300),S.d3Force("collide",O4(Kv+25)),S.d3ReheatSimulation()},[s.nodes.length]),b.useEffect(()=>{const S=r.current;if(!S||s.nodes.length===0)return;const k=setTimeout(()=>{S.zoomToFit(400,60)},600);return()=>clearTimeout(k)},[s.nodes.length]);const c=b.useCallback((S,k,j)=>{const C=S.x??0,N=S.y??0,O=Kv,T=OV/j,A=AV/j;k.beginPath(),k.arc(C,N,O,0,2*Math.PI),k.fillStyle=S.color+"66",k.fill(),k.strokeStyle=Vv,k.lineWidth=2/j,k.stroke(),k.font=`bold ${T}px sans-serif`,k.textAlign="center",k.textBaseline="middle",k.fillStyle="#E6EDF3",k.fillText(`#${S.number}`,C,N),k.font=`${A}px sans-serif`,k.fillStyle=TV,k.fillText(PV(S.title,22),C,N+O+10/j)},[]),f=b.useCallback((S,k,j)=>{const C=S.x??0,N=S.y??0;j.beginPath(),j.arc(C,N,Kv+4,0,2*Math.PI),j.fillStyle=k,j.fill()},[]),d=b.useCallback(S=>{S.url&&window.open(S.url,"_blank")},[]),m=b.useCallback(S=>S.type==="blockedBy"?gd:Vv,[]),p=b.useCallback(S=>1.5,[]),y=b.useCallback(S=>S.type==="parent"?[5,3]:null,[]),x=b.useCallback(S=>S.type==="blockedBy"?6:0,[]),_=b.useCallback(S=>{const k=S.state==="closed"?"Resolved":S.isBlocked?"Blocked":"Open";return`<div style="padding:4px 8px;background:#161B22;border:1px solid #30363D;border-radius:4px;font-size:11px;color:#E6EDF3;">
121
+ <b>#${S.number}</b> ${S.title}<br/>
122
+ <span style="color:${S.color}">${k}</span>
123
+ </div>`},[]);return s.nodes.length===0?g.jsxs("div",{className:"flex items-center justify-center h-full text-dark-muted text-sm",children:["No issues to visualize for ",n]}):g.jsxs("div",{ref:i,className:"relative w-full h-full min-h-[300px]",children:[g.jsx(bm,{ref:r,graphData:s,width:a.width,height:a.height,backgroundColor:"transparent",nodeCanvasObject:c,nodeCanvasObjectMode:()=>"replace",nodePointerAreaPaint:f,nodeLabel:_,onNodeClick:d,linkWidth:p,linkColor:m,linkLineDash:y,linkDirectionalArrowLength:x,linkDirectionalArrowRelPos:1,linkDirectionalArrowColor:m,linkCurvature:.15,d3AlphaDecay:.02,d3VelocityDecay:.3,cooldownTicks:100,enableZoomInteraction:!0,enablePanInteraction:!0,enableNodeDrag:!0,minZoom:.3,maxZoom:6}),g.jsxs("div",{className:"absolute bottom-3 right-3 bg-dark-surface/90 border border-dark-border rounded-lg px-3 py-2 text-xs text-dark-muted",children:[g.jsx("div",{className:"font-semibold text-dark-text mb-1.5",children:"Legend"}),g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:pE}}),g.jsx("span",{children:"Resolved"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:gE}}),g.jsx("span",{children:"Open (unblocked)"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:gd}}),g.jsx("span",{children:"Open (blocked)"})]}),g.jsxs("div",{className:"flex items-center gap-2 mt-1 pt-1 border-t border-dark-border/50",children:[g.jsx("svg",{width:"20",height:"8",children:g.jsx("line",{x1:"0",y1:"4",x2:"20",y2:"4",stroke:gd,strokeWidth:"2"})}),g.jsx("span",{children:"Dependency (blocks)"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("svg",{width:"20",height:"8",children:g.jsx("line",{x1:"0",y1:"4",x2:"20",y2:"4",stroke:Vv,strokeWidth:"2",strokeDasharray:"5,3"})}),g.jsx("span",{children:"Parent / child"})]})]})]})]})}function v3({issues:e,projectName:n,onClose:r}){b.useEffect(()=>{function l(s){s.key==="Escape"&&r()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r]);const i=b.useCallback(l=>{l.target===l.currentTarget&&r()},[r]),a=y3(e);return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:i,children:g.jsxs("div",{className:"w-[90vw] h-[80vh] max-w-[1400px] bg-dark-surface border border-dark-border rounded-lg shadow-2xl flex flex-col",children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-dark-border shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("h2",{className:"text-sm font-semibold text-dark-text",children:["Dependency Graph: ",n]}),g.jsxs("span",{className:"text-xs text-dark-muted",children:[a," issue",a!==1?"s":""]})]}),g.jsx("button",{onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors","aria-label":"Close dependency graph",children:g.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M18 6 6 18"}),g.jsx("path",{d:"m6 6 12 12"})]})})]}),g.jsx("div",{className:"flex-1 min-h-0",children:g.jsx(RV,{issues:e,projectName:n,onClose:r})})]})})}function y3(e){let n=0;for(const r of e)n+=1,r.children.length>0&&(n+=y3(r.children));return n}const Yv=[{key:"all",label:"All"},{key:"no-team",label:"No Team"},{key:"blocked-deps",label:"Blocked",color:"#F85149"},{key:"queued",label:"Queued",color:"#58A6FF"},{key:"running",label:"Running",color:"#3FB950"},{key:"idle",label:"Idle",color:"#D29922"},{key:"stuck",label:"Stuck",color:"#F85149"},{key:"done",label:"Done",color:"#A371F7"},{key:"failed",label:"Failed",color:"#F85149"}];function LV(){var J,ye;const e=Ot(),[n,r]=b.useState([]),[i,a]=b.useState(!0),[l,s]=b.useState(!1),[c,f]=b.useState(null),[d,m]=b.useState(null),[p,y]=b.useState(0),[x,_]=b.useState(new Set),[S,k]=b.useState(new Map),[j,C]=b.useState([]),[N,O]=b.useState([]),[T,A]=b.useState(""),[P,R]=b.useState("all"),[z,D]=b.useState("all"),[U,q]=b.useState(new Set),[L,$]=b.useState(new Map),G=oV(),[B,Y]=b.useState(null),ee=b.useRef(new Set);b.useEffect(()=>()=>{for(const K of ee.current)clearTimeout(K);ee.current.clear()},[]),b.useEffect(()=>{e.get("projects").then(C).catch(()=>{})},[e]);const H=b.useMemo(()=>j.filter(K=>K.status==="active"),[j]),re=b.useMemo(()=>H.length===1?H[0].id:null,[H]),F=b.useCallback(async()=>{try{f(null);const K=await e.get("issues");r(K.tree),O(K.groups??[]),m(K.cachedAt),y(K.count)}catch(K){const ge=K instanceof Error?K.message:String(K);f(ge)}finally{a(!1)}},[e]);b.useEffect(()=>{F()},[F]);const X=b.useCallback((K,ge)=>{K==="dependency_resolved"&&F();const be=ge;if(K==="relations_updated"&&be){const Le=be.issue_key,Re=be.relations;Le&&Re&&$(Je=>{const Ae=new Map(Je);return Ae.set(Le,Re),Ae}),F()}},[F]);Hu("dependency_resolved",X),Hu("relations_updated",X);const ae=b.useCallback(async()=>{if(!l){s(!0);try{f(null),await e.post("issues/refresh"),await F()}catch(K){const ge=K instanceof Error?K.message:String(K);f(ge)}finally{s(!1)}}},[e,l,F]),se=b.useCallback(async K=>{if(q(ge=>{const be=new Set(ge);return be.has(K)?be.delete(K):be.add(K),be}),!U.has(K)){let ge;for(const be of N){const Le=Re=>{for(const Je of Re){if((Je.issueKey??String(Je.number))===K)return ge=be.projectId,!0;if(Le(Je.children))return!0}return!1};if(Le(be.tree))break}if(ge===void 0&&re&&(ge=re),ge!==void 0)try{const be=await e.get(`projects/${ge}/issues/${K}/relations`);$(Le=>{const Re=new Map(Le);return Re.set(K,be),Re})}catch(be){console.warn(`Failed to fetch relations for ${K}:`,be)}}},[e,N,re,U]),ve=b.useCallback(async K=>{let ge;for(const be of N){const Le=Re=>{for(const Je of Re){if((Je.issueKey??String(Je.number))===K)return ge=be.projectId,!0;if(Le(Je.children))return!0}return!1};if(Le(be.tree))break}if(ge===void 0&&re&&(ge=re),ge!==void 0)try{const be=await e.get(`projects/${ge}/issues/${K}/relations`);$(Le=>{const Re=new Map(Le);return Re.set(K,be),Re})}catch(be){console.warn(`Failed to refresh relations for ${K}:`,be)}F()},[e,N,re,F]),we=b.useCallback(async(K,ge,be,Le,Re)=>{const Je=be??re;if(!Je){const Ae=H.length>1?"Multiple projects exist — use the Launch Team dialog to select one":"No active project found";k(Ze=>{const di=new Map(Ze);return di.set(K,Ae),di});const De=setTimeout(()=>{ee.current.delete(De),k(Ze=>{const di=new Map(Ze);return di.delete(K),di})},5e3);ee.current.add(De);return}_(Ae=>new Set(Ae).add(K)),k(Ae=>{if(!Ae.has(K))return Ae;const De=new Map(Ae);return De.delete(K),De});try{await e.post("teams/launch",{issueNumber:K,issueKey:Le??String(K),issueTitle:ge,projectId:Je});const Ae=setTimeout(()=>{ee.current.delete(Ae),_(De=>{const Ze=new Set(De);return Ze.delete(K),Ze}),F()},5e3);ee.current.add(Ae)}catch(Ae){const De=Ae instanceof Error?Ae.message:String(Ae);if(Ae.status===409&&Je){_(Qn=>{const Dn=new Set(Qn);return Dn.delete(K),Dn}),Y({issueNumber:K,title:ge,projectId:Je,message:De,blockers:[],issueKey:Le,issueProvider:Re});return}console.error(`[IssueTree] Failed to launch team for #${K}:`,De),_(Qn=>{const Dn=new Set(Qn);return Dn.delete(K),Dn}),k(Qn=>{const Dn=new Map(Qn);return Dn.set(K,De),Dn});const hs=setTimeout(()=>{ee.current.delete(hs),k(Qn=>{const Dn=new Map(Qn);return Dn.delete(K),Dn})},5e3);ee.current.add(hs)}},[e,F,re,H.length]),ce=b.useCallback(async()=>{if(!B)return;const{issueNumber:K,title:ge,projectId:be,issueKey:Le}=B;Y(null),_(Re=>new Set(Re).add(K));try{await e.post("teams/launch",{issueNumber:K,issueKey:Le??String(K),issueTitle:ge,projectId:be,force:!0});const Re=setTimeout(()=>{ee.current.delete(Re),_(Je=>{const Ae=new Set(Je);return Ae.delete(K),Ae}),F()},5e3);ee.current.add(Re)}catch(Re){const Je=Re instanceof Error?Re.message:String(Re);_(De=>{const Ze=new Set(De);return Ze.delete(K),Ze}),k(De=>{const Ze=new Map(De);return Ze.set(K,Je),Ze});const Ae=setTimeout(()=>{ee.current.delete(Ae),k(De=>{const Ze=new Map(De);return Ze.delete(K),Ze})},5e3);ee.current.add(Ae)}},[e,B,F]),Se=b.useCallback(async()=>{if(!B)return;const{issueNumber:K,title:ge,projectId:be,issueKey:Le}=B;Y(null),_(Re=>new Set(Re).add(K));try{await e.post("teams/launch",{issueNumber:K,issueKey:Le??String(K),issueTitle:ge,projectId:be,queue:!0});const Re=setTimeout(()=>{ee.current.delete(Re),_(Je=>{const Ae=new Set(Je);return Ae.delete(K),Ae}),F()},5e3);ee.current.add(Re)}catch(Re){const Je=Re instanceof Error?Re.message:String(Re);_(De=>{const Ze=new Set(De);return Ze.delete(K),Ze}),k(De=>{const Ze=new Map(De);return Ze.set(K,Je),Ze});const Ae=setTimeout(()=>{ee.current.delete(Ae),k(De=>{const Ze=new Map(De);return Ze.delete(K),Ze})},5e3);ee.current.add(Ae)}},[e,B,F]),me=b.useMemo(()=>{const K=new Set;function ge(be){for(const Le of be)K.add(Le.issueProvider??"github"),ge(Le.children)}if(N.length>0)for(const be of N)if(be.providers&&be.providers.length>0)for(const Le of be.providers)K.add(Le);else ge(be.tree);else ge(n);return[...K].sort()},[n,N]),pe=b.useMemo(()=>nx(n,T,P,z),[n,T,P,z]),Ee=b.useMemo(()=>N.length===0?[]:N.map(K=>({...K,tree:nx(K.tree,T,P,z)})).filter(K=>K.tree.length>0),[N,T,P,z]),he=b.useMemo(()=>{if(Ee.length===0)return[];if(!Ee.some(Le=>Le.groupId!=null))return[];const ge=new Map;for(const Le of Ee){const Re=Le.groupId!=null?`group-${Le.groupId}`:"group-ungrouped",Je=Le.groupName??"Ungrouped";let Ae=ge.get(Re);Ae||(Ae={key:Re,name:Je,projects:[]},ge.set(Re,Ae)),Ae.projects.push(Le)}return[...ge.values()].sort((Le,Re)=>Le.key==="group-ungrouped"?1:Re.key==="group-ungrouped"?-1:Le.name.localeCompare(Re.name))},[Ee]),Be=b.useMemo(()=>N.length>0?[...N.some(be=>be.groupId!=null)?[...new Set(N.map(be=>be.groupId!=null?`group-${be.groupId}`:"group-ungrouped"))]:[],...N.flatMap(be=>{const Le=[];if(be.providers&&be.providers.length>1)for(const Re of be.providers)Le.push(`provider-${be.projectId}-${Re}`);return[`project-${be.projectId}`,...Le,...rx(be.tree)]})]:rx(n),[n,N]),Me=b.useMemo(()=>N.length>0?N.flatMap(K=>ix(K.tree,0,2)):ix(n,0,2),[n,N]);return b.useEffect(()=>{Me.length>0&&G.seedDefaults(Me)},[Me,G.seedDefaults]),i?g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsxs("div",{className:"flex flex-col items-center gap-3",children:[g.jsxs("svg",{className:"w-8 h-8 text-dark-accent animate-spin",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4Z"})]}),g.jsx("p",{className:"text-dark-muted text-sm",children:"Loading issue tree..."})]})}):g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-dark-border shrink-0 gap-3",children:[g.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[g.jsx("h2",{className:"text-sm font-semibold text-dark-text",children:"Issue Tree"}),g.jsx("span",{className:"text-xs text-dark-muted",children:T||P!=="all"||z!=="all"?`${kc(pe)} of ${p} issues`:`${p} issue${p!==1?"s":""}`}),d&&!T&&g.jsxs("span",{className:"text-xs text-dark-muted",title:d,children:["·"," cached ",UV(d)]})]}),g.jsxs("div",{className:"relative flex-1 max-w-xs",children:[g.jsx("input",{type:"text",placeholder:"Search issues... (#number or title)",value:T,onChange:K=>A(K.target.value),"aria-label":"Search issues",className:"w-full px-3 py-1 text-xs bg-[#0D1117] border border-[#30363D] rounded text-[#E6EDF3] placeholder-[#8B949E] focus:outline-none focus:border-[#58A6FF]"}),T&&g.jsx("button",{onClick:()=>A(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#8B949E] hover:text-[#E6EDF3] transition-colors","aria-label":"Clear search",children:g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})})})]}),g.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:Yv.map(K=>g.jsx("button",{onClick:()=>R(K.key),className:`px-2.5 py-1 text-xs rounded-full border transition-colors ${P===K.key?"border-dark-accent/50 bg-dark-accent/20 text-dark-accent":"border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted"}`,style:P===K.key&&"color"in K?{color:K.color,borderColor:K.color+"50",backgroundColor:K.color+"15"}:void 0,children:K.label},K.key))}),me.length>1&&g.jsxs("div",{className:"flex items-center gap-1 flex-wrap","data-testid":"provider-filter-pills",children:[g.jsx("button",{onClick:()=>D("all"),className:`inline-flex items-center gap-1 px-2.5 py-1 text-xs rounded-full border transition-colors ${z==="all"?"border-dark-accent/50 bg-dark-accent/20 text-dark-accent":"border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted"}`,children:"All Sources"}),me.map(K=>g.jsxs("button",{onClick:()=>D(K),className:`inline-flex items-center gap-1 px-2.5 py-1 text-xs rounded-full border transition-colors ${z===K?"border-dark-accent/50 bg-dark-accent/20 text-dark-accent":"border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted"}`,children:[g.jsx(Iu,{provider:K,size:12}),K.charAt(0).toUpperCase()+K.slice(1)]},K))]}),g.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[g.jsxs("button",{onClick:G.expandAll,className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-accent/50 transition-colors",title:"Expand all tree nodes",children:[g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8.177 14.323a.75.75 0 0 1-1.06-.146l-3.5-4.5A.75.75 0 0 1 4.211 8.5h7.578a.75.75 0 0 1 .594 1.177l-3.5 4.5a.75.75 0 0 1-.706.146ZM7.823 1.677a.75.75 0 0 1 1.06.146l3.5 4.5A.75.75 0 0 1 11.789 7.5H4.211a.75.75 0 0 1-.594-1.177l3.5-4.5a.75.75 0 0 1 .706-.146Z"})}),"Expand All"]}),g.jsxs("button",{onClick:()=>G.collapseAll(Be),className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-accent/50 transition-colors",title:"Collapse all tree nodes",children:[g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M4.177 7.823a.75.75 0 0 1 .146-1.06l3.5-3.5A.75.75 0 0 1 8.5 3.557V7.5h-3.5a.75.75 0 0 1-.823-.677ZM11.823 7.823a.75.75 0 0 0-.146-1.06l-3.5-3.5A.75.75 0 0 0 7.5 3.557V7.5h3.5a.75.75 0 0 0 .823-.677ZM4.177 8.177a.75.75 0 0 0 .146 1.06l3.5 3.5a.75.75 0 0 0 .677.823V9.5H5a.75.75 0 0 0-.823.677ZM11.823 8.177a.75.75 0 0 1-.146 1.06l-3.5 3.5a.75.75 0 0 1-.677.823V9.5H11a.75.75 0 0 1 .823.677Z"})}),"Collapse All"]})]}),g.jsxs("button",{onClick:ae,disabled:l,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-accent/50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[g.jsx("svg",{className:`w-3.5 h-3.5 ${l?"animate-spin":""}`,viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1.705 8.005a.75.75 0 0 1 .834.656 5.5 5.5 0 0 0 9.592 2.97l-1.204-1.204a.25.25 0 0 1 .177-.427h3.646a.25.25 0 0 1 .25.25v3.646a.25.25 0 0 1-.427.177l-1.38-1.38A7.002 7.002 0 0 1 1.05 8.84a.75.75 0 0 1 .656-.834ZM8 2.5a5.487 5.487 0 0 0-4.131 1.869l1.204 1.204A.25.25 0 0 1 4.896 6H1.25A.25.25 0 0 1 1 5.75V2.104a.25.25 0 0 1 .427-.177l1.38 1.38A7.002 7.002 0 0 1 14.95 7.16a.75.75 0 0 1-1.49.178A5.5 5.5 0 0 0 8 2.5Z"})}),l?"Refreshing...":"Refresh"]})]}),c&&g.jsx("div",{className:"mx-4 mt-3 px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-xs text-[#F85149]",children:c}),g.jsx("div",{className:"flex-1 overflow-auto p-2",children:n.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[g.jsx("svg",{className:"w-12 h-12 text-dark-muted/40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})}),g.jsx("p",{className:"text-dark-muted text-lg",children:"No issues found"}),g.jsx("p",{className:"text-dark-muted/60 text-sm",children:"Click Refresh to fetch issues from GitHub"})]}):pe.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[g.jsx("p",{className:"text-dark-muted text-sm",children:T&&P!=="all"?g.jsxs(g.Fragment,{children:["No issues match “",T,"” with filter “",(J=Yv.find(K=>K.key===P))==null?void 0:J.label,"”"]}):T?g.jsxs(g.Fragment,{children:["No issues match “",T,"”"]}):g.jsxs(g.Fragment,{children:["No issues match filter “",(ye=Yv.find(K=>K.key===P))==null?void 0:ye.label,"”"]})}),g.jsx("button",{onClick:()=>{A(""),R("all"),D("all")},className:"text-xs text-dark-accent hover:underline",children:"Clear filters"})]}):he.length>0?g.jsx("div",{className:"space-y-2",children:he.map(K=>g.jsx(IV,{bucket:K,onLaunch:we,launchingIssues:x,launchErrors:S,forceExpand:!!T||P!=="all"||z!=="all",fetchTree:F,collapsedNodes:G.collapsedNodes,onToggleCollapse:G.toggleCollapse,relationsOpenKeys:U,onToggleRelations:se,relationsMap:L,onRelationChanged:ve},K.key))}):Ee.length>0?g.jsx("div",{className:"space-y-1",children:Ee.map(K=>g.jsx(w3,{group:K,onLaunch:we,launchingIssues:x,launchErrors:S,forceExpand:!!T||P!=="all"||z!=="all",fetchTree:F,collapsedNodes:G.collapsedNodes,onToggleCollapse:G.toggleCollapse,relationsOpenKeys:U,onToggleRelations:se,relationsMap:L,onRelationChanged:ve},K.projectId))}):g.jsx(BV,{tree:pe,projectId:re,projectName:H.length===1?H[0].name:void 0,onLaunch:we,launchingIssues:x,launchErrors:S,forceExpand:!!T||P!=="all"||z!=="all",fetchTree:F,collapsedNodes:G.collapsedNodes,onToggleCollapse:G.toggleCollapse,relationsOpenKeys:U,onToggleRelations:se,relationsMap:L,onRelationChanged:ve})}),B&&g.jsx(zV,{issueNumber:B.issueNumber,issueKey:B.issueKey,message:B.message,onForce:ce,onQueue:Se,onCancel:()=>Y(null)})]})}function zV({issueNumber:e,issueKey:n,message:r,onForce:i,onQueue:a,onCancel:l}){const s=n??`#${e}`;return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:g.jsxs("div",{className:"w-[420px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",children:[g.jsx("div",{className:"px-5 py-4 border-b border-dark-border",children:g.jsxs("h3",{className:"text-sm font-semibold text-dark-text flex items-center gap-2",children:[g.jsxs("svg",{className:"w-4 h-4 text-[#F85149]",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M4.25 7.25a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5h-7.5Z"}),g.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z"})]}),"Issue ",s," has unresolved dependencies"]})}),g.jsxs("div",{className:"px-5 py-4",children:[g.jsx("p",{className:"text-sm text-dark-muted mb-3",children:r}),g.jsxs("p",{className:"text-xs text-dark-muted",children:["You can ",g.jsx("strong",{children:"queue"})," this issue to auto-launch when blockers resolve, or ",g.jsx("strong",{children:"force launch"})," to bypass the dependency check."]})]}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-3 border-t border-dark-border",children:[g.jsx("button",{onClick:l,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Cancel"}),g.jsx("button",{onClick:a,className:"px-4 py-1.5 text-sm font-medium rounded border border-[#58A6FF]/40 text-[#58A6FF] bg-[#58A6FF]/10 hover:bg-[#58A6FF]/20 transition-colors",children:"Queue"}),g.jsx("button",{onClick:i,className:"px-4 py-1.5 text-sm font-medium rounded border border-[#F85149]/40 text-[#F85149] bg-[#F85149]/10 hover:bg-[#F85149]/20 transition-colors",children:"Force Launch"})]})]})})}function Xb({issues:e,skippedActive:n,blockedIssues:r,projectId:i,api:a,fetchTree:l,onClose:s}){const[c,f]=b.useState(!1),[d,m]=b.useState(null),p=b.useCallback(async()=>{f(!0),m(null);try{await a.post("teams/launch-batch",{projectId:i,issues:e.map(x=>({number:x.number,title:x.title,issueKey:x.issueKey,issueProvider:x.issueProvider})),blockedIssues:r.length>0?r.map(x=>{var _,S;return{number:x.number,title:x.title,issueKey:x.issueKey,issueProvider:x.issueProvider,blockedBy:((S=(_=x.dependencies)==null?void 0:_.blockedBy)==null?void 0:S.filter(k=>k.state==="open").map(k=>k.number))??[]}}):void 0}),s(),setTimeout(()=>l(),3e3)}catch(x){const _=x instanceof Error?x.message:String(x);m(_),f(!1)}},[a,i,e,r,s,l]);if(e.length===0&&r.length===0)return null;const y=e.length>0?`Launch ${e.length} team${e.length!==1?"s":""}?`:`Queue ${r.length} team${r.length!==1?"s":""}?`;return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:g.jsxs("div",{className:"w-[480px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",children:[g.jsx("div",{className:"px-5 py-4 border-b border-dark-border",children:g.jsxs("h3",{className:"text-sm font-semibold text-dark-text flex items-center gap-2",children:[g.jsx("svg",{className:"w-4 h-4 text-[#3FB950]",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"})}),y]})}),g.jsxs("div",{className:"px-5 py-4 max-h-[50vh] overflow-auto",children:[e.length>0&&g.jsx("ul",{className:"space-y-1 mb-3",children:e.map(x=>g.jsxs("li",{className:"text-xs text-dark-text flex items-center gap-2",children:[g.jsxs("svg",{className:"w-3 h-3 text-[#3FB950] shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"})]}),g.jsx("span",{className:"text-dark-muted",children:x.issueKey??`#${x.number}`}),g.jsx("span",{className:"truncate",children:x.title})]},x.issueKey??x.number))}),r.length>0&&g.jsxs("div",{className:e.length>0?"border-t border-dark-border/40 pt-2 mb-3":"mb-3",children:[g.jsxs("p",{className:"text-xs text-[#D29922] mb-1",children:[r.length," issue",r.length!==1?"s":""," queued (waiting for dependencies to resolve)"]}),g.jsx("ul",{className:"space-y-1",children:r.map(x=>g.jsxs("li",{className:"text-xs text-dark-text flex items-center gap-2",children:[g.jsxs("svg",{className:"w-3 h-3 text-[#D29922] shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"})]}),g.jsx("span",{className:"text-dark-muted",children:x.issueKey??`#${x.number}`}),g.jsx("span",{className:"truncate",children:x.title})]},x.issueKey??x.number))})]}),n>0&&g.jsx("div",{className:"text-xs text-dark-muted space-y-0.5 mb-3 border-t border-dark-border/40 pt-2",children:g.jsxs("p",{children:[n," issue",n!==1?"s":""," skipped (already have active teams)"]})}),d&&g.jsx("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-xs text-[#F85149] mb-3",children:d})]}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-3 border-t border-dark-border",children:[g.jsx("button",{onClick:s,disabled:c,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors disabled:opacity-50",children:"Cancel"}),g.jsxs("button",{onClick:p,disabled:c,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded border border-[#3FB950]/40 text-[#3FB950] bg-[#3FB950]/10 hover:bg-[#3FB950]/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[c?g.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):g.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"})}),c?"Launching...":e.length>0?"Launch All":"Queue All"]})]})]})})}function x3({prioritization:e,tree:n,className:r,onRunAll:i,runAllDisabled:a}){return g.jsxs("div",{className:`flex items-center gap-2 ${r??""}`,children:[g.jsxs("button",{onClick:()=>e.prioritize(n),disabled:e.loading||n.length===0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded border border-[#A371F7]/50 text-[#A371F7] hover:bg-[#A371F7]/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"AI-prioritize open issues",children:[e.loading?g.jsxs("svg",{className:"w-3.5 h-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):g.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M7.823.9l4.584 4.584-7.636 7.636L.187 8.536 7.823.9ZM14.2 6.1l-1.3 1.3-4.584-4.584L9.6 1.5a1.5 1.5 0 012.122 0L14.2 3.978a1.5 1.5 0 010 2.122Z"})}),e.loading?"Prioritizing...":"Prioritize"]}),i&&g.jsxs("button",{onClick:i,disabled:a,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded border border-[#3FB950]/50 text-[#3FB950] hover:bg-[#3FB950]/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Launch teams for all launchable issues",children:[g.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1.5 3.5a.5.5 0 0 1 .8-.4l4.5 3.4a.5.5 0 0 1 0 .8l-4.5 3.4a.5.5 0 0 1-.8-.4V3.5Zm7 0a.5.5 0 0 1 .8-.4l4.5 3.4a.5.5 0 0 1 0 .8l-4.5 3.4a.5.5 0 0 1-.8-.4V3.5Z"})}),"Run All"]}),e.hasPriority&&g.jsxs("button",{onClick:e.reset,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-accent/50 transition-colors",title:"Clear prioritization",children:[g.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}),"Reset"]})]})}function b3({prioritization:e,projectId:n,api:r,fetchTree:i}){const[a,l]=b.useState(!1),s=b.useRef(new Set);b.useEffect(()=>()=>{for(const f of s.current)clearTimeout(f);s.current.clear()},[]);const c=b.useCallback(async()=>{const f=e.checkedSortedIssueNumbers;if(f.length!==0){l(!0);try{await r.post("teams/launch-batch",{projectId:n,issues:f.map(m=>{const p=e.priorityMap.get(m);return{number:m,title:p==null?void 0:p.title}})});const d=setTimeout(()=>{s.current.delete(d),i()},3e3);s.current.add(d)}catch(d){console.error("[IssueTree] Batch launch failed:",d instanceof Error?d.message:String(d))}finally{l(!1)}}},[r,e.checkedSortedIssueNumbers,e.priorityMap,n,i]);return e.hasPriority?g.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-dark-border/40 bg-[#A371F7]/5",children:[g.jsxs("span",{className:"text-xs text-dark-muted",children:[e.checkedIssues.size," of ",e.priorityMap.size," selected"]}),g.jsxs("button",{onClick:c,disabled:a||e.checkedIssues.size===0,className:"inline-flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded border border-[#3FB950]/50 text-[#3FB950] hover:bg-[#3FB950]/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[a?g.jsxs("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}):g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"})}),e.checkedIssues.size===e.priorityMap.size?"Launch all in order":`Launch ${e.checkedIssues.size} selected in order`]}),e.costUsd!=null&&g.jsxs("span",{className:"text-xs text-dark-muted ml-auto",children:["$",e.costUsd.toFixed(4)," · ",((e.durationMs??0)/1e3).toFixed(1),"s"]})]}):null}function IV({bucket:e,onLaunch:n,launchingIssues:r,launchErrors:i,forceExpand:a,fetchTree:l,collapsedNodes:s,onToggleCollapse:c,relationsOpenKeys:f,onToggleRelations:d,relationsMap:m,onRelationChanged:p}){const y=!s.has(e.key),x=(e.projects??[]).reduce((_,S)=>_+kc(S.tree),0);return g.jsxs("div",{children:[g.jsx("div",{className:"flex items-center gap-2 py-2 px-2 rounded hover:bg-dark-surface/60 transition-colors",children:g.jsxs("button",{onClick:()=>c(e.key),className:"flex items-center gap-2 flex-1 text-left min-w-0",children:[g.jsx("span",{className:`w-4 h-4 flex items-center justify-center text-dark-muted shrink-0 transition-transform duration-150 ${y?"rotate-90":""}`,children:g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"})})}),g.jsx("svg",{className:"w-4 h-4 text-dark-accent/70 shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"})}),g.jsx("span",{className:"text-sm font-semibold text-dark-text truncate",children:e.name}),g.jsxs("span",{className:"text-xs text-dark-muted shrink-0",children:[e.projects.length," project",e.projects.length!==1?"s":""," · ",x," issue",x!==1?"s":""]})]})}),y&&g.jsx("div",{className:"ml-2 border-l border-dark-accent/20 pl-1",children:g.jsx("div",{className:"space-y-1",children:e.projects.map(_=>g.jsx(w3,{group:_,onLaunch:n,launchingIssues:r,launchErrors:i,forceExpand:a,fetchTree:l,collapsedNodes:s,onToggleCollapse:c,relationsOpenKeys:f,onToggleRelations:d,relationsMap:m,onRelationChanged:p},_.projectId))})})]})}function w3({group:e,onLaunch:n,launchingIssues:r,launchErrors:i,forceExpand:a,fetchTree:l,collapsedNodes:s,onToggleCollapse:c,relationsOpenKeys:f,onToggleRelations:d,relationsMap:m,onRelationChanged:p}){const y=Ot(),x=`project-${e.projectId}`,_=!s.has(x),S=m3(),[k,j]=b.useState(!1),[C,N]=b.useState(!1),O=b.useMemo(()=>{if(e.providers&&e.providers.length>0)return e.providers;const L=new Set;function $(G){for(const B of G)L.add(B.issueProvider??"github"),$(B.children)}return $(e.tree),[...L].sort()},[e.tree,e.providers]),T=O.length>1,A=b.useMemo(()=>{if(!T)return null;const L=new Map;function $(G){for(const B of G){const Y=B.issueProvider??"github";L.set(Y,(L.get(Y)??0)+1),$(B.children)}}return $(e.tree),L},[e.tree,T]),P=b.useMemo(()=>{if(!T)return null;const L=new Map;function $(G){for(const B of G){const Y=B.issueProvider??"github";L.has(Y)||L.set(Y,[]),L.get(Y).push(B)}return L}return $(e.tree),L},[e.tree,T]),R=b.useMemo(()=>S.hasPriority?Kb(e.tree,S.priorityMap):e.tree,[e.tree,S.hasPriority,S.priorityMap]),z=b.useMemo(()=>Zb(e.tree),[e.tree]),D=Yb(R,s,a),U=kc(e.tree),q=b.useMemo(()=>{if(!T||!A)return`${U} issue${U!==1?"s":""}`;const L=O.filter($=>A.has($)).map($=>`${$.charAt(0).toUpperCase()+$.slice(1)}: ${A.get($)}`);return`${U} issue${U!==1?"s":""} (${L.join(", ")})`},[U,T,A,O]);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 py-2 px-2 rounded hover:bg-dark-surface/60 transition-colors",children:[g.jsxs("button",{onClick:()=>c(x),className:"flex items-center gap-2 flex-1 text-left min-w-0",children:[g.jsx("span",{className:`w-4 h-4 flex items-center justify-center text-dark-muted shrink-0 transition-transform duration-150 ${_?"rotate-90":""}`,children:g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"})})}),g.jsx("svg",{className:"w-4 h-4 text-dark-muted shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.25.25 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"})}),g.jsx("span",{className:"text-sm font-semibold text-dark-text truncate",children:e.projectName}),g.jsx("span",{className:"text-xs text-dark-muted shrink-0",children:q})]}),g.jsx("button",{onClick:()=>N(!0),className:"inline-flex items-center justify-center w-7 h-7 rounded border border-dark-border text-dark-muted hover:text-dark-accent hover:border-dark-accent/50 transition-colors",title:"View dependency graph",children:g.jsx(xA,{size:14})}),g.jsx(x3,{prioritization:S,tree:e.tree,onRunAll:()=>j(!0),runAllDisabled:z.launchable.length===0&&z.blocked.length===0})]}),S.error&&g.jsxs("div",{className:"mx-2 mb-1 px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-xs text-[#F85149]",children:["Prioritization failed: ",S.error]}),S.loading&&g.jsxs("div",{className:"mx-2 mb-1 px-3 py-2 rounded border border-[#A371F7]/30 bg-[#A371F7]/10 flex items-center gap-2",children:[g.jsxs("svg",{className:"w-4 h-4 text-[#A371F7] animate-spin shrink-0",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),g.jsx("span",{className:"text-xs text-[#A371F7]",children:"Prioritizing issues... this may take a few minutes"})]}),g.jsx(b3,{prioritization:S,projectId:e.projectId,api:y,fetchTree:l}),_&&g.jsx("div",{className:"ml-2 border-l border-dark-border/40 pl-1",children:T&&P?g.jsx("div",{className:"space-y-1",children:O.map(L=>{const $=P.get(L)??[];return $.length===0?null:g.jsx($V,{provider:L,issues:$,projectId:e.projectId,nodeKey:`provider-${e.projectId}-${L}`,onLaunch:n,launchingIssues:r,launchErrors:i,forceExpand:a,fetchTree:l,collapsedNodes:s,onToggleCollapse:c,api:y,relationsOpenKeys:f,onToggleRelations:d,relationsMap:m,onRelationChanged:p},`provider-${e.projectId}-${L}`)})}):g.jsx(Wb,{rows:D,onLaunch:n,launchingIssues:r,launchErrors:i,projectId:e.projectId,priorityMap:S.hasPriority?S.priorityMap:void 0,checkedIssues:S.hasPriority?S.checkedIssues:void 0,onCheckChange:S.hasPriority?S.toggleCheck:void 0,onPrioritizeSubtree:S.prioritizeSubtree,prioritizing:S.loading,collapsedNodes:s,onToggleCollapse:c,relationsOpenKeys:f,onToggleRelations:d,relationsMap:m,onRelationChanged:p,className:"max-h-[70vh]"})}),k&&g.jsx(Xb,{issues:z.launchable,skippedActive:z.skippedActive,blockedIssues:z.blocked,projectId:e.projectId,api:y,fetchTree:l,onClose:()=>j(!1)}),C&&g.jsx(v3,{issues:e.tree,projectName:e.projectName,onClose:()=>N(!1)})]})}function $V({provider:e,issues:n,projectId:r,nodeKey:i,onLaunch:a,launchingIssues:l,launchErrors:s,forceExpand:c,fetchTree:f,collapsedNodes:d,onToggleCollapse:m,api:p,relationsOpenKeys:y,onToggleRelations:x,relationsMap:_,onRelationChanged:S}){const k=!d.has(i),[j,C]=b.useState(!1),N=Yb(n,d,c),O=b.useMemo(()=>Zb(n),[n]),T=kc(n),A=e.charAt(0).toUpperCase()+e.slice(1);return g.jsxs("div",{"data-testid":`provider-subgroup-${e}`,children:[g.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-2 rounded hover:bg-dark-surface/40 transition-colors",children:[g.jsxs("button",{onClick:()=>m(i),className:"flex items-center gap-2 flex-1 text-left min-w-0",children:[g.jsx("span",{className:`w-3.5 h-3.5 flex items-center justify-center text-dark-muted shrink-0 transition-transform duration-150 ${k?"rotate-90":""}`,children:g.jsx("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"})})}),g.jsx(Iu,{provider:e,size:14,className:"text-dark-muted shrink-0"}),g.jsx("span",{className:"text-xs font-medium text-dark-text",children:A}),g.jsxs("span",{className:"text-xs text-dark-muted shrink-0",children:[T," issue",T!==1?"s":""]})]}),g.jsxs("button",{onClick:()=>C(!0),disabled:O.launchable.length===0&&O.blocked.length===0,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium rounded border border-[#3FB950]/50 text-[#3FB950] hover:bg-[#3FB950]/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:`Launch teams for all ${A} issues`,children:[g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1.5 3.5a.5.5 0 0 1 .8-.4l4.5 3.4a.5.5 0 0 1 0 .8l-4.5 3.4a.5.5 0 0 1-.8-.4V3.5Zm7 0a.5.5 0 0 1 .8-.4l4.5 3.4a.5.5 0 0 1 0 .8l-4.5 3.4a.5.5 0 0 1-.8-.4V3.5Z"})}),"Run All"]})]}),k&&g.jsx("div",{className:"ml-2 border-l border-dark-border/20 pl-1",children:g.jsx(Wb,{rows:N,onLaunch:a,launchingIssues:l,launchErrors:s,projectId:r,collapsedNodes:d,onToggleCollapse:m,relationsOpenKeys:y,onToggleRelations:x,relationsMap:_,onRelationChanged:S,className:"max-h-[60vh]"})}),j&&g.jsx(Xb,{issues:O.launchable,skippedActive:O.skippedActive,blockedIssues:O.blocked,projectId:r,api:p,fetchTree:f,onClose:()=>C(!1)})]})}function BV({tree:e,projectId:n,projectName:r,onLaunch:i,launchingIssues:a,launchErrors:l,forceExpand:s,fetchTree:c,collapsedNodes:f,onToggleCollapse:d,relationsOpenKeys:m,onToggleRelations:p,relationsMap:y,onRelationChanged:x}){const _=Ot(),S=m3(),[k,j]=b.useState(!1),[C,N]=b.useState(!1),O=b.useMemo(()=>S.hasPriority?Kb(e,S.priorityMap):e,[e,S.hasPriority,S.priorityMap]),T=b.useMemo(()=>Zb(e),[e]),A=Yb(O,f,s);return g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex items-center gap-2 px-2 pb-2 shrink-0",children:[g.jsx("button",{onClick:()=>N(!0),className:"inline-flex items-center justify-center w-7 h-7 rounded border border-dark-border text-dark-muted hover:text-dark-accent hover:border-dark-accent/50 transition-colors",title:"View dependency graph",children:g.jsx(xA,{size:14})}),g.jsx(x3,{prioritization:S,tree:e,onRunAll:n?()=>j(!0):void 0,runAllDisabled:T.launchable.length===0&&T.blocked.length===0})]}),S.error&&g.jsxs("div",{className:"mx-2 mb-2 px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-xs text-[#F85149] shrink-0",children:["Prioritization failed: ",S.error]}),S.loading&&g.jsxs("div",{className:"mx-2 mb-2 px-3 py-2 rounded border border-[#A371F7]/30 bg-[#A371F7]/10 flex items-center gap-2 shrink-0",children:[g.jsxs("svg",{className:"w-4 h-4 text-[#A371F7] animate-spin shrink-0",viewBox:"0 0 24 24",fill:"none",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),g.jsx("span",{className:"text-xs text-[#A371F7]",children:"Prioritizing issues... this may take a few minutes"})]}),n&&g.jsx(b3,{prioritization:S,projectId:n,api:_,fetchTree:c}),g.jsx(Wb,{rows:A,onLaunch:i,launchingIssues:a,launchErrors:l,projectId:n??void 0,priorityMap:S.hasPriority?S.priorityMap:void 0,checkedIssues:S.hasPriority?S.checkedIssues:void 0,onCheckChange:S.hasPriority?S.toggleCheck:void 0,onPrioritizeSubtree:S.prioritizeSubtree,prioritizing:S.loading,collapsedNodes:f,onToggleCollapse:d,relationsOpenKeys:m,onToggleRelations:p,relationsMap:y,onRelationChanged:x,className:"max-h-[70vh]"}),k&&n&&g.jsx(Xb,{issues:T.launchable,skippedActive:T.skippedActive,blockedIssues:T.blocked,projectId:n,api:_,fetchTree:c,onClose:()=>j(!1)}),C&&g.jsx(v3,{issues:e,projectName:r??"Project",onClose:()=>N(!1)})]})}function FV(e,n){var r;return n==="all"?!0:n==="no-team"?!e.activeTeam:n==="blocked-deps"?!!(e.dependencies&&!e.dependencies.resolved):((r=e.activeTeam)==null?void 0:r.status)===n}function nx(e,n,r,i="all"){const a=n.trim().length>0,l=r!=="all",s=i!=="all";if(!a&&!l&&!s)return e;const c=n.toLowerCase().trim(),f=/^\d+$/.test(c),d=c.startsWith("#")?parseInt(c.slice(1),10):f?parseInt(c,10):NaN;return e.reduce((m,p)=>{const y=!a||!isNaN(d)&&p.number===d||p.title.toLowerCase().includes(c),x=FV(p,r),_=!s||(p.issueProvider??"github")===i,S=y&&x&&_,k=nx(p.children,n,r,i);return(S||k.length>0)&&m.push({...p,children:k}),m},[])}function rx(e){const n=[];for(const r of e)n.push(r.number.toString()),r.children.length>0&&n.push(...rx(r.children));return n}function kc(e){let n=0;for(const r of e)n++,n+=kc(r.children);return n}function Zb(e){const n=[];let r=0;const i=[];function a(l){for(const s of l)s.state==="open"&&(s.activeTeam?r++:s.dependencies&&!s.dependencies.resolved?i.push(s):n.push(s)),a(s.children)}return a(e),{launchable:n,skippedActive:r,blocked:i}}function ix(e,n,r){const i=[];for(const a of e)a.children.length>0&&(n>=r&&i.push(a.number.toString()),i.push(...ix(a.children,n+1,r)));return i}function UV(e){try{return new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit"})}catch{return"--:--"}}function _3(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(r=_3(e[n]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function ot(){for(var e,n,r=0,i="",a=arguments.length;r<a;r++)(e=arguments[r])&&(n=_3(e))&&(i&&(i+=" "),i+=n);return i}var qV=["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"];function Qb(e){if(typeof e!="string")return!1;var n=qV;return n.includes(e)}var HV=["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"],GV=new Set(HV);function k3(e){return typeof e!="string"?!1:GV.has(e)}function S3(e){return typeof e=="string"&&e.startsWith("data-")}function ri(e){if(typeof e!="object"||e===null)return{};var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(k3(r)||S3(r))&&(n[r]=e[r]);return n}function wm(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var n=e.props;return ri(n)}return typeof e=="object"&&!Array.isArray(e)?ri(e):null}function dn(e){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(k3(r)||S3(r)||Qb(r))&&(n[r]=e[r]);return n}function KV(e){return e==null?null:b.isValidElement(e)?dn(e.props):typeof e=="object"&&!Array.isArray(e)?dn(e):null}var VV=["children","width","height","viewBox","className","style","title","desc"];function ax(){return ax=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ax.apply(null,arguments)}function YV(e,n){if(e==null)return{};var r,i,a=WV(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function WV(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var j3=b.forwardRef((e,n)=>{var{children:r,width:i,height:a,viewBox:l,className:s,style:c,title:f,desc:d}=e,m=YV(e,VV),p=l||{width:i,height:a,x:0,y:0},y=ot("recharts-surface",s);return b.createElement("svg",ax({},dn(m),{className:y,width:i,height:a,style:c,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:n}),b.createElement("title",null,f),b.createElement("desc",null,d),r)}),XV=["children","className"];function lx(){return lx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},lx.apply(null,arguments)}function ZV(e,n){if(e==null)return{};var r,i,a=QV(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function QV(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var ii=b.forwardRef((e,n)=>{var{children:r,className:i}=e,a=ZV(e,XV),l=ot("recharts-layer",i);return b.createElement("g",lx({className:l},dn(a),{ref:n}),r)}),JV=b.createContext(null);function ft(e){return function(){return e}}const E3=Math.cos,ph=Math.sin,Lr=Math.sqrt,gh=Math.PI,_m=2*gh,ox=Math.PI,sx=2*ox,ml=1e-6,eY=sx-ml;function C3(e){this._+=e[0];for(let n=1,r=e.length;n<r;++n)this._+=arguments[n]+e[n]}function tY(e){let n=Math.floor(e);if(!(n>=0))throw new Error(`invalid digits: ${e}`);if(n>15)return C3;const r=10**n;return function(i){this._+=i[0];for(let a=1,l=i.length;a<l;++a)this._+=Math.round(arguments[a]*r)/r+i[a]}}class nY{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?C3:tY(n)}moveTo(n,r){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,r){this._append`L${this._x1=+n},${this._y1=+r}`}quadraticCurveTo(n,r,i,a){this._append`Q${+n},${+r},${this._x1=+i},${this._y1=+a}`}bezierCurveTo(n,r,i,a,l,s){this._append`C${+n},${+r},${+i},${+a},${this._x1=+l},${this._y1=+s}`}arcTo(n,r,i,a,l){if(n=+n,r=+r,i=+i,a=+a,l=+l,l<0)throw new Error(`negative radius: ${l}`);let s=this._x1,c=this._y1,f=i-n,d=a-r,m=s-n,p=c-r,y=m*m+p*p;if(this._x1===null)this._append`M${this._x1=n},${this._y1=r}`;else if(y>ml)if(!(Math.abs(p*f-d*m)>ml)||!l)this._append`L${this._x1=n},${this._y1=r}`;else{let x=i-s,_=a-c,S=f*f+d*d,k=x*x+_*_,j=Math.sqrt(S),C=Math.sqrt(y),N=l*Math.tan((ox-Math.acos((S+y-k)/(2*j*C)))/2),O=N/C,T=N/j;Math.abs(O-1)>ml&&this._append`L${n+O*m},${r+O*p}`,this._append`A${l},${l},0,0,${+(p*x>m*_)},${this._x1=n+T*f},${this._y1=r+T*d}`}}arc(n,r,i,a,l,s){if(n=+n,r=+r,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let c=i*Math.cos(a),f=i*Math.sin(a),d=n+c,m=r+f,p=1^s,y=s?a-l:l-a;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>ml||Math.abs(this._y1-m)>ml)&&this._append`L${d},${m}`,i&&(y<0&&(y=y%sx+sx),y>eY?this._append`A${i},${i},0,1,${p},${n-c},${r-f}A${i},${i},0,1,${p},${this._x1=d},${this._y1=m}`:y>ml&&this._append`A${i},${i},0,${+(y>=ox)},${p},${this._x1=n+i*Math.cos(l)},${this._y1=r+i*Math.sin(l)}`)}rect(n,r,i,a){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+r}h${i=+i}v${+a}h${-i}Z`}toString(){return this._}}function Jb(e){let n=3;return e.digits=function(r){if(!arguments.length)return n;if(r==null)n=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);n=i}return e},()=>new nY(n)}function e1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function N3(e){this._context=e}N3.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(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;default:this._context.lineTo(e,n);break}}};function km(e){return new N3(e)}function O3(e){return e[0]}function A3(e){return e[1]}function T3(e,n){var r=ft(!0),i=null,a=km,l=null,s=Jb(c);e=typeof e=="function"?e:e===void 0?O3:ft(e),n=typeof n=="function"?n:n===void 0?A3:ft(n);function c(f){var d,m=(f=e1(f)).length,p,y=!1,x;for(i==null&&(l=a(x=s())),d=0;d<=m;++d)!(d<m&&r(p=f[d],d,f))===y&&((y=!y)?l.lineStart():l.lineEnd()),y&&l.point(+e(p,d,f),+n(p,d,f));if(x)return l=null,x+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),c):e},c.y=function(f){return arguments.length?(n=typeof f=="function"?f:ft(+f),c):n},c.defined=function(f){return arguments.length?(r=typeof f=="function"?f:ft(!!f),c):r},c.curve=function(f){return arguments.length?(a=f,i!=null&&(l=a(i)),c):a},c.context=function(f){return arguments.length?(f==null?i=l=null:l=a(i=f),c):i},c}function vd(e,n,r){var i=null,a=ft(!0),l=null,s=km,c=null,f=Jb(d);e=typeof e=="function"?e:e===void 0?O3:ft(+e),n=typeof n=="function"?n:ft(n===void 0?0:+n),r=typeof r=="function"?r:r===void 0?A3:ft(+r);function d(p){var y,x,_,S=(p=e1(p)).length,k,j=!1,C,N=new Array(S),O=new Array(S);for(l==null&&(c=s(C=f())),y=0;y<=S;++y){if(!(y<S&&a(k=p[y],y,p))===j)if(j=!j)x=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),_=y-1;_>=x;--_)c.point(N[_],O[_]);c.lineEnd(),c.areaEnd()}j&&(N[y]=+e(k,y,p),O[y]=+n(k,y,p),c.point(i?+i(k,y,p):N[y],r?+r(k,y,p):O[y]))}if(C)return c=null,C+""||null}function m(){return T3().defined(a).curve(s).context(l)}return d.x=function(p){return arguments.length?(e=typeof p=="function"?p:ft(+p),i=null,d):e},d.x0=function(p){return arguments.length?(e=typeof p=="function"?p:ft(+p),d):e},d.x1=function(p){return arguments.length?(i=p==null?null:typeof p=="function"?p:ft(+p),d):i},d.y=function(p){return arguments.length?(n=typeof p=="function"?p:ft(+p),r=null,d):n},d.y0=function(p){return arguments.length?(n=typeof p=="function"?p:ft(+p),d):n},d.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ft(+p),d):r},d.lineX0=d.lineY0=function(){return m().x(e).y(n)},d.lineY1=function(){return m().x(e).y(r)},d.lineX1=function(){return m().x(i).y(n)},d.defined=function(p){return arguments.length?(a=typeof p=="function"?p:ft(!!p),d):a},d.curve=function(p){return arguments.length?(s=p,l!=null&&(c=s(l)),d):s},d.context=function(p){return arguments.length?(p==null?l=c=null:c=s(l=p),d):l},d}class M3{constructor(n,r){this._context=n,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(n,r){switch(n=+n,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,r,n,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,n,this._y0,n,r);break}}this._x0=n,this._y0=r}}function rY(e){return new M3(e,!0)}function iY(e){return new M3(e,!1)}const t1={draw(e,n){const r=Lr(n/gh);e.moveTo(r,0),e.arc(0,0,r,0,_m)}},aY={draw(e,n){const r=Lr(n/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},P3=Lr(1/3),lY=P3*2,oY={draw(e,n){const r=Lr(n/lY),i=r*P3;e.moveTo(0,-r),e.lineTo(i,0),e.lineTo(0,r),e.lineTo(-i,0),e.closePath()}},sY={draw(e,n){const r=Lr(n),i=-r/2;e.rect(i,i,r,r)}},uY=.8908130915292852,D3=ph(gh/10)/ph(7*gh/10),cY=ph(_m/10)*D3,fY=-E3(_m/10)*D3,dY={draw(e,n){const r=Lr(n*uY),i=cY*r,a=fY*r;e.moveTo(0,-r),e.lineTo(i,a);for(let l=1;l<5;++l){const s=_m*l/5,c=E3(s),f=ph(s);e.lineTo(f*r,-c*r),e.lineTo(c*i-f*a,f*i+c*a)}e.closePath()}},Wv=Lr(3),hY={draw(e,n){const r=-Lr(n/(Wv*3));e.moveTo(0,r*2),e.lineTo(-Wv*r,-r),e.lineTo(Wv*r,-r),e.closePath()}},cr=-.5,fr=Lr(3)/2,ux=1/Lr(12),mY=(ux/2+1)*3,pY={draw(e,n){const r=Lr(n/mY),i=r/2,a=r*ux,l=i,s=r*ux+r,c=-l,f=s;e.moveTo(i,a),e.lineTo(l,s),e.lineTo(c,f),e.lineTo(cr*i-fr*a,fr*i+cr*a),e.lineTo(cr*l-fr*s,fr*l+cr*s),e.lineTo(cr*c-fr*f,fr*c+cr*f),e.lineTo(cr*i+fr*a,cr*a-fr*i),e.lineTo(cr*l+fr*s,cr*s-fr*l),e.lineTo(cr*c+fr*f,cr*f-fr*c),e.closePath()}};function gY(e,n){let r=null,i=Jb(a);e=typeof e=="function"?e:ft(e||t1),n=typeof n=="function"?n:ft(n===void 0?64:+n);function a(){let l;if(r||(r=l=i()),e.apply(this,arguments).draw(r,+n.apply(this,arguments)),l)return r=null,l+""||null}return a.type=function(l){return arguments.length?(e=typeof l=="function"?l:ft(l),a):e},a.size=function(l){return arguments.length?(n=typeof l=="function"?l:ft(+l),a):n},a.context=function(l){return arguments.length?(r=l??null,a):r},a}function vh(){}function yh(e,n,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+n)/6,(e._y0+4*e._y1+r)/6)}function R3(e){this._context=e}R3.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:yh(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(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);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:yh(this,e,n);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n}};function vY(e){return new R3(e)}function L3(e){this._context=e}L3.prototype={areaStart:vh,areaEnd:vh,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(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._x2=e,this._y2=n;break;case 1:this._point=2,this._x3=e,this._y3=n;break;case 2:this._point=3,this._x4=e,this._y4=n,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+n)/6);break;default:yh(this,e,n);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n}};function yY(e){return new L3(e)}function z3(e){this._context=e}z3.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(e,n){switch(e=+e,n=+n,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+e)/6,i=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:yh(this,e,n);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n}};function xY(e){return new z3(e)}function I3(e){this._context=e}I3.prototype={areaStart:vh,areaEnd:vh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,n){e=+e,n=+n,this._point?this._context.lineTo(e,n):(this._point=1,this._context.moveTo(e,n))}};function bY(e){return new I3(e)}function vE(e){return e<0?-1:1}function yE(e,n,r){var i=e._x1-e._x0,a=n-e._x1,l=(e._y1-e._y0)/(i||a<0&&-0),s=(r-e._y1)/(a||i<0&&-0),c=(l*a+s*i)/(i+a);return(vE(l)+vE(s))*Math.min(Math.abs(l),Math.abs(s),.5*Math.abs(c))||0}function xE(e,n){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-n)/2:n}function Xv(e,n,r){var i=e._x0,a=e._y0,l=e._x1,s=e._y1,c=(l-i)/3;e._context.bezierCurveTo(i+c,a+c*n,l-c,s-c*r,l,s)}function xh(e){this._context=e}xh.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:Xv(this,this._t0,xE(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,n){var r=NaN;if(e=+e,n=+n,!(e===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3,Xv(this,xE(this,r=yE(this,e,n)),r);break;default:Xv(this,this._t0,r=yE(this,e,n));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._t0=r}}};function $3(e){this._context=new B3(e)}($3.prototype=Object.create(xh.prototype)).point=function(e,n){xh.prototype.point.call(this,n,e)};function B3(e){this._context=e}B3.prototype={moveTo:function(e,n){this._context.moveTo(n,e)},closePath:function(){this._context.closePath()},lineTo:function(e,n){this._context.lineTo(n,e)},bezierCurveTo:function(e,n,r,i,a,l){this._context.bezierCurveTo(n,e,i,r,l,a)}};function wY(e){return new xh(e)}function _Y(e){return new $3(e)}function F3(e){this._context=e}F3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,n=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],n[0]):this._context.moveTo(e[0],n[0]),r===2)this._context.lineTo(e[1],n[1]);else for(var i=bE(e),a=bE(n),l=0,s=1;s<r;++l,++s)this._context.bezierCurveTo(i[0][l],a[0][l],i[1][l],a[1][l],e[s],n[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,n){this._x.push(+e),this._y.push(+n)}};function bE(e){var n,r=e.length-1,i,a=new Array(r),l=new Array(r),s=new Array(r);for(a[0]=0,l[0]=2,s[0]=e[0]+2*e[1],n=1;n<r-1;++n)a[n]=1,l[n]=4,s[n]=4*e[n]+2*e[n+1];for(a[r-1]=2,l[r-1]=7,s[r-1]=8*e[r-1]+e[r],n=1;n<r;++n)i=a[n]/l[n-1],l[n]-=i,s[n]-=i*s[n-1];for(a[r-1]=s[r-1]/l[r-1],n=r-2;n>=0;--n)a[n]=(s[n]-a[n+1])/l[n];for(l[r-1]=(e[r]+a[r-1])/2,n=0;n<r-1;++n)l[n]=2*e[n+1]-a[n+1];return[a,l]}function kY(e){return new F3(e)}function Sm(e,n){this._context=e,this._t=n}Sm.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(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(e,n);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,n)}break}}this._x=e,this._y=n}};function SY(e){return new Sm(e,.5)}function jY(e){return new Sm(e,0)}function EY(e){return new Sm(e,1)}function Nl(e,n){if((s=e.length)>1)for(var r=1,i,a,l=e[n[0]],s,c=l.length;r<s;++r)for(a=l,l=e[n[r]],i=0;i<c;++i)l[i][1]+=l[i][0]=isNaN(a[i][1])?a[i][0]:a[i][1]}function cx(e){for(var n=e.length,r=new Array(n);--n>=0;)r[n]=n;return r}function CY(e,n){return e[n]}function NY(e){const n=[];return n.key=e,n}function OY(){var e=ft([]),n=cx,r=Nl,i=CY;function a(l){var s=Array.from(e.apply(this,arguments),NY),c,f=s.length,d=-1,m;for(const p of l)for(c=0,++d;c<f;++c)(s[c][d]=[0,+i(p,s[c].key,d,l)]).data=p;for(c=0,m=e1(n(s));c<f;++c)s[m[c]].index=c;return r(s,m),s}return a.keys=function(l){return arguments.length?(e=typeof l=="function"?l:ft(Array.from(l)),a):e},a.value=function(l){return arguments.length?(i=typeof l=="function"?l:ft(+l),a):i},a.order=function(l){return arguments.length?(n=l==null?cx:typeof l=="function"?l:ft(Array.from(l)),a):n},a.offset=function(l){return arguments.length?(r=l??Nl,a):r},a}function AY(e,n){if((i=e.length)>0){for(var r,i,a=0,l=e[0].length,s;a<l;++a){for(s=r=0;r<i;++r)s+=e[r][a][1]||0;if(s)for(r=0;r<i;++r)e[r][a][1]/=s}Nl(e,n)}}function TY(e,n){if((a=e.length)>0){for(var r=0,i=e[n[0]],a,l=i.length;r<l;++r){for(var s=0,c=0;s<a;++s)c+=e[s][r][1]||0;i[r][1]+=i[r][0]=-c/2}Nl(e,n)}}function MY(e,n){if(!(!((s=e.length)>0)||!((l=(a=e[n[0]]).length)>0))){for(var r=0,i=1,a,l,s;i<l;++i){for(var c=0,f=0,d=0;c<s;++c){for(var m=e[n[c]],p=m[i][1]||0,y=m[i-1][1]||0,x=(p-y)/2,_=0;_<c;++_){var S=e[n[_]],k=S[i][1]||0,j=S[i-1][1]||0;x+=k-j}f+=p,d+=x*p}a[i-1][1]+=a[i-1][0]=r,f&&(r-=d/f)}a[i-1][1]+=a[i-1][0]=r,Nl(e,n)}}var Zv={},Qv={},wE;function PY(){return wE||(wE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return r==="__proto__"}e.isUnsafeProperty=n})(Qv)),Qv}var Jv={},_E;function U3(){return _E||(_E=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=n})(Jv)),Jv}var e0={},kE;function n1(){return kE||(kE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){var i;return typeof r=="string"||typeof r=="symbol"?r:Object.is((i=r==null?void 0:r.valueOf)==null?void 0:i.call(r),-0)?"-0":String(r)}e.toKey=n})(e0)),e0}var t0={},n0={},SE;function DY(){return SE||(SE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(n).join(",");const i=String(r);return i==="0"&&Object.is(Number(r),-0)?"-0":i}e.toString=n})(n0)),n0}var jE;function r1(){return jE||(jE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=DY(),r=n1();function i(a){if(Array.isArray(a))return a.map(r.toKey);if(typeof a=="symbol")return[a];a=n.toString(a);const l=[],s=a.length;if(s===0)return l;let c=0,f="",d="",m=!1;for(a.charCodeAt(0)===46&&(l.push(""),c++);c<s;){const p=a[c];d?p==="\\"&&c+1<s?(c++,f+=a[c]):p===d?d="":f+=p:m?p==='"'||p==="'"?d=p:p==="]"?(m=!1,l.push(f),f=""):f+=p:p==="["?(m=!0,f&&(l.push(f),f="")):p==="."?f&&(l.push(f),f=""):f+=p,c++}return f&&l.push(f),l}e.toPath=i})(t0)),t0}var EE;function i1(){return EE||(EE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=PY(),r=U3(),i=n1(),a=r1();function l(c,f,d){if(c==null)return d;switch(typeof f){case"string":{if(n.isUnsafeProperty(f))return d;const m=c[f];return m===void 0?r.isDeepKey(f)?l(c,a.toPath(f),d):d:m}case"number":case"symbol":{typeof f=="number"&&(f=i.toKey(f));const m=c[f];return m===void 0?d:m}default:{if(Array.isArray(f))return s(c,f,d);if(Object.is(f==null?void 0:f.valueOf(),-0)?f="-0":f=String(f),n.isUnsafeProperty(f))return d;const m=c[f];return m===void 0?d:m}}}function s(c,f,d){if(f.length===0)return d;let m=c;for(let p=0;p<f.length;p++){if(m==null||n.isUnsafeProperty(f[p]))return d;m=m[f[p]]}return m===void 0?d:m}e.get=l})(Zv)),Zv}var r0,CE;function RY(){return CE||(CE=1,r0=i1().get),r0}var LY=RY();const jm=oi(LY);var zY=4;function La(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zY,r=10**n,i=Math.round(e*r)/r;return Object.is(i,-0)?0:i}function Et(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.reduce((a,l,s)=>{var c=r[s-1];return typeof c=="string"?a+c+l:c!==void 0?a+La(c)+l:a+l},"")}var yr=e=>e===0?0:e>0?1:-1,Wi=e=>typeof e=="number"&&e!=+e,Ol=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!Wi(e),br=e=>Ce(e)||typeof e=="string",IY=0,Zu=e=>{var n=++IY;return"".concat(e||"").concat(n)},$a=function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(n)&&typeof n!="string")return i;var l;if(Ol(n)){if(r==null)return i;var s=n.indexOf("%");l=r*parseFloat(n.slice(0,s))/100}else l=+n;return Wi(l)&&(l=i),a&&r!=null&&l>r&&(l=r),l},q3=e=>{if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i<n;i++)if(!r[String(e[i])])r[String(e[i])]=!0;else return!0;return!1};function An(e,n,r){return Ce(e)&&Ce(n)?La(e+r*(n-e)):n}function H3(e,n,r){if(!(!e||!e.length))return e.find(i=>i&&(typeof n=="function"?n(i):jm(i,n))===r)}var Gt=e=>e===null||typeof e>"u",Sc=e=>Gt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Mn(e){return e!=null}function zl(){}var $Y=["type","size","sizeType"];function fx(){return fx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},fx.apply(null,arguments)}function NE(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function OE(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?NE(Object(r),!0).forEach(function(i){BY(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NE(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function BY(e,n,r){return(n=FY(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function FY(e){var n=UY(e,"string");return typeof n=="symbol"?n:n+""}function UY(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function qY(e,n){if(e==null)return{};var r,i,a=HY(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function HY(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var G3={symbolCircle:t1,symbolCross:aY,symbolDiamond:oY,symbolSquare:sY,symbolStar:dY,symbolTriangle:hY,symbolWye:pY},GY=Math.PI/180,KY=e=>{var n="symbol".concat(Sc(e));return G3[n]||t1},VY=(e,n,r)=>{if(n==="area")return e;switch(r){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*GY;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*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}},YY=(e,n)=>{G3["symbol".concat(Sc(e))]=n},K3=e=>{var{type:n="circle",size:r=64,sizeType:i="area"}=e,a=qY(e,$Y),l=OE(OE({},a),{},{type:n,size:r,sizeType:i}),s="circle";typeof n=="string"&&(s=n);var c=()=>{var y=KY(s),x=gY().type(y).size(VY(r,i,s)),_=x();if(_!==null)return _},{className:f,cx:d,cy:m}=l,p=dn(l);return Ce(d)&&Ce(m)&&Ce(r)?b.createElement("path",fx({},p,{className:ot("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(m,")"),d:c()})):null};K3.registerSymbol=YY;var V3=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,a1=(e,n)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(b.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var i={};return Object.keys(r).forEach(a=>{Qb(a)&&typeof r[a]=="function"&&(i[a]=(l=>r[a](r,l)))}),i},WY=(e,n,r)=>i=>(e(n,r,i),null),XY=(e,n,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var i=null;return Object.keys(e).forEach(a=>{var l=e[a];Qb(a)&&typeof l=="function"&&(i||(i={}),i[a]=WY(l,n,r))}),i};function AE(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function ZY(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?AE(Object(r),!0).forEach(function(i){QY(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AE(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function QY(e,n,r){return(n=JY(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function JY(e){var n=eW(e,"string");return typeof n=="symbol"?n:n+""}function eW(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function bn(e,n){var r=ZY({},e),i=n,a=Object.keys(n),l=a.reduce((s,c)=>(s[c]===void 0&&i[c]!==void 0&&(s[c]=i[c]),s),r);return l}var i0={},a0={},TE;function tW(){return TE||(TE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r,i){const a=new Map;for(let l=0;l<r.length;l++){const s=r[l],c=i(s,l,r);a.has(c)||a.set(c,s)}return Array.from(a.values())}e.uniqBy=n})(a0)),a0}var l0={},ME;function nW(){return ME||(ME=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r,i){return function(...a){return r.apply(this,a.slice(0,i))}}e.ary=n})(l0)),l0}var o0={},PE;function Y3(){return PE||(PE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return r}e.identity=n})(o0)),o0}var s0={},u0={},c0={},DE;function rW(){return DE||(DE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=n})(c0)),c0}var RE;function W3(){return RE||(RE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=rW();function r(i){return i!=null&&typeof i!="function"&&n.isLength(i.length)}e.isArrayLike=r})(u0)),u0}var f0={},LE;function iW(){return LE||(LE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return typeof r=="object"&&r!==null}e.isObjectLike=n})(f0)),f0}var zE;function aW(){return zE||(zE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=W3(),r=iW();function i(a){return r.isObjectLike(a)&&n.isArrayLike(a)}e.isArrayLikeObject=i})(s0)),s0}var d0={},h0={},IE;function lW(){return IE||(IE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=i1();function r(i){return function(a){return n.get(a,i)}}e.property=r})(h0)),h0}var m0={},p0={},g0={},v0={},$E;function X3(){return $E||($E=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=n})(v0)),v0}var y0={},BE;function Z3(){return BE||(BE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=n})(y0)),y0}var x0={},FE;function Q3(){return FE||(FE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r,i){return r===i||Number.isNaN(r)&&Number.isNaN(i)}e.isEqualsSameValueZero=n})(x0)),x0}var UE;function oW(){return UE||(UE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=X3(),r=Z3(),i=Q3();function a(m,p,y){return typeof y!="function"?a(m,p,()=>{}):l(m,p,function x(_,S,k,j,C,N){const O=y(_,S,k,j,C,N);return O!==void 0?!!O:l(_,S,x,N)},new Map)}function l(m,p,y,x){if(p===m)return!0;switch(typeof p){case"object":return s(m,p,y,x);case"function":return Object.keys(p).length>0?l(m,{...p},y,x):i.isEqualsSameValueZero(m,p);default:return n.isObject(m)?typeof p=="string"?p==="":!0:i.isEqualsSameValueZero(m,p)}}function s(m,p,y,x){if(p==null)return!0;if(Array.isArray(p))return f(m,p,y,x);if(p instanceof Map)return c(m,p,y,x);if(p instanceof Set)return d(m,p,y,x);const _=Object.keys(p);if(m==null||r.isPrimitive(m))return _.length===0;if(_.length===0)return!0;if(x!=null&&x.has(p))return x.get(p)===m;x==null||x.set(p,m);try{for(let S=0;S<_.length;S++){const k=_[S];if(!r.isPrimitive(m)&&!(k in m)||p[k]===void 0&&m[k]!==void 0||p[k]===null&&m[k]!==null||!y(m[k],p[k],k,m,p,x))return!1}return!0}finally{x==null||x.delete(p)}}function c(m,p,y,x){if(p.size===0)return!0;if(!(m instanceof Map))return!1;for(const[_,S]of p.entries()){const k=m.get(_);if(y(k,S,_,m,p,x)===!1)return!1}return!0}function f(m,p,y,x){if(p.length===0)return!0;if(!Array.isArray(m))return!1;const _=new Set;for(let S=0;S<p.length;S++){const k=p[S];let j=!1;for(let C=0;C<m.length;C++){if(_.has(C))continue;const N=m[C];let O=!1;if(y(N,k,S,m,p,x)&&(O=!0),O){_.add(C),j=!0;break}}if(!j)return!1}return!0}function d(m,p,y,x){return p.size===0?!0:m instanceof Set?f([...m],[...p],y,x):!1}e.isMatchWith=a,e.isSetMatch=d})(g0)),g0}var qE;function J3(){return qE||(qE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=oW();function r(i,a){return n.isMatchWith(i,a,()=>{})}e.isMatch=r})(p0)),p0}var b0={},w0={},_0={},HE;function sW(){return HE||(HE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return Object.getOwnPropertySymbols(r).filter(i=>Object.prototype.propertyIsEnumerable.call(r,i))}e.getSymbols=n})(_0)),_0}var k0={},GE;function l1(){return GE||(GE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=n})(k0)),k0}var S0={},KE;function eT(){return KE||(KE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n="[object RegExp]",r="[object String]",i="[object Number]",a="[object Boolean]",l="[object Arguments]",s="[object Symbol]",c="[object Date]",f="[object Map]",d="[object Set]",m="[object Array]",p="[object Function]",y="[object ArrayBuffer]",x="[object Object]",_="[object Error]",S="[object DataView]",k="[object Uint8Array]",j="[object Uint8ClampedArray]",C="[object Uint16Array]",N="[object Uint32Array]",O="[object BigUint64Array]",T="[object Int8Array]",A="[object Int16Array]",P="[object Int32Array]",R="[object BigInt64Array]",z="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=l,e.arrayBufferTag=y,e.arrayTag=m,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=O,e.booleanTag=a,e.dataViewTag=S,e.dateTag=c,e.errorTag=_,e.float32ArrayTag=z,e.float64ArrayTag=D,e.functionTag=p,e.int16ArrayTag=A,e.int32ArrayTag=P,e.int8ArrayTag=T,e.mapTag=f,e.numberTag=i,e.objectTag=x,e.regexpTag=n,e.setTag=d,e.stringTag=r,e.symbolTag=s,e.uint16ArrayTag=C,e.uint32ArrayTag=N,e.uint8ArrayTag=k,e.uint8ClampedArrayTag=j})(S0)),S0}var j0={},VE;function uW(){return VE||(VE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=n})(j0)),j0}var YE;function tT(){return YE||(YE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=sW(),r=l1(),i=eT(),a=Z3(),l=uW();function s(m,p){return c(m,void 0,m,new Map,p)}function c(m,p,y,x=new Map,_=void 0){const S=_==null?void 0:_(m,p,y,x);if(S!==void 0)return S;if(a.isPrimitive(m))return m;if(x.has(m))return x.get(m);if(Array.isArray(m)){const k=new Array(m.length);x.set(m,k);for(let j=0;j<m.length;j++)k[j]=c(m[j],j,y,x,_);return Object.hasOwn(m,"index")&&(k.index=m.index),Object.hasOwn(m,"input")&&(k.input=m.input),k}if(m instanceof Date)return new Date(m.getTime());if(m instanceof RegExp){const k=new RegExp(m.source,m.flags);return k.lastIndex=m.lastIndex,k}if(m instanceof Map){const k=new Map;x.set(m,k);for(const[j,C]of m)k.set(j,c(C,j,y,x,_));return k}if(m instanceof Set){const k=new Set;x.set(m,k);for(const j of m)k.add(c(j,void 0,y,x,_));return k}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(l.isTypedArray(m)){const k=new(Object.getPrototypeOf(m)).constructor(m.length);x.set(m,k);for(let j=0;j<m.length;j++)k[j]=c(m[j],j,y,x,_);return k}if(m instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer)return m.slice(0);if(m instanceof DataView){const k=new DataView(m.buffer.slice(0),m.byteOffset,m.byteLength);return x.set(m,k),f(k,m,y,x,_),k}if(typeof File<"u"&&m instanceof File){const k=new File([m],m.name,{type:m.type});return x.set(m,k),f(k,m,y,x,_),k}if(typeof Blob<"u"&&m instanceof Blob){const k=new Blob([m],{type:m.type});return x.set(m,k),f(k,m,y,x,_),k}if(m instanceof Error){const k=structuredClone(m);return x.set(m,k),k.message=m.message,k.name=m.name,k.stack=m.stack,k.cause=m.cause,k.constructor=m.constructor,f(k,m,y,x,_),k}if(m instanceof Boolean){const k=new Boolean(m.valueOf());return x.set(m,k),f(k,m,y,x,_),k}if(m instanceof Number){const k=new Number(m.valueOf());return x.set(m,k),f(k,m,y,x,_),k}if(m instanceof String){const k=new String(m.valueOf());return x.set(m,k),f(k,m,y,x,_),k}if(typeof m=="object"&&d(m)){const k=Object.create(Object.getPrototypeOf(m));return x.set(m,k),f(k,m,y,x,_),k}return m}function f(m,p,y=m,x,_){const S=[...Object.keys(p),...n.getSymbols(p)];for(let k=0;k<S.length;k++){const j=S[k],C=Object.getOwnPropertyDescriptor(m,j);(C==null||C.writable)&&(m[j]=c(p[j],j,y,x,_))}}function d(m){switch(r.getTag(m)){case i.argumentsTag:case i.arrayTag:case i.arrayBufferTag:case i.dataViewTag:case i.booleanTag:case i.dateTag:case i.float32ArrayTag:case i.float64ArrayTag:case i.int8ArrayTag:case i.int16ArrayTag:case i.int32ArrayTag:case i.mapTag:case i.numberTag:case i.objectTag:case i.regexpTag:case i.setTag:case i.stringTag:case i.symbolTag:case i.uint8ArrayTag:case i.uint8ClampedArrayTag:case i.uint16ArrayTag:case i.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=c,e.copyProperties=f})(w0)),w0}var WE;function cW(){return WE||(WE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=tT();function r(i){return n.cloneDeepWithImpl(i,void 0,i,new Map,void 0)}e.cloneDeep=r})(b0)),b0}var XE;function fW(){return XE||(XE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=J3(),r=cW();function i(a){return a=r.cloneDeep(a),l=>n.isMatch(l,a)}e.matches=i})(m0)),m0}var E0={},C0={},N0={},ZE;function dW(){return ZE||(ZE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=tT(),r=l1(),i=eT();function a(l,s){return n.cloneDeepWith(l,(c,f,d,m)=>{const p=s==null?void 0:s(c,f,d,m);if(p!==void 0)return p;if(typeof l=="object"){if(r.getTag(l)===i.objectTag&&typeof l.constructor!="function"){const y={};return m.set(l,y),n.copyProperties(y,l,d,m),y}switch(Object.prototype.toString.call(l)){case i.numberTag:case i.stringTag:case i.booleanTag:{const y=new l.constructor(l==null?void 0:l.valueOf());return n.copyProperties(y,l),y}case i.argumentsTag:{const y={};return n.copyProperties(y,l),y.length=l.length,y[Symbol.iterator]=l[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=a})(N0)),N0}var QE;function hW(){return QE||(QE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=dW();function r(i){return n.cloneDeepWith(i)}e.cloneDeep=r})(C0)),C0}var O0={},A0={},JE;function nT(){return JE||(JE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=/^(?:0|[1-9]\d*)$/;function r(i,a=Number.MAX_SAFE_INTEGER){switch(typeof i){case"number":return Number.isInteger(i)&&i>=0&&i<a;case"symbol":return!1;case"string":return n.test(i)}}e.isIndex=r})(A0)),A0}var T0={},e5;function mW(){return e5||(e5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=l1();function r(i){return i!==null&&typeof i=="object"&&n.getTag(i)==="[object Arguments]"}e.isArguments=r})(T0)),T0}var t5;function pW(){return t5||(t5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=U3(),r=nT(),i=mW(),a=r1();function l(s,c){let f;if(Array.isArray(c)?f=c:typeof c=="string"&&n.isDeepKey(c)&&(s==null?void 0:s[c])==null?f=a.toPath(c):f=[c],f.length===0)return!1;let d=s;for(let m=0;m<f.length;m++){const p=f[m];if((d==null||!Object.hasOwn(d,p))&&!((Array.isArray(d)||i.isArguments(d))&&r.isIndex(p)&&p<d.length))return!1;d=d[p]}return!0}e.has=l})(O0)),O0}var n5;function gW(){return n5||(n5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=J3(),r=n1(),i=hW(),a=i1(),l=pW();function s(c,f){switch(typeof c){case"object":{Object.is(c==null?void 0:c.valueOf(),-0)&&(c="-0");break}case"number":{c=r.toKey(c);break}}return f=i.cloneDeep(f),function(d){const m=a.get(d,c);return m===void 0?l.has(d,c):f===void 0?m===void 0:n.isMatch(m,f)}}e.matchesProperty=s})(E0)),E0}var r5;function vW(){return r5||(r5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=Y3(),r=lW(),i=fW(),a=gW();function l(s){if(s==null)return n.identity;switch(typeof s){case"function":return s;case"object":return Array.isArray(s)&&s.length===2?a.matchesProperty(s[0],s[1]):i.matches(s);case"string":case"symbol":case"number":return r.property(s)}}e.iteratee=l})(d0)),d0}var i5;function yW(){return i5||(i5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=tW(),r=nW(),i=Y3(),a=aW(),l=vW();function s(c,f=i.identity){return a.isArrayLikeObject(c)?n.uniqBy(Array.from(c),r.ary(l.iteratee(f),1)):[]}e.uniqBy=s})(i0)),i0}var M0,a5;function xW(){return a5||(a5=1,M0=yW().uniqBy),M0}var bW=xW();const l5=oi(bW);function wW(e,n,r){return n===!0?l5(e,r):typeof n=="function"?l5(e,n):e}var P0={exports:{}},D0={},R0={exports:{}},L0={};/**
124
+ * @license React
125
+ * use-sync-external-store-shim.production.js
126
+ *
127
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
128
+ *
129
+ * This source code is licensed under the MIT license found in the
130
+ * LICENSE file in the root directory of this source tree.
131
+ */var o5;function _W(){if(o5)return L0;o5=1;var e=Qo();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var r=typeof Object.is=="function"?Object.is:n,i=e.useState,a=e.useEffect,l=e.useLayoutEffect,s=e.useDebugValue;function c(p,y){var x=y(),_=i({inst:{value:x,getSnapshot:y}}),S=_[0].inst,k=_[1];return l(function(){S.value=x,S.getSnapshot=y,f(S)&&k({inst:S})},[p,x,y]),a(function(){return f(S)&&k({inst:S}),p(function(){f(S)&&k({inst:S})})},[p]),s(x),x}function f(p){var y=p.getSnapshot;p=p.value;try{var x=y();return!r(p,x)}catch{return!0}}function d(p,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return L0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,L0}var s5;function kW(){return s5||(s5=1,R0.exports=_W()),R0.exports}/**
132
+ * @license React
133
+ * use-sync-external-store-shim/with-selector.production.js
134
+ *
135
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
136
+ *
137
+ * This source code is licensed under the MIT license found in the
138
+ * LICENSE file in the root directory of this source tree.
139
+ */var u5;function SW(){if(u5)return D0;u5=1;var e=Qo(),n=kW();function r(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:r,a=n.useSyncExternalStore,l=e.useRef,s=e.useEffect,c=e.useMemo,f=e.useDebugValue;return D0.useSyncExternalStoreWithSelector=function(d,m,p,y,x){var _=l(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=c(function(){function j(A){if(!C){if(C=!0,N=A,A=y(A),x!==void 0&&S.hasValue){var P=S.value;if(x(P,A))return O=P}return O=A}if(P=O,i(N,A))return P;var R=y(A);return x!==void 0&&x(P,R)?(N=A,P):(N=A,O=R)}var C=!1,N,O,T=p===void 0?null:p;return[function(){return j(m())},T===null?void 0:function(){return j(T())}]},[m,p,y,x]);var k=a(d,_[0],_[1]);return s(function(){S.hasValue=!0,S.value=k},[k]),f(k),k},D0}var c5;function jW(){return c5||(c5=1,P0.exports=SW()),P0.exports}var EW=jW(),o1=b.createContext(null),CW=e=>e,At=()=>{var e=b.useContext(o1);return e?e.store.dispatch:CW},zd=()=>{},NW=()=>zd,OW=(e,n)=>e===n;function Ne(e){var n=b.useContext(o1),r=b.useMemo(()=>n?i=>{if(i!=null)return e(i)}:zd,[n,e]);return EW.useSyncExternalStoreWithSelector(n?n.subscription.addNestedSub:NW,n?n.store.getState:zd,n?n.store.getState:zd,r,OW)}function AW(e,n=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(n)}function TW(e,n=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(n)}function MW(e,n="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${n}[${r}]`)}}var f5=e=>Array.isArray(e)?e:[e];function PW(e){const n=Array.isArray(e[0])?e[0]:e;return MW(n,"createSelector expects all input-selectors to be functions, but received the following types: "),n}function DW(e,n){const r=[],{length:i}=e;for(let a=0;a<i;a++)r.push(e[a].apply(null,n));return r}var RW=class{constructor(e){this.value=e}deref(){return this.value}},LW=typeof WeakRef<"u"?WeakRef:RW,zW=0,d5=1;function yd(){return{s:zW,v:void 0,o:null,p:null}}function rT(e,n={}){let r=yd();const{resultEqualityCheck:i}=n;let a,l=0;function s(){var p;let c=r;const{length:f}=arguments;for(let y=0,x=f;y<x;y++){const _=arguments[y];if(typeof _=="function"||typeof _=="object"&&_!==null){let S=c.o;S===null&&(c.o=S=new WeakMap);const k=S.get(_);k===void 0?(c=yd(),S.set(_,c)):c=k}else{let S=c.p;S===null&&(c.p=S=new Map);const k=S.get(_);k===void 0?(c=yd(),S.set(_,c)):c=k}}const d=c;let m;if(c.s===d5)m=c.v;else if(m=e.apply(null,arguments),l++,i){const y=((p=a==null?void 0:a.deref)==null?void 0:p.call(a))??a;y!=null&&i(y,m)&&(m=y,l!==0&&l--),a=typeof m=="object"&&m!==null||typeof m=="function"?new LW(m):m}return d.s=d5,d.v=m,m}return s.clearCache=()=>{r=yd(),s.resetResultsCount()},s.resultsCount=()=>l,s.resetResultsCount=()=>{l=0},s}function IW(e,...n){const r=typeof e=="function"?{memoize:e,memoizeOptions:n}:e,i=(...a)=>{let l=0,s=0,c,f={},d=a.pop();typeof d=="object"&&(f=d,d=a.pop()),AW(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...r,...f},{memoize:p,memoizeOptions:y=[],argsMemoize:x=rT,argsMemoizeOptions:_=[]}=m,S=f5(y),k=f5(_),j=PW(a),C=p(function(){return l++,d.apply(null,arguments)},...S),N=x(function(){s++;const T=DW(j,arguments);return c=C.apply(null,T),c},...k);return Object.assign(N,{resultFunc:d,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>l,resetRecomputations:()=>{l=0},memoize:p,argsMemoize:x})};return Object.assign(i,{withTypes:()=>i}),i}var le=IW(rT),$W=Object.assign((e,n=le)=>{TW(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),i=r.map(l=>e[l]);return n(i,(...l)=>l.reduce((s,c,f)=>(s[r[f]]=c,s),{}))},{withTypes:()=>$W}),z0={},I0={},$0={},h5;function BW(){return h5||(h5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(i){return typeof i=="symbol"?1:i===null?2:i===void 0?3:i!==i?4:0}const r=(i,a,l)=>{if(i!==a){const s=n(i),c=n(a);if(s===c&&s===0){if(i<a)return l==="desc"?1:-1;if(i>a)return l==="desc"?-1:1}return l==="desc"?c-s:s-c}return 0};e.compareValues=r})($0)),$0}var B0={},F0={},m5;function iT(){return m5||(m5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=n})(F0)),F0}var p5;function FW(){return p5||(p5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=iT(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function a(l,s){return Array.isArray(l)?!1:typeof l=="number"||typeof l=="boolean"||l==null||n.isSymbol(l)?!0:typeof l=="string"&&(i.test(l)||!r.test(l))||s!=null&&Object.hasOwn(s,l)}e.isKey=a})(B0)),B0}var g5;function UW(){return g5||(g5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=BW(),r=FW(),i=r1();function a(l,s,c,f){if(l==null)return[];c=f?void 0:c,Array.isArray(l)||(l=Object.values(l)),Array.isArray(s)||(s=s==null?[null]:[s]),s.length===0&&(s=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(x=>String(x));const d=(x,_)=>{let S=x;for(let k=0;k<_.length&&S!=null;++k)S=S[_[k]];return S},m=(x,_)=>_==null||x==null?_:typeof x=="object"&&"key"in x?Object.hasOwn(_,x.key)?_[x.key]:d(_,x.path):typeof x=="function"?x(_):Array.isArray(x)?d(_,x):typeof _=="object"?_[x]:_,p=s.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||r.isKey(x)?x:{key:x,path:i.toPath(x)}));return l.map(x=>({original:x,criteria:p.map(_=>m(_,x))})).slice().sort((x,_)=>{for(let S=0;S<p.length;S++){const k=n.compareValues(x.criteria[S],_.criteria[S],c[S]);if(k!==0)return k}return 0}).map(x=>x.original)}e.orderBy=a})(I0)),I0}var U0={},v5;function qW(){return v5||(v5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r,i=1){const a=[],l=Math.floor(i),s=(c,f)=>{for(let d=0;d<c.length;d++){const m=c[d];Array.isArray(m)&&f<l?s(m,f+1):a.push(m)}};return s(r,0),a}e.flatten=n})(U0)),U0}var q0={},y5;function aT(){return y5||(y5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=nT(),r=W3(),i=X3(),a=Q3();function l(s,c,f){return i.isObject(f)&&(typeof c=="number"&&r.isArrayLike(f)&&n.isIndex(c)&&c<f.length||typeof c=="string"&&c in f)?a.isEqualsSameValueZero(f[c],s):!1}e.isIterateeCall=l})(q0)),q0}var x5;function HW(){return x5||(x5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=UW(),r=qW(),i=aT();function a(l,...s){const c=s.length;return c>1&&i.isIterateeCall(l,s[0],s[1])?s=[]:c>2&&i.isIterateeCall(s[0],s[1],s[2])&&(s=[s[0]]),n.orderBy(l,r.flatten(s),["asc"])}e.sortBy=a})(z0)),z0}var H0,b5;function GW(){return b5||(b5=1,H0=HW().sortBy),H0}var KW=GW();const Em=oi(KW);var lT=e=>e.legend.settings,VW=e=>e.legend.size,YW=e=>e.legend.payload;le([YW,lT],(e,n)=>{var{itemSorter:r}=n,i=e.flat(1);return r?Em(i,r):i});var xd=1;function WW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[n,r]=b.useState({height:0,left:0,top:0,width:0}),i=b.useCallback(a=>{if(a!=null){var l=a.getBoundingClientRect(),s={height:l.height,left:l.left,top:l.top,width:l.width};(Math.abs(s.height-n.height)>xd||Math.abs(s.left-n.left)>xd||Math.abs(s.top-n.top)>xd||Math.abs(s.width-n.width)>xd)&&r({height:s.height,left:s.left,top:s.top,width:s.width})}},[n.width,n.height,n.top,n.left,...e]);return[n,i]}function en(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var XW=typeof Symbol=="function"&&Symbol.observable||"@@observable",w5=XW,G0=()=>Math.random().toString(36).substring(7).split("").join("."),ZW={INIT:`@@redux/INIT${G0()}`,REPLACE:`@@redux/REPLACE${G0()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${G0()}`},bh=ZW;function s1(e){if(typeof e!="object"||e===null)return!1;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n||Object.getPrototypeOf(e)===null}function oT(e,n,r){if(typeof e!="function")throw new Error(en(2));if(typeof n=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(en(0));if(typeof n=="function"&&typeof r>"u"&&(r=n,n=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(en(1));return r(oT)(e,n)}let i=e,a=n,l=new Map,s=l,c=0,f=!1;function d(){s===l&&(s=new Map,l.forEach((k,j)=>{s.set(j,k)}))}function m(){if(f)throw new Error(en(3));return a}function p(k){if(typeof k!="function")throw new Error(en(4));if(f)throw new Error(en(5));let j=!0;d();const C=c++;return s.set(C,k),function(){if(j){if(f)throw new Error(en(6));j=!1,d(),s.delete(C),l=null}}}function y(k){if(!s1(k))throw new Error(en(7));if(typeof k.type>"u")throw new Error(en(8));if(typeof k.type!="string")throw new Error(en(17));if(f)throw new Error(en(9));try{f=!0,a=i(a,k)}finally{f=!1}return(l=s).forEach(C=>{C()}),k}function x(k){if(typeof k!="function")throw new Error(en(10));i=k,y({type:bh.REPLACE})}function _(){const k=p;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(en(11));function C(){const O=j;O.next&&O.next(m())}return C(),{unsubscribe:k(C)}},[w5](){return this}}}return y({type:bh.INIT}),{dispatch:y,subscribe:p,getState:m,replaceReducer:x,[w5]:_}}function QW(e){Object.keys(e).forEach(n=>{const r=e[n];if(typeof r(void 0,{type:bh.INIT})>"u")throw new Error(en(12));if(typeof r(void 0,{type:bh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(en(13))})}function sT(e){const n=Object.keys(e),r={};for(let l=0;l<n.length;l++){const s=n[l];typeof e[s]=="function"&&(r[s]=e[s])}const i=Object.keys(r);let a;try{QW(r)}catch(l){a=l}return function(s={},c){if(a)throw a;let f=!1;const d={};for(let m=0;m<i.length;m++){const p=i[m],y=r[p],x=s[p],_=y(x,c);if(typeof _>"u")throw c&&c.type,new Error(en(14));d[p]=_,f=f||_!==x}return f=f||i.length!==Object.keys(s).length,f?d:s}}function wh(...e){return e.length===0?n=>n:e.length===1?e[0]:e.reduce((n,r)=>(...i)=>n(r(...i)))}function JW(...e){return n=>(r,i)=>{const a=n(r,i);let l=()=>{throw new Error(en(15))};const s={getState:a.getState,dispatch:(f,...d)=>l(f,...d)},c=e.map(f=>f(s));return l=wh(...c)(a.dispatch),{...a,dispatch:l}}}function uT(e){return s1(e)&&"type"in e&&typeof e.type=="string"}var cT=Symbol.for("immer-nothing"),_5=Symbol.for("immer-draftable"),yn=Symbol.for("immer-state");function Tr(e,...n){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Vn=Object,Yo=Vn.getPrototypeOf,_h="constructor",Cm="prototype",dx="configurable",kh="enumerable",Id="writable",Qu="value",Xi=e=>!!e&&!!e[yn];function Dr(e){var n;return e?fT(e)||Om(e)||!!e[_5]||!!((n=e[_h])!=null&&n[_5])||Am(e)||Tm(e):!1}var eX=Vn[Cm][_h].toString(),k5=new WeakMap;function fT(e){if(!e||!u1(e))return!1;const n=Yo(e);if(n===null||n===Vn[Cm])return!0;const r=Vn.hasOwnProperty.call(n,_h)&&n[_h];if(r===Object)return!0;if(!Ro(r))return!1;let i=k5.get(r);return i===void 0&&(i=Function.toString.call(r),k5.set(r,i)),i===eX}function Nm(e,n,r=!0){jc(e)===0?(r?Reflect.ownKeys(e):Vn.keys(e)).forEach(a=>{n(a,e[a],e)}):e.forEach((i,a)=>n(a,i,e))}function jc(e){const n=e[yn];return n?n.type_:Om(e)?1:Am(e)?2:Tm(e)?3:0}var S5=(e,n,r=jc(e))=>r===2?e.has(n):Vn[Cm].hasOwnProperty.call(e,n),hx=(e,n,r=jc(e))=>r===2?e.get(n):e[n],Sh=(e,n,r,i=jc(e))=>{i===2?e.set(n,r):i===3?e.add(r):e[n]=r};function tX(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}var Om=Array.isArray,Am=e=>e instanceof Map,Tm=e=>e instanceof Set,u1=e=>typeof e=="object",Ro=e=>typeof e=="function",K0=e=>typeof e=="boolean";function nX(e){const n=+e;return Number.isInteger(n)&&String(n)===e}var Ri=e=>e.copy_||e.base_,c1=e=>e.modified_?e.copy_:e.base_;function mx(e,n){if(Am(e))return new Map(e);if(Tm(e))return new Set(e);if(Om(e))return Array[Cm].slice.call(e);const r=fT(e);if(n===!0||n==="class_only"&&!r){const i=Vn.getOwnPropertyDescriptors(e);delete i[yn];let a=Reflect.ownKeys(i);for(let l=0;l<a.length;l++){const s=a[l],c=i[s];c[Id]===!1&&(c[Id]=!0,c[dx]=!0),(c.get||c.set)&&(i[s]={[dx]:!0,[Id]:!0,[kh]:c[kh],[Qu]:e[s]})}return Vn.create(Yo(e),i)}else{const i=Yo(e);if(i!==null&&r)return{...e};const a=Vn.create(i);return Vn.assign(a,e)}}function f1(e,n=!1){return Mm(e)||Xi(e)||!Dr(e)||(jc(e)>1&&Vn.defineProperties(e,{set:bd,add:bd,clear:bd,delete:bd}),Vn.freeze(e),n&&Nm(e,(r,i)=>{f1(i,!0)},!1)),e}function rX(){Tr(2)}var bd={[Qu]:rX};function Mm(e){return e===null||!u1(e)?!0:Vn.isFrozen(e)}var jh="MapSet",px="Patches",j5="ArrayMethods",dT={};function Al(e){const n=dT[e];return n||Tr(0,e),n}var E5=e=>!!dT[e],Ju,hT=()=>Ju,iX=(e,n)=>({drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:E5(jh)?Al(jh):void 0,arrayMethodsPlugin_:E5(j5)?Al(j5):void 0});function C5(e,n){n&&(e.patchPlugin_=Al(px),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function gx(e){vx(e),e.drafts_.forEach(aX),e.drafts_=null}function vx(e){e===Ju&&(Ju=e.parent_)}var N5=e=>Ju=iX(Ju,e);function aX(e){const n=e[yn];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function O5(e,n){n.unfinalizedDrafts_=n.drafts_.length;const r=n.drafts_[0];if(e!==void 0&&e!==r){r[yn].modified_&&(gx(n),Tr(4)),Dr(e)&&(e=A5(n,e));const{patchPlugin_:a}=n;a&&a.generateReplacementPatches_(r[yn].base_,e,n)}else e=A5(n,r);return lX(n,e,!0),gx(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==cT?e:void 0}function A5(e,n){if(Mm(n))return n;const r=n[yn];if(!r)return Eh(n,e.handledSet_,e);if(!Pm(r,e))return n;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:i}=r;if(i)for(;i.length>0;)i.pop()(e);gT(r,e)}return r.copy_}function lX(e,n,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&f1(n,r)}function mT(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Pm=(e,n)=>e.scope_===n,oX=[];function pT(e,n,r,i){const a=Ri(e),l=e.type_;if(i!==void 0&&hx(a,i,l)===n){Sh(a,i,r,l);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;Nm(a,(f,d)=>{if(Xi(d)){const m=c.get(d)||[];m.push(f),c.set(d,m)}})}const s=e.draftLocations_.get(n)??oX;for(const c of s)Sh(a,c,r,l)}function sX(e,n,r){e.callbacks_.push(function(a){var c;const l=n;if(!l||!Pm(l,a))return;(c=a.mapSetPlugin_)==null||c.fixSetContents(l);const s=c1(l);pT(e,l.draft_??l,s,r),gT(l,a)})}function gT(e,n){var i;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((i=e.assigned_)==null?void 0:i.size)??0)>0)){const{patchPlugin_:a}=n;if(a){const l=a.getPath(e);l&&a.generatePatches_(e,l,n)}mT(e)}}function uX(e,n,r){const{scope_:i}=e;if(Xi(r)){const a=r[yn];Pm(a,i)&&a.callbacks_.push(function(){$d(e);const s=c1(a);pT(e,r,s,n)})}else Dr(r)&&e.callbacks_.push(function(){const l=Ri(e);e.type_===3?l.has(r)&&Eh(r,i.handledSet_,i):hx(l,n,e.type_)===r&&i.drafts_.length>1&&(e.assigned_.get(n)??!1)===!0&&e.copy_&&Eh(hx(e.copy_,n,e.type_),i.handledSet_,i)})}function Eh(e,n,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Xi(e)||n.has(e)||!Dr(e)||Mm(e)||(n.add(e),Nm(e,(i,a)=>{if(Xi(a)){const l=a[yn];if(Pm(l,r)){const s=c1(l);Sh(e,i,s,e.type_),mT(l)}}else Dr(a)&&Eh(a,n,r)})),e}function cX(e,n){const r=Om(e),i={type_:r?1:0,scope_:n?n.scope_:hT(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=i,l=Ch;r&&(a=[i],l=ec);const{revoke:s,proxy:c}=Proxy.revocable(a,l);return i.draft_=c,i.revoke_=s,[c,i]}var Ch={get(e,n){if(n===yn)return e;let r=e.scope_.arrayMethodsPlugin_;const i=e.type_===1&&typeof n=="string";if(i&&r!=null&&r.isArrayOperationMethod(n))return r.createMethodInterceptor(e,n);const a=Ri(e);if(!S5(a,n,e.type_))return fX(e,a,n);const l=a[n];if(e.finalized_||!Dr(l)||i&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&nX(n))return l;if(l===V0(e.base_,n)){$d(e);const s=e.type_===1?+n:n,c=xx(e.scope_,l,e,s);return e.copy_[s]=c}return l},has(e,n){return n in Ri(e)},ownKeys(e){return Reflect.ownKeys(Ri(e))},set(e,n,r){const i=vT(Ri(e),n);if(i!=null&&i.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){const a=V0(Ri(e),n),l=a==null?void 0:a[yn];if(l&&l.base_===r)return e.copy_[n]=r,e.assigned_.set(n,!1),!0;if(tX(r,a)&&(r!==void 0||S5(e.base_,n,e.type_)))return!0;$d(e),yx(e)}return e.copy_[n]===r&&(r!==void 0||n in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=r,e.assigned_.set(n,!0),uX(e,n,r)),!0},deleteProperty(e,n){return $d(e),V0(e.base_,n)!==void 0||n in e.base_?(e.assigned_.set(n,!1),yx(e)):e.assigned_.delete(n),e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const r=Ri(e),i=Reflect.getOwnPropertyDescriptor(r,n);return i&&{[Id]:!0,[dx]:e.type_!==1||n!=="length",[kh]:i[kh],[Qu]:r[n]}},defineProperty(){Tr(11)},getPrototypeOf(e){return Yo(e.base_)},setPrototypeOf(){Tr(12)}},ec={};for(let e in Ch){let n=Ch[e];ec[e]=function(){const r=arguments;return r[0]=r[0][0],n.apply(this,r)}}ec.deleteProperty=function(e,n){return ec.set.call(this,e,n,void 0)};ec.set=function(e,n,r){return Ch.set.call(this,e[0],n,r,e[0])};function V0(e,n){const r=e[yn];return(r?Ri(r):e)[n]}function fX(e,n,r){var a;const i=vT(n,r);return i?Qu in i?i[Qu]:(a=i.get)==null?void 0:a.call(e.draft_):void 0}function vT(e,n){if(!(n in e))return;let r=Yo(e);for(;r;){const i=Object.getOwnPropertyDescriptor(r,n);if(i)return i;r=Yo(r)}}function yx(e){e.modified_||(e.modified_=!0,e.parent_&&yx(e.parent_))}function $d(e){e.copy_||(e.assigned_=new Map,e.copy_=mx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var dX=class{constructor(n){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,i,a)=>{if(Ro(r)&&!Ro(i)){const s=i;i=r;const c=this;return function(d=s,...m){return c.produce(d,p=>i.call(this,p,...m))}}Ro(i)||Tr(6),a!==void 0&&!Ro(a)&&Tr(7);let l;if(Dr(r)){const s=N5(this),c=xx(s,r,void 0);let f=!0;try{l=i(c),f=!1}finally{f?gx(s):vx(s)}return C5(s,a),O5(l,s)}else if(!r||!u1(r)){if(l=i(r),l===void 0&&(l=r),l===cT&&(l=void 0),this.autoFreeze_&&f1(l,!0),a){const s=[],c=[];Al(px).generateReplacementPatches_(r,l,{patches_:s,inversePatches_:c}),a(s,c)}return l}else Tr(1,r)},this.produceWithPatches=(r,i)=>{if(Ro(r))return(c,...f)=>this.produceWithPatches(c,d=>r(d,...f));let a,l;return[this.produce(r,i,(c,f)=>{a=c,l=f}),a,l]},K0(n==null?void 0:n.autoFreeze)&&this.setAutoFreeze(n.autoFreeze),K0(n==null?void 0:n.useStrictShallowCopy)&&this.setUseStrictShallowCopy(n.useStrictShallowCopy),K0(n==null?void 0:n.useStrictIteration)&&this.setUseStrictIteration(n.useStrictIteration)}createDraft(n){Dr(n)||Tr(8),Xi(n)&&(n=xr(n));const r=N5(this),i=xx(r,n,void 0);return i[yn].isManual_=!0,vx(r),i}finishDraft(n,r){const i=n&&n[yn];(!i||!i.isManual_)&&Tr(9);const{scope_:a}=i;return C5(a,r),O5(void 0,a)}setAutoFreeze(n){this.autoFreeze_=n}setUseStrictShallowCopy(n){this.useStrictShallowCopy_=n}setUseStrictIteration(n){this.useStrictIteration_=n}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(n,r){let i;for(i=r.length-1;i>=0;i--){const l=r[i];if(l.path.length===0&&l.op==="replace"){n=l.value;break}}i>-1&&(r=r.slice(i+1));const a=Al(px).applyPatches_;return Xi(n)?a(n,r):this.produce(n,l=>a(l,r))}};function xx(e,n,r,i){const[a,l]=Am(n)?Al(jh).proxyMap_(n,r):Tm(n)?Al(jh).proxySet_(n,r):cX(n,r);return((r==null?void 0:r.scope_)??hT()).drafts_.push(a),l.callbacks_=(r==null?void 0:r.callbacks_)??[],l.key_=i,r&&i!==void 0?sX(r,l,i):l.callbacks_.push(function(f){var m;(m=f.mapSetPlugin_)==null||m.fixSetContents(l);const{patchPlugin_:d}=f;l.modified_&&d&&d.generatePatches_(l,[],f)}),a}function xr(e){return Xi(e)||Tr(10,e),yT(e)}function yT(e){if(!Dr(e)||Mm(e))return e;const n=e[yn];let r,i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=mx(e,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=mx(e,!0);return Nm(r,(a,l)=>{Sh(r,a,yT(l))},i),n&&(n.finalized_=!1),r}var hX=new dX,xT=hX.produce;function bT(e){return({dispatch:r,getState:i})=>a=>l=>typeof l=="function"?l(r,i,e):a(l)}var mX=bT(),pX=bT,gX=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?wh:wh.apply(null,arguments)};function Xn(e,n){function r(...i){if(n){let a=n(...i);if(!a)throw new Error(Yn(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:i[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=i=>uT(i)&&i.type===e,r}var wT=class Du extends Array{constructor(...n){super(...n),Object.setPrototypeOf(this,Du.prototype)}static get[Symbol.species](){return Du}concat(...n){return super.concat.apply(this,n)}prepend(...n){return n.length===1&&Array.isArray(n[0])?new Du(...n[0].concat(this)):new Du(...n.concat(this))}};function T5(e){return Dr(e)?xT(e,()=>{}):e}function wd(e,n,r){return e.has(n)?e.get(n):e.set(n,r(n)).get(n)}function vX(e){return typeof e=="boolean"}var yX=()=>function(n){const{thunk:r=!0,immutableCheck:i=!0,serializableCheck:a=!0,actionCreatorCheck:l=!0}=n??{};let s=new wT;return r&&(vX(r)?s.push(mX):s.push(pX(r.extraArgument))),s},_T="RTK_autoBatch",pt=()=>e=>({payload:e,meta:{[_T]:!0}}),M5=e=>n=>{setTimeout(n,e)},kT=(e={type:"raf"})=>n=>(...r)=>{const i=n(...r);let a=!0,l=!1,s=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:M5(10):e.type==="callback"?e.queueNotification:M5(e.timeout),d=()=>{s=!1,l&&(l=!1,c.forEach(m=>m()))};return Object.assign({},i,{subscribe(m){const p=()=>a&&m(),y=i.subscribe(p);return c.add(m),()=>{y(),c.delete(m)}},dispatch(m){var p;try{return a=!((p=m==null?void 0:m.meta)!=null&&p[_T]),l=!a,l&&(s||(s=!0,f(d))),i.dispatch(m)}finally{a=!0}}})},xX=e=>function(r){const{autoBatch:i=!0}=r??{};let a=new wT(e);return i&&a.push(kT(typeof i=="object"?i:void 0)),a};function bX(e){const n=yX(),{reducer:r=void 0,middleware:i,devTools:a=!0,preloadedState:l=void 0,enhancers:s=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(s1(r))c=sT(r);else throw new Error(Yn(1));let f;typeof i=="function"?f=i(n):f=n();let d=wh;a&&(d=gX({trace:!1,...typeof a=="object"&&a}));const m=JW(...f),p=xX(m);let y=typeof s=="function"?s(p):p();const x=d(...y);return oT(c,l,x)}function ST(e){const n={},r=[];let i;const a={addCase(l,s){const c=typeof l=="string"?l:l.type;if(!c)throw new Error(Yn(28));if(c in n)throw new Error(Yn(29));return n[c]=s,a},addAsyncThunk(l,s){return s.pending&&(n[l.pending.type]=s.pending),s.rejected&&(n[l.rejected.type]=s.rejected),s.fulfilled&&(n[l.fulfilled.type]=s.fulfilled),s.settled&&r.push({matcher:l.settled,reducer:s.settled}),a},addMatcher(l,s){return r.push({matcher:l,reducer:s}),a},addDefaultCase(l){return i=l,a}};return e(a),[n,r,i]}function wX(e){return typeof e=="function"}function _X(e,n){let[r,i,a]=ST(n),l;if(wX(e))l=()=>T5(e());else{const c=T5(e);l=()=>c}function s(c=l(),f){let d=[r[f.type],...i.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return d.filter(m=>!!m).length===0&&(d=[a]),d.reduce((m,p)=>{if(p)if(Xi(m)){const x=p(m,f);return x===void 0?m:x}else{if(Dr(m))return xT(m,y=>p(y,f));{const y=p(m,f);if(y===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return m},c)}return s.getInitialState=l,s}var kX="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",SX=(e=21)=>{let n="",r=e;for(;r--;)n+=kX[Math.random()*64|0];return n},jX=Symbol.for("rtk-slice-createasyncthunk");function EX(e,n){return`${e}/${n}`}function CX({creators:e}={}){var r;const n=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[jX];return function(a){const{name:l,reducerPath:s=l}=a;if(!l)throw new Error(Yn(11));const c=(typeof a.reducers=="function"?a.reducers(OX()):a.reducers)||{},f=Object.keys(c),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(O,T){const A=typeof O=="string"?O:O.type;if(!A)throw new Error(Yn(12));if(A in d.sliceCaseReducersByType)throw new Error(Yn(13));return d.sliceCaseReducersByType[A]=T,m},addMatcher(O,T){return d.sliceMatchers.push({matcher:O,reducer:T}),m},exposeAction(O,T){return d.actionCreators[O]=T,m},exposeCaseReducer(O,T){return d.sliceCaseReducersByName[O]=T,m}};f.forEach(O=>{const T=c[O],A={reducerName:O,type:EX(l,O),createNotation:typeof a.reducers=="function"};TX(T)?PX(A,T,m,n):AX(A,T,m)});function p(){const[O={},T=[],A=void 0]=typeof a.extraReducers=="function"?ST(a.extraReducers):[a.extraReducers],P={...O,...d.sliceCaseReducersByType};return _X(a.initialState,R=>{for(let z in P)R.addCase(z,P[z]);for(let z of d.sliceMatchers)R.addMatcher(z.matcher,z.reducer);for(let z of T)R.addMatcher(z.matcher,z.reducer);A&&R.addDefaultCase(A)})}const y=O=>O,x=new Map,_=new WeakMap;let S;function k(O,T){return S||(S=p()),S(O,T)}function j(){return S||(S=p()),S.getInitialState()}function C(O,T=!1){function A(R){let z=R[O];return typeof z>"u"&&T&&(z=wd(_,A,j)),z}function P(R=y){const z=wd(x,T,()=>new WeakMap);return wd(z,R,()=>{const D={};for(const[U,q]of Object.entries(a.selectors??{}))D[U]=NX(q,R,()=>wd(_,R,j),T);return D})}return{reducerPath:O,getSelectors:P,get selectors(){return P(A)},selectSlice:A}}const N={name:l,reducer:k,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...C(s),injectInto(O,{reducerPath:T,...A}={}){const P=T??s;return O.inject({reducerPath:P,reducer:k},A),{...N,...C(P,!0)}}};return N}}function NX(e,n,r,i){function a(l,...s){let c=n(l);return typeof c>"u"&&i&&(c=r()),e(c,...s)}return a.unwrapped=e,a}var hn=CX();function OX(){function e(n,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:n,...r}}return e.withTypes=()=>e,{reducer(n){return Object.assign({[n.name](...r){return n(...r)}}[n.name],{_reducerDefinitionType:"reducer"})},preparedReducer(n,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:n,reducer:r}},asyncThunk:e}}function AX({type:e,reducerName:n,createNotation:r},i,a){let l,s;if("reducer"in i){if(r&&!MX(i))throw new Error(Yn(17));l=i.reducer,s=i.prepare}else l=i;a.addCase(e,l).exposeCaseReducer(n,l).exposeAction(n,s?Xn(e,s):Xn(e))}function TX(e){return e._reducerDefinitionType==="asyncThunk"}function MX(e){return e._reducerDefinitionType==="reducerWithPrepare"}function PX({type:e,reducerName:n},r,i,a){if(!a)throw new Error(Yn(18));const{payloadCreator:l,fulfilled:s,pending:c,rejected:f,settled:d,options:m}=r,p=a(e,l,m);i.exposeAction(n,p),s&&i.addCase(p.fulfilled,s),c&&i.addCase(p.pending,c),f&&i.addCase(p.rejected,f),d&&i.addMatcher(p.settled,d),i.exposeCaseReducer(n,{fulfilled:s||_d,pending:c||_d,rejected:f||_d,settled:d||_d})}function _d(){}var DX="task",jT="listener",ET="completed",d1="cancelled",RX=`task-${d1}`,LX=`task-${ET}`,bx=`${jT}-${d1}`,zX=`${jT}-${ET}`,Dm=class{constructor(e){rd(this,"name","TaskAbortError");rd(this,"message");this.code=e,this.message=`${DX} ${d1} (reason: ${e})`}},h1=(e,n)=>{if(typeof e!="function")throw new TypeError(Yn(32))},Nh=()=>{},CT=(e,n=Nh)=>(e.catch(n),e),NT=(e,n)=>(e.addEventListener("abort",n,{once:!0}),()=>e.removeEventListener("abort",n)),Sl=e=>{if(e.aborted)throw new Dm(e.reason)};function OT(e,n){let r=Nh;return new Promise((i,a)=>{const l=()=>a(new Dm(e.reason));if(e.aborted){l();return}r=NT(e,l),n.finally(()=>r()).then(i,a)}).finally(()=>{r=Nh})}var IX=async(e,n)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Dm?"cancelled":"rejected",error:r}}finally{n==null||n()}},Oh=e=>n=>CT(OT(e,n).then(r=>(Sl(e),r))),AT=e=>{const n=Oh(e);return r=>n(new Promise(i=>setTimeout(i,r)))},{assign:Bo}=Object,P5={},Rm="listenerMiddleware",$X=(e,n)=>{const r=i=>NT(e,()=>i.abort(e.reason));return(i,a)=>{h1(i);const l=new AbortController;r(l);const s=IX(async()=>{Sl(e),Sl(l.signal);const c=await i({pause:Oh(l.signal),delay:AT(l.signal),signal:l.signal});return Sl(l.signal),c},()=>l.abort(LX));return a!=null&&a.autoJoin&&n.push(s.catch(Nh)),{result:Oh(e)(s),cancel(){l.abort(RX)}}}},BX=(e,n)=>{const r=async(i,a)=>{Sl(n);let l=()=>{};const c=[new Promise((f,d)=>{let m=e({predicate:i,effect:(p,y)=>{y.unsubscribe(),f([p,y.getState(),y.getOriginalState()])}});l=()=>{m(),d()}})];a!=null&&c.push(new Promise(f=>setTimeout(f,a,null)));try{const f=await OT(n,Promise.race(c));return Sl(n),f}finally{l()}};return(i,a)=>CT(r(i,a))},TT=e=>{let{type:n,actionCreator:r,matcher:i,predicate:a,effect:l}=e;if(n)a=Xn(n).match;else if(r)n=r.type,a=r.match;else if(i)a=i;else if(!a)throw new Error(Yn(21));return h1(l),{predicate:a,type:n,effect:l}},MT=Bo(e=>{const{type:n,predicate:r,effect:i}=TT(e);return{id:SX(),effect:i,type:n,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Yn(22))}}},{withTypes:()=>MT}),D5=(e,n)=>{const{type:r,effect:i,predicate:a}=TT(n);return Array.from(e.values()).find(l=>(typeof r=="string"?l.type===r:l.predicate===a)&&l.effect===i)},wx=e=>{e.pending.forEach(n=>{n.abort(bx)})},FX=(e,n)=>()=>{for(const r of n.keys())wx(r);e.clear()},R5=(e,n,r)=>{try{e(n,r)}catch(i){setTimeout(()=>{throw i},0)}},PT=Bo(Xn(`${Rm}/add`),{withTypes:()=>PT}),UX=Xn(`${Rm}/removeAll`),DT=Bo(Xn(`${Rm}/remove`),{withTypes:()=>DT}),qX=(...e)=>{console.error(`${Rm}/error`,...e)},Ec=(e={})=>{const n=new Map,r=new Map,i=x=>{const _=r.get(x)??0;r.set(x,_+1)},a=x=>{const _=r.get(x)??1;_===1?r.delete(x):r.set(x,_-1)},{extra:l,onError:s=qX}=e;h1(s);const c=x=>(x.unsubscribe=()=>n.delete(x.id),n.set(x.id,x),_=>{x.unsubscribe(),_!=null&&_.cancelActive&&wx(x)}),f=x=>{const _=D5(n,x)??MT(x);return c(_)};Bo(f,{withTypes:()=>f});const d=x=>{const _=D5(n,x);return _&&(_.unsubscribe(),x.cancelActive&&wx(_)),!!_};Bo(d,{withTypes:()=>d});const m=async(x,_,S,k)=>{const j=new AbortController,C=BX(f,j.signal),N=[];try{x.pending.add(j),i(x),await Promise.resolve(x.effect(_,Bo({},S,{getOriginalState:k,condition:(O,T)=>C(O,T).then(Boolean),take:C,delay:AT(j.signal),pause:Oh(j.signal),extra:l,signal:j.signal,fork:$X(j.signal,N),unsubscribe:x.unsubscribe,subscribe:()=>{n.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((O,T,A)=>{O!==j&&(O.abort(bx),A.delete(O))})},cancel:()=>{j.abort(bx),x.pending.delete(j)},throwIfCancelled:()=>{Sl(j.signal)}})))}catch(O){O instanceof Dm||R5(s,O,{raisedBy:"effect"})}finally{await Promise.all(N),j.abort(zX),a(x),x.pending.delete(j)}},p=FX(n,r);return{middleware:x=>_=>S=>{if(!uT(S))return _(S);if(PT.match(S))return f(S.payload);if(UX.match(S)){p();return}if(DT.match(S))return d(S.payload);let k=x.getState();const j=()=>{if(k===P5)throw new Error(Yn(23));return k};let C;try{if(C=_(S),n.size>0){const N=x.getState(),O=Array.from(n.values());for(const T of O){let A=!1;try{A=T.predicate(S,N,k)}catch(P){A=!1,R5(s,P,{raisedBy:"predicate"})}A&&m(T,S,x,j)}}}finally{k=P5}return C},startListening:f,stopListening:d,clearListeners:p}};function Yn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var HX={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},RT=hn({name:"chartLayout",initialState:HX,reducers:{setLayout(e,n){e.layoutType=n.payload},setChartSize(e,n){e.width=n.payload.width,e.height=n.payload.height},setMargin(e,n){var r,i,a,l;e.margin.top=(r=n.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(i=n.payload.right)!==null&&i!==void 0?i:0,e.margin.bottom=(a=n.payload.bottom)!==null&&a!==void 0?a:0,e.margin.left=(l=n.payload.left)!==null&&l!==void 0?l:0},setScale(e,n){e.scale=n.payload}}}),{setMargin:GX,setLayout:KX,setChartSize:VX,setScale:YX}=RT.actions,WX=RT.reducer;function LT(e,n,r){return Array.isArray(e)&&e&&n+r!==0?e.slice(n,r+1):e}function Fe(e){return Number.isFinite(e)}function ai(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function L5(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Lo(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?L5(Object(r),!0).forEach(function(i){XX(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L5(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function XX(e,n,r){return(n=ZX(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ZX(e){var n=QX(e,"string");return typeof n=="symbol"?n:n+""}function QX(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function rn(e,n,r){return Gt(e)||Gt(n)?r:br(n)?jm(e,n,r):typeof n=="function"?n(e):r}var JX=(e,n,r)=>{if(n&&r){var{width:i,height:a}=r,{align:l,verticalAlign:s,layout:c}=n;if((c==="vertical"||c==="horizontal"&&s==="middle")&&l!=="center"&&Ce(e[l]))return Lo(Lo({},e),{},{[l]:e[l]+(i||0)});if((c==="horizontal"||c==="vertical"&&l==="center")&&s!=="middle"&&Ce(e[s]))return Lo(Lo({},e),{},{[s]:e[s]+(a||0)})}return e},ea=(e,n)=>e==="horizontal"&&n==="xAxis"||e==="vertical"&&n==="yAxis"||e==="centric"&&n==="angleAxis"||e==="radial"&&n==="radiusAxis",zT=(e,n,r,i)=>{if(i)return e.map(c=>c.coordinate);var a,l,s=e.map(c=>(c.coordinate===n&&(a=!0),c.coordinate===r&&(l=!0),c.coordinate));return a||s.push(n),l||s.push(r),s},IT=(e,n,r)=>{if(!e)return null;var{duplicateDomain:i,type:a,range:l,scale:s,realScaleType:c,isCategorical:f,categoricalDomain:d,tickCount:m,ticks:p,niceTicks:y,axisType:x}=e;if(!s)return null;var _=c==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,S=a==="category"&&s.bandwidth?s.bandwidth()/_:0;if(S=x==="angleAxis"&&l&&l.length>=2?yr(l[0]-l[1])*2*S:S,p||y){var k=(p||y||[]).map((j,C)=>{var N=i?i.indexOf(j):j,O=s.map(N);return Fe(O)?{coordinate:O+S,value:j,offset:S,index:C}:null}).filter(Mn);return k}return f&&d?d.map((j,C)=>{var N=s.map(j);return Fe(N)?{coordinate:N+S,value:j,index:C,offset:S}:null}).filter(Mn):s.ticks&&m!=null?s.ticks(m).map((j,C)=>{var N=s.map(j);return Fe(N)?{coordinate:N+S,value:j,index:C,offset:S}:null}).filter(Mn):s.domain().map((j,C)=>{var N=s.map(j);return Fe(N)?{coordinate:N+S,value:i?i[j]:j,index:C,offset:S}:null}).filter(Mn)},eZ=e=>{var n,r=e.length;if(!(r<=0)){var i=(n=e[0])===null||n===void 0?void 0:n.length;if(!(i==null||i<=0))for(var a=0;a<i;++a)for(var l=0,s=0,c=0;c<r;++c){var f=e[c],d=f==null?void 0:f[a];if(d!=null){var m=d[1],p=d[0],y=Wi(m)?p:m;y>=0?(d[0]=l,l+=y,d[1]=l):(d[0]=s,s+=y,d[1]=s)}}}},tZ=e=>{var n,r=e.length;if(!(r<=0)){var i=(n=e[0])===null||n===void 0?void 0:n.length;if(!(i==null||i<=0))for(var a=0;a<i;++a)for(var l=0,s=0;s<r;++s){var c=e[s],f=c==null?void 0:c[a];if(f!=null){var d=Wi(f[1])?f[0]:f[1];d>=0?(f[0]=l,l+=d,f[1]=l):(f[0]=0,f[1]=0)}}}},nZ={sign:eZ,expand:AY,none:Nl,silhouette:TY,wiggle:MY,positive:tZ},rZ=(e,n,r)=>{var i,a=(i=nZ[r])!==null&&i!==void 0?i:Nl,l=OY().keys(n).value((c,f)=>Number(rn(c,f,0))).order(cx).offset(a),s=l(e);return s.forEach((c,f)=>{c.forEach((d,m)=>{var p=rn(e[m],n[f],0);Array.isArray(p)&&p.length===2&&Ce(p[0])&&Ce(p[1])&&(d[0]=p[0],d[1]=p[1])})}),s};function z5(e){var{axis:n,ticks:r,bandSize:i,entry:a,index:l,dataKey:s}=e;if(n.type==="category"){if(!n.allowDuplicatedCategory&&n.dataKey&&!Gt(a[n.dataKey])){var c=H3(r,"value",a[n.dataKey]);if(c)return c.coordinate+i/2}return r!=null&&r[l]?r[l].coordinate+i/2:null}var f=rn(a,Gt(s)?n.dataKey:s),d=n.scale.map(f);return Ce(d)?d:null}var iZ=e=>{var n=e.flat(2).filter(Ce);return[Math.min(...n),Math.max(...n)]},aZ=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],lZ=(e,n,r)=>{if(e!=null)return aZ(Object.keys(e).reduce((i,a)=>{var l=e[a];if(!l)return i;var{stackedData:s}=l,c=s.reduce((f,d)=>{var m=LT(d,n,r),p=iZ(m);return!Fe(p[0])||!Fe(p[1])?f:[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]))},I5=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$5=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ah=(e,n,r)=>{if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var a=Em(n,m=>m.coordinate),l=1/0,s=1,c=a.length;s<c;s++){var f=a[s],d=a[s-1];l=Math.min(((f==null?void 0:f.coordinate)||0)-((d==null?void 0:d.coordinate)||0),l)}return l===1/0?0:l}return r?void 0:0};function B5(e){var{tooltipEntrySettings:n,dataKey:r,payload:i,value:a,name:l}=e;return Lo(Lo({},n),{},{dataKey:r,payload:i,value:a,name:l})}function $T(e,n){if(e)return String(e);if(typeof n=="string")return n}var oZ=(e,n)=>{if(n==="horizontal")return e.relativeX;if(n==="vertical")return e.relativeY},sZ=(e,n)=>n==="centric"?e.angle:e.radius,ta=e=>e.layout.width,na=e=>e.layout.height,uZ=e=>e.layout.scale,BT=e=>e.layout.margin,Lm=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),zm=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),cZ="data-recharts-item-index",fZ="data-recharts-item-id",Cc=60;function F5(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function kd(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?F5(Object(r),!0).forEach(function(i){dZ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F5(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function dZ(e,n,r){return(n=hZ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function hZ(e){var n=mZ(e,"string");return typeof n=="symbol"?n:n+""}function mZ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var pZ=e=>e.brush.height;function gZ(e){var n=zm(e);return n.reduce((r,i)=>{if(i.orientation==="left"&&!i.mirror&&!i.hide){var a=typeof i.width=="number"?i.width:Cc;return r+a}return r},0)}function vZ(e){var n=zm(e);return n.reduce((r,i)=>{if(i.orientation==="right"&&!i.mirror&&!i.hide){var a=typeof i.width=="number"?i.width:Cc;return r+a}return r},0)}function yZ(e){var n=Lm(e);return n.reduce((r,i)=>i.orientation==="top"&&!i.mirror&&!i.hide?r+i.height:r,0)}function xZ(e){var n=Lm(e);return n.reduce((r,i)=>i.orientation==="bottom"&&!i.mirror&&!i.hide?r+i.height:r,0)}var ln=le([ta,na,BT,pZ,gZ,vZ,yZ,xZ,lT,VW],(e,n,r,i,a,l,s,c,f,d)=>{var m={left:(r.left||0)+a,right:(r.right||0)+l},p={top:(r.top||0)+s,bottom:(r.bottom||0)+c},y=kd(kd({},p),m),x=y.bottom;y.bottom+=i,y=JX(y,f,d);var _=e-y.left-y.right,S=n-y.top-y.bottom;return kd(kd({brushBottom:x},y),{},{width:Math.max(_,0),height:Math.max(S,0)})}),bZ=le(ln,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),FT=le(ta,na,(e,n)=>({x:0,y:0,width:e,height:n})),wZ=b.createContext(null),wn=()=>b.useContext(wZ)!=null,Im=e=>e.brush,$m=le([Im,ln,BT],(e,n,r)=>({height:e.height,x:Ce(e.x)?e.x:n.left,y:Ce(e.y)?e.y:n.top+n.height+n.brushBottom-((r==null?void 0:r.bottom)||0),width:Ce(e.width)?e.width:n.width})),Y0={},W0={},X0={},U5;function _Z(){return U5||(U5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r,i,{signal:a,edges:l}={}){let s,c=null;const f=l!=null&&l.includes("leading"),d=l==null||l.includes("trailing"),m=()=>{c!==null&&(r.apply(s,c),s=void 0,c=null)},p=()=>{d&&m(),S()};let y=null;const x=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,p()},i)},_=()=>{y!==null&&(clearTimeout(y),y=null)},S=()=>{_(),s=void 0,c=null},k=()=>{m()},j=function(...C){if(a!=null&&a.aborted)return;s=this,c=C;const N=y==null;x(),f&&N&&m()};return j.schedule=x,j.cancel=S,j.flush=k,a==null||a.addEventListener("abort",S,{once:!0}),j}e.debounce=n})(X0)),X0}var q5;function kZ(){return q5||(q5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=_Z();function r(i,a=0,l={}){typeof l!="object"&&(l={});const{leading:s=!1,trailing:c=!0,maxWait:f}=l,d=Array(2);s&&(d[0]="leading"),c&&(d[1]="trailing");let m,p=null;const y=n.debounce(function(...S){m=i.apply(this,S),p=null},a,{edges:d}),x=function(...S){return f!=null&&(p===null&&(p=Date.now()),Date.now()-p>=f)?(m=i.apply(this,S),p=Date.now(),y.cancel(),y.schedule(),m):(y.apply(this,S),m)},_=()=>(y.flush(),m);return x.cancel=y.cancel,x.flush=_,x}e.debounce=r})(W0)),W0}var H5;function SZ(){return H5||(H5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=kZ();function r(i,a=0,l={}){const{leading:s=!0,trailing:c=!0}=l;return n.debounce(i,a,{leading:s,maxWait:a,trailing:c})}e.throttle=r})(Y0)),Y0}var Z0,G5;function jZ(){return G5||(G5=1,Z0=SZ().throttle),Z0}var EZ=jZ();const CZ=oi(EZ);var Th=function(n,r){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l<i;l++)a[l-2]=arguments[l];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!n))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(r.replace(/%s/g,()=>a[s++]))}},Wr={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},UT=(e,n,r)=>{var{width:i=Wr.width,height:a=Wr.height,aspect:l,maxHeight:s}=r,c=Ol(i)?e:Number(i),f=Ol(a)?n:Number(a);return l&&l>0&&(c?f=c/l:f&&(c=f*l),s&&f!=null&&f>s&&(f=s)),{calculatedWidth:c,calculatedHeight:f}},NZ={width:0,height:0,overflow:"visible"},OZ={width:0,overflowX:"visible"},AZ={height:0,overflowY:"visible"},TZ={},MZ=e=>{var{width:n,height:r}=e,i=Ol(n),a=Ol(r);return i&&a?NZ:i?OZ:a?AZ:TZ};function PZ(e){var{width:n,height:r,aspect:i}=e,a=n,l=r;return a===void 0&&l===void 0?(a=Wr.width,l=Wr.height):a===void 0?a=i&&i>0?void 0:Wr.width:l===void 0&&(l=i&&i>0?void 0:Wr.height),{width:a,height:l}}function _x(){return _x=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_x.apply(null,arguments)}function K5(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function V5(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?K5(Object(r),!0).forEach(function(i){DZ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K5(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function DZ(e,n,r){return(n=RZ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function RZ(e){var n=LZ(e,"string");return typeof n=="symbol"?n:n+""}function LZ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var qT=b.createContext(Wr.initialDimension);function zZ(e){return ai(e.width)&&ai(e.height)}function HT(e){var{children:n,width:r,height:i}=e,a=b.useMemo(()=>({width:r,height:i}),[r,i]);return zZ(a)?b.createElement(qT.Provider,{value:a},n):null}var m1=()=>b.useContext(qT),IZ=b.forwardRef((e,n)=>{var{aspect:r,initialDimension:i=Wr.initialDimension,width:a,height:l,minWidth:s=Wr.minWidth,minHeight:c,maxHeight:f,children:d,debounce:m=Wr.debounce,id:p,className:y,onResize:x,style:_={}}=e,S=b.useRef(null),k=b.useRef();k.current=x,b.useImperativeHandle(n,()=>S.current);var[j,C]=b.useState({containerWidth:i.width,containerHeight:i.height}),N=b.useCallback((R,z)=>{C(D=>{var U=Math.round(R),q=Math.round(z);return D.containerWidth===U&&D.containerHeight===q?D:{containerWidth:U,containerHeight:q}})},[]);b.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return zl;var R=q=>{var L,$=q[0];if($!=null){var{width:G,height:B}=$.contentRect;N(G,B),(L=k.current)===null||L===void 0||L.call(k,G,B)}};m>0&&(R=CZ(R,m,{trailing:!0,leading:!1}));var z=new ResizeObserver(R),{width:D,height:U}=S.current.getBoundingClientRect();return N(D,U),z.observe(S.current),()=>{z.disconnect()}},[N,m]);var{containerWidth:O,containerHeight:T}=j;Th(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:A,calculatedHeight:P}=UT(O,T,{width:a,height:l,aspect:r,maxHeight:f});return Th(A!=null&&A>0||P!=null&&P>0,`The width(%s) and height(%s) of chart should be greater than 0,
140
+ please check the style of container, or the props width(%s) and height(%s),
141
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
142
+ height and width.`,A,P,a,l,s,c,r),b.createElement("div",{id:p?"".concat(p):void 0,className:ot("recharts-responsive-container",y),style:V5(V5({},_),{},{width:a,height:l,minWidth:s,minHeight:c,maxHeight:f}),ref:S},b.createElement("div",{style:MZ({width:a,height:l})},b.createElement(HT,{width:A,height:P},d)))}),$Z=b.forwardRef((e,n)=>{var r=m1();if(ai(r.width)&&ai(r.height))return e.children;var{width:i,height:a}=PZ({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:l,calculatedHeight:s}=UT(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight});return Ce(l)&&Ce(s)?b.createElement(HT,{width:l,height:s},e.children):b.createElement(IZ,_x({},e,{width:i,height:a,ref:n}))});function p1(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Nc=()=>{var e,n=wn(),r=Ne(bZ),i=Ne($m),a=(e=Ne(Im))===null||e===void 0?void 0:e.padding;return!n||!i||!a?r:{width:i.width-a.left-a.right,height:i.height-a.top-a.bottom,x:a.left,y:a.top}},BZ={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},GT=()=>{var e;return(e=Ne(ln))!==null&&e!==void 0?e:BZ},KT=()=>Ne(ta),VT=()=>Ne(na),_t=e=>e.layout.layoutType,rs=()=>Ne(_t),YT=()=>{var e=rs();if(e==="horizontal"||e==="vertical")return e},WT=e=>{var n=e.layout.layoutType;if(n==="centric"||n==="radial")return n},FZ=()=>{var e=rs();return e!==void 0},Oc=e=>{var n=At(),r=wn(),{width:i,height:a}=e,l=m1(),s=i,c=a;return l&&(s=l.width>0?l.width:i,c=l.height>0?l.height:a),b.useEffect(()=>{!r&&ai(s)&&ai(c)&&n(VX({width:s,height:c}))},[n,r,s,c]),null},XT=Symbol.for("immer-nothing"),Y5=Symbol.for("immer-draftable"),Zn=Symbol.for("immer-state");function Mr(e,...n){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tc=Object.getPrototypeOf;function Wo(e){return!!e&&!!e[Zn]}function Tl(e){var n;return e?ZT(e)||Array.isArray(e)||!!e[Y5]||!!((n=e.constructor)!=null&&n[Y5])||Ac(e)||Fm(e):!1}var UZ=Object.prototype.constructor.toString(),W5=new WeakMap;function ZT(e){if(!e||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype)return!0;const r=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let i=W5.get(r);return i===void 0&&(i=Function.toString.call(r),W5.set(r,i)),i===UZ}function Mh(e,n,r=!0){Bm(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{n(a,e[a],e)}):e.forEach((i,a)=>n(a,i,e))}function Bm(e){const n=e[Zn];return n?n.type_:Array.isArray(e)?1:Ac(e)?2:Fm(e)?3:0}function kx(e,n){return Bm(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function QT(e,n,r){const i=Bm(e);i===2?e.set(n,r):i===3?e.add(r):e[n]=r}function qZ(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function Ac(e){return e instanceof Map}function Fm(e){return e instanceof Set}function pl(e){return e.copy_||e.base_}function Sx(e,n){if(Ac(e))return new Map(e);if(Fm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=ZT(e);if(n===!0||n==="class_only"&&!r){const i=Object.getOwnPropertyDescriptors(e);delete i[Zn];let a=Reflect.ownKeys(i);for(let l=0;l<a.length;l++){const s=a[l],c=i[s];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(i[s]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[s]})}return Object.create(tc(e),i)}else{const i=tc(e);if(i!==null&&r)return{...e};const a=Object.create(i);return Object.assign(a,e)}}function g1(e,n=!1){return Um(e)||Wo(e)||!Tl(e)||(Bm(e)>1&&Object.defineProperties(e,{set:Sd,add:Sd,clear:Sd,delete:Sd}),Object.freeze(e),n&&Object.values(e).forEach(r=>g1(r,!0))),e}function HZ(){Mr(2)}var Sd={value:HZ};function Um(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var GZ={};function Ml(e){const n=GZ[e];return n||Mr(0,e),n}var nc;function JT(){return nc}function KZ(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function X5(e,n){n&&(Ml("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function jx(e){Ex(e),e.drafts_.forEach(VZ),e.drafts_=null}function Ex(e){e===nc&&(nc=e.parent_)}function Z5(e){return nc=KZ(nc,e)}function VZ(e){const n=e[Zn];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function Q5(e,n){n.unfinalizedDrafts_=n.drafts_.length;const r=n.drafts_[0];return e!==void 0&&e!==r?(r[Zn].modified_&&(jx(n),Mr(4)),Tl(e)&&(e=Ph(n,e),n.parent_||Dh(n,e)),n.patches_&&Ml("Patches").generateReplacementPatches_(r[Zn].base_,e,n.patches_,n.inversePatches_)):e=Ph(n,r,[]),jx(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==XT?e:void 0}function Ph(e,n,r){if(Um(n))return n;const i=e.immer_.shouldUseStrictIteration(),a=n[Zn];if(!a)return Mh(n,(l,s)=>J5(e,a,n,l,s,r),i),n;if(a.scope_!==e)return n;if(!a.modified_)return Dh(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const l=a.copy_;let s=l,c=!1;a.type_===3&&(s=new Set(l),l.clear(),c=!0),Mh(s,(f,d)=>J5(e,a,l,f,d,r,c),i),Dh(e,l,!1),r&&e.patches_&&Ml("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function J5(e,n,r,i,a,l,s){if(a==null||typeof a!="object"&&!s)return;const c=Um(a);if(!(c&&!s)){if(Wo(a)){const f=l&&n&&n.type_!==3&&!kx(n.assigned_,i)?l.concat(i):void 0,d=Ph(e,a,f);if(QT(r,i,d),Wo(d))e.canAutoFreeze_=!1;else return}else s&&r.add(a);if(Tl(a)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||n&&n.base_&&n.base_[i]===a&&c)return;Ph(e,a),(!n||!n.scope_.parent_)&&typeof i!="symbol"&&(Ac(r)?r.has(i):Object.prototype.propertyIsEnumerable.call(r,i))&&Dh(e,a)}}}function Dh(e,n,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&g1(n,r)}function YZ(e,n){const r=Array.isArray(e),i={type_:r?1:0,scope_:n?n.scope_:JT(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=i,l=v1;r&&(a=[i],l=rc);const{revoke:s,proxy:c}=Proxy.revocable(a,l);return i.draft_=c,i.revoke_=s,c}var v1={get(e,n){if(n===Zn)return e;const r=pl(e);if(!kx(r,n))return WZ(e,r,n);const i=r[n];return e.finalized_||!Tl(i)?i:i===Q0(e.base_,n)?(J0(e),e.copy_[n]=Nx(i,e)):i},has(e,n){return n in pl(e)},ownKeys(e){return Reflect.ownKeys(pl(e))},set(e,n,r){const i=eM(pl(e),n);if(i!=null&&i.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){const a=Q0(pl(e),n),l=a==null?void 0:a[Zn];if(l&&l.base_===r)return e.copy_[n]=r,e.assigned_[n]=!1,!0;if(qZ(r,a)&&(r!==void 0||kx(e.base_,n)))return!0;J0(e),Cx(e)}return e.copy_[n]===r&&(r!==void 0||n in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=r,e.assigned_[n]=!0),!0},deleteProperty(e,n){return Q0(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,J0(e),Cx(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const r=pl(e),i=Reflect.getOwnPropertyDescriptor(r,n);return i&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:i.enumerable,value:r[n]}},defineProperty(){Mr(11)},getPrototypeOf(e){return tc(e.base_)},setPrototypeOf(){Mr(12)}},rc={};Mh(v1,(e,n)=>{rc[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});rc.deleteProperty=function(e,n){return rc.set.call(this,e,n,void 0)};rc.set=function(e,n,r){return v1.set.call(this,e[0],n,r,e[0])};function Q0(e,n){const r=e[Zn];return(r?pl(r):e)[n]}function WZ(e,n,r){var a;const i=eM(n,r);return i?"value"in i?i.value:(a=i.get)==null?void 0:a.call(e.draft_):void 0}function eM(e,n){if(!(n in e))return;let r=tc(e);for(;r;){const i=Object.getOwnPropertyDescriptor(r,n);if(i)return i;r=tc(r)}}function Cx(e){e.modified_||(e.modified_=!0,e.parent_&&Cx(e.parent_))}function J0(e){e.copy_||(e.copy_=Sx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var XZ=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(n,r,i)=>{if(typeof n=="function"&&typeof r!="function"){const l=r;r=n;const s=this;return function(f=l,...d){return s.produce(f,m=>r.call(this,m,...d))}}typeof r!="function"&&Mr(6),i!==void 0&&typeof i!="function"&&Mr(7);let a;if(Tl(n)){const l=Z5(this),s=Nx(n,void 0);let c=!0;try{a=r(s),c=!1}finally{c?jx(l):Ex(l)}return X5(l,i),Q5(a,l)}else if(!n||typeof n!="object"){if(a=r(n),a===void 0&&(a=n),a===XT&&(a=void 0),this.autoFreeze_&&g1(a,!0),i){const l=[],s=[];Ml("Patches").generateReplacementPatches_(n,a,l,s),i(l,s)}return a}else Mr(1,n)},this.produceWithPatches=(n,r)=>{if(typeof n=="function")return(s,...c)=>this.produceWithPatches(s,f=>n(f,...c));let i,a;return[this.produce(n,r,(s,c)=>{i=s,a=c}),i,a]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Tl(e)||Mr(8),Wo(e)&&(e=ZZ(e));const n=Z5(this),r=Nx(e,void 0);return r[Zn].isManual_=!0,Ex(n),r}finishDraft(e,n){const r=e&&e[Zn];(!r||!r.isManual_)&&Mr(9);const{scope_:i}=r;return X5(i,n),Q5(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Ml("Patches").applyPatches_;return Wo(e)?i(e,n):this.produce(e,a=>i(a,n))}};function Nx(e,n){const r=Ac(e)?Ml("MapSet").proxyMap_(e,n):Fm(e)?Ml("MapSet").proxySet_(e,n):YZ(e,n);return(n?n.scope_:JT()).drafts_.push(r),r}function ZZ(e){return Wo(e)||Mr(10,e),tM(e)}function tM(e){if(!Tl(e)||Um(e))return e;const n=e[Zn];let r,i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=Sx(e,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=Sx(e,!0);return Mh(r,(a,l)=>{QT(r,a,tM(l))},i),n&&(n.finalized_=!1),r}var QZ=new XZ;QZ.produce;var JZ={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},nM=hn({name:"legend",initialState:JZ,reducers:{setLegendSize(e,n){e.size.width=n.payload.width,e.size.height=n.payload.height},setLegendSettings(e,n){e.settings.align=n.payload.align,e.settings.layout=n.payload.layout,e.settings.verticalAlign=n.payload.verticalAlign,e.settings.itemSorter=n.payload.itemSorter},addLegendPayload:{reducer(e,n){e.payload.push(n.payload)},prepare:pt()},replaceLegendPayload:{reducer(e,n){var{prev:r,next:i}=n.payload,a=xr(e).payload.indexOf(r);a>-1&&(e.payload[a]=i)},prepare:pt()},removeLegendPayload:{reducer(e,n){var r=xr(e).payload.indexOf(n.payload);r>-1&&e.payload.splice(r,1)},prepare:pt()}}}),{setLegendSize:$de,setLegendSettings:Bde,addLegendPayload:eQ,replaceLegendPayload:tQ,removeLegendPayload:nQ}=nM.actions,rQ=nM.reducer,ey={exports:{}},ty={};/**
143
+ * @license React
144
+ * use-sync-external-store-with-selector.production.js
145
+ *
146
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
147
+ *
148
+ * This source code is licensed under the MIT license found in the
149
+ * LICENSE file in the root directory of this source tree.
150
+ */var eC;function iQ(){if(eC)return ty;eC=1;var e=Qo();function n(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,a=e.useRef,l=e.useEffect,s=e.useMemo,c=e.useDebugValue;return ty.useSyncExternalStoreWithSelector=function(f,d,m,p,y){var x=a(null);if(x.current===null){var _={hasValue:!1,value:null};x.current=_}else _=x.current;x=s(function(){function k(T){if(!j){if(j=!0,C=T,T=p(T),y!==void 0&&_.hasValue){var A=_.value;if(y(A,T))return N=A}return N=T}if(A=N,r(C,T))return A;var P=p(T);return y!==void 0&&y(A,P)?(C=T,A):(C=T,N=P)}var j=!1,C,N,O=m===void 0?null:m;return[function(){return k(d())},O===null?void 0:function(){return k(O())}]},[d,m,p,y]);var S=i(f,x[0],x[1]);return l(function(){_.hasValue=!0,_.value=S},[S]),c(S),S},ty}var tC;function aQ(){return tC||(tC=1,ey.exports=iQ()),ey.exports}aQ();function lQ(e){e()}function oQ(){let e=null,n=null;return{clear(){e=null,n=null},notify(){lQ(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let i=e;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0;const a=n={callback:r,next:null,prev:n};return a.prev?a.prev.next=a:e=a,function(){!i||e===null||(i=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var nC={notify(){},get:()=>[]};function sQ(e,n){let r,i=nC,a=0,l=!1;function s(S){m();const k=i.subscribe(S);let j=!1;return()=>{j||(j=!0,k(),p())}}function c(){i.notify()}function f(){_.onStateChange&&_.onStateChange()}function d(){return l}function m(){a++,r||(r=e.subscribe(f),i=oQ())}function p(){a--,r&&a===0&&(r(),r=void 0,i.clear(),i=nC)}function y(){l||(l=!0,m())}function x(){l&&(l=!1,p())}const _={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:d,trySubscribe:y,tryUnsubscribe:x,getListeners:()=>i};return _}var uQ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cQ=uQ(),fQ=()=>typeof navigator<"u"&&navigator.product==="ReactNative",dQ=fQ(),hQ=()=>cQ||dQ?b.useLayoutEffect:b.useEffect,mQ=hQ();function rC(e,n){return e===n?e!==0||n!==0||1/e===1/n:e!==e&&n!==n}function pQ(e,n){if(rC(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;const r=Object.keys(e),i=Object.keys(n);if(r.length!==i.length)return!1;for(let a=0;a<r.length;a++)if(!Object.prototype.hasOwnProperty.call(n,r[a])||!rC(e[r[a]],n[r[a]]))return!1;return!0}var ny=Symbol.for("react-redux-context"),ry=typeof globalThis<"u"?globalThis:{};function gQ(){if(!b.createContext)return{};const e=ry[ny]??(ry[ny]=new Map);let n=e.get(b.createContext);return n||(n=b.createContext(null),e.set(b.createContext,n)),n}var vQ=gQ();function yQ(e){const{children:n,context:r,serverState:i,store:a}=e,l=b.useMemo(()=>{const f=sQ(a);return{store:a,subscription:f,getServerState:i?()=>i:void 0}},[a,i]),s=b.useMemo(()=>a.getState(),[a]);mQ(()=>{const{subscription:f}=l;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),s!==a.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[l,s]);const c=r||vQ;return b.createElement(c.Provider,{value:l},n)}var xQ=yQ,bQ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function wQ(e,n){return e==null&&n==null?!0:typeof e=="number"&&typeof n=="number"?e===n||e!==e&&n!==n:e===n}function qm(e,n){var r=new Set([...Object.keys(e),...Object.keys(n)]);for(var i of r)if(bQ.has(i)){if(e[i]==null&&n[i]==null)continue;if(!pQ(e[i],n[i]))return!1}else if(!wQ(e[i],n[i]))return!1;return!0}function Ox(){return Ox=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ox.apply(null,arguments)}function iC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function _u(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?iC(Object(r),!0).forEach(function(i){_Q(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function _Q(e,n,r){return(n=kQ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function kQ(e){var n=SQ(e,"string");return typeof n=="symbol"?n:n+""}function SQ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function jQ(e){return Array.isArray(e)&&br(e[0])&&br(e[1])?e.join(" ~ "):e}var Oo={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function EQ(e,n){return n==null?e:Em(e,n)}var CQ=e=>{var{separator:n=Oo.separator,contentStyle:r,itemStyle:i,labelStyle:a=Oo.labelStyle,payload:l,formatter:s,itemSorter:c,wrapperClassName:f,labelClassName:d,label:m,labelFormatter:p,accessibilityLayer:y=Oo.accessibilityLayer}=e,x=()=>{if(l&&l.length){var T={padding:0,margin:0},A=EQ(l,c),P=A.map((R,z)=>{if(R.type==="none")return null;var D=R.formatter||s||jQ,{value:U,name:q}=R,L=U,$=q;if(D){var G=D(U,q,R,z,l);if(Array.isArray(G))[L,$]=G;else if(G!=null)L=G;else return null}var B=_u(_u({},Oo.itemStyle),{},{color:R.color||Oo.itemStyle.color},i);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:B},br($)?b.createElement("span",{className:"recharts-tooltip-item-name"},$):null,br($)?b.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,b.createElement("span",{className:"recharts-tooltip-item-value"},L),b.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:T},P)}return null},_=_u(_u({},Oo.contentStyle),r),S=_u({margin:0},a),k=!Gt(m),j=k?m:"",C=ot("recharts-default-tooltip",f),N=ot("recharts-tooltip-label",d);k&&p&&l!==void 0&&l!==null&&(j=p(m,l));var O=y?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",Ox({className:C,style:_},O),b.createElement("p",{className:N,style:S},b.isValidElement(j)?j:"".concat(j)),x())},ku="recharts-tooltip-wrapper",NQ={visibility:"hidden"};function OQ(e){var{coordinate:n,translateX:r,translateY:i}=e;return ot(ku,{["".concat(ku,"-right")]:Ce(r)&&n&&Ce(n.x)&&r>=n.x,["".concat(ku,"-left")]:Ce(r)&&n&&Ce(n.x)&&r<n.x,["".concat(ku,"-bottom")]:Ce(i)&&n&&Ce(n.y)&&i>=n.y,["".concat(ku,"-top")]:Ce(i)&&n&&Ce(n.y)&&i<n.y})}function aC(e){var{allowEscapeViewBox:n,coordinate:r,key:i,offset:a,position:l,reverseDirection:s,tooltipDimension:c,viewBox:f,viewBoxDimension:d}=e;if(l&&Ce(l[i]))return l[i];var m=r[i]-c-(a>0?a:0),p=r[i]+a;if(n[i])return s[i]?m:p;var y=f[i];if(y==null)return 0;if(s[i]){var x=m,_=y;return x<_?Math.max(p,y):Math.max(m,y)}if(d==null)return 0;var S=p+c,k=y+d;return S>k?Math.max(m,y):Math.max(p,y)}function AQ(e){var{translateX:n,translateY:r,useTranslate3d:i}=e;return{transform:i?"translate3d(".concat(n,"px, ").concat(r,"px, 0)"):"translate(".concat(n,"px, ").concat(r,"px)")}}function TQ(e){var{allowEscapeViewBox:n,coordinate:r,offsetTop:i,offsetLeft:a,position:l,reverseDirection:s,tooltipBox:c,useTranslate3d:f,viewBox:d}=e,m,p,y;return c.height>0&&c.width>0&&r?(p=aC({allowEscapeViewBox:n,coordinate:r,key:"x",offset:a,position:l,reverseDirection:s,tooltipDimension:c.width,viewBox:d,viewBoxDimension:d.width}),y=aC({allowEscapeViewBox:n,coordinate:r,key:"y",offset:i,position:l,reverseDirection:s,tooltipDimension:c.height,viewBox:d,viewBoxDimension:d.height}),m=AQ({translateX:p,translateY:y,useTranslate3d:f})):m=NQ,{cssProperties:m,cssClasses:OQ({translateX:p,translateY:y,coordinate:r})}}var MQ=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Tc={isSsr:MQ()};function rM(){var[e,n]=b.useState(()=>Tc.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return b.useEffect(()=>{if(window.matchMedia){var r=window.matchMedia("(prefers-reduced-motion: reduce)"),i=()=>{n(r.matches)};return r.addEventListener("change",i),()=>{r.removeEventListener("change",i)}}},[]),e}function lC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Ao(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?lC(Object(r),!0).forEach(function(i){PQ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function PQ(e,n,r){return(n=DQ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function DQ(e){var n=RQ(e,"string");return typeof n=="symbol"?n:n+""}function RQ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function LQ(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function zQ(e){var n,r,i,a,l,s,c=rM(),[f,d]=b.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));b.useEffect(()=>{var _=S=>{if(S.key==="Escape"){var k,j,C,N;d({dismissed:!0,dismissedAtCoordinate:{x:(k=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&k!==void 0?k:0,y:(C=(N=e.coordinate)===null||N===void 0?void 0:N.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[(n=e.coordinate)===null||n===void 0?void 0:n.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),f.dismissed&&(((i=(a=e.coordinate)===null||a===void 0?void 0:a.x)!==null&&i!==void 0?i:0)!==f.dismissedAtCoordinate.x||((l=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&l!==void 0?l:0)!==f.dismissedAtCoordinate.y)&&d(Ao(Ao({},f),{},{dismissed:!1}));var{cssClasses:m,cssProperties:p}=TQ({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:Ao(Ao({transition:LQ({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},p),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),x=Ao(Ao({},y),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:x,ref:e.innerRef},e.children)}var IQ=b.memo(zQ),iM=()=>{var e;return(e=Ne(n=>n.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Ax(){return Ax=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ax.apply(null,arguments)}function oC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function sC(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?oC(Object(r),!0).forEach(function(i){$Q(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function $Q(e,n,r){return(n=BQ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function BQ(e){var n=FQ(e,"string");return typeof n=="symbol"?n:n+""}function FQ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var uC={curveBasisClosed:yY,curveBasisOpen:xY,curveBasis:vY,curveBumpX:rY,curveBumpY:iY,curveLinearClosed:bY,curveLinear:km,curveMonotoneX:wY,curveMonotoneY:_Y,curveNatural:kY,curveStep:SY,curveStepAfter:EY,curveStepBefore:jY},Rh=e=>Fe(e.x)&&Fe(e.y),cC=e=>e.base!=null&&Rh(e.base)&&Rh(e),Su=e=>e.x,ju=e=>e.y,UQ=(e,n)=>{if(typeof e=="function")return e;var r="curve".concat(Sc(e));if((r==="curveMonotone"||r==="curveBump")&&n){var i=uC["".concat(r).concat(n==="vertical"?"Y":"X")];if(i)return i}return uC[r]||km},fC={connectNulls:!1,type:"linear"},qQ=e=>{var{type:n=fC.type,points:r=[],baseLine:i,layout:a,connectNulls:l=fC.connectNulls}=e,s=UQ(n,a),c=l?r.filter(Rh):r;if(Array.isArray(i)){var f,d=r.map((_,S)=>sC(sC({},_),{},{base:i[S]}));a==="vertical"?f=vd().y(ju).x1(Su).x0(_=>_.base.x):f=vd().x(Su).y1(ju).y0(_=>_.base.y);var m=f.defined(cC).curve(s),p=l?d.filter(cC):d;return m(p)}var y;a==="vertical"&&Ce(i)?y=vd().y(ju).x1(Su).x0(i):Ce(i)?y=vd().x(Su).y1(ju).y0(i):y=T3().x(Su).y(ju);var x=y.defined(Rh).curve(s);return x(c)},aM=e=>{var{className:n,points:r,path:i,pathRef:a}=e,l=rs();if((!r||!r.length)&&!i)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||l,connectNulls:e.connectNulls},c=r&&r.length?qQ(s):i;return b.createElement("path",Ax({},ri(e),a1(e),{className:ot("recharts-curve",n),d:c===null?void 0:c,ref:a}))},HQ=["x","y","top","left","width","height","className"];function Tx(){return Tx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Tx.apply(null,arguments)}function dC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function GQ(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?dC(Object(r),!0).forEach(function(i){KQ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function KQ(e,n,r){return(n=VQ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function VQ(e){var n=YQ(e,"string");return typeof n=="symbol"?n:n+""}function YQ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function WQ(e,n){if(e==null)return{};var r,i,a=XQ(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function XQ(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var ZQ=(e,n,r,i,a,l)=>"M".concat(e,",").concat(a,"v").concat(i,"M").concat(l,",").concat(n,"h").concat(r),QQ=e=>{var{x:n=0,y:r=0,top:i=0,left:a=0,width:l=0,height:s=0,className:c}=e,f=WQ(e,HQ),d=GQ({x:n,y:r,top:i,left:a,width:l,height:s},f);return!Ce(n)||!Ce(r)||!Ce(l)||!Ce(s)||!Ce(i)||!Ce(a)?null:b.createElement("path",Tx({},dn(d),{className:ot("recharts-cross",c),d:ZQ(n,r,l,s,i,a)}))};function JQ(e,n,r,i){var a=i/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?n.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:n.y-a,width:e==="horizontal"?i:r.width-1,height:e==="horizontal"?r.height-1:i}}function hC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function mC(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?hC(Object(r),!0).forEach(function(i){eJ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function eJ(e,n,r){return(n=tJ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function tJ(e){var n=nJ(e,"string");return typeof n=="symbol"?n:n+""}function nJ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var rJ=e=>e.replace(/([A-Z])/g,n=>"-".concat(n.toLowerCase())),lM=(e,n,r)=>e.map(i=>"".concat(rJ(i)," ").concat(n,"ms ").concat(r)).join(","),iJ=(e,n)=>[Object.keys(e),Object.keys(n)].reduce((r,i)=>r.filter(a=>i.includes(a))),ic=(e,n)=>Object.keys(n).reduce((r,i)=>mC(mC({},r),{},{[i]:e(i,n[i])}),{});function pC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function $t(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?pC(Object(r),!0).forEach(function(i){aJ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function aJ(e,n,r){return(n=lJ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function lJ(e){var n=oJ(e,"string");return typeof n=="symbol"?n:n+""}function oJ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var Lh=(e,n,r)=>e+(n-e)*r,Mx=e=>{var{from:n,to:r}=e;return n!==r},oM=(e,n,r)=>{var i=ic((a,l)=>{if(Mx(l)){var[s,c]=e(l.from,l.to,l.velocity);return $t($t({},l),{},{from:s,velocity:c})}return l},n);return r<1?ic((a,l)=>Mx(l)&&i[a]!=null?$t($t({},l),{},{velocity:Lh(l.velocity,i[a].velocity,r),from:Lh(l.from,i[a].from,r)}):l,n):oM(e,i,r-1)};function sJ(e,n,r,i,a,l){var s,c=i.reduce((y,x)=>$t($t({},y),{},{[x]:{from:e[x],velocity:0,to:n[x]}}),{}),f=()=>ic((y,x)=>x.from,c),d=()=>!Object.values(c).filter(Mx).length,m=null,p=y=>{s||(s=y);var x=y-s,_=x/r.dt;c=oM(r,c,_),a($t($t($t({},e),n),f())),s=y,d()||(m=l.setTimeout(p))};return()=>(m=l.setTimeout(p),()=>{var y;(y=m)===null||y===void 0||y()})}function uJ(e,n,r,i,a,l,s){var c=null,f=a.reduce((p,y)=>{var x=e[y],_=n[y];return x==null||_==null?p:$t($t({},p),{},{[y]:[x,_]})},{}),d,m=p=>{d||(d=p);var y=(p-d)/i,x=ic((S,k)=>Lh(...k,r(y)),f);if(l($t($t($t({},e),n),x)),y<1)c=s.setTimeout(m);else{var _=ic((S,k)=>Lh(...k,r(1)),f);l($t($t($t({},e),n),_))}};return()=>(c=s.setTimeout(m),()=>{var p;(p=c)===null||p===void 0||p()})}const cJ=(e,n,r,i,a,l)=>{var s=iJ(e,n);return r==null?()=>(a($t($t({},e),n)),()=>{}):r.isStepper===!0?sJ(e,n,r,s,a,l):uJ(e,n,r,i,s,a,l)};var zh=1e-4,sM=(e,n)=>[0,3*e,3*n-6*e,3*e-3*n+1],uM=(e,n)=>e.map((r,i)=>r*n**i).reduce((r,i)=>r+i),gC=(e,n)=>r=>{var i=sM(e,n);return uM(i,r)},fJ=(e,n)=>r=>{var i=sM(e,n),a=[...i.map((l,s)=>l*s).slice(1),0];return uM(a,r)},dJ=e=>{var n,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var i=(n=r[1])===null||n===void 0||(n=n.split(")")[0])===null||n===void 0?void 0:n.split(",");if(i==null||i.length!==4)return null;var a=i.map(l=>parseFloat(l));return[a[0],a[1],a[2],a[3]]},hJ=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var a=dJ(r[0]);if(a)return a}}return r.length===4?r:[0,0,1,1]},mJ=(e,n,r,i)=>{var a=gC(e,r),l=gC(n,i),s=fJ(e,r),c=d=>d>1?1:d<0?0:d,f=d=>{for(var m=d>1?1:d,p=m,y=0;y<8;++y){var x=a(p)-m,_=s(p);if(Math.abs(x-m)<zh||_<zh)return l(p);p=c(p-x/_)}return l(p)};return f.isStepper=!1,f},vC=function(){return mJ(...hJ(...arguments))},pJ=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:i=8,dt:a=17}=n,l=(s,c,f)=>{var d=-(s-c)*r,m=f*i,p=f+(d-m)*a/1e3,y=f*a/1e3+s;return Math.abs(y-c)<zh&&Math.abs(p)<zh?[c,0]:[y,p]};return l.isStepper=!0,l.dt=a,l},gJ=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return vC(e);case"spring":return pJ();default:if(e.split("(")[0]==="cubic-bezier")return vC(e)}return typeof e=="function"?e:null};function vJ(e){var n,r=()=>null,i=!1,a=null,l=s=>{if(!i){if(Array.isArray(s)){if(!s.length)return;var c=s,[f,...d]=c;if(typeof f=="number"){a=e.setTimeout(l.bind(null,d),f);return}l(f),a=e.setTimeout(l.bind(null,d));return}typeof s=="string"&&(n=s,r(n)),typeof s=="object"&&(n=s,r(n)),typeof s=="function"&&s()}};return{stop:()=>{i=!0},start:s=>{i=!1,a&&(a(),a=null),l(s)},subscribe:s=>(r=s,()=>{r=()=>null}),getTimeoutController:()=>e}}class yJ{setTimeout(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=performance.now(),a=null,l=s=>{s-i>=r?n(s):typeof requestAnimationFrame=="function"&&(a=requestAnimationFrame(l))};return a=requestAnimationFrame(l),()=>{a!=null&&cancelAnimationFrame(a)}}}function xJ(){return vJ(new yJ)}var bJ=b.createContext(xJ);function wJ(e,n){var r=b.useContext(bJ);return b.useMemo(()=>n??r(e),[e,n,r])}var _J={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},yC={t:0},iy={t:1};function y1(e){var n=bn(e,_J),{isActive:r,canBegin:i,duration:a,easing:l,begin:s,onAnimationEnd:c,onAnimationStart:f,children:d}=n,m=rM(),p=r==="auto"?!Tc.isSsr&&!m:r,y=wJ(n.animationId,n.animationManager),[x,_]=b.useState(p?yC:iy),S=b.useRef(null);return b.useEffect(()=>{p||_(iy)},[p]),b.useEffect(()=>{if(!p||!i)return zl;var k=cJ(yC,iy,gJ(l),a,_,y.getTimeoutController()),j=()=>{S.current=k()};return y.start([f,s,j,a,c]),()=>{y.stop(),S.current&&S.current(),c()}},[p,i,a,l,s,f,c,y]),d(x.t)}function x1(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=b.useRef(Zu(n)),i=b.useRef(e);return i.current!==e&&(r.current=Zu(n),i.current=e),r.current}var kJ=["radius"],SJ=["radius"],xC,bC,wC,_C,kC,SC,jC,EC,CC,NC;function OC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function AC(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?OC(Object(r),!0).forEach(function(i){jJ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function jJ(e,n,r){return(n=EJ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function EJ(e){var n=CJ(e,"string");return typeof n=="symbol"?n:n+""}function CJ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ih.apply(null,arguments)}function TC(e,n){if(e==null)return{};var r,i,a=NJ(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function NJ(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Fr(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var MC=(e,n,r,i,a)=>{var l=La(r),s=La(i),c=Math.min(Math.abs(l)/2,Math.abs(s)/2),f=s>=0?1:-1,d=l>=0?1:-1,m=s>=0&&l>=0||s<0&&l<0?1:0,p;if(c>0&&Array.isArray(a)){for(var y=[0,0,0,0],x=0,_=4;x<_;x++){var S,k=(S=a[x])!==null&&S!==void 0?S:0;y[x]=k>c?c:k}p=Et(xC||(xC=Fr(["M",",",""])),e,n+f*y[0]),y[0]>0&&(p+=Et(bC||(bC=Fr(["A ",",",",0,0,",",",",",""])),y[0],y[0],m,e+d*y[0],n)),p+=Et(wC||(wC=Fr(["L ",",",""])),e+r-d*y[1],n),y[1]>0&&(p+=Et(_C||(_C=Fr(["A ",",",",0,0,",`,
151
+ `,",",""])),y[1],y[1],m,e+r,n+f*y[1])),p+=Et(kC||(kC=Fr(["L ",",",""])),e+r,n+i-f*y[2]),y[2]>0&&(p+=Et(SC||(SC=Fr(["A ",",",",0,0,",`,
152
+ `,",",""])),y[2],y[2],m,e+r-d*y[2],n+i)),p+=Et(jC||(jC=Fr(["L ",",",""])),e+d*y[3],n+i),y[3]>0&&(p+=Et(EC||(EC=Fr(["A ",",",",0,0,",`,
153
+ `,",",""])),y[3],y[3],m,e,n+i-f*y[3])),p+="Z"}else if(c>0&&a===+a&&a>0){var j=Math.min(c,a);p=Et(CC||(CC=Fr(["M ",",",`
154
+ A `,",",",0,0,",",",",",`
155
+ L `,",",`
156
+ A `,",",",0,0,",",",",",`
157
+ L `,",",`
158
+ A `,",",",0,0,",",",",",`
159
+ L `,",",`
160
+ A `,",",",0,0,",",",","," Z"])),e,n+f*j,j,j,m,e+d*j,n,e+r-d*j,n,j,j,m,e+r,n+f*j,e+r,n+i-f*j,j,j,m,e+r-d*j,n+i,e+d*j,n+i,j,j,m,e,n+i-f*j)}else p=Et(NC||(NC=Fr(["M ",","," h "," v "," h "," Z"])),e,n,r,i,-r);return p},PC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},cM=e=>{var n=bn(e,PC),r=b.useRef(null),[i,a]=b.useState(-1);b.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var Y=r.current.getTotalLength();Y&&a(Y)}catch{}},[]);var{x:l,y:s,width:c,height:f,radius:d,className:m}=n,{animationEasing:p,animationDuration:y,animationBegin:x,isAnimationActive:_,isUpdateAnimationActive:S}=n,k=b.useRef(c),j=b.useRef(f),C=b.useRef(l),N=b.useRef(s),O=b.useMemo(()=>({x:l,y:s,width:c,height:f,radius:d}),[l,s,c,f,d]),T=x1(O,"rectangle-");if(l!==+l||s!==+s||c!==+c||f!==+f||c===0||f===0)return null;var A=ot("recharts-rectangle",m);if(!S){var P=dn(n),{radius:R}=P,z=TC(P,kJ);return b.createElement("path",Ih({},z,{x:La(l),y:La(s),width:La(c),height:La(f),radius:typeof d=="number"?d:void 0,className:A,d:MC(l,s,c,f,d)}))}var D=k.current,U=j.current,q=C.current,L=N.current,$="0px ".concat(i===-1?1:i,"px"),G="".concat(i,"px ").concat(i,"px"),B=lM(["strokeDasharray"],y,typeof p=="string"?p:PC.animationEasing);return b.createElement(y1,{animationId:T,key:T,canBegin:i>0,duration:y,easing:p,isActive:S,begin:x},Y=>{var ee=An(D,c,Y),H=An(U,f,Y),re=An(q,l,Y),F=An(L,s,Y);r.current&&(k.current=ee,j.current=H,C.current=re,N.current=F);var X;_?Y>0?X={transition:B,strokeDasharray:G}:X={strokeDasharray:$}:X={strokeDasharray:G};var ae=dn(n),{radius:se}=ae,ve=TC(ae,SJ);return b.createElement("path",Ih({},ve,{radius:typeof d=="number"?d:void 0,className:A,d:MC(re,F,ee,H,d),ref:r,style:AC(AC({},X),n.style)}))})};function DC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function RC(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?DC(Object(r),!0).forEach(function(i){OJ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function OJ(e,n,r){return(n=AJ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function AJ(e){var n=TJ(e,"string");return typeof n=="symbol"?n:n+""}function TJ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var $h=Math.PI/180,MJ=e=>e*180/Math.PI,nn=(e,n,r,i)=>({x:e+Math.cos(-$h*i)*r,y:n+Math.sin(-$h*i)*r}),PJ=function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(n-(i.left||0)-(i.right||0)),Math.abs(r-(i.top||0)-(i.bottom||0)))/2},DJ=(e,n)=>{var{x:r,y:i}=e,{x:a,y:l}=n;return Math.sqrt((r-a)**2+(i-l)**2)},RJ=(e,n)=>{var{x:r,y:i}=e,{cx:a,cy:l}=n,s=DJ({x:r,y:i},{x:a,y:l});if(s<=0)return{radius:s,angle:0};var c=(r-a)/s,f=Math.acos(c);return i>l&&(f=2*Math.PI-f),{radius:s,angle:MJ(f),angleInRadian:f}},LJ=e=>{var{startAngle:n,endAngle:r}=e,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return{startAngle:n-l*360,endAngle:r-l*360}},zJ=(e,n)=>{var{startAngle:r,endAngle:i}=n,a=Math.floor(r/360),l=Math.floor(i/360),s=Math.min(a,l);return e+s*360},IJ=(e,n)=>{var{relativeX:r,relativeY:i}=e,{radius:a,angle:l}=RJ({x:r,y:i},n),{innerRadius:s,outerRadius:c}=n;if(a<s||a>c||a===0)return null;var{startAngle:f,endAngle:d}=LJ(n),m=l,p;if(f<=d){for(;m>d;)m-=360;for(;m<f;)m+=360;p=m>=f&&m<=d}else{for(;m>f;)m-=360;for(;m<d;)m+=360;p=m>=d&&m<=f}return p?RC(RC({},n),{},{radius:a,angle:zJ(m,n)}):null};function fM(e){var{cx:n,cy:r,radius:i,startAngle:a,endAngle:l}=e,s=nn(n,r,i,a),c=nn(n,r,i,l);return{points:[s,c],cx:n,cy:r,radius:i,startAngle:a,endAngle:l}}var LC,zC,IC,$C,BC,FC,UC;function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Px.apply(null,arguments)}function bl(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var $J=(e,n)=>{var r=yr(n-e),i=Math.min(Math.abs(n-e),359.999);return r*i},jd=e=>{var{cx:n,cy:r,radius:i,angle:a,sign:l,isExternal:s,cornerRadius:c,cornerIsExternal:f}=e,d=c*(s?1:-1)+i,m=Math.asin(c/d)/$h,p=f?a:a+l*m,y=nn(n,r,d,p),x=nn(n,r,i,p),_=f?a-l*m:a,S=nn(n,r,d*Math.cos(m*$h),_);return{center:y,circleTangency:x,lineTangency:S,theta:m}},dM=e=>{var{cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:s}=e,c=$J(l,s),f=l+c,d=nn(n,r,a,l),m=nn(n,r,a,f),p=Et(LC||(LC=bl(["M ",",",`
161
+ A `,",",`,0,
162
+ `,",",`,
163
+ `,",",`
164
+ `])),d.x,d.y,a,a,+(Math.abs(c)>180),+(l>f),m.x,m.y);if(i>0){var y=nn(n,r,i,l),x=nn(n,r,i,f);p+=Et(zC||(zC=bl(["L ",",",`
165
+ A `,",",`,0,
166
+ `,",",`,
167
+ `,","," Z"])),x.x,x.y,i,i,+(Math.abs(c)>180),+(l<=f),y.x,y.y)}else p+=Et(IC||(IC=bl(["L ",","," Z"])),n,r);return p},BJ=e=>{var{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:d}=e,m=yr(d-f),{circleTangency:p,lineTangency:y,theta:x}=jd({cx:n,cy:r,radius:a,angle:f,sign:m,cornerRadius:l,cornerIsExternal:c}),{circleTangency:_,lineTangency:S,theta:k}=jd({cx:n,cy:r,radius:a,angle:d,sign:-m,cornerRadius:l,cornerIsExternal:c}),j=c?Math.abs(f-d):Math.abs(f-d)-x-k;if(j<0)return s?Et($C||($C=bl(["M ",",",`
168
+ a`,",",",0,0,1,",`,0
169
+ a`,",",",0,0,1,",`,0
170
+ `])),y.x,y.y,l,l,l*2,l,l,-l*2):dM({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:d});var C=Et(BC||(BC=bl(["M ",",",`
171
+ A`,",",",0,0,",",",",",`
172
+ A`,",",",0,",",",",",",",`
173
+ A`,",",",0,0,",",",",",`
174
+ `])),y.x,y.y,l,l,+(m<0),p.x,p.y,a,a,+(j>180),+(m<0),_.x,_.y,l,l,+(m<0),S.x,S.y);if(i>0){var{circleTangency:N,lineTangency:O,theta:T}=jd({cx:n,cy:r,radius:i,angle:f,sign:m,isExternal:!0,cornerRadius:l,cornerIsExternal:c}),{circleTangency:A,lineTangency:P,theta:R}=jd({cx:n,cy:r,radius:i,angle:d,sign:-m,isExternal:!0,cornerRadius:l,cornerIsExternal:c}),z=c?Math.abs(f-d):Math.abs(f-d)-T-R;if(z<0&&l===0)return"".concat(C,"L").concat(n,",").concat(r,"Z");C+=Et(FC||(FC=bl(["L",",",`
175
+ A`,",",",0,0,",",",",",`
176
+ A`,",",",0,",",",",",",",`
177
+ A`,",",",0,0,",",",",","Z"])),P.x,P.y,l,l,+(m<0),A.x,A.y,i,i,+(z>180),+(m>0),N.x,N.y,l,l,+(m<0),O.x,O.y)}else C+=Et(UC||(UC=bl(["L",",","Z"])),n,r);return C},FJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hM=e=>{var n=bn(e,FJ),{cx:r,cy:i,innerRadius:a,outerRadius:l,cornerRadius:s,forceCornerRadius:c,cornerIsExternal:f,startAngle:d,endAngle:m,className:p}=n;if(l<a||d===m)return null;var y=ot("recharts-sector",p),x=l-a,_=$a(s,x,0,!0),S;return _>0&&Math.abs(d-m)<360?S=BJ({cx:r,cy:i,innerRadius:a,outerRadius:l,cornerRadius:Math.min(_,x/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:d,endAngle:m}):S=dM({cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:d,endAngle:m}),b.createElement("path",Px({},dn(n),{className:y,d:S}))};function UJ(e,n,r){if(e==="horizontal")return[{x:n.x,y:r.top},{x:n.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:n.y},{x:r.left+r.width,y:n.y}];if(V3(n)){if(e==="centric"){var{cx:i,cy:a,innerRadius:l,outerRadius:s,angle:c}=n,f=nn(i,a,l,c),d=nn(i,a,s,c);return[{x:f.x,y:f.y},{x:d.x,y:d.y}]}return fM(n)}}var ay={},ly={},oy={},qC;function qJ(){return qC||(qC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=iT();function r(i){return n.isSymbol(i)?NaN:Number(i)}e.toNumber=r})(oy)),oy}var HC;function HJ(){return HC||(HC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=qJ();function r(i){return i?(i=n.toNumber(i),i===1/0||i===-1/0?(i<0?-1:1)*Number.MAX_VALUE:i===i?i:0):i===0?i:0}e.toFinite=r})(ly)),ly}var GC;function GJ(){return GC||(GC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const n=aT(),r=HJ();function i(a,l,s){s&&typeof s!="number"&&n.isIterateeCall(a,l,s)&&(l=s=void 0),a=r.toFinite(a),l===void 0?(l=a,a=0):l=r.toFinite(l),s=s===void 0?a<l?1:-1:r.toFinite(s);const c=Math.max(Math.ceil((l-a)/(s||1)),0),f=new Array(c);for(let d=0;d<c;d++)f[d]=a,a+=s;return f}e.range=i})(ay)),ay}var sy,KC;function KJ(){return KC||(KC=1,sy=GJ().range),sy}var VJ=KJ();const mM=oi(VJ);var qa=e=>e.chartData,YJ=le([qa],e=>{var n=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:n,dataStartIndex:0}}),b1=(e,n,r,i)=>i?YJ(e):qa(e);function ei(e){if(Array.isArray(e)&&e.length===2){var[n,r]=e;if(Fe(n)&&Fe(r))return!0}return!1}function VC(e,n,r){return r?e:[Math.min(e[0],n[0]),Math.max(e[1],n[1])]}function pM(e,n){if(n&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,i]=e,a,l;if(Fe(r))a=r;else if(typeof r=="function")return;if(Fe(i))l=i;else if(typeof i=="function")return;var s=[a,l];if(ei(s))return s}}function WJ(e,n,r){if(!(!r&&n==null)){if(typeof e=="function"&&n!=null)try{var i=e(n,r);if(ei(i))return VC(i,n,r)}catch{}if(Array.isArray(e)&&e.length===2){var[a,l]=e,s,c;if(a==="auto")n!=null&&(s=Math.min(...n));else if(Ce(a))s=a;else if(typeof a=="function")try{n!=null&&(s=a(n==null?void 0:n[0]))}catch{}else if(typeof a=="string"&&I5.test(a)){var f=I5.exec(a);if(f==null||f[1]==null||n==null)s=void 0;else{var d=+f[1];s=n[0]-d}}else s=n==null?void 0:n[0];if(l==="auto")n!=null&&(c=Math.max(...n));else if(Ce(l))c=l;else if(typeof l=="function")try{n!=null&&(c=l(n==null?void 0:n[1]))}catch{}else if(typeof l=="string"&&$5.test(l)){var m=$5.exec(l);if(m==null||m[1]==null||n==null)c=void 0;else{var p=+m[1];c=n[1]+p}}else c=n==null?void 0:n[1];var y=[s,c];if(ei(y))return n==null?y:VC(y,n,r)}}}var is=1e9,XJ={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_1,bt=!0,wr="[DecimalError] ",jl=wr+"Invalid argument: ",w1=wr+"Exponent out of range: ",as=Math.floor,gl=Math.pow,ZJ=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Kn,Ht=1e7,gt=7,gM=9007199254740991,Bh=as(gM/gt),_e={};_e.absoluteValue=_e.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_e.comparedTo=_e.cmp=function(e){var n,r,i,a,l=this;if(e=new l.constructor(e),l.s!==e.s)return l.s||-e.s;if(l.e!==e.e)return l.e>e.e^l.s<0?1:-1;for(i=l.d.length,a=e.d.length,n=0,r=i<a?i:a;n<r;++n)if(l.d[n]!==e.d[n])return l.d[n]>e.d[n]^l.s<0?1:-1;return i===a?0:i>a^l.s<0?1:-1};_e.decimalPlaces=_e.dp=function(){var e=this,n=e.d.length-1,r=(n-e.e)*gt;if(n=e.d[n],n)for(;n%10==0;n/=10)r--;return r<0?0:r};_e.dividedBy=_e.div=function(e){return Ui(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var n=this,r=n.constructor;return ct(Ui(n,new r(e),0,1),r.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return Rt(this)};_e.greaterThan=_e.gt=function(e){return this.cmp(e)>0};_e.greaterThanOrEqualTo=_e.gte=function(e){return this.cmp(e)>=0};_e.isInteger=_e.isint=function(){return this.e>this.d.length-2};_e.isNegative=_e.isneg=function(){return this.s<0};_e.isPositive=_e.ispos=function(){return this.s>0};_e.isZero=function(){return this.s===0};_e.lessThan=_e.lt=function(e){return this.cmp(e)<0};_e.lessThanOrEqualTo=_e.lte=function(e){return this.cmp(e)<1};_e.logarithm=_e.log=function(e){var n,r=this,i=r.constructor,a=i.precision,l=a+5;if(e===void 0)e=new i(10);else if(e=new i(e),e.s<1||e.eq(Kn))throw Error(wr+"NaN");if(r.s<1)throw Error(wr+(r.s?"NaN":"-Infinity"));return r.eq(Kn)?new i(0):(bt=!1,n=Ui(ac(r,l),ac(e,l),l),bt=!0,ct(n,a))};_e.minus=_e.sub=function(e){var n=this;return e=new n.constructor(e),n.s==e.s?xM(n,e):vM(n,(e.s=-e.s,e))};_e.modulo=_e.mod=function(e){var n,r=this,i=r.constructor,a=i.precision;if(e=new i(e),!e.s)throw Error(wr+"NaN");return r.s?(bt=!1,n=Ui(r,e,0,1).times(e),bt=!0,r.minus(n)):ct(new i(r),a)};_e.naturalExponential=_e.exp=function(){return yM(this)};_e.naturalLogarithm=_e.ln=function(){return ac(this)};_e.negated=_e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_e.plus=_e.add=function(e){var n=this;return e=new n.constructor(e),n.s==e.s?vM(n,e):xM(n,(e.s=-e.s,e))};_e.precision=_e.sd=function(e){var n,r,i,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(jl+e);if(n=Rt(a)+1,i=a.d.length-1,r=i*gt+1,i=a.d[i],i){for(;i%10==0;i/=10)r--;for(i=a.d[0];i>=10;i/=10)r++}return e&&n>r?n:r};_e.squareRoot=_e.sqrt=function(){var e,n,r,i,a,l,s,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(wr+"NaN")}for(e=Rt(c),bt=!1,a=Math.sqrt(+c),a==0||a==1/0?(n=Xr(c.d),(n.length+e)%2==0&&(n+="0"),a=Math.sqrt(n),e=as((e+1)/2)-(e<0||e%2),a==1/0?n="5e"+e:(n=a.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new f(n)):i=new f(a.toString()),r=f.precision,a=s=r+3;;)if(l=i,i=l.plus(Ui(c,l,s+2)).times(.5),Xr(l.d).slice(0,s)===(n=Xr(i.d)).slice(0,s)){if(n=n.slice(s-3,s+1),a==s&&n=="4999"){if(ct(l,r+1,0),l.times(l).eq(c)){i=l;break}}else if(n!="9999")break;s+=4}return bt=!0,ct(i,r)};_e.times=_e.mul=function(e){var n,r,i,a,l,s,c,f,d,m=this,p=m.constructor,y=m.d,x=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,r=m.e+e.e,f=y.length,d=x.length,f<d&&(l=y,y=x,x=l,s=f,f=d,d=s),l=[],s=f+d,i=s;i--;)l.push(0);for(i=d;--i>=0;){for(n=0,a=f+i;a>i;)c=l[a]+x[i]*y[a-i-1]+n,l[a--]=c%Ht|0,n=c/Ht|0;l[a]=(l[a]+n)%Ht|0}for(;!l[--s];)l.pop();return n?++r:l.shift(),e.d=l,e.e=r,bt?ct(e,p.precision):e};_e.toDecimalPlaces=_e.todp=function(e,n){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(li(e,0,is),n===void 0?n=i.rounding:li(n,0,8),ct(r,e+Rt(r)+1,n))};_e.toExponential=function(e,n){var r,i=this,a=i.constructor;return e===void 0?r=Pl(i,!0):(li(e,0,is),n===void 0?n=a.rounding:li(n,0,8),i=ct(new a(i),e+1,n),r=Pl(i,!0,e+1)),r};_e.toFixed=function(e,n){var r,i,a=this,l=a.constructor;return e===void 0?Pl(a):(li(e,0,is),n===void 0?n=l.rounding:li(n,0,8),i=ct(new l(a),e+Rt(a)+1,n),r=Pl(i.abs(),!1,e+Rt(i)+1),a.isneg()&&!a.isZero()?"-"+r:r)};_e.toInteger=_e.toint=function(){var e=this,n=e.constructor;return ct(new n(e),Rt(e)+1,n.rounding)};_e.toNumber=function(){return+this};_e.toPower=_e.pow=function(e){var n,r,i,a,l,s,c=this,f=c.constructor,d=12,m=+(e=new f(e));if(!e.s)return new f(Kn);if(c=new f(c),!c.s){if(e.s<1)throw Error(wr+"Infinity");return c}if(c.eq(Kn))return c;if(i=f.precision,e.eq(Kn))return ct(c,i);if(n=e.e,r=e.d.length-1,s=n>=r,l=c.s,s){if((r=m<0?-m:m)<=gM){for(a=new f(Kn),n=Math.ceil(i/gt+4),bt=!1;r%2&&(a=a.times(c),WC(a.d,n)),r=as(r/2),r!==0;)c=c.times(c),WC(c.d,n);return bt=!0,e.s<0?new f(Kn).div(a):ct(a,i)}}else if(l<0)throw Error(wr+"NaN");return l=l<0&&e.d[Math.max(n,r)]&1?-1:1,c.s=1,bt=!1,a=e.times(ac(c,i+d)),bt=!0,a=yM(a),a.s=l,a};_e.toPrecision=function(e,n){var r,i,a=this,l=a.constructor;return e===void 0?(r=Rt(a),i=Pl(a,r<=l.toExpNeg||r>=l.toExpPos)):(li(e,1,is),n===void 0?n=l.rounding:li(n,0,8),a=ct(new l(a),e,n),r=Rt(a),i=Pl(a,e<=r||r<=l.toExpNeg,e)),i};_e.toSignificantDigits=_e.tosd=function(e,n){var r=this,i=r.constructor;return e===void 0?(e=i.precision,n=i.rounding):(li(e,1,is),n===void 0?n=i.rounding:li(n,0,8)),ct(new i(r),e,n)};_e.toString=_e.valueOf=_e.val=_e.toJSON=_e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,n=Rt(e),r=e.constructor;return Pl(e,n<=r.toExpNeg||n>=r.toExpPos)};function vM(e,n){var r,i,a,l,s,c,f,d,m=e.constructor,p=m.precision;if(!e.s||!n.s)return n.s||(n=new m(e)),bt?ct(n,p):n;if(f=e.d,d=n.d,s=e.e,a=n.e,f=f.slice(),l=s-a,l){for(l<0?(i=f,l=-l,c=d.length):(i=d,a=s,c=f.length),s=Math.ceil(p/gt),c=s>c?s+1:c+1,l>c&&(l=c,i.length=1),i.reverse();l--;)i.push(0);i.reverse()}for(c=f.length,l=d.length,c-l<0&&(l=c,i=d,d=f,f=i),r=0;l;)r=(f[--l]=f[l]+d[l]+r)/Ht|0,f[l]%=Ht;for(r&&(f.unshift(r),++a),c=f.length;f[--c]==0;)f.pop();return n.d=f,n.e=a,bt?ct(n,p):n}function li(e,n,r){if(e!==~~e||e<n||e>r)throw Error(jl+e)}function Xr(e){var n,r,i,a=e.length-1,l="",s=e[0];if(a>0){for(l+=s,n=1;n<a;n++)i=e[n]+"",r=gt-i.length,r&&(l+=Pa(r)),l+=i;s=e[n],i=s+"",r=gt-i.length,r&&(l+=Pa(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return l+s}var Ui=(function(){function e(i,a){var l,s=0,c=i.length;for(i=i.slice();c--;)l=i[c]*a+s,i[c]=l%Ht|0,s=l/Ht|0;return s&&i.unshift(s),i}function n(i,a,l,s){var c,f;if(l!=s)f=l>s?1:-1;else for(c=f=0;c<l;c++)if(i[c]!=a[c]){f=i[c]>a[c]?1:-1;break}return f}function r(i,a,l){for(var s=0;l--;)i[l]-=s,s=i[l]<a[l]?1:0,i[l]=s*Ht+i[l]-a[l];for(;!i[0]&&i.length>1;)i.shift()}return function(i,a,l,s){var c,f,d,m,p,y,x,_,S,k,j,C,N,O,T,A,P,R,z=i.constructor,D=i.s==a.s?1:-1,U=i.d,q=a.d;if(!i.s)return new z(i);if(!a.s)throw Error(wr+"Division by zero");for(f=i.e-a.e,P=q.length,T=U.length,x=new z(D),_=x.d=[],d=0;q[d]==(U[d]||0);)++d;if(q[d]>(U[d]||0)&&--f,l==null?C=l=z.precision:s?C=l+(Rt(i)-Rt(a))+1:C=l,C<0)return new z(0);if(C=C/gt+2|0,d=0,P==1)for(m=0,q=q[0],C++;(d<T||m)&&C--;d++)N=m*Ht+(U[d]||0),_[d]=N/q|0,m=N%q|0;else{for(m=Ht/(q[0]+1)|0,m>1&&(q=e(q,m),U=e(U,m),P=q.length,T=U.length),O=P,S=U.slice(0,P),k=S.length;k<P;)S[k++]=0;R=q.slice(),R.unshift(0),A=q[0],q[1]>=Ht/2&&++A;do m=0,c=n(q,S,P,k),c<0?(j=S[0],P!=k&&(j=j*Ht+(S[1]||0)),m=j/A|0,m>1?(m>=Ht&&(m=Ht-1),p=e(q,m),y=p.length,k=S.length,c=n(p,S,y,k),c==1&&(m--,r(p,P<y?R:q,y))):(m==0&&(c=m=1),p=q.slice()),y=p.length,y<k&&p.unshift(0),r(S,p,k),c==-1&&(k=S.length,c=n(q,S,P,k),c<1&&(m++,r(S,P<k?R:q,k))),k=S.length):c===0&&(m++,S=[0]),_[d++]=m,c&&S[0]?S[k++]=U[O]||0:(S=[U[O]],k=1);while((O++<T||S[0]!==void 0)&&C--)}return _[0]||_.shift(),x.e=f,ct(x,s?l+Rt(x)+1:l)}})();function yM(e,n){var r,i,a,l,s,c,f=0,d=0,m=e.constructor,p=m.precision;if(Rt(e)>16)throw Error(w1+Rt(e));if(!e.s)return new m(Kn);for(bt=!1,c=p,s=new m(.03125);e.abs().gte(.1);)e=e.times(s),d+=5;for(i=Math.log(gl(2,d))/Math.LN10*2+5|0,c+=i,r=a=l=new m(Kn),m.precision=c;;){if(a=ct(a.times(e),c),r=r.times(++f),s=l.plus(Ui(a,r,c)),Xr(s.d).slice(0,c)===Xr(l.d).slice(0,c)){for(;d--;)l=ct(l.times(l),c);return m.precision=p,n==null?(bt=!0,ct(l,p)):l}l=s}}function Rt(e){for(var n=e.e*gt,r=e.d[0];r>=10;r/=10)n++;return n}function uy(e,n,r){if(n>e.LN10.sd())throw bt=!0,r&&(e.precision=r),Error(wr+"LN10 precision limit exceeded");return ct(new e(e.LN10),n)}function Pa(e){for(var n="";e--;)n+="0";return n}function ac(e,n){var r,i,a,l,s,c,f,d,m,p=1,y=10,x=e,_=x.d,S=x.constructor,k=S.precision;if(x.s<1)throw Error(wr+(x.s?"NaN":"-Infinity"));if(x.eq(Kn))return new S(0);if(n==null?(bt=!1,d=k):d=n,x.eq(10))return n==null&&(bt=!0),uy(S,d);if(d+=y,S.precision=d,r=Xr(_),i=r.charAt(0),l=Rt(x),Math.abs(l)<15e14){for(;i<7&&i!=1||i==1&&r.charAt(1)>3;)x=x.times(e),r=Xr(x.d),i=r.charAt(0),p++;l=Rt(x),i>1?(x=new S("0."+r),l++):x=new S(i+"."+r.slice(1))}else return f=uy(S,d+2,k).times(l+""),x=ac(new S(i+"."+r.slice(1)),d-y).plus(f),S.precision=k,n==null?(bt=!0,ct(x,k)):x;for(c=s=x=Ui(x.minus(Kn),x.plus(Kn),d),m=ct(x.times(x),d),a=3;;){if(s=ct(s.times(m),d),f=c.plus(Ui(s,new S(a),d)),Xr(f.d).slice(0,d)===Xr(c.d).slice(0,d))return c=c.times(2),l!==0&&(c=c.plus(uy(S,d+2,k).times(l+""))),c=Ui(c,new S(p),d),S.precision=k,n==null?(bt=!0,ct(c,k)):c;c=f,a+=2}}function YC(e,n){var r,i,a;for((r=n.indexOf("."))>-1&&(n=n.replace(".","")),(i=n.search(/e/i))>0?(r<0&&(r=i),r+=+n.slice(i+1),n=n.substring(0,i)):r<0&&(r=n.length),i=0;n.charCodeAt(i)===48;)++i;for(a=n.length;n.charCodeAt(a-1)===48;)--a;if(n=n.slice(i,a),n){if(a-=i,r=r-i-1,e.e=as(r/gt),e.d=[],i=(r+1)%gt,r<0&&(i+=gt),i<a){for(i&&e.d.push(+n.slice(0,i)),a-=gt;i<a;)e.d.push(+n.slice(i,i+=gt));n=n.slice(i),i=gt-n.length}else i-=a;for(;i--;)n+="0";if(e.d.push(+n),bt&&(e.e>Bh||e.e<-Bh))throw Error(w1+r)}else e.s=0,e.e=0,e.d=[0];return e}function ct(e,n,r){var i,a,l,s,c,f,d,m,p=e.d;for(s=1,l=p[0];l>=10;l/=10)s++;if(i=n-s,i<0)i+=gt,a=n,d=p[m=0];else{if(m=Math.ceil((i+1)/gt),l=p.length,m>=l)return e;for(d=l=p[m],s=1;l>=10;l/=10)s++;i%=gt,a=i-gt+s}if(r!==void 0&&(l=gl(10,s-a-1),c=d/l%10|0,f=n<0||p[m+1]!==void 0||d%l,f=r<4?(c||f)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||f||r==6&&(i>0?a>0?d/gl(10,s-a):0:p[m-1])%10&1||r==(e.s<0?8:7))),n<1||!p[0])return f?(l=Rt(e),p.length=1,n=n-l-1,p[0]=gl(10,(gt-n%gt)%gt),e.e=as(-n/gt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(i==0?(p.length=m,l=1,m--):(p.length=m+1,l=gl(10,gt-i),p[m]=a>0?(d/gl(10,s-a)%gl(10,a)|0)*l:0),f)for(;;)if(m==0){(p[0]+=l)==Ht&&(p[0]=1,++e.e);break}else{if(p[m]+=l,p[m]!=Ht)break;p[m--]=0,l=1}for(i=p.length;p[--i]===0;)p.pop();if(bt&&(e.e>Bh||e.e<-Bh))throw Error(w1+Rt(e));return e}function xM(e,n){var r,i,a,l,s,c,f,d,m,p,y=e.constructor,x=y.precision;if(!e.s||!n.s)return n.s?n.s=-n.s:n=new y(e),bt?ct(n,x):n;if(f=e.d,p=n.d,i=n.e,d=e.e,f=f.slice(),s=d-i,s){for(m=s<0,m?(r=f,s=-s,c=p.length):(r=p,i=d,c=f.length),a=Math.max(Math.ceil(x/gt),c)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.reverse()}else{for(a=f.length,c=p.length,m=a<c,m&&(c=a),a=0;a<c;a++)if(f[a]!=p[a]){m=f[a]<p[a];break}s=0}for(m&&(r=f,f=p,p=r,n.s=-n.s),c=f.length,a=p.length-c;a>0;--a)f[c++]=0;for(a=p.length;a>s;){if(f[--a]<p[a]){for(l=a;l&&f[--l]===0;)f[l]=Ht-1;--f[l],f[a]+=Ht}f[a]-=p[a]}for(;f[--c]===0;)f.pop();for(;f[0]===0;f.shift())--i;return f[0]?(n.d=f,n.e=i,bt?ct(n,x):n):new y(0)}function Pl(e,n,r){var i,a=Rt(e),l=Xr(e.d),s=l.length;return n?(r&&(i=r-s)>0?l=l.charAt(0)+"."+l.slice(1)+Pa(i):s>1&&(l=l.charAt(0)+"."+l.slice(1)),l=l+(a<0?"e":"e+")+a):a<0?(l="0."+Pa(-a-1)+l,r&&(i=r-s)>0&&(l+=Pa(i))):a>=s?(l+=Pa(a+1-s),r&&(i=r-a-1)>0&&(l=l+"."+Pa(i))):((i=a+1)<s&&(l=l.slice(0,i)+"."+l.slice(i)),r&&(i=r-s)>0&&(a+1===s&&(l+="."),l+=Pa(i))),e.s<0?"-"+l:l}function WC(e,n){if(e.length>n)return e.length=n,!0}function bM(e){var n,r,i;function a(l){var s=this;if(!(s instanceof a))return new a(l);if(s.constructor=a,l instanceof a){s.s=l.s,s.e=l.e,s.d=(l=l.d)?l.slice():l;return}if(typeof l=="number"){if(l*0!==0)throw Error(jl+l);if(l>0)s.s=1;else if(l<0)l=-l,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(l===~~l&&l<1e7){s.e=0,s.d=[l];return}return YC(s,l.toString())}else if(typeof l!="string")throw Error(jl+l);if(l.charCodeAt(0)===45?(l=l.slice(1),s.s=-1):s.s=1,ZJ.test(l))YC(s,l);else throw Error(jl+l)}if(a.prototype=_e,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=bM,a.config=a.set=QJ,e===void 0&&(e={}),e)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n<i.length;)e.hasOwnProperty(r=i[n++])||(e[r]=this[r]);return a.config(e),a}function QJ(e){if(!e||typeof e!="object")throw Error(wr+"Object expected");var n,r,i,a=["precision",1,is,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(n=0;n<a.length;n+=3)if((i=e[r=a[n]])!==void 0)if(as(i)===i&&i>=a[n+1]&&i<=a[n+2])this[r]=i;else throw Error(jl+r+": "+i);if((i=e[r="LN10"])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(jl+r+": "+i);return this}var _1=bM(XJ);Kn=new _1(1);const Ve=_1;function wM(e){var n;return e===0?n=1:n=Math.floor(new Ve(e).abs().log(10).toNumber())+1,n}function _M(e,n,r){for(var i=new Ve(e),a=0,l=[];i.lt(n)&&a<1e5;)l.push(i.toNumber()),i=i.add(r),a++;return l}var kM=e=>{var[n,r]=e,[i,a]=[n,r];return n>r&&([i,a]=[r,n]),[i,a]},k1=(e,n,r)=>{if(e.lte(0))return new Ve(0);var i=wM(e.toNumber()),a=new Ve(10).pow(i),l=e.div(a),s=i!==1?.05:.1,c=new Ve(Math.ceil(l.div(s).toNumber())).add(r).mul(s),f=c.mul(a);return n?new Ve(f.toNumber()):new Ve(Math.ceil(f.toNumber()))},SM=(e,n,r)=>{var i;if(e.lte(0))return new Ve(0);var a=[1,2,2.5,5],l=e.toNumber(),s=Math.floor(new Ve(l).abs().log(10).toNumber()),c=new Ve(10).pow(s),f=e.div(c).toNumber(),d=a.findIndex(x=>x>=f-1e-10);if(d===-1&&(c=c.mul(10),d=0),d+=r,d>=a.length){var m=Math.floor(d/a.length);d%=a.length,c=c.mul(new Ve(10).pow(m))}var p=(i=a[d])!==null&&i!==void 0?i:1,y=new Ve(p).mul(c);return n?y:new Ve(Math.ceil(y.toNumber()))},JJ=(e,n,r)=>{var i=new Ve(1),a=new Ve(e);if(!a.isint()&&r){var l=Math.abs(e);l<1?(i=new Ve(10).pow(wM(e)-1),a=new Ve(Math.floor(a.div(i).toNumber())).mul(i)):l>1&&(a=new Ve(Math.floor(e)))}else e===0?a=new Ve(Math.floor((n-1)/2)):r||(a=new Ve(Math.floor(e)));for(var s=Math.floor((n-1)/2),c=[],f=0;f<n;f++)c.push(a.add(new Ve(f-s).mul(i)).toNumber());return c},jM=function(n,r,i,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:k1;if(!Number.isFinite((r-n)/(i-1)))return{step:new Ve(0),tickMin:new Ve(0),tickMax:new Ve(0)};var c=s(new Ve(r).sub(n).div(i-1),a,l),f;n<=0&&r>=0?f=new Ve(0):(f=new Ve(n).add(r).div(2),f=f.sub(new Ve(f).mod(c)));var d=Math.ceil(f.sub(n).div(c).toNumber()),m=Math.ceil(new Ve(r).sub(f).div(c).toNumber()),p=d+m+1;return p>i?jM(n,r,i,a,l+1,s):(p<i&&(m=r>0?m+(i-p):m,d=r>0?d:d+(i-p)),{step:c,tickMin:f.sub(new Ve(d).mul(c)),tickMax:f.add(new Ve(m).mul(c))})},XC=function(n){var[r,i]=n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),[f,d]=kM([r,i]);if(f===-1/0||d===1/0){var m=d===1/0?[f,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),d];return r>i?m.reverse():m}if(f===d)return JJ(f,a,l);var p=s==="snap125"?SM:k1,{step:y,tickMin:x,tickMax:_}=jM(f,d,c,l,0,p),S=_M(x,_.add(new Ve(.1).mul(y)),y);return r>i?S.reverse():S},ZC=function(n,r){var[i,a]=n,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,f]=kM([i,a]);if(c===-1/0||f===1/0)return[i,a];if(c===f)return[c];var d=s==="snap125"?SM:k1,m=Math.max(r,2),p=d(new Ve(f).sub(c).div(m-1),l,0),y=[..._M(new Ve(c),new Ve(f),p),f];return l===!1&&(y=y.map(x=>Math.round(x))),i>a?y.reverse():y},eee=e=>e.rootProps.barCategoryGap,Hm=e=>e.rootProps.stackOffset,EM=e=>e.rootProps.reverseStackOrder,S1=e=>e.options.chartName,j1=e=>e.rootProps.syncId,CM=e=>e.rootProps.syncMethod,E1=e=>e.options.eventEmitter,fn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},ul={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ur={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Gm=(e,n)=>{if(!(!e||!n))return e!=null&&e.reversed?[n[1],n[0]]:n};function Km(e,n,r){if(r!=="auto")return r;if(e!=null)return ea(e,n)?"category":"number"}function QC(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Fh(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?QC(Object(r),!0).forEach(function(i){tee(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QC(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function tee(e,n,r){return(n=nee(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function nee(e){var n=ree(e,"string");return typeof n=="symbol"?n:n+""}function ree(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var JC={allowDataOverflow:ul.allowDataOverflow,allowDecimals:ul.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:ul.angleAxisId,includeHidden:!1,name:void 0,reversed:ul.reversed,scale:ul.scale,tick:ul.tick,tickCount:void 0,ticks:void 0,type:ul.type,unit:void 0,niceTicks:"auto"},eN={allowDataOverflow:Ur.allowDataOverflow,allowDecimals:Ur.allowDecimals,allowDuplicatedCategory:Ur.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ur.radiusAxisId,includeHidden:Ur.includeHidden,name:void 0,reversed:Ur.reversed,scale:Ur.scale,tick:Ur.tick,tickCount:Ur.tickCount,ticks:void 0,type:Ur.type,unit:void 0,niceTicks:"auto"},iee=(e,n)=>{if(n!=null)return e.polarAxis.angleAxis[n]},C1=le([iee,WT],(e,n)=>{var r;if(e!=null)return e;var i=(r=Km(n,"angleAxis",JC.type))!==null&&r!==void 0?r:"category";return Fh(Fh({},JC),{},{type:i})}),aee=(e,n)=>e.polarAxis.radiusAxis[n],N1=le([aee,WT],(e,n)=>{var r;if(e!=null)return e;var i=(r=Km(n,"radiusAxis",eN.type))!==null&&r!==void 0?r:"category";return Fh(Fh({},eN),{},{type:i})}),Vm=e=>e.polarOptions,O1=le([ta,na,ln],PJ),NM=le([Vm,O1],(e,n)=>{if(e!=null)return $a(e.innerRadius,n,0)}),OM=le([Vm,O1],(e,n)=>{if(e!=null)return $a(e.outerRadius,n,n*.8)}),lee=e=>{if(e==null)return[0,0];var{startAngle:n,endAngle:r}=e;return[n,r]},AM=le([Vm],lee);le([C1,AM],Gm);var TM=le([O1,NM,OM],(e,n,r)=>{if(!(e==null||n==null||r==null))return[n,r]});le([N1,TM],Gm);var MM=le([_t,Vm,NM,OM,ta,na],(e,n,r,i,a,l)=>{if(!(e!=="centric"&&e!=="radial"||n==null||r==null||i==null)){var{cx:s,cy:c,startAngle:f,endAngle:d}=n;return{cx:$a(s,a,a/2),cy:$a(c,l,l/2),innerRadius:r,outerRadius:i,startAngle:f,endAngle:d,clockWise:!1}}}),Vt=(e,n)=>n,Ym=(e,n,r)=>r;function PM(e){return e==null?void 0:e.id}function DM(e,n,r){var{chartData:i=[]}=n,{allowDuplicatedCategory:a,dataKey:l}=r,s=new Map;return e.forEach(c=>{var f,d=(f=c.data)!==null&&f!==void 0?f:i;if(!(d==null||d.length===0)){var m=PM(c);d.forEach((p,y)=>{var x=l==null||a?y:String(rn(p,l,null)),_=rn(p,c.dataKey,0),S;s.has(x)?S=s.get(x):S={},Object.assign(S,{[m]:_}),s.set(x,S)})}}),Array.from(s.values())}function A1(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Wm=(e,n)=>e===n?!0:e==null||n==null?!1:e[0]===n[0]&&e[1]===n[1];function Xm(e,n){return Array.isArray(e)&&Array.isArray(n)&&e.length===0&&n.length===0?!0:e===n}function oee(e,n){if(e.length===n.length){for(var r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}return!1}var Yt=e=>{var n=_t(e);return n==="horizontal"?"xAxis":n==="vertical"?"yAxis":n==="centric"?"angleAxis":"radiusAxis"},ls=e=>e.tooltip.settings.axisId;function T1(e){if(e!=null){var n=e.ticks,r=e.bandwidth,i=e.range(),a=[Math.min(...i),Math.max(...i)];return{domain:()=>e.domain(),range:(function(l){function s(){return l.apply(this,arguments)}return s.toString=function(){return l.toString()},s})(()=>a),rangeMin:()=>a[0],rangeMax:()=>a[1],isInRange(l){var s=a[0],c=a[1];return s<=c?l>=s&&l<=c:l>=c&&l<=s},bandwidth:r?()=>r.call(e):void 0,ticks:n?l=>n.call(e,l):void 0,map:(l,s)=>{var c=e(l);if(c!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var f=e.bandwidth();switch(s.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var see=(e,n)=>{if(n!=null)switch(e){case"linear":{if(!ei(n)){for(var r,i,a=0;a<n.length;a++){var l=n[a];Fe(l)&&((r===void 0||l<r)&&(r=l),(i===void 0||l>i)&&(i=l))}return r!==void 0&&i!==void 0?[r,i]:void 0}return n}default:return n}};const Ru=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Cb,scaleDiverging:n3,scaleDivergingLog:r3,scaleDivergingPow:Hb,scaleDivergingSqrt:iK,scaleDivergingSymlog:i3,scaleIdentity:L4,scaleImplicit:Qy,scaleLinear:R4,scaleLog:I4,scaleOrdinal:dm,scalePoint:pH,scalePow:Db,scaleQuantile:F4,scaleQuantize:U4,scaleRadial:B4,scaleSequential:Q4,scaleSequentialLog:J4,scaleSequentialPow:qb,scaleSequentialQuantile:t3,scaleSequentialSqrt:rK,scaleSequentialSymlog:e3,scaleSqrt:IH,scaleSymlog:$4,scaleThreshold:q4,scaleTime:tK,scaleUtc:nK,tickFormat:D4},Symbol.toStringTag,{value:"Module"}));function uee(e){if(e in Ru)return Ru[e]();var n="scale".concat(Sc(e));if(n in Ru)return Ru[n]()}function tN(e,n,r){if(typeof e=="function")return e.copy().domain(n).range(r);if(e!=null){var i=uee(e);if(i!=null)return i.domain(n).range(r),i}}function M1(e,n,r,i){if(!(r==null||i==null))return typeof e.scale=="function"?tN(e.scale,r,i):tN(n,r,i)}function cee(e){return"scale".concat(Sc(e))}function fee(e){return cee(e)in Ru}var RM=(e,n,r)=>{if(e!=null){var{scale:i,type:a}=e;if(i==="auto")return a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?"point":a==="category"?"band":"linear";if(typeof i=="string")return fee(i)?i:"point"}};function dee(e,n){for(var r=0,i=e.length,a=e[0]<e[e.length-1];r<i;){var l=Math.floor((r+i)/2);(a?e[l]<n:e[l]>n)?r=l+1:i=l}return r}function LM(e,n){if(e){var r=n??e.domain(),i=r.map(l=>{var s;return(s=e(l))!==null&&s!==void 0?s:0}),a=e.range();if(!(r.length===0||a.length<2))return l=>{var s,c,f=dee(i,l);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var d=(s=i[f-1])!==null&&s!==void 0?s:0,m=(c=i[f])!==null&&c!==void 0?c:0;return Math.abs(l-d)<=Math.abs(l-m)?r[f-1]:r[f]}}}function hee(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):LM(e,void 0)}function nN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Uh(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?nN(Object(r),!0).forEach(function(i){mee(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function mee(e,n,r){return(n=pee(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function pee(e){var n=gee(e,"string");return typeof n=="symbol"?n:n+""}function gee(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var Dx=[0,"auto"],zt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},zM=(e,n)=>e.cartesianAxis.xAxis[n],ui=(e,n)=>{var r=zM(e,n);return r??zt},It={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Dx,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Cc},IM=(e,n)=>e.cartesianAxis.yAxis[n],ci=(e,n)=>{var r=IM(e,n);return r??It},vee={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},P1=(e,n)=>{var r=e.cartesianAxis.zAxis[n];return r??vee},_n=(e,n,r)=>{switch(n){case"xAxis":return ui(e,r);case"yAxis":return ci(e,r);case"zAxis":return P1(e,r);case"angleAxis":return C1(e,r);case"radiusAxis":return N1(e,r);default:throw new Error("Unexpected axis type: ".concat(n))}},yee=(e,n,r)=>{switch(n){case"xAxis":return ui(e,r);case"yAxis":return ci(e,r);default:throw new Error("Unexpected axis type: ".concat(n))}},Mc=(e,n,r)=>{switch(n){case"xAxis":return ui(e,r);case"yAxis":return ci(e,r);case"angleAxis":return C1(e,r);case"radiusAxis":return N1(e,r);default:throw new Error("Unexpected axis type: ".concat(n))}},$M=e=>e.graphicalItems.cartesianItems.some(n=>n.type==="bar")||e.graphicalItems.polarItems.some(n=>n.type==="radialBar");function BM(e,n){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===n;case"yAxis":return"yAxisId"in r&&r.yAxisId===n;case"zAxis":return"zAxisId"in r&&r.zAxisId===n;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===n;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===n;default:return!1}}}var FM=e=>e.graphicalItems.cartesianItems,xee=le([Vt,Ym],BM),UM=(e,n,r)=>e.filter(r).filter(i=>(n==null?void 0:n.includeHidden)===!0?!0:!i.hide),Pc=le([FM,_n,xee],UM,{memoizeOptions:{resultEqualityCheck:Xm}}),qM=le([Pc],e=>e.filter(n=>n.type==="area"||n.type==="bar").filter(A1)),HM=e=>e.filter(n=>!("stackId"in n)||n.stackId===void 0),bee=le([Pc],HM),GM=e=>e.map(n=>n.data).filter(Boolean).flat(1),wee=le([Pc],GM,{memoizeOptions:{resultEqualityCheck:Xm}}),KM=(e,n)=>{var{chartData:r=[],dataStartIndex:i,dataEndIndex:a}=n;return e.length>0?e:r.slice(i,a+1)},D1=le([wee,b1],KM),VM=(e,n,r)=>(n==null?void 0:n.dataKey)!=null?e.map(i=>({value:rn(i,n.dataKey)})):r.length>0?r.map(i=>i.dataKey).flatMap(i=>e.map(a=>({value:rn(a,i)}))):e.map(i=>({value:i})),Dc=le([D1,_n,Pc],VM);function Fo(e){if(br(e)||e instanceof Date){var n=Number(e);if(Fe(n))return n}}function rN(e){if(Array.isArray(e)){var n=[Fo(e[0]),Fo(e[1])];return ei(n)?n:void 0}var r=Fo(e);if(r!=null)return[r,r]}function Zi(e){return e.map(Fo).filter(Mn)}function _ee(e,n){var r=Fo(e),i=Fo(n);return r==null&&i==null?0:r==null?-1:i==null?1:r-i}var kee=le([Dc],e=>e==null?void 0:e.map(n=>n.value).sort(_ee));function YM(e,n){switch(e){case"xAxis":return n.direction==="x";case"yAxis":return n.direction==="y";default:return!1}}function See(e,n,r){return!r||typeof n!="number"||Wi(n)?[]:r.length?Zi(r.flatMap(i=>{var a=rn(e,i.dataKey),l,s;if(Array.isArray(a)?[l,s]=a:l=s=a,!(!Fe(l)||!Fe(s)))return[n-l,n+s]})):[]}var Ft=e=>{var n=Yt(e),r=ls(e);return Mc(e,n,r)},Rc=le([Ft],e=>e==null?void 0:e.dataKey),jee=le([qM,b1,Ft],DM),WM=(e,n,r,i)=>{var a={},l=n.reduce((s,c)=>{if(c.stackId==null)return s;var f=s[c.stackId];return f==null&&(f=[]),f.push(c),s[c.stackId]=f,s},a);return Object.fromEntries(Object.entries(l).map(s=>{var[c,f]=s,d=i?[...f].reverse():f,m=d.map(PM);return[c,{stackedData:rZ(e,m,r),graphicalItems:d}]}))},Eee=le([jee,qM,Hm,EM],WM),XM=(e,n,r,i)=>{var{dataStartIndex:a,dataEndIndex:l}=n;if(i==null&&r!=="zAxis"){var s=lZ(e,a,l);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},Cee=le([_n],e=>e.allowDataOverflow),R1=e=>{var n;if(e==null||!("domain"in e))return Dx;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Zi(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(n=e==null?void 0:e.domain)!==null&&n!==void 0?n:Dx},ZM=le([_n],R1),QM=le([ZM,Cee],pM),Nee=le([Eee,qa,Vt,QM],XM,{memoizeOptions:{resultEqualityCheck:Wm}}),L1=e=>e.errorBars,Oee=(e,n,r)=>e.flatMap(i=>n[i.id]).filter(Boolean).filter(i=>YM(r,i)),qh=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r.filter(Boolean);if(a.length!==0){var l=a.flat(),s=Math.min(...l),c=Math.max(...l);return[s,c]}},JM=(e,n,r,i,a)=>{var l,s;if(r.length>0&&e.forEach(c=>{r.forEach(f=>{var d,m,p=(d=i[f.id])===null||d===void 0?void 0:d.filter(j=>YM(a,j)),y=rn(c,(m=n.dataKey)!==null&&m!==void 0?m:f.dataKey),x=See(c,y,p);if(x.length>=2){var _=Math.min(...x),S=Math.max(...x);(l==null||_<l)&&(l=_),(s==null||S>s)&&(s=S)}var k=rN(y);k!=null&&(l=l==null?k[0]:Math.min(l,k[0]),s=s==null?k[1]:Math.max(s,k[1]))})}),(n==null?void 0:n.dataKey)!=null&&e.forEach(c=>{var f=rN(rn(c,n.dataKey));f!=null&&(l=l==null?f[0]:Math.min(l,f[0]),s=s==null?f[1]:Math.max(s,f[1]))}),Fe(l)&&Fe(s))return[l,s]},Aee=le([D1,_n,bee,L1,Vt],JM,{memoizeOptions:{resultEqualityCheck:Wm}});function Tee(e){var{value:n}=e;if(br(n)||n instanceof Date)return n}var Mee=(e,n,r)=>{var i=e.map(Tee).filter(a=>a!=null);return r&&(n.dataKey==null||n.allowDuplicatedCategory&&q3(i))?mM(0,e.length):n.allowDuplicatedCategory?i:Array.from(new Set(i))},eP=e=>e.referenceElements.dots,os=(e,n,r)=>e.filter(i=>i.ifOverflow==="extendDomain").filter(i=>n==="xAxis"?i.xAxisId===r:i.yAxisId===r),Pee=le([eP,Vt,Ym],os),tP=e=>e.referenceElements.areas,Dee=le([tP,Vt,Ym],os),nP=e=>e.referenceElements.lines,Ree=le([nP,Vt,Ym],os),rP=(e,n)=>{if(e!=null){var r=Zi(e.map(i=>n==="xAxis"?i.x:i.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Lee=le(Pee,Vt,rP),iP=(e,n)=>{if(e!=null){var r=Zi(e.flatMap(i=>[n==="xAxis"?i.x1:i.y1,n==="xAxis"?i.x2:i.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},zee=le([Dee,Vt],iP);function Iee(e){var n;if(e.x!=null)return Zi([e.x]);var r=(n=e.segment)===null||n===void 0?void 0:n.map(i=>i.x);return r==null||r.length===0?[]:Zi(r)}function $ee(e){var n;if(e.y!=null)return Zi([e.y]);var r=(n=e.segment)===null||n===void 0?void 0:n.map(i=>i.y);return r==null||r.length===0?[]:Zi(r)}var aP=(e,n)=>{if(e!=null){var r=e.flatMap(i=>n==="xAxis"?Iee(i):$ee(i));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Bee=le([Ree,Vt],aP),Fee=le(Lee,Bee,zee,(e,n,r)=>qh(e,r,n)),lP=(e,n,r,i,a,l,s,c)=>{if(r!=null)return r;var f=s==="vertical"&&c==="xAxis"||s==="horizontal"&&c==="yAxis",d=f?qh(i,l,a):qh(l,a);return WJ(n,d,e.allowDataOverflow)},Uee=le([_n,ZM,QM,Nee,Aee,Fee,_t,Vt],lP,{memoizeOptions:{resultEqualityCheck:Wm}}),qee=[0,1],oP=(e,n,r,i,a,l,s)=>{if(!((e==null||r==null||r.length===0)&&s===void 0)){var{dataKey:c,type:f}=e,d=ea(n,l);if(d&&c==null){var m;return mM(0,(m=r==null?void 0:r.length)!==null&&m!==void 0?m:0)}return f==="category"?Mee(i,e,d):a==="expand"?qee:s}},z1=le([_n,_t,D1,Dc,Hm,Vt,Uee],oP),ss=le([_n,$M,S1],RM),sP=(e,n,r)=>{var{niceTicks:i}=n;if(i!=="none"){var a=R1(n),l=Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto");if((i==="snap125"||i==="adaptive")&&n!=null&&n.tickCount&&ei(e)){if(l)return XC(e,n.tickCount,n.allowDecimals,i);if(n.type==="number")return ZC(e,n.tickCount,n.allowDecimals,i)}if(i==="auto"&&r==="linear"&&n!=null&&n.tickCount){if(l&&ei(e))return XC(e,n.tickCount,n.allowDecimals,"adaptive");if(n.type==="number"&&ei(e))return ZC(e,n.tickCount,n.allowDecimals,"adaptive")}}},I1=le([z1,Mc,ss],sP),uP=(e,n,r,i)=>{if(i!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ei(n)&&Array.isArray(r)&&r.length>0){var a,l,s=n[0],c=(a=r[0])!==null&&a!==void 0?a:0,f=n[1],d=(l=r[r.length-1])!==null&&l!==void 0?l:0;return[Math.min(s,c),Math.max(f,d)]}return n},Hee=le([_n,z1,I1,Vt],uP),Gee=le(Dc,_n,(e,n)=>{if(!(!n||n.type!=="number")){var r=1/0,i=Array.from(Zi(e.map(p=>p.value))).sort((p,y)=>p-y),a=i[0],l=i[i.length-1];if(a==null||l==null)return 1/0;var s=l-a;if(s===0)return 1/0;for(var c=0;c<i.length-1;c++){var f=i[c],d=i[c+1];if(!(f==null||d==null)){var m=d-f;r=Math.min(r,m)}}return r/s}}),cP=le(Gee,_t,eee,ln,(e,n,r,i,a)=>a,(e,n,r,i,a)=>{if(!Fe(e))return 0;var l=n==="vertical"?i.height:i.width;if(a==="gap")return e*l/2;if(a==="no-gap"){var s=$a(r,e*l),c=e*l/2;return c-s-(c-s)/l*s}return 0}),Kee=(e,n,r)=>{var i=ui(e,n);return i==null||typeof i.padding!="string"?0:cP(e,"xAxis",n,r,i.padding)},Vee=(e,n,r)=>{var i=ci(e,n);return i==null||typeof i.padding!="string"?0:cP(e,"yAxis",n,r,i.padding)},Yee=le(ui,Kee,(e,n)=>{var r,i;if(e==null)return{left:0,right:0};var{padding:a}=e;return typeof a=="string"?{left:n,right:n}:{left:((r=a.left)!==null&&r!==void 0?r:0)+n,right:((i=a.right)!==null&&i!==void 0?i:0)+n}}),Wee=le(ci,Vee,(e,n)=>{var r,i;if(e==null)return{top:0,bottom:0};var{padding:a}=e;return typeof a=="string"?{top:n,bottom:n}:{top:((r=a.top)!==null&&r!==void 0?r:0)+n,bottom:((i=a.bottom)!==null&&i!==void 0?i:0)+n}}),Xee=le([ln,Yee,$m,Im,(e,n,r)=>r],(e,n,r,i,a)=>{var{padding:l}=i;return a?[l.left,r.width-l.right]:[e.left+n.left,e.left+e.width-n.right]}),Zee=le([ln,_t,Wee,$m,Im,(e,n,r)=>r],(e,n,r,i,a,l)=>{var{padding:s}=a;return l?[i.height-s.bottom,s.top]:n==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Lc=(e,n,r,i)=>{var a;switch(n){case"xAxis":return Xee(e,r,i);case"yAxis":return Zee(e,r,i);case"zAxis":return(a=P1(e,r))===null||a===void 0?void 0:a.range;case"angleAxis":return AM(e);case"radiusAxis":return TM(e,r);default:return}},fP=le([_n,Lc],Gm),Qee=le([ss,Hee],see),$1=le([_n,ss,Qee,fP],M1),dP=(e,n,r,i)=>{if(!(r==null||r.dataKey==null)){var{type:a,scale:l}=r,s=ea(e,i);if(s&&(a==="number"||l!=="auto"))return n.map(c=>c.value)}},B1=le([_t,Dc,Mc,Vt],dP),Xo=le([$1],T1);le([$1],hee);le([$1,kee],LM);le([Pc,L1,Vt],Oee);function hP(e,n){return e.id<n.id?-1:e.id>n.id?1:0}var Zm=(e,n)=>n,Qm=(e,n,r)=>r,Jee=le(Lm,Zm,Qm,(e,n,r)=>e.filter(i=>i.orientation===n).filter(i=>i.mirror===r).sort(hP)),ete=le(zm,Zm,Qm,(e,n,r)=>e.filter(i=>i.orientation===n).filter(i=>i.mirror===r).sort(hP)),mP=(e,n)=>({width:e.width,height:n.height}),tte=(e,n)=>{var r=typeof n.width=="number"?n.width:Cc;return{width:r,height:e.height}},nte=le(ln,ui,mP),rte=(e,n,r)=>{switch(n){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},ite=(e,n,r)=>{switch(n){case"left":return e.left;case"right":return r-e.right;default:return 0}},ate=le(na,ln,Jee,Zm,Qm,(e,n,r,i,a)=>{var l={},s;return r.forEach(c=>{var f=mP(n,c);s==null&&(s=rte(n,i,e));var d=i==="top"&&!a||i==="bottom"&&a;l[c.id]=s-Number(d)*f.height,s+=(d?-1:1)*f.height}),l}),lte=le(ta,ln,ete,Zm,Qm,(e,n,r,i,a)=>{var l={},s;return r.forEach(c=>{var f=tte(n,c);s==null&&(s=ite(n,i,e));var d=i==="left"&&!a||i==="right"&&a;l[c.id]=s-Number(d)*f.width,s+=(d?-1:1)*f.width}),l}),ote=(e,n)=>{var r=ui(e,n);if(r!=null)return ate(e,r.orientation,r.mirror)},ste=le([ln,ui,ote,(e,n)=>n],(e,n,r,i)=>{if(n!=null){var a=r==null?void 0:r[i];return a==null?{x:e.left,y:0}:{x:e.left,y:a}}}),ute=(e,n)=>{var r=ci(e,n);if(r!=null)return lte(e,r.orientation,r.mirror)},cte=le([ln,ci,ute,(e,n)=>n],(e,n,r,i)=>{if(n!=null){var a=r==null?void 0:r[i];return a==null?{x:0,y:e.top}:{x:a,y:e.top}}}),fte=le(ln,ci,(e,n)=>{var r=typeof n.width=="number"?n.width:Cc;return{width:r,height:e.height}}),pP=(e,n,r,i)=>{if(r!=null){var{allowDuplicatedCategory:a,type:l,dataKey:s}=r,c=ea(e,i),f=n.map(d=>d.value);if(s&&c&&l==="category"&&a&&q3(f))return f}},F1=le([_t,Dc,_n,Vt],pP),iN=le([_t,yee,ss,Xo,F1,B1,Lc,I1,Vt],(e,n,r,i,a,l,s,c,f)=>{if(n!=null){var d=ea(e,f);return{angle:n.angle,interval:n.interval,minTickGap:n.minTickGap,orientation:n.orientation,tick:n.tick,tickCount:n.tickCount,tickFormatter:n.tickFormatter,ticks:n.ticks,type:n.type,unit:n.unit,axisType:f,categoricalDomain:l,duplicateDomain:a,isCategorical:d,niceTicks:c,range:s,realScaleType:r,scale:i}}}),dte=(e,n,r,i,a,l,s,c,f)=>{if(!(n==null||i==null)){var d=ea(e,f),{type:m,ticks:p,tickCount:y}=n,x=r==="scaleBand"&&typeof i.bandwidth=="function"?i.bandwidth()/2:2,_=m==="category"&&i.bandwidth?i.bandwidth()/x:0;_=f==="angleAxis"&&l!=null&&l.length>=2?yr(l[0]-l[1])*2*_:_;var S=p||a;return S?S.map((k,j)=>{var C=s?s.indexOf(k):k,N=i.map(C);return Fe(N)?{index:j,coordinate:N+_,value:k,offset:_}:null}).filter(Mn):d&&c?c.map((k,j)=>{var C=i.map(k);return Fe(C)?{coordinate:C+_,value:k,index:j,offset:_}:null}).filter(Mn):i.ticks?i.ticks(y).map((k,j)=>{var C=i.map(k);return Fe(C)?{coordinate:C+_,value:k,index:j,offset:_}:null}).filter(Mn):i.domain().map((k,j)=>{var C=i.map(k);return Fe(C)?{coordinate:C+_,value:s?s[k]:k,index:j,offset:_}:null}).filter(Mn)}},gP=le([_t,Mc,ss,Xo,I1,Lc,F1,B1,Vt],dte),hte=(e,n,r,i,a,l,s)=>{if(!(n==null||r==null||i==null||i[0]===i[1])){var c=ea(e,s),{tickCount:f}=n,d=0;return d=s==="angleAxis"&&(i==null?void 0:i.length)>=2?yr(i[0]-i[1])*2*d:d,c&&l?l.map((m,p)=>{var y=r.map(m);return Fe(y)?{coordinate:y+d,value:m,index:p,offset:d}:null}).filter(Mn):r.ticks?r.ticks(f).map((m,p)=>{var y=r.map(m);return Fe(y)?{coordinate:y+d,value:m,index:p,offset:d}:null}).filter(Mn):r.domain().map((m,p)=>{var y=r.map(m);return Fe(y)?{coordinate:y+d,value:a?a[m]:m,index:p,offset:d}:null}).filter(Mn)}},vP=le([_t,Mc,Xo,Lc,F1,B1,Vt],hte),yP=le(_n,Xo,(e,n)=>{if(!(e==null||n==null))return Uh(Uh({},e),{},{scale:n})}),mte=le([_n,ss,z1,fP],M1),pte=le([mte],T1);le((e,n,r)=>P1(e,r),pte,(e,n)=>{if(!(e==null||n==null))return Uh(Uh({},e),{},{scale:n})});var gte=le([_t,Lm,zm],(e,n,r)=>{switch(e){case"horizontal":return n.some(i=>i.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(i=>i.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),vte=(e,n,r)=>{var i;return(i=e.renderedTicks[n])===null||i===void 0?void 0:i[r]};le([vte],e=>{if(!(!e||e.length===0))return n=>{var r,i=1/0,a=e[0];for(var l of e){var s=Math.abs(l.coordinate-n);s<i&&(i=s,a=l)}return(r=a)===null||r===void 0?void 0:r.value}});var xP=e=>e.options.defaultTooltipEventType,bP=e=>e.options.validateTooltipEventTypes;function wP(e,n,r){if(e==null)return n;var i=e?"axis":"item";return r==null?n:r.includes(i)?i:n}function U1(e,n){var r=xP(e),i=bP(e);return wP(n,r,i)}function yte(e){return Ne(n=>U1(n,e))}var _P=(e,n)=>{var r,i=Number(n);if(!(Wi(i)||n==null))return i>=0?e==null||(r=e[i])===null||r===void 0?void 0:r.value:void 0},xte=e=>e.tooltip.settings,Ra={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},bte={itemInteraction:{click:Ra,hover:Ra},axisInteraction:{click:Ra,hover:Ra},keyboardInteraction:Ra,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},kP=hn({name:"tooltip",initialState:bte,reducers:{addTooltipEntrySettings:{reducer(e,n){e.tooltipItemPayloads.push(n.payload)},prepare:pt()},replaceTooltipEntrySettings:{reducer(e,n){var{prev:r,next:i}=n.payload,a=xr(e).tooltipItemPayloads.indexOf(r);a>-1&&(e.tooltipItemPayloads[a]=i)},prepare:pt()},removeTooltipEntrySettings:{reducer(e,n){var r=xr(e).tooltipItemPayloads.indexOf(n.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:pt()},setTooltipSettingsState(e,n){e.settings=n.payload},setActiveMouseOverItemIndex(e,n){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=n.payload.activeIndex,e.itemInteraction.hover.dataKey=n.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=n.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=n.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,n){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=n.payload.activeIndex,e.itemInteraction.click.dataKey=n.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=n.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=n.payload.activeCoordinate},setMouseOverAxisIndex(e,n){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=n.payload.activeIndex,e.axisInteraction.hover.dataKey=n.payload.activeDataKey,e.axisInteraction.hover.coordinate=n.payload.activeCoordinate},setMouseClickAxisIndex(e,n){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=n.payload.activeIndex,e.axisInteraction.click.dataKey=n.payload.activeDataKey,e.axisInteraction.click.coordinate=n.payload.activeCoordinate},setSyncInteraction(e,n){e.syncInteraction=n.payload},setKeyboardInteraction(e,n){e.keyboardInteraction.active=n.payload.active,e.keyboardInteraction.index=n.payload.activeIndex,e.keyboardInteraction.coordinate=n.payload.activeCoordinate}}}),{addTooltipEntrySettings:wte,replaceTooltipEntrySettings:_te,removeTooltipEntrySettings:kte,setTooltipSettingsState:Ste,setActiveMouseOverItemIndex:jte,mouseLeaveItem:Fde,mouseLeaveChart:SP,setActiveClickItemIndex:Ude,setMouseOverAxisIndex:jP,setMouseClickAxisIndex:Ete,setSyncInteraction:Rx,setKeyboardInteraction:Hh}=kP.actions,Cte=kP.reducer;function aN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Ed(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?aN(Object(r),!0).forEach(function(i){Nte(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Nte(e,n,r){return(n=Ote(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Ote(e){var n=Ate(e,"string");return typeof n=="symbol"?n:n+""}function Ate(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Tte(e,n,r){return n==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Mte(e){return e.index!=null}var EP=(e,n,r,i)=>{if(n==null)return Ra;var a=Tte(e,n,r);if(a==null)return Ra;if(a.active)return a;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var l=e.settings.active===!0;if(Mte(a)){if(l)return Ed(Ed({},a),{},{active:!0})}else if(i!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:i,graphicalItemId:void 0};return Ed(Ed({},Ra),{},{coordinate:a.coordinate})};function Pte(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var n=e.valueOf();return Number.isFinite(n)?n:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function Dte(e,n){var r=Pte(e),i=n[0],a=n[1];if(r===void 0)return!1;var l=Math.min(i,a),s=Math.max(i,a);return r>=l&&r<=s}function Rte(e,n,r){if(r==null||n==null)return!0;var i=rn(e,n);return i==null||!ei(r)?!0:Dte(i,r)}var q1=(e,n,r,i)=>{var a=e==null?void 0:e.index;if(a==null)return null;var l=Number(a);if(!Fe(l))return a;var s=0,c=1/0;n.length>0&&(c=n.length-1);var f=Math.max(s,Math.min(l,c)),d=n[f];return d==null||Rte(d,r,i)?String(f):null},CP=(e,n,r,i,a,l,s)=>{if(l!=null){var c=s[0],f=c==null?void 0:c.getPosition(l);if(f!=null)return f;var d=a==null?void 0:a[Number(l)];if(d)switch(r){case"horizontal":return{x:d.coordinate,y:(i.top+n)/2};default:return{x:(i.left+e)/2,y:d.coordinate}}}},NP=(e,n,r,i)=>{if(n==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var a;if(r==="hover"?a=e.itemInteraction.hover.graphicalItemId:a=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&a==null)return e.tooltipItemPayloads;if(a==null&&i!=null){var l=e.tooltipItemPayloads[0];return l!=null?[l]:[]}return e.tooltipItemPayloads.filter(s=>{var c;return((c=s.settings)===null||c===void 0?void 0:c.graphicalItemId)===a})},OP=e=>e.options.tooltipPayloadSearcher,us=e=>e.tooltip;function lN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function oN(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?lN(Object(r),!0).forEach(function(i){Lte(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Lte(e,n,r){return(n=zte(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function zte(e){var n=Ite(e,"string");return typeof n=="symbol"?n:n+""}function Ite(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function $te(e){if(typeof e=="string"||typeof e=="number")return e}function Bte(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Fte(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return n=>e(n)}function sN(e){if(typeof e=="string")return e}function Ute(e){if(!(e==null||typeof e!="object")){var n="name"in e?$te(e.name):void 0,r="unit"in e?Bte(e.unit):void 0,i="dataKey"in e?Fte(e.dataKey):void 0,a="payload"in e?e.payload:void 0,l="color"in e?sN(e.color):void 0,s="fill"in e?sN(e.fill):void 0;return{name:n,unit:r,dataKey:i,payload:a,color:l,fill:s}}}function qte(e,n){return e??n}var AP=(e,n,r,i,a,l,s)=>{if(!(n==null||l==null)){var{chartData:c,computedData:f,dataStartIndex:d,dataEndIndex:m}=r,p=[];return e.reduce((y,x)=>{var _,{dataDefinedOnItem:S,settings:k}=x,j=qte(S,c),C=Array.isArray(j)?LT(j,d,m):j,N=(_=k==null?void 0:k.dataKey)!==null&&_!==void 0?_:i,O=k==null?void 0:k.nameKey,T;if(i&&Array.isArray(C)&&!Array.isArray(C[0])&&s==="axis"?T=H3(C,i,a):T=l(C,n,f,O),Array.isArray(T))T.forEach(P=>{var R,z,D=Ute(P),U=D==null?void 0:D.name,q=D==null?void 0:D.dataKey,L=D==null?void 0:D.payload,$=oN(oN({},k),{},{name:U,unit:D==null?void 0:D.unit,color:(R=D==null?void 0:D.color)!==null&&R!==void 0?R:k==null?void 0:k.color,fill:(z=D==null?void 0:D.fill)!==null&&z!==void 0?z:k==null?void 0:k.fill});y.push(B5({tooltipEntrySettings:$,dataKey:q,payload:L,value:rn(L,q),name:U==null?void 0:String(U)}))});else{var A;y.push(B5({tooltipEntrySettings:k,dataKey:N,payload:T,value:rn(T,N),name:(A=rn(T,O))!==null&&A!==void 0?A:k==null?void 0:k.name}))}return y},p)}},H1=le([Ft,$M,S1],RM),Hte=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,n)=>[...e,...n]),Gte=le([Yt,ls],BM),cs=le([Hte,Ft,Gte],UM,{memoizeOptions:{resultEqualityCheck:Xm}}),Kte=le([cs],e=>e.filter(A1)),Vte=le([cs],GM,{memoizeOptions:{resultEqualityCheck:Xm}}),fs=le([Vte,qa],KM),Yte=le([Kte,qa,Ft],DM),G1=le([fs,Ft,cs],VM),TP=le([Ft],R1),Wte=le([Ft],e=>e.allowDataOverflow),MP=le([TP,Wte],pM),Xte=le([cs],e=>e.filter(A1)),Zte=le([Yte,Xte,Hm,EM],WM),Qte=le([Zte,qa,Yt,MP],XM),Jte=le([cs],HM),ene=le([fs,Ft,Jte,L1,Yt],JM,{memoizeOptions:{resultEqualityCheck:Wm}}),tne=le([eP,Yt,ls],os),nne=le([tne,Yt],rP),rne=le([tP,Yt,ls],os),ine=le([rne,Yt],iP),ane=le([nP,Yt,ls],os),lne=le([ane,Yt],aP),one=le([nne,lne,ine],qh),sne=le([Ft,TP,MP,Qte,ene,one,_t,Yt],lP),zc=le([Ft,_t,fs,G1,Hm,Yt,sne],oP),une=le([zc,Ft,H1],sP),cne=le([Ft,zc,une,Yt],uP),PP=e=>{var n=Yt(e),r=ls(e),i=!1;return Lc(e,n,r,i)},DP=le([Ft,PP],Gm),fne=le([Ft,H1,cne,DP],M1),RP=le([fne],T1),dne=le([_t,G1,Ft,Yt],pP),hne=le([_t,G1,Ft,Yt],dP),mne=(e,n,r,i,a,l,s,c)=>{if(n){var{type:f}=n,d=ea(e,c);if(i){var m=r==="scaleBand"&&i.bandwidth?i.bandwidth()/2:2,p=f==="category"&&i.bandwidth?i.bandwidth()/m:0;return p=c==="angleAxis"&&a!=null&&(a==null?void 0:a.length)>=2?yr(a[0]-a[1])*2*p:p,d&&s?s.map((y,x)=>{var _=i.map(y);return Fe(_)?{coordinate:_+p,value:y,index:x,offset:p}:null}).filter(Mn):i.domain().map((y,x)=>{var _=i.map(y);return Fe(_)?{coordinate:_+p,value:l?l[y]:y,index:x,offset:p}:null}).filter(Mn)}}},ra=le([_t,Ft,H1,RP,PP,dne,hne,Yt],mne),K1=le([xP,bP,xte],(e,n,r)=>wP(r.shared,e,n)),LP=e=>e.tooltip.settings.trigger,V1=e=>e.tooltip.settings.defaultIndex,Ic=le([us,K1,LP,V1],EP),lc=le([Ic,fs,Rc,zc],q1),zP=le([ra,lc],_P),pne=le([Ic],e=>{if(e)return e.dataKey}),gne=le([Ic],e=>{if(e)return e.graphicalItemId}),IP=le([us,K1,LP,V1],NP),vne=le([ta,na,_t,ln,ra,V1,IP],CP),yne=le([Ic,vne],(e,n)=>e!=null&&e.coordinate?e.coordinate:n),xne=le([Ic],e=>{var n;return(n=e==null?void 0:e.active)!==null&&n!==void 0?n:!1}),bne=le([IP,lc,qa,Rc,zP,OP,K1],AP),wne=le([bne],e=>{if(e!=null){var n=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(n))}});function uN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function cN(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?uN(Object(r),!0).forEach(function(i){_ne(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function _ne(e,n,r){return(n=kne(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function kne(e){var n=Sne(e,"string");return typeof n=="symbol"?n:n+""}function Sne(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var jne=()=>Ne(Ft),Ene=()=>{var e=jne(),n=Ne(ra),r=Ne(RP);return Ah(!e||!r?void 0:cN(cN({},e),{},{scale:r}),n)};function fN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function To(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?fN(Object(r),!0).forEach(function(i){Cne(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Cne(e,n,r){return(n=Nne(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Nne(e){var n=One(e,"string");return typeof n=="symbol"?n:n+""}function One(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var Ane=(e,n,r,i)=>{var a=n.find(l=>l&&l.index===r);if(a){if(e==="horizontal")return{x:a.coordinate,y:i.relativeY};if(e==="vertical")return{x:i.relativeX,y:a.coordinate}}return{x:0,y:0}},Tne=(e,n,r,i)=>{var a=n.find(d=>d&&d.index===r);if(a){if(e==="centric"){var l=a.coordinate,{radius:s}=i;return To(To(To({},i),nn(i.cx,i.cy,s,l)),{},{angle:l,radius:s})}var c=a.coordinate,{angle:f}=i;return To(To(To({},i),nn(i.cx,i.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Mne(e,n){var{relativeX:r,relativeY:i}=e;return r>=n.left&&r<=n.left+n.width&&i>=n.top&&i<=n.top+n.height}var $P=(e,n,r,i,a)=>{var l,s=(l=n==null?void 0:n.length)!==null&&l!==void 0?l:0;if(s<=1||e==null)return 0;if(i==="angleAxis"&&a!=null&&Math.abs(Math.abs(a[1]-a[0])-360)<=1e-6)for(var c=0;c<s;c++){var f,d,m,p,y,x=c>0?(f=r[c-1])===null||f===void 0?void 0:f.coordinate:(d=r[s-1])===null||d===void 0?void 0:d.coordinate,_=(m=r[c])===null||m===void 0?void 0:m.coordinate,S=c>=s-1?(p=r[0])===null||p===void 0?void 0:p.coordinate:(y=r[c+1])===null||y===void 0?void 0:y.coordinate,k=void 0;if(!(x==null||_==null||S==null))if(yr(_-x)!==yr(S-_)){var j=[];if(yr(S-_)===yr(a[1]-a[0])){k=S;var C=_+a[1]-a[0];j[0]=Math.min(C,(C+x)/2),j[1]=Math.max(C,(C+x)/2)}else{k=x;var N=S+a[1]-a[0];j[0]=Math.min(_,(N+_)/2),j[1]=Math.max(_,(N+_)/2)}var O=[Math.min(_,(k+_)/2),Math.max(_,(k+_)/2)];if(e>O[0]&&e<=O[1]||e>=j[0]&&e<=j[1]){var T;return(T=r[c])===null||T===void 0?void 0:T.index}}else{var A=Math.min(x,S),P=Math.max(x,S);if(e>(A+_)/2&&e<=(P+_)/2){var R;return(R=r[c])===null||R===void 0?void 0:R.index}}}else if(n)for(var z=0;z<s;z++){var D=n[z];if(D!=null){var U=n[z+1],q=n[z-1];if(z===0&&U!=null&&e<=(D.coordinate+U.coordinate)/2||z===s-1&&q!=null&&e>(D.coordinate+q.coordinate)/2||z>0&&z<s-1&&q!=null&&U!=null&&e>(D.coordinate+q.coordinate)/2&&e<=(D.coordinate+U.coordinate)/2)return D.index}}return-1},Pne=()=>Ne(S1),Y1=(e,n)=>n,BP=(e,n,r)=>r,W1=(e,n,r,i)=>i,Dne=le(ra,e=>Em(e,n=>n.coordinate)),X1=le([us,Y1,BP,W1],EP),Z1=le([X1,fs,Rc,zc],q1),Rne=(e,n,r)=>{if(n!=null){var i=us(e);return n==="axis"?r==="hover"?i.axisInteraction.hover.dataKey:i.axisInteraction.click.dataKey:r==="hover"?i.itemInteraction.hover.dataKey:i.itemInteraction.click.dataKey}},FP=le([us,Y1,BP,W1],NP),Gh=le([ta,na,_t,ln,ra,W1,FP],CP),Lne=le([X1,Gh],(e,n)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:n}),UP=le([ra,Z1],_P),zne=le([FP,Z1,qa,Rc,UP,OP,Y1],AP),Ine=le([X1,Z1],(e,n)=>({isActive:e.active&&n!=null,activeIndex:n})),$ne=(e,n,r,i,a,l,s)=>{if(!(!e||!r||!i||!a)&&Mne(e,s)){var c=oZ(e,n),f=$P(c,l,a,r,i),d=Ane(n,a,f,e);return{activeIndex:String(f),activeCoordinate:d}}},Bne=(e,n,r,i,a,l,s)=>{if(!(!e||!i||!a||!l||!r)){var c=IJ(e,r);if(c){var f=sZ(c,n),d=$P(f,s,l,i,a),m=Tne(n,l,d,c);return{activeIndex:String(d),activeCoordinate:m}}}},Fne=(e,n,r,i,a,l,s,c)=>{if(!(!e||!n||!i||!a||!l))return n==="horizontal"||n==="vertical"?$ne(e,n,i,a,l,s,c):Bne(e,n,r,i,a,l,s)},Une=le(e=>e.zIndex.zIndexMap,(e,n)=>n,(e,n,r)=>r,(e,n,r)=>{if(n!=null){var i=e[n];if(i!=null)return r?i.panoramaElement:i.element}}),qne=le(e=>e.zIndex.zIndexMap,e=>{var n=Object.keys(e).map(i=>parseInt(i,10)).concat(Object.values(fn)),r=Array.from(new Set(n));return r.sort((i,a)=>i-a)},{memoizeOptions:{resultEqualityCheck:oee}});function dN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function hN(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?dN(Object(r),!0).forEach(function(i){Hne(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Hne(e,n,r){return(n=Gne(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Gne(e){var n=Kne(e,"string");return typeof n=="symbol"?n:n+""}function Kne(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var Vne={},Yne={zIndexMap:Object.values(fn).reduce((e,n)=>hN(hN({},e),{},{[n]:{element:void 0,panoramaElement:void 0,consumers:0}}),Vne)},Wne=new Set(Object.values(fn));function Xne(e){return Wne.has(e)}var qP=hn({name:"zIndex",initialState:Yne,reducers:{registerZIndexPortal:{reducer:(e,n)=>{var{zIndex:r}=n.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:pt()},unregisterZIndexPortal:{reducer:(e,n)=>{var{zIndex:r}=n.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!Xne(r)&&delete e.zIndexMap[r])},prepare:pt()},registerZIndexPortalElement:{reducer:(e,n)=>{var{zIndex:r,element:i,isPanorama:a}=n.payload;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=i:e.zIndexMap[r].element=i:e.zIndexMap[r]={consumers:0,element:a?void 0:i,panoramaElement:a?i:void 0}},prepare:pt()},unregisterZIndexPortalElement:{reducer:(e,n)=>{var{zIndex:r}=n.payload;e.zIndexMap[r]&&(n.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:pt()}}}),{registerZIndexPortal:Zne,unregisterZIndexPortal:Qne,registerZIndexPortalElement:Jne,unregisterZIndexPortalElement:ere}=qP.actions,tre=qP.reducer;function fi(e){var{zIndex:n,children:r}=e,i=FZ(),a=i&&n!==void 0&&n!==0,l=wn(),s=At();b.useLayoutEffect(()=>a?(s(Zne({zIndex:n})),()=>{s(Qne({zIndex:n}))}):zl,[s,n,a]);var c=Ne(f=>Une(f,n,l));return a?c?am.createPortal(r,c):null:r}function Lx(){return Lx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Lx.apply(null,arguments)}function mN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Cd(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?mN(Object(r),!0).forEach(function(i){nre(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function nre(e,n,r){return(n=rre(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function rre(e){var n=ire(e,"string");return typeof n=="symbol"?n:n+""}function ire(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function are(e){var{cursor:n,cursorComp:r,cursorProps:i}=e;return b.isValidElement(n)?b.cloneElement(n,i):b.createElement(r,i)}function lre(e){var n,{coordinate:r,payload:i,index:a,offset:l,tooltipAxisBandSize:s,layout:c,cursor:f,tooltipEventType:d,chartName:m}=e,p=r,y=i,x=a;if(!f||!p||m!=="ScatterChart"&&d!=="axis")return null;var _,S,k;if(m==="ScatterChart")_=p,S=QQ,k=fn.cursorLine;else if(m==="BarChart")_=JQ(c,p,l,s),S=cM,k=fn.cursorRectangle;else if(c==="radial"&&V3(p)){var{cx:j,cy:C,radius:N,startAngle:O,endAngle:T}=fM(p);_={cx:j,cy:C,startAngle:O,endAngle:T,innerRadius:N,outerRadius:N},S=hM,k=fn.cursorLine}else _={points:UJ(c,p,l)},S=aM,k=fn.cursorLine;var A=typeof f=="object"&&"className"in f?f.className:void 0,P=Cd(Cd(Cd(Cd({stroke:"#ccc",pointerEvents:"none"},l),_),wm(f)),{},{payload:y,payloadIndex:x,className:ot("recharts-tooltip-cursor",A)});return b.createElement(fi,{zIndex:(n=e.zIndex)!==null&&n!==void 0?n:k},b.createElement(are,{cursor:f,cursorComp:S,cursorProps:P}))}function ore(e){var n=Ene(),r=GT(),i=rs(),a=Pne();return n==null||r==null||i==null||a==null?null:b.createElement(lre,Lx({},e,{offset:r,layout:i,tooltipAxisBandSize:n,chartName:a}))}var HP=b.createContext(null),sre=()=>b.useContext(HP),cy={exports:{}},pN;function ure(){return pN||(pN=1,(function(e){var n=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(f,d,m){this.fn=f,this.context=d,this.once=m||!1}function l(f,d,m,p,y){if(typeof m!="function")throw new TypeError("The listener must be a function");var x=new a(m,p||f,y),_=r?r+d:d;return f._events[_]?f._events[_].fn?f._events[_]=[f._events[_],x]:f._events[_].push(x):(f._events[_]=x,f._eventsCount++),f}function s(f,d){--f._eventsCount===0?f._events=new i:delete f._events[d]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],m,p;if(this._eventsCount===0)return d;for(p in m=this._events)n.call(m,p)&&d.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},c.prototype.listeners=function(d){var m=r?r+d:d,p=this._events[m];if(!p)return[];if(p.fn)return[p.fn];for(var y=0,x=p.length,_=new Array(x);y<x;y++)_[y]=p[y].fn;return _},c.prototype.listenerCount=function(d){var m=r?r+d:d,p=this._events[m];return p?p.fn?1:p.length:0},c.prototype.emit=function(d,m,p,y,x,_){var S=r?r+d:d;if(!this._events[S])return!1;var k=this._events[S],j=arguments.length,C,N;if(k.fn){switch(k.once&&this.removeListener(d,k.fn,void 0,!0),j){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,m),!0;case 3:return k.fn.call(k.context,m,p),!0;case 4:return k.fn.call(k.context,m,p,y),!0;case 5:return k.fn.call(k.context,m,p,y,x),!0;case 6:return k.fn.call(k.context,m,p,y,x,_),!0}for(N=1,C=new Array(j-1);N<j;N++)C[N-1]=arguments[N];k.fn.apply(k.context,C)}else{var O=k.length,T;for(N=0;N<O;N++)switch(k[N].once&&this.removeListener(d,k[N].fn,void 0,!0),j){case 1:k[N].fn.call(k[N].context);break;case 2:k[N].fn.call(k[N].context,m);break;case 3:k[N].fn.call(k[N].context,m,p);break;case 4:k[N].fn.call(k[N].context,m,p,y);break;default:if(!C)for(T=1,C=new Array(j-1);T<j;T++)C[T-1]=arguments[T];k[N].fn.apply(k[N].context,C)}}return!0},c.prototype.on=function(d,m,p){return l(this,d,m,p,!1)},c.prototype.once=function(d,m,p){return l(this,d,m,p,!0)},c.prototype.removeListener=function(d,m,p,y){var x=r?r+d:d;if(!this._events[x])return this;if(!m)return s(this,x),this;var _=this._events[x];if(_.fn)_.fn===m&&(!y||_.once)&&(!p||_.context===p)&&s(this,x);else{for(var S=0,k=[],j=_.length;S<j;S++)(_[S].fn!==m||y&&!_[S].once||p&&_[S].context!==p)&&k.push(_[S]);k.length?this._events[x]=k.length===1?k[0]:k:s(this,x)}return this},c.prototype.removeAllListeners=function(d){var m;return d?(m=r?r+d:d,this._events[m]&&s(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c})(cy)),cy.exports}var cre=ure();const fre=oi(cre);var oc=new fre,zx="recharts.syncEvent.tooltip",gN="recharts.syncEvent.brush",dre=(e,n)=>{if(n&&Array.isArray(e)){var r=Number.parseInt(n,10);if(!Wi(r))return e[r]}},hre={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},GP=hn({name:"options",initialState:hre,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),mre=GP.reducer,{createEventEmitter:pre}=GP.actions;function gre(e){return e.tooltip.syncInteraction}var vre={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},KP=hn({name:"chartData",initialState:vre,reducers:{setChartData(e,n){if(e.chartData=n.payload,n.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}n.payload.length>0&&e.dataEndIndex!==n.payload.length-1&&(e.dataEndIndex=n.payload.length-1)},setComputedData(e,n){e.computedData=n.payload},setDataStartEndIndexes(e,n){var{startIndex:r,endIndex:i}=n.payload;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),{setChartData:vN,setDataStartEndIndexes:yre,setComputedData:qde}=KP.actions,xre=KP.reducer,bre=["x","y"];function yN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Mo(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yN(Object(r),!0).forEach(function(i){wre(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function wre(e,n,r){return(n=_re(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function _re(e){var n=kre(e,"string");return typeof n=="symbol"?n:n+""}function kre(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Sre(e,n){if(e==null)return{};var r,i,a=jre(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function jre(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Ere(){var e=Ne(j1),n=Ne(E1),r=At(),i=Ne(CM),a=Ne(ra),l=rs(),s=Nc(),c=Ne(f=>f.rootProps.className);b.useEffect(()=>{if(e==null)return zl;var f=(d,m,p)=>{if(n!==p&&e===d){if(i==="index"){var y;if(s&&m!==null&&m!==void 0&&(y=m.payload)!==null&&y!==void 0&&y.coordinate&&m.payload.sourceViewBox){var x=m.payload.coordinate,{x:_,y:S}=x,k=Sre(x,bre),{x:j,y:C,width:N,height:O}=m.payload.sourceViewBox,T=Mo(Mo({},k),{},{x:s.x+(N?(_-j)/N:0)*s.width,y:s.y+(O?(S-C)/O:0)*s.height});r(Mo(Mo({},m),{},{payload:Mo(Mo({},m.payload),{},{coordinate:T})}))}else r(m);return}if(a!=null){var A;if(typeof i=="function"){var P={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},R=i(a,P);A=a[R]}else i==="value"&&(A=a.find(B=>String(B.value)===m.payload.label));var{coordinate:z}=m.payload;if(A==null||m.payload.active===!1||z==null||s==null){r(Rx({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:D,y:U}=z,q=Math.min(D,s.x+s.width),L=Math.min(U,s.y+s.height),$={x:l==="horizontal"?A.coordinate:q,y:l==="horizontal"?L:A.coordinate},G=Rx({active:m.payload.active,coordinate:$,dataKey:m.payload.dataKey,index:String(A.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});r(G)}}};return oc.on(zx,f),()=>{oc.off(zx,f)}},[c,r,n,e,i,a,l,s])}function Cre(){var e=Ne(j1),n=Ne(E1),r=At();b.useEffect(()=>{if(e==null)return zl;var i=(a,l,s)=>{n!==s&&e===a&&r(yre(l))};return oc.on(gN,i),()=>{oc.off(gN,i)}},[r,n,e])}function Nre(){var e=At();b.useEffect(()=>{e(pre())},[e]),Ere(),Cre()}function Ore(e,n,r,i,a,l){var s=Ne(_=>Rne(_,e,n)),c=Ne(gne),f=Ne(E1),d=Ne(j1),m=Ne(CM),p=Ne(gre),y=p==null?void 0:p.active,x=Nc();b.useEffect(()=>{if(!y&&d!=null&&f!=null){var _=Rx({active:l,coordinate:r,dataKey:s,index:a,label:typeof i=="number"?String(i):i,sourceViewBox:x,graphicalItemId:c});oc.emit(zx,d,_,f)}},[y,r,s,c,a,i,f,d,m,l,x])}function xN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function bN(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?xN(Object(r),!0).forEach(function(i){Are(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Are(e,n,r){return(n=Tre(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Tre(e){var n=Mre(e,"string");return typeof n=="symbol"?n:n+""}function Mre(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Pre(e){return e.dataKey}function Dre(e,n){return b.isValidElement(e)?b.cloneElement(e,n):typeof e=="function"?b.createElement(e,n):b.createElement(CQ,n)}var wN=[],Rre={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Lre(e){var n,r,i=bn(e,Rre),{active:a,allowEscapeViewBox:l,animationDuration:s,animationEasing:c,content:f,filterNull:d,isAnimationActive:m,offset:p,payloadUniqBy:y,position:x,reverseDirection:_,useTranslate3d:S,wrapperStyle:k,cursor:j,shared:C,trigger:N,defaultIndex:O,portal:T,axisId:A}=i,P=At(),R=typeof O=="number"?String(O):O;b.useEffect(()=>{P(Ste({shared:C,trigger:N,axisId:A,active:a,defaultIndex:R}))},[P,C,N,A,a,R]);var z=Nc(),D=iM(),U=yte(C),{activeIndex:q,isActive:L}=(n=Ne(Se=>Ine(Se,U,N,R)))!==null&&n!==void 0?n:{},$=Ne(Se=>zne(Se,U,N,R)),G=Ne(Se=>UP(Se,U,N,R)),B=Ne(Se=>Lne(Se,U,N,R)),Y=$,ee=sre(),H=(r=a??L)!==null&&r!==void 0?r:!1,[re,F]=WW([Y,H]),X=U==="axis"?G:void 0;Ore(U,N,B,X,q,H);var ae=T??ee;if(ae==null||z==null||U==null)return null;var se=Y??wN;H||(se=wN),d&&se.length&&(se=wW(se.filter(Se=>Se.value!=null&&(Se.hide!==!0||i.includeHidden)),y,Pre));var ve=se.length>0,we=bN(bN({},i),{},{payload:se,label:X,active:H,activeIndex:q,coordinate:B,accessibilityLayer:D}),ce=b.createElement(IQ,{allowEscapeViewBox:l,animationDuration:s,animationEasing:c,isAnimationActive:m,active:H,coordinate:B,hasPayload:ve,offset:p,position:x,reverseDirection:_,useTranslate3d:S,viewBox:z,wrapperStyle:k,lastBoundingBox:re,innerRef:F,hasPortalFromProps:!!T},Dre(f,we));return b.createElement(b.Fragment,null,am.createPortal(ce,ae),H&&b.createElement(ore,{cursor:j,tooltipEventType:U,coordinate:B,payload:se,index:q}))}function zre(e,n,r){return(n=Ire(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Ire(e){var n=$re(e,"string");return typeof n=="symbol"?n:n+""}function $re(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}class Bre{constructor(n){zre(this,"cache",new Map),this.maxSize=n}get(n){var r=this.cache.get(n);return r!==void 0&&(this.cache.delete(n),this.cache.set(n,r)),r}set(n,r){if(this.cache.has(n))this.cache.delete(n);else if(this.cache.size>=this.maxSize){var i=this.cache.keys().next().value;i!=null&&this.cache.delete(i)}this.cache.set(n,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function _N(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Fre(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?_N(Object(r),!0).forEach(function(i){Ure(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_N(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ure(e,n,r){return(n=qre(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function qre(e){var n=Hre(e,"string");return typeof n=="symbol"?n:n+""}function Hre(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var Gre={cacheSize:2e3,enableCache:!0},VP=Fre({},Gre),kN=new Bre(VP.cacheSize),Kre={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},SN="recharts_measurement_span";function Vre(e,n){var r=n.fontSize||"",i=n.fontFamily||"",a=n.fontWeight||"",l=n.fontStyle||"",s=n.letterSpacing||"",c=n.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(s,"|").concat(c)}var jN=(e,n)=>{try{var r=document.getElementById(SN);r||(r=document.createElement("span"),r.setAttribute("id",SN),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,Kre,n),r.textContent="".concat(e);var i=r.getBoundingClientRect();return{width:i.width,height:i.height}}catch{return{width:0,height:0}}},Uu=function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n==null||Tc.isSsr)return{width:0,height:0};if(!VP.enableCache)return jN(n,r);var i=Vre(n,r),a=kN.get(i);if(a)return a;var l=jN(n,r);return kN.set(i,l),l},YP;function Yre(e,n,r){return(n=Wre(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Wre(e){var n=Xre(e,"string");return typeof n=="symbol"?n:n+""}function Xre(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var EN=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,CN=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Zre=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Qre=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Jre={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},eie=["cm","mm","pt","pc","in","Q","px"];function tie(e){return eie.includes(e)}var zo="NaN";function nie(e,n){return e*Jre[n]}class tn{static parse(n){var r,[,i,a]=(r=Qre.exec(n))!==null&&r!==void 0?r:[];return i==null?tn.NaN:new tn(parseFloat(i),a??"")}constructor(n,r){this.num=n,this.unit=r,this.num=n,this.unit=r,Wi(n)&&(this.unit=""),r!==""&&!Zre.test(r)&&(this.num=NaN,this.unit=""),tie(r)&&(this.num=nie(n,r),this.unit="px")}add(n){return this.unit!==n.unit?new tn(NaN,""):new tn(this.num+n.num,this.unit)}subtract(n){return this.unit!==n.unit?new tn(NaN,""):new tn(this.num-n.num,this.unit)}multiply(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new tn(NaN,""):new tn(this.num*n.num,this.unit||n.unit)}divide(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new tn(NaN,""):new tn(this.num/n.num,this.unit||n.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wi(this.num)}}YP=tn;Yre(tn,"NaN",new YP(NaN,""));function WP(e){if(e==null||e.includes(zo))return zo;for(var n=e;n.includes("*")||n.includes("/");){var r,[,i,a,l]=(r=EN.exec(n))!==null&&r!==void 0?r:[],s=tn.parse(i??""),c=tn.parse(l??""),f=a==="*"?s.multiply(c):s.divide(c);if(f.isNaN())return zo;n=n.replace(EN,f.toString())}for(;n.includes("+")||/.-\d+(?:\.\d+)?/.test(n);){var d,[,m,p,y]=(d=CN.exec(n))!==null&&d!==void 0?d:[],x=tn.parse(m??""),_=tn.parse(y??""),S=p==="+"?x.add(_):x.subtract(_);if(S.isNaN())return zo;n=n.replace(CN,S.toString())}return n}var NN=/\(([^()]*)\)/;function rie(e){for(var n=e,r;(r=NN.exec(n))!=null;){var[,i]=r;n=n.replace(NN,WP(i))}return n}function iie(e){var n=e.replace(/\s+/g,"");return n=rie(n),n=WP(n),n}function aie(e){try{return iie(e)}catch{return zo}}function fy(e){var n=aie(e.slice(5,-1));return n===zo?"":n}var lie=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],oie=["dx","dy","angle","className","breakAll"];function Ix(){return Ix=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ix.apply(null,arguments)}function ON(e,n){if(e==null)return{};var r,i,a=sie(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function sie(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var XP=/[ \f\n\r\t\v\u2028\u2029]+/,ZP=e=>{var{children:n,breakAll:r,style:i}=e;try{var a=[];Gt(n)||(r?a=n.toString().split(""):a=n.toString().split(XP));var l=a.map(c=>({word:c,width:Uu(c,i).width})),s=r?0:Uu(" ",i).width;return{wordsWithComputedWidth:l,spaceWidth:s}}catch{return null}};function QP(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function uie(e){return Gt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var JP=(e,n,r,i)=>e.reduce((a,l)=>{var{word:s,width:c}=l,f=a[a.length-1];if(f&&c!=null&&(n==null||i||f.width+c+r<Number(n)))f.words.push(s),f.width+=c+r;else{var d={words:[s],width:c};a.push(d)}return a},[]),eD=e=>e.reduce((n,r)=>n.width>r.width?n:r),cie="…",AN=(e,n,r,i,a,l,s,c)=>{var f=e.slice(0,n),d=ZP({breakAll:r,style:i,children:f+cie});if(!d)return[!1,[]];var m=JP(d.wordsWithComputedWidth,l,s,c),p=m.length>a||eD(m).width>Number(l);return[p,m]},fie=(e,n,r,i,a)=>{var{maxLines:l,children:s,style:c,breakAll:f}=e,d=Ce(l),m=String(s),p=JP(n,i,r,a);if(!d||a)return p;var y=p.length>l||eD(p).width>Number(i);if(!y)return p;for(var x=0,_=m.length-1,S=0,k;x<=_&&S<=m.length-1;){var j=Math.floor((x+_)/2),C=j-1,[N,O]=AN(m,C,f,c,l,i,r,a),[T]=AN(m,j,f,c,l,i,r,a);if(!N&&!T&&(x=j+1),N&&T&&(_=j-1),!N&&T){k=O;break}S++}return k||p},TN=e=>{var n=Gt(e)?[]:e.toString().split(XP);return[{words:n,width:void 0}]},die=e=>{var{width:n,scaleToFit:r,children:i,style:a,breakAll:l,maxLines:s}=e;if((n||r)&&!Tc.isSsr){var c,f,d=ZP({breakAll:l,children:i,style:a});if(d){var{wordsWithComputedWidth:m,spaceWidth:p}=d;c=m,f=p}else return TN(i);return fie({breakAll:l,children:i,maxLines:s,style:a},c,f,n,!!r)}return TN(i)},tD="#808080",hie={angle:0,breakAll:!1,capHeight:"0.71em",fill:tD,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Q1=b.forwardRef((e,n)=>{var r=bn(e,hie),{x:i,y:a,lineHeight:l,capHeight:s,fill:c,scaleToFit:f,textAnchor:d,verticalAnchor:m}=r,p=ON(r,lie),y=b.useMemo(()=>die({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:f,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,f,p.style,p.width]),{dx:x,dy:_,angle:S,className:k,breakAll:j}=p,C=ON(p,oie);if(!br(i)||!br(a)||y.length===0)return null;var N=Number(i)+(Ce(x)?x:0),O=Number(a)+(Ce(_)?_:0);if(!Fe(N)||!Fe(O))return null;var T;switch(m){case"start":T=fy("calc(".concat(s,")"));break;case"middle":T=fy("calc(".concat((y.length-1)/2," * -").concat(l," + (").concat(s," / 2))"));break;default:T=fy("calc(".concat(y.length-1," * -").concat(l,")"));break}var A=[],P=y[0];if(f&&P!=null){var R=P.width,{width:z}=p;A.push("scale(".concat(Ce(z)&&Ce(R)?z/R:1,")"))}return S&&A.push("rotate(".concat(S,", ").concat(N,", ").concat(O,")")),A.length&&(C.transform=A.join(" ")),b.createElement("text",Ix({},dn(C),{ref:n,x:N,y:O,className:ot("recharts-text",k),textAnchor:d,fill:c.includes("url")?tD:c}),y.map((D,U)=>{var q=D.words.join(j?"":" ");return b.createElement("tspan",{x:N,dy:U===0?T:l,key:"".concat(q,"-").concat(U)},q)}))});Q1.displayName="Text";function MN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function qr(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?MN(Object(r),!0).forEach(function(i){mie(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function mie(e,n,r){return(n=pie(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function pie(e){var n=gie(e,"string");return typeof n=="symbol"?n:n+""}function gie(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var vie=e=>{var{viewBox:n,position:r,offset:i=0,parentViewBox:a}=e,{x:l,y:s,height:c,upperWidth:f,lowerWidth:d}=p1(n),m=l,p=l+(f-d)/2,y=(m+p)/2,x=(f+d)/2,_=m+f/2,S=c>=0?1:-1,k=S*i,j=S>0?"end":"start",C=S>0?"start":"end",N=f>=0?1:-1,O=N*i,T=N>0?"end":"start",A=N>0?"start":"end",P=a;if(r==="top"){var R={x:m+f/2,y:s-k,horizontalAnchor:"middle",verticalAnchor:j};return P&&(R.height=Math.max(s-P.y,0),R.width=f),R}if(r==="bottom"){var z={x:p+d/2,y:s+c+k,horizontalAnchor:"middle",verticalAnchor:C};return P&&(z.height=Math.max(P.y+P.height-(s+c),0),z.width=d),z}if(r==="left"){var D={x:y-O,y:s+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return P&&(D.width=Math.max(D.x-P.x,0),D.height=c),D}if(r==="right"){var U={x:y+x+O,y:s+c/2,horizontalAnchor:A,verticalAnchor:"middle"};return P&&(U.width=Math.max(P.x+P.width-U.x,0),U.height=c),U}var q=P?{width:x,height:c}:{};return r==="insideLeft"?qr({x:y+O,y:s+c/2,horizontalAnchor:A,verticalAnchor:"middle"},q):r==="insideRight"?qr({x:y+x-O,y:s+c/2,horizontalAnchor:T,verticalAnchor:"middle"},q):r==="insideTop"?qr({x:m+f/2,y:s+k,horizontalAnchor:"middle",verticalAnchor:C},q):r==="insideBottom"?qr({x:p+d/2,y:s+c-k,horizontalAnchor:"middle",verticalAnchor:j},q):r==="insideTopLeft"?qr({x:m+O,y:s+k,horizontalAnchor:A,verticalAnchor:C},q):r==="insideTopRight"?qr({x:m+f-O,y:s+k,horizontalAnchor:T,verticalAnchor:C},q):r==="insideBottomLeft"?qr({x:p+O,y:s+c-k,horizontalAnchor:A,verticalAnchor:j},q):r==="insideBottomRight"?qr({x:p+d-O,y:s+c-k,horizontalAnchor:T,verticalAnchor:j},q):r&&typeof r=="object"&&(Ce(r.x)||Ol(r.x))&&(Ce(r.y)||Ol(r.y))?qr({x:l+$a(r.x,x),y:s+$a(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},q):qr({x:_,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},q)},yie=["labelRef"],xie=["content"];function PN(e,n){if(e==null)return{};var r,i,a=bie(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function bie(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function DN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Lu(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?DN(Object(r),!0).forEach(function(i){wie(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function wie(e,n,r){return(n=_ie(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function _ie(e){var n=kie(e,"string");return typeof n=="symbol"?n:n+""}function kie(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function zi(){return zi=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},zi.apply(null,arguments)}var nD=b.createContext(null),rD=e=>{var{x:n,y:r,upperWidth:i,lowerWidth:a,width:l,height:s,children:c}=e,f=b.useMemo(()=>({x:n,y:r,upperWidth:i,lowerWidth:a,width:l,height:s}),[n,r,i,a,l,s]);return b.createElement(nD.Provider,{value:f},c)},iD=()=>{var e=b.useContext(nD),n=Nc();return e||(n?p1(n):void 0)},Sie=b.createContext(null),jie=()=>{var e=b.useContext(Sie),n=Ne(MM);return e||n},Eie=e=>{var{value:n,formatter:r}=e,i=Gt(e.children)?n:e.children;return typeof r=="function"?r(i):i},J1=e=>e!=null&&typeof e=="function",Cie=(e,n)=>{var r=yr(n-e),i=Math.min(Math.abs(n-e),360);return r*i},Nie=(e,n,r,i,a)=>{var{offset:l,className:s}=e,{cx:c,cy:f,innerRadius:d,outerRadius:m,startAngle:p,endAngle:y,clockWise:x}=a,_=(d+m)/2,S=Cie(p,y),k=S>=0?1:-1,j,C;switch(n){case"insideStart":j=p+k*l,C=x;break;case"insideEnd":j=y-k*l,C=!x;break;case"end":j=y+k*l,C=x;break;default:throw new Error("Unsupported position ".concat(n))}C=S<=0?C:!C;var N=nn(c,f,_,j),O=nn(c,f,_,j+(C?1:-1)*359),T="M".concat(N.x,",").concat(N.y,`
178
+ A`).concat(_,",").concat(_,",0,1,").concat(C?0:1,`,
179
+ `).concat(O.x,",").concat(O.y),A=Gt(e.id)?Zu("recharts-radial-line-"):e.id;return b.createElement("text",zi({},i,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",s)}),b.createElement("defs",null,b.createElement("path",{id:A,d:T})),b.createElement("textPath",{xlinkHref:"#".concat(A)},r))},Oie=(e,n,r)=>{var{cx:i,cy:a,innerRadius:l,outerRadius:s,startAngle:c,endAngle:f}=e,d=(c+f)/2;if(r==="outside"){var{x:m,y:p}=nn(i,a,s+n,d);return{x:m,y:p,textAnchor:m>=i?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:i,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:i,y:a,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:i,y:a,textAnchor:"middle",verticalAnchor:"end"};var y=(l+s)/2,{x,y:_}=nn(i,a,y,d);return{x,y:_,textAnchor:"middle",verticalAnchor:"middle"}},Bd=e=>e!=null&&"cx"in e&&Ce(e.cx),Aie={angle:0,offset:5,zIndex:fn.label,position:"middle",textBreakAll:!1};function Tie(e){if(!Bd(e))return e;var{cx:n,cy:r,outerRadius:i}=e,a=i*2;return{x:n-i,y:r-i,width:a,upperWidth:a,lowerWidth:a,height:a}}function Da(e){var n=bn(e,Aie),{viewBox:r,parentViewBox:i,position:a,value:l,children:s,content:c,className:f="",textBreakAll:d,labelRef:m}=n,p=jie(),y=iD(),x=a==="center"?y:p??y,_,S,k;r==null?_=x:Bd(r)?_=r:_=p1(r);var j=Tie(_);if(!_||Gt(l)&&Gt(s)&&!b.isValidElement(c)&&typeof c!="function")return null;var C=Lu(Lu({},n),{},{viewBox:_});if(b.isValidElement(c)){var{labelRef:N}=C,O=PN(C,yie);return b.cloneElement(c,O)}if(typeof c=="function"){var{content:T}=C,A=PN(C,xie);if(S=b.createElement(c,A),b.isValidElement(S))return S}else S=Eie(n);var P=dn(n);if(Bd(_)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Nie(n,a,S,P,_);k=Oie(_,n.offset,n.position)}else{if(!j)return null;var R=vie({viewBox:j,position:a,offset:n.offset,parentViewBox:Bd(i)?void 0:i});k=Lu(Lu({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return b.createElement(fi,{zIndex:n.zIndex},b.createElement(Q1,zi({ref:m,className:ot("recharts-label",f)},P,k,{textAnchor:QP(P.textAnchor)?P.textAnchor:k.textAnchor,breakAll:d}),S))}Da.displayName="Label";var Mie=(e,n,r)=>{if(!e)return null;var i={viewBox:n,labelRef:r};return e===!0?b.createElement(Da,zi({key:"label-implicit"},i)):br(e)?b.createElement(Da,zi({key:"label-implicit",value:e},i)):b.isValidElement(e)?e.type===Da?b.cloneElement(e,Lu({key:"label-implicit"},i)):b.createElement(Da,zi({key:"label-implicit",content:e},i)):J1(e)?b.createElement(Da,zi({key:"label-implicit",content:e},i)):e&&typeof e=="object"?b.createElement(Da,zi({},e,{key:"label-implicit"},i)):null};function aD(e){var{label:n,labelRef:r}=e,i=iD();return Mie(n,i,r)||null}var Pie=["valueAccessor"],Die=["dataKey","clockWise","id","textBreakAll","zIndex"];function Kh(){return Kh=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Kh.apply(null,arguments)}function RN(e,n){if(e==null)return{};var r,i,a=Rie(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Rie(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var Lie=e=>{var n=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(uie(n))return n},lD=b.createContext(void 0),zie=lD.Provider,oD=b.createContext(void 0);oD.Provider;function Iie(){return b.useContext(lD)}function $ie(){return b.useContext(oD)}function Fd(e){var{valueAccessor:n=Lie}=e,r=RN(e,Pie),{dataKey:i,clockWise:a,id:l,textBreakAll:s,zIndex:c}=r,f=RN(r,Die),d=Iie(),m=$ie(),p=d||m;return!p||!p.length?null:b.createElement(fi,{zIndex:c??fn.label},b.createElement(ii,{className:"recharts-label-list"},p.map((y,x)=>{var _,S=Gt(i)?n(y,x):rn(y.payload,i),k=Gt(l)?{}:{id:"".concat(l,"-").concat(x)};return b.createElement(Da,Kh({key:"label-".concat(x)},dn(y),f,k,{fill:(_=r.fill)!==null&&_!==void 0?_:y.fill,parentViewBox:y.parentViewBox,value:S,textBreakAll:s,viewBox:y.viewBox,index:x,zIndex:0}))})))}Fd.displayName="LabelList";function Bie(e){var{label:n}=e;return n?n===!0?b.createElement(Fd,{key:"labelList-implicit"}):b.isValidElement(n)||J1(n)?b.createElement(Fd,{key:"labelList-implicit",content:n}):typeof n=="object"?b.createElement(Fd,Kh({key:"labelList-implicit"},n,{type:String(n.type)})):null:null}function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},$x.apply(null,arguments)}var sD=e=>{var{cx:n,cy:r,r:i,className:a}=e,l=ot("recharts-dot",a);return Ce(n)&&Ce(r)&&Ce(i)?b.createElement("circle",$x({},ri(e),a1(e),{className:l,cx:n,cy:r,r:i})):null},Fie={radiusAxis:{},angleAxis:{}},uD=hn({name:"polarAxis",initialState:Fie,reducers:{addRadiusAxis(e,n){e.radiusAxis[n.payload.id]=n.payload},removeRadiusAxis(e,n){delete e.radiusAxis[n.payload.id]},addAngleAxis(e,n){e.angleAxis[n.payload.id]=n.payload},removeAngleAxis(e,n){delete e.angleAxis[n.payload.id]}}}),{addRadiusAxis:Hde,removeRadiusAxis:Gde,addAngleAxis:Kde,removeAngleAxis:Vde}=uD.actions,Uie=uD.reducer;function qie(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var dy={exports:{}},lt={};/** @license React v17.0.2
180
+ * react-is.production.min.js
181
+ *
182
+ * Copyright (c) Facebook, Inc. and its affiliates.
183
+ *
184
+ * This source code is licensed under the MIT license found in the
185
+ * LICENSE file in the root directory of this source tree.
186
+ */var LN;function Hie(){if(LN)return lt;LN=1;var e=60103,n=60106,r=60107,i=60108,a=60114,l=60109,s=60110,c=60112,f=60113,d=60120,m=60115,p=60116,y=60121,x=60122,_=60117,S=60129,k=60131;if(typeof Symbol=="function"&&Symbol.for){var j=Symbol.for;e=j("react.element"),n=j("react.portal"),r=j("react.fragment"),i=j("react.strict_mode"),a=j("react.profiler"),l=j("react.provider"),s=j("react.context"),c=j("react.forward_ref"),f=j("react.suspense"),d=j("react.suspense_list"),m=j("react.memo"),p=j("react.lazy"),y=j("react.block"),x=j("react.server.block"),_=j("react.fundamental"),S=j("react.debug_trace_mode"),k=j("react.legacy_hidden")}function C(L){if(typeof L=="object"&&L!==null){var $=L.$$typeof;switch($){case e:switch(L=L.type,L){case r:case a:case i:case f:case d:return L;default:switch(L=L&&L.$$typeof,L){case s:case c:case p:case m:case l:return L;default:return $}}case n:return $}}}var N=l,O=e,T=c,A=r,P=p,R=m,z=n,D=a,U=i,q=f;return lt.ContextConsumer=s,lt.ContextProvider=N,lt.Element=O,lt.ForwardRef=T,lt.Fragment=A,lt.Lazy=P,lt.Memo=R,lt.Portal=z,lt.Profiler=D,lt.StrictMode=U,lt.Suspense=q,lt.isAsyncMode=function(){return!1},lt.isConcurrentMode=function(){return!1},lt.isContextConsumer=function(L){return C(L)===s},lt.isContextProvider=function(L){return C(L)===l},lt.isElement=function(L){return typeof L=="object"&&L!==null&&L.$$typeof===e},lt.isForwardRef=function(L){return C(L)===c},lt.isFragment=function(L){return C(L)===r},lt.isLazy=function(L){return C(L)===p},lt.isMemo=function(L){return C(L)===m},lt.isPortal=function(L){return C(L)===n},lt.isProfiler=function(L){return C(L)===a},lt.isStrictMode=function(L){return C(L)===i},lt.isSuspense=function(L){return C(L)===f},lt.isValidElementType=function(L){return typeof L=="string"||typeof L=="function"||L===r||L===a||L===S||L===i||L===f||L===d||L===k||typeof L=="object"&&L!==null&&(L.$$typeof===p||L.$$typeof===m||L.$$typeof===l||L.$$typeof===s||L.$$typeof===c||L.$$typeof===_||L.$$typeof===y||L[0]===x)},lt.typeOf=C,lt}var zN;function Gie(){return zN||(zN=1,dy.exports=Hie()),dy.exports}Gie();var cD=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,hy={},IN;function Kie(){return IN||(IN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function n(r){var a;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const l=r[Symbol.toStringTag];return l==null||!((a=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&a.writable)?!1:r.toString()===`[object ${l}]`}let i=r;for(;Object.getPrototypeOf(i)!==null;)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(r)===i}e.isPlainObject=n})(hy)),hy}var my,$N;function Vie(){return $N||($N=1,my=Kie().isPlainObject),my}var Yie=Vie();const Wie=oi(Yie);var BN,FN,UN,qN,HN;function GN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function KN(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?GN(Object(r),!0).forEach(function(i){Xie(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xie(e,n,r){return(n=Zie(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Zie(e){var n=Qie(e,"string");return typeof n=="symbol"?n:n+""}function Qie(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Vh(){return Vh=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Vh.apply(null,arguments)}function Eu(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var VN=(e,n,r,i,a)=>{var l=r-i,s;return s=Et(BN||(BN=Eu(["M ",",",""])),e,n),s+=Et(FN||(FN=Eu(["L ",",",""])),e+r,n),s+=Et(UN||(UN=Eu(["L ",",",""])),e+r-l/2,n+a),s+=Et(qN||(qN=Eu(["L ",",",""])),e+r-l/2-i,n+a),s+=Et(HN||(HN=Eu(["L ",","," Z"])),e,n),s},Jie={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eae=e=>{var n=bn(e,Jie),{x:r,y:i,upperWidth:a,lowerWidth:l,height:s,className:c}=n,{animationEasing:f,animationDuration:d,animationBegin:m,isUpdateAnimationActive:p}=n,y=b.useRef(null),[x,_]=b.useState(-1),S=b.useRef(a),k=b.useRef(l),j=b.useRef(s),C=b.useRef(r),N=b.useRef(i),O=x1(e,"trapezoid-");if(b.useEffect(()=>{if(y.current&&y.current.getTotalLength)try{var $=y.current.getTotalLength();$&&_($)}catch{}},[]),r!==+r||i!==+i||a!==+a||l!==+l||s!==+s||a===0&&l===0||s===0)return null;var T=ot("recharts-trapezoid",c);if(!p)return b.createElement("g",null,b.createElement("path",Vh({},dn(n),{className:T,d:VN(r,i,a,l,s)})));var A=S.current,P=k.current,R=j.current,z=C.current,D=N.current,U="0px ".concat(x===-1?1:x,"px"),q="".concat(x,"px ").concat(x,"px"),L=lM(["strokeDasharray"],d,f);return b.createElement(y1,{animationId:O,key:O,canBegin:x>0,duration:d,easing:f,isActive:p,begin:m},$=>{var G=An(A,a,$),B=An(P,l,$),Y=An(R,s,$),ee=An(z,r,$),H=An(D,i,$);y.current&&(S.current=G,k.current=B,j.current=Y,C.current=ee,N.current=H);var re=$>0?{transition:L,strokeDasharray:q}:{strokeDasharray:U};return b.createElement("path",Vh({},dn(n),{className:T,d:VN(ee,H,G,B,Y),ref:y,style:KN(KN({},re),n.style)}))})},tae=["option","shapeType","activeClassName","inActiveClassName"];function nae(e,n){if(e==null)return{};var r,i,a=rae(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function rae(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function YN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Yh(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?YN(Object(r),!0).forEach(function(i){iae(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function iae(e,n,r){return(n=aae(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function aae(e){var n=lae(e,"string");return typeof n=="symbol"?n:n+""}function lae(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function oae(e,n){return Yh(Yh({},n),e)}function sae(e,n){return e==="symbols"}function WN(e){var{shapeType:n,elementProps:r}=e;switch(n){case"rectangle":return b.createElement(cM,r);case"trapezoid":return b.createElement(eae,r);case"sector":return b.createElement(hM,r);case"symbols":if(sae(n))return b.createElement(K3,r);break;case"curve":return b.createElement(aM,r);default:return null}}function uae(e){return b.isValidElement(e)?e.props:e}function cae(e){var{option:n,shapeType:r,activeClassName:i="recharts-active-shape",inActiveClassName:a="recharts-shape"}=e,l=nae(e,tae),s;if(b.isValidElement(n))s=b.cloneElement(n,Yh(Yh({},l),uae(n)));else if(typeof n=="function")s=n(l,l.index);else if(Wie(n)&&typeof n!="boolean"){var c=oae(n,l);s=b.createElement(WN,{shapeType:r,elementProps:c})}else{var f=l;s=b.createElement(WN,{shapeType:r,elementProps:f})}return l.isActive?b.createElement(ii,{className:i},s):b.createElement(ii,{className:a},s)}function fae(e){var{tooltipEntrySettings:n}=e,r=At(),i=wn(),a=b.useRef(null);return b.useLayoutEffect(()=>{i||(a.current===null?r(wte(n)):a.current!==n&&r(_te({prev:a.current,next:n})),a.current=n)},[n,r,i]),b.useLayoutEffect(()=>()=>{a.current&&(r(kte(a.current)),a.current=null)},[r]),null}function dae(e){var{legendPayload:n}=e,r=At(),i=wn(),a=b.useRef(null);return b.useLayoutEffect(()=>{i||(a.current===null?r(eQ(n)):a.current!==n&&r(tQ({prev:a.current,next:n})),a.current=n)},[r,i,n]),b.useLayoutEffect(()=>()=>{a.current&&(r(nQ(a.current)),a.current=null)},[r]),null}var py,hae=()=>{var[e]=b.useState(()=>Zu("uid-"));return e},mae=(py=H9.useId)!==null&&py!==void 0?py:hae;function pae(e,n){var r=mae();return n||(e?"".concat(e,"-").concat(r):r)}var gae=b.createContext(void 0),vae=e=>{var{id:n,type:r,children:i}=e,a=pae("recharts-".concat(r),n);return b.createElement(gae.Provider,{value:a},i(a))},yae={cartesianItems:[],polarItems:[]},fD=hn({name:"graphicalItems",initialState:yae,reducers:{addCartesianGraphicalItem:{reducer(e,n){e.cartesianItems.push(n.payload)},prepare:pt()},replaceCartesianGraphicalItem:{reducer(e,n){var{prev:r,next:i}=n.payload,a=xr(e).cartesianItems.indexOf(r);a>-1&&(e.cartesianItems[a]=i)},prepare:pt()},removeCartesianGraphicalItem:{reducer(e,n){var r=xr(e).cartesianItems.indexOf(n.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:pt()},addPolarGraphicalItem:{reducer(e,n){e.polarItems.push(n.payload)},prepare:pt()},removePolarGraphicalItem:{reducer(e,n){var r=xr(e).polarItems.indexOf(n.payload);r>-1&&e.polarItems.splice(r,1)},prepare:pt()},replacePolarGraphicalItem:{reducer(e,n){var{prev:r,next:i}=n.payload,a=xr(e).polarItems.indexOf(r);a>-1&&(e.polarItems[a]=i)},prepare:pt()}}}),{addCartesianGraphicalItem:xae,replaceCartesianGraphicalItem:bae,removeCartesianGraphicalItem:wae,addPolarGraphicalItem:Yde,removePolarGraphicalItem:Wde,replacePolarGraphicalItem:Xde}=fD.actions,_ae=fD.reducer,kae=e=>{var n=At(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?n(xae(e)):r.current!==e&&n(bae({prev:r.current,next:e})),r.current=e},[n,e]),b.useLayoutEffect(()=>()=>{r.current&&(n(wae(r.current)),r.current=null)},[n]),null},Sae=b.memo(kae),jae=["points"];function XN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function gy(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?XN(Object(r),!0).forEach(function(i){Eae(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Eae(e,n,r){return(n=Cae(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Cae(e){var n=Nae(e,"string");return typeof n=="symbol"?n:n+""}function Nae(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Wh(){return Wh=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Wh.apply(null,arguments)}function Oae(e,n){if(e==null)return{};var r,i,a=Aae(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Aae(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Tae(e){var{option:n,dotProps:r,className:i}=e;if(b.isValidElement(n))return b.cloneElement(n,r);if(typeof n=="function")return n(r);var a=ot(i,typeof n!="boolean"?n.className:""),l=r??{},{points:s}=l,c=Oae(l,jae);return b.createElement(sD,Wh({},c,{className:a}))}function Mae(e,n){return e==null?!1:n?!0:e.length===1}function Pae(e){var{points:n,dot:r,className:i,dotClassName:a,dataKey:l,baseProps:s,needClip:c,clipPathId:f,zIndex:d=fn.scatter}=e;if(!Mae(n,r))return null;var m=cD(r),p=KV(r),y=n.map((_,S)=>{var k,j,C=gy(gy(gy({r:3},s),p),{},{index:S,cx:(k=_.x)!==null&&k!==void 0?k:void 0,cy:(j=_.y)!==null&&j!==void 0?j:void 0,dataKey:l,value:_.value,payload:_.payload,points:n});return b.createElement(Tae,{key:"dot-".concat(S),option:r,dotProps:C,className:a})}),x={};return c&&f!=null&&(x.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(f,")")),b.createElement(fi,{zIndex:d},b.createElement(ii,Wh({className:i},x),y))}function ZN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function QN(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ZN(Object(r),!0).forEach(function(i){Dae(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Dae(e,n,r){return(n=Rae(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Rae(e){var n=Lae(e,"string");return typeof n=="symbol"?n:n+""}function Lae(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var zae={xAxis:{},yAxis:{},zAxis:{}},dD=hn({name:"cartesianAxis",initialState:zae,reducers:{addXAxis:{reducer(e,n){e.xAxis[n.payload.id]=n.payload},prepare:pt()},replaceXAxis:{reducer(e,n){var{prev:r,next:i}=n.payload;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=i)},prepare:pt()},removeXAxis:{reducer(e,n){delete e.xAxis[n.payload.id]},prepare:pt()},addYAxis:{reducer(e,n){e.yAxis[n.payload.id]=n.payload},prepare:pt()},replaceYAxis:{reducer(e,n){var{prev:r,next:i}=n.payload;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=i)},prepare:pt()},removeYAxis:{reducer(e,n){delete e.yAxis[n.payload.id]},prepare:pt()},addZAxis:{reducer(e,n){e.zAxis[n.payload.id]=n.payload},prepare:pt()},replaceZAxis:{reducer(e,n){var{prev:r,next:i}=n.payload;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=i)},prepare:pt()},removeZAxis:{reducer(e,n){delete e.zAxis[n.payload.id]},prepare:pt()},updateYAxisWidth(e,n){var{id:r,width:i}=n.payload,a=e.yAxis[r];if(a){var l,s=a.widthHistory||[];if(s.length===3&&s[0]===s[2]&&i===s[1]&&i!==a.width&&Math.abs(i-((l=s[0])!==null&&l!==void 0?l:0))<=1)return;var c=[...s,i].slice(-3);e.yAxis[r]=QN(QN({},a),{},{width:i,widthHistory:c})}}}}),{addXAxis:Iae,replaceXAxis:$ae,removeXAxis:Bae,addYAxis:Fae,replaceYAxis:Uae,removeYAxis:qae,addZAxis:Zde,replaceZAxis:Qde,removeZAxis:Jde,updateYAxisWidth:Hae}=dD.actions,Gae=dD.reducer,Kae=le([ln],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Vae=le([Kae,ta,na],(e,n,r)=>{if(!(!e||n==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,n-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),e2=()=>Ne(Vae),Yae=()=>Ne(wne);function JN(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function vy(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?JN(Object(r),!0).forEach(function(i){Wae(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JN(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Wae(e,n,r){return(n=Xae(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Xae(e){var n=Zae(e,"string");return typeof n=="symbol"?n:n+""}function Zae(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var Qae=e=>{var{point:n,childIndex:r,mainColor:i,activeDot:a,dataKey:l,clipPath:s}=e;if(a===!1||n.x==null||n.y==null)return null;var c={index:r,dataKey:l,cx:n.x,cy:n.y,r:4,fill:i??"none",strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value},f=vy(vy(vy({},c),wm(a)),a1(a)),d;return b.isValidElement(a)?d=b.cloneElement(a,f):typeof a=="function"?d=a(f):d=b.createElement(sD,f),b.createElement(ii,{className:"recharts-active-dot",clipPath:s},d)};function Jae(e){var{points:n,mainColor:r,activeDot:i,itemDataKey:a,clipPath:l,zIndex:s=fn.activeDot}=e,c=Ne(lc),f=Yae();if(n==null||f==null)return null;var d=n.find(m=>f.includes(m.payload));return Gt(d)?null:b.createElement(fi,{zIndex:s},b.createElement(Qae,{point:d,childIndex:Number(c),mainColor:r,dataKey:a,activeDot:i,clipPath:l}))}var ele=e=>{var{chartData:n}=e,r=At(),i=wn();return b.useEffect(()=>i?()=>{}:(r(vN(n)),()=>{r(vN(void 0))}),[n,r,i]),null},eO={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},hD=hn({name:"brush",initialState:eO,reducers:{setBrushSettings(e,n){return n.payload==null?eO:n.payload}}}),{setBrushSettings:ehe}=hD.actions,tle=hD.reducer,nle=(e,n)=>{var{x:r,y:i}=e,{x:a,y:l}=n;return{x:Math.min(r,a),y:Math.min(i,l),width:Math.abs(a-r),height:Math.abs(l-i)}},rle=e=>{var{x1:n,y1:r,x2:i,y2:a}=e;return nle({x:n,y:r},{x:i,y:a})};function ile(e){return(e%180+180)%180}var ale=function(n){var{width:r,height:i}=n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=ile(a),s=l*Math.PI/180,c=Math.atan(i/r),f=s>c&&s<Math.PI-c?i/Math.sin(s):r/Math.cos(s);return Math.abs(f)},lle={dots:[],areas:[],lines:[]},mD=hn({name:"referenceElements",initialState:lle,reducers:{addDot:(e,n)=>{e.dots.push(n.payload)},removeDot:(e,n)=>{var r=xr(e).dots.findIndex(i=>i===n.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,n)=>{e.areas.push(n.payload)},removeArea:(e,n)=>{var r=xr(e).areas.findIndex(i=>i===n.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,n)=>{e.lines.push(n.payload)},removeLine:(e,n)=>{var r=xr(e).lines.findIndex(i=>i===n.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:the,removeDot:nhe,addArea:rhe,removeArea:ihe,addLine:ole,removeLine:sle}=mD.actions,ule=mD.reducer,pD=b.createContext(void 0),cle=e=>{var{children:n}=e,[r]=b.useState("".concat(Zu("recharts"),"-clip")),i=e2();if(i==null)return null;var{x:a,y:l,width:s,height:c}=i;return b.createElement(pD.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:a,y:l,height:c,width:s}))),n)},fle=()=>b.useContext(pD);class dle{constructor(n){var{x:r,y:i}=n;this.xAxisScale=r,this.yAxisScale=i}map(n,r){var i,a,{position:l}=r;return{x:(i=this.xAxisScale.map(n.x,{position:l}))!==null&&i!==void 0?i:0,y:(a=this.yAxisScale.map(n.y,{position:l}))!==null&&a!==void 0?a:0}}mapWithFallback(n,r){var i,a,{position:l,fallback:s}=r,c,f;return s==="rangeMin"?c=this.yAxisScale.rangeMin():s==="rangeMax"?c=this.yAxisScale.rangeMax():c=0,s==="rangeMin"?f=this.xAxisScale.rangeMin():s==="rangeMax"?f=this.xAxisScale.rangeMax():f=0,{x:(i=this.xAxisScale.map(n.x,{position:l}))!==null&&i!==void 0?i:f,y:(a=this.yAxisScale.map(n.y,{position:l}))!==null&&a!==void 0?a:c}}isInRange(n){var{x:r,y:i}=n,a=r==null||this.xAxisScale.isInRange(r),l=i==null||this.yAxisScale.isInRange(i);return a&&l}}function tO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function nO(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?tO(Object(r),!0).forEach(function(i){hle(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function hle(e,n,r){return(n=mle(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function mle(e){var n=ple(e,"string");return typeof n=="symbol"?n:n+""}function ple(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Xh.apply(null,arguments)}var gle=(e,n)=>{var r;if(b.isValidElement(e))r=b.cloneElement(e,n);else if(typeof e=="function")r=e(n);else{if(!Fe(n.x1)||!Fe(n.y1)||!Fe(n.x2)||!Fe(n.y2))return null;r=b.createElement("line",Xh({},n,{className:"recharts-reference-line-line"}))}return r},vle=(e,n,r,i,a,l)=>{var{x:s,width:c}=l,f=a.map(e,{position:r});if(!Fe(f)||n==="discard"&&!a.isInRange(f))return null;var d=[{x:s+c,y:f},{x:s,y:f}];return i==="left"?d.reverse():d},yle=(e,n,r,i,a,l)=>{var{y:s,height:c}=l,f=a.map(e,{position:r});if(!Fe(f)||n==="discard"&&!a.isInRange(f))return null;var d=[{x:f,y:s+c},{x:f,y:s}];return i==="top"?d.reverse():d},xle=(e,n,r,i)=>{var a=[i.mapWithFallback(e[0],{position:r,fallback:"rangeMin"}),i.mapWithFallback(e[1],{position:r,fallback:"rangeMax"})];return n==="discard"&&a.some(l=>!i.isInRange(l))?null:a},ble=(e,n,r,i,a,l,s)=>{var{x:c,y:f,segment:d,ifOverflow:m}=s,p=br(c),y=br(f);return y?vle(f,m,i,l,n,r):p?yle(c,m,i,a,e,r):d!=null&&d.length===2?xle(d,m,i,new dle({x:e,y:n})):null};function wle(e){var n=At();return b.useEffect(()=>(n(ole(e)),()=>{n(sle(e))})),null}function _le(e){var{xAxisId:n,yAxisId:r,shape:i,className:a,ifOverflow:l}=e,s=wn(),c=fle(),f=Ne(P=>ui(P,n)),d=Ne(P=>ci(P,r)),m=Ne(P=>Xo(P,"xAxis",n,s)),p=Ne(P=>Xo(P,"yAxis",r,s)),y=Nc();if(!c||!y||f==null||d==null||m==null||p==null)return null;var x=ble(m,p,y,e.position,f.orientation,d.orientation,e);if(!x)return null;var _=x[0],S=x[1];if(_==null||S==null)return null;var{x:k,y:j}=_,{x:C,y:N}=S,O=l==="hidden"?"url(#".concat(c,")"):void 0,T=nO(nO({clipPath:O},dn(e)),{},{x1:k,y1:j,x2:C,y2:N}),A=rle({x1:k,y1:j,x2:C,y2:N});return b.createElement(fi,{zIndex:e.zIndex},b.createElement(ii,{className:ot("recharts-reference-line",a)},gle(i,T),b.createElement(rD,Xh({},A,{lowerWidth:A.width,upperWidth:A.width}),b.createElement(aD,{label:e.label}),e.children)))}var kle={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:fn.line};function Bx(e){var n=bn(e,kle);return b.createElement(b.Fragment,null,b.createElement(wle,{yAxisId:n.yAxisId,xAxisId:n.xAxisId,ifOverflow:n.ifOverflow,x:n.x,y:n.y,segment:n.segment}),b.createElement(_le,n))}Bx.displayName="ReferenceLine";function gD(e,n){if(n<1)return[];if(n===1)return e;for(var r=[],i=0;i<e.length;i+=n){var a=e[i];a!==void 0&&r.push(a)}return r}function Sle(e,n,r){var i={width:e.width+n.width,height:e.height+n.height};return ale(i,r)}function jle(e,n,r){var i=r==="width",{x:a,y:l,width:s,height:c}=e;return n===1?{start:i?a:l,end:i?a+s:l+c}:{start:i?a+s:l+c,end:i?a:l}}function sc(e,n,r,i,a){if(e*n<e*i||e*n>e*a)return!1;var l=r();return e*(n-e*l/2-i)>=0&&e*(n+e*l/2-a)<=0}function Ele(e,n){return gD(e,n+1)}function Cle(e,n,r,i,a){for(var l=(i||[]).slice(),{start:s,end:c}=n,f=0,d=1,m=s,p=function(){var _=i==null?void 0:i[f];if(_===void 0)return{v:gD(i,d)};var S=f,k,j=()=>(k===void 0&&(k=r(_,S)),k),C=_.coordinate,N=f===0||sc(e,C,j,m,c);N||(f=0,m=s,d+=1),N&&(m=C+e*(j()/2+a),f+=d)},y;d<=l.length;)if(y=p(),y)return y.v;return[]}function Nle(e,n,r,i,a){var l=(i||[]).slice(),s=l.length;if(s===0)return[];for(var{start:c,end:f}=n,d=1;d<=s;d++){for(var m=(s-1)%d,p=c,y=!0,x=function(){var O=i[S];if(O==null)return 0;var T=S,A,P=()=>(A===void 0&&(A=r(O,T)),A),R=O.coordinate,z=S===m||sc(e,R,P,p,f);if(!z)return y=!1,1;z&&(p=R+e*(P()/2+a))},_,S=m;S<s&&(_=x(),!(_!==0&&_===1));S+=d);if(y){for(var k=[],j=m;j<s;j+=d){var C=i[j];C!=null&&k.push(C)}return k}}return[]}function rO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function un(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?rO(Object(r),!0).forEach(function(i){Ole(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ole(e,n,r){return(n=Ale(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Ale(e){var n=Tle(e,"string");return typeof n=="symbol"?n:n+""}function Tle(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Mle(e,n,r,i,a){for(var l=(i||[]).slice(),s=l.length,{start:c}=n,{end:f}=n,d=function(y){var x=l[y];if(x==null)return 1;var _=x,S,k=()=>(S===void 0&&(S=r(x,y)),S);if(y===s-1){var j=e*(_.coordinate+e*k()/2-f);l[y]=_=un(un({},_),{},{tickCoord:j>0?_.coordinate-j*e:_.coordinate})}else l[y]=_=un(un({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var C=sc(e,_.tickCoord,k,c,f);C&&(f=_.tickCoord-e*(k()/2+a),l[y]=un(un({},_),{},{isShow:!0}))}},m=s-1;m>=0;m--)d(m);return l}function Ple(e,n,r,i,a,l){var s=(i||[]).slice(),c=s.length,{start:f,end:d}=n;if(l){var m=i[c-1];if(m!=null){var p=r(m,c-1),y=e*(m.coordinate+e*p/2-d);if(s[c-1]=m=un(un({},m),{},{tickCoord:y>0?m.coordinate-y*e:m.coordinate}),m.tickCoord!=null){var x=sc(e,m.tickCoord,()=>p,f,d);x&&(d=m.tickCoord-e*(p/2+a),s[c-1]=un(un({},m),{},{isShow:!0}))}}}for(var _=l?c-1:c,S=function(C){var N=s[C];if(N==null)return 1;var O=N,T,A=()=>(T===void 0&&(T=r(N,C)),T);if(C===0){var P=e*(O.coordinate-e*A()/2-f);s[C]=O=un(un({},O),{},{tickCoord:P<0?O.coordinate-P*e:O.coordinate})}else s[C]=O=un(un({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var R=sc(e,O.tickCoord,A,f,d);R&&(f=O.tickCoord+e*(A()/2+a),s[C]=un(un({},O),{},{isShow:!0}))}},k=0;k<_;k++)S(k);return s}function t2(e,n,r){var{tick:i,ticks:a,viewBox:l,minTickGap:s,orientation:c,interval:f,tickFormatter:d,unit:m,angle:p}=e;if(!a||!a.length||!i)return[];if(Ce(f)||Tc.isSsr){var y;return(y=Ele(a,Ce(f)?f:0))!==null&&y!==void 0?y:[]}var x=[],_=c==="top"||c==="bottom"?"width":"height",S=m&&_==="width"?Uu(m,{fontSize:n,letterSpacing:r}):{width:0,height:0},k=(T,A)=>{var P=typeof d=="function"?d(T.value,A):T.value;return _==="width"?Sle(Uu(P,{fontSize:n,letterSpacing:r}),S,p):Uu(P,{fontSize:n,letterSpacing:r})[_]},j=a[0],C=a[1],N=a.length>=2&&j!=null&&C!=null?yr(C.coordinate-j.coordinate):1,O=jle(l,N,_);return f==="equidistantPreserveStart"?Cle(N,O,k,a,s):f==="equidistantPreserveEnd"?Nle(N,O,k,a,s):(f==="preserveStart"||f==="preserveStartEnd"?x=Ple(N,O,k,a,s,f==="preserveStartEnd"):x=Mle(N,O,k,a,s),x.filter(T=>T.isShow))}var Dle=e=>{var{ticks:n,label:r,labelGapWithTick:i=5,tickSize:a=0,tickMargin:l=0}=e,s=0;if(n){Array.from(n).forEach(m=>{if(m){var p=m.getBoundingClientRect();p.width>s&&(s=p.width)}});var c=r?r.getBoundingClientRect().width:0,f=a+l,d=s+f+c+(r?i:0);return Math.round(d)}return 0},Rle={xAxis:{},yAxis:{}},vD=hn({name:"renderedTicks",initialState:Rle,reducers:{setRenderedTicks:(e,n)=>{var{axisType:r,axisId:i,ticks:a}=n.payload;e[r][i]=a},removeRenderedTicks:(e,n)=>{var{axisType:r,axisId:i}=n.payload;delete e[r][i]}}}),{setRenderedTicks:Lle,removeRenderedTicks:zle}=vD.actions,Ile=vD.reducer,$le=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Ble(e,n){if(e==null)return{};var r,i,a=Fle(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Fle(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Dl(){return Dl=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Dl.apply(null,arguments)}function iO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function jt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?iO(Object(r),!0).forEach(function(i){Ule(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ule(e,n,r){return(n=qle(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function qle(e){var n=Hle(e,"string");return typeof n=="symbol"?n:n+""}function Hle(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var qi={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",zIndex:fn.axis};function Gle(e){var{x:n,y:r,width:i,height:a,orientation:l,mirror:s,axisLine:c,otherSvgProps:f}=e;if(!c)return null;var d=jt(jt(jt({},f),ri(c)),{},{fill:"none"});if(l==="top"||l==="bottom"){var m=+(l==="top"&&!s||l==="bottom"&&s);d=jt(jt({},d),{},{x1:n,y1:r+m*a,x2:n+i,y2:r+m*a})}else{var p=+(l==="left"&&!s||l==="right"&&s);d=jt(jt({},d),{},{x1:n+p*i,y1:r,x2:n+p*i,y2:r+a})}return b.createElement("line",Dl({},d,{className:ot("recharts-cartesian-axis-line",jm(c,"className"))}))}function Kle(e,n,r,i,a,l,s,c,f){var d,m,p,y,x,_,S=c?-1:1,k=e.tickSize||s,j=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(l){case"top":d=m=e.coordinate,y=r+ +!c*a,p=y-S*k,_=p-S*f,x=j;break;case"left":p=y=e.coordinate,m=n+ +!c*i,d=m-S*k,x=d-S*f,_=j;break;case"right":p=y=e.coordinate,m=n+ +c*i,d=m+S*k,x=d+S*f,_=j;break;default:d=m=e.coordinate,y=r+ +c*a,p=y+S*k,_=p+S*f,x=j;break}return{line:{x1:d,y1:p,x2:m,y2:y},tick:{x,y:_}}}function Vle(e,n){switch(e){case"left":return n?"start":"end";case"right":return n?"end":"start";default:return"middle"}}function Yle(e,n){switch(e){case"left":case"right":return"middle";case"top":return n?"start":"end";default:return n?"end":"start"}}function Wle(e){var{option:n,tickProps:r,value:i}=e,a,l=ot(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(n))a=b.cloneElement(n,jt(jt({},r),{},{className:l}));else if(typeof n=="function")a=n(jt(jt({},r),{},{className:l}));else{var s="recharts-cartesian-axis-tick-value";typeof n!="boolean"&&(s=ot(s,qie(n))),a=b.createElement(Q1,Dl({},r,{className:s}),i)}return a}function Xle(e){var{ticks:n,axisType:r,axisId:i}=e,a=At();return b.useEffect(()=>{if(i==null||r==null)return zl;var l=n.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return a(Lle({ticks:l,axisId:i,axisType:r})),()=>{a(zle({axisId:i,axisType:r}))}},[a,n,i,r]),null}var Zle=b.forwardRef((e,n)=>{var{ticks:r=[],tick:i,tickLine:a,stroke:l,tickFormatter:s,unit:c,padding:f,tickTextProps:d,orientation:m,mirror:p,x:y,y:x,width:_,height:S,tickSize:k,tickMargin:j,fontSize:C,letterSpacing:N,getTicksConfig:O,events:T,axisType:A,axisId:P}=e,R=t2(jt(jt({},O),{},{ticks:r}),C,N),z=ri(O),D=wm(i),U=QP(z.textAnchor)?z.textAnchor:Vle(m,p),q=Yle(m,p),L={};typeof a=="object"&&(L=a);var $=jt(jt({},z),{},{fill:"none"},L),G=R.map(ee=>jt({entry:ee},Kle(ee,y,x,_,S,m,k,p,j))),B=G.map(ee=>{var{entry:H,line:re}=ee;return b.createElement(ii,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},a&&b.createElement("line",Dl({},$,re,{className:ot("recharts-cartesian-axis-tick-line",jm(a,"className"))})))}),Y=G.map((ee,H)=>{var re,F,{entry:X,tick:ae}=ee,se=jt(jt(jt(jt({verticalAnchor:q},z),{},{textAnchor:U,stroke:"none",fill:l},ae),{},{index:H,payload:X,visibleTicksCount:R.length,tickFormatter:s,padding:f},d),{},{angle:(re=(F=d==null?void 0:d.angle)!==null&&F!==void 0?F:z.angle)!==null&&re!==void 0?re:0}),ve=jt(jt({},se),D);return b.createElement(ii,Dl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(X.value,"-").concat(X.coordinate,"-").concat(X.tickCoord)},XY(T,X,H)),i&&b.createElement(Wle,{option:i,tickProps:ve,value:"".concat(typeof s=="function"?s(X.value,H):X.value).concat(c||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},b.createElement(Xle,{ticks:R,axisId:P,axisType:A}),Y.length>0&&b.createElement(fi,{zIndex:fn.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:n},Y)),B.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},B))}),Qle=b.forwardRef((e,n)=>{var{axisLine:r,width:i,height:a,className:l,hide:s,ticks:c,axisType:f,axisId:d}=e,m=Ble(e,$le),[p,y]=b.useState(""),[x,_]=b.useState(""),S=b.useRef(null);b.useImperativeHandle(n,()=>({getCalculatedWidth:()=>{var j;return Dle({ticks:S.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var k=b.useCallback(j=>{if(j){var C=j.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=C;var N=C[0];if(N){var O=window.getComputedStyle(N),T=O.fontSize,A=O.letterSpacing;(T!==p||A!==x)&&(y(T),_(A))}}},[p,x]);return s||i!=null&&i<=0||a!=null&&a<=0?null:b.createElement(fi,{zIndex:e.zIndex},b.createElement(ii,{className:ot("recharts-cartesian-axis",l)},b.createElement(Gle,{x:e.x,y:e.y,width:i,height:a,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ri(e)}),b.createElement(Zle,{ref:k,axisType:f,events:m,fontSize:p,getTicksConfig:e,height:e.height,letterSpacing:x,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:d}),b.createElement(rD,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(aD,{label:e.label,labelRef:e.labelRef}),e.children)))}),n2=b.forwardRef((e,n)=>{var r=bn(e,qi);return b.createElement(Qle,Dl({},r,{ref:n}))});n2.displayName="CartesianAxis";var Jle=["x1","y1","x2","y2","key"],eoe=["offset"],toe=["xAxisId","yAxisId"],noe=["xAxisId","yAxisId"];function aO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function cn(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?aO(Object(r),!0).forEach(function(i){roe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function roe(e,n,r){return(n=ioe(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ioe(e){var n=aoe(e,"string");return typeof n=="symbol"?n:n+""}function aoe(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},wl.apply(null,arguments)}function Zh(e,n){if(e==null)return{};var r,i,a=loe(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function loe(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var ooe=e=>{var{fill:n}=e;if(!n||n==="none")return null;var{fillOpacity:r,x:i,y:a,width:l,height:s,ry:c}=e;return b.createElement("rect",{x:i,y:a,ry:c,width:l,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function yD(e){var{option:n,lineItemProps:r}=e,i;if(b.isValidElement(n))i=b.cloneElement(n,r);else if(typeof n=="function")i=n(r);else{var a,{x1:l,y1:s,x2:c,y2:f,key:d}=r,m=Zh(r,Jle),p=(a=ri(m))!==null&&a!==void 0?a:{},{offset:y}=p,x=Zh(p,eoe);i=b.createElement("line",wl({},x,{x1:l,y1:s,x2:c,y2:f,fill:"none",key:d}))}return i}function soe(e){var{x:n,width:r,horizontal:i=!0,horizontalPoints:a}=e;if(!i||!a||!a.length)return null;var{xAxisId:l,yAxisId:s}=e,c=Zh(e,toe),f=a.map((d,m)=>{var p=cn(cn({},c),{},{x1:n,y1:d,x2:n+r,y2:d,key:"line-".concat(m),index:m});return b.createElement(yD,{key:"line-".concat(m),option:i,lineItemProps:p})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function uoe(e){var{y:n,height:r,vertical:i=!0,verticalPoints:a}=e;if(!i||!a||!a.length)return null;var{xAxisId:l,yAxisId:s}=e,c=Zh(e,noe),f=a.map((d,m)=>{var p=cn(cn({},c),{},{x1:d,y1:n,x2:d,y2:n+r,key:"line-".concat(m),index:m});return b.createElement(yD,{option:i,lineItemProps:p,key:"line-".concat(m)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function coe(e){var{horizontalFill:n,fillOpacity:r,x:i,y:a,width:l,height:s,horizontalPoints:c,horizontal:f=!0}=e;if(!f||!n||!n.length||c==null)return null;var d=c.map(p=>Math.round(p+a-a)).sort((p,y)=>p-y);a!==d[0]&&d.unshift(0);var m=d.map((p,y)=>{var x=d[y+1],_=x==null,S=_?a+s-p:x-p;if(S<=0)return null;var k=y%n.length;return b.createElement("rect",{key:"react-".concat(y),y:p,x:i,height:S,width:l,stroke:"none",fill:n[k],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function foe(e){var{vertical:n=!0,verticalFill:r,fillOpacity:i,x:a,y:l,width:s,height:c,verticalPoints:f}=e;if(!n||!r||!r.length)return null;var d=f.map(p=>Math.round(p+a-a)).sort((p,y)=>p-y);a!==d[0]&&d.unshift(0);var m=d.map((p,y)=>{var x=d[y+1],_=x==null,S=_?a+s-p:x-p;if(S<=0)return null;var k=y%r.length;return b.createElement("rect",{key:"react-".concat(y),x:p,y:l,width:S,height:c,stroke:"none",fill:r[k],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var doe=(e,n)=>{var{xAxis:r,width:i,height:a,offset:l}=e;return zT(t2(cn(cn(cn({},qi),r),{},{ticks:IT(r),viewBox:{x:0,y:0,width:i,height:a}})),l.left,l.left+l.width,n)},hoe=(e,n)=>{var{yAxis:r,width:i,height:a,offset:l}=e;return zT(t2(cn(cn(cn({},qi),r),{},{ticks:IT(r),viewBox:{x:0,y:0,width:i,height:a}})),l.top,l.top+l.height,n)},moe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:fn.grid};function xD(e){var n=KT(),r=VT(),i=GT(),a=cn(cn({},bn(e,moe)),{},{x:Ce(e.x)?e.x:i.left,y:Ce(e.y)?e.y:i.top,width:Ce(e.width)?e.width:i.width,height:Ce(e.height)?e.height:i.height}),{xAxisId:l,yAxisId:s,x:c,y:f,width:d,height:m,syncWithTicks:p,horizontalValues:y,verticalValues:x}=a,_=wn(),S=Ne(z=>iN(z,"xAxis",l,_)),k=Ne(z=>iN(z,"yAxis",s,_));if(!ai(d)||!ai(m)||!Ce(c)||!Ce(f))return null;var j=a.verticalCoordinatesGenerator||doe,C=a.horizontalCoordinatesGenerator||hoe,{horizontalPoints:N,verticalPoints:O}=a;if((!N||!N.length)&&typeof C=="function"){var T=y&&y.length,A=C({yAxis:k?cn(cn({},k),{},{ticks:T?y:k.ticks}):void 0,width:n??d,height:r??m,offset:i},T?!0:p);Th(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(N=A)}if((!O||!O.length)&&typeof j=="function"){var P=x&&x.length,R=j({xAxis:S?cn(cn({},S),{},{ticks:P?x:S.ticks}):void 0,width:n??d,height:r??m,offset:i},P?!0:p);Th(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(O=R)}return b.createElement(fi,{zIndex:a.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(ooe,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),b.createElement(coe,wl({},a,{horizontalPoints:N})),b.createElement(foe,wl({},a,{verticalPoints:O})),b.createElement(soe,wl({},a,{offset:i,horizontalPoints:N,xAxis:S,yAxis:k})),b.createElement(uoe,wl({},a,{offset:i,verticalPoints:O,xAxis:S,yAxis:k}))))}xD.displayName="CartesianGrid";var poe={},bD=hn({name:"errorBars",initialState:poe,reducers:{addErrorBar:(e,n)=>{var{itemId:r,errorBar:i}=n.payload;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,n)=>{var{itemId:r,prev:i,next:a}=n.payload;e[r]&&(e[r]=e[r].map(l=>l.dataKey===i.dataKey&&l.direction===i.direction?a:l))},removeErrorBar:(e,n)=>{var{itemId:r,errorBar:i}=n.payload;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),{addErrorBar:ahe,replaceErrorBar:lhe,removeErrorBar:ohe}=bD.actions,goe=bD.reducer,voe=["children"];function yoe(e,n){if(e==null)return{};var r,i,a=xoe(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function xoe(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var boe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},woe=b.createContext(boe);function _oe(e){var{children:n}=e,r=yoe(e,voe);return b.createElement(woe.Provider,{value:r},n)}function wD(e,n){var r,i,a=Ne(d=>ui(d,e)),l=Ne(d=>ci(d,n)),s=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:zt.allowDataOverflow,c=(i=l==null?void 0:l.allowDataOverflow)!==null&&i!==void 0?i:It.allowDataOverflow,f=s||c;return{needClip:f,needClipX:s,needClipY:c}}function koe(e){var{xAxisId:n,yAxisId:r,clipPathId:i}=e,a=e2(),{needClipX:l,needClipY:s,needClip:c}=wD(n,r);if(!c||!a)return null;var{x:f,y:d,width:m,height:p}=a;return b.createElement("clipPath",{id:"clipPath-".concat(i)},b.createElement("rect",{x:l?f:f-m/2,y:s?d:d-p/2,width:l?m:m*2,height:s?p:p*2}))}var _D=(e,n,r,i)=>yP(e,"xAxis",n,i),kD=(e,n,r,i)=>vP(e,"xAxis",n,i),SD=(e,n,r,i)=>yP(e,"yAxis",r,i),jD=(e,n,r,i)=>vP(e,"yAxis",r,i),Soe=le([_t,_D,SD,kD,jD],(e,n,r,i,a)=>ea(e,"xAxis")?Ah(n,i,!1):Ah(r,a,!1)),joe=(e,n,r,i,a)=>a;function Eoe(e){return e.type==="line"}var Coe=le([FM,joe],(e,n)=>e.filter(Eoe).find(r=>r.id===n)),Noe=le([_t,_D,SD,kD,jD,Coe,Soe,b1],(e,n,r,i,a,l,s,c)=>{var{chartData:f,dataStartIndex:d,dataEndIndex:m}=c;if(!(l==null||n==null||r==null||i==null||a==null||i.length===0||a.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:y}=l,x;if(y!=null&&y.length>0?x=y:x=f==null?void 0:f.slice(d,m+1),x!=null)return Woe({layout:e,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:p,bandSize:s,displayedData:x})}});function Ooe(e){var n=wm(e),r=3,i=2;if(n!=null){var{r:a,strokeWidth:l}=n,s=Number(a),c=Number(l);return(Number.isNaN(s)||s<0)&&(s=r),(Number.isNaN(c)||c<0)&&(c=i),{r:s,strokeWidth:c}}return{r,strokeWidth:i}}var Aoe=["id"],Toe=["type","layout","connectNulls","needClip","shape"],Moe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},uc.apply(null,arguments)}function lO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Kr(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?lO(Object(r),!0).forEach(function(i){Poe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Poe(e,n,r){return(n=Doe(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Doe(e){var n=Roe(e,"string");return typeof n=="symbol"?n:n+""}function Roe(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function r2(e,n){if(e==null)return{};var r,i,a=Loe(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Loe(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var zoe=e=>{var{dataKey:n,name:r,stroke:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:n,type:a,color:i,value:$T(r,n),payload:e}]},Ioe=b.memo(e=>{var{dataKey:n,data:r,stroke:i,strokeWidth:a,fill:l,name:s,hide:c,unit:f,tooltipType:d,id:m}=e,p={dataDefinedOnItem:r,getPosition:zl,settings:{stroke:i,strokeWidth:a,fill:l,dataKey:n,nameKey:void 0,name:$T(s,n),hide:c,type:d,color:i,unit:f,graphicalItemId:m}};return b.createElement(fae,{tooltipEntrySettings:p})}),ED=(e,n)=>"".concat(n,"px ").concat(e,"px");function $oe(e,n){for(var r=e.length%2!==0?[...e,0]:e,i=[],a=0;a<n;++a)i.push(...r);return i}var Boe=(e,n,r)=>{var i=r.reduce((y,x)=>y+x,0);if(!i)return ED(n,e);for(var a=Math.floor(e/i),l=e%i,s=[],c=0,f=0;c<r.length;f+=(d=r[c])!==null&&d!==void 0?d:0,++c){var d,m=r[c];if(m!=null&&f+m>l){s=[...r.slice(0,c),l-f];break}}var p=s.length%2===0?[0,n]:[n];return[...$oe(r,a),...s,...p].map(y=>"".concat(y,"px")).join(", ")};function Foe(e){var{clipPathId:n,points:r,props:i}=e,{dot:a,dataKey:l,needClip:s}=i,{id:c}=i,f=r2(i,Aoe),d=ri(f);return b.createElement(Pae,{points:r,dot:a,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:l,baseProps:d,needClip:s,clipPathId:n})}function Uoe(e){var{showLabels:n,children:r,points:i}=e,a=b.useMemo(()=>i==null?void 0:i.map(l=>{var s,c,f={x:(s=l.x)!==null&&s!==void 0?s:0,y:(c=l.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Kr(Kr({},f),{},{value:l.value,payload:l.payload,viewBox:f,parentViewBox:void 0,fill:void 0})}),[i]);return b.createElement(zie,{value:n?a:void 0},r)}function oO(e){var{clipPathId:n,pathRef:r,points:i,strokeDasharray:a,props:l}=e,{type:s,layout:c,connectNulls:f,needClip:d,shape:m}=l,p=r2(l,Toe),y=Kr(Kr({},dn(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(n,")"):void 0,points:i,type:s,layout:c,connectNulls:f,strokeDasharray:a??l.strokeDasharray});return b.createElement(b.Fragment,null,(i==null?void 0:i.length)>1&&b.createElement(cae,uc({shapeType:"curve",option:m},y,{pathRef:r})),b.createElement(Foe,{points:i,clipPathId:n,props:l}))}function qoe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Hoe(e){var{clipPathId:n,props:r,pathRef:i,previousPointsRef:a,longestAnimatedLengthRef:l}=e,{points:s,strokeDasharray:c,isAnimationActive:f,animationBegin:d,animationDuration:m,animationEasing:p,animateNewValues:y,width:x,height:_,onAnimationEnd:S,onAnimationStart:k}=r,j=a.current,C=x1(s,"recharts-line-"),N=b.useRef(C),[O,T]=b.useState(!1),A=!O,P=b.useCallback(()=>{typeof S=="function"&&S(),T(!1)},[S]),R=b.useCallback(()=>{typeof k=="function"&&k(),T(!0)},[k]),z=qoe(i.current),D=b.useRef(0);N.current!==C&&(D.current=l.current,N.current=C);var U=D.current;return b.createElement(Uoe,{points:s,showLabels:A},r.children,b.createElement(y1,{animationId:C,begin:d,duration:m,isActive:f,easing:p,onAnimationEnd:P,onAnimationStart:R,key:C},q=>{var L=An(U,z+U,q),$=Math.min(L,z),G;if(f)if(c){var B="".concat(c).split(/[,\s]+/gim).map(H=>parseFloat(H));G=Boe($,z,B)}else G=ED(z,$);else G=c==null?void 0:String(c);if(q>0&&z>0&&(a.current=s,l.current=Math.max(l.current,$)),j){var Y=j.length/s.length,ee=q===1?s:s.map((H,re)=>{var F=Math.floor(re*Y);if(j[F]){var X=j[F];return Kr(Kr({},H),{},{x:An(X.x,H.x,q),y:An(X.y,H.y,q)})}return y?Kr(Kr({},H),{},{x:An(x*2,H.x,q),y:An(_/2,H.y,q)}):Kr(Kr({},H),{},{x:H.x,y:H.y})});return a.current=ee,b.createElement(oO,{props:r,points:ee,clipPathId:n,pathRef:i,strokeDasharray:G})}return b.createElement(oO,{props:r,points:s,clipPathId:n,pathRef:i,strokeDasharray:G})}),b.createElement(Bie,{label:r.label}))}function Goe(e){var{clipPathId:n,props:r}=e,i=b.useRef(null),a=b.useRef(0),l=b.useRef(null);return b.createElement(Hoe,{props:r,clipPathId:n,previousPointsRef:i,longestAnimatedLengthRef:a,pathRef:l})}var Koe=(e,n)=>{var r,i;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(i=e.y)!==null&&i!==void 0?i:void 0,value:e.value,errorVal:rn(e.payload,n)}};class Voe extends b.Component{render(){var{hide:n,dot:r,points:i,className:a,xAxisId:l,yAxisId:s,top:c,left:f,width:d,height:m,id:p,needClip:y,zIndex:x}=this.props;if(n)return null;var _=ot("recharts-line",a),S=p,{r:k,strokeWidth:j}=Ooe(r),C=cD(r),N=k*2+j,O=y?"url(#clipPath-".concat(C?"":"dots-").concat(S,")"):void 0;return b.createElement(fi,{zIndex:x},b.createElement(ii,{className:_},y&&b.createElement("defs",null,b.createElement(koe,{clipPathId:S,xAxisId:l,yAxisId:s}),!C&&b.createElement("clipPath",{id:"clipPath-dots-".concat(S)},b.createElement("rect",{x:f-N/2,y:c-N/2,width:d+N,height:m+N}))),b.createElement(_oe,{xAxisId:l,yAxisId:s,data:i,dataPointFormatter:Koe,errorBarOffset:0},b.createElement(Goe,{props:this.props,clipPathId:S}))),b.createElement(Jae,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:O}))}}var CD={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:fn.line,type:"linear"};function Yoe(e){var n=bn(e,CD),{activeDot:r,animateNewValues:i,animationBegin:a,animationDuration:l,animationEasing:s,connectNulls:c,dot:f,hide:d,isAnimationActive:m,label:p,legendType:y,xAxisId:x,yAxisId:_,id:S}=n,k=r2(n,Moe),{needClip:j}=wD(x,_),C=e2(),N=rs(),O=wn(),T=Ne(D=>Noe(D,x,_,O,S));if(N!=="horizontal"&&N!=="vertical"||T==null||C==null)return null;var{height:A,width:P,x:R,y:z}=C;return b.createElement(Voe,uc({},k,{id:S,connectNulls:c,dot:f,activeDot:r,animateNewValues:i,animationBegin:a,animationDuration:l,animationEasing:s,isAnimationActive:m,hide:d,label:p,legendType:y,xAxisId:x,yAxisId:_,points:T,layout:N,height:A,width:P,left:R,top:z,needClip:j}))}function Woe(e){var{layout:n,xAxis:r,yAxis:i,xAxisTicks:a,yAxisTicks:l,dataKey:s,bandSize:c,displayedData:f}=e;return f.map((d,m)=>{var p=rn(d,s);if(n==="horizontal"){var y=z5({axis:r,ticks:a,bandSize:c,entry:d,index:m}),x=Gt(p)?null:i.scale.map(p);return{x:y,y:x??null,value:p,payload:d}}var _=Gt(p)?null:r.scale.map(p),S=z5({axis:i,ticks:l,bandSize:c,entry:d,index:m});return _==null||S==null?null:{x:_,y:S,value:p,payload:d}}).filter(Boolean)}function Xoe(e){var n=bn(e,CD),r=wn();return b.createElement(vae,{id:n.id,type:"line"},i=>b.createElement(b.Fragment,null,b.createElement(dae,{legendPayload:zoe(n)}),b.createElement(Ioe,{dataKey:n.dataKey,data:n.data,stroke:n.stroke,strokeWidth:n.strokeWidth,fill:n.fill,name:n.name,hide:n.hide,unit:n.unit,tooltipType:n.tooltipType,id:i}),b.createElement(Sae,{type:"line",id:i,data:n.data,xAxisId:n.xAxisId,yAxisId:n.yAxisId,zAxisId:0,dataKey:n.dataKey,hide:n.hide,isPanorama:r}),b.createElement(Yoe,uc({},n,{id:i}))))}var ND=b.memo(Xoe,qm);ND.displayName="Line";var Zoe=["domain","range"],Qoe=["domain","range"];function sO(e,n){if(e==null)return{};var r,i,a=Joe(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Joe(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function uO(e,n){return e===n?!0:Array.isArray(e)&&e.length===2&&Array.isArray(n)&&n.length===2?e[0]===n[0]&&e[1]===n[1]:!1}function OD(e,n){if(e===n)return!0;var{domain:r,range:i}=e,a=sO(e,Zoe),{domain:l,range:s}=n,c=sO(n,Qoe);return!uO(r,l)||!uO(i,s)?!1:qm(a,c)}var ese=["type"],tse=["dangerouslySetInnerHTML","ticks","scale"],nse=["id","scale"];function Fx(){return Fx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Fx.apply(null,arguments)}function cO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function fO(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?cO(Object(r),!0).forEach(function(i){rse(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function rse(e,n,r){return(n=ise(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ise(e){var n=ase(e,"string");return typeof n=="symbol"?n:n+""}function ase(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ux(e,n){if(e==null)return{};var r,i,a=lse(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function lse(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function ose(e){var n=At(),r=b.useRef(null),i=YT(),{type:a}=e,l=Ux(e,ese),s=Km(i,"xAxis",a),c=b.useMemo(()=>{if(s!=null)return fO(fO({},l),{},{type:s})},[l,s]);return b.useLayoutEffect(()=>{c!=null&&(r.current===null?n(Iae(c)):r.current!==c&&n($ae({prev:r.current,next:c})),r.current=c)},[c,n]),b.useLayoutEffect(()=>()=>{r.current&&(n(Bae(r.current)),r.current=null)},[n]),null}var sse=e=>{var{xAxisId:n,className:r}=e,i=Ne(FT),a=wn(),l="xAxis",s=Ne(j=>gP(j,l,n,a)),c=Ne(j=>nte(j,n)),f=Ne(j=>ste(j,n)),d=Ne(j=>zM(j,n));if(c==null||f==null||d==null)return null;var{dangerouslySetInnerHTML:m,ticks:p,scale:y}=e,x=Ux(e,tse),{id:_,scale:S}=d,k=Ux(d,nse);return b.createElement(n2,Fx({},x,k,{x:f.x,y:f.y,width:c.width,height:c.height,className:ot("recharts-".concat(l," ").concat(l),r),viewBox:i,ticks:s,axisType:l,axisId:n}))},use={allowDataOverflow:zt.allowDataOverflow,allowDecimals:zt.allowDecimals,allowDuplicatedCategory:zt.allowDuplicatedCategory,angle:zt.angle,axisLine:qi.axisLine,height:zt.height,hide:!1,includeHidden:zt.includeHidden,interval:zt.interval,label:!1,minTickGap:zt.minTickGap,mirror:zt.mirror,orientation:zt.orientation,padding:zt.padding,reversed:zt.reversed,scale:zt.scale,tick:zt.tick,tickCount:zt.tickCount,tickLine:qi.tickLine,tickSize:qi.tickSize,type:zt.type,niceTicks:zt.niceTicks,xAxisId:0},cse=e=>{var n=bn(e,use);return b.createElement(b.Fragment,null,b.createElement(ose,{allowDataOverflow:n.allowDataOverflow,allowDecimals:n.allowDecimals,allowDuplicatedCategory:n.allowDuplicatedCategory,angle:n.angle,dataKey:n.dataKey,domain:n.domain,height:n.height,hide:n.hide,id:n.xAxisId,includeHidden:n.includeHidden,interval:n.interval,minTickGap:n.minTickGap,mirror:n.mirror,name:n.name,orientation:n.orientation,padding:n.padding,reversed:n.reversed,scale:n.scale,tick:n.tick,tickCount:n.tickCount,tickFormatter:n.tickFormatter,ticks:n.ticks,type:n.type,unit:n.unit,niceTicks:n.niceTicks}),b.createElement(sse,n))},AD=b.memo(cse,OD);AD.displayName="XAxis";var fse=["type"],dse=["dangerouslySetInnerHTML","ticks","scale"],hse=["id","scale"];function qx(){return qx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},qx.apply(null,arguments)}function dO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function hO(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?dO(Object(r),!0).forEach(function(i){mse(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function mse(e,n,r){return(n=pse(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function pse(e){var n=gse(e,"string");return typeof n=="symbol"?n:n+""}function gse(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Hx(e,n){if(e==null)return{};var r,i,a=vse(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function vse(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function yse(e){var n=At(),r=b.useRef(null),i=YT(),{type:a}=e,l=Hx(e,fse),s=Km(i,"yAxis",a),c=b.useMemo(()=>{if(s!=null)return hO(hO({},l),{},{type:s})},[s,l]);return b.useLayoutEffect(()=>{c!=null&&(r.current===null?n(Fae(c)):r.current!==c&&n(Uae({prev:r.current,next:c})),r.current=c)},[c,n]),b.useLayoutEffect(()=>()=>{r.current&&(n(qae(r.current)),r.current=null)},[n]),null}function xse(e){var{yAxisId:n,className:r,width:i,label:a}=e,l=b.useRef(null),s=b.useRef(null),c=Ne(FT),f=wn(),d=At(),m="yAxis",p=Ne(A=>fte(A,n)),y=Ne(A=>cte(A,n)),x=Ne(A=>gP(A,m,n,f)),_=Ne(A=>IM(A,n));if(b.useLayoutEffect(()=>{if(!(i!=="auto"||!p||J1(a)||b.isValidElement(a)||_==null)){var A=l.current;if(A){var P=A.getCalculatedWidth();Math.round(p.width)!==Math.round(P)&&d(Hae({id:n,width:P}))}}},[x,p,d,a,n,i,_]),p==null||y==null||_==null)return null;var{dangerouslySetInnerHTML:S,ticks:k,scale:j}=e,C=Hx(e,dse),{id:N,scale:O}=_,T=Hx(_,hse);return b.createElement(n2,qx({},C,T,{ref:l,labelRef:s,x:y.x,y:y.y,tickTextProps:i==="auto"?{width:void 0}:{width:i},width:p.width,height:p.height,className:ot("recharts-".concat(m," ").concat(m),r),viewBox:c,ticks:x,axisType:m,axisId:n}))}var bse={allowDataOverflow:It.allowDataOverflow,allowDecimals:It.allowDecimals,allowDuplicatedCategory:It.allowDuplicatedCategory,angle:It.angle,axisLine:qi.axisLine,hide:!1,includeHidden:It.includeHidden,interval:It.interval,label:!1,minTickGap:It.minTickGap,mirror:It.mirror,orientation:It.orientation,padding:It.padding,reversed:It.reversed,scale:It.scale,tick:It.tick,tickCount:It.tickCount,tickLine:qi.tickLine,tickSize:qi.tickSize,type:It.type,niceTicks:It.niceTicks,width:It.width,yAxisId:0},wse=e=>{var n=bn(e,bse);return b.createElement(b.Fragment,null,b.createElement(yse,{interval:n.interval,id:n.yAxisId,scale:n.scale,type:n.type,domain:n.domain,allowDataOverflow:n.allowDataOverflow,dataKey:n.dataKey,allowDuplicatedCategory:n.allowDuplicatedCategory,allowDecimals:n.allowDecimals,tickCount:n.tickCount,padding:n.padding,includeHidden:n.includeHidden,reversed:n.reversed,ticks:n.ticks,width:n.width,orientation:n.orientation,mirror:n.mirror,hide:n.hide,unit:n.unit,name:n.name,angle:n.angle,minTickGap:n.minTickGap,tick:n.tick,tickFormatter:n.tickFormatter,niceTicks:n.niceTicks}),b.createElement(xse,n))},TD=b.memo(wse,OD);TD.displayName="YAxis";var _se=(e,n)=>n,i2=le([_se,_t,MM,Yt,DP,ra,Dne,ln],Fne);function kse(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function a2(e){var n=e.currentTarget.getBoundingClientRect(),r,i;if(kse(e)){var a=e.currentTarget.getBBox();r=a.width>0?n.width/a.width:1,i=a.height>0?n.height/a.height:1}else{var l=e.currentTarget;r=l.offsetWidth>0?n.width/l.offsetWidth:1,i=l.offsetHeight>0?n.height/l.offsetHeight:1}var s=(c,f)=>({relativeX:Math.round((c-n.left)/r),relativeY:Math.round((f-n.top)/i)});return"touches"in e?Array.from(e.touches).map(c=>s(c.clientX,c.clientY)):s(e.clientX,e.clientY)}var MD=Xn("mouseClick"),PD=Ec();PD.startListening({actionCreator:MD,effect:(e,n)=>{var r=e.payload,i=i2(n.getState(),a2(r));(i==null?void 0:i.activeIndex)!=null&&n.dispatch(Ete({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}});var Gx=Xn("mouseMove"),DD=Ec(),Po=null,cl=null,yy=null;DD.startListening({actionCreator:Gx,effect:(e,n)=>{var r=e.payload,i=n.getState(),{throttleDelay:a,throttledEvents:l}=i.eventSettings,s=l==="all"||(l==null?void 0:l.includes("mousemove"));Po!==null&&(cancelAnimationFrame(Po),Po=null),cl!==null&&(typeof a!="number"||!s)&&(clearTimeout(cl),cl=null),yy=a2(r);var c=()=>{var f=n.getState(),d=U1(f,f.tooltip.settings.shared);if(!yy){Po=null,cl=null;return}if(d==="axis"){var m=i2(f,yy);(m==null?void 0:m.activeIndex)!=null?n.dispatch(jP({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):n.dispatch(SP())}Po=null,cl=null};if(!s){c();return}a==="raf"?Po=requestAnimationFrame(c):typeof a=="number"&&cl===null&&(cl=setTimeout(c,a))}});function Sse(e,n){return n instanceof HTMLElement?"HTMLElement <".concat(n.tagName,' class="').concat(n.className,'">'):n===window?"global.window":e==="children"&&typeof n=="object"&&n!==null?"<<CHILDREN>>":n}var mO={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},RD=hn({name:"rootProps",initialState:mO,reducers:{updateOptions:(e,n)=>{var r;e.accessibilityLayer=n.payload.accessibilityLayer,e.barCategoryGap=n.payload.barCategoryGap,e.barGap=(r=n.payload.barGap)!==null&&r!==void 0?r:mO.barGap,e.barSize=n.payload.barSize,e.maxBarSize=n.payload.maxBarSize,e.stackOffset=n.payload.stackOffset,e.syncId=n.payload.syncId,e.syncMethod=n.payload.syncMethod,e.className=n.payload.className,e.baseValue=n.payload.baseValue,e.reverseStackOrder=n.payload.reverseStackOrder}}}),jse=RD.reducer,{updateOptions:Ese}=RD.actions,Cse=null,Nse={updatePolarOptions:(e,n)=>e===null?n.payload:(e.startAngle=n.payload.startAngle,e.endAngle=n.payload.endAngle,e.cx=n.payload.cx,e.cy=n.payload.cy,e.innerRadius=n.payload.innerRadius,e.outerRadius=n.payload.outerRadius,e)},LD=hn({name:"polarOptions",initialState:Cse,reducers:Nse}),{updatePolarOptions:she}=LD.actions,Ose=LD.reducer,zD=Xn("keyDown"),ID=Xn("focus"),$D=Xn("blur"),Jm=Ec(),Do=null,fl=null,Nd=null;Jm.startListening({actionCreator:zD,effect:(e,n)=>{Nd=e.payload,Do!==null&&(cancelAnimationFrame(Do),Do=null);var r=n.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("keydown");fl!==null&&(typeof i!="number"||!l)&&(clearTimeout(fl),fl=null);var s=()=>{try{var c=n.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:d}=c.tooltip,m=Nd;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var p=q1(d,fs(c),Rc(c),zc(c)),y=p==null?-1:Number(p);if(!Number.isFinite(y)||y<0)return;var x=ra(c);if(m==="Enter"){var _=Gh(c,"axis","hover",String(d.index));n.dispatch(Hh({active:!d.active,activeIndex:d.index,activeCoordinate:_}));return}var S=gte(c),k=S==="left-to-right"?1:-1,j=m==="ArrowRight"?1:-1,C=y+j*k;if(x==null||C>=x.length||C<0)return;var N=Gh(c,"axis","hover",String(C));n.dispatch(Hh({active:!0,activeIndex:C.toString(),activeCoordinate:N}))}finally{Do=null,fl=null}};if(!l){s();return}i==="raf"?Do=requestAnimationFrame(s):typeof i=="number"&&fl===null&&(s(),Nd=null,fl=setTimeout(()=>{Nd?s():(fl=null,Do=null)},i))}});Jm.startListening({actionCreator:ID,effect:(e,n)=>{var r=n.getState(),i=r.rootProps.accessibilityLayer!==!1;if(i){var{keyboardInteraction:a}=r.tooltip;if(!a.active&&a.index==null){var l="0",s=Gh(r,"axis","hover",String(l));n.dispatch(Hh({active:!0,activeIndex:l,activeCoordinate:s}))}}}});Jm.startListening({actionCreator:$D,effect:(e,n)=>{var r=n.getState(),i=r.rootProps.accessibilityLayer!==!1;if(i){var{keyboardInteraction:a}=r.tooltip;a.active&&n.dispatch(Hh({active:!1,activeIndex:a.index,activeCoordinate:a.coordinate}))}}});function BD(e){e.persist();var{currentTarget:n}=e;return new Proxy(e,{get:(r,i)=>{if(i==="currentTarget")return n;var a=Reflect.get(r,i);return typeof a=="function"?a.bind(r):a}})}var dr=Xn("externalEvent"),FD=Ec(),Od=new Map,Cu=new Map,xy=new Map;FD.startListening({actionCreator:dr,effect:(e,n)=>{var{handler:r,reactEvent:i}=e.payload;if(r!=null){var a=i.type,l=BD(i);xy.set(a,{handler:r,reactEvent:l});var s=Od.get(a);s!==void 0&&(cancelAnimationFrame(s),Od.delete(a));var c=n.getState(),{throttleDelay:f,throttledEvents:d}=c.eventSettings,m=d,p=m==="all"||(m==null?void 0:m.includes(a)),y=Cu.get(a);y!==void 0&&(typeof f!="number"||!p)&&(clearTimeout(y),Cu.delete(a));var x=()=>{var k=xy.get(a);try{if(!k)return;var{handler:j,reactEvent:C}=k,N=n.getState(),O={activeCoordinate:yne(N),activeDataKey:pne(N),activeIndex:lc(N),activeLabel:zP(N),activeTooltipIndex:lc(N),isTooltipActive:xne(N)};j&&j(O,C)}finally{Od.delete(a),Cu.delete(a),xy.delete(a)}};if(!p){x();return}if(f==="raf"){var _=requestAnimationFrame(x);Od.set(a,_)}else if(typeof f=="number"){if(!Cu.has(a)){x();var S=setTimeout(x,f);Cu.set(a,S)}}else x()}}});var Ase=le([us],e=>e.tooltipItemPayloads),Tse=le([Ase,(e,n)=>n,(e,n,r)=>r],(e,n,r)=>{if(n!=null){var i=e.find(l=>l.settings.graphicalItemId===r);if(i!=null){var{getPosition:a}=i;if(a!=null)return a(n)}}}),UD=Xn("touchMove"),qD=Ec(),dl=null,Ta=null,pO=null,Nu=null;qD.startListening({actionCreator:UD,effect:(e,n)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){Nu=BD(r);var i=n.getState(),{throttleDelay:a,throttledEvents:l}=i.eventSettings,s=l==="all"||l.includes("touchmove");dl!==null&&(cancelAnimationFrame(dl),dl=null),Ta!==null&&(typeof a!="number"||!s)&&(clearTimeout(Ta),Ta=null),pO=Array.from(r.touches).map(f=>a2({clientX:f.clientX,clientY:f.clientY,currentTarget:r.currentTarget}));var c=()=>{if(Nu!=null){var f=n.getState(),d=U1(f,f.tooltip.settings.shared);if(d==="axis"){var m,p=(m=pO)===null||m===void 0?void 0:m[0];if(p==null){dl=null,Ta=null;return}var y=i2(f,p);(y==null?void 0:y.activeIndex)!=null&&n.dispatch(jP({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(d==="item"){var x,_=Nu.touches[0];if(document.elementFromPoint==null||_==null)return;var S=document.elementFromPoint(_.clientX,_.clientY);if(!S||!S.getAttribute)return;var k=S.getAttribute(cZ),j=(x=S.getAttribute(fZ))!==null&&x!==void 0?x:void 0,C=cs(f).find(T=>T.id===j);if(k==null||C==null||j==null)return;var{dataKey:N}=C,O=Tse(f,k,j);n.dispatch(jte({activeDataKey:N,activeIndex:k,activeCoordinate:O,activeGraphicalItemId:j}))}dl=null,Ta=null}};if(!s){c();return}a==="raf"?dl=requestAnimationFrame(c):typeof a=="number"&&Ta===null&&(c(),Nu=null,Ta=setTimeout(()=>{Nu?c():(Ta=null,dl=null)},a))}}});var HD={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},GD=hn({name:"eventSettings",initialState:HD,reducers:{setEventSettings:(e,n)=>{n.payload.throttleDelay!=null&&(e.throttleDelay=n.payload.throttleDelay),n.payload.throttledEvents!=null&&(e.throttledEvents=n.payload.throttledEvents)}}}),{setEventSettings:Mse}=GD.actions,Pse=GD.reducer,Dse=sT({brush:tle,cartesianAxis:Gae,chartData:xre,errorBars:goe,eventSettings:Pse,graphicalItems:_ae,layout:WX,legend:rQ,options:mre,polarAxis:Uie,polarOptions:Ose,referenceElements:ule,renderedTicks:Ile,rootProps:jse,tooltip:Cte,zIndex:tre}),Rse=function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return bX({reducer:Dse,preloadedState:n,middleware:i=>{var a;return i({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((a="es6")!==null&&a!==void 0?a:"")}).concat([PD.middleware,DD.middleware,Jm.middleware,FD.middleware,qD.middleware])},enhancers:i=>{var a=i;return typeof i=="function"&&(a=i()),a.concat(kT({type:"raf"}))},devTools:{serialize:{replacer:Sse},name:"recharts-".concat(r)}})};function Lse(e){var{preloadedState:n,children:r,reduxStoreName:i}=e,a=wn(),l=b.useRef(null);if(a)return r;l.current==null&&(l.current=Rse(n,i));var s=o1;return b.createElement(xQ,{context:s,store:l.current},r)}function zse(e){var{layout:n,margin:r}=e,i=At(),a=wn();return b.useEffect(()=>{a||(i(KX(n)),i(GX(r)))},[i,a,n,r]),null}var Ise=b.memo(zse,qm);function $se(e){var n=At();return b.useEffect(()=>{n(Ese(e))},[n,e]),null}var Bse=e=>{var n=At();return b.useEffect(()=>{n(Mse(e))},[n,e]),null},Fse=b.memo(Bse,qm);function gO(e){var{zIndex:n,isPanorama:r}=e,i=b.useRef(null),a=At();return b.useLayoutEffect(()=>(i.current&&a(Jne({zIndex:n,element:i.current,isPanorama:r})),()=>{a(ere({zIndex:n,isPanorama:r}))}),[a,n,r]),b.createElement("g",{tabIndex:-1,ref:i,className:"recharts-zIndex-layer_".concat(n)})}function vO(e){var{children:n,isPanorama:r}=e,i=Ne(qne);if(!i||i.length===0)return n;var a=i.filter(s=>s<0),l=i.filter(s=>s>0);return b.createElement(b.Fragment,null,a.map(s=>b.createElement(gO,{key:s,zIndex:s,isPanorama:r})),n,l.map(s=>b.createElement(gO,{key:s,zIndex:s,isPanorama:r})))}var Use=["children"];function qse(e,n){if(e==null)return{};var r,i,a=Hse(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Hse(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Qh.apply(null,arguments)}var Gse={width:"100%",height:"100%",display:"block"},Kse=b.forwardRef((e,n)=>{var r=KT(),i=VT(),a=iM();if(!ai(r)||!ai(i))return null;var{children:l,otherAttributes:s,title:c,desc:f}=e,d,m;return s!=null&&(typeof s.tabIndex=="number"?d=s.tabIndex:d=a?0:void 0,typeof s.role=="string"?m=s.role:m=a?"application":void 0),b.createElement(j3,Qh({},s,{title:c,desc:f,role:m,tabIndex:d,width:r,height:i,style:Gse,ref:n}),l)}),Vse=e=>{var{children:n}=e,r=Ne($m);if(!r)return null;var{width:i,height:a,y:l,x:s}=r;return b.createElement(j3,{width:i,height:a,x:s,y:l},n)},yO=b.forwardRef((e,n)=>{var{children:r}=e,i=qse(e,Use),a=wn();return a?b.createElement(Vse,null,b.createElement(vO,{isPanorama:!0},r)):b.createElement(Kse,Qh({ref:n},i),b.createElement(vO,{isPanorama:!1},r))});function Yse(){var e=At(),[n,r]=b.useState(null),i=Ne(uZ);return b.useEffect(()=>{if(n!=null){var a=n.getBoundingClientRect(),l=a.width/n.offsetWidth;Fe(l)&&l!==i&&e(YX(l))}},[n,e,i]),r}function xO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function Wse(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?xO(Object(r),!0).forEach(function(i){Xse(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xse(e,n,r){return(n=Zse(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Zse(e){var n=Qse(e,"string");return typeof n=="symbol"?n:n+""}function Qse(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ia(){return Ia=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ia.apply(null,arguments)}var Jse=()=>(Nre(),null);function Jh(e){if(typeof e=="number")return e;if(typeof e=="string"){var n=parseFloat(e);if(!Number.isNaN(n))return n}return 0}var eue=b.forwardRef((e,n)=>{var r,i,a=b.useRef(null),[l,s]=b.useState({containerWidth:Jh((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Jh((i=e.style)===null||i===void 0?void 0:i.height)}),c=b.useCallback((d,m)=>{s(p=>{var y=Math.round(d),x=Math.round(m);return p.containerWidth===y&&p.containerHeight===x?p:{containerWidth:y,containerHeight:x}})},[]),f=b.useCallback(d=>{if(typeof n=="function"&&n(d),d!=null&&typeof ResizeObserver<"u"){var{width:m,height:p}=d.getBoundingClientRect();c(m,p);var y=_=>{var S=_[0];if(S!=null){var{width:k,height:j}=S.contentRect;c(k,j)}},x=new ResizeObserver(y);x.observe(d),a.current=x}},[n,c]);return b.useEffect(()=>()=>{var d=a.current;d!=null&&d.disconnect()},[c]),b.createElement(b.Fragment,null,b.createElement(Oc,{width:l.containerWidth,height:l.containerHeight}),b.createElement("div",Ia({ref:f},e)))}),tue=b.forwardRef((e,n)=>{var{width:r,height:i}=e,[a,l]=b.useState({containerWidth:Jh(r),containerHeight:Jh(i)}),s=b.useCallback((f,d)=>{l(m=>{var p=Math.round(f),y=Math.round(d);return m.containerWidth===p&&m.containerHeight===y?m:{containerWidth:p,containerHeight:y}})},[]),c=b.useCallback(f=>{if(typeof n=="function"&&n(f),f!=null){var{width:d,height:m}=f.getBoundingClientRect();s(d,m)}},[n,s]);return b.createElement(b.Fragment,null,b.createElement(Oc,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Ia({ref:c},e)))}),nue=b.forwardRef((e,n)=>{var{width:r,height:i}=e;return b.createElement(b.Fragment,null,b.createElement(Oc,{width:r,height:i}),b.createElement("div",Ia({ref:n},e)))}),rue=b.forwardRef((e,n)=>{var{width:r,height:i}=e;return typeof r=="string"||typeof i=="string"?b.createElement(tue,Ia({},e,{ref:n})):typeof r=="number"&&typeof i=="number"?b.createElement(nue,Ia({},e,{width:r,height:i,ref:n})):b.createElement(b.Fragment,null,b.createElement(Oc,{width:r,height:i}),b.createElement("div",Ia({ref:n},e)))});function iue(e){return e?eue:rue}var aue=b.forwardRef((e,n)=>{var{children:r,className:i,height:a,onClick:l,onContextMenu:s,onDoubleClick:c,onMouseDown:f,onMouseEnter:d,onMouseLeave:m,onMouseMove:p,onMouseUp:y,onTouchEnd:x,onTouchMove:_,onTouchStart:S,style:k,width:j,responsive:C,dispatchTouchEvents:N=!0}=e,O=b.useRef(null),T=At(),[A,P]=b.useState(null),[R,z]=b.useState(null),D=Yse(),U=m1(),q=(U==null?void 0:U.width)>0?U.width:j,L=(U==null?void 0:U.height)>0?U.height:a,$=b.useCallback(pe=>{D(pe),typeof n=="function"&&n(pe),P(pe),z(pe),pe!=null&&(O.current=pe)},[D,n,P,z]),G=b.useCallback(pe=>{T(MD(pe)),T(dr({handler:l,reactEvent:pe}))},[T,l]),B=b.useCallback(pe=>{T(Gx(pe)),T(dr({handler:d,reactEvent:pe}))},[T,d]),Y=b.useCallback(pe=>{T(SP()),T(dr({handler:m,reactEvent:pe}))},[T,m]),ee=b.useCallback(pe=>{T(Gx(pe)),T(dr({handler:p,reactEvent:pe}))},[T,p]),H=b.useCallback(()=>{T(ID())},[T]),re=b.useCallback(()=>{T($D())},[T]),F=b.useCallback(pe=>{T(zD(pe.key))},[T]),X=b.useCallback(pe=>{T(dr({handler:s,reactEvent:pe}))},[T,s]),ae=b.useCallback(pe=>{T(dr({handler:c,reactEvent:pe}))},[T,c]),se=b.useCallback(pe=>{T(dr({handler:f,reactEvent:pe}))},[T,f]),ve=b.useCallback(pe=>{T(dr({handler:y,reactEvent:pe}))},[T,y]),we=b.useCallback(pe=>{T(dr({handler:S,reactEvent:pe}))},[T,S]),ce=b.useCallback(pe=>{N&&T(UD(pe)),T(dr({handler:_,reactEvent:pe}))},[T,N,_]),Se=b.useCallback(pe=>{T(dr({handler:x,reactEvent:pe}))},[T,x]),me=iue(C);return b.createElement(HP.Provider,{value:A},b.createElement(JV.Provider,{value:R},b.createElement(me,{width:q??(k==null?void 0:k.width),height:L??(k==null?void 0:k.height),className:ot("recharts-wrapper",i),style:Wse({position:"relative",cursor:"default",width:q,height:L},k),onClick:G,onContextMenu:X,onDoubleClick:ae,onFocus:H,onBlur:re,onKeyDown:F,onMouseDown:se,onMouseEnter:B,onMouseLeave:Y,onMouseMove:ee,onMouseUp:ve,onTouchEnd:Se,onTouchMove:ce,onTouchStart:we,ref:$},b.createElement(Jse,null),r)))}),lue=["width","height","responsive","children","className","style","compact","title","desc"];function oue(e,n){if(e==null)return{};var r,i,a=sue(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function sue(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}var uue=b.forwardRef((e,n)=>{var{width:r,height:i,responsive:a,children:l,className:s,style:c,compact:f,title:d,desc:m}=e,p=oue(e,lue),y=ri(p);return f?b.createElement(b.Fragment,null,b.createElement(Oc,{width:r,height:i}),b.createElement(yO,{otherAttributes:y,title:d,desc:m},l)):b.createElement(aue,{className:s,style:c,width:r,height:i,responsive:a??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(yO,{otherAttributes:y,title:d,desc:m,ref:n},b.createElement(cle,null,l)))});function Kx(){return Kx=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Kx.apply(null,arguments)}function bO(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function cue(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?bO(Object(r),!0).forEach(function(i){fue(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bO(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function fue(e,n,r){return(n=due(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function due(e){var n=hue(e,"string");return typeof n=="symbol"?n:n+""}function hue(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var mue={top:5,right:5,bottom:5,left:5},pue=cue({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:mue,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},HD),gue=b.forwardRef(function(n,r){var i,a=bn(n.categoricalChartProps,pue),{chartName:l,defaultTooltipEventType:s,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:d}=n,m={chartName:l,defaultTooltipEventType:s,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return b.createElement(Lse,{preloadedState:{options:m},reduxStoreName:(i=d.id)!==null&&i!==void 0?i:l},b.createElement(ele,{chartData:d.data}),b.createElement(Ise,{layout:a.layout,margin:a.margin}),b.createElement(Fse,{throttleDelay:a.throttleDelay,throttledEvents:a.throttledEvents}),b.createElement($se,{baseValue:a.baseValue,accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className,reverseStackOrder:a.reverseStackOrder}),b.createElement(uue,Kx({},a,{ref:r})))}),vue=["axis"],yue=b.forwardRef((e,n)=>b.createElement(gue,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:vue,tooltipPayloadSearcher:dre,categoricalChartProps:e,ref:n}));const wO={dailyPercent:"#58A6FF",weeklyPercent:"#A371F7",sonnetPercent:"#3FB950",extraPercent:"#D29922"},xue={dailyPercent:"Daily",weeklyPercent:"Weekly",sonnetPercent:"Sonnet",extraPercent:"Extra"},bue=["dailyPercent","weeklyPercent","sonnetPercent","extraPercent"];function wue(e){return e.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function _ue(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function kue({active:e,payload:n,label:r}){return!e||!n||n.length===0||r===void 0?null:g.jsxs("div",{className:"bg-dark-surface border border-dark-border rounded-md px-3 py-2 shadow-lg",children:[g.jsx("p",{className:"text-xs text-dark-muted mb-1",children:_ue(r)}),n.map(i=>g.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:i.color}}),g.jsxs("span",{className:"text-dark-text",children:[xue[i.dataKey]??i.dataKey,":"]}),g.jsxs("span",{className:"text-dark-text font-semibold tabular-nums",children:[i.value.toFixed(1),"%"]})]},i.dataKey))]})}function Sue({snapshots:e,redThresholds:n}){const r=b.useMemo(()=>{const l=Date.now()-10080*60*1e3;return e.map(s=>({time:new Date(s.recordedAt).getTime(),dailyPercent:s.dailyPercent,weeklyPercent:s.weeklyPercent,sonnetPercent:s.sonnetPercent,extraPercent:s.extraPercent})).filter(s=>s.time>=l).sort((s,c)=>s.time-c.time)},[e]),i=b.useMemo(()=>{const a=Date.now();return[a-10080*60*1e3,a]},[r]);return r.length===0?g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsx("p",{className:"text-dark-muted text-sm",children:"No usage data in the last 7 days"})}):g.jsx("div",{className:"w-full h-72",children:g.jsx($Z,{width:"100%",height:"100%",children:g.jsxs(yue,{data:r,margin:{top:8,right:16,bottom:8,left:0},children:[g.jsx(xD,{strokeDasharray:"3 3",stroke:"rgba(48, 54, 61, 0.6)",vertical:!1}),g.jsx(AD,{dataKey:"time",type:"number",domain:i,tickFormatter:a=>wue(new Date(a)),stroke:"#8B949E",tick:{fill:"#8B949E",fontSize:11},axisLine:{stroke:"#30363D"},tickLine:{stroke:"#30363D"}}),g.jsx(TD,{domain:[0,100],ticks:[0,25,50,75,100],tickFormatter:a=>`${a}%`,stroke:"#8B949E",tick:{fill:"#8B949E",fontSize:11},axisLine:{stroke:"#30363D"},tickLine:{stroke:"#30363D"},width:48}),g.jsx(Lre,{content:g.jsx(kue,{}),cursor:{stroke:"rgba(139, 148, 158, 0.3)"}}),g.jsx(Bx,{y:n.daily,stroke:"#F85149",strokeDasharray:"6 4",strokeOpacity:.6,label:{value:`Daily ${n.daily}%`,position:"right",fill:"#F85149",fontSize:10}}),g.jsx(Bx,{y:n.weekly,stroke:"#A371F7",strokeDasharray:"6 4",strokeOpacity:.6,label:{value:`Weekly ${n.weekly}%`,position:"right",fill:"#A371F7",fontSize:10}}),bue.map(a=>g.jsx(ND,{type:"monotone",dataKey:a,stroke:wO[a],strokeWidth:2,dot:!1,activeDot:{r:4,fill:wO[a],stroke:"#161B22",strokeWidth:2}},a))]})})})}const jue=3e4,Eue={daily:85,weekly:95,sonnet:95,extra:95},Cue=[{label:"Daily Usage",key:"dailyPercent",thresholdKey:"daily",resetKey:"dailyResetsAt"},{label:"Weekly Usage",key:"weeklyPercent",thresholdKey:"weekly",resetKey:"weeklyResetsAt"},{label:"Sonnet Usage",key:"sonnetPercent",thresholdKey:"sonnet",resetKey:null},{label:"Extra Usage",key:"extraPercent",thresholdKey:"extra",resetKey:null}];function Nue(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Oue(){const e=Ot(),[n,r]=b.useState(null),[i,a]=b.useState(Eue),[l,s]=b.useState([]),[c,f]=b.useState(!0),[d,m]=b.useState(null),p=b.useCallback(async()=>{try{const[x,_]=await Promise.all([e.get("usage"),e.get("usage/history?limit=1000")]);r(x),x.redThresholds&&a(x.redThresholds),s(_.snapshots),m(null)}catch(x){m(x instanceof Error?x.message:"Failed to fetch usage data")}finally{f(!1)}},[e]);b.useEffect(()=>{p();const x=setInterval(()=>{p()},jue);return()=>clearInterval(x)},[p]);const y=b.useCallback(x=>{x==="usage_updated"&&p()},[p]);return Hu("usage_updated",y),g.jsxs("div",{className:"p-6 max-w-4xl mx-auto flex flex-col gap-8",children:[g.jsxs("section",{className:"flex flex-col gap-2 py-4",children:[g.jsx("h2",{className:"text-xs font-medium text-dark-muted uppercase tracking-widest mb-4",children:"Usage Overview"}),c&&!n?g.jsx("p",{className:"text-dark-muted text-lg text-center py-8",children:"Loading..."}):d&&!n?g.jsx("p",{className:"text-[#F85149] text-sm text-center py-8",children:d}):n?g.jsxs("div",{className:"flex flex-col gap-4",children:[Cue.map(x=>{const _=n[x.key]??0,S=_A(_,i[x.thresholdKey]),k=Math.min(Math.max(_,0),100);return g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-sm font-medium text-dark-text",children:x.label}),g.jsxs("span",{className:"text-sm font-semibold tabular-nums",style:{color:S},children:[_.toFixed(1),"%"]})]}),g.jsx("div",{className:"w-full h-6 bg-dark-base rounded-md overflow-hidden border border-dark-border",children:g.jsx("div",{className:"h-full rounded-md transition-all duration-500 ease-out",style:{width:`${Math.max(k,.5)}%`,backgroundColor:S+"40",borderRight:k>0?`2px solid ${S}`:"none"}})}),x.resetKey&&(()=>{const j=Oy(n[x.resetKey]);return j?g.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:j}):null})()]},x.key)}),n.recordedAt&&g.jsxs("p",{className:"text-xs text-dark-muted mt-2",children:["Last updated: ",Nue(n.recordedAt)]})]}):null]}),g.jsxs("section",{children:[g.jsx("h3",{className:"text-sm font-medium text-dark-muted uppercase tracking-wider mb-3",children:"Last 7 Days"}),g.jsx("div",{className:"bg-dark-surface rounded-lg border border-dark-border p-4",children:g.jsx(Sue,{snapshots:l,redThresholds:i})})]})]})}function _O(e){const[n,r]=b.useState(!1),[i,a]=b.useState(e),l=b.useRef(null),s=b.useRef(!1),c=b.useCallback(m=>{a(m),r(!0),s.current=!1,setTimeout(()=>{var p;return(p=l.current)==null?void 0:p.focus()},50)},[]),f=b.useCallback(()=>{r(!1),s.current=!1},[]),d=b.useCallback(()=>s.current?null:(s.current=!0,r(!1),i),[i]);return{isEditing:n,editValue:i,inputRef:l,startEdit:c,cancelEdit:f,confirmEdit:d,setEditValue:a}}const l2="fleet-projects-expanded";function Aue(){try{return localStorage.getItem(l2)!==null}catch{return!1}}function Tue(){try{const e=localStorage.getItem(l2);if(!e)return new Set;const n=JSON.parse(e);if(Array.isArray(n))return new Set(n.filter(r=>typeof r=="string"))}catch{}return new Set}function Mue(e){try{localStorage.setItem(l2,JSON.stringify([...e]))}catch{}}function Pue(){const[e,n]=b.useState(()=>Tue()),r=b.useRef(Aue()),i=r.current,a=b.useRef(!1),l=b.useRef(!1);b.useEffect(()=>{if(!a.current){a.current=!0;return}Mue(e)},[e]);const s=b.useCallback(d=>{n(m=>{const p=new Set(m);return p.has(d)?p.delete(d):p.add(d),p})},[]),c=b.useCallback(d=>e.has(d),[e]),f=b.useCallback(d=>{l.current||r.current||(l.current=!0,d.length>0&&n(new Set(d)))},[]);return{expandedIds:e,toggle:s,isExpanded:c,hasStoredData:i,seedExpanded:f}}function Due({open:e,onClose:n,onAdded:r}){const i=Ot(),[a,l]=b.useState(""),[s,c]=b.useState(""),[f,d]=b.useState(""),[m,p]=b.useState(5),[y,x]=b.useState(""),[_,S]=b.useState(!1),[k,j]=b.useState(null),[C,N]=b.useState("github"),[O,T]=b.useState(""),[A,P]=b.useState(""),[R,z]=b.useState(""),[D,U]=b.useState(""),[q,L]=b.useState([]),[$,G]=b.useState(!1),[B,Y]=b.useState(-1),[ee,H]=b.useState(""),re=b.useMemo(()=>{if(!ee||!s)return q;const J=s.substring(ee.length).toLowerCase();return J?q.filter(ye=>ye.name.toLowerCase().startsWith(J)):q},[q,s,ee]),F=b.useRef(null),X=b.useRef(null),ae=b.useRef(null),se=b.useRef(null),ve=b.useRef(null);b.useEffect(()=>()=>{ve.current&&clearTimeout(ve.current)},[]),b.useEffect(()=>{if(e){const J=setTimeout(()=>{var ye;return(ye=F.current)==null?void 0:ye.focus()},50);return()=>clearTimeout(J)}},[e]),b.useEffect(()=>{e&&(l(""),c(""),d(""),p(5),x(""),j(null),S(!1),L([]),G(!1),Y(-1),H(""),N("github"),T(""),P(""),z(""),U(""))},[e]),b.useEffect(()=>{if(!e)return;function J(ye){ye.key==="Escape"&&($?G(!1):n())}return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[e,n,$]),b.useEffect(()=>{if(!$)return;function J(ye){const K=ye.target;ae.current&&!ae.current.contains(K)&&se.current&&!se.current.contains(K)&&G(!1)}return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[$]);const we=b.useCallback(J=>{X.current&&!X.current.contains(J.target)&&n()},[n]),ce=b.useCallback(async J=>{if(!J.trim()){L([]),G(!1);return}try{const ye=encodeURIComponent(J),K=await i.get(`system/browse-dirs?path=${ye}`);L(K.dirs),H(K.parentPath),G(K.dirs.length>0),Y(-1)}catch{L([]),G(!1)}},[i]),Se=b.useCallback(J=>{c(J),Y(-1),ve.current&&clearTimeout(ve.current);const ye=J.endsWith("/")||J.endsWith("\\")?J:J.substring(0,Math.max(J.lastIndexOf("/"),J.lastIndexOf("\\"))+1);ye?ve.current=setTimeout(()=>{ce(ye)},300):(L([]),G(!1))},[ce]),me=b.useCallback(J=>{var ye;c(J.path),G(!1),Y(-1),a.trim()||l(J.name),J.isGitRepo||setTimeout(()=>{ce(J.path+"/")},100),(ye=ae.current)==null||ye.focus()},[a,ce]),pe=b.useCallback(()=>{if(!ee)return;const J=ee.replace(/\/[^/]+\/?$/,"");J&&J!==ee&&(c(J),ce(J+"/"))},[ee,ce]),Ee=q.length===0||s===ee?!1:q.some(J=>J.path===s&&J.isGitRepo),he=b.useCallback(async()=>{if(j(null),!a.trim()){j("Project name is required");return}if(!s.trim()){j("Repository path is required");return}if(C==="jira"){if(!O.trim()){j("Jira Base URL is required");return}if(!A.trim()){j("Jira Email is required");return}if(!R.trim()){j("Jira API Token is required");return}if(!D.trim()){j("Jira Project Key is required");return}if(!/^[A-Z][A-Z0-9]*$/.test(D.trim())){j('Jira Project Key must be uppercase letters/numbers (e.g. "PROJ")');return}}S(!0);try{const J={name:a.trim(),repoPath:s.trim(),githubRepo:f.trim()||void 0,maxActiveTeams:m,model:y.trim()||void 0,issueProvider:C};C==="jira"&&(J.projectKey=D.trim(),J.providerConfig=JSON.stringify({baseUrl:O.trim(),email:A.trim(),apiToken:R.trim(),projectKey:D.trim()})),await i.post("projects",J),r()}catch(J){const ye=J instanceof Error?J.message:String(J);j(ye||"Failed to add project")}finally{S(!1)}},[a,s,f,m,y,C,O,A,R,D,i,r]),Be=b.useCallback(J=>{if($&&re.length>0){if(J.key==="ArrowDown"){J.preventDefault(),Y(ye=>ye<re.length-1?ye+1:0);return}if(J.key==="ArrowUp"){J.preventDefault(),Y(ye=>ye>0?ye-1:re.length-1);return}if(J.key==="Enter"&&B>=0){J.preventDefault(),me(re[B]);return}if(J.key==="Tab"&&B>=0){J.preventDefault(),me(re[B]);return}}J.key==="Enter"&&!_&&he()},[$,re,B,me,_,he]),Me=b.useCallback(J=>{J.key==="Enter"&&!_&&he()},[_,he]);return e?g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:we,children:g.jsxs("div",{ref:X,className:"w-[480px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true","aria-label":"Add Project",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:"Add Project"}),g.jsx("button",{onClick:n,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",title:"Close (Esc)",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"px-5 py-4 space-y-4",children:[g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Project Name ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsx("input",{ref:F,type:"text",value:a,onChange:J=>l(J.target.value),onKeyDown:Me,placeholder:"my-project",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_})]}),g.jsxs("div",{className:"relative",children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Repository Path ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsxs("div",{className:"relative",children:[g.jsx("input",{ref:ae,type:"text",value:s,onChange:J=>Se(J.target.value),onKeyDown:Be,onFocus:()=>{re.length>0&&G(!0)},placeholder:"C:/Git/my-repo",className:`w-full px-3 py-2 text-sm rounded border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:ring-1 ${Ee?"border-green-500/50 focus:border-green-500 focus:ring-green-500/30":"border-dark-border focus:border-dark-accent focus:ring-dark-accent/30"}`,disabled:_,autoComplete:"off"}),Ee&&g.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-400",title:"Valid git repository",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),g.jsx("p",{className:"mt-1 text-xs text-dark-muted/60",children:"Type a path to browse. Suggestions filter as you type."}),$&&re.length>0&&g.jsxs("div",{ref:se,className:"absolute z-10 left-0 right-0 mt-1 max-h-48 overflow-y-auto rounded border border-dark-border bg-dark-base shadow-lg",children:[ee&&g.jsxs("button",{type:"button",onClick:pe,className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-dark-muted hover:bg-dark-border/30 hover:text-dark-text transition-colors text-left",children:[g.jsx("svg",{className:"w-3.5 h-3.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),g.jsx("span",{children:".."}),g.jsx("span",{className:"ml-auto text-xs text-dark-muted/50 truncate",children:ee})]}),re.map((J,ye)=>g.jsxs("button",{type:"button",onClick:()=>me(J),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm transition-colors text-left ${ye===B?"bg-dark-accent/20 text-dark-text":"text-dark-text hover:bg-dark-border/30"}`,children:[J.isGitRepo?g.jsx("span",{className:"w-3.5 h-3.5 shrink-0 rounded-full bg-green-500/80 inline-flex items-center justify-center",title:"Git repository",children:g.jsx("svg",{className:"w-2 h-2 text-white",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}):g.jsx("svg",{className:"w-3.5 h-3.5 shrink-0 text-dark-muted/50",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{d:"M2 6a2 2 0 012-2h5l2 2h5a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"})}),g.jsx("span",{className:"truncate",children:J.name}),J.isGitRepo&&g.jsx("span",{className:"ml-auto text-xs text-green-400/70 shrink-0",children:"git"})]},J.path))]})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"Issue Provider"}),g.jsxs("div",{className:"flex gap-4",children:[g.jsxs("label",{className:"inline-flex items-center gap-1.5 text-sm text-dark-text cursor-pointer",children:[g.jsx("input",{type:"radio",name:"issueProvider",value:"github",checked:C==="github",onChange:()=>N("github"),className:"accent-dark-accent",disabled:_}),"GitHub"]}),g.jsxs("label",{className:"inline-flex items-center gap-1.5 text-sm text-dark-text cursor-pointer",children:[g.jsx("input",{type:"radio",name:"issueProvider",value:"jira",checked:C==="jira",onChange:()=>N("jira"),className:"accent-dark-accent",disabled:_}),"Jira"]})]})]}),C==="github"&&g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["GitHub Repo ",g.jsx("span",{className:"text-dark-muted/50",children:"(optional)"})]}),g.jsx("input",{type:"text",value:f,onChange:J=>d(J.target.value),onKeyDown:Me,placeholder:"org/repo (auto-detected)",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_})]}),C==="jira"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Jira Base URL ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsx("input",{type:"text",value:O,onChange:J=>T(J.target.value),onKeyDown:Me,placeholder:"https://mycompany.atlassian.net",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Jira Email ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsx("input",{type:"email",value:A,onChange:J=>P(J.target.value),onKeyDown:Me,placeholder:"user@example.com",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Jira API Token ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsx("input",{type:"password",value:R,onChange:J=>z(J.target.value),onKeyDown:Me,placeholder:"Your Jira API token",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_}),g.jsxs("p",{className:"mt-1 text-xs text-dark-muted/60",children:["Generate at ",g.jsx("a",{href:"https://id.atlassian.com/manage-profile/security/api-tokens",target:"_blank",rel:"noopener noreferrer",className:"text-dark-accent hover:underline",children:"Atlassian API tokens"})]})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Jira Project Key ",g.jsx("span",{className:"text-[#F85149]",children:"*"})]}),g.jsx("input",{type:"text",value:D,onChange:J=>U(J.target.value.toUpperCase()),onKeyDown:Me,placeholder:"PROJ",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_}),g.jsx("p",{className:"mt-1 text-xs text-dark-muted/60",children:'The Jira project key (e.g. "PROJ"). Must be uppercase.'})]})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-sm text-dark-muted mb-1",children:"Max Active Teams"}),g.jsx("input",{type:"number",value:m,onChange:J=>p(Math.max(1,Math.min(50,parseInt(J.target.value,10)||1))),onKeyDown:Me,min:1,max:50,className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_}),g.jsx("p",{className:"mt-1 text-xs text-dark-muted/60",children:"Max concurrent active teams before new launches are queued (1-50, default: 5)."})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"block text-sm text-dark-muted mb-1",children:["Model ",g.jsx("span",{className:"text-dark-muted/50",children:"(optional)"})]}),g.jsx("input",{type:"text",value:y,onChange:J=>x(J.target.value),onKeyDown:Me,placeholder:"e.g. opus, sonnet, claude-opus-4-6",className:"w-full px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30",disabled:_}),g.jsx("p",{className:"mt-1 text-xs text-dark-muted/60",children:"Claude model to use for teams in this project. Empty uses the default model."})]}),k&&g.jsx("div",{className:"px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:k})]}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-4 border-t border-dark-border",children:[g.jsx("button",{onClick:n,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",disabled:_,children:"Cancel"}),g.jsx("button",{onClick:he,disabled:_,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:_?"Adding...":"Add Project"})]})]})}):null}const kO={worktree:0,signal_file:1,stale_branch:2,team_record:3},Rue={worktree:"Worktrees",signal_file:"Signal Files",stale_branch:"Branches",team_record:"Database Records"},Lue={worktree:"📁",signal_file:"📄",stale_branch:"🌿",team_record:"🗑️"};function zue(e){const n=[...e].sort((i,a)=>kO[i.type]-kO[a.type]),r=new Map;for(const i of n)r.has(i.type)||r.set(i.type,[]),r.get(i.type).push(i);return r}function Iue({projectId:e,open:n,onClose:r,onDone:i}){const a=Ot(),l=b.useRef(null),[s,c]=b.useState("loading"),[f,d]=b.useState(null),[m,p]=b.useState(new Set),[y,x]=b.useState(null),[_,S]=b.useState(null),[k,j]=b.useState(!1),C=b.useCallback(()=>{s==="result"&&i(),j(!1),r()},[s,r,i]);b.useEffect(()=>{if(!n)return;c("loading"),d(null),p(new Set),x(null),S(null);let z=!1;return(async()=>{try{const D=k?"?resetTeams=true":"",U=await a.get(`projects/${e}/cleanup-preview${D}`);if(z)return;d(U),p(new Set(U.items.map(q=>q.path))),c("preview")}catch(D){if(z)return;S(D instanceof Error?D.message:String(D)),c("preview")}})(),()=>{z=!0}},[n,e,a,k]),b.useEffect(()=>{if(!n)return;function z(D){D.key==="Escape"&&s!=="executing"&&C()}return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[n,s,C]);const N=b.useCallback(z=>{p(D=>{const U=new Set(D);return U.has(z)?U.delete(z):U.add(z),U})},[]),O=b.useCallback(()=>{f&&p(new Set(f.items.map(z=>z.path)))},[f]),T=b.useCallback(()=>{p(new Set)},[]),A=b.useCallback(async()=>{if(m.size!==0){c("executing"),S(null);try{const z=await a.post(`projects/${e}/cleanup`,{items:Array.from(m),resetTeams:k});x(z),c("result")}catch(z){S(z instanceof Error?z.message:String(z)),c("preview")}}},[a,e,m,k]),P=b.useCallback(z=>{l.current&&!l.current.contains(z.target)&&C()},[C]);if(!n)return null;const R=f?zue(f.items):new Map;return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:P,children:g.jsxs("div",{ref:l,className:"w-[560px] max-w-[95vw] max-h-[80vh] flex flex-col bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true","aria-label":"Clean Up",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border shrink-0",children:[g.jsxs("h2",{className:"text-base font-semibold text-dark-text",children:["Clean Up",f?` — ${f.projectName}`:""]}),g.jsx("button",{onClick:C,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",title:"Close (Esc)",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 min-h-0",children:[s==="loading"&&g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsx("p",{className:"text-dark-muted text-sm",children:"Scanning for items to clean up..."})}),_&&g.jsx("div",{className:"mb-4 px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:_}),s==="preview"&&f&&g.jsx("div",{className:"mb-4",children:g.jsxs("label",{className:"flex items-start gap-2.5 px-3 py-2.5 rounded border border-dark-border/50 hover:border-dark-border bg-dark-base/50 cursor-pointer transition-colors",children:[g.jsx("input",{type:"checkbox",checked:k,onChange:z=>j(z.target.checked),className:"mt-0.5 accent-[#F85149] shrink-0"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-sm text-dark-text font-medium",children:"Reset team history"}),k&&g.jsx("div",{className:"text-xs text-[#F85149]/80 mt-1",children:"This will delete all team records, events, and commands for this project from the database. The project will be like freshly added."})]})]})}),s==="preview"&&f&&f.items.length===0&&!_&&g.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[g.jsx("span",{className:"text-3xl",children:"✨"}),g.jsx("p",{className:"text-dark-muted text-sm",children:"Nothing to clean up!"}),g.jsx("p",{className:"text-dark-muted/60 text-xs",children:"This project is already tidy."})]}),s==="preview"&&f&&f.items.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[g.jsx("button",{onClick:O,className:"text-xs text-dark-accent hover:underline",children:"Select All"}),g.jsx("button",{onClick:T,className:"text-xs text-dark-muted hover:underline",children:"Deselect All"}),g.jsxs("span",{className:"ml-auto text-xs text-dark-muted",children:[m.size," of ",f.items.length," selected"]})]}),Array.from(R.entries()).map(([z,D])=>g.jsxs("div",{className:"mb-4",children:[g.jsxs("h3",{className:"text-xs font-semibold text-dark-muted uppercase tracking-wider mb-2",children:[Lue[z]," ",Rue[z]," (",D.length,")"]}),g.jsx("div",{className:"space-y-1",children:D.map(U=>g.jsxs("label",{className:"flex items-start gap-2.5 px-3 py-2 rounded border border-dark-border/50 hover:border-dark-border bg-dark-base/50 cursor-pointer transition-colors",children:[g.jsx("input",{type:"checkbox",checked:m.has(U.path),onChange:()=>N(U.path),className:"mt-0.5 accent-[#F85149] shrink-0"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-sm text-dark-text truncate",title:U.path,children:U.name}),g.jsx("div",{className:"text-xs text-dark-muted/70 truncate",children:U.reason})]})]},U.path))})]},z))]}),s==="executing"&&g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsxs("p",{className:"text-dark-muted text-sm",children:["Removing ",m.size," item",m.size!==1?"s":"","..."]})}),s==="result"&&y&&g.jsxs("div",{className:"py-4 space-y-3",children:[y.removed.length>0&&g.jsxs("div",{children:[g.jsxs("p",{className:"text-sm text-dark-text font-medium mb-1",children:["Removed ",y.removed.length," item",y.removed.length!==1?"s":""]}),g.jsx("ul",{className:"space-y-0.5",children:y.removed.map(z=>g.jsxs("li",{className:"text-xs text-dark-muted flex items-center gap-1.5",children:[g.jsx("span",{className:"text-green-400",children:"✓"})," ",z]},z))})]}),y.failed.length>0&&g.jsxs("div",{children:[g.jsxs("p",{className:"text-sm text-[#F85149] font-medium mb-1",children:[y.failed.length," failed"]}),g.jsx("ul",{className:"space-y-0.5",children:y.failed.map(z=>g.jsxs("li",{className:"text-xs text-[#F85149]/80 flex items-start gap-1.5",children:[g.jsx("span",{className:"shrink-0",children:"✗"}),g.jsxs("span",{className:"truncate",title:z.error,children:[z.name,": ",z.error]})]},z.name))})]}),y.removed.length===0&&y.failed.length===0&&g.jsx("p",{className:"text-sm text-dark-muted",children:"No items were removed."})]})]}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-4 border-t border-dark-border shrink-0",children:[s==="preview"&&f&&f.items.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("button",{onClick:C,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Cancel"}),g.jsxs("button",{onClick:A,disabled:m.size===0,className:"px-4 py-1.5 text-sm font-medium rounded border border-[#F85149]/40 text-[#F85149] bg-[#F85149]/10 hover:bg-[#F85149]/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:["Remove Selected (",m.size,")"]})]}),(s==="result"||s==="preview"&&(!f||f.items.length===0))&&g.jsx("button",{onClick:C,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Close"})]})]})})}function $ue({open:e,projectId:n,source:r,onClose:i,onSave:a}){const[l,s]=b.useState(""),[c,f]=b.useState(""),[d,m]=b.useState(""),[p,y]=b.useState(""),[x,_]=b.useState(""),[S,k]=b.useState(!0),[j,C]=b.useState(null),[N,O]=b.useState(!1),[T,A]=b.useState(!1),[P,R]=b.useState(null),z=b.useRef(null);b.useEffect(()=>{if(e){if(r){try{const L=JSON.parse(r.configJson);s(L.jiraUrl||""),f(L.projectKey||"")}catch{s(""),f("")}m(""),y(""),r.hasCredentials&&fetch(`/api/projects/${n}/issue-sources/${r.id}/credentials`).then(L=>L.json()).then(L=>{if(L.credentialsJson)try{const $=JSON.parse(L.credentialsJson);m($.email||""),y($.apiToken||"")}catch{}}).catch(()=>{}),_(r.label||""),k(r.enabled)}else s(""),f(""),m(""),y(""),_(""),k(!0);C(null),R(null),O(!1),A(!1),setTimeout(()=>{var L;return(L=z.current)==null?void 0:L.focus()},50)}},[e,r,n]);const D=b.useCallback(()=>l.trim()?l.trim().startsWith("https://")?c.trim()?d.trim()?p.trim()?null:"API Token is required":"Email is required":"Project Key is required":"Jira URL must start with https://":"Jira URL is required",[l,c,d,p]),U=b.useCallback(async()=>{const L=D();if(L){C(L);return}C(null),R(null),A(!0);try{const G=await(await fetch(`/api/projects/${n}/issue-sources/test-connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jiraUrl:l.trim().replace(/\/+$/,""),projectKey:c.trim(),email:d.trim(),apiToken:p.trim()})})).json();R(G)}catch($){R({ok:!1,error:$ instanceof Error?$.message:"Unknown error"})}finally{A(!1)}},[D,n,l,c,d,p]),q=b.useCallback(async()=>{const L=D();if(L){C(L);return}C(null),O(!0);try{const $=JSON.stringify({jiraUrl:l.trim().replace(/\/+$/,""),projectKey:c.trim()}),G=JSON.stringify({email:d.trim(),apiToken:p.trim()});await a({provider:"jira",label:x.trim()||null,configJson:$,credentialsJson:G,enabled:S})}catch($){C($ instanceof Error?$.message:"Failed to save"),O(!1)}},[D,l,c,d,p,x,S,a]);return e?g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:L=>{L.target===L.currentTarget&&i()},children:g.jsxs("div",{className:"w-[480px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:r?"Edit Jira Source":"Add Jira Source"}),g.jsx("button",{onClick:i,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"px-5 py-4 space-y-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Label (optional)"}),g.jsx("input",{type:"text",value:x,onChange:L=>_(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"e.g. My Jira Project"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Jira URL"}),g.jsx("input",{ref:z,type:"text",value:l,onChange:L=>s(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"https://your-domain.atlassian.net"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Project Key"}),g.jsx("input",{type:"text",value:c,onChange:L=>f(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"e.g. PROJ"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Email"}),g.jsx("input",{type:"email",value:d,onChange:L=>m(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"you@company.com"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"API Token"}),g.jsx("input",{type:"password",value:p,onChange:L=>y(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"Jira API token",autoComplete:"off"})]}),r&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{className:"text-xs text-dark-muted",children:"Enabled"}),g.jsx("button",{type:"button",onClick:()=>k(!S),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${S?"bg-[#3FB950]":"bg-dark-border"}`,children:g.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform ${S?"translate-x-4":"translate-x-0.5"}`})})]}),P&&g.jsx("div",{className:"text-xs rounded px-3 py-2 border",style:{color:P.ok?"#3FB950":"#F85149",borderColor:P.ok?"#3FB95040":"#F8514940",backgroundColor:P.ok?"#3FB95010":"#F8514910"},children:P.ok?`Connected successfully${P.projectName?` — project: ${P.projectName}`:""}`:P.error||"Connection failed"}),j&&g.jsx("div",{className:"text-xs text-[#F85149]",children:j})]}),g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-t border-dark-border",children:[g.jsx("button",{onClick:U,disabled:T,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors disabled:opacity-50",children:T?"Testing...":"Test Connection"}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("button",{onClick:i,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Cancel"}),g.jsx("button",{onClick:q,disabled:N,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors disabled:opacity-50",children:N?"Saving...":r?"Save":"Create"})]})]})]})}):null}function Bue({open:e,projectId:n,source:r,onClose:i,onSave:a}){const[l,s]=b.useState(""),[c,f]=b.useState(""),[d,m]=b.useState("gh-cli"),[p,y]=b.useState(""),[x,_]=b.useState(""),[S,k]=b.useState(!0),[j,C]=b.useState(null),[N,O]=b.useState(!1),[T,A]=b.useState(!1),[P,R]=b.useState(null),z=b.useRef(null);b.useEffect(()=>{if(e){if(r){try{const L=JSON.parse(r.configJson);s(L.owner||""),f(L.repo||""),m(L.authMode||"gh-cli")}catch{s(""),f(""),m("gh-cli")}y(""),r.hasCredentials&&fetch(`/api/projects/${n}/issue-sources/${r.id}/credentials`).then(L=>L.json()).then(L=>{if(L.credentialsJson)try{const $=JSON.parse(L.credentialsJson);y($.pat||"")}catch{}}).catch(()=>{}),_(r.label||""),k(r.enabled)}else s(""),f(""),m("gh-cli"),y(""),_(""),k(!0);C(null),R(null),O(!1),A(!1),setTimeout(()=>{var L;return(L=z.current)==null?void 0:L.focus()},50)}},[e,r,n]);const D=b.useCallback(()=>l.trim()?c.trim()?d==="pat"&&!p.trim()?"Personal Access Token is required":null:"Repository is required":"Owner is required",[l,c,d,p]),U=b.useCallback(async()=>{const L=D();if(L){C(L);return}C(null),R(null),A(!0);try{const G=await(await fetch(`/api/projects/${n}/issue-sources/test-connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:"github",owner:l.trim(),repo:c.trim(),authMode:d,...d==="pat"?{pat:p.trim()}:{}})})).json();R(G)}catch($){R({ok:!1,error:$ instanceof Error?$.message:"Unknown error"})}finally{A(!1)}},[D,n,l,c,d,p]),q=b.useCallback(async()=>{const L=D();if(L){C(L);return}C(null),O(!0);try{const $=JSON.stringify({owner:l.trim(),repo:c.trim(),authMode:d}),G=d==="pat"?JSON.stringify({pat:p.trim()}):"";await a({provider:"github",label:x.trim()||null,configJson:$,credentialsJson:G,enabled:S})}catch($){C($ instanceof Error?$.message:"Failed to save"),O(!1)}},[D,l,c,d,p,x,S,a]);return e?g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:L=>{L.target===L.currentTarget&&i()},children:g.jsxs("div",{className:"w-[480px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:r?"Edit GitHub Source":"Add GitHub Source"}),g.jsx("button",{onClick:i,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"px-5 py-4 space-y-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Label (optional)"}),g.jsx("input",{type:"text",value:x,onChange:L=>_(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"e.g. My GitHub Repo"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Owner"}),g.jsx("input",{ref:z,type:"text",value:l,onChange:L=>s(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"e.g. octocat"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Repository"}),g.jsx("input",{type:"text",value:c,onChange:L=>f(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"e.g. hello-world"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Authentication"}),g.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[g.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-dark-text cursor-pointer",children:[g.jsx("input",{type:"radio",name:"authMode",value:"gh-cli",checked:d==="gh-cli",onChange:()=>m("gh-cli"),className:"accent-[#3FB950]"}),"gh CLI (default)"]}),g.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-dark-text cursor-pointer",children:[g.jsx("input",{type:"radio",name:"authMode",value:"pat",checked:d==="pat",onChange:()=>m("pat"),className:"accent-[#3FB950]"}),"Personal Access Token"]})]})]}),d==="gh-cli"&&g.jsxs("div",{className:"text-xs text-dark-muted/70 bg-dark-base/50 rounded px-3 py-2 border border-dark-border/50",children:["Uses local ",g.jsx("code",{className:"text-dark-accent/80",children:"gh auth"})," session -- no credentials needed."]}),d==="pat"&&g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Personal Access Token"}),g.jsx("input",{type:"password",value:p,onChange:L=>y(L.target.value),onKeyDown:L=>{L.key==="Escape"&&i()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"ghp_xxxxxxxxxxxx",autoComplete:"off"})]}),r&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{className:"text-xs text-dark-muted",children:"Enabled"}),g.jsx("button",{type:"button",onClick:()=>k(!S),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${S?"bg-[#3FB950]":"bg-dark-border"}`,children:g.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform ${S?"translate-x-4":"translate-x-0.5"}`})})]}),P&&g.jsx("div",{className:"text-xs rounded px-3 py-2 border",style:{color:P.ok?"#3FB950":"#F85149",borderColor:P.ok?"#3FB95040":"#F8514940",backgroundColor:P.ok?"#3FB95010":"#F8514910"},children:P.ok?`Connected successfully${P.repoName?` -- repo: ${P.repoName}`:""}`:P.error||"Connection failed"}),j&&g.jsx("div",{className:"text-xs text-[#F85149]",children:j})]}),g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-t border-dark-border",children:[g.jsx("button",{onClick:U,disabled:T,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors disabled:opacity-50",children:T?"Testing...":"Test Connection"}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("button",{onClick:i,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Cancel"}),g.jsx("button",{onClick:q,disabled:N,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors disabled:opacity-50",children:N?"Saving...":r?"Save":"Create"})]})]})]})}):null}function Fue({items:e}){const[n,r]=b.useState(!1),i=b.useRef(null),a=b.useCallback(l=>{l.stopPropagation(),r(s=>!s)},[]);return b.useEffect(()=>{if(!n)return;function l(s){i.current&&!i.current.contains(s.target)&&r(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n]),b.useEffect(()=>{if(!n)return;function l(s){s.key==="Escape"&&r(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[n]),g.jsxs("div",{ref:i,className:"relative",children:[g.jsx("button",{onClick:a,className:"p-1 rounded text-dark-muted hover:text-dark-text hover:bg-dark-border/30 transition-colors",title:"More actions",children:g.jsx(J7,{size:16})}),n&&g.jsx("div",{className:"absolute right-0 top-full mt-1 z-20 min-w-[140px] bg-dark-surface border border-dark-border rounded-lg shadow-lg py-1",children:e.map(l=>g.jsx("button",{onClick:s=>{s.stopPropagation(),r(!1),l.onClick()},className:`w-full text-left px-3 py-1.5 text-xs transition-colors ${l.danger?"text-[#F85149] hover:bg-[#F85149]/10":"text-dark-muted hover:text-dark-text hover:bg-dark-border/30"}`,children:l.label},l.label))})]})}const SO={active:{bg:"#3FB95020",text:"#3FB950",border:"#3FB95040"},archived:{bg:"#8B949E20",text:"#8B949E",border:"#8B949E40"}};function Uue(e){var m,p,y,x,_,S,k;if(!e.installStatus)return"#8B949E";const n=e.installStatus,r=(m=n.gitCommitStatus)==null?void 0:m.health;if(r==="red")return"#F85149";const i=((p=n.hooks)==null?void 0:p.installed)??!1,a=((x=(y=n.hooks)==null?void 0:y.files)==null?void 0:x.some(j=>j.hasCrlf))??!1,l=((_=n.prompt)==null?void 0:_.installed)??!1,s=((S=n.agents)==null?void 0:S.installed)??!1,c=((k=n.settings)==null?void 0:k.exists)??!1;return i&&!a&&l&&s&&c?(n.outdatedCount??0)>0||r==="amber"?"#D29922":"#3FB950":i||l||s||c||a?"#D29922":"#F85149"}function que(e,n){var r,i,a,l,s;if((r=n==null?void 0:n.installStatus)!=null&&r.gitCommitStatus){const c=n.installStatus.gitCommitStatus;if(c.health==="red"&&e==="#F85149"||c.health==="amber"&&e==="#D29922")return c.message}if(e==="#D29922"&&(n!=null&&n.installStatus)){const c=n.installStatus,f=((i=c.hooks)==null?void 0:i.installed)??!1,d=((a=c.prompt)==null?void 0:a.installed)??!1,m=((l=c.agents)==null?void 0:l.installed)??!1,p=((s=c.settings)==null?void 0:s.exists)??!1;if(f&&d&&m&&p&&(c.outdatedCount??0)>0)return`${c.outdatedCount} file${c.outdatedCount===1?"":"s"} outdated`}switch(e){case"#3FB950":return"All installed";case"#D29922":return"Partially installed";case"#F85149":return"Not installed";default:return"Unknown"}}function Hue({project:e,repoSettings:n}){var c,f,d,m,p,y,x,_,S,k,j,C,N,O,T,A,P,R,z,D,U,q,L,$,G,B,Y,ee;if(!e.installStatus)return g.jsx("span",{className:"text-xs text-dark-muted",title:"Install status unknown",children:"Status unknown"});const r=e.installStatus,i=r.currentVersion,a=[{key:"hooks",label:"hooks",installed:((c=r.hooks)==null?void 0:c.installed)??!1,hasCrlf:((d=(f=r.hooks)==null?void 0:f.files)==null?void 0:d.some(H=>H.hasCrlf))??!1,somePresent:(((m=r.hooks)==null?void 0:m.found)??0)>0,files:((p=r.hooks)==null?void 0:p.files)??[],summary:`Hook Scripts (${((y=r.hooks)==null?void 0:y.found)??0}/${((x=r.hooks)==null?void 0:x.total)??0})`,outdatedInCategory:(((_=r.hooks)==null?void 0:_.files)??[]).filter(H=>H.exists&&H.installedVersion!==i).length},{key:"prompt",label:"prompt",installed:((S=r.prompt)==null?void 0:S.installed)??!1,hasCrlf:!1,somePresent:((j=(k=r.prompt)==null?void 0:k.files)==null?void 0:j.some(H=>H.exists))??!1,files:((C=r.prompt)==null?void 0:C.files)??[],summary:"Prompt Files",outdatedInCategory:(((N=r.prompt)==null?void 0:N.files)??[]).filter(H=>H.exists&&H.installedVersion!==i).length},{key:"agents",label:"agents",installed:((O=r.agents)==null?void 0:O.installed)??!1,hasCrlf:!1,somePresent:((A=(T=r.agents)==null?void 0:T.files)==null?void 0:A.some(H=>H.exists))??!1,files:((P=r.agents)==null?void 0:P.files)??[],summary:"Agent Templates",outdatedInCategory:(((R=r.agents)==null?void 0:R.files)??[]).filter(H=>H.exists&&H.installedVersion!==i).length},{key:"guides",label:"guides",installed:((z=r.guides)==null?void 0:z.installed)??!1,hasCrlf:!1,somePresent:(((U=(D=r.guides)==null?void 0:D.files)==null?void 0:U.length)??0)>0,files:((q=r.guides)==null?void 0:q.files)??[],summary:`Guidebooks (${(($=(L=r.guides)==null?void 0:L.files)==null?void 0:$.length)??0})`,outdatedInCategory:(((G=r.guides)==null?void 0:G.files)??[]).filter(H=>H.exists&&H.installedVersion!==i).length}],l=((B=r.settings)==null?void 0:B.exists)&&r.settings.installedVersion!==i,s=[{key:"settings",label:"settings",exists:((Y=r.settings)==null?void 0:Y.exists)??!1,tooltip:(ee=r.settings)!=null&&ee.exists?l?`settings.json: v${r.settings.installedVersion||"?"} → v${i}`:"settings.json found":"settings.json missing",outdated:!!l}];return g.jsxs("div",{className:"flex items-center gap-3 text-xs flex-wrap",children:[a.map(H=>{const re=H.outdatedInCategory>0,F=H.installed&&!H.hasCrlf&&!re?"#3FB950":H.hasCrlf||re||H.somePresent?"#D29922":"#F85149",X=H.installed&&!H.hasCrlf&&!re?"✓":H.hasCrlf||re||H.somePresent?"⚠":"✗";return g.jsxs("div",{className:"relative group shrink-0",children:[g.jsxs("span",{className:"cursor-default",style:{color:F},children:[X," ",H.label]}),g.jsxs("div",{className:"hidden group-hover:block absolute z-10 bottom-full left-0 mb-1 p-2 rounded bg-[#1C2128] border border-[#30363D] shadow-lg text-xs min-w-48 max-h-64 overflow-auto",children:[g.jsx("div",{className:"font-medium mb-1 text-[#C9D1D9]",children:H.summary}),H.files.map(ae=>{const se=ae.exists&&ae.installedVersion!==i,ve=ae.exists?ae.hasCrlf||se?"#D29922":"#3FB950":"#F85149",we=ae.exists?ae.hasCrlf||se?"⚠":"✓":"✗",ce=ae.exists&&se?` (v${ae.installedVersion||"?"} → v${i})`:ae.hasCrlf?" (CRLF)":"";return g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[g.jsx("span",{style:{color:ve},children:we}),g.jsxs("span",{className:"text-[#8B949E] font-mono",children:[ae.name,ce]})]},ae.name)})]})]},H.key)}),s.map(H=>{const re=H.exists?H.outdated?"#D29922":"#3FB950":"#F85149",F=H.exists?H.outdated?"⚠":"✓":"✗";return g.jsxs("div",{className:"relative group shrink-0",children:[g.jsxs("span",{className:"cursor-default",style:{color:re},children:[F," ",H.label]}),g.jsx("div",{className:"hidden group-hover:block absolute z-10 bottom-full right-0 mb-1 p-2 rounded bg-[#1C2128] border border-[#30363D] shadow-lg text-xs whitespace-nowrap",children:g.jsx("span",{className:"text-[#C9D1D9]",children:H.tooltip})})]},H.key)}),r.gitCommitStatus&&g.jsxs("div",{className:"relative group shrink-0",children:[g.jsxs("span",{className:"cursor-default",style:{color:r.gitCommitStatus.health==="green"?"#3FB950":r.gitCommitStatus.health==="amber"?"#D29922":r.gitCommitStatus.health==="red"?"#F85149":"#8B949E"},children:[r.gitCommitStatus.health==="green"?"✓":r.gitCommitStatus.health==="amber"?"⚠":r.gitCommitStatus.health==="red"?"✗":"?"," committed"]}),g.jsxs("div",{className:"hidden group-hover:block absolute z-10 bottom-full right-0 mb-1 p-2 rounded bg-[#1C2128] border border-[#30363D] shadow-lg text-xs min-w-56 max-h-64 overflow-auto",children:[g.jsxs("div",{className:"font-medium mb-1 text-[#C9D1D9]",children:["Git Commit Status (",r.gitCommitStatus.defaultBranch,")"]}),g.jsx("div",{className:"text-[#8B949E] mb-1",children:r.gitCommitStatus.message}),r.gitCommitStatus.gitignored&&g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[g.jsx("span",{style:{color:"#F85149"},children:"✗"}),g.jsx("span",{className:"text-[#8B949E]",children:".claude/ is in .gitignore"})]}),r.gitCommitStatus.files.map(H=>{const re=H.committed?H.committedVersion&&H.committedVersion!==H.currentVersion?"#D29922":"#3FB950":"#F85149",F=H.committed?H.committedVersion&&H.committedVersion!==H.currentVersion?"⚠":"✓":"✗",X=H.committed&&H.committedVersion&&H.committedVersion!==H.currentVersion?` (v${H.committedVersion} → v${H.currentVersion})`:"";return g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[g.jsx("span",{style:{color:re},children:F}),g.jsxs("span",{className:"text-[#8B949E] font-mono text-[11px]",children:[H.path,X]})]},H.path)})]})]}),n&&g.jsxs("div",{className:"relative group shrink-0",children:[g.jsxs("span",{className:"cursor-default",style:{color:n.autoMergeEnabled?"#3FB950":"#D29922"},children:[n.autoMergeEnabled?"✓":"⚠"," github"]}),g.jsxs("div",{className:"hidden group-hover:block absolute z-10 bottom-full right-0 mb-1 p-2 rounded bg-[#1C2128] border border-[#30363D] shadow-lg text-xs min-w-52",children:[g.jsx("div",{className:"font-medium mb-1 text-[#C9D1D9]",children:"GitHub Repo Settings"}),g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[g.jsx("span",{style:{color:n.autoMergeEnabled?"#3FB950":"#D29922"},children:n.autoMergeEnabled?"✓":"⚠"}),g.jsx("span",{className:"text-[#8B949E]",children:n.autoMergeEnabled?"Auto-merge enabled":"Auto-merge disabled — required for gh pr merge --auto"})]}),g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[g.jsx("span",{style:{color:"#8B949E"},children:"•"}),g.jsxs("span",{className:"text-[#8B949E]",children:["Default branch: ",n.defaultBranch]})]}),n.branchProtection&&g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[g.jsx("span",{style:{color:n.branchProtection.enabled?"#3FB950":"#8B949E"},children:n.branchProtection.enabled?"✓":"•"}),g.jsx("span",{className:"text-[#8B949E]",children:n.branchProtection.enabled?`Branch protection (${n.branchProtection.requiredChecks.length} required check${n.branchProtection.requiredChecks.length!==1?"s":""})`:"No branch protection"})]})]})]})]})}function KD(e){try{const n=JSON.parse(e);return typeof n.authMode=="string"?n.authMode:"gh-cli"}catch{return"gh-cli"}}function Gue(e){return e.enabled?e.provider==="github"&&KD(e.configJson)==="gh-cli"||e.hasCredentials?"#3FB950":"#F85149":"#8B949E"}function Kue(e){return e.enabled?e.provider==="github"&&KD(e.configJson)==="gh-cli"?"Ready (gh CLI)":e.hasCredentials?"Connected":"No credentials":"Disabled"}function Vue({projectId:e}){const n=Ot(),[r,i]=b.useState([]),[a,l]=b.useState(!0),[s,c]=b.useState("closed"),[f,d]=b.useState(null),[m,p]=b.useState(null),y=b.useCallback(async()=>{try{const k=await n.get(`projects/${e}/issue-sources`);i(Array.isArray(k.sources)?k.sources:[])}catch{}finally{l(!1)}},[n,e]);b.useEffect(()=>{y()},[y]);const x=b.useCallback(async k=>{f?await n.patch(`projects/${e}/issue-sources/${f.id}`,k):await n.post(`projects/${e}/issue-sources`,k),c("closed"),d(null),await y()},[n,e,f,y]),_=b.useCallback(async k=>{const j=r;i(r.map(C=>C.id===k.id?{...C,enabled:!C.enabled}:C));try{await n.patch(`projects/${e}/issue-sources/${k.id}`,{enabled:!k.enabled})}catch{i(j)}},[n,e,r]),S=b.useCallback(async k=>{try{await n.del(`projects/${e}/issue-sources/${k}`),i(r.filter(j=>j.id!==k)),p(null)}catch{}},[n,e,r]);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-1",children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-dark-muted/60 font-medium",children:"Issue Sources"}),g.jsx("button",{onClick:()=>{d(null),c("pick-provider")},className:"text-[10px] text-dark-accent/70 hover:text-dark-accent transition-colors",children:"+ Add Issue Source"})]}),a&&g.jsx("div",{className:"text-xs text-dark-muted",children:"Loading..."}),!a&&r.length===0&&g.jsx("div",{className:"text-xs text-dark-muted/60",children:"No issue sources configured"}),!a&&r.length>0&&g.jsx("div",{className:"space-y-1.5",children:r.map(k=>{const j=Gue(k),C=Kue(k);let N=k.label||k.provider;try{const O=JSON.parse(k.configJson);O.projectKey?N=k.label||`${k.provider} — ${O.projectKey}`:O.owner&&O.repo&&(N=k.label||`${O.owner}/${O.repo}`)}catch{}return g.jsxs("div",{className:"flex items-center gap-2 text-xs bg-dark-base/50 rounded px-2.5 py-1.5 border border-dark-border/50",children:[g.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:j},title:C}),g.jsx(Iu,{provider:k.provider,size:12,className:"shrink-0 text-dark-muted"}),g.jsx("span",{className:"text-dark-text/80 truncate flex-1",title:N,children:N}),g.jsx("span",{className:"text-[10px] shrink-0",style:{color:j},children:C}),g.jsx("button",{onClick:()=>_(k),className:`relative inline-flex h-4 w-7 items-center rounded-full transition-colors shrink-0 ${k.enabled?"bg-[#3FB950]":"bg-dark-border"}`,title:k.enabled?"Disable":"Enable",children:g.jsx("span",{className:`inline-block h-3 w-3 rounded-full bg-white transition-transform ${k.enabled?"translate-x-3.5":"translate-x-0.5"}`})}),g.jsx("button",{onClick:()=>{d(k),c(k.provider==="github"?"github":"jira")},className:"text-dark-muted/50 hover:text-dark-text transition-colors shrink-0",title:"Edit",children:g.jsx(Ny,{size:11})}),m===k.id?g.jsxs("span",{className:"flex items-center gap-1 shrink-0",children:[g.jsx("button",{onClick:()=>S(k.id),className:"text-[10px] text-[#F85149] hover:text-[#FF6E76] transition-colors",children:"Confirm"}),g.jsx("button",{onClick:()=>p(null),className:"text-[10px] text-dark-muted hover:text-dark-text transition-colors",children:"Cancel"})]}):g.jsx("button",{onClick:()=>p(k.id),className:"text-dark-muted/50 hover:text-[#F85149] transition-colors shrink-0",title:"Delete",children:g.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z",clipRule:"evenodd"})})})]},k.id)})}),s==="pick-provider"&&g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:k=>{k.target===k.currentTarget&&c("closed")},children:g.jsxs("div",{className:"w-[320px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:"Choose Provider"}),g.jsx("button",{onClick:()=>c("closed"),className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"px-5 py-4 space-y-2",children:[g.jsxs("button",{onClick:()=>c("github"),className:"w-full flex items-center gap-3 px-4 py-3 text-sm text-dark-text rounded border border-dark-border hover:border-dark-accent/50 hover:bg-dark-accent/5 transition-colors",children:[g.jsx(Iu,{provider:"github",size:18}),"GitHub"]}),g.jsxs("button",{onClick:()=>c("jira"),className:"w-full flex items-center gap-3 px-4 py-3 text-sm text-dark-text rounded border border-dark-border hover:border-dark-accent/50 hover:bg-dark-accent/5 transition-colors",children:[g.jsx(Iu,{provider:"jira",size:18}),"Jira"]})]})]})}),g.jsx(Bue,{open:s==="github",projectId:e,source:f,onClose:()=>{c("closed"),d(null)},onSave:x}),g.jsx($ue,{open:s==="jira",projectId:e,source:f,onClose:()=>{c("closed"),d(null)},onSave:x})]})}function jO({project:e,groups:n,reinstalling:r,reinstallResult:i,expanded:a,onToggleExpand:l,onSaveLimit:s,onSaveModel:c,onReinstall:f,onCleanup:d,onDelete:m,onEditPrompt:p,onGroupChange:y,fetchRepoSettings:x,onCommitClaudeFiles:_}){var B,Y,ee;const[S,k]=b.useState(void 0),[j,C]=b.useState(!1),[N,O]=b.useState(null),[T,A]=b.useState(!1),P=_O(e.maxActiveTeams),R=_O(e.model??"");b.useEffect(()=>{!a||T||(A(!0),x(e.id).then(H=>k(H)).catch(()=>k(null)))},[a,T,x,e.id]);const z=SO[e.status]||SO.active,D=Uue(e),U=que(D,e),q=e.queuedTeamCount??0,L=`${e.activeTeamCount}/${e.maxActiveTeams} active${q>0?` · ${q} queued`:""}`,$=b.useCallback(()=>{const H=P.confirmEdit();if(H===null)return;const re=Math.max(1,Math.min(50,H));s(e.id,re)},[P,s,e.id]),G=b.useCallback(()=>{const H=R.confirmEdit();H!==null&&c(e.id,H)},[R,c,e.id]);return g.jsxs("div",{className:"bg-dark-surface border border-dark-border rounded-lg overflow-hidden",children:[g.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-dark-border/10 transition-colors",onClick:l,children:[g.jsx(tL,{size:14,className:`text-dark-muted shrink-0 transition-transform ${a?"rotate-90":""}`}),g.jsx("span",{className:"text-sm font-semibold text-dark-text truncate min-w-0",children:e.name}),g.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium shrink-0",style:{backgroundColor:z.bg,color:z.text,border:`1px solid ${z.border}`},children:e.status}),g.jsx("span",{className:"text-xs text-dark-muted shrink-0",children:L}),g.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:D},title:U}),g.jsx("span",{className:"flex-1"}),(((B=e.installStatus)==null?void 0:B.outdatedCount)??0)>0&&g.jsxs("span",{className:"px-2 py-0.5 text-xs rounded-full bg-[#D29922]/15 text-[#D29922] font-medium shrink-0",children:[e.installStatus.outdatedCount," outdated"]}),g.jsx("button",{onClick:H=>{H.stopPropagation(),f(e)},disabled:r===e.id,className:"px-3 py-1 text-xs rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",title:(((Y=e.installStatus)==null?void 0:Y.outdatedCount)??0)>0?`Reinstall (${e.installStatus.outdatedCount} file${e.installStatus.outdatedCount===1?"":"s"} outdated)`:"(Re)install hooks, settings, and workflow prompt",children:r===e.id?"Installing...":"Reinstall"}),g.jsx(Fue,{items:[{label:"Clean Up",onClick:()=>d(e)},{label:"Delete",onClick:()=>m(e),danger:!0}]})]}),(i==null?void 0:i.id)===e.id&&g.jsx("div",{className:`mx-4 mb-2 px-3 py-1.5 rounded text-xs ${i.ok?"border border-[#3FB950]/30 bg-[#3FB950]/10 text-[#3FB950]":"border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149]"}`,children:i.ok?"Installation completed successfully":`Installation failed: ${i.error}`}),((ee=e.installStatus)==null?void 0:ee.gitCommitStatus)&&(e.installStatus.gitCommitStatus.health==="red"||e.installStatus.gitCommitStatus.health==="amber")&&g.jsxs("div",{className:`mx-4 mb-2 px-3 py-1.5 rounded text-xs flex items-center gap-2 ${e.installStatus.gitCommitStatus.health==="red"?"border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149]":"border border-[#D29922]/30 bg-[#D29922]/10 text-[#D29922]"}`,children:[g.jsxs("span",{className:"flex-1",children:[e.installStatus.gitCommitStatus.message,e.installStatus.gitCommitStatus.health==="red"&&!e.installStatus.gitCommitStatus.gitignored&&" — hooks and agents won't work in worktrees"]}),g.jsx("button",{onClick:async H=>{var X,ae;H.stopPropagation();const re=((ae=(X=e.installStatus)==null?void 0:X.gitCommitStatus)==null?void 0:ae.health)==="amber",F=re?"This will update and commit+push .claude/ files to the default branch. Continue?":"This will commit and push .claude/ files to the default branch. Continue?";if(window.confirm(F)){C(!0),O(null);try{const se=await _(e.id,{reinstall:re});O(se),se.ok&&!se.error&&setTimeout(()=>O(null),5e3)}catch(se){O({ok:!1,error:se instanceof Error?se.message:String(se)})}finally{C(!1)}}},disabled:j,className:`shrink-0 px-2 py-0.5 rounded border text-xs font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${e.installStatus.gitCommitStatus.health==="red"?"border-[#F85149]/40 text-[#F85149] bg-[#F85149]/10 hover:bg-[#F85149]/20":"border-[#D29922]/40 text-[#D29922] bg-[#D29922]/10 hover:bg-[#D29922]/20"}`,children:j?"Committing...":e.installStatus.gitCommitStatus.health==="amber"?"Update & Commit":"Fix"})]}),N&&g.jsx("div",{className:`mx-4 mb-2 px-3 py-1.5 rounded text-xs ${N.ok&&!N.error?"border border-[#3FB950]/30 bg-[#3FB950]/10 text-[#3FB950]":N.ok&&N.error?"border border-[#D29922]/30 bg-[#D29922]/10 text-[#D29922]":"border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149]"}`,children:N.ok?N.error?N.error:N.message??".claude/ files committed and pushed successfully":`Commit failed: ${N.error}`}),a&&g.jsxs("div",{className:"border-t border-dark-border px-4 py-3 space-y-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-dark-muted/60 font-medium mb-1",children:"Repository"}),g.jsxs("div",{className:"flex items-center gap-4 text-xs text-dark-muted",children:[g.jsx("span",{className:"truncate",title:e.repoPath,children:e.repoPath}),e.githubRepo&&g.jsx("span",{className:"shrink-0",children:e.githubRepo})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-dark-muted/60 font-medium mb-1",children:"Configuration"}),g.jsxs("div",{className:"flex items-center gap-4 text-xs text-dark-muted flex-wrap",children:[R.isEditing?g.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1",children:[g.jsx("span",{children:"Model:"}),g.jsx("input",{ref:R.inputRef,type:"text",value:R.editValue,onChange:H=>R.setEditValue(H.target.value),onKeyDown:H=>{H.key==="Enter"&&G(),H.key==="Escape"&&R.cancelEdit()},onBlur:G,placeholder:"default",className:"w-32 px-1 py-0 text-xs rounded border border-dark-accent bg-dark-base text-dark-text focus:outline-none"})]}):g.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 cursor-pointer hover:text-dark-text transition-colors group",onClick:()=>R.startEdit(e.model??""),title:"Click to edit model",children:["Model: ",e.model||"default",g.jsx(Ny,{size:11,className:"text-dark-muted/40 group-hover:text-dark-muted transition-colors"})]}),P.isEditing?g.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1",children:[g.jsx("span",{children:"Max teams:"}),g.jsx("input",{ref:P.inputRef,type:"number",value:P.editValue,onChange:H=>P.setEditValue(parseInt(H.target.value,10)||1),onKeyDown:H=>{H.key==="Enter"&&$(),H.key==="Escape"&&P.cancelEdit()},onBlur:$,min:1,max:50,className:"w-12 px-1 py-0 text-xs rounded border border-dark-accent bg-dark-base text-dark-text focus:outline-none"})]}):g.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 cursor-pointer hover:text-dark-text transition-colors group",onClick:()=>P.startEdit(e.maxActiveTeams),title:"Click to edit max active teams",children:["Max teams: ",e.maxActiveTeams,g.jsx(Ny,{size:11,className:"text-dark-muted/40 group-hover:text-dark-muted transition-colors"})]}),g.jsxs("select",{value:e.groupId??"",onChange:H=>{const re=H.target.value;y(e.id,re===""?null:parseInt(re,10))},onClick:H=>H.stopPropagation(),className:"shrink-0 px-1 py-0 text-xs rounded border border-dark-border bg-dark-base text-dark-muted hover:text-dark-text focus:outline-none cursor-pointer",title:"Assign to group",children:[g.jsx("option",{value:"",children:"No group"}),n.map(H=>g.jsx("option",{value:H.id,children:H.name},H.id))]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-dark-muted/60 font-medium mb-1",children:"Install Health"}),g.jsx(Hue,{project:e,repoSettings:S})]}),g.jsx(Vue,{projectId:e.id}),e.promptFile&&g.jsxs("div",{children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-dark-muted/60 font-medium mb-1",children:"Prompt"}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-dark-muted",children:[g.jsx("span",{className:"truncate text-dark-text/70",title:e.promptFile,children:e.promptFile}),g.jsx("button",{onClick:()=>p(e.id),className:"shrink-0 text-dark-accent/70 hover:text-dark-accent transition-colors",title:"Edit launch prompt",children:"Edit"})]})]})]})]})}function EO({title:e,description:n,projectCount:r,expanded:i,onToggleExpand:a,onEdit:l,onDelete:s,children:c}){return g.jsxs("div",{className:"mb-4",children:[g.jsxs("button",{onClick:a,className:"flex items-center gap-2 w-full text-left py-2 group",children:[g.jsx("svg",{className:`w-3.5 h-3.5 text-dark-muted transition-transform ${i?"rotate-90":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),g.jsx("span",{className:"text-sm font-semibold text-dark-text",children:e}),g.jsxs("span",{className:"text-xs text-dark-muted",children:["(",r,")"]}),n&&g.jsx("span",{className:"text-xs text-dark-muted/60 truncate ml-2",children:n}),l&&g.jsx("span",{onClick:f=>{f.stopPropagation(),l()},className:"ml-auto text-xs text-dark-muted hover:text-dark-text transition-colors opacity-0 group-hover:opacity-100 px-1",title:"Edit group",children:"Edit"}),s&&g.jsx("span",{onClick:f=>{f.stopPropagation(),s()},className:"text-xs text-[#F85149]/70 hover:text-[#F85149] transition-colors opacity-0 group-hover:opacity-100 px-1",title:"Delete group",children:"Delete"})]}),i&&g.jsx("div",{className:"space-y-3 ml-5",children:c})]})}function Yue({open:e,group:n,onClose:r,onSave:i}){const[a,l]=b.useState((n==null?void 0:n.name)??""),[s,c]=b.useState((n==null?void 0:n.description)??""),[f,d]=b.useState(null),m=b.useRef(null);if(b.useEffect(()=>{e&&(l((n==null?void 0:n.name)??""),c((n==null?void 0:n.description)??""),d(null),setTimeout(()=>{var y;return(y=m.current)==null?void 0:y.focus()},50))},[e,n]),!e)return null;const p=()=>{if(!a.trim()){d("Name is required");return}i(a.trim(),s.trim()||null)};return g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:y=>{y.target===y.currentTarget&&r()},children:g.jsxs("div",{className:"w-[400px] max-w-[95vw] bg-dark-surface border border-dark-border rounded-lg shadow-2xl",role:"dialog","aria-modal":"true",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:n?"Edit Group":"New Group"}),g.jsx("button",{onClick:r,className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsxs("div",{className:"px-5 py-4 space-y-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Name"}),g.jsx("input",{ref:m,type:"text",value:a,onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Enter"&&p(),y.key==="Escape"&&r()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"e.g. Backend Services"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-xs text-dark-muted mb-1",children:"Description (optional)"}),g.jsx("input",{type:"text",value:s,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&p(),y.key==="Escape"&&r()},className:"w-full px-3 py-1.5 text-sm rounded border border-dark-border bg-dark-base text-dark-text focus:outline-none focus:border-dark-accent",placeholder:"Short description of this group"})]}),f&&g.jsx("div",{className:"text-xs text-[#F85149]",children:f})]}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-4 border-t border-dark-border",children:[g.jsx("button",{onClick:r,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Cancel"}),g.jsx("button",{onClick:p,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors",children:n?"Save":"Create"})]})]})})}function Wue(){const e=Ot(),[n,r]=b.useState([]),[i,a]=b.useState([]),[l,s]=b.useState(!0),[c,f]=b.useState(!1),d=Pue(),[m,p]=b.useState(!1),[y,x]=b.useState(null),[_,S]=b.useState(null),[k,j]=b.useState(null),[C,N]=b.useState(""),[O,T]=b.useState(!1),[A,P]=b.useState(!1),[R,z]=b.useState(null),[D,U]=b.useState(null),[q,L]=b.useState(null),$=b.useCallback(async()=>{try{const J=await e.get("projects");r(J)}catch{}finally{s(!1)}},[e]),G=b.useCallback(async()=>{try{const J=await e.get("project-groups");a(J)}catch{}},[e]),B=b.useCallback(async J=>{try{return await e.get(`projects/${J}/repo-settings`)}catch{return null}},[e]);b.useEffect(()=>{$(),G()},[$,G]);const Y=b.useCallback(()=>{x(null),p(!0)},[]),ee=b.useCallback(J=>{x(J),p(!0)},[]),H=b.useCallback(async J=>{if(window.confirm(`Delete group "${J.name}"? Projects in this group will become ungrouped.`))try{await e.del(`project-groups/${J.id}`),await G(),await $()}catch(K){window.alert(`Failed to delete group: ${K instanceof Error?K.message:String(K)}`)}},[e,G,$]),re=b.useCallback(async(J,ye)=>{try{y?await e.put(`project-groups/${y.id}`,{name:J,description:ye}):await e.post("project-groups",{name:J,description:ye}),p(!1),await G()}catch(K){window.alert(`Failed to save group: ${K instanceof Error?K.message:String(K)}`)}},[e,y,G]),F=b.useCallback(async(J,ye)=>{r(K=>K.map(ge=>ge.id===J?{...ge,groupId:ye}:ge));try{await e.put(`projects/${J}`,{groupId:ye}),await G()}catch{await $(),await G()}},[e,$,G]),X=b.useCallback(async J=>{if(window.confirm(`Delete project "${J.name}"? This will stop all active teams and remove the project.`)){r(K=>K.filter(ge=>ge.id!==J.id));try{await e.del(`projects/${J.id}`),await G()}catch(K){await $(),await G(),window.alert(`Failed to delete project: ${K instanceof Error?K.message:String(K)}`)}}},[e,$,G]),ae=b.useCallback(()=>{f(!1),$()},[$]),se=b.useCallback(async J=>{U(J.id),L(null);try{const ye=await e.post(`projects/${J.id}/install`,{});L({id:J.id,ok:ye.ok,error:ye.error}),ye.installStatus&&r(K=>K.map(ge=>ge.id===J.id?{...ge,installStatus:ye.installStatus}:ge))}catch(ye){L({id:J.id,ok:!1,error:ye instanceof Error?ye.message:String(ye)})}finally{U(null)}},[e]),ve=b.useCallback(async(J,ye)=>{try{const K=await e.post(`projects/${J}/commit-claude-files`,{reinstall:ye==null?void 0:ye.reinstall});return await $(),K}catch(K){return{ok:!1,error:K instanceof Error?K.message:String(K)}}},[e,$]),we=b.useCallback(J=>{S(J.id)},[]),ce=b.useCallback(()=>{S(null)},[]),Se=b.useCallback(()=>{$()},[$]),me=b.useCallback(async(J,ye)=>{r(K=>K.map(ge=>ge.id===J?{...ge,maxActiveTeams:ye}:ge));try{await e.put(`projects/${J}`,{maxActiveTeams:ye})}catch{await $()}},[e,$]),pe=b.useCallback(async(J,ye)=>{const K=ye.trim()||null;r(ge=>ge.map(be=>be.id===J?{...be,model:K}:be));try{await e.put(`projects/${J}`,{model:K})}catch{await $()}},[e,$]);b.useEffect(()=>{k!==null&&(T(!0),z(null),e.get(`projects/${k}/prompt`).then(J=>{N(J.content)}).catch(J=>{z(J instanceof Error?J.message:String(J))}).finally(()=>{T(!1)}))},[k,e]),b.useEffect(()=>{if(k===null)return;function J(ye){ye.key==="Escape"&&j(null)}return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[k]);const Ee=b.useCallback(async()=>{if(k!==null){P(!0),z(null);try{await e.put(`projects/${k}/prompt`,{content:C}),j(null)}catch(J){z(J instanceof Error?J.message:String(J))}finally{P(!1)}}},[k,C,e]),{groupedSections:he,ungroupedProjects:Be}=b.useMemo(()=>{const J=n.filter(K=>K.groupId==null);return{groupedSections:i.map(K=>({group:K,projects:n.filter(ge=>ge.groupId===K.id)})),ungroupedProjects:J}},[n,i]);b.useEffect(()=>{if(i.length===0&&Be.length===0)return;const J=[...i.map(ye=>`group:${ye.id}`),...Be.length>0?["group:ungrouped"]:[]];d.seedExpanded(J)},[i,Be.length,d.seedExpanded]);const Me={groups:i,reinstalling:D,reinstallResult:q,onSaveLimit:me,onSaveModel:pe,onReinstall:se,onCleanup:we,onDelete:X,onEditPrompt:j,onGroupChange:F,fetchRepoSettings:B,onCommitClaudeFiles:ve};return l?g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("p",{className:"text-dark-muted text-sm",children:"Loading projects..."})}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"p-6 max-w-5xl mx-auto",children:[g.jsxs("div",{className:"flex items-center justify-between mb-6",children:[g.jsx("h1",{className:"text-xl font-semibold text-dark-text",children:"Projects"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{onClick:Y,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"New Group"}),g.jsx("button",{onClick:()=>f(!0),className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors",children:"Add Project"})]})]}),n.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-3",children:[g.jsx("svg",{className:"w-12 h-12 text-dark-muted/40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})}),g.jsx("p",{className:"text-dark-muted text-lg",children:"No projects yet"}),g.jsx("p",{className:"text-dark-muted/60 text-sm",children:"Add your first project to get started."})]}):g.jsxs("div",{children:[he.map(({group:J,projects:ye})=>g.jsx(EO,{title:J.name,description:J.description,projectCount:ye.length,expanded:d.isExpanded(`group:${J.id}`),onToggleExpand:()=>d.toggle(`group:${J.id}`),onEdit:()=>ee(J),onDelete:()=>H(J),children:ye.length===0?g.jsx("p",{className:"text-xs text-dark-muted/60 py-2",children:"No projects in this group"}):ye.map(K=>g.jsx(jO,{project:K,expanded:d.isExpanded(`project:${K.id}`),onToggleExpand:()=>d.toggle(`project:${K.id}`),...Me},K.id))},J.id)),Be.length>0&&g.jsx(EO,{title:"Ungrouped",projectCount:Be.length,expanded:d.isExpanded("group:ungrouped"),onToggleExpand:()=>d.toggle("group:ungrouped"),children:Be.map(J=>g.jsx(jO,{project:J,expanded:d.isExpanded(`project:${J.id}`),onToggleExpand:()=>d.toggle(`project:${J.id}`),...Me},J.id))})]})]}),g.jsx(Due,{open:c,onClose:()=>f(!1),onAdded:ae}),_!==null&&g.jsx(Iue,{projectId:_,open:!0,onClose:ce,onDone:Se}),g.jsx(Yue,{open:m,group:y,onClose:()=>p(!1),onSave:re}),k!==null&&g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:J=>{J.target===J.currentTarget&&j(null)},children:g.jsxs("div",{className:"w-[600px] max-w-[95vw] max-h-[80vh] bg-dark-surface border border-dark-border rounded-lg shadow-2xl flex flex-col",role:"dialog","aria-modal":"true",children:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-dark-border shrink-0",children:[g.jsx("h2",{className:"text-base font-semibold text-dark-text",children:"Edit Launch Prompt"}),g.jsx("button",{onClick:()=>j(null),className:"text-dark-muted hover:text-dark-text transition-colors p-1 rounded hover:bg-dark-border/30",title:"Close",children:g.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),g.jsx("div",{className:"px-5 py-4 flex-1 overflow-y-auto",children:O?g.jsx("p",{className:"text-dark-muted text-sm",children:"Loading prompt..."}):g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"text-xs text-dark-muted mb-2",children:["Use ",g.jsx("code",{className:"text-dark-accent/70",children:"{{ISSUE_NUMBER}}"})," as a placeholder -- it will be replaced with the actual issue number at launch time."]}),g.jsx("textarea",{value:C,onChange:J=>N(J.target.value),className:"w-full h-48 px-3 py-2 text-sm rounded border border-dark-border bg-dark-base text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-dark-accent focus:ring-1 focus:ring-dark-accent/30 font-mono resize-y",disabled:A}),R&&g.jsx("div",{className:"mt-2 px-3 py-2 rounded border border-[#F85149]/30 bg-[#F85149]/10 text-[#F85149] text-sm",children:R})]})}),g.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-4 border-t border-dark-border shrink-0",children:[g.jsx("button",{onClick:()=>j(null),className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors",children:"Cancel"}),g.jsx("button",{onClick:Ee,disabled:A||O,className:"px-4 py-1.5 text-sm font-medium rounded border border-dark-accent/40 text-dark-accent bg-dark-accent/10 hover:bg-dark-accent/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:A?"Saving...":"Save Prompt"})]})]})})]})}function Ou(e){const n=Number(e);return n>=6e4?`${n/1e3}s (${n/6e4}min)`:n>=1e3?`${n/1e3}s`:`${n}ms`}const Xue=[{title:"Server",rows:[{key:"host",label:"Host",envVar:"FLEET_HOST",description:"Network interface to bind to"},{key:"port",label:"Port",envVar:"PORT",description:"HTTP server port"},{key:"claudeCmd",label:"Claude Command",envVar:"FLEET_CLAUDE_CMD",description:"CLI command used to invoke Claude"},{key:"resolvedClaudeCmd",label:"Resolved Claude Path",envVar:"(auto-detected)",description:"Actual path used after auto-detection (Windows) or explicit override"},{key:"enableAgentTeams",label:"Agent Teams",envVar:"FLEET_ENABLE_AGENT_TEAMS",description:"Enable CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS env var for spawned CC processes",format:e=>e?"Enabled":"Disabled"},{key:"outputBufferLines",label:"Output Buffer Lines",envVar:"(hardcoded)",description:"Max lines kept in team output buffer"}]},{title:"Thresholds",rows:[{key:"idleThresholdMin",label:"Idle Threshold",envVar:"FLEET_IDLE_THRESHOLD_MIN",description:"Minutes before a team is considered idle",format:e=>`${e} min`},{key:"stuckThresholdMin",label:"Stuck Threshold",envVar:"FLEET_STUCK_THRESHOLD_MIN",description:"Minutes before a team is considered stuck",format:e=>`${e} min`},{key:"launchTimeoutMin",label:"Launch Timeout",envVar:"FLEET_LAUNCH_TIMEOUT_MIN",description:"Minutes before a launching team is marked failed",format:e=>`${e} min`},{key:"maxUniqueCiFailures",label:"Max CI Failures",envVar:"FLEET_MAX_CI_FAILURES",description:"Unique CI failures before a team is blocked"},{key:"earlyCrashThresholdSec",label:"Early Crash Threshold",envVar:"FLEET_EARLY_CRASH_THRESHOLD_SEC",description:"Seconds before a SubagentStop is considered an early crash",format:e=>`${e}s`},{key:"earlyCrashMinTools",label:"Early Crash Min Tools",envVar:"FLEET_EARLY_CRASH_MIN_TOOLS",description:"Minimum tool-use events for a subagent to be considered healthy"}]},{title:"Polling Intervals",rows:[{key:"githubPollIntervalMs",label:"GitHub Poll Interval",envVar:"FLEET_GITHUB_POLL_MS",description:"How often to poll GitHub for PR/CI updates",format:Ou},{key:"issuePollIntervalMs",label:"Issue Poll Interval",envVar:"FLEET_ISSUE_POLL_MS",description:"How often to poll for new issues",format:Ou},{key:"stuckCheckIntervalMs",label:"Stuck Check Interval",envVar:"FLEET_STUCK_CHECK_MS",description:"How often to check for stuck teams",format:Ou},{key:"usagePollIntervalMs",label:"Usage Poll Interval",envVar:"FLEET_USAGE_POLL_MS",description:"How often to poll API usage data",format:Ou},{key:"sseHeartbeatMs",label:"SSE Heartbeat",envVar:"(hardcoded)",description:"Interval between SSE keepalive pings",format:Ou}]},{title:"Paths",rows:[{key:"fleetCommanderRoot",label:"Fleet Commander Root",envVar:"FLEET_COMMANDER_ROOT",description:"Installation root directory"},{key:"dbPath",label:"Database Path",envVar:"FLEET_DB_PATH",description:"SQLite database file location"}]}];function Zue(){const e=Ot(),[n,r]=b.useState(null),[i,a]=b.useState(!0),[l,s]=b.useState(null),[c,f]=b.useState(!1),[d,m]=b.useState(!1),[p,y]=b.useState(""),x=b.useCallback(async()=>{try{const S=await e.get("settings");r(S),s(null)}catch(S){s(S instanceof Error?S.message:String(S))}finally{a(!1)}},[e]);b.useEffect(()=>{x()},[x]);const _=async()=>{f(!0);try{await e.post("system/factory-reset",{confirm:"FACTORY_RESET"}),window.location.href="/"}catch(S){alert("Factory reset failed: "+(S instanceof Error?S.message:String(S)))}finally{f(!1)}};return i?g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("p",{className:"text-dark-muted text-sm",children:"Loading settings..."})}):l?g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsxs("div",{className:"text-center",children:[g.jsx("p",{className:"text-[#F85149] text-sm mb-2",children:"Failed to load settings"}),g.jsx("p",{className:"text-dark-muted text-xs",children:l})]})}):n?g.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[g.jsxs("div",{className:"mb-6",children:[g.jsx("h1",{className:"text-xl font-semibold text-dark-text",children:"Settings"}),g.jsx("p",{className:"text-dark-muted text-sm mt-1",children:"Current runtime configuration. Set via environment variables — changes require a server restart."})]}),g.jsx("div",{className:"space-y-6",children:Xue.map(S=>g.jsxs("div",{children:[g.jsx("h2",{className:"text-sm font-semibold text-dark-muted uppercase tracking-wider mb-2",children:S.title}),g.jsx("div",{className:"bg-dark-surface border border-dark-border rounded-lg overflow-hidden",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-dark-border",children:[g.jsx("th",{className:"text-left px-4 py-2 text-xs font-medium text-dark-muted uppercase tracking-wider w-[180px]",children:"Setting"}),g.jsx("th",{className:"text-left px-4 py-2 text-xs font-medium text-dark-muted uppercase tracking-wider w-[200px]",children:"Value"}),g.jsx("th",{className:"text-left px-4 py-2 text-xs font-medium text-dark-muted uppercase tracking-wider w-[200px]",children:"Env Variable"}),g.jsx("th",{className:"text-left px-4 py-2 text-xs font-medium text-dark-muted uppercase tracking-wider",children:"Description"})]})}),g.jsx("tbody",{children:S.rows.map((k,j)=>{const C=n[k.key],N=k.format?k.format(C):String(C);return g.jsxs("tr",{className:`border-b border-dark-border/50 last:border-b-0 ${j%2===1?"bg-dark-base/30":""}`,children:[g.jsx("td",{className:"px-4 py-2.5 text-dark-text font-medium",children:k.label}),g.jsx("td",{className:"px-4 py-2.5",children:g.jsx("code",{className:"text-dark-accent font-mono text-xs bg-dark-base/50 px-1.5 py-0.5 rounded",children:N})}),g.jsx("td",{className:"px-4 py-2.5",children:g.jsx("code",{className:"text-dark-muted font-mono text-xs",children:k.envVar})}),g.jsx("td",{className:"px-4 py-2.5 text-dark-muted",children:k.description})]},k.key)})})]})})]},S.title))}),g.jsxs("div",{className:"mt-6 bg-dark-surface border border-dark-border rounded-lg px-4 py-3",children:[g.jsx("h2",{className:"text-sm font-semibold text-dark-muted uppercase tracking-wider mb-1",children:"Launch Prompt"}),g.jsxs("p",{className:"text-dark-muted text-sm",children:["Configured per-project via prompt files:"," ",g.jsx("code",{className:"text-dark-accent font-mono text-xs bg-dark-base/50 px-1.5 py-0.5 rounded",children:"prompts/{slug}-prompt.md"})]})]}),g.jsxs("div",{className:"mt-8 border border-[#F85149]/30 rounded p-4",children:[g.jsx("h3",{className:"text-[#F85149] font-semibold mb-2",children:"Danger Zone"}),g.jsx("p",{className:"text-[#8B949E] text-sm mb-3",children:"Factory reset will stop all running teams, uninstall hooks from all projects, and delete all data. The database will be recreated fresh with default settings."}),d?g.jsxs("div",{className:"mt-2 p-3 bg-[#F85149]/5 border border-[#F85149]/30 rounded",children:[g.jsx("p",{className:"text-[#F85149] text-sm font-medium mb-1",children:"This action cannot be undone."}),g.jsxs("p",{className:"text-[#8B949E] text-sm mb-3",children:["Type ",g.jsx("code",{className:"font-mono text-xs bg-dark-base/50 px-1.5 py-0.5 rounded text-dark-accent",children:"FACTORY_RESET"})," to confirm."]}),g.jsx("input",{type:"text",value:p,onChange:S=>y(S.target.value),placeholder:"FACTORY_RESET",autoFocus:!0,className:"w-full px-3 py-1.5 text-sm font-mono bg-dark-base border border-dark-border rounded text-dark-text placeholder:text-dark-muted/50 focus:outline-none focus:border-[#F85149]/60 mb-3"}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("button",{onClick:_,disabled:c||p!=="FACTORY_RESET",className:"px-4 py-1.5 text-sm font-medium rounded border border-[#F85149]/40 text-[#F85149] bg-[#F85149]/10 hover:bg-[#F85149]/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:c?"Resetting...":"Confirm Factory Reset"}),g.jsx("button",{onClick:()=>{m(!1),y("")},disabled:c,className:"px-3 py-1.5 text-sm rounded border border-dark-border text-dark-muted hover:text-dark-text hover:border-dark-muted transition-colors disabled:opacity-50",children:"Cancel"})]})]}):g.jsx("button",{onClick:()=>m(!0),disabled:c,className:"px-4 py-2 text-sm bg-[#F85149]/10 text-[#F85149] border border-[#F85149]/40 rounded hover:bg-[#F85149]/20 disabled:opacity-50",children:"Factory Reset"})]})]}):null}var VD=Object.defineProperty,Que=(e,n,r)=>n in e?VD(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Jue=(e,n)=>{for(var r in n)VD(e,r,{get:n[r],enumerable:!0})},ece=(e,n,r)=>Que(e,n+"",r),YD={};Jue(YD,{Graph:()=>Sr,alg:()=>o2,json:()=>XD,version:()=>rce});var tce=Object.defineProperty,WD=(e,n)=>{for(var r in n)tce(e,r,{get:n[r],enumerable:!0})},Sr=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,n){return e.forEach(r=>{n!==void 0?this.setNode(r,n):this.setNode(r)}),this}setNode(e,n){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let n=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(r=>{this.setParent(r)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let r=n;r!==void 0;r=this.parent(r))if(r===e)throw new Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this}parent(e){if(this._isCompound){let n=this._parent[e];if(n!=="\0")return n}}children(e="\0"){if(this._isCompound){let n=this._children[e];if(n)return Object.keys(n)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let n=this._preds[e];if(n)return Object.keys(n)}successors(e){let n=this._sucs[e];if(n)return Object.keys(n)}neighbors(e){let n=this.predecessors(e);if(n){let r=new Set(n);for(let i of this.successors(e))r.add(i);return Array.from(r.values())}}isLeaf(e){let n;return this.isDirected()?n=this.successors(e):n=this.neighbors(e),n.length===0}filterNodes(e){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([a,l])=>{e(a)&&n.setNode(a,l)}),Object.values(this._edgeObjs).forEach(a=>{n.hasNode(a.v)&&n.hasNode(a.w)&&n.setEdge(a,this.edge(a))});let r={},i=a=>{let l=this.parent(a);return!l||n.hasNode(l)?(r[a]=l??void 0,l??void 0):l in r?r[l]:i(l)};return this._isCompound&&n.nodes().forEach(a=>n.setParent(a,i(a))),n}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,n){return e.reduce((r,i)=>(n!==void 0?this.setEdge(r,i,n):this.setEdge(r,i),i)),this}setEdge(e,n,r,i){let a,l,s,c,f=!1;typeof e=="object"&&e!==null&&"v"in e?(a=e.v,l=e.w,s=e.name,arguments.length===2&&(c=n,f=!0)):(a=e,l=n,s=i,arguments.length>2&&(c=r,f=!0)),a=""+a,l=""+l,s!==void 0&&(s=""+s);let d=zu(this._isDirected,a,l,s);if(d in this._edgeLabels)return f&&(this._edgeLabels[d]=c),this;if(s!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(a),this.setNode(l),this._edgeLabels[d]=f?c:this._defaultEdgeLabelFn(a,l,s);let m=nce(this._isDirected,a,l,s);return a=m.v,l=m.w,Object.freeze(m),this._edgeObjs[d]=m,CO(this._preds[l],a),CO(this._sucs[a],l),this._in[l][d]=m,this._out[a][d]=m,this._edgeCount++,this}edge(e,n,r){let i=arguments.length===1?by(this._isDirected,e):zu(this._isDirected,e,n,r);return this._edgeLabels[i]}edgeAsObj(e,n,r){let i=arguments.length===1?this.edge(e):this.edge(e,n,r);return typeof i!="object"?{label:i}:i}hasEdge(e,n,r){return(arguments.length===1?by(this._isDirected,e):zu(this._isDirected,e,n,r))in this._edgeLabels}removeEdge(e,n,r){let i=arguments.length===1?by(this._isDirected,e):zu(this._isDirected,e,n,r),a=this._edgeObjs[i];if(a){let l=a.v,s=a.w;delete this._edgeLabels[i],delete this._edgeObjs[i],NO(this._preds[s],l),NO(this._sucs[l],s),delete this._in[s][i],delete this._out[l][i],this._edgeCount--}return this}inEdges(e,n){return this.isDirected()?this.filterEdges(this._in[e],e,n):this.nodeEdges(e,n)}outEdges(e,n){return this.isDirected()?this.filterEdges(this._out[e],e,n):this.nodeEdges(e,n)}nodeEdges(e,n){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,n)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,n,r){if(!e)return;let i=Object.values(e);return r?i.filter(a=>a.v===n&&a.w===r||a.v===r&&a.w===n):i}};function CO(e,n){e[n]?e[n]++:e[n]=1}function NO(e,n){e[n]!==void 0&&!--e[n]&&delete e[n]}function zu(e,n,r,i){let a=""+n,l=""+r;if(!e&&a>l){let s=a;a=l,l=s}return a+""+l+""+(i===void 0?"\0":i)}function nce(e,n,r,i){let a=""+n,l=""+r;if(!e&&a>l){let c=a;a=l,l=c}let s={v:a,w:l};return i&&(s.name=i),s}function by(e,n){return zu(e,n.v,n.w,n.name)}var rce="4.0.1",XD={};WD(XD,{read:()=>oce,write:()=>ice});function ice(e){let n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ace(e),edges:lce(e)},r=e.graph();return r!==void 0&&(n.value=structuredClone(r)),n}function ace(e){return e.nodes().map(n=>{let r=e.node(n),i=e.parent(n),a={v:n};return r!==void 0&&(a.value=r),i!==void 0&&(a.parent=i),a})}function lce(e){return e.edges().map(n=>{let r=e.edge(n),i={v:n.v,w:n.w};return n.name!==void 0&&(i.name=n.name),r!==void 0&&(i.value=r),i})}function oce(e){let n=new Sr(e.options);return e.value!==void 0&&n.setGraph(e.value),e.nodes.forEach(r=>{n.setNode(r.v,r.value),r.parent&&n.setParent(r.v,r.parent)}),e.edges.forEach(r=>{n.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),n}var o2={};WD(o2,{CycleException:()=>tm,bellmanFord:()=>ZD,components:()=>cce,dijkstra:()=>em,dijkstraAll:()=>hce,findCycles:()=>mce,floydWarshall:()=>gce,isAcyclic:()=>yce,postorder:()=>bce,preorder:()=>wce,prim:()=>_ce,shortestPaths:()=>kce,tarjan:()=>JD,topsort:()=>e8});var sce=()=>1;function ZD(e,n,r,i){return uce(e,String(n),r||sce,i||function(a){return e.outEdges(a)})}function uce(e,n,r,i){let a={},l,s=0,c=e.nodes(),f=function(p){let y=r(p);a[p.v].distance+y<a[p.w].distance&&(a[p.w]={distance:a[p.v].distance+y,predecessor:p.v},l=!0)},d=function(){c.forEach(function(p){i(p).forEach(function(y){let x=y.v===p?y.v:y.w,_=x===y.v?y.w:y.v;f({v:x,w:_})})})};c.forEach(function(p){let y=p===n?0:Number.POSITIVE_INFINITY;a[p]={distance:y,predecessor:""}});let m=c.length;for(let p=1;p<m&&(l=!1,s++,d(),!!l);p++);if(s===m-1&&(l=!1,d(),l))throw new Error("The graph contains a negative weight cycle");return a}function cce(e){let n={},r=[],i;function a(l){l in n||(n[l]=!0,i.push(l),e.successors(l).forEach(a),e.predecessors(l).forEach(a))}return e.nodes().forEach(function(l){i=[],a(l),i.length&&r.push(i)}),r}var QD=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let n=this._keyIndices[e];if(n!==void 0)return this._arr[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,n){let r=this._keyIndices,i=String(e);if(!(i in r)){let a=this._arr,l=a.length;return r[i]=l,a.push({key:i,priority:n}),this._decrease(l),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,n){let r=this._keyIndices[e];if(r===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[r].priority;if(n>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${n}`);this._arr[r].priority=n,this._decrease(r)}_heapify(e){let n=this._arr,r=2*e,i=r+1,a=e;r<n.length&&(a=n[r].priority<n[a].priority?r:a,i<n.length&&(a=n[i].priority<n[a].priority?i:a),a!==e&&(this._swap(e,a),this._heapify(a)))}_decrease(e){let n=this._arr,r=n[e].priority,i;for(;e!==0&&(i=e>>1,!(n[i].priority<r));)this._swap(e,i),e=i}_swap(e,n){let r=this._arr,i=this._keyIndices,a=r[e],l=r[n];r[e]=l,r[n]=a,i[l.key]=e,i[a.key]=n}},fce=()=>1;function em(e,n,r,i){let a=function(l){return e.outEdges(l)};return dce(e,String(n),r||fce,i||a)}function dce(e,n,r,i){let a={},l=new QD,s,c,f=function(d){let m=d.v!==s?d.v:d.w,p=a[m],y=r(d),x=c.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+y);x<p.distance&&(p.distance=x,p.predecessor=s,l.decrease(m,x))};for(e.nodes().forEach(function(d){let m=d===n?0:Number.POSITIVE_INFINITY;a[d]={distance:m,predecessor:""},l.add(d,m)});l.size()>0&&(s=l.removeMin(),c=a[s],c.distance!==Number.POSITIVE_INFINITY);)i(s).forEach(f);return a}function hce(e,n,r){return e.nodes().reduce(function(i,a){return i[a]=em(e,a,n,r),i},{})}function JD(e){let n=0,r=[],i={},a=[];function l(s){let c=i[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),e.successors(s).forEach(function(f){f in i?i[f].onStack&&(c.lowlink=Math.min(c.lowlink,i[f].index)):(l(f),c.lowlink=Math.min(c.lowlink,i[f].lowlink))}),c.lowlink===c.index){let f=[],d;do d=r.pop(),i[d].onStack=!1,f.push(d);while(s!==d);a.push(f)}}return e.nodes().forEach(function(s){s in i||l(s)}),a}function mce(e){return JD(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})}var pce=()=>1;function gce(e,n,r){return vce(e,n||pce,r||function(i){return e.outEdges(i)})}function vce(e,n,r){let i={},a=e.nodes();return a.forEach(function(l){i[l]={},i[l][l]={distance:0,predecessor:""},a.forEach(function(s){l!==s&&(i[l][s]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(l).forEach(function(s){let c=s.v===l?s.w:s.v,f=n(s);i[l][c]={distance:f,predecessor:l}})}),a.forEach(function(l){let s=i[l];a.forEach(function(c){let f=i[c];a.forEach(function(d){let m=f[l],p=s[d],y=f[d],x=m.distance+p.distance;x<y.distance&&(y.distance=x,y.predecessor=p.predecessor)})})}),i}var tm=class extends Error{constructor(...e){super(...e)}};function e8(e){let n={},r={},i=[];function a(l){if(l in r)throw new tm;l in n||(r[l]=!0,n[l]=!0,e.predecessors(l).forEach(a),delete r[l],i.push(l))}if(e.sinks().forEach(a),Object.keys(n).length!==e.nodeCount())throw new tm;return i}function yce(e){try{e8(e)}catch(n){if(n instanceof tm)return!1;throw n}return!0}function xce(e,n,r,i,a){Array.isArray(n)||(n=[n]);let l=(c=>{var f;return(f=e.isDirected()?e.successors(c):e.neighbors(c))!=null?f:[]}),s={};return n.forEach(function(c){if(!e.hasNode(c))throw new Error("Graph does not have node: "+c);a=t8(e,c,r==="post",s,l,i,a)}),a}function t8(e,n,r,i,a,l,s){return n in i||(i[n]=!0,r||(s=l(s,n)),a(n).forEach(function(c){s=t8(e,c,r,i,a,l,s)}),r&&(s=l(s,n))),s}function n8(e,n,r){return xce(e,n,r,function(i,a){return i.push(a),i},[])}function bce(e,n){return n8(e,n,"post")}function wce(e,n){return n8(e,n,"pre")}function _ce(e,n){let r=new Sr,i={},a=new QD,l;function s(f){let d=f.v===l?f.w:f.v,m=a.priority(d);if(m!==void 0){let p=n(f);p<m&&(i[d]=l,a.decrease(d,p))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(f){a.add(f,Number.POSITIVE_INFINITY),r.setNode(f)}),a.decrease(e.nodes()[0],0);let c=!1;for(;a.size()>0;){if(l=a.removeMin(),l in i)r.setEdge(l,i[l]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(l).forEach(s)}return r}function kce(e,n,r,i){return Sce(e,n,r,i??(a=>{let l=e.outEdges(a);return l??[]}))}function Sce(e,n,r,i){if(r===void 0)return em(e,n,r,i);let a=!1,l=e.nodes();for(let s=0;s<l.length;s++){let c=i(l[s]);for(let f=0;f<c.length;f++){let d=c[f],m=d.v===l[s]?d.v:d.w,p=m===d.v?d.w:d.v;r({v:m,w:p})<0&&(a=!0)}if(a)return ZD(e,n,r,i)}return em(e,n,r,i)}function ds(e,n,r,i){let a=i;for(;e.hasNode(a);)a=s2(i);return r.dummy=n,e.setNode(a,r),a}function jce(e){let n=new Sr().setGraph(e.graph());return e.nodes().forEach(r=>n.setNode(r,e.node(r))),e.edges().forEach(r=>{let i=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:i.weight+a.weight,minlen:Math.max(i.minlen,a.minlen)})}),n}function r8(e){let n=new Sr({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||n.setNode(r,e.node(r))}),e.edges().forEach(r=>{n.setEdge(r,e.edge(r))}),n}function OO(e,n){let r=e.x,i=e.y,a=n.x-r,l=n.y-i,s=e.width/2,c=e.height/2;if(!a&&!l)throw new Error("Not possible to find intersection inside of the rectangle");let f,d;return Math.abs(l)*s>Math.abs(a)*c?(l<0&&(c=-c),f=c*a/l,d=c):(a<0&&(s=-s),f=s,d=s*l/a),{x:r+f,y:i+d}}function $c(e){let n=cc(a8(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let i=e.node(r),a=i.rank;a!==void 0&&(n[a]||(n[a]=[]),n[a][i.order]=r)}),n}function Ece(e){let n=e.nodes().map(i=>{let a=e.node(i).rank;return a===void 0?Number.MAX_VALUE:a}),r=Zr(Math.min,n);e.nodes().forEach(i=>{let a=e.node(i);Object.hasOwn(a,"rank")&&(a.rank-=r)})}function Cce(e){let n=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),r=Zr(Math.min,n),i=[];e.nodes().forEach(s=>{let c=e.node(s).rank-r;i[c]||(i[c]=[]),i[c].push(s)});let a=0,l=e.graph().nodeRankFactor;Array.from(i).forEach((s,c)=>{s===void 0&&c%l!==0?--a:s!==void 0&&a&&s.forEach(f=>e.node(f).rank+=a)})}function AO(e,n,r,i){let a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=i),ds(e,"border",a,n)}function Nce(e,n=i8){let r=[];for(let i=0;i<e.length;i+=n){let a=e.slice(i,i+n);r.push(a)}return r}var i8=65535;function Zr(e,n){if(n.length>i8){let r=Nce(n);return e(...r.map(i=>e(...i)))}else return e(...n)}function a8(e){let n=e.nodes().map(r=>{let i=e.node(r).rank;return i===void 0?Number.MIN_VALUE:i});return Zr(Math.max,n)}function Oce(e,n){let r={lhs:[],rhs:[]};return e.forEach(i=>{n(i)?r.lhs.push(i):r.rhs.push(i)}),r}function l8(e,n){let r=Date.now();try{return n()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}}function o8(e,n){return n()}var Ace=0;function s2(e){let n=++Ace;return e+(""+n)}function cc(e,n,r=1){n==null&&(n=e,e=0);let i=l=>l<n;r<0&&(i=l=>n<l);let a=[];for(let l=e;i(l);l+=r)a.push(l);return a}function nm(e,n){let r={};for(let i of n)e[i]!==void 0&&(r[i]=e[i]);return r}function ep(e,n){let r;return typeof n=="string"?r=i=>i[n]:r=n,Object.entries(e).reduce((i,[a,l])=>(i[a]=r(l,a),i),{})}function Tce(e,n){return e.reduce((r,i,a)=>(r[i]=n[a],r),{})}var tp="\0",Mce="3.0.0",Pce=class{constructor(){ece(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,n=e._prev;if(n!==e)return TO(n),n}enqueue(e){let n=this._sentinel;e._prev&&e._next&&TO(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){let e=[],n=this._sentinel,r=n._prev;for(;r!==n;)e.push(JSON.stringify(r,Dce)),r=r._prev;return"["+e.join(", ")+"]"}};function TO(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Dce(e,n){if(e!=="_next"&&e!=="_prev")return n}var Rce=Pce,Lce=()=>1;function zce(e,n){if(e.nodeCount()<=1)return[];let r=$ce(e,n||Lce);return Ice(r.graph,r.buckets,r.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function Ice(e,n,r){var i;let a=[],l=n[n.length-1],s=n[0],c;for(;e.nodeCount();){for(;c=s.dequeue();)wy(e,n,r,c);for(;c=l.dequeue();)wy(e,n,r,c);if(e.nodeCount()){for(let f=n.length-2;f>0;--f)if(c=(i=n[f])==null?void 0:i.dequeue(),c){a=a.concat(wy(e,n,r,c,!0)||[]);break}}}return a}function wy(e,n,r,i,a){let l=[],s=a?l:void 0;return(e.inEdges(i.v)||[]).forEach(c=>{let f=e.edge(c),d=e.node(c.v);a&&l.push({v:c.v,w:c.w}),d.out-=f,Vx(n,r,d)}),(e.outEdges(i.v)||[]).forEach(c=>{let f=e.edge(c),d=c.w,m=e.node(d);m.in-=f,Vx(n,r,m)}),e.removeNode(i.v),s}function $ce(e,n){let r=new Sr,i=0,a=0;e.nodes().forEach(c=>{r.setNode(c,{v:c,in:0,out:0})}),e.edges().forEach(c=>{let f=r.edge(c.v,c.w)||0,d=n(c),m=f+d;r.setEdge(c.v,c.w,m);let p=r.node(c.v),y=r.node(c.w);a=Math.max(a,p.out+=d),i=Math.max(i,y.in+=d)});let l=Bce(a+i+3).map(()=>new Rce),s=i+1;return r.nodes().forEach(c=>{Vx(l,s,r.node(c))}),{graph:r,buckets:l,zeroIdx:s}}function Vx(e,n,r){var i,a,l;r.out?r.in?(l=e[r.out-r.in+n])==null||l.enqueue(r):(a=e[e.length-1])==null||a.enqueue(r):(i=e[0])==null||i.enqueue(r)}function Bce(e){let n=[];for(let r=0;r<e;r++)n.push(r);return n}function Fce(e){(e.graph().acyclicer==="greedy"?zce(e,n(e)):Uce(e)).forEach(r=>{let i=e.edge(r);e.removeEdge(r),i.forwardName=r.name,i.reversed=!0,e.setEdge(r.w,r.v,i,s2("rev"))});function n(r){return i=>r.edge(i).weight}}function Uce(e){let n=[],r={},i={};function a(l){Object.hasOwn(i,l)||(i[l]=!0,r[l]=!0,e.outEdges(l).forEach(s=>{Object.hasOwn(r,s.w)?n.push(s):a(s.w)}),delete r[l])}return e.nodes().forEach(a),n}function qce(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.reversed){e.removeEdge(n);let i=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,i)}})}function Hce(e){e.graph().dummyChains=[],e.edges().forEach(n=>Gce(e,n))}function Gce(e,n){let r=n.v,i=e.node(r).rank,a=n.w,l=e.node(a).rank,s=n.name,c=e.edge(n),f=c.labelRank;if(l===i+1)return;e.removeEdge(n);let d,m,p;for(p=0,++i;i<l;++p,++i)c.points=[],m={width:0,height:0,edgeLabel:c,edgeObj:n,rank:i},d=ds(e,"edge",m,"_d"),i===f&&(m.width=c.width,m.height=c.height,m.dummy="edge-label",m.labelpos=c.labelpos),e.setEdge(r,d,{weight:c.weight},s),p===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,a,{weight:c.weight},s)}function Kce(e){e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeLabel,a;for(e.setEdge(r.edgeObj,i);r.dummy;)a=e.successors(n)[0],e.removeNode(n),i.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),n=a,r=e.node(n)})}function u2(e){let n={};function r(i){let a=e.node(i);if(Object.hasOwn(n,i))return a.rank;n[i]=!0;let l=e.outEdges(i),s=l?l.map(f=>f==null?Number.POSITIVE_INFINITY:r(f.w)-e.edge(f).minlen):[],c=Zr(Math.min,s);return c===Number.POSITIVE_INFINITY&&(c=0),a.rank=c}e.sources().forEach(r)}function Zo(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}var s8=Vce;function Vce(e){let n=new Sr({directed:!1}),r=e.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let i=r[0],a=e.nodeCount();n.setNode(i,{});let l,s;for(;Yce(n,e)<a&&(l=Wce(n,e),!!l);)s=n.hasNode(l.v)?Zo(e,l):-Zo(e,l),Xce(n,e,s);return n}function Yce(e,n){function r(i){let a=n.nodeEdges(i);a&&a.forEach(l=>{let s=l.v,c=i===s?l.w:s;!e.hasNode(c)&&!Zo(n,l)&&(e.setNode(c,{}),e.setEdge(i,c,{}),r(c))})}return e.nodes().forEach(r),e.nodeCount()}function Wce(e,n){return n.edges().reduce((r,i)=>{let a=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(a=Zo(n,i)),a<r[0]?[a,i]:r},[Number.POSITIVE_INFINITY,null])[1]}function Xce(e,n,r){e.nodes().forEach(i=>n.node(i).rank+=r)}var{preorder:Zce,postorder:Qce}=o2,Jce=Il;Il.initLowLimValues=f2;Il.initCutValues=c2;Il.calcCutValue=u8;Il.leaveEdge=f8;Il.enterEdge=d8;Il.exchangeEdges=h8;function Il(e){e=jce(e),u2(e);let n=s8(e);f2(n),c2(n,e);let r,i;for(;r=f8(n);)i=d8(n,e,r),h8(n,e,r,i)}function c2(e,n){let r=Qce(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(i=>efe(e,n,i))}function efe(e,n,r){let i=e.node(r).parent,a=e.edge(r,i);a.cutvalue=u8(e,n,r)}function u8(e,n,r){let i=e.node(r).parent,a=!0,l=n.edge(r,i),s=0;l||(a=!1,l=n.edge(i,r)),s=l.weight;let c=n.nodeEdges(r);return c&&c.forEach(f=>{let d=f.v===r,m=d?f.w:f.v;if(m!==i){let p=d===a,y=n.edge(f).weight;if(s+=p?y:-y,nfe(e,r,m)){let x=e.edge(r,m).cutvalue;s+=p?-x:x}}}),s}function f2(e,n){arguments.length<2&&(n=e.nodes()[0]),c8(e,{},1,n)}function c8(e,n,r,i,a){let l=r,s=e.node(i);n[i]=!0;let c=e.neighbors(i);return c&&c.forEach(f=>{Object.hasOwn(n,f)||(r=c8(e,n,r,f,i))}),s.low=l,s.lim=r++,a?s.parent=a:delete s.parent,r}function f8(e){return e.edges().find(n=>e.edge(n).cutvalue<0)}function d8(e,n,r){let i=r.v,a=r.w;n.hasEdge(i,a)||(i=r.w,a=r.v);let l=e.node(i),s=e.node(a),c=l,f=!1;return l.lim>s.lim&&(c=s,f=!0),n.edges().filter(d=>f===MO(e,e.node(d.v),c)&&f!==MO(e,e.node(d.w),c)).reduce((d,m)=>Zo(n,m)<Zo(n,d)?m:d)}function h8(e,n,r,i){let a=r.v,l=r.w;e.removeEdge(a,l),e.setEdge(i.v,i.w,{}),f2(e),c2(e,n),tfe(e,n)}function tfe(e,n){let r=e.nodes().find(a=>!e.node(a).parent);if(!r)return;let i=Zce(e,[r]);i=i.slice(1),i.forEach(a=>{let l=e.node(a).parent,s=n.edge(a,l),c=!1;s||(s=n.edge(l,a),c=!0),n.node(a).rank=n.node(l).rank+(c?s.minlen:-s.minlen)})}function nfe(e,n,r){return e.hasEdge(n,r)}function MO(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}var rfe=ife;function ife(e){let n=e.graph().ranker;if(typeof n=="function")return n(e);switch(n){case"network-simplex":PO(e);break;case"tight-tree":lfe(e);break;case"longest-path":afe(e);break;case"none":break;default:PO(e)}}var afe=u2;function lfe(e){u2(e),s8(e)}function PO(e){Jce(e)}var ofe=sfe;function sfe(e){let n=cfe(e);e.graph().dummyChains.forEach(r=>{let i=e.node(r),a=i.edgeObj,l=ufe(e,n,a.v,a.w),s=l.path,c=l.lca,f=0,d=s[f],m=!0;for(;r!==a.w;){if(i=e.node(r),m){for(;(d=s[f])!==c&&e.node(d).maxRank<i.rank;)f++;d===c&&(m=!1)}if(!m){for(;f<s.length-1&&e.node(s[f+1]).minRank<=i.rank;)f++;d=s[f]}d!==void 0&&e.setParent(r,d),r=e.successors(r)[0]}})}function ufe(e,n,r,i){let a=[],l=[],s=Math.min(n[r].low,n[i].low),c=Math.max(n[r].lim,n[i].lim),f;f=r;do f=e.parent(f),a.push(f);while(f&&(n[f].low>s||c>n[f].lim));let d=f,m=i;for(;(m=e.parent(m))!==d;)l.push(m);return{path:a.concat(l.reverse()),lca:d}}function cfe(e){let n={},r=0;function i(a){let l=r;e.children(a).forEach(i),n[a]={low:l,lim:r++}}return e.children(tp).forEach(i),n}function ffe(e){let n=ds(e,"root",{},"_root"),r=dfe(e),i=Object.values(r),a=Zr(Math.max,i)-1,l=2*a+1;e.graph().nestingRoot=n,e.edges().forEach(c=>e.edge(c).minlen*=l);let s=hfe(e)+1;e.children(tp).forEach(c=>m8(e,n,l,s,a,r,c)),e.graph().nodeRankFactor=l}function m8(e,n,r,i,a,l,s){var c;let f=e.children(s);if(!f.length){s!==n&&e.setEdge(n,s,{weight:0,minlen:r});return}let d=AO(e,"_bt"),m=AO(e,"_bb"),p=e.node(s);e.setParent(d,s),p.borderTop=d,e.setParent(m,s),p.borderBottom=m,f.forEach(y=>{var x;m8(e,n,r,i,a,l,y);let _=e.node(y),S=_.borderTop?_.borderTop:y,k=_.borderBottom?_.borderBottom:y,j=_.borderTop?i:2*i,C=S!==k?1:a-((x=l[s])!=null?x:0)+1;e.setEdge(d,S,{weight:j,minlen:C,nestingEdge:!0}),e.setEdge(k,m,{weight:j,minlen:C,nestingEdge:!0})}),e.parent(s)||e.setEdge(n,d,{weight:0,minlen:a+((c=l[s])!=null?c:0)})}function dfe(e){let n={};function r(i,a){let l=e.children(i);l&&l.length&&l.forEach(s=>r(s,a+1)),n[i]=a}return e.children(tp).forEach(i=>r(i,1)),n}function hfe(e){return e.edges().reduce((n,r)=>n+e.edge(r).weight,0)}function mfe(e){let n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,e.edges().forEach(r=>{e.edge(r).nestingEdge&&e.removeEdge(r)})}var pfe=gfe;function gfe(e){function n(r){let i=e.children(r),a=e.node(r);if(i.length&&i.forEach(n),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let l=a.minRank,s=a.maxRank+1;l<s;++l)DO(e,"borderLeft","_bl",r,a,l),DO(e,"borderRight","_br",r,a,l)}}e.children(tp).forEach(n)}function DO(e,n,r,i,a,l){let s={width:0,height:0,rank:l,borderType:n},c=a[n][l-1],f=ds(e,"border",s,r);a[n][l]=f,e.setParent(f,i),c&&e.setEdge(c,f,{weight:1})}function vfe(e){var n;let r=(n=e.graph().rankdir)==null?void 0:n.toLowerCase();(r==="lr"||r==="rl")&&p8(e)}function yfe(e){var n;let r=(n=e.graph().rankdir)==null?void 0:n.toLowerCase();(r==="bt"||r==="rl")&&xfe(e),(r==="lr"||r==="rl")&&(bfe(e),p8(e))}function p8(e){e.nodes().forEach(n=>RO(e.node(n))),e.edges().forEach(n=>RO(e.edge(n)))}function RO(e){let n=e.width;e.width=e.height,e.height=n}function xfe(e){e.nodes().forEach(n=>_y(e.node(n))),e.edges().forEach(n=>{var r;let i=e.edge(n);(r=i.points)==null||r.forEach(_y),Object.hasOwn(i,"y")&&_y(i)})}function _y(e){e.y=-e.y}function bfe(e){e.nodes().forEach(n=>ky(e.node(n))),e.edges().forEach(n=>{var r;let i=e.edge(n);(r=i.points)==null||r.forEach(ky),Object.hasOwn(i,"x")&&ky(i)})}function ky(e){let n=e.x;e.x=e.y,e.y=n}function wfe(e){let n={},r=e.nodes().filter(c=>!e.children(c).length),i=r.map(c=>e.node(c).rank),a=Zr(Math.max,i),l=cc(a+1).map(()=>[]);function s(c){if(n[c])return;n[c]=!0;let f=e.node(c);l[f.rank].push(c);let d=e.successors(c);d&&d.forEach(s)}return r.sort((c,f)=>e.node(c).rank-e.node(f).rank).forEach(s),l}function _fe(e,n){let r=0;for(let i=1;i<n.length;++i)r+=kfe(e,n[i-1],n[i]);return r}function kfe(e,n,r){let i=Tce(r,r.map((d,m)=>m)),a=n.flatMap(d=>{let m=e.outEdges(d);return m?m.map(p=>({pos:i[p.w],weight:e.edge(p).weight})).sort((p,y)=>p.pos-y.pos):[]}),l=1;for(;l<r.length;)l<<=1;let s=2*l-1;l-=1;let c=new Array(s).fill(0),f=0;return a.forEach(d=>{let m=d.pos+l;c[m]+=d.weight;let p=0;for(;m>0;)m%2&&(p+=c[m+1]),m=m-1>>1,c[m]+=d.weight;f+=d.weight*p}),f}function Sfe(e,n=[]){return n.map(r=>{let i=e.inEdges(r);if(!i||!i.length)return{v:r};{let a=i.reduce((l,s)=>{let c=e.edge(s),f=e.node(s.v);return{sum:l.sum+c.weight*f.order,weight:l.weight+c.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}})}function jfe(e,n){let r={};e.forEach((a,l)=>{let s={indegree:0,in:[],out:[],vs:[a.v],i:l};a.barycenter!==void 0&&(s.barycenter=a.barycenter,s.weight=a.weight),r[a.v]=s}),n.edges().forEach(a=>{let l=r[a.v],s=r[a.w];l!==void 0&&s!==void 0&&(s.indegree++,l.out.push(s))});let i=Object.values(r).filter(a=>!a.indegree);return Efe(i)}function Efe(e){let n=[];function r(a){return l=>{l.merged||(l.barycenter===void 0||a.barycenter===void 0||l.barycenter>=a.barycenter)&&Cfe(a,l)}}function i(a){return l=>{l.in.push(a),--l.indegree===0&&e.push(l)}}for(;e.length;){let a=e.pop();n.push(a),a.in.reverse().forEach(r(a)),a.out.forEach(i(a))}return n.filter(a=>!a.merged).map(a=>nm(a,["vs","i","barycenter","weight"]))}function Cfe(e,n){let r=0,i=0;e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),n.weight&&(r+=n.barycenter*n.weight,i+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/i,e.weight=i,e.i=Math.min(n.i,e.i),n.merged=!0}function Nfe(e,n){let r=Oce(e,m=>Object.hasOwn(m,"barycenter")),i=r.lhs,a=r.rhs.sort((m,p)=>p.i-m.i),l=[],s=0,c=0,f=0;i.sort(Ofe(!!n)),f=LO(l,a,f),i.forEach(m=>{f+=m.vs.length,l.push(m.vs),s+=m.barycenter*m.weight,c+=m.weight,f=LO(l,a,f)});let d={vs:l.flat(1)};return c&&(d.barycenter=s/c,d.weight=c),d}function LO(e,n,r){let i;for(;n.length&&(i=n[n.length-1]).i<=r;)n.pop(),e.push(i.vs),r++;return r}function Ofe(e){return(n,r)=>n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}function g8(e,n,r,i){let a=e.children(n),l=e.node(n),s=l?l.borderLeft:void 0,c=l?l.borderRight:void 0,f={};s&&(a=a.filter(y=>y!==s&&y!==c));let d=Sfe(e,a);d.forEach(y=>{if(e.children(y.v).length){let x=g8(e,y.v,r,i);f[y.v]=x,Object.hasOwn(x,"barycenter")&&Tfe(y,x)}});let m=jfe(d,r);Afe(m,f);let p=Nfe(m,i);if(s&&c){p.vs=[s,p.vs,c].flat(1);let y=e.predecessors(s);if(y&&y.length){let x=e.node(y[0]),_=e.predecessors(c),S=e.node(_[0]);Object.hasOwn(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+x.order+S.order)/(p.weight+2),p.weight+=2}}return p}function Afe(e,n){e.forEach(r=>{r.vs=r.vs.flatMap(i=>n[i]?n[i].vs:i)})}function Tfe(e,n){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight):(e.barycenter=n.barycenter,e.weight=n.weight)}function Mfe(e,n,r,i){i||(i=e.nodes());let a=Pfe(e),l=new Sr({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(s=>e.node(s));return i.forEach(s=>{let c=e.node(s),f=e.parent(s);if(c.rank===n||c.minRank<=n&&n<=c.maxRank){l.setNode(s),l.setParent(s,f||a);let d=e[r](s);d&&d.forEach(m=>{let p=m.v===s?m.w:m.v,y=l.edge(p,s),x=y!==void 0?y.weight:0;l.setEdge(p,s,{weight:e.edge(m).weight+x})}),Object.hasOwn(c,"minRank")&&l.setNode(s,{borderLeft:c.borderLeft[n],borderRight:c.borderRight[n]})}}),l}function Pfe(e){let n;for(;e.hasNode(n=s2("_root")););return n}function Dfe(e,n,r){let i={},a;r.forEach(l=>{let s=e.parent(l),c,f;for(;s;){if(c=e.parent(s),c?(f=i[c],i[c]=s):(f=a,a=s),f&&f!==s){n.setEdge(f,s);return}s=c}})}function v8(e,n={}){if(typeof n.customOrder=="function"){n.customOrder(e,v8);return}let r=a8(e),i=zO(e,cc(1,r+1),"inEdges"),a=zO(e,cc(r-1,-1,-1),"outEdges"),l=wfe(e);if(IO(e,l),n.disableOptimalOrderHeuristic)return;let s=Number.POSITIVE_INFINITY,c,f=n.constraints||[];for(let d=0,m=0;m<4;++d,++m){Rfe(d%2?i:a,d%4>=2,f),l=$c(e);let p=_fe(e,l);p<s?(m=0,c=Object.assign({},l),s=p):p===s&&(c=structuredClone(l))}IO(e,c)}function zO(e,n,r){let i=new Map,a=(l,s)=>{i.has(l)||i.set(l,[]),i.get(l).push(s)};for(let l of e.nodes()){let s=e.node(l);if(typeof s.rank=="number"&&a(s.rank,l),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let c=s.minRank;c<=s.maxRank;c++)c!==s.rank&&a(c,l)}return n.map(function(l){return Mfe(e,l,r,i.get(l)||[])})}function Rfe(e,n,r){let i=new Sr;e.forEach(function(a){r.forEach(c=>i.setEdge(c.left,c.right));let l=a.graph().root,s=g8(a,l,i,n);s.vs.forEach((c,f)=>a.node(c).order=f),Dfe(a,i,s.vs)})}function IO(e,n){Object.values(n).forEach(r=>r.forEach((i,a)=>e.node(i).order=a))}function Lfe(e,n){let r={};function i(a,l){let s=0,c=0,f=a.length,d=l[l.length-1];return l.forEach((m,p)=>{let y=Ife(e,m),x=y?e.node(y).order:f;(y||m===d)&&(l.slice(c,p+1).forEach(_=>{let S=e.predecessors(_);S&&S.forEach(k=>{let j=e.node(k),C=j.order;(C<s||x<C)&&!(j.dummy&&e.node(_).dummy)&&y8(r,k,_)})}),c=p+1,s=x)}),l}return n.length&&n.reduce(i),r}function zfe(e,n){let r={};function i(l,s,c,f,d){cc(s,c).forEach(m=>{let p=l[m];if(p!==void 0&&e.node(p).dummy){let y=e.predecessors(p);y&&y.forEach(x=>{if(x===void 0)return;let _=e.node(x);_.dummy&&(_.order<f||_.order>d)&&y8(r,x,p)})}})}function a(l,s){let c=-1,f=-1,d=0;return s.forEach((m,p)=>{if(e.node(m).dummy==="border"){let y=e.predecessors(m);if(y&&y.length){let x=y[0];if(x===void 0)return;f=e.node(x).order,i(s,d,p,c,f),d=p,c=f}}i(s,d,s.length,f,l.length)}),s}return n.length&&n.reduce(a),r}function Ife(e,n){if(e.node(n).dummy){let r=e.predecessors(n);if(r)return r.find(i=>e.node(i).dummy)}}function y8(e,n,r){if(n>r){let a=n;n=r,r=a}let i=e[n];i||(e[n]=i={}),i[r]=!0}function $fe(e,n,r){if(n>r){let a=n;n=r,r=a}let i=e[n];return i!==void 0&&Object.hasOwn(i,r)}function Bfe(e,n,r,i){let a={},l={},s={};return n.forEach(c=>{c.forEach((f,d)=>{a[f]=f,l[f]=f,s[f]=d})}),n.forEach(c=>{let f=-1;c.forEach(d=>{let m=i(d);if(m&&m.length){let p=m.sort((x,_)=>{let S=s[x],k=s[_];return(S!==void 0?S:0)-(k!==void 0?k:0)}),y=(p.length-1)/2;for(let x=Math.floor(y),_=Math.ceil(y);x<=_;++x){let S=p[x];if(S===void 0)continue;let k=s[S];if(k!==void 0&&l[d]===d&&f<k&&!$fe(r,d,S)){let j=a[S];j!==void 0&&(l[S]=d,l[d]=a[d]=j,f=k)}}}})}),{root:a,align:l}}function Ffe(e,n,r,i,a=!1){let l={},s=Ufe(e,n,r,a),c=a?"borderLeft":"borderRight";function f(x,_){let S=s.nodes().slice(),k={},j=S.pop();for(;j;){if(k[j])x(j);else{k[j]=!0,S.push(j);for(let C of _(j))S.push(C)}j=S.pop()}}function d(x){let _=s.inEdges(x);_?l[x]=_.reduce((S,k)=>{var j;let C=(j=l[k.v])!=null?j:0,N=s.edge(k);return Math.max(S,C+(N!==void 0?N:0))},0):l[x]=0}function m(x){let _=s.outEdges(x),S=Number.POSITIVE_INFINITY;_&&(S=_.reduce((j,C)=>{let N=l[C.w],O=s.edge(C);return Math.min(j,(N!==void 0?N:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let k=e.node(x);S!==Number.POSITIVE_INFINITY&&k.borderType!==c&&(l[x]=Math.max(l[x]!==void 0?l[x]:0,S))}function p(x){return s.predecessors(x)||[]}function y(x){return s.successors(x)||[]}return f(d,p),f(m,y),Object.keys(i).forEach(x=>{var _;let S=r[x];S!==void 0&&(l[x]=(_=l[S])!=null?_:0)}),l}function Ufe(e,n,r,i){let a=new Sr,l=e.graph(),s=Vfe(l.nodesep,l.edgesep,i);return n.forEach(c=>{let f;c.forEach(d=>{let m=r[d];if(m!==void 0){if(a.setNode(m),f!==void 0){let p=r[f];if(p!==void 0){let y=a.edge(p,m);a.setEdge(p,m,Math.max(s(e,d,f),y||0))}}f=d}})}),a}function qfe(e,n){return Object.values(n).reduce((r,i)=>{let a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([c,f])=>{let d=Yfe(e,c)/2;a=Math.max(f+d,a),l=Math.min(f-d,l)});let s=a-l;return s<r[0]&&(r=[s,i]),r},[Number.POSITIVE_INFINITY,null])[1]}function Hfe(e,n){let r=Object.values(n),i=Zr(Math.min,r),a=Zr(Math.max,r);["u","d"].forEach(l=>{["l","r"].forEach(s=>{let c=l+s,f=e[c];if(!f||f===n)return;let d=Object.values(f),m=i-Zr(Math.min,d);s!=="l"&&(m=a-Zr(Math.max,d)),m&&(e[c]=ep(f,p=>p+m))})})}function Gfe(e,n=void 0){let r=e.ul;return r?ep(r,(i,a)=>{var l,s;if(n){let f=n.toLowerCase(),d=e[f];if(d&&d[a]!==void 0)return d[a]}let c=Object.values(e).map(f=>{let d=f[a];return d!==void 0?d:0}).sort((f,d)=>f-d);return(((l=c[1])!=null?l:0)+((s=c[2])!=null?s:0))/2}):{}}function Kfe(e){let n=$c(e),r=Object.assign(Lfe(e,n),zfe(e,n)),i={},a;["u","d"].forEach(s=>{a=s==="u"?n:Object.values(n).reverse(),["l","r"].forEach(c=>{c==="r"&&(a=a.map(m=>Object.values(m).reverse()));let f=Bfe(e,a,r,m=>(s==="u"?e.predecessors(m):e.successors(m))||[]),d=Ffe(e,a,f.root,f.align,c==="r");c==="r"&&(d=ep(d,m=>-m)),i[s+c]=d})});let l=qfe(e,i);return Hfe(i,l),Gfe(i,e.graph().align)}function Vfe(e,n,r){return(i,a,l)=>{let s=i.node(a),c=i.node(l),f=0,d;if(f+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=-s.width/2;break;case"r":d=s.width/2;break}if(d&&(f+=r?d:-d),d=void 0,f+=(s.dummy?n:e)/2,f+=(c.dummy?n:e)/2,f+=c.width/2,Object.hasOwn(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":d=c.width/2;break;case"r":d=-c.width/2;break}return d&&(f+=r?d:-d),f}}function Yfe(e,n){return e.node(n).width}function Wfe(e){e=r8(e),Xfe(e),Object.entries(Kfe(e)).forEach(([n,r])=>e.node(n).x=r)}function Xfe(e){let n=$c(e),r=e.graph(),i=r.ranksep,a=r.rankalign,l=0;n.forEach(s=>{let c=s.reduce((f,d)=>{var m;let p=(m=e.node(d).height)!=null?m:0;return f>p?f:p},0);s.forEach(f=>{let d=e.node(f);a==="top"?d.y=l+d.height/2:a==="bottom"?d.y=l+c-d.height/2:d.y=l+c/2}),l+=c+i})}function Zfe(e,n={}){let r=n.debugTiming?l8:o8;return r("layout",()=>{let i=r(" buildLayoutGraph",()=>ode(e));return r(" runLayout",()=>Qfe(i,r,n)),r(" updateInputGraph",()=>Jfe(e,i)),i})}function Qfe(e,n,r){n(" makeSpaceForEdgeLabels",()=>sde(e)),n(" removeSelfEdges",()=>vde(e)),n(" acyclic",()=>Fce(e)),n(" nestingGraph.run",()=>ffe(e)),n(" rank",()=>rfe(r8(e))),n(" injectEdgeLabelProxies",()=>ude(e)),n(" removeEmptyRanks",()=>Cce(e)),n(" nestingGraph.cleanup",()=>mfe(e)),n(" normalizeRanks",()=>Ece(e)),n(" assignRankMinMax",()=>cde(e)),n(" removeEdgeLabelProxies",()=>fde(e)),n(" normalize.run",()=>Hce(e)),n(" parentDummyChains",()=>ofe(e)),n(" addBorderSegments",()=>pfe(e)),n(" order",()=>v8(e,r)),n(" insertSelfEdges",()=>yde(e)),n(" adjustCoordinateSystem",()=>vfe(e)),n(" position",()=>Wfe(e)),n(" positionSelfEdges",()=>xde(e)),n(" removeBorderNodes",()=>gde(e)),n(" normalize.undo",()=>Kce(e)),n(" fixupEdgeLabelCoords",()=>mde(e)),n(" undoCoordinateSystem",()=>yfe(e)),n(" translateGraph",()=>dde(e)),n(" assignNodeIntersects",()=>hde(e)),n(" reversePoints",()=>pde(e)),n(" acyclic.undo",()=>qce(e))}function Jfe(e,n){e.nodes().forEach(r=>{let i=e.node(r),a=n.node(r);i&&(i.x=a.x,i.y=a.y,i.order=a.order,i.rank=a.rank,n.children(r).length&&(i.width=a.width,i.height=a.height))}),e.edges().forEach(r=>{let i=e.edge(r),a=n.edge(r);i.points=a.points,Object.hasOwn(a,"x")&&(i.x=a.x,i.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var ede=["nodesep","edgesep","ranksep","marginx","marginy"],tde={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},nde=["acyclicer","ranker","rankdir","align","rankalign"],rde=["width","height","rank"],$O={width:0,height:0},ide=["minlen","weight","width","height","labeloffset"],ade={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},lde=["labelpos"];function ode(e){let n=new Sr({multigraph:!0,compound:!0}),r=jy(e.graph());return n.setGraph(Object.assign({},tde,Sy(r,ede),nm(r,nde))),e.nodes().forEach(i=>{let a=jy(e.node(i)),l=Sy(a,rde);Object.keys($O).forEach(c=>{l[c]===void 0&&(l[c]=$O[c])}),n.setNode(i,l);let s=e.parent(i);s!==void 0&&n.setParent(i,s)}),e.edges().forEach(i=>{let a=jy(e.edge(i));n.setEdge(i,Object.assign({},ade,Sy(a,ide),nm(a,lde)))}),n}function sde(e){let n=e.graph();n.ranksep/=2,e.edges().forEach(r=>{let i=e.edge(r);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function ude(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.width&&r.height){let i=e.node(n.v),a={rank:(e.node(n.w).rank-i.rank)/2+i.rank,e:n};ds(e,"edge-proxy",a,"_ep")}})}function cde(e){let n=0;e.nodes().forEach(r=>{let i=e.node(r);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,n=Math.max(n,i.maxRank))}),e.graph().maxRank=n}function fde(e){e.nodes().forEach(n=>{let r=e.node(n);if(r.dummy==="edge-proxy"){let i=r;e.edge(i.e).labelRank=r.rank,e.removeNode(n)}})}function dde(e){let n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,a=0,l=e.graph(),s=l.marginx||0,c=l.marginy||0;function f(d){let m=d.x,p=d.y,y=d.width,x=d.height;n=Math.min(n,m-y/2),r=Math.max(r,m+y/2),i=Math.min(i,p-x/2),a=Math.max(a,p+x/2)}e.nodes().forEach(d=>f(e.node(d))),e.edges().forEach(d=>{let m=e.edge(d);Object.hasOwn(m,"x")&&f(m)}),n-=s,i-=c,e.nodes().forEach(d=>{let m=e.node(d);m.x-=n,m.y-=i}),e.edges().forEach(d=>{let m=e.edge(d);m.points.forEach(p=>{p.x-=n,p.y-=i}),Object.hasOwn(m,"x")&&(m.x-=n),Object.hasOwn(m,"y")&&(m.y-=i)}),l.width=r-n+s,l.height=a-i+c}function hde(e){e.edges().forEach(n=>{let r=e.edge(n),i=e.node(n.v),a=e.node(n.w),l,s;r.points?(l=r.points[0],s=r.points[r.points.length-1]):(r.points=[],l=a,s=i),r.points.unshift(OO(i,l)),r.points.push(OO(a,s))})}function mde(e){e.edges().forEach(n=>{let r=e.edge(n);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function pde(e){e.edges().forEach(n=>{let r=e.edge(n);r.reversed&&r.points.reverse()})}function gde(e){e.nodes().forEach(n=>{if(e.children(n).length){let r=e.node(n),i=e.node(r.borderTop),a=e.node(r.borderBottom),l=e.node(r.borderLeft[r.borderLeft.length-1]),s=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-l.x),r.height=Math.abs(a.y-i.y),r.x=l.x+r.width/2,r.y=i.y+r.height/2}}),e.nodes().forEach(n=>{e.node(n).dummy==="border"&&e.removeNode(n)})}function vde(e){e.edges().forEach(n=>{if(n.v===n.w){let r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function yde(e){$c(e).forEach(n=>{let r=0;n.forEach((i,a)=>{let l=e.node(i);l.order=a+r,(l.selfEdges||[]).forEach(s=>{ds(e,"selfedge",{width:s.label.width,height:s.label.height,rank:l.rank,order:a+ ++r,e:s.e,label:s.label},"_se")}),delete l.selfEdges})})}function xde(e){e.nodes().forEach(n=>{let r=e.node(n);if(r.dummy==="selfedge"){let i=r,a=e.node(i.e.v),l=a.x+a.width/2,s=a.y,c=r.x-l,f=a.height/2;e.setEdge(i.e,i.label),e.removeNode(n),i.label.points=[{x:l+2*c/3,y:s-f},{x:l+5*c/6,y:s-f},{x:l+c,y:s},{x:l+5*c/6,y:s+f},{x:l+2*c/3,y:s+f}],i.label.x=r.x,i.label.y=r.y}})}function Sy(e,n){return ep(nm(e,n),Number)}function jy(e){let n={};return e&&Object.entries(e).forEach(([r,i])=>{typeof r=="string"&&(r=r.toLowerCase()),n[r]=i}),n}function bde(e){let n=$c(e),r=new Sr({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{r.setNode(i,{label:i}),r.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>r.setEdge(i.v,i.w,{},i.name)),n.forEach((i,a)=>{let l="layer"+a;r.setNode(l,{rank:"same"}),i.reduce((s,c)=>(r.setEdge(s,c,{style:"invis"}),c))}),r}var wde={graphlib:YD,version:Mce,layout:Zfe,debug:bde,util:{time:l8,notime:o8}},BO=wde;/*! For license information please see dagre.esm.js.LEGAL.txt */const _de=[{id:"ci_green",eventName:"CI Passed",description:"When CI checks pass on a PR"},{id:"ci_red",eventName:"CI Failed",description:"When CI checks fail on a PR"},{id:"pr_merged",eventName:"PR Merged",description:"When a PR is merged"},{id:"ci_blocked",eventName:"CI Blocked",description:"When CI failure count exceeds threshold"},{id:"stuck_nudge",eventName:"Stuck Nudge",description:"When a team has been idle too long"},{id:"nudge_progress",eventName:"Nudge Progress",description:"Ask TL for a status update"},{id:"ask_for_pr",eventName:"Ask for PR",description:"Request TL to open a pull request"},{id:"check_ci",eventName:"Check CI",description:"Tell TL to fix failing CI"},{id:"wrap_up",eventName:"Wrap Up",description:"Tell TL to finish and push"}],kde=130,Sde=50;function Yx({trigger:e,size:n=14,className:r}){switch(e){case"hook":return g.jsx(X7,{size:n,className:r});case"timer":return g.jsx(Q7,{size:n,className:r});case"poller":return g.jsx(V7,{size:n,className:r});case"pm_action":return g.jsx(Z7,{size:n,className:r});case"system":return g.jsx(tb,{size:n,className:r});default:return null}}function jde(e,n,r,i,a,l){const s=i/24,c=n-i/2,f=r-i/2,d={fill:"none",stroke:a,strokeWidth:2/s,strokeLinecap:"round",strokeLinejoin:"round",opacity:l};switch(e){case"hook":return g.jsx("g",{transform:`translate(${c},${f}) scale(${s})`,...d,children:g.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})});case"timer":return g.jsxs("g",{transform:`translate(${c},${f}) scale(${s})`,...d,children:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"poller":return g.jsxs("g",{transform:`translate(${c},${f}) scale(${s})`,...d,children:[g.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),g.jsx("path",{d:"M21 3v5h-5"}),g.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),g.jsx("path",{d:"M8 16H3v5"})]});case"pm_action":return g.jsxs("g",{transform:`translate(${c},${f}) scale(${s})`,...d,children:[g.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),g.jsx("circle",{cx:"12",cy:"7",r:"4"})]});case"system":return g.jsxs("g",{transform:`translate(${c},${f}) scale(${s})`,...d,children:[g.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),g.jsx("circle",{cx:"12",cy:"12",r:"3"})]});default:return null}}const Ede={hook:"Hook event",timer:"Timer (stuck detector)",poller:"Poller (GitHub)",pm_action:"PM action (API call)",system:"System (queue, recovery)"};function Cde(e,n){const r=e.map(m=>m.id),i=n.flatMap(m=>m.from==="*"?r.map(p=>({...m,from:p,id:`${m.id}-${p}`})):[m]),a=new Map;for(const m of i){const p=`${m.from}|${m.trigger}|${m.to}`,y=a.get(p);if(!y)a.set(p,m);else{const x=y.id.includes(`-${y.from}`),_=m.id.includes(`-${m.from}`);x&&!_&&a.set(p,m)}}const l=[...a.values()],s=m=>`${m.trigger}|${m.to}`,c=new Map;for(const m of l){const p=s(m);c.has(p)||c.set(p,[]),c.get(p).push(m)}const f=[];for(const[,m]of c){const p=new Set(m.map(x=>x.from));if(r.every(x=>p.has(x))&&m.length>=r.length){const x=m[0],_=x.id.replace(/-[^-]+$/,"");f.push({...x,from:"*",id:_})}else f.push(...m)}const d=[...f].sort((m,p)=>m.from==="*"&&p.from!=="*"?-1:m.from!=="*"&&p.from==="*"?1:m.from<p.from?-1:m.from>p.from?1:m.to<p.to?-1:m.to>p.to?1:0);return{transitions:f,tableTransitions:d}}function Nde(e,n){const r=[],i=e.map(d=>d.id),a=new Map;for(const d of n){if(d.from==="*")continue;const m=`${d.id}|${d.from}|${d.to}|${d.trigger}`;a.has(m)||a.set(m,[]),a.get(m).push(d)}for(const[,d]of a)if(d.length>1){const m=d.map(p=>p.id).join(", ");r.push({type:"duplicate",message:`Duplicate transition: ${d[0].from} -> ${d[0].to} (${d[0].trigger}) defined ${d.length} times [${m}]`})}const l=new Set,s=new Set;for(const d of n)d.from==="*"?i.forEach(m=>l.add(m)):l.add(d.from),s.add(d.to);const c=new Set(["done","failed"]);for(const d of i)!l.has(d)&&!c.has(d)&&r.push({type:"orphan",message:`Orphan state: "${d}" has no outgoing transitions`});const f=new Set(["queued"]);for(const d of i)!s.has(d)&&!f.has(d)&&r.push({type:"unreachable",message:`Unreachable state: "${d}" has no incoming transitions`});return r}const Ode=70,Ade=30;function Tde(e,n){const r=new BO.graphlib.Graph({multigraph:!0});r.setGraph({rankdir:"LR",nodesep:60,ranksep:120,marginx:40,marginy:40}),r.setDefaultEdgeLabel(()=>({}));const i=new Set(e.map(p=>p.id));for(const p of e)r.setNode(p.id,{label:p.id,width:kde,height:Sde});n.some(p=>p.from==="*")&&r.setNode("*",{label:"All",width:Ode,height:Ade});const l=new Map;for(const p of n){const y=p.from==="*"?"*":p.from;if(y!=="*"&&!i.has(y)||!i.has(p.to))continue;const x=`${y}->${p.to}|${p.trigger}`;l.has(x)||l.set(x,[]),l.get(x).push(p)}l.forEach((p,y)=>{const[x,_]=y.split("|"),[S,k]=x.split("->");r.setEdge(S,k,{},_)}),BO.layout(r);const s=r.nodes().map(p=>{const y=r.node(p);return{id:p,x:y.x,y:y.y,width:y.width,height:y.height}}),c=r.edges().map(p=>{const y=r.edge(p),x=`${p.v}->${p.w}|${p.name}`;return{from:p.v,to:p.w,trigger:p.name||"",points:y.points||[],transitions:l.get(x)||[]}}),f=r.graph(),d=(f.width||800)+80,m=(f.height||400)+80;return{nodes:s,edges:c,width:d,height:m}}function Mde({info:e,stateColorMap:n,onClose:r}){const i=b.useRef(null);return b.useEffect(()=>{const l=setTimeout(r,5e3);return()=>clearTimeout(l)},[r]),b.useEffect(()=>{function l(s){i.current&&!i.current.contains(s.target)&&r()}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),e.transitions[0]?g.jsx("div",{ref:i,className:"absolute z-50 bg-[#161B22] border border-[#30363D] rounded-lg shadow-xl p-3 min-w-[240px] max-w-[340px]",style:{left:e.x,top:e.y,transform:"translate(-50%, -100%) translateY(-8px)"},children:e.transitions.map((l,s)=>g.jsxs("div",{className:s>0?"mt-3 pt-3 border-t border-[#30363D]":"",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-semibold",style:{backgroundColor:`${n[l.from]||"#8B949E"}20`,color:n[l.from]||"#8B949E",border:`1px solid ${n[l.from]||"#8B949E"}40`},children:l.from==="*"?"All":l.from}),g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#8B949E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M5 12h14"}),g.jsx("path",{d:"m12 5 7 7-7 7"})]}),g.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-semibold",style:{backgroundColor:`${n[l.to]||"#8B949E"}20`,color:n[l.to]||"#8B949E",border:`1px solid ${n[l.to]||"#8B949E"}40`},children:l.to})]}),g.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-dark-text mb-1",children:[g.jsx(Yx,{trigger:l.trigger,size:12,className:"text-[#8B949E]"}),g.jsx("span",{className:"font-medium",children:l.triggerLabel})]}),g.jsx("p",{className:"text-xs text-dark-muted mb-1",children:l.description}),g.jsx("p",{className:"text-xs font-mono text-dark-muted bg-[#0D1117] px-1.5 py-0.5 rounded",children:l.condition})]},l.id))}):null}function Pde({cardDef:e,templateData:n,onSave:r}){const[i,a]=b.useState((n==null?void 0:n.template)??""),[l,s]=b.useState((n==null?void 0:n.enabled)??!0),[c,f]=b.useState(!1),[d,m]=b.useState(null);b.useEffect(()=>{n&&(a(n.template),s(n.enabled))},[n]);const p=b.useCallback(async()=>{f(!0),m(null);try{await r(e.id,i,l),m("Saved successfully")}catch(x){m(x instanceof Error?x.message:"Failed to save")}finally{f(!1)}},[e.id,i,l,r]),y=(n==null?void 0:n.placeholders)??[];return g.jsxs("div",{className:"bg-[#161B22] border border-[#30363D] rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-start justify-between mb-2",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-semibold text-dark-text",children:e.eventName}),g.jsx("p",{className:"text-xs text-dark-muted mt-0.5",children:e.description}),g.jsxs("p",{className:"text-[10px] text-dark-muted font-mono mt-0.5",children:["(",e.id,")"]})]}),g.jsx("button",{type:"button",role:"switch","aria-checked":l,"aria-label":`Toggle ${e.eventName} message`,onClick:()=>s(!l),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0 mt-0.5 ${l?"bg-[#3FB950]":"bg-[#30363D]"}`,children:g.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform ${l?"translate-x-[18px]":"translate-x-[3px]"}`})})]}),g.jsx("textarea",{value:i,onChange:x=>{a(x.target.value),m(null)},rows:3,className:`w-full text-sm font-mono rounded px-3 py-2 resize-y bg-[#0D1117] border ${l?"border-[#30363D] text-dark-text":"border-[#30363D] text-dark-muted opacity-60"} focus:outline-none focus:ring-1 focus:ring-[#58A6FF]/50`}),y.length>0&&g.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:y.map(x=>g.jsx("code",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded bg-[#30363D] text-[#58A6FF]",children:`{{${x}}}`},x))}),g.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[g.jsx("button",{type:"button",onClick:p,disabled:c,className:"px-3 py-1 text-xs font-medium rounded border border-[#58A6FF]/50 text-[#58A6FF] hover:bg-[#58A6FF]/10 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:c?"Saving...":"Save"}),d&&g.jsx("span",{className:`text-xs ${d.includes("success")?"text-[#3FB950]":"text-[#F85149]"}`,children:d})]})]})}function Dde(){const e=Ot(),[n,r]=b.useState("diagram"),[i,a]=b.useState(null),[l,s]=b.useState(!0),[c,f]=b.useState(null),[d,m]=b.useState([]),[p,y]=b.useState(null),[x,_]=b.useState(null),S=b.useRef(null),k=b.useCallback(async()=>{try{const D=await e.get("state-machine");a(D),f(null)}catch(D){f(D instanceof Error?D.message:String(D))}finally{s(!1)}},[e]),j=b.useCallback(async()=>{try{const D=await e.get("message-templates");m(D)}catch{}},[e]);b.useEffect(()=>{k(),j()},[k,j]);const C=b.useMemo(()=>i?Cde(i.states,i.transitions):null,[i]),N=b.useMemo(()=>i?Nde(i.states,i.transitions):[],[i]),O=b.useMemo(()=>!i||!C?null:Tde(i.states,C.transitions),[i,C]),T=b.useMemo(()=>{if(!i)return{};const D={"*":"#8B949E"};for(const U of i.states)D[U.id]=U.color;return D},[i]),A=b.useMemo(()=>{const D=new Map;for(const U of d)D.set(U.id,U);return D},[d]),P=b.useCallback((D,U)=>{if(!S.current)return;const q=S.current.getBoundingClientRect();_({transitions:U,x:D.clientX-q.left,y:D.clientY-q.top})},[]),R=b.useCallback(()=>_(null),[]),z=b.useCallback(async(D,U,q)=>{await e.put(`message-templates/${D}`,{template:U,enabled:q}),await j()},[e,j]);return l?g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("p",{className:"text-dark-muted text-sm",children:"Loading state machine..."})}):c?g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsxs("div",{className:"text-center",children:[g.jsx("p",{className:"text-[#F85149] text-sm mb-2",children:"Failed to load state machine"}),g.jsx("p",{className:"text-dark-muted text-xs",children:c})]})}):!i||!O?null:g.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"px-6 py-4 border-b border-dark-border shrink-0",children:[g.jsx("h1",{className:"text-xl font-semibold text-dark-text",children:"Lifecycle"}),g.jsx("p",{className:"text-dark-muted text-sm mt-1",children:"Team lifecycle transitions and PM message templates"})]}),g.jsxs("div",{className:"flex items-center gap-1 px-4 py-2 border-b border-[#30363D] shrink-0",children:[g.jsx("button",{onClick:()=>r("diagram"),className:`px-3 py-1.5 text-xs font-medium rounded ${n==="diagram"?"bg-[#58A6FF20] text-[#58A6FF] border border-[#58A6FF40]":"text-[#8B949E] hover:text-[#E6EDF3]"}`,children:"State Machine"}),g.jsx("button",{onClick:()=>r("table"),className:`px-3 py-1.5 text-xs font-medium rounded ${n==="table"?"bg-[#58A6FF20] text-[#58A6FF] border border-[#58A6FF40]":"text-[#8B949E] hover:text-[#E6EDF3]"}`,children:"Transition Table"}),g.jsx("button",{onClick:()=>r("messages"),className:`px-3 py-1.5 text-xs font-medium rounded ${n==="messages"?"bg-[#58A6FF20] text-[#58A6FF] border border-[#58A6FF40]":"text-[#8B949E] hover:text-[#E6EDF3]"}`,children:"PM Messages"})]}),g.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:n==="diagram"?g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsx("div",{className:"flex items-center gap-4 text-xs text-dark-muted px-6 py-3 border-b border-dark-border shrink-0",children:Object.entries(Ede).map(([D,U])=>g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx(Yx,{trigger:D,size:14,className:"text-[#8B949E]"}),g.jsx("span",{children:U})]},D))}),g.jsxs("div",{ref:S,className:"relative flex-1 min-h-0 p-4 overflow-auto",children:[g.jsxs("svg",{viewBox:`0 0 ${O.width} ${O.height}`,className:"w-full h-auto",style:{minHeight:300},children:[g.jsxs("defs",{children:[g.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto",children:g.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#8B949E"})}),g.jsx("marker",{id:"arrowhead-hover",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto",children:g.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#C9D1D9"})})]}),O.edges.map(D=>{const U=`${D.from}->${D.to}|${D.trigger}`,q=U===p,L=D.points;if(L.length===0)return null;const $=L.map((F,X)=>`${X===0?"M":"L"} ${F.x} ${F.y}`).join(" "),G=Math.floor(L.length/2),B=L[G];let Y="#30363D",ee=1.5,H="url(#arrowhead)";q&&(Y="#C9D1D9",ee=2,H="url(#arrowhead-hover)");const re=D.transitions.length;return g.jsxs("g",{className:"cursor-pointer",onClick:F=>P(F,D.transitions),onMouseEnter:()=>y(U),onMouseLeave:()=>y(null),children:[g.jsx("path",{d:$,fill:"none",stroke:"transparent",strokeWidth:"16"}),g.jsx("path",{d:$,fill:"none",stroke:Y,strokeWidth:ee,markerEnd:H,strokeLinejoin:"round",strokeLinecap:"round"}),B&&D.transitions.length>0&&jde(D.transitions[0].trigger,B.x,B.y-12,14,q?"#C9D1D9":"#8B949E",1),re>1&&B&&g.jsxs("g",{children:[g.jsx("rect",{x:B.x+6,y:B.y-22,width:re>=10?30:18,height:16,rx:8,fill:"#30363D"}),g.jsx("text",{x:B.x+6+(re>=10?15:9),y:B.y-22+12,textAnchor:"middle",fontSize:10,fontWeight:600,fill:"#8B949E",children:re})]})]},U)}),O.nodes.map(D=>{const U=D.x-D.width/2,q=D.y-D.height/2;if(D.id==="*")return g.jsxs("g",{children:[g.jsx("rect",{x:U,y:q,width:D.width,height:D.height,rx:15,ry:15,fill:"none",stroke:"#8B949E",strokeWidth:1.5,strokeDasharray:"4 2"}),g.jsx("text",{x:D.x,y:D.y,textAnchor:"middle",dominantBaseline:"central",fill:"#8B949E",fontSize:11,fontWeight:600,className:"select-none",children:"All"})]},"all-node");const L=T[D.id]||"#8B949E",$=`${L}18`;return g.jsxs("g",{children:[g.jsx("rect",{x:U,y:q,width:D.width,height:D.height,rx:8,ry:8,fill:"#0D1117"}),g.jsx("rect",{x:U,y:q,width:D.width,height:D.height,rx:8,ry:8,fill:$}),g.jsx("rect",{x:U,y:q,width:D.width,height:D.height,rx:8,ry:8,fill:"none",stroke:L,strokeWidth:2}),g.jsx("text",{x:D.x,y:D.y,textAnchor:"middle",dominantBaseline:"central",fontSize:14,fontWeight:700,fill:L,className:"select-none",children:D.id})]},D.id)})]}),x&&g.jsx(Mde,{info:x,stateColorMap:T,onClose:R})]}),N.length>0&&g.jsxs("div",{className:"px-6 py-3 border-t border-dark-border shrink-0",children:[g.jsx("h3",{className:"text-sm font-medium text-[#D29922] mb-2",children:"Validation Warnings"}),g.jsx("ul",{className:"space-y-1",children:N.map((D,U)=>g.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[g.jsx("span",{className:`shrink-0 mt-0.5 px-1.5 py-0.5 rounded font-mono text-[10px] ${D.type==="duplicate"?"bg-[#F8514920] text-[#F85149]":D.type==="orphan"?"bg-[#D2992220] text-[#D29922]":"bg-[#58A6FF20] text-[#58A6FF]"}`,children:D.type}),g.jsx("span",{className:"text-dark-muted",children:D.message})]},U))})]})]}):n==="table"?g.jsxs("div",{className:"flex flex-col h-full",children:[C&&g.jsxs("div",{className:"px-6 py-4 flex-1 min-h-0 overflow-auto",children:[g.jsxs("h2",{className:"text-sm font-medium text-dark-text mb-3",children:["Transition Table (",C.tableTransitions.length," transitions)"]}),g.jsx("div",{className:"overflow-x-auto",children:g.jsxs("table",{className:"w-full text-xs border-collapse",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"text-left text-dark-muted border-b border-[#30363D]",children:[g.jsx("th",{className:"py-2 pr-4 font-medium",children:"From"}),g.jsx("th",{className:"py-2 pr-4 font-medium",children:"To"}),g.jsx("th",{className:"py-2 pr-4 font-medium",children:"Trigger"}),g.jsx("th",{className:"py-2 font-medium",children:"Description"})]})}),g.jsx("tbody",{children:C.tableTransitions.map(D=>g.jsxs("tr",{className:"border-b border-[#30363D]/50 hover:bg-[#161B22]",children:[g.jsx("td",{className:"py-1.5 pr-4",children:g.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-semibold",style:{backgroundColor:`${T[D.from]||"#8B949E"}20`,color:T[D.from]||"#8B949E",border:`1px solid ${T[D.from]||"#8B949E"}40`},children:D.from==="*"?"ALL":D.from})}),g.jsx("td",{className:"py-1.5 pr-4",children:g.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-semibold",style:{backgroundColor:`${T[D.to]||"#8B949E"}20`,color:T[D.to]||"#8B949E",border:`1px solid ${T[D.to]||"#8B949E"}40`},children:D.to})}),g.jsx("td",{className:"py-1.5 pr-4",children:g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx(Yx,{trigger:D.trigger,size:12,className:"text-[#8B949E]"}),g.jsx("span",{className:"text-dark-text",children:D.triggerLabel})]})}),g.jsx("td",{className:"py-1.5 text-dark-muted",children:D.description})]},D.id))})]})})]}),N.length>0&&g.jsxs("div",{className:"px-6 py-3 border-t border-dark-border shrink-0",children:[g.jsx("h3",{className:"text-sm font-medium text-[#D29922] mb-2",children:"Validation Warnings"}),g.jsx("ul",{className:"space-y-1",children:N.map((D,U)=>g.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[g.jsx("span",{className:`shrink-0 mt-0.5 px-1.5 py-0.5 rounded font-mono text-[10px] ${D.type==="duplicate"?"bg-[#F8514920] text-[#F85149]":D.type==="orphan"?"bg-[#D2992220] text-[#D29922]":"bg-[#58A6FF20] text-[#58A6FF]"}`,children:D.type}),g.jsx("span",{className:"text-dark-muted",children:D.message})]},U))})]})]}):g.jsxs("div",{className:"px-6 py-4",children:[g.jsxs("div",{className:"mb-4",children:[g.jsx("h2",{className:"text-lg font-semibold text-dark-text",children:"PM → Team Leader Messages"}),g.jsx("p",{className:"text-dark-muted text-sm mt-0.5",children:"Messages automatically sent to your team leads when events occur"})]}),g.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4",children:_de.map(D=>g.jsx(Pde,{cardDef:D,templateData:A.get(D.id),onSave:z},D.id))})]})})]})}function Rde(){const{fetchError:e}=mc();return e?g.jsxs("div",{role:"alert",style:{backgroundColor:"#3B2607",borderBottom:"1px solid #6B4C1E",color:"#F0C674",padding:"6px 16px",fontSize:"0.75rem"},className:"flex items-center gap-2 shrink-0",children:[g.jsx("span",{style:{color:"#F0C674"},children:"⚠"}),g.jsxs("span",{children:["Data may be stale — ",e]})]}):null}function Lde(){return g.jsx(x7,{children:g.jsx(M7,{children:g.jsxs(A7,{children:[g.jsxs("div",{className:"h-screen w-screen flex flex-col bg-dark-base text-dark-text overflow-hidden",children:[g.jsx(iL,{}),g.jsxs("div",{className:"flex flex-1 min-h-0",children:[g.jsx(lL,{}),g.jsxs("main",{className:"flex-1 min-w-0 overflow-auto",children:[g.jsx(Rde,{}),g.jsxs(W6,{children:[g.jsx(hl,{path:"/",element:g.jsx(rV,{})}),g.jsx(hl,{path:"/issues",element:g.jsx(LV,{})}),g.jsx(hl,{path:"/usage",element:g.jsx(Oue,{})}),g.jsx(hl,{path:"/projects",element:g.jsx(Wue,{})}),g.jsx(hl,{path:"/lifecycle",element:g.jsx(Dde,{})}),g.jsx(hl,{path:"/settings",element:g.jsx(Zue,{})})]})]})]}),g.jsx(oL,{})]}),g.jsx(zK,{})]})})})}const x8=document.getElementById("root");if(!x8)throw new Error("Root element not found");Z9.createRoot(x8).render(g.jsx(Jo.StrictMode,{children:g.jsx(Lde,{})}));
187
+ //# sourceMappingURL=index-COIsRr4s.js.map