@limetech/lime-elements 36.0.0-next.9 → 36.1.0-dev.1

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 (304) hide show
  1. package/dist/cjs/{checkbox.template-b6c6562c.js → checkbox.template-ac867c17.js} +1 -1
  2. package/dist/cjs/{dateFormatter-05d80b12.js → dateFormatter-d7a8d40d.js} +1 -1
  3. package/dist/cjs/{index-2a28697b.js → index-287e25e0.js} +424 -246
  4. package/dist/cjs/lime-elements.cjs.js +3 -3
  5. package/dist/cjs/limel-badge.cjs.entry.js +24 -3
  6. package/dist/cjs/limel-banner.cjs.entry.js +3 -1
  7. package/dist/cjs/limel-button-group.cjs.entry.js +3 -8
  8. package/dist/cjs/{limel-button.cjs.entry.js → limel-button_2.cjs.entry.js} +117 -21
  9. package/dist/cjs/limel-checkbox.cjs.entry.js +10 -26
  10. package/dist/cjs/limel-chip-set.cjs.entry.js +40 -63
  11. package/dist/cjs/limel-circular-progress.cjs.entry.js +10 -15
  12. package/dist/cjs/limel-code-editor.cjs.entry.js +1693 -86
  13. package/dist/cjs/limel-collapsible-section.cjs.entry.js +5 -6
  14. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +5 -1
  15. package/dist/cjs/limel-color-picker.cjs.entry.js +8 -2
  16. package/dist/cjs/limel-config.cjs.entry.js +2 -1
  17. package/dist/cjs/limel-date-picker.cjs.entry.js +18 -36
  18. package/dist/cjs/limel-dialog.cjs.entry.js +3 -11
  19. package/dist/cjs/limel-dock-button.cjs.entry.js +30 -14
  20. package/dist/cjs/limel-dock.cjs.entry.js +12 -47
  21. package/dist/cjs/limel-file.cjs.entry.js +10 -24
  22. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +151 -50
  23. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -13
  24. package/dist/cjs/limel-form.cjs.entry.js +327 -328
  25. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  26. package/dist/cjs/limel-header.cjs.entry.js +5 -1
  27. package/dist/cjs/limel-icon-button.cjs.entry.js +3 -8
  28. package/dist/cjs/limel-icon.cjs.entry.js +4 -1
  29. package/dist/cjs/limel-input-field.cjs.entry.js +40 -66
  30. package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -7
  31. package/dist/cjs/limel-list_2.cjs.entry.js +9 -18
  32. package/dist/cjs/limel-menu-list.cjs.entry.js +8 -16
  33. package/dist/cjs/limel-picker.cjs.entry.js +14 -39
  34. package/dist/cjs/limel-popover_4.cjs.entry.js +14 -13
  35. package/dist/cjs/limel-portal.cjs.entry.js +63 -73
  36. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +5 -14
  37. package/dist/cjs/limel-progress-flow.cjs.entry.js +4 -20
  38. package/dist/cjs/limel-select.cjs.entry.js +12 -30
  39. package/dist/cjs/limel-shortcut.cjs.entry.js +52 -0
  40. package/dist/cjs/limel-slider.cjs.entry.js +12 -33
  41. package/dist/cjs/limel-snackbar.cjs.entry.js +7 -5
  42. package/dist/cjs/limel-spinner.cjs.entry.js +1 -7
  43. package/dist/cjs/limel-split-button.cjs.entry.js +27 -0
  44. package/dist/cjs/limel-switch.cjs.entry.js +6 -19
  45. package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -5
  46. package/dist/cjs/limel-tab-panel.cjs.entry.js +2 -5
  47. package/dist/cjs/limel-table.cjs.entry.js +33 -33
  48. package/dist/cjs/loader.cjs.js +3 -3
  49. package/dist/cjs/{moment-5cfac5cd.js → moment-d1e35cdc.js} +2 -2
  50. package/dist/cjs/{translations-5a8d7f6c.js → translations-ca7279bc.js} +6 -0
  51. package/dist/collection/collection-manifest.json +4 -2
  52. package/dist/collection/components/badge/badge.css +13 -0
  53. package/dist/collection/components/badge/badge.js +60 -28
  54. package/dist/collection/components/banner/banner.js +88 -83
  55. package/dist/collection/components/button/button.css +15 -8
  56. package/dist/collection/components/button/button.js +148 -160
  57. package/dist/collection/components/button-group/button-group.js +81 -79
  58. package/dist/collection/components/checkbox/checkbox.js +172 -176
  59. package/dist/collection/components/checkbox/checkbox.template.js +15 -23
  60. package/dist/collection/components/chip-set/chip-set.css +10 -2
  61. package/dist/collection/components/chip-set/chip-set.js +500 -534
  62. package/dist/collection/components/circular-progress/circular-progress.css +27 -5
  63. package/dist/collection/components/circular-progress/circular-progress.js +129 -113
  64. package/dist/collection/components/code-editor/code-editor.css +153 -1
  65. package/dist/collection/components/code-editor/code-editor.js +219 -135
  66. package/dist/collection/components/collapsible-section/collapsible-section.css +8 -7
  67. package/dist/collection/components/collapsible-section/collapsible-section.js +120 -124
  68. package/dist/collection/components/color-picker/color-picker-palette.js +102 -92
  69. package/dist/collection/components/color-picker/color-picker.js +143 -131
  70. package/dist/collection/components/config/config.js +21 -17
  71. package/dist/collection/components/date-picker/date-picker.js +255 -245
  72. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +595 -166
  73. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +150 -143
  74. package/dist/collection/components/date-picker/pickers/QuarterPicker.js +1 -3
  75. package/dist/collection/components/dialog/dialog.js +134 -142
  76. package/dist/collection/components/dock/dock-button/dock-button.css +15 -9
  77. package/dist/collection/components/dock/dock-button/dock-button.js +158 -124
  78. package/dist/collection/components/dock/dock.css +7 -3
  79. package/dist/collection/components/dock/dock.js +207 -205
  80. package/dist/collection/components/file/file.js +187 -191
  81. package/dist/collection/components/flex-container/flex-container.js +96 -102
  82. package/dist/collection/components/form/form.js +158 -150
  83. package/dist/collection/components/grid/grid.js +11 -7
  84. package/dist/collection/components/header/header.js +89 -87
  85. package/dist/collection/components/icon/icon.js +79 -66
  86. package/dist/collection/components/icon-button/icon-button.js +85 -85
  87. package/dist/collection/components/input-field/input-field.css +9 -8
  88. package/dist/collection/components/input-field/input-field.js +494 -510
  89. package/dist/collection/components/linear-progress/linear-progress.js +57 -61
  90. package/dist/collection/components/list/list-renderer.js +3 -12
  91. package/dist/collection/components/list/list.js +167 -164
  92. package/dist/collection/components/list/radio-button/radio-button.template.js +2 -8
  93. package/dist/collection/components/menu/menu.js +185 -208
  94. package/dist/collection/components/menu-list/menu-list-renderer.js +2 -9
  95. package/dist/collection/components/menu-list/menu-list.js +150 -167
  96. package/dist/collection/components/menu-surface/menu-surface.js +69 -64
  97. package/dist/collection/components/picker/picker.js +412 -427
  98. package/dist/collection/components/popover/popover.js +79 -74
  99. package/dist/collection/components/popover-surface/popover-surface.css +9 -4
  100. package/dist/collection/components/popover-surface/popover-surface.js +34 -25
  101. package/dist/collection/components/portal/portal.js +145 -158
  102. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +21 -8
  103. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js +90 -94
  104. package/dist/collection/components/progress-flow/progress-flow.js +93 -101
  105. package/dist/collection/components/select/select.css +10 -11
  106. package/dist/collection/components/select/select.js +206 -211
  107. package/dist/collection/components/select/select.template.js +10 -25
  108. package/dist/collection/components/shortcut/shortcut.css +91 -0
  109. package/dist/collection/components/shortcut/shortcut.js +194 -0
  110. package/dist/collection/components/slider/slider.js +233 -264
  111. package/dist/collection/components/snackbar/snackbar.js +175 -169
  112. package/dist/collection/components/spinner/spinner.js +56 -85
  113. package/dist/collection/components/split-button/split-button.css +75 -0
  114. package/dist/collection/components/split-button/split-button.js +168 -0
  115. package/dist/collection/components/switch/switch.js +117 -129
  116. package/dist/collection/components/tab-bar/tab-bar.js +87 -92
  117. package/dist/collection/components/tab-panel/tab-panel.js +64 -61
  118. package/dist/collection/components/table/columns.js +1 -0
  119. package/dist/collection/components/table/layout.js +8 -0
  120. package/dist/collection/components/table/table.css +89 -61
  121. package/dist/collection/components/table/table.js +453 -432
  122. package/dist/collection/components/tooltip/tooltip-content.js +70 -61
  123. package/dist/collection/components/tooltip/tooltip.js +96 -91
  124. package/dist/collection/icons/angle_left.svg +593 -0
  125. package/dist/collection/icons/angle_right.svg +593 -0
  126. package/dist/collection/icons/external_link.svg +593 -0
  127. package/dist/collection/icons/high_importance.svg +593 -0
  128. package/dist/collection/icons/unit-test.svg +593 -0
  129. package/dist/collection/style/internal/codemirror-tooltip.scss +19 -0
  130. package/dist/collection/style/internal/z-index.scss +0 -7
  131. package/dist/collection/style/mixins.scss +11 -0
  132. package/dist/collection/translations/da.js +1 -0
  133. package/dist/collection/translations/en.js +1 -0
  134. package/dist/collection/translations/fi.js +1 -0
  135. package/dist/collection/translations/nl.js +1 -0
  136. package/dist/collection/translations/no.js +1 -0
  137. package/dist/collection/translations/sv.js +1 -0
  138. package/dist/esm/{checkbox.template-2f1bbc98.js → checkbox.template-fc7fcd06.js} +1 -1
  139. package/dist/esm/{dateFormatter-2cad0292.js → dateFormatter-784c3334.js} +1 -1
  140. package/dist/esm/{index-11cd0b60.js → index-cdfd351d.js} +424 -246
  141. package/dist/esm/lime-elements.js +3 -3
  142. package/dist/esm/limel-badge.entry.js +24 -3
  143. package/dist/esm/limel-banner.entry.js +3 -1
  144. package/dist/esm/limel-button-group.entry.js +3 -8
  145. package/dist/esm/{limel-button.entry.js → limel-button_2.entry.js} +117 -22
  146. package/dist/esm/limel-checkbox.entry.js +10 -26
  147. package/dist/esm/limel-chip-set.entry.js +40 -63
  148. package/dist/esm/limel-circular-progress.entry.js +10 -15
  149. package/dist/esm/limel-code-editor.entry.js +1693 -86
  150. package/dist/esm/limel-collapsible-section.entry.js +5 -6
  151. package/dist/esm/limel-color-picker-palette.entry.js +5 -1
  152. package/dist/esm/limel-color-picker.entry.js +8 -2
  153. package/dist/esm/limel-config.entry.js +2 -1
  154. package/dist/esm/limel-date-picker.entry.js +18 -36
  155. package/dist/esm/limel-dialog.entry.js +3 -11
  156. package/dist/esm/limel-dock-button.entry.js +30 -14
  157. package/dist/esm/limel-dock.entry.js +12 -47
  158. package/dist/esm/limel-file.entry.js +10 -24
  159. package/dist/esm/limel-flatpickr-adapter.entry.js +151 -50
  160. package/dist/esm/limel-flex-container.entry.js +1 -13
  161. package/dist/esm/limel-form.entry.js +327 -328
  162. package/dist/esm/limel-grid.entry.js +1 -1
  163. package/dist/esm/limel-header.entry.js +5 -1
  164. package/dist/esm/limel-icon-button.entry.js +3 -8
  165. package/dist/esm/limel-icon.entry.js +4 -1
  166. package/dist/esm/limel-input-field.entry.js +40 -66
  167. package/dist/esm/limel-linear-progress.entry.js +1 -7
  168. package/dist/esm/limel-list_2.entry.js +9 -18
  169. package/dist/esm/limel-menu-list.entry.js +8 -16
  170. package/dist/esm/limel-picker.entry.js +14 -39
  171. package/dist/esm/limel-popover_4.entry.js +14 -13
  172. package/dist/esm/limel-portal.entry.js +63 -73
  173. package/dist/esm/limel-progress-flow-item.entry.js +5 -14
  174. package/dist/esm/limel-progress-flow.entry.js +4 -20
  175. package/dist/esm/limel-select.entry.js +12 -30
  176. package/dist/esm/limel-shortcut.entry.js +48 -0
  177. package/dist/esm/limel-slider.entry.js +12 -33
  178. package/dist/esm/limel-snackbar.entry.js +7 -5
  179. package/dist/esm/limel-spinner.entry.js +1 -7
  180. package/dist/esm/limel-split-button.entry.js +23 -0
  181. package/dist/esm/limel-switch.entry.js +6 -19
  182. package/dist/esm/limel-tab-bar.entry.js +2 -5
  183. package/dist/esm/limel-tab-panel.entry.js +2 -5
  184. package/dist/esm/limel-table.entry.js +33 -33
  185. package/dist/esm/loader.js +3 -3
  186. package/dist/esm/{moment-367e51c5.js → moment-faa8a4a8.js} +2 -2
  187. package/dist/esm/polyfills/css-shim.js +1 -1
  188. package/dist/esm/{translations-682e905e.js → translations-0d0ee941.js} +6 -0
  189. package/dist/lime-elements/lime-elements.css +1 -1
  190. package/dist/lime-elements/lime-elements.esm.js +1 -1
  191. package/dist/lime-elements/p-059e0a64.entry.js +1 -0
  192. package/dist/lime-elements/{p-440454ed.entry.js → p-06f2f6b4.entry.js} +1 -1
  193. package/dist/lime-elements/{p-71efe2ca.entry.js → p-0dbde06f.entry.js} +1 -1
  194. package/dist/lime-elements/p-12a7453b.entry.js +73 -0
  195. package/dist/lime-elements/p-15c2eb16.entry.js +1 -0
  196. package/dist/lime-elements/{p-c80acfb2.entry.js → p-15ca0d70.entry.js} +4 -4
  197. package/dist/lime-elements/{p-ed65468d.entry.js → p-16eb9071.entry.js} +1 -1
  198. package/dist/lime-elements/{p-1ede893b.js → p-1af8258b.js} +1 -1
  199. package/dist/lime-elements/p-246862ec.js +1 -0
  200. package/dist/lime-elements/p-28dffd9e.entry.js +1 -0
  201. package/dist/lime-elements/p-334b5f82.entry.js +37 -0
  202. package/dist/lime-elements/p-36a3b897.entry.js +1 -0
  203. package/dist/lime-elements/p-4b426b7e.entry.js +11 -0
  204. package/dist/lime-elements/p-4eda8b67.entry.js +82 -0
  205. package/dist/lime-elements/{p-9af0704c.entry.js → p-4fb4e89b.entry.js} +1 -1
  206. package/dist/lime-elements/{p-a5af84a7.entry.js → p-5338663b.entry.js} +1 -1
  207. package/dist/lime-elements/p-5ce60a32.entry.js +126 -0
  208. package/dist/lime-elements/p-5f13035a.entry.js +1 -0
  209. package/dist/lime-elements/{p-42b67933.entry.js → p-600464a9.entry.js} +1 -1
  210. package/dist/lime-elements/p-6534e16a.entry.js +1 -0
  211. package/dist/lime-elements/p-6a4a5ddd.entry.js +1 -0
  212. package/dist/lime-elements/p-6c38b505.entry.js +1 -0
  213. package/dist/lime-elements/{p-d76f896d.js → p-73df4d83.js} +1 -1
  214. package/dist/lime-elements/p-744c21f8.entry.js +1 -0
  215. package/dist/lime-elements/p-75d01713.entry.js +1 -0
  216. package/dist/lime-elements/p-768b7cbb.entry.js +1 -0
  217. package/dist/lime-elements/{p-6e7809a6.entry.js → p-82cd7bb6.entry.js} +1 -1
  218. package/dist/lime-elements/p-84a137a7.entry.js +1 -0
  219. package/dist/lime-elements/p-8715eac0.entry.js +1 -0
  220. package/dist/lime-elements/{p-8827628d.entry.js → p-8fb83e83.entry.js} +2 -2
  221. package/dist/lime-elements/p-90961075.entry.js +1 -0
  222. package/dist/lime-elements/p-945afca2.js +3 -0
  223. package/dist/lime-elements/p-9984b31c.entry.js +1 -0
  224. package/dist/lime-elements/p-9bd76629.entry.js +59 -0
  225. package/dist/lime-elements/p-9f19e0c1.entry.js +1 -0
  226. package/dist/lime-elements/p-ace4e596.entry.js +1 -0
  227. package/dist/lime-elements/p-cad7cda1.entry.js +16 -0
  228. package/dist/lime-elements/p-cfaa685f.entry.js +1 -0
  229. package/dist/lime-elements/{p-94899019.entry.js → p-d1187867.entry.js} +1 -1
  230. package/dist/lime-elements/{p-aa66620a.entry.js → p-d3ebc657.entry.js} +2 -2
  231. package/dist/lime-elements/p-d4e788e1.js +2 -0
  232. package/dist/lime-elements/p-d512656b.entry.js +1 -0
  233. package/dist/lime-elements/p-d8e5a9ee.entry.js +1 -0
  234. package/dist/lime-elements/p-dcd2a664.entry.js +16 -0
  235. package/dist/lime-elements/p-de161bb5.entry.js +1 -0
  236. package/dist/lime-elements/p-e4bca82b.entry.js +1 -0
  237. package/dist/lime-elements/p-e7bb664f.entry.js +1 -0
  238. package/dist/lime-elements/p-ef04b849.entry.js +82 -0
  239. package/dist/lime-elements/style/internal/codemirror-tooltip.scss +19 -0
  240. package/dist/lime-elements/style/internal/z-index.scss +0 -7
  241. package/dist/lime-elements/style/mixins.scss +11 -0
  242. package/dist/loader/package.json +1 -0
  243. package/dist/types/components/badge/badge.d.ts +12 -4
  244. package/dist/types/components/chip-set/chip-set.d.ts +3 -2
  245. package/dist/types/components/circular-progress/circular-progress.d.ts +5 -0
  246. package/dist/types/components/code-editor/code-editor.d.ts +14 -0
  247. package/dist/types/components/date-picker/date-picker.d.ts +4 -0
  248. package/dist/types/components/dock/dock-button/dock-button.d.ts +21 -5
  249. package/dist/types/components/dock/dock.d.ts +11 -3
  250. package/dist/types/components/input-field/input-field.d.ts +6 -0
  251. package/dist/types/components/menu/menu.d.ts +1 -2
  252. package/dist/types/components/menu-list/menu-list.d.ts +2 -7
  253. package/dist/types/components/picker/picker.d.ts +2 -2
  254. package/dist/types/components/shortcut/shortcut.d.ts +57 -0
  255. package/dist/types/components/split-button/split-button.d.ts +45 -0
  256. package/dist/types/components/tab-bar/tab.types.d.ts +1 -1
  257. package/dist/types/components/table/layout.d.ts +2 -0
  258. package/dist/types/components/table/table.d.ts +16 -1
  259. package/dist/types/components/table/table.types.d.ts +4 -0
  260. package/dist/types/components.d.ts +390 -80
  261. package/dist/types/stencil-public-runtime.d.ts +20 -4
  262. package/dist/types/translations/da.d.ts +1 -0
  263. package/dist/types/translations/en.d.ts +1 -0
  264. package/dist/types/translations/fi.d.ts +1 -0
  265. package/dist/types/translations/nl.d.ts +1 -0
  266. package/dist/types/translations/no.d.ts +1 -0
  267. package/dist/types/translations/sv.d.ts +1 -0
  268. package/package.json +27 -26
  269. package/dist/cjs/limel-menu.cjs.entry.js +0 -148
  270. package/dist/esm/limel-menu.entry.js +0 -144
  271. package/dist/lime-elements/p-009de50e.entry.js +0 -1
  272. package/dist/lime-elements/p-19f72dab.entry.js +0 -1
  273. package/dist/lime-elements/p-1a2ffe75.entry.js +0 -82
  274. package/dist/lime-elements/p-1dfccbc5.entry.js +0 -1
  275. package/dist/lime-elements/p-1e59114e.entry.js +0 -1
  276. package/dist/lime-elements/p-2639edf9.entry.js +0 -73
  277. package/dist/lime-elements/p-3af5f9ad.js +0 -3
  278. package/dist/lime-elements/p-3bf54a4c.js +0 -1
  279. package/dist/lime-elements/p-53e01330.entry.js +0 -1
  280. package/dist/lime-elements/p-5ad60e14.entry.js +0 -126
  281. package/dist/lime-elements/p-63e25a0a.entry.js +0 -1
  282. package/dist/lime-elements/p-64f068a8.entry.js +0 -1
  283. package/dist/lime-elements/p-6884b012.entry.js +0 -1
  284. package/dist/lime-elements/p-6966b5df.entry.js +0 -1
  285. package/dist/lime-elements/p-6b1bc80f.entry.js +0 -1
  286. package/dist/lime-elements/p-722d32e0.entry.js +0 -1
  287. package/dist/lime-elements/p-75152d89.entry.js +0 -1
  288. package/dist/lime-elements/p-7e571ec6.entry.js +0 -11
  289. package/dist/lime-elements/p-7ee4b825.entry.js +0 -1
  290. package/dist/lime-elements/p-93cd2268.entry.js +0 -1
  291. package/dist/lime-elements/p-95f275ab.entry.js +0 -1
  292. package/dist/lime-elements/p-97d6c4a6.entry.js +0 -1
  293. package/dist/lime-elements/p-995bbd2a.entry.js +0 -1
  294. package/dist/lime-elements/p-a465084b.entry.js +0 -82
  295. package/dist/lime-elements/p-af0ec482.entry.js +0 -16
  296. package/dist/lime-elements/p-b0046fcd.entry.js +0 -1
  297. package/dist/lime-elements/p-b95e80c9.entry.js +0 -1
  298. package/dist/lime-elements/p-bd098a11.entry.js +0 -1
  299. package/dist/lime-elements/p-d1ee4501.entry.js +0 -37
  300. package/dist/lime-elements/p-d74fa89e.entry.js +0 -1
  301. package/dist/lime-elements/p-e98d76e8.entry.js +0 -59
  302. package/dist/lime-elements/p-e9a95b8f.js +0 -1
  303. package/dist/lime-elements/p-f0c9dadd.entry.js +0 -1
  304. package/dist/lime-elements/p-f0e872b6.entry.js +0 -16
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-2a28697b.js');
5
+ const index = require('./index-287e25e0.js');
6
6
  const _commonjsHelpers = require('./_commonjsHelpers-0c557e26.js');
