hyrax 3.6.0 → 4.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (497) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +41 -61
  3. data/.dassie/Gemfile +4 -4
  4. data/.dassie/app/assets/javascripts/application.js +8 -4
  5. data/.dassie/app/assets/stylesheets/application.css +1 -1
  6. data/.dassie/app/assets/stylesheets/hyrax.scss +1 -2
  7. data/.dassie/app/controllers/application_controller.rb +1 -3
  8. data/.dassie/app/controllers/catalog_controller.rb +23 -19
  9. data/.dassie/app/models/user.rb +0 -3
  10. data/.dassie/config/analytics.yml +2 -4
  11. data/.dassie/config/application.rb +1 -1
  12. data/.dassie/config/initializers/riiif.rb +1 -1
  13. data/.dassie/db/schema.rb +5 -5
  14. data/.dassie/package.json +7 -7
  15. data/.engine_cart.yml +2 -39
  16. data/.env +1 -0
  17. data/.github/workflows/main.yml +17 -0
  18. data/.github/workflows/release.yml +17 -0
  19. data/.regen +1 -1
  20. data/.rubocop.yml +1 -1
  21. data/CONTRIBUTING.md +22 -24
  22. data/Dockerfile +1 -1
  23. data/Rakefile +0 -4
  24. data/app/actors/hyrax/actors/base_actor.rb +1 -1
  25. data/app/actors/hyrax/actors/collections_membership_actor.rb +1 -1
  26. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +5 -11
  27. data/app/actors/hyrax/actors/embargo_actor.rb +4 -11
  28. data/app/actors/hyrax/actors/file_actor.rb +9 -37
  29. data/app/actors/hyrax/actors/file_set_actor.rb +13 -62
  30. data/app/actors/hyrax/actors/lease_actor.rb +4 -11
  31. data/app/assets/javascripts/hyrax/analytics_events.js +38 -88
  32. data/app/assets/javascripts/hyrax/app.js.erb +2 -2
  33. data/app/assets/javascripts/hyrax/batch.js +2 -2
  34. data/app/assets/javascripts/hyrax/batch_edit.js +4 -4
  35. data/app/assets/javascripts/hyrax/batch_select_all.js +13 -13
  36. data/app/assets/javascripts/hyrax/browse_everything.js +4 -2
  37. data/app/assets/javascripts/hyrax/collection_types.es6 +1 -1
  38. data/app/assets/javascripts/hyrax/collections/editor.es6 +5 -1
  39. data/app/assets/javascripts/hyrax/dashboard_actions.js +5 -5
  40. data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +3 -3
  41. data/app/assets/javascripts/hyrax/editor.es6 +3 -3
  42. data/app/assets/javascripts/hyrax/facets.js +6 -4
  43. data/app/assets/javascripts/hyrax/file_manager/member.es6 +1 -1
  44. data/app/assets/javascripts/hyrax/file_manager/save_manager.es6 +2 -2
  45. data/app/assets/javascripts/hyrax/file_manager/sorting.es6 +2 -2
  46. data/app/assets/javascripts/hyrax/file_manager.es6 +2 -17
  47. data/app/assets/javascripts/hyrax/notification.es6 +1 -1
  48. data/app/assets/javascripts/hyrax/permissions/control.es6 +1 -8
  49. data/app/assets/javascripts/hyrax/permissions/registry.es6 +4 -4
  50. data/app/assets/javascripts/hyrax/permissions/user_controls.es6 +3 -1
  51. data/app/assets/javascripts/hyrax/relationships/confirm_remove_dialog.es6 +1 -1
  52. data/app/assets/javascripts/hyrax/relationships/control.es6 +2 -2
  53. data/app/assets/javascripts/hyrax/relationships/registry_entry.es6 +1 -1
  54. data/app/assets/javascripts/hyrax/reports-buttons.js +9 -9
  55. data/app/assets/javascripts/hyrax/save_work/required_fields.es6 +1 -1
  56. data/app/assets/javascripts/hyrax/save_work/save_work_control.es6 +6 -6
  57. data/app/assets/javascripts/hyrax/save_work/uploaded_files.es6 +2 -2
  58. data/app/assets/javascripts/hyrax/single_use_links_manager.js +1 -1
  59. data/app/assets/javascripts/hyrax/skip_to_content.js +1 -1
  60. data/app/assets/javascripts/hyrax/sorting.js +1 -1
  61. data/app/assets/javascripts/hyrax/trophy.js +1 -1
  62. data/app/assets/javascripts/hyrax/uploader.js +3 -3
  63. data/app/assets/javascripts/hyrax.js +1 -19
  64. data/app/assets/stylesheets/_bootstrap-default-overrides.scss +4 -4
  65. data/app/assets/stylesheets/hyrax/_accessibility.scss +1 -1
  66. data/app/assets/stylesheets/hyrax/_badge.scss +7 -0
  67. data/app/assets/stylesheets/hyrax/_batch-edit.scss +8 -8
  68. data/app/assets/stylesheets/hyrax/_browse_everything_overrides.scss +1 -1
  69. data/app/assets/stylesheets/hyrax/_buttons.scss +31 -1
  70. data/app/assets/stylesheets/hyrax/_card.scss +10 -0
  71. data/app/assets/stylesheets/hyrax/_catalog.scss +22 -48
  72. data/app/assets/stylesheets/hyrax/_collection_types.scss +1 -1
  73. data/app/assets/stylesheets/hyrax/_collections.scss +13 -13
  74. data/app/assets/stylesheets/hyrax/_facets.scss +46 -0
  75. data/app/assets/stylesheets/hyrax/_featured.scss +1 -1
  76. data/app/assets/stylesheets/hyrax/_file-listing.scss +3 -3
  77. data/app/assets/stylesheets/hyrax/_file_manager.scss +17 -17
  78. data/app/assets/stylesheets/hyrax/_file_sets.scss +1 -1
  79. data/app/assets/stylesheets/hyrax/_file_upload.scss +4 -4
  80. data/app/assets/stylesheets/hyrax/_fixedsticky.scss +1 -1
  81. data/app/assets/stylesheets/hyrax/_footer.scss +3 -3
  82. data/app/assets/stylesheets/hyrax/_form-progress.scss +9 -9
  83. data/app/assets/stylesheets/hyrax/_form.scss +3 -4
  84. data/app/assets/stylesheets/hyrax/_forms.scss +62 -29
  85. data/app/assets/stylesheets/hyrax/_header.scss +0 -17
  86. data/app/assets/stylesheets/hyrax/_home-page.scss +13 -51
  87. data/app/assets/stylesheets/hyrax/_html.scss +11 -0
  88. data/app/assets/stylesheets/hyrax/_hyrax.scss +16 -14
  89. data/app/assets/stylesheets/hyrax/_nestable.scss +1 -1
  90. data/app/assets/stylesheets/hyrax/_select_work_type.scss +2 -2
  91. data/app/assets/stylesheets/hyrax/_styles.scss +9 -14
  92. data/app/assets/stylesheets/hyrax/_users.scss +2 -2
  93. data/app/assets/stylesheets/hyrax/_variables.scss +20 -1
  94. data/app/assets/stylesheets/hyrax/_work-show.scss +21 -13
  95. data/app/assets/stylesheets/hyrax/blacklight_gallery.scss +75 -2
  96. data/app/assets/stylesheets/hyrax/dashboard.scss +70 -95
  97. data/app/assets/stylesheets/hyrax/sidebar.scss +39 -19
  98. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +9 -0
  99. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +2 -11
  100. data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +2 -11
  101. data/app/controllers/concerns/hyrax/manages_embargoes.rb +1 -13
  102. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +4 -9
  103. data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +2 -2
  104. data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +1 -1
  105. data/app/controllers/hyrax/admin/strategies_controller.rb +1 -1
  106. data/app/controllers/hyrax/admin/workflows_controller.rb +3 -48
  107. data/app/controllers/hyrax/batch_edits_controller.rb +1 -1
  108. data/app/controllers/hyrax/dashboard/collections_controller.rb +2 -1
  109. data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +0 -32
  110. data/app/controllers/hyrax/downloads_controller.rb +1 -16
  111. data/app/controllers/hyrax/file_sets_controller.rb +4 -10
  112. data/app/controllers/hyrax/homepage_controller.rb +0 -1
  113. data/app/controllers/hyrax/my_controller.rb +0 -6
  114. data/app/controllers/hyrax/permissions_controller.rb +1 -1
  115. data/app/controllers/hyrax/single_use_links_controller.rb +1 -2
  116. data/app/controllers/hyrax/transfers_controller.rb +2 -0
  117. data/app/controllers/hyrax/workflow_actions_controller.rb +2 -3
  118. data/app/forms/hyrax/forms/collection_form.rb +1 -1
  119. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +0 -2
  120. data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
  121. data/app/forms/hyrax/forms/file_set_form.rb +35 -8
  122. data/app/forms/hyrax/forms/resource_form.rb +32 -36
  123. data/app/helpers/hyrax/embargo_helper.rb +0 -11
  124. data/app/helpers/hyrax/facets_helper.rb +150 -0
  125. data/app/helpers/hyrax/hyrax_helper_behavior.rb +5 -5
  126. data/app/helpers/hyrax/lease_helper.rb +0 -11
  127. data/app/indexers/hyrax/basic_metadata_indexer.rb +3 -9
  128. data/app/indexers/hyrax/pcdm_collection_indexer.rb +0 -1
  129. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +8 -2
  130. data/app/jobs/characterize_job.rb +4 -7
  131. data/app/jobs/content_event_job.rb +1 -1
  132. data/app/jobs/create_derivatives_job.rb +4 -2
  133. data/app/jobs/ingest_local_file_job.rb +5 -13
  134. data/app/jobs/inherit_permissions_job.rb +1 -5
  135. data/app/models/admin_set.rb +0 -8
  136. data/app/models/concerns/hyrax/collection_behavior.rb +2 -3
  137. data/app/models/concerns/hyrax/collection_nesting.rb +1 -10
  138. data/app/models/concerns/hyrax/file_set_behavior.rb +1 -2
  139. data/app/models/concerns/hyrax/in_admin_set.rb +0 -7
  140. data/app/models/concerns/hyrax/user.rb +3 -3
  141. data/app/models/concerns/hyrax/work_behavior.rb +1 -3
  142. data/app/models/content_block.rb +0 -6
  143. data/app/models/hyrax/embargo.rb +1 -1
  144. data/app/models/hyrax/file_metadata.rb +1 -1
  145. data/app/models/hyrax/file_set.rb +3 -3
  146. data/app/models/hyrax/lease.rb +1 -1
  147. data/app/models/hyrax/permission_template.rb +0 -35
  148. data/app/models/proxy_deposit_request.rb +1 -1
  149. data/app/presenters/hyrax/admin/repository_object_presenter.rb +0 -2
  150. data/app/presenters/hyrax/collapsable_section_presenter.rb +2 -2
  151. data/app/presenters/hyrax/collection_presenter.rb +1 -1
  152. data/app/presenters/hyrax/fixity_status_presenter.rb +2 -2
  153. data/app/presenters/hyrax/menu_presenter.rb +1 -1
  154. data/app/presenters/hyrax/permission_badge.rb +8 -9
  155. data/app/presenters/hyrax/version_list_presenter.rb +1 -6
  156. data/app/presenters/hyrax/workflow_presenter.rb +1 -1
  157. data/app/renderers/hyrax/renderers/external_link_attribute_renderer.rb +1 -1
  158. data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +5 -13
  159. data/app/search_builders/hyrax/deposit_search_builder.rb +1 -1
  160. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +10 -1
  161. data/app/search_builders/hyrax/single_result.rb +1 -1
  162. data/app/search_builders/hyrax/stats/work_status_search_builder.rb +1 -1
  163. data/app/services/hyrax/adapters/nesting_index_adapter.rb +1 -1
  164. data/app/services/hyrax/analytics/google.rb +15 -23
  165. data/app/services/hyrax/analytics/matomo.rb +3 -4
  166. data/app/services/hyrax/collection_member_service.rb +1 -2
  167. data/app/services/hyrax/collections/nested_collection_query_service.rb +1 -1
  168. data/app/services/hyrax/collections/search_service.rb +0 -1
  169. data/app/services/hyrax/custom_queries.rb +25 -0
  170. data/app/services/hyrax/edit_permissions_service.rb +3 -21
  171. data/app/services/hyrax/embargo_manager.rb +0 -9
  172. data/app/services/hyrax/file_set_csv_service.rb +1 -1
  173. data/app/services/hyrax/graph_exporter.rb +3 -8
  174. data/app/services/hyrax/iiif_authorization_service.rb +1 -1
  175. data/app/services/hyrax/lease_manager.rb +0 -9
  176. data/app/services/hyrax/listeners/file_metadata_listener.rb +0 -11
  177. data/app/services/hyrax/search_service.rb +1 -81
  178. data/app/services/hyrax/solr_query_service.rb +4 -4
  179. data/app/services/hyrax/statistics/depositors/summary.rb +1 -3
  180. data/app/services/hyrax/user_stat_importer.rb +0 -2
  181. data/app/services/hyrax/valkyrie_upload.rb +13 -1
  182. data/app/services/hyrax/versioning_service.rb +9 -77
  183. data/app/services/hyrax/visibility_propagator.rb +5 -5
  184. data/app/services/hyrax/work_query_service.rb +1 -1
  185. data/app/services/hyrax/workflow/actionable_objects.rb +3 -28
  186. data/app/services/hyrax/workflow/permission_query.rb +2 -23
  187. data/app/services/hyrax/working_directory.rb +2 -0
  188. data/app/views/_controls.html.erb +14 -18
  189. data/app/views/_logo.html.erb +0 -1
  190. data/app/views/_masthead.html.erb +8 -18
  191. data/app/views/_user_util_links.html.erb +16 -18
  192. data/app/views/catalog/_document.html.erb +2 -2
  193. data/app/views/catalog/_document_list.html.erb +1 -1
  194. data/app/views/catalog/_facet_limit.html.erb +1 -1
  195. data/app/views/catalog/_index_gallery_collection_wrapper.html.erb +1 -1
  196. data/app/views/catalog/_index_header_list_collection.html.erb +2 -2
  197. data/app/views/catalog/_index_header_list_default.html.erb +1 -1
  198. data/app/views/catalog/_index_list_default.html.erb +7 -5
  199. data/app/views/catalog/_search_form.html.erb +13 -15
  200. data/app/views/catalog/_thumbnail_list_collection.html.erb +2 -2
  201. data/app/views/catalog/_thumbnail_list_default.html.erb +3 -3
  202. data/app/views/catalog/facet.html.erb +21 -0
  203. data/app/views/catalog/index.html.erb +6 -4
  204. data/app/views/hyrax/admin/admin_sets/_form.html.erb +16 -16
  205. data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +35 -33
  206. data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +9 -8
  207. data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +24 -24
  208. data/app/views/hyrax/admin/admin_sets/_form_workflow.erb +5 -5
  209. data/app/views/hyrax/admin/admin_sets/_show_actions.html.erb +3 -3
  210. data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +9 -9
  211. data/app/views/hyrax/admin/admin_sets/index.html.erb +3 -3
  212. data/app/views/hyrax/admin/admin_sets/show.html.erb +4 -4
  213. data/app/views/hyrax/admin/analytics/_date_range_form.html.erb +3 -3
  214. data/app/views/hyrax/admin/analytics/collection_reports/_custom_range.html.erb +3 -3
  215. data/app/views/hyrax/admin/analytics/collection_reports/_monthly_summary.html.erb +3 -3
  216. data/app/views/hyrax/admin/analytics/collection_reports/_summary.html.erb +3 -3
  217. data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +7 -7
  218. data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +7 -7
  219. data/app/views/hyrax/admin/analytics/collection_reports/show.html.erb +10 -10
  220. data/app/views/hyrax/admin/analytics/work_reports/_custom_range.html.erb +3 -3
  221. data/app/views/hyrax/admin/analytics/work_reports/_monthly_summary.html.erb +3 -3
  222. data/app/views/hyrax/admin/analytics/work_reports/_summary.html.erb +3 -3
  223. data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +5 -5
  224. data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +7 -7
  225. data/app/views/hyrax/admin/analytics/work_reports/_work_counts.html.erb +4 -4
  226. data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +5 -5
  227. data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +8 -8
  228. data/app/views/hyrax/admin/analytics/work_reports/show.html.erb +10 -10
  229. data/app/views/hyrax/admin/appearances/show.html.erb +2 -2
  230. data/app/views/hyrax/admin/collection_types/_form.html.erb +24 -23
  231. data/app/views/hyrax/admin/collection_types/_form_appearance.html.erb +2 -2
  232. data/app/views/hyrax/admin/collection_types/_form_participants.html.erb +4 -4
  233. data/app/views/hyrax/admin/collection_types/_form_settings.html.erb +9 -9
  234. data/app/views/hyrax/admin/collection_types/index.html.erb +6 -6
  235. data/app/views/hyrax/admin/features/index.html.erb +3 -3
  236. data/app/views/hyrax/admin/stats/_new_users.html.erb +1 -1
  237. data/app/views/hyrax/admin/stats/show.html.erb +4 -6
  238. data/app/views/hyrax/admin/users/index.html.erb +3 -3
  239. data/app/views/hyrax/admin/workflow_roles/index.html.erb +8 -8
  240. data/app/views/hyrax/admin/workflows/index.html.erb +80 -55
  241. data/app/views/hyrax/base/_citations.html.erb +6 -6
  242. data/app/views/hyrax/base/_currently_shared.html.erb +3 -3
  243. data/app/views/hyrax/base/_file_manager_actions.html.erb +5 -3
  244. data/app/views/hyrax/base/_file_manager_member.html.erb +5 -5
  245. data/app/views/hyrax/base/_file_manager_member_resource_options.html.erb +6 -6
  246. data/app/views/hyrax/base/_file_manager_members.html.erb +1 -1
  247. data/app/views/hyrax/base/_file_manager_thumbnail.html.erb +1 -1
  248. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +3 -3
  249. data/app/views/hyrax/base/_form_files.html.erb +9 -9
  250. data/app/views/hyrax/base/_form_member_of_collections.html.erb +3 -3
  251. data/app/views/hyrax/base/_form_metadata.html.erb +1 -1
  252. data/app/views/hyrax/base/_form_permission.html.erb +30 -20
  253. data/app/views/hyrax/base/_form_permission_under_embargo.html.erb +1 -1
  254. data/app/views/hyrax/base/_form_permission_under_lease.html.erb +1 -1
  255. data/app/views/hyrax/base/_form_progress.html.erb +7 -7
  256. data/app/views/hyrax/base/_form_relationships.html.erb +1 -1
  257. data/app/views/hyrax/base/_form_rendering.html.erb +1 -1
  258. data/app/views/hyrax/base/_form_representative.html.erb +1 -1
  259. data/app/views/hyrax/base/_form_share.html.erb +6 -6
  260. data/app/views/hyrax/base/_form_thumbnail.html.erb +1 -1
  261. data/app/views/hyrax/base/_form_visibility_component.html.erb +16 -20
  262. data/app/views/hyrax/base/_guts4form.html.erb +12 -20
  263. data/app/views/hyrax/base/_member.html.erb +1 -1
  264. data/app/views/hyrax/base/_metadata.html.erb +1 -1
  265. data/app/views/hyrax/base/_show_actions.html.erb +10 -10
  266. data/app/views/hyrax/base/_work_button_row.html.erb +17 -16
  267. data/app/views/hyrax/base/_workflow_actions.html.erb +10 -10
  268. data/app/views/hyrax/base/_workflow_actions_widget.erb +1 -1
  269. data/app/views/hyrax/base/file_manager.html.erb +4 -5
  270. data/app/views/hyrax/base/inspect_work.html.erb +1 -1
  271. data/app/views/hyrax/base/show.html.erb +12 -12
  272. data/app/views/hyrax/base/unavailable.html.erb +2 -2
  273. data/app/views/hyrax/batch_edits/_check_all.html.erb +0 -1
  274. data/app/views/hyrax/batch_edits/_delete_selected.html.erb +1 -1
  275. data/app/views/hyrax/batch_edits/edit.html.erb +26 -18
  276. data/app/views/hyrax/collections/_bookmark_control.html.erb +2 -2
  277. data/app/views/hyrax/collections/_list_collections.html.erb +6 -6
  278. data/app/views/hyrax/collections/_list_works.html.erb +3 -1
  279. data/app/views/hyrax/collections/_search_form.html.erb +4 -4
  280. data/app/views/hyrax/collections/_show_document_list_row.html.erb +5 -2
  281. data/app/views/hyrax/collections/_sort_and_per_page.html.erb +3 -3
  282. data/app/views/hyrax/collections/_view_type_group.html.erb +2 -2
  283. data/app/views/hyrax/contact_form/new.html.erb +12 -13
  284. data/app/views/hyrax/content_blocks/_form.html.erb +29 -23
  285. data/app/views/hyrax/content_blocks/templates/agreement.html.erb +3 -3
  286. data/app/views/hyrax/dashboard/_admin_sets.html.erb +22 -28
  287. data/app/views/hyrax/dashboard/_index_partials/_current_proxy_rights.html.erb +2 -2
  288. data/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +4 -4
  289. data/app/views/hyrax/dashboard/_index_partials/_transfers.html.erb +2 -2
  290. data/app/views/hyrax/dashboard/_repository_growth.html.erb +28 -28
  291. data/app/views/hyrax/dashboard/_resource_type_graph.html.erb +4 -4
  292. data/app/views/hyrax/dashboard/_sidebar.html.erb +3 -3
  293. data/app/views/hyrax/dashboard/_tabs.html.erb +6 -2
  294. data/app/views/hyrax/dashboard/_user_activity.html.erb +22 -19
  295. data/app/views/hyrax/dashboard/_visibility_graph.html.erb +4 -4
  296. data/app/views/hyrax/dashboard/_work_type_graph.html.erb +4 -4
  297. data/app/views/hyrax/dashboard/collections/_batch_edits_actions.html.erb +1 -1
  298. data/app/views/hyrax/dashboard/collections/_bookmark_control.html.erb +2 -2
  299. data/app/views/hyrax/dashboard/collections/_edit_actions.html.erb +1 -1
  300. data/app/views/hyrax/dashboard/collections/_form.html.erb +30 -22
  301. data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +19 -19
  302. data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +8 -4
  303. data/app/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb +7 -7
  304. data/app/views/hyrax/dashboard/collections/_form_share.html.erb +11 -9
  305. data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +34 -31
  306. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
  307. data/app/views/hyrax/dashboard/collections/_list_works.html.erb +3 -1
  308. data/app/views/hyrax/dashboard/collections/_modal_remove_from_collection.html.erb +1 -1
  309. data/app/views/hyrax/dashboard/collections/_modal_remove_sub_collection.html.erb +1 -1
  310. data/app/views/hyrax/dashboard/collections/_show_add_items_actions.html.erb +1 -1
  311. data/app/views/hyrax/dashboard/collections/_show_descriptions.html.erb +5 -3
  312. data/app/views/hyrax/dashboard/collections/_show_document_list_menu.html.erb +4 -4
  313. data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +12 -10
  314. data/app/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb +2 -2
  315. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +4 -4
  316. data/app/views/hyrax/dashboard/collections/_subcollection_list.html.erb +1 -1
  317. data/app/views/hyrax/dashboard/collections/_work_action_menu.html.erb +10 -10
  318. data/app/views/hyrax/dashboard/collections/show.html.erb +4 -4
  319. data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +21 -21
  320. data/app/views/hyrax/dashboard/profiles/_trophy_edit.html.erb +5 -5
  321. data/app/views/hyrax/dashboard/profiles/_zotero.html.erb +2 -2
  322. data/app/views/hyrax/dashboard/profiles/edit.html.erb +2 -2
  323. data/app/views/hyrax/dashboard/profiles/show.html.erb +3 -3
  324. data/app/views/hyrax/dashboard/show_admin.html.erb +36 -34
  325. data/app/views/hyrax/dashboard/show_user.html.erb +16 -16
  326. data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +11 -11
  327. data/app/views/hyrax/dashboard/sidebar/_configuration.html.erb +8 -8
  328. data/app/views/hyrax/dashboard/sidebar/_repository_content.html.erb +3 -1
  329. data/app/views/hyrax/dashboard/sidebar/_tasks.html.erb +5 -1
  330. data/app/views/hyrax/dashboard/works/_list_works.html.erb +4 -1
  331. data/app/views/hyrax/depositors/index.html.erb +2 -2
  332. data/app/views/hyrax/embargoes/edit.html.erb +14 -14
  333. data/app/views/hyrax/embargoes/index.html.erb +18 -6
  334. data/app/views/hyrax/file_sets/_actions.html.erb +5 -6
  335. data/app/views/hyrax/file_sets/_descriptions.html.erb +1 -1
  336. data/app/views/hyrax/file_sets/_extra_fields_modal.html.erb +1 -1
  337. data/app/views/hyrax/file_sets/_form.html.erb +1 -1
  338. data/app/views/hyrax/file_sets/_permission.html.erb +1 -1
  339. data/app/views/hyrax/file_sets/_permission_form.html.erb +39 -30
  340. data/app/views/hyrax/file_sets/_show_actions.html.erb +3 -3
  341. data/app/views/hyrax/file_sets/_show_details.html.erb +27 -17
  342. data/app/views/hyrax/file_sets/_single_use_link_rows.html.erb +2 -2
  343. data/app/views/hyrax/file_sets/_single_use_links.html.erb +2 -2
  344. data/app/views/hyrax/file_sets/_versioning.html.erb +9 -9
  345. data/app/views/hyrax/file_sets/edit.html.erb +19 -13
  346. data/app/views/hyrax/file_sets/media_display/_image.html.erb +4 -4
  347. data/app/views/hyrax/file_sets/show.html.erb +2 -2
  348. data/app/views/hyrax/homepage/_announcement.html.erb +2 -2
  349. data/app/views/hyrax/homepage/_explore_collections.html.erb +6 -4
  350. data/app/views/hyrax/homepage/_featured_fields.html.erb +1 -1
  351. data/app/views/hyrax/homepage/_featured_works.html.erb +1 -1
  352. data/app/views/hyrax/homepage/_home_content.html.erb +24 -10
  353. data/app/views/hyrax/homepage/_marketing.html.erb +1 -1
  354. data/app/views/hyrax/homepage/_recent_document.html.erb +4 -1
  355. data/app/views/hyrax/homepage/_sortable_featured.html.erb +3 -3
  356. data/app/views/hyrax/homepage/index.html.erb +4 -4
  357. data/app/views/hyrax/leases/edit.html.erb +14 -14
  358. data/app/views/hyrax/leases/index.html.erb +18 -6
  359. data/app/views/hyrax/my/_admin_set_action_menu.html.erb +5 -5
  360. data/app/views/hyrax/my/_collection_action_menu.html.erb +6 -6
  361. data/app/views/hyrax/my/_constraints.html.erb +2 -2
  362. data/app/views/hyrax/my/_document_list.html.erb +1 -1
  363. data/app/views/hyrax/my/_facet_layout.html.erb +1 -2
  364. data/app/views/hyrax/my/_facet_limit.html.erb +4 -4
  365. data/app/views/hyrax/my/_facet_pagination.html.erb +1 -25
  366. data/app/views/hyrax/my/_facet_pivot.html.erb +1 -1
  367. data/app/views/hyrax/my/_facet_selected.html.erb +1 -1
  368. data/app/views/hyrax/my/_search_form.html.erb +7 -8
  369. data/app/views/hyrax/my/_sort_and_per_page.html.erb +10 -12
  370. data/app/views/hyrax/my/_work_action_menu.html.erb +4 -5
  371. data/app/views/hyrax/my/collections/_facets.html.erb +2 -2
  372. data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
  373. data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +2 -2
  374. data/app/views/hyrax/my/collections/_modal_add_to_collection.html.erb +2 -2
  375. data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +5 -5
  376. data/app/views/hyrax/my/collections/_modal_delete_collection.html.erb +1 -1
  377. data/app/views/hyrax/my/collections/_modal_delete_empty_collection.html.erb +1 -1
  378. data/app/views/hyrax/my/collections/_modal_delete_selected_collections.html.erb +1 -1
  379. data/app/views/hyrax/my/collections/_tabs.html.erb +11 -4
  380. data/app/views/hyrax/my/collections/index.html.erb +3 -3
  381. data/app/views/hyrax/my/facet.html.erb +17 -16
  382. data/app/views/hyrax/my/index.html.erb +2 -2
  383. data/app/views/hyrax/my/works/_batch_actions.html.erb +1 -1
  384. data/app/views/hyrax/my/works/_facets.html.erb +2 -2
  385. data/app/views/hyrax/my/works/_list_works.html.erb +6 -7
  386. data/app/views/hyrax/my/works/_tabs.html.erb +6 -6
  387. data/app/views/hyrax/my/works/index.html.erb +20 -18
  388. data/app/views/hyrax/notifications/_notifications.html.erb +1 -1
  389. data/app/views/hyrax/notifications/index.html.erb +4 -4
  390. data/app/views/hyrax/operations/index.html.erb +1 -1
  391. data/app/views/hyrax/operations/show.html.erb +2 -2
  392. data/app/views/hyrax/pages/_form.html.erb +76 -64
  393. data/app/views/hyrax/permissions/confirm.html.erb +4 -4
  394. data/app/views/hyrax/permissions/confirm_access.html.erb +4 -4
  395. data/app/views/hyrax/stats/file.html.erb +1 -1
  396. data/app/views/hyrax/stats/work.html.erb +1 -1
  397. data/app/views/hyrax/transfers/_received.html.erb +4 -4
  398. data/app/views/hyrax/transfers/index.html.erb +8 -8
  399. data/app/views/hyrax/transfers/new.html.erb +1 -1
  400. data/app/views/hyrax/uploads/_js_templates.html.erb +14 -14
  401. data/app/views/hyrax/uploads/_js_templates_branding.html.erb +5 -5
  402. data/app/views/hyrax/uploads/_js_templates_versioning.html.erb +15 -15
  403. data/app/views/hyrax/users/_activity.html.erb +3 -3
  404. data/app/views/hyrax/users/_contributions.html.erb +3 -3
  405. data/app/views/hyrax/users/_left_sidebar.html.erb +1 -1
  406. data/app/views/hyrax/users/_profile_tabs.html.erb +16 -8
  407. data/app/views/hyrax/users/_search_form.html.erb +2 -2
  408. data/app/views/hyrax/users/_user.html.erb +5 -5
  409. data/app/views/hyrax/users/_user_info.html.erb +4 -4
  410. data/app/views/hyrax/users/_vitals.html.erb +3 -3
  411. data/app/views/hyrax/users/show.html.erb +2 -2
  412. data/app/views/layouts/_head_tag_content.html.erb +2 -5
  413. data/app/views/layouts/hyrax/dashboard.html.erb +4 -4
  414. data/app/views/layouts/hyrax.html.erb +4 -3
  415. data/app/views/shared/_appearance_styles.html.erb +8 -8
  416. data/app/views/shared/_footer.html.erb +1 -1
  417. data/app/views/shared/_locale_picker.html.erb +5 -8
  418. data/app/views/shared/_nav_safety_modal.html.erb +2 -2
  419. data/app/views/shared/_select_work_type_modal.html.erb +2 -2
  420. data/config/locales/hyrax.de.yml +5 -6
  421. data/config/locales/hyrax.en.yml +4 -15
  422. data/config/locales/hyrax.es.yml +6 -7
  423. data/config/locales/hyrax.fr.yml +8 -9
  424. data/config/locales/hyrax.it.yml +6 -7
  425. data/config/locales/hyrax.pt-BR.yml +6 -7
  426. data/config/locales/hyrax.zh.yml +6 -7
  427. data/docker-compose.yml +2 -1
  428. data/documentation/developing-your-hyrax-based-app.md +2 -2
  429. data/documentation/legacyREADME.md +3 -3
  430. data/hyrax.gemspec +13 -24
  431. data/karma.conf.js +104 -0
  432. data/lib/generators/hyrax/assets_generator.rb +2 -5
  433. data/lib/generators/hyrax/install_generator.rb +9 -33
  434. data/lib/generators/hyrax/templates/catalog_controller.rb +20 -13
  435. data/lib/generators/hyrax/templates/config/analytics.yml +0 -3
  436. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +1 -1
  437. data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +1 -1
  438. data/lib/generators/hyrax/templates/hyrax.scss +1 -2
  439. data/lib/generators/hyrax/templates/package.json +7 -8
  440. data/lib/hyrax/active_fedora_dummy_model.rb +0 -13
  441. data/lib/hyrax/configuration.rb +2 -49
  442. data/lib/hyrax/engine.rb +1 -2
  443. data/lib/hyrax/errors.rb +0 -2
  444. data/lib/hyrax/publisher.rb +0 -4
  445. data/lib/hyrax/specs/capybara.rb +5 -3
  446. data/lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb +0 -6
  447. data/lib/hyrax/specs/shared_specs/indexers.rb +0 -5
  448. data/lib/hyrax/transactions/container.rb +0 -54
  449. data/lib/hyrax/version.rb +1 -1
  450. data/lib/valkyrie/indexing/solr/indexing_adapter.rb +1 -1
  451. data/lib/wings/valkyrie/persister.rb +2 -1
  452. data/lib/wings/valkyrie/storage.rb +2 -6
  453. data/package.json +11 -0
  454. data/tasks/hyrax_dev.rake +32 -0
  455. data/template.rb +1 -1
  456. data/vendor/assets/javascripts/dataTables.bootstrap4.js +184 -0
  457. data/vendor/assets/javascripts/fileupload/jquery.fileupload-ui.js +1 -1
  458. data/vendor/assets/javascripts/fileupload/jquery.fileupload.js +2 -2
  459. data/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js +1 -1
  460. data/vendor/assets/javascripts/handlebars.js +5214 -0
  461. data/vendor/assets/javascripts/jquery-ui.js +19057 -0
  462. data/vendor/assets/javascripts/jquery.dataTables.js +15336 -0
  463. data/vendor/assets/javascripts/morris/morris.min.js +9 -1
  464. data/vendor/assets/javascripts/morris/raphael-min.js +4 -6
  465. data/vendor/assets/javascripts/nestable.js +1 -1
  466. data/vendor/assets/stylesheets/dataTables.bootstrap4.css +307 -0
  467. data/vendor/assets/stylesheets/jquery-ui.css +1315 -0
  468. data/vendor/assets/stylesheets/morris.css +3 -0
  469. metadata +95 -218
  470. data/app/actors/hyrax/actors/initialize_workflow_actor.rb +0 -35
  471. data/app/forms/hyrax/forms/embargo.rb +0 -13
  472. data/app/forms/hyrax/forms/lease.rb +0 -13
  473. data/app/forms/hyrax/forms/pcdm_object_form.rb +0 -46
  474. data/app/forms/hyrax/forms/work_embargo_form.rb +0 -35
  475. data/app/forms/hyrax/forms/work_lease_form.rb +0 -35
  476. data/app/helpers/hyrax/url_helper.rb +0 -13
  477. data/app/jobs/content_depositor_change_event_job.rb +0 -48
  478. data/app/models/concerns/hyrax/with_file_sets.rb +0 -17
  479. data/app/services/hyrax/analytics/ga4.rb +0 -204
  480. data/app/services/hyrax/file_set_file_service.rb +0 -55
  481. data/app/services/hyrax/work_resource_query_service.rb +0 -45
  482. data/app/views/hyrax/admin/workflows/_tabs.html.erb +0 -9
  483. data/app/views/shared/_ga4.html.erb +0 -10
  484. data/config/metadata/file_set_metadata.yaml +0 -130
  485. data/lib/hyrax/transactions/create_work.rb +0 -65
  486. data/lib/hyrax/transactions/destroy_work.rb +0 -28
  487. data/lib/hyrax/transactions/steps/apply_collection_permission_template.rb +0 -34
  488. data/lib/hyrax/transactions/steps/apply_permission_template.rb +0 -32
  489. data/lib/hyrax/transactions/steps/apply_visibility.rb +0 -41
  490. data/lib/hyrax/transactions/steps/destroy_work.rb +0 -27
  491. data/lib/hyrax/transactions/steps/ensure_permission_template.rb +0 -29
  492. data/lib/hyrax/transactions/steps/save_work.rb +0 -38
  493. data/lib/hyrax/transactions/update_work.rb +0 -19
  494. data/lib/wings/services/file_converter_service.rb +0 -19
  495. data/lib/wings/services/file_metadata_builder.rb +0 -94
  496. data/vendor/assets/javascripts/handlebars-v4.0.5.js +0 -4612
  497. data/vendor/assets/stylesheets/morris.js/0.5.1/morris.css +0 -2
