unleash-server 7.6.2 → 7.6.4

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 (316) hide show
  1. package/dist/lib/db/client-applications-store.d.ts.map +1 -1
  2. package/dist/lib/db/client-applications-store.js +1 -0
  3. package/dist/lib/db/client-applications-store.js.map +1 -1
  4. package/dist/lib/db/client-applications-store.test.d.ts +2 -0
  5. package/dist/lib/db/client-applications-store.test.d.ts.map +1 -0
  6. package/dist/lib/db/client-applications-store.test.js +134 -0
  7. package/dist/lib/db/client-applications-store.test.js.map +1 -0
  8. package/dist/lib/db/index.js +2 -2
  9. package/dist/lib/db/index.js.map +1 -1
  10. package/dist/lib/events/index.d.ts +2 -1
  11. package/dist/lib/events/index.d.ts.map +1 -1
  12. package/dist/lib/events/index.js +2 -0
  13. package/dist/lib/events/index.js.map +1 -1
  14. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta-types.d.ts +1 -1
  15. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta-types.d.ts.map +1 -1
  16. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta-types.js +2 -3
  17. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta-types.js.map +1 -1
  18. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.d.ts +3 -3
  19. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.d.ts.map +1 -1
  20. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.js +77 -27
  21. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.js.map +1 -1
  22. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.test.js +566 -20
  23. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.test.js.map +1 -1
  24. package/dist/lib/features/client-feature-toggles/delta/visible-revision.d.ts +3 -1
  25. package/dist/lib/features/client-feature-toggles/delta/visible-revision.d.ts.map +1 -1
  26. package/dist/lib/features/client-feature-toggles/delta/visible-revision.js +26 -3
  27. package/dist/lib/features/client-feature-toggles/delta/visible-revision.js.map +1 -1
  28. package/dist/lib/features/client-feature-toggles/delta/visible-revision.test.js +9 -1
  29. package/dist/lib/features/client-feature-toggles/delta/visible-revision.test.js.map +1 -1
  30. package/dist/lib/features/events/event-store.d.ts +1 -1
  31. package/dist/lib/features/events/event-store.d.ts.map +1 -1
  32. package/dist/lib/features/events/event-store.js +26 -4
  33. package/dist/lib/features/events/event-store.js.map +1 -1
  34. package/dist/lib/features/frontend-api/createFrontendApiService.d.ts.map +1 -1
  35. package/dist/lib/features/frontend-api/createFrontendApiService.js +3 -10
  36. package/dist/lib/features/frontend-api/createFrontendApiService.js.map +1 -1
  37. package/dist/lib/features/index.d.ts +1 -0
  38. package/dist/lib/features/index.d.ts.map +1 -1
  39. package/dist/lib/features/index.js +1 -0
  40. package/dist/lib/features/index.js.map +1 -1
  41. package/dist/lib/features/instance-stats/createInstanceStatsService.js +2 -2
  42. package/dist/lib/features/instance-stats/createInstanceStatsService.js.map +1 -1
  43. package/dist/lib/features/maintenance/maintenance-service.d.ts +1 -1
  44. package/dist/lib/features/maintenance/maintenance-service.d.ts.map +1 -1
  45. package/dist/lib/features/maintenance/maintenance-service.test.js +2 -2
  46. package/dist/lib/features/maintenance/maintenance-service.test.js.map +1 -1
  47. package/dist/lib/features/onboarding/createOnboardingReadModel.d.ts +2 -3
  48. package/dist/lib/features/onboarding/createOnboardingReadModel.d.ts.map +1 -1
  49. package/dist/lib/features/onboarding/createOnboardingReadModel.js +2 -2
  50. package/dist/lib/features/onboarding/createOnboardingReadModel.js.map +1 -1
  51. package/dist/lib/features/onboarding/onboarding-read-model.d.ts +3 -1
  52. package/dist/lib/features/onboarding/onboarding-read-model.d.ts.map +1 -1
  53. package/dist/lib/features/onboarding/onboarding-read-model.js +17 -2
  54. package/dist/lib/features/onboarding/onboarding-read-model.js.map +1 -1
  55. package/dist/lib/features/personal-dashboard/createPersonalDashboardService.js +1 -1
  56. package/dist/lib/features/personal-dashboard/createPersonalDashboardService.js.map +1 -1
  57. package/dist/lib/features/project/createProjectService.js +1 -1
  58. package/dist/lib/features/project/createProjectService.js.map +1 -1
  59. package/dist/lib/features/project/projects.e2e.test.js +48 -0
  60. package/dist/lib/features/project/projects.e2e.test.js.map +1 -1
  61. package/dist/lib/features/scheduler/scheduler-service.test.js +2 -2
  62. package/dist/lib/features/scheduler/scheduler-service.test.js.map +1 -1
  63. package/dist/lib/features/settings/createSettingService.d.ts +6 -0
  64. package/dist/lib/features/settings/createSettingService.d.ts.map +1 -0
  65. package/dist/lib/features/settings/createSettingService.js +15 -0
  66. package/dist/lib/features/settings/createSettingService.js.map +1 -0
  67. package/dist/{test/fixtures → lib/features/settings}/fake-setting-store.d.ts +1 -1
  68. package/dist/lib/features/settings/fake-setting-store.d.ts.map +1 -0
  69. package/dist/lib/features/settings/fake-setting-store.js.map +1 -0
  70. package/dist/lib/{services → features/settings}/setting-service.d.ts +4 -4
  71. package/dist/lib/features/settings/setting-service.d.ts.map +1 -0
  72. package/dist/lib/features/settings/setting-service.e2e.test.d.ts +2 -0
  73. package/dist/lib/features/settings/setting-service.e2e.test.d.ts.map +1 -0
  74. package/dist/{test/e2e/services/setting-service.test.js → lib/features/settings/setting-service.e2e.test.js} +7 -7
  75. package/dist/lib/features/settings/setting-service.e2e.test.js.map +1 -0
  76. package/dist/lib/{services → features/settings}/setting-service.js +2 -2
  77. package/dist/lib/features/settings/setting-service.js.map +1 -0
  78. package/dist/lib/{db → features/settings}/setting-store.d.ts +3 -3
  79. package/dist/lib/features/settings/setting-store.d.ts.map +1 -0
  80. package/dist/lib/features/settings/setting-store.e2e.test.d.ts.map +1 -0
  81. package/dist/{test/e2e/stores → lib/features/settings}/setting-store.e2e.test.js +2 -2
  82. package/dist/lib/features/settings/setting-store.e2e.test.js.map +1 -0
  83. package/dist/lib/features/settings/setting-store.js.map +1 -0
  84. package/dist/lib/{types/stores/settings-store.d.ts → features/settings/settings-store-type.d.ts} +2 -2
  85. package/dist/lib/features/settings/settings-store-type.d.ts.map +1 -0
  86. package/dist/lib/features/settings/settings-store-type.js +2 -0
  87. package/dist/lib/features/settings/settings-store-type.js.map +1 -0
  88. package/dist/lib/features/users/createUserService.d.ts.map +1 -1
  89. package/dist/lib/features/users/createUserService.js +3 -4
  90. package/dist/lib/features/users/createUserService.js.map +1 -1
  91. package/dist/lib/middleware/cors-origin-middleware.test.js +1 -1
  92. package/dist/lib/middleware/cors-origin-middleware.test.js.map +1 -1
  93. package/dist/lib/openapi/spec/context-query-parameters.d.ts +1 -1
  94. package/dist/lib/openapi/spec/context-query-parameters.d.ts.map +1 -1
  95. package/dist/lib/openapi/spec/event-schema.d.ts +1 -1
  96. package/dist/lib/openapi/spec/event-search-response-schema.d.ts +1 -1
  97. package/dist/lib/openapi/spec/events-schema.d.ts +1 -1
  98. package/dist/lib/openapi/spec/feature-events-schema.d.ts +1 -1
  99. package/dist/lib/openapi/spec/integration-event-schema.d.ts +1 -1
  100. package/dist/lib/openapi/spec/integration-events-schema.d.ts +2 -2
  101. package/dist/lib/openapi/spec/personal-dashboard-project-details-schema.d.ts +1 -1
  102. package/dist/lib/openapi/spec/project-overview-schema.d.ts +1 -1
  103. package/dist/lib/openapi/spec/project-overview-schema.d.ts.map +1 -1
  104. package/dist/lib/openapi/spec/project-overview-schema.js +5 -1
  105. package/dist/lib/openapi/spec/project-overview-schema.js.map +1 -1
  106. package/dist/lib/server-impl.d.ts +4 -4
  107. package/dist/lib/server-impl.d.ts.map +1 -1
  108. package/dist/lib/server-impl.js +2 -2
  109. package/dist/lib/server-impl.js.map +1 -1
  110. package/dist/lib/services/index.d.ts +1 -1
  111. package/dist/lib/services/index.d.ts.map +1 -1
  112. package/dist/lib/services/index.js +1 -1
  113. package/dist/lib/services/index.js.map +1 -1
  114. package/dist/lib/services/scheduler-service.test.js +2 -2
  115. package/dist/lib/services/scheduler-service.test.js.map +1 -1
  116. package/dist/lib/services/user-service.d.ts +1 -1
  117. package/dist/lib/services/user-service.d.ts.map +1 -1
  118. package/dist/lib/services/user-service.test.js +2 -2
  119. package/dist/lib/services/user-service.test.js.map +1 -1
  120. package/dist/lib/types/experimental.d.ts +1 -1
  121. package/dist/lib/types/experimental.d.ts.map +1 -1
  122. package/dist/lib/types/experimental.js +4 -3
  123. package/dist/lib/types/experimental.js.map +1 -1
  124. package/dist/lib/types/model.d.ts +1 -1
  125. package/dist/lib/types/model.d.ts.map +1 -1
  126. package/dist/lib/types/stores/client-applications-store.d.ts +1 -0
  127. package/dist/lib/types/stores/client-applications-store.d.ts.map +1 -1
  128. package/dist/lib/types/stores/event-store.d.ts +3 -2
  129. package/dist/lib/types/stores/event-store.d.ts.map +1 -1
  130. package/dist/lib/types/stores.d.ts +1 -1
  131. package/dist/lib/types/stores.d.ts.map +1 -1
  132. package/dist/lib/util/postgres-version-checker.test.js +1 -1
  133. package/dist/lib/util/postgres-version-checker.test.js.map +1 -1
  134. package/dist/server-dev.js +1 -1
  135. package/dist/server-dev.js.map +1 -1
  136. package/dist/test/e2e/api/auth/reset-password-controller.e2e.test.js +2 -2
  137. package/dist/test/e2e/api/auth/reset-password-controller.e2e.test.js.map +1 -1
  138. package/dist/test/e2e/api/auth/simple-password-provider.e2e.test.js +1 -1
  139. package/dist/test/e2e/api/auth/simple-password-provider.e2e.test.js.map +1 -1
  140. package/dist/test/e2e/services/reset-token-service.e2e.test.js +2 -2
  141. package/dist/test/e2e/services/reset-token-service.e2e.test.js.map +1 -1
  142. package/dist/test/e2e/services/user-service.e2e.test.js +1 -1
  143. package/dist/test/e2e/services/user-service.e2e.test.js.map +1 -1
  144. package/dist/test/e2e/stores/event-store.e2e.test.js +28 -4
  145. package/dist/test/e2e/stores/event-store.e2e.test.js.map +1 -1
  146. package/dist/test/e2e/users/inactive/inactive-users-service.test.js +1 -1
  147. package/dist/test/e2e/users/inactive/inactive-users-service.test.js.map +1 -1
  148. package/dist/test/fixtures/fake-client-applications-store.d.ts +1 -0
  149. package/dist/test/fixtures/fake-client-applications-store.d.ts.map +1 -1
  150. package/dist/test/fixtures/fake-client-applications-store.js +3 -0
  151. package/dist/test/fixtures/fake-client-applications-store.js.map +1 -1
  152. package/dist/test/fixtures/fake-event-store.d.ts +3 -2
  153. package/dist/test/fixtures/fake-event-store.d.ts.map +1 -1
  154. package/dist/test/fixtures/fake-event-store.js +3 -2
  155. package/dist/test/fixtures/fake-event-store.js.map +1 -1
  156. package/dist/test/fixtures/fake-impact-metrics.d.ts +2 -7
  157. package/dist/test/fixtures/fake-impact-metrics.d.ts.map +1 -1
  158. package/dist/test/fixtures/fake-impact-metrics.js.map +1 -1
  159. package/dist/test/fixtures/store.js +1 -1
  160. package/dist/test/fixtures/store.js.map +1 -1
  161. package/dist/test-setup.d.ts.map +1 -1
  162. package/dist/test-setup.js +3 -1
  163. package/dist/test-setup.js.map +1 -1
  164. package/frontend/build/index.html +2 -2
  165. package/frontend/build/static/AdvancedPlayground-V8umnmfG.js +3 -0
  166. package/frontend/build/static/BackendConnections-Cnrrjtsn.js +1 -0
  167. package/frontend/build/static/CreateProject-e6oazDvk.js +1 -0
  168. package/frontend/build/static/EnterpriseEdge-DBAPcWwZ.js +6 -0
  169. package/frontend/build/static/FeatureMetricsChart-CKOQrO5t.js +2 -0
  170. package/frontend/build/static/FeatureStaleDialog-BfIPQAKa.js +689 -0
  171. package/frontend/build/static/FeatureViewLazyExport-TYU7Gf7Q.js +11 -0
  172. package/frontend/build/static/FlagMetricsChart-D1Fksr08.js +2 -0
  173. package/frontend/build/static/FrontendNetworkTrafficUsage-NjIKHiwN.js +1 -0
  174. package/frontend/build/static/GridLayoutWrapper-CN2Zeusb.js +3 -0
  175. package/frontend/build/static/ImpactMetricsPage-PU6tVGs8.js +1 -0
  176. package/frontend/build/static/LazyAdminExport-7jFrQoFr.js +38 -0
  177. package/frontend/build/static/LazyProjectExport-DUuBB2EA.js +46 -0
  178. package/frontend/build/static/LifecycleChartComponent-LoQvj2mM.js +2 -0
  179. package/frontend/build/static/LineChartComponent-C2nacZSy.js +1 -0
  180. package/frontend/build/static/MarkCompletedDialogue-x4B5vgpn.js +1 -0
  181. package/frontend/build/static/NetworkOverview-DRDwkRie.js +1 -0
  182. package/frontend/build/static/NetworkPrometheusAPIWarning-DxrGyF-4.js +1 -0
  183. package/frontend/build/static/NetworkTraffic-DBNI6tQ4.js +1 -0
  184. package/frontend/build/static/NetworkTrafficUsage-Cp7LXHBW.js +1 -0
  185. package/frontend/build/static/PercentageDonut-DxYx2sDT.js +1 -0
  186. package/frontend/build/static/ReactJSONEditor-EiPmcfsb.js +3846 -0
  187. package/frontend/build/static/RoleCell-DPCs9tBq.js +1 -0
  188. package/frontend/build/static/Safeguard-B2SRkWlK.js +1 -0
  189. package/frontend/build/static/aggregateFeatureMetrics-B--WhUm6.js +1 -0
  190. package/frontend/build/static/chart-BMc0j_v5.js +3 -0
  191. package/frontend/build/static/chartjs-plugin-annotation.esm-CII-nIyK.js +1 -0
  192. package/frontend/build/static/daysOrHours-CWsdHL8Z.js +1 -0
  193. package/frontend/build/static/dist-CYYjHgCS.js +12 -0
  194. package/frontend/build/static/enterpriseEdgeCloud-DI6o2DkU.js +1 -0
  195. package/frontend/build/static/formatTickValue-DHdXPo89.js +1 -0
  196. package/frontend/build/static/helpers-Dz6x6iMP.js +1 -0
  197. package/frontend/build/static/index-B0RbDPtk.js +403 -0
  198. package/frontend/build/static/jsx-runtime-ButemYzH.js +1 -0
  199. package/frontend/build/static/networkTrafficUsageHighlightPlugin-ecHJHisK.js +1 -0
  200. package/frontend/build/static/objectId-D7ukzTLu.js +1 -0
  201. package/frontend/build/static/style-D9DNbuD5.css +2 -0
  202. package/frontend/build/static/toDate-zSA17Csy.js +1 -0
  203. package/frontend/build/static/unknownify-D1gvOkgV.js +1 -0
  204. package/frontend/build/static/useApiTokens-Cl4y9yhp.js +1 -0
  205. package/frontend/build/static/useInstanceTrafficMetrics--5pof2Er.js +1 -0
  206. package/frontend/build/static/vanilla-picker-DhahMYgI.js +2 -0
  207. package/frontend/package.json +18 -15
  208. package/package.json +9 -9
  209. package/dist/lib/db/setting-store.d.ts.map +0 -1
  210. package/dist/lib/db/setting-store.js.map +0 -1
  211. package/dist/lib/services/setting-service.d.ts.map +0 -1
  212. package/dist/lib/services/setting-service.js.map +0 -1
  213. package/dist/lib/types/stores/settings-store.d.ts.map +0 -1
  214. package/dist/lib/types/stores/settings-store.js +0 -2
  215. package/dist/lib/types/stores/settings-store.js.map +0 -1
  216. package/dist/test/e2e/services/setting-service.test.d.ts +0 -2
  217. package/dist/test/e2e/services/setting-service.test.d.ts.map +0 -1
  218. package/dist/test/e2e/services/setting-service.test.js.map +0 -1
  219. package/dist/test/e2e/stores/setting-store.e2e.test.d.ts.map +0 -1
  220. package/dist/test/e2e/stores/setting-store.e2e.test.js.map +0 -1
  221. package/dist/test/fixtures/fake-setting-store.d.ts.map +0 -1
  222. package/dist/test/fixtures/fake-setting-store.js.map +0 -1
  223. package/frontend/build/static/24_Text format off-fTw1GZh5.svg +0 -3
  224. package/frontend/build/static/24_Text format-CsA8QQJI.svg +0 -3
  225. package/frontend/build/static/AdvancedPlayground-BTPrG6RW.js +0 -3
  226. package/frontend/build/static/BackendConnections-CRh8Vxoe.js +0 -1
  227. package/frontend/build/static/CreateProject-DEMalH1j.js +0 -1
  228. package/frontend/build/static/EnterpriseEdge-Cp-pGMa0.js +0 -6
  229. package/frontend/build/static/FeatureMetricsChart-DQOE71LA.js +0 -2
  230. package/frontend/build/static/FeatureStaleDialog-B6BfnDiQ.js +0 -689
  231. package/frontend/build/static/FeatureViewLazyExport-BkNTNFqK.js +0 -10
  232. package/frontend/build/static/FlagMetricsChart-zYDF9bet.js +0 -2
  233. package/frontend/build/static/FrontendNetworkTrafficUsage-CbxdFXH7.js +0 -1
  234. package/frontend/build/static/GridLayoutWrapper-Cq6Bzm36.js +0 -3
  235. package/frontend/build/static/ImpactMetricsPage-CFYXYXPb.js +0 -1
  236. package/frontend/build/static/LazyAdminExport-ByTh4iFa.js +0 -38
  237. package/frontend/build/static/LazyProjectExport-K12Xy3w9.js +0 -46
  238. package/frontend/build/static/LifecycleChartComponent-DHvlFNd2.js +0 -7
  239. package/frontend/build/static/LineChartComponent-BlhKm3cw.js +0 -1
  240. package/frontend/build/static/MarkCompletedDialogue-apmlFjVY.js +0 -1
  241. package/frontend/build/static/NetworkOverview-BiLOuQ4c.js +0 -1
  242. package/frontend/build/static/NetworkPrometheusAPIWarning-CYo3j2Tj.js +0 -1
  243. package/frontend/build/static/NetworkTraffic-DONL5oIx.js +0 -1
  244. package/frontend/build/static/NetworkTrafficUsage-DjQiYq0S.js +0 -1
  245. package/frontend/build/static/PercentageDonut-CA9hYg3v.js +0 -1
  246. package/frontend/build/static/ReactJSONEditor-9cJL1vJY.js +0 -3864
  247. package/frontend/build/static/RoleCell-ZzU5Oqy8.js +0 -1
  248. package/frontend/build/static/Safeguard-DY1N4aPz.js +0 -1
  249. package/frontend/build/static/aggregateFeatureMetrics-D6bHft_C.js +0 -1
  250. package/frontend/build/static/arrowLeft-CLDXfK18.svg +0 -10
  251. package/frontend/build/static/arrowRight-CPIADLBv.svg +0 -10
  252. package/frontend/build/static/case-insensitive-CuU5weZd.svg +0 -1
  253. package/frontend/build/static/case-sensitive-D19NntKP.svg +0 -1
  254. package/frontend/build/static/changeRequestProcessWithSchedule-BmvIIWQK.svg +0 -1
  255. package/frontend/build/static/constraint-equals-giGu3HWQ.svg +0 -1
  256. package/frontend/build/static/constraint-not-equals-CJGG9pRv.svg +0 -1
  257. package/frontend/build/static/docker-HG7DQx-Z.svg +0 -5
  258. package/frontend/build/static/email-D1NVbpvG.svg +0 -17
  259. package/frontend/build/static/enterpriseEdgeCloud-DzRtm8v6.svg +0 -58
  260. package/frontend/build/static/enterpriseEdgeSelfHosted-4bnmOQVF.svg +0 -44
  261. package/frontend/build/static/formatTickValue-BcLsqREh.js +0 -6
  262. package/frontend/build/static/heart-FRDdnX3J.svg +0 -3
  263. package/frontend/build/static/impact-metrics-icon-a6_57VN1.svg +0 -9
  264. package/frontend/build/static/import-zkumD9Zv.svg +0 -3
  265. package/frontend/build/static/index-B87DWXbl.js +0 -12
  266. package/frontend/build/static/index-CoLhlfXP.js +0 -565
  267. package/frontend/build/static/instance-health-BtMrnXEj.svg +0 -5
  268. package/frontend/build/static/isenabled-false-Bx8bRzGD.svg +0 -5
  269. package/frontend/build/static/isenabled-true-BARsh3fa.svg +0 -5
  270. package/frontend/build/static/lenovo-DIzNtfrT.svg +0 -3
  271. package/frontend/build/static/lloyds-DxlC9g3t.svg +0 -10
  272. package/frontend/build/static/logo-BpeRJ1SV.svg +0 -7
  273. package/frontend/build/static/logoBg-DDUbF9lh.svg +0 -1
  274. package/frontend/build/static/logoDark-CknUTJYV.svg +0 -1
  275. package/frontend/build/static/logoDarkWithText-D0ImZCxR.svg +0 -1
  276. package/frontend/build/static/logoWhiteBg-CwoWCg7m.svg +0 -1
  277. package/frontend/build/static/logoWhiteTransparentHorizontal-5xxVCWh8.svg +0 -1
  278. package/frontend/build/static/logoWithWhiteText-Dz7VvON3.svg +0 -1
  279. package/frontend/build/static/milestone-C0FnRl9y.svg +0 -3
  280. package/frontend/build/static/mobileGuidanceBg-D9dRgnhs.svg +0 -3
  281. package/frontend/build/static/networkTrafficUsageHighlightPlugin-CqEM-cK_.js +0 -1
  282. package/frontend/build/static/new-feature-badge-FwMmHlwT.svg +0 -7
  283. package/frontend/build/static/not_operator_selected-jLHDQXLO.svg +0 -5
  284. package/frontend/build/static/not_operator_unselected-C-130FKT.svg +0 -3
  285. package/frontend/build/static/pro-enterprise-feature-badge-PZ3Bfajk.svg +0 -7
  286. package/frontend/build/static/pro-enterprise-feature-badge-light-k8Z592E8.svg +0 -6
  287. package/frontend/build/static/projectIconSmall-USf1kO_6.svg +0 -5
  288. package/frontend/build/static/projectStatus-BQym9o3t.svg +0 -3
  289. package/frontend/build/static/releaseTemplates-GIHEC4g-.svg +0 -39
  290. package/frontend/build/static/rollout-DAvS9K1l.svg +0 -4
  291. package/frontend/build/static/samsung-DOytOsnV.svg +0 -10
  292. package/frontend/build/static/signals-Bg0cQEqp.svg +0 -21
  293. package/frontend/build/static/stage-archived-DVpSnWM_.svg +0 -12
  294. package/frontend/build/static/stage-completed-BqA7cOHN.svg +0 -10
  295. package/frontend/build/static/stage-created-IXXGyXPL.svg +0 -5
  296. package/frontend/build/static/stage-live-CnCQFmyK.svg +0 -9
  297. package/frontend/build/static/stage-prelive-BLsuhDY7.svg +0 -7
  298. package/frontend/build/static/stars-C5lq_xha.svg +0 -9
  299. package/frontend/build/static/strategyCustom-Db-ZtYWl.svg +0 -23
  300. package/frontend/build/static/strategyDefault-LnSyH2eZ.svg +0 -17
  301. package/frontend/build/static/strategyGradual-oCA99tj3.svg +0 -18
  302. package/frontend/build/static/strategyHosts-4lVYC2Bf.svg +0 -23
  303. package/frontend/build/static/strategyIPs-BHaXsOYV.svg +0 -24
  304. package/frontend/build/static/strategyOn-CX-xL0oK.svg +0 -18
  305. package/frontend/build/static/style-BfdqROT6.css +0 -1
  306. package/frontend/build/static/unknownify-B7hmSXnj.js +0 -1
  307. package/frontend/build/static/unleashHoliday-CQEG77-1.svg +0 -33
  308. package/frontend/build/static/unleashHolidayDark-B9sYfzSK.svg +0 -33
  309. package/frontend/build/static/usage-line-BHicDx-Y.svg +0 -3
  310. package/frontend/build/static/usage-rate-DnXQhqDI.svg +0 -3
  311. package/frontend/build/static/useApiTokens-ClWvohC9.js +0 -1
  312. package/frontend/build/static/vanilla-picker-B6E6ObS_.js +0 -8
  313. package/frontend/build/static/visa-CkneNM2O.svg +0 -10
  314. /package/dist/{test/fixtures → lib/features/settings}/fake-setting-store.js +0 -0
  315. /package/dist/{test/e2e/stores → lib/features/settings}/setting-store.e2e.test.d.ts +0 -0
  316. /package/dist/lib/{db → features/settings}/setting-store.js +0 -0