7
7
 
8
8
  var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports) {
9
9
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
10
- // Distributed under an MIT license: https://codemirror.net/LICENSE
10
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
11
11
 
12
- // This is CodeMirror (https://codemirror.net), a code editor
12
+ // This is CodeMirror (https://codemirror.net/5), a code editor
13
13
  // implemented in JavaScript on top of the browser's DOM.
14
14
  //
15
15
  // You can find some technical background for some of the code below
@@ -31,7 +31,8 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
31
31
  var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);
32
32
  var webkit = !edge && /WebKit\//.test(userAgent);
33
33
  var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
34
- var chrome = !edge && /Chrome\//.test(userAgent);
34
+ var chrome = !edge && /Chrome\/(\d+)/.exec(userAgent);
35
+ var chrome_version = chrome && +chrome[1];
35
36
  var presto = /Opera\//.test(userAgent);
36
37
  var safari = /Apple Computer/.test(navigator.vendor);
37
38
  var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
@@ -116,15 +117,15 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
116
117
  } while (child = child.parentNode)
117
118
  }
118
119
 
119
- function activeElt() {
120
+ function activeElt(doc) {
120
121
  // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
121
122
  // IE < 10 will throw when accessed while the page is loading or in an iframe.
122
123
  // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
123
124
  var activeElement;
124
125
  try {
125
- activeElement = document.activeElement;
126
+ activeElement = doc.activeElement;
126
127
  } catch(e) {
127
- activeElement = document.body || null;
128
+ activeElement = doc.body || null;
128
129
  }
129
130
  while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
130
131
  { activeElement = activeElement.shadowRoot.activeElement; }
@@ -148,6 +149,10 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
148
149
  else if (ie) // Suppress mysterious IE10 errors
149
150
  { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }
150
151
 
152
+ function doc(cm) { return cm.display.wrapper.ownerDocument }
153
+
154
+ function win(cm) { return doc(cm).defaultView }
155
+
151
156
  function bind(f) {
152
157
  var args = Array.prototype.slice.call(arguments, 1);
153
158
  return function(){return f.apply(null, args)}
@@ -2577,16 +2582,16 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
2577
2582
  cm.display.lineNumChars = null;
2578
2583
  }
2579
2584
 
2580
- function pageScrollX() {
2585
+ function pageScrollX(doc) {
2581
2586
  // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
2582
2587
  // which causes page_Offset and bounding client rects to use
2583
2588
  // different reference viewports and invalidate our calculations.
2584
- if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
2585
- return window.pageXOffset || (document.documentElement || document.body).scrollLeft
2589
+ if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }
2590
+ return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft
2586
2591
  }
2587
- function pageScrollY() {
2588
- if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
2589
- return window.pageYOffset || (document.documentElement || document.body).scrollTop
2592
+ function pageScrollY(doc) {
2593
+ if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }
2594
+ return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop
2590
2595
  }
2591
2596
 
2592
2597
  function widgetTopHeight(lineObj) {
@@ -2614,8 +2619,8 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
2614
2619
  else { yOff -= cm.display.viewOffset; }
2615
2620
  if (context == "page" || context == "window") {
2616
2621
  var lOff = cm.display.lineSpace.getBoundingClientRect();
2617
- yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
2618
- var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
2622
+ yOff += lOff.top + (context == "window" ? 0 : pageScrollY(doc(cm)));
2623
+ var xOff = lOff.left + (context == "window" ? 0 : pageScrollX(doc(cm)));
2619
2624
  rect.left += xOff; rect.right += xOff;
2620
2625
  }
2621
2626
  rect.top += yOff; rect.bottom += yOff;
@@ -2629,8 +2634,8 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
2629
2634
  var left = coords.left, top = coords.top;
2630
2635
  // First move into "page" coordinate system
2631
2636
  if (context == "page") {
2632
- left -= pageScrollX();
2633
- top -= pageScrollY();
2637
+ left -= pageScrollX(doc(cm));
2638
+ top -= pageScrollY(doc(cm));
2634
2639
  } else if (context == "local" || !context) {
2635
2640
  var localBox = cm.display.sizer.getBoundingClientRect();
2636
2641
  left += localBox.left;
@@ -3446,8 +3451,9 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
3446
3451
  if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
3447
3452
 
3448
3453
  var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
3454
+ var doc = display.wrapper.ownerDocument;
3449
3455
  if (rect.top + box.top < 0) { doScroll = true; }
3450
- else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }
3456
+ else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }
3451
3457
  if (doScroll != null && !phantom) {
3452
3458
  var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"));
3453
3459
  cm.display.lineSpace.appendChild(scrollNode);
@@ -3701,13 +3707,13 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
3701
3707
  NativeScrollbars.prototype.zeroWidthHack = function () {
3702
3708
  var w = mac && !mac_geMountainLion ? "12px" : "18px";
3703
3709
  this.horiz.style.height = this.vert.style.width = w;
3704
- this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";
3710
+ this.horiz.style.visibility = this.vert.style.visibility = "hidden";
3705
3711
  this.disableHoriz = new Delayed;
3706
3712
  this.disableVert = new Delayed;
3707
3713
  };
3708
3714
 
3709
3715
  NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
3710
- bar.style.pointerEvents = "auto";
3716
+ bar.style.visibility = "";
3711
3717
  function maybeDisable() {
3712
3718
  // To find out whether the scrollbar is still visible, we
3713
3719
  // check whether the element under the pixel in the bottom
@@ -3718,7 +3724,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
3718
3724
  var box = bar.getBoundingClientRect();
3719
3725
  var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
3720
3726
  : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);
3721
- if (elt != bar) { bar.style.pointerEvents = "none"; }
3727
+ if (elt != bar) { bar.style.visibility = "hidden"; }
3722
3728
  else { delay.set(1000, maybeDisable); }
3723
3729
  }
3724
3730
  delay.set(1000, maybeDisable);
@@ -3899,7 +3905,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
3899
3905
  cm.display.maxLineChanged = false;
3900
3906
  }
3901
3907
 
3902
- var takeFocus = op.focus && op.focus == activeElt();
3908
+ var takeFocus = op.focus && op.focus == activeElt(doc(cm));
3903
3909
  if (op.preparedSelection)
3904
3910
  { cm.display.input.showSelection(op.preparedSelection, takeFocus); }
3905
3911
  if (op.updatedDisplay || op.startHeight != cm.doc.height)
@@ -4076,11 +4082,11 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
4076
4082
 
4077
4083
  function selectionSnapshot(cm) {
4078
4084
  if (cm.hasFocus()) { return null }
4079
- var active = activeElt();
4085
+ var active = activeElt(doc(cm));
4080
4086
  if (!active || !contains(cm.display.lineDiv, active)) { return null }
4081
4087
  var result = {activeElt: active};
4082
4088
  if (window.getSelection) {
4083
- var sel = window.getSelection();
4089
+ var sel = win(cm).getSelection();
4084
4090
  if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
4085
4091
  result.anchorNode = sel.anchorNode;
4086
4092
  result.anchorOffset = sel.anchorOffset;
@@ -4092,11 +4098,12 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
4092
4098
  }
4093
4099
 
4094
4100
  function restoreSelection(snapshot) {
4095
- if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
4101
+ if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return }
4096
4102
  snapshot.activeElt.focus();
4097
4103
  if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&
4098
4104
  snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
4099
- var sel = window.getSelection(), range = document.createRange();
4105
+ var doc = snapshot.activeElt.ownerDocument;
4106
+ var sel = doc.defaultView.getSelection(), range = doc.createRange();
4100
4107
  range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
4101
4108
  range.collapse(false);
4102
4109
  sel.removeAllRanges();
@@ -4413,6 +4420,8 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
4413
4420
  d.scroller.setAttribute("tabIndex", "-1");
4414
4421
  // The element in which the editor lives.
4415
4422
  d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
4423
+ // See #6982. FIXME remove when this has been fixed for a while in Chrome
4424
+ if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = "inset(0px)"; }
4416
4425
 
4417
4426
  // This attribute is respected by automatic translation systems such as Google Translate,
4418
4427
  // and may also be respected by tools used by human translators.
@@ -4514,6 +4523,17 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
4514
4523
  }
