hyrax 1.1.1 → 2.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1201) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +5 -4
  3. data/.eslintrc +1 -1
  4. data/.fcrepo_wrapper +4 -0
  5. data/.github/CODE_OF_CONDUCT.md +36 -0
  6. data/.github/CONTRIBUTING.md +73 -17
  7. data/.github/PULL_REQUEST_TEMPLATE.md +4 -4
  8. data/.github/SUPPORT.md +3 -0
  9. data/.hound.yml +4 -0
  10. data/.rubocop.yml +57 -21
  11. data/{.rubocop_todo.yml → .rubocop_fixme.yml} +15 -35
  12. data/.solr_wrapper +6 -0
  13. data/.travis.yml +13 -11
  14. data/Gemfile +3 -3
  15. data/LICENSE +205 -15
  16. data/README.md +87 -54
  17. data/Rakefile +0 -0
  18. data/app/actors/hyrax/actors/abstract_actor.rb +79 -12
  19. data/app/actors/hyrax/actors/add_to_work_actor.rb +27 -27
  20. data/app/actors/hyrax/actors/apply_order_actor.rb +21 -21
  21. data/app/actors/hyrax/actors/apply_permission_template_actor.rb +25 -0
  22. data/app/actors/hyrax/actors/assign_representative_actor.rb +8 -6
  23. data/app/actors/hyrax/actors/attach_members_actor.rb +14 -18
  24. data/app/actors/hyrax/actors/base_actor.rb +58 -32
  25. data/app/actors/hyrax/actors/cleanup_file_sets_actor.rb +30 -0
  26. data/app/actors/hyrax/actors/cleanup_trophies_actor.rb +20 -0
  27. data/app/actors/hyrax/actors/collections_membership_actor.rb +35 -0
  28. data/app/actors/hyrax/actors/create_with_files_actor.rb +53 -0
  29. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +55 -0
  30. data/app/actors/hyrax/actors/default_admin_set_actor.rb +48 -0
  31. data/app/actors/hyrax/actors/environment.rb +21 -0
  32. data/app/actors/hyrax/actors/featured_work_actor.rb +32 -0
  33. data/app/actors/hyrax/actors/file_actor.rb +35 -39
  34. data/app/actors/hyrax/actors/file_set_actor.rb +76 -67
  35. data/app/actors/hyrax/actors/initialize_workflow_actor.rb +6 -4
  36. data/app/actors/hyrax/actors/interpret_visibility_actor.rb +60 -49
  37. data/app/actors/hyrax/actors/model_actor.rb +32 -0
  38. data/app/actors/hyrax/actors/optimistic_lock_validator.rb +7 -5
  39. data/app/actors/hyrax/actors/terminator.rb +18 -0
  40. data/app/actors/hyrax/actors/transactional_request.rb +8 -4
  41. data/app/assets/javascripts/hyrax.js +13 -6
  42. data/app/assets/javascripts/hyrax/admin/admin_set/group_participants.es6 +20 -0
  43. data/app/assets/javascripts/hyrax/admin/admin_set/participants.es6 +13 -2
  44. data/app/assets/javascripts/hyrax/admin/admin_set/registered_users.es6 +31 -0
  45. data/app/assets/javascripts/hyrax/admin/admin_set_controls.es6 +16 -8
  46. data/app/assets/javascripts/hyrax/admin/graphs.es6 +1 -1
  47. data/app/assets/javascripts/hyrax/app.js +52 -29
  48. data/app/assets/javascripts/hyrax/authority_select.es6 +31 -37
  49. data/app/assets/javascripts/hyrax/autocomplete.es6 +13 -7
  50. data/app/assets/javascripts/hyrax/autocomplete/default.es6 +10 -5
  51. data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +65 -0
  52. data/app/assets/javascripts/hyrax/batch_select.es6 +11 -0
  53. data/app/assets/javascripts/hyrax/batch_select_all.js +17 -25
  54. data/app/assets/javascripts/hyrax/browse_everything.js +11 -7
  55. data/app/assets/javascripts/hyrax/collections/editor.es6 +11 -0
  56. data/app/assets/javascripts/hyrax/config.js.erb +3 -0
  57. data/app/assets/javascripts/hyrax/editor.es6 +49 -2
  58. data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +122 -0
  59. data/app/assets/javascripts/hyrax/{fileupload.js.erb → fileupload.js} +0 -5
  60. data/app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee +1 -1
  61. data/app/assets/javascripts/hyrax/notification.es6 +37 -0
  62. data/app/assets/javascripts/hyrax/notifications.es6 +5 -10
  63. data/app/assets/javascripts/hyrax/per_page.es6 +15 -0
  64. data/app/assets/javascripts/hyrax/save_work/save_work_control.es6 +8 -1
  65. data/app/assets/javascripts/hyrax/save_work/visibility_component.es6 +8 -13
  66. data/app/assets/javascripts/hyrax/sorting.js +0 -8
  67. data/app/assets/javascripts/hyrax/tabs.js +3 -1
  68. data/app/assets/javascripts/hyrax/thumbnail_select.es6 +29 -0
  69. data/app/assets/javascripts/hyrax/trophy.js +1 -1
  70. data/app/assets/javascripts/hyrax/uploader.js +1 -5
  71. data/app/assets/stylesheets/hyrax/_batch-edit.scss +8 -4
  72. data/app/assets/stylesheets/hyrax/_buttons.scss +9 -7
  73. data/app/assets/stylesheets/hyrax/_catalog.scss +11 -0
  74. data/app/assets/stylesheets/hyrax/_collections.scss +6 -19
  75. data/app/assets/stylesheets/hyrax/_file-listing.scss +5 -25
  76. data/app/assets/stylesheets/hyrax/_file_manager.scss +1 -0
  77. data/app/assets/stylesheets/hyrax/_footer.scss +5 -0
  78. data/app/assets/stylesheets/hyrax/_forms.scss +25 -1
  79. data/app/assets/stylesheets/hyrax/_header.scss +6 -0
  80. data/app/assets/stylesheets/hyrax/_hyrax.scss +8 -2
  81. data/app/assets/stylesheets/hyrax/_positioning.scss +3 -126
  82. data/app/assets/stylesheets/hyrax/_styles.scss +0 -4
  83. data/app/assets/stylesheets/hyrax/_users.scss +15 -0
  84. data/app/assets/stylesheets/hyrax/_variables.scss +1 -0
  85. data/app/assets/stylesheets/hyrax/_work_editor.scss +17 -0
  86. data/app/assets/stylesheets/hyrax/controlled_vocabulary.scss +7 -0
  87. data/app/assets/stylesheets/hyrax/dashboard.scss +247 -0
  88. data/app/assets/stylesheets/hyrax/sidebar.scss +147 -0
  89. data/app/assets/stylesheets/typeahead.css +64 -0
  90. data/app/authorities/qa/authorities/find_works.rb +11 -2
  91. data/app/controlled_vocabularies/hyrax/controlled_vocabularies/location.rb +13 -0
  92. data/app/controllers/concerns/hyrax/admin/stats_behavior.rb +2 -2
  93. data/app/controllers/concerns/hyrax/admin/users_controller_behavior.rb +11 -1
  94. data/app/controllers/concerns/hyrax/breadcrumbs.rb +1 -1
  95. data/app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb +1 -1
  96. data/app/controllers/concerns/hyrax/breadcrumbs_for_works.rb +26 -14
  97. data/app/controllers/concerns/hyrax/collections.rb +4 -0
  98. data/{lib → app/controllers/concerns}/hyrax/collections/accepts_batches.rb +1 -1
  99. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +1 -190
  100. data/app/controllers/concerns/hyrax/controller.rb +1 -23
  101. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +38 -0
  102. data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +37 -0
  103. data/app/controllers/concerns/hyrax/manages_embargoes.rb +18 -0
  104. data/app/controllers/concerns/hyrax/parent_container.rb +2 -2
  105. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +225 -11
  106. data/app/controllers/hyrax/admin/admin_sets_controller.rb +32 -18
  107. data/app/controllers/hyrax/admin/appearances_controller.rb +33 -0
  108. data/app/controllers/hyrax/admin/features_controller.rb +4 -3
  109. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +16 -7
  110. data/app/controllers/hyrax/admin/users_controller.rb +1 -1
  111. data/app/controllers/hyrax/admin/workflow_roles_controller.rb +2 -2
  112. data/app/controllers/hyrax/admin/workflows_controller.rb +10 -11
  113. data/app/controllers/hyrax/api/zotero_controller.rb +4 -4
  114. data/app/controllers/hyrax/batch_edits_controller.rb +99 -2
  115. data/app/controllers/hyrax/batch_uploads_controller.rb +92 -2
  116. data/app/controllers/hyrax/citations_controller.rb +2 -2
  117. data/app/controllers/hyrax/collections_controller.rb +26 -0
  118. data/app/controllers/hyrax/contact_form_controller.rb +42 -1
  119. data/app/controllers/hyrax/content_blocks_controller.rb +25 -19
  120. data/app/controllers/hyrax/dashboard/collections_controller.rb +311 -0
  121. data/app/controllers/hyrax/dashboard/profiles_controller.rb +69 -0
  122. data/app/controllers/hyrax/dashboard/works_controller.rb +31 -0
  123. data/app/controllers/hyrax/dashboard_controller.rb +16 -1
  124. data/app/controllers/hyrax/depositors_controller.rb +41 -1
  125. data/app/controllers/hyrax/downloads_controller.rb +83 -1
  126. data/app/controllers/hyrax/embargoes_controller.rb +5 -0
  127. data/app/controllers/hyrax/featured_work_lists_controller.rb +1 -1
  128. data/app/controllers/hyrax/file_sets_controller.rb +236 -1
  129. data/app/controllers/hyrax/fixity_checks_controller.rb +32 -0
  130. data/app/controllers/hyrax/homepage_controller.rb +47 -1
  131. data/app/controllers/hyrax/leases_controller.rb +5 -0
  132. data/app/controllers/hyrax/my/collections_controller.rb +8 -5
  133. data/app/controllers/hyrax/my/highlights_controller.rb +3 -3
  134. data/app/controllers/hyrax/my/shares_controller.rb +3 -3
  135. data/app/controllers/hyrax/my/works_controller.rb +10 -5
  136. data/app/controllers/hyrax/my_controller.rb +79 -2
  137. data/app/controllers/hyrax/{mailbox_controller.rb → notifications_controller.rb} +5 -1
  138. data/app/controllers/hyrax/pages_controller.rb +42 -3
  139. data/app/controllers/hyrax/permissions_controller.rb +30 -1
  140. data/app/controllers/hyrax/single_use_links_controller.rb +46 -1
  141. data/app/controllers/hyrax/single_use_links_viewer_controller.rb +87 -12
  142. data/app/controllers/hyrax/static_controller.rb +0 -1
  143. data/app/controllers/hyrax/stats_controller.rb +2 -2
  144. data/app/controllers/hyrax/transfers_controller.rb +79 -1
  145. data/app/controllers/hyrax/uploads_controller.rb +12 -1
  146. data/app/controllers/hyrax/users_controller.rb +67 -1
  147. data/app/controllers/hyrax/workflow_actions_controller.rb +15 -9
  148. data/app/forms/hyrax/forms/admin/appearance.rb +139 -0
  149. data/app/forms/hyrax/forms/admin_set_form.rb +12 -6
  150. data/app/forms/hyrax/forms/batch_edit_form.rb +22 -21
  151. data/app/forms/hyrax/forms/collection_form.rb +50 -11
  152. data/app/forms/hyrax/forms/file_set_edit_form.rb +2 -2
  153. data/app/forms/hyrax/forms/permission_template_form.rb +2 -8
  154. data/app/forms/hyrax/forms/work_form.rb +46 -9
  155. data/app/forms/hyrax/forms/workflow_action_form.rb +2 -1
  156. data/app/forms/hyrax/forms/workflow_responsibility_form.rb +0 -6
  157. data/app/helpers/hyrax/ability_helper.rb +2 -2
  158. data/app/helpers/hyrax/batch_edits_helper.rb +16 -0
  159. data/app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb +14 -22
  160. data/app/helpers/hyrax/citations_behaviors/formatters/open_url_formatter.rb +17 -21
  161. data/app/helpers/hyrax/citations_behaviors/publication_behavior.rb +4 -3
  162. data/app/helpers/hyrax/citations_behaviors/title_behavior.rb +1 -1
  163. data/app/helpers/hyrax/collections_helper.rb +12 -4
  164. data/app/helpers/hyrax/content_block_helper_behavior.rb +5 -41
  165. data/app/helpers/hyrax/dashboard_helper_behavior.rb +0 -41
  166. data/app/helpers/hyrax/file_set_helper.rb +2 -0
  167. data/app/helpers/hyrax/hyrax_helper_behavior.rb +20 -7
  168. data/app/helpers/hyrax/trophy_helper.rb +5 -3
  169. data/app/indexers/concerns/hyrax/indexes_basic_metadata.rb +9 -0
  170. data/app/indexers/concerns/hyrax/indexes_linked_metadata.rb +9 -0
  171. data/app/indexers/hyrax/admin_set_indexer.rb +0 -1
  172. data/app/indexers/hyrax/basic_metadata_indexer.rb +57 -0
  173. data/app/indexers/hyrax/collection_indexer.rb +4 -1
  174. data/app/indexers/hyrax/collection_with_basic_metadata_indexer.rb +5 -0
  175. data/app/indexers/hyrax/deep_indexing_service.rb +102 -0
  176. data/app/indexers/hyrax/file_set_indexer.rb +19 -19
  177. data/app/indexers/hyrax/work_indexer.rb +7 -6
  178. data/app/inputs/controlled_vocabulary_input.rb +87 -0
  179. data/app/inputs/multi_value_select_input.rb +2 -0
  180. data/app/jobs/attach_files_to_work_job.rb +25 -21
  181. data/app/jobs/batch_create_job.rb +1 -1
  182. data/app/jobs/characterize_job.rb +7 -5
  183. data/app/jobs/create_derivatives_job.rb +1 -1
  184. data/app/jobs/create_work_job.rb +7 -5
  185. data/app/jobs/event_job.rb +4 -5
  186. data/app/jobs/fixity_check_job.rb +63 -0
  187. data/app/jobs/hyrax/application_job.rb +7 -0
  188. data/app/jobs/hyrax/grant_edit_job.rb +14 -0
  189. data/app/jobs/hyrax/grant_edit_to_members_job.rb +24 -0
  190. data/app/jobs/hyrax/grant_read_job.rb +14 -0
  191. data/app/jobs/hyrax/grant_read_to_members_job.rb +24 -0
  192. data/app/jobs/hyrax/revoke_edit_from_members_job.rb +23 -0
  193. data/app/jobs/hyrax/revoke_edit_job.rb +14 -0
  194. data/app/jobs/import_export_job.rb +31 -0
  195. data/app/jobs/import_url_job.rb +27 -23
  196. data/app/jobs/ingest_job.rb +18 -0
  197. data/app/jobs/ingest_local_file_job.rb +1 -1
  198. data/app/jobs/inherit_permissions_job.rb +1 -1
  199. data/app/jobs/resolrize_job.rb +1 -1
  200. data/app/jobs/visibility_copy_job.rb +20 -11
  201. data/app/models/admin_set.rb +109 -3
  202. data/app/models/batch_upload_item.rb +3 -1
  203. data/app/models/checksum_audit_log.rb +59 -12
  204. data/app/models/concerns/hyrax/ability.rb +61 -8
  205. data/app/models/concerns/hyrax/basic_metadata.rb +26 -57
  206. data/app/models/concerns/hyrax/collection_behavior.rb +9 -9
  207. data/app/models/concerns/hyrax/{required_metadata.rb → core_metadata.rb} +3 -1
  208. data/app/models/concerns/hyrax/file_set/belongs_to_works.rb +2 -2
  209. data/app/models/concerns/hyrax/file_set/derivatives.rb +1 -1
  210. data/app/models/concerns/hyrax/file_set/indexing.rb +0 -1
  211. data/app/models/concerns/hyrax/file_set_behavior.rb +2 -2
  212. data/app/models/concerns/hyrax/nested_works.rb +1 -1
  213. data/app/models/concerns/hyrax/proxy_deposit.rb +1 -1
  214. data/app/models/concerns/hyrax/solr_document/metadata.rb +88 -0
  215. data/app/models/concerns/hyrax/solr_document_behavior.rb +9 -151
  216. data/app/models/concerns/hyrax/user.rb +16 -9
  217. data/app/models/concerns/hyrax/with_file_sets.rb +0 -25
  218. data/app/models/concerns/hyrax/work_behavior.rb +3 -4
  219. data/app/models/content_block.rb +102 -1
  220. data/app/models/featured_work_list.rb +7 -3
  221. data/app/models/hyrax/operation.rb +6 -4
  222. data/app/models/hyrax/permission_template.rb +2 -2
  223. data/app/models/hyrax/permission_template_access.rb +26 -1
  224. data/app/models/hyrax/uploaded_file.rb +2 -0
  225. data/app/models/job_io_wrapper.rb +105 -0
  226. data/app/models/proxy_deposit_request.rb +16 -12
  227. data/app/models/single_use_link.rb +1 -1
  228. data/app/models/sipity/method.rb +11 -0
  229. data/app/presenters/hyrax/admin/users_presenter.rb +1 -1
  230. data/app/presenters/hyrax/admin_set_options_presenter.rb +7 -2
  231. data/app/presenters/hyrax/admin_stats_presenter.rb +21 -13
  232. data/app/presenters/hyrax/characterization_behavior.rb +1 -1
  233. data/app/presenters/hyrax/collection_options_presenter.rb +1 -1
  234. data/app/presenters/hyrax/collection_presenter.rb +4 -3
  235. data/app/presenters/hyrax/dashboard/user_presenter.rb +60 -0
  236. data/app/presenters/hyrax/embargo_presenter.rb +1 -1
  237. data/app/presenters/hyrax/file_set_presenter.rb +12 -17
  238. data/app/presenters/hyrax/fixity_status_presenter.rb +89 -0
  239. data/app/presenters/hyrax/homepage_presenter.rb +15 -3
  240. data/app/presenters/hyrax/lease_presenter.rb +1 -1
  241. data/app/presenters/hyrax/member_presenter_factory.rb +3 -1
  242. data/app/presenters/hyrax/menu_presenter.rb +31 -7
  243. data/app/presenters/hyrax/permission_badge.rb +12 -14
  244. data/app/presenters/hyrax/presenter_factory.rb +25 -6
  245. data/app/presenters/hyrax/presenter_renderer.rb +1 -1
  246. data/app/presenters/hyrax/select_type_presenter.rb +16 -0
  247. data/app/presenters/hyrax/transfers_presenter.rb +37 -0
  248. data/app/presenters/hyrax/trophy_presenter.rb +1 -5
  249. data/app/presenters/hyrax/twitter_presenter.rb +18 -0
  250. data/app/presenters/hyrax/work_show_presenter.rb +25 -15
  251. data/app/presenters/hyrax/workflow_presenter.rb +7 -0
  252. data/app/renderers/hyrax/renderers/attribute_renderer.rb +2 -2
  253. data/app/renderers/hyrax/renderers/faceted_attribute_renderer.rb +1 -1
  254. data/app/renderers/hyrax/renderers/{rights_attribute_renderer.rb → license_attribute_renderer.rb} +4 -6
  255. data/app/search_builders/hyrax/README.md +3 -3
  256. data/app/search_builders/hyrax/admin_set_search_builder.rb +3 -21
  257. data/app/search_builders/hyrax/collection_member_search_builder.rb +9 -1
  258. data/app/search_builders/hyrax/collection_search_builder.rb +1 -25
  259. data/app/search_builders/hyrax/deposit_search_builder.rb +26 -0
  260. data/app/search_builders/hyrax/filter_by_type.rb +1 -3
  261. data/app/search_builders/hyrax/member_with_files_search_builder.rb +1 -1
  262. data/app/search_builders/hyrax/my/collections_search_builder.rb +8 -0
  263. data/app/search_builders/hyrax/{find_works_search_builder.rb → my/find_works_search_builder.rb} +2 -3
  264. data/app/search_builders/hyrax/{my_highlights_search_builder.rb → my/highlights_search_builder.rb} +2 -2
  265. data/app/search_builders/hyrax/my/search_builder.rb +21 -0
  266. data/app/search_builders/hyrax/{my_search_builder_behavior.rb → my/search_builder_behavior.rb} +1 -1
  267. data/app/search_builders/hyrax/{my_shares_search_builder.rb → my/shares_search_builder.rb} +3 -3
  268. data/app/search_builders/hyrax/{my_works_search_builder.rb → my/works_search_builder.rb} +6 -2
  269. data/app/search_builders/hyrax/parent_collection_search_builder.rb +12 -0
  270. data/app/search_builders/hyrax/search_builder.rb +0 -8
  271. data/app/search_builders/hyrax/search_filters.rb +11 -5
  272. data/app/search_builders/hyrax/single_admin_set_search_builder.rb +4 -2
  273. data/app/search_builders/hyrax/works_search_builder.rb +6 -1
  274. data/app/services/hyrax/admin_set_create_service.rb +37 -12
  275. data/app/services/hyrax/admin_set_service.rb +3 -2
  276. data/app/services/hyrax/analytics.rb +1 -1
  277. data/app/services/hyrax/collection_thumbnail_path_service.rb +1 -0
  278. data/{lib → app/services}/hyrax/collections/search_service.rb +1 -1
  279. data/app/services/hyrax/collections_service.rb +2 -2
  280. data/app/services/hyrax/curation_concern.rb +39 -7
  281. data/app/services/hyrax/default_middleware_stack.rb +27 -0
  282. data/app/services/hyrax/file_set_csv_service.rb +1 -1
  283. data/app/services/hyrax/file_set_derivatives_service.rb +6 -1
  284. data/app/services/hyrax/file_set_fixity_check_service.rb +122 -0
  285. data/app/services/hyrax/fixity_check_failure_service.rb +25 -0
  286. data/app/services/hyrax/form_metadata_service.rb +9 -3
  287. data/app/services/hyrax/lock_manager.rb +1 -14
  288. data/app/services/hyrax/microdata.rb +44 -13
  289. data/app/services/hyrax/noid.rb +0 -5
  290. data/app/services/hyrax/qa_select_service.rb +1 -1
  291. data/app/services/hyrax/quick_classification_query.rb +2 -2
  292. data/app/services/hyrax/repository_fixity_check_service.rb +12 -0
  293. data/app/services/hyrax/resource_types_service.rb +4 -1
  294. data/app/services/hyrax/statistics/depositors/summary.rb +9 -1
  295. data/app/services/hyrax/statistics/system_stats.rb +9 -0
  296. data/app/services/hyrax/statistics/term_query.rb +7 -0
  297. data/app/services/hyrax/statistics/works/count.rb +11 -0
  298. data/app/services/hyrax/thumbnail_path_service.rb +1 -1
  299. data/app/services/hyrax/user_stat_importer.rb +20 -18
  300. data/app/services/hyrax/workflow/abstract_notification.rb +1 -3
  301. data/app/services/hyrax/workflow/changes_required_notification.rb +1 -3
  302. data/app/services/hyrax/workflow/deposited_notification.rb +1 -3
  303. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +5 -0
  304. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +3 -0
  305. data/app/services/hyrax/workflow/notification_service.rb +12 -4
  306. data/app/services/hyrax/workflow/pending_review_notification.rb +1 -3
  307. data/app/services/hyrax/workflow/permission_generator.rb +26 -2
  308. data/app/services/hyrax/workflow/permission_query.rb +21 -24
  309. data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +3 -0
  310. data/app/services/hyrax/workflow/workflow_action_service.rb +3 -3
  311. data/app/services/hyrax/working_directory.rb +3 -0
  312. data/app/uploaders/hyrax/avatar_uploader.rb +1 -1
  313. data/app/views/_flash_msg.html.erb +1 -1
  314. data/app/views/_masthead.html.erb +0 -2
  315. data/app/views/_user_util_links.html.erb +7 -10
  316. data/app/views/catalog/_document.html.erb +1 -3
  317. data/app/views/catalog/_index_list_default.html.erb +2 -1
  318. data/app/views/catalog/_search_form.html.erb +5 -5
  319. data/app/views/catalog/_thumbnail_list_default.html.erb +1 -2
  320. data/app/views/collections/edit_fields/_based_near.html.erb +8 -0
  321. data/app/views/hyrax/admin/admin_sets/_form.html.erb +3 -1
  322. data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +12 -3
  323. data/app/views/hyrax/admin/admin_sets/_show_document_list.html.erb +1 -1
  324. data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +2 -2
  325. data/app/views/hyrax/admin/admin_sets/edit.html.erb +1 -1
  326. data/app/views/hyrax/admin/admin_sets/index.html.erb +8 -9
  327. data/app/views/hyrax/admin/admin_sets/index.json.jbuilder +5 -0
  328. data/app/views/hyrax/admin/admin_sets/new.html.erb +1 -1
  329. data/app/views/hyrax/admin/admin_sets/show.html.erb +22 -16
  330. data/app/views/hyrax/admin/appearances/show.html.erb +16 -0
  331. data/app/views/hyrax/admin/features/index.html.erb +5 -5
  332. data/app/views/hyrax/admin/stats/_deposits.html.erb +1 -2
  333. data/app/views/hyrax/admin/stats/_new_users.html.erb +1 -2
  334. data/app/views/hyrax/admin/stats/_works.html.erb +6 -6
  335. data/app/views/hyrax/admin/users/index.html.erb +3 -4
  336. data/app/views/hyrax/admin/workflow_roles/index.html.erb +58 -39
  337. data/app/views/hyrax/admin/workflows/index.html.erb +1 -1
  338. data/app/views/hyrax/base/_attribute_rows.html.erb +2 -1
  339. data/app/views/hyrax/base/_attributes.html.erb +1 -1
  340. data/app/views/hyrax/base/_form.html.erb +4 -3
  341. data/app/views/hyrax/base/_form_files.html.erb +2 -2
  342. data/app/views/hyrax/base/_form_member_of_collections.html.erb +1 -0
  343. data/app/views/hyrax/base/_form_metadata.html.erb +15 -15
  344. data/app/views/hyrax/base/_form_permission_under_embargo.html.erb +5 -4
  345. data/app/views/hyrax/base/_form_permission_under_lease.html.erb +3 -4
  346. data/app/views/hyrax/base/_form_progress.html.erb +6 -3
  347. data/app/views/hyrax/base/_form_share.html.erb +6 -6
  348. data/app/views/hyrax/base/_form_visibility_component.html.erb +9 -1
  349. data/app/views/hyrax/base/_guts4form.html.erb +39 -37
  350. data/app/views/hyrax/base/_metadata.html.erb +1 -1
  351. data/app/views/hyrax/base/_relationships_parent_rows.html.erb +8 -20
  352. data/app/views/hyrax/base/_work_title.erb +3 -1
  353. data/app/views/hyrax/base/edit.html.erb +1 -1
  354. data/app/views/hyrax/base/show.html.erb +5 -3
  355. data/app/views/hyrax/base/show.json.jbuilder +1 -1
  356. data/app/views/hyrax/base/unavailable.html.erb +3 -2
  357. data/app/views/hyrax/batch_edits/edit.html.erb +1 -1
  358. data/app/views/{batch_select → hyrax/batch_select}/_add_button.html.erb +0 -0
  359. data/app/views/hyrax/batch_uploads/_form.html.erb +2 -3
  360. data/app/views/hyrax/citations/work.html.erb +0 -2
  361. data/app/views/hyrax/collections/_collection_description.erb +1 -1
  362. data/app/views/hyrax/{my/_index_partials → collections}/_default_group.html.erb +4 -4
  363. data/app/views/hyrax/collections/_document_list.html.erb +1 -1
  364. data/app/views/hyrax/{my/_index_partials → collections}/_list_collections.html.erb +1 -1
  365. data/app/views/hyrax/collections/_list_works.html.erb +36 -0
  366. data/app/views/hyrax/collections/_media_display.html.erb +8 -1
  367. data/app/views/hyrax/collections/_search_form.html.erb +1 -1
  368. data/app/views/hyrax/collections/_show_document_list.html.erb +0 -3
  369. data/app/views/hyrax/collections/_show_document_list_row.html.erb +0 -5
  370. data/app/views/hyrax/collections/_sort_and_per_page.html.erb +0 -10
  371. data/app/views/hyrax/collections/show.html.erb +2 -5
  372. data/app/views/hyrax/content_blocks/_form.html.erb +63 -0
  373. data/app/views/hyrax/content_blocks/edit.html.erb +9 -0
  374. data/app/views/hyrax/content_blocks/templates/agreement.html.erb +44 -0
  375. data/app/views/hyrax/content_blocks/templates/terms.html.erb +62 -0
  376. data/app/views/hyrax/{admin/_collections.html.erb → dashboard/_admin_sets.html.erb} +3 -5
  377. data/app/views/hyrax/dashboard/_index_partials/_transfers.html.erb +3 -3
  378. data/app/views/hyrax/dashboard/_sidebar.html.erb +19 -0
  379. data/app/views/hyrax/{collections → dashboard/collections}/_batch_edits_actions.html.erb +0 -0
  380. data/app/views/hyrax/dashboard/collections/_bookmark_control.html.erb +23 -0
  381. data/app/views/hyrax/dashboard/collections/_button_create_collection.html.erb +1 -0
  382. data/app/views/hyrax/{collections → dashboard/collections}/_button_for_remove_selected_from_collection.html.erb +1 -1
  383. data/app/views/hyrax/{collections → dashboard/collections}/_button_for_update_collection.html.erb +1 -1
  384. data/app/views/hyrax/{collections → dashboard/collections}/_button_remove_from_collection.html.erb +1 -1
  385. data/app/views/hyrax/dashboard/collections/_document_list.html.erb +13 -0
  386. data/app/views/hyrax/{collections → dashboard/collections}/_edit_actions.html.erb +3 -2
  387. data/app/views/hyrax/dashboard/collections/_form.html.erb +86 -0
  388. data/app/views/hyrax/dashboard/collections/_form_default_group.html.erb +25 -0
  389. data/app/views/hyrax/{collections → dashboard/collections}/_form_for_select_collection.html.erb +5 -5
  390. data/app/views/hyrax/{collections → dashboard/collections}/_form_permission.html.erb +0 -0
  391. data/app/views/hyrax/dashboard/collections/_form_share.html.erb +90 -0
  392. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +45 -0
  393. data/app/views/hyrax/dashboard/collections/_list_works.html.erb +40 -0
  394. data/app/views/hyrax/{collections → dashboard/collections}/_show_actions.html.erb +4 -3
  395. data/app/views/hyrax/dashboard/collections/_show_descriptions.html.erb +7 -0
  396. data/app/views/hyrax/dashboard/collections/_show_document_list.html.erb +17 -0
  397. data/app/views/hyrax/{collections → dashboard/collections}/_show_document_list_menu.html.erb +1 -1
  398. data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +49 -0
  399. data/app/views/hyrax/dashboard/collections/_show_fields.html.erb +0 -0
  400. data/app/views/hyrax/{collections → dashboard/collections}/_single_item_action_fields.html.erb +0 -0
  401. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +32 -0
  402. data/app/views/hyrax/{collections → dashboard/collections}/_work_action_menu.html.erb +0 -0
  403. data/app/views/hyrax/dashboard/collections/edit.html.erb +35 -0
  404. data/app/views/hyrax/{collections → dashboard/collections}/edit_fields/_description.html.erb +0 -0
  405. data/app/views/hyrax/dashboard/collections/new.html.erb +11 -0
  406. data/app/views/hyrax/dashboard/collections/show.html.erb +36 -0
  407. data/app/views/hyrax/{users → dashboard/profiles}/_edit_primary.html.erb +3 -8
  408. data/app/views/hyrax/{users → dashboard/profiles}/_edit_secondary.html.erb +0 -0
  409. data/app/views/hyrax/{users → dashboard/profiles}/_trophy_edit.html.erb +0 -0
  410. data/app/views/hyrax/{users → dashboard/profiles}/_zotero.html.erb +0 -0
  411. data/app/views/hyrax/dashboard/profiles/edit.html.erb +14 -0
  412. data/app/views/hyrax/dashboard/profiles/show.html.erb +22 -0
  413. data/app/views/hyrax/{admin/show.html.erb → dashboard/show_admin.html.erb} +1 -1
  414. data/app/views/hyrax/dashboard/{_index_partials/_contents.html.erb → show_user.html.erb} +14 -10
  415. data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +27 -0
  416. data/app/views/hyrax/dashboard/sidebar/_configuration.html.erb +31 -0
  417. data/app/views/hyrax/dashboard/sidebar/_repository_content.html.erb +17 -0
  418. data/app/views/hyrax/dashboard/sidebar/_tasks.html.erb +12 -0
  419. data/app/views/hyrax/dashboard/works/_default_group.html.erb +19 -0
  420. data/app/views/hyrax/{my/_index_partials → dashboard/works}/_list_works.html.erb +0 -6
  421. data/app/views/hyrax/embargoes/_embargo_history.html.erb +8 -0
  422. data/app/views/hyrax/embargoes/_list_active_embargoes.html.erb +18 -0
  423. data/app/views/hyrax/embargoes/_list_deactivated_embargoes.html.erb +4 -0
  424. data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +53 -0
  425. data/app/views/hyrax/embargoes/_table_headers.html.erb +5 -0
  426. data/app/views/hyrax/embargoes/edit.html.erb +45 -0
  427. data/app/views/hyrax/embargoes/index.html.erb +25 -0
  428. data/app/views/hyrax/file_sets/_actions.html.erb +1 -2
  429. data/app/views/hyrax/file_sets/_extra_fields_modal.html.erb +1 -1
  430. data/app/views/hyrax/file_sets/_file_set_title.erb +9 -0
  431. data/app/views/hyrax/file_sets/_permission_form.html.erb +2 -2
  432. data/app/views/hyrax/file_sets/_show_characterization_details.html.erb +1 -1
  433. data/app/views/hyrax/file_sets/_show_details.html.erb +2 -2
  434. data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -2
  435. data/app/views/hyrax/file_sets/show.html.erb +2 -4
  436. data/app/views/hyrax/homepage/_announcement.html.erb +2 -2
  437. data/app/views/hyrax/homepage/_explore_collections.html.erb +8 -7
  438. data/app/views/hyrax/homepage/_featured_researcher.html.erb +5 -7
  439. data/app/views/hyrax/homepage/_home_content.html.erb +14 -18
  440. data/app/views/hyrax/homepage/_marketing.html.erb +2 -3
  441. data/app/views/hyrax/homepage/index.html.erb +2 -2
  442. data/app/views/hyrax/leases/_lease_history.html.erb +8 -0
  443. data/app/views/hyrax/leases/_list_active_leases.html.erb +18 -0
  444. data/app/views/hyrax/leases/_list_deactivated_leases.html.erb +4 -0
  445. data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +53 -0
  446. data/app/views/hyrax/leases/_table_headers.html.erb +5 -0
  447. data/app/views/hyrax/leases/edit.html.erb +45 -0
  448. data/app/views/hyrax/leases/index.html.erb +24 -0
  449. data/app/views/hyrax/my/_collection_action_menu.html.erb +3 -3
  450. data/app/views/hyrax/my/_constraints.html.erb +11 -9
  451. data/app/views/hyrax/my/_document_list.html.erb +1 -1
  452. data/app/views/hyrax/my/_facet_layout.html.erb +6 -11
  453. data/app/views/hyrax/my/_facet_limit.html.erb +5 -1
  454. data/app/views/hyrax/my/_scripts.js.erb +0 -5
  455. data/app/views/hyrax/my/_search_form.html.erb +14 -0
  456. data/app/views/hyrax/my/_search_header.html.erb +25 -1
  457. data/app/views/hyrax/my/_sort_and_per_page.html.erb +1 -27
  458. data/app/views/hyrax/my/_work_action_menu.html.erb +1 -1
  459. data/app/views/hyrax/my/collections/_default_group.html.erb +18 -0
  460. data/app/views/hyrax/my/collections/_facets.html.erb +7 -0
  461. data/app/views/hyrax/my/collections/_list_collections.html.erb +43 -0
  462. data/app/views/hyrax/my/collections/_tabs.html.erb +9 -0
  463. data/app/views/hyrax/my/collections/index.html.erb +38 -0
  464. data/app/views/hyrax/my/index.html.erb +18 -27
  465. data/app/views/hyrax/my/works/_default_group.html.erb +20 -0
  466. data/app/views/hyrax/my/works/_facets.html.erb +7 -0
  467. data/app/views/hyrax/my/works/_list_works.html.erb +40 -0
  468. data/app/views/hyrax/my/works/_tabs.html.erb +9 -0
  469. data/app/views/hyrax/my/works/index.html.erb +62 -0
  470. data/app/views/hyrax/notifications/_notifications.html.erb +37 -0
  471. data/app/views/hyrax/notifications/index.html.erb +15 -0
  472. data/app/views/hyrax/pages/_form.html.erb +82 -0
  473. data/app/views/hyrax/pages/edit.html.erb +9 -0
  474. data/app/views/hyrax/pages/show.html.erb +3 -1
  475. data/app/views/hyrax/permissions/confirm_access.html.erb +1 -1
  476. data/app/views/hyrax/stats/file.html.erb +1 -1
  477. data/app/views/hyrax/stats/work.html.erb +1 -1
  478. data/app/views/hyrax/transfers/_received.html.erb +9 -11
  479. data/app/views/hyrax/transfers/_sent.html.erb +7 -9
  480. data/app/views/hyrax/transfers/index.html.erb +27 -5
  481. data/app/views/hyrax/transfers/new.html.erb +9 -3
  482. data/app/views/hyrax/uploads/_js_templates.html.erb +4 -3
  483. data/app/views/hyrax/users/_activity_log.html.erb +7 -2
  484. data/app/views/hyrax/users/_left_sidebar.html.erb +1 -1
  485. data/app/views/hyrax/users/_notify_number.html.erb +8 -3
  486. data/app/views/hyrax/users/_profile_tabs.html.erb +1 -1
  487. data/app/views/hyrax/users/_user.html.erb +1 -5
  488. data/app/views/hyrax/users/_user_row.html.erb +3 -3
  489. data/app/views/layouts/_head_tag_content.html.erb +1 -1
  490. data/app/views/layouts/dashboard.html.erb +34 -0
  491. data/app/views/layouts/hyrax.html.erb +13 -34
  492. data/app/views/records/edit_fields/_based_near.html.erb +5 -1
  493. data/app/views/records/edit_fields/{_rights.html.erb → _license.html.erb} +1 -1
  494. data/app/views/records/edit_fields/_rights_statement.html.erb +5 -0
  495. data/app/views/shared/_appearance_styles.html.erb +59 -0
  496. data/app/views/shared/_citations.html.erb +5 -5
  497. data/app/views/shared/_footer.html.erb +1 -1
  498. data/app/views/shared/_select_work_type_modal.html.erb +2 -2
  499. data/artifacts/entity-relationship-diagram.dot +76 -0
  500. data/artifacts/entity-relationship-diagram.pdf +0 -0
  501. data/config/brakeman.ignore +105 -0
  502. data/config/features.rb +4 -0
  503. data/config/i18n-tasks.yml +127 -0
  504. data/config/initializers/hyrax_callbacks.rb +5 -6
  505. data/config/locales/hyrax.de.yml +865 -0
  506. data/config/locales/hyrax.en.yml +224 -102
  507. data/config/locales/hyrax.es.yml +649 -526
  508. data/config/locales/hyrax.fr.yml +865 -0
  509. data/config/locales/hyrax.it.yml +865 -0
  510. data/config/locales/hyrax.pt-BR.yml +865 -0
  511. data/config/locales/hyrax.zh.yml +627 -497
  512. data/config/locales/simple_form.de.yml +10 -0
  513. data/config/locales/simple_form.es.yml +10 -0
  514. data/config/locales/simple_form.fr.yml +10 -0
  515. data/config/locales/simple_form.it.yml +10 -0
  516. data/config/locales/simple_form.pt-BR.yml +10 -0
  517. data/config/locales/simple_form.zh.yml +10 -0
  518. data/config/routes.rb +69 -28
  519. data/db/migrate/20170307142607_tidy_up_because_of_bad_exception.rb +1 -1
  520. data/db/migrate/20170504192714_change_checksum_audit_log.rb +18 -0
  521. data/db/migrate/20170621201939_create_job_io_wrappers.rb +15 -0
  522. data/hyrax.gemspec +23 -27
  523. data/lib/generators/hyrax/assets_generator.rb +1 -0
  524. data/lib/generators/hyrax/clamav_generator.rb +1 -0
  525. data/lib/generators/hyrax/config_generator.rb +6 -0
  526. data/lib/generators/hyrax/install_generator.rb +0 -12
  527. data/lib/generators/hyrax/models_generator.rb +2 -0
  528. data/lib/generators/hyrax/templates/app/models/collection.rb +1 -0
  529. data/lib/generators/hyrax/templates/catalog_controller.rb +4 -4
  530. data/lib/generators/hyrax/templates/config/hyrax.rb +23 -33
  531. data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +56 -0
  532. data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +3 -3
  533. data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +9 -8
  534. data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +56 -0
  535. data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +56 -0
  536. data/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +56 -0
  537. data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +9 -8
  538. data/lib/generators/hyrax/work/templates/controller.rb.erb +3 -0
  539. data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
  540. data/lib/generators/hyrax/work/templates/indexer.rb.erb +19 -0
  541. data/lib/generators/hyrax/work/templates/locale.de.yml.erb +8 -0
  542. data/lib/generators/hyrax/work/templates/locale.fr.yml.erb +8 -0
  543. data/lib/generators/hyrax/work/templates/locale.it.yml.erb +8 -0
  544. data/lib/generators/hyrax/work/templates/locale.pt-BR.yml.erb +8 -0
  545. data/lib/generators/hyrax/work/templates/model.rb.erb +7 -2
  546. data/lib/generators/hyrax/work/templates/presenter.rb.erb +6 -0
  547. data/lib/generators/hyrax/work/templates/presenter_spec.rb.erb +9 -0
  548. data/lib/generators/hyrax/work/work_generator.rb +25 -10
  549. data/lib/hyrax.rb +0 -1
  550. data/lib/hyrax/arkivo/actor.rb +14 -5
  551. data/lib/hyrax/arkivo/create_subscription_job.rb +1 -1
  552. data/lib/hyrax/arkivo/schema_validator.rb +1 -1
  553. data/lib/hyrax/configuration.rb +58 -100
  554. data/lib/hyrax/controller_resource.rb +1 -1
  555. data/lib/hyrax/engine.rb +7 -4
  556. data/lib/hyrax/rails/routes.rb +2 -18
  557. data/lib/hyrax/resource_sync/capability_list_writer.rb +3 -0
  558. data/lib/hyrax/resource_sync/change_list_writer.rb +14 -2
  559. data/lib/hyrax/role_registry.rb +5 -0
  560. data/lib/hyrax/version.rb +1 -1
  561. data/lib/tasks/default_admin_set.rake +12 -1
  562. data/lib/tasks/migrate.rake +21 -4
  563. data/spec/abilities/ability_spec.rb +98 -8
  564. data/spec/abilities/admin_ability_spec.rb +5 -2
  565. data/spec/abilities/admin_set_abilities_spec.rb +2 -2
  566. data/spec/abilities/collection_abilities_spec.rb +5 -2
  567. data/spec/abilities/embargo_and_lease_ability_spec.rb +1 -2
  568. data/spec/abilities/file_set_abilities_spec.rb +8 -5
  569. data/spec/abilities/generic_work_abilities_spec.rb +10 -7
  570. data/spec/abilities/operation_ability_spec.rb +4 -3
  571. data/spec/abilities/proxies_and_transfer_abilities_spec.rb +13 -2
  572. data/spec/actors/hyrax/actors/apply_order_actor_spec.rb +25 -35
  573. data/spec/actors/hyrax/{apply_permission_template_actor_spec.rb → actors/apply_permission_template_actor_spec.rb} +15 -16
  574. data/spec/actors/hyrax/actors/attach_members_actor_spec.rb +16 -16
  575. data/spec/actors/hyrax/actors/cleanup_file_sets_actor_spec.rb +24 -0
  576. data/spec/actors/hyrax/actors/cleanup_trophies_actor_spec.rb +25 -0
  577. data/spec/actors/hyrax/actors/{add_as_member_of_collections_actor_spec.rb → collections_membership_actor_spec.rb} +29 -20
  578. data/spec/actors/hyrax/{create_with_files_actor_spec.rb → actors/create_with_files_actor_spec.rb} +27 -16
  579. data/spec/actors/hyrax/actors/create_with_remote_files_actor_spec.rb +68 -0
  580. data/spec/actors/hyrax/{default_admin_set_actor_spec.rb → actors/default_admin_set_actor_spec.rb} +19 -18
  581. data/spec/actors/hyrax/actors/embargo_actor_spec.rb +2 -3
  582. data/spec/actors/hyrax/actors/featured_work_actor_spec.rb +38 -0
  583. data/spec/actors/hyrax/actors/file_actor_spec.rb +102 -35
  584. data/spec/actors/hyrax/actors/file_set_actor_spec.rb +102 -175
  585. data/spec/actors/hyrax/actors/generic_work_actor_spec.rb +86 -54
  586. data/spec/actors/hyrax/actors/initialize_workflow_actor_spec.rb +15 -15
  587. data/spec/actors/hyrax/actors/interpret_visibility_actor_spec.rb +71 -52
  588. data/spec/actors/hyrax/actors/lease_actor_spec.rb +2 -3
  589. data/spec/actors/hyrax/actors/model_actor_spec.rb +26 -0
  590. data/spec/actors/hyrax/actors/optimistic_lock_validator_spec.rb +19 -17
  591. data/spec/actors/hyrax/actors/transactional_request_spec.rb +17 -11
  592. data/spec/authorities/qa/authorities/find_works_spec.rb +6 -9
  593. data/spec/config/hyrax_events_spec.rb +3 -8
  594. data/spec/controllers/catalog_controller_spec.rb +5 -2
  595. data/spec/controllers/hyrax/accepts_batches_controller_spec.rb +6 -6
  596. data/spec/controllers/hyrax/admin/admin_sets_controller_spec.rb +29 -5
  597. data/spec/controllers/hyrax/admin/appearances_controller_spec.rb +66 -0
  598. data/spec/controllers/hyrax/admin/features_controller_spec.rb +4 -2
  599. data/spec/controllers/hyrax/admin/permission_template_accesses_controller_spec.rb +29 -12
  600. data/spec/controllers/hyrax/admin/permission_templates_controller_spec.rb +2 -4
  601. data/spec/controllers/hyrax/admin/stats_controller_spec.rb +1 -1
  602. data/spec/controllers/hyrax/admin/strategies_controller_spec.rb +2 -15
  603. data/spec/controllers/hyrax/admin/users_controller_spec.rb +3 -13
  604. data/spec/controllers/hyrax/admin/workflow_roles_controller_spec.rb +4 -8
  605. data/spec/controllers/hyrax/admin/workflows_controller_spec.rb +2 -4
  606. data/spec/controllers/hyrax/api/items_controller_spec.rb +22 -15
  607. data/spec/controllers/hyrax/api/zotero_controller_spec.rb +4 -4
  608. data/spec/controllers/hyrax/batch_edits_controller_spec.rb +7 -6
  609. data/spec/controllers/hyrax/batch_uploads_controller_spec.rb +25 -3
  610. data/spec/controllers/hyrax/citations_controller_spec.rb +3 -3
  611. data/spec/controllers/hyrax/collections_controller_spec.rb +7 -229
  612. data/spec/controllers/hyrax/contact_form_controller_spec.rb +11 -3
  613. data/spec/controllers/hyrax/content_blocks_controller_spec.rb +55 -55
  614. data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +353 -0
  615. data/spec/controllers/hyrax/dashboard/profiles_controller_spec.rb +155 -0
  616. data/spec/controllers/hyrax/dashboard/works_controller_spec.rb +13 -0
  617. data/spec/controllers/hyrax/dashboard_controller_spec.rb +19 -58
  618. data/spec/controllers/hyrax/depositors_controller_spec.rb +1 -1
  619. data/spec/controllers/hyrax/downloads_controller_spec.rb +19 -15
  620. data/spec/controllers/hyrax/embargoes_controller_spec.rb +106 -0
  621. data/spec/controllers/hyrax/featured_work_lists_controller_spec.rb +3 -3
  622. data/spec/controllers/hyrax/featured_works_controller_spec.rb +1 -1
  623. data/spec/controllers/hyrax/file_sets_controller_spec.rb +26 -25
  624. data/spec/controllers/hyrax/{audits_controller_spec.rb → fixity_checks_controller_spec.rb} +17 -10
  625. data/spec/controllers/hyrax/generic_works_controller_json_spec.rb +6 -10
  626. data/spec/controllers/hyrax/generic_works_controller_spec.rb +104 -82
  627. data/spec/controllers/hyrax/homepage_controller_spec.rb +19 -26
  628. data/spec/controllers/hyrax/leases_controller_spec.rb +106 -0
  629. data/spec/controllers/hyrax/my/collections_controller_spec.rb +23 -16
  630. data/spec/controllers/hyrax/my/highlights_controller_spec.rb +2 -3
  631. data/spec/controllers/hyrax/my/shares_controller_spec.rb +2 -1
  632. data/spec/controllers/hyrax/my/works_controller_spec.rb +33 -30
  633. data/spec/controllers/hyrax/{mailbox_controller_spec.rb → notifications_controller_spec.rb} +2 -2
  634. data/spec/controllers/hyrax/operations_controller_spec.rb +2 -3
  635. data/spec/controllers/hyrax/pages_controller_spec.rb +100 -12
  636. data/spec/controllers/hyrax/permissions_controller_spec.rb +7 -3
  637. data/spec/controllers/hyrax/resource_sync_controller_spec.rb +1 -1
  638. data/spec/controllers/hyrax/single_use_links_controller_spec.rb +4 -3
  639. data/spec/controllers/hyrax/single_use_links_viewer_controller_spec.rb +1 -3
  640. data/spec/controllers/hyrax/static_controller_spec.rb +1 -1
  641. data/spec/controllers/hyrax/stats_controller_spec.rb +10 -7
  642. data/spec/controllers/hyrax/transfers_controller_spec.rb +12 -31
  643. data/spec/controllers/hyrax/uploads_controller_spec.rb +3 -1
  644. data/spec/controllers/hyrax/users_controller_spec.rb +17 -166
  645. data/spec/controllers/hyrax/workflow_actions_controller_spec.rb +3 -4
  646. data/spec/conversions/power_converters/polymorphic_type_spec.rb +1 -1
  647. data/spec/conversions/power_converters/sipity_action_name_spec.rb +1 -1
  648. data/spec/conversions/power_converters/sipity_action_spec.rb +1 -1
  649. data/spec/conversions/power_converters/sipity_entity_spec.rb +5 -0
  650. data/spec/conversions/power_converters/sipity_role_spec.rb +0 -2
  651. data/spec/conversions/power_converters/sipity_workflow_state_spec.rb +1 -2
  652. data/spec/factories/admin_sets.rb +1 -1
  653. data/spec/factories/api_items.rb +3 -3
  654. data/spec/factories/collections_factory.rb +2 -2
  655. data/spec/factories/content_blocks.rb +1 -1
  656. data/spec/factories/featured_works.rb +1 -1
  657. data/spec/factories/file_sets.rb +3 -36
  658. data/spec/factories/generic_works.rb +15 -15
  659. data/spec/factories/operations.rb +1 -1
  660. data/spec/factories/permission_template_accesses.rb +5 -2
  661. data/spec/factories/permission_templates.rb +1 -1
  662. data/spec/factories/proxy_deposit_requests.rb +2 -2
  663. data/spec/factories/single_use_links.rb +1 -1
  664. data/spec/factories/sipity_entities.rb +1 -1
  665. data/spec/factories/uploaded_files.rb +1 -1
  666. data/spec/factories/users.rb +2 -2
  667. data/spec/factories/workflow_actions.rb +1 -1
  668. data/spec/factories/workflow_states.rb +1 -1
  669. data/spec/factories/workflows.rb +1 -1
  670. data/spec/features/admin_admin_set_spec.rb +5 -8
  671. data/spec/features/admin_spec.rb +2 -4
  672. data/spec/features/batch_create_spec.rb +1 -1
  673. data/spec/features/batch_edit_spec.rb +47 -115
  674. data/spec/features/browse_catalog_spec.rb +1 -1
  675. data/spec/features/browse_dashboard_works_spec.rb +55 -0
  676. data/spec/features/catalog_search_spec.rb +1 -1
  677. data/spec/features/collection_spec.rb +14 -222
  678. data/spec/features/contact_form_spec.rb +1 -1
  679. data/spec/features/create_child_work_spec.rb +3 -2
  680. data/spec/features/create_work_spec.rb +52 -41
  681. data/spec/features/dashboard/all_works.rb +14 -0
  682. data/spec/features/dashboard/collection_spec.rb +262 -0
  683. data/spec/features/dashboard/display_dashboard_spec.rb +18 -0
  684. data/spec/features/delete_work_spec.rb +1 -1
  685. data/spec/features/edit_file_spec.rb +1 -1
  686. data/spec/features/edit_work_spec.rb +1 -1
  687. data/spec/features/embargo_spec.rb +35 -0
  688. data/spec/features/homepage_spec.rb +5 -8
  689. data/spec/features/lease_spec.rb +35 -0
  690. data/spec/features/notifications_spec.rb +4 -3
  691. data/spec/features/ownership_transfer_spec.rb +8 -7
  692. data/spec/features/proxy_spec.rb +11 -4
  693. data/spec/features/search_spec.rb +3 -3
  694. data/spec/features/static_pages_spec.rb +0 -2
  695. data/spec/features/users_spec.rb +3 -12
  696. data/spec/features/work_generator_spec.rb +5 -3
  697. data/spec/features/work_show_spec.rb +4 -1
  698. data/spec/features/workflow_roles_spec.rb +2 -3
  699. data/spec/features/workflow_state_changes_spec.rb +2 -3
  700. data/spec/fixtures/config/schema_org.yml +2 -0
  701. data/spec/fixtures/config/schema_org_second.yml +7 -0
  702. data/spec/forms/hyrax/forms/admin/appearance_spec.rb +46 -0
  703. data/spec/forms/hyrax/forms/admin_set_form_spec.rb +71 -3
  704. data/spec/forms/hyrax/forms/batch_edit_form_spec.rb +10 -6
  705. data/spec/forms/hyrax/forms/batch_upload_form_spec.rb +9 -3
  706. data/spec/forms/hyrax/forms/collection_form_spec.rb +39 -13
  707. data/spec/forms/hyrax/forms/file_manager_form_spec.rb +2 -2
  708. data/spec/forms/hyrax/forms/file_set_edit_form_spec.rb +3 -4
  709. data/spec/forms/hyrax/forms/permission_template_form_spec.rb +58 -5
  710. data/spec/forms/hyrax/forms/work_form_spec.rb +70 -16
  711. data/spec/forms/hyrax/forms/workflow_action_form_spec.rb +23 -7
  712. data/spec/forms/hyrax/forms/workflow_responsibility_form_spec.rb +3 -3
  713. data/spec/forms/hyrax/generic_work_form_spec.rb +14 -7
  714. data/spec/helpers/blacklight_helper_spec.rb +32 -19
  715. data/spec/helpers/dashboard_helper_spec.rb +4 -19
  716. data/spec/helpers/hyrax/ability_helper_spec.rb +10 -5
  717. data/spec/helpers/{batch_edits_helper_spec.rb → hyrax/batch_edits_helper_spec.rb} +6 -1
  718. data/spec/helpers/hyrax/charts_helper_spec.rb +4 -3
  719. data/spec/helpers/hyrax/collections_helper_spec.rb +11 -10
  720. data/spec/helpers/hyrax/content_block_helper_spec.rb +22 -51
  721. data/spec/helpers/hyrax/file_set_helper_spec.rb +8 -4
  722. data/spec/helpers/hyrax/trophy_helper_spec.rb +2 -2
  723. data/spec/helpers/hyrax_helper_spec.rb +49 -3
  724. data/spec/indexers/hyrax/collection_indexer_spec.rb +24 -11
  725. data/spec/indexers/hyrax/file_set_indexer_spec.rb +36 -37
  726. data/spec/indexers/hyrax/{work_indexer_spec.rb → generic_work_indexer_spec.rb} +42 -5
  727. data/spec/inputs/controlled_vocabulary_input_spec.rb +57 -0
  728. data/spec/inputs/multifile_input_spec.rb +2 -3
  729. data/spec/javascripts/authority_select_spec.js +22 -0
  730. data/spec/javascripts/autocomplete_spec.js.coffee +16 -8
  731. data/spec/javascripts/batch_select_spec.js +15 -0
  732. data/spec/javascripts/fixtures/chart_example.html +1 -1
  733. data/spec/javascripts/fixtures/dashboard_batch_forms.html +11 -0
  734. data/spec/javascripts/jasmine_spec.rb +1 -1
  735. data/spec/javascripts/save_work_spec.js +19 -6
  736. data/spec/javascripts/visibility_component_spec.js +17 -36
  737. data/spec/jobs/attach_files_to_work_job_spec.rb +17 -16
  738. data/spec/jobs/batch_create_job_spec.rb +2 -1
  739. data/spec/jobs/characterize_job_spec.rb +24 -12
  740. data/spec/jobs/content_delete_event_job_spec.rb +1 -1
  741. data/spec/jobs/content_deposit_event_job_spec.rb +6 -7
  742. data/spec/jobs/content_depositor_change_event_job_spec.rb +4 -3
  743. data/spec/jobs/content_new_version_event_job_spec.rb +2 -2
  744. data/spec/jobs/content_restored_version_event_job_spec.rb +3 -2
  745. data/spec/jobs/content_update_event_job_spec.rb +6 -7
  746. data/spec/jobs/create_derivatives_job_spec.rb +1 -3
  747. data/spec/jobs/create_work_job_spec.rb +10 -7
  748. data/spec/jobs/file_set_attached_event_job_spec.rb +3 -3
  749. data/spec/jobs/fixity_check_job_spec.rb +51 -0
  750. data/spec/jobs/hyrax/grant_edit_job_spec.rb +11 -0
  751. data/spec/jobs/hyrax/grant_edit_to_members_job_spec.rb +16 -0
  752. data/spec/jobs/hyrax/grant_read_job_spec.rb +11 -0
  753. data/spec/jobs/hyrax/grant_read_to_members_job_spec.rb +16 -0
  754. data/spec/jobs/hyrax/revoke_edit_from_members_job_spec.rb +16 -0
  755. data/spec/jobs/hyrax/revoke_edit_job_spec.rb +11 -0
  756. data/spec/jobs/import_export_job_spec.rb +28 -0
  757. data/spec/jobs/import_url_job_spec.rb +3 -19
  758. data/spec/jobs/ingest_local_file_job_spec.rb +1 -3
  759. data/spec/jobs/inherit_permissions_job_spec.rb +1 -3
  760. data/spec/jobs/user_edit_profile_event_job_spec.rb +2 -1
  761. data/spec/jobs/visibility_copy_job_spec.rb +3 -5
  762. data/spec/lib/hyrax/analytics_spec.rb +1 -1
  763. data/spec/lib/hyrax/arkivo/actor_spec.rb +18 -16
  764. data/spec/lib/hyrax/arkivo/create_subscription_job_spec.rb +1 -3
  765. data/spec/lib/hyrax/arkivo/metadata_munger_spec.rb +2 -4
  766. data/spec/lib/hyrax/arkivo/schema_validator_spec.rb +5 -7
  767. data/spec/lib/hyrax/arkivo_spec.rb +1 -3
  768. data/spec/lib/hyrax/collections/search_service_spec.rb +2 -3
  769. data/spec/lib/hyrax/configuration_spec.rb +14 -13
  770. data/spec/lib/hyrax/controlled_vocabulary/importer/downloader_spec.rb +3 -1
  771. data/spec/lib/hyrax/controlled_vocabulary/importer/language_spec.rb +1 -1
  772. data/spec/lib/hyrax/move_all_works_to_admin_set_spec.rb +2 -2
  773. data/spec/lib/hyrax/name_spec.rb +4 -3
  774. data/spec/lib/hyrax/redis_event_store_spec.rb +5 -1
  775. data/spec/lib/hyrax/resource_sync/capability_list_writer_spec.rb +1 -3
  776. data/spec/lib/hyrax/resource_sync/change_list_writer_spec.rb +38 -28
  777. data/spec/lib/hyrax/resource_sync/resource_list_writer_spec.rb +2 -4
  778. data/spec/lib/hyrax/resource_sync/source_description_writer_spec.rb +1 -4
  779. data/spec/lib/hyrax/role_registry_spec.rb +9 -2
  780. data/spec/lib/hyrax/search_state_spec.rb +3 -2
  781. data/spec/lib/hyrax/zotero/config_spec.rb +2 -4
  782. data/spec/lib/hyrax/zotero_spec.rb +2 -1
  783. data/spec/models/admin_set_spec.rb +26 -12
  784. data/spec/models/batch_upload_item_spec.rb +1 -2
  785. data/spec/models/checksum_audit_log_spec.rb +131 -35
  786. data/spec/models/collection_spec.rb +5 -2
  787. data/spec/models/content_block_spec.rb +158 -49
  788. data/spec/models/featured_work_list_spec.rb +32 -11
  789. data/spec/models/featured_work_spec.rb +5 -1
  790. data/spec/models/file_download_stat_spec.rb +9 -6
  791. data/spec/models/file_set_spec.rb +84 -57
  792. data/spec/models/file_view_stat_spec.rb +5 -4
  793. data/spec/models/flipflop_spec.rb +11 -2
  794. data/spec/models/generic_work_spec.rb +14 -42
  795. data/spec/models/hyrax/download_spec.rb +1 -1
  796. data/spec/models/hyrax/operation_spec.rb +10 -3
  797. data/spec/models/hyrax/pageview_spec.rb +1 -1
  798. data/spec/models/hyrax/permission_template_access_spec.rb +57 -0
  799. data/spec/models/hyrax/permission_template_spec.rb +38 -1
  800. data/spec/models/hyrax/permissions/readable_permissions_spec.rb +4 -6
  801. data/spec/models/hyrax/permissions/writable_permissions_spec.rb +1 -3
  802. data/spec/models/hyrax/uploaded_file_spec.rb +2 -1
  803. data/spec/models/hyrax/user_usage_stats_spec.rb +2 -2
  804. data/spec/models/hyrax/work_behavior_spec.rb +4 -5
  805. data/spec/models/job_io_wrapper_spec.rb +172 -0
  806. data/spec/models/proxy_deposit_request_spec.rb +4 -5
  807. data/spec/models/single_use_link_spec.rb +3 -3
  808. data/spec/models/sipity/agent_spec.rb +1 -2
  809. data/spec/models/sipity/comment_spec.rb +3 -1
  810. data/spec/models/sipity/entity_spec.rb +2 -3
  811. data/spec/models/sipity/entity_specific_responsibility_spec.rb +1 -0
  812. data/spec/models/sipity/notifiable_context_spec.rb +1 -2
  813. data/spec/models/sipity/notification_recipient_spec.rb +1 -2
  814. data/spec/models/sipity/notification_spec.rb +2 -2
  815. data/spec/models/sipity/role_spec.rb +1 -2
  816. data/spec/models/sipity/workflow_action_spec.rb +1 -0
  817. data/spec/models/sipity/workflow_responsibility_spec.rb +1 -0
  818. data/spec/models/sipity/workflow_spec.rb +4 -0
  819. data/spec/models/sipity/workflow_state_action_permission_spec.rb +1 -0
  820. data/spec/models/sipity/workflow_state_action_spec.rb +1 -0
  821. data/spec/models/sipity/workflow_state_spec.rb +2 -0
  822. data/spec/models/solr_document_spec.rb +57 -3
  823. data/spec/models/trophy_spec.rb +1 -1
  824. data/spec/models/user_mailbox_spec.rb +4 -1
  825. data/spec/models/user_spec.rb +33 -10
  826. data/spec/models/work_view_stat_spec.rb +8 -4
  827. data/spec/presenters/hyrax/admin/dashboard_presenter_spec.rb +3 -2
  828. data/spec/presenters/hyrax/admin/repository_growth_presenter_spec.rb +1 -2
  829. data/spec/presenters/hyrax/admin/repository_object_presenter_spec.rb +2 -2
  830. data/spec/presenters/hyrax/admin/user_activity_presenter_spec.rb +1 -2
  831. data/spec/presenters/hyrax/admin/users_presenter_spec.rb +3 -3
  832. data/spec/presenters/hyrax/admin/workflow_role_presenter_spec.rb +0 -2
  833. data/spec/presenters/hyrax/admin/workflow_roles_presenter_spec.rb +0 -2
  834. data/spec/presenters/hyrax/admin_set_options_presenter_spec.rb +4 -4
  835. data/spec/presenters/hyrax/admin_set_presenter_spec.rb +14 -19
  836. data/spec/presenters/hyrax/admin_stats_presenter_spec.rb +20 -114
  837. data/spec/presenters/hyrax/collection_options_presenter_spec.rb +1 -2
  838. data/spec/presenters/hyrax/collection_presenter_spec.rb +13 -2
  839. data/spec/presenters/hyrax/dashboard/user_presenter_spec.rb +65 -0
  840. data/spec/presenters/hyrax/embargo_presenter_spec.rb +6 -3
  841. data/spec/presenters/hyrax/file_set_presenter_spec.rb +38 -15
  842. data/spec/presenters/hyrax/file_usage_spec.rb +14 -10
  843. data/spec/presenters/hyrax/fixity_status_presenter_spec.rb +55 -0
  844. data/spec/presenters/hyrax/homepage_presenter_spec.rb +30 -10
  845. data/spec/presenters/hyrax/inspect_work_presenter_spec.rb +3 -2
  846. data/spec/presenters/hyrax/lease_presenter_spec.rb +6 -3
  847. data/spec/presenters/hyrax/member_presenter_factory_spec.rb +5 -4
  848. data/spec/presenters/hyrax/menu_presenter_spec.rb +51 -7
  849. data/spec/presenters/hyrax/permission_badge_spec.rb +14 -9
  850. data/spec/presenters/hyrax/presenter_factory_spec.rb +10 -9
  851. data/spec/presenters/hyrax/presenter_renderer_spec.rb +3 -1
  852. data/spec/presenters/hyrax/select_type_list_presenter_spec.rb +10 -3
  853. data/spec/presenters/hyrax/select_type_presenter_spec.rb +43 -2
  854. data/spec/presenters/hyrax/single_use_link_presenter_spec.rb +3 -3
  855. data/spec/presenters/hyrax/transfers_presenter_spec.rb +44 -0
  856. data/spec/presenters/hyrax/trophy_presenter_spec.rb +7 -0
  857. data/spec/presenters/hyrax/twitter_presenter_spec.rb +27 -0
  858. data/spec/presenters/hyrax/user_profile_presenter_spec.rb +2 -0
  859. data/spec/presenters/hyrax/version_list_presenter_spec.rb +1 -3
  860. data/spec/presenters/hyrax/version_presenter_spec.rb +6 -3
  861. data/spec/presenters/hyrax/work_show_presenter_spec.rb +63 -6
  862. data/spec/presenters/hyrax/work_usage_spec.rb +13 -7
  863. data/spec/presenters/hyrax/workflow_presenter_spec.rb +24 -2
  864. data/spec/renderers/hyrax/renderers/attribute_renderer_spec.rb +7 -5
  865. data/spec/renderers/hyrax/renderers/date_attribute_renderer_spec.rb +4 -3
  866. data/spec/renderers/hyrax/renderers/external_link_attribute_renderer_spec.rb +3 -3
  867. data/spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb +15 -3
  868. data/spec/renderers/hyrax/renderers/{rights_attribute_renderer_spec.rb → license_attribute_renderer_spec.rb} +7 -7
  869. data/spec/renderers/hyrax/renderers/linked_attribute_renderer_spec.rb +3 -3
  870. data/spec/requests/legacy_routing_spec.rb +1 -1
  871. data/spec/routing/admin_routes_spec.rb +4 -3
  872. data/spec/routing/api_route_spec.rb +1 -1
  873. data/spec/routing/citations_route_spec.rb +1 -1
  874. data/spec/routing/featured_works_route_spec.rb +1 -1
  875. data/spec/routing/operations_spec.rb +1 -1
  876. data/spec/routing/ownership_transfers_route_spec.rb +1 -1
  877. data/spec/routing/resource_sync_spec.rb +1 -1
  878. data/spec/routing/route_spec.rb +51 -26
  879. data/spec/routing/single_use_link_spec.rb +1 -3
  880. data/spec/routing/stats_route_spec.rb +1 -1
  881. data/spec/search_builders/hyrax/admin_admin_set_member_search_builder_spec.rb +1 -2
  882. data/spec/{search_builder → search_builders}/hyrax/admin_set_search_builder_spec.rb +7 -9
  883. data/spec/{search_builder → search_builders}/hyrax/catalog_search_builder_spec.rb +4 -1
  884. data/spec/{search_builder → search_builders}/hyrax/embargo_search_builder_spec.rb +3 -3
  885. data/spec/{search_builder → search_builders}/hyrax/file_set_search_builder_spec.rb +2 -3
  886. data/spec/{search_builder → search_builders}/hyrax/lease_search_builder_spec.rb +3 -3
  887. data/spec/{search_builder/hyrax → search_builders/hyrax/my}/find_works_search_builder_spec.rb +6 -3
  888. data/spec/{search_builder/hyrax/my_shares_search_builder_spec.rb → search_builders/hyrax/my/shares_search_builder_spec.rb} +1 -1
  889. data/spec/{search_builder/hyrax/my_works_search_builder_spec.rb → search_builders/hyrax/my/works_search_builder_spec.rb} +3 -1
  890. data/spec/{search_builder → search_builders}/hyrax/single_admin_set_search_builder_spec.rb +2 -2
  891. data/spec/{search_builder → search_builders}/hyrax/stats/work_status_search_builder_spec.rb +0 -2
  892. data/spec/{search_builder → search_builders}/hyrax/work_relation_spec.rb +2 -3
  893. data/spec/{search_builder → search_builders}/hyrax/work_search_builder_spec.rb +5 -1
  894. data/spec/search_builders/hyrax/works_search_builder_spec.rb +1 -2
  895. data/spec/services/hyrax/admin_set_create_service_spec.rb +32 -15
  896. data/spec/services/hyrax/admin_set_service_spec.rb +13 -7
  897. data/spec/services/hyrax/batch_create_failure_service_spec.rb +1 -1
  898. data/spec/services/hyrax/batch_create_success_service_spec.rb +1 -1
  899. data/spec/services/hyrax/change_content_depositor_service_spec.rb +1 -1
  900. data/spec/services/hyrax/collection_member_service_spec.rb +1 -1
  901. data/spec/services/hyrax/collection_size_service_spec.rb +1 -1
  902. data/spec/services/hyrax/collections_service_spec.rb +5 -3
  903. data/spec/services/hyrax/curation_concern_spec.rb +4 -5
  904. data/spec/services/hyrax/default_middleware_stack_spec.rb +36 -0
  905. data/spec/services/hyrax/derivative_path_spec.rb +7 -3
  906. data/spec/services/hyrax/derivative_service_spec.rb +4 -1
  907. data/spec/services/hyrax/embargo_service_spec.rb +6 -7
  908. data/spec/services/hyrax/file_set_csv_service_spec.rb +19 -10
  909. data/spec/services/hyrax/file_set_derivatives_service_spec.rb +2 -1
  910. data/spec/services/hyrax/file_set_fixity_check_service_spec.rb +116 -0
  911. data/spec/services/hyrax/fixity_check_failure_service_spec.rb +29 -0
  912. data/spec/services/hyrax/graph_exporter_spec.rb +3 -2
  913. data/spec/services/hyrax/import_url_failure_service_spec.rb +1 -1
  914. data/spec/services/hyrax/lease_service_spec.rb +2 -5
  915. data/spec/services/hyrax/license_service_spec.rb +1 -3
  916. data/spec/services/hyrax/lock_manager_spec.rb +2 -3
  917. data/spec/services/hyrax/microdata_spec.rb +94 -0
  918. data/spec/services/hyrax/noid_spec.rb +3 -6
  919. data/spec/services/hyrax/parent_service_spec.rb +0 -2
  920. data/spec/services/hyrax/persist_derivatives_spec.rb +1 -3
  921. data/spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb +2 -3
  922. data/spec/services/hyrax/qa_select_service_spec.rb +8 -4
  923. data/spec/services/hyrax/query_service_spec.rb +17 -1
  924. data/spec/services/hyrax/quick_classification_query_spec.rb +6 -3
  925. data/spec/services/hyrax/repository_fixity_check_service_spec.rb +18 -0
  926. data/spec/services/hyrax/resource_types_service_spec.rb +4 -3
  927. data/spec/services/hyrax/rights_statements_spec.rb +1 -3
  928. data/spec/services/hyrax/statistics/collections/over_time_spec.rb +1 -1
  929. data/spec/services/hyrax/statistics/depositors/summary_spec.rb +10 -2
  930. data/spec/services/hyrax/statistics/file_sets/by_format_spec.rb +4 -5
  931. data/spec/services/hyrax/statistics/system_stats_spec.rb +5 -4
  932. data/spec/services/hyrax/statistics/users/over_time_spec.rb +1 -2
  933. data/spec/services/hyrax/statistics/works/by_depositor_spec.rb +3 -4
  934. data/spec/services/hyrax/statistics/works/by_resource_type_spec.rb +1 -1
  935. data/spec/services/hyrax/statistics/works/count_spec.rb +7 -7
  936. data/spec/services/hyrax/statistics/works/over_time_spec.rb +1 -1
  937. data/spec/services/hyrax/thumbnail_path_service_spec.rb +12 -4
  938. data/spec/services/hyrax/user_stat_importer_spec.rb +52 -46
  939. data/spec/services/hyrax/versioning_service_spec.rb +1 -3
  940. data/spec/services/hyrax/work_query_service_spec.rb +6 -0
  941. data/spec/services/hyrax/workflow/action_taken_service_spec.rb +2 -2
  942. data/spec/services/hyrax/workflow/activate_object_spec.rb +1 -1
  943. data/spec/services/hyrax/workflow/changes_required_notification_spec.rb +4 -5
  944. data/spec/services/hyrax/workflow/deactivate_object_spec.rb +1 -1
  945. data/spec/services/hyrax/workflow/deposited_notification_spec.rb +4 -5
  946. data/spec/services/hyrax/workflow/grant_edit_to_depositor_spec.rb +19 -1
  947. data/spec/services/hyrax/workflow/grant_read_to_depositor_spec.rb +48 -0
  948. data/spec/services/hyrax/workflow/method_generator_spec.rb +1 -2
  949. data/spec/services/hyrax/workflow/notification_configuration_parameter_spec.rb +1 -2
  950. data/spec/services/hyrax/workflow/notification_generator_spec.rb +3 -3
  951. data/spec/services/hyrax/workflow/notification_service_spec.rb +37 -3
  952. data/spec/services/hyrax/workflow/pending_review_notification_spec.rb +4 -5
  953. data/spec/services/hyrax/workflow/permission_generator_spec.rb +4 -6
  954. data/spec/services/hyrax/workflow/permission_query_spec.rb +25 -3
  955. data/spec/services/hyrax/workflow/revoke_edit_from_depositor_spec.rb +16 -3
  956. data/spec/services/hyrax/workflow/sipity_actions_generator_spec.rb +0 -2
  957. data/spec/services/hyrax/workflow/state_machine_generator_spec.rb +12 -13
  958. data/spec/services/hyrax/workflow/status_list_service_spec.rb +2 -4
  959. data/spec/services/hyrax/workflow/workflow_factory_spec.rb +2 -1
  960. data/spec/services/hyrax/workflow/workflow_importer_spec.rb +7 -0
  961. data/spec/services/hyrax/workflow/workflow_permissions_generator_spec.rb +2 -0
  962. data/spec/services/hyrax/workflow/workflow_schema_spec.rb +2 -2
  963. data/spec/services/hyrax/working_directory_spec.rb +3 -3
  964. data/spec/spec_helper.rb +35 -61
  965. data/spec/strategies/hyrax/strategies/yaml_strategy_spec.rb +2 -2
  966. data/spec/support/controller_level_helpers.rb +1 -0
  967. data/spec/support/features.rb +2 -2
  968. data/spec/support/features/batch_edit_actions.rb +28 -0
  969. data/spec/support/features/session_helpers.rb +1 -1
  970. data/spec/support/features/workflow.rb +9 -0
  971. data/spec/support/logging_formatter.rb +66 -0
  972. data/spec/support/spec_statistic.rb +23 -0
  973. data/spec/tasks/rake_spec.rb +1 -1
  974. data/spec/test_app_templates/disable_animations_in_test_environment.rb +54 -0
  975. data/spec/test_app_templates/lib/generators/test_app_generator.rb +10 -1
  976. data/spec/views/_flash_msg.html.erb_spec.rb +4 -1
  977. data/spec/views/_user_util_links.html.erb_spec.rb +8 -8
  978. data/spec/views/catalog/_index_list_default.html.erb_spec.rb +1 -0
  979. data/spec/views/catalog/_search_form.html.erb_spec.rb +0 -2
  980. data/spec/views/catalog/_thumbnail_list_collection.html.erb_spec.rb +1 -1
  981. data/spec/views/catalog/index.html.erb_spec.rb +1 -1
  982. data/spec/views/content_blocks/edit.html.erb_spec.rb +21 -0
  983. data/spec/views/hyrax/admin/admin_sets/_form.html.erb_spec.rb +7 -3
  984. data/spec/views/hyrax/admin/admin_sets/_form_participant_table.html.erb_spec.rb +6 -2
  985. data/spec/views/hyrax/admin/admin_sets/_form_participants.html.erb_spec.rb +1 -2
  986. data/spec/views/hyrax/admin/admin_sets/_form_visibility.html.erb_spec.rb +0 -2
  987. data/spec/views/hyrax/admin/admin_sets/_form_workflow.html.erb_spec.rb +1 -2
  988. data/spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb +4 -18
  989. data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +2 -2
  990. data/spec/views/hyrax/admin/admin_sets/index.html.erb_spec.rb +11 -2
  991. data/spec/views/hyrax/admin/admin_sets/index.json.erb_spec.rb +30 -0
  992. data/spec/views/hyrax/admin/admin_sets/show.html.erb_spec.rb +7 -9
  993. data/spec/views/hyrax/admin/features/index.html.erb_spec.rb +2 -1
  994. data/spec/views/hyrax/admin/stats/show.html.erb_spec.rb +6 -1
  995. data/spec/views/hyrax/admin/users/index.html.erb_spec.rb +2 -2
  996. data/spec/views/hyrax/admin/workflow_roles/index.html.erb_spec.rb +17 -10
  997. data/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb +11 -4
  998. data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -3
  999. data/spec/views/hyrax/base/_browse_everything.html.erb_spec.rb +7 -4
  1000. data/spec/views/hyrax/base/_citations.html.erb_spec.rb +2 -3
  1001. data/spec/views/hyrax/base/_find_work_widget.html.erb_spec.rb +1 -2
  1002. data/spec/views/hyrax/base/_form.html.erb_spec.rb +30 -7
  1003. data/spec/views/hyrax/base/_form_child_work_relationships.html.erb_spec.rb +4 -3
  1004. data/spec/views/hyrax/base/_form_metadata.html.erb_spec.rb +40 -0
  1005. data/spec/views/hyrax/base/_form_progress.html.erb_spec.rb +17 -8
  1006. data/spec/views/hyrax/base/_form_relationships.html.erb_spec.rb +7 -8
  1007. data/spec/views/hyrax/base/_items.html.erb_spec.rb +25 -34
  1008. data/spec/views/hyrax/base/_member.html.erb_spec.rb +6 -4
  1009. data/spec/views/hyrax/base/_relationships.html.erb_spec.rb +9 -48
  1010. data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +8 -11
  1011. data/spec/views/hyrax/base/_social_media.html.erb_spec.rb +1 -3
  1012. data/spec/views/hyrax/base/edit.html.erb_spec.rb +4 -4
  1013. data/spec/views/hyrax/base/file_manager.html.erb_spec.rb +1 -3
  1014. data/spec/views/hyrax/base/show.html.erb_spec.rb +151 -7
  1015. data/spec/views/hyrax/base/show.json.jbuilder_spec.rb +3 -5
  1016. data/spec/views/hyrax/base/unauthorized.html.erb_spec.rb +3 -3
  1017. data/spec/views/hyrax/base/unavailable.html.erb_spec.rb +6 -6
  1018. data/spec/views/hyrax/batch_edits/check_all_spec.rb +1 -1
  1019. data/spec/views/hyrax/batch_edits/edit.html.erb_spec.rb +8 -4
  1020. data/spec/views/hyrax/batch_uploads/_form.html.erb_spec.rb +5 -8
  1021. data/spec/views/hyrax/citations/work.html.erb_spec.rb +1 -1
  1022. data/spec/views/hyrax/collections/_show_descriptions.html.erb_spec.rb +14 -9
  1023. data/spec/views/hyrax/collections/_show_document_list.html.erb_spec.rb +14 -18
  1024. data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +1 -2
  1025. data/spec/views/hyrax/collections/show.html.erb_spec.rb +2 -7
  1026. data/spec/views/hyrax/dashboard/_sidebar.html.erb_spec.rb +105 -0
  1027. data/spec/views/hyrax/dashboard/collections/_form.html.erb_spec.rb +56 -0
  1028. data/spec/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb_spec.rb +55 -0
  1029. data/spec/views/hyrax/dashboard/collections/_form_share.erb_spec.rb +42 -0
  1030. data/spec/views/hyrax/dashboard/collections/_show_descriptions.html.erb_spec.rb +32 -0
  1031. data/spec/views/hyrax/dashboard/collections/_show_document_list.html.erb_spec.rb +24 -0
  1032. data/spec/views/hyrax/{collections → dashboard/collections}/_show_document_list_menu.html.erb_spec.rb +6 -6
  1033. data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +31 -0
  1034. data/spec/views/hyrax/{collections → dashboard/collections}/edit.html.erb_spec.rb +4 -4
  1035. data/spec/views/hyrax/dashboard/collections/show.html.erb_spec.rb +37 -0
  1036. data/spec/views/hyrax/{users → dashboard/profiles}/edit.html.erb_spec.rb +3 -2
  1037. data/spec/views/hyrax/dashboard/show_user_spec.rb +34 -0
  1038. data/spec/views/hyrax/embargoes/index.html.erb_spec.rb +14 -0
  1039. data/spec/views/hyrax/file_sets/_permission.html.erb_spec.rb +1 -3
  1040. data/spec/views/hyrax/file_sets/_permission_form.html.erb_spec.rb +1 -3
  1041. data/spec/views/hyrax/file_sets/_show_actions.html.erb_spec.rb +2 -3
  1042. data/spec/views/hyrax/file_sets/_show_characterization_details.html.erb_spec.rb +2 -5
  1043. data/spec/views/hyrax/file_sets/_single_use_links.html.erb_spec.rb +2 -3
  1044. data/spec/views/hyrax/file_sets/_versioning.html.erb_spec.rb +1 -1
  1045. data/spec/views/hyrax/file_sets/media_display/_default.html.erb_spec.rb +1 -3
  1046. data/spec/views/hyrax/file_sets/show.html.erb_spec.rb +13 -8
  1047. data/spec/views/hyrax/file_sets/show.json.jbuilder_spec.rb +0 -2
  1048. data/spec/views/hyrax/homepage/_announcement.html.erb_spec.rb +5 -28
  1049. data/spec/views/hyrax/homepage/_featured_works.html.erb_spec.rb +4 -1
  1050. data/spec/views/hyrax/homepage/_sortable_featured.html.erb_spec.rb +3 -1
  1051. data/spec/views/hyrax/homepage/index.html.erb_spec.rb +5 -2
  1052. data/spec/views/hyrax/leases/index.html.erb_spec.rb +14 -0
  1053. data/spec/views/hyrax/my/{_sort_and_per_page.html.erb_spec.rb → _search_header.html.erb_spec.rb} +10 -11
  1054. data/spec/views/hyrax/my/_work_action_menu.html.erb_spec.rb +1 -3
  1055. data/spec/views/hyrax/my/{_list_collections.html.erb_spec.rb → collections/_list_collections.html.erb_spec.rb} +5 -5
  1056. data/spec/views/hyrax/my/facet.html.erb_spec.rb +2 -1
  1057. data/spec/views/hyrax/my/{_list_works.html.erb_spec.rb → works/_list_works.html.erb_spec.rb} +3 -3
  1058. data/spec/views/hyrax/my/works/index.html.erb_spec.rb +64 -0
  1059. data/spec/views/hyrax/permissions/confirm.html.erb_spec.rb +4 -5
  1060. data/spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb +1 -12
  1061. data/spec/views/hyrax/single_use_links_viewer/single_use_error.html.erb_spec.rb +1 -3
  1062. data/spec/views/hyrax/stats/file.html.erb_spec.rb +1 -1
  1063. data/spec/views/hyrax/uploads/create.json.jbuilder_spec.rb +1 -3
  1064. data/spec/views/hyrax/users/_user_info.html.erb_spec.rb +1 -1
  1065. data/spec/views/hyrax/users/index.html.erb_spec.rb +2 -1
  1066. data/spec/views/hyrax/users/show.html.erb_spec.rb +1 -1
  1067. data/spec/views/layouts/error.html.erb_spec.rb +1 -3
  1068. data/spec/views/pages/edit.html.erb_spec.rb +27 -0
  1069. data/spec/views/pages/show.html.erb_spec.rb +16 -0
  1070. data/spec/views/records/edit_fields/_based_near.html.erb_spec.rb +1 -1
  1071. data/spec/views/records/edit_fields/_description.html.erb_spec.rb +2 -1
  1072. data/spec/views/records/edit_fields/_language.html.erb_spec.rb +1 -1
  1073. data/spec/views/records/edit_fields/_subject.html.erb_spec.rb +1 -1
  1074. data/spec/views/shared/select_work_type_modal.html.erb_spec.rb +4 -11
  1075. data/tasks/{hyrax-dev.rake → hyrax_dev.rake} +2 -2
  1076. data/template.rb +1 -5
  1077. data/vendor/assets/javascripts/handlebars-v4.0.5.js +4612 -0
  1078. metadata +453 -396
  1079. data/CONTRIBUTING.md +0 -159
  1080. data/app/actors/hyrax/actors/actor_stack.rb +0 -70
  1081. data/app/actors/hyrax/actors/add_as_member_of_collections_actor.rb +0 -26
  1082. data/app/actors/hyrax/actors/attach_files_actor.rb +0 -53
  1083. data/app/actors/hyrax/actors/root_actor.rb +0 -20
  1084. data/app/actors/hyrax/apply_permission_template_actor.rb +0 -21
  1085. data/app/actors/hyrax/create_with_files_actor.rb +0 -46
  1086. data/app/actors/hyrax/create_with_remote_files_actor.rb +0 -71
  1087. data/app/actors/hyrax/default_admin_set_actor.rb +0 -42
  1088. data/app/assets/javascripts/batch_edit.js.coffee +0 -166
  1089. data/app/assets/javascripts/hyrax/batch_select.js +0 -10
  1090. data/app/assets/javascripts/hyrax/featured_researcher.js +0 -14
  1091. data/app/assets/stylesheets/hyrax/_dashboard.scss +0 -153
  1092. data/app/assets/stylesheets/hyrax/_multi_value_fields.css.scss +0 -18
  1093. data/app/assets/stylesheets/hyrax/admin.scss +0 -178
  1094. data/app/controllers/concerns/hydra/batch_edit_behavior.rb +0 -73
  1095. data/app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb +0 -84
  1096. data/app/controllers/concerns/hyrax/batch_uploads_controller_behavior.rb +0 -69
  1097. data/app/controllers/concerns/hyrax/contact_form_controller_behavior.rb +0 -45
  1098. data/app/controllers/concerns/hyrax/curation_concern_controller.rb +0 -241
  1099. data/app/controllers/concerns/hyrax/dashboard_controller_behavior.rb +0 -47
  1100. data/app/controllers/concerns/hyrax/depositors_controller_behavior.rb +0 -48
  1101. data/app/controllers/concerns/hyrax/download_behavior.rb +0 -87
  1102. data/app/controllers/concerns/hyrax/file_sets_controller_behavior.rb +0 -273
  1103. data/app/controllers/concerns/hyrax/homepage_controller_behavior.rb +0 -52
  1104. data/app/controllers/concerns/hyrax/my_controller_behavior.rb +0 -59
  1105. data/app/controllers/concerns/hyrax/permissions_controller_behavior.rb +0 -38
  1106. data/app/controllers/concerns/hyrax/single_use_links_controller_behavior.rb +0 -53
  1107. data/app/controllers/concerns/hyrax/single_use_links_viewer_controller_behavior.rb +0 -85
  1108. data/app/controllers/concerns/hyrax/transfers_controller_behavior.rb +0 -80
  1109. data/app/controllers/concerns/hyrax/uploads_controller_behavior.rb +0 -18
  1110. data/app/controllers/concerns/hyrax/users_controller_behavior.rb +0 -113
  1111. data/app/controllers/hyrax/admin_controller.rb +0 -20
  1112. data/app/controllers/hyrax/admin_sets_controller.rb +0 -25
  1113. data/app/controllers/hyrax/audits_controller.rb +0 -16
  1114. data/app/controllers/hyrax/tinymce_assets_controller.rb +0 -14
  1115. data/app/helpers/batch_edits_helper.rb +0 -14
  1116. data/app/helpers/contact_form_helper.rb +0 -2
  1117. data/app/helpers/file_set_helper.rb +0 -7
  1118. data/app/helpers/hyrax/search_paths_helper.rb +0 -11
  1119. data/app/jobs/audit_job.rb +0 -47
  1120. data/app/jobs/ingest_file_job.rb +0 -37
  1121. data/app/models/concerns/hyrax/admin_set_behavior.rb +0 -118
  1122. data/app/models/concerns/hyrax/content_block_behavior.rb +0 -47
  1123. data/app/models/concerns/hyrax/works/featured.rb +0 -23
  1124. data/app/models/concerns/hyrax/works/trophies.rb +0 -12
  1125. data/app/models/hyrax/classify_concern.rb +0 -43
  1126. data/app/models/tinymce_asset.rb +0 -3
  1127. data/app/search_builders/deposit_search_builder.rb +0 -24
  1128. data/app/search_builders/hyrax/active_works_search_builder.rb +0 -13
  1129. data/app/search_builders/hyrax/admin_set_member_search_builder.rb +0 -12
  1130. data/app/search_builders/hyrax/my_collections_search_builder.rb +0 -11
  1131. data/app/search_builders/parent_collection_search_builder.rb +0 -10
  1132. data/app/services/hyrax/actor_factory.rb +0 -33
  1133. data/app/services/hyrax/audit_failure_service.rb +0 -20
  1134. data/app/services/hyrax/file_set_audit_service.rb +0 -122
  1135. data/app/services/hyrax/import_url_success_service.rb +0 -22
  1136. data/app/services/hyrax/repository_audit_service.rb +0 -9
  1137. data/app/services/hyrax/workflow/workflow_by_model_name_strategy.rb +0 -14
  1138. data/app/uploaders/tinymce_asset_uploader.rb +0 -45
  1139. data/app/views/_toolbar.html.erb +0 -75
  1140. data/app/views/hyrax/admin/_menu.html.erb +0 -5
  1141. data/app/views/hyrax/admin/_sidebar.html.erb +0 -33
  1142. data/app/views/hyrax/admin_sets/_admin_set.html.erb +0 -25
  1143. data/app/views/hyrax/admin_sets/_document_list.html.erb +0 -30
  1144. data/app/views/hyrax/admin_sets/_member_document.html.erb +0 -26
  1145. data/app/views/hyrax/admin_sets/_search_form.html.erb +0 -11
  1146. data/app/views/hyrax/admin_sets/_sort_and_per_page.html.erb +0 -5
  1147. data/app/views/hyrax/admin_sets/index.html.erb +0 -2
  1148. data/app/views/hyrax/admin_sets/show.html.erb +0 -32
  1149. data/app/views/hyrax/base/_relationships_parent_row_empty.html.erb +0 -6
  1150. data/app/views/hyrax/collections/_button_create_collection.html.erb +0 -1
  1151. data/app/views/hyrax/collections/_dashboard_document_list.html.erb +0 -4
  1152. data/app/views/hyrax/collections/_form.html.erb +0 -41
  1153. data/app/views/hyrax/collections/edit.html.erb +0 -29
  1154. data/app/views/hyrax/collections/new.html.erb +0 -3
  1155. data/app/views/hyrax/content_blocks/_featured_researcher.html.erb +0 -3
  1156. data/app/views/hyrax/content_blocks/index.html.erb +0 -7
  1157. data/app/views/hyrax/dashboard/_create_work_action.html.erb +0 -20
  1158. data/app/views/hyrax/dashboard/_index_partials/_heading_actions.html.erb +0 -25
  1159. data/app/views/hyrax/dashboard/_index_partials/_heading_greetings.html.erb +0 -3
  1160. data/app/views/hyrax/dashboard/index.html.erb +0 -10
  1161. data/app/views/hyrax/file_sets/_edit.js.erb +0 -20
  1162. data/app/views/hyrax/mailbox/_notifications.html.erb +0 -27
  1163. data/app/views/hyrax/mailbox/index.html.erb +0 -8
  1164. data/app/views/hyrax/my/_facets.html.erb +0 -18
  1165. data/app/views/hyrax/static/agreement.html.erb +0 -44
  1166. data/app/views/hyrax/static/help.html.erb +0 -4
  1167. data/app/views/hyrax/static/terms.html.erb +0 -62
  1168. data/app/views/hyrax/users/edit.html.erb +0 -8
  1169. data/app/views/layouts/admin.html.erb +0 -11
  1170. data/app/views/records/edit_fields/_default.html.erb +0 -6
  1171. data/lib/hyrax/collections.rb +0 -7
  1172. data/lib/hyrax/collections_migration.rb +0 -18
  1173. data/spec/actors/hyrax/actors/actor_stack_spec.rb +0 -35
  1174. data/spec/actors/hyrax/create_with_remote_files_actor_spec.rb +0 -105
  1175. data/spec/controllers/hyrax/admin_controller_spec.rb +0 -19
  1176. data/spec/controllers/hyrax/admin_sets_controller_spec.rb +0 -28
  1177. data/spec/controllers/hyrax/tinymce_assets_controller_spec.rb +0 -37
  1178. data/spec/features/browse_dashboard_files_spec.rb +0 -67
  1179. data/spec/features/cloud_upload_spec.rb +0 -15
  1180. data/spec/features/display_dashboard_spec.rb +0 -28
  1181. data/spec/features/show_admin_set_spec.rb +0 -11
  1182. data/spec/features/user_admin_set_spec.rb +0 -55
  1183. data/spec/helpers/hyrax/citations_behaviors/formatters/chicago_formatter_spec.rb +0 -10
  1184. data/spec/jobs/audit_job_spec.rb +0 -57
  1185. data/spec/jobs/ingest_file_job_spec.rb +0 -79
  1186. data/spec/lib/hyrax/collections_migration_spec.rb +0 -34
  1187. data/spec/routing/admin_sets_spec.rb +0 -7
  1188. data/spec/search_builders/hyrax/active_works_search_builder_spec.rb +0 -53
  1189. data/spec/services/hyrax/actor_factory_spec.rb +0 -55
  1190. data/spec/services/hyrax/audit_failure_service_spec.rb +0 -26
  1191. data/spec/services/hyrax/file_set_audit_service_spec.rb +0 -156
  1192. data/spec/services/hyrax/import_url_success_service_spec.rb +0 -20
  1193. data/spec/services/hyrax/repository_audit_service_spec.rb +0 -17
  1194. data/spec/support/locations.rb +0 -17
  1195. data/spec/support/proxies.rb +0 -15
  1196. data/spec/views/_toolbar.html.erb_spec.rb +0 -93
  1197. data/spec/views/hyrax/collections/_form.html.erb_spec.rb +0 -33
  1198. data/spec/views/hyrax/collections/_form_for_select_collection.html.erb_spec.rb +0 -51
  1199. data/spec/views/hyrax/dashboard/create_work_action.html.erb_spec.rb +0 -27
  1200. data/spec/views/hyrax/dashboard/index_spec.rb +0 -169
  1201. data/vendor/assets/javascripts/jquery.validate.js +0 -1248
