bedrock_sass 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (534) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -5
  3. data/assets/_vendor/ace/ace.js +21635 -0
  4. data/assets/_vendor/ace/ext-beautify.js +318 -0
  5. data/assets/_vendor/ace/ext-elastic_tabstops_lite.js +277 -0
  6. data/assets/_vendor/ace/ext-emmet.js +1226 -0
  7. data/assets/_vendor/ace/ext-error_marker.js +10 -0
  8. data/assets/_vendor/ace/ext-keybinding_menu.js +189 -0
  9. data/assets/_vendor/ace/ext-language_tools.js +1997 -0
  10. data/assets/_vendor/ace/ext-linking.js +65 -0
  11. data/assets/_vendor/ace/ext-modelist.js +228 -0
  12. data/assets/_vendor/ace/ext-options.js +750 -0
  13. data/assets/_vendor/ace/ext-rtl.js +110 -0
  14. data/assets/_vendor/ace/ext-searchbox.js +512 -0
  15. data/assets/_vendor/ace/ext-settings_menu.js +771 -0
  16. data/assets/_vendor/ace/ext-spellcheck.js +75 -0
  17. data/assets/_vendor/ace/ext-split.js +208 -0
  18. data/assets/_vendor/ace/ext-static_highlight.js +226 -0
  19. data/assets/_vendor/ace/ext-statusbar.js +57 -0
  20. data/assets/_vendor/ace/ext-textarea.js +567 -0
  21. data/assets/_vendor/ace/ext-themelist.js +67 -0
  22. data/assets/_vendor/ace/ext-whitespace.js +210 -0
  23. data/assets/_vendor/ace/keybinding-emacs.js +1165 -0
  24. data/assets/_vendor/ace/keybinding-vim.js +5673 -0
  25. data/assets/_vendor/ace/mode-abap.js +222 -0
  26. data/assets/_vendor/ace/mode-abc.js +267 -0
  27. data/assets/_vendor/ace/mode-actionscript.js +274 -0
  28. data/assets/_vendor/ace/mode-ada.js +138 -0
  29. data/assets/_vendor/ace/mode-apache_conf.js +363 -0
  30. data/assets/_vendor/ace/mode-applescript.js +279 -0
  31. data/assets/_vendor/ace/mode-asciidoc.js +349 -0
  32. data/assets/_vendor/ace/mode-asl.js +422 -0
  33. data/assets/_vendor/ace/mode-assembly_x86.js +193 -0
  34. data/assets/_vendor/ace/mode-autohotkey.js +243 -0
  35. data/assets/_vendor/ace/mode-batchfile.js +230 -0
  36. data/assets/_vendor/ace/mode-bro.js +334 -0
  37. data/assets/_vendor/ace/mode-c9search.js +294 -0
  38. data/assets/_vendor/ace/mode-c_cpp.js +502 -0
  39. data/assets/_vendor/ace/mode-cirru.js +211 -0
  40. data/assets/_vendor/ace/mode-clojure.js +314 -0
  41. data/assets/_vendor/ace/mode-cobol.js +102 -0
  42. data/assets/_vendor/ace/mode-coffee.js +400 -0
  43. data/assets/_vendor/ace/mode-coldfusion.js +2596 -0
  44. data/assets/_vendor/ace/mode-csharp.js +502 -0
  45. data/assets/_vendor/ace/mode-csound_document.js +3749 -0
  46. data/assets/_vendor/ace/mode-csound_orchestra.js +2687 -0
  47. data/assets/_vendor/ace/mode-csound_score.js +454 -0
  48. data/assets/_vendor/ace/mode-csp.js +60 -0
  49. data/assets/_vendor/ace/mode-css.js +723 -0
  50. data/assets/_vendor/ace/mode-curly.js +2564 -0
  51. data/assets/_vendor/ace/mode-d.js +520 -0
  52. data/assets/_vendor/ace/mode-dart.js +703 -0
  53. data/assets/_vendor/ace/mode-diff.js +146 -0
  54. data/assets/_vendor/ace/mode-django.js +2594 -0
  55. data/assets/_vendor/ace/mode-dockerfile.js +498 -0
  56. data/assets/_vendor/ace/mode-dot.js +418 -0
  57. data/assets/_vendor/ace/mode-drools.js +496 -0
  58. data/assets/_vendor/ace/mode-edifact.js +165 -0
  59. data/assets/_vendor/ace/mode-eiffel.js +136 -0
  60. data/assets/_vendor/ace/mode-ejs.js +3026 -0
  61. data/assets/_vendor/ace/mode-elixir.js +501 -0
  62. data/assets/_vendor/ace/mode-elm.js +307 -0
  63. data/assets/_vendor/ace/mode-erlang.js +1009 -0
  64. data/assets/_vendor/ace/mode-forth.js +297 -0
  65. data/assets/_vendor/ace/mode-fortran.js +431 -0
  66. data/assets/_vendor/ace/mode-fsharp.js +314 -0
  67. data/assets/_vendor/ace/mode-ftl.js +1192 -0
  68. data/assets/_vendor/ace/mode-gcode.js +94 -0
  69. data/assets/_vendor/ace/mode-gherkin.js +172 -0
  70. data/assets/_vendor/ace/mode-gitignore.js +60 -0
  71. data/assets/_vendor/ace/mode-glsl.js +579 -0
  72. data/assets/_vendor/ace/mode-gobstones.js +929 -0
  73. data/assets/_vendor/ace/mode-golang.js +414 -0
  74. data/assets/_vendor/ace/mode-graphqlschema.js +214 -0
  75. data/assets/_vendor/ace/mode-groovy.js +986 -0
  76. data/assets/_vendor/ace/mode-haml.js +1555 -0
  77. data/assets/_vendor/ace/mode-handlebars.js +2622 -0
  78. data/assets/_vendor/ace/mode-haskell.js +379 -0
  79. data/assets/_vendor/ace/mode-haskell_cabal.js +142 -0
  80. data/assets/_vendor/ace/mode-haxe.js +386 -0
  81. data/assets/_vendor/ace/mode-hjson.js +353 -0
  82. data/assets/_vendor/ace/mode-html.js +2509 -0
  83. data/assets/_vendor/ace/mode-html_elixir.js +3087 -0
  84. data/assets/_vendor/ace/mode-html_ruby.js +3043 -0
  85. data/assets/_vendor/ace/mode-ini.js +163 -0
  86. data/assets/_vendor/ace/mode-io.js +253 -0
  87. data/assets/_vendor/ace/mode-jack.js +347 -0
  88. data/assets/_vendor/ace/mode-jade.js +2126 -0
  89. data/assets/_vendor/ace/mode-java.js +975 -0
  90. data/assets/_vendor/ace/mode-javascript.js +797 -0
  91. data/assets/_vendor/ace/mode-json.js +327 -0
  92. data/assets/_vendor/ace/mode-jsoniq.js +4940 -0
  93. data/assets/_vendor/ace/mode-jsp.js +1430 -0
  94. data/assets/_vendor/ace/mode-jssm.js +325 -0
  95. data/assets/_vendor/ace/mode-jsx.js +412 -0
  96. data/assets/_vendor/ace/mode-julia.js +303 -0
  97. data/assets/_vendor/ace/mode-kotlin.js +795 -0
  98. data/assets/_vendor/ace/mode-latex.js +297 -0
  99. data/assets/_vendor/ace/mode-less.js +841 -0
  100. data/assets/_vendor/ace/mode-liquid.js +1193 -0
  101. data/assets/_vendor/ace/mode-lisp.js +112 -0
  102. data/assets/_vendor/ace/mode-livescript.js +280 -0
  103. data/assets/_vendor/ace/mode-logiql.js +317 -0
  104. data/assets/_vendor/ace/mode-lsl.js +343 -0
  105. data/assets/_vendor/ace/mode-lua.js +432 -0
  106. data/assets/_vendor/ace/mode-luapage.js +3007 -0
  107. data/assets/_vendor/ace/mode-lucene.js +87 -0
  108. data/assets/_vendor/ace/mode-makefile.js +410 -0
  109. data/assets/_vendor/ace/mode-markdown.js +3189 -0
  110. data/assets/_vendor/ace/mode-mask.js +1802 -0
  111. data/assets/_vendor/ace/mode-matlab.js +264 -0
  112. data/assets/_vendor/ace/mode-maze.js +291 -0
  113. data/assets/_vendor/ace/mode-mel.js +263 -0
  114. data/assets/_vendor/ace/mode-mixal.js +123 -0
  115. data/assets/_vendor/ace/mode-mushcode.js +681 -0
  116. data/assets/_vendor/ace/mode-mysql.js +168 -0
  117. data/assets/_vendor/ace/mode-nix.js +646 -0
  118. data/assets/_vendor/ace/mode-nsis.js +312 -0
  119. data/assets/_vendor/ace/mode-objectivec.js +739 -0
  120. data/assets/_vendor/ace/mode-ocaml.js +422 -0
  121. data/assets/_vendor/ace/mode-pascal.js +205 -0
  122. data/assets/_vendor/ace/mode-perl.js +380 -0
  123. data/assets/_vendor/ace/mode-pgsql.js +1508 -0
  124. data/assets/_vendor/ace/mode-php.js +13088 -0
  125. data/assets/_vendor/ace/mode-php_laravel_blade.js +13289 -0
  126. data/assets/_vendor/ace/mode-pig.js +310 -0
  127. data/assets/_vendor/ace/mode-plain_text.js +33 -0
  128. data/assets/_vendor/ace/mode-powershell.js +418 -0
  129. data/assets/_vendor/ace/mode-praat.js +478 -0
  130. data/assets/_vendor/ace/mode-prolog.js +371 -0
  131. data/assets/_vendor/ace/mode-properties.js +81 -0
  132. data/assets/_vendor/ace/mode-protobuf.js +592 -0
  133. data/assets/_vendor/ace/mode-puppet.js +370 -0
  134. data/assets/_vendor/ace/mode-python.js +273 -0
  135. data/assets/_vendor/ace/mode-r.js +310 -0
  136. data/assets/_vendor/ace/mode-razor.js +2869 -0
  137. data/assets/_vendor/ace/mode-rdoc.js +243 -0
  138. data/assets/_vendor/ace/mode-red.js +450 -0
  139. data/assets/_vendor/ace/mode-redshift.js +361 -0
  140. data/assets/_vendor/ace/mode-rhtml.js +2806 -0
  141. data/assets/_vendor/ace/mode-rst.js +257 -0
  142. data/assets/_vendor/ace/mode-ruby.js +497 -0
  143. data/assets/_vendor/ace/mode-rust.js +279 -0
  144. data/assets/_vendor/ace/mode-sass.js +441 -0
  145. data/assets/_vendor/ace/mode-scad.js +414 -0
  146. data/assets/_vendor/ace/mode-scala.js +982 -0
  147. data/assets/_vendor/ace/mode-scheme.js +232 -0
  148. data/assets/_vendor/ace/mode-scss.js +606 -0
  149. data/assets/_vendor/ace/mode-sh.js +447 -0
  150. data/assets/_vendor/ace/mode-sjs.js +1014 -0
  151. data/assets/_vendor/ace/mode-slim.js +4736 -0
  152. data/assets/_vendor/ace/mode-smarty.js +2635 -0
  153. data/assets/_vendor/ace/mode-snippets.js +207 -0
  154. data/assets/_vendor/ace/mode-soy_template.js +2847 -0
  155. data/assets/_vendor/ace/mode-space.js +168 -0
  156. data/assets/_vendor/ace/mode-sparql.js +320 -0
  157. data/assets/_vendor/ace/mode-sql.js +111 -0
  158. data/assets/_vendor/ace/mode-sqlserver.js +444 -0
  159. data/assets/_vendor/ace/mode-stylus.js +471 -0
  160. data/assets/_vendor/ace/mode-svg.js +1581 -0
  161. data/assets/_vendor/ace/mode-swift.js +390 -0
  162. data/assets/_vendor/ace/mode-tcl.js +383 -0
  163. data/assets/_vendor/ace/mode-terraform.js +398 -0
  164. data/assets/_vendor/ace/mode-tex.js +159 -0
  165. data/assets/_vendor/ace/mode-text.js +10 -0
  166. data/assets/_vendor/ace/mode-textile.js +150 -0
  167. data/assets/_vendor/ace/mode-toml.js +154 -0
  168. data/assets/_vendor/ace/mode-tsx.js +887 -0
  169. data/assets/_vendor/ace/mode-turtle.js +296 -0
  170. data/assets/_vendor/ace/mode-twig.js +2693 -0
  171. data/assets/_vendor/ace/mode-typescript.js +868 -0
  172. data/assets/_vendor/ace/mode-vala.js +676 -0
  173. data/assets/_vendor/ace/mode-vbscript.js +207 -0
  174. data/assets/_vendor/ace/mode-velocity.js +2790 -0
  175. data/assets/_vendor/ace/mode-verilog.js +119 -0
  176. data/assets/_vendor/ace/mode-vhdl.js +118 -0
  177. data/assets/_vendor/ace/mode-wollok.js +911 -0
  178. data/assets/_vendor/ace/mode-xml.js +677 -0
  179. data/assets/_vendor/ace/mode-xquery.js +4922 -0
  180. data/assets/_vendor/ace/mode-yaml.js +300 -0
  181. data/assets/_vendor/ace/snippets/abap.js +15 -0
  182. data/assets/_vendor/ace/snippets/abc.js +46 -0
  183. data/assets/_vendor/ace/snippets/actionscript.js +172 -0
  184. data/assets/_vendor/ace/snippets/ada.js +15 -0
  185. data/assets/_vendor/ace/snippets/apache_conf.js +15 -0
  186. data/assets/_vendor/ace/snippets/applescript.js +15 -0
  187. data/assets/_vendor/ace/snippets/asciidoc.js +15 -0
  188. data/assets/_vendor/ace/snippets/asl.js +14 -0
  189. data/assets/_vendor/ace/snippets/assembly_x86.js +15 -0
  190. data/assets/_vendor/ace/snippets/autohotkey.js +15 -0
  191. data/assets/_vendor/ace/snippets/batchfile.js +15 -0
  192. data/assets/_vendor/ace/snippets/bro.js +15 -0
  193. data/assets/_vendor/ace/snippets/c9search.js +15 -0
  194. data/assets/_vendor/ace/snippets/c_cpp.js +146 -0
  195. data/assets/_vendor/ace/snippets/cirru.js +15 -0
  196. data/assets/_vendor/ace/snippets/clojure.js +105 -0
  197. data/assets/_vendor/ace/snippets/cobol.js +15 -0
  198. data/assets/_vendor/ace/snippets/coffee.js +110 -0
  199. data/assets/_vendor/ace/snippets/coldfusion.js +15 -0
  200. data/assets/_vendor/ace/snippets/csharp.js +15 -0
  201. data/assets/_vendor/ace/snippets/csound_document.js +25 -0
  202. data/assets/_vendor/ace/snippets/csound_orchestra.js +62 -0
  203. data/assets/_vendor/ace/snippets/csound_score.js +15 -0
  204. data/assets/_vendor/ace/snippets/csp.js +15 -0
  205. data/assets/_vendor/ace/snippets/css.js +982 -0
  206. data/assets/_vendor/ace/snippets/curly.js +15 -0
  207. data/assets/_vendor/ace/snippets/d.js +15 -0
  208. data/assets/_vendor/ace/snippets/dart.js +98 -0
  209. data/assets/_vendor/ace/snippets/diff.js +26 -0
  210. data/assets/_vendor/ace/snippets/django.js +123 -0
  211. data/assets/_vendor/ace/snippets/dockerfile.js +15 -0
  212. data/assets/_vendor/ace/snippets/dot.js +15 -0
  213. data/assets/_vendor/ace/snippets/drools.js +34 -0
  214. data/assets/_vendor/ace/snippets/edifact.js +255 -0
  215. data/assets/_vendor/ace/snippets/eiffel.js +15 -0
  216. data/assets/_vendor/ace/snippets/ejs.js +15 -0
  217. data/assets/_vendor/ace/snippets/elixir.js +15 -0
  218. data/assets/_vendor/ace/snippets/elm.js +15 -0
  219. data/assets/_vendor/ace/snippets/erlang.js +175 -0
  220. data/assets/_vendor/ace/snippets/forth.js +15 -0
  221. data/assets/_vendor/ace/snippets/fortran.js +15 -0
  222. data/assets/_vendor/ace/snippets/fsharp.js +15 -0
  223. data/assets/_vendor/ace/snippets/ftl.js +15 -0
  224. data/assets/_vendor/ace/snippets/gcode.js +15 -0
  225. data/assets/_vendor/ace/snippets/gherkin.js +15 -0
  226. data/assets/_vendor/ace/snippets/gitignore.js +15 -0
  227. data/assets/_vendor/ace/snippets/glsl.js +15 -0
  228. data/assets/_vendor/ace/snippets/gobstones.js +49 -0
  229. data/assets/_vendor/ace/snippets/golang.js +15 -0
  230. data/assets/_vendor/ace/snippets/graphqlschema.js +47 -0
  231. data/assets/_vendor/ace/snippets/groovy.js +15 -0
  232. data/assets/_vendor/ace/snippets/haml.js +35 -0
  233. data/assets/_vendor/ace/snippets/handlebars.js +15 -0
  234. data/assets/_vendor/ace/snippets/haskell.js +97 -0
  235. data/assets/_vendor/ace/snippets/haskell_cabal.js +15 -0
  236. data/assets/_vendor/ace/snippets/haxe.js +15 -0
  237. data/assets/_vendor/ace/snippets/hjson.js +15 -0
  238. data/assets/_vendor/ace/snippets/html.js +870 -0
  239. data/assets/_vendor/ace/snippets/html_elixir.js +15 -0
  240. data/assets/_vendor/ace/snippets/html_ruby.js +15 -0
  241. data/assets/_vendor/ace/snippets/ini.js +15 -0
  242. data/assets/_vendor/ace/snippets/io.js +77 -0
  243. data/assets/_vendor/ace/snippets/jack.js +15 -0
  244. data/assets/_vendor/ace/snippets/jade.js +15 -0
  245. data/assets/_vendor/ace/snippets/java.js +255 -0
  246. data/assets/_vendor/ace/snippets/javascript.js +210 -0
  247. data/assets/_vendor/ace/snippets/json.js +15 -0
  248. data/assets/_vendor/ace/snippets/jsoniq.js +76 -0
  249. data/assets/_vendor/ace/snippets/jsp.js +114 -0
  250. data/assets/_vendor/ace/snippets/jssm.js +15 -0
  251. data/assets/_vendor/ace/snippets/jsx.js +15 -0
  252. data/assets/_vendor/ace/snippets/julia.js +15 -0
  253. data/assets/_vendor/ace/snippets/kotlin.js +15 -0
  254. data/assets/_vendor/ace/snippets/latex.js +15 -0
  255. data/assets/_vendor/ace/snippets/less.js +15 -0
  256. data/assets/_vendor/ace/snippets/liquid.js +15 -0
  257. data/assets/_vendor/ace/snippets/lisp.js +15 -0
  258. data/assets/_vendor/ace/snippets/livescript.js +15 -0
  259. data/assets/_vendor/ace/snippets/logiql.js +15 -0
  260. data/assets/_vendor/ace/snippets/lsl.js +1247 -0
  261. data/assets/_vendor/ace/snippets/lua.js +36 -0
  262. data/assets/_vendor/ace/snippets/luapage.js +15 -0
  263. data/assets/_vendor/ace/snippets/lucene.js +15 -0
  264. data/assets/_vendor/ace/snippets/makefile.js +19 -0
  265. data/assets/_vendor/ace/snippets/markdown.js +103 -0
  266. data/assets/_vendor/ace/snippets/mask.js +15 -0
  267. data/assets/_vendor/ace/snippets/matlab.js +15 -0
  268. data/assets/_vendor/ace/snippets/maze.js +24 -0
  269. data/assets/_vendor/ace/snippets/mel.js +15 -0
  270. data/assets/_vendor/ace/snippets/mixal.js +15 -0
  271. data/assets/_vendor/ace/snippets/mushcode.js +15 -0
  272. data/assets/_vendor/ace/snippets/mysql.js +15 -0
  273. data/assets/_vendor/ace/snippets/nix.js +15 -0
  274. data/assets/_vendor/ace/snippets/nsis.js +15 -0
  275. data/assets/_vendor/ace/snippets/objectivec.js +15 -0
  276. data/assets/_vendor/ace/snippets/ocaml.js +15 -0
  277. data/assets/_vendor/ace/snippets/pascal.js +15 -0
  278. data/assets/_vendor/ace/snippets/perl.js +362 -0
  279. data/assets/_vendor/ace/snippets/pgsql.js +15 -0
  280. data/assets/_vendor/ace/snippets/php.js +398 -0
  281. data/assets/_vendor/ace/snippets/php_laravel_blade.js +15 -0
  282. data/assets/_vendor/ace/snippets/pig.js +15 -0
  283. data/assets/_vendor/ace/snippets/plain_text.js +15 -0
  284. data/assets/_vendor/ace/snippets/powershell.js +15 -0
  285. data/assets/_vendor/ace/snippets/praat.js +15 -0
  286. data/assets/_vendor/ace/snippets/prolog.js +15 -0
  287. data/assets/_vendor/ace/snippets/properties.js +15 -0
  288. data/assets/_vendor/ace/snippets/protobuf.js +15 -0
  289. data/assets/_vendor/ace/snippets/puppet.js +15 -0
  290. data/assets/_vendor/ace/snippets/python.js +173 -0
  291. data/assets/_vendor/ace/snippets/r.js +136 -0
  292. data/assets/_vendor/ace/snippets/razor.js +18 -0
  293. data/assets/_vendor/ace/snippets/rdoc.js +15 -0
  294. data/assets/_vendor/ace/snippets/red.js +15 -0
  295. data/assets/_vendor/ace/snippets/redshift.js +15 -0
  296. data/assets/_vendor/ace/snippets/rhtml.js +15 -0
  297. data/assets/_vendor/ace/snippets/rst.js +37 -0
  298. data/assets/_vendor/ace/snippets/ruby.js +943 -0
  299. data/assets/_vendor/ace/snippets/rust.js +15 -0
  300. data/assets/_vendor/ace/snippets/sass.js +15 -0
  301. data/assets/_vendor/ace/snippets/scad.js +15 -0
  302. data/assets/_vendor/ace/snippets/scala.js +15 -0
  303. data/assets/_vendor/ace/snippets/scheme.js +15 -0
  304. data/assets/_vendor/ace/snippets/scss.js +15 -0
  305. data/assets/_vendor/ace/snippets/sh.js +98 -0
  306. data/assets/_vendor/ace/snippets/sjs.js +15 -0
  307. data/assets/_vendor/ace/snippets/slim.js +15 -0
  308. data/assets/_vendor/ace/snippets/smarty.js +15 -0
  309. data/assets/_vendor/ace/snippets/snippets.js +24 -0
  310. data/assets/_vendor/ace/snippets/soy_template.js +15 -0
  311. data/assets/_vendor/ace/snippets/space.js +15 -0
  312. data/assets/_vendor/ace/snippets/sparql.js +15 -0
  313. data/assets/_vendor/ace/snippets/sql.js +41 -0
  314. data/assets/_vendor/ace/snippets/sqlserver.js +84 -0
  315. data/assets/_vendor/ace/snippets/stylus.js +15 -0
  316. data/assets/_vendor/ace/snippets/svg.js +15 -0
  317. data/assets/_vendor/ace/snippets/swift.js +15 -0
  318. data/assets/_vendor/ace/snippets/tcl.js +107 -0
  319. data/assets/_vendor/ace/snippets/terraform.js +15 -0
  320. data/assets/_vendor/ace/snippets/tex.js +205 -0
  321. data/assets/_vendor/ace/snippets/text.js +15 -0
  322. data/assets/_vendor/ace/snippets/textile.js +45 -0
  323. data/assets/_vendor/ace/snippets/toml.js +15 -0
  324. data/assets/_vendor/ace/snippets/tsx.js +15 -0
  325. data/assets/_vendor/ace/snippets/turtle.js +15 -0
  326. data/assets/_vendor/ace/snippets/twig.js +15 -0
  327. data/assets/_vendor/ace/snippets/typescript.js +15 -0
  328. data/assets/_vendor/ace/snippets/vala.js +201 -0
  329. data/assets/_vendor/ace/snippets/vbscript.js +15 -0
  330. data/assets/_vendor/ace/snippets/velocity.js +44 -0
  331. data/assets/_vendor/ace/snippets/verilog.js +15 -0
  332. data/assets/_vendor/ace/snippets/vhdl.js +15 -0
  333. data/assets/_vendor/ace/snippets/wollok.js +99 -0
  334. data/assets/_vendor/ace/snippets/xml.js +15 -0
  335. data/assets/_vendor/ace/snippets/xquery.js +76 -0
  336. data/assets/_vendor/ace/snippets/yaml.js +15 -0
  337. data/assets/_vendor/ace/theme-ambiance.js +185 -0
  338. data/assets/_vendor/ace/theme-chaos.js +164 -0
  339. data/assets/_vendor/ace/theme-chrome.js +136 -0
  340. data/assets/_vendor/ace/theme-clouds.js +103 -0
  341. data/assets/_vendor/ace/theme-clouds_midnight.js +104 -0
  342. data/assets/_vendor/ace/theme-cobalt.js +121 -0
  343. data/assets/_vendor/ace/theme-crimson_editor.js +126 -0
  344. data/assets/_vendor/ace/theme-dawn.js +116 -0
  345. data/assets/_vendor/ace/theme-dracula.js +136 -0
  346. data/assets/_vendor/ace/theme-dreamweaver.js +149 -0
  347. data/assets/_vendor/ace/theme-eclipse.js +106 -0
  348. data/assets/_vendor/ace/theme-github.js +110 -0
  349. data/assets/_vendor/ace/theme-gob.js +120 -0
  350. data/assets/_vendor/ace/theme-gruvbox.js +90 -0
  351. data/assets/_vendor/ace/theme-idle_fingers.js +104 -0
  352. data/assets/_vendor/ace/theme-iplastic.js +129 -0
  353. data/assets/_vendor/ace/theme-katzenmilch.js +129 -0
  354. data/assets/_vendor/ace/theme-kr_theme.js +112 -0
  355. data/assets/_vendor/ace/theme-kuroir.js +69 -0
  356. data/assets/_vendor/ace/theme-merbivore.js +103 -0
  357. data/assets/_vendor/ace/theme-merbivore_soft.js +104 -0
  358. data/assets/_vendor/ace/theme-mono_industrial.js +115 -0
  359. data/assets/_vendor/ace/theme-monokai.js +113 -0
  360. data/assets/_vendor/ace/theme-pastel_on_dark.js +116 -0
  361. data/assets/_vendor/ace/theme-solarized_dark.js +96 -0
  362. data/assets/_vendor/ace/theme-solarized_light.js +99 -0
  363. data/assets/_vendor/ace/theme-sqlserver.js +146 -0
  364. data/assets/_vendor/ace/theme-terminal.js +122 -0
  365. data/assets/_vendor/ace/theme-textmate.js +138 -0
  366. data/assets/_vendor/ace/theme-tomorrow.js +116 -0
  367. data/assets/_vendor/ace/theme-tomorrow_night.js +116 -0
  368. data/assets/_vendor/ace/theme-tomorrow_night_blue.js +114 -0
  369. data/assets/_vendor/ace/theme-tomorrow_night_bright.js +129 -0
  370. data/assets/_vendor/ace/theme-tomorrow_night_eighties.js +116 -0
  371. data/assets/_vendor/ace/theme-twilight.js +117 -0
  372. data/assets/_vendor/ace/theme-vibrant_ink.js +102 -0
  373. data/assets/_vendor/ace/theme-xcode.js +96 -0
  374. data/assets/_vendor/ace/worker-coffee.js +2165 -0
  375. data/assets/_vendor/ace/worker-css.js +8764 -0
  376. data/assets/_vendor/ace/worker-html.js +11614 -0
  377. data/assets/_vendor/ace/worker-javascript.js +12491 -0
  378. data/assets/_vendor/ace/worker-json.js +2396 -0
  379. data/assets/_vendor/ace/worker-lua.js +3637 -0
  380. data/assets/_vendor/ace/worker-php.js +4313 -0
  381. data/assets/_vendor/ace/worker-xml.js +3899 -0
  382. data/assets/_vendor/ace/worker-xquery.js +70688 -0
  383. data/assets/_vendor/motion-ui/_settings.scss +1 -0
  384. data/assets/_vendor/motion-ui/effects/_fade.scss +1 -4
  385. data/assets/_vendor/motion-ui/effects/_hinge.scss +4 -3
  386. data/assets/_vendor/motion-ui/effects/_shake.scss +1 -1
  387. data/assets/_vendor/motion-ui/effects/_slide.scss +4 -3
  388. data/assets/_vendor/motion-ui/effects/_spin.scss +4 -3
  389. data/assets/_vendor/motion-ui/effects/_wiggle.scss +1 -1
  390. data/assets/_vendor/motion-ui/effects/_zoom.scss +2 -2
  391. data/assets/_vendor/motion-ui/motion-ui.scss +2 -0
  392. data/assets/_vendor/motion-ui/transitions/_fade.scss +6 -4
  393. data/assets/_vendor/motion-ui/transitions/_hinge.scss +3 -2
  394. data/assets/_vendor/motion-ui/transitions/_slide.scss +3 -2
  395. data/assets/_vendor/motion-ui/transitions/_spin.scss +2 -1
  396. data/assets/_vendor/motion-ui/transitions/_zoom.scss +6 -4
  397. data/assets/_vendor/motion-ui/util/_animation.scss +1 -1
  398. data/assets/_vendor/motion-ui/util/_args.scss +2 -2
  399. data/assets/_vendor/motion-ui/util/_function.scss +94 -0
  400. data/assets/_vendor/motion-ui/util/_keyframe.scss +5 -5
  401. data/assets/_vendor/motion-ui/util/_series.scss +20 -17
  402. data/assets/_vendor/motion-ui/util/_string.scss +36 -0
  403. data/assets/_vendor/tinymce/plugins/advlist/plugin.js +136 -404
  404. data/assets/_vendor/tinymce/plugins/advlist/plugin.min.js +1 -1
  405. data/assets/_vendor/tinymce/plugins/anchor/plugin.js +103 -323
  406. data/assets/_vendor/tinymce/plugins/anchor/plugin.min.js +1 -1
  407. data/assets/_vendor/tinymce/plugins/autolink/plugin.js +153 -377
  408. data/assets/_vendor/tinymce/plugins/autolink/plugin.min.js +1 -1
  409. data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +145 -427
  410. data/assets/_vendor/tinymce/plugins/autoresize/plugin.min.js +1 -1
  411. data/assets/_vendor/tinymce/plugins/autosave/plugin.js +197 -579
  412. data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -1
  413. data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +88 -251
  414. data/assets/_vendor/tinymce/plugins/bbcode/plugin.min.js +1 -1
  415. data/assets/_vendor/tinymce/plugins/charmap/plugin.js +1243 -818
  416. data/assets/_vendor/tinymce/plugins/charmap/plugin.min.js +1 -1
  417. data/assets/_vendor/tinymce/plugins/code/plugin.js +82 -326
  418. data/assets/_vendor/tinymce/plugins/code/plugin.min.js +1 -1
  419. data/assets/_vendor/tinymce/plugins/codesample/plugin.js +829 -1444
  420. data/assets/_vendor/tinymce/plugins/codesample/plugin.min.js +1 -1
  421. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +111 -257
  422. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.min.js +1 -1
  423. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +141 -469
  424. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.min.js +1 -1
  425. data/assets/_vendor/tinymce/plugins/directionality/plugin.js +57 -261
  426. data/assets/_vendor/tinymce/plugins/directionality/plugin.min.js +1 -1
  427. data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +78 -247
  428. data/assets/_vendor/tinymce/plugins/emoticons/plugin.min.js +1 -1
  429. data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +463 -906
  430. data/assets/_vendor/tinymce/plugins/fullpage/plugin.min.js +1 -1
  431. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +149 -427
  432. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
  433. data/assets/_vendor/tinymce/plugins/help/plugin.js +634 -1434
  434. data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -1
  435. data/assets/_vendor/tinymce/plugins/hr/plugin.js +29 -185
  436. data/assets/_vendor/tinymce/plugins/hr/plugin.min.js +1 -1
  437. data/assets/_vendor/tinymce/plugins/image/plugin.js +1147 -1508
  438. data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -1
  439. data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +3319 -4079
  440. data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +1 -2
  441. data/assets/_vendor/tinymce/plugins/importcss/plugin.js +230 -543
  442. data/assets/_vendor/tinymce/plugins/importcss/plugin.min.js +1 -1
  443. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +151 -460
  444. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
  445. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +204 -379
  446. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.min.js +1 -1
  447. data/assets/_vendor/tinymce/plugins/link/plugin.js +644 -1162
  448. data/assets/_vendor/tinymce/plugins/link/plugin.min.js +1 -1
  449. data/assets/_vendor/tinymce/plugins/lists/plugin.js +1005 -1875
  450. data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -1
  451. data/assets/_vendor/tinymce/plugins/media/plugin.js +1066 -1926
  452. data/assets/_vendor/tinymce/plugins/media/plugin.min.js +1 -1
  453. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +70 -298
  454. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
  455. data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +96 -294
  456. data/assets/_vendor/tinymce/plugins/noneditable/plugin.min.js +1 -1
  457. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +92 -337
  458. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.min.js +1 -1
  459. data/assets/_vendor/tinymce/plugins/paste/plugin.js +1363 -2801
  460. data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -1
  461. data/assets/_vendor/tinymce/plugins/preview/plugin.js +106 -393
  462. data/assets/_vendor/tinymce/plugins/preview/plugin.min.js +1 -1
  463. data/assets/_vendor/tinymce/plugins/print/plugin.js +29 -185
  464. data/assets/_vendor/tinymce/plugins/print/plugin.min.js +1 -1
  465. data/assets/_vendor/tinymce/plugins/save/plugin.js +100 -350
  466. data/assets/_vendor/tinymce/plugins/save/plugin.min.js +1 -1
  467. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +491 -865
  468. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  469. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +630 -1292
  470. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -1
  471. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +96 -391
  472. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.min.js +1 -1
  473. data/assets/_vendor/tinymce/plugins/table/plugin.js +9537 -14920
  474. data/assets/_vendor/tinymce/plugins/table/plugin.min.js +1 -5
  475. data/assets/_vendor/tinymce/plugins/template/plugin.js +309 -771
  476. data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -1
  477. data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +319 -592
  478. data/assets/_vendor/tinymce/plugins/textcolor/plugin.min.js +1 -1
  479. data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +326 -674
  480. data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -1
  481. data/assets/_vendor/tinymce/plugins/toc/plugin.js +199 -530
  482. data/assets/_vendor/tinymce/plugins/toc/plugin.min.js +1 -1
  483. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +112 -436
  484. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.min.js +1 -1
  485. data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +428 -1248
  486. data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -1
  487. data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +307 -699
  488. data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -1
  489. data/assets/_vendor/tinymce/skins/lightgray/content.inline.min.css +1 -1
  490. data/assets/_vendor/tinymce/skins/lightgray/content.min.css +1 -1
  491. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  492. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +1 -1
  493. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  494. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  495. data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -1
  496. data/assets/_vendor/tinymce/skins/lightgray/skin.mobile.min.css +1 -1
  497. data/assets/_vendor/tinymce/themes/inlite/theme.js +9693 -18245
  498. data/assets/_vendor/tinymce/themes/inlite/theme.min.js +1 -5
  499. data/assets/_vendor/tinymce/themes/mobile/theme.js +12629 -22467
  500. data/assets/_vendor/tinymce/themes/mobile/theme.min.js +1 -8
  501. data/assets/_vendor/tinymce/themes/modern/theme.js +9510 -17780
  502. data/assets/_vendor/tinymce/themes/modern/theme.min.js +1 -5
  503. data/assets/_vendor/tinymce/tinymce.js +25087 -42606
  504. data/assets/_vendor/yoastseo/css/_icons.scss +7 -7
  505. data/assets/_vendor/yoastseo/css/_snippet-editor.scss +1 -1
  506. data/assets/bedrock/js/bedrock.js +1 -71697
  507. data/assets/bedrock/scss/_bedrock-components.scss +20 -0
  508. data/assets/bedrock/scss/_bedrock-settings.scss +12 -4
  509. data/assets/bedrock/scss/_foundation-settings.scss +4 -2
  510. data/assets/bedrock/scss/components/ace-editor.scss +21 -0
  511. data/assets/bedrock/scss/components/attachments-grid.scss +18 -15
  512. data/assets/bedrock/scss/components/date-picker.scss +146 -0
  513. data/assets/bedrock/scss/components/dropzone-upload.scss +7 -0
  514. data/assets/bedrock/scss/components/file-input.scss +7 -0
  515. data/assets/bedrock/scss/components/file-preview.scss +36 -0
  516. data/assets/bedrock/scss/components/frame-embed.scss +23 -0
  517. data/assets/bedrock/scss/components/global.scss +27 -0
  518. data/assets/bedrock/scss/components/helper-classes.scss +1 -0
  519. data/assets/bedrock/scss/components/icon-box.scss +38 -0
  520. data/assets/bedrock/scss/components/item-list.scss +66 -0
  521. data/assets/bedrock/scss/components/lists.scss +58 -0
  522. data/assets/bedrock/scss/components/off-canvas-menu.scss +27 -15
  523. data/assets/bedrock/scss/components/place-autocomplete.scss +90 -0
  524. data/assets/bedrock/scss/components/rrule-generator.scss +102 -0
  525. data/assets/bedrock/scss/components/rrule-reveal.scss +14 -0
  526. data/assets/bedrock/scss/components/select-box.scss +1 -0
  527. data/assets/bedrock/scss/components/seo-analysis.scss +5 -0
  528. data/assets/bedrock/scss/components/textarea.scss +14 -2
  529. data/assets/bedrock/scss/components/tiny-mce-editor.scss +5 -16
  530. data/lib/bedrock_sass.rb +5 -0
  531. data/lib/bedrock_sass/version.rb +1 -1
  532. data/lib/tasks/before_assets_precompile.rake +1 -0
  533. metadata +395 -4
  534. data/CODE_OF_CONDUCT.md +0 -74
@@ -1,5 +1 @@
1
- !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e[f]=d(a[f]);b.apply(null,e)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("d",tinymce.util.Tools.resolve),g("1",["d"],function(a){return a("tinymce.PluginManager")}),h("1p",Array),h("1q",Error),g("f",["1p","1q"],function(a,b){var c=function(){},d=function(a){return function(){return a()}},e=function(a,b){return function(){return a(b.apply(null,arguments))}},f=function(a){return function(){return a}},g=function(a){return a},h=function(a,b){return a===b},i=function(b){for(var c=new a(arguments.length-1),d=1;d<arguments.length;d++)c[d-1]=arguments[d];return function(){for(var d=new a(arguments.length),e=0;e<d.length;e++)d[e]=arguments[e];var f=c.concat(d);return b.apply(null,f)}},j=function(a){return function(){return!a.apply(null,arguments)}},k=function(a){return function(){throw new b(a)}},l=function(a){return a()},m=function(a){a()},n=f(!1),o=f(!0);return{noop:c,noarg:d,compose:e,constant:f,identity:g,tripleEquals:h,curry:i,not:j,die:k,apply:l,call:m,never:n,always:o}}),h("1r",Object),g("g",["f","1r"],function(a,b){var c=a.never,d=a.always,e=function(){return f},f=function(){var f=function(a){return a.isNone()},g=function(a){return a()},h=function(a){return a},i=function(){},j={fold:function(a,b){return a()},is:c,isSome:c,isNone:d,getOr:h,getOrThunk:g,getOrDie:function(a){throw new Error(a||"error: getOrDie called on none.")},or:h,orThunk:g,map:e,ap:e,each:i,bind:e,flatten:e,exists:c,forall:d,filter:e,equals:f,equals_:f,toArray:function(){return[]},toString:a.constant("none()")};return b.freeze&&b.freeze(j),j}(),g=function(a){var b=function(){return a},h=function(){return k},i=function(b){return g(b(a))},j=function(b){return b(a)},k={fold:function(b,c){return c(a)},is:function(b){return a===b},isSome:d,isNone:c,getOr:b,getOrThunk:b,getOrDie:b,or:h,orThunk:h,map:i,ap:function(b){return b.fold(e,function(b){return g(b(a))})},each:function(b){b(a)},bind:j,flatten:b,exists:j,forall:j,filter:function(b){return b(a)?k:f},equals:function(b){return b.is(a)},equals_:function(b,d){return b.fold(c,function(b){return d(a,b)})},toArray:function(){return[a]},toString:function(){return"some("+a+")"}};return k},h=function(a){return null===a||void 0===a?f:g(a)};return{some:g,none:e,from:h}}),h("1s",String),g("e",["g","1p","1q","1s"],function(a,b,c,d){var e=function(){var a=b.prototype.indexOf,c=function(b,c){return a.call(b,c)},d=function(a,b){return u(a,b)};return void 0===a?d:c}(),f=function(b,c){var d=e(b,c);return d===-1?a.none():a.some(d)},g=function(a,b){return e(a,b)>-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d<a;d++)c.push(b(d));return c},j=function(a,b){for(var c=[],d=0;d<a.length;d+=b){var e=a.slice(d,d+b);c.push(e)}return c},k=function(a,c){for(var d=a.length,e=new b(d),f=0;f<d;f++){var g=a[f];e[f]=c(g,f,a)}return e},l=function(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];b(e,c,a)}},m=function(a,b){for(var c=a.length-1;c>=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e<f;e++){var g=a[e],h=b(g,e,a)?c:d;h.push(g)}return{pass:c,fail:d}},o=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d];b(f,d,a)&&c.push(f)}return c},p=function(a,b){if(0===a.length)return[];for(var c=b(a[0]),d=[],e=[],f=0,g=a.length;f<g;f++){var h=a[f],i=b(h);i!==c&&(d.push(e),e=[]),c=i,e.push(h)}return 0!==e.length&&d.push(e),d},q=function(a,b,c){return m(a,function(a){c=b(c,a)}),c},r=function(a,b,c){return l(a,function(a){c=b(c,a)}),c},s=function(b,c){for(var d=0,e=b.length;d<e;d++){var f=b[d];if(c(f,d,b))return a.some(f)}return a.none()},t=function(b,c){for(var d=0,e=b.length;d<e;d++){var f=b[d];if(c(f,d,b))return a.some(d)}return a.none()},u=function(a,b){for(var c=0,d=a.length;c<d;++c)if(a[c]===b)return c;return-1},v=b.prototype.push,w=function(a){for(var d=[],e=0,f=a.length;e<f;++e){if(!b.prototype.isPrototypeOf(a[e]))throw new c("Arr.flatten item "+e+" was not an array, input: "+a);v.apply(d,a[e])}return d},x=function(a,b){var c=k(a,b);return w(c)},y=function(a,b){for(var c=0,d=a.length;c<d;++c){var e=a[c];if(b(e,c,a)!==!0)return!1}return!0},z=function(a,b){return a.length===b.length&&y(a,function(a,c){return a===b[c]})},A=b.prototype.slice,B=function(a){var b=A.call(a,0);return b.reverse(),b},C=function(a,b){return o(a,function(a){return!g(b,a)})},D=function(a,b){for(var c={},e=0,f=a.length;e<f;e++){var g=a[e];c[d(g)]=b(g,e)}return c},E=function(a){return[a]},F=function(a,b){var c=A.call(a,0);return c.sort(b),c},G=function(b){return 0===b.length?a.none():a.some(b[0])},H=function(b){return 0===b.length?a.none():a.some(b[b.length-1])};return{map:k,each:l,eachr:m,partition:n,filter:o,groupBy:p,indexOf:f,foldr:q,foldl:r,find:s,findIndex:t,flatten:w,bind:x,forall:y,exists:h,contains:g,equal:z,reverse:B,chunk:j,difference:C,mapToObject:D,pure:E,sort:F,range:i,head:G,last:H}}),g("1t",["g","1r"],function(a,b){var c=function(){var a=b.keys,c=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b};return void 0===a?c:a}(),d=function(a,b){for(var d=c(a),e=0,f=d.length;e<f;e++){var g=d[e],h=a[g];b(h,g,a)}},e=function(a,b){return f(a,function(a,c,d){return{k:c,v:b(a,c,d)}})},f=function(a,b){var c={};return d(a,function(d,e){var f=b(d,e,a);c[f.k]=f.v}),c},g=function(a,b){var c={},e={};return d(a,function(a,d){var f=b(a,d)?c:e;f[d]=a}),{t:c,f:e}},h=function(a,b){var c=[];return d(a,function(a,d){c.push(b(a,d))}),c},i=function(b,d){for(var e=c(b),f=0,g=e.length;f<g;f++){var h=e[f],i=b[h];if(d(i,h,b))return a.some(i)}return a.none()},j=function(a){return h(a,function(a){return a})},k=function(a){return j(a).length};return{bifilter:g,each:d,map:e,mapToArray:h,tupleMap:f,find:i,keys:c,values:j,size:k}}),g("1u",["e","f","1p","1q"],function(a,b,c,d){return function(){var e=arguments;return function(){for(var f=new c(arguments.length),g=0;g<f.length;g++)f[g]=arguments[g];if(e.length!==f.length)throw new d('Wrong number of arguments to struct. Expected "['+e.length+']", got '+f.length+" arguments");var h={};return a.each(e,function(a,c){h[a]=b.constant(f[c])}),h}}}),g("1z",["1p","1s"],function(a,b){var c=function(c){if(null===c)return"null";var d=typeof c;return"object"===d&&a.prototype.isPrototypeOf(c)?"array":"object"===d&&b.prototype.isPrototypeOf(c)?"string":d},d=function(a){return function(b){return c(b)===a}};return{isString:d("string"),isObject:d("object"),isArray:d("array"),isNull:d("null"),isBoolean:d("boolean"),isUndefined:d("undefined"),isFunction:d("function"),isNumber:d("number")}}),g("3r",["e","1z","1q"],function(a,b,c){var d=function(a){return a.slice(0).sort()},e=function(a,b){throw new c("All required keys ("+d(a).join(", ")+") were not specified. Specified keys were: "+d(b).join(", ")+".")},f=function(a){throw new c("Unsupported keys for object: "+d(a).join(", "))},g=function(d,e){if(!b.isArray(e))throw new c("The "+d+" fields must be an array. Was: "+e+".");a.each(e,function(a){if(!b.isString(a))throw new c("The value "+a+" in the "+d+" fields was not a string.")})},h=function(a,b){throw new c("All values need to be of type: "+b+". Keys ("+d(a).join(", ")+") were not.")},i=function(b){var e=d(b),f=a.find(e,function(a,b){return b<e.length-1&&a===e[b+1]});f.each(function(a){throw new c("The field: "+a+" occurs more than once in the combined fields: ["+e.join(", ")+"].")})};return{sort:d,reqMessage:e,unsuppMessage:f,validateStrArr:g,invalidTypeMessage:h,checkDupes:i}}),g("1v",["e","f","1t","g","3r","1q","1r"],function(a,b,c,d,e,f,g){return function(h,i){var j=h.concat(i);if(0===j.length)throw new f("You must specify at least one required or optional field.");return e.validateStrArr("required",h),e.validateStrArr("optional",i),e.checkDupes(j),function(f){var k=c.keys(f),l=a.forall(h,function(b){return a.contains(k,b)});l||e.reqMessage(h,k);var m=a.filter(k,function(b){return!a.contains(j,b)});m.length>0&&e.unsuppMessage(m);var n={};return a.each(h,function(a){n[a]=b.constant(f[a])}),a.each(i,function(a){n[a]=b.constant(g.prototype.hasOwnProperty.call(f,a)?d.some(f[a]):d.none())}),n}}}),g("1k",["1u","1v"],function(a,b){return{immutable:a,immutableBag:b}}),g("2c",["1k"],function(a){var b=a.immutable("width","height"),c=a.immutable("rows","columns"),d=a.immutable("row","column"),e=a.immutable("x","y"),f=a.immutable("element","rowspan","colspan"),g=a.immutable("element","rowspan","colspan","isNew"),h=a.immutable("element","rowspan","colspan","row","column"),i=a.immutable("element","cells","section"),j=a.immutable("element","isNew"),k=a.immutable("element","cells","section","isNew"),l=a.immutable("cells","section"),m=a.immutable("details","section"),n=a.immutable("startRow","startCol","finishRow","finishCol");return{dimensions:b,grid:c,address:d,coords:e,extended:h,detail:f,detailnew:g,rowdata:i,elementnew:j,rowdatanew:k,rowcells:l,rowdetails:m,bounds:n}}),g("21",[],function(){return"undefined"==typeof console&&(console={log:function(){}}),console}),h("23",document),g("l",["f","g","1q","21","23"],function(a,b,c,d,e){var f=function(a,b){var c=b||e,f=c.createElement("div");if(f.innerHTML=a,!f.hasChildNodes()||f.childNodes.length>1)throw d.error("HTML does not have a single root node",a),"HTML must have a single root node";return i(f.childNodes[0])},g=function(a,b){var c=b||e,d=c.createElement(a);return i(d)},h=function(a,b){var c=b||e,d=c.createTextNode(a);return i(d)},i=function(b){if(null===b||void 0===b)throw new c("Node cannot be null or undefined");return{dom:a.constant(b)}},j=function(a,c,d){return b.from(a.dom().elementFromPoint(c,d)).map(i)};return{fromHtml:f,fromTag:g,fromText:h,fromDom:i,fromPoint:j}}),g("20",[],function(){return{ATTRIBUTE:2,CDATA_SECTION:4,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,ELEMENT:1,TEXT:3,PROCESSING_INSTRUCTION:7,ENTITY_REFERENCE:5,ENTITY:6,NOTATION:12}}),g("27",["e","g","l","20","1q","23"],function(a,b,c,d,e,f){var g=d.ELEMENT,h=d.DOCUMENT,i=function(a,b){var c=a.dom();if(c.nodeType!==g)return!1;if(void 0!==c.matches)return c.matches(b);if(void 0!==c.msMatchesSelector)return c.msMatchesSelector(b);if(void 0!==c.webkitMatchesSelector)return c.webkitMatchesSelector(b);if(void 0!==c.mozMatchesSelector)return c.mozMatchesSelector(b);throw new e("Browser lacks native selectors")},j=function(a){return a.nodeType!==g&&a.nodeType!==h||0===a.childElementCount},k=function(b,d){var e=void 0===d?f:d.dom();return j(e)?[]:a.map(e.querySelectorAll(b),c.fromDom)},l=function(a,d){var e=void 0===d?f:d.dom();return j(e)?b.none():b.from(e.querySelector(a)).map(c.fromDom)};return{all:k,is:i,one:l}}),g("24",[],function(){var a=function(a,b){var c=[],d=function(a){return c.push(a),b(a)},e=b(a);do e=e.bind(d);while(e.isSome());return c};return{toArray:a}}),g("5t",[],function(){var a="undefined"!=typeof window?window:Function("return this;")();return a}),g("4y",["5t"],function(a){var b=function(b,c){for(var d=void 0!==c?c:a,e=0;e<b.length&&void 0!==d&&null!==d;++e)d=d[b[e]];return d},c=function(a,c){var d=a.split(".");return b(d,c)},d=function(a,b){return void 0!==a[b]&&null!==a[b]||(a[b]={}),a[b]},e=function(b,c){for(var e=void 0!==c?c:a,f=0;f<b.length;++f)e=d(e,b[f]);return e},f=function(a,b){var c=a.split(".");return e(c,b)};return{path:b,resolve:c,forge:e,namespace:f}}),g("3s",["4y"],function(a){var b=function(b,c){return a.resolve(b,c)},c=function(a,c){var d=b(a,c);if(void 0===d)throw a+" not available on this browser";return d};return{getOrDie:c}}),g("25",["3s"],function(a){var b=function(){var b=a.getOrDie("Node");return b},c=function(a,b,c){return 0!==(a.compareDocumentPosition(b)&c)},d=function(a,d){return c(a,d,b().DOCUMENT_POSITION_PRECEDING)},e=function(a,d){return c(a,d,b().DOCUMENT_POSITION_CONTAINED_BY)};return{documentPositionPreceding:d,documentPositionContainedBy:e}}),g("3b",[],function(){var a=function(a){var b,c=!1;return function(){return c||(c=!0,b=a.apply(null,arguments)),b}};return{cached:a}}),h("67",Number),g("5u",["e","67","1s"],function(a,b,c){var d=function(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(d.test(b))return d}},e=function(a,c){var e=d(a,c);if(!e)return{major:0,minor:0};var f=function(a){return b(c.replace(e,"$"+a))};return h(f(1),f(2))},f=function(a,b){var d=c(b).toLowerCase();return 0===a.length?g():e(a,d)},g=function(){return h(0,0)},h=function(a,b){return{major:a,minor:b}};return{nu:h,detect:f,unknown:g}}),g("4z",["f","5u"],function(a,b){var c="Edge",d="Chrome",e="IE",f="Opera",g="Firefox",h="Safari",i=function(a,b){return function(){return b===a}},j=function(){return k({current:void 0,version:b.unknown()})},k=function(a){var b=a.current,j=a.version;return{current:b,version:j,isEdge:i(c,b),isChrome:i(d,b),isIE:i(e,b),isOpera:i(f,b),isFirefox:i(g,b),isSafari:i(h,b)}};return{unknown:j,nu:k,edge:a.constant(c),chrome:a.constant(d),ie:a.constant(e),opera:a.constant(f),firefox:a.constant(g),safari:a.constant(h)}}),g("50",["f","5u"],function(a,b){var c="Windows",d="iOS",e="Android",f="Linux",g="OSX",h="Solaris",i="FreeBSD",j=function(a,b){return function(){return b===a}},k=function(){return l({current:void 0,version:b.unknown()})},l=function(a){var b=a.current,k=a.version;return{current:b,version:k,isWindows:j(c,b),isiOS:j(d,b),isAndroid:j(e,b),isOSX:j(g,b),isLinux:j(f,b),isSolaris:j(h,b),isFreeBSD:j(i,b)}};return{unknown:k,nu:l,windows:a.constant(c),ios:a.constant(d),android:a.constant(e),linux:a.constant(f),osx:a.constant(g),solaris:a.constant(h),freebsd:a.constant(i)}}),g("51",["f"],function(a){return function(b,c,d){var e=b.isiOS()&&/ipad/i.test(d)===!0,f=b.isiOS()&&!e,g=b.isAndroid()&&3===b.version.major,h=b.isAndroid()&&4===b.version.major,i=e||g||h&&/mobile/i.test(d)===!0,j=b.isiOS()||b.isAndroid(),k=j&&!i,l=c.isSafari()&&b.isiOS()&&/safari/i.test(d)===!1;return{isiPad:a.constant(e),isiPhone:a.constant(f),isTablet:a.constant(i),isPhone:a.constant(k),isTouch:a.constant(j),isAndroid:b.isAndroid,isiOS:b.isiOS,isWebView:a.constant(l)}}}),g("52",["e","5u","1s"],function(a,b,c){var d=function(b,d){var e=c(d).toLowerCase();return a.find(b,function(a){return a.search(e)})},e=function(a,c){return d(a,c).map(function(a){var d=b.detect(a.versionRegexes,c);return{current:a.name,version:d}})},f=function(a,c){return d(a,c).map(function(a){var d=b.detect(a.versionRegexes,c);return{current:a.name,version:d}})};return{detectBrowser:e,detectOs:f}}),g("54",[],function(){var a=function(a,b){return b+a},b=function(a,b){return a+b},c=function(a,b){return a.substring(b)},d=function(a,b){return a.substring(0,a.length-b)};return{addToStart:a,addToEnd:b,removeFromStart:c,removeFromEnd:d}}),g("55",["g","1q"],function(a,b){var c=function(a,b){return a.substr(0,b)},d=function(a,b){return a.substr(a.length-b,a.length)},e=function(b){return""===b?a.none():a.some(b.substr(0,1))},f=function(b){return""===b?a.none():a.some(b.substring(1))};return{first:c,last:d,head:e,tail:f}}),g("3x",["54","55","1q"],function(a,b,c){var d=function(a,b,c){if(""===b)return!0;if(a.length<b.length)return!1;var d=a.substr(c,c+b.length);return d===b},e=function(a,b){var c=function(a){var b=typeof a;return"string"===b||"number"===b};return a.replace(/\${([^{}]*)}/g,function(a,d){var e=b[d];return c(e)?e:a})},f=function(b,c){return l(b,c)?a.removeFromStart(b,c.length):b},g=function(b,c){return m(b,c)?a.removeFromEnd(b,c.length):b},h=function(b,c){return l(b,c)?b:a.addToStart(b,c)},i=function(b,c){return m(b,c)?b:a.addToEnd(b,c)},j=function(a,b){return a.indexOf(b)!==-1},k=function(a){return b.head(a).bind(function(c){return b.tail(a).map(function(a){return c.toUpperCase()+a})}).getOr(a)},l=function(a,b){return d(a,b,0)},m=function(a,b){return d(a,b,a.length-b.length)},n=function(a){return a.replace(/^\s+|\s+$/g,"")},o=function(a){return a.replace(/^\s+/g,"")},p=function(a){return a.replace(/\s+$/g,"")};return{supplant:e,startsWith:l,removeLeading:f,removeTrailing:g,ensureLeading:h,ensureTrailing:i,endsWith:m,contains:j,trim:n,lTrim:o,rTrim:p,capitalize:k}}),g("53",["f","3x"],function(a,b){var c=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,d=function(a){return function(c){return b.contains(c,a)}},e=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(a){var c=b.contains(a,"edge/")&&b.contains(a,"chrome")&&b.contains(a,"safari")&&b.contains(a,"applewebkit");return c}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,c],search:function(a){return b.contains(a,"chrome")&&!b.contains(a,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(a){return b.contains(a,"msie")||b.contains(a,"trident")}},{name:"Opera",versionRegexes:[c,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:d("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:d("firefox")},{name:"Safari",versionRegexes:[c,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(a){return(b.contains(a,"safari")||b.contains(a,"mobile/"))&&b.contains(a,"applewebkit")}}],f=[{name:"Windows",search:d("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(a){return b.contains(a,"iphone")||b.contains(a,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:d("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:d("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:d("linux"),versionRegexes:[]},{name:"Solaris",search:d("sunos"),versionRegexes:[]},{name:"FreeBSD",search:d("freebsd"),versionRegexes:[]}];return{browsers:a.constant(e),oses:a.constant(f)}}),g("3t",["4z","50","51","52","53"],function(a,b,c,d,e){var f=function(f){var g=e.browsers(),h=e.oses(),i=d.detectBrowser(g,f).fold(a.unknown,a.nu),j=d.detectOs(h,f).fold(b.unknown,b.nu),k=c(j,i,f);return{browser:i,os:j,deviceType:k}};return{detect:f}}),h("3u",navigator),g("26",["3b","3t","3u"],function(a,b,c){var d=a.cached(function(){var a=c.userAgent;return b.detect(a)});return{detect:d}}),g("1c",["e","f","25","26","27"],function(a,b,c,d,e){var f=function(a,b){return a.dom()===b.dom()},g=function(a,b){return a.dom().isEqualNode(b.dom())},h=function(c,d){return a.exists(d,b.curry(f,c))},i=function(a,b){var c=a.dom(),d=b.dom();return c!==d&&c.contains(d)},j=function(a,b){return c.documentPositionContainedBy(a.dom(),b.dom())},k=d.detect().browser,l=k.isIE()?j:i;return{eq:f,isEqualNode:g,member:h,contains:l,is:e.is}}),g("1m",["1z","e","f","g","1k","24","1c","l"],function(a,b,c,d,e,f,g,h){var i=function(a){return h.fromDom(a.dom().ownerDocument)},j=function(a){var b=i(a);return h.fromDom(b.dom().documentElement)},k=function(a){var b=a.dom(),c=b.ownerDocument.defaultView;return h.fromDom(c)},l=function(a){var b=a.dom();return d.from(b.parentNode).map(h.fromDom)},m=function(a){return l(a).bind(function(c){var d=u(c);return b.findIndex(d,function(b){return g.eq(a,b)})})},n=function(b,d){for(var e=a.isFunction(d)?d:c.constant(!1),f=b.dom(),g=[];null!==f.parentNode&&void 0!==f.parentNode;){var i=f.parentNode,j=h.fromDom(i);if(g.push(j),e(j)===!0)break;f=i}return g},o=function(a){var c=function(c){return b.filter(c,function(b){return!g.eq(a,b)})};return l(a).map(u).map(c).getOr([])},p=function(a){var b=a.dom();return d.from(b.offsetParent).map(h.fromDom)},q=function(a){var b=a.dom();return d.from(b.previousSibling).map(h.fromDom)},r=function(a){var b=a.dom();return d.from(b.nextSibling).map(h.fromDom)},s=function(a){return b.reverse(f.toArray(a,q))},t=function(a){return f.toArray(a,r)},u=function(a){var c=a.dom();return b.map(c.childNodes,h.fromDom)},v=function(a,b){var c=a.dom().childNodes;return d.from(c[b]).map(h.fromDom)},w=function(a){return v(a,0)},x=function(a){return v(a,a.dom().childNodes.length-1)},y=function(a){return a.dom().childNodes.length},z=function(a){return a.dom().hasChildNodes()},A=e.immutable("element","offset"),B=function(a,b){var c=u(a);return c.length>0&&b<c.length?A(c[b],0):A(a,b)};return{owner:i,defaultView:k,documentElement:j,parent:l,findIndex:m,parents:n,siblings:o,prevSibling:q,offsetParent:p,prevSiblings:s,nextSibling:r,nextSiblings:t,children:u,child:v,firstChild:w,lastChild:x,childNodesCount:y,hasChildNodes:z,leaf:B}}),g("1y",["e","f","27","1m"],function(a,b,c,d){var e=function(a,c){return f(a,c,b.constant(!0))},f=function(b,e,g){return a.bind(d.children(b),function(a){return c.is(a,e)?g(a)?[a]:[]:f(a,e,g)})};return{firstLayer:e,filterFirstLayer:f}}),g("n",["20"],function(a){var b=function(a){var b=a.dom().nodeName;return b.toLowerCase()},c=function(a){return a.dom().nodeType},d=function(a){return a.dom().nodeValue},e=function(a){return function(b){return c(b)===a}},f=function(d){return c(d)===a.COMMENT||"#comment"===b(d)},g=e(a.ELEMENT),h=e(a.TEXT),i=e(a.DOCUMENT);return{name:b,type:c,value:d,isElement:g,isText:h,isDocument:i,isComment:f}}),g("r",["1z","e","1t","n","1q","21"],function(a,b,c,d,e,f){var g=function(b,c,d){if(!(a.isString(d)||a.isBoolean(d)||a.isNumber(d)))throw f.error("Invalid call to Attr.set. Key ",c,":: Value ",d,":: Element ",b),new e("Attribute value was not simple");b.setAttribute(c,d+"")},h=function(a,b,c){g(a.dom(),b,c)},i=function(a,b){var d=a.dom();c.each(b,function(a,b){g(d,b,a)})},j=function(a,b){var c=a.dom().getAttribute(b);return null===c?void 0:c},k=function(a,b){var c=a.dom();return!(!c||!c.hasAttribute)&&c.hasAttribute(b)},l=function(a,b){a.dom().removeAttribute(b)},m=function(a){var b=a.dom().attributes;return void 0===b||null===b||0===b.length},n=function(a){return b.foldl(a.dom().attributes,function(a,b){return a[b.name]=b.value,a},{})},o=function(a,b,c){k(a,c)&&!k(b,c)&&h(b,c,j(a,c))},p=function(a,c,e){d.isElement(a)&&d.isElement(c)&&b.each(e,function(b){o(a,c,b)})};return{clone:n,set:h,setAll:i,get:j,has:k,remove:l,hasNone:m,transfer:p}}),g("35",["3b","l","n","23"],function(a,b,c,d){var e=function(a){var b=c.isText(a)?a.dom().parentNode:a.dom();return void 0!==b&&null!==b&&b.ownerDocument.body.contains(b)},f=a.cached(function(){return g(b.fromDom(d))}),g=function(a){var c=a.dom().body;if(null===c||void 0===c)throw"Body is not available yet";return b.fromDom(c)};return{body:f,getBody:g,inBody:e}}),g("29",["e","35","1m"],function(a,b,c){var d=function(a){return h(b.body(),a)},e=function(b,d,e){return a.filter(c.parents(b,e),d)},f=function(b,d){return a.filter(c.siblings(b),d)},g=function(b,d){return a.filter(c.children(b),d)},h=function(b,d){var e=[];return a.each(c.children(b),function(a){d(a)&&(e=e.concat([a])),e=e.concat(h(a,d))}),e};return{all:d,ancestors:e,siblings:f,children:g,descendants:h}}),g("y",["29","27"],function(a,b){var c=function(a){return b.all(a)},d=function(c,d,e){return a.ancestors(c,function(a){return b.is(a,d)},e)},e=function(c,d){return a.siblings(c,function(a){return b.is(a,d)})},f=function(c,d){return a.children(c,function(a){return b.is(a,d)})},g=function(a,c){return b.all(c,a)};return{all:c,ancestors:d,siblings:e,children:f,descendants:g}}),g("2d",["1z","g"],function(a,b){return function(c,d,e,f,g){return c(e,f)?b.some(e):a.isFunction(g)&&g(e)?b.none():d(e,f,g)}}),g("2a",["1z","e","f","g","35","1c","l","2d"],function(a,b,c,d,e,f,g,h){var i=function(a){return n(e.body(),a)},j=function(b,e,f){for(var h=b.dom(),i=a.isFunction(f)?f:c.constant(!1);h.parentNode;){h=h.parentNode;var j=g.fromDom(h);if(e(j))return d.some(j);if(i(j))break}return d.none()},k=function(a,b,c){var d=function(a){return b(a)};return h(d,j,a,b,c)},l=function(a,b){var c=a.dom();return c.parentNode?m(g.fromDom(c.parentNode),function(c){return!f.eq(a,c)&&b(c)}):d.none()},m=function(a,d){var e=b.find(a.dom().childNodes,c.compose(d,g.fromDom));return e.map(g.fromDom)},n=function(a,b){var c=function(a){for(var e=0;e<a.childNodes.length;e++){if(b(g.fromDom(a.childNodes[e])))return d.some(g.fromDom(a.childNodes[e]));var f=c(a.childNodes[e]);if(f.isSome())return f}return d.none()};return c(a.dom())};return{first:i,ancestor:j,closest:k,sibling:l,child:m,descendant:n}}),g("t",["2a","27","2d"],function(a,b,c){var d=function(a){return b.one(a)},e=function(c,d,e){return a.ancestor(c,function(a){return b.is(a,d)},e)},f=function(c,d){return a.sibling(c,function(a){return b.is(a,d)})},g=function(c,d){return a.child(c,function(a){return b.is(a,d)})},h=function(a,c){return b.one(c,a)},i=function(a,d,f){return c(b.is,e,a,d,f)};return{first:d,ancestor:e,sibling:f,child:g,descendant:h,closest:i}}),h("2e",parseInt),g("j",["e","f","g","2c","1y","r","n","y","t","27","1m","2e"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(d,e,f){var h=void 0!==f?f:b.constant(!1);if(h(e))return c.none();if(a.contains(d,g.name(e)))return c.some(e);var k=function(a){return j.is(a,"table")||h(a)};return i.ancestor(e,d.join(","),k)},n=function(a,b){return m(["td","th"],a,b)},o=function(a){return e.firstLayer(a,"th,td")},p=function(a,b){return m(["caption","tr","tbody","tfoot","thead"],a,b)},q=function(a,b){return k.parent(b).map(function(b){return h.children(b,a)})},r=b.curry(q,"th,td"),s=b.curry(q,"tr"),t=function(a){return i.descendant(a,"th,td")},u=function(a,b){return i.closest(a,"table",b)},v=function(a,b){return m(["tr"],a,b)},w=function(a){return e.firstLayer(a,"tr")},x=function(a,b){return l(f.get(a,b),10)},y=function(a,b,c){var e=x(a,b),f=x(a,c);return d.grid(e,f)};return{cell:n,firstCell:t,cells:o,neighbourCells:r,table:u,row:v,rows:w,notCell:p,neighbourRows:s,attr:x,grid:y}}),g("1w",["e","2c","j","r","n","1m"],function(a,b,c,d,e,f){var g=function(g){var h=c.rows(g);return a.map(h,function(g){var h=g,i=f.parent(h),j=i.bind(function(a){var b=e.name(a);return"tfoot"===b||"thead"===b||"tbody"===b?b:"tbody"}),k=a.map(c.cells(g),function(a){var c=d.has(a,"rowspan")?parseInt(d.get(a,"rowspan"),10):1,e=d.has(a,"colspan")?parseInt(d.get(a,"colspan"),10):1;return b.detail(a,c,e)});return b.rowdata(h,k,j)})},h=function(e,f){return a.map(e,function(e){var g=a.map(c.cells(e),function(a){var c=d.has(a,"rowspan")?parseInt(d.get(a,"rowspan"),10):1,e=d.has(a,"colspan")?parseInt(d.get(a,"colspan"),10):1;return b.detail(a,c,e)});return b.rowdata(e,g,f.section())})};return{fromTable:g,fromPastedRows:h}}),h("3v",Math),g("1x",["e","f","g","2c","3v"],function(a,b,c,d,e){var f=function(a,b){return a+","+b},g=function(a,b,d){var e=a.access()[f(b,d)];return void 0!==e?c.some(e):c.none()},h=function(a,b,d){var e=i(a,function(a){return d(b,a.element())});return e.length>0?c.some(e[0]):c.none()},i=function(b,c){var d=a.bind(b.all(),function(a){return a.cells()});return a.filter(d,c)},j=function(c){var g={},h=[],i=c.length,j=0;a.each(c,function(b,c){var i=[];a.each(b.cells(),function(a,b){for(var h=0;void 0!==g[f(c,h)];)h++;for(var k=d.extended(a.element(),a.rowspan(),a.colspan(),c,h),l=0;l<a.colspan();l++)for(var m=0;m<a.rowspan();m++){var n=c+m,o=h+l,p=f(n,o);g[p]=k,j=e.max(j,o+1)}i.push(k)}),h.push(d.rowdata(b.element(),i,b.section()))});var k=d.grid(i,j);return{grid:b.constant(k),access:b.constant(g),all:b.constant(h)}},k=function(b){var c=a.map(b.all(),function(a){return a.cells()});return a.flatten(c)};return{generate:j,getAt:g,findItem:h,filterItems:i,justCells:k}}),g("3w",[],function(){var a=function(a){return void 0!==a.style};return{isSupported:a}}),h("3y",window),g("22",["1z","e","1t","g","r","35","l","n","3w","3x","1q","21","3y"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(b,c,d){if(!a.isString(d))throw l.error("Invalid call to CSS.set. Property ",c,":: Value ",d,":: Element ",b),new k("CSS value must be a string: "+d);i.isSupported(b)&&b.style.setProperty(c,d)},o=function(a,b){i.isSupported(a)&&a.style.removeProperty(b)},p=function(a,b,c){var d=a.dom();n(d,b,c)},q=function(a,b){var d=a.dom();c.each(b,function(a,b){n(d,b,a)})},r=function(a,b){var d=a.dom();c.each(b,function(a,b){a.fold(function(){o(d,b)},function(a){n(d,b,a)})})},s=function(a,b){var c=a.dom(),d=m.getComputedStyle(c),e=d.getPropertyValue(b),g=""!==e||f.inBody(a)?e:t(c,b);return null===g?void 0:g},t=function(a,b){return i.isSupported(a)?a.style.getPropertyValue(b):""},u=function(a,b){var c=a.dom(),e=t(c,b);return d.from(e).filter(function(a){return a.length>0})},v=function(a){var b={},c=a.dom();if(i.isSupported(c))for(var d=0;d<c.style.length;d++){var e=c.style.item(d);b[e]=c.style[e]}return b},w=function(a,b,c){var d=g.fromTag(a);p(d,b,c);var e=u(d,b);return e.isSome()},x=function(a,b){var c=a.dom();o(c,b),e.has(a,"style")&&""===j.trim(e.get(a,"style"))&&e.remove(a,"style")},y=function(a,b){var c=e.get(a,"style"),d=b(a),f=void 0===c?e.remove:e.set;return f(a,"style",c),d},z=function(a,b){var c=a.dom(),d=b.dom();i.isSupported(c)&&i.isSupported(d)&&(d.style.cssText=c.style.cssText)},A=function(a){return a.dom().offsetWidth},B=function(a,b,c){u(a,c).each(function(a){u(b,c).isNone()&&p(b,c,a)})},C=function(a,c,d){h.isElement(a)&&h.isElement(c)&&b.each(d,function(b){B(a,c,b)})};return{copy:z,set:p,preserve:y,setAll:q,setOptions:r,remove:x,get:s,getRaw:u,getAllRaw:v,isValidValue:w,reflow:A,transfer:C}}),g("12",["1m"],function(a){var b=function(b,c){var d=a.parent(b);d.each(function(a){a.dom().insertBefore(c.dom(),b.dom())})},c=function(c,d){var f=a.nextSibling(c);f.fold(function(){var b=a.parent(c);b.each(function(a){e(a,d)})},function(a){b(a,d)})},d=function(b,c){var d=a.firstChild(b);d.fold(function(){e(b,c)},function(a){b.dom().insertBefore(c.dom(),a.dom())})},e=function(a,b){a.dom().appendChild(b.dom())},f=function(c,d,f){a.child(c,f).fold(function(){e(c,d)},function(a){b(a,d)})},g=function(a,c){b(a,c),e(c,a)};return{before:b,after:c,prepend:d,append:e,appendAt:f,wrap:g}}),g("28",["e","12"],function(a,b){var c=function(c,d){a.each(d,function(a){b.before(c,a)})},d=function(c,d){a.each(d,function(a,e){var f=0===e?c:d[e-1];b.after(f,a)})},e=function(c,d){a.each(d.slice().reverse(),function(a){b.prepend(c,a)})},f=function(c,d){a.each(d,function(a){b.append(c,a)})};return{before:c,after:d,prepend:e,append:f}}),g("13",["e","28","1m"],function(a,b,c){var d=function(b){b.dom().textContent="",a.each(c.children(b),function(a){e(a)})},e=function(a){var b=a.dom();null!==b.parentNode&&b.parentNode.removeChild(b)},f=function(a){var d=c.children(a);d.length>0&&b.before(a,d),e(a)};return{empty:d,remove:e,unwrap:f}}),g("h",["e","1t","1k","1w","1x","1y","r","22","l","12","13","27"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=c.immutable("minRow","minCol","maxRow","maxCol"),n=function(a,c){var d=a.grid().columns(),e=a.grid().rows(),f=e,g=d,h=0,i=0;return b.each(a.access(),function(a){if(c(a)){var b=a.row(),d=b+a.rowspan()-1,e=a.column(),j=e+a.colspan()-1;b<f?f=b:d>h&&(h=d),e<g?g=e:j>i&&(i=j)}}),m(f,g,h,i)},o=function(a,b,c){var d=a[c].element(),e=i.fromTag("td");j.append(e,i.fromTag("br"));var f=b?j.append:j.prepend;f(d,e)},p=function(a,b,c,d){for(var f=b.grid().columns(),g=b.grid().rows(),h=0;h<g;h++)for(var i=!1,j=0;j<f;j++)if(!(h<c.minRow()||h>c.maxRow()||j<c.minCol()||j>c.maxCol())){var k=e.getAt(b,h,j).filter(d).isNone();k?o(a,i,h):i=!0}},q=function(b,c){var d=a.filter(f.firstLayer(b,"tr"),function(a){return 0===a.dom().childElementCount});a.each(d,k.remove),c.minCol()!==c.maxCol()&&c.minRow()!==c.maxRow()||a.each(f.firstLayer(b,"th,td"),function(a){g.remove(a,"rowspan"),g.remove(a,"colspan")}),g.remove(b,"width"),g.remove(b,"height"),h.remove(b,"width"),h.remove(b,"height")},r=function(b,c){var g=function(a){return l.is(a.element(),c)},h=d.fromTable(b),i=e.generate(h),j=n(i,g),m="th:not("+c+"),td:not("+c+")",o=f.filterFirstLayer(b,"th,td",function(a){return l.is(a,m)});return a.each(o,k.remove),p(h,i,j,g),
2
- q(b,j),b};return{extract:r}}),g("k",["r","l","12","28","13","1m"],function(a,b,c,d,e,f){var g=function(a,c){return b.fromDom(a.dom().cloneNode(c))},h=function(a){return g(a,!1)},i=function(a){return g(a,!0)},j=function(c,d){var e=b.fromTag(d),f=a.clone(c);return a.setAll(e,f),e},k=function(a,b){var c=j(a,b),e=f.children(i(a));return d.append(c,e),c},l=function(a,b){var g=j(a,b);c.before(a,g);var h=f.children(a);return d.append(g,h),e.remove(a),g};return{shallow:h,shallowAs:j,deep:i,copy:k,mutate:l}}),g("3p",["26","g","1q"],function(a,b,c){return function(d,e){var f=function(a){if(!d(a))throw new c("Can only get "+e+" value of a "+e+" node");return j(a).getOr("")},g=function(a){try{return h(a)}catch(a){return b.none()}},h=function(a){return d(a)?b.from(a.dom().nodeValue):b.none()},i=a.detect().browser,j=i.isIE()&&10===i.version.major?g:h,k=function(a,b){if(!d(a))throw new c("Can only set raw "+e+" value of a "+e+" node");a.dom().nodeValue=b};return{get:f,getOption:j,set:k}}}),g("1l",["n","3p"],function(a,b){var c=b(a.isText,"text"),d=function(a){return c.get(a)},e=function(a){return c.getOption(a)},f=function(a,b){c.set(a,b)};return{get:d,getOption:e,set:f}}),g("2b",["e","n","1l","1m"],function(a,b,c,d){var e=function(a){return"img"===b.name(a)?1:c.getOption(a).fold(function(){return d.children(a).length},function(a){return a.length})},f=function(a,b){return e(a)===b},g=function(a,b){return 0===b},h="\xa0",i=function(a){return c.getOption(a).filter(function(a){return 0!==a.trim().length||a.indexOf(h)>-1}).isSome()},j=["img","br"],k=function(c){var d=i(c);return d||a.contains(j,b.name(c))};return{getEnd:e,isEnd:f,isStart:g,isCursorPosition:k}}),g("1d",["g","2a","1m","2b"],function(a,b,c,d){var e=function(a){return b.descendant(a,d.isCursorPosition)},f=function(a){return g(a,d.isCursorPosition)},g=function(b,d){var e=function(b){for(var f=c.children(b),g=f.length-1;g>=0;g--){var h=f[g];if(d(h))return a.some(h);var i=e(h);if(i.isSome())return i}return a.none()};return e(b)};return{first:e,last:f}}),g("i",["e","1t","1c","12","k","l","n","r","22","y","1m","1d"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(){var a=f.fromTag("td");return d.append(a,f.fromTag("br")),a},n=function(a,c,d){var f=e.copy(a,c);return b.each(d,function(a,b){null===a?h.remove(f,b):h.set(f,b,a)}),f},o=function(a){return a},p=function(a){return function(){return f.fromTag("tr",a.dom())}},q=function(b,f,g){var h=l.first(b);return h.map(function(h){var i=g.join(","),k=j.ancestors(h,i,function(a){return c.eq(a,b)});return a.foldr(k,function(a,b){var c=e.shallow(b);return d.append(a,c),c},f)}).getOr(f)},r=function(a,b,c){var e=function(b){var e=k.owner(b.element()),h=f.fromTag(g.name(b.element()),e.dom()),j=c.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),l=j.length>0?q(b.element(),h,j):h;return d.append(l,f.fromTag("br")),i.copy(b.element(),h),i.remove(h,"height"),1!==b.colspan()&&i.remove(b.element(),"width"),a(b.element(),h),h};return{row:p(b),cell:e,replace:n,gap:m}},s=function(a){return{row:p(a),cell:m,replace:o,gap:m}};return{cellOperations:r,paste:s}}),g("m",["e","l","1m","23"],function(a,b,c,d){var e=function(a,e){var f=e||d,g=f.createElement("div");return g.innerHTML=a,c.children(b.fromDom(g))},f=function(c,d){return a.map(c,function(a){return b.fromTag(a,d)})},g=function(c,d){return a.map(c,function(a){return b.fromText(a,d)})},h=function(c){return a.map(c,b.fromDom)};return{fromHtml:e,fromTags:f,fromText:g,fromDom:h}}),g("5v",[],function(){return["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"]}),g("56",["5v","e","f","r","1c","22","l","12","28","n","29","2a","13","y","t","1l","1m"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){return function(){var r=function(a){return g.fromDom(a.dom().cloneNode(!1))},s=function(c){return!!j.isElement(c)&&("body"===j.name(c)||b.contains(a,j.name(c)))},t=function(a){return!!j.isElement(a)&&b.contains(["br","img","hr","input"],j.name(a))},u=function(a,b){return a.dom().compareDocumentPosition(b.dom())},v=function(a,b){var c=d.clone(a);d.setAll(b,c)};return{up:c.constant({selector:o.ancestor,closest:o.closest,predicate:l.ancestor,all:q.parents}),down:c.constant({selector:n.descendants,predicate:k.descendants}),styles:c.constant({get:f.get,getRaw:f.getRaw,set:f.set,remove:f.remove}),attrs:c.constant({get:d.get,set:d.set,remove:d.remove,copyTo:v}),insert:c.constant({before:h.before,after:h.after,afterAll:i.after,append:h.append,appendAll:i.append,prepend:h.prepend,wrap:h.wrap}),remove:c.constant({unwrap:m.unwrap,remove:m.remove}),create:c.constant({nu:g.fromTag,clone:r,text:g.fromText}),query:c.constant({comparePosition:u,prevSibling:q.prevSibling,nextSibling:q.nextSibling}),property:c.constant({children:q.children,name:j.name,parent:q.parent,isText:j.isText,isComment:j.isComment,isElement:j.isElement,getText:p.get,setText:p.set,isBoundary:s,isEmptyTag:t}),eq:e.eq,is:e.is}}}),g("5w",["e","f","g","1k"],function(a,b,c,d){var e=d.immutable("left","right"),f=function(c,d,e){var f=c.property().children(d),g=a.findIndex(f,b.curry(c.eq,e));return g.map(function(a){return{before:b.constant(f.slice(0,a)),after:b.constant(f.slice(a+1))}})},g=function(a,b,c){return f(a,b,c).map(function(c){var d=a.create().clone(b);return a.insert().appendAll(d,c.after()),a.insert().after(b,d),e(b,d)})},h=function(a,b,c){return f(a,b,c).map(function(d){var f=a.create().clone(b);return a.insert().appendAll(f,d.before().concat([c])),a.insert().appendAll(b,d.after()),a.insert().before(b,f),e(f,b)})},i=function(a,b,e,f){var g=d.immutable("first","second","splits"),h=function(b,d,i){var j=g(b,c.none(),i);return e(b)?g(b,d,i):a.property().parent(b).bind(function(d){return f(a,d,b).map(function(a){var b=[{first:a.left,second:a.right}],f=e(d)?d:a.left();return h(f,c.some(a.right()),i.concat(b))}).getOr(j)})};return h(b,c.none(),[])};return{breakToLeft:h,breakToRight:g,breakPath:i}}),g("5x",["e","f","g"],function(a,b,c){var d=function(a,b,c,d){var e=c[0],f=c.slice(1);return d(a,b,e,f)},e=function(a,b,e){return e.length>0?d(a,b,e,f):c.none()},f=function(b,c,d,e){var f=c(b,d);return a.foldr(e,function(a,d){var e=c(b,d);return g(b,a,e)},f)},g=function(a,c,d){return c.bind(function(c){return d.filter(b.curry(a.eq,c))})};return{oneAll:e}}),g("5y",["e","f","g","3v"],function(a,b,c,d){var e=function(a,c){return b.curry(a.eq,c)},f=function(b,f,g,h){var i=b.property().children(f);if(b.eq(f,g[0]))return c.some([g[0]]);if(b.eq(f,h[0]))return c.some([h[0]]);var j=function(c){var d=a.reverse(c),g=a.findIndex(d,e(b,f)).getOr(-1),h=g<d.length-1?d[g+1]:d[g];return a.findIndex(i,e(b,h))},k=j(g),l=j(h);return k.bind(function(a){return l.map(function(b){var c=d.min(a,b),e=d.max(a,b);return i.slice(c,e+1)})})},g=function(c,d,f,g){var h=void 0!==g?g:b.constant(!1),i=[d].concat(c.up().all(d)),j=[f].concat(c.up().all(f)),k=function(b){var c=a.findIndex(b,h);return c.fold(function(){return b},function(a){return b.slice(0,a+1)})},l=k(i),m=k(j),n=a.find(l,function(b){return a.exists(m,e(c,b))});return{firstpath:b.constant(l),secondpath:b.constant(m),shared:b.constant(n)}},h=function(a,b,c){var d=g(a,b,c);return d.shared().bind(function(b){return f(a,b,d.firstpath(),d.secondpath())})};return{subset:h,ancestors:g}}),g("57",["5w","5x","5y"],function(a,b,c){var d=function(a,c,d){return b.oneAll(a,c,d)},e=function(a,b,d){return c.subset(a,b,d)},f=function(a,b,d,e){return c.ancestors(a,b,d,e)},g=function(b,c,d){return a.breakToLeft(b,c,d)},h=function(b,c,d){return a.breakToRight(b,c,d)},i=function(b,c,d,e){return a.breakPath(b,c,d,e)};return{sharedOne:d,subset:e,ancestors:f,breakToLeft:g,breakToRight:h,breakPath:i}}),g("3z",["56","57"],function(a,b){var c=a(),d=function(a,d){return b.sharedOne(c,function(b,c){return a(c)},d)},e=function(a,d){return b.subset(c,a,d)},f=function(a,d,e){return b.ancestors(c,a,d,e)},g=function(a,d){return b.breakToLeft(c,a,d)},h=function(a,d){return b.breakToRight(c,a,d)},i=function(a,d,e){return b.breakPath(c,a,d,function(a,b,c){return e(b,c)})};return{sharedOne:d,subset:e,ancestors:f,breakToLeft:g,breakToRight:h,breakPath:i}}),g("58",["f","g","1x"],function(a,b,c){var d=function(a,b){var c=b.column(),d=b.column()+b.colspan()-1,e=b.row(),f=b.row()+b.rowspan()-1;return c<=a.finishCol()&&d>=a.startCol()&&e<=a.finishRow()&&f>=a.startRow()},e=function(a,b){return b.column()>=a.startCol()&&b.column()+b.colspan()-1<=a.finishCol()&&b.row()>=a.startRow()&&b.row()+b.rowspan()-1<=a.finishRow()},f=function(d,f){for(var g=!0,h=a.curry(e,f),i=f.startRow();i<=f.finishRow();i++)for(var j=f.startCol();j<=f.finishCol();j++)g=g&&c.getAt(d,i,j).exists(h);return g?b.some(f):b.none()};return{inSelection:d,isWithin:e,isRectangular:f}}),g("41",["2c","1x","58","1c","3v"],function(a,b,c,d,e){var f=function(b,c){return a.bounds(e.min(b.row(),c.row()),e.min(b.column(),c.column()),e.max(b.row()+b.rowspan()-1,c.row()+c.rowspan()-1),e.max(b.column()+b.colspan()-1,c.column()+c.colspan()-1))},g=function(a,c,e){var g=b.findItem(a,c,d.eq),h=b.findItem(a,e,d.eq);return g.bind(function(a){return h.map(function(b){return f(a,b)})})},h=function(a,b,d){return g(a,b,d).bind(function(b){return c.isRectangular(a,b)})};return{getAnyBox:g,getBox:h}}),g("40",["e","f","1x","58","41","1c"],function(a,b,c,d,e,f){var g=function(a,b,d,e){return c.findItem(a,b,f.eq).bind(function(b){var f=d>0?b.row()+b.rowspan()-1:b.row(),g=e>0?b.column()+b.colspan()-1:b.column(),h=c.getAt(a,f+d,g+e);return h.map(function(a){return a.element()})})},h=function(f,g,h){return e.getAnyBox(f,g,h).map(function(e){var g=c.filterItems(f,b.curry(d.inSelection,e));return a.map(g,function(a){return a.element()})})},i=function(a,b){var d=function(a,b){return f.contains(b,a)};return c.findItem(a,b,d).bind(function(a){return a.element()})};return{moveBy:g,intercepts:h,parentCell:i}}),g("3q",["j","1w","1x","40","41","1c"],function(a,b,c,d,e,f){var g=function(b,c,e){return a.table(b).bind(function(a){var f=k(a);return d.moveBy(f,b,c,e)})},h=function(a,b,c){var e=k(a);return d.intercepts(e,b,c)},i=function(a,b,c,e,g){var h=k(a),i=f.eq(a,c)?b:d.parentCell(h,b),j=f.eq(a,g)?e:d.parentCell(h,e);return d.intercepts(h,i,j)},j=function(a,b,c){var d=k(a);return e.getBox(d,b,c)},k=function(a){var d=b.fromTable(a);return c.generate(d)};return{moveBy:g,intercepts:h,nestedIntercepts:i,getBox:j}}),g("3l",["e","f","g","3z","3q","1c","y","t","27"],function(a,b,c,d,e,f,g,h,i){var j=function(a,b){return h.ancestor(a,"table")},k=function(a,b,g){return f.eq(a,b)?c.some([a]):j(a,g).bind(function(c){return j(b,g).bind(function(i){return f.eq(c,i)?e.intercepts(c,a,b):f.contains(c,i)?e.nestedIntercepts(c,a,c,b,i):f.contains(i,c)?e.nestedIntercepts(i,a,c,b,i):d.ancestors(a,b).shared().bind(function(d){return h.closest(d,"table",g).bind(function(d){return e.nestedIntercepts(d,a,c,b,i)})})})})},l=function(a,b){var d=g.descendants(a,b);return d.length>0?c.some(d):c.none()},m=function(b,c){return a.find(b,function(a){return i.is(a,c)})},n=function(a,c,e){return h.descendant(a,c).bind(function(c){return h.descendant(a,e).bind(function(a){return d.sharedOne(j,[c,a]).map(function(d){return{first:b.constant(c),last:b.constant(a),table:b.constant(d)}})})})},o=function(a,c){return h.ancestor(a,"table").bind(function(d){return h.descendant(d,c).bind(function(c){return k(c,a).map(function(d){return{boxes:b.constant(d),start:b.constant(c),finish:b.constant(a)}})})})},p=function(a,b,c,d,f){return m(a,f).bind(function(a){return e.moveBy(a,b,c).bind(function(a){return o(a,d)})})};return{identify:k,retrieve:l,shiftSelection:p,getEdges:n}}),g("1o",["3l","g","3q","1c","t"],function(a,b,c,d,e){var f=function(b,c){return a.retrieve(b,c)},g=function(f,g,h){return a.getEdges(f,g,h).bind(function(a){var g=function(a){return d.eq(f,a)},h=e.ancestor(a.first(),"thead,tfoot,tbody,table",g),i=e.ancestor(a.last(),"thead,tfoot,tbody,table",g);return h.bind(function(e){return i.bind(function(f){return d.eq(e,f)?c.getBox(a.table(),a.first(),a.last()):b.none()})})})};return{retrieve:f,retrieveBox:g}}),g("9",["f"],function(a){var b="data-mce-selected",c="td["+b+"],th["+b+"]",d="["+b+"]",e="data-mce-first-selected",f="td["+e+"],th["+e+"]",g="data-mce-last-selected",h="td["+g+"],th["+g+"]";return{selected:a.constant(b),selectedSelector:a.constant(c),attributeSelector:a.constant(d),firstSelected:a.constant(e),firstSelectedSelector:a.constant(f),lastSelected:a.constant(g),lastSelectedSelector:a.constant(h)}}),g("2g",["e","1t","1z","1p","1q","21"],function(a,b,c,d,e,f){var g=function(g){if(!c.isArray(g))throw new e("cases must be an array");if(0===g.length)throw new e("there must be at least one case");var h=[],i={};return a.each(g,function(j,k){var l=b.keys(j);if(1!==l.length)throw new e("one and only one name per case");var m=l[0],n=j[m];if(void 0!==i[m])throw new e("duplicate key detected:"+m);if("cata"===m)throw new e("cannot have a case named cata (sorry)");if(!c.isArray(n))throw new e("case arguments must be an array");h.push(m),i[m]=function(){var c=arguments.length;if(c!==n.length)throw new e("Wrong number of arguments to case "+m+". Expected "+n.length+" ("+n+"), got "+c);for(var i=new d(c),j=0;j<i.length;j++)i[j]=arguments[j];var l=function(c){var d=b.keys(c);if(h.length!==d.length)throw new e("Wrong number of arguments to match. Expected: "+h.join(",")+"\nActual: "+d.join(","));var f=a.forall(h,function(b){return a.contains(d,b)});if(!f)throw new e("Not all branches were specified when using match. Specified: "+d.join(", ")+"\nRequired: "+h.join(", "));return c[m].apply(null,i)};return{fold:function(){if(arguments.length!==g.length)throw new e("Wrong number of arguments to fold. Expected "+g.length+", got "+arguments.length);var a=arguments[k];return a.apply(null,i)},match:l,log:function(a){f.log(a,{constructors:h,constructor:m,params:i})}}}}),i};return{generate:g}}),g("p",["2g"],function(a){var b=a.generate([{none:[]},{multiple:["elements"]},{single:["selection"]}]),c=function(a,b,c,d){return a.fold(b,c,d)};return{cata:c,none:b.none,multiple:b.multiple,single:b.single}}),g("2f",["1o","e","f","g","r","9","p"],function(a,b,c,d,e,f,g){var h=function(a,b){return g.cata(b.get(),c.constant([]),c.identity,c.constant([a]))},i=function(a,c){var f=function(a){return e.has(a,"rowspan")&&parseInt(e.get(a,"rowspan"),10)>1||e.has(a,"colspan")&&parseInt(e.get(a,"colspan"),10)>1},g=h(a,c);return g.length>0&&b.forall(g,f)?d.some(g):d.none()},j=function(b,e){return g.cata(e.get(),d.none,function(e,g){return 0===e.length?d.none():a.retrieveBox(b,f.firstSelectedSelector(),f.lastSelectedSelector()).bind(function(a){return e.length>1?d.some({bounds:c.constant(a),cells:c.constant(e)}):d.none()})},d.none)};return{mergable:j,unmergable:i,selection:h}}),g("o",["f","g","1k","2f"],function(a,b,c,d){var e=function(c){return{element:a.constant(c),mergable:b.none,unmergable:b.none,selection:a.constant([c])}},f=function(b,c,e){return{element:a.constant(e),mergable:a.constant(d.mergable(c,b)),unmergable:a.constant(d.unmergable(e,b)),selection:a.constant(d.selection(e,b))}},g=function(a){return e(a)},h=c.immutable("element","clipboard","generators"),i=function(c,e,f,g,h){return{element:a.constant(f),mergable:b.none,unmergable:b.none,selection:a.constant(d.selection(f,c)),clipboard:a.constant(g),generators:a.constant(h)}};return{noMenu:e,forMenu:f,notCell:g,paste:h,pasteRows:i}}),g("2",["e","f","g","h","i","j","k","l","m","n","o","9","p"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(a){return f.table(a[0]).map(g.deep).map(function(a){return[d.extract(a,l.attributeSelector())]})},o=function(a,b){return a.selection.serializer.serialize(b.dom(),{})},p=function(d,g,l,p){d.on("BeforeGetContent",function(c){var e=function(b){c.preventDefault(),n(b).each(function(b){c.content=a.map(b,function(a){return o(d,a)}).join("")})};c.selection===!0&&m.cata(g.get(),b.noop,e,b.noop)}),d.on("BeforeSetContent",function(b){if(b.selection===!0&&b.paste===!0){var g=c.from(d.dom.getParent(d.selection.getStart(),"th,td"));g.each(function(c){var g=h.fromDom(c),m=f.table(g);m.bind(function(c){var f=a.filter(i.fromHtml(b.content),function(a){return"meta"!==j.name(a)});if(1===f.length&&"table"===j.name(f[0])){b.preventDefault();var m=h.fromDom(d.getDoc()),n=e.paste(m),o=k.paste(g,f[0],n);l.pasteCells(c,o).each(function(a){d.selection.setRng(a),d.focus(),p.clear(c)})}})})}})};return{registerEvents:p}}),g("2h",["r","22","l","12","28"],function(a,b,c,d,e){var f=function(){return c.fromTag("table")},g=function(){return c.fromTag("tbody")},h=function(){return c.fromTag("tr")},i=function(){return c.fromTag("th")},j=function(){return c.fromTag("td")},k=function(k,l,m,n){var o=f();b.setAll(o,{"border-collapse":"collapse",width:"100%"}),a.set(o,"border","1");var p=g();d.append(o,p);for(var q=[],r=0;r<k;r++){for(var s=h(),t=0;t<l;t++){var u=r<m||t<n?i():j();t<n&&a.set(u,"scope","row"),r<m&&a.set(u,"scope","col"),d.append(u,c.fromTag("br")),b.set(u,"width",100/l+"%"),d.append(s,u)}q.push(s)}return e.append(p,q),o};return{render:k}}),g("q",["2h"],function(a){return{render:a.render}}),g("s",["l","m","12","28","13","1m"],function(a,b,c,d,e,f){var g=function(a){return a.dom().innerHTML},h=function(g,h){var i=f.owner(g),j=i.dom(),k=a.fromDom(j.createDocumentFragment()),l=b.fromHtml(h,j);d.append(k,l),e.empty(g),c.append(g,k)},i=function(b){var d=a.fromTag("div"),e=a.fromDom(b.dom().cloneNode(!0));return c.append(d,e),g(d)};return{get:g,set:h,getOuter:i}}),g("3",["f","q","l","r","s","t"],function(a,b,c,d,e,f){var g=function(a,b){a.selection.select(b.dom(),!0),a.selection.collapse(!0)},h=function(b,c){f.descendant(c,"td,th").each(a.curry(g,b))},i=function(a,f,g){var i,j=b.render(g,f,0,0);d.set(j,"id","__mce");var k=e.getOuter(j);return a.insertContent(k),i=a.dom.get("__mce"),a.dom.setAttrib(i,"id",null),a.$("tr",i).each(function(b,c){a.fire("newrow",{node:c}),a.$("th,td",c).each(function(b,c){a.fire("newcell",{node:c})})}),a.dom.setAttribs(i,a.settings.table_default_attributes||{}),a.dom.setStyles(i,a.settings.table_default_styles||{}),h(a,c.fromDom(i)),i};return{insert:i}}),g("59",["1z","e","22","3w"],function(a,b,c,d){return function(e,f){var g=function(b,c){if(!a.isNumber(c)&&!c.match(/^[0-9]+$/))throw e+".set accepts only positive integer values. Value was "+c;var f=b.dom();d.isSupported(f)&&(f.style[e]=c+"px")},h=function(a){var b=f(a);if(b<=0||null===b){var d=c.get(a,e);return parseFloat(d)||0}return b},i=h,j=function(a,d){return b.foldl(d,function(b,d){var e=c.get(a,d),f=void 0===e?0:parseInt(e,10);return isNaN(f)?b:b+f},0)},k=function(a,b,c){var d=j(a,c),e=b>d?b-d:0;return e};return{set:g,get:h,getOuter:i,aggregate:j,max:k}}}),g("43",["35","22","59"],function(a,b,c){var d=c("height",function(b){return a.inBody(b)?b.dom().getBoundingClientRect().height:b.dom().offsetHeight}),e=function(a,b){d.set(a,b)},f=function(a){return d.get(a)},g=function(a){return d.getOuter(a)},h=function(a,c){var e=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],f=d.max(a,c,e);b.set(a,"max-height",f+"px")};return{set:e,get:f,getOuter:g,setMax:h}}),g("44",["22","59"],function(a,b){var c=b("width",function(a){return a.dom().offsetWidth}),d=function(a,b){c.set(a,b)},e=function(a){return c.get(a)},f=function(a){return c.getOuter(a)},g=function(b,d){var e=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],f=c.max(b,d,e);a.set(b,"max-width",f+"px")};return{set:d,get:e,getOuter:f,setMax:g}}),g("42",["26","22","43","44"],function(a,b,c,d){var e=a.detect(),f=function(){return e.browser.isIE()||e.browser.isEdge()},g=function(a,b){var c=parseFloat(a);return isNaN(c)?b:c},h=function(a,c,d){return g(b.get(a,c),d)},i=function(a){var c=h(a,"padding-top",0),d=h(a,"padding-bottom",0),e=h(a,"border-top-width",0),f=h(a,"border-bottom-width",0),g=a.dom().getBoundingClientRect().height,i=b.get(a,"box-sizing"),j=e+f;return"border-box"===i?g:g-c-d-j},j=function(a){return h(a,"width",d.get(a))},k=function(a){return f()?i(a):h(a,"height",c.get(a))};return{getWidth:j,getHeight:k}}),g("2i",["f","g","3x","j","42","n","r","22","43","44","3v","2e"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=/(\d+(\.\d+)?)(\w|%)*/,n=/(\d+(\.\d+)?)%/,o=/(\d+(\.\d+)?)px|em/,p=function(a,b){h.set(a,"width",b+"px")},q=function(a,b){h.set(a,"width",b+"%")},r=function(a,b){h.set(a,"height",b+"px")},s=function(a){return h.getRaw(a,"height").getOrThunk(function(){return e.getHeight(a)+"px"})},t=function(a,b,c,e){var f=d.table(a).map(function(a){var d=c(a);return k.floor(b/100*d)}).getOr(b);return e(a,f),f},u=function(a,b,d,e){var g=l(a,10);return c.endsWith(a,"%")&&"table"!==f.name(b)?t(b,g,d,e):g},v=function(a){var b=s(a);return b?u(b,a,i.get,r):i.get(a)},w=function(a,b,c){var d=c(a),e=x(a,b);return d/e},x=function(a,b){return g.has(a,b)?l(g.get(a,b),10):1},y=function(a){var c=h.getRaw(a,"width");return c.fold(function(){return b.from(g.get(a,"width"))},function(a){return b.some(a)})},z=function(a,b){return a/b.pixelWidth()*100},A=function(a,b,c){if(n.test(b)){var d=n.exec(b);return parseFloat(d[1],10)}var e=j.get(a),f=l(e,10);return z(f,c)},B=function(a,b){var c=y(a);return c.fold(function(){var c=j.get(a),d=l(c,10);return z(d,b)},function(c){return A(a,c,b)})},C=function(a,b){return a/100*b.pixelWidth()},D=function(a,b,c){if(o.test(b)){var d=o.exec(b);return l(d[1],10)}if(n.test(b)){var e=n.exec(b),f=parseFloat(e[1],10);return C(f,c)}var g=j.get(a);return l(g,10)},E=function(a,b){var c=y(a);return c.fold(function(){var b=j.get(a),c=l(b,10);return c},function(c){return D(a,c,b)})},F=function(a){return w(a,"rowspan",v)},G=function(c){var d=y(c);return d.bind(function(c){if(m.test(c)){var d=m.exec(c);return b.some({width:a.constant(d[1]),unit:a.constant(d[3])})}return b.none()})},H=function(a,b,c){h.set(a,"width",b+c)};return{percentageBasedSizeRegex:a.constant(n),pixelBasedSizeRegex:a.constant(o),setPixelWidth:p,setPercentageWidth:q,setHeight:r,getPixelWidth:E,getPercentageWidth:B,getGenericWidth:G,setGenericWidth:H,getHeight:F,getRawWidth:y}}),g("u",["2i"],function(a){var b=function(b,c){var d=a.getGenericWidth(b);d.each(function(d){var e=d.width()/2;a.setGenericWidth(b,e,d.unit()),a.setGenericWidth(c,e,d.unit())})};return{halve:b}}),g("30",["f"],function(a){var b=function(c,d){var e=function(a,e){return b(c+a,d+e)};return{left:a.constant(c),top:a.constant(d),translate:e}};return b}),g("45",["f","1c","l","n","2a","23"],function(a,b,c,d,e,f){var g=function(d,g){var h=g||c.fromDom(f.documentElement);return e.ancestor(d,a.curry(b.eq,h)).isSome()},h=function(a){var b=a.dom();return b===b.window?a:d.isDocument(a)?b.defaultView||b.parentWindow:null};return{attached:g,windowOf:h}}),g("2z",["30","45","l"],function(a,b,c){var d=function(b){var c=b.getBoundingClientRect();return a(c.left,c.top)},e=function(a,b){return void 0!==a?a:void 0!==b?b:0},f=function(a){var d=a.dom().ownerDocument,f=d.body,g=b.windowOf(c.fromDom(d)),i=d.documentElement,j=e(g.pageYOffset,i.scrollTop),k=e(g.pageXOffset,i.scrollLeft),l=e(i.clientTop,f.clientTop),m=e(i.clientLeft,f.clientLeft);return h(a).translate(k-m,j-l)},g=function(b){var c=b.dom();return a(c.offsetLeft,c.offsetTop)},h=function(e){var f=e.dom(),g=f.ownerDocument,h=g.body,i=c.fromDom(g.documentElement);return h===f?a(h.offsetLeft,h.offsetTop):b.attached(e,i)?d(f):a(0,0)};return{absolute:f,relative:g,viewport:h}}),g("34",["e","f","1k","43","2z","44"],function(a,b,c,d,e,f){var g=c.immutable("row","y"),h=c.immutable("col","x"),i=function(a){var b=e.absolute(a);return b.left()+f.getOuter(a)},j=function(a){return e.absolute(a).left()},k=function(a,b){return h(a,j(b))},l=function(a,b){return h(a,i(b))},m=function(a){return e.absolute(a).top()},n=function(a,b){return g(a,m(b))},o=function(a,b){return g(a,m(b)+d.getOuter(b))},p=function(b,c,d){if(0===d.length)return[];var e=a.map(d.slice(1),function(a,c){return a.map(function(a){return b(c,a)})}),f=d[d.length-1].map(function(a){return c(d.length-1,a)});return e.concat([f])},q=function(a,b){return-a},r={delta:b.identity,positions:b.curry(p,n,o),edge:m},s={delta:b.identity,edge:j,positions:b.curry(p,k,l)},t={delta:q,edge:i,positions:b.curry(p,l,k)};return{height:r,rtl:t,ltr:s}}),g("2j",["34"],function(a){return{ltr:a.ltr,rtl:a.rtl}}),g("v",["2j"],function(a){return function(b){var c=function(c){return b(c).isRtl()?a.rtl:a.ltr},d=function(a,b){return c(b).delta(a,b)},e=function(a,b){return c(b).positions(a,b)},f=function(a){return c(a).edge(a)};return{delta:d,edge:f,positions:e}}}),g("w",["1w","1x"],function(a,b){var c=function(c){var d=a.fromTable(c),e=b.generate(d);return e.grid()};return{getGridSize:c}}),g("46",[],function(){var a=function(b){var c=b,d=function(){return c},e=function(a){c=a},f=function(){return a(d())};return{get:d,set:e,clone:f}};return a}),g("47",["e","f","1t","1z","3r","1q"],function(a,b,c,d,e,f){var g=function(a,b){return h(a,b,{validate:d.isFunction,label:"function"})},h=function(b,d,g){if(0===d.length)throw new f("You must specify at least one required field.");return e.validateStrArr("required",d),e.checkDupes(d),function(f){var h=c.keys(f),i=a.forall(d,function(b){return a.contains(h,b)});i||e.reqMessage(d,h),b(d,h);var j=a.filter(d,function(a){return!g.validate(f[a],a)});return j.length>0&&e.invalidTypeMessage(j,g.label),f}},i=function(b,c){var d=a.filter(c,function(c){return!a.contains(b,c)});d.length>0&&e.unsuppMessage(d)},j=b.noop;return{exactly:b.curry(g,i),ensure:b.curry(g,j),ensureWith:b.curry(h,j)}}),g("2k",["e","f","g","46","47","r","22","2e"],function(a,b,c,d,e,f,g,h){var i=function(a){var c=f.has(a,"colspan")?h(f.get(a,"colspan"),10):1,d=f.has(a,"rowspan")?h(f.get(a,"rowspan"),10):1;return{element:b.constant(a),colspan:b.constant(c),rowspan:b.constant(d)}},j=function(a,b){m(a);var e=d(c.none()),f=void 0!==b?b:i,g=function(b){return a.cell(b)},h=function(a){var b=f(a);return g(b)},j=function(a){var b=h(a);return e.get().isNone()&&e.set(c.some(b)),k=c.some({item:a,replacement:b}),b},k=c.none(),l=function(a,b){return k.fold(function(){return j(a)},function(c){return b(a,c.item)?c.replacement:j(a)})};return{getOrInit:l,cursor:e.get}},k=function(b,e){return function(f){var g=d(c.none());m(f);var h=[],i=function(b,c){return a.find(h,function(a){return c(a.item,b)})},j=function(a){var d=f.replace(a,e,{scope:b});return h.push({item:a,sub:d}),g.get().isNone()&&g.set(c.some(d)),d},k=function(a,b){return i(a,b).fold(function(){return j(a)},function(c){return b(a,c.item)?c.sub:j(a)})};return{replaceOrInit:k,cursor:g.get}}},l=function(a){m(a);var e=d(c.none()),f=function(d){return e.get().isNone()&&e.set(c.some(d)),function(){var c=a.cell({element:b.constant(d),colspan:b.constant(1),rowspan:b.constant(1)});return g.remove(c,"width"),g.remove(d,"width"),c}};return{combine:f,cursor:e.get}},m=e.exactly(["cell","row","replace","gap"]);return{modification:j,transform:k,merging:l}}),g("5a",["e"],function(a){var b=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],c=function(b,c){var d=b.property().name(c);return a.contains(["ol","ul"],d)},d=function(c,d){var e=c.property().name(d);return a.contains(b,e)},e=function(b,c){var d=b.property().name(c);return a.contains(["address","pre","p","h1","h2","h3","h4","h5","h6"],d)},f=function(b,c){var d=b.property().name(c);return a.contains(["h1","h2","h3","h4","h5","h6"],d)},g=function(b,c){return a.contains(["div","li","td","th","blockquote","body","caption"],b.property().name(c))},h=function(b,c){return a.contains(["br","img","hr","input"],b.property().name(c))},i=function(a,b){return"iframe"===a.property().name(b)},j=function(a,b){return!(d(a,b)||h(a,b))&&"li"!==a.property().name(b)};return{isBlock:d,isList:c,isFormatting:e,isHeading:f,isContainer:g,isEmptyTag:h,isFrame:i,isInline:j}}),g("48",["56","5a"],function(a,b){var c=a(),d=function(a){return b.isBlock(c,a)},e=function(a){return b.isList(c,a)},f=function(a){return b.isFormatting(c,a)},g=function(a){return b.isHeading(c,a)},h=function(a){return b.isContainer(c,a)},i=function(a){return b.isEmptyTag(c,a)},j=function(a){return b.isFrame(c,a)},k=function(a){return b.isInline(c,a)};return{isBlock:d,isList:e,isFormatting:f,isHeading:g,isContainer:h,isEmptyTag:i,isFrame:j,isInline:k}}),g("2l",["e","48","1c","28","13","l","n","1l","2a","1m","1d"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(l){var m=function(a){return"br"===g.name(a)},n=function(b){return a.forall(b,function(a){return m(a)||g.isText(a)&&0===h.get(a).trim().length})},o=function(a){return"li"===g.name(a)||i.ancestor(a,b.isList).isSome()},p=function(a){return j.nextSibling(a).map(function(a){return!!b.isBlock(a)||(b.isEmptyTag(a)?"img"!==g.name(a):void 0)}).getOr(!1)},q=function(a){return k.last(a).bind(function(d){var e=p(d);return j.parent(d).map(function(g){return e===!0||o(g)||m(d)||b.isBlock(g)&&!c.eq(a,g)?[]:[f.fromTag("br")]})}).getOr([])},r=function(){var b=a.bind(l,function(a){var b=j.children(a);return n(b)?[]:b.concat(q(a))});return 0===b.length?[f.fromTag("br")]:b},s=r();e.empty(l[0]),d.append(l[0],s)};return{merge:l}}),g("2m",["e","2c"],function(a,b){var c=function(a,b,c){var d=a.cells(),f=d.slice(0,b),g=d.slice(b),h=f.concat([c]).concat(g);return e(a,h)},d=function(a,b,c){var d=a.cells();d[b]=c},e=function(a,c){return b.rowcells(c,a.section())},f=function(c,d){var e=c.cells(),f=a.map(e,d);return b.rowcells(f,c.section())},g=function(a,b){return a.cells()[b]},h=function(a,b){return g(a,b).element()},i=function(a){return a.cells().length};return{addCell:c,setCells:e,mutateCell:d,getCell:g,getCellElement:h,mapCells:f,cellLength:i}}),g("49",["1z","1p","1q"],function(a,b,c){var d=function(a,b){return b},e=function(b,c){var d=a.isObject(b)&&a.isObject(c);return d?g(b,c):c},f=function(a){return function(){for(var d=new b(arguments.length),e=0;e<d.length;e++)d[e]=arguments[e];if(0===d.length)throw new c("Can't merge zero objects");for(var f={},g=0;g<d.length;g++){var h=d[g];for(var i in h)h.hasOwnProperty(i)&&(f[i]=a(f[i],h[i]))}return f}},g=f(e),h=f(d);return{deepMerge:g,merge:h}}),g("3m",["g"],function(a){var b=function(a){for(var b=[],c=function(a){b.push(a)},d=0;d<a.length;d++)a[d].each(c);return b},c=function(b,c){for(var d=0;d<b.length;d++){var e=c(b[d],d);if(e.isSome())return e}return a.none()},d=function(b,c){for(var d=[],e=0;e<b.length;e++){var f=b[e];if(!f.isSome())return a.none();d.push(f.getOrDie())}return a.some(c.apply(null,d))};return{cat:b,findMap:c,liftN:d}}),g("4a",["e","f","2m"],function(a,b,c){var d=function(b,d){return a.map(b,function(a){return c.getCell(a,d)})},e=function(a,b){return a[b]},f=function(b,c){if(0===b.length)return 0;var d=b[0],e=a.findIndex(b,function(a){return!c(d.element(),a.element())});return e.fold(function(){return b.length},function(a){return a})},g=function(a,c,g,h){var i=e(a,c).cells().slice(g),j=f(i,h),k=d(a,g).slice(c),l=f(k,h);return{colspan:b.constant(j),rowspan:b.constant(l)}};return{subgrid:g}}),g("2p",["e","2c","4a","1x"],function(a,b,c,d){var e=function(d,e){var f=a.map(d,function(b,c){return a.map(b.cells(),function(a,b){return!1})}),g=function(a,b,c,d){for(var e=a;e<a+c;e++)for(var g=b;g<b+d;g++)f[e][g]=!0};return a.map(d,function(h,i){var j=a.bind(h.cells(),function(a,h){if(f[i][h]===!1){var j=c.subgrid(d,i,h,e);return g(i,h,j.rowspan(),j.colspan()),[b.detailnew(a.element(),j.rowspan(),j.colspan(),a.isNew())]}return[]});return b.rowdetails(j,h.section())})},f=function(a,c,e){for(var f=[],g=0;g<a.grid().rows();g++){for(var h=[],i=0;i<a.grid().columns();i++){var j=d.getAt(a,g,i).map(function(a){return b.elementnew(a.element(),e)}).getOrThunk(function(){return b.elementnew(c.gap(),!0)});h.push(j)}var k=b.rowcells(h,a.all()[g].section());f.push(k)}return f};return{toDetails:e,toGrid:f}}),g("2v",["e","f","r","l","12","28","13","k","t","1m"],function(a,b,c,d,e,f,g,h,i,j){
3
- var k=function(a,b,d,e){d===e?c.remove(a,b):c.set(a,b,d)},l=function(c,h){var l=[],m=[],n=function(b,h){var n=i.child(c,h).getOrThunk(function(){var a=d.fromTag(h,j.owner(c).dom());return e.append(c,a),a});g.empty(n);var o=a.map(b,function(b){b.isNew()&&l.push(b.element());var c=b.element();return g.empty(c),a.each(b.cells(),function(a){a.isNew()&&m.push(a.element()),k(a.element(),"colspan",a.colspan(),1),k(a.element(),"rowspan",a.rowspan(),1),e.append(c,a.element())}),c});f.append(n,o)},o=function(a){i.child(c,a).bind(g.remove)},p=function(a,b){a.length>0?n(a,b):o(b)},q=[],r=[],s=[];return a.each(h,function(a){switch(a.section()){case"thead":q.push(a);break;case"tbody":r.push(a);break;case"tfoot":s.push(a)}}),p(q,"thead"),p(r,"tbody"),p(s,"tfoot"),{newRows:b.constant(l),newCells:b.constant(m)}},m=function(b){var c=a.map(b,function(b){var c=h.shallow(b.element());return a.each(b.cells(),function(a){var b=h.deep(a.element());k(b,"colspan",a.colspan(),1),k(b,"rowspan",a.rowspan(),1),e.append(c,b)}),c});return c};return{render:l,copy:m}}),g("5g",["e","g","3m","3v"],function(a,b,c,d){var e=function(a,b){for(var c=[],d=0;d<a;d++)c.push(b(d));return c},f=function(a,b){for(var c=[],d=a;d<b;d++)c.push(d);return c},g=function(b,c){var d=[];return a.each(b,function(a,e){e<b.length-1&&!c(a,b[e+1])?d.push(a):e===b.length-1&&d.push(a)}),d},h=function(e,f){if(f<0||f>=e.length-1)return b.none();var g=e[f].fold(function(){var b=a.reverse(e.slice(0,f));return c.findMap(b,function(a,b){return a.map(function(a){return{value:a,delta:b+1}})})},function(a){return b.some({value:a,delta:0})}),h=e[f+1].fold(function(){var a=e.slice(f+1);return c.findMap(a,function(a,b){return a.map(function(a){return{value:a,delta:b+1}})})},function(a){return b.some({value:a,delta:1})});return g.bind(function(a){return h.map(function(b){var c=b.delta+a.delta;return d.abs(b.value-a.value)/c})})};return{repeat:e,range:f,unique:g,deduce:h}}),g("5b",["e","f","g","1x","5g"],function(a,b,c,d,e){var f=function(c){var f=c.grid(),h=e.range(0,f.columns()),i=e.range(0,f.rows());return a.map(h,function(e){var f=function(){return a.bind(i,function(a){return d.getAt(c,a,e).filter(function(a){return a.column()===e}).fold(b.constant([]),function(a){return[a]})})},h=function(a){return 1===a.colspan()},j=function(){return d.getAt(c,0,e)};return g(f,h,j)})},g=function(b,d,e){var f=b(),g=a.find(f,d),h=g.orThunk(function(){return c.from(f[0]).orThunk(e)});return h.map(function(a){return a.element()})},h=function(c){var f=c.grid(),h=e.range(0,f.rows()),i=e.range(0,f.columns());return a.map(h,function(e){var f=function(){return a.bind(i,function(a){return d.getAt(c,e,a).filter(function(a){return a.row()===e}).fold(b.constant([]),function(a){return[a]})})},h=function(a){return 1===a.rowspan()},j=function(){return d.getAt(c,e,0)};return g(f,h,j)})};return{columns:f,rows:h}}),g("5c",["r","22","l"],function(a,b,c){var d=function(d,e,f,g,h){var i=c.fromTag("div");return b.setAll(i,{position:"absolute",left:e-g/2+"px",top:f+"px",height:h+"px",width:g+"px"}),a.set(i,"data-column",d),i},e=function(d,e,f,g,h){var i=c.fromTag("div");return b.setAll(i,{position:"absolute",left:e+"px",top:f-h/2+"px",height:h+"px",width:g+"px"}),a.set(i,"data-row",d),i};return{col:d,row:e}}),g("5d",[],function(){var a=function(a){var b=a.replace(/\./g,"-"),c=function(a){return b+"-"+a};return{resolve:c}};return{css:a}}),g("4k",["5d"],function(a){var b=a.css("ephox-snooker");return{resolve:b.resolve}}),g("4m",[],function(){return function(a,b,c){var d=c||!1,e=function(){b(),d=!0},f=function(){a(),d=!1},g=function(){var a=d?f:e;a()},h=function(){return d};return{on:e,off:f,toggle:g,isOn:h}}}),g("5e",["e","r"],function(a,b){var c=function(a,c){var d=b.get(a,c);return void 0===d||""===d?[]:d.split(" ")},d=function(a,d,e){var f=c(a,d),g=f.concat([e]);b.set(a,d,g.join(" "))},e=function(d,e,f){var g=a.filter(c(d,e),function(a){return a!==f});g.length>0?b.set(d,e,g.join(" ")):b.remove(d,e)};return{read:c,add:d,remove:e}}),g("4n",["e","5e"],function(a,b){var c=function(a){return void 0!==a.dom().classList},d=function(a){return b.read(a,"class")},e=function(a,c){return b.add(a,"class",c)},f=function(a,c){return b.remove(a,"class",c)},g=function(b,c){a.contains(d(b),c)?f(b,c):e(b,c)};return{get:d,add:e,remove:f,toggle:g,supports:c}}),g("3n",["4m","r","4n"],function(a,b,c){var d=function(a,b){c.supports(a)?a.dom().classList.add(b):c.add(a,b)},e=function(a){var d=c.supports(a)?a.dom().classList:c.get(a);0===d.length&&b.remove(a,"class")},f=function(a,b){if(c.supports(a)){var d=a.dom().classList;d.remove(b)}else c.remove(a,b);e(a)},g=function(a,b){return c.supports(a)?a.dom().classList.toggle(b):c.toggle(a,b)},h=function(b,d){var e=c.supports(b),f=b.dom().classList,g=function(){e?f.remove(d):c.remove(b,d)},h=function(){e?f.add(d):c.add(b,d)};return a(g,h,i(b,d))},i=function(a,b){return c.supports(a)&&a.dom().classList.contains(b)};return{add:d,remove:f,toggle:g,toggler:h,has:i}}),g("4b",["e","5b","1w","1x","5c","4k","12","13","3n","22","y","43","2z","44"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=f.resolve("resizer-bar"),p=f.resolve("resizer-rows"),q=f.resolve("resizer-cols"),r=7,s=function(b){var c=k.descendants(b.parent(),"."+o);a.each(c,h.remove)},t=function(b,c,d){var e=b.origin();a.each(c,function(a,c){a.each(function(a){var c=d(e,a);i.add(c,o),g.append(b.parent(),c)})})},u=function(a,b,c,d){t(a,b,function(a,b){var f=e.col(b.col(),b.x()-a.left(),c.top()-a.top(),r,d);return i.add(f,q),f})},v=function(a,b,c,d){t(a,b,function(a,b){var f=e.row(b.row(),c.left()-a.left(),b.y()-a.top(),d,r);return i.add(f,p),f})},w=function(a,b,c,d,e,f){var g=m.absolute(b),h=c.length>0?e.positions(c,b):[];v(a,h,g,n.getOuter(b));var i=d.length>0?f.positions(d,b):[];u(a,i,g,l.getOuter(b))},x=function(a,e,f,g){s(a,e);var h=c.fromTable(e),i=d.generate(h),j=b.rows(i),k=b.columns(i);w(a,e,j,k,f,g)},y=function(b,c){var d=k.descendants(b.parent(),"."+o);a.each(d,c)},z=function(a){y(a,function(a){j.set(a,"display","none")})},A=function(a){y(a,function(a){j.set(a,"display","block")})},B=function(a){return i.has(a,p)},C=function(a){return i.has(a,q)};return{refresh:x,hide:z,show:A,destroy:s,isRowBar:B,isColBar:C}}),g("2n",["e","49","f","g","3m","2c","j","1w","2p","1x","2v","34","4b","1c","1m"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=function(a,b){return i.toGrid(a,b,!1)},q=function(b,c){var d=function(a){var b=e.findMap(a,function(a){return o.parent(a.element()).map(function(a){var b=o.parent(a).isNone();return f.elementnew(a,b)})});return b.getOrThunk(function(){return f.elementnew(c.row(),!0)})};return a.map(b,function(a){var b=d(a.details());return f.rowdatanew(b.element(),a.details(),a.section(),b.isNew())})},r=function(a,b){var c=i.toDetails(a,n.eq);return q(c,b)},s=function(b,c){var d=a.flatten(a.map(b.all(),function(a){return a.cells()}));return a.find(d,function(a){return n.eq(c,a.element())})},t=function(a,b,e,f,g){return function(i,o,q,s,t){var u=h.fromTable(o),v=j.generate(u),w=b(v,q).map(function(b){var d=p(v,s),e=a(d,b,n.eq,g(s)),f=r(e.grid(),s);return{grid:c.constant(f),cursor:e.cursor}});return w.fold(function(){return d.none()},function(a){var b=k.render(o,a.grid());return e(o,a.grid(),t),f(o),m.refresh(i,o,l.height,t),d.some({cursor:a.cursor,newRows:b.newRows,newCells:b.newCells})})}},u=function(a,b){return g.cell(b.element()).bind(function(b){return s(a,b)})},v=function(a,c){return g.cell(c.element()).bind(function(d){return s(a,d).map(function(a){return b.merge(a,{generators:c.generators,clipboard:c.clipboard})})})},w=function(c,f){var h=a.map(f.selection(),function(a){return g.cell(a).bind(function(a){return s(c,a)})}),i=e.cat(h);return i.length>0?d.some(b.merge({cells:i},{generators:f.generators,clipboard:f.clipboard})):d.none()},x=function(a,b){return b.mergable()},y=function(a,b){return b.unmergable()},z=function(b,c){var f=a.map(c.selection(),function(a){return g.cell(a).bind(function(a){return s(b,a)})}),h=e.cat(f);return h.length>0?d.some(h):d.none()};return{run:t,toDetailList:r,onCell:u,onCells:z,onPaste:v,onPasteRows:w,onMergable:x,onUnmergable:y}}),g("5f",["f","g"],function(a,b){var c=function(d){var e=function(a){return d===a},f=function(a){return c(d)},g=function(a){return c(d)},h=function(a){return c(a(d))},i=function(a){a(d)},j=function(a){return a(d)},k=function(a,b){return b(d)},l=function(a){return a(d)},m=function(a){return a(d)},n=function(){return b.some(d)};return{is:e,isValue:a.constant(!0),isError:a.constant(!1),getOr:a.constant(d),getOrThunk:a.constant(d),getOrDie:a.constant(d),or:f,orThunk:g,fold:k,map:h,each:i,bind:j,exists:l,forall:m,toOption:n}},d=function(c){var e=function(a){return a()},f=function(){return a.die(c)()},g=function(a){return a},h=function(a){return a()},i=function(a){return d(c)},j=function(a){return d(c)},k=function(a,b){return a(c)};return{is:a.constant(!1),isValue:a.constant(!1),isError:a.constant(!0),getOr:a.identity,getOrThunk:e,getOrDie:f,or:g,orThunk:h,fold:k,map:i,each:a.noop,bind:j,exists:a.constant(!1),forall:a.constant(!0),toOption:b.none}};return{value:c,error:d}}),g("4c",["e","f","5f","2c","2m","5g","1p","1q","3v"],function(a,b,c,d,e,f,g,h,i){var j=function(a,d,f){if(a.row()>=d.length||a.column()>e.cellLength(d[0]))return c.error("invalid start address out of table bounds, row: "+a.row()+", column: "+a.column());var g=d.slice(a.row()),h=g[0].cells().slice(a.column()),i=e.cellLength(f[0]),j=f.length;return c.value({rowDelta:b.constant(g.length-j),colDelta:b.constant(h.length-i)})},k=function(a,c){var d=e.cellLength(a[0]),f=e.cellLength(c[0]);return{rowDelta:b.constant(0),colDelta:b.constant(d-f)}},l=function(b,c){return a.map(b,function(){return d.elementnew(c.cell(),!0)})},m=function(a,b,c){return a.concat(f.repeat(b,function(b){return e.setCells(a[a.length-1],l(a[a.length-1].cells(),c))}))},n=function(b,c,d){return a.map(b,function(a){return e.setCells(a,a.cells().concat(l(f.range(0,c),d)))})},o=function(a,c,d){var e=c.colDelta()<0?n:b.identity,f=c.rowDelta()<0?m:b.identity,g=e(a,i.abs(c.colDelta()),d),h=f(g,i.abs(c.rowDelta()),d);return h};return{measure:j,measureWidth:k,tailor:o}}),g("2q",["e","g","2c","2m"],function(a,b,c,d){var e=function(a,b,e,f){if(0===a.length)return a;for(var g=b.startRow();g<=b.finishRow();g++)for(var h=b.startCol();h<=b.finishCol();h++)d.mutateCell(a[g],h,c.elementnew(f(),!1));return a},f=function(a,b,e,f){for(var g=!0,h=0;h<a.length;h++)for(var i=0;i<d.cellLength(a[0]);i++){var j=d.getCellElement(a[h],i),k=e(j,b);k===!0&&g===!1?d.mutateCell(a[h],i,c.elementnew(f(),!0)):k===!0&&(g=!1)}return a},g=function(b,c){return a.foldl(b,function(b,d){return a.exists(b,function(a){return c(a.element(),d.element())})?b:b.concat([d])},[])},h=function(e,f,h,i){if(f>0&&f<e.length){var j=e[f-1].cells(),k=g(j,h);a.each(k,function(a){for(var g=b.none(),j=f;j<e.length;j++)for(var k=0;k<d.cellLength(e[0]);k++){var l=e[j].cells()[k],m=h(l.element(),a.element());m&&(g.isNone()&&(g=b.some(i())),g.each(function(a){d.mutateCell(e[j],k,c.elementnew(a,!0))}))}})}return e};return{merge:e,unmerge:f,splitRows:h}}),g("2o",["f","2c","4c","2m","2q"],function(a,b,c,d,e){var f=function(b,c,e,f){var g=d.getCell(b[c],e),h=a.curry(f,g.element()),i=b[c];return b.length>1&&d.cellLength(i)>1&&(e>0&&h(d.getCellElement(i,e-1))||e<i.length-1&&h(d.getCellElement(i,e+1))||c>0&&h(d.getCellElement(b[c-1],e))||c<b.length-1&&h(d.getCellElement(b[c+1],e)))},g=function(a,c,g,h,i){for(var j=a.row(),k=a.column(),l=g.length,m=d.cellLength(g[0]),n=j+l,o=k+m,p=j;p<n;p++)for(var q=k;q<o;q++){f(c,p,q,i)&&e.unmerge(c,d.getCellElement(c[p],q),i,h.cell);var r=d.getCellElement(g[p-j],q-k),s=h.replace(r);d.mutateCell(c[p],q,b.elementnew(s,!0))}return c},h=function(a,b,d,e,f){var h=c.measure(a,b,d);return h.map(function(h){var i=c.tailor(b,h,e);return g(a,i,d,e,f)})},i=function(a,b,d,f,g){e.splitRows(b,a,g,f.cell);var h=c.measureWidth(d,b),i=c.tailor(d,h,f),j=c.measureWidth(b,i),k=c.tailor(b,j,f);return k.slice(0,a).concat(i).concat(k.slice(a,k.length))};return{merge:h,insert:i}}),g("2r",["e","2c","2m"],function(a,b,c){var d=function(a,d,e,f,g){var h=a.slice(0,d),i=a.slice(d),j=c.mapCells(a[e],function(e,h){var i=d>0&&d<a.length&&f(c.getCellElement(a[d-1],h),c.getCellElement(a[d],h)),j=i?c.getCell(a[d],h):b.elementnew(g(e.element(),f),!0);return j});return h.concat([j]).concat(i)},e=function(d,e,f,g,h){return a.map(d,function(a){var d=e>0&&e<c.cellLength(a)&&g(c.getCellElement(a,e-1),c.getCellElement(a,e)),i=d?c.getCell(a,e):b.elementnew(h(c.getCellElement(a,f),g),!0);return c.addCell(a,e,i)})},f=function(d,e,f,g,h){var i=f+1;return a.map(d,function(a,d){var j=d===e,k=j?b.elementnew(h(c.getCellElement(a,f),g),!0):c.getCell(a,f);return c.addCell(a,i,k)})},g=function(a,d,e,f,g){var h=d+1,i=a.slice(0,h),j=a.slice(h),k=c.mapCells(a[d],function(a,c){var d=c===e;return d?b.elementnew(g(a.element(),f),!0):a});return i.concat([k]).concat(j)},h=function(c,d,e){var f=a.map(c,function(a){var c=a.cells().slice(0,d).concat(a.cells().slice(e+1));return b.rowcells(c,a.section())});return a.filter(f,function(a){return a.cells().length>0})},i=function(a,b,c){return a.slice(0,b).concat(a.slice(c+1))};return{insertRowAt:d,insertColumnAt:e,splitCellIntoColumns:f,splitCellIntoRows:g,deleteRowsAt:i,deleteColumnsAt:h}}),g("2s",["e","2c","2m"],function(a,b,c){var d=function(d,e,f,g){var h=function(b){return a.exists(e,function(a){return f(b.element(),a.element())})};return a.map(d,function(a){return c.mapCells(a,function(a){return h(a)?b.elementnew(g(a.element(),f),!0):a})})},e=function(a,b,d,e){return void 0!==c.getCellElement(a[b],d)&&b>0&&e(c.getCellElement(a[b-1],d),c.getCellElement(a[b],d))},f=function(a,b,d){return b>0&&d(c.getCellElement(a,b-1),c.getCellElement(a,b))},g=function(b,g,h,i){var j=a.bind(b,function(a,d){var i=e(b,d,g,h)||f(a,g,h);return i?[]:[c.getCell(a,g)]});return d(b,j,h,i)},h=function(b,c,g,h){var i=b[c],j=a.bind(i.cells(),function(a,d){var h=e(b,c,d,g)||f(i,d,g);return h?[]:[a]});return d(b,j,g,h)};return{replaceColumn:g,replaceRow:h}}),g("5h",[],function(){var a=function(){return f(function(a,b,c,d,e){return a()})},b=function(a){return f(function(b,c,d,e,f){return c(a)})},c=function(a,b){return f(function(c,d,e,f,g){return e(a,b)})},d=function(a,b,c){return f(function(d,e,f,g,h){return g(a,b,c)})},e=function(a,b){return f(function(c,d,e,f,g){return g(a,b)})},f=function(a){return{fold:a}};return{none:a,only:b,left:c,middle:d,right:e}}),g("4d",["e","f","5h","3v"],function(a,b,c,d){var e=function(a,b){return 0===a.length?c.none():1===a.length?c.only(0):0===b?c.left(0,1):b===a.length-1?c.right(b-1,b):b>0&&b<a.length-1?c.middle(b-1,b,b+1):c.none()},f=function(c,f,g,h){var i=c.slice(0),j=e(c,f),k=function(c){return a.map(c,b.constant(0))},l=b.constant(k(i)),m=function(a){return h.singleColumnWidth(i[a],g)},n=function(a,b){if(g>=0){var c=d.max(h.minCellWidth(),i[b]-g);return k(i.slice(0,a)).concat([g,c-i[b]]).concat(k(i.slice(b+1)))}var e=d.max(h.minCellWidth(),i[a]+g),f=i[a]-e;return k(i.slice(0,a)).concat([e-i[a],f]).concat(k(i.slice(b+1)))},o=n,p=function(a,b,c){return n(b,c)},q=function(a,b){if(g>=0)return k(i.slice(0,b)).concat([g]);var c=d.max(h.minCellWidth(),i[b]+g);return k(i.slice(0,b)).concat([c-i[b]])};return j.fold(l,m,o,p,q)};return{determine:f}}),g("4h",["f","r","22","2e"],function(a,b,c,d){var e=function(a,c){return b.has(a,c)&&d(b.get(a,c),10)>1},f=function(a){return e(a,"colspan")},g=function(a){return e(a,"rowspan")},h=function(a,b){return d(c.get(a,b),10)};return{hasColspan:f,hasRowspan:g,minWidth:a.constant(10),minHeight:a.constant(10),getInt:h}}),g("4e",["e","f","5b","2i","4h","5g","22"],function(a,b,c,d,e,f,g){var h=function(a,b,c){return g.getRaw(a,b).fold(function(){return c(a)+"px"},function(a){return a})},i=function(a){return h(a,"width",d.getPixelWidth)},j=function(a){return h(a,"height",d.getHeight)},k=function(d,g,h,i,j){var k=c.columns(d),l=a.map(k,function(a){return a.map(g.edge)});return a.map(k,function(a,c){var d=a.filter(b.not(e.hasColspan));return d.fold(function(){var a=f.deduce(l,c);return i(a)},function(a){return h(a,j)})})},l=function(a){return a.map(function(a){return a+"px"}).getOr("")},m=function(a,b){return k(a,b,i,l)},n=function(a,b,c){return k(a,b,d.getPercentageWidth,function(a){return a.fold(function(){return c.minCellWidth()},function(a){return a/c.pixelWidth()*100})},c)},o=function(a,b,c){return k(a,b,d.getPixelWidth,function(a){return a.getOrThunk(c.minCellWidth)},c)},p=function(d,g,h,i){var j=c.rows(d),k=a.map(j,function(a){return a.map(g.edge)});return a.map(j,function(a,c){var d=a.filter(b.not(e.hasRowspan));return d.fold(function(){var a=f.deduce(k,c);return i(a)},function(a){return h(a)})})},q=function(a,b){return p(a,b,d.getHeight,function(a){return a.getOrThunk(e.minHeight)})},r=function(a,b){return p(a,b,j,l)};return{getRawWidths:m,getPixelWidths:o,getPercentageWidths:n,getPixelHeights:q,getRawHeights:r}}),g("4f",["e","f","1x","2e"],function(a,b,c,d){var e=function(a,b,c){for(var d=0,e=a;e<b;e++)d+=void 0!==c[e]?c[e]:0;return d},f=function(d,f){var g=c.justCells(d);return a.map(g,function(a){var c=e(a.column(),a.column()+a.colspan(),f);return{element:a.element,width:b.constant(c),colspan:a.colspan}})},g=function(d,f){var g=c.justCells(d);return a.map(g,function(a){var c=e(a.row(),a.row()+a.rowspan(),f);return{element:a.element,height:b.constant(c),rowspan:a.rowspan}})},h=function(c,d){return a.map(c.all(),function(a,c){return{element:a.element,height:b.constant(d[c])}})};return{recalculateWidth:f,recalculateHeight:g,matchRowHeight:h}}),g("4g",["e","f","4e","2i","4h","44","3v"],function(a,b,c,d,e,f,g){var h=function(a,g){var h=parseFloat(a,10),i=f.get(g),j=function(a){return a/i*100},k=function(a,b){return[100-a]},l=function(){return e.minWidth()/i*100},m=function(a,b,c){var e=h+c;d.setPercentageWidth(a,e)};return{width:b.constant(h),pixelWidth:b.constant(i),getWidths:c.getPercentageWidths,getCellDelta:j,singleColumnWidth:k,minCellWidth:l,setElementWidth:d.setPercentageWidth,setTableWidth:m}},i=function(f){var h=parseInt(f,10),i=b.identity,j=function(a,b){var c=g.max(e.minWidth(),a+b);return[c-a]},k=function(b,c,e){var f=a.foldr(c,function(a,b){return a+b},0);d.setPixelWidth(b,f)};return{width:b.constant(h),pixelWidth:b.constant(h),getWidths:c.getPixelWidths,getCellDelta:i,singleColumnWidth:j,minCellWidth:e.minWidth,setElementWidth:d.setPixelWidth,setTableWidth:k}},j=function(a,b){if(d.percentageBasedSizeRegex().test(b)){var c=d.percentageBasedSizeRegex().exec(b);return h(c[1],a)}if(d.pixelBasedSizeRegex().test(b)){var e=d.pixelBasedSizeRegex().exec(b);return i(e[1])}var g=f.get(a);return i(g)},k=function(a){var b=d.getRawWidth(a);return b.fold(function(){var b=f.get(a);return i(b)},function(b){return j(a,b)})};return{getTableSize:k}}),g("2t",["e","4d","1w","1x","4e","4f","2i","4g","4h","3v"],function(a,b,c,d,e,f,g,h,i,j){var k=function(a){return d.generate(a)},l=function(b){return a.foldr(b,function(a,b){return a+b},0)},m=function(a){var b=c.fromTable(a);return k(b)},n=function(c,d,e,g){var i=h.getTableSize(c),j=i.getCellDelta(d),k=m(c),l=i.getWidths(k,g,i),n=b.determine(l,e,j,i),o=a.map(n,function(a,b){return a+l[b]}),p=f.recalculateWidth(k,o);a.each(p,function(a){i.setElementWidth(a.element(),a.width())}),e===k.grid().columns()-1&&i.setTableWidth(c,o,j)},o=function(b,c,d,h){var k=m(b),n=e.getPixelHeights(k,h),o=a.map(n,function(a,b){return d===b?j.max(c+a,i.minHeight()):a}),p=f.recalculateHeight(k,o),q=f.matchRowHeight(k,o);a.each(q,function(a){g.setHeight(a.element(),a.height())}),a.each(p,function(a){g.setHeight(a.element(),a.height())});var r=l(o);g.setHeight(b,r)},p=function(b,c,d){var e=h.getTableSize(b),g=k(c),i=e.getWidths(g,d,e),j=f.recalculateWidth(g,i);a.each(j,function(a){e.setElementWidth(a.element(),a.width())});var l=a.foldr(i,function(a,b){return b+a},0);j.length>0&&e.setElementWidth(b,l)};return{adjustWidth:n,adjustHeight:o,adjustWidthTo:p}}),g("x",["e","f","g","1k","2k","2c","2l","j","1w","2m","2n","2o","2p","1x","2q","2r","2s","2t","13"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){var t=function(a){var b=h.cells(a);0===b.length&&s.remove(a)},u=d.immutable("grid","cursor"),v=function(a,b,c){return w(a,b,c).orThunk(function(){return w(a,0,0)})},w=function(a,b,d){return c.from(a[b]).bind(function(a){return c.from(a.cells()[d]).bind(function(a){return c.from(a.element())})})},x=function(a,b,c){return u(a,w(a,b,c))},y=function(b){return a.foldl(b,function(b,c){return a.exists(b,function(a){return a.row()===c.row()})?b:b.concat([c])},[]).sort(function(a,b){return a.row()-b.row()})},z=function(b){return a.foldl(b,function(b,c){return a.exists(b,function(a){return a.column()===c.column()})?b:b.concat([c])},[]).sort(function(a,b){return a.column()-b.column()})},A=function(a,b,c,d){var e=b.row(),f=b.row(),g=p.insertRowAt(a,f,e,c,d.getOrInit);return x(g,f,b.column())},B=function(b,c,d,e){var f=c[0].row(),g=c[0].row(),h=y(c),i=a.foldl(h,function(a,b){return p.insertRowAt(a,g,f,d,e.getOrInit)},b);return x(i,g,c[0].column())},C=function(a,b,c,d){var e=b.row(),f=b.row()+b.rowspan(),g=p.insertRowAt(a,f,e,c,d.getOrInit);return x(g,f,b.column())},D=function(b,c,d,e){var f=y(c),g=f[f.length-1].row(),h=f[f.length-1].row()+f[f.length-1].rowspan(),i=a.foldl(f,function(a,b){return p.insertRowAt(a,h,g,d,e.getOrInit)},b);return x(i,h,c[0].column())},E=function(a,b,c,d){var e=b.column(),f=b.column(),g=p.insertColumnAt(a,f,e,c,d.getOrInit);return x(g,b.row(),f)},F=function(b,c,d,e){var f=z(c),g=f[0].column(),h=f[0].column(),i=a.foldl(f,function(a,b){return p.insertColumnAt(a,h,g,d,e.getOrInit)},b);return x(i,c[0].row(),h)},G=function(a,b,c,d){var e=b.column(),f=b.column()+b.colspan(),g=p.insertColumnAt(a,f,e,c,d.getOrInit);return x(g,b.row(),f)},H=function(b,c,d,e){var f=c[c.length-1].column(),g=c[c.length-1].column()+c[c.length-1].colspan(),h=z(c),i=a.foldl(h,function(a,b){return p.insertColumnAt(a,g,f,d,e.getOrInit)},b);return x(i,c[0].row(),g)},I=function(a,b,c,d){var e=q.replaceRow(a,b.row(),c,d.replaceOrInit);return x(e,b.row(),b.column())},J=function(a,b,c,d){var e=q.replaceColumn(a,b.column(),c,d.replaceOrInit);return x(e,b.row(),b.column())},K=function(a,b,c,d){var e=q.replaceRow(a,b.row(),c,d.replaceOrInit);return x(e,b.row(),b.column())},L=function(a,b,c,d){var e=q.replaceColumn(a,b.column(),c,d.replaceOrInit);return x(e,b.row(),b.column())},M=function(a,b,c,d){var e=p.splitCellIntoColumns(a,b.row(),b.column(),c,d.getOrInit);return x(e,b.row(),b.column())},N=function(a,b,c,d){var e=p.splitCellIntoRows(a,b.row(),b.column(),c,d.getOrInit);return x(e,b.row(),b.column())},O=function(a,b,c,d){var e=z(b),f=p.deleteColumnsAt(a,e[0].column(),e[e.length-1].column()),g=v(f,b[0].row(),b[0].column());return u(f,g)},P=function(a,b,c,d){var e=y(b),f=p.deleteRowsAt(a,e[0].row(),e[e.length-1].row()),g=v(f,b[0].row(),b[0].column());return u(f,g)},Q=function(a,d,e,f){var h=d.cells();g.merge(h);var i=o.merge(a,d.bounds(),e,b.constant(h[0]));return u(i,c.from(h[0]))},R=function(b,d,e,f){var g=a.foldr(d,function(a,b){return o.unmerge(a,b,e,f.combine(b))},b);return u(g,c.from(d[0]))},S=function(a,b,d,e){var g=function(a,b){var c=i.fromTable(a),d=n.generate(c);return m.toGrid(d,b,!0)},h=g(b.clipboard(),b.generators()),j=f.address(b.row(),b.column()),k=l.merge(j,a,h,b.generators(),d);return k.fold(function(){return u(a,c.some(b.element()))},function(a){var c=v(a,b.row(),b.column());return u(a,c)})},T=function(a,b,c){var d=i.fromPastedRows(a,c),e=n.generate(d);return m.toGrid(e,b,!0)},U=function(a,b,c,d){var e=a[b.cells[0].row()],f=b.cells[0].row(),g=T(b.clipboard(),b.generators(),e),h=l.insert(f,a,g,b.generators(),c),i=v(h,b.cells[0].row(),b.cells[0].column());return u(h,i)},V=function(a,b,c,d){var e=a[b.cells[0].row()],f=b.cells[b.cells.length-1].row()+b.cells[b.cells.length-1].rowspan(),g=T(b.clipboard(),b.generators(),e),h=l.insert(f,a,g,b.generators(),c),i=v(h,b.cells[0].row(),b.cells[0].column());return u(h,i)},W=r.adjustWidthTo;return{insertRowBefore:k.run(A,k.onCell,b.noop,b.noop,e.modification),insertRowsBefore:k.run(B,k.onCells,b.noop,b.noop,e.modification),insertRowAfter:k.run(C,k.onCell,b.noop,b.noop,e.modification),insertRowsAfter:k.run(D,k.onCells,b.noop,b.noop,e.modification),insertColumnBefore:k.run(E,k.onCell,W,b.noop,e.modification),insertColumnsBefore:k.run(F,k.onCells,W,b.noop,e.modification),insertColumnAfter:k.run(G,k.onCell,W,b.noop,e.modification),insertColumnsAfter:k.run(H,k.onCells,W,b.noop,e.modification),splitCellIntoColumns:k.run(M,k.onCell,W,b.noop,e.modification),splitCellIntoRows:k.run(N,k.onCell,b.noop,b.noop,e.modification),eraseColumns:k.run(O,k.onCells,W,t,e.modification),eraseRows:k.run(P,k.onCells,b.noop,t,e.modification),makeColumnHeader:k.run(J,k.onCell,b.noop,b.noop,e.transform("row","th")),unmakeColumnHeader:k.run(L,k.onCell,b.noop,b.noop,e.transform(null,"td")),makeRowHeader:k.run(I,k.onCell,b.noop,b.noop,e.transform("col","th")),unmakeRowHeader:k.run(K,k.onCell,b.noop,b.noop,e.transform(null,"td")),mergeCells:k.run(Q,k.onMergable,b.noop,b.noop,e.merging),unmergeCells:k.run(R,k.onUnmergable,W,b.noop,e.merging),pasteCells:k.run(S,k.onPaste,W,b.noop,e.modification),pasteRowsBefore:k.run(U,k.onPasteRows,b.noop,b.noop,e.modification),pasteRowsAfter:k.run(V,k.onPasteRows,b.noop,b.noop,e.modification)}}),g("z",["1c","l"],function(a,b){var c=function(a){return b.fromDom(a.getBody())},d=function(b){return function(d){return a.eq(d,c(b))}},e=function(a){return a?a.replace(/px$/,""):""},f=function(a){return/^[0-9]+$/.test(a)&&(a+="px"),a};return{getBody:c,getIsRoot:d,addSizeSuffix:f,removePxSuffix:e}}),g("2u",["22"],function(a){var b=function(a,b){return function(d){return"rtl"===c(d)?b:a}},c=function(b){return"rtl"===a.get(b,"direction")?"rtl":"ltr"};return{onDirection:b,getDirection:c}}),g("10",["f","2u"],function(a,b){var c={isRtl:a.constant(!1)},d={isRtl:a.constant(!0)},e=function(a){var e=b.getDirection(a);return"rtl"===e?d:c};return{directionAt:e}}),g("4",["e","f","g","u","v","i","w","x","l","n","r","y","z","10"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){return function(o,p){var q,r=function(a){return"table"===j.name(m.getBody(a))},s=function(a){var b=g.getGridSize(a);return r(o)===!1||b.rows()>1},t=function(a){var b=g.getGridSize(a);return r(o)===!1||b.columns()>1},u=function(a){return o.fire("newrow",{node:a.dom()}),a.dom()},v=function(a){return o.fire("newcell",{node:a.dom()}),a.dom()};o.settings.table_clone_elements!==!1&&("string"==typeof o.settings.table_clone_elements?q=o.settings.table_clone_elements.split(/[ ,]/):Array.isArray(o.settings.table_clone_elements)&&(q=o.settings.table_clone_elements));var w=c.from(q),x=function(b,d,g,h){return function(j,m){var p=l.descendants(j,"td[data-mce-style],th[data-mce-style]");a.each(p,function(a){k.remove(a,"data-mce-style")});var q=h(),r=i.fromDom(o.getDoc()),s=e(n.directionAt),t=f.cellOperations(g,r,w);return d(j)?b(q,j,m,t,s).bind(function(b){return a.each(b.newRows(),function(a){u(a)}),a.each(b.newCells(),function(a){v(a)}),b.cursor().map(function(a){var b=o.dom.createRng();return b.setStart(a.dom(),0),b.setEnd(a.dom(),0),b})}):c.none()}},y=x(h.eraseRows,s,b.noop,p),z=x(h.eraseColumns,t,b.noop,p),A=x(h.insertRowsBefore,b.always,b.noop,p),B=x(h.insertRowsAfter,b.always,b.noop,p),C=x(h.insertColumnsBefore,b.always,d.halve,p),D=x(h.insertColumnsAfter,b.always,d.halve,p),E=x(h.mergeCells,b.always,b.noop,p),F=x(h.unmergeCells,b.always,b.noop,p),G=x(h.pasteRowsBefore,b.always,b.noop,p),H=x(h.pasteRowsAfter,b.always,b.noop,p),I=x(h.pasteCells,b.always,b.noop,p);return{deleteRow:y,deleteColumn:z,insertRowsBefore:A,insertRowsAfter:B,insertColumnsBefore:C,insertColumnsAfter:D,mergeCells:E,unmergeCells:F,pasteRowsBefore:G,pasteRowsAfter:H,pasteCells:I}}}),g("11",["1w","2n","2p","1x","2v"],function(a,b,c,d,e){var f=function(f,g,h){var i=a.fromTable(f),j=d.generate(i),k=b.onCells(j,g);return k.map(function(a){var d=c.toGrid(j,h,!1),f=d.slice(a[0].row(),a[a.length-1].row()+a[a.length-1].rowspan()),g=b.toDetailList(f,h);return e.copy(g)})};return{copyRows:f}}),g("14",["d"],function(a){return a("tinymce.util.Tools")}),g("2w",["d"],function(a){return a("tinymce.Env")}),g("2x",["14"],function(a){var b=function(a,b,c){var d,e=a.select("td,th",b),f=function(b,d){for(var e=0;e<d.length;e++){var f=a.getStyle(d[e],c);if("undefined"==typeof b&&(b=f),b!=f)return""}return b};return d=f(d,e)},c=function(a,b,c){c&&a.formatter.apply("align"+c,{},b)},d=function(a,b,c){c&&a.formatter.apply("valign"+c,{},b)},e=function(b,c){a.each("left center right".split(" "),function(a){b.formatter.remove("align"+a,{},c)})},f=function(b,c){a.each("top middle bottom".split(" "),function(a){b.formatter.remove("valign"+a,{},c)})};return{applyAlign:c,applyVAlign:d,unApplyAlign:e,unApplyVAlign:f,getTDTHOverallStyle:b}}),g("2y",["f","14","z"],function(a,b,c){var d=function(a,c,d){var e=function(a,d){return d=d||[],b.each(a,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d};return e(a,d||[])},e=function(a,b){var d=a.dom,e=b.control.rootControl,f=e.toJSON(),g=d.parseStyle(f.style);"style"===b.control.name()?(e.find("#borderStyle").value(g["border-style"]||"")[0].fire("select"),e.find("#borderColor").value(g["border-color"]||"")[0].fire("change"),e.find("#backgroundColor").value(g["background-color"]||"")[0].fire("change"),e.find("#width").value(g.width||"").fire("change"),e.find("#height").value(g.height||"").fire("change")):(g["border-style"]=f.borderStyle,g["border-color"]=f.borderColor,g["background-color"]=f.backgroundColor,g.width=f.width?c.addSizeSuffix(f.width):"",g.height=f.height?c.addSizeSuffix(f.height):""),e.find("#style").value(d.serializeStyle(d.parseStyle(d.serializeStyle(g))))},f=function(a,b){var c=a.parseStyle(a.getAttrib(b,"style")),d={};return c["border-style"]&&(d.borderStyle=c["border-style"]),c["border-color"]&&(d.borderColor=c["border-color"]),c["background-color"]&&(d.backgroundColor=c["background-color"]),d.style=a.serializeStyle(c),d},g=function(b){var c=function(){var a=b.settings.color_picker_callback;if(a)return function(c){return a.call(b,function(a){c.control.value(a).fire("change")},c.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:a.curry(e,b)},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:a.curry(e,b),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:c()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:c()}]}]}};return{createStyleForm:g,buildListItems:d,updateStyleField:e,extractAdvancedStyles:f}}),g("15",["f","2w","14","3","2x","z","2y"],function(a,b,c,d,e,f,g){function h(a,b,c,d){if("TD"===b.tagName||"TH"===b.tagName)a.setStyle(b,c,d);else if(b.children)for(var e=0;e<b.children.length;e++)h(a,b.children[e],c,d)}var i=function(a,b){var d=a.dom,f={width:d.getStyle(b,"width")||d.getAttrib(b,"width"),height:d.getStyle(b,"height")||d.getAttrib(b,"height"),cellspacing:d.getStyle(b,"border-spacing")||d.getAttrib(b,"cellspacing"),cellpadding:d.getAttrib(b,"data-mce-cell-padding")||d.getAttrib(b,"cellpadding")||e.getTDTHOverallStyle(a.dom,b,"padding"),border:d.getAttrib(b,"data-mce-border")||d.getAttrib(b,"border")||e.getTDTHOverallStyle(a.dom,b,"border"),borderColor:d.getAttrib(b,"data-mce-border-color"),caption:!!d.select("caption",b)[0],"class":d.getAttrib(b,"class")};return c.each("left center right".split(" "),function(c){a.formatter.matchNode(b,"align"+c)&&(f.align=c)}),a.settings.table_advtab!==!1&&c.extend(f,g.extractAdvancedStyles(d,b)),
4
- f},j=function(a,b,d){var e=a.dom,g={},i={};if(g["class"]=d["class"],i.height=f.addSizeSuffix(d.height),e.getAttrib(b,"width")&&!a.settings.table_style_by_css?g.width=f.removePxSuffix(d.width):i.width=f.addSizeSuffix(d.width),a.settings.table_style_by_css?(i["border-width"]=f.addSizeSuffix(d.border),i["border-spacing"]=f.addSizeSuffix(d.cellspacing),c.extend(g,{"data-mce-border-color":d.borderColor,"data-mce-cell-padding":d.cellpadding,"data-mce-border":d.border})):c.extend(g,{border:d.border,cellpadding:d.cellpadding,cellspacing:d.cellspacing}),a.settings.table_style_by_css&&b.children)for(var j=0;j<b.children.length;j++)h(e,b.children[j],{"border-width":f.addSizeSuffix(d.border),"border-color":d.borderColor,padding:f.addSizeSuffix(d.cellpadding)});d.style?c.extend(i,e.parseStyle(d.style)):i=c.extend({},e.parseStyle(e.getAttrib(b,"style")),i),g.style=e.serializeStyle(i),e.setAttribs(b,g)},k=function(a,c,f){var h,i,k=a.dom;g.updateStyleField(a,f),i=f.control.rootControl.toJSON(),i["class"]===!1&&delete i["class"],a.undoManager.transact(function(){c||(c=d.insert(a,i.cols||1,i.rows||1)),j(a,c,i),h=k.select("caption",c)[0],h&&!i.caption&&k.remove(h),!h&&i.caption&&(h=k.create("caption"),h.innerHTML=b.ie?"\xa0":'<br data-mce-bogus="1"/>',c.insertBefore(h,c.firstChild)),e.unApplyAlign(a,c),i.align&&e.applyAlign(a,c,i.align),a.focus(),a.addVisual()})},l=function(b,c){var d,e,f,h,j,l=b.dom,m={};c===!0?(d=l.getParent(b.selection.getStart(),"table"),d&&(m=i(b,d))):(e={label:"Cols",name:"cols"},f={label:"Rows",name:"rows"}),b.settings.table_class_list&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),h={name:"class",type:"listbox",label:"Class",values:g.buildListItems(b.settings.table_class_list,function(a){a.value&&(a.textStyle=function(){return b.formatter.getCssText({block:"table",classes:[a.value]})})})}),j={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:b.settings.table_appearance_options!==!1?[e,f,{label:"Width",name:"width",onchange:a.curry(g.updateStyleField,b)},{label:"Height",name:"height",onchange:a.curry(g.updateStyleField,b)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[e,f,{label:"Width",name:"width",onchange:a.curry(g.updateStyleField,b)},{label:"Height",name:"height",onchange:a.curry(g.updateStyleField,b)}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},h]},b.settings.table_advtab!==!1?b.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:j},g.createStyleForm(b)],onsubmit:a.curry(k,b,d)}):b.windowManager.open({title:"Table properties",data:m,body:j,onsubmit:a.curry(k,b,d)})};return{open:l}}),g("16",["f","14","2x","z","2y"],function(a,b,c,d,e){function f(a,f,g){function i(a,b,c){c&&l.setAttrib(a,b,c)}function j(a,b,c){c&&l.setStyle(a,b,c)}var k,l=a.dom;e.updateStyleField(a,g),k=g.control.rootControl.toJSON(),a.undoManager.transact(function(){b.each(f,function(b){i(b,"scope",k.scope),i(b,"style",k.style),i(b,"class",k["class"]),j(b,"height",d.addSizeSuffix(k.height)),k.type!==b.parentNode.nodeName.toLowerCase()&&h(a.dom,b,k.type),1===f.length&&c.unApplyAlign(a,b),k.align&&c.applyAlign(a,b,k.align)}),a.focus()})}var g=function(a,c){var d=a.dom,f={height:d.getStyle(c,"height")||d.getAttrib(c,"height"),scope:d.getAttrib(c,"scope"),"class":d.getAttrib(c,"class")};return f.type=c.parentNode.nodeName.toLowerCase(),b.each("left center right".split(" "),function(b){a.formatter.matchNode(c,"align"+b)&&(f.align=b)}),a.settings.table_row_advtab!==!1&&b.extend(f,e.extractAdvancedStyles(d,c)),f},h=function(a,b,c){var d=a.getParent(b,"table"),e=b.parentNode,f=a.select(c,d)[0];f||(f=a.create(c),d.firstChild?"CAPTION"===d.firstChild.nodeName?a.insertAfter(f,d.firstChild):d.insertBefore(f,d.firstChild):d.appendChild(f)),f.appendChild(b),e.hasChildNodes()||a.remove(e)},i=function(c){var d,h,i,j,k,l,m=c.dom,n=[];d=c.dom.getParent(c.selection.getStart(),"table"),h=c.dom.getParent(c.selection.getStart(),"td,th"),b.each(d.rows,function(a){b.each(a.cells,function(b){if(m.getAttrib(b,"data-mce-selected")||b==h)return n.push(a),!1})}),i=n[0],i&&(k=n.length>1?{height:"",scope:"","class":"",align:"",type:i.parentNode.nodeName.toLowerCase()}:g(c,i),c.settings.table_row_class_list&&(j={name:"class",type:"listbox",label:"Class",values:e.buildListItems(c.settings.table_row_class_list,function(a){a.value&&(a.textStyle=function(){return c.formatter.getCssText({block:"tr",classes:[a.value]})})})}),l={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},j]},c.settings.table_row_advtab!==!1?c.windowManager.open({title:"Row properties",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",items:l},e.createStyleForm(m)],onsubmit:a.curry(f,c,n)}):c.windowManager.open({title:"Row properties",data:k,body:l,onsubmit:a.curry(f,c,n)}))};return{open:i}}),g("17",["f","14","2x","z","2y"],function(a,b,c,d,e){var f=function(a,b){a.style.cssText+=";"+b},g=function(a,c){var d=a.dom,f={width:d.getStyle(c,"width")||d.getAttrib(c,"width"),height:d.getStyle(c,"height")||d.getAttrib(c,"height"),scope:d.getAttrib(c,"scope"),"class":d.getAttrib(c,"class")};return f.type=c.nodeName.toLowerCase(),b.each("left center right".split(" "),function(b){a.formatter.matchNode(c,"align"+b)&&(f.align=b)}),b.each("top middle bottom".split(" "),function(b){a.formatter.matchNode(c,"valign"+b)&&(f.valign=b)}),a.settings.table_cell_advtab!==!1&&b.extend(f,e.extractAdvancedStyles(d,c)),f},h=function(a,g,h){function i(a,b,c){c&&l.setAttrib(a,b,c)}function j(a,b,c){c&&l.setStyle(a,b,c)}var k,l=a.dom;e.updateStyleField(a,h),k=h.control.rootControl.toJSON(),a.undoManager.transact(function(){b.each(g,function(b){i(b,"scope",k.scope),1===g.length?i(b,"style",k.style):f(b,k.style),i(b,"class",k["class"]),j(b,"width",d.addSizeSuffix(k.width)),j(b,"height",d.addSizeSuffix(k.height)),k.type&&b.nodeName.toLowerCase()!==k.type&&(b=l.rename(b,k.type)),1===g.length&&(c.unApplyAlign(a,b),c.unApplyVAlign(a,b)),k.align&&c.applyAlign(a,b,k.align),k.valign&&c.applyVAlign(a,b,k.valign)}),a.focus()})},i=function(b){var c,d,f,i=[];if(i=b.dom.select("td[data-mce-selected],th[data-mce-selected]"),c=b.dom.getParent(b.selection.getStart(),"td,th"),!i.length&&c&&i.push(c),c=c||i[0]){d=i.length>1?{width:"",height:"",scope:"","class":"",align:"",style:"",type:c.nodeName.toLowerCase()}:g(b,c),b.settings.table_cell_class_list&&(f={name:"class",type:"listbox",label:"Class",values:e.buildListItems(b.settings.table_cell_class_list,function(a){a.value&&(a.textStyle=function(){return b.formatter.getCssText({block:"td",classes:[a.value]})})})});var j={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:a.curry(e.updateStyleField,b)},{label:"Height",name:"height",onchange:a.curry(e.updateStyleField,b)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},f]};b.settings.table_cell_advtab!==!1?b.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:d,body:[{title:"General",type:"form",items:j},e.createStyleForm(b)],onsubmit:a.curry(h,b,i)}):b.windowManager.open({title:"Cell properties",data:d,body:j,onsubmit:a.curry(h,b,i)})}};return{open:i}}),g("5",["e","f","g","11","i","j","12","13","k","l","14","z","o","15","16","17"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=k.each,r=c.none(),s=function(){return r.fold(function(){},function(b){return a.map(b,function(a){return a.dom()})})},t=function(b){var d=a.map(b,j.fromDom);r=c.from(d)},u=function(k,s,t,u){var v=l.getIsRoot(k),w=function(){var a=j.fromDom(k.dom.getParent(k.selection.getStart(),"th,td")),c=f.table(a,v);c.filter(b.not(v)).each(function(a){var b=j.fromText("");g.after(a,b),h.remove(a);var c=k.dom.createRng();c.setStart(b.dom(),0),c.setEnd(b.dom(),0),k.selection.setRng(c)})},x=function(){return j.fromDom(k.dom.getParent(k.selection.getStart(),"th,td"))},y=function(a){return f.table(a,v)},z=function(a){var b=x(),c=y(b);c.each(function(c){var d=m.forMenu(u,c,b);a(c,d).each(function(a){k.selection.setRng(a),k.focus(),t.clear(c)})})},A=function(a){var f=x(),g=y(f);return g.bind(function(a){var g=j.fromDom(k.getDoc()),h=m.forMenu(u,a,f),i=e.cellOperations(b.noop,g,c.none());return d.copyRows(a,h,i)})},B=function(b){r.each(function(c){var d=a.map(c,function(a){return i.deep(a)}),f=x(),g=y(f);g.bind(function(a){var c=j.fromDom(k.getDoc()),g=e.paste(c),h=m.pasteRows(u,a,f,d,g);b(a,h).each(function(b){k.selection.setRng(b),k.focus(),t.clear(a)})})})};q({mceTableSplitCells:function(){z(s.unmergeCells)},mceTableMergeCells:function(){z(s.mergeCells)},mceTableInsertRowBefore:function(){z(s.insertRowsBefore)},mceTableInsertRowAfter:function(){z(s.insertRowsAfter)},mceTableInsertColBefore:function(){z(s.insertColumnsBefore)},mceTableInsertColAfter:function(){z(s.insertColumnsAfter)},mceTableDeleteCol:function(){z(s.deleteColumn)},mceTableDeleteRow:function(){z(s.deleteRow)},mceTableCutRow:function(a){r=A(),z(s.deleteRow)},mceTableCopyRow:function(a){r=A()},mceTablePasteRowBefore:function(a){B(s.pasteRowsBefore)},mceTablePasteRowAfter:function(a){B(s.pasteRowsAfter)},mceTableDelete:w},function(a,b){k.addCommand(b,a)}),q({mceInsertTable:b.curry(n.open,k),mceTableProps:b.curry(n.open,k,!0),mceTableRowProps:b.curry(o.open,k),mceTableCellProps:b.curry(p.open,k)},function(a,b){k.addCommand(b,function(b,c){a(c)})})};return{registerCommands:u,getClipboardRows:s,setClipboardRows:t}}),g("18",["f","g","l","2z","30"],function(a,b,c,d,e){var f=function(d){var f=b.from(d.dom().documentElement).map(c.fromDom).getOr(d);return{parent:a.constant(f),view:a.constant(d),origin:a.constant(e(0,0))}},g=function(b,c){var e=a.curry(d.absolute,c);return{parent:a.constant(c),view:a.constant(b),origin:e}},h=function(b,c){return{parent:a.constant(c),view:a.constant(b),origin:a.constant(e(0,0))}};return{only:f,detached:g,body:h}}),g("31",["e","1k"],function(a,b){return function(c){var d=b.immutable.apply(null,c),e=[],f=function(a){if(void 0===a)throw"Event bind error: undefined handler";e.push(a)},g=function(b){e=a.filter(e,function(a){return a!==b})},h=function(){var b=d.apply(null,arguments);a.each(e,function(a){a(b)})};return{bind:f,unbind:g,trigger:h}}}),g("32",["1t"],function(a){var b=function(b){var c=a.map(b,function(a){return{bind:a.bind,unbind:a.unbind}}),d=a.map(b,function(a){return a.trigger});return{registry:c,trigger:d}};return{create:b}}),g("5z",["47"],function(a){var b=a.exactly(["compare","extract","mutate","sink"]),c=a.exactly(["element","start","stop","destroy"]),d=a.exactly(["forceDrop","drop","move","delayDrop"]);return{mode:b,sink:c,api:d}}),g("68",["5d"],function(a){var b=a.css("ephox-dragster");return{resolve:b.resolve}}),g("60",["68","49","3n","22","l","13"],function(a,b,c,d,e,f){return function(g){var h=b.merge({layerClass:a.resolve("blocker")},g),i=e.fromTag("div");d.setAll(i,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),c.add(i,a.resolve("blocker")),c.add(i,h.layerClass);var j=function(){return i},k=function(){f.remove(i)};return{element:j,destroy:k}}}),g("5l",["f","l"],function(a,b){var c=function(b,c,d,e,f,g,h){return{target:a.constant(b),x:a.constant(c),y:a.constant(d),stop:e,prevent:f,kill:g,raw:a.constant(h)}},d=function(d,e){return function(f){if(d(f)){var g=b.fromDom(f.target),h=function(){f.stopPropagation()},i=function(){f.preventDefault()},j=a.compose(i,h),k=c(g,f.clientX,f.clientY,h,i,j,f);e(k)}}},e=function(b,c,e,f,g){var i=d(e,f);return b.dom().addEventListener(c,i,g),{unbind:a.curry(h,b,c,i,g)}},f=function(a,b,c,d){return e(a,b,c,d,!1)},g=function(a,b,c,d){return e(a,b,c,d,!0)},h=function(a,b,c,d){a.dom().removeEventListener(b,c,d)};return{bind:f,capture:g}}),g("4l",["f","5l"],function(a,b){var c=a.constant(!0),d=function(a,d,e){return b.bind(a,d,c,e)},e=function(a,d,e){return b.capture(a,d,c,e)};return{bind:d,capture:e}}),g("5i",["5z","60","g","30","4l","12","13"],function(a,b,c,d,e,f,g){var h=function(a,b){return d(b.left()-a.left(),b.top()-a.top())},i=function(a){return c.some(d(a.x(),a.y()))},j=function(a,b){a.mutate(b.left(),b.top())},k=function(c,d){var h=b(d),i=e.bind(h.element(),"mousedown",c.forceDrop),j=e.bind(h.element(),"mouseup",c.drop),k=e.bind(h.element(),"mousemove",c.move),l=e.bind(h.element(),"mouseout",c.delayDrop),m=function(){h.destroy(),j.unbind(),k.unbind(),l.unbind(),i.unbind()},n=function(a){f.append(a,h.element())},o=function(){g.remove(h.element())};return a.sink({element:h.element,start:n,stop:o,destroy:m})};return a.mode({compare:h,extract:i,sink:k,mutate:j})}),g("69",["g","31","32"],function(a,b,c){return function(){var d=a.none(),e=function(){d=a.none()},f=function(b,c){var e=d.map(function(a){return b.compare(a,c)});return d=a.some(c),e},g=function(a,b){var c=b.extract(a);c.each(function(a){var c=f(b,a);c.each(function(a){h.trigger.move(a)})})},h=c.create({move:b(["info"])});return{onEvent:g,reset:e,events:h.registry}}}),g("6a",["f"],function(a){return function(b){var c=function(a,b){};return{onEvent:c,reset:a.noop}}}),g("61",["69","6a"],function(a,b){return function(){var c=b(),d=a(),e=c,f=function(){e.reset(),e=d},g=function(){e.reset(),e=c},h=function(a,b){e.onEvent(a,b)},i=function(){return e===d};return{on:f,off:g,isOn:i,onEvent:h,events:d.events}}}),h("6b",clearTimeout),h("6c",setTimeout),g("62",["6b","6c"],function(a,b){var c=function(c,d){var e=null,f=null,g=function(){null!==e&&(a(e),e=null,f=null)},h=function(){f=arguments,null===e&&(e=b(function(){c.apply(null,f),e=null,f=null},d))};return{cancel:g,throttle:h}},d=function(c,d){var e=null,f=function(){null!==e&&(a(e),e=null)},g=function(){var a=arguments;null===e&&(e=b(function(){c.apply(null,a),e=null,a=null},d))};return{cancel:f,throttle:g}},e=function(c,d){var e=null,f=function(){null!==e&&(a(e),e=null)},g=function(){var f=arguments;null!==e&&a(e),e=b(function(){c.apply(null,f),e=null,f=null},d)};return{cancel:f,throttle:g}};return{adaptable:c,first:d,last:e}}),g("5j",["5z","61","62","31","32","1p"],function(a,b,c,d,e,f){var g=function(g,h,i){var j=!1,k=e.create({start:d([]),stop:d([])}),l=b(),m=function(){t.stop(),l.isOn()&&(l.off(),k.trigger.stop())},n=c.last(m,200),o=function(a){t.start(a),l.on(),k.trigger.start()},p=function(a,b){n.cancel(),l.onEvent(a,h)};l.events.move.bind(function(a){h.mutate(g,a.info())});var q=function(){j=!0},r=function(){j=!1},s=function(a){return function(){var b=f.prototype.slice.call(arguments,0);if(j)return a.apply(null,b)}},t=h.sink(a.api({forceDrop:m,drop:s(m),move:s(p),delayDrop:s(n.throttle)}),i),u=function(){t.destroy()};return{element:t.element,go:o,on:q,off:r,destroy:u,events:k.registry}};return{setup:g}}),g("4i",["5i","5j","1p"],function(a,b,c){var d=function(c,d){var e=void 0!==d?d:{},f=void 0!==e.mode?e.mode:a;return b.setup(c,f,d)};return{transform:d}}),g("5k",["31","32"],function(a,b){return function(){var c=b.create({drag:a(["xDelta","yDelta"])}),d=function(a,b){c.trigger.drag(a,b)};return{mutate:d,events:c.registry}}}),g("4j",["g","31","32","5k"],function(a,b,c,d){return function(){var e=c.create({drag:b(["xDelta","yDelta","target"])}),f=a.none(),g=d();g.events.drag.bind(function(a){f.each(function(b){e.trigger.drag(a.xDelta(),a.yDelta(),b)})});var h=function(b){f=a.some(b)},i=function(){return f};return{assign:h,get:i,mutate:g.mutate,events:e.registry}}}),g("4o",["t"],function(a){var b=function(b){return a.first(b).isSome()},c=function(b,c,d){return a.ancestor(b,c,d).isSome()},d=function(b,c){return a.sibling(b,c).isSome()},e=function(b,c){return a.child(b,c).isSome()},f=function(b,c){return a.descendant(b,c).isSome()},g=function(b,c,d){return a.closest(b,c,d).isSome()};return{any:b,ancestor:c,sibling:d,child:e,descendant:f,closest:g}}),g("33",["4i","f","g","31","32","4j","4b","4k","4h","1c","4l","35","n","r","3n","22","4o","t","2e"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){var t=h.resolve("resizer-bar-dragging");return function(h,u,v){var w=f(),x=a.transform(w,{}),y=c.none(),z=function(a,b){return c.from(n.get(a,b))};w.events.drag.bind(function(a){z(a.target(),"data-row").each(function(b){var c=i.getInt(a.target(),"top");p.set(a.target(),"top",c+a.yDelta()+"px")}),z(a.target(),"data-column").each(function(b){var c=i.getInt(a.target(),"left");p.set(a.target(),"left",c+a.xDelta()+"px")})});var A=function(a,b){var c=i.getInt(a,b),d=s(n.get(a,"data-initial-"+b),10);return c-d};x.events.stop.bind(function(){w.get().each(function(a){y.each(function(b){z(a,"data-row").each(function(c){var d=A(a,"top");n.remove(a,"data-initial-top"),H.trigger.adjustHeight(b,d,s(c,10))}),z(a,"data-column").each(function(c){var d=A(a,"left");n.remove(a,"data-initial-left"),H.trigger.adjustWidth(b,d,s(c,10))}),g.refresh(h,b,v,u)})})});var B=function(a,b){H.trigger.startAdjust(),w.assign(a),n.set(a,"data-initial-"+b,s(p.get(a,b),10)),o.add(a,t),p.set(a,"opacity","0.2"),x.go(h.parent())},C=k.bind(h.parent(),"mousedown",function(a){g.isRowBar(a.target())&&B(a.target(),"top"),g.isColBar(a.target())&&B(a.target(),"left")}),D=function(a){return j.eq(a,h.view())},E=k.bind(h.view(),"mouseover",function(a){"table"===m.name(a.target())||q.ancestor(a.target(),"table",D)?(y="table"===m.name(a.target())?c.some(a.target()):r.ancestor(a.target(),"table",D),y.each(function(a){g.refresh(h,a,v,u)})):l.inBody(a.target())&&g.destroy(h)}),F=function(){C.unbind(),E.unbind(),x.destroy(),g.destroy(h)},G=function(a){g.refresh(h,a,v,u)},H=e.create({adjustHeight:d(["table","delta","row"]),adjustWidth:d(["table","delta","column"]),startAdjust:d([])});return{destroy:F,refresh:G,on:x.on,off:x.off,hideBars:b.curry(g.hide,h),showBars:b.curry(g.show,h),events:H.registry}}}),g("19",["31","32","2t","33","34"],function(a,b,c,d,e){return function(f,g){var h=e.height,i=d(f,g,h),j=b.create({beforeResize:a(["table"]),afterResize:a(["table"]),startDrag:a([])});return i.events.adjustHeight.bind(function(a){j.trigger.beforeResize(a.table());var b=h.delta(a.delta(),a.table());c.adjustHeight(a.table(),b,a.row(),h),j.trigger.afterResize(a.table())}),i.events.startAdjust.bind(function(a){j.trigger.startDrag()}),i.events.adjustWidth.bind(function(a){j.trigger.beforeResize(a.table());var b=g.delta(a.delta(),a.table());c.adjustWidth(a.table(),b,a.column(),g),j.trigger.afterResize(a.table())}),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:j.registry}}}),g("1a",["18","12","13","35","l","22","z"],function(a,b,c,d,e,f,g){var h=function(){var a=e.fromTag("div");return f.setAll(a,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),b.append(d.body(),a),a},i=function(b,c){return b.inline?a.body(g.getBody(b),h()):a.only(e.fromDom(b.getDoc()))},j=function(a,b){a.inline&&c.remove(b.parent())};return{get:i,remove:j}}),g("6",["e","g","18","v","19","l","r","y","1a","10","14"],function(a,b,c,d,e,f,g,h,i,j,k){return function(l){var m,n,o=b.none(),p=b.none(),q=b.none(),r=/(\d+(\.\d+)?)%/,s=function(a){return"TABLE"===a.nodeName},t=function(a){return l.dom.getStyle(a,"width")||l.dom.getAttrib(a,"width")},u=function(){return p},v=function(){return q.getOr(c.only(f.fromDom(l.getBody())))},w=function(){p.each(function(a){a.destroy()}),q.each(function(a){i.remove(l,a)})};return l.on("init",function(){var c=d(j.directionAt),f=i.get(l);if(q=b.some(f),l.settings.object_resizing&&l.settings.table_resize_bars!==!1&&(l.settings.object_resizing===!0||"table"===l.settings.object_resizing)){var k=e(f,c);k.on(),k.events.startDrag.bind(function(a){o=b.some(l.selection.getRng())}),k.events.afterResize.bind(function(b){var c=b.table(),d=h.descendants(c,"td[data-mce-style],th[data-mce-style]");a.each(d,function(a){g.remove(a,"data-mce-style")}),o.each(function(a){l.selection.setRng(a),l.focus()}),l.undoManager.add()}),p=b.some(k)}}),l.on("ObjectResizeStart",function(a){s(a.target)&&(m=a.width,n=t(a.target))}),l.on("ObjectResized",function(a){if(s(a.target)){var b=a.target;if(r.test(n)){var c=parseFloat(r.exec(n)[1],10),d=a.width*c/m;l.dom.setStyle(b,"width",d+"%")}else{var e=[];k.each(b.rows,function(a){k.each(a.cells,function(a){var b=l.dom.getStyle(a,"width",!0);e.push({cell:a,width:b})})}),k.each(e,function(a){l.dom.setStyle(a.cell,"width",a.width),l.dom.setAttrib(a.cell,"width",null)})}}}),{lazyResize:u,lazyWire:v,destroy:w}}}),g("36",[],function(){var a=function(a){return e(function(b,c,d,e){return b(a)})},b=function(a){return e(function(b,c,d,e){return c(a)})},c=function(a,b){return e(function(c,d,e,f){return e(a,b)})},d=function(a){return e(function(b,c,d,e){return e(a)})},e=function(a){return{fold:a}};return{none:a,first:b,middle:c,last:d}}),g("1b",["e","f","36","j","1c"],function(a,b,c,d,e){var f=function(c,f){return d.table(c,f).bind(function(f){var g=d.cells(f),h=a.findIndex(g,function(a){return e.eq(c,a)});return h.map(function(a){return{index:b.constant(a),all:b.constant(g)}})})},g=function(a,b){var d=f(a,b);return d.fold(function(){return c.none(a)},function(b){return b.index()+1<b.all().length?c.middle(a,b.all()[b.index()+1]):c.last(a)})},h=function(a,b){var d=f(a,b);return d.fold(function(){return c.none()},function(b){return b.index()-1>=0?c.middle(a,b.all()[b.index()-1]):c.first(a)})};return{next:g,prev:h}}),g("37",["2g","f"],function(a,b){var c=a.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),d=function(a,b,c,d){return a.fold(b,c,d)},e=function(a){return a.fold(b.identity,b.identity,b.identity)};return{before:c.before,on:c.on,after:c.after,cata:d,getStart:e}}),g("1e",["2g","1k","l","1m","37"],function(a,b,c,d,e){var f=a.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),g=b.immutable("start","soffset","finish","foffset"),h=function(a){return f.exact(a.start(),a.soffset(),a.finish(),a.foffset())},i=function(a){return a.match({domRange:function(a){return c.fromDom(a.startContainer)},relative:function(a,b){return e.getStart(a)},exact:function(a,b,c,d){return a}})},j=function(a){var b=i(a);return d.defaultView(b)};return{domRange:f.domRange,relative:f.relative,exact:f.exact,exactFromRange:h,range:g,getWin:j}}),g("38",["1c","l","1m"],function(a,b,c){var d=function(a,b,d,e){var f=c.owner(a),g=f.dom().createRange();return g.setStart(a.dom(),b),g.setEnd(d.dom(),e),g},e=function(a,c,e,f){var g=d(a,c,e,f);return b.fromDom(g.commonAncestorContainer)},f=function(b,c,e,f){var g=d(b,c,e,f),h=a.eq(b,e)&&c===f;return g.collapsed&&!h};return{after:f,commonAncestorContainer:e}}),g("39",["e","l","23"],function(a,b,c){var d=function(d,e){var f=e||c,g=f.createDocumentFragment();return a.each(d,function(a){g.appendChild(a.dom())}),b.fromDom(g)};return{fromElements:d}}),g("3a",["f","g","1c","l"],function(a,b,c,d){var e=function(a,b){var c=a.document.createRange();return f(c,b),c},f=function(a,b){a.selectNodeContents(b.dom())},g=function(a,b){return b.compareBoundaryPoints(a.END_TO_START,a)<1&&b.compareBoundaryPoints(a.START_TO_END,a)>-1},h=function(a){return a.document.createRange()},i=function(a,b){b.fold(function(b){a.setStartBefore(b.dom())},function(b,c){a.setStart(b.dom(),c)},function(b){a.setStartAfter(b.dom())})},j=function(a,b){b.fold(function(b){a.setEndBefore(b.dom())},function(b,c){a.setEnd(b.dom(),c)},function(b){a.setEndAfter(b.dom())})},k=function(a,b){o(a),a.insertNode(b.dom())},l=function(a,b,d,e){return c.eq(a,d)&&b===e},m=function(a,b,c){var d=a.document.createRange();return i(d,b),j(d,c),d},n=function(a,b,c,d,e){var f=a.document.createRange();return f.setStart(b.dom(),c),f.setEnd(d.dom(),e),f},o=function(a){a.deleteContents()},p=function(a){var b=a.cloneContents();return d.fromDom(b)},q=function(b){return{left:a.constant(b.left),top:a.constant(b.top),right:a.constant(b.right),bottom:a.constant(b.bottom),width:a.constant(b.width),height:a.constant(b.height)}},r=function(a){var c=a.getClientRects(),d=c.length>0?c[0]:a.getBoundingClientRect();return d.width>0||d.height>0?b.some(d).map(q):b.none()},s=function(a){var c=a.getBoundingClientRect();return c.width>0||c.height>0?b.some(c).map(q):b.none()},t=function(a){return a.toString()};return{create:h,replaceWith:k,selectNodeContents:e,selectNodeContentsUsing:f,isCollapsed:l,relativeToNative:m,exactToNative:n,deleteContents:o,cloneFragment:p,getFirstRect:r,getBounds:s,isWithin:g,toString:t}}),g("1n",["2g","f","g","3b","l","3a"],function(a,b,c,d,e,f){var g=a.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),h=function(a,b,c){return b(e.fromDom(c.startContainer),c.startOffset,e.fromDom(c.endContainer),c.endOffset)},i=function(a,e){return e.match({domRange:function(a){return{ltr:b.constant(a),rtl:c.none}},relative:function(b,e){return{ltr:d.cached(function(){return f.relativeToNative(a,b,e)}),rtl:d.cached(function(){return c.some(f.relativeToNative(a,e,b))})}},exact:function(b,e,g,h){return{ltr:d.cached(function(){return f.exactToNative(a,b,e,g,h)}),rtl:d.cached(function(){return c.some(f.exactToNative(a,g,h,b,e))})}}})},j=function(a,b){var c=b.ltr();if(c.collapsed){var d=b.rtl().filter(function(a){return a.collapsed===!1});return d.map(function(a){return g.rtl(e.fromDom(a.endContainer),a.endOffset,e.fromDom(a.startContainer),a.startOffset)}).getOrThunk(function(){return h(a,g.ltr,c)})}return h(a,g.ltr,c)},k=function(a,b){var c=i(a,b);return j(a,c)},l=function(a,b){var c=k(a,b);return c.match({ltr:function(b,c,d,e){var f=a.document.createRange();return f.setStart(b.dom(),c),f.setEnd(d.dom(),e),f},rtl:function(b,c,d,e){var f=a.document.createRange();return f.setStart(d.dom(),e),f.setEnd(b.dom(),c),f}})};return{ltr:g.ltr,rtl:g.rtl,diagnose:k,asLtrRange:l}}),g("5m",["3v"],function(a){var b=function(b,c,d,e,f){if(0===f)return 0;if(c===e)return f-1;for(var g=e,h=1;h<f;h++){var i=b(h),j=a.abs(c-i.left);if(d>i.bottom);else{if(d<i.top||j>g)return h-1;g=j}}return 0},c=function(a,b,c){return b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom};return{inRect:c,searchForPoint:b}}),g("5n",["g","3m","1l","5m","3v"],function(a,b,c,d,e){var f=function(a,b,e,f,g){var h=function(c){var d=a.dom().createRange();return d.setStart(b.dom(),c),d.collapse(!0),d},i=function(a){var b=h(a);return b.getBoundingClientRect()},j=c.get(b).length,k=d.searchForPoint(i,e,f,g.right,j);return h(k)},g=function(c,e,g,h){var i=c.dom().createRange();i.selectNode(e.dom());var j=i.getClientRects(),k=b.findMap(j,function(b){return d.inRect(b,g,h)?a.some(b):a.none()});return k.map(function(a){return f(c,e,g,h,a)})};return{locate:g}}),g("4p",["g","3m","n","1m","5m","5n","3v"],function(a,b,c,d,e,f,g){var h=function(c,f,g,h){var j=c.dom().createRange(),k=d.children(f);return b.findMap(k,function(b){return j.selectNode(b.dom()),e.inRect(j.getBoundingClientRect(),g,h)?i(c,b,g,h):a.none()})},i=function(a,b,d,e){var g=c.isText(b)?f.locate:h;return g(a,b,d,e)},j=function(a,b,c,d){var e=a.dom().createRange();e.selectNode(b.dom());var f=e.getBoundingClientRect(),h=g.max(f.left,g.min(f.right,c)),j=g.max(f.top,g.min(f.bottom,d));return i(a,b,h,j)};return{locate:j}}),g("4q",["g","1m","1d"],function(a,b,c){var d=!0,e=!1,f=function(a,b){return b-a.left<a.right-b?d:e},g=function(a,b,c){var d=a.dom().createRange();return d.selectNode(b.dom()),d.collapse(c),d},h=function(a,b,e){var h=a.dom().createRange();h.selectNode(b.dom());var i=h.getBoundingClientRect(),j=f(i,e),k=j===d?c.first:c.last;return k(b).map(function(b){return g(a,b,j)})},i=function(b,c,d){var e=c.dom().getBoundingClientRect(),h=f(e,d);return a.some(g(b,c,h))},j=function(a,c,d){var e=0===b.children(c).length?i:h;return e(a,c,d)};return{search:j}}),g("3c",["g","l","1m","1e","4p","4q","23","3v"],function(a,b,c,d,e,f,g,h){var i=function(b,c,d){return a.from(b.dom().caretPositionFromPoint(c,d)).bind(function(c){if(null===c.offsetNode)return a.none();var d=b.dom().createRange();return d.setStart(c.offsetNode,c.offset),d.collapse(),a.some(d)})},j=function(b,c,d){return a.from(b.dom().caretRangeFromPoint(c,d))},k=function(a,b,c,d){var f=a.dom().createRange();f.selectNode(b.dom());var g=f.getBoundingClientRect(),i=h.max(g.left,h.min(g.right,c)),j=h.max(g.top,h.min(g.bottom,d));return e.locate(a,b,i,j)},l=function(a,d,e){return b.fromPoint(a,d,e).bind(function(b){var g=function(){return f.search(a,b,d)};return 0===c.children(b).length?g():k(a,b,d,e).orThunk(g)})},m=g.caretPositionFromPoint?i:g.caretRangeFromPoint?j:l,n=function(a,c,e){var f=b.fromDom(a.document);return m(f,c,e).map(function(a){return d.range(b.fromDom(a.startContainer),a.startOffset,b.fromDom(a.endContainer),a.endOffset)})};return{fromPoint:n}}),g("3d",["e","l","n","y","27","3a","1n"],function(a,b,c,d,e,f,g){var h=function(b,c,g,h){var i=f.create(b),j=e.is(c,h)?[c]:[],k=j.concat(d.descendants(c,h));return a.filter(k,function(a){return f.selectNodeContentsUsing(i,a),f.isWithin(g,i)})},i=function(a,d,e){var f=g.asLtrRange(a,d),i=b.fromDom(f.commonAncestorContainer);return c.isElement(i)?h(a,i,f,e):[]};return{find:i}}),g("3e",["e","l","n","1e","37"],function(a,b,c,d,e){var f=function(b,d){var f=c.name(b);return"input"===f?e.after(b):a.contains(["br","img"],f)?0===d?e.before(b):e.after(b):e.on(b,d)},g=function(a,b){var c=a.fold(e.before,f,e.after),g=b.fold(e.before,f,e.after);return d.relative(c,g)},h=function(a,b,c,e){var g=f(a,b),h=f(c,e);return d.relative(g,h)},i=function(a){return a.match({domRange:function(a){var c=b.fromDom(a.startContainer),d=b.fromDom(a.endContainer);return h(c,a.startOffset,d,a.endOffset)},relative:g,exact:h})};return{beforeSpecial:f,preprocess:i,preprocessRelative:g,preprocessExact:h}}),g("1f",["g","38","l","39","1m","1e","3a","1n","3c","3d","3e"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(b,c){a.from(b.getSelection()).each(function(a){a.removeAllRanges(),a.addRange(c)})},m=function(a,b,c,d,e){var f=g.exactToNative(a,b,c,d,e);l(a,f)},n=function(a,b,c){return j.find(a,b,c)},o=function(a,b){return h.diagnose(a,b).match({ltr:function(b,c,d,e){m(a,b,c,d,e)},rtl:function(b,c,d,e){var f=a.getSelection();f.extend?(f.collapse(b.dom(),c),f.extend(d.dom(),e)):m(a,d,e,b,c)}})},p=function(a,b,c,d,e){var f=k.preprocessExact(b,c,d,e);o(a,f)},q=function(a,b,c){var d=k.preprocessRelative(b,c);o(a,d)},r=function(a){var b=f.getWin(a).dom(),c=function(a,c,d,e){return g.exactToNative(b,a,c,d,e)},d=k.preprocess(a);return h.diagnose(b,d).match({ltr:c,rtl:c})},s=function(b){if(b.rangeCount>0){var d=b.getRangeAt(0),e=b.getRangeAt(b.rangeCount-1);return a.some(f.range(c.fromDom(d.startContainer),d.startOffset,c.fromDom(e.endContainer),e.endOffset))}return a.none();
5
- },t=function(d){var e=c.fromDom(d.anchorNode),g=c.fromDom(d.focusNode);return b.after(e,d.anchorOffset,g,d.focusOffset)?a.some(f.range(c.fromDom(d.anchorNode),d.anchorOffset,c.fromDom(d.focusNode),d.focusOffset)):s(d)},u=function(a,b){var c=g.selectNodeContents(a,b);l(a,c)},v=function(a,b){var d=g.selectNodeContents(a,b);return f.range(c.fromDom(d.startContainer),d.startOffset,c.fromDom(d.endContainer),d.endOffset)},w=function(b){var c=b.getSelection();return c.rangeCount>0?t(c):a.none()},x=function(a){return w(a).map(function(a){return f.exact(a.start(),a.soffset(),a.finish(),a.foffset())})},y=function(a,b){var c=h.asLtrRange(a,b);return g.getFirstRect(c)},z=function(a,b){var c=h.asLtrRange(a,b);return g.getBounds(c)},A=function(a,b,c){return i.fromPoint(a,b,c)},B=function(a,b){var c=h.asLtrRange(a,b);return g.toString(c)},C=function(a){var b=a.getSelection();b.removeAllRanges()},D=function(a,b){var c=h.asLtrRange(a,b);return g.cloneFragment(c)},E=function(a,b,c){var e=h.asLtrRange(a,b),f=d.fromElements(c,a.document);g.replaceWith(e,f)},F=function(a,b){var c=h.asLtrRange(a,b);g.deleteContents(c)};return{setExact:p,getExact:w,get:x,setRelative:q,toNative:r,setToElement:u,clear:C,clone:D,replace:E,deleteAt:F,forElement:v,getFirstRect:y,getBounds:z,getAtPoint:A,findWithin:n,getAsString:B}}),g("1g",["d"],function(a){return a("tinymce.util.VK")}),g("7",["e","g","1b","j","1c","l","n","y","t","1d","1e","1f","1g","z","o"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=function(a,b,d,e){return t(a,b,c.next(d),e)},q=function(a,b,d,e){return t(a,b,c.prev(d),e)},r=function(a,b){var c=k.exact(b,0,b,0);return l.toNative(c)},s=function(b,c){var d=h.descendants(c,"tr");return a.last(d).bind(function(a){return i.descendant(a,"td,th").map(function(a){return r(b,a)})})},t=function(a,c,e,f,g){return e.fold(b.none,b.none,function(b,c){return j.first(c).map(function(b){return r(a,b)})},function(b){return d.table(b,c).bind(function(c){var d=o.noMenu(b);return a.undoManager.transact(function(){f.insertRowsAfter(c,d)}),s(a,c)})})},u=["table","li","dl"],v=function(b,c,h,i){if(b.keyCode===m.TAB){var j=n.getBody(c),k=function(b){var c=g.name(b);return e.eq(b,j)||a.contains(u,c)},l=c.selection.getRng();if(l.collapsed){var o=f.fromDom(l.startContainer);d.cell(o,k).each(function(a){b.preventDefault();var d=b.shiftKey?q:p,e=d(c,k,a,h,i);e.each(function(a){c.selection.setRng(a)})})}}};return{handle:v}}),g("3f",["1k"],function(a){var b=a.immutable("selection","kill");return{response:b}}),g("1j",[],function(){var a=function(a){return function(b){return b===a}},b=a(38),c=a(40),d=function(a){return a>=37&&a<=40};return{ltr:{isBackward:a(37),isForward:a(39)},rtl:{isBackward:a(39),isForward:a(37)},isUp:b,isDown:c,isNavigation:d}});g("4r",["f","l","37","1n"],function(a,b,c,d){var e=function(c,e){var f=d.asLtrRange(c,e);return{start:a.constant(b.fromDom(f.startContainer)),soffset:a.constant(f.startOffset),finish:a.constant(b.fromDom(f.endContainer)),foffset:a.constant(f.endOffset)}},f=function(b,d,e,f){return{start:a.constant(c.on(b,d)),finish:a.constant(c.on(e,f))}};return{convertToRange:e,makeSitus:f}});g("3g",["4r","f","1t","g","l","1e","37","1f"],function(a,b,c,d,e,f,g,h){return function(i){var j=function(a,b){return d.from(i.document.elementFromPoint(a,b)).map(e.fromDom)},k=function(a){return a.dom().getBoundingClientRect()},l=function(a,d,e,g){var j=f.exact(a,d,e,g);return h.getFirstRect(i,j).map(function(a){return c.map(a,b.apply)})},m=function(){return h.get(i).map(function(b){return a.convertToRange(i,b)})},n=function(b){var c=f.relative(b.start(),b.finish());return a.convertToRange(i,c)},o=function(a,c){return h.getAtPoint(i,a,c).map(function(a){return{start:b.constant(g.on(a.start(),a.soffset())),finish:b.constant(g.on(a.finish(),a.foffset()))}})},p=function(){h.clear(i)},q=function(a){h.setToElement(i,a)},r=function(a){h.setExact(i,a.start(),a.soffset(),a.finish(),a.foffset())},s=function(a,b){h.setRelative(i,a,b)},t=function(){return i.innerHeight},u=function(){return i.scrollY},v=function(a,b){i.scrollBy(a,b)};return{elementFromPoint:j,getRect:k,getRangedRect:l,getSelection:m,fromSitus:n,situsFromPoint:o,clearSelection:p,setSelection:r,setRelativeSelection:s,selectContents:q,getInnerHeight:t,getScrollY:u,scrollBy:v}}}),g("3h",["3f","3l","4r","f","g","1c","t","2b","1e","37"],function(a,b,c,d,e,f,g,h,i,j){var k=function(a,b,c,d,h,i,j){return f.eq(c,h)&&d===i?e.none():g.closest(c,"td,th",b).bind(function(c){return g.closest(h,"td,th",b).bind(function(d){return l(a,b,c,d,j)})})},l=function(d,g,i,j,k){if(!f.eq(i,j)){var l=b.identify(i,j,g).getOr([]);if(l.length>0)return k(d,l,i,j),e.some(a.response(e.some(c.makeSitus(i,0,i,h.getEnd(i))),!0))}return e.none()},m=function(a,c,d,e,f){var g=function(a){return f.clear(d),f.selectRange(d,a.boxes(),a.start(),a.finish()),a.boxes()};return b.shiftSelection(e,a,c,f.firstSelectedSelector(),f.lastSelectedSelector()).map(g)};return{sync:k,detect:l,update:m}}),g("5o",["1k"],function(a){var b=a.immutableBag(["left","top","right","bottom"],[]),c=function(a,c){return b({left:a.left(),top:a.top()+c,right:a.right(),bottom:a.bottom()+c})},d=function(a,c){return b({left:a.left(),top:a.top()-c,right:a.right(),bottom:a.bottom()-c})},e=function(a,c){var d=a.bottom()-a.top();return b({left:a.left(),top:c-d,right:a.right(),bottom:c})},f=function(a,c){var d=a.bottom()-a.top();return b({left:a.left(),top:c,right:a.right(),bottom:c+d})},g=function(a,c,d){return b({left:a.left()+c,top:a.top()+d,right:a.right()+c,bottom:a.bottom()+d})},h=function(a){return a.top()},i=function(a){return a.bottom()},j=function(a){return"("+a.left()+", "+a.top()+") -> ("+a.right()+", "+a.bottom()+")"};return{nu:b,moveUp:d,moveDown:c,moveBottomTo:e,moveTopTo:f,getTop:h,getBottom:i,translate:g,toString:j}}),g("5p",["5o","g","n","2b"],function(a,b,c,d){var e=function(a,c,e){return e>=0&&e<d.getEnd(c)?a.getRangedRect(c,e,c,e+1):e>0?a.getRangedRect(c,e-1,c,e):b.none()},f=function(b){return a.nu({left:b.left,top:b.top,right:b.right,bottom:b.bottom})},g=function(a,c){return b.some(a.getRect(c))},h=function(a,d,h){return c.isElement(d)?g(a,d,h).map(f):c.isText(d)?e(a,d,h).map(f):b.none()},i=function(a,e){return c.isElement(e)?g(a,e).map(f):c.isText(e)?a.getRangedRect(e,0,e,d.getEnd(e)).map(f):b.none()};return{getBoxAt:h,getEntireBox:i}}),g("64",["e","g","1k"],function(a,b,c){var d=c.immutable("item","mode"),e=function(a,b,c,e){var g=void 0!==e?e:f;return a.property().parent(b).map(function(a){return d(a,g)})},f=function(a,b,c,e){var f=void 0!==e?e:g;return c.sibling(a,b).map(function(a){return d(a,f)})},g=function(a,b,c,e){var f=void 0!==e?e:g,h=a.property().children(b),i=c.first(h);return i.map(function(a){return d(a,f)})},h=[{current:e,next:f,fallback:b.none()},{current:f,next:g,fallback:b.some(e)},{current:g,next:g,fallback:b.some(f)}],i=function(b,c,d,e,f){var g=void 0!==f?f:h,j=a.find(g,function(a){return a.current===d});return j.bind(function(a){return a.current(b,c,e,a.next).orThunk(function(){return a.fallback.bind(function(a){return i(b,c,a,e)})})})};return{backtrack:e,sidestep:f,advance:g,go:i}}),g("65",["g"],function(a){var b=function(){var b=function(a,b){return a.query().prevSibling(b)},c=function(b){return b.length>0?a.some(b[b.length-1]):a.none()};return{sibling:b,first:c}},c=function(){var b=function(a,b){return a.query().nextSibling(b)},c=function(b){return b.length>0?a.some(b[0]):a.none()};return{sibling:b,first:c}};return{left:b,right:c}}),g("63",["g","64","65"],function(a,b,c){var d=function(c,e,f,g,h,i){var j=b.go(c,e,g,h);return j.bind(function(b){return i(b.item())?a.none():f(b.item())?a.some(b.item()):d(c,b.item(),f,b.mode(),h,i)})},e=function(a,e,f,g){return d(a,e,f,b.sidestep,c.left(),g)},f=function(a,e,f,g){return d(a,e,f,b.sidestep,c.right(),g)};return{left:e,right:f}}),g("5q",["f","63","64","65"],function(a,b,c,d){var e=function(a,b){return 0===a.property().children(b).length},f=function(b,c,d){return h(b,c,a.curry(e,b),d)},g=function(b,c,d){return i(b,c,a.curry(e,b),d)},h=function(a,c,d,e){return b.left(a,c,d,e)},i=function(a,c,d,e){return b.right(a,c,d,e)},j=function(){return{left:d.left,right:d.right}},k=function(a,b,d,e,f){return c.go(a,b,d,e,f)};return{before:f,after:g,seekLeft:h,seekRight:i,walkers:j,walk:k,backtrack:c.backtrack,sidestep:c.sidestep,advance:c.advance}}),g("4w",["56","5q"],function(a,b){var c=a(),d=function(a,d,e){return b.gather(c,a,d,e)},e=function(a,d){return b.before(c,a,d)},f=function(a,d){return b.after(c,a,d)},g=function(a,d,e){return b.seekLeft(c,a,d,e)},h=function(a,d,e){return b.seekRight(c,a,d,e)},i=function(){return b.walkers()},j=function(a,d,e,f){return b.walk(c,a,d,e,f)};return{gather:d,before:e,after:f,seekLeft:g,seekRight:h,walkers:i,walk:j}}),g("4u",["5o","5p","2g","f","g","4w","48","n","2a","3v"],function(a,b,c,d,e,f,g,h,i,j){var k=5,l=100,m=c.generate([{none:[]},{retry:["caret"]}]),n=function(a,b){return a.left()<b.left()||j.abs(b.right()-a.left())<1||a.left()>b.right()},o=function(a,c,e){return i.closest(c,g.isBlock).fold(d.constant(!1),function(c){return b.getEntireBox(a,c).exists(function(a){return n(e,a)})})},p=function(b,c,d,e,f){var g=a.moveDown(f,k);return j.abs(d.bottom()-e.bottom())<1?m.retry(g):d.top()>f.bottom()?m.retry(g):d.top()===f.bottom()?m.retry(a.moveDown(f,1)):o(b,c,f)?m.retry(a.translate(g,k,0)):m.none()},q=function(b,c,d,e,f){var g=a.moveUp(f,k);return j.abs(d.top()-e.top())<1?m.retry(g):d.bottom()<f.top()?m.retry(g):d.bottom()===f.top()?m.retry(a.moveUp(f,1)):o(b,c,f)?m.retry(a.translate(g,k,0)):m.none()},r={point:a.getTop,adjuster:q,move:a.moveUp,gather:f.before},s={point:a.getBottom,adjuster:p,move:a.moveDown,gather:f.after},t=function(a,b,c){return a.elementFromPoint(b,c).filter(function(a){return"table"===h.name(a)}).isSome()},u=function(a,b,c,d,e){return v(a,b,c,b.move(d,k),e)},v=function(a,c,d,f,g){return 0===g?e.some(f):t(a,f.left(),c.point(f))?u(a,c,d,f,g-1):a.situsFromPoint(f.left(),c.point(f)).bind(function(h){return h.start().fold(e.none,function(h,i){return b.getEntireBox(a,h,i).bind(function(b){return c.adjuster(a,h,b,d,f).fold(e.none,function(b){return v(a,c,d,b,g-1)})}).orThunk(function(){return e.some(f)})},e.none)})},w=function(a,b){return a.situsFromPoint(b.left(),b.bottom()+k)},x=function(a,b){return a.situsFromPoint(b.left(),b.top()-k)},y=function(a,b,c){return a.point(b)>c.getInnerHeight()?e.some(a.point(b)-c.getInnerHeight()):a.point(b)<0?e.some(-a.point(b)):e.none()},z=function(a,b,c){var d=a.move(c,k),e=v(b,a,c,d,l).getOr(d);return y(a,e,b).fold(function(){return b.situsFromPoint(e.left(),a.point(e))},function(c){return b.scrollBy(0,c),b.situsFromPoint(e.left(),a.point(e)-c)})};return{tryUp:d.curry(z,r),tryDown:d.curry(z,s),ieTryUp:x,ieTryDown:w,getJumpSize:d.constant(k)}}),g("4v",["2g","3z","1c","t","2b"],function(a,b,c,d,e){var f=a.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),g=function(a,b,c){var d=a.getRect(b),e=a.getRect(c);return e.right>d.left&&e.left<d.right},h=function(a,h,j,k,l,m,n){return d.closest(k,"td,th",n).bind(function(j){return d.closest(h,"td,th",n).map(function(d){return c.eq(j,d)?c.eq(k,j)&&e.getEnd(j)===l?m(d):f.none("in same cell"):b.sharedOne(i,[j,d]).fold(function(){return g(a,d,j)?f.success():m(d)},function(a){return m(d)})})}).getOr(f.none("default"))},i=function(a){return d.closest(a,"tr")},j=function(a,b,c,d,e){return a.fold(b,c,d,e)};return{verify:h,cata:j,adt:f}}),g("5s",["1k"],function(a){var b=a.immutable("element","offset"),c=a.immutable("element","deltaOffset"),d=a.immutable("element","start","finish"),e=a.immutable("begin","end"),f=a.immutable("element","text");return{point:b,delta:c,range:d,points:e,text:f}}),g("66",["e","f","g","1k","1c","2a","y","t","1m"],function(a,b,c,d,e,f,g,h,i){var j=d.immutable("ancestor","descendants","element","index"),k=d.immutable("parent","children","element","index"),l=function(a,b){return f.closest(a,function(a){return i.parent(a).exists(function(a){return e.eq(a,b)})})},m=function(a){return i.parent(a).bind(function(b){var c=i.children(b);return n(c,a).map(function(d){return k(b,c,a,d)})})},n=function(c,d){return a.findIndex(c,b.curry(e.eq,d))},o=function(a,b){return i.parent(a).bind(function(c){var d=g.children(c,b);return n(d,a).map(function(b){return k(c,d,a,b)})})},p=function(a,b,c){return h.closest(a,b).bind(function(b){var d=g.descendants(b,c);return n(d,a).map(function(c){return j(b,d,a,c)})})};return{childOf:l,indexOf:n,indexInParent:m,selectorsInParent:o,descendantsInAncestor:p}}),g("5r",["4v","f","g","5s","n","1l","66","1m","2b","37"],function(a,b,c,d,e,f,g,h,i,j){var k=function(a){return"br"===e.name(a)},l=function(a,b,d){return b(a,d).bind(function(a){return e.isText(a)&&0===f.get(a).trim().length?l(a,b,d):c.some(a)})},m=function(a,b,c){return c.traverse(b).orThunk(function(){return l(b,c.gather,a)}).map(c.relative)},n=function(a,b){return h.child(a,b).filter(k).orThunk(function(){return h.child(a,b-1).filter(k)})},o=function(a,b,c,d){return n(b,c).bind(function(b){return d.traverse(b).fold(function(){return l(b,d.gather,a).map(d.relative)},function(a){return g.indexInParent(a).map(function(a){return j.on(a.parent(),a.index())})})})},p=function(a,c,d,e){var f=k(c)?m(a,c,e):o(a,c,d,e);return f.map(function(a){return{start:b.constant(a),finish:b.constant(a)}})},q=function(b){return a.cata(b,function(a){return c.none("BR ADT: none")},function(){return c.none()},function(a){return c.some(d.point(a,0))},function(a){return c.some(d.point(a,i.getEnd(a)))})};return{tryBr:p,process:q}}),g("4s",["5o","5p","4u","4v","5r","g","5s","26","1c","2b"],function(a,b,c,d,e,f,g,h,i,j){var k=20,l=h.detect(),m=function(a,b,c){return a.getSelection().bind(function(h){return e.tryBr(b,h.finish(),h.foffset(),c).fold(function(){return f.some(g.point(h.finish(),h.foffset()))},function(f){var g=a.fromSitus(f),i=d.verify(a,h.finish(),h.foffset(),g.finish(),g.foffset(),c.failure,b);return e.process(i)})})},n=function(b,c,e,g,h,k){return 0===k?f.none():q(b,c,e,g,h).bind(function(l){var m=b.fromSitus(l),p=d.verify(b,e,g,m.finish(),m.foffset(),h.failure,c);return d.cata(p,function(){return f.none()},function(){return f.some(l)},function(d){return i.eq(e,d)&&0===g?o(b,e,g,a.moveUp,h):n(b,c,d,0,h,k-1)},function(d){return i.eq(e,d)&&g===j.getEnd(d)?o(b,e,g,a.moveDown,h):n(b,c,d,j.getEnd(d),h,k-1)})})},o=function(a,d,e,f,g){return b.getBoxAt(a,d,e).bind(function(b){return p(a,g,f(b,c.getJumpSize()))})},p=function(a,b,c){return l.browser.isChrome()||l.browser.isSafari()||l.browser.isFirefox()||l.browser.isEdge()?b.otherRetry(a,c):l.browser.isIE()?b.ieRetry(a,c):f.none()},q=function(a,c,d,e,f){return b.getBoxAt(a,d,e).bind(function(b){return p(a,f,b)})},r=function(a,b,c){return m(a,b,c).bind(function(d){return n(a,b,d.element(),d.offset(),c,k).map(a.fromSitus)})};return{handle:r}}),g("4t",["2a"],function(a){var b=function(b){return a.first(b).isSome()},c=function(b,c,d){return a.ancestor(b,c,d).isSome()},d=function(b,c,d){return a.closest(b,c,d).isSome()},e=function(b,c){return a.sibling(b,c).isSome()},f=function(b,c){return a.child(b,c).isSome()},g=function(b,c){return a.descendant(b,c).isSome()};return{any:b,ancestor:c,closest:d,sibling:e,child:f,descendant:g}}),g("3i",["3f","3h","4s","4r","e","f","g","26","1c","4t","y","t","1m","2b","1d"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=h.detect(),q=function(a,b){return j.ancestor(a,function(a){return m.parent(a).exists(function(a){return i.eq(a,b)})})},r=function(a,b,d,e,h){return l.closest(e,"td,th",b).bind(function(e){return l.closest(e,"table",b).bind(function(i){return q(h,i)?c.handle(a,b,d).bind(function(a){return l.closest(a.finish(),"td,th",b).map(function(b){return{start:f.constant(e),finish:f.constant(b),range:f.constant(a)}})}):g.none()})})},s=function(b,c,e,f,h,i){return p.browser.isIE()?g.none():i(f,c).orThunk(function(){return r(b,c,e,f,h).map(function(b){var c=b.range();return a.response(g.some(d.makeSitus(c.start(),c.soffset(),c.finish(),c.foffset())),!0)})})},t=function(b,c){return l.closest(b,"tr",c).bind(function(b){return l.closest(b,"table",c).bind(function(c){var e=k.descendants(c,"tr");return i.eq(b,e[0])?m.prevSibling(c).bind(o.last).map(function(b){var c=n.getEnd(b);return a.response(g.some(d.makeSitus(b,c,b,c)),!0)}):g.none()})})},u=function(b,c){return l.closest(b,"tr",c).bind(function(b){return l.closest(b,"table",c).bind(function(c){var e=k.descendants(c,"tr");return i.eq(b,e[e.length-1])?m.nextSibling(c).bind(o.first).map(function(b){return a.response(g.some(d.makeSitus(b,0,b,0)),!0)}):g.none()})})},v=function(a,c,d,e,f,g,h){return r(a,d,e,f,g).bind(function(a){return b.detect(c,d,a.start(),a.finish(),h)})};return{navigate:s,select:v,firstUpCheck:t,lastDownCheck:u}}),g("3j",["3l","g","1c","t"],function(a,b,c,d){var e=function(a,b){return d.closest(a,"td,th",b)};return function(d,f,g,h){var i=b.none(),j=function(){i=b.none()},k=function(a){h.clear(f),i=e(a.target(),g)},l=function(b){i.each(function(i){h.clear(f),e(b.target(),g).each(function(b){var e=a.identify(i,b,g).getOr([]);(e.length>1||1===e.length&&!c.eq(i,b))&&(h.selectRange(f,e,i,b),d.selectContents(b))})})},m=function(){i.each(j)};return{mousedown:k,mouseover:l,mouseup:m}}}),g("3k",["4u","4v","4w","1m","37"],function(a,b,c,d,e){return{down:{traverse:d.nextSibling,gather:c.after,relative:e.before,otherRetry:a.tryDown,ieRetry:a.ieTryDown,failure:b.adt.failedDown},up:{traverse:d.prevSibling,gather:c.before,relative:e.before,otherRetry:a.tryUp,ieRetry:a.ieTryUp,failure:b.adt.failedUp}}}),g("1h",["3f","1j","3g","3h","3i","3j","3k","3l","f","g","3m","1k","37"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=l.immutable("rows","cols"),o=function(a,b,d,e){var g=c(a),h=f(g,b,d,e);return{mousedown:h.mousedown,mouseover:h.mouseover,mouseup:h.mouseup}},p=function(f,l,o,p){var q=c(f),r=function(){return p.clear(l),j.none()},s=function(c,f,s,t,u,v){var w=c.raw().which,x=c.raw().shiftKey===!0,y=h.retrieve(l,p.selectedSelector()).fold(function(){return b.isDown(w)&&x?i.curry(e.select,q,l,o,g.down,t,f,p.selectRange):b.isUp(w)&&x?i.curry(e.select,q,l,o,g.up,t,f,p.selectRange):b.isDown(w)?i.curry(e.navigate,q,o,g.down,t,f,e.lastDownCheck):b.isUp(w)?i.curry(e.navigate,q,o,g.up,t,f,e.firstUpCheck):j.none},function(c){var e=function(e){return function(){var f=k.findMap(e,function(a){return d.update(a.rows(),a.cols(),l,c,p)});return f.fold(function(){return h.getEdges(l,p.firstSelectedSelector(),p.lastSelectedSelector()).map(function(c){var d=b.isDown(w)||v.isForward(w)?m.after:m.before;return q.setRelativeSelection(m.on(c.first(),0),d(c.table())),p.clear(l),a.response(j.none(),!0)})},function(b){return j.some(a.response(j.none(),!0))})}};return b.isDown(w)&&x?e([n(1,0)]):b.isUp(w)&&x?e([n(-1,0)]):v.isBackward(w)&&x?e([n(0,-1),n(-1,0)]):v.isForward(w)&&x?e([n(0,1),n(1,0)]):b.isNavigation(w)&&x===!1?r:j.none});return y()},t=function(a,c,e,f,g){return h.retrieve(l,p.selectedSelector()).fold(function(){var h=a.raw().which,i=a.raw().shiftKey===!0;return i===!1?j.none():b.isNavigation(h)?d.sync(l,o,c,e,f,g,p.selectRange):j.none()},j.none)};return{keydown:s,keyup:t}};return{mouse:o,keyboard:p}}),g("4x",["e","3n","4n","1p"],function(a,b,c,d){var e=function(c,d){a.each(d,function(a){b.add(c,a)})},f=function(c,d){a.each(d,function(a){b.remove(c,a)})},g=function(c,d){a.each(d,function(a){b.toggle(c,a)})},h=function(c,d){return a.forall(d,function(a){return b.has(c,a)})},i=function(c,d){return a.exists(d,function(a){return b.has(c,a)})},j=function(a){for(var b=a.dom().classList,c=new d(b.length),e=0;e<b.length;e++)c[e]=b.item(e);return c},k=function(a){return c.supports(a)?j(a):c.get(a)};return{add:e,remove:f,toggle:g,hasAll:h,hasAny:i,get:k}}),g("3o",["3n","4x"],function(a,b){var c=function(b){return function(c){a.add(c,b)}},d=function(b){return function(c){a.remove(c,b)}},e=function(a){return function(c){b.remove(c,a)}},f=function(b){return function(c){return a.has(c,b)}};return{addClass:c,removeClass:d,removeClasses:e,hasClass:f}}),g("1i",["e","r","3n","3o","y"],function(a,b,c,d,e){var f=function(b){var f=d.addClass(b.selected()),g=d.removeClasses([b.selected(),b.lastSelected(),b.firstSelected()]),h=function(c){var d=e.descendants(c,b.selectedSelector());a.each(d,g)},i=function(d,e,g,i){h(d),a.each(e,f),c.add(g,b.firstSelected()),c.add(i,b.lastSelected())};return{clear:h,selectRange:i,selectedSelector:b.selectedSelector,firstSelectedSelector:b.firstSelectedSelector,lastSelectedSelector:b.lastSelectedSelector}},g=function(c){var d=function(a){b.remove(a,c.selected()),b.remove(a,c.firstSelected()),b.remove(a,c.lastSelected())},f=function(a){b.set(a,c.selected(),"1")},g=function(b){var f=e.descendants(b,c.selectedSelector());a.each(f,d)},h=function(d,e,h,i){g(d),a.each(e,f),b.set(h,c.firstSelected(),"1"),b.set(i,c.lastSelected(),"1")};return{clear:g,selectRange:h,selectedSelector:c.selectedSelector,firstSelectedSelector:c.firstSelectedSelector,lastSelectedSelector:c.lastSelectedSelector}};return{byClass:f,byAttr:g}}),g("8",["1h","1i","1j","f","g","1k","j","1c","l","n","1l","r","1m","1e","1n","z","10","9"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){return function(s,t){var u=f.immutableBag(["mousedown","mouseover","mouseup","keyup","keydown"],[]),v=e.none(),w=b.byAttr(r);s.on("init",function(b){var f=s.getWin(),r=p.getBody(s),x=p.getIsRoot(s),y=function(){var a=s.selection,b=i.fromDom(a.getStart()),c=i.fromDom(a.getEnd()),f=g.table(b),j=g.table(c),k=f.bind(function(a){return j.bind(function(b){return h.eq(a,b)?e.some(!0):e.none()})});k.fold(function(){w.clear(r)},d.noop)},z=a.mouse(f,r,x,w),A=a.keyboard(f,r,x,w),B=function(a,b){b.kill()&&a.kill(),b.selection().each(function(a){var b=n.relative(a.start(),a.finish()),c=o.asLtrRange(f,b);s.selection.setRng(c)})},C=function(a){var b=G(a);if(b.raw().shiftKey&&c.isNavigation(b.raw().which)){var d=s.selection.getRng(),e=i.fromDom(d.startContainer),f=i.fromDom(d.endContainer);A.keyup(b,e,d.startOffset,f,d.endOffset).each(function(a){B(b,a)})}},D=function(a){return!(l.has(a,"data-mce-bogus")||"br"===j.name(a)||j.isText(a)&&0===k.get(a).length)},E=function(){var a=i.fromDom(s.getBody()),b=m.lastChild(a),c=function(a){return m.prevSibling(a).bind(function(a){return D(a)?e.some(a):c(a)})};return b.bind(function(a){return D(a)?e.some(a):c(a)})},F=function(a){var b=G(a);t().each(function(a){a.hideBars()}),40===a.which&&E().each(function(a){"table"===j.name(a)&&(s.settings.forced_root_block?s.dom.add(s.getBody(),s.settings.forced_root_block,s.settings.forced_root_block_attrs,"<br/>"):s.dom.add(s.getBody(),"br"))});var d=s.selection.getRng(),e=i.fromDom(s.selection.getStart()),f=i.fromDom(d.startContainer),g=i.fromDom(d.endContainer),h=q.directionAt(e).isRtl()?c.rtl:c.ltr;A.keydown(b,f,d.startOffset,g,d.endOffset,h).each(function(a){B(b,a)}),t().each(function(a){a.showBars()})},G=function(a){var b=i.fromDom(a.target),c=function(){a.stopPropagation()},e=function(){a.preventDefault()},f=d.compose(e,c);return{target:d.constant(b),x:d.constant(a.x),y:d.constant(a.y),stop:c,prevent:e,kill:f,raw:d.constant(a)}},H=function(a){return 0===a.button},I=function(a){return void 0===a.buttons||0!==(1&a.buttons)},J=function(a){H(a)&&z.mousedown(G(a))},K=function(a){I(a)&&z.mouseover(G(a))},L=function(a){H&&z.mouseup(G(a))};s.on("mousedown",J),s.on("mouseover",K),s.on("mouseup",L),s.on("keyup",C),s.on("keydown",F),s.on("nodechange",y),v=e.some(u({mousedown:J,mouseover:K,mouseup:L,keyup:C,keydown:F}))});var x=function(){v.each(function(a){})};return{clear:w.clear,destroy:x}}}),g("a",["1o","z","9","p"],function(a,b,c,d){return function(e){var f=function(){var f=b.getBody(e);return a.retrieve(f,c.selectedSelector()).fold(function(){return void 0===e.selection.getStart()?d.none():d.single(e.selection)},function(a){return d.multiple(a)})};return{get:f}}}),g("b",["f","14","15"],function(a,b,c){var d=b.each,e=function(b){function e(a){return function(){b.execCommand(a)}}var f=[];d("inserttable tableprops deletetable | cell row column".split(" "),function(a){"|"==a?f.push({text:"-"}):f.push(b.menuItems[a])}),b.addButton("table",{type:"menubutton",title:"Table",menu:f}),b.addButton("tableprops",{title:"Table properties",onclick:a.curry(c.open,b,!0),icon:"table"}),b.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),b.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),b.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),b.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),b.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),b.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),b.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),b.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),b.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),b.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),b.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),b.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),b.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),b.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),b.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},f=function(a){var b=function(b){var c=a.dom.is(b,"table")&&a.getBody().contains(b);return c},c=a.settings.table_toolbar;""!==c&&c!==!1&&(c||(c="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"),a.addContextToolbar(b,c))};return{addButtons:e,addToolbars:f}}),g("c",["f","e","g","j","l","3","o","15"],function(a,b,c,d,e,f,g,h){var i=function(i,j){function k(a){return function(){i.execCommand(a)}}var l=c.none(),m=[],n=[],o=[],p=[],q=function(a){a.disabled(!0)},r=function(a){a.disabled(!1)},s=function(){var a=this;m.push(a),l.fold(function(){q(a)},function(b){r(a)})},t=function(){var a=this;n.push(a),l.fold(function(){q(a)},function(b){r(a)})},u=function(){var a=this;o.push(a),l.fold(function(){q(a)},function(b){a.disabled(b.mergable().isNone())})},v=function(){var a=this;p.push(a),l.fold(function(){q(a)},function(b){a.disabled(b.unmergable().isNone())})},w=function(){l.fold(function(){b.each(m,q),b.each(n,q),b.each(o,q),b.each(p,q)},function(a){b.each(m,r),b.each(n,r),b.each(o,function(b){b.disabled(a.mergable().isNone())}),b.each(p,function(b){b.disabled(a.unmergable().isNone())})})};i.on("init",function(){i.on("nodechange",function(a){var b=c.from(i.dom.getParent(i.selection.getStart(),"th,td"));l=b.bind(function(a){var b=e.fromDom(a),c=d.table(b);return c.map(function(a){return g.forMenu(j,a,b)})}),w()})});var x=function(){var a="";a='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var b=0;b<10;b++){a+="<tr>";for(var c=0;c<10;c++)a+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*b+c)+'" href="#" data-mce-x="'+c+'" data-mce-y="'+b+'"></a></td>';a+="</tr>"}return a+="</table>",a+='<div class="mce-text-center" role="presentation">1 x 1</div>'},y=function(a,b,c,d){var e,f,g,h,i,j=d.getEl().getElementsByTagName("table")[0],k=d.isRtl()||"tl-tr"==d.parent().rel;for(j.nextSibling.innerHTML=b+1+" x "+(c+1),k&&(b=9-b),f=0;f<10;f++)for(e=0;e<10;e++)h=j.rows[f].childNodes[e].firstChild,i=(k?e>=b:e<=b)&&f<=c,a.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode},z=i.settings.table_grid===!1?{text:"Table",icon:"table",context:"table",onclick:a.curry(h.open,i)}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),h.open(i))},onshow:function(){y(i,0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");i.dom.removeClass(a,"mce-active"),i.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:x(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),b===this.lastX&&c===this.lastY||(y(i,b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),i.undoManager.transact(function(){f.insert(i,b.lastX+1,b.lastY+1)}),i.addVisual())}}]},A={text:"Table properties",context:"table",onPostRender:s,onclick:a.curry(h.open,i,!0)},B={text:"Delete table",context:"table",onPostRender:s,cmd:"mceTableDelete"},C={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:k("mceTableInsertRowBefore"),onPostRender:t},{text:"Insert row after",onclick:k("mceTableInsertRowAfter"),onPostRender:t},{text:"Delete row",onclick:k("mceTableDeleteRow"),onPostRender:t},{text:"Row properties",onclick:k("mceTableRowProps"),onPostRender:t},{text:"-"},{text:"Cut row",onclick:k("mceTableCutRow"),onPostRender:t},{text:"Copy row",onclick:k("mceTableCopyRow"),onPostRender:t},{text:"Paste row before",onclick:k("mceTablePasteRowBefore"),onPostRender:t},{text:"Paste row after",onclick:k("mceTablePasteRowAfter"),onPostRender:t}]},D={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:k("mceTableInsertColBefore"),onPostRender:t},{text:"Insert column after",onclick:k("mceTableInsertColAfter"),onPostRender:t},{text:"Delete column",onclick:k("mceTableDeleteCol"),onPostRender:t}]},E={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:k("mceTableCellProps"),onPostRender:t},{text:"Merge cells",onclick:k("mceTableMergeCells"),onPostRender:u},{text:"Split cell",onclick:k("mceTableSplitCells"),onPostRender:v}]};i.addMenuItem("inserttable",z),i.addMenuItem("tableprops",A),i.addMenuItem("deletetable",B),i.addMenuItem("row",C),i.addMenuItem("column",D),i.addMenuItem("cell",E)};return{addMenuItems:i}}),g("0",["1","2","3","4","5","6","7","8","9","a","b","c"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){var m=this,n=f(a),o=h(a,n.lazyResize),p=d(a,n.lazyWire),q=j(a);e.registerCommands(a,p,o,q),b.registerEvents(a,q,p,o),l.addMenuItems(a,q),k.addButtons(a),k.addToolbars(a),a.on("PreInit",function(){a.serializer.addTempAttr(i.firstSelected()),a.serializer.addTempAttr(i.lastSelected())}),a.settings.table_tab_navigation!==!1&&a.on("keydown",function(b){g.handle(b,a,p,n.lazyWire)}),a.on("remove",function(){n.destroy(),o.destroy()}),m.insertTable=function(b,d){return c.insert(a,b,d)},m.setClipboardRows=e.setClipboardRows,m.getClipboardRows=e.getClipboardRows}return a.add("table",m),function(){}}),d("0")()}();
1
+ !function(){"use strict";var e,t,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},C=function(e){return function(){return e}},u=function(e){return e},R=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var u=new Array(arguments.length-1),n=1;n<arguments.length;n++)u[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=u.concat(n);return i.apply(null,o)}},m=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},a=function(e){return e()},c=C(!1),l=C(!0),f=c,s=l,d=function(){return g},g=(r={fold:function(e,t){return e()},is:f,isSome:f,isNone:s,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:d,ap:d,each:function(){},bind:d,flatten:d,exists:f,forall:s,filter:d,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(r),r),h=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:s,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return h(e(n))},ap:function(e){return e.fold(d,function(e){return h(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:g},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:h,none:d,from:function(e){return null===e||e===undefined?g:h(e)}},p=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}},v=p("string"),b=p("array"),w=p("boolean"),T=p("function"),N=p("number"),D=(o=Array.prototype.indexOf)===undefined?function(e,t){return _(e,t)}:function(e,t){return o.call(e,t)},E=function(e,t){return-1<D(e,t)},O=function(e,t){return W(e,t).isSome()},A=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},k=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},P=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 function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},B=function(e,t,n){return k(e,function(e){n=t(n,e)}),n},M=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return S.some(o)}return S.none()},W=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return S.some(n);return S.none()},_=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},L=Array.prototype.push,q=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);L.apply(t,e[n])}return t},F=function(e,t){var n=A(e,t);return q(n)},j=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,H=function(e){var t=z.call(e,0);return t.reverse(),t},U=(T(Array.from)&&Array.from,Object.keys),V=function(e,t){for(var n=U(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},G=function(e,r){return Y(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},Y=function(r,o){var i={};return V(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},X=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 k(t,function(e,t){r[e]=C(n[t])}),r}},K=function(e){return e.slice(0).sort()},J=function(e,t){throw new Error("All required keys ("+K(e).join(", ")+") were not specified. Specified keys were: "+K(t).join(", ")+".")},$=function(e){throw new Error("Unsupported keys for object: "+K(e).join(", "))},Q=function(t,e){if(!b(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");k(e,function(e){if(!v(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},Z=function(e){var n=K(e);M(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(", ")+"].")})},ee=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Q("required",o),Q("optional",i),Z(u),function(t){var n=U(t);j(o,function(e){return E(n,e)})||J(o,n);var e=P(n,function(e){return!E(u,e)});0<e.length&&$(e);var r={};return k(o,function(e){r[e]=C(t[e])}),k(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?S.some(t[e]):S.none())}),r}},te=X("width","height"),ne=X("rows","columns"),re=X("row","column"),oe=X("x","y"),ie=X("element","rowspan","colspan"),ue=X("element","rowspan","colspan","isNew"),ae={dimensions:te,grid:ne,address:re,coords:oe,extended:X("element","rowspan","colspan","row","column"),detail:ie,detailnew:ue,rowdata:X("element","cells","section"),elementnew:X("element","isNew"),rowdatanew:X("element","cells","section","isNew"),rowcells:X("cells","section"),rowdetails:X("details","section"),bounds:X("startRow","startCol","finishRow","finishCol")},ce=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},le={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 ce(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return ce(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return ce(n)},fromDom:ce,fromPoint:function(e,t,n){var r=e.dom();return S.from(r.elementFromPoint(t,n)).map(ce)}},fe={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},se=fe.ELEMENT,de=fe.DOCUMENT,me=function(e){return e.nodeType!==se&&e.nodeType!==de||0===e.childElementCount},ge={all:function(e,t){var n=t===undefined?document:t.dom();return me(n)?[]:A(n.querySelectorAll(e),le.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==se)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 me(n)?S.none():S.from(n.querySelector(e)).map(le.fromDom)}},he=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},pe="undefined"!=typeof window?window:Function("return this;")(),ve=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:pe,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},be=function(e,t){var n=ve(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},we=function(){return be("Node")},ye=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},xe=function(e,t){return ye(e,t,we().DOCUMENT_POSITION_CONTAINED_BY)},Ce=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Re=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 Te(r(1),r(2))},Se=function(){return Te(0,0)},Te=function(e,t){return{major:e,minor:t}},Ne={nu:Te,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Se():Re(e,n)},unknown:Se},De="Firefox",Ee=function(e,t){return function(){return t===e}},Oe=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ee("Edge",t),isChrome:Ee("Chrome",t),isIE:Ee("IE",t),isOpera:Ee("Opera",t),isFirefox:Ee(De,t),isSafari:Ee("Safari",t)}},Ae={unknown:function(){return Oe({current:undefined,version:Ne.unknown()})},nu:Oe,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(De),safari:C("Safari")},ke="Windows",Pe="Android",Ie="Solaris",Be="FreeBSD",Me=function(e,t){return function(){return t===e}},We=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Me(ke,t),isiOS:Me("iOS",t),isAndroid:Me(Pe,t),isOSX:Me("OSX",t),isLinux:Me("Linux",t),isSolaris:Me(Ie,t),isFreeBSD:Me(Be,t)}},_e={unknown:function(){return We({current:undefined,version:Ne.unknown()})},nu:We,windows:C(ke),ios:C("iOS"),android:C(Pe),linux:C("Linux"),osx:C("OSX"),solaris:C(Ie),freebsd:C(Be)},Le=function(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})},qe=function(e,n){return Le(e,n).map(function(e){var t=Ne.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Fe=function(e,n){return Le(e,n).map(function(e){var t=Ne.detect(e.versionRegexes,n);return{current:e.name,version:t}})},je=function(e,t){return-1!==e.indexOf(t)},ze=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,He=function(t){return function(e){return je(e,t)}},Ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ze],search:function(e){return je(e,"chrome")&&!je(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return je(e,"msie")||je(e,"trident")}},{name:"Opera",versionRegexes:[ze,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:He("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:He("firefox")},{name:"Safari",versionRegexes:[ze,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}}],Ve=[{name:"Windows",search:He("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return je(e,"iphone")||je(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:He("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:He("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:He("linux"),versionRegexes:[]},{name:"Solaris",search:He("sunos"),versionRegexes:[]},{name:"FreeBSD",search:He("freebsd"),versionRegexes:[]}],Ge={browsers:C(Ue),oses:C(Ve)},Ye=function(e){var t,n,r,o,i,u,a,c,l,f,s,d=Ge.browsers(),m=Ge.oses(),g=qe(d,e).fold(Ae.unknown,Ae.nu),h=Fe(m,e).fold(_e.unknown,_e.nu);return{browser:g,os:h,deviceType:(n=g,r=e,o=(t=h).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!c,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(c),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},Xe={detect:Ce(function(){var e=navigator.userAgent;return Ye(e)})},Ke=function(e,t){return e.dom()===t.dom()},Je=Xe.detect().browser.isIE()?function(e,t){return xe(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},$e={eq:Ke,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return O(t,R(Ke,e))},contains:Je,is:ge.is},Qe=function(e){var t=e.dom();return S.from(t.parentNode).map(le.fromDom)},Ze=function(e){var t=e.dom();return S.from(t.previousSibling).map(le.fromDom)},et=function(e){var t=e.dom();return S.from(t.nextSibling).map(le.fromDom)},tt=function(e){var t=e.dom();return A(t.childNodes,le.fromDom)},nt=function(e,t){var n=e.dom().childNodes;return S.from(n[t]).map(le.fromDom)},rt=X("element","offset"),ot={owner:function(e){return le.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return le.fromDom(t)},documentElement:function(e){return le.fromDom(e.dom().ownerDocument.documentElement)},parent:Qe,findIndex:function(n){return Qe(n).bind(function(e){var t=tt(e);return W(t,function(e){return $e.eq(n,e)})})},parents:function(e,t){for(var n=T(t)?t:C(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=le.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},siblings:function(t){return Qe(t).map(tt).map(function(e){return P(e,function(e){return!$e.eq(t,e)})}).getOr([])},prevSibling:Ze,offsetParent:function(e){var t=e.dom();return S.from(t.offsetParent).map(le.fromDom)},prevSiblings:function(e){return H(he(e,Ze))},nextSibling:et,nextSiblings:function(e){return he(e,et)},children:tt,child:nt,firstChild:function(e){return nt(e,0)},lastChild:function(e){return nt(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=tt(e);return 0<n.length&&t<n.length?rt(n[t],0):rt(e,t)}},it=function(e,t,n){return F(ot.children(e),function(e){return ge.is(e,t)?n(e)?[e]:[]:it(e,t,n)})},ut={firstLayer:function(e,t){return it(e,t,C(!0))},filterFirstLayer:it},at=function(e){return e.dom().nodeName.toLowerCase()},ct=function(e){return e.dom().nodeType},lt=function(t){return function(e){return ct(e)===t}},ft=lt(fe.ELEMENT),st=lt(fe.TEXT),dt=lt(fe.DOCUMENT),mt={name:at,type:ct,value:function(e){return e.dom().nodeValue},isElement:ft,isText:st,isDocument:dt,isComment:function(e){return ct(e)===fe.COMMENT||"#comment"===at(e)}},gt=function(e,t,n){if(!(v(n)||w(n)||N(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+"")},ht=function(e,t,n){gt(e.dom(),t,n)},pt=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},vt=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},bt={clone:function(e){return B(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:ht,setAll:function(e,t){var n=e.dom();V(t,function(e,t){gt(n,t,e)})},get:pt,has:vt,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){mt.isElement(o)&&mt.isElement(i)&&k(e,function(e){var t,n,r;n=i,vt(t=o,r=e)&&!vt(n,r)&&ht(n,r,pt(t,r))})}},wt=Ce(function(){return yt(le.fromDom(document))}),yt=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return le.fromDom(t)},xt={body:wt,getBody:yt,inBody:function(e){var t=mt.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},Ct=function(e,t){var n=[];return k(ot.children(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ct(e,t))}),n},Rt={all:function(e){return Ct(xt.body(),e)},ancestors:function(e,t,n){return P(ot.parents(e,n),t)},siblings:function(e,t){return P(ot.siblings(e),t)},children:function(e,t){return P(ot.children(e),t)},descendants:Ct},St={all:function(e){return ge.all(e)},ancestors:function(e,t,n){return Rt.ancestors(e,function(e){return ge.is(e,t)},n)},siblings:function(e,t){return Rt.siblings(e,function(e){return ge.is(e,t)})},children:function(e,t){return Rt.children(e,function(e){return ge.is(e,t)})},descendants:function(e,t){return ge.all(t,e)}};function Tt(e,t,n,r,o){return e(n,r)?S.some(n):T(o)&&o(n)?S.none():t(n,r,o)}var Nt,Dt,Et,Ot,At,kt=function(e,t,n){for(var r=e.dom(),o=T(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=le.fromDom(r);if(t(i))return S.some(i);if(o(i))break}return S.none()},Pt=function(e,t){return M(e.dom().childNodes,x(t,le.fromDom)).map(le.fromDom)},It=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(le.fromDom(e.childNodes[t])))return S.some(le.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return S.none()};return o(e.dom())},Bt={first:function(e){return It(xt.body(),e)},ancestor:kt,closest:function(e,t,n){return Tt(function(e){return t(e)},kt,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Pt(le.fromDom(e.parentNode),function(e){return!$e.eq(t,e)&&n(e)}):S.none()},child:Pt,descendant:It},Mt=function(e,t,n){return Bt.ancestor(e,function(e){return ge.is(e,t)},n)},Wt={first:function(e){return ge.one(e)},ancestor:Mt,sibling:function(e,t){return Bt.sibling(e,function(e){return ge.is(e,t)})},child:function(e,t){return Bt.child(e,function(e){return ge.is(e,t)})},descendant:function(e,t){return ge.one(t,e)},closest:function(e,t,n){return Tt(ge.is,Mt,e,t,n)}},_t=function(e,t,n){var r=n!==undefined?n:C(!1);return r(t)?S.none():E(e,mt.name(t))?S.some(t):Wt.ancestor(t,e.join(","),function(e){return ge.is(e,"table")||r(e)})},Lt=function(t,e){return ot.parent(e).map(function(e){return St.children(e,t)})},qt=R(Lt,"th,td"),Ft=R(Lt,"tr"),jt=function(e,t){return parseInt(bt.get(e,t),10)},zt={cell:function(e,t){return _t(["td","th"],e,t)},firstCell:function(e){return Wt.descendant(e,"th,td")},cells:function(e){return ut.firstLayer(e,"th,td")},neighbourCells:qt,table:function(e,t){return Wt.closest(e,"table",t)},row:function(e,t){return _t(["tr"],e,t)},rows:function(e){return ut.firstLayer(e,"tr")},notCell:function(e,t){return _t(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:Ft,attr:jt,grid:function(e,t,n){var r=jt(e,t),o=jt(e,n);return ae.grid(r,o)}},Ht=function(e){var t=zt.rows(e);return A(t,function(e){var t=e,n=ot.parent(t).map(function(e){var t=mt.name(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=A(zt.cells(e),function(e){var t=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1,n=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1;return ae.detail(e,t,n)});return ae.rowdata(t,r,n)})},Ut=function(e,n){return A(e,function(e){var t=A(zt.cells(e),function(e){var t=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1,n=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1;return ae.detail(e,t,n)});return ae.rowdata(e,t,n.section())})},Vt=function(e,t){return e+","+t},Gt=function(e,t){var n=F(e.all(),function(e){return e.cells()});return P(n,t)},Yt={generate:function(e){var f={},t=[],n=e.length,s=0;k(e,function(e,c){var l=[];k(e.cells(),function(e,t){for(var n=0;f[Vt(c,n)]!==undefined;)n++;for(var r=ae.extended(e.element(),e.rowspan(),e.colspan(),c,n),o=0;o<e.colspan();o++)for(var i=0;i<e.rowspan();i++){var u=n+o,a=Vt(c+i,u);f[a]=r,s=Math.max(s,u+1)}l.push(r)}),t.push(ae.rowdata(e.element(),l,e.section()))});var r=ae.grid(n,s);return{grid:C(r),access:C(f),all:C(t)}},getAt:function(e,t,n){var r=e.access()[Vt(t,n)];return r!==undefined?S.some(r):S.none()},findItem:function(e,t,n){var r=Gt(e,function(e){return n(t,e.element())});return 0<r.length?S.some(r[0]):S.none()},filterItems:Gt,justCells:function(e){var t=A(e.all(),function(e){return e.cells()});return q(t)}},Xt=function(e){return e.style!==undefined},Kt=function(e,t,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Xt(e)&&e.style.setProperty(t,n)},Jt=function(e,t){Xt(e)&&e.style.removeProperty(t)},$t=function(e,t,n){var r=e.dom();Kt(r,t,n)},Qt=function(e,t){return Xt(e)?e.style.getPropertyValue(t):""},Zt=function(e,t){var n=e.dom(),r=Qt(n,t);return S.from(r).filter(function(e){return 0<e.length})},en={copy:function(e,t){var n=e.dom(),r=t.dom();Xt(n)&&Xt(r)&&(r.style.cssText=n.style.cssText)},set:$t,preserve:function(e,t){var n=bt.get(e,"style"),r=t(e);return(n===undefined?bt.remove:bt.set)(e,"style",n),r},setAll:function(e,t){var n=e.dom();V(t,function(e,t){Kt(n,t,e)})},setOptions:function(e,t){var n=e.dom();V(t,function(e,t){e.fold(function(){Jt(n,t)},function(e){Kt(n,t,e)})})},remove:function(e,t){var n=e.dom();Jt(n,t),bt.has(e,"style")&&""===bt.get(e,"style").replace(/^\s+|\s+$/g,"")&&bt.remove(e,"style")},get:function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||xt.inBody(e)?r:Qt(n,t);return null===o?undefined:o},getRaw:Zt,getAllRaw:function(e){var t={},n=e.dom();if(Xt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t},isValidValue:function(e,t,n){var r=le.fromTag(e);return $t(r,t,n),Zt(r,t).isSome()},reflow:function(e){return e.dom().offsetWidth},transfer:function(r,o,e){mt.isElement(r)&&mt.isElement(o)&&k(e,function(e){var t,n;t=o,Zt(r,n=e).each(function(e){Zt(t,n).isNone()&&$t(t,n,e)})})}},tn=function(t,n){ot.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},nn=function(e,t){e.dom().appendChild(t.dom())},rn={before:tn,after:function(e,t){ot.nextSibling(e).fold(function(){ot.parent(e).each(function(e){nn(e,t)})},function(e){tn(e,t)})},prepend:function(t,n){ot.firstChild(t).fold(function(){nn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:nn,appendAt:function(e,t,n){ot.child(e,n).fold(function(){nn(e,t)},function(e){tn(e,t)})},wrap:function(e,t){tn(e,t),nn(t,e)}},on={before:function(t,e){k(e,function(e){rn.before(t,e)})},after:function(r,o){k(o,function(e,t){var n=0===t?r:o[t-1];rn.after(n,e)})},prepend:function(t,e){k(e.slice().reverse(),function(e){rn.prepend(t,e)})},append:function(t,e){k(e,function(e){rn.append(t,e)})}},un=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},an={empty:function(e){e.dom().textContent="",k(ot.children(e),function(e){un(e)})},remove:un,unwrap:function(e){var t=ot.children(e);0<t.length&&on.before(e,t),un(e)}},cn=X("minRow","minCol","maxRow","maxCol"),ln=function(e,t){var n,i,r,u,a,c,l,o,f,s,d=function(e){return ge.is(e.element(),t)},m=Ht(e),g=Yt.generate(m),h=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),a=r,l=c=0,V(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:c<n&&(c=n),r<a?a=r:l<o&&(l=o)}}),cn(u,a,c,l)),p="th:not("+t+"),td:not("+t+")",v=ut.filterFirstLayer(e,"th,td",function(e){return ge.is(e,p)});return k(v,an.remove),function(e,t,n,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;l<c;l++)for(var f=!1,s=0;s<a;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(Yt.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=le.fromTag("td"),rn.append(u,le.fromTag("br")),(o?rn.append:rn.prepend)(i,u)):f=!0)}(m,g,h,d),o=e,f=h,s=P(ut.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),k(s,an.remove),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||k(ut.firstLayer(o,"th,td"),function(e){bt.remove(e,"rowspan"),bt.remove(e,"colspan")}),bt.remove(o,"width"),bt.remove(o,"height"),en.remove(o,"width"),en.remove(o,"height"),e},fn=function(e,t){return le.fromDom(e.dom().cloneNode(t))},sn=function(e){return fn(e,!0)},dn=function(e,t){var n=le.fromTag(t),r=bt.clone(e);return bt.setAll(n,r),n},mn=function(e){return fn(e,!1)},gn=sn,hn=function(e,t){var n=dn(e,t),r=ot.children(sn(e));return on.append(n,r),n},pn=(Nt=mt.isText,Dt="text",Et=function(e){return Nt(e)?S.from(e.dom().nodeValue):S.none()},Ot=Xe.detect().browser,{get:function(e){if(!Nt(e))throw new Error("Can only get "+Dt+" value of a "+Dt+" node");return At(e).getOr("")},getOption:At=Ot.isIE()&&10===Ot.version.major?function(e){try{return Et(e)}catch(t){return S.none()}}:Et,set:function(e,t){if(!Nt(e))throw new Error("Can only set raw "+Dt+" value of a "+Dt+" node");e.dom().nodeValue=t}}),vn={get:function(e){return pn.get(e)},getOption:function(e){return pn.getOption(e)},set:function(e,t){pn.set(e,t)}},bn=function(e){return"img"===mt.name(e)?1:vn.getOption(e).fold(function(){return ot.children(e).length},function(e){return e.length})},wn=["img","br"],yn=bn,xn=function(e){return vn.getOption(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||E(wn,mt.name(e))},Cn=function(e,i){var u=function(e){for(var t=ot.children(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return S.some(r);var o=u(r);if(o.isSome())return o}return S.none()};return u(e)},Rn={first:function(e){return Bt.descendant(e,xn)},last:function(e){return Cn(e,xn)}},Sn=function(){var e=le.fromTag("td");return rn.append(e,le.fromTag("br")),e},Tn=function(e,t,n){var r=hn(e,t);return V(n,function(e,t){null===e?bt.remove(r,t):bt.set(r,t,e)}),r},Nn=function(e){return e},Dn=function(e){return function(){return le.fromTag("tr",e.dom())}},En=function(c,e,l){return{row:Dn(e),cell:function(e){var r,o,i,t=ot.owner(e.element()),n=le.fromTag(mt.name(e.element()),t.dom()),u=l.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=0<u.length?(r=e.element(),o=n,i=u,Rn.first(r).map(function(e){var t=i.join(","),n=St.ancestors(e,t,function(e){return $e.eq(e,r)});return I(n,function(e,t){var n=mn(t);return bt.remove(n,"contenteditable"),rn.append(e,n),n},o)}).getOr(o)):n;return rn.append(a,le.fromTag("br")),en.copy(e.element(),n),en.remove(n,"height"),1!==e.colspan()&&en.remove(e.element(),"width"),c(e.element(),n),n},replace:Tn,gap:Sn}},On=function(e){return{row:Dn(e),cell:Sn,replace:Nn,gap:Sn}},An=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,ot.children(le.fromDom(n))},kn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Pn(){return{up:C({selector:Wt.ancestor,closest:Wt.closest,predicate:Bt.ancestor,all:ot.parents}),down:C({selector:St.descendants,predicate:Rt.descendants}),styles:C({get:en.get,getRaw:en.getRaw,set:en.set,remove:en.remove}),attrs:C({get:bt.get,set:bt.set,remove:bt.remove,copyTo:function(e,t){var n=bt.clone(e);bt.setAll(t,n)}}),insert:C({before:rn.before,after:rn.after,afterAll:on.after,append:rn.append,appendAll:on.append,prepend:rn.prepend,wrap:rn.wrap}),remove:C({unwrap:an.unwrap,remove:an.remove}),create:C({nu:le.fromTag,clone:function(e){return le.fromDom(e.dom().cloneNode(!1))},text:le.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:ot.prevSibling,nextSibling:ot.nextSibling}),property:C({children:ot.children,name:mt.name,parent:ot.parent,isText:mt.isText,isComment:mt.isComment,isElement:mt.isElement,getText:vn.get,setText:vn.set,isBoundary:function(e){return!!mt.isElement(e)&&("body"===mt.name(e)||E(kn,mt.name(e)))},isEmptyTag:function(e){return!!mt.isElement(e)&&E(["br","img","hr","input"],mt.name(e))}}),eq:$e.eq,is:$e.is}}var In=X("left","right"),Bn=function(e,t,n){var r=e.property().children(t);return W(r,R(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},Mn=function(n,r,o){return Bn(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),In(t,r)})},Wn=function(n,r,e){return Bn(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),In(r,t)})},_n=function(i,e,u,a){var r=X("first","second","splits"),c=function(e,t,o){var n=r(e,S.none(),o);return u(e)?r(e,t,o):i.property().parent(e).bind(function(r){return a(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return c(n,S.some(e.right()),o.concat(t))}).getOr(n)})};return c(e,S.none(),[])},Ln=function(r,o,e,t){var n=o(r,e);return I(t,function(e,t){var n=o(r,t);return qn(r,e,n)},n)},qn=function(t,e,n){return e.bind(function(e){return n.filter(R(t.eq,e))})},Fn=function(e,t,n){return 0<n.length?Ln(e,t,(r=n)[0],r.slice(1)):S.none();var r},jn=function(e,t){return R(e.eq,t)},zn=function(t,e,n,r){var o=r!==undefined?r:C(!1),i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return W(t,o).fold(function(){return t},function(e){return t.slice(0,e+1)})},c=a(i),l=a(u),f=M(c,function(e){return O(l,jn(t,e))});return{firstpath:C(c),secondpath:C(l),shared:C(f)}},Hn=function(t,e,n){var r=zn(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return S.some([e[0]]);if(o.eq(i,t[0]))return S.some([t[0]]);var n=function(e){var t=H(e),n=W(t,jn(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return W(u,jn(o,r))},r=n(e),a=n(t);return r.bind(function(r){return a.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},Un=zn,Vn=function(e,t,n){return Fn(e,t,n)},Gn=function(e,t,n){return Hn(e,t,n)},Yn=function(e,t,n,r){return Un(e,t,n,r)},Xn=function(e,t,n){return Mn(e,t,n)},Kn=function(e,t,n){return Wn(e,t,n)},Jn=function(e,t,n,r){return _n(e,t,n,r)},$n=Pn(),Qn={sharedOne:function(n,e){return Vn($n,function(e,t){return n(t)},e)},subset:function(e,t){return Gn($n,e,t)},ancestors:function(e,t,n){return Yn($n,e,t,n)},breakToLeft:function(e,t){return Xn($n,e,t)},breakToRight:function(e,t){return Kn($n,e,t)},breakPath:function(e,t,r){return Jn($n,e,t,function(e,t,n){return r(t,n)})}},Zn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},er=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},tr=function(e,t){for(var n=!0,r=R(Zn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&Yt.getAt(e,o,i).exists(r);return n?S.some(t):S.none()},nr=function(e,t,n){var r=Yt.findItem(e,t,$e.eq),o=Yt.findItem(e,n,$e.eq);return r.bind(function(r){return o.map(function(e){return t=r,n=e,ae.bounds(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},rr=nr,or=function(t,e,n){return nr(t,e,n).bind(function(e){return tr(t,e)})},ir=function(r,e,o,i){return Yt.findItem(r,e,$e.eq).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return Yt.getAt(r,t+o,n+i).map(function(e){return e.element()})})},ur=function(n,e,t){return rr(n,e,t).map(function(e){var t=Yt.filterItems(n,R(er,e));return A(t,function(e){return e.element()})})},ar=function(e,t){return Yt.findItem(e,t,function(e,t){return $e.contains(t,e)}).bind(function(e){return e.element()})},cr=function(e){var t=Ht(e);return Yt.generate(t)},lr=function(n,r,o){return zt.table(n).bind(function(e){var t=cr(e);return ir(t,n,r,o)})},fr=function(e,t,n){var r=cr(e);return ur(r,t,n)},sr=function(e,t,n,r,o){var i=cr(e),u=$e.eq(e,n)?t:ar(i,t),a=$e.eq(e,o)?r:ar(i,r);return ur(i,u,a)},dr=function(e,t,n){var r=cr(e);return or(r,t,n)},mr=function(e,t){return Wt.ancestor(e,"table")},gr=ee(["boxes","start","finish"],[]),hr=function(a,c,r){var l=function(t){return function(e){return r(e)||$e.eq(e,t)}};return $e.eq(a,c)?S.some(gr({boxes:S.some([a]),start:a,finish:c})):mr(a).bind(function(u){return mr(c).bind(function(i){if($e.eq(u,i))return S.some(gr({boxes:fr(u,a,c),start:a,finish:c}));if($e.contains(u,i)){var e=0<(t=St.ancestors(c,"td,th",l(u))).length?t[t.length-1]:c;return S.some(gr({boxes:sr(u,a,u,c,i),start:a,finish:e}))}if($e.contains(i,u)){var t,n=0<(t=St.ancestors(a,"td,th",l(i))).length?t[t.length-1]:a;return S.some(gr({boxes:sr(i,a,u,c,i),start:a,finish:n}))}return Qn.ancestors(a,c).shared().bind(function(e){return Wt.closest(e,"table",r).bind(function(e){var t=St.ancestors(c,"td,th",l(e)),n=0<t.length?t[t.length-1]:c,r=St.ancestors(a,"td,th",l(e)),o=0<r.length?r[r.length-1]:a;return S.some(gr({boxes:sr(e,a,u,c,i),start:o,finish:n}))})})})})},pr=hr,vr=function(e,t){var n=St.descendants(e,t);return 0<n.length?S.some(n):S.none()},br=function(e,t,n,r,o){return(i=e,u=o,M(i,function(e){return ge.is(e,u)})).bind(function(e){return lr(e,t,n).bind(function(e){return t=e,n=r,Wt.ancestor(t,"table").bind(function(e){return Wt.descendant(e,n).bind(function(e){return hr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},wr=function(e,t,r){return Wt.descendant(e,t).bind(function(n){return Wt.descendant(e,r).bind(function(t){return Qn.sharedOne(mr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},yr=function(e,t){return vr(e,t)},xr=function(o,e,t){return wr(o,e,t).bind(function(n){var e=function(e){return $e.eq(o,e)},t=Wt.ancestor(n.first(),"thead,tfoot,tbody,table",e),r=Wt.ancestor(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return $e.eq(t,e)?dr(n.table(),n.first(),n.last()):S.none()})})})},Cr="data-mce-selected",Rr="data-mce-first-selected",Sr="data-mce-last-selected",Tr={selected:C(Cr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(Rr),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(Sr),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},Nr=function(u){if(!b(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=[],n={};return k(u,function(e,r){var t=U(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(!b(i))throw new Error("case arguments must be an array");a.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!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=U(e);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!j(a,function(e){return E(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:a,constructor:o,params:n})}}}}),n},Dr=Nr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Er={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Dr.none,multiple:Dr.multiple,single:Dr.single},Or=function(e,t){return Er.cata(t.get(),C([]),u,C([e]))},Ar=function(n,e){return Er.cata(e.get(),S.none,function(t,e){return 0===t.length?S.none():xr(n,Tr.firstSelectedSelector(),Tr.lastSelectedSelector()).bind(function(e){return 1<t.length?S.some({bounds:C(e),cells:C(t)}):S.none()})},S.none)},kr=function(e,t){var n=Or(e,t);return 0<n.length&&j(n,function(e){return bt.has(e,"rowspan")&&1<parseInt(bt.get(e,"rowspan"),10)||bt.has(e,"colspan")&&1<parseInt(bt.get(e,"colspan"),10)})?S.some(n):S.none()},Pr=Or,Ir=function(e){return{element:C(e),mergable:S.none,unmergable:S.none,selection:C([e])}},Br=X("element","clipboard","generators"),Mr={noMenu:Ir,forMenu:function(e,t,n){return{element:C(n),mergable:C(Ar(t,e)),unmergable:C(kr(n,e)),selection:C(Pr(n,e))}},notCell:function(e){return Ir(e)},paste:Br,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:S.none,unmergable:S.none,selection:C(Pr(n,e)),clipboard:C(r),generators:C(o)}}},Wr=function(a,e,c,l){a.on("BeforeGetContent",function(n){!0===n.selection&&Er.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,zt.table(t[0]).map(gn).map(function(e){return[ln(e,Tr.attributeSelector())]})).each(function(e){n.content=A(e,function(e){return t=e,a.selection.serializer.serialize(t.dom(),{});var t}).join("")})},y)}),a.on("BeforeSetContent",function(u){!0===u.selection&&!0===u.paste&&S.from(a.dom.getParent(a.selection.getStart(),"th,td")).each(function(e){var i=le.fromDom(e);zt.table(i).bind(function(t){var e=P(An(u.content),function(e){return"meta"!==mt.name(e)});if(1===e.length&&"table"===mt.name(e[0])){u.preventDefault();var n=le.fromDom(a.getDoc()),r=On(n),o=Mr.paste(i,e[0],r);c.pasteCells(t,o).each(function(e){a.selection.setRng(e),a.focus(),l.clear(t)})}})})})};function _r(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=en.get(e,r);return parseFloat(n)||0}return t},i=function(o,e){return B(e,function(e,t){var n=en.get(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!N(t)&&!t.match(/^[0-9]+$/))throw r+".set accepts only positive integer values. Value was "+t;var n=e.dom();Xt(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Lr=_r("height",function(e){var t=e.dom();return xt.inBody(e)?t.getBoundingClientRect().height:t.offsetHeight}),qr=function(e){return Lr.get(e)},Fr=function(e){return Lr.getOuter(e)},jr=_r("width",function(e){return e.dom().offsetWidth}),zr=function(e){return jr.get(e)},Hr=function(e){return jr.getOuter(e)},Ur=Xe.detect(),Vr=function(e,t,n){return r=en.get(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Gr=function(e){return Ur.browser.isIE()||Ur.browser.isEdge()?(n=Vr(t=e,"padding-top",0),r=Vr(t,"padding-bottom",0),o=Vr(t,"border-top-width",0),i=Vr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===en.get(t,"box-sizing")?u:u-n-r-(o+i)):Vr(e,"height",qr(e));var t,n,r,o,i,u},Yr=/(\d+(\.\d+)?)(\w|%)*/,Xr=/(\d+(\.\d+)?)%/,Kr=/(\d+(\.\d+)?)px|em/,Jr=function(e,t){en.set(e,"height",t+"px")},$r=function(e,t,n,r){var o,i,u,a,c,l,f,s,d,m=parseInt(e,10);return s=l="%",d=(f=e).length-l.length,""!==s&&(f.length<s.length||f.substr(d,d+s.length)!==s)||"table"===mt.name(t)?m:(o=t,i=m,u=n,a=r,c=zt.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),a(o,c),c)},Qr=function(e){var t,n=(t=e,en.getRaw(t,"height").getOrThunk(function(){return Gr(t)+"px"}));return n?$r(n,e,qr,Jr):qr(e)},Zr=function(e,t){return bt.has(e,t)?parseInt(bt.get(e,t),10):1},eo=function(e){return en.getRaw(e,"width").fold(function(){return S.from(bt.get(e,"width"))},function(e){return S.some(e)})},to=function(e,t){return e/t.pixelWidth()*100},no={percentageBasedSizeRegex:C(Xr),pixelBasedSizeRegex:C(Kr),setPixelWidth:function(e,t){en.set(e,"width",t+"px")},setPercentageWidth:function(e,t){en.set(e,"width",t+"%")},setHeight:Jr,getPixelWidth:function(t,n){return eo(t).fold(function(){return zr(t)},function(e){return function(e,t,n){if(Kr.test(t)){var r=Kr.exec(t);return parseInt(r[1],10)}if(Xr.test(t)){var o=Xr.exec(t),i=parseFloat(o[1]);return i/100*n.pixelWidth()}return zr(e)}(t,e,n)})},getPercentageWidth:function(t,n){return eo(t).fold(function(){var e=zr(t);return to(e,n)},function(e){return function(e,t,n){if(Xr.test(t)){var r=Xr.exec(t);return parseFloat(r[1])}var o=zr(e);return to(o,n)}(t,e,n)})},getGenericWidth:function(e){return eo(e).bind(function(e){if(Yr.test(e)){var t=Yr.exec(e);return S.some({width:C(t[1]),unit:C(t[3])})}return S.none()})},setGenericWidth:function(e,t,n){en.set(e,"width",t+n)},getHeight:function(e){return n="rowspan",Qr(t=e)/Zr(t,n);var t,n},getRawWidth:eo},ro=function(n,r){no.getGenericWidth(n).each(function(e){var t=e.width()/2;no.setGenericWidth(n,t,e.unit()),no.setGenericWidth(r,t,e.unit())})},oo=function(e,t){var n=t||le.fromDom(document.documentElement);return Bt.ancestor(e,R($e.eq,n)).isSome()},io=function(e){var t=e.dom();return t===t.window&&e instanceof Window?e:mt.isDocument(e)?t.defaultView||t.parentWindow:null},uo=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return uo(n+e,r+t)}}},ao=uo,co=function(e,t){return e!==undefined?e:t!==undefined?t:0},lo=function(e){var t,n=e.dom(),r=n.ownerDocument,o=r.body,i=le.fromDom(r.documentElement);return o===n?ao(o.offsetLeft,o.offsetTop):oo(e,i)?(t=n.getBoundingClientRect(),ao(t.left,t.top)):ao(0,0)},fo=function(e){var t=e.dom().ownerDocument,n=t.body,r=io(le.fromDom(t)),o=t.documentElement,i=co(r.pageYOffset,o.scrollTop),u=co(r.pageXOffset,o.scrollLeft),a=co(o.clientTop,n.clientTop),c=co(o.clientLeft,n.clientLeft);return lo(e).translate(u-c,i-a)},so=X("row","y"),mo=X("col","x"),go=function(e){return fo(e).left()+Hr(e)},ho=function(e){return fo(e).left()},po=function(e,t){return mo(e,ho(t))},vo=function(e,t){return mo(e,go(t))},bo=function(e){return fo(e).top()},wo=function(n,t,r){if(0===r.length)return[];var e=A(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},yo={delta:u,positions:R(wo,function(e,t){return so(e,bo(t))},function(e,t){return so(e,bo(t)+Fr(t))}),edge:bo},xo={delta:u,edge:ho,positions:R(wo,po,vo)},Co={height:yo,rtl:{delta:function(e,t){return-e},edge:go,positions:R(wo,vo,po)},ltr:xo},Ro={ltr:Co.ltr,rtl:Co.rtl};function So(t){var n=function(e){return t(e).isRtl()?Ro.rtl:Ro.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var To,No=function(e){var t=Ht(e);return Yt.generate(t).grid()},Do=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Do(n())}}},Eo=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Q("required",o),Z(o),function(t){var n=U(t);j(o,function(e){return E(n,e)})||J(o,n),r(o,n);var e=P(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+K(e).join(", ")+") were not.")}(e,i.label),t}},Oo=function(t,e){var n=P(e,function(e){return!E(t,e)});0<n.length&&$(n)},Ao=function(e){return Eo(Oo,e,{validate:T,label:"function"})},ko=function(e){var t=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1,n=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},Po=Ao(["cell","row","replace","gap"]),Io=function(r,e){Po(r);var n=Do(S.none()),o=e!==undefined?e:ko,i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(S.some(t)),a=S.some({item:e,replacement:t}),t},a=S.none();return{getOrInit:function(t,n){return a.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},Bo=function(o,a){return function(n){var r=Do(S.none());Po(n);var i=[],u=function(e){var t=n.replace(e,a,{scope:o});return i.push({item:e,sub:t}),r.get().isNone()&&r.set(S.some(t)),t};return{replaceOrInit:function(t,n){return(r=t,o=n,M(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:r.get}}},Mo=function(n){Po(n);var e=Do(S.none());return{combine:function(t){return e.get().isNone()&&e.set(S.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return en.remove(e,"width"),en.remove(t,"width"),e}},cursor:e.get}},Wo=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],_o=function(e,t){var n=e.property().name(t);return E(Wo,n)},Lo=function(e,t){return E(["br","img","hr","input"],e.property().name(t))},qo=_o,Fo=function(e,t){var n=e.property().name(t);return E(["ol","ul"],n)},jo=Lo,zo=Pn(),Ho=function(e){return qo(zo,e)},Uo=function(e){return Fo(zo,e)},Vo=function(e){return jo(zo,e)},Go=function(e){var t,i=function(e){return"br"===mt.name(e)},n=function(o){return Rn.last(o).bind(function(n){var e,r=(e=n,ot.nextSibling(e).map(function(e){return!!Ho(e)||(Vo(e)?"img"!==mt.name(e):void 0)}).getOr(!1));return ot.parent(n).map(function(e){return!0===r||(t=e,"li"===mt.name(t)||Bt.ancestor(t,Uo).isSome())||i(n)||Ho(e)&&!$e.eq(o,e)?[]:[le.fromTag("br")];var t})}).getOr([])},r=0===(t=F(e,function(e){var t=ot.children(e);return j(t,function(e){return i(e)||mt.isText(e)&&0===vn.get(e).trim().length})?[]:t.concat(n(e))})).length?[le.fromTag("br")]:t;an.empty(e[0]),on.append(e[0],r)},Yo=Object.prototype.hasOwnProperty,Xo=(To=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)Yo.call(o,i)&&(n[i]=To(n[i],o[i]))}return n}),Ko=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Jo=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()},$o=function(e,t){return ae.rowcells(t,e.section())},Qo=function(e,t){return e.cells()[t]},Zo={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return $o(e,u)},setCells:$o,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:Qo,getCellElement:function(e,t){return Qo(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=A(n,t);return ae.rowcells(r,e.section())},cellLength:function(e){return e.cells().length}},ei=function(e,t){if(0===e.length)return 0;var n=e[0];return W(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},ti=function(e,t,n,r){var o,i,u,a,c=(o=e,i=t,o[i]).cells().slice(n),l=ei(c,r),f=(u=e,a=n,A(u,function(e){return Zo.getCell(e,a)})).slice(t),s=ei(f,r);return{colspan:C(l),rowspan:C(s)}},ni=function(o,i){var u=A(o,function(e,t){return A(e.cells(),function(e,t){return!1})});return A(o,function(e,r){var t=F(e.cells(),function(e,t){if(!1===u[r][t]){var n=ti(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[ae.detailnew(e.element(),n.rowspan(),n.colspan(),e.isNew())]}return[]});return ae.rowdetails(t,e.section())})},ri=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var a=Yt.getAt(e,o,u).map(function(e){return ae.elementnew(e.element(),n)}).getOrThunk(function(){return ae.elementnew(t.gap(),!0)});i.push(a)}var c=ae.rowcells(i,e.all()[o].section());r.push(c)}return r},oi=function(e,t,n,r){n===r?bt.remove(e,t):bt.set(e,t,n)},ii=function(o,e){var i=[],u=[],t=function(e,t){var n;0<e.length?function(e,t){var n=Wt.child(o,t).getOrThunk(function(){var e=le.fromTag(t,ot.owner(o).dom());return rn.append(o,e),e});an.empty(n);var r=A(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return an.empty(t),k(e.cells(),function(e){e.isNew()&&u.push(e.element()),oi(e.element(),"colspan",e.colspan(),1),oi(e.element(),"rowspan",e.rowspan(),1),rn.append(t,e.element())}),t});on.append(n,r)}(e,t):(n=t,Wt.child(o,n).each(an.remove))},n=[],r=[],a=[];return k(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":a.push(e)}}),t(n,"thead"),t(r,"tbody"),t(a,"tfoot"),{newRows:C(i),newCells:C(u)}},ui=function(e){return A(e,function(e){var n=mn(e.element());return k(e.cells(),function(e){var t=gn(e.element());oi(t,"colspan",e.colspan(),1),oi(t,"rowspan",e.rowspan(),1),rn.append(n,t)}),n})},ai=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},ci=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},li=function(t,n){if(n<0||n>=t.length-1)return S.none();var e=t[n].fold(function(){var e=H(t.slice(0,n));return Jo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return Jo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},fi=function(e,t,n){var r=e();return M(r,t).orThunk(function(){return S.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},si=function(n){var e=n.grid(),t=ci(0,e.columns()),r=ci(0,e.rows());return A(t,function(t){return fi(function(){return F(r,function(e){return Yt.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return Yt.getAt(n,0,t)})})},di=function(n){var e=n.grid(),t=ci(0,e.rows()),r=ci(0,e.columns());return A(t,function(t){return fi(function(){return F(r,function(e){return Yt.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return Yt.getAt(n,t,0)})})},mi=function(e,t,n,r,o){var i=le.fromTag("div");return en.setAll(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),bt.setAll(i,{"data-column":e,role:"presentation"}),i},gi=function(e,t,n,r,o){var i=le.fromTag("div");return en.setAll(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),bt.setAll(i,{"data-row":e,role:"presentation"}),i},hi=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},pi={resolve:hi("ephox-snooker").resolve},vi=function(e,t){var n=bt.get(e,t);return n===undefined||""===n?[]:n.split(" ")},bi=vi,wi=function(e,t,n){var r=vi(e,t).concat([n]);return bt.set(e,t,r.join(" ")),!0},yi=function(e,t,n){var r=P(vi(e,t),function(e){return e!==n});return 0<r.length?bt.set(e,t,r.join(" ")):bt.remove(e,t),!1},xi=function(e){return bi(e,"class")},Ci=function(e,t){return wi(e,"class",t)},Ri=function(e,t){return yi(e,"class",t)},Si=xi,Ti=Ci,Ni=Ri,Di=function(e,t){return E(xi(e),t)?Ri(e,t):Ci(e,t)},Ei=function(e){return e.dom().classList!==undefined},Oi=function(e,t){return Ei(e)&&e.dom().classList.contains(t)},Ai={add:function(e,t){Ei(e)?e.dom().classList.add(t):Ti(e,t)},remove:function(e,t){var n;Ei(e)?e.dom().classList.remove(t):Ni(e,t),0===(Ei(n=e)?n.dom().classList:Si(n)).length&&bt.remove(n,"class")},toggle:function(e,t){return Ei(e)?e.dom().classList.toggle(t):Di(e,t)},toggler:function(e,t){var n,r,o,i,u,a,c=Ei(e),l=e.dom().classList;return n=function(){c?l.remove(t):Ni(e,t)},r=function(){c?l.add(t):Ti(e,t)},o=Oi(e,t),i=o||!1,{on:u=function(){r(),i=!0},off:a=function(){n(),i=!1},toggle:function(){(i?a:u)()},isOn:function(){return i}}},has:Oi},ki=pi.resolve("resizer-bar"),Pi=pi.resolve("resizer-rows"),Ii=pi.resolve("resizer-cols"),Bi=function(e){var t=St.descendants(e.parent(),"."+ki);k(t,an.remove)},Mi=function(n,e,r){var o=n.origin();k(e,function(e,t){e.each(function(e){var t=r(o,e);Ai.add(t,ki),rn.append(n.parent(),t)})})},Wi=function(e,t,n,r,o,i){var u,a,c,l,f=fo(t),s=0<n.length?o.positions(n,t):[];u=e,a=s,c=f,l=Hr(t),Mi(u,a,function(e,t){var n=gi(t.row(),c.left()-e.left(),t.y()-e.top(),l,7);return Ai.add(n,Pi),n});var d,m,g,h,p=0<r.length?i.positions(r,t):[];d=e,m=p,g=f,h=Fr(t),Mi(d,m,function(e,t){var n=mi(t.col(),t.x()-e.left(),g.top()-e.top(),7,h);return Ai.add(n,Ii),n})},_i=function(e,t){var n=St.descendants(e.parent(),"."+ki);k(n,t)},Li={refresh:function(e,t,n,r){Bi(e);var o=Ht(t),i=Yt.generate(o),u=di(i),a=si(i);Wi(e,t,u,a,n,r)},hide:function(e){_i(e,function(e){en.set(e,"display","none")})},show:function(e){_i(e,function(e){en.set(e,"display","block")})},destroy:Bi,isRowBar:function(e){return Ai.has(e,Pi)},isColBar:function(e){return Ai.has(e,Ii)}},qi=function(e,r){return A(e,function(e){var t,n=(t=e.details(),Jo(t,function(e){return ot.parent(e.element()).map(function(e){var t=ot.parent(e).isNone();return ae.elementnew(e,t)})}).getOrThunk(function(){return ae.elementnew(r.row(),!0)}));return ae.rowdatanew(n.element(),e.details(),e.section(),n.isNew())})},Fi=function(e,t){var n=ni(e,$e.eq);return qi(n,t)},ji=function(e,t){var n=q(A(e.all(),function(e){return e.cells()}));return M(n,function(e){return $e.eq(t,e.element())})},zi=function(a,c,l,f,s){return function(n,r,e,o,i){var t=Ht(r),u=Yt.generate(t);return c(u,e).map(function(e){var t=ri(u,o,!1),n=a(t,e,$e.eq,s(o)),r=Fi(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return S.none()},function(e){var t=ii(r,e.grid());return l(r,e.grid(),i),f(r),Li.refresh(n,r,Co.height,i),S.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},Hi=Fi,Ui=function(t,e){return zt.cell(e.element()).bind(function(e){return ji(t,e)})},Vi=function(t,e){var n=A(e.selection(),function(e){return zt.cell(e).bind(function(e){return ji(t,e)})}),r=Ko(n);return 0<r.length?S.some(r):S.none()},Gi=function(t,n){return zt.cell(n.element()).bind(function(e){return ji(t,e).map(function(e){return Xo(e,{generators:n.generators,clipboard:n.clipboard})})})},Yi=function(t,e){var n=A(e.selection(),function(e){return zt.cell(e).bind(function(e){return ji(t,e)})}),r=Ko(n);return 0<r.length?S.some(Xo({cells:r},{generators:e.generators,clipboard:e.clipboard})):S.none()},Xi=function(e,t){return t.mergable()},Ki=function(e,t){return t.unmergable()},Ji=function(n){return{is:function(e){return n===e},isValue:l,isError:c,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return Ji(n)},orThunk:function(e){return Ji(n)},fold:function(e,t){return t(n)},map:function(e){return Ji(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 S.some(n)}}},$i=function(n){return{is:c,isValue:c,isError:l,getOr:u,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 $i(n)},each:y,bind:function(e){return $i(n)},exists:c,forall:l,toOption:S.none}},Qi={value:Ji,error:$i},Zi=function(e,t){return A(e,function(){return ae.elementnew(t.cell(),!0)})},eu=function(t,e,n){return t.concat(ai(e,function(e){return Zo.setCells(t[t.length-1],Zi(t[t.length-1].cells(),n))}))},tu=function(e,t,n){return A(e,function(e){return Zo.setCells(e,e.cells().concat(Zi(ci(0,t),n)))})},nu=function(e,t,n){if(e.row()>=t.length||e.column()>Zo.cellLength(t[0]))return Qi.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=Zo.cellLength(n[0]),u=n.length;return Qi.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},ru=function(e,t){var n=Zo.cellLength(e[0]),r=Zo.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},ou=function(e,t,n){var r=t.colDelta()<0?tu:u;return(t.rowDelta()<0?eu:u)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},iu=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)Zo.mutateCell(e[o],i,ae.elementnew(r(),!1));return e},uu=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<Zo.cellLength(e[0]);u++){var a=n(Zo.getCellElement(e[i],u),t);!0===a&&!1===o?Zo.mutateCell(e[i],u,ae.elementnew(r(),!0)):!0===a&&(o=!1)}return e},au=function(i,u,a,c){if(0<u&&u<i.length){var e=i[u-1].cells(),t=(n=a,B(e,function(e,t){return O(e,function(e){return n(e.element(),t.element())})?e:e.concat([t])},[]));k(t,function(e){for(var t=S.none(),n=u;n<i.length;n++)for(var r=0;r<Zo.cellLength(i[0]);r++){var o=i[n].cells()[r];a(o.element(),e.element())&&(t.isNone()&&(t=S.some(c())),t.each(function(e){Zo.mutateCell(i[n],r,ae.elementnew(e,!0))}))}})}var n;return i},cu=function(n,r,o,i,u){return nu(n,r,o).map(function(e){var t=ou(r,e,i);return function(e,t,n,r,o){for(var i,u,a,c,l,f,s,d=e.row(),m=e.column(),g=d+n.length,h=m+Zo.cellLength(n[0]),p=d;p<g;p++)for(var v=m;v<h;v++){i=t,u=p,a=v,c=o,f=l=void 0,l=Zo.getCell(i[u],a),f=R(c,l.element()),s=i[u],1<i.length&&1<Zo.cellLength(s)&&(0<a&&f(Zo.getCellElement(s,a-1))||a<s.length-1&&f(Zo.getCellElement(s,a+1))||0<u&&f(Zo.getCellElement(i[u-1],a))||u<i.length-1&&f(Zo.getCellElement(i[u+1],a)))&&uu(t,Zo.getCellElement(t[p],v),o,r.cell);var b=Zo.getCellElement(n[p-d],v-m),w=r.replace(b);Zo.mutateCell(t[p],v,ae.elementnew(w,!0))}return t}(n,t,o,i,u)})},lu=function(e,t,n,r,o){au(t,e,o,r.cell);var i=ru(n,t),u=ou(n,i,r),a=ru(t,u),c=ou(t,a,r);return c.slice(0,e).concat(u).concat(c.slice(e,c.length))},fu=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),a=Zo.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(Zo.getCellElement(n[r-1],t),Zo.getCellElement(n[r],t))?Zo.getCell(n[r],t):ae.elementnew(i(e.element(),o),!0)});return t.concat([a]).concat(u)},su=function(e,n,r,o,i){return A(e,function(e){var t=0<n&&n<Zo.cellLength(e)&&o(Zo.getCellElement(e,n-1),Zo.getCellElement(e,n))?Zo.getCell(e,n):ae.elementnew(i(Zo.getCellElement(e,r),o),!0);return Zo.addCell(e,n,t)})},du=function(e,r,o,i,u){var a=o+1;return A(e,function(e,t){var n=t===r?ae.elementnew(u(Zo.getCellElement(e,o),i),!0):Zo.getCell(e,o);return Zo.addCell(e,a,n)})},mu=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),a=e.slice(i),c=Zo.mapCells(e[t],function(e,t){return t===n?ae.elementnew(o(e.element(),r),!0):e});return u.concat([c]).concat(a)},gu=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},hu=function(e,n,r){var t=A(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return ae.rowcells(t,e.section())});return P(t,function(e){return 0<e.cells().length})},pu=function(e,n,r,o){return A(e,function(e){return Zo.mapCells(e,function(e){return t=e,O(n,function(e){return r(t.element(),e.element())})?ae.elementnew(o(e.element(),r),!0):e;var t})})},vu=function(e,t,n,r){return Zo.getCellElement(e[t],n)!==undefined&&0<t&&r(Zo.getCellElement(e[t-1],n),Zo.getCellElement(e[t],n))},bu=function(e,t,n){return 0<t&&n(Zo.getCellElement(e,t-1),Zo.getCellElement(e,t))},wu=function(n,r,o,e){var t=F(n,function(e,t){return vu(n,t,r,o)||bu(e,r,o)?[]:[Zo.getCell(e,r)]});return pu(n,t,o,e)},yu=function(n,r,o,e){var i=n[r],t=F(i.cells(),function(e,t){return vu(n,r,t,o)||bu(i,t,o)?[]:[e]});return pu(n,t,o,e)},xu=function(e){return{fold:e}},Cu=function(){return xu(function(e,t,n,r,o){return e()})},Ru=function(i){return xu(function(e,t,n,r,o){return t(i)})},Su=function(i,u){return xu(function(e,t,n,r,o){return n(i,u)})},Tu=function(i,u,a){return xu(function(e,t,n,r,o){return r(i,u,a)})},Nu=function(i,u){return xu(function(e,t,n,r,o){return o(i,u)})},Du=function(e,t,i,u){var n,r,a=e.slice(0),o=(r=t,0===(n=e).length?Cu():1===n.length?Ru(0):0===r?Su(0,1):r===n.length-1?Nu(r-1,r):0<r&&r<n.length-1?Tu(r-1,r,r+1):Cu()),c=function(e){return A(e,C(0))},l=C(c(a)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),a[t]-i);return c(a.slice(0,e)).concat([i,n-a[t]]).concat(c(a.slice(t+1)))}var r=Math.max(u.minCellWidth(),a[e]+i),o=a[e]-r;return c(a.slice(0,e)).concat([r-a[e],o]).concat(c(a.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(a[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return c(a.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),a[t]+i);return c(a.slice(0,t)).concat([n-a[t]])})},Eu=function(e,t){return bt.has(e,t)&&1<parseInt(bt.get(e,t),10)},Ou={hasColspan:function(e){return Eu(e,"colspan")},hasRowspan:function(e){return Eu(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(en.get(e,t),10)}},Au=function(e,t,n){return en.getRaw(e,t).fold(function(){return n(e)+"px"},function(e){return e})},ku=function(e){return Au(e,"width",no.getPixelWidth)},Pu=function(e){return Au(e,"height",no.getHeight)},Iu=function(e,t,n,r,o){var i=si(e),u=A(i,function(e){return e.map(t.edge)});return A(i,function(e,t){return e.filter(m(Ou.hasColspan)).fold(function(){var e=li(u,t);return r(e)},function(e){return n(e,o)})})},Bu=function(e){return e.map(function(e){return e+"px"}).getOr("")},Mu=function(e,t,n,r){var o=di(e),i=A(o,function(e){return e.map(t.edge)});return A(o,function(e,t){return e.filter(m(Ou.hasRowspan)).fold(function(){var e=li(i,t);return r(e)},function(e){return n(e)})})},Wu={getRawWidths:function(e,t){return Iu(e,t,ku,Bu)},getPixelWidths:function(e,t,n){return Iu(e,t,no.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Iu(e,t,no.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Mu(e,t,no.getHeight,function(e){return e.getOrThunk(Ou.minHeight)})},getRawHeights:function(e,t){return Mu(e,t,Pu,Bu)}},_u=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},Lu=function(e,n){var t=Yt.justCells(e);return A(t,function(e){var t=_u(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},qu=function(e,n){var t=Yt.justCells(e);return A(t,function(e){var t=_u(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},Fu=function(e,n){return A(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},ju=function(e){var t=parseInt(e,10),n=u;return{width:C(t),pixelWidth:C(t),getWidths:Wu.getPixelWidths,getCellDelta:n,singleColumnWidth:function(e,t){return[Math.max(Ou.minWidth(),e+t)-e]},minCellWidth:Ou.minWidth,setElementWidth:no.setPixelWidth,setTableWidth:function(e,t,n){var r=I(t,function(e,t){return e+t},0);no.setPixelWidth(e,r)}}},zu=function(e,t){if(no.percentageBasedSizeRegex().test(t)){var n=no.percentageBasedSizeRegex().exec(t);return o=n[1],i=e,u=parseFloat(o),a=zr(i),{width:C(u),pixelWidth:C(a),getWidths:Wu.getPercentageWidths,getCellDelta:function(e){return e/a*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Ou.minWidth()/a*100},setElementWidth:no.setPercentageWidth,setTableWidth:function(e,t,n){var r=u+n;no.setPercentageWidth(e,r)}}}if(no.pixelBasedSizeRegex().test(t)){var r=no.pixelBasedSizeRegex().exec(t);return ju(r[1])}var o,i,u,a,c=zr(e);return ju(c)},Hu=function(t){return no.getRawWidth(t).fold(function(){var e=zr(t);return ju(e)},function(e){return zu(t,e)})},Uu=function(e){return Yt.generate(e)},Vu=function(e){var t=Ht(e);return Uu(t)},Gu=function(e,t,n,r){var o=Hu(e),i=o.getCellDelta(t),u=Vu(e),a=o.getWidths(u,r,o),c=Du(a,n,i,o),l=A(c,function(e,t){return e+a[t]}),f=Lu(u,l);k(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},Yu=function(e,n,r,t){var o=Vu(e),i=Wu.getPixelHeights(o,t),u=A(i,function(e,t){return r===t?Math.max(n+e,Ou.minHeight()):e}),a=qu(o,u),c=Fu(o,u);k(c,function(e){no.setHeight(e.element(),e.height())}),k(a,function(e){no.setHeight(e.element(),e.height())});var l=I(u,function(e,t){return e+t},0);no.setHeight(e,l)},Xu=function(e,t,n){var r=Hu(e),o=Uu(t),i=r.getWidths(o,n,r),u=Lu(o,i);k(u,function(e){r.setElementWidth(e.element(),e.width())});var a=I(i,function(e,t){return t+e},0);0<u.length&&r.setElementWidth(e,a)},Ku=function(e){0===zt.cells(e).length&&an.remove(e)},Ju=X("grid","cursor"),$u=function(e,t,n){return Qu(e,t,n).orThunk(function(){return Qu(e,0,0)})},Qu=function(e,t,n){return S.from(e[t]).bind(function(e){return S.from(e.cells()[n]).bind(function(e){return S.from(e.element())})})},Zu=function(e,t,n){return Ju(e,Qu(e,t,n))},ea=function(e){return B(e,function(e,t){return O(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},ta=function(e){return B(e,function(e,t){return O(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},na=function(e,t,n){var r=Ut(e,n),o=Yt.generate(r);return ri(o,t,!0)},ra=Xu,oa={insertRowBefore:zi(function(e,t,n,r){var o=t.row(),i=t.row(),u=fu(e,i,o,n,r.getOrInit);return Zu(u,i,t.column())},Ui,y,y,Io),insertRowsBefore:zi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=ea(t),a=B(u,function(e,t){return fu(e,i,o,n,r.getOrInit)},e);return Zu(a,i,t[0].column())},Vi,y,y,Io),insertRowAfter:zi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=fu(e,i,o,n,r.getOrInit);return Zu(u,i,t.column())},Ui,y,y,Io),insertRowsAfter:zi(function(e,t,n,r){var o=ea(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=B(o,function(e,t){return fu(e,u,i,n,r.getOrInit)},e);return Zu(a,u,t[0].column())},Vi,y,y,Io),insertColumnBefore:zi(function(e,t,n,r){var o=t.column(),i=t.column(),u=su(e,i,o,n,r.getOrInit);return Zu(u,t.row(),i)},Ui,ra,y,Io),insertColumnsBefore:zi(function(e,t,n,r){var o=ta(t),i=o[0].column(),u=o[0].column(),a=B(o,function(e,t){return su(e,u,i,n,r.getOrInit)},e);return Zu(a,t[0].row(),u)},Vi,ra,y,Io),insertColumnAfter:zi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=su(e,i,o,n,r.getOrInit);return Zu(u,t.row(),i)},Ui,ra,y,Io),insertColumnsAfter:zi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ta(t),a=B(u,function(e,t){return su(e,i,o,n,r.getOrInit)},e);return Zu(a,t[0].row(),i)},Vi,ra,y,Io),splitCellIntoColumns:zi(function(e,t,n,r){var o=du(e,t.row(),t.column(),n,r.getOrInit);return Zu(o,t.row(),t.column())},Ui,ra,y,Io),splitCellIntoRows:zi(function(e,t,n,r){var o=mu(e,t.row(),t.column(),n,r.getOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Io),eraseColumns:zi(function(e,t,n,r){var o=ta(t),i=hu(e,o[0].column(),o[o.length-1].column()),u=$u(i,t[0].row(),t[0].column());return Ju(i,u)},Vi,ra,Ku,Io),eraseRows:zi(function(e,t,n,r){var o=ea(t),i=gu(e,o[0].row(),o[o.length-1].row()),u=$u(i,t[0].row(),t[0].column());return Ju(i,u)},Vi,y,Ku,Io),makeColumnHeader:zi(function(e,t,n,r){var o=wu(e,t.column(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo("row","th")),unmakeColumnHeader:zi(function(e,t,n,r){var o=wu(e,t.column(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo(null,"td")),makeRowHeader:zi(function(e,t,n,r){var o=yu(e,t.row(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo("col","th")),unmakeRowHeader:zi(function(e,t,n,r){var o=yu(e,t.row(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo(null,"td")),mergeCells:zi(function(e,t,n,r){var o=t.cells();Go(o);var i=iu(e,t.bounds(),n,C(o[0]));return Ju(i,S.from(o[0]))},Xi,y,y,Mo),unmergeCells:zi(function(e,t,n,r){var o=I(t,function(e,t){return uu(e,t,n,r.combine(t))},e);return Ju(o,S.from(t[0]))},Ki,ra,y,Mo),pasteCells:zi(function(e,n,t,r){var o,i,u,a,c=(o=n.clipboard(),i=n.generators(),u=Ht(o),a=Yt.generate(u),ri(a,i,!0)),l=ae.address(n.row(),n.column());return cu(l,e,c,n.generators(),t).fold(function(){return Ju(e,S.some(n.element()))},function(e){var t=$u(e,n.row(),n.column());return Ju(e,t)})},Gi,ra,y,Io),pasteRowsBefore:zi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=na(t.clipboard(),t.generators(),o),a=lu(i,e,u,t.generators(),n),c=$u(a,t.cells[0].row(),t.cells[0].column());return Ju(a,c)},Yi,y,y,Io),pasteRowsAfter:zi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=na(t.clipboard(),t.generators(),o),a=lu(i,e,u,t.generators(),n),c=$u(a,t.cells[0].row(),t.cells[0].column());return Ju(a,c)},Yi,y,y,Io)},ia=function(e){return le.fromDom(e.getBody())},ua=function(e){return e.getBoundingClientRect().width},aa=function(e){return e.getBoundingClientRect().height},ca=function(t){return function(e){return $e.eq(e,ia(t))}},la=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},fa=function(e){var t=St.descendants(e,"td[data-mce-style],th[data-mce-style]");bt.remove(e,"data-mce-style"),k(t,function(e){bt.remove(e,"data-mce-style")})},sa=function(e){return"rtl"===en.get(e,"direction")?"rtl":"ltr"},da={onDirection:function(t,n){return function(e){return"rtl"===sa(e)?n:t}},getDirection:sa},ma={isRtl:C(!1)},ga={isRtl:C(!0)},ha={directionAt:function(e){return"rtl"===da.getDirection(e)?ga:ma}},pa=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],va={"border-collapse":"collapse",width:"100%"},ba={border:"1"},wa=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},ya=function(e){return e.getParam("table_row_advtab",!0,"boolean")},xa=function(e){return e.getParam("table_advtab",!0,"boolean")},Ca=function(e){return e.getParam("table_style_by_css",!1,"boolean")},Ra=function(e){return e.getParam("table_cell_class_list",[],"array")},Sa=function(e){return e.getParam("table_row_class_list",[],"array")},Ta=function(e){return e.getParam("table_class_list",[],"array")},Na=function(e){return!1===e.getParam("table_responsive_width")},Da=function(e,t){return e.fire("newrow",{node:t})},Ea=function(e,t){return e.fire("newcell",{node:t})},Oa=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Aa=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},ka=function(f,e){var t,n=function(e){return"table"===mt.name(ia(e))},s=(t=f.getParam("table_clone_elements"),v(t)?S.some(t.split(/[ ,]/)):Array.isArray(t)?S.some(t):S.none()),r=function(u,a,c,l){return function(e,t){fa(e);var n=l(),r=le.fromDom(f.getDoc()),o=So(ha.directionAt),i=En(c,r,s);return a(e)?u(n,e,t,i,o).bind(function(e){return k(e.newRows(),function(e){Da(f,e.dom())}),k(e.newCells(),function(e){Ea(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):S.none()}};return{deleteRow:r(oa.eraseRows,function(e){var t=No(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(oa.eraseColumns,function(e){var t=No(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(oa.insertRowsBefore,l,y,e),insertRowsAfter:r(oa.insertRowsAfter,l,y,e),insertColumnsBefore:r(oa.insertColumnsBefore,l,ro,e),insertColumnsAfter:r(oa.insertColumnsAfter,l,ro,e),mergeCells:r(oa.mergeCells,l,y,e),unmergeCells:r(oa.unmergeCells,l,y,e),pasteRowsBefore:r(oa.pasteRowsBefore,l,y,e),pasteRowsAfter:r(oa.pasteRowsAfter,l,y,e),pasteCells:r(oa.pasteCells,l,y,e)}},Pa=function(e,t,r){var n=Ht(e),o=Yt.generate(n);return Vi(o,t).map(function(e){var t=ri(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=Hi(t,r);return ui(n)})},Ia=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ba=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},Ma=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},Wa=function(t,n){Ia.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},_a=function(t,n){Ia.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},La=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},qa=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?la(o.width):"",i.height=o.height?la(o.height):"",r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(i))))},Fa=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);r.find("#borderStyle").value(i["border-style"]||""),r.find("#borderColor").value(i["border-color"]||""),r.find("#backgroundColor").value(i["background-color"]||""),r.find("#width").value(i.width||""),r.find("#height").value(i.height||"")},ja={createStyleForm:function(n){var e=function(){var e=n.getParam("color_picker_callback");if(e)return function(t){return e.call(n,function(e){t.control.value(e).fire("change")},t.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:R(qa,n)},items:[{label:"Style",name:"style",type:"textbox",onchange:R(Fa,n)},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:R(qa,n),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}},buildListItems:function(e,r,t){var o=function(e,n){return n=n||[],Ia.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},updateStyleField:qa,extractAdvancedStyles:function(e,t){var n=e.parseStyle(e.getAttrib(t,"style")),r={};return n["border-style"]&&(r.borderStyle=n["border-style"]),n["border-color"]&&(r.borderColor=n["border-color"]),n["background-color"]&&(r.backgroundColor=n["background-color"]),r.style=e.serializeStyle(n),r},updateAdvancedFields:Fa,syncAdvancedStyleFields:function(e,t){t.control.rootControl.find("#style")[0].getEl().isEqualNode(document.activeElement)?Fa(e,t):qa(e,t)}},za=function(r,o,e){var i,u=r.dom;function a(e,t,n){(1===o.length||n)&&u.setAttrib(e,t,n)}function c(e,t,n){(1===o.length||n)&&u.setStyle(e,t,n)}wa(r)&&ja.syncAdvancedStyleFields(r,e),i=e.control.rootControl.toJSON(),r.undoManager.transact(function(){Ia.each(o,function(e){var t,n;a(e,"scope",i.scope),1===o.length?a(e,"style",i.style):(t=e,n=i.style,delete t.dataset.mceStyle,t.style.cssText+=";"+n),a(e,"class",i["class"]),c(e,"width",la(i.width)),c(e,"height",la(i.height)),i.type&&e.nodeName.toLowerCase()!==i.type&&(e=u.rename(e,i.type)),1===o.length&&(Wa(r,e),_a(r,e)),i.align&&Ba(r,e,i.align),i.valign&&Ma(r,e,i.valign)}),r.focus()})},Ha=function(t){var e,n,r,o=[];if(o=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!o.length&&e&&o.push(e),e=e||o[0]){var i,u,a,c;1<o.length?n={width:"",height:"",scope:"","class":"",align:"",valign:"",style:"",type:e.nodeName.toLowerCase()}:(u=e,a=(i=t).dom,c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class"),type:u.nodeName.toLowerCase(),style:"",align:"",valign:""},Ia.each("left center right".split(" "),function(e){i.formatter.matchNode(u,"align"+e)&&(c.align=e)}),Ia.each("top middle bottom".split(" "),function(e){i.formatter.matchNode(u,"valign"+e)&&(c.valign=e)}),wa(i)&&Ia.extend(c,ja.extractAdvancedStyles(a,u)),n=c),0<Ra(t).length&&(r={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Ra(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[e.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};wa(t)?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:l},ja.createStyleForm(t)],onsubmit:R(za,t,o)}):t.windowManager.open({title:"Cell properties",data:n,body:l,onsubmit:R(za,t,o)})}};function Ua(f,s,d,e){var m=f.dom;function g(e,t,n){(1===s.length||n)&&m.setAttrib(e,t,n)}ya(f)&&ja.syncAdvancedStyleFields(f,e);var h=e.control.rootControl.toJSON();f.undoManager.transact(function(){Ia.each(s,function(e){var t,n,r,o,i,u,a,c,l;g(e,"scope",h.scope),g(e,"style",h.style),g(e,"class",h["class"]),t=e,n="height",r=la(h.height),(1===s.length||r)&&m.setStyle(t,n,r),h.type!==e.parentNode.nodeName.toLowerCase()&&(o=f.dom,i=e,u=h.type,a=o.getParent(i,"table"),c=i.parentNode,(l=o.select(u,a)[0])||(l=o.create(u),a.firstChild?"CAPTION"===a.firstChild.nodeName?o.insertAfter(l,a.firstChild):a.insertBefore(l,a.firstChild):a.appendChild(l)),l.appendChild(i),c.hasChildNodes()||o.remove(c)),h.align!==d.align&&(Wa(f,e),Ba(f,e,h.align))}),f.focus()})}var Va=function(t){var e,n,r,o,i,u,a,c,l,f,s=t.dom,d=[];e=s.getParent(t.selection.getStart(),"table"),n=s.getParent(t.selection.getStart(),"td,th"),Ia.each(e.rows,function(t){Ia.each(t.cells,function(e){if(s.getAttrib(e,"data-mce-selected")||e===n)return d.push(t),!1})}),(r=d[0])&&(1<d.length?i={height:"",scope:"",style:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=t).dom,f={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class"),align:"",style:"",type:c.parentNode.nodeName.toLowerCase()},Ia.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),ya(a)&&Ia.extend(f,ja.extractAdvancedStyles(l,c)),i=f),0<Sa(t).length&&(o={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Sa(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},ya(t)?t.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},ja.createStyleForm(t)],onsubmit:R(Ua,t,d,i)}):t.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:R(Ua,t,d,i)}))},Ga=tinymce.util.Tools.resolve("tinymce.Env"),Ya={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Xa=function(e,t,n,r,o){void 0===o&&(o=Ya);var i=le.fromTag("table");en.setAll(i,o.styles),bt.setAll(i,o.attributes);var u=le.fromTag("tbody");rn.append(i,u);for(var a=[],c=0;c<e;c++){for(var l=le.fromTag("tr"),f=0;f<t;f++){var s=c<n||f<r?le.fromTag("th"):le.fromTag("td");f<r&&bt.set(s,"scope","row"),c<n&&bt.set(s,"scope","col"),rn.append(s,le.fromTag("br")),o.percentages&&en.set(s,"width",100/t+"%"),rn.append(l,s)}a.push(l)}return on.append(u,a),i},Ka=function(e){return e.dom().innerHTML},Ja=function(e){var t=le.fromTag("div"),n=le.fromDom(e.dom().cloneNode(!0));return rn.append(t,n),Ka(t)},$a=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},Qa=function(o,e,t){var n,r,i=o.getParam("table_default_styles",va,"object"),u={styles:i,attributes:(r=o,r.getParam("table_default_attributes",ba,"object")),percentages:(n=i.width,v(n)&&-1!==n.indexOf("%")&&!Na(o))},a=Xa(t,e,0,0,u);bt.set(a,"data-mce-id","__mce");var c=Ja(a);return o.insertContent(c),Wt.descendant(ia(o),'table[data-mce-id="__mce"]').map(function(e){var t,n,r;return Na(o)&&en.set(e,"width",en.get(e,"width")),bt.remove(e,"data-mce-id"),t=o,k(St.descendants(e,"tr"),function(e){Da(t,e.dom()),k(St.descendants(e,"th,td"),function(e){Ea(t,e.dom())})}),n=o,r=e,Wt.descendant(r,"td,th").each(R($a,n)),e.dom()}).getOr(null)};function Za(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)Za(e,t.children[o],n,r)}var ec=function(e,t,n){var r,o,i=e.dom;xa(e)&&ja.syncAdvancedStyleFields(e,n),!1===(o=n.control.rootControl.toJSON())["class"]&&delete o["class"],e.undoManager.transact(function(){t||(t=Qa(e,o.cols||1,o.rows||1)),function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=la(n.height),o.getAttrib(t,"width")&&!Ca(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=la(n.width),Ca(e)?(u["border-width"]=la(n.border),u["border-spacing"]=la(n.cellspacing),Ia.extend(i,{"data-mce-border-color":n.borderColor,"data-mce-cell-padding":n.cellpadding,"data-mce-border":n.border})):Ia.extend(i,{border:n.border,cellpadding:n.cellpadding,cellspacing:n.cellspacing}),Ca(e)&&t.children)for(var a=0;a<t.children.length;a++)Za(o,t.children[a],{"border-width":la(n.border),"border-color":n.borderColor,padding:la(n.cellpadding)});n.style?Ia.extend(u,o.parseStyle(n.style)):u=Ia.extend({},o.parseStyle(o.getAttrib(t,"style")),u),i.style=o.serializeStyle(u),o.setAttribs(t,i)}(e,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=Ga.ie?"\xa0":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),Wa(e,t),o.align&&Ba(e,t,o.align),e.focus(),e.addVisual()})},tc=function(t,e){var n,r,o,i,u,a,c,l,f,s,d=t.dom,m={};!0===e?(n=d.getParent(t.selection.getStart(),"table"))&&(c=n,l=(a=t).dom,f={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||La(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||La(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},Ia.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),xa(a)&&Ia.extend(f,ja.extractAdvancedStyles(l,c)),m=f):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),0<Ta(t).length&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Ta(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(s=t,s.getParam("table_appearance_options",!0,"boolean")?[r,o,{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)}])},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},xa(t)?t.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},ja.createStyleForm(t)],onsubmit:R(ec,t,n)}):t.windowManager.open({title:"Table properties",data:m,body:u,onsubmit:R(ec,t,n)})},nc=Ia.each,rc=function(a,t,c,l,n){var r=ca(a),f=function(){return le.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"))},s=function(e){return zt.table(e,r)},d=function(e){return{width:ua(e.dom()),height:ua(e.dom())}},o=function(t){var n=f();s(n).each(function(i){var e=Mr.forMenu(l,i,n),u=d(i);t(i,e).each(function(e){var t,n,r,o;t=a,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(Oa(t,r.dom(),n.width,n.height),Aa(t,r.dom(),o.width,o.height)),a.selection.setRng(e),a.focus(),c.clear(i),fa(i)})})},i=function(e){var o=f();return s(o).bind(function(e){var t=le.fromDom(a.getDoc()),n=Mr.forMenu(l,e,o),r=En(y,t,S.none());return Pa(e,n,r)})},u=function(u){n.get().each(function(e){var o=A(e,function(e){return gn(e)}),i=f();s(i).bind(function(t){var e=le.fromDom(a.getDoc()),n=On(e),r=Mr.pasteRows(l,t,i,o,n);u(t,r).each(function(e){a.selection.setRng(e),a.focus(),c.clear(t)})})})};nc({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){n.set(i()),o(t.deleteRow)},mceTableCopyRow:function(e){n.set(i())},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){var e=le.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"));zt.table(e,r).filter(m(r)).each(function(e){var t=le.fromText("");rn.after(e,t),an.remove(e);var n=a.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),a.selection.setRng(n)})}},function(e,t){a.addCommand(t,e)}),nc({mceInsertTable:R(tc,a),mceTableProps:R(tc,a,!0),mceTableRowProps:R(Va,a),mceTableCellProps:R(Ha,a)},function(n,e){a.addCommand(e,function(e,t){n(t)})})},oc=function(e){var t=S.from(e.dom().documentElement).map(le.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(ao(0,0))}},ic=function(e,t){return{parent:C(t),view:C(e),origin:C(ao(0,0))}};function uc(e){var n=X.apply(null,e),r=[];return{bind:function(e){if(e===undefined)throw"Event bind error: undefined handler";r.push(e)},unbind:function(t){r=P(r,function(e){return e!==t})},trigger:function(){var t=n.apply(null,arguments);k(r,function(e){e(t)})}}}var ac={create:function(e){return{registry:G(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:G(e,function(e){return e.trigger})}}},cc={mode:Ao(["compare","extract","mutate","sink"]),sink:Ao(["element","start","stop","destroy"]),api:Ao(["forceDrop","drop","move","delayDrop"])},lc={resolve:hi("ephox-dragster").resolve},fc=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,a,c=le.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=c,n=e.clientX,r=e.clientY,o=l,i=f,u=s,a=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(a)});g(d)}}},sc=function(e,t,n,r,o){var i=fc(n,r);return e.dom().addEventListener(t,i,o),{unbind:R(dc,e,t,i,o)}},dc=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},mc=function(e,t,n,r){return sc(e,t,n,r,!1)},gc=function(e,t,n,r){return sc(e,t,n,r,!0)},hc=C(!0),pc={bind:function(e,t,n){return mc(e,t,hc,n)},capture:function(e,t,n){return gc(e,t,hc,n)}},vc=cc.mode({compare:function(e,t){return ao(t.left()-e.left(),t.top()-e.top())},extract:function(e){return S.some(ao(e.x(),e.y()))},sink:function(e,t){var n,r,o,i=(n=t,r=Xo({layerClass:lc.resolve("blocker")},n),o=le.fromTag("div"),bt.set(o,"role","presentation"),en.setAll(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ai.add(o,lc.resolve("blocker")),Ai.add(o,r.layerClass),{element:function(){return o},destroy:function(){an.remove(o)}}),u=pc.bind(i.element(),"mousedown",e.forceDrop),a=pc.bind(i.element(),"mouseup",e.drop),c=pc.bind(i.element(),"mousemove",e.move),l=pc.bind(i.element(),"mouseout",e.delayDrop);return cc.sink({element:i.element,start:function(e){rn.append(e,i.element())},stop:function(){an.remove(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function bc(){var i=S.none(),u=ac.create({move:uc(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=S.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=S.none()},events:u.registry}}function wc(){var e={onEvent:function(e,t){},reset:y},t=bc(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var yc=function(t,n,e){var r,o,i,u=!1,a=ac.create({start:uc([]),stop:uc([])}),c=wc(),l=function(){d.stop(),c.isOn()&&(c.off(),a.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&clearTimeout(i),i=setTimeout(function(){r.apply(null,e),i=null},o)}});c.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);if(u)return t.apply(null,e)}},d=n.sink(cc.api({forceDrop:l,drop:s(l),move:s(function(e,t){f.cancel(),c.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),c.on(),a.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:a.registry}},xc={transform:function(e,t){var n=t!==undefined?t:{},r=n.mode!==undefined?n.mode:vc;return yc(e,r,t)}};function Cc(){var n,r=ac.create({drag:uc(["xDelta","yDelta","target"])}),o=S.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=ac.create({drag:uc(["xDelta","yDelta"])})).registry};return e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){o=S.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}}var Rc={any:function(e){return Wt.first(e).isSome()},ancestor:function(e,t,n){return Wt.ancestor(e,t,n).isSome()},sibling:function(e,t){return Wt.sibling(e,t).isSome()},child:function(e,t){return Wt.child(e,t).isSome()},descendant:function(e,t){return Wt.descendant(e,t).isSome()},closest:function(e,t,n){return Wt.closest(e,t,n).isSome()}},Sc=pi.resolve("resizer-bar-dragging");function Tc(e,n){var r=Co.height,t=function(o,t,i){var n=Cc(),r=xc.transform(n,{}),u=S.none(),e=function(e,t){return S.from(bt.get(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Ou.getInt(n.target(),"top");en.set(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Ou.getInt(n.target(),"left");en.set(n.target(),"left",t+n.xDelta()+"px")})});var a=function(e,t){return Ou.getInt(e,t)-parseInt(bt.get(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=a(r,"top");bt.remove(r,"data-initial-top"),d.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=a(r,"left");bt.remove(r,"data-initial-left"),d.trigger.adjustWidth(n,t,parseInt(e,10))}),Li.refresh(o,n,i,t)})})});var c=function(e,t){d.trigger.startAdjust(),n.assign(e),bt.set(e,"data-initial-"+t,parseInt(en.get(e,t),10)),Ai.add(e,Sc),en.set(e,"opacity","0.2"),r.go(o.parent())},l=pc.bind(o.parent(),"mousedown",function(e){Li.isRowBar(e.target())&&c(e.target(),"top"),Li.isColBar(e.target())&&c(e.target(),"left")}),f=function(e){return $e.eq(e,o.view())},s=pc.bind(o.view(),"mouseover",function(e){"table"===mt.name(e.target())||Rc.closest(e.target(),"table",f)?(u="table"===mt.name(e.target())?S.some(e.target()):Wt.ancestor(e.target(),"table",f)).each(function(e){Li.refresh(o,e,i,t)}):xt.inBody(e.target())&&Li.destroy(o)}),d=ac.create({adjustHeight:uc(["table","delta","row"]),adjustWidth:uc(["table","delta","column"]),startAdjust:uc([])});return{destroy:function(){l.unbind(),s.unbind(),r.destroy(),Li.destroy(o)},refresh:function(e){Li.refresh(o,e,i,t)},on:r.on,off:r.off,hideBars:R(Li.hide,o),showBars:R(Li.show,o),events:d.registry}}(e,n,r),o=ac.create({beforeResize:uc(["table"]),afterResize:uc(["table"]),startDrag:uc([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());Yu(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());Gu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}var Nc=function(e,t){return e.inline?ic(ia(e),(n=le.fromTag("div"),en.setAll(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),rn.append(xt.body(),n),n)):oc(le.fromDom(e.getDoc()));var n},Dc=function(e,t){e.inline&&an.remove(t.parent())},Ec=function(u){var a,c,o=S.none(),i=S.none(),l=S.none(),f=/(\d+(\.\d+)?)%/,s=function(e){return"TABLE"===e.nodeName};return u.on("init",function(){var e,t=So(ha.directionAt),n=Nc(u);if(l=S.some(n),("table"===(e=u.getParam("object_resizing",!0))||e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=Tc(n,t);r.on(),r.events.startDrag.bind(function(e){o=S.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();Oa(u,t,ua(t),aa(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();fa(t),o.each(function(e){u.selection.setRng(e),u.focus()}),Aa(u,n,ua(n),aa(n)),u.undoManager.add()}),i=S.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n=e.target;s(n)&&(a=e.width,t=n,c=u.dom.getStyle(t,"width")||u.dom.getAttrib(t,"width"))}),u.on("ObjectResized",function(e){var t=e.target;if(s(t)){var n=t;if(f.test(c)){var r=parseFloat(f.exec(c)[1]),o=e.width*r/a;u.dom.setStyle(n,"width",o+"%")}else{var i=[];Ia.each(n.rows,function(e){Ia.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),Ia.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(oc(le.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),l.each(function(e){Dc(u,e)})}}},Oc=function(e){return{fold:e}},Ac=function(o){return Oc(function(e,t,n,r){return e(o)})},kc=function(o){return Oc(function(e,t,n,r){return t(o)})},Pc=function(o,i){return Oc(function(e,t,n,r){return n(o,i)})},Ic=function(o){return Oc(function(e,t,n,r){return r(o)})},Bc=function(n,e){return zt.table(n,e).bind(function(e){var t=zt.cells(e);return W(t,function(e){return $e.eq(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},Mc=function(t,e){return Bc(t,e).fold(function(){return Ac(t)},function(e){return e.index()+1<e.all().length?Pc(t,e.all()[e.index()+1]):Ic(t)})},Wc=function(t,e){return Bc(t,e).fold(function(){return Ac()},function(e){return 0<=e.index()-1?Pc(t,e.all()[e.index()-1]):kc(t)})},_c=Nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Lc={before:_c.before,on:_c.on,after:_c.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(u,u,u)}},qc=Nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Fc=X("start","soffset","finish","foffset"),jc={domRange:qc.domRange,relative:qc.relative,exact:qc.exact,exactFromRange:function(e){return qc.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:Fc,getWin:function(e){var t=e.match({domRange:function(e){return le.fromDom(e.startContainer)},relative:function(e,t){return Lc.getStart(e)},exact:function(e,t,n,r){return e}});return ot.defaultView(t)}},zc=function(e,t,n,r){var o=ot.owner(e).dom().createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},Hc=function(e,t,n,r){var o=zc(e,t,n,r),i=$e.eq(e,n)&&t===r;return o.collapsed&&!i},Uc=function(e,t){e.selectNodeContents(t.dom())},Vc=function(e){e.deleteContents()},Gc=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},Yc={create:function(e){return e.document.createRange()},replaceWith:function(e,t){Vc(e),e.insertNode(t.dom())},selectNodeContents:function(e,t){var n=e.document.createRange();return Uc(n,t),n},selectNodeContentsUsing:Uc,relativeToNative:function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},exactToNative:function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},deleteContents:Vc,cloneFragment:function(e){var t=e.cloneContents();return le.fromDom(t)},getFirstRect:function(e){var t=e.getClientRects(),n=0<t.length?t[0]:e.getBoundingClientRect();return 0<n.width||0<n.height?S.some(n).map(Gc):S.none()},getBounds:function(e){var t=e.getBoundingClientRect();return 0<t.width||0<t.height?S.some(t).map(Gc):S.none()},isWithin:function(e,t){return t.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<t.compareBoundaryPoints(e.START_TO_END,e)},toString:function(e){return e.toString()}},Xc=Nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Kc=function(e,t,n){return t(le.fromDom(n.startContainer),n.startOffset,le.fromDom(n.endContainer),n.endOffset)},Jc=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:S.none}},relative:function(e,t){return{ltr:Ce(function(){return Yc.relativeToNative(o,e,t)}),rtl:Ce(function(){return S.some(Yc.relativeToNative(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Ce(function(){return Yc.exactToNative(o,e,t,n,r)}),rtl:Ce(function(){return S.some(Yc.exactToNative(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Xc.rtl(le.fromDom(e.endContainer),e.endOffset,le.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Kc(0,Xc.ltr,r)}):Kc(0,Xc.ltr,r)},$c={ltr:Xc.ltr,rtl:Xc.rtl,diagnose:Jc,asLtrRange:function(i,e){return Jc(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})}},Qc=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Zc=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var a=e(u),c=Math.abs(t-a.left);if(n<=a.bottom){if(n<a.top||i<c)return u-1;i=c}}return 0},el={locate:function(l,f,s,d){var e=l.dom().createRange();e.selectNode(f.dom());var t=e.getClientRects();return Jo(t,function(e){return Qc(e,s,d)?S.some(e):S.none()}).map(function(e){return n=l,t=s,o=d,i=e,u=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},a=vn.get(r=f).length,c=Zc(function(e){return u(e).getBoundingClientRect()},t,o,i.right,a),u(c);var n,r,t,o,i,u,a,c})}},tl=function(t,e,n,r){var o=t.dom().createRange(),i=ot.children(e);return Jo(i,function(e){return o.selectNode(e.dom()),Qc(o.getBoundingClientRect(),n,r)?nl(t,e,n,r):S.none()})},nl=function(e,t,n,r){return(mt.isText(t)?el.locate:tl)(e,t,n,r)},rl=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return nl(e,t,u,a)},ol=function(e,t){return t-e.left<e.right-t},il=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},ul=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=ol(o,n);return(!0===i?Rn.first:Rn.last)(e).map(function(e){return il(t,e,i)})},al=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=ol(r,n);return S.some(il(e,t,o))},cl=function(e,t,n){return(0===ot.children(t).length?al:ul)(e,t,n)},ll=document.caretPositionFromPoint?function(n,e,t){return S.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return S.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),S.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return S.from(e.dom().caretRangeFromPoint(t,n))}:function(n,r,o){return le.fromPoint(n,r,o).bind(function(e){var t=function(){return cl(n,e,r)};return 0===ot.children(e).length?t():function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return rl(e,t,u,a)}(n,e,r,o).orThunk(t)})},fl=function(e,t,n){var r=le.fromDom(e.document);return ll(r,t,n).map(function(e){return jc.range(le.fromDom(e.startContainer),e.startOffset,le.fromDom(e.endContainer),e.endOffset)})},sl=function(e,t){var n=mt.name(e);return"input"===n?Lc.after(e):E(["br","img"],n)?0===t?Lc.before(e):Lc.after(e):Lc.on(e,t)},dl=function(e,t){var n=e.fold(Lc.before,sl,Lc.after),r=t.fold(Lc.before,sl,Lc.after);return jc.relative(n,r)},ml=function(e,t,n,r){var o=sl(e,t),i=sl(n,r);return jc.relative(o,i)},gl=function(e){return e.match({domRange:function(e){var t=le.fromDom(e.startContainer),n=le.fromDom(e.endContainer);return ml(t,e.startOffset,n,e.endOffset)},relative:dl,exact:ml})},hl=dl,pl=ml,vl=function(e,t){S.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},bl=function(e,t,n,r,o){var i=Yc.exactToNative(e,t,n,r,o);vl(e,i)},wl=function(s,e){return $c.diagnose(s,e).match({ltr:function(e,t,n,r){bl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,a,c,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,a=n,c=r,(o=l).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){bl(s,n,r,e,t)}else bl(s,n,r,e,t)}})},yl=function(e){var t=le.fromDom(e.anchorNode),n=le.fromDom(e.focusNode);return Hc(t,e.anchorOffset,n,e.focusOffset)?S.some(jc.range(le.fromDom(e.anchorNode),e.anchorOffset,le.fromDom(e.focusNode),e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return S.some(jc.range(le.fromDom(t.startContainer),t.startOffset,le.fromDom(n.endContainer),n.endOffset))}return S.none()}(e)},xl=function(e){return S.from(e.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(yl)},Cl=function(e,t,n,r,o){var i=pl(t,n,r,o);wl(e,i)},Rl=function(e){return xl(e).map(function(e){return jc.exact(e.start(),e.soffset(),e.finish(),e.foffset())})},Sl=function(e,t,n){var r=hl(t,n);wl(e,r)},Tl=function(e){var o=jc.getWin(e).dom(),t=function(e,t,n,r){return Yc.exactToNative(o,e,t,n,r)},n=gl(e);return $c.diagnose(o,n).match({ltr:t,rtl:t})},Nl=function(e,t){var n=Yc.selectNodeContents(e,t);vl(e,n)},Dl=function(e){e.getSelection().removeAllRanges()},El=function(e,t){var n=$c.asLtrRange(e,t);return Yc.getFirstRect(n)},Ol=function(e,t,n){return fl(e,t,n)},Al=tinymce.util.Tools.resolve("tinymce.util.VK"),kl=function(e,t,n,r){return Ml(e,t,Mc(n),r)},Pl=function(e,t,n,r){return Ml(e,t,Wc(n),r)},Il=function(e,t){var n=jc.exact(t,0,t,0);return Tl(n)},Bl=function(e,t){var n,r=St.descendants(t,"tr");return(n=r,0===n.length?S.none():S.some(n[n.length-1])).bind(function(e){return Wt.descendant(e,"td,th").map(function(e){return Il(0,e)})})},Ml=function(r,e,t,o,n){return t.fold(S.none,S.none,function(e,t){return Rn.first(t).map(function(e){return Il(0,e)})},function(n){return zt.table(n,e).bind(function(e){var t=Mr.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Bl(0,e)})})},Wl=["table","li","dl"],_l=function(t,n,r,o){if(t.keyCode===Al.TAB){var i=ia(n),u=function(e){var t=mt.name(e);return $e.eq(e,i)||E(Wl,t)},e=n.selection.getRng();if(e.collapsed){var a=le.fromDom(e.startContainer);zt.cell(a,u).each(function(e){t.preventDefault(),(t.shiftKey?Pl:kl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},Ll={response:X("selection","kill")},ql=function(t){return function(e){return e===t}},Fl=ql(38),jl=ql(40),zl={ltr:{isBackward:ql(37),isForward:ql(39)},rtl:{isBackward:ql(39),isForward:ql(37)},isUp:Fl,isDown:jl,isNavigation:function(e){return 37<=e&&e<=40}},Hl=function(e,t){var n=$c.asLtrRange(e,t);return{start:C(le.fromDom(n.startContainer)),soffset:C(n.startOffset),finish:C(le.fromDom(n.endContainer)),foffset:C(n.endOffset)}},Ul=function(e,t,n,r){return{start:C(Lc.on(e,t)),finish:C(Lc.on(n,r))}},Vl=(Xe.detect().browser.isSafari(),function(e){var t=e!==undefined?e.dom():document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return ao(n,r)}),Gl=Vl,Yl=function(e,t,n){(n!==undefined?n.dom():document).defaultView.scrollBy(e,t)};function Xl(i){return{elementFromPoint:function(e,t){return le.fromPoint(le.fromDom(i.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=jc.exact(e,t,n,r);return El(i,o).map(function(e){return G(e,a)})},getSelection:function(){return Rl(i).map(function(e){return Hl(i,e)})},fromSitus:function(e){var t=jc.relative(e.start(),e.finish());return Hl(i,t)},situsFromPoint:function(e,t){return Ol(i,e,t).map(function(e){return{start:C(Lc.on(e.start(),e.soffset())),finish:C(Lc.on(e.finish(),e.foffset()))}})},clearSelection:function(){Dl(i)},setSelection:function(e){Cl(i,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,t){Sl(i,e,t)},selectContents:function(e){Nl(i,e)},getInnerHeight:function(){return i.innerHeight},getScrollY:function(){return Gl(le.fromDom(i.document)).top()},scrollBy:function(e,t){Yl(e,t,le.fromDom(i.document))}}}var Kl=function(n,e,r,t,o){return $e.eq(r,t)?S.none():pr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),S.some(Ll.response(S.some(Ul(r,0,r,yn(r))),!0))):S.none()})},Jl={sync:function(n,r,e,t,o,i,u){return $e.eq(e,o)&&t===i?S.none():Wt.closest(e,"td,th",r).bind(function(t){return Wt.closest(o,"td,th",r).bind(function(e){return Kl(n,r,t,e,u)})})},detect:Kl,update:function(e,t,n,r,o){return br(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},$l=ee(["left","top","right","bottom"],[]),Ql={nu:$l,moveUp:function(e,t){return $l({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return $l({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return $l({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Zl=function(e){return Ql.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},ef=function(e,t){return S.some(e.getRect(t))},tf=function(e,t,n){return mt.isElement(t)?ef(e,t).map(Zl):mt.isText(t)?(r=e,o=t,i=n,0<=i&&i<yn(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):S.none()).map(Zl):S.none();var r,o,i},nf=function(e,t){return mt.isElement(t)?ef(e,t).map(Zl):mt.isText(t)?e.getRangedRect(t,0,t,yn(t)).map(Zl):S.none()},rf=X("item","mode"),of=function(e,t,n,r){var o=r!==undefined?r:uf;return e.property().parent(t).map(function(e){return rf(e,o)})},uf=function(e,t,n,r){var o=r!==undefined?r:af;return n.sibling(e,t).map(function(e){return rf(e,o)})},af=function(e,t,n,r){var o=r!==undefined?r:af,i=e.property().children(t);return n.first(i).map(function(e){return rf(e,o)})},cf=[{current:of,next:uf,fallback:S.none()},{current:uf,next:af,fallback:S.some(of)},{current:af,next:af,fallback:S.some(uf)}],lf=function(t,n,r,o,e){return e=e!==undefined?e:cf,M(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return lf(t,n,e,o)})})})},ff={backtrack:of,sidestep:uf,advance:af,go:lf},sf={left:function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?S.some(e[e.length-1]):S.none()}}},right:function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?S.some(e[0]):S.none()}}}},df=function(t,e,n,r,o,i){return ff.go(t,e,r,o).bind(function(e){return i(e.item())?S.none():n(e.item())?S.some(e.item()):df(t,e.item(),n,e.mode(),o,i)})},mf=function(e,t,n,r){return df(e,t,n,ff.sidestep,sf.left(),r)},gf=function(e,t,n,r){return df(e,t,n,ff.sidestep,sf.right(),r)},hf=function(e,t){return 0===e.property().children(t).length},pf=function(e,t,n,r){return mf(e,t,n,r)},vf=function(e,t,n,r){return gf(e,t,n,r)},bf={before:function(e,t,n){return pf(e,t,R(hf,e),n)},after:function(e,t,n){return vf(e,t,R(hf,e),n)},seekLeft:pf,seekRight:vf,walkers:function(){return{left:sf.left,right:sf.right}},walk:function(e,t,n,r,o){return ff.go(e,t,n,r,o)},backtrack:ff.backtrack,sidestep:ff.sidestep,advance:ff.advance},wf=Pn(),yf={gather:function(e,t,n){return bf.gather(wf,e,t,n)},before:function(e,t){return bf.before(wf,e,t)},after:function(e,t){return bf.after(wf,e,t)},seekLeft:function(e,t,n){return bf.seekLeft(wf,e,t,n)},seekRight:function(e,t,n){return bf.seekRight(wf,e,t,n)},walkers:function(){return bf.walkers()},walk:function(e,t,n,r){return bf.walk(wf,e,t,n,r)}},xf=Nr([{none:[]},{retry:["caret"]}]),Cf=function(t,e,r){return Bt.closest(e,Ho).fold(C(!1),function(e){return nf(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})})},Rf={point:Ql.getTop,adjuster:function(e,t,n,r,o){var i=Ql.moveUp(o,5);return Math.abs(n.top()-r.top())<1?xf.retry(i):n.bottom()<o.top()?xf.retry(i):n.bottom()===o.top()?xf.retry(Ql.moveUp(o,1)):Cf(e,t,o)?xf.retry(Ql.translate(i,5,0)):xf.none()},move:Ql.moveUp,gather:yf.before},Sf={point:Ql.getBottom,adjuster:function(e,t,n,r,o){var i=Ql.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?xf.retry(i):n.top()>o.bottom()?xf.retry(i):n.top()===o.bottom()?xf.retry(Ql.moveDown(o,1)):Cf(e,t,o)?xf.retry(Ql.translate(i,5,0)):xf.none()},move:Ql.moveDown,gather:yf.after},Tf=function(n,r,o,i,u){return 0===u?S.some(i):(c=n,l=i.left(),f=r.point(i),c.elementFromPoint(l,f).filter(function(e){return"table"===mt.name(e)}).isSome()?(t=i,a=u-1,Tf(n,e=r,o,e.move(t,5),a)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(S.none,function(t,e){return nf(n,t,e).bind(function(e){return r.adjuster(n,t,e,o,i).fold(S.none,function(e){return Tf(n,r,o,e,u-1)})}).orThunk(function(){return S.some(i)})},S.none)}));var e,t,a,c,l,f},Nf=function(t,n,e){var r,o,i,u=t.move(e,5),a=Tf(n,t,e,u,100).getOr(u);return(r=t,o=a,i=n,r.point(o)>i.getInnerHeight()?S.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return n.situsFromPoint(a.left(),t.point(a))},function(e){return n.scrollBy(0,e),n.situsFromPoint(a.left(),t.point(a)-e)})},Df={tryUp:R(Nf,Rf),tryDown:R(Nf,Sf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},Ef=Nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Of=function(e){return Wt.closest(e,"tr")},Af={verify:function(a,e,t,n,r,c,o){return Wt.closest(n,"td,th",o).bind(function(u){return Wt.closest(e,"td,th",o).map(function(i){return $e.eq(u,i)?$e.eq(n,u)&&yn(u)===r?c(i):Ef.none("in same cell"):Qn.sharedOne(Of,[u,i]).fold(function(){return t=i,n=u,r=(e=a).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Ef.success():c(i);var e,t,n,r,o},function(e){return c(i)})})}).getOr(Ef.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)},adt:Ef},kf={point:X("element","offset"),delta:X("element","deltaOffset"),range:X("element","start","finish"),points:X("begin","end"),text:X("element","text")},Pf=(X("ancestor","descendants","element","index"),X("parent","children","element","index")),If=function(e,t){return W(e,R($e.eq,t))},Bf=function(r){return ot.parent(r).bind(function(t){var n=ot.children(t);return If(n,r).map(function(e){return Pf(t,n,r,e)})})},Mf=function(e){return"br"===mt.name(e)},Wf=function(e,t,n){return t(e,n).bind(function(e){return mt.isText(e)&&0===vn.get(e).trim().length?Wf(e,t,n):S.some(e)})},_f=function(t,e,n,r){return(o=e,i=n,ot.child(o,i).filter(Mf).orThunk(function(){return ot.child(o,i-1).filter(Mf)})).bind(function(e){return r.traverse(e).fold(function(){return Wf(e,r.gather,t).map(r.relative)},function(e){return Bf(e).map(function(e){return Lc.on(e.parent(),e.index())})})});var o,i},Lf=function(e,t,n,r){var o,i,u;return(Mf(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return Wf(i,u.gather,o)}).map(u.relative)):_f(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},qf=function(e){return Af.cata(e,function(e){return S.none()},function(){return S.none()},function(e){return S.some(kf.point(e,0))},function(e){return S.some(kf.point(e,yn(e)))})},Ff=Xe.detect(),jf=function(r,o,i,u,a,c){return 0===c?S.none():Uf(r,o,i,u,a).bind(function(e){var t=r.fromSitus(e),n=Af.verify(r,i,u,t.finish(),t.foffset(),a.failure,o);return Af.cata(n,function(){return S.none()},function(){return S.some(e)},function(e){return $e.eq(i,e)&&0===u?zf(r,i,u,Ql.moveUp,a):jf(r,o,e,0,a,c-1)},function(e){return $e.eq(i,e)&&u===yn(e)?zf(r,i,u,Ql.moveDown,a):jf(r,o,e,yn(e),a,c-1)})})},zf=function(t,e,n,r,o){return tf(t,e,n).bind(function(e){return Hf(t,o,r(e,Df.getJumpSize()))})},Hf=function(e,t,n){return Ff.browser.isChrome()||Ff.browser.isSafari()||Ff.browser.isFirefox()||Ff.browser.isEdge()?t.otherRetry(e,n):Ff.browser.isIE()?t.ieRetry(e,n):S.none()},Uf=function(t,e,n,r,o){return tf(t,n,r).bind(function(e){return Hf(t,o,e)})},Vf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return Lf(i,r.finish(),r.foffset(),u).fold(function(){return S.some(kf.point(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Af.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return qf(n)})})).bind(function(e){return jf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},Gf=function(e,t,n){return Bt.ancestor(e,t,n).isSome()},Yf=Xe.detect(),Xf=function(r,o,i,e,u){return Wt.closest(e,"td,th",o).bind(function(n){return Wt.closest(n,"table",o).bind(function(e){return t=e,Gf(u,function(e){return ot.parent(e).exists(function(e){return $e.eq(e,t)})})?Vf(r,o,i).bind(function(t){return Wt.closest(t.finish(),"td,th",o).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):S.none();var t})})},Kf=function(e,t,n,r,o,i){return Yf.browser.isIE()?S.none():i(r,t).orThunk(function(){return Xf(e,t,n,r,o).map(function(e){var t=e.range();return Ll.response(S.some(Ul(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Jf=function(e,t,n,r,o,i,u){return Xf(e,n,r,o,i).bind(function(e){return Jl.detect(t,n,e.start(),e.finish(),u)})},$f=function(e,r){return Wt.closest(e,"tr",r).bind(function(n){return Wt.closest(n,"table",r).bind(function(e){var t=St.descendants(e,"tr");return $e.eq(n,t[0])?yf.seekLeft(e,function(e){return Rn.last(e).isSome()},r).map(function(e){var t=yn(e);return Ll.response(S.some(Ul(e,t,e,t)),!0)}):S.none()})})},Qf=function(e,r){return Wt.closest(e,"tr",r).bind(function(n){return Wt.closest(n,"table",r).bind(function(e){var t=St.descendants(e,"tr");return $e.eq(n,t[t.length-1])?yf.seekRight(e,function(e){return Rn.first(e).isSome()},r).map(function(e){return Ll.response(S.some(Ul(e,0,e,0)),!0)}):S.none()})})},Zf=function(e,t){return Wt.closest(e,"td,th",t)},es={down:{traverse:ot.nextSibling,gather:yf.after,relative:Lc.before,otherRetry:Df.tryDown,ieRetry:Df.ieTryDown,failure:Af.adt.failedDown},up:{traverse:ot.prevSibling,gather:yf.before,relative:Lc.before,otherRetry:Df.tryUp,ieRetry:Df.ieTryUp,failure:Af.adt.failedUp}},ts=X("rows","cols"),ns={mouse:function(e,t,n,r){var o,i,u,a,c,l,f=Xl(e),s=(o=f,i=t,u=n,a=r,c=S.none(),l=function(){c=S.none()},{mousedown:function(e){a.clear(i),c=Zf(e.target(),u)},mouseover:function(e){c.each(function(r){a.clear(i),Zf(e.target(),u).each(function(n){pr(r,n,u).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!$e.eq(r,n))&&(a.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){c.each(l)}});return{mousedown:s.mousedown,mouseover:s.mouseover,mouseup:s.mouseup}},keyboard:function(e,c,l,f){var s=Xl(e),d=function(){return f.clear(c),S.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw().which,a=!0===e.raw().shiftKey;return vr(c,f.selectedSelector()).fold(function(){return zl.isDown(u)&&a?R(Jf,s,c,l,es.down,r,t,f.selectRange):zl.isUp(u)&&a?R(Jf,s,c,l,es.up,r,t,f.selectRange):zl.isDown(u)?R(Kf,s,l,es.down,r,t,Qf):zl.isUp(u)?R(Kf,s,l,es.up,r,t,$f):S.none},function(t){var e=function(e){return function(){return Jo(e,function(e){return Jl.update(e.rows(),e.cols(),c,t,f)}).fold(function(){return wr(c,f.firstSelectedSelector(),f.lastSelectedSelector()).map(function(e){var t=zl.isDown(u)||i.isForward(u)?Lc.after:Lc.before;return s.setRelativeSelection(Lc.on(e.first(),0),t(e.table())),f.clear(c),Ll.response(S.none(),!0)})},function(e){return S.some(Ll.response(S.none(),!0))})}};return zl.isDown(u)&&a?e([ts(1,0)]):zl.isUp(u)&&a?e([ts(-1,0)]):i.isBackward(u)&&a?e([ts(0,-1),ts(-1,0)]):i.isForward(u)&&a?e([ts(0,1),ts(1,0)]):zl.isNavigation(u)&&!1===a?d:S.none})()},keyup:function(t,n,r,o,i){return vr(c,f.selectedSelector()).fold(function(){var e=t.raw().which;return 0==(!0===t.raw().shiftKey)?S.none():zl.isNavigation(e)?Jl.sync(c,l,n,r,o,i,f.selectRange):S.none()},S.none)}}}},rs=function(t,e){k(e,function(e){Ai.remove(t,e)})},os=function(t){return function(e){Ai.add(e,t)}},is=function(t){return function(e){rs(e,t)}},us={byClass:function(o){var i=os(o.selected()),n=is([o.selected(),o.lastSelected(),o.firstSelected()]),u=function(e){var t=St.descendants(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Ai.add(n,o.firstSelected()),Ai.add(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){bt.remove(e,o.selected()),bt.remove(e,o.firstSelected()),bt.remove(e,o.lastSelected())},i=function(e){bt.set(e,o.selected(),"1")},u=function(e){var t=St.descendants(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),bt.set(n,o.firstSelected(),"1"),bt.set(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},as=function(e){return!1===Ai.has(le.fromDom(e.target),"ephox-snooker-resizer-bar")};function cs(h,p){var v=ee(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=S.none(),w=us.byAttr(Tr);return h.on("init",function(e){var r=h.getWin(),o=ia(h),t=ca(h),n=ns.mouse(r,o,t,w),a=ns.keyboard(r,o,t,w),c=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=jc.relative(e.start(),e.finish()),n=$c.asLtrRange(r,t);h.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&zl.isNavigation(t.raw().which)){var n=h.selection.getRng(),r=le.fromDom(n.startContainer),o=le.fromDom(n.endContainer);a.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){c(t,e)})}},u=function(e){var t=f(e);p().each(function(e){e.hideBars()});var n=h.selection.getRng(),r=le.fromDom(h.selection.getStart()),o=le.fromDom(n.startContainer),i=le.fromDom(n.endContainer),u=ha.directionAt(r).isRtl()?zl.rtl:zl.ltr;a.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){c(t,e)}),p().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=le.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&as(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!as(e)||n.mouseover(f(e))},g=function(e){s(e)&&as(e)&&n.mouseup(f(e))};h.on("mousedown",d),h.on("mouseover",m),h.on("mouseup",g),h.on("keyup",i),h.on("keydown",u),h.on("nodechange",function(){var e=h.selection,t=le.fromDom(e.getStart()),n=le.fromDom(e.getEnd());Qn.sharedOne(zt.table,[t,n]).fold(function(){w.clear(o)},y)}),b=S.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var ls=Ia.each,fs=function(t){var n=[];function e(e){return function(){t.execCommand(e)}}ls("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?n.push({text:"-"}):n.push(t.menuItems[e])}),t.addButton("table",{type:"menubutton",title:"Table",menu:n}),t.addButton("tableprops",{title:"Table properties",onclick:e("mceTableProps"),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},ss=function(t){var e,n=""===(e=t.getParam("table_toolbar",pa))||!1===e?[]:v(e)?e.split(/[ ,]/):b(e)?e:[];0<n.length&&t.addContextToolbar(function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n.join(" "))},ds=function(o,n){var r=S.none(),i=[],u=[],a=[],c=[],l=function(e){e.disabled(!0)},f=function(e){e.disabled(!1)},e=function(){var t=this;i.push(t),r.fold(function(){l(t)},function(e){f(t)})},t=function(){var t=this;u.push(t),r.fold(function(){l(t)},function(e){f(t)})};o.on("init",function(){o.on("nodechange",function(e){var t=S.from(o.dom.getParent(o.selection.getStart(),"th,td"));(r=t.bind(function(e){var t=le.fromDom(e);return zt.table(t).map(function(e){return Mr.forMenu(n,e,t)})})).fold(function(){k(i,l),k(u,l),k(a,l),k(c,l)},function(t){k(i,f),k(u,f),k(a,function(e){e.disabled(t.mergable().isNone())}),k(c,function(e){e.disabled(t.unmergable().isNone())})})})});var s=function(e,t,n,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],f=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(n+1),f&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(f?t<=o:o<=t)&&i<=n,e.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===o.getParam("table_grid",!0,"boolean")?{text:"Table",icon:"table",context:"table",onclick:m("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),o.execCommand("mceInsertTable"))},onshow:function(){s(o,0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:function(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){e+="<tr>";for(var n=0;n<10;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t,n,r=e.target;"A"===r.tagName.toUpperCase()&&(t=parseInt(r.getAttribute("data-mce-x"),10),n=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(t=9-t),t===this.lastX&&n===this.lastY||(s(o,t,n,e.control),this.lastX=t,this.lastY=n))},onclick:function(e){var t=this;"A"===e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),o.undoManager.transact(function(){Qa(o,t.lastX+1,t.lastY+1)}),o.addVisual())}}]};function m(e){return function(){o.execCommand(e)}}var g={text:"Table properties",context:"table",onPostRender:e,onclick:m("mceTableProps")},h={text:"Delete table",context:"table",onPostRender:e,cmd:"mceTableDelete"},p={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:t},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:t},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:t},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:t},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:t},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:t},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:t},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:t}]},v={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:t},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:t},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:t}]},b={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:t},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:function(){var t=this;a.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.mergable().isNone())})}},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:function(){var t=this;c.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.unmergable().isNone())})}}]};o.addMenuItem("inserttable",d),o.addMenuItem("tableprops",g),o.addMenuItem("deletetable",h),o.addMenuItem("row",p),o.addMenuItem("column",v),o.addMenuItem("cell",b)},ms=function(n,r){return{insertTable:function(e,t){return Qa(n,e,t)},setClipboardRows:function(e){return t=r,n=A(e,le.fromDom),void t.set(S.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return A(e,function(e){return e.dom()})})}}};i.add("table",function(t){var n,r=Ec(t),e=cs(t,r.lazyResize),o=ka(t,r.lazyWire),i=(n=t,{get:function(){var e=ia(n);return yr(e,Tr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Er.none():Er.single(n.selection)},function(e){return Er.multiple(e)})}}),u=Do(S.none());return rc(t,o,e,i,u),Wr(t,i,o,e),ds(t,i),fs(t),ss(t),t.on("PreInit",function(){t.serializer.addTempAttr(Tr.firstSelected()),t.serializer.addTempAttr(Tr.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){_l(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),ms(t,u)})}();
@@ -1,807 +1,345 @@
1
1
  (function () {
2
+ var template = (function () {
3
+ 'use strict';
2
4
 
3
- var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
5
+ var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
4
6
 
5
- // Used when there is no 'main' module.
6
- // The name is probably (hopefully) unique so minification removes for releases.
7
- var register_3795 = function (id) {
8
- var module = dem(id);
9
- var fragments = id.split('.');
10
- var target = Function('return this;')();
11
- for (var i = 0; i < fragments.length - 1; ++i) {
12
- if (target[fragments[i]] === undefined)
13
- target[fragments[i]] = {};
14
- target = target[fragments[i]];
15
- }
16
- target[fragments[fragments.length - 1]] = module;
17
- };
18
-
19
- var instantiate = function (id) {
20
- var actual = defs[id];
21
- var dependencies = actual.deps;
22
- var definition = actual.defn;
23
- var len = dependencies.length;
24
- var instances = new Array(len);
25
- for (var i = 0; i < len; ++i)
26
- instances[i] = dem(dependencies[i]);
27
- var defResult = definition.apply(null, instances);
28
- if (defResult === undefined)
29
- throw 'module [' + id + '] returned undefined';
30
- actual.instance = defResult;
31
- };
32
-
33
- var def = function (id, dependencies, definition) {
34
- if (typeof id !== 'string')
35
- throw 'module id must be a string';
36
- else if (dependencies === undefined)
37
- throw 'no dependencies for ' + id;
38
- else if (definition === undefined)
39
- throw 'no definition function for ' + id;
40
- defs[id] = {
41
- deps: dependencies,
42
- defn: definition,
43
- instance: undefined
44
- };
45
- };
46
-
47
- var dem = function (id) {
48
- var actual = defs[id];
49
- if (actual === undefined)
50
- throw 'module [' + id + '] was undefined';
51
- else if (actual.instance === undefined)
52
- instantiate(id);
53
- return actual.instance;
54
- };
55
-
56
- var req = function (ids, callback) {
57
- var len = ids.length;
58
- var instances = new Array(len);
59
- for (var i = 0; i < len; ++i)
60
- instances[i] = dem(ids[i]);
61
- callback.apply(null, instances);
62
- };
63
-
64
- var ephox = {};
65
-
66
- ephox.bolt = {
67
- module: {
68
- api: {
69
- define: def,
70
- require: req,
71
- demand: dem
7
+ var curry = function (f) {
8
+ var x = [];
9
+ for (var _i = 1; _i < arguments.length; _i++) {
10
+ x[_i - 1] = arguments[_i];
72
11
  }
73
- }
74
- };
75
-
76
- var define = def;
77
- var require = req;
78
- var demand = dem;
79
- // this helps with minification when using a lot of global references
80
- var defineGlobal = function (id, ref) {
81
- define(id, [], function () { return ref; });
82
- };
83
- /*jsc
84
- ["tinymce.plugins.template.Plugin","tinymce.core.PluginManager","tinymce.plugins.template.api.Commands","tinymce.plugins.template.core.FilterContent","tinymce.plugins.template.ui.Buttons","global!tinymce.util.Tools.resolve","ephox.katamari.api.Fun","tinymce.plugins.template.core.Templates","tinymce.core.util.Tools","tinymce.plugins.template.api.Settings","tinymce.plugins.template.core.DateTimeHelper","tinymce.plugins.template.ui.Dialog","global!Array","global!Error","tinymce.core.util.XHR","tinymce.core.dom.DOMUtils"]
85
- jsc*/
86
- defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
87
- /**
88
- * ResolveGlobal.js
89
- *
90
- * Released under LGPL License.
91
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
92
- *
93
- * License: http://www.tinymce.com/license
94
- * Contributing: http://www.tinymce.com/contributing
95
- */
96
-
97
- define(
98
- 'tinymce.core.PluginManager',
99
- [
100
- 'global!tinymce.util.Tools.resolve'
101
- ],
102
- function (resolve) {
103
- return resolve('tinymce.PluginManager');
104
- }
105
- );
106
-
107
- defineGlobal("global!Array", Array);
108
- defineGlobal("global!Error", Error);
109
- define(
110
- 'ephox.katamari.api.Fun',
111
-
112
- [
113
- 'global!Array',
114
- 'global!Error'
115
- ],
116
-
117
- function (Array, Error) {
118
-
119
- var noop = function () { };
120
-
121
- var noarg = function (f) {
122
- return function () {
123
- return f();
124
- };
125
- };
126
-
127
- var compose = function (fa, fb) {
128
- return function () {
129
- return fa(fb.apply(null, arguments));
130
- };
131
- };
132
-
133
- var constant = function (value) {
134
- return function () {
135
- return value;
136
- };
137
- };
138
-
139
- var identity = function (x) {
140
- return x;
141
- };
142
-
143
- var tripleEquals = function(a, b) {
144
- return a === b;
145
- };
146
-
147
- // Don't use array slice(arguments), makes the whole function unoptimisable on Chrome
148
- var curry = function (f) {
149
- // equivalent to arguments.slice(1)
150
- // starting at 1 because 0 is the f, makes things tricky.
151
- // Pay attention to what variable is where, and the -1 magic.
152
- // thankfully, we have tests for this.
153
- var args = new Array(arguments.length - 1);
154
- for (var i = 1; i < arguments.length; i++) args[i-1] = arguments[i];
155
-
156
- return function () {
157
- var newArgs = new Array(arguments.length);
158
- for (var j = 0; j < newArgs.length; j++) newArgs[j] = arguments[j];
159
-
160
- var all = args.concat(newArgs);
161
- return f.apply(null, all);
162
- };
163
- };
164
-
165
- var not = function (f) {
166
- return function () {
167
- return !f.apply(null, arguments);
168
- };
169
- };
170
-
171
- var die = function (msg) {
172
- return function () {
173
- throw new Error(msg);
174
- };
175
- };
176
-
177
- var apply = function (f) {
178
- return f();
179
- };
180
-
181
- var call = function(f) {
182
- f();
183
- };
184
-
185
- var never = constant(false);
186
- var always = constant(true);
187
-
188
-
189
- return {
190
- noop: noop,
191
- noarg: noarg,
192
- compose: compose,
193
- constant: constant,
194
- identity: identity,
195
- tripleEquals: tripleEquals,
196
- curry: curry,
197
- not: not,
198
- die: die,
199
- apply: apply,
200
- call: call,
201
- never: never,
202
- always: always
203
- };
204
- }
205
- );
206
-
207
- /**
208
- * ResolveGlobal.js
209
- *
210
- * Released under LGPL License.
211
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
212
- *
213
- * License: http://www.tinymce.com/license
214
- * Contributing: http://www.tinymce.com/contributing
215
- */
216
-
217
- define(
218
- 'tinymce.core.util.Tools',
219
- [
220
- 'global!tinymce.util.Tools.resolve'
221
- ],
222
- function (resolve) {
223
- return resolve('tinymce.util.Tools');
224
- }
225
- );
226
-
227
- /**
228
- * ResolveGlobal.js
229
- *
230
- * Released under LGPL License.
231
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
232
- *
233
- * License: http://www.tinymce.com/license
234
- * Contributing: http://www.tinymce.com/contributing
235
- */
236
-
237
- define(
238
- 'tinymce.core.util.XHR',
239
- [
240
- 'global!tinymce.util.Tools.resolve'
241
- ],
242
- function (resolve) {
243
- return resolve('tinymce.util.XHR');
244
- }
245
- );
246
-
247
- /**
248
- * ResolveGlobal.js
249
- *
250
- * Released under LGPL License.
251
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
252
- *
253
- * License: http://www.tinymce.com/license
254
- * Contributing: http://www.tinymce.com/contributing
255
- */
256
-
257
- define(
258
- 'tinymce.core.dom.DOMUtils',
259
- [
260
- 'global!tinymce.util.Tools.resolve'
261
- ],
262
- function (resolve) {
263
- return resolve('tinymce.dom.DOMUtils');
264
- }
265
- );
266
-
267
- /**
268
- * Settings.js
269
- *
270
- * Released under LGPL License.
271
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
272
- *
273
- * License: http://www.tinymce.com/license
274
- * Contributing: http://www.tinymce.com/contributing
275
- */
276
-
277
- define(
278
- 'tinymce.plugins.template.api.Settings',
279
- [
280
- 'tinymce.core.dom.DOMUtils'
281
- ],
282
- function (DOMUtils) {
283
- var getCreationDateClasses = function (editor) {
284
- return editor.getParam('template_cdate_classes', 'cdate');
285
- };
286
-
287
- var getModificationDateClasses = function (editor) {
288
- return editor.getParam('template_mdate_classes', 'mdate');
289
- };
290
-
291
- var getSelectedContentClasses = function (editor) {
292
- return editor.getParam('template_selected_content_classes', 'selcontent');
293
- };
294
-
295
- var getPreviewReplaceValues = function (editor) {
296
- return editor.getParam('template_preview_replace_values');
297
- };
298
-
299
- var getTemplateReplaceValues = function (editor) {
300
- return editor.getParam('template_replace_values');
301
- };
302
-
303
- var getTemplates = function (editorSettings) {
304
- return editorSettings.templates;
305
- };
306
-
307
- var getCdateFormat = function (editor) {
308
- return editor.getParam('template_cdate_format', editor.getLang('template.cdate_format'));
309
- };
310
-
311
- var getMdateFormat = function (editor) {
312
- return editor.getParam("template_mdate_format", editor.getLang("template.mdate_format"));
313
- };
314
-
315
- var getDialogWidth = function (editor) {
316
- return editor.getParam('template_popup_width', 600);
12
+ var args = new Array(arguments.length - 1);
13
+ for (var i = 1; i < arguments.length; i++)
14
+ args[i - 1] = arguments[i];
15
+ return function () {
16
+ var x = [];
17
+ for (var _i = 0; _i < arguments.length; _i++) {
18
+ x[_i] = arguments[_i];
19
+ }
20
+ var newArgs = new Array(arguments.length);
21
+ for (var j = 0; j < newArgs.length; j++)
22
+ newArgs[j] = arguments[j];
23
+ var all = args.concat(newArgs);
24
+ return f.apply(null, all);
317
25
  };
26
+ };
318
27
 
319
- var getDialogHeight = function (editor) {
320
- return Math.min(DOMUtils.DOM.getViewPort().h, editor.getParam('template_popup_height', 500));
321
- };
322
-
323
- return {
324
- getCreationDateClasses: getCreationDateClasses,
325
- getModificationDateClasses: getModificationDateClasses,
326
- getSelectedContentClasses: getSelectedContentClasses,
327
- getPreviewReplaceValues: getPreviewReplaceValues,
328
- getTemplateReplaceValues: getTemplateReplaceValues,
329
- getTemplates: getTemplates,
330
- getCdateFormat: getCdateFormat,
331
- getMdateFormat: getMdateFormat,
332
- getDialogWidth: getDialogWidth,
333
- getDialogHeight: getDialogHeight
334
- };
335
- }
336
- );
28
+ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
337
29
 
30
+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.XHR');
338
31
 
339
- /**
340
- * DateTimeHelper.js
341
- *
342
- * Released under LGPL License.
343
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
344
- *
345
- * License: http://www.tinymce.com/license
346
- * Contributing: http://www.tinymce.com/contributing
347
- */
32
+ var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
348
33
 
349
- define(
350
- 'tinymce.plugins.template.core.DateTimeHelper',
351
- [
352
- ],
353
- function () {
354
- var addZeros = function (value, len) {
355
- value = "" + value;
34
+ var getCreationDateClasses = function (editor) {
35
+ return editor.getParam('template_cdate_classes', 'cdate');
36
+ };
37
+ var getModificationDateClasses = function (editor) {
38
+ return editor.getParam('template_mdate_classes', 'mdate');
39
+ };
40
+ var getSelectedContentClasses = function (editor) {
41
+ return editor.getParam('template_selected_content_classes', 'selcontent');
42
+ };
43
+ var getPreviewReplaceValues = function (editor) {
44
+ return editor.getParam('template_preview_replace_values');
45
+ };
46
+ var getTemplateReplaceValues = function (editor) {
47
+ return editor.getParam('template_replace_values');
48
+ };
49
+ var getTemplates = function (editorSettings) {
50
+ return editorSettings.templates;
51
+ };
52
+ var getCdateFormat = function (editor) {
53
+ return editor.getParam('template_cdate_format', editor.getLang('template.cdate_format'));
54
+ };
55
+ var getMdateFormat = function (editor) {
56
+ return editor.getParam('template_mdate_format', editor.getLang('template.mdate_format'));
57
+ };
58
+ var getDialogWidth = function (editor) {
59
+ return editor.getParam('template_popup_width', 600);
60
+ };
61
+ var getDialogHeight = function (editor) {
62
+ return Math.min(global$3.DOM.getViewPort().h, editor.getParam('template_popup_height', 500));
63
+ };
64
+ var $_efmh19r8jm0og22b = {
65
+ getCreationDateClasses: getCreationDateClasses,
66
+ getModificationDateClasses: getModificationDateClasses,
67
+ getSelectedContentClasses: getSelectedContentClasses,
68
+ getPreviewReplaceValues: getPreviewReplaceValues,
69
+ getTemplateReplaceValues: getTemplateReplaceValues,
70
+ getTemplates: getTemplates,
71
+ getCdateFormat: getCdateFormat,
72
+ getMdateFormat: getMdateFormat,
73
+ getDialogWidth: getDialogWidth,
74
+ getDialogHeight: getDialogHeight
75
+ };
356
76
 
357
- if (value.length < len) {
358
- for (var i = 0; i < (len - value.length); i++) {
359
- value = "0" + value;
360
- }
77
+ var addZeros = function (value, len) {
78
+ value = '' + value;
79
+ if (value.length < len) {
80
+ for (var i = 0; i < len - value.length; i++) {
81
+ value = '0' + value;
361
82
  }
83
+ }
84
+ return value;
85
+ };
86
+ var getDateTime = function (editor, fmt, date) {
87
+ var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
88
+ var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
89
+ var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
90
+ var monthsLong = 'January February March April May June July August September October November December'.split(' ');
91
+ date = date || new Date();
92
+ fmt = fmt.replace('%D', '%m/%d/%Y');
93
+ fmt = fmt.replace('%r', '%I:%M:%S %p');
94
+ fmt = fmt.replace('%Y', '' + date.getFullYear());
95
+ fmt = fmt.replace('%y', '' + date.getYear());
96
+ fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2));
97
+ fmt = fmt.replace('%d', addZeros(date.getDate(), 2));
98
+ fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2));
99
+ fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2));
100
+ fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2));
101
+ fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1));
102
+ fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM'));
103
+ fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()]));
104
+ fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()]));
105
+ fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()]));
106
+ fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()]));
107
+ fmt = fmt.replace('%%', '%');
108
+ return fmt;
109
+ };
110
+ var $_87g1nhrajm0og22e = { getDateTime: getDateTime };
362
111
 
363
- return value;
364
- };
365
-
366
- var getDateTime = function (editor, fmt, date) {
367
- var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' ');
368
- var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' ');
369
- var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' ');
370
- var monthsLong = "January February March April May June July August September October November December".split(' ');
371
-
372
- date = date || new Date();
373
-
374
- fmt = fmt.replace("%D", "%m/%d/%Y");
375
- fmt = fmt.replace("%r", "%I:%M:%S %p");
376
- fmt = fmt.replace("%Y", "" + date.getFullYear());
377
- fmt = fmt.replace("%y", "" + date.getYear());
378
- fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2));
379
- fmt = fmt.replace("%d", addZeros(date.getDate(), 2));
380
- fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2));
381
- fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2));
382
- fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2));
383
- fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1));
384
- fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM"));
385
- fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()]));
386
- fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()]));
387
- fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()]));
388
- fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()]));
389
- fmt = fmt.replace("%%", "%");
390
-
391
- return fmt;
392
- };
393
-
394
- return {
395
- getDateTime: getDateTime
112
+ var createTemplateList = function (editorSettings, callback) {
113
+ return function () {
114
+ var templateList = $_efmh19r8jm0og22b.getTemplates(editorSettings);
115
+ if (typeof templateList === 'function') {
116
+ templateList(callback);
117
+ return;
118
+ }
119
+ if (typeof templateList === 'string') {
120
+ global$2.send({
121
+ url: templateList,
122
+ success: function (text) {
123
+ callback(JSON.parse(text));
124
+ }
125
+ });
126
+ } else {
127
+ callback(templateList);
128
+ }
396
129
  };
397
- }
398
- );
399
-
400
- /**
401
- * Templates.js
402
- *
403
- * Released under LGPL License.
404
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
405
- *
406
- * License: http://www.tinymce.com/license
407
- * Contributing: http://www.tinymce.com/contributing
408
- */
409
-
410
- define(
411
- 'tinymce.plugins.template.core.Templates',
412
- [
413
- 'tinymce.core.util.Tools',
414
- 'tinymce.core.util.XHR',
415
- 'tinymce.plugins.template.api.Settings',
416
- 'tinymce.plugins.template.core.DateTimeHelper'
417
- ],
418
- function (Tools, XHR, Settings, DateTimeHelper) {
419
- var createTemplateList = function (editorSettings, callback) {
420
- return function () {
421
- var templateList = Settings.getTemplates(editorSettings);
422
-
423
- if (typeof templateList === 'function') {
424
- templateList(callback);
425
- return;
130
+ };
131
+ var replaceTemplateValues = function (editor, html, templateValues) {
132
+ global$1.each(templateValues, function (v, k) {
133
+ if (typeof v === 'function') {
134
+ v = v(k);
135
+ }
136
+ html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
137
+ });
138
+ return html;
139
+ };
140
+ var replaceVals = function (editor, e) {
141
+ var dom = editor.dom, vl = $_efmh19r8jm0og22b.getTemplateReplaceValues(editor);
142
+ global$1.each(dom.select('*', e), function (e) {
143
+ global$1.each(vl, function (v, k) {
144
+ if (dom.hasClass(e, k)) {
145
+ if (typeof vl[k] === 'function') {
146
+ vl[k](e);
147
+ }
426
148
  }
149
+ });
150
+ });
151
+ };
152
+ var hasClass = function (n, c) {
153
+ return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
154
+ };
155
+ var insertTemplate = function (editor, ui, html) {
156
+ var el;
157
+ var n;
158
+ var dom = editor.dom;
159
+ var sel = editor.selection.getContent();
160
+ html = replaceTemplateValues(editor, html, $_efmh19r8jm0og22b.getTemplateReplaceValues(editor));
161
+ el = dom.create('div', null, html);
162
+ n = dom.select('.mceTmpl', el);
163
+ if (n && n.length > 0) {
164
+ el = dom.create('div', null);
165
+ el.appendChild(n[0].cloneNode(true));
166
+ }
167
+ global$1.each(dom.select('*', el), function (n) {
168
+ if (hasClass(n, $_efmh19r8jm0og22b.getCreationDateClasses(editor).replace(/\s+/g, '|'))) {
169
+ n.innerHTML = $_87g1nhrajm0og22e.getDateTime(editor, $_efmh19r8jm0og22b.getCdateFormat(editor));
170
+ }
171
+ if (hasClass(n, $_efmh19r8jm0og22b.getModificationDateClasses(editor).replace(/\s+/g, '|'))) {
172
+ n.innerHTML = $_87g1nhrajm0og22e.getDateTime(editor, $_efmh19r8jm0og22b.getMdateFormat(editor));
173
+ }
174
+ if (hasClass(n, $_efmh19r8jm0og22b.getSelectedContentClasses(editor).replace(/\s+/g, '|'))) {
175
+ n.innerHTML = sel;
176
+ }
177
+ });
178
+ replaceVals(editor, el);
179
+ editor.execCommand('mceInsertContent', false, el.innerHTML);
180
+ editor.addVisual();
181
+ };
182
+ var $_a5rnv3r5jm0og227 = {
183
+ createTemplateList: createTemplateList,
184
+ replaceTemplateValues: replaceTemplateValues,
185
+ replaceVals: replaceVals,
186
+ insertTemplate: insertTemplate
187
+ };
427
188
 
428
- if (typeof templateList === 'string') {
429
- XHR.send({
430
- url: templateList,
431
- success: function (text) {
432
- callback(JSON.parse(text));
189
+ var register = function (editor) {
190
+ editor.addCommand('mceInsertTemplate', curry($_a5rnv3r5jm0og227.insertTemplate, editor));
191
+ };
192
+ var $_di64i5r3jm0og21s = { register: register };
193
+
194
+ var setup = function (editor) {
195
+ editor.on('PreProcess', function (o) {
196
+ var dom = editor.dom, dateFormat = $_efmh19r8jm0og22b.getMdateFormat(editor);
197
+ global$1.each(dom.select('div', o.node), function (e) {
198
+ if (dom.hasClass(e, 'mceTmpl')) {
199
+ global$1.each(dom.select('*', e), function (e) {
200
+ if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
201
+ e.innerHTML = $_87g1nhrajm0og22e.getDateTime(editor, dateFormat);
433
202
  }
434
203
  });
435
- } else {
436
- callback(templateList);
437
- }
438
- };
439
- };
440
-
441
- var replaceTemplateValues = function (editor, html, templateValues) {
442
- Tools.each(templateValues, function (v, k) {
443
- if (typeof v === 'function') {
444
- v = v(k);
204
+ $_a5rnv3r5jm0og227.replaceVals(editor, e);
445
205
  }
446
-
447
- html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
448
206
  });
207
+ });
208
+ };
209
+ var $_apvus8rbjm0og22g = { setup: setup };
449
210
 
450
- return html;
451
- };
452
-
453
- var replaceVals = function (editor, e) {
454
- var dom = editor.dom, vl = Settings.getTemplateReplaceValues(editor);
455
-
456
- Tools.each(dom.select('*', e), function (e) {
457
- Tools.each(vl, function (v, k) {
458
- if (dom.hasClass(e, k)) {
459
- if (typeof vl[k] === 'function') {
460
- vl[k](e);
461
- }
462
- }
463
- });
211
+ var insertIframeHtml = function (editor, win, html) {
212
+ if (html.indexOf('<html>') === -1) {
213
+ var contentCssLinks_1 = '';
214
+ global$1.each(editor.contentCSS, function (url) {
215
+ contentCssLinks_1 += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
464
216
  });
465
- };
466
-
467
- var hasClass = function (n, c) {
468
- return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
469
- };
470
-
471
- var insertTemplate = function (editor, ui, html) {
472
- var el, n, dom = editor.dom, sel = editor.selection.getContent();
473
-
474
- html = replaceTemplateValues(editor, html, Settings.getTemplateReplaceValues(editor));
475
- el = dom.create('div', null, html);
476
-
477
- // Find template element within div
478
- n = dom.select('.mceTmpl', el);
479
- if (n && n.length > 0) {
480
- el = dom.create('div', null);
481
- el.appendChild(n[0].cloneNode(true));
217
+ var bodyClass = editor.settings.body_class || '';
218
+ if (bodyClass.indexOf('=') !== -1) {
219
+ bodyClass = editor.getParam('body_class', '', 'hash');
220
+ bodyClass = bodyClass[editor.id] || '';
482
221
  }
483
-
484
- Tools.each(dom.select('*', el), function (n) {
485
- // Replace cdate
486
- if (hasClass(n, Settings.getCreationDateClasses(editor).replace(/\s+/g, '|'))) {
487
- n.innerHTML = DateTimeHelper.getDateTime(editor, Settings.getCdateFormat(editor));
488
- }
489
-
490
- // Replace mdate
491
- if (hasClass(n, Settings.getModificationDateClasses(editor).replace(/\s+/g, '|'))) {
492
- n.innerHTML = DateTimeHelper.getDateTime(editor, Settings.getMdateFormat(editor));
493
- }
494
-
495
- // Replace selection
496
- if (hasClass(n, Settings.getSelectedContentClasses(editor).replace(/\s+/g, '|'))) {
497
- n.innerHTML = sel;
222
+ html = '<!DOCTYPE html>' + '<html>' + '<head>' + contentCssLinks_1 + '</head>' + '<body class="' + bodyClass + '">' + html + '</body>' + '</html>';
223
+ }
224
+ html = $_a5rnv3r5jm0og227.replaceTemplateValues(editor, html, $_efmh19r8jm0og22b.getPreviewReplaceValues(editor));
225
+ var doc = win.find('iframe')[0].getEl().contentWindow.document;
226
+ doc.open();
227
+ doc.write(html);
228
+ doc.close();
229
+ };
230
+ var open = function (editor, templateList) {
231
+ var win;
232
+ var values = [];
233
+ var templateHtml;
234
+ if (!templateList || templateList.length === 0) {
235
+ var message = editor.translate('No templates defined.');
236
+ editor.notificationManager.open({
237
+ text: message,
238
+ type: 'info'
239
+ });
240
+ return;
241
+ }
242
+ global$1.each(templateList, function (template) {
243
+ values.push({
244
+ selected: !values.length,
245
+ text: template.title,
246
+ value: {
247
+ url: template.url,
248
+ content: template.content,
249
+ description: template.description
498
250
  }
499
251
  });
500
-
501
- replaceVals(editor, el);
502
-
503
- editor.execCommand('mceInsertContent', false, el.innerHTML);
504
- editor.addVisual();
505
- };
506
-
507
- return {
508
- createTemplateList: createTemplateList,
509
- replaceTemplateValues: replaceTemplateValues,
510
- replaceVals: replaceVals,
511
- insertTemplate: insertTemplate
512
- };
513
- }
514
- );
515
-
516
- /**
517
- * Commands.js
518
- *
519
- * Released under LGPL License.
520
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
521
- *
522
- * License: http://www.tinymce.com/license
523
- * Contributing: http://www.tinymce.com/contributing
524
- */
525
-
526
- define(
527
- 'tinymce.plugins.template.api.Commands',
528
- [
529
- 'ephox.katamari.api.Fun',
530
- 'tinymce.plugins.template.core.Templates'
531
- ],
532
- function (Fun, Templates) {
533
- var register = function (editor) {
534
- editor.addCommand('mceInsertTemplate', Fun.curry(Templates.insertTemplate, editor));
535
- };
536
-
537
- return {
538
- register: register
539
- };
540
- }
541
- );
542
- /**
543
- * FilterContent.js
544
- *
545
- * Released under LGPL License.
546
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
547
- *
548
- * License: http://www.tinymce.com/license
549
- * Contributing: http://www.tinymce.com/contributing
550
- */
551
-
552
- define(
553
- 'tinymce.plugins.template.core.FilterContent',
554
- [
555
- 'tinymce.core.util.Tools',
556
- 'tinymce.plugins.template.api.Settings',
557
- 'tinymce.plugins.template.core.DateTimeHelper',
558
- 'tinymce.plugins.template.core.Templates'
559
- ],
560
- function (Tools, Settings, DateTimeHelper, Templates) {
561
- var setup = function (editor) {
562
- editor.on('PreProcess', function (o) {
563
- var dom = editor.dom, dateFormat = Settings.getMdateFormat(editor);
564
-
565
- Tools.each(dom.select('div', o.node), function (e) {
566
- if (dom.hasClass(e, 'mceTmpl')) {
567
- Tools.each(dom.select('*', e), function (e) {
568
- if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
569
- e.innerHTML = DateTimeHelper.getDateTime(editor, dateFormat);
570
- }
571
- });
572
-
573
- Templates.replaceVals(editor, e);
252
+ });
253
+ var onSelectTemplate = function (e) {
254
+ var value = e.control.value();
255
+ if (value.url) {
256
+ global$2.send({
257
+ url: value.url,
258
+ success: function (html) {
259
+ templateHtml = html;
260
+ insertIframeHtml(editor, win, templateHtml);
574
261
  }
575
262
  });
576
- });
577
- };
578
-
579
- return {
580
- setup: setup
581
- };
582
- }
583
- );
584
- /**
585
- * Dialog.js
586
- *
587
- * Released under LGPL License.
588
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
589
- *
590
- * License: http://www.tinymce.com/license
591
- * Contributing: http://www.tinymce.com/contributing
592
- */
593
-
594
- define(
595
- 'tinymce.plugins.template.ui.Dialog',
596
- [
597
- 'tinymce.core.dom.DOMUtils',
598
- 'tinymce.core.util.Tools',
599
- 'tinymce.core.util.XHR',
600
- 'tinymce.plugins.template.api.Settings',
601
- 'tinymce.plugins.template.core.Templates'
602
- ],
603
- function (DOMUtils, Tools, XHR, Settings, Templates) {
604
- var insertIframeHtml = function (editor, win, html) {
605
- if (html.indexOf('<html>') === -1) {
606
- var contentCssLinks = '';
607
-
608
- Tools.each(editor.contentCSS, function (url) {
609
- contentCssLinks += '<link type="text/css" rel="stylesheet" href="' +
610
- editor.documentBaseURI.toAbsolute(url) +
611
- '">';
612
- });
613
-
614
- var bodyClass = editor.settings.body_class || '';
615
- if (bodyClass.indexOf('=') !== -1) {
616
- bodyClass = editor.getParam('body_class', '', 'hash');
617
- bodyClass = bodyClass[editor.id] || '';
618
- }
619
-
620
- html = (
621
- '<!DOCTYPE html>' +
622
- '<html>' +
623
- '<head>' +
624
- contentCssLinks +
625
- '</head>' +
626
- '<body class="' + bodyClass + '">' +
627
- html +
628
- '</body>' +
629
- '</html>'
630
- );
631
- }
632
-
633
- html = Templates.replaceTemplateValues(editor, html, Settings.getPreviewReplaceValues(editor));
634
-
635
- var doc = win.find('iframe')[0].getEl().contentWindow.document;
636
- doc.open();
637
- doc.write(html);
638
- doc.close();
639
- };
640
-
641
- var open = function (editor, templateList) {
642
- var win, values = [], templateHtml;
643
-
644
- if (!templateList || templateList.length === 0) {
645
- var message = editor.translate('No templates defined.');
646
- editor.notificationManager.open({ text: message, type: 'info' });
647
- return;
263
+ } else {
264
+ templateHtml = value.content;
265
+ insertIframeHtml(editor, win, templateHtml);
648
266
  }
649
-
650
- Tools.each(templateList, function (template) {
651
- values.push({
652
- selected: !values.length,
653
- text: template.title,
654
- value: {
655
- url: template.url,
656
- content: template.content,
657
- description: template.description
658
- }
659
- });
660
- });
661
-
662
- var onSelectTemplate = function (e) {
663
- var value = e.control.value();
664
-
665
- if (value.url) {
666
- XHR.send({
667
- url: value.url,
668
- success: function (html) {
669
- templateHtml = html;
670
- insertIframeHtml(editor, win, templateHtml);
671
- }
672
- });
673
- } else {
674
- templateHtml = value.content;
675
- insertIframeHtml(editor, win, templateHtml);
676
- }
677
-
678
- win.find('#description')[0].text(e.control.value().description);
679
- };
680
-
681
- win = editor.windowManager.open({
682
- title: 'Insert template',
683
- layout: 'flex',
684
- direction: 'column',
685
- align: 'stretch',
686
- padding: 15,
687
- spacing: 10,
688
- items: [
689
- {
690
- type: 'form',
691
- flex: 0,
692
- padding: 0,
693
- items: [
694
- {
695
- type: 'container',
267
+ win.find('#description')[0].text(e.control.value().description);
268
+ };
269
+ win = editor.windowManager.open({
270
+ title: 'Insert template',
271
+ layout: 'flex',
272
+ direction: 'column',
273
+ align: 'stretch',
274
+ padding: 15,
275
+ spacing: 10,
276
+ items: [
277
+ {
278
+ type: 'form',
279
+ flex: 0,
280
+ padding: 0,
281
+ items: [{
282
+ type: 'container',
283
+ label: 'Templates',
284
+ items: {
285
+ type: 'listbox',
696
286
  label: 'Templates',
697
- items: {
698
- type: 'listbox',
699
- label: 'Templates',
700
- name: 'template',
701
- values: values,
702
- onselect: onSelectTemplate
703
- }
287
+ name: 'template',
288
+ values: values,
289
+ onselect: onSelectTemplate
704
290
  }
705
- ]
706
- },
707
- {
708
- type: 'label',
709
- name: 'description',
710
- label: 'Description',
711
- text: '\u00a0'
712
- },
713
- {
714
- type: 'iframe',
715
- flex: 1,
716
- border: 1
717
- }
718
- ],
719
-
720
- onsubmit: function () {
721
- Templates.insertTemplate(editor, false, templateHtml);
291
+ }]
722
292
  },
293
+ {
294
+ type: 'label',
295
+ name: 'description',
296
+ label: 'Description',
297
+ text: '\xA0'
298
+ },
299
+ {
300
+ type: 'iframe',
301
+ flex: 1,
302
+ border: 1
303
+ }
304
+ ],
305
+ onsubmit: function () {
306
+ $_a5rnv3r5jm0og227.insertTemplate(editor, false, templateHtml);
307
+ },
308
+ minWidth: $_efmh19r8jm0og22b.getDialogWidth(editor),
309
+ minHeight: $_efmh19r8jm0og22b.getDialogHeight(editor)
310
+ });
311
+ win.find('listbox')[0].fire('select');
312
+ };
313
+ var $_2gw58ardjm0og22j = { open: open };
723
314
 
724
- minWidth: Settings.getDialogWidth(editor),
725
- minHeight: Settings.getDialogHeight(editor)
726
- });
727
-
728
- win.find('listbox')[0].fire('select');
729
- };
730
-
731
- return {
732
- open: open
733
- };
734
- }
735
- );
736
- /**
737
- * Buttons.js
738
- *
739
- * Released under LGPL License.
740
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
741
- *
742
- * License: http://www.tinymce.com/license
743
- * Contributing: http://www.tinymce.com/contributing
744
- */
745
-
746
- define(
747
- 'tinymce.plugins.template.ui.Buttons',
748
- [
749
- 'tinymce.plugins.template.core.Templates',
750
- 'tinymce.plugins.template.ui.Dialog'
751
- ],
752
- function (Templates, Dialog) {
753
- var showDialog = function (editor) {
754
- return function (templates) {
755
- Dialog.open(editor, templates);
756
- };
757
- };
758
-
759
- var register = function (editor) {
760
- editor.addButton('template', {
761
- title: 'Insert template',
762
- onclick: Templates.createTemplateList(editor.settings, showDialog(editor))
763
- });
764
-
765
- editor.addMenuItem('template', {
766
- text: 'Template',
767
- onclick: Templates.createTemplateList(editor.settings, showDialog(editor)),
768
- icon: 'template',
769
- context: 'insert'
770
- });
771
- };
772
-
773
- return {
774
- register: register
315
+ var showDialog = function (editor) {
316
+ return function (templates) {
317
+ $_2gw58ardjm0og22j.open(editor, templates);
775
318
  };
319
+ };
320
+ var register$1 = function (editor) {
321
+ editor.addButton('template', {
322
+ title: 'Insert template',
323
+ onclick: $_a5rnv3r5jm0og227.createTemplateList(editor.settings, showDialog(editor))
324
+ });
325
+ editor.addMenuItem('template', {
326
+ text: 'Template',
327
+ onclick: $_a5rnv3r5jm0og227.createTemplateList(editor.settings, showDialog(editor)),
328
+ icon: 'template',
329
+ context: 'insert'
330
+ });
331
+ };
332
+ var $_docghkrcjm0og22i = { register: register$1 };
333
+
334
+ global.add('template', function (editor) {
335
+ $_docghkrcjm0og22i.register(editor);
336
+ $_di64i5r3jm0og21s.register(editor);
337
+ $_apvus8rbjm0og22g.setup(editor);
338
+ });
339
+ function Plugin () {
776
340
  }
777
- );
778
- /**
779
- * Plugin.js
780
- *
781
- * Released under LGPL License.
782
- * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
783
- *
784
- * License: http://www.tinymce.com/license
785
- * Contributing: http://www.tinymce.com/contributing
786
- */
787
341
 
788
- define(
789
- 'tinymce.plugins.template.Plugin',
790
- [
791
- 'tinymce.core.PluginManager',
792
- 'tinymce.plugins.template.api.Commands',
793
- 'tinymce.plugins.template.core.FilterContent',
794
- 'tinymce.plugins.template.ui.Buttons'
795
- ],
796
- function (PluginManager, Commands, FilterContent, Buttons) {
797
- PluginManager.add('template', function (editor) {
798
- Buttons.register(editor);
799
- Commands.register(editor);
800
- FilterContent.setup(editor);
801
- });
342
+ return Plugin;
802
343
 
803
- return function () { };
804
- }
805
- );
806
- dem('tinymce.plugins.template.Plugin')();
344
+ }());
807
345
  })();