4515
4524
 
4516
4525
  function onScrollWheel(cm, e) {
4526
+ // On Chrome 102, viewport updates somehow stop wheel-based
4527
+ // scrolling. Turning off pointer events during the scroll seems
4528
+ // to avoid the issue.
4529
+ if (chrome && chrome_version == 102) {
4530
+ if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = "none"; }
4531
+ else { clearTimeout(cm.display.chromeScrollHack); }
4532
+ cm.display.chromeScrollHack = setTimeout(function () {
4533
+ cm.display.chromeScrollHack = null;
4534
+ cm.display.sizer.style.pointerEvents = "";
4535
+ }, 100);
4536
+ }
4517
4537
  var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
4518
4538
  var pixelsPerUnit = wheelPixelsPerUnit;
4519
4539
  if (e.deltaMode === 0) {
@@ -5197,7 +5217,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
5197
5217
  var range = sel.ranges[i];
5198
5218
  var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
5199
5219
  var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
5200
- var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
5220
+ var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);
5201
5221
  if (out || newAnchor != range.anchor || newHead != range.head) {
5202
5222
  if (!out) { out = sel.ranges.slice(0, i); }
5203
5223
  out[i] = new Range(newAnchor, newHead);
@@ -7249,7 +7269,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7249
7269
  function onKeyDown(e) {
7250
7270
  var cm = this;
7251
7271
  if (e.target && e.target != cm.display.input.getField()) { return }
7252
- cm.curOp.focus = activeElt();
7272
+ cm.curOp.focus = activeElt(doc(cm));
7253
7273
  if (signalDOMEvent(cm, e)) { return }
7254
7274
  // IE does strange things with escape.
7255
7275
  if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }
@@ -7356,7 +7376,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7356
7376
  }
7357
7377
  if (clickInGutter(cm, e)) { return }
7358
7378
  var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single";
7359
- window.focus();
7379
+ win(cm).focus();
7360
7380
 
7361
7381
  // #3261: make sure, that we're not starting a second selection
7362
7382
  if (button == 1 && cm.state.selectingText)
@@ -7411,7 +7431,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7411
7431
 
7412
7432
  function leftButtonDown(cm, pos, repeat, event) {
7413
7433
  if (ie) { setTimeout(bind(ensureFocus, cm), 0); }
7414
- else { cm.curOp.focus = activeElt(); }
7434
+ else { cm.curOp.focus = activeElt(doc(cm)); }
7415
7435
 
7416
7436
  var behavior = configureMouse(cm, repeat, event);
7417
7437
 
@@ -7481,19 +7501,19 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7481
7501
  // Normal selection, as opposed to text dragging.
7482
7502
  function leftButtonSelect(cm, event, start, behavior) {
7483
7503
  if (ie) { delayBlurEvent(cm); }
7484
- var display = cm.display, doc = cm.doc;
7504
+ var display = cm.display, doc$1 = cm.doc;
7485
7505
  e_preventDefault(event);
7486
7506
 
7487
- var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
7507
+ var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges;
7488
7508
  if (behavior.addNew && !behavior.extend) {
7489
- ourIndex = doc.sel.contains(start);
7509
+ ourIndex = doc$1.sel.contains(start);
7490
7510
  if (ourIndex > -1)
7491
7511
  { ourRange = ranges[ourIndex]; }
7492
7512
  else
7493
7513
  { ourRange = new Range(start, start); }
7494
7514
  } else {
7495
- ourRange = doc.sel.primary();
7496
- ourIndex = doc.sel.primIndex;
7515
+ ourRange = doc$1.sel.primary();
7516
+ ourIndex = doc$1.sel.primIndex;
7497
7517
  }
7498
7518
 
7499
7519
  if (behavior.unit == "rectangle") {
@@ -7510,18 +7530,18 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7510
7530
 
7511
7531
  if (!behavior.addNew) {
7512
7532
  ourIndex = 0;
7513
- setSelection(doc, new Selection([ourRange], 0), sel_mouse);
7514
- startSel = doc.sel;
7533
+ setSelection(doc$1, new Selection([ourRange], 0), sel_mouse);
7534
+ startSel = doc$1.sel;
7515
7535
  } else if (ourIndex == -1) {
7516
7536
  ourIndex = ranges.length;
7517
- setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
7537
+ setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
7518
7538
  {scroll: false, origin: "*mouse"});
7519
7539
  } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
7520
- setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
7540
+ setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
7521
7541
  {scroll: false, origin: "*mouse"});
7522
- startSel = doc.sel;
7542
+ startSel = doc$1.sel;
7523
7543
  } else {
7524
- replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
7544
+ replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse);
7525
7545
  }
7526
7546
 
7527
7547
  var lastPos = start;
@@ -7531,19 +7551,19 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7531
7551
 
7532
7552
  if (behavior.unit == "rectangle") {
7533
7553
  var ranges = [], tabSize = cm.options.tabSize;
7534
- var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
7535
- var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
7554
+ var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize);
7555
+ var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize);
7536
7556
  var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);
7537
7557
  for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
7538
7558
  line <= end; line++) {
7539
- var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);
7559
+ var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize);
7540
7560
  if (left == right)
7541
7561
  { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }
7542
7562
  else if (text.length > leftPos)
7543
7563
  { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }
7544
7564
  }
7545
7565
  if (!ranges.length) { ranges.push(new Range(start, start)); }
7546
- setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
7566
+ setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
7547
7567
  {origin: "*mouse", scroll: false});
7548
7568
  cm.scrollIntoView(pos);
7549
7569
  } else {
@@ -7558,8 +7578,8 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7558
7578
  anchor = maxPos(oldRange.to(), range.head);
7559
7579
  }
7560
7580
  var ranges$1 = startSel.ranges.slice(0);
7561
- ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));
7562
- setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
7581
+ ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head));
7582
+ setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
7563
7583
  }
7564
7584
  }
7565
7585
 
@@ -7575,9 +7595,9 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7575
7595
  var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle");
7576
7596
  if (!cur) { return }
7577
7597
  if (cmp(cur, lastPos) != 0) {
7578
- cm.curOp.focus = activeElt();
7598
+ cm.curOp.focus = activeElt(doc(cm));
7579
7599
  extendTo(cur);
7580
- var visible = visibleLines(display, doc);
7600
+ var visible = visibleLines(display, doc$1);
7581
7601
  if (cur.line >= visible.to || cur.line < visible.from)
7582
7602
  { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }
7583
7603
  } else {
@@ -7602,7 +7622,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7602
7622
  }
7603
7623
  off(display.wrapper.ownerDocument, "mousemove", move);
7604
7624
  off(display.wrapper.ownerDocument, "mouseup", up);
7605
- doc.history.lastSelOrigin = null;
7625
+ doc$1.history.lastSelOrigin = null;
7606
7626
  }
7607
7627
 
7608
7628
  var move = operation(cm, function (e) {
@@ -7759,7 +7779,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
7759
7779
  for (var i = newBreaks.length - 1; i >= 0; i--)
7760
7780
  { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
7761
7781
  });
7762
- option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
7782
+ option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
7763
7783
  cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
7764
7784
  if (old != Init) { cm.refresh(); }
7765
7785
  });
@@ -8202,7 +8222,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
8202
8222
  var pasted = e.clipboardData && e.clipboardData.getData("Text");
8203
8223
  if (pasted) {
8204
8224
  e.preventDefault();
8205
- if (!cm.isReadOnly() && !cm.options.disableInput)
8225
+ if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())
8206
8226
  { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); }
8207
8227
  return true
8208
8228
  }
@@ -8279,7 +8299,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
8279
8299
 
8280
8300
  CodeMirror.prototype = {
8281
8301
  constructor: CodeMirror,
8282
- focus: function(){window.focus(); this.display.input.focus();},
8302
+ focus: function(){win(this).focus(); this.display.input.focus();},
8283
8303
 
8284
8304
  setOption: function(option, value) {
8285
8305
  var options = this.options, old = options[option];
@@ -8603,7 +8623,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
8603
8623
 
8604
8624
  signal(this, "overwriteToggle", this, this.state.overwrite);
8605
8625
  },
8606
- hasFocus: function() { return this.display.input.getField() == activeElt() },
8626
+ hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },
8607
8627
  isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
8608
8628
 
8609
8629
  scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),
@@ -8784,7 +8804,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
8784
8804
  function findPosV(cm, pos, dir, unit) {
8785
8805
  var doc = cm.doc, x = pos.left, y;
8786
8806
  if (unit == "page") {
8787
- var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
8807
+ var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);
8788
8808
  var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);