@@ -13,7 +13,7 @@ end
13
13
  RSpec::Core::RakeTask.new(:spec)
14
14
 
15
15
  desc 'Spin up test servers and run specs'
16
- task :spec_with_app_load do
16
+ task :spec_with_app_load do
17
17
  with_test_server do
18
18
  Rake::Task['spec'].invoke
19
19
  end
@@ -25,7 +25,7 @@ task :i18n_sorter do
25
25
  locales = Dir.glob(File.expand_path('../../config/locales/**/*.yml', __FILE__))
26
26
  locales.each do |locale_path|
27
27
  sorted_contents = File.open(locale_path) { |f| I18nYamlSorter::Sorter.new(f).sort }
28
- File.open(locale_path, 'w') { |f| f << sorted_contents}
28
+ File.open(locale_path, 'w') { |f| f << sorted_contents }
29
29
  abort("Bad I18n conversion!") unless Psych.load_file(locale_path).is_a?(Hash)
30
30
  end
31
31
  end
@@ -1,8 +1,4 @@
1
- gem 'hyrax', '1.1.1'
2
-
1
+ gem 'hyrax', '2.0.0.beta1'
3
2
  run 'bundle install'
4
-
5
3
  generate 'hyrax:install', '-f'
6
-
7
4
  rails_command 'db:migrate'
