card 1.96.8 → 1.97.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (488) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/config/initializers/01_core_extensions/hash.rb +7 -7
  4. data/config/initializers/01_core_extensions/object.rb +8 -4
  5. data/config/initializers/02_patches/kaminari.rb +0 -6
  6. data/config/locales/de.yml +7 -4
  7. data/config/locales/en.yml +46 -39
  8. data/db/migrate/20110511221913_require_earlier_migrations.rb +1 -0
  9. data/db/migrate/20120105203350_require_1_8_migrations.rb +1 -0
  10. data/db/migrate/20190116170824_add_left_key_to_card_virtuals.rb +11 -0
  11. data/db/migrate/20190131223248_add_codename_index.rb +9 -0
  12. data/db/migrate_core_cards/20120611203506_rails_inflection_updates.rb +8 -2
  13. data/db/migrate_core_cards/20180712042655_head_rule.rb +14 -0
  14. data/db/migrate_core_cards/20180905061536_migrate_layouts.rb +64 -0
  15. data/db/migrate_core_cards/20190125125150_add_script_rules_card.rb +9 -0
  16. data/db/migrate_core_cards/20190204195039_add_rule_card.rb +7 -0
  17. data/db/migrate_core_cards/data/decko_logo.svg +59 -0
  18. data/db/schema.rb +3 -2
  19. data/db/seed/new/card_actions.yml +1506 -1458
  20. data/db/seed/new/card_acts.yml +2 -2
  21. data/db/seed/new/card_references.yml +633 -633
  22. data/db/seed/new/cards.yml +1802 -1634
  23. data/db/seed/new/schema_migrations.yml +4 -0
  24. data/db/seed/new/schema_migrations_core_cards.yml +28 -2
  25. data/db/seed/test/fixtures/card_actions.yml +2485 -2533
  26. data/db/seed/test/fixtures/card_acts.yml +520 -460
  27. data/db/seed/test/fixtures/card_changes.yml +66 -66
  28. data/db/seed/test/fixtures/card_references.yml +1533 -1407
  29. data/db/seed/test/fixtures/cards.yml +3392 -2945
  30. data/db/seed/test/fixtures/schema_migrations.yml +4 -0
  31. data/db/seed/test/fixtures/schema_migrations_core_cards.yml +28 -2
  32. data/db/seed/test/seed.rb +33 -1
  33. data/db/version.txt +1 -1
  34. data/db/version_core_cards.txt +1 -1
  35. data/lib/card.rb +1 -0
  36. data/lib/card/act_manager.rb +6 -2
  37. data/lib/card/act_manager/stage.rb +5 -5
  38. data/lib/card/act_manager/stage_director.rb +11 -7
  39. data/lib/card/act_manager/stage_director/phases.rb +4 -8
  40. data/lib/card/auth.rb +1 -0
  41. data/lib/card/auth/current.rb +1 -1
  42. data/lib/card/auth/permissions.rb +1 -0
  43. data/lib/card/auth/proxy.rb +1 -0
  44. data/lib/card/cache.rb +10 -9
  45. data/lib/card/cache/persistent.rb +2 -1
  46. data/lib/card/cache/prepopulate.rb +1 -0
  47. data/lib/card/cache/temporary.rb +1 -0
  48. data/lib/card/codename.rb +11 -6
  49. data/lib/card/content/chunk.rb +24 -9
  50. data/lib/card/content/clean.rb +4 -2
  51. data/lib/card/content/diff.rb +4 -4
  52. data/lib/card/content/diff/lcs.rb +1 -3
  53. data/lib/card/content/diff/processor.rb +2 -0
  54. data/lib/card/content/diff/result.rb +3 -0
  55. data/lib/card/content/parser.rb +2 -1
  56. data/lib/card/content/truncate.rb +4 -1
  57. data/lib/card/dirty.rb +3 -2
  58. data/lib/card/env.rb +11 -2
  59. data/lib/card/env/location_history.rb +3 -1
  60. data/lib/card/env/success.rb +3 -1
  61. data/lib/card/error.rb +42 -8
  62. data/lib/card/format.rb +22 -9
  63. data/lib/card/format/content.rb +10 -2
  64. data/lib/card/format/context_names.rb +4 -2
  65. data/lib/card/format/error.rb +1 -1
  66. data/lib/card/format/nest.rb +4 -3
  67. data/lib/card/format/nesting.rb +2 -0
  68. data/lib/card/format/nesting/main.rb +11 -5
  69. data/lib/card/format/nesting/mode.rb +1 -0
  70. data/lib/card/format/nesting/subformat.rb +12 -0
  71. data/lib/card/format/permission.rb +3 -0
  72. data/lib/card/format/registration.rb +7 -3
  73. data/lib/card/format/render.rb +73 -17
  74. data/lib/card/mailer.rb +2 -1
  75. data/lib/card/mark.rb +2 -2
  76. data/lib/card/migration.rb +115 -113
  77. data/lib/card/migration/core.rb +1 -0
  78. data/lib/card/migration/deck_structure.rb +1 -0
  79. data/lib/card/migration/import.rb +1 -1
  80. data/lib/card/migration/import/import_data.rb +6 -3
  81. data/lib/card/migration/import/import_data/card_attributes.rb +56 -54
  82. data/lib/card/migration/import/import_data/card_content.rb +0 -1
  83. data/lib/card/mod.rb +4 -1
  84. data/lib/card/mod/dirs.rb +11 -2
  85. data/lib/card/mod/load_strategy.rb +4 -4
  86. data/lib/card/mod/load_strategy/set_binding_magic.rb +9 -5
  87. data/lib/card/mod/load_strategy/set_tmp_files.rb +1 -1
  88. data/lib/card/mod/load_strategy/tmp_files.rb +1 -0
  89. data/lib/card/mod/loader.rb +8 -9
  90. data/lib/card/mod/loader/set_loader.rb +4 -4
  91. data/lib/card/mod/loader/set_pattern_loader.rb +2 -2
  92. data/lib/card/mod/module_template.rb +12 -12
  93. data/lib/card/model/save_helper.rb +13 -4
  94. data/lib/card/name.rb +3 -2
  95. data/lib/card/name/name_variants.rb +3 -3
  96. data/lib/card/query.rb +19 -12
  97. data/lib/card/query/abstract_query/query_helper.rb +2 -0
  98. data/lib/card/query/card_query.rb +1 -0
  99. data/lib/card/query/card_query/conjunctions.rb +2 -0
  100. data/lib/card/query/card_query/interpretation.rb +2 -7
  101. data/lib/card/query/card_query/match_attributes.rb +1 -0
  102. data/lib/card/query/card_query/reference_attributes.rb +4 -4
  103. data/lib/card/query/card_query/run.rb +1 -0
  104. data/lib/card/query/card_query/sorting.rb +1 -0
  105. data/lib/card/query/clause.rb +14 -12
  106. data/lib/card/query/join.rb +4 -2
  107. data/lib/card/query/reference_query.rb +1 -0
  108. data/lib/card/query/sql_statement.rb +4 -8
  109. data/lib/card/query/sql_statement/joins.rb +1 -0
  110. data/lib/card/query/sql_statement/order.rb +7 -6
  111. data/lib/card/query/sql_statement/where.rb +3 -1
  112. data/lib/card/query/value.rb +1 -0
  113. data/lib/card/reference.rb +1 -0
  114. data/lib/card/set/advanced_api.rb +2 -2
  115. data/lib/card/set/code_nest.rb +15 -0
  116. data/lib/card/set/event.rb +4 -3
  117. data/lib/card/set/event/callbacks.rb +1 -0
  118. data/lib/card/set/event/delayed_event.rb +7 -6
  119. data/lib/card/set/event/options.rb +5 -1
  120. data/lib/card/set/format.rb +21 -0
  121. data/lib/card/set/format/abstract_format.rb +15 -6
  122. data/lib/card/set/format/haml_views.rb +1 -1
  123. data/lib/card/set/format/wrapper.rb +89 -0
  124. data/lib/card/set/helpers.rb +5 -0
  125. data/lib/card/set/i18n_scanner.rb +5 -4
  126. data/lib/card/set/i18n_scope.rb +10 -10
  127. data/lib/card/set/inheritance.rb +3 -0
  128. data/lib/card/set/loader.rb +1 -0
  129. data/lib/card/set/required_field.rb +74 -0
  130. data/lib/card/set/trait.rb +6 -0
  131. data/lib/card/set_pattern.rb +8 -4
  132. data/lib/card/subcards.rb +9 -1
  133. data/lib/card/subcards/add.rb +1 -3
  134. data/lib/card/subcards/remove.rb +2 -0
  135. data/lib/card/tasks/card.rake +2 -0
  136. data/lib/card/tasks/card/create.rake +2 -1
  137. data/lib/card/tasks/card/file_card_creator.rb +1 -1
  138. data/lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb +1 -0
  139. data/lib/card/tasks/card/migrate.rake +3 -3
  140. data/lib/card/version.rb +6 -4
  141. data/lib/card/view.rb +15 -2
  142. data/lib/card/view/cache.rb +12 -12
  143. data/lib/card/view/cache_action.rb +11 -14
  144. data/lib/card/view/classy.rb +168 -0
  145. data/lib/card/view/layout.rb +14 -0
  146. data/lib/card/view/options.rb +12 -8
  147. data/lib/card/view/options/key_lists.rb +4 -4
  148. data/lib/card/view/options/voo_api.rb +46 -9
  149. data/lib/card/view/stub.rb +2 -2
  150. data/lib/card/view/visibility.rb +4 -5
  151. data/lib/card/view/wrapper.rb +28 -0
  152. data/lib/cardio.rb +2 -1
  153. data/mod/Modfile +2 -0
  154. data/mod/account/set/right/account.rb +4 -6
  155. data/mod/account/set/right/password.rb +2 -2
  156. data/mod/account/set/self/signin.rb +16 -9
  157. data/mod/account/set/type/signup.rb +1 -1
  158. data/mod/account/spec/set/right/password_spec.rb +26 -19
  159. data/mod/account/spec/set/type/signup_spec.rb +1 -1
  160. data/mod/basic_formats/set/self/head.rb +4 -0
  161. data/mod/bootstrap/lib/javascript/script_load_select2.js.coffee +2 -0
  162. data/mod/bootstrap/lib/stylesheets/style_bootstrap_cards.scss +76 -21
  163. data/mod/bootstrap/lib/stylesheets/style_select2_bootstrap.scss +24 -6
  164. data/mod/bootstrap/set/abstract/bootswatch_theme/html_views.rb +2 -1
  165. data/mod/bootstrap/set/type/customized_bootswatch_skin/core.haml +2 -2
  166. data/mod/bootstrap/set/type/customized_bootswatch_skin/html_views.rb +14 -14
  167. data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors.rb +4 -0
  168. data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/core.haml +10 -0
  169. data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +2 -2
  170. data/mod/carrierwave/set/abstract/attachment.rb +1 -1
  171. data/mod/carrierwave/set/type/file.rb +4 -0
  172. data/mod/carrierwave/set/type/image.rb +13 -0
  173. data/mod/carrierwave/spec/lib/carrier_wave/file_card_uploader_spec.rb +2 -2
  174. data/mod/carrierwave/spec/set/type/file_spec.rb +4 -4
  175. data/mod/carrierwave/spec/set/type/image_spec.rb +6 -6
  176. data/mod/core/chunk/nest.rb +9 -1
  177. data/mod/core/format/html_format.rb +9 -45
  178. data/mod/core/layout/blank.html +5 -5
  179. data/mod/core/layout/default.html +10 -8
  180. data/mod/core/layout/noside.html +6 -9
  181. data/mod/core/layout/pre.html +1 -2
  182. data/mod/core/layout/simple.html +1 -5
  183. data/mod/core/set/abstract/code_file.rb +1 -1
  184. data/mod/core/set/all/cache.rb +0 -2
  185. data/mod/core/set/all/codename.rb +2 -0
  186. data/mod/core/set/all/collection.rb +3 -1
  187. data/mod/core/set/all/event_conditions.rb +36 -4
  188. data/mod/core/set/all/export.rb +1 -10
  189. data/mod/core/set/all/haml.rb +3 -2
  190. data/mod/core/set/all/layouts.rb +34 -0
  191. data/mod/core/set/all/name_events.rb +1 -1
  192. data/mod/core/set/all/pattern.rb +6 -11
  193. data/mod/core/set/all/subcards.rb +4 -0
  194. data/mod/core/set/all/utils.rb +21 -1
  195. data/mod/core/set_pattern/07_type_plus_right.rb +1 -1
  196. data/mod/core/set_pattern/08_rule.rb +17 -0
  197. data/mod/core/set_pattern/{08_self.rb → 09_self.rb} +0 -0
  198. data/mod/core/spec/format/html_format_spec.rb +6 -99
  199. data/mod/core/spec/set/all/codename_spec.rb +1 -1
  200. data/mod/core/spec/set/all/collection_spec.rb +9 -5
  201. data/mod/core/spec/set/all/event_conditions_spec.rb +91 -0
  202. data/mod/core/spec/set/all/pattern_spec.rb +17 -10
  203. data/mod/developer/spec/set/right/debug_spec.rb +1 -1
  204. data/mod/edit/set/all/bridge.rb +61 -0
  205. data/mod/edit/set/all/bridge/bridge.haml +6 -0
  206. data/mod/edit/set/all/bridge/follow_section.rb +37 -0
  207. data/mod/edit/set/all/bridge/tab_views.rb +75 -0
  208. data/mod/edit/set/all/bridge/tab_visibility.rb +51 -0
  209. data/mod/edit/set/all/edit_content.rb +58 -0
  210. data/mod/edit/set/all/edit_in_place.rb +58 -0
  211. data/mod/edit/set/all/edit_name.rb +87 -0
  212. data/mod/edit/set/all/edit_type.rb +28 -0
  213. data/mod/edit/set/all/editing.rb +79 -0
  214. data/mod/{standard/set/all/rich_html → edit/set/all}/editor.rb +1 -0
  215. data/mod/{standard/set/all/rich_html → edit/set/all}/form.rb +17 -10
  216. data/mod/edit/set/all/form_buttons.rb +52 -0
  217. data/mod/{standard/set/all/rich_html → edit/set/all}/form_elements.rb +2 -1
  218. data/mod/{standard/set/all/rich_html → edit/set/all}/formgroup.rb +3 -1
  219. data/mod/{standard/set/all/rich_html → edit/set/all}/new.rb +0 -2
  220. data/mod/edit/set/all/toolbar.rb +8 -0
  221. data/mod/edit/spec/set/all/bridge/tab_views_spec.rb +14 -0
  222. data/mod/{standard/spec/set/all/rich_html/editing_spec.rb → edit/spec/set/all/bridge_spec.rb} +1 -1
  223. data/mod/edit/spec/set/all/editing_spec.rb +15 -0
  224. data/mod/{standard/spec/set/all/rich_html → edit/spec/set/all}/form_elements_spec.rb +10 -8
  225. data/mod/edit/spec/set/all/form_spec.rb +50 -0
  226. data/mod/follow/lib/card/follower_stash.rb +5 -0
  227. data/mod/follow/set/abstract/follow_option.rb +0 -1
  228. data/mod/follow/set/all/follow/follow_link.rb +42 -54
  229. data/mod/follow/set/all/follow/follow_link_views.rb +29 -0
  230. data/mod/follow/set/all/follow/followed_by.rb +3 -0
  231. data/mod/follow/set/all/follow/follower_ids.rb +5 -0
  232. data/mod/follow/set/all/follow/start_follow_link.rb +11 -0
  233. data/mod/follow/set/all/follow/stop_follow_link.rb +12 -0
  234. data/mod/follow/set/all/notify.rb +4 -0
  235. data/mod/follow/set/all/notify/base_views.rb +11 -0
  236. data/mod/follow/set/right/account.rb +2 -1
  237. data/mod/follow/set/right/follow.rb +4 -0
  238. data/mod/follow/set/right/follow/follow_status.haml +2 -2
  239. data/mod/follow/set/right/followers.rb +1 -0
  240. data/mod/follow/set/right/following.rb +2 -3
  241. data/mod/follow/set/self/follow_defaults.rb +17 -16
  242. data/mod/follow/set/type/set.rb +2 -0
  243. data/mod/follow/set/type/user.rb +1 -0
  244. data/mod/follow/set/type_plus_right/user/follow.rb +1 -0
  245. data/mod/follow/set/type_plus_right/user/follow/follow_editor.haml +4 -1
  246. data/mod/follow/set/type_plus_right/user/follow/follow_editor_helper.rb +6 -0
  247. data/mod/follow/spec/set/all/follow/follow_link_views_spec.rb +27 -0
  248. data/mod/follow/spec/set/all/follow/start_follow_link_spec.rb +11 -0
  249. data/mod/follow/spec/set/all/follow/stop_follow_link_spec.rb +13 -0
  250. data/mod/follow/spec/set/all/follow_spec.rb +13 -9
  251. data/mod/follow/spec/set/all/notify_spec.rb +4 -3
  252. data/mod/follow/spec/set/right/account_spec.rb +29 -31
  253. data/mod/follow/spec/set/right/following_spec.rb +2 -8
  254. data/mod/history/lib/card/act.rb +9 -7
  255. data/mod/history/lib/card/act/act_renderer.rb +12 -9
  256. data/mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb +2 -2
  257. data/mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb +53 -0
  258. data/mod/history/lib/card/act/act_renderer/relative_act_renderer.rb +3 -0
  259. data/mod/history/lib/card/action.rb +9 -4
  260. data/mod/history/lib/card/action/action_renderer.rb +5 -3
  261. data/mod/history/lib/card/action/differ.rb +3 -0
  262. data/mod/history/set/all/history.rb +2 -1
  263. data/mod/history/set/all/history/act_listing.rb +11 -8
  264. data/mod/history/set/all/history/actions.rb +11 -2
  265. data/mod/history/set/all/history/events.rb +0 -1
  266. data/mod/history/set/all/history/last.rb +2 -1
  267. data/mod/history/set/all/history/revision.rb +1 -0
  268. data/mod/history/set/all/history/selected.rb +1 -1
  269. data/mod/history/set/all/history/views.rb +0 -1
  270. data/mod/history/set/all/history_bridge.rb +66 -0
  271. data/mod/item/set/all/bar.haml +1 -3
  272. data/mod/item/set/all/bar.rb +39 -21
  273. data/mod/item/set/all/box.haml +1 -0
  274. data/mod/item/set/all/box.rb +13 -3
  275. data/mod/item/set/all/expanded_bar.haml +4 -6
  276. data/mod/machines/file/all_script_machine_output/file.js +37380 -65
  277. data/mod/machines/file/all_style_machine_output/file.css +2 -2
  278. data/mod/machines/file/script_html5shiv_printshiv_machine_output/file.js +1 -1
  279. data/mod/machines/lib/javascript/decko.js.coffee +2 -17
  280. data/mod/machines/lib/javascript/decko_bridge.js.coffee +28 -0
  281. data/mod/machines/lib/javascript/decko_components.js.coffee +21 -0
  282. data/mod/machines/lib/javascript/decko_filter.js.coffee +3 -1
  283. data/mod/machines/lib/javascript/decko_mod.js.coffee +7 -64
  284. data/mod/machines/lib/javascript/decko_modal.js.coffee +108 -0
  285. data/mod/machines/lib/javascript/decko_navbox.js.coffee +2 -0
  286. data/mod/machines/lib/javascript/decko_overlay.js.coffee +42 -0
  287. data/mod/machines/lib/javascript/decko_recaptcha.js.coffee +9 -1
  288. data/mod/machines/lib/javascript/decko_slot.js.coffee +46 -50
  289. data/mod/machines/lib/javascript/decko_slotter.js.coffee +204 -63
  290. data/mod/machines/lib/javascript/script_card_menu.js.coffee +3 -3
  291. data/mod/machines/lib/stylesheets/style_cards.scss +234 -107
  292. data/mod/machines/set/abstract/machine.rb +4 -3
  293. data/mod/machines/set/self/script_slot.rb +2 -2
  294. data/mod/machines/set/type/css.rb +8 -1
  295. data/mod/machines/set/type/skin.rb +1 -1
  296. data/mod/machines/spec/set/type/coffeescript_spec.rb +3 -3
  297. data/mod/pointer/set/abstract/00_paging_params.rb +2 -0
  298. data/mod/pointer/set/abstract/01_paging.rb +12 -6
  299. data/mod/pointer/set/abstract/02_pointer/html_views.rb +25 -0
  300. data/mod/pointer/set/abstract/02_pointer/html_views/filter.rb +20 -4
  301. data/mod/pointer/set/abstract/02_pointer/html_views/filter/filter_items.haml +1 -6
  302. data/mod/pointer/set/abstract/02_pointer/html_views/filter/filtered_list_input.haml +4 -13
  303. data/mod/pointer/set/type/pointer.rb +9 -0
  304. data/mod/pointer/spec/set/abstract/pointer/events_spec.rb +6 -0
  305. data/mod/rules/lib/javascript/script_rules.js.coffee +23 -0
  306. data/mod/rules/set/rstar/rule_user.rb +8 -0
  307. data/mod/rules/set/rule/bridge_rules_editor.rb +32 -0
  308. data/mod/rules/set/rule/editor.rb +144 -0
  309. data/mod/rules/set/rule/rule_form.rb +57 -0
  310. data/mod/rules/set/rule/rule_form/buttons.rb +44 -0
  311. data/mod/rules/set/rule/rule_form/form_elements.rb +52 -0
  312. data/mod/rules/set/rule/rule_form/rule_form.haml +20 -0
  313. data/mod/rules/set/rule/rule_form/rule_set_radio.rb +86 -0
  314. data/mod/rules/set/rule/rule_form/set_selection.rb +46 -0
  315. data/mod/{standard/set/rstar → rules/set/rule}/rules.rb +5 -9
  316. data/mod/rules/set/rule/table.rb +27 -0
  317. data/mod/rules/set/rule/table_row.rb +62 -0
  318. data/mod/rules/set/self/script_rules.rb +3 -0
  319. data/mod/{standard → rules}/set/type/set.rb +8 -10
  320. data/mod/rules/set/type/set/html_views.rb +72 -0
  321. data/mod/{standard → rules}/set/type/set/html_views/group_panel.haml +0 -0
  322. data/mod/rules/set/type/set/html_views/rules_bridge.rb +129 -0
  323. data/mod/rules/set/type/set/html_views/rules_table.haml +11 -0
  324. data/mod/{standard → rules}/set/type/set/html_views/template.rb +3 -7
  325. data/mod/{standard → rules}/set/type/set/html_views/template/template_editor.haml +0 -0
  326. data/mod/rules/spec/set/rule/editor_spec.rb +9 -0
  327. data/mod/rules/spec/set/rule/table_row_spec.rb +9 -0
  328. data/mod/rules/spec/set/rule/table_spec.rb +15 -0
  329. data/mod/rules/spec/set/type/set/html_views_spec.rb +22 -0
  330. data/mod/{standard → rules}/spec/set/type/set_spec.rb +18 -18
  331. data/mod/search/set/abstract/00_filter_helper.rb +15 -7
  332. data/mod/search/set/abstract/01_filter_form_helper.rb +1 -0
  333. data/mod/search/set/abstract/02_search_params.rb +7 -5
  334. data/mod/search/set/abstract/03_filter.rb +3 -2
  335. data/mod/search/set/abstract/04_right_filter_form.rb +1 -2
  336. data/mod/search/set/abstract/search.rb +1 -1
  337. data/mod/search/set/abstract/search/views.rb +2 -0
  338. data/mod/search/set/abstract/wql_search.rb +6 -0
  339. data/mod/search/set/self/navbox.rb +1 -1
  340. data/mod/search/set/self/search.rb +2 -2
  341. data/mod/settings/lib/card/setting.rb +6 -1
  342. data/mod/settings/set/right/help.rb +4 -0
  343. data/mod/settings/set/right/read.rb +14 -4
  344. data/mod/settings/set/right/structure.rb +3 -0
  345. data/mod/settings/set/right/style.rb +2 -1
  346. data/mod/settings/set/self/create.rb +2 -1
  347. data/mod/settings/set/self/default.rb +2 -1
  348. data/mod/settings/set/self/delete.rb +2 -1
  349. data/mod/settings/set/self/head.rb +2 -0
  350. data/mod/settings/set/self/help.rb +2 -1
  351. data/mod/settings/set/self/input.rb +1 -1
  352. data/mod/settings/set/self/read.rb +2 -1
  353. data/mod/settings/set/self/structure.rb +2 -1
  354. data/mod/settings/set/self/thanks.rb +2 -1
  355. data/mod/settings/set/self/update.rb +2 -1
  356. data/mod/settings/set/type/setting.rb +1 -1
  357. data/mod/solid_cache/set/abstract/solid_cache.rb +2 -2
  358. data/mod/standard/file/logo/image-original.svg +59 -0
  359. data/mod/standard/lib/card/layout.rb +79 -0
  360. data/mod/standard/lib/card/layout/card_layout.rb +44 -0
  361. data/mod/standard/lib/card/layout/code_layout.rb +9 -0
  362. data/mod/standard/lib/card/layout/proc_layout.rb +9 -0
  363. data/mod/standard/lib/card/layout/unknown_layout.rb +20 -0
  364. data/mod/standard/set/all/links.rb +5 -20
  365. data/mod/standard/set/all/rich_html.rb +4 -0
  366. data/mod/standard/set/all/rich_html/alert.rb +23 -0
  367. data/mod/standard/set/all/rich_html/content.rb +26 -100
  368. data/mod/standard/set/all/rich_html/error.rb +27 -3
  369. data/mod/standard/set/all/rich_html/error/debug_server_error.haml +1015 -0
  370. data/mod/standard/set/all/rich_html/frame.rb +10 -54
  371. data/mod/standard/set/all/rich_html/header.rb +25 -15
  372. data/mod/standard/set/all/rich_html/header/header_wrap.haml +2 -1
  373. data/mod/standard/set/all/rich_html/html_views/help.rb +18 -0
  374. data/mod/standard/set/all/rich_html/html_views/info.rb +59 -0
  375. data/mod/standard/set/all/rich_html/html_views/size.rb +17 -0
  376. data/mod/standard/set/all/rich_html/menu.rb +44 -146
  377. data/mod/standard/set/all/rich_html/modal.rb +99 -24
  378. data/mod/standard/set/all/rich_html/modal/modal_dialog.haml +12 -0
  379. data/mod/standard/set/all/rich_html/overlay.rb +57 -13
  380. data/mod/standard/set/all/rich_html/process_layout.rb +91 -0
  381. data/mod/standard/set/all/rich_html/show.rb +37 -0
  382. data/mod/standard/set/all/rich_html/wrapper.rb +47 -10
  383. data/mod/standard/set/right/head.rb +11 -0
  384. data/mod/standard/set/type/cardtype.rb +1 -1
  385. data/mod/standard/set/type/listed_by.rb +3 -3
  386. data/mod/standard/spec/set/all/email_html_format_spec.rb +17 -0
  387. data/mod/standard/spec/set/all/links_spec.rb +1 -22
  388. data/mod/standard/spec/set/all/rich_html/overlay_spec.rb +18 -0
  389. data/mod/standard/spec/set/all/rich_html/process_layout/explicit_modal_wrapper_spec.rb +29 -0
  390. data/mod/standard/spec/set/all/rich_html/process_layout_spec.rb +110 -0
  391. data/mod/standard/spec/set/all/rich_html/show_spec.rb +9 -0
  392. data/mod/standard/spec/set/all/rich_html/wrapper_spec.rb +17 -24
  393. data/mod/standard/spec/set/type/email_template/email_config_spec.rb +9 -5
  394. data/mod/standard/spec/set/type/layout_type_spec.rb +6 -0
  395. data/mod/standard/spec/set/type/search_type_spec.rb +1 -1
  396. data/mod/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb +23 -0
  397. data/mod/tinymce_editor/lib/javascript/script_tinymce.js +9 -2
  398. data/mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee +3 -2
  399. data/mod/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js +92 -1
  400. data/mod/tinymce_editor/public/assets/tinymce/plugins/advlist/plugin.min.js +9 -1
  401. data/mod/tinymce_editor/public/assets/tinymce/plugins/anchor/plugin.min.js +9 -1
  402. data/mod/tinymce_editor/public/assets/tinymce/plugins/autolink/plugin.min.js +9 -1
  403. data/mod/tinymce_editor/public/assets/tinymce/plugins/autoresize/plugin.min.js +9 -1
  404. data/mod/tinymce_editor/public/assets/tinymce/plugins/autosave/plugin.min.js +9 -1
  405. data/mod/tinymce_editor/public/assets/tinymce/plugins/bbcode/plugin.min.js +9 -1
  406. data/mod/tinymce_editor/public/assets/tinymce/plugins/charmap/plugin.min.js +9 -1
  407. data/mod/tinymce_editor/public/assets/tinymce/plugins/code/plugin.min.js +9 -1
  408. data/mod/tinymce_editor/public/assets/tinymce/plugins/codesample/plugin.min.js +9 -1
  409. data/mod/tinymce_editor/public/assets/tinymce/plugins/colorpicker/plugin.min.js +9 -1
  410. data/mod/tinymce_editor/public/assets/tinymce/plugins/contextmenu/plugin.min.js +9 -1
  411. data/mod/tinymce_editor/public/assets/tinymce/plugins/directionality/plugin.min.js +9 -1
  412. data/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js +9015 -0
  413. data/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  414. data/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js +9 -1
  415. data/mod/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js +9 -1
  416. data/mod/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js +9 -1
  417. data/mod/tinymce_editor/public/assets/tinymce/plugins/help/plugin.min.js +9 -1
  418. data/mod/tinymce_editor/public/assets/tinymce/plugins/hr/plugin.min.js +9 -1
  419. data/mod/tinymce_editor/public/assets/tinymce/plugins/image/plugin.min.js +9 -1
  420. data/mod/tinymce_editor/public/assets/tinymce/plugins/imagetools/plugin.min.js +9 -1
  421. data/mod/tinymce_editor/public/assets/tinymce/plugins/importcss/plugin.min.js +9 -1
  422. data/mod/tinymce_editor/public/assets/tinymce/plugins/insertdatetime/plugin.min.js +9 -1
  423. data/mod/tinymce_editor/public/assets/tinymce/plugins/legacyoutput/plugin.min.js +9 -1
  424. data/mod/tinymce_editor/public/assets/tinymce/plugins/link/plugin.min.js +9 -1
  425. data/mod/tinymce_editor/public/assets/tinymce/plugins/lists/plugin.min.js +9 -1
  426. data/mod/tinymce_editor/public/assets/tinymce/plugins/media/plugin.min.js +9 -1
  427. data/mod/tinymce_editor/public/assets/tinymce/plugins/nonbreaking/plugin.min.js +9 -1
  428. data/mod/tinymce_editor/public/assets/tinymce/plugins/noneditable/plugin.min.js +9 -1
  429. data/mod/tinymce_editor/public/assets/tinymce/plugins/pagebreak/plugin.min.js +9 -1
  430. data/mod/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js +9 -1
  431. data/mod/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js +9 -1
  432. data/mod/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js +9 -1
  433. data/mod/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js +9 -0
  434. data/mod/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js +9 -1
  435. data/mod/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js +9 -1
  436. data/mod/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js +9 -1
  437. data/mod/tinymce_editor/public/assets/tinymce/plugins/tabfocus/plugin.min.js +9 -1
  438. data/mod/tinymce_editor/public/assets/tinymce/plugins/table/plugin.min.js +9 -1
  439. data/mod/tinymce_editor/public/assets/tinymce/plugins/template/plugin.min.js +9 -1
  440. data/mod/tinymce_editor/public/assets/tinymce/plugins/textcolor/plugin.min.js +9 -1
  441. data/mod/tinymce_editor/public/assets/tinymce/plugins/textpattern/plugin.min.js +9 -1
  442. data/mod/tinymce_editor/public/assets/tinymce/plugins/toc/plugin.min.js +9 -1
  443. data/mod/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js +9 -1
  444. data/mod/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js +9 -1
  445. data/mod/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js +9 -1
  446. data/mod/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css +7 -0
  447. data/mod/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css +7 -0
  448. data/mod/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css +7 -0
  449. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
  450. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
  451. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
  452. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
  453. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css +7 -0
  454. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css +1 -0
  455. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  456. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css +7 -0
  457. data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css +1 -0
  458. data/mod/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js +9 -1
  459. data/mod/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js +9 -0
  460. data/mod/tinymce_editor/public/assets/tinymce/tinymce.min.js +9 -2
  461. data/mod/utility/spec/set/abstract/media_spec.rb +6 -6
  462. data/mod/virtual/lib/card/virtual.rb +17 -2
  463. data/mod/virtual/set/abstract/virtual_cache.rb +1 -1
  464. data/mod/virtual/spec/set/lib/card/virtual_spec.rb +1 -1
  465. metadata +121 -42
  466. data/mod/core/layout/modal.html +0 -9
  467. data/mod/core/layout/simple_modal.html +0 -3
  468. data/mod/follow/spec/set/all/follow/follow_link_spec.rb +0 -7
  469. data/mod/standard/file/logo/image-icon.png +0 -0
  470. data/mod/standard/file/logo/image-large.png +0 -0
  471. data/mod/standard/file/logo/image-medium.png +0 -0
  472. data/mod/standard/file/logo/image-original.png +0 -0
  473. data/mod/standard/file/logo/image-small.png +0 -0
  474. data/mod/standard/set/abstract/toolbar_split_button.rb +0 -22
  475. data/mod/standard/set/all/rich_html/classy.rb +0 -37
  476. data/mod/standard/set/all/rich_html/editing.rb +0 -176
  477. data/mod/standard/set/all/rich_html/related.rb +0 -30
  478. data/mod/standard/set/all/rich_html/toolbar.rb +0 -264
  479. data/mod/standard/set/rstar/rules_editor.rb +0 -371
  480. data/mod/standard/set/self/activity_toolbar_button.rb +0 -14
  481. data/mod/standard/set/self/rules_toolbar_button.rb +0 -44
  482. data/mod/standard/set/type/set/html_views.rb +0 -155
  483. data/mod/standard/set/type/set/html_views/rules_table.haml +0 -9
  484. data/mod/standard/spec/set/all/rich_html/form_spec.rb +0 -47
  485. data/mod/standard/spec/set/all/rich_html/toolbar_spec.rb +0 -25
  486. data/mod/standard/spec/set/rstar/rules_spec.rb +0 -26
  487. data/mod/standard/spec/set/self/activity_toolbar_button_spec.rb +0 -22
  488. data/mod/standard/spec/set/type/set/html_views_spec.rb +0 -10
@@ -0,0 +1 @@
1
+ .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position:absolute;display:inline-block;background-color:green;opacity:.5}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ */
7
+ .tox,.tox :not(svg){background:0 0;border:0;box-sizing:content-box;color:#222f3e;cursor:auto;direction:ltr;float:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:400;height:auto;line-height:normal;margin:0;max-width:none;outline:0;padding:0;position:static;-webkit-tap-highlight-color:transparent;text-align:left;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal;width:auto}.tox :not(svg){color:inherit;cursor:inherit;font-size:inherit}.tox-tinymce{border:1px solid #ccc;border-radius:0;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;overflow:hidden;visibility:inherit!important}.tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox-editor-container>:first-child{border-top:none!important}.tox-tinymce-aux{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.tox-tinymce :focus,.tox-tinymce-aux :focus{outline:0}button::-moz-focus-inner{border:0}.tox-silver-sink{z-index:1300}.tox[dir=rtl]{direction:rtl}.tox[dir=rtl] .tox-statusbar__resize-handle{justify-content:flex-start;margin-left:-8px;margin-right:0;padding-left:0;padding-right:1ch}.tox[dir=rtl] .tox-statusbar .tox-statusbar__path{text-align:right}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#3498db;background-image:none;background-position:none;background-repeat:none;border-color:#3498db;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px;font-weight:700;letter-spacing:1;line-height:24px;margin:0;outline:0;padding:4px 16px;text-align:center;text-decoration:none;text-transform:capitalize;white-space:nowrap}.tox .tox-button[disabled]{background-color:#3498db;background-image:none;border-color:#3498db;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#258cd1;background-image:none;border-color:#258cd1;box-shadow:none;color:#fff}.tox .tox-button:hover:not(:disabled){background-color:#258cd1;background-image:none;border-color:#258cd1;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#217dbb;background-image:none;border-color:#217dbb;box-shadow:none;color:#fff}.tox .tox-button--secondary{background-color:#f0f0f0;background-image:none;background-position:none;background-repeat:none;border-color:#f0f0f0;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;outline:0;padding:4px 16px;text-decoration:none;text-transform:capitalize}.tox .tox-button--secondary[disabled]{background-color:#f0f0f0;background-image:none;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:hover:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:active:not(:disabled){background-color:#d6d6d6;background-image:none;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked:hover:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:focus:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:active:not(:disabled){background-color:#d6d6d6;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon{color:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#222f3e}.tox .tox-checkbox{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;left:-10000px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{border-radius:3px;box-shadow:0 0 0 2px transparent;height:24px;padding:calc(3px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(34,47,62,.3)}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#3498db}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#3498db}.tox .tox-checkbox__label{margin-left:4px}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:3px;box-shadow:inset 0 0 0 1px #3498db;padding:calc(3px)}.tox .tox-bar .tox-checkbox{margin-left:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#ccc;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#e6e6e6;color:rgba(34,47,62,.6);cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;color:#222f3e;cursor:pointer;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item--state-disabled{background-color:unset;color:rgba(34,47,62,.5);cursor:default}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:inherit;color:contrast(inherit,#222f3e,#fff)}.tox .tox-collection--list .tox-collection__item--active{background-color:#dee0e2;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#c8cbcf;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#dee0e2;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#c8cbcf;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active{background-color:#dee0e2;color:#222f3e}.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox .tox-collection__item[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;-ms-flex-preferred-size:auto;font-size:14px;font-style:normal;font-weight:400;line-height:24px;text-transform:none;word-break:break-all}.tox .tox-collection--list .tox-collection__item-label:first-child{margin-left:4px}.tox .tox-collection__item-accessory{color:rgba(34,47,62,.6);display:inline-block;font-size:14px;height:24px;line-height:24px;margin-left:16px;text-align:right;text-transform:normal}.tox .tox-collection__item-caret{align-items:center;display:flex;margin-left:16px;min-height:24px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{border:1px solid #000;box-sizing:border-box;display:flex;height:100%;margin-right:15px}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{border:1px solid #000;box-sizing:border-box;height:100%;margin-right:15px;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;height:4px;margin-left:-1px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form label{margin-right:.5em}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:2px 0 3px 4px}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;margin-left:auto;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#dee0e2}.tox .tox-comment-thread{background:#fff;position:relative}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment{background:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);padding:8px 8px 16px 8px;position:relative}.tox .tox-comment__header{align-items:center;color:#222f3e;display:flex;justify-content:space-between}.tox .tox-comment__date{color:rgba(34,47,62,.6);font-size:12px}.tox .tox-comment__body{color:#222f3e;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(34,47,62,.6);font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment__buttonspacing>:last-child{margin-left:8px}.tox .tox-comment-thread__overlay::after{background:#fff;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__reply>:last-child{margin-left:8px}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-left:8px;margin-top:16px}.tox .tox-comment__edit>:last-child{margin-left:8px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(255,255,255,0),#fff);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#fff;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#222f3e;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#fff;box-shadow:0 0 8px 8px #fff;color:#222f3e;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#fff;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:1103}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(34,47,62,.6);margin-right:8px}.tox .tox-user__name{color:rgba(34,47,62,.6);font-size:12px;font-style:normal;font-weight:700;text-transform:uppercase}.tox .tox-user__avatar+.tox-user__name{margin-left:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(255,255,255,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1101}.tox .tox-dialog{background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:1102}.tox .tox-dialog__header{align-items:center;background-color:#fff;border-bottom:none;color:#222f3e;display:flex;font-size:16px;justify-content:space-between;margin-bottom:16px;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:normal}.tox .tox-dialog__body{color:#222f3e;display:flex;flex:1;-ms-flex-preferred-size:auto;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;padding:0 16px;text-align:left;text-transform:normal}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;margin-right:32px}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(34,47,62,.6);display:inline-block;font-size:14px;line-height:1.3;margin-bottom:8px;text-decoration:none}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #3498db;color:#3498db}.tox .tox-dialog__body-content{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto;max-height:650px;overflow:auto}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__body-content--spacious{margin-bottom:16px}.tox .tox-dialog__footer{align-items:center;background-color:#fff;border-top:1px solid #ccc;display:flex;justify-content:space-between;margin-top:16px;padding:8px 16px}.tox .tox-dialog__footer .tox-dialog__footer-end>*,.tox .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(255,255,255,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:1103}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #ccc}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}body.tox-dialog__disable-scroll{overflow:hidden}.tox .tox-dropzone-container{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #ccc;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(34,47,62,.6);margin:0 0 16px 0}.tox .tox-edit-area{border-top:1px solid #ccc;display:flex;flex:1;-ms-flex-preferred-size:auto;overflow:hidden;position:relative}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;-ms-flex-preferred-size:auto;height:100%;position:absolute;width:100%}.tox.tox-inline-edit-area{border:1px dotted #ccc}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap .tox-textfield{padding-right:32px}.tox .tox-control-wrap__status-icon-wrap{position:absolute;right:4px;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:transparent}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{max-width:25em}.tox .tox-color-input{display:flex}.tox .tox-color-input .tox-textfield{border-radius:3px 0 0 3px;display:flex}.tox .tox-color-input span{border-color:rgba(34,47,62,.2);border-radius:0 3px 3px 0;border-style:solid;border-width:1px 1px 1px 0;box-shadow:none;box-sizing:border-box;cursor:pointer;display:flex;width:35px}.tox .tox-color-input span:focus{border-color:#3498db}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(34,47,62,.6);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:normal;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-textarea{flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select{padding-right:24px}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield svg{pointer-events:none;position:absolute;right:8px;top:50%;transform:translateY(-50%)}.tox .tox-textarea{white-space:pre-wrap}.tox .tox-selectfield select,.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{border-color:#3498db;box-shadow:none;outline:0}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-toolbar-textfield+*{margin-left:4px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#3498db;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#222f3e}.tox-fullscreen{border:0;height:100%;left:0;margin:0;overflow:hidden;padding:0;position:fixed;top:0;width:100%}.tox-fullscreen .tox .tox-statusbar__resize-handle{display:none}.tox-fullscreen .tox.tox-tinymce{z-index:1200}.tox-fullscreen .tox.tox-tinymce-aux{z-index:1201}.tox .tox-image-tools{width:100%}.tox .tox-image-tools__toolbar{align-items:center;display:flex;justify-content:center}.tox .tox-image-tools__image{background-color:#666;height:380px;overflow:auto;position:relative;width:100%}.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top:8px}.tox .tox-image-tools__image-bg{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left:8px}.tox .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left:32px}.tox .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left:32px}.tox .tox-image-tools__toolbar>.tox-spacer{flex:1;-ms-flex-preferred-size:auto}.tox .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:169px}.tox .tox-insert-table-picker>div{border-color:#ccc;border-style:solid;border-width:0 1px 1px 0;box-sizing:content-box;height:16px;width:16px}.tox .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px 0}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:rgba(52,152,219,.5);border-color:rgba(52,152,219,.5)}.tox .tox-insert-table-picker__label{color:rgba(34,47,62,.6);display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox .tox-menu{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);display:inline-block;overflow:hidden;vertical-align:top;z-index:1}.tox .tox-menu.tox-collection.tox-collection--list{padding:0}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:4px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:4px}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='43px' viewBox='0 0 40 43px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='42px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;margin-bottom:-1px;padding:0 4px}.tox .tox-mbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0 4px;text-transform:normal;width:auto}.tox .tox-mbtn[disabled]{background-color:none;border-color:none;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-mbtn:hover:not(:disabled){background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-mbtn:focus:not(:disabled){background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-mbtn--active{background:#c8cbcf;box-shadow:none;color:#222f3e}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{background-color:#fff;border-color:#c5c5c5;border-style:solid;border-width:1px;box-sizing:border-box;display:-ms-grid;display:grid;-ms-grid-columns:minmax(40px,1fr) auto minmax(40px,1fr);grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:5px;opacity:0;padding:5px;transition:transform .1s ease-in,opacity 150ms ease-in}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#dff0d8;border-color:#d6e9c6}.tox .tox-notification--error{background-color:#f2dede;border-color:#ebccd1}.tox .tox-notification--warn{background-color:#fcf8e3;border-color:#faebcc}.tox .tox-notification--info{background-color:#d9edf7;border-color:#779ecb}.tox .tox-notification__body{-ms-grid-row-align:center;align-self:center;color:#31708f;font-size:14px;grid-column-end:3;-ms-grid-column-span:1;-ms-grid-column:2;grid-column-start:2;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{-ms-grid-row-align:center;align-self:center;-ms-grid-column-align:end;grid-column-end:2;-ms-grid-column-span:1;-ms-grid-column:1;grid-column-start:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{-ms-grid-row-align:start;align-self:start;-ms-grid-column-align:end;grid-column-end:4;-ms-grid-column-span:1;-ms-grid-column:3;grid-column-start:3;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;justify-self:end}.tox .tox-notification .tox-progress-bar{-ms-grid-column-align:center;grid-column-end:4;-ms-grid-column-span:3;-ms-grid-column:1;grid-column-start:1;grid-row-end:3;-ms-grid-row-span:1;-ms-grid-row:2;grid-row-start:2;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar{flex-wrap:nowrap}.tox .tox-pop__dialog{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:'';display:block;height:0;position:absolute;width:0}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#fff transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#ccc transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #fff transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #ccc transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #fff transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #ccc transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #fff;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #ccc;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;min-height:0}.tox .tox-sidebar{display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-slider{align-items:center;display:flex;flex:1;-ms-flex-preferred-size:auto;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #ccc;border-radius:6px;height:6px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#3498db;border-radius:1.5px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:3px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(34,47,62,.6);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}.tox .tox-spinner>div:not(:first-child){margin-left:4px}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox .tox-statusbar{align-items:center;background-color:#fff;border-top:1px solid #ccc;color:rgba(34,47,62,.6);display:flex;flex:0 0 auto;font-size:12px;height:18px;overflow:hidden;padding:0 8px;position:relative;text-transform:uppercase}.tox .tox-statusbar a{color:rgba(34,47,62,.6);text-decoration:none}.tox .tox-statusbar a:hover{text-decoration:underline}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:flex-end;overflow:hidden}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__path>*{display:inline;margin-right:4px;white-space:nowrap}.tox .tox-statusbar__branding,.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-left:1ch}.tox .tox-statusbar__resize-handle svg{display:block;fill:rgba(34,47,62,.6)}.tox .tox-tbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0;text-transform:normal;width:34px}.tox .tox-tbtn svg{display:block;fill:#222f3e}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn+.tox-tbtn{margin-left:0}.tox .tox-tbtn--enabled{background:#c8cbcf;box-shadow:none;color:#222f3e}.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--enabled svg{fill:#222f3e}.tox .tox-tbtn:hover{background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-tbtn:hover svg{fill:#222f3e}.tox .tox-tbtn:focus{background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-tbtn:focus svg{fill:#222f3e}.tox .tox-tbtn:active{background:#c8cbcf;box-shadow:none;color:#222f3e}.tox .tox-tbtn:active svg{fill:#222f3e}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:0 0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(34,47,62,.5)}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:51px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:68px;width:68px}.tox .tox-tbtn--return{-ms-grid-row-align:stretch;align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tbtn--select{margin:2px 0 3px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(34,47,62,.6)}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:2px 0 3px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #dee0e2 inset}.tox .tox-split-button:focus{background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(34,47,62,.6)}.tox .tox-pop .tox-split-button__chevron svg{transform:rotate(-90deg)}.tox .tox-split-button .tox-tbtn{margin:0}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:0 0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color:#fff;border-top:1px solid #ccc;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;margin-bottom:-1px;padding:0 0}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{display:none}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox.tox-tinymce-aux .tox-toolbar__overflow{border-left:1px solid #ccc;border-radius:6px;border-right:1px solid #ccc}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px}.tox .tox-toolbar__group:not(:last-of-type){border-right:1px solid #ccc}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:3px;box-shadow:0 2px 4px rgba(34,47,62,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:normal}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #ccc;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #ccc;border-radius:3px;display:flex;height:525px}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox ul{display:block;list-style-type:disc;-webkit-margin-before:1em;margin-block-start:1em;-webkit-margin-after:1em;margin-block-end:1em;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0;-webkit-padding-start:40px;padding-inline-start:40px}.tox a{cursor:pointer;color:#2276d2}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px}
@@ -0,0 +1 @@
1
+ .tinymce-mobile-outer-container{all:initial;display:block}.tinymce-mobile-outer-container *{-webkit-box-sizing:initial;box-sizing:initial;line-height:1;margin:0;padding:0;border:0;outline:0;text-shadow:none;float:none;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent}.tinymce-mobile-icon-arrow-back:before{content:"\e5cd"}.tinymce-mobile-icon-image:before{content:"\e412"}.tinymce-mobile-icon-cancel-circle:before{content:"\e5c9"}.tinymce-mobile-icon-full-dot:before{content:"\e061"}.tinymce-mobile-icon-align-center:before{content:"\e234"}.tinymce-mobile-icon-align-left:before{content:"\e236"}.tinymce-mobile-icon-align-right:before{content:"\e237"}.tinymce-mobile-icon-bold:before{content:"\e238"}.tinymce-mobile-icon-italic:before{content:"\e23f"}.tinymce-mobile-icon-unordered-list:before{content:"\e241"}.tinymce-mobile-icon-ordered-list:before{content:"\e242"}.tinymce-mobile-icon-font-size:before{content:"\e245"}.tinymce-mobile-icon-underline:before{content:"\e249"}.tinymce-mobile-icon-link:before{content:"\e157"}.tinymce-mobile-icon-unlink:before{content:"\eca2"}.tinymce-mobile-icon-color:before{content:"\e891"}.tinymce-mobile-icon-previous:before{content:"\e314"}.tinymce-mobile-icon-next:before{content:"\e315"}.tinymce-mobile-icon-large-font:before,.tinymce-mobile-icon-style-formats:before{content:"\e264"}.tinymce-mobile-icon-undo:before{content:"\e166"}.tinymce-mobile-icon-redo:before{content:"\e15a"}.tinymce-mobile-icon-removeformat:before{content:"\e239"}.tinymce-mobile-icon-small-font:before{content:"\e906"}.tinymce-mobile-icon-readonly-back:before,.tinymce-mobile-format-matches:after{content:"\e5ca"}.tinymce-mobile-icon-small-heading:before{content:"small"}.tinymce-mobile-icon-large-heading:before{content:"large"}.tinymce-mobile-icon-small-heading:before,.tinymce-mobile-icon-large-heading:before{font-family:sans-serif;font-size:80%}.tinymce-mobile-mask-edit-icon:before{content:"\e254"}.tinymce-mobile-icon-back:before{content:"\e5c4"}.tinymce-mobile-icon-heading:before{content:"Headings";font-family:sans-serif;font-weight:bold;font-size:80%}.tinymce-mobile-icon-h1:before{content:"H1";font-weight:bold}.tinymce-mobile-icon-h2:before{content:"H2";font-weight:bold}.tinymce-mobile-icon-h3:before{content:"H3";font-weight:bold}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;width:100%;height:100%;top:0px;background:rgba(51,51,51,0.5)}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-border-radius:50%;border-radius:50%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;font-family:sans-serif;font-size:1em}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{-webkit-border-radius:50%;border-radius:50%;width:2.1em;height:2.1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media only screen and (min-device-width:700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1.2em}}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{-webkit-border-radius:50%;border-radius:50%;width:2.1em;height:2.1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;color:#1976D2;background-color:white}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon:before{font-family:'tinymce-mobile';content:"\e900"}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index:2}.tinymce-mobile-android-container.tinymce-mobile-android-maximized{position:fixed;top:0;bottom:0;left:0;right:0;border:none;background:#fff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position:relative}.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display:-webkit-box !important;display:-webkit-flex !important;display:-ms-flexbox !important;display:flex !important;height:auto !important;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-android-scroll-reload{overflow:hidden}:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#fff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;z-index:1;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:100%;height:2.5em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;background-color:#fff;border-bottom:1px solid #ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#1976D2;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin-left:2px;margin-right:2px;height:80%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#c8cbcf;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;padding-top:.4em;padding-bottom:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;width:100%;min-height:1.5em;padding-left:0em;padding-right:0em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{-webkit-transition:left cubic-bezier(.4, 0, 1, 1) .15s;transition:left cubic-bezier(.4, 0, 1, 1) .15s;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{position:absolute;right:0px;color:#888;font-size:.6em;font-weight:bold;background:inherit;-webkit-border-radius:50%;border-radius:50%;border:none;-webkit-align-self:center;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;height:100%;padding-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next:before{padding-left:.5em;padding-right:.5em;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;font-weight:bold}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled:before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{margin:0 2px;font-size:10px;line-height:10px;padding-top:3px;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#c8cbcf}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;position:relative;padding:.28em 0;margin-left:10%;margin-right:10%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading:before{margin-right:.9em;margin-left:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading:before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{margin-left:0px;margin-right:0px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-top:.3em;margin-bottom:.3em;background:#ccc;height:.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-top:.3em;margin-bottom:.3em;background:-webkit-gradient(linear, left top, right top, from(hsl(0,100%,50%)), color-stop(17%, hsl(60,100%,50%)), color-stop(33%, hsl(120,100%,50%)), color-stop(50%, hsl(180,100%,50%)), color-stop(67%, hsl(240,100%,50%)), color-stop(83%, hsl(300,100%,50%)), to(hsl(0,100%,50%)));background:linear-gradient(to right, hsl(0,100%,50%) 0%, hsl(60,100%,50%) 17%, hsl(120,100%,50%) 33%, hsl(180,100%,50%) 50%, hsl(240,100%,50%) 67%, hsl(300,100%,50%) 83%, hsl(0,100%,50%) 100%);height:.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:black;width:1.2em;height:.2em;margin-top:.3em;margin-bottom:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:white;width:1.2em;height:.2em;margin-top:.3em;margin-bottom:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{position:absolute;height:.5em;width:.5em;left:-10px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:auto;top:0;bottom:0;-webkit-transition:border 120ms cubic-bezier(.39, .58, .57, 1);transition:border 120ms cubic-bezier(.39, .58, .57, 1);background-color:#455a64;background-clip:padding-box;color:#fff;border:.5em solid rgba(136,136,136,0);-webkit-border-radius:3em;border-radius:3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,0.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{padding-top:.1em;padding-bottom:.1em;padding-left:5px;font-size:.85em;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;background:#fff;border:none;-webkit-border-radius:0px;border-radius:0px;color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input:-ms-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation: landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-dropup{background:white;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;overflow:hidden}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{-webkit-transition:height .3s ease-out;transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{-webkit-transition:height .3s ease-in;transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-styles-menu{overflow:hidden;outline:4px solid black;position:relative;width:100%;font-family:sans-serif}.tinymce-mobile-styles-menu [role="menu"]{height:100%;position:absolute;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%}.tinymce-mobile-styles-menu [role="menu"].transitioning{-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{cursor:pointer;padding:1em 1em;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-bottom:1px solid #ddd;color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon:before{font-family:'tinymce-mobile';content:"\e314";color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu:after{font-family:'tinymce-mobile';content:"\e315";position:absolute;padding-left:1em;padding-right:1em;right:0px;color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches:after{font-family:'tinymce-mobile';position:absolute;padding-left:1em;padding-right:1em;right:0px}.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator,.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser{border-top:#455a64;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;background:#fff;color:#455a64}.tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="before"]{-webkit-transform:translate(-100%);transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="current"]{-webkit-transform:translate(0%);transform:translate(0%)}.tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="after"]{-webkit-transform:translate(100%);transform:translate(100%)}@font-face{font-family:'tinymce-mobile';src:url('fonts/tinymce-mobile.woff?8x92w3') format('woff');font-weight:normal;font-style:normal}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:'tinymce-mobile'}.mixin-flex-and-centre{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.mixin-flex-bar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%}.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{background-color:#FFF;width:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{overflow:hidden;height:300px}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{position:fixed;right:2em;bottom:1em;color:white;background-color:#1976D2;-webkit-border-radius:50%;border-radius:50%;width:2.1em;height:2.1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}input[type="file"]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}}
@@ -1 +1,9 @@
1
- !function(){"use strict";var n,e,t,o,r,i,u,a,c,s=function(n){return function(){return n}},f=s(!1),l=s(!0),O={noop:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},noarg:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t()}},compose:function(t,o){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(o.apply(null,arguments))}},constant:s,identity:function(n){return n},tripleEquals:function(n,e){return n===e},curry:function(i){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var u=new Array(arguments.length-1),t=1;t<arguments.length;t++)u[t-1]=arguments[t];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=new Array(arguments.length),o=0;o<t.length;o++)t[o]=arguments[o];var r=u.concat(t);return i.apply(null,r)}},not:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,arguments)}},die:function(n){return function(){throw new Error(n)}},apply:function(n){return n()},call:function(n){n()},never:f,always:l},d=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},E={isString:d("string"),isObject:d("object"),isArray:d("array"),isNull:d("null"),isBoolean:d("boolean"),isUndefined:d("undefined"),isFunction:d("function"),isNumber:d("number")},m=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},o=0;o<n.length;o++){var r=n[o];for(var i in r)r.hasOwnProperty(i)&&(t[i]=u(t[i],r[i]))}return t}},g=m(function(n,e){return E.isObject(n)&&E.isObject(e)?g(n,e):e}),p=m(function(n,e){return e}),D={deepMerge:g,merge:p},h=O.never,v=O.always,y=function(){return b},b=(o={fold:function(n,e){return n()},is:h,isSome:h,isNone:v,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},or:t,orThunk:e,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:h,forall:v,filter:y,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:O.constant("none()")},Object.freeze&&Object.freeze(o),o),w=function(t){var n=function(){return t},e=function(){return r},o=function(n){return n(t)},r={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:v,isNone:h,getOr:n,getOrThunk:n,getOrDie:n,or:e,orThunk:e,map:function(n){return w(n(t))},ap:function(n){return n.fold(y,function(n){return w(n(t))})},each:function(n){n(t)},bind:o,flatten:n,exists:o,forall:o,filter:function(n){return n(t)?r:b},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(h,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return r},x={some:w,none:y,from:function(n){return null===n||n===undefined?b:w(n)}},T=(r=Object.keys)===undefined?function(n){var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(t);return e}:r,S=function(n,e){for(var t=T(n),o=0,r=t.length;o<r;o++){var i=t[o];e(n[i],i,n)}},k=function(o,r){var i={};return S(o,function(n,e){var t=r(n,e,o);i[t.k]=t.v}),i},C=function(n,t){var o=[];return S(n,function(n,e){o.push(t(n,e))}),o},A=function(n){return C(n,function(n){return n})},M={bifilter:function(n,t){var o={},r={};return S(n,function(n,e){(t(n,e)?o:r)[e]=n}),{t:o,f:r}},each:S,map:function(n,o){return k(n,function(n,e,t){return{k:e,v:o(n,e,t)}})},mapToArray:C,tupleMap:k,find:function(n,e){for(var t=T(n),o=0,r=t.length;o<r;o++){var i=t[o],u=n[i];if(e(u,i,n))return x.some(u)}return x.none()},keys:T,values:A,size:function(n){return A(n).length}},B=(O.constant("contextmenu"),O.constant("touchstart")),R=O.constant("touchmove"),I=O.constant("touchend"),F=(O.constant("gesturestart"),O.constant("mousedown")),N=O.constant("mousemove"),V=(O.constant("mouseout"),O.constant("mouseup")),H=O.constant("mouseover"),j=(O.constant("focusin"),O.constant("keydown")),z=O.constant("input"),L=O.constant("change"),P=(O.constant("focus"),O.constant("click")),W=O.constant("transitionend"),U=O.constant("selectstart"),G=function(n){var e,t=!1;return function(){return t||(t=!0,e=n.apply(null,arguments)),e}},$=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var o=n[t];if(o.test(e))return o}return undefined}(n,e);if(!t)return{major:0,minor:0};var o=function(n){return Number(e.replace(t,"$"+n))};return _(o(1),o(2))},q=function(){return _(0,0)},_=function(n,e){return{major:n,minor:e}},K={nu:_,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?q():$(n,t)},unknown:q},X="Firefox",Y=function(n,e){return function(){return e===n}},J=function(n){var e=n.current;return{current:e,version:n.version,isEdge:Y("Edge",e),isChrome:Y("Chrome",e),isIE:Y("IE",e),isOpera:Y("Opera",e),isFirefox:Y(X,e),isSafari:Y("Safari",e)}},Q={unknown:function(){return J({current:undefined,version:K.unknown()})},nu:J,edge:O.constant("Edge"),chrome:O.constant("Chrome"),ie:O.constant("IE"),opera:O.constant("Opera"),firefox:O.constant(X),safari:O.constant("Safari")},Z="Windows",nn="Android",en="Solaris",tn="FreeBSD",on=function(n,e){return function(){return e===n}},rn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:on(Z,e),isiOS:on("iOS",e),isAndroid:on(nn,e),isOSX:on("OSX",e),isLinux:on("Linux",e),isSolaris:on(en,e),isFreeBSD:on(tn,e)}},un={unknown:function(){return rn({current:undefined,version:K.unknown()})},nu:rn,windows:O.constant(Z),ios:O.constant("iOS"),android:O.constant(nn),linux:O.constant("Linux"),osx:O.constant("OSX"),solaris:O.constant(en),freebsd:O.constant(tn)},an=(i=Array.prototype.indexOf)===undefined?function(n,e){return gn(n,e)}:function(n,e){return i.call(n,e)},cn=function(n,e){return-1<an(n,e)},sn=function(n,e){for(var t=n.length,o=new Array(t),r=0;r<t;r++){var i=n[r];o[r]=e(i,r,n)}return o},fn=function(n,e){for(var t=0,o=n.length;t<o;t++)e(n[t],t,n)},ln=function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t,n)},dn=function(n,e){for(var t=[],o=0,r=n.length;o<r;o++){var i=n[o];e(i,o,n)&&t.push(i)}return t},mn=function(n,e){for(var t=0,o=n.length;t<o;t++)if(e(n[t],t,n))return x.some(t);return x.none()},gn=function(n,e){for(var t=0,o=n.length;t<o;++t)if(n[t]===e)return t;return-1},pn=Array.prototype.push,hn=function(n){for(var e=[],t=0,o=n.length;t<o;++t){if(!Array.prototype.isPrototypeOf(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);pn.apply(e,n[t])}return e},vn=function(n,e){for(var t=0,o=n.length;t<o;++t)if(!0!==e(n[t],t,n))return!1;return!0},yn=Array.prototype.slice,bn=E.isFunction(Array.from)?Array.from:function(n){return yn.call(n)},wn={map:sn,each:fn,eachr:ln,partition:function(n,e){for(var t=[],o=[],r=0,i=n.length;r<i;r++){var u=n[r];(e(u,r,n)?t:o).push(u)}return{pass:t,fail:o}},filter:dn,groupBy:function(n,e){if(0===n.length)return[];for(var t=e(n[0]),o=[],r=[],i=0,u=n.length;i<u;i++){var a=n[i],c=e(a);c!==t&&(o.push(r),r=[]),t=c,r.push(a)}return 0!==r.length&&o.push(r),o},indexOf:function(n,e){var t=an(n,e);return-1===t?x.none():x.some(t)},foldr:function(n,e,t){return ln(n,function(n){t=e(t,n)}),t},foldl:function(n,e,t){return fn(n,function(n){t=e(t,n)}),t},find:function(n,e){for(var t=0,o=n.length;t<o;t++){var r=n[t];if(e(r,t,n))return x.some(r)}return x.none()},findIndex:mn,flatten:hn,bind:function(n,e){var t=sn(n,e);return hn(t)},forall:vn,exists:function(n,e){return mn(n,e).isSome()},contains:cn,equal:function(n,t){return n.length===t.length&&vn(n,function(n,e){return n===t[e]})},reverse:function(n){var e=yn.call(n,0);return e.reverse(),e},chunk:function(n,e){for(var t=[],o=0;o<n.length;o+=e){var r=n.slice(o,o+e);t.push(r)}return t},difference:function(n,e){return dn(n,function(n){return!cn(e,n)})},mapToObject:function(n,e){for(var t={},o=0,r=n.length;o<r;o++){var i=n[o];t[String(i)]=e(i,o)}return t},pure:function(n){return[n]},sort:function(n,e){var t=yn.call(n,0);return t.sort(e),t},range:function(n,e){for(var t=[],o=0;o<n;o++)t.push(e(o));return t},head:function(n){return 0===n.length?x.none():x.some(n[0])},last:function(n){return 0===n.length?x.none():x.some(n[n.length-1])},from:bn},xn=function(n,e){var t=String(e).toLowerCase();return wn.find(n,function(n){return n.search(t)})},Tn=function(n,t){return xn(n,t).map(function(n){var e=K.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Sn=function(n,t){return xn(n,t).map(function(n){var e=K.detect(n.versionRegexes,t);return{current:n.name,version:e}})},kn=function(n,e){return e+n},Cn=function(n,e){return n+e},On=function(n,e){return n.substring(e)},En=function(n,e){return n.substring(0,n.length-e)},Dn=function(n){return""===n?x.none():x.some(n.substr(0,1))},An=function(n){return""===n?x.none():x.some(n.substring(1))},Mn=function(n,e,t){return""===e||!(n.length<e.length)&&n.substr(t,t+e.length)===e},Bn=function(n,e){return Mn(n,e,0)},Rn=function(n,e){return Mn(n,e,n.length-e.length)},In={supplant:function(n,r){return n.replace(/\${([^{}]*)}/g,function(n,e){var t,o=r[e];return"string"==(t=typeof o)||"number"===t?o:n})},startsWith:Bn,removeLeading:function(n,e){return Bn(n,e)?On(n,e.length):n},removeTrailing:function(n,e){return Rn(n,e)?En(n,e.length):n},ensureLeading:function(n,e){return Bn(n,e)?n:kn(n,e)},ensureTrailing:function(n,e){return Rn(n,e)?n:Cn(n,e)},endsWith:Rn,contains:function(n,e){return-1!==n.indexOf(e)},trim:function(n){return n.replace(/^\s+|\s+$/g,"")},lTrim:function(n){return n.replace(/^\s+/g,"")},rTrim:function(n){return n.replace(/\s+$/g,"")},capitalize:function(n){return Dn(n).bind(function(e){return An(n).map(function(n){return e.toUpperCase()+n})}).getOr(n)}},Fn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Nn=function(e){return function(n){return In.contains(n,e)}},Vn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return In.contains(n,"edge/")&&In.contains(n,"chrome")&&In.contains(n,"safari")&&In.contains(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Fn],search:function(n){return In.contains(n,"chrome")&&!In.contains(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return In.contains(n,"msie")||In.contains(n,"trident")}},{name:"Opera",versionRegexes:[Fn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Nn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Nn("firefox")},{name:"Safari",versionRegexes:[Fn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(In.contains(n,"safari")||In.contains(n,"mobile/"))&&In.contains(n,"applewebkit")}}],Hn=[{name:"Windows",search:Nn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return In.contains(n,"iphone")||In.contains(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Nn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Nn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Nn("linux"),versionRegexes:[]},{name:"Solaris",search:Nn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Nn("freebsd"),versionRegexes:[]}],jn={browsers:O.constant(Vn),oses:O.constant(Hn)},zn=function(n){var e,t,o,r,i,u,a,c,s,f,l,d=jn.browsers(),m=jn.oses(),g=Tn(d,n).fold(Q.unknown,Q.nu),p=Sn(m,n).fold(un.unknown,un.nu);return{browser:g,os:p,deviceType:(t=g,o=n,r=(e=p).isiOS()&&!0===/ipad/i.test(o),i=e.isiOS()&&!r,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=r||u||a&&!0===/mobile/i.test(o),s=e.isiOS()||e.isAndroid(),f=s&&!c,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),{isiPad:O.constant(r),isiPhone:O.constant(i),isTablet:O.constant(c),isPhone:O.constant(f),isTouch:O.constant(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:O.constant(l)})}},Ln={detect:G(function(){var n=navigator.userAgent;return zn(n)})},Pn={tap:O.constant("alloy.tap")},Wn=O.constant("alloy.focus"),Un=O.constant("alloy.blur.post"),Gn=O.constant("alloy.receive"),$n=O.constant("alloy.execute"),qn=O.constant("alloy.focus.item"),_n=Pn.tap,Kn=Ln.detect().deviceType.isTouch()?Pn.tap:P,Xn=O.constant("alloy.longpress"),Yn=(O.constant("alloy.sandbox.close"),O.constant("alloy.system.init")),Jn=O.constant("alloy.system.scroll"),Qn=O.constant("alloy.system.attached"),Zn=O.constant("alloy.system.detached"),ne=(O.constant("alloy.change.tab"),O.constant("alloy.dismiss.tab"),function(n,e){re(n,n.element(),e,{})}),ee=function(n,e,t){re(n,n.element(),e,t)},te=function(n){ne(n,$n())},oe=function(n,e,t){re(n,e,t,{})},re=function(n,e,t,o){var r=D.deepMerge({target:e},o);n.getSystem().triggerEvent(t,e,M.map(r,O.constant))},ie=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:O.constant(n)}},ue={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return ie(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return ie(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return ie(t)},fromDom:ie,fromPoint:function(n,e,t){return x.from(n.dom().elementFromPoint(e,t)).map(ie)}},ae=8,ce=9,se=1,fe=3,le=function(n){return n.dom().nodeName.toLowerCase()},de=function(n){return n.dom().nodeType},me=function(e){return function(n){return de(n)===e}},ge=me(se),pe=me(fe),he=me(ce),ve={name:le,type:de,value:function(n){return n.dom().nodeValue},isElement:ge,isText:pe,isDocument:he,isComment:function(n){return de(n)===ae||"#comment"===le(n)}},ye=G(function(){return be(ue.fromDom(document))}),be=function(n){var e=n.dom().body;if(null===e||e===undefined)throw"Body is not available yet";return ue.fromDom(e)},we={body:ye,getBody:be,inBody:function(n){var e=ve.isText(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)}},xe=function(n){return n.slice(0).sort()},Te=function(n,e){throw new Error("All required keys ("+xe(n).join(", ")+") were not specified. Specified keys were: "+xe(e).join(", ")+".")},Se=function(n){throw new Error("Unsupported keys for object: "+xe(n).join(", "))},ke=function(e,n){if(!E.isArray(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");wn.each(n,function(n){if(!E.isString(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},Ce=function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+xe(n).join(", ")+") were not.")},Oe=function(n){var t=xe(n);wn.find(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})},Ee={immutable:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var o={};return wn.each(e,function(n,e){o[n]=O.constant(t[e])}),o}},immutableBag:function(r,i){var u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return ke("required",r),ke("optional",i),Oe(u),function(e){var t=M.keys(e);wn.forall(r,function(n){return wn.contains(t,n)})||Te(r,t);var n=wn.filter(t,function(n){return!wn.contains(u,n)});0<n.length&&Se(n);var o={};return wn.each(r,function(n){o[n]=O.constant(e[n])}),wn.each(i,function(n){o[n]=O.constant(Object.prototype.hasOwnProperty.call(e,n)?x.some(e[n]):x.none())}),o}}},De=function(n,e){for(var t=[],o=function(n){return t.push(n),e(n)},r=e(n);(r=r.bind(o)).isSome(););return t},Ae="undefined"!=typeof window?window:Function("return this;")(),Me=function(n,e){for(var t=e!==undefined&&null!==e?e:Ae,o=0;o<n.length&&t!==undefined&&null!==t;++o)t=t[n[o]];return t},Be=function(n,e){var t=n.split(".");return Me(t,e)},Re={getOrDie:function(n,e){var t=Be(n,e);if(t===undefined||null===t)throw n+" not available on this browser";return t}},Ie=se,Fe=ce,Ne=function(n){return n.nodeType!==Ie&&n.nodeType!==Fe||0===n.childElementCount},Ve={all:function(n,e){var t=e===undefined?document:e.dom();return Ne(t)?[]:wn.map(t.querySelectorAll(n),ue.fromDom)},is:function(n,e){var t=n.dom();if(t.nodeType!==Ie)return!1;if(t.matches!==undefined)return t.matches(e);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(e);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(e);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},one:function(n,e){var t=e===undefined?document:e.dom();return Ne(t)?x.none():x.from(t.querySelector(n)).map(ue.fromDom)}},He=function(n,e){return n.dom()===e.dom()},je=(Ln.detect().browser.isIE(),He),ze=function(n){return ue.fromDom(n.dom().ownerDocument)},Le=function(n){var e=n.dom();return x.from(e.parentNode).map(ue.fromDom)},Pe=function(n){var e=n.dom();return x.from(e.previousSibling).map(ue.fromDom)},We=function(n){var e=n.dom();return x.from(e.nextSibling).map(ue.fromDom)},Ue=function(n){var e=n.dom();return wn.map(e.childNodes,ue.fromDom)},Ge=function(n,e){var t=n.dom().childNodes;return x.from(t[e]).map(ue.fromDom)},$e=Ee.immutable("element","offset"),qe={owner:ze,defaultView:function(n){var e=n.dom().ownerDocument.defaultView;return ue.fromDom(e)},documentElement:function(n){var e=ze(n);return ue.fromDom(e.dom().documentElement)},parent:Le,findIndex:function(t){return Le(t).bind(function(n){var e=Ue(n);return wn.findIndex(e,function(n){return je(t,n)})})},parents:function(n,e){for(var t=E.isFunction(e)?e:O.constant(!1),o=n.dom(),r=[];null!==o.parentNode&&o.parentNode!==undefined;){var i=o.parentNode,u=ue.fromDom(i);if(r.push(u),!0===t(u))break;o=i}return r},siblings:function(e){return Le(e).map(Ue).map(function(n){return wn.filter(n,function(n){return!je(e,n)})}).getOr([])},prevSibling:Pe,offsetParent:function(n){var e=n.dom();return x.from(e.offsetParent).map(ue.fromDom)},prevSiblings:function(n){return wn.reverse(De(n,Pe))},nextSibling:We,nextSiblings:function(n){return De(n,We)},children:Ue,child:Ge,firstChild:function(n){return Ge(n,0)},lastChild:function(n){return Ge(n,n.dom().childNodes.length-1)},childNodesCount:function(n){return n.dom().childNodes.length},hasChildNodes:function(n){return n.dom().hasChildNodes()},leaf:function(n,e){var t=Ue(n);return 0<t.length&&e<t.length?$e(t[e],0):$e(n,e)}},_e=function(e,t){qe.parent(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})},Ke=function(n,e){n.dom().appendChild(e.dom())},Xe={before:_e,after:function(n,e){qe.nextSibling(n).fold(function(){qe.parent(n).each(function(n){Ke(n,e)})},function(n){_e(n,e)})},prepend:function(e,t){qe.firstChild(e).fold(function(){Ke(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},append:Ke,appendAt:function(n,e,t){qe.child(n,t).fold(function(){Ke(n,e)},function(n){_e(n,e)})},wrap:function(n,e){_e(n,e),Ke(e,n)}},Ye=function(e,n){wn.each(n,function(n){Xe.before(e,n)})},Je=function(e,n){wn.each(n,function(n){Xe.append(e,n)})},Qe=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},Ze={empty:function(n){n.dom().textContent="",wn.each(qe.children(n),function(n){Qe(n)})},remove:Qe,unwrap:function(n){var e=qe.children(n);0<e.length&&Ye(n,e),Qe(n)}},nt=function(n){ne(n,Zn());var e=n.components();wn.each(e,nt)},et=function(n){var e=n.components();wn.each(e,et),ne(n,Qn())},tt=function(n,e){ot(n,e,Xe.append)},ot=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),we.inBody(n.element())&&et(e),n.syncComponents()},rt=function(n){nt(n),Ze.remove(n.element()),n.getSystem().removeFromWorld(n)},it=function(e){var n=qe.parent(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(x.none,x.some)});rt(e),n.each(function(n){n.syncComponents()})},ut=function(t){return{is:function(n){return t===n},isValue:O.always,isError:O.never,getOr:O.constant(t),getOrThunk:O.constant(t),getOrDie:O.constant(t),or:function(n){return ut(t)},orThunk:function(n){return ut(t)},fold:function(n,e){return e(t)},map:function(n){return ut(n(t))},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return x.some(t)}}},at=function(t){return{is:O.never,isValue:O.never,isError:O.always,getOr:O.identity,getOrThunk:function(n){return n()},getOrDie:function(){return O.die(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return at(t)},each:O.noop,bind:function(n){return at(t)},exists:O.never,forall:O.always,toOption:x.none}},ct={value:ut,error:at},st=function(u){if(!E.isArray(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],t={};return wn.each(u,function(n,o){var e=M.keys(n);if(1!==e.length)throw new Error("one and only one name per case");var r=e[0],i=n[r];if(t[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!E.isArray(i))throw new Error("case arguments must be an array");a.push(r),t[r]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,t)},match:function(n){var e=M.keys(n);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!wn.forall(a,function(n){return wn.contains(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return n[r].apply(null,t)},log:function(n){console.log(n,{constructors:a,constructor:r,params:t})}}}}),t},ft=st([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),lt=function(n){return ft.defaultedThunk(O.constant(n))},dt=ft.strict,mt=ft.asOption,gt=ft.defaultedThunk,pt=(ft.asDefaultedOptionThunk,ft.mergeWithThunk),ht=(st([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){var e=[],t=[];return wn.each(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}),vt=function(n){return O.compose(ct.error,wn.flatten)(n)},yt=function(n,e){var t,o,r=ht(n);return 0<r.errors.length?vt(r.errors):(t=r.values,o=e,ct.value(D.deepMerge.apply(undefined,[o].concat(t))))},bt=function(n){var e=ht(n);return 0<e.errors.length?vt(e.errors):ct.value(e.values)},wt=function(e){return function(n){return n.hasOwnProperty(e)?x.from(n[e]):x.none()}},xt=function(n,e){return wt(e)(n)},Tt=function(n,e){var t={};return t[n]=e,t},St=function(n,e){return t=n,o=e,r={},wn.each(o,function(n){t[n]!==undefined&&t.hasOwnProperty(n)&&(r[n]=t[n])}),r;var t,o,r},kt=function(n,e){return t=n,o=e,r={},M.each(t,function(n,e){wn.contains(o,e)||(r[e]=n)}),r;var t,o,r},Ct=function(n){return wt(n)},Ot=function(n,e){return t=n,o=e,function(n){return wt(t)(n).getOr(o)};var t,o},Et=function(n,e){return xt(n,e)},Dt=function(n,e){return Tt(n,e)},At=function(n){return e=n,t={},wn.each(e,function(n){t[n.key]=n.value}),t;var e,t},Mt=function(n,e){return yt(n,e)},Bt=function(n,e){return o=e,(t=n).hasOwnProperty(o)&&t[o]!==undefined&&null!==t[o];var t,o},Rt=st([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),It=st([{field:["name","presence","type"]},{state:["name"]}]),Ft=function(){return Re.getOrDie("JSON")},Nt=function(n,e,t){return Ft().stringify(n,e,t)},Vt=function(n){return E.isObject(n)&&100<M.keys(n).length?" removed due to size":Nt(n,null,2)},Ht=function(n,e){return ct.error([{path:n,getErrorInfo:e}])},jt=st([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),zt=function(t,o,r){return xt(o,r).fold(function(){return n=r,e=o,Ht(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Vt(e)});var n,e},ct.value)},Lt=function(n,e,t){var o=xt(n,e).fold(function(){return t(n)},O.identity);return ct.value(o)},Pt=function(r,a,n,c){return n.fold(function(i,e,n,t){var o=function(n){return t.extract(r.concat([i]),c,n).map(function(n){return Tt(e,c(n))})},u=function(n){return n.fold(function(){var n=Tt(e,c(x.none()));return ct.value(n)},function(n){return t.extract(r.concat([i]),c,n).map(function(n){return Tt(e,c(x.some(n)))})})};return n.fold(function(){return zt(r,a,i).bind(o)},function(n){return Lt(a,i,n).bind(o)},function(){return(n=a,e=i,ct.value(xt(n,e))).bind(u);var n,e},function(n){return(e=a,t=i,o=n,r=xt(e,t).map(function(n){return!0===n?o(e):n}),ct.value(r)).bind(u);var e,t,o,r},function(n){var e=n(a);return Lt(a,i,O.constant({})).map(function(n){return D.deepMerge(e,n)}).bind(o)})},function(n,e){var t=e(a);return ct.value(Tt(n,c(t)))})},Wt=function(o){return{extract:function(t,n,e){return o(e,n).fold(function(n){return e=n,Ht(t,function(){return e});var e},ct.value)},toString:function(){return"val"},toDsl:function(){return Rt.itemOf(o)}}},Ut=function(n){var c=Gt(n),s=wn.foldr(n,function(e,n){return n.fold(function(n){return D.deepMerge(e,Dt(n,!0))},O.constant(e))},{});return{extract:function(n,e,t){var o,r,i,u=E.isBoolean(t)?[]:(o=t,r=M.keys(o),wn.filter(r,function(n){return Bt(o,n)})),a=wn.filter(u,function(n){return!Bt(s,n)});return 0===a.length?c.extract(n,e,t):(i=a,Ht(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Gt=function(c){return{extract:function(n,e,t){return o=n,r=t,i=c,u=e,a=wn.map(i,function(n){return Pt(o,r,n,u)}),yt(a,{});var o,r,i,u,a},toString:function(){return"obj{\n"+wn.map(c,function(n){return n.fold(function(n,e,t,o){return n+" -> "+o.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Rt.objOf(wn.map(c,function(n){return n.fold(function(n,e,t,o){return It.field(n,t,o)},function(n,e){return It.state(n)})}))}}},$t=function(r){return{extract:function(t,o,n){var e=wn.map(n,function(n,e){return r.extract(t.concat(["["+e+"]"]),o,n)});return bt(e)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return Rt.arrOf(r)}}},qt=function(u,a){return{extract:function(t,o,r){var n,e,i=M.keys(r);return(n=t,e=i,$t(Wt(u)).extract(n,O.identity,e)).bind(function(n){var e=wn.map(n,function(n){return jt.field(n,n,dt(),a)});return Gt(e).extract(t,o,r)})},toString:function(){return"setOf("+a.toString()+")"},toDsl:function(){return Rt.setOf(u,a)}}},_t=O.constant(Wt(ct.value)),Kt=(O.compose($t,Gt),jt.state),Xt=jt.field,Yt=function(t,e,o,r,i){return Et(r,i).fold(function(){return n=r,e=i,Ht(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Vt(n)});var n,e},function(n){return Gt(n).extract(t.concat(["branch: "+i]),e,o)})},Jt=function(r,i){return{extract:function(e,t,o){return Et(o,r).fold(function(){return n=r,Ht(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Yt(e,t,o,i,n)})},toString:function(){return"chooseOn("+r+"). Possible values: "+M.keys(i)},toDsl:function(){return Rt.choiceOf(r,i)}}},Qt=Wt(ct.value),Zt=function(n,e,t,o){return e.extract([n],t,o).fold(function(n){return ct.error({input:o,errors:n})},ct.value)},no=function(n,e,t){return Zt(n,e,O.constant,t)},eo=function(n){return n.fold(function(n){throw new Error(ro(n))},O.identity)},to=function(n,e,t){return eo((o=t,Zt(n,e,O.identity,o)));var o},oo=function(n,e,t){return eo(no(n,e,t))},ro=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,wn.map(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Vt(n.input);var e,t},io=function(n,e){return Jt(n,e)},uo=O.constant(Qt),ao=(u=E.isFunction,a="function",Wt(function(n){var e=typeof n;return u(n)?ct.value(n):ct.error("Expected type: "+a+" but got: "+e)})),co=function(n){return Xt(n,n,dt(),_t())},so=function(n,e){return Xt(n,n,dt(),e)},fo=function(n){return so(n,ao)},lo=function(n,e){return Xt(n,n,dt(),Gt(e))},mo=function(n){return Xt(n,n,mt(),_t())},go=function(n,e){return Xt(n,n,mt(),Gt(e))},po=function(n,e){return Xt(n,n,mt(),Ut(e))},ho=function(n,e){return Xt(n,n,lt(e),_t())},vo=function(n,e,t){return Xt(n,n,lt(e),t)},yo=function(n,e){return Kt(n,e)},bo=function(n){if(!Bt(n,"can")&&!Bt(n,"abort")&&!Bt(n,"run"))throw new Error("EventHandler defined by: "+Nt(n,null,2)+" does not have can, abort, or run!");return to("Extracting event.handler",Ut([ho("can",O.constant(!0)),ho("abort",O.constant(!1)),ho("run",O.noop)]),n)},wo=function(n){var e,o,r,i,t=(e=n,o=function(n){return n.can},function(){var t=Array.prototype.slice.call(arguments,0);return wn.foldl(e,function(n,e){return n&&o(e).apply(undefined,t)},!0)}),u=(r=n,i=function(n){return n.abort},function(){var t=Array.prototype.slice.call(arguments,0);return wn.foldl(r,function(n,e){return n||i(e).apply(undefined,t)},!1)});return bo({can:t,abort:u,run:function(){var e=Array.prototype.slice.call(arguments,0);wn.each(n,function(n){n.run.apply(undefined,e)})}})},xo=At,To=function(n,e){return{key:n,value:bo({abort:e})}},So=function(n,e){return{key:n,value:bo({run:e})}},ko=function(n,e,t){return{key:n,value:bo({run:function(n){e.apply(undefined,[n].concat(t))}})}},Co=function(n){return function(o){return{key:n,value:bo({run:function(n,e){var t;t=e,je(n.element(),t.event().target())&&o(n,e)}})}}},Oo=function(n,e,t){var u,o,r=e.partUids()[t];return o=r,So(u=n,function(n,i){n.getSystem().getByUid(o).each(function(n){var e,t,o,r;t=(e=n).element(),o=u,r=i,e.getSystem().triggerEvent(o,t,r.event())})})},Eo=function(n){return So(n,function(n,e){e.cut()})},Do=Co(Qn()),Ao=Co(Zn()),Mo=Co(Yn()),Bo=(c=$n(),function(n){return So(c,n)}),Ro=function(n){return wn.map(n,function(n){return In.endsWith(n,"/*")?n.substring(0,n.length-"/*".length):n})},Io=function(n,e){var t=n.toString(),o=t.indexOf(")")+1,r=t.indexOf("("),i=t.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Ro(i)}},n},Fo=Ee.immutableBag(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),No=function(n){return{tag:n.tag(),classes:n.classes().getOr([]),attributes:n.attributes().getOr({}),styles:n.styles().getOr({}),value:n.value().getOr("<none>"),innerHtml:n.innerHtml().getOr("<none>"),defChildren:n.defChildren().getOr("<none>"),domChildren:n.domChildren().fold(function(){return"<none>"},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Vo=Ee.immutableBag([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),Ho=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return Dt(e,n)})},function(n){return t.fold(function(){return Dt(e,n)},function(n){return Dt(e,n)})})},jo=function(t,o,r){return Mo(function(n,e){r(n,t,o)})},zo=function(n,e,t,o,r,i){var u,a,c=n,s=go(e,[(u="config",a=n,Xt(u,u,mt(),a))]);return Wo(c,s,e,t,o,r,i)},Lo=function(n,r,e){var t,o,i,u,a,c;return t=function(t){var o=arguments;return t.config({name:O.constant(n)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+n+". Using API: "+e)},function(n){var e=Array.prototype.slice.call(o,1);return r.apply(undefined,[t,n.config,n.state].concat(e))})},o=e,i=r.toString(),u=i.indexOf(")")+1,a=i.indexOf("("),c=i.substring(a+1,u-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:o,parameters:Ro(c.slice(0,1).concat(c.slice(3)))}},t},Po=function(n){return{key:n,value:undefined}},Wo=function(t,n,o,r,e,i,u){var a=function(n){return Bt(n,o)?n[o]():x.none()},c=M.map(e,function(n,e){return Lo(o,n,e)}),s=M.map(i,function(n,e){return Io(n,e)}),f=D.deepMerge(s,c,{revoke:O.curry(Po,o),config:function(n){var e=oo(o+"-config",t,n);return{key:o,value:{config:e,me:f,configAsRaw:G(function(){return to(o+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return a(n).bind(function(e){return Et(r,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Vo({}))},name:function(){return o},handlers:function(n){return a(n).bind(function(e){return Et(r,"events").map(function(n){return n(e.config,e.state)})}).getOr({})}});return f},Uo=function(n,e){return Go(n,e,{validate:E.isFunction,label:"function"})},Go=function(o,r,i){if(0===r.length)throw new Error("You must specify at least one required field.");return ke("required",r),Oe(r),function(e){var t=M.keys(e);wn.forall(r,function(n){return wn.contains(t,n)})||Te(r,t),o(r,t);var n=wn.filter(r,function(n){return!i.validate(e[n],n)});return 0<n.length&&Ce(n,i.label),e}},$o=O.noop,qo={exactly:O.curry(Uo,function(e,n){var t=wn.filter(n,function(n){return!wn.contains(e,n)});0<t.length&&Se(t)}),ensure:O.curry(Uo,$o),ensureWith:O.curry(Go,$o)},_o=qo.ensure(["readState"]),Ko=function(){return _o({readState:function(){return"No State required"}})},Xo=Object.freeze({init:Ko}),Yo=function(n){return At(n)},Jo=Ut([co("fields"),co("name"),ho("active",{}),ho("apis",{}),ho("extra",{}),ho("state",Xo)]),Qo=function(n){var e,t,o,r,i,u,a,c,s=to("Creating behaviour: "+n.name,Jo,n);return e=s.fields,t=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,a=Ut(e),c=go(t,[po("config",e)]),Wo(a,c,t,o,r,i,u)},Zo=Ut([co("branchKey"),co("branches"),co("name"),ho("active",{}),ho("apis",{}),ho("extra",{}),ho("state",Xo)]),nr=O.constant(undefined),er=(O.constant({}),O.constant({}),O.constant({}),O.constant(Xo));function tr(n,e,t){var o=t||!1,r=function(){e(),o=!0},i=function(){n(),o=!1};return{on:r,off:i,toggle:function(){(o?i:r)()},isOn:function(){return o}}}var or=function(n,e,t){if(!(E.isString(t)||E.isBoolean(t)||E.isNumber(t)))throw console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},rr=function(n,e,t){or(n.dom(),e,t)},ir=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},ur=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},ar={clone:function(n){return wn.foldl(n.dom().attributes,function(n,e){return n[e.name]=e.value,n},{})},set:rr,setAll:function(n,e){var t=n.dom();M.each(e,function(n,e){or(t,e,n)})},get:ir,has:ur,remove:function(n,e){n.dom().removeAttribute(e)},hasNone:function(n){var e=n.dom().attributes;return e===undefined||null===e||0===e.length},transfer:function(r,i,n){ve.isElement(r)&&ve.isElement(i)&&wn.each(n,function(n){var e,t,o;t=i,ur(e=r,o=n)&&!ur(t,o)&&rr(t,o,ir(e,o))})}},cr=function(n,e){var t=ar.get(n,e);return t===undefined||""===t?[]:t.split(" ")},sr=cr,fr=function(n,e,t){var o=cr(n,e).concat([t]);ar.set(n,e,o.join(" "))},lr=function(n,e,t){var o=wn.filter(cr(n,e),function(n){return n!==t});0<o.length?ar.set(n,e,o.join(" ")):ar.remove(n,e)},dr=function(n){return sr(n,"class")},mr=function(n,e){return fr(n,"class",e)},gr=function(n,e){return lr(n,"class",e)},pr=dr,hr=mr,vr=gr,yr=function(n,e){wn.contains(dr(n),e)?gr(n,e):mr(n,e)},br=function(n){return n.dom().classList!==undefined},wr=function(n,e){return br(n)&&n.dom().classList.contains(e)},xr={add:function(n,e){br(n)?n.dom().classList.add(e):hr(n,e)},remove:function(n,e){var t;br(n)?n.dom().classList.remove(e):vr(n,e),0===(br(t=n)?t.dom().classList:pr(t)).length&&ar.remove(t,"class")},toggle:function(n,e){return br(n)?n.dom().classList.toggle(e):yr(n,e)},toggler:function(n,e){var t=br(n),o=n.dom().classList;return tr(function(){t?o.remove(e):vr(n,e)},function(){t?o.add(e):hr(n,e)},wr(n,e))},has:wr},Tr=function(n,e,t){xr.remove(n,t),xr.add(n,e)},Sr=Object.freeze({toAlpha:function(n,e,t){Tr(n.element(),e.alpha(),e.omega())},toOmega:function(n,e,t){Tr(n.element(),e.omega(),e.alpha())},isAlpha:function(n,e,t){return xr.has(n.element(),e.alpha())},isOmega:function(n,e,t){return xr.has(n.element(),e.omega())},clear:function(n,e,t){xr.remove(n.element(),e.alpha()),xr.remove(n.element(),e.omega())}}),kr=[co("alpha"),co("omega")],Cr=Qo({fields:kr,name:"swapping",apis:Sr}),Or=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return Or(t())}}};function Er(n,e,t,o,r){return n(t,o)?x.some(t):E.isFunction(r)&&r(t)?x.none():e(t,o,r)}var Dr=function(n,e,t){for(var o=n.dom(),r=E.isFunction(t)?t:O.constant(!1);o.parentNode;){o=o.parentNode;var i=ue.fromDom(o);if(e(i))return x.some(i);if(r(i))break}return x.none()},Ar=function(n,e){return wn.find(n.dom().childNodes,O.compose(e,ue.fromDom)).map(ue.fromDom)},Mr=function(n,o){var r=function(n){for(var e=0;e<n.childNodes.length;e++){if(o(ue.fromDom(n.childNodes[e])))return x.some(ue.fromDom(n.childNodes[e]));var t=r(n.childNodes[e]);if(t.isSome())return t}return x.none()};return r(n.dom())},Br={first:function(n){return Mr(we.body(),n)},ancestor:Dr,closest:function(n,e,t){return Er(function(n){return e(n)},Dr,n,e,t)},sibling:function(e,t){var n=e.dom();return n.parentNode?Ar(ue.fromDom(n.parentNode),function(n){return!je(e,n)&&t(n)}):x.none()},child:Ar,descendant:Mr},Rr=function(n){n.dom().focus()},Ir=function(n){var e=n!==undefined?n.dom():document;return x.from(e.activeElement).map(ue.fromDom)},Fr=function(n){var e=qe.owner(n).dom();return n.dom()===e.activeElement},Nr=Rr,Vr=function(n){n.dom().blur()},Hr=Ir,jr=function(e){return Ir(qe.owner(e)).filter(function(n){return e.dom().contains(n.dom())})},zr=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lr=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Pr=function(n){var e=document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)},Wr={formatChanged:O.constant("formatChanged"),orientationChanged:O.constant("orientationChanged"),dropupDismissed:O.constant("dropupDismissed")},Ur=function(n,e){var t=(e||document).createElement("div");return t.innerHTML=n,qe.children(ue.fromDom(t))},Gr=function(n){return n.dom().innerHTML},$r=Gr,qr=function(n,e){var t=qe.owner(n).dom(),o=ue.fromDom(t.createDocumentFragment()),r=Ur(e,t);Je(o,r),Ze.empty(n),Xe.append(n,o)},_r=function(n){var e=ue.fromTag("div"),t=ue.fromDom(n.dom().cloneNode(!0));return Xe.append(e,t),Gr(e)},Kr=function(n,e){return ue.fromDom(n.dom().cloneNode(e))},Xr=function(n){return Kr(n,!1)},Yr=function(n){return e=Xr(n),_r(e);var e},Jr=Object.freeze({events:function(a){return xo([So(Gn(),function(r,i){var n,e,u=a.channels(),t=M.keys(u),o=(n=t,(e=i).universal()?n:wn.filter(n,function(n){return wn.contains(e.channels(),n)}));wn.each(o,function(n){var e=u[n](),t=e.schema(),o=oo("channel["+n+"] data\nReceiver: "+Yr(r.element()),t,i.data());e.onReceive()(r,o)})})])}}),Qr=function(n){for(var e=[],t=function(n){e.push(n)},o=0;o<n.length;o++)n[o].each(t);return e},Zr=function(n,e){for(var t=0;t<n.length;t++){var o=e(n[t],t);if(o.isSome())return o}return x.none()},ni="unknown",ei=[],ti=["alloy/data/Fields","alloy/debugging/Debugging"],oi={logEventCut:O.noop,logEventStopped:O.noop,logNoParent:O.noop,logEventNoHandlers:O.noop,logEventResponse:O.noop,write:O.noop},ri=function(n,e,t){var o,r="*"===ei||wn.contains(ei,n)?(o=[],{logEventCut:function(n,e,t){o.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){o.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){o.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){o.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){o.push({outcome:"response",purpose:t,target:e})},write:function(){wn.contains(["mousemove","mouseover","mouseout",Yn()],n)||console.log(n,{event:n,target:e.dom(),sequence:wn.map(o,function(n){return wn.contains(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Yr(n.target)+")":n.outcome})})}}):oi,i=t(r);return r.write(),i},ii=(O.constant(oi),O.constant(!0),O.constant([co("menu"),co("selectedMenu")])),ui=O.constant([co("item"),co("selectedItem")]),ai=(O.constant(Ut(ui().concat(ii()))),O.constant(Ut(ui()))),ci=lo("initSize",[co("numColumns"),co("numRows")]),si=function(n,e,t){var o;return function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");wn.find(e,function(e){return 0<e.indexOf("alloy")&&!wn.exists(ti,function(n){return-1<e.indexOf(n)})}).getOr(ni)}}(),Xt(e,e,t,(o=function(n){return ct.value(function(){return n.apply(undefined,arguments)})},Wt(function(n){return o(n)})))},fi=function(n){return si(0,n,lt(O.noop))},li=function(n){return si(0,n,lt(x.none))},di=function(n){return si(0,n,dt())},mi=function(n){return si(0,n,dt())},gi=function(n,e){return yo(n,O.constant(e))},pi=function(n){return yo(n,O.identity)},hi=O.constant(ci),vi=[so("channels",qt(ct.value,Ut([di("onReceive"),ho("schema",uo())])))],yi=Qo({fields:vi,name:"receiving",active:Jr}),bi=function(n,e){var t=Si(n,e),o=e.aria();o.update()(n,o,t)},wi=function(n,e,t){xr.toggle(n.element(),e.toggleClass()),bi(n,e)},xi=function(n,e,t){xr.add(n.element(),e.toggleClass()),bi(n,e)},Ti=function(n,e,t){xr.remove(n.element(),e.toggleClass()),bi(n,e)},Si=function(n,e){return xr.has(n.element(),e.toggleClass())},ki=function(n,e,t){(e.selected()?xi:Ti)(n,e,t)},Ci=Object.freeze({onLoad:ki,toggle:wi,isOn:Si,on:xi,off:Ti}),Oi=Object.freeze({exhibit:function(n,e,t){return Vo({})},events:function(n,e){var t,o,r,i=(t=n,o=e,r=wi,Bo(function(n){r(n,t,o)})),u=jo(n,e,ki);return xo(wn.flatten([n.toggleOnExecute()?[i]:[],[u]]))}}),Ei=function(n,e,t){ar.set(n.element(),"aria-expanded",t)},Di=[ho("selected",!1),co("toggleClass"),ho("toggleOnExecute",!0),vo("aria",{mode:"none"},io("mode",{pressed:[ho("syncWithExpanded",!1),gi("update",function(n,e,t){ar.set(n.element(),"aria-pressed",t),e.syncWithExpanded()&&Ei(n,e,t)})],checked:[gi("update",function(n,e,t){ar.set(n.element(),"aria-checked",t)})],expanded:[gi("update",Ei)],selected:[gi("update",function(n,e,t){ar.set(n.element(),"aria-selected",t)})],none:[gi("update",O.noop)]}))],Ai=Qo({fields:Di,name:"toggling",active:Oi,apis:Ci}),Mi=function(t,o){return yi.config({channels:Dt(Wr.formatChanged(),{onReceive:function(n,e){e.command===t&&o(n,e.state)}})})},Bi=function(n){return yi.config({channels:Dt(Wr.orientationChanged(),{onReceive:n})})},Ri=function(n,e){return{key:n,value:{onReceive:e}}},Ii="tinymce-mobile",Fi={resolve:function(n){return Ii+"-"+n},prefix:O.constant(Ii)},Ni=function(n,e){e.ignore()||(Nr(n.element()),e.onFocus()(n))},Vi=Object.freeze({focus:Ni,blur:function(n,e){e.ignore()||Vr(n.element())},isFocused:function(n){return Fr(n.element())}}),Hi=Object.freeze({exhibit:function(n,e){return e.ignore()?Vo({}):Vo({attributes:{tabindex:"-1"}})},events:function(t){return xo([So(Wn(),function(n,e){Ni(n,t),e.stop()})])}}),ji=[fi("onFocus"),ho("ignore",!1)],zi=Qo({fields:ji,name:"focusing",active:Hi,apis:Vi}),Li=function(n){return n.style!==undefined},Pi=function(n,e,t){if(!E.isString(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);Li(n)&&n.style.setProperty(e,t)},Wi=function(n,e){Li(n)&&n.style.removeProperty(e)},Ui=function(n,e,t){var o=n.dom();Pi(o,e,t)},Gi=function(n,e){return Li(n)?n.style.getPropertyValue(e):""},$i=function(n,e){var t=n.dom(),o=Gi(t,e);return x.from(o).filter(function(n){return 0<n.length})},qi={copy:function(n,e){var t=n.dom(),o=e.dom();Li(t)&&Li(o)&&(o.style.cssText=t.style.cssText)},set:Ui,preserve:function(n,e){var t=ar.get(n,"style"),o=e(n);return(t===undefined?ar.remove:ar.set)(n,"style",t),o},setAll:function(n,e){var t=n.dom();M.each(e,function(n,e){Pi(t,e,n)})},setOptions:function(n,e){var t=n.dom();M.each(e,function(n,e){n.fold(function(){Wi(t,e)},function(n){Pi(t,e,n)})})},remove:function(n,e){var t=n.dom();Wi(t,e),ar.has(n,"style")&&""===In.trim(ar.get(n,"style"))&&ar.remove(n,"style")},get:function(n,e){var t=n.dom(),o=window.getComputedStyle(t).getPropertyValue(e),r=""!==o||we.inBody(n)?o:Gi(t,e);return null===r?undefined:r},getRaw:$i,getAllRaw:function(n){var e={},t=n.dom();if(Li(t))for(var o=0;o<t.style.length;o++){var r=t.style.item(o);e[r]=t.style[r]}return e},isValidValue:function(n,e,t){var o=ue.fromTag(n);return Ui(o,e,t),$i(o,e).isSome()},reflow:function(n){return n.dom().offsetWidth},transfer:function(o,r,n){ve.isElement(o)&&ve.isElement(r)&&wn.each(n,function(n){var e,t;e=r,$i(o,t=n).each(function(n){$i(e,t).isNone()&&Ui(e,t,n)})})}};function _i(o,r){var n=function(n){var e=r(n);if(e<=0||null===e){var t=qi.get(n,o);return parseFloat(t)||0}return e},i=function(r,n){return wn.foldl(n,function(n,e){var t=qi.get(r,e),o=t===undefined?0:parseInt(t,10);return isNaN(o)?n:n+o},0)};return{set:function(n,e){if(!E.isNumber(e)&&!e.match(/^[0-9]+$/))throw o+".set accepts only positive integer values. Value was "+e;var t=n.dom();Li(t)&&(t.style[o]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var o=i(n,t);return o<e?e-o:0}}}var Ki,Xi,Yi=_i("height",function(n){return we.inBody(n)?n.dom().getBoundingClientRect().height:n.dom().offsetHeight}),Ji=function(n){return Yi.get(n)},Qi=function(n,e,t){return wn.filter(qe.parents(n,t),e)},Zi=function(n,e){return wn.filter(qe.siblings(n),e)},nu=function(n){return Ve.all(n)},eu=function(n,e,t){return Qi(n,function(n){return Ve.is(n,e)},t)},tu=function(n,e){return Zi(n,function(n){return Ve.is(n,e)})},ou=function(n,e){return Ve.all(e,n)},ru=function(n,e,t){return Br.ancestor(n,function(n){return Ve.is(n,e)},t)},iu=function(n){return Ve.one(n)},uu=ru,au=function(n,e){return Ve.one(e,n)},cu=function(n,e,t){return Er(Ve.is,ru,n,e,t)},su={BACKSPACE:O.constant([8]),TAB:O.constant([9]),ENTER:O.constant([13]),SHIFT:O.constant([16]),CTRL:O.constant([17]),ALT:O.constant([18]),CAPSLOCK:O.constant([20]),ESCAPE:O.constant([27]),SPACE:O.constant([32]),PAGEUP:O.constant([33]),PAGEDOWN:O.constant([34]),END:O.constant([35]),HOME:O.constant([36]),LEFT:O.constant([37]),UP:O.constant([38]),RIGHT:O.constant([39]),DOWN:O.constant([40]),INSERT:O.constant([45]),DEL:O.constant([46]),META:O.constant([91,93,224]),F10:O.constant([121])},fu=function(n,e,t){var o=wn.reverse(n.slice(0,e)),r=wn.reverse(n.slice(e+1));return wn.find(o.concat(r),t)},lu=function(n,e,t){var o=wn.reverse(n.slice(0,e));return wn.find(o,t)},du=function(n,e,t){var o=n.slice(0,e),r=n.slice(e+1);return wn.find(r.concat(o),t)},mu=function(n,e,t){var o=n.slice(e+1);return wn.find(o,t)},gu=function(e){return function(n){return wn.contains(e,n.raw().which)}},pu=function(n){return function(e){return wn.forall(n,function(n){return n(e)})}},hu=function(n){return!0===n.raw().shiftKey},vu=function(n){return!0===n.raw().ctrlKey},yu=(O.not(vu),O.not(hu)),bu=function(n,e){return{matches:n,classification:e}},wu=function(n,e,t,o){var r=n+e;return o<r?t:r<t?o:r},xu=function(n,e,t){return n<=e?e:t<=n?t:n},Tu=function(e,t,n){var o=ou(e.element(),"."+t.highlightClass());wn.each(o,function(n){xr.remove(n,t.highlightClass()),e.getSystem().getByDom(n).each(function(n){t.onDehighlight()(e,n)})})},Su=function(n,e,t,o){var r=ku(n,e,t,o);Tu(n,e),xr.add(o.element(),e.highlightClass()),r||e.onHighlight()(n,o)},ku=function(n,e,t,o){return xr.has(o.element(),e.highlightClass())},Cu=function(n,e,t,o){var r=ou(n.element(),"."+e.itemClass());return x.from(r[o]).fold(function(){return ct.error("No element found with index "+o)},n.getSystem().getByDom)},Ou=function(n,e,t){return au(n.element(),"."+e.itemClass()).bind(n.getSystem().getByDom)},Eu=function(n,e,t){var o=ou(n.element(),"."+e.itemClass());return(0<o.length?x.some(o[o.length-1]):x.none()).bind(n.getSystem().getByDom)},Du=function(t,e,n,o){var r=ou(t.element(),"."+e.itemClass());return wn.findIndex(r,function(n){return xr.has(n,e.highlightClass())}).bind(function(n){var e=wu(n,o,0,r.length-1);return t.getSystem().getByDom(r[e])})},Au=Object.freeze({dehighlightAll:Tu,dehighlight:function(n,e,t,o){var r=ku(n,e,t,o);xr.remove(o.element(),e.highlightClass()),r&&e.onDehighlight()(n,o)},highlight:Su,highlightFirst:function(e,t,o){Ou(e,t,o).each(function(n){Su(e,t,o,n)})},highlightLast:function(e,t,o){Eu(e,t,o).each(function(n){Su(e,t,o,n)})},highlightAt:function(e,t,o,n){Cu(e,t,o,n).fold(function(n){throw new Error(n)},function(n){Su(e,t,o,n)})},highlightBy:function(e,t,o,n){var r=ou(e.element(),"."+t.itemClass()),i=Qr(wn.map(r,function(n){return e.getSystem().getByDom(n).toOption()}));wn.find(i,n).each(function(n){Su(e,t,o,n)})},isHighlighted:ku,getHighlighted:function(n,e,t){return au(n.element(),"."+e.highlightClass()).bind(n.getSystem().getByDom)},getFirst:Ou,getLast:Eu,getPrevious:function(n,e,t){return Du(n,e,0,-1)},getNext:function(n,e,t){return Du(n,e,0,1)}}),Mu=[co("highlightClass"),co("itemClass"),fi("onHighlight"),fi("onDehighlight")],Bu=Qo({fields:Mu,name:"highlighting",apis:Au}),Ru=function(){return{get:function(n){return jr(n.element())},set:function(n,e){n.getSystem().triggerFocus(e,n.element())}}},Iu=function(n,e,a,t,o,i){var u=function(e,t,o,r){var n,i,u=a(e,t,o,r);return(n=u,i=t.event(),wn.find(n,function(n){return n.matches(i)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,o,r)})},r={schema:function(){return n.concat([ho("focusManager",Ru()),gi("handler",r),gi("state",e)])},processKey:u,toEvents:function(o,r){var n=t(o,r),e=xo(i.map(function(t){return So(Wn(),function(n,e){t(n,o,r,e),e.stop()})}).toArray().concat([So(j(),function(n,e){u(n,e,o,r).each(function(n){e.stop()})})]));return D.deepMerge(n,e)},toApis:o};return r},Fu=function(n){var e=[mo("onEscape"),mo("onEnter"),ho("selector",'[data-alloy-tabstop="true"]'),ho("firstTabstop",0),ho("useTabstopAt",O.constant(!0)),mo("visibilitySelector")].concat([n]),a=function(n,e){var t=n.visibilitySelector().bind(function(n){return cu(e,n)}).getOr(e);return 0<Ji(t)},c=function(e,n,t,o,r){return r(n,t,function(n){return a(e=o,t=n)&&e.useTabstopAt()(t);var e,t}).fold(function(){return o.cyclic()?x.some(!0):x.none()},function(n){return o.focusManager().set(e,n),x.some(!0)})},i=function(e,n,t,o){var r,i,u=ou(e.element(),t.selector());return(r=e,i=t,i.focusManager().get(r).bind(function(n){return cu(n,i.selector())})).bind(function(n){return wn.findIndex(u,O.curry(je,n)).bind(function(n){return c(e,u,n,t,o)})})},t=O.constant([bu(pu([hu,gu(su.TAB())]),function(n,e,t,o){var r=t.cyclic()?fu:lu;return i(n,0,t,r)}),bu(gu(su.TAB()),function(n,e,t,o){var r=t.cyclic()?du:mu;return i(n,0,t,r)}),bu(gu(su.ESCAPE()),function(e,t,n,o){return n.onEscape().bind(function(n){return n(e,t)})}),bu(pu([yu,gu(su.ENTER())]),function(e,t,n,o){return n.onEnter().bind(function(n){return n(e,t)})})]),o=O.constant({}),r=O.constant({});return Iu(e,Ko,t,o,r,x.some(function(e,t,n){var o,r,i,u;(o=e,r=t,i=ou(o.element(),r.selector()),u=wn.filter(i,function(n){return a(r,n)}),x.from(u[r.firstTabstop()])).each(function(n){t.focusManager().set(e,n)})}))},Nu=Fu(yo("cyclic",O.constant(!1))),Vu=Fu(yo("cyclic",O.constant(!0))),Hu=function(n){return"input"===ve.name(n)&&"radio"!==ar.get(n,"type")||"textarea"===ve.name(n)},ju=function(n,e,t){return Hu(t)&&gu(su.SPACE())(e.event())?x.none():(oe(n,t,$n()),x.some(!0))},zu=[ho("execute",ju),ho("useSpace",!1),ho("useEnter",!0),ho("useControlEnter",!1),ho("useDown",!1)],Lu=function(n,e,t,o){return t.execute()(n,e,n.element())},Pu=O.constant({}),Wu=O.constant({}),Uu=Iu(zu,Ko,function(n,e,t,o){var r=t.useSpace()&&!Hu(n.element())?su.SPACE():[],i=t.useEnter()?su.ENTER():[],u=t.useDown()?su.DOWN():[],a=r.concat(i).concat(u);return[bu(gu(a),Lu)].concat(t.useControlEnter()?[bu(pu([vu,gu(su.ENTER())]),Lu)]:[])},Pu,Wu,x.none()),Gu=function(n){var t=Or(x.none());return _o({readState:O.constant({}),setGridSize:function(n,e){t.set(x.some({numRows:O.constant(n),numColumns:O.constant(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},$u=Object.freeze({flatgrid:Gu,init:function(n){return n.state()(n)}}),qu=function(n){return"rtl"===qi.get(n,"direction")?"rtl":"ltr"},_u=function(e,t){return function(n){return"rtl"===qu(n)?t:e}},Ku=function(i){return function(n,e,t,o){var r=i(n.element());return Qu(r,n,e,t,o)}},Xu=function(n,e){var t=_u(n,e);return Ku(t)},Yu=function(n,e){var t=_u(e,n);return Ku(t)},Ju=function(r){return function(n,e,t,o){return Qu(r,n,e,t,o)}},Qu=function(e,t,n,o,r){return o.focusManager().get(t).bind(function(n){return e(t.element(),n,o,r)}).map(function(n){return o.focusManager().set(t,n),!0})},Zu=Ju,na=Ju,ea=Ju,ta=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},oa=Ee.immutableBag(["index","candidates"],[]),ra=function(n,e,t){return ia(n,e,t,ta)},ia=function(n,e,t,o){var r,i,u=O.curry(je,e),a=ou(n,t),c=wn.filter(a,ta);return r=c,i=u,wn.findIndex(r,i).map(function(n){return oa({index:n,candidates:r})})},ua=function(n,e){return wn.findIndex(n,function(n){return je(e,n)})},aa=function(t,n,o,e){return e(Math.floor(n/o),n%o).bind(function(n){var e=n.row()*o+n.column();return 0<=e&&e<t.length?x.some(t[e]):x.none()})},ca=function(r,n,i,u,a){return aa(r,n,u,function(n,e){var t=n===i-1?r.length-n*u:u,o=wu(e,a,0,t-1);return x.some({row:O.constant(n),column:O.constant(o)})})},sa=function(i,n,u,a,c){return aa(i,n,a,function(n,e){var t=wu(n,c,0,u-1),o=t===u-1?i.length-t*a:a,r=xu(e,0,o-1);return x.some({row:O.constant(t),column:O.constant(r)})})},fa=[co("selector"),ho("execute",ju),li("onEscape"),ho("captureTab",!1),hi()],la=function(r){return function(n,e,t,o){return ra(n,e,t.selector()).bind(function(n){return r(n.candidates(),n.index(),o.getNumRows().getOr(t.initSize().numRows()),o.getNumColumns().getOr(t.initSize().numColumns()))})}},da=function(n,e,t,o){return t.captureTab()?x.some(!0):x.none()},ma=la(function(n,e,t,o){return ca(n,e,t,o,-1)}),ga=la(function(n,e,t,o){return ca(n,e,t,o,1)}),pa=la(function(n,e,t,o){return sa(n,e,t,o,-1)}),ha=la(function(n,e,t,o){return sa(n,e,t,o,1)}),va=O.constant([bu(gu(su.LEFT()),Xu(ma,ga)),bu(gu(su.RIGHT()),Yu(ma,ga)),bu(gu(su.UP()),Zu(pa)),bu(gu(su.DOWN()),na(ha)),bu(pu([hu,gu(su.TAB())]),da),bu(pu([yu,gu(su.TAB())]),da),bu(gu(su.ESCAPE()),function(n,e,t,o){return t.onEscape()(n,e)}),bu(gu(su.SPACE().concat(su.ENTER())),function(e,t,o,n){return(r=e,i=o,i.focusManager().get(r).bind(function(n){return cu(n,i.selector())})).bind(function(n){return o.execute()(e,t,n)});var r,i})]),ya=O.constant({}),ba=Iu(fa,Gu,va,ya,{},x.some(function(e,t,n){au(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),wa=function(n,e,t,r){return ra(n,t,e).bind(function(n){var e=n.index(),t=n.candidates(),o=wu(e,r,0,t.length-1);return x.from(t[o])})},xa=[co("selector"),ho("getInitial",x.none),ho("execute",ju),ho("executeOnMove",!1)],Ta=function(e,t,o){return(n=e,r=o,r.focusManager().get(n).bind(function(n){return cu(n,r.selector())})).bind(function(n){return o.execute()(e,t,n)});var n,r},Sa=function(n,e,t){return wa(n,t.selector(),e,-1)},ka=function(n,e,t){return wa(n,t.selector(),e,1)},Ca=function(o){return function(n,e,t){return o(n,e,t).bind(function(){return t.executeOnMove()?Ta(n,e,t):x.some(!0)})}},Oa=O.constant({}),Ea=O.constant({}),Da=Iu(xa,Ko,function(n){return[bu(gu(su.LEFT().concat(su.UP())),Ca(Xu(Sa,ka))),bu(gu(su.RIGHT().concat(su.DOWN())),Ca(Yu(Sa,ka))),bu(gu(su.ENTER()),Ta),bu(gu(su.SPACE()),Ta)]},Oa,Ea,x.some(function(e,t){t.getInitial()(e).or(au(e.element(),t.selector())).each(function(n){t.focusManager().set(e,n)})})),Aa=Ee.immutableBag(["rowIndex","columnIndex","cell"],[]),Ma=function(n,e,t){return x.from(n[e]).bind(function(n){return x.from(n[t]).map(function(n){return Aa({rowIndex:e,columnIndex:t,cell:n})})})},Ba=function(n,e,t,o){var r=n[e].length,i=wu(t,o,0,r-1);return Ma(n,e,i)},Ra=function(n,e,t,o){var r=wu(t,o,0,n.length-1),i=n[r].length,u=xu(e,0,i-1);return Ma(n,r,u)},Ia=function(n,e,t,o){var r=n[e].length,i=xu(t+o,0,r-1);return Ma(n,e,i)},Fa=function(n,e,t,o){var r=xu(t+o,0,n.length-1),i=n[r].length,u=xu(e,0,i-1);return Ma(n,r,u)},Na=[lo("selectors",[co("row"),co("cell")]),ho("cycles",!0),ho("previousSelector",x.none),ho("execute",ju)],Va=function(n,e){return function(t,o,u){var a=u.cycles()?n:e;return cu(o,u.selectors().row()).bind(function(n){var e=ou(n,u.selectors().cell());return ua(e,o).bind(function(r){var i=ou(t,u.selectors().row());return ua(i,n).bind(function(n){var e,t,o=(e=i,t=u,wn.map(e,function(n){return ou(n,t.selectors().cell())}));return a(o,n,r).map(function(n){return n.cell()})})})})}},Ha=Va(function(n,e,t){return Ba(n,e,t,-1)},function(n,e,t){return Ia(n,e,t,-1)}),ja=Va(function(n,e,t){return Ba(n,e,t,1)},function(n,e,t){return Ia(n,e,t,1)}),za=Va(function(n,e,t){return Ra(n,t,e,-1)},function(n,e,t){return Fa(n,t,e,-1)}),La=Va(function(n,e,t){return Ra(n,t,e,1)},function(n,e,t){return Fa(n,t,e,1)}),Pa=O.constant([bu(gu(su.LEFT()),Xu(Ha,ja)),bu(gu(su.RIGHT()),Yu(Ha,ja)),bu(gu(su.UP()),Zu(za)),bu(gu(su.DOWN()),na(La)),bu(gu(su.SPACE().concat(su.ENTER())),function(e,t,o){return jr(e.element()).bind(function(n){return o.execute()(e,t,n)})})]),Wa=O.constant({}),Ua=O.constant({}),Ga=Iu(Na,Ko,Pa,Wa,Ua,x.some(function(e,t){t.previousSelector()(e).orThunk(function(){var n=t.selectors();return au(e.element(),n.cell())}).each(function(n){t.focusManager().set(e,n)})})),$a=[co("selector"),ho("execute",ju),ho("moveOnTab",!1)],qa=function(e,t,o){return o.focusManager().get(e).bind(function(n){return o.execute()(e,t,n)})},_a=function(n,e,t){return wa(n,t.selector(),e,-1)},Ka=function(n,e,t){return wa(n,t.selector(),e,1)},Xa=O.constant([bu(gu(su.UP()),ea(_a)),bu(gu(su.DOWN()),ea(Ka)),bu(pu([hu,gu(su.TAB())]),function(n,e,t){return t.moveOnTab()?ea(_a)(n,e,t):x.none()}),bu(pu([yu,gu(su.TAB())]),function(n,e,t){return t.moveOnTab()?ea(Ka)(n,e,t):x.none()}),bu(gu(su.ENTER()),qa),bu(gu(su.SPACE()),qa)]),Ya=O.constant({}),Ja=O.constant({}),Qa=Iu($a,Ko,Xa,Ya,Ja,x.some(function(e,t,n){au(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Za=[li("onSpace"),li("onEnter"),li("onShiftEnter"),li("onLeft"),li("onRight"),li("onTab"),li("onShiftTab"),li("onUp"),li("onDown"),li("onEscape"),mo("focusIn")],nc=O.constant({}),ec=O.constant({}),tc=Iu(Za,Ko,function(n,e,t){return[bu(gu(su.SPACE()),t.onSpace()),bu(pu([yu,gu(su.ENTER())]),t.onEnter()),bu(pu([hu,gu(su.ENTER())]),t.onShiftEnter()),bu(pu([hu,gu(su.TAB())]),t.onShiftTab()),bu(pu([yu,gu(su.TAB())]),t.onTab()),bu(gu(su.UP()),t.onUp()),bu(gu(su.DOWN()),t.onDown()),bu(gu(su.LEFT()),t.onLeft()),bu(gu(su.RIGHT()),t.onRight()),bu(gu(su.SPACE()),t.onSpace()),bu(gu(su.ESCAPE()),t.onEscape())]},nc,ec,x.some(function(e,t){return t.focusIn().bind(function(n){return n(e,t)})})),oc={acyclic:Nu.schema(),cyclic:Vu.schema(),flow:Da.schema(),flatgrid:ba.schema(),matrix:Ga.schema(),execution:Uu.schema(),menu:Qa.schema(),special:tc.schema()},rc=(Xi=to("Creating behaviour: "+(Ki={branchKey:"mode",branches:oc,name:"keying",active:{events:function(n,e){return n.handler().toEvents(n,e)}},apis:{focusIn:function(n){n.getSystem().triggerFocus(n.element(),n.element())},setGridSize:function(n,e,t,o,r){Bt(t,"setGridSize")?t.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:$u}).name,Zo,Ki),zo(io(Xi.branchKey,Xi.branches),Xi.name,Xi.active,Xi.apis,Xi.extra,Xi.state)),ic=function(o,n){return e=o,t={},r=wn.map(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+o,Xt(e,e,mt(),Wt(function(n){return ct.error("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([yo("dump",O.identity)]),Xt(e,e,lt(t),Gt(r));var e,t,r},uc=function(n){return n.dump()},ac="placeholder",cc=st([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),sc=function(n,e,t,o){return t.uiType===ac?(i=t,u=o,(r=n).exists(function(n){return n!==i.owner})?cc.single(!0,O.constant(i)):Et(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+M.keys(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+Nt(i,null,2))},function(n){return n.replace()})):cc.single(!1,O.constant(t));var r,i,u},fc=function(i,u,a,c){return sc(i,0,a,c).fold(function(n,e){var t=e(u,a.config,a.validated),o=Et(t,"components").getOr([]),r=wn.bind(o,function(n){return fc(i,u,n,c)});return[D.deepMerge(t,{components:r})]},function(n,e){return e(u,a.config,a.validated)})},lc=function(e,t,n,o){var r,i,u,a,c=M.map(o,function(n,e){return t=e,o=n,r=!1,{name:O.constant(t),required:function(){return o.fold(function(n,e){return n},function(n,e){return n})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+t);return r=!0,o}};var t,o,r}),s=(r=e,i=t,u=n,a=c,wn.bind(u,function(n){return fc(r,i,n,a)}));return M.each(c,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+Nt(t.components(),null,2))}),s},dc=cc.single,mc=cc.multiple,gc=O.constant(ac),pc=0,hc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++pc+String(e)},vc=st([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),yc=ho("factory",{sketch:O.identity}),bc=ho("schema",[]),wc=co("name"),xc=Xt("pname","pname",gt(function(n){return"<alloy."+hc(n.name)+">"}),uo()),Tc=ho("defaults",O.constant({})),Sc=ho("overrides",O.constant({})),kc=Gt([yc,bc,wc,xc,Tc,Sc]),Cc=Gt([yc,bc,wc,Tc,Sc]),Oc=Gt([yc,bc,wc,xc,Tc,Sc]),Ec=Gt([yc,bc,wc,co("unit"),xc,Tc,Sc]),Dc=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},Ac=function(t,o){return function(n){var e=oo("Converting part type",o,n);return t(e)}},Mc=Ac(vc.required,kc),Bc=(Ac(vc.external,Cc),Ac(vc.optional,Oc)),Rc=Ac(vc.group,Ec),Ic=O.constant("entirety"),Fc=function(n,e,t,o){var r=t;return D.deepMerge(e.defaults()(n,t,o),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,o),{"debug.sketcher":Dt("part-"+e.name(),r)})},Nc=function(r,n){var i={};return wn.each(n,function(n){var e;(e=n,e.fold(x.some,x.none,x.some,x.some)).each(function(t){var o=Vc(r,t.pname());i[t.name()]=function(n){var e=to("Part: "+t.name()+" in "+r,Gt(t.schema()),n);return D.deepMerge(o,{config:n,validated:e})}})}),i},Vc=function(n,e){return{uiType:gc(),owner:n,name:e}},Hc=function(n,e,t){return o=e,r=t,i={},u={},wn.each(r,function(n){n.fold(function(o){i[o.pname()]=dc(!0,function(n,e,t){return o.factory().sketch(Fc(n,o,e,t))})},function(n){var e=o.parts()[n.name()]();u[n.name()]=O.constant(Fc(o,n,e[Ic()]()))},function(o){i[o.pname()]=dc(!1,function(n,e,t){return o.factory().sketch(Fc(n,o,e,t))})},function(r){i[r.pname()]=mc(!0,function(e,n,t){var o=e[r.name()]();return wn.map(o,function(n){return r.factory().sketch(D.deepMerge(r.defaults()(e,n),n,r.overrides()(e,n)))})})})}),{internals:O.constant(i),externals:O.constant(u)};var o,r,i,u},jc=function(n,e,t){return lc(x.some(n),e,e.components(),t)},zc=function(n,e,t){var o=e.partUids()[t];return n.getSystem().getByUid(o).toOption()},Lc=function(n,e,t){return zc(n,e,t).getOrDie("Could not find part: "+t)},Pc=function(e,n){var t,o=(t=n,wn.map(t,Dc));return At(wn.map(o,function(n){return{key:n,value:e+"-"+n}}))},Wc=function(e){return Xt("partUids","partUids",pt(function(n){return Pc(n.uid,e)}),uo())},Uc=hc("alloy-premade"),Gc=hc("api"),$c=function(n){return Dt(Uc,n)},qc=function(o){return n=function(n){var e=Array.prototype.slice.call(arguments,0),t=n.config(Gc);return o.apply(undefined,[t].concat(e))},e=o.toString(),t=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Ro(i.slice(1))}},n;var n,e,t,r,i},_c=O.constant(Gc),Kc=O.constant("alloy-id-"),Xc=O.constant("data-alloy-id"),Yc=Kc(),Jc=Xc(),Qc=function(n){var e=ve.isElement(n)?ar.get(n,Jc):null;return x.from(e)},Zc=function(n){return hc(n)},ns=(O.constant(Jc),function(n,e,t,o,r){var i,u,a=(u=r,(0<(i=o).length?[lo("parts",i)]:[]).concat([co("uid"),ho("dom",{}),ho("components",[]),pi("originalSpec"),ho("debug.sketcher",{})]).concat(u));return oo(n+" [SpecSchema]",Ut(a.concat(e)),t)}),es=function(n,e,t,o,r){var i,u=ts(r),a=(i=t,wn.bind(i,function(n){return n.fold(x.none,x.some,x.none,x.none).map(function(n){return lo(n.name(),n.schema().concat([pi(Ic())]))}).toArray()})),c=Wc(t),s=ns(n,e,u,a,[c]),f=Hc(0,s,t),l=jc(n,s,f.internals());return D.deepMerge(o(s,l,u,f.externals()),{"debug.sketcher":Dt(n,r)})},ts=function(n){return D.deepMerge({uid:Zc("uid")},n)},os=Ut([co("name"),co("factory"),co("configFields"),ho("apis",{}),ho("extraApis",{})]),rs=Ut([co("name"),co("factory"),co("configFields"),co("partFields"),ho("apis",{}),ho("extraApis",{})]),is=function(n){var a=to("Sketcher for "+n.name,os,n),e=M.map(a.apis,qc),t=M.map(a.extraApis,function(n,e){return Io(n,e)});return D.deepMerge({name:O.constant(a.name),partFields:O.constant([]),configFields:O.constant(a.configFields),sketch:function(n){return e=a.name,t=a.configFields,o=a.factory,i=ts(r=n),u=ns(e,t,i,[],[]),D.deepMerge(o(u,i),{"debug.sketcher":Dt(e,r)});var e,t,o,r,i,u}},e,t)},us=function(n){var e=to("Sketcher for "+n.name,rs,n),t=Nc(e.name,e.partFields),o=M.map(e.apis,qc),r=M.map(e.extraApis,function(n,e){return Io(n,e)});return D.deepMerge({name:O.constant(e.name),partFields:O.constant(e.partFields),configFields:O.constant(e.configFields),sketch:function(n){return es(e.name,e.configFields,e.partFields,e.factory,n)},parts:O.constant(t)},o,r)},as=is({name:"Button",factory:function(n,e){var t,o,r,i=(t=n.action(),o=function(n,e){e.stop(),te(n)},r=Ln.detect().deviceType.isTouch()?[So(_n(),o)]:[So(P(),o),So(F(),function(n,e){e.cut()})],xo(wn.flatten([t.map(function(t){return So($n(),function(n,e){t(n),e.stop()})}).toArray(),r]))),u=Et(n.dom(),"attributes").bind(Ct("type")),a=Et(n.dom(),"tag");return{uid:n.uid(),dom:n.dom(),components:n.components(),events:i,behaviours:D.deepMerge(Yo([zi.config({}),rc.config({mode:"execution",useSpace:!0,useEnter:!0})]),uc(n.buttonBehaviours())),domModification:{attributes:D.deepMerge(u.fold(function(){return a.is("button")?{type:"button"}:{}},function(n){return{}}),{role:n.role().getOr("button")})},eventOrder:n.eventOrder()}},configFields:[ho("uid",undefined),co("dom"),ho("components",[]),ic("buttonBehaviours",[zi,rc]),mo("action"),mo("role"),ho("eventOrder",{})]}),cs=Object.freeze({events:function(n){return xo([To(U(),O.constant(!0))])},exhibit:function(n,e){return Vo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),ss=Qo({fields:[],name:"unselecting",active:cs}),fs=function(n){var e,t,o,r=ue.fromHtml(n),i=qe.children(r),u=(t=(e=r).dom().attributes!==undefined?e.dom().attributes:[],wn.foldl(t,function(n,e){return"class"===e.name?n:D.deepMerge(n,Dt(e.name,e.value))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:$r(r)};return D.deepMerge({tag:ve.name(r),classes:a,attributes:u},c)},ls=function(n){var e=In.supplant(n,{prefix:Fi.prefix()});return fs(e)},ds=function(n){return{dom:ls(n)}},ms=function(n){return Yo([Ai.config({toggleClass:Fi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Mi(n,function(n,e){(e?Ai.on:Ai.off)(n)})])},gs=function(n,e,t){return as.sketch({dom:ls('<span class="${prefix}-toolbar-button ${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:e,buttonBehaviours:D.deepMerge(Yo([ss.config({})]),t)})},ps={forToolbar:gs,forToolbarCommand:function(n,e){return gs(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,o){var r=ms(t);return gs(e,o,r)},forToolbarStateCommand:function(n,e){var t=ms(e);return gs(e,function(){n.execCommand(e)},t)}},hs=function(n,e,t){return Math.max(e,Math.min(t,n))},vs=function(n,e,t,o,r,i,u){var a=t-e;if(o<n.left)return e-1;if(o>n.right)return t+1;var c,s,f,l,d=Math.min(n.right,Math.max(o,n.left))-n.left,m=hs(d/n.width*a+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(c=m,s=e,f=t,l=r,u.fold(function(){var n=c-s,e=Math.round(n/l)*l;return hs(s+e,s-1,f+1)},function(n){var e=(c-n)%l,t=Math.round(e/l),o=Math.floor((c-n)/l),r=Math.floor((f-n)/l),i=n+Math.min(r,o+t)*l;return Math.max(n,i)})):g},ys="slider.change.value",bs=Ln.detect().deviceType.isTouch(),ws=function(n){var e;return(e=n.event().raw(),bs&&e.touches!==undefined&&1===e.touches.length?x.some(e.touches[0]):bs&&e.touches!==undefined?x.none():bs||e.clientX===undefined?x.none():x.some(e)).map(function(n){return n.clientX})},xs=function(n,e){ee(n,ys,{value:e})},Ts=function(i,u,a,n){return ws(n).map(function(n){var e,t,o,r;return e=i,o=n,r=vs(a,(t=u).min(),t.max(),o,t.stepSize(),t.snapToGrid(),t.snapStart()),xs(e,r),n})},Ss=function(n,e){var t,o,r,i,u=(t=e.value().get(),o=e.min(),r=e.max(),i=e.stepSize(),t<o?t:r<t?r:t===o?o-1:Math.max(o,t-i));xs(n,u)},ks=function(n,e){var t,o,r,i,u=(t=e.value().get(),o=e.min(),r=e.max(),i=e.stepSize(),r<t?t:t<o?o:t===r?r+1:Math.min(r,t+i));xs(n,u)},Cs=O.constant(ys),Os=Ln.detect().deviceType.isTouch(),Es=function(n,o){return Bc({name:n+"-edge",overrides:function(n){var e=xo([ko(B(),o,[n])]),t=xo([ko(F(),o,[n]),ko(N(),function(n,e){e.mouseIsDown().get()&&o(n,e)},[n])]);return{events:Os?e:t}}})},Ds=[Es("left",function(n,e){xs(n,e.min()-1)}),Es("right",function(n,e){xs(n,e.max()+1)}),Mc({name:"thumb",defaults:O.constant({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:xo([Oo(B(),n,"spectrum"),Oo(R(),n,"spectrum"),Oo(I(),n,"spectrum")])}}}),Mc({schema:[yo("mouseIsDown",function(){return Or(!1)})],name:"spectrum",overrides:function(o){var t=function(n,e){var t=n.element().dom().getBoundingClientRect();Ts(n,o,t,e)},n=xo([So(B(),t),So(R(),t)]),e=xo([So(F(),t),So(N(),function(n,e){o.mouseIsDown().get()&&t(n,e)})]);return{behaviours:Yo(Os?[]:[rc.config({mode:"special",onLeft:function(n){return Ss(n,o),x.some(!0)},onRight:function(n){return ks(n,o),x.some(!0)}}),zi.config({})]),events:Os?n:e}}})],As=function(n,e,t){e.store().manager().onLoad(n,e,t)},Ms=function(n,e,t){e.store().manager().onUnload(n,e,t)},Bs=Object.freeze({onLoad:As,onUnload:Ms,setValue:function(n,e,t,o){e.store().manager().setValue(n,e,t,o)},getValue:function(n,e,t){return e.store().manager().getValue(n,e,t)}}),Rs=Object.freeze({events:function(t,o){var n=t.resetOnDom()?[Do(function(n,e){As(n,t,o)}),Ao(function(n,e){Ms(n,t,o)})]:[jo(t,o,As)];return xo(n)}}),Is=function(){var n=Or(null);return _o({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},Fs=function(){var n=Or({});return _o({readState:function(){return{mode:"dataset",dataset:n.get()}},set:n.set,get:n.get})},Ns=Object.freeze({memory:Is,dataset:Fs,manual:function(){return _o({readState:function(){}})},init:function(n){return n.store().manager().state(n)}}),Vs=function(n,e,t,o){e.store().getDataKey(),t.set({}),e.store().setData()(n,o),e.onSetValue()(n,o)},Hs=[mo("initialValue"),co("getFallbackEntry"),co("getDataKey"),co("setData"),gi("manager",{setValue:Vs,getValue:function(n,e,t){var o=e.store().getDataKey()(n),r=t.get();return Et(r,o).fold(function(){return e.store().getFallbackEntry()(o)},function(n){return n})},onLoad:function(e,t,o){t.store().initialValue().each(function(n){Vs(e,t,o,n)})},onUnload:function(n,e,t){t.set({})},state:Fs})],js=[co("getValue"),ho("setValue",O.noop),mo("initialValue"),gi("manager",{setValue:function(n,e,t,o){e.store().setValue()(n,o),e.onSetValue()(n,o)},getValue:function(n,e,t){return e.store().getValue()(n)},onLoad:function(e,t,n){t.store().initialValue().each(function(n){t.store().setValue()(e,n)})},onUnload:O.noop,state:Ko})],zs=[mo("initialValue"),gi("manager",{setValue:function(n,e,t,o){t.set(o),e.onSetValue()(n,o)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store().initialValue().each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:Is})],Ls=[vo("store",{mode:"memory"},io("mode",{memory:zs,manual:js,dataset:Hs})),fi("onSetValue"),ho("resetOnDom",!1)],Ps=Qo({fields:Ls,name:"representing",active:Rs,apis:Bs,extra:{setValueFrom:function(n,e){var t=Ps.getValue(e);Ps.setValue(n,t)}},state:Ns}),Ws=Ln.detect().deviceType.isTouch(),Us=[co("min"),co("max"),ho("stepSize",1),ho("onChange",O.noop),ho("onInit",O.noop),ho("onDragStart",O.noop),ho("onDragEnd",O.noop),ho("snapToGrid",!1),mo("snapStart"),co("getInitialValue"),ic("sliderBehaviours",[rc,Ps]),yo("value",function(n){return Or(n.min)})].concat(Ws?[]:[yo("mouseIsDown",function(){return Or(!1)})]),Gs=_i("width",function(n){return n.dom().offsetWidth}),$s=function(n,e){Gs.set(n,e)},qs=function(n){return Gs.get(n)},_s=Ln.detect().deviceType.isTouch(),Ks=us({name:"Slider",configFields:Us,partFields:Ds,factory:function(c,n,e,t){var s=c.max()-c.min(),f=function(n){var e=n.element().dom().getBoundingClientRect();return(e.left+e.right)/2},r=function(n){return Lc(n,c,"thumb")},i=function(n){var e,t,o,r,i=Lc(n,c,"spectrum").element().dom().getBoundingClientRect(),u=n.element().dom().getBoundingClientRect(),a=(e=n,t=i,(r=(o=c).value().get())<o.min()?zc(e,o,"left-edge").fold(function(){return 0},function(n){return f(n)-t.left}):r>o.max()?zc(e,o,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(o.value().get()-o.min())/s*t.width);return i.left-u.left+a},u=function(n){var e=i(n),t=r(n),o=qs(t.element())/2;qi.set(t.element(),"left",e-o+"px")},o=function(n,e){var t=c.value().get(),o=r(n);return t!==e||qi.getRaw(o.element(),"left").isNone()?(c.value().set(e),u(n),c.onChange()(n,o,e),x.some(!0)):x.none()},a=_s?[So(B(),function(n,e){c.onDragStart()(n,r(n))}),So(I(),function(n,e){c.onDragEnd()(n,r(n))})]:[So(F(),function(n,e){e.stop(),c.onDragStart()(n,r(n)),c.mouseIsDown().set(!0)}),So(V(),function(n,e){c.onDragEnd()(n,r(n)),c.mouseIsDown().set(!1)})];return{uid:c.uid(),dom:c.dom(),components:n,behaviours:D.deepMerge(Yo(wn.flatten([_s?[]:[rc.config({mode:"special",focusIn:function(n){return zc(n,c,"spectrum").map(rc.focusIn).map(O.constant(!0))}})],[Ps.config({store:{mode:"manual",getValue:function(n){return c.value().get()}}})]])),uc(c.sliderBehaviours())),events:xo([So(Cs(),function(n,e){o(n,e.event().value())}),Do(function(n,e){c.value().set(c.getInitialValue()());var t=r(n);u(n),c.onInit()(n,t,c.value().get())})].concat(a)),apis:{resetToMin:function(n){o(n,c.min())},resetToMax:function(n){o(n,c.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Xs=function(e,t,o){return ps.forToolbar(t,function(){var n=o();e.setContextToolbar([{label:t+" group",items:n}])},{})},Ys=function(n){return[(r=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Ks.sketch({dom:ls('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Ks.parts()["left-edge"](ds('<div class="${prefix}-hue-slider-black"></div>')),Ks.parts().spectrum({dom:ls('<div class="${prefix}-slider-gradient-container"></div>'),components:[ds('<div class="${prefix}-slider-gradient"></div>')],behaviours:Yo([Ai.config({toggleClass:Fi.resolve("thumb-active")})])}),Ks.parts()["right-edge"](ds('<div class="${prefix}-hue-slider-white"></div>')),Ks.parts().thumb({dom:ls('<div class="${prefix}-slider-thumb"></div>'),behaviours:Yo([Ai.config({toggleClass:Fi.resolve("thumb-active")})])})],onChange:function(n,e,t){var o=i(t);qi.set(e.element(),"background-color",o),r.onChange(n,e,o)},onDragStart:function(n,e){Ai.on(e)},onDragEnd:function(n,e){Ai.off(e)},onInit:function(n,e,t){var o=i(t);qi.set(e.element(),"background-color",o)},stepSize:10,min:0,max:360,getInitialValue:r.getInitialValue,sliderBehaviours:Yo([Bi(Ks.refresh)])}))];var r,i},Js=function(n,o){var e={onChange:function(n,e,t){o.undoManager.transact(function(){o.formatter.apply("forecolor",{value:t}),o.nodeChanged()})},getInitialValue:function(){return-1}};return Xs(n,"color",function(){return Ys(e)})},Qs=Ut([co("getInitialValue"),co("onChange"),co("category"),co("sizes")]),Zs=function(n){var r=to("SizeSlider",Qs,n);return Ks.sketch({dom:{tag:"div",classes:[Fi.resolve("slider-"+r.category+"-size-container"),Fi.resolve("slider"),Fi.resolve("slider-size-container")]},onChange:function(n,e,t){var o;0<=(o=t)&&o<r.sizes.length&&r.onChange(t)},onDragStart:function(n,e){Ai.on(e)},onDragEnd:function(n,e){Ai.off(e)},min:0,max:r.sizes.length-1,stepSize:1,getInitialValue:r.getInitialValue,snapToGrid:!0,sliderBehaviours:Yo([Bi(Ks.refresh)]),components:[Ks.parts().spectrum({dom:ls('<div class="${prefix}-slider-size-container"></div>'),components:[ds('<div class="${prefix}-slider-size-line"></div>')]}),Ks.parts().thumb({dom:ls('<div class="${prefix}-slider-thumb"></div>'),behaviours:Yo([Ai.config({toggleClass:Fi.resolve("thumb-active")})])})]})},nf=function(n,e,t){for(var o=n.dom(),r=E.isFunction(t)?t:O.constant(!1);o.parentNode;){o=o.parentNode;var i=ue.fromDom(o),u=e(i);if(u.isSome())return u;if(r(i))break}return x.none()},ef=function(n,e,t){return e(n).orThunk(function(){return t(n)?x.none():nf(n,e,t)})},tf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],of=function(n){var e,t,o=n.selection.getStart(),r=ue.fromDom(o),i=ue.fromDom(n.getBody()),u=(e=function(n){return je(i,n)},t=r,(ve.isElement(t)?x.some(t):qe.parent(t)).map(function(n){return ef(n,function(n){return qi.getRaw(n,"font-size")},e).getOrThunk(function(){return qi.get(n,"font-size")})}).getOr(""));return wn.find(tf,function(n){return u===n}).getOr("medium")},rf={candidates:O.constant(tf),get:function(n){var e,t=of(n);return(e=t,wn.findIndex(tf,function(n){return n===e})).getOr(2)},apply:function(o,n){var e;(e=n,x.from(tf[e])).each(function(n){var e,t;t=n,of(e=o)!==t&&e.execCommand("fontSize",!1,t)})}},uf=rf.candidates(),af=function(n){return[ds('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Zs({onChange:e.onChange,sizes:uf,category:"font",getInitialValue:e.getInitialValue})),ds('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},cf=function(n){var e=n.uid!==undefined&&Bt(n,"uid")?n.uid:Zc("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(x.none,x.some)},asSpec:function(){return D.deepMerge(n,{uid:e})}}};function sf(n,e){return lf(document.createElement("canvas"),n,e)}function ff(n){return n.getContext("2d")}function lf(n,e,t){return n.width=e,n.height=t,n}var df={create:sf,clone:function(n){var e;return ff(e=sf(n.width,n.height)).drawImage(n,0,0),e},resize:lf,get2dContext:ff,get3dContext:function(n){var e=null;try{e=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(t){}return e||(e=null),e}},mf={getWidth:function(n){return n.naturalWidth||n.width},getHeight:function(n){return n.naturalHeight||n.height}},gf=window.Promise?window.Promise:function(){var n=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(n,o(r,this),o(u,this))},e=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(n){setTimeout(n,1)};function o(n,e){return function(){n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(o){var r=this;null!==this._state?e(function(){var n=r._state?o.onFulfilled:o.onRejected;if(null!==n){var e;try{e=n(r._value)}catch(t){return void o.reject(t)}o.resolve(e)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void s(o(e,n),o(r,this),o(u,this))}this._state=!0,this._value=n,a.call(this)}catch(t){u.call(this,t)}}function u(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds.length;n<e;n++)i.call(this,this._deferreds[n]);this._deferreds=null}function c(n,e,t,o){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=o}function s(n,e,t){var o=!1;try{n(function(n){o||(o=!0,e(n))},function(n){o||(o=!0,t(n))})}catch(r){if(o)return;o=!0,t(r)}}return n.prototype["catch"]=function(n){return this.then(null,n)},n.prototype.then=function(t,o){var r=this;return new n(function(n,e){i.call(r,new c(t,o,n,e))})},n.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&t(arguments[0])?arguments[0]:arguments);return new n(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){a(e,n)},i)}c[e]=n,0==--u&&r(c)}catch(o){i(o)}}for(var n=0;n<c.length;n++)a(n,c[n])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(n){n(e)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.race=function(r){return new n(function(n,e){for(var t=0,o=r.length;t<o;t++)r[t].then(n,e)})},n}();function pf(){return new(Re.getOrDie("FileReader"))}var hf={atob:function(n){return Re.getOrDie("atob")(n)},requestAnimationFrame:function(n){Re.getOrDie("requestAnimationFrame")(n)}};function vf(a){return new gf(function(n,e){var t=URL.createObjectURL(a),o=new Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),n(o)}function u(){r(),e("Unable to load data of type "+a.type+": "+t)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=t,o.complete&&i()})}function yf(o){return new gf(function(n,t){var e=new XMLHttpRequest;e.open("GET",o,!0),e.responseType="blob",e.onload=function(){200==this.status&&n(this.response)},e.onerror=function(){var n,e=this;t(0===this.status?((n=new Error("No access to download image")).code=18,n.name="SecurityError",n):new Error("Error "+e.status+" downloading image"))},e.send()})}function bf(n){var e=n.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return x.none();for(var o,r,i,u=t[1],a=e[1],c=hf.atob(a),s=c.length,f=Math.ceil(s/1024),l=new Array(f),d=0;d<f;++d){for(var m=1024*d,g=Math.min(m+1024,s),p=new Array(g-m),h=m,v=0;h<g;++v,++h)p[v]=c[h].charCodeAt(0);l[d]=(o=p,new(Re.getOrDie("Uint8Array"))(o))}return x.some((r=l,i={type:u},new(Re.getOrDie("Blob"))(r,i)))}function wf(t){return new gf(function(n,e){bf(t).fold(function(){e("uri is not base64: "+t)},n)})}function xf(t){return new gf(function(n){var e=new pf;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}var Tf,Sf,kf,Cf,Of,Ef,Df,Af,Mf={blobToImage:vf,imageToBlob:function(n){var e=n.src;return 0===e.indexOf("data:")?wf(e):yf(e)},blobToArrayBuffer:function(t){return new gf(function(n){var e=new pf;e.onloadend=function(){n(e.result)},e.readAsArrayBuffer(t)})},blobToDataUri:xf,blobToBase64:function(n){return xf(n).then(function(n){return n.split(",")[1]})},dataUriToBlobSync:bf,canvasToBlob:function(n,t,o){return t=t||"image/png",HTMLCanvasElement.prototype.toBlob?new gf(function(e){n.toBlob(function(n){e(n)},t,o)}):wf(n.toDataURL(t,o))},canvasToDataURL:function(n,e,t){return e=e||"image/png",n.then(function(n){return n.toDataURL(e,t)})},blobToCanvas:function(n){return vf(n).then(function(n){var e,t;return e=n,URL.revokeObjectURL(e.src),t=df.create(mf.getWidth(n),mf.getHeight(n)),df.get2dContext(t).drawImage(n,0,0),t})},uriToBlob:function(n){return 0===n.indexOf("blob:")?yf(n):0===n.indexOf("data:")?wf(n):null}},Bf=function(n){return Mf.blobToBase64(n)},Rf=function(u){var e=cf({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:xo([Eo(P()),So(L(),function(n,e){var t,o,r;(t=e,o=t.event(),r=o.raw().target.files||o.raw().dataTransfer.files,x.from(r[0])).each(function(n){var r,i;r=u,Bf(i=n).then(function(o){r.undoManager.transact(function(){var n=r.editorUpload.blobCache,e=n.create(hc("mceu"),i,o);n.add(e);var t=r.dom.createHTML("img",{src:e.blobUri()});r.insertContent(t)})})})})])});return as.sketch({dom:ls('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},If=function(n){return n.dom().textContent},Ff=function(n,e){n.dom().textContent=e},Nf=function(n){return 0<n.length},Vf=function(n){return n===undefined||null===n?"":n},Hf=function(e,t,n){return n.text.filter(Nf).fold(function(){return ar.get(n=e,"href")===If(n)?x.some(t):x.none();var n},x.some)},jf=function(n){var e=ue.fromDom(n.selection.getStart());return cu(e,"a")},zf={getInfo:function(n){return jf(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:x.none()}},function(n){return t=If(e=n),o=ar.get(e,"href"),r=ar.get(e,"title"),i=ar.get(e,"target"),{url:Vf(o),text:t!==o?Vf(t):"",title:Vf(r),target:Vf(i),link:x.some(e)};var e,t,o,r,i})},applyInfo:function(r,i){i.url.filter(Nf).fold(function(){var e;e=r,i.link.bind(O.identity).each(function(n){e.execCommand("unlink")})},function(t){var n,e,o=(n=i,(e={}).href=t,n.title.filter(Nf).each(function(n){e.title=n}),n.target.filter(Nf).each(function(n){e.target=n}),e);i.link.bind(O.identity).fold(function(){var n=i.text.filter(Nf).getOr(t);r.insertContent(r.dom.createHTML("a",o,r.dom.encode(n)))},function(e){var n=Hf(e,t,i);ar.setAll(e,o),n.each(function(n){Ff(e,n)})})})},query:jf},Lf=Ln.detect(),Pf=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},Wf=function(n,e){(Lf.os.isAndroid()?Pf:O.apply)(e,n)},Uf=function(n,e){var t,o;return{key:n,value:{config:{},me:(t=n,o=xo(e),Qo({fields:[co("enabled")],name:t,active:{events:O.constant(o)}})),configAsRaw:O.constant({}),initialConfig:{},state:er()}}},Gf=Object.freeze({getCurrent:function(n,e,t){return e.find()(n)}}),$f=[co("find")],qf=Qo({fields:$f,name:"composing",apis:Gf}),_f=is({name:"Container",factory:function(n,e){return{uid:n.uid(),dom:D.deepMerge({tag:"div",attributes:{role:"presentation"}},n.dom()),components:n.components(),behaviours:uc(n.containerBehaviours()),events:n.events(),domModification:n.domModification(),eventOrder:n.eventOrder()}},configFields:[ho("components",[]),ic("containerBehaviours",[]),ho("events",{}),ho("domModification",{}),ho("eventOrder",{})]}),Kf=is({name:"DataField",factory:function(t,n){return{uid:t.uid(),dom:t.dom(),behaviours:D.deepMerge(Yo([Ps.config({store:{mode:"memory",initialValue:t.getInitialValue()()}}),qf.config({find:x.some})]),uc(t.dataBehaviours())),events:xo([Do(function(n,e){Ps.setValue(n,t.getInitialValue()())})])}},configFields:[co("uid"),co("dom"),co("getInitialValue"),ic("dataBehaviours",[Ps,qf])]}),Xf=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},Yf=function(n){return n.dom().value},Jf=O.constant([mo("data"),ho("inputAttributes",{}),ho("inputStyles",{}),ho("type","input"),ho("tag","input"),ho("inputClasses",[]),fi("onSetValue"),ho("styles",{}),mo("placeholder"),ho("eventOrder",{}),ic("inputBehaviours",[Ps,zi]),ho("selectOnFocus",!0)]),Qf=is({name:"Input",configFields:Jf(),factory:function(n,e){return{uid:n.uid(),dom:(o=n,{tag:o.tag(),attributes:D.deepMerge(At([{key:"type",value:o.type()}].concat(o.placeholder().map(function(n){return{key:"placeholder",value:n}}).toArray())),o.inputAttributes()),styles:o.inputStyles(),classes:o.inputClasses()}),components:[],behaviours:(t=n,D.deepMerge(Yo([Ps.config({store:{mode:"manual",initialValue:t.data().getOr(undefined),getValue:function(n){return Yf(n.element())},setValue:function(n,e){Yf(n.element())!==e&&Xf(n.element(),e)}},onSetValue:t.onSetValue()}),zi.config({onFocus:!1===t.selectOnFocus()?O.noop:function(n){var e=n.element(),t=Yf(e);e.dom().setSelectionRange(0,t.length)}})]),uc(t.inputBehaviours()))),eventOrder:n.eventOrder()};var t,o}}),Zf=Object.freeze({exhibit:function(n,e){return Vo({attributes:At([{key:e.tabAttr(),value:"true"}])})}}),nl=[ho("tabAttr","data-alloy-tabstop")],el=Qo({fields:nl,name:"tabstopping",active:Zf}),tl=function(n,e){var t=cf(Qf.sketch({placeholder:e,onSetValue:function(n,e){ne(n,z())},inputBehaviours:Yo([qf.config({find:x.some}),el.config({}),rc.config({mode:"execution"})]),selectOnFocus:!1})),o=cf(as.sketch({dom:ls('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);Ps.setValue(e,"")}}));return{name:n,spec:_f.sketch({dom:ls('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),o.asSpec()],containerBehaviours:Yo([Ai.config({toggleClass:Fi.resolve("input-container-empty")}),qf.config({find:function(n){return x.some(t.get(n))}}),Uf("input-clearing",[So(z(),function(n){var e=t.get(n);(0<Ps.getValue(e).length?Ai.off:Ai.on)(n)})])])})}},ol=["input","button","textarea"],rl=function(n,e,t){e.disabled()&&fl(n,e,t)},il=function(n){return wn.contains(ol,ve.name(n.element()))},ul=function(n){ar.set(n.element(),"disabled","disabled")},al=function(n){ar.remove(n.element(),"disabled")},cl=function(n){ar.set(n.element(),"aria-disabled","true")},sl=function(n){ar.set(n.element(),"aria-disabled","false")},fl=function(e,n,t){n.disableClass().each(function(n){xr.add(e.element(),n)}),(il(e)?ul:cl)(e)},ll=function(n){return il(n)?ar.has(n.element(),"disabled"):"true"===ar.get(n.element(),"aria-disabled")},dl=Object.freeze({enable:function(e,n,t){n.disableClass().each(function(n){xr.remove(e.element(),n)}),(il(e)?al:sl)(e)},disable:fl,isDisabled:ll,onLoad:rl}),ml=Object.freeze({exhibit:function(n,e,t){return Vo({classes:e.disabled()?e.disableClass().map(wn.pure).getOr([]):[]})},events:function(n,e){return xo([To($n(),function(n,e){return ll(n)}),jo(n,e,rl)])}}),gl=[ho("disabled",!1),mo("disableClass")],pl=Qo({fields:gl,name:"disabling",active:ml,apis:dl}),hl=[ic("formBehaviours",[Ps])],vl=function(n){return"<alloy.field."+n+">"},yl=function(r,n,e){return D.deepMerge({"debug.sketcher":{Form:e},uid:r.uid(),dom:r.dom(),components:n,behaviours:D.deepMerge(Yo([Ps.config({store:{mode:"manual",getValue:function(n){var e,t,o=(e=r,t=n.getSystem(),M.map(e.partUids(),function(n,e){return O.constant(t.getByUid(n))}));return M.map(o,function(n,e){return n().bind(qf.getCurrent).map(Ps.getValue)})},setValue:function(t,n){M.each(n,function(e,n){zc(t,r,n).each(function(n){qf.getCurrent(n).each(function(n){Ps.setValue(n,e)})})})}}})]),uc(r.formBehaviours())),apis:{getField:function(n,e){return zc(n,r,e).bind(qf.getCurrent)}}})},bl=(qc(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",o=vl(n),r=e,{uiType:gc(),owner:t,name:o,config:r,validated:{}};var t,o,r},record:function(){return i}}),t=n(e),o=e.record(),r=wn.map(o,function(n){return Mc({name:n,pname:vl(n)})});return es("form",hl,r,yl,t)}),wl=function(){var e=Or(x.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(x.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(x.some(n))},run:function(n){e.get().each(n)}}},xl=function(){var e=Or(x.none());return{clear:function(){e.set(x.none())},set:function(n){e.set(x.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Tl=function(n){return{xValue:n,points:[]}},Sl=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,o={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([o])}},kl=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},Cl=function(n){var o="navigateEvent",e=Gt([co("fields"),ho("maxFieldIndex",n.fields.length-1),co("onExecute"),co("getInitialValue"),yo("state",function(){return{dialogSwipeState:xl(),currentScreen:Or(0)}})]),u=to("SerialisedDialog",e,n),r=function(e,n,t){return as.sketch({dom:ls('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ee(n,o,{direction:e})},buttonBehaviours:Yo([pl.config({disableClass:Fi.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,r){var i=ou(n.element(),"."+Fi.resolve("serialised-dialog-screen"));au(n.element(),"."+Fi.resolve("serialised-dialog-chain")).each(function(o){0<=u.state.currentScreen.get()+r&&u.state.currentScreen.get()+r<i.length&&(qi.getRaw(o,"left").each(function(n){var e=parseInt(n,10),t=qs(i[0]);qi.set(o,"left",e-r*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+r))})},a=function(o){var n=ou(o.element(),"input");x.from(n[u.state.currentScreen.get()]).each(function(n){o.getSystem().getByDom(n).each(function(n){var e,t;e=o,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=s.get(o);Bu.highlightAt(e,u.state.currentScreen.get())},c=cf(bl(function(t){return{dom:ls('<div class="${prefix}-serialised-dialog"></div>'),components:[_f.sketch({dom:ls('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:wn.map(u.fields,function(n,e){return e<=u.maxFieldIndex?_f.sketch({dom:ls('<div class="${prefix}-serialised-dialog-screen"></div>'),components:wn.flatten([[r(-1,"previous",0<e)],[t.field(n.name,n.spec)],[r(1,"next",e<u.maxFieldIndex)]])}):t.field(n.name,n.spec)})})],formBehaviours:Yo([Bi(function(n,e){var t;t=e,au(n.element(),"."+Fi.resolve("serialised-dialog-chain")).each(function(n){qi.set(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),rc.config({mode:"special",focusIn:function(n){a(n)},onTab:function(n){return i(n,1),x.some(!0)},onShiftTab:function(n){return i(n,-1),x.some(!0)}}),Uf("form-events",[Do(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=s.get(e);Bu.highlightFirst(t),u.getInitialValue(e).each(function(n){Ps.setValue(e,n)})}),Bo(u.onExecute),So(W(),function(n,e){"left"===e.event().raw().propertyName&&a(n)}),So(o,function(n,e){var t=e.event().direction();i(n,t)})])])}})),s=cf({dom:ls('<div class="${prefix}-dot-container"></div>'),behaviours:Yo([Bu.config({highlightClass:Fi.resolve("dot-active"),itemClass:Fi.resolve("dot-item")})]),components:wn.bind(u.fields,function(n,e){return e<=u.maxFieldIndex?[ds('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:ls('<div class="${prefix}-serializer-wrapper"></div>'),components:[c.asSpec(),s.asSpec()],behaviours:Yo([rc.config({mode:"special",focusIn:function(n){var e=c.get(n);rc.focusIn(e)}}),Uf("serializer-wrapper-events",[So(B(),function(n,e){u.state.dialogSwipeState.set(Tl(e.event().raw().touches[0].clientX))}),So(R(),function(n,e){u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(Sl(n,e.event().raw().touches[0].clientX))})}),So(I(),function(o){u.state.dialogSwipeState.on(function(n){var e=c.get(o),t=-1*kl(n);i(e,t)})})])])}},Ol=G(function(t,o){return[{label:"the link group",items:[Cl({fields:[tl("url","Type or paste URL"),tl("text","Link text"),tl("title","Link title"),tl("target","Link target"),(n="link",{name:n,spec:Kf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return x.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return x.some(zf.getInfo(o))},onExecute:function(n){var e=Ps.getValue(n);zf.applyInfo(o,e),t.restoreToolbar(),o.focus()}})]}];var n}),El=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Dl={events:xo([(Tf=Wn(),Sf=function(n,e){var t,o,r=e.event().originator(),i=e.event().target();return o=i,!(je(t=r,n.element())&&!je(t,o)&&(console.warn(Wn()+" did not get interpreted by the desired target. \nOriginator: "+Yr(r)+"\nTarget: "+Yr(i)+"\nCheck the "+Wn()+" event handlers"),1))},{key:Tf,value:bo({can:Sf})})])},Al=O.identity,Ml=qo.exactly(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),Bl=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Yr(e().element())+" is not in context.")}};return Ml({debugInfo:O.constant("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:O.constant(!1)})},Rl=function(e,n){var t=wn.map(n,function(n){return Xt(n.name(),n.name(),mt(),Gt([co("config"),ho("state",Xo)]))}),o=no("component.behaviours",Gt(t),e.behaviours).fold(function(n){throw new Error(ro(n)+"\nComplete spec:\n"+Nt(e,null,2))},O.identity);return{list:n,data:M.map(o,function(n){var e=n();return O.constant(e.map(function(n){return{config:n.config(),state:n.state().init(n.config())}}))})}},Il=function(n){return n.list},Fl=function(n){return n.data},Nl=function(n,r){var i={};return M.each(n,function(n,o){M.each(n,function(n,e){var t=Ot(e,[])(i);i[e]=t.concat([r(o,n)])})}),i},Vl=function(n,e){return{name:O.constant(n),modification:e}},Hl=function(n,e,t){return 1<n.length?ct.error('Multiple behaviours have tried to change DOM "'+e+'". The guilty behaviours are: '+Nt(wn.map(n,function(n){return n.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===n.length?ct.value({}):ct.value(n[0].modification().fold(function(){return{}},function(n){return Dt(e,n)}))},jl=function(u,a){return wn.foldl(u,function(n,e){var t=e.modification().getOr({});return n.bind(function(i){var n=M.mapToArray(t,function(n,e){return i[e]!==undefined?(t=a,o=e,r=u,ct.error("Mulitple behaviours have tried to change the _"+o+'_ "'+t+'". The guilty behaviours are: '+Nt(wn.bind(r,function(n){return n.modification().getOr({})[o]!==undefined?[n.name()]:[]}),null,2)+". This is not currently supported.")):ct.value(Dt(e,n));var t,o,r});return Mt(n,i)})},ct.value({})).map(function(n){return Dt(a,n)})},zl={classes:function(n,e){var t=wn.bind(n,function(n){return n.modification().getOr([])});return ct.value(Dt(e,t))},attributes:jl,styles:jl,domChildren:Hl,defChildren:Hl,innerHtml:Hl,value:Hl},Ll=function(u,a,n,c){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[a](),o=e[a](),r=c.indexOf(t),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+Nt(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+Nt(c,null,2));return r<i?-1:i<r?1:0});return ct.value(t)}catch(o){return ct.error([o])}},Pl=function(n,e){return{handler:O.curry.apply(undefined,[n.handler].concat(e)),purpose:n.purpose}},Wl=function(n){return n.handler},Ul=function(n,e){return{name:O.constant(n),handler:O.constant(e)}},Gl=function(n,e,t){var o,r,i,u=D.deepMerge(t,(o=e,r=n,i={},wn.each(o,function(n){i[n.name()]=n.handlers(r)}),i));return Nl(u,Ul)},$l=function(n){var e,o=(e=n,E.isFunction(e)?{can:O.constant(!0),abort:O.constant(!1),run:e}:e);return function(n,e){var t=Array.prototype.slice.call(arguments,0);o.abort.apply(undefined,t)?e.stop():o.can.apply(undefined,t)&&o.run.apply(undefined,t)}},ql=function(n,e,t){var o,r,i=e[t];return i?Ll("Event: "+t,"name",n,i).map(function(n){var e=wn.map(n,function(n){return n.handler()});return wo(e)}):(o=t,r=n,ct.error(["The event ("+o+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+Nt(wn.map(r,function(n){return n.name()}),null,2)]))},_l=function(n,u){var e=M.mapToArray(n,function(r,i){return(1===r.length?ct.value(r[0].handler()):ql(r,u,i)).map(function(n){var e,t=$l(n),o=1<r.length?wn.filter(u,function(e){return wn.contains(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return Dt(i,(e=o,{handler:t,purpose:O.constant(e)}))})});return Mt(e,{})},Kl=function(n){return no("custom.definition",Ut([Xt("dom","dom",dt(),Ut([co("tag"),ho("styles",{}),ho("classes",[]),ho("attributes",{}),mo("value"),mo("innerHtml")])),co("components"),co("uid"),ho("events",{}),ho("apis",O.constant({})),Xt("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]},ft.mergeWithThunk(O.constant(e))),uo()),mo("domModification"),pi("originalSpec"),ho("debug.sketcher","unknown")]),n);var e},Xl=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:D.deepMerge((e=n,Dt(Xc(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:wn.map(n.components(),function(n){return n.element()})};return Fo(D.deepMerge(t,n.dom().innerHtml().map(function(n){return Dt("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return Dt("value",n)}).getOr({})))},Yl=function(e,n){wn.each(n,function(n){xr.add(e,n)})},Jl=function(e,n){wn.each(n,function(n){xr.remove(e,n)})},Ql=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=No(e),Nt(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return wn.map(n,nd)},function(n){return n});var n},Zl=function(n){var e=ue.fromTag(n.tag());ar.setAll(e,n.attributes().getOr({})),Yl(e,n.classes().getOr([])),qi.setAll(e,n.styles().getOr({})),qr(e,n.innerHtml().getOr(""));var t=Ql(n);return Je(e,t),n.value().each(function(n){Xf(e,n)}),e},nd=function(n){var e=Fo(n);return Zl(e)},ed=function(n){var e,t,o,r=(t=Et(e=n,"behaviours").getOr({}),o=wn.filter(M.keys(t),function(n){return t[n]!==undefined}),wn.map(o,function(n){return e.behaviours[n].me}));return Rl(n,r)},td=qo.exactly(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),od=function(t){var n,e,o,r,i,u,a,c,s,f,l=function(){return C},d=Or(Bl(l)),m=eo(Kl(D.deepMerge(t,{behaviours:undefined}))),g=ed(t),p=Il(g),h=Fl(g),v=Xl(m),y={"alloy.base.modification":(n=m,n.domModification().fold(function(){return Vo({})},Vo))},b=function(e,n,t,o){var r=D.deepMerge({},n);wn.each(t,function(n){r[n.name()]=n.exhibit(e,o)});var i=Nl(r,Vl),u=M.map(i,function(n,e){return wn.bind(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),a=M.mapToArray(u,function(e,t){return Et(zl,t).fold(function(){return ct.error("Unknown field type: "+t)},function(n){return n(e,t)})});return Mt(a,{}).map(Vo)}(h,y,p,v).getOrDie(),w=(e=v,o=b,r=D.deepMerge({tag:e.tag(),classes:o.classes().getOr([]).concat(e.classes().getOr([])),attributes:D.merge(e.attributes().getOr({}),o.attributes().getOr({})),styles:D.merge(e.styles().getOr({}),o.styles().getOr({}))},o.innerHtml().or(e.innerHtml()).map(function(n){return Dt("innerHtml",n)}).getOr({}),Ho("domChildren",o.domChildren(),e.domChildren()),Ho("defChildren",o.defChildren(),e.defChildren()),o.value().or(e.value()).map(function(n){return Dt("value",n)}).getOr({})),Fo(r)),x=Zl(w),T={"alloy.base.behaviour":(i=m,i.events())},S=(u=h,a=m.eventOrder(),c=p,s=T,f=Gl(u,c,s),_l(f,a)).getOrDie(),k=Or(m.components()),C=td({getSystem:d.get,config:function(n){if(n===_c())return m.apis();var e=h;return(E.isFunction(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+Nt(t,null,2))})()},hasConfigured:function(n){return E.isFunction(h[n.name()])},spec:O.constant(t),readState:function(n){return h[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){d.set(n)},disconnect:function(){d.set(Bl(l))},element:O.constant(x),syncComponents:function(){var n=qe.children(x),e=wn.bind(n,function(n){return d.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});k.set(e)},components:k.get,events:O.constant(S)});return C},rd=function(n){var e,t,o=Al(n),r=(e=o,t=Ot("components",[])(e),wn.map(t,ad)),i=D.deepMerge(Dl,o,Dt("components",r));return ct.value(od(i))},id=function(n){var e=ue.fromText(n);return ud({element:e})},ud=function(n){var t=oo("external.component",Ut([co("element"),mo("uid")]),n),e=Or(Bl());t.uid().each(function(n){var e;e=t.element(),ar.set(e,Jc,n)});var o=td({getSystem:e.get,config:x.none,hasConfigured:O.constant(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Bl(function(){return o}))},element:O.constant(t.element()),spec:O.constant(n),readState:O.constant("No state"),syncComponents:O.noop,components:O.constant([]),events:O.constant({})});return $c(o)},ad=function(e){return(n=e,Et(n,Uc)).fold(function(){var n=D.deepMerge({uid:Zc("")},e);return rd(n).getOrDie()},function(n){return n});var n},cd=$c,sd="alloy.item-hover",fd="alloy.item-focus",ld=function(n){(jr(n.element()).isNone()||zi.isFocused(n))&&(zi.isFocused(n)||zi.focus(n),ee(n,sd,{item:n}))},dd=function(n){ee(n,fd,{item:n})},md=O.constant(sd),gd=O.constant(fd),pd=[co("data"),co("components"),co("dom"),mo("toggling"),ho("itemBehaviours",{}),ho("ignoreFocus",!1),ho("domModification",{}),gi("builder",function(n){return{dom:D.deepMerge(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:D.deepMerge(Yo([n.toggling().fold(Ai.revoke,function(n){return Ai.config(D.deepMerge({aria:{mode:"checked"}},n))}),zi.config({ignore:n.ignoreFocus(),onFocus:function(n){dd(n)}}),rc.config({mode:"execution"}),Ps.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:xo([(e=Kn(),o=te,So(e,function(e,t){e.getSystem().getByDom(t.event().target()).each(function(n){o(e,n,t)})})),Eo(F()),So(H(),ld),So(qn(),zi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,o}),ho("eventOrder",{})],hd=[co("dom"),co("components"),gi("builder",function(n){return{dom:n.dom(),components:n.components(),events:xo([(e=qn(),So(e,function(n,e){e.stop()}))])};var e})],vd=O.constant("item-widget"),yd=O.constant([Mc({name:"widget",overrides:function(e){return{behaviours:Yo([Ps.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),bd=[co("uid"),co("data"),co("components"),co("dom"),ho("autofocus",!1),ho("domModification",{}),Wc(yd()),gi("builder",function(t){var n=Hc(vd(),t,yd()),e=jc(vd(),t,n.internals()),o=function(n){return zc(n,t,"widget").map(function(n){return rc.focusIn(n),n})},r=function(n,e){return Hu(e.event().target())||t.autofocus()&&e.setSource(n.element()),x.none()};return D.deepMerge({dom:t.dom(),components:e,domModification:t.domModification(),events:xo([Bo(function(n,e){o(n).each(function(n){e.stop()})}),So(H(),ld),So(qn(),function(n,e){t.autofocus()?o(n):zi.focus(n)})]),behaviours:Yo([Ps.config({store:{mode:"memory",initialValue:t.data()}}),zi.config({onFocus:function(n){dd(n)}}),rc.config({mode:"special",focusIn:t.autofocus()?function(n){o(n)}:nr(),onLeft:r,onRight:r,onEscape:function(n,e){return zi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),x.none()):(zi.focus(n),x.some(!0))}})])})})],wd=io("type",{widget:bd,item:pd,separator:hd}),xd=O.constant([Rc({factory:{sketch:function(n){var e=oo("menu.spec item",wd,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Zc("");return D.deepMerge({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Td=O.constant([co("value"),co("items"),co("dom"),co("components"),ho("eventOrder",{}),ic("menuBehaviours",[Bu,Ps,qf,rc]),vo("movement",{mode:"menu",moveOnTab:!0},io("mode",{grid:[hi(),gi("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[ho("moveOnTab",!0),gi("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),so("markers",ai()),ho("fakeFocus",!1),ho("focusManager",Ru()),fi("onHighlight")]),Sd=(O.constant("menu"),O.constant("alloy.menu-focus")),kd=us({name:"Menu",configFields:Td(),partFields:xd(),factory:function(n,e,t,o){return D.deepMerge({dom:D.deepMerge(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:D.deepMerge(Yo([Bu.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),Ps.config({store:{mode:"memory",initialValue:n.value()}}),qf.config({find:O.identity}),rc.config(n.movement().config()(n,n.movement()))]),uc(n.menuBehaviours())),events:xo([So(gd(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){Bu.highlight(e,n),t.stop(),ee(e,Sd(),{menu:e,item:n})})}),So(md(),function(n,e){var t=e.event().item();Bu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),Cd=function(n,e,t,o){var r=n.getSystem().build(o);ot(n,r,t)},Od=function(n,e){return n.components()},Ed=Object.freeze({append:function(n,e,t,o){Cd(n,0,Xe.append,o)},prepend:function(n,e,t,o){Cd(n,0,Xe.prepend,o)},remove:function(n,e,t,o){var r=Od(n,e);wn.find(r,function(n){return je(o.element(),n.element())}).each(it)},set:function(e,n,t,o){var r,i,u,a,c,s;i=(r=e).components(),wn.each(i,rt),Ze.empty(r.element()),r.syncComponents(),u=function(){var n=wn.map(o,e.getSystem().build);wn.each(n,function(n){tt(e,n)})},a=e.element(),c=qe.owner(a),s=Hr(c).bind(function(e){var n=function(n){return je(e,n)};return n(a)?x.some(a):Br.descendant(a,n)}),u(a),s.each(function(e){Hr(c).filter(function(n){return je(n,e)}).orThunk(function(){Nr(e)})})},contents:Od}),Dd=Qo({fields:[],name:"replacing",apis:Ed}),Ad=function(t,o,r,n){return Et(r,n).bind(function(n){return Et(t,n).bind(function(n){var e=Ad(t,o,r,n);return x.some([n].concat(e))})}).getOr([])},Md=function(n,e){var t={};M.each(n,function(n,e){wn.each(n,function(n){t[n]=e})});var o,r=e,i=(o=e,M.tupleMap(o,function(n,e){return{k:n,v:e}})),u=M.map(i,function(n,e){return[e].concat(Ad(t,r,i,e))});return M.map(t,function(n){return Et(u,n).getOr([n])})},Bd=O.constant("collapse-item"),Rd=is({name:"TieredMenu",configFields:[mi("onExecute"),mi("onEscape"),di("onOpenMenu"),di("onOpenSubmenu"),fi("onCollapseMenu"),ho("openImmediately",!0),lo("data",[co("primary"),co("menus"),co("expansions")]),ho("fakeFocus",!1),fi("onHighlight"),fi("onHover"),lo("markers",[co("backgroundMenu")].concat(ii()).concat(ui())),co("dom"),ho("navigateOnHover",!0),ho("stayInDom",!1),ic("tmenuBehaviours",[rc,Bu,qf,Dd]),ho("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)}},factory:function(u,r){var a,c,s,f,l,n,i=function(o,n){return M.map(n,function(n,e){var t=kd.sketch(D.deepMerge(n,{value:e,items:n.items,markers:St(r.markers,["item","selectedItem"]),fakeFocus:u.fakeFocus(),onHighlight:u.onHighlight(),focusManager:u.fakeFocus()?{get:function(n){return Bu.getHighlighted(n).map(function(n){return n.element()})},set:function(e,n){e.getSystem().getByDom(n).fold(O.noop,function(n){Bu.highlight(e,n)})}}:Ru()}));return o.getSystem().build(t)})},d=(a=Or({}),c=Or({}),s=Or({}),f=Or(x.none()),l=Or(O.constant([])),{setContents:function(n,e,t,o){f.set(x.some(n)),a.set(t),c.set(e),l.set(o);var r=o(e),i=Md(r,t);s.set(i)},expand:function(t){return Et(a.get(),t).map(function(n){var e=Et(s.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return Et(s.get(),n)},collapse:function(n){return Et(s.get(),n).bind(function(n){return 1<n.length?x.some(n.slice(1)):x.none()})},lookupMenu:n=function(n){return Et(c.get(),n)},otherMenus:function(n){var e=l.get()(c.get());return wn.difference(M.keys(e),n)},getPrimary:function(){return f.get().bind(n)},getMenus:function(){return c.get()},clear:function(){a.set({}),c.set({}),s.set({}),f.set(x.none())},isClear:function(){return f.get().isNone()}}),m=function(n){return Ps.getValue(n).value},g=function(n,e){return M.map(u.data().menus(),function(n,e){return wn.bind(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},p=function(e,n){Bu.highlight(e,n),Bu.getHighlighted(n).orThunk(function(){return Bu.getFirst(n)}).each(function(n){oe(e,n.element(),qn())})},h=function(n,e){return Qr(wn.map(e,n.lookupMenu))},v=function(o,r,i){return x.from(i[0]).bind(r.lookupMenu).map(function(n){var e=h(r,i.slice(1));wn.each(e,function(n){xr.add(n.element(),u.markers().backgroundMenu())}),we.inBody(n.element())||Dd.append(o,cd(n)),Jl(n.element(),[u.markers().backgroundMenu()]),p(o,n);var t=h(r,r.otherMenus(i));return wn.each(t,function(n){Jl(n.element(),[u.markers().backgroundMenu()]),u.stayInDom()||Dd.remove(o,n)}),n})},y=function(e,t){var n=m(t);return d.expand(n).bind(function(n){return x.from(n[0]).bind(d.lookupMenu).each(function(n){we.inBody(n.element())||Dd.append(e,cd(n)),u.onOpenSubmenu()(e,t,n),Bu.highlightFirst(n)}),v(e,d,n)})},o=function(e,t){var n=m(t);return d.collapse(n).bind(function(n){return v(e,d,n).map(function(n){return u.onCollapseMenu()(e,t,n),n})})},e=function(t){return function(e,n){return cu(n.getSource(),"."+u.markers().item()).bind(function(n){return e.getSystem().getByDom(n).bind(function(n){return t(e,n)})})}},t=xo([So(Sd(),function(n,e){var t=e.event().menu();Bu.highlight(n,t)}),Bo(function(e,n){var t=n.event().target();return e.getSystem().getByDom(t).bind(function(n){return 0===m(n).indexOf("collapse-item")?o(e,n):y(e,n).orThunk(function(){return u.onExecute()(e,n)})})}),Do(function(e,n){var t,o;(t=e,o=i(t,u.data().menus()),d.setContents(u.data().primary(),o,u.data().expansions(),function(n){return g(t,n)}),d.getPrimary()).each(function(n){Dd.append(e,cd(n)),u.openImmediately()&&(p(e,n),u.onOpenMenu()(e,n))})})].concat(u.navigateOnHover()?[So(md(),function(n,e){var t,o,r=e.event().item();t=n,o=m(r),d.refresh(o).bind(function(n){return v(t,d,n)}),y(n,r),u.onHover()(n,r)})]:[]));return{uid:u.uid(),dom:u.dom(),behaviours:D.deepMerge(Yo([rc.config({mode:"special",onRight:e(function(n,e){return Hu(e.element())?x.none():y(n,e)}),onLeft:e(function(n,e){return Hu(e.element())?x.none():o(n,e)}),onEscape:e(function(n,e){return o(n,e).orThunk(function(){return u.onEscape()(n,e)})}),focusIn:function(e,n){d.getPrimary().each(function(n){oe(e,n.element(),qn())})}}),Bu.config({highlightClass:u.markers().selectedMenu(),itemClass:u.markers().menu()}),qf.config({find:function(n){return Bu.getHighlighted(n)}}),Dd.config({})]),uc(u.tmenuBehaviours())),eventOrder:u.eventOrder(),apis:{collapseMenu:function(e){Bu.getHighlighted(e).each(function(n){Bu.getHighlighted(n).each(function(n){o(e,n)})})}},events:t}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:Dt(n,e),expansions:{}}},collapseItem:function(n){return{value:hc(Bd()),text:n}}}}),Id=function(n,e,t,o){return Et(e.routes(),o.start()).map(O.apply).bind(function(n){return Et(n,o.destination()).map(O.apply)})},Fd=function(n,e,t,o){return Id(0,e,0,o).bind(function(e){return e.transition().map(function(n){return{transition:O.constant(n),route:O.constant(e)}})})},Nd=function(t,o,n){var e,r,i;(e=t,r=o,i=n,Vd(e,r,i).bind(function(n){return Fd(e,r,i,n)})).each(function(n){var e=n.transition();xr.remove(t.element(),e.transitionClass()),ar.remove(t.element(),o.destinationAttr())})},Vd=function(n,e,t){var o=n.element();return ar.has(o,e.destinationAttr())?x.some({start:O.constant(ar.get(n.element(),e.stateAttr())),destination:O.constant(ar.get(n.element(),e.destinationAttr()))}):x.none()},Hd=function(n,e,t,o){Nd(n,e,t),ar.has(n.element(),e.stateAttr())&&ar.get(n.element(),e.stateAttr())!==o&&e.onFinish()(n,o),ar.set(n.element(),e.stateAttr(),o)},jd=Object.freeze({findRoute:Id,disableTransition:Nd,getCurrentRoute:Vd,jumpTo:Hd,progressTo:function(t,o,r,i){var n,e;e=o,ar.has((n=t).element(),e.destinationAttr())&&(ar.set(n.element(),e.stateAttr(),ar.get(n.element(),e.destinationAttr())),ar.remove(n.element(),e.destinationAttr()));var u,a,c,s=(u=t,a=o,c=i,{start:O.constant(ar.get(u.element(),a.stateAttr())),destination:O.constant(c)});Fd(t,o,r,s).fold(function(){Hd(t,o,r,i)},function(n){Nd(t,o,r);var e=n.transition();xr.add(t.element(),e.transitionClass()),ar.set(t.element(),o.destinationAttr(),i)})},getState:function(n,e,t){var o=n.element();return ar.has(o,e.stateAttr())?x.some(ar.get(o,e.stateAttr())):x.none()}}),zd=Object.freeze({events:function(r,i){return xo([So(W(),function(t,n){var o=n.event().raw();Vd(t,r,i).each(function(e){Id(0,r,0,e).each(function(n){n.transition().each(function(n){o.propertyName===n.property()&&(Hd(t,r,i,e.destination()),r.onTransition()(t,e))})})})}),Do(function(n,e){Hd(n,r,i,r.initialState())})])}}),Ld=[ho("destinationAttr","data-transitioning-destination"),ho("stateAttr","data-transitioning-state"),co("initialState"),fi("onTransition"),fi("onFinish"),so("routes",qt(ct.value,qt(ct.value,Ut([po("transition",[co("property"),co("transitionClass")])]))))],Pd=Qo({fields:Ld,name:"transitioning",active:zd,apis:jd,extra:{createRoutes:function(n){var o={};return M.each(n,function(n,e){var t=e.split("<->");o[t[0]]=Dt(t[1],n),o[t[1]]=Dt(t[0],n)}),o},createBistate:function(n,e,t){return At([{key:n,value:Dt(e,t)},{key:e,value:Dt(n,t)}])},createTristate:function(n,e,t,o){return At([{key:n,value:At([{key:e,value:o},{key:t,value:o}])},{key:e,value:At([{key:n,value:o},{key:t,value:o}])},{key:t,value:At([{key:n,value:o},{key:e,value:o}])}])}}}),Wd=Fi.resolve("scrollable"),Ud={register:function(n){xr.add(n,Wd)},deregister:function(n){xr.remove(n,Wd)},scrollable:O.constant(Wd)},Gd=function(n){return Et(n,"format").getOr(n.title)},$d=function(n,e,t,o,r){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:r?[Fi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Fi.resolve("format-matches"),selected:t},itemBehaviours:Yo(r?[]:[Mi(n,function(n,e){(e?Ai.on:Ai.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:o},innerHtml:e}}]}},qd=function(n,e,t,o){return{value:n,dom:{tag:"div"},components:[as.sketch({dom:{tag:"div",classes:[Fi.resolve("styles-collapser")]},components:o?[{dom:{tag:"span",classes:[Fi.resolve("styles-collapse-icon")]}},id(n)]:[id(n)],action:function(n){if(o){var e=t().get(n);Rd.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Fi.resolve("styles-menu-items-container")]},components:[kd.parts().items({})],behaviours:Yo([Uf("adhoc-scrollable-menu",[Do(function(n,e){qi.set(n.element(),"overflow-y","auto"),qi.set(n.element(),"-webkit-overflow-scrolling","touch"),Ud.register(n.element())}),Ao(function(n){qi.remove(n.element(),"overflow-y"),qi.remove(n.element(),"-webkit-overflow-scrolling"),Ud.deregister(n.element())})])])}],items:e,menuBehaviours:Yo([Pd.config({initialState:"after",routes:Pd.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},_d=function(o){var r,i,n,e,t,u=(r=o.formats,i=function(){return a},n=qd("Styles",[].concat(wn.map(r.items,function(n){return $d(Gd(n),n.title,n.isSelected(),n.getPreview(),Bt(r.expansions,Gd(n)))})),i,!1),e=M.map(r.menus,function(n,e){var t=wn.map(n,function(n){return $d(Gd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Bt(r.expansions,Gd(n)))});return qd(e,t,i,!0)}),t=D.deepMerge(e,Dt("styles",n)),{tmenu:Rd.tieredData("styles",t,r.expansions)}),a=cf(Rd.sketch({dom:{tag:"div",classes:[Fi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Ps.getValue(e);o.handle(e,t.value)},onEscape:function(){},onOpenMenu:function(n,e){var t=qs(n.element());$s(e.element(),t),Pd.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var o=qs(n.element()),r=uu(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(r).getOrDie();$s(t.element(),o),Pd.progressTo(i,"before"),Pd.jumpTo(t,"after"),Pd.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var o=uu(e.element(),'[role="menu"]').getOrDie("hacky"),r=n.getSystem().getByDom(o).getOrDie();Pd.progressTo(r,"after"),Pd.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:Fi.resolve("styles-background-menu"),menu:Fi.resolve("styles-menu"),selectedMenu:Fi.resolve("styles-selected-menu"),item:Fi.resolve("styles-item"),selectedItem:Fi.resolve("styles-selected-item")}}));return a.asSpec()},Kd=function(n){return Bt(n,"items")?(e=n,t=D.deepMerge(kt(e,["items"]),{menu:!0}),o=Xd(e.items),{item:t,menus:D.deepMerge(o.menus,Dt(e.title,o.items)),expansions:D.deepMerge(o.expansions,Dt(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,o},Xd=function(n){return wn.foldr(n,function(n,e){var t=Kd(e);return{menus:D.deepMerge(n.menus,t.menus),items:[t.item].concat(n.items),expansions:D.deepMerge(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},Yd={expand:Xd},Jd=function(a,n){var c=function(n){return function(){return a.formatter.match(n)}},s=function(n){return function(){return a.formatter.getCssText(n)}},e=Et(n,"style_formats").getOr(El),f=function(n){return wn.map(n,function(n){if(Bt(n,"items")){var e=f(n.items);return D.deepMerge((u=n,D.deepMerge(u,{isSelected:O.constant(!1),getPreview:O.constant("")})),{items:e})}return Bt(n,"format")?(i=n,D.deepMerge(i,{isSelected:c(i.format),getPreview:s(i.format)})):(o=hc((t=n).title),r=D.deepMerge(t,{format:o,isSelected:c(o),getPreview:s(o)}),a.formatter.register(o,r),r);var t,o,r,i,u})};return f(e)},Qd=function(t,n,o){var e,r,i,u=(e=t,i=(r=function(n){return wn.bind(n,function(n){return n.items!==undefined?0<r(n.items).length?[n]:[]:!Bt(n,"format")||e.formatter.canApply(n.format)?[n]:[]})})(n),Yd.expand(i));return _d({formats:u,handle:function(n,e){t.undoManager.transact(function(){Ai.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),o()}})},Zd=["undo","bold","italic","link","image","bullist","styleselect"],nm=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},em=function(n){return wn.bind(n,function(n){return E.isArray(n)?em(n):nm(n)})},tm=function(n){var e=n.toolbar!==undefined?n.toolbar:Zd;return E.isArray(e)?em(e):nm(e)},om=function(o,r){var n=function(n){return function(){return ps.forToolbarCommand(r,n)}},e=function(n){return function(){return ps.forToolbarStateCommand(r,n)}},t=function(n,e,t){return function(){return ps.forToolbarStateAction(r,n,e,t)}},i=n("undo"),u=n("redo"),a=e("bold"),c=e("italic"),s=e("underline"),f=n("removeformat"),l=t("unlink","link",function(){r.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){r.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){r.execCommand("InsertOrderedList",null,!1)}),g=Jd(r,r.settings),p=function(){return Qd(r,g,function(){r.fire("scrollIntoView")})},h=function(n,e){return{isSupported:function(){return n.forall(function(n){return Bt(r.buttons,n)})},sketch:e}};return{undo:h(x.none(),i),redo:h(x.none(),u),bold:h(x.none(),a),italic:h(x.none(),c),underline:h(x.none(),s),removeformat:h(x.none(),f),link:h(x.none(),function(){return e=o,t=r,ps.forToolbarStateAction(t,"link","link",function(){var n=Ol(e,t);e.setContextToolbar(n),Wf(t,function(){e.focusToolbar()}),zf.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:h(x.none(),l),image:h(x.none(),function(){return Rf(r)}),bullist:h(x.some("bullist"),d),numlist:h(x.some("numlist"),m),fontsizeselect:h(x.none(),function(){return e=r,n={onChange:function(n){rf.apply(e,n)},getInitialValue:function(){return rf.get(e)}},Xs(o,"font-size",function(){return af(n)});var e,n}),forecolor:h(x.none(),function(){return Js(o,r)}),styleselect:h(x.none(),function(){return ps.forToolbar("style-formats",function(n){r.fire("toReading"),o.dropup().appear(p,Ai.on,n)},Yo([Ai.config({toggleClass:Fi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),yi.config({channels:At([Ri(Wr.orientationChanged(),Ai.off),Ri(Wr.dropupDismissed(),Ai.off)])})]))})}},rm=function(n,t){var e=tm(n),o={};return wn.bind(e,function(n){var e=!Bt(o,n)&&Bt(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return o[n]=!0,e})},im=function(m,g){return function(n){if(m(n)){var e,t,o,r,i,u,a,c=ue.fromDom(n.target),s=function(){n.stopPropagation()},f=function(){n.preventDefault()},l=O.compose(f,s),d=(e=c,t=n.clientX,o=n.clientY,r=s,i=f,u=l,a=n,{target:O.constant(e),x:O.constant(t),y:O.constant(o),stop:r,prevent:i,kill:u,raw:O.constant(a)});g(d)}}},um=function(n,e,t,o,r){var i=im(t,o);return n.dom().addEventListener(e,i,r),{unbind:O.curry(am,n,e,i,r)}},am=function(n,e,t,o){n.dom().removeEventListener(e,t,o)},cm=function(n,e,t,o){return um(n,e,t,o,!1)},sm=function(n,e,t,o){return um(n,e,t,o,!0)},fm=O.constant(!0),lm=function(n,e,t){return cm(n,e,fm,t)},dm=function(n,e,t){return sm(n,e,fm,t)},mm=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:O.constant(e)}},gm=mm,pm=function(o,e){var n=ue.fromDom(o),r=null,t=lm(n,"orientationchange",function(){clearInterval(r);var n=mm(o);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(r);var e=o.innerHeight,t=0;r=setInterval(function(){e!==o.innerHeight?(clearInterval(r),n(x.some(o.innerHeight))):20<t&&(clearInterval(r),n(x.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},hm=function(n){var e=Ln.detect().os.isiOS(),t=mm(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},vm=function(n){return n.raw().touches===undefined||1!==n.raw().touches.length?x.none():x.some(n.raw().touches[0])},ym=function(t){var o,r,i,u=Or(x.none()),a=(o=function(n){u.set(x.none()),t.triggerEvent(Xn(),n)},r=400,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=arguments;i=setTimeout(function(){o.apply(null,t),i=null},r)}}),c=At([{key:B(),value:function(t){return vm(t).each(function(n){a.cancel();var e={x:O.constant(n.clientX),y:O.constant(n.clientY),target:t.target};a.schedule(t),u.set(x.some(e))}),x.none()}},{key:R(),value:function(n){return a.cancel(),vm(n).each(function(i){u.get().each(function(n){var e,t,o,r;e=i,t=n,o=Math.abs(e.clientX-t.x()),r=Math.abs(e.clientY-t.y()),(5<o||5<r)&&u.set(x.none())})}),x.none()}},{key:I(),value:function(e){return a.cancel(),u.get().filter(function(n){return je(n.target(),e.target())}).map(function(n){return t.triggerEvent(_n(),e)})}}]);return{fireIfReady:function(e,n){return Et(c,n).bind(function(n){return n(e)})}}},bm=function(t){var e=ym({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return lm(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return lm(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},wm=6<=Ln.detect().os.version.major,xm=function(o,e,t){var r=bm(o),i=qe.owner(e),u=function(n){return!je(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=o.doc().dom().hasFocus()&&o.getSelection().exists(u);t.getByDom(e).each(!0===(n||Hr(i).filter(function(n){return"input"===ve.name(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?Ai.on:Ai.off)},a=[lm(o.body(),"touchstart",function(n){o.onTouchContent(),r.fireTouchstart(n)}),r.onTouchmove(),r.onTouchend(),lm(e,"touchstart",function(n){o.onTouchToolstrip()}),o.onToReading(function(){Vr(o.body())}),o.onToEditing(O.noop),o.onScrollToCursor(function(n){n.preventDefault(),o.getCursorBox().each(function(n){var e=o.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===wm?[]:[lm(ue.fromDom(o.win()),"blur",function(){t.getByDom(e).each(Ai.off)}),lm(i,"select",n),lm(o.doc(),"selectionchange",n)]);return{destroy:function(){wn.each(a,function(n){n.unbind()})}}},Tm=function(n,e){var t=parseInt(ar.get(n,e),10);return isNaN(t)?0:t},Sm=(kf=ve.isText,Cf="text",Of=function(n){return kf(n)?x.from(n.dom().nodeValue):x.none()},Ef=Ln.detect().browser,{get:function(n){if(!kf(n))throw new Error("Can only get "+Cf+" value of a "+Cf+" node");return Df(n).getOr("")},getOption:Df=Ef.isIE()&&10===Ef.version.major?function(n){try{return Of(n)}catch(e){return x.none()}}:Of,set:function(n,e){if(!kf(n))throw new Error("Can only set raw "+Cf+" value of a "+Cf+" node");n.dom().nodeValue=e}}),km=function(n){return Sm.getOption(n)},Cm=function(n){return"img"===ve.name(n)?1:km(n).fold(function(){return qe.children(n).length},function(n){return n.length})},Om=Cm,Em=st([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Dm={before:Em.before,on:Em.on,after:Em.after,cata:function(n,e,t,o){return n.fold(e,t,o)},getStart:function(n){return n.fold(O.identity,O.identity,O.identity)}},Am=st([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Mm=Ee.immutable("start","soffset","finish","foffset"),Bm={domRange:Am.domRange,relative:Am.relative,exact:Am.exact,exactFromRange:function(n){return Am.exact(n.start(),n.soffset(),n.finish(),n.foffset())},range:Mm,getWin:function(n){var e=n.match({domRange:function(n){return ue.fromDom(n.startContainer)},relative:function(n,e){return Dm.getStart(n)},exact:function(n,e,t,o){return n}});return qe.defaultView(e)}},Rm=function(n,e,t,o){var r=qe.owner(n).dom().createRange();return r.setStart(n.dom(),e),r.setEnd(t.dom(),o),r},Im=function(n,e,t,o){var r=Rm(n,e,t,o),i=je(n,t)&&e===o;return r.collapsed&&!i},Fm=function(n,e){n.selectNodeContents(e.dom())},Nm=function(n){n.deleteContents()},Vm=function(n){return{left:O.constant(n.left),top:O.constant(n.top),right:O.constant(n.right),bottom:O.constant(n.bottom),width:O.constant(n.width),height:O.constant(n.height)}},Hm={create:function(n){return n.document.createRange()},replaceWith:function(n,e){Nm(n),n.insertNode(e.dom())},selectNodeContents:function(n,e){var t=n.document.createRange();return Fm(t,e),t},selectNodeContentsUsing:Fm,relativeToNative:function(n,e,t){var o,r,i=n.document.createRange();return o=i,e.fold(function(n){o.setStartBefore(n.dom())},function(n,e){o.setStart(n.dom(),e)},function(n){o.setStartAfter(n.dom())}),r=i,t.fold(function(n){r.setEndBefore(n.dom())},function(n,e){r.setEnd(n.dom(),e)},function(n){r.setEndAfter(n.dom())}),i},exactToNative:function(n,e,t,o,r){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(o.dom(),r),i},deleteContents:Nm,cloneFragment:function(n){var e=n.cloneContents();return ue.fromDom(e)},getFirstRect:function(n){var e=n.getClientRects(),t=0<e.length?e[0]:n.getBoundingClientRect();return 0<t.width||0<t.height?x.some(t).map(Vm):x.none()},getBounds:function(n){var e=n.getBoundingClientRect();return 0<e.width||0<e.height?x.some(e).map(Vm):x.none()},isWithin:function(n,e){return e.compareBoundaryPoints(n.END_TO_START,n)<1&&-1<e.compareBoundaryPoints(n.START_TO_END,n)},toString:function(n){return n.toString()}},jm=st([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),zm=function(n,e,t){return e(ue.fromDom(t.startContainer),t.startOffset,ue.fromDom(t.endContainer),t.endOffset)},Lm=function(n,e){var r,t,o,i=(r=n,e.match({domRange:function(n){return{ltr:O.constant(n),rtl:x.none}},relative:function(n,e){return{ltr:G(function(){return Hm.relativeToNative(r,n,e)}),rtl:G(function(){return x.some(Hm.relativeToNative(r,e,n))})}},exact:function(n,e,t,o){return{ltr:G(function(){return Hm.exactToNative(r,n,e,t,o)}),rtl:G(function(){return x.some(Hm.exactToNative(r,t,o,n,e))})}}}));return(o=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return jm.rtl(ue.fromDom(n.endContainer),n.endOffset,ue.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return zm(0,jm.ltr,o)}):zm(0,jm.ltr,o)},Pm=(jm.ltr,jm.rtl,Lm),Wm=function(i,n){return Lm(i,n).match({ltr:function(n,e,t,o){var r=i.document.createRange();return r.setStart(n.dom(),e),r.setEnd(t.dom(),o),r},rtl:function(n,e,t,o){var r=i.document.createRange();return r.setStart(t.dom(),o),r.setEnd(n.dom(),e),r}})},Um=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=ve.name(n);return"input"===t?Dm.after(n):wn.contains(["br","img"],t)?0===e?Dm.before(n):Dm.after(n):Dm.on(n,e)}),Gm=function(n,e,t,o){var r=Um(n,e),i=Um(t,o);return Bm.relative(r,i)},$m=Gm,qm=function(n,e){x.from(n.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(e)})},_m=function(n,e,t,o,r){var i=Hm.exactToNative(n,e,t,o,r);qm(n,i)},Km=function(i,n){return Pm(i,n).match({ltr:function(n,e,t,o){_m(i,n,e,t,o)},rtl:function(n,e,t,o){var r=i.getSelection();r.setBaseAndExtent?r.setBaseAndExtent(n.dom(),e,t.dom(),o):r.extend?(r.collapse(n.dom(),e),r.extend(t.dom(),o)):_m(i,t,o,n,e)}})},Xm=function(n){var e=ue.fromDom(n.anchorNode),t=ue.fromDom(n.focusNode);return Im(e,n.anchorOffset,t,n.focusOffset)?x.some(Bm.range(ue.fromDom(n.anchorNode),n.anchorOffset,ue.fromDom(n.focusNode),n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return x.some(Bm.range(ue.fromDom(e.startContainer),e.startOffset,ue.fromDom(t.endContainer),t.endOffset))}return x.none()}(n)},Ym=function(n){return x.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(Xm)},Jm=function(n,e,t,o,r){var i=$m(e,t,o,r);Km(n,i)},Qm=Ym,Zm=function(n){return Ym(n).map(function(n){return Bm.exact(n.start(),n.soffset(),n.finish(),n.foffset())})},ng=function(n){n.getSelection().removeAllRanges()},eg=function(n,e){var t=Wm(n,e);return Hm.getFirstRect(t)},tg=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:O.constant(2),height:n.height}},og=function(n){return{left:O.constant(n.left),top:O.constant(n.top),right:O.constant(n.right),bottom:O.constant(n.bottom),width:O.constant(n.width),height:O.constant(n.height)}},rg=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?function(t){if(t.collapsed){var o=ue.fromDom(t.startContainer);return qe.parent(o).bind(function(n){var e=Bm.exact(o,t.startOffset,n,Om(n));return eg(t.startContainer.ownerDocument.defaultView,e).map(tg).map(wn.pure)}).getOr([])}return wn.map(t.getClientRects(),og)}(e.getRangeAt(0)):[]},ig=function(n){n.focus();var e=ue.fromDom(n.document.body);(Hr().exists(function(n){return wn.contains(["input","textarea"],ve.name(n))})?function(n){setTimeout(function(){n()},0)}:O.apply)(function(){Hr().each(Vr),Nr(e)})},ug="data-"+Fi.resolve("last-outer-height"),ag=function(n,e){ar.set(n,ug,e)},cg=function(n){return{top:O.constant(n.top()),bottom:O.constant(n.top()+n.height())}},sg=function(n,e){var t=Tm(e,ug),o=n.innerHeight;return o<t?x.some(t-o):x.none()},fg=function(n,u){var e=ue.fromDom(u.document.body),t=lm(ue.fromDom(n),"resize",function(){sg(n,e).each(function(i){var n,e;(n=u,e=rg(n),0<e.length?x.some(e[0]).map(cg):x.none()).each(function(n){var e,t,o,r=(e=u,o=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(o,t.bottom()-e.innerHeight+50):0);0!==r&&u.scrollTo(u.pageXOffset,u.pageYOffset+r)})}),ag(e,n.innerHeight)});return ag(e,n.innerHeight),{toEditing:function(){ig(u)},destroy:function(){t.unbind()}}},lg=function(n){return x.some(ue.fromDom(n.dom().contentWindow.document.body))},dg=function(n){return x.some(ue.fromDom(n.dom().contentWindow.document))},mg=function(n){return x.from(n.dom().contentWindow)},gg=function(n){return mg(n).bind(Qm)},pg=function(n){return n.getFrame()},hg=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=pg(e);return function(){return t(n)}})()}},vg=function(n,e,t,o){return n[t].getOrThunk(function(){return function(n){return lm(e,o,n)}})},yg=function(n){return{left:O.constant(n.left),top:O.constant(n.top),right:O.constant(n.right),bottom:O.constant(n.bottom),width:O.constant(n.width),height:O.constant(n.height)}},bg={getBody:hg("getBody",lg),getDoc:hg("getDoc",dg),getWin:hg("getWin",mg),getSelection:hg("getSelection",gg),getFrame:pg,getActiveApi:function(a){var c=pg(a);return lg(c).bind(function(u){return dg(c).bind(function(i){return mg(c).map(function(r){var n=ue.fromDom(i.dom().documentElement),e=a.getCursorBox.getOrThunk(function(){return function(){return Zm(r).bind(function(n){return eg(r,n).orThunk(function(){return Qm(r).filter(function(n){return je(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?x.some(e).map(yg):x.none()})})})}}),t=a.setSelection.getOrThunk(function(){return function(n,e,t,o){Jm(r,n,e,t,o)}}),o=a.clearSelection.getOrThunk(function(){return function(){ng(r)}});return{body:O.constant(u),doc:O.constant(i),win:O.constant(r),html:O.constant(n),getSelection:O.curry(gg,c),setSelection:t,clearSelection:o,frame:O.constant(c),onKeyup:vg(a,i,"onKeyup","keyup"),onNodeChanged:vg(a,i,"onNodeChanged","selectionchange"),onDomChanged:a.onDomChanged,onScrollToCursor:a.onScrollToCursor,onScrollToElement:a.onScrollToElement,onToReading:a.onToReading,onToEditing:a.onToEditing,onToolbarScrollStart:a.onToolbarScrollStart,onTouchContent:a.onTouchContent,onTapContent:a.onTapContent,onTouchToolstrip:a.onTouchToolstrip,getCursorBox:e}})})})}},wg="data-ephox-mobile-fullscreen-style",xg="position:absolute!important;",Tg="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;",Sg=Ln.detect().os.isAndroid(),kg=function(n,e){var t,o,r=function(o){return function(n){var e=ar.get(n,"style"),t=e===undefined?"no-styles":e.trim();t!==o&&(ar.set(n,wg,t),ar.set(n,"style",o))}},i=eu(n,"*"),u=wn.bind(i,function(n){return tu(n,"*")}),a=(t=e,(o=qi.get(t,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;");wn.each(u,r("display:none!important;")),wn.each(i,r(xg+Tg+a)),r((!0===Sg?"":xg)+Tg+a)(n)},Cg=function(){var n=nu("["+wg+"]");wn.each(n,function(n){var e=ar.get(n,wg);"no-styles"!==e?ar.set(n,"style",e):ar.remove(n,"style"),ar.remove(n,wg)})},Og=function(){var e=iu("head").getOrDie(),n=iu('meta[name="viewport"]').getOrThunk(function(){var n=ue.fromTag("meta");return ar.set(n,"name","viewport"),Xe.append(e,n),n}),t=ar.get(n,"content");return{maximize:function(){ar.set(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?ar.set(n,"content",t):ar.set(n,"content","user-scalable=yes")}}},Eg=function(e,n){var t=Og(),o=wl(),r=wl();return{enter:function(){n.hide(),xr.add(e.container,Fi.resolve("fullscreen-maximized")),xr.add(e.container,Fi.resolve("android-maximized")),t.maximize(),xr.add(e.body,Fi.resolve("android-scroll-reload")),o.set(fg(e.win,bg.getWin(e.editor).getOrDie("no"))),bg.getActiveApi(e.editor).each(function(n){kg(e.container,n.body()),r.set(xm(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),xr.remove(e.container,Fi.resolve("fullscreen-maximized")),xr.remove(e.container,Fi.resolve("android-maximized")),Cg(),xr.remove(e.body,Fi.resolve("android-scroll-reload")),r.clear(),o.clear()}}},Dg=function(e,t){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){var n=arguments;null===o&&(o=setTimeout(function(){e.apply(null,n),n=o=null},t))}}},Ag=function(e,t){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){var n=arguments;null!==o&&clearTimeout(o),o=setTimeout(function(){e.apply(null,n),n=o=null},t)}}},Mg=function(n,e){var t=cf(_f.sketch({dom:ls('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:Yo([Ai.config({toggleClass:Fi.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),o=Dg(n,200);return _f.sketch({dom:ls('<div class="${prefix}-disabled-mask"></div>'),components:[_f.sketch({dom:ls('<div class="${prefix}-content-container"></div>'),components:[as.sketch({dom:ls('<div class="${prefix}-content-tap-section"></div>'),components:[t.asSpec()],action:function(n){o.throttle()},buttonBehaviours:Yo([Ai.config({toggleClass:Fi.resolve("mask-tap-icon-selected")})])})]})]})},Bg=Gt([lo("editor",[co("getFrame"),mo("getBody"),mo("getDoc"),mo("getWin"),mo("getSelection"),mo("setSelection"),mo("clearSelection"),mo("cursorSaver"),mo("onKeyup"),mo("onNodeChanged"),mo("getCursorBox"),co("onDomChanged"),ho("onTouchContent",O.noop),ho("onTapContent",O.noop),ho("onTouchToolstrip",O.noop),ho("onScrollToCursor",O.constant({unbind:O.noop})),ho("onScrollToElement",O.constant({unbind:O.noop})),ho("onToEditing",O.constant({unbind:O.noop})),ho("onToReading",O.constant({unbind:O.noop})),ho("onToolbarScrollStart",O.identity)]),co("socket"),co("toolstrip"),co("dropup"),co("toolbar"),co("container"),co("alloy"),yo("win",function(n){return qe.owner(n.socket).dom().defaultView}),yo("body",function(n){return ue.fromDom(n.socket.dom().ownerDocument.body)}),ho("translate",O.identity),ho("setReadOnly",O.noop),ho("readOnlyOnInit",O.constant(!0))]),Rg=function(n){var e=to("Getting AndroidWebapp schema",Bg,n);qi.set(e.toolstrip,"width","100%");var t=ad(Mg(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var o={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};Xe.append(e.container,t.element());var r=Eg(e,o);return{setReadOnly:e.setReadOnly,refreshStructure:O.noop,enter:r.enter,exit:r.exit,destroy:O.noop}},Ig=O.constant([ho("shell",!0),ic("toolbarBehaviours",[Dd])]),Fg=O.constant([Bc({name:"groups",overrides:function(n){return{behaviours:Yo([Dd.config({})])}}})]),Ng=(O.constant("Toolbar"),us({name:"Toolbar",configFields:Ig(),partFields:Fg(),factory:function(e,n,t,o){var r=function(n){return e.shell()?x.some(n):zc(n,e,"groups")},i=e.shell()?{behaviours:[Dd.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid(),dom:e.dom(),components:i.components,behaviours:D.deepMerge(Yo(i.behaviours),uc(e.toolbarBehaviours())),apis:{setGroups:function(n,e){r(n).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){Dd.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}})),Vg=O.constant([co("items"),(Af=["itemClass"],lo("markers",wn.map(Af,co))),ic("tgroupBehaviours",[rc])]),Hg=O.constant([Rc({name:"items",unit:"item",overrides:function(n){return{domModification:{classes:[n.markers().itemClass()]}}}})]),jg=(O.constant("ToolbarGroup"),us({name:"ToolbarGroup",configFields:Vg(),partFields:Hg(),factory:function(n,e,t,o){return D.deepMerge({dom:{attributes:{role:"toolbar"}}},{uid:n.uid(),dom:n.dom(),components:e,behaviours:D.deepMerge(Yo([rc.config({mode:"flow",selector:"."+n.markers().itemClass()})]),uc(n.tgroupBehaviours())),"debug.sketcher":t["debug.sketcher"]})}})),zg="data-"+Fi.resolve("horizontal-scroll"),Lg=function(n){return 0<n.dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(n)},Pg=function(n){return 0<n.dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(n)},Wg=function(n){return"true"===ar.get(n,zg)?Pg:Lg},Ug={exclusive:function(n,e){return lm(n,"touchmove",function(n){cu(n.target(),e).filter(Wg).fold(function(){n.raw().preventDefault()},O.noop)})},markAsHorizontal:function(n){ar.set(n,zg,"true")}};function Gg(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:ls('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:Yo([Uf("adhoc-scrollable-toolbar",!0===n.scrollable?[Mo(function(n,e){qi.set(n.element(),"overflow-x","auto"),Ug.markAsHorizontal(n.element()),Ud.register(n.element())})]:[])]),components:[_f.sketch({components:[jg.parts().items({})]})],markers:{itemClass:Fi.resolve("toolbar-group-item")},items:n.items}},t=ad(Ng.sketch({dom:ls('<div class="${prefix}-toolbar"></div>'),components:[Ng.parts().groups({})],toolbarBehaviours:Yo([Ai.config({toggleClass:Fi.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),rc.config({mode:"cyclic"})]),shell:!0})),n=ad(_f.sketch({dom:{classes:[Fi.resolve("toolstrip")]},components:[cd(t)],containerBehaviours:Yo([Ai.config({toggleClass:Fi.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),o=function(){Ng.setGroups(t,r.get()),Ai.off(t)},r=Or([]);return{wrapper:O.constant(n),toolbar:O.constant(t),createGroups:function(n){return wn.map(n,O.compose(jg.sketch,e))},setGroups:function(n){r.set(n),o()},setContextToolbar:function(n){Ai.on(t),Ng.setGroups(t,n)},restoreToolbar:function(){Ai.isOn(t)&&o()},refresh:function(){},focus:function(){rc.focusIn(t)}}}var $g=function(n,e){Dd.append(n,cd(e))},qg=function(n,e){Dd.remove(n,e)},_g=function(n){return ad(as.sketch({dom:ls('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Kg=function(){return ad(_f.sketch({dom:ls('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:Yo([Dd.config({})])}))},Xg=function(n,e,t,o){(!0===t?Cr.toAlpha:Cr.toOmega)(o),(t?$g:qg)(n,e)},Yg=function(e,n){return n.getAnimationRoot().fold(function(){return e.element()},function(n){return n(e)})},Jg=function(n){return n.dimension().property()},Qg=function(n,e){return n.dimension().getDimension()(e)},Zg=function(n,e){var t=Yg(n,e);Jl(t,[e.shrinkingClass(),e.growingClass()])},np=function(n,e){xr.remove(n.element(),e.openClass()),xr.add(n.element(),e.closedClass()),qi.set(n.element(),Jg(e),"0px"),qi.reflow(n.element())},ep=function(n,e){xr.remove(n.element(),e.closedClass()),xr.add(n.element(),e.openClass()),qi.remove(n.element(),Jg(e))},tp=function(n,e,t){t.setCollapsed(),qi.set(n.element(),Jg(e),Qg(e,n.element())),qi.reflow(n.element());var o=Yg(n,e);xr.add(o,e.shrinkingClass()),np(n,e),e.onStartShrink()(n)},op=function(n,e,t){var o=function(n,e){ep(n,e);var t=Qg(e,n.element());return np(n,e),t}(n,e),r=Yg(n,e);xr.add(r,e.growingClass()),ep(n,e),qi.set(n.element(),Jg(e),o),t.setExpanded(),e.onStartGrow()(n)},rp=function(n,e,t){var o=Yg(n,e);return!0===xr.has(o,e.growingClass())},ip=function(n,e,t){var o=Yg(n,e);return!0===xr.has(o,e.shrinkingClass())},up=Object.freeze({grow:function(n,e,t){t.isExpanded()||op(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&tp(n,e,t)},immediateShrink:function(n,e,t){var o,r;t.isExpanded()&&(o=n,r=e,t.setCollapsed(),qi.set(o.element(),Jg(r),Qg(r,o.element())),qi.reflow(o.element()),Zg(o,r),np(o,r),r.onStartShrink()(o),r.onShrunk()(o))},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:rp,isShrinking:ip,isTransitioning:function(n,e,t){return!0===rp(n,e)||!0===ip(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?tp:op)(n,e,t)},disableTransitions:Zg}),ap=Object.freeze({exhibit:function(n,e){var t=e.expanded();return Vo(t?{classes:[e.openClass()],styles:{}}:{classes:[e.closedClass()],styles:Dt(e.dimension().property(),"0px")})},events:function(t,o){return xo([So(W(),function(n,e){e.event().raw().propertyName===t.dimension().property()&&(Zg(n,t),o.isExpanded()&&qi.remove(n.element(),t.dimension().property()),(o.isExpanded()?t.onGrown():t.onShrunk())(n,e))})])}}),cp=[co("closedClass"),co("openClass"),co("shrinkingClass"),co("growingClass"),mo("getAnimationRoot"),fi("onShrunk"),fi("onStartShrink"),fi("onGrown"),fi("onStartGrow"),ho("expanded",!1),so("dimension",io("property",{width:[gi("property","width"),gi("getDimension",function(n){return qs(n)+"px"})],height:[gi("property","height"),gi("getDimension",function(n){return Ji(n)+"px"})]}))],sp=Object.freeze({init:function(n){var e=Or(n.expanded());return _o({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:O.curry(e.set,!1),setExpanded:O.curry(e.set,!0),readState:function(){return"expanded: "+e.get()}})}}),fp=Qo({fields:cp,name:"sliding",active:ap,apis:up,state:sp}),lp=function(e,t){var o=ad(_f.sketch({dom:{tag:"div",classes:Fi.resolve("dropup")},components:[],containerBehaviours:Yo([Dd.config({}),fp.config({closedClass:Fi.resolve("dropup-closed"),openClass:Fi.resolve("dropup-open"),shrinkingClass:Fi.resolve("dropup-shrinking"),growingClass:Fi.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),Dd.set(n,[])},onGrown:function(n){e(),t()}}),Bi(function(n,e){r(O.noop)})])})),r=function(n){window.requestAnimationFrame(function(){n(),fp.shrink(o)})};return{appear:function(n,e,t){!0===fp.hasShrunk(o)&&!1===fp.isTransitioning(o)&&window.requestAnimationFrame(function(){e(t),Dd.set(o,[n()]),fp.grow(o)})},disappear:r,component:O.constant(o),element:o.element}},dp=Ln.detect().browser.isFirefox(),mp=Ut([fo("triggerEvent"),fo("broadcastEvent"),ho("stopBackspace",!0)]),gp=function(e,n){var t,o,r,i,u=to("Getting GUI events settings",mp,n),a=Ln.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=ym(u),s=wn.map(a.concat(["selectstart","input","contextmenu","change","transitionend","dragstart","dragover","drop"]),function(n){return lm(e,n,function(e){c.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),f=lm(e,"keydown",function(n){var e;u.triggerEvent("keydown",n)?n.kill():!0!==u.stopBackspace||(e=n).raw().which!==su.BACKSPACE()[0]||wn.contains(["input","textarea"],ve.name(e.target()))||n.prevent()}),l=(t=e,o=function(n){u.triggerEvent("focusin",n)&&n.kill()},dp?dm(t,"focus",o):lm(t,"focusin",o)),d=(r=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),setTimeout(function(){u.triggerEvent(Un(),n)},0)},dp?dm(r,"blur",i):lm(r,"focusout",i)),m=qe.defaultView(e),g=lm(m,"scroll",function(n){u.broadcastEvent(Jn(),n)&&n.kill()});return{unbind:function(){wn.each(s,function(n){n.unbind()}),f.unbind(),l.unbind(),d.unbind(),g.unbind()}}},pp=function(n,e){var t=Et(n,"target").map(function(n){return n()}).getOr(e);return Or(t)},hp=st([{stopped:[]},{resume:["element"]},{complete:[]}]),vp=function(n,o,e,t,r,i){var u,a,c,s,f=n(o,t),l=(u=e,a=r,c=Or(!1),s=Or(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:O.constant(u),setSource:a.set,getSource:a.get});return f.fold(function(){return i.logEventNoHandlers(o,t),hp.complete()},function(e){var t=e.descHandler();return Wl(t)(l),l.isStopped()?(i.logEventStopped(o,e.element(),t.purpose()),hp.stopped()):l.isCut()?(i.logEventCut(o,e.element(),t.purpose()),hp.complete()):qe.parent(e.element()).fold(function(){return i.logNoParent(o,e.element(),t.purpose()),hp.complete()},function(n){return i.logEventResponse(o,e.element(),t.purpose()),hp.resume(n)})})},yp=function(e,t,o,n,r,i){return vp(e,t,o,n,r,i).fold(function(){return!0},function(n){return yp(e,t,o,n,r,i)},function(){return!1})},bp=function(n,e,t){var o,r,i=(o=e,r=Or(!1),{stop:function(){r.set(!0)},cut:O.noop,isStopped:r.get,isCut:O.constant(!1),event:O.constant(o),setTarget:O.die("Cannot set target of a broadcasted event"),getTarget:O.die("Cannot get target of a broadcasted event")});return wn.each(n,function(n){var e=n.descHandler();Wl(e)(i)}),i.isStopped()},wp=function(n,e,t,o,r){var i=pp(t,o);return yp(n,e,t,o,i,r)},xp=function(n,e,t){return Br.closest(n,function(n){return e(n).isSome()},t).bind(e)},Tp=Ee.immutable("element","descHandler"),Sp=function(n,e){return{id:O.constant(n),descHandler:O.constant(e)}};function kp(){var i={};return{registerId:function(o,r,n){M.each(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[r]=Pl(n,o),i[e]=t})},unregisterId:function(t){M.each(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return Et(i,n).map(function(n){return M.mapToArray(n,function(n,e){return Sp(e,n)})}).getOr([])},find:function(n,e,t){var r=Ct(e)(i);return xp(t,function(n){return t=r,Qc(o=n).fold(function(){return x.none()},function(n){var e=Ct(n);return t.bind(e).map(function(n){return Tp(o,n)})});var t,o},n)}}}function Cp(){var o=kp(),r={},i=function(o){var n=o.element();return Qc(n).fold(function(){return n="uid-",e=o.element(),t=hc(Yc+n),ar.set(e,Jc,t),t;var n,e,t},function(n){return n})},u=function(n){Qc(n.element()).each(function(n){r[n]=undefined,o.unregisterId(n)})};return{find:function(n,e,t){return o.find(n,e,t)},filter:function(n){return o.filterByType(n)},register:function(n){var e=i(n);Bt(r,e)&&function(n,e){var t=r[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+Yr(t.element())+"\nCannot use it for: "+Yr(n.element())+"\nThe conflicting element is"+(we.inBody(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];o.registerId(t,e,n.events()),r[e]=n},unregister:u,getById:function(n){return Ct(n)(r)}}}var Op=function(t){var o=function(e){return qe.parent(t.element()).fold(function(){return!0},function(n){return je(e,n)})},r=Cp(),s=function(n,e){return r.find(o,n,e)},n=gp(t.element(),{triggerEvent:function(u,a){return ri(u,a.target(),function(n){return e=s,t=u,r=n,i=(o=a).target(),wp(e,t,o,i,r);var e,t,o,r,i})},broadcastEvent:function(n,e){var t=r.filter(n);return bp(t,e)}}),i=Ml({debugInfo:O.constant("real"),triggerEvent:function(e,t,o){ri(e,t,function(n){wp(s,e,o,t,n)})},triggerFocus:function(a,c){Qc(a).fold(function(){Nr(a)},function(n){ri(Wn(),a,function(n){var e,t,o,r,i,u;e=s,t=Wn(),o={originator:O.constant(c),target:O.constant(a)},i=n,u=pp(o,r=a),vp(e,t,o,r,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return m(n)},getByDom:function(n){return g(n)},build:ad,addToGui:function(n){a(n)},removeFromGui:function(n){c(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},isConnected:O.constant(!0)}),e=function(n){n.connect(i),ve.isText(n.element())||(r.register(n),wn.each(n.components(),e),i.triggerEvent(Yn(),n.element(),{target:O.constant(n.element())}))},u=function(n){ve.isText(n.element())||(wn.each(n.components(),u),r.unregister(n)),n.disconnect()},a=function(n){tt(t,n)},c=function(n){it(n)},f=function(t){var n=r.filter(Gn());wn.each(n,function(n){var e=n.descHandler();Wl(e)(t)})},l=function(n){f({universal:O.constant(!0),data:O.constant(n)})},d=function(n,e){f({universal:O.constant(!1),channels:O.constant(n),data:O.constant(e)})},m=function(n){return r.getById(n).fold(function(){return ct.error(new Error('Could not find component with uid: "'+n+'" in system.'))},ct.value)},g=function(n){var e=Qc(n).getOr("not found");return m(e)};return e(t),{root:O.constant(t),element:t.element,destroy:function(){n.unbind(),Ze.remove(t.element())},add:a,remove:c,getByUid:m,getByDom:g,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d}},Ep=O.constant(Fi.resolve("readonly-mode")),Dp=O.constant(Fi.resolve("edit-mode"));function Ap(n){var e=ad(_f.sketch({dom:{classes:[Fi.resolve("outer-container")].concat(n.classes)},containerBehaviours:Yo([Cr.config({alpha:Ep(),omega:Dp()})])}));return Op(e)}var Mp=function(n,e){var t=ue.fromTag("input");qi.setAll(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Xe.append(n,t),Nr(t),e(t),Ze.remove(t)},Bp=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),o=n.document.createRange();o.setStart(t.startContainer,t.startOffset),o.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(o)}},Rp=function(n,e){Hr().each(function(n){je(n,e)||Vr(n)}),n.focus(),Nr(ue.fromDom(n.document.body)),Bp(n)},Ip={stubborn:function(n,e,t,o){var r=function(){Rp(e,o)},i=lm(t,"keydown",function(n){wn.contains(["input","textarea"],ve.name(n.target()))||r()});return{toReading:function(){Mp(n,Vr)},toEditing:r,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,o){var r=function(){Vr(o)};return{toReading:function(){r()},toEditing:function(){Rp(e,o)},onToolbarTouch:function(){r()},destroy:O.noop}}},Fp=function(t,o,r,i,n){var u=function(){o.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;o.run(function(n){n.scrollIntoView(t,t+e)})},a=function(){o.run(function(n){n.clearSelection()})},c=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),o.run(function(n){n.syncHeight()})},s=bm(t),f=Ag(c,300),l=[t.onKeyup(function(){a(),f.throttle()}),t.onNodeChanged(u),t.onDomChanged(f.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),f.throttle()}),t.onScrollToElement(function(n){n.element(),e(o,i)}),t.onToEditing(function(){o.run(function(n){n.toEditing()})}),t.onToReading(function(){o.run(function(n){n.toReading()})}),lm(t.doc(),"touchend",function(n){je(t.html(),n.target())||je(t.body(),n.target())}),lm(r,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Ji(r),o.run(function(n){n.setViewportOffset(e)}),u(),c())}),dm(r,"touchstart",function(n){var e;o.run(function(n){n.highlightSelection()}),e=n,o.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),lm(t.body(),"touchstart",function(n){a(),t.onTouchContent(),s.fireTouchstart(n)}),s.onTouchmove(),s.onTouchend(),lm(t.body(),"click",function(n){n.kill()}),lm(r,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){wn.each(l,function(n){n.unbind()})}}},Np=function(n){var t=x.none(),e=[],o=function(n){r()?u(n):e.push(n)},r=function(){return t.isSome()},i=function(n){wn.each(n,u)},u=function(e){t.each(function(n){setTimeout(function(){e(n)},0)})};return n(function(n){t=x.some(n),i(e),e=[]}),{get:o,map:function(t){return Np(function(e){o(function(n){e(t(n))})})},isReady:r}},Vp={nu:Np,pure:function(e){return Np(function(n){n(e)})}},Hp=function(t){return function(){var n=Array.prototype.slice.call(arguments),e=this;setTimeout(function(){t.apply(e,n)},0)}},jp=function(e){var n=function(n){e(Hp(n))};return{map:function(o){return jp(function(t){n(function(n){var e=o(n);t(e)})})},bind:function(t){return jp(function(e){n(function(n){t(n).get(e)})})},anonBind:function(t){return jp(function(e){n(function(n){t.get(e)})})},toLazy:function(){return Vp.nu(n)},get:n}},zp={nu:jp,pure:function(e){return jp(function(n){n(e)})}},Lp=function(n,e,t){return Math.abs(n-e)<=t?x.none():n<e?x.some(n+t):x.some(n-t)},Pp=function(){var s=null;return{animate:function(o,r,n,i,e,t){var u=!1,a=function(n){u=!0,e(n)};clearInterval(s);var c=function(n){clearInterval(s),a(n)};s=setInterval(function(){var t=o();Lp(t,r,n).fold(function(){clearInterval(s),a(r)},function(n){if(i(n,c),!u){var e=o();(e!==n||Math.abs(e-r)>Math.abs(t-r))&&(clearInterval(s),a(r))}})},t)}}},Wp=function(e,t){return Zr([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e<=n.width&&t<=n.height?x.some(n.keyboard):x.none()}).getOr({portrait:t/5,landscape:e/4})},Up=function(n){var e,t=gm(n).isPortrait(),o=Wp((e=n).screen.width,e.screen.height),r=t?o.portrait:o.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>r?0:r},Gp=function(n,e){var t=qe.owner(n).dom().defaultView;return Ji(n)+Ji(e)-Up(t)},$p=Gp,qp=function(n,e,t){var o=Gp(e,t),r=Ji(e)+Ji(t)-o;qi.set(n,"padding-bottom",r+"px")},_p=st([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Kp="data-"+Fi.resolve("position-y-fixed"),Xp="data-"+Fi.resolve("y-property"),Yp="data-"+Fi.resolve("scrolling"),Jp="data-"+Fi.resolve("last-window-height"),Qp=function(n){return Tm(n,Kp)},Zp=function(n,e){var t=ar.get(n,Xp);return _p.fixed(n,t,e)},nh=function(n,e){return _p.scroller(n,e)},eh=function(n){var e=Qp(n);return("true"===ar.get(n,Yp)?nh:Zp)(n,e)},th=function(n,e,t){var o=qe.owner(n).dom().defaultView.innerHeight;return ar.set(n,Jp,o+"px"),o-e-t},oh=function(n){var e=ou(n,"["+Kp+"]");return wn.map(e,eh)},rh=function(o,r,i,u){var n,e,t,a,c,s,f,l,d=qe.owner(o).dom().defaultView,m=(l=ar.get(f=i,"style"),qi.setAll(f,{position:"absolute",top:"0px"}),ar.set(f,Kp,"0px"),ar.set(f,Xp,"top"),{restore:function(){ar.set(f,"style",l||""),ar.remove(f,Kp),ar.remove(f,Xp)}}),g=Ji(i),p=Ji(u),h=th(o,g,p),v=(t=g,a=h,s=ar.get(c=o,"style"),Ud.register(c),qi.setAll(c,{position:"absolute",height:a+"px",width:"100%",top:t+"px"}),ar.set(c,Kp,t+"px"),ar.set(c,Yp,"true"),ar.set(c,Xp,"top"),{restore:function(){Ud.deregister(c),ar.set(c,"style",s||""),ar.remove(c,Kp),ar.remove(c,Yp),ar.remove(c,Xp)}}),y=(e=ar.get(n=u,"style"),qi.setAll(n,{position:"absolute",bottom:"0px"}),ar.set(n,Kp,"0px"),ar.set(n,Xp,"bottom"),{restore:function(){ar.set(n,"style",e||""),ar.remove(n,Kp),ar.remove(n,Xp)}}),b=!0,w=function(){var n=d.innerHeight;return Tm(o,Jp)<n},x=function(){if(b){var n=Ji(i),e=Ji(u),t=th(o,n,e);ar.set(o,Kp,n+"px"),qi.set(o,"height",t+"px"),qi.set(u,"bottom",-(n+t+e)+"px"),qp(r,o,u)}};return qp(r,o,u),{setViewportOffset:function(n){ar.set(o,Kp,n+"px"),x()},isExpanding:w,isShrinking:O.not(w),refresh:x,restore:function(){b=!1,m.restore(),v.restore(),y.restore()}}},ih=Qp,uh=Pp(),ah="data-"+Fi.resolve("last-scroll-top"),ch=function(n){var e=qi.getRaw(n,"top").getOr(0);return parseInt(e,10)},sh=function(n){return parseInt(n.dom().scrollTop,10)},fh=function(n,e){var t=e+ih(n)+"px";qi.set(n,"top",t)},lh=function(t,o,r){return zp.nu(function(n){var e=O.curry(sh,t);uh.animate(e,o,15,function(n){t.dom().scrollTop=n,qi.set(t,"top",ch(t)+15+"px")},function(){t.dom().scrollTop=o,qi.set(t,"top",r+"px"),n(o)},10)})},dh=function(r,i){return zp.nu(function(n){var e=O.curry(sh,r);ar.set(r,ah,e());var t=Math.abs(i-e()),o=Math.ceil(t/10);uh.animate(e,i,o,function(n,e){Tm(r,ah)!==r.dom().scrollTop?e(r.dom().scrollTop):(r.dom().scrollTop=n,ar.set(r,ah,n))},function(){r.dom().scrollTop=i,ar.set(r,ah,i),n(i)},10)})},mh=function(i,u){return zp.nu(function(n){var e=O.curry(ch,i),t=function(n){qi.set(i,"top",n+"px")},o=Math.abs(u-e()),r=Math.ceil(o/10);uh.animate(e,u,r,t,function(){t(u),n(u)},10)})},gh=function(e,t,o){var r=qe.owner(e).dom().defaultView;return zp.nu(function(n){fh(e,o),fh(t,o),r.scrollTo(0,o),n(o)})},ph=function(n,e,t,o,r){var i=$p(e,t),u=O.curry(Bp,n);i<o||i<r?dh(e,e.dom().scrollTop-i+r).get(u):o<0&&dh(e,e.dom().scrollTop+o).get(u)},hh=function(u,n){return n(function(o){var r=[],i=0;0===u.length?o([]):wn.each(u,function(n,e){var t;n.get((t=e,function(n){r[t]=n,++i>=u.length&&o(r)}))})})},vh=function(n){return hh(n,zp.nu)},yh=vh,bh=function(n,c){return n.fold(function(n,e,t){return o=n,r=e,u=c+(i=t),qi.set(o,r,u+"px"),zp.pure(i);var o,r,i,u},function(n,e){return t=n,r=c+(o=e),i=qi.getRaw(t,"top").getOr(o),u=r-parseInt(i,10),a=t.dom().scrollTop+u,lh(t,a,r);var t,o,r,i,u,a})},wh=function(n,e){var t=oh(n),o=wn.map(t,function(n){return bh(n,e)});return yh(o)},xh=function(e,t,n,o,r,i){var u,a,c=(u=function(n){return gh(e,t,n)},a=Or(Vp.pure({})),{start:function(e){var n=Vp.nu(function(n){return u(e).get(n)});a.set(n)},idle:function(n){a.get().get(function(){n()})}}),s=Ag(function(){c.idle(function(){wh(n,o.pageYOffset).get(function(){var n;(n=rg(i),x.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>o.innerHeight+5||e<-5?x.some({top:O.constant(e),bottom:O.constant(e+n.height())}):x.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),c.start(0),r.refresh()})})},1e3),f=lm(ue.fromDom(o),"scroll",function(){o.pageYOffset<0||s.throttle()});return wh(n,o.pageYOffset).get(O.identity),{unbind:f.unbind}},Th=function(n){var t=n.cWin(),e=n.ceBody(),o=n.socket(),r=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),a=n.keyboardType(),c=n.outerWindow(),s=n.dropup(),f=rh(o,e,r,s),l=a(n.outerBody(),t,we.body(),u,r,i),d=pm(c,{onChange:O.noop,onReady:f.refresh});d.onAdjustment(function(){f.refresh()});var m=lm(ue.fromDom(c),"resize",function(){f.isExpanding()&&f.refresh()}),g=xh(r,o,n.outerBody(),c,f,t),p=function(t,e){var n=t.document,o=ue.fromTag("div");xr.add(o,Fi.resolve("unfocused-selections")),Xe.append(ue.fromDom(n.documentElement),o);var r=lm(o,"touchstart",function(n){n.prevent(),Rp(t,e),u()}),i=function(n){var e=ue.fromTag("span");return Yl(e,[Fi.resolve("layer-editor"),Fi.resolve("unfocused-selection")]),qi.setAll(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Ze.empty(o)};return{update:function(){u();var n=rg(t),e=wn.map(n,i);Je(o,e)},isActive:function(){return 0<qe.children(o).length},destroy:function(){r.unbind(),Ze.remove(o)},clear:u}}(t,u),h=function(){p.clear()};return{toEditing:function(){l.toEditing(),h()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:h,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){ph(t,o,s,n,e)},updateToolbarPadding:O.noop,setViewportOffset:function(n){f.setViewportOffset(n),mh(o,n).get(O.identity)},syncHeight:function(){qi.set(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:f.refresh,destroy:function(){f.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Mp(we.body(),Vr)}}},Sh=function(o,n){var r=Og(),i=xl(),u=xl(),a=wl(),c=wl();return{enter:function(){n.hide();var t=ue.fromDom(document);bg.getActiveApi(o.editor).each(function(n){i.set({socketHeight:qi.getRaw(o.socket,"height"),iframeHeight:qi.getRaw(n.frame(),"height"),outerScroll:document.body.scrollTop}),u.set({exclusives:Ug.exclusive(t,"."+Ud.scrollable())}),xr.add(o.container,Fi.resolve("fullscreen-maximized")),kg(o.container,n.body()),r.maximize(),qi.set(o.socket,"overflow","scroll"),qi.set(o.socket,"-webkit-overflow-scrolling","touch"),Nr(n.body());var e=Ee.immutableBag(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);a.set(Th(e({cWin:n.win(),ceBody:n.body(),socket:o.socket,toolstrip:o.toolstrip,toolbar:o.toolbar,dropup:o.dropup.element(),contentElement:n.frame(),cursor:O.noop,outerBody:o.body,outerWindow:o.win,keyboardType:Ip.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),a.run(function(n){n.syncHeight()}),c.set(Fp(n,a,o.toolstrip,o.socket,o.dropup))})},refreshStructure:function(){a.run(function(n){n.refreshStructure()})},exit:function(){r.restore(),c.clear(),a.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){qi.set(o.socket,"height",n)}),n.iframeHeight.each(function(n){qi.set(o.editor.getFrame(),"height",n)}),document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),xr.remove(o.container,Fi.resolve("fullscreen-maximized")),Cg(),Ud.deregister(o.toolbar),qi.remove(o.socket,"overflow"),qi.remove(o.socket,"-webkit-overflow-scrolling"),Vr(o.editor.getFrame()),bg.getActiveApi(o.editor).each(function(n){n.clearSelection()})}}},kh=function(n){var e=to("Getting IosWebapp schema",Bg,n);qi.set(e.toolstrip,"width","100%"),qi.set(e.container,"position","relative");var t=ad(Mg(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var o=Sh(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:O.noop}},Ch=tinymce.util.Tools.resolve("tinymce.EditorManager"),Oh=function(n){var e=Et(n.settings,"skin_url").fold(function(){return Ch.baseURL+"/skins/lightgray"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},Eh=function(n,e,t){n.system().broadcastOn([Wr.formatChanged()],{command:e,state:t})},Dh=function(o,n){var e=M.keys(n.formatter.get());wn.each(e,function(e){n.formatter.formatChanged(e,function(n){Eh(o,e,n)})}),wn.each(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){Eh(o,t,n)})})},Ah=(O.constant(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Mh=O.constant("toReading"),Bh=O.constant("toEditing");Lr.add("mobile",function(C){return{getNotificationManagerImpl:function(){return{open:O.identity,close:O.noop,reposition:O.noop,getArgs:O.identity}},renderUI:function(n){var e=Oh(C);0==(!1===C.settings.skin)?(C.contentCSS.push(e.content),zr.DOM.styleSheetLoader.load(e.ui,Ah(C))):Ah(C)();var t,o,r,i,u,a,c,s,f,l,d,m,g,p,h=function(){C.fire("scrollIntoView")},v=ue.fromTag("div"),y=Ln.detect().os.isAndroid()?(s=h,f=Ap({classes:[Fi.resolve("android-container")]}),l=Gg(),d=wl(),m=_g(d),g=Kg(),p=lp(O.noop,s),f.add(l.wrapper()),f.add(g),f.add(p.component()),{system:O.constant(f),element:f.element,init:function(n){d.set(Rg(n))},exit:function(){d.run(function(n){n.exit(),Dd.remove(g,m)})},setToolbarGroups:function(n){var e=l.createGroups(n);l.setGroups(e)},setContextToolbar:function(n){var e=l.createGroups(n);l.setContextToolbar(e)},focusToolbar:function(){l.focus()},restoreToolbar:function(){l.restoreToolbar()},updateMode:function(n){Xg(g,m,n,f.root())},socket:O.constant(g),dropup:O.constant(p)}):(t=h,o=Ap({classes:[Fi.resolve("ios-container")]}),r=Gg(),i=wl(),u=_g(i),a=Kg(),c=lp(function(){i.run(function(n){n.refreshStructure()})},t),o.add(r.wrapper()),o.add(a),o.add(c.component()),{system:O.constant(o),element:o.element,init:function(n){i.set(kh(n))},exit:function(){i.run(function(n){Dd.remove(a,u),n.exit()})},setToolbarGroups:function(n){var e=r.createGroups(n);r.setGroups(e)},setContextToolbar:function(n){var e=r.createGroups(n);r.setContextToolbar(e)},focusToolbar:function(){r.focus()},restoreToolbar:function(){r.restoreToolbar()},updateMode:function(n){Xg(a,u,n,o.root())},socket:O.constant(a),dropup:O.constant(c)}),b=ue.fromDom(n.targetNode);Xe.after(b,v),function(n,e){Xe.append(n,e.element());var t=qe.children(e.element());wn.each(t,function(n){e.getByDom(n).each(et)})}(v,y.system());var w=n.targetNode.ownerDocument.defaultView,x=pm(w,{onChange:function(){y.system().broadcastOn([Wr.orientationChanged()],{width:hm(w)})},onReady:O.noop}),T=function(n,e,t,o){!1===o&&C.selection.collapse();var r=S(n,e,t);y.setToolbarGroups(!0===o?r.readOnly:r.main),C.setMode(!0===o?"readonly":"design"),C.fire(!0===o?Mh():Bh()),y.updateMode(o)},S=function(n,e,t){var o=n.get(),r={readOnly:o.backToMask.concat(e.get()),main:o.backToMask.concat(t.get())};return r},k=function(n,e){return C.on(n,e),{unbind:function(){C.off(n)}}};return C.on("init",function(){y.init({editor:{getFrame:function(){return ue.fromDom(C.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:O.noop}},onToReading:function(n){return k(Mh(),n)},onToEditing:function(n){return k(Bh(),n)},onScrollToCursor:function(e){return C.on("scrollIntoView",function(n){e(n)}),{unbind:function(){C.off("scrollIntoView"),x.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=ue.fromDom(C.editorContainer.querySelector("."+Fi.resolve("toolbar")));(n=e,jr(n).bind(function(n){return y.system().getByDom(n).toOption()})).each(te),y.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===ve.name(e)?(C.selection.select(e.dom()),n.kill()):"a"===ve.name(e)&&y.system().getByDom(ue.fromDom(C.editorContainer)).each(function(n){Cr.isAlpha(n)&&Pr(e.dom())})}},container:ue.fromDom(C.editorContainer),socket:ue.fromDom(C.contentAreaContainer),toolstrip:ue.fromDom(C.editorContainer.querySelector("."+Fi.resolve("toolstrip"))),toolbar:ue.fromDom(C.editorContainer.querySelector("."+Fi.resolve("toolbar"))),dropup:y.dropup(),alloy:y.system(),translate:O.noop,setReadOnly:function(n){T(c,a,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){y.dropup().disappear(function(){y.system().broadcastOn([Wr.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[ps.forToolbar("back",function(){C.selection.collapse(),y.exit()},{})]},e={label:"Back to read only",scrollable:!1,items:[ps.forToolbar("readonly-back",function(){T(c,a,u,!0)},{})]},o=om(y,C),r=rm(C.settings,o),i={label:"The extra group",scrollable:!1,items:[]},u=Or([{label:"the action group",scrollable:!0,items:r},i]),a=Or([{label:"The read only mode group",scrollable:!0,items:[]},i]),c=Or({backToMask:[n],backToReadOnly:[e]});Dh(y,C)}),{iframeContainer:y.socket().element().dom(),editorContainer:y.element().dom()}}}})}();
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ *
7
+ * Version: 5.0.2 (2019-03-05)
8
+ */
9
+ !function(n,v){"use strict";var y=function(){return(y=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function c(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&(t[r[o]]=n[r[o]])}return t}var x=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},p=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},h=function(n){return function(){return n}},b=function(n){return n};function l(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var e,t,r,o,i,u,a,S=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},f=function(n){return function(){throw new Error(n)}},s=function(n){return n()},d=h(!1),m=h(!0),g=d,w=m,O=function(){return T},T=(o={fold:function(n,e){return n()},is:g,isSome:g,isNone:w,getOr:r=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:t,map:O,ap:O,each:function(){},bind:O,flatten:O,exists:g,forall:w,filter:O,equals:e=function(n){return n.isNone()},equals_:e,toArray:function(){return[]},toString:h("none()")},Object.freeze&&Object.freeze(o),o),k=function(t){var n=function(){return t},e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:w,isNone:g,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return k(n(t))},ap:function(n){return n.fold(O,function(n){return k(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:T},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(g,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},E={some:k,none:O,from:function(n){return null===n||n===undefined?T:k(n)}},C=Object.keys,D=Object.hasOwnProperty,M=function(n,e){for(var t=C(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i,n)}},A=function(n,r){return I(n,function(n,e,t){return{k:e,v:r(n,e,t)}})},I=function(r,o){var i={};return M(r,function(n,e){var t=o(n,e,r);i[t.k]=t.v}),i},B=function(n,t){var r=[];return M(n,function(n,e){r.push(t(n,e))}),r},R=function(n,e){return D.call(n,e)},F=h("touchstart"),V=h("touchmove"),N=h("touchend"),H=h("mousedown"),j=h("mousemove"),z=h("mouseup"),L=h("mouseover"),P=h("keydown"),U=h("keyup"),G=h("input"),$=h("change"),W=h("click"),_=h("transitionend"),q=h("selectstart"),X=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},Y=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return J(r(1),r(2))},K=function(){return J(0,0)},J=function(n,e){return{major:n,minor:e}},Q={nu:J,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?K():Y(n,t)},unknown:K},Z="Edge",nn="Chrome",en="Opera",tn="Firefox",rn=function(n,e){return function(){return e===n}},on=function(n){var e=n.current;return{current:e,version:n.version,isEdge:rn(Z,e),isChrome:rn(nn,e),isIE:rn("IE",e),isOpera:rn(en,e),isFirefox:rn(tn,e),isSafari:rn("Safari",e)}},un={unknown:function(){return on({current:undefined,version:Q.unknown()})},nu:on,edge:h(Z),chrome:h(nn),ie:h("IE"),opera:h(en),firefox:h(tn),safari:h("Safari")},an="Windows",cn="Android",fn="Solaris",sn="FreeBSD",ln=function(n,e){return function(){return e===n}},dn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:ln(an,e),isiOS:ln("iOS",e),isAndroid:ln(cn,e),isOSX:ln("OSX",e),isLinux:ln("Linux",e),isSolaris:ln(fn,e),isFreeBSD:ln(sn,e)}},mn={unknown:function(){return dn({current:undefined,version:Q.unknown()})},nu:dn,windows:h(an),ios:h("iOS"),android:h(cn),linux:h("Linux"),osx:h("OSX"),solaris:h(fn),freebsd:h(sn)},gn=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},pn=gn("string"),vn=gn("object"),hn=gn("array"),bn=gn("boolean"),yn=gn("function"),xn=gn("number"),wn=(i=Array.prototype.indexOf)===undefined?function(n,e){return In(n,e)}:function(n,e){return i.call(n,e)},Sn=function(n,e){return-1<wn(n,e)},On=function(n,e){return An(n,e).isSome()},Tn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o,n)}return r},kn=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t,n)},En=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r,n)&&t.push(i)}return t},Cn=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t,n)}(n,function(n){t=e(t,n)}),t},Dn=function(n,e,t){return kn(n,function(n){t=e(t,n)}),t},Mn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t,n))return E.some(o)}return E.none()},An=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t,n))return E.some(t);return E.none()},In=function(n,e){for(var t=0,r=n.length;t<r;++t)if(n[t]===e)return t;return-1},Bn=Array.prototype.push,Rn=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!Array.prototype.isPrototypeOf(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);Bn.apply(e,n[t])}return e},Fn=function(n,e){var t=Tn(n,e);return Rn(t)},Vn=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t,n))return!1;return!0},Nn=Array.prototype.slice,Hn=function(n){var e=Nn.call(n,0);return e.reverse(),e},jn=function(n){return[n]},zn=(yn(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return Mn(n,function(n){return n.search(t)})}),Ln=function(n,t){return zn(n,t).map(function(n){var e=Q.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Pn=function(n,t){return zn(n,t).map(function(n){var e=Q.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Un=function(n,e){return-1!==n.indexOf(e)},Gn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$n=function(e){return function(n){return Un(n,e)}},Wn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Un(n,"edge/")&&Un(n,"chrome")&&Un(n,"safari")&&Un(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Gn],search:function(n){return Un(n,"chrome")&&!Un(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Un(n,"msie")||Un(n,"trident")}},{name:"Opera",versionRegexes:[Gn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$n("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$n("firefox")},{name:"Safari",versionRegexes:[Gn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Un(n,"safari")||Un(n,"mobile/"))&&Un(n,"applewebkit")}}],_n=[{name:"Windows",search:$n("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Un(n,"iphone")||Un(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$n("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$n("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$n("linux"),versionRegexes:[]},{name:"Solaris",search:$n("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$n("freebsd"),versionRegexes:[]}],qn={browsers:h(Wn),oses:h(_n)},Xn=function(n){var e,t,r,o,i,u,a,c,f,s,l,d=qn.browsers(),m=qn.oses(),g=Ln(d,n).fold(un.unknown,un.nu),p=Pn(m,n).fold(mn.unknown,mn.nu);return{browser:g,os:p,deviceType:(t=g,r=n,o=(e=p).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=o||u||a&&!0===/mobile/i.test(r),f=e.isiOS()||e.isAndroid(),s=f&&!c,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:h(o),isiPhone:h(i),isTablet:h(c),isPhone:h(s),isTouch:h(f),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(l)})}},Yn={detect:X(function(){var n=v.navigator.userAgent;return Xn(n)})},Kn={tap:h("alloy.tap")},Jn=h("alloy.focus"),Qn=h("alloy.blur.post"),Zn=h("alloy.paste.post"),ne=h("alloy.receive"),ee=h("alloy.execute"),te=h("alloy.focus.item"),re=Kn.tap,oe=Yn.detect().deviceType.isTouch()?Kn.tap:W,ie=h("alloy.longpress"),ue=h("alloy.system.init"),ae=h("alloy.system.attached"),ce=h("alloy.system.detached"),fe=h("alloy.focusmanager.shifted"),se=h("alloy.highlight"),le=h("alloy.dehighlight"),de=function(n,e){ve(n,n.element(),e,{})},me=function(n,e,t){ve(n,n.element(),e,t)},ge=function(n){de(n,ee())},pe=function(n,e,t){ve(n,e,t,{})},ve=function(n,e,t,r){var o=y({target:e},r);n.getSystem().triggerEvent(t,e,A(o,h))},he=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:h(n)}},be={fromHtml:function(n,e){var t=(e||v.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw v.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return he(t.childNodes[0])},fromTag:function(n,e){var t=(e||v.document).createElement(n);return he(t)},fromText:function(n,e){var t=(e||v.document).createTextNode(n);return he(t)},fromDom:he,fromPoint:function(n,e,t){var r=n.dom();return E.from(r.elementFromPoint(e,t)).map(he)}},ye=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE),xe=(v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),we=v.Node.TEXT_NODE,Se=(v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,function(n){return n.dom().nodeName.toLowerCase()}),Oe=function(e){return function(n){return n.dom().nodeType===e}},Te=Oe(xe),ke=Oe(we),Ee=function(n){var e=ke(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},Ce=X(function(){return De(be.fromDom(v.document))}),De=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return be.fromDom(e)},Me=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return kn(e,function(n,e){r[n]=h(t[e])}),r}},Ae=function(n){return n.slice(0).sort()},Ie=function(e,n){if(!hn(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");kn(n,function(n){if(!pn(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},Be=function(o,i){var t,u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Ie("required",o),Ie("optional",i),t=Ae(u),Mn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}),function(e){var t=C(e);Vn(o,function(n){return Sn(t,n)})||function(n,e){throw new Error("All required keys ("+Ae(n).join(", ")+") were not specified. Specified keys were: "+Ae(e).join(", ")+".")}(o,t);var n=En(t,function(n){return!Sn(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+Ae(n).join(", "))}(n);var r={};return kn(o,function(n){r[n]=h(e[n])}),kn(i,function(n){r[n]=h(Object.prototype.hasOwnProperty.call(e,n)?E.some(e[n]):E.none())}),r}},Re="undefined"!=typeof window?window:Function("return this;")(),Fe=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:Re,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},Ve={getOrDie:function(n,e){var t=Fe(n,e);if(t===undefined||null===t)throw n+" not available on this browser";return t}},Ne=xe,He=ye,je=function(n,e){var t=n.dom();if(t.nodeType!==Ne)return!1;if(t.matches!==undefined)return t.matches(e);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(e);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(e);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ze=function(n){return n.nodeType!==Ne&&n.nodeType!==He||0===n.childElementCount},Le=function(n,e){var t=e===undefined?v.document:e.dom();return ze(t)?[]:Tn(t.querySelectorAll(n),be.fromDom)},Pe=function(n,e){var t=e===undefined?v.document:e.dom();return ze(t)?E.none():E.from(t.querySelector(n)).map(be.fromDom)},Ue=function(n,e){return n.dom()===e.dom()},Ge=(Yn.detect().browser.isIE(),function(n){return be.fromDom(n.dom().ownerDocument)}),$e=function(n){var e=n.dom();return E.from(e.parentNode).map(be.fromDom)},We=function(n){var e=n.dom();return Tn(e.childNodes,be.fromDom)},_e=function(n,e){var t=n.dom().childNodes;return E.from(t[e]).map(be.fromDom)},qe=(Me("element","offset"),function(e,t){$e(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),Xe=function(n,e){var t;(t=n.dom(),E.from(t.nextSibling).map(be.fromDom)).fold(function(){$e(n).each(function(n){Ke(n,e)})},function(n){qe(n,e)})},Ye=function(e,t){_e(e,0).fold(function(){Ke(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},Ke=function(n,e){n.dom().appendChild(e.dom())},Je=function(e,n){kn(n,function(n){Ke(e,n)})},Qe=function(n){n.dom().textContent="",kn(We(n),function(n){Ze(n)})},Ze=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},nt=function(n){de(n,ce());var e=n.components();kn(e,nt)},et=function(n){var e=n.components();kn(e,et),de(n,ae())},tt=function(n,e){rt(n,e,Ke)},rt=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),Ee(n.element())&&et(e),n.syncComponents()},ot=function(n){nt(n),Ze(n.element()),n.getSystem().removeFromWorld(n)},it=function(e){var n=$e(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(E.none,E.some)});ot(e),n.each(function(n){n.syncComponents()})},ut=function(n,e,t){t(n,e.element());var r=We(e.element());kn(r,function(n){e.getByDom(n).each(et)})},at=function(t){return{is:function(n){return t===n},isValue:m,isError:d,getOr:h(t),getOrThunk:h(t),getOrDie:h(t),or:function(n){return at(t)},orThunk:function(n){return at(t)},fold:function(n,e){return e(t)},map:function(n){return at(n(t))},mapError:function(n){return at(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return E.some(t)}}},ct=function(t){return{is:d,isValue:d,isError:m,getOr:b,getOrThunk:function(n){return n()},getOrDie:function(){return f(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return ct(t)},mapError:function(n){return ct(n(t))},each:x,bind:function(n){return ct(t)},exists:d,forall:m,toOption:E.none}},ft={value:at,error:ct},st=function(u){if(!hn(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],t={};return kn(u,function(n,r){var e=C(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!hn(i))throw new Error("case arguments must be an array");a.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=C(n);if(a.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+e.join(","));if(!Vn(a,function(n){return Sn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+a.join(", "));return n[o].apply(null,t)},log:function(n){console.log(n,{constructors:a,constructor:o,params:t})}}}}),t},lt=Object.prototype.hasOwnProperty,dt=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)lt.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},mt=dt(function(n,e){return vn(n)&&vn(e)?mt(n,e):e}),gt=dt(function(n,e){return e}),pt=st([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),vt=function(n){return pt.defaultedThunk(h(n))},ht=pt.strict,bt=pt.asOption,yt=pt.defaultedThunk,xt=(pt.asDefaultedOptionThunk,pt.mergeWithThunk),wt=function(e){return function(n){return R(n,e)?E.from(n[e]):E.none()}},St=function(n,e){return wt(e)(n)},Ot=function(n,e){var t={};return t[n]=e,t},Tt=(st([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return wt(n)}),kt=function(n,e){return t=n,r=e,function(n){return R(n,t)?n[t]:r};var t,r},Et=function(n,e){return St(n,e)},Ct=function(n,e){return Ot(n,e)},Dt=function(n){return e={},kn(n,function(n){e[n.key]=n.value}),e;var e},Mt=function(n,e){var t,r,o,i,u,a=(t=[],r=[],kn(n,function(n){n.fold(function(n){t.push(n)},function(n){r.push(n)})}),{errors:t,values:r});return 0<a.errors.length?(u=a.errors,p(ft.error,Rn)(u)):(i=e,0===(o=a.values).length?ft.value(i):ft.value(mt(i,gt.apply(undefined,o))))},At=function(n,e){return R(t=n,r=e)&&t[r]!==undefined&&null!==t[r];var t,r};(a=u||(u={}))[a.Error=0]="Error",a[a.Value=1]="Value";var It,Bt,Rt=function(n,e,t){return n.stype===u.Error?e(n.serror):t(n.svalue)},Ft=function(n){return{stype:u.Value,svalue:n}},Vt=function(n){return{stype:u.Error,serror:n}},Nt=function(n){return n.fold(Vt,Ft)},Ht=function(n){return Rt(n,ft.error,ft.value)},jt=Ft,zt=function(n){var e=[],t=[];return kn(n,function(n){Rt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t}},Lt=Vt,Pt=function(n,e){return n.stype===u.Value?e(n.svalue):n},Ut=function(n,e){return n.stype===u.Error?e(n.serror):n},Gt=function(n,e){return n.stype===u.Value?{stype:u.Value,svalue:e(n.svalue)}:n},$t=function(n,e){return n.stype===u.Error?{stype:u.Error,serror:e(n.serror)}:n},Wt=function(n){return p(Lt,Rn)(n)},_t=function(n,e){var t,r,o=zt(n);return 0<o.errors.length?Wt(o.errors):(t=o.values,r=e,0<t.length?jt(mt(r,gt.apply(undefined,t))):jt(r))},qt=function(n){var e=zt(n);return 0<e.errors.length?Wt(e.errors):jt(e.values)},Xt=st([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Yt=st([{field:["name","presence","type"]},{state:["name"]}]),Kt=function(){return Ve.getOrDie("JSON")},Jt=function(n,e,t){return Kt().stringify(n,e,t)},Qt=function(n){return vn(n)&&100<C(n).length?" removed due to size":Jt(n,null,2)},Zt=function(n,e){return Lt([{path:n,getErrorInfo:e}])},nr=st([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),er=function(t,r,o){return St(r,o).fold(function(){return n=o,e=r,Zt(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Qt(e)});var n,e},jt)},tr=function(n,e,t){var r=St(n,e).fold(function(){return t(n)},b);return jt(r)},rr=function(a,c,n,f){return n.fold(function(o,t,n,r){var i=function(n){var e=r.extract(a.concat([o]),f,n);return Gt(e,function(n){return Ot(t,f(n))})},u=function(n){return n.fold(function(){var n=Ot(t,f(E.none()));return jt(n)},function(n){var e=r.extract(a.concat([o]),f,n);return Gt(e,function(n){return Ot(t,f(E.some(n)))})})};return n.fold(function(){return Pt(er(a,c,o),i)},function(n){return Pt(tr(c,o,n),i)},function(){return Pt(jt(St(c,o)),u)},function(n){return Pt((t=n,r=St(e=c,o).map(function(n){return!0===n?t(e):n}),jt(r)),u);var e,t,r},function(n){var e=n(c),t=Gt(tr(c,o,h({})),function(n){return mt(e,n)});return Pt(t,i)})},function(n,e){var t=e(c);return jt(Ot(n,f(t)))})},or=function(r){return{extract:function(t,n,e){return Ut(r(e,n),function(n){return e=n,Zt(t,function(){return e});var e})},toString:function(){return"val"},toDsl:function(){return Xt.itemOf(r)}}},ir=function(n){var c=ur(n),f=Cn(n,function(e,n){return n.fold(function(n){return mt(e,Ct(n,!0))},h(e))},{});return{extract:function(n,e,t){var r,o,i,u=bn(t)?[]:(o=C(r=t),En(o,function(n){return At(r,n)})),a=En(u,function(n){return!At(f,n)});return 0===a.length?c.extract(n,e,t):(i=a,Zt(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},ur=function(a){return{extract:function(n,e,t){return r=n,o=t,i=e,u=Tn(a,function(n){return rr(r,o,n,i)}),_t(u,{});var r,o,i,u},toString:function(){return"obj{\n"+Tn(a,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Xt.objOf(Tn(a,function(n){return n.fold(function(n,e,t,r){return Yt.field(n,t,r)},function(n,e){return Yt.state(n)})}))}}},ar=function(t,i){var u=function(n,e){return(o=or(t),{extract:function(t,r,n){var e=Tn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return qt(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return Xt.arrOf(o)}}).extract(n,b,e);var o};return{extract:function(t,r,o){var n=C(o),e=u(t,n);return Pt(e,function(n){var e=Tn(n,function(n){return nr.field(n,n,ht(),i)});return ur(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return Xt.setOf(t,i)}}},cr=h(or(jt)),fr=nr.state,sr=nr.field,lr=function(t,e,r,o,i){return Et(o,i).fold(function(){return n=o,e=i,Zt(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Qt(n)});var n,e},function(n){return ur(n).extract(t.concat(["branch: "+i]),e,r)})},dr=function(o,i){return{extract:function(e,t,r){return Et(r,o).fold(function(){return n=o,Zt(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return lr(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+C(i)},toDsl:function(){return Xt.choiceOf(o,i)}}},mr=or(jt),gr=function(e){return or(function(n){return e(n).fold(Lt,jt)})},pr=function(e,n){return ar(function(n){return Nt(e(n))},n)},vr=function(n,e,t){return Ht((r=n,o=b,i=t,u=e.extract([r],o,i),$t(u,function(n){return{input:i,errors:n}})));var r,o,i,u},hr=function(n){return n.fold(function(n){throw new Error(yr(n))},b)},br=function(n,e,t){return hr(vr(n,e,t))},yr=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,Tn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Qt(n.input);var e,t},xr=function(n,e){return dr(n,e)},wr=h(mr),Sr=(It=yn,Bt="function",or(function(n){var e=typeof n;return It(n)?jt(n):Lt("Expected type: "+Bt+" but got: "+e)})),Or=function(n){return sr(n,n,ht(),cr())},Tr=function(n,e){return sr(n,n,ht(),e)},kr=function(n,e){return sr(n,n,ht(),ur(e))},Er=function(n){return sr(n,n,bt(),cr())},Cr=function(n,e){return sr(n,n,bt(),ur(e))},Dr=function(n,e){return sr(n,n,bt(),ir(e))},Mr=function(n,e){return sr(n,n,vt(e),cr())},Ar=function(n,e,t){return sr(n,n,vt(e),t)},Ir=function(n,e){return fr(n,e)},Br=function(n,e){return Ue(n.element(),e.event().target())},Rr=function(n){if(!At(n,"can")&&!At(n,"abort")&&!At(n,"run"))throw new Error("EventHandler defined by: "+Jt(n,null,2)+" does not have can, abort, or run!");return br("Extracting event.handler",ir([Mr("can",h(!0)),Mr("abort",h(!1)),Mr("run",x)]),n)},Fr=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Dn(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Dn(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return Rr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];kn(t,function(n){n.run.apply(undefined,e)})}})};function Vr(n,e,t,r,o){return n(t,r)?E.some(t):yn(o)&&o(t)?E.none():e(t,r,o)}var Nr,Hr,jr,zr=function(n,e,t){for(var r=n.dom(),o=yn(t)?t:h(!1);r.parentNode;){r=r.parentNode;var i=be.fromDom(r);if(e(i))return E.some(i);if(o(i))break}return E.none()},Lr=function(n,e,t){return Vr(function(n){return e(n)},zr,n,e,t)},Pr=function(n,r){var o=function(n){for(var e=0;e<n.childNodes.length;e++){if(r(be.fromDom(n.childNodes[e])))return E.some(be.fromDom(n.childNodes[e]));var t=o(n.childNodes[e]);if(t.isSome())return t}return E.none()};return o(n.dom())},Ur=function(n,e,t){return Lr(n,function(n){return e(n).isSome()},t).bind(e)},Gr=function(n){return Dt(n)},$r=function(n,e){return{key:n,value:Rr({abort:e})}},Wr=function(n,e){return{key:n,value:Rr({run:e})}},_r=function(n,e,t){return{key:n,value:Rr({run:function(n){e.apply(undefined,[n].concat(t))}})}},qr=function(n){return function(t){return{key:n,value:Rr({run:function(n,e){Br(n,e)&&t(n,e)}})}}},Xr=function(n,e,t){var u,r,o=e.partUids[t];return r=o,Wr(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},Yr=function(n){return Wr(n,function(n,e){e.cut()})},Kr=qr(ae()),Jr=qr(ce()),Qr=qr(ue()),Zr=(Nr=ee(),function(n){return Wr(Nr,n)}),no=function(n){return Tn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},eo=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:no(i)}},n},to=function(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}},ro=function(t,r,o){return Qr(function(n,e){o(n,t,r)})},oo=function(n,e,t,r,o,i){var u,a,c=n,f=Cr(e,[(u="config",a=n,sr(u,u,bt(),a))]);return ao(c,f,e,t,r,o,i)},io=function(o,i,u){var n,e,t,r,a,c;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:h(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,a=t.indexOf("("),c=t.substring(a+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:no(c.slice(0,1).concat(c.slice(3)))}},n},uo=function(n){return{key:n,value:undefined}},ao=function(t,n,r,o,e,i,u){var a=function(n){return At(n,r)?n[r]():E.none()},c=A(e,function(n,e){return io(r,n,e)}),f=A(i,function(n,e){return eo(n,e)}),s=y({},f,c,{revoke:l(uo,r),config:function(n){var e=br(r+"-config",t,n);return{key:r,value:{config:e,me:s,configAsRaw:X(function(){return br(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return a(n).bind(function(e){return Et(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(to({}))},name:function(){return r},handlers:function(n){return a(n).map(function(n){return kt("events",function(n,e){return{}})(o)(n.config,n.state)}).getOr({})}});return s},co={init:function(){return fo({readState:function(){return"No State required"}})}},fo=function(n){return n},so=function(n){return Dt(n)},lo=ir([Or("fields"),Or("name"),Mr("active",{}),Mr("apis",{}),Mr("state",co),Mr("extra",{})]),mo=function(n){var e,t,r,o,i,u,a,c,f=br("Creating behaviour: "+n.name,lo,n);return e=f.fields,t=f.name,r=f.active,o=f.apis,i=f.extra,u=f.state,a=ir(e),c=Cr(t,[Dr("config",e)]),ao(a,c,t,r,o,i,u)},go=ir([Or("branchKey"),Or("branches"),Or("name"),Mr("active",{}),Mr("apis",{}),Mr("state",co),Mr("extra",{})]),po=h(undefined),vo=function(n,e,t){if(!(pn(t)||bn(t)||xn(t)))throw v.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},ho=function(n,e,t){vo(n.dom(),e,t)},bo=function(n,e){var t=n.dom();M(e,function(n,e){vo(t,e,n)})},yo=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},xo=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},wo=function(n,e){n.dom().removeAttribute(e)},So=function(n,e){var t=yo(n,e);return t===undefined||""===t?[]:t.split(" ")},Oo=function(n){return n.dom().classList!==undefined},To=function(n,e){return o=e,i=So(t=n,r="class").concat([o]),ho(t,r,i.join(" ")),!0;var t,r,o,i},ko=function(n,e){return o=e,0<(i=En(So(t=n,r="class"),function(n){return n!==o})).length?ho(t,r,i.join(" ")):wo(t,r),!1;var t,r,o,i},Eo=function(n,e){Oo(n)?n.dom().classList.add(e):To(n,e)},Co=function(n){0===(Oo(n)?n.dom().classList:So(n,"class")).length&&wo(n,"class")},Do=function(n,e){Oo(n)?n.dom().classList.remove(e):ko(n,e),Co(n)},Mo=function(n,e){return Oo(n)&&n.dom().classList.contains(e)},Ao=function(n,e,t){Do(n,t),Eo(n,e)},Io=/* */Object.freeze({toAlpha:function(n,e,t){Ao(n.element(),e.alpha,e.omega)},toOmega:function(n,e,t){Ao(n.element(),e.omega,e.alpha)},isAlpha:function(n,e,t){return Mo(n.element(),e.alpha)},isOmega:function(n,e,t){return Mo(n.element(),e.omega)},clear:function(n,e,t){Do(n.element(),e.alpha),Do(n.element(),e.omega)}}),Bo=[Or("alpha"),Or("omega")],Ro=mo({fields:Bo,name:"swapping",apis:Io}),Fo=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return Fo(t())}}},Vo=function(n){n.dom().focus()},No=function(n){n.dom().blur()},Ho=function(n){var e=n!==undefined?n.dom():v.document;return E.from(e.activeElement).map(be.fromDom)},jo=function(e){return Ho(Ge(e)).filter(function(n){return e.dom().contains(n.dom())})},zo=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Lo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Po=function(n){var e=v.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=v.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,v.window,0,0,0,0,0,!1,!1,!1,!1,0,null),v.document.body.appendChild(e),e.dispatchEvent(t),v.document.body.removeChild(e)},Uo={formatChanged:h("formatChanged"),orientationChanged:h("orientationChanged"),dropupDismissed:h("dropupDismissed")},Go=function(n){return n.dom().innerHTML},$o=function(n,e){var t,r,o=Ge(n).dom(),i=be.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||v.document).createElement("div")).innerHTML=t,We(be.fromDom(r)));Je(i,u),Qe(n),Ke(n,i)},Wo=function(n){return e=n,t=!1,be.fromDom(e.dom().cloneNode(t));var e,t},_o=function(n){var e,t,r,o=Wo(n);return e=o,t=be.fromTag("div"),r=be.fromDom(e.dom().cloneNode(!0)),Ke(t,r),Go(t)},qo=function(n){return _o(n)},Xo=/* */Object.freeze({events:function(a){return Gr([Wr(ne(),function(o,i){var n,e,u=a.channels,t=C(u),r=(n=t,(e=i).universal()?n:En(n,function(n){return Sn(e.channels(),n)}));kn(r,function(n){var e=u[n],t=e.schema,r=br("channel["+n+"] data\nReceiver: "+qo(o.element()),t,i.data());e.onReceive(o,r)})})])}}),Yo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Ko=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return E.none()},Jo="unknown";(jr=Hr||(Hr={}))[jr.STOP=0]="STOP",jr[jr.NORMAL=1]="NORMAL",jr[jr.LOGGING=2]="LOGGING";var Qo=Fo({}),Zo=function(e,n,t){var r,o,i,u;switch(Et(Qo.get(),e).orThunk(function(){var n=C(Qo.get());return Ko(n,function(n){return-1<e.indexOf(n)?E.some(Qo.get()[n]):E.none()})}).getOr(Hr.NORMAL)){case Hr.NORMAL:return t(ti());case Hr.LOGGING:var a=(r=e,o=n,i=[],u=(new Date).getTime(),{logEventCut:function(n,e,t){i.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){i.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){i.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){i.push({outcome:"response",purpose:t,target:e})},write:function(){var n=(new Date).getTime();Sn(["mousemove","mouseover","mouseout",ue()],r)||v.console.log(r,{event:r,time:n-u,target:o.dom(),sequence:Tn(i,function(n){return Sn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+qo(n.target)+")":n.outcome})})}}),c=t(a);return a.write(),c;case Hr.STOP:return!0}},ni=["alloy/data/Fields","alloy/debugging/Debugging"],ei=function(n,e,t){return Zo(n,e,t)},ti=h({logEventCut:x,logEventStopped:x,logNoParent:x,logEventNoHandlers:x,logEventResponse:x,write:x}),ri=h([Or("menu"),Or("selectedMenu")]),oi=h([Or("item"),Or("selectedItem")]),ii=(h(ur(oi().concat(ri()))),h(ur(oi()))),ui=kr("initSize",[Or("numColumns"),Or("numRows")]),ai=function(n,e,t){return function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");Mn(e,function(e){return 0<e.indexOf("alloy")&&!On(ni,function(n){return-1<e.indexOf(n)})}).getOr(Jo)}}(),sr(e,e,t,gr(function(t){return ft.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})}))},ci=function(n){return ai(0,n,vt(x))},fi=function(n){return ai(0,n,vt(E.none))},si=function(n){return ai(0,n,ht())},li=function(n){return ai(0,n,ht())},di=function(n,e){return Ir(n,h(e))},mi=function(n){return Ir(n,b)},gi=h(ui),pi=[Tr("channels",pr(ft.value,ir([si("onReceive"),Mr("schema",wr())])))],vi=mo({fields:pi,name:"receiving",active:Xo}),hi=function(n,e,t){var r=e.aria;r.update(n,r,t.get())},bi=function(e,n,t){n.toggleClass.each(function(n){t.get()?Eo(e.element(),n):Do(e.element(),n)})},yi=function(n,e,t){Si(n,e,t,!t.get())},xi=function(n,e,t){t.set(!0),bi(n,e,t),hi(n,e,t)},wi=function(n,e,t){t.set(!1),bi(n,e,t),hi(n,e,t)},Si=function(n,e,t,r){(r?xi:wi)(n,e,t)},Oi=function(n,e,t){Si(n,e,t,e.selected)},Ti=/* */Object.freeze({onLoad:Oi,toggle:yi,isOn:function(n,e,t){return t.get()},on:xi,off:wi,set:Si}),ki=/* */Object.freeze({exhibit:function(n,e,t){return to({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=yi,Zr(function(n){o(n,t,r)})),u=ro(n,e,Oi);return Gr(Rn([n.toggleOnExecute?[i]:[],[u]]))}}),Ei=/* */Object.freeze({init:function(n){var e=Fo(!1);return{readState:function(){return e.get()},get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(!1)}}}}),Ci=function(n,e,t){ho(n.element(),"aria-expanded",t)},Di=[Mr("selected",!1),Er("toggleClass"),Mr("toggleOnExecute",!0),Ar("aria",{mode:"none"},xr("mode",{pressed:[Mr("syncWithExpanded",!1),di("update",function(n,e,t){ho(n.element(),"aria-pressed",t),e.syncWithExpanded&&Ci(n,e,t)})],checked:[di("update",function(n,e,t){ho(n.element(),"aria-checked",t)})],expanded:[di("update",Ci)],selected:[di("update",function(n,e,t){ho(n.element(),"aria-selected",t)})],none:[di("update",x)]}))],Mi=mo({fields:Di,name:"toggling",active:ki,apis:Ti,state:Ei}),Ai=function(t,r){return vi.config({channels:Ct(Uo.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},Ii=function(n){return vi.config({channels:Ct(Uo.orientationChanged(),{onReceive:n})})},Bi=function(n,e){return{key:n,value:{onReceive:e}}},Ri="tinymce-mobile",Fi={resolve:function(n){return Ri+"-"+n},prefix:h(Ri)},Vi=function(n,e){e.ignore||(Vo(n.element()),e.onFocus(n))},Ni=/* */Object.freeze({focus:Vi,blur:function(n,e){e.ignore||No(n.element())},isFocused:function(n){return e=n.element(),t=Ge(e).dom(),e.dom()===t.activeElement;var e,t}}),Hi=/* */Object.freeze({exhibit:function(n,e){var t=e.ignore?{}:{attributes:{tabindex:"-1"}};return to(t)},events:function(t){return Gr([Wr(Jn(),function(n,e){Vi(n,t),e.stop()})].concat(t.stopMousedown?[Wr(H(),function(n,e){e.event().prevent()})]:[]))}}),ji=[ci("onFocus"),Mr("stopMousedown",!1),Mr("ignore",!1)],zi=mo({fields:ji,name:"focusing",active:Hi,apis:Ni}),Li=function(n){return n.style!==undefined},Pi=function(n,e,t){if(!pn(t))throw v.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);Li(n)&&n.style.setProperty(e,t)},Ui=function(n,e,t){var r=n.dom();Pi(r,e,t)},Gi=function(n,e){var t=n.dom();M(e,function(n,e){Pi(t,e,n)})},$i=function(n,e){var t=n.dom(),r=v.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||Ee(n)?r:Wi(t,e);return null===o?undefined:o},Wi=function(n,e){return Li(n)?n.style.getPropertyValue(e):""},_i=function(n,e){var t=n.dom(),r=Wi(t,e);return E.from(r).filter(function(n){return 0<n.length})},qi=function(n,e){var t,r,o=n.dom();r=e,Li(t=o)&&t.style.removeProperty(r),xo(n,"style")&&""===yo(n,"style").replace(/^\s+|\s+$/g,"")&&wo(n,"style")},Xi=function(n){return n.dom().offsetWidth};function Yi(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=$i(n,r);return parseFloat(t)||0}return e},i=function(o,n){return Dn(n,function(n,e){var t=$i(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!xn(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();Li(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var Ki,Ji,Qi=Yi("height",function(n){var e=n.dom();return Ee(n)?e.getBoundingClientRect().height:e.offsetHeight}),Zi=function(n){return Qi.get(n)},nu=function(n,e,t){return En(function(n,e){for(var t=yn(e)?e:h(!1),r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=be.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},eu=function(n,e){return En($e(t=n).map(We).map(function(n){return En(n,function(n){return!Ue(t,n)})}).getOr([]),e);var t},tu=function(n,e){return Le(e,n)},ru=function(n){return Pe(n)},ou=function(n,e,t){return zr(n,function(n){return je(n,e)},t)},iu=function(n,e){return Pe(e,n)},uu=function(n,e,t){return Vr(je,ou,n,e,t)},au=function(n,e,t){var r=Hn(n.slice(0,e)),o=Hn(n.slice(e+1));return Mn(r.concat(o),t)},cu=function(n,e,t){var r=Hn(n.slice(0,e));return Mn(r,t)},fu=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return Mn(o.concat(r),t)},su=function(n,e,t){var r=n.slice(e+1);return Mn(r,t)},lu=function(t){return function(n){var e=n.raw();return Sn(t,e.which)}},du=function(n){return function(e){return Vn(n,function(n){return n(e)})}},mu=function(n){return!0===n.raw().shiftKey},gu=function(n){return!0===n.raw().ctrlKey},pu=S(mu),vu=function(n,e){return{matches:n,classification:e}},hu=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},bu=function(n,e,t){return n<=e?e:t<=n?t:n},yu=function(t,r,n,o){var e=tu(t.element(),"."+r.highlightClass);kn(e,function(e){On(o,function(n){return n.element()===e})||(Do(e,r.highlightClass),t.getSystem().getByDom(e).each(function(n){r.onDehighlight(t,n),de(n,le())}))})},xu=function(n,e,t,r){yu(n,e,0,[r]),wu(n,e,t,r)||(Eo(r.element(),e.highlightClass),e.onHighlight(n,r),de(r,se()))},wu=function(n,e,t,r){return Mo(r.element(),e.highlightClass)},Su=function(n,e,t,r){var o=tu(n.element(),"."+e.itemClass);return E.from(o[r]).fold(function(){return ft.error("No element found with index "+r)},n.getSystem().getByDom)},Ou=function(e,n,t){return iu(e.element(),"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},Tu=function(e,n,t){var r=tu(e.element(),"."+n.itemClass);return(0<r.length?E.some(r[r.length-1]):E.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},ku=function(t,e,n,r){var o=tu(t.element(),"."+e.itemClass);return An(o,function(n){return Mo(n,e.highlightClass)}).bind(function(n){var e=hu(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},Eu=function(e,n,t){var r=tu(e.element(),"."+n.itemClass);return Yo(Tn(r,function(n){return e.getSystem().getByDom(n).toOption()}))},Cu=/* */Object.freeze({dehighlightAll:function(n,e,t){return yu(n,e,0,[])},dehighlight:function(n,e,t,r){wu(n,e,t,r)&&(Do(r.element(),e.highlightClass),e.onDehighlight(n,r),de(r,le()))},highlight:xu,highlightFirst:function(e,t,r){Ou(e,t,r).each(function(n){xu(e,t,r,n)})},highlightLast:function(e,t,r){Tu(e,t,r).each(function(n){xu(e,t,r,n)})},highlightAt:function(e,t,r,n){Su(e,t,r,n).fold(function(n){throw new Error(n)},function(n){xu(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Eu(e,t,r);Mn(o,n).each(function(n){xu(e,t,r,n)})},isHighlighted:wu,getHighlighted:function(e,n,t){return iu(e.element(),"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:Ou,getLast:Tu,getPrevious:function(n,e,t){return ku(n,e,0,-1)},getNext:function(n,e,t){return ku(n,e,0,1)},getCandidates:Eu}),Du=[Or("highlightClass"),Or("itemClass"),ci("onHighlight"),ci("onDehighlight")],Mu=mo({fields:Du,name:"highlighting",apis:Cu}),Au=function(n,e,t){e.exists(function(e){return t.exists(function(n){return Ue(n,e)})})||me(n,fe(),{prevFocus:e,newFocus:t})},Iu=function(){var o=function(n){return jo(n.element())};return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element());var r=o(n);Au(n,t,r)}}};(Ji=Ki||(Ki={})).OnFocusMode="onFocus",Ji.OnEnterOrSpaceMode="onEnterOrSpace",Ji.OnApiMode="onApi";var Bu,Ru,Fu=function(n,e,t,r,a){var c=function(e,t,n,r,o){var i,u,a=n(e,t,r,o);return(i=a,u=t.event(),Mn(i,function(n){return n.matches(u)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([Mr("focusManager",Iu()),Ar("focusInside","onFocus",gr(function(n){return Sn(["onFocus","onEnterOrSpace","onApi"],n)?ft.value(n):ft.error("Invalid value for focusInside")})),di("handler",o),di("state",e),di("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var n=i.focusInside!==Ki.OnFocusMode?E.none():a(i).map(function(t){return Wr(Jn(),function(n,e){t(n,i,u),e.stop()})});return Gr(n.toArray().concat([Wr(P(),function(r,o){c(r,o,t,i,u).fold(function(){var e,t,n;e=r,t=o,n=lu([32].concat([13]))(t.event()),i.focusInside===Ki.OnEnterOrSpaceMode&&n&&Br(e,t)&&a(i).each(function(n){n(e,i,u),t.stop()})},function(n){o.stop()})}),Wr(U(),function(n,e){c(n,e,r,i,u).each(function(n){e.stop()})})]))}};return o},Vu=function(n){var e=[Er("onEscape"),Er("onEnter"),Mr("selector",'[data-alloy-tabstop="true"]'),Mr("firstTabstop",0),Mr("useTabstopAt",h(!0)),Er("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector.bind(function(n){return uu(e,n)}).getOr(e);return 0<Zi(t)},t=function(e,t){var n,r,o,i;(n=e,r=t,o=tu(n.element(),r.selector),i=En(o,function(n){return u(r,n)}),E.from(i[r.firstTabstop])).each(function(n){t.focusManager.set(e,n)})},a=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt(t);var e,t}).fold(function(){return r.cyclic?E.some(!0):E.none()},function(n){return r.focusManager.set(e,n),E.some(!0)})},i=function(e,n,t,r){var o,i,u=tu(e.element(),t.selector);return(o=e,i=t,i.focusManager.get(o).bind(function(n){return uu(n,i.selector)})).bind(function(n){return An(u,l(Ue,n)).bind(function(n){return a(e,u,n,t,r)})})},r=h([vu(du([mu,lu([9])]),function(n,e,t,r){var o=t.cyclic?au:cu;return i(n,0,t,o)}),vu(lu([9]),function(n,e,t,r){var o=t.cyclic?fu:su;return i(n,0,t,o)}),vu(lu([27]),function(e,t,n,r){return n.onEscape.bind(function(n){return n(e,t)})}),vu(du([pu,lu([13])]),function(e,t,n,r){return n.onEnter.bind(function(n){return n(e,t)})})]),o=h([]);return Fu(e,co.init,r,o,function(){return E.some(t)})},Nu=Vu(Ir("cyclic",h(!1))),Hu=Vu(Ir("cyclic",h(!0))),ju=function(n){return"input"===Se(n)&&"radio"!==yo(n,"type")||"textarea"===Se(n)},zu=function(n,e,t){return ju(t)&&lu([32])(e.event())?E.none():(pe(n,t,ee()),E.some(!0))},Lu=function(n,e){return E.some(!0)},Pu=[Mr("execute",zu),Mr("useSpace",!1),Mr("useEnter",!0),Mr("useControlEnter",!1),Mr("useDown",!1)],Uu=function(n,e,t){return t.execute(n,e,n.element())},Gu=Fu(Pu,co.init,function(n,e,t,r){var o=t.useSpace&&!ju(n.element())?[32]:[],i=t.useEnter?[13]:[],u=t.useDown?[40]:[],a=o.concat(i).concat(u);return[vu(lu(a),Uu)].concat(t.useControlEnter?[vu(du([gu,lu([13])]),Uu)]:[])},function(n,e,t,r){return t.useSpace&&!ju(n.element())?[vu(lu([32]),Lu)]:[]},function(){return E.none()}),$u=function(n){var t=Fo(E.none());return fo({readState:function(){return t.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set(E.some({numRows:h(n),numColumns:h(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},Wu=/* */Object.freeze({flatgrid:$u,init:function(n){return n.state(n)}}),_u=function(e,t){return function(n){return"rtl"===qu(n)?t:e}},qu=function(n){return"rtl"===$i(n,"direction")?"rtl":"ltr"},Xu=function(i){return function(n,e,t,r){var o=i(n.element());return Qu(o,n,e,t,r)}},Yu=function(n,e){var t=_u(n,e);return Xu(t)},Ku=function(n,e){var t=_u(e,n);return Xu(t)},Ju=function(o){return function(n,e,t,r){return Qu(o,n,e,t,r)}},Qu=function(e,t,n,r,o){return r.focusManager.get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager.set(t,n),!0})},Zu=Ju,na=Ju,ea=Ju,ta=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},ra=Be(["index","candidates"],[]),oa=function(n,e,t){return ia(n,e,t,ta)},ia=function(n,e,t,r){var o,i=l(Ue,e),u=tu(n,t),a=En(u,ta);return An(o=a,i).map(function(n){return ra({index:n,candidates:o})})},ua=function(n,e){return An(n,function(n){return Ue(e,n)})},aa=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?E.some(t[e]):E.none()})},ca=function(o,n,i,u,a){return aa(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=hu(e,a,0,t-1);return E.some({row:h(n),column:h(r)})})},fa=function(i,n,u,a,c){return aa(i,n,a,function(n,e){var t=hu(n,c,0,u-1),r=t===u-1?i.length-t*a:a,o=bu(e,0,r-1);return E.some({row:h(t),column:h(o)})})},sa=[Or("selector"),Mr("execute",zu),fi("onEscape"),Mr("captureTab",!1),gi()],la=function(e,t,n){iu(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})},da=function(o){return function(n,e,t,r){return oa(n,e,t.selector).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize.numRows),r.getNumColumns().getOr(t.initSize.numColumns))})}},ma=function(n,e,t,r){return t.captureTab?E.some(!0):E.none()},ga=da(function(n,e,t,r){return ca(n,e,t,r,-1)}),pa=da(function(n,e,t,r){return ca(n,e,t,r,1)}),va=da(function(n,e,t,r){return fa(n,e,t,r,-1)}),ha=da(function(n,e,t,r){return fa(n,e,t,r,1)}),ba=h([vu(lu([37]),Yu(ga,pa)),vu(lu([39]),Ku(ga,pa)),vu(lu([38]),Zu(va)),vu(lu([40]),na(ha)),vu(du([mu,lu([9])]),ma),vu(du([pu,lu([9])]),ma),vu(lu([27]),function(n,e,t,r){return t.onEscape(n,e)}),vu(lu([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager.get(o).bind(function(n){return uu(n,i.selector)})).bind(function(n){return r.execute(e,t,n)});var o,i})]),ya=h([vu(lu([32]),Lu)]),xa=Fu(sa,$u,ba,ya,function(){return E.some(la)}),wa=function(n,e,t,i){var u=function(n,e,t){var r,o=hu(e,i,0,t.length-1);return o===n?E.none():(r=t[o],"button"===Se(r)&&"disabled"===yo(r,"disabled")?u(n,o,t):E.from(t[o]))};return oa(n,t,e).bind(function(n){var e=n.index(),t=n.candidates();return u(e,e,t)})},Sa=[Or("selector"),Mr("getInitial",E.none),Mr("execute",zu),fi("onEscape"),Mr("executeOnMove",!1),Mr("allowVertical",!0)],Oa=function(e,t,r){return(n=e,o=r,o.focusManager.get(n).bind(function(n){return uu(n,o.selector)})).bind(function(n){return r.execute(e,t,n)});var n,o},Ta=function(e,t){t.getInitial(e).orThunk(function(){return iu(e.element(),t.selector)}).each(function(n){t.focusManager.set(e,n)})},ka=function(n,e,t){return wa(n,t.selector,e,-1)},Ea=function(n,e,t){return wa(n,t.selector,e,1)},Ca=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove?Oa(n,e,t):E.some(!0)})}},Da=function(n,e,t,r){return t.onEscape(n,e)},Ma=h([vu(lu([32]),Lu)]),Aa=Fu(Sa,co.init,function(n,e,t,r){var o=[37].concat(t.allowVertical?[38]:[]),i=[39].concat(t.allowVertical?[40]:[]);return[vu(lu(o),Ca(Yu(ka,Ea))),vu(lu(i),Ca(Ku(ka,Ea))),vu(lu([13]),Oa),vu(lu([32]),Oa),vu(lu([27]),Da)]},Ma,function(){return E.some(Ta)}),Ia=Be(["rowIndex","columnIndex","cell"],[]),Ba=function(n,e,t){return E.from(n[e]).bind(function(n){return E.from(n[t]).map(function(n){return Ia({rowIndex:e,columnIndex:t,cell:n})})})},Ra=function(n,e,t,r){var o=n[e].length,i=hu(t,r,0,o-1);return Ba(n,e,i)},Fa=function(n,e,t,r){var o=hu(t,r,0,n.length-1),i=n[o].length,u=bu(e,0,i-1);return Ba(n,o,u)},Va=function(n,e,t,r){var o=n[e].length,i=bu(t+r,0,o-1);return Ba(n,e,i)},Na=function(n,e,t,r){var o=bu(t+r,0,n.length-1),i=n[o].length,u=bu(e,0,i-1);return Ba(n,o,u)},Ha=[kr("selectors",[Or("row"),Or("cell")]),Mr("cycles",!0),Mr("previousSelector",E.none),Mr("execute",zu)],ja=function(e,t){t.previousSelector(e).orThunk(function(){var n=t.selectors;return iu(e.element(),n.cell)}).each(function(n){t.focusManager.set(e,n)})},za=function(n,e){return function(t,r,i){var u=i.cycles?n:e;return uu(r,i.selectors.row).bind(function(n){var e=tu(n,i.selectors.cell);return ua(e,r).bind(function(r){var o=tu(t,i.selectors.row);return ua(o,n).bind(function(n){var e,t=(e=i,Tn(o,function(n){return tu(n,e.selectors.cell)}));return u(t,n,r).map(function(n){return n.cell()})})})})}},La=za(function(n,e,t){return Ra(n,e,t,-1)},function(n,e,t){return Va(n,e,t,-1)}),Pa=za(function(n,e,t){return Ra(n,e,t,1)},function(n,e,t){return Va(n,e,t,1)}),Ua=za(function(n,e,t){return Fa(n,t,e,-1)},function(n,e,t){return Na(n,t,e,-1)}),Ga=za(function(n,e,t){return Fa(n,t,e,1)},function(n,e,t){return Na(n,t,e,1)}),$a=h([vu(lu([37]),Yu(La,Pa)),vu(lu([39]),Ku(La,Pa)),vu(lu([38]),Zu(Ua)),vu(lu([40]),na(Ga)),vu(lu([32].concat([13])),function(e,t,r){return jo(e.element()).bind(function(n){return r.execute(e,t,n)})})]),Wa=h([vu(lu([32]),Lu)]),_a=Fu(Ha,co.init,$a,Wa,function(){return E.some(ja)}),qa=[Or("selector"),Mr("execute",zu),Mr("moveOnTab",!1)],Xa=function(e,t,r){return r.focusManager.get(e).bind(function(n){return r.execute(e,t,n)})},Ya=function(e,t){iu(e.element(),t.selector).each(function(n){t.focusManager.set(e,n)})},Ka=function(n,e,t){return wa(n,t.selector,e,-1)},Ja=function(n,e,t){return wa(n,t.selector,e,1)},Qa=h([vu(lu([38]),ea(Ka)),vu(lu([40]),ea(Ja)),vu(du([mu,lu([9])]),function(n,e,t){return t.moveOnTab?ea(Ka)(n,e,t):E.none()}),vu(du([pu,lu([9])]),function(n,e,t){return t.moveOnTab?ea(Ja)(n,e,t):E.none()}),vu(lu([13]),Xa),vu(lu([32]),Xa)]),Za=h([vu(lu([32]),Lu)]),nc=Fu(qa,co.init,Qa,Za,function(){return E.some(Ya)}),ec=[fi("onSpace"),fi("onEnter"),fi("onShiftEnter"),fi("onLeft"),fi("onRight"),fi("onTab"),fi("onShiftTab"),fi("onUp"),fi("onDown"),fi("onEscape"),Mr("stopSpaceKeyup",!1),Er("focusIn")],tc=Fu(ec,co.init,function(n,e,t){return[vu(lu([32]),t.onSpace),vu(du([pu,lu([13])]),t.onEnter),vu(du([mu,lu([13])]),t.onShiftEnter),vu(du([mu,lu([9])]),t.onShiftTab),vu(du([pu,lu([9])]),t.onTab),vu(lu([38]),t.onUp),vu(lu([40]),t.onDown),vu(lu([37]),t.onLeft),vu(lu([39]),t.onRight),vu(lu([32]),t.onSpace),vu(lu([27]),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[vu(lu([32]),Lu)]:[]},function(n){return n.focusIn}),rc=Nu.schema(),oc=Hu.schema(),ic=Aa.schema(),uc=xa.schema(),ac=_a.schema(),cc=Gu.schema(),fc=nc.schema(),sc=tc.schema(),lc=(Ru=br("Creating behaviour: "+(Bu={branchKey:"mode",branches:/* */Object.freeze({acyclic:rc,cyclic:oc,flow:ic,flatgrid:uc,matrix:ac,execution:cc,menu:fc,special:sc}),name:"keying",active:{events:function(n,e){return n.handler.toEvents(n,e)}},apis:{focusIn:function(e,t,r){t.sendFocusIn(t).fold(function(){e.getSystem().triggerFocus(e.element(),e.element())},function(n){n(e,t,r)})},setGridSize:function(n,e,t,r,o){At(t,"setGridSize")?t.setGridSize(r,o):v.console.error("Layout does not support setGridSize")}},state:Wu}).name,go,Bu),oo(xr(Ru.branchKey,Ru.branches),Ru.name,Ru.active,Ru.apis,Ru.extra,Ru.state)),dc=function(r,n){return e=r,t={},o=Tn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,sr(e,e,bt(),or(function(n){return Lt("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([Ir("dump",b)]),sr(e,e,vt(t),ur(o));var e,t,o},mc=function(n){return n.dump},gc=function(n,e){return y({},n.dump,so(e))},pc=dc,vc=gc,hc="placeholder",bc=st([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),yc=function(n,e,t,r){return t.uiType===hc?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?bc.single(!0,h(i)):Et(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+C(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+Jt(i,null,2))},function(n){return n.replace()})):bc.single(!1,h(t));var o,i,u},xc=function(i,u,a,c){return yc(i,0,a,c).fold(function(n,e){var t=e(u,a.config,a.validated),r=Et(t,"components").getOr([]),o=Fn(r,function(n){return xc(i,u,n,c)});return[y({},t,{components:o})]},function(n,e){var t=e(u,a.config,a.validated);return a.validated.preprocess.getOr(b)(t)})},wc=function(e,t,n,r){var o,i,u,a=A(r,function(n,e){return r=n,o=!1,{name:h(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),c=(o=e,i=t,u=a,Fn(n,function(n){return xc(o,i,n,u)}));return M(a,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+Jt(t.components,null,2))}),c},Sc=bc.single,Oc=bc.multiple,Tc=h(hc),kc=0,Ec=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++kc+String(e)},Cc=st([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Dc=Mr("factory",{sketch:b}),Mc=Mr("schema",[]),Ac=Or("name"),Ic=sr("pname","pname",yt(function(n){return"<alloy."+Ec(n.name)+">"}),wr()),Bc=Ir("schema",function(){return[Er("preprocess")]}),Rc=Mr("defaults",h({})),Fc=Mr("overrides",h({})),Vc=ur([Dc,Mc,Ac,Ic,Rc,Fc]),Nc=ur([Dc,Mc,Ac,Ic,Rc,Fc]),Hc=ur([Dc,Bc,Ac,Or("unit"),Ic,Rc,Fc]),jc=function(n){var e=function(n){return n.name};return n.fold(e,e,e,e)},zc=function(t,r){return function(n){var e=br("Converting part type",r,n);return t(e)}},Lc=zc(Cc.required,Vc),Pc=zc(Cc.optional,Nc),Uc=zc(Cc.group,Hc),Gc=h("entirety"),$c=function(n,e,t,r){return mt(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))},Wc=function(o,n){var i={};return kn(n,function(n){var e;(e=n,e.fold(E.some,E.none,E.some,E.some)).each(function(t){var r=_c(o,t.pname);i[t.name]=function(n){var e=br("Part: "+t.name+" in "+o,ur(t.schema),n);return y({},r,{config:n,validated:e})}})}),i},_c=function(n,e){return{uiType:Tc(),owner:n,name:e}},qc=function(n,e,t){return r=e,i={},o={},kn(t,function(n){n.fold(function(r){i[r.pname]=Sc(!0,function(n,e,t){return r.factory.sketch($c(n,r,e,t))})},function(n){var e=r.parts[n.name];o[n.name]=h(n.factory.sketch($c(r,n,e[Gc()]),e))},function(r){i[r.pname]=Sc(!1,function(n,e,t){return r.factory.sketch($c(n,r,e,t))})},function(o){i[o.pname]=Oc(!0,function(e,n,t){var r=e[o.name];return Tn(r,function(n){return o.factory.sketch(mt(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:h(i),externals:h(o)};var r,i,o},Xc=function(n,e,t){return wc(E.some(n),e,e.components,t)},Yc=function(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOption()},Kc=function(n,e,t){return Yc(n,e,t).getOrDie("Could not find part: "+t)},Jc=function(e,n){var t=Tn(n,jc);return Dt(Tn(t,function(n){return{key:n,value:e+"-"+n}}))},Qc=function(e){return sr("partUids","partUids",xt(function(n){return Jc(n.uid,e)}),wr())},Zc=Ec("alloy-premade"),nf=function(n){return Ct(Zc,n)},ef=function(r){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return r.apply(undefined,[n.getApis()].concat([n].concat(e)))},e=r.toString(),t=e.indexOf(")")+1,o=e.indexOf("("),i=e.substring(o+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:no(i.slice(1))}},n;var n,e,t,o,i},tf=h("alloy-id-"),rf=h("data-alloy-id"),of=tf(),uf=rf(),af=function(n,e){Object.defineProperty(n.dom(),uf,{value:e,writable:!0})},cf=function(n){var e=Te(n)?n.dom()[uf]:null;return E.from(e)},ff=function(n){return Ec(n)},sf=function(n,e,t,r,o){var i,u,a=(u=o,(0<(i=r).length?[kr("parts",i)]:[]).concat([Or("uid"),Mr("dom",{}),Mr("components",[]),mi("originalSpec"),Mr("debug.sketcher",{})]).concat(u));return br(n+" [SpecSchema]",ir(a.concat(e)),t)},lf=function(n,e,t,r,o){var i=df(o),u=Fn(t,function(n){return n.fold(E.none,E.some,E.none,E.none).map(function(n){return kr(n.name,n.schema.concat([mi(Gc())]))}).toArray()}),a=Qc(t),c=sf(n,e,i,u,[a]),f=qc(0,c,t);return r(c,Xc(n,c,f.internals()),i,f.externals())},df=function(n){return n.hasOwnProperty("uid")?n:y({},n,{uid:ff("uid")})},mf=ir([Or("name"),Or("factory"),Or("configFields"),Mr("apis",{}),Mr("extraApis",{})]),gf=ir([Or("name"),Or("factory"),Or("configFields"),Or("partFields"),Mr("apis",{}),Mr("extraApis",{})]),pf=function(n){var i=br("Sketcher for "+n.name,mf,n),e=A(i.apis,ef),t=A(i.extraApis,function(n,e){return eo(n,e)});return y({name:h(i.name),partFields:h([]),configFields:h(i.configFields),sketch:function(n){return e=i.name,t=i.configFields,r=i.factory,o=df(n),r(sf(e,t,o,[],[]),o);var e,t,r,o}},e,t)},vf=function(n){var e=br("Sketcher for "+n.name,gf,n),t=Wc(e.name,e.partFields),r=A(e.apis,ef),o=A(e.extraApis,function(n,e){return eo(n,e)});return y({name:h(e.name),partFields:h(e.partFields),configFields:h(e.configFields),sketch:function(n){return lf(e.name,e.configFields,e.partFields,e.factory,n)},parts:h(t)},r,o)},hf=pf({name:"Button",factory:function(n){var e,t,r,o=(e=n.action,t=function(n,e){e.stop(),ge(n)},r=Yn.detect().deviceType.isTouch()?[Wr(re(),t)]:[Wr(W(),t),Wr(H(),function(n,e){e.cut()})],Gr(Rn([e.map(function(t){return Wr(ee(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=n.dom.tag,u=function(e){return Et(n.dom,"attributes").bind(function(n){return Et(n,e)})};return{uid:n.uid,dom:n.dom,components:n.components,events:o,behaviours:vc(n.buttonBehaviours,[zi.config({}),lc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==i)return{role:u("role").getOr("button")};var n=u("type").getOr("button"),e=u("role").map(function(n){return{role:n}}).getOr({});return y({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[Mr("uid",undefined),Or("dom"),Mr("components",[]),pc("buttonBehaviours",[zi,lc]),Er("action"),Er("role"),Mr("eventOrder",{})]}),bf=mo({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return Gr([$r(q(),h(!0))])},exhibit:function(n,e){return to({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),yf=function(n){var e,t,r,o=be.fromHtml(n),i=We(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],Dn(t,function(n,e){var t;return"class"===e.name?n:y({},n,((t={})[e.name]=e.value,t))},{})),a=(r=o,Array.prototype.slice.call(r.dom().classList,0)),c=0===i.length?{}:{innerHtml:Go(o)};return y({tag:Se(o),classes:a,attributes:u},c)},xf=function(n){var e,o,t=(e=n,o={prefix:Fi.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return yf(t)},wf=function(n){return{dom:xf(n)}},Sf=function(n){return so([Mi.config({toggleClass:Fi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Ai(n,function(n,e){(e?Mi.on:Mi.off)(n)})])},Of=function(n,e){var t=e.ui.registry.getAll().icons;return E.from(t[n]).fold(function(){return xf('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>')},function(n){return xf('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+n+"</span>")})},Tf=function(n,e,t,r){return hf.sketch({dom:Of(n,r),action:e,buttonBehaviours:mt(so([bf.config({})]),t)})},kf={forToolbar:Tf,forToolbarCommand:function(n,e){return Tf(e,function(){n.execCommand(e)},{},n)},forToolbarStateAction:function(n,e,t,r){var o=Sf(t);return Tf(e,r,o,n)},forToolbarStateCommand:function(n,e){var t=Sf(e);return Tf(e,function(){n.execCommand(e)},t,n)},getToolbarIconButton:Of},Ef=Yn.detect().deviceType.isTouch(),Cf=Pc({schema:[Or("dom")],name:"label"}),Df=function(n){return Pc({name:n+"-edge",overrides:function(r){return r.model.manager.edgeActions[n].fold(function(){return{}},function(t){var n=Gr([_r(F(),t,[r])]),e=Gr([_r(H(),t,[r]),_r(j(),function(n,e){e.mouseIsDown.get()&&t(n,e)},[r])]);return{events:Ef?n:e}})}})},Mf=Df("top-left"),Af=Df("top"),If=Df("top-right"),Bf=Df("right"),Rf=Df("bottom-right"),Ff=Df("bottom"),Vf=Df("bottom-left"),Nf=[Cf,Df("left"),Bf,Af,Ff,Mf,If,Vf,Rf,Lc({name:"thumb",defaults:h({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Gr([Xr(F(),n,"spectrum"),Xr(V(),n,"spectrum"),Xr(N(),n,"spectrum"),Xr(H(),n,"spectrum"),Xr(j(),n,"spectrum"),Xr(z(),n,"spectrum")])}}}),Lc({schema:[Ir("mouseIsDown",function(){return Fo(!1)})],name:"spectrum",overrides:function(t){var r=t.model.manager,o=function(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})},n=Gr([Wr(F(),o),Wr(V(),o)]),e=Gr([Wr(H(),o),Wr(j(),function(n,e){t.mouseIsDown.get()&&o(n,e)})]);return{behaviours:so(Ef?[]:[lc.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),zi.config({})]),events:Ef?n:e}}})],Hf=function(n,e,t){e.store.manager.onLoad(n,e,t)},jf=function(n,e,t){e.store.manager.onUnload(n,e,t)},zf=/* */Object.freeze({onLoad:Hf,onUnload:jf,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),Lf=/* */Object.freeze({events:function(t,r){var n=t.resetOnDom?[Kr(function(n,e){Hf(n,t,r)}),Jr(function(n,e){jf(n,t,r)})]:[ro(t,r,Hf)];return Gr(n)}}),Pf=function(){var n=Fo(null);return fo({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},Uf=function(){var i=Fo({}),u=Fo({});return fo({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return Et(i.get(),n).orThunk(function(){return Et(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};kn(n,function(e){r[e.value]=e,Et(e,"meta").each(function(n){Et(n,"text").each(function(n){o[n]=e})})}),i.set(y({},e,r)),u.set(y({},t,o))},clear:function(){i.set({}),u.set({})}})},Gf=/* */Object.freeze({memory:Pf,dataset:Uf,manual:function(){return fo({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),$f=function(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)},Wf=[Er("initialValue"),Or("getFallbackEntry"),Or("getDataKey"),Or("setValue"),di("manager",{setValue:$f,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){$f(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Uf})],_f=[Or("getValue"),Mr("setValue",x),Er("initialValue"),di("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:x,state:co.init})],qf=[Er("initialValue"),di("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:Pf})],Xf=[Ar("store",{mode:"memory"},xr("mode",{memory:qf,manual:_f,dataset:Wf})),ci("onSetValue"),Mr("resetOnDom",!1)],Yf=mo({fields:Xf,name:"representing",active:Lf,apis:zf,extra:{setValueFrom:function(n,e){var t=Yf.getValue(e);Yf.setValue(n,t)}},state:Gf}),Kf=function(t,r){return{left:h(t),top:h(r),translate:function(n,e){return Kf(t+n,r+e)}}},Jf=Kf,Qf=Yn.detect().deviceType.isTouch(),Zf=h("slider.change.value"),ns=function(n){var e=n.event().raw();if(Qf){var t=e;return t.touches!==undefined&&1===t.touches.length?E.some(t.touches[0]).map(function(n){return Jf(n.clientX,n.clientY)}):E.none()}var r=e;return r.clientX!==undefined?E.some(r).map(function(n){return Jf(n.clientX,n.clientY)}):E.none()},es=function(n,e,t,r){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-r)},ts=function(n,e,t,r){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+r)},rs=function(n,e,t){return Math.max(e,Math.min(t,n))},os=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,f=n.hasMinEdge,s=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=f?e-1:e,p=s?t+1:t;if(o<l)return g;if(d<o)return p;var v,h,b,y,x,w,S,O=(x=o,w=l,S=d,Math.min(S,Math.max(x,w))-w),T=rs(O/m*r+e,g,p);return u&&e<=T&&T<=t?(v=T,h=e,b=t,y=i,a.fold(function(){var n=v-h,e=Math.round(n/y)*y;return rs(h+e,h-1,b+1)},function(n){var e=(v-n)%y,t=Math.round(e/y),r=Math.floor((v-n)/y),o=Math.floor((b-n)/y),i=n+Math.min(o,r+t)*y;return Math.max(n,i)})):c?Math.round(T):T},is=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,f=n.centerMinEdge,s=n.centerMaxEdge;return o<e?i?0:f:t<o?u?a:s:(o-e)/r*c},us=Yi("width",function(n){return n.dom().offsetWidth}),as=function(n,e){us.set(n,e)},cs=function(n){return us.get(n)},fs=function(n){return n.model.minX},ss=function(n){return n.model.minY},ls=function(n){return n.model.minX-1},ds=function(n){return n.model.minY-1},ms=function(n){return n.model.maxX},gs=function(n){return n.model.maxY},ps=function(n){return n.model.maxX+1},vs=function(n){return n.model.maxY+1},hs=function(n,e,t){return e(n)-t(n)},bs=function(n){return hs(n,ms,fs)},ys=function(n){return hs(n,gs,ss)},xs=function(n){return bs(n)/2},ws=function(n){return ys(n)/2},Ss=function(n){return n.stepSize},Os=function(n){return n.snapToGrid},Ts=function(n){return n.snapStart},ks=function(n){return n.rounded},Es=function(n,e){return n[e+"-edge"]!==undefined},Cs=function(n){return Es(n,"left")},Ds=function(n){return Es(n,"right")},Ms=function(n){return Es(n,"top")},As=function(n){return Es(n,"bottom")},Is=function(n){return n.model.value.get()},Bs=function(n){return{x:h(n)}},Rs=function(n){return{y:h(n)}},Fs=function(n,e){return{x:h(n),y:h(e)}},Vs=function(n,e){me(n,Zf(),{value:e})},Ns="left",Hs=function(n){return n.element().dom().getBoundingClientRect()},js=function(n,e){return n[e]},zs=function(n){var e=Hs(n);return js(e,Ns)},Ls=function(n){var e=Hs(n);return js(e,"right")},Ps=function(n){var e=Hs(n);return js(e,"top")},Us=function(n){var e=Hs(n);return js(e,"bottom")},Gs=function(n){var e=Hs(n);return js(e,"width")},$s=function(n){var e=Hs(n);return js(e,"height")},Ws=function(n,e,t){return(n+e)/2-t},_s=function(n,e){var t=Hs(n),r=Hs(e),o=js(t,Ns),i=js(t,"right"),u=js(r,Ns);return Ws(o,i,u)},qs=function(n,e){var t=Hs(n),r=Hs(e),o=js(t,"top"),i=js(t,"bottom"),u=js(r,"top");return Ws(o,i,u)},Xs=function(n,e){me(n,Zf(),{value:e})},Ys=function(n){return{x:h(n)}},Ks=function(n,e,t){var r={min:fs(e),max:ms(e),range:bs(e),value:t,step:Ss(e),snap:Os(e),snapStart:Ts(e),rounded:ks(e),hasMinEdge:Cs(e),hasMaxEdge:Ds(e),minBound:zs(n),maxBound:Ls(n),screenRange:Gs(n)};return os(r)},Js=function(u){return function(n,e){return(t=u,r=n,o=e,i=(0<t?ts:es)(Is(o).x(),fs(o),ms(o),Ss(o)),Xs(r,Ys(i)),E.some(i)).map(function(){return!0});var t,r,o,i}},Qs=function(n,e,t,r,o,i){var u,a,c,f,s,l,d,m,g,p=(a=i,c=t,f=r,s=o,l=Gs(u=e),d=f.bind(function(n){return E.some(_s(n,u))}).getOr(0),m=s.bind(function(n){return E.some(_s(n,u))}).getOr(l),g={min:fs(a),max:ms(a),range:bs(a),value:c,hasMinEdge:Cs(a),hasMaxEdge:Ds(a),minBound:zs(u),minOffset:0,maxBound:Ls(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},is(g));return zs(e)-zs(n)+p},Zs=Js(-1),nl=Js(1),el=E.none,tl=E.none,rl={"top-left":E.none(),top:E.none(),"top-right":E.none(),right:E.some(function(n,e){Vs(n,Bs(ps(e)))}),"bottom-right":E.none(),bottom:E.none(),"bottom-left":E.none(),left:E.some(function(n,e){Vs(n,Bs(ls(e)))})},ol=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ks(n,e,t),o=Ys(r);return Xs(n,o),r},setToMin:function(n,e){var t=fs(e);Xs(n,Ys(t))},setToMax:function(n,e){var t=ms(e);Xs(n,Ys(t))},findValueOfOffset:Ks,getValueFromEvent:function(n){return ns(n).map(function(n){return n.left()})},findPositionOfValue:Qs,setPositionFromValue:function(n,e,t,r){var o=Is(t),i=Qs(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=cs(e.element())/2;Ui(e.element(),"left",i-u+"px")},onLeft:Zs,onRight:nl,onUp:el,onDown:tl,edgeActions:rl}),il=function(n,e){me(n,Zf(),{value:e})},ul=function(n){return{y:h(n)}},al=function(n,e,t){var r={min:ss(e),max:gs(e),range:ys(e),value:t,step:Ss(e),snap:Os(e),snapStart:Ts(e),rounded:ks(e),hasMinEdge:Ms(e),hasMaxEdge:As(e),minBound:Ps(n),maxBound:Us(n),screenRange:$s(n)};return os(r)},cl=function(u){return function(n,e){return(t=u,r=n,o=e,i=(0<t?ts:es)(Is(o).y(),ss(o),gs(o),Ss(o)),il(r,ul(i)),E.some(i)).map(function(){return!0});var t,r,o,i}},fl=function(n,e,t,r,o,i){var u,a,c,f,s,l,d,m,g,p=(a=i,c=t,f=r,s=o,l=$s(u=e),d=f.bind(function(n){return E.some(qs(n,u))}).getOr(0),m=s.bind(function(n){return E.some(qs(n,u))}).getOr(l),g={min:ss(a),max:gs(a),range:ys(a),value:c,hasMinEdge:Ms(a),hasMaxEdge:As(a),minBound:Ps(u),minOffset:0,maxBound:Us(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},is(g));return Ps(e)-Ps(n)+p},sl=E.none,ll=E.none,dl=cl(-1),ml=cl(1),gl={"top-left":E.none(),top:E.some(function(n,e){Vs(n,Rs(ds(e)))}),"top-right":E.none(),right:E.none(),"bottom-right":E.none(),bottom:E.some(function(n,e){Vs(n,Rs(vs(e)))}),"bottom-left":E.none(),left:E.none()},pl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=al(n,e,t),o=ul(r);return il(n,o),r},setToMin:function(n,e){var t=ss(e);il(n,ul(t))},setToMax:function(n,e){var t=gs(e);il(n,ul(t))},findValueOfOffset:al,getValueFromEvent:function(n){return ns(n).map(function(n){return n.top()})},findPositionOfValue:fl,setPositionFromValue:function(n,e,t,r){var o=Is(t),i=fl(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=Zi(e.element())/2;Ui(e.element(),"top",i-u+"px")},onLeft:sl,onRight:ll,onUp:dl,onDown:ml,edgeActions:gl}),vl=function(n,e){me(n,Zf(),{value:e})},hl=function(n,e){return{x:h(n),y:h(e)}},bl=function(f,s){return function(n,e){return(t=f,r=s,o=n,i=e,u=0<t?ts:es,a=r?Is(i).x():u(Is(i).x(),fs(i),ms(i),Ss(i)),c=r?u(Is(i).y(),ss(i),gs(i),Ss(i)):Is(i).y(),vl(o,hl(a,c)),E.some(a)).map(function(){return!0});var t,r,o,i,u,a,c}},yl=bl(-1,!1),xl=bl(1,!1),wl=bl(-1,!0),Sl=bl(1,!0),Ol={"top-left":E.some(function(n,e){Vs(n,Fs(ls(e),ds(e)))}),top:E.some(function(n,e){Vs(n,Fs(xs(e),ds(e)))}),"top-right":E.some(function(n,e){Vs(n,Fs(ps(e),ds(e)))}),right:E.some(function(n,e){Vs(n,Fs(ps(e),ws(e)))}),"bottom-right":E.some(function(n,e){Vs(n,Fs(ps(e),vs(e)))}),bottom:E.some(function(n,e){Vs(n,Fs(xs(e),vs(e)))}),"bottom-left":E.some(function(n,e){Vs(n,Fs(ls(e),vs(e)))}),left:E.some(function(n,e){Vs(n,Fs(ls(e),ws(e)))})},Tl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ks(n,e,t.left()),o=al(n,e,t.top()),i=hl(r,o);return vl(n,i),i},setToMin:function(n,e){var t=fs(e),r=ss(e);vl(n,hl(t,r))},setToMax:function(n,e){var t=ms(e),r=gs(e);vl(n,hl(t,r))},getValueFromEvent:function(n){return ns(n)},setPositionFromValue:function(n,e,t,r){var o=Is(t),i=Qs(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=fl(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),a=cs(e.element())/2,c=Zi(e.element())/2;Ui(e.element(),"left",i-a+"px"),Ui(e.element(),"top",u-c+"px")},onLeft:yl,onRight:xl,onUp:wl,onDown:Sl,edgeActions:Ol}),kl=Yn.detect().deviceType.isTouch(),El=[Mr("stepSize",1),Mr("onChange",x),Mr("onChoose",x),Mr("onInit",x),Mr("onDragStart",x),Mr("onDragEnd",x),Mr("snapToGrid",!1),Mr("rounded",!0),Er("snapStart"),Tr("model",xr("mode",{x:[Mr("minX",0),Mr("maxX",100),Ir("value",function(n){return Fo(n.mode.minX)}),Or("getInitialValue"),di("manager",ol)],y:[Mr("minY",0),Mr("maxY",100),Ir("value",function(n){return Fo(n.mode.minY)}),Or("getInitialValue"),di("manager",pl)],xy:[Mr("minX",0),Mr("maxX",100),Mr("minY",0),Mr("maxY",100),Ir("value",function(n){return Fo({x:h(n.mode.minX),y:h(n.mode.minY)})}),Or("getInitialValue"),di("manager",Tl)]})),dc("sliderBehaviours",[lc,Yf])].concat(kl?[]:[Ir("mouseIsDown",function(){return Fo(!1)})]),Cl=Yn.detect().deviceType.isTouch(),Dl=vf({name:"Slider",configFields:El,partFields:Nf,factory:function(i,n,e,t){var u=function(n){return Kc(n,i,"thumb")},a=function(n){return Kc(n,i,"spectrum")},r=function(n){return Yc(n,i,"left-edge")},o=function(n){return Yc(n,i,"right-edge")},c=function(n){return Yc(n,i,"top-edge")},f=function(n){return Yc(n,i,"bottom-edge")},s=i.model,l=s.manager,d=function(n,e){l.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:c,getBottomEdge:f,getSpectrum:a})},m=function(n,e){s.value.set(e);var t=u(n);return d(n,t),i.onChange(n,t,e),E.some(!0)},g=[Wr(F(),function(n,e){i.onDragStart(n,u(n))}),Wr(N(),function(n,e){i.onDragEnd(n,u(n))})],p=[Wr(H(),function(n,e){e.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),Wr(z(),function(n,e){i.onDragEnd(n,u(n))})],v=Cl?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:gc(i.sliderBehaviours,Rn([Cl?[]:[lc.config({mode:"special",focusIn:function(n){return Yc(n,i,"spectrum").map(lc.focusIn).map(h(!0))}})],[Yf.config({store:{mode:"manual",getValue:function(n){return s.value.get()}}}),vi.config({channels:{"mouse.released":{onReceive:function(t,n){var e=i.mouseIsDown.get();i.mouseIsDown.set(!1),e&&Yc(t,i,"thumb").each(function(n){var e=s.value.get();i.onChoose(t,n,e)})}}}})]])),events:Gr([Wr(Zf(),function(n,e){m(n,e.event().value())}),Kr(function(n,e){var t=s.getInitialValue();s.value.set(t);var r=u(n);d(n,r);var o=a(n);i.onInit(n,r,o,s.value.get())})].concat(v)),apis:{resetToMin:function(n){l.setToMin(n,i)},resetToMax:function(n){l.setToMax(n,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Ml=function(e,t,r,n){return kf.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{},n)},Al=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Dl.sketch({dom:xf('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Dl.parts()["left-edge"](wf('<div class="${prefix}-hue-slider-black"></div>')),Dl.parts().spectrum({dom:xf('<div class="${prefix}-slider-gradient-container"></div>'),components:[wf('<div class="${prefix}-slider-gradient"></div>')],behaviours:so([Mi.config({toggleClass:Fi.resolve("thumb-active")})])}),Dl.parts()["right-edge"](wf('<div class="${prefix}-hue-slider-white"></div>')),Dl.parts().thumb({dom:xf('<div class="${prefix}-slider-thumb"></div>'),behaviours:so([Mi.config({toggleClass:Fi.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Ui(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){Mi.on(e)},onDragEnd:function(n,e){Mi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Ui(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:so([Ii(Dl.refresh)])}))];var o,i},Il=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Ml(n,"color-levels",function(){return Al(e)},r)},Bl=ir([Or("getInitialValue"),Or("onChange"),Or("category"),Or("sizes")]),Rl=function(n){var i=br("SizeSlider",Bl,n);return Dl.sketch({dom:{tag:"div",classes:[Fi.resolve("slider-"+i.category+"-size-container"),Fi.resolve("slider"),Fi.resolve("slider-size-container")]},onChange:function(n,e,t){var r,o=t.x();0<=(r=o)&&r<i.sizes.length&&i.onChange(o)},onDragStart:function(n,e){Mi.on(e)},onDragEnd:function(n,e){Mi.off(e)},model:{mode:"x",minX:0,maxX:i.sizes.length-1,getInitialValue:function(){return{x:function(){return i.getInitialValue()}}}},stepSize:1,snapToGrid:!0,sliderBehaviours:so([Ii(Dl.refresh)]),components:[Dl.parts().spectrum({dom:xf('<div class="${prefix}-slider-size-container"></div>'),components:[wf('<div class="${prefix}-slider-size-line"></div>')]}),Dl.parts().thumb({dom:xf('<div class="${prefix}-slider-thumb"></div>'),behaviours:so([Mi.config({toggleClass:Fi.resolve("thumb-active")})])})]})},Fl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Vl=function(n){var e,t,r=n.selection.getStart(),o=be.fromDom(r),i=be.fromDom(n.getBody()),u=(e=function(n){return Ue(i,n)},(Te(t=o)?E.some(t):$e(t)).map(function(n){return Lr(n,function(n){return _i(n,"font-size").isSome()},e).bind(function(n){return _i(n,"font-size")}).getOrThunk(function(){return $i(n,"font-size")})}).getOr(""));return Mn(Fl,function(n){return u===n}).getOr("medium")},Nl={candidates:h(Fl),get:function(n){var e,t=Vl(n);return(e=t,An(Fl,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,E.from(Fl[e])).each(function(n){var e,t;t=n,Vl(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Hl=Nl.candidates(),jl=function(n){return[wf('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Rl({onChange:e.onChange,sizes:Hl,category:"font",getInitialValue:e.getInitialValue})),wf('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},zl=function(n){var e=function t(n){return n.uid!==undefined}(n)&&At(n,"uid")?n.uid:ff("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(E.none,E.some)},asSpec:function(){return y({},n,{uid:e})}}};function Ll(n,e){return Ul(v.document.createElement("canvas"),n,e)}function Pl(n){return n.getContext("2d")}function Ul(n,e,t){return n.width=e,n.height=t,n}var Gl={create:Ll,clone:function Vh(n){var e;return Pl(e=Ll(n.width,n.height)).drawImage(n,0,0),e},resize:Ul,get2dContext:Pl,get3dContext:function Nh(n){var e=null;try{e=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(t){}return e||(e=null),e}},$l={getWidth:function Hh(n){return n.naturalWidth||n.width},getHeight:function jh(n){return n.naturalHeight||n.height}},Wl=window.Promise?window.Promise:function(){var n=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,r(o,this),r(u,this))},e=n.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)};function r(n,e){return function(){n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(r){var o=this;null!==this._state?e(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void f(r(e,n),r(o,this),r(u,this))}this._state=!0,this._value=n,a.call(this)}catch(t){u.call(this,t)}}function u(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds.length;n<e;n++)i.call(this,this._deferreds[n]);this._deferreds=null}function c(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function f(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return n.prototype["catch"]=function(n){return this.then(null,n)},n.prototype.then=function(t,r){var o=this;return new n(function(n,e){i.call(o,new c(t,r,n,e))})},n.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&t(arguments[0])?arguments[0]:arguments);return new n(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){a(e,n)},i)}c[e]=n,0==--u&&o(c)}catch(r){i(r)}}for(var n=0;n<c.length;n++)a(n,c[n])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(n){n(e)})},n.reject=function(t){return new n(function(n,e){e(t)})},n.race=function(o){return new n(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},n}();function _l(){return new(Ve.getOrDie("FileReader"))}var ql={atob:function(n){return Ve.getOrDie("atob")(n)},requestAnimationFrame:function(n){Ve.getOrDie("requestAnimationFrame")(n)}};function Xl(a){return new Wl(function(n,e){var t=v.URL.createObjectURL(a),r=new v.Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),n(r)}function u(){o(),e("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function Yl(r){return new Wl(function(n,t){var e=new v.XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&n(this.response)},e.onerror=function(){var n,e=this;t(0===this.status?((n=new Error("No access to download image")).code=18,n.name="SecurityError",n):new Error("Error "+e.status+" downloading image"))},e.send()})}function Kl(n){var e=n.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return E.none();for(var r,o=t[1],i=e[1],u=ql.atob(i),a=u.length,c=Math.ceil(a/1024),f=new Array(c),s=0;s<c;++s){for(var l=1024*s,d=Math.min(l+1024,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);f[s]=(r=m,new(Ve.getOrDie("Uint8Array"))(r))}return E.some(function v(n,e){return new(Ve.getOrDie("Blob"))(n,e)}(f,{type:o}))}function Jl(t){return new Wl(function(n,e){Kl(t).fold(function(){e("uri is not base64: "+t)},n)})}function Ql(t){return new Wl(function(n){var e=_l();e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}var Zl,nd,ed,td={blobToImage:Xl,imageToBlob:function zh(n){var e=n.src;return 0===e.indexOf("data:")?Jl(e):Yl(e)},blobToArrayBuffer:function Lh(t){return new Wl(function(n){var e=_l();e.onloadend=function(){n(e.result)},e.readAsArrayBuffer(t)})},blobToDataUri:Ql,blobToBase64:function Ph(n){return Ql(n).then(function(n){return n.split(",")[1]})},dataUriToBlobSync:Kl,canvasToBlob:function Uh(n,t,r){return t=t||"image/png",v.HTMLCanvasElement.prototype.toBlob?new Wl(function(e){n.toBlob(function(n){e(n)},t,r)}):Jl(n.toDataURL(t,r))},canvasToDataURL:function Gh(n,e,t){return e=e||"image/png",n.then(function(n){return n.toDataURL(e,t)})},blobToCanvas:function $h(n){return Xl(n).then(function(n){var e;return function t(n){v.URL.revokeObjectURL(n.src)}(n),e=Gl.create($l.getWidth(n),$l.getHeight(n)),Gl.get2dContext(e).drawImage(n,0,0),e})},uriToBlob:function Wh(n){return 0===n.indexOf("blob:")?Yl(n):0===n.indexOf("data:")?Jl(n):null}},rd=function(n){return td.blobToBase64(n)},od=function(u){var e=zl({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Gr([Yr(W()),Wr($(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,E.from(o[0])).each(function(n){var o,i;o=u,rd(i=n).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Ec("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})})})])});return hf.sketch({dom:kf.getToolbarIconButton("image",u),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},id=function(n){return n.dom().textContent},ud=function(n){return 0<n.length},ad=function(n){return n===undefined||null===n?"":n},cd=function(e,t,n){return n.text.toOption().filter(ud).fold(function(){return yo(n=e,"href")===id(n)?E.some(t):E.none();var n},E.some)},fd=function(n){var e=be.fromDom(n.selection.getStart());return uu(e,"a")},sd={getInfo:function(n){return fd(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:E.none()}},function(n){return t=id(e=n),r=yo(e,"href"),o=yo(e,"title"),i=yo(e,"target"),{url:ad(r),text:t!==r?ad(t):"",title:ad(o),target:ad(i),link:E.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.toOption().filter(ud).fold(function(){var e;e=o,i.link.bind(b).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.toOption().filter(ud).each(function(n){t.title=n}),n.target.toOption().filter(ud).each(function(n){t.target=n}),t);i.link.bind(b).fold(function(){var n=i.text.toOption().filter(ud).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=cd(t,e,i);bo(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:fd},ld=Yn.detect(),dd=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},md=function(n,e){(ld.os.isAndroid()?dd:s)(e,n)},gd=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=Gr(e),mo({fields:[Or("enabled")],name:t,active:{events:h(r)}})),configAsRaw:h({}),initialConfig:{},state:co}}},pd=/* */Object.freeze({getCurrent:function(n,e,t){return e.find(n)}}),vd=[Or("find")],hd=mo({fields:vd,name:"composing",apis:pd}),bd=pf({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,r=c(e,["attributes"]);return{uid:n.uid,dom:y({tag:"div",attributes:y({role:"presentation"},t)},r),components:n.components,behaviours:mc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Mr("components",[]),dc("containerBehaviours",[]),Mr("events",{}),Mr("domModification",{}),Mr("eventOrder",{})]}),yd=pf({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:vc(t.dataBehaviours,[Yf.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),hd.config({find:E.some})]),events:Gr([Kr(function(n,e){Yf.setValue(n,t.getInitialValue())})])}},configFields:[Or("uid"),Or("dom"),Or("getInitialValue"),pc("dataBehaviours",[Yf,hd])]}),xd=function(n){return n.dom().value},wd=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},Sd=h([Er("data"),Mr("inputAttributes",{}),Mr("inputStyles",{}),Mr("tag","input"),Mr("inputClasses",[]),ci("onSetValue"),Mr("styles",{}),Mr("eventOrder",{}),dc("inputBehaviours",[Yf,zi]),Mr("selectOnFocus",!0)]),Od=function(n){return y({},(e=n,so([zi.config({onFocus:!1===e.selectOnFocus?x:function(n){var e=n.element(),t=xd(e);e.dom().setSelectionRange(0,t.length)}})])),gc(n.inputBehaviours,[Yf.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return xd(n.element())},setValue:function(n,e){xd(n.element())!==e&&wd(n.element(),e)}},onSetValue:n.onSetValue})]));var e},Td=pf({name:"Input",configFields:Sd(),factory:function(n,e){return{uid:n.uid,dom:(t=n,{tag:t.tag,attributes:y({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}),components:[],behaviours:Od(n),eventOrder:n.eventOrder};var t}}),kd=/* */Object.freeze({exhibit:function(n,e){return to({attributes:Dt([{key:e.tabAttr,value:"true"}])})}}),Ed=[Mr("tabAttr","data-alloy-tabstop")],Cd=mo({fields:Ed,name:"tabstopping",active:kd}),Dd=function(n,e){var t=zl(Td.sketch({inputAttributes:{placeholder:e},onSetValue:function(n,e){de(n,G())},inputBehaviours:so([hd.config({find:E.some}),Cd.config({}),lc.config({mode:"execution"})]),selectOnFocus:!1})),r=zl(hf.sketch({dom:xf('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);Yf.setValue(e,"")}}));return{name:n,spec:bd.sketch({dom:xf('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:so([Mi.config({toggleClass:Fi.resolve("input-container-empty")}),hd.config({find:function(n){return E.some(t.get(n))}}),gd("input-clearing",[Wr(G(),function(n){var e=t.get(n);(0<Yf.getValue(e).length?Mi.off:Mi.on)(n)})])])})}},Md=["input","button","textarea"],Ad=function(n,e,t){e.disabled&&Nd(n,e,t)},Id=function(n){return Sn(Md,Se(n.element()))},Bd=function(n){ho(n.element(),"disabled","disabled")},Rd=function(n){wo(n.element(),"disabled")},Fd=function(n){ho(n.element(),"aria-disabled","true")},Vd=function(n){ho(n.element(),"aria-disabled","false")},Nd=function(e,n,t){n.disableClass.each(function(n){Eo(e.element(),n)}),(Id(e)?Bd:Fd)(e)},Hd=function(n){return Id(n)?xo(n.element(),"disabled"):"true"===yo(n.element(),"aria-disabled")},jd=/* */Object.freeze({enable:function(e,n,t){n.disableClass.each(function(n){Do(e.element(),n)}),(Id(e)?Rd:Vd)(e)},disable:Nd,isDisabled:Hd,onLoad:Ad}),zd=/* */Object.freeze({exhibit:function(n,e,t){return to({classes:e.disabled?e.disableClass.map(jn).getOr([]):[]})},events:function(n,e){return Gr([$r(ee(),function(n,e){return Hd(n)}),ro(n,e,Ad)])}}),Ld=[Mr("disabled",!1),Er("disableClass")],Pd=mo({fields:Ld,name:"disabling",active:zd,apis:jd}),Ud=[dc("formBehaviours",[Yf])],Gd=function(n){return"<alloy.field."+n+">"},$d=function(o,n,e){return{uid:o.uid,dom:o.dom,components:n,behaviours:gc(o.formBehaviours,[Yf.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),A(e.partUids,function(n,e){return h(t.getByUid(n))}));return A(r,function(n,e){return n().bind(function(n){var e,t=hd.getCurrent(n);return e="missing current",t.fold(function(){return ft.error(e)},ft.value)}).map(Yf.getValue)})},setValue:function(t,n){M(n,function(e,n){Yc(t,o,n).each(function(n){hd.getCurrent(n).each(function(n){Yf.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return Yc(n,o,e).bind(hd.getCurrent)}}}},Wd=(ef(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Gd(n),o=e,{uiType:Tc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=Tn(r,function(n){return Lc({name:n,pname:Gd(n)})});return lf("form",Ud,o,$d,t)}),_d=function(){var e=Fo(E.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(E.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(E.some(n))},run:function(n){e.get().each(n)}}},qd=function(){var e=Fo(E.none());return{clear:function(){e.set(E.none())},set:function(n){e.set(E.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Xd=function(n){return{xValue:n,points:[]}},Yd=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},Kd=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},Jd=function(n){var r="navigateEvent",e=ur([Or("fields"),Mr("maxFieldIndex",n.fields.length-1),Or("onExecute"),Or("getInitialValue"),Ir("state",function(){return{dialogSwipeState:qd(),currentScreen:Fo(0)}})]),u=br("SerialisedDialog",e,n),o=function(e,n,t){return hf.sketch({dom:xf('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){me(n,r,{direction:e})},buttonBehaviours:so([Pd.config({disableClass:Fi.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=tu(n.element(),"."+Fi.resolve("serialised-dialog-screen"));iu(n.element(),"."+Fi.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(_i(r,"left").each(function(n){var e=parseInt(n,10),t=cs(i[0]);Ui(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},a=function(r){var n=tu(r.element(),"input");E.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=f.get(r);Mu.highlightAt(e,u.state.currentScreen.get())},c=zl(Wd(function(t){return{dom:xf('<div class="${prefix}-serialised-dialog"></div>'),components:[bd.sketch({dom:xf('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:Tn(u.fields,function(n,e){return e<=u.maxFieldIndex?bd.sketch({dom:xf('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",0<e),t.field(n.name,n.spec),o(1,"next",e<u.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:so([Ii(function(n,e){var t;t=e,iu(n.element(),"."+Fi.resolve("serialised-dialog-chain")).each(function(n){Ui(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),lc.config({mode:"special",focusIn:function(n){a(n)},onTab:function(n){return i(n,1),E.some(!0)},onShiftTab:function(n){return i(n,-1),E.some(!0)}}),gd("form-events",[Kr(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=f.get(e);Mu.highlightFirst(t),u.getInitialValue(e).each(function(n){Yf.setValue(e,n)})}),Zr(u.onExecute),Wr(_(),function(n,e){"left"===e.event().raw().propertyName&&a(n)}),Wr(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),f=zl({dom:xf('<div class="${prefix}-dot-container"></div>'),behaviours:so([Mu.config({highlightClass:Fi.resolve("dot-active"),itemClass:Fi.resolve("dot-item")})]),components:Fn(u.fields,function(n,e){return e<=u.maxFieldIndex?[wf('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:xf('<div class="${prefix}-serializer-wrapper"></div>'),components:[c.asSpec(),f.asSpec()],behaviours:so([lc.config({mode:"special",focusIn:function(n){var e=c.get(n);lc.focusIn(e)}}),gd("serializer-wrapper-events",[Wr(F(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Xd(t.raw().touches[0].clientX))}),Wr(V(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(Yd(n,t.raw().touches[0].clientX))})}),Wr(N(),function(r){u.state.dialogSwipeState.on(function(n){var e=c.get(r),t=-1*Kd(n);i(e,t)})})])])}},Qd=X(function(t,r){return[{label:"the link group",items:[Jd({fields:[Dd("url","Type or paste URL"),Dd("text","Link text"),Dd("title","Link title"),Dd("target","Link target"),(n="link",{name:n,spec:yd.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return E.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return E.some(sd.getInfo(r))},onExecute:function(n){var e=Yf.getValue(n);sd.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),Zd=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],nm=Gr([(Zl=Jn(),nd=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(Ue(t=o,n.element())&&!Ue(t,r)&&(v.console.warn(Jn()+" did not get interpreted by the desired target. \nOriginator: "+qo(o)+"\nTarget: "+qo(i)+"\nCheck the "+Jn()+" event handlers"),1))},{key:Zl,value:Rr({can:nd})})]),em=/* */Object.freeze({events:nm}),tm=b,rm=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+qo(e().element())+" is not in context.")}};return{debugInfo:h("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:h(!1)}},om=rm(),im=function(n,o){var i={};return M(n,function(n,r){M(n,function(n,e){var t=kt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},um=function(n,e){return t=l.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:h(r)};var t,r},am=function(n){return n.cHandler},cm=function(n,e){return{name:h(n),handler:h(e)}},fm=function(n,e,t){var r,o,i=y({},t,(r=n,o={},kn(e,function(n){o[n.name()]=n.handlers(r)}),o));return im(i,cm)},sm=function(n){var e,i=yn(e=n)?{can:h(!0),abort:h(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},lm=function(n,e,t){var r,o,i=e[t];return i?function(u,a,n,c){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[a](),r=e[a](),o=c.indexOf(t),i=c.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+Jt(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+Jt(c,null,2));return o<i?-1:i<o?1:0});return ft.value(t)}catch(r){return ft.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=Tn(n,function(n){return n.handler()});return Fr(e)}):(r=t,o=n,ft.error(["The event ("+r+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+Jt(Tn(o,function(n){return n.name()}),null,2)]))},dm=function(n,i){var e=B(n,function(r,o){return(1===r.length?ft.value(r[0].handler()):lm(r,i,o)).map(function(n){var e=sm(n),t=1<r.length?En(i,function(e){return Sn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return Ct(o,{handler:e,purpose:h(t)})})});return Mt(e,{})},mm=function(n){return vr("custom.definition",ur([sr("dom","dom",ht(),ur([Or("tag"),Mr("styles",{}),Mr("classes",[]),Mr("attributes",{}),Er("value"),Er("innerHtml")])),Or("components"),Or("uid"),Mr("events",{}),Mr("apis",{}),sr("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},pt.mergeWithThunk(h(e))),wr()),Er("domModification")]),n);var e},gm=function(e,n){kn(n,function(n){Eo(e,n)})},pm=function(e,n){kn(n,function(n){Do(e,n)})},vm=function(n,e){return t=n,o=Tn(r=e,function(n){return Cr(n.name(),[Or("config"),Mr("state",co)])}),i=vr("component.behaviours",ur(o),t.behaviours).fold(function(n){throw new Error(yr(n)+"\nComplete spec:\n"+Jt(t,null,2))},function(n){return n}),{list:r,data:A(i,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})};var t,r,o,i},hm=function(n){var e,t,r,o=(e=n,t=kt("behaviours",{})(e),r=En(C(t),function(n){return t[n]!==undefined}),Tn(r,function(n){return t[n].me}));return vm(n,o)},bm=function(n,e,t){var r,o,i,u=y({},(r=n).dom,{uid:r.uid,domChildren:Tn(r.components,function(n){return n.element()})}),a=n.domModification.fold(function(){return to({})},to),c={"alloy.base.modification":a},f=0<e.length?function(e,n,t,r){var o=y({},n);kn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=im(o,function(n,e){return{name:n,modification:e}}),u=function(n){return Cn(n,function(n,e){return y({},e.modification,n)},{})},a=Cn(i.classes,function(n,e){return e.modification.concat(n)},[]),c=u(i.attributes),f=u(i.styles);return to({classes:a,attributes:c,styles:f})}(t,c,e,u):a;return i=f,y({},o=u,{attributes:y({},o.attributes,i.attributes),styles:y({},o.styles,i.styles),classes:o.classes.concat(i.classes)})},ym=function(n,e,t){var r,o,i,u,a,c,f={"alloy.base.behaviour":(r=n,r.events)};return(o=t,i=n.eventOrder,u=e,a=f,c=fm(o,u,a),dm(c,i)).getOrDie()},xm=function(t){var n=function(){return s},r=Fo(om),e=hr(mm(t)),o=hm(t),i=o.list,u=o.data,a=function(n){var e=be.fromTag(n.tag);bo(e,n.attributes),gm(e,n.classes),Gi(e,n.styles),n.innerHtml.each(function(n){return $o(e,n)});var t=n.domChildren;return Je(e,t),n.value.each(function(n){wd(e,n)}),n.uid,af(e,n.uid),e}(bm(e,i,u)),c=ym(e,i,u),f=Fo(e.components),s={getSystem:r.get,config:function(n){var e=u;return(yn(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+Jt(t,null,2))})()},hasConfigured:function(n){return yn(u[n.name()])},spec:h(t),readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return e.apis},connect:function(n){r.set(n)},disconnect:function(){r.set(rm(n))},element:h(a),syncComponents:function(){var n=We(a),e=Fn(n,function(n){return r.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(e)},components:f.get,events:h(c)};return s},wm=function(n){var e,t,r=tm(n),o=r.events,i=c(r,["events"]),u=(e=i,t=kt("components",[])(e),Tn(t,km)),a=y({},i,{events:y({},em,o),components:u});return ft.value(xm(a))},Sm=function(n){var e=be.fromText(n);return Om({element:e})},Om=function(n){var e=br("external.component",ir([Or("element"),Er("uid")]),n),t=Fo(rm());e.uid.each(function(n){af(e.element,n)});var r={getSystem:t.get,config:E.none,hasConfigured:h(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(rm(function(){return r}))},getApis:function(){return{}},element:h(e.element),spec:h(n),readState:h("No state"),syncComponents:x,components:h([]),events:h({})};return nf(r)},Tm=ff,km=function(e){return(n=e,Et(n,Zc)).fold(function(){var n=e.hasOwnProperty("uid")?e:y({uid:Tm("")},e);return wm(n).getOrDie()},function(n){return n});var n},Em=nf,Cm="alloy.item-hover",Dm="alloy.item-focus",Mm=function(n){(jo(n.element()).isNone()||zi.isFocused(n))&&(zi.isFocused(n)||zi.focus(n),me(n,Cm,{item:n}))},Am=function(n){me(n,Dm,{item:n})},Im=h(Cm),Bm=h(Dm),Rm=[Or("data"),Or("components"),Or("dom"),Mr("hasSubmenu",!1),Er("toggling"),pc("itemBehaviours",[Mi,zi,lc,Yf]),Mr("ignoreFocus",!1),Mr("domModification",{}),di("builder",function(n){return{dom:n.dom,domModification:y({},n.domModification,{attributes:y({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes,{"aria-haspopup":n.hasSubmenu},n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:vc(n.itemBehaviours,[n.toggling.fold(Mi.revoke,function(n){return Mi.config(y({aria:{mode:"checked"}},n))}),zi.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Am(n)}}),lc.config({mode:"execution"}),Yf.config({store:{mode:"memory",initialValue:n.data}}),gd("item-type-events",[Wr(oe(),ge),Yr(H()),Wr(L(),Mm),Wr(te(),zi.focus)])]),components:n.components,eventOrder:n.eventOrder}}),Mr("eventOrder",{})],Fm=[Or("dom"),Or("components"),di("builder",function(n){return{dom:n.dom,components:n.components,events:Gr([(e=te(),Wr(e,function(n,e){e.stop()}))])};var e})],Vm=h([Lc({name:"widget",overrides:function(e){return{behaviours:so([Yf.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:function(){}}})])}}})]),Nm=[Or("uid"),Or("data"),Or("components"),Or("dom"),Mr("autofocus",!1),Mr("ignoreFocus",!1),pc("widgetBehaviours",[Yf,zi,lc]),Mr("domModification",{}),Qc(Vm()),di("builder",function(t){var n=qc(0,t,Vm()),e=Xc("item-widget",t,n.internals()),r=function(n){return Yc(n,t,"widget").map(function(n){return lc.focusIn(n),n})},o=function(n,e){return ju(e.event().target())||t.autofocus&&e.setSource(n.element()),E.none()};return{dom:t.dom,components:e,domModification:t.domModification,events:Gr([Zr(function(n,e){r(n).each(function(n){e.stop()})}),Wr(L(),Mm),Wr(te(),function(n,e){t.autofocus?r(n):zi.focus(n)})]),behaviours:vc(t.widgetBehaviours,[Yf.config({store:{mode:"memory",initialValue:t.data}}),zi.config({ignore:t.ignoreFocus,onFocus:function(n){Am(n)}}),lc.config({mode:"special",focusIn:t.autofocus?function(n){r(n)}:po(),onLeft:o,onRight:o,onEscape:function(n,e){return zi.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element()),E.none()):(zi.focus(n),E.some(!0))}})])}})],Hm=xr("type",{widget:Nm,item:Rm,separator:Fm}),jm=h([Uc({factory:{sketch:function(n){var e=br("menu.spec item",Hm,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return e.hasOwnProperty("uid")?e:y({},e,{uid:ff("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),zm=h([Or("value"),Or("items"),Or("dom"),Or("components"),Mr("eventOrder",{}),dc("menuBehaviours",[Mu,Yf,hd,lc]),Ar("movement",{mode:"menu",moveOnTab:!0},xr("mode",{grid:[gi(),di("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[di("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Or("rowSelector")],menu:[Mr("moveOnTab",!0),di("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),Tr("markers",ii()),Mr("fakeFocus",!1),Mr("focusManager",Iu()),ci("onHighlight")]),Lm=h("alloy.menu-focus"),Pm=vf({name:"Menu",configFields:zm(),partFields:jm(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:gc(n.menuBehaviours,[Mu.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),Yf.config({store:{mode:"memory",initialValue:n.value}}),hd.config({find:E.some}),lc.config(n.movement.config(n,n.movement))]),events:Gr([Wr(Bm(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){Mu.highlight(e,n),t.stop(),me(e,Lm(),{menu:e,item:n})})}),Wr(Im(),function(n,e){var t=e.event().item();Mu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Um=function(n,e,t,r){var o=n.getSystem().build(r);rt(n,o,t)},Gm=function(n,e,t,r){var o=$m(n,e);Mn(o,function(n){return Ue(r.element(),n.element())}).each(it)},$m=function(n,e){return n.components()},Wm=function(e,t,n,o,r){var i=$m(e,t);return E.from(i[o]).map(function(n){return Gm(e,t,0,n),r.each(function(n){Um(e,0,function(n,e){var t,r;r=e,_e(t=n,o).fold(function(){Ke(t,r)},function(n){qe(n,r)})},n)}),n})},_m=mo({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(n,e,t,r){Um(n,0,Ke,r)},prepend:function(n,e,t,r){Um(n,0,Ye,r)},remove:Gm,replaceAt:Wm,replaceBy:function(e,t,n,r,o){var i=$m(e,t);return An(i,r).bind(function(n){return Wm(e,t,0,n,o)})},set:function(e,n,t,r){var o,i,u,a,c,f;i=(o=e).components(),kn(i,ot),Qe(o.element()),o.syncComponents(),u=function(){var n=Tn(r,e.getSystem().build);kn(n,function(n){tt(e,n)})},a=e.element(),c=Ge(a),f=Ho(c).bind(function(e){var n=function(n){return Ue(e,n)};return n(a)?E.some(a):Pr(a,n)}),u(a),f.each(function(e){Ho(c).filter(function(n){return Ue(n,e)}).fold(function(){Vo(e)},x)})},contents:$m})}),qm=function(t,r,o,n){return Et(o,n).bind(function(n){return Et(t,n).bind(function(n){var e=qm(t,r,o,n);return E.some([n].concat(e))})}).getOr([])},Xm=function(n,e){var t={};M(n,function(n,e){kn(n,function(n){t[n]=e})});var r=e,o=I(e,function(n,e){return{k:n,v:e}}),i=A(o,function(n,e){return[e].concat(qm(t,r,o,e))});return A(t,function(n){return Et(i,n).getOr([n])})},Ym=function(){var i=Fo({}),u=Fo({}),a=Fo({}),c=Fo(E.none()),f=Fo({}),e=function(n){return Et(u.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(y({},u.get(),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,r){c.set(E.some(n)),i.set(t),u.set(e),f.set(r);var o=Xm(r,t);a.set(o)},expand:function(t){return Et(i.get(),t).map(function(n){var e=Et(a.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return Et(a.get(),n)},collapse:function(n){return Et(a.get(),n).bind(function(n){return 1<n.length?E.some(n.slice(1)):E.none()})},lookupMenu:e,otherMenus:function(n){var e,t,r=f.get();return e=C(r),t=n,En(e,function(n){return!Sn(t,n)})},getPrimary:function(){return c.get().bind(function(n){return e(n).bind(function(n){return"prepared"===n.type?E.some(n.menu):E.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(E.none())},isClear:function(){return c.get().isNone()}}},Km=h("collapse-item"),Jm=pf({name:"TieredMenu",configFields:[li("onExecute"),li("onEscape"),si("onOpenMenu"),si("onOpenSubmenu"),ci("onCollapseMenu"),Mr("highlightImmediately",!0),kr("data",[Or("primary"),Or("menus"),Or("expansions")]),Mr("fakeFocus",!1),ci("onHighlight"),ci("onHover"),kr("markers",[Or("backgroundMenu")].concat(ri()).concat(oi())),Or("dom"),Mr("navigateOnHover",!0),Mr("stayInDom",!1),dc("tmenuBehaviours",[lc,Mu,hd,_m]),Mr("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)}},factory:function(a,n){var c,e,i=Fo(E.none()),u=function(r,o,n){return A(n,function(n,e){var t=function(){return Pm.sketch(y({dom:n.dom},n,{value:e,items:n.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?(o=function(n){return Mu.getHighlighted(n).map(function(n){return n.element()})},{get:o,set:function(e,n){var t=o(e);e.getSystem().getByDom(n).fold(x,function(n){Mu.highlight(e,n)});var r=o(e);Au(e,t,r)}}):Iu()}));var o};return e===o?{type:"prepared",menu:r.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})},f=Ym(),s=function(n){return Yf.getValue(n).value},l=function(n){return A(a.data.menus,function(n,e){return Fn(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},d=function(e,n){Mu.highlight(e,n),Mu.getHighlighted(n).orThunk(function(){return Mu.getFirst(n)}).each(function(n){pe(e,n.element(),te())})},m=function(e,n){return Yo(Tn(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?E.some(n.menu):E.none()})}))},g=function(e,n,t){var r=m(n,n.otherMenus(t));kn(r,function(n){pm(n.element(),[a.markers.backgroundMenu]),a.stayInDom||_m.remove(e,n)})},p=function(n,r){var o,e=(o=n,i.get().getOrThunk(function(){var t={},n=tu(o.element(),"."+a.markers.item),e=En(n,function(n){return"true"===yo(n,"aria-haspopup")});return kn(e,function(n){o.getSystem().getByDom(n).each(function(n){var e=s(n);t[e]=n})}),i.set(E.some(t)),t}));M(e,function(n,e){var t=Sn(r,e);ho(n.element(),"aria-expanded",t)})},v=function(r,o,i){return E.from(i[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return E.none();var e=n.menu,t=m(o,i.slice(1));return kn(t,function(n){Eo(n.element(),a.markers.backgroundMenu)}),Ee(e.element())||_m.append(r,Em(e)),pm(e.element(),[a.markers.backgroundMenu]),d(r,e),g(r,o,i),E.some(e)})})};(e=c||(c={}))[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var h=function(o,i,u){void 0===u&&(u=c.HighlightSubmenu);var n=s(i);return f.expand(n).bind(function(r){return p(o,r),E.from(r[0]).bind(function(t){return f.lookupMenu(t).bind(function(n){var e=function(n,e,t){if("notbuilt"!==t.type)return t.menu;var r=n.getSystem().build(t.nbMenu());return f.setMenuBuilt(e,r),r}(o,t,n);return Ee(e.element())||_m.append(o,Em(e)),a.onOpenSubmenu(o,i,e),u===c.HighlightSubmenu?(Mu.highlightFirst(e),v(o,f,r)):(Mu.dehighlightAll(e),E.some(i))})})})},r=function(e,t){var n=s(t);return f.collapse(n).bind(function(n){return p(e,n),v(e,f,n).map(function(n){return a.onCollapseMenu(e,t,n),n})})},t=function(t){return function(e,n){return uu(n.getSource(),"."+a.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},o=Gr([Wr(Lm(),function(e,n){var t=n.event().menu();Mu.highlight(e,t);var r=s(n.event().item());f.refresh(r).each(function(n){return g(e,f,n)})}),Zr(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===s(n).indexOf("collapse-item")&&r(e,n),h(e,n,c.HighlightSubmenu).fold(function(){a.onExecute(e,n)},function(){})})}),Kr(function(e,n){var t,r,o;(t=e,r=u(t,a.data.primary,a.data.menus),o=l(t),f.setContents(a.data.primary,r,a.data.expansions,o),f.getPrimary()).each(function(n){_m.append(e,Em(n)),a.onOpenMenu(e,n),a.highlightImmediately&&d(e,n)})})].concat(a.navigateOnHover?[Wr(Im(),function(n,e){var t,r,o=e.event().item();t=n,r=s(o),f.refresh(r).bind(function(n){return p(t,n),v(t,f,n)}),h(n,o,c.HighlightParent),a.onHover(n,o)})]:[])),b={collapseMenu:function(e){Mu.getHighlighted(e).each(function(n){Mu.getHighlighted(n).each(function(n){r(e,n)})})},highlightPrimary:function(e){f.getPrimary().each(function(n){d(e,n)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:gc(a.tmenuBehaviours,[lc.config({mode:"special",onRight:t(function(n,e){return ju(e.element())?E.none():h(n,e,c.HighlightSubmenu)}),onLeft:t(function(n,e){return ju(e.element())?E.none():r(n,e)}),onEscape:t(function(n,e){return r(n,e).orThunk(function(){return a.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){f.getPrimary().each(function(n){pe(e,n.element(),te())})}}),Mu.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),hd.config({find:function(n){return Mu.getHighlighted(n)}}),_m.config({})]),eventOrder:a.eventOrder,apis:b,events:o}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:Ct(n,e),expansions:{}}},collapseItem:function(n){return{value:Ec(Km()),meta:{text:n}}}}}),Qm=function(n,e,t,r){return Et(e.routes,r.start).bind(function(n){return Et(n,r.destination)})},Zm=function(n,e,t,r){return Qm(0,e,0,r).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},ng=function(t,r,n){var e,o,i;(e=t,o=r,i=n,eg(e,o,i).bind(function(n){return Zm(e,o,i,n)})).each(function(n){var e=n.transition;Do(t.element(),e.transitionClass),wo(t.element(),r.destinationAttr)})},eg=function(n,e,t){var r=n.element();return xo(r,e.destinationAttr)?E.some({start:yo(n.element(),e.stateAttr),destination:yo(n.element(),e.destinationAttr)}):E.none()},tg=function(n,e,t,r){ng(n,e,t),xo(n.element(),e.stateAttr)&&yo(n.element(),e.stateAttr)!==r&&e.onFinish(n,r),ho(n.element(),e.stateAttr,r)},rg=/* */Object.freeze({findRoute:Qm,disableTransition:ng,getCurrentRoute:eg,jumpTo:tg,progressTo:function(t,r,o,i){var n,e;e=r,xo((n=t).element(),e.destinationAttr)&&(ho(n.element(),e.stateAttr,yo(n.element(),e.destinationAttr)),wo(n.element(),e.destinationAttr));var u,a,c=(u=r,a=i,{start:yo(t.element(),u.stateAttr),destination:a});Zm(t,r,o,c).fold(function(){tg(t,r,o,i)},function(n){ng(t,r,o);var e=n.transition;Eo(t.element(),e.transitionClass),ho(t.element(),r.destinationAttr,i)})},getState:function(n,e,t){var r=n.element();return xo(r,e.stateAttr)?E.some(yo(r,e.stateAttr)):E.none()}}),og=/* */Object.freeze({events:function(o,i){return Gr([Wr(_(),function(t,n){var r=n.event().raw();eg(t,o,i).each(function(e){Qm(0,o,0,e).each(function(n){n.transition.each(function(n){r.propertyName===n.property&&(tg(t,o,i,e.destination),o.onTransition(t,e))})})})}),Kr(function(n,e){tg(n,o,i,o.initialState)})])}}),ig=[Mr("destinationAttr","data-transitioning-destination"),Mr("stateAttr","data-transitioning-state"),Or("initialState"),ci("onTransition"),ci("onFinish"),Tr("routes",pr(ft.value,pr(ft.value,ir([Dr("transition",[Or("property"),Or("transitionClass")])]))))],ug=mo({fields:ig,name:"transitioning",active:og,apis:rg,extra:{createRoutes:function(n){var r={};return M(n,function(n,e){var t=e.split("<->");r[t[0]]=Ct(t[1],n),r[t[1]]=Ct(t[0],n)}),r},createBistate:function(n,e,t){return Dt([{key:n,value:Ct(e,t)},{key:e,value:Ct(n,t)}])},createTristate:function(n,e,t,r){return Dt([{key:n,value:Dt([{key:e,value:r},{key:t,value:r}])},{key:e,value:Dt([{key:n,value:r},{key:t,value:r}])},{key:t,value:Dt([{key:n,value:r},{key:e,value:r}])}])}}}),ag=Fi.resolve("scrollable"),cg={register:function(n){Eo(n,ag)},deregister:function(n){Do(n,ag)},scrollable:h(ag)},fg=function(n){return Et(n,"format").getOr(n.title)},sg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[Fi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Fi.resolve("format-matches"),selected:t},itemBehaviours:so(o?[]:[Ai(n,function(n,e){(e?Mi.on:Mi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},lg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[hf.sketch({dom:{tag:"div",classes:[Fi.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Fi.resolve("styles-collapse-icon")]}},Sm(n)]:[Sm(n)],action:function(n){if(r){var e=t().get(n);Jm.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Fi.resolve("styles-menu-items-container")]},components:[Pm.parts().items({})],behaviours:so([gd("adhoc-scrollable-menu",[Kr(function(n,e){Ui(n.element(),"overflow-y","auto"),Ui(n.element(),"-webkit-overflow-scrolling","touch"),cg.register(n.element())}),Jr(function(n){qi(n.element(),"overflow-y"),qi(n.element(),"-webkit-overflow-scrolling"),cg.deregister(n.element())})])])}],items:e,menuBehaviours:so([ug.config({initialState:"after",routes:ug.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},dg=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return a},n=lg("Styles",[].concat(Tn(o.items,function(n){return sg(fg(n),n.title,n.isSelected(),n.getPreview(),At(o.expansions,fg(n)))})),i,!1),e=A(o.menus,function(n,e){var t=Tn(n,function(n){return sg(fg(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",At(o.expansions,fg(n)))});return lg(e,t,i,!0)}),t=mt(e,Ct("styles",n)),{tmenu:Jm.tieredData("styles",t,o.expansions)}),a=zl(Jm.sketch({dom:{tag:"div",classes:[Fi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Yf.getValue(e);return r.handle(e,t.value),E.none()},onEscape:function(){return E.none()},onOpenMenu:function(n,e){var t=cs(n.element());as(e.element(),t),ug.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=cs(n.element()),o=ou(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();as(t.element(),r),ug.progressTo(i,"before"),ug.jumpTo(t,"after"),ug.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=ou(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();ug.progressTo(o,"after"),ug.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:Fi.resolve("styles-background-menu"),menu:Fi.resolve("styles-menu"),selectedMenu:Fi.resolve("styles-selected-menu"),item:Fi.resolve("styles-item"),selectedItem:Fi.resolve("styles-selected-item")}}));return a.asSpec()},mg=function(n){return At(n,"items")?(i=mt((st([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),e=o=n,t=["items"],r={},M(e,function(n,e){Sn(t,e)||(r[e]=n)}),r),{menu:!0}),u=gg(o.items),{item:i,menus:mt(u.menus,Ct(o.title,u.items)),expansions:mt(u.expansions,Ct(o.title,o.title))}):{item:n,menus:{},expansions:{}};var e,t,r,o,i,u},gg=function(n){return Cn(n,function(n,e){var t=mg(e);return{menus:mt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:mt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},pg={expand:gg},vg=function(u,n){var a=function(n){return function(){return u.formatter.match(n)}},c=function(n){return function(){return u.formatter.getCssText(n)}},e=Et(n,"style_formats").getOr(Zd),f=function(n){return Tn(n,function(n){if(At(n,"items")){var e=f(n.items);return mt(mt(n,{isSelected:h(!1),getPreview:h("")}),{items:e})}return At(n,"format")?mt(i=n,{isSelected:a(i.format),getPreview:c(i.format)}):(r=Ec((t=n).title),o=mt(t,{format:r,isSelected:a(r),getPreview:c(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return f(e)},hg=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Fn(n,function(n){return n.items===undefined?!At(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<o(n.items).length?[n]:[]})})(n),pg.expand(i));return dg({formats:u,handle:function(n,e){t.undoManager.transact(function(){Mi.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},bg=["undo","bold","italic","link","image","bullist","styleselect"],yg=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},xg=function(n){return Fn(n,function(n){return hn(n)?xg(n):yg(n)})},wg=function(n){var e=n.toolbar!==undefined?n.toolbar:bg;return hn(e)?xg(e):yg(e)},Sg=function(r,o){var n=function(n){return function(){return kf.forToolbarCommand(o,n)}},e=function(n){return function(){return kf.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return kf.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),a=e("bold"),c=e("italic"),f=e("underline"),s=n("removeformat"),l=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=vg(o,o.settings),p=function(){return hg(o,g,function(){o.fire("scrollIntoView")})},v=function(n,e){return{isSupported:function(){return n.forall(function(n){return At(o.buttons,n)})},sketch:e}};return{undo:v(E.none(),i),redo:v(E.none(),u),bold:v(E.none(),a),italic:v(E.none(),c),underline:v(E.none(),f),removeformat:v(E.none(),s),link:v(E.none(),function(){return e=r,t=o,kf.forToolbarStateAction(t,"link","link",function(){var n=Qd(e,t);e.setContextToolbar(n),md(t,function(){e.focusToolbar()}),sd.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:v(E.none(),l),image:v(E.none(),function(){return od(o)}),bullist:v(E.some("bullist"),d),numlist:v(E.some("numlist"),m),fontsizeselect:v(E.none(),function(){return n={onChange:function(n){Nl.apply(e,n)},getInitialValue:function(){return Nl.get(e)}},Ml(r,"font-size",function(){return jl(n)},e=o);var e,n}),forecolor:v(E.none(),function(){return Il(r,o)}),styleselect:v(E.none(),function(){return kf.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(p,Mi.on,n)},so([Mi.config({toggleClass:Fi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),vi.config({channels:Dt([Bi(Uo.orientationChanged(),Mi.off),Bi(Uo.dropupDismissed(),Mi.off)])})]),o)})}},Og=function(n,t){var e=wg(n),r={};return Fn(e,function(n){var e=!At(r,n)&&At(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},Tg=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,a,c=be.fromDom(n.target),f=function(){n.stopPropagation()},s=function(){n.preventDefault()},l=p(s,f),d=(e=c,t=n.clientX,r=n.clientY,o=f,i=s,u=l,a=n,{target:h(e),x:h(t),y:h(r),stop:o,prevent:i,kill:u,raw:h(a)});g(d)}}},kg=function(n,e,t,r,o){var i=Tg(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(Eg,n,e,i,o)}},Eg=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},Cg=h(!0),Dg=function(n,e,t){return kg(n,e,Cg,t,!1)},Mg=function(n,e,t){return kg(n,e,Cg,t,!0)},Ag=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:h(e)}},Ig=Ag,Bg=function(r,e){var n=be.fromDom(r),o=null,t=Dg(n,"orientationchange",function(){clearInterval(o);var n=Ag(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(E.some(r.innerHeight))):20<t&&(clearInterval(o),n(E.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},Rg=function(n){var e=Yn.detect().os.isiOS(),t=Ag(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Fg=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?E.none():E.some(e.touches[0])},Vg=function(t){var u=Fo(E.none()),r=function n(t,r){var o=null;return{cancel:function(){null!==o&&(v.clearTimeout(o),o=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];o=v.setTimeout(function(){t.apply(null,n),o=null},r)}}}(function(n){u.set(E.none()),t.triggerEvent(ie(),n)},400),o=Dt([{key:F(),value:function(t){return Fg(t).each(function(n){r.cancel();var e={x:h(n.clientX),y:h(n.clientY),target:t.target};r.schedule(t),u.set(E.some(e))}),E.none()}},{key:V(),value:function(n){return r.cancel(),Fg(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(E.none())})}),E.none()}},{key:N(),value:function(e){return r.cancel(),u.get().filter(function(n){return Ue(n.target(),e.target())}).map(function(n){return t.triggerEvent(re(),e)})}}]);return{fireIfReady:function(e,n){return Et(o,n).bind(function(n){return n(e)})}}},Ng=function(t){var e=Vg({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return Dg(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return Dg(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Hg=6<=Yn.detect().os.version.major,jg=function(r,e,t){var o=Ng(r),i=Ge(e),u=function(n){return!Ue(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||Ho(i).filter(function(n){return"input"===Se(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?Mi.on:Mi.off)},a=[Dg(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),Dg(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){No(r.body())}),r.onToEditing(x),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Hg?[]:[Dg(be.fromDom(r.win()),"blur",function(){t.getByDom(e).each(Mi.off)}),Dg(i,"select",n),Dg(r.doc(),"selectionchange",n)]);return{destroy:function(){kn(a,function(n){n.unbind()})}}},zg=function(n,e){var t=parseInt(yo(n,e),10);return isNaN(t)?0:t},Lg=function _h(t,r){var o=function(n){return t(n)?E.from(n.dom().nodeValue):E.none()},n=Yn.detect().browser,e=n.isIE()&&10===n.version.major?function(n){try{return o(n)}catch(e){return E.none()}}:o;return{get:function(n){if(!t(n))throw new Error("Can only get "+r+" value of a "+r+" node");return e(n).getOr("")},getOption:e,set:function(n,e){if(!t(n))throw new Error("Can only set raw "+r+" value of a "+r+" node");n.dom().nodeValue=e}}}(ke,"text"),Pg=function(n){return Lg.getOption(n)},Ug=st([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gg={before:Ug.before,on:Ug.on,after:Ug.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(b,b,b)}},$g=st([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Wg=Me("start","soffset","finish","foffset"),_g=$g.relative,qg=$g.exact,Xg=function(n,e,t,r){var o,i,u,a,c,f=(i=e,u=t,a=r,(c=Ge(o=n).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),s=Ue(n,t)&&e===r;return f.collapsed&&!s},Yg=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},Kg=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Jg=function(n){return{left:h(n.left),top:h(n.top),right:h(n.right),bottom:h(n.bottom),width:h(n.width),height:h(n.height)}},Qg=st([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Zg=function(n,e,t){return e(be.fromDom(t.startContainer),t.startOffset,be.fromDom(t.endContainer),t.endOffset)},np=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:h(n),rtl:E.none}},relative:function(n,e){return{ltr:X(function(){return Yg(o,n,e)}),rtl:X(function(){return E.some(Yg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:X(function(){return Kg(o,n,e,t,r)}),rtl:X(function(){return E.some(Kg(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Qg.rtl(be.fromDom(n.endContainer),n.endOffset,be.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Zg(0,Qg.ltr,r)}):Zg(0,Qg.ltr,r)},ep=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=Se(n);return"input"===t?Gg.after(n):Sn(["br","img"],t)?0===e?Gg.before(n):Gg.after(n):Gg.on(n,e)}),tp=function(n,e,t,r,o){var i,u,a=Kg(n,e,t,r,o);i=n,u=a,E.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},rp=function(n,e,t,r,o){var i,u,a,c,l,f=(i=r,u=o,a=ep(e,t),c=ep(i,u),_g(a,c));np(l=n,f).match({ltr:function(n,e,t,r){tp(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,a,c,f=l.getSelection();if(f.setBaseAndExtent)f.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(f.extend)try{i=n,u=e,a=t,c=r,(o=f).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(s){tp(l,t,r,n,e)}else tp(l,t,r,n,e)}})},op=function(n){var e=be.fromDom(n.anchorNode),t=be.fromDom(n.focusNode);return Xg(e,n.anchorOffset,t,n.focusOffset)?E.some(Wg(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return E.some(Wg(be.fromDom(e.startContainer),e.startOffset,be.fromDom(t.endContainer),t.endOffset))}return E.none()}(n)},ip=function(n){return E.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(op)},up=function(n,e){var i,t,r,o,u=np(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?E.some(o).map(Jg):E.none()},ap=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:h(2),height:n.height}},cp=function(n){return{left:h(n.left),top:h(n.top),right:h(n.right),bottom:h(n.bottom),width:h(n.width),height:h(n.height)}},fp=function(r){if(r.collapsed){var o=be.fromDom(r.startContainer);return $e(o).bind(function(n){var e,t=qg(o,r.startOffset,n,"img"===Se(e=n)?1:Pg(e).fold(function(){return We(e).length},function(n){return n.length}));return up(r.startContainer.ownerDocument.defaultView,t).map(ap).map(jn)}).getOr([])}return Tn(r.getClientRects(),cp)},sp=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?fp(e.getRangeAt(0)):[]},lp=function(n){n.focus();var e=be.fromDom(n.document.body);(Ho().exists(function(n){return Sn(["input","textarea"],Se(n))})?function(n){setTimeout(function(){n()},0)}:s)(function(){Ho().each(No),Vo(e)})},dp="data-"+Fi.resolve("last-outer-height"),mp=function(n,e){ho(n,dp,e)},gp=function(n){return{top:h(n.top()),bottom:h(n.top()+n.height())}},pp=function(n,e){var t=zg(e,dp),r=n.innerHeight;return r<t?E.some(t-r):E.none()},vp=function(n,u){var e=be.fromDom(u.document.body),t=Dg(be.fromDom(n),"resize",function(){pp(n,e).each(function(i){var n,e;(n=u,e=sp(n),0<e.length?E.some(e[0]).map(gp):E.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),mp(e,n.innerHeight)});return mp(e,n.innerHeight),{toEditing:function(){lp(u)},destroy:function(){t.unbind()}}},hp=function(n){return E.some(be.fromDom(n.dom().contentWindow.document.body))},bp=function(n){return E.some(be.fromDom(n.dom().contentWindow.document))},yp=function(n){return E.from(n.dom().contentWindow)},xp=function(n){return yp(n).bind(ip)},wp=function(n){return n.getFrame()},Sp=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=wp(e);return function(){return t(n)}})()}},Op=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return Dg(e,r,n)}})},Tp=function(n){return{left:h(n.left),top:h(n.top),right:h(n.right),bottom:h(n.bottom),width:h(n.width),height:h(n.height)}},kp={getBody:Sp("getBody",hp),getDoc:Sp("getDoc",bp),getWin:Sp("getWin",yp),getSelection:Sp("getSelection",xp),getFrame:wp,getActiveApi:function(a){var c=wp(a);return hp(c).bind(function(u){return bp(c).bind(function(i){return yp(c).map(function(o){var n=be.fromDom(i.dom().documentElement),e=a.getCursorBox.getOrThunk(function(){return function(){return(n=o,ip(n).map(function(n){return qg(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return up(o,n).orThunk(function(){return ip(o).filter(function(n){return Ue(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?E.some(e).map(Tp):E.none()})})});var n}}),t=a.setSelection.getOrThunk(function(){return function(n,e,t,r){rp(o,n,e,t,r)}}),r=a.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:h(u),doc:h(i),win:h(o),html:h(n),getSelection:l(xp,c),setSelection:t,clearSelection:r,frame:h(c),onKeyup:Op(a,i,"onKeyup","keyup"),onNodeChanged:Op(a,i,"onNodeChanged","selectionchange"),onDomChanged:a.onDomChanged,onScrollToCursor:a.onScrollToCursor,onScrollToElement:a.onScrollToElement,onToReading:a.onToReading,onToEditing:a.onToEditing,onToolbarScrollStart:a.onToolbarScrollStart,onTouchContent:a.onTouchContent,onTapContent:a.onTapContent,onTouchToolstrip:a.onTouchToolstrip,getCursorBox:e}})})})}},Ep="data-ephox-mobile-fullscreen-style",Cp="position:absolute!important;",Dp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Mp=Yn.detect().os.isAndroid(),Ap=function(n,e){var t,r,o,i=function(r){return function(n){var e=yo(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(ho(n,Ep,t),ho(n,"style",r))}},u=(t="*",nu(n,function(n){return je(n,t)},r)),a=Fn(u,function(n){var e;return e="*",eu(n,function(n){return je(n,e)})}),c=(o=$i(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";kn(a,i("display:none!important;")),kn(u,i(Cp+Dp+c)),i((!0===Mp?"":Cp)+Dp+c)(n)},Ip=function(){var n=Le("["+Ep+"]");kn(n,function(n){var e=yo(n,Ep);"no-styles"!==e?ho(n,"style",e):wo(n,"style"),wo(n,Ep)})},Bp=function(){var e=ru("head").getOrDie(),n=ru('meta[name="viewport"]').getOrThunk(function(){var n=be.fromTag("meta");return ho(n,"name","viewport"),Ke(e,n),n}),t=yo(n,"content");return{maximize:function(){ho(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?ho(n,"content",t):ho(n,"content","user-scalable=yes")}}},Rp=function(e,n){var t=Bp(),r=_d(),o=_d();return{enter:function(){n.hide(),Eo(e.container,Fi.resolve("fullscreen-maximized")),Eo(e.container,Fi.resolve("android-maximized")),t.maximize(),Eo(e.body,Fi.resolve("android-scroll-reload")),r.set(vp(e.win,kp.getWin(e.editor).getOrDie("no"))),kp.getActiveApi(e.editor).each(function(n){Ap(e.container,n.body()),o.set(jg(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),Do(e.container,Fi.resolve("fullscreen-maximized")),Do(e.container,Fi.resolve("android-maximized")),Ip(),Do(e.body,Fi.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Fp=function(t,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout(function(){t.apply(null,n),o=null},r)}}},Vp=function(n,e){var t,r,o,i=zl(bd.sketch({dom:xf('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:so([Mi.config({toggleClass:Fi.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=setTimeout(function(){t.apply(null,n),o=null},r))}});return bd.sketch({dom:xf('<div class="${prefix}-disabled-mask"></div>'),components:[bd.sketch({dom:xf('<div class="${prefix}-content-container"></div>'),components:[hf.sketch({dom:xf('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:so([Mi.config({toggleClass:Fi.resolve("mask-tap-icon-selected")})])})]})]})},Np=ur([kr("editor",[Or("getFrame"),Er("getBody"),Er("getDoc"),Er("getWin"),Er("getSelection"),Er("setSelection"),Er("clearSelection"),Er("cursorSaver"),Er("onKeyup"),Er("onNodeChanged"),Er("getCursorBox"),Or("onDomChanged"),Mr("onTouchContent",x),Mr("onTapContent",x),Mr("onTouchToolstrip",x),Mr("onScrollToCursor",h({unbind:x})),Mr("onScrollToElement",h({unbind:x})),Mr("onToEditing",h({unbind:x})),Mr("onToReading",h({unbind:x})),Mr("onToolbarScrollStart",b)]),Or("socket"),Or("toolstrip"),Or("dropup"),Or("toolbar"),Or("container"),Or("alloy"),Ir("win",function(n){return Ge(n.socket).dom().defaultView}),Ir("body",function(n){return be.fromDom(n.socket.dom().ownerDocument.body)}),Mr("translate",b),Mr("setReadOnly",x),Mr("readOnlyOnInit",h(!0))]),Hp=function(n){var e=br("Getting AndroidWebapp schema",Np,n);Ui(e.toolstrip,"width","100%");var t=km(Vp(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};Ke(e.container,t.element());var o=Rp(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:x,enter:o.enter,exit:o.exit,destroy:x}},jp=h([Mr("shell",!0),dc("toolbarBehaviours",[_m])]),zp=h([Pc({name:"groups",overrides:function(n){return{behaviours:so([_m.config({})])}}})]),Lp=vf({name:"Toolbar",configFields:jp(),partFields:zp(),factory:function(e,n,t,r){var o=function(n){return e.shell?E.some(n):Yc(n,e,"groups")},i=e.shell?{behaviours:[_m.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:gc(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,e){o(n).fold(function(){throw v.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){_m.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Pp=h([Or("items"),(ed=["itemSelector"],kr("markers",Tn(ed,Or))),dc("tgroupBehaviours",[lc])]),Up=h([Uc({name:"items",unit:"item"})]),Gp=vf({name:"ToolbarGroup",configFields:Pp(),partFields:Up(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,components:e,behaviours:gc(n.tgroupBehaviours,[lc.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),$p="data-"+Fi.resolve("horizontal-scroll"),Wp=function(n){return"true"===yo(n,$p)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},_p={exclusive:function(n,e){return Dg(n,"touchmove",function(n){uu(n.target(),e).filter(Wp).fold(function(){n.raw().preventDefault()},x)})},markAsHorizontal:function(n){ho(n,$p,"true")}};function qp(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:xf('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:so([gd("adhoc-scrollable-toolbar",!0===n.scrollable?[Qr(function(n,e){Ui(n.element(),"overflow-x","auto"),_p.markAsHorizontal(n.element()),cg.register(n.element())})]:[])]),components:[bd.sketch({components:[Gp.parts().items({})]})],markers:{itemSelector:"."+Fi.resolve("toolbar-group-item")},items:n.items}},t=km(Lp.sketch({dom:xf('<div class="${prefix}-toolbar"></div>'),components:[Lp.parts().groups({})],toolbarBehaviours:so([Mi.config({toggleClass:Fi.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),lc.config({mode:"cyclic"})]),shell:!0})),n=km(bd.sketch({dom:{classes:[Fi.resolve("toolstrip")]},components:[Em(t)],containerBehaviours:so([Mi.config({toggleClass:Fi.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Lp.setGroups(t,o.get()),Mi.off(t)},o=Fo([]);return{wrapper:h(n),toolbar:h(t),createGroups:function(n){return Tn(n,p(Gp.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){Mi.on(t),Lp.setGroups(t,n)},restoreToolbar:function(){Mi.isOn(t)&&r()},refresh:function(){},focus:function(){lc.focusIn(t)}}}var Xp,Yp=function(n,e){_m.append(n,Em(e))},Kp=function(n,e){_m.remove(n,e)},Jp=function(n){return km(hf.sketch({dom:xf('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Qp=function(){return km(bd.sketch({dom:xf('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:so([_m.config({})])}))},Zp=function(n,e,t,r){(!0===t?Ro.toAlpha:Ro.toOmega)(r),(t?Yp:Kp)(n,e)},nv=function(e,n){return n.getAnimationRoot.fold(function(){return e.element()},function(n){return n(e)})},ev=function(n){return n.dimension.property},tv=function(n,e){return n.dimension.getDimension(e)},rv=function(n,e){var t=nv(n,e);pm(t,[e.shrinkingClass,e.growingClass])},ov=function(n,e){Do(n.element(),e.openClass),Eo(n.element(),e.closedClass),Ui(n.element(),ev(e),"0px"),Xi(n.element())},iv=function(n,e){Do(n.element(),e.closedClass),Eo(n.element(),e.openClass),qi(n.element(),ev(e))},uv=function(n,e,t,r){t.setCollapsed(),Ui(n.element(),ev(e),tv(e,n.element())),Xi(n.element()),rv(n,e),ov(n,e),e.onStartShrink(n),e.onShrunk(n)},av=function(n,e,t,r){var o=r.getOrThunk(function(){return tv(e,n.element())});t.setCollapsed(),Ui(n.element(),ev(e),o),Xi(n.element());var i=nv(n,e);Do(i,e.growingClass),Eo(i,e.shrinkingClass),ov(n,e),e.onStartShrink(n)},cv=function(n,e,t){var r=tv(e,n.element());("0px"===r?uv:av)(n,e,t,E.some(r))},fv=function(n,e,t){var r=nv(n,e),o=Mo(r,e.shrinkingClass),i=tv(e,n.element());iv(n,e);var u=tv(e,n.element());(o?function(){Ui(n.element(),ev(e),i),Xi(n.element())}:function(){ov(n,e)})(),Do(r,e.shrinkingClass),Eo(r,e.growingClass),iv(n,e),Ui(n.element(),ev(e),u),t.setExpanded(),e.onStartGrow(n)},sv=function(n,e,t){var r=nv(n,e);return!0===Mo(r,e.growingClass)},lv=function(n,e,t){var r=nv(n,e);return!0===Mo(r,e.shrinkingClass)},dv=/* */Object.freeze({refresh:function(n,e,t){if(t.isExpanded()){qi(n.element(),ev(e));var r=tv(e,n.element());Ui(n.element(),ev(e),r)}},grow:function(n,e,t){t.isExpanded()||fv(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&cv(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&uv(n,e,t,E.none())},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:sv,isShrinking:lv,isTransitioning:function(n,e,t){return!0===sv(n,e)||!0===lv(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?cv:fv)(n,e,t)},disableTransitions:rv}),mv=/* */Object.freeze({exhibit:function(n,e){var t=e.expanded;return to(t?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Ct(e.dimension.property,"0px")})},events:function(t,r){return Gr([(n=_(),e=function(n,e){e.event().raw().propertyName===t.dimension.property&&(rv(n,t),r.isExpanded()&&qi(n.element(),t.dimension.property),(r.isExpanded()?t.onGrown:t.onShrunk)(n))},qr(n)(e))]);var n,e}}),gv=[Or("closedClass"),Or("openClass"),Or("shrinkingClass"),Or("growingClass"),Er("getAnimationRoot"),ci("onShrunk"),ci("onStartShrink"),ci("onGrown"),ci("onStartGrow"),Mr("expanded",!1),Tr("dimension",xr("property",{width:[di("property","width"),di("getDimension",function(n){return cs(n)+"px"})],height:[di("property","height"),di("getDimension",function(n){return Zi(n)+"px"})]}))],pv=mo({fields:gv,name:"sliding",active:mv,apis:dv,state:/* */Object.freeze({init:function(n){var e=Fo(n.expanded);return fo({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:l(e.set,!1),setExpanded:l(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),vv=function(e,t){var r=km(bd.sketch({dom:{tag:"div",classes:[Fi.resolve("dropup")]},components:[],containerBehaviours:so([_m.config({}),pv.config({closedClass:Fi.resolve("dropup-closed"),openClass:Fi.resolve("dropup-open"),shrinkingClass:Fi.resolve("dropup-shrinking"),growingClass:Fi.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),_m.set(n,[])},onGrown:function(n){e(),t()}}),Ii(function(n,e){o(x)})])})),o=function(n){v.window.requestAnimationFrame(function(){n(),pv.shrink(r)})};return{appear:function(n,e,t){!0===pv.hasShrunk(r)&&!1===pv.isTransitioning(r)&&v.window.requestAnimationFrame(function(){e(t),_m.set(r,[n()]),pv.grow(r)})},disappear:o,component:h(r),element:r.element}},hv=function(n){var e,t;return 8===n.raw().which&&!Sn(["input","textarea"],Se(n.target()))&&(e=n.target(),!uu(e,'[contenteditable="true"]',t).isSome())},bv=Yn.detect().browser.isFirefox(),yv=ir([(Xp="triggerEvent",Tr(Xp,Sr)),Mr("stopBackspace",!0)]),xv=function(e,n){var t,r,o,i,u=br("Getting GUI events settings",yv,n),a=Yn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=Vg(u),f=Tn(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return Dg(e,n,function(e){c.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),s=Fo(E.none()),l=Dg(e,"paste",function(e){c.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),u.triggerEvent("paste",e)&&e.kill(),s.set(E.some(v.setTimeout(function(){u.triggerEvent(Zn(),e)},0)))}),d=Dg(e,"keydown",function(n){u.triggerEvent("keydown",n)?n.kill():!0===u.stopBackspace&&hv(n)&&n.prevent()}),m=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},bv?Mg(t,"focus",r):Dg(t,"focusin",r)),g=Fo(E.none()),p=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),g.set(E.some(v.setTimeout(function(){u.triggerEvent(Qn(),n)},0)))},bv?Mg(o,"blur",i):Dg(o,"focusout",i));return{unbind:function(){kn(f,function(n){n.unbind()}),d.unbind(),m.unbind(),p.unbind(),l.unbind(),s.get().each(v.clearTimeout),g.get().each(v.clearTimeout)}}},wv=function(n,e){var t=Et(n,"target").map(function(n){return n()}).getOr(e);return Fo(t)},Sv=st([{stopped:[]},{resume:["element"]},{complete:[]}]),Ov=function(n,r,e,t,o,i){var u,a,c,f,s=n(r,t),l=(u=e,a=o,c=Fo(!1),f=Fo(!1),{stop:function(){c.set(!0)},cut:function(){f.set(!0)},isStopped:c.get,isCut:f.get,event:h(u),setSource:a.set,getSource:a.get});return s.fold(function(){return i.logEventNoHandlers(r,t),Sv.complete()},function(e){var t=e.descHandler();return am(t)(l),l.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),Sv.stopped()):l.isCut()?(i.logEventCut(r,e.element(),t.purpose()),Sv.complete()):$e(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),Sv.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),Sv.resume(n)})})},Tv=function(e,t,r,n,o,i){return Ov(e,t,r,n,o,i).fold(function(){return!0},function(n){return Tv(e,t,r,n,o,i)},function(){return!1})},kv=function(n,e,t){var r,o,i=(r=e,o=Fo(!1),{stop:function(){o.set(!0)},cut:x,isStopped:o.get,isCut:h(!1),event:h(r),setSource:f("Cannot set source of a broadcasted event"),getSource:f("Cannot get source of a broadcasted event")});return kn(n,function(n){var e=n.descHandler();am(e)(i)}),i.isStopped()},Ev=function(n,e,t,r,o){var i=wv(t,r);return Tv(n,e,t,r,i,o)},Cv=Me("element","descHandler"),Dv=function(n,e){return{id:h(n),descHandler:h(e)}};function Mv(){var i={};return{registerId:function(r,o,n){M(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=um(n,r),i[e]=t})},unregisterId:function(t){M(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return Et(i,n).map(function(n){return B(n,function(n,e){return Dv(e,n)})}).getOr([])},find:function(n,e,t){var o=Tt(e)(i);return Ur(t,function(n){return t=o,cf(r=n).fold(function(){return E.none()},function(n){var e=Tt(n);return t.bind(e).map(function(n){return Cv(r,n)})});var t,r},n)}}}function Av(){var r=Mv(),o={},i=function(r){var n=r.element();return cf(n).fold(function(){return n="uid-",e=r.element(),t=Ec(of+n),af(e,t),t;var n,e,t},function(n){return n})},u=function(n){cf(n.element()).each(function(n){delete o[n],r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);At(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+qo(t.element())+"\nCannot use it for: "+qo(n.element())+"\nThe conflicting element is"+(Ee(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return Tt(n)(o)}}}var Iv=function(t){var r=function(e){return $e(t.element()).fold(function(){return!0},function(n){return Ue(e,n)})},o=Av(),f=function(n,e){return o.find(r,n,e)},n=xv(t.element(),{triggerEvent:function(u,a){return ei(u,a.target(),function(n){return e=f,t=u,o=n,i=(r=a).target(),Ev(e,t,r,i,o);var e,t,r,o,i})}}),i={debugInfo:h("real"),triggerEvent:function(e,t,r){ei(e,t,function(n){Ev(f,e,r,t,n)})},triggerFocus:function(a,c){cf(a).fold(function(){Vo(a)},function(n){ei(Jn(),a,function(n){var e,t,r,o,i,u;e=f,t=Jn(),r={originator:h(c),kill:x,prevent:x,target:h(a)},i=n,u=wv(r,o=a),Ov(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:km,addToGui:function(n){a(n)},removeFromGui:function(n){c(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){m(n,e)},isConnected:h(!0)},e=function(n){n.connect(i),ke(n.element())||(o.register(n),kn(n.components(),e),i.triggerEvent(ue(),n.element(),{target:h(n.element())}))},u=function(n){ke(n.element())||(kn(n.components(),u),o.unregister(n)),n.disconnect()},a=function(n){tt(t,n)},c=function(n){it(n)},s=function(t){var n=o.filter(ne());kn(n,function(n){var e=n.descHandler();am(e)(t)})},l=function(n){s({universal:h(!0),data:h(n)})},d=function(n,e){s({universal:h(!1),channels:h(n),data:h(e)})},m=function(n,e){var t=o.filter(n);return kv(t,e)},g=function(n){return o.getById(n).fold(function(){return ft.error(new Error('Could not find component with uid: "'+n+'" in system.'))},ft.value)},p=function(n){var e=cf(n).getOr("not found");return g(e)};return e(t),{root:h(t),element:t.element,destroy:function(){n.unbind(),Ze(t.element())},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d,broadcastEvent:m}},Bv=h(Fi.resolve("readonly-mode")),Rv=h(Fi.resolve("edit-mode"));function Fv(n){var e=km(bd.sketch({dom:{classes:[Fi.resolve("outer-container")].concat(n.classes)},containerBehaviours:so([Ro.config({alpha:Bv(),omega:Rv()})])}));return Iv(e)}var Vv=function(n,e){var t=be.fromTag("input");Gi(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Ke(n,t),Vo(t),e(t),Ze(t)},Nv=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Hv=function(n,e){Ho().each(function(n){Ue(n,e)||No(n)}),n.focus(),Vo(be.fromDom(n.document.body)),Nv(n)},jv={stubborn:function(n,e,t,r){var o=function(){Hv(e,r)},i=Dg(t,"keydown",function(n){Sn(["input","textarea"],Se(n.target()))||o()});return{toReading:function(){Vv(n,No)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){No(r)};return{toReading:function(){o()},toEditing:function(){Hv(e,r)},onToolbarTouch:function(){o()},destroy:x}}},zv=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},a=function(){r.run(function(n){n.clearSelection()})},c=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},f=Ng(t),s=Fp(c,300),l=[t.onKeyup(function(){a(),s.throttle()}),t.onNodeChanged(u),t.onDomChanged(s.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),s.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),Dg(t.doc(),"touchend",function(n){Ue(t.html(),n.target())||Ue(t.body(),n.target())}),Dg(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Zi(o),r.run(function(n){n.setViewportOffset(e)}),u(),c())}),Mg(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),Dg(t.body(),"touchstart",function(n){a(),t.onTouchContent(),f.fireTouchstart(n)}),f.onTouchmove(),f.onTouchend(),Dg(t.body(),"click",function(n){n.kill()}),Dg(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){kn(l,function(n){n.unbind()})}}},Lv=function(n){var t=E.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){kn(n,u)},u=function(e){t.each(function(n){setTimeout(function(){e(n)},0)})};return n(function(n){t=E.some(n),i(e),e=[]}),{get:r,map:function(t){return Lv(function(e){r(function(n){e(t(n))})})},isReady:o}},Pv={nu:Lv,pure:function(e){return Lv(function(n){n(e)})}},Uv=function(e){var n=function(n){var r;e((r=n,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=this;setTimeout(function(){r.apply(t,n)},0)}))},t=function(){return Pv.nu(n)};return{map:function(r){return Uv(function(t){n(function(n){var e=r(n);t(e)})})},bind:function(t){return Uv(function(e){n(function(n){t(n).get(e)})})},anonBind:function(t){return Uv(function(e){n(function(n){t.get(e)})})},toLazy:t,toCached:function(){var e=null;return Uv(function(n){null===e&&(e=t()),e.get(n)})},get:n}},Gv={nu:Uv,pure:function(e){return Uv(function(n){n(e)})}},$v=function(n,e,t){return Math.abs(n-e)<=t?E.none():n<e?E.some(n+t):E.some(n-t)},Wv=function(){var f=null;return{animate:function(r,o,n,i,e,t){var u=!1,a=function(n){u=!0,e(n)};clearInterval(f);var c=function(n){clearInterval(f),a(n)};f=setInterval(function(){var t=r();$v(t,o,n).fold(function(){clearInterval(f),a(o)},function(n){if(i(n,c),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(f),a(o))}})},t)}}},_v=function(e,t){return Ko([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e<=n.width&&t<=n.height?E.some(n.keyboard):E.none()}).getOr({portrait:t/5,landscape:e/4})},qv=function(n){var e,t=Ig(n).isPortrait(),r=_v((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Xv=function(n,e){var t=Ge(n).dom().defaultView;return Zi(n)+Zi(e)-qv(t)},Yv=Xv,Kv=function(n,e,t){var r=Xv(e,t),o=Zi(e)+Zi(t)-r;Ui(n,"padding-bottom",o+"px")},Jv=st([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Qv="data-"+Fi.resolve("position-y-fixed"),Zv="data-"+Fi.resolve("y-property"),nh="data-"+Fi.resolve("scrolling"),eh="data-"+Fi.resolve("last-window-height"),th=function(n){return zg(n,Qv)},rh=function(n,e){var t=yo(n,Zv);return Jv.fixed(n,t,e)},oh=function(n,e){return Jv.scroller(n,e)},ih=function(n){var e=th(n);return("true"===yo(n,nh)?oh:rh)(n,e)},uh=function(n,e,t){var r=Ge(n).dom().defaultView.innerHeight;return ho(n,eh,r+"px"),r-e-t},ah=function(n){var e=tu(n,"["+Qv+"]");return Tn(e,ih)},ch=function(r,o,i,u){var n,e,t,a,c,f,s,l,d=Ge(r).dom().defaultView,m=(l=yo(s=i,"style"),Gi(s,{position:"absolute",top:"0px"}),ho(s,Qv,"0px"),ho(s,Zv,"top"),{restore:function(){ho(s,"style",l||""),wo(s,Qv),wo(s,Zv)}}),g=Zi(i),p=Zi(u),v=uh(r,g,p),h=(t=g,a=v,f=yo(c=r,"style"),cg.register(c),Gi(c,{position:"absolute",height:a+"px",width:"100%",top:t+"px"}),ho(c,Qv,t+"px"),ho(c,nh,"true"),ho(c,Zv,"top"),{restore:function(){cg.deregister(c),ho(c,"style",f||""),wo(c,Qv),wo(c,nh),wo(c,Zv)}}),b=(e=yo(n=u,"style"),Gi(n,{position:"absolute",bottom:"0px"}),ho(n,Qv,"0px"),ho(n,Zv,"bottom"),{restore:function(){ho(n,"style",e||""),wo(n,Qv),wo(n,Zv)}}),y=!0,x=function(){var n=d.innerHeight;return zg(r,eh)<n},w=function(){if(y){var n=Zi(i),e=Zi(u),t=uh(r,n,e);ho(r,Qv,n+"px"),Ui(r,"height",t+"px"),Ui(u,"bottom",-(n+t+e)+"px"),Kv(o,r,u)}};return Kv(o,r,u),{setViewportOffset:function(n){ho(r,Qv,n+"px"),w()},isExpanding:x,isShrinking:S(x),refresh:w,restore:function(){y=!1,m.restore(),h.restore(),b.restore()}}},fh=th,sh=Wv(),lh="data-"+Fi.resolve("last-scroll-top"),dh=function(n){var e=_i(n,"top").getOr("0");return parseInt(e,10)},mh=function(n){return parseInt(n.dom().scrollTop,10)},gh=function(n,e){var t=e+fh(n)+"px";Ui(n,"top",t)},ph=function(t,r,o){return Gv.nu(function(n){var e=l(mh,t);sh.animate(e,r,15,function(n){t.dom().scrollTop=n,Ui(t,"top",dh(t)+15+"px")},function(){t.dom().scrollTop=r,Ui(t,"top",o+"px"),n(r)},10)})},vh=function(o,i){return Gv.nu(function(n){var e=l(mh,o);ho(o,lh,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);sh.animate(e,i,r,function(n,e){zg(o,lh)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,ho(o,lh,n))},function(){o.dom().scrollTop=i,ho(o,lh,i),n(i)},10)})},hh=function(i,u){return Gv.nu(function(n){var e=l(dh,i),t=function(n){Ui(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);sh.animate(e,u,o,t,function(){t(u),n(u)},10)})},bh=function(e,t,r){var o=Ge(e).dom().defaultView;return Gv.nu(function(n){gh(e,r),gh(t,r),o.scrollTo(0,r),n(r)})},yh=function(n,e,t,r,o){var i=Yv(e,t),u=l(Nv,n);i<r||i<o?vh(e,e.dom().scrollTop-i+o).get(u):r<0&&vh(e,e.dom().scrollTop+r).get(u)},xh=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):kn(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},wh=function(n,c){return n.fold(function(n,e,t){return Ui(n,e,c+(r=t)+"px"),Gv.pure(r);var r},function(n,e){return o=c+(r=e),i=_i(t=n,"top").getOr(r),u=o-parseInt(i,10),a=t.dom().scrollTop+u,ph(t,a,o);var t,r,o,i,u,a})},Sh=function(n,e){var t=ah(n),r=Tn(t,function(n){return wh(n,e)});return xh(r,Gv.nu)},Oh=function(e,t,n,r,o,i){var u=function f(t){var r=Fo(Pv.pure({}));return{start:function(e){var n=Pv.nu(function(n){return t(e).get(n)});r.set(n)},idle:function(n){r.get().get(function(){n()})}}}(function(n){return bh(e,t,n)}),a=Fp(function(){u.idle(function(){Sh(n,r.pageYOffset).get(function(){var n;(n=sp(i),E.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?E.some({top:h(e),bottom:h(e+n.height())}):E.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),u.start(0),o.refresh()})})},1e3),c=Dg(be.fromDom(r),"scroll",function(){r.pageYOffset<0||a.throttle()});return Sh(n,r.pageYOffset).get(b),{unbind:c.unbind}},Th=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),a=n.keyboardType(),c=n.outerWindow(),f=n.dropup(),s=ch(r,e,o,f),l=a(n.outerBody(),t,Ce(),u,o,i),d=Bg(c,{onChange:x,onReady:s.refresh});d.onAdjustment(function(){s.refresh()});var m=Dg(be.fromDom(c),"resize",function(){s.isExpanding()&&s.refresh()}),g=Oh(o,r,n.outerBody(),c,s,t),p=function h(t,e){var n=t.document,r=be.fromTag("div");Eo(r,Fi.resolve("unfocused-selections")),Ke(be.fromDom(n.documentElement),r);var o=Dg(r,"touchstart",function(n){n.prevent(),Hv(t,e),u()}),i=function(n){var e=be.fromTag("span");return gm(e,[Fi.resolve("layer-editor"),Fi.resolve("unfocused-selection")]),Gi(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Qe(r)};return{update:function(){u();var n=sp(t),e=Tn(n,i);Je(r,e)},isActive:function(){return 0<We(r).length},destroy:function(){o.unbind(),Ze(r)},clear:u}}(t,u),v=function(){p.clear()};return{toEditing:function(){l.toEditing(),v()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:v,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){yh(t,r,f,n,e)},updateToolbarPadding:x,setViewportOffset:function(n){s.setViewportOffset(n),hh(r,n).get(b)},syncHeight:function(){Ui(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:s.refresh,destroy:function(){s.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),Vv(Ce(),No)}}},kh=function(r,n){var o=Bp(),i=qd(),u=qd(),a=_d(),c=_d();return{enter:function(){n.hide();var t=be.fromDom(v.document);kp.getActiveApi(r.editor).each(function(n){i.set({socketHeight:_i(r.socket,"height"),iframeHeight:_i(n.frame(),"height"),outerScroll:v.document.body.scrollTop}),u.set({exclusives:_p.exclusive(t,"."+cg.scrollable())}),Eo(r.container,Fi.resolve("fullscreen-maximized")),Ap(r.container,n.body()),o.maximize(),Ui(r.socket,"overflow","scroll"),Ui(r.socket,"-webkit-overflow-scrolling","touch"),Vo(n.body());var e=Be(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);a.set(Th(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:x,outerBody:r.body,outerWindow:r.win,keyboardType:jv.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),a.run(function(n){n.syncHeight()}),c.set(zv(n,a,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){a.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),c.clear(),a.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){Ui(r.socket,"height",n)}),n.iframeHeight.each(function(n){Ui(r.editor.getFrame(),"height",n)}),v.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),Do(r.container,Fi.resolve("fullscreen-maximized")),Ip(),cg.deregister(r.toolbar),qi(r.socket,"overflow"),qi(r.socket,"-webkit-overflow-scrolling"),No(r.editor.getFrame()),kp.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Eh=function(n){var e=br("Getting IosWebapp schema",Np,n);Ui(e.toolstrip,"width","100%"),Ui(e.container,"position","relative");var t=km(Vp(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=kh(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:x}},Ch=tinymce.util.Tools.resolve("tinymce.EditorManager"),Dh=function(n){var e=Et(n.settings,"skin_url").fold(function(){return Ch.baseURL+"/skins/ui/oxide"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},Mh=function(n,e,t){n.system().broadcastOn([Uo.formatChanged()],{command:e,state:t})},Ah=function(r,n){var e=C(n.formatter.get());kn(e,function(e){n.formatter.formatChanged(e,function(n){Mh(r,e,n)})}),kn(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){Mh(r,t,n)})})},Ih=(h(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Bh=h("toReading"),Rh=h("toEditing"),Fh=function(p){return{getNotificationManagerImpl:function(){return{open:h({progressBar:{value:x},close:x}),close:x,reposition:x,getArgs:b}},renderUI:function(){var n=p.getElement(),e=Dh(p);0==(!1===p.settings.skin)?(p.contentCSS.push(e.content),zo.DOM.styleSheetLoader.load(e.ui,Ih(p))):Ih(p)();var t,r,o=function(){p.fire("scrollIntoView")},i=be.fromTag("div"),f=Yn.detect().os.isAndroid()?function m(n){var e=Fv({classes:[Fi.resolve("android-container")]}),t=qp(),r=_d(),o=Jp(r),i=Qp(),u=vv(x,n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:h(e),element:e.element,init:function(n){r.set(Hp(n))},exit:function(){r.run(function(n){n.exit(),_m.remove(i,o)})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){Zp(i,o,n,e.root())},socket:h(i),dropup:h(u)}}(o):function g(n){var e=Fv({classes:[Fi.resolve("ios-container")]}),t=qp(),r=_d(),o=Jp(r),i=Qp(),u=vv(function(){r.run(function(n){n.refreshStructure()})},n);return e.add(t.wrapper()),e.add(i),e.add(u.component()),{system:h(e),element:e.element,init:function(n){r.set(Eh(n))},exit:function(){r.run(function(n){_m.remove(i,o),n.exit()})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){Zp(i,o,n,e.root())},socket:h(i),dropup:h(u)}}(o),u=be.fromDom(n);Xe(u,i),t=i,r=f.system(),ut(t,r,Ke);var a=n.ownerDocument.defaultView,s=Bg(a,{onChange:function(){f.system().broadcastOn([Uo.orientationChanged()],{width:Rg(a)})},onReady:x}),l=function(n,e,t,r){!1===r&&p.selection.collapse();var o=c(n,e,t);f.setToolbarGroups(!0===r?o.readOnly:o.main),p.setMode(!0===r?"readonly":"design"),p.fire(!0===r?Bh():Rh()),f.updateMode(r)},c=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},d=function(n,e){return p.on(n,e),{unbind:function(){p.off(n)}}};return p.on("init",function(){f.init({editor:{getFrame:function(){return be.fromDom(p.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:x}},onToReading:function(n){return d(Bh(),n)},onToEditing:function(n){return d(Rh(),n)},onScrollToCursor:function(e){return p.on("scrollIntoView",function(n){e(n)}),{unbind:function(){p.off("scrollIntoView"),s.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=be.fromDom(p.editorContainer.querySelector("."+Fi.resolve("toolbar")));(n=e,jo(n).bind(function(n){return f.system().getByDom(n).toOption()})).each(ge),f.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===Se(e)?(p.selection.select(e.dom()),n.kill()):"a"===Se(e)&&f.system().getByDom(be.fromDom(p.editorContainer)).each(function(n){Ro.isAlpha(n)&&Po(e.dom())})}},container:be.fromDom(p.editorContainer),socket:be.fromDom(p.contentAreaContainer),toolstrip:be.fromDom(p.editorContainer.querySelector("."+Fi.resolve("toolstrip"))),toolbar:be.fromDom(p.editorContainer.querySelector("."+Fi.resolve("toolbar"))),dropup:f.dropup(),alloy:f.system(),translate:x,setReadOnly:function(n){l(c,a,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){f.dropup().disappear(function(){f.system().broadcastOn([Uo.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[kf.forToolbar("back",function(){p.selection.collapse(),f.exit()},{},p)]},e={label:"Back to read only",scrollable:!1,items:[kf.forToolbar("readonly-back",function(){l(c,a,u,!0)},{},p)]},r=Sg(f,p),o=Og(p.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=Fo([{label:"the action group",scrollable:!0,items:o},i]),a=Fo([{label:"The read only mode group",scrollable:!0,items:[]},i]),c=Fo({backToMask:[n],backToReadOnly:[e]});Ah(f,p)}),{iframeContainer:f.socket().element().dom(),editorContainer:f.element().dom()}}}};Lo.add("mobile",Fh),n.renderMobileTheme=Fh,n["default"]=function qh(){}}({},window);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ *
7
+ * Version: 5.0.2 (2019-03-05)
8
+ */
9
+ !function(h){"use strict";var Q=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},p=function(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}},Z=function(t){return function(){return t}},d=function(t){return t};function v(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}var t,n,e,o,r,s,i,m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},u=function(t){return function(){throw new Error(t)}},a=Z(!1),c=Z(!0),f=a,l=c,g=function(){return b},b=(o={fold:function(t,n){return t()},is:f,isSome:f,isNone:l,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:n,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:f,forall:l,filter:g,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:Z("none()")},Object.freeze&&Object.freeze(o),o),y=function(e){var t=function(){return e},n=function(){return r},o=function(t){return t(e)},r={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:l,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return y(t(e))},ap:function(t){return t.fold(g,function(t){return y(t(e))})},each:function(t){t(e)},bind:o,flatten:t,exists:o,forall:o,filter:function(t){return t(e)?r:b},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(f,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},tt={some:y,none:g,from:function(t){return null===t||t===undefined?b:y(t)}},x=function(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&Array.prototype.isPrototypeOf(t)?"array":"object"===n&&String.prototype.isPrototypeOf(t)?"string":n}(t)===n}},w=x("string"),S=x("object"),E=x("array"),C=x("boolean"),k=x("function"),O=x("number"),T=(r=Array.prototype.indexOf)===undefined?function(t,n){return N(t,n)}:function(t,n){return r.call(t,n)},B=function(t,n){return-1<T(t,n)},A=function(t,n){return H(t,n).isSome()},D=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=t.slice(o,o+n);e.push(r)}return e},_=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r,t)}return o},M=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e,t)},F=function(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o,t)&&e.push(i)}return e},I=function(t,n,e){return function(t,n){for(var e=t.length-1;0<=e;e--)n(t[e],e,t)}(t,function(t){e=n(e,t)}),e},V=function(t,n,e){return M(t,function(t){e=n(e,t)}),e},R=function(t,n){for(var e=0,o=t.length;e<o;e++){var r=t[e];if(n(r,e,t))return tt.some(r)}return tt.none()},H=function(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e,t))return tt.some(e);return tt.none()},N=function(t,n){for(var e=0,o=t.length;e<o;++e)if(t[e]===n)return e;return-1},P=Array.prototype.push,z=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!Array.prototype.isPrototypeOf(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);P.apply(n,t[e])}return n},L=function(t,n){var e=_(t,n);return z(e)},j=function(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e,t))return!1;return!0},U=Array.prototype.slice,W=function(t){var n=U.call(t,0);return n.reverse(),n},G=function(t,n){return F(t,function(t){return!B(n,t)})},X=function(t){return[t]},Y=function(t){return 0===t.length?tt.none():tt.some(t[0])},q=function(t){return 0===t.length?tt.none():tt.some(t[t.length-1])},K=k(Array.from)?Array.from:function(t){return U.call(t)},J=Object.keys,$=Object.hasOwnProperty,nt=function(t,n){for(var e=J(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i,t)}},et=function(t,o){return ot(t,function(t,n,e){return{k:n,v:o(t,n,e)}})},ot=function(o,r){var i={};return nt(o,function(t,n){var e=r(t,n,o);i[e.k]=e.v}),i},rt=function(t,e){var o=[];return nt(t,function(t,n){o.push(e(t,n))}),o},it=function(t){return rt(t,function(t){return t})},ut=function(t,n){return at(t,n)?tt.some(t[n]):tt.none()},at=function(t,n){return $.call(t,n)},ct=function(n){return function(t){return at(t,n)?tt.from(t[n]):tt.none()}},st=function(t,n){return ct(n)(t)},ft=function(t,n){var e={};return e[t]=n,e},lt=function(e){return{is:function(t){return e===t},isValue:c,isError:a,getOr:Z(e),getOrThunk:Z(e),getOrDie:Z(e),or:function(t){return lt(e)},orThunk:function(t){return lt(e)},fold:function(t,n){return n(e)},map:function(t){return lt(t(e))},mapError:function(t){return lt(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return tt.some(e)}}},dt=function(e){return{is:a,isValue:a,isError:c,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return dt(e)},mapError:function(t){return dt(t(e))},each:Q,bind:function(t){return dt(e)},exists:a,forall:c,toOption:tt.none}},mt={value:lt,error:dt},gt=function(u){if(!E(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return M(u,function(t,o){var n=J(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(e[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!E(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,e)},match:function(t){var n=J(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!j(a,function(t){return B(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){console.log(t,{constructors:a,constructor:r,params:e})}}}}),e},pt=(gt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),Object.prototype.hasOwnProperty),ht=function(u){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r=t[o];for(var i in r)pt.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}},vt=ht(function(t,n){return S(t)&&S(n)?vt(t,n):n}),bt=ht(function(t,n){return n}),yt=function(t,n){return e=n,o={},nt(t,function(t,n){B(e,n)||(o[n]=t)}),o;var e,o},xt=function(t){return ct(t)},wt=function(t,n){return e=t,o=n,function(t){return at(t,e)?t[e]:o};var e,o},St=function(t,n){return st(t,n)},Ct=function(t,n){return ft(t,n)},kt=function(t){return n={},M(t,function(t){n[t.key]=t.value}),n;var n},Ot=function(t,n){var e,o,r,i,u,a=(e=[],o=[],M(t,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),{errors:e,values:o});return 0<a.errors.length?(u=a.errors,p(mt.error,z)(u)):(i=n,0===(r=a.values).length?mt.value(i):mt.value(vt(i,bt.apply(undefined,r))))},Et=function(t,n){return at(e=t,o=n)&&e[o]!==undefined&&null!==e[o];var e,o},Tt=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return Tt(e())}}},Bt=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},At=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return tt.none()},Dt=Z("touchstart"),_t=Z("touchmove"),Mt=Z("touchend"),Ft=Z("mousedown"),It=Z("mousemove"),Vt=Z("mouseout"),Rt=Z("mouseup"),Ht=Z("mouseover"),Nt=Z("focusin"),Pt=Z("focusout"),zt=Z("keydown"),Lt=Z("keyup"),jt=Z("input"),Ut=Z("change"),Wt=Z("click"),Gt=Z("transitionend"),Xt=Z("selectstart"),Yt=function(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}},qt=function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}return undefined}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return Jt(o(1),o(2))},Kt=function(){return Jt(0,0)},Jt=function(t,n){return{major:t,minor:n}},$t={nu:Jt,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?Kt():qt(t,e)},unknown:Kt},Qt="Firefox",Zt=function(t,n){return function(){return n===t}},tn=function(t){var n=t.current;return{current:n,version:t.version,isEdge:Zt("Edge",n),isChrome:Zt("Chrome",n),isIE:Zt("IE",n),isOpera:Zt("Opera",n),isFirefox:Zt(Qt,n),isSafari:Zt("Safari",n)}},nn={unknown:function(){return tn({current:undefined,version:$t.unknown()})},nu:tn,edge:Z("Edge"),chrome:Z("Chrome"),ie:Z("IE"),opera:Z("Opera"),firefox:Z(Qt),safari:Z("Safari")},en="Windows",on="Android",rn="Solaris",un="FreeBSD",an=function(t,n){return function(){return n===t}},cn=function(t){var n=t.current;return{current:n,version:t.version,isWindows:an(en,n),isiOS:an("iOS",n),isAndroid:an(on,n),isOSX:an("OSX",n),isLinux:an("Linux",n),isSolaris:an(rn,n),isFreeBSD:an(un,n)}},sn={unknown:function(){return cn({current:undefined,version:$t.unknown()})},nu:cn,windows:Z(en),ios:Z("iOS"),android:Z(on),linux:Z("Linux"),osx:Z("OSX"),solaris:Z(rn),freebsd:Z(un)},fn=function(t,n){var e=String(n).toLowerCase();return R(t,function(t){return t.search(e)})},ln=function(t,e){return fn(t,e).map(function(t){var n=$t.detect(t.versionRegexes,e);return{current:t.name,version:n}})},dn=function(t,e){return fn(t,e).map(function(t){var n=$t.detect(t.versionRegexes,e);return{current:t.name,version:n}})},mn=function(t,n){return-1!==t.indexOf(n)},gn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pn=function(n){return function(t){return mn(t,n)}},hn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return mn(t,"edge/")&&mn(t,"chrome")&&mn(t,"safari")&&mn(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,gn],search:function(t){return mn(t,"chrome")&&!mn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return mn(t,"msie")||mn(t,"trident")}},{name:"Opera",versionRegexes:[gn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pn("firefox")},{name:"Safari",versionRegexes:[gn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(mn(t,"safari")||mn(t,"mobile/"))&&mn(t,"applewebkit")}}],vn=[{name:"Windows",search:pn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return mn(t,"iphone")||mn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:pn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pn("linux"),versionRegexes:[]},{name:"Solaris",search:pn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pn("freebsd"),versionRegexes:[]}],bn={browsers:Z(hn),oses:Z(vn)},yn=function(t){var n,e,o,r,i,u,a,c,s,f,l,d=bn.browsers(),m=bn.oses(),g=ln(d,t).fold(nn.unknown,nn.nu),p=dn(m,t).fold(sn.unknown,sn.nu);return{browser:g,os:p,deviceType:(e=g,o=t,r=(n=p).isiOS()&&!0===/ipad/i.test(o),i=n.isiOS()&&!r,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,c=r||u||a&&!0===/mobile/i.test(o),s=n.isiOS()||n.isAndroid(),f=s&&!c,l=e.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),{isiPad:Z(r),isiPhone:Z(i),isTablet:Z(c),isPhone:Z(f),isTouch:Z(s),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:Z(l)})}},xn={detect:Yt(function(){var t=h.navigator.userAgent;return yn(t)})},wn={tap:Z("alloy.tap")},Sn=Z("alloy.focus"),Cn=Z("alloy.blur.post"),kn=Z("alloy.paste.post"),On=Z("alloy.receive"),En=Z("alloy.execute"),Tn=Z("alloy.focus.item"),Bn=wn.tap,An=xn.detect().deviceType.isTouch()?wn.tap:Wt,Dn=Z("alloy.longpress"),_n=Z("alloy.sandbox.close"),Mn=Z("alloy.typeahead.cancel"),Fn=Z("alloy.system.init"),In=Z("alloy.system.scroll"),Vn=Z("alloy.system.resize"),Rn=Z("alloy.system.attached"),Hn=Z("alloy.system.detached"),Nn=Z("alloy.system.dismissRequested"),Pn=Z("alloy.focusmanager.shifted"),zn=Z("alloy.slotcontainer.visibility"),Ln=Z("alloy.change.tab"),jn=Z("alloy.dismiss.tab"),Un=Z("alloy.highlight"),Wn=Z("alloy.dehighlight"),Gn=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:Z(t)}},Xn={fromHtml:function(t,n){var e=(n||h.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw h.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Gn(e.childNodes[0])},fromTag:function(t,n){var e=(n||h.document).createElement(t);return Gn(e)},fromText:function(t,n){var e=(n||h.document).createTextNode(t);return Gn(e)},fromDom:Gn,fromPoint:function(t,n,e){var o=t.dom();return tt.from(o.elementFromPoint(n,e)).map(Gn)}},Yn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(n.length!==e.length)throw new Error('Wrong number of arguments to struct. Expected "['+n.length+']", got '+e.length+" arguments");var o={};return M(n,function(t,n){o[t]=Z(e[n])}),o}},qn=function(t){return t.slice(0).sort()},Kn=function(n,t){if(!E(t))throw new Error("The "+n+" fields must be an array. Was: "+t+".");M(t,function(t){if(!w(t))throw new Error("The value "+t+" in the "+n+" fields was not a string.")})},Jn=function(r,i){var e,u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Kn("required",r),Kn("optional",i),e=qn(u),R(e,function(t,n){return n<e.length-1&&t===e[n+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+e.join(", ")+"].")}),function(n){var e=J(n);j(r,function(t){return B(e,t)})||function(t,n){throw new Error("All required keys ("+qn(t).join(", ")+") were not specified. Specified keys were: "+qn(n).join(", ")+".")}(r,e);var t=F(e,function(t){return!B(u,t)});0<t.length&&function(t){throw new Error("Unsupported keys for object: "+qn(t).join(", "))}(t);var o={};return M(r,function(t){o[t]=Z(n[t])}),M(i,function(t){o[t]=Z(Object.prototype.hasOwnProperty.call(n,t)?tt.some(n[t]):tt.none())}),o}},$n="undefined"!=typeof window?window:Function("return this;")(),Qn=function(t,n){return function(t,n){for(var e=n!==undefined&&null!==n?n:$n,o=0;o<t.length&&e!==undefined&&null!==e;++o)e=e[t[o]];return e}(t.split("."),n)},Zn={getOrDie:function(t,n){var e=Qn(t,n);if(e===undefined||null===e)throw t+" not available on this browser";return e}},te=(h.Node.ATTRIBUTE_NODE,h.Node.CDATA_SECTION_NODE,h.Node.COMMENT_NODE,h.Node.DOCUMENT_NODE),ne=(h.Node.DOCUMENT_TYPE_NODE,h.Node.DOCUMENT_FRAGMENT_NODE,h.Node.ELEMENT_NODE),ee=h.Node.TEXT_NODE,oe=(h.Node.PROCESSING_INSTRUCTION_NODE,h.Node.ENTITY_REFERENCE_NODE,h.Node.ENTITY_NODE,h.Node.NOTATION_NODE,ne),re=te,ie=function(t,n){var e=t.dom();if(e.nodeType!==oe)return!1;if(e.matches!==undefined)return e.matches(n);if(e.msMatchesSelector!==undefined)return e.msMatchesSelector(n);if(e.webkitMatchesSelector!==undefined)return e.webkitMatchesSelector(n);if(e.mozMatchesSelector!==undefined)return e.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},ue=function(t){return t.nodeType!==oe&&t.nodeType!==re||0===t.childElementCount},ae=function(t,n){var e=n===undefined?h.document:n.dom();return ue(e)?[]:_(e.querySelectorAll(t),Xn.fromDom)},ce=function(t,n){return t.dom()===n.dom()},se=(xn.detect().browser.isIE(),function(t){return Xn.fromDom(t.dom().ownerDocument)}),fe=function(t){var n=t.dom().ownerDocument.defaultView;return Xn.fromDom(n)},le=function(t){var n=t.dom();return tt.from(n.parentNode).map(Xn.fromDom)},de=function(t){var n=t.dom();return tt.from(n.offsetParent).map(Xn.fromDom)},me=function(t){var n=t.dom();return _(n.childNodes,Xn.fromDom)},ge=function(t,n){var e=t.dom().childNodes;return tt.from(e[n]).map(Xn.fromDom)},pe=(Yn("element","offset"),function(n,e){le(n).each(function(t){t.dom().insertBefore(e.dom(),n.dom())})}),he=function(t,n){var e;(e=t.dom(),tt.from(e.nextSibling).map(Xn.fromDom)).fold(function(){le(t).each(function(t){be(t,n)})},function(t){pe(t,n)})},ve=function(n,e){ge(n,0).fold(function(){be(n,e)},function(t){n.dom().insertBefore(e.dom(),t.dom())})},be=function(t,n){t.dom().appendChild(n.dom())},ye=function(n,t){M(t,function(t){be(n,t)})},xe=function(t){t.dom().textContent="",M(me(t),function(t){we(t)})},we=function(t){var n=t.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},Se=function(t){return t.dom().innerHTML},Ce=function(t,n){var e,o,r=se(t).dom(),i=Xn.fromDom(r.createDocumentFragment()),u=(e=n,(o=(r||h.document).createElement("div")).innerHTML=e,me(Xn.fromDom(o)));ye(i,u),xe(t),be(t,i)},ke=function(t){return t.dom().nodeName.toLowerCase()},Oe=function(n){return function(t){return t.dom().nodeType===n}},Ee=Oe(ne),Te=Oe(ee),Be=Oe(te),Ae=function(t,n,e){if(!(w(e)||C(e)||O(e)))throw h.console.error("Invalid call to Attr.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},De=function(t,n,e){Ae(t.dom(),n,e)},_e=function(t,n){var e=t.dom();nt(n,function(t,n){Ae(e,n,t)})},Me=function(t,n){var e=t.dom().getAttribute(n);return null===e?undefined:e},Fe=function(t,n){var e=t.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},Ie=function(t,n){t.dom().removeAttribute(n)},Ve=function(t){return n=t,e=!1,Xn.fromDom(n.dom().cloneNode(e));var n,e},Re=function(t){var n,e,o,r=Ve(t);return n=r,e=Xn.fromTag("div"),o=Xn.fromDom(n.dom().cloneNode(!0)),be(e,o),Se(e)},He=function(t){return Re(t)},Ne="unknown",Pe="__CHROME_INSPECTOR_CONNECTION_TO_ALLOY__";(i=s||(s={}))[i.STOP=0]="STOP",i[i.NORMAL=1]="NORMAL",i[i.LOGGING=2]="LOGGING";var ze=Tt({}),Le=function(n,t,e){var o,r,i,u;switch(St(ze.get(),n).orThunk(function(){var t=J(ze.get());return At(t,function(t){return-1<n.indexOf(t)?tt.some(ze.get()[t]):tt.none()})}).getOr(s.NORMAL)){case s.NORMAL:return e(Xe());case s.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();B(["mousemove","mouseover","mouseout",Fn()],o)||h.console.log(o,{event:o,time:t-u,target:r.dom(),sequence:_(i,function(t){return B(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+He(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case s.STOP:return!0}},je=["alloy/data/Fields","alloy/debugging/Debugging"],Ue=function(t,n,e){return Le(t,n,e)},We=function(){if(h.window[Pe]!==undefined)return h.window[Pe];var n=function(t,n){var e=ze.get();e[t]=n,ze.set(e)};return h.window[Pe]={systems:{},lookup:function(n){var e=h.window[Pe].systems,t=J(e);return At(t,function(t){return e[t].getByUid(n).toOption().map(function(t){return Ct(He(t.element()),(n=function(e){var t=e.spec();return{"(original.spec)":t,"(dom.ref)":e.element().dom(),"(element)":He(e.element()),"(initComponents)":_(t.components!==undefined?t.components:[],n),"(components)":_(e.components(),n),"(bound.events)":rt(e.events(),function(t,n){return[n]}).join(", "),"(behaviours)":t.behaviours!==undefined?et(t.behaviours,function(t,n){return t===undefined?"--revoked--":{config:t.configAsRaw(),"original-config":t.initialConfig,state:e.readState(n)}}):"none"}})(t));var n})}).orThunk(function(){return tt.some({error:"Systems ("+t.join(", ")+") did not contain uid: "+n})})},events:{setToNormal:function(t){n(t,s.NORMAL)},setToLogging:function(t){n(t,s.LOGGING)},setToStop:function(t){n(t,s.STOP)}}},h.window[Pe]},Ge=function(t,n){We().systems[t]=n},Xe=Z({logEventCut:Q,logEventStopped:Q,logNoParent:Q,logEventNoHandlers:Q,logEventResponse:Q,write:Q}),Ye=0,qe=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ye+String(n)},Ke=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Je=function(){return(Je=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function $e(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&(e[o[r]]=t[o[r]])}return e}var Qe,Ze,to=gt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),no=function(t){return to.defaultedThunk(Z(t))},eo=to.strict,oo=to.asOption,ro=to.defaultedThunk,io=(to.asDefaultedOptionThunk,to.mergeWithThunk);(Ze=Qe||(Qe={}))[Ze.Error=0]="Error",Ze[Ze.Value=1]="Value";var uo=function(t,n,e){return t.stype===Qe.Error?n(t.serror):e(t.svalue)},ao=function(t){return{stype:Qe.Value,svalue:t}},co=function(t){return{stype:Qe.Error,serror:t}},so=function(t){return t.fold(co,ao)},fo=function(t){return uo(t,mt.error,mt.value)},lo=ao,mo=function(t){var n=[],e=[];return M(t,function(t){uo(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}},go=co,po=function(t,n){return t.stype===Qe.Value?n(t.svalue):t},ho=function(t,n){return t.stype===Qe.Error?n(t.serror):t},vo=function(t,n){return t.stype===Qe.Value?{stype:Qe.Value,svalue:n(t.svalue)}:t},bo=function(t,n){return t.stype===Qe.Error?{stype:Qe.Error,serror:n(t.serror)}:t},yo=function(t){return p(go,z)(t)},xo=function(t,n){var e,o,r=mo(t);return 0<r.errors.length?yo(r.errors):(e=r.values,o=n,0<e.length?lo(vt(o,bt.apply(undefined,e))):lo(o))},wo=function(t){var n=mo(t);return 0<n.errors.length?yo(n.errors):lo(n.values)},So=gt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Co=gt([{field:["name","presence","type"]},{state:["name"]}]),ko=function(){return Zn.getOrDie("JSON")},Oo=function(t,n,e){return ko().stringify(t,n,e)},Eo=function(t){return S(t)&&100<J(t).length?" removed due to size":Oo(t,null,2)},To=function(t,n){return go([{path:t,getErrorInfo:n}])},Bo=gt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Ao=function(e,o,r){return st(o,r).fold(function(){return t=r,n=o,To(e,function(){return'Could not find valid *strict* value for "'+t+'" in '+Eo(n)});var t,n},lo)},Do=function(t,n,e){var o=st(t,n).fold(function(){return e(t)},d);return lo(o)},_o=function(a,c,t,s){return t.fold(function(r,e,t,o){var i=function(t){var n=o.extract(a.concat([r]),s,t);return vo(n,function(t){return ft(e,s(t))})},u=function(t){return t.fold(function(){var t=ft(e,s(tt.none()));return lo(t)},function(t){var n=o.extract(a.concat([r]),s,t);return vo(n,function(t){return ft(e,s(tt.some(t)))})})};return t.fold(function(){return po(Ao(a,c,r),i)},function(t){return po(Do(c,r,t),i)},function(){return po(lo(st(c,r)),u)},function(t){return po((e=t,o=st(n=c,r).map(function(t){return!0===t?e(n):t}),lo(o)),u);var n,e,o},function(t){var n=t(c),e=vo(Do(c,r,Z({})),function(t){return vt(n,t)});return po(e,i)})},function(t,n){var e=n(c);return lo(ft(t,s(e)))})},Mo=function(o){return{extract:function(e,t,n){return ho(o(n,t),function(t){return n=t,To(e,function(){return n});var n})},toString:function(){return"val"},toDsl:function(){return So.itemOf(o)}}},Fo=function(t){var c=Io(t),s=I(t,function(n,t){return t.fold(function(t){return vt(n,Ct(t,!0))},Z(n))},{});return{extract:function(t,n,e){var o,r,i,u=C(e)?[]:(r=J(o=e),F(r,function(t){return Et(o,t)})),a=F(u,function(t){return!Et(s,t)});return 0===a.length?c.extract(t,n,e):(i=a,To(t,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Io=function(a){return{extract:function(t,n,e){return o=t,r=e,i=n,u=_(a,function(t){return _o(o,r,t,i)}),xo(u,{});var o,r,i,u},toString:function(){return"obj{\n"+_(a,function(t){return t.fold(function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return So.objOf(_(a,function(t){return t.fold(function(t,n,e,o){return Co.field(t,e,o)},function(t,n){return Co.state(t)})}))}}},Vo=function(r){return{extract:function(e,o,t){var n=_(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return wo(n)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return So.arrOf(r)}}},Ro=function(a,c){return{extract:function(e,o,r){var t,n,i=J(r),u=(t=e,n=i,Vo(Mo(a)).extract(t,d,n));return po(u,function(t){var n=_(t,function(t){return Bo.field(t,t,eo(),c)});return Io(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return So.setOf(a,c)}}},Ho=Z(Mo(lo)),No=p(Vo,Io),Po=Bo.state,zo=Bo.field,Lo=function(e,n,o,r,i){return St(r,i).fold(function(){return t=r,n=i,To(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Eo(t)});var t,n},function(t){return Io(t).extract(e.concat(["branch: "+i]),n,o)})},jo=function(r,i){return{extract:function(n,e,o){return St(o,r).fold(function(){return t=r,To(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return Lo(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+J(i)},toDsl:function(){return So.choiceOf(r,i)}}},Uo=Mo(lo),Wo=function(n){return Mo(function(t){return n(t).fold(go,lo)})},Go=function(n,t){return Ro(function(t){return so(n(t))},t)},Xo=function(t,n,e){return fo((o=t,r=d,i=e,u=n.extract([o],r,i),bo(u,function(t){return{input:i,errors:t}})));var o,r,i,u},Yo=function(t){return t.fold(function(t){throw new Error(Ko(t))},d)},qo=function(t,n,e){return Yo(Xo(t,n,e))},Ko=function(t){return"Errors: \n"+(n=t.errors,e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n,_(e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+Eo(t.input);var n,e},Jo=function(t,n){return jo(t,n)},$o=Z(Uo),Qo=function(e,o){return Mo(function(t){var n=typeof t;return e(t)?lo(t):go("Expected type: "+o+" but got: "+n)})},Zo=Qo(O,"number"),tr=Qo(w,"string"),nr=Qo(C,"boolean"),er=Qo(k,"function"),or=function(n){return Wo(function(t){return B(n,t)?mt.value(t):mt.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},rr=function(t){return zo(t,t,eo(),Ho())},ir=function(t,n){return zo(t,t,eo(),n)},ur=function(t){return ir(t,tr)},ar=function(t,n){return zo(t,t,eo(),or(n))},cr=function(t){return ir(t,er)},sr=function(t,n){return zo(t,t,eo(),Io(n))},fr=function(t,n){return zo(t,t,eo(),No(n))},lr=function(t,n){return zo(t,t,eo(),Vo(n))},dr=function(t){return zo(t,t,oo(),Ho())},mr=function(t,n){return zo(t,t,oo(),n)},gr=function(t){return mr(t,tr)},pr=function(t){return mr(t,er)},hr=function(t,n){return zo(t,t,oo(),Io(n))},vr=function(t,n){return zo(t,t,no(n),Ho())},br=function(t,n,e){return zo(t,t,no(n),e)},yr=function(t,n){return br(t,n,Zo)},xr=function(t,n){return br(t,n,tr)},wr=function(t,n,e){return br(t,n,or(e))},Sr=function(t,n){return br(t,n,nr)},Cr=function(t,n){return br(t,n,er)},kr=function(t,n,e){return zo(t,t,no(n),Io(e))},Or=function(t,n){return Po(t,n)},Er=function(t,n){return ce(t.element(),n.event().target())},Tr=function(t){if(!Et(t,"can")&&!Et(t,"abort")&&!Et(t,"run"))throw new Error("EventHandler defined by: "+Oo(t,null,2)+" does not have can, abort, or run!");return qo("Extracting event.handler",Fo([vr("can",Z(!0)),vr("abort",Z(!1)),vr("run",Q)]),t)},Br=function(e){var n,o,r,i,t=(n=e,o=function(t){return t.can},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return V(n,function(t,n){return t&&o(n).apply(undefined,e)},!0)}),u=(r=e,i=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return V(r,function(t,n){return t||i(n).apply(undefined,e)},!1)});return Tr({can:t,abort:u,run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];M(e,function(t){t.run.apply(undefined,n)})}})},Ar=function(t,n){Fr(t,t.element(),n,{})},Dr=function(t,n,e){Fr(t,t.element(),n,e)},_r=function(t){Ar(t,En())},Mr=function(t,n,e){Fr(t,n,e,{})},Fr=function(t,n,e,o){var r=Je({target:n},o);t.getSystem().triggerEvent(e,n,et(r,Z))},Ir=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event())};function Vr(t,n,e,o,r){return t(e,o)?tt.some(e):k(r)&&r(e)?tt.none():n(e,o,r)}var Rr,Hr,Nr,Pr=function(t){var n=Te(t)?t.dom().parentNode:t.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)},zr=Yt(function(){return Lr(Xn.fromDom(h.document))}),Lr=function(t){var n=t.dom().body;if(null===n||n===undefined)throw new Error("Body is not available yet");return Xn.fromDom(n)},jr=function(t,n,e){for(var o=t.dom(),r=k(e)?e:Z(!1);o.parentNode;){o=o.parentNode;var i=Xn.fromDom(o);if(n(i))return tt.some(i);if(r(i))break}return tt.none()},Ur=function(t,n,e){return Vr(function(t){return n(t)},jr,t,n,e)},Wr=function(t,o){var r=function(t){for(var n=0;n<t.childNodes.length;n++){if(o(Xn.fromDom(t.childNodes[n])))return tt.some(Xn.fromDom(t.childNodes[n]));var e=r(t.childNodes[n]);if(e.isSome())return e}return tt.none()};return r(t.dom())},Gr=function(t,n,e){return Ur(t,function(t){return n(t).isSome()},e).bind(n)},Xr=function(t){return kt(t)},Yr=function(t,n){return{key:t,value:Tr({abort:n})}},qr=function(t){return{key:t,value:Tr({run:function(t,n){n.event().prevent()}})}},Kr=function(t,n){return{key:t,value:Tr({run:n})}},Jr=function(t,n,e){return{key:t,value:Tr({run:function(t){n.apply(undefined,[t].concat(e))}})}},$r=function(t){return function(e){return{key:t,value:Tr({run:function(t,n){Er(t,n)&&e(t,n)}})}}},Qr=function(t,n,e){var o,r,i=n.partUids[e];return r=i,Kr(o=t,function(t,n){t.getSystem().getByUid(r).each(function(t){Ir(t,t.element(),o,n)})})},Zr=function(t,r){return Kr(t,function(n,t){var e=t.event(),o=n.getSystem().getByDom(e.target()).fold(function(){return Gr(e.target(),function(t){return n.getSystem().getByDom(t).toOption()},Z(!1)).getOr(n)},function(t){return t});r(n,o,t)})},ti=function(t){return Kr(t,function(t,n){n.cut()})},ni=function(t){return Kr(t,function(t,n){n.stop()})},ei=function(t,n){return $r(t)(n)},oi=$r(Rn()),ri=$r(Hn()),ii=$r(Fn()),ui=(Rr=En(),function(t){return Kr(Rr,t)}),ai=Xr([(Hr=Sn(),Nr=function(t,n){var e,o,r=n.event().originator(),i=n.event().target();return o=i,!(ce(e=r,t.element())&&!ce(e,o)&&(h.console.warn(Sn()+" did not get interpreted by the desired target. \nOriginator: "+He(r)+"\nTarget: "+He(i)+"\nCheck the "+Sn()+" event handlers"),1))},{key:Hr,value:Tr({can:Nr})})]),ci=/* */Object.freeze({events:ai}),si=Z("alloy-id-"),fi=Z("data-alloy-id"),li=si(),di=fi(),mi=function(t,n){Object.defineProperty(t.dom(),di,{value:n,writable:!0})},gi=function(t){var n=Ee(t)?t.dom()[di]:null;return tt.from(n)},pi=function(t){return qe(t)},hi=d,vi=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+"\n"+He(n().element())+" is not in context.")}};return{debugInfo:Z("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:Z(!1)}},bi=vi(),yi=function(t){return _(t,function(t){return o=n="/*",r=(e=t).length-n.length,""!==o&&(e.length<o.length||e.substr(r,r+o.length)!==o)?t:t.substring(0,t.length-"/*".length);var n,e,o,r})},xi=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:yi(i)}},t},wi=qe("alloy-premade"),Si=function(t){return Ct(wi,t)},Ci=function(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(undefined,[t.getApis()].concat([t].concat(n)))},n=o.toString(),e=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:yi(i.slice(1))}},t;var t,n,e,r,i},ki={init:function(){return Oi({readState:function(){return"No State required"}})}},Oi=function(t){return t},Ei=function(t,r){var i={};return nt(t,function(t,o){nt(t,function(t,n){var e=wt(n,[])(i);i[n]=e.concat([r(o,t)])})}),i},Ti=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},Bi=function(t,n){return e=v.apply(undefined,[t.handler].concat(n)),o=t.purpose(),{cHandler:e,purpose:Z(o)};var e,o},Ai=function(t){return t.cHandler},Di=function(t,n){return{name:Z(t),handler:Z(n)}},_i=function(t,n,e){var o,r,i=Je({},e,(o=t,r={},M(n,function(t){r[t.name()]=t.handlers(o)}),r));return Ei(i,Di)},Mi=function(t){var n,i=k(n=t)?{can:Z(!0),abort:Z(!1),run:n}:n;return function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(undefined,r)?n.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},Fi=function(t,n,e){var o,r,i=n[e];return i?function(u,a,t,c){var n=t.slice(0);try{var e=n.sort(function(t,n){var e=t[a](),o=n[a](),r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+Oo(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+Oo(c,null,2));return r<i?-1:i<r?1:0});return mt.value(e)}catch(o){return mt.error([o])}}("Event: "+e,"name",t,i).map(function(t){var n=_(t,function(t){return t.handler()});return Br(n)}):(o=e,r=t,mt.error(["The event ("+o+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+Oo(_(r,function(t){return t.name()}),null,2)]))},Ii=function(t,i){var n=rt(t,function(o,r){return(1===o.length?mt.value(o[0].handler()):Fi(o,i,r)).map(function(t){var n=Mi(t),e=1<o.length?F(i,function(n){return B(o,function(t){return t.name()===n})}).join(" > "):o[0].name();return Ct(r,{handler:n,purpose:Z(e)})})});return Ot(n,{})},Vi=function(t){return Xo("custom.definition",Io([zo("dom","dom",eo(),Io([rr("tag"),vr("styles",{}),vr("classes",[]),vr("attributes",{}),dr("value"),dr("innerHtml")])),rr("components"),rr("uid"),vr("events",{}),vr("apis",{}),zo("eventOrder","eventOrder",(n={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},to.mergeWithThunk(Z(n))),$o()),dr("domModification")]),t);var n},Ri=function(t,n){var e=Me(t,n);return e===undefined||""===e?[]:e.split(" ")},Hi=function(t){return t.dom().classList!==undefined},Ni=function(t,n){return r=n,i=Ri(e=t,o="class").concat([r]),De(e,o,i.join(" ")),!0;var e,o,r,i},Pi=function(t,n){return r=n,0<(i=F(Ri(e=t,o="class"),function(t){return t!==r})).length?De(e,o,i.join(" ")):Ie(e,o),!1;var e,o,r,i},zi=function(t,n){Hi(t)?t.dom().classList.add(n):Ni(t,n)},Li=function(t){0===(Hi(t)?t.dom().classList:Ri(t,"class")).length&&Ie(t,"class")},ji=function(t,n){Hi(t)?t.dom().classList.remove(n):Pi(t,n),Li(t)},Ui=function(t,n){return Hi(t)&&t.dom().classList.contains(n)},Wi=function(n,t){M(t,function(t){zi(n,t)})},Gi=function(n,t){M(t,function(t){ji(n,t)})},Xi=function(t){return t.style!==undefined},Yi=function(t,n,e){if(!w(e))throw h.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Xi(t)&&t.style.setProperty(n,e)},qi=function(t,n){Xi(t)&&t.style.removeProperty(n)},Ki=function(t,n,e){var o=t.dom();Yi(o,n,e)},Ji=function(t,n){var e=t.dom();nt(n,function(t,n){Yi(e,n,t)})},$i=function(t,n){var e=t.dom(),o=h.window.getComputedStyle(e).getPropertyValue(n),r=""!==o||Pr(t)?o:Qi(e,n);return null===r?undefined:r},Qi=function(t,n){return Xi(t)?t.style.getPropertyValue(n):""},Zi=function(t,n){var e=t.dom(),o=Qi(e,n);return tt.from(o).filter(function(t){return 0<t.length})},tu=function(t,n,e){var o=Xn.fromTag(t);return Ki(o,n,e),Zi(o,n).isSome()},nu=function(t,n){var e=t.dom();qi(e,n),Fe(t,"style")&&""===Me(t,"style").replace(/^\s+|\s+$/g,"")&&Ie(t,"style")},eu=function(t){return t.dom().offsetWidth},ou=function(t){return t.dom().value},ru=function(t,n){if(n===undefined)throw new Error("Value.set was undefined");t.dom().value=n},iu=function(t,n){return e=t,r=_(o=n,function(t){return hr(t.name(),[rr("config"),vr("state",ki)])}),i=Xo("component.behaviours",Io(r),e.behaviours).fold(function(t){throw new Error(Ko(t)+"\nComplete spec:\n"+Oo(e,null,2))},function(t){return t}),{list:o,data:et(i,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return n}})};var e,o,r,i},uu=function(t){var n,e,o,r=(n=t,e=wt("behaviours",{})(n),o=F(J(e),function(t){return e[t]!==undefined}),_(o,function(t){return e[t].me}));return iu(t,r)},au=function(t,n,e){var o,r,i,u=Je({},(o=t).dom,{uid:o.uid,domChildren:_(o.components,function(t){return t.element()})}),a=t.domModification.fold(function(){return Ti({})},Ti),c={"alloy.base.modification":a},s=0<n.length?function(n,t,e,o){var r=Je({},t);M(e,function(t){r[t.name()]=t.exhibit(n,o)});var i=Ei(r,function(t,n){return{name:t,modification:n}}),u=function(t){return I(t,function(t,n){return Je({},n.modification,t)},{})},a=I(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return Ti({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,Je({},r=u,{attributes:Je({},r.attributes,i.attributes),styles:Je({},r.styles,i.styles),classes:r.classes.concat(i.classes)})},cu=function(t,n,e){var o,r,i,u,a,c,s={"alloy.base.behaviour":(o=t,o.events)};return(r=e,i=t.eventOrder,u=n,a=s,c=_i(r,u,a),Ii(c,i)).getOrDie()},su=function(e){var t=function(){return f},o=Tt(bi),n=Yo(Vi(e)),r=uu(e),i=r.list,u=r.data,a=function(t){var n=Xn.fromTag(t.tag);_e(n,t.attributes),Wi(n,t.classes),Ji(n,t.styles),t.innerHtml.each(function(t){return Ce(n,t)});var e=t.domChildren;return ye(n,e),t.value.each(function(t){ru(n,t)}),t.uid,mi(n,t.uid),n}(au(n,i,u)),c=cu(n,i,u),s=Tt(n.components),f={getSystem:o.get,config:function(t){var n=u;return(k(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+Oo(e,null,2))})()},hasConfigured:function(t){return k(u[t.name()])},spec:Z(e),readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return n.apis},connect:function(t){o.set(t)},disconnect:function(){o.set(vi(t))},element:Z(a),syncComponents:function(){var t=me(a),n=L(t,function(t){return o.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});s.set(n)},components:s.get,events:Z(c)};return f},fu=function(t){var n,e,o=hi(t),r=o.events,i=$e(o,["events"]),u=(n=i,e=wt("components",[])(n),_(e,gu)),a=Je({},i,{events:Je({},ci,r),components:u});return mt.value(su(a))},lu=function(t){var n=Xn.fromText(t);return du({element:n})},du=function(t){var n=qo("external.component",Fo([rr("element"),dr("uid")]),t),e=Tt(vi());n.uid.each(function(t){mi(n.element,t)});var o={getSystem:e.get,config:tt.none,hasConfigured:Z(!1),connect:function(t){e.set(t)},disconnect:function(){e.set(vi(function(){return o}))},getApis:function(){return{}},element:Z(n.element),spec:Z(t),readState:Z("No state"),syncComponents:Q,components:Z([]),events:Z({})};return Si(o)},mu=pi,gu=function(n){return(t=n,St(t,wi)).fold(function(){var t=n.hasOwnProperty("uid")?n:Je({uid:mu("")},n);return fu(t).getOrDie()},function(t){return t});var t},pu=Si,hu=function(t,n,e){return jr(t,function(t){return ie(t,n)},e)},vu=function(t,n){return e=n,r=(o=t)===undefined?h.document:o.dom(),ue(r)?tt.none():tt.from(r.querySelector(e)).map(Xn.fromDom);var e,o,r},bu=function(t,n,e){return Vr(ie,hu,t,n,e)},yu=function(n,t){return(e=t,Ur(e,function(t){if(!Ee(t))return!1;var n=Me(t,"id");return n!==undefined&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=Me(t,"id"),e=se(t);return vu(e,'[aria-owns="'+n+'"]')})).exists(function(t){return xu(n,t)});var e},xu=function(n,t){return e=t,r=Z(!(o=function(t){return ce(t,n.element())})),Ur(e,o,r).isSome()||yu(n,t);var e,o,r},wu=Z([rr("menu"),rr("selectedMenu")]),Su=Z([rr("item"),rr("selectedItem")]),Cu=(Z(Io(Su().concat(wu()))),Z(Io(Su()))),ku=sr("initSize",[rr("numColumns"),rr("numRows")]),Ou=function(){return sr("markers",[rr("backgroundMenu")].concat(wu()).concat(Su()))},Eu=function(t){return sr("markers",_(t,rr))},Tu=function(t,n,e){return function(){var t=new Error;if(t.stack!==undefined){var n=t.stack.split("\n");R(n,function(n){return 0<n.indexOf("alloy")&&!A(je,function(t){return-1<n.indexOf(t)})}).getOr(Ne)}}(),zo(n,n,e,Wo(function(e){return mt.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(undefined,t)})}))},Bu=function(t){return Tu(0,t,no(Q))},Au=function(t){return Tu(0,t,no(tt.none))},Du=function(t){return Tu(0,t,eo())},_u=function(t){return Tu(0,t,eo())},Mu=function(t,n){return Or(t,Z(n))},Fu=function(t){return Or(t,d)},Iu=Z(ku),Vu=function(e,o,r){return ii(function(t,n){r(t,e,o)})},Ru=function(t,n,e,o,r,i){var u,a,c=Fo(t),s=hr(n,[(u="config",a=t,zo(u,u,oo(),Fo(a)))]);return Pu(c,s,n,e,o,r,i)},Hu=function(r,i,u){var t,n,e,o,a,c;return t=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:Z(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,t.config,t.state].concat(n))})},n=u,e=i.toString(),o=e.indexOf(")")+1,a=e.indexOf("("),c=e.substring(a+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:n,parameters:yi(c.slice(0,1).concat(c.slice(3)))}},t},Nu=function(t){return{key:t,value:undefined}},Pu=function(e,t,o,r,n,i,u){var a=function(t){return Et(t,o)?t[o]():tt.none()},c=et(n,function(t,n){return Hu(o,t,n)}),s=et(i,function(t,n){return xi(t,n)}),f=Je({},s,c,{revoke:v(Nu,o),config:function(t){var n=qo(o+"-config",e,t);return{key:o,value:{config:n,me:f,configAsRaw:Yt(function(){return qo(o+"-config",e,t)}),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(t,e){return a(t).bind(function(n){return St(r,"exhibit").map(function(t){return t(e,n.config,n.state)})}).getOr(Ti({}))},name:function(){return o},handlers:function(t){return a(t).map(function(t){return wt("events",function(t,n){return{}})(r)(t.config,t.state)}).getOr({})}});return f},zu=function(t){return kt(t)},Lu=Fo([rr("fields"),rr("name"),vr("active",{}),vr("apis",{}),vr("state",ki),vr("extra",{})]),ju=function(t){var n=qo("Creating behaviour: "+t.name,Lu,t);return Ru(n.fields,n.name,n.active,n.apis,n.extra,n.state)},Uu=Fo([rr("branchKey"),rr("branches"),rr("name"),vr("active",{}),vr("apis",{}),vr("state",ki),vr("extra",{})]),Wu=function(t){var n,e,o,r,i,u,a,c,s=qo("Creating behaviour: "+t.name,Uu,t);return n=Jo(s.branchKey,s.branches),e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,c=hr(e,[mr("config",a=n)]),Pu(a,c,e,o,r,i,u)},Gu=Z(undefined),Xu=/* */Object.freeze({events:function(a){return Xr([Kr(On(),function(r,i){var t,n,u=a.channels,e=J(u),o=(t=e,(n=i).universal()?t:F(t,function(t){return B(n.channels(),t)}));M(o,function(t){var n=u[t],e=n.schema,o=qo("channel["+t+"] data\nReceiver: "+He(r.element()),e,i.data());n.onReceive(r,o)})})])}}),Yu=[ir("channels",Go(mt.value,Fo([Du("onReceive"),vr("schema",$o())])))],qu=ju({fields:Yu,name:"receiving",active:Xu}),Ku=/* */Object.freeze({exhibit:function(t,n){return Ti({classes:[],styles:n.useFixed?{}:{position:"relative"}})}}),Ju=function(e,o){return{left:Z(e),top:Z(o),translate:function(t,n){return Ju(e+t,o+n)}}},$u=Ju,Qu=function(t,n){return t!==undefined?t:n!==undefined?n:0},Zu=function(t){var n,e,o=t.dom().ownerDocument,r=o.body,i=(n=Xn.fromDom(o),(e=n.dom())===e.window&&n instanceof h.Window?n:Be(n)?e.defaultView||e.parentWindow:null),u=o.documentElement,a=Qu(i.pageYOffset,u.scrollTop),c=Qu(i.pageXOffset,u.scrollLeft),s=Qu(u.clientTop,r.clientTop),f=Qu(u.clientLeft,r.clientLeft);return ta(t).translate(c-f,a-s)},ta=function(t){var n,e,o,r=t.dom(),i=r.ownerDocument,u=i.body,a=Xn.fromDom(i.documentElement);return u===r?$u(u.offsetLeft,u.offsetTop):(n=t,e=a||Xn.fromDom(h.document.documentElement),jr(n,v(ce,e)).isSome()?(o=r.getBoundingClientRect(),$u(o.left,o.top)):$u(0,0))},na=(xn.detect().browser.isSafari(),function(t){var n=t!==undefined?t.dom():h.document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return $u(e,o)});function ea(o,r){var t=function(t){var n=r(t);if(n<=0||null===n){var e=$i(t,o);return parseFloat(e)||0}return n},i=function(r,t){return V(t,function(t,n){var e=$i(r,n),o=e===undefined?0:parseInt(e,10);return isNaN(o)?t:t+o},0)};return{set:function(t,n){if(!O(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom();Xi(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}var oa,ra,ia=ea("width",function(t){return t.dom().offsetWidth}),ua=function(t){return ia.get(t)},aa=function(t){return ia.getOuter(t)},ca=ea("height",function(t){var n=t.dom();return Pr(t)?n.getBoundingClientRect().height:n.offsetHeight}),sa=function(t){return ca.get(t)},fa=function(t){return ca.getOuter(t)},la=Jn(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),da=Yn("position","left","top","right","bottom"),ma=gt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),ga=ma.southeast,pa=ma.southwest,ha=ma.northeast,va=ma.northwest,ba=ma.south,ya=ma.north,xa=ma.east,wa=ma.west,Sa=Yn("point","width","height"),Ca=Yn("x","y","width","height"),ka=function(t,n,e,o){return{x:Z(t),y:Z(n),width:Z(e),height:Z(o),right:Z(t+e),bottom:Z(n+o)}},Oa=function(t){var n=Zu(t),e=aa(t),o=fa(t);return ka(n.left(),n.top(),e,o)},Ea=function(o,t){return o.view(t).fold(Z([]),function(t){var n=o.owner(t),e=Ea(o,n);return[t].concat(e)})},Ta=/* */Object.freeze({view:function(t){return(t.dom()===h.document?tt.none():tt.from(t.dom().defaultView.frameElement)).map(Xn.fromDom)},owner:function(t){return se(t)}}),Ba=function(o){var t,n,e,r,i=Xn.fromDom(h.document),u=na(i);return(t=o,e=(n=Ta).owner(t),r=Ea(n,e),tt.some(r)).fold(v(Zu,o),function(t){var n=ta(o),e=I(t,function(t,n){var e=ta(n);return{left:t.left+e.left(),top:t.top+e.top()}},{left:0,top:0});return $u(e.left+n.left()+u.left(),e.top+n.top()+u.top())})},Aa=function(){var t=h.window.innerWidth,n=h.window.innerHeight,e=Xn.fromDom(h.document),o=na(e);return ka(o.left(),o.top(),t,n)},Da=gt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),_a=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=n.x()-e,h=n.y()-o,v=r-(p+n.width()),b=i-(h+n.height()),y=tt.some(p),x=tt.some(h),w=tt.some(v),S=tt.some(b),C=tt.none();return u=n.direction(),a=function(){return da(t,y,x,C,C)},c=function(){return da(t,C,x,w,C)},s=function(){return da(t,y,C,C,S)},f=function(){return da(t,C,C,w,S)},l=function(){return da(t,y,x,C,C)},d=function(){return da(t,y,C,C,S)},m=function(){return da(t,y,x,C,C)},g=function(){return da(t,C,x,w,C)},u.fold(a,c,s,f,l,d,m,g)},Ma=function(t,n){var e=v(Ba,n),o=t.fold(e,e,function(){var t=na();return Ba(n).translate(-t.left(),-t.top())}),r=aa(n),i=fa(n);return ka(o.left(),o.top(),r,i)},Fa=Da.relative,Ia=Da.fixed,Va=Yn("anchorBox","origin"),Ra=gt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Ha=function(t,H,N,P,z){var L=N.width(),j=N.height(),o=function(t,o,r,i){var n,e,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w,S,C,k,O,E,T,B,A,D,_,M,F,I,V,R=t(H,N,P);return(e=L,u=j,a=z,d=(n=R).x(),m=n.y(),g=n.bubble().offset().left(),p=n.bubble().offset().top(),h=a.x(),v=a.y(),b=a.width(),y=a.height(),C=v<=(w=m+p),k=(S=h<=(x=d+g))&&C,O=x+e<=h+b&&w+u<=v+y,E=S?Math.min(e,h+b-x):Math.abs(h-(x+e)),T=C?Math.min(u,v+y-w):Math.abs(v-(w+u)),B=a.x()+a.width(),A=Math.max(a.x(),x),D=Math.min(A,B),M=Z((_=C?w:w+(u-T))+T-v),F=Z(v+y-_),c=n.direction(),f=s=F,l=M,I=c.fold(s,s,l,l,s,l,f,f),V=la({x:D,y:_,width:E,height:T,maxHeight:I,direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:w}),k&&O?Ra.fit(V):Ra.nofit(V,E,T)).fold(Ra.fit,function(t,n,e){return i<e||r<n?Ra.nofit(t,n,e):Ra.nofit(o,r,i)})};return V(t,function(t,n){var e=v(o,n);return t.fold(Ra.fit,e)},Ra.nofit(la({x:H.x(),y:H.y(),width:N.width(),height:N.height(),maxHeight:N.height(),direction:ga(),classes:[],label:"none",candidateYforTest:H.y()}),-1,-1)).fold(d,d)},Na=function(t,n,e,o){nu(n,"max-height");var r,i={width:Z(aa(r=n)),height:Z(fa(r))};return Ha(o.preference(),t,i,e,o.bounds())},Pa=function(t,n,e){var o,r,i,u,a,c=function(t){return t+"px"},s=(o=e.origin(),r=n,o.fold(function(){return da("absolute",tt.some(r.x()),tt.some(r.y()),tt.none(),tt.none())},function(t,n,e,o){return _a("absolute",r,t,n,e,o)},function(t,n,e,o){return _a("fixed",r,t,n,e,o)}));i=t,u={position:tt.some(s.position()),left:s.left().map(c),top:s.top().map(c),right:s.right().map(c),bottom:s.bottom().map(c)},a=i.dom(),nt(u,function(t,n){t.fold(function(){qi(a,n)},function(t){Yi(a,n,t)})})},za=function(t,n){var e,o,r;e=t,o=Math.floor(n),r=ca.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),Ki(e,"max-height",r+"px")},La=Z(function(t,n){za(t,n),Ji(t,{"overflow-x":"hidden","overflow-y":"auto"})}),ja=Z(function(t,n){za(t,n)}),Ua=Jn(["bounds","origin","preference","maxHeightFunction"],[]),Wa=function(t,n,e,o,r,i){var u,a,c,s,f,l=(u=i,a="maxHeightFunction",c=La(),u[a]===undefined?c:u[a]),d=t.anchorBox(),m=t.origin(),g=Ua({bounds:(s=m,f=r,f.fold(function(){return s.fold(Aa,Aa,ka)},function(t){return s.fold(t,t,ka)})),origin:m,preference:o,maxHeightFunction:l});Ga(d,n,e,g)},Ga=function(t,n,e,o){var r,i,u,a,c=Na(t,n,e,o);Pa(n,c,o),r=n,i=c.classes(),Gi(r,i.off),Wi(r,i.on),u=n,a=c,o.maxHeightFunction()(u,a.maxHeight())},Xa=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Ya=function(t,n,e){var r=function(t){return St(e,t).getOr([])},o=function(t,n,e){var o=G(Xa,e);return{offset:function(){return $u(t,n)},classesOn:function(){return L(e,r)},classesOff:function(){return L(o,r)}}};return{southeast:function(){return o(-t,n,["top","alignLeft"])},southwest:function(){return o(t,n,["top","alignRight"])},south:function(){return o(-t/2,n,["top","alignCentre"])},northeast:function(){return o(-t,-n,["bottom","alignLeft"])},northwest:function(){return o(t,-n,["bottom","alignRight"])},north:function(){return o(-t/2,-n,["bottom","alignCentre"])},east:function(){return o(t,-n/2,["valignCentre","left"])},west:function(){return o(-t,-n/2,["valignCentre","right"])}}},qa=function(){return Ya(0,0,{})},Ka=Yn("x","y","bubble","direction","label"),Ja=function(t){return t.x()},$a=function(t,n){return t.x()+t.width()/2-n.width()/2},Qa=function(t,n){return t.x()+t.width()-n.width()},Za=function(t,n){return t.y()-n.height()},tc=function(t){return t.y()+t.height()},nc=function(t,n){return t.y()+t.height()/2-n.height()/2},ec=function(t,n,e){return Ka(Ja(t),tc(t),e.southeast(),ga(),"layout-se")},oc=function(t,n,e){return Ka(Qa(t,n),tc(t),e.southwest(),pa(),"layout-sw")},rc=function(t,n,e){return Ka(Ja(t),Za(t,n),e.northeast(),ha(),"layout-ne")},ic=function(t,n,e){return Ka(Qa(t,n),Za(t,n),e.northwest(),va(),"layout-nw")},uc=function(t,n,e){return Ka($a(t,n),Za(t,n),e.north(),ya(),"layout-n")},ac=function(t,n,e){return Ka($a(t,n),tc(t),e.south(),ba(),"layout-s")},cc=function(t,n,e){return Ka((o=t).x()+o.width(),nc(t,n),e.east(),xa(),"layout-e");var o},sc=function(t,n,e){return Ka((o=n,t.x()-o.width()),nc(t,n),e.west(),wa(),"layout-w");var o},fc=function(){return[ec,oc,rc,ic,ac,uc,cc,sc]},lc=function(){return[oc,ec,ic,rc,ac,uc,cc,sc]},dc=function(t){return t},mc=function(n,e){return function(t){return"rtl"===gc(t)?e:n}},gc=function(t){return"rtl"===$i(t,"direction")?"rtl":"ltr"},pc=function(){return hr("layouts",[rr("onLtr"),rr("onRtl")])},hc=function(n,t,e,o){var r=t.layouts.map(function(t){return t.onLtr(n)}).getOr(e),i=t.layouts.map(function(t){return t.onRtl(n)}).getOr(o);return mc(r,i)(n)},vc=[rr("hotspot"),dr("bubble"),pc(),Mu("placement",function(t,n,e){var o=n.hotspot,r=Ma(e,o.element()),i=hc(t.element(),n,fc(),lc());return tt.some(dc({anchorBox:r,bubble:n.bubble.getOr(qa()),overrides:{},layouts:i,placer:tt.none()}))})],bc=[rr("x"),rr("y"),vr("height",0),vr("width",0),vr("bubble",qa()),pc(),Mu("placement",function(t,n,e){var o=ka(n.x,n.y,n.width,n.height),r=hc(t.element(),n,fc(),lc());return tt.some(dc({anchorBox:o,bubble:n.bubble,overrides:{},layouts:r,placer:tt.none()}))})],yc=(gt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),gt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),xc=Yn("start","soffset","finish","foffset"),wc=(yc.domRange,yc.relative,yc.exact),Sc=function(t,n,e,o){var r,i,u,a,c,s=(i=n,u=e,a=o,(c=se(r=t).dom().createRange()).setStart(r.dom(),i),c.setEnd(u.dom(),a),c),f=ce(t,e)&&n===o;return s.collapsed&&!f},Cc=function(t,n,e){var o,r,i=t.document.createRange();return o=i,n.fold(function(t){o.setStartBefore(t.dom())},function(t,n){o.setStart(t.dom(),n)},function(t){o.setStartAfter(t.dom())}),r=i,e.fold(function(t){r.setEndBefore(t.dom())},function(t,n){r.setEnd(t.dom(),n)},function(t){r.setEndAfter(t.dom())}),i},kc=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom(),e),i.setEnd(o.dom(),r),i},Oc=function(t){return{left:Z(t.left),top:Z(t.top),right:Z(t.right),bottom:Z(t.bottom),width:Z(t.width),height:Z(t.height)}},Ec=gt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Tc=function(t,n,e){return n(Xn.fromDom(e.startContainer),e.startOffset,Xn.fromDom(e.endContainer),e.endOffset)},Bc=function(t,n){var r,e,o,i=(r=t,n.match({domRange:function(t){return{ltr:Z(t),rtl:tt.none}},relative:function(t,n){return{ltr:Yt(function(){return Cc(r,t,n)}),rtl:Yt(function(){return tt.some(Cc(r,n,t))})}},exact:function(t,n,e,o){return{ltr:Yt(function(){return kc(r,t,n,e,o)}),rtl:Yt(function(){return tt.some(kc(r,e,o,t,n))})}}}));return(o=(e=i).ltr()).collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return Ec.rtl(Xn.fromDom(t.endContainer),t.endOffset,Xn.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return Tc(0,Ec.ltr,o)}):Tc(0,Ec.ltr,o)},Ac=function YA(e,o){var r=function(t){return e(t)?tt.from(t.dom().nodeValue):tt.none()},t=xn.detect().browser,n=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(n){return tt.none()}}:r;return{get:function(t){if(!e(t))throw new Error("Can only get "+o+" value of a "+o+" node");return n(t).getOr("")},getOption:n,set:function(t,n){if(!e(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=n}}}(Te,"text"),Dc=function(t){return Ac.get(t)},_c=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(t,n){return ae(n,t)}),Mc=function(t){var n=Xn.fromDom(t.anchorNode),e=Xn.fromDom(t.focusNode);return Sc(n,t.anchorOffset,e,t.focusOffset)?tt.some(xc(n,t.anchorOffset,e,t.focusOffset)):function(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return tt.some(xc(Xn.fromDom(n.startContainer),n.startOffset,Xn.fromDom(e.endContainer),e.endOffset))}return tt.none()}(t)},Fc=function(t,n){var i,e,o,r,u=Bc(i=t,n).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom(),n),r.setEnd(e.dom(),o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom(),o),r.setEnd(t.dom(),n),r}});return o=(e=u).getClientRects(),0<(r=0<o.length?o[0]:e.getBoundingClientRect()).width||0<r.height?tt.some(r).map(Oc):tt.none()},Ic=Yn("element","offset"),Vc=gt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Rc=function(t){return t.fold(function(t){return t},function(t,n,e){return t.translate(-n,-e)})},Hc=function(t){return t.fold(function(t){return t},function(t,n,e){return t})},Nc=function(t){return V(t,function(t,n){return t.translate(n.left(),n.top())},$u(0,0))},Pc=function(t){var n=_(t,Hc);return Nc(n)},zc=Vc.screen,Lc=Vc.absolute,jc=function(t,n,e){var o,r,i,u=se(t.element()),a=na(u),c=(o=t,r=e,i=fe(r.root).dom(),tt.from(i.frameElement).map(Xn.fromDom).filter(function(t){var n=se(t),e=se(o.element());return ce(n,e)}).map(Zu)).getOr(a);return Lc(c,a.left(),a.top())},Uc=function(t,n,e,o){var r=t,i=n,u=e,a=o;t<0&&(r=0,u=e+t),n<0&&(i=0,a=o+n);var c=zc($u(r,i));return tt.some(Sa(c,u,a))},Wc=function(t,c,s,f,l){return t.map(function(t){var n,e,o,r=[c,t.point()],i=(n=function(){return Pc(r)},e=function(){return Pc(r)},o=function(){return t=_(r,Rc),Nc(t);var t},f.fold(n,e,o)),u=Ca(i.left(),i.top(),t.width(),t.height()),a=hc(l,s,s.showAbove?[rc,ic,ec,oc,uc,ac]:[ec,oc,rc,ic,ac,ac],s.showAbove?[ic,rc,oc,ec,uc,ac]:[oc,ec,ic,rc,ac,uc]);return dc({anchorBox:u,bubble:s.bubble.getOr(qa()),overrides:s.overrides,layouts:a,placer:tt.none()})})},Gc=Yn("element","offset"),Xc=function(t,n){return Te(t)?Gc(t,n):function(t,n){var e=me(t);if(0===e.length)return Ic(t,n);if(n<e.length)return Ic(e[n],0);var o=e[e.length-1],r=Te(o)?Dc(o).length:me(o).length;return Ic(o,r)}(t,n)},Yc=function(n,t){return t.getSelection.getOrThunk(function(){return function(){return t=n,tt.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(Mc);var t}})().map(function(t){var n=Xc(t.start(),t.soffset()),e=Xc(t.finish(),t.foffset());return xc(n.element(),n.offset(),e.element(),e.offset())})},qc=[dr("getSelection"),rr("root"),dr("bubble"),pc(),vr("overrides",{}),vr("showAbove",!1),Mu("placement",function(t,n,e){var o=fe(n.root).dom(),r=jc(t,0,n),i=Yc(o,n).bind(function(t){var n;return Fc(o,(n=t,yc.exact(n.start(),n.soffset(),n.finish(),n.foffset()))).orThunk(function(){var n=Xn.fromText("\ufeff");return pe(t.start(),n),Fc(o,wc(n,0,n,1)).map(function(t){return we(n),t})}).bind(function(t){return Uc(t.left(),t.top(),t.width(),t.height())})}),u=Yc(o,n).bind(function(t){return Ee(t.start())?tt.some(t.start()):le(t.start())}).getOr(t.element());return Wc(i,r,n,e,u)})],Kc=[rr("node"),rr("root"),dr("bubble"),pc(),vr("overrides",{}),vr("showAbove",!1),Mu("placement",function(r,i,u){var a=jc(r,0,i);return i.node.bind(function(t){var n=t.dom().getBoundingClientRect(),e=Uc(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element());return Wc(e,a,i,u,o)})})],Jc=function(t){return t.x()+t.width()},$c=function(t,n){return t.x()-n.width()},Qc=function(t,n){return t.y()-n.height()+t.height()},Zc=function(t){return t.y()},ts=function(t,n,e){return Ka(Jc(t),Zc(t),e.southeast(),ga(),"link-layout-se")},ns=function(t,n,e){return Ka($c(t,n),Zc(t),e.southwest(),pa(),"link-layout-sw")},es=function(t,n,e){return Ka(Jc(t),Qc(t,n),e.northeast(),ha(),"link-layout-ne")},os=function(t,n,e){return Ka($c(t,n),Qc(t,n),e.northwest(),va(),"link-layout-nw")},rs=[rr("item"),pc(),Mu("placement",function(t,n,e){var o=Ma(e,n.item.element()),r=hc(t.element(),n,[ts,ns,es,os],[ns,ts,os,es]);return tt.some(dc({anchorBox:o,bubble:qa(),overrides:{},layouts:r,placer:tt.none()}))})],is=Jo("anchor",{selection:qc,node:Kc,hotspot:vc,submenu:rs,makeshift:bc}),us=function(t,n,e,o,r){var i,u=(i=e.anchorBox,Va(i,n));Wa(u,r.element(),e.bubble,e.layouts,o,e.overrides)},as=function(n,t,e,o,r,i){var u=qo("positioning anchor.info",is,o);Ki(r.element(),"position","fixed");var a=Zi(r.element(),"visibility");Ki(r.element(),"visibility","hidden");var c,s,f,l=t.useFixed?Ia(0,0,h.window.innerWidth,h.window.innerHeight):(s=Zu((c=n).element()),f=c.element().dom().getBoundingClientRect(),Fa(s.left(),s.top(),f.width,f.height)),d=u.placement,m=i.map(function(t){return function(){return Oa(t)}}).or(t.getBounds);d(n,u,l).each(function(t){t.placer.getOr(us)(n,l,t,m,r)}),a.fold(function(){nu(r.element(),"visibility")},function(t){Ki(r.element(),"visibility",t)}),Zi(r.element(),"left").isNone()&&Zi(r.element(),"top").isNone()&&Zi(r.element(),"right").isNone()&&Zi(r.element(),"bottom").isNone()&&Zi(r.element(),"position").is("fixed")&&nu(r.element(),"position")},cs=/* */Object.freeze({position:function(t,n,e,o,r){var i=tt.none();as(t,n,e,o,r,i)},positionWithin:as,getMode:function(t,n,e){return n.useFixed?"fixed":"absolute"}}),ss=[vr("useFixed",!1),dr("getBounds")],fs=ju({fields:ss,name:"positioning",active:Ku,apis:cs}),ls=function(t){Ar(t,Hn());var n=t.components();M(n,ls)},ds=function(t){var n=t.components();M(n,ds),Ar(t,Rn())},ms=function(t,n){gs(t,n,be)},gs=function(t,n,e){t.getSystem().addToWorld(n),e(t.element(),n.element()),Pr(t.element())&&ds(n),t.syncComponents()},ps=function(t){ls(t),we(t.element()),t.getSystem().removeFromWorld(t)},hs=function(n){var t=le(n.element()).bind(function(t){return n.getSystem().getByDom(t).fold(tt.none,tt.some)});ps(n),t.each(function(t){t.syncComponents()})},vs=function(t){var n=t.components();M(n,ps),xe(t.element()),t.syncComponents()},bs=function(t,n){ys(t,n,be)},ys=function(t,n,e){e(t,n.element());var o=me(n.element());M(o,function(t){n.getByDom(t).each(ds)})},xs=function(n){var t=me(n.element());M(t,function(t){n.getByDom(t).each(ls)}),we(n.element())},ws=function(t,n,e,o){var r=function(n,t,e,o){e.get().each(function(t){vs(n)});var r=t.getAttachPoint(n);ms(r,n);var i=n.getSystem().build(o);return ms(n,i),e.set(i),i}(t,n,e,o);return n.onOpen(t,r),r},Ss=function(n,e,o){o.get().each(function(t){vs(n),hs(n),e.onClose(n,t),o.clear()})},Cs=function(t,n,e){return e.isOpen()},ks=function(t,n,e){var o,r,i,u,a=n.getAttachPoint(t);Ki(t.element(),"position",fs.getMode(a)),o=t,r="visibility",i=n.cloakVisibilityAttr,u="hidden",Zi(o.element(),r).fold(function(){Ie(o.element(),i)},function(t){De(o.element(),i,t)}),Ki(o.element(),r,u)},Os=function(t,n,e){var o;o=t.element(),A(["top","left","right","bottom"],function(t){return Zi(o,t).isSome()})||nu(t.element(),"position"),function(t,n,e){if(Fe(t.element(),e)){var o=Me(t.element(),e);Ki(t.element(),n,o)}else nu(t.element(),n)}(t,"visibility",n.cloakVisibilityAttr)},Es=/* */Object.freeze({cloak:ks,decloak:Os,open:ws,openWhileCloaked:function(t,n,e,o,r){ks(t,n,e),ws(t,n,e,o),r(),Os(t,n,e)},close:Ss,isOpen:Cs,isPartOf:function(n,e,t,o){return Cs(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()}}),Ts=/* */Object.freeze({events:function(e,o){return Xr([Kr(_n(),function(t,n){Ss(t,e,o)})])}}),Bs=[Bu("onOpen"),Bu("onClose"),rr("isPartOf"),rr("getAttachPoint"),vr("cloakVisibilityAttr","data-precloak-visibility")],As=ju({fields:Bs,name:"sandboxing",active:Ts,apis:Es,state:/* */Object.freeze({init:function(){var n=Tt(tt.none()),t=Z("not-implemented");return Oi({readState:t,isOpen:function(){return n.get().isSome()},clear:function(){n.set(tt.none())},set:function(t){n.set(tt.some(t))},get:function(t){return n.get()}})}})}),Ds=Z("dismiss.popups"),_s=Z("mouse.released"),Ms=Fo([vr("isExtraPart",Z(!1)),hr("fireEventInstead",[vr("event",Nn())])]),Fs=function(t){var n=Is(t);return qu.config(n)},Is=function(t){var e=qo("Dismissal",Ms,t);return{channels:Ct(Ds(),{schema:Fo([rr("target")]),onReceive:function(n,t){As.isOpen(n)&&(As.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return As.close(n)},function(t){return Ar(n,t.event)}))}})}},Vs=function(o,t){return kr(o,{},_(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,zo(n,n,oo(),Mo(function(t){return go("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([Or("dump",d)]))},Rs=function(t){return t.dump},Hs=function(t,n){return Je({},t.dump,zu(n))},Ns=Vs,Ps=Hs,zs="placeholder",Ls=gt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),js=function(t,n,e,o){return e.uiType===zs?(i=e,u=o,(r=t).exists(function(t){return t!==i.owner})?Ls.single(!0,Z(i)):St(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+J(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+Oo(i,null,2))},function(t){return t.replace()})):Ls.single(!1,Z(e));var r,i,u},Us=function(i,u,a,c){return js(i,0,a,c).fold(function(t,n){var e=n(u,a.config,a.validated),o=St(e,"components").getOr([]),r=L(o,function(t){return Us(i,u,t,c)});return[Je({},e,{components:r})]},function(t,n){var e=n(u,a.config,a.validated);return a.validated.preprocess.getOr(d)(e)})},Ws=function(n,e,t,o){var r,i,u,a=et(o,function(t,n){return o=t,r=!1,{name:Z(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),c=(r=n,i=e,u=a,L(t,function(t){return Us(r,i,t,u)}));return nt(a,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+Oo(e.components,null,2))}),c},Gs=Ls.single,Xs=Ls.multiple,Ys=Z(zs),qs=gt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Ks=vr("factory",{sketch:d}),Js=vr("schema",[]),$s=rr("name"),Qs=zo("pname","pname",ro(function(t){return"<alloy."+qe(t.name)+">"}),$o()),Zs=Or("schema",function(){return[dr("preprocess")]}),tf=vr("defaults",Z({})),nf=vr("overrides",Z({})),ef=Io([Ks,Js,$s,Qs,tf,nf]),of=Io([Ks,Js,$s,tf,nf]),rf=Io([Ks,Js,$s,Qs,tf,nf]),uf=Io([Ks,Zs,$s,rr("unit"),Qs,tf,nf]),af=function(t){return t.fold(tt.some,tt.none,tt.some,tt.some)},cf=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},sf=function(e,o){return function(t){var n=qo("Converting part type",o,t);return e(n)}},ff=sf(qs.required,ef),lf=sf(qs.external,of),df=sf(qs.optional,rf),mf=sf(qs.group,uf),gf=Z("entirety"),pf=/* */Object.freeze({required:ff,external:lf,optional:df,group:mf,asNamedPart:af,name:cf,asCommon:function(t){return t.fold(d,d,d,d)},original:gf}),hf=function(t,n,e,o){return vt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},vf=function(r,t){var n={};return M(t,function(t){af(t).each(function(e){var o=bf(r,e.pname);n[e.name]=function(t){var n=qo("Part: "+e.name+" in "+r,Io(e.schema),t);return Je({},o,{config:t,validated:n})}})}),n},bf=function(t,n){return{uiType:Ys(),owner:t,name:n}},yf=function(t,n,e){return{uiType:Ys(),owner:t,name:n,config:e,validated:{}}},xf=function(t){return L(t,function(t){return t.fold(tt.none,tt.some,tt.none,tt.none).map(function(t){return sr(t.name,t.schema.concat([Fu(gf())]))}).toArray()})},wf=function(t){return _(t,cf)},Sf=function(t,n,e){return o=n,i={},r={},M(e,function(t){t.fold(function(o){i[o.pname]=Gs(!0,function(t,n,e){return o.factory.sketch(hf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=Z(t.factory.sketch(hf(o,t,n[gf()]),n))},function(o){i[o.pname]=Gs(!1,function(t,n,e){return o.factory.sketch(hf(t,o,n,e))})},function(r){i[r.pname]=Xs(!0,function(n,t,e){var o=n[r.name];return _(o,function(t){return r.factory.sketch(vt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:Z(i),externals:Z(r)};var o,i,r},Cf=function(t,n,e){return Ws(tt.some(t),n,n.components,e)},kf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},Of=function(t,n,e){return kf(t,n,e).getOrDie("Could not find part: "+e)},Ef=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return M(e,function(t){o[t]=i.getByUid(r[t])}),et(o,Z)},Tf=function(t,n){var e=t.getSystem();return et(n.partUids,function(t,n){return Z(e.getByUid(t))})},Bf=function(t){return J(t.partUids)},Af=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return M(e,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),et(o,Z)},Df=function(n,t){var e=wf(t);return kt(_(e,function(t){return{key:t,value:n+"-"+t}}))},_f=function(n){return zo("partUids","partUids",io(function(t){return Df(t.uid,n)}),$o())},Mf=/* */Object.freeze({generate:vf,generateOne:yf,schemas:xf,names:wf,substitutes:Sf,components:Cf,defaultUids:Df,defaultUidsSchema:_f,getAllParts:Tf,getAllPartNames:Bf,getPart:kf,getPartOrDie:Of,getParts:Ef,getPartsOrDie:Af}),Ff=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[sr("parts",i)]:[]).concat([rr("uid"),vr("dom",{}),vr("components",[]),Fu("originalSpec"),vr("debug.sketcher",{})]).concat(u));return qo(t+" [SpecSchema]",Fo(a.concat(n)),e)},If=function(t,n,e,o,r){var i=Vf(r),u=xf(e),a=_f(e),c=Ff(t,n,i,u,[a]),s=Sf(0,c,e);return o(c,Cf(t,c,s.internals()),i,s.externals())},Vf=function(t){return t.hasOwnProperty("uid")?t:Je({},t,{uid:pi("uid")})},Rf=Fo([rr("name"),rr("factory"),rr("configFields"),vr("apis",{}),vr("extraApis",{})]),Hf=Fo([rr("name"),rr("factory"),rr("configFields"),rr("partFields"),vr("apis",{}),vr("extraApis",{})]),Nf=function(t){var i=qo("Sketcher for "+t.name,Rf,t),n=et(i.apis,Ci),e=et(i.extraApis,function(t,n){return xi(t,n)});return Je({name:Z(i.name),partFields:Z([]),configFields:Z(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=Vf(t),o(Ff(n,e,r,[],[]),r);var n,e,o,r}},n,e)},Pf=function(t){var n=qo("Sketcher for "+t.name,Hf,t),e=vf(n.name,n.partFields),o=et(n.apis,Ci),r=et(n.extraApis,function(t,n){return xi(t,n)});return Je({name:Z(n.name),partFields:Z(n.partFields),configFields:Z(n.configFields),sketch:function(t){return If(n.name,n.configFields,n.partFields,n.factory,t)},parts:Z(e)},o,r)},zf=function(t){return"input"===ke(t)&&"radio"!==Me(t,"type")||"textarea"===ke(t)},Lf=/* */Object.freeze({getCurrent:function(t,n,e){return n.find(t)}}),jf=[rr("find")],Uf=ju({fields:jf,name:"composing",apis:Lf}),Wf=function(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r},Gf=function(t,n,e){return t<=n?n:e<=t?e:t},Xf=function(e,o,t,r){var n=_c(e.element(),"."+o.highlightClass);M(n,function(n){A(r,function(t){return t.element()===n})||(ji(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),Ar(t,Wn())}))})},Yf=function(t,n,e,o){Xf(t,n,0,[o]),qf(t,n,e,o)||(zi(o.element(),n.highlightClass),n.onHighlight(t,o),Ar(o,Un()))},qf=function(t,n,e,o){return Ui(o.element(),n.highlightClass)},Kf=function(t,n,e,o){var r=_c(t.element(),"."+n.itemClass);return tt.from(r[o]).fold(function(){return mt.error("No element found with index "+o)},t.getSystem().getByDom)},Jf=function(n,t,e){return vu(n.element(),"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},$f=function(n,t,e){var o=_c(n.element(),"."+t.itemClass);return(0<o.length?tt.some(o[o.length-1]):tt.none()).bind(function(t){return n.getSystem().getByDom(t).toOption()})},Qf=function(e,n,t,o){var r=_c(e.element(),"."+n.itemClass);return H(r,function(t){return Ui(t,n.highlightClass)}).bind(function(t){var n=Wf(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOption()})},Zf=function(n,t,e){var o=_c(n.element(),"."+t.itemClass);return Bt(_(o,function(t){return n.getSystem().getByDom(t).toOption()}))},tl=/* */Object.freeze({dehighlightAll:function(t,n,e){return Xf(t,n,0,[])},dehighlight:function(t,n,e,o){qf(t,n,e,o)&&(ji(o.element(),n.highlightClass),n.onDehighlight(t,o),Ar(o,Wn()))},highlight:Yf,highlightFirst:function(n,e,o){Jf(n,e,o).each(function(t){Yf(n,e,o,t)})},highlightLast:function(n,e,o){$f(n,e,o).each(function(t){Yf(n,e,o,t)})},highlightAt:function(n,e,o,t){Kf(n,e,o,t).fold(function(t){throw new Error(t)},function(t){Yf(n,e,o,t)})},highlightBy:function(n,e,o,t){var r=Zf(n,e,o);R(r,t).each(function(t){Yf(n,e,o,t)})},isHighlighted:qf,getHighlighted:function(n,t,e){return vu(n.element(),"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},getFirst:Jf,getLast:$f,getPrevious:function(t,n,e){return Qf(t,n,0,-1)},getNext:function(t,n,e){return Qf(t,n,0,1)},getCandidates:Zf}),nl=[rr("highlightClass"),rr("itemClass"),Bu("onHighlight"),Bu("onDehighlight")],el=ju({fields:nl,name:"highlighting",apis:tl}),ol=function(t,n,e){var o=W(t.slice(0,n)),r=W(t.slice(n+1));return R(o.concat(r),e)},rl=function(t,n,e){var o=W(t.slice(0,n));return R(o,e)},il=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return R(r.concat(o),e)},ul=function(t,n,e){var o=t.slice(n+1);return R(o,e)},al=function(e){return function(t){var n=t.raw();return B(e,n.which)}},cl=function(t){return function(n){return j(t,function(t){return t(n)})}},sl=function(t){return!0===t.raw().shiftKey},fl=function(t){return!0===t.raw().ctrlKey},ll=m(sl),dl=function(t,n){return{matches:t,classification:n}},ml=function(t){t.dom().focus()},gl=function(t){var n=t!==undefined?t.dom():h.document;return tt.from(n.activeElement).map(Xn.fromDom)},pl=function(n){return gl(se(n)).filter(function(t){return n.dom().contains(t.dom())})},hl=function(t,n,e){n.exists(function(n){return e.exists(function(t){return ce(t,n)})})||Dr(t,Pn(),{prevFocus:n,newFocus:e})},vl=function(){var r=function(t){return pl(t.element())};return{get:r,set:function(t,n){var e=r(t);t.getSystem().triggerFocus(n,t.element());var o=r(t);hl(t,e,o)}}},bl=function(){var r=function(t){return el.getHighlighted(t).map(function(t){return t.element()})};return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold(Q,function(t){el.highlight(n,t)});var o=r(n);hl(n,e,o)}}};(ra=oa||(oa={})).OnFocusMode="onFocus",ra.OnEnterOrSpaceMode="onEnterOrSpace",ra.OnApiMode="onApi";var yl=function(t,n,e,o,a){var c=function(n,e,t,o,r){var i,u,a=t(n,e,o,r);return(i=a,u=e.event(),R(i,function(t){return t.matches(u)}).map(function(t){return t.classification})).bind(function(t){return t(n,e,o,r)})},r={schema:function(){return t.concat([vr("focusManager",vl()),br("focusInside","onFocus",Wo(function(t){return B(["onFocus","onEnterOrSpace","onApi"],t)?mt.value(t):mt.error("Invalid value for focusInside")})),Mu("handler",r),Mu("state",n),Mu("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==oa.OnFocusMode?tt.none():a(i).map(function(e){return Kr(Sn(),function(t,n){e(t,i,u),n.stop()})});return Xr(t.toArray().concat([Kr(zt(),function(o,r){c(o,r,e,i,u).fold(function(){var n,e,t;n=o,e=r,t=al([32].concat([13]))(e.event()),i.focusInside===oa.OnEnterOrSpaceMode&&t&&Er(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),Kr(Lt(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})]))}};return r},xl=function(t){var n=[dr("onEscape"),dr("onEnter"),vr("selector",'[data-alloy-tabstop="true"]'),vr("firstTabstop",0),vr("useTabstopAt",Z(!0)),dr("visibilitySelector")].concat([t]),u=function(t,n){var e=t.visibilitySelector.bind(function(t){return bu(n,t)}).getOr(n);return 0<sa(e)},e=function(n,e){var t,o,r,i;(t=n,o=e,r=_c(t.element(),o.selector),i=F(r,function(t){return u(o,t)}),tt.from(i[o.firstTabstop])).each(function(t){e.focusManager.set(n,t)})},a=function(n,t,e,o,r){return r(t,e,function(t){return u(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?tt.some(!0):tt.none()},function(t){return o.focusManager.set(n,t),tt.some(!0)})},i=function(n,t,e,o){var r,i,u=_c(n.element(),e.selector);return(r=n,i=e,i.focusManager.get(r).bind(function(t){return bu(t,i.selector)})).bind(function(t){return H(u,v(ce,t)).bind(function(t){return a(n,u,t,e,o)})})},o=Z([dl(cl([sl,al([9])]),function(t,n,e,o){var r=e.cyclic?ol:rl;return i(t,0,e,r)}),dl(al([9]),function(t,n,e,o){var r=e.cyclic?il:ul;return i(t,0,e,r)}),dl(al([27]),function(n,e,t,o){return t.onEscape.bind(function(t){return t(n,e)})}),dl(cl([ll,al([13])]),function(n,e,t,o){return t.onEnter.bind(function(t){return t(n,e)})})]),r=Z([]);return yl(n,ki.init,o,r,function(){return tt.some(e)})},wl=xl(Or("cyclic",Z(!1))),Sl=xl(Or("cyclic",Z(!0))),Cl=function(t,n,e){return zf(e)&&al([32])(n.event())?tt.none():(Mr(t,e,En()),tt.some(!0))},kl=function(t,n){return tt.some(!0)},Ol=[vr("execute",Cl),vr("useSpace",!1),vr("useEnter",!0),vr("useControlEnter",!1),vr("useDown",!1)],El=function(t,n,e){return e.execute(t,n,t.element())},Tl=yl(Ol,ki.init,function(t,n,e,o){var r=e.useSpace&&!zf(t.element())?[32]:[],i=e.useEnter?[13]:[],u=e.useDown?[40]:[],a=r.concat(i).concat(u);return[dl(al(a),El)].concat(e.useControlEnter?[dl(cl([fl,al([13])]),El)]:[])},function(t,n,e,o){return e.useSpace&&!zf(t.element())?[dl(al([32]),kl)]:[]},function(){return tt.none()}),Bl=function(t){var e=Tt(tt.none());return Oi({readState:function(){return e.get().map(function(t){return{numRows:t.numRows(),numColumns:t.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set(tt.some({numRows:Z(t),numColumns:Z(n)}))},getNumRows:function(){return e.get().map(function(t){return t.numRows()})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns()})}})},Al=/* */Object.freeze({flatgrid:Bl,init:function(t){return t.state(t)}}),Dl=function(i){return function(t,n,e,o){var r=i(t.element());return Il(r,t,n,e,o)}},_l=function(t,n){var e=mc(t,n);return Dl(e)},Ml=function(t,n){var e=mc(n,t);return Dl(e)},Fl=function(r){return function(t,n,e,o){return Il(r,t,n,e,o)}},Il=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element(),t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},Vl=Fl,Rl=Fl,Hl=Fl,Nl=function(t){var n,e=t.dom();return!((n=e).offsetWidth<=0&&n.offsetHeight<=0)},Pl=Jn(["index","candidates"],[]),zl=function(t,n,e){return Ll(t,n,e,Nl)},Ll=function(t,n,e,o){var r,i=v(ce,n),u=_c(t,e),a=F(u,Nl);return H(r=a,i).map(function(t){return Pl({index:t,candidates:r})})},jl=function(t,n){return H(t,function(t){return ce(n,t)})},Ul=function(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row()*o+t.column();return 0<=n&&n<e.length?tt.some(e[n]):tt.none()})},Wl=function(r,t,i,u,a){return Ul(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=Wf(n,a,0,e-1);return tt.some({row:Z(t),column:Z(o)})})},Gl=function(i,t,u,a,c){return Ul(i,t,a,function(t,n){var e=Wf(t,c,0,u-1),o=e===u-1?i.length-e*a:a,r=Gf(n,0,o-1);return tt.some({row:Z(e),column:Z(r)})})},Xl=[rr("selector"),vr("execute",Cl),Au("onEscape"),vr("captureTab",!1),Iu()],Yl=function(n,e,t){vu(n.element(),e.selector).each(function(t){e.focusManager.set(n,t)})},ql=function(r){return function(t,n,e,o){return zl(t,n,e.selector).bind(function(t){return r(t.candidates(),t.index(),o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}},Kl=function(t,n,e,o){return e.captureTab?tt.some(!0):tt.none()},Jl=ql(function(t,n,e,o){return Wl(t,n,e,o,-1)}),$l=ql(function(t,n,e,o){return Wl(t,n,e,o,1)}),Ql=ql(function(t,n,e,o){return Gl(t,n,e,o,-1)}),Zl=ql(function(t,n,e,o){return Gl(t,n,e,o,1)}),td=Z([dl(al([37]),_l(Jl,$l)),dl(al([39]),Ml(Jl,$l)),dl(al([38]),Vl(Ql)),dl(al([40]),Rl(Zl)),dl(cl([sl,al([9])]),Kl),dl(cl([ll,al([9])]),Kl),dl(al([27]),function(t,n,e,o){return e.onEscape(t,n)}),dl(al([32].concat([13])),function(n,e,o,t){return(r=n,i=o,i.focusManager.get(r).bind(function(t){return bu(t,i.selector)})).bind(function(t){return o.execute(n,e,t)});var r,i})]),nd=Z([dl(al([32]),kl)]),ed=yl(Xl,Bl,td,nd,function(){return tt.some(Yl)}),od=function(t,n,e,i){var u=function(t,n,e){var o,r=Wf(n,i,0,e.length-1);return r===t?tt.none():(o=e[r],"button"===ke(o)&&"disabled"===Me(o,"disabled")?u(t,r,e):tt.from(e[r]))};return zl(t,e,n).bind(function(t){var n=t.index(),e=t.candidates();return u(n,n,e)})},rd=[rr("selector"),vr("getInitial",tt.none),vr("execute",Cl),Au("onEscape"),vr("executeOnMove",!1),vr("allowVertical",!0)],id=function(n,e,o){return(t=n,r=o,r.focusManager.get(t).bind(function(t){return bu(t,r.selector)})).bind(function(t){return o.execute(n,e,t)});var t,r},ud=function(n,e){e.getInitial(n).orThunk(function(){return vu(n.element(),e.selector)}).each(function(t){e.focusManager.set(n,t)})},ad=function(t,n,e){return od(t,e.selector,n,-1)},cd=function(t,n,e){return od(t,e.selector,n,1)},sd=function(o){return function(t,n,e){return o(t,n,e).bind(function(){return e.executeOnMove?id(t,n,e):tt.some(!0)})}},fd=function(t,n,e,o){return e.onEscape(t,n)},ld=Z([dl(al([32]),kl)]),dd=yl(rd,ki.init,function(t,n,e,o){var r=[37].concat(e.allowVertical?[38]:[]),i=[39].concat(e.allowVertical?[40]:[]);return[dl(al(r),sd(_l(ad,cd))),dl(al(i),sd(Ml(ad,cd))),dl(al([13]),id),dl(al([32]),id),dl(al([27]),fd)]},ld,function(){return tt.some(ud)}),md=Jn(["rowIndex","columnIndex","cell"],[]),gd=function(t,n,e){return tt.from(t[n]).bind(function(t){return tt.from(t[e]).map(function(t){return md({rowIndex:n,columnIndex:e,cell:t})})})},pd=function(t,n,e,o){var r=t[n].length,i=Wf(e,o,0,r-1);return gd(t,n,i)},hd=function(t,n,e,o){var r=Wf(e,o,0,t.length-1),i=t[r].length,u=Gf(n,0,i-1);return gd(t,r,u)},vd=function(t,n,e,o){var r=t[n].length,i=Gf(e+o,0,r-1);return gd(t,n,i)},bd=function(t,n,e,o){var r=Gf(e+o,0,t.length-1),i=t[r].length,u=Gf(n,0,i-1);return gd(t,r,u)},yd=[sr("selectors",[rr("row"),rr("cell")]),vr("cycles",!0),vr("previousSelector",tt.none),vr("execute",Cl)],xd=function(n,e){e.previousSelector(n).orThunk(function(){var t=e.selectors;return vu(n.element(),t.cell)}).each(function(t){e.focusManager.set(n,t)})},wd=function(t,n){return function(e,o,i){var u=i.cycles?t:n;return bu(o,i.selectors.row).bind(function(t){var n=_c(t,i.selectors.cell);return jl(n,o).bind(function(o){var r=_c(e,i.selectors.row);return jl(r,t).bind(function(t){var n,e=(n=i,_(r,function(t){return _c(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell()})})})})}},Sd=wd(function(t,n,e){return pd(t,n,e,-1)},function(t,n,e){return vd(t,n,e,-1)}),Cd=wd(function(t,n,e){return pd(t,n,e,1)},function(t,n,e){return vd(t,n,e,1)}),kd=wd(function(t,n,e){return hd(t,e,n,-1)},function(t,n,e){return bd(t,e,n,-1)}),Od=wd(function(t,n,e){return hd(t,e,n,1)},function(t,n,e){return bd(t,e,n,1)}),Ed=Z([dl(al([37]),_l(Sd,Cd)),dl(al([39]),Ml(Sd,Cd)),dl(al([38]),Vl(kd)),dl(al([40]),Rl(Od)),dl(al([32].concat([13])),function(n,e,o){return pl(n.element()).bind(function(t){return o.execute(n,e,t)})})]),Td=Z([dl(al([32]),kl)]),Bd=yl(yd,ki.init,Ed,Td,function(){return tt.some(xd)}),Ad=[rr("selector"),vr("execute",Cl),vr("moveOnTab",!1)],Dd=function(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})},_d=function(n,e){vu(n.element(),e.selector).each(function(t){e.focusManager.set(n,t)})},Md=function(t,n,e){return od(t,e.selector,n,-1)},Fd=function(t,n,e){return od(t,e.selector,n,1)},Id=Z([dl(al([38]),Hl(Md)),dl(al([40]),Hl(Fd)),dl(cl([sl,al([9])]),function(t,n,e){return e.moveOnTab?Hl(Md)(t,n,e):tt.none()}),dl(cl([ll,al([9])]),function(t,n,e){return e.moveOnTab?Hl(Fd)(t,n,e):tt.none()}),dl(al([13]),Dd),dl(al([32]),Dd)]),Vd=Z([dl(al([32]),kl)]),Rd=yl(Ad,ki.init,Id,Vd,function(){return tt.some(_d)}),Hd=[Au("onSpace"),Au("onEnter"),Au("onShiftEnter"),Au("onLeft"),Au("onRight"),Au("onTab"),Au("onShiftTab"),Au("onUp"),Au("onDown"),Au("onEscape"),vr("stopSpaceKeyup",!1),dr("focusIn")],Nd=yl(Hd,ki.init,function(t,n,e){return[dl(al([32]),e.onSpace),dl(cl([ll,al([13])]),e.onEnter),dl(cl([sl,al([13])]),e.onShiftEnter),dl(cl([sl,al([9])]),e.onShiftTab),dl(cl([ll,al([9])]),e.onTab),dl(al([38]),e.onUp),dl(al([40]),e.onDown),dl(al([37]),e.onLeft),dl(al([39]),e.onRight),dl(al([32]),e.onSpace),dl(al([27]),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[dl(al([32]),kl)]:[]},function(t){return t.focusIn}),Pd=wl.schema(),zd=Sl.schema(),Ld=dd.schema(),jd=ed.schema(),Ud=Bd.schema(),Wd=Tl.schema(),Gd=Rd.schema(),Xd=Nd.schema(),Yd=Wu({branchKey:"mode",branches:/* */Object.freeze({acyclic:Pd,cyclic:zd,flow:Ld,flatgrid:jd,matrix:Ud,execution:Wd,menu:Gd,special:Xd}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element(),n.element())},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){Et(e,"setGridSize")?e.setGridSize(o,r):h.console.error("Layout does not support setGridSize")}},state:Al}),qd=function(t,n,e,o){var r=t.getSystem().build(o);gs(t,r,e)},Kd=function(t,n,e,o){var r=Jd(t,n);R(r,function(t){return ce(o.element(),t.element())}).each(hs)},Jd=function(t,n){return t.components()},$d=function(n,e,t,r,o){var i=Jd(n,e);return tt.from(i[r]).map(function(t){return Kd(n,e,0,t),o.each(function(t){qd(n,0,function(t,n){var e,o;o=n,ge(e=t,r).fold(function(){be(e,o)},function(t){pe(t,o)})},t)}),t})},Qd=ju({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(t,n,e,o){qd(t,0,be,o)},prepend:function(t,n,e,o){qd(t,0,ve,o)},remove:Kd,replaceAt:$d,replaceBy:function(n,e,t,o,r){var i=Jd(n,e);return H(i,o).bind(function(t){return $d(n,e,0,t,r)})},set:function(n,t,e,o){var r,i,u,a;vs(n),r=function(){var t=_(o,n.getSystem().build);M(t,function(t){ms(n,t)})},i=n.element(),u=se(i),a=gl(u).bind(function(n){var t=function(t){return ce(n,t)};return t(i)?tt.some(i):Wr(i,t)}),r(i),a.each(function(n){gl(u).filter(function(t){return ce(t,n)}).fold(function(){ml(n)},Q)})},contents:Jd})}),Zd=function(t,n,e){n.store.manager.onLoad(t,n,e)},tm=function(t,n,e){n.store.manager.onUnload(t,n,e)},nm=/* */Object.freeze({onLoad:Zd,onUnload:tm,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),em=/* */Object.freeze({events:function(e,o){var t=e.resetOnDom?[oi(function(t,n){Zd(t,e,o)}),ri(function(t,n){tm(t,e,o)})]:[Vu(e,o,Zd)];return Xr(t)}}),om=function(){var t=Tt(null);return Oi({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},rm=function(){var i=Tt({}),u=Tt({});return Oi({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return St(i.get(),t).orThunk(function(){return St(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};M(t,function(n){o[n.value]=n,St(n,"meta").each(function(t){St(t,"text").each(function(t){r[t]=n})})}),i.set(Je({},n,o)),u.set(Je({},e,r))},clear:function(){i.set({}),u.set({})}})},im=/* */Object.freeze({memory:om,dataset:rm,manual:function(){return Oi({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),um=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},am=[dr("initialValue"),rr("getFallbackEntry"),rr("getDataKey"),rr("setValue"),Mu("manager",{setValue:um,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){um(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:rm})],cm=[rr("getValue"),vr("setValue",Q),dr("initialValue"),Mu("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:Q,state:ki.init})],sm=[dr("initialValue"),Mu("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:om})],fm=[br("store",{mode:"memory"},Jo("mode",{memory:sm,manual:cm,dataset:am})),Bu("onSetValue"),vr("resetOnDom",!1)],lm=ju({fields:fm,name:"representing",active:em,apis:nm,extra:{setValueFrom:function(t,n){var e=lm.getValue(n);lm.setValue(t,e)}},state:im}),dm=function(t,n){n.ignore||(ml(t.element()),n.onFocus(t))},mm=/* */Object.freeze({focus:dm,blur:function(t,n){n.ignore||t.element().dom().blur()},isFocused:function(t){return n=t.element(),e=se(n).dom(),n.dom()===e.activeElement;var n,e}}),gm=/* */Object.freeze({exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return Ti(e)},events:function(e){return Xr([Kr(Sn(),function(t,n){dm(t,e),n.stop()})].concat(e.stopMousedown?[Kr(Ft(),function(t,n){n.event().prevent()})]:[]))}}),pm=[Bu("onFocus"),vr("stopMousedown",!1),vr("ignore",!1)],hm=ju({fields:pm,name:"focusing",active:gm,apis:mm}),vm=function(t,n,e){var o=n.aria;o.update(t,o,e.get())},bm=function(n,t,e){t.toggleClass.each(function(t){e.get()?zi(n.element(),t):ji(n.element(),t)})},ym=function(t,n,e){Sm(t,n,e,!e.get())},xm=function(t,n,e){e.set(!0),bm(t,n,e),vm(t,n,e)},wm=function(t,n,e){e.set(!1),bm(t,n,e),vm(t,n,e)},Sm=function(t,n,e,o){(o?xm:wm)(t,n,e)},Cm=function(t,n,e){Sm(t,n,e,n.selected)},km=/* */Object.freeze({onLoad:Cm,toggle:ym,isOn:function(t,n,e){return e.get()},on:xm,off:wm,set:Sm}),Om=/* */Object.freeze({exhibit:function(t,n,e){return Ti({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=ym,ui(function(t){r(t,e,o)})),u=Vu(t,n,Cm);return Xr(z([t.toggleOnExecute?[i]:[],[u]]))}}),Em=/* */Object.freeze({init:function(t){var n=Tt(!1);return{readState:function(){return n.get()},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(!1)}}}}),Tm=function(t,n,e){De(t.element(),"aria-expanded",e)},Bm=[vr("selected",!1),dr("toggleClass"),vr("toggleOnExecute",!0),br("aria",{mode:"none"},Jo("mode",{pressed:[vr("syncWithExpanded",!1),Mu("update",function(t,n,e){De(t.element(),"aria-pressed",e),n.syncWithExpanded&&Tm(t,n,e)})],checked:[Mu("update",function(t,n,e){De(t.element(),"aria-checked",e)})],expanded:[Mu("update",Tm)],selected:[Mu("update",function(t,n,e){De(t.element(),"aria-selected",e)})],none:[Mu("update",Q)]}))],Am=ju({fields:Bm,name:"toggling",active:Om,apis:km,state:Em}),Dm="alloy.item-hover",_m="alloy.item-focus",Mm=function(t){(pl(t.element()).isNone()||hm.isFocused(t))&&(hm.isFocused(t)||hm.focus(t),Dr(t,Dm,{item:t}))},Fm=function(t){Dr(t,_m,{item:t})},Im=Z(Dm),Vm=Z(_m),Rm=function(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=Xr(n),ju({fields:[rr("enabled")],name:e,active:{events:Z(o)}})),configAsRaw:Z({}),initialConfig:{},state:ki}}},Hm=[rr("data"),rr("components"),rr("dom"),vr("hasSubmenu",!1),dr("toggling"),Ns("itemBehaviours",[Am,hm,Yd,lm]),vr("ignoreFocus",!1),vr("domModification",{}),Mu("builder",function(t){return{dom:t.dom,domModification:Je({},t.domModification,{attributes:Je({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes,{"aria-haspopup":t.hasSubmenu},t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Ps(t.itemBehaviours,[t.toggling.fold(Am.revoke,function(t){return Am.config(Je({aria:{mode:"checked"}},t))}),hm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Fm(t)}}),Yd.config({mode:"execution"}),lm.config({store:{mode:"memory",initialValue:t.data}}),Rm("item-type-events",[Kr(An(),_r),ti(Ft()),Kr(Ht(),Mm),Kr(Tn(),hm.focus)])]),components:t.components,eventOrder:t.eventOrder}}),vr("eventOrder",{})],Nm=[rr("dom"),rr("components"),Mu("builder",function(t){return{dom:t.dom,components:t.components,events:Xr([ni(Tn())])}})],Pm=Z([ff({name:"widget",overrides:function(n){return{behaviours:zu([lm.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:function(){}}})])}}})]),zm=[rr("uid"),rr("data"),rr("components"),rr("dom"),vr("autofocus",!1),vr("ignoreFocus",!1),Ns("widgetBehaviours",[lm,hm,Yd]),vr("domModification",{}),_f(Pm()),Mu("builder",function(e){var t=Sf(0,e,Pm()),n=Cf("item-widget",e,t.internals()),o=function(t){return kf(t,e,"widget").map(function(t){return Yd.focusIn(t),t})},r=function(t,n){return zf(n.event().target())||e.autofocus&&n.setSource(t.element()),tt.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:Xr([ui(function(t,n){o(t).each(function(t){n.stop()})}),Kr(Ht(),Mm),Kr(Tn(),function(t,n){e.autofocus?o(t):hm.focus(t)})]),behaviours:Ps(e.widgetBehaviours,[lm.config({store:{mode:"memory",initialValue:e.data}}),hm.config({ignore:e.ignoreFocus,onFocus:function(t){Fm(t)}}),Yd.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:Gu(),onLeft:r,onRight:r,onEscape:function(t,n){return hm.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element()),tt.none()):(hm.focus(t),tt.some(!0))}})])}})],Lm=Jo("type",{widget:zm,item:Hm,separator:Nm}),jm=Z([mf({factory:{sketch:function(t){var n=qo("menu.spec item",Lm,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return n.hasOwnProperty("uid")?n:Je({},n,{uid:pi("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Um=Z([rr("value"),rr("items"),rr("dom"),rr("components"),vr("eventOrder",{}),Vs("menuBehaviours",[el,lm,Uf,Yd]),br("movement",{mode:"menu",moveOnTab:!0},Jo("mode",{grid:[Iu(),Mu("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[Mu("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),rr("rowSelector")],menu:[vr("moveOnTab",!0),Mu("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),ir("markers",Cu()),vr("fakeFocus",!1),vr("focusManager",vl()),Bu("onHighlight")]),Wm=Z("alloy.menu-focus"),Gm=Pf({name:"Menu",configFields:Um(),partFields:jm(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Hs(t.menuBehaviours,[el.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),lm.config({store:{mode:"memory",initialValue:t.value}}),Uf.config({find:tt.some}),Yd.config(t.movement.config(t,t.movement))]),events:Xr([Kr(Vm(),function(n,e){var t=e.event();n.getSystem().getByDom(t.target()).each(function(t){el.highlight(n,t),e.stop(),Dr(n,Wm(),{menu:n,item:t})})}),Kr(Im(),function(t,n){var e=n.event().item();el.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Xm=function(e,o,r,t){return St(r,t).bind(function(t){return St(e,t).bind(function(t){var n=Xm(e,o,r,t);return tt.some([t].concat(n))})}).getOr([])},Ym=function(t,n){var e={};nt(t,function(t,n){M(t,function(t){e[t]=n})});var o=n,r=ot(n,function(t,n){return{k:t,v:n}}),i=et(r,function(t,n){return[n].concat(Xm(e,o,r,n))});return et(e,function(t){return St(i,t).getOr([t])})},qm=function(){var i=Tt({}),u=Tt({}),a=Tt({}),c=Tt(tt.none()),s=Tt({}),n=function(t){return St(u.get(),t)};return{setMenuBuilt:function(t,n){var e;u.set(Je({},u.get(),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){c.set(tt.some(t)),i.set(e),u.set(n),s.set(o);var r=Ym(o,e);a.set(r)},expand:function(e){return St(i.get(),e).map(function(t){var n=St(a.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return St(a.get(),t)},collapse:function(t){return St(a.get(),t).bind(function(t){return 1<t.length?tt.some(t.slice(1)):tt.none()})},lookupMenu:n,otherMenus:function(t){var n=s.get();return G(J(n),t)},getPrimary:function(){return c.get().bind(function(t){return n(t).bind(function(t){return"prepared"===t.type?tt.some(t.menu):tt.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(tt.none())},isClear:function(){return c.get().isNone()}}},Km=Z("collapse-item"),Jm=Nf({name:"TieredMenu",configFields:[_u("onExecute"),_u("onEscape"),Du("onOpenMenu"),Du("onOpenSubmenu"),Bu("onCollapseMenu"),vr("highlightImmediately",!0),sr("data",[rr("primary"),rr("menus"),rr("expansions")]),vr("fakeFocus",!1),Bu("onHighlight"),Bu("onHover"),Ou(),rr("dom"),vr("navigateOnHover",!0),vr("stayInDom",!1),Vs("tmenuBehaviours",[Yd,el,Uf,Qd]),vr("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)}},factory:function(a,t){var c,n,i=Tt(tt.none()),s=qm(),e=function(t){var o,r,n,e=(o=t,r=a.data.primary,n=a.data.menus,et(n,function(t,n){var e=function(){return Gm.sketch(Je({dom:t.dom},t,{value:n,items:t.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?bl():vl()}))};return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),i=u(t);return s.setContents(a.data.primary,e,a.data.expansions,i),s.getPrimary()},f=function(t){return lm.getValue(t).value},u=function(t){return et(a.data.menus,function(t,n){return L(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},l=function(n,t){el.highlight(n,t),el.getHighlighted(t).orThunk(function(){return el.getFirst(t)}).each(function(t){Mr(n,t.element(),Tn())})},d=function(n,t){return Bt(_(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?tt.some(t.menu):tt.none()})}))},m=function(n,t,e){var o=d(t,t.otherMenus(e));M(o,function(t){Gi(t.element(),[a.markers.backgroundMenu]),a.stayInDom||Qd.remove(n,t)})},g=function(t,o){var r,n=(r=t,i.get().getOrThunk(function(){var e={},t=_c(r.element(),"."+a.markers.item),n=F(t,function(t){return"true"===Me(t,"aria-haspopup")});return M(n,function(t){r.getSystem().getByDom(t).each(function(t){var n=f(t);e[n]=t})}),i.set(tt.some(e)),e}));nt(n,function(t,n){var e=B(o,n);De(t.element(),"aria-expanded",e)})},p=function(o,r,i){return tt.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return tt.none();var n=t.menu,e=d(r,i.slice(1));return M(e,function(t){zi(t.element(),a.markers.backgroundMenu)}),Pr(n.element())||Qd.append(o,pu(n)),Gi(n.element(),[a.markers.backgroundMenu]),l(o,n),m(o,r,i),tt.some(n)})})};(n=c||(c={}))[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var h=function(r,i,u){void 0===u&&(u=c.HighlightSubmenu);var t=f(i);return s.expand(t).bind(function(o){return g(r,o),tt.from(o[0]).bind(function(e){return s.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return s.setMenuBuilt(n,o),o}(r,e,t);return Pr(n.element())||Qd.append(r,pu(n)),a.onOpenSubmenu(r,i,n),u===c.HighlightSubmenu?(el.highlightFirst(n),p(r,s,o)):(el.dehighlightAll(n),tt.some(i))})})})},o=function(n,e){var t=f(e);return s.collapse(t).bind(function(t){return g(n,t),p(n,s,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})},r=function(e){return function(n,t){return bu(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOption().bind(function(t){return e(n,t).map(function(){return!0})})})}},v=Xr([Kr(Wm(),function(n,t){var e=t.event().menu();el.highlight(n,e);var o=f(t.event().item());s.refresh(o).each(function(t){return m(n,s,t)})}),ui(function(n,t){var e=t.event().target();n.getSystem().getByDom(e).each(function(t){0===f(t).indexOf("collapse-item")&&o(n,t),h(n,t,c.HighlightSubmenu).fold(function(){a.onExecute(n,t)},function(){})})}),oi(function(n,t){e(n).each(function(t){Qd.append(n,pu(t)),a.onOpenMenu(n,t),a.highlightImmediately&&l(n,t)})})].concat(a.navigateOnHover?[Kr(Im(),function(t,n){var e,o,r=n.event().item();e=t,o=f(r),s.refresh(o).bind(function(t){return g(e,t),p(e,s,t)}),h(t,r,c.HighlightParent),a.onHover(t,r)})]:[])),b={collapseMenu:function(n){el.getHighlighted(n).each(function(t){el.getHighlighted(t).each(function(t){o(n,t)})})},highlightPrimary:function(n){s.getPrimary().each(function(t){l(n,t)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Hs(a.tmenuBehaviours,[Yd.config({mode:"special",onRight:r(function(t,n){return zf(n.element())?tt.none():h(t,n,c.HighlightSubmenu)}),onLeft:r(function(t,n){return zf(n.element())?tt.none():o(t,n)}),onEscape:r(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){s.getPrimary().each(function(t){Mr(n,t.element(),Tn())})}}),el.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),Uf.config({find:function(t){return el.getHighlighted(t)}}),Qd.config({})]),eventOrder:a.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Ct(t,n),expansions:{}}},collapseItem:function(t){return{value:qe(Km()),meta:{text:t}}}}}),$m=Nf({name:"InlineView",configFields:[rr("lazySink"),Bu("onShow"),Bu("onHide"),pr("onEscape"),Vs("inlineBehaviours",[As,qu]),hr("fireDismissalEventInstead",[vr("event",Nn())]),vr("getRelated",tt.none),vr("eventOrder",tt.none)],factory:function(s,t){var r=function(t,n,e,o){var r=s.lazySink(t).getOrDie();As.openWhileCloaked(t,e,function(){return fs.positionWithin(r,n,t,o)}),s.onShow(t)},n={setContent:function(t,n){As.open(t,n)},showAt:function(t,n,e){var o=tt.none();r(t,n,e,o)},showWithin:r,showMenuAt:function(t,n,e){var o,r,i,u,a,c=(o=s,r=t,i=n,u=e,a=function(){return o.lazySink(r)},Jm.sketch({dom:{tag:"div"},data:u.data,markers:u.menu.markers,onEscape:function(){return As.close(r),o.onEscape.map(function(t){return t(r)}),tt.some(!0)},onExecute:function(){return tt.some(!0)},onOpenMenu:function(t,n){fs.position(a().getOrDie(),i,n)},onOpenSubmenu:function(t,n,e){var o=a().getOrDie();fs.position(o,{anchor:"submenu",item:n},e)}}));As.open(t,c),s.onShow(t)},hide:function(t){As.close(t),s.onHide(t)},getContent:function(t){return As.getState(t)},isOpen:As.isOpen};return{uid:s.uid,dom:s.dom,behaviours:Hs(s.inlineBehaviours,[As.config({isPartOf:function(t,n,e){return xu(n,e)||(o=t,r=e,s.getRelated(o).exists(function(t){return xu(t,r)}));var o,r},getAttachPoint:function(t){return s.lazySink(t).getOrDie()}}),Fs(Je({isExtraPart:Z(!1)},s.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))]),eventOrder:s.eventOrder,apis:n}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)}}}),Qm=function(t){var n=function(t,n){n.stop(),_r(t)},e=xn.detect().deviceType.isTouch()?[Kr(Bn(),n)]:[Kr(Wt(),n),Kr(Ft(),function(t,n){n.cut()})];return Xr(z([t.map(function(e){return Kr(En(),function(t,n){e(t),n.stop()})}).toArray(),e]))},Zm=Nf({name:"Button",factory:function(t){var n=Qm(t.action),e=t.dom.tag,o=function(n){return St(t.dom,"attributes").bind(function(t){return St(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Ps(t.buttonBehaviours,[hm.config({}),Yd.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==e)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),n=o("role").map(function(t){return{role:t}}).getOr({});return Je({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[vr("uid",undefined),rr("dom"),vr("components",[]),Ns("buttonBehaviours",[hm,Yd]),dr("action"),dr("role"),vr("eventOrder",{})]}),tg=function(t){var n=function e(t){return t.uid!==undefined}(t)&&Et(t,"uid")?t.uid:pi("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).fold(tt.none,tt.some)},asSpec:function(){return Je({},t,{uid:n})}}},ng=function(t){return tt.from(t()["temporary-placeholder"]).getOr("!not found!")},eg=function(t,n){return tt.from(n()[t]).getOrThunk(function(){return ng(n)})},og={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},rg=Nf({name:"Notification",factory:function(n){var t,e,o=tg({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:zu([Qd.config({})])}),r=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},i=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},u=tg({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(0)]},i(0)],behaviours:zu([Qd.config({})])}),a={updateProgress:function(t,n){t.getSystem().isConnected()&&u.getOpt(t).each(function(t){Qd.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(n)]},i(n)])})},updateText:function(t,n){if(t.getSystem().isConnected()){var e=o.get(t);Qd.set(e,[lu(n)])}}},c=z([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return tt.from(og[t])}).toArray()]);return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=c,e=n.iconProvider,At(t,function(t){return tt.from(e()[t])}).getOrThunk(function(){return ng(e)}))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:zu([Qd.config({})])}].concat(n.progress?[u.asSpec()]:[]).concat(Zm.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:eg("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})),apis:a}},configFields:[dr("level"),rr("progress"),rr("icon"),rr("onAction"),rr("text"),rr("iconProvider"),rr("translationProvider")],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}});function ig(r,i,u){var a=i.backstage;return{open:function(t,n){var e=function(){n(),$m.hide(r)},o=gu(rg.sketch({text:t.text,level:B(["success","error","warning","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:tt.from(t.icon),onAction:e,iconProvider:a.shared.providers.icons,translationProvider:a.shared.providers.translate})),r=gu($m.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:i.backstage.shared.getSink,fireDismissalEventInstead:{}}));return u.add(r),t.timeout&&setTimeout(function(){e()},t.timeout),{close:e,moveTo:function(t,n){$m.showAt(r,{anchor:"makeshift",x:t,y:n},pu(o))},moveRel:function(t,n){$m.showAt(r,i.backstage.shared.anchors.banner(),pu(o))},text:function(t){rg.updateText(o,t)},settings:t,getEl:function(){},progressBar:{value:function(t){rg.updateProgress(o,t)}}}},close:function(t){t.close()},reposition:function(t){M(t,function(t){t.moveTo(0,0)}),function(e){if(0<e.length){var t=e.slice(0,1)[0],n=(o=r).inline?o.getElement():o.getContentAreaContainer();t.moveRel(n,"tc-tc"),M(e,function(t,n){0<n&&t.moveRel(e[n-1].getEl(),"bc-tc")})}var o}(t)},getArgs:function(t){return t.settings}}}var ug,ag,cg=function(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==r&&clearTimeout(r),r=setTimeout(function(){e.apply(null,t),r=null},o)}}},sg=/[\u00a0 \t\r\n]/,fg=function(e,t,n,o,r){return void 0===r&&(r=0),(i=e).collapsed&&3===i.startContainer.nodeType?function(t,n,e,o){var r;for(r=n-1;0<=r;r--){if(sg.test(t.charAt(r)))return tt.none();if(t.charAt(r)===e)break}return-1===r||n-r<o?tt.none():tt.some(t.substring(r+1,n))}(n,o,t,r).map(function(t){var n=e.cloneRange();return n.setStart(e.startContainer,e.startOffset-t.length-1),n.setEnd(e.startContainer,e.startOffset),{text:t,rng:n}}):tt.none();var i},lg=function(e,t){t.on("keypress",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel);var o=function(t,n){Dr(t,zt(),{raw:n})};t.on("keydown",function(n){var t=function(){return e.getView().bind(el.getHighlighted)};8===n.which&&e.onKeypress.throttle(n),e.isActive()&&(27===n.which?e.closeIfNecessary():32===n.which?e.closeIfNecessary():13===n.which?(t().each(_r),n.preventDefault()):40===n.which?(t().fold(function(){e.getView().each(el.highlightFirst)},function(t){o(t,n)}),n.preventDefault()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){o(t,n),n.preventDefault()}))})},dg=tinymce.util.Tools.resolve("tinymce.util.Promise"),mg=function(t,n){return 0===t.startOffset||/\s/.test(n.charAt(t.startOffset-1))},gg=function(t,n){var e,o,r,i=n(),u=t.selection.getRng(),a=u.startContainer.nodeValue;return(e=u,o=a,r=i,At(r.triggerChars,function(n){return fg(e,n,o,e.startOffset).map(function(t){return{range:t.rng,text:t.text,triggerChar:n}})})).map(function(e){var t=F(i.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOr(mg)(e.range,a,e.text)});return{lookupData:dg.all(_(t,function(n){return n.fetch(e.text,n.maxResults).then(function(t){return{items:t,columns:n.columns,onAction:n.onAction}})})),triggerChar:e.triggerChar,range:e.range}})},pg=Io([Or("type",function(){return"autocompleteitem"}),Or("active",function(){return!1}),Or("disabled",function(){return!1}),vr("meta",{}),ur("value"),gr("text"),gr("icon")]),hg=Io([ur("type"),ur("ch"),yr("minChars",1),vr("columns",1),yr("maxResults",10),pr("matches"),cr("fetch"),cr("onAction")]),vg=function(t){var n,e,o=t.ui.registry.getAll().popups,r=et(o,function(t){return(n=t,Xo("Autocompleter",hg,n)).fold(function(t){throw new Error(Ko(t))},function(t){return t});var n}),i=(n=rt(r,function(t){return t.ch}),e={},M(n,function(t){e[t]={}}),J(e)),u=it(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return F(u,function(t){return t.ch===n})}}},bg=[Sr("disabled",!1),gr("text"),gr("shortcut"),zo("value","value",ro(function(){return qe("menuitem-value")}),$o()),vr("meta",{})],yg=Io([ur("type"),Cr("onSetup",function(){return Q}),Cr("onAction",Q),gr("icon")].concat(bg)),xg=Io([ur("type"),cr("getSubmenuItems"),Cr("onSetup",function(){return Q}),gr("icon")].concat(bg)),wg=Io([ur("type"),Sr("active",!1),Cr("onSetup",function(){return Q}),cr("onAction")].concat(bg)),Sg=Io([ur("type"),Sr("active",!1),gr("icon")].concat(bg)),Cg=Io([ur("type"),gr("text")]),kg=Io([ur("type"),ar("fancytype",["inserttable"]),Cr("onAction",Q)]),Og=function(t,o,n){var r=_c(t.element(),"."+n);if(0<r.length){var e=H(r,function(t){var n=t.dom().getBoundingClientRect().top,e=r[0].dom().getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return tt.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return tt.none()},Eg=function(t,n){return zu([Rm(t,n)])},Tg=function(t){return Eg(qe("unnamed-events"),t)},Bg=[rr("lazySink"),rr("tooltipDom"),vr("exclusive",!0),vr("tooltipComponents",[]),vr("delay",300),wr("mode","normal",["normal","follow-highlight"]),vr("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:Z([ac,uc,ec,rc,oc,ic]),onRtl:Z([ac,uc,ec,rc,oc,ic])}}}),Bu("onHide"),Bu("onShow")],Ag=/* */Object.freeze({init:function(){var e=Tt(tt.none()),n=Tt(tt.none()),o=function(){e.get().each(function(t){h.clearTimeout(t)})},t=Z("not-implemented");return Oi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(tt.some(t))},clearTooltip:function(){n.set(tt.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(tt.some(h.setTimeout(function(){t()},n)))},readState:t})}}),Dg=qe("tooltip.exclusive"),_g=qe("tooltip.show"),Mg=qe("tooltip.hide"),Fg=function(t,n,e){t.getSystem().broadcastOn([Dg],{})},Ig=/* */Object.freeze({hideAllExclusive:Fg,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Qd.set(t,o)})}}),Vg=ju({fields:Bg,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){var e=function(n){r.getTooltip().each(function(t){hs(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return Xr(z([[Kr(_g,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){Fg(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:Xr("normal"===o.mode?[Kr(Ht(),function(t){Ar(n,_g)}),Kr(Vt(),function(t){Ar(n,Mg)})]:[]),behaviours:zu([Qd.config({})])});r.setTooltip(e),ms(t,e),o.onShow(n,e),fs.position(t,o.anchor(n),e)}}(t)},o.delay)}),Kr(Mg,function(t){r.resetTimer(function(){e(t)},o.delay)}),Kr(On(),function(t,n){B(n.channels(),Dg)&&e(t)}),ri(function(t){e(t)})],"normal"===o.mode?[Kr(Nt(),function(t){Ar(t,_g)}),Kr(Cn(),function(t){Ar(t,Mg)}),Kr(Ht(),function(t){Ar(t,_g)}),Kr(Vt(),function(t){Ar(t,Mg)})]:[Kr(Un(),function(t,n){Ar(t,_g)}),Kr(Wn(),function(t){Ar(t,Mg)})]]))}}),state:Ag,apis:Ig}),Rg=function(t){var n,e,o,r=Xn.fromHtml(t),i=me(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],V(e,function(t,n){var e;return"class"===n.name?t:Je({},t,((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:Se(r)};return Je({tag:ke(r),classes:a,attributes:u},c)},Hg=tinymce.util.Tools.resolve("tinymce.util.I18n"),Ng="tox-menu-nav__js",Pg="tox-collection__item",zg="tox-swatch",Lg={normal:Ng,color:zg},jg="tox-collection__item--enabled",Ug="tox-collection__item-icon",Wg="tox-collection__item-label",Gg="tox-collection__item--active",Xg=function(t){return St(Lg,t).getOr(Ng)},Yg=tinymce.util.Tools.resolve("tinymce.Env"),qg=function(t){var e=Yg.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),o=_(n,function(t){var n=t.toLowerCase().trim();return at(e,n)?e[n]:t});return Yg.mac?o.join(""):o.join("+")},Kg=function(t){return{dom:{tag:"div",classes:[Ug],innerHtml:t}}},Jg=function(t){return{dom:{tag:"div",classes:[Wg]},components:[lu(Hg.translate(t))]}},$g=function(t,n){return{dom:{tag:"div",classes:[Wg]},components:[{dom:{tag:t.tag,attributes:{style:t.styleAttr}},components:[lu(Hg.translate(n))]}]}},Qg=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:qg(t)}}},Zg=function(t){return{dom:{tag:"div",classes:[Ug,"tox-collection__item-checkmark"],innerHtml:eg("checkmark",t)}}},tp=function(t,r,n,i){void 0===i&&(i=tt.none());var e,o,u,a,c,s,f,l,d,m,g=t.iconContent.map(function(t){return n=t,e=r.icons,o=i,tt.from(e()[n]).or(o).getOrThunk(function(){return ng(e)});var n,e,o}),p=tt.from(t.meta).fold(function(){return Jg},function(t){return at(t,"style")?v($g,t.style):Jg});return"color"===t.presets?(s=t.ariaLabel,f=t.value,{dom:(l=zg,d=g.getOr(""),m=s.map(function(t){return' title="'+t+'"'}).getOr(""),Rg("custom"===f?'<button class="'+l+' tox-swatches__picker-btn"'+m+">"+d+"</button>":"remove"===f?'<div class="'+l+' tox-swatch--remove"'+m+">"+d+"</div>":'<div class="'+l+'" style="background-color: '+f+'" data-mce-color="'+f+'"'+m+"></div>")),optComponents:[]}):(e=t,o=g,u=p,a=n?e.checkMark.orThunk(function(){return o.or(tt.some("")).map(Kg)}):tt.none(),c=e.ariaLabel.map(function(t){return{attributes:{title:Hg.translate(t)}}}).getOr({}),{dom:bt({tag:"div",classes:[Ng,Pg]},c),optComponents:[a,e.textContent.map(u),e.shortcutContent.map(Qg),e.caret]})},np=["input","button","textarea"],ep=function(t,n,e){n.disabled&&cp(t,n,e)},op=function(t){return B(np,ke(t.element()))},rp=function(t){De(t.element(),"disabled","disabled")},ip=function(t){Ie(t.element(),"disabled")},up=function(t){De(t.element(),"aria-disabled","true")},ap=function(t){De(t.element(),"aria-disabled","false")},cp=function(n,t,e){t.disableClass.each(function(t){zi(n.element(),t)}),(op(n)?rp:up)(n)},sp=function(t){return op(t)?Fe(t.element(),"disabled"):"true"===Me(t.element(),"aria-disabled")},fp=/* */Object.freeze({enable:function(n,t,e){t.disableClass.each(function(t){ji(n.element(),t)}),(op(n)?ip:ap)(n)},disable:cp,isDisabled:sp,onLoad:ep}),lp=/* */Object.freeze({exhibit:function(t,n,e){return Ti({classes:n.disabled?n.disableClass.map(X).getOr([]):[]})},events:function(t,n){return Xr([Yr(En(),function(t,n){return sp(t)}),Vu(t,n,ep)])}}),dp=[vr("disabled",!1),dr("disableClass")],mp=ju({fields:dp,name:"disabling",active:lp,apis:fp}),gp=function(t){return mp.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},pp=function(t){return mp.config({disabled:t})},hp=function(t){return mp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},vp=function(t,n){var e=t.getApi(n);return function(t){t(e)}},bp=function(e,o){return oi(function(t){vp(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},yp=function(n,e){return ri(function(t){return vp(n,t)(e.get())})};(ag=ug||(ug={}))[ag.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",ag[ag.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var xp,wp,Sp=ug,Cp={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},kp=function(t){return L(t,function(t){return t.toArray()})},Op=function(t,n,e){var o,r,i=Tt(Q);return{type:"item",dom:n.dom,components:kp(n.optComponents),data:t.data,eventOrder:Cp,hasSubmenu:t.triggersSubmenu,itemBehaviours:zu([Rm("item-events",[(o=t,r=e,ui(function(t,n){vp(o,t)(o.onAction),o.triggersSubmenu||r!==Sp.CLOSE_ON_EXECUTE||(Ar(t,_n()),n.stop())})),bp(t,i),yp(t,i)]),gp(t.disabled),Qd.config({})].concat(t.itemBehaviours))}},Ep=function(t){return{value:t.value,meta:bt({text:t.text.getOr("")},t.meta)}},Tp=Z(vf("item-widget",Pm())),Bp=qe("cell-over"),Ap=qe("cell-execute"),Dp=function(n,e,t){var o,r=function(t){return Dr(t,Ap,{row:n,col:e})};return gu({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:zu([Rm("insert-table-picker-cell",[Kr(Ht(),hm.focus),Kr(En(),r),Kr(An(),r)]),Am.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),hm.config({onFocus:function(t){return Dr(t,Bp,{row:n,col:e})}})])})},_p={inserttable:function qA(o){var t,n=qe("size-label"),a=function(t,n,e){for(var o=[],r=0;r<n;r++){for(var i=[],u=0;u<e;u++)i.push(Dp(r,u,t));o.push(i)}return o}(n,10,10),c=tg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:n}},components:[lu("0x0")],behaviours:zu([Qd.config({})])});return{type:"widget",data:{value:qe("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Tp().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:(t=a,L(t,function(t){return _(t,pu)})).concat(c.asSpec()),behaviours:zu([Rm("insert-table-picker",[Zr(Bp,function(t,n,e){var o,r,i=e.event().row(),u=e.event().col();!function(t,n,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)Am.set(t[i][u],i<=n&&u<=e)}(a,i,u,10,10),Qd.set(c.get(t),[(o=i,r=u,lu(r+1+"x"+(o+1)))])}),Zr(Ap,function(t,n,e){o.onAction({numRows:e.event().row()+1,numColumns:e.event().col()+1}),Ar(t,_n())})]),Yd.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}}},Mp=function(n,t,e,o,r,i,u){var a=tp({presets:e,textContent:t?n.text:tt.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:tt.none(),checkMark:t?tt.some(Zg(u.icons)):tt.none(),caret:tt.none(),value:n.value},u,!0);return vt(Op({data:Ep(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Am.set(n,t)},isActive:function(){return Am.isOn(n)},isDisabled:function(){return mp.isDisabled(n)},setDisabled:function(t){return t?mp.disable(n):mp.enable(n)}}},onAction:function(t){return o(n.value)},onSetup:function(t){return t.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:jg,toggleOnExecute:!1,selected:n.active}})},Fp=function(n,t,e,o,r,i,u){void 0===u&&(u=!0);var a,c,s=tp({presets:e,textContent:t?n.text:tt.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:tt.none(),checkMark:tt.none(),caret:tt.none(),value:n.value},i.providers,u,n.icon);return Op({data:Ep(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(t){return o(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:(a=n.meta,c=i,ut(a,"tooltipWorker").map(function(e){return[Vg.config({lazySink:c.getSink,tooltipDom:{tag:"div"},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t}},mode:"follow-highlight",onShow:function(n,t){e(function(t){Vg.setComponents(n,[du({element:Xn.fromDom(t)})])})}})]}).getOr([]))},s,r)},Ip=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:Je({tag:"div",classes:[Pg,"tox-collection__group-heading"]},n),components:[]}},Vp=function(t,n,e,o){void 0===o&&(o=!0);var r=tp({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:tt.none(),checkMark:tt.none(),shortcutContent:t.shortcut},e,o);return Op({data:Ep(t),getApi:function(n){return{isDisabled:function(){return mp.isDisabled(n)},setDisabled:function(t){return t?mp.disable(n):mp.enable(n)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n)},Rp=function(t,n,e,o){void 0===o&&(o=!0);var r,i=(r=e.icons,{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:eg("chevron-right",r)}}),u=tp({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:tt.some(i),checkMark:tt.none(),shortcutContent:t.shortcut},e,o);return Op({data:Ep(t),getApi:function(n){return{isDisabled:function(){return mp.isDisabled(n)},setDisabled:function(t){return t?mp.disable(n):mp.enable(n)}}},disabled:t.disabled,onAction:Q,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n)},Hp=function(t,n,e){var o=tp({iconContent:tt.none(),textContent:t.text,ariaLabel:t.text,checkMark:tt.some(Zg(e.icons)),caret:tt.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,!0);return vt(Op({data:Ep(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Am.set(n,t)},isActive:function(){return Am.isOn(n)},isDisabled:function(){return mp.isDisabled(n)},setDisabled:function(t){return t?mp.disable(n):mp.enable(n)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,n),{toggling:{toggleClass:jg,toggleOnExecute:!1,selected:t.active}})},Np=function(n){return(t=_p,e=n.fancytype,Object.prototype.hasOwnProperty.call(t,e)?tt.some(t[e]):tt.none()).map(function(t){return t(n)});var t,e},Pp=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:(n=t,"color"===n?"tox-swatches":"tox-menu"),tieredMenu:"tox-tiered-menu"};var n},zp=function(t){var n=Pp(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:Xg(t)}},Lp=[Gm.parts().items({})],jp=function(t,n,e){var o=Pp(e);return{dom:{tag:"div",classes:z([[o.tieredMenu]])},markers:zp(e)}},Up=function(t,n){var e=zp(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}},Wp=function(e,o){return function(t){var n=D(t,o);return _(n,function(t){return{dom:e,components:t}})}},Gp=function(n,i,t){return void 0===t&&(t=!0),{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[Gm.parts().items({preprocess:function(t){return"auto"!==n&&1<n?Wp({tag:"div",classes:["tox-collection__group"]},n)(t):(e=function(t,n){return"separator"===i[n].type},o=[],r=[],M(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],at(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),_(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}));var e,o,r}})]}};(wp=xp||(xp={}))[wp.ContentFocus=0]="ContentFocus",wp[wp.UiFocus=1]="UiFocus";var Xp=function(t){return console.error(Ko(t)),console.log(t),tt.none()},Yp=function(t){return t.icon!==undefined||"togglemenuitem"===t.type||"choicemenuitem"===t.type},qp=function(t){return A(t,Yp)},Kp=function(t,n,e,o){switch(void 0===o&&(o=!0),t.type){case"menuitem":return(c=t,Xo("menuitem",yg,c)).fold(Xp,function(t){return tt.some(Vp(t,n,e,o))});case"nestedmenuitem":return(a=t,Xo("nestedmenuitem",xg,a)).fold(Xp,function(t){return tt.some(Rp(t,n,e,o))});case"togglemenuitem":return(u=t,Xo("togglemenuitem",wg,u)).fold(Xp,function(t){return tt.some(Hp(t,n,e))});case"separator":return(i=t,Xo("separatormenuitem",Cg,i)).fold(Xp,function(t){return tt.some(Ip(t))});case"fancymenuitem":return(r=t,Xo("fancymenuitem",kg,r)).fold(Xp,function(t){return Np(t)});default:return console.error("Unknown item in general menu",t),tt.none()}var r,i,u,a,c},Jp=function(t,n,e,o,r){var i,u,a,c,s,f,l;return"color"===r?{value:t,dom:(i=o,l={dom:{tag:"div",classes:["tox-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Gm.parts().items({preprocess:"auto"!==i?Wp({tag:"div",classes:["tox-swatches__row"]},i):d})]}]}).dom,components:l.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(l=Gp(o,e)).dom,components:l.components,items:e}:"normal"===r&&1===o?{value:t,dom:(l=Gp(1,e)).dom,components:l.components,items:e}:"normal"===r?{value:t,dom:(l=Gp(o,e)).dom,components:l.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:(a=n,c=o,s=r,f=Pp(s),{tag:"div",classes:z([[f.menu,"tox-menu-"+c+"-column"],a?[f.hasIcons]:[]])}),components:Lp,items:e}:{value:t,dom:(u=o,l={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Gm.parts().items({preprocess:Wp({tag:"div",classes:["tox-collection__group"]},u)})]}).dom,components:l.components,items:e}},$p=function(t,e,o,r,i,u,a){return Bt(_(t,function(n){return"choiceitem"===n.type?(t=n,Xo("choicemenuitem",Sg,t)).fold(Xp,function(t){return tt.some(Mp(t,1===o,r,e,u(n.value),i,a))}):tt.none();var t}))},Qp=function(t,e,n,o,r){var i=1===n,u=!i||qp(t);return Bt(_(t,function(t){return(n=t,Xo("Autocompleter.Item",pg,n)).fold(Xp,function(t){return tt.some(Fp(t,i,"normal",e,o,r,u))});var n}))},Zp=function(t,n,e,o,r,i,u,a){var c=qp(n),s=$p(n,e,o,"color"!==r?"normal":"color",i,u,a);return Jp(t,c,s,o,r)},th=function(t,n,e,o){var r=qp(n),i=Bt(_(n,function(t){return Kp(t,e,o,r)}));return Jp(t,r,i,1,"normal")},nh=function(t){return Jm.singleData(t.value,t)},eh=function(g,p){var h=gu($m.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],lazySink:p.getSink})),t=function(){return $m.isOpen(h)},v=function(){t()&&$m.hide(h)},n=Yt(function(){return vg(g)}),e=cg(function(t){(" "===t.key?tt.none():gg(g,n)).fold(v,function(m){m.lookupData.then(function(t){var e,n,o,r,i,u,a,c,s,f,l=(e=m.triggerChar,o=At(n=t,function(t){return tt.from(t.columns)}).getOr(1),L(n,function(i){var t=i.items;return Qp(t,function(o,r){var t=g.selection.getRng(),n=t.startContainer;fg(t,e,n.data,t.startOffset).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var n=t.rng,e={hide:v};i.onAction(e,n,o,r)})},o,Sp.BUBBLE_TO_SANDBOX,p)}));if(0<l.length){var d=At(t,function(t){return tt.from(t.columns)}).getOr(1);$m.showAt(h,{anchor:"selection",root:Xn.fromDom(g.getBody()),getSelection:function(){return tt.some({start:function(){return Xn.fromDom(m.range.startContainer)},soffset:function(){return m.range.startOffset},finish:function(){return Xn.fromDom(m.range.endContainer)},foffset:function(){return m.range.endOffset}})}},Gm.sketch((r=Jp("autocompleter-value",!0,l,d,"normal"),i=d,u=xp.ContentFocus,a="normal",c=u===xp.ContentFocus?bl():vl(),s=Up(i,a),f=zp(a),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:f.selectedItem,item:f.item},movement:s,fakeFocus:u===xp.ContentFocus,focusManager:c,menuBehaviours:Tg("auto"!==i?[]:[oi(function(o,t){Og(o,4,f.item).each(function(t){var n=t.numColumns,e=t.numRows;Yd.setGridSize(o,e,n)})})])}))),$m.getContent(h).each(el.highlightFirst)}else v()})})},50);lg({onKeypress:e,closeIfNecessary:v,isActive:t,getView:function(){return $m.getContent(h)}},g)},oh=function(m,g){return function(t){if(m(t)){var n,e,o,r,i,u,a,c=Xn.fromDom(t.target),s=function(){t.stopPropagation()},f=function(){t.preventDefault()},l=p(f,s),d=(n=c,e=t.clientX,o=t.clientY,r=s,i=f,u=l,a=t,{target:Z(n),x:Z(e),y:Z(o),stop:r,prevent:i,kill:u,raw:Z(a)});g(d)}}},rh=function(t,n,e,o,r){var i=oh(e,o);return t.dom().addEventListener(n,i,r),{unbind:v(ih,t,n,i,r)}},ih=function(t,n,e,o){t.dom().removeEventListener(n,e,o)},uh=Z(!0),ah=function(t,n,e){return rh(t,n,uh,e,!1)},ch=function(t,n,e){return rh(t,n,uh,e,!0)},sh=function(t,n,e){return bu(t,n,e).isSome()};function fh(e,o){var r=null;return{cancel:function(){null!==r&&(h.clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=h.setTimeout(function(){e.apply(null,t),r=null},o)}}}var lh=function(t){var n=t.raw();return n.touches===undefined||1!==n.touches.length?tt.none():tt.some(n.touches[0])},dh=function(e){var u=Tt(tt.none()),o=fh(function(t){u.set(tt.none()),e.triggerEvent(Dn(),t)},400),r=kt([{key:Dt(),value:function(e){return lh(e).each(function(t){o.cancel();var n={x:Z(t.clientX),y:Z(t.clientY),target:e.target};o.schedule(e),u.set(tt.some(n))}),tt.none()}},{key:_t(),value:function(t){return o.cancel(),lh(t).each(function(i){u.get().each(function(t){var n,e,o,r;n=i,e=t,o=Math.abs(n.clientX-e.x()),r=Math.abs(n.clientY-e.y()),(5<o||5<r)&&u.set(tt.none())})}),tt.none()}},{key:Mt(),value:function(n){return o.cancel(),u.get().filter(function(t){return ce(t.target(),n.target())}).map(function(t){return e.triggerEvent(Bn(),n)})}}]);return{fireIfReady:function(n,t){return St(r,t).bind(function(t){return t(n)})}}},mh=xn.detect().browser.isFirefox(),gh=Fo([cr("triggerEvent"),vr("stopBackspace",!0)]),ph=function(n,t){var e,o,r,i,u=qo("Getting GUI events settings",gh,t),a=xn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=dh(u),s=_(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return ah(n,t,function(n){c.fireIfReady(n,t).each(function(t){t&&n.kill()}),u.triggerEvent(t,n)&&n.kill()})}),f=Tt(tt.none()),l=ah(n,"paste",function(n){c.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),u.triggerEvent("paste",n)&&n.kill(),f.set(tt.some(h.setTimeout(function(){u.triggerEvent(kn(),n)},0)))}),d=ah(n,"keydown",function(t){var n;u.triggerEvent("keydown",t)?t.kill():!0!==u.stopBackspace||8!==(n=t).raw().which||B(["input","textarea"],ke(n.target()))||sh(n.target(),'[contenteditable="true"]')||t.prevent()}),m=(e=n,o=function(t){u.triggerEvent("focusin",t)&&t.kill()},mh?ch(e,"focus",o):ah(e,"focusin",o)),g=Tt(tt.none()),p=(r=n,i=function(t){u.triggerEvent("focusout",t)&&t.kill(),g.set(tt.some(h.setTimeout(function(){u.triggerEvent(Cn(),t)},0)))},mh?ch(r,"blur",i):ah(r,"focusout",i));return{unbind:function(){M(s,function(t){t.unbind()}),d.unbind(),m.unbind(),p.unbind(),l.unbind(),f.get().each(h.clearTimeout),g.get().each(h.clearTimeout)}}},hh=function(t,n){var e=St(t,"target").map(function(t){return t()}).getOr(n);return Tt(e)},vh=gt([{stopped:[]},{resume:["element"]},{complete:[]}]),bh=function(t,o,n,e,r,i){var u,a,c,s,f=t(o,e),l=(u=n,a=r,c=Tt(!1),s=Tt(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:Z(u),setSource:a.set,getSource:a.get});return f.fold(function(){return i.logEventNoHandlers(o,e),vh.complete()},function(n){var e=n.descHandler();return Ai(e)(l),l.isStopped()?(i.logEventStopped(o,n.element(),e.purpose()),vh.stopped()):l.isCut()?(i.logEventCut(o,n.element(),e.purpose()),vh.complete()):le(n.element()).fold(function(){return i.logNoParent(o,n.element(),e.purpose()),vh.complete()},function(t){return i.logEventResponse(o,n.element(),e.purpose()),vh.resume(t)})})},yh=function(n,e,o,t,r,i){return bh(n,e,o,t,r,i).fold(function(){return!0},function(t){return yh(n,e,o,t,r,i)},function(){return!1})},xh=function(t,n,e){var o,r,i=(o=n,r=Tt(!1),{stop:function(){r.set(!0)},cut:Q,isStopped:r.get,isCut:Z(!1),event:Z(o),setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")});return M(t,function(t){var n=t.descHandler();Ai(n)(i)}),i.isStopped()},wh=function(t,n,e,o,r){var i=hh(e,o);return yh(t,n,e,o,i,r)},Sh=Yn("element","descHandler"),Ch=function(t,n){return{id:Z(t),descHandler:Z(n)}};function kh(){var i={};return{registerId:function(o,r,t){nt(t,function(t,n){var e=i[n]!==undefined?i[n]:{};e[r]=Bi(t,o),i[n]=e})},unregisterId:function(e){nt(i,function(t,n){t.hasOwnProperty(e)&&delete t[e]})},filterByType:function(t){return St(i,t).map(function(t){return rt(t,function(t,n){return Ch(n,t)})}).getOr([])},find:function(t,n,e){var r=xt(n)(i);return Gr(e,function(t){return e=r,gi(o=t).fold(function(){return tt.none()},function(t){var n=xt(t);return e.bind(n).map(function(t){return Sh(o,t)})});var e,o},t)}}}function Oh(){var o=kh(),r={},i=function(o){var t=o.element();return gi(t).fold(function(){return t="uid-",n=o.element(),e=qe(li+t),mi(n,e),e;var t,n,e},function(t){return t})},u=function(t){gi(t.element()).each(function(t){delete r[t],o.unregisterId(t)})};return{find:function(t,n,e){return o.find(t,n,e)},filter:function(t){return o.filterByType(t)},register:function(t){var n=i(t);Et(r,n)&&function(t,n){var e=r[n];if(e!==t)throw new Error('The tagId "'+n+'" is already used by: '+He(e.element())+"\nCannot use it for: "+He(t.element())+"\nThe conflicting element is"+(Pr(e.element())?" ":" not ")+"already in the DOM");u(t)}(t,n);var e=[t];o.registerId(e,n,t.events()),r[n]=t},unregister:u,getById:function(t){return xt(t)(r)}}}var Eh,Th,Bh=Nf({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=$e(n,["attributes"]);return{uid:t.uid,dom:Je({tag:"div",attributes:Je({role:"presentation"},e)},o),components:t.components,behaviours:Rs(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[vr("components",[]),Vs("containerBehaviours",[]),vr("events",{}),vr("domModification",{}),vr("eventOrder",{})]}),Ah=function(e){var o=function(n){return le(e.element()).fold(function(){return!0},function(t){return ce(n,t)})},r=Oh(),s=function(t,n){return r.find(o,t,n)},t=ph(e.element(),{triggerEvent:function(u,a){return Ue(u,a.target(),function(t){return n=s,e=u,r=t,i=(o=a).target(),wh(n,e,o,i,r);var n,e,o,r,i})}}),i={debugInfo:Z("real"),triggerEvent:function(n,e,o){Ue(n,e,function(t){wh(s,n,o,e,t)})},triggerFocus:function(a,c){gi(a).fold(function(){ml(a)},function(t){Ue(Sn(),a,function(t){var n,e,o,r,i,u;n=s,e=Sn(),o={originator:Z(c),kill:Q,prevent:Q,target:Z(a)},i=t,u=hh(o,r=a),bh(n,e,o,r,u,i)})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element(),n.event())},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:gu,addToGui:function(t){a(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){l(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:Z(!0)},n=function(t){t.connect(i),Te(t.element())||(r.register(t),M(t.components(),n),i.triggerEvent(Fn(),t.element(),{target:Z(t.element())}))},u=function(t){Te(t.element())||(M(t.components(),u),r.unregister(t)),t.disconnect()},a=function(t){ms(e,t)},c=function(t){hs(t)},f=function(e){var t=r.filter(On());M(t,function(t){var n=t.descHandler();Ai(n)(e)})},l=function(t){f({universal:Z(!0),data:Z(t)})},d=function(t,n){f({universal:Z(!1),channels:Z(t),data:Z(n)})},m=function(t,n){var e=r.filter(t);return xh(e,n)},g=function(t){return r.getById(t).fold(function(){return mt.error(new Error('Could not find component with uid: "'+t+'" in system.'))},mt.value)},p=function(t){var n=gi(t).getOr("not found");return g(n)};return n(e),{root:Z(e),element:e.element,destroy:function(){t.unbind(),we(e.element())},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:u,broadcast:l,broadcastOn:d,broadcastEvent:m}},Dh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_h=tinymce.util.Tools.resolve("tinymce.EditorManager"),Mh=function(t){return tt.from(t.settings.min_width).filter(O)},Fh=function(t){return tt.from(t.settings.min_height).filter(O)},Ih=function(n){var t=J(n.settings),e=F(t,function(t){return/^toolbar([1-9])$/.test(t)}),o=_(e,function(t){return n.getParam(t,!1,"string")}),r=F(o,function(t){return"string"==typeof t});return 0<r.length?tt.some(r):tt.none()};(Th=Eh||(Eh={}))["default"]="",Th.floating="floating",Th.sliding="sliding";var Vh,Rh,Hh=function(t){return t.getParam("toolbar_drawer","","string")},Nh=function(t){var n=t.getParam("fixed_toolbar_container","","string"),e=t.getParam("inline",!1,"boolean");return 0<n.length&&e?vu(zr(),n):tt.none()},Ph=function(t){return t.getParam("inline",!1,"boolean")&&Nh(t).isSome()},zh=qe("form-component-change"),Lh=qe("form-close"),jh=qe("form-cancel"),Uh=qe("form-action"),Wh=qe("form-submit"),Gh=qe("form-block"),Xh=qe("form-unblock"),Yh=qe("form-tabchange"),qh=qe("form-resize"),Kh=Z([vr("prefix","form-field"),Vs("fieldBehaviours",[Uf,lm])]),Jh=Z([df({schema:[rr("dom")],name:"label"}),df({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[rr("text")],name:"aria-descriptor"}),ff({factory:{sketch:function(t){var n=yt(t,["factory"]);return t.factory.sketch(n)}},schema:[rr("factory")],name:"field"})]),$h=Pf({name:"FormField",configFields:Kh(),partFields:Jh(),factory:function(r,t,n,e){var o=Hs(r.fieldBehaviours,[Uf.config({find:function(t){return kf(t,r,"field")}}),lm.config({store:{mode:"manual",getValue:function(t){return Uf.getCurrent(t).bind(lm.getValue)},setValue:function(t,n){Uf.getCurrent(t).each(function(t){lm.setValue(t,n)})}}})]),i=Xr([oi(function(t,n){var o=Ef(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=qe(r.prefix);o.label().each(function(t){De(t.element(),"for",n),De(e.element(),"id",n)}),o["aria-descriptor"]().each(function(t){var n=qe(r.prefix);De(t.element(),"id",n),De(e.element(),"aria-describedby",n)})})})]),u={getField:function(t){return kf(t,r,"field")},getLabel:function(t){return kf(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),Qh=/* */Object.freeze({getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),Zh=[ir("others",Go(mt.value,$o()))],tv=ju({fields:Zh,name:"coupling",apis:Qh,state:/* */Object.freeze({init:function(t){var i={},n=Z({});return Oi({readState:n,getOrCreate:function(e,o,r){var t=J(o.others);if(t)return St(i,r).getOrThunk(function(){var t=St(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+Oo(t,null,2))}})}})}),nv=/* */Object.freeze({events:function(t,n){var e=t.stream.streams.setup(t,n);return Xr([Kr(t.event,e),ri(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[Kr(t,function(){return n.cancel()})]}).getOr([])))}}),ev=function(t){var n=Tt(null);return Oi({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})},ov=/* */Object.freeze({throttle:ev,init:function(t){return t.stream.streams.state(t)}}),rv=[ir("stream",Jo("mode",{throttle:[rr("delay"),vr("stopEvent",!0),Mu("streams",{setup:function(t,n){var e=t.stream,o=cg(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:ev})]})),vr("event","input"),dr("cancelEvent"),Du("onStream")],iv=ju({fields:rv,name:"streaming",active:nv,state:ov}),uv=function(t){var e=tt.none(),n=[],o=function(t){r()?u(t):n.push(t)},r=function(){return e.isSome()},i=function(t){M(t,u)},u=function(n){e.each(function(t){setTimeout(function(){n(t)},0)})};return t(function(t){e=tt.some(t),i(n),n=[]}),{get:o,map:function(e){return uv(function(n){o(function(t){n(e(t))})})},isReady:r}},av={nu:uv,pure:function(n){return uv(function(t){t(n)})}},cv=function(n){var t=function(t){var o;n((o=t,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=this;setTimeout(function(){o.apply(e,t)},0)}))},e=function(){return av.nu(t)};return{map:function(o){return cv(function(e){t(function(t){var n=o(t);e(n)})})},bind:function(e){return cv(function(n){t(function(t){e(t).get(n)})})},anonBind:function(e){return cv(function(n){t(function(t){e.get(n)})})},toLazy:e,toCached:function(){var n=null;return cv(function(t){null===n&&(n=e()),n.get(t)})},get:t}},sv={nu:cv,pure:function(n){return cv(function(t){t(n)})}},fv=Z("sink"),lv=Z(df({name:fv(),overrides:Z({dom:{tag:"div"},behaviours:zu([fs.config({useFixed:!0})]),events:Xr([ti(zt()),ti(Ft()),ti(Wt())])})}));(Rh=Vh||(Vh={}))[Rh.HighlightFirst=0]="HighlightFirst",Rh[Rh.HighlightNone=1]="HighlightNone";var dv=function(t,n){var e=t.getHotspot(n).getOr(n);return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:e}},function(t){return{anchor:"hotspot",hotspot:e,layouts:t}})},mv=function(t,n,e,o,r,i,u){var a,c,s,f,l,d,m,g,p,h,v=dv(t,e);return(c=v,f=o,l=r,d=u,m=n,g=s=e,p=(0,(a=t).fetch)(g).map(m),h=vv(s,a),p.map(function(t){return t.bind(function(t){return tt.from(Jm.sketch(Je({},l.menu(),{uid:pi(""),data:t,highlightImmediately:d===Vh.HighlightFirst,onOpenMenu:function(t,n){var e=h().getOrDie();fs.position(e,c,n),As.decloak(f)},onOpenSubmenu:function(t,n,e){var o=h().getOrDie();fs.position(o,{anchor:"submenu",item:n},e),As.decloak(f)},onEscape:function(){return hm.focus(s),As.close(f),tt.some(!0)}})))})})).map(function(t){return t.fold(function(){As.isOpen(o)&&As.close(o)},function(t){As.cloak(o),As.open(o,t),i(o)}),o})},gv=function(t,n,e,o,r,i,u){return As.close(o),sv.pure(o)},pv=function(t,n,e,o,r,i){var u=tv.getCoupled(e,"sandbox");return(As.isOpen(u)?gv:mv)(t,n,e,u,o,r,i)},hv=function(t,n,e){var o,r,i=Uf.getCurrent(n).getOr(n),u=ua(t.element());e?Ki(i.element(),"min-width",u+"px"):(o=i.element(),r=u,ia.set(o,r))},vv=function(n,t){return n.getSystem().getByUid(t.uid+"-"+fv()).map(function(t){return function(){return mt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return mt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},bv=function(o,r,i){var n,u=(n=qe("aria-owns"),{id:Z(n),link:function(t){De(t,"aria-owns",n)},unlink:function(t){Ie(t,"aria-owns")}}),t=vv(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id()}},behaviours:Ps(o.sandboxBehaviours,[lm.config({store:{mode:"memory",initialValue:r}}),As.config({onOpen:function(t,n){var e=dv(o,r);u.link(r.element()),o.matchWidth&&hv(e.hotspot,n,o.useMinWidth),o.onOpen(e,t,n),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,n)},onClose:function(t,n){u.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(t,n)},isPartOf:function(t,n,e){return xu(n,e)||xu(r,e)},getAttachPoint:function(){return t().getOrDie()}}),Uf.config({find:function(t){return As.getState(t).bind(function(t){return Uf.getCurrent(t)})}}),Fs({isExtraPart:Z(!1)})])}},yv=function(t,n,e){var o=lm.getValue(e);lm.setValue(n,o),wv(n)},xv=function(t,n){var e=t.element(),o=ou(e),r=e.dom();"number"!==Me(e,"type")&&n(r,o)},wv=function(t){xv(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},Sv=function(t,n,o){if(t.selectsOver){var e=lm.getValue(n),r=t.getDisplayText(e),i=lm.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?tt.some(function(){var t,e;yv(0,n,o),t=n,e=r.length,xv(t,function(t,n){return t.setSelectionRange(e,n.length)})}):tt.none()}return tt.none()},Cv=Z([dr("data"),vr("inputAttributes",{}),vr("inputStyles",{}),vr("tag","input"),vr("inputClasses",[]),Bu("onSetValue"),vr("styles",{}),vr("eventOrder",{}),Vs("inputBehaviours",[lm,hm]),vr("selectOnFocus",!0)]),kv=function(t){return zu([hm.config({onFocus:!1===t.selectOnFocus?Q:function(t){var n=t.element(),e=ou(n);n.dom().setSelectionRange(0,e.length)}})])},Ov=function(t){return{tag:t.tag,attributes:Je({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Ev=Z("alloy.typeahead.itemexecute"),Tv=function(){return[vr("sandboxClasses",[]),Ns("sandboxBehaviours",[Uf,qu,As,lm])]},Bv=Z([dr("lazySink"),rr("fetch"),vr("minChars",5),vr("responseTime",1e3),Bu("onOpen"),vr("getHotspot",tt.some),vr("layouts",tt.none()),vr("eventOrder",{}),kr("model",{},[vr("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),vr("selectsOver",!0),vr("populateFromBrowse",!0)]),Bu("onSetValue"),Au("onExecute"),Bu("onItemExecute"),vr("inputClasses",[]),vr("inputAttributes",{}),vr("inputStyles",{}),vr("matchWidth",!0),vr("useMinWidth",!1),vr("dismissOnBlur",!0),Eu(["openClass"]),dr("initialData"),Vs("typeaheadBehaviours",[hm,lm,iv,Yd,Am,tv]),Or("previewing",function(){return Tt(!0)})].concat(Cv()).concat(Tv())),Av=Z([lf({schema:[Ou()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){Sv(o.model,t,e).fold(function(){return el.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&yv(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOption().map(function(t){return Dr(t,Ev(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&yv(o.model,t,n)})}}}})]),Dv=Pf({name:"Typeahead",configFields:Bv(),partFields:Av(),factory:function(r,t,n,i){var e=function(t,n,e){r.previewing.set(!1);var o=tv.getCoupled(t,"sandbox");As.isOpen(o)?Uf.getCurrent(o).each(function(t){el.getHighlighted(t).fold(function(){e(t)},function(){Ir(o,t.element(),"keydown",n)})}):mv(r,u(t),t,o,i,function(t){Uf.getCurrent(t).each(e)},Vh.HighlightFirst).get(Q)},o=kv(r),u=function(o){return function(t){return t.map(function(t){var n=it(t.menus),e=L(n,function(t){return F(t.items,function(t){return"item"===t.type})});return lm.getState(o).update(_(e,function(t){return t.data})),t})}},a=[hm.config({}),lm.config({onSetValue:r.onSetValue,store:Je({mode:"dataset",getDataKey:function(t){return ou(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){ru(t.element(),r.model.getDisplayText(n))}},r.initialData.map(function(t){return Ct("initialValue",t)}).getOr({}))}),iv.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e=tv.getCoupled(t,"sandbox");if(hm.isFocused(t)&&ou(t.element()).length>=r.minChars){var o=Uf.getCurrent(e).bind(function(t){return el.getHighlighted(t).map(lm.getValue)});r.previewing.set(!0),mv(r,u(t),t,e,i,function(t){Uf.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&el.highlightFirst(t)},function(n){el.highlightBy(t,function(t){return lm.getValue(t).value===n.value}),el.getHighlighted(t).orThunk(function(){return el.highlightFirst(t),tt.none()})})})},Vh.HighlightFirst).get(Q)}},cancelEvent:Mn()}),Yd.config({mode:"special",onDown:function(t,n){return e(t,n,el.highlightFirst),tt.some(!0)},onEscape:function(t){var n=tv.getCoupled(t,"sandbox");return As.isOpen(n)?(As.close(n),tt.some(!0)):tt.none()},onUp:function(t,n){return e(t,n,el.highlightLast),tt.some(!0)},onEnter:function(n){var t=tv.getCoupled(n,"sandbox"),e=As.isOpen(t);if(e&&!r.previewing.get())return Uf.getCurrent(t).bind(function(t){return el.getHighlighted(t)}).map(function(t){return Dr(n,Ev(),{item:t}),!0});var o=lm.getValue(n);return Ar(n,Mn()),r.onExecute(t,n,o),e&&As.close(t),tt.some(!0)}}),Am.config({toggleClass:r.markers.openClass,aria:{mode:"pressed",syncWithExpanded:!0}}),tv.config({others:{sandbox:function(t){return bv(r,t,{onOpen:d,onClose:d})}}}),Rm("typeaheadevents",[ui(function(t){var n=Q;pv(r,u(t),t,i,n,Vh.HighlightFirst).get(Q)}),Kr(Ev(),function(t,n){var e=tv.getCoupled(t,"sandbox");yv(r.model,t,n.event().item()),Ar(t,Mn()),r.onItemExecute(t,e,n.event().item(),lm.getValue(t)),As.close(e),wv(t)})].concat(r.dismissOnBlur?[Kr(Cn(),function(t){var n=tv.getCoupled(t,"sandbox");pl(n.element()).isNone()&&As.close(n)})]:[]))];return{uid:r.uid,dom:Ov(r),behaviours:Je({},o,Hs(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),_v=function(t,n,e){var o=Fv(t,n,e);return $h.sketch(o)},Mv=function(t,n){return _v(t,n,[])},Fv=function(t,n,e){return{dom:Iv(e),components:t.toArray().concat([n])}},Iv=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Vv=function(t,n){return $h.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},Rv=function(t){return"separator"===t.type},Hv={type:"separator"},Nv=function(t,e){var n=V(t,function(t,n){return w(n)?""===n?t:"|"===n?0<t.length&&!Rv(t[t.length-1])?t.concat([Hv]):t:at(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return 0<n.length&&Rv(n[n.length-1])&&n.pop(),n},Pv=function(t,n){return at(t,"getSubmenuItems")?(o=n,r=(e=t).getSubmenuItems(),i=zv(r,o),{item:e,menus:vt(i.menus,Ct(e.value,i.items)),expansions:vt(i.expansions,Ct(e.value,e.value))}):{item:t,menus:{},expansions:{}};var e,o,r,i},zv=function(t,r){var n=Nv(w(t)?t.split(" "):t,r);return I(n,function(t,n){var e=function(t){if(Rv(t))return t;var n=St(t,"value").getOrThunk(function(){return qe("generated-menu-item")});return vt({value:n},t)}(n),o=Pv(e,r);return{menus:vt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:vt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},Lv=function(t,e,o){var n=qe("primary-menu"),r=zv(t,o.menuItems());if(0===r.items.length)return tt.none();var i=th(n,r.items,e,o),u=et(r.menus,function(t,n){return th(n,t,e,o)}),a=vt(u,Ct(n,i));return tt.from(Jm.tieredData(n,a,r.expansions))},jv=Nf({name:"Input",configFields:Cv(),factory:function(t,n){return{uid:t.uid,dom:Ov(t),components:[],behaviours:(e=t,Je({},kv(e),Hs(e.inputBehaviours,[lm.config({store:{mode:"manual",initialValue:e.data.getOr(undefined),getValue:function(t){return ou(t.element())},setValue:function(t,n){ou(t.element())!==n&&ru(t.element(),n)}},onSetValue:e.onSetValue})]))),eventOrder:t.eventOrder};var e}}),Uv=xn.detect().browser.isFirefox(),Wv={position:"absolute",left:"-9999px"},Gv=function(t,n,e){var o,r,i,u=function(t,n){var e=Xn.fromTag("span",t.dom());De(e,"role","presentation");var o=Xn.fromText(n,t.dom());return be(e,o),e}(se(n),e);Uv&&(o=n,r=u,i=qe("ephox-alloy-aria-voice"),De(r,"id",i),De(o,"aria-describedby",i)),_e(u,t(e)),Ji(u,Wv),be(n,u),h.setTimeout(function(){Ie(u,"aria-live"),we(u)},1e3)},Xv=function(t){return{"aria-live":"assertive","aria-atomic":"true",role:"alert"}},Yv=["input","textarea"],qv=function(t){var n=ke(t);return B(Yv,n)},Kv=function(t,n){var e=n.getRoot(t).getOr(t.element());ji(e,n.invalidClass),n.notify.each(function(n){qv(t.element())&&Ie(e,"title"),n.getContainer(t).each(function(t){Ce(t,n.validHtml)}),n.onValid(t)})},Jv=function(e,t,n,o){var r=t.getRoot(e).getOr(e.element());zi(r,t.invalidClass),t.notify.each(function(t){var n;qv(e.element())&&De(e.element(),"title",o),n=zr(),Gv(Xv,n,o),t.getContainer(e).each(function(t){Ce(t,o)}),t.onInvalid(e,o)})},$v=function(n,t,e){return t.validator.fold(function(){return sv.pure(mt.value(!0))},function(t){return t.validate(n)})},Qv=function(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),$v(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return Jv(n,e,0,t),mt.error(t)},function(t){return Kv(n,e),mt.value(t)}):mt.error("No longer in system")})},Zv=/* */Object.freeze({markValid:Kv,markInvalid:Jv,query:$v,run:Qv,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element());return Ui(e,n.invalidClass)}}),tb=/* */Object.freeze({events:function(n,t){return n.validator.map(function(t){return Xr([Kr(t.onEvent,function(t){Qv(t,n).get(d)})].concat(t.validateOnLoad?[oi(function(t){Qv(t,n).get(Q)})]:[]))}).getOr({})}}),nb=[rr("invalidClass"),vr("getRoot",tt.none),hr("notify",[vr("aria","alert"),vr("getContainer",tt.none),vr("validHtml",""),Bu("onValid"),Bu("onInvalid"),Bu("onValidate")]),hr("validator",[rr("validate"),vr("onEvent","input"),vr("validateOnLoad",!0)])],eb=ju({fields:nb,name:"invalidating",active:tb,apis:Zv,extra:{validation:function(e){return function(t){var n=lm.getValue(t);return sv.pure(e(n))}}}}),ob=/* */Object.freeze({exhibit:function(t,n){return Ti({attributes:kt([{key:n.tabAttr,value:"true"}])})}}),rb=[vr("tabAttr","data-alloy-tabstop")],ib=ju({fields:rb,name:"tabstopping",active:ob}),ub=function(t){return{value:Z(t)}},ab=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,cb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,sb=function(t){return ab.test(t)||cb.test(t)},fb=function(t){var n,e=(n=t.value().replace(ab,function(t,n,e,o){return n+n+e+e+o+o}),{value:Z(n)});return cb.exec(e.value())},lb=function(t){var n=t.toString(16);return 1==n.length?"0"+n:n},db=function(t){var n=lb(t.red())+lb(t.green())+lb(t.blue());return ub(n)},mb=Math.min,gb=Math.max,pb=Math.round,hb=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,vb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,bb=function(t,n,e,o){return{red:Z(t),green:Z(n),blue:Z(e),alpha:Z(o)}},yb=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},xb=function(t){var n,e,o,r,i,u,a,c,s,f;if(i=(t.hue()||0)%360,u=t.saturation()/100,a=t.value()/100,u=gb(0,mb(u,1)),a=gb(0,mb(a,1)),0===u)return c=s=f=pb(255*a),bb(c,s,f,1);switch(n=i/60,o=(e=a*u)*(1-Math.abs(n%2-1)),r=a-e,Math.floor(n)){case 0:c=e,s=o,f=0;break;case 1:c=o,s=e,f=0;break;case 2:c=0,s=e,f=o;break;case 3:c=0,s=o,f=e;break;case 4:c=o,s=0,f=e;break;case 5:c=e,s=0,f=o;break;default:c=s=f=0}return c=pb(255*(c+r)),s=pb(255*(s+r)),f=pb(255*(f+r)),bb(c,s,f,1)},wb=function(t){var n=fb(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return bb(e,o,r,1)},Sb=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return bb(r,i,u,a)},Cb=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},kb=Z(bb(255,0,0,1)),Ob=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Eb="tinymce-custom-colors",Tb="choiceitem",Bb=[{type:Tb,text:"Turquoise",value:"#18BC9B"},{type:Tb,text:"Green",value:"#2FCC71"},{type:Tb,text:"Blue",value:"#3598DB"},{type:Tb,text:"Purple",value:"#9B59B6"},{type:Tb,text:"Navy Blue",value:"#34495E"},{type:Tb,text:"Dark Turquoise",value:"#18A085"},{type:Tb,text:"Dark Green",value:"#27AE60"},{type:Tb,text:"Medium Blue",value:"#2880B9"},{type:Tb,text:"Medium Purple",value:"#8E44AD"},{type:Tb,text:"Midnight Blue",value:"#2B3E50"},{type:Tb,text:"Yellow",value:"#F1C40F"},{type:Tb,text:"Orange",value:"#E67E23"},{type:Tb,text:"Red",value:"#E74C3C"},{type:Tb,text:"Light Gray",value:"#ECF0F1"},{type:Tb,text:"Gray",value:"#95A5A6"},{type:Tb,text:"Dark Yellow",value:"#F29D12"},{type:Tb,text:"Dark Orange",value:"#D35400"},{type:Tb,text:"Dark Red",value:"#E74C3C"},{type:Tb,text:"Medium Gray",value:"#BDC3C7"},{type:Tb,text:"Dark Gray",value:"#7E8C8D"},{type:Tb,text:"Black",value:"#000000"},{type:Tb,text:"White",value:"#ffffff"}],Ab=function KA(r){void 0===r&&(r=10);var t,n=Ob.getItem(Eb),e=w(n)?JSON.parse(n):[],i=r-(t=e).length<0?t.slice(0,r):t,u=function(t){i.splice(t,1)};return{add:function(t){var n,e,o;(n=i,e=t,o=T(n,e),-1===o?tt.none():tt.some(o)).each(u),i.unshift(t),i.length>r&&i.pop(),Ob.setItem(Eb,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Db=function(t){var n,e=[];for(n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+t[n],type:"choiceitem"});return e},_b=function(t){return t.getParam("color_map")},Mb=function(t,n){return t.getParam("color_cols",n,"number")},Fb=function(t){return!1!==t.getParam("custom_colors")},Ib=function(t){var n=_b(t);return n!==undefined?Db(n):Bb},Vb=function(){return _(Ab.state(),function(t){return{type:Tb,text:t,value:t}})},Rb=function(t){Ab.add(t)},Hb=function(t,e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var n;(n=t.style["forecolor"===e?"color":"background-color"])&&(o=o||n)}),o},Nb=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))},Pb=function(t){var n=Ib(t),e=Nb(n.length);return Mb(t,e)},zb=function(n,e,t,o){"custom"===t?Wb(n)(function(t){t.each(function(t){Rb(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},"#000000"):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))},Lb=function(o,r){return function(t){var n,e;t(o.concat(Vb().concat((e={type:n="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},r?[e,{type:n,text:"Custom color",icon:"color-picker",value:"custom"}]:[e]))))}},jb=function(t,n,e){var o,r;o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,t.setIconFill(o,r),t.setIconStroke(o,r)},Ub=function(o,e,r,t,i){o.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return tt.from(Hb(o,r)).bind(function(t){return function(t){if("transparent"===t)return tt.some(bb(0,0,0,0));if(hb.test(t)){var n=hb.exec(t);return tt.some(Sb(n[1],n[2],n[3],"1"))}if(vb.test(t)){var e=hb.exec(t);return tt.some(Sb(e[1],e[2],e[3],e[4]))}return tt.none()}(t).map(function(t){var n=db(t).value();return mn(e.toLowerCase(),n)})}).getOr(!1)},columns:Pb(o),fetch:Lb(Ib(o),Fb(o)),onAction:function(t){null!==i.get()&&zb(o,r,i.get(),function(){})},onItemAction:function(n,t){zb(o,r,t,function(t){i.set(t),jb(n,e,t)})},onSetup:function(t){return null!==i.get()&&jb(t,e,i.get()),function(){}}})},Wb=function(i){return function(t,n){var e,o={colorpicker:n},r=(e=t,function(t){var n=t.getData();e(tt.from(n.colorpicker)),t.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,n){"hex-valid"===n.name&&(n.value?t.enable("ok"):t.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(tt.none())}})}},Gb={register:function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,n){var e,o,r;o=t,r=n,(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e;e=t,(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})});var n=Tt(null),e=Tt(null);Ub(t,"forecolor","forecolor","Text color",n),Ub(t,"backcolor","hilitecolor","Background color",e)},getFetch:Lb,colorPickerDialog:Wb,getCurrentColor:Hb,getColorCols:Pb,calcCols:Nb},Xb=Z([rr("dom"),rr("fetch"),Bu("onOpen"),Au("onExecute"),vr("getHotspot",tt.some),vr("layouts",tt.none()),Vs("dropdownBehaviours",[Am,tv,Yd,hm]),rr("toggleClass"),vr("eventOrder",{}),dr("lazySink"),vr("matchWidth",!1),vr("useMinWidth",!1),dr("role")].concat(Tv())),Yb=Z([lf({schema:[Ou()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),lv()]),qb=Pf({name:"Dropdown",configFields:Xb(),partFields:Yb(),factory:function(n,t,e,o){var r,i,u=function(t){As.getState(t).each(function(t){Jm.highlightPrimary(t)})},a={expand:function(t){Am.isOn(t)||pv(n,function(t){return t},t,o,Q,Vh.HighlightNone).get(Q)},open:function(t){Am.isOn(t)||pv(n,function(t){return t},t,o,Q,Vh.HighlightFirst).get(Q)},isOpen:Am.isOn,close:function(t){Am.isOn(t)&&pv(n,function(t){return t},t,o,Q,Vh.HighlightFirst).get(Q)}},c=function(t,n){return _r(t),tt.some(!0)};return{uid:n.uid,dom:n.dom,components:t,behaviours:Hs(n.dropdownBehaviours,[Am.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),tv.config({others:{sandbox:function(t){return bv(n,t,{onOpen:function(){Am.on(t)},onClose:function(){Am.off(t)}})}}}),Yd.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,n){if(qb.isOpen(t)){var e=tv.getCoupled(t,"sandbox");u(e)}else qb.open(t);return tt.some(!0)},onEscape:function(t,n){return qb.isOpen(t)?(qb.close(t),tt.some(!0)):tt.none()}}),hm.config({})]),events:Qm(tt.some(function(t){pv(n,function(t){return t},t,o,u,Vh.HighlightFirst).get(Q)})),eventOrder:Je({},n.eventOrder,(r={},r[En()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:Je({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}}),"button"===n.dom.tag?{type:(i="type",St(n.dom,"attributes").bind(function(t){return St(t,i)})).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)}}}),Kb=ju({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(t){return Xr([Yr(Xt(),Z(!0))])},exhibit:function(t,n){return Ti({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Jb=qe("color-input-change"),$b=qe("color-swatch-change"),Qb=qe("color-picker-cancel"),Zb=function(t,n,o){var e,r,i=$h.parts().field({factory:jv,inputClasses:["tox-textfield"],onSetValue:function(t){return eb.run(t).get(function(){})},inputBehaviours:zu([ib.config({}),eb.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return le(t.element())},notify:{onValid:function(t){var n=lm.getValue(t);Dr(t,Jb,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=lm.getValue(t);if(0===n.length)return sv.pure(mt.value(!0));var e=Xn.fromTag("span");Ki(e,"background-color",n);var o=Zi(e,"background-color").fold(function(){return mt.error("blah")},function(t){return mt.value(n)});return sv.pure(o)}}})]),selectOnFocus:!1}),u=t.label.map(function(t){return Vv(t,n.providers)}),a=function(t,n){Dr(t,$b,{value:n})},c=tg((e={dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:tt.some({onRtl:function(){return[ec]},onLtr:function(){return[oc]}}),components:[],fetch:Gb.getFetch(o.getColors(),o.hasCustomColors()),onItemAction:function(e){n.getSink().each(function(t){c.getOpt(t).each(function(n){"custom"===e?o.colorPicker(function(t){t.fold(function(){return Ar(n,Qb)},function(t){a(n,t),Rb(t)})},"#ffffff"):a(n,"remove"===e?"":e)})})}},r=n,qb.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:zu([Kb.config({}),ib.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:r.getSink,fetch:function(){return sv.nu(function(t){return e.fetch(t)}).map(function(t){return tt.from(nh(vt(Zp(qe("menu-value"),t,function(t){e.onItemAction(t)},5,"color",Sp.CLOSE_ON_EXECUTE,function(){return!1},r.providers),{movement:Up(5,"color")})))})},parts:{menu:jp(0,0,"color")}})));return $h.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[i,c.asSpec()]}]),fieldBehaviours:zu([Rm("form-field-events",[Kr(Jb,function(t,n){c.getOpt(t).each(function(t){Ki(t.element(),"background-color",n.event().color())})}),Kr($b,function(n,e){$h.getField(n).each(function(t){lm.setValue(t,e.event().value()),Uf.getCurrent(n).each(hm.focus)})}),Kr(Qb,function(n,t){$h.getField(n).each(function(t){Uf.getCurrent(n).each(hm.focus)})})])])})},ty=xn.detect().deviceType.isTouch(),ny=df({schema:[rr("dom")],name:"label"}),ey=function(t){return df({name:t+"-edge",overrides:function(o){return o.model.manager.edgeActions[t].fold(function(){return{}},function(e){var t=Xr([Jr(Dt(),e,[o])]),n=Xr([Jr(Ft(),e,[o]),Jr(It(),function(t,n){n.mouseIsDown.get()&&e(t,n)},[o])]);return{events:ty?t:n}})}})},oy=ey("top-left"),ry=ey("top"),iy=ey("top-right"),uy=ey("right"),ay=ey("bottom-right"),cy=ey("bottom"),sy=ey("bottom-left"),fy=[ny,ey("left"),uy,ry,cy,oy,iy,sy,ay,ff({name:"thumb",defaults:Z({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Xr([Qr(Dt(),t,"spectrum"),Qr(_t(),t,"spectrum"),Qr(Mt(),t,"spectrum"),Qr(Ft(),t,"spectrum"),Qr(It(),t,"spectrum"),Qr(Rt(),t,"spectrum")])}}}),ff({schema:[Or("mouseIsDown",function(){return Tt(!1)})],name:"spectrum",overrides:function(e){var o=e.model.manager,r=function(n,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(n,e,t)})},t=Xr([Kr(Dt(),r),Kr(_t(),r)]),n=Xr([Kr(Ft(),r),Kr(It(),function(t,n){e.mouseIsDown.get()&&r(t,n)})]);return{behaviours:zu(ty?[]:[Yd.config({mode:"special",onLeft:function(t){return o.onLeft(t,e)},onRight:function(t){return o.onRight(t,e)},onUp:function(t){return o.onUp(t,e)},onDown:function(t){return o.onDown(t,e)}}),hm.config({})]),events:ty?t:n}}})],ly=xn.detect().deviceType.isTouch(),dy=Z("slider.change.value"),my=function(t){var n=t.event().raw();if(ly){var e=n;return e.touches!==undefined&&1===e.touches.length?tt.some(e.touches[0]).map(function(t){return $u(t.clientX,t.clientY)}):tt.none()}var o=n;return o.clientX!==undefined?tt.some(o).map(function(t){return $u(t.clientX,t.clientY)}):tt.none()},gy=function(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)},py=function(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)},hy=function(t,n,e){return Math.max(n,Math.min(e,t))},vy=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,f=t.hasMaxEdge,l=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=f?e+1:e;if(r<l)return g;if(d<r)return p;var h,v,b,y,x,w,S,C=(x=r,w=l,S=d,Math.min(S,Math.max(x,w))-w),k=hy(C/m*o+n,g,p);return u&&n<=k&&k<=e?(h=k,v=n,b=e,y=i,a.fold(function(){var t=h-v,n=Math.round(t/y)*y;return hy(v+n,v-1,b+1)},function(t){var n=(h-t)%y,e=Math.round(n/y),o=Math.floor((h-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+e)*y;return Math.max(t,i)})):c?Math.round(k):k},by=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:f:(r-n)/o*c},yy=function(t){return t.model.minX},xy=function(t){return t.model.minY},wy=function(t){return t.model.minX-1},Sy=function(t){return t.model.minY-1},Cy=function(t){return t.model.maxX},ky=function(t){return t.model.maxY},Oy=function(t){return t.model.maxX+1},Ey=function(t){return t.model.maxY+1},Ty=function(t,n,e){return n(t)-e(t)},By=function(t){return Ty(t,Cy,yy)},Ay=function(t){return Ty(t,ky,xy)},Dy=function(t){return By(t)/2},_y=function(t){return Ay(t)/2},My=function(t){return t.stepSize},Fy=function(t){return t.snapToGrid},Iy=function(t){return t.snapStart},Vy=function(t){return t.rounded},Ry=function(t,n){return t[n+"-edge"]!==undefined},Hy=function(t){return Ry(t,"left")},Ny=function(t){return Ry(t,"right")},Py=function(t){return Ry(t,"top")},zy=function(t){return Ry(t,"bottom")},Ly=function(t){return t.model.value.get()},jy=function(t){return{x:Z(t)}},Uy=function(t){return{y:Z(t)}},Wy=function(t,n){return{x:Z(t),y:Z(n)}},Gy=function(t,n){Dr(t,dy(),{value:n})},Xy="left",Yy=function(t){return t.element().dom().getBoundingClientRect()},qy=function(t,n){return t[n]},Ky=function(t){var n=Yy(t);return qy(n,Xy)},Jy=function(t){var n=Yy(t);return qy(n,"right")},$y=function(t){var n=Yy(t);return qy(n,"top")},Qy=function(t){var n=Yy(t);return qy(n,"bottom")},Zy=function(t){var n=Yy(t);return qy(n,"width")},tx=function(t){var n=Yy(t);return qy(n,"height")},nx=function(t,n,e){return(t+n)/2-e},ex=function(t,n){var e=Yy(t),o=Yy(n),r=qy(e,Xy),i=qy(e,"right"),u=qy(o,Xy);return nx(r,i,u)},ox=function(t,n){var e=Yy(t),o=Yy(n),r=qy(e,"top"),i=qy(e,"bottom"),u=qy(o,"top");return nx(r,i,u)},rx=function(t,n){Dr(t,dy(),{value:n})},ix=function(t){return{x:Z(t)}},ux=function(t,n,e){var o={min:yy(n),max:Cy(n),range:By(n),value:e,step:My(n),snap:Fy(n),snapStart:Iy(n),rounded:Vy(n),hasMinEdge:Hy(n),hasMaxEdge:Ny(n),minBound:Ky(t),maxBound:Jy(t),screenRange:Zy(t)};return vy(o)},ax=function(u){return function(t,n){return(e=u,o=t,r=n,i=(0<e?py:gy)(Ly(r).x(),yy(r),Cy(r),My(r)),rx(o,ix(i)),tt.some(i)).map(function(){return!0});var e,o,r,i}},cx=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=(a=i,c=e,s=o,f=r,l=Zy(u=n),d=s.bind(function(t){return tt.some(ex(t,u))}).getOr(0),m=f.bind(function(t){return tt.some(ex(t,u))}).getOr(l),g={min:yy(a),max:Cy(a),range:By(a),value:c,hasMinEdge:Hy(a),hasMaxEdge:Ny(a),minBound:Ky(u),minOffset:0,maxBound:Jy(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},by(g));return Ky(n)-Ky(t)+p},sx=ax(-1),fx=ax(1),lx=tt.none,dx=tt.none,mx={"top-left":tt.none(),top:tt.none(),"top-right":tt.none(),right:tt.some(function(t,n){Gy(t,jy(Oy(n)))}),"bottom-right":tt.none(),bottom:tt.none(),"bottom-left":tt.none(),left:tt.some(function(t,n){Gy(t,jy(wy(n)))})},gx=/* */Object.freeze({setValueFrom:function(t,n,e){var o=ux(t,n,e),r=ix(o);return rx(t,r),o},setToMin:function(t,n){var e=yy(n);rx(t,ix(e))},setToMax:function(t,n){var e=Cy(n);rx(t,ix(e))},findValueOfOffset:ux,getValueFromEvent:function(t){return my(t).map(function(t){return t.left()})},findPositionOfValue:cx,setPositionFromValue:function(t,n,e,o){var r=Ly(e),i=cx(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),e),u=ua(n.element())/2;Ki(n.element(),"left",i-u+"px")},onLeft:sx,onRight:fx,onUp:lx,onDown:dx,edgeActions:mx}),px=function(t,n){Dr(t,dy(),{value:n})},hx=function(t){return{y:Z(t)}},vx=function(t,n,e){var o={min:xy(n),max:ky(n),range:Ay(n),value:e,step:My(n),snap:Fy(n),snapStart:Iy(n),rounded:Vy(n),hasMinEdge:Py(n),hasMaxEdge:zy(n),minBound:$y(t),maxBound:Qy(t),screenRange:tx(t)};return vy(o)},bx=function(u){return function(t,n){return(e=u,o=t,r=n,i=(0<e?py:gy)(Ly(r).y(),xy(r),ky(r),My(r)),px(o,hx(i)),tt.some(i)).map(function(){return!0});var e,o,r,i}},yx=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=(a=i,c=e,s=o,f=r,l=tx(u=n),d=s.bind(function(t){return tt.some(ox(t,u))}).getOr(0),m=f.bind(function(t){return tt.some(ox(t,u))}).getOr(l),g={min:xy(a),max:ky(a),range:Ay(a),value:c,hasMinEdge:Py(a),hasMaxEdge:zy(a),minBound:$y(u),minOffset:0,maxBound:Qy(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},by(g));return $y(n)-$y(t)+p},xx=tt.none,wx=tt.none,Sx=bx(-1),Cx=bx(1),kx={"top-left":tt.none(),top:tt.some(function(t,n){Gy(t,Uy(Sy(n)))}),"top-right":tt.none(),right:tt.none(),"bottom-right":tt.none(),bottom:tt.some(function(t,n){Gy(t,Uy(Ey(n)))}),"bottom-left":tt.none(),left:tt.none()},Ox=/* */Object.freeze({setValueFrom:function(t,n,e){var o=vx(t,n,e),r=hx(o);return px(t,r),o},setToMin:function(t,n){var e=xy(n);px(t,hx(e))},setToMax:function(t,n){var e=ky(n);px(t,hx(e))},findValueOfOffset:vx,getValueFromEvent:function(t){return my(t).map(function(t){return t.top()})},findPositionOfValue:yx,setPositionFromValue:function(t,n,e,o){var r=Ly(e),i=yx(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),e),u=sa(n.element())/2;Ki(n.element(),"top",i-u+"px")},onLeft:xx,onRight:wx,onUp:Sx,onDown:Cx,edgeActions:kx}),Ex=function(t,n){Dr(t,dy(),{value:n})},Tx=function(t,n){return{x:Z(t),y:Z(n)}},Bx=function(s,f){return function(t,n){return(e=s,o=f,r=t,i=n,u=0<e?py:gy,a=o?Ly(i).x():u(Ly(i).x(),yy(i),Cy(i),My(i)),c=o?u(Ly(i).y(),xy(i),ky(i),My(i)):Ly(i).y(),Ex(r,Tx(a,c)),tt.some(a)).map(function(){return!0});var e,o,r,i,u,a,c}},Ax=Bx(-1,!1),Dx=Bx(1,!1),_x=Bx(-1,!0),Mx=Bx(1,!0),Fx={"top-left":tt.some(function(t,n){Gy(t,Wy(wy(n),Sy(n)))}),top:tt.some(function(t,n){Gy(t,Wy(Dy(n),Sy(n)))}),"top-right":tt.some(function(t,n){Gy(t,Wy(Oy(n),Sy(n)))}),right:tt.some(function(t,n){Gy(t,Wy(Oy(n),_y(n)))}),"bottom-right":tt.some(function(t,n){Gy(t,Wy(Oy(n),Ey(n)))}),bottom:tt.some(function(t,n){Gy(t,Wy(Dy(n),Ey(n)))}),"bottom-left":tt.some(function(t,n){Gy(t,Wy(wy(n),Ey(n)))}),left:tt.some(function(t,n){Gy(t,Wy(wy(n),_y(n)))})},Ix=/* */Object.freeze({setValueFrom:function(t,n,e){var o=ux(t,n,e.left()),r=vx(t,n,e.top()),i=Tx(o,r);return Ex(t,i),i},setToMin:function(t,n){var e=yy(n),o=xy(n);Ex(t,Tx(e,o))},setToMax:function(t,n){var e=Cy(n),o=ky(n);Ex(t,Tx(e,o))},getValueFromEvent:function(t){return my(t)},setPositionFromValue:function(t,n,e,o){var r=Ly(e),i=cx(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),e),u=yx(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),e),a=ua(n.element())/2,c=sa(n.element())/2;Ki(n.element(),"left",i-a+"px"),Ki(n.element(),"top",u-c+"px")},onLeft:Ax,onRight:Dx,onUp:_x,onDown:Mx,edgeActions:Fx}),Vx=xn.detect().deviceType.isTouch(),Rx=[vr("stepSize",1),vr("onChange",Q),vr("onChoose",Q),vr("onInit",Q),vr("onDragStart",Q),vr("onDragEnd",Q),vr("snapToGrid",!1),vr("rounded",!0),dr("snapStart"),ir("model",Jo("mode",{x:[vr("minX",0),vr("maxX",100),Or("value",function(t){return Tt(t.mode.minX)}),rr("getInitialValue"),Mu("manager",gx)],y:[vr("minY",0),vr("maxY",100),Or("value",function(t){return Tt(t.mode.minY)}),rr("getInitialValue"),Mu("manager",Ox)],xy:[vr("minX",0),vr("maxX",100),vr("minY",0),vr("maxY",100),Or("value",function(t){return Tt({x:Z(t.mode.minX),y:Z(t.mode.minY)})}),rr("getInitialValue"),Mu("manager",Ix)]})),Vs("sliderBehaviours",[Yd,lm])].concat(Vx?[]:[Or("mouseIsDown",function(){return Tt(!1)})]),Hx=xn.detect().deviceType.isTouch(),Nx=Pf({name:"Slider",configFields:Rx,partFields:fy,factory:function(i,t,n,e){var u=function(t){return Of(t,i,"thumb")},a=function(t){return Of(t,i,"spectrum")},o=function(t){return kf(t,i,"left-edge")},r=function(t){return kf(t,i,"right-edge")},c=function(t){return kf(t,i,"top-edge")},s=function(t){return kf(t,i,"bottom-edge")},f=i.model,l=f.manager,d=function(t,n){l.setPositionFromValue(t,n,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})},m=function(t,n){f.value.set(n);var e=u(t);return d(t,e),i.onChange(t,e,n),tt.some(!0)},g=[Kr(Dt(),function(t,n){i.onDragStart(t,u(t))}),Kr(Mt(),function(t,n){i.onDragEnd(t,u(t))})],p=[Kr(Ft(),function(t,n){n.stop(),i.onDragStart(t,u(t)),i.mouseIsDown.set(!0)}),Kr(Rt(),function(t,n){i.onDragEnd(t,u(t))})],h=Hx?g:p;return{uid:i.uid,dom:i.dom,components:t,behaviours:Hs(i.sliderBehaviours,z([Hx?[]:[Yd.config({mode:"special",focusIn:function(t){return kf(t,i,"spectrum").map(Yd.focusIn).map(Z(!0))}})],[lm.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),qu.config({channels:{"mouse.released":{onReceive:function(e,t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&kf(e,i,"thumb").each(function(t){var n=f.value.get();i.onChoose(e,t,n)})}}}})]])),events:Xr([Kr(dy(),function(t,n){m(t,n.event().value())}),oi(function(t,n){var e=f.getInitialValue();f.value.set(e);var o=u(t);d(t,o);var r=a(t);i.onInit(t,o,r,f.value.get())})].concat(h)),apis:{resetToMin:function(t){l.setToMin(t,i)},resetToMax:function(t){l.setToMax(t,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),Px=Z(qe("rgb-hex-update")),zx=Z(qe("slider-update")),Lx=Z(qe("palette-update")),jx=function(t,o){var r=Nx.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Nx.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),u=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)};return Nf({factory:function(t){var n=Z({x:Z(0),y:Z(0)}),e=zu([Uf.config({find:tt.some}),hm.config({})]);return Nx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){Dr(t,Lx(),{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),Cb(kb()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,Cb(o))}},extraApis:{}})},Ux=function(t,n){var e=Nx.parts().spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Nx.parts().thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}});return Nx.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:Z({y:Z(0)})},components:[e,o],sliderBehaviours:zu([hm.config({})]),onChange:function(t,n,e){Dr(t,zx(),{value:e})}})},Wx=[Vs("formBehaviours",[lm])],Gx=function(t){return"<alloy.field."+t+">"},Xx=function(o,t,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:Hs(o.formBehaviours,[lm.config({store:{mode:"manual",getValue:function(t){var n=Tf(t,o);return et(n,function(t,n){return t().bind(function(t){var n,e=Uf.getCurrent(t);return n="missing current",e.fold(function(){return mt.error(n)},mt.value)}).map(lm.getValue)})},setValue:function(e,t){nt(t,function(n,t){kf(e,o,t).each(function(t){Uf.getCurrent(t).each(function(t){lm.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return kf(t,o,n).bind(Uf.getCurrent)}}}},Yx={getField:Ci(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),yf("form",Gx(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=_(r,function(t){return ff({name:t,pname:Gx(t)})});return If("form",Wx,i,Xx,o)}},qx=qe("valid-input"),Kx=qe("invalid-input"),Jx=qe("validating-input"),$x="colorcustom.rgb.",Qx=function(m,g,p,h){var v=function(t,n,e,o,r){var i,u,a=m($x+"range"),c=[$h.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),$h.parts().field({data:r,factory:jv,inputAttributes:Je({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[g("textfield")],inputBehaviours:zu([(i=n,u=t,eb.config({invalidClass:g("invalid"),notify:{onValidate:function(t){Dr(t,Jx,{type:i})},onValid:function(t){Dr(t,qx,{type:i,value:lm.getValue(t)})},onInvalid:function(t){Dr(t,Kx,{type:i,value:lm.getValue(t)})}},validator:{validate:function(t){var n=lm.getValue(t),e=u(n)?mt.value(!0):mt.error(m("aria.input.invalid"));return sv.pure(e)},validateOnLoad:!1}})),ib.config({})]),onSetValue:function(t){eb.isInvalid(t)&&eb.run(t).get(Q)}})],s="hex"!==n?[$h.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},b=function(t,n){var e=n.red(),o=n.green(),r=n.blue();lm.setValue(t,{red:e,green:o,blue:r})},y=tg({dom:{tag:"div",classes:[g("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),x=function(t,n){y.getOpt(t).each(function(t){Ki(t.element(),"background-color","#"+n.value())})};return Nf({factory:function(t){var e={red:Z(Tt(tt.some(255))),green:Z(Tt(tt.some(255))),blue:Z(Tt(tt.some(255))),hex:Z(Tt(tt.some("ffffff")))},o=function(t){return e[t]().get()},i=function(t,n){e[t]().set(n)},r=function(t){var n=t.red(),e=t.green(),o=t.blue();i("red",tt.some(n)),i("green",tt.some(e)),i("blue",tt.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),tt.none()):h(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,tt.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return bb(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=db(t),Yx.getField(n,"hex").each(function(t){hm.isFocused(t)||lm.setValue(n,{hex:e.value()})}),e);x(r,o)})},a=function(t,n){var e=n.event();"hex"===e.type()?function(t,n){p(t);var e=ub(n);i("hex",tt.some(n));var o=wb(e);b(t,o),r(o),Dr(t,Px(),{hex:e}),x(t,e)}(t,e.value()):u(t,e.type(),e.value())},c=function(t){return{label:m($x+t+".label"),description:m($x+t+".description")}},s=c("red"),f=c("green"),l=c("blue"),d=c("hex");return vt(Yx.sketch(function(t){return{dom:{tag:"form",classes:[g("rgb-form")],attributes:{"aria-label":m("aria.color.picker")}},components:[t.field("red",$h.sketch(v(yb,"red",s.label,s.description,255))),t.field("green",$h.sketch(v(yb,"green",f.label,f.description,255))),t.field("blue",$h.sketch(v(yb,"blue",l.label,l.description,255))),t.field("hex",$h.sketch(v(sb,"hex",d.label,d.description,"ffffff"))),y.asSpec()],formBehaviours:zu([eb.config({invalidClass:g("form-invalid")}),Rm("rgb-form-events",[Kr(qx,a),Kr(Kx,n),Kr(Jx,n)])])}}),{apis:{updateHex:function(t,n){var e,o;lm.setValue(t,{hex:n.value()}),e=t,o=wb(n),b(e,o),r(o),x(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},Zx=function(t,n,e){return{hue:Z(t),saturation:Z(n),value:Z(e)}},tw=function(c,s){return Nf({name:"ColourPicker",configFields:[vr("onValidHex",Q),vr("onInvalidHex",Q),gr("formChangeEvent")],factory:function(t){var a,v,e=Qx(c,s,t.onValidHex,t.onInvalidHex),o=jx(c,s),b={paletteRgba:Z(Tt(kb()))},n=tg(o.sketch({})),r=tg(e.sketch({})),i=function(t,e){n.getOpt(t).each(function(t){var n=wb(e);b.paletteRgba().set(n),o.setRgba(t,n)})},u=function(t,n){r.getOpt(t).each(function(t){e.updateHex(t,n)})},y=function(n,e,t){M(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[n.asSpec(),Ux(c,s),r.asSpec()],behaviours:zu([Rm("colour-picker-events",[Kr(Lx(),(v=[u],function(t,n){var e,o,r,i,u,a,c,s,f,l=n.event().value(),d=b.paletteRgba().get(),m=(c=u=0,o=(e=d).red()/255,r=e.green()/255,i=e.blue()/255,(s=Math.min(o,Math.min(r,i)))===(f=Math.max(o,Math.max(r,i)))?Zx(0,0,100*(c=s)):(u=60*((u=o===s?3:i===s?1:5)-(o===s?r-i:i===s?o-r:i-o)/(f-s)),a=(f-s)/f,c=f,Zx(Math.round(u),Math.round(100*a),Math.round(100*c)))),g=Zx(m.hue(),l.x(),100-l.y()),p=xb(g),h=db(p);y(t,h,v)})),Kr(zx(),(a=[i,u],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=Zx(360*(100-e/100),100,100),r=xb(o),db(r));y(t,u,a)}))]),Uf.config({find:function(t){return r.getOpt(t)}}),Yd.config({mode:"acyclic"})])}}})},nw=function(){return Uf.config({find:tt.some})},ew=function(t){return Uf.config({find:t.getOpt})},ow=function(t){return Uf.config({find:function(n){return ge(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},rw={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},iw=function(t){return rw[t]},uw=Io([vr("preprocess",d),vr("postprocess",d)]),aw=function(t,n,e){return lm.config(vt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},cw=function(t,n,e){return aw(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},sw=function(r,t){var i=qo("RepresentingConfigs.memento processors",uw,t);return lm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=lm.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);lm.setValue(o,e)}}})},fw=aw,lw=function(t){return cw(t,Se,Ce)},dw=function(t){return lm.config({store:{mode:"memory",initialValue:t}})},mw=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){M(t,function(t){t(n,e)})}},i=function(t,n){if(!mp.isDisabled(t)){var e=n.event().raw();a(t,e.dataTransfer.files)}},u=function(t,n){var e=n.event().raw().target.files;a(t,e)},a=function(t,n){var e,o;lm.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),F(K(e),function(t){return o.test(t.name)}))),Dr(t,zh,{name:r.name})},c=tg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:zu([Rm("input-file-events",[ti(Wt())])])}),t=r.label.map(function(t){return Vv(t,n)}),s=$h.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:zu([dw([]),nw(),mp.config({}),Am.config({toggleClass:"dragenter",toggleOnExecute:!1}),Rm("dropzone-events",[Kr("dragenter",o([e,Am.toggle])),Kr("dragleave",o([e,Am.toggle])),Kr("dragover",e),Kr("drop",o([e,i])),Kr(Ut(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},Zm.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:zu([ib.config({})])})]}]}}}});return _v(t,s,["tox-form__group--stretched"])},gw=qe("alloy-fake-before-tabstop"),pw=qe("alloy-fake-after-tabstop"),hw=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:zu([hm.config({ignore:!0}),ib.config({})])}},vw=function(t,n){Dr(t,zt(),{raw:{which:9,shiftKey:n}})},bw=function(t){return sh(t,["."+gw,"."+pw].join(","),Z(!1))},yw=function(t,n){var e=n.element();Ui(e,gw)?vw(t,!0):Ui(e,pw)&&vw(t,!1)},xw=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[hw([gw]),t,hw([pw])],behaviours:zu([ow(1)])}},ww=!(xn.detect().browser.isIE()||xn.detect().browser.isEdge()),Sw=function(t,n){var o,r,e=ww&&t.sandboxed,i=Je({},t.label.map(function(t){return{title:t}}).getOr({}),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=Tt(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)De(t.element(),"src","data:text/html;charset=utf-8,"+encodeURIComponent(n));else{De(t.element(),"src","javascript:''");var e=t.element().dom().contentWindow.document;e.open(),e.write(n),e.close()}r.set(n)}}),a=t.label.map(function(t){return Vv(t,n)}),c=$h.parts().field({factory:{sketch:function(t){return xw({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:zu([ib.config({}),hm.config({}),fw(tt.none(),u.getValue,u.setValue)])})}}});return _v(a,c,["tox-form__group--stretched"])};function Cw(t,n){return Ow(h.document.createElement("canvas"),t,n)}function kw(t){return t.getContext("2d")}function Ow(t,n,e){return t.width=n,t.height=e,t}var Ew={create:Cw,clone:function JA(t){var n;return kw(n=Cw(t.width,t.height)).drawImage(t,0,0),n},resize:Ow,get2dContext:kw,get3dContext:function $A(t){var n=null;try{n=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(e){}return n||(n=null),n}},Tw={getWidth:function QA(t){return t.naturalWidth||t.width},getHeight:function ZA(t){return t.naturalHeight||t.height}},Bw=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,o(r,this),o(u,this))},n=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){h.setTimeout(t,1)};function o(t,n){return function(){t.apply(n,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(o){var r=this;null!==this._state?n(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var n;try{n=t(r._value)}catch(e){return void o.reject(e)}o.resolve(n)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(o(n,t),o(r,this),o(u,this))}this._state=!0,this._value=t,a.call(this)}catch(e){u.call(this,e)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,n=this._deferreds.length;t<n;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,n,e,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=o}function s(t,n,e){var o=!1;try{t(function(t){o||(o=!0,n(t))},function(t){o||(o=!0,e(t))})}catch(r){if(o)return;o=!0,e(r)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(e,o){var r=this;return new t(function(t,n){i.call(r,new c(e,o,t,n))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new t(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}for(var t=0;t<c.length;t++)a(t,c[t])})},t.resolve=function(n){return n&&"object"==typeof n&&n.constructor===t?n:new t(function(t){t(n)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(r){return new t(function(t,n){for(var e=0,o=r.length;e<o;e++)r[e].then(t,n)})},t}();function Aw(){return new(Zn.getOrDie("FileReader"))}var Dw={atob:function(t){return Zn.getOrDie("atob")(t)},requestAnimationFrame:function(t){Zn.getOrDie("requestAnimationFrame")(t)}};function _w(a){return new Bw(function(t,n){var e=h.URL.createObjectURL(a),o=new h.Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),t(o)}function u(){r(),n("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()})}function Mw(o){return new Bw(function(t,e){var n=new h.XMLHttpRequest;n.open("GET",o,!0),n.responseType="blob",n.onload=function(){200==this.status&&t(this.response)},n.onerror=function(){var t,n=this;e(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+n.status+" downloading image"))},n.send()})}function Fw(t){var n=t.split(","),e=/data:([^;]+)/.exec(n[0]);if(!e)return tt.none();for(var o,r=e[1],i=n[1],u=Dw.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),f=0;f<c;++f){for(var l=1024*f,d=Math.min(l+1024,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[f]=(o=m,new(Zn.getOrDie("Uint8Array"))(o))}return tt.some(function h(t,n){return new(Zn.getOrDie("Blob"))(t,n)}(s,{type:r}))}function Iw(e){return new Bw(function(t,n){Fw(e).fold(function(){n("uri is not base64: "+e)},t)})}function Vw(e){return new Bw(function(t){var n=Aw();n.onloadend=function(){t(n.result)},n.readAsDataURL(e)})}var Rw={blobToImage:_w,imageToBlob:function tD(t){var n=t.src;return 0===n.indexOf("data:")?Iw(n):Mw(n)},blobToArrayBuffer:function nD(e){return new Bw(function(t){var n=Aw();n.onloadend=function(){t(n.result)},n.readAsArrayBuffer(e)})},blobToDataUri:Vw,blobToBase64:function eD(t){return Vw(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:Fw,canvasToBlob:function oD(t,e,o){return e=e||"image/png",h.HTMLCanvasElement.prototype.toBlob?new Bw(function(n){t.toBlob(function(t){n(t)},e,o)}):Iw(t.toDataURL(e,o))},canvasToDataURL:function rD(t,n,e){return n=n||"image/png",t.then(function(t){return t.toDataURL(n,e)})},blobToCanvas:function iD(t){return _w(t).then(function(t){var n;return function e(t){h.URL.revokeObjectURL(t.src)}(t),n=Ew.create(Tw.getWidth(t),Tw.getHeight(t)),Ew.get2dContext(n).drawImage(t,0,0),n})},uriToBlob:function uD(t){return 0===t.indexOf("blob:")?Mw(t):0===t.indexOf("data:")?Iw(t):null}};function Hw(t,n,e){var o=n.type;function r(n,e){return t.then(function(t){return Rw.canvasToDataURL(t,n,e)})}return{getType:Z(o),toBlob:function i(){return Bw.resolve(n)},toDataURL:function u(){return e},toBase64:function a(){return e.split(",")[1]},toAdjustedBlob:function c(n,e){return t.then(function(t){return Rw.canvasToBlob(t,n,e)})},toAdjustedDataURL:r,toAdjustedBase64:function s(t,n){return r(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function f(){return t.then(Ew.clone)}}}function Nw(n){return Rw.blobToDataUri(n).then(function(t){return Hw(Rw.blobToCanvas(n),n,t)})}var Pw={fromBlob:Nw,fromCanvas:function aD(n,t){return Rw.canvasToBlob(n,t).then(function(t){return Hw(Bw.resolve(n),t,n.toDataURL())})},fromImage:function cD(t){return Rw.imageToBlob(t).then(function(t){return Nw(t)})},fromBlobAndUrlSync:function(t,n){return Hw(Rw.blobToCanvas(t),t,n)}},zw=function(t){return Pw.fromBlob(t)};function Lw(t,n,e){return e<(t=parseFloat(t))?t=e:t<n&&(t=n),t}var jw=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function Uw(t,n){var e,o,r,i,u=[],a=new Array(10);for(e=0;e<5;e++){for(o=0;o<5;o++)u[o]=n[o+5*e];for(o=0;o<5;o++){for(r=i=0;r<5;r++)i+=t[o+5*r]*u[r];a[o+5*e]=i}}return a}function Ww(t,e){return e=Lw(e,0,1),t.map(function(t,n){return n%6==0?t=1-(1-t)*e:t*=e,Lw(t,0,1)})}var Gw={identity:function sD(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]},adjust:Ww,multiply:Uw,adjustContrast:function fD(t,n){var e;return n=Lw(n,-1,1),Uw(t,[(e=(n*=100)<0?127+n/100*127:127*(e=0==(e=n%1)?jw[n]:jw[Math.floor(n)]*(1-e)+jw[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])},adjustBrightness:function lD(t,n){return Uw(t,[1,0,0,0,n=Lw(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function dD(t,n){var e;return Uw(t,[.3086*(1-(e=1+(0<(n=Lw(n,-1,1))?3*n:n)))+e,.6094*(1-e),.082*(1-e),0,0,.3086*(1-e),.6094*(1-e)+e,.082*(1-e),0,0,.3086*(1-e),.6094*(1-e),.082*(1-e)+e,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function mD(t,n){var e,o;return n=Lw(n,-180,180)/180*Math.PI,Uw(t,[.213+.787*(e=Math.cos(n))+-.213*(o=Math.sin(n)),.715+-.715*e+-.715*o,.072+-.072*e+.928*o,0,0,.213+-.213*e+.143*o,.715+e*(1-.715)+.14*o,.072+-.072*e+-.283*o,0,0,.213+-.213*e+-.787*o,.715+-.715*e+.715*o,.072+.928*e+.072*o,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function gD(t,n,e,o){return Uw(t,[n=Lw(n,0,2),0,0,0,0,0,e=Lw(e,0,2),0,0,0,0,0,o=Lw(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function pD(t,n){return Uw(t,Ww([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],n=Lw(n,0,1)))},adjustGrayscale:function hD(t,n){return Uw(t,Ww([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],n=Lw(n,0,1)))}};function Xw(n,e){return n.toCanvas().then(function(t){return function i(t,n,e){var o,r=Ew.get2dContext(t);return o=function B(t,n){var e,o,r,i,u,a=t.data,c=n[0],s=n[1],f=n[2],l=n[3],d=n[4],m=n[5],g=n[6],p=n[7],h=n[8],v=n[9],b=n[10],y=n[11],x=n[12],w=n[13],S=n[14],C=n[15],k=n[16],O=n[17],E=n[18],T=n[19];for(u=0;u<a.length;u+=4)e=a[u],o=a[u+1],r=a[u+2],i=a[u+3],a[u]=e*c+o*s+r*f+i*l+d,a[u+1]=e*m+o*g+r*p+i*h+v,a[u+2]=e*b+o*y+r*x+i*w+S,a[u+3]=e*C+o*k+r*O+i*E+T;return t}(r.getImageData(0,0,t.width,t.height),e),r.putImageData(o,0,0),Pw.fromCanvas(t,n)}(t,n.getType(),e)})}function Yw(n,e){return n.toCanvas().then(function(t){return function u(t,n,e){var o,r,i=Ew.get2dContext(t);return o=i.getImageData(0,0,t.width,t.height),r=i.getImageData(0,0,t.width,t.height),r=function w(t,n,e){var o,r,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y;function x(t,n,e){return e<t?t=e:t<n&&(t=n),t}for(i=Math.round(Math.sqrt(e.length)),u=Math.floor(i/2),o=t.data,r=n.data,b=t.width,y=t.height,c=0;c<y;c++)for(a=0;a<b;a++){for(s=f=l=0,m=0;m<i;m++)for(d=0;d<i;d++)g=x(a+d-u,0,b-1),p=x(c+m-u,0,y-1),h=4*(p*b+g),v=e[m*i+d],s+=o[h]*v,f+=o[h+1]*v,l+=o[h+2]*v;r[h=4*(c*b+a)]=x(s,0,255),r[h+1]=x(f,0,255),r[h+2]=x(l,0,255)}return n}(o,r,e),i.putImageData(r,0,0),Pw.fromCanvas(t,n)}(t,n.getType(),e)})}function qw(c){return function(n,e){return n.toCanvas().then(function(t){return function(t,n,e){var o,r,i=Ew.get2dContext(t),u=new Array(256);for(r=0;r<u.length;r++)u[r]=c(r,e);return o=function a(t,n){var e,o=t.data;for(e=0;e<o.length;e+=4)o[e]=n[o[e]],o[e+1]=n[o[e+1]],o[e+2]=n[o[e+2]];return t}(i.getImageData(0,0,t.width,t.height),u),i.putImageData(o,0,0),Pw.fromCanvas(t,n)}(t,n.getType(),e)})}}function Kw(e){return function(t,n){return Xw(t,e(Gw.identity(),n))}}function Jw(n){return function(t){return Yw(t,n)}}var $w={invert:function vD(n){return function(t){return Xw(t,n)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:Kw(Gw.adjustBrightness),hue:Kw(Gw.adjustHue),saturate:Kw(Gw.adjustSaturation),contrast:Kw(Gw.adjustContrast),grayscale:Kw(Gw.adjustGrayscale),sepia:Kw(Gw.adjustSepia),colorize:function(t,n,e,o){return Xw(t,Gw.adjustColors(Gw.identity(),n,e,o))},sharpen:Jw([0,-1,0,-1,5,-1,0,-1,0]),emboss:Jw([-2,-1,0,-1,1,1,0,1,2]),gamma:qw(function(t,n){return 255*Math.pow(t/255,1-n)}),exposure:qw(function(t,n){return 255*(1-Math.exp(-t/255*n))}),colorFilter:Xw,convoluteFilter:Yw},Qw={scale:function bD(t,n,e){var o=Tw.getWidth(t),r=Tw.getHeight(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=function f(a,c,s){return new Bw(function(t){var n=Tw.getWidth(a),e=Tw.getHeight(a),o=Math.floor(n*c),r=Math.floor(e*s),i=Ew.create(o,r),u=Ew.get2dContext(i);u.drawImage(a,0,0,n,e,0,0,o,r),t(i)})}(t,i,u);return a?c.then(function(t){return bD(t,n,e)}):c}},Zw={rotate:function yD(n,e){return n.toCanvas().then(function(t){return function a(t,n,e){var o=Ew.create(t.width,t.height),r=Ew.get2dContext(o),i=0,u=0;return 90!=(e=e<0?360+e:e)&&270!=e||Ew.resize(o,o.height,o.width),90!=e&&180!=e||(i=o.width),270!=e&&180!=e||(u=o.height),r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(t,0,0),Pw.fromCanvas(o,n)}(t,n.getType(),e)})},flip:function xD(n,e){return n.toCanvas().then(function(t){return function i(t,n,e){var o=Ew.create(t.width,t.height),r=Ew.get2dContext(o);return"v"==e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),Pw.fromCanvas(o,n)}(t,n.getType(),e)})},crop:function wD(n,e,o,r,i){return n.toCanvas().then(function(t){return function a(t,n,e,o,r,i){var u=Ew.create(r,i);return Ew.get2dContext(u).drawImage(t,-e,-o),Pw.fromCanvas(u,n)}(t,n.getType(),e,o,r,i)})},resize:function SD(n,e,o){return n.toCanvas().then(function(t){return Qw.scale(t,e,o).then(function(t){return Pw.fromCanvas(t,n.getType())})})}},tS=(function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,n){if(t+n>this.length())return null;for(var e=this.littleEndian?0:-8*(n-1),o=0,r=0;o<n;o++)r|=this.readByteAt(t+o)<<Math.abs(e+8*o);return r},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var n=this.read(t,4);return 2147483647<n?n-4294967296:n},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,n){return this.asArray("CHAR",t,n).join("")},t.prototype.SEGMENT=function(t,n){var e=this._dv.buffer;switch(arguments.length){case 2:return e.slice(t,t+n);case 1:return e.slice(t);default:return e}},t.prototype.asArray=function(t,n,e){for(var o=[],r=0;r<e;r++)o[r]=this[t](n+r);return o},t.prototype.length=function(){return this._dv?this._dv.byteLength:0}}(),function(t,n){return Zw.rotate(t,n)}),nS=function(t){return $w.invert(t)},eS=function(t){return $w.sharpen(t)},oS=function(t,n){return $w.brightness(t,n)},rS=function(t,n){return $w.contrast(t,n)},iS=function(t,n,e,o){return $w.colorize(t,n,e,o)},uS=function(t,n){return $w.gamma(t,n)},aS=function(t,n){return Zw.flip(t,n)},cS=function(t,n,e,o,r){return Zw.crop(t,n,e,o,r)},sS=function(t,n,e){return Zw.resize(t,n,e)},fS=tS,lS=function(t,n){return Je({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},n)},dS=function(t,n){return lS(eg(t,n),{})},mS=function(t,n){return lS(eg(t,n),{behaviours:zu([Qd.config({})])})},gS=function(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:zu([Qd.config({})])}},pS=function(t,n,e,o,r){void 0===e&&(e=[]);var i=n.fold(function(){return{}},function(t){return{action:t}}),u=Je({buttonBehaviours:zu([pp(t.disabled),ib.config({}),Rm("button press",[qr("click"),qr("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},i),a=vt(u,{dom:o});return vt(a,{components:r})},hS=function(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return dS(t,e.icons)}),u=kp([i]);return pS(t,n,o,r,u)},vS=function(t,n,e,o){void 0===o&&(o=[]);var r=hS(t,tt.some(n),e,o);return Zm.sketch(r)},bS=function(t,n,e,o){void 0===o&&(o=[]);var r=e.translate(t.text),i=t.icon?t.icon.map(function(t){return dS(t,e.icons)}):tt.none(),u=i.isSome()?kp([i]):[],a=i.isSome()?{}:{innerHtml:r},c=(t.primary?["tox-button"]:["tox-button","tox-button--secondary"]).concat(i.isSome()?["tox-button--icon"]:[]);return function(t,n,e,o,r){void 0===e&&(e=[]);var i=pS(t,tt.some(n),e,o,r);return Zm.sketch(i)}(t,n,o,Je({tag:"button",classes:c},a,{attributes:{title:r}}),u)},yS=function(n,e){return function(t){"custom"===e?Dr(t,Uh,{name:n,value:{}}):"submit"===e?Ar(t,Wh):"cancel"===e?Ar(t,jh):console.error("Unknown button type: ",e)}},xS=function(t,n,e){var o=yS(t.name,n);return bS(t,o,e,[])},wS=Z([vr("field1Name","field1"),vr("field2Name","field2"),Du("onLockedChange"),Eu(["lockClass"]),vr("locked",!1),Ns("coupledFieldBehaviours",[Uf,lm])]),SS=function(t,i){return ff({factory:$h,name:t,overrides:function(r){return{fieldBehaviours:zu([Rm("coupled-input-behaviour",[Kr(jt(),function(e){var t,n,o;(t=e,n=r,o=i,kf(t,n,o).bind(Uf.getCurrent)).each(function(n){kf(e,r,"lock").each(function(t){Am.isOn(t)&&r.onLockedChange(e,n,t)})})})])])}}})},CS=Z([SS("field1","field2"),SS("field2","field1"),ff({factory:Zm,schema:[rr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:zu([Am.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),kS=Pf({name:"FormCoupledInputs",configFields:wS(),partFields:CS(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Ps(o.coupledFieldBehaviours,[Uf.config({find:tt.some}),lm.config({store:{mode:"manual",getValue:function(t){var n,e=Af(t,o,["field1","field2"]);return(n={})[o.field1Name]=lm.getValue(e.field1()),n[o.field2Name]=lm.getValue(e.field2()),n},setValue:function(t,n){var e=Af(t,o,["field1","field2"]);Et(n,o.field1Name)&&lm.setValue(e.field1(),n[o.field1Name]),Et(n,o.field2Name)&&lm.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return kf(t,o,"field1")},getField2:function(t){return kf(t,o,"field2")},getLock:function(t){return kf(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),OS=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return mt.error(t);var e=parseFloat(n[1]),o=n[2];return mt.value({value:e,unit:o})},ES=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(e,t)};return t.unit===n?tt.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?tt.some(t.value):tt.some(t.value/e[t.unit]*e[n]):tt.none()},TS=function(t){return tt.none()},BS=function(t,n){return function(t,n){for(var e=[],o=0;o<t.length;o++){var r=t[o];if(!r.isSome())return tt.none();e.push(r.getOrDie())}return tt.some(n.apply(null,e))}([OS(t).toOption(),OS(n).toOption()],function(t,o){return ES(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return ES(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(TS)}).getOr(TS)},AS=function(o,n){var a=TS,r=qe("ratio-event"),t=kS.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:eg("lock",n.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:eg("unlock",n.icons)}}],buttonBehaviours:zu([ib.config({})])}),e=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},i=function(e){return $h.parts().field({factory:jv,inputClasses:["tox-textfield"],inputBehaviours:zu([ib.config({}),Rm("size-input-events",[Kr(Nt(),function(t,n){Dr(t,r,{isField1:e})}),Kr(Ut(),function(t,n){Dr(t,zh,{name:o.name})})])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}},c=kS.parts().field1(e([$h.parts().label(u("Width")),i(!0)])),s=kS.parts().field2(e([$h.parts().label(u("Height")),i(!1)]));return kS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([u("&nbsp;"),t])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){OS(lm.getValue(t)).each(function(t){a(t).each(function(t){var n,e,o,r;lm.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(n=t).value.toFixed((e=n.unit)in o?o[e]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+n.unit))})})},coupledFieldBehaviours:zu([mp.config({}),Rm("size-input-events2",[Kr(r,function(t,n){var e=n.event().isField1(),o=e?kS.getField1(t):kS.getField2(t),r=e?kS.getField2(t):kS.getField1(t),i=o.map(lm.getValue).getOr(""),u=r.map(lm.getValue).getOr("");a=BS(i,u)})])])})},DS={undo:Z(qe("undo")),redo:Z(qe("redo")),zoom:Z(qe("zoom")),back:Z(qe("back")),apply:Z(qe("apply")),swap:Z(qe("swap")),transform:Z(qe("transform")),tempTransform:Z(qe("temp-transform")),transformApply:Z(qe("transform-apply"))},_S=Z("save-state"),MS=Z("disable"),FS=Z("enable"),IS={formActionEvent:Uh,saveState:_S,disable:MS,enable:FS},VS=function(r,c){var t=function(t,n,e,o){return tg(bS({name:t,text:t,disabled:e,primary:o},n,c))},n=function(t,n,e,o){return tg(vS({name:t,icon:tt.some(t),tooltip:tt.some(n),disabled:o},e,c))},u=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(mp)&&mp.disable(n)})},a=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(mp)&&mp.enable(n)})},s={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},e=tt.none(),o=Q,i=function(t,n,e){Dr(t,n,e)},f=function(t){return Ar(t,IS.disable())},l=function(t){return Ar(t,IS.enable())},d=function(t,n){f(t),i(t,DS.transform(),{transform:n}),l(t)},m=function(t){return function(){$.getOpt(t).each(function(t){Qd.set(t,[K])})}},g=function(t,n){f(t),i(t,DS.transformApply(),{transform:n,swap:m(t)}),l(t)},p=function(){return t("Back",function(t){return i(t,DS.back(),{swap:m(t)})},!1,!1)},h=function(){return tg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:zu([mp.config({})])})},v=function(){return t("Apply",function(t){return i(t,DS.apply(),{swap:m(t)})},!0,!0)},b=[p(),h(),t("Apply",function(t){g(t,function(t){var n=r.getRect();return cS(t,n.x,n.y,n.w,n.h)}),r.hideCrop()},!1,!0)],y=Bh.sketch({dom:s,components:b.map(function(t){return t.asSpec()}),containerBehaviours:zu([Rm("image-tools-crop-buttons-events",[Kr(IS.disable(),function(t,n){u(b,t)}),Kr(IS.enable(),function(t,n){a(b,t)})])])}),x=tg(AS({name:"size",label:e,type:"sizeinput",constrain:!0},c)),w=[p(),h(),x,h(),t("Apply",function(a){x.getOpt(a).each(function(t){var n,e,o=lm.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),u=(n=r,e=i,function(t){return sS(t,n,e)});g(a,u)})},!1,!0)],S=Bh.sketch({dom:s,components:w.map(function(t){return t.asSpec()}),containerBehaviours:zu([Rm("image-tools-resize-buttons-events",[Kr(IS.disable(),function(t,n){u(w,t)}),Kr(IS.enable(),function(t,n){a(w,t)})])])}),C=function(n,e){return function(t){return n(t,e)}},k=C(aS,"h"),O=C(aS,"v"),E=C(fS,-90),T=C(fS,90),B=function(t,n){var e,o;o=n,f(e=t),i(e,DS.tempTransform(),{transform:o}),l(e)},A=[p(),h(),n("flip-horizontally","Flip horizontally",function(t){B(t,k)},!1),n("flip-vertically","Flip vertically",function(t){B(t,O)},!1),n("rotate-left","Rotate counterclockwise",function(t){B(t,E)},!1),n("rotate-right","Rotate clockwise",function(t){B(t,T)},!1),h(),v()],D=Bh.sketch({dom:s,components:A.map(function(t){return t.asSpec()}),containerBehaviours:zu([Rm("image-tools-fliprotate-buttons-events",[Kr(IS.disable(),function(t,n){u(A,t)}),Kr(IS.enable(),function(t,n){a(A,t)})])])}),_=function(t,n,e,o,r){var i=Nx.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=Nx.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=Nx.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return tg(Nx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:Z({x:Z(o)})},components:[i,u,a],sliderBehaviours:zu([hm.config({})]),onChoose:n}))},M=function(t,n,e,o,r){return[p(),(i=t,u=n,a=e,c=o,s=r,_(i,function(t,n,e){var o=C(u,e.x()/100);d(t,o)},a,c,s)),v()];var i,u,a,c,s},F=function(t,n,e,o,r){var i=M(t,n,e,o,r);return Bh.sketch({dom:s,components:i.map(function(t){return t.asSpec()}),containerBehaviours:zu([Rm("image-tools-filter-panel-buttons-events",[Kr(IS.disable(),function(t,n){u(i,t)}),Kr(IS.enable(),function(t,n){a(i,t)})])])})},I=[p(),h(),v()],V=Bh.sketch({dom:s,components:I.map(function(t){return t.asSpec()})}),R=F("Brightness",oS,-100,0,100),H=F("Contrast",rS,-100,0,100),N=F("Gamma",uS,-100,0,100),P=function(t){return _(t,function(f,t,n){var e=z.getOpt(f),o=j.getOpt(f),r=L.getOpt(f);e.each(function(s){o.each(function(c){r.each(function(t){var n,e,o,r=lm.getValue(s).x()/100,i=lm.getValue(t).x()/100,u=lm.getValue(c).x()/100,a=(n=r,e=i,o=u,function(t){return iS(t,n,e,o)});d(f,a)})})})},0,100,200)},z=P("R"),L=P("G"),j=P("B"),U=[p(),z,L,j,v()],W=Bh.sketch({dom:s,components:U.map(function(t){return t.asSpec()})}),G=function(n,e,o){return function(t){i(t,DS.swap(),{transform:e,swap:function(){$.getOpt(t).each(function(t){Qd.set(t,[n]),o(t)})}})}},X=tt.some(eS),Y=tt.some(nS),q=[n("crop","Crop",G(y,e,function(t){r.showCrop()}),!1),n("resize","Resize",G(S,e,function(t){x.getOpt(t).each(function(t){var n=r.getMeasurements(),e=n.width,o=n.height;lm.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",G(D,e,o),!1),n("brightness","Brightness",G(R,e,o),!1),n("sharpen","Sharpen",G(V,X,o),!1),n("contrast","Contrast",G(H,e,o),!1),n("color-levels","Color levels",G(W,e,o),!1),n("gamma","Gamma",G(N,e,o),!1),n("invert","Invert",G(V,Y,o),!1)],K=Bh.sketch({dom:s,components:q.map(function(t){return t.asSpec()})}),J=Bh.sketch({dom:{tag:"div"},components:[K],containerBehaviours:zu([Qd.config({})])}),$=tg(J);return{memContainer:$,getApplyButton:function(t){return $.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}},RS=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),HS=tinymce.util.Tools.resolve("tinymce.geom.Rect"),NS=tinymce.util.Tools.resolve("tinymce.util.Observable"),PS=tinymce.util.Tools.resolve("tinymce.util.Tools"),zS=tinymce.util.Tools.resolve("tinymce.util.VK");function LS(t){var n,e;if(t.changedTouches)for(n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}function jS(t,r){var i,u,n,a,c,f,l,d=r.document||h.document;r=r||{};var m=d.getElementById(r.handle||t);n=function(t){var n,e,o=function s(t){var n,e,o,r,i,u,a,c=Math.max;return n=t.documentElement,e=t.body,o=c(n.scrollWidth,e.scrollWidth),r=c(n.clientWidth,e.clientWidth),i=c(n.offsetWidth,e.offsetWidth),u=c(n.scrollHeight,e.scrollHeight),a=c(n.clientHeight,e.clientHeight),{width:o<i?r:o,height:u<c(n.offsetHeight,e.offsetHeight)?a:u}}(d);LS(t),t.preventDefault(),u=t.button,n=m,f=t.screenX,l=t.screenY,e=h.window.getComputedStyle?h.window.getComputedStyle(n,null).getPropertyValue("cursor"):n.runtimeStyle.cursor,i=RS("<div></div>").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),RS(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(LS(t),t.button!==u)return a(t);t.deltaX=t.screenX-f,t.deltaY=t.screenY-l,t.preventDefault(),r.drag(t)},a=function(t){LS(t),RS(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){RS(m).off()},RS(m).on("mousedown touchstart",n)}var US,WS,GS,XS=0,YS=function(n){var f=tg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=Tt(1),d=Tt(tt.none()),m=Tt({x:0,y:0,w:1,h:1}),c=Tt({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=l.get(),o=ua(t.element()),r=sa(t.element()),i=s.dom().naturalWidth*e,u=s.dom().naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};Ji(s,n),f.getOpt(t).each(function(t){Ji(t.element(),n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=Xn.fromTag("img");return De(a,"src",n),(e=a.dom(),new dg(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)})).then(function(){return g.getOpt(t).map(function(t){var n=du({element:a});Qd.replaceAt(t,1,tt.some(n));var e=c.get(),o={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};c.set(o);var r,u,i=HS.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=ua(t.element()),e=sa(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(n/o,e/r);1<=i?l.set(1):l.set(i)})),s(t,a),a})})},t=Bh.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:zu([Rm("image-panel-crop-events",[oi(function(t){g.getOpt(t).each(function(t){var n=function S(s,e,f,o,r){var l,u,n,i,a="tox-",c="tox-crid-"+XS++;function d(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function m(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=HS.clamp({x:r,y:i,w:u,h:a},f,"move"===t.name),c=d(f,c),l.fire("updateRect",{rect:c}),h(c)}function g(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),RS("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}PS.each(u,function(t){RS("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function p(t){g(s=t)}function h(t){p(function e(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}}(f,t))}return u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],function v(){RS('<div id="'+c+'" class="'+a+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),PS.each(i,function(t){RS("#"+c,o).append('<div id="'+c+"-"+t+'"class="'+a+'croprect-block" style="display: none" data-mce-bogus="all">')}),PS.each(u,function(t){RS("#"+c,o).append('<div id="'+c+"-"+t.name+'" class="'+a+"croprect-handle "+a+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),n=PS.map(u,function t(n){var e;return new jS(c,{document:o.ownerDocument,handle:c+"-"+n.name,start:function(){e=s},drag:function(t){m(n,e,t.deltaX,t.deltaY)}})}),g(s),RS(o).on("focusin focusout",function(t){RS(t.target).attr("aria-grabbed","focus"===t.type)}),RS(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),m(i,e,o,r)}switch(PS.each(u,function(t){if(n.target.id===c+"-"+t.name)return i=t,!1}),n.keyCode){case zS.LEFT:t(n,0,s,-10,0);break;case zS.RIGHT:t(n,0,s,10,0);break;case zS.UP:t(n,0,s,0,-10);break;case zS.DOWN:t(n,0,s,0,10);break;case zS.ENTER:case zS.SPACEBAR:n.preventDefault(),r()}})}(),l=PS.extend({toggleVisibility:function b(t){var n;n=PS.map(u,function(t){return"#"+c+"-"+t.name}).concat(PS.map(i,function(t){return"#"+c+"-"+t})).join(","),t?RS(n,o).show():RS(n,o).hide()},setClampRect:function y(t){f=t,g(s)},setRect:p,getInnerRect:function t(){return d(f,s)},setInnerRect:h,setViewPortRect:function x(t){e=t,g(s)},destroy:function w(){PS.each(n,function(t){t.destroy()}),n=[]}},NS)}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element().dom(),function(){});n.toggleVisibility(!1),n.on("updateRect",function(t){var n=t.rect,e=l.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(tt.some(n))})})])])}],containerBehaviours:zu([Qd.config({}),Rm("image-panel-events",[oi(function(t){e(t,n)})])])}),g=tg(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=l.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);l.set(o),g.getOpt(t).each(function(t){var n=t.components()[1].element();s(t,n)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},qS=function(t,n,e,o,r){return vS({name:t,icon:tt.some(n),disabled:e,tooltip:tt.some(t)},o,r)},KS=function(t,n){n?mp.enable(t):mp.disable(t)},JS=function(){return Zn.getOrDie("URL")},$S=function(t){return JS().createObjectURL(t)},QS=function(t){JS().revokeObjectURL(t)},ZS=function(t){var n=Tt(t),e=Tt(tt.none()),r=function s(){var e=[],o=-1;function t(){return 0<o}function n(){return-1!==o&&o<e.length-1}return{data:e,add:function r(t){var n;return n=e.splice(++o),e.push(t),{state:t,removed:n}},undo:function i(){if(t())return e[--o]},redo:function u(){if(n())return e[++o]},canUndo:t,canRedo:n}}();r.add(t);var i=function(t){n.set(t)},u=function(t){return{blob:t,url:$S(t)}},a=function(t){QS(t.url)},o=function(){e.get().each(a),e.set(tt.none())},c=function(t){var n=u(t);i(n);var e,o=r.add(n).removed;return e=o,PS.each(e,a),n.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return e.get().fold(function(){return n.get()},function(t){return t})},updateTempState:function(t){var n=u(t);return o(),e.set(tt.some(n)),n.url},addTempState:function(t){var n=u(t);return e.set(tt.some(n)),n.url},applyTempState:function(n){return e.get().fold(function(){},function(t){c(t.blob),n()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},tC=function(t,n){var e,o,r,u=ZS(t.currentState),i=function(t){var n=u.getHistoryStates();p.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),Dr(t,IS.formActionEvent,{name:IS.saveState(),value:n.undoEnabled})},a=function(t){return t.toBlob()},c=function(t){Dr(t,IS.formActionEvent,{name:IS.disable(),value:{}})},s=function(t){h.getApplyButton(t).each(function(t){mp.enable(t)}),Dr(t,IS.formActionEvent,{name:IS.enable(),value:{}})},f=function(t,n){return c(t),g.updateSrc(t,n)},l=function(n,t,e,o,r){return c(n),zw(t).then(e).then(a).then(o).then(function(t){return f(n,t).then(function(t){return i(n),r(),s(n),t})})["catch"](function(t){console.log(t),s(n)})},d=function(t,n,e){var o=u.getBlobState().blob;l(t,o,n,function(t){return u.updateTempState(t)},e)},m=function(t){var n=u.getBlobState().url;return u.destroyTempState(),i(t),n},g=YS(t.currentState.url),p=(o=tg(qS("Undo","undo",!0,function(t){Dr(t,DS.undo(),{direction:1})},e=n)),r=tg(qS("Redo","redo",!0,function(t){Dr(t,DS.redo(),{direction:1})},e)),{container:Bh.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),qS("Zoom in","zoom-in",!1,function(t){Dr(t,DS.zoom(),{direction:1})},e),qS("Zoom out","zoom-out",!1,function(t){Dr(t,DS.zoom(),{direction:-1})},e)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){KS(t,n)}),r.getOpt(t).each(function(t){KS(t,e)})}}),h=VS(g,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[h.memContainer.asSpec(),g.memContainer.asSpec(),p.container],behaviours:zu([lm.config({store:{mode:"manual",getValue:function(){return u.getBlobState()}}}),Rm("image-tools-events",[Kr(DS.undo(),function(n,t){var e=u.undo();f(n,e).then(function(t){s(n),i(n)})}),Kr(DS.redo(),function(n,t){var e=u.redo();f(n,e).then(function(t){s(n),i(n)})}),Kr(DS.zoom(),function(t,n){var e=n.event().direction();g.zoom(t,e)}),Kr(DS.back(),function(t,n){var e,o;o=m(e=t),f(e,o).then(function(t){s(e)}),n.event().swap()(),g.hideCrop()}),Kr(DS.apply(),function(t,n){u.applyTempState(function(){m(t),n.event().swap()()})}),Kr(DS.transform(),function(t,n){return d(t,n.event().transform(),Q)}),Kr(DS.tempTransform(),function(t,n){return e=t,o=n.event().transform(),r=u.getTempState().blob,void l(e,r,o,function(t){return u.addTempState(t)},Q);var e,o,r}),Kr(DS.transformApply(),function(t,n){return e=t,o=n.event().transform(),r=n.event().swap(),i=u.getBlobState().blob,void l(e,i,o,function(t){var n=u.addBlobState(t);return m(e),n},r);var e,o,r,i}),Kr(DS.swap(),function(n,t){var e;e=n,p.updateButtonUndoStates(e,!1,!1);var o=t.event().transform(),r=t.event().swap();o.fold(function(){r()},function(t){d(n,t,r)})})]),nw()])}},nC=Nf({name:"HtmlSelect",configFields:[rr("options"),Vs("selectBehaviours",[hm,lm]),vr("selectClasses",[]),vr("selectAttributes",{}),dr("data")],factory:function(e,t){var n=_(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return Ct("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Hs(e.selectBehaviours,[hm.config({}),lm.config({store:Je({mode:"manual",getValue:function(t){return ou(t.element())},setValue:function(t,n){R(e.options,function(t){return t.value===n}).isSome()&&ru(t.element(),n)}},o)})])}}}),eC=function(e,n){var t=e.label.map(function(t){return Vv(t,n)}),o=[Yd.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return Ar(t,Wh),tt.some(!0)}}),Rm("textfield-change",[Kr(jt(),function(t,n){Dr(t,zh,{name:e.name})}),Kr(kn(),function(t,n){Dr(t,zh,{name:e.name})})]),ib.config({})],r=e.validation.map(function(o){return eb.config({getRoot:function(t){return le(t.element())},invalidClass:"tox-invalid",validator:{validate:function(t){var n=lm.getValue(t),e=o.validator(n);return sv.pure(!0===e?mt.value(n):mt.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=$h.parts().field({tag:!0===e.multiline?"textarea":"input",inputAttributes:e.placeholder.fold(function(){},function(t){return{placeholder:n.translate(t)}}),inputClasses:[e.classname],inputBehaviours:zu(z([o,r])),selectOnFocus:!1,factory:jv}),u=e.flex?["tox-form__group--stretched"]:[];return _v(t,i,u)},oC=function(i){return Je({},i,{toCached:function(){return oC(i.toCached())},bindFuture:function(n){return oC(i.bind(function(t){return t.fold(function(t){return sv.pure(mt.error(t))},function(t){return n(t)})}))},bindResult:function(n){return oC(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return oC(i.map(function(t){return t.map(n)}))},mapError:function(n){return oC(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return oC(sv.nu(function(n){var e=!1,o=window.setTimeout(function(){e=!0,n(mt.error(r()))},t);i.get(function(t){e||(window.clearTimeout(o),n(t))})}))}})},rC=function(t){return oC(sv.nu(t))},iC=rC,uC={type:"separator"},aC=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},cC=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:Q},onAction:function(){}}},sC=function(t,n){return o=t,e=F(n,function(t){return t.type===o}),_(e,aC);var e,o},fC=function(t,n){var e=t.toLowerCase();return F(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return mn(n.toLowerCase(),e)||mn(t.value.toLowerCase(),e)})},lC=function(c,t,s){var n=lm.getValue(t),f=n.meta.text!==undefined?n.meta.text:n.value;return s.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i,u,a=fC(f,(n=s.getHistory(c),_(n,function(t){return cC(t,t)})));return"file"===c?(e=[a,fC(f,(u=t,sC("header",u.targets))),fC(f,z([(i=t,i.anchorTop.map(function(t){return cC("<top>",t)}).toArray()),(r=t,sC("anchor",r.targets)),(o=t,o.anchorBottom.map(function(t){return cC("<bottom>",t)}).toArray())]))],V(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(uC,n)},[])):a})},dC=function(i,u,o){var t,r=function(t){var n=lm.getValue(t);o.addToHistory(n.value,i.filetype)},n=$h.parts().field({factory:Dv,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],minChars:0,responseTime:0,fetch:function(t){var n=lC(i.filetype,t,o),e=Lv(n,Sp.BUBBLE_TO_SANDBOX,u.providers);return sv.pure(e)},getHotspot:function(t){return l.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(eb)&&eb.run(t).get(Q)},typeaheadBehaviours:zu(z([o.getValidationHandler().map(function(o){return eb.config({getRoot:function(t){return le(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{},validator:{validate:function(n){var e=lm.getValue(n);return iC(function(t){o({type:i.filetype,url:e.value},function(e){l.getOpt(n).each(function(t){var n=function(t,n,e){(e?zi:ji)(t.element(),n)};n(t,"tox-control-wrap--status-valid","valid"===e.status),n(t,"tox-control-wrap--status-unknown","unknown"===e.status)}),t(("invalid"===e.status?mt.error:mt.value)(e.message))})})},validateOnLoad:!1}})}).toArray(),[ib.config({}),Rm("urlinput-events",z(["file"===i.filetype?[Kr(jt(),function(t){Dr(t,zh,{name:i.name})})]:[],[Kr(Ut(),function(t){Dr(t,zh,{name:i.name}),r(t)}),Kr(kn(),function(t){Dr(t,zh,{name:i.name}),r(t)})]]))]])),eventOrder:(t={},t[jt()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"dog"},lazySink:u.getSink,parts:{menu:jp(0,0,"normal")},onExecute:function(t,n,e){Dr(n,Wh,{})},onItemExecute:function(t,n,e,o){r(t),Dr(t,zh,{name:i.name})}}),e=i.label.map(function(t){return Vv(t,u.providers)}),a=function(t,n,e){return void 0===n&&(n=t),void 0===e&&(e=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:eg(n,u.providers.icons),attributes:{title:u.providers.translate(e)}}}},c=tg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[a("valid","checkmark","valid"),a("unknown","warning"),a("invalid","warning")]}),s=o.getUrlPicker(i.filetype),f=qe("browser.url.event"),l=tg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[n,c.asSpec()]});return $h.sketch({dom:Iv([]),components:e.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:z([[l.asSpec()],s.map(function(){return t=i.label,n=f,e="tox-browse-url",o="browse",r=u.providers,Zm.sketch({dom:{tag:"button",classes:["tox-tbtn",e],innerHtml:eg(o,r.icons),attributes:{title:r.translate(t.getOr(""))}},buttonBehaviours:zu([ib.config({})]),action:function(t){Ar(t,n)}});var t,n,e,o,r}).toArray()])}]),fieldBehaviours:zu([Rm("url-input-events",[Kr(f,function(o){Uf.getCurrent(o).each(function(n){var e=lm.getValue(n);s.each(function(t){t(e).get(function(t){lm.setValue(n,t),Dr(o,zh,{name:i.name})})})})})])])})},mC=function(u,n){var t,e,o=u.label.map(function(t){return Vv(t,n)}),r=function(e){return function(n,t){bu(t.event().target(),"[data-collection-item-value]").each(function(t){e(n,t,Me(t,"data-collection-item-value"))})}},i=[Kr(Ht(),r(function(t,n){ml(n)})),Kr(Wt(),r(function(t,n,e){Dr(t,Uh,{name:u.name,value:e})})),Kr(Nt(),r(function(t,n,e){vu(t.element(),"."+Gg).each(function(t){ji(t,Gg)}),zi(n,Gg)})),Kr(Pt(),r(function(t,n,e){vu(t.element(),"."+Gg).each(function(t){ji(t,Gg)})})),ui(r(function(t,n,e){Dr(t,Uh,{name:u.name,value:e})}))],a=$h.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:d},behaviours:zu([Qd.config({}),lm.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n,e,r,i;n=o,e=_(t,function(t){var n,e=1===u.columns?t.text.map(function(t){return'<div class="tox-collection__item-label">'+t+"</div>"}).getOr(""):"",o=t.icon.map(function(t){return'<div class="tox-collection__item-icon">'+t+"</div>"}).getOr(""),r={_:" "," - ":" ","-":" "},i=t.text.getOr("").replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(n=t.value)?"&quot;":n)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r=1<u.columns&&"auto"!==u.columns?D(e,u.columns):[e],i=_(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),Ce(n.element(),i.join("")),"auto"===u.columns&&Og(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;Yd.setGridSize(o,n,e)}),Ar(o,qh)}}),ib.config({}),Yd.config((t=u.columns,e="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+zg:"."+Pg}})),Rm("collection-events",i)])});return _v(o,a,["tox-form__group--collection"])},gC=function(r){return function(n,e,o){return St(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},pC={bar:gC(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar"]},components:_(e.items,o.interpreter)};var e,o}),collection:gC(function(t,n){return mC(t,n.shared.providers)}),alloy:gC(d),alertbanner:gC(function(t,n){return e=t,o=n.shared.providers,Bh.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Zm.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:eg(e.icon,o.icons),attributes:{title:o.translate(e.actionLabel)}},action:function(t){Dr(t,Uh,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:gC(function(t,n){return e=t,o=n.shared.providers,eC({name:e.name,multiline:!1,label:e.label,placeholder:e.placeholder,flex:!1,classname:"tox-textfield",validation:tt.none()},o);var e,o}),textarea:gC(function(t,n){return e=t,o=n.shared.providers,eC({name:e.name,multiline:!0,label:e.label,placeholder:e.placeholder,flex:!0,classname:"tox-textarea",validation:tt.none()},o);var e,o}),listbox:gC(function(t,n){return e=t,o=n.shared.providers,r=Vv(e.label,o),i=$h.parts().field({factory:nC,dom:{classes:["mce-select-field"]},selectBehaviours:zu([ib.config({})]),options:e.values,data:e.initialValue.getOr(undefined)}),Mv(tt.some(r),i);var e,o,r,i}),label:gC(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=_(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:zu([nw(),Qd.config({}),lw(tt.none()),Yd.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(US=function(t,n){return Sw(t,n.shared.providers)},function(t,n,e){var o=vt(n,{source:"dynamic"});return gC(US)(t,o,e)}),autocomplete:gC(function(t,n){return r=t,i=n.shared,e=Vv(r.label.getOr("?"),i.providers),o=$h.parts().field({factory:Dv,dismissOnBlur:!1,inputClasses:["tox-textfield"],minChars:1,fetch:function(t){var n=lm.getValue(t),e=r.getItems(n),o=Lv(e,Sp.BUBBLE_TO_SANDBOX,i.providers);return sv.pure(o)},markers:{openClass:"dog"},lazySink:i.getSink,parts:{menu:jp(0,0,"normal")}}),Mv(tt.some(e),o);var r,i,e,o}),button:gC(function(t,n){return e=t,o=n.shared.providers,r=yS(e.name,"custom"),bS(e,r,o,[dw(""),nw()]);var e,o,r}),checkbox:gC(function(t,n){return e=t,o=n.shared.providers,r=lm.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,n){t.element().dom().checked=n}}}),i=function(t){return t.element().dom().click(),tt.some(!0)},u=$h.parts().field({factory:{sketch:d},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:zu([nw(),ib.config({}),hm.config({}),r,Yd.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),Rm("checkbox-events",[Kr(Ut(),function(t,n){Dr(t,zh,{name:e.name})})])])}),a=$h.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:zu([Kb.config({})])}),s=tg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:eg("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),$h.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a]});var e,o,r,i,u,a,c,s}),colorinput:gC(function(t,n){return Zb(t,n.shared,n.colorinput)}),colorpicker:gC(function(t){var n=function(t){return"tox-"+t},e=tw(iw,n),r=tg(e.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Dr(t,Uh,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Dr(t,Uh,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:zu([lm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return Uf.getCurrent(n).bind(function(t){return lm.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);Uf.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){lm.setValue(t,{hex:tt.from(e[1]).getOr("")}),Yx.getField(t,"hex").each(function(t){Ar(t,jt())})})}}}),nw()])}}),dropzone:gC(function(t,n){return mw(t,n.shared.providers)}),grid:gC(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:_(e.items,o.interpreter)};var e,o}),selectbox:gC(function(t,n){return e=t,o=n.shared.providers,r=e.label.map(function(t){return Vv(t,o)}),i=$h.parts().field({dom:{},selectAttributes:{size:e.size},options:e.items,factory:nC,selectBehaviours:zu([ib.config({}),Rm("selectbox-change",[Kr(Ut(),function(t,n){Dr(t,zh,{name:e.name})})])])}),u=1<e.size?tt.none():tt.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:eg("chevron-down",o.icons)}}),a={dom:{tag:"div",classes:["tox-selectfield"]},components:z([[i],u.toArray()])},$h.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:z([r.toArray(),[a]])});var e,o,r,i,u,a}),sizeinput:gC(function(t,n){return AS(t,n.shared.providers)}),urlinput:gC(function(t,n){return dC(t,n.shared,n.urlinput)}),customeditor:gC(function(n){var e=Tt(tt.none()),o=tg({dom:{tag:n.tag}}),r=Tt(tt.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:zu([Rm("editor-foo-events",[oi(function(t){o.getOpt(t).each(function(t){n.init(t.element().dom()).then(function(n){r.get().each(function(t){n.setValue(t)}),r.set(tt.none()),e.set(tt.some(n))})})})]),lm.config({store:{mode:"manual",getValue:function(){return e.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){e.get().fold(function(){r.set(tt.some(n))},function(t){return t.setValue(n)})}}}),nw()]),components:[o.asSpec()]}}),htmlpanel:gC(function(t){return"presentation"===t.presets?Bh.sketch({dom:{tag:"div",innerHtml:t.html}}):Bh.sketch({dom:{tag:"div",innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:zu([ib.config({}),hm.config({})])})}),imagetools:gC(function(t,n){return tC(t,n.shared.providers)}),table:gC(function(t,n){return e=t,o=n.shared.providers,u=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},a=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:_(t,a)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:_(i,u)}]}),(r=e.cells,{dom:{tag:"tbody"},components:_(r,c)})],behaviours:zu([ib.config({}),hm.config({})])};var e,o,r,i,u,a,c})},hC={field:function(t,n){return n}},vC=function(n,t,e){var o=vt(e,{shared:{interpreter:function(t){return bC(n,t,o)}}});return bC(n,t,o)},bC=function(n,e,o){return St(pC,e.type).fold(function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},yC=function(t){return t.y()},xC=function(t,n,e){return Ka(t.x(),yC(t),e.northeast(),ha(),"layout-ne")},wC=function(t,n,e){return Ka((r=n,(o=t).x()+o.width()-r.width()),yC(t),e.northwest(),va(),"layout-nw");var o,r},SC=function(t,n,e){return Ka((r=n,(o=t).x()+o.width()/2-r.width()/2),yC(t),e.north(),ya(),"layout-n");var o,r},CC={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},kC=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m=Ph(t),g=function(){return Xn.fromDom(t.getBody())};return{toolbar:(f=g,l=n,d=m,d?function(){return{anchor:"node",root:f(),node:tt.from(f()),bubble:Ya(-12,-12,CC),layouts:{onRtl:function(){return[xC]},onLtr:function(){return[wC]}}}}:function(){return{anchor:"hotspot",hotspot:l(),bubble:Ya(-12,12,CC),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[oc]}}}}),toolbarOverflow:(s=e,function(){return{anchor:"hotspot",hotspot:s(),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[oc]}}}}),banner:(u=g,a=n,c=e,c?function(){return{anchor:"node",root:u(),node:tt.from(u()),layouts:{onRtl:function(){return[SC]},onLtr:function(){return[SC]}}}}:function(){return{anchor:"hotspot",hotspot:a(),layouts:{onRtl:function(){return[ac]},onLtr:function(){return[ac]}}}}),cursor:(r=t,i=g,function(){return{anchor:"selection",root:i(),getSelection:function(){var t=r.selection.getRng();return tt.some(xc(Xn.fromDom(t.startContainer),t.startOffset,Xn.fromDom(t.endContainer),t.endOffset))}}}),node:(o=g,function(t){return{anchor:"node",root:o(),node:t}})}},OC=function(t){return{colorPicker:(o=t,function(t,n){Gb.colorPickerDialog(o)(t,n)}),hasCustomColors:(e=t,function(){return Fb(e)}),getColors:(n=t,function(){return Ib(n)})};var n,e,o},EC=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strike-through",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],TC=function(t){return V(t,function(t,n){if(at(n,"items")){var e=TC(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(at(n,"inline")||at(n,"block")||at(n,"selector")){var o="custom-"+n.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return Je({},t,{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},BC=function(i){return(t=i,tt.from(t.getParam("style_formats")).filter(E)).map(function(t){var n,e,o,r=(n=i,e=TC(t),o=function(t){M(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})},n.formatter?o(e.customFormats):n.on("init",function(){o(e.customFormats)}),e.formats);return i.getParam("style_formats_merge",!1,"boolean")?EC.concat(r):r}).getOr(EC);var t},AC=function(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return vt(t,o)},DC=function(s,t,f,l){var d=function(t){return _(t,function(t){var n,e,o,r,i,u,a=J(t);if(Et(t,"items")){var c=d(t.items);return vt((i=t,u={type:"submenu",isSelected:Z(!1),getStylePreview:function(){return tt.none()}},vt(i,u)),{getStyleItems:function(){return c}})}return Et(t,"format")?AC(t,f,l):1===a.length&&B(a,"title")?vt(t,{type:"separator"}):(e=qe((n=t).title),o={type:"formatter",format:e,isSelected:f(e),getStylePreview:l(e)},r=vt(n,o),s.formatter.register(e,r),r)})};return d(t)},_C=PS.trim,MC=function(n){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}return!1}},FC=MC("true"),IC=MC("false"),VC=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},RC=function(t){return t.innerText||t.textContent},HC=function(t){return(n=t)&&"A"===n.nodeName&&(n.id||n.name)!==undefined&&PC(t);var n},NC=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},PC=function(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return FC(t)}return!1}(t)&&!IC(t)},zC=function(t){return NC(t)&&PC(t)},LC=function(t){var n,e,o=(n=t).id?n.id:qe("h");return VC("header",RC(t),"#"+o,NC(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=o})},jC=function(t){var n=t.id||t.name,e=RC(t);return VC("anchor",e||"#"+n,"#"+n,0,Q)},UC=function(t){var n,e;return n="h1,h2,h3,h4,h5,h6,a:not([href])",e=t,_(_c(Xn.fromDom(e),n),function(t){return t.dom()})},WC=function(t){return 0<_C(t.title).length},GC=function(t){var n,e=UC(t);return F((n=e,_(F(n,zC),LC)).concat(_(F(e,HC),jC)),WC)},XC="tinymce-url-history",YC=function(t){return w(t)&&/^https?/.test(t)},qC=function(t){return S(t)&&function(t,n){for(var e=J(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return tt.some(u)}return tt.none()}(t,function(t){return!(E(n=t)&&n.length<=5&&j(n,YC));var n}).isNone()},KC=function(){var t,n=h.localStorage.getItem(XC);if(null===n)return{};try{t=JSON.parse(n)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+XC+" was not valid JSON",e),{};throw e}return qC(t)?t:(console.log("Local storage "+XC+" was not valid format",t),{})},JC=function(t){var n=KC();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:[]},$C=function(n,t){if(YC(n)){var e=KC(),o=Object.prototype.hasOwnProperty.call(e,t)?e[t]:[],r=F(o,function(t){return t!==n});e[t]=[n].concat(r).slice(0,5),function(t){if(!qC(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));h.localStorage.setItem(XC,JSON.stringify(t))}(e)}},QC=Object.prototype.hasOwnProperty,ZC=function(t){return!!t},tk=function(t){return et(PS.makeMap(t,/[, ]/),ZC)},nk=function(t,n){return QC.call(t,n)?tt.some(t[n]):tt.none()},ek=function(t,n,e){var o=nk(t,n).getOr(e);return w(o)?tt.some(o):tt.none()},ok=function(a){return function(r){return(t=a.settings,n=r,e=tt.some(t.file_picker_types).filter(ZC),o=tt.some(t.file_browser_callback_types).filter(ZC),i=e.or(o).map(tk).fold(function(){return!0},function(t){return nk(t,n).getOr(!1)}),u=tt.some(t.file_picker_callback).filter(k),i?u:tt.none()).map(function(o){return function(n){return sv.nu(function(e){var t=PS.extend({filetype:r},tt.from(n.meta).getOr({}));o.call(a,function(t,n){if(!w(t))throw new Error("Expected value to be string");if(n!==undefined&&!S(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var t,n,e,o,i,u}},rk=function(t){return{getHistory:JC,addToHistory:$C,getLinkInformation:(e=t,function(){return!1===e.settings.typeahead_urls?tt.none():tt.some({targets:GC(e.getBody()),anchorTop:ek(e.settings,"anchor_top","#top"),anchorBottom:ek(e.settings,"anchor_bottom","#bottom")})}),getValidationHandler:(n=t,function(){var t=n.settings.filepicker_validator_handler;return k(t)?tt.some(t):tt.none()}),getUrlPicker:ok(t)};var n,e},ik=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:Hg.translate},interpreter:function(t){return bC(hC,t,m)},anchors:kC(n,e,o),getSink:function(){return mt.value(t)}},urlinput:rk(n),styleselect:(r=n,i=function(t){return function(){return r.formatter.match(t)}},u=function(n){return function(){var t=r.formatter.get(n);return t!==undefined?tt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:r.formatter.getCssText(n)}):tt.none()}},a=function(t){var n=t.items;return n!==undefined&&0<n.length?L(n,a):[t.format]},c=Tt([]),s=Tt([]),f=Tt([]),l=Tt([]),d=Tt(!1),r.on("init",function(){var t=BC(r),n=DC(r,t,i,u);c.set(n),s.set(L(n,a))}),r.on("addStyleModifications",function(t){var n=DC(r,t.items,i,u);f.set(n),d.set(t.replace),l.set(L(n,a))}),{getData:function(){var t=d.get()?[]:c.get(),n=f.get();return t.concat(n)},getFlattenedKeys:function(){var t=d.get()?[]:s.get(),n=l.get();return t.concat(n)}}),colorinput:OC(n)};return m},uk=tinymce.util.Tools.resolve("tinymce.util.Delay"),ak=Yn("within","extra","withinWidth"),ck=function(t,n,o){var e,r=(e=function(t,n){var e=o(t);return tt.some({element:Z(t),start:Z(n),finish:Z(n+e),width:Z(e)})},V(t,function(n,t){return e(t,n.len).fold(Z(n),function(t){return{len:t.finish(),list:n.list.concat([t])}})},{len:0,list:[]}).list),i=F(r,function(t){return t.finish()<=n}),u=I(i,function(t,n){return t+n.width()},0),a=r.slice(i.length);return{within:Z(i),extra:Z(a),withinWidth:Z(u)}},sk=function(t){return _(t,function(t){return t.element()})},fk=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p,h=(r=t,i=n,u=e,a=ck(i,r,u),0===a.extra().length?tt.some(a):tt.none()).getOrThunk(function(){return ck(n,t-e(o),e)}),v=h.within(),b=h.extra(),y=h.withinWidth();return 1===b.length&&b[0].width()<=e(o)?(m=b,g=y,p=sk(v.concat(m)),ak(p,[],g)):1<=b.length?(s=b,f=o,l=y,d=sk(v).concat([f]),ak(d,sk(s),l)):(c=y,ak(sk(v),[],c))},lk=function(n,t){return t.getAnimationRoot.fold(function(){return n.element()},function(t){return t(n)})},dk=function(t){return t.dimension.property},mk=function(t,n){return t.dimension.getDimension(n)},gk=function(t,n){var e=lk(t,n);Gi(e,[n.shrinkingClass,n.growingClass])},pk=function(t,n){ji(t.element(),n.openClass),zi(t.element(),n.closedClass),Ki(t.element(),dk(n),"0px"),eu(t.element())},hk=function(t,n){ji(t.element(),n.closedClass),zi(t.element(),n.openClass),nu(t.element(),dk(n))},vk=function(t,n,e,o){e.setCollapsed(),Ki(t.element(),dk(n),mk(n,t.element())),eu(t.element()),gk(t,n),pk(t,n),n.onStartShrink(t),n.onShrunk(t)},bk=function(t,n,e,o){var r=o.getOrThunk(function(){return mk(n,t.element())});e.setCollapsed(),Ki(t.element(),dk(n),r),eu(t.element());var i=lk(t,n);ji(i,n.growingClass),zi(i,n.shrinkingClass),pk(t,n),n.onStartShrink(t)},yk=function(t,n,e){var o=mk(n,t.element());("0px"===o?vk:bk)(t,n,e,tt.some(o))},xk=function(t,n,e){var o=lk(t,n),r=Ui(o,n.shrinkingClass),i=mk(n,t.element());hk(t,n);var u=mk(n,t.element());(r?function(){Ki(t.element(),dk(n),i),eu(t.element())}:function(){pk(t,n)})(),ji(o,n.shrinkingClass),zi(o,n.growingClass),hk(t,n),Ki(t.element(),dk(n),u),e.setExpanded(),n.onStartGrow(t)},wk=function(t,n,e){var o=lk(t,n);return!0===Ui(o,n.growingClass)},Sk=function(t,n,e){var o=lk(t,n);return!0===Ui(o,n.shrinkingClass)},Ck=/* */Object.freeze({refresh:function(t,n,e){if(e.isExpanded()){nu(t.element(),dk(n));var o=mk(n,t.element());Ki(t.element(),dk(n),o)}},grow:function(t,n,e){e.isExpanded()||xk(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&yk(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&vk(t,n,e,tt.none())},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:wk,isShrinking:Sk,isTransitioning:function(t,n,e){return!0===wk(t,n)||!0===Sk(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?yk:xk)(t,n,e)},disableTransitions:gk}),kk=/* */Object.freeze({exhibit:function(t,n){var e=n.expanded;return Ti(e?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Ct(n.dimension.property,"0px")})},events:function(e,o){return Xr([ei(Gt(),function(t,n){n.event().raw().propertyName===e.dimension.property&&(gk(t,e),o.isExpanded()&&nu(t.element(),e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),Ok=[rr("closedClass"),rr("openClass"),rr("shrinkingClass"),rr("growingClass"),dr("getAnimationRoot"),Bu("onShrunk"),Bu("onStartShrink"),Bu("onGrown"),Bu("onStartGrow"),vr("expanded",!1),ir("dimension",Jo("property",{width:[Mu("property","width"),Mu("getDimension",function(t){return ua(t)+"px"})],height:[Mu("property","height"),Mu("getDimension",function(t){return sa(t)+"px"})]}))],Ek=ju({fields:Ok,name:"sliding",active:kk,apis:Ck,state:/* */Object.freeze({init:function(t){var n=Tt(t.expanded);return Oi({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:v(n.set,!1),setExpanded:v(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),Tk=Z([vr("shell",!0),Vs("toolbarBehaviours",[Qd])]),Bk=Z([df({name:"groups",overrides:function(t){return{behaviours:zu([Qd.config({})])}}})]),Ak=Pf({name:"Toolbar",configFields:Tk(),partFields:Bk(),factory:function(n,t,e,o){var r=function(t){return n.shell?tt.some(t):kf(t,n,"groups")},i=n.shell?{behaviours:[Qd.config({})],components:[]}:{behaviours:[],components:t};return{uid:n.uid,dom:n.dom,components:i.components,behaviours:Hs(n.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,n){r(t).fold(function(){throw h.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Qd.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),Dk=Z([Eu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Vs("splitToolbarBehaviours",[]),Or("builtGroups",function(){return Tt([])}),vr("overflow",function(t){return tt.none()}),Sr("floating",!1)]),_k=[rr("dom"),vr("overflow",function(t){return tt.none()}),Sr("floating",!1)],Mk=Z([ff({factory:Ak,schema:_k,name:"primary"}),df({factory:Ak,schema:_k,name:"overflow",overrides:function(t){return{toolbarBehaviours:zu([Ek.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass})])}}}),lf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:zu([Am.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"}})])}}}),lf({name:"overflow-group"})]),Fk=Z([rr("items"),Eu(["itemSelector"]),Vs("tgroupBehaviours",[Yd])]),Ik=Z([mf({name:"items",unit:"item"})]),Vk=Pf({name:"ToolbarGroup",configFields:Fk(),partFields:Ik(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Hs(t.tgroupBehaviours,[Yd.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Rk=function(t,n){var e=_(n,function(t){return pu(t)});Ak.setGroups(t,e)},Hk=function(e,o,t,n){var r=Of(e,o,"primary"),i=kf(e,o,"overflow").orThunk(function(){return o.overflow(e)});Ki(r.element(),"visibility","hidden"),i.each(function(t){Ak.setGroups(t,[])});var u=o.builtGroups.get(),a=Vk.sketch(Je({},t["overflow-group"](),{items:[Zm.sketch(Je({},t["overflow-button"](),{action:function(t){!0===o.floating?Ar(e,n):i.each(function(t){Ek.toggleGrow(t)})}}))]})),c=e.getSystem().build(a);Rk(r,u.concat([c]));var s=ua(r.element()),f=fk(s,u,function(t){return ua(t.element())},c);0===f.extra().length?(Qd.remove(r,c),i.each(function(t){Ak.setGroups(t,[])})):(Rk(r,f.within()),i.each(function(t){Rk(t,f.extra())})),nu(r.element(),"visibility"),eu(r.element()),i.each(function(n){o.floating||Ek.refresh(n),kf(e,o,"overflow-button").each(function(t){o.floating?Am.set(t,n.getSystem().isConnected()):Am.set(t,Ek.hasGrown(n))})})},Nk=Pf({name:"SplitToolbar",configFields:Dk(),partFields:Mk(),factory:function(o,t,n,r){var i="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:Hs(o.splitToolbarBehaviours,[]),apis:{setGroups:function(t,n){var e;e=_(n,t.getSystem().build),o.builtGroups.set(e),Hk(t,o,r,i)},refresh:function(t){Hk(t,o,r,i)},getMoreButton:function(t){return kf(t,o,"overflow-button")},getOverflow:function(t){return kf(n=t,o,"overflow").orThunk(function(){return o.overflow(n)});var n}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},getMoreButton:function(t,n){return t.getMoreButton(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),Pk=function(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:Je({tag:"div",classes:["tox-toolbar__group"]},n),components:[Vk.parts().items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:zu([ib.config({}),hm.config({})])}},zk=function(t){return Vk.sketch(Pk(t))},Lk=function(r,t,n){var e=oi(function(t){var n=_(r.initGroups,zk);Ak.setGroups(t,n)}),o=n.fold(function(){return[e]},function(o){return[e,Kr("alloy.toolbar.toggle",function(e,t){r.getSink().toOption().each(function(n){o.getOpt(n).fold(function(){var t=gu(o.asSpec());ms(n,t),fs.position(n,r.backstage.shared.anchors.toolbarOverflow(),t),Nk.refresh(e)},function(t){hs(t)})})})]});return zu([Yd.config({mode:t,onEscape:r.onEscape,selector:".tox-toolbar__group"}),Rm("toolbar-events",o)])},jk=function(o){var t=o.cyclicKeying?"cyclic":"acyclic",n=tg(Ak.sketch({dom:{tag:"div",classes:["tox-toolbar__overflow"]}})),e=Nk.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),r=o.floating?[e]:[e,Nk.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}})];return Nk.sketch({uid:o.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},floating:o.floating,overflow:function(t){return o.getSink().toOption().bind(function(e){return n.getOpt(e).bind(function(n){return Nk.getMoreButton(t).bind(function(t){return n.getSystem().isConnected()?(fs.position(e,o.backstage.shared.anchors.toolbarOverflow(),n),tt.some(n)):tt.none()})})})},parts:{"overflow-group":Pk({title:tt.none(),items:[]}),"overflow-button":hS({name:"more",icon:tt.some("more-drawer"),disabled:!1,tooltip:tt.some("More...")},tt.none(),o.backstage.shared.providers)},components:r,markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},splitToolbarBehaviours:Lk(o,t,tt.some(n))})},Uk=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return Ak.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[Ak.parts().groups({})],toolbarBehaviours:Lk(t,n,tt.none())})},Wk=[Sr("disabled",!1),gr("tooltip"),gr("icon"),gr("text"),Cr("onSetup",function(){return Q})],Gk=Io([ur("type"),cr("onAction")].concat(Wk)),Xk=function(t){return Xo("toolbarbutton",Gk,t)},Yk=Io([ur("type"),gr("tooltip"),gr("icon"),gr("text"),cr("fetch"),Cr("onSetup",function(){return Q})]),qk=Io([ur("type"),gr("tooltip"),gr("icon"),gr("text"),pr("select"),cr("fetch"),Cr("onSetup",function(){return Q}),wr("presets","normal",["normal","color","listpreview"]),vr("columns",1),cr("onAction"),cr("onItemAction")]),Kk=[Sr("active",!1)].concat(Wk),Jk=Io(Kk.concat([ur("type"),cr("onAction")])),$k=function(t){return Xo("ToggleButton",Jk,t)},Qk=[Cr("predicate",function(){return!1}),wr("scope","node",["node","editor"]),wr("position","selection",["node","selection","line"])],Zk=Wk.concat([vr("type","contextformbutton"),vr("primary",!1),cr("onAction"),Or("original",d)]),tO=Kk.concat([vr("type","contextformbutton"),vr("primary",!1),cr("onAction"),Or("original",d)]),nO=Wk.concat([vr("type","contextformbutton")]),eO=Kk.concat([vr("type","contextformtogglebutton")]),oO=Jo("type",{contextformbutton:Zk,contextformtogglebutton:tO}),rO=Io([vr("type","contextform"),Cr("initValue",function(){return""}),gr("label"),lr("commands",oO),mr("launch",Jo("type",{contextformbutton:nO,contextformtogglebutton:eO}))].concat(Qk)),iO=Io([vr("type","contexttoolbar"),ur("items")].concat(Qk)),uO=qe("toolbar.button.execute"),aO={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},cO=/* */Object.freeze({getState:function(t,n,e){return e}}),sO=/* */Object.freeze({events:function(r,i){var o=function(e,o){r.updateState.each(function(t){var n=t(e,o);i.set(n)}),r.renderComponents.each(function(t){var n=t(o,i.get());vs(e),M(n,function(t){ms(e,e.getSystem().build(t))})})};return Xr([Kr(On(),function(t,n){var e=r.channel;B(n.channels(),e)&&o(t,n.data())}),oi(function(n,t){r.initialData.each(function(t){o(n,t)})})])}}),fO=/* */Object.freeze({init:function(t){var n=Tt(tt.none());return{readState:function(){return n.get().getOr("none")},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(tt.none())}}}}),lO=[rr("channel"),dr("renderComponents"),dr("updateState"),dr("initialData")],dO=ju({fields:lO,name:"reflecting",active:sO,apis:cO,state:fO}),mO=Z([rr("toggleClass"),rr("fetch"),Du("onExecute"),vr("getHotspot",tt.some),vr("layouts",tt.none()),Du("onItemExecute"),dr("lazySink"),rr("dom"),Bu("onOpen"),Vs("splitDropdownBehaviours",[tv,Yd,hm]),vr("matchWidth",!1),vr("useMinWidth",!1),vr("eventOrder",{}),dr("role")].concat(Tv())),gO=ff({factory:Zm,schema:[rr("dom")],name:"arrow",defaults:function(t){return{buttonBehaviours:zu([hm.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(_r)},buttonBehaviours:zu([Am.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),pO=ff({factory:Zm,schema:[rr("dom")],name:"button",defaults:function(t){return{buttonBehaviours:zu([hm.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),hO=Z([gO,pO,df({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[rr("text")],name:"aria-descriptor"}),lf({schema:[Ou()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),lv()]),vO=Pf({name:"SplitDropdown",configFields:mO(),partFields:hO(),factory:function(o,t,n,e){var r=function(t){Uf.getCurrent(t).each(function(t){el.highlightFirst(t),Yd.focusIn(t)})},i=function(t){pv(o,function(t){return t},t,e,r,Vh.HighlightFirst).get(Q)},u=function(t){var n=Of(t,o,"button");return _r(n),tt.some(!0)},a=bt(Xr([oi(function(e,t){kf(e,o,"aria-descriptor").each(function(t){var n=qe("aria");De(t.element(),"id",n),De(e.element(),"aria-describedby",n)})})]),Qm(tt.some(i)));return{uid:o.uid,dom:o.dom,components:t,eventOrder:Je({},o.eventOrder,{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:a,behaviours:Hs(o.splitDropdownBehaviours,[tv.config({others:{sandbox:function(t){var n=Of(t,o,"arrow");return bv(o,t,{onOpen:function(){Am.on(n),Am.on(t)},onClose:function(){Am.off(n),Am.off(t)}})}}}),Yd.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),tt.some(!0)}}),hm.config({}),Am.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}}}),bO=function(n){return{isDisabled:function(){return mp.isDisabled(n)},setDisabled:function(t){return t?mp.disable(n):mp.enable(n)}}},yO=function(n){return{setActive:function(t){Am.set(n,t)},isActive:function(){return Am.isOn(n)},isDisabled:function(){return mp.isDisabled(n)},setDisabled:function(t){return t?mp.disable(n):mp.enable(n)}}},xO=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},wO=qe("focus-button"),SO=function(n,e,t,o,r,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:xO(t,i)},components:kp([n.map(function(t){return dS(t,i.icons)}),e.map(function(t){return gS(t,"tox-tbtn",i)})]),eventOrder:(u={},u[Ft()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:zu([Rm("common-button-display-events",[Kr(Ft(),function(t,n){n.event().prevent(),Ar(t,wO)})])].concat(o.map(function(t){return dO.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return kp([t.icon.map(function(t){return dS(t,i.icons)}),t.text.map(function(t){return gS(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},CO=function(t,n,e){var o,r=Tt(Q),i=SO(t.icon,t.text,t.tooltip,tt.none(),tt.none(),e);return Zm.sketch({dom:i.dom,components:i.components,eventOrder:aO,buttonBehaviours:zu([Rm("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},ui(function(n,t){vp(o,n)(function(t){Dr(n,uO,{buttonApi:t}),o.onAction(t)})})),bp(n,r),yp(n,r)]),pp(t.disabled)].concat(n.toolbarButtonBehaviours))})},kO=function(t,n,e){return CO(t,{toolbarButtonBehaviours:[].concat(0<e.length?[Rm("toolbarButtonWith",e)]:[]),getApi:bO,onSetup:t.onSetup},n)},OO=function(t,n,e){return vt(CO(t,{toolbarButtonBehaviours:[Qd.config({}),Am.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[Rm("toolbarToggleButtonWith",e)]:[]),getApi:yO,onSetup:t.onSetup},n))},EO=function(n,t){var e,o,r,i,u=qe("channel-update-split-dropdown-display"),a=function(e){return{isDisabled:function(){return mp.isDisabled(e)},setDisabled:function(t){return t?mp.disable(e):mp.enable(e)},setIconFill:function(t,n){vu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){De(t,"fill",n)})},setIconStroke:function(t,n){vu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){De(t,"stroke",n)})},setActive:function(n){De(e.element(),"aria-pressed",n),vu(e.element(),"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Am.set(t,n)})})},isActive:function(){return vu(e.element(),"span").exists(function(t){return e.getSystem().getByDom(t).exists(Am.isOn)})}}},c=Tt(Q),s={getApi:a,onSetup:n.onSetup};return vO.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:bt({"aria-pressed":!1},xO(n.tooltip,t.providers))},onExecute:function(t){n.onAction(a(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:zu([hp(!1),Rm("split-dropdown-events",[Kr(wO,hm.focus),bp(s,c),yp(s,c)])]),eventOrder:(e={},e[Rn()]=["alloy.base.behaviour","split-dropdown-events"],e),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=a,r=n,i=t.providers,function(n){return sv.nu(function(t){return r.fetch(t)}).map(function(t){return tt.from(nh(vt(Zp(qe("menu-value"),t,function(t){r.onItemAction(o(n),t)},r.columns,r.presets,Sp.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),i),{movement:Up(r.columns,r.presets),menuBehaviours:Tg("auto"!==r.columns?[]:[oi(function(o,t){Og(o,4,Xg(r.presets)).each(function(t){var n=t.numRows,e=t.numColumns;Yd.setGridSize(o,n,e)})})])})))})}),parts:{menu:jp(0,n.columns,n.presets)},components:[vO.parts().button(SO(n.icon,n.text,tt.none(),tt.some(u),tt.some([Am.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),vO.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:eg("chevron-down",t.providers.icons)}}),vO.parts()["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},TO=function(i,u){return Kr(uO,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return Ar(e,_n())},getValue:function(){return lm.getValue(e)}});u.onAction(r,n.event().buttonApi())})},BO=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m,g,p={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===n.type?(s=t,l=p,(d=(f=n).original).primary,m=$e(d,["primary"]),g=Yo($k(Je({},m,{type:"togglebutton",onAction:function(){}}))),OO(g,l.backstage.shared.providers,[TO(s,f)])):(o=t,i=p,(u=(r=n).original).primary,a=$e(u,["primary"]),c=Yo(Xk(Je({},a,{type:"button",onAction:function(){}}))),kO(c,i.backstage.shared.providers,[TO(o,r)]))},AO=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=tg(jv.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:zu([Yd.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return _r(t),!0})},onLeft:function(t,n){return n.cut(),tt.none()},onRight:function(t,n){return n.cut(),tt.none()}})])})),c=(e=a,o=t.commands,r=n.shared.providers,i=_(o,function(t){return tg(BO(e,t,r))}),{asSpecs:function(){return _(i,function(t){return t.asSpec()})},findPrimary:function(e){return At(o,function(t,n){return t.primary?tt.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(m(mp.isDisabled)):tt.none()})}});return Uk({uid:qe("context-toolbar"),initGroups:[{title:tt.none(),items:[a.asSpec()]},{title:tt.none(),items:c.asSpecs()}],onEscape:tt.none,cyclicKeying:!0,backstage:n,floating:!1,getSink:function(){return mt.error("")}})},DO=qe("forward-slide"),_O=qe("backward-slide"),MO=qe("change-slide-event"),FO="tox-pop--resizing",IO=function(n,t){return At(t,function(t){return t.predicate(n.dom())?tt.some({toolbarApi:t,elem:n}):tt.none()})},VO=function(n,e){var t=function(t){return t.dom()===e.getBody()},o=Xn.fromDom(e.selection.getNode());return IO(o,n.inNodeScope).orThunk(function(){return IO(o,n.inEditorScope).orThunk(function(){return function(t,n,e){for(var o=t.dom(),r=k(e)?e:Z(!1);o.parentNode;){o=o.parentNode;var i=Xn.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return tt.none()}(o,function(t){return IO(t,n.inNodeScope)},t)})})},RO=function(e,r){var t={},i=[],u=[],a={},c={},o=function(n,e){var o=Yo(Xo("ContextForm",rO,e));(t[n]=o).launch.map(function(t){a["form:"+n]=Je({},e.launch,{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?u.push(o):i.push(o),c[n]=o},s=function(n,e){var t;(t=e,Xo("ContextToolbar",iO,t)).each(function(t){"editor"===e.scope?u.push(t):i.push(t),c[n]=t})},n=J(e);return M(n,function(t){var n=e[t];"contextform"===n.type?o(t,n):"contexttoolbar"===n.type&&s(t,n)}),{forms:t,inNodeScope:i,inEditorScope:u,lookupTable:c,formNavigators:a}},HO=qe("update-menu-text"),NO=qe("update-menu-icon"),PO=function(t,n,o){var r=t.text.map(function(t){return tg(gS(t,n,o.providers))}),i=t.icon.map(function(t){return tg(mS(t,o.providers.icons))}),e=function(t,n){var e=lm.getValue(t);return hm.focus(e),Dr(e,"keydown",{raw:n.event().raw()}),qb.close(e),tt.some(!0)},u=t.role.fold(function(){return{}},function(t){return{role:t}}),a=t.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}});return tg(qb.sketch(Je({},u,{dom:{tag:"button",classes:[n,n+"--select"].concat(_(t.classes,function(t){return n+"--"+t})),attributes:Je({},a)},components:kp([i.map(function(t){return t.asSpec()}),r.map(function(t){return t.asSpec()}),tt.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:eg("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:zu([pp(t.disabled),Kb.config({}),Qd.config({}),Rm("menubutton-update-display-text",[oi(t.onAttach),ri(t.onDetach),Kr(HO,function(n,e){r.bind(function(t){return t.getOpt(n)}).each(function(t){Qd.set(t,[lu(o.providers.translate(e.event().text()))])})}),Kr(NO,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){Qd.set(t,[mS(e.event().icon(),o.providers.icons)])})})])]),eventOrder:vt(aO,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:zu([Yd.config({mode:"special",onLeft:e,onRight:e})]),lazySink:o.getSink,toggleClass:n+"--active",parts:{menu:jp(0,t.columns,t.presets)},fetch:function(){return sv.nu(t.fetch)}}))).asSpec()},zO=function(t,n,e,o){var r,i,u,a,c,s="basic"===e.type?function(){return _(e.data,function(t){return AC(t,o.isSelectedFor,o.getPreviewFor)})}:e.getData;return{items:(r=n,i=o,u=function(t,n,e){var o=r.shared.providers.translate(t.title);return"separator"===t.type?{type:"separator",text:o}:"submenu"===t.type?{type:"nestedmenuitem",text:o,disabled:e,getSubmenuItems:function(){return L(t.getStyleItems(),function(t){return a(t,n)})}}:Je({type:"togglemenuitem",text:o,active:t.isSelected(),disabled:e,onAction:i.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}}))},a=function(t,n){var e="formatter"===t.type&&i.isInvalid(t);return 0===n?e?[]:[u(t,n,!1)]:[u(t,n,e)]},c=function(t){var n=i.shouldHide?0:1;return L(t,function(t){return a(t,n)})},{validateItems:c,getFetch:function(o,r){return function(t){var n=r(),e=c(n);t(Lv(e,Sp.CLOSE_ON_EXECUTE,o.shared.providers))}}}),getStyleItems:s}},LO=function(o,t,n,e){var r=zO(0,t,n,e),i=r.items,u=r.getStyleItems,a=Tt(undefined),c=e.nodeChangeHandler.map(function(e){return function(t){var n=e(t);a.set(n),o.on("nodeChange",n)}}).getOr(Q),s=e.nodeChangeHandler.map(function(t){return function(t){var n=a.get();n!==undefined&&o.off("nodeChange",n)}}).getOr(Q);return PO({text:e.icon.isSome()?tt.none():tt.some(""),icon:e.icon,tooltip:tt.from(e.tooltip),role:tt.none(),fetch:i.getFetch(t,u),onAttach:c,onDetach:s,columns:1,presets:"normal",classes:e.icon.isSome()?[]:["bespoke"]},"tox-tbtn",t.shared)};(GS=WS||(WS={}))[GS.SemiColon=0]="SemiColon",GS[GS.Space=1]="Space";var jO,UO,WO=function(t,n,e,o){var r,i,u=St(t.settings,n).getOr(e);return{type:"basic",data:(i=u,r=o===WS.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),_(r,function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}},GO=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],XO=function(e){var t=tt.some(function(n){return function(){var t=R(GO,function(t){return e.formatter.match(t.format)}).fold(function(){return"left"},function(t){return t.title.toLowerCase()});Dr(n,NO,{icon:"align-"+t})}}),n={type:"basic",data:GO};return{tooltip:"Align",icon:tt.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getPreviewFor:function(t){return function(){return tt.none()}},onAction:function(t){return function(){e.undoManager.transact(function(){e.focus(),e.formatter.match(t.format)?e.formatter.remove(t.format):e.formatter.apply(t.format)})}},nodeChangeHandler:t,dataset:n,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},YO=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],qO=function(r){var o=function(){var e=function(t){return t?t.split(",")[0]:""},t=r.queryCommandValue("FontName"),n=i.data,o=t?t.toLowerCase():"";return R(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return 0===(t=o).indexOf("-apple-system")&&(n=t.toLowerCase().split(/['"]?\s*,\s*['"]?/),j(YO,function(t){return-1<n.indexOf(t.toLowerCase())}))?tt.from({title:"System Font",format:o}):tt.none();var t,n})},t=tt.some(function(e){return function(){var t=r.queryCommandValue("FontName"),n=o().fold(function(){return t},function(t){return t.title});Dr(e,HO,{text:n})}}),i=WO(r,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",WS.SemiColon);return{tooltip:"Fonts",icon:tt.none(),isSelectedFor:function(n){return function(){return o().exists(function(t){return t.format===n})}},getPreviewFor:function(t){return function(){return tt.some({tag:"div",styleAttr:-1===t.indexOf("dings")?"font-family:"+t:""})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},nodeChangeHandler:t,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},KO=function(t,n){return/[0-9.]+px$/.test(t)?(e=72*parseInt(t,10)/96,o=n||0,r=Math.pow(10,o),Math.round(e*r)/r+"pt"):t;var e,o,r},JO=function(i){var u=function(){var e=tt.none(),o=a.data,r=i.queryCommandValue("FontSize");if(r)for(var t=function(t){var n=KO(r,t);e=R(o,function(t){return t.format===r||t.format===n})},n=3;e.isNone()&&0<=n;n--)t(n);return{matchOpt:e,px:r}},t=tt.some(function(r){return function(){var t=u(),n=t.matchOpt,e=t.px,o=n.fold(function(){return e},function(t){return t.title});Dr(r,HO,{text:o})}}),a=WO(i,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",WS.Space);return{tooltip:"Font sizes",icon:tt.none(),isSelectedFor:function(n){return function(){return u().matchOpt.exists(function(t){return t.format===n})}},getPreviewFor:function(){return function(){return tt.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.execCommand("FontSize",!1,t.format)})}},nodeChangeHandler:t,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},$O=function(e,t,n){var o=n.parents,r=t();return At(o,function(n){return R(r,function(t){return e.formatter.matchNode(n,t.format)})}).orThunk(function(){return e.formatter.match("p")?tt.some({title:"Paragraph",format:"p"}):tt.none()})},QO=function(o){var t=tt.some(function(e){return function(t){var n=$O(o,function(){return r.data},t).fold(function(){return"Paragraph"},function(t){return t.title});Dr(e,HO,{text:n})}}),r=WO(o,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",WS.SemiColon);return{tooltip:"Blocks",icon:tt.none(),isSelectedFor:function(t){return function(){return o.formatter.match(t)}},getPreviewFor:function(n){return function(){var t=o.formatter.get(n);return tt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(n)})}},onAction:function(t){return function(){o.undoManager.transact(function(){o.focus(),o.formatter.match(t.format)?o.formatter.remove(t.format):o.formatter.apply(t.format)})}},nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!o.formatter.canApply(t.format)}}},ZO=function(i){var t=tt.some(function(e){var o=function(t){var n=t.items;return n!==undefined&&0<n.length?L(n,o):[{title:t.title,format:t.format}]},r=L(BC(i),o);return function(t){var n=$O(i,function(){return r},t).fold(function(){return"Paragraph"},function(t){return t.title});Dr(e,HO,{text:n})}});return{tooltip:"Formats",icon:tt.none(),isSelectedFor:function(t){return function(){return i.formatter.match(t)}},getPreviewFor:function(n){return function(){var t=i.formatter.get(n);return t!==undefined?tt.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:i.formatter.getCssText(n)}):tt.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.formatter.match(t.format)?i.formatter.remove(t.format):i.formatter.apply(t.format)})}},nodeChangeHandler:t,shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!i.formatter.canApply(t.format)}}},tE={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},nE=function(t,n,e,o){return PO({text:t.text,icon:t.icon,tooltip:t.tooltip,role:o,fetch:function(n){t.fetch(function(t){n(Lv(t,Sp.CLOSE_ON_EXECUTE,e.providers))})},onAttach:function(){},onDetach:function(){},columns:1,presets:"normal",classes:[]},n,e)},eE=function(t){return"string"==typeof t?t.split(" "):t},oE=function(u,a){var c=bt(tE,a.menus),n=0<J(a.menus).length,t=a.menubar===undefined||!0===a.menubar?eE("file edit view insert format tools table help"):eE(!1===a.menubar?"":a.menubar),e=F(t,function(t){return n&&a.menus.hasOwnProperty(t)&&a.menus[t].hasOwnProperty("items")||tE.hasOwnProperty(t)}),o=_(e,function(t){var n,e,o,r,i=c[t];return n={title:i.title,items:eE(i.items)},e=a,r=(o=u,o.getParam("removed_menuitems","")).split(/[ ,]/),{text:n.title,getItems:function(){return L(n.items,function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:A(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}});return F(o,function(t){return 0<t.getItems().length&&A(t.getItems(),function(t){return"separator"!==t.type})})},rE=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],iE=function(o,r){return function(t,n){var e=o(t).fold(p(mt.error,Ko),mt.value).getOrDie();return r(e,n)}},uE={button:iE(Xk,function(t,n){return e=t,o=n.backstage.shared.providers,kO(e,o,[]);var e,o}),togglebutton:iE($k,function(t,n){return e=t,o=n.backstage.shared.providers,OO(e,o,[]);var e,o}),menubutton:iE(function(t){return Xo("menubutton",Yk,t)},function(t,n){return nE(t,"tox-tbtn",n.backstage.shared,tt.none())}),splitbutton:iE(function(t){return Xo("SplitButton",qk,t)},function(t,n){return EO(t,n.backstage.shared)}),styleSelectButton:function(t,n){return e=t,o=n.backstage,r=o.styleselect,LO(e,o,r,ZO(e));var e,o,r},fontsizeSelectButton:function(t,n){return e=t,o=n.backstage,r=JO(e),LO(e,o,r.dataset,r);var e,o,r},fontSelectButton:function(t,n){return e=t,o=n.backstage,r=qO(e),LO(e,o,r.dataset,r);var e,o,r},formatButton:function(t,n){return e=t,o=n.backstage,r=QO(e),LO(e,o,r.dataset,r);var e,o,r},alignMenuButton:function(t,n){return e=t,o=n.backstage,r=XO(e),LO(e,o,r.dataset,r);var e,o,r}},aE={styleselect:uE.styleSelectButton,fontsizeselect:uE.fontsizeSelectButton,fontselect:uE.fontSelectButton,formatselect:uE.formatButton,align:uE.alignMenuButton},cE=function(t){var n=t.split("|");return _(n,function(t){return{items:t.trim().split(" ")}})},sE=function(t){return!1===t.toolbar?[]:t.toolbar===undefined||!0===t.toolbar?(e=t.buttons,n=_(rE,function(t){var n=F(t.items,function(t){return at(e,t)||at(aE,t)});return{name:t.name,items:n}}),F(n,function(t){return 0<t.items.length})):w(t.toolbar)?cE(t.toolbar):E(t.toolbar)&&w(t.toolbar[0])?cE(t.toolbar.join(" | ")):t.toolbar;var e,n},fE=function(n,e,o,r,t){return ut(e,o.toLowerCase()).orThunk(function(){return t.bind(function(t){return At(t,function(t){return ut(e,t+o.toLowerCase())})})}).fold(function(){return ut(aE,o.toLowerCase()).map(function(t){return t(n,r)}).orThunk(function(){return tt.none()})},function(t){return e=r,ut(uE,(n=t).type).fold(function(){return console.error("skipping button defined by",n),tt.none()},function(t){return tt.some(t(n,e))});var n,e})},lE=function(e,o,r,i){var t=sE(o),n=_(t,function(t){var n=L(t.items,function(t){return 0===t.trim().length?[]:fE(e,o.buttons,t,r,i).toArray()});return{title:tt.from(e.translate(t.name)),items:n}});return F(n,function(t){return 0<t.items.length})},dE=function(i,t,u,c){var e,o,s=gu((e={sink:u,onEscape:function(){return i.focus(),tt.some(!0)}},o=Tt([]),$m.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){o.set([]),$m.getContent(t).each(function(t){nu(t.element(),"visibility")}),ji(t.element(),FO),nu(t.element(),"width")},inlineBehaviours:zu([Rm("context-toolbar-events",[ei(Gt(),function(t,n){$m.getContent(t).each(function(t){}),ji(t.element(),FO),nu(t.element(),"width")}),Kr(MO,function(n,e){nu(n.element(),"width");var t=ua(n.element());$m.setContent(n,e.event().contents()),zi(n.element(),FO);var o=ua(n.element());Ki(n.element(),"width",t+"px"),$m.getContent(n).each(function(t){e.event().focus().bind(function(t){return ml(t),pl(n.element())}).orThunk(function(){return Yd.focusIn(t),gl()})}),setTimeout(function(){Ki(n.element(),"width",o+"px")},0)}),Kr(DO,function(t,n){$m.getContent(t).each(function(t){o.set(o.get().concat([{bar:t,focus:gl()}]))}),Dr(t,MO,{contents:n.event().forwardContents(),focus:tt.none()})}),Kr(_O,function(n,t){q(o.get()).each(function(t){o.set(o.get().slice(0,o.get().length-1)),Dr(n,MO,{contents:pu(t.bar),focus:t.focus})})})]),Yd.config({mode:"special",onEscape:function(n){return q(o.get()).fold(function(){return e.onEscape()},function(t){return Ar(n,_O),tt.some(!0)})}})]),lazySink:function(){return mt.value(e.sink)}}))),f=function(){return tt.some(Xn.fromDom(i.contentAreaContainer))};i.on("init",function(){var t=i.getBody().ownerDocument.defaultView,n=ah(Xn.fromDom(t),"scroll",function(){l.get().each(function(t){var n=d.get().getOr(i.selection.getNode()).getBoundingClientRect(),e=i.contentAreaContainer.getBoundingClientRect(),o=n.bottom<0,r=n.top>e.height;o||r?Ki(s.element(),"display","none"):(nu(s.element(),"display"),fs.positionWithin(u,t,s,f()))})});i.on("remove",function(){n.unbind()})});var l=Tt(tt.none()),d=Tt(tt.none()),n=Tt(null),m=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:zu([Yd.config({mode:"acyclic"}),Rm("pop-dialog-wrap-events",[oi(function(t){i.shortcuts.add("ctrl+F9","focus statusbar",function(){return Yd.focusIn(t)})}),ri(function(t){i.shortcuts.remove("ctrl+F9")})])])}},a=Yt(function(){return RO(t,function(t){var n=g(t);Dr(s,DO,{forwardContents:m(n)})})}),g=function(t){var n,e,o=i.ui.registry.getAll().buttons,r=a();return"contexttoolbar"===t.type?(n=bt(o,r.formNavigators),e=lE(i,{buttons:n,toolbar:t.items},c,tt.some(["form:"])),Uk({uid:qe("context-toolbar"),initGroups:e,onEscape:tt.none,cyclicKeying:!0,backstage:c.backstage,floating:!1,getSink:function(){return mt.error("")}})):AO(t,c.backstage)};i.on("contexttoolbar-show",function(n){var t=a();St(t.lookupTable,n.toolbarKey).each(function(t){b(t,n.target===i?tt.none():tt.some(n)),$m.getContent(s).each(Yd.focusIn)})});var r={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},p={maxHeightFunction:ja()},h={bubble:Ya(12,0,r),layouts:{onLtr:function(){return[cc]},onRtl:function(){return[sc]}},overrides:p},v={bubble:Ya(0,12,r),layouts:{onLtr:function(){return[uc,ac,rc,ec,ic,oc]},onRtl:function(){return[uc,ac,ic,oc,rc,ec]}},overrides:p},b=function(t,n){x();var e,o,r,i=g(t),u=n.map(Xn.fromDom),a=(e=t.position,o=u,r="node"===e?c.backstage.shared.anchors.node(o):c.backstage.shared.anchors.cursor(),vt(r,"line"===e?h:v));l.set(tt.some(a)),d.set(n),$m.showWithin(s,a,m(i),f()),nu(s.element(),"display")},y=function(){var t=a();VO(t,i).fold(function(){l.set(tt.none()),$m.hide(s)},function(t){b(t.toolbarApi,tt.some(t.elem.dom()))})},x=function(){var t=n.get();null!==t&&(clearTimeout(t),n.set(null))},w=function(t){x(),n.set(t)};i.on("init",function(){i.on("click keyup setContent ObjectResized ResizeEditor",function(t){w(uk.setEditorTimeout(i,y,0))}),i.on("focusout",function(t){uk.setEditorTimeout(i,function(){pl(u.element()).isNone()&&pl(s.element()).isNone()&&(l.set(tt.none()),$m.hide(s))},0)}),i.on("nodeChange",function(t){pl(s.element()).fold(function(){w(uk.setEditorTimeout(i,y,0))},function(t){})})})},mE=function(t,e,o){var n=ah(Xn.fromDom(h.document),"mousedown",function(n){M([e,o],function(t){t.broadcastOn([Ds()],{target:n.target()})})}),r=ah(Xn.fromDom(h.document),"touchstart",function(n){M([e,o],function(t){t.broadcastOn([Ds()],{target:n.target()})})}),i=ah(Xn.fromDom(h.document),"mouseup",function(n){0===n.raw().button&&M([e,o],function(t){t.broadcastOn([_s()],{target:n.target()})})}),u=function(n){M([e,o],function(t){t.broadcastOn([Ds()],{target:Xn.fromDom(n.target)})})};t.on("mousedown",u),t.on("touchstart",u);var a=function(n){0===n.button&&M([e,o],function(t){t.broadcastOn([_s()],{target:Xn.fromDom(n.target)})})};t.on("mouseup",a);var c=function(n){M([e,o],function(t){t.broadcastEvent(In(),n)})};t.on("ScrollWindow",c);var s=function(n){M([e,o],function(t){t.broadcastEvent(Vn(),n)})};t.on("ResizeWindow",s),t.on("remove",function(){t.off("mousedown",u),t.off("touchstart",u),t.off("mouseup",a),t.off("ResizeWindow",s),t.off("ScrollWindow",c),n.unbind(),r.unbind(),i.unbind()}),t.on("detach",function(){xs(e),xs(o),e.destroy(),o.destroy()})},gE=Mf,pE=pf,hE=Nf({factory:function(o,t){var n={focus:Yd.focusIn,setMenus:function(t,n){var e=_(n,function(n){var t={text:tt.some(n.text),icon:tt.none(),tooltip:tt.none(),fetch:function(t){t(n.getItems())}};return nE(t,"tox-mbtn",{getSink:o.getSink,providers:o.providers},tt.some("menuitem"))});Qd.set(t,e)}};return{uid:o.uid,dom:o.dom,components:[],behaviours:zu([Qd.config({}),Rm("menubar-events",[oi(function(t){o.onSetup(t)}),Kr(Ht(),function(e,t){vu(e.element(),".tox-mbtn--active").each(function(n){bu(t.event().target(),".tox-mbtn").each(function(t){ce(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){qb.expand(t),qb.close(n),hm.focus(t)})})})})}),Kr(Pn(),function(e,t){t.event().prevFocus().bind(function(t){return e.getSystem().getByDom(t).toOption()}).each(function(n){t.event().newFocus().bind(function(t){return e.getSystem().getByDom(t).toOption()}).each(function(t){qb.isOpen(n)&&(qb.expand(t),qb.close(n))})})})]),Yd.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return o.onEscape(t),tt.some(!0)}}),ib.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[rr("dom"),rr("uid"),rr("onEscape"),rr("getSink"),rr("providers"),vr("onSetup",Q)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),vE="container",bE=[Vs("slotBehaviours",[])],yE=function(t){return"<alloy.field."+t+">"},xE=function(r,t,n){var e,o=function(t){return Bf(r)},i=function(e,o){return void 0===o&&(o=undefined),function(t,n){return kf(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},u=function(t,n){return"true"!==Me(t.element(),"aria-hidden")},a=i(u,!1),c=i(function(t,n){if(u(t)){var e=t.element();Ki(e,"display","none"),De(e,"aria-hidden","true"),Dr(t,zn(),{name:n,visible:!1})}}),s=(e=c,function(n,t){M(t,function(t){return e(n,t)})}),f=i(function(t,n){if(!u(t)){var e=t.element();nu(e,"display"),Ie(e,"aria-hidden"),Dr(t,zn(),{name:n,visible:!0})}}),l={getSlotNames:o,getSlot:function(t,n){return kf(t,r,n)},isShowing:a,hideSlot:c,hideAllSlots:function(t){return s(t,o())},showSlot:f};return{uid:r.uid,dom:r.dom,components:t,behaviours:Rs(r.slotBehaviours),apis:l}},wE=et({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},Ci),SE=Je({},wE,{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),yf(vE,yE(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=_(r,function(t){return ff({name:t,pname:yE(t)})});return If(vE,bE,i,xE,o)}}),CE=Io([gr("icon"),gr("tooltip"),Cr("onShow",Q),Cr("onHide",Q),Cr("onSetup",function(){return Q})]),kE=function(t){return{element:function(){return t.element().dom()}}},OE=function(e,o){var r=_(J(o),function(t){var n=o[t],e=Yo(Xo("sidebar",CE,n));return{name:t,getApi:kE,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return _(r,function(t){var n=Tt(Q);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Tg([bp(t,n),yp(t,n),Kr(zn(),function(n,t){var e=t.event();R(r,function(t){return t.name===e.name()}).each(function(t){(e.visible()?t.onShow:t.onHide)(t.getApi(n))})})])})})},EE=function(t,e){Uf.getCurrent(t).each(function(t){return Qd.set(t,[(n=e,SE.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:OE(t,n),slotBehaviours:Tg([oi(function(t){return SE.hideAllSlots(t)})])}}))]);var n})},TE=function(t){return Uf.getCurrent(t).bind(function(t){return Ek.isGrowing(t)||Ek.hasGrown(t)?Uf.getCurrent(t).bind(function(n){return R(SE.getSlotNames(n),function(t){return SE.isShowing(n,t)})}):tt.none()})},BE=qe("FixSizeEvent"),AE=qe("AutoSizeEvent"),DE=pE.optional({factory:hE,name:"menubar",schema:[rr("dom"),rr("getSink")]}),_E=pE.optional({factory:{sketch:function(t){return(t.split===Eh.sliding||t.split===Eh.floating?jk:Uk)({uid:t.uid,onEscape:function(){return t.onEscape(),tt.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,backstage:t.backstage,floating:t.split===Eh.floating})}},name:"toolbar",schema:[rr("dom"),rr("onEscape"),rr("getSink")]}),ME=pE.optional({name:"socket",schema:[rr("dom")]}),FE=pE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:zu([ib.config({}),hm.config({}),Ek.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){Uf.getCurrent(t).each(SE.hideAllSlots),Ar(t,AE)},onGrown:function(t){Ar(t,AE)},onStartGrow:function(t){Dr(t,BE,{width:Zi(t.element(),"width").getOr("")})},onStartShrink:function(t){Dr(t,BE,{width:ua(t.element())+"px"})}}),Qd.config({}),Uf.config({find:function(t){var n=Qd.contents(t);return Y(n)}})])}],behaviours:zu([ow(0),Rm("sidebar-sliding-events",[Kr(BE,function(t,n){Ki(t.element(),"width",n.event().width())}),Kr(AE,function(t,n){nu(t.element(),"width")})])])}}},name:"sidebar",schema:[rr("dom")]}),IE=Pf({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return gE.getPart(t,e,"socket")},setSidebar:function(t,n){gE.getPart(t,e,"sidebar").each(function(t){return EE(t,n)})},toggleSidebar:function(t,o){gE.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void Uf.getCurrent(n).each(function(n){Uf.getCurrent(n).each(function(t){Ek.hasGrown(n)?SE.isShowing(t,e)?Ek.shrink(n):(SE.hideAllSlots(t),SE.showSlot(t,e)):(SE.hideAllSlots(t),SE.showSlot(t,e),Ek.grow(n))})});var n,e})},whichSidebar:function(t){return gE.getPart(t,e,"sidebar").bind(TE).getOrNull()},getToolbar:function(t){return gE.getPart(t,e,"toolbar")},setToolbar:function(t,n){gE.getPart(t,e,"toolbar").each(function(t){Ak.setGroups(t,n)})},getMoreButton:function(t){return gE.getPart(t,e,"toolbar").bind(function(t){return Nk.getMoreButton(t)})},focusToolbar:function(t){gE.getPart(t,e,"toolbar").each(function(t){Yd.focusIn(t)})},setMenubar:function(t,n){gE.getPart(t,e,"menubar").each(function(t){hE.setMenus(t,n)})},focusMenubar:function(t){gE.getPart(t,e,"menubar").each(function(t){hE.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[rr("dom"),rr("behaviours")],partFields:[DE,_E,ME,FE],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=_(e,function(t){return zk(t)});t.setToolbar(n,o)},getMoreButton:function(t,n){return t.getMoreButton(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),VE=function(t){return t.fire("SkinLoaded")},RE=function(t){return t.fire("ResizeEditor")},HE=function(t){return t.fire("ResizeContent")},NE=function(t){var n=function(){t._skinLoaded=!0,VE(t)};return function(){t.initialized?n():t.on("init",n)}},PE=function(t,n){var e,o=function(t){var n=t.settings,e=n.skin,o=n.skin_url;if(!1!==e){var r=e||"oxide";o=o?t.documentBaseURI.toAbsolute(o):_h.baseURL+"/skins/ui/"+r}return o}(n);o&&(e=o+"/skin.min.css",n.contentCSS.push(o+(t?"/content.inline":"/content")+".min.css")),0==(!1===n.getParam("skin"))&&e?Dh.DOM.styleSheetLoader.load(e,NE(n)):NE(n)()},zE=v(PE,!1),LE=v(PE,!0),jE=Dh.DOM,UE=function(t){return function(n){var e=t.outerContainer;ae("*",e.element()).forEach(function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(mp)&&("readonly"===n.mode?mp.disable(t):mp.enable(t))})})}},WE={render:function(r,i,n,u,t){var e,o;zE(r),e=Xn.fromDom(t.targetNode),o=i.mothership,ys(e,o,he),bs(zr(),i.uiMothership),r.on("init",function(){IE.setToolbar(i.outerContainer,lE(r,n,{backstage:u},tt.none())),IE.setMenubar(i.outerContainer,oE(r,n)),IE.setSidebar(i.outerContainer,n.sidebar),r.readonly&&UE(i)({mode:"readonly"});var e=Tt($u(0,0)),o=r.contentWindow,t=function(){var t=e.get();if(t.left()!==o.innerWidth||t.top()!==o.innerHeight){var n=$u(o.innerWidth,o.innerHeight);e.set(n),HE(r)}};jE.bind(o,"resize",t),r.on("remove",function(){jE.unbind(o,"resize",t)})});var a=IE.getSocket(i.outerContainer).getOrDie("Could not find expected socket element");r.on("SwitchMode",UE(i)),r.getParam("readonly",!1,"boolean")&&r.setMode("readonly"),r.addCommand("ToggleSidebar",function(t,n){IE.toggleSidebar(i.outerContainer,n),r.fire("ToggleSidebar")}),r.addQueryValueHandler("ToggleSidebar",function(){return IE.whichSidebar(i.outerContainer)});var c=Hh(r);return c!==Eh.sliding&&c!==Eh.floating||r.on("ResizeContent",function(){IE.getToolbar(i.outerContainer).each(Nk.refresh)}),{iframeContainer:a.element().dom(),editorContainer:i.outerContainer.element().dom()}},getBehaviours:function(t){return[]}},GE=function(e,n){return de(e).orThunk(function(){var t=Xn.fromTag("span");pe(e,t);var n=de(t);return we(t),n}).map(function(t){return Zu(t).translate(-n.left(),-n.top())}).getOrThunk(function(){return $u(0,0)})},XE=gt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),YE=function(n){return function(t){return t.translate(-n.left(),-n.top())}},qE=function(n){return function(t){return t.translate(n.left(),n.top())}},KE=function(e){return function(t,n){return V(e,function(t,n){return n(t)},$u(t,n))}},JE=function(t,n,e){return t.fold(KE([qE(e),YE(n)]),KE([YE(n)]),KE([]))},$E=function(t,n,e){return t.fold(KE([qE(e)]),KE([]),KE([qE(n)]))},QE=function(t,n,e){return t.fold(KE([]),KE([YE(e)]),KE([qE(n),YE(e)]))},ZE=function(t,n,e){return t.fold(function(t,n){return{position:"absolute",left:t+"px",top:n+"px"}},function(t,n){return{position:"absolute",left:t-e.left()+"px",top:n-e.top()+"px"}},function(t,n){return{position:"fixed",left:t+"px",top:n+"px"}})},tT=XE.offset,nT=XE.absolute,eT=XE.fixed,oT=function(t,n){zi(t.element(),n.transitionClass),ji(t.element(),n.fadeOutClass),zi(t.element(),n.fadeInClass)},rT=function(t,n){zi(t.element(),n.transitionClass),ji(t.element(),n.fadeInClass),zi(t.element(),n.fadeOutClass)},iT=function(t,n){return t.y()>=n.y()&&t.bottom()<=n.bottom()},uT=function(t,n){return Fe(t,n)?tt.some(parseInt(Me(t,n),10)):tt.none()},aT=function(o,r,i){return(u=o,t=r,n=u.element(),uT(n,t.leftAttr).bind(function(o){return uT(n,t.topAttr).map(function(t){var n=ua(u.element()),e=sa(u.element());return ka(o,t,n,e)})})).bind(function(t){return iT(t,i)?(n=r,e=o.element(),Ie(e,n.leftAttr),Ie(e,n.topAttr),tt.some(nT(t.x(),t.y()))):tt.none();var n,e});var u,t,n},cT=function(t,n,e,o,r){var i=Zu(t.element()),u=ka(i.left(),i.top(),ua(t.element()),sa(t.element()));if(iT(u,e))return tt.none();a=t,c=n,s=i.left(),f=i.top(),l=a.element(),De(l,c.leftAttr,s),De(l,c.topAttr,f);var a,c,s,f,l,d=nT(i.left(),i.top()),m=JE(d,o,r),g=nT(e.x(),e.y()),p=JE(g,o,r),h=u.y()<=e.y()?p.top():p.top()+e.height()-u.height();return tt.some(eT(m.left(),h))},sT=function(i,t,n){var u=t.lazyViewport(i);t.contextual.each(function(r){r.lazyContext(i).each(function(t){var n,e,o=Oa(t);e=u,((n=o).y()<e.bottom()&&n.bottom()>e.y()?oT:rT)(i,r)})});var e,o,r,a,c,s=se(i.element()),f=na(s),l=GE(i.element(),f);(e=i,o=t,r=u,a=f,c=l,Zi(e.element(),"position").is("fixed")?aT(e,o,r):cT(e,o,r,a,c)).each(function(t){var n=ZE(t,0,l);Ji(i.element(),n)})},fT=/* */Object.freeze({refresh:sT}),lT=/* */Object.freeze({events:function(o,t){return Xr([Kr(Gt(),function(n,e){o.contextual.each(function(t){ce(n.element(),e.event().target())&&(ji(n.element(),t.transitionClass),e.stop())})}),Kr(In(),function(t,n){sT(t,o)})])}}),dT=[hr("contextual",[rr("fadeInClass"),rr("fadeOutClass"),rr("transitionClass"),rr("lazyContext")]),vr("lazyViewport",function(t){var n=na();return ka(n.left(),n.top(),h.window.innerWidth,h.window.innerHeight)}),rr("leftAttr"),rr("topAttr")],mT=ju({fields:dT,name:"docking",active:lT,apis:fT}),gT={render:function(e,n,o,r,t){var i,u=Dh.DOM,a=Ph(e),c=Hh(e),s=c===Eh.sliding||c===Eh.floating,f=c===Eh.floating;LE(e);var l=function(t){var n=s?t.fold(function(){return 0},function(t){return 1<t.components().length?sa(t.components()[1].element()):0}):0;Ji(i.element(),function(t){void 0===t&&(t=0);var n=Zu(Xn.fromDom(e.getBody()));return{top:Math.round(n.top()-sa(i.element()))+t+"px",left:Math.round(n.left())+"px"}}(n)),mT.refresh(i)},d=function(){var t=IE.getToolbar(n.outerContainer);s&&t.each(Nk.refresh),a||l(t)},m=function(){Ki(n.outerContainer.element(),"display","flex"),u.addClass(e.getBody(),"mce-edit-focus"),d(),f&&IE.getToolbar(n.outerContainer).each(function(t){Nk.getOverflow(t).each(function(t){ji(t.element(),"tox-toolbar__overflow--closed")})})},g=function(){n.outerContainer&&(Ki(n.outerContainer.element(),"display","none"),u.removeClass(e.getBody(),"mce-edit-focus"),f&&IE.getToolbar(n.outerContainer).each(function(t){Nk.getOverflow(t).each(function(t){zi(t.element(),"tox-toolbar__overflow--closed")})}))},p=function(){if(i)m();else{i=n.outerContainer;var t=Nh(e).getOr(zr());bs(t,n.mothership),bs(t,n.uiMothership),IE.setToolbar(n.outerContainer,lE(e,o,{backstage:r},tt.none())),IE.setMenubar(n.outerContainer,oE(e,o)),a||Ki(i.element(),"position","absolute"),d(),m(),e.on("nodeChange ResizeWindow",d),e.on("activate",m),e.on("deactivate",g),e.nodeChanged()}};return e.on("focus",p),e.on("blur hide",g),e.on("init",function(){e.hasFocus()&&p()}),{editorContainer:n.outerContainer.element().dom()}},getBehaviours:function(n){return Ph(n)?[]:[mT.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",contextual:{lazyContext:function(t){return tt.from(n).map(function(t){return Xn.fromDom(t.getBody())})},fadeInClass:"tox-toolbar-dock-fadein",fadeOutClass:"tox-toolbar-dock-fadeout",transitionClass:"tox-toolbar-dock-transition"}}),hm.config({})]}},pT=function(t,n){return{anchor:"makeshift",x:t,y:n}},hT=function(t,n){var e,o,r,i=Dh.DOM.getPos(t);return e=n,o=i.x,r=i.y,pT(e.x+o,e.y+r)},vT=function(t,n){return"contextmenu"===n.type?t.inline?pT((o=n).pageX,o.pageY):hT(t.getContentAreaContainer(),pT((e=n).clientX,e.clientY)):bT(t);var e,o},bT=function(t){return{anchor:"selection",root:Xn.fromDom(t.selection.getNode())}},yT=function(t){return"string"==typeof t?t.split(/[ ,]/):t},xT=function(t){return t.settings.contextmenu_never_use_native||!1},wT=function(t){return e="contextmenu",o="link image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,ut(n.settings,e).map(yT).getOrThunk(function(){return F(yT(o),function(t){return at(r,t)})});var n,e,o,r},ST=function(t){return w(t)?"|"===t:"separator"===t.type},CT={type:"separator"},kT=function(n){if(w(n))return n;switch(n.type){case"separator":return CT;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return w(t)?t:_(t,kT)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:(e=n.onAction,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e()})}}var e},OT=function(t,n){if(0===n.length)return t;var e=q(t).filter(function(t){return!ST(t)}).fold(function(){return[]},function(t){return[CT]});return t.concat(e).concat(n).concat([CT])},ET=function(d,t,m){var g=gu($m.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return d.focus()},fireDismissalEventInstead:{},inlineBehaviours:zu([Rm("dismissContextMenu",[Kr(Nn(),function(t,n){As.close(t),d.focus()})])])}));d.on("init",function(){d.on("contextmenu",function(n){if(t=d,!n.ctrlKey||xT(t)){var t,e,r,i,o,u=2!==n.button||n.target===d.getBody(),a=u?(e=d,{anchor:"node",node:tt.some(Xn.fromDom(e.selection.getNode())),root:Xn.fromDom(e.getBody())}):vT(d,n),c=d.ui.registry.getAll(),s=wT(d),f=u?d.selection.getStart(!0):n.target,l=(r=c.contextMenus,i=f,0<(o=V(s,function(t,n){if(at(r,n)){var e=r[n].update(i);if(w(e))return OT(t,e.split(" "));if(0<e.length){var o=_(e,kT);return OT(t,o)}return t}return t.concat([n])},[])).length&&ST(o[o.length-1])&&o.pop(),o);Lv(l,Sp.CLOSE_ON_EXECUTE,m.providers).map(function(t){n.preventDefault(),$m.showMenuAt(g,a,{menu:{markers:zp("normal")},data:t})})}})})},TT=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?tt.some(parseInt(t,10)):tt.none()},BT=function(t){return O(t)?t+"px":t},AT="data-initial-z-index",DT=function(t,n){var e;t.getSystem().addToGui(n),le((e=n).element()).each(function(n){Zi(n,"z-index").each(function(t){De(n,AT,t)}),Ki(n,"z-index",$i(e.element(),"z-index"))})},_T=function(t){le(t.element()).each(function(t){var n=Me(t,AT);Fe(t,AT)?Ki(t,"z-index",n):nu(t,"z-index"),Ie(t,AT)}),t.getSystem().removeFromGui(t)},MT=function(t,n,e,o){return(r=t,i=n,u=r.element(),a=parseInt(Me(u,i.leftAttr),10),c=parseInt(Me(u,i.topAttr),10),isNaN(a)||isNaN(c)?tt.none():tt.some($u(a,c))).fold(function(){return e},function(t){return eT(t.left()+o.left(),t.top()+o.top())});var r,i,u,a,c},FT=function(t,n,e,o,r,i){var u,a,c,s=MT(t,n,e,o),f=VT(t,n,s,r,i),l=JE(s,r,i);return u=n,a=l,c=t.element(),De(c,u.leftAttr,a.left()+"px"),De(c,u.topAttr,a.top()+"px"),f.fold(function(){return{coord:eT(l.left(),l.top()),extra:tt.none()}},function(t){return{coord:t.output(),extra:t.extra()}})},IT=function(t,n){var e,o;e=n,o=t.element(),Ie(o,e.leftAttr),Ie(o,e.topAttr)},VT=function(t,n,p,h,v){var e=n.getSnapPoints(t);return At(e,function(t){var n,e,o,r,i,u,a,c,s,f,l,d,m,g=t.sensor();return n=p,e=g,o=t.range().left(),r=t.range().top(),a=$E(n,i=h,u=v),c=$E(e,i,u),Math.abs(a.left()-c.left())<=o&&Math.abs(a.top()-c.top())<=r?tt.some({output:Z((s=t.output(),f=p,l=h,d=v,m=function(o,r){return function(t,n){var e=o(f,l,d);return r(t.getOr(e.left()),n.getOr(e.top()))}},s.fold(m(QE,XE.offset),m($E,XE.absolute),m(JE,XE.fixed)))),extra:t.extra}):tt.none()})},RT=function(e,t,i,u,a,c){return t.fold(function(){var t,e,o,n=(t=i,e=c.left(),o=c.top(),t.fold(function(t,n){return XE.offset(t+e,n+o)},function(t,n){return XE.absolute(t+e,n+o)},function(t,n){return XE.fixed(t+e,n+o)})),r=JE(n,u,a);return eT(r.left(),r.top())},function(n){var t=FT(e,n,i,c,u,a);return t.extra.each(function(t){n.onSensor(e,t)}),t.coord})},HT=function(t,n,e){var o,r=n.getTarget(t.element());if(n.repositionTarget){var i=se(t.element()),u=na(i),a=GE(r,u),c=Zi(o=r,"left").bind(function(e){return Zi(o,"top").bind(function(n){return Zi(o,"position").map(function(t){return("fixed"===t?eT:tT)(parseInt(e,10),parseInt(n,10))})})}).getOrThunk(function(){var t=Zu(o);return nT(t.left(),t.top())}),s=RT(t,n.snaps,c,u,a,e),f=ZE(s,0,a);Ji(r,f)}n.onDrag(t,r,e)},NT=hr("snaps",[rr("getSnapPoints"),Bu("onSensor"),rr("leftAttr"),rr("topAttr"),vr("lazyViewport",function(){var t=na();return{x:t.left,y:t.top,width:Z(h.window.innerWidth),height:Z(h.window.innerHeight),bottom:Z(t.top()+h.window.innerHeight),right:Z(t.left()+h.window.innerWidth)}})]),PT=/* */Object.freeze({getData:function(t){return tt.from($u(t.x(),t.y()))},getDelta:function(t,n){return $u(n.left()-t.left(),n.top()-t.top())}}),zT=[vr("useFixed",!1),rr("blockerClass"),vr("getTarget",d),vr("onDrag",Q),vr("repositionTarget",!0),Bu("onDrop"),NT,Mu("dragger",{handlers:function(a,c){return Xr([Kr(Ft(),function(n,t){if(0===t.event().raw().button){t.stop();var e,o={drop:function(){i()},delayDrop:function(){u.schedule()},forceDrop:function(){i()},move:function(t){u.cancel(),c.update(PT,t).each(function(t){HT(n,a,t)})}},r=n.getSystem().build(Bh.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[a.blockerClass]},events:(e=o,Xr([Kr(Ft(),e.forceDrop),Kr(Rt(),e.drop),Kr(It(),function(t,n){e.move(n.event())}),Kr(Vt(),e.delayDrop)]))})),i=function(){_T(r),a.snaps.each(function(t){IT(n,t)});var t=a.getTarget(n.element());a.onDrop(n,t)},u=fh(i,200);c.reset(),DT(n,r)}})])}})],LT=/* */Object.freeze({getData:function(t){var n,e=t.raw().touches;return 1===e.length?(n=e[0],tt.some($u(n.clientX,n.clientY))):tt.none()},getDelta:function(t,n){return $u(n.left()-t.left(),n.top()-t.top())}}),jT=zT,UT=[vr("useFixed",!1),vr("getTarget",d),vr("onDrag",Q),vr("repositionTarget",!0),vr("onDrop",Q),NT,Mu("dragger",{handlers:function(o,r){return Xr([ni(Dt()),Kr(_t(),function(n,t){t.stop(),r.update(LT,t.event()).each(function(t){HT(n,o,t)})}),Kr(Mt(),function(n,t){o.snaps.each(function(t){IT(n,t)});var e=o.getTarget(n.element());r.reset(),o.onDrop(n,e)})])}})],WT=/* */Object.freeze({mouse:jT,touch:UT}),GT=/* */Object.freeze({init:function(){var i=tt.none(),t=Z({});return Oi({readState:t,reset:function(){i=tt.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=tt.some(e),o;var n,e,o})}})}}),XT=Wu({branchKey:"mode",branches:WT,name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:Jn(["sensor","range","output"],["extra"])},state:GT});(UO=jO||(jO={}))[UO.None=0]="None",UO[UO.Both=1]="Both",UO[UO.Vertical=2]="Vertical";var YT,qT,KT,JT,$T,QT=function(t,n,e,o){var r=t+n,i=e.filter(function(t){return r<t}),u=o.filter(function(t){return t<r});return i.or(u).getOr(r)},ZT=function(t,n,e,o,r){var i,u,a={};return a.height=QT(o,n.top(),Fh(t),(i=t,tt.from(i.getParam("max_height")).filter(O))),e===jO.Both&&(a.width=QT(r,n.left(),Mh(t),(u=t,tt.from(u.getParam("max_width")).filter(O)))),a},tB=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},nB=function(i,u){return u.delimiter||(u.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:zu([Yd.config({mode:"flow",selector:"div[role=button]"}),ib.config({}),Qd.config({}),Rm("elementPathEvents",[oi(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Yd.focusIn(r)}),i.on("nodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!tB(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length&&Qd.set(r,(n=_(e||[],function(n,t){return Zm.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){i.focus(),i.selection.select(n.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+u.delimiter+" "}},V(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]])))})})])]),components:[]}},eB=function(s,t){var n,e,o,r,i,u,a,c,f,l,d,m=function(c){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:eg("resize-handle",t.icons)},behaviours:zu([XT.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){var o,r,i,u,a;o=s,r=e,i=c,u=Xn.fromDom(o.getContainer()),a=ZT(o,r,i,sa(u),ua(u)),nt(a,function(t,n){return Ki(u,n,BT(t))}),RE(o)},blockerClass:"tox-blocker"})])}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(d=[],s.getParam("elementpath",!0,"boolean")&&d.push(nB(s,{})),mn(s.settings.plugins,"wordcount")&&d.push((u=s,a=t,f=function(t,n,e){return Qd.set(t,[lu(a.translate(["{0} "+e,n[e]]))])},Zm.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:zu([ib.config({}),Qd.config({}),lm.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Rm("wordcount-events",[Kr(Wt(),function(t){var n=lm.getValue(t),e="words"===n.mode?"characters":"words";lm.setValue(t,{mode:e,count:n.count}),f(t,n.count,e)}),oi(function(e){u.on("wordCountUpdate",function(t){var n=lm.getValue(e).mode;lm.setValue(e,{mode:n,count:t.wordCount}),f(e,t.wordCount,n)})})])]),eventOrder:(c={},c[Wt()]=["wordcount-events","alloy.base.behaviour"],c)}))),s.getParam("branding",!0,"boolean")&&d.push((l='<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+Hg.translate(["Powered by {0}","Tiny"])+'">Tiny</a>',{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:Hg.translate(["Powered by {0}",l])}})),r=0<d.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:d}]:[],e=!mn((n=s).settings.plugins,"autoresize"),i=!1===(o=n.getParam("resize",e))?jO.None:"both"===o?jO.Both:jO.Vertical,i!==jO.None&&r.push(m(i)),r)}},oB=function(d){var t,n,e=d.getParam("inline",!1,"boolean"),m=e?gT:WE,o=tt.none(),r=Hg.isRtl()?{attributes:{dir:"rtl"}}:{},g=gu({dom:Je({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"]},r),behaviours:zu([fs.config({useFixed:!1})])}),i=tg({dom:{tag:"div",classes:["tox-anchorbar"]}}),p=ik(g,d,function(){return o.bind(function(t){return i.getOpt(t)}).getOrDie("Could not find a anchor bar element")},function(){return o.bind(function(t){return IE.getMoreButton(t)}).getOrDie("Could not find more button element")}),h=function(){return mt.value(g)},u=IE.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},getSink:h,providers:p.shared.providers,onEscape:function(){d.focus()}}),a=IE.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:h,backstage:p,onEscape:function(){d.focus()},split:Hh(d)}),c=IE.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),s=IE.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),f=d.getParam("statusbar",!0,"boolean")&&!e?tt.some(eB(d,p.shared.providers)):tt.none(),l={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[c,s]},v=(n=(t=d).getParam("toolbar"),(E(n)?0<n.length:!1!==t.getParam("toolbar",!0,"boolean"))||Ih(d).isSome()),b=!1!==d.getParam("menubar",!0,"boolean"),y=z([b?[u]:[],v?[a]:[],Ph(d)?[]:[i.asSpec()],e?[]:[l]]),x=z([[{dom:{tag:"div",classes:["tox-editor-container"]},components:y}],e?[]:f.toArray()]),w=Je({role:"application"},Hg.isRtl()?{dir:"rtl"}:{}),S=gu(IE.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(e?["tox-tinymce-inline"]:[]),styles:{visibility:"hidden"},attributes:w},components:x,behaviours:zu(m.getBehaviours(d).concat([Yd.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-sidebar--sliding-open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})]))}));o=tt.some(S),d.shortcuts.add("alt+F9","focus menubar",function(){IE.focusMenubar(S)}),d.shortcuts.add("alt+F10","focus toolbar",function(){IE.focusToolbar(S)});var C=Ah(S),k=Ah(g);mE(d,C,k);var O=function(t){var n,e=Dh.DOM,o=d.getParam("width",e.getStyle(t,"width")),r=(n=d).getParam("height",Math.max(n.getElement().offsetHeight,200)),i=Mh(d),u=Fh(d),a=TT(o).bind(function(n){return BT(i.map(function(t){return Math.max(n,t)}))}).getOr(BT(o)),c=TT(r).bind(function(n){return u.map(function(t){return Math.max(n,t)})}).getOr(r),s=BT(a);if(tu("div","width",s)&&Ki(S.element(),"width",s),!d.inline){var f=BT(c);tu("div","height",f)?Ki(S.element(),"height",f):Ki(S.element(),"height","200px")}return c};return{mothership:C,uiMothership:k,backstage:p,renderUI:function(){var o,r;ET(d,h,p.shared),r=(o=d).ui.registry.getAll().sidebars,M(J(r),function(n){var t=r[n],e=function(){return tt.from(o.queryCommandValue("ToggleSidebar")).is(n)};o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){var n=function(){return t.setActive(e())};return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})});var t=d.ui.registry.getAll(),n=t.buttons,e=t.menuItems,i=t.contextToolbars,u=t.sidebars,a={menuItems:e,buttons:n,menus:d.settings.menu?et(d.settings.menu,function(t){return bt(t,{items:t.items})}):{},menubar:d.settings.menubar,toolbar:Ih(d).getOr(d.getParam("toolbar",!0)),sidebar:u};dE(d,i,g,{backstage:p});var c=d.getElement(),s=O(c),f={mothership:C,uiMothership:k,outerContainer:S},l={targetNode:c,height:s};return m.render(d,f,a,p,l)},getUi:function(){return{channels:{broadcastAll:k.broadcast,broadcastOn:k.broadcastOn,register:function(){}}}}}},rB=function(o,r){return function(n){var e=Tt(tt.none()),t=function(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive).unbind;e.set(tt.some(t))};return o.initialized?t():o.on("init",t),function(){return e.get().each(function(t){return t()})}}},iB=function(n){PS.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:rB(n,t.name)})});var t="alignnone",e="No alignment",o="JustifyNone",r="align-none";n.ui.registry.addButton(t,{tooltip:e,onAction:function(){return n.execCommand(o)},icon:r})},uB=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},aB=function(t){var n,e;!function(n){PS.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:rB(n,t.name),onAction:uB(n,t.name)})});for(var t=1;t<=6;t++){var e="h"+t;n.ui.registry.addToggleButton(e,{text:e.toUpperCase(),tooltip:"Heading "+t,onSetup:rB(n,e),onAction:uB(n,e)})}}(t),n=t,PS.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),e=t,PS.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)},onSetup:rB(e,t.name)})})},cB=function(t){var n;aB(t),n=t,PS.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){n.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return n.execCommand(t.action)}})}),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:uB(n,"code")})},sB=function(t,n,e){var o=function(){return!!n.undoManager&&n.undoManager[e]()},r=function(){t.setDisabled(n.readonly||!o())};return t.setDisabled(!o()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return n.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},fB=function(t){var n,e;(n=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return sB(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return sB(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}}),(e=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return sB(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return sB(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}})},lB=function(t){var n,e;(n=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return n.execCommand("mceToggleVisualAid")}}),(e=t).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(n,t){n.setActive(t.hasVisual);var e=function(t){n.setActive(t.hasVisual)};return t.on("VisualAid",e),function(){return t.off("VisualAid",e)}}(t,e)},onAction:function(){e.execCommand("mceToggleVisualAid")}})},dB=function(t){var n;(n=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return function(t,n){t.setDisabled(!n.queryCommandState("outdent"));var e=function(){t.setDisabled(!n.queryCommandState("outdent"))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}(t,n)},onAction:function(){return n.execCommand("outdent")}}),n.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return n.execCommand("indent")}})},mB=function(t,n){var e,o,r,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w;o=n,r=XO(e=t),i=zO(0,o,r.dataset,r),e.ui.registry.addNestedMenuItem("align",{text:o.shared.providers.translate("Align"),getSubmenuItems:function(){return i.items.validateItems(i.getStyleItems())}}),a=n,c=qO(u=t),s=zO(0,a,c.dataset,c),u.ui.registry.addNestedMenuItem("fontformats",{text:a.shared.providers.translate("Fonts"),getSubmenuItems:function(){return s.items.validateItems(s.getStyleItems())}}),f=t,d=(l=n).styleselect,m=zO(0,l,d,ZO(f)),f.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return m.items.validateItems(m.getStyleItems())}}),p=n,h=QO(g=t),v=zO(0,p,h.dataset,h),g.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return v.items.validateItems(v.getStyleItems())}}),y=n,x=JO(b=t),w=zO(0,y,x.dataset,x),b.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return w.items.validateItems(w.getStyleItems())}})},gB=function(t,n){iB(t),cB(t),mB(t,n),fB(t),Gb.register(t),lB(t),dB(t)},pB=function(t,n){var e=tt.from(Me(t,"id")).fold(function(){var t=qe("dialog-label");return De(n,"id",t),t},d);De(t,"aria-labelledby",e)},hB=Z([rr("lazySink"),dr("dragBlockClass"),vr("useTabstopAt",Z(!0)),vr("eventOrder",{}),Vs("modalBehaviours",[Yd]),Au("onExecute"),_u("onEscape")]),vB={sketch:d},bB=Z([df({name:"draghandle",overrides:function(t,n){return{behaviours:zu([XT.config({mode:"mouse",getTarget:function(t){return hu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+Oo(n,null,2)).message)})])}}}),ff({schema:[rr("dom")],name:"title"}),ff({factory:vB,schema:[rr("dom")],name:"close"}),ff({factory:vB,schema:[rr("dom")],name:"body"}),ff({factory:vB,schema:[rr("dom")],name:"footer"}),lf({factory:{sketch:function(t,n){return Je({},t,{dom:n.dom,components:n.components})}},schema:[vr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),vr("components",[])],name:"blocker"})]),yB=Pf({name:"ModalDialog",configFields:hB(),partFields:bB(),factory:function(r,t,n,o){var a=qe("alloy.dialog.busy"),c=qe("alloy.dialog.idle"),s=zu([Yd.config({mode:"special",onTab:function(){return tt.some(!0)},onShiftTab:function(){return tt.some(!0)}}),hm.config({})]),e=qe("modal-events"),i=Je({},r.eventOrder,{"alloy.system.attached":[e].concat(r.eventOrder["alloy.system.attached"]||[])});return{uid:r.uid,dom:r.dom,components:t,apis:{show:function(i){var t=r.lazySink(i).getOrDie(),u=Tt(tt.none()),n=o.blocker(),e=t.getSystem().build(Je({},n,{components:n.components.concat([pu(i)]),behaviours:zu([Rm("dialog-blocker-events",[Kr(c,function(t,n){Fe(i.element(),"aria-busy")&&(Ie(i.element(),"aria-busy"),u.get().each(function(t){return Qd.remove(i,t)}))}),Kr(a,function(t,n){De(i.element(),"aria-busy","true");var e=n.event().getBusySpec();u.get().each(function(t){Qd.remove(i,t)});var o=e(i,s),r=t.getSystem().build(o);u.set(tt.some(r)),Qd.append(i,pu(r)),r.hasConfigured(Yd)&&Yd.focusIn(r)})])])}));ms(t,e),Yd.focusIn(i)},hide:function(n){le(n.element()).each(function(t){n.getSystem().getByDom(t).each(function(t){hs(t)})})},getBody:function(t){return Of(t,r,"body")},getFooter:function(t){return Of(t,r,"footer")},setIdle:function(t){Ar(t,c)},setBusy:function(t,n){Dr(t,a,{getBusySpec:n})}},eventOrder:i,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Hs(r.modalBehaviours,[Qd.config({}),Yd.config({mode:"cyclic",onEnter:r.onExecute,onEscape:r.onEscape,useTabstopAt:r.useTabstopAt}),Rm(e,[oi(function(t){var n,e,o;pB(t.element(),Of(t,r,"title").element()),n=t.element(),e=Of(t,r,"body").element(),o=tt.from(Me(n,"id")).fold(function(){var t=qe("dialog-describe");return De(e,"id",t),t},d),De(n,"aria-describedby",o)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),xB=[ur("type"),ur("text"),ar("level",["info","warn","error","success"]),ur("icon"),vr("url","")],wB=[ur("type"),ur("text"),Sr("primary",!1),zo("name","name",ro(function(){return qe("button-name")}),tr),gr("icon")],SB=[ur("type"),ur("name"),ur("label")],CB=nr,kB=[ur("type"),ur("name"),gr("label")],OB=kB,EB=tr,TB=kB,BB=tr,AB=kB,DB=Vo(Uo),_B=kB.concat([Sr("sandboxed",!0)]),MB=tr,FB=kB.concat([gr("placeholder")]),IB=tr,VB=kB.concat([fr("items",[ur("text"),ur("value")]),yr("size",1)]),RB=tr,HB=kB.concat([Sr("constrain",!0)]),NB=Io([ur("width"),ur("height")]),PB=kB.concat([gr("placeholder")]),zB=tr,LB=kB.concat([wr("filetype","file",["image","media","file"])]),jB=Io([ur("value"),vr("meta",{})]),UB=kB.concat([ur("type"),xr("tag","textarea"),cr("init")]),WB=tr,GB=[ur("type"),ur("html"),wr("presets","presentation",["presentation","document"])],XB=kB.concat([ir("currentState",Io([rr("blob"),ur("url")]))]),YB=kB.concat([vr("columns","auto")]),qB=(YT=[ur("value"),gr("text"),gr("icon")],No(YT)),KB=[ur("type"),lr("header",tr),lr("cells",Vo(tr))],JB=function(n){return zo("items","items",eo(),Vo(Wo(function(t){return Xo("Checking item of "+n,$B,t).fold(function(t){return mt.error(Ko(t))},function(t){return mt.value(t)})})))},$B=Jo("type",{alertbanner:xB,bar:($T=JB("bar"),[ur("type"),$T]),button:wB,checkbox:SB,colorinput:OB,colorpicker:TB,dropzone:AB,grid:(KT=JB("grid"),[ur("type"),(JT="columns",ir(JT,Zo)),KT]),iframe:_B,input:FB,selectbox:VB,sizeinput:HB,textarea:PB,urlinput:LB,customeditor:UB,htmlpanel:GB,imagetools:XB,collection:YB,label:(qT=JB("label"),[ur("type"),ur("label"),qT]),table:KB}),QB=[ur("type"),lr("items",$B)],ZB=[ur("title"),lr("items",$B)],tA=[ur("type"),fr("tabs",ZB)],nA=Io([ar("type",["submit","cancel","custom"]),zo("name","name",ro(function(){return qe("button-name")}),tr),ur("text"),gr("icon"),wr("align","end",["start","end"]),Sr("primary",!1),Sr("disabled",!1)]),eA=Io([ur("title"),ir("body",Jo("type",{panel:QB,tabpanel:tA})),xr("size","normal"),lr("buttons",nA),vr("initialData",{}),Cr("onAction",Q),Cr("onChange",Q),Cr("onSubmit",Q),Cr("onClose",Q),Cr("onCancel",Q),vr("onTabChange",Q)]),oA=function(t){return S(t)?[t].concat(L(it(t),oA)):E(t)?L(t,oA):[]},rA=function(t){return w(t.type)&&w(t.name)},iA={checkbox:CB,colorinput:EB,colorpicker:BB,dropzone:DB,input:IB,iframe:MB,sizeinput:NB,selectbox:RB,size:NB,textarea:zB,urlinput:jB,customeditor:WB,collection:qB},uA=function(t){var n=L(F(oA(t),rA),function(n){return(t=n,tt.from(iA[t.type])).fold(function(){return[]},function(t){return[ir(n.name,t)]});var t});return Io(n)},aA=function(t){return{internalDialog:Yo(Xo("dialog",eA,t)),dataValidator:uA(t),initialData:t.initialData}},cA={open:function(t,n){var e=aA(n);return t(e.internalDialog,e.initialData,e.dataValidator)},redial:function(t){return aA(t)}},sA=qe("update-dialog"),fA=qe("update-title"),lA=qe("update-body"),dA=qe("update-footer"),mA=function(t){var e=[],o={};return nt(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?mt.error(e):mt.value(o)},gA=Nf({name:"TabButton",configFields:[vr("uid",undefined),rr("value"),zo("dom","dom",io(function(t){return{attributes:{role:"tab",id:qe("aria"),"aria-selected":"false"}}}),$o()),dr("action"),vr("domModification",{}),Vs("tabButtonBehaviours",[hm,Yd,lm]),rr("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:Qm(t.action),behaviours:Hs(t.tabButtonBehaviours,[hm.config({}),Yd.config({mode:"execution",useSpace:!0,useEnter:!0}),lm.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),pA=Z([rr("tabs"),rr("dom"),vr("clickToDismiss",!1),Vs("tabbarBehaviours",[el,Yd]),Eu(["tabClass","selectedClass"])]),hA=mf({factory:gA,name:"tabs",unit:"tab",overrides:function(o,t){var r=function(t,n){el.dehighlight(t,n),Dr(t,jn(),{tabbar:t,button:n})},i=function(t,n){el.highlight(t,n),Dr(t,Ln(),{tabbar:t,button:n})};return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=el.isHighlighted(n,t);(e&&o.clickToDismiss?r:e?Q:i)(n,t)},domModification:{classes:[o.markers.tabClass]}}}}),vA=Z([hA]),bA=Pf({name:"Tabbar",configFields:pA(),partFields:vA(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Hs(t.tabbarBehaviours,[el.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){De(n.element(),"aria-selected","true")},onDehighlight:function(t,n){De(n.element(),"aria-selected","false")}}),Yd.config({mode:"flow",getInitial:function(t){return el.getHighlighted(t).map(function(t){return t.element()})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),yA=Nf({name:"Tabview",configFields:[Vs("tabviewBehaviours",[Qd])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:Hs(t.tabviewBehaviours,[Qd.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),xA=Z([vr("selectFirst",!0),Bu("onChangeTab"),Bu("onDismissTab"),vr("tabs",[]),Vs("tabSectionBehaviours",[])]),wA=ff({factory:bA,schema:[rr("dom"),sr("markers",[rr("tabClass"),rr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),SA=ff({factory:yA,name:"tabview"}),CA=Z([wA,SA]),kA=Pf({name:"TabSection",configFields:xA(),partFields:CA(),factory:function(i,t,n,e){var o=function(t,n){kf(t,i,"tabbar").each(function(t){n(t).each(_r)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:Rs(i.tabSectionBehaviours),events:Xr(z([i.selectFirst?[oi(function(t,n){o(t,el.getFirst)})]:[],[Kr(Ln(),function(t,n){var o,r,e=n.event().button();o=e,r=lm.getValue(o),kf(o,i,"tabview").each(function(e){R(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();De(e.element(),"aria-labelledby",Me(o.element(),"id")),Qd.set(e,n),i.onChangeTab(e,o,n)})})}),Kr(jn(),function(t,n){var e=n.event().button();i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return kf(t,i,"tabview").map(function(t){return Qd.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){var t=el.getCandidates(n);return R(t,function(t){return lm.getValue(t)===e}).filter(function(t){return!el.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),OA=function(t){return Y((n=t,e=function(t,n){return n<t?-1:t<n?1:0},(o=U.call(n,0)).sort(e),o));var n,e,o},EA=function(i,u,t){hu(i,'[role="dialog"]').each(function(r){t.get().map(function(t){return Ki(u,"height","0"),Math.min(t,(e=i,o=hu(n=r,".tox-dialog-wrap").getOr(n),("fixed"===$i(o,"position")?Math.max(h.document.documentElement.clientHeight,h.window.innerHeight):Math.max(h.document.documentElement.offsetHeight,h.document.documentElement.scrollHeight))-(n.dom().getBoundingClientRect().height-e.dom().getBoundingClientRect().height)));var n,e,o}).each(function(t){Ki(u,"height",t+"px")})})},TA=function(a){var c;return{smartTabHeight:(c=Tt(tt.none()),{extraEvents:[oi(function(t){vu(t.element(),'[role="tabpanel"]').each(function(u){var n;Ki(u,"visibility","hidden"),t.getSystem().getByDom(u).toOption().each(function(t){var o,r,i,n=(r=u,i=t,_(o=a,function(t,n){Qd.set(i,o[n].view());var e=r.dom().getBoundingClientRect();return Qd.set(i,[]),e.height})),e=OA(n);c.set(e)}),EA(t.element(),u,c),nu(u,"visibility"),n=t,Y(a).each(function(t){return kA.showTab(n,t.value)}),uk.requestAnimationFrame(function(){EA(t.element(),u,c)})})}),Kr(Vn(),function(n){vu(n.element(),'[role="tabpanel"]').each(function(t){EA(n.element(),t,c)})}),Kr(qh,function(r,t){vu(r.element(),'[role="tabpanel"]').each(function(n){var t=gl();Ki(n,"visibility","hidden");var e=Zi(n,"height").map(function(t){return parseInt(t,10)});nu(n,"height");var o=n.dom().getBoundingClientRect().height;e.forall(function(t){return t<o})?(c.set(tt.from(o)),EA(r.element(),n,c)):e.each(function(t){Ki(n,"height",t+"px")}),nu(n,"visibility"),t.each(ml)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},BA="send-data-to-section",AA="send-data-to-view",DA=function(t,n,d,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:Je({},n.map(function(t){return{id:t}}).getOr({}),e?{"aria-live":"polite"}:{})},components:[],behaviours:zu([ow(0),dO.config({channel:lA,updateState:function(t,n){return tt.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r={tabs:t.body.tabs},i=d,u=Tt({}),a=function(t){var n=lm.getValue(t),e=mA(n).getOr({}),o=u.get(),r=vt(o,e);u.set(r)},c=function(t){var n=u.get();lm.setValue(t,n)},s=Tt(null),f=_(r.tabs,function(t){return{value:t.title,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[Yx.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:_(t.items,function(t){return vC(n,t,i)}),formBehaviours:zu([Yd.config({mode:"acyclic",useTabstopAt:m(bw)}),Rm("TabView.form.events",[oi(c),ri(a)]),qu.config({channels:kt([{key:BA,value:{onReceive:a}},{key:AA,value:{onReceive:c}}])})])}})]}}}),l=TA(f).smartTabHeight,kA.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=lm.getValue(n);Dr(t,Yh,{title:o,oldTitle:s.get()}),s.set(o)},tabs:f,components:[kA.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[bA.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:zu([ib.config({})])}),kA.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:zu([Rm("tabpanel",l.extraEvents),Yd.config({mode:"acyclic"}),Uf.config({find:function(t){return Y(kA.getViewItems(t))}}),lm.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([BA],{}),u.get()},setValue:function(t,n){u.set(n),t.getSystem().broadcastOn([AA],{})}}})])}))];default:return[(e={items:t.body.items},o=d,n=tg(Yx.sketch(function(n){return{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:_(e.items,function(t){return vC(n,t,o)})}})),{dom:{tag:"div",classes:["tox-dialog__body"]},components:[n.asSpec()],behaviours:zu([Yd.config({mode:"acyclic",useTabstopAt:m(bw)}),ew(n),sw(n,{postprocess:function(t){return mA(t).fold(function(t){return console.error(t),{}},function(t){return t})}})])})]}var e,o,n,r,i,u,a,c,s,f,l},initialData:t})])}},_A=function(o,e){var t=function(t,r){return Kr(t,function(e,o){n(e,function(t,n){r(t,o.event(),e)})})},n=function(n,e){dO.getState(n).get().each(function(t){e(t.internalDialog,n)})};return[Zr(Nt(),yw),t(Wh,function(t){return t.onSubmit(o())}),t(zh,function(t,n){t.onChange(o(),{name:n.name()})}),t(Uh,function(t,n){t.onAction(o(),{name:n.name(),value:n.value()})}),t(Yh,function(t,n){t.onTabChange(o(),n.title())}),t(Lh,function(t){e.onClose(),t.onClose()}),t(jh,function(t,n,e){t.onCancel(o()),Ar(e,Lh)}),ri(function(t){var n=o();lm.setValue(t,n.getData())}),Kr(Xh,function(t,n){return e.onUnblock()}),Kr(Gh,function(t,n){return e.onBlock(n.event())})]},MA=function(t,n){var e=function(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r,t)?e:o).push(u)}return{pass:e,fail:o}}(n.map(function(t){return t.footerButtons}).getOr([]),function(t){return"start"===t.align}),o=function(t,n){return Bh.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:_(n,function(t){return t.memento.asSpec()})})};return[o("start",e.pass),o("end",e.fail)]},FA=function(t,i){return{dom:Rg('<div class="tox-dialog__footer"></div>'),components:[],behaviours:zu([dO.config({channel:dA,initialData:t,updateState:function(t,n){var r=_(n.buttons,function(t){var n,e,o=tg((e=i,xS(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return tt.some({lookupByName:function(t,n){return e=t,o=n,R(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:MA})])}},IA=function(t){return Zm.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){Ar(t,jh)}})},VA=function(t,n,e){var o=function(t){return[lu(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:Je({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:zu([dO.config({channel:fA,renderComponents:o})])}},RA=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=Uf.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Yx.getField(o,e).fold(function(){var t=n.getFooter();return dO.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return tt.some(t)})}return tt.none()},HA=function(c,o){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},s={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t;return lm.getValue(n)},setData:function(a){t(function(t){var n,e,o=s.getData(),r=bt(o,a),i=(n=r,e=c.getRoot(),dO.getState(e).get().map(function(t){return Yo(Xo("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();lm.setValue(u,i)})},disable:function(t){RA(c,t).each(mp.disable)},enable:function(t){RA(c,t).each(mp.enable)},focus:function(t){RA(c,t).each(hm.focus)},block:function(n){if(!w(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){Dr(t,Gh,{message:n})})},unblock:function(){t(function(t){Ar(t,Xh)})},showTab:function(e){t(function(t){var n=c.getBody();dO.getState(n).get().exists(function(t){return t.isTabPanel()})&&Uf.getCurrent(n).each(function(t){kA.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([sA],n),t.getSystem().broadcastOn([fA],n.internalDialog),t.getSystem().broadcastOn([lA],n.internalDialog),t.getSystem().broadcastOn([dA],n.internalDialog),s.setData(n.initialData)})},close:function(){t(function(t){Ar(t,Lh)})}};return s},NA=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m,g=(r={title:e.shared.providers.translate(t.internalDialog.title),draggable:!0},i=e.shared.providers,u=yB.parts().title(VA(r,tt.none(),i)),a=yB.parts().draghandle({dom:Rg('<div class="tox-dialog__draghandle"></div>')}),c=yB.parts().close(IA(i)),s=[u].concat(r.draggable?[a]:[]).concat([c]),Bh.sketch({dom:Rg('<div class="tox-dialog__header"></div>'),components:s})),p=(f={body:t.internalDialog.body},l=e,yB.parts().body(DA(f,tt.none(),l,!1))),h=(d={buttons:t.internalDialog.buttons},m=e.shared.providers,yB.parts().footer(FA(d,m))),v=_A(function(){return x},{onClose:function(){return n.closeWindow()},onBlock:function(e){yB.setBusy(y,function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:Rg('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){yB.setIdle(y)}}),b="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?"tox-dialog--width-lg":"tox-dialog--width-md":[],y=gu(yB.sketch({lazySink:e.shared.getSink,onEscape:function(t){return Ar(t,jh),tt.some(!0)},useTabstopAt:function(t){return!bw(t)&&("button"!==ke(t)||"disabled"!==Me(t,"disabled"))},modalBehaviours:zu([dO.config({channel:sA,updateState:function(t,n){return tt.some(n)},initialData:t}),hm.config({}),Rm("execute-on-form",v.concat([ei(Nt(),function(t,n){Yd.focusIn(t)})])),Rm("scroll-lock",[oi(function(){zi(zr(),"tox-dialog__disable-scroll")}),ri(function(){ji(zr(),"tox-dialog__disable-scroll")})]),dw({})]),eventOrder:(o={},o[En()]=["execute-on-form"],o[Rn()]=["scroll-lock","reflecting","execute-on-form","alloy.base.behaviour"],o[Hn()]=["alloy.base.behaviour","execute-on-form","reflecting","scroll-lock"],o),dom:{tag:"div",classes:["tox-dialog"].concat(b),styles:{position:"relative"}},components:[g,p,h],dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:Rg('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}})),x=HA({getRoot:function(){return y},getBody:function(){return yB.getBody(y)},getFooter:function(){return yB.getFooter(y)},getFormWrapper:function(){var t=yB.getBody(y);return Uf.getCurrent(t).getOr(t)}},n.redial);return{dialog:y,instanceApi:x}},PA=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p=qe("dialog-label"),h=qe("dialog-content"),v=tg((u={title:t.internalDialog.title,draggable:!0},a=p,c=e.shared.providers,Bh.sketch({dom:Rg('<div class="tox-dialog__header"></div>'),components:[VA(u,tt.some(a),c),IA(c)],containerBehaviours:zu([XT.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return bu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),b=tg((s={body:t.internalDialog.body},f=h,l=e,d=o,DA(s,tt.some(f),l,d))),y=tg((m={buttons:t.internalDialog.buttons},g=e.shared.providers,FA(m,g))),x=_A(function(){return S},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}}),w=gu({dom:{tag:"div",classes:["tox-dialog"],attributes:(r={role:"dialog"},r["aria-labelledby"]=p,r["aria-describedby"]=""+h,r)},eventOrder:(i={},i[On()]=[dO.name(),qu.name()],i[En()]=["execute-on-form"],i[Rn()]=["reflecting","execute-on-form"],i),behaviours:zu([Yd.config({mode:"cyclic",onEscape:function(t){return Ar(t,Lh),tt.some(!0)},useTabstopAt:function(t){return!bw(t)&&("button"!==ke(t)||"disabled"!==Me(t,"disabled"))}}),dO.config({channel:sA,updateState:function(t,n){return tt.some(n)},initialData:t}),Rm("execute-on-form",x),dw({})]),components:[v.asSpec(),b.asSpec(),y.asSpec()]}),S=HA({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return b.get(w)},getFormWrapper:function(){var t=b.get(w);return Uf.getCurrent(t).getOr(t)}},n.redial);return{dialog:w,instanceApi:S}},zA=function(t,n){return yB.parts().close(Zm.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:zu([ib.config({})])}))},LA=function(){return yB.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},jA=function(t,n){return yB.parts().body({dom:{tag:"div",classes:["tox-dialog__body","todo-tox-fit"]},components:[{dom:Rg("<p>"+n.translate(t)+"</p>")}]})},UA=function(t){return yB.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},WA=function(t,n){return[Bh.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Bh.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},GA=function(e){return yB.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),tt.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[{dom:{tag:"div",classes:["tox-dialog__header"]},components:[e.partSpecs.title,e.partSpecs.close]},e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:Rg('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:zu([Rm("basic-dialog-events",[Kr(jh,function(t,n){e.onCancel()}),Kr(Wh,function(t,n){e.onSubmit()})])])})},XA=function(s){var u,a,e=(u=s.backstage.shared,{open:function(t,n){var e=function(){yB.hide(r),n()},o=tg(xS({name:"close-alert",text:"OK",primary:!0,icon:tt.none()},"cancel",u.providers)),r=gu(GA({lazySink:function(){return u.getSink()},partSpecs:{title:LA(),close:zA(function(){e()},u.providers),body:jA(t,u.providers),footer:UA(WA([],[o.asSpec()]))},onCancel:function(){return e()},onSubmit:Q,extraClasses:["tox-alert-dialog"]}));yB.show(r);var i=o.get(r);hm.focus(i)}}),o=(a=s.backstage.shared,{open:function(t,n){var e=function(t){yB.hide(i),n(t)},o=tg(xS({name:"yes",text:"Yes",primary:!0,icon:tt.none()},"submit",a.providers)),r=xS({name:"no",text:"No",primary:!0,icon:tt.none()},"cancel",a.providers),i=gu(GA({lazySink:function(){return a.getSink()},partSpecs:{title:LA(),close:zA(function(){e(!1)},a.providers),body:jA(t,a.providers),footer:UA(WA([],[r,o.asSpec()]))},onCancel:function(){return e(!1)},onSubmit:function(){return e(!0)},extraClasses:["tox-confirm-dialog"]}));yB.show(i);var u=o.get(i);hm.focus(u)}}),r=function(t,i){return cA.open(function(t,n,e){var o=n,r=NA({dataValidator:e,initialData:o,internalDialog:t},{redial:cA.redial,closeWindow:function(){yB.hide(r.dialog),i(r.instanceApi)}},s.backstage);return yB.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},i=function(t,u,a,c){return cA.open(function(t,n,e){var o=Yo(Xo("data",e,n)),r=PA({dataValidator:e,initialData:o,internalDialog:t},{redial:cA.redial,closeWindow:function(){$m.hide(i),a(r.instanceApi)}},s.backstage,c),i=gu($m.sketch({lazySink:s.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:zu([Rm("window-manager-inline-events",[Kr(Nn(),function(t,n){Ar(r.dialog,jh)})])])}));return $m.showAt(i,u,pu(r.dialog)),r.instanceApi.setData(o),Yd.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?i(t,s.backstage.shared.anchors.toolbar(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?i(t,s.backstage.shared.anchors.cursor(),e,n.ariaAttrs):r(t,e)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};Ke.add("silver",function(t){var n=oB(t),e=n.mothership,o=n.uiMothership,r=n.backstage,i=n.renderUI,u=n.getUi;gB(t,r),Ge(qe("silver-demo"),e),Ge(qe("silver-ui-demo"),o),eh(t,r.shared);var a=XA({backstage:r});return{renderUI:i,getWindowManagerImpl:Z(a),getNotificationManagerImpl:function(){return ig(t,{backstage:r},o)},ui:u()}}),function CD(){}}(window);
@@ -1,2 +1,9 @@
1
- // 4.7.13 (2018-05-16)
2
- !function(){"use strict";var e,t,n,r,o,i,a,u,s,c,l,f,d,m,p,g,h,v=function(e){return function(){return e}},y=v(!1),b=v(!0),V={noop:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},noarg:function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n()}},compose:function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},constant:v,identity:function(e){return e},tripleEquals:function(e,t){return e===t},curry:function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},not:function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},die:function(e){return function(){throw new Error(e)}},apply:function(e){return e()},call:function(e){e()},never:y,always:b},C=V.never,x=V.always,w=function(){return N},N=(r={fold:function(e,t){return e()},is:C,isSome:C,isNone:x,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},or:n,orThunk:t,map:w,ap:w,each:function(){},bind:w,flatten:w,exists:C,forall:x,filter:w,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:V.constant("none()")},Object.freeze&&Object.freeze(r),r),E=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:x,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,or:t,orThunk:t,map:function(e){return E(e(n))},ap:function(e){return e.fold(w,function(e){return E(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:N},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(C,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:E,none:w,from:function(e){return null===e||e===undefined?N:E(e)}},S=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},k={isString:S("string"),isObject:S("object"),isArray:S("array"),isNull:S("null"),isBoolean:S("boolean"),isUndefined:S("undefined"),isFunction:S("function"),isNumber:S("number")},T=(o=Array.prototype.indexOf)===undefined?function(e,t){return L(e,t)}:function(e,t){return o.call(e,t)},R=function(e,t){return-1<T(e,t)},_=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},B=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},D=function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)},O=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},L=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},I=Array.prototype.push,M=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);I.apply(t,e[n])}return t},F=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},z=Array.prototype.slice,U=k.isFunction(Array.from)?Array.from:function(e){return z.call(e)},H={map:_,each:B,eachr:D,partition:function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},filter:O,groupBy:function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],s=t(u);s!==n&&(r.push(o),o=[]),n=s,o.push(u)}return 0!==o.length&&r.push(o),r},indexOf:function(e,t){var n=T(e,t);return-1===n?A.none():A.some(n)},foldr:function(e,t,n){return D(e,function(e){n=t(n,e)}),n},foldl:function(e,t,n){return B(e,function(e){n=t(n,e)}),n},find:function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},findIndex:P,flatten:M,bind:function(e,t){var n=_(e,t);return M(n)},forall:F,exists:function(e,t){return P(e,t).isSome()},contains:R,equal:function(e,n){return e.length===n.length&&F(e,function(e,t){return e===n[t]})},reverse:function(e){var t=z.call(e,0);return t.reverse(),t},chunk:function(e,t){for(var n=[],r=0;r<e.length;r+=t){var o=e.slice(r,r+t);n.push(o)}return n},difference:function(e,t){return O(e,function(e){return!R(t,e)})},mapToObject:function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n},pure:function(e){return[e]},sort:function(e,t){var n=z.call(e,0);return n.sort(t),n},range:function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},head:function(e){return 0===e.length?A.none():A.some(e[0])},last:function(e){return 0===e.length?A.none():A.some(e[e.length-1])},from:U},q="undefined"!=typeof window?window:Function("return this;")(),j=function(e,t){for(var n=t!==undefined&&null!==t?t:q,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n},$=function(e,t){var n=e.split(".");return j(n,t)},W={getOrDie:function(e,t){var n=$(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},K=function(){return W.getOrDie("URL")},X={createObjectURL:function(e){return K().createObjectURL(e)},revokeObjectURL:function(e){K().revokeObjectURL(e)}},Y=navigator,G=Y.userAgent,J=function(e){return"matchMedia"in window&&matchMedia(e).matches};d=/Android/.test(G),a=(a=!(i=/WebKit/.test(G))&&/MSIE/gi.test(G)&&/Explorer/gi.test(Y.appName))&&/MSIE (\w+)\./.exec(G)[1],u=-1!==G.indexOf("Trident/")&&(-1!==G.indexOf("rv:")||-1!==Y.appName.indexOf("Netscape"))&&11,s=-1!==G.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(G),l=-1!==G.indexOf("Mac"),f=/(iPad|iPhone)/.test(G),m="FormData"in window&&"FileReader"in window&&"URL"in window&&!!X.createObjectURL,p=J("only screen and (max-device-width: 480px)")&&(d||f),g=J("only screen and (min-width: 800px)")&&(d||f),h=-1!==G.indexOf("Windows Phone"),s&&(i=!1);var Q,Z,ee,te,ne,re,oe,ie,ae,ue,se,ce,le,fe,de,me,pe,ge,he,ve={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:d,contentEditable:!f||m||534<=parseInt(G.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:window.getSelection&&"Range"in window,documentMode:a&&!s?document.documentMode||7:10,fileApi:m,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!p&&!g,windowsPhone:h},ye=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),be=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},Ce=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},xe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=be(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},we={requestAnimationFrame:function(e,t){Q?Q.then(e):Q=new ye(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:be,setInterval:Ce,setEditorTimeout:function(e,t,n){return be(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=Ce(function(){e.removed?clearInterval(r):t()},n)},debounce:xe,throttle:xe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ne=/^(?:mouse|contextmenu)|click/,Ee={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Se=function(){return!1},ke=function(){return!0},Te=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ae=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Re=function(e,t){var n,r,o,i,a,u,s=t||{};for(n in e)Ee[n]||(s[n]=e[n]);if(s.target||(s.target=s.srcElement||document),ve.experimentalShadowDom&&(s.target=(r=e,o=s.target,a=o,(i=r.path)&&0<i.length&&(a=i[0]),r.composedPath&&(i=r.composedPath())&&0<i.length&&(a=i[0]),a)),e&&Ne.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var c=s.target.ownerDocument||document,l=c.documentElement,f=c.body;s.pageX=e.clientX+(l&&l.scrollLeft||f&&f.scrollLeft||0)-(l&&l.clientLeft||f&&f.clientLeft||0),s.pageY=e.clientY+(l&&l.scrollTop||f&&f.scrollTop||0)-(l&&l.clientTop||f&&f.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=ke,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=ke,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=ke,s.stopPropagation()})==((u=s).isDefaultPrevented===ke||u.isDefaultPrevented===Se)&&(s.isDefaultPrevented=Se,s.isPropagationStopped=Se,s.isImmediatePropagationStopped=Se),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s},_e=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ae(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void we.setTimeout(s)}a()};!r.addEventListener||ve.ie&&ve.ie<11?(Te(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():Te(e,"DOMContentLoaded",a),Te(e,"load",a)}},Be=function(){var m,p,g,h,v,y=this,b={};p="mce-data-"+(+new Date).toString(32),h="onmouseenter"in document.documentElement,g="onfocusin"in document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,y.domLoaded=!1,y.events=b;var C=function(e,t){var n,r,o,i,a=b[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};y.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=window,d=function(e){C(Re(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[p]?o=e[p]:(o=m++,e[p]=o,b[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),y.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Re({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Re(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),g||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Re(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=b[o][u])?"ready"===u&&y.domLoaded?n({type:u}):i.push({func:n,scope:r}):(b[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?_e(e,c,y):Te(e,s||u,c,l)));return e=i=0,n}},y.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return y;if(r=e[p]){if(s=b[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],Ae(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ae(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return y;delete b[r];try{delete e[p]}catch(d){e[p]=null}}return y},y.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return y;for((n=Re(null,n)).type=t,n.target=e;(r=e[p])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return y},y.clean=function(e){var t,n,r=y.unbind;if(!e||3===e.nodeType||8===e.nodeType)return y;if(e[p]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[p]&&r(e);return y},y.destroy=function(){b={}},y.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};Be.Event=new Be,Be.Event.bind(window,"ready",function(){});var De="sizzle"+-new Date,Oe=window.document,Pe=0,Le=0,Ie=pt(),Me=pt(),Fe=pt(),ze=function(e,t){return e===t&&(ce=!0),0},Ue=typeof undefined,qe={}.hasOwnProperty,Ve=[],He=Ve.pop,je=Ve.push,$e=Ve.push,We=Ve.slice,Ke=Ve.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},Xe="[\\x20\\t\\r\\n\\f]",Ye="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Ge="\\["+Xe+"*("+Ye+")(?:"+Xe+"*([*^$|!~]?=)"+Xe+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Ye+"))|)"+Xe+"*\\]",Je=":("+Ye+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Ge+")*)|.*)\\)|)",Qe=new RegExp("^"+Xe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Xe+"+$","g"),Ze=new RegExp("^"+Xe+"*,"+Xe+"*"),et=new RegExp("^"+Xe+"*([>+~]|"+Xe+")"+Xe+"*"),tt=new RegExp("="+Xe+"*([^\\]'\"]*?)"+Xe+"*\\]","g"),nt=new RegExp(Je),rt=new RegExp("^"+Ye+"$"),ot={ID:new RegExp("^#("+Ye+")"),CLASS:new RegExp("^\\.("+Ye+")"),TAG:new RegExp("^("+Ye+"|[*])"),ATTR:new RegExp("^"+Ge),PSEUDO:new RegExp("^"+Je),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Xe+"*(even|odd|(([+-]|)(\\d*)n|)"+Xe+"*(?:([+-]|)"+Xe+"*(\\d+)|))"+Xe+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Xe+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Xe+"*((?:-\\d)?\\d*)"+Xe+"*\\)|)(?=[^-]|$)","i")},it=/^(?:input|select|textarea|button)$/i,at=/^h\d$/i,ut=/^[^{]+\{\s*\[native \w/,st=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ct=/[+~]/,lt=/'|\\/g,ft=new RegExp("\\\\([\\da-f]{1,6}"+Xe+"?|("+Xe+")|.)","ig"),dt=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{$e.apply(Ve=We.call(Oe.childNodes),Oe.childNodes),Ve[Oe.childNodes.length].nodeType}catch(Dw){$e={apply:Ve.length?function(e,t){je.apply(e,We.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var mt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:Oe)!==fe&&le(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||fe).nodeType)&&9!==u)return[];if(me&&!r){if(o=st.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&he(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return $e.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ee.getElementsByClassName)return $e.apply(n,t.getElementsByClassName(a)),n}if(ee.qsa&&(!pe||!pe.test(e))){if(f=l=De,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=oe(e),(l=t.getAttribute("id"))?f=l.replace(lt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+wt(c[s]);d=ct.test(e)&&Ct(t.parentNode)||t,m=c.join(",")}if(m)try{return $e.apply(n,d.querySelectorAll(m)),n}catch(p){}finally{l||t.removeAttribute("id")}}}return ae(e.replace(Qe,"$1"),t,n,r)};function pt(){var r=[];return function e(t,n){return r.push(t+" ")>te.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function gt(e){return e[De]=!0,e}function ht(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function vt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function yt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function bt(a){return gt(function(i){return i=+i,gt(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ct(e){return e&&typeof e.getElementsByTagName!==Ue&&e}for(Z in ee=mt.support={},re=mt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},le=mt.setDocument=function(e){var t,s=e?e.ownerDocument||e:Oe,n=s.defaultView;return s!==fe&&9===s.nodeType&&s.documentElement?(de=(fe=s).documentElement,me=!re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){le()},!1):n.attachEvent&&n.attachEvent("onunload",function(){le()})),ee.attributes=!0,ee.getElementsByTagName=!0,ee.getElementsByClassName=ut.test(s.getElementsByClassName),ee.getById=!0,te.find.ID=function(e,t){if(typeof t.getElementById!==Ue&&me){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},te.filter.ID=function(e){var t=e.replace(ft,dt);return function(e){return e.getAttribute("id")===t}},te.find.TAG=ee.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ue)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},te.find.CLASS=ee.getElementsByClassName&&function(e,t){if(me)return t.getElementsByClassName(e)},ge=[],pe=[],ee.disconnectedMatch=!0,pe=pe.length&&new RegExp(pe.join("|")),ge=ge.length&&new RegExp(ge.join("|")),t=ut.test(de.compareDocumentPosition),he=t||ut.test(de.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},ze=t?function(e,t){if(e===t)return ce=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ee.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===Oe&&he(Oe,e)?-1:t===s||t.ownerDocument===Oe&&he(Oe,t)?1:se?Ke.call(se,e)-Ke.call(se,t):0:4&n?-1:1)}:function(e,t){if(e===t)return ce=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:se?Ke.call(se,e)-Ke.call(se,t):0;if(o===i)return ht(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?ht(a[r],u[r]):a[r]===Oe?-1:u[r]===Oe?1:0},s):fe},mt.matches=function(e,t){return mt(e,null,null,t)},mt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==fe&&le(e),t=t.replace(tt,"='$1']"),ee.matchesSelector&&me&&(!ge||!ge.test(t))&&(!pe||!pe.test(t)))try{var n=(void 0).call(e,t);if(n||ee.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(Dw){}return 0<mt(t,fe,null,[e]).length},mt.contains=function(e,t){return(e.ownerDocument||e)!==fe&&le(e),he(e,t)},mt.attr=function(e,t){(e.ownerDocument||e)!==fe&&le(e);var n=te.attrHandle[t.toLowerCase()],r=n&&qe.call(te.attrHandle,t.toLowerCase())?n(e,t,!me):undefined;return r!==undefined?r:ee.attributes||!me?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},mt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},mt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(ce=!ee.detectDuplicates,se=!ee.sortStable&&e.slice(0),e.sort(ze),ce){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return se=null,e},ne=mt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=ne(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=ne(t);return n},(te=mt.selectors={cacheLength:50,createPseudo:gt,match:ot,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ft,dt),e[3]=(e[3]||e[4]||e[5]||"").replace(ft,dt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||mt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&mt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ot.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&nt.test(n)&&(t=oe(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ft,dt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ie[e+" "];return t||(t=new RegExp("(^|"+Xe+")"+e+"("+Xe+"|$)"))&&Ie(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ue&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=mt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,p,g){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),y="of-type"===e;return 1===p&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=y&&e.nodeName.toLowerCase(),d=!n&&!y;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(y?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[De]||(l[De]={}))[m]||[])[0]===Pe&&r[1],a=r[0]===Pe&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Pe,u,a];break}}else if(d&&(r=(e[De]||(e[De]={}))[m])&&r[0]===Pe)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((y?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[De]||(i[De]={}))[m]=[Pe,a]),i!==e)););return(a-=g)===p||a%p==0&&0<=a/p}}},PSEUDO:function(e,i){var t,a=te.pseudos[e]||te.setFilters[e.toLowerCase()]||mt.error("unsupported pseudo: "+e);return a[De]?a(i):1<a.length?(t=[e,e,"",i],te.setFilters.hasOwnProperty(e.toLowerCase())?gt(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=Ke.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:gt(function(e){var r=[],o=[],u=ie(e.replace(Qe,"$1"));return u[De]?gt(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:gt(function(t){return function(e){return 0<mt(t,e).length}}),contains:gt(function(t){return t=t.replace(ft,dt),function(e){return-1<(e.textContent||e.innerText||ne(e)).indexOf(t)}}),lang:gt(function(n){return rt.test(n||"")||mt.error("unsupported lang: "+n),n=n.replace(ft,dt).toLowerCase(),function(e){var t;do{if(t=me?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===de},focus:function(e){return e===fe.activeElement&&(!fe.hasFocus||fe.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!te.pseudos.empty(e)},header:function(e){return at.test(e.nodeName)},input:function(e){return it.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:bt(function(){return[0]}),last:bt(function(e,t){return[t-1]}),eq:bt(function(e,t,n){return[n<0?n+t:n]}),even:bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=te.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})te.pseudos[Z]=vt(Z);for(Z in{submit:!0,reset:!0})te.pseudos[Z]=yt(Z);function xt(){}function wt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Nt(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Le++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Pe,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[De]||(e[De]={}))[u])&&r[0]===Pe&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Et(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function St(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function kt(m,p,g,h,v,e){return h&&!h[De]&&(h=kt(h)),v&&!v[De]&&(v=kt(v,e)),gt(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)mt(e,t[r],n);return n}(p||"*",n.nodeType?[n]:n,[]),f=!m||!e&&p?l:St(l,u,m,n,r),d=g?v||(e?m:c||h)?[]:t:f;if(g&&g(f,d,n,r),h)for(o=St(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?Ke.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=St(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):$e.apply(t,d)})}function Tt(e){for(var r,t,n,o=e.length,i=te.relative[e[0].type],a=i||te.relative[" "],u=i?1:0,s=Nt(function(e){return e===r},a,!0),c=Nt(function(e){return-1<Ke.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==ue)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=te.relative[e[u].type])l=[Nt(Et(l),t)];else{if((t=te.filter[e[u].type].apply(null,e[u].matches))[De]){for(n=++u;n<o&&!te.relative[e[n].type];n++);return kt(1<u&&Et(l),1<u&&wt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(Qe,"$1"),t,u<n&&Tt(e.slice(u,n)),n<o&&Tt(e=e.slice(n)),n<o&&wt(e))}l.push(t)}return Et(l)}xt.prototype=te.filters=te.pseudos,te.setFilters=new xt,oe=mt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Me[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=te.preFilter;a;){for(i in n&&!(r=Ze.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=et.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Qe," ")}),a=a.slice(n.length)),te.filter)!(r=ot[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?mt.error(e):Me(e,u).slice(0)},ie=mt.compile=function(e,t){var n,h,v,y,b,r,o=[],i=[],a=Fe[e+" "];if(!a){for(t||(t=oe(e)),n=t.length;n--;)(a=Tt(t[n]))[De]?o.push(a):i.push(a);(a=Fe(e,(h=i,y=0<(v=o).length,b=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=ue,m=e||b&&te.find.TAG("*",o),p=Pe+=null==d?1:Math.random()||.1,g=m.length;for(o&&(ue=t!==fe&&t);c!==g&&null!=(i=m[c]);c++){if(b&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Pe=p)}y&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,y&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=He.call(r));f=St(f)}$e.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&mt.uniqueSort(r)}return o&&(Pe=p,ue=d),l},y?gt(r):r))).selector=e}return a},ae=mt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&oe(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&ee.getById&&9===t.nodeType&&me&&te.relative[i[1].type]){if(!(t=(te.find.ID(a.matches[0].replace(ft,dt),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ot.needsContext.test(e)?0:i.length;o--&&(a=i[o],!te.relative[u=a.type]);)if((s=te.find[u])&&(r=s(a.matches[0].replace(ft,dt),ct.test(i[0].type)&&Ct(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&wt(i)))return $e.apply(n,r),n;break}}return(c||ie(e,l))(r,t,!me,n,ct.test(e)&&Ct(t.parentNode)||t),n},ee.sortStable=De.split("").sort(ze).join("")===De,ee.detectDuplicates=!!ce,le(),ee.sortDetached=!0;var At=Array.isArray,Rt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},_t=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},Bt={isArray:At,toArray:function(e){var t,n,r=e;if(!At(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:Rt,map:function(n,r){var o=[];return Rt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return Rt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:_t,find:function(e,t,n){var r=_t(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},Dt=/^\s*|\s*$/g,Ot=function(e){return null===e||e===undefined?"":(""+e).replace(Dt,"")},Pt=function(e,t){return t?!("array"!==t||!Bt.isArray(e))||typeof e===t:e!==undefined},Lt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),Bt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Lt(e,n,r,o)}))},It={trim:Ot,isArray:Bt.isArray,is:Pt,toArray:Bt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:Bt.each,map:Bt.map,grep:Bt.filter,inArray:Bt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Lt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Pt(e,"array")?e:Bt.map(e.split(t||","),Ot)},_addCacheSuffix:function(e){var t=ve.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Mt=document,Ft=Array.prototype.push,zt=Array.prototype.slice,Ut=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,qt=Be.Event,Vt=It.makeMap("children,contents,next,prev"),Ht=function(e){return void 0!==e},jt=function(e){return"string"==typeof e},$t=function(e,t){var n,r,o;for(o=(t=t||Mt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},Wt=function(e,t,n,r){var o;if(jt(t))t=$t(t,un(e[0]));else if(t.length&&!t.nodeType){if(t=tn.makeArray(t),r)for(o=t.length-1;0<=o;o--)Wt(e,t[o],n,r);else for(o=0;o<t.length;o++)Wt(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},Kt=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},Xt=function(e,t,n){var r,o;return t=tn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},Yt=It.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Gt=It.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Jt={"for":"htmlFor","class":"className",readonly:"readOnly"},Qt={"float":"cssFloat"},Zt={},en={},tn=function(e,t){return new tn.fn.init(e,t)},nn=/^\s*|\s*$/g,rn=function(e){return null===e||e===undefined?"":(""+e).replace(nn,"")},on=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},an=function(e,n){var r=[];return on(e,function(e,t){n(t,e)&&r.push(t)}),r},un=function(e){return e?9===e.nodeType?e:e.ownerDocument:Mt};tn.fn=tn.prototype={constructor:tn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return tn(e).attr(t);o.context=t=document}if(jt(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Ut.exec(e)))return tn(t).find(e);if(n[1])for(r=$t(e,un(t)).firstChild;r;)Ft.call(o,r),r=r.nextSibling;else{if(!(r=un(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return It.toArray(this)},add:function(e,t){var n,r,o=this;if(jt(e))return o.add(tn(e));if(!1!==t)for(n=tn.unique(o.toArray().concat(tn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Ft.apply(o,tn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)on(t,function(e,t){r.attr(e,t)});else{if(!Ht(n)){if(r[0]&&1===r[0].nodeType){if((e=Zt[t])&&e.get)return e.get(r[0],t);if(Gt[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=Zt[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Jt[e]||e))on(e,function(e,t){n.prop(e,t)});else{if(!Ht(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)on(n,function(e,t){i.css(e,t)});else if(Ht(r))n=t(n),"number"!=typeof r||Yt[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=en[n])&&o.set)o.set(this,r);else{try{this.style[Qt[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=en[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],qt.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(Ht(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){tn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(Ht(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return Wt(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return Wt(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?Wt(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?Wt(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return tn(e).append(this),this},prependTo:function(e){return tn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Xt(this,e)},wrapAll:function(e){return Xt(this,e,!0)},wrapInner:function(e){return this.each(function(){tn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){tn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),tn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?on(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=Kt(t,o))!==i&&(n=t.className,r?t.className=rn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return Kt(this[0],e)},each:function(e){return on(this,e)},on:function(e,t){return this.each(function(){qt.bind(this,e,t)})},off:function(e,t){return this.each(function(){qt.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?qt.fire(this,e.type,e):qt.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new tn(zt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)tn.find(e,this[t],r);return tn(r)},filter:function(n){return tn("function"==typeof n?an(this.toArray(),function(e,t){return n(t,e)}):tn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof tn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&tn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),tn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Ft,sort:[].sort,splice:[].splice},It.extend(tn,{extend:It.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:It.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:It.isArray,each:on,trim:rn,grep:an,find:mt,expr:mt.selectors,unique:mt.uniqueSort,text:mt.getText,contains:mt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?tn.find.matchesSelector(t[0],e)?[t[0]]:[]:tn.find.matches(e,t)}});var sn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof tn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&tn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},cn=function(e,t,n,r){var o=[];for(r instanceof tn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&tn(e).is(r))break}o.push(e)}return o},ln=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};on({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return sn(e,"parentNode")},next:function(e){return ln(e,"nextSibling",1)},prev:function(e){return ln(e,"previousSibling",1)},children:function(e){return cn(e.firstChild,"nextSibling",1)},contents:function(e){return It.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){tn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(tn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(Vt[e]||(n=tn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=tn(n),t?n.filter(t):n}}),on({parentsUntil:function(e,t){return sn(e,"parentNode",t)},nextUntil:function(e,t){return cn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return cn(e,"previousSibling",1,t).slice(1)}},function(r,o){tn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(tn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=tn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=tn(n),e?n.filter(e):n}}),tn.fn.is=function(e){return!!e&&0<this.filter(e).length},tn.fn.init.prototype=tn.fn,tn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return tn.extend(o,this),o};var fn=function(n,r,e){on(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};ve.ie&&ve.ie<8&&(fn(Zt,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),fn(Zt,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),ve.ie&&ve.ie<9&&(Qt["float"]="styleFloat",fn(en,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),tn.attrHooks=Zt,tn.cssHooks=en;var dn,mn=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(null,arguments)),t}},pn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return hn(r(1),r(2))},gn=function(){return hn(0,0)},hn=function(e,t){return{major:e,minor:t}},vn={nu:hn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?gn():pn(e,n)},unknown:gn},yn="Firefox",bn=function(e,t){return function(){return t===e}},Cn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:bn("Edge",t),isChrome:bn("Chrome",t),isIE:bn("IE",t),isOpera:bn("Opera",t),isFirefox:bn(yn,t),isSafari:bn("Safari",t)}},xn={unknown:function(){return Cn({current:undefined,version:vn.unknown()})},nu:Cn,edge:V.constant("Edge"),chrome:V.constant("Chrome"),ie:V.constant("IE"),opera:V.constant("Opera"),firefox:V.constant(yn),safari:V.constant("Safari")},wn="Windows",Nn="Android",En="Solaris",Sn="FreeBSD",kn=function(e,t){return function(){return t===e}},Tn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:kn(wn,t),isiOS:kn("iOS",t),isAndroid:kn(Nn,t),isOSX:kn("OSX",t),isLinux:kn("Linux",t),isSolaris:kn(En,t),isFreeBSD:kn(Sn,t)}},An={unknown:function(){return Tn({current:undefined,version:vn.unknown()})},nu:Tn,windows:V.constant(wn),ios:V.constant("iOS"),android:V.constant(Nn),linux:V.constant("Linux"),osx:V.constant("OSX"),solaris:V.constant(En),freebsd:V.constant(Sn)},Rn=function(e,t){var n=String(t).toLowerCase();return H.find(e,function(e){return e.search(n)})},_n=function(e,n){return Rn(e,n).map(function(e){var t=vn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Bn=function(e,n){return Rn(e,n).map(function(e){var t=vn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Dn=function(e,t){return-1!==e.indexOf(t)},On=function(e){return e.replace(/^\s+|\s+$/g,"")},Pn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ln=function(t){return function(e){return Dn(e,t)}},In=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Dn(e,"edge/")&&Dn(e,"chrome")&&Dn(e,"safari")&&Dn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pn],search:function(e){return Dn(e,"chrome")&&!Dn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Dn(e,"msie")||Dn(e,"trident")}},{name:"Opera",versionRegexes:[Pn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ln("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ln("firefox")},{name:"Safari",versionRegexes:[Pn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Dn(e,"safari")||Dn(e,"mobile/"))&&Dn(e,"applewebkit")}}],Mn=[{name:"Windows",search:Ln("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Dn(e,"iphone")||Dn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ln("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ln("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ln("linux"),versionRegexes:[]},{name:"Solaris",search:Ln("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ln("freebsd"),versionRegexes:[]}],Fn={browsers:V.constant(In),oses:V.constant(Mn)},zn=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Fn.browsers(),m=Fn.oses(),p=_n(d,e).fold(xn.unknown,xn.nu),g=Bn(m,e).fold(An.unknown,An.nu);return{browser:p,os:g,deviceType:(n=p,r=e,o=(t=g).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:V.constant(o),isiPhone:V.constant(i),isTablet:V.constant(s),isPhone:V.constant(l),isTouch:V.constant(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:V.constant(f)})}},Un={detect:mn(function(){var e=navigator.userAgent;return zn(e)})},qn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:V.constant(e)}},Vn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return qn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return qn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return qn(n)},fromDom:qn,fromPoint:function(e,t,n){return A.from(e.dom().elementFromPoint(t,n)).map(qn)}},Hn=8,jn=9,$n=1,Wn=3,Kn=function(e){return e.dom().nodeName.toLowerCase()},Xn=function(e){return e.dom().nodeType},Yn=function(t){return function(e){return Xn(e)===t}},Gn=Yn($n),Jn=Yn(Wn),Qn=Yn(jn),Zn={name:Kn,type:Xn,value:function(e){return e.dom().nodeValue},isElement:Gn,isText:Jn,isDocument:Qn,isComment:function(e){return Xn(e)===Hn||"#comment"===Kn(e)}},er=(dn=Object.keys)===undefined?function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}:dn,tr=function(e,t){for(var n=er(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},nr=function(r,o){var i={};return tr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},rr=function(e,n){var r=[];return tr(e,function(e,t){r.push(n(e,t))}),r},or=function(e){return rr(e,function(e){return e})},ir={bifilter:function(e,n){var r={},o={};return tr(e,function(e,t){(n(e,t)?r:o)[t]=e}),{t:r,f:o}},each:tr,map:function(e,r){return nr(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},mapToArray:rr,tupleMap:nr,find:function(e,t){for(var n=er(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return A.some(a)}return A.none()},keys:er,values:or,size:function(e){return or(e).length}},ar=function(e,t,n){if(!(k.isString(n)||k.isBoolean(n)||k.isNumber(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},ur=function(e,t,n){ar(e.dom(),t,n)},sr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},cr=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},lr={clone:function(e){return H.foldl(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:ur,setAll:function(e,t){var n=e.dom();ir.each(t,function(e,t){ar(n,t,e)})},get:sr,has:cr,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){Zn.isElement(o)&&Zn.isElement(i)&&H.each(e,function(e){var t,n,r;n=i,cr(t=o,r=e)&&!cr(n,r)&&ur(n,r,sr(t,r))})}},fr=mn(function(){return dr(Vn.fromDom(document))}),dr=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return Vn.fromDom(t)},mr={body:fr,getBody:dr,inBody:function(e){var t=Zn.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},pr=function(e){return e.style!==undefined},gr=function(e,t,n){if(!k.isString(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);pr(e)&&e.style.setProperty(t,n)},hr=function(e,t){return pr(e)?e.style.getPropertyValue(t):""},vr=function(e,t){var n=e.dom(),r=hr(n,t);return A.from(r).filter(function(e){return 0<e.length})},yr=function(e,t){var n=e.dom();ir.each(t,function(e,t){gr(n,t,e)})},br=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||mr.inBody(e)?r:hr(n,t);return null===o?undefined:o},Cr=vr,xr=function(e){return e.slice(0).sort()},wr=function(e,t){throw new Error("All required keys ("+xr(e).join(", ")+") were not specified. Specified keys were: "+xr(t).join(", ")+".")},Nr=function(e){throw new Error("Unsupported keys for object: "+xr(e).join(", "))},Er=function(t,e){if(!k.isArray(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");H.each(e,function(e){if(!k.isString(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},Sr=function(e){var n=xr(e);H.find(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},kr={immutable:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return H.each(t,function(e,t){r[e]=V.constant(n[t])}),r}},immutableBag:function(o,i){var a=o.concat(i);if(0===a.length)throw new Error("You must specify at least one required or optional field.");return Er("required",o),Er("optional",i),Sr(a),function(t){var n=ir.keys(t);H.forall(o,function(e){return H.contains(n,e)})||wr(o,n);var e=H.filter(n,function(e){return!H.contains(a,e)});0<e.length&&Nr(e);var r={};return H.each(o,function(e){r[e]=V.constant(t[e])}),H.each(i,function(e){r[e]=V.constant(Object.prototype.hasOwnProperty.call(t,e)?A.some(t[e]):A.none())}),r}}},Tr=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Ar=function(){return W.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},_r=function(e,t){return Rr(e,t,Ar().DOCUMENT_POSITION_CONTAINED_BY)},Br=$n,Dr=jn,Or=function(e){return e.nodeType!==Br&&e.nodeType!==Dr||0===e.childElementCount},Pr={all:function(e,t){var n=t===undefined?document:t.dom();return Or(n)?[]:H.map(n.querySelectorAll(e),Vn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==Br)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Or(n)?A.none():A.from(n.querySelector(e)).map(Vn.fromDom)}},Lr=function(e,t){return e.dom()===t.dom()},Ir=Un.detect().browser.isIE()?function(e,t){return _r(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Mr={eq:Lr,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return H.exists(t,V.curry(Lr,e))},contains:Ir,is:Pr.is},Fr=function(e){return Vn.fromDom(e.dom().ownerDocument)},zr=function(e){var t=e.dom();return A.from(t.parentNode).map(Vn.fromDom)},Ur=function(e){var t=e.dom();return A.from(t.previousSibling).map(Vn.fromDom)},qr=function(e){var t=e.dom();return A.from(t.nextSibling).map(Vn.fromDom)},Vr=function(e){var t=e.dom();return H.map(t.childNodes,Vn.fromDom)},Hr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(Vn.fromDom)},jr=kr.immutable("element","offset"),$r={owner:Fr,defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return Vn.fromDom(t)},documentElement:function(e){var t=Fr(e);return Vn.fromDom(t.dom().documentElement)},parent:zr,findIndex:function(n){return zr(n).bind(function(e){var t=Vr(e);return H.findIndex(t,function(e){return Mr.eq(n,e)})})},parents:function(e,t){for(var n=k.isFunction(t)?t:V.constant(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Vn.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(t){return zr(t).map(Vr).map(function(e){return H.filter(e,function(e){return!Mr.eq(t,e)})}).getOr([])},prevSibling:Ur,offsetParent:function(e){var t=e.dom();return A.from(t.offsetParent).map(Vn.fromDom)},prevSiblings:function(e){return H.reverse(Tr(e,Ur))},nextSibling:qr,nextSiblings:function(e){return Tr(e,qr)},children:Vr,child:Hr,firstChild:function(e){return Hr(e,0)},lastChild:function(e){return Hr(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=Vr(e);return 0<n.length&&t<n.length?jr(n[t],0):jr(e,t)}},Wr=Un.detect().browser,Kr=function(e){return H.find(e,Zn.isElement)},Xr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===br(Vn.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=Vn.fromDom(t),Wr.isFirefox()&&"table"===Zn.name(i)?Kr($r.children(i)).filter(function(e){return"caption"===Zn.name(e)}).bind(function(o){return Kr($r.nextSiblings(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Yr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){H.each(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Yr(function(t){r(function(e){t(n(e))})})},isReady:o}},Gr={nu:Yr,pure:function(t){return Yr(function(e){e(t)})}},Jr=function(n){return function(){var e=Array.prototype.slice.call(arguments),t=this;setTimeout(function(){n.apply(t,e)},0)}},Qr=function(t){var e=function(e){t(Jr(e))};return{map:function(r){return Qr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Qr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Qr(function(t){e(function(e){n.get(t)})})},toLazy:function(){return Gr.nu(e)},get:e}},Zr={nu:Qr,pure:function(t){return Qr(function(e){e(t)})}},eo=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):H.each(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},to=function(e){return eo(e,Zr.nu)},no={par:to,mapM:function(e,t){var n=H.map(e,t);return to(n)},compose:function(t,n){return function(e){return n(e).bind(t)}}},ro=function(n){return{is:function(e){return n===e},isValue:V.always,isError:V.never,getOr:V.constant(n),getOrThunk:V.constant(n),getOrDie:V.constant(n),or:function(e){return ro(n)},orThunk:function(e){return ro(n)},fold:function(e,t){return t(n)},map:function(e){return ro(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},oo=function(n){return{is:V.never,isValue:V.never,isError:V.always,getOr:V.identity,getOrThunk:function(e){return e()},getOrDie:function(){return V.die(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return oo(n)},each:V.noop,bind:function(e){return oo(n)},exists:V.never,forall:V.always,toOption:A.none}},io={value:ro,error:oo};function ao(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var uo,so,co,lo=function(t){var n;return function(e){return(n=n||H.mapToObject(t,V.constant(!0))).hasOwnProperty(Zn.name(e))}},fo=lo(["h1","h2","h3","h4","h5","h6"]),mo=lo(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),po=function(e){return Zn.isElement(e)&&!mo(e)},go=function(e){return Zn.isElement(e)&&"br"===Zn.name(e)},ho=lo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),vo=lo(["ul","ol","dl"]),yo=lo(["li","dd","dt"]),bo=lo(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),Co=lo(["thead","tbody","tfoot"]),xo=lo(["td","th"]),wo=lo(["pre","script","textarea","style"]),No=function(t){return function(e){return!!e&&e.nodeType===t}},Eo=No(1),So=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},ko=function(t){return function(e){if(Eo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},To=No(3),Ao=No(8),Ro=No(9),_o=So("br"),Bo=ko("true"),Do=ko("false"),Oo={isText:To,isElement:Eo,isComment:Ao,isDocument:Ro,isBr:_o,isContentEditableTrue:Bo,isContentEditableFalse:Do,matchNodeNames:So,hasPropValue:function(t,n){return function(e){return Eo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return Eo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return Eo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(Eo(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return Eo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return Eo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return Eo(e)&&"TABLE"===e.tagName}},Po=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Lo=function(e,t){var n,r=t.childNodes;if(!Oo.isElement(t)||!Po(t)){for(n=r.length-1;0<=n;n--)Lo(e,r[n]);if(!1===Oo.isDocument(t)){if(Oo.isText(t)&&0<t.nodeValue.length){var o=It.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(Oo.isElement(t)&&(1===(r=t.childNodes).length&&Po(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||bo(Vn.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Io={trimNode:Lo},Mo=It.makeMap,Fo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Uo=/[<>&\"\']/g,qo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Vo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};so={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},co={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};var Ho=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),so[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};uo=Ho("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var jo=function(e,t){return e.replace(t?Fo:zo,function(e){return so[e]||e})},$o=function(e,t){return e.replace(t?Fo:zo,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":so[e]||"&#"+e.charCodeAt(0)+";"})},Wo=function(e,t,n){return n=n||uo,e.replace(t?Fo:zo,function(e){return so[e]||n[e]||e})},Ko={encodeRaw:jo,encodeAllRaw:function(e){return(""+e).replace(Uo,function(e){return so[e]||e})},encodeNumeric:$o,encodeNamed:Wo,getEncodeFunc:function(e,t){var n=Ho(t)||uo,r=Mo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Fo:zo,function(e){return so[e]!==undefined?so[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return Wo(e,t,n)}:Wo:r.numeric?$o:jo},decode:function(e){return e.replace(qo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Vo[t]||String.fromCharCode(t):co[e]||uo[e]||(n=e,(r=Vn.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Xo={},Yo={},Go=It.makeMap,Jo=It.each,Qo=It.extend,Zo=It.explode,ei=It.inArray,ti=function(e,t){return(e=It.trim(e))?e.split(t||" "):[]},ni=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=ti(n)),r=(e=ti(e)).length;r--;)i={attributes:a(o=ti([u,t].join(" "))),attributesOrder:o,children:a(n,Yo)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=ti(e)).length,t=ti(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return Xo[e]?Xo[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Jo(ti(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Jo(ti(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Jo(ti("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Xo[e]=s)},ri=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Jo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Go(e,/[, ]/):Zo(e,/[, ]/)})),r};function oi(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},p={},E=[],g={},h={},v=function(e,t,n){var r=i[e];return r?r=Go(r,/[, ]/,Go(r.toUpperCase(),/[, ]/)):(r=Xo[e])||(r=Go(t," ",Go(t.toUpperCase()," ")),r=Qo(r,n),Xo[e]=r),r};n=ni((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ri(i.valid_styles),t=ri(i.invalid_styles,"map"),s=ri(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),c=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Jo((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},y=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,p,g,h,v,y,b,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=ti(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(p=i[1],c=i[2],g=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===p&&(a.paddEmpty=!0),"-"===p&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(y in h)d[y]=h[y];m.push.apply(m,v)}if(s)for(r=0,o=(s=ti(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),p=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(ei(m,l),1);continue}p&&("="===p&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===p&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===p&&(u.validValues=Go(b,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),g&&(a.outputName=c,N[g]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},b=function(e){N={},E=[],y(e),Jo(n,function(e,t){p[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Xo.text_block_elements=Xo.block_elements=null,Jo(ti(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(p[o]=p[r],g[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Qo({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Jo(p,function(e,t){e[r]&&(p[t]=e=Qo({},p[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Xo[i.schema]=null,e&&Jo(ti(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?p[r[2]]:p[r[2]]={"#comment":{}},t=p[r[2]],Jo(ti(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?b(i.valid_elements):(Jo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},p[t]=e.children}),"html5"!==i.schema&&Jo(ti("strong/b em/i"),function(e){e=ti(e,"/"),N[e[1]].outputName=e[0]}),Jo(ti("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Jo(ti("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Jo(ti("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),y(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),Jo({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=ti(e))}),i.invalid_elements&&Jo(Zo(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||y("span[!data-mce-type|*]"),{children:p,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=p[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return g},addValidElements:y,setValidElements:b,addCustomElements:C,addValidChildren:x}}var ii=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function ai(b,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},k="\ufeff";for(b=b||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+k).split(" "),C=0;C<t.length;C++)S[t[C]]=k+C,S[k+C]=t[C];return{toHex:function(e){return e.replace(x,ii)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=b.url_converter,f=b.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},p=function(e){return o=!0,S[e]},g=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},y=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=g(o)).replace(/\'/g,"\\'")+"'";if(t=g(t||n||r),!b.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!b.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,p)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(k)||-1!==n.indexOf('"'))continue;if(!b.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,ii)).replace(w,y),c[n]=o?g(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var ui,si=It.each,ci=It.grep,li=ve.ie,fi=/^([a-z0-9],?)+$/i,di=/^[ \t\r\n]*$/,mi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},pi=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},gi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function hi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function(m,e){var p,g=0,h={};p=(e=e||{}).maxLoadTime||5e3;var v=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<p?we.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=It._addCacheSuffix(e),h[e]?a=h[e]:(a={passed:[],failed:[]},h[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+g++,o.async=!1,o.defer=!1,i=(new Date).getTime(),"onload"in o&&!((d=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void v(r);l()}var d;v(o),o.href=e}else s();else u()},t=function(t){return Zr.nu(function(e){n(t,V.compose(e,V.constant(io.value(t))),V.compose(e,V.constant(io.error(t))))})},o=function(e){return e.fold(V.identity,V.identity)};return{load:n,loadAll:function(e,n,r){no.par(H.map(e,t)).get(function(e){var t=H.partition(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a),l=[],f=u.schema?u.schema:oi({}),d=ai({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new Be(u.proxy):Be.Event,n=f.getBlockElements(),p=tn.overrideDefaults(function(){return{context:a,element:q.getRoot()}}),g=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=g(e)),p(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},y=function(e){var t=g(e);return t?t.attributes:[]},b=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Xr.getPos(a.body,g(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=ve.ie&&ve.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=g(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(fi.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<mt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=g(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),It.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},k=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},T=function(e,n,r){var o,t="string"==typeof e?g(e):e;if(!t)return!1;if(It.isArray(t)&&(t.length||0===t.length))return o=[],si(t,function(e,t){e&&("string"==typeof e&&(e=g(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){si(t,function(e,t){b(n,t,e)})})},R=function(e,r){var t=h(e);li?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){tn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},_=function(e,n,r,o,i){return T(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&R(t,o)),i?t:e.appendChild(t)})},B=function(e,t,n){return _(a.createElement(e),e,t,n,!0)},D=Ko.decode,O=Ko.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},L=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&tn(this).attr("class",null)})},I=function(t,e,n){return T(e,function(e){return It.is(e,"array")&&(t=t.cloneNode(!0)),n&&si(ci(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(It.isArray(e)){for(var o=e.length;o--;)e[o]=F(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||q)},z=function(e,t,n){var r;if(It.isArray(e)){for(r=e.length;r--;)e[r]=z(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},U=function(e){if(e&&Oo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},q={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:p,$$:h,root:null,clone:function(t,e){if(!li||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return si(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=g(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:g,getNext:function(e,t){return k(e,t,"nextSibling")},getPrev:function(e,t){return k(e,t,"previousSibling")},select:function(e,t){return mt(e,g(t)||u.root_element||a,[])},is:E,add:_,create:B,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+O(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&pi(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&pi(d,n)},removeAllAttribs:function(e){return T(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:b,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(q!==hi.DOM&&a===document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;q===hi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],si(e.split(","),function(e){var t;e=It._addCacheSuffix(e),o[e]||(o[e]=!0,t=B("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):hi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){L(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:L,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:R,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return Oo.isElement(t)?t.outerHTML:tn("<div></div>").append(tn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(tn(this).html(t),!0)})},decode:D,encode:O,insertAfter:function(e,t){var r=g(t);return T(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=B(e),si(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),I(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(It.trim(e))},run:T,getAttribs:y,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new ao(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Oo.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=y(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!di.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&di.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:gi,split:function(e,t,n){var r,o,i,a=M();if(e&&t)return a.setStart(e.parentNode,gi(e)),a.setEnd(t.parentNode,gi(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,gi(t)+1),a.setEnd(e.parentNode,gi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Io.trimNode(q,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Io.trimNode(q,o),e),P(e),n||t},bind:F,unbind:z,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:U,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=U(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}mt.setDocument&&mt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=mi(d,u,function(){return q}),q}(ui=hi||(hi={})).DOM=ui(document),ui.nodeIndex=gi;var vi=hi,yi=vi.DOM,bi=It.each,Ci=It.grep,xi=function(e){return"function"==typeof e},wi=function(){var f={},o=[],i={},a=[],d=0;this.isDone=function(e){return 2===f[e]},this.markDone=function(e){f[e]=2},this.add=this.load=function(e,t,n,r){f[e]===undefined&&(o.push(e),f[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete f[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var s,c=[],l=function(t,e){bi(i[e],function(e){xi(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(s=function(){var e=Ci(n);if(n.length=0,bi(e,function(e){var t,n,r,o,i,a,u;2!==f[e]?3!==f[e]?1!==f[e]&&(f[e]=1,d++,t=e,n=function(){f[e]=2,d--,l("success",e),s()},r=function(){f[e]=3,d--,c.push(e),l("failure",e),s()},u=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},i=(a=yi).uniqueId(),(o=document.createElement("script")).id=i,o.type="text/javascript",o.src=It._addCacheSuffix(t),"onreadystatechange"in o?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&u()}:o.onload=u,o.onerror=function(){xi(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)):l("failure",e):l("success",e)}),!d){var t=a.slice(0);a.length=0,bi(t,function(e){0===c.length?xi(e.success)&&e.success.call(e.scope):xi(e.failure)&&e.failure.call(e.scope,c)})}})()}};wi.ScriptLoader=new wi;var Ni,Ei=It.each;function Si(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(n,e,t){var r=s(name);Ei(r,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),e&&(t?e.call(t):e.call(wi))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Si.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(t,n,r):wi.ScriptLoader.add(i,function(){return l(t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Si.language;if(n&&!1!==Si.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;wi.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=H.partition(i,function(e){return e.name===t});return i=r.fail,Ei(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];Ei(t,function(e){wi.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Ni=Si||(Si={})).PluginManager=Ni(),Ni.ThemeManager=Ni();var ki,Ti="\ufeff",Ai=function(e){return e===Ti},Ri=Ti,_i=function(e){return e.replace(new RegExp(Ti,"g"),"")},Bi=Oo.isElement,Di=Oo.isText,Oi=function(e){return Di(e)&&(e=e.parentNode),Bi(e)&&e.hasAttribute("data-mce-caret")},Pi=function(e){return Di(e)&&Ai(e.data)},Li=function(e){return Oi(e)||Pi(e)},Ii=function(e){return e.firstChild!==e.lastChild||!Oo.isBr(e.firstChild)},Mi=function(e){var t=e.container();return e&&Oo.isText(t)&&t.data.charAt(e.offset())===Ri},Fi=function(e){var t=e.container();return e&&Oo.isText(t)&&t.data.charAt(e.offset()-1)===Ri},zi=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Ui=function(e){return Di(e)&&e.data[0]===Ri},qi=function(e){return Di(e)&&e.data[e.data.length-1]===Ri},Vi=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Oo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Hi=Oo.isContentEditableTrue,ji=Oo.isContentEditableFalse,$i=Oo.isBr,Wi=Oo.isText,Ki=Oo.matchNodeNames("script style textarea"),Xi=Oo.matchNodeNames("img input textarea hr iframe video audio object"),Yi=Oo.matchNodeNames("table"),Gi=Li,Ji=function(e){return!Gi(e)&&(Wi(e)?!Ki(e.parentNode):Xi(e)||$i(e)||Yi(e)||Qi(e))},Qi=function(e){return!1===(t=e,Oo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&ji(e);var t},Zi=function(e,t){return Ji(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Qi(e))return!1;if(Hi(e))return!0}return!0}(e,t)},ea=Math.round,ta=function(e){return e?{left:ea(e.left),top:ea(e.top),bottom:ea(e.bottom),right:ea(e.right),width:ea(e.width),height:ea(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},na=function(e,t){return e=ta(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},ra=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},oa=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&ra(t.top-e.bottom,e,t)},ia=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&ra(t.bottom-e.top,e,t)},aa=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},ua=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},sa=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),ca=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&sa.test(e)},la=[].slice,fa=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=la.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return fa.apply(this,e)}},da={constant:function(e){return function(){return e}},negate:function(t){return function(e){return!t(e)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=la.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=la.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},curry:fa,compose:function(t,n){return function(e){return t(n(e))}},noop:function(){}},ma=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},pa=Oo.isElement,ga=Ji,ha=Oo.matchStyleValues("display","block table"),va=Oo.matchStyleValues("float","left right"),ya=da.and(pa,ga,da.negate(va)),ba=da.negate(Oo.matchStyleValues("white-space","pre pre-line pre-wrap")),Ca=Oo.isText,xa=Oo.isBr,wa=vi.nodeIndex,Na=ua,Ea=function(e){return"createRange"in e?e.createRange():vi.DOM.createRng()},Sa=function(e){return e&&/[\r\n\t ]/.test(e)},ka=function(e){return!!e.setStart&&!!e.setEnd},Ta=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(Sa(e.toString())&&ba(n.parentNode)&&Oo.isText(n)&&(t=n.data,Sa(t[r-1])||Sa(t[r+1])))},Aa=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},Ra=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?ta(n[0]):ta(e.getBoundingClientRect()),!ka(e)&&xa(e)&&Aa(t)?(i=(r=e).ownerDocument,a=Ea(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=ta(a.getBoundingClientRect()),s.removeChild(u),o):Aa(t)&&ka(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Oo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),Ra(i)}return null}(e):t},_a=function(e,t){var n=na(e,t);return n.width=1,n.right=n.left+1,n},Ba=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=Ea(e.ownerDocument);if(t<e.data.length){if(ca(e.data[t]))return r;if(ca(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!Ta(n)))return o(_a(Ra(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),Ta(n)||o(_a(Ra(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),Ta(n)||o(_a(Ra(n),!0)))};if(Ca(e.container()))return i(e.container(),e.offset()),r;if(pa(e.container()))if(e.isAtEnd())n=Na(e.container(),e.offset()),Ca(n)&&i(n,n.data.length),ya(n)&&!xa(n)&&o(_a(Ra(n),!1));else{if(n=Na(e.container(),e.offset()),Ca(n)&&i(n,0),ya(n)&&e.isAtEnd())return o(_a(Ra(n),!1)),r;t=Na(e.container(),e.offset()-1),ya(t)&&!xa(t)&&(ha(t)||ha(n)||!ya(n))&&o(_a(Ra(t),!1)),ya(n)&&o(_a(Ra(n),!0))}return r};function Da(t,n,e){var r=function(){return e||(e=Ba(Da(t,n))),e};return{container:da.constant(t),offset:da.constant(n),toRange:function(){var e;return(e=Ea(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return Ca(t),0===n},isAtEnd:function(){return Ca(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return Na(t,e?n-1:n)}}}(ki=Da||(Da={})).fromRangeStart=function(e){return ki(e.startContainer,e.startOffset)},ki.fromRangeEnd=function(e){return ki(e.endContainer,e.endOffset)},ki.after=function(e){return ki(e.parentNode,wa(e)+1)},ki.before=function(e){return ki(e.parentNode,wa(e))},ki.isAbove=function(e,t){return ma([H.head(t.getClientRects()),H.last(e.getClientRects())],oa).getOr(!1)},ki.isBelow=function(e,t){return ma([H.last(t.getClientRects()),H.head(e.getClientRects())],ia).getOr(!1)},ki.isAtStart=function(e){return!!e&&e.isAtStart()},ki.isAtEnd=function(e){return!!e&&e.isAtEnd()},ki.isTextPosition=function(e){return!!e&&Oo.isText(e.container())},ki.isElementPosition=function(e){return!1===ki.isTextPosition(e)};var Oa,Pa,La=Da,Ia=Oo.isElement,Ma=Oo.isText,Fa=function(e){var t=e.parentNode;t&&t.removeChild(e)},za=function(e,t){0===t.length?Fa(e):e.nodeValue=t},Ua=function(e){var t=_i(e);return{count:e.length-t.length,text:t}},qa=function(e,t){return ja(e),t},Va=function(e,t){return Ma(e)&&t.container()===e?(r=t,o=Ua((n=e).data.substr(0,r.offset())),i=Ua(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(za(n,a),La(n,r.offset()-o.count)):r):qa(e,t);var n,r,o,i,a},Ha=function(e,t){return t.container()===e.parentNode?(n=e,o=(r=t).container(),i=H.indexOf(H.from(o.childNodes),n).map(function(e){return e<r.offset()?La(o,r.offset()-1):r}).getOr(r),ja(n),i):qa(e,t);var n,r,o,i},ja=function(e){if(Ia(e)&&Li(e)&&(Ii(e)?e.removeAttribute("data-mce-caret"):Fa(e)),Ma(e)){var t=_i(function(e){try{return e.nodeValue}catch(t){return""}}(e));za(e,t)}},$a={removeAndReposition:function(e,t){return La.isTextPosition(t)?Va(e,t):Ha(e,t)},remove:ja},Wa=function(e){return La.isTextPosition(e)?0===e.offset():Ji(e.getNode())},Ka=function(e){if(La.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ji(e.getNode(!0))},Xa=function(e,t){return!La.isTextPosition(e)&&!La.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Ya=function(e,t,n){return e?!Xa(t,n)&&(r=t,!(!La.isTextPosition(r)&&Oo.isBr(r.getNode())))&&Ka(t)&&Wa(n):!Xa(n,t)&&Wa(t)&&Ka(n);var r},Ga=function(e,t,n){var r=Ys(t);return A.from(e?r.next(n):r.prev(n))},Ja=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Oo.isText(u)?A.some(La(u,e?0:u.data.length)):u?Ji(u)?A.some(e?La.before(u):(a=u,Oo.isBr(a)?La.before(a):La.after(a))):(r=t,o=u,i=(n=e)?La.before(o):La.after(o),Ga(n,r,i)):A.none()},Qa={fromPosition:Ga,nextPosition:V.curry(Ga,!0),prevPosition:V.curry(Ga,!1),navigate:function(t,n,r){return Ga(t,n,r).bind(function(e){return bs(r,e,n)&&Ya(t,r,e)?Ga(t,n,e):A.some(e)})},positionIn:Ja,firstPositionIn:V.curry(Ja,!0),lastPositionIn:V.curry(Ja,!1)},Za=Oo.isContentEditableTrue,eu=Oo.isContentEditableFalse,tu=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},nu=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},ru=function(e,t,n){var r=Ss(1,e.getBody(),t),o=La.fromRangeStart(r),i=o.getNode();if(eu(i))return tu(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(eu(a))return tu(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return eu(e)||Za(e)});return eu(u)?tu(1,e,u,!1,n):null},ou=function(e,t,n){if(!t||!t.collapsed)return t;var r=ru(e,t,n);return r||t};(Pa=Oa||(Oa={}))[Pa.Br=0]="Br",Pa[Pa.Block=1]="Block",Pa[Pa.Wrap=2]="Wrap",Pa[Pa.Eol=3]="Eol";var iu,au,uu=function(e,t){return e===iu.Backwards?t.reverse():t},su=function(e,t,n,r){for(var o,i,a,u,s,c,l=Ys(n),f=r,d=[];f&&(s=l,c=f,o=t===iu.Forwards?s.next(c):s.prev(c));){if(Oo.isBr(o.getNode(!1)))return t===iu.Forwards?{positions:uu(t,d).concat([o]),breakType:Oa.Br,breakAt:A.some(o)}:{positions:uu(t,d),breakType:Oa.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,Oo.isBr(u.getNode(i===iu.Forwards))?Oa.Br:!1===bs(a,u)?Oa.Block:Oa.Wrap);return{positions:uu(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:uu(t,d),breakType:Oa.Eol,breakAt:A.none()}},cu=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===iu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},lu=function(e,i){return H.foldl(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return ma([H.head(r.getClientRects()),H.head(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},fu=function(t,e){return H.head(e.getClientRects()).bind(function(e){return lu(t,e.left)})},du=V.curry(su,Da.isAbove,-1),mu=V.curry(su,Da.isBelow,1),pu=V.curry(cu,-1,du),gu=V.curry(cu,1,mu),hu=function(e,t){return Pr.all(t,e)},vu=function(e,t,n,r,o){var i,a,u,s,c,l=hu(Vn.fromDom(n),"td,th").map(function(e){return e.dom()}),f=H.filter((i=e,a=l,H.bind(a,function(e){var t,n,r=(t=e.getBoundingClientRect(),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(u=f,s=r,c=o,H.foldl(u,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-s)+Math.abs(e.y-c)),n=Math.sqrt(Math.abs(r.x-s)+Math.abs(r.y-c));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},yu=V.curry(vu,function(e){return e.bottom},function(e,t){return e.y<t}),bu=V.curry(vu,function(e){return e.top},function(e,t){return e.y>t}),Cu=function(t,n){return H.head(n.getClientRects()).bind(function(e){return yu(t,e.left,e.top)}).bind(function(e){return fu((t=e,Qa.lastPositionIn(t).map(function(e){return du(t,e).positions.concat(e)}).getOr([])),n);var t})},xu=function(t,n){return H.last(n.getClientRects()).bind(function(e){return bu(t,e.left,e.top)}).bind(function(e){return fu((t=e,Qa.firstPositionIn(t).map(function(e){return[e].concat(mu(t,e).positions)}).getOr([])),n);var t})},wu=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},Nu=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&Oo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=wu(t).y-wu(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},Eu=function(d,e){H.head(Da.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},Su=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},ku=function(e){return e.getParam("iframe_attrs",{})},Tu=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Au=function(e){return e.getParam("document_base_url","")},Ru=function(e){return Su(e,"body_id","tinymce")},_u=function(e){return Su(e,"body_class","")},Bu=function(e){return e.getParam("content_security_policy","")},Du=function(e){return e.getParam("br_in_pre",!0)},Ou=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},Pu=function(e){return e.getParam("forced_root_block_attrs",{})},Lu=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Iu=function(e){return e.getParam("no_newline_selector","")},Mu=function(e){return e.getParam("keep_styles",!0)},Fu=function(e){return e.getParam("end_container_on_empty_block",!1)},zu=function(e){return It.explode(e.getParam("font_size_style_values",""))},Uu=function(e){return It.explode(e.getParam("font_size_classes",""))},qu=function(t,n){$r.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Vu=function(e,t){e.dom().appendChild(t.dom())},Hu={before:qu,after:function(e,t){$r.nextSibling(e).fold(function(){$r.parent(e).each(function(e){Vu(e,t)})},function(e){qu(e,t)})},prepend:function(t,n){$r.firstChild(t).fold(function(){Vu(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Vu,appendAt:function(e,t,n){$r.child(e,n).fold(function(){Vu(e,t)},function(e){qu(e,t)})},wrap:function(e,t){qu(e,t),Vu(t,e)}},ju=Un.detect().browser,$u=function(){return ju.isIE()||ju.isEdge()||ju.isFirefox()},Wu=function(e,t){e.selection.setRng(t),Eu(e,t)},Ku=function(t,n,e){var r=t(n,e);return r.breakType===Oa.Wrap&&0===r.positions.length?r.breakAt.map(function(e){return t(n,e).breakAt.isNone()}).getOr(!0):r.breakAt.isNone()},Xu=da.curry(Ku,du),Yu=da.curry(Ku,mu),Gu=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if($u()&&(o=t,i=s,a=n,u=La.fromRangeStart(i),Qa.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=tu(c,e,n,!t,!0);return Wu(e,l),!0}return!1},Ju=function(e,t){var n=t.getNode(e);return Oo.isElement(n)&&"TABLE"===n.nodeName?A.some(n):A.none()},Qu=function(u,s,c){var e=Ju(!!s,c),t=!1===s;e.fold(function(){return Wu(u,c.toRange())},function(a){return Qa.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Wu(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Ou(r=u))?r.undoManager.transact(function(){var e=Vn.fromTag(i);lr.setAll(e,Pu(r)),Hu.append(e,Vn.fromTag("br")),n?Hu.after(Vn.fromDom(o),e):Hu.before(Vn.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),Wu(r,t)}):Wu(r,t.toRange()));var n,r,o,t,i})})},Zu=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=La.fromRangeStart(l),d=e.getBody();if(!t&&Xu(r,f)){var m=(u=d,Cu(s=n,c=f).orThunk(function(){return H.head(c.getClientRects()).bind(function(e){return lu(pu(u,La.before(s)),e.left)})}).getOr(La.before(s)));return Qu(e,t,m),!0}return!(!t||!Yu(r,f))&&(o=d,m=xu(i=n,a=f).orThunk(function(){return H.head(a.getClientRects()).bind(function(e){return lu(gu(o,La.after(i)),e.left)})}).getOr(La.after(i)),Qu(e,t,m),!0)},es=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return Gu(t,n,e)})}).getOr(!1)}},ts=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return Zu(n,r,e,t)})}).getOr(!1)}},ns=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return ns(n())}}},rs=Oo.isContentEditableFalse,os=function(e,t,n){var r,o,i,a,u,s=na(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},is=function(a,u,e){var t,s,c=ns(A.none()),l=function(){!function(e){var t,n,r,o,i;for(t=tn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,qi(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Ui(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&($a.remove(s),s=null),c.get().each(function(e){tn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=we.setInterval(function(){e()?tn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):tn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,Oo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(Ri),o=e.parentNode,t){if(n=e.previousSibling,Di(n)){if(Li(n))return n;if(qi(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Di(n)){if(Li(n))return n;if(Ui(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),rs(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=zi("p",e,t),n=os(a,e,t),tn(s).css("top",n.top);var i=tn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&tn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=os(a,e.element,e.before);tn(e.caret).css(t)})},destroy:function(){return we.clearInterval(t)}}},as=function(e){return rs(e)||Oo.isTable(e)&&$u()},us=Oo.isContentEditableFalse,ss=Oo.matchStyleValues("display","block table table-cell table-caption list-item"),cs=Li,ls=Oi,fs=da.curry,ds=Oo.isElement,ms=Ji,ps=function(e){return 0<e},gs=function(e){return e<0},hs=function(e,t){for(var n;n=e(t);)if(!ls(n))return n;return null},vs=function(e,t,n,r,o){var i=new ao(e,r);if(gs(t)){if((us(e)||ls(e))&&n(e=hs(i.prev,!0)))return e;for(;e=hs(i.prev,o);)if(n(e))return e}if(ps(t)){if((us(e)||ls(e))&&n(e=hs(i.next,!0)))return e;for(;e=hs(i.next,o);)if(n(e))return e}return null},ys=function(e,t){for(;e&&e!==t;){if(ss(e))return e;e=e.parentNode}return null},bs=function(e,t,n){return ys(e.container(),n)===ys(t.container(),n)},Cs=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),ds(n)?n.childNodes[r+e]:null):null},xs=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},ws=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],cs(r)&&(r=r[o]),us(r)){if(a=n,ys(r,i=t)===ys(a,i))return r;break}if(ms(r))break;n=n.parentNode}return null},Ns=fs(xs,!0),Es=fs(xs,!1),Ss=function(e,t,n){var r,o,i,a,u=fs(ws,!0,t),s=fs(ws,!1,t);if(o=n.startContainer,i=n.startOffset,Oi(o)){if(ds(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,as(r)))return Ns(r);if("after"===a&&(r=o.previousSibling,as(r)))return Es(r)}if(!n.collapsed)return n;if(Oo.isText(o)){if(cs(o)){if(1===e){if(r=s(o))return Ns(r);if(r=u(o))return Es(r)}if(-1===e){if(r=u(o))return Es(r);if(r=s(o))return Ns(r)}return n}if(qi(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Ns(r):n;if(Ui(o)&&i<=1)return-1===e&&(r=u(o))?Es(r):n;if(i===o.data.length)return(r=s(o))?Ns(r):n;if(0===i)return(r=u(o))?Es(r):n}return n},ks=function(e,t){var n=Cs(e,t);return us(n)&&!Oo.isBogusAll(n)},Ts=function(e,t){return Oo.isTable(Cs(e,t))},As=function(e,t){return A.from(Cs(e?0:-1,t)).filter(us)},Rs=function(e,t,n){var r=Ss(e,t,n);return-1===e?Da.fromRangeStart(r):Da.fromRangeEnd(r)},_s=fs(ks,0),Bs=fs(ks,-1),Ds=fs(Ts,0),Os=fs(Ts,-1);(au=iu||(iu={}))[au.Backwards=-1]="Backwards",au[au.Forwards=1]="Forwards";var Ps,Ls,Is,Ms,Fs,zs=Oo.isContentEditableFalse,Us=Oo.isText,qs=Oo.isElement,Vs=Oo.isBr,Hs=Ji,js=function(e){return Xi(e)||!!Qi(t=e)&&!0!==Bt.reduce(t.getElementsByTagName("*"),function(e,t){return e||Hi(t)},!1);var t},$s=Zi,Ws=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ks=function(e,t){if(ps(e)){if(Hs(t.previousSibling)&&!Us(t.previousSibling))return La.before(t);if(Us(t))return La(t,0)}if(gs(e)){if(Hs(t.nextSibling)&&!Us(t.nextSibling))return La.after(t);if(Us(t))return La(t,t.data.length)}return gs(e)?Vs(t)?La.before(t):La.after(t):La.before(t)},Xs=function(e,t,n){var r,o,i,a,u;if(!qs(n)||!t)return null;if(t.isEqual(La.after(n))&&n.lastChild){if(u=La.after(n.lastChild),gs(e)&&Hs(n.lastChild)&&qs(n.lastChild))return Vs(n.lastChild)?La.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(Us(f)){if(gs(e)&&0<d)return La(f,--d);if(ps(e)&&d<f.length)return La(f,++d);r=f}else{if(gs(e)&&0<d&&(o=Ws(f,d-1),Hs(o)))return!js(o)&&(i=vs(o,e,$s,o))?Us(i)?La(i,i.data.length):La.after(i):Us(o)?La(o,o.data.length):La.before(o);if(ps(e)&&d<f.childNodes.length&&(o=Ws(f,d),Hs(o)))return Vs(o)&&n.lastChild===o?null:(s=o,c=n,Oo.isBr(s)&&(l=Xs(1,La.after(s),c))&&!bs(La.before(s),La.before(l),c)?Xs(e,La.after(o),n):!js(o)&&(i=vs(o,e,$s,o))?Us(i)?La(i,0):La.before(i):Us(o)?La(o,0):La.after(o));r=o||u.getNode()}return(ps(e)&&u.isAtEnd()||gs(e)&&u.isAtStart())&&(r=vs(r,e,da.constant(!0),n,!0),$s(r,n))?Ks(e,r):(o=vs(r,e,$s,n),!(a=Bt.last(Bt.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),zs)))||o&&a.contains(o)?o?Ks(e,o):null:u=ps(e)?La.after(a):La.before(a))},Ys=function(t){return{next:function(e){return Xs(iu.Forwards,e,t)},prev:function(e){return Xs(iu.Backwards,e,t)}}},Gs=function(e){return It.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Js=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||Oo.isBr(t));var t},Qs=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Js(t))?e.slice(0,-1):e;var t},Zs=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},ec=function(e,t){var n=La.after(e),r=Ys(t).prev(n);return r?r.toRange():null},tc=function(t,e,n){var r,o,i,a,u=t.parentNode;return It.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=La.before(r),(a=Ys(o).next(i))?a.toRange():null},nc=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},rc=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,p,g,h,v,y,b,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=Zs(o,i.startContainer),S=Qs(Gs(N.firstChild)),k=o.getRoot(),T=function(e){var t=La.fromRangeStart(i),n=Ys(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Zs(o,r.getNode())!==E};return T(1)?tc(E,S,k):T(2)?(f=E,d=S,m=k,o.insertAfter(d.reverse(),f),ec(d[0],m)):(g=S,h=k,v=p=E,b=(y=i).cloneRange(),C=y.cloneRange(),b.setStartBefore(v),C.setEndAfter(v),x=[b.cloneContents(),C.cloneContents()],(w=p.parentNode).insertBefore(x[0],p),It.each(g,function(e){w.insertBefore(e,p)}),w.insertBefore(x[1],p),w.removeChild(p),ec(g[g.length-1],h))},oc=function(e,t){return!!Zs(e,t)},ic=Oo.isText,ac=Oo.isBogus,uc=vi.nodeIndex,sc=function(e){var t=e.parentNode;return ac(t)?sc(t):t},cc=function(e){return e?Bt.reduce(e.childNodes,function(e,t){return ac(t)&&"BR"!==t.nodeName?e=e.concat(cc(t)):e.push(t),e},[]):[]},lc=function(t){return function(e){return t===e}},fc=function(e){var t,r,n,o;return(ic(e)?"text()":e.nodeName.toLowerCase())+"["+(r=cc(sc(t=e)),n=Bt.findIndex(r,lc(t),t),r=r.slice(0,n+1),o=Bt.reduce(r,function(e,t,n){return ic(t)&&ic(r[n-1])&&e++,e},0),r=Bt.filter(r,Oo.matchNodeNames(t.nodeName)),(n=Bt.findIndex(r,lc(t),t))-o)+"]"},dc=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),ic(n)?o=function(e,t){for(;(e=e.previousSibling)&&ic(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(fc(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=Bt.filter(a,da.negate(Oo.isBogus)),(u=u.concat(Bt.map(a,function(e){return fc(e)}))).reverse().join("/")+","+o},mc=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=Bt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=cc(n),i=Bt.filter(i,function(e,t){return!ic(e)||!ic(i[t-1])}),(i=Bt.filter(i,Oo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?ic(r)?function(e,t){for(var n,r=e,o=0;ic(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!ic(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return ic(e)&&t>e.data.length&&(t=e.data.length),La(e,t)}(r,parseInt(o,10)):(o="after"===o?uc(r)+1:uc(r),La(r.parentNode,o)):null):null},pc=Oo.isContentEditableFalse,gc=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(Oo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Oo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},hc=function(e){Oo.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},vc=function(e,t,n){var r=0;return It.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},yc=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Oo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},bc=function(e){return yc(e,!0),yc(e,!1),e},Cc=function(e,t){var n;if(Oo.isElement(e)&&(e=ua(e,t),pc(e)))return e;if(Li(e)){if(Oo.isText(e)&&Oi(e)&&(e=e.parentNode),n=e.previousSibling,pc(n))return n;if(n=e.nextSibling,pc(n))return n}},xc=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(pc(r)||"IMG"===o)return{name:o,index:vc(n.dom,o,r)};var a,u,s,c,l,f,d,m=Cc((a=i).startContainer,a.startOffset)||Cc(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:vc(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=gc(f,u,c,l,!0),s.isCollapsed()||(d.end=gc(f,u,c,l,!1)),d)},wc=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},Nc=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:vc(n,u,a)};var s=bc(r.cloneRange());if(!i){s.collapse(!1);var c=wc(n,o+"_end",t);s.insertNode(c),hc(c.nextSibling)}(r=bc(r)).collapse(!0);var l=wc(n,o+"_start",t);return r.insertNode(l),hc(l.previousSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},Ec={getBookmark:function(e,t,n){return 2===t?xc(_i,n,e):3===t?(o=(r=e).getRng(),{start:dc(r.dom.getRoot(),La.fromRangeStart(o)),end:dc(r.dom.getRoot(),La.fromRangeEnd(o))}):t?{rng:e.getRng()}:Nc(e,!1);var r,o},getUndoBookmark:V.curry(xc,V.identity,!0),getPersistentBookmark:Nc},Sc="_mce_caret",kc=function(e){return Oo.isElement(e)&&e.id===Sc},Tc=function(e,t){for(;t&&t!==e;){if(t.id===Sc)return t;t=t.parentNode}return null},Ac=function(e,t){return!e.isBlock(t)||t.innerHTML||ve.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},Rc=function(e,t){return Qa.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},_c=function(e,t,n){return!(!1!==t.hasChildNodes()||!Tc(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(Ri),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},Bc=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,_c(c,i,r))return!0;if(s[o]>u.length-1)return!!_c(c,i,r)||Rc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},Dc=function(e){return Oo.isText(e)&&0<e.data.length},Oc=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):Dc(c.nextSibling)?(r=c.nextSibling,o=0):Dc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):Dc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,It.each(It.grep(c.childNodes),function(e){Oo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&Oo.isText(a)&&!ve.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(La(u,s))}return A.none()},Pc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p,g,h,v,y=e.dom;if(t){if(v=t,It.isArray(v.start))return g=t,h=(p=y).createRng(),Bc(p,!0,g,h)&&Bc(p,!1,g,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=y).createRng(),m=mc(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=mc(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=Oc(o=y,"start",i=t),c=Oc(o,"end",i),ma([s,(a=c,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(Ac(o,e.container()),e.offset()),n.setEnd(Ac(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=y,r=t,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.none()},Lc=function(e,t,n){return Ec.getBookmark(e,t,n)},Ic=function(t,e){Pc(t,e).each(function(e){t.setRng(e)})},Mc=function(e){return Oo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Fc=It.each,zc=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Fc(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||Mc(e)||Mc(t))}},Uc=function(t,e){H.each(e,function(e){Hu.before(t,e)})},qc=function(t,e){H.each(e,function(e){Hu.append(t,e)})},Vc=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Hc={empty:function(e){e.dom().textContent="",H.each($r.children(e),function(e){Vc(e)})},remove:Vc,unwrap:function(e){var t=$r.children(e);0<t.length&&Uc(e,t),Vc(e)}},jc=(Ps=Zn.isText,Ls="text",Is=function(e){return Ps(e)?A.from(e.dom().nodeValue):A.none()},Ms=Un.detect().browser,{get:function(e){if(!Ps(e))throw new Error("Can only get "+Ls+" value of a "+Ls+" node");return Fs(e).getOr("")},getOption:Fs=Ms.isIE()&&10===Ms.version.major?function(e){try{return Is(e)}catch(Dw){return A.none()}}:Is,set:function(e,t){if(!Ps(e))throw new Error("Can only set raw "+Ls+" value of a "+Ls+" node");e.dom().nodeValue=t}}),$c=function(e){return jc.get(e)},Wc=function(e){var t=hu(e,"br"),n=H.filter(function(e){for(var t=[],n=e.dom();n;)t.push(Vn.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),go);t.length===n.length&&H.each(n,Hc.remove)},Kc=function(e){Hc.empty(e),Hu.append(e,Vn.fromHtml('<br data-mce-bogus="1">'))},Xc=function(n){$r.lastChild(n).each(function(t){$r.prevSibling(t).each(function(e){mo(n)&&go(t)&&mo(e)&&Hc.remove(t)})})},Yc=It.makeMap;function Gc(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=Yc(e.indent_before||""),c=Yc(e.indent_after||""),l=Ko.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function Jc(t,p){void 0===p&&(p=oi());var g=Gc(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},g.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=p.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(g.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);g.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),g.getContent()}}}var Qc=function(a){var u=La.fromRangeStart(a),s=La.fromRangeEnd(a),c=a.commonAncestorContainer;return Qa.fromPosition(!1,c,s).map(function(e){return!bs(u,s,c)&&bs(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},Zc=function(e){return e.collapsed?e:Qc(e)},el=Oo.matchNodeNames("td th"),tl=function(o,e,t){var n,r,i,a,u,s,c,l,f,d,m,p,g=o.schema.getTextInlineElements(),h=o.selection,v=o.dom;if(/^ | $/.test(e)&&(e=function(e){var t,n,r;t=h.getRng(),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?e=e.replace(/^&nbsp;/," "):o("previousSibling")||(e=e.replace(/^ /,"&nbsp;")),r<n.length?e=e.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(e=e.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),e}(e)),n=o.parser,p=t.merge,r=Jc({validate:o.settings.validate},o.schema),m='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',s={content:e,format:"html",selection:!0,paste:t.paste},(s=o.fire("BeforeSetContent",s)).isDefaultPrevented())o.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=s.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,m);var y,b,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=o.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(y=N.firstChild)&&!o.schema.getShortEndedElements()[y.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(o.selection.setRng(Zc(o.selection.getRng())),o.getDoc().execCommand("Delete",!1,null),C=(b=h.getRng()).startContainer,x=b.startOffset,3===C.nodeType&&b.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))));var E,S,k,T={context:(i=h.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0};if(u=n.parse(e,T),!0===t.paste&&nc(o.schema,u)&&oc(v,i))return l=rc(r,v,o.selection.getRng(),u),o.selection.setRng(l),void o.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!v.isBlock(f.name)){o.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(o._selectionOverrides.showBlockCaretContainer(i),T.invalid){for(h.setContent(m),i=h.getNode(),a=o.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;e=i===a?a.innerHTML:v.getOuterHTML(i),e=r.serialize(n.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return r.serialize(u)}))),i===a?v.setHTML(a,e):v.setOuterHTML(i,e)}else e=r.serialize(u),function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t)}}(o,e,i);!function(){if(p){var n=o.getBody(),r=new zc(v);It.each(v.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==n;t=t.parentNode)g[e.nodeName.toLowerCase()]&&r.compare(t,e)&&v.remove(e,!0)})}}(),function(e){var t,n,r;if(e){if(h.scrollIntoView(e),t=function(e){for(var t=o.getBody();e&&e!==t;e=e.parentNode)if("false"===o.dom.getContentEditable(e))return e;return null}(e))return v.remove(e),h.select(t);l=v.createRng(),(f=e.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),ve.ie||(d=e.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(e),l.setEndBefore(e)),n=v.getParent(e,v.isBlock),v.remove(e),n&&v.isEmpty(n)&&(o.$(n).empty(),l.setStart(n,0),l.setEnd(n,0),el(n)||n.getAttribute("data-mce-fragment")||!(r=function(e){var t=La.fromRangeStart(e);if(t=Ys(o.getBody()).next(t))return t.toRange()}(l))?v.add(n,v.create("br",{"data-mce-bogus":"1"})):(l=r,v.remove(n))),h.setRng(l)}}(v.get("mce_marker")),E=o.getBody(),It.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=o.dom,k=o.selection.getStart(),A.from(S.getParent(k,"td,th")).map(Vn.fromDom).each(Xc),o.fire("SetContent",s),o.addVisual()}},nl=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=It.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};tl(e,o.content,o.details)};function rl(e,t,n,r,o){return e(n,r)?A.some(n):k.isFunction(o)&&o(n)?A.none():t(n,r,o)}var ol=function(e,t,n){for(var r=e.dom(),o=k.isFunction(n)?n:V.constant(!1);r.parentNode;){r=r.parentNode;var i=Vn.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},il=function(e,t){return H.find(e.dom().childNodes,V.compose(t,Vn.fromDom)).map(Vn.fromDom)},al=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(Vn.fromDom(e.childNodes[t])))return A.some(Vn.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return A.none()};return o(e.dom())},ul={first:function(e){return al(mr.body(),e)},ancestor:ol,closest:function(e,t,n){return rl(function(e){return t(e)},ol,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?il(Vn.fromDom(e.parentNode),function(e){return!Mr.eq(t,e)&&n(e)}):A.none()},child:il,descendant:al},sl=kr.immutable("sections","settings"),cl=Un.detect().deviceType.isTouch(),ll=["lists","autolink","autosave"],fl={theme:"mobile"},dl=function(e){var t=k.isArray(e)?e.join(" "):e,n=H.map(k.isString(t)?t.split(" "):[],On);return H.filter(n,function(e){return 0<e.length})},ml=function(e,t){return e.sections().hasOwnProperty(t)},pl=function(e,t,n,r){var o,i,a=dl(n.forced_plugins),u=dl(r.plugins),s=e&&ml(t,"mobile")?(o=u,H.filter(o,V.curry(H.contains,ll))):u,c=(i=s,[].concat(dl(a)).concat(dl(i)));return It.extend(r,{plugins:c.join(" ")})},gl=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,p,g,h,v=(o=["mobile"],i=r,a=ir.bifilter(i,function(e,t){return H.contains(o,t)}),sl(a.t,a.f)),y=It.extend(t,n,v.settings(),(p=e,h=(g=v).settings().inline,p&&ml(g,"mobile")&&!h?(l="mobile",f=fl,d=v.sections(),m=d.hasOwnProperty(l)?d[l]:{},It.extend({},f,m)):{}),{validate:!0,content_editable:v.settings().inline,external_plugins:(u=n,s=v.settings(),c=s.external_plugins?s.external_plugins:{},u&&u.external_plugins?It.extend({},u.external_plugins,c):c)});return pl(e,v,n,y)},hl=function(e,t,n){return A.from(t.settings[n]).filter(e)},vl=V.curry(hl,k.isString),yl=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?H.each(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[It.trim(t[0])]=It.trim(t[1]):a[It.trim(t[0])]=It.trim(t)}):a=i,a):"string"===r?hl(k.isString,e,t).getOr(n):"number"===r?hl(k.isNumber,e,t).getOr(n):"boolean"===r?hl(k.isBoolean,e,t).getOr(n):"object"===r?hl(k.isObject,e,t).getOr(n):"array"===r?hl(k.isArray,e,t).getOr(n):"string[]"===r?hl((o=k.isString,function(e){return k.isArray(e)&&H.forall(e,o)}),e,t).getOr(n):"function"===r?hl(k.isFunction,e,t).getOr(n):u},bl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Cl=function(e,t){var n=t.container(),r=t.offset();return e?Pi(n)?Oo.isText(n.nextSibling)?La(n.nextSibling,0):La.after(n):Mi(t)?La(n,r+1):t:Pi(n)?Oo.isText(n.previousSibling)?La(n.previousSibling,n.previousSibling.data.length):La.before(n):Fi(t)?La(n,r-1):t},xl={isInlineTarget:function(e,t){var n=vl(e,"inline_boundaries_selector").getOr("a[href],code");return Pr.is(Vn.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,H.filter(vi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===vi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,bl.test(t));var t},isAtZwsp:function(e){return Mi(e)||Fi(e)},normalizePosition:Cl,normalizeForwards:V.curry(Cl,!0),normalizeBackwards:V.curry(Cl,!1),hasSameParentBlock:function(e,t,n){var r=ys(t,e),o=ys(n,e);return r&&r===o}},wl=function(e,t){return Mr.contains(e,t)?ul.closest(t,function(e){return ho(e)||yo(e)},(n=e,function(e){return Mr.eq(n,Vn.fromDom(e.dom().parentNode))})):A.none();var n},Nl=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},El=function(i,a,u){return ma([Qa.firstPositionIn(u),Qa.lastPositionIn(u)],function(e,t){var n=xl.normalizePosition(!0,e),r=xl.normalizePosition(!1,t),o=xl.normalizePosition(!1,a);return i?Qa.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):Qa.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Sl=function(e,t,n){return ul.ancestor(e,function(e){return Pr.is(e,t)},n)},kl=Sl,Tl=function(e,t){return Pr.one(t,e)},Al=function(e,t,n){return rl(Pr.is,Sl,e,t,n)},Rl=function(e,t,n){return kl(e,t,n).isSome()},_l=function(e,t){return Oo.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===(n=e,r=t,o=Vn.fromDom(n),i=Vn.fromDom(r),Rl(i,"pre,code",V.curry(Mr.eq,o)));var n,r,o,i},Bl=function(e,t){return Ji(t)&&!1===_l(e,t)||(n=t,Oo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Dl(t);var n},Dl=Oo.hasAttribute("data-mce-bookmark"),Ol=Oo.hasAttribute("data-mce-bogus"),Pl=Oo.hasAttributeValue("data-mce-bogus","all"),Ll=function(e){return function(e){var t,n,r=0;if(Bl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new ao(n,e);do{if(Pl(n))n=t.next(!0);else if(Ol(n))n=t.next();else if(Oo.isBr(n))r++,n=t.next();else{if(Bl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Il=kr.immutable("block","position"),Ml=kr.immutable("from","to"),Fl=function(e,t){var n=Vn.fromDom(e),r=Vn.fromDom(t.container());return wl(n,r).map(function(e){return Il(e,t)})},zl=function(o,i,e){var t=Fl(o,La.fromRangeStart(e)),n=t.bind(function(e){return Qa.fromPosition(i,o,e.position()).bind(function(e){return Fl(o,e).map(function(e){return t=o,n=i,r=e,Oo.isBr(r.position().getNode())&&!1===Ll(r.block())?Qa.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?Qa.fromPosition(n,t,e).bind(function(e){return Fl(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return ma([t,n],Ml).filter(function(e){return r=e,!1===Mr.eq(r.from().block(),r.to().block())&&(n=e,$r.parent(n.from().block()).bind(function(t){return $r.parent(n.to().block()).filter(function(e){return Mr.eq(t,e)})}).isSome())&&(t=e,!1===Oo.isContentEditableFalse(t.from().block())&&!1===Oo.isContentEditableFalse(t.to().block()));var t,n,r})},Ul=function(e,t,n){return n.collapsed?zl(e,t,n):A.none()},ql=function(e,t,n){return Mr.contains(t,e)?$r.parents(e,function(e){return n(e)||Mr.eq(e,t)}).slice(0,-1):[]},Vl=function(e,t){return ql(e,t,V.constant(!1))},Hl=Vl,jl=function(e,t){return[e].concat(Vl(e,t))},$l=function(e){var t,n,r=(t=e,n=$r.children(t),H.findIndex(n,mo).fold(function(){return n},function(e){return n.slice(0,e)}));return H.each(r,function(e){Hc.remove(e)}),r},Wl=function(e,t){Qa.positionIn(e,t.dom()).each(function(e){var t=e.getNode();Oo.isBr(t)&&Hc.remove(Vn.fromDom(t))})},Kl=function(e,t){var n=jl(t,e);return H.find(n.reverse(),Ll).each(Hc.remove)},Xl=function(o,i){return Mr.contains(i,o)?$r.parent(o).bind(function(e){return Mr.eq(e,i)?A.some(o):(t=i,n=o,r=$r.parents(n,function(e){return Mr.eq(e,t)}),A.from(r[r.length-2]));var t,n,r}):A.none()},Yl=function(n,r,o){if(Ll(o))return Hc.remove(o),Ll(r)&&Kc(r),Qa.firstPositionIn(r.dom());Wl(!0,r),Wl(!1,o);var i=$l(r);return Xl(r,o).fold(function(){Kl(n,r);var e=Qa.lastPositionIn(o.dom());return H.each(i,function(e){Hu.append(o,e)}),e},function(t){var e=Qa.prevPosition(o.dom(),La.before(t.dom()));return H.each(i,function(e){Hu.before(t,e)}),Kl(n,r),e})},Gl=function(e,t,n,r){return t?Yl(e,r,n):Yl(e,n,r)},Jl=function(t,n){var e,r=Vn.fromDom(t.getBody());return(e=Ul(r.dom(),n,t.selection.getRng()).bind(function(e){return Gl(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},Ql=function(e,t){var n=Vn.fromDom(t),r=V.curry(Mr.eq,e);return ul.ancestor(n,xo,r).isSome()},Zl=function(e,t){var n,r,o=Qa.prevPosition(e.dom(),La.fromRangeStart(t)).isNone(),i=Qa.nextPosition(e.dom(),La.fromRangeEnd(t)).isNone();return!(Ql(n=e,(r=t).startContainer)||Ql(n,r.endContainer))&&o&&i},ef=function(e){var n,r,o,t,i=Vn.fromDom(e.getBody()),a=e.selection.getRng();return Zl(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ma([wl(n,Vn.fromDom(o.startContainer)),wl(n,Vn.fromDom(o.endContainer))],function(e,t){return!1===Mr.eq(e,t)&&(o.deleteContents(),Gl(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},tf=function(e,t){return!e.selection.isCollapsed()&&ef(e)},nf=function(a){if(!k.isArray(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return H.each(a,function(e,r){var t=ir.keys(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k.isArray(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=ir.keys(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!H.forall(u,function(e){return H.contains(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},rf=nf([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),of=function(e,t,n,r){var o=r.getNode(!1===t);return wl(Vn.fromDom(e),Vn.fromDom(n.getNode())).map(function(e){return Ll(e)?rf.remove(e.dom()):rf.moveToElement(o)}).orThunk(function(){return A.some(rf.moveToElement(o))})},af=function(u,s,c){return Qa.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),xo(Vn.fromDom(a))||yo(Vn.fromDom(a))?A.none():(t=u,o=e,i=function(e){return po(Vn.fromDom(e))&&!bs(r,o,t)},As(!(n=s),r=c).fold(function(){return As(n,o).fold(V.constant(!1),i)},i)?A.none():s&&Oo.isContentEditableFalse(e.getNode())?of(u,s,c,e):!1===s&&Oo.isContentEditableFalse(e.getNode(!0))?of(u,s,c,e):s&&Bs(c)?A.some(rf.moveToPosition(e)):!1===s&&_s(c)?A.some(rf.moveToPosition(e)):A.none());var t,n,r,o,i,a})},uf=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Oo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&Oo.isContentEditableFalse(n.nextSibling)?A.some(rf.moveToElement(n.nextSibling)):!1===t&&Oo.isContentEditableFalse(n.previousSibling)?A.some(rf.moveToElement(n.previousSibling)):A.none()).fold(function(){return af(r,e,o)},A.some):af(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(rf.remove(e))},function(e){return A.some(rf.moveToElement(e))},function(e){return bs(n,e,t)?A.none():A.some(rf.moveToPosition(e))});var t,n});var t,n,i,a,u},sf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===La.isTextPosition(n)&&o===r.parentNode&&i>La.before(r).offset()?La(t.container(),t.offset()-1):t;var n,r,o,i},cf=function(e){return Ji(e.previousSibling)?A.some((t=e.previousSibling,Oo.isText(t)?La(t,t.data.length):La.after(t))):e.previousSibling?Qa.lastPositionIn(e.previousSibling):A.none();var t},lf=function(e){return Ji(e.nextSibling)?A.some((t=e.nextSibling,Oo.isText(t)?La(t,0):La.before(t))):e.nextSibling?Qa.firstPositionIn(e.nextSibling):A.none();var t},ff=function(r,o){return cf(o).orThunk(function(){return lf(o)}).orThunk(function(){return e=r,t=o,n=La.before(t.previousSibling?t.previousSibling:t.parentNode),Qa.prevPosition(e,n).fold(function(){return Qa.nextPosition(e,La.after(t))},A.some);var e,t,n})},df=function(n,r){return lf(r).orThunk(function(){return cf(r)}).orThunk(function(){return e=n,t=r,Qa.nextPosition(e,La.after(t)).fold(function(){return Qa.prevPosition(e,La.before(t))},A.some);var e,t})},mf=function(e,t,n){return(r=e,o=t,i=n,r?df(o,i):ff(o,i)).map(V.curry(sf,n));var r,o,i},pf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},gf=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Zn.name(t))},hf=function(e){if(Ll(e)){var t=Vn.fromHtml('<br data-mce-bogus="1">');return Hc.empty(e),Hu.append(e,t),A.some(La.before(t.dom()))}return A.none()},vf=function(t,n,e){var r,a,o,i=mf(n,t.getBody(),e.dom()),u=ul.ancestor(e,V.curry(gf,t),(r=t.getBody(),function(e){return e.dom()===r})),s=(a=e,o=i,ma([$r.prevSibling(a),$r.nextSibling(a),o],function(e,t,n){var r,o=e.dom(),i=t.dom();return Oo.isText(o)&&Oo.isText(i)?(r=o.data.length,o.appendData(i.data),Hc.remove(t),Hc.remove(a),n.container()===i?La(o,r):n):(Hc.remove(a),n)}).orThunk(function(){return Hc.remove(a),o}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(hf).fold(function(){pf(t,n,s)},function(e){pf(t,n,A.some(e))})},yf=function(a,u){var e,t,n,r,o;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Ss(t?1:-1,e,n),o=La.fromRangeStart(r),!1===t&&Bs(o)?A.some(rf.remove(o.getNode(!0))):t&&_s(o)?A.some(rf.remove(o.getNode())):uf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),vf(o,i,Vn.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?La.before(e):La.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},bf=function(e,t){var n,r=e.selection.getNode();return!!Oo.isContentEditableFalse(r)&&(n=Vn.fromDom(e.getBody()),H.each(hu(n,".mce-offscreen-selection"),Hc.remove),vf(e,t,Vn.fromDom(e.selection.getNode())),Nl(e),!0)},Cf=function(e,t){return e.selection.isCollapsed()?yf(e,t):bf(e,t)},xf=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Oo.isContentEditableTrue(t)||Oo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Oo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(La.before(t).toRange())),!0},wf=Oo.isText,Nf=function(e){return wf(e)&&e.data[0]===Ri},Ef=function(e){return wf(e)&&e.data[e.data.length-1]===Ri},Sf=function(e){return e.ownerDocument.createTextNode(Ri)},kf=function(e,t){return e?function(e){if(wf(e.previousSibling))return Ef(e.previousSibling)||e.previousSibling.appendData(Ri),e.previousSibling;if(wf(e))return Nf(e)||e.insertData(0,Ri),e;var t=Sf(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(wf(e.nextSibling))return Nf(e.nextSibling)||e.nextSibling.insertData(0,Ri),e.nextSibling;if(wf(e))return Ef(e)||e.appendData(Ri),e;var t=Sf(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Tf=V.curry(kf,!0),Af=V.curry(kf,!1),Rf=function(e,t){return Oo.isText(e.container())?kf(t,e.container()):kf(t,e.getNode())},_f=function(e,t){var n=t.get();return n&&e.container()===n&&Pi(n)},Bf=function(n,e){return e.fold(function(e){$a.remove(n.get());var t=Tf(e);return n.set(t),A.some(La(t,t.length-1))},function(e){return Qa.firstPositionIn(e).map(function(e){if(_f(e,n))return La(n.get(),1);$a.remove(n.get());var t=Rf(e,!0);return n.set(t),La(t,1)})},function(e){return Qa.lastPositionIn(e).map(function(e){if(_f(e,n))return La(n.get(),n.get().length-1);$a.remove(n.get());var t=Rf(e,!1);return n.set(t),La(t,t.length-1)})},function(e){$a.remove(n.get());var t=Af(e);return n.set(t),A.some(La(t,1))})},Df=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return A.none()},Of=nf([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Pf=function(e,t){var n=ys(t,e);return n||e},Lf=function(e,t,n){var r=xl.normalizeForwards(n),o=Pf(t,r.container());return xl.findRootInline(e,o,r).fold(function(){return Qa.nextPosition(o,r).bind(V.curry(xl.findRootInline,e,o)).map(function(e){return Of.before(e)})},A.none)},If=function(e,t){return null===Tc(e,t)},Mf=function(e,t,n){return xl.findRootInline(e,t,n).filter(V.curry(If,t))},Ff=function(e,t,n){var r=xl.normalizeBackwards(n);return Mf(e,t,r).bind(function(e){return Qa.prevPosition(e,r).isNone()?A.some(Of.start(e)):A.none()})},zf=function(e,t,n){var r=xl.normalizeForwards(n);return Mf(e,t,r).bind(function(e){return Qa.nextPosition(e,r).isNone()?A.some(Of.end(e)):A.none()})},Uf=function(e,t,n){var r=xl.normalizeBackwards(n),o=Pf(t,r.container());return xl.findRootInline(e,o,r).fold(function(){return Qa.prevPosition(o,r).bind(V.curry(xl.findRootInline,e,o)).map(function(e){return Of.after(e)})},A.none)},qf=function(e){return!1===xl.isRtl(Hf(e))},Vf=function(e,t,n){return Df([Lf,Ff,zf,Uf],[e,t,n]).filter(qf)},Hf=function(e){return e.fold(V.identity,V.identity,V.identity,V.identity)},jf=function(e){return e.fold(V.constant("before"),V.constant("start"),V.constant("end"),V.constant("after"))},$f=function(e){return e.fold(Of.before,Of.before,Of.after,Of.after)},Wf=function(n,e,r,t,o,i){return ma([xl.findRootInline(e,r,t),xl.findRootInline(e,r,o)],function(e,t){return e!==t&&xl.hasSameParentBlock(r,e,t)?Of.after(n?e:t):i}).getOr(i)},Kf=function(e,r){return e.fold(V.constant(!0),function(e){return n=r,!(jf(t=e)===jf(n)&&Hf(t)===Hf(n));var t,n})},Xf=function(e,t){return e?t.fold(V.compose(A.some,Of.start),A.none,V.compose(A.some,Of.after),A.none):t.fold(A.none,V.compose(A.some,Of.before),A.none,V.compose(A.some,Of.end))},Yf=function(a,u,s,c){var e=xl.normalizePosition(a,c),l=Vf(u,s,e);return Vf(u,s,e).bind(V.curry(Xf,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=xl.normalizePosition(t,e),Qa.fromPosition(t,r,i).map(V.curry(xl.normalizePosition,t)).fold(function(){return o.map($f)},function(e){return Vf(n,r,e).map(V.curry(Wf,t,n,r,i,e)).filter(V.curry(Kf,o))}).filter(qf);var t,n,r,o,e,i})},Gf=Vf,Jf=Yf,Qf=(V.curry(Yf,!1),V.curry(Yf,!0),$f),Zf=function(e){return e.fold(Of.start,Of.start,Of.end,Of.end)},ed=function(e){return k.isFunction(e.selection.getSel().modify)},td=function(e,t,n){var r=e?1:-1;return t.setRng(La(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},nd=function(e,t){var n=t.selection.getRng(),r=e?La.fromRangeEnd(n):La.fromRangeStart(n);return!!ed(t)&&(e&&Mi(r)?td(!0,t.selection,r):!(e||!Fi(r))&&td(!1,t.selection,r))},rd=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},od=function(e){return!1!==e.settings.inline_boundaries},id=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},ad=function(t,e,n){return Bf(e,n).map(function(e){return rd(t,e),n})},ud=function(e,t,n){return function(){return!!od(t)&&nd(e,t)}},sd={move:function(a,u,s){return function(){return!!od(a)&&(t=a,n=u,e=s,r=t.getBody(),o=La.fromRangeStart(t.selection.getRng()),i=V.curry(xl.isInlineTarget,t),Jf(e,i,r,o).bind(function(e){return ad(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:V.curry(ud,!0),movePrevWord:V.curry(ud,!1),setupSelectedState:function(a){var u=ns(null),s=V.curry(xl.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;od(a)&&(t=s,n=a.dom,r=e.parents,o=H.filter(n.select('*[data-mce-selected="inline-boundary"]'),t),i=H.filter(r,t),H.each(H.difference(o,i),V.curry(id,!1)),H.each(H.difference(i,o),V.curry(id,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=La.fromRangeStart(e.selection.getRng());La.isTextPosition(n)&&!1===xl.isAtZwsp(n)&&(rd(e,$a.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=H.filter(e,n);H.each(t,function(e){var t=La.fromRangeStart(r.selection.getRng());Gf(n,r.getBody(),t).bind(function(e){return ad(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:rd},cd=function(t,n){return function(e){return Bf(n,e).map(function(e){return sd.setCaretPosition(t,e),!0}).getOr(!1)}},ld=function(r,o,i,a){var u=r.getBody(),s=V.curry(xl.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Gf(s,u,La.fromRangeStart(r.selection.getRng())).map(Zf).map(cd(r,o))}),r.nodeChanged()},fd=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),ys(t,e)||e),u=V.curry(xl.isInlineTarget,n),s=Gf(u,a,o);return s.bind(function(e){return i?e.fold(V.constant(A.some(Zf(e))),A.none,V.constant(A.some(Qf(e))),A.none):e.fold(A.none,V.constant(A.some(Qf(e))),A.none,V.constant(A.some(Zf(e))))}).map(cd(n,r)).getOrThunk(function(){var t=Qa.navigate(i,a,o),e=t.bind(function(e){return Gf(u,a,e)});return s.isSome()&&e.isSome()?xl.findRootInline(u,a,o).map(function(e){return o=e,!!ma([Qa.firstPositionIn(o),Qa.lastPositionIn(o)],function(e,t){var n=xl.normalizePosition(!0,e),r=xl.normalizePosition(!1,t);return Qa.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(vf(n,i,Vn.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?ld(n,r,o,e):ld(n,r,e,o),!0})}).getOr(!1)})},dd=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=La.fromRangeStart(e.selection.getRng());return fd(e,t,n,r)}return!1},md=kr.immutable("start","end"),pd=kr.immutable("rng","table","cells"),gd=nf([{removeTable:["element"]},{emptyCells:["cells"]}]),hd=function(e,t){return Al(Vn.fromDom(e),"td,th",t)},vd=function(e,t){return kl(e,"table",t)},yd=function(e){return!1===Mr.eq(e.start(),e.end())},bd=function(e,n){return vd(e.start(),n).bind(function(t){return vd(e.end(),n).bind(function(e){return Mr.eq(t,e)?A.some(t):A.none()})})},Cd=function(e){return hu(e,"td,th")},xd=function(r,e){var t=hd(e.startContainer,r),n=hd(e.endContainer,r);return e.collapsed?A.none():ma([t,n],md).fold(function(){return t.fold(function(){return n.bind(function(t){return vd(t,r).bind(function(e){return H.head(Cd(e)).map(function(e){return md(e,t)})})})},function(t){return vd(t,r).bind(function(e){return H.last(Cd(e)).map(function(e){return md(t,e)})})})},function(e){return wd(r,e)?A.none():(n=r,vd((t=e).start(),n).bind(function(e){return H.last(Cd(e)).map(function(e){return md(t.start(),e)})}));var t,n})},wd=function(e,t){return bd(t,e).isSome()},Nd=function(e,t){var n,r,o,i,a,u=(n=e,V.curry(Mr.eq,n));return(r=t,o=u,i=hd(r.startContainer,o),a=hd(r.endContainer,o),ma([i,a],md).filter(yd).filter(function(e){return wd(o,e)}).orThunk(function(){return xd(o,r)})).bind(function(e){return bd(t=e,u).map(function(e){return pd(t,e,Cd(e))});var t})},Ed=function(e,t){return H.findIndex(e,function(e){return Mr.eq(e,t)})},Sd=function(n){return(r=n,ma([Ed(r.cells(),r.rng().start()),Ed(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?gd.removeTable(n.table()):gd.emptyCells(e)});var r},kd=function(e,t){return Nd(e,t).bind(Sd)},Td=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Ad=Td,Rd=function(e){return H.bind(e,function(e){var t=aa(e);return t?[Vn.fromDom(t)]:[]})},_d=function(e){return 1<Td(e).length},Bd=function(e){return H.filter(Rd(e),xo)},Dd=function(e){return hu(e,"td[data-mce-selected],th[data-mce-selected]")},Od=function(e,t){var n=Dd(t),r=Bd(e);return 0<n.length?n:r},Pd=Od,Ld=function(e){return Od(Ad(e.selection.getSel()),Vn.fromDom(e.getBody()))},Id=function(e,t){return H.each(t,Kc),e.selection.setCursorLocation(t[0].dom(),0),!0},Md=function(e,t){return vf(e,!1,t),!0},Fd=function(n,e,r,t){return Ud(e,t).fold(function(){return t=n,kd(e,r).map(function(e){return e.fold(V.curry(Md,t),V.curry(Id,t))});var t},function(e){return qd(n,e)}).getOr(!1)},zd=function(e,t){return H.find(jl(t,e),xo)},Ud=function(e,t){return H.find(jl(t,e),function(e){return"caption"===Zn.name(e)})},qd=function(e,t){return Kc(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Vd=function(u,s,c,l,f){return Qa.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,Qa.firstPositionIn(r.dom()).bind(function(t){return Qa.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?qd(u,l):(t=l,n=e,Ud(s,Vn.fromDom(n.getNode())).map(function(e){return!1===Mr.eq(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},Hd=function(a,u,s,e){var c=La.fromRangeStart(a.selection.getRng());return zd(s,e).bind(function(e){return Ll(e)?qd(a,e):(t=a,n=s,r=u,o=e,i=c,Qa.navigate(r,t.getBody(),i).bind(function(e){return zd(n,Vn.fromDom(e.getNode())).map(function(e){return!1===Mr.eq(e,o)})}));var t,n,r,o,i})},jd=function(a,u,e){var s=Vn.fromDom(a.getBody());return Ud(s,e).fold(function(){return Hd(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=La.fromRangeStart(t.selection.getRng()),Ll(o)?qd(t,o):Vd(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},$d=function(e,t){var n,r,o,i,a,u=Vn.fromDom(e.selection.getStart(!0)),s=Ld(e);return e.selection.isCollapsed()&&0===s.length?jd(e,t,u):(n=e,r=u,o=Vn.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Ld(n)).length?Id(n,a):Fd(n,o,i,r))},Wd=function(e,t){e.getDoc().execCommand(t,!1,null)},Kd=function(e){Cf(e,!1)||dd(e,!1)||Jl(e,!1)||$d(e)||tf(e,!1)||(Wd(e,"Delete"),Nl(e))},Xd=function(e){Cf(e,!0)||dd(e,!0)||Jl(e,!0)||$d(e)||tf(e,!0)||Wd(e,"ForwardDelete")},Yd=function(s){return function(u,e){return A.from(e).map(Vn.fromDom).filter(Zn.isElement).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return Cr(e,r)},ul.closest(Vn.fromDom(i),function(e){return a(e).isSome()},function(e){return Mr.eq(Vn.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),A.from(vi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},Gd={getFontSize:Yd("font-size"),getFontFamily:V.compose(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},Yd("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},Jd=function(e){return Qa.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Oo.isText(t)?t.parentNode:t})},Qd=function(o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},Zd=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=zu(e),o=Uu(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},em=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},tm=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},nm=function(e,t,n){return tm(e,t,function(e){return e.nodeName===n})},rm=function(e){return e&&"TABLE"===e.nodeName},om=function(e,t,n){for(var r=new ao(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Oo.isBr(t))return!0},im=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&Oo.isBr(o)&&t&&e.isEmpty(u))return A.some(Da(o.parentNode,e.nodeIndex(o)));for(i=new ao(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Li(c=s)&&!1===tm(c,l,kc)))return A.none();if(Oo.isText(s)&&0<s.nodeValue.length)return!1===nm(s,f,"A")?A.some(Da(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(Da(a,0)):A.none()},am=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,p=e.getRoot(),g=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Oo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Li(o))return A.none();if(Oo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Oo.isDocument(o)&&(o=p,i=0),o===p){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Li(u))return A.none();if(s[u.nodeName]||rm(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Oo.isText(o)&&l?o.data.length:0,!t&&o===p.lastChild&&rm(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(Oo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(p,o)||Li(o))return A.none();if(o.hasChildNodes()&&!1===rm(o)){a=new ao(u=o,p);do{if(Oo.isContentEditableFalse(u)||Li(u)){g=!1;break}if(Oo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,g=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,g=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Oo.isText(o)&&0===i&&im(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),Oo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Oo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||om(e,u,!1)||om(e,u,!0)||im(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),g=!0}))),c&&!t&&Oo.isText(o)&&i===o.nodeValue.length&&im(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),g?A.some(Da(o,i)):A.none()},um=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Da.fromRangeStart(t);return am(e,n,!0,r).each(function(e){n&&Da.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||am(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),em(t,r)?A.none():A.some(r)},sm=function(e,t,n){var r=e.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},cm=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},lm=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();um(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new ao(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),sm(i,o,n),cm(i,o,n,r),e.undoManager.add()},fm=function(e,t){var n=Vn.fromTag("br");Hu.before(Vn.fromDom(t),n),e.undoManager.add()},dm=function(e,t){mm(e.getBody(),t)||Hu.after(Vn.fromDom(t),Vn.fromTag("br"));var n=Vn.fromTag("br");Hu.after(Vn.fromDom(t),n),sm(e.dom,e.selection,n.dom()),cm(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},mm=function(e,t){return n=La.after(t),!!Oo.isBr(n.getNode())||Qa.nextPosition(e,La.after(t)).map(function(e){return Oo.isBr(e.getNode())}).getOr(!1);var n},pm=function(e){return e&&"A"===e.nodeName&&"href"in e},gm=function(e){return e.fold(V.constant(!1),pm,pm,V.constant(!1))},hm=function(e,t){t.fold(V.noop,V.curry(fm,e),V.curry(dm,e),V.noop)},vm=function(e,t){var n,r,o,i=(n=e,r=V.curry(xl.isInlineTarget,n),o=La.fromRangeStart(n.selection.getRng()),Gf(r,n.getBody(),o).filter(gm));i.isSome()?i.each(V.curry(hm,e)):lm(e,t)},ym=nf([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bm=(ym.before,ym.on,ym.after,function(e){return e.fold(V.identity,V.identity,V.identity)}),Cm=nf([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),xm=kr.immutable("start","soffset","finish","foffset"),wm={domRange:Cm.domRange,relative:Cm.relative,exact:Cm.exact,exactFromRange:function(e){return Cm.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:xm,getWin:function(e){var t=e.match({domRange:function(e){return Vn.fromDom(e.startContainer)},relative:function(e,t){return bm(e)},exact:function(e,t,n,r){return e}});return $r.defaultView(t)}},Nm=Un.detect().browser,Em=function(e,t){var n=Zn.isText(t)?$c(t).length:$r.children(t).length+1;return n<e?n:e<0?0:e},Sm=function(e){return wm.range(e.start(),Em(e.soffset(),e.start()),e.finish(),Em(e.foffset(),e.finish()))},km=function(e,t){return Mr.contains(e,t)||Mr.eq(e,t)},Tm=function(t){return function(e){return km(t,e.start())&&km(t,e.finish())}},Am=function(e){return!0===e.inline||Nm.isIE()},Rm=function(e){return wm.range(Vn.fromDom(e.startContainer),e.startOffset,Vn.fromDom(e.endContainer),e.endOffset)},_m=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map(Rm)},Bm=function(e){var t=$r.defaultView(e);return _m(t.dom()).filter(Tm(e))},Dm=function(e,t){return A.from(t).filter(Tm(e)).map(Sm)},Om=function(e){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},Pm=function(e){return(e.bookmark?e.bookmark:A.none()).bind(V.curry(Dm,Vn.fromDom(e.getBody()))).bind(Om)},Lm=function(e){var t=Am(e)?Bm(Vn.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},Im=function(t){Pm(t).each(function(e){t.selection.setRng(e)})},Mm=Pm,Fm=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||(n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),H.each(o.getSelectedBlocks(),function(e){return function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)&&"LI"!==i.nodeName){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e)}))},zm=It.each,Um=It.extend,qm=It.map,Vm=It.inArray;function Hm(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",zm(e,function(t,e){zm(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};Um(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?Im(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(zm(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},p=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");ve.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),zm("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),p()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:Zd(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:Zd(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),p())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){nl(s,n)},mceInsertRawHTML:function(e,t,n){var r=s.getContent();i.setContent("tiny_mce_marker"),s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){Fm(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Oo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Kd(s)},forwardDelete:function(){Xd(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return vm(s,n),!0}});var g=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=qm(e,function(e){return!!a.matchNode(e,n)});return-1!==Vm(t,!0)}};e({JustifyLeft:g("alignleft"),JustifyCenter:g("aligncenter"),JustifyRight:g("alignright"),JustifyFull:g("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return Qd(t=s).fold(function(){return Jd(t).map(function(e){return Gd.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return Gd.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return Qd(t=s).fold(function(){return Jd(t).map(function(e){return Gd.getFontSize(t.getBody(),e)}).getOr("")},function(e){return Gd.getFontSize(t.getBody(),e)});var t},this)}var jm=It.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),$m=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&It.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};$m.isNative=function(e){return!!jm[e.toLowerCase()]};var Wm,Km=function(n){return n._eventDispatcher||(n._eventDispatcher=new $m({scope:n,toggleEvent:function(e,t){$m.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},Xm={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Km(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Km(this).on(e,t,n)},off:function(e,t){return Km(this).off(e,t)},once:function(e,t){return Km(this).once(e,t)},hasEventListeners:function(e){return Km(this).has(e)}},Ym=function(e,t){var n=lr.get(e,t);return n===undefined||""===n?[]:n.split(" ")},Gm=Ym,Jm=function(e,t,n){var r=Ym(e,t).concat([n]);lr.set(e,t,r.join(" "))},Qm=function(e,t,n){var r=H.filter(Ym(e,t),function(e){return e!==n});0<r.length?lr.set(e,t,r.join(" ")):lr.remove(e,t)},Zm=function(e){return Gm(e,"class")},ep=function(e,t){return Jm(e,"class",t)},tp=function(e,t){return Qm(e,"class",t)},np=Zm,rp=ep,op=tp,ip=function(e,t){H.contains(Zm(e),t)?tp(e,t):ep(e,t)},ap=function(e){return e.dom().classList!==undefined},up=function(e,t){return ap(e)&&e.dom().classList.contains(t)},sp={add:function(e,t){ap(e)?e.dom().classList.add(t):rp(e,t)},remove:function(e,t){var n;ap(e)?e.dom().classList.remove(t):op(e,t),0===(ap(n=e)?n.dom().classList:np(n)).length&&lr.remove(n,"class")},toggle:function(e,t){return ap(e)?e.dom().classList.toggle(t):ip(e,t)},toggler:function(e,t){var n,r,o,i,a,u,s=ap(e),c=e.dom().classList;return n=function(){s?c.remove(t):op(e,t)},r=function(){s?c.add(t):rp(e,t)},o=up(e,t),i=o||!1,{on:a=function(){r(),i=!0},off:u=function(){n(),i=!1},toggle:function(){(i?u:a)()},isOn:function(){return i}}},has:up},cp=function(e,t){return e.fire("PreProcess",t)},lp=function(e,t){return e.fire("PostProcess",t)},fp=function(e){return e.fire("remove")},dp=function(e,t){return e.fire("SwitchMode",{mode:t})},mp=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},pp=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},gp=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},hp=function(e,t){var n,r,o;n=Vn.fromDom(e.getBody()),r="mce-content-readonly",o=t,sp.has(n,r)&&!1===o?sp.remove(n,r):o&&sp.add(n,r),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",gp(e,"StyleWithCSS",!1),gp(e,"enableInlineTableEditing",!1),gp(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},vp=function(e){return e.readonly?"readonly":"design"},yp=vi.DOM,bp=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=yp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},Cp=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},xp=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=bp(i,a),i.settings.event_root){if(Wm||(Wm={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&Wm){for(e in Wm)i.dom.unbind(bp(i,e));Wm=null}})),Wm[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||yp.isChildOf(t,o))&&Cp(n[r],a,e)}},Wm[a]=t,yp.bind(e,a,t)}else t=function(e){Cp(i,a,e)},yp.bind(e,a,t),i.delegates[a]=t},wp={bindPendingEventDelegates:function(){var t=this;It.each(t._pendingNativeEvents,function(e){xp(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?xp(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(bp(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(bp(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},Np=wp=It.extend({},Xm,wp),Ep=It.each,Sp=It.explode,kp={f9:120,f10:121,f11:122},Tp=It.makeMap("alt,ctrl,shift,meta,access");function Ap(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Ep(Sp(e,"+"),function(e){e in Tp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=kp[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Tp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,ve.mac?r.ctrl=!0:r.shift=!0),r.meta&&(ve.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=It.map(Sp(e,">"),u))[o.length-1]=It.extend(o[o.length-1],{func:n,scope:r||i}),It.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Ep(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:It.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Ep(Sp(It.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Rp=function(e){var t=e!==undefined?e.dom():document;return A.from(t.activeElement).map(Vn.fromDom)},_p=function(e){var t=$r.owner(e).dom();return e.dom()===t.activeElement},Bp=function(t){return Rp($r.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},Dp=function(t,e){return(n=e,n.collapsed?A.from(ua(n.startContainer,n.startOffset)).map(Vn.fromDom):A.none()).bind(function(e){return Co(e)?A.some(e):!1===Mr.contains(t,e)?A.some(t):A.none()});var n},Op=function(t,e){Dp(Vn.fromDom(t.getBody()),e).bind(function(e){return Qa.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Pp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Lp=function(e){var t,n=e.getBody();return n&&(t=Vn.fromDom(n),_p(t)||Bp(t).isSome())},Ip=function(e){return e.inline?Lp(e):(t=e).iframeElement&&_p(Vn.fromDom(t.iframeElement));var t},Mp=function(e){return e.editorManager.setActive(e)},Fp=function(e,t){e.removed||(t?Mp(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return Pp(u),Op(t,o),Mp(t);t.bookmark!==undefined&&!1===Ip(t)&&Mm(t).each(function(e){t.selection.setRng(e),o=e}),n||(ve.opera||Pp(r),t.getWin().focus()),(ve.gecko||n)&&(Pp(r),Op(t,o)),Mp(t)}(e))},zp=Ip,Up=function(e,t){return t.dom()[e]},qp=function(e,t){return parseInt(br(t,e),10)},Vp=V.curry(Up,"clientWidth"),Hp=V.curry(Up,"clientHeight"),jp=V.curry(qp,"margin-top"),$p=V.curry(qp,"margin-left"),Wp=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m=Vn.fromDom(e.getBody()),p=e.inline?m:$r.documentElement(m),g=(r=e.inline,i=t,a=n,u=(o=p).dom().getBoundingClientRect(),{x:i-(r?u.left+o.dom().clientLeft+$p(o):0),y:a-(r?u.top+o.dom().clientTop+jp(o):0)});return c=g.x,l=g.y,f=Vp(s=p),d=Hp(s),0<=c&&0<=l&&c<=f&&l<=d},Kp=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(Vn.fromDom)).map(function(e){return Mr.contains($r.owner(e),e)}).getOr(!1)};function Xp(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){H.findIndex(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Kp(n))return H.find(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){we.requestAnimationFrame(a)}),t.on("remove",function(){H.each(o,function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function Yp(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){H.findIndex(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return A.from(o[o.length-1])};return r.on("remove",function(){H.each(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Lm(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var Gp=Si.PluginManager,Jp=function(e,t){var n=function(e,t){for(var n in Gp.urls)if(Gp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},Qp=function(e,t){e.notificationManager.open({type:"error",text:t})},Zp=function(e,t){e._skinLoaded?Qp(e,t):e.on("SkinLoaded",function(){Qp(e,t)})},eg=function(e,t){Zp(e,Jp(e,t))},tg=function(e,t){Zp(e,"Failed to upload image: "+t)},ng=Zp,rg=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},og=Si.PluginManager,ig=Si.ThemeManager;function ag(){return new(W.getOrDie("XMLHttpRequest"))}function ug(u,s){var r={},n=function(e,r,o,t){var i,n;(i=new ag).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){It.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=It.grep(e,function(e){return!u.isUploaded(e.blobUri())}),ye.all(It.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new ye(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new ye(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return s=It.extend({credentials:!1,handler:n},s),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new ye(function(e){e([])})}}}function sg(e,t){return new(W.getOrDie("Blob"))(e,t)}function cg(){return new(W.getOrDie("FileReader"))}function lg(e){return new(W.getOrDie("Uint8Array"))(e)}var fg=function(e){return W.getOrDie("atob")(e)},dg=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},mg=function(e){return 0===e.indexOf("blob:")?(i=e,new ye(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=new ag;r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?(o=e,new ye(function(e){var t,n,r;o=dg(o);try{t=fg(o.data)}catch(Dw){return void e(new sg([]))}for(n=new lg(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new sg([n],{type:o.type}))})):null;var i,o},pg=function(n){return new ye(function(e){var t=new cg;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},gg=dg,hg=0,vg=function(e){return(e||"blobid")+hg++},yg=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=gg(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):mg(r.src).then(function(e){a=n.create(vg(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):mg(r.src).then(function(t){pg(t).then(function(e){i=gg(e).data,a=n.create(vg(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},bg=function(e){return e?e.getElementsByTagName("img"):[]},Cg=0,xg={uuid:function(e){return e+Cg+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function wg(u){var n,o,i,t,e,a,r,s,c,l,f=(n=[],o=da.constant,i=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||xg.uuid("blobid"),n=e.name||t,{id:o(t),name:o(n),filename:o(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:o(e.blob),base64:o(e.base64),blobUri:o(e.blobUri||X.createObjectURL(e.blob)),uri:o(e.uri)}},{create:function(e,t,n,r){return i("object"==typeof e?e:{id:e,name:r,blob:t,base64:n})},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return Bt.filter(n,e)[0]},removeByUri:function(t){n=Bt.filter(n,function(e){return e.blobUri()!==t||(X.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){Bt.each(n,function(e){X.revokeObjectURL(e.blobUri())}),n=[]}}),d=u.settings,m=(s={},c=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:l=function(e){return e in s},getResultUri:function(e){var t=s[e];return t?t.resultUri:null},isPending:function(e){return!!l(e)&&1===s[e].status},isUploaded:function(e){return!!l(e)&&2===s[e].status},markPending:function(e){s[e]=c(1,null)},markUploaded:function(e,t){s[e]=c(2,t)},removeFailed:function(e){delete s[e]},destroy:function(){s={}}}),p=function(t){return function(e){return u.selection?t(e):[]}},g=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},h=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},v=function(t,n){Bt.each(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=Bt.map(e.fragments,function(e){return h(e,t,n)}):e.content=h(e.content,t,n)})},y=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},b=function(e,t){f.removeByUri(e.src),v(e.src,t),u.$(e).attr({src:d.images_reuse_filename?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},C=function(n){return a||(a=ug(m,{url:d.images_upload_url,basePath:d.images_upload_base_path,credentials:d.images_upload_credentials,handler:d.images_upload_handler})),N().then(p(function(r){var e;return e=Bt.map(r,function(e){return e.blobInfo}),a.upload(e,y).then(p(function(e){var t=Bt.map(e,function(e,t){var n=r[t].image;return e.status&&!1!==u.settings.images_replace_blob_uris?b(n,e.url):e.error&&tg(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},x=function(e){if(!1!==d.automatic_uploads)return C(e)},w=function(e){return!d.images_dataimg_filter||d.images_dataimg_filter(e)},N=function(){var o,i,a;return r||(o=m,i=f,a={},r={findAll:function(e,n){var t;n||(n=da.constant(!0)),t=Bt.filter(bg(e),function(e){var t=e.src;return!!ve.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===ve.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t):0===t.indexOf("data:")&&n(e))});var r=Bt.map(t,function(n){if(a[n.src])return new ye(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new ye(function(e,t){yg(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return ye.all(r)}}),r.findAll(u.getBody(),w).then(p(function(e){return e=Bt.filter(e,function(e){return"string"!=typeof e||(ng(u,e),!1)}),Bt.each(e,function(e){v(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},E=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=m.getResultUri(n);if(t)return'src="'+t+'"';var r=f.getByUri(n);return r||(r=Bt.reduce(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){!1!==u.settings.automatic_uploads?x():N()}),u.on("RawSaveContent",function(e){e.content=E(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=E(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){Bt.each(e,function(e){var t=e.attr("src");if(!f.getByUri(t)){var n=m.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:f,uploadImages:C,uploadImagesAuto:x,scanForImages:N,destroy:function(){f.destroy(),m.destroy(),r=a=null}}}var Ng=function(e,t){return e.hasOwnProperty(t.nodeName)},Eg=function(e,t){if(Oo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Ng(e,t.nextSibling)))return!0}return!1},Sg=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,p=e.selection,g=e.schema,h=g.getBlockElements(),v=p.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&Oo.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),g.isValidChild(l,f.toLowerCase())&&(b=h,C=y,x=v,!H.exists(Hl(Vn.fromDom(x),Vn.fromDom(C)),function(e){return Ng(b,e.dom())})))){var b,C,x,w,N;for(n=(t=p.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=zp(e),v=y.firstChild;v;)if(w=h,N=v,Oo.isText(N)||Oo.isElement(N)&&!Ng(w,N)&&!Mc(N)){if(Eg(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),p.setRng(t),e.nodeChanged())}},kg=function(e){e.settings.forced_root_block&&e.on("NodeChange",V.curry(Sg,e))},Tg=function(t){return $r.firstChild(t).fold(V.constant([t]),function(e){return[t].concat(Tg(e))})},Ag=function(t){return $r.lastChild(t).fold(V.constant([t]),function(e){return"br"===Zn.name(e)?$r.prevSibling(e).map(function(e){return[t].concat(Ag(e))}).getOr([]):[t].concat(Ag(e))})},Rg=function(o,e){return ma([(i=e,a=i.startContainer,u=i.startOffset,Oo.isText(a)?0===u?A.some(Vn.fromDom(a)):A.none():A.from(a.childNodes[u]).map(Vn.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Oo.isText(n)?r===n.data.length?A.some(Vn.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(Vn.fromDom))],function(e,t){var n=H.find(Tg(o),V.curry(Mr.eq,e)),r=H.find(Ag(o),V.curry(Mr.eq,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},_g=function(e,t,n,r){var o=n,i=new ao(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==It.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(ve.ie&&ve.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Bg=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Dg(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&em(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!ve.range&&i.selection.isCollapsed()||Bg(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&Bg(i)&&("IMG"===i.selection.getNode().nodeName?we.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Og,Pg,Lg=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Ig=function(e,t){return n=(u=e).inline?Lg(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Lg(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},Mg=Oo.isContentEditableFalse,Fg=Oo.isContentEditableTrue,zg=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Ug=function(u,s){return function(e){if(0===e.button){var t=Bt.find(s.dom.getParents(e.target),da.or(Mg,Fg));if(i=s.getBody(),Mg(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},qg=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!Mg(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){zg(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Vg(l)}},Vg=function(e){e.dragging=!1,e.element=null,zg(e.ghost)},Hg=function(e){var t,n,r,o,i,a,g,h,v,u,s,c={};t=vi.DOM,a=document,n=Ug(c,e),g=c,h=e,v=we.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-g.screenX),Math.abs(e.screenY-g.screenY));if(g.element&&!g.dragging&&10<m){if(h.fire("dragstart",{target:g.element}).isDefaultPrevented())return;g.dragging=!0,h.focus()}if(g.dragging){var p=(f=g,{pageX:(d=Ig(h,e)).pageX-f.relX,pageY:d.pageY+5});c=g.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=g.ghost,n=p,r=g.width,o=g.height,i=g.maxX,a=g.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=qg(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Vg(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},jg=function(e){var n;Hg(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Mg(t)||Mg(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},$g=function(e){return Bt.reduce(e,function(e,t){return e.concat(function(t){var e=function(e){return Bt.map(e,function(e){return(e=ta(e)).node=t,e})};if(Oo.isElement(t))return e(t.getClientRects());if(Oo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Pg=Og||(Og={}))[Pg.Up=-1]="Up",Pg[Pg.Down=1]="Down";var Wg=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=$g([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,Bt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=Bt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=vs(r,e,Zi,t);)if(n(r))return}(o,e,r,n)),l},Kg=V.curry(Wg,Og.Up,oa,ia),Xg=V.curry(Wg,Og.Down,ia,oa),Yg=function(n){return function(e){return t=n,e.line>t;var t}},Gg=function(n){return function(e){return t=n,e.line===t;var t}},Jg=Oo.isContentEditableFalse,Qg=vs,Zg=function(e,t){return Math.abs(e.left-t)},eh=function(e,t){return Math.abs(e.right-t)},th=function(e,t){return e>=t.left&&e<=t.right},nh=function(e,o){return Bt.reduce(e,function(e,t){var n,r;return n=Math.min(Zg(e,o),eh(e,o)),r=Math.min(Zg(t,o),eh(t,o)),th(o,t)?t:th(o,e)?e:r===n&&Jg(t.node)?t:r<n?t:e})},rh=function(e,t,n,r){for(;r=Qg(r,e,Zi,t);)if(n(r))return},oh=function(e,t,n){var r,o,i,a,u,s,c,l,f=$g((o=e,Bt.filter(Bt.toArray(o.getElementsByTagName("*")),as))),d=Bt.filter(f,function(e){return n>=e.top&&n<=e.bottom});return(r=nh(d,t))&&(r=nh((u=e,l=function(t,e){var n;return n=Bt.filter($g([e]),function(e){return!t(e,s)}),c=c.concat(n),0===n.length},(c=[]).push(s=r),rh(Og.Up,u,V.curry(l,oa),s.node),rh(Og.Down,u,V.curry(l,ia),s.node),c),t))&&as(r.node)?(a=t,{node:(i=r).node,before:Zg(i,a)<eh(i,a)}):null},ih=function(i,a,e){return!e.collapsed&&H.foldl(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},ah=function(t,n){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){var e=arguments;null===r&&(r=setTimeout(function(){t.apply(null,e),e=r=null},n))}}},uh=function(t){var e=ah(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ou(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},sh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return ve.mac?e.metaKey:e.ctrlKey&&!e.altKey}},ch=Oo.isContentEditableTrue,lh=Oo.isContentEditableFalse,fh=Bs,dh=_s,mh=function(e,t){for(var n=e.getBody();t&&t!==n;){if(ch(t)||lh(t))return t;t=t.parentNode}return null},ph=function(p){var g,e,t,a=p.getBody(),o=is(p.getBody(),function(e){return p.dom.isBlock(e)},function(){return zp(p)}),h="sel-"+p.dom.uniqueId(),u=function(e){e&&p.selection.setRng(e)},s=function(){return p.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),p.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&p.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=Ss(e,a,t),-1===e?La.fromRangeStart(t):La.fromRangeEnd(t)},n=function(e){return Li(e)||Ui(e)||qi(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=p.$,m=p.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),as(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(as(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),as(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(as(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&lh(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),lh(n)?(l=f=n.cloneNode(!0),(s=p.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=Tl(Vn.fromDom(p.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(p.getBody()),e=p.dom.createRng(),l===f&&ve.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,p.getBody()).y}),r[0].focus(),(o=p.selection.getSel()).removeAllRanges(),o.addRange(e),H.each(hu(Vn.fromDom(p.getBody()),"*[data-mce-selected]"),function(e){lr.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),g=n,C(),e)):null)},l=function(){g&&g.removeAttribute("data-mce-selected"),Tl(Vn.fromDom(p.getBody()),"#"+h).each(Hc.remove),g=null},C=function(){o.hide()};return ve.ceFalse&&(function(){p.on("mouseup",function(e){var t=s();t.collapsed&&Wp(p,e.clientX,e.clientY)&&u(ru(p,t,!1))}),p.on("click",function(e){var t;(t=mh(p,e.target))&&(lh(t)&&(e.preventDefault(),p.focus()),ch(t)&&p.dom.isChildOf(t,p.selection.getNode())&&l())}),p.on("blur NewBlock",function(){l()}),p.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=p.dom.getParent(e,p.dom.isBlock),i=p.dom.getParent(t,p.dom.isBlock);return!(!o||!p.dom.isChildOf(o,i)||!1!==lh(mh(p,o)))||o&&(n=o,r=i,!(p.dom.getParent(n,p.dom.isBlock)===p.dom.getParent(r,p.dom.isBlock)))&&function(e){var t=Ys(e);if(!e.firstChild)return!1;var n=La.before(e.firstChild),r=t.next(n);return r&&!dh(r)&&!fh(r)}(o)};r=!1,(n=p).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=mh(n,e.target);lh(t)&&(r||(e.preventDefault(),c(nu(n,t))))}),p.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||p.dom.isChildOf(n,a))&&!1!==Wp(p,e.clientX,e.clientY))if(t=mh(p,n))lh(t)?(e.preventDefault(),c(nu(p,t))):(l(),ch(t)&&e.shiftKey||ih(e.clientX,e.clientY,p.selection.getRng())||(C(),p.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===as(n)){l(),C();var r=oh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);p.getBody().focus(),u(o)}}}),p.on("keypress",function(e){sh.modifierPressed(e)||(e.keyCode,lh(p.selection.getNode())&&e.preventDefault())}),p.on("getSelectionRange",function(e){var t=e.range;if(g){if(!g.parentNode)return void(g=null);(t=t.cloneRange()).selectNode(g),e.range=t}}),p.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),p.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||C(),t=n.startContainer.parentNode,p.dom.hasClass(t,"mce-offscreen-selection")||l()}),p.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!ve.ie){var r=(t=p.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),jg(p),uh(p)}(),e=p.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Vi(e),u(s()),p.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),g=null}}},gh=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function hh(F,z){void 0===z&&(z=oi());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var U=F.comment?F.comment:e,q=F.cdata?F.cdata:e,V=F.text?F.text:e,H=F.start?F.start:e,j=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,p,c,g,l,f,h,v,y,b,C,x,w,N,E,S,k,T,A,R,_=0,B=[],D=0,O=Ko.decode,P=It.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=B.length;t--&&B[t].name!==e;);if(0<=t){for(n=B.length-1;t<=n;n--)(e=B[n]).valid&&j(e.name);B.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in p?t:O(n||r||o||""),g&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=y[t])&&b){for(a=b.length;a--&&!(i=b[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),k=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=z.getShortEndedElements(),E=F.self_closing_elements||z.getSelfClosingElements(),p=z.getBoolAttrs(),g=F.validate,u=F.remove_internals,R=F.fix_self_closing,T=z.getSpecialElements(),N=e+">";t=S.exec(N);){if(_<t.index&&V(O(e.substr(_,t.index-_))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),I(n);else if(n=t[7]){if(t.index+t[0].length>e.length){V(O(e.substr(t.index))),_=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,R&&E[n]&&0<B.length&&B[B.length-1].name===n&&I(n),!g||(l=z.getElementRule(n))){if(f=!0,g&&(y=l.attributes,b=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(k,M)):(d=[]).map={},g&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(A=h.value)&&(A="mce_"+D++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+D++),d.map[a]=A,d.push({name:a,value:A}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){_=gh(z,e,S.lastIndex),S.lastIndex=_;continue}f=!1}}f&&H(n,d,c)}else f=!1;if(r=T[n]){r.lastIndex=_=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(_,t.index-_)),_=t.index+t[0].length):(i=e.substr(_),_=e.length),f&&(0<i.length&&V(i,!0),j(n)),S.lastIndex=_;continue}c||(v&&v.indexOf("/")===v.length-1?f&&j(n):B.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),U(n)):(n=t[2])?q(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);_=t.index+t[0].length}for(_<e.length&&V(O(e.substr(_))),o=B.length-1;0<=o;o--)(n=B[o]).valid&&j(n.name)}}}(hh||(hh={})).findEndTag=gh;var vh=hh,yh=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:vh.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return _i(l)},bh={trimExternal:yh,trimInternal:yh},Ch=0,xh=2,wh=1,Nh=function(p,g){var e=p.length+g.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&p[a]===g[u]?(o.push([0,p[a]]),++a,++u):r-n<t-e?(o.push([2,p[a]]),++a):(o.push([1,g[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,p[s]]);c(i.end,t,i.end-i.diag,r,o)}},y=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&p[o]===g[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&p[c]===g[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return y(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&p[c]===g[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return y(v[s],u+e-n,t,r)}}},t=[];return c(0,p.length,0,g.length,t),t},Eh=function(e){return Oo.isElement(e)?e.outerHTML:Oo.isText(e)?Ko.encodeRaw(e.data,!1):Oo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Sh=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},kh=function(e){return Bt.filter(Bt.map(e.childNodes,Eh),function(e){return 0<e.length})},Th=function(e,t){var n,r,o,i=Bt.map(t.childNodes,Eh);return n=Nh(i,e),r=t,o=0,Bt.each(n,function(e){e[0]===Ch?o++:e[0]===wh?(Sh(r,e[1],o),o++):e[0]===xh&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Ah=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,$r.children(Vn.fromDom(n))},Rh=function(e){return e.dom().innerHTML},_h=Rh,Bh=function(e,t){var n=$r.owner(e).dom(),r=Vn.fromDom(n.createDocumentFragment()),o=Ah(t,n);qc(r,o),Hc.empty(e),Hu.append(e,r)},Dh=ns(A.none()),Oh=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Ph=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Lh=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Ih=function(e){var t=Vn.fromTag("body",Dh.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return Dh.set(A.some(e)),e}));return Bh(t,Lh(e)),H.each(hu(t,"*[data-mce-bogus]"),Hc.unwrap),_h(t)},Mh=function(n){var e,t,r;return e=kh(n.getBody()),-1!==(t=(r=H.bind(e,function(e){var t=bh.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Oh(r):Ph(t)},Fh=function(e,t,n){"fragmented"===t.type?Th(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},zh=function(e,t){return!(!e||!t)&&(r=t,Lh(e)===Lh(r)||(n=t,Ih(e)===Ih(n)));var n,r};function Uh(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===zh(Mh(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=Ec.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=Mh(u),e=e||{},e=It.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&zh(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=Ec.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],Fh(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Fh(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!zh(Mh(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],Fh(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var qh,Vh,Hh=function(e){return e&&/^(IMG)$/.test(e.nodeName)},jh=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},$h=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},Wh={isInlineBlock:Hh,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!Hh(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new ao(u=i[a],e.getParent(u,e.isBlock)):(r=new ao(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!jh(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!jh(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:jh,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:$h,getStyle:function(e,t,n){return $h(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Kh=Mc,Xh=Wh.getParents,Yh=Wh.isWhiteSpaceNode,Gh=Wh.isTextBlock,Jh=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Qh=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Zh=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1===(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)||t||o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},ev=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Zh(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new ao(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3===u.nodeType){if(-1!==(s=Zh(o,i,c=u)))return{container:u,offset:s}}else if(e.isBlock(u))break;if(c)return{container:c,offset:r=o?0:c.length}},tv=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=Xh(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},nv=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&Gh(t,e)},u)}if(o&&e[0].wrapper&&(o=Xh(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Wh.isEq(o,"br")););return o||n},rv=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!Yh(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Kh(c)&&!Yh(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},ov=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=ua(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=ua(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Qh(c,i),u=Qh(c,u),(Kh(i.parentNode)||Kh(i))&&3===(i=(i=Kh(i)?i:i.parentNode).nextSibling||i).nodeType&&(a=0),(Kh(u.parentNode)||Kh(u))&&3===(u=(u=Kh(u)?u:u.parentNode).previousSibling||u).nodeType&&(s=u.length),n[0].inline&&(t.collapsed&&((o=ev(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=ev(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),u=r?u:function(e,t){var n=Jh(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Jh(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=rv(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=rv(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=tv(c,n,t,i,"previousSibling"),u=tv(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=nv(e,n,i,"previousSibling"),u=nv(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=rv(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=rv(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},iv=Wh.isEq,av=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},uv=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!av(t,e,n)||e.parentNode===o||!!lv(t,e,n,r,!0)}),lv(t,e,n,r))},sv=function(e,t,n){return!!iv(t,n.inline)||!!iv(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},cv=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):Wh.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!iv(u,Wh.normalizeStyleValue(e,Wh.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):Wh.getStyle(e,t,c[s]))return n;return n},lv=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],sv(e.dom,t,i)&&cv(l,t,i,"attributes",o,r)&&cv(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},fv={matchNode:lv,matchName:sv,match:function(e,t,n,r){var o;return r?uv(e,r,t,n):(r=e.selection.getNode(),!!uv(e,r,t,n)||!((o=e.selection.getStart())===r||!uv(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&lv(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=Wh.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:av},dv=function(e,t){return e.splitText(t)},mv=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Oo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=dv(t,n)).previousSibling,n<o?(t=r=dv(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Oo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=dv(t,n),n=0),Oo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=dv(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},pv=Ri,gv="_mce_caret",hv=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==pv||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},vv=function(e){var t;if(e)for(e=(t=new ao(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},yv=function(e){var t=Vn.fromTag("span");return lr.setAll(t,{id:gv,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Hu.append(t,Vn.fromText(pv)),t},bv=function(e,t,n,r){var o,i,a,u;o=t.getRng(!0),i=e.getParent(n,e.isBlock),hv(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):((u=vv(n))&&u.nodeValue.charAt(0)===pv&&u.deleteData(0,1),a=u,o.startContainer===a&&0<o.startOffset&&o.setStart(a,o.startOffset-1),o.endContainer===a&&0<o.endOffset&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&Kc(Vn.fromDom(i)),t.setRng(o)},Cv=function(e,t,n,r,o){if(r)bv(t,n,r,o);else if(!(r=Tc(e,n.getStart())))for(;r=t.get(gv);)bv(t,n,r,!1)},xv=function(e,t,n){var r=e.dom,o=r.getParent(n,da.curry(Wh.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Wc(Vn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},wv=function(e,t){return e.appendChild(t),t},Nv=function(e,t){var n=H.foldr(e,function(e,t){return wv(e,t.cloneNode(!1))},t);return wv(n,n.ownerDocument.createTextNode(pv))},Ev=function(e){var i=e.dom,a=e.selection,u=e.getBody();e.on("mouseup keydown",function(e){var t,n,r,o;t=u,n=i,r=a,o=e.keyCode,Cv(t,n,r,null,!1),8===o&&r.isCollapsed()&&r.getStart().innerHTML===pv&&Cv(t,n,r,Tc(t,r.getStart())),37!==o&&39!==o||Cv(t,n,r,Tc(t,r.getStart()))})},Sv=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(Zn.name(t))&&!kc(t.dom())&&!Oo.isBogus(t.dom())},kv={},Tv=Bt.filter,Av=Bt.each;Vh=function(e){var t,n,r=e.selection.getRng();t=Oo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Av(Tv(Tv(n,t),function(e){return t(e.previousSibling)&&-1!==Bt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,tn(n=e).remove(),tn(t).append("<br><br>").append(n.childNodes)}))},kv[qh="pre"]||(kv[qh]=[]),kv[qh].push(Vh);var Rv=function(e,t){Av(kv[e],function(e){e(t)})},_v=It.each,Bv=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)_v(c,function(e){o([e])});else{var p,g,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},y=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},b=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=y(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(g=m,h=(p=d).childNodes,--g>h.length-1?g=h.length-1:g<0&&(g=0),d=h[g]||p),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Dv=/^(src|href|style)$/,Ov=It.each,Pv=Wh.isEq,Lv=function(e){return/^(TH|TD)$/.test(e.nodeName)},Iv=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Oo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Oo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new ao(r,e.getBody()).next()||r),Oo.isText(r)&&!n&&0===o&&(r=new ao(r,e.getBody()).prev()||r),r},Mv=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Fv=function(e,t,n,r){return!(t=Wh.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},zv=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,p,g,h,v,y,b=e.dom;if(c=b,!(Pv(l=o,(f=n).inline)||Pv(l,f.block)||(f.selector?Oo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Ov(n.styles,function(e,t){e=Wh.normalizeStyleValue(b,Wh.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||Pv(Wh.getStyle(b,i,t),e))&&b.setStyle(o,t,""),u=1}),u&&""===b.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Ov(n.attributes,function(e,t){var n;if(e=Wh.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||Pv(b.getAttrib(i,t),e)){if("class"===t&&(e=b.getAttrib(o,t))&&(n="",Ov(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void b.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),Dv.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),Ov(n.classes,function(e){e=Wh.replaceVars(e,r),i&&!b.hasClass(i,e)||b.removeClass(o,e)}),a=b.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,p=n,h=(m=o).parentNode,v=d.dom,y=d.settings.forced_root_block,p.block&&(y?h===v.getRoot()&&(p.list_block&&Pv(m,p.list_block)||Ov(It.grep(m.childNodes),function(e){Wh.isValid(d,y,e.nodeName.toLowerCase())?g?g.appendChild(e):(g=Mv(v,e,y),v.setAttribs(g,d.settings.forced_root_block_attrs)):g=0})):v.isBlock(m)&&!v.isBlock(h)&&(Fv(v,m,!1)||Fv(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),Fv(v,m,!0)||Fv(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),p.selector&&p.inline&&!Pv(p.inline,m)||v.remove(m,1),!0):void 0},Uv=zv,qv=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,o=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,Ov(Wh.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=fv.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,p=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=p.clone(s,!1),d=0;d<t.length;d++)if(zv(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&p.isBlock(n)||(r=p.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},p=function(e){var t,n,r,o,i;if(Oo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=It.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!zv(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)p(t[n]);i&&(a=o)}},i=function(e){var t=u.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return Mc(n)&&(n=n[e?"firstChild":"lastChild"]),Oo.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),u.remove(t,!0),n},g=function(e){var t,n,r=e.commonAncestorContainer;if(e=ov(s,e,d,!0),m.split){if((t=Iv(s,e,!0))!==(n=Iv(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&Lv(n)&&n.firstChild&&(n=n.firstChild||n),u.isChildOf(t,n)&&t!==n&&!u.isBlock(n)&&!Lv(t)&&!Lv(n))return t=Mv(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),o(t),void(t=i(!0));t=Mv(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=Mv(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),o(t),o(n),t=i(!0),n=i()}else t=n=o(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Bv(u,e,function(e){Ov(e,function(e){p(e),Oo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===Wh.getTextDecoration(u,e.parentNode)&&zv(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),g(n)):g(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],p=d.getRng();for(o=p.startContainer,i=p.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(fv.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),p.collapse(!0);var g=ov(e,p,e.formatter.get(t),!0);g=mv(g),e.formatter.remove(t,n,g),d.moveToBookmark(a)}else{l=Tc(e.getBody(),c);var h=yv(!1).dom(),v=Nv(m,h);xv(e,h,l||c),bv(f,d,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Ec.getPersistentBookmark(s.selection,!0),g(r.getRng()),r.moveToBookmark(t),m.inline&&fv.match(s,c,l,r.getStart())&&Wh.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!zv(s,d[h],l,e,e));h++);}},Vv=It.each,Hv=function(e){return e&&1===e.nodeType&&!Mc(e)&&!kc(e)&&!Oo.isBogus(e)},jv=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!Mc(n))return n}return e},$v=function(e,t,n){var r,o,i=new zc(e);if(t&&n&&(t=jv(t,"previousSibling"),n=jv(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),It.each(It.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Wv=function(e,t,n){Vv(e.childNodes,function(e){Hv(e)&&(t(e)&&n(e),e.hasChildNodes()&&Wv(e,t,n))})},Kv=function(n,e){return V.curry(function(e,t){return!(!t||!Wh.getStyle(n,t,e))},e)},Xv=function(r,e,t){return V.curry(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),Yv(r,n)},e,t)},Yv=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Gv=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=Wh.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},Jv=function(n,e,r,o){Vv(e,function(t){Vv(n.dom.select(t.inline,o),function(e){Hv(e)&&Uv(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";Vv(r.select(n,t),function(n){Hv(n)&&Vv(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Qv=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(It.walk(r,V.curry(Gv,e),"childNodes"),Gv(e,r))},Zv=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Wv(r,Kv(e,"fontSize"),Xv(e,"backgroundColor",Wh.replaceVars(t.styles.backgroundColor,n)))},ey=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(Wv(r,Kv(e,"fontSize"),Xv(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},ty=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=$v(e,Wh.getNonWhiteSpaceSibling(r),r),r=$v(e,r,Wh.getNonWhiteSpaceSibling(r,!0)))},ny=function(t,n,r,o,i){fv.matchNode(t,i.parentNode,r,o)&&Uv(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(fv.matchNode(t,e,r,o))return Uv(t,n,o,i),!0})},ry=It.each,oy=function(p,g,h,r){var e,t,v=p.formatter.get(g),y=v[0],o=!r&&p.selection.isCollapsed(),i=p.dom,n=p.selection,b=function(n,e){if(e=e||y,n){if(e.onformat&&e.onformat(n,e,h,r),ry(e.styles,function(e,t){i.setStyle(n,t,Wh.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}ry(e.attributes,function(e,t){i.setAttrib(n,t,Wh.replaceVars(e,h))}),ry(e.classes,function(e){e=Wh.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!y.selector&&(ry(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!kc(t)?(b(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=y.inline||y.block,f=s.create(l),b(f),Bv(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),Wh.isEq(t,"br"))return a=0,void(y.block&&s.remove(e));if(y.wrapper&&fv.matchNode(p,e,g,h))a=0;else{if(m&&!r&&y.block&&!y.wrapper&&Wh.isTextBlock(p,t)&&Wh.isValid(p,n,l))return e=s.rename(e,l),b(e),d.push(e),void(a=0);if(y.selector){var i=C(v,e);if(!y.inline||i)return void(a=0)}!m||r||!Wh.isValid(p,l,t)||!Wh.isValid(p,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||kc(e)||y.inline&&s.isBlock(e)?(a=0,ry(It.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};ry(e,u)}),!0===y.links&&ry(d,function(e){var t=function(e){"A"===e.nodeName&&b(e,y),ry(It.grep(e.childNodes),t)};t(e)}),ry(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return ry(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!Mc(t)&&!kc(t)&&!Oo.isBogus(t))return n=e,!1;var t}),n};n=0,ry(e.childNodes,function(e){Wh.isWhiteSpaceNode(e)||Mc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(y.inline||y.wrapper)&&(y.exact||1!==t||((o=a(r=e))&&!Mc(o)&&fv.matchName(s,o,y)&&(i=s.clone(o,!1),b(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Jv(p,v,h,e),ny(p,y,g,h,e),Zv(s,y,h,e),ey(s,y,h,e),ty(s,y,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(y){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,ov(p,t,v),0,!0)):a(i,r,0,!0);else if(o&&y.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Tc(e.getBody(),c.getStart()))&&(i=vv(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=ov(e,r,e.formatter.get(t)),r=mv(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===pv||(l=e.getDoc(),f=yv(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(p,g,h);else{var u=p.selection.getNode();p.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||oy(p,v[0].defaultBlock),p.selection.setRng(Zc(p.selection.getRng())),e=Ec.getPersistentBookmark(p.selection,!0),a(i,ov(p,n.getRng(),v)),y.styles&&Qv(i,y,h,u),n.moveToBookmark(e),Wh.moveStart(i,n,n.getRng()),p.nodeChanged()}Rv(g,p)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void b(r,v[s])}},iy={applyFormat:oy},ay=It.each,uy=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=Wh.getParents(a.dom,n.element),o={};r=It.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),ay(i.get(),function(e,n){ay(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(ay(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!fv.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),ay(u,function(e,t){o[t]||(delete u[t],ay(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),ay(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},sy={get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){It.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return It.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},cy=It.each,ly=vi.DOM,fy=function(e,t){var n,o,r,m=t&&t.schema||oi({}),p=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=ly.create(o.name),n=t,(r=o).classes.length&&ly.addClass(n,r.classes.join(" ")),ly.setAttribs(n,r.attrs),t},g=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==It.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=p(o)).appendChild(n),t&&(r||(r=ly.create("div")).appendChild(n),It.each(t,function(e){var t=p(e);r.insertBefore(t,n)})),g(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=p(o),(r=ly.create("div")).appendChild(g(n,e.slice(1),o.siblings)),r):""},dy=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=It.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==It.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},my=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),It.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=It.map(e.split(/(?:~\+|~|\+)/),dy),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},py=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=my(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=fy(i,n)):r=fy([t],n),o=ly.select(t,r)[0]||r.firstChild,cy(e.styles,function(e,t){(e=c(e))&&ly.setStyle(o,t,e)}),cy(e.attributes,function(e,t){(e=c(e))&&ly.setAttrib(o,t,e)}),cy(e.classes,function(e){e=c(e),ly.hasClass(o,e)||ly.addClass(o,e)}),n.fire("PreviewFormats"),ly.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=ly.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,cy(u.split(" "),function(e){var t=ly.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=ly.getStyle(n.getBody(),e,!0),"#ffffff"===ly.toHex(t).toLowerCase())||"color"===e&&"#000000"===ly.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),ly.remove(r),s)},gy=function(e,t,n,r,o){var i=t.get(n);!fv.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?iy.applyFormat(e,n,r,o):qv(e,n,r,o)},hy=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function vy(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?It.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],It.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(sy.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=ns(null);return hy(e),Ev(e),{get:o.get,register:o.register,unregister:o.unregister,apply:V.curry(iy.applyFormat,e),remove:V.curry(qv,e),toggle:V.curry(gy,e,o),match:V.curry(fv.match,e),matchAll:V.curry(fv.matchAll,e),matchNode:V.curry(fv.matchNode,e),canApply:V.curry(fv.canApply,e),formatChanged:V.curry(uy,e,i),getCssText:V.curry(py,e)}}var yy=function(a){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)o.hasOwnProperty(i)&&(n[i]=a(n[i],o[i]))}return n}},by=yy(function(e,t){return k.isObject(e)&&k.isObject(t)?by(e,t):t}),Cy=yy(function(e,t){return t}),xy={deepMerge:by,merge:Cy},wy={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Ko.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){H.each(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},Ny={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),It.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),cp(r,xy.merge(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Ey=function(e,u,s){e.addNodeFilter("font",function(e){H.each(e,function(e){var t,n,r=u.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=s[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",u.serialize(r)),t=e,n=["color","face","size"],H.each(n,function(e){t.attr(e,null)})})})},Sy=function(e,t){var n,r=ai();t.convert_fonts_to_spans&&Ey(e,r,It.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){H.each(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},ky={register:function(e,t){t.inline_styles&&Sy(e,t)}},Ty=/^[ \t\r\n]*$/,Ay={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Ry=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},_y=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,Ay[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=Ry(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=Ry(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Ty.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Ty.test(i.value))return!1;if(n&&n(i))return!1}while(i=Ry(i,this));return!0},a.prototype.walk=function(e){return Ry(this,null,e)},a}(),By=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new _y("br",1)).shortEnded=!0:r.empty().append(new _y("#text",3)).value="\xa0"},Dy=function(e){return Oy(e,"#text")&&"\xa0"===e.firstChild.value},Oy=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Py=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},Ly=function(e,t){return e&&(t[e.name]||"br"===e.name)},Iy=function(e,g){var h=e.schema;g.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=It.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),p=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),Py(h,m,p,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&By(g,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==g.padd_empty_with_br&&((l=new _y("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!g.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?It.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),g.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),g.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new _y("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),g.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},My=It.makeMap,Fy=It.each,zy=It.explode,Uy=It.extend;function qy(k,T){void 0===T&&(T=oi());var A={},R=[],_={},B={};(k=k||{}).validate=!("validate"in k)||k.validate,k.root_name=k.root_name||"body";var D=function(e){var t,n,r;n in A&&((r=_[n])?r.push(e):_[n]=[e]),t=R.length;for(;t--;)(n=R[t].name)in e.attributes.map&&((r=B[n])?r.push(e):B[n]=[e]);return e},e={schema:T,addAttributeFilter:function(e,n){Fy(zy(e),function(e){var t;for(t=0;t<R.length;t++)if(R[t].name===e)return void R[t].callbacks.push(n);R.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(R)},addNodeFilter:function(e,n){Fy(zy(e),function(e){var t=A[e];t||(A[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in A)A.hasOwnProperty(t)&&e.push({name:t,callbacks:A[t]});return e},filterNode:D,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},_={},B={},l=Uy(My("script,style,head,html,body,title,meta,param"),T.getBlockElements());var p=T.getNonEmptyElements(),g=T.children,h=k.validate,v="forced_root_block"in a?a.forced_root_block:k.forced_root_block,y=T.getWhiteSpaceElements(),b=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=y.hasOwnProperty(a.context)||y.hasOwnProperty(k.root_name);var N=function(e,t){var n,r=new _y(e,t);return e in A&&((n=_[e])?n.push(r):_[e]=[r]),r},E=function(e){var t,n,r,o,i=T.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=vh({validate:h,allow_script_urls:k.allow_script_urls,allow_conditional_comments:k.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(T.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),Ly(d.lastChild,l)&&(e=e.replace(b,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?T.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=g[d.name])&&g[r.name]&&!u[r.name]&&m.push(r),o=R.length;o--;)(a=R[o].name)in t.map&&((s=B[a])?s.push(r):B[a]=[r]);l[e]&&E(r),n||(d=r),!f&&y[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?T.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(b,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&y[e]&&(f=!1),n.removeEmpty&&Py(T,p,y,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(Dy(d)||Py(T,p,y,d))&&By(k,a,l,d),d=d.parent}}},T);var S=d=new _y(a.context||k.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,p,g,h;for(d=My("tr,td,th,tbody,thead,tfoot,table"),l=T.getNonEmptyElements(),f=T.getWhiteSpaceElements(),m=T.getTextBlockElements(),p=T.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(g=n.next;g&&m[g.name];)g.name="li",g.fixed=!0,n.parent.insert(g,n.parent),g=g.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!T.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=D(o[0].clone()),c=0;c<o.length-1;c++){for(T.isValidChild(a.name,o[c].name)?(u=D(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}Py(T,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(Py(T,l,f,r)||Oy(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((g=n.prev)&&("ul"===g.name||"ul"===g.name)){g.append(n);continue}if((g=n.next)&&("ul"===g.name||"ul"===g.name)){g.insert(n,g.firstChild,!0);continue}n.wrap(D(new _y("ul",1)));continue}T.isValidChild(n.parent.name,"div")&&T.isValidChild("div",n.name)?n.wrap(D(new _y("div",1))):p[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(b,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(T.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(k.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in _){for(s=A[c],i=(n=_[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=R.length;r<o;r++)if((s=R[r]).name in B){for(i=(n=B[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return Iy(e,k),ky.register(e,k),e}var Vy=function(e,t,n){-1===It.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},Hy=function(e,t,n){var r=_i(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||wo(Vn.fromDom(t))?r:It.trim(r)},jy=function(e,t,n){var r=n.selection?xy.merge({forced_root_block:!1},n):n,o=e.parse(t,r);return wy.trimTrailingBr(o),o},$y=function(e,t,n,r,o){var i,a,u,s,c=(i=r,Jc(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?lp(a,xy.merge(u,{content:s})).content:s};function Wy(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:vi.DOM,c=u&&u.schema?u.schema:oi(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=qy(a,c),wy.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=xy.merge({format:"html"},t||{}),r=Ny.process(u,e,n),o=Hy(s,r,n),i=jy(l,o,n);return"tree"===n.format?i:$y(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:V.curry(Vy,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function Ky(e){return{getBookmark:V.curry(Lc,e),moveToBookmark:V.curry(Ic,e)}}(Ky||(Ky={})).isBookmarkNode=Mc;var Xy=Ky,Yy=Oo.isContentEditableFalse,Gy=Oo.isContentEditableTrue,Jy=function(r,a){var u,s,c,l,f,d,m,p,g,h,v,y,i,b,C,x,w,N=a.dom,E=It.each,S=a.getDoc(),k=document,T=Math.abs,A=Math.round,R=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(ve.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var _=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!_(t.target)||ih(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},B=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},D=function(e){var t=a.settings.object_resizing;return!1!==t&&!ve.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Pr.is(Vn.fromDom(e),t))},O=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,b=t*f[2]+h,C=n*f[3]+v,b=b<5?5:b,C=C<5?5:C,(_(u)&&!1!==a.settings.resize_img_proportional?!sh.modifierPressed(e):sh.modifierPressed(e)||_(u)&&f[2]*f[3]!=0)&&(T(t)>T(n)?(C=A(b*y),b=A(C/y)):(b=A(C/y),C=A(b*y))),N.setStyles(B(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" &times; "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",p+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",g+(v-C)),(t=R.scrollWidth-x)+(n=R.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(mp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(B(u),e,t):N.setAttrib(B(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),k!==S&&(N.unbind(k,"mousemove",O),N.unbind(k,"mouseup",P)),N.remove(s),N.remove(c),o(u),pp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,R),p=t.x,g=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),D(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(R,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ve.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=B(u).clientWidth,v=B(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+p,y:o*n[1]+g},x=R.scrollWidth,w=R.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:p,top:g,margin:0}),s.removeAttribute("data-mce-selected"),R.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),k!==S&&(N.bind(k,"mousemove",O),N.bind(k,"mouseup",P)),c=N.add(R,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" &times; "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+p-t.offsetWidth/2,top:o*n[1]+g-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],R)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return Yy(function(e,t){for(;t&&t!==e;){if(Gy(t)||Yy(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),ve.ie&&11<=ve.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(R,"mscontrolselect",function(e){var t=function(e){we.setEditorTimeout(a,function(){a.selection.select(e)})};if(M(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=we.throttle(function(e){a.composing||I(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:D,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},Qy=function(e){return Oo.isContentEditableTrue(e)||Oo.isContentEditableFalse(e)},Zy=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=It.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Oo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Qy))?null:i}return r},eb=function(n,e){return H.map(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},tb=function(e,t){return Vn.fromDom(e.dom().cloneNode(t))},nb=function(e){return tb(e,!0)},rb=function(e){return tb(e,!1)},ob=nb,ib=function(e,t){var n=(t||document).createDocumentFragment();return H.each(e,function(e){n.appendChild(e.dom())}),Vn.fromDom(n)},ab=kr.immutable("element","width","rows"),ub=kr.immutable("element","cells"),sb=kr.immutable("x","y"),cb=function(e,t){var n=parseInt(lr.get(e,t),10);return isNaN(n)?1:n},lb=function(e){return H.foldl(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},fb=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Mr.eq(o[i],t))return A.some(sb(i,r));return A.none()},db=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(ub(a[u].element(),c))}return i},mb=function(e){var o=ab(rb(e),0,[]);return H.each(hu(e,"tr"),function(n,r){H.each(hu(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=cb(o,"rowspan"),a=cb(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=ub(ob(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:rb(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),ab(o.element(),lb(o.rows()),o.rows())},pb=function(e){return i=t=e,n=H.map(i.rows(),function(e){var t=H.map(e.cells(),function(e){var t=ob(e);return lr.remove(t,"colspan"),lr.remove(t,"rowspan"),t}),n=rb(e.element());return qc(n,t),n}),r=rb(t.element()),o=Vn.fromTag("tbody"),qc(o,n),Hu.append(r,o),r;var t,n,r,o,i},gb=function(l,e,t){return fb(l,e).bind(function(c){return fb(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?db(t,o,i,a,u):db(t,o,u,a,i),ab(t.element(),lb(s),s);var t,n,r,o,i,a,u,s})})},hb=function(n,t){return H.find(n,function(e){return"li"===Zn.name(e)&&Rg(e,t)}).fold(V.constant([]),function(e){return(t=n,H.find(t,function(e){return"ul"===Zn.name(e)||"ol"===Zn.name(e)})).map(function(e){return[Vn.fromTag("li"),Vn.fromTag(Zn.name(e))]}).getOr([]);var t})},vb=function(e,t){var n,r=Vn.fromDom(t.commonAncestorContainer),o=jl(r,e),i=H.filter(o,function(e){return po(e)||fo(e)}),a=hb(o,t),u=i.concat(a.length?a:yo(n=r)?$r.parent(n).filter(vo).fold(V.constant([]),function(e){return[n,e]}):vo(n)?[n]:[]);return H.map(u,rb)},yb=function(){return ib([])},bb=function(e,t){return n=Vn.fromDom(t.cloneContents()),r=vb(e,t),o=H.foldl(r,function(e,t){return Hu.append(t,e),t},n),0<r.length?ib([o]):o;var n,r,o},Cb=function(e,o){return(t=e,n=o[0],kl(n,"table",V.curry(Mr.eq,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=mb(e);return gb(r,t,n).map(function(e){return ib([pb(e)])})}).getOrThunk(yb);var t,n},xb=function(e,t){var n,r,o=Pd(t,e);return 0<o.length?Cb(e,o):(n=e,0<(r=t).length&&r[0].collapsed?yb():bb(n,r[0]))},wb=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=eb(e,Ad(i));if((t=t||{}).get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return e.selection.isCollapsed()?"":_i(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?xb(Vn.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},Nb=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Eb=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(Vn.fromDom).map(function(e){return r&&t.collapsed?e:$r.child(e,o(e,a)).getOr(e)}).bind(function(e){return Zn.isElement(e)?A.some(e):$r.parent(e)}).map(function(e){return e.dom()}).getOr(e)},Sb=function(e,t,n){return Eb(e,t,!0,n,function(e,t){return Math.min($r.childNodesCount(e),t)})},kb=function(e,t,n){return Eb(e,t,!1,n,function(e,t){return 0<t?t-1:t})},Tb=function(e,t){for(var n=e;e&&Oo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Ab=It.each,Rb=function(e){return!!e.select},_b=function(e){return!(!e||!e.ownerDocument)&&Mr.contains(Vn.fromDom(e.ownerDocument),Vn.fromDom(e))},Bb=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Nb(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===zp(c)){var i=Mm(c);if(i.isSome())return i.map(function(e){return eb(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=eb(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(Rb(o)||_b(o.startContainer)&&_b(o.endContainer))){var o,i=Rb(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||ve.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},p=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},g={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(_g(u,n,c.getBody(),!0),i(n))},getContent:function(e){return wb(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,A.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(_g(r,n,e,!0),_g(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:p,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Tb(r.nextSibling,!0):r.parentNode,o=0===a?Tb(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return Sb(c.getBody(),m(),e)},getEnd:function(e){return kb(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Sb(i,t,!1),e.isBlock),r=e.getParent(r||kb(i,t,!1),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new ao(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!_d(t)&&Bg(c)){var n=um(u,e);return n.each(function(e){i(e,p())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};Ab(a,function(e,n){Ab(r,function(t){if(u.is(t,n))return i[n]||(Ab(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),Ab(i,function(e,t){o[t]||(delete i[t],Ab(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),g},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return Nu(c,e,t)},placeCaretAt:function(e,t){return i(Zy(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?La.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Xy(g),t=Jy(g,c),g.bookmarkManager=n,g.controlSelection=t,g},Db=Oo.isContentEditableFalse,Ob=aa,Pb=Bs,Lb=_s,Ib=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Mb=function(e,t,n,r){var o,i,a,u,s,c,l=e===iu.Forwards,f=l?Lb:Pb;return!r.collapsed&&(o=Ob(r),Db(o))?tu(e,t,o,e===iu.Backwards,!0):(u=Oi(r.startContainer),f(i=Rs(e,t.getBody(),r))?nu(t,i.getNode(!l)):(i=n(i))?f(i)?tu(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=bs(s=i,a))&&Oo.isBr(s.getNode())||c)?tu(e,t,a.getNode(!l),l,!0):u?ou(t,i.toRange(),!0):null:u?r:null)},Fb=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=Ob(r),o=Rs(e,t.getBody(),r),i=n(t.getBody(),Yg(1),o),a=Bt.filter(i,Gg(1)),s=Bt.last(o.getClientRects()),(Lb(o)||Ds(o))&&(d=o.getNode()),(Pb(o)||Os(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=nh(a,c))&&Db(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),tu(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Ys(t),f=[],d=0,m=function(e){return Bt.last(e.getClientRects())};1===e?(o=l.next,i=ia,a=oa,u=La.after(r)):(o=l.prev,i=oa,a=ia,u=La.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,Bt.last(f))&&d++,(s=ta(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),Yg(1),d);if(u=nh(Bt.filter(m,Gg(1)),c))return ou(t,u.position.toRange(),!0);if(u=Bt.last(Bt.filter(m,Gg(0))))return ou(t,u.position.toRange(),!0)}},zb=function(e,t,n){var r,o,i,a,u=Ys(e.getBody()),s=da.curry(Ib,u.next),c=da.curry(Ib,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(La.fromRangeStart(n)):c(La.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!ve.ie||11<=ve.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},Ub=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ys((e=l).getBody()),o=da.curry(Ib,r.next),i=da.curry(Ib,r.prev),a=t?iu.Forwards:iu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Mb(a,e,u,s))?n:(n=zb(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},qb=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Xg:Kg,i=(e=u).selection.getRng(),(n=Fb(r,e,o,i))?n:(n=zb(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},Vb=function(e,r){return H.bind((t=e,H.map(t,function(e){return xy.merge({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:V.noop},e)})),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n});var t},Hb=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},jb=function(e,t){return H.find(Vb(e,t),function(e){return e.action()})},$b=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=Un.detect().os,jb([{keyCode:sh.RIGHT,action:Ub(t,!0)},{keyCode:sh.LEFT,action:Ub(t,!1)},{keyCode:sh.UP,action:qb(t,!1)},{keyCode:sh.DOWN,action:qb(t,!0)},{keyCode:sh.RIGHT,action:es(t,!0)},{keyCode:sh.LEFT,action:es(t,!1)},{keyCode:sh.UP,action:ts(t,!1)},{keyCode:sh.DOWN,action:ts(t,!0)},{keyCode:sh.RIGHT,action:sd.move(t,n,!0)},{keyCode:sh.LEFT,action:sd.move(t,n,!1)},{keyCode:sh.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:sd.moveNextWord(t,n)},{keyCode:sh.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:sd.movePrevWord(t,n)}],r).each(function(e){r.preventDefault()}))})},Wb=function(e){return 1===$r.children(e).length},Kb=function(e,t,n,r){var o,i,a,u,s=V.curry(Sv,t),c=H.map(H.filter(r,s),function(e){return e.dom()});if(0===c.length)vf(t,e,n);else{var l=(o=n.dom(),i=c,a=yv(!1),u=Nv(i,a.dom()),Hu.before(Vn.fromDom(o),a),Hc.remove(Vn.fromDom(o)),La(u,0));t.selection.setRng(l.toRange())}},Xb=function(n,r){var t,e=Vn.fromDom(n.getBody()),o=Vn.fromDom(n.selection.getStart()),i=H.filter((t=jl(o,e),H.findIndex(t,mo).fold(V.constant(t),function(e){return t.slice(0,e)})),Wb);return H.last(i).map(function(e){var t=La.fromRangeStart(n.selection.getRng());return!!El(r,t,e.dom())&&(Kb(r,n,e,i),!0)}).getOr(!1)},Yb=function(e,t){return!!e.selection.isCollapsed()&&Xb(e,t)},Gb=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,jb([{keyCode:sh.BACKSPACE,action:Hb(Cf,t,!1)},{keyCode:sh.DELETE,action:Hb(Cf,t,!0)},{keyCode:sh.BACKSPACE,action:Hb(dd,t,n,!1)},{keyCode:sh.DELETE,action:Hb(dd,t,n,!0)},{keyCode:sh.BACKSPACE,action:Hb(tf,t,!1)},{keyCode:sh.DELETE,action:Hb(tf,t,!0)},{keyCode:sh.BACKSPACE,action:Hb(Jl,t,!1)},{keyCode:sh.DELETE,action:Hb(Jl,t,!0)},{keyCode:sh.BACKSPACE,action:Hb($d,t,!1)},{keyCode:sh.DELETE,action:Hb($d,t,!0)},{keyCode:sh.BACKSPACE,action:Hb(Yb,t,!1)},{keyCode:sh.DELETE,action:Hb(Yb,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,jb([{keyCode:sh.BACKSPACE,action:Hb(xf,t)},{keyCode:sh.DELETE,action:Hb(xf,t)}],n))})},Jb=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},Qb=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new ao(t,t);r=n.current();){if(Oo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Oo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},Zb=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},eC=Jb,tC=function(e){return Jb(e).fold(V.constant(""),function(e){return e.nodeName.toUpperCase()})},nC=function(e){return Jb(e).filter(function(e){return yo(Vn.fromDom(e))}).isSome()},rC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},oC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},iC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},aC=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Oo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},uC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;oC(u=n)&&oC(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(aC(n,r,!0)&&aC(n,r,!1))rC(n,"LI")?i.insertAfter(l,iC(n)):i.replace(l,n);else if(aC(n,r,!0))rC(n,"LI")?(i.insertAfter(l,iC(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(aC(n,r,!1))i.insertAfter(l,iC(n));else{n=iC(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),Qb(e,l)}},sC=function(e){e.innerHTML='<br data-mce-bogus="1">'},cC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},fC=function(e,t,n){return!1===Oo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===Ri?0:n:n===t.data.length-1&&t.data.charAt(n)===Ri?t.data.length:n},dC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},mC=function(e,t){var n=Ou(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,Pu(e))},pC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,p,g,h,v,y,b,C=a.dom,x=a.schema,w=x.getNonEmptyElements(),N=a.selection.getRng(),E=function(e){var t,n,r,o=s,i=x.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=C.create(e||m),mC(a,t)):t=c.cloneNode(!1),r=t,!1===Mu(a))C.setAttrib(t,"style",null),C.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(kc(o))continue;n=o.cloneNode(!1),C.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return sC(r),t},S=function(e){var t,n,r,o;if(o=fC(e,s,i),Oo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&p&&!e)return!0;if(e&&Oo.isElement(s)&&s===c.firstChild)return!0;if(cC(s,"TABLE")||cC(s,"HR"))return p&&!e||!p&&e;for(t=new ao(s,c),Oo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Oo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),w[r]&&"br"!==r))return!1}else if(Oo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},k=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?E(m):E(),Fu(a)&&lC(C,l)&&C.isEmpty(c)?r=C.split(l,c):C.insertAfter(r,c),Qb(a,r)};um(C,N).each(function(e){N.setStart(e.startContainer,e.startOffset),N.setEnd(e.endContainer,e.endOffset)}),s=N.startContainer,i=N.startOffset,m=Ou(a),n=e.shiftKey,Oo.isElement(s)&&s.hasChildNodes()&&(p=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=p&&Oo.isText(s)?s.nodeValue.length:0),(u=dC(C,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,p=dC(m,r);if(!(a=m.getParent(r,m.isBlock))||!lC(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),mC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),mC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,N,s,i)),c=C.getParent(s,C.isBlock),l=c?C.getParent(c.parentNode,C.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(c)?uC(a,E,l,c,m):m&&c===a.getBody()||(m=m||"P",Oi(c)?(r=Vi(c),C.isEmpty(c)&&sC(c),Qb(a,r)):S()?k():S(!0)?(r=c.parentNode.insertBefore(E(),c),Qb(a,cC(c,"HR")?r:c)):((t=(y=N,b=y.cloneRange(),b.setStart(y.startContainer,fC(!0,y.startContainer,y.startOffset)),b.setEnd(y.endContainer,fC(!1,y.endContainer,y.endOffset)),b).cloneRange()).setEndAfter(c),function(e){for(;Oo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o=t.extractContents()),r=o.firstChild,C.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Oo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===It.trim(_i(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,r),g=C,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(g.getStyle(v,"float",!0))||g.add(h,"br"),C.isEmpty(c)&&sC(c),r.normalize(),C.isEmpty(r)?(C.remove(r),k()):Qb(a,r)),C.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},gC=function(e,t){return eC(e).filter(function(e){return 0<t.length&&Pr.is(Vn.fromDom(e),t)}).isSome()},hC=function(e){return gC(e,Lu(e))},vC=function(e){return gC(e,Iu(e))},yC=nf([{br:[]},{block:[]},{none:[]}]),bC=function(e,t){return vC(e)},CC=function(n){return function(e,t){return""===Ou(e)===n}},xC=function(n){return function(e,t){return nC(e)===n}},wC=function(n,r){return function(e,t){return tC(e)===n.toUpperCase()===r}},NC=function(e){return wC("pre",e)},EC=function(n){return function(e,t){return Du(e)===n}},SC=function(e,t){return hC(e)},kC=function(e,t){return t},TC=function(e){var t=Ou(e),n=Zb(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},AC=function(e,t){return function(n,r){return H.foldl(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},RC=function(e,t){return Df([AC([bC],yC.none()),AC([wC("summary",!0)],yC.br()),AC([NC(!0),EC(!1),kC],yC.br()),AC([NC(!0),EC(!1)],yC.block()),AC([NC(!0),EC(!0),kC],yC.block()),AC([NC(!0),EC(!0)],yC.br()),AC([xC(!0),kC],yC.br()),AC([xC(!0)],yC.block()),AC([CC(!0),kC,TC],yC.block()),AC([CC(!0)],yC.br()),AC([SC],yC.br()),AC([CC(!1),kC],yC.br()),AC([TC],yC.block())],[e,t.shiftKey]).getOr(yC.none())},_C=function(e,t){RC(e,t).fold(function(){vm(e,t)},function(){pC(e,t)},V.noop)},BC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===sh.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),_C(t,n)})))})},DC=function(e,t,n){return u=t,!(!OC(n)||!Oo.isText(u.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,u},OC=function(e){return e.fold(V.constant(!1),V.constant(!0),V.constant(!0),V.constant(!1))},PC=function(e){return!!e.selection.isCollapsed()&&(t=e,n=V.curry(xl.isInlineTarget,t),r=La.fromRangeStart(t.selection.getRng()),Gf(n,t.getBody(),r).map(V.curry(DC,t,r)).getOr(!1));var t,n,r},LC=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,jb([{keyCode:sh.SPACEBAR,action:Hb(PC,t)}],n).each(function(e){n.preventDefault()}))})},IC=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Vi(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},MC=function(e,t){var n,r=(n=e,Tl(Vn.fromDom(n.getBody()),"*[data-mce-caret]").fold(V.constant(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void IC(e,r)):void(Ii(r)&&(IC(e,r),e.undoManager.add()))},FC=function(e){e.on("keyup compositionstart",V.curry(MC,e))},zC=function(e){var t=sd.setupSelectedState(e);FC(e),$b(e,t),Gb(e,t),BC(e),LC(e)};function UC(u){var s,n,r,o=It.each,c=sh.BACKSPACE,l=sh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=ve.gecko,a=ve.ie,m=ve.webkit,p="data:text/mce-internal,",g=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},y=function(){u.shortcuts.add("meta+a",null,"SelectAll")},b=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<ve.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===sh.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),ve.windowsPhone||u.on("keyup focusin mouseup",function(e){sh.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Li(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),b(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),ve.iOS?(u.inline||u.on("keydown",function(){document.activeElement===document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):y()),11<=ve.ie&&(C(),b()),ve.ie&&(y(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=p+escape(u.id)+","+escape(n),t.dataTransfer.setData(g,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(g))&&0<=a.indexOf(p)?(a=a.substr(p.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Zy(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),we.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),we.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),ve.mac&&u.on("keydown",function(e){!sh.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var qC=function(e){return Oo.isElement(e)&&ho(Vn.fromDom(e))},VC=function(t){t.on("click",function(e){3===e.detail&&function(e){var t=e.selection.getRng(),n=Da.fromRangeStart(t),r=Da.fromRangeEnd(t);if(Da.isElementPosition(n)){var o=n.container();qC(o)&&Qa.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}Da.isElementPosition(r)&&(o=n.container(),qC(o)&&Qa.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(Zc(t))}(t)})},HC=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){H.each(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){H.each(e,function(e){var t=e.attr("data-mce-open");e.attr("open",k.isString(t)?t:null),e.attr("data-mce-open",null)})})},jC=vi.DOM,$C=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&we.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},WC=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();jC.removeClass(e,"mce-content-body"),jC.removeClass(e,"mce-edit-focus"),jC.setAttrib(e,"contentEditable",null)}),jC.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||document,t.contentWindow=f.content_window||window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===jC.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=wg(t),t.schema=oi(f),t.dom=vi(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=qy((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new _y("br",1)).shortEnded=!0)}),o),t.serializer=Wy(f,t),t.selection=Bb(t.dom,t.getWin(),t.serializer,t),t.formatter=vy(t),t.undoManager=Uh(t),t._nodeChangeDispatcher=new Dg(t),t._selectionOverrides=ph(t),HC(t),VC(t),zC(t),kg(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,jC.setAttrib(n,"spellcheck","false")),t.quirks=UC(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){It.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",It.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?jC.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){$C(t)},function(e){$C(t)}),f.content_style&&(a=t,s=f.content_style,c=Vn.fromDom(a.getDoc().head),l=Vn.fromTag("style"),lr.set(l,"type","text/css"),Hu.append(l,Vn.fromText(s)),Hu.append(c,l))},KC=vi.DOM,XC=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=ku(e),s=Vn.fromTag("iframe"),lr.setAll(s,i),lr.setAll(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),yr(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,p,g=function(e,t){if(document.domain!==window.location.hostname&&ve.ie&&ve.ie<12){var n=xg.uuid("mce");e[n]=function(){WC(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return KC.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(p=Tu(f=e)+"<html><head>",Au(f)!==f.documentBaseUrl&&(p+='<base href="'+f.documentBaseURI.getURI()+'" />'),p+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=Ru(f),m=_u(f),Bu(f)&&(p+='<meta http-equiv="Content-Security-Policy" content="'+Bu(f)+'" />'),p+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),KC.add(t.iframeContainer,l),g},YC=function(e,t){var n=XC(e,t);t.editorContainer&&(KC.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=KC.isHidden(t.editorContainer)),e.getElement().style.display="none",KC.setAttrib(e.id,"aria-hidden","true"),n||WC(e)},GC=vi.DOM,JC=function(t,n,e){var r,o,i=og.get(e);if(r=og.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=It.trim(e),i&&-1===It.inArray(n,e)){if(It.each(og.dependencies(e),function(e){JC(t,n,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},QC=function(e){return e.replace(/^\-/,"")},ZC=function(e){return{editorContainer:e,iframeContainer:e}},ex=function(e){var t,n,r=e.getElement();return e.inline?ZC(null):(t=r,n=GC.create("div"),GC.insertAfter(n,t),ZC(n))},tx=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,k.isString(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||GC.getStyle(f,"width")||"100%",a=l.height||GC.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):k.isFunction(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):ex(e)},nx=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||GC.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,k.isString(o)?(n.settings.theme=QC(o),r=ig.get(o),n.theme=new r(n,ig.urls[o]),n.theme.init&&n.theme.init(n,ig.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],It.each(i.settings.plugins.split(/[ ,]/),function(e){JC(i,a,QC(e))}),e=tx(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&It.each(It.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?WC(t):YC(t,e)},rx=vi.DOM,ox=function(e){return"-"===e.charAt(0)},ix=function(i,a){var u=wi.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(k.isString(i)){if(!ox(i)&&!ig.urls.hasOwnProperty(i)){var a=o.theme_url;a?ig.load(i,t.documentBaseURI.toAbsolute(a)):ig.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){ig.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,It.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),It.each(r.external_plugins,function(e,t){og.load(t,e),r.plugins+=" "+t}),It.each(r.plugins.split(/[ ,]/),function(e){if((e=It.trim(e))&&!og.urls[e])if(ox(e)){e=e.substr(1,e.length);var t=og.dependencies(e);It.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=og.createUrl(t,e),og.load(e.resource,e)})}else og.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||nx(i)},i,function(e){eg(i,e[0]),i.removed||nx(i)})})},ax=function(t){var e=t.settings,n=t.id,r=function(){rx.unbind(window,"ready",r),t.render()};if(Be.Event.domLoaded){if(t.getElement()&&ve.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||rx.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(rx.insertAfter(rx.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},rx.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=Yp(t),t.notificationManager=Xp(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=rx.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),ix(t,t.suffix)}}else rx.bind(window,"ready",r)},ux=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},sx=It.each,cx=It.trim,lx="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),fx={ftp:21,http:80,https:443,mailto:25},dx=function(r,e){var t,n,o=this;if(r=cx(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new dx(document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),sx(lx,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};dx.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new dx(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new dx(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=fx[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),sx(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},dx.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},dx.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var mx=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=It.trim(bh.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=_i(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=Ou(o),u=new RegExp("^(<"+a+"[^>]*>(&nbsp;|&#160;|\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||wo(Vn.fromDom(n))?t.content=r:t.content=It.trim(r),t.no_events||e.fire("GetContent",t),t.content},px=function(e,t){t(e),e.firstChild&&px(e.firstChild,t),e.next&&px(e.next,t)},gx=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&px(t.firstChild,function(t){H.each(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),H.each(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(e,t,n);H.each(r,function(t){H.each(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},hx=function(e){return e instanceof _y},vx=function(e,t){var r;e.dom.setHTML(e.getBody(),t),zp(r=e)&&Qa.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Oo.isTable(t)?Qa.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},yx=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=hx(s)?"":s,hx(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(V.constant(s),function(e){return hx(s)?function(e,t,n,r){gx(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Jc({validate:e.validate},e.schema).serialize(n);return r.content=wo(Vn.fromDom(t))?o:It.trim(o),vx(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=Ou(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),vx(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=Jc({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=wo(Vn.fromDom(n))?r:It.trim(r),vx(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},bx=vi.DOM,Cx=function(e){return A.from(e).each(function(e){return e.destroy()})},xx=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save(),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&bx.remove(o.nextSibling),!e.inline&&r&&(i=e,bx.setStyle(i.id,"display",i.orgDisplay)),fp(e),e.editorManager.remove(e),bx.remove(e.getContainer()),Cx(t),Cx(n),e.destroy()}var i},wx=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Cx(i),Cx(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),bx.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Nx=vi.DOM,Ex=It.extend,Sx=It.each,kx=It.resolve,Tx=ve.ie,Ax=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=gl(cl,c,a,u),l.settings=t,Si.language=t.language||"en",Si.languageLoad=t.language_load,Si.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new dx(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Ap(l),l.loadedCSS={},l.editorCommands=new Hm(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(ve.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(ve.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=tn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Ex(Ax.prototype={render:function(){ax(this)},focus:function(e){Fp(this,e)},hasFocus:function(){return zp(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?kx(r):0,o=kx(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&It.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return yl(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return ux(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:xg.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(Nx.show(this.getContainer()),Nx.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Tx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Nx.hide(e.getContainer()),Nx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(r.inline||(o.innerHTML=t),(n=Nx.getParent(r.id,"form"))&&Sx(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return yx(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(V.constant("tree"===n.format?new _y("body",11):""),function(e){return mx(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Ex({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==vp(t=this)&&(t.initialized?hp(t,"readonly"===n):t.on("init",function(){hp(t,"readonly"===n)}),dp(t,n))},getContainer:function(){return this.container||(this.container=Nx.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Nx.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Sx(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){xx(this)},destroy:function(e){wx(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Np);var Rx,_x,Bx,Dx={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},Ox=function(n,e){var t,r;Un.detect().browser.isIE()?(r=n).on("focusout",function(){Lm(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Lm(n)})},Px=function(e){var t,n,r,o=ah(function(){Lm(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},vi.DOM.bind(document,"mouseup",r),t.on("remove",function(){vi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Ox(e,o)}),e.on("remove",function(){o.cancel()})},Lx=vi.DOM,Ix=function(e){return Dx.isEditorUIElement(e)},Mx=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==Lx.getParent(e,function(e){return Ix(e)||!!n&&t.dom.is(e,n)})},Fx=function(r,e){var t=e.editor;Px(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;we.setEditorTimeout(t,function(){var e=r.focusedEditor;Mx(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Rx||(Rx=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===document&&(t===document.body||Mx(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},Lx.bind(document,"focusin",Rx))},zx=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Lx.unbind(document,"focusin",Rx),Rx=null)},Ux=function(e){e.on("AddEditor",V.curry(Fx,e)),e.on("RemoveEditor",V.curry(zx,e))},qx={},Vx="en",Hx={setCode:function(e){e&&(Vx=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return Vx},rtl:!1,add:function(e,t){var n=qx[e];for(var r in n||(qx[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=qx[Vx]||{},n=function(e){return It.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||It.is(e,"undefined")},o=function(e){return e=n(e),It.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(It.is(e,"object")&&It.hasOwn(e,"raw"))return n(e.raw);if(It.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return It.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:qx},jx=vi.DOM,$x=It.explode,Wx=It.each,Kx=It.extend,Xx=0,Yx=!1,Gx=[],Jx=[],Qx=function(t){Wx(Bx.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},Zx=function(e){e!==Yx&&(e?tn(window).on("resize scroll",Qx):tn(window).off("resize scroll",Qx),Yx=e)},ew=function(t){var e=Jx;delete Gx[t.id];for(var n=0;n<Gx.length;n++)if(Gx[n]===t){Gx.splice(n,1);break}return Jx=H.filter(Jx,function(e){return t!==e}),Bx.activeEditor===t&&(Bx.activeEditor=0<Jx.length?Jx[0]:null),Bx.focusedEditor===t&&(Bx.focusedEditor=null),e.length!==Jx.length};Kx(Bx={defaultSettings:{},$:tn,majorVersion:"4",minorVersion:"7.13",releaseDate:"2018-05-16",editors:Gx,i18n:Hx,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=dx.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new dx(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new dx(this.baseURL),this.suffix=o,Ux(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new dx(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new dx(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Si.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=It.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!jx.get(t)?e.name:jx.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):jx.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Ax(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};jx.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=tn.unique(function(t){var e,n=[];if(ve.ie&&ve.ie<11)return rg("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(t.types)return Wx(t.types,function(e){n=n.concat(jx.select(e.selector))}),n;if(t.selector)return jx.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&Wx($x(e),function(t){var e;(e=jx.get(t))?n.push(e):Wx(document.forms,function(e){Wx(e.elements,function(e){e.name===t&&(t="mce_editor_"+Xx++,jx.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":Wx(jx.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?Wx(r.types,function(t){It.each(o,function(e){return!jx.is(e,t.selector)||(n(c(e),Kx({},r,t),e),!1)})}):(It.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(ew(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=It.grep(o,function(e){return!s.get(e.id)})).length?f([]):Wx(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?rg("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,jx.bind(window,"ready",e),new ye(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?Jx.slice(0):k.isString(t)?H.find(Jx,function(e){return e.id===t}).getOr(null):k.isNumber(t)&&Jx[t]?Jx[t]:null},add:function(e){var t=this;return Gx[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(Gx[e.id]=e),Gx.push(e),Jx.push(e)),Zx(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),_x||(_x=function(){t.fire("BeforeUnload")},jx.bind(window,"beforeunload",_x))),e},createEditor:function(e,t){return this.add(new Ax(e,t,this))},remove:function(e){var t,n,r=this;if(e)return k.isString(e)?(e=e.selector||e,void Wx(jx.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})):(n=e,k.isNull(r.get(n.id))?null:(ew(n)&&r.fire("RemoveEditor",{editor:n}),0===Jx.length&&jx.unbind(window,"beforeunload",_x),n.remove(),Zx(0<Jx.length),n));for(t=Jx.length-1;0<=t;t--)r.remove(Jx[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Ax(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Wx(Jx,function(e){e.save()})},addI18n:function(e,t){Hx.add(e,t)},translate:function(e){return Hx.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},Xm),Bx.setup();var tw,nw=Bx;function rw(n){return{walk:function(e,t){return Bv(n,e,t)},split:mv,normalize:function(t){return um(n,t).fold(V.constant(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(tw=rw||(rw={})).compareRanges=em,tw.getCaretRangeFromPoint=Zy,tw.getSelectedNode=aa,tw.getNode=ua;var ow,iw,aw=rw,uw=Math.min,sw=Math.max,cw=Math.round,lw=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=cw(s/2)),"c"===n[1]&&(r+=cw(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=cw(a/2)),"c"===n[4]&&(r-=cw(i/2)),fw(r,o,i,a)},fw=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},dw={inflate:function(e,t,n){return fw(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:lw,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=lw(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=sw(e.x,t.x),r=sw(e.y,t.y),o=uw(e.x+e.w,t.x+t.w),i=uw(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:fw(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=sw(0,t.x-u),o=sw(0,t.y-s),i=sw(0,c-f),a=sw(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),fw(u,s,(c-=i)-u,(l-=a)-s)},create:fw,fromClientRect:function(e){return fw(e.left,e.top,e.width,e.height)}},mw={},pw={add:function(e,t){mw[e.toLowerCase()]=t},has:function(e){return!!mw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=mw.hasOwnProperty(t)?mw[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=mw[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},gw=It.each,hw=It.extend,vw=function(){};vw.extend=ow=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!iw&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in iw=!0,e=new this,iw=!1,n.Mixins&&(gw(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&gw(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&gw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&gw(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=hw({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=ow,i};var yw=Math.min,bw=Math.max,Cw=Math.round,xw=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+xw(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+xw(e[i],n):"");return o+"}"}return""+e},ww={serialize:xw,parse:function(e){try{return JSON.parse(e)}catch(t){}}},Nw={callbacks:{},count:0,send:function(t){var n=this,r=vi.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},Ew={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",Ew.fire("beforeInitialize",{settings:e}),t=new ag){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&It.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=Ew.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};It.extend(Ew,Xm);var Sw=It.extend,kw=function(e){this.settings=Sw({},e),this.count=0};kw.sendRPC=function(e){return(new kw).send(e)},kw.prototype={send:function(n){var r=n.error,o=n.success;(n=Sw(this.settings,n)).success=function(e,t){void 0===(e=ww.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=ww.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",Ew.send(n)}};var Tw,Aw=window.localStorage,Rw=nw,_w={geom:{Rect:dw},util:{Promise:ye,Delay:we,Tools:It,VK:sh,URI:dx,Class:vw,EventDispatcher:$m,Observable:Xm,I18n:Hx,XHR:Ew,JSON:ww,JSONRequest:kw,JSONP:Nw,LocalStorage:Aw,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=bw(0,yw(t,1)),n=bw(0,yw(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=Cw(255*(u+a)),s=Cw(255*(s+a)),c=Cw(255*(c+a))}else u=s=c=Cw(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=yw(e/=255,yw(t/=255,n/=255)))===(a=bw(e,bw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:Cw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:Cw(100*r),v:Cw(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:Be,Sizzle:mt,DomQuery:tn,TreeWalker:ao,DOMUtils:vi,ScriptLoader:wi,RangeUtils:aw,Serializer:Wy,ControlSelection:Jy,BookmarkManager:Xy,Selection:Bb,Event:Be.Event},html:{Styles:ai,Entities:Ko,Node:_y,Schema:oi,SaxParser:vh,DomParser:qy,Writer:Gc,Serializer:Jc},ui:{Factory:pw},Env:ve,AddOnManager:Si,Formatter:vy,UndoManager:Uh,EditorCommands:Hm,WindowManager:Yp,NotificationManager:Xp,EditorObservable:Np,Shortcuts:Ap,Editor:Ax,FocusManager:Dx,EditorManager:nw,DOM:vi.DOM,ScriptLoader:wi.ScriptLoader,PluginManager:Si.PluginManager,ThemeManager:Si.ThemeManager,trim:It.trim,isArray:It.isArray,is:It.is,toArray:It.toArray,makeMap:It.makeMap,each:It.each,map:It.map,grep:It.grep,inArray:It.inArray,extend:It.extend,create:It.create,walk:It.walk,createNS:It.createNS,resolve:It.resolve,explode:It.explode,_addCacheSuffix:It._addCacheSuffix,isOpera:ve.opera,isWebKit:ve.webkit,isIE:ve.ie,isGecko:ve.gecko,isMac:ve.mac},Bw=Rw=It.extend(Rw,_w);Tw=Bw,window.tinymce=Tw,window.tinyMCE=Tw,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(Bw)}();
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ *
7
+ * Version: 5.0.2 (2019-03-05)
8
+ */
9
+ !function(j){"use strict";var o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},q=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},$=function(e){return function(){return e}},W=function(e){return e};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,a,u,s,l,c,f,h,m,g,p,v,b,y=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},C=$(!1),w=$(!0),x=C,N=w,E=function(){return z},z=(r={fold:function(e,t){return e()},is:x,isSome:x,isNone:N,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:E,ap:E,each:function(){},bind:E,flatten:E,exists:x,forall:N,filter:E,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:$("none()")},Object.freeze&&Object.freeze(r),r),S=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:N,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return S(e(n))},ap:function(e){return e.fold(E,function(e){return S(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:z},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(x,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},T={some:S,none:E,from:function(e){return null===e||e===undefined?z:S(e)}},k=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},A=k("string"),R=k("object"),D=k("array"),M=k("null"),B=k("boolean"),O=k("function"),_=k("number"),H=(i=Array.prototype.indexOf)===undefined?function(e,t){return Y(e,t)}:function(e,t){return i.call(e,t)},P=function(e,t){return-1<H(e,t)},K=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},L=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},X=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},V=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},I=function(e,t,n){return L(e,function(e){n=t(n,e)}),n},F=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return T.some(o)}return T.none()},U=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return T.some(n);return T.none()},Y=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},G=Array.prototype.push,J=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);G.apply(t,e[n])}return t}(K(e,t))},Q=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},Z=Array.prototype.slice,ee=function(e,t){return V(e,function(e){return!P(t,e)})},te=function(e){return 0===e.length?T.none():T.some(e[0])},ne=function(e){return 0===e.length?T.none():T.some(e[e.length-1])},re=O(Array.from)?Array.from:function(e){return Z.call(e)},oe="undefined"!=typeof window?window:Function("return this;")(),ie=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:oe,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ae={getOrDie:function(e,t){var n=ie(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},ue=function(){return ae.getOrDie("URL")},se={createObjectURL:function(e){return ue().createObjectURL(e)},revokeObjectURL:function(e){ue().revokeObjectURL(e)}},le=j.navigator,ce=le.userAgent,fe=function(e){return"matchMedia"in j.window&&j.matchMedia(e).matches};m=/Android/.test(ce),u=(u=!(a=/WebKit/.test(ce))&&/MSIE/gi.test(ce)&&/Explorer/gi.test(le.appName))&&/MSIE (\w+)\./.exec(ce)[1],s=-1!==ce.indexOf("Trident/")&&(-1!==ce.indexOf("rv:")||-1!==le.appName.indexOf("Netscape"))&&11,l=-1!==ce.indexOf("Edge/")&&!u&&!s&&12,u=u||s||l,c=!a&&!s&&/Gecko/.test(ce),f=-1!==ce.indexOf("Mac"),h=/(iPad|iPhone)/.test(ce),g="FormData"in j.window&&"FileReader"in j.window&&"URL"in j.window&&!!se.createObjectURL,p=fe("only screen and (max-device-width: 480px)")&&(m||h),v=fe("only screen and (min-width: 800px)")&&(m||h),b=-1!==ce.indexOf("Windows Phone"),l&&(a=!1);var de,he={opera:!1,webkit:a,ie:u,gecko:c,mac:f,iOS:h,android:m,contentEditable:!h||g||534<=parseInt(ce.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==u,range:j.window.getSelection&&"Range"in j.window,documentMode:u&&!l?j.document.documentMode||7:10,fileApi:g,ceFalse:!1===u||8<u,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===u||11<u,desktop:!p&&!v,windowsPhone:b},me=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],c(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void c(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function l(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function c(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new l(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),ge=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},pe=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},ve=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=ge(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},be={requestAnimationFrame:function(e,t){de?de.then(e):de=new me(function(e){t||(t=j.document.body),function(e,t){var n,r=j.window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=j.window[o[n]+"RequestAnimationFrame"];r||(r=function(e){j.window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:ge,setInterval:pe,setEditorTimeout:function(e,t,n){return ge(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=pe(function(){e.removed?clearInterval(r):t()},n)},debounce:ve,throttle:ve,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},ye=/^(?:mouse|contextmenu)|click/,Ce={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},we=function(){return!1},xe=function(){return!0},Ne=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ee=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},ze=function(e,t){var n,r,o=t||{};for(n in e)Ce[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||j.document),he.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&ye.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||j.document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=xe,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=xe,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=xe,o.stopPropagation()})==((r=o).isDefaultPrevented===xe||r.isDefaultPrevented===we)&&(o.isDefaultPrevented=we,o.isPropagationStopped=we,o.isImmediatePropagationStopped=we),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Se=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){Ee(e,"DOMContentLoaded",a),Ee(e,"load",a),n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ee(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void be.setTimeout(s)}a()};!r.addEventListener||he.ie&&he.ie<11?(Ne(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():Ne(e,"DOMContentLoaded",a),Ne(e,"load",a)}},ke=function(){var h,m,g,p,v,b=this,y={};m="mce-data-"+(+new Date).toString(32),p="onmouseenter"in j.document.documentElement,g="onfocusin"in j.document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},h=1,b.domLoaded=!1,b.events=y;var C=function(e,t){var n,r,o,i,a=y[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};b.bind=function(e,t,n,r){var o,i,a,u,s,l,c,f=j.window,d=function(e){C(ze(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[m]?o=e[m]:(o=h++,e[m]=o,y[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)l=d,s=c=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),b.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,ze({type:u})):(p||(s=v[u])&&(l=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=ze(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),g||"focusin"!==u&&"focusout"!==u||(c=!0,s="focusin"===u?"focus":"blur",l=function(e){(e=ze(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=y[o][u])?"ready"===u&&b.domLoaded?n({type:u}):i.push({func:n,scope:r}):(y[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=c,i.nativeHandler=l,"ready"===u?Se(e,l,b):Ne(e,s||u,l,c)));return e=i=0,n}},b.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return b;if(r=e[m]){if(s=y[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var l=o.nativeHandler,c=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=l,o.fakeName=c,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],Ee(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ee(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return b;delete y[r];try{delete e[m]}catch(d){e[m]=null}}return b},b.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return b;for((n=ze(null,n)).type=t,n.target=e;(r=e[m])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return b},b.clean=function(e){var t,n,r=b.unbind;if(!e||3===e.nodeType||8===e.nodeType)return b;if(e[m]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[m]&&r(e);return b},b.destroy=function(){y={}},b.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};ke.Event=new ke,ke.Event.bind(j.window,"ready",function(){});var Te,Ae,Re,De,Me,Be,Oe,_e,He,Pe,Le,Ve,Ie,Fe,Ue,je,qe,$e,We="sizzle"+-new Date,Ke=j.window.document,Xe=0,Ye=0,Ge=Tt(),Je=Tt(),Qe=Tt(),Ze=function(e,t){return e===t&&(Le=!0),0},et=typeof undefined,tt={}.hasOwnProperty,nt=[],rt=nt.pop,ot=nt.push,it=nt.push,at=nt.slice,ut=nt.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},st="[\\x20\\t\\r\\n\\f]",lt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ct="\\["+st+"*("+lt+")(?:"+st+"*([*^$|!~]?=)"+st+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+lt+"))|)"+st+"*\\]",ft=":("+lt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ct+")*)|.*)\\)|)",dt=new RegExp("^"+st+"+|((?:^|[^\\\\])(?:\\\\.)*)"+st+"+$","g"),ht=new RegExp("^"+st+"*,"+st+"*"),mt=new RegExp("^"+st+"*([>+~]|"+st+")"+st+"*"),gt=new RegExp("="+st+"*([^\\]'\"]*?)"+st+"*\\]","g"),pt=new RegExp(ft),vt=new RegExp("^"+lt+"$"),bt={ID:new RegExp("^#("+lt+")"),CLASS:new RegExp("^\\.("+lt+")"),TAG:new RegExp("^("+lt+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+ft),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+st+"*(even|odd|(([+-]|)(\\d*)n|)"+st+"*(?:([+-]|)"+st+"*(\\d+)|))"+st+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+st+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+st+"*((?:-\\d)?\\d*)"+st+"*\\)|)(?=[^-]|$)","i")},yt=/^(?:input|select|textarea|button)$/i,Ct=/^h\d$/i,wt=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Nt=/[+~]/,Et=/'|\\/g,zt=new RegExp("\\\\([\\da-f]{1,6}"+st+"?|("+st+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{it.apply(nt=at.call(Ke.childNodes),Ke.childNodes),nt[Ke.childNodes.length].nodeType}catch(GN){it={apply:nt.length?function(e,t){ot.apply(e,at.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var kt=function(e,t,n,r){var o,i,a,u,s,l,c,f,d,h;if((t?t.ownerDocument||t:Ke)!==Ie&&Ve(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Ie).nodeType)&&9!==u)return[];if(Ue&&!r){if(o=xt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&$e(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return it.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Ae.getElementsByClassName)return it.apply(n,t.getElementsByClassName(a)),n}if(Ae.qsa&&(!je||!je.test(e))){if(f=c=We,d=t,h=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(l=Be(e),(c=t.getAttribute("id"))?f=c.replace(Et,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=l.length;s--;)l[s]=f+Ht(l[s]);d=Nt.test(e)&&Ot(t.parentNode)||t,h=l.join(",")}if(h)try{return it.apply(n,d.querySelectorAll(h)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return _e(e.replace(dt,"$1"),t,n,r)};function Tt(){var n=[];return function r(e,t){return n.push(e+" ")>Re.cacheLength&&delete r[n.shift()],r[e+" "]=t}}function At(e){return e[We]=!0,e}function Rt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Mt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Bt(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==et&&e}for(Te in Ae=kt.support={},Me=kt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Ve=kt.setDocument=function(e){var t,s=e?e.ownerDocument||e:Ke,n=s.defaultView;return s!==Ie&&9===s.nodeType&&s.documentElement?(Fe=(Ie=s).documentElement,Ue=!Me(s),n&&n!==function r(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Ve()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Ve()})),Ae.attributes=!0,Ae.getElementsByTagName=!0,Ae.getElementsByClassName=wt.test(s.getElementsByClassName),Ae.getById=!0,Re.find.ID=function(e,t){if(typeof t.getElementById!==et&&Ue){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Re.filter.ID=function(e){var t=e.replace(zt,St);return function(e){return e.getAttribute("id")===t}},Re.find.TAG=Ae.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==et)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},Re.find.CLASS=Ae.getElementsByClassName&&function(e,t){if(Ue)return t.getElementsByClassName(e)},qe=[],je=[],Ae.disconnectedMatch=!0,je=je.length&&new RegExp(je.join("|")),qe=qe.length&&new RegExp(qe.join("|")),t=wt.test(Fe.compareDocumentPosition),$e=t||wt.test(Fe.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Ze=t?function(e,t){if(e===t)return Le=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Ae.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===Ke&&$e(Ke,e)?-1:t===s||t.ownerDocument===Ke&&$e(Ke,t)?1:Pe?ut.call(Pe,e)-ut.call(Pe,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Le=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Pe?ut.call(Pe,e)-ut.call(Pe,t):0;if(o===i)return Rt(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?Rt(a[r],u[r]):a[r]===Ke?-1:u[r]===Ke?1:0},s):Ie},kt.matches=function(e,t){return kt(e,null,null,t)},kt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ie&&Ve(e),t=t.replace(gt,"='$1']"),Ae.matchesSelector&&Ue&&(!qe||!qe.test(t))&&(!je||!je.test(t)))try{var n=(void 0).call(e,t);if(n||Ae.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(GN){}return 0<kt(t,Ie,null,[e]).length},kt.contains=function(e,t){return(e.ownerDocument||e)!==Ie&&Ve(e),$e(e,t)},kt.attr=function(e,t){(e.ownerDocument||e)!==Ie&&Ve(e);var n=Re.attrHandle[t.toLowerCase()],r=n&&tt.call(Re.attrHandle,t.toLowerCase())?n(e,t,!Ue):undefined;return r!==undefined?r:Ae.attributes||!Ue?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},kt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},kt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Le=!Ae.detectDuplicates,Pe=!Ae.sortStable&&e.slice(0),e.sort(Ze),Le){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Pe=null,e},De=kt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=De(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=De(t);return n},(Re=kt.selectors={cacheLength:50,createPseudo:At,match:bt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(zt,St),e[3]=(e[3]||e[4]||e[5]||"").replace(zt,St),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||kt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&kt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return bt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=Be(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(zt,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ge[e+" "];return t||(t=new RegExp("(^|"+st+")"+e+"("+st+"|$)"))&&Ge(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==et&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=kt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(h,e,t,m,g){var p="nth"!==h.slice(0,3),v="last"!==h.slice(-4),b="of-type"===e;return 1===m&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,l=p!==v?"nextSibling":"previousSibling",c=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(c){if(p){for(;l;){for(i=e;i=i[l];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=l="only"===h&&!s&&"nextSibling"}return!0}if(s=[v?c.firstChild:c.lastChild],v&&d){for(u=(r=(o=c[We]||(c[We]={}))[h]||[])[0]===Xe&&r[1],a=r[0]===Xe&&r[2],i=u&&c.childNodes[u];i=++u&&i&&i[l]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[h]=[Xe,u,a];break}}else if(d&&(r=(e[We]||(e[We]={}))[h])&&r[0]===Xe)a=r[1];else for(;(i=++u&&i&&i[l]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[We]||(i[We]={}))[h]=[Xe,a]),i!==e)););return(a-=g)===m||a%m==0&&0<=a/m}}},PSEUDO:function(e,i){var t,a=Re.pseudos[e]||Re.setFilters[e.toLowerCase()]||kt.error("unsupported pseudo: "+e);return a[We]?a(i):1<a.length?(t=[e,e,"",i],Re.setFilters.hasOwnProperty(e.toLowerCase())?At(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=ut.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:At(function(e){var r=[],o=[],u=Oe(e.replace(dt,"$1"));return u[We]?At(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:At(function(t){return function(e){return 0<kt(t,e).length}}),contains:At(function(t){return t=t.replace(zt,St),function(e){return-1<(e.textContent||e.innerText||De(e)).indexOf(t)}}),lang:At(function(n){return vt.test(n||"")||kt.error("unsupported lang: "+n),n=n.replace(zt,St).toLowerCase(),function(e){var t;do{if(t=Ue?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=j.window.location&&j.window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===Fe},focus:function(e){return e===Ie.activeElement&&(!Ie.hasFocus||Ie.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!Re.pseudos.empty(e)},header:function(e){return Ct.test(e.nodeName)},input:function(e){return yt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Bt(function(){return[0]}),last:Bt(function(e,t){return[t-1]}),eq:Bt(function(e,t,n){return[n<0?n+t:n]}),even:Bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=Re.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Re.pseudos[Te]=Dt(Te);for(Te in{submit:!0,reset:!0})Re.pseudos[Te]=Mt(Te);function _t(){}function Ht(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Pt(a,e,t){var u=e.dir,s=t&&"parentNode"===u,l=Ye++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Xe,l];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[We]||(e[We]={}))[u])&&r[0]===Xe&&r[1]===l)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Lt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Vt(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,l=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),l&&t.push(u)));return a}function It(m,g,p,v,b,e){return v&&!v[We]&&(v=It(v)),b&&!b[We]&&(b=It(b,e)),At(function(e,t,n,r){var o,i,a,u=[],s=[],l=t.length,c=e||function h(e,t,n){for(var r=0,o=t.length;r<o;r++)kt(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?c:Vt(c,u,m,n,r),d=p?b||(e?m:l||v)?[]:t:f;if(p&&p(f,d,n,r),v)for(o=Vt(d,s),v(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(b||m){if(b){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);b(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=b?ut.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Vt(d===t?d.splice(l,d.length):d),b?b(null,t,d,r):it.apply(t,d)})}function Ft(e){for(var r,t,n,o=e.length,i=Re.relative[e[0].type],a=i||Re.relative[" "],u=i?1:0,s=Pt(function(e){return e===r},a,!0),l=Pt(function(e){return-1<ut.call(r,e)},a,!0),c=[function(e,t,n){return!i&&(n||t!==He)||((r=t).nodeType?s(e,t,n):l(e,t,n))}];u<o;u++)if(t=Re.relative[e[u].type])c=[Pt(Lt(c),t)];else{if((t=Re.filter[e[u].type].apply(null,e[u].matches))[We]){for(n=++u;n<o&&!Re.relative[e[n].type];n++);return It(1<u&&Lt(c),1<u&&Ht(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(dt,"$1"),t,u<n&&Ft(e.slice(u,n)),n<o&&Ft(e=e.slice(n)),n<o&&Ht(e))}c.push(t)}return Lt(c)}_t.prototype=Re.filters=Re.pseudos,Re.setFilters=new _t,Be=kt.tokenize=function(e,t){var n,r,o,i,a,u,s,l=Je[e+" "];if(l)return t?0:l.slice(0);for(a=e,u=[],s=Re.preFilter;a;){for(i in n&&!(r=ht.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=mt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(dt," ")}),a=a.slice(n.length)),Re.filter)!(r=bt[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?kt.error(e):Je(e,u).slice(0)},Oe=kt.compile=function(e,t){var n,r=[],o=[],i=Qe[e+" "];if(!i){for(t||(t=Be(e)),n=t.length;n--;)(i=Ft(t[n]))[We]?r.push(i):o.push(i);(i=Qe(e,function a(p,v){var b=0<v.length,y=0<p.length,e=function(e,t,n,r,o){var i,a,u,s=0,l="0",c=e&&[],f=[],d=He,h=e||y&&Re.find.TAG("*",o),m=Xe+=null==d?1:Math.random()||.1,g=h.length;for(o&&(He=t!==Ie&&t);l!==g&&null!=(i=h[l]);l++){if(y&&i){for(a=0;u=p[a++];)if(u(i,t,n)){r.push(i);break}o&&(Xe=m)}b&&((i=!u&&i)&&s--,e&&c.push(i))}if(s+=l,b&&l!==s){for(a=0;u=v[a++];)u(c,f,t,n);if(e){if(0<s)for(;l--;)c[l]||f[l]||(f[l]=rt.call(r));f=Vt(f)}it.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&kt.uniqueSort(r)}return o&&(Xe=m,He=d),c};return b?At(e):e}(o,r))).selector=e}return i},_e=kt.select=function(e,t,n,r){var o,i,a,u,s,l="function"==typeof e&&e,c=!r&&Be(e=l.selector||e);if(n=n||[],1===c.length){if(2<(i=c[0]=c[0].slice(0)).length&&"ID"===(a=i[0]).type&&Ae.getById&&9===t.nodeType&&Ue&&Re.relative[i[1].type]){if(!(t=(Re.find.ID(a.matches[0].replace(zt,St),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=bt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Re.relative[u=a.type]);)if((s=Re.find[u])&&(r=s(a.matches[0].replace(zt,St),Nt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Ht(i)))return it.apply(n,r),n;break}}return(l||Oe(e,c))(r,t,!Ue,n,Nt.test(e)&&Ot(t.parentNode)||t),n},Ae.sortStable=We.split("").sort(Ze).join("")===We,Ae.detectDuplicates=!!Le,Ve(),Ae.sortDetached=!0;var Ut=Array.isArray,jt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},qt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},$t={isArray:Ut,toArray:function(e){var t,n,r=e;if(!Ut(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:jt,map:function(n,r){var o=[];return jt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return jt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:qt,find:function(e,t,n){var r=qt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},Wt=/^\s*|\s*$/g,Kt=function(e){return null===e||e===undefined?"":(""+e).replace(Wt,"")},Xt=function(e,t){return t?!("array"!==t||!$t.isArray(e))||typeof e===t:e!==undefined},Yt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),$t.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Yt(e,n,r,o)}))},Gt={trim:Kt,isArray:$t.isArray,is:Xt,toArray:$t.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:$t.each,map:$t.map,grep:$t.filter,inArray:$t.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,l=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},l=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=l?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Yt,createNS:function(e,t){var n,r;for(t=t||j.window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||j.window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Xt(e,"array")?e:$t.map(e.split(t||","),Kt)},_addCacheSuffix:function(e){var t=he.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Jt=j.document,Qt=Array.prototype.push,Zt=Array.prototype.slice,en=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,tn=ke.Event,nn=Gt.makeMap("children,contents,next,prev"),rn=function(e){return void 0!==e},on=function(e){return"string"==typeof e},an=function(e,t){var n,r,o;for(o=(t=t||Jt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},un=function(e,t,n,r){var o;if(on(t))t=an(t,wn(e[0]));else if(t.length&&!t.nodeType){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)un(e,t[o],n,r);else for(o=0;o<t.length;o++)un(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},sn=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},ln=function(e,t,n){var r,o;return t=pn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},cn=Gt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),fn=Gt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),dn={"for":"htmlFor","class":"className",readonly:"readOnly"},hn={"float":"cssFloat"},mn={},gn={},pn=function(e,t){return new pn.fn.init(e,t)},vn=/^\s*|\s*$/g,bn=function(e){return null===e||e===undefined?"":(""+e).replace(vn,"")},yn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},Cn=function(e,n){var r=[];return yn(e,function(e,t){n(t,e)&&r.push(t)}),r},wn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Jt};pn.fn=pn.prototype={constructor:pn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return pn(e).attr(t);o.context=t=j.document}if(on(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:en.exec(e)))return pn(t).find(e);if(n[1])for(r=an(e,wn(t)).firstChild;r;)Qt.call(o,r),r=r.nextSibling;else{if(!(r=wn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Gt.toArray(this)},add:function(e,t){var n,r,o=this;if(on(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Qt.apply(o,pn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)yn(t,function(e,t){r.attr(e,t)});else{if(!rn(n)){if(r[0]&&1===r[0].nodeType){if((e=mn[t])&&e.get)return e.get(r[0],t);if(fn[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=mn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=dn[e]||e))yn(e,function(e,t){n.prop(e,t)});else{if(!rn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)yn(n,function(e,t){i.css(e,t)});else if(rn(r))n=t(n),"number"!=typeof r||cn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=gn[n])&&o.set)o.set(this,r);else{try{this.style[hn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=gn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],tn.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(rn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){pn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(rn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return un(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return un(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?un(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?un(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return pn(e).append(this),this},prependTo:function(e){return pn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return ln(this,e)},wrapAll:function(e){return ln(this,e,!0)},wrapInner:function(e){return this.each(function(){pn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){pn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),pn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?yn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=sn(t,o))!==i&&(n=t.className,r?t.className=bn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return sn(this[0],e)},each:function(e){return yn(this,e)},on:function(e,t){return this.each(function(){tn.bind(this,e,t)})},off:function(e,t){return this.each(function(){tn.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?tn.fire(this,e.type,e):tn.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new pn(Zt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)pn.find(e,this[t],r);return pn(r)},filter:function(n){return pn("function"==typeof n?Cn(this.toArray(),function(e,t){return n(t,e)}):pn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof pn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&pn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),pn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Qt,sort:[].sort,splice:[].splice},Gt.extend(pn,{extend:Gt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Gt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Gt.isArray,each:yn,trim:bn,grep:Cn,find:kt,expr:kt.selectors,unique:kt.uniqueSort,text:kt.getText,contains:kt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?pn.find.matchesSelector(t[0],e)?[t[0]]:[]:pn.find.matches(e,t)}});var xn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof pn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&pn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},Nn=function(e,t,n,r){var o=[];for(r instanceof pn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&pn(e).is(r))break}o.push(e)}return o},En=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};yn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xn(e,"parentNode")},next:function(e){return En(e,"nextSibling",1)},prev:function(e){return En(e,"previousSibling",1)},children:function(e){return Nn(e.firstChild,"nextSibling",1)},contents:function(e){return Gt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){pn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(nn[e]||(n=pn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=pn(n),t?n.filter(t):n}}),yn({parentsUntil:function(e,t){return xn(e,"parentNode",t)},nextUntil:function(e,t){return Nn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return Nn(e,"previousSibling",1,t).slice(1)}},function(r,o){pn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=pn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=pn(n),e?n.filter(e):n}}),pn.fn.is=function(e){return!!e&&0<this.filter(e).length},pn.fn.init.prototype=pn.fn,pn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return pn.extend(o,this),o};var zn=function(n,r,e){yn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};he.ie&&he.ie<8&&(zn(mn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),zn(mn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),he.ie&&he.ie<9&&(hn["float"]="styleFloat",zn(gn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),pn.attrHooks=mn,pn.cssHooks=gn;var Sn,kn,Tn,An=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Dn(r(1),r(2))},Rn=function(){return Dn(0,0)},Dn=function(e,t){return{major:e,minor:t}},Mn={nu:Dn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Rn():An(e,n)},unknown:Rn},Bn="Firefox",On=function(e,t){return function(){return t===e}},_n=function(e){var t=e.current;return{current:t,version:e.version,isEdge:On("Edge",t),isChrome:On("Chrome",t),isIE:On("IE",t),isOpera:On("Opera",t),isFirefox:On(Bn,t),isSafari:On("Safari",t)}},Hn={unknown:function(){return _n({current:undefined,version:Mn.unknown()})},nu:_n,edge:$("Edge"),chrome:$("Chrome"),ie:$("IE"),opera:$("Opera"),firefox:$(Bn),safari:$("Safari")},Pn="Windows",Ln="Android",Vn="Solaris",In="FreeBSD",Fn=function(e,t){return function(){return t===e}},Un=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Fn(Pn,t),isiOS:Fn("iOS",t),isAndroid:Fn(Ln,t),isOSX:Fn("OSX",t),isLinux:Fn("Linux",t),isSolaris:Fn(Vn,t),isFreeBSD:Fn(In,t)}},jn={unknown:function(){return Un({current:undefined,version:Mn.unknown()})},nu:Un,windows:$(Pn),ios:$("iOS"),android:$(Ln),linux:$("Linux"),osx:$("OSX"),solaris:$(Vn),freebsd:$(In)},qn=function(e,t){var n=String(t).toLowerCase();return F(e,function(e){return e.search(n)})},$n=function(e,n){return qn(e,n).map(function(e){var t=Mn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Wn=function(e,n){return qn(e,n).map(function(e){var t=Mn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Kn=function(e,t){return-1!==e.indexOf(t)},Xn=function(e){return e.replace(/^\s+|\s+$/g,"")},Yn=function(e){return e.replace(/\s+$/g,"")},Gn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Jn=function(t){return function(e){return Kn(e,t)}},Qn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Kn(e,"edge/")&&Kn(e,"chrome")&&Kn(e,"safari")&&Kn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Gn],search:function(e){return Kn(e,"chrome")&&!Kn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Kn(e,"msie")||Kn(e,"trident")}},{name:"Opera",versionRegexes:[Gn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Jn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Jn("firefox")},{name:"Safari",versionRegexes:[Gn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Kn(e,"safari")||Kn(e,"mobile/"))&&Kn(e,"applewebkit")}}],Zn=[{name:"Windows",search:Jn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Kn(e,"iphone")||Kn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Jn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Jn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Jn("linux"),versionRegexes:[]},{name:"Solaris",search:Jn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Jn("freebsd"),versionRegexes:[]}],er={browsers:$(Qn),oses:$(Zn)},tr=function(e){var t,n,r,o,i,a,u,s,l,c,f,d=er.browsers(),h=er.oses(),m=$n(d,e).fold(Hn.unknown,Hn.nu),g=Wn(h,e).fold(jn.unknown,jn.nu);return{browser:m,os:g,deviceType:(n=m,r=e,o=(t=g).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),c=l&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:$(o),isiPhone:$(i),isTablet:$(s),isPhone:$(c),isTouch:$(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:$(f)})}},nr={detect:(Sn=function(){var e=j.navigator.userAgent;return tr(e)},Tn=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn||(Tn=!0,kn=Sn.apply(null,e)),kn})},rr=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:$(e)}},or={fromHtml:function(e,t){var n=(t||j.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw j.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return rr(n.childNodes[0])},fromTag:function(e,t){var n=(t||j.document).createElement(e);return rr(n)},fromText:function(e,t){var n=(t||j.document).createTextNode(e);return rr(n)},fromDom:rr,fromPoint:function(e,t,n){var r=e.dom();return T.from(r.elementFromPoint(t,n)).map(rr)}},ir=(j.Node.ATTRIBUTE_NODE,j.Node.CDATA_SECTION_NODE,j.Node.COMMENT_NODE,j.Node.DOCUMENT_NODE),ar=(j.Node.DOCUMENT_TYPE_NODE,j.Node.DOCUMENT_FRAGMENT_NODE,j.Node.ELEMENT_NODE),ur=j.Node.TEXT_NODE,sr=(j.Node.PROCESSING_INSTRUCTION_NODE,j.Node.ENTITY_REFERENCE_NODE,j.Node.ENTITY_NODE,j.Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),lr=function(t){return function(e){return e.dom().nodeType===t}},cr=lr(ar),fr=lr(ur),dr=Object.keys,hr=Object.hasOwnProperty,mr=function(e,t){for(var n=dr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},gr=function(r,o){var i={};return mr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},pr=function(e,n){var r={},o={};return mr(e,function(e,t){(n(e,t)?r:o)[t]=e}),{t:r,f:o}},vr=function(e,t){return br(e,t)?T.some(e[t]):T.none()},br=function(e,t){return hr.call(e,t)},yr=function(e,t,n){if(!(A(n)||B(n)||_(n)))throw j.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Cr=function(e,t,n){yr(e.dom(),t,n)},wr=function(e,t){var n=e.dom();mr(t,function(e,t){yr(n,t,e)})},xr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Nr=function(e,t){e.dom().removeAttribute(t)},Er=function(e,t){var n,r,o=e.dom(),i=j.window.getComputedStyle(o).getPropertyValue(t),a=""!==i||(r=fr(n=e)?n.dom().parentNode:n.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:zr(o,t);return null===a?undefined:a},zr=function(e,t){return e.style!==undefined?e.style.getPropertyValue(t):""},Sr=function(e,t){var n=e.dom(),r=zr(n,t);return T.from(r).filter(function(e){return 0<e.length})},kr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return L(t,function(e,t){r[e]=$(n[t])}),r}},Tr=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Ar=function(){return ae.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Dr=function(e,t){return Rr(e,t,Ar().DOCUMENT_POSITION_CONTAINED_BY)},Mr=ar,Br=ir,Or=function(e,t){var n=e.dom();if(n.nodeType!==Mr)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},_r=function(e){return e.nodeType!==Mr&&e.nodeType!==Br||0===e.childElementCount},Hr=function(e,t){return e.dom()===t.dom()},Pr=nr.detect().browser.isIE()?function(e,t){return Dr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Lr=function(e){return or.fromDom(e.dom().ownerDocument)},Vr=function(e){var t=e.dom();return T.from(t.parentNode).map(or.fromDom)},Ir=function(e){var t=e.dom();return T.from(t.previousSibling).map(or.fromDom)},Fr=function(e){var t=e.dom();return T.from(t.nextSibling).map(or.fromDom)},Ur=function(e){return t=Tr(e,Ir),(n=Z.call(t,0)).reverse(),n;var t,n},jr=function(e){return Tr(e,Fr)},qr=function(e){var t=e.dom();return K(t.childNodes,or.fromDom)},$r=function(e,t){var n=e.dom().childNodes;return T.from(n[t]).map(or.fromDom)},Wr=function(e){return $r(e,0)},Kr=function(e){return $r(e,e.dom().childNodes.length-1)},Xr=(kr("element","offset"),nr.detect().browser),Yr=function(e){return F(e,cr)},Gr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Er(or.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=or.fromDom(t),Xr.isFirefox()&&"table"===sr(i)?Yr(qr(i)).filter(function(e){return"caption"===sr(e)}).bind(function(o){return Yr(jr(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Jr=function(e){var n=T.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){L(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=T.some(e),i(t),t=[]}),{get:r,map:function(n){return Jr(function(t){r(function(e){t(n(e))})})},isReady:o}},Qr={nu:Jr,pure:function(t){return Jr(function(e){e(t)})}},Zr=function(t){var e=function(e){var r;t((r=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){r.apply(n,e)},0)}))},n=function(){return Qr.nu(e)};return{map:function(r){return Zr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Zr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Zr(function(t){e(function(e){n.get(t)})})},toLazy:n,toCached:function(){var t=null;return Zr(function(e){null===t&&(t=n()),t.get(e)})},get:e}},eo={nu:Zr,pure:function(t){return Zr(function(e){e(t)})}},to=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):L(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},no=function(e){return to(e,eo.nu)},ro=function(n){return{is:function(e){return n===e},isValue:w,isError:C,getOr:$(n),getOrThunk:$(n),getOrDie:$(n),or:function(e){return ro(n)},orThunk:function(e){return ro(n)},fold:function(e,t){return t(n)},map:function(e){return ro(e(n))},mapError:function(e){return ro(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return T.some(n)}}},oo=function(n){return{is:C,isValue:C,isError:w,getOr:W,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return oo(n)},mapError:function(e){return oo(e(n))},each:o,bind:function(e){return oo(n)},exists:C,forall:w,toOption:T.none}},io={value:ro,error:oo};function ao(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var uo,so,lo,co=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,$(!0))).hasOwnProperty(sr(e))}},fo=co(["h1","h2","h3","h4","h5","h6"]),ho=co(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),mo=function(e){return cr(e)&&!ho(e)},go=function(e){return cr(e)&&"br"===sr(e)},po=co(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),vo=co(["ul","ol","dl"]),bo=co(["li","dd","dt"]),yo=co(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),Co=co(["thead","tbody","tfoot"]),wo=co(["td","th"]),xo=co(["pre","script","textarea","style"]),No=function(t){return function(e){return!!e&&e.nodeType===t}},Eo=No(1),zo=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},So=function(t){return function(e){if(Eo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},ko=No(3),To=No(8),Ao=No(9),Ro=No(11),Do=zo("br"),Mo=So("true"),Bo=So("false"),Oo={isText:ko,isElement:Eo,isComment:To,isDocument:Ao,isDocumentFragment:Ro,isBr:Do,isContentEditableTrue:Mo,isContentEditableFalse:Bo,matchNodeNames:zo,hasPropValue:function(t,n){return function(e){return Eo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return Eo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return Eo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(Eo(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return Eo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return Eo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return Eo(e)&&"TABLE"===e.tagName}},_o=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Ho=function(e,t){var n,r=t.childNodes;if(!Oo.isElement(t)||!_o(t)){for(n=r.length-1;0<=n;n--)Ho(e,r[n]);if(!1===Oo.isDocument(t)){if(Oo.isText(t)&&0<t.nodeValue.length){var o=Gt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(Oo.isElement(t)&&(1===(r=t.childNodes).length&&_o(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||yo(or.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Po={trimNode:Ho},Lo=Gt.makeMap,Vo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Io=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,jo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};so={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},lo={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};var qo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),so[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};uo=qo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var $o=function(e,t){return e.replace(t?Vo:Io,function(e){return so[e]||e})},Wo=function(e,t){return e.replace(t?Vo:Io,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":so[e]||"&#"+e.charCodeAt(0)+";"})},Ko=function(e,t,n){return n=n||uo,e.replace(t?Vo:Io,function(e){return so[e]||n[e]||e})},Xo={encodeRaw:$o,encodeAllRaw:function(e){return(""+e).replace(Fo,function(e){return so[e]||e})},encodeNumeric:Wo,encodeNamed:Ko,getEncodeFunc:function(e,t){var n=qo(t)||uo,r=Lo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Vo:Io,function(e){return so[e]!==undefined?so[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return Ko(e,t,n)}:Ko:r.numeric?Wo:$o},decode:function(e){return e.replace(Uo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):jo[t]||String.fromCharCode(t):lo[e]||uo[e]||(n=e,(r=or.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Yo={},Go={},Jo=Gt.makeMap,Qo=Gt.each,Zo=Gt.extend,ei=Gt.explode,ti=Gt.inArray,ni=function(e,t){return(e=Gt.trim(e))?e.split(t||" "):[]},ri=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=ni(n)),r=(e=ni(e)).length;r--;)i={attributes:a(o=ni([u,t].join(" "))),attributesOrder:o,children:a(n,Go)},s[e[r]]=i},l=function(e,t){var n,r,o,i;for(n=(e=ni(e)).length,t=ni(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return Yo[e]?Yo[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure main header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Qo(ni(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Qo(ni(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside main header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(l("script","language xml:space"),l("style","xml:space"),l("object","declare classid code codebase codetype archive standby align border hspace vspace"),l("embed","align name hspace vspace"),l("param","valuetype type"),l("a","charset name rev shape coords"),l("br","clear"),l("applet","codebase archive code object alt name width height align hspace vspace"),l("img","name longdesc align border hspace vspace"),l("iframe","longdesc frameborder marginwidth marginheight scrolling align"),l("font basefont","size color face"),l("input","usemap align"),l("select","onchange"),l("textarea"),l("h1 h2 h3 h4 h5 h6 div p legend caption","align"),l("ul","type compact"),l("li","type"),l("ol dl menu dir","compact"),l("pre","width xml:space"),l("hr","align noshade size width"),l("isindex","prompt"),l("table","summary width frame rules cellspacing cellpadding align bgcolor"),l("col","width align char charoff valign"),l("colgroup","width align char charoff valign"),l("thead","align char charoff valign"),l("tr","align char charoff valign bgcolor"),l("th","axis align char charoff valign nowrap bgcolor width height"),l("form","accept"),l("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),l("tfoot","align char charoff valign"),l("tbody","align char charoff valign"),l("area","nohref"),l("body","background bgcolor text link vlink alink")),"html4"!==e&&(l("input button select textarea","autofocus"),l("input textarea","placeholder"),l("a","download"),l("link script img","crossorigin"),l("iframe","sandbox seamless allowfullscreen")),Qo(ni("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Yo[e]=s)},oi=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Qo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Jo(e,/[, ]/):ei(e,/[, ]/)})),r};function ii(i){var e,t,n,r,o,a,u,s,l,c,f,d,h,N={},m={},E=[],g={},p={},v=function(e,t,n){var r=i[e];return r?r=Jo(r,/[, ]/,Jo(r.toUpperCase(),/[, ]/)):(r=Yo[e])||(r=Jo(t," ",Jo(t.toUpperCase()," ")),r=Zo(r,n),Yo[e]=r),r};n=ri((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=oi(i.valid_styles),t=oi(i.invalid_styles,"map"),s=oi(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),c=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",c),d=v("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),l=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),h=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Qo((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){p[e]=new RegExp("</"+e+"[^>]*>","gi")});var z=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},b=function(e){var t,n,r,o,i,a,u,s,l,c,f,d,h,m,g,p,v,b,y,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,w=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,x=/[*?+]/;if(e)for(e=ni(e,","),N["@"]&&(p=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(m=i[1],l=i[2],g=i[3],s=i[5],a={attributes:d={},attributesOrder:h=[]},"#"===m&&(a.paddEmpty=!0),"-"===m&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),p){for(b in p)d[b]=p[b];h.push.apply(h,v)}if(s)for(r=0,o=(s=ni(s,"|")).length;r<o;r++)if(i=w.exec(s[r])){if(u={},f=i[1],c=i[2].replace(/[\\:]:/g,":"),m=i[3],y=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(c),u.required=!0),"-"===f){delete d[c],h.splice(ti(h,c),1);continue}m&&("="===m&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:c,value:y}),u.defaultValue=y),":"===m&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:c,value:y}),u.forcedValue=y),"<"===m&&(u.validValues=Jo(y,"?"))),x.test(c)?(a.attributePatterns=a.attributePatterns||[],u.pattern=z(c),a.attributePatterns.push(u)):(d[c]||h.push(c),d[c]=u)}p||"@"!==l||(p=d,v=h),g&&(a.outputName=l,N[g]=a),x.test(l)?(a.pattern=z(l),E.push(a)):N[l]=a}},y=function(e){N={},E=[],b(e),Qo(n,function(e,t){m[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Yo.text_block_elements=Yo.block_elements=null,Qo(ni(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(m[o]=m[r],g[o]=r,n||(l[o.toUpperCase()]={},l[o]={}),!N[o]){var i=N[r];delete(i=Zo({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Qo(m,function(e,t){e[r]&&(m[t]=e=Zo({},m[t]),e[o]=e[r])})}))},w=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Yo[i.schema]=null,e&&Qo(ni(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?m[r[2]]:m[r[2]]={"#comment":{}},t=m[r[2]],Qo(ni(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},x=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?y(i.valid_elements):(Qo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},m[t]=e.children}),"html5"!==i.schema&&Qo(ni("strong/b em/i"),function(e){e=ni(e,"/"),N[e[1]].outputName=e[0]}),Qo(ni("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Qo(ni("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Qo(ni("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),w(i.valid_children),b(i.extended_valid_elements),w("+ol[ul|ol],+ul[ul|ol]"),Qo({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=ni(e))}),i.invalid_elements&&Qo(ei(i.invalid_elements),function(e){N[e]&&delete N[e]}),x("span")||b("span[!data-mce-type|*]"),{children:m,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return l},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return h},getBoolAttrs:function(){return u},getElementRule:x,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return c},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return p},isValidChild:function(e,t){var n=m[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=x(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return g},addValidElements:b,setValidElements:y,addCustomElements:C,addValidChildren:w}}var ai=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function ui(y,e){var C,t,l,c,w=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,x=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,z={},S="\ufeff";for(y=y||{},e&&(l=e.getValidStyles(),c=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+S).split(" "),C=0;C<t.length;C++)z[t[C]]=S+C,z[S+C]=t[C];return{toHex:function(e){return e.replace(w,ai)},parse:function(e){var t,n,r,o,i,a,u,s,l={},c=y.url_converter,f=y.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=l[e+"-top"+t])&&(o=l[e+"-right"+t])&&(i=l[e+"-bottom"+t])&&(a=l[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(l[e+t]=-1===C?u[0]:u.join(" "),delete l[e+"-top"+t],delete l[e+"-right"+t],delete l[e+"-bottom"+t],delete l[e+"-left"+t])}},h=function(e){var t,n=l[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return l[e]=n[0],!0}},m=function(e){return o=!0,z[e]},g=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return z[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},p=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,p)},b=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=g(o)).replace(/\'/g,"\\'")+"'";if(t=g(t||n||r),!y.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!y.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return c&&(t=c.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,m).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,m)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(S)||-1!==n.indexOf('"'))continue;if(!y.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(w,ai)).replace(x,b),l[n]=o?g(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",h(a="border-width")&&h(u)&&h(s)&&(l[i]=l[a]+" "+l[u]+" "+l[s],delete l[a],delete l[u],delete l[s]),"medium none"===l.border&&delete l.border,"none"===l["border-image"]&&delete l["border-image"]}return l},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=l[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&l)s("*"),s(e);else for(t in i)!(n=i[t])||c&&(r=t,o=e,a=void 0,(a=c["*"])&&a[r]||(a=c[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var si,li=Gt.each,ci=Gt.grep,fi=he.ie,di=/^([a-z0-9],?)+$/i,hi=/^[ \t\r\n]*$/,mi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},gi=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},pi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function vi(a,u){var s,l=this;void 0===u&&(u={});var r={},i=j.window,o={},t=0,e=function U(m,g){void 0===g&&(g={});var p,v=0,b={};p=g.maxLoadTime||5e3;var y=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(e){a.status=e,a.passed=[],a.failed=[],o&&(o.onload=null,o.onerror=null,o=null)},s=function(){for(var e=a.passed,t=e.length;t--;)e[t]();u(2)},l=function(){for(var e=a.failed,t=e.length;t--;)e[t]();u(3)},c=function(e,t){e()||((new Date).getTime()-i<p?be.setTimeout(t):l())},f=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return s(),!0},f)},d=function(){c(function(){try{var e=r.sheet.cssRules;return s(),!!e}catch(t){}},d)};if(e=Gt._addCacheSuffix(e),b[e]?a=b[e]:(a={passed:[],failed:[]},b[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+v++,o.async=!1,o.defer=!1,i=(new Date).getTime(),g.contentCssCors&&(o.crossOrigin="anonymous"),"onload"in o&&!((h=j.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(h[1],10)<536))o.onload=f,o.onerror=l;else{if(0<j.navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',d(),void y(r);f()}var h;y(o),o.href=e}else l();else s()},t=function(t){return eo.nu(function(e){n(t,q(e,$(io.value(t))),q(e,$(io.error(t))))})},o=function(e){return e.fold(W,W)};return{load:n,loadAll:function(e,n,r){no(K(e,t)).get(function(e){var t=X(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a,{contentCssCors:u.contentCssCors}),c=[],f=u.schema?u.schema:ii({}),d=ui({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),h=u.ownEvents?new ke(u.proxy):ke.Event,n=f.getBlockElements(),m=pn.overrideDefaults(function(){return{context:a,element:F.getRoot()}}),g=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},p=function(e){return"string"==typeof e&&(e=g(e)),m(e)},v=function(e,t,n){var r,o,i=p(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=g(e);return t?t.attributes:[]},y=function(e,t,n){var r,o;""===n&&(n=null);var i=p(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},w=function(e,t){return Gr.getPos(a.body,g(e),t)},x=function(e,t,n){var r=p(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=he.ie&&he.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=g(e),t=x(e,"width"),n=x(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(di.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<kt(t,i[0].ownerDocument||i[0],null,i).length},z=function(e,t,n,r){var o,i=[],a=g(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Gt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},S=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?g(e):e;if(!t)return!1;if(Gt.isArray(t)&&(t.length||0===t.length))return o=[],li(t,function(e,t){e&&("string"==typeof e&&(e=g(e)),o.push(n.call(r,e,t)))}),o;var i=r||l;return n.call(i,t)},T=function(e,t){p(e).each(function(e,n){li(t,function(e,t){y(n,t,e)})})},A=function(e,r){var t=p(e);fi?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){pn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return T(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&A(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},M=Xo.decode,B=Xo.encodeAllRaw,O=function(e,t){var n=p(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},_=function(e,t,n){p(e).toggleClass(t,n).each(function(){""===this.className&&pn(this).attr("class",null)})},H=function(t,e,n){return k(e,function(e){return Gt.is(e,"array")&&(t=t.cloneNode(!0)),n&&li(ci(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},P=function(){return a.createRange()},L=function(e,t,n,r){if(Gt.isArray(e)){for(var o=e.length;o--;)e[o]=L(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||c.push([e,t,n,r]),h.bind(e,t,n,r||F)},V=function(e,t,n){var r;if(Gt.isArray(e)){for(r=e.length;r--;)e[r]=V(e[r],t,n);return e}if(c&&(e===a||e===i))for(r=c.length;r--;){var o=c[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||h.unbind(o[0],o[1],o[2])}return h.unbind(e,t,n)},I=function(e){if(e&&Oo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},F={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:c,styles:d,schema:f,events:h,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:m,$$:p,root:null,clone:function(t,e){if(!fi||1!==t.nodeType||e)return t.cloneNode(e);if(e)return null;var n=a.createElement(t.nodeName);return li(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),n},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=g(e),t=w(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=z(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:z,get:g,getNext:function(e,t){return S(e,t,"nextSibling")},getPrev:function(e,t){return S(e,t,"previousSibling")},select:function(e,t){return kt(e,g(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+B(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:O,setStyle:function(e,t,n){var r=p(e).css(t,n);u.update_styles&&gi(d,r)},getStyle:x,setStyles:function(e,t){var n=p(e).css(t);u.update_styles&&gi(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:y,setAttribs:T,getAttrib:v,getPos:w,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(F!==vi.DOM&&a===j.document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;F===vi.DOM||a!==j.document?(e||(e=""),n=a.getElementsByTagName("head")[0],li(e.split(","),function(e){var t;e=Gt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):vi.DOM.loadCSS(e)},addClass:function(e,t){p(e).addClass(t)},removeClass:function(e,t){_(e,t,!1)},hasClass:function(e,t){return p(e).hasClass(t)},toggleClass:_,show:function(e){p(e).show()},hide:function(e){p(e).hide()},isHidden:function(e){return"none"===p(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:A,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return Oo.isElement(t)?t.outerHTML:pn("<div></div>").append(pn(t).clone()).html()},setOuterHTML:function(e,t){p(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}O(pn(this).html(t),!0)})},decode:M,encode:B,insertAfter:function(e,t){var r=g(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:H,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),li(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),H(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Gt.trim(e))},run:k,getAttribs:b,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new ao(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Oo.isElement(e)){var l=e.getAttribute("data-mce-bogus");if(l){e=a.next("all"===l);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"!==u)return!1;s++,e=a.next();continue}for(n=(r=b(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!hi.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&hi.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:P,nodeIndex:pi,split:function(e,t,n){var r,o,i,a=P();if(e&&t)return a.setStart(e.parentNode,pi(e)),a.setEnd(t.parentNode,pi(t)),r=a.extractContents(),(a=P()).setStart(t.parentNode,pi(t)+1),a.setEnd(e.parentNode,pi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Po.trimNode(F,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Po.trimNode(F,o),e),O(e),n||t},bind:L,unbind:V,fire:function(e,t,n){return h.fire(e,t,n)},getContentEditable:I,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=I(e));e=e.parentNode);return n},destroy:function(){if(c)for(var e=c.length;e--;){var t=c[e];h.unbind(t[0],t[1],t[2])}kt.setDocument&&kt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=mi(d,u,function(){return F}),F}(si=vi||(vi={})).DOM=si(j.document),si.nodeIndex=pi;var bi=vi,yi=bi.DOM,Ci=Gt.each,wi=Gt.grep,xi=function(e){return"function"==typeof e},Ni=function(){var u={},o=[],s={},l=[],c=0,f=function(e,t,n){var r,o,i=yi;o=i.uniqueId(),(r=j.document.createElement("script")).id=o,r.type="text/javascript",r.src=Gt._addCacheSuffix(e),r.onload=function(){i.remove(o),r&&(r.onreadystatechange=r.onload=r=null),t()},r.onerror=function(){xi(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e)},(j.document.getElementsByTagName("head")[0]||j.document.body).appendChild(r)};this.loadScript=function(e,t,n){f(e,t,n)},this.isDone=function(e){return 2===u[e]},this.markDone=function(e){u[e]=2},this.add=this.load=function(e,t,n,r){u[e]===undefined&&(o.push(e),u[e]=0),t&&(s[e]||(s[e]=[]),s[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete u[e],delete s[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var o,i=[],a=function(t,e){Ci(s[e],function(e){xi(e[t])&&e[t].call(e.scope)}),s[e]=undefined};l.push({success:e,failure:r,scope:t||this}),(o=function(){var e=wi(n);if(n.length=0,Ci(e,function(e){2!==u[e]?3!==u[e]?1!==u[e]&&(u[e]=1,c++,f(e,function(){u[e]=2,c--,a("success",e),o()},function(){u[e]=3,c--,i.push(e),a("failure",e),o()})):a("failure",e):a("success",e)}),!c){var t=l.slice(0);l.length=0,Ci(t,function(e){0===i.length?xi(e.success)&&e.success.call(e.scope):xi(e.failure)&&e.failure.call(e.scope,i)})}})()}};Ni.ScriptLoader=new Ni;var Ei,zi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return zi(n())}}},Si={},ki=zi("en"),Ti={setCode:function(e){e&&ki.set(e)},getCode:function(){return ki.get()},add:function(e,t){var n=Si[e];for(var r in n||(Si[e]=n={}),t)n[r.toLowerCase()]=t[r]},translate:function(e){var t,n,r=Si[ki.get()]||{},o=function(e){return O(e)?Object.prototype.toString.call(e):i(e)?"":""+e},i=function(e){return""===e||null===e||e===undefined},a=function(e){var t=o(e),n=t.toLowerCase();return br(r,n)?o(r[n]):t},u=function(e){return e.replace(/{context:\w+}$/,"")},s=function(e){return e};if(i(e))return s("");if(R(t=e)&&br(t,"raw"))return s(o(e.raw));if(D(n=e)&&1<n.length){var l=e.slice(1);return s(u(a(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return br(l,t)?o(l[t]):e})))}return s(u(a(e)))},isRtl:function(){return vr(Si,ki.get()).bind(function(e){return vr(e,"_dir")}).exists(function(e){return"rtl"===e})},hasCode:function(e){return br(Si,e)}},Ai=Gt.each;function Ri(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},l=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},c=function(e,n,t,r){var o=s(e);Ai(o,function(e){var t=l(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(Ni))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Ri.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?c(e,t,n,r):Ni.ScriptLoader.add(i,function(){return c(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Ti.getCode();if(n&&!1!==Ri.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Ni.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=X(i,function(e){return e.name===t});return i=r.fail,Ai(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:l,addComponents:function(e,t){var n=r.urls[e];Ai(t,function(e){Ni.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Ei=Ri||(Ri={})).PluginManager=Ei(),Ei.ThemeManager=Ei();var Di=function(t,n){Vr(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Mi=function(e,t){Fr(e).fold(function(){Vr(e).each(function(e){Oi(e,t)})},function(e){Di(e,t)})},Bi=function(t,n){Wr(t).fold(function(){Oi(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Oi=function(e,t){e.dom().appendChild(t.dom())},_i=function(t,e){L(e,function(e){Oi(t,e)})},Hi=function(e){e.dom().textContent="",L(qr(e),function(e){Pi(e)})},Pi=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Li=function(e){var t,n=qr(e);0<n.length&&(t=e,L(n,function(e){Di(t,e)})),Pi(e)},Vi=function(n,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=setTimeout(function(){n.apply(null,e),o=null},r))}}},Ii=function(e,t){var n=xr(e,t);return n===undefined||""===n?[]:n.split(" ")},Fi=function(e){return e.dom().classList!==undefined},Ui=function(e,t){return o=t,i=Ii(n=e,r="class").concat([o]),Cr(n,r,i.join(" ")),!0;var n,r,o,i},ji=function(e,t){return o=t,0<(i=V(Ii(n=e,r="class"),function(e){return e!==o})).length?Cr(n,r,i.join(" ")):Nr(n,r),!1;var n,r,o,i},qi=function(e,t){Fi(e)?e.dom().classList.add(t):Ui(e,t)},$i=function(e){0===(Fi(e)?e.dom().classList:Ii(e,"class")).length&&Nr(e,"class")},Wi=function(e,t){return Fi(e)&&e.dom().classList.contains(t)},Ki=function(e,t){var n=[];return L(qr(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ki(e,t))}),n},Xi=function(e,t){return n=t,o=(r=e)===undefined?j.document:r.dom(),_r(o)?[]:K(o.querySelectorAll(n),or.fromDom);var n,r,o};function Yi(e,t,n,r,o){return e(n,r)?T.some(n):O(o)&&o(n)?T.none():t(n,r,o)}var Gi,Ji=function(e,t,n){for(var r=e.dom(),o=O(n)?n:$(!1);r.parentNode;){r=r.parentNode;var i=or.fromDom(r);if(t(i))return T.some(i);if(o(i))break}return T.none()},Qi=function(e,t,n){return Yi(function(e){return t(e)},Ji,e,t,n)},Zi=function(e,t,n){return Ji(e,function(e){return Or(e,t)},n)},ea=function(e,t){return n=t,o=(r=e)===undefined?j.document:r.dom(),_r(o)?T.none():T.from(o.querySelector(n)).map(or.fromDom);var n,r,o},ta=function(e,t,n){return Yi(Or,Zi,e,t,n)},na=$("mce-annotation"),ra=$("data-mce-annotation"),oa=$("data-mce-annotation-uid"),ia=function(r,e){var t=r.selection.getRng(),n=or.fromDom(t.startContainer),o=or.fromDom(r.getBody()),i=e.fold(function(){return"."+na()},function(e){return"["+ra()+'="'+e+'"]'}),a=$r(n,t.startOffset).getOr(n),u=ta(a,i,function(e){return Hr(e,o)}),s=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?T.some(xr(e,t)):T.none();var n,r};return u.bind(function(e){return s(e,""+oa()).bind(function(n){return s(e,""+ra()).map(function(e){var t=aa(r,n);return{uid:n,name:e,elements:t}})})})},aa=function(e,t){var n=or.fromDom(e.getBody());return Xi(n,"["+oa()+'="'+t+'"]')},ua=function(i,e){var n,r,o,a=zi({}),l=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:zi(T.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=dr(r),(n=Z.call(e,0)).sort(t),n);L(o,function(e){u(e,function(u){var s=u.previous.get();return ia(i,T.some(e)).fold(function(){var t;s.isSome()&&(l(t=e,function(e){L(e.listeners,function(e){return e(!1,t)})}),u.previous.set(T.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,l(t=i,function(e){L(e.listeners,function(e){return e(!0,t,{uid:n,nodes:K(r,function(e){return e.dom()})})})}),u.previous.set(T.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&clearTimeout(o),o=setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},sa=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){L(e,function(t){var e;(e=t,T.from(e.attributes.map[ra()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},la=function(){return(la=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ca=0,fa=function(e,t){return or.fromDom(e.dom().cloneNode(t))},da=function(e){return fa(e,!1)},ha=function(e){return fa(e,!0)},ma=function(e,t){var n,r,o=Lr(e).dom(),i=or.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||j.document).createElement("div")).innerHTML=n,qr(or.fromDom(r)));_i(i,a),Hi(e),Oi(e,i)},ga="\ufeff",pa=function(e){return e===ga},va=ga,ba=function(e){return e.replace(new RegExp(ga,"g"),"")},ya=Oo.isElement,Ca=Oo.isText,wa=function(e){return Ca(e)&&(e=e.parentNode),ya(e)&&e.hasAttribute("data-mce-caret")},xa=function(e){return Ca(e)&&pa(e.data)},Na=function(e){return wa(e)||xa(e)},Ea=function(e){return e.firstChild!==e.lastChild||!Oo.isBr(e.firstChild)},za=function(e){var t=e.container();return!(!e||!Oo.isText(t))&&(t.data.charAt(e.offset())===va||e.isAtStart()&&xa(t.previousSibling))},Sa=function(e){var t=e.container();return!(!e||!Oo.isText(t))&&(t.data.charAt(e.offset()-1)===va||e.isAtEnd()&&xa(t.nextSibling))},ka=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=j.document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Ta=function(e){return Ca(e)&&e.data[0]===va},Aa=function(e){return Ca(e)&&e.data[e.data.length-1]===va},Ra=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Oo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Da=Oo.isContentEditableTrue,Ma=Oo.isContentEditableFalse,Ba=Oo.isBr,Oa=Oo.isText,_a=Oo.matchNodeNames("script style textarea"),Ha=Oo.matchNodeNames("img input textarea hr iframe video audio object"),Pa=Oo.matchNodeNames("table"),La=Na,Va=function(e){return!La(e)&&(Oa(e)?!_a(e.parentNode):Ha(e)||Ba(e)||Pa(e)||Ia(e))},Ia=function(e){return!1===(t=e,Oo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Ma(e);var t},Fa=function(e,t){return Va(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Ia(e))return!1;if(Da(e))return!0}return!0}(e,t)},Ua=Math.round,ja=function(e){return e?{left:Ua(e.left),top:Ua(e.top),bottom:Ua(e.bottom),right:Ua(e.right),width:Ua(e.width),height:Ua(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},qa=function(e,t){return(e=ja(e)).right=(t||(e.left=e.left+e.width),e.left),e.width=0,e},$a=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Wa=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&$a(t.top-e.bottom,e,t)},Ka=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&$a(t.bottom-e.top,e,t)},Xa=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Ya=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Ga=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),Ja=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Ga.test(e)},Qa=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return T.none();n.push(o.getOrDie())}return T.some(t.apply(null,n))},Za=[].slice,eu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Za.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},tu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Za.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},nu=Oo.isElement,ru=Va,ou=Oo.matchStyleValues("display","block table"),iu=Oo.matchStyleValues("float","left right"),au=eu(nu,ru,y(iu)),uu=y(Oo.matchStyleValues("white-space","pre pre-line pre-wrap")),su=Oo.isText,lu=Oo.isBr,cu=bi.nodeIndex,fu=Ya,du=function(e){return"createRange"in e?e.createRange():bi.DOM.createRng()},hu=function(e){return e&&/[\r\n\t ]/.test(e)},mu=function(e){return!!e.setStart&&!!e.setEnd},gu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(hu(e.toString())&&uu(n.parentNode)&&Oo.isText(n)&&(t=n.data,hu(t[r-1])||hu(t[r+1])))},pu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},vu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?ja(n[0]):ja(e.getBoundingClientRect()),!mu(e)&&lu(e)&&pu(t)?(i=(r=e).ownerDocument,a=du(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=ja(a.getBoundingClientRect()),s.removeChild(u),o):pu(t)&&mu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Oo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),vu(i)}return null}(e):t},bu=function(e,t){var n=qa(e,t);return n.width=1,n.right=n.left+1,n},yu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=du(e.ownerDocument);if(t<e.data.length){if(Ja(e.data[t]))return r;if(Ja(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!gu(n)))return o(bu(vu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),gu(n)||o(bu(vu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),gu(n)||o(bu(vu(n),!0)))};if(su(e.container()))return i(e.container(),e.offset()),r;if(nu(e.container()))if(e.isAtEnd())n=fu(e.container(),e.offset()),su(n)&&i(n,n.data.length),au(n)&&!lu(n)&&o(bu(vu(n),!1));else{if(n=fu(e.container(),e.offset()),su(n)&&i(n,0),au(n)&&e.isAtEnd())return o(bu(vu(n),!1)),r;t=fu(e.container(),e.offset()-1),au(t)&&!lu(t)&&(ou(t)||ou(n)||!au(n))&&o(bu(vu(t),!1)),au(n)&&o(bu(vu(n),!0))}return r};function Cu(t,n,e){var r=function(){return e||(e=yu(Cu(t,n))),e};return{container:$(t),offset:$(n),toRange:function(){var e;return(e=du(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return su(t),0===n},isAtEnd:function(){return su(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return fu(t,e?n-1:n)}}}(Gi=Cu||(Cu={})).fromRangeStart=function(e){return Gi(e.startContainer,e.startOffset)},Gi.fromRangeEnd=function(e){return Gi(e.endContainer,e.endOffset)},Gi.after=function(e){return Gi(e.parentNode,cu(e)+1)},Gi.before=function(e){return Gi(e.parentNode,cu(e))},Gi.isAbove=function(e,t){return Qa([te(t.getClientRects()),ne(e.getClientRects())],Wa).getOr(!1)},Gi.isBelow=function(e,t){return Qa([ne(t.getClientRects()),te(e.getClientRects())],Ka).getOr(!1)},Gi.isAtStart=function(e){return!!e&&e.isAtStart()},Gi.isAtEnd=function(e){return!!e&&e.isAtEnd()},Gi.isTextPosition=function(e){return!!e&&Oo.isText(e.container())},Gi.isElementPosition=function(e){return!1===Gi.isTextPosition(e)};var wu,xu,Nu=Cu,Eu=Oo.isText,zu=Oo.isBogus,Su=bi.nodeIndex,ku=function(e){var t=e.parentNode;return zu(t)?ku(t):t},Tu=function(e){return e?$t.reduce(e.childNodes,function(e,t){return zu(t)&&"BR"!==t.nodeName?e=e.concat(Tu(t)):e.push(t),e},[]):[]},Au=function(t){return function(e){return t===e}},Ru=function(e){var t,r,n,o;return(Eu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Tu(ku(t=e)),n=$t.findIndex(r,Au(t),t),r=r.slice(0,n+1),o=$t.reduce(r,function(e,t,n){return Eu(t)&&Eu(r[n-1])&&e++,e},0),r=$t.filter(r,Oo.matchNodeNames(t.nodeName)),(n=$t.findIndex(r,Au(t),t))-o)+"]"},Du=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Eu(n)?o=function(e,t){for(;(e=e.previousSibling)&&Eu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Ru(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=$t.filter(a,y(Oo.isBogus)),(u=u.concat($t.map(a,function(e){return Ru(e)}))).reverse().join("/")+","+o},Mu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=$t.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Tu(n),i=$t.filter(i,function(e,t){return!Eu(e)||!Eu(i[t-1])}),(i=$t.filter(i,Oo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Eu(r)?function(e,t){for(var n,r=e,o=0;Eu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!Eu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Eu(e)&&t>e.data.length&&(t=e.data.length),Nu(e,t)}(r,parseInt(o,10)):(o="after"===o?Su(r)+1:Su(r),Nu(r.parentNode,o)):null):null},Bu=function(e,t){Oo.isText(t)&&0===t.data.length&&e.remove(t)},Ou=function(e,t,n){var r,o,i,a,u,s,l;Oo.isDocumentFragment(n)?(i=e,a=t,u=n,s=T.from(u.firstChild),l=T.from(u.lastChild),a.insertNode(u),s.each(function(e){return Bu(i,e.previousSibling)}),l.each(function(e){return Bu(i,e.nextSibling)})):(r=e,o=n,t.insertNode(o),Bu(r,o.previousSibling),Bu(r,o.nextSibling))},_u=Oo.isContentEditableFalse,Hu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],l=0,c=e.getRoot();for(Oo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Oo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(l=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+l));a&&a!==c;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},Pu=function(e,t,n){var r=0;return Gt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Lu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Oo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Vu=function(e){return Lu(e,!0),Lu(e,!1),e},Iu=function(e,t){var n;if(Oo.isElement(e)&&(e=Ya(e,t),_u(e)))return e;if(Na(e)){if(Oo.isText(e)&&wa(e)&&(e=e.parentNode),n=e.previousSibling,_u(n))return n;if(n=e.nextSibling,_u(n))return n}},Fu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(_u(r)||"IMG"===o)return{name:o,index:Pu(n.dom,o,r)};var a,u,s,l,c,f,d,h=Iu((a=i).startContainer,a.startOffset)||Iu(a.endContainer,a.endOffset);return h?{name:o=h.tagName,index:Pu(n.dom,o,h)}:(u=e,l=t,c=i,f=(s=n).dom,(d={}).start=Hu(f,u,l,c,!0),s.isCollapsed()||(d.end=Hu(f,u,l,c,!1)),d)},Uu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},ju=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Pu(n,u,a)};var s=Vu(r.cloneRange());if(!i){s.collapse(!1);var l=Uu(n,o+"_end",t);Ou(n,s,l)}(r=Vu(r)).collapse(!0);var c=Uu(n,o+"_start",t);return Ou(n,r,c),e.moveToBookmark({id:o,keep:1}),{id:o}},qu={getBookmark:function(e,t,n){return 2===t?Fu(ba,n,e):3===t?(o=(r=e).getRng(),{start:Du(r.dom.getRoot(),Nu.fromRangeStart(o)),end:Du(r.dom.getRoot(),Nu.fromRangeEnd(o))}):t?{rng:e.getRng()}:ju(e,!1);var r,o},getUndoBookmark:d(Fu,W,!0),getPersistentBookmark:ju},$u="_mce_caret",Wu=function(e){return Oo.isElement(e)&&e.id===$u},Ku=function(e,t){for(;t&&t!==e;){if(t.id===$u)return t;t=t.parentNode}return null},Xu=Oo.isElement,Yu=Oo.isText,Gu=function(e){var t=e.parentNode;t&&t.removeChild(e)},Ju=function(e,t){0===t.length?Gu(e):e.nodeValue=t},Qu=function(e){var t=ba(e);return{count:e.length-t.length,text:t}},Zu=function(e,t){return ns(e),t},es=function(e,t){var n,r,o,i=t.container(),a=(n=re(i.childNodes),r=e,o=H(n,r),-1===o?T.none():T.some(o)).map(function(e){return e<t.offset()?Nu(i,t.offset()-1):t}).getOr(t);return ns(e),a},ts=function(e,t){return Yu(e)&&t.container()===e?(r=t,o=Qu((n=e).data.substr(0,r.offset())),i=Qu(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(Ju(n,a),Nu(n,r.offset()-o.count)):r):Zu(e,t);var n,r,o,i,a},ns=function(e){if(Xu(e)&&Na(e)&&(Ea(e)?e.removeAttribute("data-mce-caret"):Gu(e)),Yu(e)){var t=ba(function(e){try{return e.nodeValue}catch(t){return""}}(e));Ju(e,t)}},rs={removeAndReposition:function(e,t){return Nu.isTextPosition(t)?ts(e,t):(n=e,(r=t).container()===n.parentNode?es(n,r):Zu(n,r));var n,r},remove:ns},os=nr.detect().browser,is=Oo.isContentEditableFalse,as=function(e,t,n){var r,o,i,a,u,s=qa(t.getBoundingClientRect(),n);return i="BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},us=function(a,u,e){var t,s,l=zi(T.none()),c=function(){!function(e){var t,n,r,o,i;for(t=pn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Aa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Ta(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(rs.remove(s),s=null),l.get().each(function(e){pn(e.caret).remove(),l.set(T.none())}),clearInterval(t)},f=function(){t=be.setInterval(function(){e()?pn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):pn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(c(),o=e,Oo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(va),o=e.parentNode,t){if(n=e.previousSibling,Ca(n)){if(Na(n))return n;if(Aa(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Ca(n)){if(Na(n))return n;if(Ta(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),is(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=ka("p",e,t),n=as(a,e,t),pn(s).css("top",n.top);var i=pn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return l.set(T.some({caret:i,element:e,before:t})),l.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:c,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){l.get().each(function(e){var t=as(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return be.clearInterval(t)}}},ss=function(){return os.isIE()||os.isEdge()||os.isFirefox()},ls=function(e){return is(e)||Oo.isTable(e)&&ss()},cs=Oo.isContentEditableFalse,fs=Oo.matchStyleValues("display","block table table-cell table-caption list-item"),ds=Na,hs=wa,ms=Oo.isElement,gs=Va,ps=function(e){return 0<e},vs=function(e){return e<0},bs=function(e,t){for(var n;n=e(t);)if(!hs(n))return n;return null},ys=function(e,t,n,r,o){var i=new ao(e,r);if(vs(t)){if((cs(e)||hs(e))&&n(e=bs(i.prev,!0)))return e;for(;e=bs(i.prev,o);)if(n(e))return e}if(ps(t)){if((cs(e)||hs(e))&&n(e=bs(i.next,!0)))return e;for(;e=bs(i.next,o);)if(n(e))return e}return null},Cs=function(e,t){for(;e&&e!==t;){if(fs(e))return e;e=e.parentNode}return null},ws=function(e,t,n){return Cs(e.container(),n)===Cs(t.container(),n)},xs=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),ms(n)?n.childNodes[r+e]:null):null},Ns=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Es=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],ds(r)&&(r=r[o]),cs(r)){if(a=n,Cs(r,i=t)===Cs(a,i))return r;break}if(gs(r))break;n=n.parentNode}return null},zs=d(Ns,!0),Ss=d(Ns,!1),ks=function(e,t,n){var r,o,i,a,u=d(Es,!0,t),s=d(Es,!1,t);if(o=n.startContainer,i=n.startOffset,wa(o)){if(ms(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,ls(r)))return zs(r);if("after"===a&&(r=o.previousSibling,ls(r)))return Ss(r)}if(!n.collapsed)return n;if(Oo.isText(o)){if(ds(o)){if(1===e){if(r=s(o))return zs(r);if(r=u(o))return Ss(r)}if(-1===e){if(r=u(o))return Ss(r);if(r=s(o))return zs(r)}return n}if(Aa(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?zs(r):n;if(Ta(o)&&i<=1)return-1===e&&(r=u(o))?Ss(r):n;if(i===o.data.length)return(r=s(o))?zs(r):n;if(0===i)return(r=u(o))?Ss(r):n}return n},Ts=function(e,t){return T.from(xs(e?0:-1,t)).filter(cs)},As=function(e,t,n){var r=ks(e,t,n);return-1===e?Cu.fromRangeStart(r):Cu.fromRangeEnd(r)},Rs=function(e){return T.from(e.getNode()).map(or.fromDom)},Ds=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Ms=function(e,t){var n=ws(e,t);return!(n||!Oo.isBr(e.getNode()))||n};(xu=wu||(wu={}))[xu.Backwards=-1]="Backwards",xu[xu.Forwards=1]="Forwards";var Bs=Oo.isContentEditableFalse,Os=Oo.isText,_s=Oo.isElement,Hs=Oo.isBr,Ps=Va,Ls=function(e){return Ha(e)||!!Ia(t=e)&&!0!==I(re(t.getElementsByTagName("*")),function(e,t){return e||Da(t)},!1);var t},Vs=Fa,Is=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Fs=function(e,t){if(ps(e)){if(Ps(t.previousSibling)&&!Os(t.previousSibling))return Nu.before(t);if(Os(t))return Nu(t,0)}if(vs(e)){if(Ps(t.nextSibling)&&!Os(t.nextSibling))return Nu.after(t);if(Os(t))return Nu(t,t.data.length)}return vs(e)?Hs(t)?Nu.before(t):Nu.after(t):Nu.before(t)},Us=function(e,t,n){var r,o,i,a,u;if(!_s(n)||!t)return null;if(t.isEqual(Nu.after(n))&&n.lastChild){if(u=Nu.after(n.lastChild),vs(e)&&Ps(n.lastChild)&&_s(n.lastChild))return Hs(n.lastChild)?Nu.before(n.lastChild):u}else u=t;var s,l,c,f=u.container(),d=u.offset();if(Os(f)){if(vs(e)&&0<d)return Nu(f,--d);if(ps(e)&&d<f.length)return Nu(f,++d);r=f}else{if(vs(e)&&0<d&&(o=Is(f,d-1),Ps(o)))return!Ls(o)&&(i=ys(o,e,Vs,o))?Os(i)?Nu(i,i.data.length):Nu.after(i):Os(o)?Nu(o,o.data.length):Nu.before(o);if(ps(e)&&d<f.childNodes.length&&(o=Is(f,d),Ps(o)))return Hs(o)?(s=n,(c=(l=o).nextSibling)&&Ps(c)?Os(c)?Nu(c,0):Nu.before(c):Us(wu.Forwards,Nu.after(l),s)):!Ls(o)&&(i=ys(o,e,Vs,o))?Os(i)?Nu(i,0):Nu.before(i):Os(o)?Nu(o,0):Nu.after(o);r=o||u.getNode()}return(ps(e)&&u.isAtEnd()||vs(e)&&u.isAtStart())&&(r=ys(r,e,$(!0),n,!0),Vs(r,n))?Fs(e,r):(o=ys(r,e,Vs,n),!(a=$t.last(V(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),Bs)))||o&&a.contains(o)?o?Fs(e,o):null:u=ps(e)?Nu.after(a):Nu.before(a))},js=function(t){return{next:function(e){return Us(wu.Forwards,e,t)},prev:function(e){return Us(wu.Backwards,e,t)}}},qs=function(e){return Nu.isTextPosition(e)?0===e.offset():Va(e.getNode())},$s=function(e){if(Nu.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Va(e.getNode(!0))},Ws=function(e,t){return!Nu.isTextPosition(e)&&!Nu.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Ks=function(e,t,n){return e?!Ws(t,n)&&(r=t,!(!Nu.isTextPosition(r)&&Oo.isBr(r.getNode())))&&$s(t)&&qs(n):!Ws(n,t)&&qs(t)&&$s(n);var r},Xs=function(e,t,n){var r=js(t);return T.from(e?r.next(n):r.prev(n))},Ys=function(t,n,r){return Xs(t,n,r).bind(function(e){return ws(r,e,n)&&Ks(t,r,e)?Xs(t,n,e):T.some(e)})},Gs=function(t,n,e,r){return Ys(t,n,e).bind(function(e){return r(e)?Gs(t,n,e,r):T.some(e)})},Js=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Oo.isText(u)?T.some(Nu(u,e?0:u.data.length)):u?Va(u)?T.some(e?Nu.before(u):(a=u,Oo.isBr(a)?Nu.before(a):Nu.after(a))):(r=t,o=u,i=(n=e)?Nu.before(o):Nu.after(o),Xs(n,r,i)):T.none()},Qs=d(Xs,!0),Zs=d(Xs,!1),el={fromPosition:Xs,nextPosition:Qs,prevPosition:Zs,navigate:Ys,navigateIgnore:Gs,positionIn:Js,firstPositionIn:d(Js,!0),lastPositionIn:d(Js,!1)},tl=function(e,t){return!e.isBlock(t)||t.innerHTML||he.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},nl=function(e,t){return el.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},rl=function(e,t,n){return!(!1!==t.hasChildNodes()||!Ku(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(va),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},ol=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],l=e.getRoot();if(s){for(a=s[0],i=l,o=s.length-1;1<=o;o--){if(u=i.childNodes,rl(l,i,r))return!0;if(s[o]>u.length-1)return!!rl(l,i,r)||nl(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},il=function(e){return Oo.isText(e)&&0<e.data.length},al=function(e,t,n){var r,o,i,a,u,s,l=e.get(n.id+"_"+t),c=n.keep;if(l){if(r=l.parentNode,o="start"===t?c?l.hasChildNodes()?(r=l.firstChild,1):il(l.nextSibling)?(r=l.nextSibling,0):il(l.previousSibling)?(r=l.previousSibling,l.previousSibling.data.length):(r=l.parentNode,e.nodeIndex(l)+1):e.nodeIndex(l):c?l.hasChildNodes()?(r=l.firstChild,1):il(l.previousSibling)?(r=l.previousSibling,l.previousSibling.data.length):(r=l.parentNode,e.nodeIndex(l)):e.nodeIndex(l),u=r,s=o,!c){for(a=l.previousSibling,i=l.nextSibling,Gt.each(Gt.grep(l.childNodes),function(e){Oo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});l=e.get(n.id+"_"+t);)e.remove(l,!0);a&&i&&a.nodeType===i.nodeType&&Oo.isText(a)&&!he.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return T.some(Nu(u,s))}return T.none()},ul=function(e,t){var n,r,o,i,a,u,s,l,c,f,d,h,m,g,p,v,b=e.dom;if(t){if(v=t,Gt.isArray(v.start))return g=t,p=(m=b).createRng(),ol(m,!0,g,p)&&ol(m,!1,g,p)?T.some(p):T.none();if("string"==typeof t.start)return T.some((f=t,d=(c=b).createRng(),h=Mu(c.getRoot(),f.start),d.setStart(h.container(),h.offset()),h=Mu(c.getRoot(),f.end),d.setEnd(h.container(),h.offset()),d));if(t.hasOwnProperty("id"))return s=al(o=b,"start",i=t),l=al(o,"end",i),Qa([s,(a=l,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(tl(o,e.container()),e.offset()),n.setEnd(tl(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=b,r=t,T.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return T.some(t.rng)}return T.none()},sl=function(e,t,n){return qu.getBookmark(e,t,n)},ll=function(t,e){ul(t,e).each(function(e){t.setRng(e)})},cl=function(e){return Oo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},fl=function(e){return e&&/^(IMG)$/.test(e.nodeName)},dl=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},hl=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},ml={isInlineBlock:fl,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!fl(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new ao(u=i[a],e.getParent(u,e.isBlock)):(r=new ao(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!dl(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!dl(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:dl,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:hl,getStyle:function(e,t,n){return hl(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},gl=cl,pl=ml.getParents,vl=ml.isWhiteSpaceNode,bl=ml.isTextBlock,yl=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Cl=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},wl=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1!==(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},xl=function(e,t,n,r,o,i){var a,u,s,l;if(3===n.nodeType){if(-1!==(s=wl(o,i,n,r)))return{container:n,offset:s};l=n}for(a=new ao(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||gl(u.parentNode)){if(e.isBlock(u)||ml.isEq(u,"BR"))break}else if(-1!==(s=wl(o,i,l=u)))return{container:u,offset:s};if(l)return{container:l,offset:r=o?0:l.length}},Nl=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=pl(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},El=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&bl(t,e)},u)}if(o&&e[0].wrapper&&(o=pl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!ml.isEq(o,"br")););return o||n},zl=function(e,t,n,r,o,i,a){var u,s,l,c,f,d;if(u=s=a?n:o,c=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!vl(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(l=s[c];l;l=l[c])if(!gl(l)&&!vl(l)&&("BR"!==(d=l).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Sl=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,l=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=Ya(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=Ya(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Cl(l,i),u=Cl(l,u),(gl(i.parentNode)||gl(i))&&(i=gl(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(gl(u.parentNode)||gl(u))&&(u=gl(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=xl(l,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=xl(l,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=yl(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=yl(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=zl(l,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=zl(l,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=Nl(l,n,t,i,"previousSibling"),u=Nl(l,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=El(e,n,i,"previousSibling"),u=El(e,n,u,"nextSibling"),n[0].block&&(l.isBlock(i)||(i=zl(l,n,i,a,u,s,!0)),l.isBlock(u)||(u=zl(l,n,i,a,u,s,!1)))),1===i.nodeType&&(a=l.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=l.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},kl=Gt.each,Tl=function(e,t,o){var n,r,i,a,u,s,l,c=t.startContainer,f=t.startOffset,d=t.endContainer,h=t.endOffset;if(0<(l=e.select("td[data-mce-selected],th[data-mce-selected]")).length)kl(l,function(e){o([e])});else{var m,g,p,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===c&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===h&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(g=h,p=(m=d).childNodes,--g>p.length-1?g=p.length-1:g<0&&(g=0),d=p[g]||m),c===d)return o(v([c]));for(n=e.findCommonAncestor(c,d),a=c;a;a=a.parentNode){if(a===d)return C(c,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===c)return C(d,n);if(a===n)break}r=y(c,n)||c,i=y(d,n)||d,C(c,r,!0),(s=b(r===c?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Al=function JN(n,r){var t=function(e){return n(e)?T.from(e.dom().nodeValue):T.none()},e=nr.detect().browser,o=e.isIE()&&10===e.version.major?function(e){try{return t(e)}catch(GN){return T.none()}}:t;return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return o(e).getOr("")},getOption:o,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(fr,"text"),Rl=function(e){return Al.get(e)},Dl=function(r,o,i,a){return Vr(o).fold(function(){return"skipping"},function(e){return"br"===a||fr(n=o)&&"\ufeff"===Rl(n)?"valid":cr(t=o)&&Wi(t,na())?"existing":Wu(o)?"caret":ml.isValid(r,i,a)&&ml.isValid(r,sr(e),i)?"valid":"invalid-child";var t,n})},Ml=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++ca+String(i)):a,s=function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),l=or.fromTag("span",e);qi(l,na()),Cr(l,""+oa(),u),Cr(l,""+ra(),n);var c,f=r(u,s),d=f.attributes,h=void 0===d?{}:d,m=f.classes,g=void 0===m?[]:m;return wr(l,h),c=l,L(g,function(e){qi(c,e)}),l},Bl=function(i,e,t,n,r){var a=[],u=Ml(i.getDoc(),r,t,n),s=zi(T.none()),l=function(){s.set(T.none())},c=function(e){L(e,o)},o=function(e){var t,n;switch(Dl(i,e,"span",sr(e))){case"invalid-child":l();var r=qr(e);c(r),l();break;case"valid":var o=s.get().getOrThunk(function(){var e=da(u);return a.push(e),s.set(T.some(e)),e});Di(t=e,n=o),Oi(n,t)}};return Tl(i.dom,e,function(e){var t;l(),t=K(e,or.fromDom),c(t)}),a},Ol=function(s,l,c,f){s.undoManager.transact(function(){var e,t,n,r,o=s.selection.getRng();if(o.collapsed&&(r=Sl(e=s,t=o,[{inline:!0}],3===(n=t).startContainer.nodeType&&n.startContainer.nodeValue.length>=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Ml(s.getDoc(),f,l,c.decorate);ma(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=qu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();Bl(s,u,l,c.decorate,f),s.selection.moveToBookmark(a)}})};function _l(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?T.from(n[e]).map(function(e){return e.settings}):T.none()}});sa(s,r);var o=ua(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){Ol(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ia(s,T.some(e)).each(function(e){var t=e.elements;L(t,Li)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=or.fromDom(t.getBody()),o=Xi(r,"["+ra()+'="'+n+'"]'),i={},L(o,function(e){var t=xr(e,oa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return K(e,function(e){return e.dom()})},gr(u,function(e,t,n){return{k:t,v:a(e,t,n)}})}}}var Hl,Pl=Object.prototype.hasOwnProperty,Ll=(Hl=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Pl.call(o,i)&&(n[i]=Hl(n[i],o[i]))}return n}),Vl=/^[ \t\r\n]*$/,Il={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Fl=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},Ul=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,Il[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t===undefined)return n.map[e];if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),t=this.lastChild,this.lastChild=t?((t.next=e).prev=t,e):this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=Fl(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=Fl(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Vl.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Vl.test(i.value))return!1;if(n&&n(i))return!1}while(i=Fl(i,this));return!0},a.prototype.walk=function(e){return Fl(this,null,e)},a}(),jl=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},ql=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function $l(V,I){void 0===I&&(I=ii());var e=function(){};!1!==(V=V||{}).fix_self_closing&&(V.fix_self_closing=!0);var F=V.comment?V.comment:e,U=V.cdata?V.cdata:e,j=V.text?V.text:e,q=V.start?V.start:e,$=V.end?V.end:e,W=V.pi?V.pi:e,K=V.doctype?V.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,h,u,s,m,l,g,c,f,p,v,b,y,C,w,x,N,E,z,S,k,T,A,R=0,D=[],M=0,B=Xo.decode,O=Gt.makeMap("src,href,data,background,formaction,poster,xlink:href"),_=/((java|vb)script|mhtml):/i,H=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&$(e.name);D.length=t}},P=function(e,t,n,r,o){var i,a,u,s,l;if(n=(t=t.toLowerCase())in m?t:B(n||r||o||""),g&&!h&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(O[t]&&!V.allow_script_urls){var c=n.replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(f){c=unescape(c)}if(_.test(c))return;if(l=c,!(s=V).allow_html_data_urls&&(/^data:image\//i.test(l)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(l):/^data:/i.test(l)))return}h&&(t in O||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(z=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),S=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=I.getShortEndedElements(),E=V.self_closing_elements||I.getSelfClosingElements(),m=I.getBoolAttrs(),g=V.validate,u=V.remove_internals,A=V.fix_self_closing,k=I.getSpecialElements(),N=e+">";t=z.exec(N);){if(R<t.index&&j(B(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),H(n);else if(n=t[7]){if(t.index+t[0].length>e.length){j(B(e.substr(t.index))),R=t.index+t[0].length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),l=n in s,A&&E[n]&&0<D.length&&D[D.length-1].name===n&&H(n);var L=ql(S,t[8]);if(null!==L){if("all"===L){R=jl(I,e,z.lastIndex),z.lastIndex=R;continue}f=!1}if(!g||(c=I.getElementRule(n))){if(f=!0,g&&(b=c.attributes,y=c.attributePatterns),(v=t[8])?((h=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(S,P)):(d=[]).map={},g&&!h){if(C=c.attributesRequired,w=c.attributesDefault,x=c.attributesForced,c.removeEmptyAttrs&&!d.length&&(f=!1),x)for(o=x.length;o--;)a=(p=x[o]).name,"{$uid}"===(T=p.value)&&(T="mce_"+M++),d.map[a]=T,d.push({name:a,value:T});if(w)for(o=w.length;o--;)(a=(p=w[o]).name)in d.map||("{$uid}"===(T=p.value)&&(T="mce_"+M++),d.map[a]=T,d.push({name:a,value:T}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(p=d.map["data-mce-bogus"]){if("all"===p){R=jl(I,e,z.lastIndex),z.lastIndex=R;continue}f=!1}}f&&q(n,d,l)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,R=(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),t.index+t[0].length):(i=e.substr(R),e.length),f&&(0<i.length&&j(i,!0),$(n)),z.lastIndex=R;continue}l||(v&&v.indexOf("/")===v.length-1?f&&$(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),V.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),F(n)):(n=t[2])?U(n.replace(/<!--|-->/g,"")):(n=t[3])?K(n):(n=t[4])&&W(n,t[5]);R=t.index+t[0].length}for(R<e.length&&j(B(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&$(n.name)}}}($l||($l={})).findEndTag=jl;var Wl=$l,Kl=function(e,t){var n,r,o,i,a,u,s,l,c=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=c,l=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),c=s.replace(l,""),a=d.getShortEndedElements();i=f.exec(c);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Wl.findEndTag(d,c,r),c=c.substring(0,r-o)+c.substring(n),f.lastIndex=r-o;return ba(c)},Xl={trimExternal:Kl,trimInternal:Kl},Yl=function(e,t,n){var r=e.getParam(t,n);if(-1===r.indexOf("="))return r;var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n},Gl=function(e){return e.getParam("iframe_attrs",{})},Jl=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Ql=function(e){return e.getParam("document_base_url","")},Zl=function(e){return Yl(e,"body_id","tinymce")},ec=function(e){return Yl(e,"body_class","")},tc=function(e){return e.getParam("content_security_policy","")},nc=function(e){return e.getParam("br_in_pre",!0)},rc=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t},oc=function(e){return e.getParam("forced_root_block_attrs",{})},ic=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},ac=function(e){return e.getParam("no_newline_selector","")},uc=function(e){return e.getParam("keep_styles",!0)},sc=function(e){return e.getParam("end_container_on_empty_block",!1)},lc=function(e){return Gt.explode(e.getParam("font_size_style_values",""))},cc=function(e){return Gt.explode(e.getParam("font_size_classes",""))},fc=function(e){return e.getParam("images_dataimg_filter",$(!0),"function")},dc=function(e){return e.getParam("automatic_uploads",!0,"boolean")},hc=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},mc=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},gc=function(e){return e.getParam("images_upload_url","","string")},pc=function(e){return e.getParam("images_upload_base_path","","string")},vc=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},bc=function(e){return e.getParam("images_upload_handler",null,"function")},yc=function(e){return e.getParam("content_css_cors",!1,"boolean")},Cc=function(e){return e.getParam("language","en","string")},wc=function(e){return e.getParam("language_url","","string")},xc=function(e){return e.getParam("indent_use_margin",!1)},Nc=function(e){return e.getParam("indentation","40px","string")},Ec=function(e){var t=e.settings.content_css;return A(t)?K(t.split(","),Xn):D(t)?t:!1===t||e.inline?[]:["default"]},zc=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Gt.trim(Xl.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=ba(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=rc(o),u=new RegExp("^(<"+a+"[^>]*>(&nbsp;|&#160;|\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||xo(or.fromDom(n))?t.content=r:t.content=Gt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Sc=Gt.makeMap;function kc(e){var u,s,l,c,f,d=[];return u=(e=e||{}).indent,s=Sc(e.indent_before||""),l=Sc(e.indent_after||""),c=Xo.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',c(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&l[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&l[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:c(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",c(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function Tc(t,m){void 0===m&&(m=ii());var g=kc(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;h(e),e=e.next;);}},g.reset();var h=function(e){var t,n,r,o,i,a,u,s,l,c=f[e.type];if(c)c(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},l=m.getElementRule(e.name))){for(u=0,s=l.attributesOrder.length;u<s;u++)(o=l.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(g.start(e.name,r,n),!n){if(e=e.firstChild)for(;h(e),e=e.next;);g.end(t)}}};return 1!==e.type||t.inner?f[11](e):h(e),g.getContent()}}}var Ac=function(e,t){t(e),e.firstChild&&Ac(e.firstChild,t),e.next&&Ac(e.next,t)},Rc=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Ac(t.firstChild,function(t){L(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),L(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);L(r,function(t){L(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Dc=function(e){var t=Lr(e).dom();return e.dom()===t.activeElement},Mc=function(t){return(e=Lr(t),n=e!==undefined?e.dom():j.document,T.from(n.activeElement).map(or.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},Bc=function(a){if(!D(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return L(a,function(e,r){var t=dr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!D(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=dr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!Q(u,function(e){return P(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},Oc=(Bc([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Bc([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),_c=kr("start","soffset","finish","foffset"),Hc=(Oc.domRange,Oc.relative,Oc.exact,nr.detect().browser),Pc=function(e,t){var n=fr(t)?Rl(t).length:qr(t).length+1;return n<e?n:e<0?0:e},Lc=function(e){return _c(e.start(),Pc(e.soffset(),e.start()),e.finish(),Pc(e.foffset(),e.finish()))},Vc=function(e,t){return Pr(e,t)||Hr(e,t)},Ic=function(t){return function(e){return Vc(t,e.start())&&Vc(t,e.finish())}},Fc=function(e){return!0===e.inline||Hc.isIE()},Uc=function(e){return _c(or.fromDom(e.startContainer),e.startOffset,or.fromDom(e.endContainer),e.endOffset)},jc=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?T.from(t.getRangeAt(0)):T.none()).map(Uc)},qc=function(e){var t,n=(t=e.dom().ownerDocument.defaultView,or.fromDom(t));return jc(n.dom()).filter(Ic(e))},$c=function(e,t){return T.from(t).filter(Ic(e)).map(Lc)},Wc=function(e){var t=j.document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),T.some(t)}catch(n){return T.none()}},Kc=function(e){return(e.bookmark?e.bookmark:T.none()).bind(d($c,or.fromDom(e.getBody()))).bind(Wc)},Xc=function(e){var t=Fc(e)?qc(or.fromDom(e.getBody())):T.none();e.bookmark=t.isSome()?t:e.bookmark},Yc=function(t){Kc(t).each(function(e){t.selection.setRng(e)})},Gc=Kc,Jc=function(t,e){return(n=e,n.collapsed?T.from(Ya(n.startContainer,n.startOffset)).map(or.fromDom):T.none()).bind(function(e){return Co(e)?T.some(e):!1===Pr(t,e)?T.some(t):T.none()});var n},Qc=function(t,e){Jc(or.fromDom(t.getBody()),e).bind(function(e){return el.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Zc=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},ef=function(e){var t,n=e.getBody();return n&&(t=or.fromDom(n),Dc(t)||Mc(t).isSome())},tf=function(e){return e.inline?ef(e):(t=e).iframeElement&&Dc(or.fromDom(t.iframeElement));var t},nf=function(e){return e.editorManager.setActive(e)},rf=function(e,t){e.removed||(t?nf(e):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable();var o,i,a=(o=t,i=e.getNode(),o.dom.getParent(i,function(e){return"true"===o.dom.getContentEditable(e)}));if(t.$.contains(n,a))return Zc(a),Qc(t,r),nf(t);t.bookmark!==undefined&&!1===tf(t)&&Gc(t).each(function(e){t.selection.setRng(e),r=e}),t.inline||(he.opera||Zc(n),t.getWin().focus()),(he.gecko||t.inline)&&(Zc(n),Qc(t,r)),nf(t)}(e))},of=tf,af=function(e){return e instanceof Ul},uf=function(e,t){var r;e.dom.setHTML(e.getBody(),t),of(r=e)&&el.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Oo.isTable(t)?el.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},sf=function(u,s,l){return void 0===l&&(l={}),l.format=l.format?l.format:"html",l.set=!0,l.content=af(s)?"":s,af(s)||l.no_events||(u.fire("BeforeSetContent",l),s=l.content),T.from(u.getBody()).fold($(s),function(e){return af(s)?function(e,t,n,r){Rc(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Tc({validate:e.validate},e.schema).serialize(n);return r.content=xo(or.fromDom(t))?o:Gt.trim(o),uf(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,l):(t=u,n=e,o=l,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=rc(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),uf(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=Tc({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=xo(or.fromDom(n))?r:Gt.trim(r),uf(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},lf=function(e,t){return e.fire("PreProcess",t)},cf=function(e,t){return e.fire("PostProcess",t)},ff=function(e){return e.fire("remove")},df=function(e){return e.fire("detach")},hf=function(e,t){return e.fire("SwitchMode",{mode:t})},mf=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},gf=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},pf=bi.DOM,vf=function(e){return T.from(e).each(function(e){return e.destroy()})},bf=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&pf.remove(o.nextSibling),!e.inline&&r&&(i=e,pf.setStyle(i.id,"display",i.orgDisplay)),ff(e),e.editorManager.remove(e),df(e),pf.remove(e.getContainer()),vf(t),vf(n),e.destroy()}var i},yf=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),vf(i),vf(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),pf.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Cf=kr("sections","settings"),wf=nr.detect(),xf=wf.deviceType.isTouch(),Nf=wf.deviceType.isPhone(),Ef=["lists","autolink","autosave"],zf=Nf?{theme:"mobile"}:{},Sf=function(e){var t=D(e)?e.join(" "):e,n=K(A(t)?t.split(" "):[],Xn);return V(n,function(e){return 0<e.length})},kf=function(e,t,n,r){var o,i,a=Sf(n.forced_plugins),u=Sf(r.plugins),s=e&&(o="mobile",t.sections().hasOwnProperty(o))?V(u,d(P,Ef)):u,l=(i=s,[].concat(Sf(a)).concat(Sf(i)));return Gt.extend(r,{plugins:l.join(" ")})},Tf=function(e,t,n,r){var o,i,a,u,s,l,c,f,d,h,m,g=(o=["mobile"],i=pr(r,function(e,t){return P(o,t)}),Cf(i.t,i.f)),p=Gt.extend(t,n,g.settings(),(h=e,m=g.settings().inline,h&&!m?(l="mobile",c=zf,f=g.sections(),d=f.hasOwnProperty(l)?f[l]:{},Gt.extend({},c,d)):{}),{validate:!0,external_plugins:(a=n,u=g.settings(),s=u.external_plugins?u.external_plugins:{},a&&a.external_plugins?Gt.extend({},a.external_plugins,s):s)});return kf(e,g,n,p)},Af=function(e,t,n){return T.from(t.settings[n]).filter(e)},Rf=d(Af,A),Df=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?L(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Gt.trim(t[0])]=Gt.trim(t[1]):a[Gt.trim(t[0])]=Gt.trim(t)}):a=i,a):"string"===r?Af(A,e,t).getOr(n):"number"===r?Af(_,e,t).getOr(n):"boolean"===r?Af(B,e,t).getOr(n):"object"===r?Af(R,e,t).getOr(n):"array"===r?Af(D,e,t).getOr(n):"string[]"===r?Af((o=A,function(e){return D(e)&&Q(e,o)}),e,t).getOr(n):"function"===r?Af(O,e,t).getOr(n):u},Mf=function(e,t){return t.dom()[e]},Bf=function(e,t){return parseInt(Er(t,e),10)},Of=d(Mf,"clientWidth"),_f=d(Mf,"clientHeight"),Hf=d(Bf,"margin-top"),Pf=d(Bf,"margin-left"),Lf=function(e,t,n){var r,o,i,a,u,s,l,c,f,d,h,m=or.fromDom(e.getBody()),g=e.inline?m:(r=m,or.fromDom(r.dom().ownerDocument.documentElement)),p=(o=e.inline,a=t,u=n,s=(i=g).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+Pf(i):0),y:u-(o?s.top+i.dom().clientTop+Hf(i):0)});return c=p.x,f=p.y,d=Of(l=g),h=_f(l),0<=c&&0<=f&&c<=d&&f<=h},Vf=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,T.from(t).map(or.fromDom)).map(function(e){return Pr(Lr(e),e)}).getOr(!1)};function If(n){var t,o=[],i=function(){var e=n.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():function t(){var e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,reposition:e,getArgs:e}}()},a=function(){0<o.length&&i().reposition(o)},u=function(t){U(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Vf(n))return F(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0})}),t.on("ResizeEditor ResizeWindow NodeChange",function(){be.requestAnimationFrame(a)}),t.on("remove",function(){L(o.slice(),function(e){i().close(e)})}),{open:r,close:function(){T.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function Ff(r){var n=[],o=function(){var e=r.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():function t(){var e=function(){throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}}()},i=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},a=function(e){var t;n.push(e),t=e,r.fire("OpenWindow",{dialog:t})},u=function(t){var e;e=t,r.fire("CloseWindow",{dialog:e}),0===(n=V(n,function(e){return e!==t})).length&&r.focus()};return r.on("remove",function(){L(n,function(e){o().close(e)})}),{open:function(e,t){r.editorManager.setActive(r),Xc(r);var n=o().open(e,t,u);return a(n),n},alert:function(e,t,n){o().alert(e,i(n||this,t))},confirm:function(e,t,n){o().confirm(e,i(n||this,t))},close:function(){T.from(n[n.length-1]).each(function(e){o().close(e),u(e)})}}}var Uf,jf=Ri.PluginManager,qf=function(e,t){var n=function(e,t){for(var n in jf.urls)if(jf.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?Ti.translate(["Failed to load plugin: {0} from url {1}",n,t]):Ti.translate(["Failed to load plugin url: {0}",t])},$f=function(e,t){e.notificationManager.open({type:"error",text:t})},Wf=function(e,t){e._skinLoaded?$f(e,t):e.on("SkinLoaded",function(){$f(e,t)})},Kf=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=j.window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},Xf={pluginLoadError:function(e,t){Wf(e,qf(e,t))},pluginInitError:function(e,t,n){var r=Ti.translate(["Failed to initialize plugin: {0}",t]);Kf(r,n),Wf(e,r)},uploadError:function(e,t){Wf(e,Ti.translate(["Failed to upload image: {0}",t]))},displayError:Wf,initError:Kf},Yf=(Uf={},{add:function(e,t){Uf[e]=t},get:function(e){return Uf[e]?Uf[e]:{icons:{}}}}),Gf=Ri.PluginManager,Jf=Ri.ThemeManager;function Qf(){return new(ae.getOrDie("XMLHttpRequest"))}function Zf(u,s){var r={},n=function(e,r,o,t){var i,n;(i=Qf()).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new j.FormData).append("file",e.blob(),e.filename()),i.send(n)},l=function(e,t){return{url:t,blobInfo:e,status:!0}},c=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Gt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Gt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),me.all(Gt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new me(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new me(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(c(o,e.message))}}));var o,i,a,t}))};return!1===O(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new me(function(e){e([])})}}}var ed=function(e){return ae.getOrDie("atob")(e)},td=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},nd=function(a){return new me(function(e){var t,n,r,o=td(a);try{t=ed(o.data)}catch(GN){return void e(new j.Blob([]))}for(n=function i(e){return new(ae.getOrDie("Uint8Array"))(e)}(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new j.Blob([n],{type:o.type}))})},rd=function(e){return 0===e.indexOf("blob:")?(i=e,new me(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=Qf();r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?nd(e):null;var i},od=function(r){return new me(function(e){var t=function n(){return new(ae.getOrDie("FileReader"))}();t.onloadend=function(){e(t.result)},t.readAsDataURL(r)})},id=td,ad=0,ud=function(e){return(e||"blobid")+ad++},sd=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=id(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):rd(r.src).then(function(e){a=n.create(ud(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):rd(r.src).then(function(t){od(t).then(function(e){i=id(e).data,a=n.create(ud(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},ld=function(e){return e?re(e.getElementsByTagName("img")):[]},cd=0,fd={uuid:function(e){return e+cd+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function dd(o){var t,n,i=function v(){var n=[],o=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||fd.uuid("blobid"),n=e.name||t,{id:$(t),name:$(n),filename:$(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:$(e.blob),base64:$(e.base64),blobUri:$(e.blobUri||se.createObjectURL(e.blob)),uri:$(e.uri)}},t=function(t){return e(function(e){return e.id()===t})},e=function(e){return V(n,e)[0]};return{create:function(e,t,n,r){if(A(e))return o({id:e,name:r,blob:t,base64:n});if(R(e))return o(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t,getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e,removeByUri:function(t){n=V(n,function(e){return e.blobUri()!==t||(se.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){L(n,function(e){se.revokeObjectURL(e.blobUri())}),n=[]}}}(),a=function b(){var n={},r=function(e,t){return{status:e,resultUri:t}},t=function(e){return e in n};return{hasBlobUri:t,getResultUri:function(e){var t=n[e];return t?t.resultUri:null},isPending:function(e){return!!t(e)&&1===n[e].status},isUploaded:function(e){return!!t(e)&&2===n[e].status},markPending:function(e){n[e]=r(1,null)},markUploaded:function(e,t){n[e]=r(2,t)},removeFailed:function(e){delete n[e]},destroy:function(){n={}}}}(),r=[],u=function(t){return function(e){return o.selection?t(e):[]}},s=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},l=function(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},c=function(t,n){L(o.undoManager.data,function(e){"fragmented"===e.type?e.fragments=K(e.fragments,function(e){return l(e,t,n)}):e.content=l(e.content,t,n)})},f=function(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},d=function(e,t){i.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:hc(o)?t+"?"+(new Date).getTime():t,"data-mce-src":o.convertURL(t,"src")})},h=function(n){return t||(t=Zf(a,{url:gc(o),basePath:pc(o),credentials:vc(o),handler:bc(o)})),g().then(u(function(r){var e;return e=K(r,function(e){return e.blobInfo}),t.upload(e,f).then(u(function(e){var t=K(e,function(e,t){var n=r[t].image;return e.status&&mc(o)?d(n,e.url):e.error&&Xf.uploadError(o,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},e=function(e){if(dc(o))return h(e)},m=function(t){return!1!==Q(r,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||fc(o)(t))},g=function(){return n||(n=function e(o,i){var a={};return{findAll:function(e,n){var t;n||(n=$(!0)),t=V(ld(e),function(e){var t=e.src;return!!he.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===he.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=K(t,function(n){if(a[n.src])return new me(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new me(function(e,t){sd(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return me.all(r)}}}(a,i)),n.findAll(o.getBody(),m).then(u(function(e){return e=V(e,function(e){return"string"!=typeof e||(Xf.displayError(o,e),!1)}),L(e,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},p=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=a.getResultUri(n);if(t)return'src="'+t+'"';var r=i.getByUri(n);return r||(r=I(o.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return o.on("setContent",function(){dc(o)?e():g()}),o.on("RawSaveContent",function(e){e.content=p(e.content)}),o.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=p(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(e){L(e,function(e){var t=e.attr("src");if(!i.getByUri(t)){var n=a.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:i,addFilter:function(e){r.push(e)},uploadImages:h,uploadImagesAuto:e,scanForImages:g,destroy:function(){i.destroy(),a.destroy(),n=t=null}}}var hd=function(e,t,n){return Pr(t,e)?function(e,t){for(var n=O(t)?t:$(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=or.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Hr(e,t)}).slice(0,-1):[]},md=function(e,t){return hd(e,t,$(!1))},gd=md,pd=function(e,t){return[e].concat(md(e,t))},vd=function(e,t){return e.hasOwnProperty(t.nodeName)},bd=function(t,e,n){return r=gd(or.fromDom(n),or.fromDom(e)),U(r,function(e){return vd(t,e.dom())}).isSome();var r},yd=function(e,t){if(Oo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||vd(e,t.nextSibling)))return!0}return!1},Cd=function(e){var t,n,r,o,i,a,u,s,l,c,f=e.dom,d=e.selection,h=e.schema,m=h.getBlockElements(),g=d.getStart(),p=e.getBody(),v=rc(e);if(g&&Oo.isElement(g)&&v&&(c=p.nodeName.toLowerCase(),h.isValidChild(c,v.toLowerCase())&&!bd(m,p,g))){for(n=(t=d.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,l=of(e),g=p.firstChild;g;)if(b=m,y=g,Oo.isText(y)||Oo.isElement(y)&&!vd(b,y)&&!cl(y)){if(yd(m,g)){g=(u=g).nextSibling,f.remove(u);continue}a||(a=f.create(v,e.settings.forced_root_block_attrs),g.parentNode.insertBefore(a,g),s=!0),g=(u=g).nextSibling,a.appendChild(u)}else a=null,g=g.nextSibling;var b,y;s&&l&&(t.setStart(n,r),t.setEnd(o,i),d.setRng(t),e.nodeChanged())}},wd=function(e){rc(e)&&e.on("NodeChange",d(Cd,e))},xd=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},Nd=function(t){return Wr(t).fold($([t]),function(e){return[t].concat(Nd(e))})},Ed=function(t){return Kr(t).fold($([t]),function(e){return"br"===sr(e)?Ir(e).map(function(e){return[t].concat(Ed(e))}).getOr([]):[t].concat(Ed(e))})},zd=function(o,e){return Qa([(i=e,a=i.startContainer,u=i.startOffset,Oo.isText(a)?0===u?T.some(or.fromDom(a)):T.none():T.from(a.childNodes[u]).map(or.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Oo.isText(n)?r===n.data.length?T.some(or.fromDom(n)):T.none():T.from(n.childNodes[r-1]).map(or.fromDom))],function(e,t){var n=F(Nd(o),d(Hr,e)),r=F(Ed(o),d(Hr,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},Sd=function(e,t,n,r){var o=n,i=new ao(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Gt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(he.ie&&he.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},kd=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Td(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&xd(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!he.range&&i.selection.isCollapsed()||kd(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&kd(i)&&("IMG"===i.selection.getNode().nodeName?be.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Ad,Rd,Dd=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Md=function(e,t){return n=(u=e).inline?Dd(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument===e.getDoc())return{left:t.pageX,top:t.pageY};var n,r,o,i,a,u=Dd(e.getContentAreaContainer()),s=(r=(n=e).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},a={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:a);return{left:t.pageX-u.left+s.left,top:t.pageY-u.top+s.top}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},Bd=Oo.isContentEditableFalse,Od=Oo.isContentEditableTrue,_d=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Hd=function(u,s){return function(e){if(0===e.button){var t=F(s.dom.getParents(e.target),tu(Bd,Od)).getOr(null);if(i=s.getBody(),Bd(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},Pd=function(c,f){return function(e){if(c.dragging&&(s=(i=f).selection,l=s.getSel().getRangeAt(0).startContainer,a=3===l.nodeType?l.parentNode:l,u=c.element,a!==u&&!i.dom.isChildOf(a,u)&&!Bd(a))){var t=(r=c.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){_d(c.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,l;Ld(c)}},Ld=function(e){e.dragging=!1,e.element=null,_d(e.ghost)},Vd=function(e){var t,n,r,o,i,a,g,p,v,u,s,l={};t=bi.DOM,a=j.document,n=Hd(l,e),g=l,p=e,v=be.throttle(function(e,t){p._selectionOverrides.hideFakeCaret(),p.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,l,c,f,d,h=Math.max(Math.abs(e.screenX-g.screenX),Math.abs(e.screenY-g.screenY));if(g.element&&!g.dragging&&10<h){if(p.fire("dragstart",{target:g.element}).isDefaultPrevented())return;g.dragging=!0,p.focus()}if(g.dragging){var m=(f=g,{pageX:(d=Md(p,e)).pageX-f.relX,pageY:d.pageY+5});l=g.ghost,c=p.getBody(),l.parentNode!==c&&c.appendChild(l),t=g.ghost,n=m,r=g.width,o=g.height,i=g.maxX,a=g.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Pd(l,e),u=l,i=function(){u.dragging&&s.fire("dragend"),Ld(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Id=function(e){var n;Vd(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Bd(t)||Bd(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Fd=function(e){return I(e,function(e,t){return e.concat(function(t){var e=function(e){return K(e,function(e){return(e=ja(e)).node=t,e})};if(Oo.isElement(t))return e(t.getClientRects());if(Oo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Rd=Ad||(Ad={}))[Rd.Up=-1]="Up",Rd[Rd.Down=1]="Down";var Ud,jd=function(o,i,a,e,u,t){var n,s,l=0,c=[],r=function(e){var t,n,r;for(r=Fd([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<c.length&&i(n,$t.last(c))&&l++,n.line=l,u(n))return!0;c.push(n)}};return(s=$t.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=ys(r,e,Fa,t);)if(n(r))return}(o,e,r,n)),c},qd=d(jd,Ad.Up,Wa,Ka),$d=d(jd,Ad.Down,Ka,Wa),Wd=function(n){return function(e){return t=n,e.line>t;var t}},Kd=function(n){return function(e){return t=n,e.line===t;var t}},Xd=Oo.isContentEditableFalse,Yd=ys,Gd=function(e,t){return Math.abs(e.left-t)},Jd=function(e,t){return Math.abs(e.right-t)},Qd=function(e,t){return e>=t.left&&e<=t.right},Zd=function(e,o){return $t.reduce(e,function(e,t){var n,r;return n=Math.min(Gd(e,o),Jd(e,o)),r=Math.min(Gd(t,o),Jd(t,o)),Qd(o,t)?t:Qd(o,e)?e:r===n&&Xd(t.node)?t:r<n?t:e})},eh=function(e,t,n,r){for(;r=Yd(r,e,Fa,t);)if(n(r))return},th=function(e,t,n){var r,o,i,a,u,s,l,c=Fd(V(re(e.getElementsByTagName("*")),ls)),f=V(c,function(e){return n>=e.top&&n<=e.bottom});return(r=Zd(f,t))&&(r=Zd((a=e,l=function(t,e){var n;return n=V(Fd([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),eh(Ad.Up,a,d(l,Wa),u.node),eh(Ad.Down,a,d(l,Ka),u.node),s),t))&&ls(r.node)?(i=t,{node:(o=r).node,before:Gd(o,i)<Jd(o,i)}):null},nh=function(i,a,e){return!e.collapsed&&I(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},rh=Oo.isContentEditableTrue,oh=Oo.isContentEditableFalse,ih=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},ah=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},uh=function(e,t,n){var r=ks(1,e.getBody(),t),o=Nu.fromRangeStart(r),i=o.getNode();if(oh(i))return ih(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(oh(a))return ih(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return oh(e)||rh(e)});return oh(u)?ih(1,e,u,!1,n):null},sh=function(e,t,n){if(!t||!t.collapsed)return t;var r=uh(e,t,n);return r||t},lh=function(t){var e=Vi(function(){if(!t.removed&&t.getBody().contains(j.document.activeElement)&&t.selection.getRng().collapsed){var e=sh(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},ch={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return he.mac?e.metaKey:e.ctrlKey&&!e.altKey}},fh=(Ud="\xa0",function(e){return Ud===e}),dh=function(e){return/^[\r\n\t ]$/.test(e)},hh=function(e){return!dh(e)&&!fh(e)},mh=function(n,r,o){return T.from(o.container()).filter(Oo.isText).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},gh=d(mh,!0,dh),ph=d(mh,!1,dh),vh=function(e){var t=e.container();return Oo.isText(t)&&0===t.data.length},bh=function(t,n){return function(e){return T.from(xs(t?0:-1,e)).filter(n).isSome()}},yh=function(e){return"IMG"===e.nodeName&&"block"===Er(or.fromDom(e),"display")},Ch=function(e){return Oo.isContentEditableFalse(e)&&!Oo.isBogusAll(e)},wh=bh(!0,yh),xh=bh(!1,yh),Nh=bh(!0,Oo.isTable),Eh=bh(!1,Oo.isTable),zh=bh(!0,Ch),Sh=bh(!1,Ch),kh=Oo.isContentEditableTrue,Th=Oo.isContentEditableFalse,Ah=function(e,t){for(var n=e.getBody();t&&t!==n;){if(kh(t)||Th(t))return t;t=t.parentNode}return null},Rh=function(m){var g,a=m.getBody(),o=us(m.getBody(),function(e){return m.dom.isBlock(e)},function(){return of(m)}),p="sel-"+m.dom.uniqueId(),u=function(e){e&&m.selection.setRng(e)},s=function(){return m.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),m.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&m.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=ks(e,a,t),-1===e?Nu.fromRangeStart(t):Nu.fromRangeEnd(t)},t=function(e){return Na(e)||Ta(e)||Aa(e)},y=function(e){return t(e.startContainer)||t(e.endContainer)},l=function(e,t){var n,r,o,i,a,u,s,l,c,f,d=m.$,h=m.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(l=b(-1,e),ls(l.getNode(!0)))return v(-1,l.getNode(!0),!1,!1);if(ls(l.getNode()))return v(-1,l.getNode(),!l.isAtEnd(),!1)}else{if(l=b(1,e),ls(l.getNode()))return v(1,l.getNode(),!l.isAtEnd(),!1);if(ls(l.getNode(!0)))return v(1,l.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Th(i.parentNode)&&(i=i.parentNode,a=h.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),Th(n)?(c=f=n.cloneNode(!0),(s=m.fire("ObjectSelected",{target:n,targetClone:c})).isDefaultPrevented()?null:(r=ea(or.fromDom(m.getBody()),"#"+p).fold(function(){return d([])},function(e){return d([e.dom()])}),c=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",p)).appendTo(m.getBody()),e=m.dom.createRng(),c===f&&he.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(c),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(c)):(r.empty().append("\xa0").append(c).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:h.getPos(n,m.getBody()).y}),r[0].focus(),(o=m.selection.getSel()).removeAllRanges(),o.addRange(e),L(Xi(or.fromDom(m.getBody()),"*[data-mce-selected]"),function(e){Nr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),g=n,C(),e)):null)},c=function(){g&&(g.removeAttribute("data-mce-selected"),ea(or.fromDom(m.getBody()),"#"+p).each(Pi),g=null),ea(or.fromDom(m.getBody()),"#"+p).each(Pi),g=null},C=function(){o.hide()};return he.ceFalse&&function(){m.on("mouseup",function(e){var t=s();t.collapsed&&Lf(m,e.clientX,e.clientY)&&u(uh(m,t,!1))}),m.on("click",function(e){var t;(t=Ah(m,e.target))&&(Th(t)&&(e.preventDefault(),m.focus()),kh(t)&&m.dom.isChildOf(t,m.selection.getNode())&&c())}),m.on("blur NewBlock",function(){c()}),m.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=m.dom.getParent(e,m.dom.isBlock),i=m.dom.getParent(t,m.dom.isBlock);return!(!o||!m.dom.isChildOf(o,i)||!1!==Th(Ah(m,o)))||o&&(n=o,r=i,!(m.dom.getParent(n,m.dom.isBlock)===m.dom.getParent(r,m.dom.isBlock)))&&function(e){var t=js(e);if(!e.firstChild)return!1;var n=Nu.before(e.firstChild),r=t.next(n);return r&&!zh(r)&&!Sh(r)}(o)};r=!1,(n=m).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Ah(n,e.target);Th(t)&&(r||(e.preventDefault(),l(ah(n,t))))}),m.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||m.dom.isChildOf(n,a))&&!1!==Lf(m,e.clientX,e.clientY))if(t=Ah(m,n))Th(t)?(e.preventDefault(),l(ah(m,t))):(c(),kh(t)&&e.shiftKey||nh(e.clientX,e.clientY,m.selection.getRng())||(C(),m.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===ls(n)){c(),C();var r=th(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);m.getBody().focus(),u(o)}}}),m.on("keypress",function(e){ch.modifierPressed(e)||(e.keyCode,Th(m.selection.getNode())&&e.preventDefault())}),m.on("getSelectionRange",function(e){var t=e.range;if(g){if(!g.parentNode)return void(g=null);(t=t.cloneRange()).selectNode(g),e.range=t}}),m.on("setSelectionRange",function(e){var t;(t=l(e.range,e.forward))&&(e.range=t)}),m.on("AfterSetSelectionRange",function(e){var t,n=e.range;y(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,m.dom.hasClass(t,"mce-offscreen-selection")||c()}),m.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!he.ie){var r=(t=m.dom.get(p))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Id(m),lh(m)}(),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Ra(e),u(s()),m.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),g=null}}},Dh=0,Mh=2,Bh=1,Oh=function(m,g){var e=m.length+g.length+2,p=new Array(e),v=new Array(e),l=function(e,t,n,r,o){var i=c(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&m[a]===g[u]?(o.push([0,m[a]]),++a,++u):r-n<t-e?(o.push([2,m[a]]),++a):(o.push([1,g[u]]),++u);else{l(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,m[s]]);l(i.end,t,i.end-i.diag,r,o)}},b=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&m[o]===g[o-t];)++o;return{start:e,end:o,diag:t}},c=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,l,c,f=o-i,d=i+o,h=(d%2==0?d:d+1)/2;for(p[1+h]=e,v[1+h]=t+1,a=0;a<=h;++a){for(u=-a;u<=a;u+=2){for(s=u+h,u===-a||u!==a&&p[s-1]<p[s+1]?p[s]=p[s+1]:p[s]=p[s-1]+1,c=(l=p[s])-e+n-u;l<t&&c<r&&m[l]===g[c];)p[s]=++l,++c;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=p[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+h-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],c=(l=v[s]-1)-e+n-u;e<=l&&n<=c&&m[l]===g[c];)v[s]=l--,c--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=p[s+f])return b(v[s],u+e-n,t,r)}}},t=[];return l(0,m.length,0,g.length,t),t},_h=function(e){return Oo.isElement(e)?e.outerHTML:Oo.isText(e)?Xo.encodeRaw(e.data,!1):Oo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Hh=function(e,t,n){var r=function(e){var t,n,r;for(r=j.document.createElement("div"),t=j.document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Ph=function(e){return V(K(re(e.childNodes),_h),function(e){return 0<e.length})},Lh=function(e,t){var n,r,o,i=K(re(t.childNodes),_h);return n=Oh(i,e),r=t,o=0,L(n,function(e){e[0]===Dh?o++:e[0]===Bh?(Hh(r,e[1],o),o++):e[0]===Mh&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Vh=zi(T.none()),Ih=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Fh=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Uh=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},jh=function(e){var t=or.fromTag("body",Vh.get().getOrThunk(function(){var e=j.document.implementation.createHTMLDocument("undo");return Vh.set(T.some(e)),e}));return ma(t,Uh(e)),L(Xi(t,"*[data-mce-bogus]"),Li),t.dom().innerHTML},qh=function(n){var e,t,r;return e=Ph(n.getBody()),-1!==(t=(r=J(e,function(e){var t=Xl.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Ih(r):Fh(t)},$h=function(e,t,n){"fragmented"===t.type?Lh(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Wh=function(e,t){return!(!e||!t)&&(r=t,Uh(e)===Uh(r)||(n=t,jh(e)===jh(n)));var n,r};function Kh(u){var s,r,o=this,l=0,c=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===Wh(qh(u),c[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:c[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:c,typing:!1,beforeChange:function(){f()&&(s=qu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=qh(u),e=e||{},e=Gt.extend(e,o),!1===f()||u.removed)return null;if(r=c[l],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&Wh(r,e))return null;if(c[l]&&(c[l].beforeBookmark=s),i.custom_undo_redo_levels&&c.length>i.custom_undo_redo_levels){for(n=0;n<c.length-1;n++)c[n]=c[n+1];c.length--,l=c.length}e.bookmark=qu.getUndoBookmark(u.selection),l<c.length-1&&(c.length=l+1),c.push(e),l=c.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<l&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<l&&(e=c[--l],$h(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return l<c.length-1&&(e=c[++l],$h(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){c=[],l=0,o.typing=!1,o.data=c,u.fire("ClearUndos")},hasUndo:function(){return 0<l||o.typing&&c[0]&&!Wh(qh(u),c[0])},hasRedo:function(){return l<c.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=c[l].bookmark,n=c[l-1],$h(u,n,!0),o.transact(t)&&(c[l-1].beforeBookmark=r))}}}var Xh,Yh,Gh=function(e){var t=Xi(e,"br"),n=V(function(e){for(var t=[],n=e.dom();n;)t.push(or.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),go);t.length===n.length&&L(n,Pi)},Jh=function(e){Hi(e),Oi(e,or.fromHtml('<br data-mce-bogus="1">'))},Qh=function(n){Kr(n).each(function(t){Ir(t).each(function(e){ho(n)&&go(t)&&ho(e)&&Pi(t)})})},Zh=ml.isEq,em=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},tm=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!em(t,e,n)||e.parentNode===o||!!om(t,e,n,r,!0)}),om(t,e,n,r))},nm=function(e,t,n){return!!Zh(t,n.inline)||!!Zh(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},rm=function(e,t,n,r,o,i){var a,u,s,l=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(l)if("undefined"==typeof l.length){for(a in l)if(l.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):ml.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Zh(u,ml.normalizeStyleValue(e,ml.replaceVars(l[a],i),a)))return}}else for(s=0;s<l.length;s++)if("attributes"===r?e.getAttrib(t,l[s]):ml.getStyle(e,t,l[s]))return n;return n},om=function(e,t,n,r,o){var i,a,u,s,l=e.formatter.get(n),c=e.dom;if(l&&t)for(a=0;a<l.length;a++)if(i=l[a],nm(e.dom,t,i)&&rm(c,t,i,"attributes",o,r)&&rm(c,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},im={matchNode:om,matchName:nm,match:function(e,t,n,r){var o;return r?tm(e,r,t,n):(r=e.selection.getNode(),!!tm(e,r,t,n)||!((o=e.selection.getStart())===r||!tm(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&om(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=ml.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:em},am=function(e,t){return e.splitText(t)},um=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Oo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=am(t,n)).previousSibling,n<o?(t=r=am(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Oo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=am(t,n),n=0),Oo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=am(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},sm=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,I((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},lm=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return sm(e,t,o)},cm=function(e,t){var n,r,o,i=or.fromDom(e),a=or.fromDom(t);return n=a,r="pre,code",o=d(Hr,i),Zi(n,r,o).isSome()},fm=function(e,t){return Va(t)&&!1===(r=e,o=t,Oo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===cm(r,o))||(n=t,Oo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||dm(t);var n,r,o},dm=Oo.hasAttribute("data-mce-bookmark"),hm=Oo.hasAttribute("data-mce-bogus"),mm=Oo.hasAttributeValue("data-mce-bogus","all"),gm=function(e){return function(e){var t,n,r=0;if(fm(e,e))return!1;if(!(n=e.firstChild))return!0;t=new ao(n,e);do{if(mm(n))n=t.next(!0);else if(hm(n))n=t.next();else if(Oo.isBr(n))r++,n=t.next();else{if(fm(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},pm=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Nu.isTextPosition(n)&&o===r.parentNode&&i>Nu.before(r).offset()?Nu(t.container(),t.offset()-1):t;var n,r,o,i},vm=function(e){return Va(e.previousSibling)?T.some((t=e.previousSibling,Oo.isText(t)?Nu(t,t.data.length):Nu.after(t))):e.previousSibling?el.lastPositionIn(e.previousSibling):T.none();var t},bm=function(e){return Va(e.nextSibling)?T.some((t=e.nextSibling,Oo.isText(t)?Nu(t,0):Nu.before(t))):e.nextSibling?el.firstPositionIn(e.nextSibling):T.none();var t},ym=function(r,o){return vm(o).orThunk(function(){return bm(o)}).orThunk(function(){return e=r,t=o,n=Nu.before(t.previousSibling?t.previousSibling:t.parentNode),el.prevPosition(e,n).fold(function(){return el.nextPosition(e,Nu.after(t))},T.some);var e,t,n})},Cm=function(n,r){return bm(r).orThunk(function(){return vm(r)}).orThunk(function(){return e=n,t=r,el.nextPosition(e,Nu.after(t)).fold(function(){return el.prevPosition(e,Nu.before(t))},T.some);var e,t})},wm=function(e,t,n){return(r=e,o=t,i=n,r?Cm(o,i):ym(o,i)).map(d(pm,n));var r,o,i},xm=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Nm=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(sr(t))},Em=function(e){if(gm(e)){var t=or.fromHtml('<br data-mce-bogus="1">');return Hi(e),Oi(e,t),T.some(Nu.before(t.dom()))}return T.none()},zm=function(e,t,c){var n=Ir(e).filter(function(e){return Oo.isText(e.dom())}),r=Fr(e).filter(function(e){return Oo.isText(e.dom())});return Pi(e),Qa([n,r,t],function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),l=u.data.length;return o=s,i=c,a=Yn((r=u).data).length,r.appendData(o.data),Pi(or.fromDom(o)),i&&lm(r,a),n.container()===s?Nu(u,l):n}).orThunk(function(){return c&&(n.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Yn(r).length,sm(t,n-o,o);var t,n,r,o}),r.each(function(e){return lm(e.dom(),0)})),t})},Sm=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=wm(n,t.getBody(),e.dom()),u=Ji(e,d(Nm,t),(o=t.getBody(),function(e){return e.dom()===o})),s=zm(e,a,(i=e,br(t.schema.getTextInlineElements(),sr(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(Em).fold(function(){r&&xm(t,n,s)},function(e){r&&xm(t,n,T.some(e))})},km=va,Tm="_mce_caret",Am=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==km||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},Rm=function(e){var t;if(e)for(e=(t=new ao(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Dm=function(e){var t=or.fromTag("span");return wr(t,{id:Tm,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Oi(t,or.fromText(km)),t},Mm=function(e,t,n){void 0===n&&(n=!0);var r,o=e.dom,i=e.selection;if(Am(t))Sm(e,!1,or.fromDom(t),n);else{var a=i.getRng(),u=o.getParent(t,o.isBlock),s=((r=Rm(t))&&r.nodeValue.charAt(0)===km&&r.deleteData(0,1),r);a.startContainer===s&&0<a.startOffset&&a.setStart(s,a.startOffset-1),a.endContainer===s&&0<a.endOffset&&a.setEnd(s,a.endOffset-1),o.remove(t,!0),u&&o.isEmpty(u)&&Jh(or.fromDom(u)),i.setRng(a)}},Bm=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Mm(e,t,n);else if(!(t=Ku(e.getBody(),o.getStart())))for(;t=r.get(Tm);)Mm(e,t,!1)},Om=function(e,t,n){var r=e.dom,o=r.getParent(n,d(ml.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Gh(or.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},_m=function(e,t){return e.appendChild(t),t},Hm=function(e,t){var n,r,o=(n=function(e,t){return _m(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){r=n(r,e)}),r);return _m(o,o.ownerDocument.createTextNode(km))},Pm=function(i){i.on("mouseup keydown",function(e){var t,n,r,o;t=i,n=e.keyCode,r=t.selection,o=t.getBody(),Bm(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==km||Bm(t,Ku(o,r.getStart())),37!==n&&39!==n||Bm(t,Ku(o,r.getStart()))})},Lm=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(sr(t))&&!Wu(t.dom())&&!Oo.isBogus(t.dom())},Vm={},Im=$t.filter,Fm=$t.each;Yh=function(e){var t,n,r=e.selection.getRng();t=Oo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Fm(Im(Im(n,t),function(e){return t(e.previousSibling)&&-1!==$t.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,pn(n=e).remove(),pn(t).append("<br><br>").append(n.childNodes)}))},Vm[Xh="pre"]||(Vm[Xh]=[]),Vm[Xh].push(Yh);var Um=function(e,t){Fm(Vm[e],function(e){e(t)})},jm=Gt.each,qm=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return jm(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||cl(e)||cl(t))}},$m=/^(src|href|style)$/,Wm=Gt.each,Km=ml.isEq,Xm=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Ym=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Oo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Oo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new ao(r,e.getBody()).next()||r),Oo.isText(r)&&!n&&0===o&&(r=new ao(r,e.getBody()).prev()||r),r},Gm=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Jm=function(e,t,n,r,o){var i=or.fromDom(t),a=or.fromDom(e.create(r,o)),u=n?jr(i):Ur(i);return _i(a,u),n?(Di(i,a),Bi(a,i)):(Mi(i,a),Oi(a,i)),a.dom()},Qm=function(e,t,n,r){return!(t=ml.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},Zm=function(e,n,r,o,i){var t,a,u,s,l,c,f,d,h,m,g,p,v,b,y=e.dom;if(l=y,!(Km(c=o,(f=n).inline)||Km(c,f.block)||(f.selector?Oo.isElement(c)&&l.is(c,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Wm(n.styles,function(e,t){e=ml.normalizeStyleValue(y,ml.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||Km(ml.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Wm(n.attributes,function(e,t){var n;if(e=ml.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||Km(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",Wm(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),$m.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),Wm(n.classes,function(e){e=ml.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,m=n,p=(h=o).parentNode,v=d.dom,b=rc(d),m.block&&(b?p===v.getRoot()&&(m.list_block&&Km(h,m.list_block)||Wm(Gt.grep(h.childNodes),function(e){ml.isValid(d,b,e.nodeName.toLowerCase())?g?g.appendChild(e):(g=Gm(v,e,b),v.setAttribs(g,d.settings.forced_root_block_attrs)):g=0})):v.isBlock(h)&&!v.isBlock(p)&&(Qm(v,h,!1)||Qm(v,h.firstChild,!0,1)||h.insertBefore(v.create("br"),h.firstChild),Qm(v,h,!0)||Qm(v,h.lastChild,!1,1)||h.appendChild(v.create("br")))),m.selector&&m.inline&&!Km(m.inline,h)||v.remove(h,1),!0):void 0},eg=Zm,tg=function(s,l,c,e,f){var t,n,d=s.formatter.get(l),h=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=l,o=c,i=f,Wm(ml.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=im.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,l,c,f,d,h,m=e.dom;if(n){for(h=n.parentNode,s=r.parentNode;s&&s!==h;s=s.parentNode){for(l=m.clone(s,!1),d=0;d<t.length;d++)if(Zm(e,t[d],u,l,l)){l=0;break}l&&(c&&l.appendChild(c),f||(f=l),c=l)}!i||a.mixed&&m.isBlock(n)||(r=m.split(n,r)),c&&(o.parentNode.insertBefore(c,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,h,c)},m=function(e){var t,n,r,o,i;if(Oo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Gt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!Zm(s,d[n],c,e,e);n++);if(h.deep&&t.length){for(n=0,r=t.length;n<r;n++)m(t[n]);i&&(a=o)}},g=function(e){var t,n=u.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return cl(t=r)&&Oo.isElement(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),Oo.isText(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),u.remove(n,!0),r},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Sl(s,e,d,!0),h.split){if(e=um(e),(t=Ym(s,e,!0))!==(n=Ym(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),Xm(u,t,n)){var o=T.from(t.firstChild).getOr(t);return i(Jm(u,o,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void g(!0)}if(Xm(u,n,t))return o=T.from(n.lastChild).getOr(n),i(Jm(u,o,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void g(!1);t=Gm(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=Gm(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=g(!0),n=g()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Tl(u,e,function(e){Wm(e,function(e){m(e),Oo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===ml.getTextDecoration(u,e.parentNode)&&Zm(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&h.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,l,c,f=e.dom,d=e.selection,h=[],m=d.getRng();for(o=m.startContainer,i=m.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(im.matchNode(e,s,t,n,r)){l=s;break}s.nextSibling&&(u=!0),h.push(s),s=s.parentNode}if(l)if(u){a=d.getBookmark(),m.collapse(!0);var g=Sl(e,m,e.formatter.get(t),!0);g=um(g),e.formatter.remove(t,n,g),d.moveToBookmark(a)}else{c=Ku(e.getBody(),l);var p=Dm(!1).dom(),v=Hm(h,p);Om(e,p,c||l),Mm(e,c,!1),d.setCursorLocation(v,1),f.isEmpty(l)&&f.remove(l)}}(s,l,c,f):(t=qu.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),h.inline&&im.match(s,l,c,r.getStart())&&ml.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var p=0,v=d.length;p<v&&(!d[p].ceFalseOverride||!Zm(s,d[p],c,e,e));p++);}},ng=Gt.each,rg=function(e){return e&&1===e.nodeType&&!cl(e)&&!Wu(e)&&!Oo.isBogus(e)},og=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!cl(n))return n}return e},ig=function(e,t,n){var r,o,i=new qm(e);if(t&&n&&(t=og(t,"previousSibling"),n=og(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Gt.each(Gt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},ag=function(e,t,n){ng(e.childNodes,function(e){rg(e)&&(t(e)&&n(e),e.hasChildNodes()&&ag(e,t,n))})},ug=function(n,e){return d(function(e,t){return!(!t||!ml.getStyle(n,t,e))},e)},sg=function(r,e,t){return d(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),lg(r,n)},e,t)},lg=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},cg=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=ml.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},fg=function(n,e,r,o){ng(e,function(t){ng(n.dom.select(t.inline,o),function(e){rg(e)&&eg(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";ng(r.select(n,t),function(n){rg(n)&&ng(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},dg=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Gt.walk(r,d(cg,e),"childNodes"),cg(e,r))},hg=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&ag(r,ug(e,"fontSize"),sg(e,"backgroundColor",ml.replaceVars(t.styles.backgroundColor,n)))},mg=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(ag(r,ug(e,"fontSize"),sg(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},gg=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=ig(e,ml.getNonWhiteSpaceSibling(r),r),r=ig(e,r,ml.getNonWhiteSpaceSibling(r,!0)))},pg=function(t,n,r,o,i){im.matchNode(t,i.parentNode,r,o)&&eg(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(im.matchNode(t,e,r,o))return eg(t,n,o,i),!0})},vg=function(a){var u=Nu.fromRangeStart(a),s=Nu.fromRangeEnd(a),l=a.commonAncestorContainer;return el.fromPosition(!1,l,s).map(function(e){return!ws(u,s,l)&&ws(u,e,l)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=j.document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},bg=function(e){return e.collapsed?e:vg(e)},yg=Gt.each,Cg=function(m,g,p,r){var e,t,v=m.formatter.get(g),b=v[0],o=!r&&m.selection.isCollapsed(),i=m.dom,n=m.selection,y=function(n,e){if(e=e||b,n){if(e.onformat&&e.onformat(n,e,p,r),yg(e.styles,function(e,t){i.setStyle(n,t,ml.replaceVars(e,p))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}yg(e.attributes,function(e,t){i.setAttrib(n,t,ml.replaceVars(e,p))}),yg(e.classes,function(e){e=ml.replaceVars(e,p),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!b.selector&&(yg(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Wu(t)?(y(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,l){var c,f,d=[],h=!0;c=b.inline||b.block,f=s.create(c),y(f),Tl(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=h,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=h,h="true"===s.getContentEditable(e),r=!0),ml.isEq(t,"br"))return a=0,void(b.block&&s.remove(e));if(b.wrapper&&im.matchNode(m,e,g,p))a=0;else{if(h&&!r&&b.block&&!b.wrapper&&ml.isTextBlock(m,t)&&ml.isValid(m,n,c))return e=s.rename(e,c),y(e),d.push(e),void(a=0);if(b.selector){var i=C(v,e);if(!b.inline||i)return void(a=0)}!h||r||!ml.isValid(m,c,t)||!ml.isValid(m,n,c)||!l&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Wu(e)||b.inline&&s.isBlock(e)?(a=0,yg(Gt.grep(e.childNodes),u),r&&(h=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};yg(e,u)}),!0===b.links&&yg(d,function(e){var t=function(e){"A"===e.nodeName&&y(e,b),yg(Gt.grep(e.childNodes),t)};t(e)}),yg(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return yg(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!cl(t)&&!Wu(t)&&!Oo.isBogus(t))return n=e,!1;var t}),n};n=0,yg(e.childNodes,function(e){ml.isWhiteSpaceNode(e)||cl(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(b.inline||b.wrapper)&&(b.exact||1!==t||((o=a(r=e))&&!cl(o)&&im.matchName(s,o,b)&&(i=s.clone(o,!1),y(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),fg(m,v,p,e),pg(m,b,g,p,e),hg(s,b,p,e),mg(s,b,p,e),gg(s,b,p,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(b){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Sl(m,t,v),0,!0)):a(i,r,0,!0);else if(o&&b.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,l=e.selection;a=(r=l.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Ku(e.getBody(),l.getStart()))&&(i=Rm(o));var c,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=l.getBookmark(),r.collapse(!0),r=Sl(e,r,e.formatter.get(t)),r=um(r),e.formatter.apply(t,n,r),l.moveToBookmark(u)):(o&&i.nodeValue===km||(c=e.getDoc(),f=Dm(!0).dom(),i=(o=c.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),l.setCursorLocation(i,a))}(m,g,p);else{var u=m.selection.getNode();m.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Cg(m,v[0].defaultBlock),m.selection.setRng(bg(m.selection.getRng())),e=qu.getPersistentBookmark(m.selection,!0),a(i,Sl(m,n.getRng(),v)),b.styles&&dg(i,b,p,u),n.moveToBookmark(e),ml.moveStart(i,n,n.getRng()),m.nodeChanged()}Um(g,m)}}else{r=n.getNode();for(var s=0,l=v.length;s<l;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void y(r,v[s])}},wg={applyFormat:Cg},xg=function(r,e,t,n){var o=dr(t.get()),i={},a={},u=V(ml.getParents(r.dom,e),function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")});mr(n,function(e,n){Gt.each(u,function(t){return r.formatter.matchNode(t,n,{},e.similar)?(-1===o.indexOf(n)&&(L(e.callbacks,function(e){e(!0,{node:t,format:n,parents:u})}),i[n]=e.callbacks),a[n]=e.callbacks,!1):!im.matchesUnInheritedFormatSelector(r,t,n)&&void 0})});var s=Ng(t.get(),a,e,u);t.set(la({},i,s))},Ng=function(e,n,r,o){return pr(e,function(e,t){return!!br(n,t)||(L(e,function(e){e(!1,{node:r,format:t,parents:o})}),!1)}).t},Eg=function(e,o,i,a,t){var n,r,u,s,l,c,f,d;return null===o.get()&&(n=o,r=e,u=zi({}),n.set({}),r.on("NodeChange",function(e){xg(r,e.element,u,n.get())})),l=i,c=a,f=t,d=(s=o).get(),L(l.split(","),function(e){d[e]||(d[e]={similar:f,callbacks:[]}),d[e].callbacks.push(c)}),s.set(d),{unbind:function(){return t=i,n=a,r=(e=o).get(),L(t.split(","),function(e){r[e].callbacks=V(r[e].callbacks,function(e){return e!==n}),0===r[e].callbacks.length&&delete r[e]}),void e.set(r);var e,t,n,r}}},zg={get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){Gt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Gt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},Sg=Gt.each,kg=bi.DOM,Tg=function(e,t){var n,o,r,h=t&&t.schema||ii({}),m=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=kg.create(o.name),n=t,(r=o).classes.length&&kg.addClass(n,r.classes.join(" ")),kg.setAttribs(n,r.attrs),t},g=function(n,e,t){var r,o,i,a,u,s,l,c,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,l=h.getElementRule(s),i=!(!(c=l&&l.parentsRequired)||!c.length)&&(u&&-1!==Gt.inArray(c,u)?u:c[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=m(o)).appendChild(n),t&&(r||(r=kg.create("div")).appendChild(n),Gt.each(t,function(e){var t=m(e);r.insertBefore(t,n)})),g(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=m(o),(r=kg.create("div")).appendChild(g(n,e.slice(1),o.siblings)),r):""},Ag=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Gt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Gt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Rg=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Gt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Gt.map(e.split(/(?:~\+|~|\+)/),Ag),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Dg=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var l=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",r=(i=Rg(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,Tg(i,n)):Tg([t],n),o=kg.select(t,r)[0]||r.firstChild,Sg(e.styles,function(e,t){(e=l(e))&&kg.setStyle(o,t,e)}),Sg(e.attributes,function(e,t){(e=l(e))&&kg.setAttrib(o,t,e)}),Sg(e.classes,function(e){e=l(e),kg.hasClass(o,e)||kg.addClass(o,e)}),n.fire("PreviewFormats"),kg.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=kg.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Sg(u.split(" "),function(e){var t=kg.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=kg.getStyle(n.getBody(),e,!0),"#ffffff"===kg.toHex(t).toLowerCase())||"color"===e&&"#000000"===kg.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),kg.remove(r),s)},Mg=function(e,t,n,r,o){var i=t.get(n);!im.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?wg.applyFormat(e,n,r,o):tg(e,n,r,o)},Bg=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Og(e){var t=function o(e){var n={},r=function(e,t){e&&("string"!=typeof e?Gt.each(e,function(e,t){r(t,e)}):(D(t)||(t=[t]),Gt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))};return r(zg.get(e.dom)),r(e.settings.formats),{get:function(e){return e?n[e]:n},has:function(e){return br(n,e)},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}}(e),n=zi(null);return Bg(e),Pm(e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:d(wg.applyFormat,e),remove:d(tg,e),toggle:d(Mg,e,t),match:d(im.match,e),matchAll:d(im.matchAll,e),matchNode:d(im.matchNode,e),canApply:d(im.canApply,e),formatChanged:d(Eg,e,n),getCssText:d(Dg,e)}}var _g={register:function(t,s,l){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=l.serializeStyle(l.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||(r.firstChild===undefined||pa(r.firstChild.value)?r.remove():r.unwrap())}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Xo.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){L(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},Hg={process:function(e,t,n){return f=n,(c=e)&&c.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,l=(r=e).dom,o=o.cloneNode(!0),(a=j.document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Gt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=l.doc,l.doc=u),lf(r,Ll(i,{node:o})),s&&(l.doc=s),o):t;var r,o,i,a,u,s,l,c,f}},Pg=function(e,a,u){e.addNodeFilter("font",function(e){L(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,L(["color","face","size"],function(e){t.attr(e,null)})})})},Lg=function(e,t){var n,r=ui();t.convert_fonts_to_spans&&Pg(e,r,Gt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){L(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Vg={register:function(e,t){t.inline_styles&&Lg(e,t)}},Ig=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Ul("br",1)).shortEnded=!0:r.empty().append(new Ul("#text",3)).value="\xa0"},Fg=function(e){return Ug(e,"#text")&&"\xa0"===e.firstChild.value},Ug=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},jg=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},qg=function(e,t){return e&&(t[e.name]||"br"===e.name)},$g=function(e,g){var p=e.schema;g.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,l,c,f=e.length,d=Gt.extend({},p.getBlockElements()),h=p.getNonEmptyElements(),m=p.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),jg(p,h,m,i)&&(l=p.getElementRule(i.name))&&(l.removeEmpty?i.remove():l.paddEmpty&&Ig(g,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==g.padd_empty_with_br&&((c=new Ul("#text",3)).value="\xa0",o.replace(c))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!g.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Gt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),g.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),g.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new Ul("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),g.validate&&p.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,l=p.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=l["*"])&&a[o]&&(u=!0),a=l[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},Wg=Gt.makeMap,Kg=Gt.each,Xg=Gt.explode,Yg=Gt.extend;function Gg(T,A){void 0===A&&(A=ii());var R={},D=[],M={},B={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var O=function(e){var t,n,r;(n=e.name)in R&&((r=M[n])?r.push(e):M[n]=[e]),t=D.length;for(;t--;)(n=D[t].name)in e.attributes.map&&((r=B[n])?r.push(e):B[n]=[e]);return e},e={schema:A,addAttributeFilter:function(e,n){Kg(Xg(e),function(e){var t;for(t=0;t<D.length;t++)if(D[t].name===e)return void D[t].callbacks.push(n);D.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(D)},addNodeFilter:function(e,n){Kg(Xg(e),function(e){var t=R[e];t||(R[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in R)R.hasOwnProperty(t)&&e.push({name:t,callbacks:R[t]});return e},filterNode:O,parse:function(e,a){var t,n,r,o,i,u,s,l,c,f,d,h=[];a=a||{},M={},B={},c=Yg(Wg("script,style,head,html,body,title,meta,param"),A.getBlockElements());var m,g=A.getNonEmptyElements(),p=A.children,v=T.validate,b="forced_root_block"in a?a.forced_root_block:T.forced_root_block,y=!1===(m=b)?"":!0===m?"p":m,C=A.getWhiteSpaceElements(),w=/^[ \t\r\n]+/,x=/[ \t\r\n]+$/,N=/[ \t\r\n]+/g,E=/^[ \t\r\n]+$/;f=C.hasOwnProperty(a.context)||C.hasOwnProperty(T.root_name);var z=function(e,t){var n,r=new Ul(e,t);return e in R&&((n=M[e])?n.push(r):M[e]=[r]),r},S=function(e){var t,n,r,o,i=A.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(x,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=Wl({validate:v,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(A.getSelfClosingElements()),cdata:function(e){d.append(z("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(N," "),qg(d.lastChild,c)&&(e=e.replace(w,""))),0!==e.length&&((n=z("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(z("#comment",8)).value=e},pi:function(e,t){d.append(z(e,7)).value=t,S(d)},doctype:function(e){d.append(z("#doctype",10)).value=e,S(d)},start:function(e,t,n){var r,o,i,a,u;if(i=v?A.getElementRule(e):{}){for((r=z(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&h.push(r),o=D.length;o--;)(a=D[o].name)in t.map&&((s=B[a])?s.push(r):B[a]=[r]);c[e]&&S(r),n||(d=r),!f&&C[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=v?A.getElementRule(e):{}){if(c[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(w,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||E.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(x,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||E.test(r))&&(t.remove(),t=o),t=o}if(f&&C[e]&&(f=!1),n.removeEmpty&&jg(A,g,C,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,c[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(Fg(d)||jg(A,g,C,d))&&Ig(T,a,c,d),d=d.parent}}},A);var k=d=new Ul(a.context||T.root_name,11);if(t.parse(e),v&&h.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,l,c,f,d,h,m,g,p;for(d=Wg("tr,td,th,tbody,thead,tfoot,table"),c=A.getNonEmptyElements(),f=A.getWhiteSpaceElements(),h=A.getTextBlockElements(),m=A.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(h[n.name]&&"li"===n.parent.name){for(g=n.next;g&&h[g.name];)g.name="li",g.fixed=!0,n.parent.insert(g,n.parent),g=g.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!A.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=O(o[0].clone()),l=0;l<o.length-1;l++){for(A.isValidChild(a.name,o[l].name)?(u=O(o[l].clone()),a.append(u)):u=a,s=o[l].firstChild;s&&s!==o[l+1];)p=s.next,u.append(s),s=p;a=u}jg(A,c,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(jg(A,c,f,r)||Ug(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((g=n.prev)&&("ul"===g.name||"ul"===g.name)){g.append(n);continue}if((g=n.next)&&("ul"===g.name||"ul"===g.name)){g.insert(n,g.firstChild,!0);continue}n.wrap(O(new Ul("ul",1)));continue}A.isValidChild(n.parent.name,"div")&&A.isValidChild("div",n.name)?n.wrap(O(new Ul("div",1))):m[n.name]?n.empty().remove():n.unwrap()}}}(h)),y&&("body"===k.name||a.isRootContent)&&function(){var e,t,n=k.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(w,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(x,"")))};if(A.isValidChild(k.name,y.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!c[n.name]&&!n.attr("data-mce-type")?(t||((t=z(y,1)).attr(T.forced_root_block_attrs),k.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(l in M){for(s=R[l],i=(n=M[l]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,l,a)}for(r=0,o=D.length;r<o;r++)if((s=D[r]).name in B){for(i=(n=B[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return k}};return $g(e,T),Vg.register(e,T),e}var Jg=function(e,t,n){-1===Gt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},Qg=function(e,t,n){var r=ba(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||xo(or.fromDom(t))?r:Gt.trim(r)},Zg=function(e,t,n){var r=n.selection?Ll({forced_root_block:!1},n):n,o=e.parse(t,r);return _g.trimTrailingBr(o),o},ep=function(e,t,n,r,o){var i,a,u,s,l=(i=r,Tc(t,n).serialize(i));return a=e,s=l,(u=o).no_events||!a?s:cf(a,Ll(u,{content:s})).content};function tp(e,t){var n=function r(a,u){var s,l,c,e=["data-mce-selected"];return s=u&&u.dom?u.dom:bi.DOM,l=u&&u.schema?u.schema:ii(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,c=Gg(a,l),_g.register(c,a,s),{schema:l,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,serialize:function(e,t){var n=Ll({format:"html"},t||{}),r=Hg.process(u,e,n),o=Qg(s,r,n),i=Zg(c,o,n);return"tree"===n.format?i:ep(u,a,l,i,n)},addRules:function(e){l.addValidElements(e)},setRules:function(e){l.setValidElements(e)},addTempAttr:d(Jg,c,e),getTempAttrs:function(){return e}}}(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs}}function np(e){return{getBookmark:d(sl,e),moveToBookmark:d(ll,e)}}(np||(np={})).isBookmarkNode=cl;var rp,op,ip=np,ap=Oo.isContentEditableFalse,up=Oo.isContentEditableTrue,sp=function(r,a){var u,s,l,c,f,d,h,m,g,p,v,b,i,y,C,w,x,N=a.dom,E=Gt.each,z=a.getDoc(),S=j.document,k=Math.abs,T=Math.round,A=a.getBody();c={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},e=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!R(t.target)||nh(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},M=function(e){var t=a.settings.object_resizing;return!1!==t&&!he.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Or(or.fromDom(e),t))},B=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-h,y=t*f[2]+p,C=n*f[3]+v,y=y<5?5:y,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!ch.modifierPressed(e):ch.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=T(y*b),y=T(C/b)):(y=T(C/b),C=T(y*b))),N.setStyles(D(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(l,{left:r,top:o,display:"block"}),l.innerHTML=y+" &times; "+C,f[2]<0&&s.clientWidth<=y&&N.setStyle(s,"left",m+(p-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",g+(v-C)),(t=A.scrollWidth-w)+(n=A.scrollHeight-x)!=0&&N.setStyles(l,{left:r-t,top:o-n}),i||(mf(a,u,p,v),i=!0)},O=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",y),e("height",C),N.unbind(z,"mousemove",B),N.unbind(z,"mouseup",O),S!==z&&(N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",O)),N.remove(s),N.remove(l),o(u),gf(a,u,y,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;_(),P(),t=N.getPos(e,A),m=t.x,g=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),M(e)&&!n.isDefaultPrevented()?E(c,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===he.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,h=t.screenY,p=D(u).clientWidth,v=D(u).clientHeight,b=v/p,(f=n).startPos={x:r*n[0]+m,y:o*n[1]+g},w=A.scrollWidth,x=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:m,top:g,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(z,"mousemove",B),N.bind(z,"mouseup",O),S!==z&&(N.bind(S,"mousemove",B),N.bind(S,"mouseup",O)),l=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},p+" &times; "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+m-t.offsetWidth/2,top:o*n[1]+g-t.offsetHeight/2})}):_(),u.setAttribute("data-mce-selected","1")},_=function(){var e,t;for(e in P(),u&&u.removeAttribute("data-mce-selected"),c)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},n=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(L(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):_())},H=function(e){return ap(function(e,t){for(;t&&t!==e;){if(up(t)||ap(t))return t;t=t.parentNode}return null}(a.getBody(),e))},P=function(){for(var e in c){var t=c[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},L=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){L(),he.ie&&11<=he.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||H(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){be.setEditorTimeout(a,function(){a.selection.select(e)})};if(H(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=be.throttle(function(e){a.composing||n(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",_),a.on("contextmenu",e)}),a.on("remove",P),{isResizable:M,showResizeRect:o,hideResizeRect:_,updateResizeRect:n,destroy:function(){u=s=null}}},lp=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},cp=function(e,t,n){var r,o,i,a,u,s=e.dom,l=s.getRoot(),c=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&Oo.isElement(t)){if(!1===n&&(c=t.offsetHeight),"BODY"!==l.nodeName){var f=e.selection.getScrollContainer();if(f)return r=lp(t).y-lp(f).y+c,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+c,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},fp=function(d,e){te(Cu.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,l,c=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=c,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,l=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=l):u.getWin().scrollBy(s,l)})},dp=function(e){return Oo.isContentEditableTrue(e)||Oo.isContentEditableFalse(e)},hp=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(l){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Gt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Oo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,dp))?null:i}return r},mp=function(n,e){return K(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},gp=function(e,t){var n=(t||j.document).createDocumentFragment();return L(e,function(e){n.appendChild(e.dom())}),or.fromDom(n)},pp=kr("element","width","rows"),vp=kr("element","cells"),bp=kr("x","y"),yp=function(e,t){var n=parseInt(xr(e,t),10);return isNaN(n)?1:n},Cp=function(e){return I(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},wp=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Hr(o[i],t))return T.some(bp(i,r));return T.none()},xp=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),l=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(vp(a[u].element(),l))}return i},Np=function(e){var o=pp(da(e),0,[]);return L(Xi(e,"tr"),function(n,r){L(Xi(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=yp(o,"rowspan"),a=yp(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=vp(ha(r),[]));for(var l=t;l<t+a;l++)u[s].cells()[l]=s===n&&l===t?o:da(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),pp(o.element(),Cp(o.rows()),o.rows())},Ep=function(e){return n=K((t=e).rows(),function(e){var t=K(e.cells(),function(e){var t=ha(e);return Nr(t,"colspan"),Nr(t,"rowspan"),t}),n=da(e.element());return _i(n,t),n}),r=da(t.element()),o=or.fromTag("tbody"),_i(o,n),Oi(r,o),r;var t,n,r,o},zp=function(c,e,t){return wp(c,e).bind(function(l){return wp(c,t).map(function(e){return t=c,r=e,o=(n=l).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?xp(t,o,i,a,u):xp(t,o,u,a,i),pp(t.element(),Cp(s),s);var t,n,r,o,i,a,u,s})})},Sp=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},kp=Sp,Tp=function(e){return J(e,function(e){var t=Xa(e);return t?[or.fromDom(t)]:[]})},Ap=function(e){return 1<Sp(e).length},Rp=function(e){return V(Tp(e),wo)},Dp=function(e){return Xi(e,"td[data-mce-selected],th[data-mce-selected]")},Mp=function(e,t){var n=Dp(t),r=Rp(e);return 0<n.length?n:r},Bp=Mp,Op=function(e){return Mp(kp(e.selection.getSel()),or.fromDom(e.getBody()))},_p=function(n,t){return F(n,function(e){return"li"===sr(e)&&zd(e,t)}).fold($([]),function(e){return(t=n,F(t,function(e){return"ul"===sr(e)||"ol"===sr(e)})).map(function(e){return[or.fromTag("li"),or.fromTag(sr(e))]}).getOr([]);var t})},Hp=function(e,t){var n,r=or.fromDom(t.commonAncestorContainer),o=pd(r,e),i=V(o,function(e){return mo(e)||fo(e)}),a=_p(o,t),u=i.concat(a.length?a:bo(n=r)?Vr(n).filter(vo).fold($([]),function(e){return[n,e]}):vo(n)?[n]:[]);return K(u,da)},Pp=function(){return gp([])},Lp=function(e,t){return n=or.fromDom(t.cloneContents()),r=Hp(e,t),o=I(r,function(e,t){return Oi(t,e),t},n),0<r.length?gp([o]):o;var n,r,o},Vp=function(e,o){return(t=e,n=o[0],Zi(n,"table",d(Hr,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Np(e);return zp(r,t,n).map(function(e){return gp([Ep(e)])})}).getOrThunk(Pp);var t,n},Ip=function(e,t){var n,r,o=Bp(t,e);return 0<o.length?Vp(e,o):(n=e,0<(r=t).length&&r[0].collapsed?Pp():Lp(n,r[0]))},Fp=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return l=e,T.from(l.selection.getRng()).map(function(e){var t=l.dom.add(l.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),n=ba(t.innerText);return l.dom.remove(t),n}).getOr("");t.getInner=!0;var n,r,o,i,a,u,s,l,c=(r=t,i=(n=e).selection.getRng(),a=n.dom.create("body"),u=n.selection.getSel(),s=mp(n,kp(u)),(o=r.contextual?Ip(or.fromDom(n.getBody()),s).dom():i.cloneContents())&&a.appendChild(o),n.selection.serializer.serialize(a,r));return"tree"===t.format?c:(t.content=e.selection.isCollapsed()?"":c,e.fire("GetContent",t),t.content)},Up=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},jp=function(e,t,n){return Up(e,t,function(e){return e.nodeName===n})},qp=function(e){return e&&"TABLE"===e.nodeName},$p=function(e,t,n){for(var r=new ao(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Oo.isBr(t))return!0},Wp=function(e,t,n,r,o){var i,a,u,s,l,c,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&Oo.isBr(o)&&t&&e.isEmpty(u))return T.some(Cu(o.parentNode,e.nodeIndex(o)));for(i=new ao(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(c=f,Na(l=s)&&!1===Up(l,c,Wu)))return T.none();if(Oo.isText(s)&&0<s.nodeValue.length)return!1===jp(s,f,"A")?T.some(Cu(s,r?s.nodeValue.length:0)):T.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return T.none();a=s}return n&&a?T.some(Cu(a,0)):T.none()},Kp=function(e,t,n,r){var o,i,a,u,s,l,c,f,d,h,m=e.getRoot(),g=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],c=Oo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),l=n,Na(o))return T.none();if(Oo.isElement(o)&&i>o.childNodes.length-1&&(l=!1),Oo.isDocument(o)&&(o=m,i=0),o===m){if(l&&(u=o.childNodes[0<i?i-1:0])){if(Na(u))return T.none();if(s[u.nodeName]||qp(u))return T.none()}if(o.hasChildNodes()){if(i=Math.min(!l&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Oo.isText(o)&&c?o.data.length:0,!t&&o===m.lastChild&&qp(o))return T.none();if(function(e,t){for(;t&&t!==e;){if(Oo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(m,o)||Na(o))return T.none();if(o.hasChildNodes()&&!1===qp(o)){a=new ao(u=o,m);do{if(Oo.isContentEditableFalse(u)||Na(u)){g=!1;break}if(Oo.isText(u)&&0<u.nodeValue.length){i=l?0:u.nodeValue.length,o=u,g=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,l||i++,g=!0;break}}while(u=l?a.next():a.prev())}}}return t&&(Oo.isText(o)&&0===i&&Wp(e,c,t,!0,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),Oo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Oo.isBr(u)||(h="A",(d=u).previousSibling&&d.previousSibling.nodeName===h)||$p(e,u,!1)||$p(e,u,!0)||Wp(e,c,t,!0,u).each(function(e){o=e.container(),i=e.offset(),g=!0}))),l&&!t&&Oo.isText(o)&&i===o.nodeValue.length&&Wp(e,c,t,!1,o).each(function(e){o=e.container(),i=e.offset(),g=!0}),g?T.some(Cu(o,i)):T.none()},Xp=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Cu.fromRangeStart(t);return Kp(e,n,!0,r).each(function(e){n&&Cu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Kp(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),xd(t,r)?T.none():T.some(r)},Yp=function(e){return 0===e.dom().length?(Pi(e),T.none()):T.some(e)},Gp=function(e,t,n){var r,o;if(o=t,(r=(r=n)||{format:"html"}).set=!0,r.selection=!0,r.content=o,(n=r).no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){var i=e.selection.getRng();!function(r,e){var t=T.from(e.firstChild).map(or.fromDom),n=T.from(e.lastChild).map(or.fromDom);r.deleteContents(),r.insertNode(e);var o=t.bind(Ir).filter(fr).bind(Yp),i=n.bind(Fr).filter(fr).bind(Yp);Qa([o,t.filter(fr)],function(e,t){var n,r;n=t.dom(),r=e.dom().data,n.insertData(0,r),Pi(e)}),Qa([i,n.filter(fr)],function(e,t){var n=t.dom().length;t.dom().appendData(e.dom().data),r.setEnd(t.dom(),n),Pi(e)}),r.collapse(!1)}(i,i.createContextualFragment(n.content)),e.selection.setRng(i),fp(e,i),n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Jp=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return T.from(i).map(or.fromDom).map(function(e){return r&&t.collapsed?e:$r(e,o(e,a)).getOr(e)}).bind(function(e){return cr(e)?T.some(e):Vr(e)}).map(function(e){return e.dom()}).getOr(e)},Qp=function(e,t,n){return Jp(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},Zp=function(e,t,n){return Jp(e,t,!1,n,function(e,t){return 0<t?t-1:t})},ev=function(e,t){for(var n=e;e&&Oo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},tv=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=V(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}},nv=function(e){return!!e.select},rv=function(e){return!(!e||!e.ownerDocument)&&Pr(or.fromDom(e.ownerDocument),or.fromDom(e))},ov=function(u,s,e,l){var n,t,c,f,r=function p(i,n){var a,u;return{selectorChangedWithUnbind:function(e,t){return a||(a={},u={},n.on("NodeChange",function(e){var n=e.element,r=i.getParents(n,null,i.getRoot()),o={};Gt.each(a,function(e,n){Gt.each(r,function(t){if(i.is(t,n))return u[n]||(Gt.each(e,function(e){e(!0,{node:t,selector:n,parents:r})}),u[n]=e),o[n]=e,!1})}),Gt.each(u,function(e,t){o[t]||(delete u[t],Gt.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),{unbind:function(){tv(a,e,t),tv(u,e,t)}}}}}(u,l).selectorChangedWithUnbind,o=function(e,t){return Gp(l,e,t)},i=function(e){var t=h();t.collapse(!!e),a(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},h=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(l.bookmark!==undefined&&!1===of(l)){var i=Gc(l);if(i.isSome())return i.map(function(e){return mp(l,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=mp(l,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),c&&f&&(0===o(t.START_TO_START,t,c)&&0===o(t.END_TO_END,t,c)?t=f:f=c=null),t},a=function(e,t){var n,r;if((o=e)&&(nv(o)||rv(o.startContainer)&&rv(o.endContainer))){var o,i=nv(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=l.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),c=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||he.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),l.fire("AfterSetSelectionRange",{range:e,forward:t})}}},m=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},g={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:l,collapse:i,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),a(n),i(!1)):(Sd(u,n,l.getBody(),!0),a(n))},getContent:function(e){return Fp(l,e)},setContent:o,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,T.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Sd(r,n,e,!0),Sd(r,n,e,!1)),n})).each(a),e},isCollapsed:function(){var e=h(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:m,setNode:function(e){return o(u.getOuterHTML(e)),e},getNode:function(){return e=l.getBody(),(t=h())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?ev(r.nextSibling,!0):r.parentNode,o=0===a?ev(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:a,getRng:h,getStart:function(e){return Qp(l.getBody(),h(),e)},getEnd:function(e){return Zp(l.getBody(),h(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Qp(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Zp(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new ao(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,h(),e,t)},normalize:function(){var e=h(),t=d();if(Ap(t)||!kd(l))return e;var n=Xp(u,e);return n.each(function(e){a(e,m())}),n.getOr(e)},selectorChanged:function(e,t){return r(e,t),g},selectorChangedWithUnbind:r,getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return cp(l,e,t)},placeCaretAt:function(e,t){return a(hp(e,t,l.getDoc()))},getBoundingClientRect:function(){var e=h();return e.collapsed?Nu.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=c=f=null,t.destroy()}};return n=ip(g),t=sp(g,l),g.bookmarkManager=n,g.controlSelection=t,g},iv=Oo.isText,av=function(e){return iv(e)&&e.data[0]===va},uv=function(e){return iv(e)&&e.data[e.data.length-1]===va},sv=function(e){return e.ownerDocument.createTextNode(va)},lv=function(e,t){return e?function(e){if(iv(e.previousSibling))return uv(e.previousSibling)||e.previousSibling.appendData(va),e.previousSibling;if(iv(e))return av(e)||e.insertData(0,va),e;var t=sv(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(iv(e.nextSibling))return av(e.nextSibling)||e.nextSibling.insertData(0,va),e.nextSibling;if(iv(e))return uv(e)||e.appendData(va),e;var t=sv(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},cv=d(lv,!0),fv=d(lv,!1),dv=function(e,t){return Oo.isText(e.container())?lv(t,e.container()):lv(t,e.getNode())},hv=function(e,t){var n=t.get();return n&&e.container()===n&&xa(n)},mv=function(n,e){return e.fold(function(e){rs.remove(n.get());var t=cv(e);return n.set(t),T.some(Nu(t,t.length-1))},function(e){return el.firstPositionIn(e).map(function(e){if(hv(e,n))return Nu(n.get(),1);rs.remove(n.get());var t=dv(e,!0);return n.set(t),Nu(t,1)})},function(e){return el.lastPositionIn(e).map(function(e){if(hv(e,n))return Nu(n.get(),n.get().length-1);rs.remove(n.get());var t=dv(e,!1);return n.set(t),Nu(t,t.length-1)})},function(e){rs.remove(n.get());var t=fv(e);return n.set(t),T.some(Nu(t,1))})},gv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,pv=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?xa(n)?Oo.isText(n.nextSibling)?Nu(n.nextSibling,0):Nu.after(n):za(t)?Nu(n,r+1):t:xa(n)?Oo.isText(n.previousSibling)?Nu(n.previousSibling,n.previousSibling.data.length):Nu.before(n):Sa(t)?Nu(n,r-1):t},vv={isInlineTarget:function(e,t){var n=Rf(e,"inline_boundaries_selector").getOr("a[href],code");return Or(or.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,V(bi.DOM.getParents(i.container(),"*",o),r));return T.from(a[a.length-1])},isRtl:function(e){return"rtl"===bi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,gv.test(t));var t},isAtZwsp:function(e){return za(e)||Sa(e)},normalizePosition:pv,normalizeForwards:d(pv,!0),normalizeBackwards:d(pv,!1),hasSameParentBlock:function(e,t,n){var r=Cs(t,e),o=Cs(n,e);return r&&r===o}},bv=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return T.none()},yv=Bc([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Cv=function(e,t){var n=Cs(t,e);return n||e},wv=function(e,t,n){var r=vv.normalizeForwards(n),o=Cv(t,r.container());return vv.findRootInline(e,o,r).fold(function(){return el.nextPosition(o,r).bind(d(vv.findRootInline,e,o)).map(function(e){return yv.before(e)})},T.none)},xv=function(e,t){return null===Ku(e,t)},Nv=function(e,t,n){return vv.findRootInline(e,t,n).filter(d(xv,t))},Ev=function(e,t,n){var r=vv.normalizeBackwards(n);return Nv(e,t,r).bind(function(e){return el.prevPosition(e,r).isNone()?T.some(yv.start(e)):T.none()})},zv=function(e,t,n){var r=vv.normalizeForwards(n);return Nv(e,t,r).bind(function(e){return el.nextPosition(e,r).isNone()?T.some(yv.end(e)):T.none()})},Sv=function(e,t,n){var r=vv.normalizeBackwards(n),o=Cv(t,r.container());return vv.findRootInline(e,o,r).fold(function(){return el.prevPosition(o,r).bind(d(vv.findRootInline,e,o)).map(function(e){return yv.after(e)})},T.none)},kv=function(e){return!1===vv.isRtl(Av(e))},Tv=function(e,t,n){return bv([wv,Ev,zv,Sv],[e,t,n]).filter(kv)},Av=function(e){return e.fold(W,W,W,W)},Rv=function(e){return e.fold($("before"),$("start"),$("end"),$("after"))},Dv=function(e){return e.fold(yv.before,yv.before,yv.after,yv.after)},Mv=function(n,e,r,t,o,i){return Qa([vv.findRootInline(e,r,t),vv.findRootInline(e,r,o)],function(e,t){return e!==t&&vv.hasSameParentBlock(r,e,t)?yv.after(n?e:t):i}).getOr(i)},Bv=function(e,r){return e.fold($(!0),function(e){return n=r,!(Rv(t=e)===Rv(n)&&Av(t)===Av(n));var t,n})},Ov=function(e,t){return e?t.fold(q(T.some,yv.start),T.none,q(T.some,yv.after),T.none):t.fold(T.none,q(T.some,yv.before),T.none,q(T.some,yv.end))},_v=function(a,u,s,l){var e=vv.normalizePosition(a,l),c=Tv(u,s,e);return Tv(u,s,e).bind(d(Ov,a)).orThunk(function(){return t=a,n=u,r=s,o=c,e=l,i=vv.normalizePosition(t,e),el.fromPosition(t,r,i).map(d(vv.normalizePosition,t)).fold(function(){return o.map(Dv)},function(e){return Tv(n,r,e).map(d(Mv,t,n,r,i,e)).filter(d(Bv,o))}).filter(kv);var t,n,r,o,e,i})},Hv=Tv,Pv=_v,Lv=(d(_v,!1),d(_v,!0),Dv),Vv=function(e){return e.fold(yv.start,yv.start,yv.end,yv.end)},Iv=function(e){return O(e.selection.getSel().modify)},Fv=function(e,t,n){var r=e?1:-1;return t.setRng(Nu(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Uv=function(e,t){var n=t.selection.getRng(),r=e?Nu.fromRangeEnd(n):Nu.fromRangeStart(n);return!!Iv(t)&&(e&&za(r)?Fv(!0,t.selection,r):!(e||!Sa(r))&&Fv(!1,t.selection,r))},jv=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},qv=function(e){return!1!==e.settings.inline_boundaries},$v=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},Wv=function(t,e,n){return mv(e,n).map(function(e){return jv(t,e),n})},Kv=function(e,t,n){return function(){return!!qv(t)&&Uv(e,t)}},Xv={move:function(a,u,s){return function(){return!!qv(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Nu.fromRangeStart(t.selection.getRng()),i=d(vv.isInlineTarget,t),Pv(e,i,r,o).bind(function(e){return Wv(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:d(Kv,!0),movePrevWord:d(Kv,!1),setupSelectedState:function(a){var u=zi(null),s=d(vv.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;qv(a)&&(t=s,n=a.dom,r=e.parents,o=V(n.select('*[data-mce-selected="inline-boundary"]'),t),i=V(r,t),L(ee(o,i),d($v,!1)),L(ee(i,o),d($v,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Nu.fromRangeStart(e.selection.getRng());Nu.isTextPosition(n)&&!1===vv.isAtZwsp(n)&&(jv(e,rs.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=V(e,n);L(t,function(e){var t=Nu.fromRangeStart(r.selection.getRng());Hv(n,r.getBody(),t).bind(function(e){return Wv(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:jv},Yv=Oo.isContentEditableFalse,Gv=Xa,Jv=function(e,t,n,r){var o=e===wu.Forwards,i=o?zh:Sh;if(!r.collapsed){var a=Gv(r);if(Yv(a))return ih(e,t,a,e===wu.Backwards,!0)}var u=wa(r.startContainer),s=As(e,t.getBody(),r);if(i(s))return ah(t,s.getNode(!o));var l=vv.normalizePosition(o,n(s));if(!l)return u?r:null;if(i(l))return ih(e,t,l.getNode(!o),o,!0);var c=n(l);return c&&i(c)&&Ms(l,c)?ih(e,t,c.getNode(!o),o,!0):u?sh(t,l.toRange(),!0):null},Qv=function(e,t,n,r){var o,i,a,u,s,l,c,f,d;if(d=Gv(r),o=As(e,t.getBody(),r),i=n(t.getBody(),Wd(1),o),a=V(i,Kd(1)),s=$t.last(o.getClientRects()),(zh(o)||Nh(o))&&(d=o.getNode()),(Sh(o)||Eh(o))&&(d=o.getNode(!0)),!s)return null;if(l=s.left,(u=Zd(a,l))&&Yv(u.node))return c=Math.abs(l-u.left),f=Math.abs(l-u.right),ih(e,t,u.node,c<f,!0);if(d){var h=function(e,t,n,r){var o,i,a,u,s,l,c=js(t),f=[],d=0,h=function(e){return $t.last(e.getClientRects())};l=h(u=1===e?(o=c.next,i=Ka,a=Wa,Nu.after(r)):(o=c.prev,i=Wa,a=Ka,Nu.before(r)));do{if(u.isVisible()&&!a(s=h(u),l)){if(0<f.length&&i(s,$t.last(f))&&d++,(s=ja(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),Wd(1),d);if(u=Zd(V(h,Kd(1)),l))return sh(t,u.position.toRange(),!0);if(u=$t.last(V(h,Kd(0))))return sh(t,u.position.toRange(),!0)}},Zv=function(e,t,n){var r,o,i,a,u=js(e.getBody()),s=d(Ds,u.next),l=d(Ds,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Nu.fromRangeStart(n)):l(Nu.fromRangeStart(n)))||(a=(i=e).dom.create(rc(i)),(!he.ie||11<=he.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},eb=function(c,f){return function(){var e,t,n,r,o,i,a,u,s,l=(t=f,r=js((e=c).getBody()),o=d(Ds,r.next),i=d(Ds,r.prev),a=t?wu.Forwards:wu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Jv(a,e,u,s))?n:(n=Zv(e,a,s))||null);return!!l&&(c.selection.setRng(l),!0)}},tb=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?$d:qd,i=(e=u).selection.getRng(),(n=Qv(r,e,o,i))?n:(n=Zv(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}};(op=rp||(rp={}))[op.Br=0]="Br",op[op.Block=1]="Block",op[op.Wrap=2]="Wrap",op[op.Eol=3]="Eol";var nb=function(e,t){return e===wu.Backwards?t.reverse():t},rb=function(e,t,n,r){for(var o,i,a,u,s,l,c=js(n),f=r,d=[];f&&(s=c,l=f,o=t===wu.Forwards?s.next(l):s.prev(l));){if(Oo.isBr(o.getNode(!1)))return t===wu.Forwards?{positions:nb(t,d).concat([o]),breakType:rp.Br,breakAt:T.some(o)}:{positions:nb(t,d),breakType:rp.Br,breakAt:T.some(o)};if(o.isVisible()){if(e(f,o)){var h=(i=t,a=f,u=o,Oo.isBr(u.getNode(i===wu.Forwards))?rp.Br:!1===ws(a,u)?rp.Block:rp.Wrap);return{positions:nb(t,d),breakType:h,breakAt:T.some(o)}}d.push(o),f=o}else f=o}return{positions:nb(t,d),breakType:rp.Eol,breakAt:T.none()}},ob=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===wu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},ib=function(e,i){return I(e,function(e,o){return e.fold(function(){return T.some(o)},function(r){return Qa([te(r.getClientRects()),te(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},T.none())},ab=function(t,e){return te(e.getClientRects()).bind(function(e){return ib(t,e.left)})},ub=d(rb,Cu.isAbove,-1),sb=d(rb,Cu.isBelow,1),lb=d(ob,-1,ub),cb=d(ob,1,sb),fb=function(e,t,n,r,o){var i,a,u,s,l=Xi(or.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),c=V((i=e,J(l,function(e){var t,n,r=(t=ja(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=c,u=r,s=o,I(a,function(e,r){return e.fold(function(){return T.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return T.some(n<t?r:e)})},T.none())).map(function(e){return e.cell})},db=d(fb,function(e){return e.bottom},function(e,t){return e.y<t}),hb=d(fb,function(e){return e.top},function(e,t){return e.y>t}),mb=function(t,n){return te(n.getClientRects()).bind(function(e){return db(t,e.left,e.top)}).bind(function(e){return ab((t=e,el.lastPositionIn(t).map(function(e){return ub(t,e).positions.concat(e)}).getOr([])),n);var t})},gb=function(t,n){return ne(n.getClientRects()).bind(function(e){return hb(t,e.left,e.top)}).bind(function(e){return ab((t=e,el.firstPositionIn(t).map(function(e){return[e].concat(sb(t,e).positions)}).getOr([])),n);var t})},pb=function(e,t){e.selection.setRng(t),fp(e,t)},vb=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===rp.Wrap&&0===a.positions.length||!Oo.isBr(n.getNode())&&(i=u).breakType===rp.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},bb=d(vb,ub),yb=d(vb,sb),Cb=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),l=t?1:-1;if(ss()&&(o=t,i=s,a=n,u=Nu.fromRangeStart(i),el.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var c=ih(l,e,n,!t,!0);return pb(e,c),!0}return!1},wb=function(e,t){var n=t.getNode(e);return Oo.isElement(n)&&"TABLE"===n.nodeName?T.some(n):T.none()},xb=function(u,s,l){var e=wb(!!s,l),t=!1===s;e.fold(function(){return pb(u,l.toRange())},function(a){return el.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(l)}).fold(function(){return pb(u,l.toRange())},function(e){return n=s,o=a,t=l,void((i=rc(r=u))?r.undoManager.transact(function(){var e=or.fromTag(i);wr(e,oc(r)),Oi(e,or.fromTag("br")),n?Mi(or.fromDom(o),e):Di(or.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),pb(r,t)}):pb(r,t.toRange()));var n,r,o,t,i})})},Nb=function(e,t,n,r){var o,i,a,u,s,l,c=e.selection.getRng(),f=Nu.fromRangeStart(c),d=e.getBody();if(t||!bb(r,f))return!(!t||!yb(r,f))&&(o=d,h=gb(i=n,a=f).orThunk(function(){return te(a.getClientRects()).bind(function(e){return ib(cb(o,Nu.after(i)),e.left)})}).getOr(Nu.after(i)),xb(e,t,h),!0);var h=(u=d,mb(s=n,l=f).orThunk(function(){return te(l.getClientRects()).bind(function(e){return ib(lb(u,Nu.before(s)),e.left)})}).getOr(Nu.before(s)));return xb(e,t,h),!0},Eb=function(t,n){return function(){return T.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return T.from(t.dom.getParent(e,"table")).map(function(e){return Cb(t,n,e)})}).getOr(!1)}},zb=function(n,r){return function(){return T.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return T.from(n.dom.getParent(t,"table")).map(function(e){return Nb(n,r,e,t)})}).getOr(!1)}},Sb=function(e){return P(["figcaption"],sr(e))},kb=function(e){var t=j.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},Tb=function(e,t,n){n?Oi(e,t):Bi(e,t)},Ab=function(e,t,n,r){return""===t?(c=e,f=r,d=or.fromTag("br"),Tb(c,d,f),kb(d)):(o=e,i=r,a=t,u=n,s=or.fromTag(a),l=or.fromTag("br"),wr(s,u),Oi(s,l),Tb(o,s,i),kb(l));var o,i,a,u,s,l,c,f,d},Rb=function(e,t,n){return t?(o=e.dom(),sb(o,n).breakAt.isNone()):(r=e.dom(),ub(r,n).breakAt.isNone());var r,o},Db=function(t,n){var e,r,o,i=or.fromDom(t.getBody()),a=Nu.fromRangeStart(t.selection.getRng()),u=rc(t),s=oc(t);return(e=a,r=i,o=d(Hr,r),Qi(or.fromDom(e.container()),ho,o).filter(Sb)).exists(function(){if(Rb(i,n,a)){var e=Ab(i,u,s,n);return t.selection.setRng(e),!0}return!1})},Mb=function(e,t){return function(){return!!e.selection.isCollapsed()&&Db(e,t)}},Bb=function(e,r){return J(K(e,function(e){return Ll({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},Ob=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},_b=function(e,t){return F(Bb(e,t),function(e){return e.action()})},Hb=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=nr.detect().os,_b([{keyCode:ch.RIGHT,action:eb(t,!0)},{keyCode:ch.LEFT,action:eb(t,!1)},{keyCode:ch.UP,action:tb(t,!1)},{keyCode:ch.DOWN,action:tb(t,!0)},{keyCode:ch.RIGHT,action:Eb(t,!0)},{keyCode:ch.LEFT,action:Eb(t,!1)},{keyCode:ch.UP,action:zb(t,!1)},{keyCode:ch.DOWN,action:zb(t,!0)},{keyCode:ch.RIGHT,action:Xv.move(t,n,!0)},{keyCode:ch.LEFT,action:Xv.move(t,n,!1)},{keyCode:ch.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Xv.moveNextWord(t,n)},{keyCode:ch.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Xv.movePrevWord(t,n)},{keyCode:ch.UP,action:Mb(t,!1)},{keyCode:ch.DOWN,action:Mb(t,!0)}],r).each(function(e){r.preventDefault()}))})},Pb=function(e,t){return Pr(e,t)?Qi(t,function(e){return po(e)||bo(e)},(n=e,function(e){return Hr(n,or.fromDom(e.dom().parentNode))})):T.none();var n},Lb=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},Vb=function(i,a,u){return Qa([el.firstPositionIn(u),el.lastPositionIn(u)],function(e,t){var n=vv.normalizePosition(!0,e),r=vv.normalizePosition(!1,t),o=vv.normalizePosition(!1,a);return i?el.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):el.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Ib=kr("block","position"),Fb=kr("from","to"),Ub=function(e,t){var n=or.fromDom(e),r=or.fromDom(t.container());return Pb(n,r).map(function(e){return Ib(e,t)})},jb=function(o,i,e){var t=Ub(o,Nu.fromRangeStart(e)),n=t.bind(function(e){return el.fromPosition(i,o,e.position()).bind(function(e){return Ub(o,e).map(function(e){return t=o,n=i,r=e,Oo.isBr(r.position().getNode())&&!1===gm(r.block())?el.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?el.fromPosition(n,t,e).bind(function(e){return Ub(t,e)}):T.some(r)}).getOr(r):r;var t,n,r})})});return Qa([t,n],Fb).filter(function(e){return!1===Hr((r=e).from().block(),r.to().block())&&Vr((n=e).from().block()).bind(function(t){return Vr(n.to().block()).filter(function(e){return Hr(t,e)})}).isSome()&&(t=e,!1===Oo.isContentEditableFalse(t.from().block())&&!1===Oo.isContentEditableFalse(t.to().block()));var t,n,r})},qb=function(e,t,n){return n.collapsed?jb(e,t,n):T.none()},$b=function(e){var t,n=(t=qr(e),U(t,ho).fold(function(){return t},function(e){return t.slice(0,e)}));return L(n,Pi),n},Wb=function(e,t){var n=pd(t,e);return F(n.reverse(),gm).each(Pi)},Kb=function(e,t,n,r){if(gm(n))return Jh(n),el.firstPositionIn(n.dom());0===V(Ur(r),function(e){return!gm(e)}).length&&gm(t)&&Di(r,or.fromTag("br"));var o=el.prevPosition(n.dom(),Nu.before(r.dom()));return L($b(t),function(e){Di(r,e)}),Wb(e,t),o},Xb=function(e,t,n){if(gm(n))return Pi(n),gm(t)&&Jh(t),el.firstPositionIn(t.dom());var r=el.lastPositionIn(n.dom());return L($b(t),function(e){Oi(n,e)}),Wb(e,t),r},Yb=function(e,t){return Pr(t,e)?(n=pd(e,t),T.from(n[n.length-1])):T.none();var n},Gb=function(e,t){el.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(or.fromDom).filter(go).each(Pi)},Jb=function(e,t,n){return Gb(!0,t),Gb(!1,n),Yb(t,n).fold(d(Xb,e,t,n),d(Kb,e,t,n))},Qb=function(e,t,n,r){return t?Jb(e,r,n):Jb(e,n,r)},Zb=function(t,n){var e,r=or.fromDom(t.getBody());return(e=qb(r.dom(),n,t.selection.getRng()).bind(function(e){return Qb(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},ey=function(e,t){var n=or.fromDom(t),r=d(Hr,e);return Ji(n,wo,r).isSome()},ty=function(e,t){var n,r,o=el.prevPosition(e.dom(),Nu.fromRangeStart(t)).isNone(),i=el.nextPosition(e.dom(),Nu.fromRangeEnd(t)).isNone();return!(ey(n=e,(r=t).startContainer)||ey(n,r.endContainer))&&o&&i},ny=function(e){var n,r,o,t,i=or.fromDom(e.getBody()),a=e.selection.getRng();return ty(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),Qa([Pb(n,or.fromDom(o.startContainer)),Pb(n,or.fromDom(o.endContainer))],function(e,t){return!1===Hr(e,t)&&(o.deleteContents(),Qb(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},ry=function(e,t){return!e.selection.isCollapsed()&&ny(e)},oy=function(e){return Rs(e).exists(go)},iy=function(e,t,n){var r=V(pd(or.fromDom(n.container()),t),ho),o=te(r).getOr(t);return el.fromPosition(e,o.dom(),n).filter(oy)},ay=function(e,t){return Rs(t).exists(go)||iy(!0,e,t).isSome()},uy=function(e,t){return(n=t,T.from(n.getNode(!0)).map(or.fromDom)).exists(go)||iy(!1,e,t).isSome();var n},sy=d(iy,!1),ly=d(iy,!0),cy=Bc([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),fy=function(e,t,n,r){var o=r.getNode(!1===t);return Pb(or.fromDom(e),or.fromDom(n.getNode())).map(function(e){return gm(e)?cy.remove(e.dom()):cy.moveToElement(o)}).orThunk(function(){return T.some(cy.moveToElement(o))})},dy=function(u,s,l){return el.fromPosition(s,u,l).bind(function(e){return a=e.getNode(),wo(or.fromDom(a))||bo(or.fromDom(a))?T.none():(t=u,o=e,i=function(e){return mo(or.fromDom(e))&&!ws(r,o,t)},Ts(!(n=s),r=l).fold(function(){return Ts(n,o).fold($(!1),i)},i)?T.none():s&&Oo.isContentEditableFalse(e.getNode())?fy(u,s,l,e):!1===s&&Oo.isContentEditableFalse(e.getNode(!0))?fy(u,s,l,e):s&&Sh(l)?T.some(cy.moveToPosition(e)):!1===s&&zh(l)?T.some(cy.moveToPosition(e)):T.none());var t,n,r,o,i,a})},hy=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Oo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&Oo.isContentEditableFalse(n.nextSibling)?T.some(cy.moveToElement(n.nextSibling)):!1===t&&Oo.isContentEditableFalse(n.previousSibling)?T.some(cy.moveToElement(n.previousSibling)):T.none()).fold(function(){return dy(r,e,o)},T.some):dy(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return T.some(cy.remove(e))},function(e){return T.some(cy.moveToElement(e))},function(e){return ws(n,e,t)?T.none():T.some(cy.moveToPosition(e))});var t,n});var t,n,i,a,u},my=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=ks(t?1:-1,e,n),o=Nu.fromRangeStart(r),i=or.fromDom(e),!1===t&&Sh(o)?T.some(cy.remove(o.getNode(!0))):t&&zh(o)?T.some(cy.remove(o.getNode())):!1===t&&zh(o)&&uy(i,o)?sy(i,o).map(function(e){return cy.remove(e.getNode())}):t&&Sh(o)&&ay(i,o)?ly(i,o).map(function(e){return cy.remove(e.getNode())}):hy(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),Sm(o,i,or.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Nu.before(e):Nu.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},gy=function(e,t){var n,r=e.selection.getNode();return!!Oo.isContentEditableFalse(r)&&(n=or.fromDom(e.getBody()),L(Xi(n,".mce-offscreen-selection"),Pi),Sm(e,t,or.fromDom(e.selection.getNode())),Lb(e),!0)},py=function(e,t){return e.selection.isCollapsed()?my(e,t):gy(e,t)},vy=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Oo.isContentEditableTrue(t)||Oo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Oo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Nu.before(t).toRange())),!0},by=function(e,t,n,r,o,i){var a,u,s=ih(r,e,i.getNode(!o),o,!0);if(t.collapsed){var l=t.cloneRange();o?l.setEnd(s.startContainer,s.startOffset):l.setStart(s.endContainer,s.endOffset),l.deleteContents()}else t.deleteContents();return e.selection.setRng(s),a=e.dom,u=n,Oo.isText(u)&&0===u.data.length&&a.remove(u),!0},yy=function(e,t){return function(e,t){var n=e.selection.getRng();if(!Oo.isText(n.commonAncestorContainer))return!1;var r=t?wu.Forwards:wu.Backwards,o=js(e.getBody()),i=d(Ds,o.next),a=d(Ds,o.prev),u=t?i:a,s=t?zh:Sh,l=As(r,e.getBody(),n),c=vv.normalizePosition(t,u(l));if(!c)return!1;if(s(c))return by(e,n,l.getNode(),r,t,c);var f=u(c);return!!(f&&s(f)&&Ms(c,f))&&by(e,n,l.getNode(),r,t,f)}(e,t)},Cy=function(t,n){return function(e){return mv(n,e).map(function(e){return Xv.setCaretPosition(t,e),!0}).getOr(!1)}},wy=function(r,o,i,a){var u=r.getBody(),s=d(vv.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=j.document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Hv(s,u,Nu.fromRangeStart(r.selection.getRng())).map(Vv).map(Cy(r,o))}),r.nodeChanged()},xy=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),Cs(t,e)||e),u=d(vv.isInlineTarget,n),s=Hv(u,a,o);return s.bind(function(e){return i?e.fold($(T.some(Vv(e))),T.none,$(T.some(Lv(e))),T.none):e.fold(T.none,$(T.some(Lv(e))),T.none,$(T.some(Vv(e))))}).map(Cy(n,r)).getOrThunk(function(){var t=el.navigate(i,a,o),e=t.bind(function(e){return Hv(u,a,e)});return s.isSome()&&e.isSome()?vv.findRootInline(u,a,o).map(function(e){return o=e,!!Qa([el.firstPositionIn(o),el.lastPositionIn(o)],function(e,t){var n=vv.normalizePosition(!0,e),r=vv.normalizePosition(!1,t);return el.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(Sm(n,i,or.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?wy(n,r,o,e):wy(n,r,e,o),!0})}).getOr(!1)})},Ny=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Nu.fromRangeStart(e.selection.getRng());return xy(e,t,n,r)}return!1},Ey=function(e){return 1===qr(e).length},zy=function(e,t,n,r){var o,i,a,u,s=d(Lm,t),l=K(V(r,s),function(e){return e.dom()});if(0===l.length)Sm(t,e,n);else{var c=(o=n.dom(),i=l,a=Dm(!1),u=Hm(i,a.dom()),Di(or.fromDom(o),a),Pi(or.fromDom(o)),Nu(u,0));t.selection.setRng(c.toRange())}},Sy=function(r,o){var t,e=or.fromDom(r.getBody()),n=or.fromDom(r.selection.getStart()),i=V((t=pd(n,e),U(t,ho).fold($(t),function(e){return t.slice(0,e)})),Ey);return ne(i).map(function(e){var t,n=Nu.fromRangeStart(r.selection.getRng());return!(!Vb(o,n,e.dom())||Wu((t=e).dom())&&Am(t.dom())||(zy(o,r,e,i),0))}).getOr(!1)},ky=function(e,t){return!!e.selection.isCollapsed()&&Sy(e,t)},Ty=kr("start","end"),Ay=kr("rng","table","cells"),Ry=Bc([{removeTable:["element"]},{emptyCells:["cells"]}]),Dy=function(e,t){return ta(or.fromDom(e),"td,th",t)},My=function(e,t){return Zi(e,"table",t)},By=function(e){return!1===Hr(e.start(),e.end())},Oy=function(e,n){return My(e.start(),n).bind(function(t){return My(e.end(),n).bind(function(e){return Hr(t,e)?T.some(t):T.none()})})},_y=function(e){return Xi(e,"td,th")},Hy=function(r,e){var t=Dy(e.startContainer,r),n=Dy(e.endContainer,r);return e.collapsed?T.none():Qa([t,n],Ty).fold(function(){return t.fold(function(){return n.bind(function(t){return My(t,r).bind(function(e){return te(_y(e)).map(function(e){return Ty(e,t)})})})},function(t){return My(t,r).bind(function(e){return ne(_y(e)).map(function(e){return Ty(t,e)})})})},function(e){return Py(r,e)?T.none():(n=r,My((t=e).start(),n).bind(function(e){return ne(_y(e)).map(function(e){return Ty(t.start(),e)})}));var t,n})},Py=function(e,t){return Oy(t,e).isSome()},Ly=function(e,t){var n,r,o,i,a=d(Hr,e);return(n=t,r=a,o=Dy(n.startContainer,r),i=Dy(n.endContainer,r),Qa([o,i],Ty).filter(By).filter(function(e){return Py(r,e)}).orThunk(function(){return Hy(r,n)})).bind(function(e){return Oy(t=e,a).map(function(e){return Ay(t,e,_y(e))});var t})},Vy=function(e,t){return U(e,function(e){return Hr(e,t)})},Iy=function(n){return(r=n,Qa([Vy(r.cells(),r.rng().start()),Vy(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?Ry.removeTable(n.table()):Ry.emptyCells(e)});var r},Fy=function(e,t){return Ly(e,t).bind(Iy)},Uy=function(e,t){return L(t,Jh),e.selection.setCursorLocation(t[0].dom(),0),!0},jy=function(e,t){return Sm(e,!1,t),!0},qy=function(n,e,r,t){return Wy(e,t).fold(function(){return t=n,Fy(e,r).map(function(e){return e.fold(d(jy,t),d(Uy,t))});var t},function(e){return Ky(n,e)}).getOr(!1)},$y=function(e,t){return F(pd(t,e),wo)},Wy=function(e,t){return F(pd(t,e),function(e){return"caption"===sr(e)})},Ky=function(e,t){return Jh(t),e.selection.setCursorLocation(t.dom(),0),T.some(!0)},Xy=function(u,s,l,c,f){return el.navigate(l,u.getBody(),f).bind(function(e){return r=c,o=l,i=f,a=e,el.firstPositionIn(r.dom()).bind(function(t){return el.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Ky(u,c):(t=c,n=e,Wy(s,or.fromDom(n.getNode())).map(function(e){return!1===Hr(e,t)}));var t,n,r,o,i,a}).or(T.some(!0))},Yy=function(a,u,s,e){var l=Nu.fromRangeStart(a.selection.getRng());return $y(s,e).bind(function(e){return gm(e)?Ky(a,e):(t=a,n=s,r=u,o=e,i=l,el.navigate(r,t.getBody(),i).bind(function(e){return $y(n,or.fromDom(e.getNode())).map(function(e){return!1===Hr(e,o)})}));var t,n,r,o,i})},Gy=function(a,u,e){var s=or.fromDom(a.getBody());return Wy(s,e).fold(function(){return Yy(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Nu.fromRangeStart(t.selection.getRng()),gm(o)?Ky(t,o):Xy(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},Jy=function(e,t){var n,r,o,i,a,u=or.fromDom(e.selection.getStart(!0)),s=Op(e);return e.selection.isCollapsed()&&0===s.length?Gy(e,t,u):(n=e,r=u,o=or.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Op(n)).length?Uy(n,a):qy(n,o,i,r))},Qy=function(e,t){return!!e.selection.isCollapsed()&&(n=e,r=t,o=Nu.fromRangeStart(n.selection.getRng()),el.fromPosition(r,n.getBody(),o).filter(function(e){return r?wh(e):xh(e)}).bind(function(e){return T.from(xs(r?0:-1,e))}).map(function(e){return n.selection.select(e),!0}).getOr(!1));var n,r,o},Zy=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,_b([{keyCode:ch.BACKSPACE,action:Ob(py,t,!1)},{keyCode:ch.DELETE,action:Ob(py,t,!0)},{keyCode:ch.BACKSPACE,action:Ob(yy,t,!1)},{keyCode:ch.DELETE,action:Ob(yy,t,!0)},{keyCode:ch.BACKSPACE,action:Ob(Ny,t,n,!1)},{keyCode:ch.DELETE,action:Ob(Ny,t,n,!0)},{keyCode:ch.BACKSPACE,action:Ob(Jy,t,!1)},{keyCode:ch.DELETE,action:Ob(Jy,t,!0)},{keyCode:ch.BACKSPACE,action:Ob(Qy,t,!1)},{keyCode:ch.DELETE,action:Ob(Qy,t,!0)},{keyCode:ch.BACKSPACE,action:Ob(ry,t,!1)},{keyCode:ch.DELETE,action:Ob(ry,t,!0)},{keyCode:ch.BACKSPACE,action:Ob(Zb,t,!1)},{keyCode:ch.DELETE,action:Ob(Zb,t,!0)},{keyCode:ch.BACKSPACE,action:Ob(ky,t,!1)},{keyCode:ch.DELETE,action:Ob(ky,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,_b([{keyCode:ch.BACKSPACE,action:Ob(vy,t)},{keyCode:ch.DELETE,action:Ob(vy,t)}],n))})},eC=function(e){return T.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},tC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new ao(t,t);r=n.current();){if(Oo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Oo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},nC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},rC=eC,oC=function(e){return eC(e).fold($(""),function(e){return e.nodeName.toUpperCase()})},iC=function(e){return eC(e).filter(function(e){return bo(or.fromDom(e))}).isSome()},aC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},uC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},sC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},lC=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Oo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},cC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;uC(u=n)&&uC(u.parentNode)&&(o="LI");var s,l,c=o?t(o):i.create("BR");if(lC(n,r,!0)&&lC(n,r,!1))aC(n,"LI")?i.insertAfter(c,sC(n)):i.replace(c,n);else if(lC(n,r,!0))aC(n,"LI")?(i.insertAfter(c,sC(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n);else if(lC(n,r,!1))i.insertAfter(c,sC(n));else{n=sC(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(l="LI",(s=d).firstChild&&s.firstChild.nodeName===l)?(c=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(c,n))}i.remove(r),tC(e,c)}},fC=function(e){e.innerHTML='<br data-mce-bogus="1">'},dC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},hC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},mC=function(e,t,n){return!1===Oo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===va?0:n:n===t.data.length-1&&t.data.charAt(n)===va?t.data.length:n},gC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},pC=function(e,t){var n=rc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,oc(e))},vC=function(a,e){var t,u,s,i,l,n,r,o,c,f,d,h,m,g=a.dom,p=a.schema,v=p.getNonEmptyElements(),b=a.selection.getRng(),y=function(e){var t,n,r,o=s,i=p.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=g.create(e||h),pC(a,t)):t=l.cloneNode(!1),r=t,!1===uc(a))g.setAttrib(t,"style",null),g.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Wu(o)||cl(o))continue;n=o.cloneNode(!1),g.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return fC(r),t},C=function(e){var t,n,r,o;if(o=mC(e,s,i),Oo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===l&&m&&!e)return!0;if(e&&Oo.isElement(s)&&s===l.firstChild)return!0;if(dC(s,"TABLE")||dC(s,"HR"))return m&&!e||!m&&e;for(t=new ao(s,l),Oo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Oo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),v[r]&&"br"!==r))return!1}else if(Oo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},w=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?y(h):y(),sc(a)&&hC(g,c)&&g.isEmpty(l)?r=g.split(c,l):g.insertAfter(r,l),tC(a,r)};Xp(g,b).each(function(e){b.setStart(e.startContainer,e.startOffset),b.setEnd(e.endContainer,e.endOffset)}),s=b.startContainer,i=b.startOffset,h=rc(a),n=!(!e||!e.shiftKey);var x,N,E,z,S,k,T=!(!e||!e.ctrlKey);Oo.isElement(s)&&s.hasChildNodes()&&(m=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=m&&Oo.isText(s)?s.nodeValue.length:0),(u=gC(g,s))&&((h&&!n||!h&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,l,c,f,d=t||"P",h=e.dom,m=gC(h,r);if(!(a=h.getParent(r,h.isBlock))||!hC(h,a)){if(c=(a=a||m)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=h.create(d),pC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!h.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(c,d.toLowerCase())){for(i=h.create(d),pC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!h.isBlock(s);)l=s.nextSibling,i.appendChild(s),s=l;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,h,b,s,i)),l=g.getParent(s,g.isBlock),c=l?g.getParent(l.parentNode,g.isBlock):null,f=l?l.nodeName.toUpperCase():"","LI"!==(d=c?c.nodeName.toUpperCase():"")||T||(c=(l=c).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&g.isEmpty(l)?cC(a,y,c,l,h):h&&l===a.getBody()||(h=h||"P",wa(l)?(r=Ra(l),g.isEmpty(l)&&fC(l),tC(a,r)):C()?w():C(!0)?(r=l.parentNode.insertBefore(y(),l),tC(a,dC(l,"HR")?r:l)):((t=(S=b,k=S.cloneRange(),k.setStart(S.startContainer,mC(!0,S.startContainer,S.startOffset)),k.setEnd(S.endContainer,mC(!1,S.endContainer,S.endOffset)),k).cloneRange()).setEndAfter(l),o=t.extractContents(),z=o,L(Ki(or.fromDom(z),fr),function(e){var t=e.dom();t.nodeValue=ba(t.nodeValue)}),function(e){for(;Oo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,g.insertAfter(o,l),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Oo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(g,v,r),x=g,(N=l).normalize(),(E=N.lastChild)&&!/^(left|right)$/gi.test(x.getStyle(E,"float",!0))||x.add(N,"br"),g.isEmpty(l)&&fC(l),r.normalize(),g.isEmpty(r)?(g.remove(r),w()):tC(a,r)),g.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},bC=function(e,t,n){var r=e.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},yC=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},CC=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Xp(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var l=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=l&&3===s.nodeType?s.nodeValue.length:0}var c=i.getParent(s,i.isBlock),f=c?i.getParent(c.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",h=!(!t||!t.ctrlKey);"LI"!==d||h||(c=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new ao(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,c)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Ou(i,a,n),bC(i,o,n),yC(i,o,n,r),e.undoManager.add()},wC=function(e,t){var n=or.fromTag("br");Di(or.fromDom(t),n),e.undoManager.add()},xC=function(e,t){NC(e.getBody(),t)||Mi(or.fromDom(t),or.fromTag("br"));var n=or.fromTag("br");Mi(or.fromDom(t),n),bC(e.dom,e.selection,n.dom()),yC(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},NC=function(e,t){return n=Nu.after(t),!!Oo.isBr(n.getNode())||el.nextPosition(e,Nu.after(t)).map(function(e){return Oo.isBr(e.getNode())}).getOr(!1);var n},EC=function(e){return e&&"A"===e.nodeName&&"href"in e},zC=function(e){return e.fold($(!1),EC,EC,$(!1))},SC=function(e,t){t.fold(o,d(wC,e),d(xC,e),o)},kC=function(e,t){var n,r,o,i=(n=e,r=d(vv.isInlineTarget,n),o=Nu.fromRangeStart(n.selection.getRng()),Hv(r,n.getBody(),o).filter(zC));i.isSome()?i.each(d(SC,e)):CC(e,t)},TC=function(e,t){return rC(e).filter(function(e){return 0<t.length&&Or(or.fromDom(e),t)}).isSome()},AC=function(e){return TC(e,ic(e))},RC=function(e){return TC(e,ac(e))},DC=Bc([{br:[]},{block:[]},{none:[]}]),MC=function(e,t){return RC(e)},BC=function(n){return function(e,t){return""===rc(e)===n}},OC=function(n){return function(e,t){return iC(e)===n}},_C=function(n,r){return function(e,t){return oC(e)===n.toUpperCase()===r}},HC=function(e){return _C("pre",e)},PC=function(n){return function(e,t){return nc(e)===n}},LC=function(e,t){return AC(e)},VC=function(e,t){return t},IC=function(e){var t=rc(e),n=nC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},FC=function(e,t){return function(n,r){return I(e,function(e,t){return e&&t(n,r)},!0)?T.some(t):T.none()}},UC=function(e,t){return bv([FC([MC],DC.none()),FC([_C("summary",!0)],DC.br()),FC([HC(!0),PC(!1),VC],DC.br()),FC([HC(!0),PC(!1)],DC.block()),FC([HC(!0),PC(!0),VC],DC.block()),FC([HC(!0),PC(!0)],DC.br()),FC([OC(!0),VC],DC.br()),FC([OC(!0)],DC.block()),FC([BC(!0),VC,IC],DC.block()),FC([BC(!0)],DC.br()),FC([LC],DC.br()),FC([BC(!1),VC],DC.br()),FC([IC],DC.block())],[e,!(!t||!t.shiftKey)]).getOr(DC.none())},jC=function(e,t){UC(e,t).fold(function(){kC(e,t)},function(){vC(e,t)},o)},qC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===ch.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),jC(t,n)})))})},$C=function(n,r){var e=r.container(),t=r.offset();return Oo.isText(e)?(e.insertData(t,n),T.some(Cu(e,t+n.length))):Rs(r).map(function(e){var t=or.fromText(n);return r.isAtEnd()?Mi(e,t):Di(e,t),Cu(t.dom(),n.length)})},WC=d($C,"\xa0"),KC=d($C," "),XC=function(e,t,n){return el.navigateIgnore(e,t,n,vh)},YC=function(t,n,r){var e=V(pd(or.fromDom(r.container()),n),ho);return te(e).fold(function(){return XC(t,n.dom(),r).forall(function(e){return!1===ws(e,r,n.dom())})},function(e){return XC(t,e.dom(),r).isNone()})},GC=d(YC,!1),JC=d(YC,!0),QC=function(e){return Cu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},ZC=function(e,t){var n=V(pd(or.fromDom(t.container()),e),ho);return te(n).getOr(e)},ew=function(e,t){return QC(t)?ph(t):ph(t)||el.prevPosition(ZC(e,t).dom(),t).exists(ph)},tw=function(e,t){return QC(t)?gh(t):gh(t)||el.nextPosition(ZC(e,t).dom(),t).exists(gh)},nw=function(e){return Rs(e).bind(function(e){return Qi(e,cr)}).exists(function(e){return t=Er(e,"white-space"),P(["pre","pre-line","pre-wrap"],t);var t})},rw=function(e,t){return o=e,i=t,el.prevPosition(o.dom(),i).isNone()||(n=e,r=t,el.nextPosition(n.dom(),r).isNone())||GC(e,t)||JC(e,t)||uy(e,t)||ay(e,t);var n,r,o,i},ow=function(e,t){var n,r,o,i=(r=(n=t).container(),o=n.offset(),Oo.isText(r)&&o<r.data.length?Cu(r,o+1):n);return!nw(i)&&(JC(e,i)||ay(e,i)||tw(e,i))},iw=function(e,t){return n=e,!nw(r=t)&&(GC(n,r)||uy(n,r)||ew(n,r))||ow(e,t);var n,r},aw=function(e,t){return fh(e.charAt(t))},uw=function(e){var t=e.container();return Oo.isText(t)&&Kn(t.data,"\xa0")},sw=function(e){var t=e.data,n=K(t.split(""),function(e,t,n){return fh(e)&&0<t&&t<n.length-1&&hh(n[t-1])&&hh(n[t+1])?" ":e}).join("");return n!==t&&(e.data=n,!0)},lw=function(c,e){return T.some(e).filter(uw).bind(function(e){var t,n,r,o,i,a,u,s,l=e.container();return i=c,u=(a=l).data,s=Cu(a,0),aw(u,0)&&!iw(i,s)&&(a.data=" "+u.slice(1),1)||sw(l)||(t=c,r=(n=l).data,o=Cu(n,r.length-1),aw(r,r.length-1)&&!iw(t,o)&&(n.data=r.slice(0,-1)+" ",1))?T.some(e):T.none()})},cw=function(t){var e=or.fromDom(t.getBody());t.selection.isCollapsed()&&lw(e,Cu.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},fw=function(r,o){return function(e){return t=r,!nw(n=e)&&(rw(t,n)||ew(t,n)||tw(t,n))?WC(o):KC(o);var t,n}},dw=function(e){var t,n,r=Nu.fromRangeStart(e.selection.getRng()),o=or.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=d(vv.isInlineTarget,e),a=Nu.fromRangeStart(e.selection.getRng());return Hv(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return el.prevPosition(n.dom(),Nu.before(e))},function(e){return el.firstPositionIn(e)},function(e){return el.lastPositionIn(e)},function(e){return el.nextPosition(n.dom(),Nu.after(e))})})).bind(fw(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1},hw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,_b([{keyCode:ch.SPACEBAR,action:Ob(dw,t)}],n).each(function(e){n.preventDefault()}))})},mw=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Ra(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},gw=function(e,t){var n,r=(n=e,ea(or.fromDom(n.getBody()),"*[data-mce-caret]").fold($(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void mw(e,r)):void(Ea(r)&&(mw(e,r),e.undoManager.add()))},pw=function(e){e.on("keyup compositionstart",d(gw,e))},vw=nr.detect().browser,bw=function(t){var e,n;e=t,n=Vi(function(){e.composing||cw(e)},0),vw.isIE()&&(e.on("keypress",function(e){n.throttle()}),e.on("remove",function(e){n.cancel()})),t.on("input",function(e){!1===e.isComposing&&cw(t)})},yw=function(e){var t=Xv.setupSelectedState(e);pw(e),Hb(e,t),Zy(e,t),qC(e),hw(e),bw(e)};function Cw(u){var s,n,r,o=Gt.each,l=ch.BACKSPACE,c=ch.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=he.gecko,a=he.ie,h=he.webkit,m="data:text/mce-internal,",g=a?"Text":"URL",p=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},b=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===l&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<he.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===ch.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===c||a===l)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),he.windowsPhone||u.on("keyup focusin mouseup",function(e){ch.modifierPressed(e)||d.normalize()},!0),h&&(u.inline||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Na(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){p("DefaultParagraphSeparator",rc(u))}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),y(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),he.iOS?(u.inline||u.on("keydown",function(){j.document.activeElement===j.document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),11<=he.ie&&(C(),y()),he.ie&&(b(),p("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=m+escape(u.id)+","+escape(n),t.dataTransfer.setData(g,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(g))&&0<=a.indexOf(m)?(a=a.substr(m.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=hp(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===l){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),j.Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),be.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),be.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),e.object_resizing||p("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),he.mac&&u.on("keydown",function(e){!ch.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var ww=function(e){return Oo.isElement(e)&&po(or.fromDom(e))},xw=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=Cu.fromRangeStart(t),r=Cu.fromRangeEnd(t);if(Cu.isElementPosition(n)){var o=n.container();ww(o)&&el.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}Cu.isElementPosition(r)&&(o=n.container(),ww(o)&&el.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(bg(t))}(t)})},Nw=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){L(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){L(e,function(e){var t=e.attr("data-mce-open");e.attr("open",A(t)?t:null),e.attr("data-mce-open",null)})})},Ew=bi.DOM,zw=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&be.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},Sw=function(t,e){var n,r,u,o,i,a,s,l,c,f=t.settings,d=t.getElement(),h=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(h.open(),h.write(t.iframeHTML),h.close()),t.inline&&(t.on("remove",function(){var e=this.getBody();Ew.removeClass(e,"mce-content-body"),Ew.removeClass(e,"mce-edit-focus"),Ew.setAttrib(e,"contentEditable",null)}),Ew.addClass(d,"mce-content-body"),t.contentDocument=h=f.content_document||j.document,t.contentWindow=f.content_window||j.window,t.bodyElement=d,t.contentAreaContainer=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===Ew.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=dd(t),t.schema=ii(f),t.dom=bi(h,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:yc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=Gg((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new Ul("br",1)).shortEnded=!0)}),o),t.serializer=tp(f,t),t.selection=ov(t.dom,t.getWin(),t.serializer,t),t.annotator=_l(t),t.formatter=Og(t),t.undoManager=Kh(t),t._nodeChangeDispatcher=new Td(t),t._selectionOverrides=Rh(t),Nw(t),xw(t),yw(t),wd(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(h.body.spellcheck=!1,Ew.setAttrib(n,"spellcheck","false")),t.quirks=Cw(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.protect&&t.on("BeforeSetContent",function(t){Gt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Gt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?Ew.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){zw(t)},function(e){zw(t)}),f.content_style&&(a=t,s=f.content_style,l=or.fromDom(a.getDoc().head),c=or.fromTag("style"),Cr(c,"type","text/css"),Oi(c,or.fromText(s)),Oi(l,c))},kw=bi.DOM,Tw=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=Gl(e),i=or.fromTag("iframe"),wr(i,o),wr(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),qi(i,"tox-edit-area__iframe"),i).dom();u.onload=function(){u.onload=null,e.fire("load")};var s,l,c,f,d=function(e,t){if(j.document.domain!==j.window.location.hostname&&he.ie&&he.ie<12){var n=fd.uuid("mce");e[n]=function(){Sw(e)};var r='javascript:(function(){document.open();document.domain="'+j.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return kw.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=(f=Jl(s=e)+"<html><head>",Ql(s)!==s.documentBaseUrl&&(f+='<base href="'+s.documentBaseURI.getURI()+'" />'),f+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',l=Zl(s),c=ec(s),tc(s)&&(f+='<meta http-equiv="Content-Security-Policy" content="'+tc(s)+'" />'),f+='</head><body id="'+l+'" class="mce-content-body '+c+'" data-id="'+s.id+'"><br></body></html>'),kw.add(t.iframeContainer,u),d},Aw=function(e,t){var n=Tw(e,t);t.editorContainer&&(kw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=kw.isHidden(t.editorContainer)),e.getElement().style.display="none",kw.setAttrib(e.id,"aria-hidden","true"),n||Sw(e)},Rw=function(e){var t,n,r,o,i;e.contentCSS=e.contentCSS.concat((n=Ec(t=e),r=t.editorManager.baseURL+"/skins/content",o="content"+t.editorManager.suffix+".css",i=!0===t.inline,K(n,function(e){return/^[a-z0-9\-]+$/i.test(e)&&!i?r+"/"+e+"/"+o:t.documentBaseURI.toAbsolute(e)})))},Dw=bi.DOM,Mw=function(t,n,e){var r=Gf.get(e),o=Gf.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Gt.trim(e),r&&-1===Gt.inArray(n,e)){if(Gt.each(Gf.dependencies(e),function(e){Mw(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(GN){Xf.pluginInitError(t,e,GN)}}},Bw=function(e){return e.replace(/^\-/,"")},Ow=function(e){return{editorContainer:e,iframeContainer:e}},_w=function(e){var t,n,r=e.getElement();return e.inline?Ow(null):(t=r,n=Dw.create("div"),Dw.insertAfter(n,t),Ow(n))},Hw=function(e){var n,t,r,o,i;e.fire("ScriptsLoaded"),n=e,t=Gt.trim(n.settings.icons),r=la({},{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 1 1 0-2h9.2zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h6.8zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 0 1 0-2h4.4zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 0 1 0-2h2zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 1 1 0-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 0 1-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0zm-10-7l-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8zM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 1 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',comment:'<svg width="24" height="24"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23z" fill-rule="nonzero"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1z"/></g></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9zM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13z" fill-rule="nonzero"/></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2zm14-2v2h2a2 2 0 0 0-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 0 0 2-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2zm2 14h-2v2a2 2 0 0 0 2-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1zM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" fill-rule="evenodd"/></svg>',indeterminate:'<svg width="24" height="24"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 11a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2.1 2a2 2 0 1 0 2.7 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5z" fill-rule="evenodd"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><g fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="#000" stroke-width="2"><path d="M12 5v14M5 12h14"/></g></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8zM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7zM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 0 0-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 0 0 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm-2.4-6.1L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3z" fill-rule="evenodd"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-cell-properties":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><path d="M12.5 5.5v6h6v-6h-6zm-1 0h-6v6h6v-6zm1 13h6v-6h-6v6zm-1 0v-6h-6v6h6zm-7-14h15v15h-15v-15z" fill-rule="nonzero"/></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5.5 5.5v13h13v-13h-13zm-1-1h15v15h-15v-15z" opacity=".2"/><path d="M11.5 11.5v-7h1v7h7v1h-7v7h-1v-7h-7v-1h7z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path d="M9 11.2l1 1v.2l-1 1v-2.2zm5 1l1-1v2.2l-1-1v-.2zM20 5v14H4V5h16zm-1 2h-4v.8l-.2-.2-.8.8V7h-4v1.4l-.8-.8-.2.2V7H5v11h4v-1.8l.5.5.5-.4V18h4v-1.8l.8.8.2-.3V18h4V7zm-3.9 3.4l-1.8 1.9 1.8 1.9c.4.3.4.9 0 1.2-.3.3-.8.3-1.2 0L12 13.5l-1.8 1.9a.8.8 0 0 1-1.2 0 .9.9 0 0 1 0-1.2l1.8-1.9-1.9-2a.9.9 0 0 1 1.2-1.2l2 2 1.8-1.8c.3-.4.9-.4 1.2 0a.8.8 0 0 1 0 1.1z" fill-rule="evenodd"/></svg>',"table-delete-row":'<svg width="24" height="24"><path d="M16.7 8.8l1.1 1.2-2.4 2.5L18 15l-1.2 1.2-2.5-2.5-2.4 2.5-1.3-1.2 2.5-2.5-2.5-2.5 1.2-1.3 2.6 2.6 2.4-2.5zM4 5h16v14H4V5zm15 5V7H5v3h4.8l1 1H5v3h5.8l-1 1H5v3h14v-3h-.4l-1-1H19v-3h-1.3l1-1h.3z" fill-rule="evenodd"/></svg>',"table-delete-table":'<svg width="24" height="26"><path d="M4 6h16v14H4V6zm1 2v11h14V8H5zm11.7 8.7l-1.5 1.5L12 15l-3.3 3.2-1.4-1.5 3.2-3.2-3.3-3.2 1.5-1.5L12 12l3.2-3.2 1.5 1.5-3.2 3.2 3.2 3.2z" fill-rule="evenodd"/></svg>',"table-insert-column-after":'<svg width="24" height="24"><path d="M14.3 9c.4 0 .7.3.7.6v2.2h2.1c.4 0 .7.3.7.7 0 .4-.3.7-.7.7H15v2.2c0 .3-.3.6-.7.6a.7.7 0 0 1-.6-.6v-2.2h-2.2a.7.7 0 0 1 0-1.4h2.2V9.6c0-.3.3-.6.6-.6zM4 5h16v14H4V5zm5 13v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8V7h-9v11h9z" fill-rule="evenodd"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path d="M9.7 16a.7.7 0 0 1-.7-.6v-2.2H6.9a.7.7 0 0 1 0-1.4H9V9.6c0-.3.3-.6.7-.6.3 0 .6.3.6.6v2.2h2.2c.4 0 .8.3.8.7 0 .4-.4.7-.8.7h-2.2v2.2c0 .3-.3.6-.6.6zM4 5h16v14H4V5zm10 13V7H5v11h9zm5 0v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V7h-4v3h4z" fill-rule="evenodd"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path d="M14.8 10.5c0 .3-.2.5-.5.5h-1.8v1.8c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.6V11H9.7a.5.5 0 0 1 0-1h1.8V8.3c0-.3.2-.6.5-.6s.5.3.5.6V10h1.8c.3 0 .5.2.5.5zM4 5h16v14H4V5zm5 13v-3H5v3h4zm5 0v-3h-4v3h4zm5 0v-3h-4v3h4zm0-4V7H5v7h14z" fill-rule="evenodd"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path d="M9.2 14.5c0-.3.2-.5.5-.5h1.8v-1.8c0-.3.2-.5.5-.5s.5.2.5.6V14h1.8c.3 0 .5.2.5.5s-.2.5-.5.5h-1.8v1.7c0 .3-.2.6-.5.6a.5.5 0 0 1-.5-.6V15H9.7a.5.5 0 0 1-.5-.5zM4 5h16v14H4V5zm6 2v3h4V7h-4zM5 7v3h4V7H5zm14 11v-7H5v7h14zm0-8V7h-4v3h4z" fill-rule="evenodd"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm10 12v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4zm5 8v-3h-4v3h4zm0-4v-3h-4v3h4zm0-4V6h-4v3h4z" fill-rule="evenodd"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 13h9v-7h-9v7zm4-11h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10-1h4V7h-4v3zM5 15v3h4v-3H5z" fill-rule="evenodd"/></svg>',"table-row-properties":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm10 10h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm6 3h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',"table-split-cells":'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 2v3h4V7h-4zM9 18v-3H5v3h4zm0-4v-3H5v3h4zm0-4V7H5v3h4zm10 8v-7h-9v7h9zm0-8V7h-4v3h4zm-3.5 4.5l1.5 1.6c.3.2.3.7 0 1-.2.2-.7.2-1 0l-1.5-1.6-1.6 1.5c-.2.3-.7.3-1 0a.7.7 0 0 1 0-1l1.6-1.5-1.5-1.6a.7.7 0 0 1 1-1l1.5 1.6 1.6-1.5c.2-.3.7-.3 1 0 .2.2.2.7 0 1l-1.6 1.5z" fill-rule="evenodd"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M4 5h16v13H4V5zm5 12v-3H5v3h4zm0-4v-3H5v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4zm5 4v-3h-4v3h4zm0-4v-3h-4v3h4z" fill-rule="evenodd"/></svg>',table:'<svg width="24" height="24"><path d="M4 5h16v14H4V5zm6 9h4v-3h-4v3zm4 1h-4v3h4v-3zm0-8h-4v3h4V7zM9 7H5v3h4V7zm-4 4v3h4v-3H5zm10 0v3h4v-3h-4zm0-1h4V7h-4v3zM5 15v3h4v-3H5zm10 3h4v-3h-4v3z" fill-rule="evenodd"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 1 1 2 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2zM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1zM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path d="M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm0-1a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" fill-rule="evenodd"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12zM11 6.4L8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z" fill-rule="nonzero"/></svg>'},Yf.get(t).icons),mr(r,function(e,t){n.ui.registry.addIcon(t,e)}),function(e){var t=e.settings.theme;if(A(t)){e.settings.theme=Bw(t);var n=Jf.get(t);e.theme=new n(e,Jf.urls[t]),e.theme.init&&e.theme.init(e,Jf.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$)}else e.theme={}}(e),o=e,i=[],Gt.each(o.settings.plugins.split(/[ ,]/),function(e){Mw(o,i,Bw(e))});var a,u,s,l,c,f,d=(c=(a=e).settings,f=a.getElement(),a.orgDisplay=f.style.display,A(c.theme)?a.theme.renderUI():O(c.theme)?(s=(u=a).getElement(),(l=u.settings.theme(u,s)).editorContainer.nodeType&&(l.editorContainer.id=l.editorContainer.id||u.id+"_parent"),l.iframeContainer&&l.iframeContainer.nodeType&&(l.iframeContainer.id=l.iframeContainer.id||u.id+"_iframecontainer"),l.height=l.iframeHeight?l.iframeHeight:s.offsetHeight,l):_w(a));return e.editorContainer=d.editorContainer?d.editorContainer:null,Rw(e),e.inline?Sw(e):Aw(e,d)},Pw=bi.DOM,Lw=function(e){return"-"===e.charAt(0)},Vw=function(a,u){var s=Ni.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(A(i)){if(!Lw(i)&&!Jf.urls.hasOwnProperty(i)){var a=o.theme_url;a?Jf.load(i,t.documentBaseURI.toAbsolute(a)):Jf.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Jf.waitFor(i,r)})}else r()}(s,a,u,function(){var e,t,n,r,o,i;e=s,n=Cc(t=a),r=wc(t),!1===Ti.hasCode(n)&&"en"!==n&&(""!==r?e.add(r):e.add(t.editorManager.baseURL+"/langs/"+n+".js")),function(e,t){var n=e.icons;if(A(n)){var r=t.editorManager.baseURL+"/icons/"+Gt.trim(n)+"/icons.js";Ni.ScriptLoader.add(r)}}(a.settings,a),o=a.settings,i=u,Gt.isArray(o.plugins)&&(o.plugins=o.plugins.join(" ")),Gt.each(o.external_plugins,function(e,t){Gf.load(t,e),o.plugins+=" "+t}),Gt.each(o.plugins.split(/[ ,]/),function(e){if((e=Gt.trim(e))&&!Gf.urls[e])if(Lw(e)){e=e.substr(1,e.length);var t=Gf.dependencies(e);Gt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+i+".js"};e=Gf.createUrl(t,e),Gf.load(e.resource,e)})}else Gf.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+i+".js"})}),s.loadQueue(function(){a.removed||Hw(a)},a,function(e){Xf.pluginLoadError(a,e[0]),a.removed||Hw(a)})})},Iw=function(t){var e=t.settings,n=t.id;Ti.setCode(Cc(t));var r=function(){Pw.unbind(j.window,"ready",r),t.render()};if(ke.Event.domLoaded){if(t.getElement()&&he.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||Pw.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(Pw.insertAfter(Pw.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Pw.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=Ff(t),t.notificationManager=If(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=Pw.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Vw(t,t.suffix)}}else Pw.bind(j.window,"ready",r)},Fw=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},Uw=function(e,t,n){var r,o;Wi(e,t)&&!1===n?(o=t,Fi(r=e)?r.dom().classList.remove(o):ji(r,o),$i(r)):n&&qi(e,t)},jw=function(e,t){Uw(or.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",Fw(e,"StyleWithCSS",!1),Fw(e,"enableInlineTableEditing",!1),Fw(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},qw=function(e){return e.readonly?"readonly":"design"},$w=function(e){return Gt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Ww=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||Oo.isBr(t));var t},Kw=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Ww(t))?e.slice(0,-1):e;var t},Xw=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Yw=function(e,t){var n=Nu.after(e),r=js(t).prev(n);return r?r.toRange():null},Gw=function(t,e,n){var r,o,i,a,u=t.parentNode;return Gt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Nu.before(r),(a=js(o).next(i))?a.toRange():null},Jw=function(e,t){var n,r,o,i,a,u,s=t.firstChild,l=t.lastChild;return s&&"meta"===s.name&&(s=s.next),l&&"mce_marker"===l.attr("id")&&(l=l.prev),r=l,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(l=l.prev),!(!s||s!==l||"ul"!==s.name&&"ol"!==s.name)},Qw=function(e,o,i,t){var n,r,a,u,s,l,c,f,d,h,m,g,p,v,b,y,C,w,x,N=(n=o,r=t,l=e.serialize(r),c=n.createFragment(l),u=(a=c).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=Xw(o,i.startContainer),z=Kw($w(N.firstChild)),S=o.getRoot(),k=function(e){var t=Nu.fromRangeStart(i),n=js(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Xw(o,r.getNode())!==E};return k(1)?Gw(E,z,S):k(2)?(f=E,d=z,h=S,o.insertAfter(d.reverse(),f),Yw(d[0],h)):(g=z,p=S,v=m=E,y=(b=i).cloneRange(),C=b.cloneRange(),y.setStartBefore(v),C.setEndAfter(v),w=[y.cloneContents(),C.cloneContents()],(x=m.parentNode).insertBefore(w[0],m),Gt.each(g,function(e){x.insertBefore(e,m)}),x.insertBefore(w[1],m),x.removeChild(m),Yw(g[g.length-1],p))},Zw=function(e,t){return!!Xw(e,t)},ex=Oo.matchNodeNames("td th"),tx=function(e,t){var n,r,o=e.selection.getRng(),i=o.startContainer,a=o.startOffset;o.collapsed&&(n=i,r=a,Oo.isText(n)&&"\xa0"===n.nodeValue[r-1])&&Oo.isText(i)&&(i.insertData(a-1," "),i.deleteData(a,1),o.setStart(i,a),o.setEnd(i,a),e.selection.setRng(o)),e.selection.setContent(t)},nx=function(e,t,n){var r,o,i,a,u,s,l,c,f,d,h,m=e.selection,g=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?t=t.replace(/^&nbsp;/," "):o("previousSibling")||(t=t.replace(/^ /,"&nbsp;")),r<n.length?t=t.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(t=t.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),t}(m.getRng(),t)),r=e.parser,h=n.merge,o=Tc({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var p,v,b,y,C,w,x=(c=m.getRng()).startContainer||(c.parentElement?c.parentElement():null),N=e.getBody();x===N&&m.isCollapsed()&&g.isBlock(N.firstChild)&&(p=e,(v=N.firstChild)&&!p.schema.getShortEndedElements()[v.nodeName])&&g.isEmpty(N.firstChild)&&((c=g.createRng()).setStart(N.firstChild,0),c.setEnd(N.firstChild,0),m.setRng(c)),m.isCollapsed()||(e.selection.setRng(bg(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),b=e.selection.getRng(),y=t,C=b.startContainer,w=b.startOffset,3===C.nodeType&&b.collapsed&&("\xa0"===C.data[w]?(C.deleteData(w,1),/[\u00a0| ]$/.test(y)||(y+=" ")):"\xa0"===C.data[w-1]&&(C.deleteData(w-1,1),/[\u00a0| ]$/.test(y)||(y=" "+y))),t=y);var E,z,S,k={context:(i=m.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Jw(e.schema,u)&&Zw(g,i))return c=Qw(o,g,e.selection.getRng(),u),e.selection.setRng(c),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(l=f).prev;f;f=f.walk(!0))if(3===f.type||!g.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(l,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(tx(e,d),i=m.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:g.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(u)}))),i===a?g.setHTML(a,t):g.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):tx(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new qm(r);Gt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,h),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var l=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(l.setStart(i,i.nodeValue.length),he.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(l.setStartBefore(e),l.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),l.setStart(r,0),l.setEnd(r,0),ex(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=Nu.fromRangeStart(e);if(t=js(n.getBody()).next(t))return t.toRange()}(l))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(l=o,u.remove(r))),s.setRng(l)}}(e,g.get("mce_marker")),E=e.getBody(),Gt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),z=e.dom,S=e.selection.getStart(),T.from(z.getParent(S,"td,th")).map(or.fromDom).each(Qh),e.fire("SetContent",s),e.addVisual()}},rx=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Gt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};nx(e,o.content,o.details)},ox=function(e,t){e.getDoc().execCommand(t,!1,null)},ix=function(e){py(e,!1)||yy(e,!1)||Ny(e,!1)||Zb(e,!1)||Jy(e)||ry(e,!1)||ky(e,!1)||(ox(e,"Delete"),Lb(e))},ax=function(e){py(e,!0)||yy(e,!0)||Ny(e,!0)||Zb(e,!0)||Jy(e)||ry(e,!0)||ky(e,!0)||ox(e,"ForwardDelete")},ux=function(s){return function(u,e){return T.from(e).map(or.fromDom).filter(cr).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return Sr(e,r)},Qi(or.fromDom(i),function(e){return a(e).isSome()},function(e){return Hr(or.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),T.from(bi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},sx={getFontSize:ux("font-size"),getFontFamily:q(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},ux("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},lx=function(e){return el.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Oo.isText(t)?t.parentNode:t})},cx=function(o){return T.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?T.none():T.from(o.selection.getStart(!0))})},fx=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=lc(e),o=cc(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},dx=function(e){var t=parseInt(e,10);return isNaN(t)?0:t},hx=function(e,t){return(e||"table"===sr(t)?"margin":"padding")+("rtl"===Er(t,"direction")?"-right":"-left")},mx=function(e){var r,t=px(e);return!0!==e.readonly&&(1<t.length||(r=e,Q(t,function(e){var t=hx(xc(r),e),n=Sr(e,t).map(dx).getOr(0);return"false"!==r.dom.getContentEditable(e.dom())&&0<n})))},gx=function(e){return vo(e)||bo(e)},px=function(e){return V(K(e.selection.getSelectedBlocks(),or.fromDom),function(e){return!gx(e)&&!Vr(e).map(gx).getOr(!1)&&Qi(e,function(e){return Oo.isContentEditableTrue(e.dom())||Oo.isContentEditableFalse(e.dom())}).exists(function(e){return Oo.isContentEditableTrue(e.dom())})})},vx=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=Nc(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),s=xc(e),l=rc(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==l||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),L(px(e),function(e){!function(e,t,n,r,o,i){var a=hx(n,or.fromDom(i));if("outdent"===t){var u=Math.max(0,dx(i.style[a])-r);e.setStyle(i,a,u?u+o:"")}else u=dx(i.style[a])+r+o,e.setStyle(i,a,u)}(n,t,s,u,a,e.dom())})},bx=Gt.each,yx=Gt.extend,Cx=Gt.map,wx=Gt.inArray;function xx(s){var o,i,a,t,l={state:{},exec:{},value:{}};s.on("PreInit",function(){o=s.dom,i=s.selection,a=s.formatter});var e=function(e,n){n=n||"exec",bx(e,function(t,e){bx(e.toLowerCase().split(","),function(e){l[n][e]=t})})},n=function(e,t,n){e=e.toLowerCase(),l.value[e]=function(){return t.call(n||s)}};yx(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?Yc(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=l.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(bx(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=l.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=l.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),l.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),l.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),l.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:n,hasCustomCommand:function(e){return e=e.toLowerCase(),!!l.exec[e]}});var u=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},r=function(e){return a.match(e)},c=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},f=function(e){t=i.getBookmark(e)},d=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{u(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");he.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),bx("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&c("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;u(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(f(),o.split(n,t),d()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){c(e)},"ForeColor,HiliteColor":function(e,t,n){c(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:fx(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:fx(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){c("blockquote")},FormatBlock:function(e,t,n){return c(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(f(),s.dom.remove(r,!0),d())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){rx(s,n)},mceInsertRawHTML:function(e,t,n){i.setContent("tiny_mce_marker");var r=s.getContent();s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceInsertNewLine:function(e,t,n){jC(s,n)},mceToggleFormat:function(e,t,n){c(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){vx(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Oo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){ix(s)},forwardDelete:function(){ax(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return kC(s,n),!0}});var h=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=Cx(e,function(e){return!!a.matchNode(e,n)});return-1!==wx(t,!0)}};e({JustifyLeft:h("alignleft"),JustifyCenter:h("aligncenter"),JustifyRight:h("alignright"),JustifyFull:h("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return r(e)},mceBlockQuote:function(){return r("blockquote")},Outdent:function(){return mx(s)},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),n("FontName",function(){return cx(t=s).fold(function(){return lx(t).map(function(e){return sx.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return sx.getFontFamily(t.getBody(),e)});var t},this),n("FontSize",function(){return cx(t=s).fold(function(){return lx(t).map(function(e){return sx.getFontSize(t.getBody(),e)}).getOr("")},function(e){return sx.getFontSize(t.getBody(),e)});var t},this)}var Nx=Gt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),Ex=function(a){var u,s,l=this,c={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||l,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Gt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=c[e])||(o=c[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return l},h=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=c[e],!e){for(o in c)s(o,!1),delete c[o];return l}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),c[e]=r);else r.length=0;r.length||(s(e,!1),delete c[e])}}else{for(e in c)s(e,!1);c={}}return l};l.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=c[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&h(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},l.on=r,l.off=h,l.once=function(e,t,n){return r(e,t,n,{once:!0})},l.has=function(e){return e=e.toLowerCase(),!(!c[e]||0===c[e].length)}};Ex.isNative=function(e){return!!Nx[e.toLowerCase()]};var zx,Sx=function(n){return n._eventDispatcher||(n._eventDispatcher=new Ex({scope:n,toggleEvent:function(e,t){Ex.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},kx={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;if(t=Sx(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Sx(this).on(e,t,n)},off:function(e,t){return Sx(this).off(e,t)},once:function(e,t){return Sx(this).once(e,t)},hasEventListeners:function(e){return Sx(this).has(e)}},Tx=bi.DOM,Ax=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=Tx.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},Rx=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},Dx=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=Ax(i,a),i.settings.event_root){if(zx||(zx={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&zx){for(e in zx)i.dom.unbind(Ax(i,e));zx=null}})),zx[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||Tx.isChildOf(t,o))&&Rx(n[r],a,e)}},zx[a]=t,Tx.bind(e,a,t)}else t=function(e){Rx(i,a,e)},Tx.bind(e,a,t),i.delegates[a]=t},Mx={bindPendingEventDelegates:function(){var t=this;Gt.each(t._pendingNativeEvents,function(e){Dx(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?Dx(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(Ax(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(Ax(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},Bx=Mx=Gt.extend({},kx,Mx),Ox=Gt.each,_x=Gt.explode,Hx={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},Px=Gt.makeMap("alt,ctrl,shift,meta,access");function Lx(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Ox(_x(e,"+"),function(e){e in Px?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Hx[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Px)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,he.mac?r.ctrl=!0:r.shift=!0),r.meta&&(he.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Gt.map(_x(e,">"),u))[o.length-1]=Gt.extend(o[o.length-1],{func:n,scope:r||i}),Gt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},l=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Ox(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&l(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&l(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Gt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Ox(_x(Gt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Vx=Gt.each,Ix=Gt.trim,Fx="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Ux={ftp:21,http:80,https:443,mailto:25},jx=function(r,e){var t,n,o=this;if(r=Ix(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new jx(j.document.location.href).directory,r=""==e.base_uri.protocol?"//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),Vx(Fx,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};jx.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new jx(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new jx(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Ux[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),Vx(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},jx.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},jx.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var qx=bi.DOM,$x=Gt.extend,Wx=Gt.each,Kx=Gt.resolve,Xx=he.ie,Yx=function(e,t,n){var r,o,i,a,u,s,l,c=this,f=c.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=c,o=e,i=f,a=n.defaultSettings,u=t,l={id:o,theme:"silver",popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=Tf(xf,l,a,u),c.settings=t,Ri.languageLoad=t.language_load,Ri.baseURL=n.baseURL,c.id=e,c.setDirty(!1),c.plugins={},c.documentBaseURI=new jx(t.document_base_url,{base_uri:d}),c.baseURI=d,c.contentCSS=[],c.contentStyles=[],c.shortcuts=new Lx(c),c.loadedCSS={},c.editorCommands=new xx(c),c.suffix=n.suffix,c.editorManager=n,c.inline=t.inline,c.buttons={},c.menuItems={},t.cache_suffix&&(he.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(he.overrideViewPort=!1);var h,m,g,p,v,b,y,C,w=(m={},g={},p={},v={},b={},y={},{addButton:(C=function(n,r){return function(e,t){return n[e.toLowerCase()]=Ll({type:r},t)}})(h={},"button"),addToggleButton:C(h,"togglebutton"),addMenuButton:C(h,"menubutton"),addSplitButton:C(h,"splitbutton"),addMenuItem:C(m,"menuitem"),addNestedMenuItem:C(m,"nestedmenuitem"),addToggleMenuItem:C(m,"togglemenuitem"),addAutocompleter:C(g,"autocompleter"),addContextMenu:C(v,"contextmenu"),addContextToolbar:C(b,"contexttoolbar"),addContextForm:C(b,"contextform"),addSidebar:C(y,"sidebar"),addIcon:function(e,t){return p[e.toLowerCase()]=t},getAll:function(){return{buttons:h,menuItems:m,icons:p,popups:g,contextMenus:v,contextToolbars:b,sidebars:y}}});c.ui={registry:w},n.fire("SetupEditor",{editor:c}),c.execCallback("setup",c),c.$=pn.overrideDefaults(function(){return{context:c.inline?c.getBody():c.getDoc(),element:c.getBody()}})};$x(Yx.prototype={render:function(){Iw(this)},focus:function(e){rf(this,e)},hasFocus:function(){return of(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Kx(r):0,o=Kx(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){return Ti.translate(e)},getParam:function(e,t,n){return Df(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},addSidebar:function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},addMenuItem:function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},addContextToolbar:function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(qx.show(this.getContainer()),qx.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Xx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(qx.hide(e.getContainer()),qx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=qx.getParent(r.id,"form"))&&Wx(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return sf(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),T.from(t.getBody()).fold($("tree"===n.format?new Ul("body",11):""),function(e){return zc(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=$x({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==qw(t=this)&&(t.initialized?jw(t,"readonly"===n):t.on("init",function(){jw(t,"readonly"===n)}),hf(t,n))},getContainer:function(){return this.container||(this.container=qx.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=qx.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Wx(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){bf(this)},destroy:function(e){yf(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Bx);var Gx,Jx,Qx,Zx={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("tox-")||-1!==e.className.toString().indexOf("mce-")}},eN=function(n,e){var t,r;nr.detect().browser.isIE()?(r=n).on("focusout",function(){Xc(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Xc(n)})},tN=function(e){var t,n,r,o=Vi(function(){Xc(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},bi.DOM.bind(j.document,"mouseup",r),t.on("remove",function(){bi.DOM.unbind(j.document,"mouseup",r)})),e.on("init",function(){eN(e,o)}),e.on("remove",function(){o.cancel()})},nN=bi.DOM,rN=function(e){return Zx.isEditorUIElement(e)},oN=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==nN.getParent(e,function(e){return rN(e)||!!n&&t.dom.is(e,n)})},iN=function(r,e){var t=e.editor;tN(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;be.setEditorTimeout(t,function(){var e=r.focusedEditor;oN(t,function(){try{return j.document.activeElement}catch(e){return j.document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Gx||(Gx=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===j.document&&(t===j.document.body||oN(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},nN.bind(j.document,"focusin",Gx))},aN=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(nN.unbind(j.document,"focusin",Gx),Gx=null)},uN=function(e){e.on("AddEditor",d(iN,e)),e.on("RemoveEditor",d(aN,e))},sN=bi.DOM,lN=Gt.explode,cN=Gt.each,fN=Gt.extend,dN=0,hN=!1,mN=[],gN=[],pN=function(t){var n=t.type;cN(Qx.get(),function(e){switch(n){case"scroll":e.fire("ScrollWindow",t);break;case"resize":e.fire("ResizeWindow",t)}})},vN=function(e){e!==hN&&(e?pn(window).on("resize scroll",pN):pn(window).off("resize scroll",pN),hN=e)},bN=function(t){var e=gN;delete mN[t.id];for(var n=0;n<mN.length;n++)if(mN[n]===t){mN.splice(n,1);break}return gN=V(gN,function(e){return t!==e}),Qx.activeEditor===t&&(Qx.activeEditor=0<gN.length?gN[0]:null),Qx.focusedEditor===t&&(Qx.focusedEditor=null),e.length!==gN.length};fN(Qx={defaultSettings:{},$:pn,majorVersion:"5",minorVersion:"0.2",releaseDate:"2019-03-05",editors:mN,i18n:Ti,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=jx.getDocumentBaseUrl(j.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=j.document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&j.document.currentScript&&(-1!==(r=j.document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new jx(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new jx(this.baseURL),this.suffix=o,uN(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new jx(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new jx(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Ri.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Gt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");var l=function(e){var t=e.id;return t||(t=(t=e.name)&&!sN.get(t)?e.name:sN.uniqueId(),e.setAttribute("id",t)),t},c=function(e,t){return t.constructor===RegExp?t.test(e.className):sN.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Yx(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};sN.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=pn.unique(function(t){var e,n=[];if(he.ie&&he.ie<11)return Xf.initError("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(t.types)return cN(t.types,function(e){n=n.concat(sN.select(e.selector))}),n;if(t.selector)return sN.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&cN(lN(e),function(t){var e;(e=sN.get(t))?n.push(e):cN(j.document.forms,function(e){cN(e.elements,function(e){e.name===t&&(t="mce_editor_"+dN++,sN.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":cN(sN.select("textarea"),function(e){t.editor_deselector&&c(e,t.editor_deselector)||t.editor_selector&&!c(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?cN(r.types,function(t){Gt.each(o,function(e){return!sN.is(e,t.selector)||(n(l(e),fN({},r,t),e),!1)})}):(Gt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(bN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Gt.grep(o,function(e){return!s.get(e.id)})).length?f([]):cN(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?Xf.initError("Could not initialize inline editor on invalid inline target element",e):n(l(e),r,e)}))};return s.settings=r,sN.bind(window,"ready",e),new me(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?gN.slice(0):A(t)?F(gN,function(e){return e.id===t}).getOr(null):_(t)&&gN[t]?gN[t]:null},add:function(e){var t=this;return mN[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(mN[e.id]=e),mN.push(e),gN.push(e)),vN(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Jx||(Jx=function(){t.fire("BeforeUnload")},sN.bind(window,"beforeunload",Jx))),e},createEditor:function(e,t){return this.add(new Yx(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!A(e))return n=e,M(r.get(n.id))?null:(bN(n)&&r.fire("RemoveEditor",{editor:n}),0===gN.length&&sN.unbind(window,"beforeunload",Jx),n.remove(),vN(0<gN.length),n);cN(sN.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=gN.length-1;0<=t;t--)r.remove(gN[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Yx(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){cN(gN,function(e){e.save()})},addI18n:function(e,t){Ti.add(e,t)},translate:function(e){return Ti.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},kx),Qx.setup();var yN,CN=Qx;function wN(n){return{walk:function(e,t){return Tl(n,e,t)},split:um,normalize:function(t){return Xp(n,t).fold($(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(yN=wN||(wN={})).compareRanges=xd,yN.getCaretRangeFromPoint=hp,yN.getSelectedNode=Xa,yN.getNode=Ya;var xN,NN,EN=wN,zN=Math.min,SN=Math.max,kN=Math.round,TN=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=kN(s/2)),"c"===n[1]&&(r+=kN(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=kN(a/2)),"c"===n[4]&&(r-=kN(i/2)),AN(r,o,i,a)},AN=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},RN={inflate:function(e,t,n){return AN(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:TN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=TN(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=SN(e.x,t.x),r=SN(e.y,t.y),o=zN(e.x+e.w,t.x+t.w),i=zN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:AN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,l,c,f,d;return u=e.x,s=e.y,l=e.x+e.w,c=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=SN(0,t.x-u),o=SN(0,t.y-s),i=SN(0,l-f),a=SN(0,c-d),u+=r,s+=o,n&&(l+=r,c+=o,u-=i,s-=a),AN(u,s,(l-=i)-u,(c-=a)-s)},create:AN,fromClientRect:function(e){return AN(e.left,e.top,e.width,e.height)}},DN=Gt.each,MN=Gt.extend,BN=function(){};BN.extend=xN=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!NN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in NN=!0,e=new this,NN=!1,n.Mixins&&(DN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&DN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&DN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&DN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=MN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=xN,i};var ON=Math.min,_N=Math.max,HN=Math.round,PN={serialize:function(e){var t=JSON.stringify(e);return A(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(t){}}},LN={callbacks:{},count:0,send:function(t){var n=this,r=bi.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},VN={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",VN.fire("beforeInitialize",{settings:e}),t=Qf()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Gt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=VN.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Gt.extend(VN,kx);var IN,FN,UN,jN,qN=Gt.extend,$N=function(e){this.settings=qN({},e),this.count=0};$N.sendRPC=function(e){return(new $N).send(e)},$N.prototype={send:function(n){var r=n.error,o=n.success;(n=qN(this.settings,n)).success=function(e,t){void 0===(e=PN.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=PN.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",VN.send(n)}};try{IN=j.window.localStorage}catch(GN){FN={},UN=[],jN={getItem:function(e){var t=FN[e];return t||null},setItem:function(e,t){UN.push(e),FN[e]=String(t)},key:function(e){return UN[e]},removeItem:function(t){UN=UN.filter(function(e){return e===t}),delete FN[t]},clear:function(){UN=[],FN={}},length:0},Object.defineProperty(jN,"length",{get:function(){return UN.length},configurable:!1,enumerable:!1}),IN=jN}var WN,KN=CN,XN={geom:{Rect:RN},util:{Promise:me,Delay:be,Tools:Gt,VK:ch,URI:jx,Class:BN,EventDispatcher:Ex,Observable:kx,I18n:Ti,XHR:VN,JSON:PN,JSONRequest:$N,JSONP:LN,LocalStorage:IN,Color:function(e){var n={},u=0,s=0,l=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,l=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=_N(0,ON(t,1)),n=_N(0,ON(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,l=0;break;case 1:u=i,s=o,l=0;break;case 2:u=0,s=o,l=i;break;case 3:u=0,s=i,l=o;break;case 4:u=i,s=0,l=o;break;case 5:u=o,s=0,l=i;break;default:u=s=l=0}u=HN(255*(u+a)),s=HN(255*(s+a)),l=HN(255*(l+a))}else u=s=l=HN(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),l=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),l=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),l=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,l=l<0?0:255<l?255:l,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:l}},n.toHsv=function(){return e=u,t=s,n=l,o=0,(i=ON(e/=255,ON(t/=255,n/=255)))===(a=_N(e,_N(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:HN(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:HN(100*r),v:HN(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(l)},n.parse=t,n}},dom:{EventUtils:ke,Sizzle:kt,DomQuery:pn,TreeWalker:ao,DOMUtils:bi,ScriptLoader:Ni,RangeUtils:EN,Serializer:tp,ControlSelection:sp,BookmarkManager:ip,Selection:ov,Event:ke.Event},html:{Styles:ui,Entities:Xo,Node:Ul,Schema:ii,SaxParser:Wl,DomParser:Gg,Writer:kc,Serializer:Tc},Env:he,AddOnManager:Ri,Annotator:_l,Formatter:Og,UndoManager:Kh,EditorCommands:xx,WindowManager:Ff,NotificationManager:If,EditorObservable:Bx,Shortcuts:Lx,Editor:Yx,FocusManager:Zx,EditorManager:CN,DOM:bi.DOM,ScriptLoader:Ni.ScriptLoader,PluginManager:Ri.PluginManager,ThemeManager:Ri.ThemeManager,IconManager:Yf,trim:Gt.trim,isArray:Gt.isArray,is:Gt.is,toArray:Gt.toArray,makeMap:Gt.makeMap,each:Gt.each,map:Gt.map,grep:Gt.grep,inArray:Gt.inArray,extend:Gt.extend,create:Gt.create,walk:Gt.walk,createNS:Gt.createNS,resolve:Gt.resolve,explode:Gt.explode,_addCacheSuffix:Gt._addCacheSuffix,isOpera:he.opera,isWebKit:he.webkit,isIE:he.ie,isGecko:he.gecko,isMac:he.mac},YN=KN=Gt.extend(KN,XN);WN=YN,window.tinymce=WN,window.tinyMCE=WN,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(YN)}(window);
@@ -1,7 +1,7 @@
1
1
  RSpec.describe Card::Set::Abstract::Media do
2
2
  describe "#image_with_text" do
3
3
  let(:html_format) do
4
- Card["*credit"].format_with_set(described_class, :html)
4
+ Card[:yeti_skin].format_with_set(described_class, :html)
5
5
  end
6
6
 
7
7
  def text_with_image args={}
@@ -11,21 +11,21 @@ RSpec.describe Card::Set::Abstract::Media do
11
11
  it "uses +image by default" do
12
12
  expect(text_with_image)
13
13
  .to have_tag :div, with: { class: "media" } do
14
- with_tag "img[src*='/files/']", with: { alt: "*credit+image" }
14
+ with_tag "img[src*='/files/']", with: { alt: "yeti skin+Image" }
15
15
  end
16
16
  end
17
17
 
18
18
  it "takes image card name as image" do
19
- expect(text_with_image(image: "*logo"))
19
+ expect(text_with_image(image: "yeti skin+image"))
20
20
  .to have_tag :div, with: { class: "media" } do
21
- with_tag "img[src*='/files/']", with: { alt: "*logo" }
21
+ with_tag "img[src*='/files/']", with: { alt: "yeti skin+Image" }
22
22
  end
23
23
  end
24
24
 
25
25
  it "takes image card object as image" do
26
- expect(text_with_image(image: Card["*logo"]))
26
+ expect(text_with_image(image: Card[:yeti_skin_image]))
27
27
  .to have_tag :div, with: { class: "media" } do
28
- with_tag "img[src*='/files/']", with: { alt: "*logo" }
28
+ with_tag "img[src*='/files/']", with: { alt: "yeti skin+Image" }
29
29
  end
30
30
  end
31
31
 
@@ -15,11 +15,20 @@ class Card
15
15
  validate_card card
16
16
  virtual_content ||= block_given? ? yield : card.generate_virtual_content
17
17
  virtual = new left_id: left_id(card), right_id: right_id(card),
18
+ left_key: card.name.left_key,
18
19
  content: virtual_content
19
20
  virtual.save!
20
21
  virtual
21
22
  end
22
23
 
24
+ def create_or_update card, virtual_content
25
+ if (virtual_card = find_by_card(card))
26
+ virtual_card.update virtual_content
27
+ else
28
+ create card, virtual_content
29
+ end
30
+ end
31
+
23
32
  def fetch_content card, &block
24
33
  find_content_by_card(card) || create(card, &block).content
25
34
  end
@@ -35,7 +44,7 @@ class Card
35
44
  end
36
45
 
37
46
  def find_content_by_card card
38
- where_card(card).pluck(:content).first
47
+ where_card(card)&.pluck(:content)&.first
39
48
  end
40
49
 
41
50
  def find_by_card card
@@ -45,7 +54,13 @@ class Card
45
54
  private
46
55
 
47
56
  def where_card card
48
- where left_id: left_id(card), right_id: right_id(card)
57
+ query = { right_id: right_id(card) }
58
+ if (lid = left_id(card))
59
+ query[:left_id] = lid
60
+ else
61
+ query[:left_key] = card.name.left_key
62
+ end
63
+ where query
49
64
  end
50
65
 
51
66
  def left_id card
@@ -23,7 +23,7 @@ def generate_virtual_content
23
23
  end
24
24
 
25
25
  event :save_virtual_content, :prepare_to_store, on: :save, changed: :content do
26
- Card::Virtual.fetch(self) { attributes["db_content"] }
26
+ Card::Virtual.create_or_update(self, attributes["db_content"])
27
27
  abort :success
28
28
  end
29
29
 
@@ -6,7 +6,7 @@ RSpec.describe Card::Virtual do
6
6
  let(:card) do
7
7
  double("virtual card", junction?: true,
8
8
  generate_virtual_content: virtual_content,
9
- left_id: 1, right_id: 5)
9
+ left_id: 1, right_id: 5, name: "virtual card".to_name)
10
10
  end
11
11
 
12
12
  let(:create_virtual) { described_class.create(card) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.96.8
4
+ version: 1.97.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-01-25 00:00:00.000000000 Z
14
+ date: 2019-03-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cardname
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.6.8
22
+ version: 0.7.0.pre
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.6.8
29
+ version: 0.7.0.pre
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: haml
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -338,6 +338,8 @@ files:
338
338
  - db/migrate/20170908114442_create_delayed_jobs.rb
339
339
  - db/migrate/20170908114452_increase_text_size_for_delayed_jobs.rb
340
340
  - db/migrate/20180514152037_add_card_virtuals_table.rb
341
+ - db/migrate/20190116170824_add_left_key_to_card_virtuals.rb
342
+ - db/migrate/20190131223248_add_codename_index.rb
341
343
  - db/migrate_core_cards/20120611203506_rails_inflection_updates.rb
342
344
  - db/migrate_core_cards/20130411191151_renaming_for_menu.rb
343
345
  - db/migrate_core_cards/20130411211600_delete_old_related_tab_cards.rb
@@ -401,7 +403,11 @@ files:
401
403
  - db/migrate_core_cards/20180423120222_add_mod_styles_card.rb
402
404
  - db/migrate_core_cards/20180508210903_add_json_type.rb
403
405
  - db/migrate_core_cards/20180515175726_add_codenames.rb
406
+ - db/migrate_core_cards/20180712042655_head_rule.rb
407
+ - db/migrate_core_cards/20180905061536_migrate_layouts.rb
404
408
  - db/migrate_core_cards/20181120200937_update_layout.rb
409
+ - db/migrate_core_cards/20190125125150_add_script_rules_card.rb
410
+ - db/migrate_core_cards/20190204195039_add_rule_card.rb
405
411
  - db/migrate_core_cards/data/1.11_help_text.json
406
412
  - db/migrate_core_cards/data/1.12_stylesheets/classic_cards.scss
407
413
  - db/migrate_core_cards/data/1.12_stylesheets/common.scss
@@ -413,6 +419,7 @@ files:
413
419
  - db/migrate_core_cards/data/cards.yml
414
420
  - db/migrate_core_cards/data/cards/Xheader
415
421
  - db/migrate_core_cards/data/cards/Xmain_menu
422
+ - db/migrate_core_cards/data/decko_logo.svg
416
423
  - db/migrate_core_cards/data/mailer/follower_notification_email.html
417
424
  - db/migrate_core_cards/data/mailer/follower_notification_email.txt
418
425
  - db/migrate_core_cards/data/mailer/mail_config.json
@@ -583,6 +590,7 @@ files:
583
590
  - lib/card/set.rb
584
591
  - lib/card/set/advanced_api.rb
585
592
  - lib/card/set/basket.rb
593
+ - lib/card/set/code_nest.rb
586
594
  - lib/card/set/event.rb
587
595
  - lib/card/set/event/callbacks.rb
588
596
  - lib/card/set/event/delayed_event.rb
@@ -590,11 +598,13 @@ files:
590
598
  - lib/card/set/format.rb
591
599
  - lib/card/set/format/abstract_format.rb
592
600
  - lib/card/set/format/haml_views.rb
601
+ - lib/card/set/format/wrapper.rb
593
602
  - lib/card/set/helpers.rb
594
603
  - lib/card/set/i18n_scanner.rb
595
604
  - lib/card/set/i18n_scope.rb
596
605
  - lib/card/set/inheritance.rb
597
606
  - lib/card/set/loader.rb
607
+ - lib/card/set/required_field.rb
598
608
  - lib/card/set/trait.rb
599
609
  - lib/card/set_pattern.rb
600
610
  - lib/card/subcards.rb
@@ -618,11 +628,14 @@ files:
618
628
  - lib/card/view.rb
619
629
  - lib/card/view/cache.rb
620
630
  - lib/card/view/cache_action.rb
631
+ - lib/card/view/classy.rb
632
+ - lib/card/view/layout.rb
621
633
  - lib/card/view/options.rb
622
634
  - lib/card/view/options/key_lists.rb
623
635
  - lib/card/view/options/voo_api.rb
624
636
  - lib/card/view/stub.rb
625
637
  - lib/card/view/visibility.rb
638
+ - lib/card/view/wrapper.rb
626
639
  - lib/cardio.rb
627
640
  - lib/cardio/schema.rb
628
641
  - lib/cardio/utils.rb
@@ -1291,6 +1304,7 @@ files:
1291
1304
  - mod/bootstrap/set/type/customized_bootswatch_skin/html_views.rb
1292
1305
  - mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors.rb
1293
1306
  - mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/_colorpicker.haml
1307
+ - mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/core.haml
1294
1308
  - mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/editor.haml
1295
1309
  - mod/bootstrap/spec/set/all/bootstrap/bootstrap_builder_spec.rb
1296
1310
  - mod/bootstrap/spec/set/all/bootstrap/bootstrap_spec.rb
@@ -3848,11 +3862,9 @@ files:
3848
3862
  - mod/core/format/text_format.rb
3849
3863
  - mod/core/layout/blank.html
3850
3864
  - mod/core/layout/default.html
3851
- - mod/core/layout/modal.html
3852
3865
  - mod/core/layout/noside.html
3853
3866
  - mod/core/layout/pre.html
3854
3867
  - mod/core/layout/simple.html
3855
- - mod/core/layout/simple_modal.html
3856
3868
  - mod/core/set/abstract/code_file.rb
3857
3869
  - mod/core/set/abstract/haml_file.rb
3858
3870
  - mod/core/set/abstract/lock.rb
@@ -3878,6 +3890,7 @@ files:
3878
3890
  - mod/core/set/all/i18n.rb
3879
3891
  - mod/core/set/all/initialize.rb
3880
3892
  - mod/core/set/all/item.rb
3893
+ - mod/core/set/all/layouts.rb
3881
3894
  - mod/core/set/all/location_history.rb
3882
3895
  - mod/core/set/all/name.rb
3883
3896
  - mod/core/set/all/name_events.rb
@@ -3904,7 +3917,8 @@ files:
3904
3917
  - mod/core/set_pattern/05_rstar.rb
3905
3918
  - mod/core/set_pattern/06_right.rb
3906
3919
  - mod/core/set_pattern/07_type_plus_right.rb
3907
- - mod/core/set_pattern/08_self.rb
3920
+ - mod/core/set_pattern/08_rule.rb
3921
+ - mod/core/set_pattern/09_self.rb
3908
3922
  - mod/core/spec/chunk/literal_spec.rb
3909
3923
  - mod/core/spec/chunk/uri_spec.rb
3910
3924
  - mod/core/spec/format/data_format_spec.rb
@@ -4645,6 +4659,28 @@ files:
4645
4659
  - mod/developer/spec/set/all/event_viz_spec.rb
4646
4660
  - mod/developer/spec/set/all/view_viz_spec.rb
4647
4661
  - mod/developer/spec/set/right/debug_spec.rb
4662
+ - mod/edit/set/all/bridge.rb
4663
+ - mod/edit/set/all/bridge/bridge.haml
4664
+ - mod/edit/set/all/bridge/follow_section.rb
4665
+ - mod/edit/set/all/bridge/tab_views.rb
4666
+ - mod/edit/set/all/bridge/tab_visibility.rb
4667
+ - mod/edit/set/all/edit_content.rb
4668
+ - mod/edit/set/all/edit_in_place.rb
4669
+ - mod/edit/set/all/edit_name.rb
4670
+ - mod/edit/set/all/edit_type.rb
4671
+ - mod/edit/set/all/editing.rb
4672
+ - mod/edit/set/all/editor.rb
4673
+ - mod/edit/set/all/form.rb
4674
+ - mod/edit/set/all/form_buttons.rb
4675
+ - mod/edit/set/all/form_elements.rb
4676
+ - mod/edit/set/all/formgroup.rb
4677
+ - mod/edit/set/all/new.rb
4678
+ - mod/edit/set/all/toolbar.rb
4679
+ - mod/edit/spec/set/all/bridge/tab_views_spec.rb
4680
+ - mod/edit/spec/set/all/bridge_spec.rb
4681
+ - mod/edit/spec/set/all/editing_spec.rb
4682
+ - mod/edit/spec/set/all/form_elements_spec.rb
4683
+ - mod/edit/spec/set/all/form_spec.rb
4648
4684
  - mod/email/README
4649
4685
  - mod/email/format/email_html_format.rb
4650
4686
  - mod/email/format/email_text_format.rb
@@ -4667,8 +4703,11 @@ files:
4667
4703
  - mod/follow/set/abstract/follow_option.rb
4668
4704
  - mod/follow/set/all/follow.rb
4669
4705
  - mod/follow/set/all/follow/follow_link.rb
4706
+ - mod/follow/set/all/follow/follow_link_views.rb
4670
4707
  - mod/follow/set/all/follow/followed_by.rb
4671
4708
  - mod/follow/set/all/follow/follower_ids.rb
4709
+ - mod/follow/set/all/follow/start_follow_link.rb
4710
+ - mod/follow/set/all/follow/stop_follow_link.rb
4672
4711
  - mod/follow/set/all/notify.rb
4673
4712
  - mod/follow/set/all/notify/base_views.rb
4674
4713
  - mod/follow/set/all/notify/html_views.rb
@@ -4690,7 +4729,9 @@ files:
4690
4729
  - mod/follow/set/type_plus_right/user/follow.rb
4691
4730
  - mod/follow/set/type_plus_right/user/follow/follow_editor.haml
4692
4731
  - mod/follow/set/type_plus_right/user/follow/follow_editor_helper.rb
4693
- - mod/follow/spec/set/all/follow/follow_link_spec.rb
4732
+ - mod/follow/spec/set/all/follow/follow_link_views_spec.rb
4733
+ - mod/follow/spec/set/all/follow/start_follow_link_spec.rb
4734
+ - mod/follow/spec/set/all/follow/stop_follow_link_spec.rb
4694
4735
  - mod/follow/spec/set/all/follow_spec.rb
4695
4736
  - mod/follow/spec/set/all/notify/html_views_spec.rb
4696
4737
  - mod/follow/spec/set/all/notify_email.txt
@@ -4705,6 +4746,7 @@ files:
4705
4746
  - mod/history/lib/card/act.rb
4706
4747
  - mod/history/lib/card/act/act_renderer.rb
4707
4748
  - mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb
4749
+ - mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb
4708
4750
  - mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
4709
4751
  - mod/history/lib/card/action.rb
4710
4752
  - mod/history/lib/card/action/action_renderer.rb
@@ -4720,6 +4762,7 @@ files:
4720
4762
  - mod/history/set/all/history/revision.rb
4721
4763
  - mod/history/set/all/history/selected.rb
4722
4764
  - mod/history/set/all/history/views.rb
4765
+ - mod/history/set/all/history_bridge.rb
4723
4766
  - mod/history/spec/set/all/history/views_spec.rb
4724
4767
  - mod/item/set/all/bar.haml
4725
4768
  - mod/item/set/all/bar.rb
@@ -4732,11 +4775,15 @@ files:
4732
4775
  - mod/machines/file/script_html5shiv_printshiv_machine_output/file.js
4733
4776
  - mod/machines/lib/card/machine.rb
4734
4777
  - mod/machines/lib/javascript/decko.js.coffee
4778
+ - mod/machines/lib/javascript/decko_bridge.js.coffee
4779
+ - mod/machines/lib/javascript/decko_components.js.coffee
4735
4780
  - mod/machines/lib/javascript/decko_editor.js.coffee
4736
4781
  - mod/machines/lib/javascript/decko_filter.js.coffee
4737
4782
  - mod/machines/lib/javascript/decko_layout.js.coffee
4738
4783
  - mod/machines/lib/javascript/decko_mod.js.coffee
4784
+ - mod/machines/lib/javascript/decko_modal.js.coffee
4739
4785
  - mod/machines/lib/javascript/decko_navbox.js.coffee
4786
+ - mod/machines/lib/javascript/decko_overlay.js.coffee
4740
4787
  - mod/machines/lib/javascript/decko_recaptcha.js.coffee
4741
4788
  - mod/machines/lib/javascript/decko_slot.js.coffee
4742
4789
  - mod/machines/lib/javascript/decko_slotter.js.coffee
@@ -4918,6 +4965,32 @@ files:
4918
4965
  - mod/prosemirror_editor/set/self/script_prosemirror_config.rb
4919
4966
  - mod/prosemirror_editor/set/self/style_prosemirror.rb
4920
4967
  - mod/recaptcha/set/all/recaptcha.rb
4968
+ - mod/rules/lib/javascript/script_rules.js.coffee
4969
+ - mod/rules/set/rstar/rule_user.rb
4970
+ - mod/rules/set/rule/bridge_rules_editor.rb
4971
+ - mod/rules/set/rule/editor.rb
4972
+ - mod/rules/set/rule/rule_form.rb
4973
+ - mod/rules/set/rule/rule_form/buttons.rb
4974
+ - mod/rules/set/rule/rule_form/form_elements.rb
4975
+ - mod/rules/set/rule/rule_form/rule_form.haml
4976
+ - mod/rules/set/rule/rule_form/rule_set_radio.rb
4977
+ - mod/rules/set/rule/rule_form/set_selection.rb
4978
+ - mod/rules/set/rule/rules.rb
4979
+ - mod/rules/set/rule/table.rb
4980
+ - mod/rules/set/rule/table_row.rb
4981
+ - mod/rules/set/self/script_rules.rb
4982
+ - mod/rules/set/type/set.rb
4983
+ - mod/rules/set/type/set/html_views.rb
4984
+ - mod/rules/set/type/set/html_views/group_panel.haml
4985
+ - mod/rules/set/type/set/html_views/rules_bridge.rb
4986
+ - mod/rules/set/type/set/html_views/rules_table.haml
4987
+ - mod/rules/set/type/set/html_views/template.rb
4988
+ - mod/rules/set/type/set/html_views/template/template_editor.haml
4989
+ - mod/rules/spec/set/rule/editor_spec.rb
4990
+ - mod/rules/spec/set/rule/table_row_spec.rb
4991
+ - mod/rules/spec/set/rule/table_spec.rb
4992
+ - mod/rules/spec/set/type/set/html_views_spec.rb
4993
+ - mod/rules/spec/set/type/set_spec.rb
4921
4994
  - mod/search/lib/card/filter_query.rb
4922
4995
  - mod/search/set/abstract/00_filter_helper.rb
4923
4996
  - mod/search/set/abstract/01_filter_form_helper.rb
@@ -4965,6 +5038,7 @@ files:
4965
5038
  - mod/settings/set/self/default_html_view.rb
4966
5039
  - mod/settings/set/self/delete.rb
4967
5040
  - mod/settings/set/self/follow_fields.rb
5041
+ - mod/settings/set/self/head.rb
4968
5042
  - mod/settings/set/self/help.rb
4969
5043
  - mod/settings/set/self/input.rb
4970
5044
  - mod/settings/set/self/layout.rb
@@ -5009,52 +5083,49 @@ files:
5009
5083
  - mod/standard/file/favicon/image-medium.png
5010
5084
  - mod/standard/file/favicon/image-original.png
5011
5085
  - mod/standard/file/favicon/image-small.png
5012
- - mod/standard/file/logo/image-icon.png
5013
- - mod/standard/file/logo/image-large.png
5014
- - mod/standard/file/logo/image-medium.png
5015
- - mod/standard/file/logo/image-original.png
5016
- - mod/standard/file/logo/image-small.png
5017
- - mod/standard/set/abstract/toolbar_split_button.rb
5086
+ - mod/standard/file/logo/image-original.svg
5087
+ - mod/standard/lib/card/layout.rb
5088
+ - mod/standard/lib/card/layout/card_layout.rb
5089
+ - mod/standard/lib/card/layout/code_layout.rb
5090
+ - mod/standard/lib/card/layout/proc_layout.rb
5091
+ - mod/standard/lib/card/layout/unknown_layout.rb
5018
5092
  - mod/standard/set/all/comment.rb
5019
5093
  - mod/standard/set/all/error.rb
5020
5094
  - mod/standard/set/all/links.rb
5021
5095
  - mod/standard/set/all/list_changes.rb
5022
5096
  - mod/standard/set/all/path.rb
5023
- - mod/standard/set/all/rich_html/classy.rb
5097
+ - mod/standard/set/all/rich_html.rb
5098
+ - mod/standard/set/all/rich_html/alert.rb
5024
5099
  - mod/standard/set/all/rich_html/content.rb
5025
5100
  - mod/standard/set/all/rich_html/content/labeled.haml
5026
- - mod/standard/set/all/rich_html/editing.rb
5027
- - mod/standard/set/all/rich_html/editor.rb
5028
5101
  - mod/standard/set/all/rich_html/error.rb
5102
+ - mod/standard/set/all/rich_html/error/debug_server_error.haml
5029
5103
  - mod/standard/set/all/rich_html/error/not_found.haml
5030
5104
  - mod/standard/set/all/rich_html/error/server_error.haml
5031
- - mod/standard/set/all/rich_html/form.rb
5032
- - mod/standard/set/all/rich_html/form_elements.rb
5033
- - mod/standard/set/all/rich_html/formgroup.rb
5034
5105
  - mod/standard/set/all/rich_html/frame.rb
5035
5106
  - mod/standard/set/all/rich_html/header.rb
5036
5107
  - mod/standard/set/all/rich_html/header/header_wrap.haml
5108
+ - mod/standard/set/all/rich_html/html_views/help.rb
5109
+ - mod/standard/set/all/rich_html/html_views/info.rb
5110
+ - mod/standard/set/all/rich_html/html_views/size.rb
5037
5111
  - mod/standard/set/all/rich_html/menu.rb
5038
5112
  - mod/standard/set/all/rich_html/modal.rb
5039
- - mod/standard/set/all/rich_html/new.rb
5113
+ - mod/standard/set/all/rich_html/modal/modal_dialog.haml
5040
5114
  - mod/standard/set/all/rich_html/overlay.rb
5041
5115
  - mod/standard/set/all/rich_html/overlay/overlay_header.haml
5042
- - mod/standard/set/all/rich_html/related.rb
5116
+ - mod/standard/set/all/rich_html/process_layout.rb
5117
+ - mod/standard/set/all/rich_html/show.rb
5043
5118
  - mod/standard/set/all/rich_html/title.rb
5044
- - mod/standard/set/all/rich_html/toolbar.rb
5045
5119
  - mod/standard/set/all/rich_html/wrapper.rb
5046
5120
  - mod/standard/set/right/discussion.rb
5121
+ - mod/standard/set/right/head.rb
5047
5122
  - mod/standard/set/right/when_created.rb
5048
5123
  - mod/standard/set/right/when_last_edited.rb
5049
- - mod/standard/set/rstar/rules.rb
5050
- - mod/standard/set/rstar/rules_editor.rb
5051
- - mod/standard/set/self/activity_toolbar_button.rb
5052
5124
  - mod/standard/set/self/alerts.rb
5053
5125
  - mod/standard/set/self/codenames.rb
5054
5126
  - mod/standard/set/self/foot.rb
5055
5127
  - mod/standard/set/self/home.rb
5056
5128
  - mod/standard/set/self/now.rb
5057
- - mod/standard/set/self/rules_toolbar_button.rb
5058
5129
  - mod/standard/set/type/basic.rb
5059
5130
  - mod/standard/set/type/cardtype.rb
5060
5131
  - mod/standard/set/type/layout_type.rb
@@ -5064,12 +5135,6 @@ files:
5064
5135
  - mod/standard/set/type/number.rb
5065
5136
  - mod/standard/set/type/phrase.rb
5066
5137
  - mod/standard/set/type/session.rb
5067
- - mod/standard/set/type/set.rb
5068
- - mod/standard/set/type/set/html_views.rb
5069
- - mod/standard/set/type/set/html_views/group_panel.haml
5070
- - mod/standard/set/type/set/html_views/rules_table.haml
5071
- - mod/standard/set/type/set/html_views/template.rb
5072
- - mod/standard/set/type/set/html_views/template/template_editor.haml
5073
5138
  - mod/standard/set/type/toggle.rb
5074
5139
  - mod/standard/set/type/uri.rb
5075
5140
  - mod/standard/spec/content/chunk/include_spec.rb
@@ -5084,19 +5149,18 @@ files:
5084
5149
  - mod/standard/spec/format/rss_format_spec.rb
5085
5150
  - mod/standard/spec/format/xml_format_spec.rb
5086
5151
  - mod/standard/spec/set/all/comment_spec.rb
5152
+ - mod/standard/spec/set/all/email_html_format_spec.rb
5087
5153
  - mod/standard/spec/set/all/error_spec.rb
5088
5154
  - mod/standard/spec/set/all/history_spec.rb
5089
5155
  - mod/standard/spec/set/all/links_spec.rb
5090
5156
  - mod/standard/spec/set/all/path_spec.rb
5091
- - mod/standard/spec/set/all/rich_html/editing_spec.rb
5092
- - mod/standard/spec/set/all/rich_html/form_elements_spec.rb
5093
- - mod/standard/spec/set/all/rich_html/form_spec.rb
5094
- - mod/standard/spec/set/all/rich_html/toolbar_spec.rb
5157
+ - mod/standard/spec/set/all/rich_html/overlay_spec.rb
5158
+ - mod/standard/spec/set/all/rich_html/process_layout/explicit_modal_wrapper_spec.rb
5159
+ - mod/standard/spec/set/all/rich_html/process_layout_spec.rb
5160
+ - mod/standard/spec/set/all/rich_html/show_spec.rb
5095
5161
  - mod/standard/spec/set/all/rich_html/wrapper_spec.rb
5096
5162
  - mod/standard/spec/set/right/when_created_spec.rb
5097
5163
  - mod/standard/spec/set/right/when_last_edited_spec.rb
5098
- - mod/standard/spec/set/rstar/rules_spec.rb
5099
- - mod/standard/spec/set/self/activity_toolbar_button_spec.rb
5100
5164
  - mod/standard/spec/set/self/alerts_spec.rb
5101
5165
  - mod/standard/spec/set/self/foot_spec.rb
5102
5166
  - mod/standard/spec/set/self/head_spec.rb
@@ -5112,12 +5176,11 @@ files:
5112
5176
  - mod/standard/spec/set/type/number_spec.rb
5113
5177
  - mod/standard/spec/set/type/phrase_spec.rb
5114
5178
  - mod/standard/spec/set/type/search_type_spec.rb
5115
- - mod/standard/spec/set/type/set/html_views_spec.rb
5116
- - mod/standard/spec/set/type/set_spec.rb
5117
5179
  - mod/standard/spec/set/type/toggle_spec.rb
5118
5180
  - mod/standard/spec/set/type/uri_spec.rb
5119
5181
  - mod/tinymce_editor/db/migrate_core_cards/20160804112560_add_tinymce_cards.rb
5120
5182
  - mod/tinymce_editor/db/migrate_core_cards/20171113233151_update_tinymce_config.rb
5183
+ - mod/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb
5121
5184
  - mod/tinymce_editor/lib/javascript/script_tinymce.js
5122
5185
  - mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee
5123
5186
  - mod/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js
@@ -5152,6 +5215,8 @@ files:
5152
5215
  - mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/img/smiley-undecided.gif
5153
5216
  - mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/img/smiley-wink.gif
5154
5217
  - mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/img/smiley-yell.gif
5218
+ - mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js
5219
+ - mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js
5155
5220
  - mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js
5156
5221
  - mod/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js
5157
5222
  - mod/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js
@@ -5172,6 +5237,7 @@ files:
5172
5237
  - mod/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js
5173
5238
  - mod/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js
5174
5239
  - mod/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js
5240
+ - mod/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js
5175
5241
  - mod/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js
5176
5242
  - mod/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js
5177
5243
  - mod/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js
@@ -5185,6 +5251,9 @@ files:
5185
5251
  - mod/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js
5186
5252
  - mod/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js
5187
5253
  - mod/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js
5254
+ - mod/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css
5255
+ - mod/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css
5256
+ - mod/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css
5188
5257
  - mod/tinymce_editor/public/assets/tinymce/skins/lightgray/content.inline.min.css
5189
5258
  - mod/tinymce_editor/public/assets/tinymce/skins/lightgray/content.min.css
5190
5259
  - mod/tinymce_editor/public/assets/tinymce/skins/lightgray/content.mobile.min.css
@@ -5204,9 +5273,19 @@ files:
5204
5273
  - mod/tinymce_editor/public/assets/tinymce/skins/lightgray/skin.min.css
5205
5274
  - mod/tinymce_editor/public/assets/tinymce/skins/lightgray/skin.min.css.map
5206
5275
  - mod/tinymce_editor/public/assets/tinymce/skins/lightgray/skin.mobile.min.css
5276
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css
5277
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css
5278
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css
5279
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css
5280
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css
5281
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css
5282
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff
5283
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css
5284
+ - mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css
5207
5285
  - mod/tinymce_editor/public/assets/tinymce/themes/inlite/theme.min.js
5208
5286
  - mod/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js
5209
5287
  - mod/tinymce_editor/public/assets/tinymce/themes/modern/theme.min.js
5288
+ - mod/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js
5210
5289
  - mod/tinymce_editor/public/assets/tinymce/tinymce.min.js
5211
5290
  - mod/tinymce_editor/set/abstract/tinymce_editor.rb
5212
5291
  - mod/tinymce_editor/set/self/script_tinymce.rb
@@ -5463,7 +5542,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
5463
5542
  requirements:
5464
5543
  - - ">="
5465
5544
  - !ruby/object:Gem::Version
5466
- version: '2.3'
5545
+ version: 2.4.1
5467
5546
  required_rubygems_version: !ruby/object:Gem::Requirement
5468
5547
  requirements:
5469
5548
  - - ">="