8789
8809
  y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;
8790
8810
 
@@ -8884,7 +8904,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
8884
8904
  var kludge = hiddenTextarea(), te = kludge.firstChild;
8885
8905
  cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
8886
8906
  te.value = lastCopied.text.join("\n");
8887
- var hadFocus = activeElt();
8907
+ var hadFocus = activeElt(div.ownerDocument);
8888
8908
  selectInput(te);
8889
8909
  setTimeout(function () {
8890
8910
  cm.display.lineSpace.removeChild(kludge);
@@ -8907,7 +8927,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
8907
8927
 
8908
8928
  ContentEditableInput.prototype.prepareSelection = function () {
8909
8929
  var result = prepareSelection(this.cm, false);
8910
- result.focus = activeElt() == this.div;
8930
+ result.focus = activeElt(this.div.ownerDocument) == this.div;
8911
8931
  return result
8912
8932
  };
8913
8933
 
@@ -9003,7 +9023,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9003
9023
 
9004
9024
  ContentEditableInput.prototype.focus = function () {
9005
9025
  if (this.cm.options.readOnly != "nocursor") {
9006
- if (!this.selectionInEditor() || activeElt() != this.div)
9026
+ if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div)
9007
9027
  { this.showSelection(this.prepareSelection(), true); }
9008
9028
  this.div.focus();
9009
9029
  }
@@ -9355,6 +9375,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9355
9375
  // Used to work around IE issue with selection being forgotten when focus moves away from textarea
9356
9376
  this.hasSelection = false;
9357
9377
  this.composing = null;
9378
+ this.resetting = false;
9358
9379
  };
9359
9380
 
9360
9381
  TextareaInput.prototype.init = function (display) {
@@ -9487,8 +9508,9 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9487
9508
  // Reset the input to correspond to the selection (or to be empty,
9488
9509
  // when not typing and nothing is selected)
9489
9510
  TextareaInput.prototype.reset = function (typing) {
9490
- if (this.contextMenuPending || this.composing) { return }
9511
+ if (this.contextMenuPending || this.composing && typing) { return }
9491
9512
  var cm = this.cm;
9513
+ this.resetting = true;
9492
9514
  if (cm.somethingSelected()) {
9493
9515
  this.prevInput = "";
9494
9516
  var content = cm.getSelection();
@@ -9499,6 +9521,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9499
9521
  this.prevInput = this.textarea.value = "";
9500
9522
  if (ie && ie_version >= 9) { this.hasSelection = null; }
9501
9523
  }
9524
+ this.resetting = false;
9502
9525
  };
9503
9526
 
9504
9527
  TextareaInput.prototype.getField = function () { return this.textarea };
@@ -9506,7 +9529,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9506
9529
  TextareaInput.prototype.supportsTouch = function () { return false };
9507
9530
 
9508
9531
  TextareaInput.prototype.focus = function () {
9509
- if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
9532
+ if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) {
9510
9533
  try { this.textarea.focus(); }
9511
9534
  catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
9512
9535
  }
@@ -9560,7 +9583,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9560
9583
  // possible when it is clear that nothing happened. hasSelection
9561
9584
  // will be the case when there is a lot of text in the textarea,
9562
9585
  // in which case reading its value would be expensive.
9563
- if (this.contextMenuPending || !cm.state.focused ||
9586
+ if (this.contextMenuPending || this.resetting || !cm.state.focused ||
9564
9587
  (hasSelection(input) && !prevInput && !this.composing) ||
9565
9588
  cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
9566
9589
  { return false }
@@ -9629,9 +9652,9 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9629
9652
  input.wrapper.style.cssText = "position: static";
9630
9653
  te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
9631
9654
  var oldScrollY;
9632
- if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)
9655
+ if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)
9633
9656
  display.input.focus();
9634
- if (webkit) { window.scrollTo(null, oldScrollY); }
9657
+ if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }
9635
9658
  display.input.reset();
9636
9659
  // Adds "Select all" to context menu in FF
9637
9660
  if (!cm.somethingSelected()) { te.value = input.prevInput = " "; }
@@ -9713,7 +9736,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9713
9736
  // Set autofocus to true if this textarea is focused, or if it has
9714
9737
  // autofocus and no other element is focused.
9715
9738
  if (options.autofocus == null) {
9716
- var hasFocus = activeElt();
9739
+ var hasFocus = activeElt(textarea.ownerDocument);
9717
9740
  options.autofocus = hasFocus == textarea ||
9718
9741
  textarea.getAttribute("autofocus") != null && hasFocus == document.body;
9719
9742
  }
@@ -9847,7 +9870,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9847
9870
 
9848
9871
  addLegacyProps(CodeMirror);
9849
9872
 
9850
- CodeMirror.version = "5.65.3";
9873
+ CodeMirror.version = "5.65.9";
9851
9874
 
9852
9875
  return CodeMirror;
9853
9876
 
@@ -9856,7 +9879,7 @@ var codemirror = _commonjsHelpers.createCommonjsModule(function (module, exports
9856
9879
 
9857
9880
  _commonjsHelpers.createCommonjsModule(function (module, exports) {
9858
9881
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
9859
- // Distributed under an MIT license: https://codemirror.net/LICENSE
9882
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
9860
9883
 
9861
9884
  (function(mod) {
9862
9885
  mod(codemirror);
@@ -10812,7 +10835,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript
10812
10835
 
10813
10836
  _commonjsHelpers.createCommonjsModule(function (module, exports) {
10814
10837
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
10815
- // Distributed under an MIT license: https://codemirror.net/LICENSE
10838
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
10816
10839
 
10817
10840
  (function(mod) {
10818
10841
  mod(codemirror);
@@ -10881,7 +10904,7 @@ _commonjsHelpers.createCommonjsModule(function (module, exports) {
10881
10904
 
10882
10905
  _commonjsHelpers.createCommonjsModule(function (module, exports) {
10883
10906
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
10884
- // Distributed under an MIT license: https://codemirror.net/LICENSE
10907
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
10885
10908
 
10886
10909
  (function(mod) {
10887
10910
  mod(codemirror);
@@ -11037,28 +11060,1567 @@ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11037
11060
  });
11038
11061
  });
11039
11062
 
11040
- const codeEditorCss = ".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}:host{display:flex;font-size:1rem}.editor{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}.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}";
11063
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11064
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11065
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
11066
+
11067
+ (function(mod) {
11068
+ mod(codemirror);
11069
+ })(function(CodeMirror) {
11070
+ var GUTTER_ID = "CodeMirror-lint-markers";
11071
+ var LINT_LINE_ID = "CodeMirror-lint-line-";
11072
+
11073
+ function showTooltip(cm, e, content) {
11074
+ var tt = document.createElement("div");
11075
+ tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme;
11076
+ tt.appendChild(content.cloneNode(true));
11077
+ if (cm.state.lint.options.selfContain)
11078
+ cm.getWrapperElement().appendChild(tt);
11079
+ else
11080
+ document.body.appendChild(tt);
11081
+
11082
+ function position(e) {
11083
+ if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
11084
+ tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
11085
+ tt.style.left = (e.clientX + 5) + "px";
11086
+ }
11087
+ CodeMirror.on(document, "mousemove", position);
11088
+ position(e);
11089
+ if (tt.style.opacity != null) tt.style.opacity = 1;
11090
+ return tt;
11091
+ }
11092
+ function rm(elt) {
11093
+ if (elt.parentNode) elt.parentNode.removeChild(elt);
11094
+ }
11095
+ function hideTooltip(tt) {
11096
+ if (!tt.parentNode) return;
11097
+ if (tt.style.opacity == null) rm(tt);
11098
+ tt.style.opacity = 0;
11099
+ setTimeout(function() { rm(tt); }, 600);
11100
+ }
11101
+
11102
+ function showTooltipFor(cm, e, content, node) {
11103
+ var tooltip = showTooltip(cm, e, content);
11104
+ function hide() {
11105
+ CodeMirror.off(node, "mouseout", hide);
11106
+ if (tooltip) { hideTooltip(tooltip); tooltip = null; }
11107
+ }
11108
+ var poll = setInterval(function() {
11109
+ if (tooltip) for (var n = node;; n = n.parentNode) {
11110
+ if (n && n.nodeType == 11) n = n.host;
11111
+ if (n == document.body) return;
11112
+ if (!n) { hide(); break; }
11113
+ }
11114
+ if (!tooltip) return clearInterval(poll);
11115
+ }, 400);
11116
+ CodeMirror.on(node, "mouseout", hide);
11117
+ }
11118
+
11119
+ function LintState(cm, conf, hasGutter) {
11120
+ this.marked = [];
11121
+ if (conf instanceof Function) conf = {getAnnotations: conf};
11122
+ if (!conf || conf === true) conf = {};
11123
+ this.options = {};
11124
+ this.linterOptions = conf.options || {};
11125
+ for (var prop in defaults) this.options[prop] = defaults[prop];
11126
+ for (var prop in conf) {
11127
+ if (defaults.hasOwnProperty(prop)) {
11128
+ if (conf[prop] != null) this.options[prop] = conf[prop];
11129
+ } else if (!conf.options) {
11130
+ this.linterOptions[prop] = conf[prop];
11131
+ }
11132
+ }
11133
+ this.timeout = null;
11134
+ this.hasGutter = hasGutter;
11135
+ this.onMouseOver = function(e) { onMouseOver(cm, e); };
11136
+ this.waitingFor = 0;
11137
+ }
11138
+
11139
+ var defaults = {
11140
+ highlightLines: false,
11141
+ tooltips: true,
11142
+ delay: 500,
11143
+ lintOnChange: true,
11144
+ getAnnotations: null,
11145
+ async: false,
11146
+ selfContain: null,
11147
+ formatAnnotation: null,
11148
+ onUpdateLinting: null
11149
+ };
11150
+
11151
+ function clearMarks(cm) {
11152
+ var state = cm.state.lint;
11153
+ if (state.hasGutter) cm.clearGutter(GUTTER_ID);
11154
+ if (state.options.highlightLines) clearErrorLines(cm);
11155
+ for (var i = 0; i < state.marked.length; ++i)
11156
+ state.marked[i].clear();
11157
+ state.marked.length = 0;
11158
+ }
11159
+
11160
+ function clearErrorLines(cm) {
11161
+ cm.eachLine(function(line) {
11162
+ var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass);
11163
+ if (has) cm.removeLineClass(line, "wrap", has[0]);
11164
+ });
11165
+ }
11166
+
11167
+ function makeMarker(cm, labels, severity, multiple, tooltips) {
11168
+ var marker = document.createElement("div"), inner = marker;
11169
+ marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity;
11170
+ if (multiple) {
11171
+ inner = marker.appendChild(document.createElement("div"));
11172
+ inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple";
11173
+ }
11174
+
11175
+ if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
11176
+ showTooltipFor(cm, e, labels, inner);
11177
+ });
11178
+
11179
+ return marker;
11180
+ }
11181
+
11182
+ function getMaxSeverity(a, b) {
11183
+ if (a == "error") return a;
11184
+ else return b;
11185
+ }
11186
+
11187
+ function groupByLine(annotations) {
11188
+ var lines = [];
11189
+ for (var i = 0; i < annotations.length; ++i) {
11190
+ var ann = annotations[i], line = ann.from.line;
11191
+ (lines[line] || (lines[line] = [])).push(ann);
11192
+ }
11193
+ return lines;
11194
+ }
11195
+
11196
+ function annotationTooltip(ann) {
11197
+ var severity = ann.severity;
11198
+ if (!severity) severity = "error";
11199
+ var tip = document.createElement("div");
11200
+ tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity;
11201
+ if (typeof ann.messageHTML != 'undefined') {
11202
+ tip.innerHTML = ann.messageHTML;
11203
+ } else {
11204
+ tip.appendChild(document.createTextNode(ann.message));
11205
+ }
11206
+ return tip;
11207
+ }
11208
+
11209
+ function lintAsync(cm, getAnnotations) {
11210
+ var state = cm.state.lint;
11211
+ var id = ++state.waitingFor;
11212
+ function abort() {
11213
+ id = -1;
11214
+ cm.off("change", abort);
11215
+ }
11216
+ cm.on("change", abort);
11217
+ getAnnotations(cm.getValue(), function(annotations, arg2) {
11218
+ cm.off("change", abort);
11219
+ if (state.waitingFor != id) return
11220
+ if (arg2 && annotations instanceof CodeMirror) annotations = arg2;
11221
+ cm.operation(function() {updateLinting(cm, annotations);});
11222
+ }, state.linterOptions, cm);
11223
+ }
11224
+
11225
+ function startLinting(cm) {
11226
+ var state = cm.state.lint;
11227
+ if (!state) return;
11228
+ var options = state.options;
11229
+ /*
11230
+ * Passing rules in `options` property prevents JSHint (and other linters) from complaining
11231
+ * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc.
11232
+ */
11233
+ var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
11234
+ if (!getAnnotations) return;
11235
+ if (options.async || getAnnotations.async) {
11236
+ lintAsync(cm, getAnnotations);
11237
+ } else {
11238
+ var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm);
11239
+ if (!annotations) return;
11240
+ if (annotations.then) annotations.then(function(issues) {
11241
+ cm.operation(function() {updateLinting(cm, issues);});
11242
+ });
11243
+ else cm.operation(function() {updateLinting(cm, annotations);});
11244
+ }
11245
+ }
11246
+
11247
+ function updateLinting(cm, annotationsNotSorted) {
11248
+ var state = cm.state.lint;
11249
+ if (!state) return;
11250
+ var options = state.options;
11251
+ clearMarks(cm);
11252
+
11253
+ var annotations = groupByLine(annotationsNotSorted);
11254
+
11255
+ for (var line = 0; line < annotations.length; ++line) {
11256
+ var anns = annotations[line];
11257
+ if (!anns) continue;
11258
+
11259
+ // filter out duplicate messages
11260
+ var message = [];
11261
+ anns = anns.filter(function(item) { return message.indexOf(item.message) > -1 ? false : message.push(item.message) });
11262
+
11263
+ var maxSeverity = null;
11264
+ var tipLabel = state.hasGutter && document.createDocumentFragment();
11265
+
11266
+ for (var i = 0; i < anns.length; ++i) {
11267
+ var ann = anns[i];
11268
+ var severity = ann.severity;
11269
+ if (!severity) severity = "error";
11270
+ maxSeverity = getMaxSeverity(maxSeverity, severity);
11271
+
11272
+ if (options.formatAnnotation) ann = options.formatAnnotation(ann);
11273
+ if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
11274
+
11275
+ if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
11276
+ className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity,
11277
+ __annotation: ann
11278
+ }));
11279
+ }
11280
+ // use original annotations[line] to show multiple messages
11281
+ if (state.hasGutter)
11282
+ cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1,
11283
+ options.tooltips));
11284
+
11285
+ if (options.highlightLines)
11286
+ cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity);
11287
+ }
11288
+ if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
11289
+ }
11290
+
11291
+ function onChange(cm) {
11292
+ var state = cm.state.lint;
11293
+ if (!state) return;
11294
+ clearTimeout(state.timeout);
11295
+ state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay);
11296
+ }
11297
+
11298
+ function popupTooltips(cm, annotations, e) {
11299
+ var target = e.target || e.srcElement;
11300
+ var tooltip = document.createDocumentFragment();
11301
+ for (var i = 0; i < annotations.length; i++) {
11302
+ var ann = annotations[i];
11303
+ tooltip.appendChild(annotationTooltip(ann));
11304
+ }
11305
+ showTooltipFor(cm, e, tooltip, target);
11306
+ }
11307
+
11308
+ function onMouseOver(cm, e) {
11309
+ var target = e.target || e.srcElement;
11310
+ if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
11311
+ var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
11312
+ var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
11313
+
11314
+ var annotations = [];
11315
+ for (var i = 0; i < spans.length; ++i) {
11316
+ var ann = spans[i].__annotation;
11317
+ if (ann) annotations.push(ann);
11318
+ }
11319
+ if (annotations.length) popupTooltips(cm, annotations, e);
11320
+ }
11321
+
11322
+ CodeMirror.defineOption("lint", false, function(cm, val, old) {
11323
+ if (old && old != CodeMirror.Init) {
11324
+ clearMarks(cm);
11325
+ if (cm.state.lint.options.lintOnChange !== false)
11326
+ cm.off("change", onChange);
11327
+ CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
11328
+ clearTimeout(cm.state.lint.timeout);
11329
+ delete cm.state.lint;
11330
+ }
11331
+
11332
+ if (val) {
11333
+ var gutters = cm.getOption("gutters"), hasLintGutter = false;
11334
+ for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
11335
+ var state = cm.state.lint = new LintState(cm, val, hasLintGutter);
11336
+ if (state.options.lintOnChange)
11337
+ cm.on("change", onChange);
11338
+ if (state.options.tooltips != false && state.options.tooltips != "gutter")
11339
+ CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
11340
+
11341
+ startLinting(cm);
11342
+ }
11343
+ });
11344
+
11345
+ CodeMirror.defineExtension("performLint", function() {
11346
+ startLinting(this);
11347
+ });
11348
+ });
11349
+ });
11350
+
11351
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11352
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11353
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
11354
+
11355
+ // Depends on jsonlint.js from https://github.com/zaach/jsonlint
11356
+
11357
+ // declare global: jsonlint
11358
+
11359
+ (function(mod) {
11360
+ mod(codemirror);
11361
+ })(function(CodeMirror) {
11362
+
11363
+ CodeMirror.registerHelper("lint", "json", function(text) {
11364
+ var found = [];
11365
+ if (!window.jsonlint) {
11366
+ if (window.console) {
11367
+ window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.");
11368
+ }
11369
+ return found;
11370
+ }
11371
+ // for jsonlint's web dist jsonlint is exported as an object with a single property parser, of which parseError
11372
+ // is a subproperty
11373
+ var jsonlint = window.jsonlint.parser || window.jsonlint;
11374
+ jsonlint.parseError = function(str, hash) {
11375
+ var loc = hash.loc;
11376
+ found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
11377
+ to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
11378
+ message: str});
11379
+ };
11380
+ try { jsonlint.parse(text); }
11381
+ catch(e) {}
11382
+ return found;
11383
+ });
11384
+
11385
+ });
11386
+ });
11387
+
11388
+ var foldcode = _commonjsHelpers.createCommonjsModule(function (module, exports) {
11389
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11390
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
11391
+
11392
+ (function(mod) {
11393
+ mod(codemirror);
11394
+ })(function(CodeMirror) {
11395
+
11396
+ function doFold(cm, pos, options, force) {
11397
+ if (options && options.call) {
11398
+ var finder = options;
11399
+ options = null;
11400
+ } else {
11401
+ var finder = getOption(cm, options, "rangeFinder");
11402
+ }
11403
+ if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
11404
+ var minSize = getOption(cm, options, "minFoldSize");
11405
+
11406
+ function getRange(allowFolded) {
11407
+ var range = finder(cm, pos);
11408
+ if (!range || range.to.line - range.from.line < minSize) return null;
11409
+ if (force === "fold") return range;
11410
+
11411
+ var marks = cm.findMarksAt(range.from);
11412
+ for (var i = 0; i < marks.length; ++i) {
11413
+ if (marks[i].__isFold) {
11414
+ if (!allowFolded) return null;
11415
+ range.cleared = true;
11416
+ marks[i].clear();
11417
+ }
11418
+ }
11419
+ return range;
11420
+ }
11421
+
11422
+ var range = getRange(true);
11423
+ if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) {
11424
+ pos = CodeMirror.Pos(pos.line - 1, 0);
11425
+ range = getRange(false);
11426
+ }
11427
+ if (!range || range.cleared || force === "unfold") return;
11428
+
11429
+ var myWidget = makeWidget(cm, options, range);
11430
+ CodeMirror.on(myWidget, "mousedown", function(e) {
11431
+ myRange.clear();
11432
+ CodeMirror.e_preventDefault(e);
11433
+ });
11434
+ var myRange = cm.markText(range.from, range.to, {
11435
+ replacedWith: myWidget,
11436
+ clearOnEnter: getOption(cm, options, "clearOnEnter"),
11437
+ __isFold: true
11438
+ });
11439
+ myRange.on("clear", function(from, to) {
11440
+ CodeMirror.signal(cm, "unfold", cm, from, to);
11441
+ });
11442
+ CodeMirror.signal(cm, "fold", cm, range.from, range.to);
11443
+ }
11444
+
11445
+ function makeWidget(cm, options, range) {
11446
+ var widget = getOption(cm, options, "widget");
11447
+
11448
+ if (typeof widget == "function") {
11449
+ widget = widget(range.from, range.to);
11450
+ }
11451
+
11452
+ if (typeof widget == "string") {
11453
+ var text = document.createTextNode(widget);
11454
+ widget = document.createElement("span");
11455
+ widget.appendChild(text);
11456
+ widget.className = "CodeMirror-foldmarker";
11457
+ } else if (widget) {
11458
+ widget = widget.cloneNode(true);
11459
+ }
11460
+ return widget;
11461
+ }
11462
+
11463
+ // Clumsy backwards-compatible interface
11464
+ CodeMirror.newFoldFunction = function(rangeFinder, widget) {
11465
+ return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
11466
+ };
11467
+
11468
+ // New-style interface
11469
+ CodeMirror.defineExtension("foldCode", function(pos, options, force) {
11470
+ doFold(this, pos, options, force);
11471
+ });
11472
+
11473
+ CodeMirror.defineExtension("isFolded", function(pos) {
11474
+ var marks = this.findMarksAt(pos);
11475
+ for (var i = 0; i < marks.length; ++i)
11476
+ if (marks[i].__isFold) return true;
11477
+ });
11478
+
11479
+ CodeMirror.commands.toggleFold = function(cm) {
11480
+ cm.foldCode(cm.getCursor());
11481
+ };
11482
+ CodeMirror.commands.fold = function(cm) {
11483
+ cm.foldCode(cm.getCursor(), null, "fold");
11484
+ };
11485
+ CodeMirror.commands.unfold = function(cm) {
11486
+ cm.foldCode(cm.getCursor(), { scanUp: false }, "unfold");
11487
+ };
11488
+ CodeMirror.commands.foldAll = function(cm) {
11489
+ cm.operation(function() {
11490
+ for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
11491
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "fold");
11492
+ });
11493
+ };
11494
+ CodeMirror.commands.unfoldAll = function(cm) {
11495
+ cm.operation(function() {
11496
+ for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
11497
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "unfold");
11498
+ });
11499
+ };
11500
+
11501
+ CodeMirror.registerHelper("fold", "combine", function() {
11502
+ var funcs = Array.prototype.slice.call(arguments, 0);
11503
+ return function(cm, start) {
11504
+ for (var i = 0; i < funcs.length; ++i) {
11505
+ var found = funcs[i](cm, start);
11506
+ if (found) return found;
11507
+ }
11508
+ };
11509
+ });
11510
+
11511
+ CodeMirror.registerHelper("fold", "auto", function(cm, start) {
11512
+ var helpers = cm.getHelpers(start, "fold");
11513
+ for (var i = 0; i < helpers.length; i++) {
11514
+ var cur = helpers[i](cm, start);
11515
+ if (cur) return cur;
11516
+ }
11517
+ });
11518
+
11519
+ var defaultOptions = {
11520
+ rangeFinder: CodeMirror.fold.auto,
11521
+ widget: "\u2194",
11522
+ minFoldSize: 0,
11523
+ scanUp: false,
11524
+ clearOnEnter: true
11525
+ };
11526
+
11527
+ CodeMirror.defineOption("foldOptions", null);
11528
+
11529
+ function getOption(cm, options, name) {
11530
+ if (options && options[name] !== undefined)
11531
+ return options[name];
11532
+ var editorOptions = cm.options.foldOptions;
11533
+ if (editorOptions && editorOptions[name] !== undefined)
11534
+ return editorOptions[name];
11535
+ return defaultOptions[name];
11536
+ }
11537
+
11538
+ CodeMirror.defineExtension("foldOption", function(options, name) {
11539
+ return getOption(this, options, name);
11540
+ });
11541
+ });
11542
+ });
11543
+
11544
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11545
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11546
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
11547
+
11548
+ (function(mod) {
11549
+ mod(codemirror, foldcode);
11550
+ })(function(CodeMirror) {
11551
+
11552
+ CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
11553
+ if (old && old != CodeMirror.Init) {
11554
+ cm.clearGutter(cm.state.foldGutter.options.gutter);
11555
+ cm.state.foldGutter = null;
11556
+ cm.off("gutterClick", onGutterClick);
11557
+ cm.off("changes", onChange);
11558
+ cm.off("viewportChange", onViewportChange);
11559
+ cm.off("fold", onFold);
11560
+ cm.off("unfold", onFold);
11561
+ cm.off("swapDoc", onChange);
11562
+ cm.off("optionChange", optionChange);
11563
+ }
11564
+ if (val) {
11565
+ cm.state.foldGutter = new State(parseOptions(val));
11566
+ updateInViewport(cm);
11567
+ cm.on("gutterClick", onGutterClick);
11568
+ cm.on("changes", onChange);
11569
+ cm.on("viewportChange", onViewportChange);
11570
+ cm.on("fold", onFold);
11571
+ cm.on("unfold", onFold);
11572
+ cm.on("swapDoc", onChange);
11573
+ cm.on("optionChange", optionChange);
11574
+ }
11575
+ });
11576
+
11577
+ var Pos = CodeMirror.Pos;
11578
+
11579
+ function State(options) {
11580
+ this.options = options;
11581
+ this.from = this.to = 0;
11582
+ }
11583
+
11584
+ function parseOptions(opts) {
11585
+ if (opts === true) opts = {};
11586
+ if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
11587
+ if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
11588
+ if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
11589
+ return opts;
11590
+ }
11591
+
11592
+ function isFolded(cm, line) {
11593
+ var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
11594
+ for (var i = 0; i < marks.length; ++i) {
11595
+ if (marks[i].__isFold) {
11596
+ var fromPos = marks[i].find(-1);
11597
+ if (fromPos && fromPos.line === line)
11598
+ return marks[i];
11599
+ }
11600
+ }
11601
+ }
11602
+
11603
+ function marker(spec) {
11604
+ if (typeof spec == "string") {
11605
+ var elt = document.createElement("div");
11606
+ elt.className = spec + " CodeMirror-guttermarker-subtle";
11607
+ return elt;
11608
+ } else {
11609
+ return spec.cloneNode(true);
11610
+ }
11611
+ }
11612
+
11613
+ function updateFoldInfo(cm, from, to) {
11614
+ var opts = cm.state.foldGutter.options, cur = from - 1;
11615
+ var minSize = cm.foldOption(opts, "minFoldSize");
11616
+ var func = cm.foldOption(opts, "rangeFinder");
11617
+ // we can reuse the built-in indicator element if its className matches the new state
11618
+ var clsFolded = typeof opts.indicatorFolded == "string" && classTest(opts.indicatorFolded);
11619
+ var clsOpen = typeof opts.indicatorOpen == "string" && classTest(opts.indicatorOpen);
11620
+ cm.eachLine(from, to, function(line) {
11621
+ ++cur;
11622
+ var mark = null;
11623
+ var old = line.gutterMarkers;
11624
+ if (old) old = old[opts.gutter];
11625
+ if (isFolded(cm, cur)) {
11626
+ if (clsFolded && old && clsFolded.test(old.className)) return;
11627
+ mark = marker(opts.indicatorFolded);
11628
+ } else {
11629
+ var pos = Pos(cur, 0);
11630
+ var range = func && func(cm, pos);
11631
+ if (range && range.to.line - range.from.line >= minSize) {
11632
+ if (clsOpen && old && clsOpen.test(old.className)) return;
11633
+ mark = marker(opts.indicatorOpen);
11634
+ }
11635
+ }
11636
+ if (!mark && !old) return;
11637
+ cm.setGutterMarker(line, opts.gutter, mark);
11638
+ });
11639
+ }
11640
+
11641
+ // copied from CodeMirror/src/util/dom.js
11642
+ function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
11643
+
11644
+ function updateInViewport(cm) {
11645
+ var vp = cm.getViewport(), state = cm.state.foldGutter;
11646
+ if (!state) return;
11647
+ cm.operation(function() {
11648
+ updateFoldInfo(cm, vp.from, vp.to);
11649
+ });
11650
+ state.from = vp.from; state.to = vp.to;
11651
+ }
11652
+
11653
+ function onGutterClick(cm, line, gutter) {
11654
+ var state = cm.state.foldGutter;
11655
+ if (!state) return;
11656
+ var opts = state.options;
11657
+ if (gutter != opts.gutter) return;
11658
+ var folded = isFolded(cm, line);
11659
+ if (folded) folded.clear();
11660
+ else cm.foldCode(Pos(line, 0), opts);
11661
+ }
11662
+
11663
+ function optionChange(cm, option) {
11664
+ if (option == "mode") onChange(cm);
11665
+ }
11666
+
11667
+ function onChange(cm) {
11668
+ var state = cm.state.foldGutter;
11669
+ if (!state) return;
11670
+ var opts = state.options;
11671
+ state.from = state.to = 0;
11672
+ clearTimeout(state.changeUpdate);
11673
+ state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
11674
+ }
11675
+
11676
+ function onViewportChange(cm) {
11677
+ var state = cm.state.foldGutter;
11678
+ if (!state) return;
11679
+ var opts = state.options;
11680
+ clearTimeout(state.changeUpdate);
11681
+ state.changeUpdate = setTimeout(function() {
11682
+ var vp = cm.getViewport();
11683
+ if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
11684
+ updateInViewport(cm);
11685
+ } else {
11686
+ cm.operation(function() {
11687
+ if (vp.from < state.from) {
11688
+ updateFoldInfo(cm, vp.from, state.from);
11689
+ state.from = vp.from;
11690
+ }
11691
+ if (vp.to > state.to) {
11692
+ updateFoldInfo(cm, state.to, vp.to);
11693
+ state.to = vp.to;
11694
+ }
11695
+ });
11696
+ }
11697
+ }, opts.updateViewportTimeSpan || 400);
11698
+ }
11699
+
11700
+ function onFold(cm, from) {
11701
+ var state = cm.state.foldGutter;
11702
+ if (!state) return;
11703
+ var line = from.line;
11704
+ if (line >= state.from && line < state.to)
11705
+ updateFoldInfo(cm, line, line + 1);
11706
+ }
11707
+ });
11708
+ });
11709
+
11710
+ _commonjsHelpers.createCommonjsModule(function (module, exports) {
11711
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
11712
+ // Distributed under an MIT license: https://codemirror.net/5/LICENSE
11713
+
11714
+ (function(mod) {
11715
+ mod(codemirror);
11716
+ })(function(CodeMirror) {
11717
+
11718
+ function bracketFolding(pairs) {
11719
+ return function(cm, start) {
11720
+ var line = start.line, lineText = cm.getLine(line);
11721
+
11722
+ function findOpening(pair) {
11723
+ var tokenType;
11724
+ for (var at = start.ch, pass = 0;;) {
11725
+ var found = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1);
11726
+ if (found == -1) {
11727
+ if (pass == 1) break;
11728
+ pass = 1;
11729
+ at = lineText.length;
11730
+ continue;
11731
+ }
11732
+ if (pass == 1 && found < start.ch) break;
11733
+ tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
11734
+ if (!/^(comment|string)/.test(tokenType)) return {ch: found + 1, tokenType: tokenType, pair: pair};
11735
+ at = found - 1;
11736
+ }
11737
+ }
11738
+
11739
+ function findRange(found) {
11740
+ var count = 1, lastLine = cm.lastLine(), end, startCh = found.ch, endCh;
11741
+ outer: for (var i = line; i <= lastLine; ++i) {
11742
+ var text = cm.getLine(i), pos = i == line ? startCh : 0;
11743
+ for (;;) {
11744
+ var nextOpen = text.indexOf(found.pair[0], pos), nextClose = text.indexOf(found.pair[1], pos);
11745
+ if (nextOpen < 0) nextOpen = text.length;
11746
+ if (nextClose < 0) nextClose = text.length;
11747
+ pos = Math.min(nextOpen, nextClose);
11748
+ if (pos == text.length) break;
11749
+ if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) {
11750
+ if (pos == nextOpen) ++count;
11751
+ else if (!--count) { end = i; endCh = pos; break outer; }
11752
+ }
11753
+ ++pos;
11754
+ }
11755
+ }
11756
+
11757
+ if (end == null || line == end) return null
11758
+ return {from: CodeMirror.Pos(line, startCh),
11759
+ to: CodeMirror.Pos(end, endCh)};
11760
+ }
11761
+
11762
+ var found = [];
11763
+ for (var i = 0; i < pairs.length; i++) {
11764
+ var open = findOpening(pairs[i]);
11765
+ if (open) found.push(open);
11766
+ }
11767
+ found.sort(function(a, b) { return a.ch - b.ch });
11768
+ for (var i = 0; i < found.length; i++) {
11769
+ var range = findRange(found[i]);
11770
+ if (range) return range
11771
+ }
11772
+ return null
11773
+ }
11774
+ }
11775
+
11776
+ CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]]));
11777
+
11778
+ CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]]));
11779
+
11780
+ CodeMirror.registerHelper("fold", "import", function(cm, start) {
11781
+ function hasImport(line) {
11782
+ if (line < cm.firstLine() || line > cm.lastLine()) return null;
11783
+ var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
11784
+ if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
11785
+ if (start.type != "keyword" || start.string != "import") return null;
11786
+ // Now find closing semicolon, return its position
11787
+ for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
11788
+ var text = cm.getLine(i), semi = text.indexOf(";");
11789
+ if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
11790
+ }
11791
+ }
11792
+
11793
+ var startLine = start.line, has = hasImport(startLine), prev;
11794
+ if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
11795
+ return null;
11796
+ for (var end = has.end;;) {
11797
+ var next = hasImport(end.line + 1);
11798
+ if (next == null) break;
11799
+ end = next.end;
11800
+ }
11801
+ return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
11802
+ });
11803
+
11804
+ CodeMirror.registerHelper("fold", "include", function(cm, start) {
11805
+ function hasInclude(line) {
11806
+ if (line < cm.firstLine() || line > cm.lastLine()) return null;
11807
+ var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
11808
+ if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
11809
+ if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
11810
+ }
11811
+
11812
+ var startLine = start.line, has = hasInclude(startLine);
11813
+ if (has == null || hasInclude(startLine - 1) != null) return null;
11814
+ for (var end = startLine;;) {
11815
+ var next = hasInclude(end + 1);
11816
+ if (next == null) break;
11817
+ ++end;
11818
+ }
11819
+ return {from: CodeMirror.Pos(startLine, has + 1),
11820
+ to: cm.clipPos(CodeMirror.Pos(end))};
11821
+ });
11822
+
11823
+ });
11824
+ });
11825
+
11826
+ var jsonlint_1 = _commonjsHelpers.createCommonjsModule(function (module) {
11827
+ var jsonlint = (function(){var require=true,module=false;var exports={};/*
11828
+ json_parse.js
11829
+ 2016-05-02
11830
+
11831
+ Public Domain.
11832
+
11833
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
11834
+
11835
+ This file creates a json_parse function.
11836
+
11837
+ json_parse(text, reviver)
11838
+ This method parses a JSON text to produce an object or array.
11839
+ It can throw a SyntaxError exception.
11840
+
11841
+ The optional reviver parameter is a function that can filter and
11842
+ transform the results. It receives each of the keys and values,
11843
+ and its return value is used instead of the original value.
11844
+ If it returns what it received, then the structure is not modified.
11845
+ If it returns undefined then the member is deleted.
11846
+
11847
+ Example:
11848
+
11849
+ // Parse the text. Values that look like ISO date strings will
11850
+ // be converted to Date objects.
11851
+
11852
+ myData = json_parse(text, function (key, value) {
11853
+ var a;
11854
+ if (typeof value === "string") {
11855
+ a =
11856
+ /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
11857
+ if (a) {
11858
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
11859
+ +a[5], +a[6]));
11860
+ }
11861
+ }
11862
+ return value;
11863
+ });
11864
+
11865
+ This is a reference implementation. You are free to copy, modify, or
11866
+ redistribute.
11867
+
11868
+ This code should be minified before deployment.
11869
+ See http://javascript.crockford.com/jsmin.html
11870
+
11871
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
11872
+ NOT CONTROL.
11873
+ */
11874
+
11875
+ /*jslint for */
11876
+
11877
+ /*property
11878
+ at, b, call, charAt, f, fromCharCode, hasOwnProperty, message, n, name,
11879
+ prototype, push, r, t, text
11880
+ */
11881
+
11882
+ var ___dougJSONParse = (function () {
11883
+
11884
+ // This is a function that can parse a JSON text, producing a JavaScript
11885
+ // data structure. It is a simple, recursive descent parser. It does not use
11886
+ // eval or regular expressions, so it can be used as a model for implementing
11887
+ // a JSON parser in other languages.
11888
+
11889
+ // We are defining the function inside of another function to avoid creating
11890
+ // global variables.
11891
+
11892
+ var at; // The index of the current character
11893
+ var ch; // The current character
11894
+ var escapee = {
11895
+ "\"": "\"",
11896
+ "\\": "\\",
11897
+ "/": "/",
11898
+ b: "\b",
11899
+ f: "\f",
11900
+ n: "\n",
11901
+ r: "\r",
11902
+ t: "\t"
11903
+ };
11904
+ var text;
11905
+
11906
+ var error = function (m) {
11907
+
11908
+ // Call error when something is wrong.
11909
+
11910
+ throw {
11911
+ name: "SyntaxError",
11912
+ message: m,
11913
+ at: at,
11914
+ text: text
11915
+ };
11916
+ };
11917
+
11918
+ var next = function (c) {
11919
+
11920
+ // If a c parameter is provided, verify that it matches the current character.
11921
+
11922
+ if (c && c !== ch) {
11923
+ error("Expected '" + c + "' instead of '" + ch + "'");
11924
+ }
11925
+
11926
+ // Get the next character. When there are no more characters,
11927
+ // return the empty string.
11928
+
11929
+ ch = text.charAt(at);
11930
+ at += 1;
11931
+ return ch;
11932
+ };
11933
+
11934
+ var number = function () {
11935
+
11936
+ // Parse a number value.
11937
+
11938
+ var value;
11939
+ var string = "";
11940
+
11941
+ if (ch === "-") {
11942
+ string = "-";
11943
+ next("-");
11944
+ }
11945
+ while (ch >= "0" && ch <= "9") {
11946
+ string += ch;
11947
+ next();
11948
+ }
11949
+ if (ch === ".") {
11950
+ string += ".";
11951
+ while (next() && ch >= "0" && ch <= "9") {
11952
+ string += ch;
11953
+ }
11954
+ }
11955
+ if (ch === "e" || ch === "E") {
11956
+ string += ch;
11957
+ next();
11958
+ if (ch === "-" || ch === "+") {
11959
+ string += ch;
11960
+ next();
11961
+ }
11962
+ while (ch >= "0" && ch <= "9") {
11963
+ string += ch;
11964
+ next();
11965
+ }
11966
+ }
11967
+ value = +string;
11968
+ if (!isFinite(value)) {
11969
+ error("Bad number");
11970
+ } else {
11971
+ return value;
11972
+ }
11973
+ };
11974
+
11975
+ var string = function () {
11976
+
11977
+ // Parse a string value.
11978
+
11979
+ var hex;
11980
+ var i;
11981
+ var value = "";
11982
+ var uffff;
11983
+
11984
+ // When parsing for string values, we must look for " and \ characters.
11985
+
11986
+ if (ch === "\"") {
11987
+ while (next()) {
11988
+ if (ch === "\"") {
11989
+ next();
11990
+ return value;
11991
+ }
11992
+ if (ch === "\\") {
11993
+ next();
11994
+ if (ch === "u") {
11995
+ uffff = 0;
11996
+ for (i = 0; i < 4; i += 1) {
11997
+ hex = parseInt(next(), 16);
11998
+ if (!isFinite(hex)) {
11999
+ break;
12000
+ }
12001
+ uffff = uffff * 16 + hex;
12002
+ }
12003
+ value += String.fromCharCode(uffff);
12004
+ } else if (typeof escapee[ch] === "string") {
12005
+ value += escapee[ch];
12006
+ } else {
12007
+ break;
12008
+ }
12009
+ } else {
12010
+ value += ch;
12011
+ }
12012
+ }
12013
+ }
12014
+ error("Bad string");
12015
+ };
12016
+
12017
+ var white = function () {
12018
+
12019
+ // Skip whitespace.
12020
+
12021
+ while (ch && ch <= " ") {
12022
+ next();
12023
+ }
12024
+ };
12025
+
12026
+ var word = function () {
12027
+
12028
+ // true, false, or null.
12029
+
12030
+ switch (ch) {
12031
+ case "t":
12032
+ next("t");
12033
+ next("r");
12034
+ next("u");
12035
+ next("e");
12036
+ return true;
12037
+ case "f":
12038
+ next("f");
12039
+ next("a");
12040
+ next("l");
12041
+ next("s");
12042
+ next("e");
12043
+ return false;
12044
+ case "n":
12045
+ next("n");
12046
+ next("u");
12047
+ next("l");
12048
+ next("l");
12049
+ return null;
12050
+ }
12051
+ error("Unexpected '" + ch + "'");
12052
+ };
12053
+
12054
+ var value; // Place holder for the value function.
12055
+
12056
+ var array = function () {
12057
+
12058
+ // Parse an array value.
12059
+
12060
+ var arr = [];
12061
+
12062
+ if (ch === "[") {
12063
+ next("[");
12064
+ white();
12065
+ if (ch === "]") {
12066
+ next("]");
12067
+ return arr; // empty array
12068
+ }
12069
+ while (ch) {
12070
+ arr.push(value());
12071
+ white();
12072
+ if (ch === "]") {
12073
+ next("]");
12074
+ return arr;
12075
+ }
12076
+ next(",");
12077
+ white();
12078
+ }
12079
+ }
12080
+ error("Bad array");
12081
+ };
12082
+
12083
+ var object = function () {
12084
+
12085
+ // Parse an object value.
12086
+
12087
+ var key;
12088
+ var obj = {};
12089
+
12090
+ if (ch === "{") {
12091
+ next("{");
12092
+ white();
12093
+ if (ch === "}") {
12094
+ next("}");
12095
+ return obj; // empty object
12096
+ }
12097
+ while (ch) {
12098
+ key = string();
12099
+ white();
12100
+ next(":");
12101
+ if (Object.hasOwnProperty.call(obj, key)) {
12102
+ error("Duplicate key '" + key + "'");
12103
+ }
12104
+ obj[key] = value();
12105
+ white();
12106
+ if (ch === "}") {
12107
+ next("}");
12108
+ return obj;
12109
+ }
12110
+ next(",");
12111
+ white();
12112
+ }
12113
+ }
12114
+ error("Bad object");
12115
+ };
12116
+
12117
+ value = function () {
12118
+
12119
+ // Parse a JSON value. It could be an object, an array, a string, a number,
12120
+ // or a word.
12121
+
12122
+ white();
12123
+ switch (ch) {
12124
+ case "{":
12125
+ return object();
12126
+ case "[":
12127
+ return array();
12128
+ case "\"":
12129
+ return string();
12130
+ case "-":
12131
+ return number();
12132
+ default:
12133
+ return (ch >= "0" && ch <= "9")
12134
+ ? number()
12135
+ : word();
12136
+ }
12137
+ };
12138
+
12139
+ // Return the json_parse function. It will have access to all of the above
12140
+ // functions and variables.
12141
+
12142
+ return function (source, reviver) {
12143
+ var result;
12144
+
12145
+ text = source;
12146
+ at = 0;
12147
+ ch = " ";
12148
+ result = value();
12149
+ white();
12150
+ if (ch) {
12151
+ error("Syntax error");
12152
+ }
12153
+
12154
+ // If there is a reviver function, we recursively walk the new structure,
12155
+ // passing each name/value pair to the reviver function for possible
12156
+ // transformation, starting with a temporary root object that holds the result
12157
+ // in an empty key. If there is not a reviver function, we simply return the
12158
+ // result.
12159
+
12160
+ return (typeof reviver === "function")
12161
+ ? (function walk(holder, key) {
12162
+ var k;
12163
+ var v;
12164
+ var val = holder[key];
12165
+ if (val && typeof val === "object") {
12166
+ for (k in val) {
12167
+ if (Object.prototype.hasOwnProperty.call(val, k)) {
12168
+ v = walk(val, k);
12169
+ if (v !== undefined) {
12170
+ val[k] = v;
12171
+ } else {
12172
+ delete val[k];
12173
+ }
12174
+ }
12175
+ }
12176
+ }
12177
+ return reviver.call(holder, key, val);
12178
+ }({"": result}, ""))
12179
+ : result;
12180
+ };
12181
+ }());
12182
+ /* Jison generated parser */
12183
+ var jsonlint = (function(){
12184
+ var parser = {trace: function trace() { },
12185
+ yy: {},
12186
+ 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},
12187
+ terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
12188
+ 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]],
12189
+ performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
12190
+
12191
+ var $0 = $$.length - 1;
12192
+ switch (yystate) {
12193
+ case 1: // replace escaped characters with actual character
12194
+ this.$ = yytext.replace(/\\(\\|")/g, "$"+"1")
12195
+ .replace(/\\n/g,'\n')
12196
+ .replace(/\\r/g,'\r')
12197
+ .replace(/\\t/g,'\t')
12198
+ .replace(/\\v/g,'\v')
12199
+ .replace(/\\f/g,'\f')
12200
+ .replace(/\\b/g,'\b');
12201
+
12202
+ break;
12203
+ case 2:this.$ = Number(yytext);
12204
+ break;
12205
+ case 3:this.$ = null;
12206
+ break;
12207
+ case 4:this.$ = true;
12208
+ break;
12209
+ case 5:this.$ = false;
12210
+ break;
12211
+ case 6:return this.$ = $$[$0-1];
12212
+ case 13:this.$ = {};
12213
+ break;
12214
+ case 14:this.$ = $$[$0-1];
12215
+ break;
12216
+ case 15:this.$ = [$$[$0-2], $$[$0]];
12217
+ break;
12218
+ case 16:this.$ = {}; this.$[$$[$0][0]] = $$[$0][1];
12219
+ break;
12220
+ case 17:this.$ = $$[$0-2]; $$[$0-2][$$[$0][0]] = $$[$0][1];
12221
+ break;
12222
+ case 18:this.$ = [];
12223
+ break;
12224
+ case 19:this.$ = $$[$0-1];
12225
+ break;
12226
+ case 20:this.$ = [$$[$0]];
12227
+ break;
12228
+ case 21:this.$ = $$[$0-2]; $$[$0-2].push($$[$0]);
12229
+ break;
12230
+ }
12231
+ },
12232
+ 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]}],
12233
+ defaultActions: {16:[2,6]},
12234
+ parseError: function parseError(str, hash) {
12235
+ throw new Error(str);
12236
+ },
12237
+ parse: function parse(input) {
12238
+ var self = this,
12239
+ stack = [0],
12240
+ vstack = [null], // semantic value stack
12241
+ lstack = [], // location stack
12242
+ table = this.table,
12243
+ yytext = '',
12244
+ yylineno = 0,
12245
+ yyleng = 0,
12246
+ recovering = 0,
12247
+ TERROR = 2,
12248
+ EOF = 1;
12249
+
12250
+ //this.reductionCount = this.shiftCount = 0;
12251
+
12252
+ this.lexer.setInput(input);
12253
+ this.lexer.yy = this.yy;
12254
+ this.yy.lexer = this.lexer;
12255
+ if (typeof this.lexer.yylloc == 'undefined')
12256
+ this.lexer.yylloc = {};
12257
+ var yyloc = this.lexer.yylloc;
12258
+ lstack.push(yyloc);
12259
+
12260
+ if (typeof this.yy.parseError === 'function')
12261
+ this.parseError = this.yy.parseError;
12262
+
12263
+ function popStack (n) {
12264
+ stack.length = stack.length - 2*n;
12265
+ vstack.length = vstack.length - n;
12266
+ lstack.length = lstack.length - n;
12267
+ }
12268
+
12269
+ function lex() {
12270
+ var token;
12271
+ token = self.lexer.lex() || 1; // $end = 1
12272
+ // if token isn't its numeric value, convert
12273
+ if (typeof token !== 'number') {
12274
+ token = self.symbols_[token] || token;
12275
+ }
12276
+ return token;
12277
+ }
12278
+
12279
+ var symbol, preErrorSymbol, state, action, r, yyval={},p,len,newState, expected;
12280
+ while (true) {
12281
+ // retreive state number from top of stack
12282
+ state = stack[stack.length-1];
12283
+
12284
+ // use default actions if available
12285
+ if (this.defaultActions[state]) {
12286
+ action = this.defaultActions[state];
12287
+ } else {
12288
+ if (symbol == null)
12289
+ symbol = lex();
12290
+ // read action for current state and first input
12291
+ action = table[state] && table[state][symbol];
12292
+ }
12293
+
12294
+ // handle parse error
12295
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
12296
+
12297
+ if (!recovering) {
12298
+ // Report error
12299
+ expected = [];
12300
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
12301
+ expected.push("'"+this.terminals_[p]+"'");
12302
+ }
12303
+ var errStr = '';
12304
+ if (this.lexer.showPosition) {
12305
+ errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
12306
+ } else {
12307
+ errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
12308
+ (symbol == 1 /*EOF*/ ? "end of input" :
12309
+ ("'"+(this.terminals_[symbol] || symbol)+"'"));
12310
+ }
12311
+ this.parseError(errStr,
12312
+ {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
12313
+ }
12314
+
12315
+ // just recovered from another error
12316
+ if (recovering == 3) {
12317
+ if (symbol == EOF) {
12318
+ throw new Error(errStr || 'Parsing halted.');
12319
+ }
12320
+
12321
+ // discard current lookahead and grab another
12322
+ yyleng = this.lexer.yyleng;
12323
+ yytext = this.lexer.yytext;
12324
+ yylineno = this.lexer.yylineno;
12325
+ yyloc = this.lexer.yylloc;
12326
+ symbol = lex();
12327
+ }
12328
+
12329
+ // try to recover from error
12330
+ while (1) {
12331
+ // check for error recovery rule in this state
12332
+ if ((TERROR.toString()) in table[state]) {
12333
+ break;
12334
+ }
12335
+ if (state == 0) {
12336
+ throw new Error(errStr || 'Parsing halted.');
12337
+ }
12338
+ popStack(1);
12339
+ state = stack[stack.length-1];
12340
+ }
12341
+
12342
+ preErrorSymbol = symbol; // save the lookahead token
12343
+ symbol = TERROR; // insert generic error symbol as new lookahead
12344
+ state = stack[stack.length-1];
12345
+ action = table[state] && table[state][TERROR];
12346
+ recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
12347
+ }
12348
+
12349
+ // this shouldn't happen, unless resolve defaults are off
12350
+ if (action[0] instanceof Array && action.length > 1) {
12351
+ throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
12352
+ }
12353
+
12354
+ switch (action[0]) {
12355
+
12356
+ case 1: // shift
12357
+ //this.shiftCount++;
12358
+
12359
+ stack.push(symbol);
12360
+ vstack.push(this.lexer.yytext);
12361
+ lstack.push(this.lexer.yylloc);
12362
+ stack.push(action[1]); // push state
12363
+ symbol = null;
12364
+ if (!preErrorSymbol) { // normal execution/no error
12365
+ yyleng = this.lexer.yyleng;
12366
+ yytext = this.lexer.yytext;
12367
+ yylineno = this.lexer.yylineno;
12368
+ yyloc = this.lexer.yylloc;
12369
+ if (recovering > 0)
12370
+ recovering--;
12371
+ } else { // error just occurred, resume old lookahead f/ before error
12372
+ symbol = preErrorSymbol;
12373
+ preErrorSymbol = null;
12374
+ }
12375
+ break;
12376
+
12377
+ case 2: // reduce
12378
+ //this.reductionCount++;
12379
+
12380
+ len = this.productions_[action[1]][1];
12381
+
12382
+ // perform semantic action
12383
+ yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
12384
+ // default location, uses first token for firsts, last for lasts
12385
+ yyval._$ = {
12386
+ first_line: lstack[lstack.length-(len||1)].first_line,
12387
+ last_line: lstack[lstack.length-1].last_line,
12388
+ first_column: lstack[lstack.length-(len||1)].first_column,
12389
+ last_column: lstack[lstack.length-1].last_column
12390
+ };
12391
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
12392
+
12393
+ if (typeof r !== 'undefined') {
12394
+ return r;
12395
+ }
12396
+
12397
+ // pop off stack
12398
+ if (len) {
12399
+ stack = stack.slice(0,-1*len*2);
12400
+ vstack = vstack.slice(0, -1*len);
12401
+ lstack = lstack.slice(0, -1*len);
12402
+ }
12403
+
12404
+ stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
12405
+ vstack.push(yyval.$);
12406
+ lstack.push(yyval._$);
12407
+ // goto new state = table[STATE][NONTERMINAL]
12408
+ newState = table[stack[stack.length-2]][stack[stack.length-1]];
12409
+ stack.push(newState);
12410
+ break;
12411
+
12412
+ case 3: // accept
12413
+ return true;
12414
+ }
12415
+
12416
+ }
12417
+
12418
+ return true;
12419
+ }};
12420
+ /* Jison generated lexer */
12421
+ var lexer = (function(){
12422
+ var lexer = ({EOF:1,
12423
+ parseError:function parseError(str, hash) {
12424
+ if (this.yy.parseError) {
12425
+ this.yy.parseError(str, hash);
12426
+ } else {
12427
+ throw new Error(str);
12428
+ }
12429
+ },
12430
+ setInput:function (input) {
12431
+ this._input = input;
12432
+ this._more = this._less = this.done = false;
12433
+ this.yylineno = this.yyleng = 0;
12434
+ this.yytext = this.matched = this.match = '';
12435
+ this.conditionStack = ['INITIAL'];
12436
+ this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
12437
+ return this;
12438
+ },
12439
+ input:function () {
12440
+ var ch = this._input[0];
12441
+ this.yytext+=ch;
12442
+ this.yyleng++;
12443
+ this.match+=ch;
12444
+ this.matched+=ch;
12445
+ var lines = ch.match(/\n/);
12446
+ if (lines) this.yylineno++;
12447
+ this._input = this._input.slice(1);
12448
+ return ch;
12449
+ },
12450
+ unput:function (ch) {
12451
+ this._input = ch + this._input;
12452
+ return this;
12453
+ },
12454
+ more:function () {
12455
+ this._more = true;
12456
+ return this;
12457
+ },
12458
+ less:function (n) {
12459
+ this._input = this.match.slice(n) + this._input;
12460
+ },
12461
+ pastInput:function () {
12462
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
12463
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
12464
+ },
12465
+ upcomingInput:function () {
12466
+ var next = this.match;
12467
+ if (next.length < 20) {
12468
+ next += this._input.substr(0, 20-next.length);
12469
+ }
12470
+ return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
12471
+ },
12472
+ showPosition:function () {
12473
+ var pre = this.pastInput();
12474
+ var c = new Array(pre.length + 1).join("-");
12475
+ return pre + this.upcomingInput() + "\n" + c+"^";
12476
+ },
12477
+ next:function () {
12478
+ if (this.done) {
12479
+ return this.EOF;
12480
+ }
12481
+ if (!this._input) this.done = true;
12482
+
12483
+ var token,
12484
+ match,
12485
+ tempMatch,
12486
+ index,
12487
+ lines;
12488
+ if (!this._more) {
12489
+ this.yytext = '';
12490
+ this.match = '';
12491
+ }
12492
+ var rules = this._currentRules();
12493
+ for (var i=0;i < rules.length; i++) {
12494
+ tempMatch = this._input.match(this.rules[rules[i]]);
12495
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
12496
+ match = tempMatch;
12497
+ index = i;
12498
+ if (!this.options.flex) break;
12499
+ }
12500
+ }
12501
+ if (match) {
12502
+ lines = match[0].match(/\n.*/g);
12503
+ if (lines) this.yylineno += lines.length;
12504
+ this.yylloc = {first_line: this.yylloc.last_line,
12505
+ last_line: this.yylineno+1,
12506
+ first_column: this.yylloc.last_column,
12507
+ last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length};
12508
+ this.yytext += match[0];
12509
+ this.match += match[0];
12510
+ this.yyleng = this.yytext.length;
12511
+ this._more = false;
12512
+ this._input = this._input.slice(match[0].length);
12513
+ this.matched += match[0];
12514
+ token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
12515
+ if (this.done && this._input) this.done = false;
12516
+ if (token) return token;
12517
+ else return;
12518
+ }
12519
+ if (this._input === "") {
12520
+ return this.EOF;
12521
+ } else {
12522
+ this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
12523
+ {text: "", token: null, line: this.yylineno});
12524
+ }
12525
+ },
12526
+ lex:function lex() {
12527
+ var r = this.next();
12528
+ if (typeof r !== 'undefined') {
12529
+ return r;
12530
+ } else {
12531
+ return this.lex();
12532
+ }
12533
+ },
12534
+ begin:function begin(condition) {
12535
+ this.conditionStack.push(condition);
12536
+ },
12537
+ popState:function popState() {
12538
+ return this.conditionStack.pop();
12539
+ },
12540
+ _currentRules:function _currentRules() {
12541
+ return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
12542
+ },
12543
+ topState:function () {
12544
+ return this.conditionStack[this.conditionStack.length-2];
12545
+ },
12546
+ pushState:function begin(condition) {
12547
+ this.begin(condition);
12548
+ }});
12549
+ lexer.options = {};
12550
+ lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
12551
+ switch($avoiding_name_collisions) {
12552
+ case 0:/* skip whitespace */
12553
+ break;
12554
+ case 1:return 6
12555
+ case 2:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 4
12556
+ case 3:return 17
12557
+ case 4:return 18
12558
+ case 5:return 23
12559
+ case 6:return 24
12560
+ case 7:return 22
12561
+ case 8:return 21
12562
+ case 9:return 10
12563
+ case 10:return 11
12564
+ case 11:return 8
12565
+ case 12:return 14
12566
+ case 13:return 'INVALID'
12567
+ }
12568
+ };
12569
+ lexer.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)/,/^(?:$)/,/^(?:.)/];
12570
+ lexer.conditions = {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"inclusive":true}};
12571
+ return lexer;})();
12572
+ parser.lexer = lexer;
12573
+ return parser;
12574
+ })();
12575
+
12576
+ var origParse = jsonlint.parse;
12577
+
12578
+ jsonlint.parse = function(input) {
12579
+ var result = origParse.call(jsonlint, input);
12580
+ var dougJSONParse = typeof ___dougJSONParse === 'undefined' ? require('./doug-json-parse') : ___dougJSONParse;
12581
+ try {
12582
+ dougJSONParse(input);
12583
+ } catch(e) {
12584
+ if(/Duplicate key|Bad string|Unexpected/.test(e.message)) {
12585
+ var linesUntilError = input.substring(0, e.at).split('\n');
12586
+ var line = linesUntilError.length;
12587
+ var col = linesUntilError[line - 1].length - 1;
12588
+
12589
+ this.parseError(e.message, {line: line, col: col, message: e.message.replace(/./, function(l) { return l.toLowerCase(); })});
12590
+ throw SyntaxError(e.message + ' on line ' + line);
12591
+ }
12592
+ }
12593
+
12594
+ return result;
12595
+ };
12596
+
12597
+ if (typeof exports !== 'undefined') {
12598
+ exports.parser = jsonlint;
12599
+ exports.parse = function () { return jsonlint.parse.apply(jsonlint, arguments); };
12600
+ exports.main = function commonjsMain(args) {
12601
+ if (!args[1])
12602
+ throw new Error('Usage: '+args[0]+' FILE');
12603
+ if (typeof process !== 'undefined') {
12604
+ var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
12605
+ } else {
12606
+ var cwd = require("file").path(require("file").cwd());
12607
+ var source = cwd.join(args[1]).read({charset: "utf-8"});
12608
+ }
12609
+ return exports.parser.parse(source);
12610
+ };
12611
+ if (require.main === module) {
12612
+ exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
12613
+ }
12614
+ }
12615
+ return exports;})();if(module.exports) module.exports = jsonlint;
12616
+ });
12617
+
12618
+ const codeEditorCss = ".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}";
11041
12619
 
