@usine/server 0.4.1-next.263.g21813b5 → 0.4.1-next.264.gfdecd7e

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 (124) hide show
  1. package/README.md +2 -0
  2. package/dist/configuration/catalog.d.ts +5 -0
  3. package/dist/configuration/catalog.d.ts.map +1 -0
  4. package/dist/configuration/catalog.js +38 -0
  5. package/dist/configuration/catalog.js.map +1 -0
  6. package/dist/http.d.ts +3 -1
  7. package/dist/http.d.ts.map +1 -1
  8. package/dist/http.js +7 -0
  9. package/dist/http.js.map +1 -1
  10. package/dist/up.d.ts.map +1 -1
  11. package/dist/up.js +4 -2
  12. package/dist/up.js.map +1 -1
  13. package/dist/web/assets/_agent-CK1JZbEZ.js +1 -0
  14. package/dist/web/assets/{_label-CjbmpOS8.js → _label-CkDrdgxa.js} +1 -1
  15. package/dist/web/assets/_loop-DLKJmqFq.js +1 -0
  16. package/dist/web/assets/_name-BzeOsU08.js +1 -0
  17. package/dist/web/assets/_name-CCrJHJTI.js +1 -0
  18. package/dist/web/assets/_name-LWtfT5Eq.js +2 -0
  19. package/dist/web/assets/_number-BzeOsU08.js +1 -0
  20. package/dist/web/assets/{_number-Cak-hr88.js → _number-CpU9ru_u.js} +1 -1
  21. package/dist/web/assets/_number-n4iejSEq.js +1 -0
  22. package/dist/web/assets/_run-BzeOsU08.js +1 -0
  23. package/dist/web/assets/_run-CHrGLkXR.js +5 -0
  24. package/dist/web/assets/{_worker-Ce5spGKK.js → _worker-BvlkSKMd.js} +1 -1
  25. package/dist/web/assets/{action-BN5NBgLV.js → action-DQzkdVHs.js} +1 -1
  26. package/dist/web/assets/actions-CG0hkpe7.js +1 -0
  27. package/dist/web/assets/agents-CgWsAMoz.js +1 -0
  28. package/dist/web/assets/{agents-CvLlV1IU.js → agents-D3eAK_60.js} +1 -1
  29. package/dist/web/assets/code-block-Y9Y-8fHK.js +4 -0
  30. package/dist/web/assets/collapsible-BKcakxvM.js +1 -0
  31. package/dist/web/assets/{core-CuokrI3P.js → core-S_rVxu-b.js} +3 -3
  32. package/dist/web/assets/drawer-ClcvABkO.js +1 -0
  33. package/dist/web/assets/dropdown-menu-BHKHYfLs.js +1 -0
  34. package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +1 -0
  35. package/dist/web/assets/error-alert-hABzwCSY.js +1 -0
  36. package/dist/web/assets/{file-error-eIMly20p.js → file-error-B5tv6DhJ.js} +1 -1
  37. package/dist/web/assets/{heading-ss9Xdc-n.js → heading-zIOXe3qT.js} +1 -1
  38. package/dist/web/assets/{history-DgnatlLO.js → history-PYEz5wbe.js} +1 -1
  39. package/dist/web/assets/index-C_S4sA5L.css +2 -0
  40. package/dist/web/assets/index-Dki55xSv.js +10 -0
  41. package/dist/web/assets/label-badge-JdNthOHh.js +1 -0
  42. package/dist/web/assets/{labels-Ca7Ov7o0.js → labels-Dr9t-xYj.js} +1 -1
  43. package/dist/web/assets/{list-6VjnLdz_.js → list-NcxSR9Ja.js} +1 -1
  44. package/dist/web/assets/loops-DI4kElkX.js +1 -0
  45. package/dist/web/assets/mark-uyeJ8aPC.js +1 -0
  46. package/dist/web/assets/markdown-BNebzGGH.js +29 -0
  47. package/dist/web/assets/model-87X7P9Uh.js +1 -0
  48. package/dist/web/assets/moves-DS1ecXd6.js +1 -0
  49. package/dist/web/assets/native-select-BzF8xUnx.js +1 -0
  50. package/dist/web/assets/{not-found-xvnvMs0s.js → not-found-D7GT8Sj7.js} +1 -1
  51. package/dist/web/assets/outcome-DvqnSso3.js +5 -0
  52. package/dist/web/assets/{overview-CF8vBUkv.js → overview-C73v5kbv.js} +1 -1
  53. package/dist/web/assets/{page-0tuebez8.js → page-C47YAWAl.js} +1 -1
  54. package/dist/web/assets/{pull-request-marks-Doq7DaVI.js → pull-request-marks-B4f7z4xa.js} +1 -1
  55. package/dist/web/assets/queries-BZMW2wiD.js +1 -0
  56. package/dist/web/assets/queries-oea_Y4on.js +1 -0
  57. package/dist/web/assets/repositories-CZBhubWh.js +1 -0
  58. package/dist/web/assets/route-BtU2HI1M.js +1 -0
  59. package/dist/web/assets/route-CD6OvH-7.js +1 -0
  60. package/dist/web/assets/{route-status-Cg2e753V.js → route-status-DGpeFNCC.js} +1 -1
  61. package/dist/web/assets/routes-BzeOsU08.js +1 -0
  62. package/dist/web/assets/{routes-aXaODFL1.js → routes-g6SHTgCO.js} +4 -4
  63. package/dist/web/assets/run-again-DPa5c27z.js +1 -0
  64. package/dist/web/assets/{section-Dvf2zdjI.js → section-BZs0sQLB.js} +1 -1
  65. package/dist/web/assets/section-eyIYzZrG.js +24 -0
  66. package/dist/web/assets/{settings-C7SrVNWn.js → settings-DusVdmgP.js} +1 -1
  67. package/dist/web/assets/sortable.esm-Lp8AM6j2.js +5 -0
  68. package/dist/web/assets/{strings-D8AeU2ul.js → strings-Bexnszes.js} +1 -1
  69. package/dist/web/assets/{strings-BcIxtDID.js → strings-DXB6PB2g.js} +63 -63
  70. package/dist/web/assets/tasks-BzeOsU08.js +1 -0
  71. package/dist/web/assets/tasks-ClShPUFW.js +1 -0
  72. package/dist/web/assets/usage-BMYuEDo9.js +1 -0
  73. package/dist/web/assets/use-open-run-B8nD_BT1.js +1 -0
  74. package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +1 -0
  75. package/dist/web/assets/useControlled-B5kAMgo-.js +1 -0
  76. package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +1 -0
  77. package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +1 -0
  78. package/dist/web/assets/{workers-BWNVF5aS.js → workers-CDWbu1Tb.js} +1 -1
  79. package/dist/web/index.html +14 -15
  80. package/package.json +11 -11
  81. package/dist/web/assets/_agent-NYU8ZbHV.js +0 -1
  82. package/dist/web/assets/_loop-BjVObygk.js +0 -1
  83. package/dist/web/assets/_name-B6oTm1fE.js +0 -6
  84. package/dist/web/assets/_name-Ce_Q-lHb.js +0 -1
  85. package/dist/web/assets/_name-D3Tep-4Y.js +0 -1
  86. package/dist/web/assets/_number-8w6uiYOA.js +0 -1
  87. package/dist/web/assets/_number-Ce_Q-lHb.js +0 -1
  88. package/dist/web/assets/_run-Ce_Q-lHb.js +0 -1
  89. package/dist/web/assets/_run-DbyRF4Hm.js +0 -5
  90. package/dist/web/assets/actions-BPHDKUD8.js +0 -1
  91. package/dist/web/assets/agents-BN4G7qse.js +0 -1
  92. package/dist/web/assets/ccount-8deXbw7O.js +0 -1
  93. package/dist/web/assets/code-block-B32s6oe9.js +0 -4
  94. package/dist/web/assets/collapsible-C9-9oo50.js +0 -1
  95. package/dist/web/assets/drawer-DYJv3cI2.js +0 -1
  96. package/dist/web/assets/dropdown-menu-BiC7TTLR.js +0 -1
  97. package/dist/web/assets/edit-and-retry-f_LbEfud.js +0 -1
  98. package/dist/web/assets/error-alert-B_2zeHFu.js +0 -1
  99. package/dist/web/assets/index-C-kJ1rRt.js +0 -10
  100. package/dist/web/assets/index-CdIl44fJ.css +0 -2
  101. package/dist/web/assets/label-badge-BE80XVOx.js +0 -1
  102. package/dist/web/assets/label-f_7LisR0.js +0 -1
  103. package/dist/web/assets/loops-D2E-MWMy.js +0 -1
  104. package/dist/web/assets/mark-mFortOAt.js +0 -1
  105. package/dist/web/assets/markdown-3NxaXixH.js +0 -29
  106. package/dist/web/assets/model-BTe4eohR.js +0 -1
  107. package/dist/web/assets/moves-Ci10cwSz.js +0 -1
  108. package/dist/web/assets/outcome-7cxhEvRx.js +0 -5
  109. package/dist/web/assets/queries-CCEL6uj9.js +0 -1
  110. package/dist/web/assets/queries-CiGD_2IE.js +0 -1
  111. package/dist/web/assets/reason-parts-DmsEA117.js +0 -1
  112. package/dist/web/assets/repositories-DdX53hco.js +0 -1
  113. package/dist/web/assets/route-BQYtlrWB.js +0 -1
  114. package/dist/web/assets/route-nKcGNWV5.js +0 -1
  115. package/dist/web/assets/routes-Ce_Q-lHb.js +0 -1
  116. package/dist/web/assets/run-again-LTJXpcOt.js +0 -1
  117. package/dist/web/assets/section-BF7kbQsU.js +0 -24
  118. package/dist/web/assets/tasks-Ce_Q-lHb.js +0 -1
  119. package/dist/web/assets/tasks-D8qgj3xb.js +0 -1
  120. package/dist/web/assets/usage-BmhM4Mev.js +0 -1
  121. package/dist/web/assets/use-open-run-D4GtXqIL.js +0 -1
  122. package/dist/web/assets/useAnchoredPopupScrollLock-heUDjEK1.js +0 -1
  123. package/dist/web/assets/useSuspenseQuery-NLdoz0Gs.js +0 -1
  124. package/dist/web/assets/useTransitionStatus-Dpq86WgF.js +0 -1
