@justifi/webcomponents 4.7.4 → 4.7.6

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 (649) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cjs/{Api-548eaa62.js → Api-a06b996e.js} +35 -35
  3. package/dist/cjs/{Pagination-cae1dcbd.js → Pagination-0da8f095.js} +5 -5
  4. package/dist/cjs/Payout-7821eb61.js +183 -0
  5. package/dist/cjs/SubAccount-b9487cbb.js +107 -0
  6. package/dist/cjs/additional-questions-details_5.cjs.entry.js +50 -50
  7. package/dist/cjs/business-form-schema-a2b87e77.js +148 -0
  8. package/dist/cjs/config-ff2dda66.js +15 -0
  9. package/dist/cjs/{form-1e732a9d.js → form-2ad3d374.js} +84 -84
  10. package/dist/cjs/form-control-datepart_2.cjs.entry.js +108 -108
  11. package/dist/cjs/form-control-monetary.cjs.entry.js +50 -50
  12. package/dist/cjs/form-control-number_3.cjs.entry.js +108 -108
  13. package/dist/cjs/{index-c5ace247.js → index-55950669.js} +220 -52
  14. package/dist/cjs/{index-5a880722.js → index-fc5339a5.js} +406 -195
  15. package/dist/cjs/{index.esm-91ec051e.js → index.esm-c08c2adc.js} +61 -30
  16. package/dist/cjs/justifi-additional-questions_6.cjs.entry.js +372 -372
  17. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +56 -56
  18. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +79 -79
  19. package/dist/cjs/justifi-business-details.cjs.entry.js +61 -61
  20. package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +135 -122
  21. package/dist/cjs/justifi-business-form.cjs.entry.js +80 -69
  22. package/dist/cjs/justifi-business-list.cjs.entry.js +128 -128
  23. package/dist/cjs/justifi-card-form.cjs.entry.js +57 -57
  24. package/dist/cjs/justifi-details.cjs.entry.js +13 -13
  25. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +125 -125
  26. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +72 -72
  27. package/dist/cjs/justifi-payment-details.cjs.entry.js +53 -53
  28. package/dist/cjs/justifi-payment-form.cjs.entry.js +89 -89
  29. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +171 -188
  30. package/dist/cjs/justifi-payments-list.cjs.entry.js +99 -100
  31. package/dist/cjs/justifi-payout-details.cjs.entry.js +54 -54
  32. package/dist/cjs/justifi-payouts-list.cjs.entry.js +121 -121
  33. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +135 -135
  34. package/dist/cjs/justifi-refund-form.cjs.entry.js +85 -85
  35. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +62 -62
  36. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +86 -86
  37. package/dist/cjs/justifi-table_2.cjs.entry.js +64 -61
  38. package/dist/cjs/loader.cjs.js +2 -2
  39. package/dist/cjs/select-input_2.cjs.entry.js +38 -38
  40. package/dist/cjs/state-options-96d05a98.js +246 -0
  41. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +41 -41
  42. package/dist/cjs/subaccount-bank-details.cjs.entry.js +11 -11
  43. package/dist/cjs/subaccount-terms-details.cjs.entry.js +11 -11
  44. package/dist/cjs/{utils-13d069be.js → utils-36bf8b3e.js} +108 -108
  45. package/dist/cjs/utils-931f4879.js +34 -0
  46. package/dist/cjs/utils-99c086ee.js +35 -0
  47. package/dist/cjs/webcomponents.cjs.js +3 -3
  48. package/dist/collection/api/Api.js +34 -34
  49. package/dist/collection/api/Business.js +39 -39
  50. package/dist/collection/api/Pagination.js +5 -5
  51. package/dist/collection/api/Payment.js +108 -108
  52. package/dist/collection/api/Payout.js +33 -33
  53. package/dist/collection/api/Proceed.js +33 -33
  54. package/dist/collection/api/SubAccount.js +78 -78
  55. package/dist/collection/api/mockData/MockOnboardingData.js +108 -108
  56. package/dist/collection/api/mockData/MockPayments.js +207 -207
  57. package/dist/collection/api/mockData/MockSubAccount.js +96 -96
  58. package/dist/collection/api/mockData/mockGrossVolumeReport.js +123 -123
  59. package/dist/collection/collection-manifest.json +4 -4
  60. package/dist/collection/components/bank-account-form/bank-account-form.js +260 -259
  61. package/dist/collection/components/bank-account-form/test/bank-account-form.e2e.js +10 -10
  62. package/dist/collection/components/bank-account-form/test/bank-account-form.spec.js +38 -38
  63. package/dist/collection/components/billing-form/billing-form-schema.js +6 -6
  64. package/dist/collection/components/billing-form/billing-form.css +16 -12
  65. package/dist/collection/components/billing-form/billing-form.js +177 -179
  66. package/dist/collection/components/billing-form/state-options.js +240 -240
  67. package/dist/collection/components/billing-form/test/billing-form.spec.js +50 -50
  68. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.css +23 -16
  69. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +43 -43
  70. package/dist/collection/components/business-details/business-details.css +11 -4
  71. package/dist/collection/components/business-details/business-details.js +107 -107
  72. package/dist/collection/components/business-details/generic-info-details/generic-info-details.css +23 -16
  73. package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +43 -43
  74. package/dist/collection/components/business-details/legal-address-details/legal-address-details.css +23 -16
  75. package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +43 -43
  76. package/dist/collection/components/business-details/owner-details/owner-details.css +23 -16
  77. package/dist/collection/components/business-details/owner-details/owner-details.js +45 -45
  78. package/dist/collection/components/business-details/representative-details/representative-details.css +23 -16
  79. package/dist/collection/components/business-details/representative-details/representative-details.js +43 -43
  80. package/dist/collection/components/business-form/additional-questions/additional-questions.js +49 -49
  81. package/dist/collection/components/business-form/business-address/business-address-form-schema.js +8 -8
  82. package/dist/collection/components/business-form/business-address/business-address-form.css +16 -12
  83. package/dist/collection/components/business-form/business-address/business-address-form.js +93 -93
  84. package/dist/collection/components/business-form/business-address/test/business-address.e2e.js +6 -6
  85. package/dist/collection/components/business-form/business-address/test/business-address.spec.js +21 -21
  86. package/dist/collection/components/business-form/business-form-schema.js +137 -137
  87. package/dist/collection/components/business-form/business-form-stepped.css +23 -16
  88. package/dist/collection/components/business-form/business-form-stepped.js +218 -203
  89. package/dist/collection/components/business-form/business-form.css +118 -16
  90. package/dist/collection/components/business-form/business-form.js +142 -111
  91. package/dist/collection/components/business-form/business-generic-info/business-generic-info.css +16 -12
  92. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +57 -57
  93. package/dist/collection/components/business-form/business-owners/business-owners.css +23 -16
  94. package/dist/collection/components/business-form/business-owners/business-owners.js +117 -117
  95. package/dist/collection/components/business-form/business-representative/business-representative.css +16 -12
  96. package/dist/collection/components/business-form/business-representative/business-representative.js +65 -65
  97. package/dist/collection/components/business-form/helpers.js +19 -19
  98. package/dist/collection/components/business-form/legal-address-form/legal-address-form-schema.js +6 -6
  99. package/dist/collection/components/business-form/legal-address-form/legal-address-form.css +16 -12
  100. package/dist/collection/components/business-form/legal-address-form/legal-address-form.js +61 -61
  101. package/dist/collection/components/business-form/test/business-form.spec.js +35 -35
  102. package/dist/collection/components/business-list/business-list.css +3 -0
  103. package/dist/collection/components/business-list/business-list.js +160 -160
  104. package/dist/collection/components/business-list/business-list.stories.js +10 -10
  105. package/dist/collection/components/card-form/card-form.js +278 -277
  106. package/dist/collection/components/card-form/test/card-form.e2e.js +10 -10
  107. package/dist/collection/components/card-form/test/card-form.spec.js +45 -45
  108. package/dist/collection/components/details/details.css +38 -31
  109. package/dist/collection/components/details/details.js +42 -42
  110. package/dist/collection/components/form/form-control-datepart.js +224 -224
  111. package/dist/collection/components/form/form-control-monetary.js +177 -177
  112. package/dist/collection/components/form/form-control-number-masked.js +208 -208
  113. package/dist/collection/components/form/form-control-number.css +7 -2
  114. package/dist/collection/components/form/form-control-number.js +188 -188
  115. package/dist/collection/components/form/form-control-select.css +7 -2
  116. package/dist/collection/components/form/form-control-select.js +196 -196
  117. package/dist/collection/components/form/form-control-text.css +7 -2
  118. package/dist/collection/components/form/form-control-text.js +188 -188
  119. package/dist/collection/components/form/form.js +80 -80
  120. package/dist/collection/components/form/utils.js +2 -0
  121. package/dist/collection/components/gross-payment-chart/chart-utils.js +52 -52
  122. package/dist/collection/components/gross-payment-chart/gross-payment-chart.css +3 -0
  123. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +125 -125
  124. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +7 -7
  125. package/dist/collection/components/pagination-menu/pagination-menu.js +72 -72
  126. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js +144 -144
  127. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js +10 -10
  128. package/dist/collection/components/payment-details/payment-details.css +38 -31
  129. package/dist/collection/components/payment-details/payment-details.js +106 -106
  130. package/dist/collection/components/payment-form/payment-form.css +16 -12
  131. package/dist/collection/components/payment-form/payment-form.js +319 -318
  132. package/dist/collection/components/payment-form/payment-method-selector.css +6 -2
  133. package/dist/collection/components/payment-form/payment-method-selector.js +90 -90
  134. package/dist/collection/components/payment-form/test/payment-form.e2e.js +9 -9
  135. package/dist/collection/components/payment-form/test/payment-form.spec.js +157 -157
  136. package/dist/collection/components/payment-method-form/get-computed-theme.js +47 -47
  137. package/dist/collection/components/payment-method-form/message-event-types.js +14 -14
  138. package/dist/collection/components/payment-method-form/payment-method-form.js +288 -262
  139. package/dist/collection/components/payment-method-form/test/payment-method-form.e2e.js +16 -16
  140. package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +43 -43
  141. package/dist/collection/components/payments-list/payments-list.css +3 -0
  142. package/dist/collection/components/payments-list/payments-list.js +179 -180
  143. package/dist/collection/components/payments-list/test/payments-list.spec.js +21 -21
  144. package/dist/collection/components/payout-details/payout-details.css +38 -31
  145. package/dist/collection/components/payout-details/payout-details.js +107 -107
  146. package/dist/collection/components/payouts-list/payouts-list.css +3 -0
  147. package/dist/collection/components/payouts-list/payouts-list.js +201 -201
  148. package/dist/collection/components/proceeds-list/proceeds-list.css +3 -0
  149. package/dist/collection/components/proceeds-list/proceeds-list.js +182 -182
  150. package/dist/collection/components/proceeds-list/proceeds-list.stories.js +12 -12
  151. package/dist/collection/components/refund-form/refund-form-schema.js +9 -9
  152. package/dist/collection/components/refund-form/refund-form.css +23 -16
  153. package/dist/collection/components/refund-form/refund-form.js +216 -216
  154. package/dist/collection/components/refund-form/refund-form.stories.js +27 -27
  155. package/dist/collection/components/select-input/select-input.css +7 -2
  156. package/dist/collection/components/select-input/select-input.js +139 -139
  157. package/dist/collection/components/select-input/test/select-input.spec.js +38 -38
  158. package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.css +23 -16
  159. package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +65 -65
  160. package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.css +23 -16
  161. package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +43 -43
  162. package/dist/collection/components/subaccount-details/subaccount-details.css +38 -31
  163. package/dist/collection/components/subaccount-details/subaccount-details.js +132 -132
  164. package/dist/collection/components/subaccount-details/subaccount-details.stories.js +9 -9
  165. package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.css +23 -16
  166. package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +43 -44
  167. package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.css +23 -16
  168. package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +44 -43
  169. package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.css +23 -16
  170. package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +43 -43
  171. package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.css +23 -16
  172. package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +43 -43
  173. package/dist/collection/components/subaccount-details/test/subaccount-details.spec.js +7 -7
  174. package/dist/collection/components/subaccounts-list/subaccounts-list.js +166 -166
  175. package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js +12 -12
  176. package/dist/collection/components/subaccounts-list/test/subaccounts-list.e2e.js +6 -6
  177. package/dist/collection/components/subaccounts-list/test/subaccounts-list.spec.js +21 -21
  178. package/dist/collection/components/table/table.css +38 -31
  179. package/dist/collection/components/table/table.js +217 -224
  180. package/dist/collection/components/table/test/table.spec.js +64 -48
  181. package/dist/collection/components/table/utils.js +4 -0
  182. package/dist/collection/components/text-input/test/text-input.spec.js +31 -31
  183. package/dist/collection/components/text-input/text-input.css +7 -2
  184. package/dist/collection/components/text-input/text-input.js +122 -122
  185. package/dist/collection/utils/country-options.js +198 -198
  186. package/dist/collection/utils/phone-masks.js +1 -1
  187. package/dist/collection/utils/utils.js +107 -107
  188. package/dist/config.js +9 -9
  189. package/dist/docs.d.ts +401 -0
  190. package/dist/docs.json +6511 -0
  191. package/dist/esm/{Api-c65d3ed8.js → Api-0e88671c.js} +35 -35
  192. package/dist/esm/{Pagination-31f770d6.js → Pagination-afc8f96d.js} +5 -5
  193. package/dist/esm/Payout-c42e3877.js +179 -0
  194. package/dist/esm/SubAccount-b3ce8720.js +105 -0
  195. package/dist/esm/additional-questions-details_5.entry.js +50 -50
  196. package/dist/esm/business-form-schema-997c585c.js +144 -0
  197. package/dist/esm/config-476c7241.js +13 -0
  198. package/dist/esm/{form-32cf3d1e.js → form-5279c05a.js} +84 -84
  199. package/dist/esm/form-control-datepart_2.entry.js +108 -108
  200. package/dist/esm/form-control-monetary.entry.js +50 -50
  201. package/dist/esm/form-control-number_3.entry.js +108 -108
  202. package/dist/esm/{index-5ed53c20.js → index-5eb05747.js} +406 -195
  203. package/dist/esm/{index-7471ed60.js → index-62b8aa8a.js} +220 -52
  204. package/dist/esm/{index.esm-9397ffa0.js → index.esm-8ae36d07.js} +61 -30
  205. package/dist/esm/justifi-additional-questions_6.entry.js +372 -372
  206. package/dist/esm/justifi-bank-account-form.entry.js +56 -56
  207. package/dist/esm/justifi-billing-form_2.entry.js +79 -79
  208. package/dist/esm/justifi-business-details.entry.js +61 -61
  209. package/dist/esm/justifi-business-form-stepped.entry.js +135 -122
  210. package/dist/esm/justifi-business-form.entry.js +80 -69
  211. package/dist/esm/justifi-business-list.entry.js +128 -128
  212. package/dist/esm/justifi-card-form.entry.js +57 -57
  213. package/dist/esm/justifi-details.entry.js +13 -13
  214. package/dist/esm/justifi-gross-payment-chart.entry.js +125 -125
  215. package/dist/esm/justifi-payment-balance-transactions.entry.js +72 -72
  216. package/dist/esm/justifi-payment-details.entry.js +53 -53
  217. package/dist/esm/justifi-payment-form.entry.js +89 -89
  218. package/dist/esm/justifi-payment-method-form.entry.js +171 -188
  219. package/dist/esm/justifi-payments-list.entry.js +99 -100
  220. package/dist/esm/justifi-payout-details.entry.js +54 -54
  221. package/dist/esm/justifi-payouts-list.entry.js +121 -121
  222. package/dist/esm/justifi-proceeds-list.entry.js +135 -135
  223. package/dist/esm/justifi-refund-form.entry.js +85 -85
  224. package/dist/esm/justifi-subaccount-details.entry.js +62 -62
  225. package/dist/esm/justifi-subaccounts-list.entry.js +86 -86
  226. package/dist/esm/justifi-table_2.entry.js +64 -61
  227. package/dist/esm/loader.js +3 -3
  228. package/dist/esm/polyfills/core-js.js +0 -0
  229. package/dist/esm/polyfills/dom.js +0 -0
  230. package/dist/esm/polyfills/es5-html-element.js +0 -0
  231. package/dist/esm/polyfills/index.js +0 -0
  232. package/dist/esm/polyfills/system.js +0 -0
  233. package/dist/esm/select-input_2.entry.js +38 -38
  234. package/dist/esm/state-options-fc1daf67.js +244 -0
  235. package/dist/esm/subaccount-account-details_4.entry.js +41 -41
  236. package/dist/esm/subaccount-bank-details.entry.js +11 -11
  237. package/dist/esm/subaccount-terms-details.entry.js +11 -11
  238. package/dist/esm/{utils-40b7002c.js → utils-26c7dd12.js} +108 -108
  239. package/dist/esm/utils-8cc130a9.js +31 -0
  240. package/dist/esm/utils-f33f7e3c.js +27 -0
  241. package/dist/esm/webcomponents.js +4 -4
  242. package/{loader → dist/loader}/cdn.js +1 -1
  243. package/{loader → dist/loader}/index.cjs.js +1 -1
  244. package/{loader → dist/loader}/index.d.ts +1 -1
  245. package/dist/loader/index.es2017.js +3 -0
  246. package/{loader → dist/loader}/index.js +2 -2
  247. package/dist/{components → module}/Api.js +35 -35
  248. package/dist/{components → module}/Pagination.js +5 -5
  249. package/dist/module/Payout.js +179 -0
  250. package/dist/module/SubAccount.js +105 -0
  251. package/dist/{components → module}/additional-questions-details.d.ts +2 -2
  252. package/dist/module/additional-questions-details2.js +36 -0
  253. package/dist/module/additional-questions.js +50 -0
  254. package/dist/module/billing-form.js +113 -0
  255. package/dist/module/business-address-form.js +72 -0
  256. package/dist/module/business-generic-info.js +212 -0
  257. package/dist/module/business-owners.js +116 -0
  258. package/dist/module/business-representative.js +90 -0
  259. package/dist/module/config.js +13 -0
  260. package/dist/module/details.js +38 -0
  261. package/dist/{components → module}/form-control-datepart.d.ts +2 -2
  262. package/dist/module/form-control-datepart2.js +98 -0
  263. package/dist/{components → module}/form-control-monetary.d.ts +2 -2
  264. package/dist/module/form-control-monetary2.js +83 -0
  265. package/dist/{components → module}/form-control-number-masked.d.ts +2 -2
  266. package/dist/module/form-control-number-masked2.js +82 -0
  267. package/dist/{components → module}/form-control-number.d.ts +2 -2
  268. package/dist/module/form-control-number2.js +71 -0
  269. package/dist/{components → module}/form-control-select.d.ts +2 -2
  270. package/dist/module/form-control-select2.js +67 -0
  271. package/dist/{components → module}/form-control-text.d.ts +2 -2
  272. package/dist/module/form-control-text2.js +71 -0
  273. package/dist/{components → module}/form.js +84 -84
  274. package/dist/{components → module}/generic-info-details.d.ts +2 -2
  275. package/dist/module/generic-info-details2.js +37 -0
  276. package/dist/{components → module}/index.esm.js +61 -30
  277. package/dist/{components → module}/index2.js +406 -195
  278. package/dist/{components → module}/justifi-additional-questions.d.ts +2 -2
  279. package/dist/{components → module}/justifi-bank-account-form.d.ts +2 -2
  280. package/dist/module/justifi-bank-account-form.js +96 -0
  281. package/dist/{components → module}/justifi-billing-form.d.ts +2 -2
  282. package/dist/{components → module}/justifi-business-address-form.d.ts +2 -2
  283. package/dist/{components → module}/justifi-business-details.d.ts +2 -2
  284. package/dist/module/justifi-business-details.js +130 -0
  285. package/dist/{components → module}/justifi-business-form-stepped.d.ts +2 -2
  286. package/dist/module/justifi-business-form-stepped.js +242 -0
  287. package/dist/{components → module}/justifi-business-form.d.ts +2 -2
  288. package/dist/{components/justifi-payment-details.js → module/justifi-business-form.js} +175 -79
  289. package/dist/{components → module}/justifi-business-generic-info.d.ts +2 -2
  290. package/dist/{components → module}/justifi-business-list.d.ts +2 -2
  291. package/dist/module/justifi-business-list.js +197 -0
  292. package/dist/{components → module}/justifi-business-owners.d.ts +2 -2
  293. package/dist/{components → module}/justifi-business-representative.d.ts +2 -2
  294. package/dist/{components → module}/justifi-card-form.d.ts +2 -2
  295. package/dist/module/justifi-card-form.js +98 -0
  296. package/dist/{components → module}/justifi-details.d.ts +2 -2
  297. package/dist/{components → module}/justifi-gross-payment-chart.d.ts +2 -2
  298. package/dist/{components → module}/justifi-gross-payment-chart.js +146 -142
  299. package/dist/{components → module}/justifi-legal-address-form.d.ts +2 -2
  300. package/dist/{components → module}/justifi-payment-balance-transactions.d.ts +2 -2
  301. package/dist/module/justifi-payment-balance-transactions.js +125 -0
  302. package/dist/{components → module}/justifi-payment-details.d.ts +2 -2
  303. package/dist/module/justifi-payment-details.js +98 -0
  304. package/dist/{components → module}/justifi-payment-form.d.ts +2 -2
  305. package/dist/module/justifi-payment-form.js +169 -0
  306. package/dist/{components → module}/justifi-payment-method-form.d.ts +2 -2
  307. package/dist/{components → module}/justifi-payment-method-selector.d.ts +2 -2
  308. package/dist/{components → module}/justifi-payments-list.d.ts +2 -2
  309. package/dist/module/justifi-payments-list.js +154 -0
  310. package/dist/{components → module}/justifi-payout-details.d.ts +2 -2
  311. package/dist/module/justifi-payout-details.js +99 -0
  312. package/dist/{components → module}/justifi-payouts-list.d.ts +2 -2
  313. package/dist/module/justifi-payouts-list.js +176 -0
  314. package/dist/{components → module}/justifi-proceeds-list.d.ts +2 -2
  315. package/dist/module/justifi-proceeds-list.js +199 -0
  316. package/dist/{components → module}/justifi-refund-form.d.ts +2 -2
  317. package/dist/module/justifi-refund-form.js +139 -0
  318. package/dist/{components → module}/justifi-subaccount-details.d.ts +2 -2
  319. package/dist/module/justifi-subaccount-details.js +134 -0
  320. package/dist/{components → module}/justifi-subaccounts-list.d.ts +2 -2
  321. package/dist/module/justifi-subaccounts-list.js +142 -0
  322. package/dist/{components → module}/justifi-table.d.ts +2 -2
  323. package/dist/{components → module}/legal-address-details.d.ts +2 -2
  324. package/dist/module/legal-address-details2.js +36 -0
  325. package/dist/module/legal-address-form.js +268 -0
  326. package/dist/{components → module}/owner-details.d.ts +2 -2
  327. package/dist/module/owner-details2.js +39 -0
  328. package/dist/{components → module}/pagination-menu.d.ts +2 -2
  329. package/dist/module/pagination-menu2.js +43 -0
  330. package/dist/{components → module}/payment-method-form.js +191 -207
  331. package/dist/module/payment-method-selector.js +44 -0
  332. package/dist/{components → module}/phone-masks.js +1 -1
  333. package/dist/{components → module}/representative-details.d.ts +2 -2
  334. package/dist/module/representative-details2.js +37 -0
  335. package/dist/{components → module}/select-input.d.ts +2 -2
  336. package/dist/module/select-input2.js +50 -0
  337. package/dist/module/state-options.js +244 -0
  338. package/dist/{components → module}/subaccount-account-details.d.ts +2 -2
  339. package/dist/module/subaccount-account-details2.js +38 -0
  340. package/dist/{components → module}/subaccount-bank-details.d.ts +2 -2
  341. package/dist/module/subaccount-bank-details.js +39 -0
  342. package/dist/{components → module}/subaccount-merchant-details.d.ts +2 -2
  343. package/dist/module/subaccount-merchant-details2.js +37 -0
  344. package/dist/{components → module}/subaccount-owners-details.d.ts +2 -2
  345. package/dist/module/subaccount-owners-details2.js +37 -0
  346. package/dist/{components → module}/subaccount-representative-details.d.ts +2 -2
  347. package/dist/module/subaccount-representative-details2.js +37 -0
  348. package/dist/{components → module}/subaccount-terms-details.d.ts +2 -2
  349. package/dist/{webcomponents/p-98e4eae3.entry.js → module/subaccount-terms-details.js} +39 -1
  350. package/dist/module/table.js +93 -0
  351. package/dist/{components → module}/text-input.d.ts +2 -2
  352. package/dist/module/text-input2.js +48 -0
  353. package/dist/module/utils.js +27 -0
  354. package/dist/{components → module}/utils2.js +108 -108
  355. package/dist/module/utils3.js +31 -0
  356. package/dist/types/api/Api.d.ts +14 -14
  357. package/dist/types/api/Business.d.ts +120 -120
  358. package/dist/types/api/GrossVolume.d.ts +4 -4
  359. package/dist/types/api/Pagination.d.ts +12 -12
  360. package/dist/types/api/Payment.d.ts +134 -134
  361. package/dist/types/api/Payout.d.ts +51 -51
  362. package/dist/types/api/Proceed.d.ts +51 -51
  363. package/dist/types/api/SubAccount.d.ts +130 -130
  364. package/dist/types/api/mockData/MockOnboardingData.d.ts +5 -5
  365. package/dist/types/api/mockData/mockGrossVolumeReport.d.ts +5 -5
  366. package/dist/types/api/shared.d.ts +9 -9
  367. package/dist/types/components/bank-account-form/bank-account-form.d.ts +58 -0
  368. package/dist/types/components/billing-form/billing-form-schema.d.ts +18 -18
  369. package/dist/types/components/billing-form/billing-form.d.ts +25 -25
  370. package/dist/types/components/billing-form/state-options.d.ts +2 -2
  371. package/dist/types/components/business-details/additional-questions-details/additional-questions-details.d.ts +2 -2
  372. package/dist/types/components/business-details/business-details.d.ts +13 -13
  373. package/dist/types/components/business-details/generic-info-details/generic-info-details.d.ts +2 -2
  374. package/dist/types/components/business-details/legal-address-details/legal-address-details.d.ts +2 -2
  375. package/dist/types/components/business-details/owner-details/owner-details.d.ts +2 -2
  376. package/dist/types/components/business-details/representative-details/representative-details.d.ts +2 -2
  377. package/dist/types/components/business-form/additional-questions/additional-questions.d.ts +7 -7
  378. package/dist/types/components/business-form/business-address/business-address-form-schema.d.ts +16 -16
  379. package/dist/types/components/business-form/business-address/business-address-form.d.ts +7 -7
  380. package/dist/types/components/business-form/business-form-schema.d.ts +102 -102
  381. package/dist/types/components/business-form/business-form-stepped.d.ts +27 -23
  382. package/dist/types/components/business-form/business-form.d.ts +16 -11
  383. package/dist/types/components/business-form/business-generic-info/business-generic-info.d.ts +6 -6
  384. package/dist/types/components/business-form/business-owners/business-owners.d.ts +22 -22
  385. package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +13 -13
  386. package/dist/types/components/business-form/business-representative/business-representative.d.ts +8 -8
  387. package/dist/types/components/business-form/legal-address-form/legal-address-form-schema.d.ts +12 -12
  388. package/dist/types/components/business-form/legal-address-form/legal-address-form.d.ts +7 -7
  389. package/dist/types/components/business-list/business-list.d.ts +27 -27
  390. package/dist/types/components/business-list/business-list.stories.d.ts +3 -3
  391. package/dist/types/components/card-form/card-form.d.ts +68 -0
  392. package/dist/types/components/details/details.d.ts +2 -2
  393. package/dist/types/components/details/utils.d.ts +10 -10
  394. package/dist/types/components/form/form-control-datepart.d.ts +16 -16
  395. package/dist/types/components/form/form-control-monetary.d.ts +14 -14
  396. package/dist/types/components/form/form-control-number-masked.d.ts +16 -16
  397. package/dist/types/components/form/form-control-number.d.ts +15 -15
  398. package/dist/types/components/form/form-control-select.d.ts +17 -17
  399. package/dist/types/components/form/form-control-text.d.ts +15 -15
  400. package/dist/types/components/form/form.d.ts +18 -18
  401. package/dist/types/components/form/utils.d.ts +1 -0
  402. package/dist/types/components/gross-payment-chart/chart-utils.d.ts +39 -39
  403. package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +16 -16
  404. package/dist/types/components/pagination-menu/pagination-menu.d.ts +5 -5
  405. package/dist/types/components/payment-balance-transactions/payment-balance-transactions.d.ts +14 -14
  406. package/dist/types/components/payment-balance-transactions/payment-balance-transactions.stories.d.ts +3 -3
  407. package/dist/types/components/payment-details/payment-details.d.ts +9 -9
  408. package/dist/types/components/payment-form/payment-form.d.ts +22 -22
  409. package/dist/types/components/payment-form/payment-method-selector.d.ts +6 -6
  410. package/dist/types/components/payment-form/tokenize.d.ts +3 -3
  411. package/dist/types/components/payment-method-form/message-event-types.d.ts +14 -14
  412. package/dist/types/components/payment-method-form/payment-method-form.d.ts +21 -22
  413. package/dist/types/components/payment-method-form/payment-method-responses.d.ts +40 -40
  414. package/dist/types/components/payment-method-form/theme.d.ts +45 -45
  415. package/dist/types/components/payments-list/payments-list.d.ts +14 -14
  416. package/dist/types/components/payout-details/payout-details.d.ts +9 -9
  417. package/dist/types/components/payouts-list/payouts-list.d.ts +15 -15
  418. package/dist/types/components/proceeds-list/proceeds-list.d.ts +15 -15
  419. package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +4 -4
  420. package/dist/types/components/refund-form/refund-form-schema.d.ts +4 -4
  421. package/dist/types/components/refund-form/refund-form.d.ts +54 -54
  422. package/dist/types/components/refund-form/refund-form.stories.d.ts +21 -21
  423. package/dist/types/components/select-input/select-input.d.ts +14 -14
  424. package/dist/types/components/subaccount-details/subaccount-account-details/subaccount-account-details.d.ts +3 -3
  425. package/dist/types/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.d.ts +2 -2
  426. package/dist/types/components/subaccount-details/subaccount-details.d.ts +13 -13
  427. package/dist/types/components/subaccount-details/subaccount-details.stories.d.ts +3 -3
  428. package/dist/types/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.d.ts +2 -2
  429. package/dist/types/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.d.ts +2 -2
  430. package/dist/types/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.d.ts +2 -2
  431. package/dist/types/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.d.ts +2 -2
  432. package/dist/types/components/subaccounts-list/subaccounts-list.d.ts +14 -14
  433. package/dist/types/components/subaccounts-list/subaccounts-list.stories.d.ts +4 -4
  434. package/dist/types/components/table/table.d.ts +18 -19
  435. package/dist/types/components/table/utils.d.ts +3 -0
  436. package/dist/types/components/text-input/text-input.d.ts +10 -10
  437. package/dist/types/components.d.ts +232 -17
  438. package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/config.d.ts +11 -0
  439. package/dist/types/stencil-public-runtime.d.ts +32 -3
  440. package/dist/types/utils/country-options.d.ts +2 -2
  441. package/dist/types/utils/phone-masks.d.ts +1 -1
  442. package/dist/webcomponents/{p-b157f6ae.js → p-04c7f8f8.js} +1 -1
  443. package/dist/webcomponents/p-0a0cf2e6.entry.js +1 -0
  444. package/dist/webcomponents/p-0a1347cf.entry.js +1 -0
  445. package/dist/webcomponents/{p-86c23e1e.js → p-0f3e9483.js} +1 -1
  446. package/dist/webcomponents/p-0fa49c38.entry.js +1 -0
  447. package/dist/webcomponents/p-1e2a98bf.js +1 -0
  448. package/dist/webcomponents/{p-311250e2.entry.js → p-2b2f8162.entry.js} +1 -1
  449. package/dist/webcomponents/p-34c30022.entry.js +1 -0
  450. package/dist/webcomponents/{p-988191bf.js → p-3bef762a.js} +1 -1
  451. package/dist/webcomponents/{p-cdd06952.entry.js → p-40fb25c6.entry.js} +1 -1
  452. package/dist/webcomponents/p-45d2761d.entry.js +1 -0
  453. package/dist/webcomponents/p-4f14df36.js +2 -0
  454. package/dist/webcomponents/p-525adabf.entry.js +1 -0
  455. package/dist/webcomponents/p-57aab065.entry.js +1 -0
  456. package/dist/webcomponents/p-5a502ceb.entry.js +1 -0
  457. package/dist/webcomponents/p-5bf0ac1a.entry.js +1 -0
  458. package/dist/{components/subaccount-terms-details.js → webcomponents/p-64a5126c.entry.js} +1 -38
  459. package/dist/webcomponents/p-6e80f063.entry.js +1 -0
  460. package/dist/webcomponents/{p-59860ac8.js → p-78baff54.js} +1 -1
  461. package/dist/webcomponents/p-85ddbe82.entry.js +1 -0
  462. package/dist/webcomponents/p-8bbb1b10.entry.js +1 -0
  463. package/dist/webcomponents/p-90926321.js +1 -0
  464. package/dist/webcomponents/p-93579716.js +1 -0
  465. package/dist/webcomponents/p-9ba0be02.entry.js +1 -0
  466. package/dist/webcomponents/p-9cec4a27.entry.js +1 -0
  467. package/dist/webcomponents/p-9e0d2179.entry.js +1 -0
  468. package/dist/webcomponents/p-ac8be2a8.entry.js +1 -0
  469. package/dist/webcomponents/p-bd099662.entry.js +1 -0
  470. package/dist/{components/additional-questions-details2.js → webcomponents/p-c43e29ac.entry.js} +1 -35
  471. package/dist/webcomponents/p-c4826a33.entry.js +1 -0
  472. package/dist/webcomponents/{p-ed8c9b88.entry.js → p-c63a98f6.entry.js} +1 -1
  473. package/dist/webcomponents/{p-c0f9f6a8.entry.js → p-c950901c.entry.js} +2 -2
  474. package/dist/webcomponents/{p-3ee831ac.entry.js → p-d4755024.entry.js} +1 -1
  475. package/dist/webcomponents/p-d8835e7a.entry.js +1 -0
  476. package/dist/webcomponents/p-e8e109bd.entry.js +1 -0
  477. package/dist/webcomponents/p-ead8cfc2.entry.js +1 -0
  478. package/dist/webcomponents/p-f74899b9.entry.js +1 -0
  479. package/dist/webcomponents/p-f9183f12.entry.js +1 -0
  480. package/dist/webcomponents/webcomponents.css +1 -1
  481. package/dist/webcomponents/webcomponents.esm.js +1 -1
  482. package/package.json +18 -41
  483. package/readme.md +1 -1
  484. package/dist/cjs/Payout-f8240e9c.js +0 -183
  485. package/dist/cjs/SubAccount-f47c8522.js +0 -107
  486. package/dist/cjs/business-form-schema-fe831c30.js +0 -148
  487. package/dist/cjs/config-a156df17.js +0 -15
  488. package/dist/cjs/helpers-c505d861.js +0 -26
  489. package/dist/cjs/state-options-83b52cd1.js +0 -246
  490. package/dist/cjs/utils-a47b2e73.js +0 -35
  491. package/dist/collection/components/bank-account-form/bank-account-form.stories.js +0 -132
  492. package/dist/collection/components/bank-account-form/example.js +0 -54
  493. package/dist/collection/components/billing-form/billing-form.stories.js +0 -61
  494. package/dist/collection/components/billing-form/example.js +0 -26
  495. package/dist/collection/components/business-details/business-details.stories.js +0 -23
  496. package/dist/collection/components/business-form/business-form-example.js +0 -12
  497. package/dist/collection/components/business-form/business-form-stepped-example.js +0 -12
  498. package/dist/collection/components/business-form/business-form-stepped.stories.js +0 -132
  499. package/dist/collection/components/business-form/business-form.stories.js +0 -127
  500. package/dist/collection/components/card-form/card-form.stories.js +0 -137
  501. package/dist/collection/components/card-form/example.js +0 -59
  502. package/dist/collection/components/gross-payment-chart/example.js +0 -12
  503. package/dist/collection/components/gross-payment-chart/gross-payment-chart.stories.js +0 -22
  504. package/dist/collection/components/payment-details/example.js +0 -12
  505. package/dist/collection/components/payment-details/payment-details.stories.js +0 -47
  506. package/dist/collection/components/payment-form/example.js +0 -23
  507. package/dist/collection/components/payment-form/payment-form.stories.js +0 -129
  508. package/dist/collection/components/payments-list/example.js +0 -12
  509. package/dist/collection/components/payments-list/payments-list.stories.js +0 -88
  510. package/dist/collection/components/payout-details/example.js +0 -12
  511. package/dist/collection/components/payout-details/payout-details.stories.js +0 -47
  512. package/dist/collection/components/payouts-list/example.js +0 -12
  513. package/dist/collection/components/payouts-list/payouts-list.stories.js +0 -88
  514. package/dist/components/Payout.js +0 -179
  515. package/dist/components/SubAccount.js +0 -105
  516. package/dist/components/additional-questions.js +0 -49
  517. package/dist/components/billing-form.js +0 -112
  518. package/dist/components/business-address-form.js +0 -69
  519. package/dist/components/business-generic-info.js +0 -211
  520. package/dist/components/business-owners.js +0 -115
  521. package/dist/components/business-representative.js +0 -89
  522. package/dist/components/config.js +0 -13
  523. package/dist/components/details.js +0 -37
  524. package/dist/components/form-control-datepart2.js +0 -95
  525. package/dist/components/form-control-monetary2.js +0 -80
  526. package/dist/components/form-control-number-masked2.js +0 -79
  527. package/dist/components/form-control-number2.js +0 -68
  528. package/dist/components/form-control-select2.js +0 -64
  529. package/dist/components/form-control-text2.js +0 -68
  530. package/dist/components/generic-info-details2.js +0 -36
  531. package/dist/components/helpers.js +0 -24
  532. package/dist/components/justifi-bank-account-form.js +0 -95
  533. package/dist/components/justifi-business-details.js +0 -129
  534. package/dist/components/justifi-business-form-stepped.js +0 -227
  535. package/dist/components/justifi-business-form.js +0 -175
  536. package/dist/components/justifi-business-list.js +0 -192
  537. package/dist/components/justifi-card-form.js +0 -97
  538. package/dist/components/justifi-payment-balance-transactions.js +0 -122
  539. package/dist/components/justifi-payment-form.js +0 -168
  540. package/dist/components/justifi-payments-list.js +0 -149
  541. package/dist/components/justifi-payout-details.js +0 -95
  542. package/dist/components/justifi-payouts-list.js +0 -171
  543. package/dist/components/justifi-proceeds-list.js +0 -194
  544. package/dist/components/justifi-refund-form.js +0 -138
  545. package/dist/components/justifi-subaccount-details.js +0 -130
  546. package/dist/components/justifi-subaccounts-list.js +0 -137
  547. package/dist/components/legal-address-details2.js +0 -35
  548. package/dist/components/legal-address-form.js +0 -267
  549. package/dist/components/owner-details2.js +0 -38
  550. package/dist/components/pagination-menu2.js +0 -42
  551. package/dist/components/payment-method-selector.js +0 -43
  552. package/dist/components/representative-details2.js +0 -36
  553. package/dist/components/select-input2.js +0 -49
  554. package/dist/components/state-options.js +0 -244
  555. package/dist/components/subaccount-account-details2.js +0 -37
  556. package/dist/components/subaccount-bank-details.js +0 -38
  557. package/dist/components/subaccount-merchant-details2.js +0 -36
  558. package/dist/components/subaccount-owners-details2.js +0 -36
  559. package/dist/components/subaccount-representative-details2.js +0 -36
  560. package/dist/components/table.js +0 -89
  561. package/dist/components/text-input2.js +0 -47
  562. package/dist/components/utils.js +0 -27
  563. package/dist/esm/Payout-586f06a3.js +0 -179
  564. package/dist/esm/SubAccount-128190e9.js +0 -105
  565. package/dist/esm/business-form-schema-30a3eadd.js +0 -144
  566. package/dist/esm/config-ceb0f902.js +0 -13
  567. package/dist/esm/helpers-1d5ecdc8.js +0 -24
  568. package/dist/esm/state-options-ece00aa2.js +0 -244
  569. package/dist/esm/utils-d19c2778.js +0 -27
  570. package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +0 -23
  571. package/dist/types/components/billing-form/billing-form.stories.d.ts +0 -8
  572. package/dist/types/components/business-details/business-details.stories.d.ts +0 -7
  573. package/dist/types/components/business-form/business-form-stepped.stories.d.ts +0 -27
  574. package/dist/types/components/business-form/business-form.stories.d.ts +0 -27
  575. package/dist/types/components/card-form/card-form.stories.d.ts +0 -17
  576. package/dist/types/components/gross-payment-chart/gross-payment-chart.stories.d.ts +0 -7
  577. package/dist/types/components/payment-details/payment-details.stories.d.ts +0 -8
  578. package/dist/types/components/payment-form/payment-form.stories.d.ts +0 -8
  579. package/dist/types/components/payments-list/payments-list.stories.d.ts +0 -9
  580. package/dist/types/components/payout-details/payout-details.stories.d.ts +0 -8
  581. package/dist/types/components/payouts-list/payouts-list.stories.d.ts +0 -9
  582. package/dist/types/home/runner/work/web-component-library/web-component-library/stencil-library/.stencil/config.d.ts +0 -11
  583. package/dist/webcomponents/p-14f7229e.entry.js +0 -1
  584. package/dist/webcomponents/p-2c2cde2d.js +0 -1
  585. package/dist/webcomponents/p-3501b0e8.entry.js +0 -1
  586. package/dist/webcomponents/p-3fc95638.entry.js +0 -1
  587. package/dist/webcomponents/p-4214dbb8.entry.js +0 -1
  588. package/dist/webcomponents/p-46d5f717.entry.js +0 -1
  589. package/dist/webcomponents/p-4852ce94.entry.js +0 -1
  590. package/dist/webcomponents/p-4ec00b55.entry.js +0 -1
  591. package/dist/webcomponents/p-4fb653a8.entry.js +0 -1
  592. package/dist/webcomponents/p-586c8a4f.entry.js +0 -1
  593. package/dist/webcomponents/p-5e6726a8.entry.js +0 -1
  594. package/dist/webcomponents/p-7bda12a5.entry.js +0 -1
  595. package/dist/webcomponents/p-7d58db66.js +0 -1
  596. package/dist/webcomponents/p-8f37e3ee.js +0 -1
  597. package/dist/webcomponents/p-91757d9f.entry.js +0 -1
  598. package/dist/webcomponents/p-9e012e33.entry.js +0 -1
  599. package/dist/webcomponents/p-a1ef6b4c.entry.js +0 -1
  600. package/dist/webcomponents/p-af771964.entry.js +0 -1
  601. package/dist/webcomponents/p-b60a58f4.entry.js +0 -1
  602. package/dist/webcomponents/p-bb70152e.entry.js +0 -1
  603. package/dist/webcomponents/p-bc91044c.entry.js +0 -1
  604. package/dist/webcomponents/p-c29c587f.entry.js +0 -1
  605. package/dist/webcomponents/p-cbb60191.js +0 -2
  606. package/dist/webcomponents/p-d0e4eca5.entry.js +0 -1
  607. package/dist/webcomponents/p-d4b66d74.entry.js +0 -1
  608. package/dist/webcomponents/p-e7ef2455.entry.js +0 -1
  609. package/dist/webcomponents/p-f2f0aa6e.entry.js +0 -1
  610. package/dist/webcomponents/p-f4075186.entry.js +0 -1
  611. package/loader/index.es2017.js +0 -3
  612. /package/{loader → dist/loader}/package.json +0 -0
  613. /package/dist/{components → module}/additional-questions-details.js +0 -0
  614. /package/dist/{components → module}/form-control-datepart.js +0 -0
  615. /package/dist/{components → module}/form-control-monetary.js +0 -0
  616. /package/dist/{components → module}/form-control-number-masked.js +0 -0
  617. /package/dist/{components → module}/form-control-number.js +0 -0
  618. /package/dist/{components → module}/form-control-select.js +0 -0
  619. /package/dist/{components → module}/form-control-text.js +0 -0
  620. /package/dist/{components → module}/generic-info-details.js +0 -0
  621. /package/dist/{components → module}/index.d.ts +0 -0
  622. /package/dist/{components → module}/index.js +0 -0
  623. /package/dist/{components → module}/justifi-additional-questions.js +0 -0
  624. /package/dist/{components → module}/justifi-billing-form.js +0 -0
  625. /package/dist/{components → module}/justifi-business-address-form.js +0 -0
  626. /package/dist/{components → module}/justifi-business-generic-info.js +0 -0
  627. /package/dist/{components → module}/justifi-business-owners.js +0 -0
  628. /package/dist/{components → module}/justifi-business-representative.js +0 -0
  629. /package/dist/{components → module}/justifi-details.js +0 -0
  630. /package/dist/{components → module}/justifi-legal-address-form.js +0 -0
  631. /package/dist/{components → module}/justifi-payment-method-form.js +0 -0
  632. /package/dist/{components → module}/justifi-payment-method-selector.js +0 -0
  633. /package/dist/{components → module}/justifi-table.js +0 -0
  634. /package/dist/{components → module}/legal-address-details.js +0 -0
  635. /package/dist/{components → module}/owner-details.js +0 -0
  636. /package/dist/{components → module}/pagination-menu.js +0 -0
  637. /package/dist/{components → module}/representative-details.js +0 -0
  638. /package/dist/{components → module}/select-input.js +0 -0
  639. /package/dist/{components → module}/subaccount-account-details.js +0 -0
  640. /package/dist/{components → module}/subaccount-merchant-details.js +0 -0
  641. /package/dist/{components → module}/subaccount-owners-details.js +0 -0
  642. /package/dist/{components → module}/subaccount-representative-details.js +0 -0
  643. /package/dist/{components → module}/text-input.js +0 -0
  644. /package/dist/webcomponents/{p-0d5d02d7.js → p-56f6ce4c.js} +0 -0
  645. /package/dist/webcomponents/{p-e12ab547.js → p-71679a41.js} +0 -0
  646. /package/dist/webcomponents/{p-47bc59b5.js → p-8e2a88a8.js} +0 -0
  647. /package/dist/webcomponents/{p-d6b5793d.js → p-9a6e4749.js} +0 -0
  648. /package/dist/webcomponents/{p-526cb161.js → p-9b4b91ba.js} +0 -0
  649. /package/dist/webcomponents/{p-9b6dcac5.js → p-ae263544.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{r as t,h as i,H as e}from"./p-cbb60191.js";import{A as s}from"./p-b157f6ae.js";import"./p-0d5d02d7.js";import"./p-e12ab547.js";import{a as n,b as r}from"./p-d6b5793d.js";import{E as o}from"./p-86c23e1e.js";import{c as a}from"./p-9b6dcac5.js";
1
+ import{r as t,h as i,H as e}from"./p-4f14df36.js";import{A as s}from"./p-04c7f8f8.js";import"./p-56f6ce4c.js";import"./p-71679a41.js";import{a as n,b as r}from"./p-9a6e4749.js";import{E as o}from"./p-0f3e9483.js";import{c as a}from"./p-ae263544.js";
2
2
  /*!
3
3
  * @kurkle/color v0.3.2
4
4
  * https://github.com/kurkle/color#readme
@@ -16,4 +16,4 @@ import{r as t,h as i,H as e}from"./p-cbb60191.js";import{A as s}from"./p-b157f6a
16
16
  * https://www.chartjs.org
17
17
  * (c) 2023 Chart.js Contributors
18
18
  * Released under the MIT License
19
- */class qi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,e,s){const n=i.duration;i.listeners[s].forEach((s=>s({chart:t,initial:i.initial,numSteps:n,currentStep:Math.min(e-i.start,n)})))}_refresh(){this._request||(this._running=!0,this._request=Bt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let i=0;this._charts.forEach(((e,s)=>{if(!e.running||!e.items.length)return;const n=e.items;let r,o=n.length-1,a=!1;for(;o>=0;--o)r=n[o],r._active?(r._total>e.duration&&(e.duration=r._total),r.tick(t),a=!0):(n[o]=n[n.length-1],n.pop());a&&(s.draw(),this._notify(s,e,t,"progress")),n.length||(e.running=!1,this._notify(s,e,t,"complete"),e.initial=!1),i+=n.length})),this._lastDate=t,0===i&&(this._running=!1)}_getAnims(t){const i=this._charts;let e=i.get(t);return e||(e={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,e)),e}listen(t,i,e){this._getAnims(t).listeners[i].push(e)}add(t,i){i&&i.length&&this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce(((t,i)=>Math.max(t,i._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!!(i&&i.running&&i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const e=i.items;let s=e.length-1;for(;s>=0;--s)e[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ji=new qi;const te="transparent",ie={boolean:(t,i,e)=>e>.5?i:t,color(t,i,e){const s=Nt(t||te),n=s.valid&&Nt(i||te);return n&&n.valid?n.mix(s,e).hexString():i},number:(t,i,e)=>t+(i-t)*e};class ee{constructor(t,i,e,s){const n=i[e];s=Mi([t.to,s,n,t.from]);const r=Mi([t.from,n,s]);this._active=!0,this._fn=t.fn||ie[t.type||typeof r],this._easing=Ft[t.easing]||Ft.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=e,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,e){if(this._active){this._notify(!1);const s=this._target[this._prop],n=e-this._start,r=this._duration-n;this._start=e,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Mi([t.to,i,s,t.from]),this._from=Mi([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,e=this._duration,s=this._prop,n=this._from,r=this._loop,o=this._to;let a;if(this._active=n!==o&&(r||i<e),!this._active)return this._target[s]=o,void this._notify(!0);i<0?this._target[s]=n:(a=i/e%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(n,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((i,e)=>{t.push({res:i,rej:e})}))}_notify(t){const i=t?"res":"rej",e=this._promises||[];for(let t=0;t<e.length;t++)e[t][i]()}}class se{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!$(t))return;const i=Object.keys(Jt.animation),e=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const n=t[s];if(!$(n))return;const r={};for(const t of i)r[t]=n[t];(W(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,i){const e=i.options,s=function(t,i){if(!i)return;let e=t.options;if(e)return e.$shared&&(t.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e;t.options=i}(t,e);if(!s)return[];const n=this._createAnimations(s,e);return e.$shared&&function(t,i){const e=[],s=Object.keys(i);for(let i=0;i<s.length;i++){const n=t[s[i]];n&&n.active()&&e.push(n.wait())}return Promise.all(e)}(t.options.$animations,e).then((()=>{t.options=e}),(()=>{})),n}_createAnimations(t,i){const e=this._properties,s=[],n=t.$animations||(t.$animations={}),r=Object.keys(i),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const h=r[a];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,i));continue}const c=i[h];let l=n[h];const u=e.get(h);if(l){if(u&&l.active()){l.update(u,c,o);continue}l.cancel()}u&&u.duration?(n[h]=l=new ee(u,t,h,c),s.push(l)):t[h]=c}return s}update(t,i){if(0===this._properties.size)return void Object.assign(t,i);const e=this._createAnimations(t,i);return e.length?(Ji.add(this._chart,e),!0):void 0}}function ne(t,i){const e=t&&t.options||{},s=e.reverse,n=void 0===e.min?i:0,r=void 0===e.max?i:0;return{start:s?r:n,end:s?n:r}}function re(t,i){const e=[],s=t._getSortedDatasetMetas(i);let n,r;for(n=0,r=s.length;n<r;++n)e.push(s[n].index);return e}function oe(t,i,e,s={}){const n=t.keys,r="single"===s.mode;let o,a,h,c;if(null!==i){for(o=0,a=n.length;o<a;++o){if(h=+n[o],h===e){if(s.all)continue;break}c=t.values[h],H(c)&&(r||0===i||gt(i)===gt(c))&&(i+=c)}return i}}function ae(t,i){const e=t&&t.options.stacked;return e||void 0===e&&void 0!==i.stack}function he(t,i,e){const s=t[i]||(t[i]={});return s[e]||(s[e]={})}function ce(t,i,e,s){for(const n of i.getMatchingVisibleMetas(s).reverse()){const i=t[n.index];if(e&&i>0||!e&&i<0)return n.index}return null}function le(t,i){const{chart:e,_cachedMeta:s}=t,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=s,h=r.axis,c=o.axis,l=function(t,i,e){return`${t.id}.${i.id}.${e.stack||e.type}`}(r,o,s),u=i.length;let d;for(let t=0;t<u;++t){const e=i[t],{[h]:r,[c]:u}=e;d=(e._stacks||(e._stacks={}))[c]=he(n,l,r),d[a]=u,d._top=ce(d,o,!0,s.type),d._bottom=ce(d,o,!1,s.type),(d._visualValues||(d._visualValues={}))[a]=u}}function ue(t,i){const e=t.scales;return Object.keys(e).filter((t=>e[t].axis===i)).shift()}function de(t,i){const e=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){i=i||t._parsed;for(const t of i){const i=t._stacks;if(!i||void 0===i[s]||void 0===i[s][e])return;delete i[s][e],void 0!==i[s]._visualValues&&void 0!==i[s]._visualValues[e]&&delete i[s]._visualValues[e]}}}const fe=t=>"reset"===t||"none"===t,be=(t,i)=>i?t:Object.assign({},t);class pe{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ae(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&de(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,e=this.getDataset(),s=(t,i,e,s)=>"x"===t?i:"r"===t?s:e,n=i.xAxisID=Y(e.xAxisID,ue(t,"x")),r=i.yAxisID=Y(e.yAxisID,ue(t,"y")),o=i.rAxisID=Y(e.rAxisID,ue(t,"r")),a=i.indexAxis,h=i.iAxisID=s(a,n,r,o),c=i.vAxisID=s(a,r,n,o);i.xScale=this.getScaleForId(n),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(o),i.iScale=this.getScaleForId(h),i.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&jt(this._data,this),t._stacked&&de(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),e=this._data;if($(i))this._data=function(t){const i=Object.keys(t),e=new Array(i.length);let s,n,r;for(s=0,n=i.length;s<n;++s)r=i[s],e[s]={x:r,y:t[r]};return e}(i);else if(e!==i){if(e){jt(e,this);const t=this._cachedMeta;de(t),t._parsed=[]}i&&Object.isExtensible(i)&&(this,(s=i)._chartjs?s._chartjs.listeners.push(this):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Dt.forEach((t=>{const i="_onData"+nt(t),e=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=e.apply(this,t);return s._chartjs.listeners.forEach((e=>{"function"==typeof e[i]&&e[i](...t)})),n}})})))),this._syncList=[],this._data=i}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,e=this.getDataset();let s=!1;this._dataCheck();const n=i._stacked;i._stacked=ae(i.vScale,i),i.stack!==e.stack&&(s=!0,de(i),i.stack=e.stack),this._resyncElements(t),(s||n!==i._stacked)&&le(this,i._parsed)}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:e,_data:s}=this,{iScale:n,_stacked:r}=e,o=n.axis;let a,h,c,l=0===t&&i===s.length||e._sorted,u=t>0&&e._parsed[t-1];if(!1===this._parsing)e._parsed=s,e._sorted=!0,c=s;else{c=W(s[t])?this.parseArrayData(e,s,t,i):$(s[t])?this.parseObjectData(e,s,t,i):this.parsePrimitiveData(e,s,t,i);const n=()=>null===h[o]||u&&h[o]<u[o];for(a=0;a<i;++a)e._parsed[a+t]=h=c[a],l&&(n()&&(l=!1),u=h);e._sorted=l}r&&le(this,c)}parsePrimitiveData(t,i,e,s){const{iScale:n,vScale:r}=t,o=n.axis,a=r.axis,h=n.getLabels(),c=n===r,l=new Array(s);let u,d,f;for(u=0,d=s;u<d;++u)f=u+e,l[u]={[o]:c||n.parse(h[f],f),[a]:r.parse(i[f],f)};return l}parseArrayData(t,i,e,s){const{xScale:n,yScale:r}=t,o=new Array(s);let a,h,c,l;for(a=0,h=s;a<h;++a)c=a+e,l=i[c],o[a]={x:n.parse(l[0],c),y:r.parse(l[1],c)};return o}parseObjectData(t,i,e,s){const{xScale:n,yScale:r}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,h=new Array(s);let c,l,u,d;for(c=0,l=s;c<l;++c)u=c+e,d=i[u],h[c]={x:n.parse(st(d,o),u),y:r.parse(st(d,a),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,e){const s=this._cachedMeta,n=i[t.axis];return oe({keys:re(this.chart,!0),values:i._stacks[t.axis]._visualValues},n,s.index,{mode:e})}updateRangeFromParsed(t,i,e,s){const n=e[i.axis];let r=null===n?NaN:n;const o=s&&e._stacks[i.axis];s&&o&&(s.values=o,r=oe(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){const e=this._cachedMeta,s=e._parsed,n=e._sorted&&t===e.iScale,r=s.length,o=this._getOtherScale(t),a=((t,i)=>t&&!i.hidden&&i._stacked&&{keys:re(this.chart,!0),values:null})(i,e),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:l}=function(t){const{min:i,max:e,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?i:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}(o);let u,d;function f(){d=s[u];const i=d[o.axis];return!H(d[t.axis])||c>i||l<i}for(u=0;u<r&&(f()||(this.updateRangeFromParsed(h,t,d,a),!n));++u);if(n)for(u=r-1;u>=0;--u)if(!f()){this.updateRangeFromParsed(h,t,d,a);break}return h}getAllParsedValues(t){const i=this._cachedMeta._parsed,e=[];let s,n,r;for(s=0,n=i.length;s<n;++s)r=i[s][t.axis],H(r)&&e.push(r);return e}getMaxOverflow(){return!1}getLabelAndValue(t){const i=this._cachedMeta,e=i.iScale,s=i.vScale,n=this.getParsed(t);return{label:e?""+e.getLabelForValue(n[e.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const i=this._cachedMeta;this.update(t||"default"),i._clip=function(t){let i,e,s,n;return $(t)?(i=t.top,e=t.right,s=t.bottom,n=t.left):i=e=s=n=t,{top:i,right:e,bottom:s,left:n,disabled:!1===t}}(Y(this.options.clip,function(t,i,e){if(!1===e)return!1;const s=ne(t,e),n=ne(i,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this._cachedMeta,e=i.data||[],s=this.chart.chartArea,n=[],r=this._drawStart||0,o=this._drawCount||e.length-r,a=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,r,o),h=r;h<r+o;++h){const i=e[h];i.hidden||(i.active&&a?n.push(i):i.draw(t,s))}for(h=0;h<n.length;++h)n[h].draw(t,s)}getStyle(t,i){const e=i?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,i,e){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];n=i.$context||(i.$context=function(t,i,e){return ki(t,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:e,index:i,mode:"default",type:"data"})}(this.getContext(),t,i)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,i){return ki(t,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!i,n.mode=e,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",e){const s="active"===i,n=this._cachedDataOpts,r=t+"-"+i,o=n[r],a=this.enableOptionSharing&&rt(e);if(o)return be(o,a);const h=this.chart.config,c=h.datasetElementScopeKeys(this._type,t),l=s?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),c),d=Object.keys(Jt.elements[t]),f=h.resolveNamedOptions(u,d,(()=>this.getContext(e,s,i)),l);return f.$shared&&(f.$shared=a,n[r]=Object.freeze(be(f,a))),f}_resolveAnimations(t,i,e){const s=this.chart,n=this._cachedDataOpts,r=`animation-${i}`,o=n[r];if(o)return o;let a;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,i),r=s.getOptionScopes(this.getDataset(),n);a=s.createResolver(r,this.getContext(t,e,i))}const h=new se(s,a&&a.animations);return a&&a._cacheable&&(n[r]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||fe(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const e=this.resolveDataElementOptions(t,i),s=this._sharedOptions,n=this.getSharedOptions(e),r=this.includeOptions(i,n)||n!==s;return this.updateSharedOptions(n,i,e),{sharedOptions:n,includeOptions:r}}updateElement(t,i,e,s){fe(s)?Object.assign(t,e):this._resolveAnimations(i,s).update(t,e)}updateSharedOptions(t,i,e){t&&!fe(i)&&this._resolveAnimations(void 0,i).update(t,e)}_setStyle(t,i,e,s){t.active=s;const n=this.getStyle(i,s);this._resolveAnimations(i,e,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,i,e){this._setStyle(t,e,"active",!1)}setHoverStyle(t,i,e){this._setStyle(t,e,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,e=this._cachedMeta.data;for(const[t,i,e]of this._syncList)this[t](i,e);this._syncList=[];const s=e.length,n=i.length,r=Math.min(n,s);r&&this.parse(0,r),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,i,e=!0){const s=this._cachedMeta,n=s.data,r=t+i;let o;const a=t=>{for(t.length+=i,o=t.length-1;o>=r;o--)t[o]=t[o-i]};for(a(n),o=t;o<r;++o)n[o]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(t,i),e&&this.updateElements(n,t,i,"reset")}updateElements(t,i,e,s){}_removeElements(t,i){const e=this._cachedMeta;if(this._parsing){const s=e._parsed.splice(t,i);e._stacked&&de(e,s)}e.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[i,e,s]=t;this[i](e,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);const e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ge(t,i,e,s){return W(t)?function(t,i,e,s){const n=e.parse(t[0],s),r=e.parse(t[1],s),o=Math.min(n,r),a=Math.max(n,r);let h=o,c=a;Math.abs(o)>Math.abs(a)&&(h=a,c=o),i[e.axis]=c,i._custom={barStart:h,barEnd:c,start:n,end:r,min:o,max:a}}(t,i,e,s):i[e.axis]=e.parse(t,s),i}function me(t,i,e,s){const n=t.iScale,r=t.vScale,o=n.getLabels(),a=n===r,h=[];let c,l,u,d;for(c=e,l=e+s;c<l;++c)d=i[c],u={},u[n.axis]=a||n.parse(o[c],c),h.push(ge(d,u,r,c));return h}function ve(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function ye(t,i,e,s){let n=i.borderSkipped;const r={};if(!n)return void(t.borderSkipped=r);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:h,top:c,bottom:l}=function(t){let i,e,s,n,r;return t.horizontal?(i=t.base>t.x,e="left",s="right"):(i=t.base<t.y,e="bottom",s="top"),i?(n="end",r="start"):(n="start",r="end"),{start:e,end:s,reverse:i,top:n,bottom:r}}(t);"middle"===n&&e&&(t.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=l:(r[xe(l,o,a,h)]=!0,n=c)),r[xe(n,o,a,h)]=!0,t.borderSkipped=r}function xe(t,i,e,s){var n,r,o;return s?(o=e,t=Me(t=(n=t)===(r=i)?o:n===o?r:n,e,i)):t=Me(t,i,e),t}function Me(t,i,e){return"start"===t?i:"end"===t?e:t}function ke(t,{inflateAmount:i},e){t.inflateAmount="auto"===i?1===e?.33:0:i}class we extends pe{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,i,e,s){return me(t,i,e,s)}parseArrayData(t,i,e,s){return me(t,i,e,s)}parseObjectData(t,i,e,s){const{iScale:n,vScale:r}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,h="x"===n.axis?o:a,c="x"===r.axis?o:a,l=[];let u,d,f,b;for(u=e,d=e+s;u<d;++u)b=i[u],f={},f[n.axis]=n.parse(st(b,h),u),l.push(ge(st(b,c),f,r,u));return l}updateRangeFromParsed(t,i,e,s){super.updateRangeFromParsed(t,i,e,s);const n=e._custom;n&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const i=this._cachedMeta,{iScale:e,vScale:s}=i,n=this.getParsed(t),r=n._custom,o=ve(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+e.getLabelForValue(n[e.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,e,s){const n="reset"===s,{index:r,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),h=o.isHorizontal(),c=this._getRuler(),{sharedOptions:l,includeOptions:u}=this._getSharedOptions(i,s);for(let d=i;d<i+e;d++){const i=this.getParsed(d),e=n||N(i[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(d),f=this._calculateBarIndexPixels(d,c),b=(i._stacks||{})[o.axis],p={horizontal:h,base:e.base,enableBorderRadius:!b||ve(i._custom)||r===b._top||r===b._bottom,x:h?e.head:f.center,y:h?f.center:e.head,height:h?f.size:Math.abs(e.size),width:h?Math.abs(e.size):f.size};u&&(p.options=l||this.resolveDataElementOptions(d,t[d].active?"active":s));const g=p.options||t[d].options;ye(p,g,b,r),ke(p,g,c.ratio),this.updateElement(t[d],d,p,s)}}_getStacks(t,i){const{iScale:e}=this._cachedMeta,s=e.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),n=e.options.stacked,r=[],o=t=>{const e=t.controller.getParsed(i),s=e&&e[t.vScale.axis];if(N(s)||isNaN(s))return!0};for(const e of s)if((void 0===i||!o(e))&&((!1===n||-1===r.indexOf(e.stack)||void 0===n&&void 0===e.stack)&&r.push(e.stack),e.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,i,e){const s=this._getStacks(t,e),n=void 0!==i?s.indexOf(i):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,i=this._cachedMeta,e=i.iScale,s=[];let n,r;for(n=0,r=i.data.length;n<r;++n)s.push(e.getPixelForValue(this.getParsed(n)[e.axis],n));const o=t.barThickness,a=o||function(t){const i=t.iScale,e=function(t,i){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas(i);let s=[];for(let i=0,n=e.length;i<n;i++)s=s.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=function(t){const i=new Set(t);return i.size===t.length?t:Array.from(i)}(s.sort(((t,i)=>t-i)))}return t._cache.$bar}(i,t.type);let s,n,r,o,a=i._length;const h=()=>{32767!==r&&-32768!==r&&(rt(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(s=0,n=e.length;s<n;++s)r=i.getPixelForValue(e[s]),h();for(o=void 0,s=0,n=i.ticks.length;s<n;++s)r=i.getPixelForTick(s),h();return a}(i);return{min:a,pixels:s,start:e._startPixel,end:e._endPixel,stackCount:this._getStackCount(),scale:e,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:i,_stacked:e,index:s},options:{base:n,minBarLength:r}}=this,o=n||0,a=this.getParsed(t),h=a._custom,c=ve(h);let l,u,d=a[i.axis],f=0,b=e?this.applyStack(i,a,e):d;b!==d&&(f=b-d,b=d),c&&(d=h.barStart,b=h.barEnd-h.barStart,0!==d&&gt(d)!==gt(h.barEnd)&&(f=0),f+=d);const p=N(n)||c?f:n;let g=i.getPixelForValue(p);if(l=this.chart.getDataVisibility(t)?i.getPixelForValue(f+b):g,u=l-g,Math.abs(u)<r){u=function(t,i,e){return 0!==t?gt(t):(i.isHorizontal()?1:-1)*(i.min>=e?1:-1)}(u,i,o)*r,d===o&&(g-=u/2);const t=i.getPixelForDecimal(0),n=i.getPixelForDecimal(1),h=Math.min(t,n),f=Math.max(t,n);g=Math.max(Math.min(g,f),h),l=g+u,e&&!c&&(a._stacks[i.axis]._visualValues[s]=i.getValueForPixel(l)-i.getValueForPixel(g))}if(g===i.getPixelForValue(o)){const t=gt(u)*i.getLineWidthForValue(o)/2;g+=t,u-=t}return{size:u,base:g,head:l,center:l+u/2}}_calculateBarIndexPixels(t,i){const e=i.scale,s=this.options,n=s.skipNull,r=Y(s.maxBarThickness,1/0);let o,a;if(i.grouped){const e=n?this._getStackCount(t):i.stackCount,h="flex"===s.barThickness?function(t,i,e,s){const n=i.pixels,r=n[t];let o=t>0?n[t-1]:null,a=t<n.length-1?n[t+1]:null;const h=e.categoryPercentage;null===o&&(o=r-(null===a?i.end-i.start:a-r)),null===a&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*h;return{chunk:Math.abs(a-o)/2*h/s,ratio:e.barPercentage,start:c}}(t,i,s,e):function(t,i,e,s){const n=e.barThickness;let r,o;return N(n)?(r=i.min*e.categoryPercentage,o=e.barPercentage):(r=n*s,o=1),{chunk:r/s,ratio:o,start:i.pixels[t]-r/2}}(t,i,s,e),c=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0);o=h.start+h.chunk*c+h.chunk/2,a=Math.min(r,h.chunk*h.ratio)}else o=e.getPixelForValue(this.getParsed(t)[e.axis],t),a=Math.min(r,i.min*i.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const t=this._cachedMeta,i=t.vScale,e=t.data,s=e.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[i.axis]&&e[n].draw(this._ctx)}}class _e extends pe{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:e,color:s}}=t.legend.options;return i.labels.map(((i,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:e,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}}};constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){const e=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=e;else{let n,r,o=t=>+e[t];if($(e[t])){const{key:t="value"}=this._parsing;o=i=>+st(e[i],t)}for(n=t,r=t+i;n<r;++n)s._parsed[n]=o(n)}}_getRotation(){return xt(this.options.rotation-90)}_getCircumference(){return xt(this.options.circumference)}_getRotationExtents(){let t=ct,i=-ct;for(let e=0;e<this.chart.data.datasets.length;++e)if(this.chart.isDatasetVisible(e)&&this.chart.getDatasetMeta(e).type===this._type){const s=this.chart.getDatasetMeta(e).controller,n=s._getRotation(),r=s._getCircumference();t=Math.min(t,n),i=Math.max(i,n+r)}return{rotation:t,circumference:i-t}}update(t){const i=this.chart,{chartArea:e}=i,s=this._cachedMeta,n=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(e.width,e.height)-r)/2,0),a=Math.min((c=o,"string"==typeof(h=this.options.cutout)&&h.endsWith("%")?parseFloat(h)/100:+h/c),1);var h,c;const l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:b,offsetX:p,offsetY:g}=function(t,i,e){let s=1,n=1,r=0,o=0;if(i<ct){const a=t,h=a+i,c=Math.cos(a),l=Math.sin(a),u=Math.cos(h),d=Math.sin(h),f=(t,i,s)=>wt(t,a,h,!0)?1:Math.max(i,i*e,s,s*e),b=(t,i,s)=>wt(t,a,h,!0)?-1:Math.min(i,i*e,s,s*e),p=f(0,c,u),g=f(dt,l,d),m=b(ht,c,u),v=b(ht+dt,l,d);s=(p-m)/2,n=(g-v)/2,r=-(p+m)/2,o=-(g+v)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}(d,u,a),m=Math.max(Math.min((e.width-r)/f,(e.height-r)/b)/2,0),v=V(this.options.radius,m),y=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=g*v,s.total=this.calculateTotal(),this.outerRadius=v-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,i){const e=this.options,s=this._cachedMeta,n=this._getCircumference();return i&&e.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/ct)}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.chartArea,a=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=n&&r.options.animation.animateScale,l=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(i,s);let b,p=this._getRotation();for(b=0;b<i;++b)p+=this._circumference(b,n);for(b=i;b<i+e;++b){const i=this._circumference(b,n),e=t[b],r={x:a+this.offsetX,y:h+this.offsetY,startAngle:p,endAngle:p+i,circumference:i,outerRadius:u,innerRadius:l};f&&(r.options=d||this.resolveDataElementOptions(b,e.active?"active":s)),p+=i,this.updateElement(e,b,r,s)}}calculateTotal(){const t=this._cachedMeta,i=t.data;let e,s=0;for(e=0;e<i.length;e++){const n=t._parsed[e];null===n||isNaN(n)||!this.chart.getDataVisibility(e)||i[e].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const i=this._cachedMeta.total;return i>0&&!isNaN(t)?ct*(Math.abs(t)/i):0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Yt(this._cachedMeta._parsed[t],i.options.locale);return{label:e[t]||"",value:s}}getMaxBorderWidth(t){let i=0;const e=this.chart;let s,n,r,o,a;if(!t)for(s=0,n=e.data.datasets.length;s<n;++s)if(e.isDatasetVisible(s)){r=e.getDatasetMeta(s),t=r.data,o=r.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)a=o.resolveDataElementOptions(s),"inner"!==a.borderAlign&&(i=Math.max(i,a.borderWidth||0,a.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let e=0,s=t.length;e<s;++e){const t=this.resolveDataElementOptions(e);i=Math.max(i,t.offset||0,t.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let e=0;e<t;++e)this.chart.isDatasetVisible(e)&&(i+=this._getRingWeight(e));return i}_getRingWeight(t){return Math.max(Y(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Ae extends pe{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:e,color:s}}=t.legend.options;return i.labels.map(((i,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:e,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Yt(this._cachedMeta._parsed[t].r,i.options.locale);return{label:e[t]||"",value:s}}parseObjectData(t,i,e,s){return Ii.bind(this)(t,i,e,s)}update(t){const i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){const t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return this._cachedMeta.data.forEach(((i,e)=>{const s=this.getParsed(e).r;!isNaN(s)&&this.chart.getDataVisibility(e)&&(s<t.min&&(t.min=s),s>t.max&&(t.max=s))})),t}_updateRadius(){const t=this.chart,i=t.chartArea,e=t.options,s=Math.min(i.right-i.left,i.bottom-i.top),n=Math.max(s/2,0),r=(n-Math.max(e.cutoutPercentage?n/100*e.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.options.animation,a=this._cachedMeta.rScale,h=a.xCenter,c=a.yCenter,l=a.getIndexAngle(0)-.5*ht;let u,d=l;const f=360/this.countVisibleElements();for(u=0;u<i;++u)d+=this._computeAngle(u,s,f);for(u=i;u<i+e;u++){const i=t[u];let e=d,b=d+this._computeAngle(u,s,f),p=r.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;d=b,n&&(o.animateScale&&(p=0),o.animateRotate&&(e=b=l));const g={x:h,y:c,innerRadius:0,outerRadius:p,startAngle:e,endAngle:b,options:this.resolveDataElementOptions(u,i.active?"active":s)};this.updateElement(i,u,g,s)}}countVisibleElements(){let t=0;return this._cachedMeta.data.forEach(((i,e)=>{!isNaN(this.getParsed(e).r)&&this.chart.getDataVisibility(e)&&t++})),t}_computeAngle(t,i,e){return this.chart.getDataVisibility(t)?xt(this.resolveDataElementOptions(t,i).angle||e):0}}function Oe(t,i,e,s){const{controller:n,data:r,_sorted:o}=t,a=n._cachedMeta.iScale;if(a&&i===a.axis&&"r"!==i&&o&&r.length){const t=a._reversePixels?Rt:St;if(!s)return t(r,i,e);if(n._sharedOptions){const s=r[0],n="function"==typeof s.getRange&&s.getRange(i);if(n){const s=t(r,i,e-n),o=t(r,i,e+n);return{lo:s.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Se(t,i,e,s,n){const r=t.getSortedVisibleDatasetMetas(),o=e[i];for(let t=0,e=r.length;t<e;++t){const{index:e,data:a}=r[t],{lo:h,hi:c}=Oe(r[t],i,o,n);for(let t=h;t<=c;++t){const i=a[t];i.skip||s(i,e,t)}}}function Re(t,i,e,s,n){const r=[];return n||t.isPointInArea(i)?(Se(t,e,i,(function(e,o,a){(n||ri(e,t.chartArea,0))&&e.inRange(i.x,i.y,s)&&r.push({element:e,datasetIndex:o,index:a})}),!0),r):r}function De(t,i,e,s,n,r){return r||t.isPointInArea(i)?"r"!==e||s?function(t,i,e,s,n,r){let o=[];const a=function(t){const i=-1!==t.indexOf("x"),e=-1!==t.indexOf("y");return function(t,s){const n=i?Math.abs(t.x-s.x):0,r=e?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}}(e);let h=Number.POSITIVE_INFINITY;return Se(t,e,i,(function(e,c,l){const u=e.inRange(i.x,i.y,n);if(s&&!u)return;const d=e.getCenterPoint(n);if(!r&&!t.isPointInArea(d)&&!u)return;const f=a(i,d);f<h?(o=[{element:e,datasetIndex:c,index:l}],h=f):f===h&&o.push({element:e,datasetIndex:c,index:l})})),o}(t,i,e,s,n,r):function(t,i,e,s){let n=[];return Se(t,e,i,(function(t,e,r){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],s),{angle:h}=function(t,i){const e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s);let r=Math.atan2(s,e);return r<-.5*ht&&(r+=ct),{angle:r,distance:n}}(t,{x:i.x,y:i.y});wt(h,o,a)&&n.push({element:t,datasetIndex:e,index:r})})),n}(t,i,e,n):[]}function je(t,i,e,s,n){const r=[],o="x"===e?"inXRange":"inYRange";let a=!1;return Se(t,e,i,((t,s,h)=>{t[o](i[e],n)&&(r.push({element:t,datasetIndex:s,index:h}),a=a||t.inRange(i.x,i.y,n))})),s&&!a?[]:r}var Be={evaluateInteractionItems:Se,modes:{index(t,i,e,s){const n=Gi(i,t),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Re(t,n,r,s,o):De(t,n,r,!1,s,o),h=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const i=a[0].index,e=t.data[i];e&&!e.skip&&h.push({element:e,datasetIndex:t.index,index:i})})),h):[]},dataset(t,i,e,s){const n=Gi(i,t),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Re(t,n,r,s,o):De(t,n,r,!1,s,o);if(a.length>0){const i=a[0].datasetIndex,e=t.getDatasetMeta(i).data;a=[];for(let t=0;t<e.length;++t)a.push({element:e[t],datasetIndex:i,index:t})}return a},point:(t,i,e,s)=>Re(t,Gi(i,t),e.axis||"xy",s,e.includeInvisible||!1),nearest:(t,i,e,s)=>De(t,Gi(i,t),e.axis||"xy",e.intersect,s,e.includeInvisible||!1),x:(t,i,e,s)=>je(t,Gi(i,t),"x",e.intersect,s),y:(t,i,e,s)=>je(t,Gi(i,t),"y",e.intersect,s)}};const Ce=["left","top","right","bottom"];function Ee(t,i){return t.filter((t=>t.pos===i))}function Le(t,i){return t.filter((t=>-1===Ce.indexOf(t.pos)&&t.box.axis===i))}function Pe(t,i){return t.sort(((t,e)=>{const s=i?e:t,n=i?t:e;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Ie(t,i,e,s){return Math.max(t[e],i[e])+Math.max(t[s],i[s])}function Te(t,i){t.top=Math.max(t.top,i.top),t.left=Math.max(t.left,i.left),t.bottom=Math.max(t.bottom,i.bottom),t.right=Math.max(t.right,i.right)}function Fe(t,i,e,s){const{pos:n,box:r}=e,o=t.maxPadding;if(!$(n)){e.size&&(t[n]-=e.size);const i=s[e.stack]||{size:0,count:1};i.size=Math.max(i.size,e.horizontal?r.height:r.width),e.size=i.size/i.count,t[n]+=e.size}r.getPadding&&Te(o,r.getPadding());const a=Math.max(0,i.outerWidth-Ie(o,t,"left","right")),h=Math.max(0,i.outerHeight-Ie(o,t,"top","bottom")),c=a!==t.w,l=h!==t.h;return t.w=a,t.h=h,e.horizontal?{same:c,other:l}:{same:l,other:c}}function ze(t,i){const e=i.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(i[t],e[t])})),s}(t?["left","right"]:["top","bottom"])}function Ne(t,i,e,s){const n=[];let r,o,a,h,c,l;for(r=0,o=t.length,c=0;r<o;++r){a=t[r],h=a.box,h.update(a.width||i.w,a.height||i.h,ze(a.horizontal,i));const{same:o,other:u}=Fe(i,e,a,s);c|=o&&n.length,l=l||u,h.fullSize||n.push(a)}return c&&Ne(n,i,e,s)||l}function We(t,i,e,s,n){t.top=e,t.left=i,t.right=i+s,t.bottom=e+n,t.width=s,t.height=n}function $e(t,i,e,s){const n=e.padding;let{x:r,y:o}=i;for(const a of t){const t=a.box,h=s[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/h.weight||1;if(a.horizontal){const s=i.w*c,r=h.size||t.height;rt(h.start)&&(o=h.start),t.fullSize?We(t,n.left,o,e.outerWidth-n.right-n.left,r):We(t,i.left+h.placed,o,s,r),h.start=o,h.placed+=s,o=t.bottom}else{const s=i.h*c,o=h.size||t.width;rt(h.start)&&(r=h.start),t.fullSize?We(t,r,n.top,o,e.outerHeight-n.bottom-n.top):We(t,r,i.top+h.placed,o,s),h.start=r,h.placed+=s,r=t.right}}i.x=r,i.y=o}var He={addBox(t,i){t.boxes||(t.boxes=[]),i.fullSize=i.fullSize||!1,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t)}}]},t.boxes.push(i)},removeBox(t,i){const e=t.boxes?t.boxes.indexOf(i):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,i,e){i.fullSize=e.fullSize,i.position=e.position,i.weight=e.weight},update(t,i,e,s){if(!t)return;const n=yi(t.options.layout.padding),r=Math.max(i-n.width,0),o=Math.max(e-n.height,0),a=function(t){const i=function(t){const i=[];let e,s,n,r,o,a;for(e=0,s=(t||[]).length;e<s;++e)n=t[e],({position:r,options:{stack:o,stackWeight:a=1}}=n),i.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:a});return i}(t),e=Pe(i.filter((t=>t.box.fullSize)),!0),s=Pe(Ee(i,"left"),!0),n=Pe(Ee(i,"right")),r=Pe(Ee(i,"top"),!0),o=Pe(Ee(i,"bottom")),a=Le(i,"x"),h=Le(i,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(h).concat(o).concat(a),chartArea:Ee(i,"chartArea"),vertical:s.concat(n).concat(h),horizontal:r.concat(o).concat(a)}}(t.boxes),h=a.vertical,c=a.horizontal;U(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const l=h.reduce(((t,i)=>i.box.options&&!1===i.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:i,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/l,hBoxMaxHeight:o/2}),d=Object.assign({},n);Te(d,yi(s));const f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),b=function(t,i){const e=function(t){const i={};for(const e of t){const{stack:t,pos:s,stackWeight:n}=e;if(!t||!Ce.includes(s))continue;const r=i[t]||(i[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=n}return i}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=i;let r,o,a;for(r=0,o=t.length;r<o;++r){a=t[r];const{fullSize:o}=a.box,h=e[a.stack],c=h&&a.stackWeight/h.weight;a.horizontal?(a.width=c?c*s:o&&i.availableWidth,a.height=n):(a.width=s,a.height=c?c*n:o&&i.availableHeight)}return e}(h.concat(c),u);Ne(a.fullSize,f,u,b),Ne(h,f,u,b),Ne(c,f,u,b)&&Ne(h,f,u,b),function(t){const i=t.maxPadding;function e(e){const s=Math.max(i[e]-t[e],0);return t[e]+=s,s}t.y+=e("top"),t.x+=e("left"),e("right"),e("bottom")}(f),$e(a.leftAndTop,f,u,b),f.x+=f.w,f.y+=f.h,$e(a.rightAndBottom,f,u,b),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},U(a.chartArea,(i=>{const e=i.box;Object.assign(e,t.chartArea),e.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Ge{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,e){}removeEventListener(t,i,e){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,e,s){return i=Math.max(0,i||t.width),e=e||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):e)}}isAttached(t){return!0}updateConfig(t){}}class Ye extends Ge{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ve="$chartjs",Xe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ue=t=>null===t||""===t,Ze=!!Xi&&{passive:!0};function Ke(t,i,e){t.canvas.removeEventListener(i,e,Ze)}function Qe(t,i){for(const e of t)if(e===i||e.contains(i))return!0}function qe(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Qe(e.addedNodes,s),i=i&&!Qe(e.removedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Je(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Qe(e.removedNodes,s),i=i&&!Qe(e.addedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}const ts=new Map;let is=0;function es(){const t=window.devicePixelRatio;t!==is&&(is=t,ts.forEach(((i,e)=>{e.currentDevicePixelRatio!==t&&i()})))}function ss(t,i,e){const s=t.canvas,n=s&&Fi(s);if(!n)return;const r=Ct(((t,i)=>{const s=n.clientWidth;e(t,i),s<n.clientWidth&&e()}),window),o=new ResizeObserver((t=>{const i=t[0],e=i.contentRect.width,s=i.contentRect.height;0===e&&0===s||r(e,s)}));return o.observe(n),function(t,i){ts.size||window.addEventListener("resize",es),ts.set(t,i)}(t,r),o}function ns(t,i,e){e&&e.disconnect(),"resize"===i&&function(t){ts.delete(t),ts.size||window.removeEventListener("resize",es)}(t)}function rs(t,i,e){const s=t.canvas,n=Ct((i=>{null!==t.ctx&&e(function(t,i){const e=Xe[t.type]||t.type,{x:s,y:n}=Gi(t,i);return{type:e,chart:i,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(i,t))}),t);return function(t,i,e){t.addEventListener(i,e,Ze)}(s,i,n),n}class os extends Ge{acquireContext(t,i){const e=t&&t.getContext&&t.getContext("2d");return e&&e.canvas===t?(function(t,i){const e=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[Ve]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ue(n)){const i=Ui(t,"width");void 0!==i&&(t.width=i)}if(Ue(s))if(""===t.style.height)t.height=t.width/(i||2);else{const i=Ui(t,"height");void 0!==i&&(t.height=i)}}(t,i),e):null}releaseContext(t){const i=t.canvas;if(!i[Ve])return!1;const e=i[Ve].initial;["height","width"].forEach((t=>{const s=e[t];N(s)?i.removeAttribute(t):i.setAttribute(t,s)}));const s=e.style||{};return Object.keys(s).forEach((t=>{i.style[t]=s[t]})),i.width=i.width,delete i[Ve],!0}addEventListener(t,i,e){this.removeEventListener(t,i),(t.$proxies||(t.$proxies={}))[i]=({attach:qe,detach:Je,resize:ss}[i]||rs)(t,i,e)}removeEventListener(t,i){const e=t.$proxies||(t.$proxies={}),s=e[i];s&&(({attach:ns,detach:ns,resize:ns}[i]||Ke)(t,i,s),e[i]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,e,s){return function(t,i,e,s){const n=Ni(t),r=$i(n,"margin"),o=zi(n.maxWidth,t,"clientWidth")||lt,a=zi(n.maxHeight,t,"clientHeight")||lt,h=function(t,i,e){let s,n;if(void 0===i||void 0===e){const r=Fi(t);if(r){const t=r.getBoundingClientRect(),o=Ni(r),a=$i(o,"border","width"),h=$i(o,"padding");i=t.width-h.width-a.width,e=t.height-h.height-a.height,s=zi(o.maxWidth,r,"clientWidth"),n=zi(o.maxHeight,r,"clientHeight")}else i=t.clientWidth,e=t.clientHeight}return{width:i,height:e,maxWidth:s||lt,maxHeight:n||lt}}(t,i,e);let{width:c,height:l}=h;if("content-box"===n.boxSizing){const t=$i(n,"border","width"),i=$i(n,"padding");c-=i.width+t.width,l-=i.height+t.height}return c=Math.max(0,c-r.width),l=Math.max(0,s?c/s:l-r.height),c=Yi(Math.min(c,o,h.maxWidth)),l=Yi(Math.min(l,a,h.maxHeight)),c&&!l&&(l=Yi(c/2)),(void 0!==i||void 0!==e)&&s&&h.height&&l>h.height&&(l=h.height,c=Yi(Math.floor(l*s))),{width:c,height:l}}(t,i,e,s)}isAttached(t){const i=Fi(t);return!(!i||!i.isConnected)}}class as{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:i,y:e}=this.getProps(["x","y"],t);return{x:i,y:e}}hasValue(){return yt(this.x)&&yt(this.y)}getProps(t,i){const e=this.$animations;if(!i||!e)return this;const s={};return t.forEach((t=>{s[t]=e[t]&&e[t].active()?e[t]._to:this[t]})),s}}function hs(t,i,e,s,n){const r=Y(s,0),o=Math.min(Y(n,t.length),t.length);let a,h,c,l=0;for(e=Math.ceil(e),n&&(a=n-s,e=a/Math.floor(a/e)),c=r;c<0;)l++,c=Math.round(r+l*e);for(h=Math.max(r,0);h<o;h++)h===c&&(i.push(t[h]),l++,c=Math.round(r+l*e))}const cs=(t,i,e)=>"top"===i||"left"===i?t[i]+e:t[i]-e,ls=(t,i)=>Math.min(i||t,t);function us(t,i){const e=[],s=t.length/i,n=t.length;let r=0;for(;r<n;r+=s)e.push(t[Math.floor(r)]);return e}function ds(t,i,e){const s=t.ticks.length,n=Math.min(i,s-1),r=t._startPixel,o=t._endPixel,a=1e-6;let h,c=t.getPixelForTick(n);if(!(e&&(h=1===s?Math.max(c-r,o-c):0===i?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(n-1))/2,c+=n<i?h:-h,c<r-a||c>o+a)))return c}function fs(t){return t.drawTicks?t.tickLength:0}function bs(t,i){if(!t.display)return 0;const e=xi(t.font,i),s=yi(t.padding);return(W(t.text)?t.text.length:1)*e.lineHeight+s.height}function ps(t,i,e){let s=Et(t);return(e&&"right"!==i||!e&&"right"===i)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class gs extends as{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:e,_suggestedMax:s}=this;return t=G(t,Number.POSITIVE_INFINITY),i=G(i,Number.NEGATIVE_INFINITY),e=G(e,Number.POSITIVE_INFINITY),s=G(s,Number.NEGATIVE_INFINITY),{min:G(t,e),max:G(i,s),minDefined:H(t),maxDefined:H(i)}}getMinMax(t){let i,{min:e,max:s,minDefined:n,maxDefined:r}=this.getUserBounds();if(n&&r)return{min:e,max:s};const o=this.getMatchingVisibleMetas();for(let a=0,h=o.length;a<h;++a)i=o[a].controller.getMinMax(this,t),n||(e=Math.min(e,i.min)),r||(s=Math.max(s,i.max));return e=r&&e>s?s:e,s=n&&e>s?e:s,{min:G(e,G(s,e)),max:G(s,G(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){X(this.options.beforeUpdate,[this])}update(t,i,e){const{beginAtZero:s,grace:n,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=e=Object.assign({left:0,right:0,top:0,bottom:0},e),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+e.left+e.right:this.height+e.top+e.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,i,e){const{min:s,max:n}=t,r=V(i,(n-s)/2),o=(t,i)=>e&&0===t?0:t+i;return{min:o(s,-Math.abs(r)),max:o(n,r)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o<this.ticks.length;this._convertTicksToLabels(a?us(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=function(t,i){const e=t.options.ticks,s=function(t){const i=t.options.offset,e=t._tickSize();return Math.floor(Math.min(t._length/e+(i?0:1),t._maxLength/e))}(t),n=Math.min(e.maxTicksLimit||s,s),r=e.major.enabled?function(t){const i=[];let e,s;for(e=0,s=t.length;e<s;e++)t[e].major&&i.push(e);return i}(i):[],o=r.length,a=r[0],h=r[o-1],c=[];if(o>n)return function(t,i,e,s){let n,r=0,o=e[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(i.push(t[n]),r++,o=e[r*s])}(i,c,r,o/n),c;const l=function(t,i,e){const s=function(t){const i=t.length;let e,s;if(i<2)return!1;for(s=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==s)return!1;return s}(t),n=i.length/e;if(!s)return Math.max(n,1);const r=function(t){const i=[],e=Math.sqrt(t);let s;for(s=1;s<e;s++)t%s==0&&(i.push(s),i.push(t/s));return e===(0|e)&&i.push(e),i.sort(((t,i)=>t-i)).pop(),i}(s);for(let t=0,i=r.length-1;t<i;t++){const i=r[t];if(i>n)return i}return Math.max(n,1)}(r,i,n);if(o>0){let t,e;const s=o>1?Math.round((h-a)/(o-1)):null;for(hs(i,c,l,N(s)?0:a-s,a),t=0,e=o-1;t<e;t++)hs(i,c,l,r[t],r[t+1]);return hs(i,c,l,h,N(s)?i.length:h+s),c}return hs(i,c,l),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,i,e=this.options.reverse;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){X(this.options.afterUpdate,[this])}beforeSetDimensions(){X(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){X(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),X(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){X(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const i=this.options.ticks;let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e],n.label=X(i.callback,[n.value,e,t],this)}afterTickToLabelConversion(){X(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){X(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,i=t.ticks,e=ls(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,n=i.maxRotation;let r,o,a,h=s;if(!this._isVisible()||!i.display||s>=n||e<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),l=c.widest.width,u=c.highest.height,d=_t(this.chart.width-l,0,this.maxWidth);r=t.offset?this.maxWidth/e:d/(e-1),l+6>r&&(r=d/(e-(t.offset?.5:1)),o=this.maxHeight-fs(t.grid)-i.padding-bs(t.title,this.chart.options.font),a=Math.sqrt(l*l+u*u),h=Math.min(Math.asin(_t((c.highest.height+6)/r,-1,1)),Math.asin(_t(o/a,-1,1))-Math.asin(_t(u/a,-1,1)))*(180/ht),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){X(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){X(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:e,title:s,grid:n}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=bs(s,i.options.font);if(o?(t.width=this.maxWidth,t.height=fs(n)+r):(t.height=this.maxHeight,t.width=fs(n)+r),e.display&&this.ticks.length){const{first:i,last:s,widest:n,highest:r}=this._getLabelSizes(),a=2*e.padding,h=xt(this.labelRotation),c=Math.cos(h),l=Math.sin(h);o?t.height=Math.min(this.maxHeight,t.height+(e.mirror?0:l*n.width+c*r.height)+a):t.width=Math.min(this.maxWidth,t.width+(e.mirror?0:c*n.width+l*r.height)+a),this._calculatePadding(i,s,l,c)}}this._handleMargins(),o?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,e,s){const{ticks:{align:n,padding:r},position:o}=this.options,a=0!==this.labelRotation,h="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let l=0,u=0;a?h?(l=s*t.width,u=e*i.height):(l=e*t.height,u=s*i.width):"start"===n?u=i.width:"end"===n?l=t.width:"inner"!==n&&(l=t.width/2,u=i.width/2),this.paddingLeft=Math.max((l-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-c+r)*this.width/(this.width-c),0)}else{let e=i.height/2,s=t.height/2;"start"===n?(e=0,s=t.height):"end"===n&&(e=i.height,s=0),this.paddingTop=e+r,this.paddingBottom=s+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){X(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return"top"===i||"bottom"===i||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let i,e;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),i=0,e=t.length;i<e;i++)N(t[i].label)&&(t.splice(i,1),e--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const i=this.options.ticks.sampleSize;let e=this.ticks;i<e.length&&(e=us(e,i)),this._labelSizes=t=this._computeLabelSizes(e,e.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,e){const{ctx:s,_longestTextCache:n}=this,r=[],o=[],a=Math.floor(i/ls(i,e));let h,c,l,u,d,f,b,p,g,m,v,y=0,x=0;for(h=0;h<i;h+=a){if(u=t[h].label,d=this._resolveTickFontOptions(h),s.font=f=d.string,b=n[f]=n[f]||{data:{},gc:[]},p=d.lineHeight,g=m=0,N(u)||W(u)){if(W(u))for(c=0,l=u.length;c<l;++c)v=u[c],N(v)||W(v)||(g=ti(s,b.data,b.gc,g,v),m+=p)}else g=ti(s,b.data,b.gc,g,u),m=p;r.push(g),o.push(m),y=Math.max(g,y),x=Math.max(m,x)}!function(t,i){U(t,(t=>{const e=t.gc,s=e.length/2;let n;if(s>i){for(n=0;n<s;++n)delete t.data[e[n]];e.splice(0,s)}}))}(n,i);const M=r.indexOf(y),k=o.indexOf(x),w=t=>({width:r[t]||0,height:o[t]||0});return{first:w(0),last:w(i-1),widest:w(M),highest:w(k),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return _t(this._alignToPixels?ii(this.chart,i,0):i,-32768,32767)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&t<i.length){const e=i[t];return e.$context||(e.$context=function(t,i,e){return ki(t,{tick:e,index:i,type:"tick"})}(this.getContext(),t,e))}return this.$context||(this.$context=ki(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,i=xt(this.labelRotation),e=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),n=this._getLabelSizes(),r=t.autoSkipPadding||0,o=n?n.widest.width+r:0,a=n?n.highest.height+r:0;return this.isHorizontal()?a*e>o*s?o/e:a/s:a*s<o*e?a/e:o/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const i=this.axis,e=this.chart,s=this.options,{grid:n,position:r,border:o}=s,a=n.offset,h=this.isHorizontal(),c=this.ticks.length+(a?1:0),l=fs(n),u=[],d=o.setContext(this.getContext()),f=d.display?d.width:0,b=f/2,p=function(t){return ii(e,t,f)};let g,m,v,y,x,M,k,w,_,A,O,S;if("top"===r)g=p(this.bottom),M=this.bottom-l,w=g-b,A=p(t.top)+b,S=t.bottom;else if("bottom"===r)g=p(this.top),A=t.top,S=p(t.bottom)-b,M=g+b,w=this.top+l;else if("left"===r)g=p(this.right),x=this.right-l,k=g-b,_=p(t.left)+b,O=t.right;else if("right"===r)g=p(this.left),_=t.left,O=p(t.right)-b,x=g+b,k=this.left+l;else if("x"===i){if("center"===r)g=p((t.top+t.bottom)/2+.5);else if($(r)){const t=Object.keys(r)[0];g=p(this.chart.scales[t].getPixelForValue(r[t]))}A=t.top,S=t.bottom,M=g+b,w=M+l}else if("y"===i){if("center"===r)g=p((t.left+t.right)/2);else if($(r)){const t=Object.keys(r)[0];g=p(this.chart.scales[t].getPixelForValue(r[t]))}x=g-b,k=x-l,_=t.left,O=t.right}const R=Y(s.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/R));for(m=0;m<c;m+=D){const t=this.getContext(m),i=n.setContext(t),s=o.setContext(t),r=i.lineWidth,c=i.color,l=s.dash||[],d=s.dashOffset,f=i.tickWidth,b=i.tickColor,p=i.tickBorderDash||[],g=i.tickBorderDashOffset;v=ds(this,m,a),void 0!==v&&(y=ii(e,v,r),h?x=k=_=O=y:M=w=A=S=y,u.push({tx1:x,ty1:M,tx2:k,ty2:w,x1:_,y1:A,x2:O,y2:S,width:r,color:c,borderDash:l,borderDashOffset:d,tickWidth:f,tickColor:b,tickBorderDash:p,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,u}_computeLabelItems(t){const i=this.axis,e=this.options,{position:s,ticks:n}=e,r=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:h,padding:c,mirror:l}=n,u=fs(e.grid),d=u+c,f=l?-c:d,b=-xt(this.labelRotation),p=[];let g,m,v,y,x,M,k,w,_,A,O,S,R="middle";if("top"===s)M=this.bottom-f,k=this._getXAxisLabelAlignment();else if("bottom"===s)M=this.top+f,k=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,x=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,x=t.x}else if("x"===i){if("center"===s)M=(t.top+t.bottom)/2+d;else if($(s)){const t=Object.keys(s)[0];M=this.chart.scales[t].getPixelForValue(s[t])+d}k=this._getXAxisLabelAlignment()}else if("y"===i){if("center"===s)x=(t.left+t.right)/2-d;else if($(s)){const t=Object.keys(s)[0];x=this.chart.scales[t].getPixelForValue(s[t])}k=this._getYAxisLabelAlignment(u).textAlign}"y"===i&&("start"===a?R="top":"end"===a&&(R="bottom"));const D=this._getLabelSizes();for(g=0,m=o.length;g<m;++g){v=o[g],y=v.label;const t=n.setContext(this.getContext(g));w=this.getPixelForTick(g)+n.labelOffset,_=this._resolveTickFontOptions(g),A=_.lineHeight,O=W(y)?y.length:1;const i=O/2,e=t.color,a=t.textStrokeColor,c=t.textStrokeWidth;let u,d=k;if(r?(x=w,"inner"===k&&(d=g===m-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),S="top"===s?"near"===h||0!==b?-O*A+A/2:"center"===h?-D.highest.height/2-i*A+A:A/2-D.highest.height:"near"===h||0!==b?A/2:"center"===h?D.highest.height/2-i*A:D.highest.height-O*A,l&&(S*=-1),0===b||t.showLabelBackdrop||(x+=A/2*Math.sin(b))):(M=w,S=(1-O)*A/2),t.showLabelBackdrop){const i=yi(t.backdropPadding),e=D.heights[g],s=D.widths[g];let n=S-i.top,r=0-i.left;switch(R){case"middle":n-=e/2;break;case"bottom":n-=e}switch(k){case"center":r-=s/2;break;case"right":r-=s;break;case"inner":g===m-1?r-=s:g>0&&(r-=s/2)}u={left:r,top:n,width:s+i.width,height:e+i.height,color:t.backdropColor}}p.push({label:y,font:_,textOffset:S,options:{rotation:b,color:e,strokeColor:a,strokeWidth:c,textAlign:d,textBaseline:R,translation:[x,M],backdrop:u}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-xt(this.labelRotation))return"top"===t?"left":"right";let e="center";return"start"===i.align?e="left":"end"===i.align?e="right":"inner"===i.align&&(e="inner"),e}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:e,mirror:s,padding:n}}=this.options,r=t+n,o=this._getLabelSizes().widest.width;let a,h;return"left"===i?s?(h=this.right+n,"near"===e?a="left":"center"===e?(a="center",h+=o/2):(a="right",h+=o)):(h=this.right-r,"near"===e?a="right":"center"===e?(a="center",h-=o/2):(a="left",h=this.left)):"right"===i?s?(h=this.left+n,"near"===e?a="right":"center"===e?(a="center",h-=o/2):(a="left",h-=o)):(h=this.left+r,"near"===e?a="left":"center"===e?(a="center",h+=o/2):(a="right",h=this.right)):a="right",{textAlign:a,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;return"left"===i||"right"===i?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===i||"bottom"===i?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:e,top:s,width:n,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(e,s,n,r),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const e=this.ticks.findIndex((i=>i.value===t));return e>=0?i.setContext(this.getContext(e)).lineWidth:0}drawGrid(t){const i=this.options.grid,e=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,r;const o=(t,i,s)=>{s.width&&s.color&&(e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),e.stroke(),e.restore())};if(i.display)for(n=0,r=s.length;n<r;++n){const t=s[n];i.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:i,options:{border:e,grid:s}}=this,n=e.setContext(this.getContext()),r=e.display?n.width:0;if(!r)return;const o=s.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let h,c,l,u;this.isHorizontal()?(h=ii(t,this.left,r)-r/2,c=ii(t,this.right,o)+o/2,l=u=a):(l=ii(t,this.top,r)-r/2,u=ii(t,this.bottom,o)+o/2,h=c=a),i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.beginPath(),i.moveTo(h,l),i.lineTo(c,u),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,e=this._computeLabelArea();e&&oi(i,e);const s=this.getLabelItems(t);for(const t of s)li(i,t.label,0,t.textOffset,t.font,t.options);e&&ai(i)}drawTitle(){const{ctx:t,options:{position:i,title:e,reverse:s}}=this;if(!e.display)return;const n=xi(e.font),r=yi(e.padding),o=e.align;let a=n.lineHeight/2;"bottom"===i||"center"===i||$(i)?(a+=r.bottom,W(e.text)&&(a+=n.lineHeight*(e.text.length-1))):a+=r.top;const{titleX:h,titleY:c,maxWidth:l,rotation:u}=function(t,i,e,s){const{top:n,left:r,bottom:o,right:a,chart:h}=t,{chartArea:c,scales:l}=h;let u,d,f,b=0;const p=o-n,g=a-r;if(t.isHorizontal()){if(d=Lt(s,r,a),$(e)){const t=Object.keys(e)[0];f=l[t].getPixelForValue(e[t])+p-i}else f="center"===e?(c.bottom+c.top)/2+p-i:cs(t,e,i);u=a-r}else{if($(e)){const t=Object.keys(e)[0];d=l[t].getPixelForValue(e[t])-g+i}else d="center"===e?(c.left+c.right)/2-g+i:cs(t,e,i);f=Lt(s,o,n),b="left"===e?-dt:dt}return{titleX:d,titleY:f,maxWidth:u,rotation:b}}(this,a,i,o);li(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:u,textAlign:ps(o,i,s),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,i=t.ticks&&t.ticks.z||0,e=Y(t.grid&&t.grid.z,-1),s=Y(t.border&&t.border.z,0);return this._isVisible()&&this.draw===gs.prototype.draw?[{z:e,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),e=this.axis+"AxisID",s=[];let n,r;for(n=0,r=i.length;n<r;++n){const r=i[n];r[e]!==this.id||t&&r.type!==t||s.push(r)}return s}_resolveTickFontOptions(t){return xi(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ms{constructor(t,i,e){this.type=t,this.scope=i,this.override=e,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const i=Object.getPrototypeOf(t);let e;(function(t){return"id"in t&&"defaults"in t})(i)&&(e=this.register(i));const s=this.items,n=t.id,r=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,i,e){const s=J(Object.create(null),[e?Jt.get(e):{},Jt.get(i),t.defaults]);Jt.set(i,s),t.defaultRoutes&&function(t,i){Object.keys(i).forEach((e=>{const s=e.split("."),n=s.pop(),r=[t].concat(s).join("."),o=i[e].split("."),a=o.pop(),h=o.join(".");Jt.route(r,n,h,a)}))}(i,t.defaultRoutes),t.descriptors&&Jt.describe(i,t.descriptors)}(t,r,e),this.override&&Jt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const i=this.items,e=t.id,s=this.scope;e in i&&delete i[e],s&&e in Jt[s]&&(delete Jt[s][e],this.override&&delete Ut[e])}}class vs{constructor(){this.controllers=new ms(pe,"datasets",!0),this.elements=new ms(as,"elements"),this.plugins=new ms(Object,"plugins"),this.scales=new ms(gs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,e){[...i].forEach((i=>{const s=e||this._getRegistryForType(i);e||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):U(i,(i=>{const s=e||this._getRegistryForType(i);this._exec(t,s,i)}))}))}_exec(t,i,e){const s=nt(t);X(e["before"+s],[],e),i[t](e),X(e["after"+s],[],e)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){const e=this._typedRegistries[i];if(e.isForType(t))return e}return this.plugins}_get(t,i,e){const s=i.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+e+".");return s}}var ys=new vs;class xs{constructor(){this._init=[]}notify(t,i,e,s){"beforeInit"===i&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(n,t,i,e);return"afterDestroy"===i&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,i,e,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===X(t[e],[i,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){const e=t&&t.config,s=Y(e.options&&e.options.plugins,{}),n=function(t){const i={},e=[],s=Object.keys(ys.plugins.items);for(let t=0;t<s.length;t++)e.push(ys.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===e.indexOf(s)&&(e.push(s),i[s.id]=!0)}return{plugins:e,localIds:i}}(e);return!1!==s||i?function(t,{plugins:i,localIds:e},s,n){const r=[],o=t.getContext();for(const a of i){const i=a.id,h=Ms(s[i],n);null!==h&&r.push({plugin:a,options:ks(t.config,{plugin:a,local:e[i]},h,o)})}return r}(t,n,s,i):[]}_notifyStateChanges(t){const i=this._oldCache||[],e=this._cache,s=(t,i)=>t.filter((t=>!i.some((i=>t.plugin.id===i.plugin.id))));this._notify(s(i,e),t,"stop"),this._notify(s(e,i),t,"start")}}function Ms(t,i){return i||!1!==t?!0===t?{}:t:null}function ks(t,{plugin:i,local:e},s,n){const r=t.pluginScopeKeys(i),o=t.getOptionScopes(s,r);return e&&i.defaults&&o.push(i.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ws(t,i){return((i.datasets||{})[t]||{}).indexAxis||i.indexAxis||(Jt.datasets[t]||{}).indexAxis||"x"}function _s(t){if("x"===t||"y"===t||"r"===t)return t}function As(t,...i){if(_s(t))return t;for(const s of i){const i=s.axis||("top"===(e=s.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.length>1&&_s(t[0].toLowerCase());if(i)return i}var e;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Os(t,i,e){if(e[i+"AxisID"]===t)return{axis:i}}function Ss(t){const i=t.options||(t.options={});i.plugins=Y(i.plugins,{}),i.scales=function(t,i){const e=Ut[t.type]||{scales:{}},s=i.scales||{},n=ws(t.type,i),r=Object.create(null);return Object.keys(s).forEach((i=>{const o=s[i];if(!$(o))return console.error(`Invalid scale configuration for scale: ${i}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const a=As(i,o,function(t,i){if(i.data&&i.data.datasets){const e=i.data.datasets.filter((i=>i.xAxisID===t||i.yAxisID===t));if(e.length)return Os(t,"x",e[0])||Os(t,"y",e[0])}return{}}(i,t),Jt.scales[o.type]),h=function(t,i){return t===i?"_index_":"_value_"}(a,n),c=e.scales||{};r[i]=tt(Object.create(null),[{axis:a},o,c[a],c[h]])})),t.data.datasets.forEach((e=>{const n=e.type||t.type,o=e.indexAxis||ws(n,i),a=(Ut[n]||{}).scales||{};Object.keys(a).forEach((t=>{const i=function(t,i){let e=t;return"_index_"===t?e=i:"_value_"===t&&(e="x"===i?"y":"x"),e}(t,o),n=e[i+"AxisID"]||i;r[n]=r[n]||Object.create(null),tt(r[n],[{axis:i},s[n],a[t]])}))})),Object.keys(r).forEach((t=>{const i=r[t];tt(i,[Jt.scales[i.type],Jt.scale])})),r}(t,i)}function Rs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ds=new Map,js=new Set;function Bs(t,i){let e=Ds.get(t);return e||(e=i(),Ds.set(t,e),js.add(e)),e}const Cs=(t,i,e)=>{const s=st(i,e);void 0!==s&&t.add(s)};class Es{constructor(t){this._config=function(t){return(t=t||{}).data=Rs(t.data),Ss(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Rs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ss(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bs(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,i){return Bs(`${t}.transition.${i}`,(()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,i){return Bs(`${t}-${i}`,(()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]]))}pluginScopeKeys(t){const i=t.id;return Bs(`${this.type}-plugin-${i}`,(()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,i){const e=this._scopeCache;let s=e.get(t);return s&&!i||(s=new Map,e.set(t,s)),s}getOptionScopes(t,i,e){const{options:s,type:n}=this,r=this._cachedScopes(t,e),o=r.get(i);if(o)return o;const a=new Set;i.forEach((i=>{t&&(a.add(t),i.forEach((i=>Cs(a,t,i)))),i.forEach((t=>Cs(a,s,t))),i.forEach((t=>Cs(a,Ut[n]||{},t))),i.forEach((t=>Cs(a,Jt,t))),i.forEach((t=>Cs(a,Zt,t)))}));const h=Array.from(a);return 0===h.length&&h.push(Object.create(null)),js.has(i)&&r.set(i,h),h}chartOptionScopes(){const{options:t,type:i}=this;return[t,Ut[i]||{},Jt.datasets[i]||{},{type:i},Jt,Zt]}resolveNamedOptions(t,i,e,s=[""]){const n={$shared:!0},{resolver:r,subPrefixes:o}=Ls(this._resolverCache,t,s);let a=r;(function(t,i){const{isScriptable:e,isIndexable:s}=Ai(t);for(const n of i){const i=e(n),r=s(n),o=(r||i)&&t[n];if(i&&(ot(o)||Ps(o))||r&&W(o))return!0}return!1})(r,i)&&(n.$shared=!1,a=_i(r,e=ot(e)?e():e,this.createResolver(t,e,o)));for(const t of i)n[t]=a[t];return n}createResolver(t,i,e=[""],s){const{resolver:n}=Ls(this._resolverCache,t,e);return $(i)?_i(n,i,void 0,s):n}}function Ls(t,i,e){let s=t.get(i);s||(s=new Map,t.set(i,s));const n=e.join();let r=s.get(n);return r||(r={resolver:wi(i,e),subPrefixes:e.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,r)),r}const Ps=t=>$(t)&&Object.getOwnPropertyNames(t).some((i=>ot(t[i]))),Is=["top","bottom","left","right","chartArea"];function Ts(t,i){return"top"===t||"bottom"===t||-1===Is.indexOf(t)&&"x"===i}function Fs(t,i){return function(e,s){return e[t]===s[t]?e[i]-s[i]:e[t]-s[t]}}function zs(t){const i=t.chart,e=i.options.animation;i.notifyPlugins("afterRender"),X(e&&e.onComplete,[t],i)}function Ns(t){const i=t.chart,e=i.options.animation;X(e&&e.onProgress,[t],i)}function Ws(t){return Ti()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const $s={},Hs=t=>{const i=Ws(t);return Object.values($s).filter((t=>t.canvas===i)).pop()};function Gs(t,i,e){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=i){const r=t[n];delete t[n],(e>0||s>i)&&(t[s+e]=r)}}}function Ys(t,i,e){return t.options.clip?t[e]:i[e]}class Vs{static defaults=Jt;static instances=$s;static overrides=Ut;static registry=ys;static version="4.4.1";static getChart=Hs;static register(...t){ys.add(...t),Xs()}static unregister(...t){ys.remove(...t),Xs()}constructor(t,i){const e=this.config=new Es(i),s=Ws(t),n=Hs(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const r=e.createResolver(e.chartOptionScopes(),this.getContext());this.platform=new(e.platform||function(t){return!Ti()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ye:os}(s)),this.platform.updateConfig(e);const o=this.platform.acquireContext(s,r.aspectRatio),a=o&&o.canvas,h=a&&a.height,c=a&&a.width;this.id=z(),this.ctx=o,this.canvas=a,this.width=c,this.height=h,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,i){let e;return function(...s){return i?(clearTimeout(e),e=setTimeout(t,i,s)):t.apply(this,s),i}}((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],$s[this.id]=this,o&&a?(Ji.listen(this,"complete",zs),Ji.listen(this,"progress",Ns),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:e,height:s,_aspectRatio:n}=this;return N(t)?i&&n?n:s?e/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ys}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Vi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ei(this.canvas,this.ctx),this}stop(){return Ji.stop(this),this}resize(t,i){Ji.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const e=this.options,s=this.platform.getMaximumSize(this.canvas,t,i,e.maintainAspectRatio&&this.aspectRatio),n=e.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Vi(this,n,!0)&&(this.notifyPlugins("resize",{size:s}),X(e.onResize,[this,s],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){U(this.options.scales||{},((t,i)=>{t.id=i}))}buildOrUpdateScales(){const t=this.options,i=t.scales,e=this.scales,s=Object.keys(e).reduce(((t,i)=>(t[i]=!1,t)),{});let n=[];i&&(n=n.concat(Object.keys(i).map((t=>{const e=i[t],s=As(t,e),n="r"===s,r="x"===s;return{options:e,dposition:n?"chartArea":r?"bottom":"left",dtype:n?"radialLinear":r?"category":"linear"}})))),U(n,(i=>{const n=i.options,r=n.id,o=As(r,n),a=Y(n.type,i.dtype);void 0!==n.position&&Ts(n.position,o)===Ts(i.dposition)||(n.position=i.dposition),s[r]=!0;let h=null;r in e&&e[r].type===a?h=e[r]:(h=new(ys.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),e[h.id]=h),h.init(n,t)})),U(s,((t,i)=>{t||delete e[i]})),U(e,(t=>{He.configure(this,t,t.options),He.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,e=t.length;if(t.sort(((t,i)=>t.index-i.index)),e>i){for(let t=i;t<e;++t)this._destroyDatasetMeta(t);t.splice(i,e-i)}this._sortedMetasets=t.slice(0).sort(Fs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach(((t,e)=>{0===i.filter((i=>i===t._dataset)).length&&this._destroyDatasetMeta(e)}))}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let e,s;for(this._removeUnreferencedMetasets(),e=0,s=i.length;e<s;e++){const s=i[e];let n=this.getDatasetMeta(e);const r=s.type||this.config.type;if(n.type&&n.type!==r&&(this._destroyDatasetMeta(e),n=this.getDatasetMeta(e)),n.type=r,n.indexAxis=s.indexAxis||ws(r,this.options),n.order=s.order||0,n.index=e,n.label=""+s.label,n.visible=this.isDatasetVisible(e),n.controller)n.controller.updateIndex(e),n.controller.linkScales();else{const i=ys.getController(r),{datasetElementType:s,dataElementType:o}=Jt.datasets[r];Object.assign(i,{dataElementType:ys.getElement(o),datasetElementType:s&&ys.getElement(s)}),n.controller=new i(this,e),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){U(this.data.datasets,((t,i)=>{this.getDatasetMeta(i).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const e=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!e.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,i=this.data.datasets.length;t<i;t++){const{controller:i}=this.getDatasetMeta(t),e=!s&&-1===n.indexOf(i);i.buildOrUpdateElements(e),r=Math.max(+i.getMaxOverflow(),r)}r=this._minPadding=e.layout.autoPadding?r:0,this._updateLayout(r),s||U(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){U(this.scales,(t=>{He.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),e=new Set(t.events);at(i,e)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:e,start:s,count:n}of i)Gs(t,s,"_removeElements"===e?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,e=i=>new Set(t.filter((t=>t[0]===i)).map(((t,i)=>i+","+t.splice(1).join(",")))),s=e(0);for(let t=1;t<i;t++)if(!at(s,e(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;He.update(this,this.width,this.height,t);const i=this.chartArea,e=i.width<=0||i.height<=0;this._layers=[],U(this.boxes,(t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,i)=>{t._idx=i})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let i=0,e=this.data.datasets.length;i<e;++i)this._updateDataset(i,ot(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){const e=this.getDatasetMeta(t),s={meta:e,index:t,mode:i,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(e.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ji.has(this)?this.attached&&!Ji.running(this)&&Ji.start(this):(this.draw(),zs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:i}=this._resizeBeforeDraw;this._resize(t,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const i=this._sortedMetasets,e=[];let s,n;for(s=0,n=i.length;s<n;++s){const n=i[s];t&&!n.visible||e.push(n)}return e}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,e=t._clip,s=!e.disabled,n=function(t,i){const{xScale:e,yScale:s}=t;return e&&s?{left:Ys(e,i,"left"),right:Ys(e,i,"right"),top:Ys(s,i,"top"),bottom:Ys(s,i,"bottom")}:i}(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&oi(i,{left:!1===e.left?0:n.left-e.left,right:!1===e.right?this.width:n.right+e.right,top:!1===e.top?0:n.top-e.top,bottom:!1===e.bottom?this.height:n.bottom+e.bottom}),t.controller.draw(),s&&ai(i),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,e,s){const n=Be.modes[i];return"function"==typeof n?n(this,t,e,s):[]}getDatasetMeta(t){const i=this.data.datasets[t],e=this._metasets;let s=e.filter((t=>t&&t._dataset===i)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},e.push(s)),s}getContext(){return this.$context||(this.$context=ki(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!i.hidden}setDatasetVisibility(t,i){this.getDatasetMeta(t).hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,e){const s=e?"show":"hide",n=this.getDatasetMeta(t),r=n.controller._resolveAnimations(void 0,s);rt(i)?(n.data[i].hidden=!e,this.update()):(this.setDatasetVisibility(t,e),r.update(n,{visible:e}),this.update((i=>i.datasetIndex===t?s:void 0)))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Ji.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ei(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete $s[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(t,i,e)=>{t.offsetX=i,t.offsetY=e,this._eventHandler(t)};U(this.options.events,(t=>e(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(e,s)=>{t[e]&&(i.removeEventListener(this,e,s),delete t[e])},n=(t,i)=>{this.canvas&&this.resize(t,i)};let r;const o=()=>{s("attach",o),this.attached=!0,this.resize(),e("resize",n),e("detach",r)};r=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),e("attach",o)},i.isAttached(this.canvas)?o():r()}unbindEvents(){U(this._listeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._listeners={},U(this._responsiveListeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,i,e){const s=e?"set":"remove";let n,r,o,a;for("dataset"===i&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,a=t.length;o<a;++o){r=t[o];const i=r&&this.getDatasetMeta(r.datasetIndex).controller;i&&i[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const i=this._active||[],e=t.map((({datasetIndex:t,index:i})=>{const e=this.getDatasetMeta(t);if(!e)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:e.data[i],index:i}}));!Z(e,i)&&(this._active=e,this._lastEvent=null,this._updateHoverStyles(e,i))}notifyPlugins(t,i,e){return this._plugins.notify(this,t,i,e)}isPluginEnabled(t){return 1===this._plugins._cache.filter((i=>i.plugin.id===t)).length}_updateHoverStyles(t,i,e){const s=this.options.hover,n=(t,i)=>t.filter((t=>!i.some((i=>t.datasetIndex===i.datasetIndex&&t.index===i.index)))),r=n(i,t),o=e?t:n(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,i){const e={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",e,s))return;const n=this._handleEvent(t,i,e.inChartArea);return e.cancelable=!1,this.notifyPlugins("afterEvent",e,s),(n||e.changed)&&this.render(),this}_handleEvent(t,i,e){const{_active:s=[],options:n}=this,r=this._getActiveElements(t,s,e,i),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),a=function(t,i,e,s){return e&&"mouseout"!==t.type?s?i:t:null}(t,this._lastEvent,e,o);e&&(this._lastEvent=null,X(n.onHover,[t,r,this],this),o&&X(n.onClick,[t,r,this],this));const h=!Z(r,s);return(h||i)&&(this._active=r,this._updateHoverStyles(r,s,i)),this._lastEvent=a,h}_getActiveElements(t,i,e,s){if("mouseout"===t.type)return[];if(!e)return i;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Xs(){return U(Vs.instances,(t=>t._plugins.invalidate()))}function Us(t,i){const{x:e,y:s,base:n,width:r,height:o}=t.getProps(["x","y","base","width","height"],i);let a,h,c,l,u;return t.horizontal?(u=o/2,a=Math.min(e,n),h=Math.max(e,n),c=s-u,l=s+u):(u=r/2,a=e-u,h=e+u,c=Math.min(s,n),l=Math.max(s,n)),{left:a,top:c,right:h,bottom:l}}function Zs(t,i,e,s){return t?0:_t(i,e,s)}function Ks(t,i,e,s){const n=null===i,r=null===e,o=t&&!(n&&r)&&Us(t,s);return o&&(n||At(i,o.left,o.right))&&(r||At(e,o.top,o.bottom))}function Qs(t,i){t.rect(i.x,i.y,i.w,i.h)}function qs(t,i,e={}){const s=t.x!==e.x?-i:0,n=t.y!==e.y?-i:0;return{x:t.x+s,y:t.y+n,w:t.w+((t.x+t.w!==e.x+e.w?i:0)-s),h:t.h+((t.y+t.h!==e.y+e.h?i:0)-n),radius:t.radius}}class Js extends as{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:i,options:{borderColor:e,backgroundColor:s}}=this,{inner:n,outer:r}=function(t){const i=Us(t),e=i.right-i.left,s=i.bottom-i.top,n=function(t,i,e){const s=t.borderSkipped,n=mi(t.options.borderWidth);return{t:Zs(s.top,n.top,0,e),r:Zs(s.right,n.right,0,i),b:Zs(s.bottom,n.bottom,0,e),l:Zs(s.left,n.left,0,i)}}(t,e/2,s/2),r=function(t,i,e){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,r=vi(n),o=Math.min(i,e),a=t.borderSkipped,h=s||$(n);return{topLeft:Zs(!h||a.top||a.left,r.topLeft,0,o),topRight:Zs(!h||a.top||a.right,r.topRight,0,o),bottomLeft:Zs(!h||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Zs(!h||a.bottom||a.right,r.bottomRight,0,o)}}(t,e/2,s/2);return{outer:{x:i.left,y:i.top,w:e,h:s,radius:r},inner:{x:i.left+n.l,y:i.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}(this),o=(a=r.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?ui:Qs;var a;t.save(),r.w===n.w&&r.h===n.h||(t.beginPath(),o(t,qs(r,i,n)),t.clip(),o(t,qs(n,-i,r)),t.fillStyle=e,t.fill("evenodd")),t.beginPath(),o(t,qs(n,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,e){return Ks(this,t,i,e)}inXRange(t,i){return Ks(this,t,null,i)}inYRange(t,i){return Ks(this,null,t,i)}getCenterPoint(t){const{x:i,y:e,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(i+s)/2:i,y:n?e:(e+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}const tn=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],en=tn.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function sn(t){return tn[t%tn.length]}function nn(t){return en[t%en.length]}function rn(t){let i;for(i in t)if(t[i].borderColor||t[i].backgroundColor)return!0;return!1}var on={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,i,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:r}=n;if(!e.forceOverride&&(rn(s)||(o=n)&&(o.borderColor||o.backgroundColor)||r&&rn(r)))return;var o;const a=function(t){let i=0;return(e,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof _e?i=function(t,i){return t.backgroundColor=t.data.map((()=>sn(i++))),i}(e,i):n instanceof Ae?i=function(t,i){return t.backgroundColor=t.data.map((()=>nn(i++))),i}(e,i):n&&(i=function(t,i){return t.borderColor=sn(i),t.backgroundColor=nn(i),++i}(e,i))}}(t);s.forEach(a)}};const an=(t,i)=>{let{boxHeight:e=i,boxWidth:s=i}=t;return t.usePointStyle&&(e=Math.min(e,i),s=t.pointStyleWidth||Math.min(s,i)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(i,e)}};class hn extends as{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,e){this.maxWidth=t,this.maxHeight=i,this._margins=e,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let i=X(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter((i=>t.filter(i,this.chart.data)))),t.sort&&(i=i.sort(((i,e)=>t.sort(i,e,this.chart.data)))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:t,ctx:i}=this;if(!t.display)return void(this.width=this.height=0);const e=t.labels,s=xi(e.font),n=s.size,r=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=an(e,n);let h,c;i.font=s.string,this.isHorizontal()?(h=this.maxWidth,c=this._fitRows(r,n,o,a)+10):(c=this.maxHeight,h=this._fitCols(r,s,o,a)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,i,e,s){const{ctx:n,maxWidth:r,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],h=this.lineWidths=[0],c=s+o;let l=t;n.textAlign="left",n.textBaseline="middle";let u=-1,d=-c;return this.legendItems.forEach(((t,f)=>{const b=e+i/2+n.measureText(t.text).width;(0===f||h[h.length-1]+b+2*o>r)&&(l+=c,h[h.length-(f>0?0:1)]=0,d+=c,u++),a[f]={left:0,top:d,row:u,width:b,height:s},h[h.length-1]+=b+o})),l}_fitCols(t,i,e,s){const{ctx:n,maxHeight:r,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],h=this.columnSizes=[],c=r-t;let l=o,u=0,d=0,f=0,b=0;return this.legendItems.forEach(((t,r)=>{const{itemWidth:p,itemHeight:g}=function(t,i,e,s,n){const r=function(t,i,e,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,i)=>t.length>i.length?t:i))),i+e.size/2+s.measureText(n).width}(s,t,i,e),o=function(t,i,e){let s=t;return"string"!=typeof i.text&&(s=cn(i,e)),s}(n,s,i.lineHeight);return{itemWidth:r,itemHeight:o}}(e,i,n,t,s);r>0&&d+g+2*o>c&&(l+=u+o,h.push({width:u,height:d}),f+=u+o,b++,u=d=0),a[r]={left:f,top:d,col:b,width:p,height:g},u=Math.max(u,p),d+=g+o})),l+=u,h.push({width:u,height:d}),l}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:e,labels:{padding:s},rtl:n}}=this,r=Zi(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=Lt(e,this.left+s,this.right-this.lineWidths[n]);for(const a of i)n!==a.row&&(n=a.row,o=Lt(e,this.left+s,this.right-this.lineWidths[n])),a.top+=this.top+t+s,a.left=r.leftForLtr(r.x(o),a.width),o+=a.width+s}else{let n=0,o=Lt(e,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const a of i)a.col!==n&&(n=a.col,o=Lt(e,this.top+t+s,this.bottom-this.columnSizes[n].height)),a.top=o,a.left+=this.left+s,a.left=r.leftForLtr(r.x(a.left),a.width),o+=a.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;oi(t,this),this._draw(),ai(t)}}_draw(){const{options:t,columnSizes:i,lineWidths:e,ctx:s}=this,{align:n,labels:r}=t,o=Jt.color,a=Zi(t.rtl,this.left,this.width),h=xi(r.font),{padding:c}=r,l=h.size,u=l/2;let d;this.drawTitle(),s.textAlign=a.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:f,boxHeight:b,itemHeight:p}=an(r,l),g=this.isHorizontal(),m=this._computeTitleHeight();d=g?{x:Lt(n,this.left+c,this.right-e[0]),y:this.top+c+m,line:0}:{x:this.left+c,y:Lt(n,this.top+m+c,this.bottom-i[0].height),line:0},Ki(this.ctx,t.textDirection);const v=p+c;this.legendItems.forEach(((y,x)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const M=s.measureText(y.text).width,k=a.textAlign(y.textAlign||(y.textAlign=r.textAlign)),w=f+u+M;let _=d.x,A=d.y;a.setWidth(this.width),g?x>0&&_+w+c>this.right&&(A=d.y+=v,d.line++,_=d.x=Lt(n,this.left+c,this.right-e[d.line])):x>0&&A+v>this.bottom&&(_=d.x=_+i[d.line].width+c,d.line++,A=d.y=Lt(n,this.top+m+c,this.bottom-i[d.line].height)),function(t,i,e){if(isNaN(f)||f<=0||isNaN(b)||b<0)return;s.save();const n=Y(e.lineWidth,1);if(s.fillStyle=Y(e.fillStyle,o),s.lineCap=Y(e.lineCap,"butt"),s.lineDashOffset=Y(e.lineDashOffset,0),s.lineJoin=Y(e.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=Y(e.strokeStyle,o),s.setLineDash(Y(e.lineDash,[])),r.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:e.pointStyle,rotation:e.rotation,borderWidth:n},h=a.xPlus(t,f/2);ni(s,o,h,i+u,r.pointStyleWidth&&f)}else{const r=i+Math.max((l-b)/2,0),o=a.leftForLtr(t,f),h=vi(e.borderRadius);s.beginPath(),Object.values(h).some((t=>0!==t))?ui(s,{x:o,y:r,w:f,h:b,radius:h}):s.rect(o,r,f,b),s.fill(),0!==n&&s.stroke()}s.restore()}(a.x(_),A,y),_=((t,i,e,s)=>t===(s?"left":"right")?e:"center"===t?(i+e)/2:i)(k,_+f+u,g?_+w:this.right,t.rtl),function(t,i,e){li(s,e.text,t,i+p/2,h,{strikethrough:e.hidden,textAlign:a.textAlign(e.textAlign)})}(a.x(_),A,y),g?d.x+=w+c:d.y+="string"!=typeof y.text?cn(y,h.lineHeight)+c:v})),Qi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,i=t.title,e=xi(i.font),s=yi(i.padding);if(!i.display)return;const n=Zi(t.rtl,this.left,this.width),r=this.ctx,o=i.position,a=s.top+e.size/2;let h,c=this.left,l=this.width;if(this.isHorizontal())l=Math.max(...this.lineWidths),h=this.top+a,c=Lt(t.align,c,this.right-l);else{const i=this.columnSizes.reduce(((t,i)=>Math.max(t,i.height)),0);h=a+Lt(t.align,this.top,this.bottom-i-t.labels.padding-this._computeTitleHeight())}const u=Lt(o,c,c+l);r.textAlign=n.textAlign(Et(o)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=e.string,li(r,i.text,u,h,e)}_computeTitleHeight(){const t=this.options.title,i=xi(t.font),e=yi(t.padding);return t.display?i.lineHeight+e.height:0}_getLegendItemAt(t,i){let e,s,n;if(At(t,this.left,this.right)&&At(i,this.top,this.bottom))for(n=this.legendHitBoxes,e=0;e<n.length;++e)if(s=n[e],At(t,s.left,s.left+s.width)&&At(i,s.top,s.top+s.height))return this.legendItems[e];return null}handleEvent(t){const i=this.options;if(!function(t,i){return!("mousemove"!==t&&"mouseout"!==t||!i.onHover&&!i.onLeave)||!(!i.onClick||"click"!==t&&"mouseup"!==t)}(t.type,i))return;const e=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,o=(n=e,null!==(s=r)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);r&&!o&&X(i.onLeave,[t,r,this],this),this._hoveredItem=e,e&&!o&&X(i.onHover,[t,e,this],this)}else e&&X(i.onClick,[t,e,this],this);var s,n}}function cn(t,i){return i*(t.text?t.text.length:0)}var ln={id:"legend",_element:hn,start(t,i,e){const s=t.legend=new hn({ctx:t.ctx,options:e,chart:t});He.configure(t,s,e),He.addBox(t,s)},stop(t){He.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,i,e){const s=t.legend;He.configure(t,s,e),s.options=e},afterUpdate(t){const i=t.legend;i.buildLabels(),i.adjustHitBoxes()},afterEvent(t,i){i.replay||t.legend.handleEvent(i.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,i,e){const s=i.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),i.hidden=!0):(n.show(s),i.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const i=t.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const h=t.controller.getStyle(e?0:void 0),c=yi(h.borderWidth);return{text:i[t.index].label,fillStyle:h.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:n||h.textAlign,borderRadius:o&&(a||h.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class un extends as{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i){const e=this.options;if(this.left=0,this.top=0,!e.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=i;const s=W(e.text)?e.text.length:1;this._padding=yi(e.padding);const n=s*xi(e.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:i,left:e,bottom:s,right:n,options:r}=this,o=r.align;let a,h,c,l=0;return this.isHorizontal()?(h=Lt(o,e,n),c=i+t,a=n-e):("left"===r.position?(h=e+t,c=Lt(o,s,i),l=-.5*ht):(h=n-t,c=Lt(o,i,s),l=.5*ht),a=s-i),{titleX:h,titleY:c,maxWidth:a,rotation:l}}draw(){const t=this.ctx,i=this.options;if(!i.display)return;const e=xi(i.font),s=e.lineHeight/2+this._padding.top,{titleX:n,titleY:r,maxWidth:o,rotation:a}=this._drawArgs(s);li(t,i.text,0,0,e,{color:i.color,maxWidth:o,rotation:a,textAlign:Et(i.align),textBaseline:"middle",translation:[n,r]})}}var dn={id:"title",_element:un,start(t,i,e){!function(t,i){const e=new un({ctx:t.ctx,options:i,chart:t});He.configure(t,e,i),He.addBox(t,e),t.titleBlock=e}(t,e)},stop(t){He.removeBox(t,t.titleBlock),delete t.titleBlock},beforeUpdate(t,i,e){const s=t.titleBlock;He.configure(t,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const fn={average(t){if(!t.length)return!1;let i,e,s=0,n=0,r=0;for(i=0,e=t.length;i<e;++i){const e=t[i].element;if(e&&e.hasValue()){const t=e.tooltipPosition();s+=t.x,n+=t.y,++r}}return{x:s/r,y:n/r}},nearest(t,i){if(!t.length)return!1;let e,s,n,r=i.x,o=i.y,a=Number.POSITIVE_INFINITY;for(e=0,s=t.length;e<s;++e){const s=t[e].element;if(s&&s.hasValue()){const t=(h=i,c=s.getCenterPoint(),Math.sqrt(Math.pow(c.x-h.x,2)+Math.pow(c.y-h.y,2)));t<a&&(a=t,n=s)}}var h,c;if(n){const t=n.tooltipPosition();r=t.x,o=t.y}return{x:r,y:o}}};function bn(t,i){return i&&(W(i)?Array.prototype.push.apply(t,i):t.push(i)),t}function pn(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function gn(t,i){const{element:e,datasetIndex:s,index:n}=i,r=t.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:t,label:o,parsed:r.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function mn(t,i){const e=t.chart.ctx,{body:s,footer:n,title:r}=t,{boxWidth:o,boxHeight:a}=i,h=xi(i.bodyFont),c=xi(i.titleFont),l=xi(i.footerFont),u=r.length,d=n.length,f=s.length,b=yi(i.padding);let p=b.height,g=0,m=s.reduce(((t,i)=>t+i.before.length+i.lines.length+i.after.length),0);m+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*i.titleSpacing+i.titleMarginBottom),m&&(p+=f*(i.displayColors?Math.max(a,h.lineHeight):h.lineHeight)+(m-f)*h.lineHeight+(m-1)*i.bodySpacing),d&&(p+=i.footerMarginTop+d*l.lineHeight+(d-1)*i.footerSpacing);let v=0;const y=function(t){g=Math.max(g,e.measureText(t).width+v)};return e.save(),e.font=c.string,U(t.title,y),e.font=h.string,U(t.beforeBody.concat(t.afterBody),y),v=i.displayColors?o+2+i.boxPadding:0,U(s,(t=>{U(t.before,y),U(t.lines,y),U(t.after,y)})),v=0,e.font=l.string,U(t.footer,y),e.restore(),g+=b.width,{width:g,height:p}}function vn(t,i,e,s){const{x:n,width:r}=e,{width:o,chartArea:{left:a,right:h}}=t;let c="center";return"center"===s?c=n<=(a+h)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),function(t,i,e,s){const{x:n,width:r}=s,o=e.caretSize+e.caretPadding;return"left"===t&&n+r+o>i.width||"right"===t&&n-r-o<0||void 0}(c,t,i,e)&&(c="center"),c}function yn(t,i,e){const s=e.yAlign||i.yAlign||function(t,i){const{y:e,height:s}=i;return e<s/2?"top":e>t.height-s/2?"bottom":"center"}(t,e);return{xAlign:e.xAlign||i.xAlign||vn(t,i,e,s),yAlign:s}}function xn(t,i,e,s){const{caretSize:n,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:h}=e,c=n+r,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:f}=vi(o);let b=function(t,i){let{x:e,width:s}=t;return"right"===i?e-=s:"center"===i&&(e-=s/2),e}(i,a);const p=function(t,i,e){let{y:s,height:n}=t;return"top"===i?s+=e:s-="bottom"===i?n+e:n/2,s}(i,h,c);return"center"===h?"left"===a?b+=c:"right"===a&&(b-=c):"left"===a?b-=Math.max(l,d)+n:"right"===a&&(b+=Math.max(u,f)+n),{x:_t(b,0,s.width-i.width),y:_t(p,0,s.height-i.height)}}function Mn(t,i,e){const s=yi(e.padding);return"center"===i?t.x+t.width/2:"right"===i?t.x+t.width-s.right:t.x+s.left}function kn(t){return bn([],pn(t))}function wn(t,i){const e=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return e?t.override(e):t}const _n={beforeTitle:F,title(t){if(t.length>0){const i=t[0],e=i.chart.data.labels,s=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return i.dataset.label||"";if(i.label)return i.label;if(s>0&&i.dataIndex<s)return e[i.dataIndex]}return""},afterTitle:F,beforeBody:F,beforeLabel:F,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let i=t.dataset.label||"";i&&(i+=": ");const e=t.formattedValue;return N(e)||(i+=e),i},labelColor(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:F,afterBody:F,beforeFooter:F,footer:F,afterFooter:F};function An(t,i,e,s){const n=t[i].call(e,s);return void 0===n?_n[i].call(e,s):n}class On extends as{static positioners=fn;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,e=this.options.setContext(this.getContext()),s=e.enabled&&i.options.animation&&e.animations,n=new se(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=ki(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,i){const{callbacks:e}=i,s=An(e,"beforeTitle",this,t),n=An(e,"title",this,t),r=An(e,"afterTitle",this,t);let o=[];return o=bn(o,pn(s)),o=bn(o,pn(n)),o=bn(o,pn(r)),o}getBeforeBody(t,i){return kn(An(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:e}=i,s=[];return U(t,(t=>{const i={before:[],lines:[],after:[]},n=wn(e,t);bn(i.before,pn(An(n,"beforeLabel",this,t))),bn(i.lines,An(n,"label",this,t)),bn(i.after,pn(An(n,"afterLabel",this,t))),s.push(i)})),s}getAfterBody(t,i){return kn(An(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:e}=i,s=An(e,"beforeFooter",this,t),n=An(e,"footer",this,t),r=An(e,"afterFooter",this,t);let o=[];return o=bn(o,pn(s)),o=bn(o,pn(n)),o=bn(o,pn(r)),o}_createItems(t){const i=this._active,e=this.chart.data,s=[],n=[],r=[];let o,a,h=[];for(o=0,a=i.length;o<a;++o)h.push(gn(this.chart,i[o]));return t.filter&&(h=h.filter(((i,s,n)=>t.filter(i,s,n,e)))),t.itemSort&&(h=h.sort(((i,s)=>t.itemSort(i,s,e)))),U(h,(i=>{const e=wn(t.callbacks,i);s.push(An(e,"labelColor",this,i)),n.push(An(e,"labelPointStyle",this,i)),r.push(An(e,"labelTextColor",this,i))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=r,this.dataPoints=h,h}update(t,i){const e=this.options.setContext(this.getContext()),s=this._active;let n,r=[];if(s.length){const t=fn[e.position].call(this,s,this._eventPosition);r=this._createItems(e),this.title=this.getTitle(r,e),this.beforeBody=this.getBeforeBody(r,e),this.body=this.getBody(r,e),this.afterBody=this.getAfterBody(r,e),this.footer=this.getFooter(r,e);const i=this._size=mn(this,e),o=Object.assign({},t,i),a=yn(this.chart,e,o),h=xn(e,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,n={opacity:1,x:h.x,y:h.y,width:i.width,height:i.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=r,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&e.external&&e.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,e,s){const n=this.getCaretPosition(t,e,s);i.lineTo(n.x1,n.y1),i.lineTo(n.x2,n.y2),i.lineTo(n.x3,n.y3)}getCaretPosition(t,i,e){const{xAlign:s,yAlign:n}=this,{caretSize:r,cornerRadius:o}=e,{topLeft:a,topRight:h,bottomLeft:c,bottomRight:l}=vi(o),{x:u,y:d}=t,{width:f,height:b}=i;let p,g,m,v,y,x;return"center"===n?(y=d+b/2,"left"===s?(p=u,g=p-r,v=y+r,x=y-r):(p=u+f,g=p+r,v=y-r,x=y+r),m=p):(g="left"===s?u+Math.max(a,c)+r:"right"===s?u+f-Math.max(h,l)-r:this.caretX,"top"===n?(v=d,y=v-r,p=g-r,m=g+r):(v=d+b,y=v+r,p=g+r,m=g-r),x=v),{x1:p,x2:g,x3:m,y1:v,y2:y,y3:x}}drawTitle(t,i,e){const s=this.title,n=s.length;let r,o,a;if(n){const h=Zi(e.rtl,this.x,this.width);for(t.x=Mn(this,e.titleAlign,e),i.textAlign=h.textAlign(e.titleAlign),i.textBaseline="middle",r=xi(e.titleFont),o=e.titleSpacing,i.fillStyle=e.titleColor,i.font=r.string,a=0;a<n;++a)i.fillText(s[a],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+o,a+1===n&&(t.y+=e.titleMarginBottom-o)}}_drawColorBox(t,i,e,s,n){const r=this.labelColors[e],o=this.labelPointStyles[e],{boxHeight:a,boxWidth:h}=n,c=xi(n.bodyFont),l=Mn(this,"left",n),u=s.x(l),d=i.y+(a<c.lineHeight?(c.lineHeight-a)/2:0);if(n.usePointStyle){const i={radius:Math.min(h,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},e=s.leftForLtr(u,h)+h/2,c=d+a/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,si(t,i,e,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,si(t,i,e,c)}else{t.lineWidth=$(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const i=s.leftForLtr(u,h),e=s.leftForLtr(s.xPlus(u,1),h-2),o=vi(r.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,ui(t,{x:i,y:d,w:h,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ui(t,{x:e,y:d+1,w:h-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(i,d,h,a),t.strokeRect(i,d,h,a),t.fillStyle=r.backgroundColor,t.fillRect(e,d+1,h-2,a-2))}t.fillStyle=this.labelTextColors[e]}drawBody(t,i,e){const{body:s}=this,{bodySpacing:n,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:h,boxPadding:c}=e,l=xi(e.bodyFont);let u=l.lineHeight,d=0;const f=Zi(e.rtl,this.x,this.width),b=function(e){i.fillText(e,f.x(t.x+d),t.y+u/2),t.y+=u+n},p=f.textAlign(r);let g,m,v,y,x,M,k;for(i.textAlign=r,i.textBaseline="middle",i.font=l.string,t.x=Mn(this,p,e),i.fillStyle=e.bodyColor,U(this.beforeBody,b),d=o&&"right"!==p?"center"===r?h/2+c:h+2+c:0,y=0,M=s.length;y<M;++y){for(g=s[y],m=this.labelTextColors[y],i.fillStyle=m,U(g.before,b),v=g.lines,o&&v.length&&(this._drawColorBox(i,t,y,f,e),u=Math.max(l.lineHeight,a)),x=0,k=v.length;x<k;++x)b(v[x]),u=l.lineHeight;U(g.after,b)}d=0,u=l.lineHeight,U(this.afterBody,b),t.y-=n}drawFooter(t,i,e){const s=this.footer,n=s.length;let r,o;if(n){const a=Zi(e.rtl,this.x,this.width);for(t.x=Mn(this,e.footerAlign,e),t.y+=e.footerMarginTop,i.textAlign=a.textAlign(e.footerAlign),i.textBaseline="middle",r=xi(e.footerFont),i.fillStyle=e.footerColor,i.font=r.string,o=0;o<n;++o)i.fillText(s[o],a.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+e.footerSpacing}}drawBackground(t,i,e,s){const{xAlign:n,yAlign:r}=this,{x:o,y:a}=t,{width:h,height:c}=e,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:f}=vi(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(o+l,a),"top"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+h-u,a),i.quadraticCurveTo(o+h,a,o+h,a+u),"center"===r&&"right"===n&&this.drawCaret(t,i,e,s),i.lineTo(o+h,a+c-f),i.quadraticCurveTo(o+h,a+c,o+h-f,a+c),"bottom"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+d,a+c),i.quadraticCurveTo(o,a+c,o,a+c-d),"center"===r&&"left"===n&&this.drawCaret(t,i,e,s),i.lineTo(o,a+l),i.quadraticCurveTo(o,a,o+l,a),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,e=this.$animations,s=e&&e.x,n=e&&e.y;if(s||n){const e=fn[t.position].call(this,this._active,this._eventPosition);if(!e)return;const r=this._size=mn(this,t),o=Object.assign({},e,this._size),a=yn(i,t,o),h=xn(t,o,a,i);s._to===h.x&&n._to===h.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let e=this.opacity;if(!e)return;this._updateAnimationTarget(i);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};e=Math.abs(e)<.001?0:e;const r=yi(i.padding);i.enabled&&(this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length)&&(t.save(),t.globalAlpha=e,this.drawBackground(n,t,s,i),Ki(t,i.textDirection),n.y+=r.top,this.drawTitle(n,t,i),this.drawBody(n,t,i),this.drawFooter(n,t,i),Qi(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const e=this._active,s=t.map((({datasetIndex:t,index:i})=>{const e=this.chart.getDatasetMeta(t);if(!e)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:e.data[i],index:i}})),n=!Z(e,s),r=this._positionChanged(s,i);(n||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,e=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],r=this._getActiveElements(t,n,i,e),o=this._positionChanged(r,t),a=i||!Z(r,n)||o;return a&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),a}_getActiveElements(t,i,e,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return i.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const r=this.chart.getElementsAtEventForMode(t,n.mode,n,e);return n.reverse&&r.reverse(),r}_positionChanged(t,i){const{caretX:e,caretY:s,options:n}=this,r=fn[n.position].call(this,t,i);return!1!==r&&(e!==r.x||s!==r.y)}}var Sn={id:"tooltip",_element:On,positioners:fn,afterInit(t,i,e){e&&(t.tooltip=new On({chart:t,options:e}))},beforeUpdate(t,i,e){t.tooltip&&t.tooltip.initialize(e)},reset(t,i,e){t.tooltip&&t.tooltip.initialize(e)},afterDraw(t){const i=t.tooltip;if(i&&i._willRender()){const e={tooltip:i};if(!1===t.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0}))return;i.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e)}},afterEvent(t,i){t.tooltip&&t.tooltip.handleEvent(i.event,i.replay,i.inChartArea)&&(i.changed=!0)},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,i)=>i.bodyFont.size,boxWidth:(t,i)=>i.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:_n},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Rn(t){const i=this.getLabels();return t>=0&&t<i.length?i[t]:t}class Dn extends gs{static id="category";static defaults={ticks:{callback:Rn}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const i=this._addedLabels;if(i.length){const t=this.getLabels();for(const{index:e,label:s}of i)t[e]===s&&t.splice(e,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(N(t))return null;const e=this.getLabels();return((t,i)=>null===t?null:_t(Math.round(t),0,i))(i=isFinite(i)&&e[i]===t?i:function(t,i,e,s){const n=t.indexOf(i);return-1===n?((t,i,e,s)=>("string"==typeof i?(e=t.push(i)-1,s.unshift({index:e,label:i})):isNaN(i)&&(e=null),e))(t,i,e,s):n!==t.lastIndexOf(i)?e:n}(e,t,Y(i,t),this._addedLabels),e.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:e,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(e=0),i||(s=this.getLabels().length-1)),this.min=e,this.max=s}buildTicks(){const t=this.min,i=this.max,e=this.options.offset,s=[];let n=this.getLabels();n=0===t&&i===n.length-1?n:n.slice(t,i+1),this._valueRange=Math.max(n.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let e=t;e<=i;e++)s.push({value:e});return s}getLabelForValue(t){return Rn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function jn(t,i,{horizontal:e,minRotation:s}){const n=xt(s),r=(e?Math.sin(n):Math.cos(n))||.001;return Math.min(i/r,.75*i*(""+t).length)}class Bn extends gs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return N(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this;const r=t=>s=i?s:t,o=t=>n=e?n:t;if(t){const t=gt(s),i=gt(n);t<0&&i<0?o(0):t>0&&i>0&&r(0)}if(s===n){let i=0===n?1:Math.abs(.05*n);o(n+i),t||r(s-i)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let i,{maxTicksLimit:e,stepSize:s}=t;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let e=this.getTickLimit();e=Math.max(2,e);const s=function(t,i){const e=[],{bounds:s,step:n,min:r,max:o,precision:a,count:h,maxTicks:c,maxDigits:l,includeBounds:u}=t,d=n||1,f=c-1,{min:b,max:p}=i,g=!N(r),m=!N(o),v=!N(h),y=(p-b)/(l+1);let x,M,k,w,_=vt((p-b)/f/d)*d;if(_<1e-14&&!g&&!m)return[{value:b},{value:p}];w=Math.ceil(p/_)-Math.floor(b/_),w>f&&(_=vt(w*_/f/d)*d),N(a)||(x=Math.pow(10,a),_=Math.ceil(_*x)/x),"ticks"===s?(M=Math.floor(b/_)*_,k=Math.ceil(p/_)*_):(M=b,k=p),g&&m&&n&&function(t,i){const e=Math.round(t);return e-i<=t&&e+i>=t}((o-r)/n,_/1e3)?(w=Math.round(Math.min((o-r)/_,c)),_=(o-r)/w,M=r,k=o):v?(M=g?r:M,k=m?o:k,w=h-1,_=(k-M)/w):(w=(k-M)/_,w=mt(w,Math.round(w),_/1e3)?Math.round(w):Math.ceil(w));const A=Math.max(Mt(_),Mt(M));x=Math.pow(10,N(a)?A:a),M=Math.round(M*x)/x,k=Math.round(k*x)/x;let O=0;for(g&&(u&&M!==r?(e.push({value:r}),M<r&&O++,mt(Math.round((M+O*_)*x)/x,r,jn(r,y,t))&&O++):M<r&&O++);O<w;++O){const t=Math.round((M+O*_)*x)/x;if(m&&t>o)break;e.push({value:t})}return m&&u&&k!==o?e.length&&mt(e[e.length-1].value,o,jn(o,y,t))?e[e.length-1].value=o:e.push({value:o}):m&&k!==o||e.push({value:k}),e}({maxTicks:e,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,i){let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e].value,isNaN(n)||(i.min=Math.min(i.min,n),i.max=Math.max(i.max,n))}(s,this),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let i=this.min,e=this.max;if(super.configure(),this.options.offset&&t.length){const s=(e-i)/Math.max(t.length-1,1)/2;i-=s,e+=s}this._startValue=i,this._endValue=e,this._valueRange=e-i}getLabelForValue(t){return Yt(t,this.chart.options.locale,this.options.ticks.format)}}class Cn extends Bn{static id="linear";static defaults={ticks:{callback:Xt.formatters.numeric}};determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=H(t)?t:0,this.max=H(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,e=xt(this.options.ticks.minRotation),s=(t?Math.sin(e):Math.cos(e))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const En=class{constructor(i){t(this,i),this.accountId=void 0,this.authToken=void 0,this.data=void 0,this.total=void 0,this.dates=void 0,this.endDate=void 0,this.loading=!0,this.errorMessage=""}updateOnPropChange(){this.fetchData()}connectedCallback(){this.fetchData()}componentDidRender(){this.renderChart()}async fetchData(){if(!this.accountId||!this.authToken)return this.errorMessage="Can not fetch any data without an AccountID and an AuthToken",void(this.loading=!1);this.loading=!0;try{const t=s(this.authToken,a.proxyApiOrigin),i=`account/${this.accountId}/reports/gross_volume`,e=await t.get(i);e.error?(this.errorMessage=`Error trying to fetch data : ${e.error}`,console.error(this.errorMessage)):(this.total=null==e?void 0:e.data.total,this.dates=null==e?void 0:e.data.dates.reverse(),this.endDate=this.dates[this.dates.length-1].date)}catch(t){this.errorMessage=`Error trying to fetch data : ${t}`,console.error(this.errorMessage)}finally{this.loading=!1}}renderChart(){var t,i;this.chart?this.chart.update():this.chartRef&&this.endDate&&(Vs.register(on,we,Js,Dn,Cn,ln,Sn,dn),this.chart=new Vs(this.chartRef.getContext("2d"),(t=this.dates,i=this.endDate,{type:"bar",options:{plugins:{legend:{display:!1},title:{display:!0,text:["Trailing 30 Days","Gross Payments",n(this.total)],position:"top",align:"start"},tooltip:{displayColors:!1,intersect:!1,callbacks:{label:e=>{let s=e.dataIndex;return[r(t[s].date,i),n(t[s].value)]}}}},scales:{x:{grid:{drawOnChartArea:!1,drawTicks:!1},ticks:{callback:e=>{if(0===e||e===t.length-1)return r(t[e].date,i)}}},y:{display:!1}}},data:{labels:t.map((()=>"")),datasets:[{label:"Gross Volume by Date",data:t.map((t=>t.value))}]}})),this.chart.render())}render(){return i(e,null,this.errorMessage?o(this.errorMessage):i("canvas",{id:"chart",ref:t=>this.chartRef=t}))}static get watchers(){return{accountId:["updateOnPropChange"],authToken:["updateOnPropChange"]}}};En.style=':root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33, 37, 41;--bs-body-bg:#fff;--bs-body-bg-rgb:255, 255, 255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0, 0, 0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33, 37, 41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233, 236, 239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33, 37, 41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248, 249, 250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13, 110, 253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10, 88, 202;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222, 226, 230;--bs-body-bg:#212529;--bs-body-bg-rgb:33, 37, 41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255, 255, 255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222, 226, 230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52, 58, 64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222, 226, 230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43, 48, 53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110, 168, 254;--bs-link-hover-color-rgb:139, 185, 254;--bs-code-color:#e685b5;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) }}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:0.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:0.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:0.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:0.25}:host{display:block}';export{En as justifi_gross_payment_chart}
19
+ */class qi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,e,s){const n=i.duration;i.listeners[s].forEach((s=>s({chart:t,initial:i.initial,numSteps:n,currentStep:Math.min(e-i.start,n)})))}_refresh(){this._request||(this._running=!0,this._request=Bt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let i=0;this._charts.forEach(((e,s)=>{if(!e.running||!e.items.length)return;const n=e.items;let r,o=n.length-1,a=!1;for(;o>=0;--o)r=n[o],r._active?(r._total>e.duration&&(e.duration=r._total),r.tick(t),a=!0):(n[o]=n[n.length-1],n.pop());a&&(s.draw(),this._notify(s,e,t,"progress")),n.length||(e.running=!1,this._notify(s,e,t,"complete"),e.initial=!1),i+=n.length})),this._lastDate=t,0===i&&(this._running=!1)}_getAnims(t){const i=this._charts;let e=i.get(t);return e||(e={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,e)),e}listen(t,i,e){this._getAnims(t).listeners[i].push(e)}add(t,i){i&&i.length&&this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce(((t,i)=>Math.max(t,i._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!!(i&&i.running&&i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const e=i.items;let s=e.length-1;for(;s>=0;--s)e[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ji=new qi;const te="transparent",ie={boolean:(t,i,e)=>e>.5?i:t,color(t,i,e){const s=Nt(t||te),n=s.valid&&Nt(i||te);return n&&n.valid?n.mix(s,e).hexString():i},number:(t,i,e)=>t+(i-t)*e};class ee{constructor(t,i,e,s){const n=i[e];s=Mi([t.to,s,n,t.from]);const r=Mi([t.from,n,s]);this._active=!0,this._fn=t.fn||ie[t.type||typeof r],this._easing=Ft[t.easing]||Ft.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=e,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,e){if(this._active){this._notify(!1);const s=this._target[this._prop],n=e-this._start,r=this._duration-n;this._start=e,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Mi([t.to,i,s,t.from]),this._from=Mi([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,e=this._duration,s=this._prop,n=this._from,r=this._loop,o=this._to;let a;if(this._active=n!==o&&(r||i<e),!this._active)return this._target[s]=o,void this._notify(!0);i<0?this._target[s]=n:(a=i/e%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(n,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((i,e)=>{t.push({res:i,rej:e})}))}_notify(t){const i=t?"res":"rej",e=this._promises||[];for(let t=0;t<e.length;t++)e[t][i]()}}class se{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!$(t))return;const i=Object.keys(Jt.animation),e=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const n=t[s];if(!$(n))return;const r={};for(const t of i)r[t]=n[t];(W(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,i){const e=i.options,s=function(t,i){if(!i)return;let e=t.options;if(e)return e.$shared&&(t.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e;t.options=i}(t,e);if(!s)return[];const n=this._createAnimations(s,e);return e.$shared&&function(t,i){const e=[],s=Object.keys(i);for(let i=0;i<s.length;i++){const n=t[s[i]];n&&n.active()&&e.push(n.wait())}return Promise.all(e)}(t.options.$animations,e).then((()=>{t.options=e}),(()=>{})),n}_createAnimations(t,i){const e=this._properties,s=[],n=t.$animations||(t.$animations={}),r=Object.keys(i),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const h=r[a];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,i));continue}const c=i[h];let l=n[h];const u=e.get(h);if(l){if(u&&l.active()){l.update(u,c,o);continue}l.cancel()}u&&u.duration?(n[h]=l=new ee(u,t,h,c),s.push(l)):t[h]=c}return s}update(t,i){if(0===this._properties.size)return void Object.assign(t,i);const e=this._createAnimations(t,i);return e.length?(Ji.add(this._chart,e),!0):void 0}}function ne(t,i){const e=t&&t.options||{},s=e.reverse,n=void 0===e.min?i:0,r=void 0===e.max?i:0;return{start:s?r:n,end:s?n:r}}function re(t,i){const e=[],s=t._getSortedDatasetMetas(i);let n,r;for(n=0,r=s.length;n<r;++n)e.push(s[n].index);return e}function oe(t,i,e,s={}){const n=t.keys,r="single"===s.mode;let o,a,h,c;if(null!==i){for(o=0,a=n.length;o<a;++o){if(h=+n[o],h===e){if(s.all)continue;break}c=t.values[h],H(c)&&(r||0===i||gt(i)===gt(c))&&(i+=c)}return i}}function ae(t,i){const e=t&&t.options.stacked;return e||void 0===e&&void 0!==i.stack}function he(t,i,e){const s=t[i]||(t[i]={});return s[e]||(s[e]={})}function ce(t,i,e,s){for(const n of i.getMatchingVisibleMetas(s).reverse()){const i=t[n.index];if(e&&i>0||!e&&i<0)return n.index}return null}function le(t,i){const{chart:e,_cachedMeta:s}=t,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=s,h=r.axis,c=o.axis,l=function(t,i,e){return`${t.id}.${i.id}.${e.stack||e.type}`}(r,o,s),u=i.length;let d;for(let t=0;t<u;++t){const e=i[t],{[h]:r,[c]:u}=e;d=(e._stacks||(e._stacks={}))[c]=he(n,l,r),d[a]=u,d._top=ce(d,o,!0,s.type),d._bottom=ce(d,o,!1,s.type),(d._visualValues||(d._visualValues={}))[a]=u}}function ue(t,i){const e=t.scales;return Object.keys(e).filter((t=>e[t].axis===i)).shift()}function de(t,i){const e=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){i=i||t._parsed;for(const t of i){const i=t._stacks;if(!i||void 0===i[s]||void 0===i[s][e])return;delete i[s][e],void 0!==i[s]._visualValues&&void 0!==i[s]._visualValues[e]&&delete i[s]._visualValues[e]}}}const fe=t=>"reset"===t||"none"===t,be=(t,i)=>i?t:Object.assign({},t);class pe{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ae(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&de(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,e=this.getDataset(),s=(t,i,e,s)=>"x"===t?i:"r"===t?s:e,n=i.xAxisID=Y(e.xAxisID,ue(t,"x")),r=i.yAxisID=Y(e.yAxisID,ue(t,"y")),o=i.rAxisID=Y(e.rAxisID,ue(t,"r")),a=i.indexAxis,h=i.iAxisID=s(a,n,r,o),c=i.vAxisID=s(a,r,n,o);i.xScale=this.getScaleForId(n),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(o),i.iScale=this.getScaleForId(h),i.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&jt(this._data,this),t._stacked&&de(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),e=this._data;if($(i))this._data=function(t){const i=Object.keys(t),e=new Array(i.length);let s,n,r;for(s=0,n=i.length;s<n;++s)r=i[s],e[s]={x:r,y:t[r]};return e}(i);else if(e!==i){if(e){jt(e,this);const t=this._cachedMeta;de(t),t._parsed=[]}i&&Object.isExtensible(i)&&(this,(s=i)._chartjs?s._chartjs.listeners.push(this):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Dt.forEach((t=>{const i="_onData"+nt(t),e=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=e.apply(this,t);return s._chartjs.listeners.forEach((e=>{"function"==typeof e[i]&&e[i](...t)})),n}})})))),this._syncList=[],this._data=i}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,e=this.getDataset();let s=!1;this._dataCheck();const n=i._stacked;i._stacked=ae(i.vScale,i),i.stack!==e.stack&&(s=!0,de(i),i.stack=e.stack),this._resyncElements(t),(s||n!==i._stacked)&&le(this,i._parsed)}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:e,_data:s}=this,{iScale:n,_stacked:r}=e,o=n.axis;let a,h,c,l=0===t&&i===s.length||e._sorted,u=t>0&&e._parsed[t-1];if(!1===this._parsing)e._parsed=s,e._sorted=!0,c=s;else{c=W(s[t])?this.parseArrayData(e,s,t,i):$(s[t])?this.parseObjectData(e,s,t,i):this.parsePrimitiveData(e,s,t,i);const n=()=>null===h[o]||u&&h[o]<u[o];for(a=0;a<i;++a)e._parsed[a+t]=h=c[a],l&&(n()&&(l=!1),u=h);e._sorted=l}r&&le(this,c)}parsePrimitiveData(t,i,e,s){const{iScale:n,vScale:r}=t,o=n.axis,a=r.axis,h=n.getLabels(),c=n===r,l=new Array(s);let u,d,f;for(u=0,d=s;u<d;++u)f=u+e,l[u]={[o]:c||n.parse(h[f],f),[a]:r.parse(i[f],f)};return l}parseArrayData(t,i,e,s){const{xScale:n,yScale:r}=t,o=new Array(s);let a,h,c,l;for(a=0,h=s;a<h;++a)c=a+e,l=i[c],o[a]={x:n.parse(l[0],c),y:r.parse(l[1],c)};return o}parseObjectData(t,i,e,s){const{xScale:n,yScale:r}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,h=new Array(s);let c,l,u,d;for(c=0,l=s;c<l;++c)u=c+e,d=i[u],h[c]={x:n.parse(st(d,o),u),y:r.parse(st(d,a),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,e){const s=this._cachedMeta,n=i[t.axis];return oe({keys:re(this.chart,!0),values:i._stacks[t.axis]._visualValues},n,s.index,{mode:e})}updateRangeFromParsed(t,i,e,s){const n=e[i.axis];let r=null===n?NaN:n;const o=s&&e._stacks[i.axis];s&&o&&(s.values=o,r=oe(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){const e=this._cachedMeta,s=e._parsed,n=e._sorted&&t===e.iScale,r=s.length,o=this._getOtherScale(t),a=((t,i)=>t&&!i.hidden&&i._stacked&&{keys:re(this.chart,!0),values:null})(i,e),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:l}=function(t){const{min:i,max:e,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?i:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}(o);let u,d;function f(){d=s[u];const i=d[o.axis];return!H(d[t.axis])||c>i||l<i}for(u=0;u<r&&(f()||(this.updateRangeFromParsed(h,t,d,a),!n));++u);if(n)for(u=r-1;u>=0;--u)if(!f()){this.updateRangeFromParsed(h,t,d,a);break}return h}getAllParsedValues(t){const i=this._cachedMeta._parsed,e=[];let s,n,r;for(s=0,n=i.length;s<n;++s)r=i[s][t.axis],H(r)&&e.push(r);return e}getMaxOverflow(){return!1}getLabelAndValue(t){const i=this._cachedMeta,e=i.iScale,s=i.vScale,n=this.getParsed(t);return{label:e?""+e.getLabelForValue(n[e.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const i=this._cachedMeta;this.update(t||"default"),i._clip=function(t){let i,e,s,n;return $(t)?(i=t.top,e=t.right,s=t.bottom,n=t.left):i=e=s=n=t,{top:i,right:e,bottom:s,left:n,disabled:!1===t}}(Y(this.options.clip,function(t,i,e){if(!1===e)return!1;const s=ne(t,e),n=ne(i,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this._cachedMeta,e=i.data||[],s=this.chart.chartArea,n=[],r=this._drawStart||0,o=this._drawCount||e.length-r,a=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,r,o),h=r;h<r+o;++h){const i=e[h];i.hidden||(i.active&&a?n.push(i):i.draw(t,s))}for(h=0;h<n.length;++h)n[h].draw(t,s)}getStyle(t,i){const e=i?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,i,e){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];n=i.$context||(i.$context=function(t,i,e){return ki(t,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:e,index:i,mode:"default",type:"data"})}(this.getContext(),t,i)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,i){return ki(t,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!i,n.mode=e,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",e){const s="active"===i,n=this._cachedDataOpts,r=t+"-"+i,o=n[r],a=this.enableOptionSharing&&rt(e);if(o)return be(o,a);const h=this.chart.config,c=h.datasetElementScopeKeys(this._type,t),l=s?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),c),d=Object.keys(Jt.elements[t]),f=h.resolveNamedOptions(u,d,(()=>this.getContext(e,s,i)),l);return f.$shared&&(f.$shared=a,n[r]=Object.freeze(be(f,a))),f}_resolveAnimations(t,i,e){const s=this.chart,n=this._cachedDataOpts,r=`animation-${i}`,o=n[r];if(o)return o;let a;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,i),r=s.getOptionScopes(this.getDataset(),n);a=s.createResolver(r,this.getContext(t,e,i))}const h=new se(s,a&&a.animations);return a&&a._cacheable&&(n[r]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||fe(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const e=this.resolveDataElementOptions(t,i),s=this._sharedOptions,n=this.getSharedOptions(e),r=this.includeOptions(i,n)||n!==s;return this.updateSharedOptions(n,i,e),{sharedOptions:n,includeOptions:r}}updateElement(t,i,e,s){fe(s)?Object.assign(t,e):this._resolveAnimations(i,s).update(t,e)}updateSharedOptions(t,i,e){t&&!fe(i)&&this._resolveAnimations(void 0,i).update(t,e)}_setStyle(t,i,e,s){t.active=s;const n=this.getStyle(i,s);this._resolveAnimations(i,e,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,i,e){this._setStyle(t,e,"active",!1)}setHoverStyle(t,i,e){this._setStyle(t,e,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,e=this._cachedMeta.data;for(const[t,i,e]of this._syncList)this[t](i,e);this._syncList=[];const s=e.length,n=i.length,r=Math.min(n,s);r&&this.parse(0,r),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,i,e=!0){const s=this._cachedMeta,n=s.data,r=t+i;let o;const a=t=>{for(t.length+=i,o=t.length-1;o>=r;o--)t[o]=t[o-i]};for(a(n),o=t;o<r;++o)n[o]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(t,i),e&&this.updateElements(n,t,i,"reset")}updateElements(t,i,e,s){}_removeElements(t,i){const e=this._cachedMeta;if(this._parsing){const s=e._parsed.splice(t,i);e._stacked&&de(e,s)}e.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[i,e,s]=t;this[i](e,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);const e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ge(t,i,e,s){return W(t)?function(t,i,e,s){const n=e.parse(t[0],s),r=e.parse(t[1],s),o=Math.min(n,r),a=Math.max(n,r);let h=o,c=a;Math.abs(o)>Math.abs(a)&&(h=a,c=o),i[e.axis]=c,i._custom={barStart:h,barEnd:c,start:n,end:r,min:o,max:a}}(t,i,e,s):i[e.axis]=e.parse(t,s),i}function me(t,i,e,s){const n=t.iScale,r=t.vScale,o=n.getLabels(),a=n===r,h=[];let c,l,u,d;for(c=e,l=e+s;c<l;++c)d=i[c],u={},u[n.axis]=a||n.parse(o[c],c),h.push(ge(d,u,r,c));return h}function ve(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function ye(t,i,e,s){let n=i.borderSkipped;const r={};if(!n)return void(t.borderSkipped=r);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:h,top:c,bottom:l}=function(t){let i,e,s,n,r;return t.horizontal?(i=t.base>t.x,e="left",s="right"):(i=t.base<t.y,e="bottom",s="top"),i?(n="end",r="start"):(n="start",r="end"),{start:e,end:s,reverse:i,top:n,bottom:r}}(t);"middle"===n&&e&&(t.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=l:(r[xe(l,o,a,h)]=!0,n=c)),r[xe(n,o,a,h)]=!0,t.borderSkipped=r}function xe(t,i,e,s){var n,r,o;return s?(o=e,t=Me(t=(n=t)===(r=i)?o:n===o?r:n,e,i)):t=Me(t,i,e),t}function Me(t,i,e){return"start"===t?i:"end"===t?e:t}function ke(t,{inflateAmount:i},e){t.inflateAmount="auto"===i?1===e?.33:0:i}class we extends pe{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,i,e,s){return me(t,i,e,s)}parseArrayData(t,i,e,s){return me(t,i,e,s)}parseObjectData(t,i,e,s){const{iScale:n,vScale:r}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,h="x"===n.axis?o:a,c="x"===r.axis?o:a,l=[];let u,d,f,b;for(u=e,d=e+s;u<d;++u)b=i[u],f={},f[n.axis]=n.parse(st(b,h),u),l.push(ge(st(b,c),f,r,u));return l}updateRangeFromParsed(t,i,e,s){super.updateRangeFromParsed(t,i,e,s);const n=e._custom;n&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const i=this._cachedMeta,{iScale:e,vScale:s}=i,n=this.getParsed(t),r=n._custom,o=ve(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+e.getLabelForValue(n[e.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,e,s){const n="reset"===s,{index:r,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),h=o.isHorizontal(),c=this._getRuler(),{sharedOptions:l,includeOptions:u}=this._getSharedOptions(i,s);for(let d=i;d<i+e;d++){const i=this.getParsed(d),e=n||N(i[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(d),f=this._calculateBarIndexPixels(d,c),b=(i._stacks||{})[o.axis],p={horizontal:h,base:e.base,enableBorderRadius:!b||ve(i._custom)||r===b._top||r===b._bottom,x:h?e.head:f.center,y:h?f.center:e.head,height:h?f.size:Math.abs(e.size),width:h?Math.abs(e.size):f.size};u&&(p.options=l||this.resolveDataElementOptions(d,t[d].active?"active":s));const g=p.options||t[d].options;ye(p,g,b,r),ke(p,g,c.ratio),this.updateElement(t[d],d,p,s)}}_getStacks(t,i){const{iScale:e}=this._cachedMeta,s=e.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),n=e.options.stacked,r=[],o=t=>{const e=t.controller.getParsed(i),s=e&&e[t.vScale.axis];if(N(s)||isNaN(s))return!0};for(const e of s)if((void 0===i||!o(e))&&((!1===n||-1===r.indexOf(e.stack)||void 0===n&&void 0===e.stack)&&r.push(e.stack),e.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,i,e){const s=this._getStacks(t,e),n=void 0!==i?s.indexOf(i):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,i=this._cachedMeta,e=i.iScale,s=[];let n,r;for(n=0,r=i.data.length;n<r;++n)s.push(e.getPixelForValue(this.getParsed(n)[e.axis],n));const o=t.barThickness,a=o||function(t){const i=t.iScale,e=function(t,i){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas(i);let s=[];for(let i=0,n=e.length;i<n;i++)s=s.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=function(t){const i=new Set(t);return i.size===t.length?t:Array.from(i)}(s.sort(((t,i)=>t-i)))}return t._cache.$bar}(i,t.type);let s,n,r,o,a=i._length;const h=()=>{32767!==r&&-32768!==r&&(rt(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(s=0,n=e.length;s<n;++s)r=i.getPixelForValue(e[s]),h();for(o=void 0,s=0,n=i.ticks.length;s<n;++s)r=i.getPixelForTick(s),h();return a}(i);return{min:a,pixels:s,start:e._startPixel,end:e._endPixel,stackCount:this._getStackCount(),scale:e,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:i,_stacked:e,index:s},options:{base:n,minBarLength:r}}=this,o=n||0,a=this.getParsed(t),h=a._custom,c=ve(h);let l,u,d=a[i.axis],f=0,b=e?this.applyStack(i,a,e):d;b!==d&&(f=b-d,b=d),c&&(d=h.barStart,b=h.barEnd-h.barStart,0!==d&&gt(d)!==gt(h.barEnd)&&(f=0),f+=d);const p=N(n)||c?f:n;let g=i.getPixelForValue(p);if(l=this.chart.getDataVisibility(t)?i.getPixelForValue(f+b):g,u=l-g,Math.abs(u)<r){u=function(t,i,e){return 0!==t?gt(t):(i.isHorizontal()?1:-1)*(i.min>=e?1:-1)}(u,i,o)*r,d===o&&(g-=u/2);const t=i.getPixelForDecimal(0),n=i.getPixelForDecimal(1),h=Math.min(t,n),f=Math.max(t,n);g=Math.max(Math.min(g,f),h),l=g+u,e&&!c&&(a._stacks[i.axis]._visualValues[s]=i.getValueForPixel(l)-i.getValueForPixel(g))}if(g===i.getPixelForValue(o)){const t=gt(u)*i.getLineWidthForValue(o)/2;g+=t,u-=t}return{size:u,base:g,head:l,center:l+u/2}}_calculateBarIndexPixels(t,i){const e=i.scale,s=this.options,n=s.skipNull,r=Y(s.maxBarThickness,1/0);let o,a;if(i.grouped){const e=n?this._getStackCount(t):i.stackCount,h="flex"===s.barThickness?function(t,i,e,s){const n=i.pixels,r=n[t];let o=t>0?n[t-1]:null,a=t<n.length-1?n[t+1]:null;const h=e.categoryPercentage;null===o&&(o=r-(null===a?i.end-i.start:a-r)),null===a&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*h;return{chunk:Math.abs(a-o)/2*h/s,ratio:e.barPercentage,start:c}}(t,i,s,e):function(t,i,e,s){const n=e.barThickness;let r,o;return N(n)?(r=i.min*e.categoryPercentage,o=e.barPercentage):(r=n*s,o=1),{chunk:r/s,ratio:o,start:i.pixels[t]-r/2}}(t,i,s,e),c=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0);o=h.start+h.chunk*c+h.chunk/2,a=Math.min(r,h.chunk*h.ratio)}else o=e.getPixelForValue(this.getParsed(t)[e.axis],t),a=Math.min(r,i.min*i.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const t=this._cachedMeta,i=t.vScale,e=t.data,s=e.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[i.axis]&&e[n].draw(this._ctx)}}class _e extends pe{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:e,color:s}}=t.legend.options;return i.labels.map(((i,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:e,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}}};constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){const e=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=e;else{let n,r,o=t=>+e[t];if($(e[t])){const{key:t="value"}=this._parsing;o=i=>+st(e[i],t)}for(n=t,r=t+i;n<r;++n)s._parsed[n]=o(n)}}_getRotation(){return xt(this.options.rotation-90)}_getCircumference(){return xt(this.options.circumference)}_getRotationExtents(){let t=ct,i=-ct;for(let e=0;e<this.chart.data.datasets.length;++e)if(this.chart.isDatasetVisible(e)&&this.chart.getDatasetMeta(e).type===this._type){const s=this.chart.getDatasetMeta(e).controller,n=s._getRotation(),r=s._getCircumference();t=Math.min(t,n),i=Math.max(i,n+r)}return{rotation:t,circumference:i-t}}update(t){const i=this.chart,{chartArea:e}=i,s=this._cachedMeta,n=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(e.width,e.height)-r)/2,0),a=Math.min((c=o,"string"==typeof(h=this.options.cutout)&&h.endsWith("%")?parseFloat(h)/100:+h/c),1);var h,c;const l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:b,offsetX:p,offsetY:g}=function(t,i,e){let s=1,n=1,r=0,o=0;if(i<ct){const a=t,h=a+i,c=Math.cos(a),l=Math.sin(a),u=Math.cos(h),d=Math.sin(h),f=(t,i,s)=>wt(t,a,h,!0)?1:Math.max(i,i*e,s,s*e),b=(t,i,s)=>wt(t,a,h,!0)?-1:Math.min(i,i*e,s,s*e),p=f(0,c,u),g=f(dt,l,d),m=b(ht,c,u),v=b(ht+dt,l,d);s=(p-m)/2,n=(g-v)/2,r=-(p+m)/2,o=-(g+v)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}(d,u,a),m=Math.max(Math.min((e.width-r)/f,(e.height-r)/b)/2,0),v=V(this.options.radius,m),y=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=g*v,s.total=this.calculateTotal(),this.outerRadius=v-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,i){const e=this.options,s=this._cachedMeta,n=this._getCircumference();return i&&e.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/ct)}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.chartArea,a=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=n&&r.options.animation.animateScale,l=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(i,s);let b,p=this._getRotation();for(b=0;b<i;++b)p+=this._circumference(b,n);for(b=i;b<i+e;++b){const i=this._circumference(b,n),e=t[b],r={x:a+this.offsetX,y:h+this.offsetY,startAngle:p,endAngle:p+i,circumference:i,outerRadius:u,innerRadius:l};f&&(r.options=d||this.resolveDataElementOptions(b,e.active?"active":s)),p+=i,this.updateElement(e,b,r,s)}}calculateTotal(){const t=this._cachedMeta,i=t.data;let e,s=0;for(e=0;e<i.length;e++){const n=t._parsed[e];null===n||isNaN(n)||!this.chart.getDataVisibility(e)||i[e].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const i=this._cachedMeta.total;return i>0&&!isNaN(t)?ct*(Math.abs(t)/i):0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Yt(this._cachedMeta._parsed[t],i.options.locale);return{label:e[t]||"",value:s}}getMaxBorderWidth(t){let i=0;const e=this.chart;let s,n,r,o,a;if(!t)for(s=0,n=e.data.datasets.length;s<n;++s)if(e.isDatasetVisible(s)){r=e.getDatasetMeta(s),t=r.data,o=r.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)a=o.resolveDataElementOptions(s),"inner"!==a.borderAlign&&(i=Math.max(i,a.borderWidth||0,a.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let e=0,s=t.length;e<s;++e){const t=this.resolveDataElementOptions(e);i=Math.max(i,t.offset||0,t.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let e=0;e<t;++e)this.chart.isDatasetVisible(e)&&(i+=this._getRingWeight(e));return i}_getRingWeight(t){return Math.max(Y(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Ae extends pe{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:e,color:s}}=t.legend.options;return i.labels.map(((i,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:e,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Yt(this._cachedMeta._parsed[t].r,i.options.locale);return{label:e[t]||"",value:s}}parseObjectData(t,i,e,s){return Ii.bind(this)(t,i,e,s)}update(t){const i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){const t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return this._cachedMeta.data.forEach(((i,e)=>{const s=this.getParsed(e).r;!isNaN(s)&&this.chart.getDataVisibility(e)&&(s<t.min&&(t.min=s),s>t.max&&(t.max=s))})),t}_updateRadius(){const t=this.chart,i=t.chartArea,e=t.options,s=Math.min(i.right-i.left,i.bottom-i.top),n=Math.max(s/2,0),r=(n-Math.max(e.cutoutPercentage?n/100*e.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.options.animation,a=this._cachedMeta.rScale,h=a.xCenter,c=a.yCenter,l=a.getIndexAngle(0)-.5*ht;let u,d=l;const f=360/this.countVisibleElements();for(u=0;u<i;++u)d+=this._computeAngle(u,s,f);for(u=i;u<i+e;u++){const i=t[u];let e=d,b=d+this._computeAngle(u,s,f),p=r.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;d=b,n&&(o.animateScale&&(p=0),o.animateRotate&&(e=b=l));const g={x:h,y:c,innerRadius:0,outerRadius:p,startAngle:e,endAngle:b,options:this.resolveDataElementOptions(u,i.active?"active":s)};this.updateElement(i,u,g,s)}}countVisibleElements(){let t=0;return this._cachedMeta.data.forEach(((i,e)=>{!isNaN(this.getParsed(e).r)&&this.chart.getDataVisibility(e)&&t++})),t}_computeAngle(t,i,e){return this.chart.getDataVisibility(t)?xt(this.resolveDataElementOptions(t,i).angle||e):0}}function Oe(t,i,e,s){const{controller:n,data:r,_sorted:o}=t,a=n._cachedMeta.iScale;if(a&&i===a.axis&&"r"!==i&&o&&r.length){const t=a._reversePixels?Rt:St;if(!s)return t(r,i,e);if(n._sharedOptions){const s=r[0],n="function"==typeof s.getRange&&s.getRange(i);if(n){const s=t(r,i,e-n),o=t(r,i,e+n);return{lo:s.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Se(t,i,e,s,n){const r=t.getSortedVisibleDatasetMetas(),o=e[i];for(let t=0,e=r.length;t<e;++t){const{index:e,data:a}=r[t],{lo:h,hi:c}=Oe(r[t],i,o,n);for(let t=h;t<=c;++t){const i=a[t];i.skip||s(i,e,t)}}}function Re(t,i,e,s,n){const r=[];return n||t.isPointInArea(i)?(Se(t,e,i,(function(e,o,a){(n||ri(e,t.chartArea,0))&&e.inRange(i.x,i.y,s)&&r.push({element:e,datasetIndex:o,index:a})}),!0),r):r}function De(t,i,e,s,n,r){return r||t.isPointInArea(i)?"r"!==e||s?function(t,i,e,s,n,r){let o=[];const a=function(t){const i=-1!==t.indexOf("x"),e=-1!==t.indexOf("y");return function(t,s){const n=i?Math.abs(t.x-s.x):0,r=e?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}}(e);let h=Number.POSITIVE_INFINITY;return Se(t,e,i,(function(e,c,l){const u=e.inRange(i.x,i.y,n);if(s&&!u)return;const d=e.getCenterPoint(n);if(!r&&!t.isPointInArea(d)&&!u)return;const f=a(i,d);f<h?(o=[{element:e,datasetIndex:c,index:l}],h=f):f===h&&o.push({element:e,datasetIndex:c,index:l})})),o}(t,i,e,s,n,r):function(t,i,e,s){let n=[];return Se(t,e,i,(function(t,e,r){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],s),{angle:h}=function(t,i){const e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s);let r=Math.atan2(s,e);return r<-.5*ht&&(r+=ct),{angle:r,distance:n}}(t,{x:i.x,y:i.y});wt(h,o,a)&&n.push({element:t,datasetIndex:e,index:r})})),n}(t,i,e,n):[]}function je(t,i,e,s,n){const r=[],o="x"===e?"inXRange":"inYRange";let a=!1;return Se(t,e,i,((t,s,h)=>{t[o](i[e],n)&&(r.push({element:t,datasetIndex:s,index:h}),a=a||t.inRange(i.x,i.y,n))})),s&&!a?[]:r}var Be={evaluateInteractionItems:Se,modes:{index(t,i,e,s){const n=Gi(i,t),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Re(t,n,r,s,o):De(t,n,r,!1,s,o),h=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const i=a[0].index,e=t.data[i];e&&!e.skip&&h.push({element:e,datasetIndex:t.index,index:i})})),h):[]},dataset(t,i,e,s){const n=Gi(i,t),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Re(t,n,r,s,o):De(t,n,r,!1,s,o);if(a.length>0){const i=a[0].datasetIndex,e=t.getDatasetMeta(i).data;a=[];for(let t=0;t<e.length;++t)a.push({element:e[t],datasetIndex:i,index:t})}return a},point:(t,i,e,s)=>Re(t,Gi(i,t),e.axis||"xy",s,e.includeInvisible||!1),nearest:(t,i,e,s)=>De(t,Gi(i,t),e.axis||"xy",e.intersect,s,e.includeInvisible||!1),x:(t,i,e,s)=>je(t,Gi(i,t),"x",e.intersect,s),y:(t,i,e,s)=>je(t,Gi(i,t),"y",e.intersect,s)}};const Ce=["left","top","right","bottom"];function Ee(t,i){return t.filter((t=>t.pos===i))}function Le(t,i){return t.filter((t=>-1===Ce.indexOf(t.pos)&&t.box.axis===i))}function Pe(t,i){return t.sort(((t,e)=>{const s=i?e:t,n=i?t:e;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Ie(t,i,e,s){return Math.max(t[e],i[e])+Math.max(t[s],i[s])}function Te(t,i){t.top=Math.max(t.top,i.top),t.left=Math.max(t.left,i.left),t.bottom=Math.max(t.bottom,i.bottom),t.right=Math.max(t.right,i.right)}function Fe(t,i,e,s){const{pos:n,box:r}=e,o=t.maxPadding;if(!$(n)){e.size&&(t[n]-=e.size);const i=s[e.stack]||{size:0,count:1};i.size=Math.max(i.size,e.horizontal?r.height:r.width),e.size=i.size/i.count,t[n]+=e.size}r.getPadding&&Te(o,r.getPadding());const a=Math.max(0,i.outerWidth-Ie(o,t,"left","right")),h=Math.max(0,i.outerHeight-Ie(o,t,"top","bottom")),c=a!==t.w,l=h!==t.h;return t.w=a,t.h=h,e.horizontal?{same:c,other:l}:{same:l,other:c}}function ze(t,i){const e=i.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(i[t],e[t])})),s}(t?["left","right"]:["top","bottom"])}function Ne(t,i,e,s){const n=[];let r,o,a,h,c,l;for(r=0,o=t.length,c=0;r<o;++r){a=t[r],h=a.box,h.update(a.width||i.w,a.height||i.h,ze(a.horizontal,i));const{same:o,other:u}=Fe(i,e,a,s);c|=o&&n.length,l=l||u,h.fullSize||n.push(a)}return c&&Ne(n,i,e,s)||l}function We(t,i,e,s,n){t.top=e,t.left=i,t.right=i+s,t.bottom=e+n,t.width=s,t.height=n}function $e(t,i,e,s){const n=e.padding;let{x:r,y:o}=i;for(const a of t){const t=a.box,h=s[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/h.weight||1;if(a.horizontal){const s=i.w*c,r=h.size||t.height;rt(h.start)&&(o=h.start),t.fullSize?We(t,n.left,o,e.outerWidth-n.right-n.left,r):We(t,i.left+h.placed,o,s,r),h.start=o,h.placed+=s,o=t.bottom}else{const s=i.h*c,o=h.size||t.width;rt(h.start)&&(r=h.start),t.fullSize?We(t,r,n.top,o,e.outerHeight-n.bottom-n.top):We(t,r,i.top+h.placed,o,s),h.start=r,h.placed+=s,r=t.right}}i.x=r,i.y=o}var He={addBox(t,i){t.boxes||(t.boxes=[]),i.fullSize=i.fullSize||!1,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t)}}]},t.boxes.push(i)},removeBox(t,i){const e=t.boxes?t.boxes.indexOf(i):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,i,e){i.fullSize=e.fullSize,i.position=e.position,i.weight=e.weight},update(t,i,e,s){if(!t)return;const n=yi(t.options.layout.padding),r=Math.max(i-n.width,0),o=Math.max(e-n.height,0),a=function(t){const i=function(t){const i=[];let e,s,n,r,o,a;for(e=0,s=(t||[]).length;e<s;++e)n=t[e],({position:r,options:{stack:o,stackWeight:a=1}}=n),i.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:a});return i}(t),e=Pe(i.filter((t=>t.box.fullSize)),!0),s=Pe(Ee(i,"left"),!0),n=Pe(Ee(i,"right")),r=Pe(Ee(i,"top"),!0),o=Pe(Ee(i,"bottom")),a=Le(i,"x"),h=Le(i,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(h).concat(o).concat(a),chartArea:Ee(i,"chartArea"),vertical:s.concat(n).concat(h),horizontal:r.concat(o).concat(a)}}(t.boxes),h=a.vertical,c=a.horizontal;U(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const l=h.reduce(((t,i)=>i.box.options&&!1===i.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:i,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/l,hBoxMaxHeight:o/2}),d=Object.assign({},n);Te(d,yi(s));const f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),b=function(t,i){const e=function(t){const i={};for(const e of t){const{stack:t,pos:s,stackWeight:n}=e;if(!t||!Ce.includes(s))continue;const r=i[t]||(i[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=n}return i}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=i;let r,o,a;for(r=0,o=t.length;r<o;++r){a=t[r];const{fullSize:o}=a.box,h=e[a.stack],c=h&&a.stackWeight/h.weight;a.horizontal?(a.width=c?c*s:o&&i.availableWidth,a.height=n):(a.width=s,a.height=c?c*n:o&&i.availableHeight)}return e}(h.concat(c),u);Ne(a.fullSize,f,u,b),Ne(h,f,u,b),Ne(c,f,u,b)&&Ne(h,f,u,b),function(t){const i=t.maxPadding;function e(e){const s=Math.max(i[e]-t[e],0);return t[e]+=s,s}t.y+=e("top"),t.x+=e("left"),e("right"),e("bottom")}(f),$e(a.leftAndTop,f,u,b),f.x+=f.w,f.y+=f.h,$e(a.rightAndBottom,f,u,b),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},U(a.chartArea,(i=>{const e=i.box;Object.assign(e,t.chartArea),e.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Ge{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,e){}removeEventListener(t,i,e){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,e,s){return i=Math.max(0,i||t.width),e=e||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):e)}}isAttached(t){return!0}updateConfig(t){}}class Ye extends Ge{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ve="$chartjs",Xe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ue=t=>null===t||""===t,Ze=!!Xi&&{passive:!0};function Ke(t,i,e){t.canvas.removeEventListener(i,e,Ze)}function Qe(t,i){for(const e of t)if(e===i||e.contains(i))return!0}function qe(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Qe(e.addedNodes,s),i=i&&!Qe(e.removedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Je(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Qe(e.removedNodes,s),i=i&&!Qe(e.addedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}const ts=new Map;let is=0;function es(){const t=window.devicePixelRatio;t!==is&&(is=t,ts.forEach(((i,e)=>{e.currentDevicePixelRatio!==t&&i()})))}function ss(t,i,e){const s=t.canvas,n=s&&Fi(s);if(!n)return;const r=Ct(((t,i)=>{const s=n.clientWidth;e(t,i),s<n.clientWidth&&e()}),window),o=new ResizeObserver((t=>{const i=t[0],e=i.contentRect.width,s=i.contentRect.height;0===e&&0===s||r(e,s)}));return o.observe(n),function(t,i){ts.size||window.addEventListener("resize",es),ts.set(t,i)}(t,r),o}function ns(t,i,e){e&&e.disconnect(),"resize"===i&&function(t){ts.delete(t),ts.size||window.removeEventListener("resize",es)}(t)}function rs(t,i,e){const s=t.canvas,n=Ct((i=>{null!==t.ctx&&e(function(t,i){const e=Xe[t.type]||t.type,{x:s,y:n}=Gi(t,i);return{type:e,chart:i,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(i,t))}),t);return function(t,i,e){t.addEventListener(i,e,Ze)}(s,i,n),n}class os extends Ge{acquireContext(t,i){const e=t&&t.getContext&&t.getContext("2d");return e&&e.canvas===t?(function(t,i){const e=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[Ve]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ue(n)){const i=Ui(t,"width");void 0!==i&&(t.width=i)}if(Ue(s))if(""===t.style.height)t.height=t.width/(i||2);else{const i=Ui(t,"height");void 0!==i&&(t.height=i)}}(t,i),e):null}releaseContext(t){const i=t.canvas;if(!i[Ve])return!1;const e=i[Ve].initial;["height","width"].forEach((t=>{const s=e[t];N(s)?i.removeAttribute(t):i.setAttribute(t,s)}));const s=e.style||{};return Object.keys(s).forEach((t=>{i.style[t]=s[t]})),i.width=i.width,delete i[Ve],!0}addEventListener(t,i,e){this.removeEventListener(t,i),(t.$proxies||(t.$proxies={}))[i]=({attach:qe,detach:Je,resize:ss}[i]||rs)(t,i,e)}removeEventListener(t,i){const e=t.$proxies||(t.$proxies={}),s=e[i];s&&(({attach:ns,detach:ns,resize:ns}[i]||Ke)(t,i,s),e[i]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,e,s){return function(t,i,e,s){const n=Ni(t),r=$i(n,"margin"),o=zi(n.maxWidth,t,"clientWidth")||lt,a=zi(n.maxHeight,t,"clientHeight")||lt,h=function(t,i,e){let s,n;if(void 0===i||void 0===e){const r=Fi(t);if(r){const t=r.getBoundingClientRect(),o=Ni(r),a=$i(o,"border","width"),h=$i(o,"padding");i=t.width-h.width-a.width,e=t.height-h.height-a.height,s=zi(o.maxWidth,r,"clientWidth"),n=zi(o.maxHeight,r,"clientHeight")}else i=t.clientWidth,e=t.clientHeight}return{width:i,height:e,maxWidth:s||lt,maxHeight:n||lt}}(t,i,e);let{width:c,height:l}=h;if("content-box"===n.boxSizing){const t=$i(n,"border","width"),i=$i(n,"padding");c-=i.width+t.width,l-=i.height+t.height}return c=Math.max(0,c-r.width),l=Math.max(0,s?c/s:l-r.height),c=Yi(Math.min(c,o,h.maxWidth)),l=Yi(Math.min(l,a,h.maxHeight)),c&&!l&&(l=Yi(c/2)),(void 0!==i||void 0!==e)&&s&&h.height&&l>h.height&&(l=h.height,c=Yi(Math.floor(l*s))),{width:c,height:l}}(t,i,e,s)}isAttached(t){const i=Fi(t);return!(!i||!i.isConnected)}}class as{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:i,y:e}=this.getProps(["x","y"],t);return{x:i,y:e}}hasValue(){return yt(this.x)&&yt(this.y)}getProps(t,i){const e=this.$animations;if(!i||!e)return this;const s={};return t.forEach((t=>{s[t]=e[t]&&e[t].active()?e[t]._to:this[t]})),s}}function hs(t,i,e,s,n){const r=Y(s,0),o=Math.min(Y(n,t.length),t.length);let a,h,c,l=0;for(e=Math.ceil(e),n&&(a=n-s,e=a/Math.floor(a/e)),c=r;c<0;)l++,c=Math.round(r+l*e);for(h=Math.max(r,0);h<o;h++)h===c&&(i.push(t[h]),l++,c=Math.round(r+l*e))}const cs=(t,i,e)=>"top"===i||"left"===i?t[i]+e:t[i]-e,ls=(t,i)=>Math.min(i||t,t);function us(t,i){const e=[],s=t.length/i,n=t.length;let r=0;for(;r<n;r+=s)e.push(t[Math.floor(r)]);return e}function ds(t,i,e){const s=t.ticks.length,n=Math.min(i,s-1),r=t._startPixel,o=t._endPixel,a=1e-6;let h,c=t.getPixelForTick(n);if(!(e&&(h=1===s?Math.max(c-r,o-c):0===i?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(n-1))/2,c+=n<i?h:-h,c<r-a||c>o+a)))return c}function fs(t){return t.drawTicks?t.tickLength:0}function bs(t,i){if(!t.display)return 0;const e=xi(t.font,i),s=yi(t.padding);return(W(t.text)?t.text.length:1)*e.lineHeight+s.height}function ps(t,i,e){let s=Et(t);return(e&&"right"!==i||!e&&"right"===i)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class gs extends as{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:e,_suggestedMax:s}=this;return t=G(t,Number.POSITIVE_INFINITY),i=G(i,Number.NEGATIVE_INFINITY),e=G(e,Number.POSITIVE_INFINITY),s=G(s,Number.NEGATIVE_INFINITY),{min:G(t,e),max:G(i,s),minDefined:H(t),maxDefined:H(i)}}getMinMax(t){let i,{min:e,max:s,minDefined:n,maxDefined:r}=this.getUserBounds();if(n&&r)return{min:e,max:s};const o=this.getMatchingVisibleMetas();for(let a=0,h=o.length;a<h;++a)i=o[a].controller.getMinMax(this,t),n||(e=Math.min(e,i.min)),r||(s=Math.max(s,i.max));return e=r&&e>s?s:e,s=n&&e>s?e:s,{min:G(e,G(s,e)),max:G(s,G(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){X(this.options.beforeUpdate,[this])}update(t,i,e){const{beginAtZero:s,grace:n,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=e=Object.assign({left:0,right:0,top:0,bottom:0},e),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+e.left+e.right:this.height+e.top+e.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,i,e){const{min:s,max:n}=t,r=V(i,(n-s)/2),o=(t,i)=>e&&0===t?0:t+i;return{min:o(s,-Math.abs(r)),max:o(n,r)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o<this.ticks.length;this._convertTicksToLabels(a?us(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=function(t,i){const e=t.options.ticks,s=function(t){const i=t.options.offset,e=t._tickSize();return Math.floor(Math.min(t._length/e+(i?0:1),t._maxLength/e))}(t),n=Math.min(e.maxTicksLimit||s,s),r=e.major.enabled?function(t){const i=[];let e,s;for(e=0,s=t.length;e<s;e++)t[e].major&&i.push(e);return i}(i):[],o=r.length,a=r[0],h=r[o-1],c=[];if(o>n)return function(t,i,e,s){let n,r=0,o=e[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(i.push(t[n]),r++,o=e[r*s])}(i,c,r,o/n),c;const l=function(t,i,e){const s=function(t){const i=t.length;let e,s;if(i<2)return!1;for(s=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==s)return!1;return s}(t),n=i.length/e;if(!s)return Math.max(n,1);const r=function(t){const i=[],e=Math.sqrt(t);let s;for(s=1;s<e;s++)t%s==0&&(i.push(s),i.push(t/s));return e===(0|e)&&i.push(e),i.sort(((t,i)=>t-i)).pop(),i}(s);for(let t=0,i=r.length-1;t<i;t++){const i=r[t];if(i>n)return i}return Math.max(n,1)}(r,i,n);if(o>0){let t,e;const s=o>1?Math.round((h-a)/(o-1)):null;for(hs(i,c,l,N(s)?0:a-s,a),t=0,e=o-1;t<e;t++)hs(i,c,l,r[t],r[t+1]);return hs(i,c,l,h,N(s)?i.length:h+s),c}return hs(i,c,l),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,i,e=this.options.reverse;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){X(this.options.afterUpdate,[this])}beforeSetDimensions(){X(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){X(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),X(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){X(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const i=this.options.ticks;let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e],n.label=X(i.callback,[n.value,e,t],this)}afterTickToLabelConversion(){X(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){X(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,i=t.ticks,e=ls(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,n=i.maxRotation;let r,o,a,h=s;if(!this._isVisible()||!i.display||s>=n||e<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),l=c.widest.width,u=c.highest.height,d=_t(this.chart.width-l,0,this.maxWidth);r=t.offset?this.maxWidth/e:d/(e-1),l+6>r&&(r=d/(e-(t.offset?.5:1)),o=this.maxHeight-fs(t.grid)-i.padding-bs(t.title,this.chart.options.font),a=Math.sqrt(l*l+u*u),h=Math.min(Math.asin(_t((c.highest.height+6)/r,-1,1)),Math.asin(_t(o/a,-1,1))-Math.asin(_t(u/a,-1,1)))*(180/ht),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){X(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){X(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:e,title:s,grid:n}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=bs(s,i.options.font);if(o?(t.width=this.maxWidth,t.height=fs(n)+r):(t.height=this.maxHeight,t.width=fs(n)+r),e.display&&this.ticks.length){const{first:i,last:s,widest:n,highest:r}=this._getLabelSizes(),a=2*e.padding,h=xt(this.labelRotation),c=Math.cos(h),l=Math.sin(h);o?t.height=Math.min(this.maxHeight,t.height+(e.mirror?0:l*n.width+c*r.height)+a):t.width=Math.min(this.maxWidth,t.width+(e.mirror?0:c*n.width+l*r.height)+a),this._calculatePadding(i,s,l,c)}}this._handleMargins(),o?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,e,s){const{ticks:{align:n,padding:r},position:o}=this.options,a=0!==this.labelRotation,h="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let l=0,u=0;a?h?(l=s*t.width,u=e*i.height):(l=e*t.height,u=s*i.width):"start"===n?u=i.width:"end"===n?l=t.width:"inner"!==n&&(l=t.width/2,u=i.width/2),this.paddingLeft=Math.max((l-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-c+r)*this.width/(this.width-c),0)}else{let e=i.height/2,s=t.height/2;"start"===n?(e=0,s=t.height):"end"===n&&(e=i.height,s=0),this.paddingTop=e+r,this.paddingBottom=s+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){X(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return"top"===i||"bottom"===i||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let i,e;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),i=0,e=t.length;i<e;i++)N(t[i].label)&&(t.splice(i,1),e--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const i=this.options.ticks.sampleSize;let e=this.ticks;i<e.length&&(e=us(e,i)),this._labelSizes=t=this._computeLabelSizes(e,e.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,e){const{ctx:s,_longestTextCache:n}=this,r=[],o=[],a=Math.floor(i/ls(i,e));let h,c,l,u,d,f,b,p,g,m,v,y=0,x=0;for(h=0;h<i;h+=a){if(u=t[h].label,d=this._resolveTickFontOptions(h),s.font=f=d.string,b=n[f]=n[f]||{data:{},gc:[]},p=d.lineHeight,g=m=0,N(u)||W(u)){if(W(u))for(c=0,l=u.length;c<l;++c)v=u[c],N(v)||W(v)||(g=ti(s,b.data,b.gc,g,v),m+=p)}else g=ti(s,b.data,b.gc,g,u),m=p;r.push(g),o.push(m),y=Math.max(g,y),x=Math.max(m,x)}!function(t,i){U(t,(t=>{const e=t.gc,s=e.length/2;let n;if(s>i){for(n=0;n<s;++n)delete t.data[e[n]];e.splice(0,s)}}))}(n,i);const M=r.indexOf(y),k=o.indexOf(x),w=t=>({width:r[t]||0,height:o[t]||0});return{first:w(0),last:w(i-1),widest:w(M),highest:w(k),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return _t(this._alignToPixels?ii(this.chart,i,0):i,-32768,32767)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&t<i.length){const e=i[t];return e.$context||(e.$context=function(t,i,e){return ki(t,{tick:e,index:i,type:"tick"})}(this.getContext(),t,e))}return this.$context||(this.$context=ki(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,i=xt(this.labelRotation),e=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),n=this._getLabelSizes(),r=t.autoSkipPadding||0,o=n?n.widest.width+r:0,a=n?n.highest.height+r:0;return this.isHorizontal()?a*e>o*s?o/e:a/s:a*s<o*e?a/e:o/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const i=this.axis,e=this.chart,s=this.options,{grid:n,position:r,border:o}=s,a=n.offset,h=this.isHorizontal(),c=this.ticks.length+(a?1:0),l=fs(n),u=[],d=o.setContext(this.getContext()),f=d.display?d.width:0,b=f/2,p=function(t){return ii(e,t,f)};let g,m,v,y,x,M,k,w,_,A,O,S;if("top"===r)g=p(this.bottom),M=this.bottom-l,w=g-b,A=p(t.top)+b,S=t.bottom;else if("bottom"===r)g=p(this.top),A=t.top,S=p(t.bottom)-b,M=g+b,w=this.top+l;else if("left"===r)g=p(this.right),x=this.right-l,k=g-b,_=p(t.left)+b,O=t.right;else if("right"===r)g=p(this.left),_=t.left,O=p(t.right)-b,x=g+b,k=this.left+l;else if("x"===i){if("center"===r)g=p((t.top+t.bottom)/2+.5);else if($(r)){const t=Object.keys(r)[0];g=p(this.chart.scales[t].getPixelForValue(r[t]))}A=t.top,S=t.bottom,M=g+b,w=M+l}else if("y"===i){if("center"===r)g=p((t.left+t.right)/2);else if($(r)){const t=Object.keys(r)[0];g=p(this.chart.scales[t].getPixelForValue(r[t]))}x=g-b,k=x-l,_=t.left,O=t.right}const R=Y(s.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/R));for(m=0;m<c;m+=D){const t=this.getContext(m),i=n.setContext(t),s=o.setContext(t),r=i.lineWidth,c=i.color,l=s.dash||[],d=s.dashOffset,f=i.tickWidth,b=i.tickColor,p=i.tickBorderDash||[],g=i.tickBorderDashOffset;v=ds(this,m,a),void 0!==v&&(y=ii(e,v,r),h?x=k=_=O=y:M=w=A=S=y,u.push({tx1:x,ty1:M,tx2:k,ty2:w,x1:_,y1:A,x2:O,y2:S,width:r,color:c,borderDash:l,borderDashOffset:d,tickWidth:f,tickColor:b,tickBorderDash:p,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,u}_computeLabelItems(t){const i=this.axis,e=this.options,{position:s,ticks:n}=e,r=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:h,padding:c,mirror:l}=n,u=fs(e.grid),d=u+c,f=l?-c:d,b=-xt(this.labelRotation),p=[];let g,m,v,y,x,M,k,w,_,A,O,S,R="middle";if("top"===s)M=this.bottom-f,k=this._getXAxisLabelAlignment();else if("bottom"===s)M=this.top+f,k=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,x=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,x=t.x}else if("x"===i){if("center"===s)M=(t.top+t.bottom)/2+d;else if($(s)){const t=Object.keys(s)[0];M=this.chart.scales[t].getPixelForValue(s[t])+d}k=this._getXAxisLabelAlignment()}else if("y"===i){if("center"===s)x=(t.left+t.right)/2-d;else if($(s)){const t=Object.keys(s)[0];x=this.chart.scales[t].getPixelForValue(s[t])}k=this._getYAxisLabelAlignment(u).textAlign}"y"===i&&("start"===a?R="top":"end"===a&&(R="bottom"));const D=this._getLabelSizes();for(g=0,m=o.length;g<m;++g){v=o[g],y=v.label;const t=n.setContext(this.getContext(g));w=this.getPixelForTick(g)+n.labelOffset,_=this._resolveTickFontOptions(g),A=_.lineHeight,O=W(y)?y.length:1;const i=O/2,e=t.color,a=t.textStrokeColor,c=t.textStrokeWidth;let u,d=k;if(r?(x=w,"inner"===k&&(d=g===m-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),S="top"===s?"near"===h||0!==b?-O*A+A/2:"center"===h?-D.highest.height/2-i*A+A:A/2-D.highest.height:"near"===h||0!==b?A/2:"center"===h?D.highest.height/2-i*A:D.highest.height-O*A,l&&(S*=-1),0===b||t.showLabelBackdrop||(x+=A/2*Math.sin(b))):(M=w,S=(1-O)*A/2),t.showLabelBackdrop){const i=yi(t.backdropPadding),e=D.heights[g],s=D.widths[g];let n=S-i.top,r=0-i.left;switch(R){case"middle":n-=e/2;break;case"bottom":n-=e}switch(k){case"center":r-=s/2;break;case"right":r-=s;break;case"inner":g===m-1?r-=s:g>0&&(r-=s/2)}u={left:r,top:n,width:s+i.width,height:e+i.height,color:t.backdropColor}}p.push({label:y,font:_,textOffset:S,options:{rotation:b,color:e,strokeColor:a,strokeWidth:c,textAlign:d,textBaseline:R,translation:[x,M],backdrop:u}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-xt(this.labelRotation))return"top"===t?"left":"right";let e="center";return"start"===i.align?e="left":"end"===i.align?e="right":"inner"===i.align&&(e="inner"),e}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:e,mirror:s,padding:n}}=this.options,r=t+n,o=this._getLabelSizes().widest.width;let a,h;return"left"===i?s?(h=this.right+n,"near"===e?a="left":"center"===e?(a="center",h+=o/2):(a="right",h+=o)):(h=this.right-r,"near"===e?a="right":"center"===e?(a="center",h-=o/2):(a="left",h=this.left)):"right"===i?s?(h=this.left+n,"near"===e?a="right":"center"===e?(a="center",h-=o/2):(a="left",h-=o)):(h=this.left+r,"near"===e?a="left":"center"===e?(a="center",h+=o/2):(a="right",h=this.right)):a="right",{textAlign:a,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;return"left"===i||"right"===i?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===i||"bottom"===i?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:e,top:s,width:n,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(e,s,n,r),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const e=this.ticks.findIndex((i=>i.value===t));return e>=0?i.setContext(this.getContext(e)).lineWidth:0}drawGrid(t){const i=this.options.grid,e=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,r;const o=(t,i,s)=>{s.width&&s.color&&(e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),e.stroke(),e.restore())};if(i.display)for(n=0,r=s.length;n<r;++n){const t=s[n];i.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:i,options:{border:e,grid:s}}=this,n=e.setContext(this.getContext()),r=e.display?n.width:0;if(!r)return;const o=s.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let h,c,l,u;this.isHorizontal()?(h=ii(t,this.left,r)-r/2,c=ii(t,this.right,o)+o/2,l=u=a):(l=ii(t,this.top,r)-r/2,u=ii(t,this.bottom,o)+o/2,h=c=a),i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.beginPath(),i.moveTo(h,l),i.lineTo(c,u),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,e=this._computeLabelArea();e&&oi(i,e);const s=this.getLabelItems(t);for(const t of s)li(i,t.label,0,t.textOffset,t.font,t.options);e&&ai(i)}drawTitle(){const{ctx:t,options:{position:i,title:e,reverse:s}}=this;if(!e.display)return;const n=xi(e.font),r=yi(e.padding),o=e.align;let a=n.lineHeight/2;"bottom"===i||"center"===i||$(i)?(a+=r.bottom,W(e.text)&&(a+=n.lineHeight*(e.text.length-1))):a+=r.top;const{titleX:h,titleY:c,maxWidth:l,rotation:u}=function(t,i,e,s){const{top:n,left:r,bottom:o,right:a,chart:h}=t,{chartArea:c,scales:l}=h;let u,d,f,b=0;const p=o-n,g=a-r;if(t.isHorizontal()){if(d=Lt(s,r,a),$(e)){const t=Object.keys(e)[0];f=l[t].getPixelForValue(e[t])+p-i}else f="center"===e?(c.bottom+c.top)/2+p-i:cs(t,e,i);u=a-r}else{if($(e)){const t=Object.keys(e)[0];d=l[t].getPixelForValue(e[t])-g+i}else d="center"===e?(c.left+c.right)/2-g+i:cs(t,e,i);f=Lt(s,o,n),b="left"===e?-dt:dt}return{titleX:d,titleY:f,maxWidth:u,rotation:b}}(this,a,i,o);li(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:u,textAlign:ps(o,i,s),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,i=t.ticks&&t.ticks.z||0,e=Y(t.grid&&t.grid.z,-1),s=Y(t.border&&t.border.z,0);return this._isVisible()&&this.draw===gs.prototype.draw?[{z:e,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),e=this.axis+"AxisID",s=[];let n,r;for(n=0,r=i.length;n<r;++n){const r=i[n];r[e]!==this.id||t&&r.type!==t||s.push(r)}return s}_resolveTickFontOptions(t){return xi(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ms{constructor(t,i,e){this.type=t,this.scope=i,this.override=e,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const i=Object.getPrototypeOf(t);let e;(function(t){return"id"in t&&"defaults"in t})(i)&&(e=this.register(i));const s=this.items,n=t.id,r=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,i,e){const s=J(Object.create(null),[e?Jt.get(e):{},Jt.get(i),t.defaults]);Jt.set(i,s),t.defaultRoutes&&function(t,i){Object.keys(i).forEach((e=>{const s=e.split("."),n=s.pop(),r=[t].concat(s).join("."),o=i[e].split("."),a=o.pop(),h=o.join(".");Jt.route(r,n,h,a)}))}(i,t.defaultRoutes),t.descriptors&&Jt.describe(i,t.descriptors)}(t,r,e),this.override&&Jt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const i=this.items,e=t.id,s=this.scope;e in i&&delete i[e],s&&e in Jt[s]&&(delete Jt[s][e],this.override&&delete Ut[e])}}class vs{constructor(){this.controllers=new ms(pe,"datasets",!0),this.elements=new ms(as,"elements"),this.plugins=new ms(Object,"plugins"),this.scales=new ms(gs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,e){[...i].forEach((i=>{const s=e||this._getRegistryForType(i);e||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):U(i,(i=>{const s=e||this._getRegistryForType(i);this._exec(t,s,i)}))}))}_exec(t,i,e){const s=nt(t);X(e["before"+s],[],e),i[t](e),X(e["after"+s],[],e)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){const e=this._typedRegistries[i];if(e.isForType(t))return e}return this.plugins}_get(t,i,e){const s=i.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+e+".");return s}}var ys=new vs;class xs{constructor(){this._init=[]}notify(t,i,e,s){"beforeInit"===i&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(n,t,i,e);return"afterDestroy"===i&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,i,e,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===X(t[e],[i,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){const e=t&&t.config,s=Y(e.options&&e.options.plugins,{}),n=function(t){const i={},e=[],s=Object.keys(ys.plugins.items);for(let t=0;t<s.length;t++)e.push(ys.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===e.indexOf(s)&&(e.push(s),i[s.id]=!0)}return{plugins:e,localIds:i}}(e);return!1!==s||i?function(t,{plugins:i,localIds:e},s,n){const r=[],o=t.getContext();for(const a of i){const i=a.id,h=Ms(s[i],n);null!==h&&r.push({plugin:a,options:ks(t.config,{plugin:a,local:e[i]},h,o)})}return r}(t,n,s,i):[]}_notifyStateChanges(t){const i=this._oldCache||[],e=this._cache,s=(t,i)=>t.filter((t=>!i.some((i=>t.plugin.id===i.plugin.id))));this._notify(s(i,e),t,"stop"),this._notify(s(e,i),t,"start")}}function Ms(t,i){return i||!1!==t?!0===t?{}:t:null}function ks(t,{plugin:i,local:e},s,n){const r=t.pluginScopeKeys(i),o=t.getOptionScopes(s,r);return e&&i.defaults&&o.push(i.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ws(t,i){return((i.datasets||{})[t]||{}).indexAxis||i.indexAxis||(Jt.datasets[t]||{}).indexAxis||"x"}function _s(t){if("x"===t||"y"===t||"r"===t)return t}function As(t,...i){if(_s(t))return t;for(const s of i){const i=s.axis||("top"===(e=s.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.length>1&&_s(t[0].toLowerCase());if(i)return i}var e;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Os(t,i,e){if(e[i+"AxisID"]===t)return{axis:i}}function Ss(t){const i=t.options||(t.options={});i.plugins=Y(i.plugins,{}),i.scales=function(t,i){const e=Ut[t.type]||{scales:{}},s=i.scales||{},n=ws(t.type,i),r=Object.create(null);return Object.keys(s).forEach((i=>{const o=s[i];if(!$(o))return console.error(`Invalid scale configuration for scale: ${i}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const a=As(i,o,function(t,i){if(i.data&&i.data.datasets){const e=i.data.datasets.filter((i=>i.xAxisID===t||i.yAxisID===t));if(e.length)return Os(t,"x",e[0])||Os(t,"y",e[0])}return{}}(i,t),Jt.scales[o.type]),h=function(t,i){return t===i?"_index_":"_value_"}(a,n),c=e.scales||{};r[i]=tt(Object.create(null),[{axis:a},o,c[a],c[h]])})),t.data.datasets.forEach((e=>{const n=e.type||t.type,o=e.indexAxis||ws(n,i),a=(Ut[n]||{}).scales||{};Object.keys(a).forEach((t=>{const i=function(t,i){let e=t;return"_index_"===t?e=i:"_value_"===t&&(e="x"===i?"y":"x"),e}(t,o),n=e[i+"AxisID"]||i;r[n]=r[n]||Object.create(null),tt(r[n],[{axis:i},s[n],a[t]])}))})),Object.keys(r).forEach((t=>{const i=r[t];tt(i,[Jt.scales[i.type],Jt.scale])})),r}(t,i)}function Rs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ds=new Map,js=new Set;function Bs(t,i){let e=Ds.get(t);return e||(e=i(),Ds.set(t,e),js.add(e)),e}const Cs=(t,i,e)=>{const s=st(i,e);void 0!==s&&t.add(s)};class Es{constructor(t){this._config=function(t){return(t=t||{}).data=Rs(t.data),Ss(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Rs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ss(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bs(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,i){return Bs(`${t}.transition.${i}`,(()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,i){return Bs(`${t}-${i}`,(()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]]))}pluginScopeKeys(t){const i=t.id;return Bs(`${this.type}-plugin-${i}`,(()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,i){const e=this._scopeCache;let s=e.get(t);return s&&!i||(s=new Map,e.set(t,s)),s}getOptionScopes(t,i,e){const{options:s,type:n}=this,r=this._cachedScopes(t,e),o=r.get(i);if(o)return o;const a=new Set;i.forEach((i=>{t&&(a.add(t),i.forEach((i=>Cs(a,t,i)))),i.forEach((t=>Cs(a,s,t))),i.forEach((t=>Cs(a,Ut[n]||{},t))),i.forEach((t=>Cs(a,Jt,t))),i.forEach((t=>Cs(a,Zt,t)))}));const h=Array.from(a);return 0===h.length&&h.push(Object.create(null)),js.has(i)&&r.set(i,h),h}chartOptionScopes(){const{options:t,type:i}=this;return[t,Ut[i]||{},Jt.datasets[i]||{},{type:i},Jt,Zt]}resolveNamedOptions(t,i,e,s=[""]){const n={$shared:!0},{resolver:r,subPrefixes:o}=Ls(this._resolverCache,t,s);let a=r;(function(t,i){const{isScriptable:e,isIndexable:s}=Ai(t);for(const n of i){const i=e(n),r=s(n),o=(r||i)&&t[n];if(i&&(ot(o)||Ps(o))||r&&W(o))return!0}return!1})(r,i)&&(n.$shared=!1,a=_i(r,e=ot(e)?e():e,this.createResolver(t,e,o)));for(const t of i)n[t]=a[t];return n}createResolver(t,i,e=[""],s){const{resolver:n}=Ls(this._resolverCache,t,e);return $(i)?_i(n,i,void 0,s):n}}function Ls(t,i,e){let s=t.get(i);s||(s=new Map,t.set(i,s));const n=e.join();let r=s.get(n);return r||(r={resolver:wi(i,e),subPrefixes:e.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,r)),r}const Ps=t=>$(t)&&Object.getOwnPropertyNames(t).some((i=>ot(t[i]))),Is=["top","bottom","left","right","chartArea"];function Ts(t,i){return"top"===t||"bottom"===t||-1===Is.indexOf(t)&&"x"===i}function Fs(t,i){return function(e,s){return e[t]===s[t]?e[i]-s[i]:e[t]-s[t]}}function zs(t){const i=t.chart,e=i.options.animation;i.notifyPlugins("afterRender"),X(e&&e.onComplete,[t],i)}function Ns(t){const i=t.chart,e=i.options.animation;X(e&&e.onProgress,[t],i)}function Ws(t){return Ti()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const $s={},Hs=t=>{const i=Ws(t);return Object.values($s).filter((t=>t.canvas===i)).pop()};function Gs(t,i,e){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=i){const r=t[n];delete t[n],(e>0||s>i)&&(t[s+e]=r)}}}function Ys(t,i,e){return t.options.clip?t[e]:i[e]}class Vs{static defaults=Jt;static instances=$s;static overrides=Ut;static registry=ys;static version="4.4.1";static getChart=Hs;static register(...t){ys.add(...t),Xs()}static unregister(...t){ys.remove(...t),Xs()}constructor(t,i){const e=this.config=new Es(i),s=Ws(t),n=Hs(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const r=e.createResolver(e.chartOptionScopes(),this.getContext());this.platform=new(e.platform||function(t){return!Ti()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ye:os}(s)),this.platform.updateConfig(e);const o=this.platform.acquireContext(s,r.aspectRatio),a=o&&o.canvas,h=a&&a.height,c=a&&a.width;this.id=z(),this.ctx=o,this.canvas=a,this.width=c,this.height=h,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,i){let e;return function(...s){return i?(clearTimeout(e),e=setTimeout(t,i,s)):t.apply(this,s),i}}((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],$s[this.id]=this,o&&a?(Ji.listen(this,"complete",zs),Ji.listen(this,"progress",Ns),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:e,height:s,_aspectRatio:n}=this;return N(t)?i&&n?n:s?e/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ys}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Vi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ei(this.canvas,this.ctx),this}stop(){return Ji.stop(this),this}resize(t,i){Ji.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const e=this.options,s=this.platform.getMaximumSize(this.canvas,t,i,e.maintainAspectRatio&&this.aspectRatio),n=e.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Vi(this,n,!0)&&(this.notifyPlugins("resize",{size:s}),X(e.onResize,[this,s],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){U(this.options.scales||{},((t,i)=>{t.id=i}))}buildOrUpdateScales(){const t=this.options,i=t.scales,e=this.scales,s=Object.keys(e).reduce(((t,i)=>(t[i]=!1,t)),{});let n=[];i&&(n=n.concat(Object.keys(i).map((t=>{const e=i[t],s=As(t,e),n="r"===s,r="x"===s;return{options:e,dposition:n?"chartArea":r?"bottom":"left",dtype:n?"radialLinear":r?"category":"linear"}})))),U(n,(i=>{const n=i.options,r=n.id,o=As(r,n),a=Y(n.type,i.dtype);void 0!==n.position&&Ts(n.position,o)===Ts(i.dposition)||(n.position=i.dposition),s[r]=!0;let h=null;r in e&&e[r].type===a?h=e[r]:(h=new(ys.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),e[h.id]=h),h.init(n,t)})),U(s,((t,i)=>{t||delete e[i]})),U(e,(t=>{He.configure(this,t,t.options),He.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,e=t.length;if(t.sort(((t,i)=>t.index-i.index)),e>i){for(let t=i;t<e;++t)this._destroyDatasetMeta(t);t.splice(i,e-i)}this._sortedMetasets=t.slice(0).sort(Fs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach(((t,e)=>{0===i.filter((i=>i===t._dataset)).length&&this._destroyDatasetMeta(e)}))}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let e,s;for(this._removeUnreferencedMetasets(),e=0,s=i.length;e<s;e++){const s=i[e];let n=this.getDatasetMeta(e);const r=s.type||this.config.type;if(n.type&&n.type!==r&&(this._destroyDatasetMeta(e),n=this.getDatasetMeta(e)),n.type=r,n.indexAxis=s.indexAxis||ws(r,this.options),n.order=s.order||0,n.index=e,n.label=""+s.label,n.visible=this.isDatasetVisible(e),n.controller)n.controller.updateIndex(e),n.controller.linkScales();else{const i=ys.getController(r),{datasetElementType:s,dataElementType:o}=Jt.datasets[r];Object.assign(i,{dataElementType:ys.getElement(o),datasetElementType:s&&ys.getElement(s)}),n.controller=new i(this,e),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){U(this.data.datasets,((t,i)=>{this.getDatasetMeta(i).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const e=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!e.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,i=this.data.datasets.length;t<i;t++){const{controller:i}=this.getDatasetMeta(t),e=!s&&-1===n.indexOf(i);i.buildOrUpdateElements(e),r=Math.max(+i.getMaxOverflow(),r)}r=this._minPadding=e.layout.autoPadding?r:0,this._updateLayout(r),s||U(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){U(this.scales,(t=>{He.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),e=new Set(t.events);at(i,e)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:e,start:s,count:n}of i)Gs(t,s,"_removeElements"===e?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,e=i=>new Set(t.filter((t=>t[0]===i)).map(((t,i)=>i+","+t.splice(1).join(",")))),s=e(0);for(let t=1;t<i;t++)if(!at(s,e(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;He.update(this,this.width,this.height,t);const i=this.chartArea,e=i.width<=0||i.height<=0;this._layers=[],U(this.boxes,(t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,i)=>{t._idx=i})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let i=0,e=this.data.datasets.length;i<e;++i)this._updateDataset(i,ot(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){const e=this.getDatasetMeta(t),s={meta:e,index:t,mode:i,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(e.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ji.has(this)?this.attached&&!Ji.running(this)&&Ji.start(this):(this.draw(),zs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:i}=this._resizeBeforeDraw;this._resize(t,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const i=this._sortedMetasets,e=[];let s,n;for(s=0,n=i.length;s<n;++s){const n=i[s];t&&!n.visible||e.push(n)}return e}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,e=t._clip,s=!e.disabled,n=function(t,i){const{xScale:e,yScale:s}=t;return e&&s?{left:Ys(e,i,"left"),right:Ys(e,i,"right"),top:Ys(s,i,"top"),bottom:Ys(s,i,"bottom")}:i}(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&oi(i,{left:!1===e.left?0:n.left-e.left,right:!1===e.right?this.width:n.right+e.right,top:!1===e.top?0:n.top-e.top,bottom:!1===e.bottom?this.height:n.bottom+e.bottom}),t.controller.draw(),s&&ai(i),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,e,s){const n=Be.modes[i];return"function"==typeof n?n(this,t,e,s):[]}getDatasetMeta(t){const i=this.data.datasets[t],e=this._metasets;let s=e.filter((t=>t&&t._dataset===i)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},e.push(s)),s}getContext(){return this.$context||(this.$context=ki(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!i.hidden}setDatasetVisibility(t,i){this.getDatasetMeta(t).hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,e){const s=e?"show":"hide",n=this.getDatasetMeta(t),r=n.controller._resolveAnimations(void 0,s);rt(i)?(n.data[i].hidden=!e,this.update()):(this.setDatasetVisibility(t,e),r.update(n,{visible:e}),this.update((i=>i.datasetIndex===t?s:void 0)))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Ji.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ei(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete $s[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(t,i,e)=>{t.offsetX=i,t.offsetY=e,this._eventHandler(t)};U(this.options.events,(t=>e(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(e,s)=>{t[e]&&(i.removeEventListener(this,e,s),delete t[e])},n=(t,i)=>{this.canvas&&this.resize(t,i)};let r;const o=()=>{s("attach",o),this.attached=!0,this.resize(),e("resize",n),e("detach",r)};r=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),e("attach",o)},i.isAttached(this.canvas)?o():r()}unbindEvents(){U(this._listeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._listeners={},U(this._responsiveListeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,i,e){const s=e?"set":"remove";let n,r,o,a;for("dataset"===i&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,a=t.length;o<a;++o){r=t[o];const i=r&&this.getDatasetMeta(r.datasetIndex).controller;i&&i[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const i=this._active||[],e=t.map((({datasetIndex:t,index:i})=>{const e=this.getDatasetMeta(t);if(!e)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:e.data[i],index:i}}));!Z(e,i)&&(this._active=e,this._lastEvent=null,this._updateHoverStyles(e,i))}notifyPlugins(t,i,e){return this._plugins.notify(this,t,i,e)}isPluginEnabled(t){return 1===this._plugins._cache.filter((i=>i.plugin.id===t)).length}_updateHoverStyles(t,i,e){const s=this.options.hover,n=(t,i)=>t.filter((t=>!i.some((i=>t.datasetIndex===i.datasetIndex&&t.index===i.index)))),r=n(i,t),o=e?t:n(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,i){const e={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",e,s))return;const n=this._handleEvent(t,i,e.inChartArea);return e.cancelable=!1,this.notifyPlugins("afterEvent",e,s),(n||e.changed)&&this.render(),this}_handleEvent(t,i,e){const{_active:s=[],options:n}=this,r=this._getActiveElements(t,s,e,i),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),a=function(t,i,e,s){return e&&"mouseout"!==t.type?s?i:t:null}(t,this._lastEvent,e,o);e&&(this._lastEvent=null,X(n.onHover,[t,r,this],this),o&&X(n.onClick,[t,r,this],this));const h=!Z(r,s);return(h||i)&&(this._active=r,this._updateHoverStyles(r,s,i)),this._lastEvent=a,h}_getActiveElements(t,i,e,s){if("mouseout"===t.type)return[];if(!e)return i;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Xs(){return U(Vs.instances,(t=>t._plugins.invalidate()))}function Us(t,i){const{x:e,y:s,base:n,width:r,height:o}=t.getProps(["x","y","base","width","height"],i);let a,h,c,l,u;return t.horizontal?(u=o/2,a=Math.min(e,n),h=Math.max(e,n),c=s-u,l=s+u):(u=r/2,a=e-u,h=e+u,c=Math.min(s,n),l=Math.max(s,n)),{left:a,top:c,right:h,bottom:l}}function Zs(t,i,e,s){return t?0:_t(i,e,s)}function Ks(t,i,e,s){const n=null===i,r=null===e,o=t&&!(n&&r)&&Us(t,s);return o&&(n||At(i,o.left,o.right))&&(r||At(e,o.top,o.bottom))}function Qs(t,i){t.rect(i.x,i.y,i.w,i.h)}function qs(t,i,e={}){const s=t.x!==e.x?-i:0,n=t.y!==e.y?-i:0;return{x:t.x+s,y:t.y+n,w:t.w+((t.x+t.w!==e.x+e.w?i:0)-s),h:t.h+((t.y+t.h!==e.y+e.h?i:0)-n),radius:t.radius}}class Js extends as{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:i,options:{borderColor:e,backgroundColor:s}}=this,{inner:n,outer:r}=function(t){const i=Us(t),e=i.right-i.left,s=i.bottom-i.top,n=function(t,i,e){const s=t.borderSkipped,n=mi(t.options.borderWidth);return{t:Zs(s.top,n.top,0,e),r:Zs(s.right,n.right,0,i),b:Zs(s.bottom,n.bottom,0,e),l:Zs(s.left,n.left,0,i)}}(t,e/2,s/2),r=function(t,i,e){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,r=vi(n),o=Math.min(i,e),a=t.borderSkipped,h=s||$(n);return{topLeft:Zs(!h||a.top||a.left,r.topLeft,0,o),topRight:Zs(!h||a.top||a.right,r.topRight,0,o),bottomLeft:Zs(!h||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Zs(!h||a.bottom||a.right,r.bottomRight,0,o)}}(t,e/2,s/2);return{outer:{x:i.left,y:i.top,w:e,h:s,radius:r},inner:{x:i.left+n.l,y:i.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}(this),o=(a=r.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?ui:Qs;var a;t.save(),r.w===n.w&&r.h===n.h||(t.beginPath(),o(t,qs(r,i,n)),t.clip(),o(t,qs(n,-i,r)),t.fillStyle=e,t.fill("evenodd")),t.beginPath(),o(t,qs(n,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,e){return Ks(this,t,i,e)}inXRange(t,i){return Ks(this,t,null,i)}inYRange(t,i){return Ks(this,null,t,i)}getCenterPoint(t){const{x:i,y:e,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(i+s)/2:i,y:n?e:(e+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}const tn=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],en=tn.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function sn(t){return tn[t%tn.length]}function nn(t){return en[t%en.length]}function rn(t){let i;for(i in t)if(t[i].borderColor||t[i].backgroundColor)return!0;return!1}var on={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,i,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:r}=n;if(!e.forceOverride&&(rn(s)||(o=n)&&(o.borderColor||o.backgroundColor)||r&&rn(r)))return;var o;const a=function(t){let i=0;return(e,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof _e?i=function(t,i){return t.backgroundColor=t.data.map((()=>sn(i++))),i}(e,i):n instanceof Ae?i=function(t,i){return t.backgroundColor=t.data.map((()=>nn(i++))),i}(e,i):n&&(i=function(t,i){return t.borderColor=sn(i),t.backgroundColor=nn(i),++i}(e,i))}}(t);s.forEach(a)}};const an=(t,i)=>{let{boxHeight:e=i,boxWidth:s=i}=t;return t.usePointStyle&&(e=Math.min(e,i),s=t.pointStyleWidth||Math.min(s,i)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(i,e)}};class hn extends as{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,e){this.maxWidth=t,this.maxHeight=i,this._margins=e,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let i=X(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter((i=>t.filter(i,this.chart.data)))),t.sort&&(i=i.sort(((i,e)=>t.sort(i,e,this.chart.data)))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:t,ctx:i}=this;if(!t.display)return void(this.width=this.height=0);const e=t.labels,s=xi(e.font),n=s.size,r=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=an(e,n);let h,c;i.font=s.string,this.isHorizontal()?(h=this.maxWidth,c=this._fitRows(r,n,o,a)+10):(c=this.maxHeight,h=this._fitCols(r,s,o,a)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,i,e,s){const{ctx:n,maxWidth:r,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],h=this.lineWidths=[0],c=s+o;let l=t;n.textAlign="left",n.textBaseline="middle";let u=-1,d=-c;return this.legendItems.forEach(((t,f)=>{const b=e+i/2+n.measureText(t.text).width;(0===f||h[h.length-1]+b+2*o>r)&&(l+=c,h[h.length-(f>0?0:1)]=0,d+=c,u++),a[f]={left:0,top:d,row:u,width:b,height:s},h[h.length-1]+=b+o})),l}_fitCols(t,i,e,s){const{ctx:n,maxHeight:r,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],h=this.columnSizes=[],c=r-t;let l=o,u=0,d=0,f=0,b=0;return this.legendItems.forEach(((t,r)=>{const{itemWidth:p,itemHeight:g}=function(t,i,e,s,n){const r=function(t,i,e,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,i)=>t.length>i.length?t:i))),i+e.size/2+s.measureText(n).width}(s,t,i,e),o=function(t,i,e){let s=t;return"string"!=typeof i.text&&(s=cn(i,e)),s}(n,s,i.lineHeight);return{itemWidth:r,itemHeight:o}}(e,i,n,t,s);r>0&&d+g+2*o>c&&(l+=u+o,h.push({width:u,height:d}),f+=u+o,b++,u=d=0),a[r]={left:f,top:d,col:b,width:p,height:g},u=Math.max(u,p),d+=g+o})),l+=u,h.push({width:u,height:d}),l}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:e,labels:{padding:s},rtl:n}}=this,r=Zi(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=Lt(e,this.left+s,this.right-this.lineWidths[n]);for(const a of i)n!==a.row&&(n=a.row,o=Lt(e,this.left+s,this.right-this.lineWidths[n])),a.top+=this.top+t+s,a.left=r.leftForLtr(r.x(o),a.width),o+=a.width+s}else{let n=0,o=Lt(e,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const a of i)a.col!==n&&(n=a.col,o=Lt(e,this.top+t+s,this.bottom-this.columnSizes[n].height)),a.top=o,a.left+=this.left+s,a.left=r.leftForLtr(r.x(a.left),a.width),o+=a.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;oi(t,this),this._draw(),ai(t)}}_draw(){const{options:t,columnSizes:i,lineWidths:e,ctx:s}=this,{align:n,labels:r}=t,o=Jt.color,a=Zi(t.rtl,this.left,this.width),h=xi(r.font),{padding:c}=r,l=h.size,u=l/2;let d;this.drawTitle(),s.textAlign=a.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:f,boxHeight:b,itemHeight:p}=an(r,l),g=this.isHorizontal(),m=this._computeTitleHeight();d=g?{x:Lt(n,this.left+c,this.right-e[0]),y:this.top+c+m,line:0}:{x:this.left+c,y:Lt(n,this.top+m+c,this.bottom-i[0].height),line:0},Ki(this.ctx,t.textDirection);const v=p+c;this.legendItems.forEach(((y,x)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const M=s.measureText(y.text).width,k=a.textAlign(y.textAlign||(y.textAlign=r.textAlign)),w=f+u+M;let _=d.x,A=d.y;a.setWidth(this.width),g?x>0&&_+w+c>this.right&&(A=d.y+=v,d.line++,_=d.x=Lt(n,this.left+c,this.right-e[d.line])):x>0&&A+v>this.bottom&&(_=d.x=_+i[d.line].width+c,d.line++,A=d.y=Lt(n,this.top+m+c,this.bottom-i[d.line].height)),function(t,i,e){if(isNaN(f)||f<=0||isNaN(b)||b<0)return;s.save();const n=Y(e.lineWidth,1);if(s.fillStyle=Y(e.fillStyle,o),s.lineCap=Y(e.lineCap,"butt"),s.lineDashOffset=Y(e.lineDashOffset,0),s.lineJoin=Y(e.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=Y(e.strokeStyle,o),s.setLineDash(Y(e.lineDash,[])),r.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:e.pointStyle,rotation:e.rotation,borderWidth:n},h=a.xPlus(t,f/2);ni(s,o,h,i+u,r.pointStyleWidth&&f)}else{const r=i+Math.max((l-b)/2,0),o=a.leftForLtr(t,f),h=vi(e.borderRadius);s.beginPath(),Object.values(h).some((t=>0!==t))?ui(s,{x:o,y:r,w:f,h:b,radius:h}):s.rect(o,r,f,b),s.fill(),0!==n&&s.stroke()}s.restore()}(a.x(_),A,y),_=((t,i,e,s)=>t===(s?"left":"right")?e:"center"===t?(i+e)/2:i)(k,_+f+u,g?_+w:this.right,t.rtl),function(t,i,e){li(s,e.text,t,i+p/2,h,{strikethrough:e.hidden,textAlign:a.textAlign(e.textAlign)})}(a.x(_),A,y),g?d.x+=w+c:d.y+="string"!=typeof y.text?cn(y,h.lineHeight)+c:v})),Qi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,i=t.title,e=xi(i.font),s=yi(i.padding);if(!i.display)return;const n=Zi(t.rtl,this.left,this.width),r=this.ctx,o=i.position,a=s.top+e.size/2;let h,c=this.left,l=this.width;if(this.isHorizontal())l=Math.max(...this.lineWidths),h=this.top+a,c=Lt(t.align,c,this.right-l);else{const i=this.columnSizes.reduce(((t,i)=>Math.max(t,i.height)),0);h=a+Lt(t.align,this.top,this.bottom-i-t.labels.padding-this._computeTitleHeight())}const u=Lt(o,c,c+l);r.textAlign=n.textAlign(Et(o)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=e.string,li(r,i.text,u,h,e)}_computeTitleHeight(){const t=this.options.title,i=xi(t.font),e=yi(t.padding);return t.display?i.lineHeight+e.height:0}_getLegendItemAt(t,i){let e,s,n;if(At(t,this.left,this.right)&&At(i,this.top,this.bottom))for(n=this.legendHitBoxes,e=0;e<n.length;++e)if(s=n[e],At(t,s.left,s.left+s.width)&&At(i,s.top,s.top+s.height))return this.legendItems[e];return null}handleEvent(t){const i=this.options;if(!function(t,i){return!("mousemove"!==t&&"mouseout"!==t||!i.onHover&&!i.onLeave)||!(!i.onClick||"click"!==t&&"mouseup"!==t)}(t.type,i))return;const e=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,o=(n=e,null!==(s=r)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);r&&!o&&X(i.onLeave,[t,r,this],this),this._hoveredItem=e,e&&!o&&X(i.onHover,[t,e,this],this)}else e&&X(i.onClick,[t,e,this],this);var s,n}}function cn(t,i){return i*(t.text?t.text.length:0)}var ln={id:"legend",_element:hn,start(t,i,e){const s=t.legend=new hn({ctx:t.ctx,options:e,chart:t});He.configure(t,s,e),He.addBox(t,s)},stop(t){He.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,i,e){const s=t.legend;He.configure(t,s,e),s.options=e},afterUpdate(t){const i=t.legend;i.buildLabels(),i.adjustHitBoxes()},afterEvent(t,i){i.replay||t.legend.handleEvent(i.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,i,e){const s=i.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),i.hidden=!0):(n.show(s),i.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const i=t.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const h=t.controller.getStyle(e?0:void 0),c=yi(h.borderWidth);return{text:i[t.index].label,fillStyle:h.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:n||h.textAlign,borderRadius:o&&(a||h.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class un extends as{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i){const e=this.options;if(this.left=0,this.top=0,!e.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=i;const s=W(e.text)?e.text.length:1;this._padding=yi(e.padding);const n=s*xi(e.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:i,left:e,bottom:s,right:n,options:r}=this,o=r.align;let a,h,c,l=0;return this.isHorizontal()?(h=Lt(o,e,n),c=i+t,a=n-e):("left"===r.position?(h=e+t,c=Lt(o,s,i),l=-.5*ht):(h=n-t,c=Lt(o,i,s),l=.5*ht),a=s-i),{titleX:h,titleY:c,maxWidth:a,rotation:l}}draw(){const t=this.ctx,i=this.options;if(!i.display)return;const e=xi(i.font),s=e.lineHeight/2+this._padding.top,{titleX:n,titleY:r,maxWidth:o,rotation:a}=this._drawArgs(s);li(t,i.text,0,0,e,{color:i.color,maxWidth:o,rotation:a,textAlign:Et(i.align),textBaseline:"middle",translation:[n,r]})}}var dn={id:"title",_element:un,start(t,i,e){!function(t,i){const e=new un({ctx:t.ctx,options:i,chart:t});He.configure(t,e,i),He.addBox(t,e),t.titleBlock=e}(t,e)},stop(t){He.removeBox(t,t.titleBlock),delete t.titleBlock},beforeUpdate(t,i,e){const s=t.titleBlock;He.configure(t,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const fn={average(t){if(!t.length)return!1;let i,e,s=0,n=0,r=0;for(i=0,e=t.length;i<e;++i){const e=t[i].element;if(e&&e.hasValue()){const t=e.tooltipPosition();s+=t.x,n+=t.y,++r}}return{x:s/r,y:n/r}},nearest(t,i){if(!t.length)return!1;let e,s,n,r=i.x,o=i.y,a=Number.POSITIVE_INFINITY;for(e=0,s=t.length;e<s;++e){const s=t[e].element;if(s&&s.hasValue()){const t=(h=i,c=s.getCenterPoint(),Math.sqrt(Math.pow(c.x-h.x,2)+Math.pow(c.y-h.y,2)));t<a&&(a=t,n=s)}}var h,c;if(n){const t=n.tooltipPosition();r=t.x,o=t.y}return{x:r,y:o}}};function bn(t,i){return i&&(W(i)?Array.prototype.push.apply(t,i):t.push(i)),t}function pn(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function gn(t,i){const{element:e,datasetIndex:s,index:n}=i,r=t.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:t,label:o,parsed:r.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function mn(t,i){const e=t.chart.ctx,{body:s,footer:n,title:r}=t,{boxWidth:o,boxHeight:a}=i,h=xi(i.bodyFont),c=xi(i.titleFont),l=xi(i.footerFont),u=r.length,d=n.length,f=s.length,b=yi(i.padding);let p=b.height,g=0,m=s.reduce(((t,i)=>t+i.before.length+i.lines.length+i.after.length),0);m+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*i.titleSpacing+i.titleMarginBottom),m&&(p+=f*(i.displayColors?Math.max(a,h.lineHeight):h.lineHeight)+(m-f)*h.lineHeight+(m-1)*i.bodySpacing),d&&(p+=i.footerMarginTop+d*l.lineHeight+(d-1)*i.footerSpacing);let v=0;const y=function(t){g=Math.max(g,e.measureText(t).width+v)};return e.save(),e.font=c.string,U(t.title,y),e.font=h.string,U(t.beforeBody.concat(t.afterBody),y),v=i.displayColors?o+2+i.boxPadding:0,U(s,(t=>{U(t.before,y),U(t.lines,y),U(t.after,y)})),v=0,e.font=l.string,U(t.footer,y),e.restore(),g+=b.width,{width:g,height:p}}function vn(t,i,e,s){const{x:n,width:r}=e,{width:o,chartArea:{left:a,right:h}}=t;let c="center";return"center"===s?c=n<=(a+h)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),function(t,i,e,s){const{x:n,width:r}=s,o=e.caretSize+e.caretPadding;return"left"===t&&n+r+o>i.width||"right"===t&&n-r-o<0||void 0}(c,t,i,e)&&(c="center"),c}function yn(t,i,e){const s=e.yAlign||i.yAlign||function(t,i){const{y:e,height:s}=i;return e<s/2?"top":e>t.height-s/2?"bottom":"center"}(t,e);return{xAlign:e.xAlign||i.xAlign||vn(t,i,e,s),yAlign:s}}function xn(t,i,e,s){const{caretSize:n,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:h}=e,c=n+r,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:f}=vi(o);let b=function(t,i){let{x:e,width:s}=t;return"right"===i?e-=s:"center"===i&&(e-=s/2),e}(i,a);const p=function(t,i,e){let{y:s,height:n}=t;return"top"===i?s+=e:s-="bottom"===i?n+e:n/2,s}(i,h,c);return"center"===h?"left"===a?b+=c:"right"===a&&(b-=c):"left"===a?b-=Math.max(l,d)+n:"right"===a&&(b+=Math.max(u,f)+n),{x:_t(b,0,s.width-i.width),y:_t(p,0,s.height-i.height)}}function Mn(t,i,e){const s=yi(e.padding);return"center"===i?t.x+t.width/2:"right"===i?t.x+t.width-s.right:t.x+s.left}function kn(t){return bn([],pn(t))}function wn(t,i){const e=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return e?t.override(e):t}const _n={beforeTitle:F,title(t){if(t.length>0){const i=t[0],e=i.chart.data.labels,s=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return i.dataset.label||"";if(i.label)return i.label;if(s>0&&i.dataIndex<s)return e[i.dataIndex]}return""},afterTitle:F,beforeBody:F,beforeLabel:F,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let i=t.dataset.label||"";i&&(i+=": ");const e=t.formattedValue;return N(e)||(i+=e),i},labelColor(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:F,afterBody:F,beforeFooter:F,footer:F,afterFooter:F};function An(t,i,e,s){const n=t[i].call(e,s);return void 0===n?_n[i].call(e,s):n}class On extends as{static positioners=fn;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,e=this.options.setContext(this.getContext()),s=e.enabled&&i.options.animation&&e.animations,n=new se(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=ki(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,i){const{callbacks:e}=i,s=An(e,"beforeTitle",this,t),n=An(e,"title",this,t),r=An(e,"afterTitle",this,t);let o=[];return o=bn(o,pn(s)),o=bn(o,pn(n)),o=bn(o,pn(r)),o}getBeforeBody(t,i){return kn(An(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:e}=i,s=[];return U(t,(t=>{const i={before:[],lines:[],after:[]},n=wn(e,t);bn(i.before,pn(An(n,"beforeLabel",this,t))),bn(i.lines,An(n,"label",this,t)),bn(i.after,pn(An(n,"afterLabel",this,t))),s.push(i)})),s}getAfterBody(t,i){return kn(An(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:e}=i,s=An(e,"beforeFooter",this,t),n=An(e,"footer",this,t),r=An(e,"afterFooter",this,t);let o=[];return o=bn(o,pn(s)),o=bn(o,pn(n)),o=bn(o,pn(r)),o}_createItems(t){const i=this._active,e=this.chart.data,s=[],n=[],r=[];let o,a,h=[];for(o=0,a=i.length;o<a;++o)h.push(gn(this.chart,i[o]));return t.filter&&(h=h.filter(((i,s,n)=>t.filter(i,s,n,e)))),t.itemSort&&(h=h.sort(((i,s)=>t.itemSort(i,s,e)))),U(h,(i=>{const e=wn(t.callbacks,i);s.push(An(e,"labelColor",this,i)),n.push(An(e,"labelPointStyle",this,i)),r.push(An(e,"labelTextColor",this,i))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=r,this.dataPoints=h,h}update(t,i){const e=this.options.setContext(this.getContext()),s=this._active;let n,r=[];if(s.length){const t=fn[e.position].call(this,s,this._eventPosition);r=this._createItems(e),this.title=this.getTitle(r,e),this.beforeBody=this.getBeforeBody(r,e),this.body=this.getBody(r,e),this.afterBody=this.getAfterBody(r,e),this.footer=this.getFooter(r,e);const i=this._size=mn(this,e),o=Object.assign({},t,i),a=yn(this.chart,e,o),h=xn(e,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,n={opacity:1,x:h.x,y:h.y,width:i.width,height:i.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=r,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&e.external&&e.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,e,s){const n=this.getCaretPosition(t,e,s);i.lineTo(n.x1,n.y1),i.lineTo(n.x2,n.y2),i.lineTo(n.x3,n.y3)}getCaretPosition(t,i,e){const{xAlign:s,yAlign:n}=this,{caretSize:r,cornerRadius:o}=e,{topLeft:a,topRight:h,bottomLeft:c,bottomRight:l}=vi(o),{x:u,y:d}=t,{width:f,height:b}=i;let p,g,m,v,y,x;return"center"===n?(y=d+b/2,"left"===s?(p=u,g=p-r,v=y+r,x=y-r):(p=u+f,g=p+r,v=y-r,x=y+r),m=p):(g="left"===s?u+Math.max(a,c)+r:"right"===s?u+f-Math.max(h,l)-r:this.caretX,"top"===n?(v=d,y=v-r,p=g-r,m=g+r):(v=d+b,y=v+r,p=g+r,m=g-r),x=v),{x1:p,x2:g,x3:m,y1:v,y2:y,y3:x}}drawTitle(t,i,e){const s=this.title,n=s.length;let r,o,a;if(n){const h=Zi(e.rtl,this.x,this.width);for(t.x=Mn(this,e.titleAlign,e),i.textAlign=h.textAlign(e.titleAlign),i.textBaseline="middle",r=xi(e.titleFont),o=e.titleSpacing,i.fillStyle=e.titleColor,i.font=r.string,a=0;a<n;++a)i.fillText(s[a],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+o,a+1===n&&(t.y+=e.titleMarginBottom-o)}}_drawColorBox(t,i,e,s,n){const r=this.labelColors[e],o=this.labelPointStyles[e],{boxHeight:a,boxWidth:h}=n,c=xi(n.bodyFont),l=Mn(this,"left",n),u=s.x(l),d=i.y+(a<c.lineHeight?(c.lineHeight-a)/2:0);if(n.usePointStyle){const i={radius:Math.min(h,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},e=s.leftForLtr(u,h)+h/2,c=d+a/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,si(t,i,e,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,si(t,i,e,c)}else{t.lineWidth=$(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const i=s.leftForLtr(u,h),e=s.leftForLtr(s.xPlus(u,1),h-2),o=vi(r.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,ui(t,{x:i,y:d,w:h,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ui(t,{x:e,y:d+1,w:h-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(i,d,h,a),t.strokeRect(i,d,h,a),t.fillStyle=r.backgroundColor,t.fillRect(e,d+1,h-2,a-2))}t.fillStyle=this.labelTextColors[e]}drawBody(t,i,e){const{body:s}=this,{bodySpacing:n,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:h,boxPadding:c}=e,l=xi(e.bodyFont);let u=l.lineHeight,d=0;const f=Zi(e.rtl,this.x,this.width),b=function(e){i.fillText(e,f.x(t.x+d),t.y+u/2),t.y+=u+n},p=f.textAlign(r);let g,m,v,y,x,M,k;for(i.textAlign=r,i.textBaseline="middle",i.font=l.string,t.x=Mn(this,p,e),i.fillStyle=e.bodyColor,U(this.beforeBody,b),d=o&&"right"!==p?"center"===r?h/2+c:h+2+c:0,y=0,M=s.length;y<M;++y){for(g=s[y],m=this.labelTextColors[y],i.fillStyle=m,U(g.before,b),v=g.lines,o&&v.length&&(this._drawColorBox(i,t,y,f,e),u=Math.max(l.lineHeight,a)),x=0,k=v.length;x<k;++x)b(v[x]),u=l.lineHeight;U(g.after,b)}d=0,u=l.lineHeight,U(this.afterBody,b),t.y-=n}drawFooter(t,i,e){const s=this.footer,n=s.length;let r,o;if(n){const a=Zi(e.rtl,this.x,this.width);for(t.x=Mn(this,e.footerAlign,e),t.y+=e.footerMarginTop,i.textAlign=a.textAlign(e.footerAlign),i.textBaseline="middle",r=xi(e.footerFont),i.fillStyle=e.footerColor,i.font=r.string,o=0;o<n;++o)i.fillText(s[o],a.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+e.footerSpacing}}drawBackground(t,i,e,s){const{xAlign:n,yAlign:r}=this,{x:o,y:a}=t,{width:h,height:c}=e,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:f}=vi(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(o+l,a),"top"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+h-u,a),i.quadraticCurveTo(o+h,a,o+h,a+u),"center"===r&&"right"===n&&this.drawCaret(t,i,e,s),i.lineTo(o+h,a+c-f),i.quadraticCurveTo(o+h,a+c,o+h-f,a+c),"bottom"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+d,a+c),i.quadraticCurveTo(o,a+c,o,a+c-d),"center"===r&&"left"===n&&this.drawCaret(t,i,e,s),i.lineTo(o,a+l),i.quadraticCurveTo(o,a,o+l,a),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,e=this.$animations,s=e&&e.x,n=e&&e.y;if(s||n){const e=fn[t.position].call(this,this._active,this._eventPosition);if(!e)return;const r=this._size=mn(this,t),o=Object.assign({},e,this._size),a=yn(i,t,o),h=xn(t,o,a,i);s._to===h.x&&n._to===h.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let e=this.opacity;if(!e)return;this._updateAnimationTarget(i);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};e=Math.abs(e)<.001?0:e;const r=yi(i.padding);i.enabled&&(this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length)&&(t.save(),t.globalAlpha=e,this.drawBackground(n,t,s,i),Ki(t,i.textDirection),n.y+=r.top,this.drawTitle(n,t,i),this.drawBody(n,t,i),this.drawFooter(n,t,i),Qi(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const e=this._active,s=t.map((({datasetIndex:t,index:i})=>{const e=this.chart.getDatasetMeta(t);if(!e)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:e.data[i],index:i}})),n=!Z(e,s),r=this._positionChanged(s,i);(n||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,e=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],r=this._getActiveElements(t,n,i,e),o=this._positionChanged(r,t),a=i||!Z(r,n)||o;return a&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),a}_getActiveElements(t,i,e,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return i.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const r=this.chart.getElementsAtEventForMode(t,n.mode,n,e);return n.reverse&&r.reverse(),r}_positionChanged(t,i){const{caretX:e,caretY:s,options:n}=this,r=fn[n.position].call(this,t,i);return!1!==r&&(e!==r.x||s!==r.y)}}var Sn={id:"tooltip",_element:On,positioners:fn,afterInit(t,i,e){e&&(t.tooltip=new On({chart:t,options:e}))},beforeUpdate(t,i,e){t.tooltip&&t.tooltip.initialize(e)},reset(t,i,e){t.tooltip&&t.tooltip.initialize(e)},afterDraw(t){const i=t.tooltip;if(i&&i._willRender()){const e={tooltip:i};if(!1===t.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0}))return;i.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e)}},afterEvent(t,i){t.tooltip&&t.tooltip.handleEvent(i.event,i.replay,i.inChartArea)&&(i.changed=!0)},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,i)=>i.bodyFont.size,boxWidth:(t,i)=>i.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:_n},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Rn(t){const i=this.getLabels();return t>=0&&t<i.length?i[t]:t}class Dn extends gs{static id="category";static defaults={ticks:{callback:Rn}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const i=this._addedLabels;if(i.length){const t=this.getLabels();for(const{index:e,label:s}of i)t[e]===s&&t.splice(e,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(N(t))return null;const e=this.getLabels();return((t,i)=>null===t?null:_t(Math.round(t),0,i))(i=isFinite(i)&&e[i]===t?i:function(t,i,e,s){const n=t.indexOf(i);return-1===n?((t,i,e,s)=>("string"==typeof i?(e=t.push(i)-1,s.unshift({index:e,label:i})):isNaN(i)&&(e=null),e))(t,i,e,s):n!==t.lastIndexOf(i)?e:n}(e,t,Y(i,t),this._addedLabels),e.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:e,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(e=0),i||(s=this.getLabels().length-1)),this.min=e,this.max=s}buildTicks(){const t=this.min,i=this.max,e=this.options.offset,s=[];let n=this.getLabels();n=0===t&&i===n.length-1?n:n.slice(t,i+1),this._valueRange=Math.max(n.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let e=t;e<=i;e++)s.push({value:e});return s}getLabelForValue(t){return Rn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function jn(t,i,{horizontal:e,minRotation:s}){const n=xt(s),r=(e?Math.sin(n):Math.cos(n))||.001;return Math.min(i/r,.75*i*(""+t).length)}class Bn extends gs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return N(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this;const r=t=>s=i?s:t,o=t=>n=e?n:t;if(t){const t=gt(s),i=gt(n);t<0&&i<0?o(0):t>0&&i>0&&r(0)}if(s===n){let i=0===n?1:Math.abs(.05*n);o(n+i),t||r(s-i)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let i,{maxTicksLimit:e,stepSize:s}=t;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let e=this.getTickLimit();e=Math.max(2,e);const s=function(t,i){const e=[],{bounds:s,step:n,min:r,max:o,precision:a,count:h,maxTicks:c,maxDigits:l,includeBounds:u}=t,d=n||1,f=c-1,{min:b,max:p}=i,g=!N(r),m=!N(o),v=!N(h),y=(p-b)/(l+1);let x,M,k,w,_=vt((p-b)/f/d)*d;if(_<1e-14&&!g&&!m)return[{value:b},{value:p}];w=Math.ceil(p/_)-Math.floor(b/_),w>f&&(_=vt(w*_/f/d)*d),N(a)||(x=Math.pow(10,a),_=Math.ceil(_*x)/x),"ticks"===s?(M=Math.floor(b/_)*_,k=Math.ceil(p/_)*_):(M=b,k=p),g&&m&&n&&function(t,i){const e=Math.round(t);return e-i<=t&&e+i>=t}((o-r)/n,_/1e3)?(w=Math.round(Math.min((o-r)/_,c)),_=(o-r)/w,M=r,k=o):v?(M=g?r:M,k=m?o:k,w=h-1,_=(k-M)/w):(w=(k-M)/_,w=mt(w,Math.round(w),_/1e3)?Math.round(w):Math.ceil(w));const A=Math.max(Mt(_),Mt(M));x=Math.pow(10,N(a)?A:a),M=Math.round(M*x)/x,k=Math.round(k*x)/x;let O=0;for(g&&(u&&M!==r?(e.push({value:r}),M<r&&O++,mt(Math.round((M+O*_)*x)/x,r,jn(r,y,t))&&O++):M<r&&O++);O<w;++O){const t=Math.round((M+O*_)*x)/x;if(m&&t>o)break;e.push({value:t})}return m&&u&&k!==o?e.length&&mt(e[e.length-1].value,o,jn(o,y,t))?e[e.length-1].value=o:e.push({value:o}):m&&k!==o||e.push({value:k}),e}({maxTicks:e,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,i){let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e].value,isNaN(n)||(i.min=Math.min(i.min,n),i.max=Math.max(i.max,n))}(s,this),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let i=this.min,e=this.max;if(super.configure(),this.options.offset&&t.length){const s=(e-i)/Math.max(t.length-1,1)/2;i-=s,e+=s}this._startValue=i,this._endValue=e,this._valueRange=e-i}getLabelForValue(t){return Yt(t,this.chart.options.locale,this.options.ticks.format)}}class Cn extends Bn{static id="linear";static defaults={ticks:{callback:Xt.formatters.numeric}};determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=H(t)?t:0,this.max=H(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,e=xt(this.options.ticks.minRotation),s=(t?Math.sin(e):Math.cos(e))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const En=class{constructor(i){t(this,i),this.accountId=void 0,this.authToken=void 0,this.data=void 0,this.total=void 0,this.dates=void 0,this.endDate=void 0,this.loading=!0,this.errorMessage=""}updateOnPropChange(){this.fetchData()}connectedCallback(){this.fetchData()}componentDidRender(){this.renderChart()}async fetchData(){if(!this.accountId||!this.authToken)return this.errorMessage="Can not fetch any data without an AccountID and an AuthToken",void(this.loading=!1);this.loading=!0;try{const t=s(this.authToken,a.proxyApiOrigin),i=`account/${this.accountId}/reports/gross_volume`,e=await t.get(i);e.error?(this.errorMessage=`Error trying to fetch data : ${e.error}`,console.error(this.errorMessage)):(this.total=null==e?void 0:e.data.total,this.dates=null==e?void 0:e.data.dates.reverse(),this.endDate=this.dates[this.dates.length-1].date)}catch(t){this.errorMessage=`Error trying to fetch data : ${t}`,console.error(this.errorMessage)}finally{this.loading=!1}}renderChart(){var t,i;this.chart?this.chart.update():this.chartRef&&this.endDate&&(Vs.register(on,we,Js,Dn,Cn,ln,Sn,dn),this.chart=new Vs(this.chartRef.getContext("2d"),(t=this.dates,i=this.endDate,{type:"bar",options:{plugins:{legend:{display:!1},title:{display:!0,text:["Trailing 30 Days","Gross Payments",n(this.total)],position:"top",align:"start"},tooltip:{displayColors:!1,intersect:!1,callbacks:{label:e=>{let s=e.dataIndex;return[r(t[s].date,i),n(t[s].value)]}}}},scales:{x:{grid:{drawOnChartArea:!1,drawTicks:!1},ticks:{callback:e=>{if(0===e||e===t.length-1)return r(t[e].date,i)}}},y:{display:!1}}},data:{labels:t.map((()=>"")),datasets:[{label:"Gross Volume by Date",data:t.map((t=>t.value))}]}})),this.chart.render())}render(){return i(e,null,this.errorMessage?o(this.errorMessage):i("canvas",{id:"chart",ref:t=>this.chartRef=t}))}static get watchers(){return{accountId:["updateOnPropChange"],authToken:["updateOnPropChange"]}}};En.style=':root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33, 37, 41;--bs-body-bg:#fff;--bs-body-bg-rgb:255, 255, 255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0, 0, 0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33, 37, 41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233, 236, 239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33, 37, 41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248, 249, 250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13, 110, 253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10, 88, 202;--bs-code-color:#d63384;--bs-highlight-color:#212529;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222, 226, 230;--bs-body-bg:#212529;--bs-body-bg-rgb:33, 37, 41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255, 255, 255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222, 226, 230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52, 58, 64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222, 226, 230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43, 48, 53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110, 168, 254;--bs-link-hover-color-rgb:139, 185, 254;--bs-code-color:#e685b5;--bs-highlight-color:#dee2e6;--bs-highlight-bg:#664d03;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) }}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:0.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:0.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:0.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:0.25}:host{display:block}';export{En as justifi_gross_payment_chart}