@limetech/lime-elements 36.1.0-next.9 → 36.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/cjs/{checkbox.template-b6c6562c.js → checkbox.template-ac867c17.js} +1 -1
  2. package/dist/cjs/{index-2a28697b.js → index-287e25e0.js} +424 -246
  3. package/dist/cjs/lime-elements.cjs.js +3 -3
  4. package/dist/cjs/limel-badge.cjs.entry.js +2 -1
  5. package/dist/cjs/limel-banner.cjs.entry.js +3 -1
  6. package/dist/cjs/limel-button-group.cjs.entry.js +3 -8
  7. package/dist/cjs/{limel-button.cjs.entry.js → limel-button_2.cjs.entry.js} +117 -21
  8. package/dist/cjs/limel-checkbox.cjs.entry.js +10 -26
  9. package/dist/cjs/limel-chip-set.cjs.entry.js +21 -52
  10. package/dist/cjs/{limel-linear-progress.cjs.entry.js → limel-circular-progress_2.cjs.entry.js} +34 -7
  11. package/dist/cjs/limel-code-editor.cjs.entry.js +110 -97
  12. package/dist/cjs/limel-collapsible-section.cjs.entry.js +4 -5
  13. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +5 -1
  14. package/dist/cjs/limel-color-picker.cjs.entry.js +8 -2
  15. package/dist/cjs/limel-config.cjs.entry.js +2 -1
  16. package/dist/cjs/limel-date-picker.cjs.entry.js +15 -33
  17. package/dist/cjs/limel-dialog.cjs.entry.js +4 -12
  18. package/dist/cjs/limel-dock-button.cjs.entry.js +5 -15
  19. package/dist/cjs/limel-dock.cjs.entry.js +8 -40
  20. package/dist/cjs/limel-file.cjs.entry.js +10 -24
  21. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +149 -48
  22. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -13
  23. package/dist/cjs/limel-form.cjs.entry.js +327 -326
  24. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  25. package/dist/cjs/limel-header.cjs.entry.js +5 -1
  26. package/dist/cjs/limel-icon-button.cjs.entry.js +3 -8
  27. package/dist/cjs/limel-icon.cjs.entry.js +4 -1
  28. package/dist/cjs/limel-info-tile.cjs.entry.js +95 -0
  29. package/dist/cjs/limel-input-field.cjs.entry.js +27 -60
  30. package/dist/cjs/limel-list_2.cjs.entry.js +10 -21
  31. package/dist/cjs/limel-menu-list.cjs.entry.js +7 -14
  32. package/dist/cjs/limel-picker.cjs.entry.js +14 -39
  33. package/dist/cjs/limel-popover_4.cjs.entry.js +13 -12
  34. package/dist/cjs/limel-portal.cjs.entry.js +63 -73
  35. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +4 -13
  36. package/dist/cjs/limel-progress-flow.cjs.entry.js +4 -20
  37. package/dist/cjs/limel-select.cjs.entry.js +19 -31
  38. package/dist/cjs/limel-shortcut.cjs.entry.js +52 -0
  39. package/dist/cjs/limel-slider.cjs.entry.js +12 -33
  40. package/dist/cjs/limel-snackbar.cjs.entry.js +7 -5
  41. package/dist/cjs/limel-spinner.cjs.entry.js +1 -7
  42. package/dist/cjs/limel-split-button.cjs.entry.js +35 -0
  43. package/dist/cjs/limel-switch.cjs.entry.js +6 -19
  44. package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -5
  45. package/dist/cjs/limel-tab-panel.cjs.entry.js +2 -5
  46. package/dist/cjs/limel-table.cjs.entry.js +16 -28
  47. package/dist/cjs/loader.cjs.js +3 -3
  48. package/dist/cjs/{translations-5a8d7f6c.js → translations-ca7279bc.js} +6 -0
  49. package/dist/collection/collection-manifest.json +5 -2
  50. package/dist/collection/components/badge/badge.js +35 -26
  51. package/dist/collection/components/banner/banner.js +88 -83
  52. package/dist/collection/components/button/button.css +4 -1
  53. package/dist/collection/components/button/button.js +148 -160
  54. package/dist/collection/components/button-group/button-group.js +81 -79
  55. package/dist/collection/components/checkbox/checkbox.js +172 -176
  56. package/dist/collection/components/checkbox/checkbox.template.js +15 -23
  57. package/dist/collection/components/chip-set/chip-set.js +486 -528
  58. package/dist/collection/components/circular-progress/circular-progress.css +27 -5
  59. package/dist/collection/components/circular-progress/circular-progress.js +129 -113
  60. package/dist/collection/components/code-editor/code-editor.js +178 -182
  61. package/dist/collection/components/collapsible-section/collapsible-section.js +120 -124
  62. package/dist/collection/components/color-picker/color-picker-palette.js +102 -92
  63. package/dist/collection/components/color-picker/color-picker.js +143 -131
  64. package/dist/collection/components/config/config.js +21 -17
  65. package/dist/collection/components/date-picker/date-picker.js +254 -261
  66. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +591 -166
  67. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +150 -143
  68. package/dist/collection/components/date-picker/pickers/QuarterPicker.js +1 -3
  69. package/dist/collection/components/dialog/dialog.css +7 -1
  70. package/dist/collection/components/dialog/dialog.js +134 -142
  71. package/dist/collection/components/dock/dock-button/dock-button.js +138 -141
  72. package/dist/collection/components/dock/dock.js +204 -233
  73. package/dist/collection/components/file/file.js +187 -191
  74. package/dist/collection/components/flex-container/flex-container.js +96 -102
  75. package/dist/collection/components/form/form.js +158 -150
  76. package/dist/collection/components/form/widgets/code-editor.js +2 -0
  77. package/dist/collection/components/grid/grid.js +11 -7
  78. package/dist/collection/components/header/header.js +89 -87
  79. package/dist/collection/components/icon/icon.js +79 -66
  80. package/dist/collection/components/icon-button/icon-button.js +85 -85
  81. package/dist/collection/components/info-tile/info-tile.css +310 -0
  82. package/dist/collection/components/info-tile/info-tile.js +294 -0
  83. package/dist/collection/components/info-tile/info-tile.types.js +1 -0
  84. package/dist/collection/components/input-field/input-field.css +3 -0
  85. package/dist/collection/components/input-field/input-field.js +482 -523
  86. package/dist/collection/components/linear-progress/linear-progress.js +57 -61
  87. package/dist/collection/components/list/list-renderer.js +3 -12
  88. package/dist/collection/components/list/list.css +11 -116
  89. package/dist/collection/components/list/list.js +167 -166
  90. package/dist/collection/components/list/radio-button/radio-button.template.js +2 -8
  91. package/dist/collection/components/menu/menu.js +183 -195
  92. package/dist/collection/components/menu-list/menu-list-renderer.js +2 -9
  93. package/dist/collection/components/menu-list/menu-list.css +11 -116
  94. package/dist/collection/components/menu-list/menu-list.js +149 -146
  95. package/dist/collection/components/menu-surface/menu-surface.js +69 -64
  96. package/dist/collection/components/picker/picker.js +412 -427
  97. package/dist/collection/components/popover/popover.js +79 -74
  98. package/dist/collection/components/popover-surface/popover-surface.js +34 -25
  99. package/dist/collection/components/portal/portal.js +145 -158
  100. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js +90 -94
  101. package/dist/collection/components/progress-flow/progress-flow.js +93 -101
  102. package/dist/collection/components/select/select.css +8 -7
  103. package/dist/collection/components/select/select.js +206 -211
  104. package/dist/collection/components/select/select.template.js +17 -26
  105. package/dist/collection/components/shortcut/shortcut.css +91 -0
  106. package/dist/collection/components/shortcut/shortcut.js +161 -0
  107. package/dist/collection/components/slider/slider.js +233 -264
  108. package/dist/collection/components/snackbar/snackbar.js +175 -169
  109. package/dist/collection/components/spinner/spinner.js +56 -85
  110. package/dist/collection/components/split-button/split-button.css +84 -0
  111. package/dist/collection/components/split-button/split-button.js +176 -0
  112. package/dist/collection/components/switch/switch.js +117 -129
  113. package/dist/collection/components/tab-bar/tab-bar.js +87 -92
  114. package/dist/collection/components/tab-panel/tab-panel.js +64 -61
  115. package/dist/collection/components/table/table.js +447 -457
  116. package/dist/collection/components/tooltip/tooltip-content.js +70 -61
  117. package/dist/collection/components/tooltip/tooltip.js +96 -91
  118. package/dist/collection/global/shared-types/link.types.js +1 -0
  119. package/dist/collection/style/internal/z-index.scss +0 -5
  120. package/dist/collection/translations/da.js +1 -0
  121. package/dist/collection/translations/en.js +1 -0
  122. package/dist/collection/translations/fi.js +1 -0
  123. package/dist/collection/translations/nl.js +1 -0
  124. package/dist/collection/translations/no.js +1 -0
  125. package/dist/collection/translations/sv.js +1 -0
  126. package/dist/esm/{checkbox.template-2f1bbc98.js → checkbox.template-fc7fcd06.js} +1 -1
  127. package/dist/esm/{index-11cd0b60.js → index-cdfd351d.js} +424 -246
  128. package/dist/esm/lime-elements.js +3 -3
  129. package/dist/esm/limel-badge.entry.js +2 -1
  130. package/dist/esm/limel-banner.entry.js +3 -1
  131. package/dist/esm/limel-button-group.entry.js +3 -8
  132. package/dist/esm/{limel-button.entry.js → limel-button_2.entry.js} +117 -22
  133. package/dist/esm/limel-checkbox.entry.js +10 -26
  134. package/dist/esm/limel-chip-set.entry.js +21 -52
  135. package/dist/esm/{limel-linear-progress.entry.js → limel-circular-progress_2.entry.js} +34 -8
  136. package/dist/esm/limel-code-editor.entry.js +110 -97
  137. package/dist/esm/limel-collapsible-section.entry.js +4 -5
  138. package/dist/esm/limel-color-picker-palette.entry.js +5 -1
  139. package/dist/esm/limel-color-picker.entry.js +8 -2
  140. package/dist/esm/limel-config.entry.js +2 -1
  141. package/dist/esm/limel-date-picker.entry.js +15 -33
  142. package/dist/esm/limel-dialog.entry.js +4 -12
  143. package/dist/esm/limel-dock-button.entry.js +5 -15
  144. package/dist/esm/limel-dock.entry.js +8 -40
  145. package/dist/esm/limel-file.entry.js +10 -24
  146. package/dist/esm/limel-flatpickr-adapter.entry.js +149 -48
  147. package/dist/esm/limel-flex-container.entry.js +1 -13
  148. package/dist/esm/limel-form.entry.js +327 -326
  149. package/dist/esm/limel-grid.entry.js +1 -1
  150. package/dist/esm/limel-header.entry.js +5 -1
  151. package/dist/esm/limel-icon-button.entry.js +3 -8
  152. package/dist/esm/limel-icon.entry.js +4 -1
  153. package/dist/esm/limel-info-tile.entry.js +91 -0
  154. package/dist/esm/limel-input-field.entry.js +27 -60
  155. package/dist/esm/limel-list_2.entry.js +10 -21
  156. package/dist/esm/limel-menu-list.entry.js +7 -14
  157. package/dist/esm/limel-picker.entry.js +14 -39
  158. package/dist/esm/limel-popover_4.entry.js +13 -12
  159. package/dist/esm/limel-portal.entry.js +63 -73
  160. package/dist/esm/limel-progress-flow-item.entry.js +4 -13
  161. package/dist/esm/limel-progress-flow.entry.js +4 -20
  162. package/dist/esm/limel-select.entry.js +19 -31
  163. package/dist/esm/limel-shortcut.entry.js +48 -0
  164. package/dist/esm/limel-slider.entry.js +12 -33
  165. package/dist/esm/limel-snackbar.entry.js +7 -5
  166. package/dist/esm/limel-spinner.entry.js +1 -7
  167. package/dist/esm/limel-split-button.entry.js +31 -0
  168. package/dist/esm/limel-switch.entry.js +6 -19
  169. package/dist/esm/limel-tab-bar.entry.js +2 -5
  170. package/dist/esm/limel-tab-panel.entry.js +2 -5
  171. package/dist/esm/limel-table.entry.js +16 -28
  172. package/dist/esm/loader.js +3 -3
  173. package/dist/esm/polyfills/css-shim.js +1 -1
  174. package/dist/esm/{translations-682e905e.js → translations-0d0ee941.js} +6 -0
  175. package/dist/lime-elements/lime-elements.esm.js +1 -1
  176. package/dist/lime-elements/p-059e0a64.entry.js +1 -0
  177. package/dist/lime-elements/{p-440454ed.entry.js → p-06f2f6b4.entry.js} +1 -1
  178. package/dist/lime-elements/p-12a7453b.entry.js +73 -0
  179. package/dist/lime-elements/p-1386d86d.entry.js +82 -0
  180. package/dist/lime-elements/p-15c2eb16.entry.js +1 -0
  181. package/dist/lime-elements/{p-c80acfb2.entry.js → p-15ca0d70.entry.js} +4 -4
  182. package/dist/lime-elements/{p-ed65468d.entry.js → p-16eb9071.entry.js} +1 -1
  183. package/dist/lime-elements/{p-1ede893b.js → p-1af8258b.js} +1 -1
  184. package/dist/lime-elements/{p-71efe2ca.entry.js → p-21058db5.entry.js} +4 -3
  185. package/dist/lime-elements/p-246862ec.js +1 -0
  186. package/dist/lime-elements/p-36a3b897.entry.js +1 -0
  187. package/dist/lime-elements/p-4eda8b67.entry.js +82 -0
  188. package/dist/lime-elements/{p-9af0704c.entry.js → p-4fb4e89b.entry.js} +1 -1
  189. package/dist/lime-elements/p-4fc38050.entry.js +1 -0
  190. package/dist/lime-elements/{p-a5af84a7.entry.js → p-5338663b.entry.js} +1 -1
  191. package/dist/lime-elements/p-5ce60a32.entry.js +126 -0
  192. package/dist/lime-elements/p-5f13035a.entry.js +1 -0
  193. package/dist/lime-elements/p-5f29f099.entry.js +16 -0
  194. package/dist/lime-elements/p-600464a9.entry.js +1 -0
  195. package/dist/lime-elements/p-6534e16a.entry.js +1 -0
  196. package/dist/lime-elements/p-6a4a5ddd.entry.js +1 -0
  197. package/dist/lime-elements/p-6c38b505.entry.js +1 -0
  198. package/dist/lime-elements/p-75d01713.entry.js +1 -0
  199. package/dist/lime-elements/p-768b7cbb.entry.js +1 -0
  200. package/dist/lime-elements/{p-6e7809a6.entry.js → p-82cd7bb6.entry.js} +1 -1
  201. package/dist/lime-elements/p-84a137a7.entry.js +1 -0
  202. package/dist/lime-elements/{p-aa66620a.entry.js → p-8ab597a8.entry.js} +2 -2
  203. package/dist/lime-elements/{p-8827628d.entry.js → p-8fb83e83.entry.js} +2 -2
  204. package/dist/lime-elements/p-90961075.entry.js +1 -0
  205. package/dist/lime-elements/p-9984b31c.entry.js +1 -0
  206. package/dist/lime-elements/p-9bd76629.entry.js +59 -0
  207. package/dist/lime-elements/p-9ea8dd5c.entry.js +1 -0
  208. package/dist/lime-elements/p-cad7cda1.entry.js +16 -0
  209. package/dist/lime-elements/{p-104c89e8.entry.js → p-cfaa685f.entry.js} +1 -1
  210. package/dist/lime-elements/{p-94899019.entry.js → p-d1187867.entry.js} +1 -1
  211. package/dist/lime-elements/p-d4e788e1.js +2 -0
  212. package/dist/lime-elements/p-d512656b.entry.js +1 -0
  213. package/dist/lime-elements/p-d8e5a9ee.entry.js +1 -0
  214. package/dist/lime-elements/p-de161bb5.entry.js +1 -0
  215. package/dist/lime-elements/p-e4bca82b.entry.js +1 -0
  216. package/dist/lime-elements/p-e6f84d68.entry.js +1 -0
  217. package/dist/lime-elements/{p-c15da26d.entry.js → p-e7bb664f.entry.js} +1 -1
  218. package/dist/lime-elements/p-e88f7922.entry.js +1 -0
  219. package/dist/lime-elements/p-ec4c075d.entry.js +1 -0
  220. package/dist/lime-elements/p-f1ed857b.entry.js +37 -0
  221. package/dist/lime-elements/p-f33cfcb8.entry.js +11 -0
  222. package/dist/lime-elements/style/internal/z-index.scss +0 -5
  223. package/dist/loader/package.json +1 -0
  224. package/dist/types/components/circular-progress/circular-progress.d.ts +5 -0
  225. package/dist/types/components/dock/dock.d.ts +0 -1
  226. package/dist/types/components/info-tile/info-tile.d.ts +87 -0
  227. package/dist/types/components/info-tile/info-tile.types.d.ts +23 -0
  228. package/dist/types/components/picker/picker.d.ts +2 -2
  229. package/dist/types/components/shortcut/shortcut.d.ts +42 -0
  230. package/dist/types/components/split-button/split-button.d.ts +46 -0
  231. package/dist/types/components.d.ts +403 -67
  232. package/dist/types/global/shared-types/link.types.d.ts +25 -0
  233. package/dist/types/interface.d.ts +2 -0
  234. package/dist/types/stencil-public-runtime.d.ts +20 -4
  235. package/dist/types/translations/da.d.ts +1 -0
  236. package/dist/types/translations/en.d.ts +1 -0
  237. package/dist/types/translations/fi.d.ts +1 -0
  238. package/dist/types/translations/nl.d.ts +1 -0
  239. package/dist/types/translations/no.d.ts +1 -0
  240. package/dist/types/translations/sv.d.ts +1 -0
  241. package/package.json +21 -20
  242. package/dist/cjs/limel-circular-progress.cjs.entry.js +0 -44
  243. package/dist/cjs/limel-menu.cjs.entry.js +0 -137
  244. package/dist/esm/limel-circular-progress.entry.js +0 -40
  245. package/dist/esm/limel-menu.entry.js +0 -133
  246. package/dist/lime-elements/p-009de50e.entry.js +0 -1
  247. package/dist/lime-elements/p-19f72dab.entry.js +0 -1
  248. package/dist/lime-elements/p-2639edf9.entry.js +0 -73
  249. package/dist/lime-elements/p-2fc4f4ff.entry.js +0 -1
  250. package/dist/lime-elements/p-3b0c9885.entry.js +0 -37
  251. package/dist/lime-elements/p-3bf54a4c.js +0 -1
  252. package/dist/lime-elements/p-3cf4aae0.entry.js +0 -1
  253. package/dist/lime-elements/p-3f388717.entry.js +0 -11
  254. package/dist/lime-elements/p-41e902ac.entry.js +0 -126
  255. package/dist/lime-elements/p-4dc07252.entry.js +0 -82
  256. package/dist/lime-elements/p-53e01330.entry.js +0 -1
  257. package/dist/lime-elements/p-5ef52589.entry.js +0 -1
  258. package/dist/lime-elements/p-629862f4.entry.js +0 -1
  259. package/dist/lime-elements/p-63e25a0a.entry.js +0 -1
  260. package/dist/lime-elements/p-6b1bc80f.entry.js +0 -1
  261. package/dist/lime-elements/p-93cd2268.entry.js +0 -1
  262. package/dist/lime-elements/p-95f275ab.entry.js +0 -1
  263. package/dist/lime-elements/p-9917f042.entry.js +0 -16
  264. package/dist/lime-elements/p-995bbd2a.entry.js +0 -1
  265. package/dist/lime-elements/p-a465084b.entry.js +0 -82
  266. package/dist/lime-elements/p-b0046fcd.entry.js +0 -1
  267. package/dist/lime-elements/p-b0e54dc2.entry.js +0 -1
  268. package/dist/lime-elements/p-b4de3380.entry.js +0 -1
  269. package/dist/lime-elements/p-c59cbd68.entry.js +0 -1
  270. package/dist/lime-elements/p-d74fa89e.entry.js +0 -1
  271. package/dist/lime-elements/p-e98d76e8.entry.js +0 -59
  272. package/dist/lime-elements/p-e9a95b8f.js +0 -1
  273. package/dist/lime-elements/p-eec907ac.entry.js +0 -1
  274. package/dist/lime-elements/p-f0c9dadd.entry.js +0 -1
  275. package/dist/lime-elements/p-f0e872b6.entry.js +0 -16
  276. package/dist/lime-elements/p-f41567a1.entry.js +0 -1
  277. package/dist/lime-elements/p-f5df4d4f.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{r,c as t,h as n,g as i}from"./p-e9a95b8f.js";import{c as e,a as o}from"./p-eab67c09.js";var u=e((function(r){r.exports=function(){var r=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(r),i=/MSIE \d/.test(r),e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),o=/Edge\/(\d+)/.exec(r),u=i||e||o,a=u&&(i?document.documentMode||6:+(o||e)[1]),f=!o&&/WebKit\//.test(r),c=f&&/Qt\/\d+\.\d+/.test(r),l=!o&&/Chrome\//.test(r),s=/Opera\//.test(r),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),v=/PhantomJS/.test(r),m=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),p=/Android/.test(r),g=m||p||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),b=m||/Mac/.test(t),w=/\bCrOS\b/.test(r),C=/win/i.test(t),k=s&&r.match(/Version\/(\d*\.\d*)/);k&&(k=Number(k[1])),k&&k>=15&&(s=!1,f=!0);var M=b&&(c||s&&(null==k||k<12.11)),A=n||u&&a>=9;function y(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var x,L=function(r,t){var n=r.className,i=y(t).exec(n);if(i){var e=n.slice(i.index+i[0].length);r.className=n.slice(0,i.index)+(e?i[1]+e:"")}};function S(r){for(var t=r.childNodes.length;t>0;--t)r.removeChild(r.firstChild);return r}function N(r,t){return S(r).appendChild(t)}function E(r,t,n,i){var e=document.createElement(r);if(n&&(e.className=n),i&&(e.style.cssText=i),"string"==typeof t)e.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)e.appendChild(t[o]);return e}function D(r,t,n,i){var e=E(r,t,n,i);return e.setAttribute("role","presentation"),e}function T(r,t){if(3==t.nodeType&&(t=t.parentNode),r.contains)return r.contains(t);do{if(11==t.nodeType&&(t=t.host),t==r)return!0}while(t=t.parentNode)}function I(){var r;try{r=document.activeElement}catch(t){r=document.body||null}for(;r&&r.shadowRoot&&r.shadowRoot.activeElement;)r=r.shadowRoot.activeElement;return r}function O(r,t){var n=r.className;y(t).test(n)||(r.className+=(n?" ":"")+t)}function R(r,t){for(var n=r.split(" "),i=0;i<n.length;i++)n[i]&&!y(n[i]).test(t)&&(t+=" "+n[i]);return t}x=document.createRange?function(r,t,n,i){var e=document.createRange();return e.setEnd(i||r,n),e.setStart(r,t),e}:function(r,t,n){var i=document.body.createTextRange();try{i.moveToElementText(r.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var B=function(r){r.select()};function U(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function z(r,t,n){for(var i in t||(t={}),r)!r.hasOwnProperty(i)||!1===n&&t.hasOwnProperty(i)||(t[i]=r[i]);return t}function j(r,t,n,i,e){null==t&&-1==(t=r.search(/[^\s\u00a0]/))&&(t=r.length);for(var o=i||0,u=e||0;;){var a=r.indexOf("\t",o);if(a<0||a>=t)return u+(t-o);u+=a-o,u+=n-u%n,o=a+1}}m?B=function(r){r.selectionStart=0,r.selectionEnd=r.value.length}:u&&(B=function(r){try{r.select()}catch(r){}});var W=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};function F(r,t){for(var n=0;n<r.length;++n)if(r[n]==t)return n;return-1}W.prototype.onTimeout=function(r){r.id=0,r.time<=+new Date?r.f():setTimeout(r.handler,r.time-+new Date)},W.prototype.set=function(r,t){this.f=t;var n=+new Date+r;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,r),this.time=n)};var P={toString:function(){return"CodeMirror.Pass"}},G={scroll:!1},H={origin:"*mouse"},V={origin:"+move"};function $(r,t,n){for(var i=0,e=0;;){var o=r.indexOf("\t",i);-1==o&&(o=r.length);var u=o-i;if(o==r.length||e+u>=t)return i+Math.min(u,t-e);if(e+=o-i,i=o+1,(e+=n-e%n)>=t)return i}}var _=[""];function Q(r){for(;_.length<=r;)_.push(J(_)+" ");return _[r]}function J(r){return r[r.length-1]}function K(r,t){for(var n=[],i=0;i<r.length;i++)n[i]=t(r[i],i);return n}function Y(){}function X(r,t){var n;return Object.create?n=Object.create(r):(Y.prototype=r,n=new Y),t&&z(t,n),n}var q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Z(r){return/\w/.test(r)||r>"€"&&(r.toUpperCase()!=r.toLowerCase()||q.test(r))}function rr(r,t){return t?!!(t.source.indexOf("\\w")>-1&&Z(r))||t.test(r):Z(r)}function tr(r){for(var t in r)if(r.hasOwnProperty(t)&&r[t])return!1;return!0}var nr=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ir(r){return r.charCodeAt(0)>=768&&nr.test(r)}function er(r,t,n){for(;(n<0?t>0:t<r.length)&&ir(r.charAt(t));)t+=n;return t}function or(r,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var e=(t+n)/2,o=i<0?Math.ceil(e):Math.floor(e);if(o==t)return r(o)?t:n;r(o)?n=o:t=o+i}}var ur=null;function ar(r,t,n){var i;ur=null;for(var e=0;e<r.length;++e){var o=r[e];if(o.from<t&&o.to>t)return e;o.to==t&&(o.from!=o.to&&"before"==n?i=e:ur=e),o.from==t&&(o.from!=o.to&&"before"!=n?i=e:ur=e)}return null!=i?i:ur}var fr=function(){var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,e=/[1n]/;function o(r,t,n){this.level=r,this.from=t,this.to=n}return function(u,a){var f,c="ltr"==a?"L":"R";if(0==u.length||"ltr"==a&&!r.test(u))return!1;for(var l=u.length,s=[],h=0;h<l;++h)s.push((f=u.charCodeAt(h))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(f):1424<=f&&f<=1524?"R":1536<=f&&f<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(f-1536):1774<=f&&f<=2220?"r":8192<=f&&f<=8203?"w":8204==f?"b":"L");for(var d=0,v=c;d<l;++d){var m=s[d];"m"==m?s[d]=v:v=m}for(var p=0,g=c;p<l;++p){var b=s[p];"1"==b&&"r"==g?s[p]="n":n.test(b)&&(g=b,"r"==b&&(s[p]="R"))}for(var w=1,C=s[0];w<l-1;++w){var k=s[w];"+"==k&&"1"==C&&"1"==s[w+1]?s[w]="1":","!=k||C!=s[w+1]||"1"!=C&&"n"!=C||(s[w]=C),C=k}for(var M=0;M<l;++M){var A=s[M];if(","==A)s[M]="N";else if("%"==A){var y=void 0;for(y=M+1;y<l&&"%"==s[y];++y);for(var x=M&&"!"==s[M-1]||y<l&&"1"==s[y]?"1":"N",L=M;L<y;++L)s[L]=x;M=y-1}}for(var S=0,N=c;S<l;++S){var E=s[S];"L"==N&&"1"==E?s[S]="L":n.test(E)&&(N=E)}for(var D=0;D<l;++D)if(t.test(s[D])){var T=void 0;for(T=D+1;T<l&&t.test(s[T]);++T);for(var I="L"==(D?s[D-1]:c),O=I==("L"==(T<l?s[T]:c))?I?"L":"R":c,R=D;R<T;++R)s[R]=O;D=T-1}for(var B,U=[],z=0;z<l;)if(i.test(s[z])){var j=z;for(++z;z<l&&i.test(s[z]);++z);U.push(new o(0,j,z))}else{var W=z,F=U.length,P="rtl"==a?1:0;for(++z;z<l&&"L"!=s[z];++z);for(var G=W;G<z;)if(e.test(s[G])){W<G&&(U.splice(F,0,new o(1,W,G)),F+=P);var H=G;for(++G;G<z&&e.test(s[G]);++G);U.splice(F,0,new o(2,H,G)),F+=P,W=G}else++G;W<z&&U.splice(F,0,new o(1,W,z))}return"ltr"==a&&(1==U[0].level&&(B=u.match(/^\s+/))&&(U[0].from=B[0].length,U.unshift(new o(0,0,B[0].length))),1==J(U).level&&(B=u.match(/\s+$/))&&(J(U).to-=B[0].length,U.push(new o(0,l-B[0].length,l)))),"rtl"==a?U.reverse():U}}();function cr(r,t){var n=r.order;return null==n&&(n=r.order=fr(r.text,t)),n}var lr=[],sr=function(r,t,n){if(r.addEventListener)r.addEventListener(t,n,!1);else if(r.attachEvent)r.attachEvent("on"+t,n);else{var i=r._handlers||(r._handlers={});i[t]=(i[t]||lr).concat(n)}};function hr(r,t){return r._handlers&&r._handlers[t]||lr}function dr(r,t,n){if(r.removeEventListener)r.removeEventListener(t,n,!1);else if(r.detachEvent)r.detachEvent("on"+t,n);else{var i=r._handlers,e=i&&i[t];if(e){var o=F(e,n);o>-1&&(i[t]=e.slice(0,o).concat(e.slice(o+1)))}}}function vr(r,t){var n=hr(r,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),e=0;e<n.length;++e)n[e].apply(null,i)}function mr(r,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),vr(r,n||t.type,r,t),kr(t)||t.codemirrorIgnore}function pr(r){var t=r._handlers&&r._handlers.cursorActivity;if(t)for(var n=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==F(n,t[i])&&n.push(t[i])}function gr(r,t){return hr(r,t).length>0}function br(r){r.prototype.on=function(r,t){sr(this,r,t)},r.prototype.off=function(r,t){dr(this,r,t)}}function wr(r){r.preventDefault?r.preventDefault():r.returnValue=!1}function Cr(r){r.stopPropagation?r.stopPropagation():r.cancelBubble=!0}function kr(r){return null!=r.defaultPrevented?r.defaultPrevented:0==r.returnValue}function Mr(r){wr(r),Cr(r)}function Ar(r){return r.target||r.srcElement}function yr(r){var t=r.which;return null==t&&(1&r.button?t=1:2&r.button?t=3:4&r.button&&(t=2)),b&&r.ctrlKey&&1==t&&(t=3),t}var xr,Lr,Sr=function(){if(u&&a<9)return!1;var r=E("div");return"draggable"in r||"dragDrop"in r}();function Nr(r){if(null==xr){var t=E("span","​");N(r,E("span",[t,document.createTextNode("x")])),0!=r.firstChild.offsetHeight&&(xr=t.offsetWidth<=1&&t.offsetHeight>2&&!(u&&a<8))}var n=xr?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Er(r){if(null!=Lr)return Lr;var t=N(r,document.createTextNode("AخA")),n=x(t,0,1).getBoundingClientRect(),i=x(t,1,2).getBoundingClientRect();return S(r),!(!n||n.left==n.right)&&(Lr=i.right-n.right<3)}var Dr,Tr=3!="\n\nb".split(/\n/).length?function(r){for(var t=0,n=[],i=r.length;t<=i;){var e=r.indexOf("\n",t);-1==e&&(e=r.length);var o=r.slice(t,"\r"==r.charAt(e-1)?e-1:e),u=o.indexOf("\r");-1!=u?(n.push(o.slice(0,u)),t+=u+1):(n.push(o),t=e+1)}return n}:function(r){return r.split(/\r\n?|\n/)},Ir=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return!1}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}return!(!t||t.parentElement()!=r)&&0!=t.compareEndPoints("StartToEnd",t)},Or="oncopy"in(Dr=E("div"))||(Dr.setAttribute("oncopy","return;"),"function"==typeof Dr.oncopy),Rr=null;var Br={},Ur={};function zr(r,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Br[r]=t}function jr(r){if("string"==typeof r&&Ur.hasOwnProperty(r))r=Ur[r];else if(r&&"string"==typeof r.name&&Ur.hasOwnProperty(r.name)){var t=Ur[r.name];"string"==typeof t&&(t={name:t}),(r=X(t,r)).name=t.name}else{if("string"==typeof r&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r))return jr("application/xml");if("string"==typeof r&&/^[\w\-]+\/[\w\-]+\+json$/.test(r))return jr("application/json")}return"string"==typeof r?{name:r}:r||{name:"null"}}function Wr(r,t){t=jr(t);var n=Br[t.name];if(!n)return Wr(r,"text/plain");var i=n(r,t);if(Fr.hasOwnProperty(t.name)){var e=Fr[t.name];for(var o in e)e.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=e[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var u in t.modeProps)i[u]=t.modeProps[u];return i}var Fr={};function Pr(r,t){z(t,Fr.hasOwnProperty(r)?Fr[r]:Fr[r]={})}function Gr(r,t){if(!0===t)return t;if(r.copyState)return r.copyState(t);var n={};for(var i in t){var e=t[i];e instanceof Array&&(e=e.concat([])),n[i]=e}return n}function Hr(r,t){for(var n;r.innerMode&&(n=r.innerMode(t))&&n.mode!=r;)t=n.state,r=n.mode;return n||{mode:r,state:t}}function Vr(r,t,n){return!r.startState||r.startState(t,n)}var $r=function(r,t,n){this.pos=this.start=0,this.string=r,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function _r(r,t){if((t-=r.first)<0||t>=r.size)throw new Error("There is no line "+(t+r.first)+" in the document.");for(var n=r;!n.lines;)for(var i=0;;++i){var e=n.children[i],o=e.chunkSize();if(t<o){n=e;break}t-=o}return n.lines[t]}function Qr(r,t,n){var i=[],e=t.line;return r.iter(t.line,n.line+1,(function(r){var o=r.text;e==n.line&&(o=o.slice(0,n.ch)),e==t.line&&(o=o.slice(t.ch)),i.push(o),++e})),i}function Jr(r,t,n){var i=[];return r.iter(t,n,(function(r){i.push(r.text)})),i}function Kr(r,t){var n=t-r.height;if(n)for(var i=r;i;i=i.parent)i.height+=n}function Yr(r){if(null==r.parent)return null;for(var t=r.parent,n=F(t.lines,r),i=t.parent;i;t=i,i=i.parent)for(var e=0;i.children[e]!=t;++e)n+=i.children[e].chunkSize();return n+t.first}function Xr(r,t){var n=r.first;r:do{for(var i=0;i<r.children.length;++i){var e=r.children[i],o=e.height;if(t<o){r=e;continue r}t-=o,n+=e.chunkSize()}return n}while(!r.lines);for(var u=0;u<r.lines.length;++u){var a=r.lines[u].height;if(t<a)break;t-=a}return n+u}function qr(r,t){return t>=r.first&&t<r.first+r.size}function Zr(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function rt(r,t,n){if(void 0===n&&(n=null),!(this instanceof rt))return new rt(r,t,n);this.line=r,this.ch=t,this.sticky=n}function tt(r,t){return r.line-t.line||r.ch-t.ch}function nt(r,t){return r.sticky==t.sticky&&0==tt(r,t)}function it(r){return rt(r.line,r.ch)}function et(r,t){return tt(r,t)<0?t:r}function ot(r,t){return tt(r,t)<0?r:t}function ut(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function at(r,t){if(t.line<r.first)return rt(r.first,0);var n=r.first+r.size-1;return t.line>n?rt(n,_r(r,n).text.length):function(r,t){var n=r.ch;return null==n||n>t?rt(r.line,t):n<0?rt(r.line,0):r}(t,_r(r,t.line).text.length)}function ft(r,t){for(var n=[],i=0;i<t.length;i++)n[i]=at(r,t[i]);return n}$r.prototype.eol=function(){return this.pos>=this.string.length},$r.prototype.sol=function(){return this.pos==this.lineStart},$r.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$r.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$r.prototype.eat=function(r){var t=this.string.charAt(this.pos);if("string"==typeof r?t==r:t&&(r.test?r.test(t):r(t)))return++this.pos,t},$r.prototype.eatWhile=function(r){for(var t=this.pos;this.eat(r););return this.pos>t},$r.prototype.eatSpace=function(){for(var r=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>r},$r.prototype.skipToEnd=function(){this.pos=this.string.length},$r.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1)return this.pos=t,!0},$r.prototype.backUp=function(r){this.pos-=r},$r.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},$r.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},$r.prototype.match=function(r,t,n){if("string"!=typeof r){var i=this.string.slice(this.pos).match(r);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var e=function(r){return n?r.toLowerCase():r};if(e(this.string.substr(this.pos,r.length))==e(r))return!1!==t&&(this.pos+=r.length),!0},$r.prototype.current=function(){return this.string.slice(this.start,this.pos)},$r.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}},$r.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)},$r.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};var ct=function(r,t){this.state=r,this.lookAhead=t},lt=function(r,t,n,i){this.state=t,this.doc=r,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function st(r,t,n,i){var e=[r.state.modeGen],o={};Ct(r,t.text,r.doc.mode,n,(function(r,t){return e.push(r,t)}),o,i);for(var u=n.state,a=function(i){n.baseTokens=e;var a=r.state.overlays[i],f=1,c=0;n.state=!0,Ct(r,t.text,a.mode,n,(function(r,t){for(var n=f;c<r;){var i=e[f];i>r&&e.splice(f,1,r,e[f+1],i),f+=2,c=Math.min(r,i)}if(t)if(a.opaque)e.splice(n,f-n,r,"overlay "+t),f=n+2;else for(;n<f;n+=2){var o=e[n+1];e[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=u,n.baseTokens=null,n.baseTokenPos=1},f=0;f<r.state.overlays.length;++f)a(f);return{styles:e,classes:o.bgClass||o.textClass?o:null}}function ht(r,t,n){if(!t.styles||t.styles[0]!=r.state.modeGen){var i=dt(r,Yr(t)),e=t.text.length>r.options.maxHighlightLength&&Gr(r.doc.mode,i.state),o=st(r,t,i);e&&(i.state=e),t.stateAfter=i.save(!e),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===r.doc.highlightFrontier&&(r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier))}return t.styles}function dt(r,t,n){var i=r.doc,e=r.display;if(!i.mode.startState)return new lt(i,!0,t);var o=function(r,t,n){for(var i,e,o=r.doc,u=n?-1:t-(r.doc.mode.innerMode?1e3:100),a=t;a>u;--a){if(a<=o.first)return o.first;var f=_r(o,a-1),c=f.stateAfter;if(c&&(!n||a+(c instanceof ct?c.lookAhead:0)<=o.modeFrontier))return a;var l=j(f.text,null,r.options.tabSize);(null==e||i>l)&&(e=a-1,i=l)}return e}(r,t,n),u=o>i.first&&_r(i,o-1).stateAfter,a=u?lt.fromSaved(i,u,o):new lt(i,Vr(i.mode),o);return i.iter(o,t,(function(n){vt(r,n.text,a);var i=a.line;n.stateAfter=i==t-1||i%5==0||i>=e.viewFrom&&i<e.viewTo?a.save():null,a.nextLine()})),n&&(i.modeFrontier=a.line),a}function vt(r,t,n,i){var e=r.doc.mode,o=new $r(t,r.options.tabSize,n);for(o.start=o.pos=i||0,""==t&&mt(e,n.state);!o.eol();)pt(e,o,n.state),o.start=o.pos}function mt(r,t){if(r.blankLine)return r.blankLine(t);if(r.innerMode){var n=Hr(r,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function pt(r,t,n,i){for(var e=0;e<10;e++){i&&(i[0]=Hr(r,n).mode);var o=r.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+r.name+" failed to advance stream.")}lt.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);return null!=t&&r>this.maxLookAhead&&(this.maxLookAhead=r),t},lt.prototype.baseToken=function(r){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=r;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}},lt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},lt.fromSaved=function(r,t,n){return t instanceof ct?new lt(r,Gr(r.mode,t.state),n,t.lookAhead):new lt(r,Gr(r.mode,t),n)},lt.prototype.save=function(r){var t=!1!==r?Gr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(r,t,n){this.start=r.start,this.end=r.pos,this.string=r.current(),this.type=t||null,this.state=n};function bt(r,t,n,i){var e,o,u=r.doc,a=u.mode,f=_r(u,(t=at(u,t)).line),c=dt(r,t.line,n),l=new $r(f.text,r.options.tabSize,c);for(i&&(o=[]);(i||l.pos<t.ch)&&!l.eol();)l.start=l.pos,e=pt(a,l,c.state),i&&o.push(new gt(l,e,Gr(u.mode,c.state)));return i?o:new gt(l,e,c.state)}function wt(r,t){if(r)for(;;){var n=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;r=r.slice(0,n.index)+r.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return r}function Ct(r,t,n,i,e,o,u){var a=n.flattenSpans;null==a&&(a=r.options.flattenSpans);var f,c=0,l=null,s=new $r(t,r.options.tabSize,i),h=r.options.addModeClass&&[null];for(""==t&&wt(mt(n,i.state),o);!s.eol();){if(s.pos>r.options.maxHighlightLength?(a=!1,u&&vt(r,t,i,s.pos),s.pos=t.length,f=null):f=wt(pt(n,s,i.state,h),o),h){var d=h[0].name;d&&(f="m-"+(f?d+" "+f:d))}if(!a||l!=f){for(;c<s.start;)e(c=Math.min(s.start,c+5e3),l);l=f}s.start=s.pos}for(;c<s.pos;){var v=Math.min(s.pos,c+5e3);e(v,l),c=v}}var kt=!1,Mt=!1;function At(r,t,n){this.marker=r,this.from=t,this.to=n}function yt(r,t){if(r)for(var n=0;n<r.length;++n){var i=r[n];if(i.marker==t)return i}}function xt(r,t){for(var n,i=0;i<r.length;++i)r[i]!=t&&(n||(n=[])).push(r[i]);return n}function Lt(r,t){if(t.full)return null;var n=qr(r,t.from.line)&&_r(r,t.from.line).markedSpans,i=qr(r,t.to.line)&&_r(r,t.to.line).markedSpans;if(!n&&!i)return null;var e=t.from.ch,o=t.to.ch,u=0==tt(t.from,t.to),a=function(r,t,n){var i;if(r)for(var e=0;e<r.length;++e){var o=r[e],u=o.marker;null!=o.from&&!(u.inclusiveLeft?o.from<=t:o.from<t)&&(o.from!=t||"bookmark"!=u.type||n&&o.marker.insertLeft)||(i||(i=[])).push(new At(u,o.from,null==o.to||(u.inclusiveRight?o.to>=t:o.to>t)?null:o.to))}return i}(n,e,u),f=function(r,t,n){var i;if(r)for(var e=0;e<r.length;++e){var o=r[e],u=o.marker;(null==o.to||(u.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==u.type&&(!n||o.marker.insertLeft))&&(i||(i=[])).push(new At(u,null==o.from||(u.inclusiveLeft?o.from<=t:o.from<t)?null:o.from-t,null==o.to?null:o.to-t))}return i}(i,o,u),c=1==t.text.length,l=J(t.text).length+(c?e:0);if(a)for(var s=0;s<a.length;++s){var h=a[s];if(null==h.to){var d=yt(f,h.marker);d?c&&(h.to=null==d.to?null:d.to+l):h.to=e}}if(f)for(var v=0;v<f.length;++v){var m=f[v];null!=m.to&&(m.to+=l),null==m.from?yt(a,m.marker)||(m.from=l,c&&(a||(a=[])).push(m)):(m.from+=l,c&&(a||(a=[])).push(m))}a&&(a=St(a)),f&&f!=a&&(f=St(f));var p=[a];if(!c){var g,b=t.text.length-2;if(b>0&&a)for(var w=0;w<a.length;++w)null==a[w].to&&(g||(g=[])).push(new At(a[w].marker,null,null));for(var C=0;C<b;++C)p.push(g);p.push(f)}return p}function St(r){for(var t=0;t<r.length;++t){var n=r[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&r.splice(t--,1)}return r.length?r:null}function Nt(r){var t=r.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(r);r.markedSpans=null}}function Et(r,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(r);r.markedSpans=t}}function Dt(r){return r.inclusiveLeft?-1:0}function Tt(r){return r.inclusiveRight?1:0}function It(r,t){var n=r.lines.length-t.lines.length;if(0!=n)return n;var i=r.find(),e=t.find(),o=tt(i.from,e.from)||Dt(r)-Dt(t);return o?-o:tt(i.to,e.to)||Tt(r)-Tt(t)||t.id-r.id}function Ot(r,t){var n,i=Mt&&r.markedSpans;if(i)for(var e=void 0,o=0;o<i.length;++o)(e=i[o]).marker.collapsed&&null==(t?e.from:e.to)&&(!n||It(n,e.marker)<0)&&(n=e.marker);return n}function Rt(r){return Ot(r,!0)}function Bt(r){return Ot(r,!1)}function Ut(r,t){var n,i=Mt&&r.markedSpans;if(i)for(var e=0;e<i.length;++e){var o=i[e];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||It(n,o.marker)<0)&&(n=o.marker)}return n}function zt(r,t,n,i,e){var o=_r(r,t),u=Mt&&o.markedSpans;if(u)for(var a=0;a<u.length;++a){var f=u[a];if(f.marker.collapsed){var c=f.marker.find(0),l=tt(c.from,n)||Dt(f.marker)-Dt(e),s=tt(c.to,i)||Tt(f.marker)-Tt(e);if(!(l>=0&&s<=0||l<=0&&s>=0)&&(l<=0&&(f.marker.inclusiveRight&&e.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||l>=0&&(f.marker.inclusiveRight&&e.inclusiveLeft?tt(c.from,i)<=0:tt(c.from,i)<0)))return!0}}}function jt(r){for(var t;t=Rt(r);)r=t.find(-1,!0).line;return r}function Wt(r,t){var n=_r(r,t),i=jt(n);return n==i?t:Yr(i)}function Ft(r,t){if(t>r.lastLine())return t;var n,i=_r(r,t);if(!Pt(r,i))return t;for(;n=Bt(i);)i=n.find(1,!0).line;return Yr(i)+1}function Pt(r,t){var n=Mt&&t.markedSpans;if(n)for(var i=void 0,e=0;e<n.length;++e)if((i=n[e]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&Gt(r,t,i))return!0}}function Gt(r,t,n){if(null==n.to){var i=n.marker.find(1,!0);return Gt(r,i.line,yt(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var e=void 0,o=0;o<t.markedSpans.length;++o)if((e=t.markedSpans[o]).marker.collapsed&&!e.marker.widgetNode&&e.from==n.to&&(null==e.to||e.to!=n.from)&&(e.marker.inclusiveLeft||n.marker.inclusiveRight)&&Gt(r,t,e))return!0}function Ht(r){for(var t=0,n=(r=jt(r)).parent,i=0;i<n.lines.length;++i){var e=n.lines[i];if(e==r)break;t+=e.height}for(var o=n.parent;o;o=(n=o).parent)for(var u=0;u<o.children.length;++u){var a=o.children[u];if(a==n)break;t+=a.height}return t}function Vt(r){if(0==r.height)return 0;for(var t,n=r.text.length,i=r;t=Rt(i);){var e=t.find(0,!0);i=e.from.line,n+=e.from.ch-e.to.ch}for(i=r;t=Bt(i);){var o=t.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function $t(r){var t=r.display,n=r.doc;t.maxLine=_r(n,n.first),t.maxLineLength=Vt(t.maxLine),t.maxLineChanged=!0,n.iter((function(r){var n=Vt(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)}))}var _t=function(r,t,n){this.text=r,Et(this,t),this.height=n?n(this):1};function Qt(r){r.parent=null,Nt(r)}_t.prototype.lineNo=function(){return Yr(this)},br(_t);var Jt={},Kt={};function Yt(r,t){if(!r||/^\s*$/.test(r))return null;var n=t.addModeClass?Kt:Jt;return n[r]||(n[r]=r.replace(/\S+/g,"cm-$&"))}function Xt(r,t){var n=D("span",null,null,f?"padding-right: .1px":null),i={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:r,trailingSpace:!1,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var e=0;e<=(t.rest?t.rest.length:0);e++){var o=e?t.rest[e-1]:t.line,u=void 0;i.pos=0,i.addToken=Zt,Er(r.display.measure)&&(u=cr(o,r.doc.direction))&&(i.addToken=rn(i.addToken,u)),i.map=[],nn(o,i,ht(r,o,t!=r.display.externalMeasured&&Yr(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=R(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=R(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Nr(r.display.measure))),0==e?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(f){var a=i.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return vr(r,"renderLine",r,t.line,i.pre),i.pre.className&&(i.textClass=R(i.pre.className,i.textClass||"")),i}function qt(r){var t=E("span","•","cm-invalidchar");return t.title="\\u"+r.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(r,t,n,i,e,o,f){if(t){var c,l=r.splitSpaces?function(r,t){if(r.length>1&&!/ /.test(r))return r;for(var n=t,i="",e=0;e<r.length;e++){var o=r.charAt(e);" "!=o||!n||e!=r.length-1&&32!=r.charCodeAt(e+1)||(o=" "),i+=o,n=" "==o}return i}(t,r.trailingSpace):t,s=r.cm.state.specialChars,h=!1;if(s.test(t)){c=document.createDocumentFragment();for(var d=0;;){s.lastIndex=d;var v=s.exec(t),m=v?v.index-d:t.length-d;if(m){var p=document.createTextNode(l.slice(d,d+m));c.appendChild(u&&a<9?E("span",[p]):p),r.map.push(r.pos,r.pos+m,p),r.col+=m,r.pos+=m}if(!v)break;d+=m+1;var g=void 0;if("\t"==v[0]){var b=r.cm.options.tabSize,w=b-r.col%b;(g=c.appendChild(E("span",Q(w),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),r.col+=w}else"\r"==v[0]||"\n"==v[0]?((g=c.appendChild(E("span","\r"==v[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",v[0]),r.col+=1):((g=r.cm.options.specialCharPlaceholder(v[0])).setAttribute("cm-text",v[0]),c.appendChild(u&&a<9?E("span",[g]):g),r.col+=1);r.map.push(r.pos,r.pos+1,g),r.pos++}}else r.col+=t.length,c=document.createTextNode(l),r.map.push(r.pos,r.pos+t.length,c),u&&a<9&&(h=!0),r.pos+=t.length;if(r.trailingSpace=32==l.charCodeAt(t.length-1),n||i||e||h||o||f){var C=n||"";i&&(C+=i),e&&(C+=e);var k=E("span",[c],C,o);if(f)for(var M in f)f.hasOwnProperty(M)&&"style"!=M&&"class"!=M&&k.setAttribute(M,f[M]);return r.content.appendChild(k)}r.content.appendChild(c)}}function rn(r,t){return function(n,i,e,o,u,a,f){e=e?e+" cm-force-border":"cm-force-border";for(var c=n.pos,l=c+i.length;;){for(var s=void 0,h=0;h<t.length&&!((s=t[h]).to>c&&s.from<=c);h++);if(s.to>=l)return r(n,i,e,o,u,a,f);r(n,i.slice(0,s.to-c),e,o,null,a,f),o=null,i=i.slice(s.to-c),c=s.to}}}function tn(r,t,n,i){var e=!i&&n.widgetNode;e&&r.map.push(r.pos,r.pos+t,e),!i&&r.cm.display.input.needsContentAttribute&&(e||(e=r.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",n.id)),e&&(r.cm.display.input.setUneditable(e),r.content.appendChild(e)),r.pos+=t,r.trailingSpace=!1}function nn(r,t,n){var i=r.markedSpans,e=r.text,o=0;if(i)for(var u,a,f,c,l,s,h,d=e.length,v=0,m=1,p="",g=0;;){if(g==v){f=c=l=a="",h=null,s=null,g=1/0;for(var b=[],w=void 0,C=0;C<i.length;++C){var k=i[C],M=k.marker;if("bookmark"==M.type&&k.from==v&&M.widgetNode)b.push(M);else if(k.from<=v&&(null==k.to||k.to>v||M.collapsed&&k.to==v&&k.from==v)){if(null!=k.to&&k.to!=v&&g>k.to&&(g=k.to,c=""),M.className&&(f+=" "+M.className),M.css&&(a=(a?a+";":"")+M.css),M.startStyle&&k.from==v&&(l+=" "+M.startStyle),M.endStyle&&k.to==g&&(w||(w=[])).push(M.endStyle,k.to),M.title&&((h||(h={})).title=M.title),M.attributes)for(var A in M.attributes)(h||(h={}))[A]=M.attributes[A];M.collapsed&&(!s||It(s.marker,M)<0)&&(s=k)}else k.from>v&&g>k.from&&(g=k.from)}if(w)for(var y=0;y<w.length;y+=2)w[y+1]==g&&(c+=" "+w[y]);if(!s||s.from==v)for(var x=0;x<b.length;++x)tn(t,0,b[x]);if(s&&(s.from||0)==v){if(tn(t,(null==s.to?d+1:s.to)-v,s.marker,null==s.from),null==s.to)return;s.to==v&&(s=!1)}}if(v>=d)break;for(var L=Math.min(d,g);;){if(p){var S=v+p.length;if(!s){var N=S>L?p.slice(0,L-v):p;t.addToken(t,N,u?u+f:f,l,v+N.length==g?c:"",a,h)}if(S>=L){p=p.slice(L-v),v=L;break}v=S,l=""}p=e.slice(o,o=n[m++]),u=Yt(n[m++],t.cm.options)}}else for(var E=1;E<n.length;E+=2)t.addToken(t,e.slice(o,o=n[E]),Yt(n[E+1],t.cm.options))}function en(r,t,n){this.line=t,this.rest=function(r){for(var t,n;t=Bt(r);)r=t.find(1,!0).line,(n||(n=[])).push(r);return n}(t),this.size=this.rest?Yr(J(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Pt(r,t)}function on(r,t,n){for(var i,e=[],o=t;o<n;o=i){var u=new en(r.doc,_r(r.doc,o),o);i=o+u.size,e.push(u)}return e}var un=null;var an=null;function fn(r,t){var n=hr(r,t);if(n.length){var i,e=Array.prototype.slice.call(arguments,2);un?i=un.delayedCallbacks:an?i=an:(i=an=[],setTimeout(cn,0));for(var o=function(r){i.push((function(){return n[r].apply(null,e)}))},u=0;u<n.length;++u)o(u)}}function cn(){var r=an;an=null;for(var t=0;t<r.length;++t)r[t]()}function ln(r,t,n,i){for(var e=0;e<t.changes.length;e++){var o=t.changes[e];"text"==o?dn(r,t):"gutter"==o?mn(r,t,n,i):"class"==o?vn(r,t):"widget"==o&&pn(r,t,i)}t.changes=null}function sn(r){return r.node==r.text&&(r.node=E("div",null,null,"position: relative"),r.text.parentNode&&r.text.parentNode.replaceChild(r.node,r.text),r.node.appendChild(r.text),u&&a<8&&(r.node.style.zIndex=2)),r.node}function hn(r,t){var n=r.display.externalMeasured;return n&&n.line==t.line?(r.display.externalMeasured=null,t.measure=n.measure,n.built):Xt(r,t)}function dn(r,t){var n=t.text.className,i=hn(r,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,vn(r,t)):n&&(t.text.className=n)}function vn(r,t){(function(r,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=sn(t);t.background=i.insertBefore(E("div",null,n),i.firstChild),r.display.input.setUneditable(t.background)}})(r,t),t.line.wrapClass?sn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=""),t.text.className=(t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass)||""}function mn(r,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var e=sn(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),r.display.input.setUneditable(t.gutterBackground),e.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var u=sn(t),a=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),r.display.input.setUneditable(a),u.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!r.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(E("div",Zr(r.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))),o)for(var f=0;f<r.display.gutterSpecs.length;++f){var c=r.display.gutterSpecs[f].className,l=o.hasOwnProperty(c)&&o[c];l&&a.appendChild(E("div",[l],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function pn(r,t,n){t.alignable&&(t.alignable=null);for(var i=y("CodeMirror-linewidget"),e=t.node.firstChild,o=void 0;e;e=o)o=e.nextSibling,i.test(e.className)&&t.node.removeChild(e);bn(r,t,n)}function gn(r,t,n,i){var e=hn(r,t);return t.text=t.node=e.pre,e.bgClass&&(t.bgClass=e.bgClass),e.textClass&&(t.textClass=e.textClass),vn(r,t),mn(r,t,n,i),bn(r,t,i),t.node}function bn(r,t,n){if(wn(r,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)wn(r,t.rest[i],t,n,!1)}function wn(r,t,n,i,e){if(t.widgets)for(var o=sn(n),u=0,a=t.widgets;u<a.length;++u){var f=a[u],c=E("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));f.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Cn(f,c,n,i),r.display.input.setUneditable(c),e&&f.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),fn(f,"redraw")}}function Cn(r,t,n,i){if(r.noHScroll){(n.alignable||(n.alignable=[])).push(t);var e=i.wrapperWidth;t.style.left=i.fixedPos+"px",r.coverGutter||(e-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=e+"px"}r.coverGutter&&(t.style.zIndex=5,t.style.position="relative",r.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function kn(r){if(null!=r.height)return r.height;var t=r.doc.cm;if(!t)return 0;if(!T(document.body,r.node)){var n="position: relative;";r.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),r.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,E("div",[r.node],null,n))}return r.height=r.node.parentNode.offsetHeight}function Mn(r,t){for(var n=Ar(t);n!=r.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==r.sizer&&n!=r.mover)return!0}function An(r){return r.lineSpace.offsetTop}function yn(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function xn(r){if(r.cachedPaddingH)return r.cachedPaddingH;var t=N(r.measure,E("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(r.cachedPaddingH=i),i}function Ln(r){return 50-r.display.nativeBarWidth}function Sn(r){return r.display.scroller.clientWidth-Ln(r)-r.display.barWidth}function Nn(r){return r.display.scroller.clientHeight-Ln(r)-r.display.barHeight}function En(r,t,n){if(r.line==t)return{map:r.measure.map,cache:r.measure.cache};if(r.rest){for(var i=0;i<r.rest.length;i++)if(r.rest[i]==t)return{map:r.measure.maps[i],cache:r.measure.caches[i]};for(var e=0;e<r.rest.length;e++)if(Yr(r.rest[e])>n)return{map:r.measure.maps[e],cache:r.measure.caches[e],before:!0}}}function Dn(r,t,n,i){return On(r,In(r,t),n,i)}function Tn(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo)return r.display.view[li(r,t)];var n=r.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function In(r,t){var n=Yr(t),i=Tn(r,n);i&&!i.text?i=null:i&&i.changes&&(ln(r,i,n,oi(r)),r.curOp.forceUpdate=!0),i||(i=function(r,t){var n=Yr(t=jt(t)),i=r.display.externalMeasured=new en(r.doc,t,n);i.lineN=n;var e=i.built=Xt(r,i);return i.text=e.pre,N(r.display.lineMeasure,e.pre),i}(r,t));var e=En(i,t,n);return{line:t,view:i,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function On(r,t,n,i,e){t.before&&(n=-1);var o,f=n+(i||"");return t.cache.hasOwnProperty(f)?o=t.cache[f]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(r,t,n){var i=r.options.lineWrapping,e=i&&Sn(r);if(!t.measure.heights||i&&t.measure.width!=e){var o=t.measure.heights=[];if(i){t.measure.width=e;for(var u=t.text.firstChild.getClientRects(),a=0;a<u.length-1;a++){var f=u[a],c=u[a+1];Math.abs(f.bottom-c.bottom)>2&&o.push((f.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(r,t.view,t.rect),t.hasHeights=!0),(o=function(r,t,n,i){var e,o=Un(t.map,n,i),f=o.node,c=o.start,l=o.end,s=o.collapse;if(3==f.nodeType){for(var h=0;h<4;h++){for(;c&&ir(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+l<o.coverEnd&&ir(t.line.text.charAt(o.coverStart+l));)++l;if((e=u&&a<9&&0==c&&l==o.coverEnd-o.coverStart?f.parentNode.getBoundingClientRect():zn(x(f,c,l).getClientRects(),i)).left||e.right||0==c)break;l=c,c-=1,s="right"}u&&a<11&&(e=function(r,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(r){if(null!=Rr)return Rr;var t=N(r,E("span","x")),n=t.getBoundingClientRect(),i=x(t,0,1).getBoundingClientRect();return Rr=Math.abs(n.left-i.left)>1}(r))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(r.display.measure,e))}else{var d;c>0&&(s=i="right"),e=r.options.lineWrapping&&(d=f.getClientRects()).length>1?d["right"==i?d.length-1:0]:f.getBoundingClientRect()}if(u&&a<9&&!c&&(!e||!e.left&&!e.right)){var v=f.parentNode.getClientRects()[0];e=v?{left:v.left,right:v.left+ei(r.display),top:v.top,bottom:v.bottom}:Bn}for(var m=e.top-t.rect.top,p=e.bottom-t.rect.top,g=(m+p)/2,b=t.view.measure.heights,w=0;w<b.length-1&&!(g<b[w]);w++);var C={left:("right"==s?e.right:e.left)-t.rect.left,right:("left"==s?e.left:e.right)-t.rect.left,top:w?b[w-1]:0,bottom:b[w]};return e.left||e.right||(C.bogus=!0),r.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=p),C}(r,t,n,i)).bogus||(t.cache[f]=o)),{left:o.left,right:o.right,top:e?o.rtop:o.top,bottom:e?o.rbottom:o.bottom}}var Rn,Bn={left:0,right:0,top:0,bottom:0};function Un(r,t,n){for(var i,e,o,u,a,f,c=0;c<r.length;c+=3)if(f=r[c+1],t<(a=r[c])?(e=0,o=1,u="left"):t<f?o=1+(e=t-a):(c==r.length-3||t==f&&r[c+3]>t)&&(e=(o=f-a)-1,t>=f&&(u="right")),null!=e){if(i=r[c+2],a==f&&n==(i.insertLeft?"left":"right")&&(u=n),"left"==n&&0==e)for(;c&&r[c-2]==r[c-3]&&r[c-1].insertLeft;)i=r[2+(c-=3)],u="left";if("right"==n&&e==f-a)for(;c<r.length-3&&r[c+3]==r[c+4]&&!r[c+5].insertLeft;)i=r[(c+=3)+2],u="right";break}return{node:i,start:e,end:o,collapse:u,coverStart:a,coverEnd:f}}function zn(r,t){var n=Bn;if("left"==t)for(var i=0;i<r.length&&(n=r[i]).left==n.right;i++);else for(var e=r.length-1;e>=0&&(n=r[e]).left==n.right;e--);return n}function jn(r){if(r.measure&&(r.measure.cache={},r.measure.heights=null,r.rest))for(var t=0;t<r.rest.length;t++)r.measure.caches[t]={}}function Wn(r){r.display.externalMeasure=null,S(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++)jn(r.display.view[t])}function Fn(r){Wn(r),r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null,r.options.lineWrapping||(r.display.maxLineChanged=!0),r.display.lineNumChars=null}function Pn(){return l&&p?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Gn(){return l&&p?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(r){var t=jt(r).widgets,n=0;if(t)for(var i=0;i<t.length;++i)t[i].above&&(n+=kn(t[i]));return n}function Vn(r,t,n,i,e){if(!e){var o=Hn(t);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var u=Ht(t);if("local"==i?u+=An(r.display):u-=r.display.viewOffset,"page"==i||"window"==i){var a=r.display.lineSpace.getBoundingClientRect();u+=a.top+("window"==i?0:Gn());var f=a.left+("window"==i?0:Pn());n.left+=f,n.right+=f}return n.top+=u,n.bottom+=u,n}function $n(r,t,n){if("div"==n)return t;var i=t.left,e=t.top;if("page"==n)i-=Pn(),e-=Gn();else if("local"==n||!n){var o=r.display.sizer.getBoundingClientRect();i+=o.left,e+=o.top}var u=r.display.lineSpace.getBoundingClientRect();return{left:i-u.left,top:e-u.top}}function _n(r,t,n,i,e){return i||(i=_r(r.doc,t.line)),Vn(r,i,Dn(r,i,t.ch,e),n)}function Qn(r,t,n,i,e,o){function u(t,u){var a=On(r,e,t,u?"right":"left",o);return u?a.left=a.right:a.right=a.left,Vn(r,i,a,n)}i=i||_r(r.doc,t.line),e||(e=In(r,i));var a=cr(i,r.doc.direction),f=t.ch,c=t.sticky;if(f>=i.text.length?(f=i.text.length,c="before"):f<=0&&(f=0,c="after"),!a)return u("before"==c?f-1:f,"before"==c);function l(r,t,n){return u(n?r-1:r,1==a[t].level!=n)}var s=ar(a,f,c),h=ur,d=l(f,s,"before"==c);return null!=h&&(d.other=l(f,h,"before"!=c)),d}function Jn(r,t){var n=0;t=at(r.doc,t),r.options.lineWrapping||(n=ei(r.display)*t.ch);var i=_r(r.doc,t.line),e=Ht(i)+An(r.display);return{left:n,right:n,top:e,bottom:e+i.height}}function Kn(r,t,n,i,e){var o=rt(r,t,n);return o.xRel=e,i&&(o.outside=i),o}function Yn(r,t,n){var i=r.doc;if((n+=r.display.viewOffset)<0)return Kn(i.first,0,null,-1,-1);var e=Xr(i,n),o=i.first+i.size-1;if(e>o)return Kn(i.first+i.size-1,_r(i,o).text.length,null,1,1);t<0&&(t=0);for(var u=_r(i,e);;){var a=ri(r,u,e,t,n),f=Ut(u,a.ch+(a.xRel>0||a.outside>0?1:0));if(!f)return a;var c=f.find(1);if(c.line==e)return c;u=_r(i,e=c.line)}}function Xn(r,t,n,i){i-=Hn(t);var e=t.text.length,o=or((function(t){return On(r,n,t-1).bottom<=i}),e,0);return{begin:o,end:e=or((function(t){return On(r,n,t).top>i}),o,e)}}function qn(r,t,n,i){return n||(n=In(r,t)),Xn(r,t,n,Vn(r,t,On(r,n,i),"line").top)}function Zn(r,t,n,i){return!(r.bottom<=n)&&(r.top>n||(i?r.left:r.right)>t)}function ri(r,t,n,i,e){e-=Ht(t);var o=In(r,t),u=Hn(t),a=0,f=t.text.length,c=!0,l=cr(t,r.doc.direction);if(l){var s=(r.options.lineWrapping?ni:ti)(r,t,n,o,l,i,e);a=(c=1!=s.level)?s.from:s.to-1,f=c?s.to:s.from-1}var h,d,v=null,m=null,p=or((function(t){var n=On(r,o,t);return n.top+=u,n.bottom+=u,!!Zn(n,i,e,!1)&&(n.top<=e&&n.left<=i&&(v=t,m=n),!0)}),a,f),g=!1;if(m){var b=i-m.left<m.right-i,w=b==c;p=v+(w?0:1),d=w?"after":"before",h=b?m.left:m.right}else{c||p!=f&&p!=a||p++,d=0==p?"after":p==t.text.length?"before":On(r,o,p-(c?1:0)).bottom+u<=e==c?"after":"before";var C=Qn(r,rt(n,p,d),"line",t,o);h=C.left,g=e<C.top?-1:e>=C.bottom?1:0}return Kn(n,p=er(t.text,p,1),d,g,i-h)}function ti(r,t,n,i,e,o,u){var a=or((function(a){var f=e[a],c=1!=f.level;return Zn(Qn(r,rt(n,c?f.to:f.from,c?"before":"after"),"line",t,i),o,u,!0)}),0,e.length-1),f=e[a];if(a>0){var c=1!=f.level,l=Qn(r,rt(n,c?f.from:f.to,c?"after":"before"),"line",t,i);Zn(l,o,u,!0)&&l.top>u&&(f=e[a-1])}return f}function ni(r,t,n,i,e,o,u){var a=Xn(r,t,i,u),f=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var l=null,s=null,h=0;h<e.length;h++){var d=e[h];if(!(d.from>=c||d.to<=f)){var v=On(r,i,1!=d.level?Math.min(c,d.to)-1:Math.max(f,d.from)).right,m=v<o?o-v+1e9:v-o;(!l||s>m)&&(l=d,s=m)}}return l||(l=e[e.length-1]),l.from<f&&(l={from:f,to:l.to,level:l.level}),l.to>c&&(l={from:l.from,to:c,level:l.level}),l}function ii(r){if(null!=r.cachedTextHeight)return r.cachedTextHeight;if(null==Rn){Rn=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Rn.appendChild(document.createTextNode("x")),Rn.appendChild(E("br"));Rn.appendChild(document.createTextNode("x"))}N(r.measure,Rn);var n=Rn.offsetHeight/50;return n>3&&(r.cachedTextHeight=n),S(r.measure),n||1}function ei(r){if(null!=r.cachedCharWidth)return r.cachedCharWidth;var t=E("span","xxxxxxxxxx"),n=E("pre",[t],"CodeMirror-line-like");N(r.measure,n);var i=t.getBoundingClientRect(),e=(i.right-i.left)/10;return e>2&&(r.cachedCharWidth=e),e||10}function oi(r){for(var t=r.display,n={},i={},e=t.gutters.clientLeft,o=t.gutters.firstChild,u=0;o;o=o.nextSibling,++u){var a=r.display.gutterSpecs[u].className;n[a]=o.offsetLeft+o.clientLeft+e,i[a]=o.clientWidth}return{fixedPos:ui(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ui(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function ai(r){var t=ii(r.display),n=r.options.lineWrapping,i=n&&Math.max(5,r.display.scroller.clientWidth/ei(r.display)-3);return function(e){if(Pt(r.doc,e))return 0;var o=0;if(e.widgets)for(var u=0;u<e.widgets.length;u++)e.widgets[u].height&&(o+=e.widgets[u].height);return n?o+(Math.ceil(e.text.length/i)||1)*t:o+t}}function fi(r){var t=r.doc,n=ai(r);t.iter((function(r){var t=n(r);t!=r.height&&Kr(r,t)}))}function ci(r,t,n,i){var e=r.display;if(!n&&"true"==Ar(t).getAttribute("cm-not-content"))return null;var o,u,a=e.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,u=t.clientY-a.top}catch(r){return null}var f,c=Yn(r,o,u);if(i&&c.xRel>0&&(f=_r(r.doc,c.line).text).length==c.ch){var l=j(f,f.length,r.options.tabSize)-f.length;c=rt(c.line,Math.max(0,Math.round((o-xn(r.display).left)/ei(r.display))-l))}return c}function li(r,t){if(t>=r.display.viewTo)return null;if((t-=r.display.viewFrom)<0)return null;for(var n=r.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function si(r,t,n,i){null==t&&(t=r.doc.first),null==n&&(n=r.doc.first+r.doc.size),i||(i=0);var e=r.display;if(i&&n<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>t)&&(e.updateLineNumbers=t),r.curOp.viewChanged=!0,t>=e.viewTo)Mt&&Wt(r.doc,t)<e.viewTo&&di(r);else if(n<=e.viewFrom)Mt&&Ft(r.doc,n+i)>e.viewFrom?di(r):(e.viewFrom+=i,e.viewTo+=i);else if(t<=e.viewFrom&&n>=e.viewTo)di(r);else if(t<=e.viewFrom){var o=vi(r,n,n+i,1);o?(e.view=e.view.slice(o.index),e.viewFrom=o.lineN,e.viewTo+=i):di(r)}else if(n>=e.viewTo){var u=vi(r,t,t,-1);u?(e.view=e.view.slice(0,u.index),e.viewTo=u.lineN):di(r)}else{var a=vi(r,t,t,-1),f=vi(r,n,n+i,1);a&&f?(e.view=e.view.slice(0,a.index).concat(on(r,a.lineN,f.lineN)).concat(e.view.slice(f.index)),e.viewTo+=i):di(r)}var c=e.externalMeasured;c&&(n<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(e.externalMeasured=null))}function hi(r,t,n){r.curOp.viewChanged=!0;var i=r.display,e=r.display.externalMeasured;if(e&&t>=e.lineN&&t<e.lineN+e.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[li(r,t)];if(null!=o.node){var u=o.changes||(o.changes=[]);-1==F(u,n)&&u.push(n)}}}function di(r){r.display.viewFrom=r.display.viewTo=r.doc.first,r.display.view=[],r.display.viewOffset=0}function vi(r,t,n,i){var e,o=li(r,t),u=r.display.view;if(!Mt||n==r.doc.first+r.doc.size)return{index:o,lineN:n};for(var a=r.display.viewFrom,f=0;f<o;f++)a+=u[f].size;if(a!=t){if(i>0){if(o==u.length-1)return null;e=a+u[o].size-t,o++}else e=a-t;t+=e,n+=e}for(;Wt(r.doc,n)!=n;){if(o==(i<0?0:u.length-1))return null;n+=i*u[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(r){for(var t=r.display.view,n=0,i=0;i<t.length;i++){var e=t[i];e.hidden||e.node&&!e.changes||++n}return n}function pi(r){r.display.input.showSelection(r.display.input.prepareSelection())}function gi(r,t){void 0===t&&(t=!0);var n=r.doc,i={},e=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),u=r.options.$customCursor;u&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var f=n.sel.ranges[a];if(!(f.from().line>=r.display.viewTo||f.to().line<r.display.viewFrom)){var c=f.empty();if(u){var l=u(r,f);l&&bi(r,l,e)}else(c||r.options.showCursorWhenSelecting)&&bi(r,f.head,e);c||Ci(r,f,o)}}return i}function bi(r,t,n){var i=Qn(r,t,"div",null,null,!r.options.singleCursorHeightPerLine),e=n.appendChild(E("div"," ","CodeMirror-cursor"));if(e.style.left=i.left+"px",e.style.top=i.top+"px",e.style.height=Math.max(0,i.bottom-i.top)*r.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=_n(r,t,"div",null,null),u=o.right-o.left;e.style.width=(u>0?u:r.defaultCharWidth())+"px"}if(i.other){var a=n.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function wi(r,t){return r.top-t.top||r.left-t.left}function Ci(r,t,n){var i=r.display,e=r.doc,o=document.createDocumentFragment(),u=xn(r.display),a=u.left,f=Math.max(i.sizerWidth,Sn(r)-i.sizer.offsetLeft)-u.right,c="ltr"==e.direction;function l(r,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(null==n?f-r:n)+"px;\n height: "+(i-t)+"px"))}function s(t,n,i){var o,u,s=_r(e,t),h=s.text.length;function d(n,i){return _n(r,rt(t,n),"div",s,i)}function v(t,n,i){var e=qn(r,s,null,t),o="ltr"==n==("after"==i)?"left":"right";return d("after"==i?e.begin:e.end-(/\s/.test(s.text.charAt(e.end-1))?2:1),o)[o]}var m=cr(s,e.direction);return function(r,t,n,i){if(!r)return i(t,n,"ltr",0);for(var e=!1,o=0;o<r.length;++o){var u=r[o];(u.from<n&&u.to>t||t==n&&u.to==t)&&(i(Math.max(u.from,t),Math.min(u.to,n),1==u.level?"rtl":"ltr",o),e=!0)}e||i(t,n,"ltr")}(m,n||0,null==i?h:i,(function(r,t,e,s){var p="ltr"==e,g=d(r,p?"left":"right"),b=d(t-1,p?"right":"left"),w=null==n&&0==r,C=null==i&&t==h,k=0==s,M=!m||s==m.length-1;if(b.top-g.top<=3){var A=(c?w:C)&&k?a:(p?g:b).left;l(A,g.top,((c?C:w)&&M?f:(p?b:g).right)-A,g.bottom)}else{var y,x,L,S;p?(y=c&&w&&k?a:g.left,x=c?f:v(r,e,"before"),L=c?a:v(t,e,"after"),S=c&&C&&M?f:b.right):(y=c?v(r,e,"before"):a,x=!c&&w&&k?f:g.right,L=!c&&C&&M?a:b.left,S=c?v(t,e,"after"):f),l(y,g.top,x-y,g.bottom),g.bottom<b.top&&l(a,g.bottom,null,b.top),l(L,b.top,S-L,b.bottom)}(!o||wi(g,o)<0)&&(o=g),wi(b,o)<0&&(o=b),(!u||wi(g,u)<0)&&(u=g),wi(b,u)<0&&(u=b)})),{start:o,end:u}}var h=t.from(),d=t.to();if(h.line==d.line)s(h.line,h.ch,d.ch);else{var v=_r(e,h.line),m=_r(e,d.line),p=jt(v)==jt(m),g=s(h.line,h.ch,p?v.text.length+1:null).end,b=s(d.line,p?0:null,d.ch).start;p&&(g.top<b.top-2?(l(g.right,g.top,null,g.bottom),l(a,b.top,b.left,b.bottom)):l(g.right,g.top,b.left-g.right,g.bottom)),g.bottom<b.top&&l(a,g.bottom,null,b.top)}n.appendChild(o)}function ki(r){if(r.state.focused){var t=r.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",r.options.cursorBlinkRate>0?t.blinker=setInterval((function(){r.hasFocus()||xi(r),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),r.options.cursorBlinkRate):r.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Mi(r){r.hasFocus()||(r.display.input.focus(),r.state.focused||yi(r))}function Ai(r){r.state.delayingBlurEvent=!0,setTimeout((function(){r.state.delayingBlurEvent&&(r.state.delayingBlurEvent=!1,r.state.focused&&xi(r))}),100)}function yi(r,t){r.state.delayingBlurEvent&&!r.state.draggingText&&(r.state.delayingBlurEvent=!1),"nocursor"!=r.options.readOnly&&(r.state.focused||(vr(r,"focus",r,t),r.state.focused=!0,O(r.display.wrapper,"CodeMirror-focused"),r.curOp||r.display.selForContextMenu==r.doc.sel||(r.display.input.reset(),f&&setTimeout((function(){return r.display.input.reset(!0)}),20)),r.display.input.receivedFocus()),ki(r))}function xi(r,t){r.state.delayingBlurEvent||(r.state.focused&&(vr(r,"blur",r,t),r.state.focused=!1,L(r.display.wrapper,"CodeMirror-focused")),clearInterval(r.display.blinker),setTimeout((function(){r.state.focused||(r.display.shift=!1)}),150))}function Li(r){for(var t=r.display,n=t.lineDiv.offsetTop,i=Math.max(0,t.scroller.getBoundingClientRect().top),e=t.lineDiv.getBoundingClientRect().top,o=0,f=0;f<t.view.length;f++){var c=t.view[f],l=r.options.lineWrapping,s=void 0,h=0;if(!c.hidden){if(e+=c.line.height,u&&a<8){var d=c.node.offsetTop+c.node.offsetHeight;s=d-n,n=d}else{var v=c.node.getBoundingClientRect();s=v.bottom-v.top,!l&&c.text.firstChild&&(h=c.text.firstChild.getBoundingClientRect().right-v.left-1)}var m=c.line.height-s;if((m>.005||m<-.005)&&(e<i&&(o-=m),Kr(c.line,s),Si(c.line),c.rest))for(var p=0;p<c.rest.length;p++)Si(c.rest[p]);if(h>r.display.sizerWidth){var g=Math.ceil(h/ei(r.display));g>r.display.maxLineLength&&(r.display.maxLineLength=g,r.display.maxLine=c.line,r.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Si(r){if(r.widgets)for(var t=0;t<r.widgets.length;++t){var n=r.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Ni(r,t,n){var i=n&&null!=n.top?Math.max(0,n.top):r.scroller.scrollTop;i=Math.floor(i-An(r));var e=n&&null!=n.bottom?n.bottom:i+r.wrapper.clientHeight,o=Xr(t,i),u=Xr(t,e);if(n&&n.ensure){var a=n.ensure.from.line,f=n.ensure.to.line;a<o?(o=a,u=Xr(t,Ht(_r(t,a))+r.wrapper.clientHeight)):Math.min(f,t.lastLine())>=u&&(o=Xr(t,Ht(_r(t,f))-r.wrapper.clientHeight),u=f)}return{from:o,to:Math.max(u,o+1)}}function Ei(r,t){var n=r.display,i=ii(r.display);t.top<0&&(t.top=0);var e=r.curOp&&null!=r.curOp.scrollTop?r.curOp.scrollTop:n.scroller.scrollTop,o=Nn(r),u={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=r.doc.height+yn(n),f=t.bottom>a-i;if(t.top<e)u.scrollTop=t.top<i?0:t.top;else if(t.bottom>e+o){var c=Math.min(t.top,(f?a:t.bottom)-o);c!=e&&(u.scrollTop=c)}var l=r.options.fixedGutter?0:n.gutters.offsetWidth,s=r.curOp&&null!=r.curOp.scrollLeft?r.curOp.scrollLeft:n.scroller.scrollLeft-l,h=Sn(r)-n.gutters.offsetWidth,d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?u.scrollLeft=0:t.left<s?u.scrollLeft=Math.max(0,t.left+l-(d?0:10)):t.right>h+s-3&&(u.scrollLeft=t.right+(d?0:10)-h),u}function Di(r,t){null!=t&&(Oi(r),r.curOp.scrollTop=(null==r.curOp.scrollTop?r.doc.scrollTop:r.curOp.scrollTop)+t)}function Ti(r){Oi(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function Ii(r,t,n){null==t&&null==n||Oi(r),null!=t&&(r.curOp.scrollLeft=t),null!=n&&(r.curOp.scrollTop=n)}function Oi(r){var t=r.curOp.scrollToPos;t&&(r.curOp.scrollToPos=null,Ri(r,Jn(r,t.from),Jn(r,t.to),t.margin))}function Ri(r,t,n,i){var e=Ei(r,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Ii(r,e.scrollLeft,e.scrollTop)}function Bi(r,t){Math.abs(r.doc.scrollTop-t)<2||(n||fe(r,{top:t}),Ui(r,t,!0),n&&fe(r),ie(r,100))}function Ui(r,t,n){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t)),(r.display.scroller.scrollTop!=t||n)&&(r.doc.scrollTop=t,r.display.scrollbars.setScrollTop(t),r.display.scroller.scrollTop!=t&&(r.display.scroller.scrollTop=t))}function zi(r,t,n,i){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth)),(n?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!i||(r.doc.scrollLeft=t,se(r),r.display.scroller.scrollLeft!=t&&(r.display.scroller.scrollLeft=t),r.display.scrollbars.setScrollLeft(t))}function ji(r){var t=r.display,n=t.gutters.offsetWidth,i=Math.round(r.doc.height+yn(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Ln(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Wi=function(r,t,n){this.cm=n;var i=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=e.tabIndex=-1,r(i),r(e),sr(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),sr(e,"scroll",(function(){e.clientWidth&&t(e.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,u&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wi.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1,n=r.scrollHeight>r.clientHeight+1,i=r.nativeBarWidth;return n?(this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0",this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+(r.viewHeight-(t?i:0)))+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),t?(this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=r.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+(r.viewWidth-r.barLeft-(n?i:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&r.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},Wi.prototype.setScrollLeft=function(r){this.horiz.scrollLeft!=r&&(this.horiz.scrollLeft=r),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wi.prototype.setScrollTop=function(r){this.vert.scrollTop!=r&&(this.vert.scrollTop=r),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wi.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=b&&!d?"12px":"18px",this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},Wi.prototype.enableZeroWidthBar=function(r,t,n){r.style.pointerEvents="auto",t.set(1e3,(function i(){var e=r.getBoundingClientRect();("vert"==n?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1))!=r?r.style.pointerEvents="none":t.set(1e3,i)}))},Wi.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz),r.removeChild(this.vert)};var Fi=function(){};function Pi(r,t){t||(t=ji(r));var n=r.display.barWidth,i=r.display.barHeight;Gi(r,t);for(var e=0;e<4&&n!=r.display.barWidth||i!=r.display.barHeight;e++)n!=r.display.barWidth&&r.options.lineWrapping&&Li(r),Gi(r,ji(r)),n=r.display.barWidth,i=r.display.barHeight}function Gi(r,t){var n=r.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Fi.prototype.update=function(){return{bottom:0,right:0}},Fi.prototype.setScrollLeft=function(){},Fi.prototype.setScrollTop=function(){},Fi.prototype.clear=function(){};var Hi={native:Wi,null:Fi};function Vi(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&L(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Hi[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller),sr(t,"mousedown",(function(){r.state.focused&&setTimeout((function(){return r.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?zi(r,t):Bi(r,t)}),r),r.display.scrollbars.addClass&&O(r.display.wrapper,r.display.scrollbars.addClass)}var $i=0;function _i(r){var t;r.curOp={cm:r,viewChanged:!1,startHeight:r.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$i,markArrays:null},t=r.curOp,un?un.ops.push(t):t.ownsGroup=un={ops:[t],delayedCallbacks:[]}}function Qi(r){var t=r.curOp;t&&function(r,t){var n=r.ownsGroup;if(n)try{!function(r){var t=r.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<r.ops.length;i++){var e=r.ops[i];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}while(n<t.length)}(n)}finally{un=null,t(n)}}(t,(function(r){for(var t=0;t<r.ops.length;t++)r.ops[t].cm.curOp=null;!function(r){for(var t=r.ops,n=0;n<t.length;n++)Ji(t[n]);for(var i=0;i<t.length;i++)Ki(t[i]);for(var e=0;e<t.length;e++)Yi(t[e]);for(var o=0;o<t.length;o++)Xi(t[o]);for(var u=0;u<t.length;u++)qi(t[u])}(r)}))}function Ji(r){var t=r.cm,n=t.display;(function(r){var t=r.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ln(r)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ln(r)+"px",t.scrollbarsClipped=!0)})(t),r.updateMaxLine&&$t(t),r.mustUpdate=r.viewChanged||r.forceUpdate||null!=r.scrollTop||r.scrollToPos&&(r.scrollToPos.from.line<n.viewFrom||r.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,r.update=r.mustUpdate&&new oe(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function Ki(r){r.updatedDisplay=r.mustUpdate&&ue(r.cm,r.update)}function Yi(r){var t=r.cm,n=t.display;r.updatedDisplay&&Li(t),r.barMeasure=ji(t),n.maxLineChanged&&!t.options.lineWrapping&&(r.adjustWidthTo=Dn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=r.adjustWidthTo,r.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+r.adjustWidthTo+Ln(t)+t.display.barWidth),r.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+r.adjustWidthTo-Sn(t))),(r.updatedDisplay||r.selectionChanged)&&(r.preparedSelection=n.input.prepareSelection())}function Xi(r){var t=r.cm;null!=r.adjustWidthTo&&(t.display.sizer.style.minWidth=r.adjustWidthTo+"px",r.maxScrollLeft<t.doc.scrollLeft&&zi(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=r.focus&&r.focus==I();r.preparedSelection&&t.display.input.showSelection(r.preparedSelection,n),(r.updatedDisplay||r.startHeight!=t.doc.height)&&Pi(t,r.barMeasure),r.updatedDisplay&&le(t,r.barMeasure),r.selectionChanged&&ki(t),t.state.focused&&r.updateInput&&t.display.input.reset(r.typing),n&&Mi(r.cm)}function qi(r){var t=r.cm,n=t.display,i=t.doc;r.updatedDisplay&&ae(t,r.update),null==n.wheelStartX||null==r.scrollTop&&null==r.scrollLeft&&!r.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=r.scrollTop&&Ui(t,r.scrollTop,r.forceScroll),null!=r.scrollLeft&&zi(t,r.scrollLeft,!0,!0),r.scrollToPos&&function(r,t){if(!mr(r,"scrollCursorIntoView")){var n=r.display,i=n.sizer.getBoundingClientRect(),e=null;if(t.top+i.top<0?e=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!v){var o=E("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-An(r.display))+"px;\n height: "+(t.bottom-t.top+Ln(r)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(o),o.scrollIntoView(e),r.display.lineSpace.removeChild(o)}}}(t,function(r,t,n,i){var e;null==i&&(i=0),r.options.lineWrapping||t!=n||(n="before"==t.sticky?rt(t.line,t.ch+1,"before"):t,t=t.ch?rt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var u=!1,a=Qn(r,t),f=n&&n!=t?Qn(r,n):a,c=Ei(r,e={left:Math.min(a.left,f.left),top:Math.min(a.top,f.top)-i,right:Math.max(a.left,f.left),bottom:Math.max(a.bottom,f.bottom)+i}),l=r.doc.scrollTop,s=r.doc.scrollLeft;if(null!=c.scrollTop&&(Bi(r,c.scrollTop),Math.abs(r.doc.scrollTop-l)>1&&(u=!0)),null!=c.scrollLeft&&(zi(r,c.scrollLeft),Math.abs(r.doc.scrollLeft-s)>1&&(u=!0)),!u)break}return e}(t,at(i,r.scrollToPos.from),at(i,r.scrollToPos.to),r.scrollToPos.margin));var e=r.maybeHiddenMarkers,o=r.maybeUnhiddenMarkers;if(e)for(var u=0;u<e.length;++u)e[u].lines.length||vr(e[u],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&vr(o[a],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),r.changeObjs&&vr(t,"changes",t,r.changeObjs),r.update&&r.update.finish()}function Zi(r,t){if(r.curOp)return t();_i(r);try{return t()}finally{Qi(r)}}function re(r,t){return function(){if(r.curOp)return t.apply(r,arguments);_i(r);try{return t.apply(r,arguments)}finally{Qi(r)}}}function te(r){return function(){if(this.curOp)return r.apply(this,arguments);_i(this);try{return r.apply(this,arguments)}finally{Qi(this)}}}function ne(r){return function(){var t=this.cm;if(!t||t.curOp)return r.apply(this,arguments);_i(t);try{return r.apply(this,arguments)}finally{Qi(t)}}}function ie(r,t){r.doc.highlightFrontier<r.display.viewTo&&r.state.highlight.set(t,U(ee,r))}function ee(r){var t=r.doc;if(!(t.highlightFrontier>=r.display.viewTo)){var n=+new Date+r.options.workTime,i=dt(r,t.highlightFrontier),e=[];t.iter(i.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(i.line>=r.display.viewFrom){var u=o.styles,a=o.text.length>r.options.maxHighlightLength?Gr(t.mode,i.state):null,f=st(r,o,i,!0);a&&(i.state=a),o.styles=f.styles;var c=o.styleClasses,l=f.classes;l?o.styleClasses=l:c&&(o.styleClasses=null);for(var s=!u||u.length!=o.styles.length||c!=l&&(!c||!l||c.bgClass!=l.bgClass||c.textClass!=l.textClass),h=0;!s&&h<u.length;++h)s=u[h]!=o.styles[h];s&&e.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=r.options.maxHighlightLength&&vt(r,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return ie(r,r.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),e.length&&Zi(r,(function(){for(var t=0;t<e.length;t++)hi(r,e[t],"text")}))}}var oe=function(r,t,n){var i=r.display;this.viewport=t,this.visible=Ni(i,r.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Sn(r),this.force=n,this.dims=oi(r),this.events=[]};function ue(r,t){var n=r.display,i=r.doc;if(t.editorIsHidden)return di(r),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(r))return!1;he(r)&&(di(r),t.dims=oi(r));var e=i.first+i.size,o=Math.max(t.visible.from-r.options.viewportMargin,i.first),u=Math.min(e,t.visible.to+r.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>u&&n.viewTo-u<20&&(u=Math.min(e,n.viewTo)),Mt&&(o=Wt(r.doc,o),u=Ft(r.doc,u));var a=o!=n.viewFrom||u!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(r,t,n){var i=r.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=on(r,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=on(r,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(li(r,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(on(r,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,li(r,n)))),i.viewTo=n})(r,o,u),n.viewOffset=Ht(_r(r.doc,n.viewFrom)),r.display.mover.style.top=n.viewOffset+"px";var c=mi(r);if(!a&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var l=function(r){if(r.hasFocus())return null;var t=I();if(!t||!T(r.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&T(r.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(r);return c>4&&(n.lineDiv.style.display="none"),function(r,t,n){var i=r.display,e=r.options.lineNumbers,o=i.lineDiv,u=o.firstChild;function a(t){var n=t.nextSibling;return f&&b&&r.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=i.view,l=i.viewFrom,s=0;s<c.length;s++){var h=c[s];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;u!=h.node;)u=a(u);var d=e&&null!=t&&t<=l&&h.lineNumber;h.changes&&(F(h.changes,"gutter")>-1&&(d=!1),ln(r,h,l,n)),d&&(S(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Zr(r.options,l)))),u=h.node.nextSibling}else{var v=gn(r,h,l,n);o.insertBefore(v,u)}l+=h.size}for(;u;)u=a(u)}(r,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(r){if(r&&r.activeElt&&r.activeElt!=I()&&(r.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&T(document.body,r.anchorNode)&&T(document.body,r.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(r.anchorNode,r.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(r.focusNode,r.focusOffset)}}(l),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ie(r,400)),n.updateLineNumbers=null,!0}function ae(r,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&r.options.lineWrapping&&t.oldDisplayWidth!=Sn(r))i&&(t.visible=Ni(r.display,r.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(r.doc.height+yn(r.display)-Nn(r),n.top)}),t.visible=Ni(r.display,r.doc,n),t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo)break;if(!ue(r,t))break;Li(r);var e=ji(r);pi(r),Pi(r,e),le(r,e),t.force=!1}t.signal(r,"update",r),r.display.viewFrom==r.display.reportedViewFrom&&r.display.viewTo==r.display.reportedViewTo||(t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo),r.display.reportedViewFrom=r.display.viewFrom,r.display.reportedViewTo=r.display.viewTo)}function fe(r,t){var n=new oe(r,t);if(ue(r,n)){Li(r),ae(r,n);var i=ji(r);pi(r),Pi(r,i),le(r,i),n.finish()}}function ce(r){r.sizer.style.marginLeft=r.gutters.offsetWidth+"px",fn(r,"gutterChanged",r)}function le(r,t){r.display.sizer.style.minHeight=t.docHeight+"px",r.display.heightForcer.style.top=t.docHeight+"px",r.display.gutters.style.height=t.docHeight+r.display.barHeight+Ln(r)+"px"}function se(r){var t=r.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&r.options.fixedGutter){for(var i=ui(t)-t.scroller.scrollLeft+r.doc.scrollLeft,e=t.gutters.offsetWidth,o=i+"px",u=0;u<n.length;u++)if(!n[u].hidden){r.options.fixedGutter&&(n[u].gutter&&(n[u].gutter.style.left=o),n[u].gutterBackground&&(n[u].gutterBackground.style.left=o));var a=n[u].alignable;if(a)for(var f=0;f<a.length;f++)a[f].style.left=o}r.options.fixedGutter&&(t.gutters.style.left=i+e+"px")}}function he(r){if(!r.options.lineNumbers)return!1;var t=r.doc,n=Zr(r.options,t.first+t.size-1),i=r.display;if(n.length!=i.lineNumChars){var e=i.measure.appendChild(E("div",[E("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=e.firstChild.offsetWidth,u=e.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-u)+1,i.lineNumWidth=i.lineNumInnerWidth+u,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",ce(r.display),!0}return!1}function de(r,t){for(var n=[],i=!1,e=0;e<r.length;e++){var o=r[e],u=null;if("string"!=typeof o&&(u=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;i=!0}n.push({className:o,style:u})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ve(r){var t=r.gutters,n=r.gutterSpecs;S(t),r.lineGutter=null;for(var i=0;i<n.length;++i){var e=n[i],o=e.className,u=e.style,a=t.appendChild(E("div",null,"CodeMirror-gutter "+o));u&&(a.style.cssText=u),"CodeMirror-linenumbers"==o&&(r.lineGutter=a,a.style.width=(r.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ce(r)}function me(r){ve(r.display),si(r),se(r)}function pe(r,t,i,e){var o=this;this.input=i,o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=E("div",null,"CodeMirror-cursors"),o.measure=E("div",null,"CodeMirror-measure"),o.lineMeasure=E("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[c],null,"position: relative"),o.sizer=E("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=E("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=E("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),o.wrapper.setAttribute("translate","no"),u&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),f||n&&g||(o.scroller.draggable=!0),r&&(r.appendChild?r.appendChild(o.wrapper):r(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=de(e.gutters,e.lineNumbers),ve(o),i.init(o)}oe.prototype.signal=function(r,t){gr(r,t)&&this.events.push(arguments)},oe.prototype.finish=function(){for(var r=0;r<this.events.length;r++)vr.apply(null,this.events[r])};var ge=0,be=null;function we(r){var t=r.wheelDeltaX,n=r.wheelDeltaY;return null==t&&r.detail&&r.axis==r.HORIZONTAL_AXIS&&(t=r.detail),null==n&&r.detail&&r.axis==r.VERTICAL_AXIS?n=r.detail:null==n&&(n=r.wheelDelta),{x:t,y:n}}function Ce(r){var t=we(r);return t.x*=be,t.y*=be,t}function ke(r,t){var i=we(t),e=i.x,o=i.y,u=be;0===t.deltaMode&&(e=t.deltaX,o=t.deltaY,u=1);var a=r.display,c=a.scroller,l=c.scrollHeight>c.clientHeight;if(e&&c.scrollWidth>c.clientWidth||o&&l){if(o&&b&&f)r:for(var h=t.target,d=a.view;h!=c;h=h.parentNode)for(var v=0;v<d.length;v++)if(d[v].node==h){r.display.currentWheelTarget=h;break r}if(e&&!n&&!s&&null!=u)return o&&l&&Bi(r,Math.max(0,c.scrollTop+o*u)),zi(r,Math.max(0,c.scrollLeft+e*u)),(!o||o&&l)&&wr(t),void(a.wheelStartX=null);if(o&&null!=u){var m=o*u,p=r.doc.scrollTop,g=p+a.wrapper.clientHeight;m<0?p=Math.max(0,p+m-50):g=Math.min(r.doc.height,g+m+50),fe(r,{top:p,bottom:g})}ge<20&&0!==t.deltaMode&&(null==a.wheelStartX?(a.wheelStartX=c.scrollLeft,a.wheelStartY=c.scrollTop,a.wheelDX=e,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var r=c.scrollLeft-a.wheelStartX,t=c.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||r&&a.wheelDX&&r/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(be=(be*ge+n)/(ge+1),++ge)}}),200)):(a.wheelDX+=e,a.wheelDY+=o))}}u?be=-.53:n?be=15:l?be=-.7:h&&(be=-1/3);var Me=function(r,t){this.ranges=r,this.primIndex=t};Me.prototype.primary=function(){return this.ranges[this.primIndex]},Me.prototype.equals=function(r){if(r==this)return!0;if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=r.ranges[t];if(!nt(n.anchor,i.anchor)||!nt(n.head,i.head))return!1}return!0},Me.prototype.deepCopy=function(){for(var r=[],t=0;t<this.ranges.length;t++)r[t]=new Ae(it(this.ranges[t].anchor),it(this.ranges[t].head));return new Me(r,this.primIndex)},Me.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++)if(!this.ranges[r].empty())return!0;return!1},Me.prototype.contains=function(r,t){t||(t=r);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(tt(t,i.from())>=0&&tt(r,i.to())<=0)return n}return-1};var Ae=function(r,t){this.anchor=r,this.head=t};function ye(r,t,n){var i=r&&r.options.selectionsMayTouch,e=t[n];t.sort((function(r,t){return tt(r.from(),t.from())})),n=F(t,e);for(var o=1;o<t.length;o++){var u=t[o],a=t[o-1],f=tt(a.to(),u.from());if(i&&!u.empty()?f>0:f>=0){var c=ot(a.from(),u.from()),l=et(a.to(),u.to()),s=a.empty()?u.from()==u.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Ae(s?l:c,s?c:l))}}return new Me(t,n)}function xe(r,t){return new Me([new Ae(r,t||r)],0)}function Le(r){return r.text?rt(r.from.line+r.text.length-1,J(r.text).length+(1==r.text.length?r.from.ch:0)):r.to}function Se(r,t){if(tt(r,t.from)<0)return r;if(tt(r,t.to)<=0)return Le(t);var n=r.line+t.text.length-(t.to.line-t.from.line)-1,i=r.ch;return r.line==t.to.line&&(i+=Le(t).ch-t.to.ch),rt(n,i)}function Ne(r,t){for(var n=[],i=0;i<r.sel.ranges.length;i++){var e=r.sel.ranges[i];n.push(new Ae(Se(e.anchor,t),Se(e.head,t)))}return ye(r.cm,n,r.sel.primIndex)}function Ee(r,t,n){return r.line==t.line?rt(n.line,r.ch-t.ch+n.ch):rt(n.line+(r.line-t.line),r.ch)}function De(r){r.doc.mode=Wr(r.options,r.doc.modeOption),Te(r)}function Te(r){r.doc.iter((function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)})),r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first,ie(r,100),r.state.modeGen++,r.curOp&&si(r)}function Ie(r,t){return 0==t.from.ch&&0==t.to.ch&&""==J(t.text)&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function Oe(r,t,n,i){function e(r){return n?n[r]:null}function o(r,n,e){(function(r,t,n,i){r.text=t,r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null),null!=r.order&&(r.order=null),Nt(r),Et(r,n);var e=i?i(r):1;e!=r.height&&Kr(r,e)})(r,n,e,i),fn(r,"change",r,t)}function u(r,t){for(var n=[],o=r;o<t;++o)n.push(new _t(c[o],e(o),i));return n}var a=t.from,f=t.to,c=t.text,l=_r(r,a.line),s=_r(r,f.line),h=J(c),d=e(c.length-1),v=f.line-a.line;if(t.full)r.insert(0,u(0,c.length)),r.remove(c.length,r.size-c.length);else if(Ie(r,t)){var m=u(0,c.length-1);o(s,s.text,d),v&&r.remove(a.line,v),m.length&&r.insert(a.line,m)}else if(l==s)if(1==c.length)o(l,l.text.slice(0,a.ch)+h+l.text.slice(f.ch),d);else{var p=u(1,c.length-1);p.push(new _t(h+l.text.slice(f.ch),d,i)),o(l,l.text.slice(0,a.ch)+c[0],e(0)),r.insert(a.line+1,p)}else if(1==c.length)o(l,l.text.slice(0,a.ch)+c[0]+s.text.slice(f.ch),e(0)),r.remove(a.line+1,v);else{o(l,l.text.slice(0,a.ch)+c[0],e(0)),o(s,h+s.text.slice(f.ch),d);var g=u(1,c.length-1);v>1&&r.remove(a.line+1,v-1),r.insert(a.line+1,g)}fn(r,"change",r,t)}function Re(r,t,n){!function r(i,e,o){if(i.linked)for(var u=0;u<i.linked.length;++u){var a=i.linked[u];if(a.doc!=e){var f=o&&a.sharedHist;n&&!f||(t(a.doc,f),r(a.doc,i,f))}}}(r,null,!0)}function Be(r,t){if(t.cm)throw new Error("This document is already in use.");r.doc=t,t.cm=r,fi(r),De(r),Ue(r),r.options.direction=t.direction,r.options.lineWrapping||$t(r),r.options.mode=t.modeOption,si(r)}function Ue(r){("rtl"==r.doc.direction?O:L)(r.display.lineDiv,"CodeMirror-rtl")}function ze(r){this.done=[],this.undone=[],this.undoDepth=r?r.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=r?r.maxGeneration:1}function je(r,t){var n={from:it(t.from),to:Le(t),text:Qr(r,t.from,t.to)};return He(r,n,t.from.line,t.to.line+1),Re(r,(function(r){return He(r,n,t.from.line,t.to.line+1)}),!0),n}function We(r){for(;r.length&&J(r).ranges;)r.pop()}function Fe(r,t,n,i){var e=r.history;e.undone.length=0;var o,u,a=+new Date;if((e.lastOp==i||e.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.lastModTime>a-(r.cm?r.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(r,t){return t?(We(r.done),J(r.done)):r.done.length&&!J(r.done).ranges?J(r.done):r.done.length>1&&!r.done[r.done.length-2].ranges?(r.done.pop(),J(r.done)):void 0}(e,e.lastOp==i)))u=J(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,u.to)?u.to=Le(t):o.changes.push(je(r,t));else{var f=J(e.done);for(f&&f.ranges||Ge(r.sel,e.done),o={changes:[je(r,t)],generation:e.generation},e.done.push(o);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(n),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=a,e.lastOp=e.lastSelOp=i,e.lastOrigin=e.lastSelOrigin=t.origin,u||vr(r,"historyAdded")}function Pe(r,t,n,i){var e=r.history,o=i&&i.origin;n==e.lastSelOp||o&&e.lastSelOrigin==o&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==o||function(r,t,n,i){var e=t.charAt(0);return"*"==e||"+"==e&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}(r,o,J(e.done),t))?e.done[e.done.length-1]=t:Ge(t,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=o,e.lastSelOp=n,i&&!1!==i.clearRedo&&We(e.undone)}function Ge(r,t){var n=J(t);n&&n.ranges&&n.equals(r)||t.push(r)}function He(r,t,n,i){var e=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,n),Math.min(r.first+r.size,i),(function(n){n.markedSpans&&((e||(e=t["spans_"+r.id]={}))[o]=n.markedSpans),++o}))}function Ve(r){if(!r)return null;for(var t,n=0;n<r.length;++n)r[n].marker.explicitlyCleared?t||(t=r.slice(0,n)):t&&t.push(r[n]);return t?t.length?t:null:r}function $e(r,t){var n=function(r,t){var n=t["spans_"+r.id];if(!n)return null;for(var i=[],e=0;e<t.text.length;++e)i.push(Ve(n[e]));return i}(r,t),i=Lt(r,t);if(!n)return i;if(!i)return n;for(var e=0;e<n.length;++e){var o=n[e],u=i[e];if(o&&u)r:for(var a=0;a<u.length;++a){for(var f=u[a],c=0;c<o.length;++c)if(o[c].marker==f.marker)continue r;o.push(f)}else u&&(n[e]=u)}return n}function _e(r,t,n){for(var i=[],e=0;e<r.length;++e){var o=r[e];if(o.ranges)i.push(n?Me.prototype.deepCopy.call(o):o);else{var u=o.changes,a=[];i.push({changes:a});for(var f=0;f<u.length;++f){var c=u[f],l=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var s in c)(l=s.match(/^spans_(\d+)$/))&&F(t,Number(l[1]))>-1&&(J(a)[s]=c[s],delete c[s])}}}return i}function Qe(r,t,n,i){if(i){var e=r.anchor;if(n){var o=tt(t,e)<0;o!=tt(n,e)<0?(e=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Ae(e,t)}return new Ae(n||t,t)}function Je(r,t,n,i,e){null==e&&(e=r.cm&&(r.cm.display.shift||r.extend)),Ze(r,new Me([Qe(r.sel.primary(),t,n,e)],0),i)}function Ke(r,t,n){for(var i=[],e=r.cm&&(r.cm.display.shift||r.extend),o=0;o<r.sel.ranges.length;o++)i[o]=Qe(r.sel.ranges[o],t[o],null,e);Ze(r,ye(r.cm,i,r.sel.primIndex),n)}function Ye(r,t,n,i){var e=r.sel.ranges.slice(0);e[t]=n,Ze(r,ye(r.cm,e,r.sel.primIndex),i)}function Xe(r,t,n,i){Ze(r,xe(t,n),i)}function qe(r,t,n){var i=r.history.done,e=J(i);e&&e.ranges?(i[i.length-1]=t,ro(r,t,n)):Ze(r,t,n)}function Ze(r,t,n){ro(r,t,n),Pe(r,r.sel,r.cm?r.cm.curOp.id:NaN,n)}function ro(r,t,n){(gr(r,"beforeSelectionChange")||r.cm&&gr(r.cm,"beforeSelectionChange"))&&(t=function(r,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Ae(at(r,t[n].anchor),at(r,t[n].head))},origin:n&&n.origin};return vr(r,"beforeSelectionChange",r,i),r.cm&&vr(r.cm,"beforeSelectionChange",r.cm,i),i.ranges!=t.ranges?ye(r.cm,i.ranges,i.ranges.length-1):t}(r,t,n));var i=n&&n.bias||(tt(t.primary().head,r.sel.primary().head)<0?-1:1);to(r,io(r,t,i,!0)),n&&!1===n.scroll||!r.cm||"nocursor"==r.cm.getOption("readOnly")||Ti(r.cm)}function to(r,t){t.equals(r.sel)||(r.sel=t,r.cm&&(r.cm.curOp.updateInput=1,r.cm.curOp.selectionChanged=!0,pr(r.cm)),fn(r,"cursorActivity",r))}function no(r){to(r,io(r,r.sel,null,!1))}function io(r,t,n,i){for(var e,o=0;o<t.ranges.length;o++){var u=t.ranges[o],a=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o],f=oo(r,u.anchor,a&&a.anchor,n,i),c=oo(r,u.head,a&&a.head,n,i);(e||f!=u.anchor||c!=u.head)&&(e||(e=t.ranges.slice(0,o)),e[o]=new Ae(f,c))}return e?ye(r.cm,e,t.primIndex):t}function eo(r,t,n,i,e){var o=_r(r,t.line);if(o.markedSpans)for(var u=0;u<o.markedSpans.length;++u){var a=o.markedSpans[u],f=a.marker,c="selectLeft"in f?!f.selectLeft:f.inclusiveLeft,l="selectRight"in f?!f.selectRight:f.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(l?a.to>=t.ch:a.to>t.ch))){if(e&&(vr(f,"beforeCursorEnter"),f.explicitlyCleared)){if(o.markedSpans){--u;continue}break}if(!f.atomic)continue;if(n){var s=f.find(i<0?1:-1),h=void 0;if((i<0?l:c)&&(s=uo(r,s,-i,s&&s.line==t.line?o:null)),s&&s.line==t.line&&(h=tt(s,n))&&(i<0?h<0:h>0))return eo(r,s,t,i,e)}var d=f.find(i<0?-1:1);return(i<0?c:l)&&(d=uo(r,d,i,d.line==t.line?o:null)),d?eo(r,d,t,i,e):null}}return t}function oo(r,t,n,i,e){var o=i||1;return eo(r,t,n,o,e)||!e&&eo(r,t,n,o,!0)||eo(r,t,n,-o,e)||!e&&eo(r,t,n,-o,!0)||(r.cantEdit=!0,rt(r.first,0))}function uo(r,t,n,i){return n<0&&0==t.ch?t.line>r.first?at(r,rt(t.line-1)):null:n>0&&t.ch==(i||_r(r,t.line)).text.length?t.line<r.first+r.size-1?rt(t.line+1,0):null:new rt(t.line,t.ch+n)}function ao(r){r.setSelection(rt(r.firstLine(),0),rt(r.lastLine()),G)}function fo(r,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(t,n,e,o){t&&(i.from=at(r,t)),n&&(i.to=at(r,n)),e&&(i.text=e),void 0!==o&&(i.origin=o)}),vr(r,"beforeChange",r,i),r.cm&&vr(r.cm,"beforeChange",r.cm,i),i.canceled?(r.cm&&(r.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function co(r,t,n){if(r.cm){if(!r.cm.curOp)return re(r.cm,co)(r,t,n);if(r.cm.state.suppressEdits)return}if(!(gr(r,"beforeChange")||r.cm&&gr(r.cm,"beforeChange"))||(t=fo(r,t,!0))){var i=kt&&!n&&function(r,t,n){var i=null;if(r.iter(t.line,n.line+1,(function(r){if(r.markedSpans)for(var t=0;t<r.markedSpans.length;++t){var n=r.markedSpans[t].marker;!n.readOnly||i&&-1!=F(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var e=[{from:t,to:n}],o=0;o<i.length;++o)for(var u=i[o],a=u.find(0),f=0;f<e.length;++f){var c=e[f];if(!(tt(c.to,a.from)<0||tt(c.from,a.to)>0)){var l=[f,1],s=tt(c.from,a.from),h=tt(c.to,a.to);(s<0||!u.inclusiveLeft&&!s)&&l.push({from:c.from,to:a.from}),(h>0||!u.inclusiveRight&&!h)&&l.push({from:a.to,to:c.to}),e.splice.apply(e,l),f+=l.length-3}}return e}(r,t.from,t.to);if(i)for(var e=i.length-1;e>=0;--e)lo(r,{from:i[e].from,to:i[e].to,text:e?[""]:t.text,origin:t.origin});else lo(r,t)}}function lo(r,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ne(r,t);Fe(r,t,n,r.cm?r.cm.curOp.id:NaN),vo(r,t,n,Lt(r,t));var i=[];Re(r,(function(r,n){n||-1!=F(i,r.history)||(bo(r.history,t),i.push(r.history)),vo(r,t,null,Lt(r,t))}))}}function so(r,t,n){var i=r.cm&&r.cm.state.suppressEdits;if(!i||n){for(var e,o=r.history,u=r.sel,a="undo"==t?o.done:o.undone,f="undo"==t?o.undone:o.done,c=0;c<a.length&&(e=a[c],n?!e.ranges||e.equals(r.sel):e.ranges);c++);if(c!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(e=a.pop()).ranges){if(i)return void a.push(e);break}if(Ge(e,f),n&&!e.equals(r.sel))return void Ze(r,e,{clearRedo:!1});u=e}var l=[];Ge(u,f),f.push({changes:l,generation:o.generation}),o.generation=e.generation||++o.maxGeneration;for(var s=gr(r,"beforeChange")||r.cm&&gr(r.cm,"beforeChange"),h=function(n){var i=e.changes[n];if(i.origin=t,s&&!fo(r,i,!1))return a.length=0,{};l.push(je(r,i));var o=n?Ne(r,i):J(a);vo(r,i,o,$e(r,i)),!n&&r.cm&&r.cm.scrollIntoView({from:i.from,to:Le(i)});var u=[];Re(r,(function(r,t){t||-1!=F(u,r.history)||(bo(r.history,i),u.push(r.history)),vo(r,i,null,$e(r,i))}))},d=e.changes.length-1;d>=0;--d){var v=h(d);if(v)return v.v}}}}function ho(r,t){if(0!=t&&(r.first+=t,r.sel=new Me(K(r.sel.ranges,(function(r){return new Ae(rt(r.anchor.line+t,r.anchor.ch),rt(r.head.line+t,r.head.ch))})),r.sel.primIndex),r.cm)){si(r.cm,r.first,r.first-t,t);for(var n=r.cm.display,i=n.viewFrom;i<n.viewTo;i++)hi(r.cm,i,"gutter")}}function vo(r,t,n,i){if(r.cm&&!r.cm.curOp)return re(r.cm,vo)(r,t,n,i);if(t.to.line<r.first)ho(r,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>r.lastLine())){if(t.from.line<r.first){var e=t.text.length-1-(r.first-t.from.line);ho(r,e),t={from:rt(r.first,0),to:rt(t.to.line+e,t.to.ch),text:[J(t.text)],origin:t.origin}}var o=r.lastLine();t.to.line>o&&(t={from:t.from,to:rt(o,_r(r,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qr(r,t.from,t.to),n||(n=Ne(r,t)),r.cm?function(r,t,n){var i=r.doc,e=r.display,o=t.from,u=t.to,a=!1,f=o.line;r.options.lineWrapping||(f=Yr(jt(_r(i,o.line))),i.iter(f,u.line+1,(function(r){if(r==e.maxLine)return a=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&pr(r),Oe(i,t,n,ai(r)),r.options.lineWrapping||(i.iter(f,o.line+t.text.length,(function(r){var t=Vt(r);t>e.maxLineLength&&(e.maxLine=r,e.maxLineLength=t,e.maxLineChanged=!0,a=!1)})),a&&(r.curOp.updateMaxLine=!0)),function(r,t){if(r.modeFrontier=Math.min(r.modeFrontier,t),!(r.highlightFrontier<t-10)){for(var n=r.first,i=t-1;i>n;i--){var e=_r(r,i).stateAfter;if(e&&(!(e instanceof ct)||i+e.lookAhead<t)){n=i+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,n)}}(i,o.line),ie(r,400);var c=t.text.length-(u.line-o.line)-1;t.full?si(r):o.line!=u.line||1!=t.text.length||Ie(r.doc,t)?si(r,o.line,u.line+1,c):hi(r,o.line,"text");var l=gr(r,"changes"),s=gr(r,"change");if(s||l){var h={from:o,to:u,text:t.text,removed:t.removed,origin:t.origin};s&&fn(r,"change",r,h),l&&(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(h)}r.display.selForContextMenu=null}(r.cm,t,i):Oe(r,t,i),ro(r,n,G),r.cantEdit&&oo(r,rt(r.firstLine(),0))&&(r.cantEdit=!1)}}function mo(r,t,n,i,e){var o;i||(i=n),tt(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof t&&(t=r.splitLines(t)),co(r,{from:n,to:i,text:t,origin:e})}function po(r,t,n,i){n<r.line?r.line+=i:t<r.line&&(r.line=t,r.ch=0)}function go(r,t,n,i){for(var e=0;e<r.length;++e){var o=r[e],u=!0;if(o.ranges){o.copied||((o=r[e]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)po(o.ranges[a].anchor,t,n,i),po(o.ranges[a].head,t,n,i)}else{for(var f=0;f<o.changes.length;++f){var c=o.changes[f];if(n<c.from.line)c.from=rt(c.from.line+i,c.from.ch),c.to=rt(c.to.line+i,c.to.ch);else if(t<=c.to.line){u=!1;break}}u||(r.splice(0,e+1),e=0)}}}function bo(r,t){var n=t.from.line,i=t.to.line,e=t.text.length-(i-n)-1;go(r.done,n,i,e),go(r.undone,n,i,e)}function wo(r,t,n,i){var e=t,o=t;return"number"==typeof t?o=_r(r,ut(r,t)):e=Yr(t),null==e?null:(i(o,e)&&r.cm&&hi(r.cm,e,n),o)}function Co(r){this.lines=r,this.parent=null;for(var t=0,n=0;n<r.length;++n)r[n].parent=this,t+=r[n].height;this.height=t}function ko(r){this.children=r;for(var t=0,n=0,i=0;i<r.length;++i){var e=r[i];t+=e.chunkSize(),n+=e.height,e.parent=this}this.size=t,this.height=n,this.parent=null}Ae.prototype.from=function(){return ot(this.anchor,this.head)},Ae.prototype.to=function(){return et(this.anchor,this.head)},Ae.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Co.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var n=r,i=r+t;n<i;++n){var e=this.lines[n];this.height-=e.height,Qt(e),fn(e,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,n){this.height+=n,this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(r,t,n){for(var i=r+t;r<i;++r)if(n(this.lines[r]))return!0}},ko.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],e=i.chunkSize();if(r<e){var o=Math.min(t,e-r),u=i.height;if(i.removeInner(r,o),this.height-=u-i.height,e==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;r=0}else r-=e}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Co))){var a=[];this.collapse(a),this.children=[new Co(a)],this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t)this.children[t].collapse(r)},insertInner:function(r,t,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var e=this.children[i],o=e.chunkSize();if(r<=o){if(e.insertInner(r,t,n),e.lines&&e.lines.length>50){for(var u=e.lines.length%25+25,a=u;a<e.lines.length;){var f=new Co(e.lines.slice(a,a+=25));e.height-=f.height,this.children.splice(++i,0,f),f.parent=this}e.lines=e.lines.slice(0,u),this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var r=this;do{var t=new ko(r.children.splice(r.children.length-5,5));if(r.parent){r.size-=t.size,r.height-=t.height;var n=F(r.parent.children,r);r.parent.children.splice(n+1,0,t)}else{var i=new ko(r.children);i.parent=r,r.children=[i,t],r=i}t.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()}},iterN:function(r,t,n){for(var i=0;i<this.children.length;++i){var e=this.children[i],o=e.chunkSize();if(r<o){var u=Math.min(t,o-r);if(e.iterN(r,u,n))return!0;if(0==(t-=u))break;r=0}else r-=o}}};var Mo=function(r,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=r,this.node=t};function Ao(r,t,n){Ht(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)&&Di(r,n)}Mo.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,n=this.line,i=Yr(n);if(null!=i&&t){for(var e=0;e<t.length;++e)t[e]==this&&t.splice(e--,1);t.length||(n.widgets=null);var o=kn(this);Kr(n,Math.max(0,n.height-o)),r&&(Zi(r,(function(){Ao(r,n,-o),hi(r,i,"widget")})),fn(r,"lineWidgetCleared",r,this,i))}},Mo.prototype.changed=function(){var r=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var e=kn(this)-t;e&&(Pt(this.doc,i)||Kr(i,i.height+e),n&&Zi(n,(function(){n.curOp.forceUpdate=!0,Ao(n,i,e),fn(n,"lineWidgetChanged",n,r,Yr(i))})))},br(Mo);var yo=0,xo=function(r,t){this.lines=[],this.type=t,this.doc=r,this.id=++yo};function Lo(r,t,n,i,e){if(i&&i.shared)return function(r,t,n,i,e){(i=z(i)).shared=!1;var o=[Lo(r,t,n,i,e)],u=o[0],a=i.widgetNode;return Re(r,(function(r){a&&(i.widgetNode=a.cloneNode(!0)),o.push(Lo(r,at(r,t),at(r,n),i,e));for(var f=0;f<r.linked.length;++f)if(r.linked[f].isParent)return;u=J(o)})),new So(o,u)}(r,t,n,i,e);if(r.cm&&!r.cm.curOp)return re(r.cm,Lo)(r,t,n,i,e);var o=new xo(r,e),u=tt(t,n);if(i&&z(i,o,!1),u>0||0==u&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(zt(r,t.line,t,n,o)||t.line!=n.line&&zt(r,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Mt=!0}o.addToHistory&&Fe(r,{from:t,to:n,origin:"markText"},r.sel,NaN);var a,f=t.line,c=r.cm;if(r.iter(f,n.line+1,(function(i){c&&o.collapsed&&!c.options.lineWrapping&&jt(i)==c.display.maxLine&&(a=!0),o.collapsed&&f!=t.line&&Kr(i,0),function(r,t,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));i&&r.markedSpans&&i.has(r.markedSpans)?r.markedSpans.push(t):(r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t],i&&i.add(r.markedSpans)),t.marker.attachLine(r)}(i,new At(o,f==t.line?t.ch:null,f==n.line?n.ch:null),r.cm&&r.cm.curOp),++f})),o.collapsed&&r.iter(t.line,n.line+1,(function(t){Pt(r,t)&&Kr(t,0)})),o.clearOnEnter&&sr(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(kt=!0,(r.history.done.length||r.history.undone.length)&&r.clearHistory()),o.collapsed&&(o.id=++yo,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)si(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var l=t.line;l<=n.line;l++)hi(c,l,"text");o.atomic&&no(c.doc),fn(c,"markerAdded",c,o)}return o}xo.prototype.clear=function(){if(!this.explicitlyCleared){var r=this.doc.cm,t=r&&!r.curOp;if(t&&_i(r),gr(this,"clear")){var n=this.find();n&&fn(this,"clear",n.from,n.to)}for(var i=null,e=null,o=0;o<this.lines.length;++o){var u=this.lines[o],a=yt(u.markedSpans,this);r&&!this.collapsed?hi(r,Yr(u),"text"):r&&(null!=a.to&&(e=Yr(u)),null!=a.from&&(i=Yr(u))),u.markedSpans=xt(u.markedSpans,a),null==a.from&&this.collapsed&&!Pt(this.doc,u)&&r&&Kr(u,ii(r.display))}if(r&&this.collapsed&&!r.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var c=jt(this.lines[f]),l=Vt(c);l>r.display.maxLineLength&&(r.display.maxLine=c,r.display.maxLineLength=l,r.display.maxLineChanged=!0)}null!=i&&r&&this.collapsed&&si(r,i,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,r&&no(r.doc)),r&&fn(r,"markerCleared",r,this,i,e),t&&Qi(r),this.parent&&this.parent.clear()}},xo.prototype.find=function(r,t){var n,i;null==r&&"bookmark"==this.type&&(r=1);for(var e=0;e<this.lines.length;++e){var o=this.lines[e],u=yt(o.markedSpans,this);if(null!=u.from&&(n=rt(t?o:Yr(o),u.from),-1==r))return n;if(null!=u.to&&(i=rt(t?o:Yr(o),u.to),1==r))return i}return n&&{from:n,to:i}},xo.prototype.changed=function(){var r=this,t=this.find(-1,!0),n=this,i=this.doc.cm;t&&i&&Zi(i,(function(){var e=t.line,o=Yr(t.line),u=Tn(i,o);if(u&&(jn(u),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Pt(n.doc,e)&&null!=n.height){var a=n.height;n.height=null;var f=kn(n)-a;f&&Kr(e,e.height+f)}fn(i,"markerChanged",i,r)}))},xo.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=F(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(r)},xo.prototype.detachLine=function(r){if(this.lines.splice(F(this.lines,r),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},br(xo);var So=function(r,t){this.markers=r,this.primary=t;for(var n=0;n<r.length;++n)r[n].parent=this};function No(r){return r.findMarks(rt(r.first,0),r.clipPos(rt(r.lastLine())),(function(r){return r.parent}))}function Eo(r){for(var t=function(t){var n=r[t],i=[n.primary.doc];Re(n.primary.doc,(function(r){return i.push(r)}));for(var e=0;e<n.markers.length;e++){var o=n.markers[e];-1==F(i,o.doc)&&(o.parent=null,n.markers.splice(e--,1))}},n=0;n<r.length;n++)t(n)}So.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var r=0;r<this.markers.length;++r)this.markers[r].clear();fn(this,"clear")}},So.prototype.find=function(r,t){return this.primary.find(r,t)},br(So);var Do=0,To=function(r,t,n,i,e){if(!(this instanceof To))return new To(r,t,n,i,e);null==n&&(n=0),ko.call(this,[new Co([new _t("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=rt(n,0);this.sel=xe(o),this.history=new ze(null),this.id=++Do,this.modeOption=t,this.lineSep=i,this.direction="rtl"==e?"rtl":"ltr",this.extend=!1,"string"==typeof r&&(r=this.splitLines(r)),Oe(this,{from:o,to:o,text:r}),Ze(this,xe(o),G)};To.prototype=X(ko.prototype,{constructor:To,iter:function(r,t,n){n?this.iterN(r-this.first,t-r,n):this.iterN(this.first,this.first+this.size,r)},insert:function(r,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(r-this.first,t,n)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=Jr(this,this.first,this.first+this.size);return!1===r?t:t.join(r||this.lineSeparator())},setValue:ne((function(r){var t=rt(this.first,0),n=this.first+this.size-1;co(this,{from:t,to:rt(n,_r(this,n).text.length),text:this.splitLines(r),origin:"setValue",full:!0},!0),this.cm&&Ii(this.cm,0,0),Ze(this,xe(t),G)})),replaceRange:function(r,t,n,i){mo(this,r,t=at(this,t),n=n?at(this,n):t,i)},getRange:function(r,t,n){var i=Qr(this,at(this,r),at(this,t));return!1===n?i:i.join(""===n?"":n||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(qr(this,r))return _r(this,r)},getLineNumber:function(r){return Yr(r)},getLineHandleVisualStart:function(r){return"number"==typeof r&&(r=_r(this,r)),jt(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return at(this,r)},getCursor:function(r){var t=this.sel.primary();return null==r||"head"==r?t.head:"anchor"==r?t.anchor:"end"==r||"to"==r||!1===r?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ne((function(r,t,n){Xe(this,at(this,"number"==typeof r?rt(r,t||0):r),null,n)})),setSelection:ne((function(r,t,n){Xe(this,at(this,r),at(this,t||r),n)})),extendSelection:ne((function(r,t,n){Je(this,at(this,r),t&&at(this,t),n)})),extendSelections:ne((function(r,t){Ke(this,ft(this,r),t)})),extendSelectionsBy:ne((function(r,t){Ke(this,ft(this,K(this.sel.ranges,r)),t)})),setSelections:ne((function(r,t,n){if(r.length){for(var i=[],e=0;e<r.length;e++)i[e]=new Ae(at(this,r[e].anchor),at(this,r[e].head||r[e].anchor));null==t&&(t=Math.min(r.length-1,this.sel.primIndex)),Ze(this,ye(this.cm,i,t),n)}})),addSelection:ne((function(r,t,n){var i=this.sel.ranges.slice(0);i.push(new Ae(at(this,r),at(this,t||r))),Ze(this,ye(this.cm,i,i.length-1),n)})),getSelection:function(r){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var e=Qr(this,n[i].from(),n[i].to());t=t?t.concat(e):e}return!1===r?t:t.join(r||this.lineSeparator())},getSelections:function(r){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var e=Qr(this,n[i].from(),n[i].to());!1!==r&&(e=e.join(r||this.lineSeparator())),t[i]=e}return t},replaceSelection:function(r,t,n){for(var i=[],e=0;e<this.sel.ranges.length;e++)i[e]=r;this.replaceSelections(i,t,n||"+input")},replaceSelections:ne((function(r,t,n){for(var i=[],e=this.sel,o=0;o<e.ranges.length;o++){var u=e.ranges[o];i[o]={from:u.from(),to:u.to(),text:this.splitLines(r[o]),origin:n}}for(var a=t&&"end"!=t&&function(r,t,n){for(var i=[],e=rt(r.first,0),o=e,u=0;u<t.length;u++){var a=t[u],f=Ee(a.from,e,o),c=Ee(Le(a),e,o);if(e=a.to,o=c,"around"==n){var l=r.sel.ranges[u],s=tt(l.head,l.anchor)<0;i[u]=new Ae(s?c:f,s?f:c)}else i[u]=new Ae(f,f)}return new Me(i,r.sel.primIndex)}(this,i,t),f=i.length-1;f>=0;f--)co(this,i[f]);a?qe(this,a):this.cm&&Ti(this.cm)})),undo:ne((function(){so(this,"undo")})),redo:ne((function(){so(this,"redo")})),undoSelection:ne((function(){so(this,"undo",!0)})),redoSelection:ne((function(){so(this,"redo",!0)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){for(var r=this.history,t=0,n=0,i=0;i<r.done.length;i++)r.done[i].ranges||++t;for(var e=0;e<r.undone.length;e++)r.undone[e].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var r=this;this.history=new ze(this.history),Re(this,(function(t){return t.history=r.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(r){return r&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:_e(this.history.done),undone:_e(this.history.undone)}},setHistory:function(r){var t=this.history=new ze(this.history);t.done=_e(r.done.slice(0),null,!0),t.undone=_e(r.undone.slice(0),null,!0)},setGutterMarker:ne((function(r,t,n){return wo(this,r,"gutter",(function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&tr(i)&&(r.gutterMarkers=null),!0}))})),clearGutter:ne((function(r){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[r]&&wo(t,n,"gutter",(function(){return n.gutterMarkers[r]=null,tr(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(r){var t;if("number"==typeof r){if(!qr(this,r))return null;if(t=r,!(r=_r(this,r)))return null}else if(null==(t=Yr(r)))return null;return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:ne((function(r,t,n){return wo(this,r,"gutter"==t?"gutter":"class",(function(r){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(r[i]){if(y(n).test(r[i]))return!1;r[i]+=" "+n}else r[i]=n;return!0}))})),removeLineClass:ne((function(r,t,n){return wo(this,r,"gutter"==t?"gutter":"class",(function(r){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",e=r[i];if(!e)return!1;if(null==n)r[i]=null;else{var o=e.match(y(n));if(!o)return!1;var u=o.index+o[0].length;r[i]=e.slice(0,o.index)+(o.index&&u!=e.length?" ":"")+e.slice(u)||null}return!0}))})),addLineWidget:ne((function(r,t,n){return function(r,t,n,i){var e=new Mo(r,n,i),o=r.cm;return o&&e.noHScroll&&(o.display.alignWidgets=!0),wo(r,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==e.insertAt?n.push(e):n.splice(Math.min(n.length,Math.max(0,e.insertAt)),0,e),e.line=t,o&&!Pt(r,t)){var i=Ht(t)<r.scrollTop;Kr(t,t.height+kn(e)),i&&Di(o,e.height),o.curOp.forceUpdate=!0}return!0})),o&&fn(o,"lineWidgetAdded",o,e,"number"==typeof t?t:Yr(t)),e}(this,r,t,n)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,n){return Lo(this,at(this,r),at(this,t),n,n&&n.type||"range")},setBookmark:function(r,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Lo(this,r=at(this,r),r,n,"bookmark")},findMarksAt:function(r){var t=[],n=_r(this,(r=at(this,r)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var e=n[i];(null==e.from||e.from<=r.ch)&&(null==e.to||e.to>=r.ch)&&t.push(e.marker.parent||e.marker)}return t},findMarks:function(r,t,n){r=at(this,r),t=at(this,t);var i=[],e=r.line;return this.iter(r.line,t.line+1,(function(o){var u=o.markedSpans;if(u)for(var a=0;a<u.length;a++){var f=u[a];null!=f.to&&e==r.line&&r.ch>=f.to||null==f.from&&e!=r.line||null!=f.from&&e==t.line&&f.from>=t.ch||n&&!n(f.marker)||i.push(f.marker.parent||f.marker)}++e})),i},getAllMarks:function(){var r=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&r.push(n[i].marker)})),r},posFromIndex:function(r){var t,n=this.first,i=this.lineSeparator().length;return this.iter((function(e){var o=e.text.length+i;if(o>r)return t=r,!0;r-=o,++n})),at(this,rt(n,t))},indexFromPos:function(r){var t=(r=at(this,r)).ch;if(r.line<this.first||r.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,r.line,(function(r){t+=r.text.length+n})),t},copy:function(r){var t=new To(Jr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,r&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(r){r||(r={});var t=this.first,n=this.first+this.size;null!=r.from&&r.from>t&&(t=r.from),null!=r.to&&r.to<n&&(n=r.to);var i=new To(Jr(this,t,n),r.mode||this.modeOption,t,this.lineSep,this.direction);return r.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:r.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:r.sharedHist}],function(r,t){for(var n=0;n<t.length;n++){var i=t[n],e=i.find(),o=r.clipPos(e.from),u=r.clipPos(e.to);if(tt(o,u)){var a=Lo(r,o,u,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}(i,No(this)),i},unlinkDoc:function(r){if(r instanceof Su&&(r=r.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==r){this.linked.splice(t,1),r.unlinkDoc(this),Eo(No(this));break}if(r.history==this.history){var n=[r.id];Re(r,(function(r){return n.push(r.id)}),!0),r.history=new ze(null),r.history.done=_e(this.history.done,n),r.history.undone=_e(this.history.undone,n)}},iterLinkedDocs:function(r){Re(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){return this.lineSep?r.split(this.lineSep):Tr(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ne((function(r){var t;"rtl"!=r&&(r="ltr"),r!=this.direction&&(this.direction=r,this.iter((function(r){return r.order=null})),this.cm&&Zi(t=this.cm,(function(){Ue(t),si(t)})))}))}),To.prototype.eachLine=To.prototype.iter;var Io=0;function Oo(r){var t=this;if(Ro(t),!mr(t,r)&&!Mn(t.display,r)){wr(r),u&&(Io=+new Date);var n=ci(t,r,!0),i=r.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var e=i.length,o=Array(e),a=0,f=function(){++a==e&&re(t,(function(){var r={from:n=at(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(r){return null!=r})).join(t.doc.lineSeparator())),origin:"paste"};co(t.doc,r),qe(t.doc,xe(at(t.doc,n),at(t.doc,Le(r))))}))()},c=function(r,n){if(t.options.allowDropFileTypes&&-1==F(t.options.allowDropFileTypes,r.type))f();else{var i=new FileReader;i.onerror=function(){return f()},i.onload=function(){var r=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(r)||(o[n]=r),f()},i.readAsText(r)}},l=0;l<i.length;l++)c(i[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(r),void setTimeout((function(){return t.display.input.focus()}),20);try{var s=r.dataTransfer.getData("Text");if(s){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),ro(t.doc,xe(n,n)),h)for(var d=0;d<h.length;++d)mo(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(r){}}}}function Ro(r){r.display.dragCursor&&(r.display.lineSpace.removeChild(r.display.dragCursor),r.display.dragCursor=null)}function Bo(r){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var e=t[i].CodeMirror;e&&n.push(e)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)r(n[t])}))}}var Uo=!1;function zo(){var r;Uo||(sr(window,"resize",(function(){null==r&&(r=setTimeout((function(){r=null,Bo(jo)}),100))})),sr(window,"blur",(function(){return Bo(xi)})),Uo=!0)}function jo(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,r.setSize()}for(var Wo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fo=0;Fo<10;Fo++)Wo[Fo+48]=Wo[Fo+96]=String(Fo);for(var Po=65;Po<=90;Po++)Wo[Po]=String.fromCharCode(Po);for(var Go=1;Go<=12;Go++)Wo[Go+111]=Wo[Go+63235]="F"+Go;var Ho={};function Vo(r){var t,n,i,e,o=r.split(/-(?!$)/);r=o[o.length-1];for(var u=0;u<o.length-1;u++){var a=o[u];if(/^(cmd|meta|m)$/i.test(a))e=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return t&&(r="Alt-"+r),n&&(r="Ctrl-"+r),e&&(r="Cmd-"+r),i&&(r="Shift-"+r),r}function $o(r){var t={};for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete r[n];continue}for(var e=K(n.split(" "),Vo),o=0;o<e.length;o++){var u=void 0,a=void 0;o==e.length-1?(a=e.join(" "),u=i):(a=e.slice(0,o+1).join(" "),u="...");var f=t[a];if(f){if(f!=u)throw new Error("Inconsistent bindings for "+a)}else t[a]=u}delete r[n]}for(var c in t)r[c]=t[c];return r}function _o(r,t,n,i){var e=(t=Yo(t)).call?t.call(r,i):t[r];if(!1===e)return"nothing";if("..."===e)return"multi";if(null!=e&&n(e))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return _o(r,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var u=_o(r,t.fallthrough[o],n,i);if(u)return u}}}function Qo(r){var t="string"==typeof r?r:Wo[r.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Jo(r,t,n){var i=r;return t.altKey&&"Alt"!=i&&(r="Alt-"+r),(M?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(r="Ctrl-"+r),(M?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(r="Cmd-"+r),!n&&t.shiftKey&&"Shift"!=i&&(r="Shift-"+r),r}function Ko(r,t){if(s&&34==r.keyCode&&r.char)return!1;var n=Wo[r.keyCode];return null!=n&&!r.altGraphKey&&(3==r.keyCode&&r.code&&(n=r.code),Jo(n,r,t))}function Yo(r){return"string"==typeof r?Ho[r]:r}function Xo(r,t){for(var n=r.doc.sel.ranges,i=[],e=0;e<n.length;e++){for(var o=t(n[e]);i.length&&tt(o.from,J(i).to)<=0;){var u=i.pop();if(tt(u.from,o.from)<0){o.from=u.from;break}}i.push(o)}Zi(r,(function(){for(var t=i.length-1;t>=0;t--)mo(r.doc,"",i[t].from,i[t].to,"+delete");Ti(r)}))}function qo(r,t,n){var i=er(r.text,t+n,n);return i<0||i>r.text.length?null:i}function Zo(r,t,n){var i=qo(r,t.ch,n);return null==i?null:new rt(t.line,i,n<0?"after":"before")}function ru(r,t,n,i,e){if(r){"rtl"==t.doc.direction&&(e=-e);var o=cr(n,t.doc.direction);if(o){var u,a=e<0?J(o):o[0],f=e<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=In(t,n),l=On(t,c,u=e<0?n.text.length-1:0).top;u=or((function(r){return On(t,c,r).top==l}),e<0==(1==a.level)?a.from:a.to-1,u),"before"==f&&(u=qo(n,u,1))}else u=e<0?a.to:a.from;return new rt(i,u,f)}}return new rt(i,e<0?n.text.length:0,e<0?"before":"after")}Ho.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ho.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ho.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ho.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ho.default=b?Ho.macDefault:Ho.pcDefault;var tu={selectAll:ao,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),G)},killLine:function(r){return Xo(r,(function(t){if(t.empty()){var n=_r(r.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<r.lastLine()?{from:t.head,to:rt(t.head.line+1,0)}:{from:t.head,to:rt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(r){return Xo(r,(function(t){return{from:rt(t.from().line,0),to:at(r.doc,rt(t.to().line+1,0))}}))},delLineLeft:function(r){return Xo(r,(function(r){return{from:rt(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Xo(r,(function(t){var n=r.charCoords(t.head,"div").top+5;return{from:r.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(r){return Xo(r,(function(t){var n=r.charCoords(t.head,"div").top+5,i=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(rt(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(rt(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return nu(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return iu(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return function(r,t){var n=_r(r.doc,t),i=function(r){for(var t;t=Bt(r);)r=t.find(1,!0).line;return r}(n);return i!=n&&(t=Yr(i)),ru(!0,r,n,t,-1)}(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var n=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var n=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var n=r.cursorCoords(t.head,"div").top+5,i=r.coordsChar({left:0,top:n},"div");return i.ch<r.getLine(i.line).search(/\S/)?iu(r,t.head):i}),V)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){for(var t=[],n=r.listSelections(),i=r.options.tabSize,e=0;e<n.length;e++){var o=n[e].from(),u=j(r.getLine(o.line),o.ch,i);t.push(Q(i-u%i))}r.replaceSelections(t)},defaultTab:function(r){r.somethingSelected()?r.indentSelection("add"):r.execCommand("insertTab")},transposeChars:function(r){return Zi(r,(function(){for(var t=r.listSelections(),n=[],i=0;i<t.length;i++)if(t[i].empty()){var e=t[i].head,o=_r(r.doc,e.line).text;if(o)if(e.ch==o.length&&(e=new rt(e.line,e.ch-1)),e.ch>0)e=new rt(e.line,e.ch+1),r.replaceRange(o.charAt(e.ch-1)+o.charAt(e.ch-2),rt(e.line,e.ch-2),e,"+transpose");else if(e.line>r.doc.first){var u=_r(r.doc,e.line-1).text;u&&(e=new rt(e.line,1),r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+u.charAt(u.length-1),rt(e.line-1,u.length-1),e,"+transpose"))}n.push(new Ae(e,e))}r.setSelections(n)}))},newlineAndIndent:function(r){return Zi(r,(function(){for(var t=r.listSelections(),n=t.length-1;n>=0;n--)r.replaceRange(r.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=r.listSelections();for(var i=0;i<t.length;i++)r.indentLine(t[i].from().line,null,!0);Ti(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function nu(r,t){var n=_r(r.doc,t),i=jt(n);return i!=n&&(t=Yr(i)),ru(!0,r,i,t,1)}function iu(r,t){var n=nu(r,t.line),i=_r(r.doc,n.line),e=cr(i,r.doc.direction);if(!e||0==e[0].level){var o=Math.max(n.ch,i.text.search(/\S/));return rt(n.line,t.line==n.line&&t.ch<=o&&t.ch?0:o,n.sticky)}return n}function eu(r,t,n){if("string"==typeof t&&!(t=tu[t]))return!1;r.display.input.ensurePolled();var i=r.display.shift,e=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),n&&(r.display.shift=!1),e=t(r)!=P}finally{r.display.shift=i,r.state.suppressEdits=!1}return e}var ou=new W;function uu(r,t,n,i){var e=r.state.keySeq;if(e){if(Qo(t))return"handled";if(/\'$/.test(t)?r.state.keySeq=null:ou.set(50,(function(){r.state.keySeq==e&&(r.state.keySeq=null,r.display.input.reset())})),au(r,e+" "+t,n,i))return!0}return au(r,t,n,i)}function au(r,t,n,i){var e=function(r,t,n){for(var i=0;i<r.state.keyMaps.length;i++){var e=_o(t,r.state.keyMaps[i],n,r);if(e)return e}return r.options.extraKeys&&_o(t,r.options.extraKeys,n,r)||_o(t,r.options.keyMap,n,r)}(r,t,i);return"multi"==e&&(r.state.keySeq=t),"handled"==e&&fn(r,"keyHandled",r,t,n),"handled"!=e&&"multi"!=e||(wr(n),ki(r)),!!e}function fu(r,t){var n=Ko(t,!0);return!!n&&(t.shiftKey&&!r.state.keySeq?uu(r,"Shift-"+n,t,(function(t){return eu(r,t,!0)}))||uu(r,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return eu(r,t)})):uu(r,n,t,(function(t){return eu(r,t)})))}var cu=null;function lu(r){var t=this;if(!(r.target&&r.target!=t.display.input.getField()||(t.curOp.focus=I(),mr(t,r)))){u&&a<11&&27==r.keyCode&&(r.returnValue=!1);var i=r.keyCode;t.display.shift=16==i||r.shiftKey;var e=fu(t,r);s&&(cu=e?i:null,e||88!=i||Or||!(b?r.metaKey:r.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!e&&46==i&&r.shiftKey&&!r.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(r){var t=r.display.lineDiv;function n(r){18!=r.keyCode&&r.altKey||(L(t,"CodeMirror-crosshair"),dr(document,"keyup",n),dr(document,"mouseover",n))}O(t,"CodeMirror-crosshair"),sr(document,"keyup",n),sr(document,"mouseover",n)}(t)}}function su(r){16==r.keyCode&&(this.doc.sel.shift=!1),mr(this,r)}function hu(r){var t=this;if(!(r.target&&r.target!=t.display.input.getField()||Mn(t.display,r)||mr(t,r)||r.ctrlKey&&!r.altKey||b&&r.metaKey)){var n=r.keyCode,i=r.charCode;if(s&&n==cu)return cu=null,void wr(r);if(!s||r.which&&!(r.which<10)||!fu(t,r)){var e=String.fromCharCode(null==i?n:i);"\b"!=e&&(function(r,t,n){return uu(r,"'"+n+"'",t,(function(t){return eu(r,t,!0)}))}(t,r,e)||t.display.input.onKeyPress(r))}}}var du,vu,mu=function(r,t,n){this.time=r,this.pos=t,this.button=n};function pu(r){var t=this,n=t.display;if(!(mr(t,r)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=r.shiftKey,Mn(n,r))f||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!wu(t,r)){var i=ci(t,r),e=yr(r),o=i?function(r,t){var n=+new Date;return vu&&vu.compare(n,r,t)?(du=vu=null,"triple"):du&&du.compare(n,r,t)?(vu=new mu(n,r,t),du=null,"double"):(du=new mu(n,r,t),vu=null,"single")}(i,e):"single";window.focus(),1==e&&t.state.selectingText&&t.state.selectingText(r),i&&function(r,t,n,i,e){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),uu(r,Jo(o=(1==t?"Left":2==t?"Middle":"Right")+o,e),e,(function(t){if("string"==typeof t&&(t=tu[t]),!t)return!1;var i=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),i=t(r,n)!=P}finally{r.state.suppressEdits=!1}return i}))}(t,e,i,o,r)||(1==e?i?function(r,t,n,i){u?setTimeout(U(Mi,r),0):r.curOp.focus=I();var e,o=function(r,t,n){var i=r.getOption("configureMouse"),e=i?i(r,t,n):{};return null==e.unit&&(e.unit=(w?n.shiftKey&&n.metaKey:n.altKey)?"rectangle":"single"==t?"char":"double"==t?"word":"line"),(null==e.extend||r.doc.extend)&&(e.extend=r.doc.extend||n.shiftKey),null==e.addNew&&(e.addNew=b?n.metaKey:n.ctrlKey),null==e.moveOnDrag&&(e.moveOnDrag=!(b?n.altKey:n.ctrlKey)),e}(r,n,i),c=r.doc.sel;r.options.dragDrop&&Sr&&!r.isReadOnly()&&"single"==n&&(e=c.contains(t))>-1&&(tt((e=c.ranges[e]).from(),t)<0||t.xRel>0)&&(tt(e.to(),t)>0||t.xRel<0)?function(r,t,n,i){var e=r.display,o=!1,c=re(r,(function(t){f&&(e.scroller.draggable=!1),r.state.draggingText=!1,r.state.delayingBlurEvent&&(r.hasFocus()?r.state.delayingBlurEvent=!1:Ai(r)),dr(e.wrapper.ownerDocument,"mouseup",c),dr(e.wrapper.ownerDocument,"mousemove",l),dr(e.scroller,"dragstart",s),dr(e.scroller,"drop",c),o||(wr(t),i.addNew||Je(r.doc,n,null,null,i.extend),f&&!h||u&&9==a?setTimeout((function(){e.wrapper.ownerDocument.body.focus({preventScroll:!0}),e.input.focus()}),20):e.input.focus())})),l=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10},s=function(){return o=!0};f&&(e.scroller.draggable=!0),r.state.draggingText=c,c.copy=!i.moveOnDrag,sr(e.wrapper.ownerDocument,"mouseup",c),sr(e.wrapper.ownerDocument,"mousemove",l),sr(e.scroller,"dragstart",s),sr(e.scroller,"drop",c),r.state.delayingBlurEvent=!0,setTimeout((function(){return e.input.focus()}),20),e.scroller.dragDrop&&e.scroller.dragDrop()}(r,i,t,o):function(r,t,n,i){u&&Ai(r);var e=r.display,o=r.doc;wr(t);var a,f,c=o.sel,l=c.ranges;if(i.addNew&&!i.extend?(f=o.sel.contains(n),a=f>-1?l[f]:new Ae(n,n)):(a=o.sel.primary(),f=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new Ae(n,n)),n=ci(r,t,!0,!0),f=-1;else{var s=gu(r,n,i.unit);a=i.extend?Qe(a,s.anchor,s.head,i.extend):s}i.addNew?-1==f?(f=l.length,Ze(o,ye(r,l.concat([a]),f),{scroll:!1,origin:"*mouse"})):l.length>1&&l[f].empty()&&"char"==i.unit&&!i.extend?(Ze(o,ye(r,l.slice(0,f).concat(l.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Ye(o,f,a,H):(f=0,Ze(o,new Me([a],0),H),c=o.sel);var h=n;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==i.unit){for(var e=[],u=r.options.tabSize,l=j(_r(o,n.line).text,n.ch,u),s=j(_r(o,t.line).text,t.ch,u),d=Math.min(l,s),v=Math.max(l,s),m=Math.min(n.line,t.line),p=Math.min(r.lastLine(),Math.max(n.line,t.line));m<=p;m++){var g=_r(o,m).text,b=$(g,d,u);d==v?e.push(new Ae(rt(m,b),rt(m,b))):g.length>b&&e.push(new Ae(rt(m,b),rt(m,$(g,v,u))))}e.length||e.push(new Ae(n,n)),Ze(o,ye(r,c.ranges.slice(0,f).concat(e),f),{origin:"*mouse",scroll:!1}),r.scrollIntoView(t)}else{var w,C=a,k=gu(r,t,i.unit),M=C.anchor;tt(k.anchor,M)>0?(w=k.head,M=ot(C.from(),k.anchor)):(w=k.anchor,M=et(C.to(),k.head));var A=c.ranges.slice(0);A[f]=function(r,t){var n=t.anchor,i=t.head,e=_r(r.doc,n.line);if(0==tt(n,i)&&n.sticky==i.sticky)return t;var o=cr(e);if(!o)return t;var u=ar(o,n.ch,n.sticky),a=o[u];if(a.from!=n.ch&&a.to!=n.ch)return t;var f,c=u+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==o.length)return t;if(i.line!=n.line)f=(i.line-n.line)*("ltr"==r.doc.direction?1:-1)>0;else{var l=ar(o,i.ch,i.sticky),s=l-u||(i.ch-n.ch)*(1==a.level?-1:1);f=l==c-1||l==c?s<0:s>0}var h=o[c+(f?-1:0)],d=f==(1==h.level),v=d?h.from:h.to,m=d?"after":"before";return n.ch==v&&n.sticky==m?t:new Ae(new rt(n.line,v,m),i)}(r,new Ae(at(o,M),w)),Ze(o,ye(r,A,f),H)}}var v=e.wrapper.getBoundingClientRect(),m=0;function p(t){var n=++m,u=ci(r,t,!0,"rectangle"==i.unit);if(u)if(0!=tt(u,h)){r.curOp.focus=I(),d(u);var a=Ni(e,o);(u.line>=a.to||u.line<a.from)&&setTimeout(re(r,(function(){m==n&&p(t)})),150)}else{var f=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;f&&setTimeout(re(r,(function(){m==n&&(e.scroller.scrollTop+=f,p(t))})),50)}}function g(t){r.state.selectingText=!1,m=1/0,t&&(wr(t),e.input.focus()),dr(e.wrapper.ownerDocument,"mousemove",b),dr(e.wrapper.ownerDocument,"mouseup",w),o.history.lastSelOrigin=null}var b=re(r,(function(r){0!==r.buttons&&yr(r)?p(r):g(r)})),w=re(r,g);r.state.selectingText=w,sr(e.wrapper.ownerDocument,"mousemove",b),sr(e.wrapper.ownerDocument,"mouseup",w)}(r,i,t,o)}(t,i,o,r):Ar(r)==n.scroller&&wr(r):2==e?(i&&Je(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==e&&(A?t.display.input.onContextMenu(r):Ai(t)))}}function gu(r,t,n){if("char"==n)return new Ae(t,t);if("word"==n)return r.findWordAt(t);if("line"==n)return new Ae(rt(t.line,0),at(r.doc,rt(t.line+1,0)));var i=n(r,t);return new Ae(i.from,i.to)}function bu(r,t,n,i){var e,o;if(t.touches)e=t.touches[0].clientX,o=t.touches[0].clientY;else try{e=t.clientX,o=t.clientY}catch(r){return!1}if(e>=Math.floor(r.display.gutters.getBoundingClientRect().right))return!1;i&&wr(t);var u=r.display,a=u.lineDiv.getBoundingClientRect();if(o>a.bottom||!gr(r,n))return kr(t);o-=a.top-u.viewOffset;for(var f=0;f<r.display.gutterSpecs.length;++f){var c=u.gutters.childNodes[f];if(c&&c.getBoundingClientRect().right>=e)return vr(r,n,r,Xr(r.doc,o),r.display.gutterSpecs[f].className,t),kr(t)}}function wu(r,t){return bu(r,t,"gutterClick",!0)}function Cu(r,t){Mn(r.display,t)||function(r,t){return!!gr(r,"gutterContextMenu")&&bu(r,t,"gutterContextMenu",!1)}(r,t)||mr(r,t,"contextmenu")||A||r.display.input.onContextMenu(t)}function ku(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(r)}mu.prototype.compare=function(r,t,n){return this.time+400>r&&0==tt(t,this.pos)&&n==this.button};var Mu={toString:function(){return"CodeMirror.Init"}},Au={},yu={};function xu(r,t,n){if(!t!=!(n&&n!=Mu)){var i=r.display.dragFunctions,e=t?sr:dr;e(r.display.scroller,"dragstart",i.start),e(r.display.scroller,"dragenter",i.enter),e(r.display.scroller,"dragover",i.over),e(r.display.scroller,"dragleave",i.leave),e(r.display.scroller,"drop",i.drop)}}function Lu(r){r.options.lineWrapping?(O(r.display.wrapper,"CodeMirror-wrap"),r.display.sizer.style.minWidth="",r.display.sizerWidth=null):(L(r.display.wrapper,"CodeMirror-wrap"),$t(r)),fi(r),si(r),Fn(r),setTimeout((function(){return Pi(r)}),100)}function Su(r,t){var n=this;if(!(this instanceof Su))return new Su(r,t);this.options=t=t?z(t):{},z(Au,t,!1);var i=t.value;"string"==typeof i?i=new To(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var e=new Su.inputStyles[t.inputStyle](this),o=this.display=new pe(r,i,e,t);for(var c in o.wrapper.CodeMirror=this,ku(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new W,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),u&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(r){var t=r.display;sr(t.scroller,"mousedown",re(r,pu)),sr(t.scroller,"dblclick",u&&a<11?re(r,(function(t){if(!mr(r,t)){var n=ci(r,t);if(n&&!wu(r,t)&&!Mn(r.display,t)){wr(t);var i=r.findWordAt(n);Je(r.doc,i.anchor,i.head)}}})):function(t){return mr(r,t)||wr(t)}),sr(t.scroller,"contextmenu",(function(t){return Cu(r,t)})),sr(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Cu(r,n)}));var n,i={end:0};function e(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(r){if(1!=r.touches.length)return!1;var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function f(r,t){if(null==t.left)return!0;var n=t.left-r.left,i=t.top-r.top;return n*n+i*i>400}sr(t.scroller,"touchstart",(function(e){if(!mr(r,e)&&!o(e)&&!wu(r,e)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-i.end<=300?i:null},1==e.touches.length&&(t.activeTouch.left=e.touches[0].pageX,t.activeTouch.top=e.touches[0].pageY)}})),sr(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),sr(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Mn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,u=r.coordsChar(t.activeTouch,"page");o=!i.prev||f(i,i.prev)?new Ae(u,u):!i.prev.prev||f(i,i.prev.prev)?r.findWordAt(u):new Ae(rt(u.line,0),at(r.doc,rt(u.line+1,0))),r.setSelection(o.anchor,o.head),r.focus(),wr(n)}e()})),sr(t.scroller,"touchcancel",e),sr(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Bi(r,t.scroller.scrollTop),zi(r,t.scroller.scrollLeft,!0),vr(r,"scroll",r))})),sr(t.scroller,"mousewheel",(function(t){return ke(r,t)})),sr(t.scroller,"DOMMouseScroll",(function(t){return ke(r,t)})),sr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){mr(r,t)||Mr(t)},over:function(t){mr(r,t)||(function(r,t){var n=ci(r,t);if(n){var i=document.createDocumentFragment();bi(r,n,i),r.display.dragCursor||(r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),N(r.display.dragCursor,i)}}(r,t),Mr(t))},start:function(t){return function(r,t){if(u&&(!r.state.draggingText||+new Date-Io<100))Mr(t);else if(!mr(r,t)&&!Mn(r.display,t)&&(t.dataTransfer.setData("Text",r.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=E("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s&&(n.width=n.height=1,r.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),s&&n.parentNode.removeChild(n)}}(r,t)},drop:re(r,Oo),leave:function(t){mr(r,t)||Ro(r)}};var c=t.input.getField();sr(c,"keyup",(function(t){return su.call(r,t)})),sr(c,"keydown",re(r,lu)),sr(c,"keypress",re(r,hu)),sr(c,"focus",(function(t){return yi(r,t)})),sr(c,"blur",(function(t){return xi(r,t)}))}(this),zo(),_i(this),this.curOp.forceUpdate=!0,Be(this,i),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&yi(n)}),20):xi(this),yu)yu.hasOwnProperty(c)&&yu[c](this,t[c],Mu);he(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Nu.length;++l)Nu[l](this);Qi(this),f&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Su.defaults=Au,Su.optionHandlers=yu;var Nu=[];function Eu(r,t,n,i){var e,o=r.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?e=dt(r,t).state:n="prev");var u=r.options.tabSize,a=_r(o,t),f=j(a.text,null,u);a.stateAfter&&(a.stateAfter=null);var c,l=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&((c=o.mode.indent(e,a.text.slice(l.length),a.text))==P||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(_r(o,t-1).text,null,u):0:"add"==n?c=f+r.options.indentUnit:"subtract"==n?c=f-r.options.indentUnit:"number"==typeof n&&(c=f+n),c=Math.max(0,c);var s="",h=0;if(r.options.indentWithTabs)for(var d=Math.floor(c/u);d;--d)h+=u,s+="\t";if(h<c&&(s+=Q(c-h)),s!=l)return mo(o,s,rt(t,0),rt(t,l.length),"+input"),a.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==t&&m.head.ch<l.length){var p=rt(t,l.length);Ye(o,v,new Ae(p,p));break}}}Su.defineInitHook=function(r){return Nu.push(r)};var Du=null;function Tu(r){Du=r}function Iu(r,t,n,i,e){var o=r.doc;r.display.shift=!1,i||(i=o.sel);var u=+new Date-200,a="paste"==e||r.state.pasteIncoming>u,f=Tr(t),c=null;if(a&&i.ranges.length>1)if(Du&&Du.text.join("\n")==t){if(i.ranges.length%Du.text.length==0){c=[];for(var l=0;l<Du.text.length;l++)c.push(o.splitLines(Du.text[l]))}}else f.length==i.ranges.length&&r.options.pasteLinesPerSelection&&(c=K(f,(function(r){return[r]})));for(var s=r.curOp.updateInput,h=i.ranges.length-1;h>=0;h--){var d=i.ranges[h],v=d.from(),m=d.to();d.empty()&&(n&&n>0?v=rt(v.line,v.ch-n):r.state.overwrite&&!a?m=rt(m.line,Math.min(_r(o,m.line).text.length,m.ch+J(f).length)):a&&Du&&Du.lineWise&&Du.text.join("\n")==f.join("\n")&&(v=m=rt(v.line,0)));var p={from:v,to:m,text:c?c[h%c.length]:f,origin:e||(a?"paste":r.state.cutIncoming>u?"cut":"+input")};co(r.doc,p),fn(r,"inputRead",r,p)}t&&!a&&Ru(r,t),Ti(r),r.curOp.updateInput<2&&(r.curOp.updateInput=s),r.curOp.typing=!0,r.state.pasteIncoming=r.state.cutIncoming=-1}function Ou(r,t){var n=r.clipboardData&&r.clipboardData.getData("Text");if(n)return r.preventDefault(),t.isReadOnly()||t.options.disableInput||Zi(t,(function(){return Iu(t,n,0,null,"paste")})),!0}function Ru(r,t){if(r.options.electricChars&&r.options.smartIndent)for(var n=r.doc.sel,i=n.ranges.length-1;i>=0;i--){var e=n.ranges[i];if(!(e.head.ch>100||i&&n.ranges[i-1].head.line==e.head.line)){var o=r.getModeAt(e.head),u=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){u=Eu(r,e.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(_r(r.doc,e.head.line).text.slice(0,e.head.ch))&&(u=Eu(r,e.head.line,"smart"));u&&fn(r,"electricInput",r,e.head.line)}}}function Bu(r){for(var t=[],n=[],i=0;i<r.doc.sel.ranges.length;i++){var e=r.doc.sel.ranges[i].head.line,o={anchor:rt(e,0),head:rt(e+1,0)};n.push(o),t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Uu(r,t,n,i){r.setAttribute("autocorrect",n?"":"off"),r.setAttribute("autocapitalize",i?"":"off"),r.setAttribute("spellcheck",!!t)}function zu(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return f?r.style.width="1000px":r.setAttribute("wrap","off"),m&&(r.style.border="1px solid black"),Uu(r),t}function ju(r,t,n,i,e){var o=t,u=n,a=_r(r,t.line),f=e&&"rtl"==r.direction?-n:n;function c(o){var u,c;if("codepoint"==i){var l=a.text.charCodeAt(t.ch+(n>0?0:-1));u=isNaN(l)?null:new rt(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*((n>0?l>=55296&&l<56320:l>=56320&&l<57343)?2:1))),-n)}else u=e?function(r,t,n,i){var e=cr(t,r.doc.direction);if(!e)return Zo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ar(e,n.ch,n.sticky),u=e[o];if("ltr"==r.doc.direction&&u.level%2==0&&(i>0?u.to>n.ch:u.from<n.ch))return Zo(t,n,i);var a,f=function(r,n){return qo(t,r instanceof rt?r.ch:r,n)},c=function(n){return r.options.lineWrapping?(a=a||In(r,t),qn(r,t,a,n)):{begin:0,end:t.text.length}},l=c("before"==n.sticky?f(n,-1):n.ch);if("rtl"==r.doc.direction||1==u.level){var s=1==u.level==i<0,h=f(n,s?1:-1);if(null!=h&&(s?h<=u.to&&h<=l.end:h>=u.from&&h>=l.begin))return new rt(n.line,h,s?"before":"after")}var d=function(r,t,i){for(var o=function(r,t){return t?new rt(n.line,f(r,1),"before"):new rt(n.line,r,"after")};r>=0&&r<e.length;r+=t){var u=e[r],a=t>0==(1!=u.level),c=a?i.begin:f(i.end,-1);if(u.from<=c&&c<u.to)return o(c,a);if(c=a?u.from:f(u.to,-1),i.begin<=c&&c<i.end)return o(c,a)}},v=d(o+i,i,l);if(v)return v;var m=i>0?l.end:f(l.begin,-1);return null==m||i>0&&m==t.text.length||!(v=d(i>0?0:e.length-1,i,c(m)))?null:v}(r.cm,a,t,n):Zo(a,t,n);if(null==u){if(o||((c=t.line+f)<r.first||c>=r.first+r.size||(t=new rt(c,t.ch,t.sticky),!(a=_r(r,c)))))return!1;t=ru(e,r.cm,a,t.line,f)}else t=u;return!0}if("char"==i||"codepoint"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var l=null,s="group"==i,h=r.cm&&r.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||c(!d);d=!1){var v=a.text.charAt(t.ch)||"\n",m=rr(v,h)?"w":s&&"\n"==v?"n":!s||/\s/.test(v)?null:"p";if(!s||d||m||(m="s"),l&&l!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(l=m),n>0&&!c(!d))break}var p=oo(r,t,o,u,!0);return nt(o,p)&&(p.hitSide=!0),p}function Wu(r,t,n,i){var e,o,u=r.doc,a=t.left;if("page"==i){var f=Math.min(r.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(f-.5*ii(r.display),3);e=(n>0?t.bottom:t.top)+n*c}else"line"==i&&(e=n>0?t.bottom+3:t.top-3);for(;(o=Yn(r,a,e)).outside;){if(n<0?e<=0:e>=u.height){o.hitSide=!0;break}e+=5*n}return o}var Fu=function(r){this.cm=r,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Pu(r,t){var n=Tn(r,t.line);if(!n||n.hidden)return null;var i=_r(r.doc,t.line),e=En(n,i,t.line),o=cr(i,r.doc.direction),u="left";o&&(u=ar(o,t.ch)%2?"right":"left");var a=Un(e.map,t.ch,u);return a.offset="right"==a.collapse?a.end:a.start,a}function Gu(r,t){return t&&(r.bad=!0),r}function Hu(r,t,n){var i;if(t==r.display.lineDiv){if(!(i=r.display.lineDiv.childNodes[n]))return Gu(r.clipPos(rt(r.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==r.display.lineDiv)return null;if(i.parentNode&&i.parentNode==r.display.lineDiv)break}for(var e=0;e<r.display.view.length;e++){var o=r.display.view[e];if(o.node==i)return Vu(o,t,n)}}function Vu(r,t,n){var i=r.text.firstChild,e=!1;if(!t||!T(i,t))return Gu(rt(Yr(r.line),0),!0);if(t==i&&(e=!0,t=i.childNodes[n],n=0,!t)){var o=r.rest?J(r.rest):r.line;return Gu(rt(Yr(o),o.text.length),e)}var u=3==t.nodeType?t:null,a=t;for(u||1!=t.childNodes.length||3!=t.firstChild.nodeType||(u=t.firstChild,n&&(n=u.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var f=r.measure,c=f.maps;function l(t,n,i){for(var e=-1;e<(c?c.length:0);e++)for(var o=e<0?f.map:c[e],u=0;u<o.length;u+=3){var a=o[u+2];if(a==t||a==n){var l=Yr(e<0?r.line:r.rest[e]),s=o[u]+i;return(i<0||a!=t)&&(s=o[u+(i?1:0)]),rt(l,s)}}}var s=l(u,a,n);if(s)return Gu(s,e);for(var h=a.nextSibling,d=u?u.nodeValue.length-n:0;h;h=h.nextSibling){if(s=l(h,h.firstChild,0))return Gu(rt(s.line,s.ch-d),e);d+=h.textContent.length}for(var v=a.previousSibling,m=n;v;v=v.previousSibling){if(s=l(v,v.firstChild,-1))return Gu(rt(s.line,s.ch+m),e);m+=v.textContent.length}}Fu.prototype.init=function(r){var t=this,n=this,i=n.cm,e=n.div=r.lineDiv;function o(r){for(var t=r.target;t;t=t.parentNode){if(t==e)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function u(r){if(o(r)&&!mr(i,r)){if(i.somethingSelected())Tu({lineWise:!1,text:i.getSelections()}),"cut"==r.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Bu(i);Tu({lineWise:!0,text:t.text}),"cut"==r.type&&i.operation((function(){i.setSelections(t.ranges,0,G),i.replaceSelection("",null,"cut")}))}if(r.clipboardData){r.clipboardData.clearData();var u=Du.text.join("\n");if(r.clipboardData.setData("Text",u),r.clipboardData.getData("Text")==u)return void r.preventDefault()}var a=zu(),f=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),f.value=Du.text.join("\n");var c=I();B(f),setTimeout((function(){i.display.lineSpace.removeChild(a),c.focus(),c==e&&n.showPrimarySelection()}),50)}}e.contentEditable=!0,Uu(e,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),sr(e,"paste",(function(r){!o(r)||mr(i,r)||Ou(r,i)||a<=11&&setTimeout(re(i,(function(){return t.updateFromDOM()})),20)})),sr(e,"compositionstart",(function(r){t.composing={data:r.data,done:!1}})),sr(e,"compositionupdate",(function(r){t.composing||(t.composing={data:r.data,done:!1})})),sr(e,"compositionend",(function(r){t.composing&&(r.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),sr(e,"touchstart",(function(){return n.forceCompositionEnd()})),sr(e,"input",(function(){t.composing||t.readFromDOMSoon()})),sr(e,"copy",u),sr(e,"cut",u)},Fu.prototype.screenReaderLabelChanged=function(r){r?this.div.setAttribute("aria-label",r):this.div.removeAttribute("aria-label")},Fu.prototype.prepareSelection=function(){var r=gi(this.cm,!1);return r.focus=I()==this.div,r},Fu.prototype.showSelection=function(r,t){r&&this.cm.display.view.length&&((r.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(r))},Fu.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fu.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),e=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||e.line>=t.display.viewTo||o.line<t.display.viewFrom)r.removeAllRanges();else{var u=Hu(t,r.anchorNode,r.anchorOffset),a=Hu(t,r.focusNode,r.focusOffset);if(!u||u.bad||!a||a.bad||0!=tt(ot(u,a),e)||0!=tt(et(u,a),o)){var f=t.display.view,c=e.line>=t.display.viewFrom&&Pu(t,e)||{node:f[0].measure.map[2],offset:0},l=o.line<t.display.viewTo&&Pu(t,o);if(!l){var s=f[f.length-1].measure,h=s.maps?s.maps[s.maps.length-1]:s.map;l={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&l){var d,v=r.rangeCount&&r.getRangeAt(0);try{d=x(c.node,c.offset,l.offset,l.node)}catch(r){}d&&(!n&&t.state.focused?(r.collapse(c.node,c.offset),d.collapsed||(r.removeAllRanges(),r.addRange(d))):(r.removeAllRanges(),r.addRange(d)),v&&null==r.anchorNode?r.addRange(v):n&&this.startGracePeriod()),this.rememberSelection()}else r.removeAllRanges()}}},Fu.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){r.gracePeriod=!1,r.selectionChanged()&&r.cm.operation((function(){return r.cm.curOp.selectionChanged=!0}))}),20)},Fu.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors),N(this.cm.display.selectionDiv,r.selection)},Fu.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode,this.lastAnchorOffset=r.anchorOffset,this.lastFocusNode=r.focusNode,this.lastFocusOffset=r.focusOffset},Fu.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount)return!1;var t=r.getRangeAt(0).commonAncestorContainer;return T(this.div,t)},Fu.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&I()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fu.prototype.blur=function(){this.div.blur()},Fu.prototype.getField=function(){return this.div},Fu.prototype.supportsTouch=function(){return!0},Fu.prototype.receivedFocus=function(){var r=this,t=this;this.selectionInEditor()?setTimeout((function(){return r.pollSelection()}),20):Zi(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}))},Fu.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset},Fu.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var r=this.getSelection(),t=this.cm;if(p&&l&&this.cm.display.gutterSpecs.length&&function(r){for(var t=r;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(r.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Hu(t,r.anchorNode,r.anchorOffset),i=Hu(t,r.focusNode,r.focusOffset);n&&i&&Zi(t,(function(){Ze(t.doc,xe(n,i),G),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},Fu.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var r,t,n,i=this.cm,e=i.display,o=i.doc.sel.primary(),u=o.from(),a=o.to();if(0==u.ch&&u.line>i.firstLine()&&(u=rt(u.line-1,_r(i.doc,u.line-1).length)),a.ch==_r(i.doc,a.line).text.length&&a.line<i.lastLine()&&(a=rt(a.line+1,0)),u.line<e.viewFrom||a.line>e.viewTo-1)return!1;u.line==e.viewFrom||0==(r=li(i,u.line))?(t=Yr(e.view[0].line),n=e.view[0].node):(t=Yr(e.view[r].line),n=e.view[r-1].node.nextSibling);var f,c,l=li(i,a.line);if(l==e.view.length-1?(f=e.viewTo-1,c=e.lineDiv.lastChild):(f=Yr(e.view[l+1].line)-1,c=e.view[l+1].node.previousSibling),!n)return!1;for(var s=i.doc.splitLines(function(r,t,n,i,e){var o="",u=!1,a=r.doc.lineSeparator(),f=!1;function c(){u&&(o+=a,f&&(o+=a),u=f=!1)}function l(r){r&&(c(),o+=r)}function s(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void l(n);var o,h=t.getAttribute("cm-marker");if(h){var d=r.findMarks(rt(i,0),rt(e+1,0),(p=+h,function(r){return r.id==p}));return void(d.length&&(o=d[0].find(0))&&l(Qr(r.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var v=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;v&&c();for(var m=0;m<t.childNodes.length;m++)s(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(f=!0),v&&(u=!0)}else 3==t.nodeType&&l(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var p}for(;s(t),t!=n;)t=t.nextSibling,f=!1;return o}(i,n,c,t,f)),h=Qr(i.doc,rt(t,0),rt(f,_r(i.doc,f).text.length));s.length>1&&h.length>1;)if(J(s)==J(h))s.pop(),h.pop(),f--;else{if(s[0]!=h[0])break;s.shift(),h.shift(),t++}for(var d=0,v=0,m=s[0],p=h[0],g=Math.min(m.length,p.length);d<g&&m.charCodeAt(d)==p.charCodeAt(d);)++d;for(var b=J(s),w=J(h),C=Math.min(b.length-(1==s.length?d:0),w.length-(1==h.length?d:0));v<C&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1);)++v;if(1==s.length&&1==h.length&&t==u.line)for(;d&&d>u.ch&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1);)d--,v++;s[s.length-1]=b.slice(0,b.length-v).replace(/^\u200b+/,""),s[0]=s[0].slice(d).replace(/\u200b+$/,"");var k=rt(t,d),M=rt(f,h.length?J(h).length-v:0);return s.length>1||s[0]||tt(k,M)?(mo(i.doc,s,k,M,"+input"),!0):void 0},Fu.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fu.prototype.reset=function(){this.forceCompositionEnd()},Fu.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fu.prototype.readFromDOMSoon=function(){var r=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(r.readDOMTimeout=null,r.composing){if(!r.composing.done)return;r.composing=null}r.updateFromDOM()}),80))},Fu.prototype.updateFromDOM=function(){var r=this;!this.cm.isReadOnly()&&this.pollContent()||Zi(this.cm,(function(){return si(r.cm)}))},Fu.prototype.setUneditable=function(r){r.contentEditable="false"},Fu.prototype.onKeyPress=function(r){0==r.charCode||this.composing||(r.preventDefault(),this.cm.isReadOnly()||re(this.cm,Iu)(this.cm,String.fromCharCode(null==r.charCode?r.keyCode:r.charCode),0))},Fu.prototype.readOnlyChanged=function(r){this.div.contentEditable=String("nocursor"!=r)},Fu.prototype.onContextMenu=function(){},Fu.prototype.resetPosition=function(){},Fu.prototype.needsContentAttribute=!0;var $u=function(r){this.cm=r,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null};$u.prototype.init=function(r){var t=this,n=this,i=this.cm;this.createField(r);var e=this.textarea;function o(r){if(!mr(i,r)){if(i.somethingSelected())Tu({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Bu(i);Tu({lineWise:!0,text:t.text}),"cut"==r.type?i.setSelections(t.ranges,null,G):(n.prevInput="",e.value=t.text.join("\n"),B(e))}"cut"==r.type&&(i.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),m&&(e.style.width="0px"),sr(e,"input",(function(){u&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),sr(e,"paste",(function(r){mr(i,r)||Ou(r,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),sr(e,"cut",o),sr(e,"copy",o),sr(r.scroller,"paste",(function(t){if(!Mn(r,t)&&!mr(i,t)){if(!e.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,e.dispatchEvent(o)}})),sr(r.lineSpace,"selectstart",(function(t){Mn(r,t)||wr(t)})),sr(e,"compositionstart",(function(){var r=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:r,range:i.markText(r,i.getCursor("to"),{className:"CodeMirror-composing"})}})),sr(e,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},$u.prototype.createField=function(){this.wrapper=zu(),this.textarea=this.wrapper.firstChild},$u.prototype.screenReaderLabelChanged=function(r){r?this.textarea.setAttribute("aria-label",r):this.textarea.removeAttribute("aria-label")},$u.prototype.prepareSelection=function(){var r=this.cm,t=r.display,n=r.doc,i=gi(r);if(r.options.moveInputWithCursor){var e=Qn(r,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,e.top+u.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,e.left+u.left-o.left))}return i},$u.prototype.showSelection=function(r){var t=this.cm.display;N(t.cursorDiv,r.cursors),N(t.selectionDiv,r.selection),null!=r.teTop&&(this.wrapper.style.top=r.teTop+"px",this.wrapper.style.left=r.teLeft+"px")},$u.prototype.reset=function(r){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&B(this.textarea),u&&a>=9&&(this.hasSelection=n)}else r||(this.prevInput=this.textarea.value="",u&&a>=9&&(this.hasSelection=null))}},$u.prototype.getField=function(){return this.textarea},$u.prototype.supportsTouch=function(){return!1},$u.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||I()!=this.textarea))try{this.textarea.focus()}catch(r){}},$u.prototype.blur=function(){this.textarea.blur()},$u.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$u.prototype.receivedFocus=function(){this.slowPoll()},$u.prototype.slowPoll=function(){var r=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){r.poll(),r.cm.state.focused&&r.slowPoll()}))},$u.prototype.fastPoll=function(){var r=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||r?(t.pollingFast=!1,t.slowPoll()):(r=!0,t.polling.set(60,n))}))},$u.prototype.poll=function(){var r=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ir(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var e=n.value;if(e==i&&!t.somethingSelected())return!1;if(u&&a>=9&&this.hasSelection===e||b&&/[\uf700-\uf7ff]/.test(e))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=e.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var f=0,c=Math.min(i.length,e.length);f<c&&i.charCodeAt(f)==e.charCodeAt(f);)++f;return Zi(t,(function(){Iu(t,e.slice(f),i.length-f,null,r.composing?"*compose":null),e.length>1e3||e.indexOf("\n")>-1?n.value=r.prevInput="":r.prevInput=e,r.composing&&(r.composing.range.clear(),r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},$u.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$u.prototype.onKeyPress=function(){u&&a>=9&&(this.hasSelection=null),this.fastPoll()},$u.prototype.onContextMenu=function(r){var t=this,n=t.cm,i=n.display,e=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ci(n,r),c=i.scroller.scrollTop;if(o&&!s){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&re(n,Ze)(n.doc,xe(o),G);var l,h=e.style.cssText,d=t.wrapper.style.cssText,v=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",e.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-v.top-5)+"px; left: "+(r.clientX-v.left-5)+"px;\n z-index: 1000; background: "+(u?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",f&&(l=window.scrollY),i.input.focus(),f&&window.scrollTo(null,l),i.input.reset(),n.somethingSelected()||(e.value=t.prevInput=" "),t.contextMenuPending=g,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),u&&a>=9&&p(),A){Mr(r);var m=function(){dr(window,"mouseup",m),setTimeout(g,20)};sr(window,"mouseup",m)}else setTimeout(g,50)}function p(){if(null!=e.selectionStart){var r=n.somethingSelected(),o="​"+(r?e.value:"");e.value="⇚",e.value=o,t.prevInput=r?"":"​",e.selectionStart=1,e.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,e.style.cssText=h,u&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=e.selectionStart)){(!u||u&&a<9)&&p();var r=0,o=function(){i.selForContextMenu==n.doc.sel&&0==e.selectionStart&&e.selectionEnd>0&&"​"==t.prevInput?re(n,ao)(n):r++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},$u.prototype.readOnlyChanged=function(r){r||this.reset(),this.textarea.disabled="nocursor"==r,this.textarea.readOnly=!!r},$u.prototype.setUneditable=function(){},$u.prototype.needsContentAttribute=!1,function(r){var t=r.optionHandlers;function n(n,i,e,o){r.defaults[n]=i,e&&(t[n]=o?function(r,t,n){n!=Mu&&e(r,t,n)}:e)}r.defineOption=n,r.Init=Mu,n("value","",(function(r,t){return r.setValue(t)}),!0),n("mode",null,(function(r,t){r.doc.modeOption=t,De(r)}),!0),n("indentUnit",2,De,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(r){Te(r),Fn(r),si(r)}),!0),n("lineSeparator",null,(function(r,t){if(r.doc.lineSep=t,t){var n=[],i=r.doc.first;r.doc.iter((function(r){for(var e=0;;){var o=r.text.indexOf(t,e);if(-1==o)break;e=o+t.length,n.push(rt(i,o))}i++}));for(var e=n.length-1;e>=0;e--)mo(r.doc,t,n[e],rt(n[e].line,n[e].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(r,t,n){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Mu&&r.refresh()})),n("specialCharPlaceholder",qt,(function(r){return r.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(r,t){return r.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(r,t){return r.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(r,t){return r.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!C),n("wholeLineUpdateBefore",!0),n("theme","default",(function(r){ku(r),me(r)}),!0),n("keyMap","default",(function(r,t,n){var i=Yo(t),e=n!=Mu&&Yo(n);e&&e.detach&&e.detach(r,i),i.attach&&i.attach(r,e||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Lu,!0),n("gutters",[],(function(r,t){r.display.gutterSpecs=de(t,r.options.lineNumbers),me(r)}),!0),n("fixedGutter",!0,(function(r,t){r.display.gutters.style.left=t?ui(r.display)+"px":"0",r.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(r){return Pi(r)}),!0),n("scrollbarStyle","native",(function(r){Vi(r),Pi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(r,t){r.display.gutterSpecs=de(r.options.gutters,t),me(r)}),!0),n("firstLineNumber",1,me,!0),n("lineNumberFormatter",(function(r){return r}),me,!0),n("showCursorWhenSelecting",!1,pi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(r,t){"nocursor"==t&&(xi(r),r.display.input.blur()),r.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(r,t){r.display.input.screenReaderLabelChanged(t=""===t?null:t)})),n("disableInput",!1,(function(r,t){t||r.display.input.reset()}),!0),n("dragDrop",!0,xu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,pi,!0),n("singleCursorHeightPerLine",!0,pi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Te,!0),n("addModeClass",!1,Te,!0),n("pollInterval",100),n("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(r){return r.refresh()}),!0),n("maxHighlightLength",1e4,Te,!0),n("moveInputWithCursor",!0,(function(r,t){t||r.display.input.resetPosition()})),n("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),!0),n("phrases",null)}(Su),function(r){var t=r.optionHandlers,n=r.helpers={};r.prototype={constructor:r,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,n){var i=this.options,e=i[r];i[r]==n&&"mode"!=r||(i[r]=n,t.hasOwnProperty(r)&&re(this,t[r])(this,n,e),vr(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](Yo(r))},removeKeyMap:function(r){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==r||t[n].name==r)return t.splice(n,1),!0},addOverlay:te((function(t,n){var i=t.token?t:r.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");(function(r,t,n){for(var i=0,e=n(t);i<r.length&&n(r[i])<=e;)i++;r.splice(i,0,t)})(this.state.overlays,{mode:i,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(r){return r.priority})),this.state.modeGen++,si(this)})),removeOverlay:te((function(r){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==r||"string"==typeof r&&i.name==r)return t.splice(n,1),this.state.modeGen++,void si(this)}})),indentLine:te((function(r,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),qr(this.doc,r)&&Eu(this,r,t,n)})),indentSelection:te((function(r){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var e=t[i];if(e.empty())e.head.line>n&&(Eu(this,e.head.line,r,!0),n=e.head.line,i==this.doc.sel.primIndex&&Ti(this));else{var o=e.from(),u=e.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var f=a;f<n;++f)Eu(this,f,r);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[i].from().ch>0&&Ye(this.doc,i,new Ae(o,c[i].to()),G)}}})),getTokenAt:function(r,t){return bt(this,r,t)},getLineTokens:function(r,t){return bt(this,rt(r),t,!0)},getTokenTypeAt:function(r){r=at(this.doc,r);var t,n=ht(this,_r(this.doc,r.line)),i=0,e=(n.length-1)/2,o=r.ch;if(0==o)t=n[2];else for(;;){var u=i+e>>1;if((u?n[2*u-1]:0)>=o)e=u;else{if(!(n[2*u+1]<o)){t=n[2*u+2];break}i=u+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?r.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var i=[];if(!n.hasOwnProperty(t))return i;var e=n[t],o=this.getModeAt(r);if("string"==typeof o[t])e[o[t]]&&i.push(e[o[t]]);else if(o[t])for(var u=0;u<o[t].length;u++){var a=e[o[t][u]];a&&i.push(a)}else o.helperType&&e[o.helperType]?i.push(e[o.helperType]):e[o.name]&&i.push(e[o.name]);for(var f=0;f<e._global.length;f++){var c=e._global[f];c.pred(o,this)&&-1==F(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(r,t){var n=this.doc;return dt(this,(r=ut(n,null==r?n.first+n.size-1:r))+1,t).state},cursorCoords:function(r,t){var n=this.doc.sel.primary();return Qn(this,null==r?n.head:"object"==typeof r?at(this.doc,r):r?n.from():n.to(),t||"page")},charCoords:function(r,t){return _n(this,at(this.doc,r),t||"page")},coordsChar:function(r,t){return Yn(this,(r=$n(this,r,t||"page")).left,r.top)},lineAtHeight:function(r,t){return r=$n(this,{top:r,left:0},t||"page").top,Xr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,n){var i,e=!1;if("number"==typeof r){var o=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>o&&(r=o,e=!0),i=_r(this.doc,r)}else i=r;return Vn(this,i,{top:0,left:0},t||"page",n||e).top+(e?this.doc.height-Ht(i):0)},defaultTextHeight:function(){return ii(this.display)},defaultCharWidth:function(){return ei(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,n,i,e){var o,u,a=this.display,f=(r=Qn(this,at(this.doc,r))).bottom,c=r.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==i)f=r.top;else if("above"==i||"near"==i){var l=Math.max(a.wrapper.clientHeight,this.doc.height),s=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==i||r.bottom+t.offsetHeight>l)&&r.top>t.offsetHeight?f=r.top-t.offsetHeight:r.bottom+t.offsetHeight<=l&&(f=r.bottom),c+t.offsetWidth>s&&(c=s-t.offsetWidth)}t.style.top=f+"px",t.style.left=t.style.right="","right"==e?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==e?c=0:"middle"==e&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(null!=(u=Ei(o=this,{left:c,top:f,right:c+t.offsetWidth,bottom:f+t.offsetHeight})).scrollTop&&Bi(o,u.scrollTop),null!=u.scrollLeft&&zi(o,u.scrollLeft))},triggerOnKeyDown:te(lu),triggerOnKeyPress:te(hu),triggerOnKeyUp:su,triggerOnMouseDown:te(pu),execCommand:function(r){if(tu.hasOwnProperty(r))return tu[r].call(null,this)},triggerElectric:te((function(r){Ru(this,r)})),findPosH:function(r,t,n,i){var e=1;t<0&&(e=-1,t=-t);for(var o=at(this.doc,r),u=0;u<t&&!(o=ju(this.doc,o,e,n,i)).hitSide;++u);return o},moveH:te((function(r,t){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?ju(n.doc,i.head,r,t,n.options.rtlMoveVisually):r<0?i.from():i.to()}),V)})),deleteH:te((function(r,t){var n=this.doc;this.doc.sel.somethingSelected()?n.replaceSelection("",null,"+delete"):Xo(this,(function(i){var e=ju(n,i.head,r,t,!1);return r<0?{from:e,to:i.head}:{from:i.head,to:e}}))})),findPosV:function(r,t,n,i){var e=1,o=i;t<0&&(e=-1,t=-t);for(var u=at(this.doc,r),a=0;a<t;++a){var f=Qn(this,u,"div");if(null==o?o=f.left:f.left=o,(u=Wu(this,f,e,n)).hitSide)break}return u},moveV:te((function(r,t){var n=this,i=this.doc,e=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(u){if(o)return r<0?u.from():u.to();var a=Qn(n,u.head,"div");null!=u.goalColumn&&(a.left=u.goalColumn),e.push(a.left);var f=Wu(n,a,r,t);return"page"==t&&u==i.sel.primary()&&Di(n,_n(n,f,"div").top-a.top),f}),V),e.length)for(var u=0;u<i.sel.ranges.length;u++)i.sel.ranges[u].goalColumn=e[u]})),findWordAt:function(r){var t=_r(this.doc,r.line).text,n=r.ch,i=r.ch;if(t){var e=this.getHelper(r,"wordChars");"before"!=r.sticky&&i!=t.length||!n?++i:--n;for(var o=t.charAt(n),u=rr(o,e)?function(r){return rr(r,e)}:/\s/.test(o)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!rr(r)};n>0&&u(t.charAt(n-1));)--n;for(;i<t.length&&u(t.charAt(i));)++i}return new Ae(rt(r.line,n),rt(r.line,i))},toggleOverwrite:function(r){null!=r&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?O(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),vr(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:te((function(r,t){Ii(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ln(this)-this.display.barHeight,width:r.scrollWidth-Ln(this)-this.display.barWidth,clientHeight:Nn(this),clientWidth:Sn(this)}},scrollIntoView:te((function(r,t){null==r?(r={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof r?r={from:rt(r,0),to:null}:null==r.from&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=t||0,null!=r.from.line?function(r,t){Oi(r),r.curOp.scrollToPos=t}(this,r):Ri(this,r.from,r.to,r.margin)})),setSize:te((function(r,t){var n=this,i=function(r){return"number"==typeof r||/^\d+$/.test(String(r))?r+"px":r};null!=r&&(this.display.wrapper.style.width=i(r)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&Wn(this);var e=this.display.viewFrom;this.doc.iter(e,this.display.viewTo,(function(r){if(r.widgets)for(var t=0;t<r.widgets.length;t++)if(r.widgets[t].noHScroll){hi(n,e,"widget");break}++e})),this.curOp.forceUpdate=!0,vr(this,"refresh",this)})),operation:function(r){return Zi(this,r)},startOperation:function(){return _i(this)},endOperation:function(){return Qi(this)},refresh:te((function(){var r=this.display.cachedTextHeight;si(this),this.curOp.forceUpdate=!0,Fn(this),Ii(this,this.doc.scrollLeft,this.doc.scrollTop),ce(this.display),(null==r||Math.abs(r-ii(this.display))>.5||this.options.lineWrapping)&&fi(this),vr(this,"refresh",this)})),swapDoc:te((function(r){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Be(this,r),Fn(this),this.display.input.reset(),Ii(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,fn(this,"swapDoc",this,t),t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},br(r),r.registerHelper=function(t,i,e){n.hasOwnProperty(t)||(n[t]=r[t]={_global:[]}),n[t][i]=e},r.registerGlobalHelper=function(t,i,e,o){r.registerHelper(t,i,o),n[t]._global.push({pred:e,val:o})}}(Su);var _u="iter insert remove copy getEditor constructor".split(" ");for(var Qu in To.prototype)To.prototype.hasOwnProperty(Qu)&&F(_u,Qu)<0&&(Su.prototype[Qu]=function(r){return function(){return r.apply(this.doc,arguments)}}(To.prototype[Qu]));return br(To),Su.inputStyles={textarea:$u,contenteditable:Fu},Su.defineMode=function(r){Su.defaults.mode||"null"==r||(Su.defaults.mode=r),zr.apply(this,arguments)},Su.defineMIME=function(r,t){Ur[r]=t},Su.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}})),Su.defineMIME("text/plain","null"),Su.defineExtension=function(r,t){Su.prototype[r]=t},Su.defineDocExtension=function(r,t){To.prototype[r]=t},Su.fromTextArea=function(r,t){if((t=t?z(t):{}).value=r.value,!t.tabindex&&r.tabIndex&&(t.tabindex=r.tabIndex),!t.placeholder&&r.placeholder&&(t.placeholder=r.placeholder),null==t.autofocus){var n=I();t.autofocus=n==r||null!=r.getAttribute("autofocus")&&n==document.body}function i(){r.value=a.getValue()}var e;if(r.form&&(sr(r.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=r.form;e=o.submit;try{var u=o.submit=function(){i(),o.submit=e,o.submit(),o.submit=u}}catch(r){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return r},n.toTextArea=function(){n.toTextArea=isNaN,i(),r.parentNode.removeChild(n.getWrapperElement()),r.style.display="",r.form&&(dr(r.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof r.form.submit||(r.form.submit=e))}},r.style.display="none";var a=Su((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return a},function(r){r.off=dr,r.on=sr,r.wheelEventPixels=Ce,r.Doc=To,r.splitLines=Tr,r.countColumn=j,r.findColumn=$,r.isWordChar=Z,r.Pass=P,r.signal=vr,r.Line=_t,r.changeEnd=Le,r.scrollbarModel=Hi,r.Pos=rt,r.cmpPos=tt,r.modes=Br,r.mimeModes=Ur,r.resolveMode=jr,r.getMode=Wr,r.modeExtensions=Fr,r.extendMode=Pr,r.copyState=Gr,r.startState=Vr,r.innerMode=Hr,r.commands=tu,r.keyMap=Ho,r.keyName=Ko,r.isModifierKey=Qo,r.lookupKey=_o,r.normalizeKeyMap=$o,r.StringStream=$r,r.SharedTextMarker=So,r.TextMarker=xo,r.LineWidget=Mo,r.e_preventDefault=wr,r.e_stopPropagation=Cr,r.e_stop=Mr,r.addClass=O,r.contains=T,r.rmClass=L,r.keyNames=Wo}(Su),Su.version="5.65.3",Su}()}));e((function(){var r;(r=u).defineMode("javascript",(function(t,n){var i,e,o=t.indentUnit,u=n.statementIndent,a=n.jsonld,f=n.json||a,c=!1!==n.trackScope,l=n.typescript,s=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),n=r("keyword b"),i=r("keyword c"),e=r("keyword d"),o=r("operator"),u={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:e,break:e,continue:e,new:r("new"),delete:i,void:i,throw:i,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:u,false:u,null:u,undefined:u,NaN:u,Infinity:u,this:r("this"),class:r("class"),super:r("atom"),yield:i,export:r("export"),import:r("import"),extends:i,await:i}}(),d=/[+\-*&%=<>!?|~^@]/,v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(r,t,n){return i=r,e=n,t}function p(r,t){var n,i=r.next();if('"'==i||"'"==i)return t.tokenize=(n=i,function(r,t){var i,e=!1;if(a&&"@"==r.peek()&&r.match(v))return t.tokenize=p,m("jsonld-keyword","meta");for(;null!=(i=r.next())&&(i!=n||e);)e=!e&&"\\"==i;return e||(t.tokenize=p),m("string","string")}),t.tokenize(r,t);if("."==i&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==i&&r.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return m(i);if("="==i&&r.eat(">"))return m("=>","operator");if("0"==i&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(i))return r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==i)return r.eat("*")?(t.tokenize=g,g(r,t)):r.eat("/")?(r.skipToEnd(),m("comment","comment")):Zr(r,t,1)?(function(r){for(var t,n=!1,i=!1;null!=(t=r.next());){if(!n){if("/"==t&&!i)return;"["==t?i=!0:i&&"]"==t&&(i=!1)}n=!n&&"\\"==t}}(r),r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(r.eat("="),m("operator","operator",r.current()));if("`"==i)return t.tokenize=b,b(r,t);if("#"==i&&"!"==r.peek())return r.skipToEnd(),m("meta","meta");if("#"==i&&r.eatWhile(s))return m("variable","property");if("<"==i&&r.match("!--")||"-"==i&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start)))return r.skipToEnd(),m("comment","comment");if(d.test(i))return">"==i&&t.lexical&&">"==t.lexical.type||(r.eat("=")?"!"!=i&&"="!=i||r.eat("="):/[<>*+\-|&?]/.test(i)&&(r.eat(i),">"==i&&r.eat(i))),"?"==i&&r.eat(".")?m("."):m("operator","operator",r.current());if(s.test(i)){r.eatWhile(s);var e=r.current();if("."!=t.lastType){if(h.propertyIsEnumerable(e)){var o=h[e];return m(o.type,o.style,e)}if("async"==e&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",e)}return m("variable","variable",e)}}function g(r,t){for(var n,i=!1;n=r.next();){if("/"==n&&i){t.tokenize=p;break}i="*"==n}return m("comment","comment")}function b(r,t){for(var n,i=!1;null!=(n=r.next());){if(!i&&("`"==n||"$"==n&&r.eat("{"))){t.tokenize=p;break}i=!i&&"\\"==n}return m("quasi","string-2",r.current())}function w(r,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=r.string.indexOf("=>",r.start);if(!(n<0)){if(l){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,n));i&&(n=i.index)}for(var e=0,o=!1,u=n-1;u>=0;--u){var a=r.string.charAt(u),f="([{}])".indexOf(a);if(f>=0&&f<3){if(!e){++u;break}if(0==--e){"("==a&&(o=!0);break}}else if(f>=3&&f<6)++e;else if(s.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--u){if(0==u)return;if(r.string.charAt(u-1)==a&&"\\"!=r.string.charAt(u-2)){u--;break}}else if(o&&!e){++u;break}}o&&!e&&(t.fatArrowAt=u)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function k(r,t,n,i,e,o){this.indented=r,this.column=t,this.type=n,this.prev=e,this.info=o,null!=i&&(this.align=i)}function M(r,t){if(!c)return!1;for(var n=r.localVars;n;n=n.next)if(n.name==t)return!0;for(var i=r.context;i;i=i.prev)for(n=i.vars;n;n=n.next)if(n.name==t)return!0}function A(r,t,n,i,e){var o=r.cc;for(y.state=r,y.stream=e,y.marked=null,y.cc=o,y.style=t,r.lexical.hasOwnProperty("align")||(r.lexical.align=!0);;)if((o.length?o.pop():f?G:F)(n,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();return y.marked?y.marked:"variable"==n&&M(r,i)?"variable-2":t}}var y={state:null,column:null,marked:null,cc:null};function x(){for(var r=arguments.length-1;r>=0;r--)y.cc.push(arguments[r])}function L(){return x.apply(null,arguments),!0}function S(r,t){for(var n=t;n;n=n.next)if(n.name==r)return!0;return!1}function N(r){var t=y.state;if(y.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var i=E(r,t.context);if(null!=i)return void(t.context=i)}else if(!S(r,t.localVars))return void(t.localVars=new I(r,t.localVars));n.globalVars&&!S(r,t.globalVars)&&(t.globalVars=new I(r,t.globalVars))}}function E(r,t){if(t){if(t.block){var n=E(r,t.prev);return n?n==t.prev?t:new T(n,t.vars,!0):null}return S(r,t.vars)?t:new T(t.prev,new I(r,t.vars),!1)}return null}function D(r){return"public"==r||"private"==r||"protected"==r||"abstract"==r||"readonly"==r}function T(r,t,n){this.prev=r,this.vars=t,this.block=n}function I(r,t){this.name=r,this.next=t}var O=new I("this",new I("arguments",null));function R(){y.state.context=new T(y.state.context,y.state.localVars,!1),y.state.localVars=O}function B(){y.state.context=new T(y.state.context,y.state.localVars,!0),y.state.localVars=null}function U(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function z(r,t){var n=function(){var n=y.state,i=n.indented;if("stat"==n.lexical.type)i=n.lexical.indented;else for(var e=n.lexical;e&&")"==e.type&&e.align;e=e.prev)i=e.indented;n.lexical=new k(i,y.stream.column(),r,null,n.lexical,t)};return n.lex=!0,n}function j(){var r=y.state;r.lexical.prev&&(")"==r.lexical.type&&(r.indented=r.lexical.indented),r.lexical=r.lexical.prev)}function W(r){return function t(n){return n==r?L():";"==r||"}"==n||")"==n||"]"==n?x():L(t)}}function F(r,t){return"var"==r?L(z("vardef",t),yr,W(";"),j):"keyword a"==r?L(z("form"),V,F,j):"keyword b"==r?L(z("form"),F,j):"keyword d"==r?y.stream.match(/^\s*$/,!1)?L():L(z("stat"),_,W(";"),j):"debugger"==r?L(W(";")):"{"==r?L(z("}"),B,fr,j,U):";"==r?L():"if"==r?("else"==y.state.lexical.info&&y.state.cc[y.state.cc.length-1]==j&&y.state.cc.pop()(),L(z("form"),V,F,j,Dr)):"function"==r?L(Rr):"for"==r?L(z("form"),B,Tr,F,U,j):"class"==r||l&&"interface"==t?(y.marked="keyword",L(z("form","class"==r?r:t),Wr,j)):"variable"==r?l&&"declare"==t?(y.marked="keyword",L(F)):l&&("module"==t||"enum"==t||"type"==t)&&y.stream.match(/^\s*\w/,!1)?(y.marked="keyword","enum"==t?L(Xr):"type"==t?L(Ur,W("operator"),dr,W(";")):L(z("form"),xr,W("{"),z("}"),fr,j,j)):l&&"namespace"==t?(y.marked="keyword",L(z("form"),G,F,j)):l&&"abstract"==t?(y.marked="keyword",L(F)):L(z("stat"),tr):"switch"==r?L(z("form"),V,W("{"),z("}","switch"),B,fr,j,j,U):"case"==r?L(G,W(":")):"default"==r?L(W(":")):"catch"==r?L(z("form"),R,P,F,j,U):"export"==r?L(z("stat"),Hr,j):"import"==r?L(z("stat"),$r,j):"async"==r?L(F):"@"==t?L(G,F):x(z("stat"),G,W(";"),j)}function P(r){if("("==r)return L(zr,W(")"))}function G(r,t){return $(r,t,!1)}function H(r,t){return $(r,t,!0)}function V(r){return"("!=r?x():L(z(")"),_,W(")"),j)}function $(r,t,n){if(y.state.fatArrowAt==y.stream.start){var i=n?q:X;if("("==r)return L(R,z(")"),ur(zr,")"),j,W("=>"),i,U);if("variable"==r)return x(R,xr,W("=>"),i,U)}var e=n?J:Q;return C.hasOwnProperty(r)?L(e):"function"==r?L(Rr,e):"class"==r||l&&"interface"==t?(y.marked="keyword",L(z("form"),jr,j)):"keyword c"==r||"async"==r?L(n?H:G):"("==r?L(z(")"),_,W(")"),j,e):"operator"==r||"spread"==r?L(n?H:G):"["==r?L(z("]"),Yr,j,e):"{"==r?ar(ir,"}",null,e):"quasi"==r?x(K,e):"new"==r?L(function(r){return function(t){return"."==t?L(r?rr:Z):"variable"==t&&l?L(kr,r?J:Q):x(r?H:G)}}(n)):L()}function _(r){return r.match(/[;\}\)\],]/)?x():x(G)}function Q(r,t){return","==r?L(_):J(r,t,!1)}function J(r,t,n){var i=0==n?Q:J,e=0==n?G:H;return"=>"==r?L(R,n?q:X,U):"operator"==r?/\+\+|--/.test(t)||l&&"!"==t?L(i):l&&"<"==t&&y.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?L(z(">"),ur(dr,">"),j,i):"?"==t?L(G,W(":"),e):L(e):"quasi"==r?x(K,i):";"!=r?"("==r?ar(H,")","call",i):"."==r?L(nr,i):"["==r?L(z("]"),_,W("]"),j,i):l&&"as"==t?(y.marked="keyword",L(dr,i)):"regexp"==r?(y.state.lastType=y.marked="operator",y.stream.backUp(y.stream.pos-y.stream.start-1),L(e)):void 0:void 0}function K(r,t){return"quasi"!=r?x():"${"!=t.slice(t.length-2)?L(K):L(_,Y)}function Y(r){if("}"==r)return y.marked="string-2",y.state.tokenize=b,L(K)}function X(r){return w(y.stream,y.state),x("{"==r?F:G)}function q(r){return w(y.stream,y.state),x("{"==r?F:H)}function Z(r,t){if("target"==t)return y.marked="keyword",L(Q)}function rr(r,t){if("target"==t)return y.marked="keyword",L(J)}function tr(r){return":"==r?L(j,F):x(Q,W(";"),j)}function nr(r){if("variable"==r)return y.marked="property",L()}function ir(r,t){return"async"==r?(y.marked="property",L(ir)):"variable"==r||"keyword"==y.style?(y.marked="property","get"==t||"set"==t?L(er):(l&&y.state.fatArrowAt==y.stream.start&&(n=y.stream.match(/^\s*:\s*/,!1))&&(y.state.fatArrowAt=y.stream.pos+n[0].length),L(or))):"number"==r||"string"==r?(y.marked=a?"property":y.style+" property",L(or)):"jsonld-keyword"==r?L(or):l&&D(t)?(y.marked="keyword",L(ir)):"["==r?L(G,cr,W("]"),or):"spread"==r?L(H,or):"*"==t?(y.marked="keyword",L(ir)):":"==r?x(or):void 0;var n}function er(r){return"variable"!=r?x(or):(y.marked="property",L(Rr))}function or(r){return":"==r?L(H):"("==r?x(Rr):void 0}function ur(r,t,n){function i(e,o){if(n?n.indexOf(e)>-1:","==e){var u=y.state.lexical;return"call"==u.info&&(u.pos=(u.pos||0)+1),L((function(n,i){return n==t||i==t?x():x(r)}),i)}return e==t||o==t?L():n&&n.indexOf(";")>-1?x(r):L(W(t))}return function(n,e){return n==t||e==t?L():x(r,i)}}function ar(r,t,n){for(var i=3;i<arguments.length;i++)y.cc.push(arguments[i]);return L(z(t,n),ur(r,t),j)}function fr(r){return"}"==r?L():x(F,fr)}function cr(r,t){if(l){if(":"==r)return L(dr);if("?"==t)return L(cr)}}function lr(r,t){if(l&&(":"==r||"in"==t))return L(dr)}function sr(r){if(l&&":"==r)return y.stream.match(/^\s*\w+\s+is\b/,!1)?L(G,hr,dr):L(dr)}function hr(r,t){if("is"==t)return y.marked="keyword",L()}function dr(r,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(y.marked="keyword",L("typeof"==t?H:dr)):"variable"==r||"void"==t?(y.marked="type",L(Cr)):"|"==t||"&"==t?L(dr):"string"==r||"number"==r||"atom"==r?L(Cr):"["==r?L(z("]"),ur(dr,"]",","),j,Cr):"{"==r?L(z("}"),mr,j,Cr):"("==r?L(ur(wr,")"),vr,Cr):"<"==r?L(ur(dr,">"),dr):"quasi"==r?x(gr,Cr):void 0}function vr(r){if("=>"==r)return L(dr)}function mr(r){return r.match(/[\}\)\]]/)?L():","==r||";"==r?L(mr):x(pr,mr)}function pr(r,t){return"variable"==r||"keyword"==y.style?(y.marked="property",L(pr)):"?"==t||"number"==r||"string"==r?L(pr):":"==r?L(dr):"["==r?L(W("variable"),lr,W("]"),pr):"("==r?x(Br,pr):r.match(/[;\}\)\],]/)?void 0:L()}function gr(r,t){return"quasi"!=r?x():"${"!=t.slice(t.length-2)?L(gr):L(dr,br)}function br(r){if("}"==r)return y.marked="string-2",y.state.tokenize=b,L(gr)}function wr(r,t){return"variable"==r&&y.stream.match(/^\s*[?:]/,!1)||"?"==t?L(wr):":"==r?L(dr):"spread"==r?L(wr):x(dr)}function Cr(r,t){return"<"==t?L(z(">"),ur(dr,">"),j,Cr):"|"==t||"."==r||"&"==t?L(dr):"["==r?L(dr,W("]"),Cr):"extends"==t||"implements"==t?(y.marked="keyword",L(dr)):"?"==t?L(dr,W(":"),dr):void 0}function kr(r,t){if("<"==t)return L(z(">"),ur(dr,">"),j,Cr)}function Mr(){return x(dr,Ar)}function Ar(r,t){if("="==t)return L(dr)}function yr(r,t){return"enum"==t?(y.marked="keyword",L(Xr)):x(xr,cr,Nr,Er)}function xr(r,t){return l&&D(t)?(y.marked="keyword",L(xr)):"variable"==r?(N(t),L()):"spread"==r?L(xr):"["==r?ar(Sr,"]"):"{"==r?ar(Lr,"}"):void 0}function Lr(r,t){return"variable"!=r||y.stream.match(/^\s*:/,!1)?("variable"==r&&(y.marked="property"),"spread"==r?L(xr):"}"==r?x():"["==r?L(G,W("]"),W(":"),Lr):L(W(":"),xr,Nr)):(N(t),L(Nr))}function Sr(){return x(xr,Nr)}function Nr(r,t){if("="==t)return L(H)}function Er(r){if(","==r)return L(yr)}function Dr(r,t){if("keyword b"==r&&"else"==t)return L(z("form","else"),F,j)}function Tr(r,t){return"await"==t?L(Tr):"("==r?L(z(")"),Ir,j):void 0}function Ir(r){return"var"==r?L(yr,Or):"variable"==r?L(Or):x(Or)}function Or(r,t){return")"==r?L():";"==r?L(Or):"in"==t||"of"==t?(y.marked="keyword",L(G,Or)):x(G,Or)}function Rr(r,t){return"*"==t?(y.marked="keyword",L(Rr)):"variable"==r?(N(t),L(Rr)):"("==r?L(R,z(")"),ur(zr,")"),j,sr,F,U):l&&"<"==t?L(z(">"),ur(Mr,">"),j,Rr):void 0}function Br(r,t){return"*"==t?(y.marked="keyword",L(Br)):"variable"==r?(N(t),L(Br)):"("==r?L(R,z(")"),ur(zr,")"),j,sr,U):l&&"<"==t?L(z(">"),ur(Mr,">"),j,Br):void 0}function Ur(r,t){return"keyword"==r||"variable"==r?(y.marked="type",L(Ur)):"<"==t?L(z(">"),ur(Mr,">"),j):void 0}function zr(r,t){return"@"==t&&L(G,zr),"spread"==r?L(zr):l&&D(t)?(y.marked="keyword",L(zr)):l&&"this"==r?L(cr,Nr):x(xr,cr,Nr)}function jr(r,t){return"variable"==r?Wr(r,t):Fr(r,t)}function Wr(r,t){if("variable"==r)return N(t),L(Fr)}function Fr(r,t){return"<"==t?L(z(">"),ur(Mr,">"),j,Fr):"extends"==t||"implements"==t||l&&","==r?("implements"==t&&(y.marked="keyword"),L(l?dr:G,Fr)):"{"==r?L(z("}"),Pr,j):void 0}function Pr(r,t){return"async"==r||"variable"==r&&("static"==t||"get"==t||"set"==t||l&&D(t))&&y.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(y.marked="keyword",L(Pr)):"variable"==r||"keyword"==y.style?(y.marked="property",L(Gr,Pr)):"number"==r||"string"==r?L(Gr,Pr):"["==r?L(G,cr,W("]"),Gr,Pr):"*"==t?(y.marked="keyword",L(Pr)):l&&"("==r?x(Br,Pr):";"==r||","==r?L(Pr):"}"==r?L():"@"==t?L(G,Pr):void 0}function Gr(r,t){if("!"==t)return L(Gr);if("?"==t)return L(Gr);if(":"==r)return L(dr,Nr);if("="==t)return L(H);var n=y.state.lexical.prev;return x(n&&"interface"==n.info?Br:Rr)}function Hr(r,t){return"*"==t?(y.marked="keyword",L(Kr,W(";"))):"default"==t?(y.marked="keyword",L(G,W(";"))):"{"==r?L(ur(Vr,"}"),Kr,W(";")):x(F)}function Vr(r,t){return"as"==t?(y.marked="keyword",L(W("variable"))):"variable"==r?x(H,Vr):void 0}function $r(r){return"string"==r?L():"("==r?x(G):"."==r?x(Q):x(_r,Qr,Kr)}function _r(r,t){return"{"==r?ar(_r,"}"):("variable"==r&&N(t),"*"==t&&(y.marked="keyword"),L(Jr))}function Qr(r){if(","==r)return L(_r,Qr)}function Jr(r,t){if("as"==t)return y.marked="keyword",L(_r)}function Kr(r,t){if("from"==t)return y.marked="keyword",L(G)}function Yr(r){return"]"==r?L():x(ur(H,"]"))}function Xr(){return x(z("form"),xr,W("{"),z("}"),ur(qr,"}"),j,j)}function qr(){return x(xr,Nr)}function Zr(r,t,n){return t.tokenize==p&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(r.string.slice(0,r.pos-(n||0)))}return R.lex=B.lex=!0,U.lex=!0,j.lex=!0,{startState:function(r){var t={tokenize:p,lastType:"sof",cc:[],lexical:new k((r||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new T(null,null,!1),indented:r||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(r,t){if(r.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=r.indentation(),w(r,t)),t.tokenize!=g&&r.eatSpace())return null;var n=t.tokenize(r,t);return"comment"==i?n:(t.lastType="operator"!=i||"++"!=e&&"--"!=e?i:"incdec",A(t,n,i,e,r))},indent:function(t,i){if(t.tokenize==g||t.tokenize==b)return r.Pass;if(t.tokenize!=p)return 0;var e,a=i&&i.charAt(0),f=t.lexical;if(!/^\s*else\b/.test(i))for(var c=t.cc.length-1;c>=0;--c){var l=t.cc[c];if(l==j)f=f.prev;else if(l!=Dr&&l!=U)break}for(;("stat"==f.type||"form"==f.type)&&("}"==a||(e=t.cc[t.cc.length-1])&&(e==Q||e==J)&&!/^[,\.=+\-*:?[\(]/.test(i));)f=f.prev;u&&")"==f.type&&"stat"==f.prev.type&&(f=f.prev);var s=f.type,h=a==s;return"vardef"==s?f.indented+("operator"==t.lastType||","==t.lastType?f.info.length+1:0):"form"==s&&"{"==a?f.indented:"form"==s?f.indented+o:"stat"==s?f.indented+(function(r,t){return"operator"==r.lastType||","==r.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,i)?u||o:0):"switch"!=f.info||h||0==n.doubleIndentSwitch?f.align?f.column+(h?0:1):f.indented+(h?0:o):f.indented+(/^(?:case|default)\b/.test(i)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:f?null:"/*",blockCommentEnd:f?null:"*/",blockCommentContinue:f?null:" * ",lineComment:f?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:f?"json":"javascript",jsonldMode:a,jsonMode:f,expressionAllowed:Zr,skipExpression:function(t){A(t,"atom","atom","true",new r.StringStream("",2,null))}}})),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})})),e((function(){!function(r){var t="CodeMirror-activeline",n="CodeMirror-activeline-background",i="CodeMirror-activeline-gutter";function e(r){for(var e=0;e<r.state.activeLines.length;e++)r.removeLineClass(r.state.activeLines[e],"wrap",t),r.removeLineClass(r.state.activeLines[e],"background",n),r.removeLineClass(r.state.activeLines[e],"gutter",i)}function o(r,o){for(var u=[],a=0;a<o.length;a++){var f=o[a],c=r.getOption("styleActiveLine");if("object"==typeof c&&c.nonEmpty?f.anchor.line==f.head.line:f.empty()){var l=r.getLineHandleVisualStart(f.head.line);u[u.length-1]!=l&&u.push(l)}}(function(r,t){if(r.length!=t.length)return!1;for(var n=0;n<r.length;n++)if(r[n]!=t[n])return!1;return!0})(r.state.activeLines,u)||r.operation((function(){e(r);for(var o=0;o<u.length;o++)r.addLineClass(u[o],"wrap",t),r.addLineClass(u[o],"background",n),r.addLineClass(u[o],"gutter",i);r.state.activeLines=u}))}function u(r,t){o(r,t.ranges)}r.defineOption("styleActiveLine",!1,(function(t,n,i){var a=i!=r.Init&&i;n!=a&&(a&&(t.off("beforeSelectionChange",u),e(t),delete t.state.activeLines),n&&(t.state.activeLines=[],o(t,t.listSelections()),t.on("beforeSelectionChange",u)))}))}(u)})),e((function(){!function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=r.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function e(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var a=r.getLineHandle(t.line),f=t.ch-1,c=o&&o.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className));var l=e(o),s=!c&&f>=0&&l.test(a.text.charAt(f))&&i[a.text.charAt(f)]||l.test(a.text.charAt(f+1))&&i[a.text.charAt(++f)];if(!s)return null;var h=">"==s.charAt(1)?1:-1;if(o&&o.strict&&h>0!=(f==t.ch))return null;var d=r.getTokenTypeAt(n(t.line,f+1)),v=u(r,n(t.line,f+(h>0?1:0)),h,d,o);return null==v?null:{from:n(t.line,f),to:v&&v.pos,match:v&&v.ch==s.charAt(0),forward:h>0}}function u(r,t,o,u,a){for(var f=a&&a.maxScanLineLength||1e4,c=a&&a.maxScanLines||1e3,l=[],s=e(a),h=o>0?Math.min(t.line+c,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-c),d=t.line;d!=h;d+=o){var v=r.getLine(d);if(v){var m=o>0?0:v.length-1,p=o>0?v.length:-1;if(!(v.length>f))for(d==t.line&&(m=t.ch-(o<0?1:0));m!=p;m+=o){var g=v.charAt(m);if(s.test(g)&&(void 0===u||(r.getTokenTypeAt(n(d,m+1))||"")==(u||""))){var b=i[g];if(b&&">"==b.charAt(1)==o>0)l.push(g);else{if(!l.length)return{pos:n(d,m),ch:g};l.pop()}}}}}return d-o!=(o>0?r.lastLine():r.firstLine())&&null}function a(r,i,e){for(var u=r.state.matchBrackets.maxHighlightLineLength||1e3,a=e&&e.highlightNonMatching,f=[],c=r.listSelections(),l=0;l<c.length;l++){var s=c[l].empty()&&o(r,c[l].head,e);if(s&&(s.match||!1!==a)&&r.getLine(s.from.line).length<=u){var h=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";f.push(r.markText(s.from,n(s.from.line,s.from.ch+1),{className:h})),s.to&&r.getLine(s.to.line).length<=u&&f.push(r.markText(s.to,n(s.to.line,s.to.ch+1),{className:h}))}}if(f.length){t&&r.state.focused&&r.focus();var d=function(){r.operation((function(){for(var r=0;r<f.length;r++)f[r].clear()}))};if(!i)return d;setTimeout(d,800)}}function f(r){r.operation((function(){r.state.matchBrackets.currentlyHighlighted&&(r.state.matchBrackets.currentlyHighlighted(),r.state.matchBrackets.currentlyHighlighted=null),r.state.matchBrackets.currentlyHighlighted=a(r,!1,r.state.matchBrackets)}))}function c(r){r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted&&(r.state.matchBrackets.currentlyHighlighted(),r.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,(function(t,n,i){i&&i!=r.Init&&(t.off("cursorActivity",f),t.off("focus",f),t.off("blur",c),c(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",f),t.on("focus",f),t.on("blur",c))})),r.defineExtension("matchBrackets",(function(){a(this,!0)})),r.defineExtension("findMatchingBracket",(function(r,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),o(this,r,t)})),r.defineExtension("scanForBracket",(function(r,t,n,i){return u(this,r,t,n,i)}))}(u)})),e((function(){!function(r){var t="CodeMirror-lint-markers";function n(r){r.parentNode&&r.parentNode.removeChild(r)}function i(t,i,e,o){var u=function(t,n,i){var e=document.createElement("div");function o(t){if(!e.parentNode)return r.off(document,"mousemove",o);e.style.top=Math.max(0,t.clientY-e.offsetHeight-5)+"px",e.style.left=t.clientX+5+"px"}return e.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,e.appendChild(i.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(e):document.body.appendChild(e),r.on(document,"mousemove",o),o(n),null!=e.style.opacity&&(e.style.opacity=1),e}(t,i,e);function a(){var t;r.off(o,"mouseout",a),u&&((t=u).parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout((function(){n(t)}),600)),u=null)}var f=setInterval((function(){if(u)for(var r=o;;r=r.parentNode){if(r&&11==r.nodeType&&(r=r.host),r==document.body)return;if(!r){a();break}}if(!u)return clearInterval(f)}),400);r.on(o,"mouseout",a)}function e(r,t,n){for(var e in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},o)this.options[e]=o[e];for(var e in t)o.hasOwnProperty(e)?null!=t[e]&&(this.options[e]=t[e]):t.options||(this.linterOptions[e]=t[e]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){!function(r,t){var n=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className)){for(var e=n.getBoundingClientRect(),o=r.findMarksAt(r.coordsChar({left:(e.left+e.right)/2,top:(e.top+e.bottom)/2},"client")),u=[],a=0;a<o.length;++a){var c=o[a].__annotation;c&&u.push(c)}u.length&&function(r,t,n){for(var e=n.target||n.srcElement,o=document.createDocumentFragment(),u=0;u<t.length;u++)o.appendChild(f(t[u]));i(r,n,o,e)}(r,u,t)}}(r,t)},this.waitingFor=0}var o={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function u(r){var n=r.state.lint;n.hasGutter&&r.clearGutter(t),n.options.highlightLines&&function(r){r.eachLine((function(t){var n=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);n&&r.removeLineClass(t,"wrap",n[0])}))}(r);for(var i=0;i<n.marked.length;++i)n.marked[i].clear();n.marked.length=0}function a(t,n,e,o,u){var a=document.createElement("div"),f=a;return a.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+e,o&&((f=a.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=u&&r.on(f,"mouseover",(function(r){i(t,r,n,f)})),a}function f(r){var t=r.severity;t||(t="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message CodeMirror-lint-message-"+t,void 0!==r.messageHTML?n.innerHTML=r.messageHTML:n.appendChild(document.createTextNode(r.message)),n}function c(t){var n=t.state.lint;if(n){var i=n.options,e=i.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(e)if(i.async||e.async)!function(t,n){var i=t.state.lint,e=++i.waitingFor;function o(){e=-1,t.off("change",o)}t.on("change",o),n(t.getValue(),(function(n,u){t.off("change",o),i.waitingFor==e&&(u&&n instanceof r&&(n=u),t.operation((function(){l(t,n)})))}),i.linterOptions,t)}(t,e);else{var o=e(t.getValue(),n.linterOptions,t);if(!o)return;o.then?o.then((function(r){t.operation((function(){l(t,r)}))})):t.operation((function(){l(t,o)}))}}}function l(r,n){var i,e,o=r.state.lint;if(o){var c=o.options;u(r);for(var l=function(r){for(var t=[],n=0;n<r.length;++n){var i=r[n],e=i.from.line;(t[e]||(t[e]=[])).push(i)}return t}(n),s=0;s<l.length;++s){var h=l[s];if(h){var d=[];h=h.filter((function(r){return!(d.indexOf(r.message)>-1)&&d.push(r.message)}));for(var v=null,m=o.hasGutter&&document.createDocumentFragment(),p=0;p<h.length;++p){var g=h[p],b=g.severity;b||(b="error"),e=b,v="error"==(i=v)?i:e,c.formatAnnotation&&(g=c.formatAnnotation(g)),o.hasGutter&&m.appendChild(f(g)),g.to&&o.marked.push(r.markText(g.from,g.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+b,__annotation:g}))}o.hasGutter&&r.setGutterMarker(s,t,a(r,m,v,l[s].length>1,c.tooltips)),c.highlightLines&&r.addLineClass(s,"wrap","CodeMirror-lint-line-"+v)}}c.onUpdateLinting&&c.onUpdateLinting(n,l,r)}}function s(r){var t=r.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){c(r)}),t.options.delay))}r.defineOption("lint",!1,(function(n,i,o){if(o&&o!=r.Init&&(u(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",s),r.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),i){for(var a=n.getOption("gutters"),f=!1,l=0;l<a.length;++l)a[l]==t&&(f=!0);var h=n.state.lint=new e(n,i,f);h.options.lintOnChange&&n.on("change",s),0!=h.options.tooltips&&"gutter"!=h.options.tooltips&&r.on(n.getWrapperElement(),"mouseover",h.onMouseOver),c(n)}})),r.defineExtension("performLint",(function(){c(this)}))}(u)})),e((function(){var r;(r=u).registerHelper("lint","json",(function(t){var n=[];if(!window.jsonlint)return window.console&&window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."),n;var i=window.jsonlint.parser||window.jsonlint;i.parseError=function(t,i){var e=i.loc;n.push({from:r.Pos(e.first_line-1,e.first_column),to:r.Pos(e.last_line-1,e.last_column),message:t})};try{i.parse(t)}catch(r){}return n}))})),e((function(){!function(r){function t(t,n,e,o){if(e&&e.call){var u=e;e=null}else u=i(t,e,"rangeFinder");"number"==typeof n&&(n=r.Pos(n,0));var a=i(t,e,"minFoldSize");function f(r){var i=u(t,n);if(!i||i.to.line-i.from.line<a)return null;if("fold"===o)return i;for(var e=t.findMarksAt(i.from),f=0;f<e.length;++f)if(e[f].__isFold){if(!r)return null;i.cleared=!0,e[f].clear()}return i}var c=f(!0);if(i(t,e,"scanUp"))for(;!c&&n.line>t.firstLine();)n=r.Pos(n.line-1,0),c=f(!1);if(c&&!c.cleared&&"unfold"!==o){var l=function(r,t,n){var e=i(r,t,"widget");if("function"==typeof e&&(e=e(n.from,n.to)),"string"==typeof e){var o=document.createTextNode(e);(e=document.createElement("span")).appendChild(o),e.className="CodeMirror-foldmarker"}else e&&(e=e.cloneNode(!0));return e}(t,e,c);r.on(l,"mousedown",(function(t){s.clear(),r.e_preventDefault(t)}));var s=t.markText(c.from,c.to,{replacedWith:l,clearOnEnter:i(t,e,"clearOnEnter"),__isFold:!0});s.on("clear",(function(n,i){r.signal(t,"unfold",t,n,i)})),r.signal(t,"fold",t,c.from,c.to)}}r.newFoldFunction=function(r,n){return function(i,e){t(i,e,{rangeFinder:r,widget:n})}},r.defineExtension("foldCode",(function(r,n,i){t(this,r,n,i)})),r.defineExtension("isFolded",(function(r){for(var t=this.findMarksAt(r),n=0;n<t.length;++n)if(t[n].__isFold)return!0})),r.commands.toggleFold=function(r){r.foldCode(r.getCursor())},r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")},r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(t){t.operation((function(){for(var n=t.firstLine(),i=t.lastLine();n<=i;n++)t.foldCode(r.Pos(n,0),{scanUp:!1},"fold")}))},r.commands.unfoldAll=function(t){t.operation((function(){for(var n=t.firstLine(),i=t.lastLine();n<=i;n++)t.foldCode(r.Pos(n,0),{scanUp:!1},"unfold")}))},r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,n){for(var i=0;i<r.length;++i){var e=r[i](t,n);if(e)return e}}})),r.registerHelper("fold","auto",(function(r,t){for(var n=r.getHelpers(t,"fold"),i=0;i<n.length;i++){var e=n[i](r,t);if(e)return e}}));var n={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(r,t,i){if(t&&void 0!==t[i])return t[i];var e=r.options.foldOptions;return e&&void 0!==e[i]?e[i]:n[i]}r.defineOption("foldOptions",null),r.defineExtension("foldOption",(function(r,t){return i(this,r,t)}))}(u)})),e((function(){!function(r){r.defineOption("foldGutter",!1,(function(t,i,e){var o;e&&e!=r.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",f),t.off("changes",c),t.off("viewportChange",l),t.off("fold",s),t.off("unfold",s),t.off("swapDoc",c)),i&&(t.state.foldGutter=new n((!0===(o=i)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),a(t),t.on("gutterClick",f),t.on("changes",c),t.on("viewportChange",l),t.on("fold",s),t.on("unfold",s),t.on("swapDoc",c))}));var t=r.Pos;function n(r){this.options=r,this.from=this.to=0}function i(r,n){for(var i=r.findMarks(t(n,0),t(n+1,0)),e=0;e<i.length;++e)if(i[e].__isFold){var o=i[e].find(-1);if(o&&o.line===n)return i[e]}}function e(r){if("string"==typeof r){var t=document.createElement("div");return t.className=r+" CodeMirror-guttermarker-subtle",t}return r.cloneNode(!0)}function o(r,n,o){var a=r.state.foldGutter.options,f=n-1,c=r.foldOption(a,"minFoldSize"),l=r.foldOption(a,"rangeFinder"),s="string"==typeof a.indicatorFolded&&u(a.indicatorFolded),h="string"==typeof a.indicatorOpen&&u(a.indicatorOpen);r.eachLine(n,o,(function(n){++f;var o=null,u=n.gutterMarkers;if(u&&(u=u[a.gutter]),i(r,f)){if(s&&u&&s.test(u.className))return;o=e(a.indicatorFolded)}else{var d=t(f,0),v=l&&l(r,d);if(v&&v.to.line-v.from.line>=c){if(h&&u&&h.test(u.className))return;o=e(a.indicatorOpen)}}(o||u)&&r.setGutterMarker(n,a.gutter,o)}))}function u(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function a(r){var t=r.getViewport(),n=r.state.foldGutter;n&&(r.operation((function(){o(r,t.from,t.to)})),n.from=t.from,n.to=t.to)}function f(r,n,e){var o=r.state.foldGutter;if(o){var u=o.options;if(e==u.gutter){var a=i(r,n);a?a.clear():r.foldCode(t(n,0),u)}}}function c(r){var t=r.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){a(r)}),n.foldOnChangeTimeSpan||600)}}function l(r){var t=r.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=r.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(r):r.operation((function(){n.from<t.from&&(o(r,n.from,t.from),t.from=n.from),n.to>t.to&&(o(r,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function s(r,t){var n=r.state.foldGutter;if(n){var i=t.line;i>=n.from&&i<n.to&&o(r,i,i+1)}}}(u)})),e((function(){!function(r){function t(t){return function(n,i){var e=i.line,o=n.getLine(e);function u(t){for(var u,a=i.ch,f=0;;){var c=a<=0?-1:o.lastIndexOf(t[0],a-1);if(-1!=c){if(1==f&&c<i.ch)break;if(u=n.getTokenTypeAt(r.Pos(e,c+1)),!/^(comment|string)/.test(u))return{ch:c+1,tokenType:u,pair:t};a=c-1}else{if(1==f)break;f=1,a=o.length}}}function a(t){var i,o,u=1,a=n.lastLine(),f=t.ch;r:for(var c=e;c<=a;++c)for(var l=n.getLine(c),s=c==e?f:0;;){var h=l.indexOf(t.pair[0],s),d=l.indexOf(t.pair[1],s);if(h<0&&(h=l.length),d<0&&(d=l.length),(s=Math.min(h,d))==l.length)break;if(n.getTokenTypeAt(r.Pos(c,s+1))==t.tokenType)if(s==h)++u;else if(!--u){i=c,o=s;break r}++s}return null==i||e==i?null:{from:r.Pos(e,f),to:r.Pos(i,o)}}for(var f=[],c=0;c<t.length;c++){var l=u(t[c]);l&&f.push(l)}for(f.sort((function(r,t){return r.ch-t.ch})),c=0;c<f.length;c++){var s=a(f[c]);if(s)return s}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",(function(t,n){function i(n){if(n<t.firstLine()||n>t.lastLine())return null;var i=t.getTokenAt(r.Pos(n,1));if(/\S/.test(i.string)||(i=t.getTokenAt(r.Pos(n,i.end+1))),"keyword"!=i.type||"import"!=i.string)return null;for(var e=n,o=Math.min(t.lastLine(),n+10);e<=o;++e){var u=t.getLine(e).indexOf(";");if(-1!=u)return{startCh:i.end,end:r.Pos(e,u)}}}var e,o=n.line,u=i(o);if(!u||i(o-1)||(e=i(o-2))&&e.end.line==o-1)return null;for(var a=u.end;;){var f=i(a.line+1);if(null==f)break;a=f.end}return{from:t.clipPos(r.Pos(o,u.startCh+1)),to:a}})),r.registerHelper("fold","include",(function(t,n){function i(n){if(n<t.firstLine()||n>t.lastLine())return null;var i=t.getTokenAt(r.Pos(n,1));return/\S/.test(i.string)||(i=t.getTokenAt(r.Pos(n,i.end+1))),"meta"==i.type&&"#include"==i.string.slice(0,8)?i.start+8:void 0}var e=n.line,o=i(e);if(null==o||null!=i(e-1))return null;for(var u=e;null!=i(u+1);)++u;return{from:r.Pos(e,o+1),to:t.clipPos(r.Pos(u))}}))}(u)}));var a=e((function(r){var t=function(){var r,t,n,i,e,o,u,a,f,c,l,s=!0,h={},d=(e={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=function(t){throw{name:"SyntaxError",message:t,at:r,text:n}},u=function(i){return i&&i!==t&&o("Expected '"+i+"' instead of '"+t+"'"),t=n.charAt(r),r+=1,t},a=function(){var r,n="";for("-"===t&&(n="-",u("-"));t>="0"&&t<="9";)n+=t,u();if("."===t)for(n+=".";u()&&t>="0"&&t<="9";)n+=t;if("e"===t||"E"===t)for(n+=t,u(),"-"!==t&&"+"!==t||(n+=t,u());t>="0"&&t<="9";)n+=t,u();if(r=+n,isFinite(r))return r;o("Bad number")},f=function(){var r,n,i,a="";if('"'===t)for(;u();){if('"'===t)return u(),a;if("\\"===t)if(u(),"u"===t){for(i=0,n=0;n<4&&(r=parseInt(u(),16),isFinite(r));n+=1)i=16*i+r;a+=String.fromCharCode(i)}else{if("string"!=typeof e[t])break;a+=e[t]}else a+=t}o("Bad string")},c=function(){for(;t&&t<=" ";)u()},i=function(){switch(c(),t){case"{":return function(){var r,n={};if("{"===t){if(u("{"),c(),"}"===t)return u("}"),n;for(;t;){if(r=f(),c(),u(":"),Object.hasOwnProperty.call(n,r)&&o("Duplicate key '"+r+"'"),n[r]=i(),c(),"}"===t)return u("}"),n;u(","),c()}}o("Bad object")}();case"[":return function(){var r=[];if("["===t){if(u("["),c(),"]"===t)return u("]"),r;for(;t;){if(r.push(i()),c(),"]"===t)return u("]"),r;u(","),c()}}o("Bad array")}();case'"':return f();case"-":return a();default:return t>="0"&&t<="9"?a():function(){switch(t){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}o("Unexpected '"+t+"'")}()}},function(e,u){var a;return n=e,r=0,t=" ",a=i(),c(),t&&o("Syntax error"),"function"==typeof u?function r(t,n){var i,e,o=t[n];if(o&&"object"==typeof o)for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(void 0!==(e=r(o,i))?o[i]=e:delete o[i]);return u.call(t,n,o)}({"":a},""):a}),v=((l={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(r,t,n,i,e,o){var u=o.length-1;switch(e){case 1:this.$=r.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(r);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=o[u-1];case 13:this.$={};break;case 14:this.$=o[u-1];break;case 15:this.$=[o[u-2],o[u]];break;case 16:this.$={},this.$[o[u][0]]=o[u][1];break;case 17:this.$=o[u-2],o[u-2][o[u][0]]=o[u][1];break;case 18:this.$=[];break;case 19:this.$=o[u-1];break;case 20:this.$=[o[u]];break;case 21:this.$=o[u-2],o[u-2].push(o[u])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(r){throw new Error(r)},parse:function(r){var t=this,n=[0],i=[null],e=[],o=this.table,u="",a=0,f=0,c=0;this.lexer.setInput(r),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;function s(){var r;return"number"!=typeof(r=t.lexer.lex()||1)&&(r=t.symbols_[r]||r),r}e.push(l),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var h,d,v,m,p,g,b,w,C={};;){if(this.defaultActions[v=n[n.length-1]]?m=this.defaultActions[v]:(null==h&&(h=s()),m=o[v]&&o[v][h]),void 0===m||!m.length||!m[0]){if(!c){for(g in w=[],o[v])this.terminals_[g]&&g>2&&w.push("'"+this.terminals_[g]+"'");var k="";k=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+this.terminals_[h]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:l,expected:w})}if(3==c){if(1==h)throw new Error(k||"Parsing halted.");f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,l=this.lexer.yylloc,h=s()}for(;!(2..toString()in o[v]);){if(0==v)throw new Error(k||"Parsing halted.");n.length=n.length-2*1,i.length=i.length-1,e.length=e.length-1,v=n[n.length-1]}d=h,h=2,m=o[v=n[n.length-1]]&&o[v][2],c=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+h);switch(m[0]){case 1:n.push(h),i.push(this.lexer.yytext),e.push(this.lexer.yylloc),n.push(m[1]),h=null,d?(h=d,d=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,l=this.lexer.yylloc,c>0&&c--);break;case 2:if(C.$=i[i.length-(b=this.productions_[m[1]][1])],C._$={first_line:e[e.length-(b||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(b||1)].first_column,last_column:e[e.length-1].last_column},void 0!==(p=this.performAction.call(C,u,f,a,this.yy,m[1],i,e)))return p;b&&(n=n.slice(0,-1*b*2),i=i.slice(0,-1*b),e=e.slice(0,-1*b)),n.push(this.productions_[m[1]][0]),i.push(C.$),e.push(C._$),n.push(o[n[n.length-2]][n[n.length-1]]);break;case 3:return!0}}return!0}}).lexer={EOF:1,parseError:function(r,t){if(!this.yy.parseError)throw new Error(r);this.yy.parseError(r,t)},setInput:function(r){return this._input=r,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var r=this._input[0];return this.yytext+=r,this.yyleng++,this.match+=r,this.matched+=r,r.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),r},unput:function(r){return this._input=r+this._input,this},more:function(){return this._more=!0,this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var r,t,n,i,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),u=0;u<o.length&&(!(n=this._input.match(this.rules[o[u]]))||t&&!(n[0].length>t[0].length)||(t=n,i=u,this.options.flex));u++);return t?((e=t[0].match(/\n.*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return void 0!==r?r:this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(r){this.begin(r)},options:{},performAction:function(r,t,n){switch(n){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}},l),m=v.parse;return v.parse=function(r){var t=m.call(v,r),n=void 0===d?s("./doug-json-parse"):d;try{n(r)}catch(t){if(/Duplicate key|Bad string|Unexpected/.test(t.message)){var i=r.substring(0,t.at).split("\n"),e=i.length;throw this.parseError(t.message,{line:e,col:i[e-1].length-1,message:t.message.replace(/./,(function(r){return r.toLowerCase()}))}),SyntaxError(t.message+" on line "+e)}}return t},void 0!==h&&(h.parser=v,h.parse=function(){return v.parse.apply(v,arguments)},h.main=function(r){if(!r[1])throw new Error("Usage: "+r[0]+" FILE");if("undefined"!=typeof process)var t=s("fs").readFileSync(s("path").join(process.cwd(),r[1]),"utf8");else t=s("file").path(s("file").cwd()).join(r[1]).read({charset:"utf-8"});return h.parser.parse(t)},!1===s.main&&h.main("undefined"!=typeof process?process.argv.slice(1):s("system").args)),h}();r.exports&&(r.exports=t)}));const f=class{constructor(n){r(this,n),this.change=t(this,"change",7),this.value="",this.readonly=!1,this.lineNumbers=!1,this.fold=!1,this.lint=!1,this.colorScheme="auto",this.handleChangeDarkMode=()=>{"auto"===this.colorScheme&&this.forceRedraw()},this.handleChange=()=>{this.change.emit(this.editor.getValue())},this.handleResize=()=>{this.editor&&this.editor.refresh()}}connectedCallback(){this.observer=new ResizeObserver(this.handleResize),this.observer.observe(this.host),this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){this.observer.unobserve(this.host),this.editor.off("change",this.handleChange),this.editor=null,this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const r=this.host.shadowRoot.querySelector(".editor");null==r||r.childNodes.forEach((r=>{r.remove()}))}componentDidRender(){this.editor||(this.editor=this.createEditor())}watchValue(r){this.editor&&r!==this.editor.getValue()&&this.editor.getDoc().setValue(r||"")}createEditor(){const r=this.getOptions(),t=u(this.host.shadowRoot.querySelector(".editor"),r);return t.on("change",this.handleChange),t.setOption("extraKeys",{Tab:r=>{const t=Array(r.getOption("indentUnit")+1).join(" ");r.replaceSelection(t)}}),t}getOptions(){let r=this.language,t="lime light";const n=[];return this.isDarkMode()&&(t="lime dark"),"json"===this.language?(r={name:"application/json",json:!0},this.lint&&(n.push("CodeMirror-lint-markers"),"jsonlint"in window||(window.jsonlint=a))):"typescript"===this.language&&(r={name:"application/typescript",typescript:!0}),this.fold&&n.push("CodeMirror-foldgutter"),{mode:r,value:this.value||"",theme:t,readOnly:this.readonly,tabSize:4,indentUnit:4,lineNumbers:this.lineNumbers,styleActiveLine:!0,matchBrackets:!0,lint:this.lint,foldGutter:this.fold,gutters:n}}isDarkMode(){return"auto"!==this.colorScheme?"dark"===this.colorScheme:this.darkMode.matches}render(){const r={editor:!0,readonly:this.readonly,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return n("div",{class:r})}forceRedraw(){this.random=Math.random()}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}get host(){return i(this)}static get watchers(){return{value:["watchValue"]}}};f.style=".CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\")}.CodeMirror-lint-mark-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-multiple{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:rgba(183, 76, 81, 0.08)}.CodeMirror-lint-line-warning{background-color:rgba(255, 211, 0, 0.1)}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}:host{display:flex;font-size:var(--code-editor-font-size, 0.875rem)}.editor{display:flex;align-items:stretch;width:100%}.editor.is-light-mode{--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}.editor.is-light-mode .cm-attribute,.editor.is-light-mode .cm-property,.editor.is-light-mode .cm-keyword{color:rgb(var(--color-violet-light))}.editor.is-light-mode .cm-operator{color:rgb(var(--color-sky-dark))}.editor.is-light-mode .cm-variable{color:rgb(var(--color-pink-light))}.editor.is-light-mode .cm-variable-2{color:rgb(var(--contrast-1100))}.editor.is-light-mode .cm-variable-3,.editor.is-light-mode .cm-type{color:rgb(var(--color-amber-darker))}.editor.is-light-mode .cm-builtin,.editor.is-light-mode .cm-meta{color:rgb(var(--color-amber-default))}.editor.is-light-mode .cm-atom{color:rgb(var(--color-coral-default))}.editor.is-light-mode .cm-tag,.editor.is-light-mode .cm-number{color:rgb(var(--color-magenta-default))}.editor.is-light-mode .cm-def{color:rgb(var(--color-sky-default))}.editor.is-light-mode .cm-string{color:rgb(var(--color-green-dark))}.editor.is-light-mode .cm-string-2{color:rgb(var(--color-pink-default))}.editor.is-light-mode .cm-qualifier{color:rgb(var(--color-grass-default))}.editor.is-light-mode .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}.editor.is-light-mode .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}.editor.is-dark-mode{--code-editor-neutral-text-color:var(--contrast-200);--code-editor-background-color:var(--contrast-1600);--code-editor-gutter-background-color:var(--contrast-1500);--code-editor-line-number-text-color:var(--contrast-1000);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-1700)}.editor.is-dark-mode .cm-attribute,.editor.is-dark-mode .cm-property,.editor.is-dark-mode .cm-keyword{color:rgb(var(--color-purple-lighter))}.editor.is-dark-mode .cm-operator{color:rgb(var(--color-sky-lighter))}.editor.is-dark-mode .cm-variable{color:rgb(var(--color-pink-light))}.editor.is-dark-mode .cm-variable-2{color:rgb(var(--contrast-300))}.editor.is-dark-mode .cm-variable-3,.editor.is-dark-mode .cm-type{color:rgb(var(--color-yellow-light))}.editor.is-dark-mode .cm-builtin,.editor.is-dark-mode .cm-meta{color:rgb(var(--color-amber-default))}.editor.is-dark-mode .cm-atom{color:rgb(var(--color-coral-light))}.editor.is-dark-mode .cm-tag,.editor.is-dark-mode .cm-number{color:rgb(var(--color-magenta-light))}.editor.is-dark-mode .cm-def{color:rgb(var(--color-sky-light))}.editor.is-dark-mode .cm-string{color:rgb(var(--color-lime-light))}.editor.is-dark-mode .cm-string-2{color:rgb(var(--color-pink-lighter))}.editor.is-dark-mode .cm-qualifier{color:rgb(var(--color-grass-light))}.editor.is-dark-mode .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}.editor.is-dark-mode .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto;width:100%}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}.cm-s-lime .CodeMirror-lint-marker-error,.cm-s-lime .CodeMirror-lint-message-error{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;box-shadow:var(--button-shadow-normal);color:transparent;text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle cx='16' cy='16' r='2'/><circle cx='26' cy='16' r='2'/><circle cx='6' cy='16' r='2'/></svg>\");background-size:contain;background-repeat:no-repeat;background-position:center}.cm-s-lime .CodeMirror-foldmarker:hover{box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.is-dark-mode .cm-s-lime .CodeMirror-foldmarker{background-color:rgb(var(--contrast-1200))}.cm-s-lime [class^=CodeMirror-foldgutter]{color:var(--code-editor-neutral-text-color);transition:opacity 0.2s ease;opacity:0.4}.cm-s-lime [class^=CodeMirror-foldgutter]:hover{opacity:1}.cm-s-lime .CodeMirror-foldgutter-folded{opacity:0.7}";export{f as limel_code_editor}