@@ -1,12 +1,12 @@
1
- import{a as e,i as t,o as n,r,s as i}from"./useRouter-Hur3RN7j.js";import{a,i as o,t as s}from"./page-0tuebez8.js";import{t as c}from"./error-alert-B_2zeHFu.js";import{T as l,_ as u,u as d,y as f}from"./reason-parts-DmsEA117.js";import{t as p}from"./useSuspenseQuery-NLdoz0Gs.js";import{O as m,c as h,j as g,n as _,r as v,s as y}from"./overview-CF8vBUkv.js";import{o as b}from"./actions-BPHDKUD8.js";import{n as x}from"./useNavigate-AT5VkfZa.js";import{t as S}from"./link-C7GfYrMt.js";import{t as C}from"./with-selector-Dwf291_Q.js";import{u as w}from"./useTransitionStatus-Dpq86WgF.js";import{A as T,D as E,E as D,L as O,O as k,P as A,R as j,V as M,a as N,k as ee,r as te,t as ne}from"./button-4rhhIcK8.js";import{a as re,dn as ie,f as ae,g as oe,ht as se,ln as ce,n as le,o as ue,p as de,r as fe,t as pe,un as me,vn as he,xn as ge}from"./strings-BcIxtDID.js";import{Gt as _e,S as ve,_ as ye,_t as be,a as xe,b as Se,dt as Ce,ft as we,g as Te,gt as Ee,h as De,i as Oe,l as ke,m as Ae,o as je,pt as Me,s as Ne,t as Pe,u as Fe,v as Ie,x as Le}from"./mark-mFortOAt.js";import{t as Re}from"./use-open-run-D4GtXqIL.js";import{t as ze}from"./skeleton-87E84B2f.js";import{E as Be,K as Ve,Y as He,_ as Ue,g as We,h as Ge,m as Ke}from"./index-C-kJ1rRt.js";import{t as qe}from"./use-now-vNgLntlV.js";import{t as Je}from"./heading-ss9Xdc-n.js";import{n as Ye,r as Xe}from"./status-badge-CLPsMXtK.js";import{t as Ze}from"./ToolbarRootContext-aq6udDVh.js";import{i as Qe,n as $e,r as et,t as tt}from"./collapsible-C9-9oo50.js";import{n as nt,t as rt}from"./CompositeItem-DL5QWzlf.js";import{a as it,i as P,n as at,o as ot,r as st,t as ct}from"./table-hbKjhjeL.js";import{t as lt}from"./fill-cell-CjksmixH.js";import{i as ut,n as dt,r as ft,t as pt}from"./section-Dvf2zdjI.js";import{t as mt}from"./action-BN5NBgLV.js";import{o as ht}from"./model-BTe4eohR.js";import{n as gt}from"./strings-D8AeU2ul.js";function _t(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var F=r(),vt=({needs:e})=>{let t=Re();return e.length===0?null:(0,F.jsxs)(tt,{className:`mt-3`,children:[(0,F.jsxs)(et,{render:(0,F.jsx)(ne,{variant:`ghost`,size:`sm`,className:`-mx-2 w-fit gap-1.5 px-2 text-sm font-medium text-muted-foreground hover:text-foreground data-[panel-open]:text-foreground data-[panel-open]:[&>svg]:rotate-90`}),children:[(0,F.jsx)(b,{"aria-hidden":`true`,className:`transition-transform duration-(--duration-fast)`}),y,` (`,e.length,`)`]}),(0,F.jsx)($e,{children:(0,F.jsx)(`ul`,{className:`mt-2.5 grid grid-cols-1 items-start gap-2.5 lg:grid-cols-2`,children:e.map(e=>{let n=h(e),r=n.runId;return(0,F.jsx)(Ue,{copy:n,open:r===null?void 0:()=>t(r),actions:(0,F.jsx)(Be,{need:e,action:`undoDismissNeed`})},e.id)})})})]})},yt=e=>se(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>`${e} silent since ${fe(t)}`,ProviderRetrying:({agent:e,retries:t,since:n})=>`${e}: provider unreachable, ${t} ${t===1?`retry`:`retries`} since ${fe(n)}`}),bt=e=>e.reduce((e,{slots:{capacity:t,leased:n}})=>e+Math.max(0,t-n),0),xt=e=>{let t=e.reduce((e,{slots:t})=>e+t.capacity,0),n=bt(e);return t===0?`Nothing running`:`Nothing running, ${n} of ${t} worker ${t===1?`slot`:`slots`} free`},St=(e,t)=>{if(e.length===0)return null;if(e.every(({polledAt:e})=>e===null))return`Not checked yet`;let[n]=e;return e.length===1&&n!==void 0&&n.polledAt!==null?`Last checked ${pe(n.polledAt,t)}`:`Last checked ${e.map(({repository:e,polledAt:n})=>`${e} ${n===null?`not yet`:pe(n,t)}`).join(`, `)}`},Ct=e=>{let t=[e.running.length>0?`${e.running.length} running`:null,e.notMoving.length>0?`${e.notMoving.length} stalled`:null].filter(e=>e!==null);return t.length===0?void 0:t.join(`, `)},wt=6e4,Tt=60*wt,Et=24*Tt,Dt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ot={"7d":`7 days`,"30d":`30 days`,all:`All`},kt=e=>e===`all`?`yet`:`in the last ${Ot[e]}`,At=e=>{let t=new Date(`${e}T00:00:00.000Z`);return`${t.getUTCDate()} ${Dt[t.getUTCMonth()]}`},jt=e=>At(new Date(e).toISOString().slice(0,10)),Mt=(e,t)=>t===`day`?At(e):`Week of ${At(e)}`,Nt=(e,t)=>`From ${At(e.slice(0,10))}, by UTC ${t}`,Pt=e=>{if(e<1e3)return`under 1s`;if(e<2*Et)return ue(e);let t=Math.round(e/Tt);return t%24==0?`${t/24} d`:`${Math.floor(t/24)} d ${t%24} h`},Ft=e=>{let t=e/wt,n=t<10?1:t<60?5:t<600?10:60;return`about ${Pt(Math.max(1,Math.round(t/n))*n*wt)}`},It=(e,t)=>t===0?`0%`:`${Math.round(e/t*100)}%`,Lt=e=>e>0&&e<.005?`under 1%`:`${Math.round(e*100)}%`,Rt=({succeeded:e,failed:t,canceled:n})=>e+t+n,zt=(e,t,n)=>`${e.toLocaleString(`en`)} ${e===1?t:n}`,Bt=(e,t)=>t===0?`0`:(e/t).toLocaleString(`en`,{maximumFractionDigits:1}),Vt=e=>`No tasks done ${kt(e)}`,Ht=({tasks:e,before:t})=>e===1?`1 task before ${At(t)} lacks timing and is left out`:`${e.toLocaleString(`en`)} tasks before ${At(t)} lack timing and are left out`,Ut=e=>e===1?`1 task lacks token reports and is left out of tokens`:`${e.toLocaleString(`en`)} tasks lack token reports and are left out of tokens`,Wt=e=>e===1?`1 task lacks a price and is left out of the median price`:`${e.toLocaleString(`en`)} tasks lack a price and are left out of the median price`,Gt=e=>zt(e,`attempt`,`attempts`),Kt=e=>It(e.find(({attempts:e})=>e===1)?.runs??0,e.reduce((e,{runs:t})=>e+t,0)),qt=`Median failure to answer`,Jt=`Median failure to retry`,Yt=`Median failure to resolution`,Xt={title:`No projects registered`,description:`Register a repository in Configuration.`,action:`Open repositories`},Zt=({closed:e,overview:t,now:n})=>{let{run:r,item:i,closedAt:a}=e,o=Ne(t,r.itemKey),s=he(o,{onNone:()=>i,onSome:e=>Oe(e).origin}),c=ce(me(ie(r.pullRequestUrl),e=>je(e,he(o,{onNone:()=>[],onSome:({items:e})=>e}))),({number:e})=>e!==s?.number);return(0,F.jsxs)(ut,{run:r,children:[(0,F.jsxs)(lt,{className:`py-3`,children:[(0,F.jsx)(ft,{run:r,children:s===null?(0,F.jsxs)(`span`,{className:`block truncate text-sm font-medium`,children:[`Run `,(0,F.jsx)(`span`,{className:`font-mono text-xs`,children:r.id.slice(0,8)})]}):(0,F.jsx)(Je,{variant:`row`,item:ge(s),title:s.title,linked:!1})}),(0,F.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground md:hidden`,children:r.loop})]}),(0,F.jsx)(st,{className:`py-3 max-md:hidden`,children:r.loop}),(0,F.jsx)(st,{className:`py-3`,children:(0,F.jsx)(Xe,{state:r.state})}),(0,F.jsx)(st,{className:`py-3 text-right max-sm:hidden`,children:(0,F.jsx)(`time`,{dateTime:a,title:ae(a),className:`text-xs text-muted-foreground tabular-nums`,children:pe(a,n)})}),(0,F.jsx)(st,{className:`py-3 text-right`,children:r.pullRequestUrl===null?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`None`}):he(c,{onNone:()=>null,onSome:e=>(0,F.jsx)(Pe,{item:e})})})]})},Qt=({outcomes:e,now:t})=>{let n=ke();return e.length===0?(0,F.jsx)(dt,{children:`No recent runs`}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(it,{children:(0,F.jsxs)(ot,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:`Item`}),(0,F.jsx)(P,{className:`max-md:hidden`,children:`Loop`}),(0,F.jsx)(P,{children:`Outcome`}),(0,F.jsx)(P,{className:`text-right max-sm:hidden`,children:`Closed`}),(0,F.jsx)(P,{className:`text-right`,children:`Pull request`})]})}),(0,F.jsx)(at,{children:e.map(e=>(0,F.jsx)(Zt,{closed:e,overview:n,now:t},e.run.id))})]})})},$t=({stalled:e,overview:t,now:n,readOnly:r,narrow:i})=>{let a=ht(e),{origin:o}=xe(t,e.item),s=(0,F.jsx)(Je,{variant:`row`,item:ge(o),title:o.title,linked:a===null}),c=a===null?s:(0,F.jsx)(ft,{run:a,children:s}),l=(0,F.jsx)(mt,{stalled:e,readOnly:r,appearance:`row`});return i?(0,F.jsx)(ut,{run:a,children:(0,F.jsxs)(lt,{className:`py-3 align-top whitespace-normal`,children:[c,(0,F.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.loop}),(0,F.jsx)(`p`,{className:`mt-1 text-sm text-foreground/90`,children:gt(e,n)}),(0,F.jsx)(`div`,{className:`-ml-2.5 empty:hidden [&>span]:items-start`,children:l})]})}):(0,F.jsxs)(ut,{run:a,children:[(0,F.jsx)(st,{className:`w-2/5 max-w-0 py-3 align-top whitespace-normal`,children:c}),(0,F.jsx)(st,{className:`py-3 align-top`,children:e.loop}),(0,F.jsx)(st,{className:`w-3/5 py-3 align-top whitespace-normal text-foreground/90`,children:gt(e,n)}),(0,F.jsx)(st,{className:`py-2 text-right align-top`,children:l})]})},en=({stalled:e,now:t,readOnly:n,polled:r})=>{let i=Ve(),a=ke();return e.length===0?(0,F.jsx)(dt,{children:r?`Nothing stalled`:`Not checked yet`}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(it,{children:(0,F.jsxs)(ot,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:`Item`}),!i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(P,{children:`Loop`}),(0,F.jsx)(P,{children:`Reason`}),(0,F.jsx)(P,{children:(0,F.jsx)(`span`,{className:`sr-only`,children:`Action`})})]})]})}),(0,F.jsx)(at,{children:e.map(e=>(0,F.jsx)($t,{stalled:e,overview:a,now:t,readOnly:n,narrow:i},`${e.loop}:${e.item.itemKey}`))})]})})},tn=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString()?ae(e).slice(11):re(e),nn=({running:e,overview:t,now:n})=>{let{run:r,attempt:i,item:a,lastActivityAt:o,warnings:s}=e,c=a===null?null:xe(t,a).origin;return(0,F.jsxs)(ut,{run:r,children:[(0,F.jsxs)(lt,{className:`py-3 whitespace-normal align-top`,children:[(0,F.jsx)(ft,{run:r,children:c===null?(0,F.jsxs)(`span`,{className:`block truncate text-sm font-medium`,children:[`Run `,(0,F.jsx)(`span`,{className:`font-mono text-xs`,children:r.id.slice(0,8)})]}):(0,F.jsx)(Je,{variant:`row`,item:ge(c),title:c.title,linked:!1})}),(0,F.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground lg:hidden`,children:[(0,F.jsxs)(`span`,{className:`md:hidden`,children:[r.loop,`, `,r.agent,` on `,i.worker]}),(0,F.jsxs)(`span`,{className:`max-md:hidden`,children:[r.agent,` on `,i.worker]})]}),s.map(e=>(0,F.jsxs)(`p`,{className:`mt-1 flex items-start gap-1.5 text-xs text-warning`,children:[(0,F.jsx)(He,{"aria-hidden":`true`,weight:`fill`,className:`mt-0.5 size-3 shrink-0`}),(0,F.jsxs)(`span`,{children:[yt(e),e._tag===`ProviderRetrying`&&(0,F.jsx)(`span`,{className:`block text-warning/80 wrap-anywhere`,children:e.message})]})]},e._tag===`WorkerSilent`?e.worker:`${e.agent}`))]}),(0,F.jsx)(st,{className:`py-3 max-md:hidden align-top`,children:r.loop}),(0,F.jsx)(st,{className:`py-3 max-lg:hidden align-top`,children:r.agent}),(0,F.jsx)(st,{className:`py-3 max-lg:hidden align-top`,children:i.worker}),(0,F.jsx)(st,{className:`py-3 max-sm:hidden align-top`,children:(0,F.jsx)(`time`,{dateTime:i.startedAt,title:ae(i.startedAt),className:`font-mono text-xs tabular-nums`,children:tn(i.startedAt,n)})}),(0,F.jsx)(st,{className:`py-3 text-right align-top`,children:o===null?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`None yet`}):(0,F.jsx)(`time`,{dateTime:o,title:ae(o),className:`text-xs text-muted-foreground tabular-nums`,children:pe(o,n)})})]})},rn=({running:e,workers:t,now:n})=>{let r=ke();return e.length===0?(0,F.jsx)(dt,{children:xt(t)}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(it,{children:(0,F.jsxs)(ot,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:`Item`}),(0,F.jsx)(P,{className:`max-md:hidden`,children:`Loop`}),(0,F.jsx)(P,{className:`max-lg:hidden`,children:`Agent`}),(0,F.jsx)(P,{className:`max-lg:hidden`,children:`Worker`}),(0,F.jsx)(P,{className:`max-sm:hidden`,children:`Started`}),(0,F.jsx)(P,{className:`text-right`,children:`Last activity`})]})}),(0,F.jsx)(at,{children:e.map(e=>(0,F.jsx)(nn,{running:e,overview:r,now:n},e.attempt.id))})]})})},I=i(t(),1),an=I.createContext(void 0);function on(){return I.useContext(an)}var sn=I.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:p,nativeButton:m=!0,style:h,...g}=e,_=f(p||void 0),v=on(),y=v?.value??[],b=(i||v?.disabled)??!1,[x,S]=Qe({controlled:v?_!==void 0&&y.indexOf(_)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:C,buttonRef:w}=te({disabled:b,native:m}),T={disabled:b,pressed:x},E=[w,t],D=[{"aria-pressed":x,onClick(e){let t=!x,n=u(d,e.nativeEvent);o?.(t,n),!n.isCanceled&&(_&&v?.setGroupValue?.(_,t,n),!n.isCanceled&&S(t))}},g,C],O=A(`button`,e,{enabled:!v,state:T,ref:E,props:D}),k=I.useMemo(()=>({disabled:b,focusableWhenDisabled:!1}),[b]);return v?(0,F.jsx)(rt,{tag:`button`,render:c,className:n,style:h,metadata:k,state:T,refs:E,props:D}):O});function cn(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=O}=e,[p,m]=I.useState(0),h=r!=null,g=I.useRef(null),_=M(g,c),v=I.useRef([]),y=I.useRef(!1),b=I.useRef(null),x=o??p,S=T((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];ve(g.current,t,a,n)}}),C=T(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||be(e,x,d)?S(ln(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(be(t,x,d)){let e=Ce(t,{disabledIndices:d});Ee(t,e)||S(e)}ve(g.current,r,a,n)});ee(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(be(e,x,d)){let t=Ce(e,{disabledIndices:d});Ee(e,t)||S(t)}},[d,o,x,v,S]);let w=T((e,t,n)=>i?i(e,t,n,v):n),E=T(e=>{let o=e.key===`Home`||e.key===`End`;if(!Ie.has(e.key)||!l&&o||un(e,f)||!g.current)return;let s=a===`rtl`,c=s?De:Te,p=s?Te:De,m=n===`vertical`?Ae:c,_=n===`vertical`?ye:p,y=_e(e.nativeEvent);if(y!=null&&Le(y)&&!_t(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=Me(v,d),T=we(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=Ce(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!Ee(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=_e(e.nativeEvent);t&&n!=null&&Le(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:E}}function ln(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!be(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function un(e,t){for(let n of Se)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function dn(e){let{render:t,className:n,style:r,refs:i=O,props:a=O,state:o=j,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:k}=cn({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Fe(),disabledIndices:v,modifierKeys:y}),M=A(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),ee=I.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:k}),[w,T,b,k]);return(0,F.jsx)(N.Provider,{value:ee,children:(0,F.jsx)(nt,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:M})})}var fn=I.createContext(void 0);function pn(){return I.useContext(fn)}var mn=I.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=Ze(!0),m=pn(),h=n??O,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=Qe({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),b=T((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:s,orientation:o},S=I.useMemo(()=>({disabled:_,setGroupValue:b,value:v,isValueInitialized:g}),[_,b,v,g]),C={role:`group`},w=A(`div`,e,{enabled:!!p,state:x,ref:t,props:[C,f]});return(0,F.jsx)(an.Provider,{value:S,children:p?w:(0,F.jsx)(dn,{render:u,className:l,style:d,state:x,refs:[t],props:[C,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),hn=D(`group/toggle inline-flex items-center justify-center gap-1.5 rounded-md text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow] duration-100 outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent text-muted-foreground hover:bg-muted/50 aria-pressed:text-foreground`},size:{default:`h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,sm:`h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),gn=I.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function _n({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,F.jsx)(mn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:E(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,F.jsx)(gn.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function vn({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=I.useContext(gn);return(0,F.jsx)(sn,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:E(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,hn({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var yn=`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`.split(`.`);function bn(e){return typeof e==`string`&&yn.includes(e)}var xn=new Set(`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`.split(`.`));function Sn(e){return typeof e==`string`&&xn.has(e)}function Cn(e){return typeof e==`string`&&e.startsWith(`data-`)}function wn(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Sn(n)||Cn(n))&&(t[n]=e[n]);return t}function Tn(e){if(e==null)return null;if((0,I.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return wn(t)}return typeof e==`object`&&!Array.isArray(e)?wn(e):null}function En(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Sn(n)||Cn(n)||bn(n))&&(t[n]=e[n]);return t}function Dn(e){return e==null?null:(0,I.isValidElement)(e)?En(e.props):typeof e==`object`&&!Array.isArray(e)?En(e):null}var On=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function kn(){return kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(null,arguments)}function An(e,t){if(e==null)return{};var n,r,i=jn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Mn=(0,I.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=An(e,On),d=a||{width:r,height:i,x:0,y:0},f=k(`recharts-surface`,o);return I.createElement(`svg`,kn({},En(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),I.createElement(`title`,null,c),I.createElement(`desc`,null,l),n)}),Nn=[`children`,`className`];function Pn(){return Pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(null,arguments)}function Fn(e,t){if(e==null)return{};var n,r,i=In(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function In(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ln=I.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Fn(e,Nn),a=k(`recharts-layer`,r);return I.createElement(`g`,Pn({className:a},En(i),{ref:t}),n)});function Rn(e){return e===`__proto__`}var zn=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function Bn(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:zn.test(e);default:return!1}}function Vn(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function Hn(e){return typeof e==`symbol`||e instanceof Symbol}function Un(e){return e==null?``:Wn(e)}function Wn(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Wn).join(`,`);if(Hn(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Gn(e){if(Array.isArray(e))return e.map(Vn);if(typeof e==`symbol`)return[e];e=Un(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o){if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l}else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function Kn(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Rn(t))return n;let r=e[t];return r===void 0?Bn(t)&&!Object.hasOwn(e,t)?Kn(e,Gn(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Vn(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return qn(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Rn(t))return n;let r=e[t];return r===void 0?n:r}}}function qn(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Rn(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var Jn=4;function Yn(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jn),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function Xn(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Yn(i)+n},``)}var Zn=e=>e===0?0:e>0?1:-1,Qn=e=>typeof e==`number`&&e!=+e,$n=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,L=e=>(typeof e==`number`||e instanceof Number)&&!Qn(e),er=e=>L(e)||typeof e==`string`,tr=0,nr=e=>{var t=++tr;return`${e||``}${t}`},rr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!L(e)&&typeof e!=`string`)return n;var i;if($n(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Qn(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},ir=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function R(e,t,n){return L(e)&&L(t)?Yn(e+n*(t-e)):t}function ar(e,t,n){if(e&&e.length)return e.find(e=>e&&(typeof t==`function`?t(e):Kn(e,t))===n)}var or=e=>{for(var t=e.length,n=0,r=0,i=0,a=0,o=1/0,s=-1/0,c=0,l=0,u=0;u<t;u++)c=e[u]?.cx||0,l=e[u]?.cy||0,n+=c,r+=l,i+=c*l,a+=c*c,o=Math.min(o,c),s=Math.max(s,c);var d=t*a===n*n?0:(t*i-n*r)/(t*a-n*n);return{xmin:o,xmax:s,a:d,b:(r-d*n)/t}},z=e=>e==null,sr=e=>z(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function cr(e){return e!=null}function lr(){}function ur(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}}function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dr(Object(n),!0).forEach(function(t){pr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pr(e,t,n){return(t=mr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(e){var t=hr(e,`string`);return typeof t==`symbol`?t:t+``}function hr(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var gr=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=ur(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?fr({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?fr({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?fr({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?fr({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?fr({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?fr({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?fr({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?fr({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(L(n.x)||$n(n.x))&&(L(n.y)||$n(n.y))?fr({x:c+rr(n.x,g),y:l+rr(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):fr({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},_r=[`top`,`left`,`right`,`bottom`];function vr(e){return e==null?!1:typeof e==`object`||_r.includes(e)}var yr=(0,I.createContext)(null),br=()=>(0,I.useContext)(yr);function B(e){return function(){return e}}var xr=Math.cos,Sr=Math.sin,Cr=Math.sqrt,wr=Math.PI;wr/2;var Tr=2*wr,Er=Math.PI,Dr=2*Er,Or=1e-6,kr=Dr-Or;function Ar(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jr(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ar;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Mr=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Ar:jr(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Or){if(!(Math.abs(u*s-c*l)>Or)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Er-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Or&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Or||Math.abs(this._y1-l)>Or)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Dr+Dr),d>kr?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Or&&this._append`A${n},${n},0,${+(d>=Er)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Mr.prototype;function Nr(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Mr(t)}Array.prototype.slice;function Pr(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Fr(e){this._context=e}Fr.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,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Ir(e){return new Fr(e)}function Lr(e){return e[0]}function Rr(e){return e[1]}function zr(e,t){var n=B(!0),r=null,i=Ir,a=null,o=Nr(s);e=typeof e==`function`?e:e===void 0?Lr:B(e),t=typeof t==`function`?t:t===void 0?Rr:B(t);function s(s){var c,l=(s=Pr(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:B(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:B(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Br(e,t,n){var r=null,i=B(!0),a=null,o=Ir,s=null,c=Nr(l);e=typeof e==`function`?e:e===void 0?Lr:B(+e),t=typeof t==`function`?t:B(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Rr:B(+n);function l(l){var u,d,f,p=(l=Pr(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return zr().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:B(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:B(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:B(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:B(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:B(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Vr=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function Hr(e){return new Vr(e,!0)}function Ur(e){return new Vr(e,!1)}var Wr={draw(e,t){let n=Cr(t/wr);e.moveTo(n,0),e.arc(0,0,n,0,Tr)}},Gr={draw(e,t){let n=Cr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Kr=Cr(1/3),qr=Kr*2,Jr={draw(e,t){let n=Cr(t/qr),r=n*Kr;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Yr={draw(e,t){let n=Cr(t),r=-n/2;e.rect(r,r,n,n)}},Xr=.8908130915292852,Zr=Sr(wr/10)/Sr(7*wr/10),Qr=Sr(Tr/10)*Zr,$r=-xr(Tr/10)*Zr,ei={draw(e,t){let n=Cr(t*Xr),r=Qr*n,i=$r*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Tr*t/5,o=xr(a),s=Sr(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},ti=Cr(3),ni={draw(e,t){let n=-Cr(t/(ti*3));e.moveTo(0,n*2),e.lineTo(-ti*n,-n),e.lineTo(ti*n,-n),e.closePath()}},ri=-.5,ii=Cr(3)/2,ai=1/Cr(12),oi=(ai/2+1)*3,si={draw(e,t){let n=Cr(t/oi),r=n/2,i=n*ai,a=r,o=n*ai+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(ri*r-ii*i,ii*r+ri*i),e.lineTo(ri*a-ii*o,ii*a+ri*o),e.lineTo(ri*s-ii*c,ii*s+ri*c),e.lineTo(ri*r+ii*i,ri*i-ii*r),e.lineTo(ri*a+ii*o,ri*o-ii*a),e.lineTo(ri*s+ii*c,ri*c-ii*s),e.closePath()}};function ci(e,t){let n=null,r=Nr(i);e=typeof e==`function`?e:B(e||Wr),t=typeof t==`function`?t:B(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:B(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function li(){}function ui(e,t,n){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+t)/6,(e._y0+4*e._y1+n)/6)}function di(e){this._context=e}di.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:ui(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:ui(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fi(e){return new di(e)}function pi(e){this._context=e}pi.prototype={areaStart:li,areaEnd:li,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)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ui(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mi(e){return new pi(e)}function hi(e){this._context=e}hi.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,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ui(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gi(e){return new hi(e)}function _i(e){this._context=e}_i.prototype={areaStart:li,areaEnd:li,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function vi(e){return new _i(e)}function yi(e){return e<0?-1:1}function bi(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(yi(a)+yi(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xi(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Si(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Ci(e){this._context=e}Ci.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:Si(this,this._t0,xi(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Si(this,xi(this,n=bi(this,e,t)),n);break;default:Si(this,this._t0,n=bi(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wi(e){this._context=new Ti(e)}(wi.prototype=Object.create(Ci.prototype)).point=function(e,t){Ci.prototype.point.call(this,t,e)};function Ti(e){this._context=e}Ti.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Ei(e){return new Ci(e)}function Di(e){return new wi(e)}function Oi(e){this._context=e}Oi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ki(e),i=ki(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function ki(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Ai(e){return new Oi(e)}function ji(e,t){this._context=e,this._t=t}ji.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,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function Mi(e){return new ji(e,.5)}function Ni(e){return new ji(e,0)}function Pi(e){return new ji(e,1)}function Fi(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Ii(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Li(e,t){return e[t]}function Ri(e){let t=[];return t.key=e,t}function zi(){var e=B([]),t=Ii,n=Fi,r=Li;function i(i){var a=Array.from(e.apply(this,arguments),Ri),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=Pr(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:B(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:B(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?Ii:typeof e==`function`?e:B(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??Fi,i):n},i}function Bi(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Fi(e,t)}}function Vi(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}Fi(e,t)}}function Hi(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,Fi(e,t)}}var Ui=[`type`,`size`,`sizeType`];function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wi.apply(null,arguments)}function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gi(Object(n),!0).forEach(function(t){qi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qi(e,t,n){return(t=Ji(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ji(e){var t=Yi(e,`string`);return typeof t==`symbol`?t:t+``}function Yi(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Xi(e,t){if(e==null)return{};var n,r,i=Zi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Qi={symbolCircle:Wr,symbolCross:Gr,symbolDiamond:Jr,symbolSquare:Yr,symbolStar:ei,symbolTriangle:ni,symbolWye:si},$i=Math.PI/180,ea=e=>Qi[`symbol${sr(e)}`]||Wr,ta=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*$i;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**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}},na=(e,t)=>{Qi[`symbol${sr(e)}`]=t},ra=e=>{var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=Ki(Ki({},Xi(e,Ui)),{},{type:n,size:i,sizeType:o}),c=`circle`;typeof n==`string`&&(c=n);var l=()=>{var e=ea(c),t=ci().type(e).size(ta(i,o,c))();if(t!==null)return t},u=s.className,d=s.cx,f=s.cy,p=En(s);return L(d)&&L(f)&&L(i)?I.createElement(`path`,Wi({},p,{className:k(`recharts-symbols`,u),transform:`translate(${d}, ${f})`,d:l()})):null};ra.registerSymbol=na;var ia=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,aa=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,I.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{bn(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},oa=(e,t,n)=>r=>(e(t,n,r),null),sa=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];bn(i)&&typeof a==`function`&&(r||={},r[i]=oa(a,t,n))}),r},ca=e=>Array.isArray(e)&&e.length>0;function la(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?la(Object(n),!0).forEach(function(t){da(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function da(e,t,n){return(t=fa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e){var t=pa(e,`string`);return typeof t==`symbol`?t:t+``}function pa(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function V(e,t){var n=ua({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function ma(){return ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ma.apply(null,arguments)}function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ga(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ha(Object(n),!0).forEach(function(t){_a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _a(e,t,n){return(t=va(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function va(e){var t=ya(e,`string`);return typeof t==`symbol`?t:t+``}function ya(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ba=32,xa={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Sa(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Ca(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=ba/2,a=ba/6,o=ba/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return I.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Sa(t.payload),x1:0,y1:i,x2:ba,y2:i,className:`recharts-legend-icon`});if(c===`line`)return I.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
1
+ import{a as e,i as t,o as n,r,s as i}from"./useRouter-Hur3RN7j.js";import{a,i as o,t as s}from"./page-C47YAWAl.js";import{t as c}from"./error-alert-hABzwCSY.js";import{I as l,L as u,f as d,x as f,y as p}from"./visuallyHidden-BUGCJ1D9.js";import{t as m}from"./useSuspenseQuery-DbhQN-t-.js";import{O as h,c as g,j as _,n as v,r as y,s as b}from"./overview-C73v5kbv.js";import{o as x}from"./actions-CG0hkpe7.js";import{n as S}from"./useNavigate-AT5VkfZa.js";import{t as C}from"./link-C7GfYrMt.js";import{t as w}from"./with-selector-Dwf291_Q.js";import{A as T,D as E,E as D,L as O,O as k,P as A,R as j,V as M,a as N,k as ee,r as te,t as ne}from"./button-4rhhIcK8.js";import{An as re,Hn as ie,Mn as ae,Ot as oe,a as se,f as ce,g as le,jn as ue,n as de,o as fe,p as pe,r as me,t as he,zn as ge}from"./strings-DXB6PB2g.js";import{Gt as _e,S as ve,_ as ye,_t as be,a as xe,b as Se,dt as Ce,ft as we,g as Te,gt as Ee,h as De,i as Oe,l as ke,m as Ae,o as je,pt as Me,s as Ne,t as Pe,u as Fe,v as Ie,x as Le}from"./mark-uyeJ8aPC.js";import{t as Re}from"./use-open-run-B8nD_BT1.js";import{t as ze}from"./skeleton-87E84B2f.js";import{$ as Be,E as Ve,_ as He,g as Ue,h as We,m as Ge,nt as Ke}from"./index-Dki55xSv.js";import{t as qe}from"./use-now-vNgLntlV.js";import{t as Je}from"./heading-zIOXe3qT.js";import{n as Ye,r as Xe}from"./status-badge-CLPsMXtK.js";import{t as Ze}from"./ToolbarRootContext-aq6udDVh.js";import{t as Qe}from"./useControlled-B5kAMgo-.js";import{n as $e,t as et}from"./CompositeItem-DL5QWzlf.js";import{a as tt,i as P,n as nt,o as rt,r as it,t as at}from"./table-hbKjhjeL.js";import{t as ot}from"./fill-cell-CjksmixH.js";import{n as st,r as ct,t as lt}from"./collapsible-BKcakxvM.js";import{i as ut,n as dt,r as ft,t as pt}from"./section-BZs0sQLB.js";import{t as mt}from"./action-DQzkdVHs.js";import{o as ht}from"./model-87X7P9Uh.js";import{n as gt}from"./strings-Bexnszes.js";function _t(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var F=r(),vt=({needs:e})=>{let t=Re();return e.length===0?null:(0,F.jsxs)(lt,{className:`mt-3`,children:[(0,F.jsxs)(ct,{render:(0,F.jsx)(ne,{variant:`ghost`,size:`sm`,className:`-mx-2 w-fit gap-1.5 px-2 text-sm font-medium text-muted-foreground hover:text-foreground data-[panel-open]:text-foreground data-[panel-open]:[&>svg]:rotate-90`}),children:[(0,F.jsx)(x,{"aria-hidden":`true`,className:`transition-transform duration-(--duration-fast)`}),b,` (`,e.length,`)`]}),(0,F.jsx)(st,{children:(0,F.jsx)(`ul`,{className:`mt-2.5 grid grid-cols-1 items-start gap-2.5 lg:grid-cols-2`,children:e.map(e=>{let n=g(e),r=n.runId;return(0,F.jsx)(He,{copy:n,open:r===null?void 0:()=>t(r),actions:(0,F.jsx)(Ve,{need:e,action:`undoDismissNeed`})},e.id)})})})]})},yt=e=>oe(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>`${e} silent since ${me(t)}`,ProviderRetrying:({agent:e,retries:t,since:n})=>`${e}: provider unreachable, ${t} ${t===1?`retry`:`retries`} since ${me(n)}`}),bt=e=>e.reduce((e,{slots:{capacity:t,leased:n}})=>e+Math.max(0,t-n),0),xt=e=>{let t=e.reduce((e,{slots:t})=>e+t.capacity,0),n=bt(e);return t===0?`Nothing running`:`Nothing running, ${n} of ${t} worker ${t===1?`slot`:`slots`} free`},St=(e,t)=>{if(e.length===0)return null;if(e.every(({polledAt:e})=>e===null))return`Not checked yet`;let[n]=e;return e.length===1&&n!==void 0&&n.polledAt!==null?`Last checked ${he(n.polledAt,t)}`:`Last checked ${e.map(({repository:e,polledAt:n})=>`${e} ${n===null?`not yet`:he(n,t)}`).join(`, `)}`},Ct=e=>{let t=[e.running.length>0?`${e.running.length} running`:null,e.notMoving.length>0?`${e.notMoving.length} stalled`:null].filter(e=>e!==null);return t.length===0?void 0:t.join(`, `)},wt=6e4,Tt=60*wt,Et=24*Tt,Dt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ot={"7d":`7 days`,"30d":`30 days`,all:`All`},kt=e=>e===`all`?`yet`:`in the last ${Ot[e]}`,At=e=>{let t=new Date(`${e}T00:00:00.000Z`);return`${t.getUTCDate()} ${Dt[t.getUTCMonth()]}`},jt=e=>At(new Date(e).toISOString().slice(0,10)),Mt=(e,t)=>t===`day`?At(e):`Week of ${At(e)}`,Nt=(e,t)=>`From ${At(e.slice(0,10))}, by UTC ${t}`,Pt=e=>{if(e<1e3)return`under 1s`;if(e<2*Et)return fe(e);let t=Math.round(e/Tt);return t%24==0?`${t/24} d`:`${Math.floor(t/24)} d ${t%24} h`},Ft=e=>{let t=e/wt,n=t<10?1:t<60?5:t<600?10:60;return`about ${Pt(Math.max(1,Math.round(t/n))*n*wt)}`},It=(e,t)=>t===0?`0%`:`${Math.round(e/t*100)}%`,Lt=e=>e>0&&e<.005?`under 1%`:`${Math.round(e*100)}%`,Rt=({succeeded:e,failed:t,canceled:n})=>e+t+n,zt=(e,t,n)=>`${e.toLocaleString(`en`)} ${e===1?t:n}`,Bt=(e,t)=>t===0?`0`:(e/t).toLocaleString(`en`,{maximumFractionDigits:1}),Vt=e=>`No tasks done ${kt(e)}`,Ht=({tasks:e,before:t})=>e===1?`1 task before ${At(t)} lacks timing and is left out`:`${e.toLocaleString(`en`)} tasks before ${At(t)} lack timing and are left out`,Ut=e=>e===1?`1 task lacks token reports and is left out of tokens`:`${e.toLocaleString(`en`)} tasks lack token reports and are left out of tokens`,Wt=e=>e===1?`1 task lacks a price and is left out of the median price`:`${e.toLocaleString(`en`)} tasks lack a price and are left out of the median price`,Gt=e=>zt(e,`attempt`,`attempts`),Kt=e=>It(e.find(({attempts:e})=>e===1)?.runs??0,e.reduce((e,{runs:t})=>e+t,0)),qt=`Median failure to answer`,Jt=`Median failure to retry`,Yt=`Median failure to resolution`,Xt={title:`No projects registered`,description:`Register a repository in Configuration.`,action:`Open repositories`},Zt=({closed:e,overview:t,now:n})=>{let{run:r,item:i,closedAt:a}=e,o=Ne(t,r.itemKey),s=ge(o,{onNone:()=>i,onSome:e=>Oe(e).origin}),c=re(ue(ae(r.pullRequestUrl),e=>je(e,ge(o,{onNone:()=>[],onSome:({items:e})=>e}))),({number:e})=>e!==s?.number);return(0,F.jsxs)(ut,{run:r,children:[(0,F.jsxs)(ot,{className:`py-3`,children:[(0,F.jsx)(ft,{run:r,children:s===null?(0,F.jsxs)(`span`,{className:`block truncate text-sm font-medium`,children:[`Run `,(0,F.jsx)(`span`,{className:`font-mono text-xs`,children:r.id.slice(0,8)})]}):(0,F.jsx)(Je,{variant:`row`,item:ie(s),title:s.title,linked:!1})}),(0,F.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground md:hidden`,children:r.loop})]}),(0,F.jsx)(it,{className:`py-3 max-md:hidden`,children:r.loop}),(0,F.jsx)(it,{className:`py-3`,children:(0,F.jsx)(Xe,{state:r.state})}),(0,F.jsx)(it,{className:`py-3 text-right max-sm:hidden`,children:(0,F.jsx)(`time`,{dateTime:a,title:ce(a),className:`text-xs text-muted-foreground tabular-nums`,children:he(a,n)})}),(0,F.jsx)(it,{className:`py-3 text-right`,children:r.pullRequestUrl===null?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`None`}):ge(c,{onNone:()=>null,onSome:e=>(0,F.jsx)(Pe,{item:e})})})]})},Qt=({outcomes:e,now:t})=>{let n=ke();return e.length===0?(0,F.jsx)(dt,{children:`No recent runs`}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(at,{children:[(0,F.jsx)(tt,{children:(0,F.jsxs)(rt,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:`Item`}),(0,F.jsx)(P,{className:`max-md:hidden`,children:`Loop`}),(0,F.jsx)(P,{children:`Outcome`}),(0,F.jsx)(P,{className:`text-right max-sm:hidden`,children:`Closed`}),(0,F.jsx)(P,{className:`text-right`,children:`Pull request`})]})}),(0,F.jsx)(nt,{children:e.map(e=>(0,F.jsx)(Zt,{closed:e,overview:n,now:t},e.run.id))})]})})},$t=({stalled:e,overview:t,now:n,readOnly:r,narrow:i})=>{let a=ht(e),{origin:o}=xe(t,e.item),s=(0,F.jsx)(Je,{variant:`row`,item:ie(o),title:o.title,linked:a===null}),c=a===null?s:(0,F.jsx)(ft,{run:a,children:s}),l=(0,F.jsx)(mt,{stalled:e,readOnly:r,appearance:`row`});return i?(0,F.jsx)(ut,{run:a,children:(0,F.jsxs)(ot,{className:`py-3 align-top whitespace-normal`,children:[c,(0,F.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.loop}),(0,F.jsx)(`p`,{className:`mt-1 text-sm text-foreground/90`,children:gt(e,n)}),(0,F.jsx)(`div`,{className:`-ml-2.5 empty:hidden [&>span]:items-start`,children:l})]})}):(0,F.jsxs)(ut,{run:a,children:[(0,F.jsx)(it,{className:`w-2/5 max-w-0 py-3 align-top whitespace-normal`,children:c}),(0,F.jsx)(it,{className:`py-3 align-top`,children:e.loop}),(0,F.jsx)(it,{className:`w-3/5 py-3 align-top whitespace-normal text-foreground/90`,children:gt(e,n)}),(0,F.jsx)(it,{className:`py-2 text-right align-top`,children:l})]})},en=({stalled:e,now:t,readOnly:n,polled:r})=>{let i=Be(),a=ke();return e.length===0?(0,F.jsx)(dt,{children:r?`Nothing stalled`:`Not checked yet`}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(at,{children:[(0,F.jsx)(tt,{children:(0,F.jsxs)(rt,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:`Item`}),!i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(P,{children:`Loop`}),(0,F.jsx)(P,{children:`Reason`}),(0,F.jsx)(P,{children:(0,F.jsx)(`span`,{className:`sr-only`,children:`Action`})})]})]})}),(0,F.jsx)(nt,{children:e.map(e=>(0,F.jsx)($t,{stalled:e,overview:a,now:t,readOnly:n,narrow:i},`${e.loop}:${e.item.itemKey}`))})]})})},tn=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString()?ce(e).slice(11):se(e),nn=({running:e,overview:t,now:n})=>{let{run:r,attempt:i,item:a,lastActivityAt:o,warnings:s}=e,c=a===null?null:xe(t,a).origin;return(0,F.jsxs)(ut,{run:r,children:[(0,F.jsxs)(ot,{className:`py-3 whitespace-normal align-top`,children:[(0,F.jsx)(ft,{run:r,children:c===null?(0,F.jsxs)(`span`,{className:`block truncate text-sm font-medium`,children:[`Run `,(0,F.jsx)(`span`,{className:`font-mono text-xs`,children:r.id.slice(0,8)})]}):(0,F.jsx)(Je,{variant:`row`,item:ie(c),title:c.title,linked:!1})}),(0,F.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground lg:hidden`,children:[(0,F.jsxs)(`span`,{className:`md:hidden`,children:[r.loop,`, `,r.agent,` on `,i.worker]}),(0,F.jsxs)(`span`,{className:`max-md:hidden`,children:[r.agent,` on `,i.worker]})]}),s.map(e=>(0,F.jsxs)(`p`,{className:`mt-1 flex items-start gap-1.5 text-xs text-warning`,children:[(0,F.jsx)(Ke,{"aria-hidden":`true`,weight:`fill`,className:`mt-0.5 size-3 shrink-0`}),(0,F.jsxs)(`span`,{children:[yt(e),e._tag===`ProviderRetrying`&&(0,F.jsx)(`span`,{className:`block text-warning/80 wrap-anywhere`,children:e.message})]})]},e._tag===`WorkerSilent`?e.worker:`${e.agent}`))]}),(0,F.jsx)(it,{className:`py-3 max-md:hidden align-top`,children:r.loop}),(0,F.jsx)(it,{className:`py-3 max-lg:hidden align-top`,children:r.agent}),(0,F.jsx)(it,{className:`py-3 max-lg:hidden align-top`,children:i.worker}),(0,F.jsx)(it,{className:`py-3 max-sm:hidden align-top`,children:(0,F.jsx)(`time`,{dateTime:i.startedAt,title:ce(i.startedAt),className:`font-mono text-xs tabular-nums`,children:tn(i.startedAt,n)})}),(0,F.jsx)(it,{className:`py-3 text-right align-top`,children:o===null?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`None yet`}):(0,F.jsx)(`time`,{dateTime:o,title:ce(o),className:`text-xs text-muted-foreground tabular-nums`,children:he(o,n)})})]})},rn=({running:e,workers:t,now:n})=>{let r=ke();return e.length===0?(0,F.jsx)(dt,{children:xt(t)}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(at,{children:[(0,F.jsx)(tt,{children:(0,F.jsxs)(rt,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:`Item`}),(0,F.jsx)(P,{className:`max-md:hidden`,children:`Loop`}),(0,F.jsx)(P,{className:`max-lg:hidden`,children:`Agent`}),(0,F.jsx)(P,{className:`max-lg:hidden`,children:`Worker`}),(0,F.jsx)(P,{className:`max-sm:hidden`,children:`Started`}),(0,F.jsx)(P,{className:`text-right`,children:`Last activity`})]})}),(0,F.jsx)(nt,{children:e.map(e=>(0,F.jsx)(nn,{running:e,overview:r,now:n},e.attempt.id))})]})})},I=i(t(),1),an=I.createContext(void 0);function on(){return I.useContext(an)}var sn=I.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:m=!0,style:h,...g}=e,_=f(u||void 0),v=on(),y=v?.value??[],b=(i||v?.disabled)??!1,[x,S]=Qe({controlled:v?_!==void 0&&y.indexOf(_)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:C,buttonRef:w}=te({disabled:b,native:m}),T={disabled:b,pressed:x},E=[w,t],D=[{"aria-pressed":x,onClick(e){let t=!x,n=p(d,e.nativeEvent);o?.(t,n),!n.isCanceled&&(_&&v?.setGroupValue?.(_,t,n),!n.isCanceled&&S(t))}},g,C],O=A(`button`,e,{enabled:!v,state:T,ref:E,props:D}),k=I.useMemo(()=>({disabled:b,focusableWhenDisabled:!1}),[b]);return v?(0,F.jsx)(et,{tag:`button`,render:c,className:n,style:h,metadata:k,state:T,refs:E,props:D}):O});function cn(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=O}=e,[p,m]=I.useState(0),h=r!=null,g=I.useRef(null),_=M(g,c),v=I.useRef([]),y=I.useRef(!1),b=I.useRef(null),x=o??p,S=T((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];ve(g.current,t,a,n)}}),C=T(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||be(e,x,d)?S(ln(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(be(t,x,d)){let e=Ce(t,{disabledIndices:d});Ee(t,e)||S(e)}ve(g.current,r,a,n)});ee(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(be(e,x,d)){let t=Ce(e,{disabledIndices:d});Ee(e,t)||S(t)}},[d,o,x,v,S]);let w=T((e,t,n)=>i?i(e,t,n,v):n),E=T(e=>{let o=e.key===`Home`||e.key===`End`;if(!Ie.has(e.key)||!l&&o||un(e,f)||!g.current)return;let s=a===`rtl`,c=s?De:Te,p=s?Te:De,m=n===`vertical`?Ae:c,_=n===`vertical`?ye:p,y=_e(e.nativeEvent);if(y!=null&&Le(y)&&!_t(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=Me(v,d),T=we(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=Ce(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!Ee(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=_e(e.nativeEvent);t&&n!=null&&Le(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:E}}function ln(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!be(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function un(e,t){for(let n of Se)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function dn(e){let{render:t,className:n,style:r,refs:i=O,props:a=O,state:o=j,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:k}=cn({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Fe(),disabledIndices:v,modifierKeys:y}),M=A(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),ee=I.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:k}),[w,T,b,k]);return(0,F.jsx)(N.Provider,{value:ee,children:(0,F.jsx)($e,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:M})})}var fn=I.createContext(void 0);function pn(){return I.useContext(fn)}var mn=I.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=Ze(!0),m=pn(),h=n??O,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=Qe({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),b=T((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:s,orientation:o},S=I.useMemo(()=>({disabled:_,setGroupValue:b,value:v,isValueInitialized:g}),[_,b,v,g]),C={role:`group`},w=A(`div`,e,{enabled:!!p,state:x,ref:t,props:[C,f]});return(0,F.jsx)(an.Provider,{value:S,children:p?w:(0,F.jsx)(dn,{render:u,className:l,style:d,state:x,refs:[t],props:[C,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),hn=D(`group/toggle inline-flex items-center justify-center gap-1.5 rounded-md text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow] duration-100 outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent text-muted-foreground hover:bg-muted/50 aria-pressed:text-foreground`},size:{default:`h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,sm:`h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),gn=I.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function _n({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,F.jsx)(mn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:E(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,F.jsx)(gn.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function vn({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=I.useContext(gn);return(0,F.jsx)(sn,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:E(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,hn({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var yn=`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`.split(`.`);function bn(e){return typeof e==`string`&&yn.includes(e)}var xn=new Set(`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`.split(`.`));function Sn(e){return typeof e==`string`&&xn.has(e)}function Cn(e){return typeof e==`string`&&e.startsWith(`data-`)}function wn(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Sn(n)||Cn(n))&&(t[n]=e[n]);return t}function Tn(e){if(e==null)return null;if((0,I.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return wn(t)}return typeof e==`object`&&!Array.isArray(e)?wn(e):null}function En(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Sn(n)||Cn(n)||bn(n))&&(t[n]=e[n]);return t}function Dn(e){return e==null?null:(0,I.isValidElement)(e)?En(e.props):typeof e==`object`&&!Array.isArray(e)?En(e):null}var On=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function kn(){return kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(null,arguments)}function An(e,t){if(e==null)return{};var n,r,i=jn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Mn=(0,I.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=An(e,On),d=a||{width:r,height:i,x:0,y:0},f=k(`recharts-surface`,o);return I.createElement(`svg`,kn({},En(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),I.createElement(`title`,null,c),I.createElement(`desc`,null,l),n)}),Nn=[`children`,`className`];function Pn(){return Pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(null,arguments)}function Fn(e,t){if(e==null)return{};var n,r,i=In(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function In(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ln=I.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Fn(e,Nn),a=k(`recharts-layer`,r);return I.createElement(`g`,Pn({className:a},En(i),{ref:t}),n)});function Rn(e){return e===`__proto__`}var zn=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function Bn(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:zn.test(e);default:return!1}}function Vn(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function Hn(e){return typeof e==`symbol`||e instanceof Symbol}function Un(e){return e==null?``:Wn(e)}function Wn(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Wn).join(`,`);if(Hn(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Gn(e){if(Array.isArray(e))return e.map(Vn);if(typeof e==`symbol`)return[e];e=Un(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o){if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l}else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function Kn(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Rn(t))return n;let r=e[t];return r===void 0?Bn(t)&&!Object.hasOwn(e,t)?Kn(e,Gn(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Vn(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return qn(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Rn(t))return n;let r=e[t];return r===void 0?n:r}}}function qn(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Rn(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var Jn=4;function Yn(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jn),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function Xn(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Yn(i)+n},``)}var Zn=e=>e===0?0:e>0?1:-1,Qn=e=>typeof e==`number`&&e!=+e,$n=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,L=e=>(typeof e==`number`||e instanceof Number)&&!Qn(e),er=e=>L(e)||typeof e==`string`,tr=0,nr=e=>{var t=++tr;return`${e||``}${t}`},rr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!L(e)&&typeof e!=`string`)return n;var i;if($n(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Qn(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},ir=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function R(e,t,n){return L(e)&&L(t)?Yn(e+n*(t-e)):t}function ar(e,t,n){if(e&&e.length)return e.find(e=>e&&(typeof t==`function`?t(e):Kn(e,t))===n)}var or=e=>{for(var t=e.length,n=0,r=0,i=0,a=0,o=1/0,s=-1/0,c=0,l=0,u=0;u<t;u++)c=e[u]?.cx||0,l=e[u]?.cy||0,n+=c,r+=l,i+=c*l,a+=c*c,o=Math.min(o,c),s=Math.max(s,c);var d=t*a===n*n?0:(t*i-n*r)/(t*a-n*n);return{xmin:o,xmax:s,a:d,b:(r-d*n)/t}},z=e=>e==null,sr=e=>z(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function cr(e){return e!=null}function lr(){}function ur(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}}function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dr(Object(n),!0).forEach(function(t){pr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pr(e,t,n){return(t=mr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(e){var t=hr(e,`string`);return typeof t==`symbol`?t:t+``}function hr(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var gr=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=ur(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?fr({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?fr({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?fr({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?fr({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?fr({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?fr({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?fr({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?fr({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(L(n.x)||$n(n.x))&&(L(n.y)||$n(n.y))?fr({x:c+rr(n.x,g),y:l+rr(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):fr({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},_r=[`top`,`left`,`right`,`bottom`];function vr(e){return e==null?!1:typeof e==`object`||_r.includes(e)}var yr=(0,I.createContext)(null),br=()=>(0,I.useContext)(yr);function B(e){return function(){return e}}var xr=Math.cos,Sr=Math.sin,Cr=Math.sqrt,wr=Math.PI;wr/2;var Tr=2*wr,Er=Math.PI,Dr=2*Er,Or=1e-6,kr=Dr-Or;function Ar(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jr(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ar;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Mr=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Ar:jr(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Or){if(!(Math.abs(u*s-c*l)>Or)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Er-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Or&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Or||Math.abs(this._y1-l)>Or)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Dr+Dr),d>kr?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Or&&this._append`A${n},${n},0,${+(d>=Er)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Mr.prototype;function Nr(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Mr(t)}Array.prototype.slice;function Pr(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Fr(e){this._context=e}Fr.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,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Ir(e){return new Fr(e)}function Lr(e){return e[0]}function Rr(e){return e[1]}function zr(e,t){var n=B(!0),r=null,i=Ir,a=null,o=Nr(s);e=typeof e==`function`?e:e===void 0?Lr:B(e),t=typeof t==`function`?t:t===void 0?Rr:B(t);function s(s){var c,l=(s=Pr(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:B(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:B(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Br(e,t,n){var r=null,i=B(!0),a=null,o=Ir,s=null,c=Nr(l);e=typeof e==`function`?e:e===void 0?Lr:B(+e),t=typeof t==`function`?t:B(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Rr:B(+n);function l(l){var u,d,f,p=(l=Pr(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return zr().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:B(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:B(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:B(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:B(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:B(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Vr=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function Hr(e){return new Vr(e,!0)}function Ur(e){return new Vr(e,!1)}var Wr={draw(e,t){let n=Cr(t/wr);e.moveTo(n,0),e.arc(0,0,n,0,Tr)}},Gr={draw(e,t){let n=Cr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Kr=Cr(1/3),qr=Kr*2,Jr={draw(e,t){let n=Cr(t/qr),r=n*Kr;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Yr={draw(e,t){let n=Cr(t),r=-n/2;e.rect(r,r,n,n)}},Xr=.8908130915292852,Zr=Sr(wr/10)/Sr(7*wr/10),Qr=Sr(Tr/10)*Zr,$r=-xr(Tr/10)*Zr,ei={draw(e,t){let n=Cr(t*Xr),r=Qr*n,i=$r*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Tr*t/5,o=xr(a),s=Sr(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},ti=Cr(3),ni={draw(e,t){let n=-Cr(t/(ti*3));e.moveTo(0,n*2),e.lineTo(-ti*n,-n),e.lineTo(ti*n,-n),e.closePath()}},ri=-.5,ii=Cr(3)/2,ai=1/Cr(12),oi=(ai/2+1)*3,si={draw(e,t){let n=Cr(t/oi),r=n/2,i=n*ai,a=r,o=n*ai+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(ri*r-ii*i,ii*r+ri*i),e.lineTo(ri*a-ii*o,ii*a+ri*o),e.lineTo(ri*s-ii*c,ii*s+ri*c),e.lineTo(ri*r+ii*i,ri*i-ii*r),e.lineTo(ri*a+ii*o,ri*o-ii*a),e.lineTo(ri*s+ii*c,ri*c-ii*s),e.closePath()}};function ci(e,t){let n=null,r=Nr(i);e=typeof e==`function`?e:B(e||Wr),t=typeof t==`function`?t:B(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:B(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:B(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function li(){}function ui(e,t,n){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+t)/6,(e._y0+4*e._y1+n)/6)}function di(e){this._context=e}di.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:ui(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:ui(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fi(e){return new di(e)}function pi(e){this._context=e}pi.prototype={areaStart:li,areaEnd:li,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)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ui(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mi(e){return new pi(e)}function hi(e){this._context=e}hi.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,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ui(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gi(e){return new hi(e)}function _i(e){this._context=e}_i.prototype={areaStart:li,areaEnd:li,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function vi(e){return new _i(e)}function yi(e){return e<0?-1:1}function bi(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(yi(a)+yi(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function xi(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Si(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Ci(e){this._context=e}Ci.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:Si(this,this._t0,xi(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Si(this,xi(this,n=bi(this,e,t)),n);break;default:Si(this,this._t0,n=bi(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wi(e){this._context=new Ti(e)}(wi.prototype=Object.create(Ci.prototype)).point=function(e,t){Ci.prototype.point.call(this,t,e)};function Ti(e){this._context=e}Ti.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Ei(e){return new Ci(e)}function Di(e){return new wi(e)}function Oi(e){this._context=e}Oi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ki(e),i=ki(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function ki(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Ai(e){return new Oi(e)}function ji(e,t){this._context=e,this._t=t}ji.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,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function Mi(e){return new ji(e,.5)}function Ni(e){return new ji(e,0)}function Pi(e){return new ji(e,1)}function Fi(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Ii(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Li(e,t){return e[t]}function Ri(e){let t=[];return t.key=e,t}function zi(){var e=B([]),t=Ii,n=Fi,r=Li;function i(i){var a=Array.from(e.apply(this,arguments),Ri),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=Pr(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:B(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:B(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?Ii:typeof e==`function`?e:B(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??Fi,i):n},i}function Bi(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Fi(e,t)}}function Vi(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}Fi(e,t)}}function Hi(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,Fi(e,t)}}var Ui=[`type`,`size`,`sizeType`];function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wi.apply(null,arguments)}function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gi(Object(n),!0).forEach(function(t){qi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qi(e,t,n){return(t=Ji(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ji(e){var t=Yi(e,`string`);return typeof t==`symbol`?t:t+``}function Yi(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Xi(e,t){if(e==null)return{};var n,r,i=Zi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Qi={symbolCircle:Wr,symbolCross:Gr,symbolDiamond:Jr,symbolSquare:Yr,symbolStar:ei,symbolTriangle:ni,symbolWye:si},$i=Math.PI/180,ea=e=>Qi[`symbol${sr(e)}`]||Wr,ta=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*$i;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**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}},na=(e,t)=>{Qi[`symbol${sr(e)}`]=t},ra=e=>{var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=Ki(Ki({},Xi(e,Ui)),{},{type:n,size:i,sizeType:o}),c=`circle`;typeof n==`string`&&(c=n);var l=()=>{var e=ea(c),t=ci().type(e).size(ta(i,o,c))();if(t!==null)return t},u=s.className,d=s.cx,f=s.cy,p=En(s);return L(d)&&L(f)&&L(i)?I.createElement(`path`,Wi({},p,{className:k(`recharts-symbols`,u),transform:`translate(${d}, ${f})`,d:l()})):null};ra.registerSymbol=na;var ia=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,aa=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,I.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{bn(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},oa=(e,t,n)=>r=>(e(t,n,r),null),sa=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];bn(i)&&typeof a==`function`&&(r||={},r[i]=oa(a,t,n))}),r},ca=e=>Array.isArray(e)&&e.length>0;function la(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?la(Object(n),!0).forEach(function(t){da(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function da(e,t,n){return(t=fa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e){var t=pa(e,`string`);return typeof t==`symbol`?t:t+``}function pa(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function V(e,t){var n=ua({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function ma(){return ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ma.apply(null,arguments)}function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ga(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ha(Object(n),!0).forEach(function(t){_a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _a(e,t,n){return(t=va(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function va(e){var t=ya(e,`string`);return typeof t==`symbol`?t:t+``}function ya(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ba=32,xa={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Sa(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Ca(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=ba/2,a=ba/6,o=ba/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return I.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Sa(t.payload),x1:0,y1:i,x2:ba,y2:i,className:`recharts-legend-icon`});if(c===`line`)return I.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
2
2
  A${a},${a},0,1,1,${2*o},${i}
3
3
  H${ba}M${2*o},${i}
4
- A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return I.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${ba/8}h${ba}v${ba*3/4}h${-ba}z`,className:`recharts-legend-icon`});if(I.isValidElement(t.legendIcon)){var l=ga({},t);return delete l.legendIcon,I.cloneElement(t.legendIcon,l)}return I.createElement(ra,{fill:s,cx:i,cy:i,size:ba,sizeType:`diameter`,type:c})}function wa(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,o=e.iconType,s=e.labelStyle,c={x:0,y:0,width:ba,height:ba},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10,whiteSpace:`nowrap`},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=k({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?ga({},s):{};p.color=t.inactive?a:p.color||t.color,p.whiteSpace??=`normal`,p.overflowWrap??=`break-word`;var m=d?d(t.value,t,r):t.value;return I.createElement(`li`,ma({className:f,style:l,key:`legend-item-${r}`},sa(e,t,r)),I.createElement(Mn,{width:n,height:n,viewBox:c,style:u,"aria-label":t.value==null?`legend icon`:`${t.value} legend icon`},I.createElement(Ca,{data:t,iconType:o,inactiveColor:a})),I.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var Ta=e=>{var t=V(e,xa),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return I.createElement(`ul`,{className:`recharts-default-legend`,style:a},I.createElement(wa,ma({},t,{payload:n})))};function Ea(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Da(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Oa(e){return e}function ka(e){return Number.isSafeInteger(e)&&e>=0}function Aa(e){return e!=null&&typeof e!=`function`&&ka(e.length)}function ja(e){return function(t){return Kn(t,e)}}function Ma(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Na(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pa(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Fa(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ia=`[object RegExp]`,La=`[object String]`,Ra=`[object Number]`,za=`[object Boolean]`,Ba=`[object Arguments]`,Va=`[object Symbol]`,Ha=`[object Date]`,Ua=`[object Map]`,Wa=`[object Set]`,Ga=`[object Array]`,Ka=`[object Function]`,qa=`[object ArrayBuffer]`,Ja=`[object Object]`,Ya=`[object Error]`,Xa=`[object DataView]`,Za=`[object Uint8Array]`,Qa=`[object Uint8ClampedArray]`,$a=`[object Uint16Array]`,eo=`[object Uint32Array]`,to=`[object BigUint64Array]`,no=`[object Int8Array]`,ro=`[object Int16Array]`,io=`[object Int32Array]`,ao=`[object BigInt64Array]`,oo=`[object Float32Array]`,so=`[object Float64Array]`,co=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function lo(e){return co.Buffer!==void 0&&co.Buffer.isBuffer(e)}function uo(e,t){return fo(e,void 0,e,new Map,t)}function fo(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Ma(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=fo(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,fo(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(fo(a,void 0,n,r,i));return t}if(lo(e))return e.subarray();if(Na(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=fo(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),po(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),po(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),po(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,po(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),po(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),po(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),po(t,e,n,r,i),t}if(typeof e==`object`&&mo(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),po(t,e,n,r,i),t}return e}function po(e,t,n=e,r,i){let a=[...Object.keys(t),...Pa(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=fo(t[s],s,n,r,i))}}function mo(e){switch(Fa(e)){case Ba:case Ga:case qa:case Xa:case za:case Ha:case oo:case so:case no:case ro:case io:case Ua:case Ra:case Ja:case Ia:case Wa:case La:case Va:case Za:case Qa:case $a:case eo:return!0;default:return!1}}function ho(e){return fo(e,void 0,e,new Map,void 0)}function go(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function _o(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function vo(e,t,n){return typeof n==`function`?yo(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?yo(t,r,e,s,!1):!!c},new Map,!0):vo(e,t,()=>void 0)}function yo(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return bo(e,t,n,r,i);case`function`:return Object.keys(t).length>0?yo(e,{...t},n,r,i):go(e,t);default:return _o(e)&&i?typeof t!=`string`||t===``:go(e,t)}}function bo(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return So(e,t,n,r);if(t instanceof Map)return xo(e,t,n,r);if(t instanceof Set)return Co(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Ma(e)&&(e=Object(e));else{let t=Fa(e);if(t!==`[object Object]`&&t!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;i<a.length;i++){let o=a[i];if(!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function xo(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function So(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function Co(e,t,n,r){return t.size===0||e instanceof Set&&So([...e],[...t],n,r)}function wo(e,t){return vo(e,t,()=>void 0)}function To(e){return e=ho(e),t=>wo(t,e)}function Eo(e,t){return uo(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Fa(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),po(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Ra:case La:case za:{let t=new e.constructor(e?.valueOf());return po(t,e),t}case Ba:{let t={};return po(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Do(e){return Eo(e)}var Oo=/^(?:0|[1-9]\d*)$/;function ko(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Oo.test(e)}}function Ao(e){return typeof e==`object`&&!!e&&Fa(e)===`[object Arguments]`}function jo(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Bn(t)&&!(t in Object(e))?Gn(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=Vn(n[e]);if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||Ao(r))&&ko(t)&&Number(t)<r.length))return!1;r=r[t]}return!0}function Mo(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=Vn(e)}return t=Do(t),function(n){let r=Kn(n,e);return r===void 0?jo(n,e):t===void 0?r===void 0:wo(r,t)}}function No(e){if(e==null)return Oa;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?Mo(e[0],e[1]):To(e);default:return ja(e)}}function Po(e){return e===0?0:e}function Fo(e,t=Oa){return Aa(e)?Ea(Array.from(e),Da(No(t),1)).map(Po):[]}function Io(e,t,n){return t===!0?Fo(e,n):typeof t==`function`?Fo(e,t):e}var Lo=(0,I.createContext)(null),Ro=C(),zo=e=>e,H=()=>{var e=(0,I.useContext)(Lo);return e?e.store.dispatch:zo},Bo=()=>{},Vo=()=>Bo,Ho=(e,t)=>e===t;function U(e){var t=(0,I.useContext)(Lo),n=(0,I.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Bo,[t,e]);return(0,Ro.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Vo,t?t.store.getState:Bo,t?t.store.getState:Bo,n,Ho)}function Uo(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Wo(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Go=e=>Array.isArray(e)?e:[e];function Ko(e){let t=Array.isArray(e[0])?e[0]:e;return Wo(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function qo(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Jo=class{constructor(e){this.value=e}deref(){return this.value}},Yo=typeof WeakRef>`u`?Jo:WeakRef,Xo=0,Zo=1;function Qo(){return{s:Xo,v:void 0,o:null,p:null}}function $o(e){return e instanceof Yo?e.deref():e}function es(e,t={}){let n=Qo(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=Qo(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=Qo(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Zo)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=$o(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Yo(c):c}return s.s=Zo,s.v=c,c}return o.clearCache=()=>{n=Qo(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function ts(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Uo(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=es,argsMemoizeOptions:u=[]}={...n,...a},d=Go(c),f=Go(u),p=Ko(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=qo(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var W=ts(es);function ns(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function rs(e,t,n){return _o(n)&&(typeof t==`number`&&Aa(n)&&ko(t)&&t<n.length||typeof t==`string`&&t in n)?go(n[t],e):!1}function is(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var as=(e,t,n)=>{if(e!==t){let r=is(e),i=is(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},os=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ss=/^\w*$/;function cs(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Hn(e)?!0:typeof e==`string`&&(ss.test(e)||!os.test(e))||t!=null&&Object.hasOwn(t,e)}function ls(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Aa(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r<t.length&&n!=null;++r)n=n[t[r]];return r>0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||cs(e)?e:{key:e,path:Gn(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=as(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function us(e,...t){let n=t.length;return n>1&&rs(e,t[0],t[1])?t=[]:n>2&&rs(t[0],t[1],t[2])&&(t=[t[0]]),ls(e,ns(t),[`asc`])}var ds=e=>e.legend.settings,fs=e=>e.legend.size,ps=W([e=>e.legend.payload,ds],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?us(r,n):r});function ms(){return U(ps)}function hs(e,t){return bs(e)||ys(e,t)||_s(e,t)||gs()}function gs(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return I.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${ba/8}h${ba}v${ba*3/4}h${-ba}z`,className:`recharts-legend-icon`});if(I.isValidElement(t.legendIcon)){var l=ga({},t);return delete l.legendIcon,I.cloneElement(t.legendIcon,l)}return I.createElement(ra,{fill:s,cx:i,cy:i,size:ba,sizeType:`diameter`,type:c})}function wa(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,o=e.iconType,s=e.labelStyle,c={x:0,y:0,width:ba,height:ba},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10,whiteSpace:`nowrap`},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=k({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?ga({},s):{};p.color=t.inactive?a:p.color||t.color,p.whiteSpace??=`normal`,p.overflowWrap??=`break-word`;var m=d?d(t.value,t,r):t.value;return I.createElement(`li`,ma({className:f,style:l,key:`legend-item-${r}`},sa(e,t,r)),I.createElement(Mn,{width:n,height:n,viewBox:c,style:u,"aria-label":t.value==null?`legend icon`:`${t.value} legend icon`},I.createElement(Ca,{data:t,iconType:o,inactiveColor:a})),I.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var Ta=e=>{var t=V(e,xa),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return I.createElement(`ul`,{className:`recharts-default-legend`,style:a},I.createElement(wa,ma({},t,{payload:n})))};function Ea(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Da(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Oa(e){return e}function ka(e){return Number.isSafeInteger(e)&&e>=0}function Aa(e){return e!=null&&typeof e!=`function`&&ka(e.length)}function ja(e){return function(t){return Kn(t,e)}}function Ma(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Na(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pa(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Fa(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ia=`[object RegExp]`,La=`[object String]`,Ra=`[object Number]`,za=`[object Boolean]`,Ba=`[object Arguments]`,Va=`[object Symbol]`,Ha=`[object Date]`,Ua=`[object Map]`,Wa=`[object Set]`,Ga=`[object Array]`,Ka=`[object Function]`,qa=`[object ArrayBuffer]`,Ja=`[object Object]`,Ya=`[object Error]`,Xa=`[object DataView]`,Za=`[object Uint8Array]`,Qa=`[object Uint8ClampedArray]`,$a=`[object Uint16Array]`,eo=`[object Uint32Array]`,to=`[object BigUint64Array]`,no=`[object Int8Array]`,ro=`[object Int16Array]`,io=`[object Int32Array]`,ao=`[object BigInt64Array]`,oo=`[object Float32Array]`,so=`[object Float64Array]`,co=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function lo(e){return co.Buffer!==void 0&&co.Buffer.isBuffer(e)}function uo(e,t){return fo(e,void 0,e,new Map,t)}function fo(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Ma(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=fo(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,fo(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(fo(a,void 0,n,r,i));return t}if(lo(e))return e.subarray();if(Na(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=fo(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),po(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),po(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),po(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,po(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),po(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),po(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),po(t,e,n,r,i),t}if(typeof e==`object`&&mo(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),po(t,e,n,r,i),t}return e}function po(e,t,n=e,r,i){let a=[...Object.keys(t),...Pa(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=fo(t[s],s,n,r,i))}}function mo(e){switch(Fa(e)){case Ba:case Ga:case qa:case Xa:case za:case Ha:case oo:case so:case no:case ro:case io:case Ua:case Ra:case Ja:case Ia:case Wa:case La:case Va:case Za:case Qa:case $a:case eo:return!0;default:return!1}}function ho(e){return fo(e,void 0,e,new Map,void 0)}function go(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function _o(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function vo(e,t,n){return typeof n==`function`?yo(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?yo(t,r,e,s,!1):!!c},new Map,!0):vo(e,t,()=>void 0)}function yo(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return bo(e,t,n,r,i);case`function`:return Object.keys(t).length>0?yo(e,{...t},n,r,i):go(e,t);default:return _o(e)&&i?typeof t!=`string`||t===``:go(e,t)}}function bo(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return So(e,t,n,r);if(t instanceof Map)return xo(e,t,n,r);if(t instanceof Set)return Co(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Ma(e)&&(e=Object(e));else{let t=Fa(e);if(t!==`[object Object]`&&t!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;i<a.length;i++){let o=a[i];if(!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function xo(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function So(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function Co(e,t,n,r){return t.size===0||e instanceof Set&&So([...e],[...t],n,r)}function wo(e,t){return vo(e,t,()=>void 0)}function To(e){return e=ho(e),t=>wo(t,e)}function Eo(e,t){return uo(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Fa(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),po(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Ra:case La:case za:{let t=new e.constructor(e?.valueOf());return po(t,e),t}case Ba:{let t={};return po(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Do(e){return Eo(e)}var Oo=/^(?:0|[1-9]\d*)$/;function ko(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Oo.test(e)}}function Ao(e){return typeof e==`object`&&!!e&&Fa(e)===`[object Arguments]`}function jo(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Bn(t)&&!(t in Object(e))?Gn(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=Vn(n[e]);if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||Ao(r))&&ko(t)&&Number(t)<r.length))return!1;r=r[t]}return!0}function Mo(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=Vn(e)}return t=Do(t),function(n){let r=Kn(n,e);return r===void 0?jo(n,e):t===void 0?r===void 0:wo(r,t)}}function No(e){if(e==null)return Oa;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?Mo(e[0],e[1]):To(e);default:return ja(e)}}function Po(e){return e===0?0:e}function Fo(e,t=Oa){return Aa(e)?Ea(Array.from(e),Da(No(t),1)).map(Po):[]}function Io(e,t,n){return t===!0?Fo(e,n):typeof t==`function`?Fo(e,t):e}var Lo=(0,I.createContext)(null),Ro=w(),zo=e=>e,H=()=>{var e=(0,I.useContext)(Lo);return e?e.store.dispatch:zo},Bo=()=>{},Vo=()=>Bo,Ho=(e,t)=>e===t;function U(e){var t=(0,I.useContext)(Lo),n=(0,I.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Bo,[t,e]);return(0,Ro.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Vo,t?t.store.getState:Bo,t?t.store.getState:Bo,n,Ho)}function Uo(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Wo(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Go=e=>Array.isArray(e)?e:[e];function Ko(e){let t=Array.isArray(e[0])?e[0]:e;return Wo(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function qo(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Jo=class{constructor(e){this.value=e}deref(){return this.value}},Yo=typeof WeakRef>`u`?Jo:WeakRef,Xo=0,Zo=1;function Qo(){return{s:Xo,v:void 0,o:null,p:null}}function $o(e){return e instanceof Yo?e.deref():e}function es(e,t={}){let n=Qo(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=Qo(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=Qo(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Zo)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=$o(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Yo(c):c}return s.s=Zo,s.v=c,c}return o.clearCache=()=>{n=Qo(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function ts(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Uo(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=es,argsMemoizeOptions:u=[]}={...n,...a},d=Go(c),f=Go(u),p=Ko(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=qo(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var W=ts(es);function ns(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function rs(e,t,n){return _o(n)&&(typeof t==`number`&&Aa(n)&&ko(t)&&t<n.length||typeof t==`string`&&t in n)?go(n[t],e):!1}function is(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var as=(e,t,n)=>{if(e!==t){let r=is(e),i=is(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},os=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ss=/^\w*$/;function cs(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Hn(e)?!0:typeof e==`string`&&(ss.test(e)||!os.test(e))||t!=null&&Object.hasOwn(t,e)}function ls(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Aa(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r<t.length&&n!=null;++r)n=n[t[r]];return r>0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||cs(e)?e:{key:e,path:Gn(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=as(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function us(e,...t){let n=t.length;return n>1&&rs(e,t[0],t[1])?t=[]:n>2&&rs(t[0],t[1],t[2])&&(t=[t[0]]),ls(e,ns(t),[`asc`])}var ds=e=>e.legend.settings,fs=e=>e.legend.size,ps=W([e=>e.legend.payload,ds],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?us(r,n):r});function ms(){return U(ps)}function hs(e,t){return bs(e)||ys(e,t)||_s(e,t)||gs()}function gs(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
5
5
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _s(e,t){if(e){if(typeof e==`string`)return vs(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vs(e,t):void 0}}function vs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ys(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bs(e){if(Array.isArray(e))return e}var xs=1;function Ss(e,t){return Math.abs(e.height-t.height)>xs||Math.abs(e.left-t.left)>xs||Math.abs(e.top-t.top)>xs||Math.abs(e.width-t.width)>xs}function Cs(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function ws(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=hs((0,I.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,I.useRef)(null),a=(0,I.useRef)(n);a.current=n;var o=(0,I.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=Cs(e);if(Ss(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=Cs(e);Ss(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,I.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function Ts(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 Es=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Ds=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Os={INIT:`@@redux/INIT${Ds()}`,REPLACE:`@@redux/REPLACE${Ds()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ds()}`};function ks(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function As(e,t,n){if(typeof e!=`function`)throw Error(Ts(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Ts(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Ts(1));return n(As)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Ts(3));return i}function d(e){if(typeof e!=`function`)throw Error(Ts(4));if(c)throw Error(Ts(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Ts(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!ks(e))throw Error(Ts(7));if(e.type===void 0)throw Error(Ts(8));if(typeof e.type!=`string`)throw Error(Ts(17));if(c)throw Error(Ts(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Ts(10));r=e,f({type:Os.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Ts(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Es](){return this}}}return f({type:Os.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[Es]:m}}function js(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Os.INIT})===void 0)throw Error(Ts(12));if(n(void 0,{type:Os.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Ts(13))})}function Ms(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{js(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(Ts(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function Ns(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Ps(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Ts(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=Ns(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function Fs(e){return ks(e)&&`type`in e&&typeof e.type==`string`}var Is=Symbol.for(`immer-nothing`),Ls=Symbol.for(`immer-draftable`),Rs=Symbol.for(`immer-state`);function zs(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Bs=Object,Vs=Bs.getPrototypeOf,Hs=`constructor`,Us=`prototype`,Ws=`configurable`,Gs=`enumerable`,Ks=`writable`,qs=`value`,Js=e=>!!e&&!!e[Rs];function Ys(e){return e?Qs(e)||ac(e)||!!e[Ls]||!!e[Hs]?.[Ls]||oc(e)||sc(e):!1}var Xs=Bs[Us][Hs].toString(),Zs=new WeakMap;function Qs(e){if(!e||!cc(e))return!1;let t=Vs(e);if(t===null||t===Bs[Us])return!0;let n=Bs.hasOwnProperty.call(t,Hs)&&t[Hs];if(n===Object)return!0;if(!lc(n))return!1;let r=Zs.get(n);return r===void 0&&(r=Function.toString.call(n),Zs.set(n,r)),r===Xs}function $s(e,t,n=!0){ec(e)===0?(n?Reflect.ownKeys(e):Bs.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ec(e){let t=e[Rs];return t?t.type_:ac(e)?1:oc(e)?2:sc(e)?3:0}var tc=(e,t,n=ec(e))=>n===2?e.has(t):Bs[Us].hasOwnProperty.call(e,t),nc=(e,t,n=ec(e))=>n===2?e.get(t):e[t],rc=(e,t,n,r=ec(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ic(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var ac=Array.isArray,oc=e=>e instanceof Map,sc=e=>e instanceof Set,cc=e=>typeof e==`object`,lc=e=>typeof e==`function`,uc=e=>typeof e==`boolean`;function dc(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var fc=e=>e.copy_||e.base_,pc=e=>e.modified_?e.copy_:e.base_;function mc(e,t){if(oc(e))return new Map(e);if(sc(e))return new Set(e);if(ac(e))return Array[Us].slice.call(e);let n=Qs(e);if(t===!0||t===`class_only`&&!n){let t=Bs.getOwnPropertyDescriptors(e);delete t[Rs];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Ks]===!1&&(a[Ks]=!0,a[Ws]=!0),(a.get||a.set)&&(t[i]={[Ws]:!0,[Ks]:!0,[Gs]:a[Gs],[qs]:e[i]})}return Bs.create(Vs(e),t)}{let t=Vs(e);if(t!==null&&n)return{...e};let r=Bs.create(t);return Bs.assign(r,e)}}function hc(e,t=!1){return vc(e)||Js(e)||!Ys(e)||(ec(e)>1&&Bs.defineProperties(e,{set:_c,add:_c,clear:_c,delete:_c}),Bs.freeze(e),t&&$s(e,(e,t)=>{hc(t,!0)},!1)),e}function gc(){zs(2)}var _c={[qs]:gc};function vc(e){return e===null||!cc(e)||Bs.isFrozen(e)}var yc=`MapSet`,bc=`Patches`,xc=`ArrayMethods`,Sc={};function Cc(e){let t=Sc[e];return t||zs(0,e),t}var wc=e=>!!Sc[e],Tc,Ec=()=>Tc,Dc=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:wc(yc)?Cc(yc):void 0,arrayMethodsPlugin_:wc(xc)?Cc(xc):void 0});function Oc(e,t){t&&(e.patchPlugin_=Cc(bc),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function kc(e){Ac(e),e.drafts_.forEach(Mc),e.drafts_=null}function Ac(e){e===Tc&&(Tc=e.parent_)}var jc=e=>Tc=Dc(Tc,e);function Mc(e){let t=e[Rs];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Nc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Rs].modified_&&(kc(t),zs(4)),Ys(e)&&(e=Pc(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Rs].base_,e,t)}else e=Pc(t,n);return Fc(t,e,!0),kc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Is?void 0:e}function Pc(e,t){if(vc(t))return t;let n=t[Rs];if(!n)return Uc(t,e.handledSet_,e);if(!Lc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Vc(n,e)}return n.copy_}function Fc(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hc(t,n)}function Ic(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Lc=(e,t)=>e.scope_===t,Rc=[];function zc(e,t,n,r){let i=fc(e),a=e.type_;if(r!==void 0&&nc(i,r,a)===t){rc(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;$s(i,(e,n)=>{if(Js(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Rc;for(let e of o)rc(i,e,n,a)}function Bc(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Lc(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=pc(i);zc(e,i.draft_??i,a,n),Vc(i,r)})}function Vc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Ic(e)}}function Hc(e,t,n){let{scope_:r}=e;if(Js(n)){let i=n[Rs];Lc(i,r)&&i.callbacks_.push(function(){Qc(e),zc(e,n,pc(i),t)})}else Ys(n)&&e.callbacks_.push(function(){let i=fc(e);e.type_===3?i.has(n)&&Uc(n,r.handledSet_,r):nc(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Uc(nc(e.copy_,t,e.type_),r.handledSet_,r)})}function Uc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Js(e)||t.has(e)||!Ys(e)||vc(e)||(t.add(e),$s(e,(r,i)=>{if(Js(i)){let t=i[Rs];Lc(t,n)&&(rc(e,r,pc(t),e.type_),Ic(t))}else Ys(i)&&Uc(i,t,n)})),e}function Wc(e,t){let n=ac(e),r={type_:+!!n,scope_:t?t.scope_:Ec(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Gc;n&&(i=[r],a=Kc);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Gc={get(e,t){if(t===Rs)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=fc(e);if(!tc(i,t,e.type_))return Yc(e,i,t);let a=i[t];if(e.finalized_||!Ys(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&dc(t))return a;if(a===qc(e.base_,t)||Jc(e,t,a)){Qc(e);let n=e.type_===1?+t:t,r=el(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in fc(e)},ownKeys(e){return Reflect.ownKeys(fc(e))},set(e,t,n){let r=Xc(fc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=qc(fc(e),t),i=r?.[Rs];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(ic(n,r)&&(n!==void 0||tc(e.base_,t,e.type_)))return!0;Qc(e),Zc(e)}return e.copy_[t]===n&&(n!==void 0||tc(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Hc(e,t,n)),!0},deleteProperty(e,t){return Qc(e),qc(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Zc(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=fc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ks]:!0,[Ws]:e.type_!==1||t!==`length`,[Gs]:r[Gs],[qs]:n[t]}},defineProperty(){zs(11)},getPrototypeOf(e){return Vs(e.base_)},setPrototypeOf(){zs(12)}},Kc={};for(let e in Gc){let t=Gc[e];Kc[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}Kc.deleteProperty=function(e,t){return Kc.set.call(this,e,t,void 0)},Kc.set=function(e,t,n){return Gc.set.call(this,e[0],t,n,e[0])};function qc(e,t){let n=e[Rs];return(n?fc(n):e)[t]}function Jc(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Ys(n)||n[Rs]?!1:e.baseRefs_.has(n)}function Yc(e,t,n){let r=Xc(t,n);return r?qs in r?r[qs]:r.get?.call(e.draft_):void 0}function Xc(e,t){if(!(t in e))return;let n=Vs(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Vs(n)}}function Zc(e){e.modified_||(e.modified_=!0,e.parent_&&Zc(e.parent_))}function Qc(e){e.copy_||=(e.assigned_=new Map,mc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $c=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(lc(e)&&!lc(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}lc(t)||zs(6),n!==void 0&&!lc(n)&&zs(7);let r;if(Ys(e)){let i=jc(this),a=el(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?kc(i):Ac(i)}return Oc(i,n),Nc(r,i)}if(!e||!cc(e)){if(r=t(e),r===void 0&&(r=e),r===Is&&(r=void 0),this.autoFreeze_&&hc(r,!0),n){let t=[],i=[];Cc(bc).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}zs(1,e)},this.produceWithPatches=(e,t)=>{if(lc(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},uc(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),uc(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),uc(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ys(e)||zs(8),Js(e)&&(e=tl(e));let t=jc(this),n=el(t,e,void 0);return n[Rs].isManual_=!0,Ac(t),n}finishDraft(e,t){let n=e&&e[Rs];(!n||!n.isManual_)&&zs(9);let{scope_:r}=n;return Oc(r,t),Nc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Cc(bc).applyPatches_;return Js(e)?r(e,t):this.produce(e,e=>r(e,t))}};function el(e,t,n,r){let[i,a]=oc(t)?Cc(yc).proxyMap_(t,n):sc(t)?Cc(yc).proxySet_(t,n):Wc(t,n);return(n?.scope_??Ec()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Bc(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function tl(e){return Js(e)||zs(10,e),nl(e)}function nl(e){if(!Ys(e)||vc(e))return e;let t=e[Rs],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=mc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=mc(e,!0);return $s(n,(e,t)=>{rc(n,e,nl(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var rl=new $c().produce,G=e=>e;function il(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var al=il(),ol=il,sl=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?Ns:Ns.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function cl(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(gu(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Fs(t)&&t.type===e,n}var ll=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ul(e){return Ys(e)?rl(e,()=>{}):e}function dl(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function fl(e){return typeof e==`boolean`}var pl=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new ll;return t&&(fl(t)?a.push(al):a.push(ol(t.extraArgument))),a},ml=`RTK_autoBatch`,K=()=>e=>({payload:e,meta:{[ml]:!0}}),hl=e=>t=>{setTimeout(t,e)},gl=(e,t)=>n=>{let r=!1,i,a,o=()=>{r||(r=!0,cancelAnimationFrame(i),clearTimeout(a),n())};i=e(o),a=setTimeout(o,t)},_l=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?gl(window.requestAnimationFrame,100):hl(10):e.type===`callback`?e.queueNotification:hl(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[ml],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},vl=e=>function(t){let{autoBatch:n=!0}=t??{},r=new ll(e);return n&&r.push(_l(typeof n==`object`?n:void 0)),r};function yl(e){let t=pl(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(ks(n))c=Ms(n);else throw Error(gu(1));let l;l=typeof r==`function`?r(t):t();let u=Ns;i&&(u=sl({trace:!1,...typeof i==`object`&&i}));let d=vl(Ps(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return As(c,o,p)}function bl(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(gu(28));if(r in t)throw Error(gu(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function xl(e){return typeof e==`function`}function Sl(e,t){let[n,r,i]=bl(t),a;if(xl(e))a=()=>ul(e());else{let t=ul(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(Js(e)){let r=n(e,t);return r===void 0?e:r}if(Ys(e))return rl(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(gu(9))}return r}}return e},e)}return o.getInitialState=a,o}var Cl=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,wl=(e=21)=>{let t=``,n=e;for(;n--;)t+=Cl[Math.random()*64|0];return t},Tl=Symbol.for(`rtk-slice-createasyncthunk`);function El(e,t){return`${e}/${t}`}function Dl({creators:e}={}){let t=e?.asyncThunk?.[Tl];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(gu(11));let i=(typeof e.reducers==`function`?e.reducers(Al()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(gu(12));if(n in o.sliceCaseReducersByType)throw Error(gu(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:El(n,r),createNotation:typeof e.reducers==`function`};Ml(a)?Pl(o,a,s,t):jl(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?bl(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Sl(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=dl(d,r,m)),i}function i(t=l){return dl(dl(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Ol(a,t,()=>dl(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Ol(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var kl=Dl();function Al(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function jl({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Nl(r))throw Error(gu(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?cl(e,o):cl(e))}function Ml(e){return e._reducerDefinitionType===`asyncThunk`}function Nl(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Pl({type:e,reducerName:t},n,r,i){if(!i)throw Error(gu(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Fl,pending:s||Fl,rejected:c||Fl,settled:l||Fl})}function Fl(){}var Il=`task`,Ll=`listener`,Rl=`completed`,zl=`cancelled`,Bl=`task-${zl}`,Vl=`task-${Rl}`,Hl=`${Ll}-${zl}`,Ul=`${Ll}-${Rl}`,Wl=class{code;name=`TaskAbortError`;message;constructor(e){this.code=e,this.message=`${Il} ${zl} (reason: ${e})`}},Gl=(e,t)=>{if(typeof e!=`function`)throw TypeError(gu(32))},Kl=()=>{},ql=(e,t=Kl)=>(e.catch(t),e),Jl=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),Yl=e=>{if(e.aborted)throw new Wl(e.reason)};function Xl(e,t){let n=Kl;return new Promise((r,i)=>{let a=()=>i(new Wl(e.reason));e.aborted?a():(n=Jl(e,a),t.finally(()=>n()).then(r,i))}).finally(()=>{n=Kl})}var Zl=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof Wl?`cancelled`:`rejected`,error:e}}finally{t?.()}},Ql=e=>t=>ql(Xl(e,t).then(t=>(Yl(e),t))),$l=e=>{let t=Ql(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:eu}=Object,tu={},nu=`listenerMiddleware`,ru=(e,t)=>{let n=t=>Jl(e,()=>t.abort(e.reason));return(r,i)=>{Gl(r,`taskExecutor`);let a=new AbortController;n(a);let o=Zl(async()=>{Yl(e),Yl(a.signal);let t=await r({pause:Ql(a.signal),delay:$l(a.signal),signal:a.signal});return Yl(a.signal),t},()=>a.abort(Vl));return i?.autoJoin&&t.push(o.catch(Kl)),{result:Ql(e)(o),cancel(){a.abort(Bl)}}}},iu=(e,t)=>{let n=async(n,r)=>{Yl(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await Xl(t,Promise.race(a));return Yl(t),e}finally{i()}};return((e,t)=>ql(n(e,t)))},au=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=cl(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(gu(21));return Gl(a,`options.listener`),{predicate:i,type:t,effect:a}},ou=eu(e=>{let{type:t,predicate:n,effect:r}=au(e);return{id:wl(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(gu(22))}}},{withTypes:()=>ou}),su=(e,t)=>{let{type:n,effect:r,predicate:i}=au(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},cu=e=>{e.pending.forEach(e=>{e.abort(Hl)})},lu=(e,t)=>()=>{for(let e of t.keys())cu(e);e.clear()},uu=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},du=eu(cl(`${nu}/add`),{withTypes:()=>du}),fu=cl(`${nu}/removeAll`),pu=eu(cl(`${nu}/remove`),{withTypes:()=>pu}),mu=(...e)=>{console.error(`${nu}/error`,...e)},hu=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=mu}=e;Gl(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&cu(e)}),c=(e=>{let n=su(t,e)??ou(e);return s(n)});eu(c,{withTypes:()=>c});let l=e=>{let n=su(t,e);return n&&(n.unsubscribe(),e.cancelActive&&cu(n)),!!n};eu(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=iu(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,eu({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:$l(u.signal),pause:Ql(u.signal),extra:a,signal:u.signal,fork:ru(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(Hl),n.delete(e))})},cancel:()=>{u.abort(Hl),e.pending.delete(u)},throwIfCancelled:()=>{Yl(u.signal)}})))}catch(e){e instanceof Wl||uu(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(Ul),i(e),e.pending.delete(u)}},d=lu(t,n);return{middleware:e=>n=>r=>{if(!Fs(r))return n(r);if(du.match(r))return c(r.payload);if(fu.match(r)){d();return}if(pu.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===tu)throw Error(gu(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,uu(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=tu}return s},startListening:c,stopListening:l,clearListeners:d}};function gu(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 _u=kl({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),vu=_u.actions,yu=vu.setMargin,bu=vu.setLayout,xu=vu.setChartSize,Su=vu.setScale,Cu=_u.reducer;function wu(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function q(e){return Number.isFinite(e)}function Tu(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Eu(Object(n),!0).forEach(function(t){Ou(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ou(e,t,n){return(t=ku(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ku(e){var t=Au(e,`string`);return typeof t==`symbol`?t:t+``}function Au(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function J(e,t,n){return z(e)||z(t)?n:er(t)?Kn(e,t,n):typeof t==`function`?t(e):n}var ju=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(vr(c)){if(c===`top`&&L(e.top))return Du(Du({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&L(e.bottom))return Du(Du({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&L(e.left))return Du(Du({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&L(e.right))return Du(Du({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&L(e[a]))return Du(Du({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&L(e[o]))return Du(Du({},e),{},{[o]:e[o]+(i||0)})}return e},Mu=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Nu=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},Pu=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Zn(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return q(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(cr):c&&l?l.map((e,t)=>{var n=o.map(e);return q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(cr):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(cr):o.domain().map((e,t)=>{var n=o.map(e);return q(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(cr)},Fu=(e,t)=>{if(!t||t.length!==2||!L(t[0])||!L(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!L(e[0])||e[0]<n)&&(i[0]=n),(!L(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Iu={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=Qn(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Bi,none:Fi,silhouette:Vi,wiggle:Hi,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=Qn(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},Lu=(e,t,n)=>{var r=Iu[n]??Fi,i=zi().keys(t).value((e,t)=>Number(J(e,t,0))).order(Ii).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=J(e[i],t[r],0);Array.isArray(a)&&a.length===2&&L(a[0])&&L(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function Ru(e){return e==null?void 0:String(e)}function zu(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!z(i[t.dataKey])){var s=ar(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=J(i,z(o)?t.dataKey:o),l=t.scale.map(c);return L(l)?l:null}var Bu=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=J(a,t.dataKey,t.scale.domain()[o]);if(z(s))return null;var c=t.scale.map(s);return L(c)?c-i/2+r:null},Vu=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Hu=e=>{var t=e.flat(2).filter(L);return[Math.min(...t),Math.max(...t)]},Uu=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Wu=(e,t,n)=>{if(e!=null&&Object.keys(e).length!==0)return Uu(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=Hu(wu(r,t,n));return!q(i[0])||!q(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},Gu=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ku=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qu=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=us(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;s<c;s++){var l=(i[s]?.coordinate||0)-(i[s-1]?.coordinate||0);a.push(l),o=Math.max(l,o)}var u=o*1e-4,d=1/0;for(var f of a)f>u&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function Ju(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Du(Du({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Yu(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var Xu=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},Zu=(e,t)=>t===`centric`?e.angle:e.radius,Qu=e=>e.layout.width,$u=e=>e.layout.height,ed=e=>e.layout.scale,td=e=>e.layout.margin,nd=W(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),rd=W(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),id=`data-recharts-item-index`,ad=`data-recharts-item-id`;function od(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?od(Object(n),!0).forEach(function(t){cd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):od(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cd(e,t,n){return(t=ld(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ld(e){var t=ud(e,`string`);return typeof t==`symbol`?t:t+``}function ud(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dd=e=>e.brush.height;function fd(e){return rd(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function pd(e){return rd(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function md(e){return nd(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function hd(e){return nd(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var gd=W([Qu,$u,td,dd,fd,pd,md,hd,ds,fs],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=sd(sd({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=ju(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return sd(sd({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),_d=W(gd,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),vd=W(Qu,$u,(e,t)=>({x:0,y:0,width:e,height:t})),yd=(0,I.createContext)(null),bd=()=>(0,I.useContext)(yd)!=null,xd=e=>e.brush,Sd=W([xd,gd,td],(e,t,n)=>({height:e.height,x:L(e.x)?e.x:t.left,y:L(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:L(e.width)?e.width:t.width}));function Cd(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function wd(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=Cd(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Td(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return wd(e,t,{leading:r,maxWait:t,trailing:i})}var Ed=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},Dd={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Od=(e,t,n)=>{var r=n.width,i=r===void 0?Dd.width:r,a=n.height,o=a===void 0?Dd.height:a,s=n.aspect,c=n.maxHeight,l=$n(i)?e:Number(i),u=$n(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},kd={width:0,height:0,overflow:`visible`},Ad={width:0,overflowX:`visible`},jd={height:0,overflowY:`visible`},Md={},Nd=e=>{var t=e.width,n=e.height,r=$n(t),i=$n(n);return r&&i?kd:r?Ad:i?jd:Md};function Pd(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Dd.width,a=Dd.height):i===void 0?i=r&&r>0?void 0:Dd.width:a===void 0&&(a=r&&r>0?void 0:Dd.height),{width:i,height:a}}var Fd=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Id.apply(null,arguments)}function Ld(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ld(Object(n),!0).forEach(function(t){zd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ld(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zd(e,t,n){return(t=Bd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bd(e){var t=Vd(e,`string`);return typeof t==`symbol`?t:t+``}function Vd(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Hd(e,t){return qd(e)||Kd(e,t)||Wd(e,t)||Ud()}function Ud(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
6
6
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wd(e,t){if(e){if(typeof e==`string`)return Gd(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gd(e,t):void 0}}function Gd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Kd(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function qd(e){if(Array.isArray(e))return e}function Jd(e,t){if(e==null)return{};var n,r,i=Yd(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yd(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Xd=(0,I.createContext)(Dd.initialDimension);function Zd(e){return Tu(e.width)&&Tu(e.height)}function Qd(e){var t=e.children,n=e.width,r=e.height,i=(0,I.useMemo)(()=>({width:n,height:r}),[n,r]);return Zd(i)?I.createElement(Xd.Provider,{value:i},t):null}var $d=()=>(0,I.useContext)(Xd),ef=(0,I.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Dd.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?Dd.minWidth:s,l=e.minHeight,u=e.maxHeight,d=e.children,f=e.debounce,p=f===void 0?Dd.debounce:f,m=e.id,h=e.className,g=e.onResize,_=e.style,v=_===void 0?{}:_,y=Jd(e,Fd),b=(0,I.useRef)(null),x=(0,I.useRef)();x.current=g,(0,I.useImperativeHandle)(t,()=>b.current);var S=Hd((0,I.useState)({containerWidth:i.width,containerHeight:i.height}),2),C=S[0],w=S[1],T=(0,I.useCallback)((e,t)=>{w(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,I.useEffect)(()=>{if(b.current==null||typeof ResizeObserver>`u`)return lr;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;T(i,a),(t=x.current)==null||t.call(x,i,a)}};p>0&&(e=Td(e,p,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=b.current.getBoundingClientRect(),r=n.width,i=n.height;return T(r,i),t.observe(b.current),()=>{t.disconnect()}},[T,p]);var E=C.containerWidth,D=C.containerHeight;Ed(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var O=Od(E,D,{width:a,height:o,aspect:n,maxHeight:u}),A=O.calculatedWidth,j=O.calculatedHeight;return Ed(E<0||D<0||A!=null&&A>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
7
7
  please check the style of container, or the props width(%s) and height(%s),
8
8
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
9
- height and width.`,A,j,a,o,c,l,n),I.createElement(`div`,Id({id:m?`${m}`:void 0,className:k(`recharts-responsive-container`,h),style:Rd(Rd({},v),{},{width:a,height:o,minWidth:c,minHeight:l,maxHeight:u}),ref:b},y),I.createElement(`div`,{style:Nd({width:a,height:o})},I.createElement(Qd,{width:A,height:j},d)))}),tf=(0,I.forwardRef)((e,t)=>{var n=$d();if(Tu(n.width)&&Tu(n.height))return e.children;var r=Pd({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=Od(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return L(s)&&L(c)?I.createElement(Qd,{width:s,height:c},e.children):I.createElement(ef,Id({},e,{width:i,height:a,ref:t}))}),nf=()=>{var e=bd(),t=U(_d),n=U(Sd),r=U(xd)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},rf={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},af=()=>U(gd)??rf,of=()=>U(Qu),sf=()=>U($u),cf=()=>U(e=>e.layout.margin),Y=e=>e.layout.layoutType,lf=()=>U(Y),uf=()=>{var e=lf();if(e===`horizontal`||e===`vertical`)return e},df=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},ff=()=>lf()!==void 0,pf=e=>{var t=H(),n=bd(),r=e.width,i=e.height,a=$d(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,I.useEffect)(()=>{!n&&Tu(o)&&Tu(s)&&t(xu({width:o,height:s}))},[t,n,o,s]),null},mf=kl({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`,position:void 0,offset:0},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter,e.settings.position=t.payload.position,e.settings.offset=t.payload.offset},addLegendPayload:{reducer(e,t){e.payload.push(G(t.payload))},prepare:K()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=tl(e).payload.indexOf(G(r));a>-1&&(e.payload[a]=G(i))},prepare:K()},removeLegendPayload:{reducer(e,t){var n=tl(e).payload.indexOf(G(t.payload));n>-1&&e.payload.splice(n,1)},prepare:K()}}}),hf=mf.actions,gf=hf.setLegendSize,_f=hf.setLegendSettings,vf=hf.addLegendPayload,yf=hf.replaceLegendPayload,bf=hf.removeLegendPayload,xf=mf.reducer,Sf=e((e=>{var n=t();n.useSyncExternalStore,n.useRef,n.useEffect,n.useMemo,n.useDebugValue}));e(((e,t)=>{t.exports=Sf()}))();function Cf(e){e()}function wf(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Cf(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){r&&e!==null&&(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Tf={notify(){},get:()=>[]};function Ef(e,t){let n,r=Tf,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=wf())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Tf)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var Df=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Of=typeof navigator<`u`&&navigator.product===`ReactNative`,kf=Df||Of?I.useLayoutEffect:I.useEffect;function Af(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function jf(e,t){if(Af(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Af(e[n[r]],t[n[r]]))return!1;return!0}var Mf=Symbol.for(`react-redux-context`),Nf=typeof globalThis<`u`?globalThis:{};function Pf(){if(!I.createContext)return{};let e=Nf[Mf]??=new Map,t=e.get(I.createContext);return t||(t=I.createContext(null),e.set(I.createContext,t)),t}var Ff=Pf();function If(e){let{children:t,context:n,serverState:r,store:i}=e,a=I.useMemo(()=>{let e=Ef(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=I.useMemo(()=>i.getState(),[i]);kf(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||Ff;return I.createElement(s.Provider,{value:a},t)}var Lf=If,Rf=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function zf(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function Bf(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(Rf.has(n)){if(e[n]==null&&t[n]==null)continue;if(!jf(e[n],t[n]))return!1}else if(!zf(e[n],t[n]))return!1;return!0}var Vf=W([Qu,$u,td],(e,t,n)=>({x:n.left||0,y:n.top||0,width:Math.max(e-(n.left||0)-(n.right||0),0),height:Math.max(t-(n.top||0)-(n.bottom||0),0)}));function Hf(e,t){return e===`start`&&t===`start`?``:`translate(${e===`inherit`?`0`:{start:`0`,middle:`-50%`,end:`-100%`}[e]}, ${{start:`0`,middle:`-50%`,end:`-100%`}[t]??`0`})`}var Uf=i(w()),Wf=[`contextPayload`];function Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gf.apply(null,arguments)}function Kf(e,t){return Zf(e)||Xf(e,t)||Jf(e,t)||qf()}function qf(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ height and width.`,A,j,a,o,c,l,n),I.createElement(`div`,Id({id:m?`${m}`:void 0,className:k(`recharts-responsive-container`,h),style:Rd(Rd({},v),{},{width:a,height:o,minWidth:c,minHeight:l,maxHeight:u}),ref:b},y),I.createElement(`div`,{style:Nd({width:a,height:o})},I.createElement(Qd,{width:A,height:j},d)))}),tf=(0,I.forwardRef)((e,t)=>{var n=$d();if(Tu(n.width)&&Tu(n.height))return e.children;var r=Pd({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=Od(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return L(s)&&L(c)?I.createElement(Qd,{width:s,height:c},e.children):I.createElement(ef,Id({},e,{width:i,height:a,ref:t}))}),nf=()=>{var e=bd(),t=U(_d),n=U(Sd),r=U(xd)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},rf={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},af=()=>U(gd)??rf,of=()=>U(Qu),sf=()=>U($u),cf=()=>U(e=>e.layout.margin),Y=e=>e.layout.layoutType,lf=()=>U(Y),uf=()=>{var e=lf();if(e===`horizontal`||e===`vertical`)return e},df=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},ff=()=>lf()!==void 0,pf=e=>{var t=H(),n=bd(),r=e.width,i=e.height,a=$d(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,I.useEffect)(()=>{!n&&Tu(o)&&Tu(s)&&t(xu({width:o,height:s}))},[t,n,o,s]),null},mf=kl({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`,position:void 0,offset:0},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter,e.settings.position=t.payload.position,e.settings.offset=t.payload.offset},addLegendPayload:{reducer(e,t){e.payload.push(G(t.payload))},prepare:K()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=tl(e).payload.indexOf(G(r));a>-1&&(e.payload[a]=G(i))},prepare:K()},removeLegendPayload:{reducer(e,t){var n=tl(e).payload.indexOf(G(t.payload));n>-1&&e.payload.splice(n,1)},prepare:K()}}}),hf=mf.actions,gf=hf.setLegendSize,_f=hf.setLegendSettings,vf=hf.addLegendPayload,yf=hf.replaceLegendPayload,bf=hf.removeLegendPayload,xf=mf.reducer,Sf=e((e=>{var n=t();n.useSyncExternalStore,n.useRef,n.useEffect,n.useMemo,n.useDebugValue}));e(((e,t)=>{t.exports=Sf()}))();function Cf(e){e()}function wf(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Cf(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){r&&e!==null&&(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Tf={notify(){},get:()=>[]};function Ef(e,t){let n,r=Tf,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=wf())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Tf)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var Df=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Of=typeof navigator<`u`&&navigator.product===`ReactNative`,kf=Df||Of?I.useLayoutEffect:I.useEffect;function Af(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function jf(e,t){if(Af(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Af(e[n[r]],t[n[r]]))return!1;return!0}var Mf=Symbol.for(`react-redux-context`),Nf=typeof globalThis<`u`?globalThis:{};function Pf(){if(!I.createContext)return{};let e=Nf[Mf]??=new Map,t=e.get(I.createContext);return t||(t=I.createContext(null),e.set(I.createContext,t)),t}var Ff=Pf();function If(e){let{children:t,context:n,serverState:r,store:i}=e,a=I.useMemo(()=>{let e=Ef(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=I.useMemo(()=>i.getState(),[i]);kf(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||Ff;return I.createElement(s.Provider,{value:a},t)}var Lf=If,Rf=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function zf(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function Bf(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(Rf.has(n)){if(e[n]==null&&t[n]==null)continue;if(!jf(e[n],t[n]))return!1}else if(!zf(e[n],t[n]))return!1;return!0}var Vf=W([Qu,$u,td],(e,t,n)=>({x:n.left||0,y:n.top||0,width:Math.max(e-(n.left||0)-(n.right||0),0),height:Math.max(t-(n.top||0)-(n.bottom||0),0)}));function Hf(e,t){return e===`start`&&t===`start`?``:`translate(${e===`inherit`?`0`:{start:`0`,middle:`-50%`,end:`-100%`}[e]}, ${{start:`0`,middle:`-50%`,end:`-100%`}[t]??`0`})`}var Uf=i(l()),Wf=[`contextPayload`];function Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gf.apply(null,arguments)}function Kf(e,t){return Zf(e)||Xf(e,t)||Jf(e,t)||qf()}function qf(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jf(e,t){if(e){if(typeof e==`string`)return Yf(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yf(e,t):void 0}}function Yf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xf(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Zf(e){if(Array.isArray(e))return e}function Qf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qf(Object(n),!0).forEach(function(t){ep(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ep(e,t,n){return(t=tp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tp(e){var t=np(e,`string`);return typeof t==`symbol`?t:t+``}function np(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rp(e,t){if(e==null)return{};var n,r,i=ip(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ip(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ap(e){return e.value}function op(e){var t=e.contextPayload,n=rp(e,Wf),r=Io(t,e.payloadUniqBy,ap),i=$f($f({},n),{},{payload:r});return I.isValidElement(e.content)?I.cloneElement(e.content,i):typeof e.content==`function`?I.createElement(e.content,i):I.createElement(Ta,i)}function sp(e){return e===`left`||e===`right`||e===`insideLeft`||e===`insideRight`?`vertical`:`horizontal`}function cp(e,t){return t==null?null:vr(t)?Vf(e):_d(e)}function lp(e,t,n){return e===`top`?{top:n.height+t}:e===`bottom`?{top:-n.height-t}:e===`left`?{left:n.width+t}:e===`right`?{left:-n.width-t}:{}}function up(e,t,n,r,i,a){var o=t.layout,s=t.align,c=t.verticalAlign,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),$f($f({},l),u)}function dp(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=e.position,o=e.offset,s=H();return(0,I.useLayoutEffect)(()=>{s(_f({align:t,layout:n,verticalAlign:r,itemSorter:i,position:a,offset:o}))},[s,t,n,r,i,a,o]),null}function fp(e){var t=e.width,n=e.height,r=H();return(0,I.useLayoutEffect)(()=>{r(gf({width:t,height:n}))},[r,t,n]),(0,I.useLayoutEffect)(()=>()=>{r(gf({width:0,height:0}))},[r]),null}function pp(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var mp={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,labelStyle:{},layout:`auto`,verticalAlign:`bottom`,offset:0};function hp(e){var t=V(e,mp),n=e.layout&&e.layout!==`auto`?e.layout:sp(t.position),r=ms(),i=br(),a=cf(),o=U(e=>cp(e,t.position)),s=t.width,c=t.height,l=t.wrapperStyle,u=t.portal,d=u==null&&(t.position==null||vr(t.position)),f=Kf(ws([r]),2),p=f[0],m=f[1],h=of(),g=sf();if(h==null||g==null||t.position!=null&&o==null)return null;var _=pp(n,c,s,h-(a?.left||0)-(a?.right||0)),v=t.position==null?null:gr({viewBox:o??{x:0,y:0,width:h,height:g},position:t.position,offset:t.offset??0}),y=lp(t.position,t.offset??0,p),b=n===`vertical`?(o?.width??0)/2:o?.width??0,x=n===`horizontal`?(o?.height??0)/2:o?.height??0,S=v?{width:`max-content`,height:`max-content`,maxWidth:b,maxHeight:x,overflowY:`auto`,top:v.y+(y.top??0),left:v.x+(y.left??0),transform:Hf(v.horizontalAnchor,v.verticalAnchor)}:up(l,t,a,h,g,p),C=u?l:$f($f({position:`absolute`,width:_?.width||s||`auto`,height:_?.height||c||`auto`},S),l),w=u??i;if(w==null||r==null)return null;var T=I.createElement(`div`,{className:`recharts-legend-wrapper`,style:C,ref:m},I.createElement(dp,{layout:n,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter,position:t.position,offset:t.offset}),d&&I.createElement(fp,p),I.createElement(op,Gf({},t,{layout:n},_,{margin:a,chartWidth:h,chartHeight:g,contextPayload:r})));return(0,Uf.createPortal)(T,w)}var gp=I.memo(hp,Bf);gp.displayName=`Legend`;function _p(){return _p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_p.apply(null,arguments)}function vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vp(Object(n),!0).forEach(function(t){bp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bp(e,t,n){return(t=xp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xp(e){var t=Sp(e,`string`);return typeof t==`symbol`?t:t+``}function Sp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Cp(e,t){return Op(e)||Dp(e,t)||Tp(e,t)||wp()}function wp(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
11
11
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tp(e,t){if(e){if(typeof e==`string`)return Ep(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ep(e,t):void 0}}function Ep(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Dp(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Op(e){if(Array.isArray(e))return e}function kp(e){return Array.isArray(e)&&er(e[0])&&er(e[1])?e.join(` ~ `):e}var Ap={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 jp(e,t){return t==null?e:us(e,t)}var Mp=e=>{var t=e.separator,n=t===void 0?Ap.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?Ap.labelStyle:a,s=e.payload,c=e.formatter,l=e.itemSorter,u=e.wrapperClassName,d=e.labelClassName,f=e.label,p=e.labelFormatter,m=e.accessibilityLayer,h=m===void 0?Ap.accessibilityLayer:m,g=()=>{if(s&&s.length){var e={padding:0,margin:0},t=jp(s,l).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||kp,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var f=Cp(d,2);l=f[0],u=f[1]}else if(d!=null)l=d;else return null}var p=yp(yp({},Ap.itemStyle),{},{color:e.color||Ap.itemStyle.color},i);return I.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},er(u)?I.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,er(u)?I.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,I.createElement(`span`,{className:`recharts-tooltip-item-value`},l),I.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return I.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},_=yp(yp({},Ap.contentStyle),r),v=yp({margin:0},o),y=!z(f),b=y?f:``,x=k(`recharts-default-tooltip`,u),S=k(`recharts-tooltip-label`,d);y&&p&&s!=null&&(b=p(f,s));var C=h?{role:`status`,"aria-live":`assertive`}:{};return I.createElement(`div`,_p({className:x,style:_},C),I.createElement(`p`,{className:S,style:v},I.isValidElement(b)?b:`${b}`),g())},Np=`recharts-tooltip-wrapper`,Pp={visibility:`hidden`};function Fp(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return k(Np,{[`${Np}-right`]:L(n)&&t&&L(t.x)&&n>=t.x,[`${Np}-left`]:L(n)&&t&&L(t.x)&&n<t.x,[`${Np}-bottom`]:L(r)&&t&&L(t.y)&&r>=t.y,[`${Np}-top`]:L(r)&&t&&L(t.y)&&r<t.y})}function Ip(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&L(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function Lp(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Rp(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s&&s.height>0&&s.width>0&&n?(d=Ip({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=Ip({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Lp({translateX:d,translateY:f,useTranslate3d:c})):u=Pp,{cssProperties:u,cssClasses:Fp({translateX:d,translateY:f,coordinate:n})}}var zp={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Bp(e,t){return Gp(e)||Wp(e,t)||Hp(e,t)||Vp()}function Vp(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
12
12
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hp(e,t){if(e){if(typeof e==`string`)return Up(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Up(e,t):void 0}}function Up(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wp(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Gp(e){if(Array.isArray(e))return e}function Kp(){var e=Bp((0,I.useState)(()=>zp.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),2),t=e[0],n=e[1];return(0,I.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{n(e.matches)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}},[]),t}function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qp(Object(n),!0).forEach(function(t){Yp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yp(e,t,n){return(t=Xp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xp(e){var t=Zp(e,`string`);return typeof t==`symbol`?t:t+``}function Zp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Qp(e,t){return rm(e)||nm(e,t)||em(e,t)||$p()}function $p(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -62,4 +62,4 @@ ${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:n
62
62
  `)}
63
63
  }
64
64
  `).join(`
65
- `)}}):null},AV=Ck;function jV({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=DV(),m=I.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=`${f??e?.dataKey??e?.name??`value`}`,r=PV(p,e,n),a=!f&&typeof o==`string`?p[o]?.label??o:r?.label;return s?(0,F.jsx)(`div`,{className:E(`font-medium`,c),children:s(a,t)}):a?(0,F.jsx)(`div`,{className:E(`font-medium`,c),children:a}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,F.jsxs)(`div`,{className:E(`grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs/relaxed shadow-xl`,n),children:[h?null:m,(0,F.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=`${d??e.name??e.dataKey??`value`}`,i=PV(p,e,n),o=u??e.payload?.fill??e.color;return(0,F.jsx)(`div`,{className:E(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,F.jsxs)(F.Fragment,{children:[i?.icon?(0,F.jsx)(i.icon,{}):!a&&(0,F.jsx)(`div`,{className:E(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":h&&r===`dashed`}),style:{"--color-bg":o,"--color-border":o}}),(0,F.jsxs)(`div`,{className:E(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,F.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:i?.label??e.name})]}),e.value!=null&&(0,F.jsx)(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}var MV=gp;function NV({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i}){let{config:a}=DV();return n?.length?(0,F.jsx)(`div`,{className:E(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map((e,n)=>{let r=`${i??e.dataKey??`value`}`,o=PV(a,e,r);return(0,F.jsxs)(`div`,{className:E(`flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[o?.icon&&!t?(0,F.jsx)(o.icon,{}):(0,F.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),o?.label]},n)})}):null}function PV(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var FV=({caption:e,head:t,rows:n})=>(0,F.jsxs)(`table`,{className:`sr-only`,children:[(0,F.jsx)(`caption`,{children:e}),(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:t.map(e=>(0,F.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,F.jsx)(`tbody`,{children:n.map(([e,...n])=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{scope:`row`,children:e}),n.map((e,n)=>(0,F.jsx)(`td`,{children:e},t[n+1]??n))]},e))})]}),IV=[`succeeded`,`failed`,`canceled`],LV={succeeded:{label:`Succeeded`,color:`var(--run-succeeded)`},failed:{label:`Failed`,color:`var(--run-failed)`},canceled:{label:`Canceled`,color:`var(--run-canceled)`}},RV=`border-0 bg-popover shadow-raised`,zV=({title:e,actions:t,children:n})=>(0,F.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2.5`,children:[(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,F.jsx)(`h4`,{className:`text-sm font-medium`,children:e}),t]}),n]}),BV=({periods:e,bucket:t})=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OV,{config:LV,className:`aspect-auto h-44 w-full`,children:(0,F.jsxs)(xV,{data:[...e],margin:{top:4,right:0,bottom:0,left:0},barCategoryGap:`16%`,children:[(0,F.jsx)(YF,{vertical:!1}),(0,F.jsx)(uz,{dataKey:`start`,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:24,tickFormatter:e=>At(e)}),(0,F.jsx)(Tz,{allowDecimals:!1,tickLine:!1,axisLine:!1,width:28}),(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:(0,F.jsx)(jV,{className:RV,labelFormatter:e=>Mt(String(e),t)})}),(0,F.jsx)(MV,{content:(0,F.jsx)(NV,{}),itemSorter:e=>IV.findIndex(t=>t===e.dataKey)}),IV.map(e=>(0,F.jsx)(uR,{dataKey:e,stackId:`outcome`,fill:`var(--color-${e})`,stroke:`var(--background)`,strokeWidth:2,maxBarSize:24,isAnimationActive:!1},e))]})}),(0,F.jsx)(FV,{caption:`Closed runs per period by outcome`,head:[`Period`,`Succeeded`,`Failed`,`Canceled`],rows:e.map(({start:e,succeeded:n,failed:r,canceled:i})=>[Mt(e,t),String(n),String(r),String(i)])})]}),VV={runs:{label:`Runs`,color:`var(--chart-1)`}},HV=({counts:e})=>{let t=e.map(({attempts:e,runs:t})=>({label:Gt(e),runs:t}));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OV,{config:VV,className:`aspect-auto w-full`,style:{height:Math.max(2,t.length)*28+8},children:(0,F.jsxs)(xV,{data:t,layout:`vertical`,margin:{top:4,right:40,bottom:4,left:0},children:[(0,F.jsx)(uz,{type:`number`,hide:!0,allowDecimals:!1}),(0,F.jsx)(Tz,{type:`category`,dataKey:`label`,tickLine:!1,axisLine:!1,width:76}),(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:(0,F.jsx)(jV,{className:RV,hideIndicator:!0})}),(0,F.jsx)(uR,{dataKey:`runs`,fill:`var(--color-runs)`,radius:[0,4,4,0],maxBarSize:18,isAnimationActive:!1,children:(0,F.jsx)(xj,{dataKey:`runs`,position:`right`,offset:8,className:`fill-foreground tabular-nums`})})]})}),(0,F.jsx)(FV,{caption:`Closed runs per number of attempts`,head:[`Attempts`,`Runs`],rows:t.map(({label:e,runs:t})=>[e,String(t)])})]})},UV={entries:{label:`Entries`,color:`var(--needs-you)`}},WV=({periods:e,bucket:t})=>{let n=e.map(({start:e,approvals:t,failures:n})=>({start:e,approvals:t,failures:n,entries:t+n})),r=new Map(n.map(e=>[e.start,e]));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OV,{config:UV,className:`aspect-auto h-32 w-full`,children:(0,F.jsxs)(xV,{data:n,margin:{top:4,right:0,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),(0,F.jsx)(uz,{dataKey:`start`,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:24,tickFormatter:e=>At(e)}),(0,F.jsx)(Tz,{allowDecimals:!1,tickLine:!1,axisLine:!1,width:28}),(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:(0,F.jsx)(jV,{className:RV,hideIndicator:!0,labelFormatter:e=>{let n=String(e),i=r.get(n);return i===void 0?Mt(n,t):`${Mt(n,t)}: ${zt(i.approvals,`approval`,`approvals`)}, ${zt(i.failures,`failure`,`failures`)}`}})}),(0,F.jsx)(uR,{dataKey:`entries`,fill:`var(--color-entries)`,radius:[4,4,0,0],maxBarSize:24,isAnimationActive:!1})]})}),(0,F.jsx)(FV,{caption:`Needs attention entries per period`,head:[`Period`,`Approvals`,`Failures`],rows:n.map(({start:e,approvals:n,failures:r})=>[Mt(e,t),String(n),String(r)])})]})},GV=({workers:e})=>(0,F.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map(({worker:e,slots:t,occupiedMillis:n,share:r})=>(0,F.jsxs)(`li`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-xs`,children:[(0,F.jsx)(`span`,{className:`truncate font-mono text-foreground`,children:e}),(0,F.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:It(r,1)})]}),(0,F.jsx)(`div`,{role:`meter`,"aria-label":`${e} slot use`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r*100),className:`h-1.5 overflow-hidden rounded-full bg-chart-1/15`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full bg-chart-1`,style:{width:`${r*100}%`}})}),(0,F.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[zt(t,`slot`,`slots`),`, `,Pt(n),` held`]})]},e))}),KV=[{value:`loop`,label:`Loop`},{value:`agent`,label:`Agent`},{value:`model`,label:`Model`}],qV=(e,t)=>{switch(t){case`loop`:return e.loops.map(({loop:e,...t})=>({name:e,...t}));case`agent`:return e.agents.map(({agent:e,...t})=>({name:e,...t}));case`model`:return e.brains.map(({brain:e,...t})=>({name:le(e),...t}))}},JV=e=>KV.some(t=>t.value===e),YV=({statistics:e})=>{let[t,n]=(0,I.useState)(`loop`),r=qV(e,t),i=t===`model`?`attempt`:`run`;return(0,F.jsx)(zV,{title:t===`model`?`Attempts per model`:`Runs per ${t}`,actions:(0,F.jsx)(_n,{"aria-label":`Group by`,variant:`outline`,size:`sm`,spacing:0,value:[t],onValueChange:([e])=>{JV(e)&&n(e)},children:KV.map(({value:e,label:t})=>(0,F.jsx)(vn,{value:e,children:t},e))}),children:r.length===0?(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No closed runs `,kt(e.window)]}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(it,{children:(0,F.jsxs)(ot,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:KV.find(({value:e})=>e===t)?.label}),(0,F.jsx)(P,{className:`text-right`,children:i===`run`?`Runs`:`Attempts`}),(0,F.jsx)(P,{className:`text-right`,children:`Succeeded`}),(0,F.jsx)(P,{className:`text-right max-sm:hidden`,children:`Median time`}),(0,F.jsxs)(P,{className:`text-right max-md:hidden`,children:[`Tokens per `,i]}),(0,F.jsxs)(P,{className:`text-right max-sm:hidden`,children:[`Cost per `,i]})]})}),(0,F.jsx)(at,{children:r.map(({name:e,outcomes:n,time:r,usage:a})=>(0,F.jsxs)(ot,{className:`hover:bg-transparent`,children:[(0,F.jsx)(lt,{className:t===`model`?`truncate font-mono text-xs`:`truncate`,title:e,children:e}),(0,F.jsx)(st,{className:`text-right tabular-nums`,children:Rt(n).toLocaleString(`en`)}),(0,F.jsx)(st,{className:`text-right tabular-nums`,children:It(n.succeeded,Rt(n))}),(0,F.jsx)(st,{className:`text-right tabular-nums max-sm:hidden`,children:r===null?`None`:Pt(r.medianMillis)}),(0,F.jsx)(st,{className:`text-right tabular-nums max-md:hidden`,children:a.meanTokens===null?`None`:de(a.meanTokens)}),(0,F.jsx)(st,{className:`text-right tabular-nums max-sm:hidden`,title:a.cost===null?`No ${i} has a price for every session`:`${a.cost.priced} of ${a.measured} priced${a.cost.estimate?`, estimate`:``}`,children:a.cost===null?(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`No price`}):oe(a.cost.meanUsd)})]},e))})]})})})},XV=({label:e,value:t,detail:n})=>(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,F.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,F.jsx)(`dd`,{className:`text-lg font-semibold`,children:t}),n!==void 0&&(0,F.jsx)(`dd`,{className:`text-xs text-muted-foreground tabular-nums`,children:n})]}),ZV=e=>e===null?`None`:Pt(e.medianMillis),QV=({children:e})=>(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e}),$V=({statistics:e})=>{let t=Rt(e.runs),n=kt(e.window),r=e.needsAttention;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-7`,children:[(0,F.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-8 gap-y-4 sm:grid-cols-4`,children:[(0,F.jsx)(XV,{label:`Runs closed`,value:t.toLocaleString(`en`),detail:t===0?void 0:`${It(e.runs.succeeded,t)} succeeded`}),(0,F.jsx)(XV,{label:`Median run time`,value:ZV(e.runTime)}),(0,F.jsx)(XV,{label:`Median attempt time`,value:ZV(e.attemptTime)}),(0,F.jsx)(XV,{label:`Runs in one attempt`,value:e.attemptsPerRun.length===0?`None`:Kt(e.attemptsPerRun)})]}),(0,F.jsxs)(`div`,{className:`grid gap-x-10 gap-y-7 lg:grid-cols-2`,children:[(0,F.jsx)(zV,{title:e.bucket===`day`?`Runs closed per day`:`Runs closed per week`,children:t===0?(0,F.jsx)(QV,{children:`No closed runs ${n}`}):(0,F.jsx)(BV,{periods:e.throughput,bucket:e.bucket})}),(0,F.jsx)(zV,{title:`Needs attention entries per ${e.bucket}`,children:r.approvals+r.failures===0?(0,F.jsx)(QV,{children:`No approvals or failures ${n}`}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(WV,{periods:r.periods,bucket:e.bucket}),(0,F.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-8 gap-y-4`,children:[(0,F.jsx)(XV,{label:`Median approval wait`,value:ZV(r.approvalWait)}),(0,F.jsx)(XV,{label:qt,value:ZV(r.failureWait)}),(0,F.jsx)(XV,{label:Jt,value:ZV(r.retryWait)}),(0,F.jsx)(XV,{label:Yt,value:ZV(r.resolutionWait)})]})]})})]}),(0,F.jsx)(YV,{statistics:e}),(0,F.jsxs)(`div`,{className:`grid gap-x-10 gap-y-7 sm:grid-cols-2 xl:grid-cols-3`,children:[(0,F.jsx)(zV,{title:`Attempts per run`,children:e.attemptsPerRun.length===0?(0,F.jsx)(QV,{children:`No closed runs with an attempt ${n}`}):(0,F.jsx)(HV,{counts:e.attemptsPerRun})}),(0,F.jsx)(zV,{title:`Queue wait`,children:e.queueWait.length===0?(0,F.jsx)(QV,{children:`No attempts started ${n}`}):(0,F.jsx)(`dl`,{className:`flex flex-col gap-2.5`,children:e.queueWait.map(({worker:e,wait:t})=>(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,F.jsx)(`dt`,{className:`truncate font-mono text-xs text-foreground`,children:e}),(0,F.jsx)(`dd`,{className:`text-sm font-medium tabular-nums`,children:ZV(t)})]},e))})}),(0,F.jsx)(zV,{title:`Worker utilization`,children:e.utilization.length===0?(0,F.jsx)(QV,{children:`No workers in usine.yaml`}):(0,F.jsx)(GV,{workers:e.utilization})})]}),e.unmeasuredAttempts>0&&(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[zt(e.unmeasuredAttempts,`attempt`,`attempts`),` without an end time`,` `,e.unmeasuredAttempts===1?`is`:`are`,` left out of attempt time`]})]})},eH=()=>(0,F.jsx)(`div`,{"aria-hidden":`true`,className:`grid grid-cols-2 gap-x-8 gap-y-4 sm:grid-cols-4`,children:[0,1,2,3].map(e=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(ze,{className:`h-3 w-20`}),(0,F.jsx)(ze,{className:`h-5 w-14`})]},e))}),tH=({window:e})=>{let t=l(Ke(e)),n=t.data;return n===void 0?t.isError?(0,F.jsx)(c,{title:`Could not load the run statistics`,message:t.error.message}):(0,F.jsx)(eH,{}):(0,F.jsx)(`div`,{"aria-busy":t.isPlaceholderData,className:E(`transition-opacity duration-(--duration-fast)`,t.isPlaceholderData&&`opacity-60`),children:(0,F.jsx)($V,{statistics:n})})},nH=({window:e})=>(0,F.jsxs)(tt,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(et,{render:(0,F.jsx)(ne,{variant:`ghost`,size:`sm`,className:`-mx-2 w-fit gap-1.5 px-2 text-sm font-medium text-muted-foreground hover:text-foreground data-[panel-open]:text-foreground data-[panel-open]:[&>svg]:rotate-90`}),children:[(0,F.jsx)(b,{"aria-hidden":`true`,className:`transition-transform duration-(--duration-fast)`}),`Details`]}),(0,F.jsx)($e,{children:(0,F.jsx)(tH,{window:e})})]}),rH=8,iH=96,aH=28,oH=4,sH=(e,t)=>{let n=Math.ceil(e.periods.length/rH),r=[];for(let t=0;t<e.periods.length;t+=n)r.push(e.periods.slice(t,t+n));return r.map(n=>{let r=n.reduce((e,{tasks:t})=>e+t,0),i=n[0];return{label:i===void 0?``:Mt(i.start,e.bucket),value:r===0?null:t(r,n)}})},cH=({label:e,points:t,ceiling:n,format:r})=>{let i=t.length<2?0:88/(t.length-1),a=t.flatMap(({value:e},t)=>e===null?[]:[{x:oH+t*i,y:24-(n===0?0:e/n*20)}]),o=a.at(-1);return(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`${e}: ${t.map(({label:e,value:t})=>`${e} ${t===null?`none`:r(t)}`).join(`, `)}`,width:iH,height:aH,viewBox:`0 0 ${iH} ${aH}`,className:`shrink-0 overflow-visible`,children:[a.length>1&&(0,F.jsx)(`polyline`,{points:a.map(({x:e,y:t})=>`${e},${t}`).join(` `),fill:`none`,stroke:`var(--muted-foreground)`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`}),o!==void 0&&(0,F.jsx)(`circle`,{cx:o.x,cy:o.y,r:3,fill:`var(--chart-1)`,stroke:`var(--background)`,strokeWidth:2})]})},lH=({value:e,unit:t,children:n})=>(0,F.jsxs)(`div`,{className:`contents`,children:[(0,F.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xl font-semibold`,children:e}),` `,(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t})]}),n]}),uH=({statistics:e})=>{let t=e.tasks.length,n=sH(e,(e,t)=>t.reduce((e,{firstTimeRight:t})=>e+t,0)/e),r=sH(e,(e,t)=>t.reduce((e,{operatorActions:t})=>e+t,0)/e);return(0,F.jsxs)(`div`,{className:`grid grid-cols-[auto_auto] items-center justify-start gap-x-8 gap-y-4`,children:[(0,F.jsx)(lH,{value:It(e.firstTimeRight,t),unit:`of tasks`,children:(0,F.jsx)(cH,{label:`First time right per period`,points:n,ceiling:1,format:e=>It(e,1)})}),(0,F.jsx)(lH,{value:Bt(e.operatorActions,t),unit:`operator actions per task`,children:(0,F.jsx)(cH,{label:`Operator actions per task per period`,points:r,ceiling:Math.max(1,...r.flatMap(({value:e})=>e===null?[]:[e])),format:e=>Bt(e,1)})})]})},dH=5,fH=(e,t)=>{let n=e.length>dH,r=[],i=0;for(let{loop:a,share:o}of t){let t=e.indexOf(a);n&&t>=4?i+=o:r.push({name:a,share:o,fill:`var(--loop-${Math.max(0,t)+1})`})}return i>0?[...r,{name:`other loops`,share:i,fill:`var(--loop-${dH})`}]:r},pH=e=>({name:`waiting`,share:e,fill:`var(--loop-waiting)`}),mH=({label:e,parts:t})=>{let[n,r]=(0,I.useState)(null),i=e=>n!==null&&n!==e;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,F.jsx)(`div`,{role:`img`,"aria-label":`${e}: ${t.map(({name:e,share:t})=>`${e} ${Lt(t)}`).join(`, `)}`,className:`flex h-3 gap-0.5 overflow-hidden rounded-sm`,onPointerLeave:()=>r(null),children:t.map(({name:e,share:t,fill:n})=>(0,F.jsx)(`div`,{className:E(`min-w-0.5 transition-opacity duration-(--duration-fast)`,i(e)&&`opacity-35`),style:{flexGrow:t,flexBasis:0,background:n},onPointerEnter:()=>r(e)},e))}),(0,F.jsx)(`ul`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,onPointerLeave:()=>r(null),children:t.map(({name:e,share:t,fill:n})=>(0,F.jsxs)(`li`,{className:E(`inline-flex items-center gap-1.5 tabular-nums transition-opacity duration-(--duration-fast)`,i(e)&&`opacity-50`),onPointerEnter:()=>r(e),children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-[2px]`,style:{background:n}}),(0,F.jsx)(`span`,{className:`text-foreground`,children:e}),Lt(t)]},e))})]})},hH=6e4,gH=60*hH,_H=24*gH,vH=[[hH,`1 min`],[15*hH,`15 min`],[gH,`1 h`],[4*gH,`4 h`],[_H,`1 d`],[7*_H,`1 w`],[28*_H,`4 w`]],yH=1.25,bH={task:{label:`task`,color:`var(--chart-1)`},tasks:{label:`tasks`,color:`var(--chart-1)`},median:{label:`median`,color:`var(--muted-foreground)`}},xH=e=>{let t=Math.min(...e),n=Math.max(...e),r=vH.filter(([e])=>e<=t).at(-1)??vH[0],i=vH.find(([e])=>e>=n)??vH.at(-1),a=r?.[0]??6e4,o=Math.max(i?.[0]??n,n);return{domain:[a/yH,o*yH],ticks:vH.filter(([e])=>e>=a&&e<=o).map(([e])=>e)}},SH=e=>vH.find(([t])=>t===e)?.[1]??Pt(e),CH=`grid min-w-24 gap-0.5 rounded-md bg-popover px-2.5 py-1.5 text-xs shadow-raised tabular-nums`,wH=(e,t)=>{let n=Math.ceil((t-e)/864e5)<=8?_H:7*_H,r=[];for(let i=e;i<t;i+=n)r.push(i);return r},TH=Math.PI*16,EH=Math.PI*144,DH=(e,t)=>t>1?`${e.repository} #${e.number}`:`#${e.number}`,OH=({statistics:e})=>{let t=x(),n=Date.parse(e.from),r=Date.parse(e.to),i=r-r%_H+_H,a=e.tasks.map(e=>({x:Date.parse(e.mergedAt),y:Math.max(hH,e.durationMillis),z:1,task:e})),o=xH(a.map(({y:e})=>e)),s=new Set(e.tasks.map(({repository:e})=>e)).size;return(0,F.jsx)(OV,{config:bH,className:`aspect-auto h-60 w-full`,children:(0,F.jsxs)(CV,{margin:{top:8,right:8,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),(0,F.jsx)(uz,{type:`number`,dataKey:`x`,scale:`time`,domain:[n,i],ticks:[...wH(n,i)],tickFormatter:e=>jt(e),tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:16}),(0,F.jsx)(Tz,{type:`number`,dataKey:`y`,scale:`log`,domain:o.domain,ticks:o.ticks,tickFormatter:SH,allowDataOverflow:!0,tickLine:!1,axisLine:!1,width:48}),(0,F.jsx)(DP,{y:Math.max(hH,e.medianMillis??6e4),stroke:`var(--color-median)`,strokeWidth:2}),(0,F.jsx)(AV,{cursor:!1,content:({active:e,payload:t})=>{let n=t?.[0]?.payload;return e===!0&&n!==void 0?(0,F.jsxs)(`div`,{className:CH,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:Pt(n.task.durationMillis)}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:DH(n.task,s)})]}):null}}),(0,F.jsx)(Oz,{zAxisId:`dot`,dataKey:`z`,range:[TH,TH]}),(0,F.jsx)(Oz,{zAxisId:`hit`,dataKey:`z`,range:[EH,EH]}),(0,F.jsx)(UR,{zAxisId:`dot`,data:[...a],fill:`var(--color-task)`,stroke:`var(--background)`,strokeWidth:2,isAnimationActive:!1}),(0,F.jsx)(UR,{zAxisId:`hit`,data:[...a],fill:`transparent`,className:`cursor-pointer`,isAnimationActive:!1,onClick:e=>{let n=e.payload?.task;n!==void 0&&t({to:`/projects/$owner/$name/tasks/$number`,params:{...v(n.repository),number:String(n.number)}})}})]})})},kH=({statistics:e})=>{let t=e.periods.map(({start:e,tasks:t,medianMillis:n})=>({start:e,tasks:t,median:n===null?null:Math.max(hH,n)})),n=xH(t.flatMap(({median:e})=>e===null?[]:[e])),r=(0,F.jsx)(uz,{dataKey:`start`,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:24,tickFormatter:e=>At(e)}),i=(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:({active:e,payload:t})=>{let n=t?.[0]?.payload;return e===!0&&n!==void 0?(0,F.jsxs)(`div`,{className:CH,children:[(0,F.jsxs)(`span`,{className:`font-medium text-foreground`,children:[n.tasks,` `,n.tasks===1?`task`:`tasks`,n.median===null?``:`, median ${Pt(n.median)}`]}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:Mt(n.start,`week`)})]}):null}});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(OV,{config:bH,className:`aspect-auto h-28 w-full`,children:(0,F.jsxs)(xV,{data:t,margin:{top:4,right:8,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),r,(0,F.jsx)(Tz,{allowDecimals:!1,tickLine:!1,axisLine:!1,width:48}),i,(0,F.jsx)(uR,{dataKey:`tasks`,fill:`var(--color-tasks)`,radius:[4,4,0,0],maxBarSize:24,isAnimationActive:!1})]})}),(0,F.jsx)(OV,{config:bH,className:`aspect-auto h-36 w-full`,children:(0,F.jsxs)(yV,{data:t,margin:{top:8,right:8,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),r,(0,F.jsx)(Tz,{scale:`log`,domain:n.domain,ticks:n.ticks,tickFormatter:SH,allowDataOverflow:!0,tickLine:!1,axisLine:!1,width:48}),i,(0,F.jsx)($I,{dataKey:`median`,stroke:`var(--color-median)`,strokeWidth:2,dot:{r:4,fill:`var(--color-median)`,stroke:`var(--background)`,strokeWidth:2},connectNulls:!0,isAnimationActive:!1})]})})]})},AH=({statistics:e})=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.bucket===`day`?(0,F.jsx)(OH,{statistics:e}):(0,F.jsx)(kH,{statistics:e}),(0,F.jsx)(FV,{caption:`Tasks done, time in usine`,head:[`Task`,`Merged`,`Duration`],rows:e.tasks.map(e=>[`${e.repository} #${e.number}`,jt(Date.parse(e.mergedAt)),Pt(e.durationMillis)])})]}),jH=({points:e})=>(0,F.jsxs)(`ul`,{className:`flex items-center gap-4 text-xs text-muted-foreground`,children:[(0,F.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:e===`dot`?`size-2 rounded-full bg-chart-1`:`size-2 rounded-[2px] bg-chart-1`}),e===`dot`?`task`:`tasks`]}),(0,F.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 w-3 rounded-full bg-muted-foreground`}),`median`]})]}),MH=[`7d`,`30d`,`all`],NH=e=>MH.some(t=>t===e),PH=({value:e,unit:t})=>(0,F.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xl font-semibold`,children:e}),` `,(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t})]}),FH=({title:e,className:t,children:n})=>(0,F.jsxs)(`section`,{className:E(`flex min-w-0 flex-col gap-3`,t),children:[(0,F.jsx)(`h3`,{className:`text-md font-medium`,children:e}),n]}),IH=({statistics:e})=>{let{time:t}=e;return(0,F.jsx)(FH,{title:`Time per task`,children:t===null?(0,F.jsx)(dt,{children:`No task with recorded attempt times`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(mH,{label:`Time per task`,parts:[...fH(e.loops,t.loops),pH(t.waiting)]}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:t.runs.map(({loop:e,medianMillis:t})=>(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`span`,{className:`text-foreground`,children:e}),` `,Ft(t)]},e))})]})})},LH=({statistics:e})=>{let{tokens:t}=e;return(0,F.jsx)(FH,{title:`Tokens per task`,children:t===null?(0,F.jsx)(dt,{children:`No token reports`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(PH,{value:de(t.medianTokens),unit:`median`}),(0,F.jsx)(mH,{label:`Tokens per task`,parts:fH(e.loops,t.loops)})]})})},RH=({statistics:e})=>{if(e.tasks.length===0)return(0,F.jsx)(dt,{children:Vt(e.window)});let{tokens:t}=e,n=t?.cost??null,r=t===null?0:t.tasks-(n?.tasks??0),i=[e.untimed===null?null:Ht(e.untimed),e.unmetered===0?null:Ut(e.unmetered),r===0?null:Wt(r)].filter(e=>e!==null);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,F.jsxs)(`div`,{className:`grid gap-x-12 gap-y-9 lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]`,children:[(0,F.jsxs)(FH,{title:`Tasks done`,className:`lg:col-span-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-x-8 gap-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-8 gap-y-1`,children:[(0,F.jsx)(PH,{value:e.tasks.length.toLocaleString(`en`),unit:e.tasks.length===1?`task`:`tasks`}),e.medianMillis!==null&&(0,F.jsx)(PH,{value:Pt(e.medianMillis),unit:`median time in usine`}),n!==null&&(0,F.jsx)(PH,{value:`${n.estimate?`~`:``}${oe(n.medianUsd)}`,unit:`median price`})]}),(0,F.jsx)(jH,{points:e.bucket===`day`?`dot`:`column`})]}),(0,F.jsx)(AH,{statistics:e})]}),(0,F.jsx)(IH,{statistics:e}),(0,F.jsx)(FH,{title:`First time right`,className:`lg:row-span-2`,children:(0,F.jsx)(uH,{statistics:e})}),(0,F.jsx)(LH,{statistics:e})]}),i.length>0&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.join(`; `)})]})},zH=()=>(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col gap-3`,children:[(0,F.jsx)(ze,{className:`h-4 w-24`}),(0,F.jsxs)(`div`,{className:`flex gap-8`,children:[(0,F.jsx)(ze,{className:`h-6 w-20`}),(0,F.jsx)(ze,{className:`h-6 w-40`})]}),(0,F.jsx)(ze,{className:`h-60 w-full`})]}),BH=()=>{let[e,t]=(0,I.useState)(`30d`),n=l(Ge(e)),r=n.data;return(0,F.jsx)(pt,{id:`desk-statistics`,title:`Statistics`,note:r===void 0?void 0:Nt(r.from,r.bucket),actions:(0,F.jsx)(_n,{"aria-label":`Statistics window`,variant:`outline`,size:`sm`,spacing:0,value:[e],onValueChange:([e])=>{NH(e)&&t(e)},children:MH.map(e=>(0,F.jsx)(vn,{value:e,children:Ot[e]},e))}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-6 pt-2`,children:[r===void 0?n.isError?(0,F.jsx)(c,{title:`Could not load the statistics`,message:n.error.message}):(0,F.jsx)(zH,{}):(0,F.jsxs)(`div`,{"aria-busy":n.isPlaceholderData,className:E(`transition-opacity duration-(--duration-fast)`,n.isPlaceholderData&&`opacity-60`),children:[n.isError&&(0,F.jsxs)(dt,{children:[`Could not refresh the statistics: `,n.error.message]}),(0,F.jsx)(RH,{statistics:r})]}),(0,F.jsx)(nH,{window:e})]})})},VH={Passed:{state:`Succeeded`,label:`passed`,className:void 0},Degraded:{state:`Waiting`,label:`degraded`,className:`text-run-waiting`},Deferred:{state:`Deferred`,label:`deferred`,className:void 0},Failed:{state:`Failed`,label:`failed`,className:`text-destructive`}},HH=({worker:e,now:t})=>{let n=e.preflight;if(n===null)return(0,F.jsx)(`span`,{children:`No preflight yet`});let{state:r,label:i,className:a}=VH[n._tag];return(0,F.jsxs)(`span`,{className:a,title:n._tag===`Passed`?ae(n.checkedAt):n.message,children:[(0,F.jsx)(Ye,{state:r,className:`mr-1.5 align-middle`}),`Preflight `,i,` `,pe(n.checkedAt,t)]})},UH=({pause:e,now:t})=>(0,F.jsxs)(`span`,{className:`text-destructive`,title:e.message,children:[(0,F.jsx)(Ye,{state:`Failed`,className:`mr-1.5 align-middle`}),m(e),`.`,` `,(0,F.jsx)(`span`,{className:`tabular-nums`,children:g(e,t)})]}),WH=({workers:e,now:t})=>(0,F.jsxs)(`footer`,{"aria-label":`Workers`,className:`flex flex-wrap items-baseline gap-x-8 gap-y-1.5 border-t pt-3 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:`Workers`}),e.map(e=>(0,F.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-3`,children:[(0,F.jsx)(`span`,{className:`font-mono text-foreground`,children:e.name}),(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[e.slots.leased,` of `,e.slots.capacity,` `,e.slots.capacity===1?`slot`:`slots`,` in use`,e.machines.length>0&&`, ${e.machines.length} ${e.machines.length===1?`machine`:`machines`}`]}),(0,F.jsx)(HH,{worker:e,now:t}),e.provisioning?.blocked===!0&&(0,F.jsx)(UH,{pause:e.provisioning,now:t})]},e.name))]}),GH=()=>(0,F.jsxs)(`section`,{className:`flex flex-col items-start gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex max-w-prose flex-col gap-1`,children:[(0,F.jsx)(`h2`,{className:`text-md font-medium`,children:Xt.title}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:Xt.description})]}),(0,F.jsx)(ne,{variant:`outline`,render:(0,F.jsx)(S,{to:`/configuration/repositories`}),children:Xt.action})]}),KH=({needs:e,dismissedNeeds:t=[],polls:n,now:r})=>(0,F.jsxs)(pt,{id:`desk-needs-you`,title:`Needs attention`,count:e.length,countTone:`needs-you`,note:St(n,r)??void 0,children:[e.length===0?(0,F.jsx)(dt,{children:`Nothing needs attention`}):(0,F.jsx)(`ul`,{className:`grid grid-cols-1 items-start gap-2.5 lg:grid-cols-2`,children:e.map(e=>(0,F.jsx)(We,{need:e,compact:!1},e.id))}),(0,F.jsx)(vt,{needs:t})]}),qH=()=>{let{data:e}=p(_()),t=p(a()),n=qe(15e3),r=e._tag===`NeedsSetup`;return(0,F.jsx)(s,{width:`full`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-9 pb-2`,children:[(0,F.jsx)(o,{title:`Overview`,counts:Ct(t.data)}),e.projects.length===0&&(0,F.jsx)(GH,{}),(0,F.jsx)(BH,{}),(0,F.jsx)(KH,{dismissedNeeds:e.dismissedNeeds,needs:e.needsYou,polls:t.data.polls,now:n}),t.isError&&(0,F.jsx)(c,{title:`Could not refresh the overview`,message:t.error.message}),(0,F.jsx)(pt,{id:`desk-running`,title:`Running`,count:t.data.running.length,children:(0,F.jsx)(rn,{running:t.data.running,workers:t.data.workers,now:n})}),(0,F.jsx)(pt,{id:`desk-not-moving`,title:`Stalled`,count:t.data.notMoving.length,children:(0,F.jsx)(en,{stalled:t.data.notMoving,now:n,readOnly:r,polled:t.data.polls.some(({polledAt:e})=>e!==null)})}),(0,F.jsx)(pt,{id:`desk-outcomes`,title:`Recent runs`,children:(0,F.jsx)(Qt,{outcomes:t.data.lastOutcomes,now:n})}),t.data.workers.length>0&&(0,F.jsx)(WH,{workers:t.data.workers,now:n})]})})};export{qH as component};
65
+ `)}}):null},AV=Ck;function jV({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=DV(),m=I.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=`${f??e?.dataKey??e?.name??`value`}`,r=PV(p,e,n),a=!f&&typeof o==`string`?p[o]?.label??o:r?.label;return s?(0,F.jsx)(`div`,{className:E(`font-medium`,c),children:s(a,t)}):a?(0,F.jsx)(`div`,{className:E(`font-medium`,c),children:a}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,F.jsxs)(`div`,{className:E(`grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs/relaxed shadow-xl`,n),children:[h?null:m,(0,F.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=`${d??e.name??e.dataKey??`value`}`,i=PV(p,e,n),o=u??e.payload?.fill??e.color;return(0,F.jsx)(`div`,{className:E(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,F.jsxs)(F.Fragment,{children:[i?.icon?(0,F.jsx)(i.icon,{}):!a&&(0,F.jsx)(`div`,{className:E(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":h&&r===`dashed`}),style:{"--color-bg":o,"--color-border":o}}),(0,F.jsxs)(`div`,{className:E(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,F.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:i?.label??e.name})]}),e.value!=null&&(0,F.jsx)(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}var MV=gp;function NV({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i}){let{config:a}=DV();return n?.length?(0,F.jsx)(`div`,{className:E(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map((e,n)=>{let r=`${i??e.dataKey??`value`}`,o=PV(a,e,r);return(0,F.jsxs)(`div`,{className:E(`flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[o?.icon&&!t?(0,F.jsx)(o.icon,{}):(0,F.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),o?.label]},n)})}):null}function PV(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var FV=({caption:e,head:t,rows:n})=>(0,F.jsxs)(`table`,{className:`sr-only`,children:[(0,F.jsx)(`caption`,{children:e}),(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:t.map(e=>(0,F.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,F.jsx)(`tbody`,{children:n.map(([e,...n])=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{scope:`row`,children:e}),n.map((e,n)=>(0,F.jsx)(`td`,{children:e},t[n+1]??n))]},e))})]}),IV=[`succeeded`,`failed`,`canceled`],LV={succeeded:{label:`Succeeded`,color:`var(--run-succeeded)`},failed:{label:`Failed`,color:`var(--run-failed)`},canceled:{label:`Canceled`,color:`var(--run-canceled)`}},RV=`border-0 bg-popover shadow-raised`,zV=({title:e,actions:t,children:n})=>(0,F.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2.5`,children:[(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,F.jsx)(`h4`,{className:`text-sm font-medium`,children:e}),t]}),n]}),BV=({periods:e,bucket:t})=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OV,{config:LV,className:`aspect-auto h-44 w-full`,children:(0,F.jsxs)(xV,{data:[...e],margin:{top:4,right:0,bottom:0,left:0},barCategoryGap:`16%`,children:[(0,F.jsx)(YF,{vertical:!1}),(0,F.jsx)(uz,{dataKey:`start`,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:24,tickFormatter:e=>At(e)}),(0,F.jsx)(Tz,{allowDecimals:!1,tickLine:!1,axisLine:!1,width:28}),(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:(0,F.jsx)(jV,{className:RV,labelFormatter:e=>Mt(String(e),t)})}),(0,F.jsx)(MV,{content:(0,F.jsx)(NV,{}),itemSorter:e=>IV.findIndex(t=>t===e.dataKey)}),IV.map(e=>(0,F.jsx)(uR,{dataKey:e,stackId:`outcome`,fill:`var(--color-${e})`,stroke:`var(--background)`,strokeWidth:2,maxBarSize:24,isAnimationActive:!1},e))]})}),(0,F.jsx)(FV,{caption:`Closed runs per period by outcome`,head:[`Period`,`Succeeded`,`Failed`,`Canceled`],rows:e.map(({start:e,succeeded:n,failed:r,canceled:i})=>[Mt(e,t),String(n),String(r),String(i)])})]}),VV={runs:{label:`Runs`,color:`var(--chart-1)`}},HV=({counts:e})=>{let t=e.map(({attempts:e,runs:t})=>({label:Gt(e),runs:t}));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OV,{config:VV,className:`aspect-auto w-full`,style:{height:Math.max(2,t.length)*28+8},children:(0,F.jsxs)(xV,{data:t,layout:`vertical`,margin:{top:4,right:40,bottom:4,left:0},children:[(0,F.jsx)(uz,{type:`number`,hide:!0,allowDecimals:!1}),(0,F.jsx)(Tz,{type:`category`,dataKey:`label`,tickLine:!1,axisLine:!1,width:76}),(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:(0,F.jsx)(jV,{className:RV,hideIndicator:!0})}),(0,F.jsx)(uR,{dataKey:`runs`,fill:`var(--color-runs)`,radius:[0,4,4,0],maxBarSize:18,isAnimationActive:!1,children:(0,F.jsx)(xj,{dataKey:`runs`,position:`right`,offset:8,className:`fill-foreground tabular-nums`})})]})}),(0,F.jsx)(FV,{caption:`Closed runs per number of attempts`,head:[`Attempts`,`Runs`],rows:t.map(({label:e,runs:t})=>[e,String(t)])})]})},UV={entries:{label:`Entries`,color:`var(--needs-you)`}},WV=({periods:e,bucket:t})=>{let n=e.map(({start:e,approvals:t,failures:n})=>({start:e,approvals:t,failures:n,entries:t+n})),r=new Map(n.map(e=>[e.start,e]));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OV,{config:UV,className:`aspect-auto h-32 w-full`,children:(0,F.jsxs)(xV,{data:n,margin:{top:4,right:0,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),(0,F.jsx)(uz,{dataKey:`start`,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:24,tickFormatter:e=>At(e)}),(0,F.jsx)(Tz,{allowDecimals:!1,tickLine:!1,axisLine:!1,width:28}),(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:(0,F.jsx)(jV,{className:RV,hideIndicator:!0,labelFormatter:e=>{let n=String(e),i=r.get(n);return i===void 0?Mt(n,t):`${Mt(n,t)}: ${zt(i.approvals,`approval`,`approvals`)}, ${zt(i.failures,`failure`,`failures`)}`}})}),(0,F.jsx)(uR,{dataKey:`entries`,fill:`var(--color-entries)`,radius:[4,4,0,0],maxBarSize:24,isAnimationActive:!1})]})}),(0,F.jsx)(FV,{caption:`Needs attention entries per period`,head:[`Period`,`Approvals`,`Failures`],rows:n.map(({start:e,approvals:n,failures:r})=>[Mt(e,t),String(n),String(r)])})]})},GV=({workers:e})=>(0,F.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map(({worker:e,slots:t,occupiedMillis:n,share:r})=>(0,F.jsxs)(`li`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-xs`,children:[(0,F.jsx)(`span`,{className:`truncate font-mono text-foreground`,children:e}),(0,F.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:It(r,1)})]}),(0,F.jsx)(`div`,{role:`meter`,"aria-label":`${e} slot use`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r*100),className:`h-1.5 overflow-hidden rounded-full bg-chart-1/15`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full bg-chart-1`,style:{width:`${r*100}%`}})}),(0,F.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[zt(t,`slot`,`slots`),`, `,Pt(n),` held`]})]},e))}),KV=[{value:`loop`,label:`Loop`},{value:`agent`,label:`Agent`},{value:`model`,label:`Model`}],qV=(e,t)=>{switch(t){case`loop`:return e.loops.map(({loop:e,...t})=>({name:e,...t}));case`agent`:return e.agents.map(({agent:e,...t})=>({name:e,...t}));case`model`:return e.brains.map(({brain:e,...t})=>({name:de(e),...t}))}},JV=e=>KV.some(t=>t.value===e),YV=({statistics:e})=>{let[t,n]=(0,I.useState)(`loop`),r=qV(e,t),i=t===`model`?`attempt`:`run`;return(0,F.jsx)(zV,{title:t===`model`?`Attempts per model`:`Runs per ${t}`,actions:(0,F.jsx)(_n,{"aria-label":`Group by`,variant:`outline`,size:`sm`,spacing:0,value:[t],onValueChange:([e])=>{JV(e)&&n(e)},children:KV.map(({value:e,label:t})=>(0,F.jsx)(vn,{value:e,children:t},e))}),children:r.length===0?(0,F.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No closed runs `,kt(e.window)]}):(0,F.jsx)(`div`,{className:`-mx-2`,children:(0,F.jsxs)(at,{children:[(0,F.jsx)(tt,{children:(0,F.jsxs)(rt,{className:`hover:bg-transparent`,children:[(0,F.jsx)(P,{children:KV.find(({value:e})=>e===t)?.label}),(0,F.jsx)(P,{className:`text-right`,children:i===`run`?`Runs`:`Attempts`}),(0,F.jsx)(P,{className:`text-right`,children:`Succeeded`}),(0,F.jsx)(P,{className:`text-right max-sm:hidden`,children:`Median time`}),(0,F.jsxs)(P,{className:`text-right max-md:hidden`,children:[`Tokens per `,i]}),(0,F.jsxs)(P,{className:`text-right max-sm:hidden`,children:[`Cost per `,i]})]})}),(0,F.jsx)(nt,{children:r.map(({name:e,outcomes:n,time:r,usage:a})=>(0,F.jsxs)(rt,{className:`hover:bg-transparent`,children:[(0,F.jsx)(ot,{className:t===`model`?`truncate font-mono text-xs`:`truncate`,title:e,children:e}),(0,F.jsx)(it,{className:`text-right tabular-nums`,children:Rt(n).toLocaleString(`en`)}),(0,F.jsx)(it,{className:`text-right tabular-nums`,children:It(n.succeeded,Rt(n))}),(0,F.jsx)(it,{className:`text-right tabular-nums max-sm:hidden`,children:r===null?`None`:Pt(r.medianMillis)}),(0,F.jsx)(it,{className:`text-right tabular-nums max-md:hidden`,children:a.meanTokens===null?`None`:pe(a.meanTokens)}),(0,F.jsx)(it,{className:`text-right tabular-nums max-sm:hidden`,title:a.cost===null?`No ${i} has a price for every session`:`${a.cost.priced} of ${a.measured} priced${a.cost.estimate?`, estimate`:``}`,children:a.cost===null?(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`No price`}):le(a.cost.meanUsd)})]},e))})]})})})},XV=({label:e,value:t,detail:n})=>(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,F.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,F.jsx)(`dd`,{className:`text-lg font-semibold`,children:t}),n!==void 0&&(0,F.jsx)(`dd`,{className:`text-xs text-muted-foreground tabular-nums`,children:n})]}),ZV=e=>e===null?`None`:Pt(e.medianMillis),QV=({children:e})=>(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e}),$V=({statistics:e})=>{let t=Rt(e.runs),n=kt(e.window),r=e.needsAttention;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-7`,children:[(0,F.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-8 gap-y-4 sm:grid-cols-4`,children:[(0,F.jsx)(XV,{label:`Runs closed`,value:t.toLocaleString(`en`),detail:t===0?void 0:`${It(e.runs.succeeded,t)} succeeded`}),(0,F.jsx)(XV,{label:`Median run time`,value:ZV(e.runTime)}),(0,F.jsx)(XV,{label:`Median attempt time`,value:ZV(e.attemptTime)}),(0,F.jsx)(XV,{label:`Runs in one attempt`,value:e.attemptsPerRun.length===0?`None`:Kt(e.attemptsPerRun)})]}),(0,F.jsxs)(`div`,{className:`grid gap-x-10 gap-y-7 lg:grid-cols-2`,children:[(0,F.jsx)(zV,{title:e.bucket===`day`?`Runs closed per day`:`Runs closed per week`,children:t===0?(0,F.jsx)(QV,{children:`No closed runs ${n}`}):(0,F.jsx)(BV,{periods:e.throughput,bucket:e.bucket})}),(0,F.jsx)(zV,{title:`Needs attention entries per ${e.bucket}`,children:r.approvals+r.failures===0?(0,F.jsx)(QV,{children:`No approvals or failures ${n}`}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(WV,{periods:r.periods,bucket:e.bucket}),(0,F.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-8 gap-y-4`,children:[(0,F.jsx)(XV,{label:`Median approval wait`,value:ZV(r.approvalWait)}),(0,F.jsx)(XV,{label:qt,value:ZV(r.failureWait)}),(0,F.jsx)(XV,{label:Jt,value:ZV(r.retryWait)}),(0,F.jsx)(XV,{label:Yt,value:ZV(r.resolutionWait)})]})]})})]}),(0,F.jsx)(YV,{statistics:e}),(0,F.jsxs)(`div`,{className:`grid gap-x-10 gap-y-7 sm:grid-cols-2 xl:grid-cols-3`,children:[(0,F.jsx)(zV,{title:`Attempts per run`,children:e.attemptsPerRun.length===0?(0,F.jsx)(QV,{children:`No closed runs with an attempt ${n}`}):(0,F.jsx)(HV,{counts:e.attemptsPerRun})}),(0,F.jsx)(zV,{title:`Queue wait`,children:e.queueWait.length===0?(0,F.jsx)(QV,{children:`No attempts started ${n}`}):(0,F.jsx)(`dl`,{className:`flex flex-col gap-2.5`,children:e.queueWait.map(({worker:e,wait:t})=>(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,F.jsx)(`dt`,{className:`truncate font-mono text-xs text-foreground`,children:e}),(0,F.jsx)(`dd`,{className:`text-sm font-medium tabular-nums`,children:ZV(t)})]},e))})}),(0,F.jsx)(zV,{title:`Worker utilization`,children:e.utilization.length===0?(0,F.jsx)(QV,{children:`No workers in usine.yaml`}):(0,F.jsx)(GV,{workers:e.utilization})})]}),e.unmeasuredAttempts>0&&(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[zt(e.unmeasuredAttempts,`attempt`,`attempts`),` without an end time`,` `,e.unmeasuredAttempts===1?`is`:`are`,` left out of attempt time`]})]})},eH=()=>(0,F.jsx)(`div`,{"aria-hidden":`true`,className:`grid grid-cols-2 gap-x-8 gap-y-4 sm:grid-cols-4`,children:[0,1,2,3].map(e=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(ze,{className:`h-3 w-20`}),(0,F.jsx)(ze,{className:`h-5 w-14`})]},e))}),tH=({window:e})=>{let t=u(Ge(e)),n=t.data;return n===void 0?t.isError?(0,F.jsx)(c,{title:`Could not load the run statistics`,message:t.error.message}):(0,F.jsx)(eH,{}):(0,F.jsx)(`div`,{"aria-busy":t.isPlaceholderData,className:E(`transition-opacity duration-(--duration-fast)`,t.isPlaceholderData&&`opacity-60`),children:(0,F.jsx)($V,{statistics:n})})},nH=({window:e})=>(0,F.jsxs)(lt,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(ct,{render:(0,F.jsx)(ne,{variant:`ghost`,size:`sm`,className:`-mx-2 w-fit gap-1.5 px-2 text-sm font-medium text-muted-foreground hover:text-foreground data-[panel-open]:text-foreground data-[panel-open]:[&>svg]:rotate-90`}),children:[(0,F.jsx)(x,{"aria-hidden":`true`,className:`transition-transform duration-(--duration-fast)`}),`Details`]}),(0,F.jsx)(st,{children:(0,F.jsx)(tH,{window:e})})]}),rH=8,iH=96,aH=28,oH=4,sH=(e,t)=>{let n=Math.ceil(e.periods.length/rH),r=[];for(let t=0;t<e.periods.length;t+=n)r.push(e.periods.slice(t,t+n));return r.map(n=>{let r=n.reduce((e,{tasks:t})=>e+t,0),i=n[0];return{label:i===void 0?``:Mt(i.start,e.bucket),value:r===0?null:t(r,n)}})},cH=({label:e,points:t,ceiling:n,format:r})=>{let i=t.length<2?0:88/(t.length-1),a=t.flatMap(({value:e},t)=>e===null?[]:[{x:oH+t*i,y:24-(n===0?0:e/n*20)}]),o=a.at(-1);return(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`${e}: ${t.map(({label:e,value:t})=>`${e} ${t===null?`none`:r(t)}`).join(`, `)}`,width:iH,height:aH,viewBox:`0 0 ${iH} ${aH}`,className:`shrink-0 overflow-visible`,children:[a.length>1&&(0,F.jsx)(`polyline`,{points:a.map(({x:e,y:t})=>`${e},${t}`).join(` `),fill:`none`,stroke:`var(--muted-foreground)`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`}),o!==void 0&&(0,F.jsx)(`circle`,{cx:o.x,cy:o.y,r:3,fill:`var(--chart-1)`,stroke:`var(--background)`,strokeWidth:2})]})},lH=({value:e,unit:t,children:n})=>(0,F.jsxs)(`div`,{className:`contents`,children:[(0,F.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xl font-semibold`,children:e}),` `,(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t})]}),n]}),uH=({statistics:e})=>{let t=e.tasks.length,n=sH(e,(e,t)=>t.reduce((e,{firstTimeRight:t})=>e+t,0)/e),r=sH(e,(e,t)=>t.reduce((e,{operatorActions:t})=>e+t,0)/e);return(0,F.jsxs)(`div`,{className:`grid grid-cols-[auto_auto] items-center justify-start gap-x-8 gap-y-4`,children:[(0,F.jsx)(lH,{value:It(e.firstTimeRight,t),unit:`of tasks`,children:(0,F.jsx)(cH,{label:`First time right per period`,points:n,ceiling:1,format:e=>It(e,1)})}),(0,F.jsx)(lH,{value:Bt(e.operatorActions,t),unit:`operator actions per task`,children:(0,F.jsx)(cH,{label:`Operator actions per task per period`,points:r,ceiling:Math.max(1,...r.flatMap(({value:e})=>e===null?[]:[e])),format:e=>Bt(e,1)})})]})},dH=5,fH=(e,t)=>{let n=e.length>dH,r=[],i=0;for(let{loop:a,share:o}of t){let t=e.indexOf(a);n&&t>=4?i+=o:r.push({name:a,share:o,fill:`var(--loop-${Math.max(0,t)+1})`})}return i>0?[...r,{name:`other loops`,share:i,fill:`var(--loop-${dH})`}]:r},pH=e=>({name:`waiting`,share:e,fill:`var(--loop-waiting)`}),mH=({label:e,parts:t})=>{let[n,r]=(0,I.useState)(null),i=e=>n!==null&&n!==e;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,F.jsx)(`div`,{role:`img`,"aria-label":`${e}: ${t.map(({name:e,share:t})=>`${e} ${Lt(t)}`).join(`, `)}`,className:`flex h-3 gap-0.5 overflow-hidden rounded-sm`,onPointerLeave:()=>r(null),children:t.map(({name:e,share:t,fill:n})=>(0,F.jsx)(`div`,{className:E(`min-w-0.5 transition-opacity duration-(--duration-fast)`,i(e)&&`opacity-35`),style:{flexGrow:t,flexBasis:0,background:n},onPointerEnter:()=>r(e)},e))}),(0,F.jsx)(`ul`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,onPointerLeave:()=>r(null),children:t.map(({name:e,share:t,fill:n})=>(0,F.jsxs)(`li`,{className:E(`inline-flex items-center gap-1.5 tabular-nums transition-opacity duration-(--duration-fast)`,i(e)&&`opacity-50`),onPointerEnter:()=>r(e),children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-[2px]`,style:{background:n}}),(0,F.jsx)(`span`,{className:`text-foreground`,children:e}),Lt(t)]},e))})]})},hH=6e4,gH=60*hH,_H=24*gH,vH=[[hH,`1 min`],[15*hH,`15 min`],[gH,`1 h`],[4*gH,`4 h`],[_H,`1 d`],[7*_H,`1 w`],[28*_H,`4 w`]],yH=1.25,bH={task:{label:`task`,color:`var(--chart-1)`},tasks:{label:`tasks`,color:`var(--chart-1)`},median:{label:`median`,color:`var(--muted-foreground)`}},xH=e=>{let t=Math.min(...e),n=Math.max(...e),r=vH.filter(([e])=>e<=t).at(-1)??vH[0],i=vH.find(([e])=>e>=n)??vH.at(-1),a=r?.[0]??6e4,o=Math.max(i?.[0]??n,n);return{domain:[a/yH,o*yH],ticks:vH.filter(([e])=>e>=a&&e<=o).map(([e])=>e)}},SH=e=>vH.find(([t])=>t===e)?.[1]??Pt(e),CH=`grid min-w-24 gap-0.5 rounded-md bg-popover px-2.5 py-1.5 text-xs shadow-raised tabular-nums`,wH=(e,t)=>{let n=Math.ceil((t-e)/864e5)<=8?_H:7*_H,r=[];for(let i=e;i<t;i+=n)r.push(i);return r},TH=Math.PI*16,EH=Math.PI*144,DH=(e,t)=>t>1?`${e.repository} #${e.number}`:`#${e.number}`,OH=({statistics:e})=>{let t=S(),n=Date.parse(e.from),r=Date.parse(e.to),i=r-r%_H+_H,a=e.tasks.map(e=>({x:Date.parse(e.mergedAt),y:Math.max(hH,e.durationMillis),z:1,task:e})),o=xH(a.map(({y:e})=>e)),s=new Set(e.tasks.map(({repository:e})=>e)).size;return(0,F.jsx)(OV,{config:bH,className:`aspect-auto h-60 w-full`,children:(0,F.jsxs)(CV,{margin:{top:8,right:8,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),(0,F.jsx)(uz,{type:`number`,dataKey:`x`,scale:`time`,domain:[n,i],ticks:[...wH(n,i)],tickFormatter:e=>jt(e),tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:16}),(0,F.jsx)(Tz,{type:`number`,dataKey:`y`,scale:`log`,domain:o.domain,ticks:o.ticks,tickFormatter:SH,allowDataOverflow:!0,tickLine:!1,axisLine:!1,width:48}),(0,F.jsx)(DP,{y:Math.max(hH,e.medianMillis??6e4),stroke:`var(--color-median)`,strokeWidth:2}),(0,F.jsx)(AV,{cursor:!1,content:({active:e,payload:t})=>{let n=t?.[0]?.payload;return e===!0&&n!==void 0?(0,F.jsxs)(`div`,{className:CH,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:Pt(n.task.durationMillis)}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:DH(n.task,s)})]}):null}}),(0,F.jsx)(Oz,{zAxisId:`dot`,dataKey:`z`,range:[TH,TH]}),(0,F.jsx)(Oz,{zAxisId:`hit`,dataKey:`z`,range:[EH,EH]}),(0,F.jsx)(UR,{zAxisId:`dot`,data:[...a],fill:`var(--color-task)`,stroke:`var(--background)`,strokeWidth:2,isAnimationActive:!1}),(0,F.jsx)(UR,{zAxisId:`hit`,data:[...a],fill:`transparent`,className:`cursor-pointer`,isAnimationActive:!1,onClick:e=>{let n=e.payload?.task;n!==void 0&&t({to:`/projects/$owner/$name/tasks/$number`,params:{...y(n.repository),number:String(n.number)}})}})]})})},kH=({statistics:e})=>{let t=e.periods.map(({start:e,tasks:t,medianMillis:n})=>({start:e,tasks:t,median:n===null?null:Math.max(hH,n)})),n=xH(t.flatMap(({median:e})=>e===null?[]:[e])),r=(0,F.jsx)(uz,{dataKey:`start`,tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:24,tickFormatter:e=>At(e)}),i=(0,F.jsx)(AV,{cursor:{fill:`var(--muted)`,fillOpacity:.5},content:({active:e,payload:t})=>{let n=t?.[0]?.payload;return e===!0&&n!==void 0?(0,F.jsxs)(`div`,{className:CH,children:[(0,F.jsxs)(`span`,{className:`font-medium text-foreground`,children:[n.tasks,` `,n.tasks===1?`task`:`tasks`,n.median===null?``:`, median ${Pt(n.median)}`]}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:Mt(n.start,`week`)})]}):null}});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(OV,{config:bH,className:`aspect-auto h-28 w-full`,children:(0,F.jsxs)(xV,{data:t,margin:{top:4,right:8,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),r,(0,F.jsx)(Tz,{allowDecimals:!1,tickLine:!1,axisLine:!1,width:48}),i,(0,F.jsx)(uR,{dataKey:`tasks`,fill:`var(--color-tasks)`,radius:[4,4,0,0],maxBarSize:24,isAnimationActive:!1})]})}),(0,F.jsx)(OV,{config:bH,className:`aspect-auto h-36 w-full`,children:(0,F.jsxs)(yV,{data:t,margin:{top:8,right:8,bottom:0,left:0},children:[(0,F.jsx)(YF,{vertical:!1}),r,(0,F.jsx)(Tz,{scale:`log`,domain:n.domain,ticks:n.ticks,tickFormatter:SH,allowDataOverflow:!0,tickLine:!1,axisLine:!1,width:48}),i,(0,F.jsx)($I,{dataKey:`median`,stroke:`var(--color-median)`,strokeWidth:2,dot:{r:4,fill:`var(--color-median)`,stroke:`var(--background)`,strokeWidth:2},connectNulls:!0,isAnimationActive:!1})]})})]})},AH=({statistics:e})=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.bucket===`day`?(0,F.jsx)(OH,{statistics:e}):(0,F.jsx)(kH,{statistics:e}),(0,F.jsx)(FV,{caption:`Tasks done, time in usine`,head:[`Task`,`Merged`,`Duration`],rows:e.tasks.map(e=>[`${e.repository} #${e.number}`,jt(Date.parse(e.mergedAt)),Pt(e.durationMillis)])})]}),jH=({points:e})=>(0,F.jsxs)(`ul`,{className:`flex items-center gap-4 text-xs text-muted-foreground`,children:[(0,F.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:e===`dot`?`size-2 rounded-full bg-chart-1`:`size-2 rounded-[2px] bg-chart-1`}),e===`dot`?`task`:`tasks`]}),(0,F.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 w-3 rounded-full bg-muted-foreground`}),`median`]})]}),MH=[`7d`,`30d`,`all`],NH=e=>MH.some(t=>t===e),PH=({value:e,unit:t})=>(0,F.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xl font-semibold`,children:e}),` `,(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t})]}),FH=({title:e,className:t,children:n})=>(0,F.jsxs)(`section`,{className:E(`flex min-w-0 flex-col gap-3`,t),children:[(0,F.jsx)(`h3`,{className:`text-md font-medium`,children:e}),n]}),IH=({statistics:e})=>{let{time:t}=e;return(0,F.jsx)(FH,{title:`Time per task`,children:t===null?(0,F.jsx)(dt,{children:`No task with recorded attempt times`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(mH,{label:`Time per task`,parts:[...fH(e.loops,t.loops),pH(t.waiting)]}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:t.runs.map(({loop:e,medianMillis:t})=>(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`span`,{className:`text-foreground`,children:e}),` `,Ft(t)]},e))})]})})},LH=({statistics:e})=>{let{tokens:t}=e;return(0,F.jsx)(FH,{title:`Tokens per task`,children:t===null?(0,F.jsx)(dt,{children:`No token reports`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(PH,{value:pe(t.medianTokens),unit:`median`}),(0,F.jsx)(mH,{label:`Tokens per task`,parts:fH(e.loops,t.loops)})]})})},RH=({statistics:e})=>{if(e.tasks.length===0)return(0,F.jsx)(dt,{children:Vt(e.window)});let{tokens:t}=e,n=t?.cost??null,r=t===null?0:t.tasks-(n?.tasks??0),i=[e.untimed===null?null:Ht(e.untimed),e.unmetered===0?null:Ut(e.unmetered),r===0?null:Wt(r)].filter(e=>e!==null);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,F.jsxs)(`div`,{className:`grid gap-x-12 gap-y-9 lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]`,children:[(0,F.jsxs)(FH,{title:`Tasks done`,className:`lg:col-span-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-x-8 gap-y-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-8 gap-y-1`,children:[(0,F.jsx)(PH,{value:e.tasks.length.toLocaleString(`en`),unit:e.tasks.length===1?`task`:`tasks`}),e.medianMillis!==null&&(0,F.jsx)(PH,{value:Pt(e.medianMillis),unit:`median time in usine`}),n!==null&&(0,F.jsx)(PH,{value:`${n.estimate?`~`:``}${le(n.medianUsd)}`,unit:`median price`})]}),(0,F.jsx)(jH,{points:e.bucket===`day`?`dot`:`column`})]}),(0,F.jsx)(AH,{statistics:e})]}),(0,F.jsx)(IH,{statistics:e}),(0,F.jsx)(FH,{title:`First time right`,className:`lg:row-span-2`,children:(0,F.jsx)(uH,{statistics:e})}),(0,F.jsx)(LH,{statistics:e})]}),i.length>0&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.join(`; `)})]})},zH=()=>(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col gap-3`,children:[(0,F.jsx)(ze,{className:`h-4 w-24`}),(0,F.jsxs)(`div`,{className:`flex gap-8`,children:[(0,F.jsx)(ze,{className:`h-6 w-20`}),(0,F.jsx)(ze,{className:`h-6 w-40`})]}),(0,F.jsx)(ze,{className:`h-60 w-full`})]}),BH=()=>{let[e,t]=(0,I.useState)(`30d`),n=u(We(e)),r=n.data;return(0,F.jsx)(pt,{id:`desk-statistics`,title:`Statistics`,note:r===void 0?void 0:Nt(r.from,r.bucket),actions:(0,F.jsx)(_n,{"aria-label":`Statistics window`,variant:`outline`,size:`sm`,spacing:0,value:[e],onValueChange:([e])=>{NH(e)&&t(e)},children:MH.map(e=>(0,F.jsx)(vn,{value:e,children:Ot[e]},e))}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-6 pt-2`,children:[r===void 0?n.isError?(0,F.jsx)(c,{title:`Could not load the statistics`,message:n.error.message}):(0,F.jsx)(zH,{}):(0,F.jsxs)(`div`,{"aria-busy":n.isPlaceholderData,className:E(`transition-opacity duration-(--duration-fast)`,n.isPlaceholderData&&`opacity-60`),children:[n.isError&&(0,F.jsxs)(dt,{children:[`Could not refresh the statistics: `,n.error.message]}),(0,F.jsx)(RH,{statistics:r})]}),(0,F.jsx)(nH,{window:e})]})})},VH={Passed:{state:`Succeeded`,label:`passed`,className:void 0},Degraded:{state:`Waiting`,label:`degraded`,className:`text-run-waiting`},Deferred:{state:`Deferred`,label:`deferred`,className:void 0},Failed:{state:`Failed`,label:`failed`,className:`text-destructive`}},HH=({worker:e,now:t})=>{let n=e.preflight;if(n===null)return(0,F.jsx)(`span`,{children:`No preflight yet`});let{state:r,label:i,className:a}=VH[n._tag];return(0,F.jsxs)(`span`,{className:a,title:n._tag===`Passed`?ce(n.checkedAt):n.message,children:[(0,F.jsx)(Ye,{state:r,className:`mr-1.5 align-middle`}),`Preflight `,i,` `,he(n.checkedAt,t)]})},UH=({pause:e,now:t})=>(0,F.jsxs)(`span`,{className:`text-destructive`,title:e.message,children:[(0,F.jsx)(Ye,{state:`Failed`,className:`mr-1.5 align-middle`}),h(e),`.`,` `,(0,F.jsx)(`span`,{className:`tabular-nums`,children:_(e,t)})]}),WH=({workers:e,now:t})=>(0,F.jsxs)(`footer`,{"aria-label":`Workers`,className:`flex flex-wrap items-baseline gap-x-8 gap-y-1.5 border-t pt-3 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:`Workers`}),e.map(e=>(0,F.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-3`,children:[(0,F.jsx)(`span`,{className:`font-mono text-foreground`,children:e.name}),(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[e.slots.leased,` of `,e.slots.capacity,` `,e.slots.capacity===1?`slot`:`slots`,` in use`,e.machines.length>0&&`, ${e.machines.length} ${e.machines.length===1?`machine`:`machines`}`]}),(0,F.jsx)(HH,{worker:e,now:t}),e.provisioning?.blocked===!0&&(0,F.jsx)(UH,{pause:e.provisioning,now:t})]},e.name))]}),GH=()=>(0,F.jsxs)(`section`,{className:`flex flex-col items-start gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex max-w-prose flex-col gap-1`,children:[(0,F.jsx)(`h2`,{className:`text-md font-medium`,children:Xt.title}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:Xt.description})]}),(0,F.jsx)(ne,{variant:`outline`,render:(0,F.jsx)(C,{to:`/configuration/repositories`}),children:Xt.action})]}),KH=({needs:e,dismissedNeeds:t=[],polls:n,now:r})=>(0,F.jsxs)(pt,{id:`desk-needs-you`,title:`Needs attention`,count:e.length,countTone:`needs-you`,note:St(n,r)??void 0,children:[e.length===0?(0,F.jsx)(dt,{children:`Nothing needs attention`}):(0,F.jsx)(`ul`,{className:`grid grid-cols-1 items-start gap-2.5 lg:grid-cols-2`,children:e.map(e=>(0,F.jsx)(Ue,{need:e,compact:!1},e.id))}),(0,F.jsx)(vt,{needs:t})]}),qH=()=>{let{data:e}=m(v()),t=m(a()),n=qe(15e3),r=e._tag===`NeedsSetup`;return(0,F.jsx)(s,{width:`full`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-9 pb-2`,children:[(0,F.jsx)(o,{title:`Overview`,counts:Ct(t.data)}),e.projects.length===0&&(0,F.jsx)(GH,{}),(0,F.jsx)(BH,{}),(0,F.jsx)(KH,{dismissedNeeds:e.dismissedNeeds,needs:e.needsYou,polls:t.data.polls,now:n}),t.isError&&(0,F.jsx)(c,{title:`Could not refresh the overview`,message:t.error.message}),(0,F.jsx)(pt,{id:`desk-running`,title:`Running`,count:t.data.running.length,children:(0,F.jsx)(rn,{running:t.data.running,workers:t.data.workers,now:n})}),(0,F.jsx)(pt,{id:`desk-not-moving`,title:`Stalled`,count:t.data.notMoving.length,children:(0,F.jsx)(en,{stalled:t.data.notMoving,now:n,readOnly:r,polled:t.data.polls.some(({polledAt:e})=>e!==null)})}),(0,F.jsx)(pt,{id:`desk-outcomes`,title:`Recent runs`,children:(0,F.jsx)(Qt,{outcomes:t.data.lastOutcomes,now:n})}),t.data.workers.length>0&&(0,F.jsx)(WH,{workers:t.data.workers,now:n})]})})};export{qH as component};