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
@@ -0,0 +1,3899 @@
1
+ "no use strict";
2
+ !(function(window) {
3
+ if (typeof window.window != "undefined" && window.document)
4
+ return;
5
+ if (window.require && window.define)
6
+ return;
7
+
8
+ if (!window.console) {
9
+ window.console = function() {
10
+ var msgs = Array.prototype.slice.call(arguments, 0);
11
+ postMessage({type: "log", data: msgs});
12
+ };
13
+ window.console.error =
14
+ window.console.warn =
15
+ window.console.log =
16
+ window.console.trace = window.console;
17
+ }
18
+ window.window = window;
19
+ window.ace = window;
20
+
21
+ window.onerror = function(message, file, line, col, err) {
22
+ postMessage({type: "error", data: {
23
+ message: message,
24
+ data: err.data,
25
+ file: file,
26
+ line: line,
27
+ col: col,
28
+ stack: err.stack
29
+ }});
30
+ };
31
+
32
+ window.normalizeModule = function(parentId, moduleName) {
33
+ // normalize plugin requires
34
+ if (moduleName.indexOf("!") !== -1) {
35
+ var chunks = moduleName.split("!");
36
+ return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
37
+ }
38
+ // normalize relative requires
39
+ if (moduleName.charAt(0) == ".") {
40
+ var base = parentId.split("/").slice(0, -1).join("/");
41
+ moduleName = (base ? base + "/" : "") + moduleName;
42
+
43
+ while (moduleName.indexOf(".") !== -1 && previous != moduleName) {
44
+ var previous = moduleName;
45
+ moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
46
+ }
47
+ }
48
+
49
+ return moduleName;
50
+ };
51
+
52
+ window.require = function require(parentId, id) {
53
+ if (!id) {
54
+ id = parentId;
55
+ parentId = null;
56
+ }
57
+ if (!id.charAt)
58
+ throw new Error("worker.js require() accepts only (parentId, id) as arguments");
59
+
60
+ id = window.normalizeModule(parentId, id);
61
+
62
+ var module = window.require.modules[id];
63
+ if (module) {
64
+ if (!module.initialized) {
65
+ module.initialized = true;
66
+ module.exports = module.factory().exports;
67
+ }
68
+ return module.exports;
69
+ }
70
+
71
+ if (!window.require.tlns)
72
+ return console.log("unable to load " + id);
73
+
74
+ var path = resolveModuleId(id, window.require.tlns);
75
+ if (path.slice(-3) != ".js") path += ".js";
76
+
77
+ window.require.id = id;
78
+ window.require.modules[id] = {}; // prevent infinite loop on broken modules
79
+ importScripts(path);
80
+ return window.require(parentId, id);
81
+ };
82
+ function resolveModuleId(id, paths) {
83
+ var testPath = id, tail = "";
84
+ while (testPath) {
85
+ var alias = paths[testPath];
86
+ if (typeof alias == "string") {
87
+ return alias + tail;
88
+ } else if (alias) {
89
+ return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name);
90
+ } else if (alias === false) {
91
+ return "";
92
+ }
93
+ var i = testPath.lastIndexOf("/");
94
+ if (i === -1) break;
95
+ tail = testPath.substr(i) + tail;
96
+ testPath = testPath.slice(0, i);
97
+ }
98
+ return id;
99
+ }
100
+ window.require.modules = {};
101
+ window.require.tlns = {};
102
+
103
+ window.define = function(id, deps, factory) {
104
+ if (arguments.length == 2) {
105
+ factory = deps;
106
+ if (typeof id != "string") {
107
+ deps = id;
108
+ id = window.require.id;
109
+ }
110
+ } else if (arguments.length == 1) {
111
+ factory = id;
112
+ deps = [];
113
+ id = window.require.id;
114
+ }
115
+
116
+ if (typeof factory != "function") {
117
+ window.require.modules[id] = {
118
+ exports: factory,
119
+ initialized: true
120
+ };
121
+ return;
122
+ }
123
+
124
+ if (!deps.length)
125
+ // If there is no dependencies, we inject "require", "exports" and
126
+ // "module" as dependencies, to provide CommonJS compatibility.
127
+ deps = ["require", "exports", "module"];
128
+
129
+ var req = function(childId) {
130
+ return window.require(id, childId);
131
+ };
132
+
133
+ window.require.modules[id] = {
134
+ exports: {},
135
+ factory: function() {
136
+ var module = this;
137
+ var returnExports = factory.apply(this, deps.slice(0, factory.length).map(function(dep) {
138
+ switch (dep) {
139
+ // Because "require", "exports" and "module" aren't actual
140
+ // dependencies, we must handle them seperately.
141
+ case "require": return req;
142
+ case "exports": return module.exports;
143
+ case "module": return module;
144
+ // But for all other dependencies, we can just go ahead and
145
+ // require them.
146
+ default: return req(dep);
147
+ }
148
+ }));
149
+ if (returnExports)
150
+ module.exports = returnExports;
151
+ return module;
152
+ }
153
+ };
154
+ };
155
+ window.define.amd = {};
156
+ require.tlns = {};
157
+ window.initBaseUrls = function initBaseUrls(topLevelNamespaces) {
158
+ for (var i in topLevelNamespaces)
159
+ require.tlns[i] = topLevelNamespaces[i];
160
+ };
161
+
162
+ window.initSender = function initSender() {
163
+
164
+ var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
165
+ var oop = window.require("ace/lib/oop");
166
+
167
+ var Sender = function() {};
168
+
169
+ (function() {
170
+
171
+ oop.implement(this, EventEmitter);
172
+
173
+ this.callback = function(data, callbackId) {
174
+ postMessage({
175
+ type: "call",
176
+ id: callbackId,
177
+ data: data
178
+ });
179
+ };
180
+
181
+ this.emit = function(name, data) {
182
+ postMessage({
183
+ type: "event",
184
+ name: name,
185
+ data: data
186
+ });
187
+ };
188
+
189
+ }).call(Sender.prototype);
190
+
191
+ return new Sender();
192
+ };
193
+
194
+ var main = window.main = null;
195
+ var sender = window.sender = null;
196
+
197
+ window.onmessage = function(e) {
198
+ var msg = e.data;
199
+ if (msg.event && sender) {
200
+ sender._signal(msg.event, msg.data);
201
+ }
202
+ else if (msg.command) {
203
+ if (main[msg.command])
204
+ main[msg.command].apply(main, msg.args);
205
+ else if (window[msg.command])
206
+ window[msg.command].apply(window, msg.args);
207
+ else
208
+ throw new Error("Unknown command:" + msg.command);
209
+ }
210
+ else if (msg.init) {
211
+ window.initBaseUrls(msg.tlns);
212
+ require("ace/lib/es5-shim");
213
+ sender = window.sender = window.initSender();
214
+ var clazz = require(msg.module)[msg.classname];
215
+ main = window.main = new clazz(sender);
216
+ }
217
+ };
218
+ })(this);
219
+
220
+ define("ace/lib/oop",[], function(require, exports, module) {
221
+ "use strict";
222
+
223
+ exports.inherits = function(ctor, superCtor) {
224
+ ctor.super_ = superCtor;
225
+ ctor.prototype = Object.create(superCtor.prototype, {
226
+ constructor: {
227
+ value: ctor,
228
+ enumerable: false,
229
+ writable: true,
230
+ configurable: true
231
+ }
232
+ });
233
+ };
234
+
235
+ exports.mixin = function(obj, mixin) {
236
+ for (var key in mixin) {
237
+ obj[key] = mixin[key];
238
+ }
239
+ return obj;
240
+ };
241
+
242
+ exports.implement = function(proto, mixin) {
243
+ exports.mixin(proto, mixin);
244
+ };
245
+
246
+ });
247
+
248
+ define("ace/lib/lang",[], function(require, exports, module) {
249
+ "use strict";
250
+
251
+ exports.last = function(a) {
252
+ return a[a.length - 1];
253
+ };
254
+
255
+ exports.stringReverse = function(string) {
256
+ return string.split("").reverse().join("");
257
+ };
258
+
259
+ exports.stringRepeat = function (string, count) {
260
+ var result = '';
261
+ while (count > 0) {
262
+ if (count & 1)
263
+ result += string;
264
+
265
+ if (count >>= 1)
266
+ string += string;
267
+ }
268
+ return result;
269
+ };
270
+
271
+ var trimBeginRegexp = /^\s\s*/;
272
+ var trimEndRegexp = /\s\s*$/;
273
+
274
+ exports.stringTrimLeft = function (string) {
275
+ return string.replace(trimBeginRegexp, '');
276
+ };
277
+
278
+ exports.stringTrimRight = function (string) {
279
+ return string.replace(trimEndRegexp, '');
280
+ };
281
+
282
+ exports.copyObject = function(obj) {
283
+ var copy = {};
284
+ for (var key in obj) {
285
+ copy[key] = obj[key];
286
+ }
287
+ return copy;
288
+ };
289
+
290
+ exports.copyArray = function(array){
291
+ var copy = [];
292
+ for (var i=0, l=array.length; i<l; i++) {
293
+ if (array[i] && typeof array[i] == "object")
294
+ copy[i] = this.copyObject(array[i]);
295
+ else
296
+ copy[i] = array[i];
297
+ }
298
+ return copy;
299
+ };
300
+
301
+ exports.deepCopy = function deepCopy(obj) {
302
+ if (typeof obj !== "object" || !obj)
303
+ return obj;
304
+ var copy;
305
+ if (Array.isArray(obj)) {
306
+ copy = [];
307
+ for (var key = 0; key < obj.length; key++) {
308
+ copy[key] = deepCopy(obj[key]);
309
+ }
310
+ return copy;
311
+ }
312
+ if (Object.prototype.toString.call(obj) !== "[object Object]")
313
+ return obj;
314
+
315
+ copy = {};
316
+ for (var key in obj)
317
+ copy[key] = deepCopy(obj[key]);
318
+ return copy;
319
+ };
320
+
321
+ exports.arrayToMap = function(arr) {
322
+ var map = {};
323
+ for (var i=0; i<arr.length; i++) {
324
+ map[arr[i]] = 1;
325
+ }
326
+ return map;
327
+
328
+ };
329
+
330
+ exports.createMap = function(props) {
331
+ var map = Object.create(null);
332
+ for (var i in props) {
333
+ map[i] = props[i];
334
+ }
335
+ return map;
336
+ };
337
+ exports.arrayRemove = function(array, value) {
338
+ for (var i = 0; i <= array.length; i++) {
339
+ if (value === array[i]) {
340
+ array.splice(i, 1);
341
+ }
342
+ }
343
+ };
344
+
345
+ exports.escapeRegExp = function(str) {
346
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
347
+ };
348
+
349
+ exports.escapeHTML = function(str) {
350
+ return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
351
+ };
352
+
353
+ exports.getMatchOffsets = function(string, regExp) {
354
+ var matches = [];
355
+
356
+ string.replace(regExp, function(str) {
357
+ matches.push({
358
+ offset: arguments[arguments.length-2],
359
+ length: str.length
360
+ });
361
+ });
362
+
363
+ return matches;
364
+ };
365
+ exports.deferredCall = function(fcn) {
366
+ var timer = null;
367
+ var callback = function() {
368
+ timer = null;
369
+ fcn();
370
+ };
371
+
372
+ var deferred = function(timeout) {
373
+ deferred.cancel();
374
+ timer = setTimeout(callback, timeout || 0);
375
+ return deferred;
376
+ };
377
+
378
+ deferred.schedule = deferred;
379
+
380
+ deferred.call = function() {
381
+ this.cancel();
382
+ fcn();
383
+ return deferred;
384
+ };
385
+
386
+ deferred.cancel = function() {
387
+ clearTimeout(timer);
388
+ timer = null;
389
+ return deferred;
390
+ };
391
+
392
+ deferred.isPending = function() {
393
+ return timer;
394
+ };
395
+
396
+ return deferred;
397
+ };
398
+
399
+
400
+ exports.delayedCall = function(fcn, defaultTimeout) {
401
+ var timer = null;
402
+ var callback = function() {
403
+ timer = null;
404
+ fcn();
405
+ };
406
+
407
+ var _self = function(timeout) {
408
+ if (timer == null)
409
+ timer = setTimeout(callback, timeout || defaultTimeout);
410
+ };
411
+
412
+ _self.delay = function(timeout) {
413
+ timer && clearTimeout(timer);
414
+ timer = setTimeout(callback, timeout || defaultTimeout);
415
+ };
416
+ _self.schedule = _self;
417
+
418
+ _self.call = function() {
419
+ this.cancel();
420
+ fcn();
421
+ };
422
+
423
+ _self.cancel = function() {
424
+ timer && clearTimeout(timer);
425
+ timer = null;
426
+ };
427
+
428
+ _self.isPending = function() {
429
+ return timer;
430
+ };
431
+
432
+ return _self;
433
+ };
434
+ });
435
+
436
+ define("ace/range",[], function(require, exports, module) {
437
+ "use strict";
438
+ var comparePoints = function(p1, p2) {
439
+ return p1.row - p2.row || p1.column - p2.column;
440
+ };
441
+ var Range = function(startRow, startColumn, endRow, endColumn) {
442
+ this.start = {
443
+ row: startRow,
444
+ column: startColumn
445
+ };
446
+
447
+ this.end = {
448
+ row: endRow,
449
+ column: endColumn
450
+ };
451
+ };
452
+
453
+ (function() {
454
+ this.isEqual = function(range) {
455
+ return this.start.row === range.start.row &&
456
+ this.end.row === range.end.row &&
457
+ this.start.column === range.start.column &&
458
+ this.end.column === range.end.column;
459
+ };
460
+ this.toString = function() {
461
+ return ("Range: [" + this.start.row + "/" + this.start.column +
462
+ "] -> [" + this.end.row + "/" + this.end.column + "]");
463
+ };
464
+
465
+ this.contains = function(row, column) {
466
+ return this.compare(row, column) == 0;
467
+ };
468
+ this.compareRange = function(range) {
469
+ var cmp,
470
+ end = range.end,
471
+ start = range.start;
472
+
473
+ cmp = this.compare(end.row, end.column);
474
+ if (cmp == 1) {
475
+ cmp = this.compare(start.row, start.column);
476
+ if (cmp == 1) {
477
+ return 2;
478
+ } else if (cmp == 0) {
479
+ return 1;
480
+ } else {
481
+ return 0;
482
+ }
483
+ } else if (cmp == -1) {
484
+ return -2;
485
+ } else {
486
+ cmp = this.compare(start.row, start.column);
487
+ if (cmp == -1) {
488
+ return -1;
489
+ } else if (cmp == 1) {
490
+ return 42;
491
+ } else {
492
+ return 0;
493
+ }
494
+ }
495
+ };
496
+ this.comparePoint = function(p) {
497
+ return this.compare(p.row, p.column);
498
+ };
499
+ this.containsRange = function(range) {
500
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
501
+ };
502
+ this.intersects = function(range) {
503
+ var cmp = this.compareRange(range);
504
+ return (cmp == -1 || cmp == 0 || cmp == 1);
505
+ };
506
+ this.isEnd = function(row, column) {
507
+ return this.end.row == row && this.end.column == column;
508
+ };
509
+ this.isStart = function(row, column) {
510
+ return this.start.row == row && this.start.column == column;
511
+ };
512
+ this.setStart = function(row, column) {
513
+ if (typeof row == "object") {
514
+ this.start.column = row.column;
515
+ this.start.row = row.row;
516
+ } else {
517
+ this.start.row = row;
518
+ this.start.column = column;
519
+ }
520
+ };
521
+ this.setEnd = function(row, column) {
522
+ if (typeof row == "object") {
523
+ this.end.column = row.column;
524
+ this.end.row = row.row;
525
+ } else {
526
+ this.end.row = row;
527
+ this.end.column = column;
528
+ }
529
+ };
530
+ this.inside = function(row, column) {
531
+ if (this.compare(row, column) == 0) {
532
+ if (this.isEnd(row, column) || this.isStart(row, column)) {
533
+ return false;
534
+ } else {
535
+ return true;
536
+ }
537
+ }
538
+ return false;
539
+ };
540
+ this.insideStart = function(row, column) {
541
+ if (this.compare(row, column) == 0) {
542
+ if (this.isEnd(row, column)) {
543
+ return false;
544
+ } else {
545
+ return true;
546
+ }
547
+ }
548
+ return false;
549
+ };
550
+ this.insideEnd = function(row, column) {
551
+ if (this.compare(row, column) == 0) {
552
+ if (this.isStart(row, column)) {
553
+ return false;
554
+ } else {
555
+ return true;
556
+ }
557
+ }
558
+ return false;
559
+ };
560
+ this.compare = function(row, column) {
561
+ if (!this.isMultiLine()) {
562
+ if (row === this.start.row) {
563
+ return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
564
+ }
565
+ }
566
+
567
+ if (row < this.start.row)
568
+ return -1;
569
+
570
+ if (row > this.end.row)
571
+ return 1;
572
+
573
+ if (this.start.row === row)
574
+ return column >= this.start.column ? 0 : -1;
575
+
576
+ if (this.end.row === row)
577
+ return column <= this.end.column ? 0 : 1;
578
+
579
+ return 0;
580
+ };
581
+ this.compareStart = function(row, column) {
582
+ if (this.start.row == row && this.start.column == column) {
583
+ return -1;
584
+ } else {
585
+ return this.compare(row, column);
586
+ }
587
+ };
588
+ this.compareEnd = function(row, column) {
589
+ if (this.end.row == row && this.end.column == column) {
590
+ return 1;
591
+ } else {
592
+ return this.compare(row, column);
593
+ }
594
+ };
595
+ this.compareInside = function(row, column) {
596
+ if (this.end.row == row && this.end.column == column) {
597
+ return 1;
598
+ } else if (this.start.row == row && this.start.column == column) {
599
+ return -1;
600
+ } else {
601
+ return this.compare(row, column);
602
+ }
603
+ };
604
+ this.clipRows = function(firstRow, lastRow) {
605
+ if (this.end.row > lastRow)
606
+ var end = {row: lastRow + 1, column: 0};
607
+ else if (this.end.row < firstRow)
608
+ var end = {row: firstRow, column: 0};
609
+
610
+ if (this.start.row > lastRow)
611
+ var start = {row: lastRow + 1, column: 0};
612
+ else if (this.start.row < firstRow)
613
+ var start = {row: firstRow, column: 0};
614
+
615
+ return Range.fromPoints(start || this.start, end || this.end);
616
+ };
617
+ this.extend = function(row, column) {
618
+ var cmp = this.compare(row, column);
619
+
620
+ if (cmp == 0)
621
+ return this;
622
+ else if (cmp == -1)
623
+ var start = {row: row, column: column};
624
+ else
625
+ var end = {row: row, column: column};
626
+
627
+ return Range.fromPoints(start || this.start, end || this.end);
628
+ };
629
+
630
+ this.isEmpty = function() {
631
+ return (this.start.row === this.end.row && this.start.column === this.end.column);
632
+ };
633
+ this.isMultiLine = function() {
634
+ return (this.start.row !== this.end.row);
635
+ };
636
+ this.clone = function() {
637
+ return Range.fromPoints(this.start, this.end);
638
+ };
639
+ this.collapseRows = function() {
640
+ if (this.end.column == 0)
641
+ return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0);
642
+ else
643
+ return new Range(this.start.row, 0, this.end.row, 0);
644
+ };
645
+ this.toScreenRange = function(session) {
646
+ var screenPosStart = session.documentToScreenPosition(this.start);
647
+ var screenPosEnd = session.documentToScreenPosition(this.end);
648
+
649
+ return new Range(
650
+ screenPosStart.row, screenPosStart.column,
651
+ screenPosEnd.row, screenPosEnd.column
652
+ );
653
+ };
654
+ this.moveBy = function(row, column) {
655
+ this.start.row += row;
656
+ this.start.column += column;
657
+ this.end.row += row;
658
+ this.end.column += column;
659
+ };
660
+
661
+ }).call(Range.prototype);
662
+ Range.fromPoints = function(start, end) {
663
+ return new Range(start.row, start.column, end.row, end.column);
664
+ };
665
+ Range.comparePoints = comparePoints;
666
+
667
+ Range.comparePoints = function(p1, p2) {
668
+ return p1.row - p2.row || p1.column - p2.column;
669
+ };
670
+
671
+
672
+ exports.Range = Range;
673
+ });
674
+
675
+ define("ace/apply_delta",[], function(require, exports, module) {
676
+ "use strict";
677
+
678
+ function throwDeltaError(delta, errorText){
679
+ console.log("Invalid Delta:", delta);
680
+ throw "Invalid Delta: " + errorText;
681
+ }
682
+
683
+ function positionInDocument(docLines, position) {
684
+ return position.row >= 0 && position.row < docLines.length &&
685
+ position.column >= 0 && position.column <= docLines[position.row].length;
686
+ }
687
+
688
+ function validateDelta(docLines, delta) {
689
+ if (delta.action != "insert" && delta.action != "remove")
690
+ throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
691
+ if (!(delta.lines instanceof Array))
692
+ throwDeltaError(delta, "delta.lines must be an Array");
693
+ if (!delta.start || !delta.end)
694
+ throwDeltaError(delta, "delta.start/end must be an present");
695
+ var start = delta.start;
696
+ if (!positionInDocument(docLines, delta.start))
697
+ throwDeltaError(delta, "delta.start must be contained in document");
698
+ var end = delta.end;
699
+ if (delta.action == "remove" && !positionInDocument(docLines, end))
700
+ throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
701
+ var numRangeRows = end.row - start.row;
702
+ var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
703
+ if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
704
+ throwDeltaError(delta, "delta.range must match delta lines");
705
+ }
706
+
707
+ exports.applyDelta = function(docLines, delta, doNotValidate) {
708
+ var row = delta.start.row;
709
+ var startColumn = delta.start.column;
710
+ var line = docLines[row] || "";
711
+ switch (delta.action) {
712
+ case "insert":
713
+ var lines = delta.lines;
714
+ if (lines.length === 1) {
715
+ docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
716
+ } else {
717
+ var args = [row, 1].concat(delta.lines);
718
+ docLines.splice.apply(docLines, args);
719
+ docLines[row] = line.substring(0, startColumn) + docLines[row];
720
+ docLines[row + delta.lines.length - 1] += line.substring(startColumn);
721
+ }
722
+ break;
723
+ case "remove":
724
+ var endColumn = delta.end.column;
725
+ var endRow = delta.end.row;
726
+ if (row === endRow) {
727
+ docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
728
+ } else {
729
+ docLines.splice(
730
+ row, endRow - row + 1,
731
+ line.substring(0, startColumn) + docLines[endRow].substring(endColumn)
732
+ );
733
+ }
734
+ break;
735
+ }
736
+ };
737
+ });
738
+
739
+ define("ace/lib/event_emitter",[], function(require, exports, module) {
740
+ "use strict";
741
+
742
+ var EventEmitter = {};
743
+ var stopPropagation = function() { this.propagationStopped = true; };
744
+ var preventDefault = function() { this.defaultPrevented = true; };
745
+
746
+ EventEmitter._emit =
747
+ EventEmitter._dispatchEvent = function(eventName, e) {
748
+ this._eventRegistry || (this._eventRegistry = {});
749
+ this._defaultHandlers || (this._defaultHandlers = {});
750
+
751
+ var listeners = this._eventRegistry[eventName] || [];
752
+ var defaultHandler = this._defaultHandlers[eventName];
753
+ if (!listeners.length && !defaultHandler)
754
+ return;
755
+
756
+ if (typeof e != "object" || !e)
757
+ e = {};
758
+
759
+ if (!e.type)
760
+ e.type = eventName;
761
+ if (!e.stopPropagation)
762
+ e.stopPropagation = stopPropagation;
763
+ if (!e.preventDefault)
764
+ e.preventDefault = preventDefault;
765
+
766
+ listeners = listeners.slice();
767
+ for (var i=0; i<listeners.length; i++) {
768
+ listeners[i](e, this);
769
+ if (e.propagationStopped)
770
+ break;
771
+ }
772
+
773
+ if (defaultHandler && !e.defaultPrevented)
774
+ return defaultHandler(e, this);
775
+ };
776
+
777
+
778
+ EventEmitter._signal = function(eventName, e) {
779
+ var listeners = (this._eventRegistry || {})[eventName];
780
+ if (!listeners)
781
+ return;
782
+ listeners = listeners.slice();
783
+ for (var i=0; i<listeners.length; i++)
784
+ listeners[i](e, this);
785
+ };
786
+
787
+ EventEmitter.once = function(eventName, callback) {
788
+ var _self = this;
789
+ callback && this.addEventListener(eventName, function newCallback() {
790
+ _self.removeEventListener(eventName, newCallback);
791
+ callback.apply(null, arguments);
792
+ });
793
+ };
794
+
795
+
796
+ EventEmitter.setDefaultHandler = function(eventName, callback) {
797
+ var handlers = this._defaultHandlers;
798
+ if (!handlers)
799
+ handlers = this._defaultHandlers = {_disabled_: {}};
800
+
801
+ if (handlers[eventName]) {
802
+ var old = handlers[eventName];
803
+ var disabled = handlers._disabled_[eventName];
804
+ if (!disabled)
805
+ handlers._disabled_[eventName] = disabled = [];
806
+ disabled.push(old);
807
+ var i = disabled.indexOf(callback);
808
+ if (i != -1)
809
+ disabled.splice(i, 1);
810
+ }
811
+ handlers[eventName] = callback;
812
+ };
813
+ EventEmitter.removeDefaultHandler = function(eventName, callback) {
814
+ var handlers = this._defaultHandlers;
815
+ if (!handlers)
816
+ return;
817
+ var disabled = handlers._disabled_[eventName];
818
+
819
+ if (handlers[eventName] == callback) {
820
+ if (disabled)
821
+ this.setDefaultHandler(eventName, disabled.pop());
822
+ } else if (disabled) {
823
+ var i = disabled.indexOf(callback);
824
+ if (i != -1)
825
+ disabled.splice(i, 1);
826
+ }
827
+ };
828
+
829
+ EventEmitter.on =
830
+ EventEmitter.addEventListener = function(eventName, callback, capturing) {
831
+ this._eventRegistry = this._eventRegistry || {};
832
+
833
+ var listeners = this._eventRegistry[eventName];
834
+ if (!listeners)
835
+ listeners = this._eventRegistry[eventName] = [];
836
+
837
+ if (listeners.indexOf(callback) == -1)
838
+ listeners[capturing ? "unshift" : "push"](callback);
839
+ return callback;
840
+ };
841
+
842
+ EventEmitter.off =
843
+ EventEmitter.removeListener =
844
+ EventEmitter.removeEventListener = function(eventName, callback) {
845
+ this._eventRegistry = this._eventRegistry || {};
846
+
847
+ var listeners = this._eventRegistry[eventName];
848
+ if (!listeners)
849
+ return;
850
+
851
+ var index = listeners.indexOf(callback);
852
+ if (index !== -1)
853
+ listeners.splice(index, 1);
854
+ };
855
+
856
+ EventEmitter.removeAllListeners = function(eventName) {
857
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
858
+ };
859
+
860
+ exports.EventEmitter = EventEmitter;
861
+
862
+ });
863
+
864
+ define("ace/anchor",[], function(require, exports, module) {
865
+ "use strict";
866
+
867
+ var oop = require("./lib/oop");
868
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
869
+
870
+ var Anchor = exports.Anchor = function(doc, row, column) {
871
+ this.$onChange = this.onChange.bind(this);
872
+ this.attach(doc);
873
+
874
+ if (typeof column == "undefined")
875
+ this.setPosition(row.row, row.column);
876
+ else
877
+ this.setPosition(row, column);
878
+ };
879
+
880
+ (function() {
881
+
882
+ oop.implement(this, EventEmitter);
883
+ this.getPosition = function() {
884
+ return this.$clipPositionToDocument(this.row, this.column);
885
+ };
886
+ this.getDocument = function() {
887
+ return this.document;
888
+ };
889
+ this.$insertRight = false;
890
+ this.onChange = function(delta) {
891
+ if (delta.start.row == delta.end.row && delta.start.row != this.row)
892
+ return;
893
+
894
+ if (delta.start.row > this.row)
895
+ return;
896
+
897
+ var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight);
898
+ this.setPosition(point.row, point.column, true);
899
+ };
900
+
901
+ function $pointsInOrder(point1, point2, equalPointsInOrder) {
902
+ var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
903
+ return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
904
+ }
905
+
906
+ function $getTransformedPoint(delta, point, moveIfEqual) {
907
+ var deltaIsInsert = delta.action == "insert";
908
+ var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
909
+ var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
910
+ var deltaStart = delta.start;
911
+ var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
912
+ if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
913
+ return {
914
+ row: point.row,
915
+ column: point.column
916
+ };
917
+ }
918
+ if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
919
+ return {
920
+ row: point.row + deltaRowShift,
921
+ column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
922
+ };
923
+ }
924
+ return {
925
+ row: deltaStart.row,
926
+ column: deltaStart.column
927
+ };
928
+ }
929
+ this.setPosition = function(row, column, noClip) {
930
+ var pos;
931
+ if (noClip) {
932
+ pos = {
933
+ row: row,
934
+ column: column
935
+ };
936
+ } else {
937
+ pos = this.$clipPositionToDocument(row, column);
938
+ }
939
+
940
+ if (this.row == pos.row && this.column == pos.column)
941
+ return;
942
+
943
+ var old = {
944
+ row: this.row,
945
+ column: this.column
946
+ };
947
+
948
+ this.row = pos.row;
949
+ this.column = pos.column;
950
+ this._signal("change", {
951
+ old: old,
952
+ value: pos
953
+ });
954
+ };
955
+ this.detach = function() {
956
+ this.document.removeEventListener("change", this.$onChange);
957
+ };
958
+ this.attach = function(doc) {
959
+ this.document = doc || this.document;
960
+ this.document.on("change", this.$onChange);
961
+ };
962
+ this.$clipPositionToDocument = function(row, column) {
963
+ var pos = {};
964
+
965
+ if (row >= this.document.getLength()) {
966
+ pos.row = Math.max(0, this.document.getLength() - 1);
967
+ pos.column = this.document.getLine(pos.row).length;
968
+ }
969
+ else if (row < 0) {
970
+ pos.row = 0;
971
+ pos.column = 0;
972
+ }
973
+ else {
974
+ pos.row = row;
975
+ pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
976
+ }
977
+
978
+ if (column < 0)
979
+ pos.column = 0;
980
+
981
+ return pos;
982
+ };
983
+
984
+ }).call(Anchor.prototype);
985
+
986
+ });
987
+
988
+ define("ace/document",[], function(require, exports, module) {
989
+ "use strict";
990
+
991
+ var oop = require("./lib/oop");
992
+ var applyDelta = require("./apply_delta").applyDelta;
993
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
994
+ var Range = require("./range").Range;
995
+ var Anchor = require("./anchor").Anchor;
996
+
997
+ var Document = function(textOrLines) {
998
+ this.$lines = [""];
999
+ if (textOrLines.length === 0) {
1000
+ this.$lines = [""];
1001
+ } else if (Array.isArray(textOrLines)) {
1002
+ this.insertMergedLines({row: 0, column: 0}, textOrLines);
1003
+ } else {
1004
+ this.insert({row: 0, column:0}, textOrLines);
1005
+ }
1006
+ };
1007
+
1008
+ (function() {
1009
+
1010
+ oop.implement(this, EventEmitter);
1011
+ this.setValue = function(text) {
1012
+ var len = this.getLength() - 1;
1013
+ this.remove(new Range(0, 0, len, this.getLine(len).length));
1014
+ this.insert({row: 0, column: 0}, text);
1015
+ };
1016
+ this.getValue = function() {
1017
+ return this.getAllLines().join(this.getNewLineCharacter());
1018
+ };
1019
+ this.createAnchor = function(row, column) {
1020
+ return new Anchor(this, row, column);
1021
+ };
1022
+ if ("aaa".split(/a/).length === 0) {
1023
+ this.$split = function(text) {
1024
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
1025
+ };
1026
+ } else {
1027
+ this.$split = function(text) {
1028
+ return text.split(/\r\n|\r|\n/);
1029
+ };
1030
+ }
1031
+
1032
+
1033
+ this.$detectNewLine = function(text) {
1034
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
1035
+ this.$autoNewLine = match ? match[1] : "\n";
1036
+ this._signal("changeNewLineMode");
1037
+ };
1038
+ this.getNewLineCharacter = function() {
1039
+ switch (this.$newLineMode) {
1040
+ case "windows":
1041
+ return "\r\n";
1042
+ case "unix":
1043
+ return "\n";
1044
+ default:
1045
+ return this.$autoNewLine || "\n";
1046
+ }
1047
+ };
1048
+
1049
+ this.$autoNewLine = "";
1050
+ this.$newLineMode = "auto";
1051
+ this.setNewLineMode = function(newLineMode) {
1052
+ if (this.$newLineMode === newLineMode)
1053
+ return;
1054
+
1055
+ this.$newLineMode = newLineMode;
1056
+ this._signal("changeNewLineMode");
1057
+ };
1058
+ this.getNewLineMode = function() {
1059
+ return this.$newLineMode;
1060
+ };
1061
+ this.isNewLine = function(text) {
1062
+ return (text == "\r\n" || text == "\r" || text == "\n");
1063
+ };
1064
+ this.getLine = function(row) {
1065
+ return this.$lines[row] || "";
1066
+ };
1067
+ this.getLines = function(firstRow, lastRow) {
1068
+ return this.$lines.slice(firstRow, lastRow + 1);
1069
+ };
1070
+ this.getAllLines = function() {
1071
+ return this.getLines(0, this.getLength());
1072
+ };
1073
+ this.getLength = function() {
1074
+ return this.$lines.length;
1075
+ };
1076
+ this.getTextRange = function(range) {
1077
+ return this.getLinesForRange(range).join(this.getNewLineCharacter());
1078
+ };
1079
+ this.getLinesForRange = function(range) {
1080
+ var lines;
1081
+ if (range.start.row === range.end.row) {
1082
+ lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
1083
+ } else {
1084
+ lines = this.getLines(range.start.row, range.end.row);
1085
+ lines[0] = (lines[0] || "").substring(range.start.column);
1086
+ var l = lines.length - 1;
1087
+ if (range.end.row - range.start.row == l)
1088
+ lines[l] = lines[l].substring(0, range.end.column);
1089
+ }
1090
+ return lines;
1091
+ };
1092
+ this.insertLines = function(row, lines) {
1093
+ console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
1094
+ return this.insertFullLines(row, lines);
1095
+ };
1096
+ this.removeLines = function(firstRow, lastRow) {
1097
+ console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
1098
+ return this.removeFullLines(firstRow, lastRow);
1099
+ };
1100
+ this.insertNewLine = function(position) {
1101
+ console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
1102
+ return this.insertMergedLines(position, ["", ""]);
1103
+ };
1104
+ this.insert = function(position, text) {
1105
+ if (this.getLength() <= 1)
1106
+ this.$detectNewLine(text);
1107
+
1108
+ return this.insertMergedLines(position, this.$split(text));
1109
+ };
1110
+ this.insertInLine = function(position, text) {
1111
+ var start = this.clippedPos(position.row, position.column);
1112
+ var end = this.pos(position.row, position.column + text.length);
1113
+
1114
+ this.applyDelta({
1115
+ start: start,
1116
+ end: end,
1117
+ action: "insert",
1118
+ lines: [text]
1119
+ }, true);
1120
+
1121
+ return this.clonePos(end);
1122
+ };
1123
+
1124
+ this.clippedPos = function(row, column) {
1125
+ var length = this.getLength();
1126
+ if (row === undefined) {
1127
+ row = length;
1128
+ } else if (row < 0) {
1129
+ row = 0;
1130
+ } else if (row >= length) {
1131
+ row = length - 1;
1132
+ column = undefined;
1133
+ }
1134
+ var line = this.getLine(row);
1135
+ if (column == undefined)
1136
+ column = line.length;
1137
+ column = Math.min(Math.max(column, 0), line.length);
1138
+ return {row: row, column: column};
1139
+ };
1140
+
1141
+ this.clonePos = function(pos) {
1142
+ return {row: pos.row, column: pos.column};
1143
+ };
1144
+
1145
+ this.pos = function(row, column) {
1146
+ return {row: row, column: column};
1147
+ };
1148
+
1149
+ this.$clipPosition = function(position) {
1150
+ var length = this.getLength();
1151
+ if (position.row >= length) {
1152
+ position.row = Math.max(0, length - 1);
1153
+ position.column = this.getLine(length - 1).length;
1154
+ } else {
1155
+ position.row = Math.max(0, position.row);
1156
+ position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
1157
+ }
1158
+ return position;
1159
+ };
1160
+ this.insertFullLines = function(row, lines) {
1161
+ row = Math.min(Math.max(row, 0), this.getLength());
1162
+ var column = 0;
1163
+ if (row < this.getLength()) {
1164
+ lines = lines.concat([""]);
1165
+ column = 0;
1166
+ } else {
1167
+ lines = [""].concat(lines);
1168
+ row--;
1169
+ column = this.$lines[row].length;
1170
+ }
1171
+ this.insertMergedLines({row: row, column: column}, lines);
1172
+ };
1173
+ this.insertMergedLines = function(position, lines) {
1174
+ var start = this.clippedPos(position.row, position.column);
1175
+ var end = {
1176
+ row: start.row + lines.length - 1,
1177
+ column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
1178
+ };
1179
+
1180
+ this.applyDelta({
1181
+ start: start,
1182
+ end: end,
1183
+ action: "insert",
1184
+ lines: lines
1185
+ });
1186
+
1187
+ return this.clonePos(end);
1188
+ };
1189
+ this.remove = function(range) {
1190
+ var start = this.clippedPos(range.start.row, range.start.column);
1191
+ var end = this.clippedPos(range.end.row, range.end.column);
1192
+ this.applyDelta({
1193
+ start: start,
1194
+ end: end,
1195
+ action: "remove",
1196
+ lines: this.getLinesForRange({start: start, end: end})
1197
+ });
1198
+ return this.clonePos(start);
1199
+ };
1200
+ this.removeInLine = function(row, startColumn, endColumn) {
1201
+ var start = this.clippedPos(row, startColumn);
1202
+ var end = this.clippedPos(row, endColumn);
1203
+
1204
+ this.applyDelta({
1205
+ start: start,
1206
+ end: end,
1207
+ action: "remove",
1208
+ lines: this.getLinesForRange({start: start, end: end})
1209
+ }, true);
1210
+
1211
+ return this.clonePos(start);
1212
+ };
1213
+ this.removeFullLines = function(firstRow, lastRow) {
1214
+ firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
1215
+ lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1);
1216
+ var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
1217
+ var deleteLastNewLine = lastRow < this.getLength() - 1;
1218
+ var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow );
1219
+ var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 );
1220
+ var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow );
1221
+ var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length );
1222
+ var range = new Range(startRow, startCol, endRow, endCol);
1223
+ var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
1224
+
1225
+ this.applyDelta({
1226
+ start: range.start,
1227
+ end: range.end,
1228
+ action: "remove",
1229
+ lines: this.getLinesForRange(range)
1230
+ });
1231
+ return deletedLines;
1232
+ };
1233
+ this.removeNewLine = function(row) {
1234
+ if (row < this.getLength() - 1 && row >= 0) {
1235
+ this.applyDelta({
1236
+ start: this.pos(row, this.getLine(row).length),
1237
+ end: this.pos(row + 1, 0),
1238
+ action: "remove",
1239
+ lines: ["", ""]
1240
+ });
1241
+ }
1242
+ };
1243
+ this.replace = function(range, text) {
1244
+ if (!(range instanceof Range))
1245
+ range = Range.fromPoints(range.start, range.end);
1246
+ if (text.length === 0 && range.isEmpty())
1247
+ return range.start;
1248
+ if (text == this.getTextRange(range))
1249
+ return range.end;
1250
+
1251
+ this.remove(range);
1252
+ var end;
1253
+ if (text) {
1254
+ end = this.insert(range.start, text);
1255
+ }
1256
+ else {
1257
+ end = range.start;
1258
+ }
1259
+
1260
+ return end;
1261
+ };
1262
+ this.applyDeltas = function(deltas) {
1263
+ for (var i=0; i<deltas.length; i++) {
1264
+ this.applyDelta(deltas[i]);
1265
+ }
1266
+ };
1267
+ this.revertDeltas = function(deltas) {
1268
+ for (var i=deltas.length-1; i>=0; i--) {
1269
+ this.revertDelta(deltas[i]);
1270
+ }
1271
+ };
1272
+ this.applyDelta = function(delta, doNotValidate) {
1273
+ var isInsert = delta.action == "insert";
1274
+ if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
1275
+ : !Range.comparePoints(delta.start, delta.end)) {
1276
+ return;
1277
+ }
1278
+
1279
+ if (isInsert && delta.lines.length > 20000) {
1280
+ this.$splitAndapplyLargeDelta(delta, 20000);
1281
+ }
1282
+ else {
1283
+ applyDelta(this.$lines, delta, doNotValidate);
1284
+ this._signal("change", delta);
1285
+ }
1286
+ };
1287
+
1288
+ this.$splitAndapplyLargeDelta = function(delta, MAX) {
1289
+ var lines = delta.lines;
1290
+ var l = lines.length - MAX + 1;
1291
+ var row = delta.start.row;
1292
+ var column = delta.start.column;
1293
+ for (var from = 0, to = 0; from < l; from = to) {
1294
+ to += MAX - 1;
1295
+ var chunk = lines.slice(from, to);
1296
+ chunk.push("");
1297
+ this.applyDelta({
1298
+ start: this.pos(row + from, column),
1299
+ end: this.pos(row + to, column = 0),
1300
+ action: delta.action,
1301
+ lines: chunk
1302
+ }, true);
1303
+ }
1304
+ delta.lines = lines.slice(from);
1305
+ delta.start.row = row + from;
1306
+ delta.start.column = column;
1307
+ this.applyDelta(delta, true);
1308
+ };
1309
+ this.revertDelta = function(delta) {
1310
+ this.applyDelta({
1311
+ start: this.clonePos(delta.start),
1312
+ end: this.clonePos(delta.end),
1313
+ action: (delta.action == "insert" ? "remove" : "insert"),
1314
+ lines: delta.lines.slice()
1315
+ });
1316
+ };
1317
+ this.indexToPosition = function(index, startRow) {
1318
+ var lines = this.$lines || this.getAllLines();
1319
+ var newlineLength = this.getNewLineCharacter().length;
1320
+ for (var i = startRow || 0, l = lines.length; i < l; i++) {
1321
+ index -= lines[i].length + newlineLength;
1322
+ if (index < 0)
1323
+ return {row: i, column: index + lines[i].length + newlineLength};
1324
+ }
1325
+ return {row: l-1, column: index + lines[l-1].length + newlineLength};
1326
+ };
1327
+ this.positionToIndex = function(pos, startRow) {
1328
+ var lines = this.$lines || this.getAllLines();
1329
+ var newlineLength = this.getNewLineCharacter().length;
1330
+ var index = 0;
1331
+ var row = Math.min(pos.row, lines.length);
1332
+ for (var i = startRow || 0; i < row; ++i)
1333
+ index += lines[i].length + newlineLength;
1334
+
1335
+ return index + pos.column;
1336
+ };
1337
+
1338
+ }).call(Document.prototype);
1339
+
1340
+ exports.Document = Document;
1341
+ });
1342
+
1343
+ define("ace/worker/mirror",[], function(require, exports, module) {
1344
+ "use strict";
1345
+
1346
+ var Range = require("../range").Range;
1347
+ var Document = require("../document").Document;
1348
+ var lang = require("../lib/lang");
1349
+
1350
+ var Mirror = exports.Mirror = function(sender) {
1351
+ this.sender = sender;
1352
+ var doc = this.doc = new Document("");
1353
+
1354
+ var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
1355
+
1356
+ var _self = this;
1357
+ sender.on("change", function(e) {
1358
+ var data = e.data;
1359
+ if (data[0].start) {
1360
+ doc.applyDeltas(data);
1361
+ } else {
1362
+ for (var i = 0; i < data.length; i += 2) {
1363
+ if (Array.isArray(data[i+1])) {
1364
+ var d = {action: "insert", start: data[i], lines: data[i+1]};
1365
+ } else {
1366
+ var d = {action: "remove", start: data[i], end: data[i+1]};
1367
+ }
1368
+ doc.applyDelta(d, true);
1369
+ }
1370
+ }
1371
+ if (_self.$timeout)
1372
+ return deferredUpdate.schedule(_self.$timeout);
1373
+ _self.onUpdate();
1374
+ });
1375
+ };
1376
+
1377
+ (function() {
1378
+
1379
+ this.$timeout = 500;
1380
+
1381
+ this.setTimeout = function(timeout) {
1382
+ this.$timeout = timeout;
1383
+ };
1384
+
1385
+ this.setValue = function(value) {
1386
+ this.doc.setValue(value);
1387
+ this.deferredUpdate.schedule(this.$timeout);
1388
+ };
1389
+
1390
+ this.getValue = function(callbackId) {
1391
+ this.sender.callback(this.doc.getValue(), callbackId);
1392
+ };
1393
+
1394
+ this.onUpdate = function() {
1395
+ };
1396
+
1397
+ this.isPending = function() {
1398
+ return this.deferredUpdate.isPending();
1399
+ };
1400
+
1401
+ }).call(Mirror.prototype);
1402
+
1403
+ });
1404
+
1405
+ define("ace/mode/xml/sax",[], function(require, exports, module) {
1406
+ var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
1407
+ var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\u00B7\u0300-\u036F\\ux203F-\u2040]");
1408
+ var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
1409
+ var S_TAG = 0;//tag name offerring
1410
+ var S_ATTR = 1;//attr name offerring
1411
+ var S_ATTR_S=2;//attr name end and space offer
1412
+ var S_EQ = 3;//=space?
1413
+ var S_V = 4;//attr value(no quot value only)
1414
+ var S_E = 5;//attr value end and no space(quot end)
1415
+ var S_S = 6;//(attr value end || tag end ) && (space offer)
1416
+ var S_C = 7;//closed el<el />
1417
+
1418
+ function XMLReader(){
1419
+
1420
+ }
1421
+
1422
+ XMLReader.prototype = {
1423
+ parse:function(source,defaultNSMap,entityMap){
1424
+ var domBuilder = this.domBuilder;
1425
+ domBuilder.startDocument();
1426
+ _copy(defaultNSMap ,defaultNSMap = {})
1427
+ parse(source,defaultNSMap,entityMap,
1428
+ domBuilder,this.errorHandler);
1429
+ domBuilder.endDocument();
1430
+ }
1431
+ }
1432
+ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
1433
+ function fixedFromCharCode(code) {
1434
+ if (code > 0xffff) {
1435
+ code -= 0x10000;
1436
+ var surrogate1 = 0xd800 + (code >> 10)
1437
+ , surrogate2 = 0xdc00 + (code & 0x3ff);
1438
+
1439
+ return String.fromCharCode(surrogate1, surrogate2);
1440
+ } else {
1441
+ return String.fromCharCode(code);
1442
+ }
1443
+ }
1444
+ function entityReplacer(a){
1445
+ var k = a.slice(1,-1);
1446
+ if(k in entityMap){
1447
+ return entityMap[k];
1448
+ }else if(k.charAt(0) === '#'){
1449
+ return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
1450
+ }else{
1451
+ errorHandler.error('entity not found:'+a);
1452
+ return a;
1453
+ }
1454
+ }
1455
+ function appendText(end){//has some bugs
1456
+ var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer);
1457
+ locator&&position(start);
1458
+ domBuilder.characters(xt,0,end-start);
1459
+ start = end
1460
+ }
1461
+ function position(start,m){
1462
+ while(start>=endPos && (m = linePattern.exec(source))){
1463
+ startPos = m.index;
1464
+ endPos = startPos + m[0].length;
1465
+ locator.lineNumber++;
1466
+ }
1467
+ locator.columnNumber = start-startPos+1;
1468
+ }
1469
+ var startPos = 0;
1470
+ var endPos = 0;
1471
+ var linePattern = /.+(?:\r\n?|\n)|.*$/g
1472
+ var locator = domBuilder.locator;
1473
+
1474
+ var parseStack = [{currentNSMap:defaultNSMapCopy}]
1475
+ var closeMap = {};
1476
+ var start = 0;
1477
+ while(true){
1478
+ var i = source.indexOf('<',start);
1479
+ if(i<0){
1480
+ if(!source.substr(start).match(/^\s*$/)){
1481
+ var doc = domBuilder.document;
1482
+ var text = doc.createTextNode(source.substr(start));
1483
+ doc.appendChild(text);
1484
+ domBuilder.currentElement = text;
1485
+ }
1486
+ return;
1487
+ }
1488
+ if(i>start){
1489
+ appendText(i);
1490
+ }
1491
+ switch(source.charAt(i+1)){
1492
+ case '/':
1493
+ var end = source.indexOf('>',i+3);
1494
+ var tagName = source.substring(i+2,end);
1495
+ var config;
1496
+ if (parseStack.length > 1) {
1497
+ config = parseStack.pop();
1498
+ } else {
1499
+ errorHandler.fatalError("end tag name not found for: "+tagName);
1500
+ break;
1501
+ }
1502
+ var localNSMap = config.localNSMap;
1503
+
1504
+ if(config.tagName != tagName){
1505
+ errorHandler.fatalError("end tag name: " + tagName + " does not match the current start tagName: "+config.tagName );
1506
+ }
1507
+ domBuilder.endElement(config.uri,config.localName,tagName);
1508
+ if(localNSMap){
1509
+ for(var prefix in localNSMap){
1510
+ domBuilder.endPrefixMapping(prefix) ;
1511
+ }
1512
+ }
1513
+ end++;
1514
+ break;
1515
+ case '?':// <?...?>
1516
+ locator&&position(i);
1517
+ end = parseInstruction(source,i,domBuilder);
1518
+ break;
1519
+ case '!':// <!doctype,<![CDATA,<!--
1520
+ locator&&position(i);
1521
+ end = parseDCC(source,i,domBuilder,errorHandler);
1522
+ break;
1523
+ default:
1524
+ try{
1525
+ locator&&position(i);
1526
+
1527
+ var el = new ElementAttributes();
1528
+ var end = parseElementStartPart(source,i,el,entityReplacer,errorHandler);
1529
+ var len = el.length;
1530
+ if(len && locator){
1531
+ var backup = copyLocator(locator,{});
1532
+ for(var i = 0;i<len;i++){
1533
+ var a = el[i];
1534
+ position(a.offset);
1535
+ a.offset = copyLocator(locator,{});
1536
+ }
1537
+ copyLocator(backup,locator);
1538
+ }
1539
+ if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
1540
+ el.closed = true;
1541
+ if(!entityMap.nbsp){
1542
+ errorHandler.warning('unclosed xml attribute');
1543
+ }
1544
+ }
1545
+ appendElement(el,domBuilder,parseStack);
1546
+
1547
+
1548
+ if(el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed){
1549
+ end = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)
1550
+ }else{
1551
+ end++;
1552
+ }
1553
+ }catch(e){
1554
+ errorHandler.error('element parse error: '+e);
1555
+ end = -1;
1556
+ }
1557
+
1558
+ }
1559
+ if(end<0){
1560
+ appendText(i+1);
1561
+ }else{
1562
+ start = end;
1563
+ }
1564
+ }
1565
+ }
1566
+ function copyLocator(f,t){
1567
+ t.lineNumber = f.lineNumber;
1568
+ t.columnNumber = f.columnNumber;
1569
+ return t;
1570
+
1571
+ }
1572
+ function parseElementStartPart(source,start,el,entityReplacer,errorHandler){
1573
+ var attrName;
1574
+ var value;
1575
+ var p = ++start;
1576
+ var s = S_TAG;//status
1577
+ while(true){
1578
+ var c = source.charAt(p);
1579
+ switch(c){
1580
+ case '=':
1581
+ if(s === S_ATTR){//attrName
1582
+ attrName = source.slice(start,p);
1583
+ s = S_EQ;
1584
+ }else if(s === S_ATTR_S){
1585
+ s = S_EQ;
1586
+ }else{
1587
+ throw new Error('attribute equal must after attrName');
1588
+ }
1589
+ break;
1590
+ case '\'':
1591
+ case '"':
1592
+ if(s === S_EQ){//equal
1593
+ start = p+1;
1594
+ p = source.indexOf(c,start)
1595
+ if(p>0){
1596
+ value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
1597
+ el.add(attrName,value,start-1);
1598
+ s = S_E;
1599
+ }else{
1600
+ throw new Error('attribute value no end \''+c+'\' match');
1601
+ }
1602
+ }else if(s == S_V){
1603
+ value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
1604
+ el.add(attrName,value,start);
1605
+ errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
1606
+ start = p+1;
1607
+ s = S_E
1608
+ }else{
1609
+ throw new Error('attribute value must after "="');
1610
+ }
1611
+ break;
1612
+ case '/':
1613
+ switch(s){
1614
+ case S_TAG:
1615
+ el.setTagName(source.slice(start,p));
1616
+ case S_E:
1617
+ case S_S:
1618
+ case S_C:
1619
+ s = S_C;
1620
+ el.closed = true;
1621
+ case S_V:
1622
+ case S_ATTR:
1623
+ case S_ATTR_S:
1624
+ break;
1625
+ default:
1626
+ throw new Error("attribute invalid close char('/')")
1627
+ }
1628
+ break;
1629
+ case ''://end document
1630
+ errorHandler.error('unexpected end of input');
1631
+ case '>':
1632
+ switch(s){
1633
+ case S_TAG:
1634
+ el.setTagName(source.slice(start,p));
1635
+ case S_E:
1636
+ case S_S:
1637
+ case S_C:
1638
+ break;//normal
1639
+ case S_V://Compatible state
1640
+ case S_ATTR:
1641
+ value = source.slice(start,p);
1642
+ if(value.slice(-1) === '/'){
1643
+ el.closed = true;
1644
+ value = value.slice(0,-1)
1645
+ }
1646
+ case S_ATTR_S:
1647
+ if(s === S_ATTR_S){
1648
+ value = attrName;
1649
+ }
1650
+ if(s == S_V){
1651
+ errorHandler.warning('attribute "'+value+'" missed quot(")!!');
1652
+ el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start)
1653
+ }else{
1654
+ errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
1655
+ el.add(value,value,start)
1656
+ }
1657
+ break;
1658
+ case S_EQ:
1659
+ throw new Error('attribute value missed!!');
1660
+ }
1661
+ return p;
1662
+ case '\u0080':
1663
+ c = ' ';
1664
+ default:
1665
+ if(c<= ' '){//space
1666
+ switch(s){
1667
+ case S_TAG:
1668
+ el.setTagName(source.slice(start,p));//tagName
1669
+ s = S_S;
1670
+ break;
1671
+ case S_ATTR:
1672
+ attrName = source.slice(start,p)
1673
+ s = S_ATTR_S;
1674
+ break;
1675
+ case S_V:
1676
+ var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
1677
+ errorHandler.warning('attribute "'+value+'" missed quot(")!!');
1678
+ el.add(attrName,value,start)
1679
+ case S_E:
1680
+ s = S_S;
1681
+ break;
1682
+ }
1683
+ }else{//not space
1684
+ switch(s){
1685
+ case S_ATTR_S:
1686
+ errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!')
1687
+ el.add(attrName,attrName,start);
1688
+ start = p;
1689
+ s = S_ATTR;
1690
+ break;
1691
+ case S_E:
1692
+ errorHandler.warning('attribute space is required"'+attrName+'"!!')
1693
+ case S_S:
1694
+ s = S_ATTR;
1695
+ start = p;
1696
+ break;
1697
+ case S_EQ:
1698
+ s = S_V;
1699
+ start = p;
1700
+ break;
1701
+ case S_C:
1702
+ throw new Error("elements closed character '/' and '>' must be connected to");
1703
+ }
1704
+ }
1705
+ }
1706
+ p++;
1707
+ }
1708
+ }
1709
+ function appendElement(el,domBuilder,parseStack){
1710
+ var tagName = el.tagName;
1711
+ var localNSMap = null;
1712
+ var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
1713
+ var i = el.length;
1714
+ while(i--){
1715
+ var a = el[i];
1716
+ var qName = a.qName;
1717
+ var value = a.value;
1718
+ var nsp = qName.indexOf(':');
1719
+ if(nsp>0){
1720
+ var prefix = a.prefix = qName.slice(0,nsp);
1721
+ var localName = qName.slice(nsp+1);
1722
+ var nsPrefix = prefix === 'xmlns' && localName
1723
+ }else{
1724
+ localName = qName;
1725
+ prefix = null
1726
+ nsPrefix = qName === 'xmlns' && ''
1727
+ }
1728
+ a.localName = localName ;
1729
+ if(nsPrefix !== false){//hack!!
1730
+ if(localNSMap == null){
1731
+ localNSMap = {}
1732
+ _copy(currentNSMap,currentNSMap={})
1733
+ }
1734
+ currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
1735
+ a.uri = 'http://www.w3.org/2000/xmlns/'
1736
+ domBuilder.startPrefixMapping(nsPrefix, value)
1737
+ }
1738
+ }
1739
+ var i = el.length;
1740
+ while(i--){
1741
+ a = el[i];
1742
+ var prefix = a.prefix;
1743
+ if(prefix){//no prefix attribute has no namespace
1744
+ if(prefix === 'xml'){
1745
+ a.uri = 'http://www.w3.org/XML/1998/namespace';
1746
+ }if(prefix !== 'xmlns'){
1747
+ a.uri = currentNSMap[prefix]
1748
+ }
1749
+ }
1750
+ }
1751
+ var nsp = tagName.indexOf(':');
1752
+ if(nsp>0){
1753
+ prefix = el.prefix = tagName.slice(0,nsp);
1754
+ localName = el.localName = tagName.slice(nsp+1);
1755
+ }else{
1756
+ prefix = null;//important!!
1757
+ localName = el.localName = tagName;
1758
+ }
1759
+ var ns = el.uri = currentNSMap[prefix || ''];
1760
+ domBuilder.startElement(ns,localName,tagName,el);
1761
+ if(el.closed){
1762
+ domBuilder.endElement(ns,localName,tagName);
1763
+ if(localNSMap){
1764
+ for(prefix in localNSMap){
1765
+ domBuilder.endPrefixMapping(prefix)
1766
+ }
1767
+ }
1768
+ }else{
1769
+ el.currentNSMap = currentNSMap;
1770
+ el.localNSMap = localNSMap;
1771
+ parseStack.push(el);
1772
+ }
1773
+ }
1774
+ function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
1775
+ if(/^(?:script|textarea)$/i.test(tagName)){
1776
+ var elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);
1777
+ var text = source.substring(elStartEnd+1,elEndStart);
1778
+ if(/[&<]/.test(text)){
1779
+ if(/^script$/i.test(tagName)){
1780
+ domBuilder.characters(text,0,text.length);
1781
+ return elEndStart;
1782
+ }//}else{//text area
1783
+ text = text.replace(/&#?\w+;/g,entityReplacer);
1784
+ domBuilder.characters(text,0,text.length);
1785
+ return elEndStart;
1786
+
1787
+ }
1788
+ }
1789
+ return elStartEnd+1;
1790
+ }
1791
+ function fixSelfClosed(source,elStartEnd,tagName,closeMap){
1792
+ var pos = closeMap[tagName];
1793
+ if(pos == null){
1794
+ pos = closeMap[tagName] = source.lastIndexOf('</'+tagName+'>')
1795
+ }
1796
+ return pos<elStartEnd;
1797
+ }
1798
+ function _copy(source,target){
1799
+ for(var n in source){target[n] = source[n]}
1800
+ }
1801
+ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
1802
+ var next= source.charAt(start+2)
1803
+ switch(next){
1804
+ case '-':
1805
+ if(source.charAt(start + 3) === '-'){
1806
+ var end = source.indexOf('-->',start+4);
1807
+ if(end>start){
1808
+ domBuilder.comment(source,start+4,end-start-4);
1809
+ return end+3;
1810
+ }else{
1811
+ errorHandler.error("Unclosed comment");
1812
+ return -1;
1813
+ }
1814
+ }else{
1815
+ return -1;
1816
+ }
1817
+ default:
1818
+ if(source.substr(start+3,6) == 'CDATA['){
1819
+ var end = source.indexOf(']]>',start+9);
1820
+ domBuilder.startCDATA();
1821
+ domBuilder.characters(source,start+9,end-start-9);
1822
+ domBuilder.endCDATA()
1823
+ return end+3;
1824
+ }
1825
+ var matchs = split(source,start);
1826
+ var len = matchs.length;
1827
+ if(len>1 && /!doctype/i.test(matchs[0][0])){
1828
+ var name = matchs[1][0];
1829
+ var pubid = len>3 && /^public$/i.test(matchs[2][0]) && matchs[3][0]
1830
+ var sysid = len>4 && matchs[4][0];
1831
+ var lastMatch = matchs[len-1]
1832
+ domBuilder.startDTD(name,pubid && pubid.replace(/^(['"])(.*?)\1$/,'$2'),
1833
+ sysid && sysid.replace(/^(['"])(.*?)\1$/,'$2'));
1834
+ domBuilder.endDTD();
1835
+
1836
+ return lastMatch.index+lastMatch[0].length
1837
+ }
1838
+ }
1839
+ return -1;
1840
+ }
1841
+
1842
+
1843
+
1844
+ function parseInstruction(source,start,domBuilder){
1845
+ var end = source.indexOf('?>',start);
1846
+ if(end){
1847
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
1848
+ if(match){
1849
+ var len = match[0].length;
1850
+ domBuilder.processingInstruction(match[1], match[2]) ;
1851
+ return end+2;
1852
+ }else{//error
1853
+ return -1;
1854
+ }
1855
+ }
1856
+ return -1;
1857
+ }
1858
+ function ElementAttributes(source){
1859
+
1860
+ }
1861
+ ElementAttributes.prototype = {
1862
+ setTagName:function(tagName){
1863
+ if(!tagNamePattern.test(tagName)){
1864
+ throw new Error('invalid tagName:'+tagName)
1865
+ }
1866
+ this.tagName = tagName
1867
+ },
1868
+ add:function(qName,value,offset){
1869
+ if(!tagNamePattern.test(qName)){
1870
+ throw new Error('invalid attribute:'+qName)
1871
+ }
1872
+ this[this.length++] = {qName:qName,value:value,offset:offset}
1873
+ },
1874
+ length:0,
1875
+ getLocalName:function(i){return this[i].localName},
1876
+ getOffset:function(i){return this[i].offset},
1877
+ getQName:function(i){return this[i].qName},
1878
+ getURI:function(i){return this[i].uri},
1879
+ getValue:function(i){return this[i].value}
1880
+ }
1881
+
1882
+
1883
+
1884
+
1885
+ function _set_proto_(thiz,parent){
1886
+ thiz.__proto__ = parent;
1887
+ return thiz;
1888
+ }
1889
+ if(!(_set_proto_({},_set_proto_.prototype) instanceof _set_proto_)){
1890
+ _set_proto_ = function(thiz,parent){
1891
+ function p(){};
1892
+ p.prototype = parent;
1893
+ p = new p();
1894
+ for(parent in thiz){
1895
+ p[parent] = thiz[parent];
1896
+ }
1897
+ return p;
1898
+ }
1899
+ }
1900
+
1901
+ function split(source,start){
1902
+ var match;
1903
+ var buf = [];
1904
+ var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
1905
+ reg.lastIndex = start;
1906
+ reg.exec(source);//skip <
1907
+ while(match = reg.exec(source)){
1908
+ buf.push(match);
1909
+ if(match[1])return buf;
1910
+ }
1911
+ }
1912
+
1913
+ return XMLReader;
1914
+ });
1915
+
1916
+ define("ace/mode/xml/dom",[], function(require, exports, module) {
1917
+
1918
+ function copy(src,dest){
1919
+ for(var p in src){
1920
+ dest[p] = src[p];
1921
+ }
1922
+ }
1923
+ function _extends(Class,Super){
1924
+ var t = function(){};
1925
+ var pt = Class.prototype;
1926
+ if(Object.create){
1927
+ var ppt = Object.create(Super.prototype);
1928
+ pt.__proto__ = ppt;
1929
+ }
1930
+ if(!(pt instanceof Super)){
1931
+ t.prototype = Super.prototype;
1932
+ t = new t();
1933
+ copy(pt,t);
1934
+ Class.prototype = pt = t;
1935
+ }
1936
+ if(pt.constructor != Class){
1937
+ if(typeof Class != 'function'){
1938
+ console.error("unknown Class:"+Class);
1939
+ }
1940
+ pt.constructor = Class;
1941
+ }
1942
+ }
1943
+ var htmlns = 'http://www.w3.org/1999/xhtml' ;
1944
+ var NodeType = {};
1945
+ var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
1946
+ var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
1947
+ var TEXT_NODE = NodeType.TEXT_NODE = 3;
1948
+ var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
1949
+ var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
1950
+ var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
1951
+ var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
1952
+ var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
1953
+ var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
1954
+ var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
1955
+ var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
1956
+ var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
1957
+ var ExceptionCode = {};
1958
+ var ExceptionMessage = {};
1959
+ var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
1960
+ var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
1961
+ var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
1962
+ var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
1963
+ var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
1964
+ var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
1965
+ var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
1966
+ var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
1967
+ var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
1968
+ var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
1969
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
1970
+ var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
1971
+ var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
1972
+ var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
1973
+ var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
1974
+
1975
+
1976
+ function DOMException(code, message) {
1977
+ if(message instanceof Error){
1978
+ var error = message;
1979
+ }else{
1980
+ error = this;
1981
+ Error.call(this, ExceptionMessage[code]);
1982
+ this.message = ExceptionMessage[code];
1983
+ if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
1984
+ }
1985
+ error.code = code;
1986
+ if(message) this.message = this.message + ": " + message;
1987
+ return error;
1988
+ };
1989
+ DOMException.prototype = Error.prototype;
1990
+ copy(ExceptionCode,DOMException)
1991
+ function NodeList() {
1992
+ };
1993
+ NodeList.prototype = {
1994
+ length:0,
1995
+ item: function(index) {
1996
+ return this[index] || null;
1997
+ }
1998
+ };
1999
+ function LiveNodeList(node,refresh){
2000
+ this._node = node;
2001
+ this._refresh = refresh;
2002
+ _updateLiveList(this);
2003
+ }
2004
+ function _updateLiveList(list){
2005
+ var inc = list._node._inc || list._node.ownerDocument._inc;
2006
+ if(list._inc != inc){
2007
+ var ls = list._refresh(list._node);
2008
+ __set__(list,'length',ls.length);
2009
+ copy(ls,list);
2010
+ list._inc = inc;
2011
+ }
2012
+ }
2013
+ LiveNodeList.prototype.item = function(i){
2014
+ _updateLiveList(this);
2015
+ return this[i];
2016
+ }
2017
+
2018
+ _extends(LiveNodeList,NodeList);
2019
+ function NamedNodeMap() {
2020
+ };
2021
+
2022
+ function _findNodeIndex(list,node){
2023
+ var i = list.length;
2024
+ while(i--){
2025
+ if(list[i] === node){return i}
2026
+ }
2027
+ }
2028
+
2029
+ function _addNamedNode(el,list,newAttr,oldAttr){
2030
+ if(oldAttr){
2031
+ list[_findNodeIndex(list,oldAttr)] = newAttr;
2032
+ }else{
2033
+ list[list.length++] = newAttr;
2034
+ }
2035
+ if(el){
2036
+ newAttr.ownerElement = el;
2037
+ var doc = el.ownerDocument;
2038
+ if(doc){
2039
+ oldAttr && _onRemoveAttribute(doc,el,oldAttr);
2040
+ _onAddAttribute(doc,el,newAttr);
2041
+ }
2042
+ }
2043
+ }
2044
+ function _removeNamedNode(el,list,attr){
2045
+ var i = _findNodeIndex(list,attr);
2046
+ if(i>=0){
2047
+ var lastIndex = list.length-1;
2048
+ while(i<lastIndex){
2049
+ list[i] = list[++i];
2050
+ }
2051
+ list.length = lastIndex;
2052
+ if(el){
2053
+ var doc = el.ownerDocument;
2054
+ if(doc){
2055
+ _onRemoveAttribute(doc,el,attr);
2056
+ attr.ownerElement = null;
2057
+ }
2058
+ }
2059
+ }else{
2060
+ throw new DOMException(NOT_FOUND_ERR,new Error());
2061
+ }
2062
+ }
2063
+ NamedNodeMap.prototype = {
2064
+ length:0,
2065
+ item:NodeList.prototype.item,
2066
+ getNamedItem: function(key) {
2067
+ var i = this.length;
2068
+ while(i--){
2069
+ var attr = this[i];
2070
+ if(attr.nodeName == key){
2071
+ return attr;
2072
+ }
2073
+ }
2074
+ },
2075
+ setNamedItem: function(attr) {
2076
+ var el = attr.ownerElement;
2077
+ if(el && el!=this._ownerElement){
2078
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
2079
+ }
2080
+ var oldAttr = this.getNamedItem(attr.nodeName);
2081
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
2082
+ return oldAttr;
2083
+ },
2084
+ setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
2085
+ var el = attr.ownerElement, oldAttr;
2086
+ if(el && el!=this._ownerElement){
2087
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
2088
+ }
2089
+ oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
2090
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
2091
+ return oldAttr;
2092
+ },
2093
+ removeNamedItem: function(key) {
2094
+ var attr = this.getNamedItem(key);
2095
+ _removeNamedNode(this._ownerElement,this,attr);
2096
+ return attr;
2097
+
2098
+
2099
+ },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
2100
+ removeNamedItemNS:function(namespaceURI,localName){
2101
+ var attr = this.getNamedItemNS(namespaceURI,localName);
2102
+ _removeNamedNode(this._ownerElement,this,attr);
2103
+ return attr;
2104
+ },
2105
+ getNamedItemNS: function(namespaceURI, localName) {
2106
+ var i = this.length;
2107
+ while(i--){
2108
+ var node = this[i];
2109
+ if(node.localName == localName && node.namespaceURI == namespaceURI){
2110
+ return node;
2111
+ }
2112
+ }
2113
+ return null;
2114
+ }
2115
+ };
2116
+ function DOMImplementation(/* Object */ features) {
2117
+ this._features = {};
2118
+ if (features) {
2119
+ for (var feature in features) {
2120
+ this._features = features[feature];
2121
+ }
2122
+ }
2123
+ };
2124
+
2125
+ DOMImplementation.prototype = {
2126
+ hasFeature: function(/* string */ feature, /* string */ version) {
2127
+ var versions = this._features[feature.toLowerCase()];
2128
+ if (versions && (!version || version in versions)) {
2129
+ return true;
2130
+ } else {
2131
+ return false;
2132
+ }
2133
+ },
2134
+ createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR
2135
+ var doc = new Document();
2136
+ doc.implementation = this;
2137
+ doc.childNodes = new NodeList();
2138
+ doc.doctype = doctype;
2139
+ if(doctype){
2140
+ doc.appendChild(doctype);
2141
+ }
2142
+ if(qualifiedName){
2143
+ var root = doc.createElementNS(namespaceURI,qualifiedName);
2144
+ doc.appendChild(root);
2145
+ }
2146
+ return doc;
2147
+ },
2148
+ createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR
2149
+ var node = new DocumentType();
2150
+ node.name = qualifiedName;
2151
+ node.nodeName = qualifiedName;
2152
+ node.publicId = publicId;
2153
+ node.systemId = systemId;
2154
+ return node;
2155
+ }
2156
+ };
2157
+
2158
+ function Node() {
2159
+ };
2160
+
2161
+ Node.prototype = {
2162
+ firstChild : null,
2163
+ lastChild : null,
2164
+ previousSibling : null,
2165
+ nextSibling : null,
2166
+ attributes : null,
2167
+ parentNode : null,
2168
+ childNodes : null,
2169
+ ownerDocument : null,
2170
+ nodeValue : null,
2171
+ namespaceURI : null,
2172
+ prefix : null,
2173
+ localName : null,
2174
+ insertBefore:function(newChild, refChild){//raises
2175
+ return _insertBefore(this,newChild,refChild);
2176
+ },
2177
+ replaceChild:function(newChild, oldChild){//raises
2178
+ this.insertBefore(newChild,oldChild);
2179
+ if(oldChild){
2180
+ this.removeChild(oldChild);
2181
+ }
2182
+ },
2183
+ removeChild:function(oldChild){
2184
+ return _removeChild(this,oldChild);
2185
+ },
2186
+ appendChild:function(newChild){
2187
+ return this.insertBefore(newChild,null);
2188
+ },
2189
+ hasChildNodes:function(){
2190
+ return this.firstChild != null;
2191
+ },
2192
+ cloneNode:function(deep){
2193
+ return cloneNode(this.ownerDocument||this,this,deep);
2194
+ },
2195
+ normalize:function(){
2196
+ var child = this.firstChild;
2197
+ while(child){
2198
+ var next = child.nextSibling;
2199
+ if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
2200
+ this.removeChild(next);
2201
+ child.appendData(next.data);
2202
+ }else{
2203
+ child.normalize();
2204
+ child = next;
2205
+ }
2206
+ }
2207
+ },
2208
+ isSupported:function(feature, version){
2209
+ return this.ownerDocument.implementation.hasFeature(feature,version);
2210
+ },
2211
+ hasAttributes:function(){
2212
+ return this.attributes.length>0;
2213
+ },
2214
+ lookupPrefix:function(namespaceURI){
2215
+ var el = this;
2216
+ while(el){
2217
+ var map = el._nsMap;
2218
+ if(map){
2219
+ for(var n in map){
2220
+ if(map[n] == namespaceURI){
2221
+ return n;
2222
+ }
2223
+ }
2224
+ }
2225
+ el = el.nodeType == 2?el.ownerDocument : el.parentNode;
2226
+ }
2227
+ return null;
2228
+ },
2229
+ lookupNamespaceURI:function(prefix){
2230
+ var el = this;
2231
+ while(el){
2232
+ var map = el._nsMap;
2233
+ if(map){
2234
+ if(prefix in map){
2235
+ return map[prefix] ;
2236
+ }
2237
+ }
2238
+ el = el.nodeType == 2?el.ownerDocument : el.parentNode;
2239
+ }
2240
+ return null;
2241
+ },
2242
+ isDefaultNamespace:function(namespaceURI){
2243
+ var prefix = this.lookupPrefix(namespaceURI);
2244
+ return prefix == null;
2245
+ }
2246
+ };
2247
+
2248
+
2249
+ function _xmlEncoder(c){
2250
+ return c == '<' && '&lt;' ||
2251
+ c == '>' && '&gt;' ||
2252
+ c == '&' && '&amp;' ||
2253
+ c == '"' && '&quot;' ||
2254
+ '&#'+c.charCodeAt()+';';
2255
+ }
2256
+
2257
+
2258
+ copy(NodeType,Node);
2259
+ copy(NodeType,Node.prototype);
2260
+ function _visitNode(node,callback){
2261
+ if(callback(node)){
2262
+ return true;
2263
+ }
2264
+ if(node = node.firstChild){
2265
+ do{
2266
+ if(_visitNode(node,callback)){return true}
2267
+ }while(node=node.nextSibling)
2268
+ }
2269
+ }
2270
+
2271
+
2272
+
2273
+ function Document(){
2274
+ }
2275
+ function _onAddAttribute(doc,el,newAttr){
2276
+ doc && doc._inc++;
2277
+ var ns = newAttr.namespaceURI ;
2278
+ if(ns == 'http://www.w3.org/2000/xmlns/'){
2279
+ el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
2280
+ }
2281
+ }
2282
+ function _onRemoveAttribute(doc,el,newAttr,remove){
2283
+ doc && doc._inc++;
2284
+ var ns = newAttr.namespaceURI ;
2285
+ if(ns == 'http://www.w3.org/2000/xmlns/'){
2286
+ delete el._nsMap[newAttr.prefix?newAttr.localName:''];
2287
+ }
2288
+ }
2289
+ function _onUpdateChild(doc,el,newChild){
2290
+ if(doc && doc._inc){
2291
+ doc._inc++;
2292
+ var cs = el.childNodes;
2293
+ if(newChild){
2294
+ cs[cs.length++] = newChild;
2295
+ }else{
2296
+ var child = el.firstChild;
2297
+ var i = 0;
2298
+ while(child){
2299
+ cs[i++] = child;
2300
+ child =child.nextSibling;
2301
+ }
2302
+ cs.length = i;
2303
+ }
2304
+ }
2305
+ }
2306
+ function _removeChild(parentNode,child){
2307
+ var previous = child.previousSibling;
2308
+ var next = child.nextSibling;
2309
+ if(previous){
2310
+ previous.nextSibling = next;
2311
+ }else{
2312
+ parentNode.firstChild = next
2313
+ }
2314
+ if(next){
2315
+ next.previousSibling = previous;
2316
+ }else{
2317
+ parentNode.lastChild = previous;
2318
+ }
2319
+ _onUpdateChild(parentNode.ownerDocument,parentNode);
2320
+ return child;
2321
+ }
2322
+ function _insertBefore(parentNode,newChild,nextChild){
2323
+ var cp = newChild.parentNode;
2324
+ if(cp){
2325
+ cp.removeChild(newChild);//remove and update
2326
+ }
2327
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
2328
+ var newFirst = newChild.firstChild;
2329
+ if (newFirst == null) {
2330
+ return newChild;
2331
+ }
2332
+ var newLast = newChild.lastChild;
2333
+ }else{
2334
+ newFirst = newLast = newChild;
2335
+ }
2336
+ var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;
2337
+
2338
+ newFirst.previousSibling = pre;
2339
+ newLast.nextSibling = nextChild;
2340
+
2341
+
2342
+ if(pre){
2343
+ pre.nextSibling = newFirst;
2344
+ }else{
2345
+ parentNode.firstChild = newFirst;
2346
+ }
2347
+ if(nextChild == null){
2348
+ parentNode.lastChild = newLast;
2349
+ }else{
2350
+ nextChild.previousSibling = newLast;
2351
+ }
2352
+ do{
2353
+ newFirst.parentNode = parentNode;
2354
+ }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
2355
+ _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);
2356
+ if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
2357
+ newChild.firstChild = newChild.lastChild = null;
2358
+ }
2359
+ return newChild;
2360
+ }
2361
+ function _appendSingleChild(parentNode,newChild){
2362
+ var cp = newChild.parentNode;
2363
+ if(cp){
2364
+ var pre = parentNode.lastChild;
2365
+ cp.removeChild(newChild);//remove and update
2366
+ var pre = parentNode.lastChild;
2367
+ }
2368
+ var pre = parentNode.lastChild;
2369
+ newChild.parentNode = parentNode;
2370
+ newChild.previousSibling = pre;
2371
+ newChild.nextSibling = null;
2372
+ if(pre){
2373
+ pre.nextSibling = newChild;
2374
+ }else{
2375
+ parentNode.firstChild = newChild;
2376
+ }
2377
+ parentNode.lastChild = newChild;
2378
+ _onUpdateChild(parentNode.ownerDocument,parentNode,newChild);
2379
+ return newChild;
2380
+ }
2381
+ Document.prototype = {
2382
+ nodeName : '#document',
2383
+ nodeType : DOCUMENT_NODE,
2384
+ doctype : null,
2385
+ documentElement : null,
2386
+ _inc : 1,
2387
+
2388
+ insertBefore : function(newChild, refChild){//raises
2389
+ if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
2390
+ var child = newChild.firstChild;
2391
+ while(child){
2392
+ var next = child.nextSibling;
2393
+ this.insertBefore(child,refChild);
2394
+ child = next;
2395
+ }
2396
+ return newChild;
2397
+ }
2398
+ if(this.documentElement == null && newChild.nodeType == 1){
2399
+ this.documentElement = newChild;
2400
+ }
2401
+
2402
+ return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;
2403
+ },
2404
+ removeChild : function(oldChild){
2405
+ if(this.documentElement == oldChild){
2406
+ this.documentElement = null;
2407
+ }
2408
+ return _removeChild(this,oldChild);
2409
+ },
2410
+ importNode : function(importedNode,deep){
2411
+ return importNode(this,importedNode,deep);
2412
+ },
2413
+ getElementById : function(id){
2414
+ var rtv = null;
2415
+ _visitNode(this.documentElement,function(node){
2416
+ if(node.nodeType == 1){
2417
+ if(node.getAttribute('id') == id){
2418
+ rtv = node;
2419
+ return true;
2420
+ }
2421
+ }
2422
+ });
2423
+ return rtv;
2424
+ },
2425
+ createElement : function(tagName){
2426
+ var node = new Element();
2427
+ node.ownerDocument = this;
2428
+ node.nodeName = tagName;
2429
+ node.tagName = tagName;
2430
+ node.childNodes = new NodeList();
2431
+ var attrs = node.attributes = new NamedNodeMap();
2432
+ attrs._ownerElement = node;
2433
+ return node;
2434
+ },
2435
+ createDocumentFragment : function(){
2436
+ var node = new DocumentFragment();
2437
+ node.ownerDocument = this;
2438
+ node.childNodes = new NodeList();
2439
+ return node;
2440
+ },
2441
+ createTextNode : function(data){
2442
+ var node = new Text();
2443
+ node.ownerDocument = this;
2444
+ node.appendData(data);
2445
+ return node;
2446
+ },
2447
+ createComment : function(data){
2448
+ var node = new Comment();
2449
+ node.ownerDocument = this;
2450
+ node.appendData(data);
2451
+ return node;
2452
+ },
2453
+ createCDATASection : function(data){
2454
+ var node = new CDATASection();
2455
+ node.ownerDocument = this;
2456
+ node.appendData(data);
2457
+ return node;
2458
+ },
2459
+ createProcessingInstruction : function(target,data){
2460
+ var node = new ProcessingInstruction();
2461
+ node.ownerDocument = this;
2462
+ node.tagName = node.target = target;
2463
+ node.nodeValue= node.data = data;
2464
+ return node;
2465
+ },
2466
+ createAttribute : function(name){
2467
+ var node = new Attr();
2468
+ node.ownerDocument = this;
2469
+ node.name = name;
2470
+ node.nodeName = name;
2471
+ node.localName = name;
2472
+ node.specified = true;
2473
+ return node;
2474
+ },
2475
+ createEntityReference : function(name){
2476
+ var node = new EntityReference();
2477
+ node.ownerDocument = this;
2478
+ node.nodeName = name;
2479
+ return node;
2480
+ },
2481
+ createElementNS : function(namespaceURI,qualifiedName){
2482
+ var node = new Element();
2483
+ var pl = qualifiedName.split(':');
2484
+ var attrs = node.attributes = new NamedNodeMap();
2485
+ node.childNodes = new NodeList();
2486
+ node.ownerDocument = this;
2487
+ node.nodeName = qualifiedName;
2488
+ node.tagName = qualifiedName;
2489
+ node.namespaceURI = namespaceURI;
2490
+ if(pl.length == 2){
2491
+ node.prefix = pl[0];
2492
+ node.localName = pl[1];
2493
+ }else{
2494
+ node.localName = qualifiedName;
2495
+ }
2496
+ attrs._ownerElement = node;
2497
+ return node;
2498
+ },
2499
+ createAttributeNS : function(namespaceURI,qualifiedName){
2500
+ var node = new Attr();
2501
+ var pl = qualifiedName.split(':');
2502
+ node.ownerDocument = this;
2503
+ node.nodeName = qualifiedName;
2504
+ node.name = qualifiedName;
2505
+ node.namespaceURI = namespaceURI;
2506
+ node.specified = true;
2507
+ if(pl.length == 2){
2508
+ node.prefix = pl[0];
2509
+ node.localName = pl[1];
2510
+ }else{
2511
+ node.localName = qualifiedName;
2512
+ }
2513
+ return node;
2514
+ }
2515
+ };
2516
+ _extends(Document,Node);
2517
+
2518
+
2519
+ function Element() {
2520
+ this._nsMap = {};
2521
+ };
2522
+ Element.prototype = {
2523
+ nodeType : ELEMENT_NODE,
2524
+ hasAttribute : function(name){
2525
+ return this.getAttributeNode(name)!=null;
2526
+ },
2527
+ getAttribute : function(name){
2528
+ var attr = this.getAttributeNode(name);
2529
+ return attr && attr.value || '';
2530
+ },
2531
+ getAttributeNode : function(name){
2532
+ return this.attributes.getNamedItem(name);
2533
+ },
2534
+ setAttribute : function(name, value){
2535
+ var attr = this.ownerDocument.createAttribute(name);
2536
+ attr.value = attr.nodeValue = "" + value;
2537
+ this.setAttributeNode(attr);
2538
+ },
2539
+ removeAttribute : function(name){
2540
+ var attr = this.getAttributeNode(name);
2541
+ attr && this.removeAttributeNode(attr);
2542
+ },
2543
+ appendChild:function(newChild){
2544
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
2545
+ return this.insertBefore(newChild,null);
2546
+ }else{
2547
+ return _appendSingleChild(this,newChild);
2548
+ }
2549
+ },
2550
+ setAttributeNode : function(newAttr){
2551
+ return this.attributes.setNamedItem(newAttr);
2552
+ },
2553
+ setAttributeNodeNS : function(newAttr){
2554
+ return this.attributes.setNamedItemNS(newAttr);
2555
+ },
2556
+ removeAttributeNode : function(oldAttr){
2557
+ return this.attributes.removeNamedItem(oldAttr.nodeName);
2558
+ },
2559
+ removeAttributeNS : function(namespaceURI, localName){
2560
+ var old = this.getAttributeNodeNS(namespaceURI, localName);
2561
+ old && this.removeAttributeNode(old);
2562
+ },
2563
+
2564
+ hasAttributeNS : function(namespaceURI, localName){
2565
+ return this.getAttributeNodeNS(namespaceURI, localName)!=null;
2566
+ },
2567
+ getAttributeNS : function(namespaceURI, localName){
2568
+ var attr = this.getAttributeNodeNS(namespaceURI, localName);
2569
+ return attr && attr.value || '';
2570
+ },
2571
+ setAttributeNS : function(namespaceURI, qualifiedName, value){
2572
+ var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
2573
+ attr.value = attr.nodeValue = "" + value;
2574
+ this.setAttributeNode(attr);
2575
+ },
2576
+ getAttributeNodeNS : function(namespaceURI, localName){
2577
+ return this.attributes.getNamedItemNS(namespaceURI, localName);
2578
+ },
2579
+
2580
+ getElementsByTagName : function(tagName){
2581
+ return new LiveNodeList(this,function(base){
2582
+ var ls = [];
2583
+ _visitNode(base,function(node){
2584
+ if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
2585
+ ls.push(node);
2586
+ }
2587
+ });
2588
+ return ls;
2589
+ });
2590
+ },
2591
+ getElementsByTagNameNS : function(namespaceURI, localName){
2592
+ return new LiveNodeList(this,function(base){
2593
+ var ls = [];
2594
+ _visitNode(base,function(node){
2595
+ if(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){
2596
+ ls.push(node);
2597
+ }
2598
+ });
2599
+ return ls;
2600
+ });
2601
+ }
2602
+ };
2603
+ Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
2604
+ Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
2605
+
2606
+
2607
+ _extends(Element,Node);
2608
+ function Attr() {
2609
+ };
2610
+ Attr.prototype.nodeType = ATTRIBUTE_NODE;
2611
+ _extends(Attr,Node);
2612
+
2613
+
2614
+ function CharacterData() {
2615
+ };
2616
+ CharacterData.prototype = {
2617
+ data : '',
2618
+ substringData : function(offset, count) {
2619
+ return this.data.substring(offset, offset+count);
2620
+ },
2621
+ appendData: function(text) {
2622
+ text = this.data+text;
2623
+ this.nodeValue = this.data = text;
2624
+ this.length = text.length;
2625
+ },
2626
+ insertData: function(offset,text) {
2627
+ this.replaceData(offset,0,text);
2628
+ },
2629
+ appendChild:function(newChild){
2630
+ throw new Error(ExceptionMessage[3]);
2631
+ return Node.prototype.appendChild.apply(this,arguments);
2632
+ },
2633
+ deleteData: function(offset, count) {
2634
+ this.replaceData(offset,count,"");
2635
+ },
2636
+ replaceData: function(offset, count, text) {
2637
+ var start = this.data.substring(0,offset);
2638
+ var end = this.data.substring(offset+count);
2639
+ text = start + text + end;
2640
+ this.nodeValue = this.data = text;
2641
+ this.length = text.length;
2642
+ }
2643
+ }
2644
+ _extends(CharacterData,Node);
2645
+ function Text() {
2646
+ };
2647
+ Text.prototype = {
2648
+ nodeName : "#text",
2649
+ nodeType : TEXT_NODE,
2650
+ splitText : function(offset) {
2651
+ var text = this.data;
2652
+ var newText = text.substring(offset);
2653
+ text = text.substring(0, offset);
2654
+ this.data = this.nodeValue = text;
2655
+ this.length = text.length;
2656
+ var newNode = this.ownerDocument.createTextNode(newText);
2657
+ if(this.parentNode){
2658
+ this.parentNode.insertBefore(newNode, this.nextSibling);
2659
+ }
2660
+ return newNode;
2661
+ }
2662
+ }
2663
+ _extends(Text,CharacterData);
2664
+ function Comment() {
2665
+ };
2666
+ Comment.prototype = {
2667
+ nodeName : "#comment",
2668
+ nodeType : COMMENT_NODE
2669
+ }
2670
+ _extends(Comment,CharacterData);
2671
+
2672
+ function CDATASection() {
2673
+ };
2674
+ CDATASection.prototype = {
2675
+ nodeName : "#cdata-section",
2676
+ nodeType : CDATA_SECTION_NODE
2677
+ }
2678
+ _extends(CDATASection,CharacterData);
2679
+
2680
+
2681
+ function DocumentType() {
2682
+ }
2683
+ DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
2684
+ _extends(DocumentType,Node);
2685
+
2686
+ function Notation() {
2687
+ }
2688
+ Notation.prototype.nodeType = NOTATION_NODE;
2689
+ _extends(Notation,Node);
2690
+
2691
+ function Entity() {
2692
+ }
2693
+ Entity.prototype.nodeType = ENTITY_NODE;
2694
+ _extends(Entity,Node);
2695
+
2696
+ function EntityReference() {
2697
+ }
2698
+ EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
2699
+ _extends(EntityReference,Node);
2700
+
2701
+ function DocumentFragment() {
2702
+ }
2703
+ DocumentFragment.prototype.nodeName = "#document-fragment";
2704
+ DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
2705
+ _extends(DocumentFragment,Node);
2706
+
2707
+
2708
+ function ProcessingInstruction() {
2709
+ }
2710
+ ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
2711
+ _extends(ProcessingInstruction,Node);
2712
+ function XMLSerializer(){}
2713
+ XMLSerializer.prototype.serializeToString = function(node){
2714
+ var buf = [];
2715
+ serializeToString(node,buf);
2716
+ return buf.join('');
2717
+ }
2718
+ Node.prototype.toString =function(){
2719
+ return XMLSerializer.prototype.serializeToString(this);
2720
+ }
2721
+ function serializeToString(node,buf){
2722
+ switch(node.nodeType){
2723
+ case ELEMENT_NODE:
2724
+ var attrs = node.attributes;
2725
+ var len = attrs.length;
2726
+ var child = node.firstChild;
2727
+ var nodeName = node.tagName;
2728
+ var isHTML = htmlns === node.namespaceURI;
2729
+ buf.push('<',nodeName);
2730
+ for(var i=0;i<len;i++){
2731
+ serializeToString(attrs.item(i),buf);
2732
+ }
2733
+ if(child || isHTML && !/^(?:meta|link|img|br|hr|input|button)$/i.test(nodeName)){
2734
+ buf.push('>');
2735
+ if(isHTML && /^script$/i.test(nodeName)){
2736
+ if(child){
2737
+ buf.push(child.data);
2738
+ }
2739
+ }else{
2740
+ while(child){
2741
+ serializeToString(child,buf);
2742
+ child = child.nextSibling;
2743
+ }
2744
+ }
2745
+ buf.push('</',nodeName,'>');
2746
+ }else{
2747
+ buf.push('/>');
2748
+ }
2749
+ return;
2750
+ case DOCUMENT_NODE:
2751
+ case DOCUMENT_FRAGMENT_NODE:
2752
+ var child = node.firstChild;
2753
+ while(child){
2754
+ serializeToString(child,buf);
2755
+ child = child.nextSibling;
2756
+ }
2757
+ return;
2758
+ case ATTRIBUTE_NODE:
2759
+ return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"');
2760
+ case TEXT_NODE:
2761
+ return buf.push(node.data.replace(/[<&]/g,_xmlEncoder));
2762
+ case CDATA_SECTION_NODE:
2763
+ return buf.push( '<![CDATA[',node.data,']]>');
2764
+ case COMMENT_NODE:
2765
+ return buf.push( "<!--",node.data,"-->");
2766
+ case DOCUMENT_TYPE_NODE:
2767
+ var pubid = node.publicId;
2768
+ var sysid = node.systemId;
2769
+ buf.push('<!DOCTYPE ',node.name);
2770
+ if(pubid){
2771
+ buf.push(' PUBLIC "',pubid);
2772
+ if (sysid && sysid!='.') {
2773
+ buf.push( '" "',sysid);
2774
+ }
2775
+ buf.push('">');
2776
+ }else if(sysid && sysid!='.'){
2777
+ buf.push(' SYSTEM "',sysid,'">');
2778
+ }else{
2779
+ var sub = node.internalSubset;
2780
+ if(sub){
2781
+ buf.push(" [",sub,"]");
2782
+ }
2783
+ buf.push(">");
2784
+ }
2785
+ return;
2786
+ case PROCESSING_INSTRUCTION_NODE:
2787
+ return buf.push( "<?",node.target," ",node.data,"?>");
2788
+ case ENTITY_REFERENCE_NODE:
2789
+ return buf.push( '&',node.nodeName,';');
2790
+ default:
2791
+ buf.push('??',node.nodeName);
2792
+ }
2793
+ }
2794
+ function importNode(doc,node,deep){
2795
+ var node2;
2796
+ switch (node.nodeType) {
2797
+ case ELEMENT_NODE:
2798
+ node2 = node.cloneNode(false);
2799
+ node2.ownerDocument = doc;
2800
+ case DOCUMENT_FRAGMENT_NODE:
2801
+ break;
2802
+ case ATTRIBUTE_NODE:
2803
+ deep = true;
2804
+ break;
2805
+ }
2806
+ if(!node2){
2807
+ node2 = node.cloneNode(false);//false
2808
+ }
2809
+ node2.ownerDocument = doc;
2810
+ node2.parentNode = null;
2811
+ if(deep){
2812
+ var child = node.firstChild;
2813
+ while(child){
2814
+ node2.appendChild(importNode(doc,child,deep));
2815
+ child = child.nextSibling;
2816
+ }
2817
+ }
2818
+ return node2;
2819
+ }
2820
+ //
2821
+ function cloneNode(doc,node,deep){
2822
+ var node2 = new node.constructor();
2823
+ for(var n in node){
2824
+ var v = node[n];
2825
+ if(typeof v != 'object' ){
2826
+ if(v != node2[n]){
2827
+ node2[n] = v;
2828
+ }
2829
+ }
2830
+ }
2831
+ if(node.childNodes){
2832
+ node2.childNodes = new NodeList();
2833
+ }
2834
+ node2.ownerDocument = doc;
2835
+ switch (node2.nodeType) {
2836
+ case ELEMENT_NODE:
2837
+ var attrs = node.attributes;
2838
+ var attrs2 = node2.attributes = new NamedNodeMap();
2839
+ var len = attrs.length;
2840
+ attrs2._ownerElement = node2;
2841
+ for(var i=0;i<len;i++){
2842
+ node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
2843
+ }
2844
+ break;
2845
+ case ATTRIBUTE_NODE:
2846
+ deep = true;
2847
+ }
2848
+ if(deep){
2849
+ var child = node.firstChild;
2850
+ while(child){
2851
+ node2.appendChild(cloneNode(doc,child,deep));
2852
+ child = child.nextSibling;
2853
+ }
2854
+ }
2855
+ return node2;
2856
+ }
2857
+
2858
+ function __set__(object,key,value){
2859
+ object[key] = value;
2860
+ }
2861
+ function getTextContent(node){
2862
+ switch(node.nodeType){
2863
+ case 1:
2864
+ case 11:
2865
+ var buf = [];
2866
+ node = node.firstChild;
2867
+ while(node){
2868
+ if(node.nodeType!==7 && node.nodeType !==8){
2869
+ buf.push(getTextContent(node));
2870
+ }
2871
+ node = node.nextSibling;
2872
+ }
2873
+ return buf.join('');
2874
+ default:
2875
+ return node.nodeValue;
2876
+ }
2877
+ }
2878
+ try{
2879
+ if(Object.defineProperty){
2880
+ Object.defineProperty(LiveNodeList.prototype,'length',{
2881
+ get:function(){
2882
+ _updateLiveList(this);
2883
+ return this.$$length;
2884
+ }
2885
+ });
2886
+ Object.defineProperty(Node.prototype,'textContent',{
2887
+ get:function(){
2888
+ return getTextContent(this);
2889
+ },
2890
+ set:function(data){
2891
+ switch(this.nodeType){
2892
+ case 1:
2893
+ case 11:
2894
+ while(this.firstChild){
2895
+ this.removeChild(this.firstChild);
2896
+ }
2897
+ if(data || String(data)){
2898
+ this.appendChild(this.ownerDocument.createTextNode(data));
2899
+ }
2900
+ break;
2901
+ default:
2902
+ this.data = data;
2903
+ this.value = value;
2904
+ this.nodeValue = data;
2905
+ }
2906
+ }
2907
+ });
2908
+
2909
+ __set__ = function(object,key,value){
2910
+ object['$$'+key] = value;
2911
+ };
2912
+ }
2913
+ }catch(e){//ie8
2914
+ }
2915
+
2916
+ return DOMImplementation;
2917
+ });
2918
+
2919
+ define("ace/mode/xml/dom-parser",[], function(require, exports, module) {
2920
+ 'use strict';
2921
+
2922
+ var XMLReader = require('./sax'),
2923
+ DOMImplementation = require('./dom');
2924
+
2925
+ function DOMParser(options){
2926
+ this.options = options ||{locator:{}};
2927
+
2928
+ }
2929
+ DOMParser.prototype.parseFromString = function(source,mimeType){
2930
+ var options = this.options;
2931
+ var sax = new XMLReader();
2932
+ var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
2933
+ var errorHandler = options.errorHandler;
2934
+ var locator = options.locator;
2935
+ var defaultNSMap = options.xmlns||{};
2936
+ var entityMap = {'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"}
2937
+ if(locator){
2938
+ domBuilder.setDocumentLocator(locator)
2939
+ }
2940
+
2941
+ sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
2942
+ sax.domBuilder = options.domBuilder || domBuilder;
2943
+ if(/\/x?html?$/.test(mimeType)){
2944
+ entityMap.nbsp = '\xa0';
2945
+ entityMap.copy = '\xa9';
2946
+ defaultNSMap['']= 'http://www.w3.org/1999/xhtml';
2947
+ }
2948
+ if(source){
2949
+ sax.parse(source,defaultNSMap,entityMap);
2950
+ }else{
2951
+ sax.errorHandler.error("invalid document source");
2952
+ }
2953
+ return domBuilder.document;
2954
+ }
2955
+ function buildErrorHandler(errorImpl,domBuilder,locator){
2956
+ if(!errorImpl){
2957
+ if(domBuilder instanceof DOMHandler){
2958
+ return domBuilder;
2959
+ }
2960
+ errorImpl = domBuilder ;
2961
+ }
2962
+ var errorHandler = {}
2963
+ var isCallback = errorImpl instanceof Function;
2964
+ locator = locator||{}
2965
+ function build(key){
2966
+ var fn = errorImpl[key];
2967
+ if(!fn){
2968
+ if(isCallback){
2969
+ fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;
2970
+ }else{
2971
+ var i=arguments.length;
2972
+ while(--i){
2973
+ if(fn = errorImpl[arguments[i]]){
2974
+ break;
2975
+ }
2976
+ }
2977
+ }
2978
+ }
2979
+ errorHandler[key] = fn && function(msg){
2980
+ fn(msg+_locator(locator), msg, locator);
2981
+ }||function(){};
2982
+ }
2983
+ build('warning','warn');
2984
+ build('error','warn','warning');
2985
+ build('fatalError','warn','warning','error');
2986
+ return errorHandler;
2987
+ }
2988
+ function DOMHandler() {
2989
+ this.cdata = false;
2990
+ }
2991
+ function position(locator,node){
2992
+ node.lineNumber = locator.lineNumber;
2993
+ node.columnNumber = locator.columnNumber;
2994
+ }
2995
+ DOMHandler.prototype = {
2996
+ startDocument : function() {
2997
+ this.document = new DOMImplementation().createDocument(null, null, null);
2998
+ if (this.locator) {
2999
+ this.document.documentURI = this.locator.systemId;
3000
+ }
3001
+ },
3002
+ startElement:function(namespaceURI, localName, qName, attrs) {
3003
+ var doc = this.document;
3004
+ var el = doc.createElementNS(namespaceURI, qName||localName);
3005
+ var len = attrs.length;
3006
+ appendElement(this, el);
3007
+ this.currentElement = el;
3008
+
3009
+ this.locator && position(this.locator,el)
3010
+ for (var i = 0 ; i < len; i++) {
3011
+ var namespaceURI = attrs.getURI(i);
3012
+ var value = attrs.getValue(i);
3013
+ var qName = attrs.getQName(i);
3014
+ var attr = doc.createAttributeNS(namespaceURI, qName);
3015
+ if( attr.getOffset){
3016
+ position(attr.getOffset(1),attr)
3017
+ }
3018
+ attr.value = attr.nodeValue = value;
3019
+ el.setAttributeNode(attr)
3020
+ }
3021
+ },
3022
+ endElement:function(namespaceURI, localName, qName) {
3023
+ var current = this.currentElement
3024
+ var tagName = current.tagName;
3025
+ this.currentElement = current.parentNode;
3026
+ },
3027
+ startPrefixMapping:function(prefix, uri) {
3028
+ },
3029
+ endPrefixMapping:function(prefix) {
3030
+ },
3031
+ processingInstruction:function(target, data) {
3032
+ var ins = this.document.createProcessingInstruction(target, data);
3033
+ this.locator && position(this.locator,ins)
3034
+ appendElement(this, ins);
3035
+ },
3036
+ ignorableWhitespace:function(ch, start, length) {
3037
+ },
3038
+ characters:function(chars, start, length) {
3039
+ chars = _toString.apply(this,arguments)
3040
+ if(this.currentElement && chars){
3041
+ if (this.cdata) {
3042
+ var charNode = this.document.createCDATASection(chars);
3043
+ this.currentElement.appendChild(charNode);
3044
+ } else {
3045
+ var charNode = this.document.createTextNode(chars);
3046
+ this.currentElement.appendChild(charNode);
3047
+ }
3048
+ this.locator && position(this.locator,charNode)
3049
+ }
3050
+ },
3051
+ skippedEntity:function(name) {
3052
+ },
3053
+ endDocument:function() {
3054
+ this.document.normalize();
3055
+ },
3056
+ setDocumentLocator:function (locator) {
3057
+ if(this.locator = locator){// && !('lineNumber' in locator)){
3058
+ locator.lineNumber = 0;
3059
+ }
3060
+ },
3061
+ comment:function(chars, start, length) {
3062
+ chars = _toString.apply(this,arguments)
3063
+ var comm = this.document.createComment(chars);
3064
+ this.locator && position(this.locator,comm)
3065
+ appendElement(this, comm);
3066
+ },
3067
+
3068
+ startCDATA:function() {
3069
+ this.cdata = true;
3070
+ },
3071
+ endCDATA:function() {
3072
+ this.cdata = false;
3073
+ },
3074
+
3075
+ startDTD:function(name, publicId, systemId) {
3076
+ var impl = this.document.implementation;
3077
+ if (impl && impl.createDocumentType) {
3078
+ var dt = impl.createDocumentType(name, publicId, systemId);
3079
+ this.locator && position(this.locator,dt)
3080
+ appendElement(this, dt);
3081
+ }
3082
+ },
3083
+ warning:function(error) {
3084
+ console.warn(error,_locator(this.locator));
3085
+ },
3086
+ error:function(error) {
3087
+ console.error(error,_locator(this.locator));
3088
+ },
3089
+ fatalError:function(error) {
3090
+ console.error(error,_locator(this.locator));
3091
+ throw error;
3092
+ }
3093
+ }
3094
+ function _locator(l){
3095
+ if(l){
3096
+ return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'
3097
+ }
3098
+ }
3099
+ function _toString(chars,start,length){
3100
+ if(typeof chars == 'string'){
3101
+ return chars.substr(start,length)
3102
+ }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)")
3103
+ if(chars.length >= start+length || start){
3104
+ return new java.lang.String(chars,start,length)+'';
3105
+ }
3106
+ return chars;
3107
+ }
3108
+ }
3109
+ "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){
3110
+ DOMHandler.prototype[key] = function(){return null}
3111
+ })
3112
+ function appendElement (hander,node) {
3113
+ if (!hander.currentElement) {
3114
+ hander.document.appendChild(node);
3115
+ } else {
3116
+ hander.currentElement.appendChild(node);
3117
+ }
3118
+ }//appendChild and setAttributeNS are preformance key
3119
+
3120
+ return {
3121
+ DOMParser: DOMParser
3122
+ };
3123
+ });
3124
+
3125
+ define("ace/mode/xml_worker",[], function(require, exports, module) {
3126
+ "use strict";
3127
+
3128
+ var oop = require("../lib/oop");
3129
+ var lang = require("../lib/lang");
3130
+ var Mirror = require("../worker/mirror").Mirror;
3131
+ var DOMParser = require("./xml/dom-parser").DOMParser;
3132
+
3133
+ var Worker = exports.Worker = function(sender) {
3134
+ Mirror.call(this, sender);
3135
+ this.setTimeout(400);
3136
+ this.context = null;
3137
+ };
3138
+
3139
+ oop.inherits(Worker, Mirror);
3140
+
3141
+ (function() {
3142
+
3143
+ this.setOptions = function(options) {
3144
+ this.context = options.context;
3145
+ };
3146
+
3147
+ this.onUpdate = function() {
3148
+ var value = this.doc.getValue();
3149
+ if (!value)
3150
+ return;
3151
+ var parser = new DOMParser();
3152
+ var errors = [];
3153
+ parser.options.errorHandler = {
3154
+ fatalError: function(fullMsg, errorMsg, locator) {
3155
+ errors.push({
3156
+ row: locator.lineNumber,
3157
+ column: locator.columnNumber,
3158
+ text: errorMsg,
3159
+ type: "error"
3160
+ });
3161
+ },
3162
+ error: function(fullMsg, errorMsg, locator) {
3163
+ errors.push({
3164
+ row: locator.lineNumber,
3165
+ column: locator.columnNumber,
3166
+ text: errorMsg,
3167
+ type: "error"
3168
+ });
3169
+ },
3170
+ warning: function(fullMsg, errorMsg, locator) {
3171
+ errors.push({
3172
+ row: locator.lineNumber,
3173
+ column: locator.columnNumber,
3174
+ text: errorMsg,
3175
+ type: "warning"
3176
+ });
3177
+ }
3178
+ };
3179
+
3180
+ parser.parseFromString(value);
3181
+ this.sender.emit("error", errors);
3182
+ };
3183
+
3184
+ }).call(Worker.prototype);
3185
+
3186
+ });
3187
+
3188
+ define("ace/lib/es5-shim",[], function(require, exports, module) {
3189
+
3190
+ //
3191
+ //
3192
+ function Empty() {}
3193
+
3194
+ if (!Function.prototype.bind) {
3195
+ Function.prototype.bind = function bind(that) { // .length is 1
3196
+ var target = this;
3197
+ if (typeof target != "function") {
3198
+ throw new TypeError("Function.prototype.bind called on incompatible " + target);
3199
+ }
3200
+ var args = slice.call(arguments, 1); // for normal call
3201
+ var bound = function () {
3202
+
3203
+ if (this instanceof bound) {
3204
+ var result = target.apply(
3205
+ this,
3206
+ args.concat(slice.call(arguments))
3207
+ );
3208
+ if (Object(result) === result) {
3209
+ return result;
3210
+ }
3211
+ return this;
3212
+
3213
+ } else {
3214
+ return target.apply(
3215
+ that,
3216
+ args.concat(slice.call(arguments))
3217
+ );
3218
+
3219
+ }
3220
+
3221
+ };
3222
+ if(target.prototype) {
3223
+ Empty.prototype = target.prototype;
3224
+ bound.prototype = new Empty();
3225
+ Empty.prototype = null;
3226
+ }
3227
+ //
3228
+ return bound;
3229
+ };
3230
+ }
3231
+ var call = Function.prototype.call;
3232
+ var prototypeOfArray = Array.prototype;
3233
+ var prototypeOfObject = Object.prototype;
3234
+ var slice = prototypeOfArray.slice;
3235
+ var _toString = call.bind(prototypeOfObject.toString);
3236
+ var owns = call.bind(prototypeOfObject.hasOwnProperty);
3237
+ var defineGetter;
3238
+ var defineSetter;
3239
+ var lookupGetter;
3240
+ var lookupSetter;
3241
+ var supportsAccessors;
3242
+ if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
3243
+ defineGetter = call.bind(prototypeOfObject.__defineGetter__);
3244
+ defineSetter = call.bind(prototypeOfObject.__defineSetter__);
3245
+ lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
3246
+ lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
3247
+ }
3248
+
3249
+ //
3250
+ //
3251
+ if ([1,2].splice(0).length != 2) {
3252
+ if(function() { // test IE < 9 to splice bug - see issue #138
3253
+ function makeArray(l) {
3254
+ var a = new Array(l+2);
3255
+ a[0] = a[1] = 0;
3256
+ return a;
3257
+ }
3258
+ var array = [], lengthBefore;
3259
+
3260
+ array.splice.apply(array, makeArray(20));
3261
+ array.splice.apply(array, makeArray(26));
3262
+
3263
+ lengthBefore = array.length; //46
3264
+ array.splice(5, 0, "XXX"); // add one element
3265
+
3266
+ lengthBefore + 1 == array.length
3267
+
3268
+ if (lengthBefore + 1 == array.length) {
3269
+ return true;// has right splice implementation without bugs
3270
+ }
3271
+ }()) {//IE 6/7
3272
+ var array_splice = Array.prototype.splice;
3273
+ Array.prototype.splice = function(start, deleteCount) {
3274
+ if (!arguments.length) {
3275
+ return [];
3276
+ } else {
3277
+ return array_splice.apply(this, [
3278
+ start === void 0 ? 0 : start,
3279
+ deleteCount === void 0 ? (this.length - start) : deleteCount
3280
+ ].concat(slice.call(arguments, 2)))
3281
+ }
3282
+ };
3283
+ } else {//IE8
3284
+ Array.prototype.splice = function(pos, removeCount){
3285
+ var length = this.length;
3286
+ if (pos > 0) {
3287
+ if (pos > length)
3288
+ pos = length;
3289
+ } else if (pos == void 0) {
3290
+ pos = 0;
3291
+ } else if (pos < 0) {
3292
+ pos = Math.max(length + pos, 0);
3293
+ }
3294
+
3295
+ if (!(pos+removeCount < length))
3296
+ removeCount = length - pos;
3297
+
3298
+ var removed = this.slice(pos, pos+removeCount);
3299
+ var insert = slice.call(arguments, 2);
3300
+ var add = insert.length;
3301
+ if (pos === length) {
3302
+ if (add) {
3303
+ this.push.apply(this, insert);
3304
+ }
3305
+ } else {
3306
+ var remove = Math.min(removeCount, length - pos);
3307
+ var tailOldPos = pos + remove;
3308
+ var tailNewPos = tailOldPos + add - remove;
3309
+ var tailCount = length - tailOldPos;
3310
+ var lengthAfterRemove = length - remove;
3311
+
3312
+ if (tailNewPos < tailOldPos) { // case A
3313
+ for (var i = 0; i < tailCount; ++i) {
3314
+ this[tailNewPos+i] = this[tailOldPos+i];
3315
+ }
3316
+ } else if (tailNewPos > tailOldPos) { // case B
3317
+ for (i = tailCount; i--; ) {
3318
+ this[tailNewPos+i] = this[tailOldPos+i];
3319
+ }
3320
+ } // else, add == remove (nothing to do)
3321
+
3322
+ if (add && pos === lengthAfterRemove) {
3323
+ this.length = lengthAfterRemove; // truncate array
3324
+ this.push.apply(this, insert);
3325
+ } else {
3326
+ this.length = lengthAfterRemove + add; // reserves space
3327
+ for (i = 0; i < add; ++i) {
3328
+ this[pos+i] = insert[i];
3329
+ }
3330
+ }
3331
+ }
3332
+ return removed;
3333
+ };
3334
+ }
3335
+ }
3336
+ if (!Array.isArray) {
3337
+ Array.isArray = function isArray(obj) {
3338
+ return _toString(obj) == "[object Array]";
3339
+ };
3340
+ }
3341
+ var boxedString = Object("a"),
3342
+ splitString = boxedString[0] != "a" || !(0 in boxedString);
3343
+
3344
+ if (!Array.prototype.forEach) {
3345
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
3346
+ var object = toObject(this),
3347
+ self = splitString && _toString(this) == "[object String]" ?
3348
+ this.split("") :
3349
+ object,
3350
+ thisp = arguments[1],
3351
+ i = -1,
3352
+ length = self.length >>> 0;
3353
+ if (_toString(fun) != "[object Function]") {
3354
+ throw new TypeError(); // TODO message
3355
+ }
3356
+
3357
+ while (++i < length) {
3358
+ if (i in self) {
3359
+ fun.call(thisp, self[i], i, object);
3360
+ }
3361
+ }
3362
+ };
3363
+ }
3364
+ if (!Array.prototype.map) {
3365
+ Array.prototype.map = function map(fun /*, thisp*/) {
3366
+ var object = toObject(this),
3367
+ self = splitString && _toString(this) == "[object String]" ?
3368
+ this.split("") :
3369
+ object,
3370
+ length = self.length >>> 0,
3371
+ result = Array(length),
3372
+ thisp = arguments[1];
3373
+ if (_toString(fun) != "[object Function]") {
3374
+ throw new TypeError(fun + " is not a function");
3375
+ }
3376
+
3377
+ for (var i = 0; i < length; i++) {
3378
+ if (i in self)
3379
+ result[i] = fun.call(thisp, self[i], i, object);
3380
+ }
3381
+ return result;
3382
+ };
3383
+ }
3384
+ if (!Array.prototype.filter) {
3385
+ Array.prototype.filter = function filter(fun /*, thisp */) {
3386
+ var object = toObject(this),
3387
+ self = splitString && _toString(this) == "[object String]" ?
3388
+ this.split("") :
3389
+ object,
3390
+ length = self.length >>> 0,
3391
+ result = [],
3392
+ value,
3393
+ thisp = arguments[1];
3394
+ if (_toString(fun) != "[object Function]") {
3395
+ throw new TypeError(fun + " is not a function");
3396
+ }
3397
+
3398
+ for (var i = 0; i < length; i++) {
3399
+ if (i in self) {
3400
+ value = self[i];
3401
+ if (fun.call(thisp, value, i, object)) {
3402
+ result.push(value);
3403
+ }
3404
+ }
3405
+ }
3406
+ return result;
3407
+ };
3408
+ }
3409
+ if (!Array.prototype.every) {
3410
+ Array.prototype.every = function every(fun /*, thisp */) {
3411
+ var object = toObject(this),
3412
+ self = splitString && _toString(this) == "[object String]" ?
3413
+ this.split("") :
3414
+ object,
3415
+ length = self.length >>> 0,
3416
+ thisp = arguments[1];
3417
+ if (_toString(fun) != "[object Function]") {
3418
+ throw new TypeError(fun + " is not a function");
3419
+ }
3420
+
3421
+ for (var i = 0; i < length; i++) {
3422
+ if (i in self && !fun.call(thisp, self[i], i, object)) {
3423
+ return false;
3424
+ }
3425
+ }
3426
+ return true;
3427
+ };
3428
+ }
3429
+ if (!Array.prototype.some) {
3430
+ Array.prototype.some = function some(fun /*, thisp */) {
3431
+ var object = toObject(this),
3432
+ self = splitString && _toString(this) == "[object String]" ?
3433
+ this.split("") :
3434
+ object,
3435
+ length = self.length >>> 0,
3436
+ thisp = arguments[1];
3437
+ if (_toString(fun) != "[object Function]") {
3438
+ throw new TypeError(fun + " is not a function");
3439
+ }
3440
+
3441
+ for (var i = 0; i < length; i++) {
3442
+ if (i in self && fun.call(thisp, self[i], i, object)) {
3443
+ return true;
3444
+ }
3445
+ }
3446
+ return false;
3447
+ };
3448
+ }
3449
+ if (!Array.prototype.reduce) {
3450
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
3451
+ var object = toObject(this),
3452
+ self = splitString && _toString(this) == "[object String]" ?
3453
+ this.split("") :
3454
+ object,
3455
+ length = self.length >>> 0;
3456
+ if (_toString(fun) != "[object Function]") {
3457
+ throw new TypeError(fun + " is not a function");
3458
+ }
3459
+ if (!length && arguments.length == 1) {
3460
+ throw new TypeError("reduce of empty array with no initial value");
3461
+ }
3462
+
3463
+ var i = 0;
3464
+ var result;
3465
+ if (arguments.length >= 2) {
3466
+ result = arguments[1];
3467
+ } else {
3468
+ do {
3469
+ if (i in self) {
3470
+ result = self[i++];
3471
+ break;
3472
+ }
3473
+ if (++i >= length) {
3474
+ throw new TypeError("reduce of empty array with no initial value");
3475
+ }
3476
+ } while (true);
3477
+ }
3478
+
3479
+ for (; i < length; i++) {
3480
+ if (i in self) {
3481
+ result = fun.call(void 0, result, self[i], i, object);
3482
+ }
3483
+ }
3484
+
3485
+ return result;
3486
+ };
3487
+ }
3488
+ if (!Array.prototype.reduceRight) {
3489
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
3490
+ var object = toObject(this),
3491
+ self = splitString && _toString(this) == "[object String]" ?
3492
+ this.split("") :
3493
+ object,
3494
+ length = self.length >>> 0;
3495
+ if (_toString(fun) != "[object Function]") {
3496
+ throw new TypeError(fun + " is not a function");
3497
+ }
3498
+ if (!length && arguments.length == 1) {
3499
+ throw new TypeError("reduceRight of empty array with no initial value");
3500
+ }
3501
+
3502
+ var result, i = length - 1;
3503
+ if (arguments.length >= 2) {
3504
+ result = arguments[1];
3505
+ } else {
3506
+ do {
3507
+ if (i in self) {
3508
+ result = self[i--];
3509
+ break;
3510
+ }
3511
+ if (--i < 0) {
3512
+ throw new TypeError("reduceRight of empty array with no initial value");
3513
+ }
3514
+ } while (true);
3515
+ }
3516
+
3517
+ do {
3518
+ if (i in this) {
3519
+ result = fun.call(void 0, result, self[i], i, object);
3520
+ }
3521
+ } while (i--);
3522
+
3523
+ return result;
3524
+ };
3525
+ }
3526
+ if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
3527
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
3528
+ var self = splitString && _toString(this) == "[object String]" ?
3529
+ this.split("") :
3530
+ toObject(this),
3531
+ length = self.length >>> 0;
3532
+
3533
+ if (!length) {
3534
+ return -1;
3535
+ }
3536
+
3537
+ var i = 0;
3538
+ if (arguments.length > 1) {
3539
+ i = toInteger(arguments[1]);
3540
+ }
3541
+ i = i >= 0 ? i : Math.max(0, length + i);
3542
+ for (; i < length; i++) {
3543
+ if (i in self && self[i] === sought) {
3544
+ return i;
3545
+ }
3546
+ }
3547
+ return -1;
3548
+ };
3549
+ }
3550
+ if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
3551
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
3552
+ var self = splitString && _toString(this) == "[object String]" ?
3553
+ this.split("") :
3554
+ toObject(this),
3555
+ length = self.length >>> 0;
3556
+
3557
+ if (!length) {
3558
+ return -1;
3559
+ }
3560
+ var i = length - 1;
3561
+ if (arguments.length > 1) {
3562
+ i = Math.min(i, toInteger(arguments[1]));
3563
+ }
3564
+ i = i >= 0 ? i : length - Math.abs(i);
3565
+ for (; i >= 0; i--) {
3566
+ if (i in self && sought === self[i]) {
3567
+ return i;
3568
+ }
3569
+ }
3570
+ return -1;
3571
+ };
3572
+ }
3573
+
3574
+ //
3575
+ //
3576
+ if (!Object.getPrototypeOf) {
3577
+ Object.getPrototypeOf = function getPrototypeOf(object) {
3578
+ return object.__proto__ || (
3579
+ object.constructor ?
3580
+ object.constructor.prototype :
3581
+ prototypeOfObject
3582
+ );
3583
+ };
3584
+ }
3585
+ if (!Object.getOwnPropertyDescriptor) {
3586
+ var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
3587
+ "non-object: ";
3588
+ Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
3589
+ if ((typeof object != "object" && typeof object != "function") || object === null)
3590
+ throw new TypeError(ERR_NON_OBJECT + object);
3591
+ if (!owns(object, property))
3592
+ return;
3593
+
3594
+ var descriptor, getter, setter;
3595
+ descriptor = { enumerable: true, configurable: true };
3596
+ if (supportsAccessors) {
3597
+ var prototype = object.__proto__;
3598
+ object.__proto__ = prototypeOfObject;
3599
+
3600
+ var getter = lookupGetter(object, property);
3601
+ var setter = lookupSetter(object, property);
3602
+ object.__proto__ = prototype;
3603
+
3604
+ if (getter || setter) {
3605
+ if (getter) descriptor.get = getter;
3606
+ if (setter) descriptor.set = setter;
3607
+ return descriptor;
3608
+ }
3609
+ }
3610
+ descriptor.value = object[property];
3611
+ return descriptor;
3612
+ };
3613
+ }
3614
+ if (!Object.getOwnPropertyNames) {
3615
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
3616
+ return Object.keys(object);
3617
+ };
3618
+ }
3619
+ if (!Object.create) {
3620
+ var createEmpty;
3621
+ if (Object.prototype.__proto__ === null) {
3622
+ createEmpty = function () {
3623
+ return { "__proto__": null };
3624
+ };
3625
+ } else {
3626
+ createEmpty = function () {
3627
+ var empty = {};
3628
+ for (var i in empty)
3629
+ empty[i] = null;
3630
+ empty.constructor =
3631
+ empty.hasOwnProperty =
3632
+ empty.propertyIsEnumerable =
3633
+ empty.isPrototypeOf =
3634
+ empty.toLocaleString =
3635
+ empty.toString =
3636
+ empty.valueOf =
3637
+ empty.__proto__ = null;
3638
+ return empty;
3639
+ }
3640
+ }
3641
+
3642
+ Object.create = function create(prototype, properties) {
3643
+ var object;
3644
+ if (prototype === null) {
3645
+ object = createEmpty();
3646
+ } else {
3647
+ if (typeof prototype != "object")
3648
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
3649
+ var Type = function () {};
3650
+ Type.prototype = prototype;
3651
+ object = new Type();
3652
+ object.__proto__ = prototype;
3653
+ }
3654
+ if (properties !== void 0)
3655
+ Object.defineProperties(object, properties);
3656
+ return object;
3657
+ };
3658
+ }
3659
+ function doesDefinePropertyWork(object) {
3660
+ try {
3661
+ Object.defineProperty(object, "sentinel", {});
3662
+ return "sentinel" in object;
3663
+ } catch (exception) {
3664
+ }
3665
+ }
3666
+ if (Object.defineProperty) {
3667
+ var definePropertyWorksOnObject = doesDefinePropertyWork({});
3668
+ var definePropertyWorksOnDom = typeof document == "undefined" ||
3669
+ doesDefinePropertyWork(document.createElement("div"));
3670
+ if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
3671
+ var definePropertyFallback = Object.defineProperty;
3672
+ }
3673
+ }
3674
+
3675
+ if (!Object.defineProperty || definePropertyFallback) {
3676
+ var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
3677
+ var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
3678
+ var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
3679
+ "on this javascript engine";
3680
+
3681
+ Object.defineProperty = function defineProperty(object, property, descriptor) {
3682
+ if ((typeof object != "object" && typeof object != "function") || object === null)
3683
+ throw new TypeError(ERR_NON_OBJECT_TARGET + object);
3684
+ if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
3685
+ throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
3686
+ if (definePropertyFallback) {
3687
+ try {
3688
+ return definePropertyFallback.call(Object, object, property, descriptor);
3689
+ } catch (exception) {
3690
+ }
3691
+ }
3692
+ if (owns(descriptor, "value")) {
3693
+
3694
+ if (supportsAccessors && (lookupGetter(object, property) ||
3695
+ lookupSetter(object, property)))
3696
+ {
3697
+ var prototype = object.__proto__;
3698
+ object.__proto__ = prototypeOfObject;
3699
+ delete object[property];
3700
+ object[property] = descriptor.value;
3701
+ object.__proto__ = prototype;
3702
+ } else {
3703
+ object[property] = descriptor.value;
3704
+ }
3705
+ } else {
3706
+ if (!supportsAccessors)
3707
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
3708
+ if (owns(descriptor, "get"))
3709
+ defineGetter(object, property, descriptor.get);
3710
+ if (owns(descriptor, "set"))
3711
+ defineSetter(object, property, descriptor.set);
3712
+ }
3713
+
3714
+ return object;
3715
+ };
3716
+ }
3717
+ if (!Object.defineProperties) {
3718
+ Object.defineProperties = function defineProperties(object, properties) {
3719
+ for (var property in properties) {
3720
+ if (owns(properties, property))
3721
+ Object.defineProperty(object, property, properties[property]);
3722
+ }
3723
+ return object;
3724
+ };
3725
+ }
3726
+ if (!Object.seal) {
3727
+ Object.seal = function seal(object) {
3728
+ return object;
3729
+ };
3730
+ }
3731
+ if (!Object.freeze) {
3732
+ Object.freeze = function freeze(object) {
3733
+ return object;
3734
+ };
3735
+ }
3736
+ try {
3737
+ Object.freeze(function () {});
3738
+ } catch (exception) {
3739
+ Object.freeze = (function freeze(freezeObject) {
3740
+ return function freeze(object) {
3741
+ if (typeof object == "function") {
3742
+ return object;
3743
+ } else {
3744
+ return freezeObject(object);
3745
+ }
3746
+ };
3747
+ })(Object.freeze);
3748
+ }
3749
+ if (!Object.preventExtensions) {
3750
+ Object.preventExtensions = function preventExtensions(object) {
3751
+ return object;
3752
+ };
3753
+ }
3754
+ if (!Object.isSealed) {
3755
+ Object.isSealed = function isSealed(object) {
3756
+ return false;
3757
+ };
3758
+ }
3759
+ if (!Object.isFrozen) {
3760
+ Object.isFrozen = function isFrozen(object) {
3761
+ return false;
3762
+ };
3763
+ }
3764
+ if (!Object.isExtensible) {
3765
+ Object.isExtensible = function isExtensible(object) {
3766
+ if (Object(object) === object) {
3767
+ throw new TypeError(); // TODO message
3768
+ }
3769
+ var name = '';
3770
+ while (owns(object, name)) {
3771
+ name += '?';
3772
+ }
3773
+ object[name] = true;
3774
+ var returnValue = owns(object, name);
3775
+ delete object[name];
3776
+ return returnValue;
3777
+ };
3778
+ }
3779
+ if (!Object.keys) {
3780
+ var hasDontEnumBug = true,
3781
+ dontEnums = [
3782
+ "toString",
3783
+ "toLocaleString",
3784
+ "valueOf",
3785
+ "hasOwnProperty",
3786
+ "isPrototypeOf",
3787
+ "propertyIsEnumerable",
3788
+ "constructor"
3789
+ ],
3790
+ dontEnumsLength = dontEnums.length;
3791
+
3792
+ for (var key in {"toString": null}) {
3793
+ hasDontEnumBug = false;
3794
+ }
3795
+
3796
+ Object.keys = function keys(object) {
3797
+
3798
+ if (
3799
+ (typeof object != "object" && typeof object != "function") ||
3800
+ object === null
3801
+ ) {
3802
+ throw new TypeError("Object.keys called on a non-object");
3803
+ }
3804
+
3805
+ var keys = [];
3806
+ for (var name in object) {
3807
+ if (owns(object, name)) {
3808
+ keys.push(name);
3809
+ }
3810
+ }
3811
+
3812
+ if (hasDontEnumBug) {
3813
+ for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
3814
+ var dontEnum = dontEnums[i];
3815
+ if (owns(object, dontEnum)) {
3816
+ keys.push(dontEnum);
3817
+ }
3818
+ }
3819
+ }
3820
+ return keys;
3821
+ };
3822
+
3823
+ }
3824
+
3825
+ //
3826
+ //
3827
+ if (!Date.now) {
3828
+ Date.now = function now() {
3829
+ return new Date().getTime();
3830
+ };
3831
+ }
3832
+
3833
+
3834
+ //
3835
+ //
3836
+ var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
3837
+ "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
3838
+ "\u2029\uFEFF";
3839
+ if (!String.prototype.trim || ws.trim()) {
3840
+ ws = "[" + ws + "]";
3841
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
3842
+ trimEndRegexp = new RegExp(ws + ws + "*$");
3843
+ String.prototype.trim = function trim() {
3844
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
3845
+ };
3846
+ }
3847
+
3848
+ //
3849
+ //
3850
+ function toInteger(n) {
3851
+ n = +n;
3852
+ if (n !== n) { // isNaN
3853
+ n = 0;
3854
+ } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
3855
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
3856
+ }
3857
+ return n;
3858
+ }
3859
+
3860
+ function isPrimitive(input) {
3861
+ var type = typeof input;
3862
+ return (
3863
+ input === null ||
3864
+ type === "undefined" ||
3865
+ type === "boolean" ||
3866
+ type === "number" ||
3867
+ type === "string"
3868
+ );
3869
+ }
3870
+
3871
+ function toPrimitive(input) {
3872
+ var val, valueOf, toString;
3873
+ if (isPrimitive(input)) {
3874
+ return input;
3875
+ }
3876
+ valueOf = input.valueOf;
3877
+ if (typeof valueOf === "function") {
3878
+ val = valueOf.call(input);
3879
+ if (isPrimitive(val)) {
3880
+ return val;
3881
+ }
3882
+ }
3883
+ toString = input.toString;
3884
+ if (typeof toString === "function") {
3885
+ val = toString.call(input);
3886
+ if (isPrimitive(val)) {
3887
+ return val;
3888
+ }
3889
+ }
3890
+ throw new TypeError();
3891
+ }
3892
+ var toObject = function (o) {
3893
+ if (o == null) { // this matches both null and undefined
3894
+ throw new TypeError("can't convert "+o+" to object");
3895
+ }
3896
+ return Object(o);
3897
+ };
3898
+
3899
+ });