unleash-server 7.2.1 → 7.2.3

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 (385) hide show
  1. package/README.md +21 -10
  2. package/dist/lib/db/feature-environment-store.d.ts +1 -1
  3. package/dist/lib/db/feature-environment-store.d.ts.map +1 -1
  4. package/dist/lib/db/feature-environment-store.js +42 -35
  5. package/dist/lib/db/feature-environment-store.js.map +1 -1
  6. package/dist/lib/db/index.d.ts.map +1 -1
  7. package/dist/lib/db/index.js +2 -0
  8. package/dist/lib/db/index.js.map +1 -1
  9. package/dist/lib/error/unleash-error.d.ts.map +1 -1
  10. package/dist/lib/error/unleash-error.js +2 -2
  11. package/dist/lib/error/unleash-error.js.map +1 -1
  12. package/dist/lib/events/index.d.ts +7 -1
  13. package/dist/lib/events/index.d.ts.map +1 -1
  14. package/dist/lib/events/index.js +12 -0
  15. package/dist/lib/events/index.js.map +1 -1
  16. package/dist/lib/features/api-tokens/createApiTokenService.d.ts +2 -0
  17. package/dist/lib/features/api-tokens/createApiTokenService.d.ts.map +1 -1
  18. package/dist/lib/features/api-tokens/createApiTokenService.js +6 -2
  19. package/dist/lib/features/api-tokens/createApiTokenService.js.map +1 -1
  20. package/dist/lib/features/client-feature-toggles/client-feature-toggle.controller.d.ts.map +1 -1
  21. package/dist/lib/features/client-feature-toggles/client-feature-toggle.controller.js +2 -9
  22. package/dist/lib/features/client-feature-toggles/client-feature-toggle.controller.js.map +1 -1
  23. package/dist/lib/features/dependent-features/dependent.features.e2e.test.js +28 -29
  24. package/dist/lib/features/dependent-features/dependent.features.e2e.test.js.map +1 -1
  25. package/dist/lib/features/feature-toggle/createFeatureToggleService.d.ts.map +1 -1
  26. package/dist/lib/features/feature-toggle/createFeatureToggleService.js +14 -4
  27. package/dist/lib/features/feature-toggle/createFeatureToggleService.js.map +1 -1
  28. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.d.ts.map +1 -1
  29. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.js +2 -1
  30. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.js.map +1 -1
  31. package/dist/lib/features/feature-toggle/feature-toggle-service.d.ts +9 -3
  32. package/dist/lib/features/feature-toggle/feature-toggle-service.d.ts.map +1 -1
  33. package/dist/lib/features/feature-toggle/feature-toggle-service.js +23 -7
  34. package/dist/lib/features/feature-toggle/feature-toggle-service.js.map +1 -1
  35. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.d.ts.map +1 -1
  36. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.js +3 -3
  37. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.js.map +1 -1
  38. package/dist/lib/features/feature-toggle/tests/feature-toggles.e2e.test.js +34 -35
  39. package/dist/lib/features/feature-toggle/tests/feature-toggles.e2e.test.js.map +1 -1
  40. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.js +1 -1
  41. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.js.map +1 -1
  42. package/dist/lib/features/metrics/impact/batch-histogram.d.ts +36 -0
  43. package/dist/lib/features/metrics/impact/batch-histogram.d.ts.map +1 -0
  44. package/dist/lib/features/metrics/impact/batch-histogram.js +87 -0
  45. package/dist/lib/features/metrics/impact/batch-histogram.js.map +1 -0
  46. package/dist/lib/features/metrics/impact/batch-histogram.test.d.ts +2 -0
  47. package/dist/lib/features/metrics/impact/batch-histogram.test.d.ts.map +1 -0
  48. package/dist/lib/features/metrics/impact/batch-histogram.test.js +137 -0
  49. package/dist/lib/features/metrics/impact/batch-histogram.test.js.map +1 -0
  50. package/dist/lib/features/metrics/impact/define-impact-metrics.d.ts +2 -0
  51. package/dist/lib/features/metrics/impact/define-impact-metrics.d.ts.map +1 -1
  52. package/dist/lib/features/metrics/impact/define-impact-metrics.js +4 -0
  53. package/dist/lib/features/metrics/impact/define-impact-metrics.js.map +1 -1
  54. package/dist/lib/features/metrics/impact/impact-metrics.e2e.test.js +49 -0
  55. package/dist/lib/features/metrics/impact/impact-metrics.e2e.test.js.map +1 -1
  56. package/dist/lib/features/metrics/impact/metrics-translator.d.ts +22 -4
  57. package/dist/lib/features/metrics/impact/metrics-translator.d.ts.map +1 -1
  58. package/dist/lib/features/metrics/impact/metrics-translator.js +58 -2
  59. package/dist/lib/features/metrics/impact/metrics-translator.js.map +1 -1
  60. package/dist/lib/features/metrics/impact/metrics-translator.test.js +83 -0
  61. package/dist/lib/features/metrics/impact/metrics-translator.test.js.map +1 -1
  62. package/dist/lib/features/metrics/shared/schema.d.ts +1 -0
  63. package/dist/lib/features/metrics/shared/schema.d.ts.map +1 -1
  64. package/dist/lib/features/metrics/shared/schema.js +27 -1
  65. package/dist/lib/features/metrics/shared/schema.js.map +1 -1
  66. package/dist/lib/features/project/createProjectService.d.ts.map +1 -1
  67. package/dist/lib/features/project/createProjectService.js +7 -5
  68. package/dist/lib/features/project/createProjectService.js.map +1 -1
  69. package/dist/lib/features/project/project-service.d.ts +3 -2
  70. package/dist/lib/features/project/project-service.d.ts.map +1 -1
  71. package/dist/lib/features/project/project-service.js +4 -3
  72. package/dist/lib/features/project/project-service.js.map +1 -1
  73. package/dist/lib/features/release-plans/release-plan-milestone-store.d.ts +2 -2
  74. package/dist/lib/features/release-plans/release-plan-milestone-store.d.ts.map +1 -1
  75. package/dist/lib/features/release-plans/release-plan-milestone-store.js +3 -0
  76. package/dist/lib/features/release-plans/release-plan-milestone-store.js.map +1 -1
  77. package/dist/lib/features/release-plans/release-plan-milestone.d.ts +6 -0
  78. package/dist/lib/features/release-plans/release-plan-milestone.d.ts.map +1 -1
  79. package/dist/lib/features/release-plans/release-plan-read-model-type.d.ts +5 -0
  80. package/dist/lib/features/release-plans/release-plan-read-model-type.d.ts.map +1 -0
  81. package/dist/lib/features/release-plans/release-plan-read-model-type.js +2 -0
  82. package/dist/lib/features/release-plans/release-plan-read-model-type.js.map +1 -0
  83. package/dist/lib/features/release-plans/release-plan-read-model.d.ts +11 -0
  84. package/dist/lib/features/release-plans/release-plan-read-model.d.ts.map +1 -0
  85. package/dist/lib/features/release-plans/release-plan-read-model.js +133 -0
  86. package/dist/lib/features/release-plans/release-plan-read-model.js.map +1 -0
  87. package/dist/lib/features/release-plans/release-plan-read-model.test.d.ts +2 -0
  88. package/dist/lib/features/release-plans/release-plan-read-model.test.d.ts.map +1 -0
  89. package/dist/lib/features/release-plans/release-plan-read-model.test.js +166 -0
  90. package/dist/lib/features/release-plans/release-plan-read-model.test.js.map +1 -0
  91. package/dist/lib/features/release-plans/release-plan-store.d.ts +1 -1
  92. package/dist/lib/features/release-plans/release-plan-store.d.ts.map +1 -1
  93. package/dist/lib/features/release-plans/release-plan-store.js +16 -15
  94. package/dist/lib/features/release-plans/release-plan-store.js.map +1 -1
  95. package/dist/lib/features/release-plans/release-plan-template.d.ts +2 -2
  96. package/dist/lib/features/release-plans/release-plan-template.d.ts.map +1 -1
  97. package/dist/lib/features/release-plans/release-plan.d.ts +1 -1
  98. package/dist/lib/features/release-plans/release-plan.d.ts.map +1 -1
  99. package/dist/lib/features/resource-limits/resource-limits-service.d.ts +8 -0
  100. package/dist/lib/features/resource-limits/resource-limits-service.d.ts.map +1 -0
  101. package/dist/lib/features/resource-limits/resource-limits-service.js +9 -0
  102. package/dist/lib/features/resource-limits/resource-limits-service.js.map +1 -0
  103. package/dist/lib/features/segment/createSegmentService.d.ts.map +1 -1
  104. package/dist/lib/features/segment/createSegmentService.js +5 -3
  105. package/dist/lib/features/segment/createSegmentService.js.map +1 -1
  106. package/dist/lib/features/segment/segment-service.d.ts +3 -2
  107. package/dist/lib/features/segment/segment-service.d.ts.map +1 -1
  108. package/dist/lib/features/segment/segment-service.js +3 -3
  109. package/dist/lib/features/segment/segment-service.js.map +1 -1
  110. package/dist/lib/features/users/user-store.d.ts +2 -0
  111. package/dist/lib/features/users/user-store.d.ts.map +1 -1
  112. package/dist/lib/features/users/user-store.js +3 -2
  113. package/dist/lib/features/users/user-store.js.map +1 -1
  114. package/dist/lib/features/users/user-updates-read-model.d.ts +27 -0
  115. package/dist/lib/features/users/user-updates-read-model.d.ts.map +1 -0
  116. package/dist/lib/features/users/user-updates-read-model.js +68 -0
  117. package/dist/lib/features/users/user-updates-read-model.js.map +1 -0
  118. package/dist/lib/features/users/user-updates-read-model.test.d.ts +2 -0
  119. package/dist/lib/features/users/user-updates-read-model.test.d.ts.map +1 -0
  120. package/dist/lib/features/users/user-updates-read-model.test.js +50 -0
  121. package/dist/lib/features/users/user-updates-read-model.test.js.map +1 -0
  122. package/dist/lib/metrics.d.ts.map +1 -1
  123. package/dist/lib/metrics.js +8 -6
  124. package/dist/lib/metrics.js.map +1 -1
  125. package/dist/lib/openapi/spec/bulk-metrics-schema.d.ts +126 -39
  126. package/dist/lib/openapi/spec/bulk-metrics-schema.d.ts.map +1 -1
  127. package/dist/lib/openapi/spec/event-schema.d.ts +1 -1
  128. package/dist/lib/openapi/spec/event-search-response-schema.d.ts +1 -1
  129. package/dist/lib/openapi/spec/events-schema.d.ts +1 -1
  130. package/dist/lib/openapi/spec/export-result-schema.d.ts +12304 -1250
  131. package/dist/lib/openapi/spec/export-result-schema.d.ts.map +1 -1
  132. package/dist/lib/openapi/spec/export-result-schema.js +12 -0
  133. package/dist/lib/openapi/spec/export-result-schema.js.map +1 -1
  134. package/dist/lib/openapi/spec/feature-environment-schema.d.ts +2767 -0
  135. package/dist/lib/openapi/spec/feature-environment-schema.d.ts.map +1 -1
  136. package/dist/lib/openapi/spec/feature-environment-schema.js +19 -0
  137. package/dist/lib/openapi/spec/feature-environment-schema.js.map +1 -1
  138. package/dist/lib/openapi/spec/feature-events-schema.d.ts +1 -1
  139. package/dist/lib/openapi/spec/feature-schema.d.ts +5808 -281
  140. package/dist/lib/openapi/spec/feature-schema.d.ts.map +1 -1
  141. package/dist/lib/openapi/spec/feature-schema.js +12 -0
  142. package/dist/lib/openapi/spec/feature-schema.js.map +1 -1
  143. package/dist/lib/openapi/spec/feature-search-environment-schema.d.ts +5613 -79
  144. package/dist/lib/openapi/spec/feature-search-environment-schema.d.ts.map +1 -1
  145. package/dist/lib/openapi/spec/feature-search-environment-schema.js +12 -0
  146. package/dist/lib/openapi/spec/feature-search-environment-schema.js.map +1 -1
  147. package/dist/lib/openapi/spec/feature-search-query-parameters.d.ts +2 -1
  148. package/dist/lib/openapi/spec/feature-search-query-parameters.d.ts.map +1 -1
  149. package/dist/lib/openapi/spec/feature-search-query-parameters.js +2 -1
  150. package/dist/lib/openapi/spec/feature-search-query-parameters.js.map +1 -1
  151. package/dist/lib/openapi/spec/feature-search-response-schema.d.ts +5613 -79
  152. package/dist/lib/openapi/spec/feature-search-response-schema.d.ts.map +1 -1
  153. package/dist/lib/openapi/spec/health-overview-schema.d.ts +11432 -605
  154. package/dist/lib/openapi/spec/health-overview-schema.d.ts.map +1 -1
  155. package/dist/lib/openapi/spec/health-overview-schema.js +8 -0
  156. package/dist/lib/openapi/spec/health-overview-schema.js.map +1 -1
  157. package/dist/lib/openapi/spec/health-report-schema.d.ts +11432 -605
  158. package/dist/lib/openapi/spec/health-report-schema.d.ts.map +1 -1
  159. package/dist/lib/openapi/spec/impact-metrics-schema.d.ts +126 -39
  160. package/dist/lib/openapi/spec/impact-metrics-schema.d.ts.map +1 -1
  161. package/dist/lib/openapi/spec/impact-metrics-schema.js +128 -39
  162. package/dist/lib/openapi/spec/impact-metrics-schema.js.map +1 -1
  163. package/dist/lib/openapi/spec/import-toggles-schema.d.ts +24822 -2714
  164. package/dist/lib/openapi/spec/import-toggles-schema.d.ts.map +1 -1
  165. package/dist/lib/openapi/spec/import-toggles-schema.js +12 -0
  166. package/dist/lib/openapi/spec/import-toggles-schema.js.map +1 -1
  167. package/dist/lib/openapi/spec/index.d.ts +6 -0
  168. package/dist/lib/openapi/spec/index.d.ts.map +1 -1
  169. package/dist/lib/openapi/spec/index.js +6 -0
  170. package/dist/lib/openapi/spec/index.js.map +1 -1
  171. package/dist/lib/openapi/spec/integration-event-schema.d.ts +1 -1
  172. package/dist/lib/openapi/spec/integration-events-schema.d.ts +2 -2
  173. package/dist/lib/openapi/spec/patch-schema.d.ts +1 -1
  174. package/dist/lib/openapi/spec/patch-schema.js +1 -1
  175. package/dist/lib/openapi/spec/patch-schema.js.map +1 -1
  176. package/dist/lib/openapi/spec/patches-schema.d.ts +1 -1
  177. package/dist/lib/openapi/spec/profile-schema.d.ts +5808 -281
  178. package/dist/lib/openapi/spec/profile-schema.d.ts.map +1 -1
  179. package/dist/lib/openapi/spec/project-overview-schema.d.ts +11641 -814
  180. package/dist/lib/openapi/spec/project-overview-schema.d.ts.map +1 -1
  181. package/dist/lib/openapi/spec/project-overview-schema.js +8 -0
  182. package/dist/lib/openapi/spec/project-overview-schema.js.map +1 -1
  183. package/dist/lib/openapi/spec/release-plan-milestone-schema.d.ts +716 -0
  184. package/dist/lib/openapi/spec/release-plan-milestone-schema.d.ts.map +1 -0
  185. package/dist/lib/openapi/spec/release-plan-milestone-schema.js +72 -0
  186. package/dist/lib/openapi/spec/release-plan-milestone-schema.js.map +1 -0
  187. package/dist/lib/openapi/spec/release-plan-milestone-strategy-schema.d.ts +361 -0
  188. package/dist/lib/openapi/spec/release-plan-milestone-strategy-schema.d.ts.map +1 -0
  189. package/dist/lib/openapi/spec/release-plan-milestone-strategy-schema.js +40 -0
  190. package/dist/lib/openapi/spec/release-plan-milestone-strategy-schema.js.map +1 -0
  191. package/dist/lib/openapi/spec/release-plan-schema.d.ts +1449 -0
  192. package/dist/lib/openapi/spec/release-plan-schema.d.ts.map +1 -0
  193. package/dist/lib/openapi/spec/release-plan-schema.js +74 -0
  194. package/dist/lib/openapi/spec/release-plan-schema.js.map +1 -0
  195. package/dist/lib/openapi/spec/release-plan-template-id-schema.d.ts +19 -0
  196. package/dist/lib/openapi/spec/release-plan-template-id-schema.d.ts.map +1 -0
  197. package/dist/lib/openapi/spec/release-plan-template-id-schema.js +17 -0
  198. package/dist/lib/openapi/spec/release-plan-template-id-schema.js.map +1 -0
  199. package/dist/lib/openapi/spec/release-plan-template-schema.d.ts +1434 -0
  200. package/dist/lib/openapi/spec/release-plan-template-schema.d.ts.map +1 -0
  201. package/dist/lib/openapi/spec/release-plan-template-schema.js +79 -0
  202. package/dist/lib/openapi/spec/release-plan-template-schema.js.map +1 -0
  203. package/dist/lib/openapi/spec/search-features-schema.d.ts +11793 -725
  204. package/dist/lib/openapi/spec/search-features-schema.d.ts.map +1 -1
  205. package/dist/lib/openapi/spec/transition-condition-schema.d.ts +19 -0
  206. package/dist/lib/openapi/spec/transition-condition-schema.d.ts.map +1 -0
  207. package/dist/lib/openapi/spec/transition-condition-schema.js +17 -0
  208. package/dist/lib/openapi/spec/transition-condition-schema.js.map +1 -0
  209. package/dist/lib/routes/admin-api/index.js +2 -2
  210. package/dist/lib/routes/admin-api/index.js.map +1 -1
  211. package/dist/lib/routes/backstage.test.js +17 -5
  212. package/dist/lib/routes/backstage.test.js.map +1 -1
  213. package/dist/lib/routes/util.d.ts.map +1 -1
  214. package/dist/lib/routes/util.js +19 -1
  215. package/dist/lib/routes/util.js.map +1 -1
  216. package/dist/lib/server-impl.d.ts +8 -3
  217. package/dist/lib/server-impl.d.ts.map +1 -1
  218. package/dist/lib/server-impl.js +5 -1
  219. package/dist/lib/server-impl.js.map +1 -1
  220. package/dist/lib/services/api-token-service.d.ts +3 -2
  221. package/dist/lib/services/api-token-service.d.ts.map +1 -1
  222. package/dist/lib/services/api-token-service.js +3 -3
  223. package/dist/lib/services/api-token-service.js.map +1 -1
  224. package/dist/lib/services/index.d.ts +5 -1
  225. package/dist/lib/services/index.d.ts.map +1 -1
  226. package/dist/lib/services/index.js +16 -2
  227. package/dist/lib/services/index.js.map +1 -1
  228. package/dist/lib/services/user-service.d.ts.map +1 -1
  229. package/dist/lib/services/user-service.js +19 -3
  230. package/dist/lib/services/user-service.js.map +1 -1
  231. package/dist/lib/types/events.d.ts +41 -0
  232. package/dist/lib/types/events.d.ts.map +1 -1
  233. package/dist/lib/types/events.js +29 -1
  234. package/dist/lib/types/events.js.map +1 -1
  235. package/dist/lib/types/experimental.d.ts +3 -1
  236. package/dist/lib/types/experimental.d.ts.map +1 -1
  237. package/dist/lib/types/experimental.js +7 -6
  238. package/dist/lib/types/experimental.js.map +1 -1
  239. package/dist/lib/types/stores/feature-environment-store.d.ts +1 -1
  240. package/dist/lib/types/stores/feature-environment-store.d.ts.map +1 -1
  241. package/dist/lib/types/stores.d.ts +2 -0
  242. package/dist/lib/types/stores.d.ts.map +1 -1
  243. package/dist/lib/types/stores.js.map +1 -1
  244. package/dist/lib/ui-config/ui-config-controller.d.ts +24 -0
  245. package/dist/lib/ui-config/ui-config-controller.d.ts.map +1 -0
  246. package/dist/lib/{routes/admin-api/config.js → ui-config/ui-config-controller.js} +21 -17
  247. package/dist/lib/ui-config/ui-config-controller.js.map +1 -0
  248. package/dist/lib/ui-config/ui-config-service.d.ts +18 -0
  249. package/dist/lib/ui-config/ui-config-service.d.ts.map +1 -0
  250. package/dist/lib/ui-config/ui-config-service.js +64 -0
  251. package/dist/lib/ui-config/ui-config-service.js.map +1 -0
  252. package/dist/lib/ui-config/ui-config.test.d.ts +2 -0
  253. package/dist/lib/ui-config/ui-config.test.d.ts.map +1 -0
  254. package/dist/lib/{routes/admin-api/config.test.js → ui-config/ui-config.test.js} +6 -6
  255. package/dist/lib/ui-config/ui-config.test.js.map +1 -0
  256. package/dist/lib/util/metrics/createGauge.d.ts +17 -1
  257. package/dist/lib/util/metrics/createGauge.d.ts.map +1 -1
  258. package/dist/lib/util/metrics/createGauge.js +49 -4
  259. package/dist/lib/util/metrics/createGauge.js.map +1 -1
  260. package/dist/lib/util/random-id.js +2 -2
  261. package/dist/lib/util/random-id.js.map +1 -1
  262. package/dist/lib/util/random-id.test.d.ts +2 -0
  263. package/dist/lib/util/random-id.test.d.ts.map +1 -0
  264. package/dist/lib/util/random-id.test.js +7 -0
  265. package/dist/lib/util/random-id.test.js.map +1 -0
  266. package/dist/migrations/20210218090213-generate-server-identifier.js +2 -2
  267. package/dist/migrations/20210218090213-generate-server-identifier.js.map +1 -1
  268. package/dist/migrations/20210615115226-migrate-strategies-to-feature-strategies.js +2 -2
  269. package/dist/migrations/20210615115226-migrate-strategies-to-feature-strategies.js.map +1 -1
  270. package/dist/migrations/20250923130348-add-users-updated-at.d.ts +3 -0
  271. package/dist/migrations/20250923130348-add-users-updated-at.d.ts.map +1 -0
  272. package/dist/migrations/20250923130348-add-users-updated-at.js +40 -0
  273. package/dist/migrations/20250923130348-add-users-updated-at.js.map +1 -0
  274. package/dist/migrations/20251002095623-not-null-constraints.d.ts +3 -0
  275. package/dist/migrations/20251002095623-not-null-constraints.d.ts.map +1 -0
  276. package/dist/migrations/20251002095623-not-null-constraints.js +20 -0
  277. package/dist/migrations/20251002095623-not-null-constraints.js.map +1 -0
  278. package/dist/migrations/20251003105758-add-milestone-started-at.d.ts +3 -0
  279. package/dist/migrations/20251003105758-add-milestone-started-at.d.ts.map +1 -0
  280. package/dist/migrations/20251003105758-add-milestone-started-at.js +8 -0
  281. package/dist/migrations/20251003105758-add-milestone-started-at.js.map +1 -0
  282. package/dist/migrations/20251006111609-add-milestone-progressions.d.ts +3 -0
  283. package/dist/migrations/20251006111609-add-milestone-progressions.d.ts.map +1 -0
  284. package/dist/migrations/20251006111609-add-milestone-progressions.js +15 -0
  285. package/dist/migrations/20251006111609-add-milestone-progressions.js.map +1 -0
  286. package/dist/migrations/20251009081052-add-milestone-progression-executed-at.d.ts +3 -0
  287. package/dist/migrations/20251009081052-add-milestone-progression-executed-at.d.ts.map +1 -0
  288. package/dist/migrations/20251009081052-add-milestone-progression-executed-at.js +14 -0
  289. package/dist/migrations/20251009081052-add-milestone-progression-executed-at.js.map +1 -0
  290. package/dist/migrations/20251009132935-add-edge-node-presence.d.ts +3 -0
  291. package/dist/migrations/20251009132935-add-edge-node-presence.d.ts.map +1 -0
  292. package/dist/migrations/20251009132935-add-edge-node-presence.js +29 -0
  293. package/dist/migrations/20251009132935-add-edge-node-presence.js.map +1 -0
  294. package/dist/migrations/20251013131405-milestone-progression-uniqueness.d.ts +3 -0
  295. package/dist/migrations/20251013131405-milestone-progression-uniqueness.d.ts.map +1 -0
  296. package/dist/migrations/20251013131405-milestone-progression-uniqueness.js +9 -0
  297. package/dist/migrations/20251013131405-milestone-progression-uniqueness.js.map +1 -0
  298. package/dist/server-dev.js +7 -1
  299. package/dist/server-dev.js.map +1 -1
  300. package/dist/test/e2e/api/admin/context.e2e.test.js +2 -3
  301. package/dist/test/e2e/api/admin/context.e2e.test.js.map +1 -1
  302. package/dist/test/e2e/api/admin/user-admin.e2e.test.js +2 -3
  303. package/dist/test/e2e/api/admin/user-admin.e2e.test.js.map +1 -1
  304. package/dist/test/e2e/api/client/feature.optimal304.e2e.test.js +17 -41
  305. package/dist/test/e2e/api/client/feature.optimal304.e2e.test.js.map +1 -1
  306. package/dist/test/e2e/helpers/database-init.js +2 -2
  307. package/dist/test/e2e/helpers/database-init.js.map +1 -1
  308. package/dist/test/e2e/services/user-service.e2e.test.js +129 -99
  309. package/dist/test/e2e/services/user-service.e2e.test.js.map +1 -1
  310. package/dist/test/e2e/stores/feature-environment-store.e2e.test.js +3 -1
  311. package/dist/test/e2e/stores/feature-environment-store.e2e.test.js.map +1 -1
  312. package/dist/test/e2e/users/user-store.e2e.test.d.ts.map +1 -0
  313. package/dist/test/e2e/users/user-store.e2e.test.js.map +1 -0
  314. package/dist/test/e2e/users/user-updates-read-model.e2e.test.d.ts +2 -0
  315. package/dist/test/e2e/users/user-updates-read-model.e2e.test.d.ts.map +1 -0
  316. package/dist/test/e2e/users/user-updates-read-model.e2e.test.js +88 -0
  317. package/dist/test/e2e/users/user-updates-read-model.e2e.test.js.map +1 -0
  318. package/dist/test/fixtures/fake/fake-release-plan-read-model.d.ts +8 -0
  319. package/dist/test/fixtures/fake/fake-release-plan-read-model.d.ts.map +1 -0
  320. package/dist/test/fixtures/fake/fake-release-plan-read-model.js +9 -0
  321. package/dist/test/fixtures/fake/fake-release-plan-read-model.js.map +1 -0
  322. package/dist/test/fixtures/store.d.ts.map +1 -1
  323. package/dist/test/fixtures/store.js +1 -0
  324. package/dist/test/fixtures/store.js.map +1 -1
  325. package/frontend/build/index.html +1 -1
  326. package/frontend/build/static/{AdvancedPlayground-CUkOz1YF.js → AdvancedPlayground-HWcSRQrt.js} +1 -1
  327. package/frontend/build/static/BackendConnections-Cug76pb0.js +1 -0
  328. package/frontend/build/static/{CreateProject-COHPsP3X.js → CreateProject-3uUrdDWJ.js} +1 -1
  329. package/frontend/build/static/FeatureMetricsChart-DLvE4xPU.js +2 -0
  330. package/frontend/build/static/FeatureStaleDialog-BFWmPzw7.js +7 -0
  331. package/frontend/build/static/FeatureViewLazyExport-DfivW7sC.js +10 -0
  332. package/frontend/build/static/{FlagMetricsChart-D0GI-ltv.js → FlagMetricsChart-DFDJ4xPh.js} +2 -2
  333. package/frontend/build/static/FrontendNetworkTrafficUsage-DVa2I8CC.js +1 -0
  334. package/frontend/build/static/GridLayoutWrapper-Mt7n_5lt.js +3 -0
  335. package/frontend/build/static/ImpactMetricsPage-B3ERxAH0.js +1 -0
  336. package/frontend/build/static/LazyAdminExport-s8FIvcqq.js +38 -0
  337. package/frontend/build/static/LazyProjectExport-DN00bJrc.js +728 -0
  338. package/frontend/build/static/{LifecycleChartComponent-BigwXcU3.js → LifecycleChartComponent-BOcT_Zpy.js} +3 -3
  339. package/frontend/build/static/LineChartComponent-CudSs6ri.js +1 -0
  340. package/frontend/build/static/{MarkCompletedDialogue-CS-kM4vW.js → MarkCompletedDialogue-4XT7ryE9.js} +1 -1
  341. package/frontend/build/static/{NetworkConnectedEdges-C2nfTRKM.js → NetworkConnectedEdges-CnEFuyuC.js} +1 -1
  342. package/frontend/build/static/{NetworkOverview-BKozpi8w.js → NetworkOverview-KDe9n7ZE.js} +1 -1
  343. package/frontend/build/static/{NetworkPrometheusAPIWarning-wqCXwcem.js → NetworkPrometheusAPIWarning-Cy93jJcu.js} +1 -1
  344. package/frontend/build/static/{NetworkTraffic-Co7oakIE.js → NetworkTraffic-BTN3OABv.js} +1 -1
  345. package/frontend/build/static/NetworkTrafficUsage-DwnXvons.js +1 -0
  346. package/frontend/build/static/PercentageDonut-CmWbqKEA.js +1 -0
  347. package/frontend/build/static/{ReactJSONEditor-BDMT4-_1.js → ReactJSONEditor-xNDjbhPU.js} +1 -1
  348. package/frontend/build/static/{RoleCell-COtuTPWk.js → RoleCell-DSglYWti.js} +1 -1
  349. package/frontend/build/static/{aggregateFeatureMetrics-ClblY5Ev.js → aggregateFeatureMetrics-B7oOoe9g.js} +1 -1
  350. package/frontend/build/static/{formatTickValue-DojfJagm.js → formatTickValue-4OyGeZqN.js} +2 -2
  351. package/frontend/build/static/index-D02pkj6r.js +542 -0
  352. package/frontend/build/static/metricsFormatters-7MLBOEud.js +1 -0
  353. package/frontend/build/static/{networkTrafficUsageHighlightPlugin-BMMmh5e_.js → networkTrafficUsageHighlightPlugin-CT-MfVrm.js} +1 -1
  354. package/frontend/build/static/strategyCustom-Db-ZtYWl.svg +23 -0
  355. package/frontend/build/static/strategyDefault-LnSyH2eZ.svg +17 -0
  356. package/frontend/build/static/strategyGradual-oCA99tj3.svg +18 -0
  357. package/frontend/build/static/strategyHosts-4lVYC2Bf.svg +23 -0
  358. package/frontend/build/static/strategyIPs-BHaXsOYV.svg +24 -0
  359. package/frontend/build/static/strategyOn-CX-xL0oK.svg +18 -0
  360. package/frontend/build/static/useApiTokens-wTDjjd8a.js +1 -0
  361. package/frontend/package.json +2 -2
  362. package/package.json +5 -7
  363. package/dist/lib/routes/admin-api/config.d.ts +0 -24
  364. package/dist/lib/routes/admin-api/config.d.ts.map +0 -1
  365. package/dist/lib/routes/admin-api/config.js.map +0 -1
  366. package/dist/lib/routes/admin-api/config.test.d.ts +0 -2
  367. package/dist/lib/routes/admin-api/config.test.d.ts.map +0 -1
  368. package/dist/lib/routes/admin-api/config.test.js.map +0 -1
  369. package/dist/test/e2e/stores/user-store.e2e.test.d.ts.map +0 -1
  370. package/dist/test/e2e/stores/user-store.e2e.test.js.map +0 -1
  371. package/frontend/build/static/BackendConnections-Bi1Fsohi.js +0 -1
  372. package/frontend/build/static/ChartItem-Ci-KFL7s.js +0 -1
  373. package/frontend/build/static/FeatureMetricsChart-ClbKeGOa.js +0 -2
  374. package/frontend/build/static/FeatureStaleDialog-DZvKjxPB.js +0 -7
  375. package/frontend/build/static/FeatureViewLazyExport-yCIrczZt.js +0 -10
  376. package/frontend/build/static/FrontendNetworkTrafficUsage-DlRkx8CV.js +0 -1
  377. package/frontend/build/static/ImpactMetricsPage-BYcbHNWC.js +0 -3
  378. package/frontend/build/static/LazyAdminExport-BjSYZTvt.js +0 -38
  379. package/frontend/build/static/LazyProjectExport-9mNkV9Jq.js +0 -728
  380. package/frontend/build/static/LineChartComponent-CPcDsiNa.js +0 -1
  381. package/frontend/build/static/NetworkTrafficUsage-DNDJZGXi.js +0 -1
  382. package/frontend/build/static/index-CqYZiU1N.js +0 -542
  383. package/frontend/build/static/useApiTokens-B6vbGXUF.js +0 -1
  384. /package/dist/test/e2e/{stores → users}/user-store.e2e.test.d.ts +0 -0
  385. /package/dist/test/e2e/{stores → users}/user-store.e2e.test.js +0 -0