@@ -0,0 +1 @@
1
+ import{n as e,s as t,t as n}from"./jsx-runtime-ButemYzH.js";import{$l as r,Ac as i,Al as a,An as o,Bu as s,Ci as c,Cl as l,Cs as u,Cu as d,Da as f,Dn as p,Es as m,Ia as h,Iu as g,Ji as _,Js as v,Ks as ee,La as te,Md as ne,Nd as re,Ns as ie,Nu as y,Ol as b,Oo as ae,Ps as x,Qs as oe,Qt as se,Si as S,Ss as C,Su as ce,Ta as le,Td as ue,Ts as w,Ui as de,Vi as fe,Ws as pe,Xd as T,Xn as E,Xu as D,Ys as O,Yu as k,Zi as A,Zs as me,_d as he,ad as ge,ec as _e,fu as j,gu as ve,hu as ye,id as M,jd as N,kc as P,mi as be,mu as F,nf as xe,pu as Se,qc as Ce,qs as I,rd as L,tc as R,tu as we,vd as Te,ws as Ee,xd as z,xi as De,xo as B,yu as Oe,zs as ke,zu as Ae}from"./index-B0RbDPtk.js";import{t as je}from"./useApiTokens-Cl4y9yhp.js";var V=t(e());function Me(e){return ne(`MuiTableContainer`,e)}N(`MuiTableContainer`,[`root`]);var H=n(),Ne=e=>{let{classes:t}=e;return ue({root:[`root`]},Me,t)},Pe=z(`div`,{name:`MuiTableContainer`,slot:`Root`,overridesResolver:(e,t)=>t.root})({width:`100%`,overflowX:`auto`}),Fe=V.forwardRef(function(e,t){let n=Te({props:e,name:`MuiTableContainer`}),{className:r,component:i=`div`,...a}=n,o={...n,component:i};return(0,H.jsx)(Pe,{ref:t,as:i,className:re(Ne(o).root,r),ownerState:o,...a})}),Ie=()=>(0,H.jsx)(M,{severity:`info`,children:(0,H.jsxs)(`p`,{children:[`Read the`,` `,(0,H.jsx)(`a`,{href:`https://docs.getunleash.io/sdks`,target:`_blank`,rel:`noreferrer`,children:`SDK overview`}),` `,`to connect Unleash to your application. Please note it can take up to `,(0,H.jsx)(`strong`,{children:`1 minute`}),` before a new API key is activated.`]})}),U=t(_(),1),W=({title:e,url:t})=>{let{setToastData:n}=x();return(0,H.jsxs)(j,{children:[(0,H.jsx)(F,{component:`th`,scope:`row`,children:e}),(0,H.jsx)(F,{children:(0,H.jsx)(`pre`,{style:{display:`inline`},children:t})}),(0,H.jsx)(F,{align:`center`,children:(0,H.jsx)(Oe,{title:`Copy URL`,arrow:!0,children:(0,H.jsx)(ge,{onClick:(e=>()=>{(0,U.default)(e),n({type:`success`,text:`Copied to clipboard`})})(t),size:`small`,"aria-label":`Copy ${e} to clipboard`,children:(0,H.jsx)(A,{})})})})]})},G=z(F)(({theme:e})=>({color:e.palette.text.secondary})),Le=({compact:e})=>{let{uiConfig:t}=P(),[n,r]=(0,V.useState)(!e),i=t.unleashUrl&&(n||!t.edgeUrl),a=e&&t.edgeUrl&&t.unleashUrl,o=t.edgeUrl?{edgeUrl:`${t.edgeUrl}/api/`,edgeFrontendUrl:`${t.edgeUrl}/api/frontend/`}:void 0,s=`${t.unleashUrl}/api/`,c=`${t.unleashUrl}/api/frontend/`;return(0,H.jsxs)(Fe,{role:`region`,"aria-live":`polite`,children:[(0,H.jsxs)(ve,{"aria-label":`API URLs`,id:`api-urls-table`,children:[(0,H.jsx)(Se,{children:(0,H.jsxs)(j,{children:[(0,H.jsx)(G,{children:`Type`}),(0,H.jsx)(G,{children:`URL`}),(0,H.jsx)(G,{align:`center`,children:`Actions`})]})}),(0,H.jsxs)(ye,{children:[o&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W,{title:`Edge Backend`,url:o.edgeUrl}),(0,H.jsx)(W,{title:`Edge Frontend`,url:o.edgeFrontendUrl})]}),i&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W,{title:`Backend`,url:s}),(0,H.jsx)(W,{title:`Frontend`,url:c})]})]})]}),a&&(0,H.jsx)(k,{sx:{mt:1,marginInline:1.5},variant:`text`,size:`small`,"aria-expanded":n,"aria-controls":`api-urls-table`,onClick:()=>r(!n),children:n?`Show less`:`Show all`})]})},Re=[`Icon`,`createdAt`,`seenAt`],ze=[`Icon`,`project`,`seenAt`],K=z(L)(({theme:e})=>({margin:0,marginBottom:e.spacing(1.5),fontSize:e.fontSizes.smallBody,color:e.palette.text.primary})),Be=({compact:e=!1,setHiddenColumns:t,columns:n,loading:i,rows:a,headerGroups:o,globalFilter:s,prepareRow:c})=>(p([{condition:g(we.breakpoints.down(`xl`)),columns:Re},{condition:e,columns:ze}],t,n),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r,{condition:a.length>0,show:(0,H.jsxs)(D,{sx:{mb:4},children:[(0,H.jsx)(Ie,{}),(0,H.jsxs)(D,{sx:{marginBlock:4},children:[(0,H.jsx)(K,{variant:`h2`,children:`API URLs`}),(0,H.jsx)(Le,{compact:e})]})]})}),(0,H.jsxs)(D,{sx:{overflowX:`auto`},children:[(0,H.jsx)(K,{variant:`h2`,children:`API Tokens`}),(0,H.jsx)(me,{value:s,children:(0,H.jsx)(_e,{rows:a,headerGroups:o,prepareRow:c})})]}),(0,H.jsx)(r,{condition:a.length===0&&!i,show:(0,H.jsx)(r,{condition:s?.length>0,show:(0,H.jsxs)(R,{children:[`No tokens found matching “`,s,`”`]}),elseShow:(0,H.jsx)(R,{children:(0,H.jsxs)(`span`,{children:[`No tokens available. Read `,(0,H.jsx)(y,{href:`https://docs.getunleash.io/api-overview`,target:`_blank`,rel:`noreferrer`,children:`API How-to guides`}),` `,` to learn more.`]})})})})]})),Ve=(e,t)=>{let n=t>=e;return{limitReached:n,limitMessage:n?`You have reached the limit of ${e} API tokens`:void 0}},He=({path:e,permission:t,project:n})=>{let r=xe(),{tokens:i,loading:a}=je(),{uiConfig:o}=P(),{limitReached:s,limitMessage:c}=Ve(o.resourceLimits.apiTokens,i.length);return(0,H.jsx)(De,{Icon:te,onClick:()=>r(e),"data-testid":Ce,permission:t,projectId:n,maxWidth:`700px`,disabled:a||s,tooltipProps:{title:c},children:`New API token`})},q=ke(),Ue=z(T)(({theme:e})=>({textDecoration:`none`,color:e.palette.links,"&:hover, &:focus":{textDecoration:`underline`}})),We=z(`div`)({display:`flex`,alignItems:`center`}),Ge=({projects:e,project:t})=>{let{searchQuery:n}=oe(),r=e&&Array.isArray(e)&&e.length>1?e:[];if(r.length>0)return(0,H.jsx)(O,{children:(0,H.jsx)(l,{title:r.map((e,t)=>(0,H.jsxs)(V.Fragment,{children:[t>0&&`, `,!e||e===`*`?(0,H.jsx)(I,{search:n,children:`*`}):(0,H.jsx)(Ue,{to:`/projects/${e}`,children:(0,H.jsx)(I,{search:n,children:e})})]},e)),placement:`bottom-start`,arrow:!0,tabIndex:0,children:(0,H.jsxs)(`span`,{children:[`${r.length}`,` projects`]})})});if(r.length===1&&r[0]!==`*`||t&&t!==`*`){let e=t||r[0];return(0,H.jsx)(pe,{to:`/projects/${e}`,title:e})}return(0,H.jsx)(O,{children:(0,H.jsx)(l,{title:`ALL current and future projects.`,placement:`bottom`,arrow:!0,children:(0,H.jsx)(We,{children:(0,H.jsx)(I,{search:n,children:`*`})})})})},J=he((0,H.jsx)(`path`,{d:`M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3`}),`Key`),Ke=({secret:e,project:t,projects:n})=>{let r=e?.includes(`:`)?`v2`:`v1`,i=e?.startsWith(`*:`),a=n&&n?.length>1||n?.length===1&&n[0]!==`*`||t&&t!==`*`;return r===`v2`&&!i&&!a},qe=({...e})=>Ke(e)?(0,H.jsx)(E,{icon:(0,H.jsx)(l,{title:(0,H.jsxs)(`p`,{children:[`This is an orphaned token. All of its original projects have been deleted and it now has access to all current and future projects. You should stop using this token and delete it. Read more in`,` `,(0,H.jsx)(y,{target:`_blank`,rel:`noopener noreferrer`,href:`https://github.com/Unleash/unleash/releases/tag/v6.1.0`,children:`release notes`}),`.`]}),placement:`bottom-start`,arrow:!0,children:(0,H.jsx)(de,{"aria-label":`Orphaned token`,color:`warning`,"data-testid":`orphaned-token-icon`})})}):(0,H.jsx)(E,{icon:(0,H.jsx)(J,{color:`disabled`})}),Je=(e,t)=>{let n=(0,V.useMemo)(()=>({sortBy:[{id:`createdAt`,desc:!0}]}),[]),r=(0,V.useMemo)(()=>[{id:`Icon`,Cell:e=>(0,H.jsx)(qe,{secret:e.row.original.secret,project:e.row.original.project,projects:e.row.original.projects}),disableSortBy:!0,disableGlobalFilter:!0,width:50},{Header:`Token name`,accessor:`tokenName`,Cell:c,minWidth:35},{Header:`Type`,accessor:`type`,Cell:({value:e})=>(0,H.jsx)(c,{value:Y[e.toLowerCase()].label,subtitle:Y[e.toLowerCase()].title,subtitleTooltip:!0}),width:180},{Header:`Project`,accessor:`project`,Cell:e=>(0,H.jsx)(Ge,{project:e.row.original.project,projects:e.row.original.projects}),width:160},{Header:`Environment`,accessor:`environment`,Cell:c,width:120},{Header:`Created`,accessor:`createdAt`,Cell:v,width:150,disableGlobalFilter:!0},{Header:`Last seen`,accessor:`seenAt`,Cell:S,width:140,disableGlobalFilter:!0},{Header:`Actions`,width:120,id:`Actions`,align:`center`,disableSortBy:!0,disableGlobalFilter:!0,Cell:t}],[]),{getTableProps:i,getTableBodyProps:a,headerGroups:o,rows:s,prepareRow:l,state:u,setGlobalFilter:d,setHiddenColumns:p}=(0,q.useTable)({columns:r,data:e,initialState:n,sortTypes:f,autoResetHiddenColumns:!1,disableSortRemove:!0},q.useGlobalFilter,q.useSortBy,q.useFlexLayout);return{getTableProps:i,getTableBodyProps:a,headerGroups:o,rows:s,prepareRow:l,state:u,setGlobalFilter:d,setHiddenColumns:p,columns:r}},Y={client:{label:`BACKEND`,title:`Connect backend SDK or Unleash Edge`},backend:{label:`BACKEND`,title:`Connect backend SDK or Unleash Edge`},frontend:{label:`FRONTEND`,title:`Connect frontend SDK`},admin:{label:`ADMIN`,title:`Full access for managing Unleash`}},Ye=({token:e,project:t,permission:n,track:r})=>{let{setToastData:i}=x(),a=e=>{(0,U.default)(e)&&(i({type:`success`,text:`Token copied to clipboard`}),r&&typeof r==`function`&&r())};return(0,H.jsx)(h,{permission:n,projectId:t,tooltipProps:{title:`Copy token`,arrow:!0},onClick:()=>a(e.secret),size:`large`,children:(0,H.jsx)(A,{})})},Xe=z(`ul`)({marginBottom:0}),Ze=({token:e,permission:t,onRemove:n,project:r})=>{let[i,a]=(0,V.useState)(!1),{setToastData:o,setToastApiError:s}=x();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(h,{permission:t,projectId:r,tooltipProps:{title:`Delete token`,arrow:!0},onClick:()=>a(!0),size:`large`,children:(0,H.jsx)(le,{})}),(0,H.jsx)(w,{open:i,onClick:async()=>{try{await n(),a(!1),o({type:`success`,text:`API token removed`})}catch(e){s(ie(e))}},onClose:()=>a(!1),title:`Confirm deletion`,children:(0,H.jsxs)(`div`,{children:[`Are you sure you want to delete the following API token?`,(0,H.jsx)(`br`,{}),(0,H.jsxs)(Xe,{children:[(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`strong`,{children:`name`}),`:`,` `,(0,H.jsx)(`code`,{children:e.tokenName})]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`strong`,{children:`type`}),`: `,(0,H.jsx)(`code`,{children:e.type})]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`strong`,{children:`environment`}),`:`,` `,(0,H.jsx)(`code`,{children:e.environment})]})]})]})})]})},Qe=z(`div`)(()=>({maxWidth:`400px`})),$e=z(`form`)(()=>({display:`flex`,flexDirection:`column`,height:`100%`})),et=z(be)(({theme:e})=>({width:`100%`,marginBottom:e.spacing(2)})),tt=z(u)(({theme:e})=>({marginBottom:e.spacing(2),minWidth:`400px`,[e.breakpoints.down(`sm`)]:{minWidth:`379px`}})),X=z(`p`)(({theme:e})=>({marginBottom:e.spacing(1)})),nt=z(`label`)(({theme:e})=>({marginBottom:e.spacing(1)})),rt=z(k)(({theme:e})=>({marginLeft:e.spacing(3)})),Z=z(D)({marginTop:`auto`,display:`flex`,justifyContent:`flex-end`}),it=({children:e,actions:t,handleSubmit:n,handleCancel:i})=>{let{uiConfig:a}=P();return(0,H.jsxs)($e,{onSubmit:n,children:[(0,H.jsx)(r,{condition:!!a?.flags?.UNLEASH_CLOUD,show:(0,H.jsxs)(M,{severity:`info`,sx:{mb:4},children:[`Please be aware of our`,` `,(0,H.jsx)(y,{href:`https://www.getunleash.io/fair-use-policy`,children:`fair use policy`}),`.`]})}),e,(0,H.jsxs)(Z,{children:[t,(0,H.jsx)(rt,{onClick:i,children:`Cancel`})]})]})},Q=function(e){return e.ADMIN=`ADMIN`,e.CLIENT=`CLIENT`,e.FRONTEND=`FRONTEND`,e}({}),at=e=>{let{environments:t}=m(),n=t?.find(e=>e.enabled)?.name,r=B(ae,e),i=[{key:Q.CLIENT,label:`Backend SDK`,title:`Creates a backend token to connect a backend SDK or Unleash Edge`,enabled:B(`CREATE_CLIENT_API_TOKEN`)||r},{key:Q.FRONTEND,label:`Frontend SDK`,title:`Creates a frontend token to connect a frontend SDK`,enabled:B(`CREATE_FRONTEND_API_TOKEN`)||r}],a=i.find(e=>e.enabled)?.key,[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(a||Q.CLIENT),[u,d]=(0,V.useState)([e||`*`]),[f,p]=(0,V.useState)(u),[h,g]=(0,V.useState)(),[_,v]=(0,V.useState)({});return(0,V.useEffect)(()=>{g(c===`ADMIN`?`*`:n)},[c,n]),{tokenName:o,type:c,apiTokenTypes:i,projects:u,environment:h,setTokenName:s,setTokenType:e=>{e===`ADMIN`?(l(Q.ADMIN),p(u),d([`*`]),g(`*`)):(l(e),d(f),g(n))},setProjects:d,setEnvironment:g,getApiTokenPayload:()=>({tokenName:o,type:c,environment:h,projects:u}),isValid:()=>{let e={};return o||(e.tokenName=`Token name is required`),u.length===0&&(e.projects=`At least one project is required`),v(e),Object.keys(e).length===0},clearErrors:e=>{if(e){let t={..._};delete t[e],v(t)}else v({})},errors:_}},ot=({open:e,setOpen:t,closeConfirm:n,token:i,type:a})=>(0,H.jsxs)(w,{open:e,setOpen:t,onClick:n,primaryButtonText:`Close`,title:`New token created`,children:[(0,H.jsx)(L,{variant:`body1`,children:`Your new token has been created successfully.`}),(0,H.jsx)(o,{token:i}),(0,H.jsx)(r,{condition:a===Q.FRONTEND,show:(0,H.jsxs)(M,{sx:{mt:2},severity:`info`,children:[`By default, all `,Q.FRONTEND,` tokens may be used from any CORS origin. If you'd like to configure a strict set of origins, please use the`,` `,(0,H.jsx)(T,{to:`/admin/cors`,target:`_blank`,rel:`noreferrer`,children:`CORS origins configuration page`}),`.`]})})]}),st=({tokenName:e,setTokenName:t,errors:n,clearErrors:r})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(X,{children:`What would you like to call this token?`}),(0,H.jsx)(et,{value:e,name:`tokenName`,onChange:e=>t(e.target.value),label:`Token name`,error:n.tokenName!==void 0,errorText:n.tokenName,onFocus:()=>r(`tokenName`),autoFocus:!0})]}),ct=({type:e,setType:t,apiTokenTypes:n})=>(0,H.jsx)(Qe,{children:(0,H.jsxs)(s,{sx:{mb:2,width:`100%`},children:[(0,H.jsx)(nt,{id:`token-type`,children:`What do you want to connect?`}),(0,H.jsx)(ce,{"aria-labelledby":`token-type`,defaultValue:`CLIENT`,name:`radio-buttons-group`,value:e,onChange:(e,n)=>t(n),children:n.map(({key:e,label:t,title:n,enabled:r})=>(0,H.jsx)(Ae,{value:e,sx:{mb:1},disabled:!r,control:(0,H.jsx)(d,{sx:{ml:.75,alignSelf:`flex-start`}}),label:(0,H.jsx)(D,{children:(0,H.jsxs)(D,{children:[(0,H.jsx)(L,{children:t}),(0,H.jsx)(L,{variant:`body2`,color:`text.secondary`,children:n})]})})},e))})]})}),lt=({type:e,environment:t,setEnvironment:n})=>{let{environments:r}=m(),i=e===Q.ADMIN?[{key:`*`,label:`ALL`}]:r.map(e=>({key:e.name,label:`${e.name.concat(e.enabled?``:` - deprecated`)}`,title:e.name,disabled:!1}));return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(X,{children:`Which environment should the token have access to?`}),(0,H.jsx)(tt,{disabled:e===Q.ADMIN,options:i,value:t,onChange:n,label:`Environment`,id:`api_key_environment`,name:`environment`,IconComponent:Ee,fullWidth:!0})]})},$=e=>e.map(e=>({...e.user,joinedAt:new Date(e.joinedAt),createdBy:e.createdBy})),ut=e=>{let{data:t,error:n,mutate:r}=a(b(`api/admin/groups/${e}`),dt);return(0,V.useMemo)(()=>({group:t&&{...t,users:$(t?.users??[])},loading:!n&&!t,refetchGroup:()=>r(),error:n}),[t,n,r])},dt=e=>fetch(e).then(i(`Group`)).then(e=>e.json()),ft=()=>{let{isEnterprise:e}=P(),{data:t,error:n,mutate:r}=C(e(),{serviceAccounts:[],rootRoles:[]},b(`api/admin/service-account`),pt);return(0,V.useMemo)(()=>({serviceAccounts:t?.serviceAccounts??[],roles:t?.rootRoles??[],loading:!n&&!t,refetch:()=>r(),error:n}),[t,n,r])},pt=e=>fetch(e).then(i(`Service Accounts`)).then(e=>e.json()),mt=z(`div`)(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing(.5),"& > *:not(:last-child)":{borderBottom:`1px solid ${e.palette.divider}`,paddingBottom:e.spacing(1)}})),ht=z(ee)(()=>({display:`block`})),gt=({role:e,roles:t,value:n})=>{let{isEnterprise:r}=P();return r()?(0,H.jsx)(O,{children:(0,H.jsx)(fe,{tooltip:(0,H.jsx)(mt,{children:(t||[e]).map(e=>(0,H.jsx)(se,{roleId:e,tooltip:!0},e))}),children:(0,H.jsx)(ht,{children:n})})}):(0,H.jsx)(O,{children:n})};export{He as _,lt as a,ot as c,it as d,X as f,J as g,Je as h,ut as i,at as l,Ye as m,ft as n,ct as o,Ze as p,$ as r,st as s,gt as t,Q as u,Be as v};
@@ -0,0 +1 @@
1
+ import{n as e,s as t,t as n}from"./jsx-runtime-ButemYzH.js";import{E as r,Go as i,Gr as a,K as o,La as s,Ls as c,Ms as l,Na as u,Ns as d,Ps as f,Ts as p,Tu as m,Ur as h,Wa as g,Yu as _,dt as v,wu as y,xd as b,yu as x}from"./index-B0RbDPtk.js";var S=t(e(),1),C=n(),w=({isOpen:e,onConfirm:t,onClose:n,safeguardData:r,mode:i,safeguardType:a})=>{let{metricName:o}=r.impactMetric;return(0,C.jsx)(p,{title:`Request changes`,open:e,secondaryButtonText:`Cancel`,onClose:n,customButton:(0,C.jsx)(_,{color:`primary`,variant:`contained`,onClick:t,autoFocus:!0,children:`Add suggestion to draft`}),children:(0,C.jsxs)(`p`,{children:[i===`create`?`Add`:`Update`,` safeguard that an`,` `,a===`featureEnvironment`?`disables the environment`:`pauses automation`,` based on `,(0,C.jsx)(`strong`,{children:o})]})})},T=()=>{let{makeRequest:e,createRequest:t,errors:n,loading:r}=l({propagateErrors:!0});return{createOrUpdateReleasePlanSafeguard:async({projectId:n,featureName:r,environment:i,planId:a,body:o})=>{let s=t(`api/admin/projects/${n}/features/${r}/environments/${i}/release-plans/${a}/safeguards`,{method:`PUT`,body:JSON.stringify(o)},`createOrUpdateReleasePlanSafeguard`);await e(s.caller,s.id)},createOrUpdateFeatureEnvironmentSafeguard:async({projectId:n,featureName:r,environment:i,body:a})=>{let o=t(`api/admin/projects/${n}/features/${r}/environments/${i}/safeguards`,{method:`PUT`,body:JSON.stringify(a)},`createOrUpdateFeatureEnvironmentSafeguard`);await e(o.caller,o.id)},deleteReleasePlanSafeguard:async({projectId:n,featureName:r,environment:i,planId:a,safeguardId:o})=>{let s=t(`api/admin/projects/${n}/features/${r}/environments/${i}/release-plans/${a}/safeguards/${o}`,{method:`DELETE`},`deleteReleasePlanSafeguard`);await e(s.caller,s.id)},deleteFeatureEnvironmentSafeguard:async({projectId:n,featureName:r,environment:i,safeguardId:a})=>{let o=t(`api/admin/projects/${n}/features/${r}/environments/${i}/safeguards/${a}`,{method:`DELETE`},`deleteFeatureEnvironmentSafeguard`);await e(o.caller,o.id)},errors:n,loading:r}},E=({open:e,onClose:t,onConfirm:n,isDeleting:r=!1})=>(0,C.jsxs)(p,{title:`Remove safeguard?`,open:e,primaryButtonText:r?`Removing...`:`Remove safeguard`,secondaryButtonText:`Cancel`,onClick:n,onClose:t,disabledPrimaryButton:r,children:[(0,C.jsx)(`p`,{children:`You are about to remove the safeguard that pauses automation when conditions are met.`}),(0,C.jsx)(`br`,{}),(0,C.jsx)(`p`,{children:`This action cannot be undone.`})]}),D=b(`div`)(({theme:e})=>({display:`flex`,padding:e.spacing(.25,.25),backgroundColor:v(e),borderTop:`1px solid ${e.palette.divider}`,borderBottom:`1px solid ${e.palette.divider}`,"& > form":{borderRadius:0,border:`none`}})),O=b(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,gap:e.spacing(1),justifyContent:`space-between`,width:`100%`,paddingRight:e.spacing(2)})),k=({onSelect:e,releasePlan:t})=>{let[n,r]=(0,S.useState)(null),{trackEvent:i}=c();return(0,C.jsxs)(D,{children:[(0,C.jsx)(O,{children:(0,C.jsx)(o,{onClick:e=>{i(`safeguards`,{props:{eventType:`choose safeguard opened`}}),r(e.currentTarget)},color:`primary`,startIcon:(0,C.jsx)(s,{}),sx:{m:2},children:`Add safeguard`})}),(0,C.jsxs)(m,{anchorEl:n,open:!!n,onClose:()=>r(null),children:[(0,C.jsx)(y,{onClick:()=>{i(`safeguards`,{props:{eventType:`form opened`,safeguardType:`featureEnvironment`}}),e(`featureEnvironment`),r(null)},children:`Disable environment`}),(0,C.jsx)(x,{title:t?``:`Add a release plan to use this safeguard`,placement:`right`,arrow:!0,children:(0,C.jsx)(`span`,{children:(0,C.jsx)(y,{disabled:!t,onClick:()=>{i(`safeguards`,{props:{eventType:`form opened`,safeguardType:`releasePlan`}}),e(`releasePlan`),r(null)},children:`Pause automation`})})})]})]})},A=({projectId:e,featureId:t,environmentName:n,safeguardType:r,releasePlan:o,safeguard:s,onSafeguardChange:l})=>{let{setToastData:u,setToastApiError:p}=f(),{trackEvent:m}=c(),{addChange:g}=a(),{isChangeRequestConfigured:_}=i(e),{data:v,refetch:y}=h(e),{createOrUpdateReleasePlanSafeguard:b,deleteReleasePlanSafeguard:x,createOrUpdateFeatureEnvironmentSafeguard:C,deleteFeatureEnvironmentSafeguard:w}=T(),[E,D]=(0,S.useState)(!1),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(null),[P,F]=(0,S.useState)(!1),I=_(n),L=r===`releasePlan`&&o?r=>b({projectId:e,featureName:t,environment:n,planId:o.id,body:r}):r=>C({projectId:e,featureName:t,environment:n,body:r}),R=r===`releasePlan`&&o?r=>x({projectId:e,featureName:t,environment:n,planId:o.id,safeguardId:r}):r=>w({projectId:e,featureName:t,environment:n,safeguardId:r}),z=async e=>{if(m(`safeguards`,{props:{eventType:`safeguard submitted`,safeguardType:r}}),I){N(e),j(!0);return}try{await L(e),u({type:`success`,text:`Safeguard added successfully`}),l()}catch(e){p(d(e))}},B=async()=>{if(M)try{if(r===`featureEnvironment`)await g(e,n,{feature:t,action:`changeFeatureEnvSafeguard`,payload:{safeguard:M}});else{if(!o)return;await g(e,n,{feature:t,action:`changeReleasePlanSafeguard`,payload:{planId:o.id,safeguard:M}})}await y(),u({type:`success`,text:`Added to draft`}),l()}catch(e){p(d(e))}finally{j(!1),N(null)}},V=()=>{s&&(I?k(!0):D(!0))},H=async()=>{if(!(!s||P)){F(!0);try{await R(s.id),u({type:`success`,text:`Safeguard deleted successfully`}),l()}catch(e){p(d(e))}finally{F(!1),D(!1)}}},U=async()=>{if(!(!s||P)){F(!0);try{if(r===`featureEnvironment`)await g(e,n,{feature:t,action:`deleteFeatureEnvSafeguard`,payload:{safeguardId:s.id}});else{if(!o)return;await g(e,n,{feature:t,action:`deleteReleasePlanSafeguard`,payload:{planId:o.id,safeguardId:s.id}})}await y(),u({type:`success`,text:`Added to draft`}),l()}catch(e){p(d(e))}finally{F(!1),k(!1)}}},W=e=>{let t=(e.action===`changeReleasePlanSafeguard`||e.action===`deleteReleasePlanSafeguard`)&&!!o&&e.payload?.planId===o.id,n=e.action===`changeFeatureEnvSafeguard`||e.action===`deleteFeatureEnvSafeguard`;return t||n};return{handleSubmit:z,handleDeleteRequest:V,pendingSafeguardAction:(0,S.useMemo)(()=>{if(!v)return null;for(let e of v){if(e.environment!==n)continue;let r=e.features.find(e=>e.name===t);if(!r)continue;let i=r.changes.find(W);if(i)return i.action}return null},[v,n,t,o?.id]),deleteDialog:{open:E,isDeleting:P,onConfirm:H,onClose:()=>{P||D(!1)}},deleteChangeRequestDialog:{open:O,isDeleting:P,onConfirm:U,onClose:()=>k(!1)},submitChangeRequestDialog:{open:A,data:M,onConfirm:B,onClose:()=>{j(!1),N(null)}}}},j=({safeguardType:e,releasePlan:t,safeguard:n,environmentName:i,featureId:a,onSafeguardChange:o,onCancel:s})=>{let{handleSubmit:c,handleDeleteRequest:l,pendingSafeguardAction:d,deleteDialog:f,deleteChangeRequestDialog:m,submitChangeRequestDialog:h}=A({projectId:u(`projectId`),featureId:a,environmentName:i,safeguardType:e,releasePlan:t,safeguard:n,onSafeguardChange:o});return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(r,{safeguard:n,onSubmit:c,onCancel:s,onDelete:n?l:void 0,environment:i,featureId:a,badge:d===`deleteReleasePlanSafeguard`||d===`deleteFeatureEnvSafeguard`?(0,C.jsx)(g,{color:`error`,children:`Deleted in draft`}):d===`changeReleasePlanSafeguard`||d===`changeFeatureEnvSafeguard`?(0,C.jsx)(g,{color:`warning`,children:`Modified in draft`}):void 0,safeguardType:e}),h.data&&(0,C.jsx)(w,{isOpen:h.open,onConfirm:h.onConfirm,onClose:()=>{h.onClose(),s()},safeguardData:h.data,environment:i,mode:n?`edit`:`create`,safeguardType:e}),n&&(0,C.jsx)(E,{open:f.open,onClose:f.onClose,onConfirm:f.onConfirm,isDeleting:f.isDeleting}),n&&(0,C.jsx)(p,{title:`Request changes`,open:m.open,secondaryButtonText:`Cancel`,onClose:m.onClose,primaryButtonText:`Add suggestion to draft`,onClick:m.onConfirm,disabledPrimaryButton:m.isDeleting,children:(0,C.jsxs)(`p`,{children:[(0,C.jsx)(`strong`,{children:`Remove`}),` safeguard`,t&&(0,C.jsxs)(C.Fragment,{children:[` `,`from release plan`,` `,(0,C.jsx)(`strong`,{children:t.name})]}),` `,`for `,(0,C.jsx)(`strong`,{children:a}),` in`,` `,(0,C.jsx)(`strong`,{children:i})]})})]})},M=({featureEnvSafeguard:e,releasePlan:t,environmentName:n,featureId:r,onSafeguardChange:i})=>{let a=t?.safeguards?.[0],[o,s]=(0,S.useState)(null),c=()=>{s(null),i()};return e||a?(0,C.jsxs)(C.Fragment,{children:[e&&(0,C.jsx)(D,{children:(0,C.jsx)(j,{safeguardType:`featureEnvironment`,safeguard:e,environmentName:n,featureId:r,onSafeguardChange:c,onCancel:()=>{}})}),a&&(0,C.jsx)(D,{children:(0,C.jsx)(j,{safeguardType:`releasePlan`,releasePlan:t,safeguard:a,environmentName:n,featureId:r,onSafeguardChange:c,onCancel:()=>{}})})]}):o===`featureEnvironment`?(0,C.jsx)(D,{children:(0,C.jsx)(j,{safeguardType:`featureEnvironment`,environmentName:n,featureId:r,onSafeguardChange:i,onCancel:()=>s(null)})}):o===`releasePlan`&&t?(0,C.jsx)(D,{children:(0,C.jsx)(j,{safeguardType:`releasePlan`,releasePlan:t,environmentName:n,featureId:r,onSafeguardChange:i,onCancel:()=>s(null)})}):(0,C.jsx)(k,{onSelect:s,releasePlan:t})};export{k as AddSafeguard,M as Safeguard,M as default};
@@ -0,0 +1 @@
1
+ import{n as e,s as t,t as n}from"./jsx-runtime-ButemYzH.js";import{Ac as r,Al as i,Cs as a,Ls as o,Ml as s,Ol as c,Ri as l,Ts as u,Xd as d,kc as f,xd as p}from"./index-B0RbDPtk.js";var m=n(),h=p(d)(({theme:e})=>({textDecoration:`none`,color:e.palette.primary.main,fontWeight:e.fontWeight.bold})),g=({isOpen:e,onClose:t,features:n,project:r})=>(0,m.jsxs)(u,{title:`You can't archive a feature that other features depend on`,open:e,primaryButtonText:`OK`,onClick:t,children:[(0,m.jsx)(`p`,{children:`The following features depend on your feature:`}),(0,m.jsx)(`ul`,{children:n.map(e=>(0,m.jsx)(`li`,{children:(0,m.jsx)(h,{to:`/projects/${r}/features/${e}`,target:`_blank`,rel:`noopener noreferrer`,children:e})},e))})]}),_=t(e()),v=c(`api/admin/client-metrics/features`),y=(e,t)=>{let n=c(`api/admin/client-metrics/features/${e}/raw?hoursBack=${t}`),{data:r,error:a}=i(n,()=>b(n)),o=(0,_.useCallback)(()=>{s(v).catch(console.warn)},[]);return{featureMetrics:r?.data,loading:!a&&!r,refetchFeatureMetrics:o,error:a}},b=e=>fetch(e).then(r(`Features`)).then(e=>e.json()).then(),x=({hoursBack:e,setHoursBack:t,label:n=`Period`})=>{let{trackEvent:r}=o(),i=e=>{t(Number.parseInt(e,10)),r(`feature-metrics`,{props:{eventType:`change-period`,hoursBack:e}})},{isEnterprise:s}=f(),c=l(`extendedUsageMetrics`),u=s()&&c?[...S,...C]:S,d=u.map(e=>Number(e.key)).includes(e)?e:48;return(0,_.useEffect)(()=>{e!==d&&t(d)},[e]),(0,m.jsx)(`div`,{children:(0,m.jsx)(a,{name:`feature-metrics-period`,label:n,id:`feature-metrics-period`,options:u,value:String(d),onChange:i,fullWidth:!0})})},S=[{key:`1`,label:`Last hour`},{key:`24`,label:`Last 24 hours`},{key:`48`,label:`Last 48 hours`}],C=[{key:`168`,label:`Last 7 days`},{key:`720`,label:`Last 30 days`},{key:`2160`,label:`Last 90 days`}],w=e=>{let t=new Map;return e.forEach(e=>{let n=t.get(e.timestamp);if(n||(n={...e,yes:0,no:0,variants:{}},t.set(e.timestamp,n)),n.yes+=e.yes,n.no+=e.no,e.variants){n.variants=n.variants||{};for(let[t,r]of Object.entries(e.variants))n.variants[t]=(n.variants[t]||0)+r}}),Array.from(t.values()).map(e=>({...e,variants:e.variants&&Object.keys(e.variants).length===0?void 0:e.variants}))};export{g as i,x as n,y as r,w as t};
@@ -0,0 +1,3 @@
1
+ function e(){}var t=function(){let e=0;return function(){return e++}}();function n(e){return e==null}function r(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function i(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}var a=e=>(typeof e==`number`||e instanceof Number)&&isFinite(+e);function o(e,t){return a(e)?e:t}function s(e,t){return e===void 0?t:e}var c=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:e/t,l=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function u(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function d(e,t,n,a){let o,s,c;if(r(e))if(s=e.length,a)for(o=s-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<s;o++)t.call(n,e[o],o);else if(i(e))for(c=Object.keys(e),s=c.length,o=0;o<s;o++)t.call(n,e[c[o]],c[o])}function f(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function p(e){if(r(e))return e.map(p);if(i(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=p(e[n[i]]);return t}return e}function m(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function h(e,t,n,r){if(!m(e))return;let a=t[e],o=n[e];i(a)&&i(o)?g(a,o,r):t[e]=p(o)}function g(e,t,n){let a=r(t)?t:[t],o=a.length;if(!i(e))return e;n||={};let s=n.merger||h;for(let r=0;r<o;++r){if(t=a[r],!i(t))continue;let o=Object.keys(t);for(let r=0,i=o.length;r<i;++r)s(o[r],e,t,n)}return e}function _(e,t){return g(e,t,{merger:v})}function v(e,t,n){if(!m(e))return;let r=t[e],a=n[e];i(r)&&i(a)?_(r,a):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=p(a))}var y={"":e=>e,x:e=>e.x,y:e=>e.y};function b(e,t){return(y[t]||(y[t]=x(t)))(e)}function x(e){let t=S(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function S(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function C(e){return e.charAt(0).toUpperCase()+e.slice(1)}var w=e=>e!==void 0,T=e=>typeof e==`function`,E=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function D(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var O=Math.PI,k=2*O,ee=k+O,A=1/0,te=O/180,j=O/2,ne=O/4,re=O*2/3,M=Math.log10,N=Math.sign;function ie(e){let t=Math.round(e);e=se(e,t,e/1e3)?t:e;let n=10**Math.floor(M(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function ae(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function oe(e){return!isNaN(parseFloat(e))&&isFinite(e)}function se(e,t,n){return Math.abs(e-t)<n}function ce(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function le(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function P(e){return O/180*e}function ue(e){return 180/O*e}function de(e){if(!a(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function fe(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*O&&(a+=k),{angle:a,distance:i}}function pe(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function me(e,t){return(e-t+ee)%k-O}function F(e){return(e%k+k)%k}function he(e,t,n,r){let i=F(e),a=F(t),o=F(n),s=F(a-i),c=F(o-i),l=F(i-a),u=F(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function I(e,t,n){return Math.max(t,Math.min(n,e))}function ge(e){return I(e,-32768,32767)}function L(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function _e(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var ve=(e,t,n,r)=>_e(e,n,r?r=>e[r][t]<=n:r=>e[r][t]<n),ye=(e,t,n)=>_e(e,n,r=>e[r][t]>=n);function be(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var xe=[`push`,`pop`,`shift`,`splice`,`unshift`];function Se(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),xe.forEach(t=>{let n=`_onData`+C(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function Ce(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(xe.forEach(t=>{delete e[t]}),delete e._chartjs)}function we(e){let t=new Set,n,r;for(n=0,r=e.length;n<r;++n)t.add(e[n]);return t.size===r?e:Array.from(t)}var Te=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function Ee(e,t,n){let r=n||(e=>Array.prototype.slice.call(e)),i=!1,a=[];return function(...n){a=r(n),i||(i=!0,Te.call(window,()=>{i=!1,e.apply(t,a)}))}}function De(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var Oe=e=>e===`start`?`left`:e===`end`?`right`:`center`,R=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,ke=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function Ae(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,_parsed:s}=e,c=o.axis,{min:l,max:u,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(i=I(Math.min(ve(s,o.axis,l).lo,n?r:ve(t,c,o.getPixelForValue(l)).lo),0,r-1)),a=f?I(Math.max(ve(s,o.axis,u,!0).hi+1,n?0:ve(t,c,o.getPixelForValue(u),!0).hi+1),i,r)-i:r-i}return{start:i,count:a}}function je(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Me=e=>e===0||e===1,Ne=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*k/n)),Pe=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*k/n)+1,Fe={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*j)+1,easeOutSine:e=>Math.sin(e*j),easeInOutSine:e=>-.5*(Math.cos(O*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Me(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Me(e)?e:Ne(e,.075,.3),easeOutElastic:e=>Me(e)?e:Pe(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Me(e)?e:e<.5?.5*Ne(e*2,t,n):.5+.5*Pe(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Fe.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Fe.easeInBounce(e*2)*.5:Fe.easeOutBounce(e*2-1)*.5+.5};function Ie(e){return e+.5|0}var z=(e,t,n)=>Math.max(Math.min(e,n),t);function Le(e){return z(Ie(e*2.55),0,255)}function Re(e){return z(Ie(e*255),0,255)}function B(e){return z(Ie(e/2.55)/100,0,1)}function ze(e){return z(Ie(e*100),0,100)}var V={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Be=[...`0123456789ABCDEF`],Ve=e=>Be[e&15],He=e=>Be[(e&240)>>4]+Be[e&15],Ue=e=>(e&240)>>4==(e&15),We=e=>Ue(e.r)&&Ue(e.g)&&Ue(e.b)&&Ue(e.a);function Ge(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&V[e[1]]*17,g:255&V[e[2]]*17,b:255&V[e[3]]*17,a:t===5?V[e[4]]*17:255}:(t===7||t===9)&&(n={r:V[e[1]]<<4|V[e[2]],g:V[e[3]]<<4|V[e[4]],b:V[e[5]]<<4|V[e[6]],a:t===9?V[e[7]]<<4|V[e[8]]:255})),n}var Ke=(e,t)=>e<255?t(e):``;function qe(e){var t=We(e)?Ve:He;return e?`#`+t(e.r)+t(e.g)+t(e.b)+Ke(e.a,t):void 0}var Je=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ye(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function Xe(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Ze(e,t,n){let r=Ye(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Qe(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function $e(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Qe(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function et(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Re)}function tt(e,t,n){return et(Ye,e,t,n)}function nt(e,t,n){return et(Ze,e,t,n)}function rt(e,t,n){return et(Xe,e,t,n)}function it(e){return(e%360+360)%360}function at(e){let t=Je.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Le(+t[5]):Re(+t[5]));let i=it(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?nt(i,a,o):t[1]===`hsv`?rt(i,a,o):tt(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function ot(e,t){var n=$e(e);n[0]=it(n[0]+t),n=tt(n),e.r=n[0],e.g=n[1],e.b=n[2]}function st(e){if(!e)return;let t=$e(e),n=t[0],r=ze(t[1]),i=ze(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${B(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var ct={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},lt={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function ut(){let e={},t=Object.keys(lt),n=Object.keys(ct),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,ct[a]);a=parseInt(lt[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var dt;function ft(e){dt||(dt=ut(),dt.transparent=[0,0,0,0]);let t=dt[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var pt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mt(e){let t=pt.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?Le(e):z(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?Le(r):z(r,0,255)),i=255&(t[4]?Le(i):z(i,0,255)),a=255&(t[6]?Le(a):z(a,0,255)),{r,g:i,b:a,a:n}}}function ht(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${B(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var gt=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,_t=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function vt(e,t,n){let r=_t(B(e.r)),i=_t(B(e.g)),a=_t(B(e.b));return{r:Re(gt(r+n*(_t(B(t.r))-r))),g:Re(gt(i+n*(_t(B(t.g))-i))),b:Re(gt(a+n*(_t(B(t.b))-a))),a:e.a+n*(t.a-e.a)}}function yt(e,t,n){if(e){let r=$e(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=tt(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function bt(e,t){return e&&Object.assign(t||{},e)}function xt(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Re(e[3]))):(t=bt(e,{r:0,g:0,b:0,a:1}),t.a=Re(t.a)),t}function St(e){return e.charAt(0)===`r`?mt(e):at(e)}var Ct=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=xt(t):n===`string`&&(r=Ge(t)||ft(t)||St(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=bt(this._rgb);return e&&(e.a=B(e.a)),e}set rgb(e){this._rgb=xt(e)}rgbString(){return this._valid?ht(this._rgb):void 0}hexString(){return this._valid?qe(this._rgb):void 0}hslString(){return this._valid?st(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=vt(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=Re(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=Ie(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return yt(this._rgb,2,e),this}darken(e){return yt(this._rgb,2,-e),this}saturate(e){return yt(this._rgb,1,e),this}desaturate(e){return yt(this._rgb,1,-e),this}rotate(e){return ot(this._rgb,e),this}};function wt(e){return new Ct(e)}function Tt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Et(e){return Tt(e)?e:wt(e)}function Dt(e){return Tt(e)?e:wt(e).saturate(.5).darken(.1).hexString()}var Ot=Object.create(null),kt=Object.create(null);function At(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function jt(e,t,n){return typeof t==`string`?g(At(e,t),n):g(At(e,``),t)}var H=new class{constructor(e){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Dt(t.backgroundColor),this.hoverBorderColor=(e,t)=>Dt(t.borderColor),this.hoverColor=(e,t)=>Dt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return jt(this,e,t)}get(e){return At(this,e)}describe(e,t){return jt(kt,e,t)}override(e,t){return jt(Ot,e,t)}route(e,t,n,r){let a=At(this,e),o=At(this,n),c=`_`+t;Object.defineProperties(a,{[c]:{value:a[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[c],t=o[r];return i(e)?Object.assign({},t,e):s(e,t)},set(e){this[c]=e}}})}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}});function Mt(e){return!e||n(e.size)||n(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Nt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Pt(e,t,n,i){i||={};let a=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(a=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let s=0,c=n.length,l,u,d,f,p;for(l=0;l<c;l++)if(f=n[l],f!=null&&r(f)!==!0)s=Nt(e,a,o,s,f);else if(r(f))for(u=0,d=f.length;u<d;u++)p=f[u],p!=null&&!r(p)&&(s=Nt(e,a,o,s,p));e.restore();let m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete a[o[l]];o.splice(0,m)}return s}function Ft(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function It(e,t){t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function Lt(e,t,n,r){Rt(e,t,n,r,null)}function Rt(e,t,n,r,i){let a,o,s,c,l,u,d=t.pointStyle,f=t.rotation,p=t.radius,m=(f||0)*te;if(d&&typeof d==`object`&&(a=d.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(m),e.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),d){default:i?e.ellipse(n,r,i/2,p,0,0,k):e.arc(n,r,p,0,k),e.closePath();break;case`triangle`:e.moveTo(n+Math.sin(m)*p,r-Math.cos(m)*p),m+=re,e.lineTo(n+Math.sin(m)*p,r-Math.cos(m)*p),m+=re,e.lineTo(n+Math.sin(m)*p,r-Math.cos(m)*p),e.closePath();break;case`rectRounded`:l=p*.516,c=p-l,o=Math.cos(m+ne)*c,s=Math.sin(m+ne)*c,e.arc(n-o,r-s,l,m-O,m-j),e.arc(n+s,r-o,l,m-j,m),e.arc(n+o,r+s,l,m,m+j),e.arc(n-s,r+o,l,m+j,m+O),e.closePath();break;case`rect`:if(!f){c=Math.SQRT1_2*p,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}m+=ne;case`rectRot`:o=Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+s,r-o),e.lineTo(n+o,r+s),e.lineTo(n-s,r+o),e.closePath();break;case`crossRot`:m+=ne;case`cross`:o=Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s),e.moveTo(n+s,r-o),e.lineTo(n-s,r+o);break;case`star`:o=Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s),e.moveTo(n+s,r-o),e.lineTo(n-s,r+o),m+=ne,o=Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s),e.moveTo(n+s,r-o),e.lineTo(n-s,r+o);break;case`line`:o=i?i/2:Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(m)*p,r+Math.sin(m)*p);break}e.fill(),t.borderWidth>0&&e.stroke()}}function zt(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Bt(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Vt(e){e.restore()}function Ht(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function Ut(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Wt(e,t,i,a,o,s={}){let c=r(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!==``,u,d;for(e.save(),e.font=o.string,Gt(e,s),u=0;u<c.length;++u)d=c[u],l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),n(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,i,a,s.maxWidth)),e.fillText(d,i,a,s.maxWidth),Kt(e,i,a,d,s),a+=o.lineHeight;e.restore()}function Gt(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),n(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Kt(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function qt(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,-j,O,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,O,j,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,j,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-j,!0),e.lineTo(n+o.topLeft,r)}var Jt=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Yt=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Xt(e,t){let n=(``+e).match(Jt);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var Zt=e=>+e||0;function Qt(e,t){let n={},r=i(t),a=r?Object.keys(t):t,o=i(e)?r?n=>s(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of a)n[e]=Zt(o(e));return n}function $t(e){return Qt(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function U(e){return Qt(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function W(e){let t=$t(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function G(e,t){e||={},t||=H.font;let n=s(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=s(e.style,t.style);r&&!(``+r).match(Yt)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=``);let i={family:s(e.family,t.family),lineHeight:Xt(s(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:s(e.weight,t.weight),string:``};return i.string=Mt(i),i}function en(e,t,n,i){let a=!0,o,s,c;for(o=0,s=e.length;o<s;++o)if(c=e[o],c!==void 0&&(t!==void 0&&typeof c==`function`&&(c=c(t),a=!1),n!==void 0&&r(c)&&(c=c[n%c.length],a=!1),c!==void 0))return i&&!a&&(i.cacheable=!1),c}function tn(e,t,n){let{min:r,max:i}=e,a=l(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function nn(e,t){return Object.assign(Object.create(e),t)}function rn(e,t=[``],n=e,r,i=()=>e[0]){return w(r)||(r=bn(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:r,_getTarget:i,override:i=>rn([i,...e],t,n,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return ln(n,r,()=>yn(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return xn(e).includes(t)},ownKeys(e){return xn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function an(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:on(e,r),setContext:t=>an(e,t,n,r),override:i=>an(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return ln(e,t,()=>un(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function on(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:T(n)?n:()=>n,isIndexable:T(r)?r:()=>r}}var sn=(e,t)=>e?e+C(t):t,cn=(e,t)=>i(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ln(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let r=n();return e[t]=r,r}function un(e,t,n){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=e,c=i[t];return T(c)&&s.isScriptable(t)&&(c=dn(t,c,e,n)),r(c)&&c.length&&(c=fn(t,c,e,s.isIndexable)),cn(t,c)&&(c=an(c,a,o&&o[t],s)),c}function dn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);return s.add(e),t=t(a,o||r),s.delete(e),cn(e,t)&&(t=gn(i._scopes,i,e,t)),t}function fn(e,t,n,r){let{_proxy:a,_context:o,_subProxy:s,_descriptors:c}=n;if(w(o.index)&&r(e))t=t[o.index%t.length];else if(i(t[0])){let n=t,r=a._scopes.filter(e=>e!==n);t=[];for(let i of n){let n=gn(r,a,e,i);t.push(an(n,o,s&&s[e],c))}}return t}function pn(e,t,n){return T(e)?e(t,n):e}var mn=(e,t)=>e===!0?t:typeof e==`string`?b(t,e):void 0;function hn(e,t,n,r,i){for(let a of t){let t=mn(n,a);if(t){e.add(t);let a=pn(t._fallback,n,i);if(w(a)&&a!==n&&a!==r)return a}else if(t===!1&&w(r)&&n!==r)return null}return!1}function gn(e,t,n,r){let i=t._rootScopes,a=pn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=_n(s,o,n,a||n,r);return c===null||w(a)&&a!==n&&(c=_n(s,o,a,c,r),c===null)?!1:rn(Array.from(s),[``],i,a,()=>vn(t,n,r))}function _n(e,t,n,r,i){for(;n;)n=hn(e,t,n,r,i);return n}function vn(e,t,n){let a=e._getTarget();t in a||(a[t]={});let o=a[t];return r(o)&&i(n)?n:o}function yn(e,t,n,r){let i;for(let a of t)if(i=bn(sn(a,e),n),w(i))return cn(e,i)?gn(n,r,e,i):i}function bn(e,t){for(let n of t){if(!n)continue;let t=n[e];if(w(t))return t}}function xn(e){let t=e._keys;return t||=e._keys=Sn(e._scopes),t}function Sn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function Cn(e,t,n,r){let{iScale:i}=e,{key:a=`r`}=this._parsing,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={r:i.parse(b(u,a),l)};return o}var wn=2**-52||1e-14,Tn=(e,t)=>t<e.length&&!e[t].skip&&e[t],En=e=>e===`x`?`y`:`x`;function Dn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=pe(a,i),c=pe(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function On(e,t,n){let r=e.length,i,a,o,s,c,l=Tn(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Tn(e,u+1),!(!c||!l)){if(se(t[u],0,wn)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function kn(e,t,n=`x`){let r=En(n),i=e.length,a,o,s,c=Tn(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=Tn(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function An(e,t=`x`){let n=En(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=Tn(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=Tn(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?N(i[o-1])===N(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}On(e,i,a),kn(e,a,t)}function jn(e,t,n){return Math.max(Math.min(e,n),t)}function Mn(e,t){let n,r,i,a,o,s=zt(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&zt(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=jn(i.cp1x,t.left,t.right),i.cp1y=jn(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=jn(i.cp2x,t.left,t.right),i.cp2y=jn(i.cp2y,t.top,t.bottom)))}function Nn(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)An(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Dn(n,s,e[Math.min(a+1,o-+!r)%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&Mn(e,n)}function Pn(){return typeof window<`u`&&typeof document<`u`}function Fn(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function In(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var Ln=e=>window.getComputedStyle(e,null);function Rn(e,t){return Ln(e).getPropertyValue(t)}var zn=[`top`,`right`,`bottom`,`left`];function Bn(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=zn[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Vn=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Hn(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Vn(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Un(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Ln(n),a=i.boxSizing===`border-box`,o=Bn(i,`padding`),s=Bn(i,`border`,`width`),{x:c,y:l,box:u}=Hn(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Wn(e,t,n){let r,i;if(t===void 0||n===void 0){let a=Fn(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Ln(a),s=Bn(o,`border`,`width`),c=Bn(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=In(o.maxWidth,a,`clientWidth`),i=In(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||A,maxHeight:i||A}}var Gn=e=>Math.round(e*10)/10;function Kn(e,t,n,r){let i=Ln(e),a=Bn(i,`margin`),o=In(i.maxWidth,e,`clientWidth`)||A,s=In(i.maxHeight,e,`clientHeight`)||A,c=Wn(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Bn(i,`border`,`width`),t=Bn(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?Math.floor(l/r):u-a.height),l=Gn(Math.min(l,o,c.maxWidth)),u=Gn(Math.min(u,s,c.maxHeight)),l&&!u&&(u=Gn(l/2)),{width:l,height:u}}function qn(e,t,n){let r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=i/r,e.width=a/r;let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var Jn=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t)}catch{}return e}();function Yn(e,t){let n=Rn(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Xn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Zn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function Qn(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=Xn(e,i,n),s=Xn(i,a,n),c=Xn(a,t,n);return Xn(Xn(o,s,n),Xn(s,c,n),n)}var $n=new Map;function er(e,t){t||={};let n=e+JSON.stringify(t),r=$n.get(n);return r||(r=new Intl.NumberFormat(e,t),$n.set(n,r)),r}function tr(e,t,n){return er(t,n).format(e)}var nr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},rr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ir(e,t,n){return e?nr(t,n):rr()}function ar(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function or(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function sr(e){return e===`angle`?{between:he,compare:me,normalize:F}:{between:L,compare:(e,t)=>e-t,normalize:e=>e}}function cr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function lr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=sr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function ur(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=sr(r),{start:u,end:d,loop:f,style:p}=lr(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(cr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(cr({start:g,end:d,loop:f,count:o,style:p})),m}function dr(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=ur(r[i],e.points,t);a.length&&n.push(...a)}return n}function fr(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function pr(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function mr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=fr(n,i,a,r);return r===!0?hr(e,[{start:o,end:s,loop:a}],n,t):hr(e,pr(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function hr(e,t,n,r){return!r||!r.setContext||!n?t:gr(e,t,n,r)}function gr(e,t,n,r){let i=e._chart.getContext(),a=_r(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=_r(r.setContext(nn(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),vr(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function _r(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function vr(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}var K=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,Te.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},yr=`transparent`,br={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Et(e||yr),i=r.valid&&Et(t||yr);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},xr=class{constructor(e,t,n,r){let i=t[n];r=en([e.to,r,i,e.from]);let a=en([e.from,i,r]);this._active=!0,this._fn=e.fn||br[e.type||typeof a],this._easing=Fe[e.easing]||Fe.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=en([e.to,t,r,e.from]),this._from=en([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},Sr=[`x`,`y`,`borderWidth`,`radius`,`tension`],Cr=[`color`,`borderColor`,`backgroundColor`];H.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var wr=Object.keys(H.animation);H.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),H.set(`animations`,{colors:{type:`color`,properties:Cr},numbers:{type:`number`,properties:Sr}}),H.describe(`animations`,{_fallback:`animation`}),H.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}});var Tr=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!i(e))return;let t=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{let a=e[n];if(!i(a))return;let o={};for(let e of wr)o[e]=a[e];(r(a.properties)&&a.properties||[n]).forEach(e=>{(e===n||!t.has(e))&&t.set(e,o)})})}_animateOptions(e,t){let n=t.options,r=Dr(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Er(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new xr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return K.add(this._chart,n),!0}};function Er(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Dr(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Or(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function kr(e,t,n){if(n===!1)return!1;let r=Or(e,n),i=Or(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Ar(e){let t,n,r,a;return i(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a,disabled:e===!1}}function jr(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Mr(e,t,n,r={}){let i=e.keys,o=r.mode===`single`,s,c,l,u;if(t!==null){for(s=0,c=i.length;s<c;++s){if(l=+i[s],l===n){if(r.all)continue;break}u=e.values[l],a(u)&&(o||t===0||N(t)===N(u))&&(t+=u)}return t}}function Nr(e){let t=Object.keys(e),n=Array(t.length),r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r],n[r]={x:a,y:e[a]};return n}function Pr(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Fr(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ir(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Lr(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Rr(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function zr(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Fr(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Lr(i,u,a),f[s]=d,f._top=Rr(f,o,!0,r.type),f._bottom=Rr(f,o,!1,r.type)}}function Br(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function Vr(e,t){return nn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function Hr(e,t,n){return nn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function Ur(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n]}}}var Wr=e=>e===`reset`||e===`none`,Gr=(e,t)=>t?e:Object.assign({},e),Kr=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:jr(n,!0),values:null},q=class{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Pr(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ur(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=s(n.xAxisID,Br(e,`x`)),a=t.yAxisID=s(n.yAxisID,Br(e,`y`)),o=t.rAxisID=s(n.rAxisID,Br(e,`r`)),c=t.indexAxis,l=t.iAxisID=r(c,i,a,o),u=t.vAxisID=r(c,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&Ce(this._data,this),e._stacked&&Ur(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(i(t))this._data=Nr(t);else if(n!==t){if(n){Ce(n,this);let e=this._cachedMeta;Ur(e),e._parsed=[]}t&&Object.isExtensible(t)&&Se(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Pr(t.vScale,t),t.stack!==n.stack&&(r=!0,Ur(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&zr(this,t._parsed)}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:a}=this,{iScale:o,_stacked:s}=n,c=o.axis,l=e===0&&t===a.length?!0:n._sorted,u=e>0&&n._parsed[e-1],d,f,p;if(this._parsing===!1)n._parsed=a,n._sorted=!0,p=a;else{p=r(a[e])?this.parseArrayData(n,a,e,t):i(a[e])?this.parseObjectData(n,a,e,t):this.parsePrimitiveData(n,a,e,t);let o=()=>f[c]===null||u&&f[c]<u[c];for(d=0;d<t;++d)n._parsed[d+e]=f=p[d],l&&(o()&&(l=!1),u=f);n._sorted=l}s&&zr(this,p)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(b(f,o),d),y:a.parse(b(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return Mr({keys:jr(r,!0),values:t._stacks[e.axis]},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=Mr(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,o=r.length,s=this._getOtherScale(e),c=Kr(t,n,this.chart),l={min:1/0,max:-1/0},{min:u,max:d}=Ir(s),f,p;function m(){p=r[f];let t=p[s.axis];return!a(p[e.axis])||u>t||d<t}for(f=0;f<o&&!(!m()&&(this.updateRangeFromParsed(l,e,p,c),i));++f);if(i){for(f=o-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(l,e,p,c);break}}return l}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r][e.axis],a(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Ar(s(this.options.clip,kr(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=Hr(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=Vr(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&w(n);if(o)return Gr(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(H.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Gr(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Tr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||Wr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){Wr(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!Wr(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&Ur(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};q.defaults={},q.prototype.datasetElementType=null,q.prototype.dataElementType=null;function qr(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=we(r.sort((e,t)=>e-t))}return e._cache.$bar}function Jr(e){let t=e.iScale,n=qr(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(w(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function Yr(e,t,r,i){let a=r.barThickness,o,s;return n(a)?(o=t.min*r.categoryPercentage,s=r.barPercentage):(o=a*i,s=1),{chunk:o/i,ratio:s,start:t.pixels[e]-o/2}}function Xr(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function Zr(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function Qr(e,t,n,i){return r(e)?Zr(e,t,n,i):t[n.axis]=n.parse(e,i),t}function $r(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(Qr(f,d,a,l));return c}function ei(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ti(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):N(e)}function ni(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function ri(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=ni(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[ii(u,o,s,c)]=!0,i=l)),a[ii(i,o,s,c)]=!0,e.borderSkipped=a}function ii(e,t,n,r){return r?(e=ai(e,t,n),e=oi(e,n,t)):e=oi(e,t,n),e}function ai(e,t,n){return e===t?n:e===n?t:e}function oi(e,t,n){return e===`start`?t:e===`end`?n:e}function si(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var ci=class extends q{parsePrimitiveData(e,t,n,r){return $r(e,t,n,r)}parseArrayData(e,t,n,r){return $r(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(b(m,c),d),u.push(Qr(b(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=ei(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,r,i){let a=i===`reset`,{index:o,_cachedMeta:{vScale:s}}=this,c=s.getBasePixel(),l=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(t,i);for(let p=t;p<t+r;p++){let t=this.getParsed(p),r=a||n(t[s.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),m=this._calculateBarIndexPixels(p,u),h=(t._stacks||{})[s.axis],g={horizontal:l,base:r.base,enableBorderRadius:!h||ei(t._custom)||o===h._top||o===h._bottom,x:l?r.head:m.center,y:l?m.center:r.head,height:l?m.size:Math.abs(r.size),width:l?Math.abs(r.size):m.size};f&&(g.options=d||this.resolveDataElementOptions(p,e[p].active?`active`:i));let _=g.options||e[p].options;ri(g,_,h,o),si(g,_,u.ratio),this.updateElement(e[p],p,g,i)}}_getStacks(e,t){let{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),a=r.options.stacked,o=[],s=e=>{let r=e.controller.getParsed(t),i=r&&r[e.vScale.axis];if(n(i)||isNaN(i))return!0};for(let n of i)if(!(t!==void 0&&s(n))&&((a===!1||o.indexOf(n.stack)===-1||a===void 0&&n.stack===void 0)&&o.push(n.stack),n.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||Jr(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=ei(c),u=s[t.axis],d=0,f=r?this.applyStack(t,s,r):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&N(u)!==N(c.barEnd)&&(d=0),d+=u);let h=!n(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=ti(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),n=t.getPixelForDecimal(1);g=Math.max(Math.min(g,Math.max(e,n)),Math.min(e,n)),p=g+m}if(g===t.getPixelForValue(o)){let e=N(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=s(r.maxBarThickness,1/0),o,c;if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,s=r.barThickness===`flex`?Xr(e,t,r,n):Yr(e,t,r,n),l=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0);o=s.start+s.chunk*l+s.chunk/2,c=Math.min(a,s.chunk*s.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),c=Math.min(a,t.min*t.ratio);return{base:o-c/2,head:o+c/2,center:o,size:c}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&n[i].draw(this._ctx)}};ci.id=`bar`,ci.defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}},ci.overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};var li=class extends q{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,r){let i=super.parsePrimitiveData(e,t,n,r);for(let e=0;e<i.length;e++)i[e]._custom=this.resolveDataElementOptions(e+n).radius;return i}parseArrayData(e,t,n,r){let i=super.parseArrayData(e,t,n,r);for(let e=0;e<i.length;e++){let r=t[n+e];i[e]._custom=s(r[2],this.resolveDataElementOptions(e+n).radius)}return i}parseObjectData(e,t,n,r){let i=super.parseObjectData(e,t,n,r);for(let e=0;e<i.length;e++){let r=t[n+e];i[e]._custom=s(r&&r.r&&+r.r,this.resolveDataElementOptions(e+n).radius)}return i}getMaxOverflow(){let e=this._cachedMeta.data,t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,{xScale:n,yScale:r}=t,i=this.getParsed(e),a=n.getLabelForValue(i.x),o=r.getLabelForValue(i.y),s=i._custom;return{label:t.label,value:`(`+a+`, `+o+(s?`, `+s:``)+`)`}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:s,includeOptions:c}=this._getSharedOptions(t,r),l=a.axis,u=o.axis;for(let d=t;d<t+n;d++){let t=e[d],n=!i&&this.getParsed(d),f={},p=f[l]=i?a.getPixelForDecimal(.5):a.getPixelForValue(n[l]),m=f[u]=i?o.getBasePixel():o.getPixelForValue(n[u]);f.skip=isNaN(p)||isNaN(m),c&&(f.options=s||this.resolveDataElementOptions(d,t.active?`active`:r),i&&(f.options.radius=0)),this.updateElement(t,d,f,r)}}resolveDataElementOptions(e,t){let n=this.getParsed(e),r=super.resolveDataElementOptions(e,t);r.$shared&&(r=Object.assign({},r,{$shared:!1}));let i=r.radius;return t!==`active`&&(r.radius=0),r.radius+=s(n&&n._custom,i),r}};li.id=`bubble`,li.defaults={datasetElementType:!1,dataElementType:`point`,animations:{numbers:{type:`number`,properties:[`x`,`y`,`borderWidth`,`radius`]}}},li.overrides={scales:{x:{type:`linear`},y:{type:`linear`}},plugins:{tooltip:{callbacks:{title(){return``}}}}};function ui(e,t,n){let r=1,i=1,a=0,o=0;if(t<k){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>he(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>he(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(j,u,f),_=m(O,l,d),v=m(O+j,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var di=class extends q{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let a=e=>+n[e];if(i(n[e])){let{key:e=`value`}=this._parsing;a=t=>+b(n[t],e)}let o,s;for(o=e,s=e+t;o<s;++o)r._parsed[o]=a(o)}}_getRotation(){return P(this.options.rotation-90)}_getCircumference(){return P(this.options.circumference)}_getRotationExtents(){let e=k,t=-k;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(c(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:m,offsetY:h}=ui(d,u,o),g=(t.width-i)/f,_=(t.height-i)/p,v=Math.max(Math.min(g,_)/2,0),y=l(this.options.radius,v),b=(y-Math.max(y*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*y,this.offsetY=h*y,n.total=this.calculateTotal(),this.outerRadius=y-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/k)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g;for(g=0;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r;for(r=0;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*k:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=tr(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(s(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};di.id=`doughnut`,di.defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`},di.descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`},di.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((t,r)=>{let i=e.getDatasetMeta(0).controller.getStyle(r);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return``},label(e){let t=e.label,n=`: `+e.formattedValue;return r(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};var fi=class extends q{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=Ae(t,r,a);this._drawStart=o,this._drawCount=s,je(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,r,i){let a=i===`reset`,{iScale:o,vScale:s,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,i),f=o.axis,p=s.axis,{spanGaps:m,segment:h}=this.options,g=oe(m)?m:1/0,_=this.chart._animationsDisabled||a||i===`none`,v=t>0&&this.getParsed(t-1);for(let m=t;m<t+r;++m){let t=e[m],r=this.getParsed(m),y=_?t:{},b=n(r[p]),x=y[f]=o.getPixelForValue(r[f],m),S=y[p]=a||b?s.getBasePixel():s.getPixelForValue(c?this.applyStack(s,r,c):r[p],m);y.skip=isNaN(x)||isNaN(S)||b,y.stop=m>0&&Math.abs(r[f]-v[f])>g,h&&(y.parsed=r,y.raw=l.data[m]),d&&(y.options=u||this.resolveDataElementOptions(m,t.active?`active`:i)),_||this.updateElement(t,m,y,i),v=r}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};fi.id=`line`,fi.defaults={datasetElementType:`line`,dataElementType:`point`,showLine:!0,spanGaps:!1},fi.overrides={scales:{_index_:{type:`category`},_value_:{type:`linear`}}};var pi=class extends q{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=tr(t._parsed[e].r,n.options.locale);return{label:r[e]||``,value:i}}parseObjectData(e,t,n,r){return Cn.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:1/0,max:-1/0};return e.data.forEach((e,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),i=Math.max(r/2,0),a=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.options.animation,s=this._cachedMeta.rScale,c=s.xCenter,l=s.yCenter,u=s.getIndexAngle(0)-.5*O,d=u,f,p=360/this.countVisibleElements();for(f=0;f<t;++f)d+=this._computeAngle(f,r,p);for(f=t;f<t+n;f++){let t=e[f],n=d,m=d+this._computeAngle(f,r,p),h=a.getDataVisibility(f)?s.getDistanceFromCenterForValue(this.getParsed(f).r):0;d=m,i&&(o.animateScale&&(h=0),o.animateRotate&&(n=m=u));let g={x:c,y:l,innerRadius:0,outerRadius:h,startAngle:n,endAngle:m,options:this.resolveDataElementOptions(f,t.active?`active`:r)};this.updateElement(t,f,g,r)}}countVisibleElements(){let e=this._cachedMeta,t=0;return e.data.forEach((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?P(this.resolveDataElementOptions(e,t).angle||n):0}};pi.id=`polarArea`,pi.defaults={dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:`number`,properties:[`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`]}},indexAxis:`r`,startAngle:0},pi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((t,r)=>{let i=e.getDatasetMeta(0).controller.getStyle(r);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return``},label(e){return e.chart.data.labels[e.dataIndex]+`: `+e.formattedValue}}}},scales:{r:{type:`radialLinear`,angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var mi=class extends di{};mi.id=`pie`,mi.defaults={cutout:0,rotation:0,circumference:360,radius:`100%`};var hi=class extends q{getLabelAndValue(e){let t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:``+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return Cn.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta,n=t.dataset,r=t.data||[],i=t.iScale.getLabels();if(n.points=r,e!==`resize`){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);let a={_loop:!0,_fullLoop:i.length===r.length,options:t};this.updateElement(n,void 0,a,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){let i=this._cachedMeta.rScale,a=r===`reset`;for(let o=t;o<t+n;o++){let t=e[o],n=this.resolveDataElementOptions(o,t.active?`active`:r),s=i.getPointPositionForValue(o,this.getParsed(o).r),c=a?i.xCenter:s.x,l=a?i.yCenter:s.y,u={x:c,y:l,angle:s.angle,skip:isNaN(c)||isNaN(l),options:n};this.updateElement(t,o,u,r)}}};hi.id=`radar`,hi.defaults={datasetElementType:`line`,dataElementType:`point`,indexAxis:`r`,showLine:!0,elements:{line:{fill:`start`}}},hi.overrides={aspectRatio:1,scales:{r:{type:`radialLinear`}}};var J=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return oe(this.x)&&oe(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};J.defaults={},J.defaultRoutes=void 0;var gi={values(e){return r(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=_i(e,n)}let o=M(Math.abs(a)),s=Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),tr(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=e/10**Math.floor(M(e));return r===1||r===2||r===5?gi.numeric.call(this,e,t,n):``}};function _i(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var vi={formatters:gi};H.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vi.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),H.route(`scale.ticks`,`color`,``,`color`),H.route(`scale.grid`,`color`,``,`borderColor`),H.route(`scale.grid`,`borderColor`,``,`borderColor`),H.route(`scale.title`,`color`,``,`color`),H.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`}),H.describe(`scales`,{_fallback:`scale`}),H.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`});function yi(e,t){let r=e.options.ticks,i=r.maxTicksLimit||bi(e),a=r.major.enabled?Si(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Ci(t,l,a,o/i),l;let u=xi(a,t,i);if(o>0){let e,r,i=o>1?Math.round((c-s)/(o-1)):null;for(wi(t,l,u,n(i)?0:s-i,s),e=0,r=o-1;e<r;e++)wi(t,l,u,a[e],a[e+1]);return wi(t,l,u,c,n(i)?t.length:c+i),l}return wi(t,l,u),l}function bi(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+ +!t,i=e._maxLength/n;return Math.floor(Math.min(r,i))}function xi(e,t,n){let r=Ti(e),i=t.length/n;if(!r)return Math.max(i,1);let a=ae(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function Si(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Ci(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function wi(e,t,n,r,i){let a=s(r,0),o=Math.min(s(i,e.length),e.length),c=0,l,u,d;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),d=a;d<0;)c++,d=Math.round(a+c*n);for(u=Math.max(a,0);u<o;u++)u===d&&(t.push(e[u]),c++,d=Math.round(a+c*n))}function Ti(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var Ei=e=>e===`left`?`right`:e===`right`?`left`:e,Di=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n;function Oi(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function ki(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Ai(e,t){d(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function ji(e){return e.drawTicks?e.tickLength:0}function Mi(e,t){if(!e.display)return 0;let n=G(e.font,t),i=W(e.padding);return(r(e.text)?e.text.length:1)*n.lineHeight+i.height}function Ni(e,t){return nn(e,{scale:t,type:`scale`})}function Pi(e,t,n){return nn(e,{tick:n,index:t,type:`tick`})}function Fi(e,t,n){let r=Oe(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=Ei(r)),r}function Ii(e,t,n,r){let{top:a,left:o,bottom:s,right:c,chart:l}=e,{chartArea:u,scales:d}=l,f=0,p,m,h,g=s-a,_=c-o;if(e.isHorizontal()){if(m=R(r,o,c),i(n)){let e=Object.keys(n)[0],r=n[e];h=d[e].getPixelForValue(r)+g-t}else h=n===`center`?(u.bottom+u.top)/2+g-t:Di(e,n,t);p=c-o}else{if(i(n)){let e=Object.keys(n)[0],r=n[e];m=d[e].getPixelForValue(r)-_+t}else m=n===`center`?(u.left+u.right)/2-_+t:Di(e,n,t);h=R(r,s,a),f=n===`left`?-j:j}return{titleX:m,titleY:h,maxWidth:p,rotation:f}}var Li=class e extends J{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=o(e,1/0),t=o(t,-1/0),n=o(n,1/0),r=o(r,-1/0),{min:o(e,n),max:o(t,r),minDefined:a(e),maxDefined:a(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let s=this.getMatchingVisibleMetas();for(let o=0,c=s.length;o<c;++o)a=s[o].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:o(t,o(n,t)),max:o(n,o(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){u(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?Oi(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=yi(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){u(this.options.afterUpdate,[this])}beforeSetDimensions(){u(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){u(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),u(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){u(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=u(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){u(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){u(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=this.ticks.length,r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=I(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-ji(e.grid)-t.padding-Mi(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=ue(Math.min(Math.asin(I((l.highest.height+6)/o,-1,1)),Math.asin(I(s/c,-1,1))-Math.asin(I(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){u(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){u(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Mi(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=ji(i)+a):(e.height=this.maxHeight,e.width=ji(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=P(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){u(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,r;for(t=0,r=e.length;t<r;t++)n(e[t].label)&&(e.splice(t,1),r--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Oi(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length)}return e}_computeLabelSizes(e,t){let{ctx:i,_longestTextCache:a}=this,o=[],s=[],c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;++u){if(p=e[u].label,m=this._resolveTickFontOptions(u),i.font=h=m.string,g=a[h]=a[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!n(p)&&!r(p))v=Nt(i,g.data,g.gc,v,p),y=_;else if(r(p))for(d=0,f=p.length;d<f;++d)b=p[d],!n(b)&&!r(b)&&(v=Nt(i,g.data,g.gc,v,b),y+=_);o.push(v),s.push(y),c=Math.max(v,c),l=Math.max(y,l)}Ai(a,t);let x=o.indexOf(c),S=s.indexOf(l),C=e=>({width:o[e]||0,height:s[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:o,heights:s}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ge(this._alignToPixels?Ft(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=Pi(this.getContext(),e,n)}return this.$context||=Ni(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=P(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:a,position:o}=r,c=a.offset,l=this.isHorizontal(),u=this.ticks.length+ +!!c,d=ji(a),f=[],p=a.setContext(this.getContext()),m=p.drawBorder?p.borderWidth:0,h=m/2,g=function(e){return Ft(n,e,m)},_,v,y,b,x,S,C,w,T,E,D,O;if(o===`top`)_=g(this.bottom),S=this.bottom-d,w=_-h,E=g(e.top)+h,O=e.bottom;else if(o===`bottom`)_=g(this.top),E=e.top,O=g(e.bottom)-h,S=_+h,w=this.top+d;else if(o===`left`)_=g(this.right),x=this.right-d,C=_-h,T=g(e.left)+h,D=e.right;else if(o===`right`)_=g(this.left),T=e.left,D=g(e.right)-h,x=_+h,C=this.left+d;else if(t===`x`){if(o===`center`)_=g((e.top+e.bottom)/2+.5);else if(i(o)){let e=Object.keys(o)[0],t=o[e];_=g(this.chart.scales[e].getPixelForValue(t))}E=e.top,O=e.bottom,S=_+h,w=S+d}else if(t===`y`){if(o===`center`)_=g((e.left+e.right)/2);else if(i(o)){let e=Object.keys(o)[0],t=o[e];_=g(this.chart.scales[e].getPixelForValue(t))}x=_-h,C=x-d,T=e.left,D=e.right}let k=s(r.ticks.maxTicksLimit,u),ee=Math.max(1,Math.ceil(u/k));for(v=0;v<u;v+=ee){let e=a.setContext(this.getContext(v)),t=e.lineWidth,r=e.color,i=e.borderDash||[],o=e.borderDashOffset,s=e.tickWidth,u=e.tickColor,d=e.tickBorderDash||[],p=e.tickBorderDashOffset;y=ki(this,v,c),y!==void 0&&(b=Ft(n,y,t),l?x=C=T=D=b:S=w=E=O=b,f.push({tx1:x,ty1:S,tx2:C,ty2:w,x1:T,y1:E,x2:D,y2:O,width:t,color:r,borderDash:i,borderDashOffset:o,tickWidth:s,tickColor:u,tickBorderDash:d,tickBorderDashOffset:p}))}return this._ticksLength=u,this._borderValue=_,f}_computeLabelItems(e){let t=this.axis,n=this.options,{position:a,ticks:o}=n,s=this.isHorizontal(),c=this.ticks,{align:l,crossAlign:u,padding:d,mirror:f}=o,p=ji(n.grid),m=p+d,h=f?-d:m,g=-P(this.labelRotation),_=[],v,y,b,x,S,C,w,T,E,D,O,k,ee=`middle`;if(a===`top`)C=this.bottom-h,w=this._getXAxisLabelAlignment();else if(a===`bottom`)C=this.top+h,w=this._getXAxisLabelAlignment();else if(a===`left`){let e=this._getYAxisLabelAlignment(p);w=e.textAlign,S=e.x}else if(a===`right`){let e=this._getYAxisLabelAlignment(p);w=e.textAlign,S=e.x}else if(t===`x`){if(a===`center`)C=(e.top+e.bottom)/2+m;else if(i(a)){let e=Object.keys(a)[0],t=a[e];C=this.chart.scales[e].getPixelForValue(t)+m}w=this._getXAxisLabelAlignment()}else if(t===`y`){if(a===`center`)S=(e.left+e.right)/2-m;else if(i(a)){let e=Object.keys(a)[0],t=a[e];S=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(p).textAlign}t===`y`&&(l===`start`?ee=`top`:l===`end`&&(ee=`bottom`));let A=this._getLabelSizes();for(v=0,y=c.length;v<y;++v){b=c[v],x=b.label;let e=o.setContext(this.getContext(v));T=this.getPixelForTick(v)+o.labelOffset,E=this._resolveTickFontOptions(v),D=E.lineHeight,O=r(x)?x.length:1;let t=O/2,n=e.color,i=e.textStrokeColor,l=e.textStrokeWidth,d=w;s?(S=T,w===`inner`&&(d=v===y-1?this.options.reverse?`left`:`right`:v===0?this.options.reverse?`right`:`left`:`center`),k=a===`top`?u===`near`||g!==0?-O*D+D/2:u===`center`?-A.highest.height/2-t*D+D:-A.highest.height+D/2:u===`near`||g!==0?D/2:u===`center`?A.highest.height/2-t*D:A.highest.height-O*D,f&&(k*=-1)):(C=T,k=(1-O)*D/2);let p;if(e.showLabelBackdrop){let t=W(e.backdropPadding),n=A.heights[v],r=A.widths[v],i=C+k-t.top,a=S-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(w){case`center`:a-=r/2;break;case`right`:a-=r;break}p={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}_.push({rotation:g,label:x,font:E,color:n,strokeColor:i,strokeWidth:l,textOffset:k,textAlign:d,textBaseline:ee,translation:[S,C],backdrop:p})}return _}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-P(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{grid:n}}=this,r=n.setContext(this.getContext()),i=n.drawBorder?r.borderWidth:0;if(!i)return;let a=n.setContext(this.getContext(0)).lineWidth,o=this._borderValue,s,c,l,u;this.isHorizontal()?(s=Ft(e,this.left,i)-i/2,c=Ft(e,this.right,a)+a/2,l=u=o):(l=Ft(e,this.top,i)-i/2,u=Ft(e,this.bottom,a)+a/2,s=c=o),t.save(),t.lineWidth=r.borderWidth,t.strokeStyle=r.borderColor,t.beginPath(),t.moveTo(s,l),t.lineTo(c,u),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Bt(t,n);let r=this._labelItems||=this._computeLabelItems(e),i,a;for(i=0,a=r.length;i<a;++i){let e=r[i],n=e.font,a=e.label;e.backdrop&&(t.fillStyle=e.backdrop.color,t.fillRect(e.backdrop.left,e.backdrop.top,e.backdrop.width,e.backdrop.height));let o=e.textOffset;Wt(t,a,0,o,n,e)}n&&Vt(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:a}}=this;if(!n.display)return;let o=G(n.font),s=W(n.padding),c=n.align,l=o.lineHeight/2;t===`bottom`||t===`center`||i(t)?(l+=s.bottom,r(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=s.top;let{titleX:u,titleY:d,maxWidth:f,rotation:p}=Ii(this,l,t,c);Wt(e,n.text,0,0,o,{color:n.color,maxWidth:f,rotation:p,textAlign:Fi(c,t,a),textBaseline:`middle`,translation:[u,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=s(t.grid&&t.grid.z,-1);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r+1,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return G(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ri=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Vi(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,zi(e,a,n),this.override&&H.override(e.id,e.overrides),a)}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in H[r]&&(delete H[r][n],this.override&&delete Ot[n])}};function zi(e,t,n){let r=g(Object.create(null),[n?H.get(n):{},H.get(t),e.defaults]);H.set(t,r),e.defaultRoutes&&Bi(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors)}function Bi(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);H.route(a,i,c,s)})}function Vi(e){return`id`in e&&`defaults`in e}var Y=new class{constructor(){this.controllers=new Ri(q,`datasets`,!0),this.elements=new Ri(J,`elements`),this.plugins=new Ri(Object,`plugins`),this.scales=new Ri(Li,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):d(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=C(e);u(n[`before`+r],[],n),t[e](n),u(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},Hi=class extends q{update(e){let t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled,{start:i,count:a}=Ae(t,n,r);if(this._drawStart=i,this._drawCount=a,je(t)&&(i=0,a=n.length),this.options.showLine){let{dataset:i,_dataset:a}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;let o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:o},e)}this.updateElements(n,i,a,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=Y.getElement(`line`)),super.addElements()}updateElements(e,t,r,i){let a=i===`reset`,{iScale:o,vScale:s,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(t,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),p=o.axis,m=s.axis,{spanGaps:h,segment:g}=this.options,_=oe(h)?h:1/0,v=this.chart._animationsDisabled||a||i===`none`,y=t>0&&this.getParsed(t-1);for(let u=t;u<t+r;++u){let t=e[u],r=this.getParsed(u),h=v?t:{},b=n(r[m]),x=h[p]=o.getPixelForValue(r[p],u),S=h[m]=a||b?s.getBasePixel():s.getPixelForValue(c?this.applyStack(s,r,c):r[m],u);h.skip=isNaN(x)||isNaN(S)||b,h.stop=u>0&&Math.abs(r[p]-y[p])>_,g&&(h.parsed=r,h.raw=l.data[u]),f&&(h.options=d||this.resolveDataElementOptions(u,t.active?`active`:i)),v||this.updateElement(t,u,h,i),y=r}this.updateSharedOptions(d,i,u)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}};Hi.id=`scatter`,Hi.defaults={datasetElementType:!1,dataElementType:`point`,showLine:!1,fill:!1},Hi.overrides={interaction:{mode:`point`},plugins:{tooltip:{callbacks:{title(){return``},label(e){return`(`+e.label+`, `+e.formattedValue+`)`}}}},scales:{x:{type:`linear`},y:{type:`linear`}}};function Ui(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Wi=class{constructor(e){this.options=e||{}}init(e){}formats(){return Ui()}parse(e,t){return Ui()}format(e,t){return Ui()}add(e,t,n){return Ui()}diff(e,t,n){return Ui()}startOf(e,t,n){return Ui()}endOf(e,t){return Ui()}};Wi.override=function(e){Object.assign(Wi.prototype,e)};var Gi={_date:Wi};function Ki(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let e=s._reversePixels?ye:ve;if(!r)return e(a,t,n);if(i._sharedOptions){let r=a[0],i=typeof r.getRange==`function`&&r.getRange(t);if(i){let r=e(a,t,n-i),o=e(a,t,n+i);return{lo:r.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function qi(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Ki(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function Ji(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Yi(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||qi(e,n,t,function(n,o,s){!i&&!zt(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Xi(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=fe(e,{x:t.x,y:t.y});he(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return qi(e,n,t,a),i}function Zi(e,t,n,r,i,a){let o=[],s=Ji(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return qi(e,n,t,l),o}function Qi(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Xi(e,t,n,i):Zi(e,t,n,r,i,a)}function $i(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return qi(e,n,t,(e,r,c)=>{e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var ea={evaluateInteractionItems:qi,modes:{index(e,t,n,r){let i=Un(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Yi(e,i,a,r,o):Qi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Un(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Yi(e,i,a,r,o):Qi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Yi(e,Un(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=Un(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Qi(e,i,a,n.intersect,r,o)},x(e,t,n,r){return $i(e,Un(t,e),`x`,n.intersect,r)},y(e,t,n,r){return $i(e,Un(t,e),`y`,n.intersect,r)}}},ta=[`left`,`top`,`right`,`bottom`];function na(e,t){return e.filter(e=>e.pos===t)}function ra(e,t){return e.filter(e=>ta.indexOf(e.pos)===-1&&e.box.axis===t)}function ia(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function aa(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function oa(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!ta.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function sa(e,t){let n=oa(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function ca(e){let t=aa(e),n=ia(t.filter(e=>e.box.fullSize),!0),r=ia(na(t,`left`),!0),i=ia(na(t,`right`)),a=ia(na(t,`top`),!0),o=ia(na(t,`bottom`)),s=ra(t,`x`),c=ra(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:na(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function la(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function ua(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function da(e,t,n,r){let{pos:a,box:o}=n,s=e.maxPadding;if(!i(a)){n.size&&(e[a]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?o.height:o.width),n.size=t.size/t.count,e[a]+=n.size}o.getPadding&&ua(s,o.getPadding());let c=Math.max(0,t.outerWidth-la(s,e,`left`,`right`)),l=Math.max(0,t.outerHeight-la(s,e,`top`,`bottom`)),u=c!==e.w,d=l!==e.h;return e.w=c,e.h=l,n.horizontal?{same:u,other:d}:{same:d,other:u}}function fa(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function pa(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function ma(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,pa(s.horizontal,t));let{same:o,other:d}=da(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&ma(i,t,n,r)||u}function ha(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ga(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;w(c.start)&&(o=c.start),e.fullSize?ha(e,i.left,o,n.outerWidth-i.right-i.left,a):ha(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;w(c.start)&&(a=c.start),e.fullSize?ha(e,a,i.top,o,n.outerHeight-i.bottom-i.top):ha(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}H.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var X={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=W(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=ca(e.boxes),c=s.vertical,l=s.horizontal;d(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),p=Object.assign({},i);ua(p,W(r));let m=Object.assign({maxPadding:p,w:a,h:o,x:i.left,y:i.top},i),h=sa(c.concat(l),f);ma(s.fullSize,m,f,h),ma(c,m,f,h),ma(l,m,f,h)&&ma(c,m,f,h),fa(m),ga(s.leftAndTop,m,f,h),m.x+=m.w,m.y+=m.h,ga(s.rightAndBottom,m,f,h),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},d(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}},_a=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},va=class extends _a{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},ya=`$chartjs`,ba={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},xa=e=>e===null||e===``;function Sa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[ya]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,xa(i)){let t=Yn(e,`width`);t!==void 0&&(e.width=t)}if(xa(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=Yn(e,`height`);t!==void 0&&(e.height=t)}return e}var Ca=Jn?{passive:!0}:!1;function wa(e,t,n){e.addEventListener(t,n,Ca)}function Ta(e,t,n){e.canvas.removeEventListener(t,n,Ca)}function Ea(e,t){let n=ba[e.type]||e.type,{x:r,y:i}=Un(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function Da(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Oa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Da(n.addedNodes,r),t&&=!Da(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ka(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Da(n.removedNodes,r),t&&=!Da(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var Aa=new Map,ja=0;function Ma(){let e=window.devicePixelRatio;e!==ja&&(ja=e,Aa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Na(e,t){Aa.size||window.addEventListener(`resize`,Ma),Aa.set(e,t)}function Pa(e){Aa.delete(e),Aa.size||window.removeEventListener(`resize`,Ma)}function Fa(e,t,n){let r=e.canvas,i=r&&Fn(r);if(!i)return;let a=Ee((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),Na(e,a),o}function Ia(e,t,n){n&&n.disconnect(),t===`resize`&&Pa(e)}function La(e,t,n){let r=e.canvas,i=Ee(t=>{e.ctx!==null&&n(Ea(t,e))},e,e=>{let t=e[0];return[t,t.offsetX,t.offsetY]});return wa(r,t,i),i}var Ra=class extends _a{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(Sa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[ya])return!1;let r=t[ya].initial;[`height`,`width`].forEach(e=>{let i=r[e];n(i)?t.removeAttribute(e):t.setAttribute(e,i)});let i=r.style||{};return Object.keys(i).forEach(e=>{t.style[e]=i[e]}),t.width=t.width,delete t[ya],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:Oa,detach:ka,resize:Fa}[t]||La)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:Ia,detach:Ia,resize:Ia}[t]||Ta)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Kn(e,t,n,r)}isAttached(e){let t=Fn(e);return!!(t&&t.isConnected)}};function za(e){return!Pn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?va:Ra}var Ba=class{constructor(){this._init=[]}notify(e,t,n,r){t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`));let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`)),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(u(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){n(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=s(n.options&&n.options.plugins,{}),i=Va(n);return r===!1&&!t?[]:Ua(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Va(e){let t={},n=[],r=Object.keys(Y.plugins.items);for(let e=0;e<r.length;e++)n.push(Y.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Ha(e,t){return!t&&e===!1?null:e===!0?{}:e}function Ua(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=Ha(r[t],i);c!==null&&a.push({plugin:s,options:Wa(e.config,{plugin:s,local:n[t]},c,o)})}return a}function Wa(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(e,t){let n=H.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function Ka(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function qa(e,t){return e===t?`_index_`:`_value_`}function Ja(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function Ya(e,t){return e===`x`||e===`y`?e:t.axis||Ja(t.position)||e.charAt(0).toLowerCase()}function Xa(e,t){let n=Ot[e.type]||{scales:{}},r=t.scales||{},a=Ga(e.type,t),o=Object.create(null),s=Object.create(null);return Object.keys(r).forEach(e=>{let t=r[e];if(!i(t))return console.error(`Invalid scale configuration for scale: ${e}`);if(t._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);let c=Ya(e,t),l=qa(c,a),u=n.scales||{};o[c]=o[c]||e,s[e]=_(Object.create(null),[{axis:c},t,u[c],u[l]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,a=n.indexAxis||Ga(i,t),c=(Ot[i]||{}).scales||{};Object.keys(c).forEach(e=>{let t=Ka(e,a),i=n[t+`AxisID`]||o[t]||t;s[i]=s[i]||Object.create(null),_(s[i],[{axis:t},r[i],c[e]])})}),Object.keys(s).forEach(e=>{let t=s[e];_(t,[H.scales[t.type],H.scale])}),s}function Za(e){let t=e.options||={};t.plugins=s(t.plugins,{}),t.scales=Xa(e,t)}function Qa(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function $a(e){return e||={},e.data=Qa(e.data),Za(e),e}var eo=new Map,to=new Set;function no(e,t){let n=eo.get(e);return n||(n=t(),eo.set(e,n),to.add(n)),n}var ro=(e,t,n)=>{let r=b(t,n);r!==void 0&&e.add(r)},io=class{constructor(e){this._config=$a(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Qa(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),Za(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return no(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return no(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return no(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return no(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>ro(s,e,t))),t.forEach(e=>ro(s,r,e)),t.forEach(e=>ro(s,Ot[i]||{},e)),t.forEach(e=>ro(s,H,e)),t.forEach(e=>ro(s,kt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),to.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ot[t]||{},H.datasets[t]||{},{type:t},H,kt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=ao(this._resolverCache,e,r),s=a;if(so(a,t)){i.$shared=!1,n=T(n)?n():n;let t=this.createResolver(e,n,o);s=an(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:a}=ao(this._resolverCache,e,n);return i(t)?an(a,t,void 0,r):a}};function ao(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:rn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var oo=e=>i(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||T(e[n]),!1);function so(e,t){let{isScriptable:n,isIndexable:i}=on(e);for(let a of t){let t=n(a),o=i(a),s=(o||t)&&e[a];if(t&&(T(s)||oo(s))||o&&r(s))return!0}return!1}var co=`3.9.1`,lo=[`top`,`bottom`,`left`,`right`,`chartArea`];function uo(e,t){return e===`top`||e===`bottom`||lo.indexOf(e)===-1&&t===`x`}function fo(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function po(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),u(n&&n.onComplete,[e],t)}function mo(e){let t=e.chart,n=t.options.animation;u(n&&n.onProgress,[e],t)}function ho(e){return Pn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var go={},_o=e=>{let t=ho(e);return Object.values(go).filter(e=>e.canvas===t).pop()};function vo(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function yo(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var bo=class{constructor(e,n){let r=this.config=new io(n),i=ho(e),a=_o(i);if(a)throw Error(`Canvas is already in use. Chart with ID '`+a.id+`' must be destroyed before the canvas with ID '`+a.canvas.id+`' can be reused.`);let o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||(za(i))),this.platform.updateConfig(r);let s=this.platform.acquireContext(i,o.aspectRatio),c=s&&s.canvas,l=c&&c.height,u=c&&c.width;if(this.id=t(),this.ctx=s,this.canvas=c,this.width=u,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ba,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=De(e=>this.update(e),o.resizeDelay||0),this._dataChanges=[],go[this.id]=this,!s||!c){console.error(`Failed to create chart: can't acquire context from the given item`);return}K.listen(this,`complete`,po),K.listen(this,`progress`,mo),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:r,height:i,_aspectRatio:a}=this;return n(e)?t&&a?a:i?r/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():qn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return It(this.canvas,this.ctx),this}stop(){return K.stop(this),this}resize(e,t){K.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,qn(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),u(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){d(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=Ya(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),d(i,t=>{let i=t.options,a=i.id,o=Ya(a,i),c=s(i.type,t.dtype);(i.position===void 0||uo(i.position,o)!==uo(t.dposition))&&(i.position=t.dposition),r[a]=!0;let l=null;a in n&&n[a].type===c?l=n[a]:(l=new(Y.getScale(c))({id:a,type:c,ctx:this.ctx,chart:this}),n[l.id]=l),l.init(i,e)}),d(r,(e,t)=>{e||delete n[t]}),d(n,e=>{X.configure(this,e,e.options),X.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(fo(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||Ga(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=Y.getController(a),{datasetElementType:r,dataElementType:o}=H.datasets[a];Object.assign(t.prototype,{dataElementType:Y.getElement(o),datasetElementType:r&&Y.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){d(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||d(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(fo(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){d(this.scales,e=>{X.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!E(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)vo(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!E(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;X.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],d(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,T(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(K.has(this)?this.attached&&!K.running(this)&&K.start(this):(this.draw(),po({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resize(e,t),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n=e._clip,r=!n.disabled,i=this.chartArea,a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins(`beforeDatasetDraw`,a)!==!1&&(r&&Bt(t,{left:n.left===!1?0:i.left-n.left,right:n.right===!1?this.width:i.right+n.right,top:n.top===!1?0:i.top-n.top,bottom:n.bottom===!1?this.height:i.bottom+n.bottom}),e.controller.draw(),r&&Vt(t),a.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,a))}isPointInArea(e){return zt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=ea.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=nn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);w(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),K.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),It(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins(`destroy`),delete go[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};d(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){d(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},d(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});f(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=D(e),c=yo(e,this._lastEvent,n,s);n&&(this._lastEvent=null,u(i.onHover,[e,o,this],this),s&&u(i.onClick,[e,o,this],this));let l=!f(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}},xo=()=>d(bo.instances,e=>e._plugins.invalidate()),So=!0;Object.defineProperties(bo,{defaults:{enumerable:So,value:H},instances:{enumerable:So,value:go},overrides:{enumerable:So,value:Ot},registry:{enumerable:So,value:Y},version:{enumerable:So,value:co},getChart:{enumerable:So,value:_o},register:{enumerable:So,value:(...e)=>{Y.add(...e),xo()}},unregister:{enumerable:So,value:(...e)=>{Y.remove(...e),xo()}}});function Co(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+j,r-j),e.closePath(),e.clip()}function wo(e){return Qt(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function To(e,t,n,r){let i=wo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return I(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:I(i.innerStart,0,o),innerEnd:I(i.innerEnd,0,o)}}function Eo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Do(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/O)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=To(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,k=g+b/E,ee=_-x/D;if(e.beginPath(),a){if(e.arc(o,s,d,w,T),y>0){let t=Eo(C,T,o,s);e.arc(t.x,t.y,y,T,_+j)}let t=Eo(D,_,o,s);if(e.lineTo(t.x,t.y),x>0){let t=Eo(D,ee,o,s);e.arc(t.x,t.y,x,_+j,ee+Math.PI)}if(e.arc(o,s,f,_-x/f,g+b/f,!0),b>0){let t=Eo(E,k,o,s);e.arc(t.x,t.y,b,k+Math.PI,g-j)}let n=Eo(S,g,o,s);if(e.lineTo(n.x,n.y),v>0){let t=Eo(S,w,o,s);e.arc(t.x,t.y,v,g-j,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Oo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Do(e,t,n,r,o+k,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+s%k,s%k===0&&(c+=k))}return Do(e,t,n,r,c,i),e.fill(),c}function ko(e,t,n){let{x:r,y:i,startAngle:a,pixelMargin:o,fullCircles:s}=t,c=Math.max(t.outerRadius-o,0),l=t.innerRadius+o,u;for(n&&Co(e,t,a+k),e.beginPath(),e.arc(r,i,l,a+k,a,!0),u=0;u<s;++u)e.stroke();for(e.beginPath(),e.arc(r,i,c,a,a+k),u=0;u<s;++u)e.stroke()}function Ao(e,t,n,r,i,a){let{options:o}=t,{borderWidth:s,borderJoinStyle:c}=o,l=o.borderAlign===`inner`;s&&(l?(e.lineWidth=s*2,e.lineJoin=c||`round`):(e.lineWidth=s,e.lineJoin=c||`bevel`),t.fullCircles&&ko(e,t,l),l&&Co(e,t,i),Do(e,t,n,r,i,a),e.stroke())}var jo=class extends J{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=fe(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:c,outerRadius:l,circumference:u}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),d=this.options.spacing/2,f=s(u,o-a)>=k||he(r,a,o),p=L(i,c+d,l+d);return f&&p}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/2,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>k?Math.floor(n/k):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=0;if(r){o=r/2;let t=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(t)*o,Math.sin(t)*o),this.circumference>=O&&(o=r)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;let s=Oo(e,this,o,i,a);Ao(e,this,o,i,s,a),e.restore()}};jo.id=`arc`,jo.defaults={borderAlign:`center`,borderColor:`#fff`,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},jo.defaultRoutes={backgroundColor:`backgroundColor`};function Mo(e,t,n=t){e.lineCap=s(n.borderCapStyle,t.borderCapStyle),e.setLineDash(s(n.borderDash,t.borderDash)),e.lineDashOffset=s(n.borderDashOffset,t.borderDashOffset),e.lineJoin=s(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=s(n.borderWidth,t.borderWidth),e.strokeStyle=s(n.borderColor,t.borderColor)}function No(e,t,n){e.lineTo(n.x,n.y)}function Po(e){return e.stepped?Ht:e.tension||e.cubicInterpolationMode===`monotone`?Ut:No}function Fo(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function Io(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=Fo(i,n,r),u=Po(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function Lo(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=Fo(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Ro(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Lo:Io}function zo(e){return e.stepped?Zn:e.tension||e.cubicInterpolationMode===`monotone`?Qn:Xn}function Bo(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Mo(e,t.options),e.stroke(i)}function Vo(e,t,n,r){let{segments:i,options:a}=t,o=Ro(t);for(let s of i)Mo(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var Ho=typeof Path2D==`function`;function Uo(e,t,n,r){Ho&&!t.options.segment?Bo(e,t,n,r):Vo(e,t,n,r)}var Wo=class extends J{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Nn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=mr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=dr(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=zo(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return Ro(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=Ro(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),Uo(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};Wo.id=`line`,Wo.defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0},Wo.defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`},Wo.descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};function Go(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var Ko=class extends J{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return Go(this,e,`x`,t)}inYRange(e,t){return Go(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!zt(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Lt(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};Ko.id=`point`,Ko.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:`circle`,radius:3,rotation:0},Ko.defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};function qo(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function Jo(e,t,n,r){return e?0:I(t,n,r)}function Yo(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=$t(r);return{t:Jo(i.top,a.top,0,n),r:Jo(i.right,a.right,0,t),b:Jo(i.bottom,a.bottom,0,n),l:Jo(i.left,a.left,0,t)}}function Xo(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),a=e.options.borderRadius,o=U(a),s=Math.min(t,n),c=e.borderSkipped,l=r||i(a);return{topLeft:Jo(!l||c.top||c.left,o.topLeft,0,s),topRight:Jo(!l||c.top||c.right,o.topRight,0,s),bottomLeft:Jo(!l||c.bottom||c.left,o.bottomLeft,0,s),bottomRight:Jo(!l||c.bottom||c.right,o.bottomRight,0,s)}}function Zo(e){let t=qo(e),n=t.right-t.left,r=t.bottom-t.top,i=Yo(e,n/2,r/2),a=Xo(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function Qo(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&qo(e,r);return o&&(i||L(t,o.left,o.right))&&(a||L(n,o.top,o.bottom))}function $o(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function es(e,t){e.rect(t.x,t.y,t.w,t.h)}function ts(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var ns=class extends J{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=Zo(this),o=$o(a.radius)?qt:es;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,ts(a,t,i)),e.clip(),o(e,ts(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,ts(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return Qo(this,e,t,n)}inXRange(e,t){return Qo(this,e,null,t)}inYRange(e,t){return Qo(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}};ns.id=`bar`,ns.defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0},ns.defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};function rs(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=os(r,s,i);let c=is(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=dr(t,c);for(let t of l){let r=is(n,a[t.start],a[t.end],t.loop),s=ur(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:ss(c,r,`start`,Math.max)},end:{[n]:ss(c,r,`end`,Math.min)}})}}return o}function is(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=F(i),a=F(a)),{property:e,start:i,end:a}}function as(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=os(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function os(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function ss(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function cs(e,t){let n=[],i=!1;return r(e)?(i=!0,n=e):n=as(e,t),n.length?new Wo({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function ls(e){return e&&e.fill!==!1}function us(e,t,n){let r=e[t].fill,i=[t],o;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!a(r))return r;if(o=e[r],!o)return!1;if(o.visible)return r;i.push(r),r=o.fill}return!1}function ds(e,t,n){let r=hs(e);if(i(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return a(o)&&Math.floor(o)===o?fs(r[0],t,o,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function fs(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function ps(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:i(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function ms(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:i(e)?e.value:t.getBaseValue(),r}function hs(e){let t=e.options,n=t.fill,r=s(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function gs(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=_s(t,n);s.push(cs({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)vs(i,o[e],s)}return new Wo({points:i,options:{}})}function _s(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function vs(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=ys(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function ys(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(L(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var bs=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:k},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function xs(e){let{chart:t,fill:n,line:r}=e;if(a(n))return Ss(t,n);if(n===`stack`)return gs(e);if(n===`shape`)return!0;let i=Cs(e);return i instanceof bs?i:cs(i,r)}function Ss(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Cs(e){return(e.scale||{}).getPointPositionForValue?Ts(e):ws(e)}function ws(e){let{scale:t={},fill:n}=e,r=ps(n,t);if(a(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Ts(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=ms(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new bs({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function Es(e,t,n){let r=xs(t),{line:i,scale:a,axis:o}=t,s=i.options,c=s.fill,l=s.backgroundColor,{above:u=l,below:d=l}=c||{};r&&i.points.length&&(Bt(e,n),Ds(e,{line:i,target:r,above:u,below:d,area:n,scale:a,axis:o}),Vt(e))}function Ds(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s}=t,c=n._loop?`angle`:t.axis;e.save(),c===`x`&&a!==i&&(Os(e,r,o.top),ks(e,{line:n,target:r,color:i,scale:s,property:c}),e.restore(),e.save(),Os(e,r,o.bottom)),ks(e,{line:n,target:r,color:a,scale:s,property:c}),e.restore()}function Os(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[os(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ks(e,t){let{line:n,target:r,property:i,color:a,scale:o}=t,s=rs(n,r,i);for(let{source:t,target:c,start:l,end:u}of s){let{style:{backgroundColor:s=a}={}}=t,d=r!==!0;e.save(),e.fillStyle=s,As(e,o,d&&is(i,l,u)),e.beginPath();let f=!!n.pathSegment(e,t),p;if(d){f?e.closePath():js(e,r,u,i);let t=!!r.pathSegment(e,c,{move:f,reverse:!0});p=f&&t,p||js(e,r,l,i)}e.closePath(),e.fill(p?`evenodd`:`nonzero`),e.restore()}}function As(e,t,n){let{top:r,bottom:i}=t.chart.chartArea,{property:a,start:o,end:s}=n||{};a===`x`&&(e.beginPath(),e.rect(o,r,s-o,i-r),e.clip())}function js(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Ms={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof Wo&&(c={visible:e.isDatasetVisible(o),index:o,fill:ds(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=us(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Es(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;ls(n)&&Es(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!ls(r)||n.drawTime!==`beforeDatasetDraw`||Es(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Ns=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Ps=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Fs=class extends J{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=u(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=G(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Ns(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,i,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let h=n+t/2+i.measureText(e.text).width;a>0&&f+r+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:r},d=Math.max(d,h),f+=r+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=ir(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=R(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=R(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=R(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=R(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;Bt(e,this),this._draw(),Vt(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=H.color,c=ir(e.rtl,this.left,this.width),l=G(a.font),{color:u,padding:d}=a,f=l.size,p=f/2,m;this.drawTitle(),r.textAlign=c.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=l.string;let{boxWidth:h,boxHeight:g,itemHeight:_}=Ns(a,f),v=function(e,t,n){if(isNaN(h)||h<=0||isNaN(g)||g<0)return;r.save();let i=s(n.lineWidth,1);if(r.fillStyle=s(n.fillStyle,o),r.lineCap=s(n.lineCap,`butt`),r.lineDashOffset=s(n.lineDashOffset,0),r.lineJoin=s(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=s(n.strokeStyle,o),r.setLineDash(s(n.lineDash,[])),a.usePointStyle)Rt(r,{radius:g*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},c.xPlus(e,h/2),t+p,a.pointStyleWidth&&h);else{let a=t+Math.max((f-g)/2,0),o=c.leftForLtr(e,h),s=U(n.borderRadius);r.beginPath(),Object.values(s).some(e=>e!==0)?qt(r,{x:o,y:a,w:h,h:g,radius:s}):r.rect(o,a,h,g),r.fill(),i!==0&&r.stroke()}r.restore()},y=function(e,t,n){Wt(r,n.text,e,t+_/2,l,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})},b=this.isHorizontal(),x=this._computeTitleHeight();m=b?{x:R(i,this.left+d,this.right-n[0]),y:this.top+d+x,line:0}:{x:this.left+d,y:R(i,this.top+x+d,this.bottom-t[0].height),line:0},ar(this.ctx,e.textDirection);let S=_+d;this.legendItems.forEach((o,s)=>{r.strokeStyle=o.fontColor||u,r.fillStyle=o.fontColor||u;let l=r.measureText(o.text).width,f=c.textAlign(o.textAlign||=a.textAlign),g=h+p+l,_=m.x,C=m.y;c.setWidth(this.width),b?s>0&&_+g+d>this.right&&(C=m.y+=S,m.line++,_=m.x=R(i,this.left+d,this.right-n[m.line])):s>0&&C+S>this.bottom&&(_=m.x=_+t[m.line].width+d,m.line++,C=m.y=R(i,this.top+x+d,this.bottom-t[m.line].height)),v(c.x(_),C,o),_=ke(f,_+h+p,b?_+g:this.right,e.rtl),y(c.x(_),C,o),b?m.x+=g+d:m.y+=S}),or(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=G(t.font),r=W(t.padding);if(!t.display)return;let i=ir(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=R(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+R(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=R(o,u,u+d);a.textAlign=i.textAlign(Oe(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Wt(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=G(e.font),n=W(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(L(e,this.left,this.right)&&L(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],L(e,r.left,r.left+r.width)&&L(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!Is(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Ps(r,n);r&&!i&&u(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&u(t.onHover,[e,n,this],this)}else n&&u(t.onClick,[e,n,this],this)}};function Is(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var Ls={id:`legend`,_element:Fs,start(e,t,n){let r=e.legend=new Fs({ctx:e.ctx,options:n,chart:e});X.configure(e,r,n),X.addBox(e,r)},stop(e){X.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;X.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let o=e.controller.getStyle(n?0:void 0),s=W(o.borderWidth);return{text:t[e.index].label,fillStyle:o.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:o.borderColor,pointStyle:r||o.pointStyle,rotation:o.rotation,textAlign:i||o.textAlign,borderRadius:0,datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},Rs=class extends J{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let i=r(n.text)?n.text.length:1;this._padding=W(n.padding);let a=i*G(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=R(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=R(o,r,t),s=O*-.5):(l=i-e,u=R(o,t,r),s=O*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=G(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);Wt(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:Oe(t.align),textBaseline:`middle`,translation:[i,a]})}};function zs(e,t){let n=new Rs({ctx:e.ctx,options:t,chart:e});X.configure(e,n,t),X.addBox(e,n),e.titleBlock=n}var Bs={id:`title`,_element:Rs,start(e,t,n){zs(e,n)},stop(e){let t=e.titleBlock;X.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;X.configure(e,r,n),r.options=n},defaults:{align:`center`,display:!1,font:{weight:`bold`},fullSize:!0,padding:10,position:`top`,text:``,weight:2e3},defaultRoutes:{color:`color`},descriptors:{_scriptable:!0,_indexable:!1}},Vs={average(e){if(!e.length)return!1;let t,n,r=0,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r+=e.x,i+=e.y,++a}}return{x:r/a,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=pe(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function Z(e,t){return t&&(r(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Q(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
2
+ `)>-1?e.split(`
3
+ `):e}function Hs(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Us(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=G(t.bodyFont),l=G(t.titleFont),u=G(t.footerFont),f=a.length,p=i.length,m=r.length,h=W(t.padding),g=h.height,_=0,v=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*l.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),v){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;g+=m*e+(v-m)*c.lineHeight+(v-1)*t.bodySpacing}p&&(g+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let y=0,b=function(e){_=Math.max(_,n.measureText(e).width+y)};return n.save(),n.font=l.string,d(e.title,b),n.font=c.string,d(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?o+2+t.boxPadding:0,d(r,e=>{d(e.before,b),d(e.lines,b),d(e.after,b)}),y=0,n.font=u.string,d(e.footer,b),n.restore(),_+=h.width,{width:_,height:g}}function Ws(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function Gs(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function Ks(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Gs(l,e,t,n)&&(l=`center`),l}function qs(e,t,n){let r=n.yAlign||t.yAlign||Ws(e,n);return{xAlign:n.xAlign||t.xAlign||Ks(e,t,n,r),yAlign:r}}function Js(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function Ys(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function Xs(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=U(o),m=Js(t,s),h=Ys(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:I(m,0,r.width-t.width),y:I(h,0,r.height-t.height)}}function Zs(e,t,n){let r=W(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function Qs(e){return Z([],Q(e))}function $s(e,t,n){return nn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function ec(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var tc=class extends J{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new Tr(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=$s(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=n.beforeTitle.apply(this,[e]),i=n.title.apply(this,[e]),a=n.afterTitle.apply(this,[e]),o=[];return o=Z(o,Q(r)),o=Z(o,Q(i)),o=Z(o,Q(a)),o}getBeforeBody(e,t){return Qs(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){let{callbacks:n}=t,r=[];return d(e,e=>{let t={before:[],lines:[],after:[]},i=ec(n,e);Z(t.before,Q(i.beforeLabel.call(this,e))),Z(t.lines,i.label.call(this,e)),Z(t.after,Q(i.afterLabel.call(this,e))),r.push(t)}),r}getAfterBody(e,t){return Qs(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){let{callbacks:n}=t,r=n.beforeFooter.apply(this,[e]),i=n.footer.apply(this,[e]),a=n.afterFooter.apply(this,[e]),o=[];return o=Z(o,Q(r)),o=Z(o,Q(i)),o=Z(o,Q(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(Hs(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),d(o,t=>{let n=ec(e.callbacks,t);r.push(n.labelColor.call(this,t)),i.push(n.labelPointStyle.call(this,t)),a.push(n.labelTextColor.call(this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=Vs[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Us(this,n),o=Object.assign({},e,t),s=qs(this.chart,n,o),c=Xs(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=U(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=ir(n.rtl,this.x,this.width);for(e.x=Zs(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=G(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,a){let o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:c,boxWidth:l,boxPadding:u}=a,d=G(a.bodyFont),f=Zs(this,`left`,a),p=r.x(f),m=c<d.lineHeight?(d.lineHeight-c)/2:0,h=t.y+m;if(a.usePointStyle){let t={radius:Math.min(l,c)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=r.leftForLtr(p,l)+l/2,i=h+c/2;e.strokeStyle=a.multiKeyBackground,e.fillStyle=a.multiKeyBackground,Lt(e,t,n,i),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Lt(e,t,n,i)}else{e.lineWidth=i(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;let t=r.leftForLtr(p,l-u),n=r.leftForLtr(r.xPlus(p,1),l-u-2),s=U(o.borderRadius);Object.values(s).some(e=>e!==0)?(e.beginPath(),e.fillStyle=a.multiKeyBackground,qt(e,{x:t,y:h,w:l,h:c,radius:s}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),qt(e,{x:n,y:h+1,w:l-2,h:c-2,radius:s}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(t,h,l,c),e.strokeRect(t,h,l,c),e.fillStyle=o.backgroundColor,e.fillRect(n,h+1,l-2,c-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=G(n.bodyFont),f=u.lineHeight,p=0,m=ir(n.rtl,this.x,this.width),h=function(n){t.fillText(n,m.x(e.x+p),e.y+f/2),e.y+=f+i},g=m.textAlign(a),_,v,y,b,x,S,C;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=Zs(this,g,n),t.fillStyle=n.bodyColor,d(this.beforeBody,h),p=o&&g!==`right`?a===`center`?c/2+l:c+2+l:0,b=0,S=r.length;b<S;++b){for(_=r[b],v=this.labelTextColors[b],t.fillStyle=v,d(_.before,h),y=_.lines,o&&y.length&&(this._drawColorBox(t,e,b,m,n),f=Math.max(u.lineHeight,s)),x=0,C=y.length;x<C;++x)h(y[x]),f=u.lineHeight;d(_.after,h)}p=0,f=u.lineHeight,d(this.afterBody,h),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=ir(n.rtl,this.x,this.width);for(e.x=Zs(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=G(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=U(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=Vs[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Us(this,e),o=Object.assign({},n,this._size),s=qs(t,e,o),c=Xs(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=W(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),ar(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),or(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!f(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!f(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t;let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=Vs[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}};tc.positioners=Vs;var nc={id:`tooltip`,_element:tc,positioners:Vs,afterInit(e,t,n){n&&(e.tooltip=new tc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,n)===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:{beforeTitle:e,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:e,beforeBody:e,beforeLabel:e,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let r=e.formattedValue;return n(r)||(t+=r),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:e,afterBody:e,beforeFooter:e,footer:e,afterFooter:e}},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},rc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function ic(e,t,n,r){let i=e.indexOf(t);return i===-1?rc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var ac=(e,t)=>e===null?null:I(Math.round(e),0,t),oc=class extends Li{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(n(e))return null;let r=this.getLabels();return t=isFinite(t)&&r[t]===e?t:ic(r,e,s(t,e),this._addedLabels),ac(t,r.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-+!n,1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};oc.id=`category`,oc.defaults={ticks:{callback:oc.prototype.getLabelForValue}};function sc(e,t){let r=[],{bounds:i,step:a,min:o,max:s,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=a||1,m=u-1,{min:h,max:g}=t,_=!n(o),v=!n(s),y=!n(l),b=(g-h)/(d+1),x=ie((g-h)/m/p)*p,S,C,w,T;if(x<1e-14&&!_&&!v)return[{value:h},{value:g}];T=Math.ceil(g/x)-Math.floor(h/x),T>m&&(x=ie(T*x/m/p)*p),n(c)||(S=10**c,x=Math.ceil(x*S)/S),i===`ticks`?(C=Math.floor(h/x)*x,w=Math.ceil(g/x)*x):(C=h,w=g),_&&v&&a&&ce((s-o)/a,x/1e3)?(T=Math.round(Math.min((s-o)/x,u)),x=(s-o)/T,C=o,w=s):y?(C=_?o:C,w=v?s:w,T=l-1,x=(w-C)/T):(T=(w-C)/x,T=se(T,Math.round(T),x/1e3)?Math.round(T):Math.ceil(T));let E=Math.max(de(x),de(C));S=10**(n(c)?E:c),C=Math.round(C*S)/S,w=Math.round(w*S)/S;let D=0;for(_&&(f&&C!==o?(r.push({value:o}),C<o&&D++,se(Math.round((C+D*x)*S)/S,o,cc(o,b,e))&&D++):C<o&&D++);D<T;++D)r.push({value:Math.round((C+D*x)*S)/S});return v&&f&&w!==s?r.length&&se(r[r.length-1].value,s,cc(s,b,e))?r[r.length-1].value=s:r.push({value:s}):(!v||w===s)&&r.push({value:w}),r}function cc(e,t,{horizontal:n,minRotation:r}){let i=P(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var lc=class extends Li{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return n(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=N(r),t=N(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=1;(i>=2**53-1||r<=-(2**53-1))&&(t=Math.abs(i*.05)),o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=sc({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&le(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return tr(e,this.chart.options.locale,this.options.ticks.format)}},uc=class extends lc{determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=a(e)?e:0,this.max=a(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=P(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}};uc.id=`linear`,uc.defaults={ticks:{callback:vi.formatters.numeric}};function dc(e){return e/10**Math.floor(M(e))==1}function fc(e,t){let n=Math.floor(M(t.max)),r=Math.ceil(t.max/10**n),i=[],a=o(e.min,10**Math.floor(M(t.min))),s=Math.floor(M(a)),c=Math.floor(a/10**s),l=s<0?10**Math.abs(s):1;do i.push({value:a,major:dc(a)}),++c,c===10&&(c=1,++s,l=s>=0?1:l),a=Math.round(c*10**s*l)/l;while(s<n||s===n&&c<r);let u=o(e.max,a);return i.push({value:u,major:dc(a)}),i}var pc=class extends Li{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=lc.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return a(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=a(e)?Math.max(0,e):null,this.max=a(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e,o=(e,t)=>10**(Math.floor(M(e))+t);n===r&&(n<=0?(i(1),a(10)):(i(o(n,-1)),a(o(r,1)))),n<=0&&i(o(r,-1)),r<=0&&a(o(n,1)),this._zero&&this.min!==this._suggestedMin&&n===o(this.min,0)&&i(o(n,-1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=fc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&le(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:tr(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=M(e),this._valueRange=M(this.max)-M(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(M(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}};pc.id=`logarithmic`,pc.defaults={ticks:{callback:vi.formatters.logarithmic,major:{enabled:!0}}};function mc(e){let t=e.ticks;if(t.display&&e.display){let e=W(t.backdropPadding);return s(t.font&&t.font.size,H.font.size)+e.height}return 0}function hc(e,t,n){return n=r(n)?n:[n],{w:Pt(e,t.string,n),h:n.length*t.lineHeight}}function gc(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function _c(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?O/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=G(a.font),d=hc(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=F(e.getIndexAngle(c)+s),p=Math.round(ue(f));vc(n,t,f,gc(p,l.x,d.w,0,180),gc(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=yc(e,r,i)}function vc(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function yc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,o=mc(a)/2,s=e.drawingArea,c=a.pointLabels.centerPointLabels?O/i:0;for(let a=0;a<i;a++){let i=e.getPointPosition(a,s+o+n[a],c),l=Math.round(ue(F(i.angle+j))),u=t[a],d=Sc(i.y,u.h,l),f=bc(l),p=xc(i.x,u.w,f);r.push({x:i.x,y:d,textAlign:f,left:p,top:d,right:p+u.w,bottom:d+u.h})}return r}function bc(e){return e===0||e===180?`center`:e<180?`left`:`right`}function xc(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function Sc(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Cc(e,t){let{ctx:r,options:{pointLabels:i}}=e;for(let a=t-1;a>=0;a--){let t=i.setContext(e.getPointLabelContext(a)),o=G(t.font),{x:s,y:c,textAlign:l,left:u,top:d,right:f,bottom:p}=e._pointLabelItems[a],{backdropColor:m}=t;if(!n(m)){let e=U(t.borderRadius),n=W(t.backdropPadding);r.fillStyle=m;let i=u-n.left,a=d-n.top,o=f-u+n.width,s=p-d+n.height;Object.values(e).some(e=>e!==0)?(r.beginPath(),qt(r,{x:i,y:a,w:o,h:s,radius:e}),r.fill()):r.fillRect(i,a,o,s)}Wt(r,e._pointLabels[a],s,c+o.lineHeight/2,o,{color:t.color,textAlign:l,textBaseline:`middle`})}}function wc(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,k);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function Tc(e,t,n,r){let i=e.ctx,a=t.circular,{color:o,lineWidth:s}=t;!a&&!r||!o||!s||n<0||(i.save(),i.strokeStyle=o,i.lineWidth=s,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),wc(e,n,a,r),i.closePath(),i.stroke(),i.restore())}function Ec(e,t,n){return nn(e,{label:n,index:t,type:`pointLabel`})}var Dc=class extends lc{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=W(mc(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=a(e)&&!isNaN(e)?e:0,this.max=a(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/mc(this.options))}generateTickLabels(e){lc.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=u(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?_c(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=k/(this._pointLabels.length||1),n=this.options.startAngle||0;return F(e*t+P(n))}getDistanceFromCenterForValue(e){if(n(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(n(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return Ec(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-j+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),wc(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r}=t,i=this._pointLabels.length,a,o,s;if(t.pointLabels.display&&Cc(this,i),r.display&&this.ticks.forEach((e,t)=>{if(t!==0){o=this.getDistanceFromCenterForValue(e.value);let n=r.setContext(this.getContext(t-1));Tc(this,n,o,i)}}),n.display){for(e.save(),a=i-1;a>=0;a--){let r=n.setContext(this.getPointLabelContext(a)),{color:i,lineWidth:c}=r;!c||!i||(e.lineWidth=c,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,o=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),s=this.getPointPosition(a,o),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(s.x,s.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=G(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=W(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}Wt(e,r.label,0,-i,c,{color:s.color})}),e.restore()}drawTitle(){}};Dc.id=`radialLinear`,Dc.defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}},Dc.defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`},Dc.descriptors={angleLines:{_fallback:`grid`}};var Oc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},$=Object.keys(Oc);function kc(e,t){return e-t}function Ac(e,t){if(n(t))return null;let r=e._adapter,{parser:i,round:o,isoWeekday:s}=e._parseOpts,c=t;return typeof i==`function`&&(c=i(c)),a(c)||(c=typeof i==`string`?r.parse(c,i):r.parse(c)),c===null?null:(o&&(c=o===`week`&&(oe(s)||s===!0)?r.startOf(c,`isoWeek`,s):r.startOf(c,o)),+c)}function jc(e,t,n,r){let i=$.length;for(let a=$.indexOf(e);a<i-1;++a){let e=Oc[$[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return $[a]}return $[i-1]}function Mc(e,t,n,r,i){for(let a=$.length-1;a>=$.indexOf(n);a--){let n=$[a];if(Oc[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return $[n?$.indexOf(n):0]}function Nc(e){for(let t=$.indexOf(e)+1,n=$.length;t<n;++t)if(Oc[$[t]].common)return $[t]}function Pc(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=_e(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function Fc(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Ic(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:Fc(e,r,i,n)}var Lc=class extends Li{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){let n=e.time||={},r=this._adapter=new Gi._date(e.adapters.date);r.init(t),_(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Ac(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:o,maxDefined:s}=this.getUserBounds();function c(e){!o&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!s&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!o||!s)&&(c(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&c(this.getMinMax(!1))),r=a(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=a(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=be(r,i,a);return this._unit=t.unit||(n.autoSkip?jc(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):Mc(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:Nc(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),Ic(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=I(t,0,a),n=I(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||jc(i.minUnit,t,n,this._getLabelCapacity(t)),o=s(i.stepSize,1),c=a===`week`?i.isoWeekday:!1,l=oe(c)||c===!0,u={},d=t,f,p;if(l&&(d=+e.startOf(d,`isoWeek`,c)),d=+e.startOf(d,l?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let m=r.ticks.source===`data`&&this.getDataTimestamps();for(f=d,p=0;f<n;f=+e.add(f,o,a),p++)Pc(u,f,m);return(f===n||r.bounds===`ticks`||p===1)&&Pc(u,f,m),Object.keys(u).sort((e,t)=>e-t).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.time.displayFormats,o=this._unit,s=this._majorUnit,c=o&&a[o],l=s&&a[s],d=n[t],f=s&&l&&d&&d.major,p=this._adapter.format(e,r||(f?l:c)),m=i.ticks.callback;return m?u(m,[p,t,n],this):p}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=P(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,Ic(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(Ac(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return we(e.sort(kc))}};Lc.id=`time`,Lc.defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,major:{enabled:!1}}};function Rc(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ve(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ve(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}var zc=class extends Lc{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Rc(t,this.min),this._tableRange=Rc(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Rc(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Rc(this._table,n*this._tableRange+this._minPos,!0)}};zc.id=`timeseries`,zc.defaults=Lc.defaults;export{d as A,G as B,re as C,H as D,Bt as E,a as F,s as G,P as H,i as I,g as L,T as M,n as N,w as O,oe as P,en as R,k as S,u as T,U,W as V,Vt as W,nc as _,oc as a,ne as b,fi as c,Ko as d,Lc as f,Bs as g,Ls as h,ns as i,r as j,pe as k,Wo as l,Ms as m,jo as n,bo as o,Gi as p,ci as r,J as s,Tr as t,uc as u,j as v,qt as w,te as x,O as y,ue as z};