8
- rails_command 'hyrax:workflow:load'
@@ -0,0 +1,4612 @@
1
+ /* Note this has been modified from it's original in order to work around
2
+ https://github.com/wycats/handlebars.js/issues/1335
3
+ /*
4
+
5
+ /*!
6
+
7
+ handlebars v4.0.5
8
+
9
+ Copyright (C) 2011-2015 by Yehuda Katz
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in
19
+ all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
+ THE SOFTWARE.
28
+
29
+ @license
30
+ */
31
+ (function webpackUniversalModuleDefinition(root, factory) {
32
+ if(typeof exports === 'object' && typeof module === 'object')
33
+ module.exports = factory();
34
+ else if(typeof define === 'function' && define.amd)
35
+ define('handlebars', [], factory);
36
+ else if(typeof exports === 'object')
37
+ exports["Handlebars"] = factory();
38
+ else
39
+ root["Handlebars"] = factory();
40
+ })(this, function() {
41
+ return /******/ (function(modules) { // webpackBootstrap
42
+ /******/ // The module cache
43
+ /******/ var installedModules = {};
44
+
45
+ /******/ // The require function
46
+ /******/ function __webpack_require__(moduleId) {
47
+
48
+ /******/ // Check if module is in cache
49
+ /******/ if(installedModules[moduleId])
50
+ /******/ return installedModules[moduleId].exports;
51
+
52
+ /******/ // Create a new module (and put it into the cache)
53
+ /******/ var module = installedModules[moduleId] = {
54
+ /******/ exports: {},
55
+ /******/ id: moduleId,
56
+ /******/ loaded: false
57
+ /******/ };
58
+
59
+ /******/ // Execute the module function
60
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
61
+
62
+ /******/ // Flag the module as loaded
63
+ /******/ module.loaded = true;
64
+
65
+ /******/ // Return the exports of the module
66
+ /******/ return module.exports;
67
+ /******/ }
68
+
69
+
70
+ /******/ // expose the modules object (__webpack_modules__)
71
+ /******/ __webpack_require__.m = modules;
72
+
73
+ /******/ // expose the module cache
74
+ /******/ __webpack_require__.c = installedModules;
75
+
76
+ /******/ // __webpack_public_path__
77
+ /******/ __webpack_require__.p = "";
78
+
79
+ /******/ // Load entry module and return exports
80
+ /******/ return __webpack_require__(0);
81
+ /******/ })
82
+ /************************************************************************/
83
+ /******/ ([
84
+ /* 0 */
85
+ /***/ function(module, exports, __webpack_require__) {
86
+
87
+ 'use strict';
88
+
89
+ var _interopRequireDefault = __webpack_require__(1)['default'];
90
+
91
+ exports.__esModule = true;
92
+
93
+ var _handlebarsRuntime = __webpack_require__(2);
94
+
95
+ var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
96
+
97
+ // Compiler imports
98
+
99
+ var _handlebarsCompilerAst = __webpack_require__(21);
100
+
101
+ var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
102
+
103
+ var _handlebarsCompilerBase = __webpack_require__(22);
104
+
105
+ var _handlebarsCompilerCompiler = __webpack_require__(27);
106
+
107
+ var _handlebarsCompilerJavascriptCompiler = __webpack_require__(28);
108
+
109
+ var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
110
+
111
+ var _handlebarsCompilerVisitor = __webpack_require__(25);
112
+
113
+ var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
114
+
115
+ var _handlebarsNoConflict = __webpack_require__(20);
116
+
117
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
118
+
119
+ var _create = _handlebarsRuntime2['default'].create;
120
+ function create() {
121
+ var hb = _create();
122
+
123
+ hb.compile = function (input, options) {
124
+ return _handlebarsCompilerCompiler.compile(input, options, hb);
125
+ };
126
+ hb.precompile = function (input, options) {
127
+ return _handlebarsCompilerCompiler.precompile(input, options, hb);
128
+ };
129
+
130
+ hb.AST = _handlebarsCompilerAst2['default'];
131
+ hb.Compiler = _handlebarsCompilerCompiler.Compiler;
132
+ hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
133
+ hb.Parser = _handlebarsCompilerBase.parser;
134
+ hb.parse = _handlebarsCompilerBase.parse;
135
+
136
+ return hb;
137
+ }
138
+
139
+ var inst = create();
140
+ inst.create = create;
141
+
142
+ _handlebarsNoConflict2['default'](inst);
143
+
144
+ inst.Visitor = _handlebarsCompilerVisitor2['default'];
145
+
146
+ inst['default'] = inst;
147
+
148
+ exports['default'] = inst;
149
+ module.exports = exports['default'];
150
+
151
+ /***/ },
152
+ /* 1 */
153
+ /***/ function(module, exports) {
154
+
155
+ "use strict";
156
+
157
+ exports["default"] = function (obj) {
158
+ return obj && obj.__esModule ? obj : {
159
+ "default": obj
160
+ };
161
+ };
162
+
163
+ exports.__esModule = true;
164
+
165
+ /***/ },
166
+ /* 2 */
167
+ /***/ function(module, exports, __webpack_require__) {
168
+
169
+ 'use strict';
170
+
171
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
172
+
173
+ var _interopRequireDefault = __webpack_require__(1)['default'];
174
+
175
+ exports.__esModule = true;
176
+
177
+ var _handlebarsBase = __webpack_require__(4);
178
+
179
+ var base = _interopRequireWildcard(_handlebarsBase);
180
+
181
+ // Each of these augment the Handlebars object. No need to setup here.
182
+ // (This is done to easily share code between commonjs and browse envs)
183
+
184
+ var _handlebarsSafeString = __webpack_require__(18);
185
+
186
+ var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
187
+
188
+ var _handlebarsException = __webpack_require__(6);
189
+
190
+ var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
191
+
192
+ var _handlebarsUtils = __webpack_require__(5);
193
+
194
+ var Utils = _interopRequireWildcard(_handlebarsUtils);
195
+
196
+ var _handlebarsRuntime = __webpack_require__(19);
197
+
198
+ var runtime = _interopRequireWildcard(_handlebarsRuntime);
199
+
200
+ var _handlebarsNoConflict = __webpack_require__(20);
201
+
202
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
203
+
204
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
205
+ function create() {
206
+ var hb = new base.HandlebarsEnvironment();
207
+
208
+ Utils.extend(hb, base);
209
+ hb.SafeString = _handlebarsSafeString2['default'];
210
+ hb.Exception = _handlebarsException2['default'];
211
+ hb.Utils = Utils;
212
+ hb.escapeExpression = Utils.escapeExpression;
213
+
214
+ hb.VM = runtime;
215
+ hb.template = function (spec) {
216
+ return runtime.template(spec, hb);
217
+ };
218
+
219
+ return hb;
220
+ }
221
+
222
+ var inst = create();
223
+ inst.create = create;
224
+
225
+ _handlebarsNoConflict2['default'](inst);
226
+
227
+ inst['default'] = inst;
228
+
229
+ exports['default'] = inst;
230
+ module.exports = exports['default'];
231
+
232
+ /***/ },
233
+ /* 3 */
234
+ /***/ function(module, exports) {
235
+
236
+ "use strict";
237
+
238
+ exports["default"] = function (obj) {
239
+ if (obj && obj.__esModule) {
240
+ return obj;
241
+ } else {
242
+ var newObj = {};
243
+
244
+ if (obj != null) {
245
+ for (var key in obj) {
246
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
247
+ }
248
+ }
249
+
250
+ newObj["default"] = obj;
251
+ return newObj;
252
+ }
253
+ };
254
+
255
+ exports.__esModule = true;
256
+
257
+ /***/ },
258
+ /* 4 */
259
+ /***/ function(module, exports, __webpack_require__) {
260
+
261
+ 'use strict';
262
+
263
+ var _interopRequireDefault = __webpack_require__(1)['default'];
264
+
265
+ exports.__esModule = true;
266
+ exports.HandlebarsEnvironment = HandlebarsEnvironment;
267
+
268
+ var _utils = __webpack_require__(5);
269
+
270
+ var _exception = __webpack_require__(6);
271
+
272
+ var _exception2 = _interopRequireDefault(_exception);
273
+
274
+ var _helpers = __webpack_require__(7);
275
+
276
+ var _decorators = __webpack_require__(15);
277
+
278
+ var _logger = __webpack_require__(17);
279
+
280
+ var _logger2 = _interopRequireDefault(_logger);
281
+
282
+ var VERSION = '4.0.5';
283
+ exports.VERSION = VERSION;
284
+ var COMPILER_REVISION = 7;
285
+
286
+ exports.COMPILER_REVISION = COMPILER_REVISION;
287
+ var REVISION_CHANGES = {
288
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
289
+ 2: '== 1.0.0-rc.3',
290
+ 3: '== 1.0.0-rc.4',
291
+ 4: '== 1.x.x',
292
+ 5: '== 2.0.0-alpha.x',
293
+ 6: '>= 2.0.0-beta.1',
294
+ 7: '>= 4.0.0'
295
+ };
296
+
297
+ exports.REVISION_CHANGES = REVISION_CHANGES;
298
+ var objectType = '[object Object]';
299
+
300
+ function HandlebarsEnvironment(helpers, partials, decorators) {
301
+ this.helpers = helpers || {};
302
+ this.partials = partials || {};
303
+ this.decorators = decorators || {};
304
+
305
+ _helpers.registerDefaultHelpers(this);
306
+ _decorators.registerDefaultDecorators(this);
307
+ }
308
+
309
+ HandlebarsEnvironment.prototype = {
310
+ constructor: HandlebarsEnvironment,
311
+
312
+ logger: _logger2['default'],
313
+ log: _logger2['default'].log,
314
+
315
+ registerHelper: function registerHelper(name, fn) {
316
+ if (_utils.toString.call(name) === objectType) {
317
+ if (fn) {
318
+ throw new _exception2['default']('Arg not supported with multiple helpers');
319
+ }
320
+ _utils.extend(this.helpers, name);
321
+ } else {
322
+ this.helpers[name] = fn;
323
+ }
324
+ },
325
+ unregisterHelper: function unregisterHelper(name) {
326
+ delete this.helpers[name];
327
+ },
328
+
329
+ registerPartial: function registerPartial(name, partial) {
330
+ if (_utils.toString.call(name) === objectType) {
331
+ _utils.extend(this.partials, name);
332
+ } else {
333
+ if (typeof partial === 'undefined') {
334
+ throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
335
+ }
336
+ this.partials[name] = partial;
337
+ }
338
+ },
339
+ unregisterPartial: function unregisterPartial(name) {
340
+ delete this.partials[name];
341
+ },
342
+
343
+ registerDecorator: function registerDecorator(name, fn) {
344
+ if (_utils.toString.call(name) === objectType) {
345
+ if (fn) {
346
+ throw new _exception2['default']('Arg not supported with multiple decorators');
347
+ }
348
+ _utils.extend(this.decorators, name);
349
+ } else {
350
+ this.decorators[name] = fn;
351
+ }
352
+ },
353
+ unregisterDecorator: function unregisterDecorator(name) {
354
+ delete this.decorators[name];
355
+ }
356
+ };
357
+
358
+ var log = _logger2['default'].log;
359
+
360
+ exports.log = log;
361
+ exports.createFrame = _utils.createFrame;
362
+ exports.logger = _logger2['default'];
363
+
364
+ /***/ },
365
+ /* 5 */
366
+ /***/ function(module, exports) {
367
+
368
+ 'use strict';
369
+
370
+ exports.__esModule = true;
371
+ exports.extend = extend;
372
+ exports.indexOf = indexOf;
373
+ exports.escapeExpression = escapeExpression;
374
+ exports.isEmpty = isEmpty;
375
+ exports.createFrame = createFrame;
376
+ exports.blockParams = blockParams;
377
+ exports.appendContextPath = appendContextPath;
378
+ var escape = {
379
+ '&': '&amp;',
380
+ '<': '&lt;',
381
+ '>': '&gt;',
382
+ '"': '&quot;',
383
+ "'": '&#x27;',
384
+ '`': '&#x60;',
385
+ '=': '&#x3D;'
386
+ };
387
+
388
+ var badChars = /[&<>"'`=]/g,
389
+ possible = /[&<>"'`=]/;
390
+
391
+ function escapeChar(chr) {
392
+ return escape[chr];
393
+ }
394
+
395
+ function extend(obj /* , ...source */) {
396
+ for (var i = 1; i < arguments.length; i++) {
397
+ for (var key in arguments[i]) {
398
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
399
+ obj[key] = arguments[i][key];
400
+ }
401
+ }
402
+ }
403
+
404
+ return obj;
405
+ }
406
+
407
+ var toString = Object.prototype.toString;
408
+
409
+ exports.toString = toString;
410
+ // Sourced from lodash
411
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
412
+ /* eslint-disable func-style */
413
+ var isFunction = function isFunction(value) {
414
+ return typeof value === 'function';
415
+ };
416
+ // fallback for older versions of Chrome and Safari
417
+ /* istanbul ignore next */
418
+ if (isFunction(/x/)) {
419
+ exports.isFunction = isFunction = function (value) {
420
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
421
+ };
422
+ }
423
+ exports.isFunction = isFunction;
424
+
425
+ /* eslint-enable func-style */
426
+
427
+ /* istanbul ignore next */
428
+ var isArray = Array.isArray || function (value) {
429
+ return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
430
+ };
431
+
432
+ exports.isArray = isArray;
433
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
434
+
435
+ function indexOf(array, value) {
436
+ for (var i = 0, len = array.length; i < len; i++) {
437
+ if (array[i] === value) {
438
+ return i;
439
+ }
440
+ }
441
+ return -1;
442
+ }
443
+
444
+ function escapeExpression(string) {
445
+ if (typeof string !== 'string') {
446
+ // don't escape SafeStrings, since they're already safe
447
+ if (string && string.toHTML) {
448
+ return string.toHTML();
449
+ } else if (string == null) {
450
+ return '';
451
+ } else if (!string) {
452
+ return string + '';
453
+ }
454
+
455
+ // Force a string conversion as this will be done by the append regardless and
456
+ // the regex test will do this transparently behind the scenes, causing issues if
457
+ // an object's to string has escaped characters in it.
458
+ string = '' + string;
459
+ }
460
+
461
+ if (!possible.test(string)) {
462
+ return string;
463
+ }
464
+ return string.replace(badChars, escapeChar);
465
+ }
466
+
467
+ function isEmpty(value) {
468
+ if (!value && value !== 0) {
469
+ return true;
470
+ } else if (isArray(value) && value.length === 0) {
471
+ return true;
472
+ } else {
473
+ return false;
474
+ }
475
+ }
476
+
477
+ function createFrame(object) {
478
+ var frame = extend({}, object);
479
+ frame._parent = object;
480
+ return frame;
481
+ }
482
+
483
+ function blockParams(params, ids) {
484
+ params.path = ids;
485
+ return params;
486
+ }
487
+
488
+ function appendContextPath(contextPath, id) {
489
+ return (contextPath ? contextPath + '.' : '') + id;
490
+ }
491
+
492
+ /***/ },
493
+ /* 6 */
494
+ /***/ function(module, exports) {
495
+
496
+ 'use strict';
497
+
498
+ exports.__esModule = true;
499
+
500
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
501
+
502
+ function Exception(message, node) {
503
+ var loc = node && node.loc,
504
+ line = undefined,
505
+ column = undefined;
506
+ if (loc) {
507
+ line = loc.start.line;
508
+ column = loc.start.column;
509
+
510
+ message += ' - ' + line + ':' + column;
511
+ }
512
+
513
+ var tmp = Error.prototype.constructor.call(this, message);
514
+
515
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
516
+ for (var idx = 0; idx < errorProps.length; idx++) {
517
+ this[errorProps[idx]] = tmp[errorProps[idx]];
518
+ }
519
+
520
+ /* istanbul ignore else */
521
+ if (Error.captureStackTrace) {
522
+ Error.captureStackTrace(this, Exception);
523
+ }
524
+
525
+ if (loc) {
526
+ this.lineNumber = line;
527
+ this.column = column;
528
+ }
529
+ }
530
+
531
+ Exception.prototype = new Error();
532
+
533
+ exports['default'] = Exception;
534
+ module.exports = exports['default'];
535
+
536
+ /***/ },
537
+ /* 7 */
538
+ /***/ function(module, exports, __webpack_require__) {
539
+
540
+ 'use strict';
541
+
542
+ var _interopRequireDefault = __webpack_require__(1)['default'];
543
+
544
+ exports.__esModule = true;
545
+ exports.registerDefaultHelpers = registerDefaultHelpers;
546
+
547
+ var _helpersBlockHelperMissing = __webpack_require__(8);
548
+
549
+ var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
550
+
551
+ var _helpersEach = __webpack_require__(9);
552
+
553
+ var _helpersEach2 = _interopRequireDefault(_helpersEach);
554
+
555
+ var _helpersHelperMissing = __webpack_require__(10);
556
+
557
+ var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
558
+
559
+ var _helpersIf = __webpack_require__(11);
560
+
561
+ var _helpersIf2 = _interopRequireDefault(_helpersIf);
562
+
563
+ var _helpersLog = __webpack_require__(12);
564
+
565
+ var _helpersLog2 = _interopRequireDefault(_helpersLog);
566
+
567
+ var _helpersLookup = __webpack_require__(13);
568
+
569
+ var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
570
+
571
+ var _helpersWith = __webpack_require__(14);
572
+
573
+ var _helpersWith2 = _interopRequireDefault(_helpersWith);
574
+
575
+ function registerDefaultHelpers(instance) {
576
+ _helpersBlockHelperMissing2['default'](instance);
577
+ _helpersEach2['default'](instance);
578
+ _helpersHelperMissing2['default'](instance);
579
+ _helpersIf2['default'](instance);
580
+ _helpersLog2['default'](instance);
581
+ _helpersLookup2['default'](instance);
582
+ _helpersWith2['default'](instance);
583
+ }
584
+
585
+ /***/ },
586
+ /* 8 */
587
+ /***/ function(module, exports, __webpack_require__) {
588
+
589
+ 'use strict';
590
+
591
+ exports.__esModule = true;
592
+
593
+ var _utils = __webpack_require__(5);
594
+
595
+ exports['default'] = function (instance) {
596
+ instance.registerHelper('blockHelperMissing', function (context, options) {
597
+ var inverse = options.inverse,
598
+ fn = options.fn;
599
+
600
+ if (context === true) {
601
+ return fn(this);
602
+ } else if (context === false || context == null) {
603
+ return inverse(this);
604
+ } else if (_utils.isArray(context)) {
605
+ if (context.length > 0) {
606
+ if (options.ids) {
607
+ options.ids = [options.name];
608
+ }
609
+
610
+ return instance.helpers.each(context, options);
611
+ } else {
612
+ return inverse(this);
613
+ }
614
+ } else {
615
+ if (options.data && options.ids) {
616
+ var data = _utils.createFrame(options.data);
617
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
618
+ options = { data: data };
619
+ }
620
+
621
+ return fn(context, options);
622
+ }
623
+ });
624
+ };
625
+
626
+ module.exports = exports['default'];
627
+
628
+ /***/ },
629
+ /* 9 */
630
+ /***/ function(module, exports, __webpack_require__) {
631
+
632
+ 'use strict';
633
+
634
+ var _interopRequireDefault = __webpack_require__(1)['default'];
635
+
636
+ exports.__esModule = true;
637
+
638
+ var _utils = __webpack_require__(5);
639
+
640
+ var _exception = __webpack_require__(6);
641
+
642
+ var _exception2 = _interopRequireDefault(_exception);
643
+
644
+ exports['default'] = function (instance) {
645
+ instance.registerHelper('each', function (context, options) {
646
+ if (!options) {
647
+ throw new _exception2['default']('Must pass iterator to #each');
648
+ }
649
+
650
+ var fn = options.fn,
651
+ inverse = options.inverse,
652
+ i = 0,
653
+ ret = '',
654
+ data = undefined,
655
+ contextPath = undefined;
656
+
657
+ if (options.data && options.ids) {
658
+ contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
659
+ }
660
+
661
+ if (_utils.isFunction(context)) {
662
+ context = context.call(this);
663
+ }
664
+
665
+ if (options.data) {
666
+ data = _utils.createFrame(options.data);
667
+ }
668
+
669
+ function execIteration(field, index, last) {
670
+ if (data) {
671
+ data.key = field;
672
+ data.index = index;
673
+ data.first = index === 0;
674
+ data.last = !!last;
675
+
676
+ if (contextPath) {
677
+ data.contextPath = contextPath + field;
678
+ }
679
+ }
680
+
681
+ ret = ret + fn(context[field], {
682
+ data: data,
683
+ blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
684
+ });
685
+ }
686
+
687
+ if (context && typeof context === 'object') {
688
+ if (_utils.isArray(context)) {
689
+ for (var j = context.length; i < j; i++) {
690
+ if (i in context) {
691
+ execIteration(i, i, i === context.length - 1);
692
+ }
693
+ }
694
+ } else {
695
+ var priorKey = undefined;
696
+
697
+ for (var key in context) {
698
+ if (context.hasOwnProperty(key)) {
699
+ // We're running the iterations one step out of sync so we can detect
700
+ // the last iteration without have to scan the object twice and create
701
+ // an itermediate keys array.
702
+ if (priorKey !== undefined) {
703
+ execIteration(priorKey, i - 1);
704
+ }
705
+ priorKey = key;
706
+ i++;
707
+ }
708
+ }
709
+ if (priorKey !== undefined) {
710
+ execIteration(priorKey, i - 1, true);
711
+ }
712
+ }
713
+ }
714
+
715
+ if (i === 0) {
716
+ ret = inverse(this);
717
+ }
718
+
719
+ return ret;
720
+ });
721
+ };
722
+
723
+ module.exports = exports['default'];
724
+
725
+ /***/ },
726
+ /* 10 */
727
+ /***/ function(module, exports, __webpack_require__) {
728
+
729
+ 'use strict';
730
+
731
+ var _interopRequireDefault = __webpack_require__(1)['default'];
732
+
733
+ exports.__esModule = true;
734
+
735
+ var _exception = __webpack_require__(6);
736
+
737
+ var _exception2 = _interopRequireDefault(_exception);
738
+
739
+ exports['default'] = function (instance) {
740
+ instance.registerHelper('helperMissing', function () /* [args, ]options */{
741
+ if (arguments.length === 1) {
742
+ // A missing field in a {{foo}} construct.
743
+ return undefined;
744
+ } else {
745
+ // Someone is actually trying to call something, blow up.
746
+ throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
747
+ }
748
+ });
749
+ };
750
+
751
+ module.exports = exports['default'];
752
+
753
+ /***/ },
754
+ /* 11 */
755
+ /***/ function(module, exports, __webpack_require__) {
756
+
757
+ 'use strict';
758
+
759
+ exports.__esModule = true;
760
+
761
+ var _utils = __webpack_require__(5);
762
+
763
+ exports['default'] = function (instance) {
764
+ instance.registerHelper('if', function (conditional, options) {
765
+ if (_utils.isFunction(conditional)) {
766
+ conditional = conditional.call(this);
767
+ }
768
+
769
+ // Default behavior is to render the positive path if the value is truthy and not empty.
770
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
771
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
772
+ if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
773
+ return options.inverse(this);
774
+ } else {
775
+ return options.fn(this);
776
+ }
777
+ });
778
+
779
+ instance.registerHelper('unless', function (conditional, options) {
780
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
781
+ });
782
+ };
783
+
784
+ module.exports = exports['default'];
785
+
786
+ /***/ },
787
+ /* 12 */
788
+ /***/ function(module, exports) {
789
+
790
+ 'use strict';
791
+
792
+ exports.__esModule = true;
793
+
794
+ exports['default'] = function (instance) {
795
+ instance.registerHelper('log', function () /* message, options */{
796
+ var args = [undefined],
797
+ options = arguments[arguments.length - 1];
798
+ for (var i = 0; i < arguments.length - 1; i++) {
799
+ args.push(arguments[i]);
800
+ }
801
+
802
+ var level = 1;
803
+ if (options.hash.level != null) {
804
+ level = options.hash.level;
805
+ } else if (options.data && options.data.level != null) {
806
+ level = options.data.level;
807
+ }
808
+ args[0] = level;
809
+
810
+ instance.log.apply(instance, args);
811
+ });
812
+ };
813
+
814
+ module.exports = exports['default'];
815
+
816
+ /***/ },
817
+ /* 13 */
818
+ /***/ function(module, exports) {
819
+
820
+ 'use strict';
821
+
822
+ exports.__esModule = true;
823
+
824
+ exports['default'] = function (instance) {
825
+ instance.registerHelper('lookup', function (obj, field) {
826
+ return obj && obj[field];
827
+ });
828
+ };
829
+
830
+ module.exports = exports['default'];
831
+
832
+ /***/ },
833
+ /* 14 */
834
+ /***/ function(module, exports, __webpack_require__) {
835
+
836
+ 'use strict';
837
+
838
+ exports.__esModule = true;
839
+
840
+ var _utils = __webpack_require__(5);
841
+
842
+ exports['default'] = function (instance) {
843
+ instance.registerHelper('with', function (context, options) {
844
+ if (_utils.isFunction(context)) {
845
+ context = context.call(this);
846
+ }
847
+
848
+ var fn = options.fn;
849
+
850
+ if (!_utils.isEmpty(context)) {
851
+ var data = options.data;
852
+ if (options.data && options.ids) {
853
+ data = _utils.createFrame(options.data);
854
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
855
+ }
856
+
857
+ return fn(context, {
858
+ data: data,
859
+ blockParams: _utils.blockParams([context], [data && data.contextPath])
860
+ });
861
+ } else {
862
+ return options.inverse(this);
863
+ }
864
+ });
865
+ };
866
+
867
+ module.exports = exports['default'];
868
+
869
+ /***/ },
870
+ /* 15 */
871
+ /***/ function(module, exports, __webpack_require__) {
872
+
873
+ 'use strict';
874
+
875
+ var _interopRequireDefault = __webpack_require__(1)['default'];
876
+
877
+ exports.__esModule = true;
878
+ exports.registerDefaultDecorators = registerDefaultDecorators;
879
+
880
+ var _decoratorsInline = __webpack_require__(16);
881
+
882
+ var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
883
+
884
+ function registerDefaultDecorators(instance) {
885
+ _decoratorsInline2['default'](instance);
886
+ }
887
+
888
+ /***/ },
889
+ /* 16 */
890
+ /***/ function(module, exports, __webpack_require__) {
891
+
892
+ 'use strict';
893
+
894
+ exports.__esModule = true;
895
+
896
+ var _utils = __webpack_require__(5);
897
+
898
+ exports['default'] = function (instance) {
899
+ instance.registerDecorator('inline', function (fn, props, container, options) {
900
+ var ret = fn;
901
+ if (!props.partials) {
902
+ props.partials = {};
903
+ ret = function (context, options) {
904
+ // Create a new partials stack frame prior to exec.
905
+ var original = container.partials;
906
+ container.partials = _utils.extend({}, original, props.partials);
907
+ var ret = fn(context, options);
908
+ container.partials = original;
909
+ return ret;
910
+ };
911
+ }
912
+
913
+ props.partials[options.args[0]] = options.fn;
914
+
915
+ return ret;
916
+ });
917
+ };
918
+
919
+ module.exports = exports['default'];
920
+
921
+ /***/ },
922
+ /* 17 */
923
+ /***/ function(module, exports, __webpack_require__) {
924
+
925
+ 'use strict';
926
+
927
+ exports.__esModule = true;
928
+
929
+ var _utils = __webpack_require__(5);
930
+
931
+ var logger = {
932
+ methodMap: ['debug', 'info', 'warn', 'error'],
933
+ level: 'info',
934
+
935
+ // Maps a given level value to the `methodMap` indexes above.
936
+ lookupLevel: function lookupLevel(level) {
937
+ if (typeof level === 'string') {
938
+ var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
939
+ if (levelMap >= 0) {
940
+ level = levelMap;
941
+ } else {
942
+ level = parseInt(level, 10);
943
+ }
944
+ }
945
+
946
+ return level;
947
+ },
948
+
949
+ // Can be overridden in the host environment
950
+ log: function log(level) {
951
+ level = logger.lookupLevel(level);
952
+
953
+ if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
954
+ var method = logger.methodMap[level];
955
+ if (!console[method]) {
956
+ // eslint-disable-line no-console
957
+ method = 'log';
958
+ }
959
+
960
+ for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
961
+ message[_key - 1] = arguments[_key];
962
+ }
963
+
964
+ console[method].apply(console, message); // eslint-disable-line no-console
965
+ }
966
+ }
967
+ };
968
+
969
+ exports['default'] = logger;
970
+ module.exports = exports['default'];
971
+
972
+ /***/ },
973
+ /* 18 */
974
+ /***/ function(module, exports) {
975
+
976
+ // Build out our basic SafeString type
977
+ 'use strict';
978
+
979
+ exports.__esModule = true;
980
+ function SafeString(string) {
981
+ this.string = string;
982
+ }
983
+
984
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
985
+ return '' + this.string;
986
+ };
987
+
988
+ exports['default'] = SafeString;
989
+ module.exports = exports['default'];
990
+
991
+ /***/ },
992
+ /* 19 */
993
+ /***/ function(module, exports, __webpack_require__) {
994
+
995
+ 'use strict';
996
+
997
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
998
+
999
+ var _interopRequireDefault = __webpack_require__(1)['default'];
1000
+
1001
+ exports.__esModule = true;
1002
+ exports.checkRevision = checkRevision;
1003
+ exports.template = template;
1004
+ exports.wrapProgram = wrapProgram;
1005
+ exports.resolvePartial = resolvePartial;
1006
+ exports.invokePartial = invokePartial;
1007
+ exports.noop = noop;
1008
+
1009
+ var _utils = __webpack_require__(5);
1010
+
1011
+ var Utils = _interopRequireWildcard(_utils);
1012
+
1013
+ var _exception = __webpack_require__(6);
1014
+
1015
+ var _exception2 = _interopRequireDefault(_exception);
1016
+
1017
+ var _base = __webpack_require__(4);
1018
+
1019
+ function checkRevision(compilerInfo) {
1020
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
1021
+ currentRevision = _base.COMPILER_REVISION;
1022
+
1023
+ if (compilerRevision !== currentRevision) {
1024
+ if (compilerRevision < currentRevision) {
1025
+ var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
1026
+ compilerVersions = _base.REVISION_CHANGES[compilerRevision];
1027
+ throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
1028
+ } else {
1029
+ // Use the embedded version info since the runtime doesn't know about this revision yet
1030
+ throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
1031
+ }
1032
+ }
1033
+ }
1034
+
1035
+ function template(templateSpec, env) {
1036
+ /* istanbul ignore next */
1037
+ if (!env) {
1038
+ throw new _exception2['default']('No environment passed to template');
1039
+ }
1040
+ if (!templateSpec || !templateSpec.main) {
1041
+ throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
1042
+ }
1043
+
1044
+ templateSpec.main.decorator = templateSpec.main_d;
1045
+
1046
+ // Note: Using env.VM references rather than local var references throughout this section to allow
1047
+ // for external users to override these as psuedo-supported APIs.
1048
+ env.VM.checkRevision(templateSpec.compiler);
1049
+
1050
+ function invokePartialWrapper(partial, context, options) {
1051
+ if (options.hash) {
1052
+ context = Utils.extend({}, context, options.hash);
1053
+ if (options.ids) {
1054
+ options.ids[0] = true;
1055
+ }
1056
+ }
1057
+
1058
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
1059
+ var result = env.VM.invokePartial.call(this, partial, context, options);
1060
+
1061
+ if (result == null && env.compile) {
1062
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1063
+ result = options.partials[options.name](context, options);
1064
+ }
1065
+ if (result != null) {
1066
+ if (options.indent) {
1067
+ var lines = result.split('\n');
1068
+ for (var i = 0, l = lines.length; i < l; i++) {
1069
+ if (!lines[i] && i + 1 === l) {
1070
+ break;
1071
+ }
1072
+
1073
+ lines[i] = options.indent + lines[i];
1074
+ }
1075
+ result = lines.join('\n');
1076
+ }
1077
+ return result;
1078
+ } else {
1079
+ throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1080
+ }
1081
+ }
1082
+
1083
+ // Just add water
1084
+ var container = {
1085
+ strict: function strict(obj, name) {
1086
+ if (!(name in obj)) {
1087
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1088
+ }
1089
+ return obj[name];
1090
+ },
1091
+ lookup: function lookup(depths, name) {
1092
+ var len = depths.length;
1093
+ for (var i = 0; i < len; i++) {
1094
+ if (depths[i] && depths[i][name] != null) {
1095
+ return depths[i][name];
1096
+ }
1097
+ }
1098
+ },
1099
+ lambda: function lambda(current, context) {
1100
+ return typeof current === 'function' ? current.call(context) : current;
1101
+ },
1102
+
1103
+ escapeExpression: Utils.escapeExpression,
1104
+ invokePartial: invokePartialWrapper,
1105
+
1106
+ fn: function fn(i) {
1107
+ var ret = templateSpec[i];
1108
+ ret.decorator = templateSpec[i + '_d'];
1109
+ return ret;
1110
+ },
1111
+
1112
+ programs: [],
1113
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
1114
+ var programWrapper = this.programs[i],
1115
+ fn = this.fn(i);
1116
+ if (data || depths || blockParams || declaredBlockParams) {
1117
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1118
+ } else if (!programWrapper) {
1119
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1120
+ }
1121
+ return programWrapper;
1122
+ },
1123
+
1124
+ data: function data(value, depth) {
1125
+ while (value && depth--) {
1126
+ value = value._parent;
1127
+ }
1128
+ return value;
1129
+ },
1130
+ merge: function merge(param, common) {
1131
+ var obj = param || common;
1132
+
1133
+ if (param && common && param !== common) {
1134
+ obj = Utils.extend({}, common, param);
1135
+ }
1136
+
1137
+ return obj;
1138
+ },
1139
+
1140
+ noop: env.VM.noop,
1141
+ compilerInfo: templateSpec.compiler
1142
+ };
1143
+
1144
+ function ret(context) {
1145
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1146
+
1147
+ var data = options.data;
1148
+
1149
+ ret._setup(options);
1150
+ if (!options.partial && templateSpec.useData) {
1151
+ data = initData(context, data);
1152
+ }
1153
+ var depths = undefined,
1154
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
1155
+ if (templateSpec.useDepths) {
1156
+ if (options.depths) {
1157
+ depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths;
1158
+ } else {
1159
+ depths = [context];
1160
+ }
1161
+ }
1162
+
1163
+ function main(context /*, options*/) {
1164
+ return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1165
+ }
1166
+ main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1167
+ return main(context, options);
1168
+ }
1169
+ ret.isTop = true;
1170
+
1171
+ ret._setup = function (options) {
1172
+ if (!options.partial) {
1173
+ container.helpers = container.merge(options.helpers, env.helpers);
1174
+
1175
+ if (templateSpec.usePartial) {
1176
+ container.partials = container.merge(options.partials, env.partials);
1177
+ }
1178
+ if (templateSpec.usePartial || templateSpec.useDecorators) {
1179
+ container.decorators = container.merge(options.decorators, env.decorators);
1180
+ }
1181
+ } else {
1182
+ container.helpers = options.helpers;
1183
+ container.partials = options.partials;
1184
+ container.decorators = options.decorators;
1185
+ }
1186
+ };
1187
+
1188
+ ret._child = function (i, data, blockParams, depths) {
1189
+ if (templateSpec.useBlockParams && !blockParams) {
1190
+ throw new _exception2['default']('must pass block params');
1191
+ }
1192
+ if (templateSpec.useDepths && !depths) {
1193
+ throw new _exception2['default']('must pass parent depths');
1194
+ }
1195
+
1196
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1197
+ };
1198
+ return ret;
1199
+ }
1200
+
1201
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1202
+ function prog(context) {
1203
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1204
+
1205
+ var currentDepths = depths;
1206
+ if (depths && context !== depths[0]) {
1207
+ currentDepths = [context].concat(depths);
1208
+ }
1209
+
1210
+ return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1211
+ }
1212
+
1213
+ prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1214
+
1215
+ prog.program = i;
1216
+ prog.depth = depths ? depths.length : 0;
1217
+ prog.blockParams = declaredBlockParams || 0;
1218
+ return prog;
1219
+ }
1220
+
1221
+ function resolvePartial(partial, context, options) {
1222
+ if (!partial) {
1223
+ if (options.name === '@partial-block') {
1224
+ partial = options.data['partial-block'];
1225
+ } else {
1226
+ partial = options.partials[options.name];
1227
+ }
1228
+ } else if (!partial.call && !options.name) {
1229
+ // This is a dynamic partial that returned a string
1230
+ options.name = partial;
1231
+ partial = options.partials[partial];
1232
+ }
1233
+ return partial;
1234
+ }
1235
+
1236
+ function invokePartial(partial, context, options) {
1237
+ options.partial = true;
1238
+ if (options.ids) {
1239
+ options.data.contextPath = options.ids[0] || options.data.contextPath;
1240
+ }
1241
+
1242
+ var partialBlock = undefined;
1243
+ if (options.fn && options.fn !== noop) {
1244
+ options.data = _base.createFrame(options.data);
1245
+ partialBlock = options.data['partial-block'] = options.fn;
1246
+
1247
+ if (partialBlock.partials) {
1248
+ options.partials = Utils.extend({}, options.partials, partialBlock.partials);
1249
+ }
1250
+ }
1251
+
1252
+ if (partial === undefined && partialBlock) {
1253
+ partial = partialBlock;
1254
+ }
1255
+
1256
+ if (partial === undefined) {
1257
+ throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1258
+ } else if (partial instanceof Function) {
1259
+ return partial(context, options);
1260
+ }
1261
+ }
1262
+
1263
+ function noop() {
1264
+ return '';
1265
+ }
1266
+
1267
+ function initData(context, data) {
1268
+ if (!data || !('root' in data)) {
1269
+ data = data ? _base.createFrame(data) : {};
1270
+ data.root = context;
1271
+ }
1272
+ return data;
1273
+ }
1274
+
1275
+ function executeDecorators(fn, prog, container, depths, data, blockParams) {
1276
+ if (fn.decorator) {
1277
+ var props = {};
1278
+ prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1279
+ Utils.extend(prog, props);
1280
+ }
1281
+ return prog;
1282
+ }
1283
+
1284
+ /***/ },
1285
+ /* 20 */
1286
+ /***/ function(module, exports) {
1287
+
1288
+ /* WEBPACK VAR INJECTION */(function(global) {/* global window */
1289
+ 'use strict';
1290
+
1291
+ exports.__esModule = true;
1292
+
1293
+ exports['default'] = function (Handlebars) {
1294
+ /* istanbul ignore next */
1295
+ var root = typeof global !== 'undefined' ? global : window,
1296
+ $Handlebars = root.Handlebars;
1297
+ /* istanbul ignore next */
1298
+ Handlebars.noConflict = function () {
1299
+ if (root.Handlebars === Handlebars) {
1300
+ root.Handlebars = $Handlebars;
1301
+ }
1302
+ return Handlebars;
1303
+ };
1304
+ };
1305
+
1306
+ module.exports = exports['default'];
1307
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1308
+
1309
+ /***/ },
1310
+ /* 21 */
1311
+ /***/ function(module, exports) {
1312
+
1313
+ 'use strict';
1314
+
1315
+ exports.__esModule = true;
1316
+ var AST = {
1317
+ // Public API used to evaluate derived attributes regarding AST nodes
1318
+ helpers: {
1319
+ // a mustache is definitely a helper if:
1320
+ // * it is an eligible helper, and
1321
+ // * it has at least one parameter or hash segment
1322
+ helperExpression: function helperExpression(node) {
1323
+ return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
1324
+ },
1325
+
1326
+ scopedId: function scopedId(path) {
1327
+ return (/^\.|this\b/.test(path.original)
1328
+ );
1329
+ },
1330
+
1331
+ // an ID is simple if it only has one part, and that part is not
1332
+ // `..` or `this`.
1333
+ simpleId: function simpleId(path) {
1334
+ return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
1335
+ }
1336
+ }
1337
+ };
1338
+
1339
+ // Must be exported as an object rather than the root of the module as the jison lexer
1340
+ // must modify the object to operate properly.
1341
+ exports['default'] = AST;
1342
+ module.exports = exports['default'];
1343
+
1344
+ /***/ },
1345
+ /* 22 */
1346
+ /***/ function(module, exports, __webpack_require__) {
1347
+
1348
+ 'use strict';
1349
+
1350
+ var _interopRequireDefault = __webpack_require__(1)['default'];
1351
+
1352
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
1353
+
1354
+ exports.__esModule = true;
1355
+ exports.parse = parse;
1356
+
1357
+ var _parser = __webpack_require__(23);
1358
+
1359
+ var _parser2 = _interopRequireDefault(_parser);
1360
+
1361
+ var _whitespaceControl = __webpack_require__(24);
1362
+
1363
+ var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
1364
+
1365
+ var _helpers = __webpack_require__(26);
1366
+
1367
+ var Helpers = _interopRequireWildcard(_helpers);
1368
+
1369
+ var _utils = __webpack_require__(5);
1370
+
1371
+ exports.parser = _parser2['default'];
1372
+
1373
+ var yy = {};
1374
+ _utils.extend(yy, Helpers);
1375
+
1376
+ function parse(input, options) {
1377
+ // Just return if an already-compiled AST was passed in.
1378
+ if (input.type === 'Program') {
1379
+ return input;
1380
+ }
1381
+
1382
+ _parser2['default'].yy = yy;
1383
+
1384
+ // Altering the shared object here, but this is ok as parser is a sync operation
1385
+ yy.locInfo = function (locInfo) {
1386
+ return new yy.SourceLocation(options && options.srcName, locInfo);
1387
+ };
1388
+
1389
+ var strip = new _whitespaceControl2['default'](options);
1390
+ return strip.accept(_parser2['default'].parse(input));
1391
+ }
1392
+
1393
+ /***/ },
1394
+ /* 23 */
1395
+ /***/ function(module, exports) {
1396
+
1397
+ /* istanbul ignore next */
1398
+ /* Jison generated parser */
1399
+ "use strict";
1400
+
1401
+ var handlebars = (function () {
1402
+ var parser = { trace: function trace() {},
1403
+ yy: {},
1404
+ symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
1405
+ terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
1406
+ productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
1407
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
1408
+ /**/) {
1409
+
1410
+ var $0 = $$.length - 1;
1411
+ switch (yystate) {
1412
+ case 1:
1413
+ return $$[$0 - 1];
1414
+ break;
1415
+ case 2:
1416
+ this.$ = yy.prepareProgram($$[$0]);
1417
+ break;
1418
+ case 3:
1419
+ this.$ = $$[$0];
1420
+ break;
1421
+ case 4:
1422
+ this.$ = $$[$0];
1423
+ break;
1424
+ case 5:
1425
+ this.$ = $$[$0];
1426
+ break;
1427
+ case 6:
1428
+ this.$ = $$[$0];
1429
+ break;
1430
+ case 7:
1431
+ this.$ = $$[$0];
1432
+ break;
1433
+ case 8:
1434
+ this.$ = $$[$0];
1435
+ break;
1436
+ case 9:
1437
+ this.$ = {
1438
+ type: 'CommentStatement',
1439
+ value: yy.stripComment($$[$0]),
1440
+ strip: yy.stripFlags($$[$0], $$[$0]),
1441
+ loc: yy.locInfo(this._$)
1442
+ };
1443
+
1444
+ break;
1445
+ case 10:
1446
+ this.$ = {
1447
+ type: 'ContentStatement',
1448
+ original: $$[$0],
1449
+ value: $$[$0],
1450
+ loc: yy.locInfo(this._$)
1451
+ };
1452
+
1453
+ break;
1454
+ case 11:
1455
+ this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1456
+ break;
1457
+ case 12:
1458
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
1459
+ break;
1460
+ case 13:
1461
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
1462
+ break;
1463
+ case 14:
1464
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
1465
+ break;
1466
+ case 15:
1467
+ this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1468
+ break;
1469
+ case 16:
1470
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1471
+ break;
1472
+ case 17:
1473
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1474
+ break;
1475
+ case 18:
1476
+ this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
1477
+ break;
1478
+ case 19:
1479
+ var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
1480
+ program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
1481
+ program.chained = true;
1482
+
1483
+ this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
1484
+
1485
+ break;
1486
+ case 20:
1487
+ this.$ = $$[$0];
1488
+ break;
1489
+ case 21:
1490
+ this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
1491
+ break;
1492
+ case 22:
1493
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1494
+ break;
1495
+ case 23:
1496
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1497
+ break;
1498
+ case 24:
1499
+ this.$ = {
1500
+ type: 'PartialStatement',
1501
+ name: $$[$0 - 3],
1502
+ params: $$[$0 - 2],
1503
+ hash: $$[$0 - 1],
1504
+ indent: '',
1505
+ strip: yy.stripFlags($$[$0 - 4], $$[$0]),
1506
+ loc: yy.locInfo(this._$)
1507
+ };
1508
+
1509
+ break;
1510
+ case 25:
1511
+ this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1512
+ break;
1513
+ case 26:
1514
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
1515
+ break;
1516
+ case 27:
1517
+ this.$ = $$[$0];
1518
+ break;
1519
+ case 28:
1520
+ this.$ = $$[$0];
1521
+ break;
1522
+ case 29:
1523
+ this.$ = {
1524
+ type: 'SubExpression',
1525
+ path: $$[$0 - 3],
1526
+ params: $$[$0 - 2],
1527
+ hash: $$[$0 - 1],
1528
+ loc: yy.locInfo(this._$)
1529
+ };
1530
+
1531
+ break;
1532
+ case 30:
1533
+ this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
1534
+ break;
1535
+ case 31:
1536
+ this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
1537
+ break;
1538
+ case 32:
1539
+ this.$ = yy.id($$[$0 - 1]);
1540
+ break;
1541
+ case 33:
1542
+ this.$ = $$[$0];
1543
+ break;
1544
+ case 34:
1545
+ this.$ = $$[$0];
1546
+ break;
1547
+ case 35:
1548
+ this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
1549
+ break;
1550
+ case 36:
1551
+ this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
1552
+ break;
1553
+ case 37:
1554
+ this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
1555
+ break;
1556
+ case 38:
1557
+ this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
1558
+ break;
1559
+ case 39:
1560
+ this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
1561
+ break;
1562
+ case 40:
1563
+ this.$ = $$[$0];
1564
+ break;
1565
+ case 41:
1566
+ this.$ = $$[$0];
1567
+ break;
1568
+ case 42:
1569
+ this.$ = yy.preparePath(true, $$[$0], this._$);
1570
+ break;
1571
+ case 43:
1572
+ this.$ = yy.preparePath(false, $$[$0], this._$);
1573
+ break;
1574
+ case 44:
1575
+ $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
1576
+ break;
1577
+ case 45:
1578
+ this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
1579
+ break;
1580
+ case 46:
1581
+ this.$ = [];
1582
+ break;
1583
+ case 47:
1584
+ $$[$0 - 1].push($$[$0]);
1585
+ break;
1586
+ case 48:
1587
+ this.$ = [$$[$0]];
1588
+ break;
1589
+ case 49:
1590
+ $$[$0 - 1].push($$[$0]);
1591
+ break;
1592
+ case 50:
1593
+ this.$ = [];
1594
+ break;
1595
+ case 51:
1596
+ $$[$0 - 1].push($$[$0]);
1597
+ break;
1598
+ case 58:
1599
+ this.$ = [];
1600
+ break;
1601
+ case 59:
1602
+ $$[$0 - 1].push($$[$0]);
1603
+ break;
1604
+ case 64:
1605
+ this.$ = [];
1606
+ break;
1607
+ case 65:
1608
+ $$[$0 - 1].push($$[$0]);
1609
+ break;
1610
+ case 70:
1611
+ this.$ = [];
1612
+ break;
1613
+ case 71:
1614
+ $$[$0 - 1].push($$[$0]);
1615
+ break;
1616
+ case 78:
1617
+ this.$ = [];
1618
+ break;
1619
+ case 79:
1620
+ $$[$0 - 1].push($$[$0]);
1621
+ break;
1622
+ case 82:
1623
+ this.$ = [];
1624
+ break;
1625
+ case 83:
1626
+ $$[$0 - 1].push($$[$0]);
1627
+ break;
1628
+ case 86:
1629
+ this.$ = [];
1630
+ break;
1631
+ case 87:
1632
+ $$[$0 - 1].push($$[$0]);
1633
+ break;
1634
+ case 90:
1635
+ this.$ = [];
1636
+ break;
1637
+ case 91:
1638
+ $$[$0 - 1].push($$[$0]);
1639
+ break;
1640
+ case 94:
1641
+ this.$ = [];
1642
+ break;
1643
+ case 95:
1644
+ $$[$0 - 1].push($$[$0]);
1645
+ break;
1646
+ case 98:
1647
+ this.$ = [$$[$0]];
1648
+ break;
1649
+ case 99:
1650
+ $$[$0 - 1].push($$[$0]);
1651
+ break;
1652
+ case 100:
1653
+ this.$ = [$$[$0]];
1654
+ break;
1655
+ case 101:
1656
+ $$[$0 - 1].push($$[$0]);
1657
+ break;
1658
+ }
1659
+ },
1660
+ table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
1661
+ defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
1662
+ parseError: function parseError(str, hash) {
1663
+ throw new Error(str);
1664
+ },
1665
+ parse: function parse(input) {
1666
+ var self = this,
1667
+ stack = [0],
1668
+ vstack = [null],
1669
+ lstack = [],
1670
+ table = this.table,
1671
+ yytext = "",
1672
+ yylineno = 0,
1673
+ yyleng = 0,
1674
+ recovering = 0,
1675
+ TERROR = 2,
1676
+ EOF = 1;
1677
+ this.lexer.setInput(input);
1678
+ this.lexer.yy = this.yy;
1679
+ this.yy.lexer = this.lexer;
1680
+ this.yy.parser = this;
1681
+ if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
1682
+ var yyloc = this.lexer.yylloc;
1683
+ lstack.push(yyloc);
1684
+ var ranges = this.lexer.options && this.lexer.options.ranges;
1685
+ if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
1686
+ function popStack(n) {
1687
+ stack.length = stack.length - 2 * n;
1688
+ vstack.length = vstack.length - n;
1689
+ lstack.length = lstack.length - n;
1690
+ }
1691
+ function lex() {
1692
+ var token;
1693
+ token = self.lexer.lex() || 1;
1694
+ if (typeof token !== "number") {
1695
+ token = self.symbols_[token] || token;
1696
+ }
1697
+ return token;
1698
+ }
1699
+ var symbol,
1700
+ preErrorSymbol,
1701
+ state,
1702
+ action,
1703
+ a,
1704
+ r,
1705
+ yyval = {},
1706
+ p,
1707
+ len,
1708
+ newState,
1709
+ expected;
1710
+ while (true) {
1711
+ state = stack[stack.length - 1];
1712
+ if (this.defaultActions[state]) {
1713
+ action = this.defaultActions[state];
1714
+ } else {
1715
+ if (symbol === null || typeof symbol == "undefined") {
1716
+ symbol = lex();
1717
+ }
1718
+ action = table[state] && table[state][symbol];
1719
+ }
1720
+ if (typeof action === "undefined" || !action.length || !action[0]) {
1721
+ var errStr = "";
1722
+ if (!recovering) {
1723
+ expected = [];
1724
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
1725
+ expected.push("'" + this.terminals_[p] + "'");
1726
+ }
1727
+ if (this.lexer.showPosition) {
1728
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1729
+ } else {
1730
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1731
+ }
1732
+ this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
1733
+ }
1734
+ }
1735
+ if (action[0] instanceof Array && action.length > 1) {
1736
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1737
+ }
1738
+ switch (action[0]) {
1739
+ case 1:
1740
+ stack.push(symbol);
1741
+ vstack.push(this.lexer.yytext);
1742
+ lstack.push(this.lexer.yylloc);
1743
+ stack.push(action[1]);
1744
+ symbol = null;
1745
+ if (!preErrorSymbol) {
1746
+ yyleng = this.lexer.yyleng;
1747
+ yytext = this.lexer.yytext;
1748
+ yylineno = this.lexer.yylineno;
1749
+ yyloc = this.lexer.yylloc;
1750
+ if (recovering > 0) recovering--;
1751
+ } else {
1752
+ symbol = preErrorSymbol;
1753
+ preErrorSymbol = null;
1754
+ }
1755
+ break;
1756
+ case 2:
1757
+ len = this.productions_[action[1]][1];
1758
+ yyval.$ = vstack[vstack.length - len];
1759
+ yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
1760
+ if (ranges) {
1761
+ yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1762
+ }
1763
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
1764
+ if (typeof r !== "undefined") {
1765
+ return r;
1766
+ }
1767
+ if (len) {
1768
+ stack = stack.slice(0, -1 * len * 2);
1769
+ vstack = vstack.slice(0, -1 * len);
1770
+ lstack = lstack.slice(0, -1 * len);
1771
+ }
1772
+ stack.push(this.productions_[action[1]][0]);
1773
+ vstack.push(yyval.$);
1774
+ lstack.push(yyval._$);
1775
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1776
+ stack.push(newState);
1777
+ break;
1778
+ case 3:
1779
+ return true;
1780
+ }
1781
+ }
1782
+ return true;
1783
+ }
1784
+ };
1785
+ /* Jison generated lexer */
1786
+ var lexer = (function () {
1787
+ var lexer = { EOF: 1,
1788
+ parseError: function parseError(str, hash) {
1789
+ if (this.yy.parser) {
1790
+ this.yy.parser.parseError(str, hash);
1791
+ } else {
1792
+ throw new Error(str);
1793
+ }
1794
+ },
1795
+ setInput: function setInput(input) {
1796
+ this._input = input;
1797
+ this._more = this._less = this.done = false;
1798
+ this.yylineno = this.yyleng = 0;
1799
+ this.yytext = this.matched = this.match = '';
1800
+ this.conditionStack = ['INITIAL'];
1801
+ this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
1802
+ if (this.options.ranges) this.yylloc.range = [0, 0];
1803
+ this.offset = 0;
1804
+ return this;
1805
+ },
1806
+ input: function input() {
1807
+ var ch = this._input[0];
1808
+ this.yytext += ch;
1809
+ this.yyleng++;
1810
+ this.offset++;
1811
+ this.match += ch;
1812
+ this.matched += ch;
1813
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
1814
+ if (lines) {
1815
+ this.yylineno++;
1816
+ this.yylloc.last_line++;
1817
+ } else {
1818
+ this.yylloc.last_column++;
1819
+ }
1820
+ if (this.options.ranges) this.yylloc.range[1]++;
1821
+
1822
+ this._input = this._input.slice(1);
1823
+ return ch;
1824
+ },
1825
+ unput: function unput(ch) {
1826
+ var len = ch.length;
1827
+ var lines = ch.split(/(?:\r\n?|\n)/g);
1828
+
1829
+ this._input = ch + this._input;
1830
+ this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
1831
+ //this.yyleng -= len;
1832
+ this.offset -= len;
1833
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1834
+ this.match = this.match.substr(0, this.match.length - 1);
1835
+ this.matched = this.matched.substr(0, this.matched.length - 1);
1836
+
1837
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
1838
+ var r = this.yylloc.range;
1839
+
1840
+ this.yylloc = { first_line: this.yylloc.first_line,
1841
+ last_line: this.yylineno + 1,
1842
+ first_column: this.yylloc.first_column,
1843
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
1844
+ };
1845
+
1846
+ if (this.options.ranges) {
1847
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1848
+ }
1849
+ return this;
1850
+ },
1851
+ more: function more() {
1852
+ this._more = true;
1853
+ return this;
1854
+ },
1855
+ less: function less(n) {
1856
+ this.unput(this.match.slice(n));
1857
+ },
1858
+ pastInput: function pastInput() {
1859
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
1860
+ return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
1861
+ },
1862
+ upcomingInput: function upcomingInput() {
1863
+ var next = this.match;
1864
+ if (next.length < 20) {
1865
+ next += this._input.substr(0, 20 - next.length);
1866
+ }
1867
+ return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1868
+ },
1869
+ showPosition: function showPosition() {
1870
+ var pre = this.pastInput();
1871
+ var c = new Array(pre.length + 1).join("-");
1872
+ return pre + this.upcomingInput() + "\n" + c + "^";
1873
+ },
1874
+ next: function next() {
1875
+ if (this.done) {
1876
+ return this.EOF;
1877
+ }
1878
+ if (!this._input) this.done = true;
1879
+
1880
+ var token, match, tempMatch, index, col, lines;
1881
+ if (!this._more) {
1882
+ this.yytext = '';
1883
+ this.match = '';
1884
+ }
1885
+ var rules = this._currentRules();
1886
+ for (var i = 0; i < rules.length; i++) {
1887
+ tempMatch = this._input.match(this.rules[rules[i]]);
1888
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1889
+ match = tempMatch;
1890
+ index = i;
1891
+ if (!this.options.flex) break;
1892
+ }
1893
+ }
1894
+ if (match) {
1895
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
1896
+ if (lines) this.yylineno += lines.length;
1897
+ this.yylloc = { first_line: this.yylloc.last_line,
1898
+ last_line: this.yylineno + 1,
1899
+ first_column: this.yylloc.last_column,
1900
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
1901
+ this.yytext += match[0];
1902
+ this.match += match[0];
1903
+ this.matches = match;
1904
+ this.yyleng = this.yytext.length;
1905
+ if (this.options.ranges) {
1906
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
1907
+ }
1908
+ this._more = false;
1909
+ this._input = this._input.slice(match[0].length);
1910
+ this.matched += match[0];
1911
+ token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
1912
+ if (this.done && this._input) this.done = false;
1913
+ if (token) return token;else return;
1914
+ }
1915
+ if (this._input === "") {
1916
+ return this.EOF;
1917
+ } else {
1918
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
1919
+ }
1920
+ },
1921
+ lex: function lex() {
1922
+ var r = this.next();
1923
+ if (typeof r !== 'undefined') {
1924
+ return r;
1925
+ } else {
1926
+ return this.lex();
1927
+ }
1928
+ },
1929
+ begin: function begin(condition) {
1930
+ this.conditionStack.push(condition);
1931
+ },
1932
+ popState: function popState() {
1933
+ return this.conditionStack.pop();
1934
+ },
1935
+ _currentRules: function _currentRules() {
1936
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1937
+ },
1938
+ topState: function topState() {
1939
+ return this.conditionStack[this.conditionStack.length - 2];
1940
+ },
1941
+ pushState: function begin(condition) {
1942
+ this.begin(condition);
1943
+ } };
1944
+ lexer.options = {};
1945
+ lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
1946
+ /**/) {
1947
+
1948
+ function strip(start, end) {
1949
+ return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
1950
+ }
1951
+
1952
+ var YYSTATE = YY_START;
1953
+ switch ($avoiding_name_collisions) {
1954
+ case 0:
1955
+ if (yy_.yytext.slice(-2) === "\\\\") {
1956
+ strip(0, 1);
1957
+ this.begin("mu");
1958
+ } else if (yy_.yytext.slice(-1) === "\\") {
1959
+ strip(0, 1);
1960
+ this.begin("emu");
1961
+ } else {
1962
+ this.begin("mu");
1963
+ }
1964
+ if (yy_.yytext) return 15;
1965
+
1966
+ break;
1967
+ case 1:
1968
+ return 15;
1969
+ break;
1970
+ case 2:
1971
+ this.popState();
1972
+ return 15;
1973
+
1974
+ break;
1975
+ case 3:
1976
+ this.begin('raw');return 15;
1977
+ break;
1978
+ case 4:
1979
+ this.popState();
1980
+ // Should be using `this.topState()` below, but it currently
1981
+ // returns the second top instead of the first top. Opened an
1982
+ // issue about it at https://github.com/zaach/jison/issues/291
1983
+ if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
1984
+ return 15;
1985
+ } else {
1986
+ yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
1987
+ return 'END_RAW_BLOCK';
1988
+ }
1989
+
1990
+ break;
1991
+ case 5:
1992
+ return 15;
1993
+ break;
1994
+ case 6:
1995
+ this.popState();
1996
+ return 14;
1997
+
1998
+ break;
1999
+ case 7:
2000
+ return 65;
2001
+ break;
2002
+ case 8:
2003
+ return 68;
2004
+ break;
2005
+ case 9:
2006
+ return 19;
2007
+ break;
2008
+ case 10:
2009
+ this.popState();
2010
+ this.begin('raw');
2011
+ return 23;
2012
+
2013
+ break;
2014
+ case 11:
2015
+ return 55;
2016
+ break;
2017
+ case 12:
2018
+ return 60;
2019
+ break;
2020
+ case 13:
2021
+ return 29;
2022
+ break;
2023
+ case 14:
2024
+ return 47;
2025
+ break;
2026
+ case 15:
2027
+ this.popState();return 44;
2028
+ break;
2029
+ case 16:
2030
+ this.popState();return 44;
2031
+ break;
2032
+ case 17:
2033
+ return 34;
2034
+ break;
2035
+ case 18:
2036
+ return 39;
2037
+ break;
2038
+ case 19:
2039
+ return 51;
2040
+ break;
2041
+ case 20:
2042
+ return 48;
2043
+ break;
2044
+ case 21:
2045
+ this.unput(yy_.yytext);
2046
+ this.popState();
2047
+ this.begin('com');
2048
+
2049
+ break;
2050
+ case 22:
2051
+ this.popState();
2052
+ return 14;
2053
+
2054
+ break;
2055
+ case 23:
2056
+ return 48;
2057
+ break;
2058
+ case 24:
2059
+ return 73;
2060
+ break;
2061
+ case 25:
2062
+ return 72;
2063
+ break;
2064
+ case 26:
2065
+ return 72;
2066
+ break;
2067
+ case 27:
2068
+ return 87;
2069
+ break;
2070
+ case 28:
2071
+ // ignore whitespace
2072
+ break;
2073
+ case 29:
2074
+ this.popState();return 54;
2075
+ break;
2076
+ case 30:
2077
+ this.popState();return 33;
2078
+ break;
2079
+ case 31:
2080
+ yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
2081
+ break;
2082
+ case 32:
2083
+ yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
2084
+ break;
2085
+ case 33:
2086
+ return 85;
2087
+ break;
2088
+ case 34:
2089
+ return 82;
2090
+ break;
2091
+ case 35:
2092
+ return 82;
2093
+ break;
2094
+ case 36:
2095
+ return 83;
2096
+ break;
2097
+ case 37:
2098
+ return 84;
2099
+ break;
2100
+ case 38:
2101
+ return 81;
2102
+ break;
2103
+ case 39:
2104
+ return 75;
2105
+ break;
2106
+ case 40:
2107
+ return 77;
2108
+ break;
2109
+ case 41:
2110
+ return 72;
2111
+ break;
2112
+ case 42:
2113
+ yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
2114
+ break;
2115
+ case 43:
2116
+ return 'INVALID';
2117
+ break;
2118
+ case 44:
2119
+ return 5;
2120
+ break;
2121
+ }
2122
+ };
2123
+ lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2124
+ lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
2125
+ return lexer;
2126
+ })();
2127
+ parser.lexer = lexer;
2128
+ function Parser() {
2129
+ this.yy = {};
2130
+ }Parser.prototype = parser;parser.Parser = Parser;
2131
+ return new Parser();
2132
+ })();exports.__esModule = true;
2133
+ exports['default'] = handlebars;
2134
+
2135
+ /***/ },
2136
+ /* 24 */
2137
+ /***/ function(module, exports, __webpack_require__) {
2138
+
2139
+ 'use strict';
2140
+
2141
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2142
+
2143
+ exports.__esModule = true;
2144
+
2145
+ var _visitor = __webpack_require__(25);
2146
+
2147
+ var _visitor2 = _interopRequireDefault(_visitor);
2148
+
2149
+ function WhitespaceControl() {
2150
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
2151
+
2152
+ this.options = options;
2153
+ }
2154
+ WhitespaceControl.prototype = new _visitor2['default']();
2155
+
2156
+ WhitespaceControl.prototype.Program = function (program) {
2157
+ var doStandalone = !this.options.ignoreStandalone;
2158
+
2159
+ var isRoot = !this.isRootSeen;
2160
+ this.isRootSeen = true;
2161
+
2162
+ var body = program.body;
2163
+ for (var i = 0, l = body.length; i < l; i++) {
2164
+ var current = body[i],
2165
+ strip = this.accept(current);
2166
+
2167
+ if (!strip) {
2168
+ continue;
2169
+ }
2170
+
2171
+ var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
2172
+ _isNextWhitespace = isNextWhitespace(body, i, isRoot),
2173
+ openStandalone = strip.openStandalone && _isPrevWhitespace,
2174
+ closeStandalone = strip.closeStandalone && _isNextWhitespace,
2175
+ inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
2176
+
2177
+ if (strip.close) {
2178
+ omitRight(body, i, true);
2179
+ }
2180
+ if (strip.open) {
2181
+ omitLeft(body, i, true);
2182
+ }
2183
+
2184
+ if (doStandalone && inlineStandalone) {
2185
+ omitRight(body, i);
2186
+
2187
+ if (omitLeft(body, i)) {
2188
+ // If we are on a standalone node, save the indent info for partials
2189
+ if (current.type === 'PartialStatement') {
2190
+ // Pull out the whitespace from the final line
2191
+ current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2192
+ }
2193
+ }
2194
+ }
2195
+ if (doStandalone && openStandalone) {
2196
+ omitRight((current.program || current.inverse).body);
2197
+
2198
+ // Strip out the previous content node if it's whitespace only
2199
+ omitLeft(body, i);
2200
+ }
2201
+ if (doStandalone && closeStandalone) {
2202
+ // Always strip the next node
2203
+ omitRight(body, i);
2204
+
2205
+ omitLeft((current.inverse || current.program).body);
2206
+ }
2207
+ }
2208
+
2209
+ return program;
2210
+ };
2211
+
2212
+ WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
2213
+ this.accept(block.program);
2214
+ this.accept(block.inverse);
2215
+
2216
+ // Find the inverse program that is involed with whitespace stripping.
2217
+ var program = block.program || block.inverse,
2218
+ inverse = block.program && block.inverse,
2219
+ firstInverse = inverse,
2220
+ lastInverse = inverse;
2221
+
2222
+ if (inverse && inverse.chained) {
2223
+ firstInverse = inverse.body[0].program;
2224
+
2225
+ // Walk the inverse chain to find the last inverse that is actually in the chain.
2226
+ while (lastInverse.chained) {
2227
+ lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
2228
+ }
2229
+ }
2230
+
2231
+ var strip = {
2232
+ open: block.openStrip.open,
2233
+ close: block.closeStrip.close,
2234
+
2235
+ // Determine the standalone candiacy. Basically flag our content as being possibly standalone
2236
+ // so our parent can determine if we actually are standalone
2237
+ openStandalone: isNextWhitespace(program.body),
2238
+ closeStandalone: isPrevWhitespace((firstInverse || program).body)
2239
+ };
2240
+
2241
+ if (block.openStrip.close) {
2242
+ omitRight(program.body, null, true);
2243
+ }
2244
+
2245
+ if (inverse) {
2246
+ var inverseStrip = block.inverseStrip;
2247
+
2248
+ if (inverseStrip.open) {
2249
+ omitLeft(program.body, null, true);
2250
+ }
2251
+
2252
+ if (inverseStrip.close) {
2253
+ omitRight(firstInverse.body, null, true);
2254
+ }
2255
+ if (block.closeStrip.open) {
2256
+ omitLeft(lastInverse.body, null, true);
2257
+ }
2258
+
2259
+ // Find standalone else statments
2260
+ if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
2261
+ omitLeft(program.body);
2262
+ omitRight(firstInverse.body);
2263
+ }
2264
+ } else if (block.closeStrip.open) {
2265
+ omitLeft(program.body, null, true);
2266
+ }
2267
+
2268
+ return strip;
2269
+ };
2270
+
2271
+ WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
2272
+ return mustache.strip;
2273
+ };
2274
+
2275
+ WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
2276
+ /* istanbul ignore next */
2277
+ var strip = node.strip || {};
2278
+ return {
2279
+ inlineStandalone: true,
2280
+ open: strip.open,
2281
+ close: strip.close
2282
+ };
2283
+ };
2284
+
2285
+ function isPrevWhitespace(body, i, isRoot) {
2286
+ if (i === undefined) {
2287
+ i = body.length;
2288
+ }
2289
+
2290
+ // Nodes that end with newlines are considered whitespace (but are special
2291
+ // cased for strip operations)
2292
+ var prev = body[i - 1],
2293
+ sibling = body[i - 2];
2294
+ if (!prev) {
2295
+ return isRoot;
2296
+ }
2297
+
2298
+ if (prev.type === 'ContentStatement') {
2299
+ return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2300
+ }
2301
+ }
2302
+ function isNextWhitespace(body, i, isRoot) {
2303
+ if (i === undefined) {
2304
+ i = -1;
2305
+ }
2306
+
2307
+ var next = body[i + 1],
2308
+ sibling = body[i + 2];
2309
+ if (!next) {
2310
+ return isRoot;
2311
+ }
2312
+
2313
+ if (next.type === 'ContentStatement') {
2314
+ return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
2315
+ }
2316
+ }
2317
+
2318
+ // Marks the node to the right of the position as omitted.
2319
+ // I.e. {{foo}}' ' will mark the ' ' node as omitted.
2320
+ //
2321
+ // If i is undefined, then the first child will be marked as such.
2322
+ //
2323
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2324
+ // content is met.
2325
+ function omitRight(body, i, multiple) {
2326
+ var current = body[i == null ? 0 : i + 1];
2327
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
2328
+ return;
2329
+ }
2330
+
2331
+ var original = current.value;
2332
+ current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
2333
+ current.rightStripped = current.value !== original;
2334
+ }
2335
+
2336
+ // Marks the node to the left of the position as omitted.
2337
+ // I.e. ' '{{foo}} will mark the ' ' node as omitted.
2338
+ //
2339
+ // If i is undefined then the last child will be marked as such.
2340
+ //
2341
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2342
+ // content is met.
2343
+ function omitLeft(body, i, multiple) {
2344
+ var current = body[i == null ? body.length - 1 : i - 1];
2345
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
2346
+ return;
2347
+ }
2348
+
2349
+ // We omit the last node if it's whitespace only and not preceeded by a non-content node.
2350
+ var original = current.value;
2351
+ current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
2352
+ current.leftStripped = current.value !== original;
2353
+ return current.leftStripped;
2354
+ }
2355
+
2356
+ exports['default'] = WhitespaceControl;
2357
+ module.exports = exports['default'];
2358
+
2359
+ /***/ },
2360
+ /* 25 */
2361
+ /***/ function(module, exports, __webpack_require__) {
2362
+
2363
+ 'use strict';
2364
+
2365
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2366
+
2367
+ exports.__esModule = true;
2368
+
2369
+ var _exception = __webpack_require__(6);
2370
+
2371
+ var _exception2 = _interopRequireDefault(_exception);
2372
+
2373
+ function Visitor() {
2374
+ this.parents = [];
2375
+ }
2376
+
2377
+ Visitor.prototype = {
2378
+ constructor: Visitor,
2379
+ mutating: false,
2380
+
2381
+ // Visits a given value. If mutating, will replace the value if necessary.
2382
+ acceptKey: function acceptKey(node, name) {
2383
+ var value = this.accept(node[name]);
2384
+ if (this.mutating) {
2385
+ // Hacky sanity check: This may have a few false positives for type for the helper
2386
+ // methods but will generally do the right thing without a lot of overhead.
2387
+ if (value && !Visitor.prototype[value.type]) {
2388
+ throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2389
+ }
2390
+ node[name] = value;
2391
+ }
2392
+ },
2393
+
2394
+ // Performs an accept operation with added sanity check to ensure
2395
+ // required keys are not removed.
2396
+ acceptRequired: function acceptRequired(node, name) {
2397
+ this.acceptKey(node, name);
2398
+
2399
+ if (!node[name]) {
2400
+ throw new _exception2['default'](node.type + ' requires ' + name);
2401
+ }
2402
+ },
2403
+
2404
+ // Traverses a given array. If mutating, empty respnses will be removed
2405
+ // for child elements.
2406
+ acceptArray: function acceptArray(array) {
2407
+ for (var i = 0, l = array.length; i < l; i++) {
2408
+ this.acceptKey(array, i);
2409
+
2410
+ if (!array[i]) {
2411
+ array.splice(i, 1);
2412
+ i--;
2413
+ l--;
2414
+ }
2415
+ }
2416
+ },
2417
+
2418
+ accept: function accept(object) {
2419
+ if (!object) {
2420
+ return;
2421
+ }
2422
+
2423
+ /* istanbul ignore next: Sanity code */
2424
+ if (!this[object.type]) {
2425
+ throw new _exception2['default']('Unknown type: ' + object.type, object);
2426
+ }
2427
+
2428
+ if (this.current) {
2429
+ this.parents.unshift(this.current);
2430
+ }
2431
+ this.current = object;
2432
+
2433
+ var ret = this[object.type](object);
2434
+
2435
+ this.current = this.parents.shift();
2436
+
2437
+ if (!this.mutating || ret) {
2438
+ return ret;
2439
+ } else if (ret !== false) {
2440
+ return object;
2441
+ }
2442
+ },
2443
+
2444
+ Program: function Program(program) {
2445
+ this.acceptArray(program.body);
2446
+ },
2447
+
2448
+ MustacheStatement: visitSubExpression,
2449
+ Decorator: visitSubExpression,
2450
+
2451
+ BlockStatement: visitBlock,
2452
+ DecoratorBlock: visitBlock,
2453
+
2454
+ PartialStatement: visitPartial,
2455
+ PartialBlockStatement: function PartialBlockStatement(partial) {
2456
+ visitPartial.call(this, partial);
2457
+
2458
+ this.acceptKey(partial, 'program');
2459
+ },
2460
+
2461
+ ContentStatement: function ContentStatement() /* content */{},
2462
+ CommentStatement: function CommentStatement() /* comment */{},
2463
+
2464
+ SubExpression: visitSubExpression,
2465
+
2466
+ PathExpression: function PathExpression() /* path */{},
2467
+
2468
+ StringLiteral: function StringLiteral() /* string */{},
2469
+ NumberLiteral: function NumberLiteral() /* number */{},
2470
+ BooleanLiteral: function BooleanLiteral() /* bool */{},
2471
+ UndefinedLiteral: function UndefinedLiteral() /* literal */{},
2472
+ NullLiteral: function NullLiteral() /* literal */{},
2473
+
2474
+ Hash: function Hash(hash) {
2475
+ this.acceptArray(hash.pairs);
2476
+ },
2477
+ HashPair: function HashPair(pair) {
2478
+ this.acceptRequired(pair, 'value');
2479
+ }
2480
+ };
2481
+
2482
+ function visitSubExpression(mustache) {
2483
+ this.acceptRequired(mustache, 'path');
2484
+ this.acceptArray(mustache.params);
2485
+ this.acceptKey(mustache, 'hash');
2486
+ }
2487
+ function visitBlock(block) {
2488
+ visitSubExpression.call(this, block);
2489
+
2490
+ this.acceptKey(block, 'program');
2491
+ this.acceptKey(block, 'inverse');
2492
+ }
2493
+ function visitPartial(partial) {
2494
+ this.acceptRequired(partial, 'name');
2495
+ this.acceptArray(partial.params);
2496
+ this.acceptKey(partial, 'hash');
2497
+ }
2498
+
2499
+ exports['default'] = Visitor;
2500
+ module.exports = exports['default'];
2501
+
2502
+ /***/ },
2503
+ /* 26 */
2504
+ /***/ function(module, exports, __webpack_require__) {
2505
+
2506
+ 'use strict';
2507
+
2508
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2509
+
2510
+ exports.__esModule = true;
2511
+ exports.SourceLocation = SourceLocation;
2512
+ exports.id = id;
2513
+ exports.stripFlags = stripFlags;
2514
+ exports.stripComment = stripComment;
2515
+ exports.preparePath = preparePath;
2516
+ exports.prepareMustache = prepareMustache;
2517
+ exports.prepareRawBlock = prepareRawBlock;
2518
+ exports.prepareBlock = prepareBlock;
2519
+ exports.prepareProgram = prepareProgram;
2520
+ exports.preparePartialBlock = preparePartialBlock;
2521
+
2522
+ var _exception = __webpack_require__(6);
2523
+
2524
+ var _exception2 = _interopRequireDefault(_exception);
2525
+
2526
+ function validateClose(open, close) {
2527
+ close = close.path ? close.path.original : close;
2528
+
2529
+ if (open.path.original !== close) {
2530
+ var errorNode = { loc: open.path.loc };
2531
+
2532
+ throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
2533
+ }
2534
+ }
2535
+
2536
+ function SourceLocation(source, locInfo) {
2537
+ this.source = source;
2538
+ this.start = {
2539
+ line: locInfo.first_line,
2540
+ column: locInfo.first_column
2541
+ };
2542
+ this.end = {
2543
+ line: locInfo.last_line,
2544
+ column: locInfo.last_column
2545
+ };
2546
+ }
2547
+
2548
+ function id(token) {
2549
+ if (/^\[.*\]$/.test(token)) {
2550
+ return token.substr(1, token.length - 2);
2551
+ } else {
2552
+ return token;
2553
+ }
2554
+ }
2555
+
2556
+ function stripFlags(open, close) {
2557
+ return {
2558
+ open: open.charAt(2) === '~',
2559
+ close: close.charAt(close.length - 3) === '~'
2560
+ };
2561
+ }
2562
+
2563
+ function stripComment(comment) {
2564
+ return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
2565
+ }
2566
+
2567
+ function preparePath(data, parts, loc) {
2568
+ loc = this.locInfo(loc);
2569
+
2570
+ var original = data ? '@' : '',
2571
+ dig = [],
2572
+ depth = 0,
2573
+ depthString = '';
2574
+
2575
+ for (var i = 0, l = parts.length; i < l; i++) {
2576
+ var part = parts[i].part,
2577
+
2578
+ // If we have [] syntax then we do not treat path references as operators,
2579
+ // i.e. foo.[this] resolves to approximately context.foo['this']
2580
+ isLiteral = parts[i].original !== part;
2581
+ original += (parts[i].separator || '') + part;
2582
+
2583
+ if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
2584
+ if (dig.length > 0) {
2585
+ throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
2586
+ } else if (part === '..') {
2587
+ depth++;
2588
+ depthString += '../';
2589
+ }
2590
+ } else {
2591
+ dig.push(part);
2592
+ }
2593
+ }
2594
+
2595
+ return {
2596
+ type: 'PathExpression',
2597
+ data: data,
2598
+ depth: depth,
2599
+ parts: dig,
2600
+ original: original,
2601
+ loc: loc
2602
+ };
2603
+ }
2604
+
2605
+ function prepareMustache(path, params, hash, open, strip, locInfo) {
2606
+ // Must use charAt to support IE pre-10
2607
+ var escapeFlag = open.charAt(3) || open.charAt(2),
2608
+ escaped = escapeFlag !== '{' && escapeFlag !== '&';
2609
+
2610
+ var decorator = /\*/.test(open);
2611
+ return {
2612
+ type: decorator ? 'Decorator' : 'MustacheStatement',
2613
+ path: path,
2614
+ params: params,
2615
+ hash: hash,
2616
+ escaped: escaped,
2617
+ strip: strip,
2618
+ loc: this.locInfo(locInfo)
2619
+ };
2620
+ }
2621
+
2622
+ function prepareRawBlock(openRawBlock, contents, close, locInfo) {
2623
+ validateClose(openRawBlock, close);
2624
+
2625
+ locInfo = this.locInfo(locInfo);
2626
+ var program = {
2627
+ type: 'Program',
2628
+ body: contents,
2629
+ strip: {},
2630
+ loc: locInfo
2631
+ };
2632
+
2633
+ return {
2634
+ type: 'BlockStatement',
2635
+ path: openRawBlock.path,
2636
+ params: openRawBlock.params,
2637
+ hash: openRawBlock.hash,
2638
+ program: program,
2639
+ openStrip: {},
2640
+ inverseStrip: {},
2641
+ closeStrip: {},
2642
+ loc: locInfo
2643
+ };
2644
+ }
2645
+
2646
+ function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
2647
+ if (close && close.path) {
2648
+ validateClose(openBlock, close);
2649
+ }
2650
+
2651
+ var decorator = /\*/.test(openBlock.open);
2652
+
2653
+ program.blockParams = openBlock.blockParams;
2654
+
2655
+ var inverse = undefined,
2656
+ inverseStrip = undefined;
2657
+
2658
+ if (inverseAndProgram) {
2659
+ if (decorator) {
2660
+ throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
2661
+ }
2662
+
2663
+ if (inverseAndProgram.chain) {
2664
+ inverseAndProgram.program.body[0].closeStrip = close.strip;
2665
+ }
2666
+
2667
+ inverseStrip = inverseAndProgram.strip;
2668
+ inverse = inverseAndProgram.program;
2669
+ }
2670
+
2671
+ if (inverted) {
2672
+ inverted = inverse;
2673
+ inverse = program;
2674
+ program = inverted;
2675
+ }
2676
+
2677
+ return {
2678
+ type: decorator ? 'DecoratorBlock' : 'BlockStatement',
2679
+ path: openBlock.path,
2680
+ params: openBlock.params,
2681
+ hash: openBlock.hash,
2682
+ program: program,
2683
+ inverse: inverse,
2684
+ openStrip: openBlock.strip,
2685
+ inverseStrip: inverseStrip,
2686
+ closeStrip: close && close.strip,
2687
+ loc: this.locInfo(locInfo)
2688
+ };
2689
+ }
2690
+
2691
+ function prepareProgram(statements, loc) {
2692
+ if (!loc && statements.length) {
2693
+ var firstLoc = statements[0].loc,
2694
+ lastLoc = statements[statements.length - 1].loc;
2695
+
2696
+ /* istanbul ignore else */
2697
+ if (firstLoc && lastLoc) {
2698
+ loc = {
2699
+ source: firstLoc.source,
2700
+ start: {
2701
+ line: firstLoc.start.line,
2702
+ column: firstLoc.start.column
2703
+ },
2704
+ end: {
2705
+ line: lastLoc.end.line,
2706
+ column: lastLoc.end.column
2707
+ }
2708
+ };
2709
+ }
2710
+ }
2711
+
2712
+ return {
2713
+ type: 'Program',
2714
+ body: statements,
2715
+ strip: {},
2716
+ loc: loc
2717
+ };
2718
+ }
2719
+
2720
+ function preparePartialBlock(open, program, close, locInfo) {
2721
+ validateClose(open, close);
2722
+
2723
+ return {
2724
+ type: 'PartialBlockStatement',
2725
+ name: open.path,
2726
+ params: open.params,
2727
+ hash: open.hash,
2728
+ program: program,
2729
+ openStrip: open.strip,
2730
+ closeStrip: close && close.strip,
2731
+ loc: this.locInfo(locInfo)
2732
+ };
2733
+ }
2734
+
2735
+ /***/ },
2736
+ /* 27 */
2737
+ /***/ function(module, exports, __webpack_require__) {
2738
+
2739
+ /* eslint-disable new-cap */
2740
+
2741
+ 'use strict';
2742
+
2743
+ var _interopRequireDefault = __webpack_require__(1)['default'];
2744
+
2745
+ exports.__esModule = true;
2746
+ exports.Compiler = Compiler;
2747
+ exports.precompile = precompile;
2748
+ exports.compile = compile;
2749
+
2750
+ var _exception = __webpack_require__(6);
2751
+
2752
+ var _exception2 = _interopRequireDefault(_exception);
2753
+
2754
+ var _utils = __webpack_require__(5);
2755
+
2756
+ var _ast = __webpack_require__(21);
2757
+
2758
+ var _ast2 = _interopRequireDefault(_ast);
2759
+
2760
+ var slice = [].slice;
2761
+
2762
+ function Compiler() {}
2763
+
2764
+ // the foundHelper register will disambiguate helper lookup from finding a
2765
+ // function in a context. This is necessary for mustache compatibility, which
2766
+ // requires that context functions in blocks are evaluated by blockHelperMissing,
2767
+ // and then proceed as if the resulting value was provided to blockHelperMissing.
2768
+
2769
+ Compiler.prototype = {
2770
+ compiler: Compiler,
2771
+
2772
+ equals: function equals(other) {
2773
+ var len = this.opcodes.length;
2774
+ if (other.opcodes.length !== len) {
2775
+ return false;
2776
+ }
2777
+
2778
+ for (var i = 0; i < len; i++) {
2779
+ var opcode = this.opcodes[i],
2780
+ otherOpcode = other.opcodes[i];
2781
+ if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
2782
+ return false;
2783
+ }
2784
+ }
2785
+
2786
+ // We know that length is the same between the two arrays because they are directly tied
2787
+ // to the opcode behavior above.
2788
+ len = this.children.length;
2789
+ for (var i = 0; i < len; i++) {
2790
+ if (!this.children[i].equals(other.children[i])) {
2791
+ return false;
2792
+ }
2793
+ }
2794
+
2795
+ return true;
2796
+ },
2797
+
2798
+ guid: 0,
2799
+
2800
+ compile: function compile(program, options) {
2801
+ this.sourceNode = [];
2802
+ this.opcodes = [];
2803
+ this.children = [];
2804
+ this.options = options;
2805
+ this.stringParams = options.stringParams;
2806
+ this.trackIds = options.trackIds;
2807
+
2808
+ options.blockParams = options.blockParams || [];
2809
+
2810
+ // These changes will propagate to the other compiler components
2811
+ var knownHelpers = options.knownHelpers;
2812
+ options.knownHelpers = {
2813
+ 'helperMissing': true,
2814
+ 'blockHelperMissing': true,
2815
+ 'each': true,
2816
+ 'if': true,
2817
+ 'unless': true,
2818
+ 'with': true,
2819
+ 'log': true,
2820
+ 'lookup': true
2821
+ };
2822
+ if (knownHelpers) {
2823
+ for (var _name in knownHelpers) {
2824
+ /* istanbul ignore else */
2825
+ if (_name in knownHelpers) {
2826
+ options.knownHelpers[_name] = knownHelpers[_name];
2827
+ }
2828
+ }
2829
+ }
2830
+
2831
+ return this.accept(program);
2832
+ },
2833
+
2834
+ compileProgram: function compileProgram(program) {
2835
+ var childCompiler = new this.compiler(),
2836
+ // eslint-disable-line new-cap
2837
+ result = childCompiler.compile(program, this.options),
2838
+ guid = this.guid++;
2839
+
2840
+ this.usePartial = this.usePartial || result.usePartial;
2841
+
2842
+ this.children[guid] = result;
2843
+ this.useDepths = this.useDepths || result.useDepths;
2844
+
2845
+ return guid;
2846
+ },
2847
+
2848
+ accept: function accept(node) {
2849
+ /* istanbul ignore next: Sanity code */
2850
+ if (!this[node.type]) {
2851
+ throw new _exception2['default']('Unknown type: ' + node.type, node);
2852
+ }
2853
+
2854
+ this.sourceNode.unshift(node);
2855
+ var ret = this[node.type](node);
2856
+ this.sourceNode.shift();
2857
+ return ret;
2858
+ },
2859
+
2860
+ Program: function Program(program) {
2861
+ this.options.blockParams.unshift(program.blockParams);
2862
+
2863
+ var body = program.body,
2864
+ bodyLength = body.length;
2865
+ for (var i = 0; i < bodyLength; i++) {
2866
+ this.accept(body[i]);
2867
+ }
2868
+
2869
+ this.options.blockParams.shift();
2870
+
2871
+ this.isSimple = bodyLength === 1;
2872
+ this.blockParams = program.blockParams ? program.blockParams.length : 0;
2873
+
2874
+ return this;
2875
+ },
2876
+
2877
+ BlockStatement: function BlockStatement(block) {
2878
+ transformLiteralToPath(block);
2879
+
2880
+ var program = block.program,
2881
+ inverse = block.inverse;
2882
+
2883
+ program = program && this.compileProgram(program);
2884
+ inverse = inverse && this.compileProgram(inverse);
2885
+
2886
+ var type = this.classifySexpr(block);
2887
+
2888
+ if (type === 'helper') {
2889
+ this.helperSexpr(block, program, inverse);
2890
+ } else if (type === 'simple') {
2891
+ this.simpleSexpr(block);
2892
+
2893
+ // now that the simple mustache is resolved, we need to
2894
+ // evaluate it by executing `blockHelperMissing`
2895
+ this.opcode('pushProgram', program);
2896
+ this.opcode('pushProgram', inverse);
2897
+ this.opcode('emptyHash');
2898
+ this.opcode('blockValue', block.path.original);
2899
+ } else {
2900
+ this.ambiguousSexpr(block, program, inverse);
2901
+
2902
+ // now that the simple mustache is resolved, we need to
2903
+ // evaluate it by executing `blockHelperMissing`
2904
+ this.opcode('pushProgram', program);
2905
+ this.opcode('pushProgram', inverse);
2906
+ this.opcode('emptyHash');
2907
+ this.opcode('ambiguousBlockValue');
2908
+ }
2909
+
2910
+ this.opcode('append');
2911
+ },
2912
+
2913
+ DecoratorBlock: function DecoratorBlock(decorator) {
2914
+ var program = decorator.program && this.compileProgram(decorator.program);
2915
+ var params = this.setupFullMustacheParams(decorator, program, undefined),
2916
+ path = decorator.path;
2917
+
2918
+ this.useDecorators = true;
2919
+ this.opcode('registerDecorator', params.length, path.original);
2920
+ },
2921
+
2922
+ PartialStatement: function PartialStatement(partial) {
2923
+ this.usePartial = true;
2924
+
2925
+ var program = partial.program;
2926
+ if (program) {
2927
+ program = this.compileProgram(partial.program);
2928
+ }
2929
+
2930
+ var params = partial.params;
2931
+ if (params.length > 1) {
2932
+ throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
2933
+ } else if (!params.length) {
2934
+ if (this.options.explicitPartialContext) {
2935
+ this.opcode('pushLiteral', 'undefined');
2936
+ } else {
2937
+ params.push({ type: 'PathExpression', parts: [], depth: 0 });
2938
+ }
2939
+ }
2940
+
2941
+ var partialName = partial.name.original,
2942
+ isDynamic = partial.name.type === 'SubExpression';
2943
+ if (isDynamic) {
2944
+ this.accept(partial.name);
2945
+ }
2946
+
2947
+ this.setupFullMustacheParams(partial, program, undefined, true);
2948
+
2949
+ var indent = partial.indent || '';
2950
+ if (this.options.preventIndent && indent) {
2951
+ this.opcode('appendContent', indent);
2952
+ indent = '';
2953
+ }
2954
+
2955
+ this.opcode('invokePartial', isDynamic, partialName, indent);
2956
+ this.opcode('append');
2957
+ },
2958
+ PartialBlockStatement: function PartialBlockStatement(partialBlock) {
2959
+ this.PartialStatement(partialBlock);
2960
+ },
2961
+
2962
+ MustacheStatement: function MustacheStatement(mustache) {
2963
+ this.SubExpression(mustache);
2964
+
2965
+ if (mustache.escaped && !this.options.noEscape) {
2966
+ this.opcode('appendEscaped');
2967
+ } else {
2968
+ this.opcode('append');
2969
+ }
2970
+ },
2971
+ Decorator: function Decorator(decorator) {
2972
+ this.DecoratorBlock(decorator);
2973
+ },
2974
+
2975
+ ContentStatement: function ContentStatement(content) {
2976
+ if (content.value) {
2977
+ this.opcode('appendContent', content.value);
2978
+ }
2979
+ },
2980
+
2981
+ CommentStatement: function CommentStatement() {},
2982
+
2983
+ SubExpression: function SubExpression(sexpr) {
2984
+ transformLiteralToPath(sexpr);
2985
+ var type = this.classifySexpr(sexpr);
2986
+
2987
+ if (type === 'simple') {
2988
+ this.simpleSexpr(sexpr);
2989
+ } else if (type === 'helper') {
2990
+ this.helperSexpr(sexpr);
2991
+ } else {
2992
+ this.ambiguousSexpr(sexpr);
2993
+ }
2994
+ },
2995
+ ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
2996
+ var path = sexpr.path,
2997
+ name = path.parts[0],
2998
+ isBlock = program != null || inverse != null;
2999
+
3000
+ this.opcode('getContext', path.depth);
3001
+
3002
+ this.opcode('pushProgram', program);
3003
+ this.opcode('pushProgram', inverse);
3004
+
3005
+ path.strict = true;
3006
+ this.accept(path);
3007
+
3008
+ this.opcode('invokeAmbiguous', name, isBlock);
3009
+ },
3010
+
3011
+ simpleSexpr: function simpleSexpr(sexpr) {
3012
+ var path = sexpr.path;
3013
+ path.strict = true;
3014
+ this.accept(path);
3015
+ this.opcode('resolvePossibleLambda');
3016
+ },
3017
+
3018
+ helperSexpr: function helperSexpr(sexpr, program, inverse) {
3019
+ var params = this.setupFullMustacheParams(sexpr, program, inverse),
3020
+ path = sexpr.path,
3021
+ name = path.parts[0];
3022
+
3023
+ if (this.options.knownHelpers[name]) {
3024
+ this.opcode('invokeKnownHelper', params.length, name);
3025
+ } else if (this.options.knownHelpersOnly) {
3026
+ throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
3027
+ } else {
3028
+ path.strict = true;
3029
+ path.falsy = true;
3030
+
3031
+ this.accept(path);
3032
+ this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
3033
+ }
3034
+ },
3035
+
3036
+ PathExpression: function PathExpression(path) {
3037
+ this.addDepth(path.depth);
3038
+ this.opcode('getContext', path.depth);
3039
+
3040
+ var name = path.parts[0],
3041
+ scoped = _ast2['default'].helpers.scopedId(path),
3042
+ blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
3043
+
3044
+ if (blockParamId) {
3045
+ this.opcode('lookupBlockParam', blockParamId, path.parts);
3046
+ } else if (!name) {
3047
+ // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
3048
+ this.opcode('pushContext');
3049
+ } else if (path.data) {
3050
+ this.options.data = true;
3051
+ this.opcode('lookupData', path.depth, path.parts, path.strict);
3052
+ } else {
3053
+ this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
3054
+ }
3055
+ },
3056
+
3057
+ StringLiteral: function StringLiteral(string) {
3058
+ this.opcode('pushString', string.value);
3059
+ },
3060
+
3061
+ NumberLiteral: function NumberLiteral(number) {
3062
+ this.opcode('pushLiteral', number.value);
3063
+ },
3064
+
3065
+ BooleanLiteral: function BooleanLiteral(bool) {
3066
+ this.opcode('pushLiteral', bool.value);
3067
+ },
3068
+
3069
+ UndefinedLiteral: function UndefinedLiteral() {
3070
+ this.opcode('pushLiteral', 'undefined');
3071
+ },
3072
+
3073
+ NullLiteral: function NullLiteral() {
3074
+ this.opcode('pushLiteral', 'null');
3075
+ },
3076
+
3077
+ Hash: function Hash(hash) {
3078
+ var pairs = hash.pairs,
3079
+ i = 0,
3080
+ l = pairs.length;
3081
+
3082
+ this.opcode('pushHash');
3083
+
3084
+ for (; i < l; i++) {
3085
+ this.pushParam(pairs[i].value);
3086
+ }
3087
+ while (i--) {
3088
+ this.opcode('assignToHash', pairs[i].key);
3089
+ }
3090
+ this.opcode('popHash');
3091
+ },
3092
+
3093
+ // HELPERS
3094
+ opcode: function opcode(name) {
3095
+ this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc });
3096
+ },
3097
+
3098
+ addDepth: function addDepth(depth) {
3099
+ if (!depth) {
3100
+ return;
3101
+ }
3102
+
3103
+ this.useDepths = true;
3104
+ },
3105
+
3106
+ classifySexpr: function classifySexpr(sexpr) {
3107
+ var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
3108
+
3109
+ var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
3110
+
3111
+ // a mustache is an eligible helper if:
3112
+ // * its id is simple (a single part, not `this` or `..`)
3113
+ var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
3114
+
3115
+ // if a mustache is an eligible helper but not a definite
3116
+ // helper, it is ambiguous, and will be resolved in a later
3117
+ // pass or at runtime.
3118
+ var isEligible = !isBlockParam && (isHelper || isSimple);
3119
+
3120
+ // if ambiguous, we can possibly resolve the ambiguity now
3121
+ // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
3122
+ if (isEligible && !isHelper) {
3123
+ var _name2 = sexpr.path.parts[0],
3124
+ options = this.options;
3125
+
3126
+ if (options.knownHelpers[_name2]) {
3127
+ isHelper = true;
3128
+ } else if (options.knownHelpersOnly) {
3129
+ isEligible = false;
3130
+ }
3131
+ }
3132
+
3133
+ if (isHelper) {
3134
+ return 'helper';
3135
+ } else if (isEligible) {
3136
+ return 'ambiguous';
3137
+ } else {
3138
+ return 'simple';
3139
+ }
3140
+ },
3141
+
3142
+ pushParams: function pushParams(params) {
3143
+ for (var i = 0, l = params.length; i < l; i++) {
3144
+ this.pushParam(params[i]);
3145
+ }
3146
+ },
3147
+
3148
+ pushParam: function pushParam(val) {
3149
+ var value = val.value != null ? val.value : val.original || '';
3150
+
3151
+ if (this.stringParams) {
3152
+ if (value.replace) {
3153
+ value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
3154
+ }
3155
+
3156
+ if (val.depth) {
3157
+ this.addDepth(val.depth);
3158
+ }
3159
+ this.opcode('getContext', val.depth || 0);
3160
+ this.opcode('pushStringParam', value, val.type);
3161
+
3162
+ if (val.type === 'SubExpression') {
3163
+ // SubExpressions get evaluated and passed in
3164
+ // in string params mode.
3165
+ this.accept(val);
3166
+ }
3167
+ } else {
3168
+ if (this.trackIds) {
3169
+ var blockParamIndex = undefined;
3170
+ if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
3171
+ blockParamIndex = this.blockParamIndex(val.parts[0]);
3172
+ }
3173
+ if (blockParamIndex) {
3174
+ var blockParamChild = val.parts.slice(1).join('.');
3175
+ this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
3176
+ } else {
3177
+ value = val.original || value;
3178
+ if (value.replace) {
3179
+ value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
3180
+ }
3181
+
3182
+ this.opcode('pushId', val.type, value);
3183
+ }
3184
+ }
3185
+ this.accept(val);
3186
+ }
3187
+ },
3188
+
3189
+ setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
3190
+ var params = sexpr.params;
3191
+ this.pushParams(params);
3192
+
3193
+ this.opcode('pushProgram', program);
3194
+ this.opcode('pushProgram', inverse);
3195
+
3196
+ if (sexpr.hash) {
3197
+ this.accept(sexpr.hash);
3198
+ } else {
3199
+ this.opcode('emptyHash', omitEmpty);
3200
+ }
3201
+
3202
+ return params;
3203
+ },
3204
+
3205
+ blockParamIndex: function blockParamIndex(name) {
3206
+ for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
3207
+ var blockParams = this.options.blockParams[depth],
3208
+ param = blockParams && _utils.indexOf(blockParams, name);
3209
+ if (blockParams && param >= 0) {
3210
+ return [depth, param];
3211
+ }
3212
+ }
3213
+ }
3214
+ };
3215
+
3216
+ function precompile(input, options, env) {
3217
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3218
+ throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
3219
+ }
3220
+
3221
+ options = options || {};
3222
+ if (!('data' in options)) {
3223
+ options.data = true;
3224
+ }
3225
+ if (options.compat) {
3226
+ options.useDepths = true;
3227
+ }
3228
+
3229
+ var ast = env.parse(input, options),
3230
+ environment = new env.Compiler().compile(ast, options);
3231
+ return new env.JavaScriptCompiler().compile(environment, options);
3232
+ }
3233
+
3234
+ function compile(input, options, env) {
3235
+ if (options === undefined) options = {};
3236
+
3237
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3238
+ throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
3239
+ }
3240
+
3241
+ if (!('data' in options)) {
3242
+ options.data = true;
3243
+ }
3244
+ if (options.compat) {
3245
+ options.useDepths = true;
3246
+ }
3247
+
3248
+ var compiled = undefined;
3249
+
3250
+ function compileInput() {
3251
+ var ast = env.parse(input, options),
3252
+ environment = new env.Compiler().compile(ast, options),
3253
+ templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
3254
+ return env.template(templateSpec);
3255
+ }
3256
+
3257
+ // Template is only compiled on first use and cached after that point.
3258
+ function ret(context, execOptions) {
3259
+ if (!compiled) {
3260
+ compiled = compileInput();
3261
+ }
3262
+ return compiled.call(this, context, execOptions);
3263
+ }
3264
+ ret._setup = function (setupOptions) {
3265
+ if (!compiled) {
3266
+ compiled = compileInput();
3267
+ }
3268
+ return compiled._setup(setupOptions);
3269
+ };
3270
+ ret._child = function (i, data, blockParams, depths) {
3271
+ if (!compiled) {
3272
+ compiled = compileInput();
3273
+ }
3274
+ return compiled._child(i, data, blockParams, depths);
3275
+ };
3276
+ return ret;
3277
+ }
3278
+
3279
+ function argEquals(a, b) {
3280
+ if (a === b) {
3281
+ return true;
3282
+ }
3283
+
3284
+ if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
3285
+ for (var i = 0; i < a.length; i++) {
3286
+ if (!argEquals(a[i], b[i])) {
3287
+ return false;
3288
+ }
3289
+ }
3290
+ return true;
3291
+ }
3292
+ }
3293
+
3294
+ function transformLiteralToPath(sexpr) {
3295
+ if (!sexpr.path.parts) {
3296
+ var literal = sexpr.path;
3297
+ // Casting to string here to make false and 0 literal values play nicely with the rest
3298
+ // of the system.
3299
+ sexpr.path = {
3300
+ type: 'PathExpression',
3301
+ data: false,
3302
+ depth: 0,
3303
+ parts: [literal.original + ''],
3304
+ original: literal.original + '',
3305
+ loc: literal.loc
3306
+ };
3307
+ }
3308
+ }
3309
+
3310
+ /***/ },
3311
+ /* 28 */
3312
+ /***/ function(module, exports, __webpack_require__) {
3313
+
3314
+ 'use strict';
3315
+
3316
+ var _interopRequireDefault = __webpack_require__(1)['default'];
3317
+
3318
+ exports.__esModule = true;
3319
+
3320
+ var _base = __webpack_require__(4);
3321
+
3322
+ var _exception = __webpack_require__(6);
3323
+
3324
+ var _exception2 = _interopRequireDefault(_exception);
3325
+
3326
+ var _utils = __webpack_require__(5);
3327
+
3328
+ var _codeGen = __webpack_require__(29);
3329
+
3330
+ var _codeGen2 = _interopRequireDefault(_codeGen);
3331
+
3332
+ function Literal(value) {
3333
+ this.value = value;
3334
+ }
3335
+
3336
+ function JavaScriptCompiler() {}
3337
+
3338
+ JavaScriptCompiler.prototype = {
3339
+ // PUBLIC API: You can override these methods in a subclass to provide
3340
+ // alternative compiled forms for name lookup and buffering semantics
3341
+ nameLookup: function nameLookup(parent, name /* , type*/) {
3342
+ if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
3343
+ return [parent, '.', name];
3344
+ } else {
3345
+ return [parent, '[', JSON.stringify(name), ']'];
3346
+ }
3347
+ },
3348
+ depthedLookup: function depthedLookup(name) {
3349
+ return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
3350
+ },
3351
+
3352
+ compilerInfo: function compilerInfo() {
3353
+ var revision = _base.COMPILER_REVISION,
3354
+ versions = _base.REVISION_CHANGES[revision];
3355
+ return [revision, versions];
3356
+ },
3357
+
3358
+ appendToBuffer: function appendToBuffer(source, location, explicit) {
3359
+ // Force a source as this simplifies the merge logic.
3360
+ if (!_utils.isArray(source)) {
3361
+ source = [source];
3362
+ }
3363
+ source = this.source.wrap(source, location);
3364
+
3365
+ if (this.environment.isSimple) {
3366
+ return ['return ', source, ';'];
3367
+ } else if (explicit) {
3368
+ // This is a case where the buffer operation occurs as a child of another
3369
+ // construct, generally braces. We have to explicitly output these buffer
3370
+ // operations to ensure that the emitted code goes in the correct location.
3371
+ return ['buffer += ', source, ';'];
3372
+ } else {
3373
+ source.appendToBuffer = true;
3374
+ return source;
3375
+ }
3376
+ },
3377
+
3378
+ initializeBuffer: function initializeBuffer() {
3379
+ return this.quotedString('');
3380
+ },
3381
+ // END PUBLIC API
3382
+
3383
+ compile: function compile(environment, options, context, asObject) {
3384
+ this.environment = environment;
3385
+ this.options = options;
3386
+ this.stringParams = this.options.stringParams;
3387
+ this.trackIds = this.options.trackIds;
3388
+ this.precompile = !asObject;
3389
+
3390
+ this.name = this.environment.name;
3391
+ this.isChild = !!context;
3392
+ this.context = context || {
3393
+ decorators: [],
3394
+ programs: [],
3395
+ environments: []
3396
+ };
3397
+
3398
+ this.preamble();
3399
+
3400
+ this.stackSlot = 0;
3401
+ this.stackVars = [];
3402
+ this.aliases = {};
3403
+ this.registers = { list: [] };
3404
+ this.hashes = [];
3405
+ this.compileStack = [];
3406
+ this.inlineStack = [];
3407
+ this.blockParams = [];
3408
+
3409
+ this.compileChildren(environment, options);
3410
+
3411
+ this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
3412
+ this.useBlockParams = this.useBlockParams || environment.useBlockParams;
3413
+
3414
+ var opcodes = environment.opcodes,
3415
+ opcode = undefined,
3416
+ firstLoc = undefined,
3417
+ i = undefined,
3418
+ l = undefined;
3419
+
3420
+ for (i = 0, l = opcodes.length; i < l; i++) {
3421
+ opcode = opcodes[i];
3422
+
3423
+ this.source.currentLocation = opcode.loc;
3424
+ firstLoc = firstLoc || opcode.loc;
3425
+ this[opcode.opcode].apply(this, opcode.args);
3426
+ }
3427
+
3428
+ // Flush any trailing content that might be pending.
3429
+ this.source.currentLocation = firstLoc;
3430
+ this.pushSource('');
3431
+
3432
+ /* istanbul ignore next */
3433
+ if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
3434
+ throw new _exception2['default']('Compile completed with content left on stack');
3435
+ }
3436
+
3437
+ if (!this.decorators.isEmpty()) {
3438
+ this.useDecorators = true;
3439
+
3440
+ this.decorators.prepend('var decorators = container.decorators;\n');
3441
+ this.decorators.push('return fn;');
3442
+
3443
+ if (asObject) {
3444
+ this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
3445
+ } else {
3446
+ this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
3447
+ this.decorators.push('}\n');
3448
+ this.decorators = this.decorators.merge();
3449
+ }
3450
+ } else {
3451
+ this.decorators = undefined;
3452
+ }
3453
+
3454
+ var fn = this.createFunctionContext(asObject);
3455
+ if (!this.isChild) {
3456
+ var ret = {
3457
+ compiler: this.compilerInfo(),
3458
+ main: fn
3459
+ };
3460
+
3461
+ if (this.decorators) {
3462
+ ret.main_d = this.decorators; // eslint-disable-line camelcase
3463
+ ret.useDecorators = true;
3464
+ }
3465
+
3466
+ var _context = this.context;
3467
+ var programs = _context.programs;
3468
+ var decorators = _context.decorators;
3469
+
3470
+ for (i = 0, l = programs.length; i < l; i++) {
3471
+ if (programs[i]) {
3472
+ ret[i] = programs[i];
3473
+ if (decorators[i]) {
3474
+ ret[i + '_d'] = decorators[i];
3475
+ ret.useDecorators = true;
3476
+ }
3477
+ }
3478
+ }
3479
+
3480
+ if (this.environment.usePartial) {
3481
+ ret.usePartial = true;
3482
+ }
3483
+ if (this.options.data) {
3484
+ ret.useData = true;
3485
+ }
3486
+ if (this.useDepths) {
3487
+ ret.useDepths = true;
3488
+ }
3489
+ if (this.useBlockParams) {
3490
+ ret.useBlockParams = true;
3491
+ }
3492
+ if (this.options.compat) {
3493
+ ret.compat = true;
3494
+ }
3495
+
3496
+ if (!asObject) {
3497
+ ret.compiler = JSON.stringify(ret.compiler);
3498
+
3499
+ this.source.currentLocation = { start: { line: 1, column: 0 } };
3500
+ ret = this.objectLiteral(ret);
3501
+
3502
+ if (options.srcName) {
3503
+ ret = ret.toStringWithSourceMap({ file: options.destName });
3504
+ ret.map = ret.map && ret.map.toString();
3505
+ } else {
3506
+ ret = ret.toString();
3507
+ }
3508
+ } else {
3509
+ ret.compilerOptions = this.options;
3510
+ }
3511
+
3512
+ return ret;
3513
+ } else {
3514
+ return fn;
3515
+ }
3516
+ },
3517
+
3518
+ preamble: function preamble() {
3519
+ // track the last context pushed into place to allow skipping the
3520
+ // getContext opcode when it would be a noop
3521
+ this.lastContext = 0;
3522
+ this.source = new _codeGen2['default'](this.options.srcName);
3523
+ this.decorators = new _codeGen2['default'](this.options.srcName);
3524
+ },
3525
+
3526
+ createFunctionContext: function createFunctionContext(asObject) {
3527
+ var varDeclarations = '';
3528
+
3529
+ var locals = this.stackVars.concat(this.registers.list);
3530
+ if (locals.length > 0) {
3531
+ varDeclarations += ', ' + locals.join(', ');
3532
+ }
3533
+
3534
+ // Generate minimizer alias mappings
3535
+ //
3536
+ // When using true SourceNodes, this will update all references to the given alias
3537
+ // as the source nodes are reused in situ. For the non-source node compilation mode,
3538
+ // aliases will not be used, but this case is already being run on the client and
3539
+ // we aren't concern about minimizing the template size.
3540
+ var aliasCount = 0;
3541
+ for (var alias in this.aliases) {
3542
+ // eslint-disable-line guard-for-in
3543
+ var node = this.aliases[alias];
3544
+
3545
+ if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) {
3546
+ varDeclarations += ', alias' + ++aliasCount + '=' + alias;
3547
+ node.children[0] = 'alias' + aliasCount;
3548
+ }
3549
+ }
3550
+
3551
+ var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
3552
+
3553
+ if (this.useBlockParams || this.useDepths) {
3554
+ params.push('blockParams');
3555
+ }
3556
+ if (this.useDepths) {
3557
+ params.push('depths');
3558
+ }
3559
+
3560
+ // Perform a second pass over the output to merge content when possible
3561
+ var source = this.mergeSource(varDeclarations);
3562
+
3563
+ if (asObject) {
3564
+ params.push(source);
3565
+
3566
+ return Function.apply(this, params);
3567
+ } else {
3568
+ return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
3569
+ }
3570
+ },
3571
+ mergeSource: function mergeSource(varDeclarations) {
3572
+ var isSimple = this.environment.isSimple,
3573
+ appendOnly = !this.forceBuffer,
3574
+ appendFirst = undefined,
3575
+ sourceSeen = undefined,
3576
+ bufferStart = undefined,
3577
+ bufferEnd = undefined;
3578
+ this.source.each(function (line) {
3579
+ if (line.appendToBuffer) {
3580
+ if (bufferStart) {
3581
+ line.prepend(' + ');
3582
+ } else {
3583
+ bufferStart = line;
3584
+ }
3585
+ bufferEnd = line;
3586
+ } else {
3587
+ if (bufferStart) {
3588
+ if (!sourceSeen) {
3589
+ appendFirst = true;
3590
+ } else {
3591
+ bufferStart.prepend('buffer += ');
3592
+ }
3593
+ bufferEnd.add(';');
3594
+ bufferStart = bufferEnd = undefined;
3595
+ }
3596
+
3597
+ sourceSeen = true;
3598
+ if (!isSimple) {
3599
+ appendOnly = false;
3600
+ }
3601
+ }
3602
+ });
3603
+
3604
+ if (appendOnly) {
3605
+ if (bufferStart) {
3606
+ bufferStart.prepend('return ');
3607
+ bufferEnd.add(';');
3608
+ } else if (!sourceSeen) {
3609
+ this.source.push('return "";');
3610
+ }
3611
+ } else {
3612
+ varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
3613
+
3614
+ if (bufferStart) {
3615
+ bufferStart.prepend('return buffer + ');
3616
+ bufferEnd.add(';');
3617
+ } else {
3618
+ this.source.push('return buffer;');
3619
+ }
3620
+ }
3621
+
3622
+ if (varDeclarations) {
3623
+ this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
3624
+ }
3625
+
3626
+ return this.source.merge();
3627
+ },
3628
+
3629
+ // [blockValue]
3630
+ //
3631
+ // On stack, before: hash, inverse, program, value
3632
+ // On stack, after: return value of blockHelperMissing
3633
+ //
3634
+ // The purpose of this opcode is to take a block of the form
3635
+ // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
3636
+ // replace it on the stack with the result of properly
3637
+ // invoking blockHelperMissing.
3638
+ blockValue: function blockValue(name) {
3639
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
3640
+ params = [this.contextName(0)];
3641
+ this.setupHelperArgs(name, 0, params);
3642
+
3643
+ var blockName = this.popStack();
3644
+ params.splice(1, 0, blockName);
3645
+
3646
+ this.push(this.source.functionCall(blockHelperMissing, 'call', params));
3647
+ },
3648
+
3649
+ // [ambiguousBlockValue]
3650
+ //
3651
+ // On stack, before: hash, inverse, program, value
3652
+ // Compiler value, before: lastHelper=value of last found helper, if any
3653
+ // On stack, after, if no lastHelper: same as [blockValue]
3654
+ // On stack, after, if lastHelper: value
3655
+ ambiguousBlockValue: function ambiguousBlockValue() {
3656
+ // We're being a bit cheeky and reusing the options value from the prior exec
3657
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
3658
+ params = [this.contextName(0)];
3659
+ this.setupHelperArgs('', 0, params, true);
3660
+
3661
+ this.flushInline();
3662
+
3663
+ var current = this.topStack();
3664
+ params.splice(1, 0, current);
3665
+
3666
+ this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
3667
+ },
3668
+
3669
+ // [appendContent]
3670
+ //
3671
+ // On stack, before: ...
3672
+ // On stack, after: ...
3673
+ //
3674
+ // Appends the string value of `content` to the current buffer
3675
+ appendContent: function appendContent(content) {
3676
+ if (this.pendingContent) {
3677
+ content = this.pendingContent + content;
3678
+ } else {
3679
+ this.pendingLocation = this.source.currentLocation;
3680
+ }
3681
+
3682
+ this.pendingContent = content;
3683
+ },
3684
+
3685
+ // [append]
3686
+ //
3687
+ // On stack, before: value, ...
3688
+ // On stack, after: ...
3689
+ //
3690
+ // Coerces `value` to a String and appends it to the current buffer.
3691
+ //
3692
+ // If `value` is truthy, or 0, it is coerced into a string and appended
3693
+ // Otherwise, the empty string is appended
3694
+ append: function append() {
3695
+ if (this.isInline()) {
3696
+ this.replaceStack(function (current) {
3697
+ return [' != null ? ', current, ' : ""'];
3698
+ });
3699
+
3700
+ this.pushSource(this.appendToBuffer(this.popStack()));
3701
+ } else {
3702
+ var local = this.popStack();
3703
+ this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
3704
+ if (this.environment.isSimple) {
3705
+ this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
3706
+ }
3707
+ }
3708
+ },
3709
+
3710
+ // [appendEscaped]
3711
+ //
3712
+ // On stack, before: value, ...
3713
+ // On stack, after: ...
3714
+ //
3715
+ // Escape `value` and append it to the buffer
3716
+ appendEscaped: function appendEscaped() {
3717
+ this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
3718
+ },
3719
+
3720
+ // [getContext]
3721
+ //
3722
+ // On stack, before: ...
3723
+ // On stack, after: ...
3724
+ // Compiler value, after: lastContext=depth
3725
+ //
3726
+ // Set the value of the `lastContext` compiler value to the depth
3727
+ getContext: function getContext(depth) {
3728
+ this.lastContext = depth;
3729
+ },
3730
+
3731
+ // [pushContext]
3732
+ //
3733
+ // On stack, before: ...
3734
+ // On stack, after: currentContext, ...
3735
+ //
3736
+ // Pushes the value of the current context onto the stack.
3737
+ pushContext: function pushContext() {
3738
+ this.pushStackLiteral(this.contextName(this.lastContext));
3739
+ },
3740
+
3741
+ // [lookupOnContext]
3742
+ //
3743
+ // On stack, before: ...
3744
+ // On stack, after: currentContext[name], ...
3745
+ //
3746
+ // Looks up the value of `name` on the current context and pushes
3747
+ // it onto the stack.
3748
+ lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
3749
+ var i = 0;
3750
+
3751
+ if (!scoped && this.options.compat && !this.lastContext) {
3752
+ // The depthed query is expected to handle the undefined logic for the root level that
3753
+ // is implemented below, so we evaluate that directly in compat mode
3754
+ this.push(this.depthedLookup(parts[i++]));
3755
+ } else {
3756
+ this.pushContext();
3757
+ }
3758
+
3759
+ this.resolvePath('context', parts, i, falsy, strict);
3760
+ },
3761
+
3762
+ // [lookupBlockParam]
3763
+ //
3764
+ // On stack, before: ...
3765
+ // On stack, after: blockParam[name], ...
3766
+ //
3767
+ // Looks up the value of `parts` on the given block param and pushes
3768
+ // it onto the stack.
3769
+ lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
3770
+ this.useBlockParams = true;
3771
+
3772
+ this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
3773
+ this.resolvePath('context', parts, 1);
3774
+ },
3775
+
3776
+ // [lookupData]
3777
+ //
3778
+ // On stack, before: ...
3779
+ // On stack, after: data, ...
3780
+ //
3781
+ // Push the data lookup operator
3782
+ lookupData: function lookupData(depth, parts, strict) {
3783
+ if (!depth) {
3784
+ this.pushStackLiteral('data');
3785
+ } else {
3786
+ this.pushStackLiteral('container.data(data, ' + depth + ')');
3787
+ }
3788
+
3789
+ this.resolvePath('data', parts, 0, true, strict);
3790
+ },
3791
+
3792
+ resolvePath: function resolvePath(type, parts, i, falsy, strict) {
3793
+ // istanbul ignore next
3794
+
3795
+ var _this = this;
3796
+
3797
+ if (this.options.strict || this.options.assumeObjects) {
3798
+ this.push(strictLookup(this.options.strict && strict, this, parts, type));
3799
+ return;
3800
+ }
3801
+
3802
+ var len = parts.length;
3803
+ for (; i < len; i++) {
3804
+ /* eslint-disable no-loop-func */
3805
+ this.replaceStack(function (current) {
3806
+ var lookup = _this.nameLookup(current, parts[i], type);
3807
+ // We want to ensure that zero and false are handled properly if the context (falsy flag)
3808
+ // needs to have the special handling for these values.
3809
+ if (!falsy) {
3810
+ return [' != null ? ', lookup, ' : ', current];
3811
+ } else {
3812
+ // Otherwise we can use generic falsy handling
3813
+ return [' && ', lookup];
3814
+ }
3815
+ });
3816
+ /* eslint-enable no-loop-func */
3817
+ }
3818
+ },
3819
+
3820
+ // [resolvePossibleLambda]
3821
+ //
3822
+ // On stack, before: value, ...
3823
+ // On stack, after: resolved value, ...
3824
+ //
3825
+ // If the `value` is a lambda, replace it on the stack by
3826
+ // the return value of the lambda
3827
+ resolvePossibleLambda: function resolvePossibleLambda() {
3828
+ this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
3829
+ },
3830
+
3831
+ // [pushStringParam]
3832
+ //
3833
+ // On stack, before: ...
3834
+ // On stack, after: string, currentContext, ...
3835
+ //
3836
+ // This opcode is designed for use in string mode, which
3837
+ // provides the string value of a parameter along with its
3838
+ // depth rather than resolving it immediately.
3839
+ pushStringParam: function pushStringParam(string, type) {
3840
+ this.pushContext();
3841
+ this.pushString(type);
3842
+
3843
+ // If it's a subexpression, the string result
3844
+ // will be pushed after this opcode.
3845
+ if (type !== 'SubExpression') {
3846
+ if (typeof string === 'string') {
3847
+ this.pushString(string);
3848
+ } else {
3849
+ this.pushStackLiteral(string);
3850
+ }
3851
+ }
3852
+ },
3853
+
3854
+ emptyHash: function emptyHash(omitEmpty) {
3855
+ if (this.trackIds) {
3856
+ this.push('{}'); // hashIds
3857
+ }
3858
+ if (this.stringParams) {
3859
+ this.push('{}'); // hashContexts
3860
+ this.push('{}'); // hashTypes
3861
+ }
3862
+ this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
3863
+ },
3864
+ pushHash: function pushHash() {
3865
+ if (this.hash) {
3866
+ this.hashes.push(this.hash);
3867
+ }
3868
+ this.hash = { values: [], types: [], contexts: [], ids: [] };
3869
+ },
3870
+ popHash: function popHash() {
3871
+ var hash = this.hash;
3872
+ this.hash = this.hashes.pop();
3873
+
3874
+ if (this.trackIds) {
3875
+ this.push(this.objectLiteral(hash.ids));
3876
+ }
3877
+ if (this.stringParams) {
3878
+ this.push(this.objectLiteral(hash.contexts));
3879
+ this.push(this.objectLiteral(hash.types));
3880
+ }
3881
+
3882
+ this.push(this.objectLiteral(hash.values));
3883
+ },
3884
+
3885
+ // [pushString]
3886
+ //
3887
+ // On stack, before: ...
3888
+ // On stack, after: quotedString(string), ...
3889
+ //
3890
+ // Push a quoted version of `string` onto the stack
3891
+ pushString: function pushString(string) {
3892
+ this.pushStackLiteral(this.quotedString(string));
3893
+ },
3894
+
3895
+ // [pushLiteral]
3896
+ //
3897
+ // On stack, before: ...
3898
+ // On stack, after: value, ...
3899
+ //
3900
+ // Pushes a value onto the stack. This operation prevents
3901
+ // the compiler from creating a temporary variable to hold
3902
+ // it.
3903
+ pushLiteral: function pushLiteral(value) {
3904
+ this.pushStackLiteral(value);
3905
+ },
3906
+
3907
+ // [pushProgram]
3908
+ //
3909
+ // On stack, before: ...
3910
+ // On stack, after: program(guid), ...
3911
+ //
3912
+ // Push a program expression onto the stack. This takes
3913
+ // a compile-time guid and converts it into a runtime-accessible
3914
+ // expression.
3915
+ pushProgram: function pushProgram(guid) {
3916
+ if (guid != null) {
3917
+ this.pushStackLiteral(this.programExpression(guid));
3918
+ } else {
3919
+ this.pushStackLiteral(null);
3920
+ }
3921
+ },
3922
+
3923
+ // [registerDecorator]
3924
+ //
3925
+ // On stack, before: hash, program, params..., ...
3926
+ // On stack, after: ...
3927
+ //
3928
+ // Pops off the decorator's parameters, invokes the decorator,
3929
+ // and inserts the decorator into the decorators list.
3930
+ registerDecorator: function registerDecorator(paramSize, name) {
3931
+ var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
3932
+ options = this.setupHelperArgs(name, paramSize);
3933
+
3934
+ this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
3935
+ },
3936
+
3937
+ // [invokeHelper]
3938
+ //
3939
+ // On stack, before: hash, inverse, program, params..., ...
3940
+ // On stack, after: result of helper invocation
3941
+ //
3942
+ // Pops off the helper's parameters, invokes the helper,
3943
+ // and pushes the helper's return value onto the stack.
3944
+ //
3945
+ // If the helper is not found, `helperMissing` is called.
3946
+ invokeHelper: function invokeHelper(paramSize, name, isSimple) {
3947
+ var nonHelper = this.popStack(),
3948
+ helper = this.setupHelper(paramSize, name),
3949
+ simple = isSimple ? [helper.name, ' || '] : '';
3950
+
3951
+ var lookup = ['('].concat(simple, nonHelper);
3952
+ if (!this.options.strict) {
3953
+ lookup.push(' || ', this.aliasable('helpers.helperMissing'));
3954
+ }
3955
+ lookup.push(')');
3956
+
3957
+ this.push(this.source.functionCall(lookup, 'call', helper.callParams));
3958
+ },
3959
+
3960
+ // [invokeKnownHelper]
3961
+ //
3962
+ // On stack, before: hash, inverse, program, params..., ...
3963
+ // On stack, after: result of helper invocation
3964
+ //
3965
+ // This operation is used when the helper is known to exist,
3966
+ // so a `helperMissing` fallback is not required.
3967
+ invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
3968
+ var helper = this.setupHelper(paramSize, name);
3969
+ this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
3970
+ },
3971
+
3972
+ // [invokeAmbiguous]
3973
+ //
3974
+ // On stack, before: hash, inverse, program, params..., ...
3975
+ // On stack, after: result of disambiguation
3976
+ //
3977
+ // This operation is used when an expression like `{{foo}}`
3978
+ // is provided, but we don't know at compile-time whether it
3979
+ // is a helper or a path.
3980
+ //
3981
+ // This operation emits more code than the other options,
3982
+ // and can be avoided by passing the `knownHelpers` and
3983
+ // `knownHelpersOnly` flags at compile-time.
3984
+ invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
3985
+ this.useRegister('helper');
3986
+
3987
+ var nonHelper = this.popStack();
3988
+
3989
+ this.emptyHash();
3990
+ var helper = this.setupHelper(0, name, helperCall);
3991
+
3992
+ var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
3993
+
3994
+ var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
3995
+ if (!this.options.strict) {
3996
+ lookup[0] = '(helper = ';
3997
+ lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing'));
3998
+ }
3999
+
4000
+ this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
4001
+ },
4002
+
4003
+ // [invokePartial]
4004
+ //
4005
+ // On stack, before: context, ...
4006
+ // On stack after: result of partial invocation
4007
+ //
4008
+ // This operation pops off a context, invokes a partial with that context,
4009
+ // and pushes the result of the invocation back.
4010
+ invokePartial: function invokePartial(isDynamic, name, indent) {
4011
+ var params = [],
4012
+ options = this.setupParams(name, 1, params);
4013
+
4014
+ if (isDynamic) {
4015
+ name = this.popStack();
4016
+ delete options.name;
4017
+ }
4018
+
4019
+ if (indent) {
4020
+ options.indent = JSON.stringify(indent);
4021
+ }
4022
+ options.helpers = 'helpers';
4023
+ options.partials = 'partials';
4024
+ options.decorators = 'container.decorators';
4025
+
4026
+ if (!isDynamic) {
4027
+ params.unshift(this.nameLookup('partials', name, 'partial'));
4028
+ } else {
4029
+ params.unshift(name);
4030
+ }
4031
+
4032
+ if (this.options.compat) {
4033
+ options.depths = 'depths';
4034
+ }
4035
+ options = this.objectLiteral(options);
4036
+ params.push(options);
4037
+
4038
+ this.push(this.source.functionCall('container.invokePartial', '', params));
4039
+ },
4040
+
4041
+ // [assignToHash]
4042
+ //
4043
+ // On stack, before: value, ..., hash, ...
4044
+ // On stack, after: ..., hash, ...
4045
+ //
4046
+ // Pops a value off the stack and assigns it to the current hash
4047
+ assignToHash: function assignToHash(key) {
4048
+ var value = this.popStack(),
4049
+ context = undefined,
4050
+ type = undefined,
4051
+ id = undefined;
4052
+
4053
+ if (this.trackIds) {
4054
+ id = this.popStack();
4055
+ }
4056
+ if (this.stringParams) {
4057
+ type = this.popStack();
4058
+ context = this.popStack();
4059
+ }
4060
+
4061
+ var hash = this.hash;
4062
+ if (context) {
4063
+ hash.contexts[key] = context;
4064
+ }
4065
+ if (type) {
4066
+ hash.types[key] = type;
4067
+ }
4068
+ if (id) {
4069
+ hash.ids[key] = id;
4070
+ }
4071
+ hash.values[key] = value;
4072
+ },
4073
+
4074
+ pushId: function pushId(type, name, child) {
4075
+ if (type === 'BlockParam') {
4076
+ this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
4077
+ } else if (type === 'PathExpression') {
4078
+ this.pushString(name);
4079
+ } else if (type === 'SubExpression') {
4080
+ this.pushStackLiteral('true');
4081
+ } else {
4082
+ this.pushStackLiteral('null');
4083
+ }
4084
+ },
4085
+
4086
+ // HELPERS
4087
+
4088
+ compiler: JavaScriptCompiler,
4089
+
4090
+ compileChildren: function compileChildren(environment, options) {
4091
+ var children = environment.children,
4092
+ child = undefined,
4093
+ compiler = undefined;
4094
+
4095
+ for (var i = 0, l = children.length; i < l; i++) {
4096
+ child = children[i];
4097
+ compiler = new this.compiler(); // eslint-disable-line new-cap
4098
+
4099
+ var index = this.matchExistingProgram(child);
4100
+
4101
+ if (index == null) {
4102
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
4103
+ index = this.context.programs.length;
4104
+ child.index = index;
4105
+ child.name = 'program' + index;
4106
+ this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
4107
+ this.context.decorators[index] = compiler.decorators;
4108
+ this.context.environments[index] = child;
4109
+
4110
+ this.useDepths = this.useDepths || compiler.useDepths;
4111
+ this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
4112
+ } else {
4113
+ child.index = index;
4114
+ child.name = 'program' + index;
4115
+
4116
+ this.useDepths = this.useDepths || child.useDepths;
4117
+ this.useBlockParams = this.useBlockParams || child.useBlockParams;
4118
+ }
4119
+ }
4120
+ },
4121
+ matchExistingProgram: function matchExistingProgram(child) {
4122
+ for (var i = 0, len = this.context.environments.length; i < len; i++) {
4123
+ var environment = this.context.environments[i];
4124
+ if (environment && environment.equals(child)) {
4125
+ return i;
4126
+ }
4127
+ }
4128
+ },
4129
+
4130
+ programExpression: function programExpression(guid) {
4131
+ var child = this.environment.children[guid],
4132
+ programParams = [child.index, 'data', child.blockParams];
4133
+
4134
+ if (this.useBlockParams || this.useDepths) {
4135
+ programParams.push('blockParams');
4136
+ }
4137
+ if (this.useDepths) {
4138
+ programParams.push('depths');
4139
+ }
4140
+
4141
+ return 'container.program(' + programParams.join(', ') + ')';
4142
+ },
4143
+
4144
+ useRegister: function useRegister(name) {
4145
+ if (!this.registers[name]) {
4146
+ this.registers[name] = true;
4147
+ this.registers.list.push(name);
4148
+ }
4149
+ },
4150
+
4151
+ push: function push(expr) {
4152
+ if (!(expr instanceof Literal)) {
4153
+ expr = this.source.wrap(expr);
4154
+ }
4155
+
4156
+ this.inlineStack.push(expr);
4157
+ return expr;
4158
+ },
4159
+
4160
+ pushStackLiteral: function pushStackLiteral(item) {
4161
+ this.push(new Literal(item));
4162
+ },
4163
+
4164
+ pushSource: function pushSource(source) {
4165
+ if (this.pendingContent) {
4166
+ this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
4167
+ this.pendingContent = undefined;
4168
+ }
4169
+
4170
+ if (source) {
4171
+ this.source.push(source);
4172
+ }
4173
+ },
4174
+
4175
+ replaceStack: function replaceStack(callback) {
4176
+ var prefix = ['('],
4177
+ stack = undefined,
4178
+ createdStack = undefined,
4179
+ usedLiteral = undefined;
4180
+
4181
+ /* istanbul ignore next */
4182
+ if (!this.isInline()) {
4183
+ throw new _exception2['default']('replaceStack on non-inline');
4184
+ }
4185
+
4186
+ // We want to merge the inline statement into the replacement statement via ','
4187
+ var top = this.popStack(true);
4188
+
4189
+ if (top instanceof Literal) {
4190
+ // Literals do not need to be inlined
4191
+ stack = [top.value];
4192
+ prefix = ['(', stack];
4193
+ usedLiteral = true;
4194
+ } else {
4195
+ // Get or create the current stack name for use by the inline
4196
+ createdStack = true;
4197
+ var _name = this.incrStack();
4198
+
4199
+ prefix = ['((', this.push(_name), ' = ', top, ')'];
4200
+ stack = this.topStack();
4201
+ }
4202
+
4203
+ var item = callback.call(this, stack);
4204
+
4205
+ if (!usedLiteral) {
4206
+ this.popStack();
4207
+ }
4208
+ if (createdStack) {
4209
+ this.stackSlot--;
4210
+ }
4211
+ this.push(prefix.concat(item, ')'));
4212
+ },
4213
+
4214
+ incrStack: function incrStack() {
4215
+ this.stackSlot++;
4216
+ if (this.stackSlot > this.stackVars.length) {
4217
+ this.stackVars.push('stack' + this.stackSlot);
4218
+ }
4219
+ return this.topStackName();
4220
+ },
4221
+ topStackName: function topStackName() {
4222
+ return 'stack' + this.stackSlot;
4223
+ },
4224
+ flushInline: function flushInline() {
4225
+ var inlineStack = this.inlineStack;
4226
+ this.inlineStack = [];
4227
+ for (var i = 0, len = inlineStack.length; i < len; i++) {
4228
+ var entry = inlineStack[i];
4229
+ /* istanbul ignore if */
4230
+ if (entry instanceof Literal) {
4231
+ this.compileStack.push(entry);
4232
+ } else {
4233
+ var stack = this.incrStack();
4234
+ this.pushSource([stack, ' = ', entry, ';']);
4235
+ this.compileStack.push(stack);
4236
+ }
4237
+ }
4238
+ },
4239
+ isInline: function isInline() {
4240
+ return this.inlineStack.length;
4241
+ },
4242
+
4243
+ popStack: function popStack(wrapped) {
4244
+ var inline = this.isInline(),
4245
+ item = (inline ? this.inlineStack : this.compileStack).pop();
4246
+
4247
+ if (!wrapped && item instanceof Literal) {
4248
+ return item.value;
4249
+ } else {
4250
+ if (!inline) {
4251
+ /* istanbul ignore next */
4252
+ if (!this.stackSlot) {
4253
+ throw new _exception2['default']('Invalid stack pop');
4254
+ }
4255
+ this.stackSlot--;
4256
+ }
4257
+ return item;
4258
+ }
4259
+ },
4260
+
4261
+ topStack: function topStack() {
4262
+ var stack = this.isInline() ? this.inlineStack : this.compileStack,
4263
+ item = stack[stack.length - 1];
4264
+
4265
+ /* istanbul ignore if */
4266
+ if (item instanceof Literal) {
4267
+ return item.value;
4268
+ } else {
4269
+ return item;
4270
+ }
4271
+ },
4272
+
4273
+ contextName: function contextName(context) {
4274
+ if (this.useDepths && context) {
4275
+ return 'depths[' + context + ']';
4276
+ } else {
4277
+ return 'depth' + context;
4278
+ }
4279
+ },
4280
+
4281
+ quotedString: function quotedString(str) {
4282
+ return this.source.quotedString(str);
4283
+ },
4284
+
4285
+ objectLiteral: function objectLiteral(obj) {
4286
+ return this.source.objectLiteral(obj);
4287
+ },
4288
+
4289
+ aliasable: function aliasable(name) {
4290
+ var ret = this.aliases[name];
4291
+ if (ret) {
4292
+ ret.referenceCount++;
4293
+ return ret;
4294
+ }
4295
+
4296
+ ret = this.aliases[name] = this.source.wrap(name);
4297
+ ret.aliasable = true;
4298
+ ret.referenceCount = 1;
4299
+
4300
+ return ret;
4301
+ },
4302
+
4303
+ setupHelper: function setupHelper(paramSize, name, blockHelper) {
4304
+ var params = [],
4305
+ paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4306
+ var foundHelper = this.nameLookup('helpers', name, 'helper'),
4307
+ callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : {}');
4308
+
4309
+ return {
4310
+ params: params,
4311
+ paramsInit: paramsInit,
4312
+ name: foundHelper,
4313
+ callParams: [callContext].concat(params)
4314
+ };
4315
+ },
4316
+
4317
+ setupParams: function setupParams(helper, paramSize, params) {
4318
+ var options = {},
4319
+ contexts = [],
4320
+ types = [],
4321
+ ids = [],
4322
+ objectArgs = !params,
4323
+ param = undefined;
4324
+
4325
+ if (objectArgs) {
4326
+ params = [];
4327
+ }
4328
+
4329
+ options.name = this.quotedString(helper);
4330
+ options.hash = this.popStack();
4331
+
4332
+ if (this.trackIds) {
4333
+ options.hashIds = this.popStack();
4334
+ }
4335
+ if (this.stringParams) {
4336
+ options.hashTypes = this.popStack();
4337
+ options.hashContexts = this.popStack();
4338
+ }
4339
+
4340
+ var inverse = this.popStack(),
4341
+ program = this.popStack();
4342
+
4343
+ // Avoid setting fn and inverse if neither are set. This allows
4344
+ // helpers to do a check for `if (options.fn)`
4345
+ if (program || inverse) {
4346
+ options.fn = program || 'container.noop';
4347
+ options.inverse = inverse || 'container.noop';
4348
+ }
4349
+
4350
+ // The parameters go on to the stack in order (making sure that they are evaluated in order)
4351
+ // so we need to pop them off the stack in reverse order
4352
+ var i = paramSize;
4353
+ while (i--) {
4354
+ param = this.popStack();
4355
+ params[i] = param;
4356
+
4357
+ if (this.trackIds) {
4358
+ ids[i] = this.popStack();
4359
+ }
4360
+ if (this.stringParams) {
4361
+ types[i] = this.popStack();
4362
+ contexts[i] = this.popStack();
4363
+ }
4364
+ }
4365
+
4366
+ if (objectArgs) {
4367
+ options.args = this.source.generateArray(params);
4368
+ }
4369
+
4370
+ if (this.trackIds) {
4371
+ options.ids = this.source.generateArray(ids);
4372
+ }
4373
+ if (this.stringParams) {
4374
+ options.types = this.source.generateArray(types);
4375
+ options.contexts = this.source.generateArray(contexts);
4376
+ }
4377
+
4378
+ if (this.options.data) {
4379
+ options.data = 'data';
4380
+ }
4381
+ if (this.useBlockParams) {
4382
+ options.blockParams = 'blockParams';
4383
+ }
4384
+ return options;
4385
+ },
4386
+
4387
+ setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4388
+ var options = this.setupParams(helper, paramSize, params);
4389
+ options = this.objectLiteral(options);
4390
+ if (useRegister) {
4391
+ this.useRegister('options');
4392
+ params.push('options');
4393
+ return ['options=', options];
4394
+ } else if (params) {
4395
+ params.push(options);
4396
+ return '';
4397
+ } else {
4398
+ return options;
4399
+ }
4400
+ }
4401
+ };
4402
+
4403
+ (function () {
4404
+ var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
4405
+
4406
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
4407
+
4408
+ for (var i = 0, l = reservedWords.length; i < l; i++) {
4409
+ compilerWords[reservedWords[i]] = true;
4410
+ }
4411
+ })();
4412
+
4413
+ JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
4414
+ return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
4415
+ };
4416
+
4417
+ function strictLookup(requireTerminal, compiler, parts, type) {
4418
+ var stack = compiler.popStack(),
4419
+ i = 0,
4420
+ len = parts.length;
4421
+ if (requireTerminal) {
4422
+ len--;
4423
+ }
4424
+
4425
+ for (; i < len; i++) {
4426
+ stack = compiler.nameLookup(stack, parts[i], type);
4427
+ }
4428
+
4429
+ if (requireTerminal) {
4430
+ return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
4431
+ } else {
4432
+ return stack;
4433
+ }
4434
+ }
4435
+
4436
+ exports['default'] = JavaScriptCompiler;
4437
+ module.exports = exports['default'];
4438
+
4439
+ /***/ },
4440
+ /* 29 */
4441
+ /***/ function(module, exports, __webpack_require__) {
4442
+
4443
+ /* global define */
4444
+ 'use strict';
4445
+
4446
+ exports.__esModule = true;
4447
+
4448
+ var _utils = __webpack_require__(5);
4449
+
4450
+ var SourceNode = undefined;
4451
+
4452
+ try {
4453
+ /* istanbul ignore next */
4454
+ if (false) {
4455
+ // We don't support this in AMD environments. For these environments, we asusme that
4456
+ // they are running on the browser and thus have no need for the source-map library.
4457
+ var SourceMap = require('source-map');
4458
+ SourceNode = SourceMap.SourceNode;
4459
+ }
4460
+ } catch (err) {}
4461
+ /* NOP */
4462
+
4463
+ /* istanbul ignore if: tested but not covered in istanbul due to dist build */
4464
+ if (!SourceNode) {
4465
+ SourceNode = function (line, column, srcFile, chunks) {
4466
+ this.src = '';
4467
+ if (chunks) {
4468
+ this.add(chunks);
4469
+ }
4470
+ };
4471
+ /* istanbul ignore next */
4472
+ SourceNode.prototype = {
4473
+ add: function add(chunks) {
4474
+ if (_utils.isArray(chunks)) {
4475
+ chunks = chunks.join('');
4476
+ }
4477
+ this.src += chunks;
4478
+ },
4479
+ prepend: function prepend(chunks) {
4480
+ if (_utils.isArray(chunks)) {
4481
+ chunks = chunks.join('');
4482
+ }
4483
+ this.src = chunks + this.src;
4484
+ },
4485
+ toStringWithSourceMap: function toStringWithSourceMap() {
4486
+ return { code: this.toString() };
4487
+ },
4488
+ toString: function toString() {
4489
+ return this.src;
4490
+ }
4491
+ };
4492
+ }
4493
+
4494
+ function castChunk(chunk, codeGen, loc) {
4495
+ if (_utils.isArray(chunk)) {
4496
+ var ret = [];
4497
+
4498
+ for (var i = 0, len = chunk.length; i < len; i++) {
4499
+ ret.push(codeGen.wrap(chunk[i], loc));
4500
+ }
4501
+ return ret;
4502
+ } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
4503
+ // Handle primitives that the SourceNode will throw up on
4504
+ return chunk + '';
4505
+ }
4506
+ return chunk;
4507
+ }
4508
+
4509
+ function CodeGen(srcFile) {
4510
+ this.srcFile = srcFile;
4511
+ this.source = [];
4512
+ }
4513
+
4514
+ CodeGen.prototype = {
4515
+ isEmpty: function isEmpty() {
4516
+ return !this.source.length;
4517
+ },
4518
+ prepend: function prepend(source, loc) {
4519
+ this.source.unshift(this.wrap(source, loc));
4520
+ },
4521
+ push: function push(source, loc) {
4522
+ this.source.push(this.wrap(source, loc));
4523
+ },
4524
+
4525
+ merge: function merge() {
4526
+ var source = this.empty();
4527
+ this.each(function (line) {
4528
+ source.add([' ', line, '\n']);
4529
+ });
4530
+ return source;
4531
+ },
4532
+
4533
+ each: function each(iter) {
4534
+ for (var i = 0, len = this.source.length; i < len; i++) {
4535
+ iter(this.source[i]);
4536
+ }
4537
+ },
4538
+
4539
+ empty: function empty() {
4540
+ var loc = this.currentLocation || { start: {} };
4541
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
4542
+ },
4543
+ wrap: function wrap(chunk) {
4544
+ var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
4545
+
4546
+ if (chunk instanceof SourceNode) {
4547
+ return chunk;
4548
+ }
4549
+
4550
+ chunk = castChunk(chunk, this, loc);
4551
+
4552
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
4553
+ },
4554
+
4555
+ functionCall: function functionCall(fn, type, params) {
4556
+ params = this.generateList(params);
4557
+ return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
4558
+ },
4559
+
4560
+ quotedString: function quotedString(str) {
4561
+ return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
4562
+ .replace(/\u2029/g, '\\u2029') + '"';
4563
+ },
4564
+
4565
+ objectLiteral: function objectLiteral(obj) {
4566
+ var pairs = [];
4567
+
4568
+ for (var key in obj) {
4569
+ if (obj.hasOwnProperty(key)) {
4570
+ var value = castChunk(obj[key], this);
4571
+ if (value !== 'undefined') {
4572
+ pairs.push([this.quotedString(key), ':', value]);
4573
+ }
4574
+ }
4575
+ }
4576
+
4577
+ var ret = this.generateList(pairs);
4578
+ ret.prepend('{');
4579
+ ret.add('}');
4580
+ return ret;
4581
+ },
4582
+
4583
+ generateList: function generateList(entries) {
4584
+ var ret = this.empty();
4585
+
4586
+ for (var i = 0, len = entries.length; i < len; i++) {
4587
+ if (i) {
4588
+ ret.add(',');
4589
+ }
4590
+
4591
+ ret.add(castChunk(entries[i], this));
4592
+ }
4593
+
4594
+ return ret;
4595
+ },
4596
+
4597
+ generateArray: function generateArray(entries) {
4598
+ var ret = this.generateList(entries);
4599
+ ret.prepend('[');
4600
+ ret.add(']');
4601
+
4602
+ return ret;
4603
+ }
4604
+ };
4605
+
4606
+ exports['default'] = CodeGen;
4607
+ module.exports = exports['default'];
4608
+
4609
+ /***/ }
4610
+ /******/ ])
4611
+ });
4612
+ ;