11042
12620
  const CodeEditor = class {
11043
12621
  constructor(hostRef) {
11044
12622
  index.registerInstance(this, hostRef);
11045
12623
  this.change = index.createEvent(this, "change", 7);
11046
- /**
11047
- * The code to be rendered
11048
- */
11049
- this.value = '';
11050
- /**
11051
- * Disables editing of the editor content
11052
- */
11053
- this.readonly = false;
11054
- /**
11055
- * Displays line numbers in the editor
11056
- */
11057
- this.lineNumbers = false;
11058
- /**
11059
- * Select color scheme for the editor
11060
- */
11061
- this.colorScheme = 'auto';
11062
12624
  this.handleChangeDarkMode = () => {
11063
12625
  if (this.colorScheme !== 'auto') {
11064
12626
  return;
@@ -11074,6 +12636,14 @@ const CodeEditor = class {
11074
12636
  }
11075
12637
  this.editor.refresh();
11076
12638
  };
12639
+ this.value = '';
12640
+ this.language = undefined;
12641
+ this.readonly = false;
12642
+ this.lineNumbers = false;
12643
+ this.fold = false;
12644
+ this.lint = false;
12645
+ this.colorScheme = 'auto';
12646
+ this.random = undefined;
11077
12647
  }
11078
12648
  connectedCallback() {
11079
12649
  this.observer = new ResizeObserver(this.handleResize);
@@ -11096,16 +12666,37 @@ const CodeEditor = class {
11096
12666
  }
11097
12667
  this.editor = this.createEditor();
11098
12668
  }
12669
+ watchValue(newValue) {
12670
+ if (!this.editor) {
12671
+ return;
12672
+ }
12673
+ const currentValue = this.editor.getValue();
12674
+ if (newValue === currentValue) {
12675
+ // Circuit breaker for when the change comes from the editor itself
12676
+ // The caret position will be reset without this
12677
+ return;
12678
+ }
12679
+ this.editor.getDoc().setValue(newValue || '');
12680
+ }
11099
12681
  createEditor() {
11100
12682
  const options = this.getOptions();
11101
12683
  const editor = codemirror(this.host.shadowRoot.querySelector('.editor'), options);
11102
12684
  editor.on('change', this.handleChange);
12685
+ // Replace tab with spaces and use the actual indent setting for
12686
+ // the space count
12687
+ editor.setOption('extraKeys', {
12688
+ Tab: (codeMirror) => {
12689
+ const spaces = Array(codeMirror.getOption('indentUnit') + 1).join(' ');
12690
+ codeMirror.replaceSelection(spaces);
12691
+ },
12692
+ });
11103
12693
  return editor;
11104
12694
  }
11105
12695
  getOptions() {
11106
12696
  let mode = this.language;
11107
12697
  const TAB_SIZE = 4;
11108
12698
  let theme = 'lime light';
12699
+ const gutters = [];
11109
12700
  if (this.isDarkMode()) {
11110
12701
  theme = 'lime dark';
11111
12702
  }
@@ -11114,6 +12705,13 @@ const CodeEditor = class {
11114
12705
  name: 'application/json',
11115
12706
  json: true,
11116
12707
  };
12708
+ if (this.lint) {
12709
+ gutters.push('CodeMirror-lint-markers');
12710
+ if (!('jsonlint' in window)) {
12711
+ // eslint-disable-next-line @typescript-eslint/dot-notation
12712
+ window['jsonlint'] = jsonlint_1;
12713
+ }
12714
+ }
11117
12715
  }
11118
12716
  else if (this.language === 'typescript') {
11119
12717
  mode = {
@@ -11121,9 +12719,12 @@ const CodeEditor = class {
11121
12719
  typescript: true,
11122
12720
  };
11123
12721
  }
12722
+ if (this.fold) {
12723
+ gutters.push('CodeMirror-foldgutter');
12724
+ }
11124
12725
  return {
11125
12726
  mode: mode,
11126
- value: this.value,
12727
+ value: this.value || '',
11127
12728
  theme: theme,
11128
12729
  readOnly: this.readonly,
11129
12730
  tabSize: TAB_SIZE,
@@ -11131,6 +12732,9 @@ const CodeEditor = class {
11131
12732
  lineNumbers: this.lineNumbers,
11132
12733
  styleActiveLine: true,
11133
12734
  matchBrackets: true,
12735
+ lint: this.lint,
12736
+ foldGutter: this.fold,
12737
+ gutters: gutters,
11134
12738
  };
11135
12739
  }
11136
12740
  isDarkMode() {
@@ -11155,6 +12759,9 @@ const CodeEditor = class {
11155
12759
  return matchMedia('(prefers-color-scheme: dark)');
11156
12760
  }
11157
12761
  get host() { return index.getElement(this); }
12762
+ static get watchers() { return {
12763
+ "value": ["watchValue"]
12764
+ }; }
11158
12765
  };
11159
12766
  CodeEditor.style = codeEditorCss;
11160
12767