@@ -1,6 +1,6 @@
1
- import{jc as ct,jE as R,jF as w,jG as p,jd as Q,jH as fe,jI as ut,jJ as b,i$ as oe,jk as B,jK as A,jL as ft,jM as ht,je as _,jf as he,ja as K,jN as yt,jO as bt,jP as X,jQ as J,jR as Ce,jS as gt,jT as Pe,jU as T,jV as Ve,jW as $e,jX as mt}from"./index-CqYZiU1N.js";/*!
1
+ import{jk as ct,jM as R,jN as w,jO as p,jl as G,jP as fe,jQ as ut,jR as b,j7 as oe,js as B,jS as A,jT as ft,jU as ht,jm as z,jn as he,ji as K,jV as yt,jW as bt,jX as X,jY as J,jZ as Ce,j_ as gt,j$ as Pe,k0 as I,k1 as Ve,k2 as $e,k3 as mt}from"./index-D02pkj6r.js";/*!
2
2
  * chartjs-plugin-annotation v2.2.1
3
3
  * https://www.chartjs.org/chartjs-plugin-annotation/index
4
4
  * (c) 2023 chartjs-plugin-annotation Contributors
5
5
  * Released under the MIT License
6
- */const ke={modes:{point(t,e){return q(t,e,{intersect:!0})},nearest(t,e,n){return xt(t,e,n)},x(t,e,n){return q(t,e,{intersect:n.intersect,axis:"x"})},y(t,e,n){return q(t,e,{intersect:n.intersect,axis:"y"})}}};function ye(t,e,n){return(ke.modes[n.mode]||ke.modes.nearest)(t,e,n)}function pt(t,e,n){return n!=="x"&&n!=="y"?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,n,!0)}function wt(t,e,n){return n==="x"?{x:t.x,y:e.y}:n==="y"?{x:e.x,y:t.y}:e}function q(t,e,n){return t.visibleElements.filter(o=>n.intersect?o.inRange(e.x,e.y):pt(o,e,n.axis))}function xt(t,e,n){let o=Number.POSITIVE_INFINITY;return q(t,e,n).reduce((r,i)=>{const s=i.getCenterPoint(),a=wt(e,s,n.axis),d=fe(e,a);return d<o?(r=[i],o=d):d===o&&r.push(i),r},[]).sort((r,i)=>r._index-i._index).slice(0,1)}const St=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,v=.001,F=(t,e,n)=>Math.min(n,Math.max(e,t));function Mt(t,e,n){for(const o of Object.keys(t))t[o]=F(t[o],e,n);return t}function Ct(t,e,n,o){if(!t||!e||n<=0)return!1;const r=o/2;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(n+r,2)}function Je(t,{x:e,y:n,x2:o,y2:r},i,s){const a=s/2,d=t.x>=e-a-v&&t.x<=o+a+v,l=t.y>=n-a-v&&t.y<=r+a+v;return i==="x"?d:(i==="y"||d)&&l}function E(t,e){const{centerX:n,centerY:o}=t.getProps(["centerX","centerY"],e);return{x:n,y:o}}function Pt(t,e,n,o=!0){const r=n.split(".");let i=0;for(const s of e.split(".")){const a=r[i++];if(parseInt(s,10)<parseInt(a,10))break;if(St(a,s)){if(o)throw new Error(`${t} v${n} is not supported. v${e} or newer is required.`);return!1}}return!0}const Ue=t=>typeof t=="string"&&t.endsWith("%"),qe=t=>parseFloat(t)/100,Ke=t=>F(qe(t),0,1);function be(t,e){return e==="start"?0:e==="end"?t:Ue(e)?Ke(e)*t:t/2}function C(t,e,n=!0){return typeof e=="number"?e:Ue(e)?(n?Ke(e):qe(e))*t:t}function kt(t,e){const{x:n,width:o}=t,r=e.textAlign;return r==="center"?n+o/2:r==="end"||r==="right"?n+o:n}function ge(t,e="center"){return B(t)?{x:_(t.x,e),y:_(t.y,e)}:(t=_(t,e),{x:t,y:t})}function Ge(t){return t&&(p(t.xValue)||p(t.yValue))}function H(t,e,n,o=!1){const r=n.init;if(r){if(r===!0)return Fe(e,o)}else return;return jt(e,o,he(r,[{chart:t,properties:e,options:n}]))}function Qe(t,e,n){let o=!1;return e.forEach(r=>{T(t[r])?(o=!0,n[r]=t[r]):p(n[r])&&delete n[r]}),o}function Fe({centerX:t,centerY:e},n){return n?{centerX:t,centerY:e,radius:0,width:0,height:0}:{x:t,y:e,x2:t,y2:e,width:0,height:0}}function jt(t,e,n){if(n===!0)return Fe(t,e);if(B(n))return n}const re=new Map,vt=t=>isNaN(t)||t<=0,At=t=>t.reduce(function(e,n){return e+=n.string,e},"");function Z(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object HTMLImageElement]"||e==="[object HTMLCanvasElement]"}}function me(t,{x:e,y:n},o){o&&(t.translate(e,n),t.rotate(w(o)),t.translate(-e,-n))}function P(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle,t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle,t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function W(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function pe(t,e){const n=e.content;if(Z(n))return{width:C(n.width,e.width),height:C(n.height,e.height)};const o=e.font,r=A(o)?o.map(d=>K(d)):[K(o)],i=e.textStrokeWidth,s=A(n)?n:[n],a=s.join()+At(r)+i+(t._measureText?"-spriting":"");return re.has(a)||re.set(a,Rt(t,s,r,i)),re.get(a)}function Ze(t,e,n){const{x:o,y:r,width:i,height:s}=e;t.save(),W(t,n);const a=P(t,n);t.fillStyle=n.backgroundColor,t.beginPath(),yt(t,{x:o,y:r,w:i,h:s,radius:Mt(bt(n.borderRadius),0,Math.min(i,s)/2)}),t.closePath(),t.fill(),a&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore()}function Dt(t,e,n){const o=n.content;if(Z(o)){t.save(),t.globalAlpha=Lt(n.opacity,o.style.opacity),t.drawImage(o,e.x,e.y,e.width,e.height),t.restore();return}const r=A(o)?o:[o],i=n.font,s=A(i)?i.map(u=>K(u)):[K(i)],a=n.color,d=A(a)?a:[a],l=kt(e,n),c=e.y+n.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=n.textAlign,It(t,n)&&Et(t,{x:l,y:c},r,s),Wt(t,{x:l,y:c},r,{fonts:s,colors:d}),t.restore()}function It(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}function Tt(t,e,n,o){const{radius:r,options:i}=e,s=i.pointStyle,a=i.rotation;let d=(a||0)*$e;if(Z(s)){t.save(),t.translate(n,o),t.rotate(d),t.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),t.restore();return}vt(r)||Ot(t,{x:n,y:o,radius:r,rotation:a,style:s,rad:d})}function Ot(t,{x:e,y:n,radius:o,rotation:r,style:i,rad:s}){let a,d,l,c;switch(t.beginPath(),i){default:t.arc(e,n,o,0,gt),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(s)*o,n-Math.cos(s)*o),s+=Ce,t.lineTo(e+Math.sin(s)*o,n-Math.cos(s)*o),s+=Ce,t.lineTo(e+Math.sin(s)*o,n-Math.cos(s)*o),t.closePath();break;case"rectRounded":c=o*.516,l=o-c,a=Math.cos(s+X)*l,d=Math.sin(s+X)*l,t.arc(e-a,n-d,c,s-b,s-J),t.arc(e+d,n-a,c,s-J,s),t.arc(e+a,n+d,c,s,s+J),t.arc(e-d,n+a,c,s+J,s+b),t.closePath();break;case"rect":if(!r){l=Math.SQRT1_2*o,t.rect(e-l,n-l,2*l,2*l);break}s+=X;case"rectRot":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+d,n-a),t.lineTo(e+a,n+d),t.lineTo(e-d,n+a),t.closePath();break;case"crossRot":s+=X;case"cross":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d),t.moveTo(e+d,n-a),t.lineTo(e-d,n+a);break;case"star":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d),t.moveTo(e+d,n-a),t.lineTo(e-d,n+a),s+=X,a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d),t.moveTo(e+d,n-a),t.lineTo(e-d,n+a);break;case"line":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d);break;case"dash":t.moveTo(e,n),t.lineTo(e+Math.cos(s)*o,n+Math.sin(s)*o);break}t.fill()}function Rt(t,e,n,o){t.save();const r=e.length;let i=0,s=o;for(let a=0;a<r;a++){const d=n[Math.min(a,n.length-1)];t.font=d.string;const l=e[a];i=Math.max(i,t.measureText(l).width+o),s+=d.lineHeight}return t.restore(),{width:i,height:s}}function Et(t,{x:e,y:n},o,r){t.beginPath();let i=0;o.forEach(function(s,a){const d=r[Math.min(a,r.length-1)],l=d.lineHeight;t.font=d.string,t.strokeText(s,e,n+l/2+i),i+=l}),t.stroke()}function Wt(t,{x:e,y:n},o,{fonts:r,colors:i}){let s=0;o.forEach(function(a,d){const l=i[Math.min(d,i.length-1)],c=r[Math.min(d,r.length-1)],u=c.lineHeight;t.beginPath(),t.font=c.string,t.fillStyle=l,t.fillText(a,e,n+u/2+s),s+=u,t.fill()})}function Lt(t,e){const n=Pe(t)?t:e;return Pe(n)?F(n,0,1):1}const je={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function O(t,e,n){return e=typeof e=="number"?e:t.parse(e),Ve(e)?t.getPixelForValue(e):n}function D(t,e,n){const o=e[n];if(o||n==="scaleID")return o;const r=n.charAt(0),i=Object.values(t).filter(s=>s.axis&&s.axis===r);return i.length?i[0].id:r}function et(t,e){if(t){const n=t.options.reverse,o=O(t,e.min,n?e.end:e.start),r=O(t,e.max,n?e.start:e.end);return{start:o,end:r}}}function tt(t,e){const{chartArea:n,scales:o}=t,r=o[D(o,e,"xScaleID")],i=o[D(o,e,"yScaleID")];let s=n.width/2,a=n.height/2;return r&&(s=O(r,e.xValue,r.left+r.width/2)),i&&(a=O(i,e.yValue,i.top+i.height/2)),{x:s,y:a}}function we(t,e){const n=t.scales,o=n[D(n,e,"xScaleID")],r=n[D(n,e,"yScaleID")];if(!o&&!r)return{};let{left:i,right:s}=o||t.chartArea,{top:a,bottom:d}=r||t.chartArea;const l=ve(o,{min:e.xMin,max:e.xMax,start:i,end:s});i=l.start,s=l.end;const c=ve(r,{min:e.yMin,max:e.yMax,start:d,end:a});return a=c.start,d=c.end,{x:i,y:a,x2:s,y2:d,width:s-i,height:d-a,centerX:i+(s-i)/2,centerY:a+(d-a)/2}}function nt(t,e){if(!Ge(e)){const n=we(t,e);let o=e.radius;(!o||isNaN(o))&&(o=Math.min(n.width,n.height)/2,e.radius=o);const r=o*2,i=n.centerX+e.xAdjust,s=n.centerY+e.yAdjust;return{x:i-o,y:s-o,x2:i+o,y2:s+o,centerX:i,centerY:s,width:r,height:r,radius:o}}return Xt(t,e)}function Yt(t,e){const{scales:n,chartArea:o}=t,r=n[e.scaleID],i={x:o.left,y:o.top,x2:o.right,y2:o.bottom};return r?zt(r,i,e):_t(n,i,e),i}function ot(t,e,n){const o=we(t,e);return o.initProperties=H(t,o,e,n),o.elements=[{type:"label",optionScope:"label",properties:Nt(t,o,e),initProperties:o.initProperties}],o}function Xt(t,e){const n=tt(t,e),o=e.radius*2;return{x:n.x-e.radius+e.xAdjust,y:n.y-e.radius+e.yAdjust,x2:n.x+e.radius+e.xAdjust,y2:n.y+e.radius+e.yAdjust,centerX:n.x+e.xAdjust,centerY:n.y+e.yAdjust,radius:e.radius,width:o,height:o}}function ve(t,e){const n=et(t,e)||e;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function zt(t,e,n){const o=O(t,n.value,NaN),r=O(t,n.endValue,o);t.isHorizontal()?(e.x=o,e.x2=r):(e.y=o,e.y2=r)}function _t(t,e,n){for(const o of Object.keys(je)){const r=t[D(t,n,o)];if(r){const{min:i,max:s,start:a,end:d,startProp:l,endProp:c}=je[o],u=et(r,{min:n[i],max:n[s],start:r[a],end:r[d]});e[l]=u.start,e[c]=u.end}}}function Bt({properties:t,options:e},n,o,r){const{x:i,x2:s,width:a}=t;return rt({start:i,end:s,size:a,borderWidth:e.borderWidth},{position:o.x,padding:{start:r.left,end:r.right},adjust:e.label.xAdjust,size:n.width})}function Ht({properties:t,options:e},n,o,r){const{y:i,y2:s,height:a}=t;return rt({start:i,end:s,size:a,borderWidth:e.borderWidth},{position:o.y,padding:{start:r.top,end:r.bottom},adjust:e.label.yAdjust,size:n.height})}function rt(t,e){const{start:n,end:o,borderWidth:r}=t,{position:i,padding:{start:s,end:a},adjust:d}=e,l=o-r-n-s-a-e.size;return n+r/2+d+be(l,i)}function Nt(t,e,n){const o=n.label;o.backgroundColor="transparent",o.callout.display=!1;const r=ge(o.position),i=Q(o.padding),s=pe(t.ctx,o),a=Bt({properties:e,options:n},s,r,i),d=Ht({properties:e,options:n},s,r,i),l=s.width+i.width,c=s.height+i.height;return{x:a,y:d,x2:a+l,y2:d+c,width:l,height:c,centerX:a+l/2,centerY:d+c/2,rotation:o.rotation}}function I(t,e,n){const o=Math.cos(n),r=Math.sin(n),i=e.x,s=e.y;return{x:i+o*(t.x-i)-r*(t.y-s),y:s+r*(t.x-i)+o*(t.y-s)}}const ie=["enter","leave"],xe=ie.concat("click");function Vt(t,e,n){e.listened=Qe(n,xe,e.listeners),e.moveListened=!1,e._getElements=ye,ie.forEach(o=>{T(n[o])&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(o=>{!e.listened&&T(o.click)&&(e.listened=!0),e.moveListened||ie.forEach(r=>{T(o[r])&&(e.listened=!0,e.moveListened=!0)})})}function $t(t,e,n){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return Jt(t,e,n);case"click":return Ut(t,e,n)}}function Jt(t,e,n){if(!t.moveListened)return;let o;e.type==="mousemove"?o=ye(t,e,n.interaction):o=[];const r=t.hovered;t.hovered=o;const i={state:t,event:e};let s=Ae(i,"leave",r,o);return Ae(i,"enter",o,r)||s}function Ae({state:t,event:e},n,o,r){let i;for(const s of o)r.indexOf(s)<0&&(i=it(s.options[n]||t.listeners[n],s,e)||i);return i}function Ut(t,e,n){const o=t.listeners,r=ye(t,e,n.interaction);let i;for(const s of r)i=it(s.options.click||o.click,s,e)||i;return i}function it(t,e,n){return he(t,[e.$context,n])===!0}const G=["afterDraw","beforeDraw"];function qt(t,e,n){const o=e.visibleElements;e.hooked=Qe(n,G,e.hooks),e.hooked||o.forEach(r=>{e.hooked||G.forEach(i=>{T(r.options[i])&&(e.hooked=!0)})})}function De(t,e,n){if(t.hooked){const o=e.options[n]||t.hooks[n];return he(o,[e.$context])}}function Kt(t,e,n){const o=en(t.scales,e,n);let r=Ie(e,o,"min","suggestedMin");r=Ie(e,o,"max","suggestedMax")||r,r&&T(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function Gt(t,e){for(const n of t)Ft(n,e)}function Ie(t,e,n,o){if(Ve(e[n])&&!Qt(t.options,n,o)){const r=t[n]!==e[n];return t[n]=e[n],r}}function Qt(t,e,n){return p(t[e])||p(t[n])}function Ft(t,e){for(const n of["scaleID","xScaleID","yScaleID"]){const o=D(e,t,n);o&&!e[o]&&Zt(t,n)&&console.warn(`No scale found with id '${o}' for annotation '${t.id}'`)}}function Zt(t,e){if(e==="scaleID")return!0;const n=e.charAt(0);for(const o of["Min","Max","Value"])if(p(t[n+o]))return!0;return!1}function en(t,e,n){const o=e.axis,r=e.id,i=o+"ScaleID",s={min:_(e.min,Number.NEGATIVE_INFINITY),max:_(e.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===r?Te(a,e,["value","endValue"],s):D(t,a,i)===r&&Te(a,e,[o+"Min",o+"Max",o+"Value"],s);return s}function Te(t,e,n,o){for(const r of n){const i=t[r];if(p(i)){const s=e.parse(i);o.min=Math.min(o.min,s),o.max=Math.max(o.max,s)}}}class L extends R{inRange(e,n,o,r){const{x:i,y:s}=I({x:e,y:n},this.getCenterPoint(r),w(-this.options.rotation));return Je({x:i,y:s},this.getProps(["x","y","x2","y2"],r),o,this.options.borderWidth)}getCenterPoint(e){return E(this,e)}draw(e){e.save(),me(e,this.getCenterPoint(),this.options.rotation),Ze(e,this,this.options),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return ot(e,n)}}L.id="boxAnnotation";L.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};L.defaultRoutes={borderColor:"color",backgroundColor:"color"};L.descriptors={label:{_fallback:!0}};const st=["left","bottom","top","right"];class N extends R{inRange(e,n,o,r){const{x:i,y:s}=I({x:e,y:n},this.getCenterPoint(r),w(-this.rotation));return Je({x:i,y:s},this.getProps(["x","y","x2","y2"],r),o,this.options.borderWidth)}getCenterPoint(e){return E(this,e)}draw(e){const n=this.options,o=!p(this._visible)||this._visible;!n.display||!n.content||!o||(e.save(),me(e,this.getCenterPoint(),this.rotation),nn(e,this),Ze(e,this,n),Dt(e,cn(this),n),e.restore())}resolveElementProperties(e,n){let o;if(Ge(n))o=tt(e,n);else{const{centerX:a,centerY:d}=we(e,n);o={x:a,y:d}}const r=Q(n.padding),i=pe(e.ctx,n),s=tn(o,i,n,r);return{initProperties:H(e,s,n),pointX:o.x,pointY:o.y,...s,rotation:n.rotation}}}N.id="labelAnnotation";N.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};N.defaultRoutes={borderColor:"color"};function tn(t,e,n,o){const r=e.width+o.width+n.borderWidth,i=e.height+o.height+n.borderWidth,s=ge(n.position,"center"),a=Oe(t.x,r,n.xAdjust,s.x),d=Oe(t.y,i,n.yAdjust,s.y);return{x:a,y:d,x2:a+r,y2:d+i,width:r,height:i,centerX:a+r/2,centerY:d+i/2}}function Oe(t,e,n=0,o){return t-be(e,o)+n}function nn(t,e){const{pointX:n,pointY:o,options:r}=e,i=r.callout,s=i&&i.display&&dn(e,i);if(!s||un(e,i,s))return;if(t.save(),t.beginPath(),!P(t,i))return t.restore();const{separatorStart:d,separatorEnd:l}=on(e,s),{sideStart:c,sideEnd:u}=sn(e,s,d);(i.margin>0||r.borderWidth===0)&&(t.moveTo(d.x,d.y),t.lineTo(l.x,l.y)),t.moveTo(c.x,c.y),t.lineTo(u.x,u.y);const f=I({x:n,y:o},e.getCenterPoint(),w(-e.rotation));t.lineTo(f.x,f.y),t.stroke(),t.restore()}function on(t,e){const{x:n,y:o,x2:r,y2:i}=t,s=rn(t,e);let a,d;return e==="left"||e==="right"?(a={x:n+s,y:o},d={x:a.x,y:i}):(a={x:n,y:o+s},d={x:r,y:a.y}),{separatorStart:a,separatorEnd:d}}function rn(t,e){const{width:n,height:o,options:r}=t,i=r.callout.margin+r.borderWidth/2;return e==="right"?n+i:e==="bottom"?o+i:-i}function sn(t,e,n){const{y:o,width:r,height:i,options:s}=t,a=s.callout.start,d=an(e,s.callout);let l,c;return e==="left"||e==="right"?(l={x:n.x,y:o+C(i,a)},c={x:l.x+d,y:l.y}):(l={x:n.x+C(r,a),y:n.y},c={x:l.x,y:l.y+d}),{sideStart:l,sideEnd:c}}function an(t,e){const n=e.side;return t==="left"||t==="top"?-n:n}function dn(t,e){const n=e.position;return st.includes(n)?n:ln(t,e)}function ln(t,e){const{x:n,y:o,x2:r,y2:i,width:s,height:a,pointX:d,pointY:l,centerX:c,centerY:u,rotation:f}=t,h={x:c,y:u},y=e.start,x=C(s,y),Y=C(a,y),g=[n,n+x,n+x,r],m=[o+Y,i,o,i],k=[];for(let j=0;j<4;j++){const ne=I({x:g[j],y:m[j]},h,w(f));k.push({position:st[j],distance:fe(ne,{x:d,y:l})})}return k.sort((j,ne)=>j.distance-ne.distance)[0].position}function cn({x:t,y:e,width:n,height:o,options:r}){const i=r.borderWidth/2,s=Q(r.padding);return{x:t+s.left+i,y:e+s.top+i,width:n-s.left-s.right-r.borderWidth,height:o-s.top-s.bottom-r.borderWidth}}function un(t,e,n){const{pointX:o,pointY:r}=t,i=e.margin;let s=o,a=r;return n==="left"?s+=i:n==="right"?s-=i:n==="top"?a+=i:n==="bottom"&&(a-=i),t.inRange(s,a)}const Se=(t,e,n)=>({x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}),se=(t,e,n)=>Se(e,n,Math.abs((t-e.y)/(n.y-e.y))).x,Re=(t,e,n)=>Se(e,n,Math.abs((t-e.x)/(n.x-e.x))).y,z=t=>t*t,fn=(t,e,{x:n,y:o,x2:r,y2:i},s)=>s==="y"?{start:Math.min(o,i),end:Math.max(o,i),value:e}:{start:Math.min(n,r),end:Math.max(n,r),value:t},Ee=(t,e,n,o)=>(1-o)*(1-o)*t+2*(1-o)*o*e+o*o*n,ae=(t,e,n,o)=>({x:Ee(t.x,e.x,n.x,o),y:Ee(t.y,e.y,n.y,o)}),We=(t,e,n,o)=>2*(1-o)*(e-t)+2*o*(n-e),Le=(t,e,n,o)=>-Math.atan2(We(t.x,e.x,n.x,o),We(t.y,e.y,n.y,o))+.5*b;class V extends R{inRange(e,n,o,r){const i=this.options.borderWidth/2;if(o!=="x"&&o!=="y"){const s={mouseX:e,mouseY:n},{path:a,ctx:d}=this;if(a){P(d,this.options);const{chart:c}=this.$context,u=e*c.currentDevicePixelRatio,f=n*c.currentDevicePixelRatio,h=d.isPointInStroke(a,u,f)||de(this,s,r);return d.restore(),h}const l=z(i);return gn(this,s,l,r)||de(this,s,r)}return hn(this,{mouseX:e,mouseY:n},o,{hBorderWidth:i,useFinalPosition:r})}getCenterPoint(e){return E(this,e)}draw(e){const{x:n,y:o,x2:r,y2:i,cp:s,options:a}=this;if(e.save(),!P(e,a))return e.restore();W(e,a);const d=Math.sqrt(Math.pow(r-n,2)+Math.pow(i-o,2));if(a.curve&&s)return Pn(e,this,s,d),e.restore();const{startOpts:l,endOpts:c,startAdjust:u,endAdjust:f}=at(this),h=Math.atan2(i-o,r-n);e.translate(n,o),e.rotate(h),e.beginPath(),e.moveTo(0+u,0),e.lineTo(d-f,0),e.shadowColor=a.borderShadowColor,e.stroke(),le(e,0,u,l),le(e,d,-f,c),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){const o=Yt(e,n),{x:r,y:i,x2:s,y2:a}=o,d=yn(o,e.chartArea),l=d?bn({x:r,y:i},{x:s,y:a},e.chartArea):{x:r,y:i,x2:s,y2:a,width:Math.abs(s-r),height:Math.abs(a-i)};if(l.centerX=(s+r)/2,l.centerY=(a+i)/2,l.initProperties=H(e,l,n),n.curve){const u={x:l.x,y:l.y},f={x:l.x2,y:l.y2};l.cp=Cn(l,n,fe(u,f))}const c=mn(e,l,n.label);return c._visible=d,l.elements=[{type:"label",optionScope:"label",properties:c,initProperties:l.initProperties}],l}}V.id="lineAnnotation";const Ye={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};V.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ye),fill:!1,length:12,start:Object.assign({},Ye),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},N.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};V.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};V.defaultRoutes={borderColor:"color"};function hn(t,{mouseX:e,mouseY:n},o,{hBorderWidth:r,useFinalPosition:i}){const s=fn(e,n,t.getProps(["x","y","x2","y2"],i),o);return s.value>=s.start-r&&s.value<=s.end+r||de(t,{mouseX:e,mouseY:n},i,o)}function yn({x:t,y:e,x2:n,y2:o},{top:r,right:i,bottom:s,left:a}){return!(t<a&&n<a||t>i&&n>i||e<r&&o<r||e>s&&o>s)}function Xe({x:t,y:e},n,{top:o,right:r,bottom:i,left:s}){return t<s&&(e=Re(s,{x:t,y:e},n),t=s),t>r&&(e=Re(r,{x:t,y:e},n),t=r),e<o&&(t=se(o,{x:t,y:e},n),e=o),e>i&&(t=se(i,{x:t,y:e},n),e=i),{x:t,y:e}}function bn(t,e,n){const{x:o,y:r}=Xe(t,e,n),{x:i,y:s}=Xe(e,t,n);return{x:o,y:r,x2:i,y2:s,width:Math.abs(i-o),height:Math.abs(s-r)}}function gn(t,{mouseX:e,mouseY:n},o=v,r){const{x:i,y:s,x2:a,y2:d}=t.getProps(["x","y","x2","y2"],r),l=a-i,c=d-s,u=z(l)+z(c),f=u===0?-1:((e-i)*l+(n-s)*c)/u;let h,y;return f<0?(h=i,y=s):f>1?(h=a,y=d):(h=i+f*l,y=s+f*c),z(e-h)+z(n-y)<=o}function de(t,{mouseX:e,mouseY:n},o,r){const i=t.label;return i.options.display&&i.inRange(e,n,r,o)}function mn(t,e,n){const o=n.borderWidth,r=Q(n.padding),i=pe(t.ctx,n),s=i.width+r.width+o,a=i.height+r.height+o;return wn(e,n,{width:s,height:a,padding:r},t.chartArea)}function pn(t){const{x:e,y:n,x2:o,y2:r}=t,i=Math.atan2(r-n,o-e);return i>b/2?i-b:i<b/-2?i+b:i}function wn(t,e,n,o){const{width:r,height:i,padding:s}=n,{xAdjust:a,yAdjust:d}=e,l={x:t.x,y:t.y},c={x:t.x2,y:t.y2},u=e.rotation==="auto"?pn(t):w(e.rotation),f=xn(r,i,u),h=Sn(t,e,{labelSize:f,padding:s},o),y=t.cp?ae(l,t.cp,c,h):Se(l,c,h),x={size:f.w,min:o.left,max:o.right,padding:s.left},Y={size:f.h,min:o.top,max:o.bottom,padding:s.top},g=_e(y.x,x)+a,m=_e(y.y,Y)+d;return{x:g-r/2,y:m-i/2,x2:g+r/2,y2:m+i/2,centerX:g,centerY:m,pointX:y.x,pointY:y.y,width:r,height:i,rotation:ut(u)}}function xn(t,e,n){const o=Math.cos(n),r=Math.sin(n);return{w:Math.abs(t*o)+Math.abs(e*r),h:Math.abs(t*r)+Math.abs(e*o)}}function Sn(t,e,n,o){let r;const i=Mn(t,o);return e.position==="start"?r=ze({w:t.x2-t.x,h:t.y2-t.y},n,e,i):e.position==="end"?r=1-ze({w:t.x-t.x2,h:t.y-t.y2},n,e,i):r=be(1,e.position),r}function ze(t,e,n,o){const{labelSize:r,padding:i}=e,s=t.w*o.dx,a=t.h*o.dy,d=s>0&&(r.w/2+i.left-o.x)/s,l=a>0&&(r.h/2+i.top-o.y)/a;return F(Math.max(d,l),0,.25)}function Mn(t,e){const{x:n,x2:o,y:r,y2:i}=t,s=Math.min(r,i)-e.top,a=Math.min(n,o)-e.left,d=e.bottom-Math.max(r,i),l=e.right-Math.max(n,o);return{x:Math.min(a,l),y:Math.min(s,d),dx:a<=l?1:-1,dy:s<=d?1:-1}}function _e(t,e){const{size:n,min:o,max:r,padding:i}=e,s=n/2;return n>r-o?(r+o)/2:(o>=t-i-s&&(t=o+i+s),r<=t+i+s&&(t=r-i-s),t)}function at(t){const e=t.options,n=e.arrowHeads&&e.arrowHeads.start,o=e.arrowHeads&&e.arrowHeads.end;return{startOpts:n,endOpts:o,startAdjust:Be(t,n),endAdjust:Be(t,o)}}function Be(t,e){if(!e||!e.display)return 0;const{length:n,width:o}=e,r=t.options.borderWidth/2,i={x:n,y:o+r};return Math.abs(se(0,i,{x:0,y:r}))}function le(t,e,n,o){if(!o||!o.display)return;const{length:r,width:i,fill:s,backgroundColor:a,borderColor:d}=o,l=Math.abs(e-r)+n;t.beginPath(),W(t,o),P(t,o),t.moveTo(l,-i),t.lineTo(e+n,0),t.lineTo(l,i),s===!0?(t.fillStyle=a||d,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=o.borderShadowColor,t.stroke()}function Cn(t,e,n){const{x:o,y:r,x2:i,y2:s,centerX:a,centerY:d}=t,l=Math.atan2(s-r,i-o),c=ge(e.controlPoint,0),u={x:a+C(n,c.x,!1),y:d+C(n,c.y,!1)};return I(u,{x:a,y:d},l)}function He(t,{x:e,y:n},{angle:o,adjust:r},i){!i||!i.display||(t.save(),t.translate(e,n),t.rotate(o),le(t,0,-r,i),t.restore())}function Pn(t,e,n,o){const{x:r,y:i,x2:s,y2:a,options:d}=e,{startOpts:l,endOpts:c,startAdjust:u,endAdjust:f}=at(e),h={x:r,y:i},y={x:s,y:a},x=Le(h,n,y,0),Y=Le(h,n,y,1)-b,g=ae(h,n,y,u/o),m=ae(h,n,y,1-f/o),k=new Path2D;t.beginPath(),k.moveTo(g.x,g.y),k.quadraticCurveTo(n.x,n.y,m.x,m.y),t.shadowColor=d.borderShadowColor,t.stroke(k),e.path=k,e.ctx=t,He(t,g,{angle:x,adjust:u},l),He(t,m,{angle:Y,adjust:f},c)}class $ extends R{inRange(e,n,o,r){const i=this.options.rotation,s=this.options.borderWidth;if(o!=="x"&&o!=="y")return kn({x:e,y:n},this.getProps(["width","height","centerX","centerY"],r),i,s);const{x:a,y:d,x2:l,y2:c}=this.getProps(["x","y","x2","y2"],r),u=s/2,f=o==="y"?{start:d,end:c}:{start:a,end:l},h=I({x:e,y:n},this.getCenterPoint(r),w(-i));return h[o]>=f.start-u-v&&h[o]<=f.end+u+v}getCenterPoint(e){return E(this,e)}draw(e){const{width:n,height:o,centerX:r,centerY:i,options:s}=this;e.save(),me(e,this.getCenterPoint(),s.rotation),W(e,this.options),e.beginPath(),e.fillStyle=s.backgroundColor;const a=P(e,s);e.ellipse(r,i,o/2,n/2,b/2,0,2*b),e.fill(),a&&(e.shadowColor=s.borderShadowColor,e.stroke()),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return ot(e,n,!0)}}$.id="ellipseAnnotation";$.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},L.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};$.defaultRoutes={borderColor:"color",backgroundColor:"color"};$.descriptors={label:{_fallback:!0}};function kn(t,e,n,o){const{width:r,height:i,centerX:s,centerY:a}=e,d=r/2,l=i/2;if(d<=0||l<=0)return!1;const c=w(n||0),u=o/2||0,f=Math.cos(c),h=Math.sin(c),y=Math.pow(f*(t.x-s)+h*(t.y-a),2),x=Math.pow(h*(t.x-s)-f*(t.y-a),2);return y/Math.pow(d+u,2)+x/Math.pow(l+u,2)<=1.0001}class ee extends R{inRange(e,n,o,r){const{x:i,y:s,x2:a,y2:d,width:l}=this.getProps(["x","y","x2","y2","width"],r),c=this.options.borderWidth;if(o!=="x"&&o!=="y")return Ct({x:e,y:n},this.getCenterPoint(r),l/2,c);const u=c/2,f=o==="y"?{start:s,end:d,value:n}:{start:i,end:a,value:e};return f.value>=f.start-u&&f.value<=f.end+u}getCenterPoint(e){return E(this,e)}draw(e){const n=this.options,o=n.borderWidth;if(n.radius<.1)return;e.save(),e.fillStyle=n.backgroundColor,W(e,n);const r=P(e,n);Tt(e,this,this.centerX,this.centerY),r&&!Z(n.pointStyle)&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore(),n.borderWidth=o}resolveElementProperties(e,n){const o=nt(e,n);return o.initProperties=H(e,o,n,!0),o}}ee.id="pointAnnotation";ee.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ee.defaultRoutes={borderColor:"color",backgroundColor:"color"};class te extends R{inRange(e,n,o,r){if(o!=="x"&&o!=="y")return this.options.radius>=.1&&this.elements.length>1&&vn(this.elements,e,n,r);const i=I({x:e,y:n},this.getCenterPoint(r),w(-this.options.rotation)),s=this.elements.map(l=>o==="y"?l.bY:l.bX),a=Math.min(...s),d=Math.max(...s);return i[o]>=a&&i[o]<=d}getCenterPoint(e){return E(this,e)}draw(e){const{elements:n,options:o}=this;e.save(),e.beginPath(),e.fillStyle=o.backgroundColor,W(e,o);const r=P(e,o);let i=!0;for(const s of n)i?(e.moveTo(s.x,s.y),i=!1):e.lineTo(s.x,s.y);e.closePath(),e.fill(),r&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore()}resolveElementProperties(e,n){const o=nt(e,n),{sides:r,rotation:i}=n,s=[],a=2*b/r;let d=i*$e;for(let l=0;l<r;l++,d+=a){const c=jn(o,n,d);c.initProperties=H(e,o,n),s.push(c)}return o.elements=s,o}}te.id="polygonAnnotation";te.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};te.defaultRoutes={borderColor:"color",backgroundColor:"color"};function jn({centerX:t,centerY:e},{radius:n,borderWidth:o},r){const i=o/2,s=Math.sin(r),a=Math.cos(r),d={x:t+s*n,y:e-a*n};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:t+s*(n+i),bY:e-a*(n+i)}}}function vn(t,e,n,o){let r=!1,i=t[t.length-1].getProps(["bX","bY"],o);for(const s of t){const a=s.getProps(["bX","bY"],o);a.bY>n!=i.bY>n&&e<(i.bX-a.bX)*(n-a.bY)/(i.bY-a.bY)+a.bX&&(r=!r),i=a}return r}const M={box:L,ellipse:$,label:N,line:V,point:ee,polygon:te};Object.keys(M).forEach(t=>{ct.describe(`elements.${M[t].id}`,{_fallback:"plugins.annotation.common"})});const An={update:Object.assign},Dn=xe.concat(G),Ne=(t,e)=>B(e)?ue(t,e):t,ce=t=>t==="color"||t==="font";function Me(t="line"){return M[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function In(t,e,n,o){const r=On(t,n.animations,o),i=e.annotations,s=Wn(e.elements,i);for(let a=0;a<i.length;a++){const d=i[a],l=dt(s,a,d.type),c=d.setContext(En(t,l,d)),u=l.resolveElementProperties(t,c);u.skip=Tn(u),"elements"in u&&(Rn(l,u.elements,c,r),delete u.elements),p(l.x)||Object.assign(l,u),Object.assign(l,u.initProperties),u.options=lt(c),r.update(l,u)}}function Tn(t){return isNaN(t.x)||isNaN(t.y)}function On(t,e,n){return n==="reset"||n==="none"||n==="resize"?An:new mt(t,e)}function Rn(t,e,n,o){const r=t.elements||(t.elements=[]);r.length=e.length;for(let i=0;i<e.length;i++){const s=e[i],a=s.properties,d=dt(r,i,s.type,s.initProperties),l=n[s.optionScope].override(s);a.options=lt(l),o.update(d,a)}}function dt(t,e,n,o){const r=M[Me(n)];let i=t[e];return(!i||!(i instanceof r))&&(i=t[e]=new r,Object.assign(i,o)),i}function lt(t){const e=M[Me(t.type)],n={};n.id=t.id,n.type=t.type,n.drawTime=t.drawTime,Object.assign(n,ue(t,e.defaults),ue(t,e.defaultRoutes));for(const o of Dn)n[o]=t[o];return n}function ue(t,e){const n={};for(const o of Object.keys(e)){const r=e[o],i=t[o];ce(o)&&A(i)?n[o]=i.map(s=>Ne(s,r)):n[o]=Ne(i,r)}return n}function En(t,e,n){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,id:n.id,type:"annotation"}))}function Wn(t,e){const n=e.length,o=t.length;if(o<n){const r=n-o;t.splice(o,0,...new Array(r))}else o>n&&t.splice(n,o-n);return t}var Ln="2.2.1";const S=new Map,Yn=xe.concat(G);var Bn={id:"annotation",version:Ln,beforeRegister(){Pt("chart.js","3.7",oe.version)},afterRegister(){oe.register(M)},afterUnregister(){oe.unregister(M)},beforeInit(t){S.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,n){const o=S.get(t),r=o.annotations=[];let i=n.annotations;B(i)?Object.keys(i).forEach(s=>{const a=i[s];B(a)&&(a.id=s,r.push(a))}):A(i)&&r.push(...i),Gt(r,t.scales)},afterDataLimits(t,e){const n=S.get(t);Kt(t,e.scale,n.annotations.filter(o=>o.display&&o.adjustScaleRange))},afterUpdate(t,e,n){const o=S.get(t);Vt(t,o,n),In(t,o,n,e.mode),o.visibleElements=o.elements.filter(r=>!r.skip&&r.options.display),qt(t,o,n)},beforeDatasetsDraw(t,e,n){U(t,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(t,e,n){U(t,"afterDatasetsDraw",n.clip)},beforeDraw(t,e,n){U(t,"beforeDraw",n.clip)},afterDraw(t,e,n){U(t,"afterDraw",n.clip)},beforeEvent(t,e,n){const o=S.get(t);$t(o,e.event,n)&&(e.changed=!0)},afterDestroy(t){S.delete(t)},_getState(t){return S.get(t)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!Yn.includes(t)&&t!=="init",annotations:{_allKeys:!1,_fallback:(t,e)=>`elements.${M[Me(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ce,_fallback:!0},_indexable:ce}},additionalOptionScopes:[""]};function U(t,e,n){const{ctx:o,chartArea:r}=t,i=S.get(t);n&&ft(o,r);const s=Xn(i.visibleElements,e).sort((a,d)=>a.element.options.z-d.element.options.z);for(const a of s)zn(o,r,i,a);n&&ht(o)}function Xn(t,e){const n=[];for(const o of t)if(o.options.drawTime===e&&n.push({element:o,main:!0}),o.elements&&o.elements.length)for(const r of o.elements)r.options.display&&r.options.drawTime===e&&n.push({element:r});return n}function zn(t,e,n,o){const r=o.element;o.main?(De(n,r,"beforeDraw"),r.draw(t,e),De(n,r,"afterDraw")):r.draw(t,e)}const Hn=(t,e,n)=>{if(typeof t=="string")return t;const o=Number.parseInt(t.toString());return o>999999?`${o/1e6}M`:o>999?`${o/1e3}k`:o};export{Bn as a,Hn as f};
6
+ */const ke={modes:{point(t,e){return q(t,e,{intersect:!0})},nearest(t,e,n){return xt(t,e,n)},x(t,e,n){return q(t,e,{intersect:n.intersect,axis:"x"})},y(t,e,n){return q(t,e,{intersect:n.intersect,axis:"y"})}}};function ye(t,e,n){return(ke.modes[n.mode]||ke.modes.nearest)(t,e,n)}function pt(t,e,n){return n!=="x"&&n!=="y"?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,n,!0)}function wt(t,e,n){return n==="x"?{x:t.x,y:e.y}:n==="y"?{x:e.x,y:t.y}:e}function q(t,e,n){return t.visibleElements.filter(o=>n.intersect?o.inRange(e.x,e.y):pt(o,e,n.axis))}function xt(t,e,n){let o=Number.POSITIVE_INFINITY;return q(t,e,n).reduce((r,i)=>{const s=i.getCenterPoint(),a=wt(e,s,n.axis),d=fe(e,a);return d<o?(r=[i],o=d):d===o&&r.push(i),r},[]).sort((r,i)=>r._index-i._index).slice(0,1)}const St=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,v=.001,F=(t,e,n)=>Math.min(n,Math.max(e,t));function Mt(t,e,n){for(const o of Object.keys(t))t[o]=F(t[o],e,n);return t}function Ct(t,e,n,o){if(!t||!e||n<=0)return!1;const r=o/2;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(n+r,2)}function Je(t,{x:e,y:n,x2:o,y2:r},i,s){const a=s/2,d=t.x>=e-a-v&&t.x<=o+a+v,l=t.y>=n-a-v&&t.y<=r+a+v;return i==="x"?d:(i==="y"||d)&&l}function E(t,e){const{centerX:n,centerY:o}=t.getProps(["centerX","centerY"],e);return{x:n,y:o}}function Pt(t,e,n,o=!0){const r=n.split(".");let i=0;for(const s of e.split(".")){const a=r[i++];if(parseInt(s,10)<parseInt(a,10))break;if(St(a,s)){if(o)throw new Error(`${t} v${n} is not supported. v${e} or newer is required.`);return!1}}return!0}const Ue=t=>typeof t=="string"&&t.endsWith("%"),qe=t=>parseFloat(t)/100,Ke=t=>F(qe(t),0,1);function be(t,e){return e==="start"?0:e==="end"?t:Ue(e)?Ke(e)*t:t/2}function C(t,e,n=!0){return typeof e=="number"?e:Ue(e)?(n?Ke(e):qe(e))*t:t}function kt(t,e){const{x:n,width:o}=t,r=e.textAlign;return r==="center"?n+o/2:r==="end"||r==="right"?n+o:n}function ge(t,e="center"){return B(t)?{x:z(t.x,e),y:z(t.y,e)}:(t=z(t,e),{x:t,y:t})}function Qe(t){return t&&(p(t.xValue)||p(t.yValue))}function H(t,e,n,o=!1){const r=n.init;if(r){if(r===!0)return Fe(e,o)}else return;return jt(e,o,he(r,[{chart:t,properties:e,options:n}]))}function Ge(t,e,n){let o=!1;return e.forEach(r=>{I(t[r])?(o=!0,n[r]=t[r]):p(n[r])&&delete n[r]}),o}function Fe({centerX:t,centerY:e},n){return n?{centerX:t,centerY:e,radius:0,width:0,height:0}:{x:t,y:e,x2:t,y2:e,width:0,height:0}}function jt(t,e,n){if(n===!0)return Fe(t,e);if(B(n))return n}const re=new Map,vt=t=>isNaN(t)||t<=0,At=t=>t.reduce(function(e,n){return e+=n.string,e},"");function Z(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object HTMLImageElement]"||e==="[object HTMLCanvasElement]"}}function me(t,{x:e,y:n},o){o&&(t.translate(e,n),t.rotate(w(o)),t.translate(-e,-n))}function P(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle,t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle,t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function W(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function pe(t,e){const n=e.content;if(Z(n))return{width:C(n.width,e.width),height:C(n.height,e.height)};const o=e.font,r=A(o)?o.map(d=>K(d)):[K(o)],i=e.textStrokeWidth,s=A(n)?n:[n],a=s.join()+At(r)+i+(t._measureText?"-spriting":"");return re.has(a)||re.set(a,Rt(t,s,r,i)),re.get(a)}function Ze(t,e,n){const{x:o,y:r,width:i,height:s}=e;t.save(),W(t,n);const a=P(t,n);t.fillStyle=n.backgroundColor,t.beginPath(),yt(t,{x:o,y:r,w:i,h:s,radius:Mt(bt(n.borderRadius),0,Math.min(i,s)/2)}),t.closePath(),t.fill(),a&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore()}function Dt(t,e,n){const o=n.content;if(Z(o)){t.save(),t.globalAlpha=Lt(n.opacity,o.style.opacity),t.drawImage(o,e.x,e.y,e.width,e.height),t.restore();return}const r=A(o)?o:[o],i=n.font,s=A(i)?i.map(u=>K(u)):[K(i)],a=n.color,d=A(a)?a:[a],l=kt(e,n),c=e.y+n.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=n.textAlign,Tt(t,n)&&Et(t,{x:l,y:c},r,s),Wt(t,{x:l,y:c},r,{fonts:s,colors:d}),t.restore()}function Tt(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}function It(t,e,n,o){const{radius:r,options:i}=e,s=i.pointStyle,a=i.rotation;let d=(a||0)*$e;if(Z(s)){t.save(),t.translate(n,o),t.rotate(d),t.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),t.restore();return}vt(r)||Ot(t,{x:n,y:o,radius:r,rotation:a,style:s,rad:d})}function Ot(t,{x:e,y:n,radius:o,rotation:r,style:i,rad:s}){let a,d,l,c;switch(t.beginPath(),i){default:t.arc(e,n,o,0,gt),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(s)*o,n-Math.cos(s)*o),s+=Ce,t.lineTo(e+Math.sin(s)*o,n-Math.cos(s)*o),s+=Ce,t.lineTo(e+Math.sin(s)*o,n-Math.cos(s)*o),t.closePath();break;case"rectRounded":c=o*.516,l=o-c,a=Math.cos(s+X)*l,d=Math.sin(s+X)*l,t.arc(e-a,n-d,c,s-b,s-J),t.arc(e+d,n-a,c,s-J,s),t.arc(e+a,n+d,c,s,s+J),t.arc(e-d,n+a,c,s+J,s+b),t.closePath();break;case"rect":if(!r){l=Math.SQRT1_2*o,t.rect(e-l,n-l,2*l,2*l);break}s+=X;case"rectRot":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+d,n-a),t.lineTo(e+a,n+d),t.lineTo(e-d,n+a),t.closePath();break;case"crossRot":s+=X;case"cross":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d),t.moveTo(e+d,n-a),t.lineTo(e-d,n+a);break;case"star":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d),t.moveTo(e+d,n-a),t.lineTo(e-d,n+a),s+=X,a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d),t.moveTo(e+d,n-a),t.lineTo(e-d,n+a);break;case"line":a=Math.cos(s)*o,d=Math.sin(s)*o,t.moveTo(e-a,n-d),t.lineTo(e+a,n+d);break;case"dash":t.moveTo(e,n),t.lineTo(e+Math.cos(s)*o,n+Math.sin(s)*o);break}t.fill()}function Rt(t,e,n,o){t.save();const r=e.length;let i=0,s=o;for(let a=0;a<r;a++){const d=n[Math.min(a,n.length-1)];t.font=d.string;const l=e[a];i=Math.max(i,t.measureText(l).width+o),s+=d.lineHeight}return t.restore(),{width:i,height:s}}function Et(t,{x:e,y:n},o,r){t.beginPath();let i=0;o.forEach(function(s,a){const d=r[Math.min(a,r.length-1)],l=d.lineHeight;t.font=d.string,t.strokeText(s,e,n+l/2+i),i+=l}),t.stroke()}function Wt(t,{x:e,y:n},o,{fonts:r,colors:i}){let s=0;o.forEach(function(a,d){const l=i[Math.min(d,i.length-1)],c=r[Math.min(d,r.length-1)],u=c.lineHeight;t.beginPath(),t.font=c.string,t.fillStyle=l,t.fillText(a,e,n+u/2+s),s+=u,t.fill()})}function Lt(t,e){const n=Pe(t)?t:e;return Pe(n)?F(n,0,1):1}const je={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function O(t,e,n){return e=typeof e=="number"?e:t.parse(e),Ve(e)?t.getPixelForValue(e):n}function D(t,e,n){const o=e[n];if(o||n==="scaleID")return o;const r=n.charAt(0),i=Object.values(t).filter(s=>s.axis&&s.axis===r);return i.length?i[0].id:r}function et(t,e){if(t){const n=t.options.reverse,o=O(t,e.min,n?e.end:e.start),r=O(t,e.max,n?e.start:e.end);return{start:o,end:r}}}function tt(t,e){const{chartArea:n,scales:o}=t,r=o[D(o,e,"xScaleID")],i=o[D(o,e,"yScaleID")];let s=n.width/2,a=n.height/2;return r&&(s=O(r,e.xValue,r.left+r.width/2)),i&&(a=O(i,e.yValue,i.top+i.height/2)),{x:s,y:a}}function we(t,e){const n=t.scales,o=n[D(n,e,"xScaleID")],r=n[D(n,e,"yScaleID")];if(!o&&!r)return{};let{left:i,right:s}=o||t.chartArea,{top:a,bottom:d}=r||t.chartArea;const l=ve(o,{min:e.xMin,max:e.xMax,start:i,end:s});i=l.start,s=l.end;const c=ve(r,{min:e.yMin,max:e.yMax,start:d,end:a});return a=c.start,d=c.end,{x:i,y:a,x2:s,y2:d,width:s-i,height:d-a,centerX:i+(s-i)/2,centerY:a+(d-a)/2}}function nt(t,e){if(!Qe(e)){const n=we(t,e);let o=e.radius;(!o||isNaN(o))&&(o=Math.min(n.width,n.height)/2,e.radius=o);const r=o*2,i=n.centerX+e.xAdjust,s=n.centerY+e.yAdjust;return{x:i-o,y:s-o,x2:i+o,y2:s+o,centerX:i,centerY:s,width:r,height:r,radius:o}}return Xt(t,e)}function Yt(t,e){const{scales:n,chartArea:o}=t,r=n[e.scaleID],i={x:o.left,y:o.top,x2:o.right,y2:o.bottom};return r?_t(r,i,e):zt(n,i,e),i}function ot(t,e,n){const o=we(t,e);return o.initProperties=H(t,o,e,n),o.elements=[{type:"label",optionScope:"label",properties:Nt(t,o,e),initProperties:o.initProperties}],o}function Xt(t,e){const n=tt(t,e),o=e.radius*2;return{x:n.x-e.radius+e.xAdjust,y:n.y-e.radius+e.yAdjust,x2:n.x+e.radius+e.xAdjust,y2:n.y+e.radius+e.yAdjust,centerX:n.x+e.xAdjust,centerY:n.y+e.yAdjust,radius:e.radius,width:o,height:o}}function ve(t,e){const n=et(t,e)||e;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function _t(t,e,n){const o=O(t,n.value,NaN),r=O(t,n.endValue,o);t.isHorizontal()?(e.x=o,e.x2=r):(e.y=o,e.y2=r)}function zt(t,e,n){for(const o of Object.keys(je)){const r=t[D(t,n,o)];if(r){const{min:i,max:s,start:a,end:d,startProp:l,endProp:c}=je[o],u=et(r,{min:n[i],max:n[s],start:r[a],end:r[d]});e[l]=u.start,e[c]=u.end}}}function Bt({properties:t,options:e},n,o,r){const{x:i,x2:s,width:a}=t;return rt({start:i,end:s,size:a,borderWidth:e.borderWidth},{position:o.x,padding:{start:r.left,end:r.right},adjust:e.label.xAdjust,size:n.width})}function Ht({properties:t,options:e},n,o,r){const{y:i,y2:s,height:a}=t;return rt({start:i,end:s,size:a,borderWidth:e.borderWidth},{position:o.y,padding:{start:r.top,end:r.bottom},adjust:e.label.yAdjust,size:n.height})}function rt(t,e){const{start:n,end:o,borderWidth:r}=t,{position:i,padding:{start:s,end:a},adjust:d}=e,l=o-r-n-s-a-e.size;return n+r/2+d+be(l,i)}function Nt(t,e,n){const o=n.label;o.backgroundColor="transparent",o.callout.display=!1;const r=ge(o.position),i=G(o.padding),s=pe(t.ctx,o),a=Bt({properties:e,options:n},s,r,i),d=Ht({properties:e,options:n},s,r,i),l=s.width+i.width,c=s.height+i.height;return{x:a,y:d,x2:a+l,y2:d+c,width:l,height:c,centerX:a+l/2,centerY:d+c/2,rotation:o.rotation}}function T(t,e,n){const o=Math.cos(n),r=Math.sin(n),i=e.x,s=e.y;return{x:i+o*(t.x-i)-r*(t.y-s),y:s+r*(t.x-i)+o*(t.y-s)}}const ie=["enter","leave"],xe=ie.concat("click");function Vt(t,e,n){e.listened=Ge(n,xe,e.listeners),e.moveListened=!1,e._getElements=ye,ie.forEach(o=>{I(n[o])&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(o=>{!e.listened&&I(o.click)&&(e.listened=!0),e.moveListened||ie.forEach(r=>{I(o[r])&&(e.listened=!0,e.moveListened=!0)})})}function $t(t,e,n){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return Jt(t,e,n);case"click":return Ut(t,e,n)}}function Jt(t,e,n){if(!t.moveListened)return;let o;e.type==="mousemove"?o=ye(t,e,n.interaction):o=[];const r=t.hovered;t.hovered=o;const i={state:t,event:e};let s=Ae(i,"leave",r,o);return Ae(i,"enter",o,r)||s}function Ae({state:t,event:e},n,o,r){let i;for(const s of o)r.indexOf(s)<0&&(i=it(s.options[n]||t.listeners[n],s,e)||i);return i}function Ut(t,e,n){const o=t.listeners,r=ye(t,e,n.interaction);let i;for(const s of r)i=it(s.options.click||o.click,s,e)||i;return i}function it(t,e,n){return he(t,[e.$context,n])===!0}const Q=["afterDraw","beforeDraw"];function qt(t,e,n){const o=e.visibleElements;e.hooked=Ge(n,Q,e.hooks),e.hooked||o.forEach(r=>{e.hooked||Q.forEach(i=>{I(r.options[i])&&(e.hooked=!0)})})}function De(t,e,n){if(t.hooked){const o=e.options[n]||t.hooks[n];return he(o,[e.$context])}}function Kt(t,e,n){const o=en(t.scales,e,n);let r=Te(e,o,"min","suggestedMin");r=Te(e,o,"max","suggestedMax")||r,r&&I(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function Qt(t,e){for(const n of t)Ft(n,e)}function Te(t,e,n,o){if(Ve(e[n])&&!Gt(t.options,n,o)){const r=t[n]!==e[n];return t[n]=e[n],r}}function Gt(t,e,n){return p(t[e])||p(t[n])}function Ft(t,e){for(const n of["scaleID","xScaleID","yScaleID"]){const o=D(e,t,n);o&&!e[o]&&Zt(t,n)&&console.warn(`No scale found with id '${o}' for annotation '${t.id}'`)}}function Zt(t,e){if(e==="scaleID")return!0;const n=e.charAt(0);for(const o of["Min","Max","Value"])if(p(t[n+o]))return!0;return!1}function en(t,e,n){const o=e.axis,r=e.id,i=o+"ScaleID",s={min:z(e.min,Number.NEGATIVE_INFINITY),max:z(e.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===r?Ie(a,e,["value","endValue"],s):D(t,a,i)===r&&Ie(a,e,[o+"Min",o+"Max",o+"Value"],s);return s}function Ie(t,e,n,o){for(const r of n){const i=t[r];if(p(i)){const s=e.parse(i);o.min=Math.min(o.min,s),o.max=Math.max(o.max,s)}}}class L extends R{inRange(e,n,o,r){const{x:i,y:s}=T({x:e,y:n},this.getCenterPoint(r),w(-this.options.rotation));return Je({x:i,y:s},this.getProps(["x","y","x2","y2"],r),o,this.options.borderWidth)}getCenterPoint(e){return E(this,e)}draw(e){e.save(),me(e,this.getCenterPoint(),this.options.rotation),Ze(e,this,this.options),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return ot(e,n)}}L.id="boxAnnotation";L.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};L.defaultRoutes={borderColor:"color",backgroundColor:"color"};L.descriptors={label:{_fallback:!0}};const st=["left","bottom","top","right"];class N extends R{inRange(e,n,o,r){const{x:i,y:s}=T({x:e,y:n},this.getCenterPoint(r),w(-this.rotation));return Je({x:i,y:s},this.getProps(["x","y","x2","y2"],r),o,this.options.borderWidth)}getCenterPoint(e){return E(this,e)}draw(e){const n=this.options,o=!p(this._visible)||this._visible;!n.display||!n.content||!o||(e.save(),me(e,this.getCenterPoint(),this.rotation),nn(e,this),Ze(e,this,n),Dt(e,cn(this),n),e.restore())}resolveElementProperties(e,n){let o;if(Qe(n))o=tt(e,n);else{const{centerX:a,centerY:d}=we(e,n);o={x:a,y:d}}const r=G(n.padding),i=pe(e.ctx,n),s=tn(o,i,n,r);return{initProperties:H(e,s,n),pointX:o.x,pointY:o.y,...s,rotation:n.rotation}}}N.id="labelAnnotation";N.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};N.defaultRoutes={borderColor:"color"};function tn(t,e,n,o){const r=e.width+o.width+n.borderWidth,i=e.height+o.height+n.borderWidth,s=ge(n.position,"center"),a=Oe(t.x,r,n.xAdjust,s.x),d=Oe(t.y,i,n.yAdjust,s.y);return{x:a,y:d,x2:a+r,y2:d+i,width:r,height:i,centerX:a+r/2,centerY:d+i/2}}function Oe(t,e,n=0,o){return t-be(e,o)+n}function nn(t,e){const{pointX:n,pointY:o,options:r}=e,i=r.callout,s=i&&i.display&&dn(e,i);if(!s||un(e,i,s))return;if(t.save(),t.beginPath(),!P(t,i))return t.restore();const{separatorStart:d,separatorEnd:l}=on(e,s),{sideStart:c,sideEnd:u}=sn(e,s,d);(i.margin>0||r.borderWidth===0)&&(t.moveTo(d.x,d.y),t.lineTo(l.x,l.y)),t.moveTo(c.x,c.y),t.lineTo(u.x,u.y);const f=T({x:n,y:o},e.getCenterPoint(),w(-e.rotation));t.lineTo(f.x,f.y),t.stroke(),t.restore()}function on(t,e){const{x:n,y:o,x2:r,y2:i}=t,s=rn(t,e);let a,d;return e==="left"||e==="right"?(a={x:n+s,y:o},d={x:a.x,y:i}):(a={x:n,y:o+s},d={x:r,y:a.y}),{separatorStart:a,separatorEnd:d}}function rn(t,e){const{width:n,height:o,options:r}=t,i=r.callout.margin+r.borderWidth/2;return e==="right"?n+i:e==="bottom"?o+i:-i}function sn(t,e,n){const{y:o,width:r,height:i,options:s}=t,a=s.callout.start,d=an(e,s.callout);let l,c;return e==="left"||e==="right"?(l={x:n.x,y:o+C(i,a)},c={x:l.x+d,y:l.y}):(l={x:n.x+C(r,a),y:n.y},c={x:l.x,y:l.y+d}),{sideStart:l,sideEnd:c}}function an(t,e){const n=e.side;return t==="left"||t==="top"?-n:n}function dn(t,e){const n=e.position;return st.includes(n)?n:ln(t,e)}function ln(t,e){const{x:n,y:o,x2:r,y2:i,width:s,height:a,pointX:d,pointY:l,centerX:c,centerY:u,rotation:f}=t,h={x:c,y:u},y=e.start,x=C(s,y),Y=C(a,y),g=[n,n+x,n+x,r],m=[o+Y,i,o,i],k=[];for(let j=0;j<4;j++){const ne=T({x:g[j],y:m[j]},h,w(f));k.push({position:st[j],distance:fe(ne,{x:d,y:l})})}return k.sort((j,ne)=>j.distance-ne.distance)[0].position}function cn({x:t,y:e,width:n,height:o,options:r}){const i=r.borderWidth/2,s=G(r.padding);return{x:t+s.left+i,y:e+s.top+i,width:n-s.left-s.right-r.borderWidth,height:o-s.top-s.bottom-r.borderWidth}}function un(t,e,n){const{pointX:o,pointY:r}=t,i=e.margin;let s=o,a=r;return n==="left"?s+=i:n==="right"?s-=i:n==="top"?a+=i:n==="bottom"&&(a-=i),t.inRange(s,a)}const Se=(t,e,n)=>({x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}),se=(t,e,n)=>Se(e,n,Math.abs((t-e.y)/(n.y-e.y))).x,Re=(t,e,n)=>Se(e,n,Math.abs((t-e.x)/(n.x-e.x))).y,_=t=>t*t,fn=(t,e,{x:n,y:o,x2:r,y2:i},s)=>s==="y"?{start:Math.min(o,i),end:Math.max(o,i),value:e}:{start:Math.min(n,r),end:Math.max(n,r),value:t},Ee=(t,e,n,o)=>(1-o)*(1-o)*t+2*(1-o)*o*e+o*o*n,ae=(t,e,n,o)=>({x:Ee(t.x,e.x,n.x,o),y:Ee(t.y,e.y,n.y,o)}),We=(t,e,n,o)=>2*(1-o)*(e-t)+2*o*(n-e),Le=(t,e,n,o)=>-Math.atan2(We(t.x,e.x,n.x,o),We(t.y,e.y,n.y,o))+.5*b;class V extends R{inRange(e,n,o,r){const i=this.options.borderWidth/2;if(o!=="x"&&o!=="y"){const s={mouseX:e,mouseY:n},{path:a,ctx:d}=this;if(a){P(d,this.options);const{chart:c}=this.$context,u=e*c.currentDevicePixelRatio,f=n*c.currentDevicePixelRatio,h=d.isPointInStroke(a,u,f)||de(this,s,r);return d.restore(),h}const l=_(i);return gn(this,s,l,r)||de(this,s,r)}return hn(this,{mouseX:e,mouseY:n},o,{hBorderWidth:i,useFinalPosition:r})}getCenterPoint(e){return E(this,e)}draw(e){const{x:n,y:o,x2:r,y2:i,cp:s,options:a}=this;if(e.save(),!P(e,a))return e.restore();W(e,a);const d=Math.sqrt(Math.pow(r-n,2)+Math.pow(i-o,2));if(a.curve&&s)return Pn(e,this,s,d),e.restore();const{startOpts:l,endOpts:c,startAdjust:u,endAdjust:f}=at(this),h=Math.atan2(i-o,r-n);e.translate(n,o),e.rotate(h),e.beginPath(),e.moveTo(0+u,0),e.lineTo(d-f,0),e.shadowColor=a.borderShadowColor,e.stroke(),le(e,0,u,l),le(e,d,-f,c),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){const o=Yt(e,n),{x:r,y:i,x2:s,y2:a}=o,d=yn(o,e.chartArea),l=d?bn({x:r,y:i},{x:s,y:a},e.chartArea):{x:r,y:i,x2:s,y2:a,width:Math.abs(s-r),height:Math.abs(a-i)};if(l.centerX=(s+r)/2,l.centerY=(a+i)/2,l.initProperties=H(e,l,n),n.curve){const u={x:l.x,y:l.y},f={x:l.x2,y:l.y2};l.cp=Cn(l,n,fe(u,f))}const c=mn(e,l,n.label);return c._visible=d,l.elements=[{type:"label",optionScope:"label",properties:c,initProperties:l.initProperties}],l}}V.id="lineAnnotation";const Ye={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};V.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ye),fill:!1,length:12,start:Object.assign({},Ye),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},N.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};V.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};V.defaultRoutes={borderColor:"color"};function hn(t,{mouseX:e,mouseY:n},o,{hBorderWidth:r,useFinalPosition:i}){const s=fn(e,n,t.getProps(["x","y","x2","y2"],i),o);return s.value>=s.start-r&&s.value<=s.end+r||de(t,{mouseX:e,mouseY:n},i,o)}function yn({x:t,y:e,x2:n,y2:o},{top:r,right:i,bottom:s,left:a}){return!(t<a&&n<a||t>i&&n>i||e<r&&o<r||e>s&&o>s)}function Xe({x:t,y:e},n,{top:o,right:r,bottom:i,left:s}){return t<s&&(e=Re(s,{x:t,y:e},n),t=s),t>r&&(e=Re(r,{x:t,y:e},n),t=r),e<o&&(t=se(o,{x:t,y:e},n),e=o),e>i&&(t=se(i,{x:t,y:e},n),e=i),{x:t,y:e}}function bn(t,e,n){const{x:o,y:r}=Xe(t,e,n),{x:i,y:s}=Xe(e,t,n);return{x:o,y:r,x2:i,y2:s,width:Math.abs(i-o),height:Math.abs(s-r)}}function gn(t,{mouseX:e,mouseY:n},o=v,r){const{x:i,y:s,x2:a,y2:d}=t.getProps(["x","y","x2","y2"],r),l=a-i,c=d-s,u=_(l)+_(c),f=u===0?-1:((e-i)*l+(n-s)*c)/u;let h,y;return f<0?(h=i,y=s):f>1?(h=a,y=d):(h=i+f*l,y=s+f*c),_(e-h)+_(n-y)<=o}function de(t,{mouseX:e,mouseY:n},o,r){const i=t.label;return i.options.display&&i.inRange(e,n,r,o)}function mn(t,e,n){const o=n.borderWidth,r=G(n.padding),i=pe(t.ctx,n),s=i.width+r.width+o,a=i.height+r.height+o;return wn(e,n,{width:s,height:a,padding:r},t.chartArea)}function pn(t){const{x:e,y:n,x2:o,y2:r}=t,i=Math.atan2(r-n,o-e);return i>b/2?i-b:i<b/-2?i+b:i}function wn(t,e,n,o){const{width:r,height:i,padding:s}=n,{xAdjust:a,yAdjust:d}=e,l={x:t.x,y:t.y},c={x:t.x2,y:t.y2},u=e.rotation==="auto"?pn(t):w(e.rotation),f=xn(r,i,u),h=Sn(t,e,{labelSize:f,padding:s},o),y=t.cp?ae(l,t.cp,c,h):Se(l,c,h),x={size:f.w,min:o.left,max:o.right,padding:s.left},Y={size:f.h,min:o.top,max:o.bottom,padding:s.top},g=ze(y.x,x)+a,m=ze(y.y,Y)+d;return{x:g-r/2,y:m-i/2,x2:g+r/2,y2:m+i/2,centerX:g,centerY:m,pointX:y.x,pointY:y.y,width:r,height:i,rotation:ut(u)}}function xn(t,e,n){const o=Math.cos(n),r=Math.sin(n);return{w:Math.abs(t*o)+Math.abs(e*r),h:Math.abs(t*r)+Math.abs(e*o)}}function Sn(t,e,n,o){let r;const i=Mn(t,o);return e.position==="start"?r=_e({w:t.x2-t.x,h:t.y2-t.y},n,e,i):e.position==="end"?r=1-_e({w:t.x-t.x2,h:t.y-t.y2},n,e,i):r=be(1,e.position),r}function _e(t,e,n,o){const{labelSize:r,padding:i}=e,s=t.w*o.dx,a=t.h*o.dy,d=s>0&&(r.w/2+i.left-o.x)/s,l=a>0&&(r.h/2+i.top-o.y)/a;return F(Math.max(d,l),0,.25)}function Mn(t,e){const{x:n,x2:o,y:r,y2:i}=t,s=Math.min(r,i)-e.top,a=Math.min(n,o)-e.left,d=e.bottom-Math.max(r,i),l=e.right-Math.max(n,o);return{x:Math.min(a,l),y:Math.min(s,d),dx:a<=l?1:-1,dy:s<=d?1:-1}}function ze(t,e){const{size:n,min:o,max:r,padding:i}=e,s=n/2;return n>r-o?(r+o)/2:(o>=t-i-s&&(t=o+i+s),r<=t+i+s&&(t=r-i-s),t)}function at(t){const e=t.options,n=e.arrowHeads&&e.arrowHeads.start,o=e.arrowHeads&&e.arrowHeads.end;return{startOpts:n,endOpts:o,startAdjust:Be(t,n),endAdjust:Be(t,o)}}function Be(t,e){if(!e||!e.display)return 0;const{length:n,width:o}=e,r=t.options.borderWidth/2,i={x:n,y:o+r};return Math.abs(se(0,i,{x:0,y:r}))}function le(t,e,n,o){if(!o||!o.display)return;const{length:r,width:i,fill:s,backgroundColor:a,borderColor:d}=o,l=Math.abs(e-r)+n;t.beginPath(),W(t,o),P(t,o),t.moveTo(l,-i),t.lineTo(e+n,0),t.lineTo(l,i),s===!0?(t.fillStyle=a||d,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=o.borderShadowColor,t.stroke()}function Cn(t,e,n){const{x:o,y:r,x2:i,y2:s,centerX:a,centerY:d}=t,l=Math.atan2(s-r,i-o),c=ge(e.controlPoint,0),u={x:a+C(n,c.x,!1),y:d+C(n,c.y,!1)};return T(u,{x:a,y:d},l)}function He(t,{x:e,y:n},{angle:o,adjust:r},i){!i||!i.display||(t.save(),t.translate(e,n),t.rotate(o),le(t,0,-r,i),t.restore())}function Pn(t,e,n,o){const{x:r,y:i,x2:s,y2:a,options:d}=e,{startOpts:l,endOpts:c,startAdjust:u,endAdjust:f}=at(e),h={x:r,y:i},y={x:s,y:a},x=Le(h,n,y,0),Y=Le(h,n,y,1)-b,g=ae(h,n,y,u/o),m=ae(h,n,y,1-f/o),k=new Path2D;t.beginPath(),k.moveTo(g.x,g.y),k.quadraticCurveTo(n.x,n.y,m.x,m.y),t.shadowColor=d.borderShadowColor,t.stroke(k),e.path=k,e.ctx=t,He(t,g,{angle:x,adjust:u},l),He(t,m,{angle:Y,adjust:f},c)}class $ extends R{inRange(e,n,o,r){const i=this.options.rotation,s=this.options.borderWidth;if(o!=="x"&&o!=="y")return kn({x:e,y:n},this.getProps(["width","height","centerX","centerY"],r),i,s);const{x:a,y:d,x2:l,y2:c}=this.getProps(["x","y","x2","y2"],r),u=s/2,f=o==="y"?{start:d,end:c}:{start:a,end:l},h=T({x:e,y:n},this.getCenterPoint(r),w(-i));return h[o]>=f.start-u-v&&h[o]<=f.end+u+v}getCenterPoint(e){return E(this,e)}draw(e){const{width:n,height:o,centerX:r,centerY:i,options:s}=this;e.save(),me(e,this.getCenterPoint(),s.rotation),W(e,this.options),e.beginPath(),e.fillStyle=s.backgroundColor;const a=P(e,s);e.ellipse(r,i,o/2,n/2,b/2,0,2*b),e.fill(),a&&(e.shadowColor=s.borderShadowColor,e.stroke()),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return ot(e,n,!0)}}$.id="ellipseAnnotation";$.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},L.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};$.defaultRoutes={borderColor:"color",backgroundColor:"color"};$.descriptors={label:{_fallback:!0}};function kn(t,e,n,o){const{width:r,height:i,centerX:s,centerY:a}=e,d=r/2,l=i/2;if(d<=0||l<=0)return!1;const c=w(n||0),u=o/2||0,f=Math.cos(c),h=Math.sin(c),y=Math.pow(f*(t.x-s)+h*(t.y-a),2),x=Math.pow(h*(t.x-s)-f*(t.y-a),2);return y/Math.pow(d+u,2)+x/Math.pow(l+u,2)<=1.0001}class ee extends R{inRange(e,n,o,r){const{x:i,y:s,x2:a,y2:d,width:l}=this.getProps(["x","y","x2","y2","width"],r),c=this.options.borderWidth;if(o!=="x"&&o!=="y")return Ct({x:e,y:n},this.getCenterPoint(r),l/2,c);const u=c/2,f=o==="y"?{start:s,end:d,value:n}:{start:i,end:a,value:e};return f.value>=f.start-u&&f.value<=f.end+u}getCenterPoint(e){return E(this,e)}draw(e){const n=this.options,o=n.borderWidth;if(n.radius<.1)return;e.save(),e.fillStyle=n.backgroundColor,W(e,n);const r=P(e,n);It(e,this,this.centerX,this.centerY),r&&!Z(n.pointStyle)&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore(),n.borderWidth=o}resolveElementProperties(e,n){const o=nt(e,n);return o.initProperties=H(e,o,n,!0),o}}ee.id="pointAnnotation";ee.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ee.defaultRoutes={borderColor:"color",backgroundColor:"color"};class te extends R{inRange(e,n,o,r){if(o!=="x"&&o!=="y")return this.options.radius>=.1&&this.elements.length>1&&vn(this.elements,e,n,r);const i=T({x:e,y:n},this.getCenterPoint(r),w(-this.options.rotation)),s=this.elements.map(l=>o==="y"?l.bY:l.bX),a=Math.min(...s),d=Math.max(...s);return i[o]>=a&&i[o]<=d}getCenterPoint(e){return E(this,e)}draw(e){const{elements:n,options:o}=this;e.save(),e.beginPath(),e.fillStyle=o.backgroundColor,W(e,o);const r=P(e,o);let i=!0;for(const s of n)i?(e.moveTo(s.x,s.y),i=!1):e.lineTo(s.x,s.y);e.closePath(),e.fill(),r&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore()}resolveElementProperties(e,n){const o=nt(e,n),{sides:r,rotation:i}=n,s=[],a=2*b/r;let d=i*$e;for(let l=0;l<r;l++,d+=a){const c=jn(o,n,d);c.initProperties=H(e,o,n),s.push(c)}return o.elements=s,o}}te.id="polygonAnnotation";te.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};te.defaultRoutes={borderColor:"color",backgroundColor:"color"};function jn({centerX:t,centerY:e},{radius:n,borderWidth:o},r){const i=o/2,s=Math.sin(r),a=Math.cos(r),d={x:t+s*n,y:e-a*n};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:t+s*(n+i),bY:e-a*(n+i)}}}function vn(t,e,n,o){let r=!1,i=t[t.length-1].getProps(["bX","bY"],o);for(const s of t){const a=s.getProps(["bX","bY"],o);a.bY>n!=i.bY>n&&e<(i.bX-a.bX)*(n-a.bY)/(i.bY-a.bY)+a.bX&&(r=!r),i=a}return r}const M={box:L,ellipse:$,label:N,line:V,point:ee,polygon:te};Object.keys(M).forEach(t=>{ct.describe(`elements.${M[t].id}`,{_fallback:"plugins.annotation.common"})});const An={update:Object.assign},Dn=xe.concat(Q),Ne=(t,e)=>B(e)?ue(t,e):t,ce=t=>t==="color"||t==="font";function Me(t="line"){return M[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function Tn(t,e,n,o){const r=On(t,n.animations,o),i=e.annotations,s=Wn(e.elements,i);for(let a=0;a<i.length;a++){const d=i[a],l=dt(s,a,d.type),c=d.setContext(En(t,l,d)),u=l.resolveElementProperties(t,c);u.skip=In(u),"elements"in u&&(Rn(l,u.elements,c,r),delete u.elements),p(l.x)||Object.assign(l,u),Object.assign(l,u.initProperties),u.options=lt(c),r.update(l,u)}}function In(t){return isNaN(t.x)||isNaN(t.y)}function On(t,e,n){return n==="reset"||n==="none"||n==="resize"?An:new mt(t,e)}function Rn(t,e,n,o){const r=t.elements||(t.elements=[]);r.length=e.length;for(let i=0;i<e.length;i++){const s=e[i],a=s.properties,d=dt(r,i,s.type,s.initProperties),l=n[s.optionScope].override(s);a.options=lt(l),o.update(d,a)}}function dt(t,e,n,o){const r=M[Me(n)];let i=t[e];return(!i||!(i instanceof r))&&(i=t[e]=new r,Object.assign(i,o)),i}function lt(t){const e=M[Me(t.type)],n={};n.id=t.id,n.type=t.type,n.drawTime=t.drawTime,Object.assign(n,ue(t,e.defaults),ue(t,e.defaultRoutes));for(const o of Dn)n[o]=t[o];return n}function ue(t,e){const n={};for(const o of Object.keys(e)){const r=e[o],i=t[o];ce(o)&&A(i)?n[o]=i.map(s=>Ne(s,r)):n[o]=Ne(i,r)}return n}function En(t,e,n){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,id:n.id,type:"annotation"}))}function Wn(t,e){const n=e.length,o=t.length;if(o<n){const r=n-o;t.splice(o,0,...new Array(r))}else o>n&&t.splice(n,o-n);return t}var Ln="2.2.1";const S=new Map,Yn=xe.concat(Q);var Bn={id:"annotation",version:Ln,beforeRegister(){Pt("chart.js","3.7",oe.version)},afterRegister(){oe.register(M)},afterUnregister(){oe.unregister(M)},beforeInit(t){S.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,n){const o=S.get(t),r=o.annotations=[];let i=n.annotations;B(i)?Object.keys(i).forEach(s=>{const a=i[s];B(a)&&(a.id=s,r.push(a))}):A(i)&&r.push(...i),Qt(r,t.scales)},afterDataLimits(t,e){const n=S.get(t);Kt(t,e.scale,n.annotations.filter(o=>o.display&&o.adjustScaleRange))},afterUpdate(t,e,n){const o=S.get(t);Vt(t,o,n),Tn(t,o,n,e.mode),o.visibleElements=o.elements.filter(r=>!r.skip&&r.options.display),qt(t,o,n)},beforeDatasetsDraw(t,e,n){U(t,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(t,e,n){U(t,"afterDatasetsDraw",n.clip)},beforeDraw(t,e,n){U(t,"beforeDraw",n.clip)},afterDraw(t,e,n){U(t,"afterDraw",n.clip)},beforeEvent(t,e,n){const o=S.get(t);$t(o,e.event,n)&&(e.changed=!0)},afterDestroy(t){S.delete(t)},_getState(t){return S.get(t)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!Yn.includes(t)&&t!=="init",annotations:{_allKeys:!1,_fallback:(t,e)=>`elements.${M[Me(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ce,_fallback:!0},_indexable:ce}},additionalOptionScopes:[""]};function U(t,e,n){const{ctx:o,chartArea:r}=t,i=S.get(t);n&&ft(o,r);const s=Xn(i.visibleElements,e).sort((a,d)=>a.element.options.z-d.element.options.z);for(const a of s)_n(o,r,i,a);n&&ht(o)}function Xn(t,e){const n=[];for(const o of t)if(o.options.drawTime===e&&n.push({element:o,main:!0}),o.elements&&o.elements.length)for(const r of o.elements)r.options.display&&r.options.drawTime===e&&n.push({element:r});return n}function _n(t,e,n,o){const r=o.element;o.main?(De(n,r,"beforeDraw"),r.draw(t,e),De(n,r,"afterDraw")):r.draw(t,e)}const Hn=(t,e,n)=>{if(typeof t=="string")return t;const o=Number.parseInt(t.toString());return o>999999?`${o/1e6}M`:o>999?`${o/1e3}k`:o};export{Bn as a,Hn as f};