@@ -1 +1,9 @@
1
- (function(){var t,i,e,n,o=[].slice,s=function(t,i){return function(){return t.apply(i,arguments)}},r={}.hasOwnProperty,h=function(t,i){for(var e in i)r.call(i,e)&&(t[e]=i[e]);function n(){this.constructor=t}return n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype,t},a=[].indexOf||function(t){for(var i=0,e=this.length;i<e;i++)if(i in this&&this[i]===t)return i;return-1};i=window.Morris={},t=jQuery,i.EventEmitter=function(){function t(){}return t.prototype.on=function(t,i){return null==this.handlers&&(this.handlers={}),null==this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(i),this},t.prototype.fire=function(){var t,i,e,n,s,r,h;if(e=arguments[0],t=2<=arguments.length?o.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[e]){for(h=[],n=0,s=(r=this.handlers[e]).length;n<s;n++)i=r[n],h.push(i.apply(null,t));return h}},t}(),i.commas=function(t){var i,e,n,o;return null!=t?(n=t<0?"-":"",i=Math.abs(t),n+=(e=Math.floor(i).toFixed(0)).replace(/(?=(?:\d{3})+$)(?!^)/g,","),(o=i.toString()).length>e.length&&(n+=o.slice(e.length)),n):"-"},i.pad2=function(t){return(t<10?"0":"")+t},i.Grid=function(e){function n(i){this.resizeHandler=s(this.resizeHandler,this);var e=this;if("string"==typeof i.element?this.el=t(document.getElementById(i.element)):this.el=t(i.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=t.extend({},this.gridDefaults,this.defaults||{},i),"string"==typeof this.options.units&&(this.options.postUnits=i.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(t){var i,n,o,s;return n=e.el.offset(),s=t.pageX-n.left,e.selectFrom?(i=e.data[e.hitTest(Math.min(s,e.selectFrom))]._x,o=e.data[e.hitTest(Math.max(s,e.selectFrom))]._x-i,e.selectionRect.attr({x:i,width:o})):e.fire("hovermove",s,t.pageY-n.top)}),this.el.bind("mouseleave",function(t){return e.selectFrom&&(e.selectionRect.hide(),e.selectFrom=null),e.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(t){var i,n;return n=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],i=e.el.offset(),e.fire("hover",n.pageX-i.left,n.pageY-i.top),n}),this.el.bind("click",function(t){var i;return i=e.el.offset(),e.fire("gridclick",t.pageX-i.left,t.pageY-i.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(t){var i;return i=e.el.offset(),e.startRange(t.pageX-i.left)}),this.el.bind("mouseup",function(t){var i;return i=e.el.offset(),e.endRange(t.pageX-i.left),e.fire("hovermove",t.pageX-i.left,t.pageY-i.top)})),this.options.resize&&t(window).bind("resize",function(t){return null!=e.timeoutId&&window.clearTimeout(e.timeoutId),e.timeoutId=window.setTimeout(e.resizeHandler,100)}),this.postInit&&this.postInit()}return h(n,e),n.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",gridIntegers:!1,hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},n.prototype.setData=function(t,e){var n,o,s,r,h,a,l,p,u,c,d,f,g,m,y;return null==e&&(e=!0),this.options.data=t,null==t||0===t.length?(this.data=[],this.raphael.clear(),void(null!=this.hover&&this.hover.hide())):(f=this.cumulative?0:null,g=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),r=Math.max.apply(Math,this.options.goals),g=null!=g?Math.min(g,h):h,f=null!=f?Math.max(f,r):r),this.data=function(){var e,n,r;for(r=[],s=e=0,n=t.length;e<n;s=++e)l=t[s],(a={src:l}).label=l[this.options.xkey],this.options.parseTime?(a.x=i.parseDate(a.label),this.options.dateFormat?a.label=this.options.dateFormat(a.x):"number"==typeof a.label&&(a.label=new Date(a.label).toString())):(a.x=s,this.options.xLabelFormat&&(a.label=this.options.xLabelFormat(a))),u=0,a.y=function(){var t,i,e,n;for(e=this.options.ykeys,n=[],o=t=0,i=e.length;t<i;o=++t)d=e[o],"string"==typeof(m=l[d])&&(m=parseFloat(m)),null!=m&&"number"!=typeof m&&(m=null),null!=m&&(this.cumulative?u+=m:null!=f?(f=Math.max(m,f),g=Math.min(m,g)):f=g=m),this.cumulative&&null!=u&&(f=Math.max(u,f),g=Math.min(u,g)),n.push(m);return n}.call(this),r.push(a);return r}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(t,i){return(t.x>i.x)-(i.x>t.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.options.parseTime?this.events=function(){var t,e,o,s;for(s=[],t=0,e=(o=this.options.events).length;t<e;t++)n=o[t],s.push(i.parseDate(n));return s}.call(this):this.events=this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",g),this.ymax=this.yboundary("max",f),this.ymin===this.ymax&&(g&&(this.ymin-=1),this.ymax+=1),!0!==(y=this.options.axes)&&"both"!==y&&"y"!==y&&!0!==this.options.grid||(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(p=(this.ymax-this.ymin)/(this.options.numLines-1),this.options.gridIntegers&&(p=Math.max(1,Math.round(p))),this.grid=function(){var t,i,e;for(e=[],c=t=this.ymin,i=this.ymax;p>0?t<=i:t>=i;c=t+=p)e.push(c);return e}.call(this))),this.dirty=!0,e?this.redraw():void 0)},n.prototype.yboundary=function(t,i){var e,n;return"string"==typeof(e=this.options["y"+t])?"auto"===e.slice(0,4)?e.length>5?(n=parseInt(e.slice(5),10),null==i?n:Math[t](i,n)):null!=i?i:0:parseInt(e,10):e},n.prototype.autoGridLines=function(t,i,e){var n,o,s,r,h,a,l,p,u;return h=i-t,u=Math.floor(Math.log(h)/Math.log(10)),l=Math.pow(10,u),o=Math.floor(t/l)*l,n=Math.ceil(i/l)*l,a=(n-o)/(e-1),1===l&&a>1&&Math.ceil(a)!==a&&(a=Math.ceil(a),n=o+a*(e-1)),o<0&&n>0&&(o=Math.floor(t/a)*a,n=Math.ceil(i/a)*a),a<1?(r=Math.floor(Math.log(a)/Math.log(10)),s=function(){var t,i;for(i=[],p=t=o;a>0?t<=n:t>=n;p=t+=a)i.push(parseFloat(p.toFixed(1-r)));return i}()):s=function(){var t,i;for(i=[],p=t=o;a>0?t<=n:t>=n;p=t+=a)i.push(p);return i}(),s},n.prototype._calc=function(){var t,i,e,n,o,s,r,h;if(o=this.el.width(),e=this.el.height(),(this.elementWidth!==o||this.elementHeight!==e||this.dirty)&&(this.elementWidth=o,this.elementHeight=e,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,!0!==(r=this.options.axes)&&"both"!==r&&"y"!==r||(s=function(){var t,e,n,o;for(o=[],t=0,e=(n=this.grid).length;t<e;t++)i=n[t],o.push(this.measureText(this.yAxisFormat(i)).width);return o}.call(this),this.left+=Math.max.apply(Math,s)),!0!==(h=this.options.axes)&&"both"!==h&&"x"!==h||(t=function(){var t,i,e;for(e=[],n=t=0,i=this.data.length;0<=i?t<i:t>i;n=0<=i?++t:--t)e.push(this.measureText(this.data[n].text,-this.options.xLabelAngle).height);return e}.call(this),this.bottom-=Math.max.apply(Math,t)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc))return this.calc()},n.prototype.transY=function(t){return this.bottom-(t-this.ymin)*this.dy},n.prototype.transX=function(t){return 1===this.data.length?(this.left+this.right)/2:this.left+(t-this.xmin)*this.dx},n.prototype.redraw=function(){if(this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw)return this.draw()},n.prototype.measureText=function(t,i){var e,n;return null==i&&(i=0),e=(n=this.raphael.text(100,100,t).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(i)).getBBox(),n.remove(),e},n.prototype.yAxisFormat=function(t){return this.yLabelFormat(t)},n.prototype.yLabelFormat=function(t){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(t):""+this.options.preUnits+i.commas(t)+this.options.postUnits},n.prototype.drawGrid=function(){var t,i,e,n,o,s,r,h;if(!1!==this.options.grid||!0===(o=this.options.axes)||"both"===o||"y"===o){for(h=[],e=0,n=(s=this.grid).length;e<n;e++)t=s[e],i=this.transY(t),!0!==(r=this.options.axes)&&"both"!==r&&"y"!==r||this.drawYAxisLabel(this.left-this.options.padding/2,i,this.yAxisFormat(t)),this.options.grid?h.push(this.drawGridLine("M"+this.left+","+i+"H"+(this.left+this.width))):h.push(void 0);return h}},n.prototype.drawGoals=function(){var t,i,e,n,o,s,r;for(r=[],e=n=0,o=(s=this.options.goals).length;n<o;e=++n)i=s[e],t=this.options.goalLineColors[e%this.options.goalLineColors.length],r.push(this.drawGoal(i,t));return r},n.prototype.drawEvents=function(){var t,i,e,n,o,s,r;for(r=[],e=n=0,o=(s=this.events).length;n<o;e=++n)i=s[e],t=this.options.eventLineColors[e%this.options.eventLineColors.length],r.push(this.drawEvent(i,t));return r},n.prototype.drawGoal=function(t,i){return this.raphael.path("M"+this.left+","+this.transY(t)+"H"+this.right).attr("stroke",i).attr("stroke-width",this.options.goalStrokeWidth)},n.prototype.drawEvent=function(t,i){return this.raphael.path("M"+this.transX(t)+","+this.bottom+"V"+this.top).attr("stroke",i).attr("stroke-width",this.options.eventStrokeWidth)},n.prototype.drawYAxisLabel=function(t,i,e){return this.raphael.text(t,i,e).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},n.prototype.drawGridLine=function(t){return this.raphael.path(t).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},n.prototype.startRange=function(t){return this.hover.hide(),this.selectFrom=t,this.selectionRect.attr({x:t,width:0}).show()},n.prototype.endRange=function(t){var i,e;if(this.selectFrom)return e=Math.min(this.selectFrom,t),i=Math.max(this.selectFrom,t),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(e)].x,end:this.data[this.hitTest(i)].x}),this.selectFrom=null},n.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},n}(i.EventEmitter),i.parseDate=function(t){var i,e,n,o,s,r,h,a,l,p,u;return"number"==typeof t?t:(e=t.match(/^(\d+) Q(\d)$/),o=t.match(/^(\d+)-(\d+)$/),s=t.match(/^(\d+)-(\d+)-(\d+)$/),h=t.match(/^(\d+) W(\d+)$/),a=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),l=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),e?new Date(parseInt(e[1],10),3*parseInt(e[2],10)-1,1).getTime():o?new Date(parseInt(o[1],10),parseInt(o[2],10)-1,1).getTime():s?new Date(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10)).getTime():h?(4!==(p=new Date(parseInt(h[1],10),0,1)).getDay()&&p.setMonth(0,1+(4-p.getDay()+7)%7),p.getTime()+6048e5*parseInt(h[2],10)):a?a[6]?(r=0,"Z"!==a[6]&&(r=60*parseInt(a[8],10)+parseInt(a[9],10),"+"===a[7]&&(r=0-r)),Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10)+r)):new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10)).getTime():l?(u=parseFloat(l[6]),i=Math.floor(u),n=Math.round(1e3*(u-i)),l[8]?(r=0,"Z"!==l[8]&&(r=60*parseInt(l[10],10)+parseInt(l[11],10),"+"===l[9]&&(r=0-r)),Date.UTC(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)+r,i,n)):new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10),i,n).getTime()):new Date(parseInt(t,10),0,1).getTime())},i.Hover=function(){function e(e){null==e&&(e={}),this.options=t.extend({},i.Hover.defaults,e),this.el=t("<div class='"+this.options.class+"'></div>"),this.el.hide(),this.options.parent.append(this.el)}return e.defaults={class:"morris-hover morris-default-style"},e.prototype.update=function(t,i,e){return this.html(t),this.show(),this.moveTo(i,e)},e.prototype.html=function(t){return this.el.html(t)},e.prototype.moveTo=function(t,i){var e,n,o,s,r,h;return r=this.options.parent.innerWidth(),s=this.options.parent.innerHeight(),n=this.el.outerWidth(),e=this.el.outerHeight(),o=Math.min(Math.max(0,t-n/2),r-n),null!=i?(h=i-e-10)<0&&(h=i+10)+e>s&&(h=s/2-e/2):h=s/2-e/2,this.el.css({left:o+"px",top:parseInt(h)+"px"})},e.prototype.show=function(){return this.el.show()},e.prototype.hide=function(){return this.el.hide()},e}(),i.Line=function(t){function e(t){if(this.hilight=s(this.hilight,this),this.onHoverOut=s(this.onHoverOut,this),this.onHoverMove=s(this.onHoverMove,this),this.onGridClick=s(this.onGridClick,this),!(this instanceof i.Line))return new i.Line(t);e.__super__.constructor.call(this,t)}return h(e,t),e.prototype.init=function(){if("always"!==this.options.hideHover)return this.hover=new i.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)},e.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,continuousLine:!0,hideHover:!1},e.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},e.prototype.calcPoints=function(){var t,i,e,n,o,s;for(s=[],e=0,n=(o=this.data).length;e<n;e++)(t=o[e])._x=this.transX(t.x),t._y=function(){var e,n,o,s;for(s=[],e=0,n=(o=t.y).length;e<n;e++)null!=(i=o[e])?s.push(this.transY(i)):s.push(i);return s}.call(this),s.push(t._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var e,n,o,s;for(s=[],e=0,n=(o=t._y).length;e<n;e++)null!=(i=o[e])&&s.push(i);return s}())));return s},e.prototype.hitTest=function(t){var i,e,n,o;if(0===this.data.length)return null;for(i=e=0,n=(o=this.data.slice(1)).length;e<n&&!(t<(o[i]._x+this.data[i]._x)/2);i=++e);return i},e.prototype.onGridClick=function(t,i){var e;return e=this.hitTest(t),this.fire("click",e,this.data[e].src,t,i)},e.prototype.onHoverMove=function(t,i){var e;return e=this.hitTest(t),this.displayHoverForRow(e)},e.prototype.onHoverOut=function(){if(!1!==this.options.hideHover)return this.displayHoverForRow(null)},e.prototype.displayHoverForRow=function(t){var i;return null!=t?((i=this.hover).update.apply(i,this.hoverContentForRow(t)),this.hilight(t)):(this.hover.hide(),this.hilight())},e.prototype.hoverContentForRow=function(t){var i,e,n,o,s,r,h;for(i="<div class='morris-hover-row-label'>"+(n=this.data[t]).label+"</div>",e=s=0,r=(h=n.y).length;s<r;e=++s)o=h[e],i+="<div class='morris-hover-point' style='color: "+this.colorFor(n,e,"label")+"'>\n "+this.options.labels[e]+":\n "+this.yLabelFormat(o)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(i=this.options.hoverCallback(t,this.options,i,n.src)),[i,n._x,n._ymax]},e.prototype.generatePaths=function(){var t,e,n,o,s;return this.paths=function(){var r,h,l,p;for(p=[],n=r=0,h=this.options.ykeys.length;0<=h?r<h:r>h;n=0<=h?++r:--r)s="boolean"==typeof this.options.smooth?this.options.smooth:(l=this.options.ykeys[n],a.call(this.options.smooth,l)>=0),e=function(){var t,i,e,s;for(s=[],t=0,i=(e=this.data).length;t<i;t++)void 0!==(o=e[t])._y[n]&&s.push({x:o._x,y:o._y[n]});return s}.call(this),this.options.continuousLine&&(e=function(){var i,n,o;for(o=[],i=0,n=e.length;i<n;i++)null!==(t=e[i]).y&&o.push(t);return o}()),e.length>1?p.push(i.Line.createPath(e,s,this.bottom)):p.push(null);return p}.call(this)},e.prototype.draw=function(){var t;if(!0!==(t=this.options.axes)&&"both"!==t&&"x"!==t||this.drawXAxis(),this.drawSeries(),!1===this.options.hideHover)return this.displayHoverForRow(this.data.length-1)},e.prototype.drawXAxis=function(){var t,e,n,o,s,r,h,a,l,p,u=this;for(h=this.bottom+this.options.padding/2,s=null,o=null,t=function(t,i){var e,n,r,a,l;return l=(e=u.drawXAxisLabel(u.transX(i),h,t)).getBBox(),e.transform("r"+-u.options.xLabelAngle),n=e.getBBox(),e.transform("t0,"+n.height/2+"..."),0!==u.options.xLabelAngle&&(a=-.5*l.width*Math.cos(u.options.xLabelAngle*Math.PI/180),e.transform("t"+a+",0...")),n=e.getBBox(),(null==s||s>=n.x+n.width||null!=o&&o>=n.x)&&n.x>=0&&n.x+n.width<u.el.width()?(0!==u.options.xLabelAngle&&(r=1.25*u.options.gridTextSize/Math.sin(u.options.xLabelAngle*Math.PI/180),o=n.x-r),s=n.x-u.options.xLabelMargin):e.remove()},(n=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:i.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):function(){var t,i,e,n;for(n=[],t=0,i=(e=this.data).length;t<i;t++)r=e[t],n.push([r.label,r.x]);return n}.call(this)).reverse(),p=[],a=0,l=n.length;a<l;a++)e=n[a],p.push(t(e[0],e[1]));return p},e.prototype.drawSeries=function(){var t,i,e,n,o,s;for(this.seriesPoints=[],t=i=n=this.options.ykeys.length-1;n<=0?i<=0:i>=0;t=n<=0?++i:--i)this._drawLineFor(t);for(s=[],t=e=o=this.options.ykeys.length-1;o<=0?e<=0:e>=0;t=o<=0?++e:--e)s.push(this._drawPointFor(t));return s},e.prototype._drawPointFor=function(t){var i,e,n,o,s,r;for(this.seriesPoints[t]=[],r=[],n=0,o=(s=this.data).length;n<o;n++)i=null,null!=(e=s[n])._y[t]&&(i=this.drawLinePoint(e._x,e._y[t],this.colorFor(e,t,"point"),t)),r.push(this.seriesPoints[t].push(i));return r},e.prototype._drawLineFor=function(t){var i;if(null!==(i=this.paths[t]))return this.drawLinePath(i,this.colorFor(null,t,"line"),t)},e.createPath=function(t,e,n){var o,s,r,h,a,l,p,u,c,d;for(p="",e&&(r=i.Line.gradients(t)),u={y:null},h=c=0,d=t.length;c<d;h=++c)null!=(o=t[h]).y&&(null!=u.y?e?(s=r[h],l=r[h-1],a=(o.x-u.x)/4,p+="C"+(u.x+a)+","+Math.min(n,u.y+a*l)+","+(o.x-a)+","+Math.min(n,o.y-a*s)+","+o.x+","+o.y):p+="L"+o.x+","+o.y:e&&null==r[h]||(p+="M"+o.x+","+o.y)),u=o;return p},e.gradients=function(t){var i,e,n,o,s,r,h,a;for(e=function(t,i){return(t.y-i.y)/(t.x-i.x)},a=[],n=r=0,h=t.length;r<h;n=++r)null!=(i=t[n]).y?(o=t[n+1]||{y:null},null!=(s=t[n-1]||{y:null}).y&&null!=o.y?a.push(e(s,o)):null!=s.y?a.push(e(s,i)):null!=o.y?a.push(e(i,o)):a.push(null)):a.push(null);return a},e.prototype.hilight=function(t){var i,e,n,o,s;if(null!==this.prevHilight&&this.prevHilight!==t)for(i=e=0,o=this.seriesPoints.length-1;0<=o?e<=o:e>=o;i=0<=o?++e:--e)this.seriesPoints[i][this.prevHilight]&&this.seriesPoints[i][this.prevHilight].animate(this.pointShrinkSeries(i));if(null!==t&&this.prevHilight!==t)for(i=n=0,s=this.seriesPoints.length-1;0<=s?n<=s:n>=s;i=0<=s?++n:--n)this.seriesPoints[i][t]&&this.seriesPoints[i][t].animate(this.pointGrowSeries(i));return this.prevHilight=t},e.prototype.colorFor=function(t,i,e){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,t,i,e):"point"===e&&this.options.pointFillColors[i%this.options.pointFillColors.length]||this.options.lineColors[i%this.options.lineColors.length]},e.prototype.drawXAxisLabel=function(t,i,e){return this.raphael.text(t,i,e).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},e.prototype.drawLinePath=function(t,i,e){return this.raphael.path(t).attr("stroke",i).attr("stroke-width",this.lineWidthForSeries(e))},e.prototype.drawLinePoint=function(t,i,e,n){return this.raphael.circle(t,i,this.pointSizeForSeries(n)).attr("fill",e).attr("stroke-width",this.pointStrokeWidthForSeries(n)).attr("stroke",this.pointStrokeColorForSeries(n))},e.prototype.pointStrokeWidthForSeries=function(t){return this.options.pointStrokeWidths[t%this.options.pointStrokeWidths.length]},e.prototype.pointStrokeColorForSeries=function(t){return this.options.pointStrokeColors[t%this.options.pointStrokeColors.length]},e.prototype.lineWidthForSeries=function(t){return this.options.lineWidth instanceof Array?this.options.lineWidth[t%this.options.lineWidth.length]:this.options.lineWidth},e.prototype.pointSizeForSeries=function(t){return this.options.pointSize instanceof Array?this.options.pointSize[t%this.options.pointSize.length]:this.options.pointSize},e.prototype.pointGrowSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)+3},25,"linear")},e.prototype.pointShrinkSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)},25,"linear")},e}(i.Grid),i.labelSeries=function(e,n,o,s,r){var h,a,l,p,u,c,d,f,g,m,y;if(l=200*(n-e)/o,a=new Date(e),void 0===(d=i.LABEL_SPECS[s]))for(g=0,m=(y=i.AUTO_LABEL_ORDER).length;g<m;g++)if(p=y[g],l>=(c=i.LABEL_SPECS[p]).span){d=c;break}for(void 0===d&&(d=i.LABEL_SPECS.second),r&&(d=t.extend({},d,{fmt:r})),h=d.start(a),u=[];(f=h.getTime())<=n;)f>=e&&u.push([d.fmt(h),f]),d.incr(h);return u},e=function(t){return{span:60*t*1e3,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours())},fmt:function(t){return i.pad2(t.getHours())+":"+i.pad2(t.getMinutes())},incr:function(i){return i.setUTCMinutes(i.getUTCMinutes()+t)}}},n=function(t){return{span:1e3*t,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes())},fmt:function(t){return i.pad2(t.getHours())+":"+i.pad2(t.getMinutes())+":"+i.pad2(t.getSeconds())},incr:function(i){return i.setUTCSeconds(i.getUTCSeconds()+t)}}},i.LABEL_SPECS={decade:{span:1728e8,start:function(t){return new Date(t.getFullYear()-t.getFullYear()%10,0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+10)}},year:{span:1728e7,start:function(t){return new Date(t.getFullYear(),0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+1)}},month:{span:24192e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),1)},fmt:function(t){return t.getFullYear()+"-"+i.pad2(t.getMonth()+1)},incr:function(t){return t.setMonth(t.getMonth()+1)}},week:{span:6048e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return t.getFullYear()+"-"+i.pad2(t.getMonth()+1)+"-"+i.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+7)}},day:{span:864e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return t.getFullYear()+"-"+i.pad2(t.getMonth()+1)+"-"+i.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+1)}},hour:e(60),"30min":e(30),"15min":e(15),"10min":e(10),"5min":e(5),minute:e(1),"30sec":n(30),"15sec":n(15),"10sec":n(10),"5sec":n(5),second:n(1)},i.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],i.Area=function(e){var n;function o(e){var s;if(!(this instanceof i.Area))return new i.Area(e);s=t.extend({},n,e),this.cumulative=!s.behaveLikeLine,"auto"===s.fillOpacity&&(s.fillOpacity=s.behaveLikeLine?.8:1),o.__super__.constructor.call(this,s)}return h(o,e),n={fillOpacity:"auto",behaveLikeLine:!1},o.prototype.calcPoints=function(){var t,i,e,n,o,s,r;for(r=[],n=0,o=(s=this.data).length;n<o;n++)(t=s[n])._x=this.transX(t.x),i=0,t._y=function(){var n,o,s,r;for(r=[],n=0,o=(s=t.y).length;n<o;n++)e=s[n],this.options.behaveLikeLine?r.push(this.transY(e)):(i+=e||0,r.push(this.transY(i)));return r}.call(this),r.push(t._ymax=Math.max.apply(Math,t._y));return r},o.prototype.drawSeries=function(){var t,i,e,n,o,s,r,h;for(this.seriesPoints=[],h=[],e=0,n=(i=this.options.behaveLikeLine?function(){s=[];for(var t=0,i=this.options.ykeys.length-1;0<=i?t<=i:t>=i;0<=i?t++:t--)s.push(t);return s}.apply(this):function(){r=[];for(var t=o=this.options.ykeys.length-1;o<=0?t<=0:t>=0;o<=0?t++:t--)r.push(t);return r}.apply(this)).length;e<n;e++)t=i[e],this._drawFillFor(t),this._drawLineFor(t),h.push(this._drawPointFor(t));return h},o.prototype._drawFillFor=function(t){var i;if(null!==(i=this.paths[t]))return i=i+"L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(i,this.fillForSeries(t))},o.prototype.fillForSeries=function(t){var i;return i=Raphael.rgb2hsl(this.colorFor(this.data[t],t,"line")),Raphael.hsl(i.h,this.options.behaveLikeLine?.9*i.s:.75*i.s,Math.min(.98,this.options.behaveLikeLine?1.2*i.l:1.25*i.l))},o.prototype.drawFilledPath=function(t,i){return this.raphael.path(t).attr("fill",i).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},o}(i.Line),i.Bar=function(e){function n(e){if(this.onHoverOut=s(this.onHoverOut,this),this.onHoverMove=s(this.onHoverMove,this),this.onGridClick=s(this.onGridClick,this),!(this instanceof i.Bar))return new i.Bar(e);n.__super__.constructor.call(this,t.extend({},e,{parseTime:!1}))}return h(n,e),n.prototype.init=function(){if(this.cumulative=this.options.stacked,"always"!==this.options.hideHover)return this.hover=new i.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)},n.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},n.prototype.calc=function(){var t;if(this.calcBars(),!1===this.options.hideHover)return(t=this.hover).update.apply(t,this.hoverContentForRow(this.data.length-1))},n.prototype.calcBars=function(){var t,i,e,n,o,s,r;for(r=[],t=n=0,o=(s=this.data).length;n<o;t=++n)(i=s[t])._x=this.left+this.width*(t+.5)/this.data.length,r.push(i._y=function(){var t,n,o,s;for(s=[],t=0,n=(o=i.y).length;t<n;t++)null!=(e=o[t])?s.push(this.transY(e)):s.push(null);return s}.call(this));return r},n.prototype.draw=function(){var t;return!0!==(t=this.options.axes)&&"both"!==t&&"x"!==t||this.drawXAxis(),this.drawSeries()},n.prototype.drawXAxis=function(){var t,i,e,n,o,s,r,h,a,l,p,u,c;for(l=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),r=null,s=null,c=[],t=p=0,u=this.data.length;0<=u?p<u:p>u;t=0<=u?++p:--p)h=this.data[this.data.length-1-t],a=(i=this.drawXAxisLabel(h._x,l,h.label)).getBBox(),i.transform("r"+-this.options.xLabelAngle),e=i.getBBox(),i.transform("t0,"+e.height/2+"..."),0!==this.options.xLabelAngle&&(o=-.5*a.width*Math.cos(this.options.xLabelAngle*Math.PI/180),i.transform("t"+o+",0...")),(null==r||r>=e.x+e.width||null!=s&&s>=e.x)&&e.x>=0&&e.x+e.width<this.el.width()?(0!==this.options.xLabelAngle&&(n=1.25*this.options.gridTextSize/Math.sin(this.options.xLabelAngle*Math.PI/180),s=e.x-n),c.push(r=e.x-this.options.xLabelMargin)):c.push(i.remove());return c},n.prototype.drawSeries=function(){var t,i,e,n,o,s,r,h,a,l,p,u,c,d;return e=this.width/this.options.data.length,h=null!=this.options.stacked?1:this.options.ykeys.length,t=(e*this.options.barSizeRatio-this.options.barGap*(h-1))/h,r=e*(1-this.options.barSizeRatio)/2,d=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var h,f,g,m;for(g=this.data,m=[],n=h=0,f=g.length;h<f;n=++h)a=g[n],o=0,m.push(function(){var h,f,g,m;for(g=a._y,m=[],l=h=0,f=g.length;h<f;l=++h)null!==(c=g[l])?(d?(u=Math.min(c,d),i=Math.max(c,d)):(u=c,i=this.bottom),s=this.left+n*e+r,this.options.stacked||(s+=l*(t+this.options.barGap)),p=i-u,this.options.stacked&&(u-=o),this.drawBar(s,u,t,p,this.colorFor(a,l,"bar"),this.options.barOpacity,this.options.barRadius),m.push(o+=p)):m.push(null);return m}.call(this));return m}.call(this)},n.prototype.colorFor=function(t,i,e){var n,o;return"function"==typeof this.options.barColors?(n={x:t.x,y:t.y[i],label:t.label},o={index:i,key:this.options.ykeys[i],label:this.options.labels[i]},this.options.barColors.call(this,n,o,e)):this.options.barColors[i%this.options.barColors.length]},n.prototype.hitTest=function(t){return 0===this.data.length?null:(t=Math.max(Math.min(t,this.right),this.left),Math.min(this.data.length-1,Math.floor((t-this.left)/(this.width/this.data.length))))},n.prototype.onGridClick=function(t,i){var e;return e=this.hitTest(t),this.fire("click",e,this.data[e].src,t,i)},n.prototype.onHoverMove=function(t,i){var e,n;return e=this.hitTest(t),(n=this.hover).update.apply(n,this.hoverContentForRow(e))},n.prototype.onHoverOut=function(){if(!1!==this.options.hideHover)return this.hover.hide()},n.prototype.hoverContentForRow=function(t){var i,e,n,o,s,r,h;for(i="<div class='morris-hover-row-label'>"+(n=this.data[t]).label+"</div>",e=s=0,r=(h=n.y).length;s<r;e=++s)o=h[e],i+="<div class='morris-hover-point' style='color: "+this.colorFor(n,e,"label")+"'>\n "+this.options.labels[e]+":\n "+this.yLabelFormat(o)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(i=this.options.hoverCallback(t,this.options,i,n.src)),[i,this.left+(t+.5)*this.width/this.data.length]},n.prototype.drawXAxisLabel=function(t,i,e){return this.raphael.text(t,i,e).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},n.prototype.drawBar=function(t,i,e,n,o,s,r){var h;return(0===(h=Math.max.apply(Math,r))||h>n?this.raphael.rect(t,i,e,n):this.raphael.path(this.roundedRect(t,i,e,n,r))).attr("fill",o).attr("fill-opacity",s).attr("stroke","none")},n.prototype.roundedRect=function(t,i,e,n,o){return null==o&&(o=[0,0,0,0]),["M",t,o[0]+i,"Q",t,i,t+o[0],i,"L",t+e-o[1],i,"Q",t+e,i,t+e,i+o[1],"L",t+e,i+n-o[2],"Q",t+e,i+n,t+e-o[2],i+n,"L",t+o[3],i+n,"Q",t,i+n,t,i+n-o[3],"Z"]},n}(i.Grid),i.Donut=function(e){function n(e){this.resizeHandler=s(this.resizeHandler,this),this.select=s(this.select,this),this.click=s(this.click,this);var n=this;if(!(this instanceof i.Donut))return new i.Donut(e);if(this.options=t.extend({},this.defaults,e),"string"==typeof e.element?this.el=t(document.getElementById(e.element)):this.el=t(e.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==e.data&&0!==e.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&t(window).bind("resize",function(t){return null!=n.timeoutId&&window.clearTimeout(n.timeoutId),n.timeoutId=window.setTimeout(n.resizeHandler,100)}),this.setData(e.data))}return h(n,e),n.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:i.commas,resize:!1},n.prototype.redraw=function(){var t,e,n,o,s,r,h,a,l,p,u,c,d,f,g,m,y,v,x,w,b,M;for(this.raphael.clear(),e=this.el.width()/2,n=this.el.height()/2,c=(Math.min(e,n)-10)/3,u=0,d=0,m=(x=this.values).length;d<m;d++)u+=x[d];for(a=5/(2*c),t=1.9999*Math.PI-a*this.data.length,r=0,s=0,this.segments=[],o=f=0,y=(w=this.values).length;f<y;o=++f)l=r+a+t*(w[o]/u),(p=new i.DonutSegment(e,n,2*c,c,r,l,this.data[o].color||this.options.colors[s%this.options.colors.length],this.options.backgroundColor,s,this.raphael)).render(),this.segments.push(p),p.on("hover",this.select),p.on("click",this.click),r=l,s+=1;for(this.text1=this.drawEmptyDonutLabel(e,n-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(e,n+10,this.options.labelColor,14),h=Math.max.apply(Math,this.values),s=0,M=[],g=0,v=(b=this.values).length;g<v;g++){if(b[g]===h){this.select(s);break}M.push(s+=1)}return M},n.prototype.setData=function(t){var i;return this.data=t,this.values=function(){var t,e,n,o;for(o=[],t=0,e=(n=this.data).length;t<e;t++)i=n[t],o.push(parseFloat(i.value));return o}.call(this),this.redraw()},n.prototype.click=function(t){return this.fire("click",t,this.data[t])},n.prototype.select=function(t){var i,e,n,o;for(e=0,n=(o=this.segments).length;e<n;e++)o[e].deselect();return this.segments[t].select(),i=this.data[t],this.setLabels(i.label,this.options.formatter(i.value,i))},n.prototype.setLabels=function(t,i){var e,n,o,s,r,h,a,l;return s=1.8*(e=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3),o=e/2,n=e/3,this.text1.attr({text:t,transform:""}),r=this.text1.getBBox(),h=Math.min(s/r.width,o/r.height),this.text1.attr({transform:"S"+h+","+h+","+(r.x+r.width/2)+","+(r.y+r.height)}),this.text2.attr({text:i,transform:""}),a=this.text2.getBBox(),l=Math.min(s/a.width,n/a.height),this.text2.attr({transform:"S"+l+","+l+","+(a.x+a.width/2)+","+a.y})},n.prototype.drawEmptyDonutLabel=function(t,i,e,n,o){var s;return s=this.raphael.text(t,i,"").attr("font-size",n).attr("fill",e),null!=o&&s.attr("font-weight",o),s},n.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},n}(i.EventEmitter),i.DonutSegment=function(t){function i(t,i,e,n,o,r,h,a,l,p){this.cx=t,this.cy=i,this.inner=e,this.outer=n,this.color=h,this.backgroundColor=a,this.index=l,this.raphael=p,this.deselect=s(this.deselect,this),this.select=s(this.select,this),this.sin_p0=Math.sin(o),this.cos_p0=Math.cos(o),this.sin_p1=Math.sin(r),this.cos_p1=Math.cos(r),this.is_long=r-o>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(i,t),i.prototype.calcArcPoints=function(t){return[this.cx+t*this.sin_p0,this.cy+t*this.cos_p0,this.cx+t*this.sin_p1,this.cy+t*this.cos_p1]},i.prototype.calcSegment=function(t,i){var e,n,o,s,r,h,a,l,p,u;return e=(p=this.calcArcPoints(t))[0],o=p[1],n=p[2],s=p[3],r=(u=this.calcArcPoints(i))[0],a=u[1],h=u[2],l=u[3],"M"+e+","+o+"A"+t+","+t+",0,"+this.is_long+",0,"+n+","+s+"L"+h+","+l+"A"+i+","+i+",0,"+this.is_long+",1,"+r+","+a+"Z"},i.prototype.calcArc=function(t){var i,e,n,o,s;return i=(s=this.calcArcPoints(t))[0],n=s[1],e=s[2],o=s[3],"M"+i+","+n+"A"+t+","+t+",0,"+this.is_long+",0,"+e+","+o},i.prototype.render=function(){var t=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return t.fire("hover",t.index)},function(){return t.fire("click",t.index)})},i.prototype.drawDonutArc=function(t,i){return this.raphael.path(t).attr({stroke:i,"stroke-width":2,opacity:0})},i.prototype.drawDonutSegment=function(t,i,e,n,o){return this.raphael.path(t).attr({fill:i,stroke:e,"stroke-width":3}).hover(n).click(o)},i.prototype.select=function(){if(!this.selected)return this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0},i.prototype.deselect=function(){if(this.selected)return this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1},i}(i.EventEmitter)}).call(this);
1
+ /* @license
2
+ morris.js06 v0.6.9
3
+ https://pierresh.github.io/morris.js/
4
+ Copyright 2021 Olly Smith All rights reserved.
5
+ Licensed under the BSD-2-Clause License.
6
+ */
7
+ (function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};a=window.Morris={},b=function(a){return getComputedStyle?getComputedStyle(a,null):a.currentStyle?a.currentStyle:a.style},a.EventEmitter=function(){function a(){}return a.prototype.on=function(a,b){return null==this.handlers&&(this.handlers={}),null==this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this},a.prototype.fire=function(){var a,b,c,d,f,g,h;if(c=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[c]){for(g=this.handlers[c],h=[],d=0,f=g.length;f>d;d++)b=g[d],h.push(b.apply(null,a));return h}},a}(),a.commas=function(a){var b,c,d,e;return null!=a?(d=0>a?"-":"",b=Math.abs(a),c=Math.floor(b).toFixed(0),d+=c.replace(/(?=(?:\d{3})+$)(?!^)/g,","),e=b.toString(),e.length>c.length&&(d+=e.slice(c.length)),d):"-"},a.pad2=function(a){return(10>a?"0":"")+a},a.extend=function(){var a,b,c,d,f,g,h;for(b=arguments[0],c=2<=arguments.length?e.call(arguments,1):[],null==b&&(b={}),g=0,h=c.length;h>g;g++)if(d=c[g],null!=d)for(a in d)f=d[a],d.hasOwnProperty(a)&&(b[a]=f);return b},a.offset=function(a){var b;return b=a.getBoundingClientRect(),{top:b.top+document.body.scrollTop,left:b.left+document.body.scrollLeft}},a.css=function(a,c){return b(a)[c]},a.on=function(a,b,c){return a.addEventListener?a.addEventListener(b,c):a.attachEvent("on"+b,c)},a.off=function(a,b,c){return a.removeEventListener?a.removeEventListener(b,c):a.detachEvent("on"+b,c)},a.dimensions=function(a){var c;return c=b(a),{width:parseInt(c.width),height:parseInt(c.height)}},a.innerDimensions=function(a){var c;return c=b(a),{width:parseInt(c.width)+parseInt(c.paddingLeft)+parseInt(c.paddingRight),height:parseInt(c.height)+parseInt(c.paddingTop)+parseInt(c.paddingBottom)}},a.Grid=function(b){function c(b){if(this.setLabels=f(this.setLabels,this),this.hasToShow=f(this.hasToShow,this),this.debouncedResizeHandler=f(this.debouncedResizeHandler,this),this.resizeHandler=f(this.resizeHandler,this),this.mouseupHandler=f(this.mouseupHandler,this),this.mousedownHandler=f(this.mousedownHandler,this),this.clickHandler=f(this.clickHandler,this),this.touchHandler=f(this.touchHandler,this),this.mouseleaveHandler=f(this.mouseleaveHandler,this),this.mousemoveHandler=f(this.mousemoveHandler,this),"string"==typeof b.element?this.el=document.getElementById(b.element):this.el=b.element[0]||b.element,null==this.el)throw new Error("Graph container element not found");"static"===a.css(this.el,"position")&&(this.el.style.position="relative"),this.options=a.extend({},this.gridDefaults,this.defaults||{},b),"string"==typeof this.options.units&&(this.options.postUnits=b.units),this.raphael=new Raphael(this.el),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),a.on(this.el,"mousemove",this.mousemoveHandler),a.on(this.el,"mouseleave",this.mouseleaveHandler),a.on(this.el,"touchstart touchmove touchend",this.touchHandler),a.on(this.el,"click",this.clickHandler),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,a.innerDimensions(this.el).height).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),a.on(this.el,"mousedown",this.mousedownHandler),a.on(this.el,"mouseup",this.mouseupHandler)),this.options.resize&&a.on(window,"resize",this.resizeHandler),this.el.style.webkitTapHighlightColor="rgba(0,0,0,0)",this.postInit&&this.postInit()}return h(c,b),c.prototype.gridDefaults={dateFormat:null,axes:!0,freePosition:!1,grid:!0,gridIntegers:!1,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:"auto",yLabelFormat:null,yLabelAlign:"right",yLabelAlign2:"left",xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",postUnits2:"",preUnits:"",preUnits2:"",ymax:"auto",ymin:"auto 0",ymax2:"auto",ymin2:"auto 0",regions:[],regionsColors:["#fde4e4"],goals:[],goals2:[],goalStrokeWidth:1,goalStrokeWidth2:1,goalLineColors:["red"],goalLineColors2:["red"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04"],rangeSelect:null,rangeSelectColor:"#eef",resize:!0,dataLabels:!0,dataLabelsPosition:"outside",dataLabelsFamily:"sans-serif",dataLabelsSize:12,dataLabelsWeight:"normal",dataLabelsColor:"auto",animate:!0,nbYkeys2:0,smooth:!0},c.prototype.destroy=function(){return a.off(this.el,"mousemove",this.mousemoveHandler),a.off(this.el,"mouseleave",this.mouseleaveHandler),a.off(this.el,"touchstart touchmove touchend",this.touchHandler),a.off(this.el,"click",this.clickHandler),this.options.rangeSelect&&(a.off(this.el,"mousedown",this.mousedownHandler),a.off(this.el,"mouseup",this.mouseupHandler)),this.options.resize?(window.clearTimeout(this.timeoutId),a.off(window,"resize",this.resizeHandler)):void 0},c.prototype.setData=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;if(null==c&&(c=!0),this.options.data=b,null==b||0===b.length)return this.data=[],this.raphael.clear(),void(null!=this.hover&&this.hover.hide());if(s=this.cumulative?0:null,u=this.cumulative?0:null,t=this.cumulative?0:null,v=this.cumulative?0:null,this.options.goals.length>0&&(j=Math.min.apply(Math,this.options.goals),i=Math.max.apply(Math,this.options.goals),u=null!=u?Math.min(u,j):j,s=null!=s?Math.max(s,i):i),this.options.goals2.length>0&&(j=Math.min.apply(Math,this.options.goals2),i=Math.max.apply(Math,this.options.goals2),v=null!=v?Math.min(v,j):j,t=null!=t?Math.max(t,i):i),this.options.nbYkeys2>this.options.ykeys.length&&(this.options.nbYkeys2=this.options.ykeys.length),this.data=function(){var c,d,e;for(e=[],h=c=0,d=b.length;d>c;h=++c)l=b[h],k={src:l},k.label=l[this.options.xkey],this.options.parseTime?(k.x=a.parseDate(k.label),this.options.dateFormat?k.label=this.options.dateFormat(k.x):"number"==typeof k.label&&(k.label=new Date(k.label).toString())):this.options.freePosition?(k.x=parseFloat(l[this.options.xkey]),this.options.xLabelFormat&&(k.label=this.options.xLabelFormat(k))):(k.x=h,this.options.xLabelFormat&&(k.label=this.options.xLabelFormat(k))),p=0,k.y=function(){var a,b,c,d;for(c=this.options.ykeys,d=[],g=a=0,b=c.length;b>a;g=++a)r=c[g],w=l[r],"string"==typeof w&&(w=parseFloat(w)),null!=w&&"number"!=typeof w&&(w=null),g<this.options.ykeys.length-this.options.nbYkeys2?(null!=w&&this.hasToShow(g)&&(this.cumulative?0>p&&w>0?p=w:p+=w:null!=s?(s=Math.max(w,s),u=Math.min(w,u)):s=u=w),this.cumulative&&null!=p&&(s=Math.max(p,s),u=Math.min(p,u))):(null!=w&&this.hasToShow(g)&&(this.cumulative?p=w:null!=t?(t=Math.max(w,t),v=Math.min(w,v)):t=v=w),this.cumulative&&null!=p&&(t=Math.max(p,t),v=Math.min(p,v))),d.push(w);return d}.call(this),e.push(k);return e}.call(this),(this.options.parseTime||this.options.freePosition)&&(this.data=this.data.sort(function(a,b){return(a.x>b.x)-(b.x>a.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0){if(this.options.parseTime)for(z=this.options.events,x=0,y=z.length;y>x;x++)d=z[x],d instanceof Array?(f=d[0],o=d[1],this.events.push([a.parseDate(f),a.parseDate(o)])):this.events.push(a.parseDate(d));else this.events=this.options.events;e=this.events.map(function(a){return a}),this.xmax=Math.max(this.xmax,Math.max.apply(Math,e)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,e))}return this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",u),this.ymax=this.yboundary("max",s),this.ymin2=this.yboundary("min2",v),this.ymax2=this.yboundary("max2",t),this.ymin===this.ymax&&(u&&(this.ymin-=1),this.ymax+=1),this.ymin2===this.ymax2&&(v&&(this.ymin2-=1),this.ymax2+=1),((A=this.options.axes)===!0||"both"===A||"y"===A||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(m=(this.ymax-this.ymin)/(this.options.numLines-1),this.options.gridIntegers&&(m=Math.max(1,Math.round(m))),this.grid=function(){var a,b,c,d;for(d=[],q=a=b=this.ymin,c=this.ymax;m>0?c>=a:a>=c;q=a+=m)d.push(parseFloat(q.toFixed(2)));return d}.call(this)),this.options.ymax2===this.gridDefaults.ymax2&&this.options.ymin2===this.gridDefaults.ymin2&&this.options.nbYkeys2>0?(this.grid2=this.autoGridLines(this.ymin2,this.ymax2,this.options.numLines),this.ymin2=Math.min(this.ymin2,this.grid2[0]),this.ymax2=Math.max(this.ymax2,this.grid2[this.grid2.length-1])):(n=(this.ymax2-this.ymin2)/(this.options.numLines-1),this.grid2=function(){var a,b,c,d;for(d=[],q=a=b=this.ymin2,c=this.ymax2;n>0?c>=a:a>=c;q=a+=n)d.push(parseFloat(q.toFixed(2)));return d}.call(this))),this.dirty=!0,c?this.redraw():void 0},c.prototype.yboundary=function(a,b){var c,d;return c=this.options["y"+a],"string"==typeof c?"auto"===c.slice(0,4)?c.length>5?(d=parseInt(c.slice(5),10),null==b?d:Math[a.substring(0,3)](b,d)):null!=b?b:0:parseInt(c,10):c},c.prototype.autoGridLines=function(a,b,c){var d,e,f,g,h,i,j,k,l;return h=b-a,l=Math.floor(Math.log(h)/Math.log(10)),j=Math.pow(10,l),e=Math.floor(a/j)*j,d=Math.ceil(b/j)*j,i=(d-e)/(c-1),1===j&&i>1&&Math.ceil(i)!==i&&(i=Math.ceil(i),d=e+i*(c-1)),0>e&&d>0&&(e=Math.floor(a/i)*i,d=Math.ceil(b/i)*i),1>i?(g=Math.floor(Math.log(i)/Math.log(10)),f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(parseFloat(k.toFixed(1-g)));return b}()):f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(k);return b}(),f},c.prototype._calc=function(){var b,c,d,e,f,g,h,i,j,k,l;return j=a.dimensions(this.el),g=j.width,e=j.height,(this.elementWidth!==g||this.elementHeight!==e||this.dirty)&&(this.elementWidth=g,this.elementHeight=e,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((k=this.options.axes)===!0||"both"===k||"y"===k)&&(null!=this.grid&&(h=function(){var a,b,c,e;for(c=this.grid,e=[],a=0,b=c.length;b>a;a++)d=c[a],e.push(this.measureText(this.yAxisFormat(d)).width);return e}.call(this)),this.options.nbYkeys2>0&&(i=function(){var a,b,c,e;for(c=this.grid2,e=[],a=0,b=c.length;b>a;a++)d=c[a],e.push(this.measureText(this.yAxisFormat2(d)).width);return e}.call(this)),this.options.horizontal?this.bottom-=this.options.padding/2:(this.left+=Math.max.apply(Math,h),this.options.nbYkeys2>0&&(this.right-=Math.max.apply(Math,i)))),((l=this.options.axes)===!0||"both"===l||"x"===l)&&(b=this.options.horizontal?-90:-this.options.xLabelAngle,c=function(){var a,c,d;for(d=[],f=a=0,c=this.data.length;c>=0?c>a:a>c;f=c>=0?++a:--a)d.push(this.measureText(this.data[f].label,b).height);return d}.call(this),this.options.horizontal?this.left+=Math.max.apply(Math,c):this.bottom-=Math.max.apply(Math,c)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.options.horizontal?(this.dx=this.height/(this.xmax-this.xmin),this.dy=this.width/(this.ymax-this.ymin),this.dy2=this.width/(this.ymax2-this.ymin2),this.yStart=this.left,this.yEnd=this.right,this.xStart=this.top,this.xEnd=this.bottom,this.xSize=this.height,this.ySize=this.width):(this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.dy2=this.height/(this.ymax2-this.ymin2),this.yStart=this.bottom,this.yEnd=this.top,this.xStart=this.left,this.xEnd=this.right,this.xSize=this.width,this.ySize=this.height),this.calc)?this.calc():void 0},c.prototype.transY=function(a){return this.options.horizontal?this.left+(a-this.ymin)*this.dy:this.bottom-(a-this.ymin)*this.dy},c.prototype.transY2=function(a){return this.options.horizontal?this.left+(a-this.ymin2)*this.dy2:this.bottom-(a-this.ymin2)*this.dy2},c.prototype.transX=function(a){return 1===this.data.length?(this.xStart+this.xEnd)/2:this.xStart+(a-this.xmin)*this.dx},c.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawRegions(),this.drawEvents(),this.draw&&this.draw(),this.drawGoals(),this.setLabels()},c.prototype.measureText=function(a,b){var c,d;return null==b&&(b=0),d=this.raphael.text(100,100,a).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(b),c=d.getBBox(),d.remove(),c},c.prototype.yAxisFormat=function(a){return this.yLabelFormat(a,0)},c.prototype.yAxisFormat2=function(a){return this.yLabelFormat(a,1e3)},c.prototype.yLabelFormat=function(b,c){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(b,c):0===this.options.nbYkeys2||c<=this.options.ykeys.length-this.options.nbYkeys2-1?""+this.options.preUnits+a.commas(b)+this.options.postUnits:""+this.options.preUnits2+a.commas(b)+this.options.postUnits2},c.prototype.yLabelFormat_noUnit=function(b,c){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(b,c):""+a.commas(b)},c.prototype.getYAxisLabelX=function(){return"right"===this.options.yLabelAlign?this.left-this.options.padding/2:this.options.padding/2},c.prototype.drawGrid=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(this.options.grid!==!1||(i=this.options.axes)===!0||"both"===i||"y"===i){if(this.options.horizontal?(a=this.getXAxisLabelY(),b=this.top-(this.options.xAxisLabelTopPadding||this.options.padding/2)):(a=this.getYAxisLabelX(),b=this.right+this.options.padding/2),null!=this.grid)for(j=this.grid,e=0,g=j.length;g>e;e++)c=j[e],d=this.transY(c),((k=this.options.axes)===!0||"both"===k||"y"===k)&&(this.options.horizontal?this.drawXAxisLabel(d,a,this.yAxisFormat(c)):this.drawYAxisLabel(a,d,this.yAxisFormat(c),1)),this.options.grid&&(d=Math.floor(d)+.5,this.options.horizontal?this.drawGridLine("M"+d+","+this.xStart+"V"+this.xEnd):(isNaN(this.xEnd)&&(this.xEnd=20),this.drawGridLine("M"+this.xStart+","+d+"H"+this.xEnd)));if(this.options.nbYkeys2>0){for(l=this.grid2,n=[],f=0,h=l.length;h>f;f++)c=l[f],d=this.transY2(c),(m=this.options.axes)===!0||"both"===m||"y"===m?this.options.horizontal?n.push(this.drawXAxisLabel(d,b,this.yAxisFormat2(c))):n.push(this.drawYAxisLabel(b,d,this.yAxisFormat2(c),2)):n.push(void 0);return n}}},c.prototype.drawRegions=function(){var a,b,c,d,e,f,g;for(f=this.options.regions,g=[],b=d=0,e=f.length;e>d;b=++d)c=f[b],a=this.options.regionsColors[b%this.options.regionsColors.length],g.push(this.drawRegion(c,a));return g},c.prototype.drawGoals=function(){var a,b,c,d,e,f,g,h,i,j;for(h=this.options.goals,c=d=0,f=h.length;f>d;c=++d)b=h[c],a=this.options.goalLineColors[c%this.options.goalLineColors.length],this.drawGoal(b,a);for(i=this.options.goals2,j=[],c=e=0,g=i.length;g>e;c=++e)b=i[c],a=this.options.goalLineColors2[c%this.options.goalLineColors2.length],j.push(this.drawGoal2(b,a));return j},c.prototype.drawEvents=function(){var a,b,c,d,e,f,g;if(null!=this.events){for(f=this.events,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.eventLineColors[c%this.options.eventLineColors.length],g.push(this.drawEvent(b,a));return g}},c.prototype.drawGoal=function(a,b){var c,d;return d=Math.floor(this.transY(a))+.5,c=this.options.horizontal?"M"+d+","+this.xStart+"V"+this.xEnd:"M"+this.xStart+","+d+"H"+this.xEnd,this.raphael.path(c).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth)},c.prototype.drawGoal2=function(a,b){var c,d;return d=Math.floor(this.transY2(a))+.5,c=this.options.horizontal?"M"+d+","+this.xStart+"V"+this.xEnd:"M"+this.xStart+","+d+"H"+this.xEnd,this.raphael.path(c).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth2)},c.prototype.drawRegion=function(a,b){var c,d,e,f;return a instanceof Array?(c=Math.min(Math.max.apply(Math,a),this.ymax),e=Math.max(Math.min.apply(Math,a),this.ymin),this.options.horizontal?(e=Math.floor(this.transY(e)),c=Math.floor(this.transY(c))-e,this.raphael.rect(e,this.xStart,c,this.xEnd-this.xStart).attr({fill:b,stroke:!1}).toBack()):(c=Math.floor(this.transY(c)),e=Math.floor(this.transY(e))-c,this.raphael.rect(this.xStart,c,this.xEnd-this.xStart,e).attr({fill:b,stroke:!1}).toBack())):this.options.horizontal?(f=Math.floor(this.transY(area))+1,d="M"+f+","+this.xStart+"V"+this.xEnd,this.raphael.path(d).attr("stroke",b).attr("stroke-width",2)):(f=Math.floor(this.transY(area))+1,d="M"+this.xStart+","+f+"H"+this.xEnd,this.raphael.path(d).attr("stroke",b).attr("stroke-width",2))},c.prototype.drawEvent=function(a,b){var c,d,e,f;return a instanceof Array?(c=a[0],e=a[1],c=Math.floor(this.transX(c))+.5,e=Math.floor(this.transX(e))+.5,this.options.horizontal?this.raphael.rect(this.yStart,c,this.yEnd-this.yStart,e-c).attr({fill:b,stroke:!1}).toBack():this.raphael.rect(c,this.yEnd,e-c,this.yStart-this.yEnd).attr({fill:b,stroke:!1}).toBack()):(f=Math.floor(this.transX(a))+.5,d=this.options.horizontal?"M"+this.yStart+","+f+"H"+this.yEnd:"M"+f+","+this.yStart+"V"+this.yEnd,this.raphael.path(d).attr("stroke",b).attr("stroke-width",this.options.eventStrokeWidth))},c.prototype.drawYAxisLabel=function(a,b,c,d){var e;return e=this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor),1===d?"right"===this.options.yLabelAlign?e.attr("text-anchor","end"):e.attr("text-anchor","start"):"left"===this.options.yLabelAlign2?e.attr("text-anchor","start"):e.attr("text-anchor","end")},c.prototype.drawXAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},c.prototype.drawGridLine=function(a){return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},c.prototype.startRange=function(a){return this.hover.hide(),this.selectFrom=a,this.selectionRect.attr({x:a,width:0}).show()},c.prototype.endRange=function(a){var b,c;return this.selectFrom?(c=Math.min(this.selectFrom,a),b=Math.max(this.selectFrom,a),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(c)].x,end:this.data[this.hitTest(b)].x}),this.selectFrom=null):void 0},c.prototype.mousemoveHandler=function(b){var c,d,e,f,g;return d=a.offset(this.el),g=b.pageX-d.left,this.selectFrom?(c=this.data[this.hitTest(Math.min(g,this.selectFrom))]._x,e=this.data[this.hitTest(Math.max(g,this.selectFrom))]._x,f=e-c,this.selectionRect.attr({x:c,width:f})):this.fire("hovermove",g,b.pageY-d.top)},c.prototype.mouseleaveHandler=function(a){return this.selectFrom&&(this.selectionRect.hide(),this.selectFrom=null),this.fire("hoverout")},c.prototype.touchHandler=function(b){var c,d;return d=b.originalEvent.touches[0]||b.originalEvent.changedTouches[0],c=a.offset(this.el),this.fire("hovermove",d.pageX-c.left,d.pageY-c.top)},c.prototype.clickHandler=function(b){var c;return c=a.offset(this.el),this.fire("gridclick",b.pageX-c.left,b.pageY-c.top)},c.prototype.mousedownHandler=function(b){var c;return c=a.offset(this.el),this.startRange(b.pageX-c.left)},c.prototype.mouseupHandler=function(b){var c;return c=a.offset(this.el),this.endRange(b.pageX-c.left),this.fire("hovermove",b.pageX-c.left,b.pageY-c.top)},c.prototype.resizeHandler=function(){return null!=this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(this.debouncedResizeHandler,100)},c.prototype.debouncedResizeHandler=function(){var b,c,d;return this.timeoutId=null,d=a.dimensions(this.el),c=d.width,b=d.height,this.raphael.setSize(c,b),this.options.animate=!1,this.redraw()},c.prototype.hasToShow=function(a){return this.options.shown===!0||this.options.shown[a]===!0},c.prototype.isColorDark=function(a){var b,c,d,e,f;return null!=a?(a=a.substring(1),f=parseInt(a,16),e=f>>16&255,c=f>>8&255,b=f>>0&255,d=.2126*e+.7152*c+.0722*b,d>=128?!1:!0):!1},c.prototype.drawDataLabel=function(a,b,c,d){var e;return e=this.raphael.text(a,b,c).attr("text-anchor","middle").attr("font-size",this.options.dataLabelsSize).attr("font-family",this.options.dataLabelsFamily).attr("font-weight",this.options.dataLabelsWeight).attr("fill",d)},c.prototype.drawDataLabelExt=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,c).attr("text-anchor",d).attr("font-size",this.options.dataLabelsSize).attr("font-family",this.options.dataLabelsFamily).attr("font-weight",this.options.dataLabelsWeight).attr("fill",e)},c.prototype.setLabels=function(){var a,b,c,d,e,f,g,h;if(this.options.dataLabels){for(g=this.data,h=[],e=0,f=g.length;f>e;e++)c=g[e],h.push(function(){var e,f,g,h;for(g=this.options.ykeys,h=[],b=e=0,f=g.length;f>e;b=++e)d=g[b],a="auto"!==this.options.dataLabelsColor?this.options.dataLabelsColor:this.options.stacked===!0&&this.isColorDark(this.options.barColors[b%this.options.barColors.length])===!0?"#fff":"#000",null!=this.options.lineColors&&null!=this.options.lineType?(null!=c.label_y[b]&&this.drawDataLabel(c._x,c.label_y[b],this.yLabelFormat_noUnit(c.y[b],0),a),null!=c._y2&&null!=c._y2[b]?h.push(this.drawDataLabel(c._x,c._y2[b]-10,this.yLabelFormat_noUnit(c.y[b],1e3),a)):h.push(void 0)):null!=c.label_y[b]?this.options.horizontal===!1?h.push(this.drawDataLabel(c.label_x[b],c.label_y[b],this.yLabelFormat_noUnit(c.y[b],b),a)):h.push(this.drawDataLabelExt(c.label_x[b],c.label_y[b],this.yLabelFormat_noUnit(c.y[b]),"start",a)):null!=c._y2[b]?this.options.horizontal===!1?h.push(this.drawDataLabel(c._x,c._y2[b]-10,this.yLabelFormat_noUnit(c.y[b],b),a)):h.push(this.drawDataLabelExt(c._y2[b],c._x-10,this.yLabelFormat_noUnit(c.y[b]),"middle",a)):h.push(void 0);return h}.call(this));return h}},c}(a.EventEmitter),a.parseDate=function(a){var b,c,d,e,f,g,h,i,j,k,l;return"number"==typeof a?a:(c=a.match(/^(\d+) Q(\d)$/),e=a.match(/^(\d+)-(\d+)$/),f=a.match(/^(\d+)-(\d+)-(\d+)$/),h=a.match(/^(\d+) W(\d+)$/),i=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),j=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),c?new Date(parseInt(c[1],10),3*parseInt(c[2],10)-1,1).getTime():e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,1).getTime():f?new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10)).getTime():h?(k=new Date(parseInt(h[1],10),0,1),4!==k.getDay()&&k.setMonth(0,1+(4-k.getDay()+7)%7),k.getTime()+6048e5*parseInt(h[2],10)):i?i[6]?(g=0,"Z"!==i[6]&&(g=60*parseInt(i[8],10)+parseInt(i[9],10),"+"===i[7]&&(g=0-g)),Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)+g)):new Date(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)).getTime():j?(l=parseFloat(j[6]),b=Math.floor(l),d=Math.round(1e3*(l-b)),j[8]?(g=0,"Z"!==j[8]&&(g=60*parseInt(j[10],10)+parseInt(j[11],10),"+"===j[9]&&(g=0-g)),Date.UTC(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10)+g,b,d)):new Date(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10),b,d).getTime()):new Date(parseInt(a,10),0,1).getTime())},a.Hover=function(){function b(b){null==b&&(b={}),this.options=a.extend({},a.Hover.defaults,b),this.el=document.createElement("div"),this.el.className=this.options["class"],this.el.style.display="none",(this.options.parent=this.options.parent[0]||this.options.parent).appendChild(this.el)}return b.defaults={"class":"morris-hover morris-default-style"},b.prototype.update=function(a,b,c,d){return a?(this.html(a),this.show(),this.moveTo(b,c,d)):this.hide()},b.prototype.html=function(a){return this.el.innerHTML=a},b.prototype.moveTo=function(b,c,d){var e,f,g,h,i,j,k;return k=a.innerDimensions(this.options.parent),i=k.width,h=k.height,f=this.el.offsetWidth,e=this.el.offsetHeight,g=Math.min(Math.max(0,b-f/2),i-f),null!=c?d===!0?(j=c-e/2,0>j&&(j=0)):(j=c-e-10,0>j&&(j=c+10,j+e>h&&(j=h/2-e/2))):j=h/2-e/2,this.el.style.left=parseInt(g)+"px",this.el.style.top=parseInt(j)+"px"},b.prototype.show=function(){return this.el.style.display=""},b.prototype.hide=function(){return this.el.style.display="none"},b}(),a.Line=function(b){function c(b){return this.hilight=f(this.hilight,this),this.escapeHTML=f(this.escapeHTML,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof a.Line?void c.__super__.constructor.call(this,b):new a.Line(b)}return h(c,b),c.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new a.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={lineWidth:3,pointSize:4,pointSizeGrow:3,lineColors:["#2f7df6","#53a351","#f6c244","#cb444a","#4aa0b5","#222529"],extraClassLine:"",extraClassCircle:"",pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],pointSuperimposed:!0,hoverOrdered:!1,hoverReversed:!1,smooth:!0,lineType:{},shown:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:0,verticalGrid:!1,verticalGridHeight:"full",verticalGridStartOffset:0,verticalGridType:"",trendLine:!1,trendLineType:"linear",trendLineWidth:2,trendLineWeight:!1,trendLineColors:["#689bc3","#a2b3bf","#64b764"]},c.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},c.prototype.calcPoints=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;for(q=this.data,j=0,n=q.length;n>j;j++)g=q[j],g._x=this.transX(g.x),g._y=function(){var a,b,c,e;for(c=g.y,e=[],d=a=0,b=c.length;b>a;d=++a)i=c[d],d<this.options.ykeys.length-this.options.nbYkeys2?null!=i?e.push(this.transY(i)):e.push(i):e.push(void 0);return e}.call(this),g._y2=function(){var a,b,c,e;for(c=g.y,e=[],d=a=0,b=c.length;b>a;d=++a)i=c[d],d>=this.options.ykeys.length-this.options.nbYkeys2?null!=i?e.push(this.transY2(i)):e.push(i):e.push(void 0);return e}.call(this),g._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var a,c,d,e;for(d=g._y,e=[],b=a=0,c=d.length;c>a;b=++a)i=d[b],null!=i&&this.hasToShow(b)&&e.push(i);return e}.call(this))),g._ymax2=Math.min.apply(Math,[this.bottom].concat(function(){var a,c,d,e;for(d=g._y2,e=[],b=a=0,c=d.length;c>a;b=++a)i=d[b],null!=i&&this.hasToShow(b)&&e.push(i);return e}.call(this)));for(r=this.data,c=k=0,o=r.length;o>k;c=++k)for(g=r[c],this.data[c].label_x=[],this.data[c].label_y=[],e=l=s=this.options.ykeys.length-1;0>=s?0>=l:l>=0;e=0>=s?++l:--l)null!=g._y[e]&&(this.data[c].label_x[e]=g._x,this.data[c].label_y[e]=g._y[e]-10),null!=g._y2&&null!=g._y2[e]&&(this.data[c].label_x[e]=g._x,this.data[c].label_y[e]=g._y2[e]-10);if(this.options.pointSuperimposed===!1){for(t=this.data,u=[],m=0,p=t.length;p>m;m++)g=t[m],u.push(function(){var d,e,i,j,k,l,m;for(k=g._y,m=[],c=i=0,d=k.length;d>i;c=++i){for(f=k[c],a=0,l=g._y,b=j=0,e=l.length;e>j;b=++j)h=l[b],f===h&&"number"==typeof f&&a++;a>1?(g._y[c]=g._y[c]+a*this.lineWidthForSeries(c),this.lineWidthForSeries(c)>1?m.push(g._y[c]=g._y[c]-1):m.push(void 0)):m.push(void 0)}return m}.call(this));return u}},c.prototype.hitTest=function(a){var b,c,d,e,f;if(0===this.data.length)return null;for(f=this.data.slice(1),b=d=0,e=f.length;e>d&&(c=f[b],!(a<(c._x+this.data[b]._x)/2));b=++d);return b},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a,b){var c;return c=this.hitTest(a),this.displayHoverForRow(c)},c.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},c.prototype.displayHoverForRow=function(a){var b;return null!=a?((b=this.hover).update.apply(b,this.hoverContentForRow(a)),this.hilight(a)):(this.hover.hide(),this.hilight())},c.prototype.escapeHTML=function(a){var b,c;return b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},c=/[&<>"'/]/gi,a.replace(c,function(a){return b[a]})},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u;if(j=this.data[a],c="",h=[],this.options.hoverOrdered===!0)for(s=j.y,e=m=0,q=s.length;q>m;e=++m){for(l=s[e],f=null,g=-1,t=j.y,d=n=0,r=t.length;r>n;d=++n)k=t[d],i.call(h,d)<0&&(k>=f||null===f)&&(f=k,g=d);h.push(g)}else for(u=j.y,e=o=u.length-1;o>=0;e=o+=-1)l=u[e],h.push(e);for(this.options.hoverReversed===!0&&(h=h.reverse()),b=-1,p=h.length-1;p>=0;p+=-1)d=h[p],this.options.labels[d]!==!1&&(void 0!==j.y[d]&&-1===b&&(b=d),c="<div class='morris-hover-point' style='color: "+this.colorFor(j,d,"label")+"'>\n "+this.options.labels[d]+":\n "+this.yLabelFormat(j.y[d],d)+"\n</div>"+c);return c="<div class='morris-hover-row-label'>"+this.escapeHTML(j.label)+"</div>"+c,"function"==typeof this.options.hoverCallback&&(c=this.options.hoverCallback(a,this.options,c,j.src)),b>this.options.nbYkeys2?[c,j._x,j._ymax2]:[c,j._x,j._ymax]},c.prototype.generatePaths=function(){var b,c,d,e,f,g;return this.paths=function(){var h,j,k,l;for(l=[],c=h=0,j=this.options.ykeys.length;j>=0?j>h:h>j;c=j>=0?++h:--h)g="boolean"==typeof this.options.smooth?this.options.smooth:(k=this.options.ykeys[c],i.call(this.options.smooth,k)>=0),d=g?"smooth":"jagged","string"==typeof this.options.lineType&&(d=this.options.lineType),void 0!==this.options.lineType[this.options.ykeys[c]]&&(d=this.options.lineType[this.options.ykeys[c]]),e=this.options.ykeys.length-this.options.nbYkeys2,b=e>c?function(){var a,b,d,e;for(d=this.data,e=[],a=0,b=d.length;b>a;a++)f=d[a],void 0!==f._y[c]&&e.push({x:f._x,y:f._y[c]});return e}.call(this):function(){var a,b,d,e;for(d=this.data,e=[],a=0,b=d.length;b>a;a++)f=d[a],void 0!==f._y2[c]&&e.push({x:f._x,y:f._y2[c]});return e}.call(this),b.length>1?l.push(a.Line.createPath(b,d,this.bottom,c,this.options.ykeys.length,this.options.lineWidth)):l.push(null);return l}.call(this)},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},c.prototype.drawXAxis=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o=this;for(i=this.bottom+this.options.padding/2,g=null,f=null,b=function(b,c){var d,e,h,j,k;return d=o.drawXAxisLabel(o.transX(c),i,b),k=d.getBBox(),d.transform("r"+-o.options.xLabelAngle),e=d.getBBox(),d.transform("t0,"+e.height/2+"..."),0!==o.options.xLabelAngle&&(j=-.5*k.width*Math.cos(o.options.xLabelAngle*Math.PI/180),d.transform("t"+j+",0...")),e=d.getBBox(),(null==g||g>=e.x+e.width||null!=f&&f>=e.x)&&e.x>=0&&e.x+e.width<a.dimensions(o.el).width?(0!==o.options.xLabelAngle&&(h=1.25*o.options.gridTextSize/Math.sin(o.options.xLabelAngle*Math.PI/180),f=e.x-h),g=e.x-o.options.xLabelMargin,o.options.verticalGrid===!0?o.drawVerticalGridLine(c):void 0):d.remove()},d=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:a.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):this.options.customLabels?function(){var a,b,c,d;for(c=this.options.customLabels,d=[],a=0,b=c.length;b>a;a++)h=c[a],d.push([h.label,h.x]);return d}.call(this):function(){var a,b,c,d;for(c=this.data,d=[],a=0,b=c.length;b>a;a++)h=c[a],d.push([h.label,h.x]);return d}.call(this),d.reverse(),j=0,l=d.length;l>j;j++)c=d[j],b(c[0],c[1]);if("string"==typeof this.options.verticalGrid){for(e=a.labelSeries(this.xmin,this.xmax,this.width,this.options.verticalGrid),n=[],k=0,m=e.length;m>k;k++)c=e[k],n.push(this.drawVerticalGridLine(c[1]));return n}},c.prototype.drawVerticalGridLine=function(a){var b,c;return a=Math.floor(this.transX(a))+.5,c=this.yStart+this.options.verticalGridStartOffset,b="full"===this.options.verticalGridHeight?this.yEnd:this.yStart-this.options.verticalGridHeight,this.drawGridLineVert("M"+a+","+c+"V"+b)},c.prototype.drawGridLineVert=function(a){
8
+ return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth).attr("stroke-dasharray",this.options.verticalGridType)},c.prototype.drawSeries=function(){var a,b,c,d,e,f;for(this.seriesPoints=[],a=b=d=this.options.ykeys.length-1;0>=d?0>=b:b>=0;a=0>=d?++b:--b)this.hasToShow(a)&&((this.options.trendLine!==!1&&this.options.trendLine===!0||this.options.trendLine[a]===!0)&&this.data.length>0&&this._drawTrendLine(a),this._drawLineFor(a));for(f=[],a=c=e=this.options.ykeys.length-1;0>=e?0>=c:c>=0;a=0>=e?++c:--c)this.hasToShow(a)?f.push(this._drawPointFor(a)):f.push(void 0);return f},c.prototype._drawPointFor=function(a){var b,c,d,e,f,g,h;for(this.seriesPoints[a]=[],g=this.data,h=[],c=e=0,f=g.length;f>e;c=++e)d=g[c],b=null,null!=d._y[a]&&(b=this.drawLinePoint(d._x,d._y[a],this.colorFor(d,a,"point"),a)),null!=d._y2&&null!=d._y2[a]&&(b=this.drawLinePoint(d._x,d._y2[a],this.colorFor(d,a,"point"),a)),h.push(this.seriesPoints[a].push(b));return h},c.prototype._drawLineFor=function(a){var b;return b=this.paths[a],null!==b?this.drawLinePath(b,this.colorFor(null,a,"line"),a):void 0},c.prototype._drawTrendLine=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;for(k=0,n=0,l=0,m=0,f=0,i=[],A=this.data,g=v=0,z=A.length;z>v;g=++v)r=A[g],t=r.x,u=r.y[b],null!=u&&(i.push([t,u]),s=this.options.trendLineWeight===!1?1:this.options.data[g][this.options.trendLineWeight],f+=s,k+=t*s,n+=u*s,l+=t*t*s,m+=t*u*s);if(c=(f*m-k*n)/(f*l-k*k),d=n/f-c*k/f,e=[{},{}],e[0].x=this.transX(this.data[0].x),e[0].y=this.transY(this.data[0].x*c+d),e[1].x=this.transX(this.data[this.data.length-1].x),e[1].y=this.transY(this.data[this.data.length-1].x*c+d),"linear"!==this.options.trendLineType)if("function"==typeof regression){if(o=(this.xmax-this.xmin)/30,e=[],"polynomial"===this.options.trendLineType)for(j=regression("polynomial",i,2),g=w=0;30>=w;g=++w)p=this.xmin+g*o,q=j.equation[2]*p*p+j.equation[1]*p+j.equation[0],e.push({x:this.transX(p),y:this.transY(q)});else if("logarithmic"===this.options.trendLineType)for(j=regression("logarithmic",i),g=x=0;30>=x;g=++x)p=this.xmin+g*o,q=j.equation[0]+j.equation[1]*Math.log(p),e.push({x:this.transX(p),y:this.transY(q)});else if("exponential"===this.options.trendLineType)for(j=regression("exponential",i),g=y=0;30>=y;g=++y)p=this.xmin+g*o,q=j.equation[0]+Math.exp(j.equation[1]*p),e.push({x:this.transX(p),y:this.transY(q)});console.log("Regression formula is: "+j.string+", r2:"+j.r2)}else console.log("Warning: regression() is undefined, please ensure that regression.js is loaded");return isNaN(c)?void 0:(h=a.Line.createPath(e,"jagged",this.bottom),h=this.raphael.path(h).attr("stroke",this.colorFor(null,b,"trendLine")).attr("stroke-width",this.options.trendLineWidth))},c.createPath=function(b,c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r,s,t,u;for(n="","smooth"===c&&(j=a.Line.gradients(b)),o={y:null},k=t=0,u=b.length;u>t;k=++t)h=b[k],null!=h.y&&(null!=o.y?"smooth"===c?(i=j[k],m=j[k-1],l=(h.x-o.x)/4,p=o.x+l,r=Math.min(d,o.y+l*m),q=h.x-l,s=Math.min(d,h.y-l*i),n+="C"+p+","+r+","+q+","+s+","+h.x+","+h.y):"jagged"===c?n+="L"+h.x+","+h.y:"step"===c?(n+="L"+h.x+","+o.y,n+="L"+h.x+","+h.y):"stepNoRiser"===c?(n+="L"+h.x+","+o.y,n+="M"+h.x+","+h.y):"vertical"===c&&(n+="L"+(o.x-(f-1)*(g/f)+e*g)+","+o.y,n+="L"+(o.x-(f-1)*(g/f)+e*g)+","+d,n+="M"+(h.x-(f-1)*(g/f)+e*g)+","+d,b.length===k+1&&(n+="L"+(h.x-(f-1)*(g/f)+e*g)+","+h.y,n+="L"+(h.x-(f-1)*(g/f)+e*g)+","+d)):("smooth"!==c||null!=j[k])&&(n+="M"+h.x+","+h.y)),o=h;return n},c.gradients=function(a){var b,c,d,e,f,g,h,i;for(c=function(a,b){return(a.y-b.y)/(a.x-b.x)},i=[],d=g=0,h=a.length;h>g;d=++g)b=a[d],null!=b.y?(e=a[d+1]||{y:null},f=a[d-1]||{y:null},null!=f.y&&null!=e.y?i.push(c(f,e)):null!=f.y?i.push(c(f,b)):null!=e.y?i.push(c(b,e)):i.push(null)):i.push(null);return i},c.prototype.hilight=function(a){var b,c,d,e,f;if(null!==this.prevHilight&&this.prevHilight!==a)for(b=c=0,e=this.seriesPoints.length-1;e>=0?e>=c:c>=e;b=e>=0?++c:--c)this.hasToShow(b)&&this.seriesPoints[b][this.prevHilight]&&this.seriesPoints[b][this.prevHilight].animate(this.pointShrinkSeries(b));if(null!==a&&this.prevHilight!==a)for(b=d=0,f=this.seriesPoints.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)this.hasToShow(b)&&this.seriesPoints[b][a]&&this.seriesPoints[b][a].animate(this.pointGrowSeries(b));return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,a,b,c):"point"===c?this.options.pointFillColors[b%this.options.pointFillColors.length]||this.options.lineColors[b%this.options.lineColors.length]:"trendLine"===c?this.options.trendLineColors[b%this.options.trendLineColors.length]:this.options.lineColors[b%this.options.lineColors.length]},c.prototype.drawLinePath=function(a,b,c){var d,e,f,g,h,i,j,k;if(this.options.animate){for(h="",k=this.data,d=i=0,j=k.length;j>i;d=++i)f=k[d],""===h?c>=this.options.ykeys.length-this.options.nbYkeys2?null!=f._y2[c]&&(h="M"+f._x+","+this.transY2(this.ymin2)):null!=f._y[c]&&(h="vertical"!==this.options.lineType?"M"+f._x+","+this.transY(this.ymin):"M"+f._x+","+this.transY(0)+"L"+f._x+","+this.transY(0)+"L"+f._x+","+this.transY(0)):c>=this.options.ykeys.length-this.options.nbYkeys2?null!=f._y2[c]&&(h+=","+f._x+","+this.transY2(this.ymin2),"step"===this.options.lineType&&(h+=","+f._x+","+this.transY2(this.ymin2))):null!=f._y[c]&&("vertical"!==this.options.lineType?h+=","+f._x+","+this.transY(this.ymin):(g=f._x-(this.options.ykeys.length-1)*(this.options.lineWidth/this.options.ykeys.length)+c*this.options.lineWidth,h+="M"+g+","+this.transY(0)+"L"+g+","+this.transY(0)+"L"+g+","+this.transY(0)),"step"===this.options.lineType&&(h+=","+f._x+","+this.transY(this.ymin)));return e=this.raphael.path(h).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c)).attr("class",this.options.extraClassLine).attr("class","line_"+c),this.options.cumulative?function(a,b){return a.animate({path:b},600,"<>")}(e,a):function(a,b){return a.animate({path:b},500,"<>")}(e,a)}return this.raphael.path(a).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c)).attr("class",this.options.extraClassLine).attr("class","line_"+c)},c.prototype.drawLinePoint=function(a,b,c,d){return this.raphael.circle(a,b,this.pointSizeForSeries(d)).attr("fill",c).attr("stroke-width",this.pointStrokeWidthForSeries(d)).attr("stroke",this.pointStrokeColorForSeries(d)).attr("class",this.options.extraClassCircle).attr("class","circle_line_"+d)},c.prototype.pointStrokeWidthForSeries=function(a){return this.options.pointStrokeWidths[a%this.options.pointStrokeWidths.length]},c.prototype.pointStrokeColorForSeries=function(a){return this.options.pointStrokeColors[a%this.options.pointStrokeColors.length]},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.pointGrowSeries=function(a){return 0!==this.pointSizeForSeries(a)?Raphael.animation({r:this.pointSizeForSeries(a)+this.options.pointSizeGrow},25,"linear"):void 0},c.prototype.pointShrinkSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)},25,"linear")},c}(a.Grid),a.labelSeries=function(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;if(i=200*(c-b)/d,h=new Date(b),m=a.LABEL_SPECS[e],void 0===m)for(q=a.AUTO_LABEL_ORDER,o=0,p=q.length;p>o;o++)if(j=q[o],l=a.LABEL_SPECS[j],i>=l.span){m=l;break}for(void 0===m&&(m=a.LABEL_SPECS.second),f&&(m=a.extend({},m,{fmt:f})),g=m.start(h),k=[];(n=g.getTime())<=c;)n>=b&&k.push([m.fmt(g),n]),m.incr(g);return k},c=function(b){return{span:60*b*1e3,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())},fmt:function(b){return""+a.pad2(b.getHours())+":"+a.pad2(b.getMinutes())},incr:function(a){return a.setUTCMinutes(a.getUTCMinutes()+b)}}},d=function(b){return{span:1e3*b,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes())},fmt:function(b){return""+a.pad2(b.getHours())+":"+a.pad2(b.getMinutes())+":"+a.pad2(b.getSeconds())},incr:function(a){return a.setUTCSeconds(a.getUTCSeconds()+b)}}},a.LABEL_SPECS={decade:{span:1728e8,start:function(a){return new Date(a.getFullYear()-a.getFullYear()%10,0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+10)}},year:{span:1728e7,start:function(a){return new Date(a.getFullYear(),0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+1)}},month:{span:24192e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),1)},fmt:function(b){return""+b.getFullYear()+"-"+a.pad2(b.getMonth()+1)},incr:function(a){return a.setMonth(a.getMonth()+1)}},week:{span:6048e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(b){return""+b.getFullYear()+"-"+a.pad2(b.getMonth()+1)+"-"+a.pad2(b.getDate())},incr:function(a){return a.setDate(a.getDate()+7)}},day:{span:864e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(b){return""+b.getFullYear()+"-"+a.pad2(b.getMonth()+1)+"-"+a.pad2(b.getDate())},incr:function(a){return a.setDate(a.getDate()+1)}},hour:c(60),"30min":c(30),"15min":c(15),"10min":c(10),"5min":c(5),minute:c(1),"30sec":d(30),"15sec":d(15),"10sec":d(10),"5sec":d(5),second:d(1)},a.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],a.Area=function(b){function c(b){var e;return this instanceof a.Area?(e=a.extend({},d,b),this.cumulative=!e.behaveLikeLine,"auto"===e.fillOpacity&&(e.fillOpacity=e.behaveLikeLine?.8:1),void c.__super__.constructor.call(this,e)):new a.Area(b)}var d;return h(c,b),d={fillOpacity:"auto",behaveLikeLine:!1,belowArea:!0,areaColors:[]},c.prototype.calcPoints=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(k=this.data,g=0,i=k.length;i>g;g++)d=k[g],d._x=this.transX(d.x),e=0,d._y=function(){var a,b,c,g;for(c=d.y,g=[],a=0,b=c.length;b>a;a++)f=c[a],this.options.behaveLikeLine?null!=f?g.push(this.transY(f)):g.push(f):null!=f?(e+=f||0,g.push(this.transY(e))):g.push(void 0);return g}.call(this),d._ymax=Math.max.apply(Math,[].concat(function(){var b,c,e,g;for(e=d._y,g=[],a=b=0,c=e.length;c>b;a=++b)f=e[a],null!=f&&g.push(f);return g}()));for(l=this.data,m=[],b=h=0,j=l.length;j>h;b=++h)d=l[b],this.data[b].label_x=[],this.data[b].label_y=[],m.push(function(){var a,e,f;for(f=[],c=a=e=this.options.ykeys.length-1;0>=e?0>=a:a>=0;c=0>=e?++a:--a)null!=d._y[c]&&(this.data[b].label_x[c]=d._x,this.data[b].label_y[c]=d._y[c]-10),null!=d._y2&&null!=d._y2[c]?(this.data[b].label_x[c]=d._x,f.push(this.data[b].label_y[c]=d._y2[c]-10)):f.push(void 0);return f}.call(this));return m},c.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h,i,j;for(this.seriesPoints=[],b=this.options.behaveLikeLine?function(){h=[];for(var a=0,b=this.options.ykeys.length-1;b>=0?b>=a:a>=b;b>=0?a++:a--)h.push(a);return h}.apply(this):function(){i=[];for(var a=g=this.options.ykeys.length-1;0>=g?0>=a:a>=0;0>=g?a++:a--)i.push(a);return i}.apply(this),c=0,e=b.length;e>c;c++)a=b[c],this._drawFillFor(a);for(j=[],d=0,f=b.length;f>d;d++)a=b[d],this._drawLineFor(a),j.push(this._drawPointFor(a));return j},c.prototype._drawFillFor=function(b){var c,d,e,f;return d=this.paths[b],null!==d?this.options.belowArea===!0?(d+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(d,this.fillForSeries(b),b)):(c=function(){var a,b,c;for(b=this.data,c=[],a=b.length-1;a>=0;a+=-1)f=b[a],void 0!==f._y[0]&&c.push({x:f._x,y:f._y[0]});return c}.call(this),e=a.Line.createPath(c,"smooth",this.bottom),d=d+"L"+e.slice(1),this.drawFilledPath(d,this.fillForSeries(b),b)):void 0},c.prototype.fillForSeries=function(a){var b;return 0===this.options.areaColors.length&&(this.options.areaColors=this.options.lineColors),b=Raphael.rgb2hsl(this.options.areaColors[a%this.options.areaColors.length]),Raphael.hsl(b.h,this.options.behaveLikeLine?.9*b.s:.75*b.s,Math.min(.98,this.options.behaveLikeLine?1.2*b.l:1.25*b.l))},c.prototype.drawFilledPath=function(b,c,d){var e,f,g,h,i;return this.options.animate?(e=function(){var a,b,c,e;for(c=this.data,e=[],a=0,b=c.length;b>a;a++)g=c[a],void 0!==g._y[d]&&e.push({x:g._x,y:this.transY(0)});return e}.call(this),i=a.Line.createPath(e,"smooth",this.bottom),this.options.belowArea===!0?i+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z":(e=function(){var a,b,c;for(b=this.data,c=[],a=b.length-1;a>=0;a+=-1)g=b[a],void 0!==g._y[d]&&c.push({x:g._x,y:this.transY(0)});return c}.call(this),f=a.Line.createPath(e,"smooth",this.bottom),i=i+"L"+f.slice(1)),i+="Z",h=this.raphael.path(i).attr("fill",c).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none"),function(a,b){return a.animate({path:b},500,"<>")}(h,b)):this.raphael.path(b).attr("fill",c).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},c}(a.Line),a.Bar=function(b){function c(b){return this.escapeHTML=f(this.escapeHTML,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof a.Bar?void c.__super__.constructor.call(this,a.extend({},b,{parseTime:!1})):new a.Bar(b)}return h(c,b),c.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new a.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={barSizeRatio:.75,pointSize:4,lineWidth:3,barGap:3,barColors:["#2f7df6","#53a351","#f6c244","#cb444a","#4aa0b5","#222529"],barOpacity:1,barHighlightOpacity:1,highlightSpeed:150,barRadius:[0,0,0,0],xLabelMargin:0,horizontal:!1,stacked:!1,shown:!0,showZero:!0,inBarValue:!1,inBarValueTextColor:"white",inBarValueMinTopMargin:1,inBarValueRightMargin:4,rightAxisBar:!1},c.prototype.calc=function(){var a;return this.calcBars(),this.options.hideHover===!1?(a=this.hover).update.apply(a,this.hoverContentForRow(this.data.length-1)):void 0},c.prototype.calcBars=function(){var a,b,c,d,e,f,g,h;for(g=this.data,h=[],a=e=0,f=g.length;f>e;a=++e)c=g[a],c._x=this.xStart+this.xSize*(a+.5)/this.data.length,c._y=function(){var a,e,f,g;for(f=c.y,g=[],b=a=0,e=f.length;e>a;b=++a)d=f[b],b<this.options.ykeys.length-this.options.nbYkeys2?null!=d?g.push(this.transY(d)):g.push(null):g.push(void 0);return g}.call(this),h.push(c._y2=function(){var a,e,f,g;for(f=c.y,g=[],b=a=0,e=f.length;e>a;b=++a)d=f[b],b>=this.options.ykeys.length-this.options.nbYkeys2?null!=d?g.push(this.transY2(d)):g.push(null):g.push(void 0);return g}.call(this));return h},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.rightAxisBar===!1?(this.drawBarLine(),this.drawBarPoints()):void 0},c.prototype.drawBarLine=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;for(k=this.options.ykeys.length-this.options.nbYkeys2,y=this.options.ykeys.slice(k,this.options.ykeys.length),z=[],h=u=0,w=y.length;w>u;h=u+=1){for(d=y[h],l="",p="",c=this.options.horizontal===!1?function(){var a,b,c,d;for(c=this.data,d=[],a=0,b=c.length;b>a;a++)n=c[a],void 0!==n._y2[k+h]&&d.push({x:n._x,y:n._y2[k+h]});return d}.call(this):function(){var a,b,c,d;for(c=this.data,d=[],a=0,b=c.length;b>a;a++)n=c[a],void 0!==n._y2[k+h]&&d.push({x:n._y2[k+h],y:n._x});return d}.call(this),this.options.smooth&&(f=a.Line.gradients(c)),m={y:null},g=v=0,x=c.length;x>v;g=++v)b=c[g],null!=b.y&&(null!=m.y?(this.options.smooth&&this.options.horizontal===!1?(e=f[g],j=f[g-1],i=(b.x-m.x)/4,q=m.x+i,s=Math.min(this.bottom,m.y+i*j),r=b.x-i,t=Math.min(this.bottom,b.y-i*e),l+="C"+q+","+s+","+r+","+t+","+b.x+","+b.y):l+="L"+b.x+","+b.y,p+=this.options.horizontal===!0?"L"+this.transY(0)+","+b.y:"L"+b.x+","+this.transY(0)):this.options.smooth&&null==f[g]||(l+="M"+b.x+","+b.y,p+=this.options.horizontal===!0?"M"+this.transY(0)+","+b.y:"M"+b.x+","+this.transY(0))),m=b;""!==l?this.options.animate?(o=this.raphael.path(p).attr("stroke",this.colorFor(b,k+h,"bar")).attr("stroke-width",this.lineWidthForSeries(h)),z.push(function(a,b){return a.animate({path:b},500,"<>")}(o,l))):z.push(o=this.raphael.path(l).attr("stroke",this.colorFor(b,k+h,"bar")).attr("stroke-width",this.lineWidthForSeries(h))):z.push(void 0)}return z},c.prototype.drawBarPoints=function(){var a,b,c,d,e,f,g,h,i,j;for(e=this.options.ykeys.length-this.options.nbYkeys2,this.seriesPoints=[],i=this.options.ykeys.slice(e,this.options.ykeys.length),j=[],d=g=0,h=i.length;h>g;d=g+=1)b=i[d],this.seriesPoints[d]=[],j.push(function(){var b,g,h,i;for(h=this.data,i=[],c=b=0,g=h.length;g>b;c=++b)f=h[c],a=null,null!=f._y2[e+d]?this.options.horizontal===!1?(a=this.raphael.circle(f._x,f._y2[e+d],this.pointSizeForSeries(d)).attr("fill",this.colorFor(f,e+d,"bar")).attr("stroke-width",1).attr("stroke","#ffffff"),i.push(this.seriesPoints[d].push(a))):(a=this.raphael.circle(f._y2[e+d],f._x,this.pointSizeForSeries(d)).attr("fill",this.colorFor(f,e+d,"bar")).attr("stroke-width",1).attr("stroke","#ffffff"),i.push(this.seriesPoints[d].push(a))):i.push(void 0);return i}.call(this));return j},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.drawXAxis=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;for(c=this.options.horizontal?this.getYAxisLabelX():this.getXAxisLabelY(),l=null,k=null,u=[],e=r=0,s=this.data.length;s>=0?s>r:r>s;e=s>=0?++r:--r)m=this.data[this.data.length-1-e],f=this.options.horizontal?this.drawYAxisLabel(c,m._x-.5*this.options.gridTextSize,m.label,1):this.drawXAxisLabel(m._x,c,m.label),b=this.options.horizontal?0:this.options.xLabelAngle,p=f.getBBox(),f.transform("r"+-b),g=f.getBBox(),f.transform("t0,"+g.height/2+"..."),0!==b&&(j=-.5*p.width*Math.cos(b*Math.PI/180),f.transform("t"+j+",0...")),t=a.dimensions(this.el),q=t.width,d=t.height,this.options.horizontal?(o=g.y,n=g.height,i=d):(o=g.x,n=g.width,i=q),(null==l||l>=o+n||null!=k&&k>=o)&&o>=0&&i>o+n?(0!==b&&(h=1.25*this.options.gridTextSize/Math.sin(b*Math.PI/180),k=o-h),this.options.horizontal?u.push(l=o):u.push(l=o-this.options.xLabelMargin)):u.push(f.remove());return u},c.prototype.getXAxisLabelY=function(){return this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2)},c.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;if(this.seriesBars=[],e=this.xSize/this.options.data.length,this.options.stacked)m=1;else for(m=0,f=u=0,v=this.options.ykeys.length-1;v>=0?v>=u:u>=v;f=v>=0?++u:--u)this.hasToShow(f)&&(m+=1);return this.options.stacked===!1&&this.options.rightAxisBar===!1&&(m-=this.options.nbYkeys2),b=(e*this.options.barSizeRatio-this.options.barGap*(m-1))/m,this.options.barSize&&(b=Math.min(b,this.options.barSize)),q=e-b*m-this.options.barGap*(m-1),k=q/2,t=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var f,m,q,u;for(q=this.data,u=[],g=f=0,m=q.length;m>f;g=++f)n=q[g],this.data[g].label_x=[],this.data[g].label_y=[],this.seriesBars[g]=[],i=null,h=null,l=this.options.rightAxisBar===!0?n._y.length:n._y.length-this.options.nbYkeys2,u.push(function(){var f,m,q,u;for(q=n._y.slice(0,l),u=[],o=f=0,m=q.length;m>f;o=++f)s=q[o],null!=n._y[o]?s=n._y[o]:null!=n._y2[o]&&(s=n._y2[o]),this.hasToShow(o)&&(null!==s?(t?(r=Math.min(s,t),c=Math.max(s,t)):(r=s,c=this.bottom),j=this.xStart+g*e+k,this.options.stacked||(j+=o*(b+this.options.barGap)),p=c-r,this.options.verticalGridCondition&&this.options.verticalGridCondition(n.x)&&(this.options.horizontal?this.drawBar(this.yStart,this.xStart+g*e,this.ySize,e,this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius):this.drawBar(this.xStart+g*e,this.yEnd,e,this.ySize,this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius)),this.options.horizontal?(h=c,this.options.stacked&&null!=i&&(r=i),i=r+p,0===p&&(p=1),this.seriesBars[g][o]=this.drawBar(r,j,p,b,this.colorFor(n,o,"bar"),this.options.barOpacity,this.options.barRadius),this.options.dataLabels&&(this.options.stacked||"inside"===this.options.dataLabelsPosition?(this.data[g].label_x[o]=r+p/2,this.data[g].label_y[o]=j+b/2):(this.data[g].label_x[o]=r+p+5,this.data[g].label_y[o]=j+b/2)),this.options.inBarValue&&b>this.options.gridTextSize+2*this.options.inBarValueMinTopMargin?(a=j+.5*b,u.push(this.raphael.text(c-this.options.inBarValueRightMargin,a,this.yLabelFormat(n.y[o],o)).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.inBarValueTextColor).attr("text-anchor","end"))):u.push(void 0)):(this.options.stacked&&null!=i&&(r+=i-c),i=r,0===p&&this.options.showZero&&(p=1),this.seriesBars[g][o]=this.drawBar(j,r,b,p,this.colorFor(n,o,"bar"),this.options.barOpacity,this.options.barRadius),this.options.dataLabels?(d="inside"===this.options.dataLabelsPosition||this.options.stacked&&"force_outside"!==this.options.dataLabelsPosition?p/2:-7,p>this.options.dataLabelsSize||!this.options.stacked||"force_outside"===this.options.dataLabelsPosition?(this.data[g].label_x[o]=j+b/2,u.push(this.data[g].label_y[o]=r+d)):u.push(void 0)):u.push(void 0))):u.push(null));return u}.call(this));return u}.call(this)},c.prototype.hilight=function(a){var b,c,d,e,f,g,h,i;if(this.seriesBars&&this.seriesBars[this.prevHilight]&&null!==this.prevHilight&&this.prevHilight!==a)for(h=this.seriesBars[this.prevHilight],b=d=0,f=h.length;f>d;b=++d)c=h[b],c&&c.animate({"fill-opacity":this.options.barOpacity},this.options.highlightSpeed);if(this.seriesBars&&this.seriesBars[a]&&null!==a&&this.prevHilight!==a)for(i=this.seriesBars[a],b=e=0,g=i.length;g>e;b=++e)c=i[b],c&&c.animate({"fill-opacity":this.options.barHighlightOpacity},this.options.highlightSpeed);return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){var d,e;return"function"==typeof this.options.barColors?(d={x:a.x,y:a.y[b],label:a.label,src:a.src},e={index:b,key:this.options.ykeys[b],label:this.options.labels[b]},this.options.barColors.call(this,d,e,c)):this.options.barColors[b%this.options.barColors.length]},c.prototype.hitTest=function(a,b){var c,d;return 0===this.data.length?null:(this.options.horizontal?(c=document.body.getBoundingClientRect(),d=b+c.top):d=a,d=Math.max(Math.min(d,this.xEnd),this.xStart),Math.min(this.data.length-1,Math.floor((d-this.xStart)/(this.xSize/this.data.length))))},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a,b),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a,b){var c,d;return c=this.hitTest(a,b),this.hilight(c),null!=c?(d=this.hover).update.apply(d,this.hoverContentForRow(c)):this.hover.hide()},c.prototype.onHoverOut=function(){return this.hilight(-1),this.options.hideHover!==!1?this.hover.hide():void 0},c.prototype.escapeHTML=function(a){var b,c;return b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},c=/[&<>"'/]/gi,a.replace(c,function(a){return b[a]})},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,i,j,k,l,m;for(f=this.data[a],b="<div class='morris-hover-row-label'>"+this.escapeHTML(f.label)+"</div>",c=[],m=f.y,e=i=0,k=m.length;k>i;e=++i)h=m[e],c.unshift(h);for(e=j=0,l=c.length;l>j;e=++j)h=c[e],d=f.y.length-1-e,this.options.labels[d]!==!1&&(b+="<div class='morris-hover-point' style='color: "+this.colorFor(f,d,"label")+"'>\n "+this.options.labels[d]+":\n "+this.yLabelFormat(h,d)+"\n</div>");return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,f.src)),this.options.horizontal?(g=this.left+.5*this.width,h=this.top+(a+.5)*this.height/this.data.length,[b,g,h,!0]):(g=this.left+(a+.5)*this.width/this.data.length,[b,g])},c.prototype.drawBar=function(a,b,c,d,e,f,g){var h,i;return h=Math.max.apply(Math,g),i=this.options.animate?this.options.horizontal?0===h||h>d?this.raphael.rect(this.transY(0),b,0,d).animate({x:a,width:c},500):this.raphael.path(this.roundedRect(this.transY(0),b+d,c,0,g).animate({y:b,height:d},500)):0===h||h>d?this.raphael.rect(a,this.transY(0),c,0).animate({y:b,height:d},500):this.raphael.path(this.roundedRect(a,this.transY(0),c,0,g).animate({y:b,height:d},500)):0===h||h>d?this.raphael.rect(a,b,c,d):this.raphael.path(this.roundedRect(a,b,c,d,g)),i.attr("fill",e).attr("fill-opacity",f).attr("stroke","none")},c.prototype.roundedRect=function(a,b,c,d,e){return null==e&&(e=[0,0,0,0]),["M",a,e[0]+b,"Q",a,b,a+e[0],b,"L",a+c-e[1],b,"Q",a+c,b,a+c,b+e[1],"L",a+c,b+d-e[2],"Q",a+c,b+d,a+c-e[2],b+d,"L",a+e[3],b+d,"Q",a,b+d,a,b+d-e[3],"Z"]},c}(a.Grid),a.Donut=function(b){function c(b){this.debouncedResizeHandler=f(this.debouncedResizeHandler,this),this.resizeHandler=f(this.resizeHandler,this),this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.click=f(this.click,this);var c,d,e,g,h;if(!(this instanceof a.Donut))return new a.Donut(b);if(this.options=a.extend({},this.defaults,b),"string"==typeof b.element?this.el=document.getElementById(b.element):this.el=b.element[0]||b.element,null===this.el)throw new Error("Graph placeholder not found.");return this.raphael=new Raphael(this.el),void 0===b.data||0===b.data.length?(h=a.dimensions(this.el),g=h.width,e=h.height,c=g/2,d=e/2,void this.raphael.text(c,d,this.options.noDataLabel).attr("text-anchor","middle").attr("font-size",this.options.noDataLabelSize).attr("font-family",this.options.dataLabelsFamily).attr("font-weight",this.options.noDataLabelWeight).attr("fill",this.options.dataLabelsColor)):(this.options.resize&&a.on(window,"resize",this.resizeHandler),void this.setData(b.data))}return h(c,b),c.prototype.defaults={colors:["#2f7df6","#53a351","#f6c244","#cb444a","#4aa0b5","#222529","#44a1f8","#81d453","#f0bb40","#eb3f25","#b45184","#5f5f5f"],backgroundColor:"#FFFFFF",labelColor:"#000000",padding:0,formatter:a.commas,resize:!0,dataLabels:!1,dataLabelsPosition:"inside",dataLabelsFamily:"sans-serif",dataLabelsSize:12,dataLabelsWeight:"normal",dataLabelsColor:"auto",noDataLabel:"No data for this chart",noDataLabelSize:21,noDataLabelWeight:"bold",donutType:"donut",animate:!0,showPercentage:!1,postUnits:"",preUnits:""},c.prototype.destroy=function(){return this.options.resize?(window.clearTimeout(this.timeoutId),a.off(window,"resize",this.resizeHandler)):void 0},c.prototype.redraw=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H;for(this.raphael.clear(),D=a.dimensions(this.el),w=D.width,h=D.height,d=w/2,e=h/2,v=(Math.min(d,e)-10)/3-this.options.padding,t=0,E=this.values,x=0,A=E.length;A>x;x++)u=E[x],t+=u;for(this.options.total=t,o=5/(2*v),b=1.9999*Math.PI-o*this.data.length,m=0,j=0,this.segments=[],0===t&&(t=1),F=this.values,i=y=0,B=F.length;B>y;i=++y)u=F[i],p=m+o+b*(u/t),s=new a.DonutSegment(d,e,2*v,v,m,p,this.data[i].color||this.options.colors[j%this.options.colors.length],this.options.backgroundColor,j,this.raphael,this.options),s.render(),this.segments.push(s),s.on("hover",this.select),s.on("click",this.click),s.on("mouseout",this.deselect),f=parseFloat(s.raphael.height)>parseFloat(h)?2*h-7*this.options.padding:s.raphael.height-7*this.options.padding,void 0===this.options.data[i].ratio&&(this.options.data[i].ratio=1),f*=this.options.data[i].ratio,this.options.dataLabels&&this.values.length>=1&&(r=Math.sin((m+p)/2),q=Math.cos((m+p)/2),"inside"===this.options.dataLabelsPosition?"pie"===this.options.donutType?(k=parseFloat(d)+parseFloat(.3*f*r),l=parseFloat(e)+parseFloat(.3*f*q)):(k=parseFloat(d)+parseFloat(.39*f*r),l=parseFloat(e)+parseFloat(.39*f*q)):(k=parseFloat(d)+parseFloat(.5*(f-9)*r),l=parseFloat(e)+parseFloat(.5*(f-9)*q)),c="auto"!==this.options.dataLabelsColor?this.options.dataLabelsColor:"inside"===this.options.dataLabelsPosition&&this.isColorDark(this.options.colors[i])===!0?"#fff":"#000",this.options.showPercentage?(g=Math.round(parseFloat(u)/parseFloat(t)*100)+"%",this.drawDataLabelExt(k,l,g,c)):this.drawDataLabelExt(k,l,this.options.preUnits+u+this.options.postUnits,c)),m=p,j+=1;if(this.text1=this.drawEmptyDonutLabel(d,e-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(d,e+10,this.options.labelColor,14),n=Math.max.apply(Math,this.values),j=0,"donut"===this.options.donutType){for(G=this.values,H=[],z=0,C=G.length;C>z;z++){if(u=G[z],u===n){this.select(j);break}H.push(j+=1)}return H}},c.prototype.setData=function(a){var b;return this.data=a,this.values=function(){var a,c,d,e;for(d=this.data,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(parseFloat(b.value));return e}.call(this),this.redraw()},c.prototype.drawDataLabel=function(a,b,c,d){var e;return e=this.raphael.text(a,b,c).attr("text-anchor","middle").attr("font-size",this.options.dataLabelsSize).attr("font-family",this.options.dataLabelsFamily).attr("font-weight",this.options.dataLabelsWeight).attr("fill",this.options.dataLabelsColor)},c.prototype.drawDataLabelExt=function(a,b,c,d){var e,f;return f=this.values.length>=1?"middle":"inside"===this.options.dataLabelsPosition?"middle":a>this.raphael.width/2?"start":a>.55*this.raphael.width&&a<.45*this.raphael.width?"middle":"end",e=this.raphael.text(a,b,c,d).attr("text-anchor",f).attr("font-size",this.options.dataLabelsSize).attr("font-family",this.options.dataLabelsFamily).attr("font-weight",this.options.dataLabelsWeight).attr("fill",d)},c.prototype.click=function(a){return this.fire("click",a,this.data[a])},c.prototype.select=function(a){var b,c,d,e,f,g,h;for(h=this.segments,f=0,g=h.length;g>f;f++)d=h[f],d.deselect();return e=this.segments[a],e.select(),c=this.data[a],"donut"===this.options.donutType?this.options.showPercentage&&!this.options.dataLabels?(b=Math.round(parseFloat(c.value)/parseFloat(this.options.total)*100)+"%",this.setLabels(c.label,b)):this.setLabels(c.label,this.options.formatter(c.value,c)):void 0},c.prototype.deselect=function(a){var b,c,d,e,f;for(e=this.segments,f=[],c=0,d=e.length;d>c;c++)b=e[c],f.push(b.deselect());return f},c.prototype.isColorDark=function(a){var b,c,d,e,f;return null!=a?(a=a.substring(1),f=parseInt(a,16),e=f>>16&255,c=f>>8&255,b=f>>0&255,d=.2126*e+.7152*c+.0722*b,d>=128?!1:!0):!1},c.prototype.setLabels=function(b,c){var d,e,f,g,h,i,j,k,l,m,n;return n=a.dimensions(this.el),m=n.width,d=n.height,e=2*(Math.min(m/2,d/2)-10)/3,h=1.8*e,g=e/2,f=e/3,this.text1.attr({text:b,transform:""}),i=this.text1.getBBox(),j=Math.min(h/i.width,g/i.height),this.text1.attr({transform:"S"+j+","+j+","+(i.x+i.width/2)+","+(i.y+i.height)}),this.text2.attr({text:c,transform:""}),k=this.text2.getBBox(),l=Math.min(h/k.width,f/k.height),this.text2.attr({transform:"S"+l+","+l+","+(k.x+k.width/2)+","+k.y})},c.prototype.drawEmptyDonutLabel=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,"").attr("font-size",d).attr("fill",c),null!=e&&f.attr("font-weight",e),f},c.prototype.resizeHandler=function(){return null!=this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(this.debouncedResizeHandler,100)},c.prototype.debouncedResizeHandler=function(){var b,c,d;return this.timeoutId=null,d=a.dimensions(this.el),c=d.width,b=d.height,this.raphael.setSize(c,b),this.options.animate=!1,this.redraw()},c}(a.EventEmitter),a.DonutSegment=function(a){function b(a,b,c,d,e,g,h,i,j,k,l){this.cx=a,this.cy=b,this.inner=c,this.outer=d,this.color=h,this.backgroundColor=i,this.index=j,this.raphael=k,this.options=l,this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.sin_p0=Math.sin(e),this.cos_p0=Math.cos(e),this.sin_p1=Math.sin(g),
9
+ this.cos_p1=Math.cos(g),this.is_long=g-e>Math.PI?1:0,void 0===this.options.data[this.index].ratio&&(this.options.data[this.index].ratio=1),c=this.inner*this.options.data[this.index].ratio,this.path=this.calcSegment(c+3,c+this.outer-5),this.selectedPath=this.calcSegment(c+3,c+this.outer),this.hilight=this.calcArc(c)}return h(b,a),b.prototype.calcArcPoints=function(a){return[this.cx+a*this.sin_p0,this.cy+a*this.cos_p0,this.cx+a*this.sin_p1,this.cy+a*this.cos_p1]},b.prototype.calcSegment=function(a,b){var c,d,e,f,g,h,i,j,k,l;return k=this.calcArcPoints(a),c=k[0],e=k[1],d=k[2],f=k[3],l=this.calcArcPoints(b),g=l[0],i=l[1],h=l[2],j=l[3],"pie"===this.options.donutType?"M"+g+","+i+("A"+b+","+b+",0,"+this.is_long+",0,"+h+","+j)+("L"+this.cx+","+this.cy)+"Z":"M"+c+","+e+("A"+a+","+a+",0,"+this.is_long+",0,"+d+","+f)+("L"+h+","+j)+("A"+b+","+b+",0,"+this.is_long+",1,"+g+","+i)+"Z"},b.prototype.calcArc=function(a){var b,c,d,e,f;return f=this.calcArcPoints(a),b=f[0],d=f[1],c=f[2],e=f[3],"M"+b+","+d+("A"+a+","+a+",0,"+this.is_long+",0,"+c+","+e)},b.prototype.render=function(){var a=this;return/NaN/.test(this.hilight)||(this.arc=this.drawDonutArc(this.hilight,this.color)),/NaN/.test(this.path)?void 0:this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return a.fire("hover",a.index)},function(){return a.fire("click",a.index)},function(){return a.fire("mouseout",a.index)})},b.prototype.drawDonutArc=function(a,b){var c;return this.options.animate?(c=this.raphael.path("M"+this.cx+","+this.cy+"Z").attr({stroke:b,"stroke-width":2,opacity:0}),function(a,b){return a.animate({path:b},500,"<>")}(c,a)):this.raphael.path(a).attr({stroke:b,"stroke-width":2,opacity:0})},b.prototype.drawDonutSegment=function(a,b,c,d,e,f){var g,h,i;return this.options.animate&&"pie"===this.options.donutType?(i=a,i=a.replace("A",","),i=i.replace("M",""),i=i.replace("C",","),i=i.replace("Z",""),h=i.split(","),i="pie"===this.options.donutType?"M"+h[0]+","+h[1]+","+h[h.length-2]+","+h[h.length-1]+","+h[h.length-2]+","+h[h.length-1]+"Z":"M"+h[0]+","+h[1]+","+h[h.length-2]+","+h[h.length-1]+"Z",g=this.raphael.path(i).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e).mouseout(f),function(a,b){return a.animate({path:b},500,"<>")}(g,a)):"pie"===this.options.donutType?this.raphael.path(a).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e).mouseout(f):this.raphael.path(a).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e)},b.prototype.select=function(){return this.selected||null==this.seg?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},b.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},b}(a.EventEmitter)}).call(this);