@limetech/lime-elements 39.0.1 → 39.0.2

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 (242) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/{checkbox.template-Bu9mvjbY.js → checkbox.template-VElWkDR9.js} +1 -1
  3. package/dist/cjs/{index-DYJkh2ZK.js → index-Ddjrlc-6.js} +1 -1
  4. package/dist/cjs/lime-elements.cjs.js +1 -1
  5. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
  6. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-badge.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-banner.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +4 -4
  12. package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-button.cjs.entry.js +2 -2
  14. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-card.cjs.entry.js +1 -1
  16. package/dist/cjs/limel-chart.cjs.entry.js +2 -2
  17. package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
  18. package/dist/cjs/limel-chip_2.cjs.entry.js +3 -3
  19. package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
  20. package/dist/cjs/limel-code-editor.cjs.entry.js +2 -2
  21. package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
  22. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
  23. package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
  24. package/dist/cjs/limel-config.cjs.entry.js +1 -1
  25. package/dist/cjs/limel-date-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
  27. package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
  28. package/dist/cjs/limel-dock.cjs.entry.js +2 -2
  29. package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
  30. package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
  31. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
  32. package/dist/cjs/limel-file-viewer.cjs.entry.js +2 -2
  33. package/dist/cjs/limel-file.cjs.entry.js +1 -1
  34. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  35. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
  36. package/dist/cjs/limel-form.cjs.entry.js +2 -2
  37. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  38. package/dist/cjs/limel-header.cjs.entry.js +1 -1
  39. package/dist/cjs/limel-help-content.cjs.entry.js +1 -1
  40. package/dist/cjs/limel-help.cjs.entry.js +1 -1
  41. package/dist/cjs/limel-helper-line_2.cjs.entry.js +1 -1
  42. package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
  43. package/dist/cjs/limel-icon.cjs.entry.js +1 -1
  44. package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
  46. package/dist/cjs/limel-list-item.cjs.entry.js +2 -2
  47. package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
  48. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
  49. package/dist/cjs/limel-picker.cjs.entry.js +1 -1
  50. package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
  51. package/dist/cjs/limel-portal_3.cjs.entry.js +1 -1
  52. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
  53. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +2 -2
  54. package/dist/cjs/limel-progress-flow.cjs.entry.js +2 -2
  55. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  56. package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
  57. package/dist/cjs/limel-radio-button.cjs.entry.js +2 -2
  58. package/dist/cjs/limel-select.cjs.entry.js +2 -2
  59. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  60. package/dist/cjs/limel-slider.cjs.entry.js +2 -2
  61. package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
  62. package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
  63. package/dist/cjs/limel-switch.cjs.entry.js +2 -2
  64. package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -2
  65. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  66. package/dist/cjs/limel-table.cjs.entry.js +2 -2
  67. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  68. package/dist/cjs/loader.cjs.js +1 -1
  69. package/dist/collection/components/button/button.css +34 -33
  70. package/dist/collection/components/chart/chart.css +120 -376
  71. package/dist/collection/components/chip/chip.css +68 -69
  72. package/dist/collection/components/chip-set/chip-set.css +29 -116
  73. package/dist/collection/components/circular-progress/circular-progress.css +193 -193
  74. package/dist/collection/components/code-editor/code-editor.css +350 -189
  75. package/dist/collection/components/collapsible-section/collapsible-section.css +125 -125
  76. package/dist/collection/components/dock/dock.css +60 -153
  77. package/dist/collection/components/file-viewer/file-viewer.css +80 -172
  78. package/dist/collection/components/form/form.css +77 -164
  79. package/dist/collection/components/input-field/input-field.css +75 -168
  80. package/dist/collection/components/list/list.css +59 -151
  81. package/dist/collection/components/menu-list/menu-list.css +59 -151
  82. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +74 -80
  83. package/dist/collection/components/progress-flow/progress-flow.css +2 -0
  84. package/dist/collection/components/radio-button-group/radio-button.css +2 -2
  85. package/dist/collection/components/select/select.css +39 -132
  86. package/dist/collection/components/slider/slider.css +391 -403
  87. package/dist/collection/components/snackbar/snackbar.css +76 -75
  88. package/dist/collection/components/switch/switch.css +106 -106
  89. package/dist/collection/components/tab-bar/tab-bar.css +208 -203
  90. package/dist/collection/components/table/table.css +170 -462
  91. package/dist/collection/style/color-palette-primary.scss.bak +1 -1
  92. package/dist/collection/style/color-palette-ui.scss.bak +1 -1
  93. package/dist/collection/style/internal/fieldset.scss +2 -2
  94. package/dist/esm/{checkbox.template-CVMlWdZR.js → checkbox.template-BB2t2jwT.js} +1 -1
  95. package/dist/esm/{index-BudcI_o9.js → index-xvTBZcD2.js} +1 -1
  96. package/dist/esm/lime-elements.js +2 -2
  97. package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
  98. package/dist/esm/limel-action-bar-item_2.entry.js +1 -1
  99. package/dist/esm/limel-action-bar_2.entry.js +1 -1
  100. package/dist/esm/limel-ai-avatar.entry.js +1 -1
  101. package/dist/esm/limel-badge.entry.js +1 -1
  102. package/dist/esm/limel-banner.entry.js +1 -1
  103. package/dist/esm/limel-breadcrumbs_7.entry.js +4 -4
  104. package/dist/esm/limel-button-group.entry.js +1 -1
  105. package/dist/esm/limel-button.entry.js +2 -2
  106. package/dist/esm/limel-callout.entry.js +1 -1
  107. package/dist/esm/limel-card.entry.js +1 -1
  108. package/dist/esm/limel-chart.entry.js +2 -2
  109. package/dist/esm/limel-checkbox.entry.js +2 -2
  110. package/dist/esm/limel-chip_2.entry.js +3 -3
  111. package/dist/esm/limel-circular-progress.entry.js +2 -2
  112. package/dist/esm/limel-code-editor.entry.js +2 -2
  113. package/dist/esm/limel-collapsible-section.entry.js +2 -2
  114. package/dist/esm/limel-color-picker-palette.entry.js +1 -1
  115. package/dist/esm/limel-color-picker.entry.js +1 -1
  116. package/dist/esm/limel-config.entry.js +1 -1
  117. package/dist/esm/limel-date-picker.entry.js +1 -1
  118. package/dist/esm/limel-dialog.entry.js +1 -1
  119. package/dist/esm/limel-dock-button.entry.js +1 -1
  120. package/dist/esm/limel-dock.entry.js +2 -2
  121. package/dist/esm/limel-drag-handle.entry.js +1 -1
  122. package/dist/esm/limel-dynamic-label.entry.js +1 -1
  123. package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
  124. package/dist/esm/limel-file-viewer.entry.js +2 -2
  125. package/dist/esm/limel-file.entry.js +1 -1
  126. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  127. package/dist/esm/limel-flex-container.entry.js +1 -1
  128. package/dist/esm/limel-form.entry.js +2 -2
  129. package/dist/esm/limel-grid.entry.js +1 -1
  130. package/dist/esm/limel-header.entry.js +1 -1
  131. package/dist/esm/limel-help-content.entry.js +1 -1
  132. package/dist/esm/limel-help.entry.js +1 -1
  133. package/dist/esm/limel-helper-line_2.entry.js +1 -1
  134. package/dist/esm/limel-icon-button.entry.js +1 -1
  135. package/dist/esm/limel-icon.entry.js +1 -1
  136. package/dist/esm/limel-info-tile.entry.js +1 -1
  137. package/dist/esm/limel-linear-progress.entry.js +1 -1
  138. package/dist/esm/limel-list-item.entry.js +2 -2
  139. package/dist/esm/limel-markdown.entry.js +1 -1
  140. package/dist/esm/limel-menu-item-meta.entry.js +1 -1
  141. package/dist/esm/limel-picker.entry.js +1 -1
  142. package/dist/esm/limel-popover_2.entry.js +1 -1
  143. package/dist/esm/limel-portal_3.entry.js +1 -1
  144. package/dist/esm/limel-profile-picture.entry.js +1 -1
  145. package/dist/esm/limel-progress-flow-item.entry.js +2 -2
  146. package/dist/esm/limel-progress-flow.entry.js +2 -2
  147. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  148. package/dist/esm/limel-radio-button-group.entry.js +1 -1
  149. package/dist/esm/limel-radio-button.entry.js +2 -2
  150. package/dist/esm/limel-select.entry.js +2 -2
  151. package/dist/esm/limel-shortcut.entry.js +1 -1
  152. package/dist/esm/limel-slider.entry.js +2 -2
  153. package/dist/esm/limel-snackbar.entry.js +2 -2
  154. package/dist/esm/limel-split-button.entry.js +1 -1
  155. package/dist/esm/limel-switch.entry.js +2 -2
  156. package/dist/esm/limel-tab-bar.entry.js +2 -2
  157. package/dist/esm/limel-tab-panel.entry.js +1 -1
  158. package/dist/esm/limel-table.entry.js +2 -2
  159. package/dist/esm/limel-text-editor.entry.js +1 -1
  160. package/dist/esm/loader.js +2 -2
  161. package/dist/lime-elements/lime-elements.css +2 -2
  162. package/dist/lime-elements/lime-elements.esm.js +1 -1
  163. package/dist/lime-elements/{p-f80d0b8b.entry.js → p-00859fac.entry.js} +1 -1
  164. package/dist/lime-elements/{p-6c51b3bd.entry.js → p-017dd326.entry.js} +1 -1
  165. package/dist/lime-elements/{p-a91b36d3.entry.js → p-045c6027.entry.js} +1 -1
  166. package/dist/lime-elements/{p-a0b6339c.entry.js → p-083b24bb.entry.js} +1 -1
  167. package/dist/lime-elements/{p-0d1c887c.entry.js → p-11f716f5.entry.js} +1 -1
  168. package/dist/lime-elements/{p-72489a91.entry.js → p-1e5b18cc.entry.js} +1 -1
  169. package/dist/lime-elements/{p-ce8be001.entry.js → p-23f7956e.entry.js} +1 -1
  170. package/dist/lime-elements/{p-7a47ecdc.entry.js → p-264f791d.entry.js} +1 -1
  171. package/dist/lime-elements/{p-690b9cf4.entry.js → p-2a5b259e.entry.js} +1 -1
  172. package/dist/lime-elements/{p-b857f209.entry.js → p-2c1538f0.entry.js} +1 -1
  173. package/dist/lime-elements/{p-48eb1ff2.entry.js → p-303d01e5.entry.js} +1 -1
  174. package/dist/lime-elements/{p-8850374d.entry.js → p-34ef71f2.entry.js} +1 -1
  175. package/dist/lime-elements/{p-3aa32860.entry.js → p-38fb97fe.entry.js} +1 -1
  176. package/dist/lime-elements/{p-ed20f52d.entry.js → p-3c933811.entry.js} +1 -1
  177. package/dist/lime-elements/{p-6abc7ed8.entry.js → p-478d225c.entry.js} +1 -1
  178. package/dist/lime-elements/{p-93c9b561.entry.js → p-4be18a57.entry.js} +1 -1
  179. package/dist/lime-elements/{p-be4e99b4.entry.js → p-52bb74b9.entry.js} +1 -1
  180. package/dist/lime-elements/{p-70450a21.entry.js → p-52edfe86.entry.js} +1 -1
  181. package/dist/lime-elements/{p-846a1d26.entry.js → p-534fdf9b.entry.js} +1 -1
  182. package/dist/lime-elements/{p-94c76e12.entry.js → p-5536e886.entry.js} +1 -1
  183. package/dist/lime-elements/{p-69fec8b9.entry.js → p-5d5f0a73.entry.js} +1 -1
  184. package/dist/lime-elements/{p-8c631f1e.entry.js → p-5ddeb498.entry.js} +1 -1
  185. package/dist/lime-elements/{p-7f50dd29.entry.js → p-6275668f.entry.js} +1 -1
  186. package/dist/lime-elements/{p-c127acfd.entry.js → p-6896d5c8.entry.js} +1 -1
  187. package/dist/lime-elements/{p-903c0e45.entry.js → p-68f49d6f.entry.js} +1 -1
  188. package/dist/lime-elements/p-693cbb67.entry.js +1 -0
  189. package/dist/lime-elements/{p-ea6204d1.entry.js → p-6951136b.entry.js} +1 -1
  190. package/dist/lime-elements/{p-a0ddf68a.entry.js → p-6aebcf60.entry.js} +1 -1
  191. package/dist/lime-elements/{p-638642a0.entry.js → p-6e3666e5.entry.js} +1 -1
  192. package/dist/lime-elements/{p-1f78b29b.entry.js → p-7457bc07.entry.js} +1 -1
  193. package/dist/lime-elements/{p-88519938.entry.js → p-7464e43d.entry.js} +1 -1
  194. package/dist/lime-elements/p-74fbf987.entry.js +1 -0
  195. package/dist/lime-elements/{p-ce82000d.entry.js → p-752df4bf.entry.js} +1 -1
  196. package/dist/lime-elements/p-7c37a99e.entry.js +1 -0
  197. package/dist/lime-elements/{p-8ba65d1b.entry.js → p-7d5bd4a2.entry.js} +1 -1
  198. package/dist/lime-elements/{p-df0892cd.entry.js → p-80d35f8f.entry.js} +1 -1
  199. package/dist/lime-elements/p-880b9683.entry.js +23 -0
  200. package/dist/lime-elements/{p-e50a1d0b.entry.js → p-88f503eb.entry.js} +1 -1
  201. package/dist/lime-elements/{p-99a9abf7.entry.js → p-8a2b2fac.entry.js} +1 -1
  202. package/dist/lime-elements/{p-9c80e222.entry.js → p-8db6b7d9.entry.js} +2 -2
  203. package/dist/lime-elements/{p-5028a09d.entry.js → p-927622ec.entry.js} +1 -1
  204. package/dist/lime-elements/{p-5054a30b.entry.js → p-9a8d6440.entry.js} +1 -1
  205. package/dist/lime-elements/{p-90688692.entry.js → p-9ea564fe.entry.js} +2 -2
  206. package/dist/lime-elements/{p-d22e07f0.entry.js → p-9ed578ec.entry.js} +1 -1
  207. package/dist/lime-elements/{p-ngNtOjhe.js → p-BlsZTyGA.js} +1 -1
  208. package/dist/lime-elements/p-a6fae24d.entry.js +1 -0
  209. package/dist/lime-elements/{p-ddc25dd2.entry.js → p-abef62d7.entry.js} +1 -1
  210. package/dist/lime-elements/{p-e33c71b7.entry.js → p-aea52308.entry.js} +1 -1
  211. package/dist/lime-elements/{p-773a37c0.entry.js → p-bbaf35ce.entry.js} +1 -1
  212. package/dist/lime-elements/{p-e77059f2.entry.js → p-c118eac0.entry.js} +1 -1
  213. package/dist/lime-elements/{p-5cddb3df.entry.js → p-c9e934af.entry.js} +1 -1
  214. package/dist/lime-elements/{p-10900b3f.entry.js → p-cbb7d624.entry.js} +1 -1
  215. package/dist/lime-elements/p-d1fa6da3.entry.js +67 -0
  216. package/dist/lime-elements/{p-2b0cfd52.entry.js → p-d2123236.entry.js} +1 -1
  217. package/dist/lime-elements/p-d424688d.entry.js +1 -0
  218. package/dist/lime-elements/{p-1c97671b.entry.js → p-d6270e4a.entry.js} +1 -1
  219. package/dist/lime-elements/p-dd36d57b.entry.js +203 -0
  220. package/dist/lime-elements/p-e11c9b40.entry.js +1 -0
  221. package/dist/lime-elements/{p-23ef08cc.entry.js → p-e1656821.entry.js} +2 -2
  222. package/dist/lime-elements/p-e6d74062.entry.js +1 -0
  223. package/dist/lime-elements/{p-70ea6855.entry.js → p-ec42a4aa.entry.js} +1 -1
  224. package/dist/lime-elements/{p-2b1f729d.entry.js → p-f395fbe3.entry.js} +1 -1
  225. package/dist/lime-elements/{p-170fd367.entry.js → p-fc3209db.entry.js} +1 -1
  226. package/dist/lime-elements/p-feeae1e4.entry.js +1 -0
  227. package/dist/lime-elements/{p-BudcI_o9.js → p-xvTBZcD2.js} +1 -1
  228. package/dist/lime-elements/style/color-palette-primary.scss.bak +1 -1
  229. package/dist/lime-elements/style/color-palette-ui.scss.bak +1 -1
  230. package/dist/lime-elements/style/internal/fieldset.scss +2 -2
  231. package/package.json +1 -1
  232. package/dist/lime-elements/p-1691e794.entry.js +0 -1
  233. package/dist/lime-elements/p-1db54640.entry.js +0 -1
  234. package/dist/lime-elements/p-45304b5c.entry.js +0 -23
  235. package/dist/lime-elements/p-4ab87bae.entry.js +0 -1
  236. package/dist/lime-elements/p-7203e289.entry.js +0 -203
  237. package/dist/lime-elements/p-8408a45f.entry.js +0 -1
  238. package/dist/lime-elements/p-c18a8a9f.entry.js +0 -1
  239. package/dist/lime-elements/p-d73c300f.entry.js +0 -1
  240. package/dist/lime-elements/p-da63420d.entry.js +0 -67
  241. package/dist/lime-elements/p-de541d0f.entry.js +0 -1
  242. package/dist/lime-elements/p-e6e65d9d.entry.js +0 -1
@@ -1 +1 @@
1
- import{r,c as t,h as e,H as n,a as i}from"./p-BudcI_o9.js";import{c as o}from"./p-JbKhhoXs.js";import{g as a}from"./p-BFTU3MAI.js";import{t as u}from"./p-6rJPElLH.js";var l,s={exports:{}};function c(){return l||(l=1,s.exports=function(){var r=navigator.userAgent,t=navigator.platform,e=/gecko\/\d/i.test(r),n=/MSIE \d/.test(r),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),o=/Edge\/(\d+)/.exec(r),a=n||i||o,u=a&&(n?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(r),s=l&&/Qt\/\d+\.\d+/.test(r),c=!o&&/Chrome\/(\d+)/.exec(r),f=c&&+c[1],d=/Opera\//.test(r),h=/Apple Computer/.test(navigator.vendor),v=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),m=/PhantomJS/.test(r),p=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),g=/Android/.test(r),b=p||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),w=p||/Mac/.test(t),k=/\bCrOS\b/.test(r),y=/win/i.test(t),x=d&&r.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var C=w&&(s||d&&(null==x||x<12.11)),M=e||a&&u>=9;function A(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L,S=function(r,t){var e=r.className,n=A(t).exec(e);if(n){var i=e.slice(n.index+n[0].length);r.className=e.slice(0,n.index)+(i?n[1]+i:"")}};function T(r){for(var t=r.childNodes.length;t>0;--t)r.removeChild(r.firstChild);return r}function N(r,t){return T(r).appendChild(t)}function E(r,t,e,n){var i=document.createElement(r);if(e&&(i.className=e),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function D(r,t,e,n){var i=E(r,t,e,n);return i.setAttribute("role","presentation"),i}function z(r,t){if(3==t.nodeType&&(t=t.parentNode),r.contains)return r.contains(t);do{if(11==t.nodeType&&(t=t.host),t==r)return!0}while(t=t.parentNode)}function j(r){var t;try{t=r.activeElement}catch(e){t=r.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function B(r,t){var e=r.className;A(t).test(e)||(r.className+=(e?" ":"")+t)}function I(r,t){for(var e=r.split(" "),n=0;n<e.length;n++)e[n]&&!A(e[n]).test(t)&&(t+=" "+e[n]);return t}L=document.createRange?function(r,t,e,n){var i=document.createRange();return i.setEnd(n||r,e),i.setStart(r,t),i}:function(r,t,e){var n=document.body.createTextRange();try{n.moveToElementText(r.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",e),n.moveStart("character",t),n};var R=function(r){r.select()};function F(r){return r.display.wrapper.ownerDocument}function O(r){return F(r).defaultView}function U(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function _(r,t,e){for(var n in t||(t={}),r)!r.hasOwnProperty(n)||!1===e&&t.hasOwnProperty(n)||(t[n]=r[n]);return t}function P(r,t,e,n,i){null==t&&-1==(t=r.search(/[^\s\u00a0]/))&&(t=r.length);for(var o=n||0,a=i||0;;){var u=r.indexOf("\t",o);if(u<0||u>=t)return a+(t-o);a+=u-o,a+=e-a%e,o=u+1}}p?R=function(r){r.selectionStart=0,r.selectionEnd=r.value.length}:a&&(R=function(r){try{r.select()}catch(r){}});var q=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};function W(r,t){for(var e=0;e<r.length;++e)if(r[e]==t)return e;return-1}q.prototype.onTimeout=function(r){r.id=0,r.time<=+new Date?r.f():setTimeout(r.handler,r.time-+new Date)},q.prototype.set=function(r,t){this.f=t;var e=+new Date+r;(!this.id||e<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,r),this.time=e)};var $={toString:function(){return"CodeMirror.Pass"}},G={scroll:!1},H={origin:"*mouse"},K={origin:"+move"};function V(r,t,e){for(var n=0,i=0;;){var o=r.indexOf("\t",n);-1==o&&(o=r.length);var a=o-n;if(o==r.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=e-i%e)>=t)return n}}var Q=[""];function J(r){for(;Q.length<=r;)Q.push(Y(Q)+" ");return Q[r]}function Y(r){return r[r.length-1]}function X(r,t){for(var e=[],n=0;n<r.length;n++)e[n]=t(r[n],n);return e}function Z(){}function rr(r,t){var e;return Object.create?e=Object.create(r):(Z.prototype=r,e=new Z),t&&_(t,e),e}var tr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function er(r){return/\w/.test(r)||r>"€"&&(r.toUpperCase()!=r.toLowerCase()||tr.test(r))}function nr(r,t){return t?!!(t.source.indexOf("\\w")>-1&&er(r))||t.test(r):er(r)}function ir(r){for(var t in r)if(r.hasOwnProperty(t)&&r[t])return!1;return!0}var or=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ar(r){return r.charCodeAt(0)>=768&&or.test(r)}function ur(r,t,e){for(;(e<0?t>0:t<r.length)&&ar(r.charAt(t));)t+=e;return t}function lr(r,t,e){for(var n=t>e?-1:1;;){if(t==e)return t;var i=(t+e)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return r(o)?t:e;r(o)?e=o:t=o+n}}var sr=null;function cr(r,t,e){var n;sr=null;for(var i=0;i<r.length;++i){var o=r[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==e?n=i:sr=i),o.from==t&&(o.from!=o.to&&"before"!=e?n=i:sr=i)}return null!=n?n:sr}var fr=function(){var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,e=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(r,t,e){this.level=r,this.from=t,this.to=e}return function(a,u){var l,s="ltr"==u?"L":"R";if(0==a.length||"ltr"==u&&!r.test(a))return!1;for(var c=a.length,f=[],d=0;d<c;++d)f.push((l=a.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(l):1424<=l&&l<=1524?"R":1536<=l&&l<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(l-1536):1774<=l&&l<=2220?"r":8192<=l&&l<=8203?"w":8204==l?"b":"L");for(var h=0,v=s;h<c;++h){var m=f[h];"m"==m?f[h]=v:v=m}for(var p=0,g=s;p<c;++p){var b=f[p];"1"==b&&"r"==g?f[p]="n":e.test(b)&&(g=b,"r"==b&&(f[p]="R"))}for(var w=1,k=f[0];w<c-1;++w){var y=f[w];"+"==y&&"1"==k&&"1"==f[w+1]?f[w]="1":","!=y||k!=f[w+1]||"1"!=k&&"n"!=k||(f[w]=k),k=y}for(var x=0;x<c;++x){var C=f[x];if(","==C)f[x]="N";else if("%"==C){var M=void 0;for(M=x+1;M<c&&"%"==f[M];++M);for(var A=x&&"!"==f[x-1]||M<c&&"1"==f[M]?"1":"N",L=x;L<M;++L)f[L]=A;x=M-1}}for(var S=0,T=s;S<c;++S){var N=f[S];"L"==T&&"1"==N?f[S]="L":e.test(N)&&(T=N)}for(var E=0;E<c;++E)if(t.test(f[E])){var D=void 0;for(D=E+1;D<c&&t.test(f[D]);++D);for(var z="L"==(E?f[E-1]:s),j=z==("L"==(D<c?f[D]:s))?z?"L":"R":s,B=E;B<D;++B)f[B]=j;E=D-1}for(var I,R=[],F=0;F<c;)if(n.test(f[F])){var O=F;for(++F;F<c&&n.test(f[F]);++F);R.push(new o(0,O,F))}else{var U=F,_=R.length,P="rtl"==u?1:0;for(++F;F<c&&"L"!=f[F];++F);for(var q=U;q<F;)if(i.test(f[q])){U<q&&(R.splice(_,0,new o(1,U,q)),_+=P);var W=q;for(++q;q<F&&i.test(f[q]);++q);R.splice(_,0,new o(2,W,q)),_+=P,U=q}else++q;U<F&&R.splice(_,0,new o(1,U,F))}return"ltr"==u&&(1==R[0].level&&(I=a.match(/^\s+/))&&(R[0].from=I[0].length,R.unshift(new o(0,0,I[0].length))),1==Y(R).level&&(I=a.match(/\s+$/))&&(Y(R).to-=I[0].length,R.push(new o(0,c-I[0].length,c)))),"rtl"==u?R.reverse():R}}();function dr(r,t){var e=r.order;return null==e&&(e=r.order=fr(r.text,t)),e}var hr=[],vr=function(r,t,e){if(r.addEventListener)r.addEventListener(t,e,!1);else if(r.attachEvent)r.attachEvent("on"+t,e);else{var n=r._handlers||(r._handlers={});n[t]=(n[t]||hr).concat(e)}};function mr(r,t){return r._handlers&&r._handlers[t]||hr}function pr(r,t,e){if(r.removeEventListener)r.removeEventListener(t,e,!1);else if(r.detachEvent)r.detachEvent("on"+t,e);else{var n=r._handlers,i=n&&n[t];if(i){var o=W(i,e);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function gr(r,t){var e=mr(r,t);if(e.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<e.length;++i)e[i].apply(null,n)}function br(r,t,e){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),gr(r,e||t.type,r,t),Mr(t)||t.codemirrorIgnore}function wr(r){var t=r._handlers&&r._handlers.cursorActivity;if(t)for(var e=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==W(e,t[n])&&e.push(t[n])}function kr(r,t){return mr(r,t).length>0}function yr(r){r.prototype.on=function(r,t){vr(this,r,t)},r.prototype.off=function(r,t){pr(this,r,t)}}function xr(r){r.preventDefault?r.preventDefault():r.returnValue=!1}function Cr(r){r.stopPropagation?r.stopPropagation():r.cancelBubble=!0}function Mr(r){return null!=r.defaultPrevented?r.defaultPrevented:0==r.returnValue}function Ar(r){xr(r),Cr(r)}function Lr(r){return r.target||r.srcElement}function Sr(r){var t=r.which;return null==t&&(1&r.button?t=1:2&r.button?t=3:4&r.button&&(t=2)),w&&r.ctrlKey&&1==t&&(t=3),t}var Tr,Nr,Er=function(){if(a&&u<9)return!1;var r=E("div");return"draggable"in r||"dragDrop"in r}();function Dr(r){if(null==Tr){var t=E("span","​");N(r,E("span",[t,document.createTextNode("x")])),0!=r.firstChild.offsetHeight&&(Tr=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&u<8))}var e=Tr?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return e.setAttribute("cm-text",""),e}function zr(r){if(null!=Nr)return Nr;var t=N(r,document.createTextNode("AخA")),e=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return T(r),!(!e||e.left==e.right)&&(Nr=n.right-e.right<3)}var jr,Br=3!="\n\nb".split(/\n/).length?function(r){for(var t=0,e=[],n=r.length;t<=n;){var i=r.indexOf("\n",t);-1==i&&(i=r.length);var o=r.slice(t,"\r"==r.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(e.push(o.slice(0,a)),t+=a+1):(e.push(o),t=i+1)}return e}:function(r){return r.split(/\r\n?|\n/)},Ir=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return!1}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}return!(!t||t.parentElement()!=r)&&0!=t.compareEndPoints("StartToEnd",t)},Rr="oncopy"in(jr=E("div"))||(jr.setAttribute("oncopy","return;"),"function"==typeof jr.oncopy),Fr=null;var Or={},Ur={};function _r(r,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Or[r]=t}function Pr(r){if("string"==typeof r&&Ur.hasOwnProperty(r))r=Ur[r];else if(r&&"string"==typeof r.name&&Ur.hasOwnProperty(r.name)){var t=Ur[r.name];"string"==typeof t&&(t={name:t}),(r=rr(t,r)).name=t.name}else{if("string"==typeof r&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r))return Pr("application/xml");if("string"==typeof r&&/^[\w\-]+\/[\w\-]+\+json$/.test(r))return Pr("application/json")}return"string"==typeof r?{name:r}:r||{name:"null"}}function qr(r,t){t=Pr(t);var e=Or[t.name];if(!e)return qr(r,"text/plain");var n=e(r,t);if(Wr.hasOwnProperty(t.name)){var i=Wr[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Wr={};function $r(r,t){_(t,Wr.hasOwnProperty(r)?Wr[r]:Wr[r]={})}function Gr(r,t){if(!0===t)return t;if(r.copyState)return r.copyState(t);var e={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),e[n]=i}return e}function Hr(r,t){for(var e;r.innerMode&&(e=r.innerMode(t))&&e.mode!=r;)t=e.state,r=e.mode;return e||{mode:r,state:t}}function Kr(r,t,e){return!r.startState||r.startState(t,e)}var Vr=function(r,t,e){this.pos=this.start=0,this.string=r,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=e};function Qr(r,t){if((t-=r.first)<0||t>=r.size)throw new Error("There is no line "+(t+r.first)+" in the document.");for(var e=r;!e.lines;)for(var n=0;;++n){var i=e.children[n],o=i.chunkSize();if(t<o){e=i;break}t-=o}return e.lines[t]}function Jr(r,t,e){var n=[],i=t.line;return r.iter(t.line,e.line+1,(function(r){var o=r.text;i==e.line&&(o=o.slice(0,e.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function Yr(r,t,e){var n=[];return r.iter(t,e,(function(r){n.push(r.text)})),n}function Xr(r,t){var e=t-r.height;if(e)for(var n=r;n;n=n.parent)n.height+=e}function Zr(r){if(null==r.parent)return null;for(var t=r.parent,e=W(t.lines,r),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)e+=n.children[i].chunkSize();return e+t.first}function rt(r,t){var e=r.first;r:do{for(var n=0;n<r.children.length;++n){var i=r.children[n],o=i.height;if(t<o){r=i;continue r}t-=o,e+=i.chunkSize()}return e}while(!r.lines);for(var a=0;a<r.lines.length;++a){var u=r.lines[a].height;if(t<u)break;t-=u}return e+a}function tt(r,t){return t>=r.first&&t<r.first+r.size}function et(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function nt(r,t,e){if(void 0===e&&(e=null),!(this instanceof nt))return new nt(r,t,e);this.line=r,this.ch=t,this.sticky=e}function it(r,t){return r.line-t.line||r.ch-t.ch}function ot(r,t){return r.sticky==t.sticky&&0==it(r,t)}function at(r){return nt(r.line,r.ch)}function ut(r,t){return it(r,t)<0?t:r}function lt(r,t){return it(r,t)<0?r:t}function st(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function ct(r,t){if(t.line<r.first)return nt(r.first,0);var e=r.first+r.size-1;return t.line>e?nt(e,Qr(r,e).text.length):function(r,t){var e=r.ch;return null==e||e>t?nt(r.line,t):e<0?nt(r.line,0):r}(t,Qr(r,t.line).text.length)}function ft(r,t){for(var e=[],n=0;n<t.length;n++)e[n]=ct(r,t[n]);return e}Vr.prototype.eol=function(){return this.pos>=this.string.length},Vr.prototype.sol=function(){return this.pos==this.lineStart},Vr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vr.prototype.eat=function(r){var t=this.string.charAt(this.pos);if("string"==typeof r?t==r:t&&(r.test?r.test(t):r(t)))return++this.pos,t},Vr.prototype.eatWhile=function(r){for(var t=this.pos;this.eat(r););return this.pos>t},Vr.prototype.eatSpace=function(){for(var r=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>r},Vr.prototype.skipToEnd=function(){this.pos=this.string.length},Vr.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1)return this.pos=t,!0},Vr.prototype.backUp=function(r){this.pos-=r},Vr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Vr.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Vr.prototype.match=function(r,t,e){if("string"!=typeof r){var n=this.string.slice(this.pos).match(r);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(r){return e?r.toLowerCase():r};if(i(this.string.substr(this.pos,r.length))==i(r))return!1!==t&&(this.pos+=r.length),!0},Vr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vr.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}},Vr.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)},Vr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};var dt=function(r,t){this.state=r,this.lookAhead=t},ht=function(r,t,e,n){this.state=t,this.doc=r,this.line=e,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function vt(r,t,e,n){var i=[r.state.modeGen],o={};Ct(r,t.text,r.doc.mode,e,(function(r,t){return i.push(r,t)}),o,n);for(var a=e.state,u=function(n){e.baseTokens=i;var u=r.state.overlays[n],l=1,s=0;e.state=!0,Ct(r,t.text,u.mode,e,(function(r,t){for(var e=l;s<r;){var n=i[l];n>r&&i.splice(l,1,r,i[l+1],n),l+=2,s=Math.min(r,n)}if(t)if(u.opaque)i.splice(e,l-e,r,"overlay "+t),l=e+2;else for(;e<l;e+=2){var o=i[e+1];i[e+1]=(o?o+" ":"")+"overlay "+t}}),o),e.state=a,e.baseTokens=null,e.baseTokenPos=1},l=0;l<r.state.overlays.length;++l)u(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mt(r,t,e){if(!t.styles||t.styles[0]!=r.state.modeGen){var n=pt(r,Zr(t)),i=t.text.length>r.options.maxHighlightLength&&Gr(r.doc.mode,n.state),o=vt(r,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),e===r.doc.highlightFrontier&&(r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier))}return t.styles}function pt(r,t,e){var n=r.doc,i=r.display;if(!n.mode.startState)return new ht(n,!0,t);var o=function(r,t,e){for(var n,i,o=r.doc,a=e?-1:t-(r.doc.mode.innerMode?1e3:100),u=t;u>a;--u){if(u<=o.first)return o.first;var l=Qr(o,u-1),s=l.stateAfter;if(s&&(!e||u+(s instanceof dt?s.lookAhead:0)<=o.modeFrontier))return u;var c=P(l.text,null,r.options.tabSize);(null==i||n>c)&&(i=u-1,n=c)}return i}(r,t,e),a=o>n.first&&Qr(n,o-1).stateAfter,u=a?ht.fromSaved(n,a,o):new ht(n,Kr(n.mode),o);return n.iter(o,t,(function(e){gt(r,e.text,u);var n=u.line;e.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?u.save():null,u.nextLine()})),e&&(n.modeFrontier=u.line),u}function gt(r,t,e,n){var i=r.doc.mode,o=new Vr(t,r.options.tabSize,e);for(o.start=o.pos=n||0,""==t&&bt(i,e.state);!o.eol();)wt(i,o,e.state),o.start=o.pos}function bt(r,t){if(r.blankLine)return r.blankLine(t);if(r.innerMode){var e=Hr(r,t);return e.mode.blankLine?e.mode.blankLine(e.state):void 0}}function wt(r,t,e,n){for(var i=0;i<10;i++){n&&(n[0]=Hr(r,e).mode);var o=r.token(t,e);if(t.pos>t.start)return o}throw new Error("Mode "+r.name+" failed to advance stream.")}ht.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);return null!=t&&r>this.maxLookAhead&&(this.maxLookAhead=r),t},ht.prototype.baseToken=function(r){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=r;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}},ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ht.fromSaved=function(r,t,e){return t instanceof dt?new ht(r,Gr(r.mode,t.state),e,t.lookAhead):new ht(r,Gr(r.mode,t),e)},ht.prototype.save=function(r){var t=!1!==r?Gr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new dt(t,this.maxLookAhead):t};var kt=function(r,t,e){this.start=r.start,this.end=r.pos,this.string=r.current(),this.type=t||null,this.state=e};function yt(r,t,e,n){var i,o,a=r.doc,u=a.mode,l=Qr(a,(t=ct(a,t)).line),s=pt(r,t.line,e),c=new Vr(l.text,r.options.tabSize,s);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=wt(u,c,s.state),n&&o.push(new kt(c,i,Gr(a.mode,s.state)));return n?o:new kt(c,i,s.state)}function xt(r,t){if(r)for(;;){var e=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!e)break;r=r.slice(0,e.index)+r.slice(e.index+e[0].length);var n=e[1]?"bgClass":"textClass";null==t[n]?t[n]=e[2]:new RegExp("(?:^|\\s)"+e[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+e[2])}return r}function Ct(r,t,e,n,i,o,a){var u=e.flattenSpans;null==u&&(u=r.options.flattenSpans);var l,s=0,c=null,f=new Vr(t,r.options.tabSize,n),d=r.options.addModeClass&&[null];for(""==t&&xt(bt(e,n.state),o);!f.eol();){if(f.pos>r.options.maxHighlightLength?(u=!1,a&&gt(r,t,n,f.pos),f.pos=t.length,l=null):l=xt(wt(e,f,n.state,d),o),d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!u||c!=l){for(;s<f.start;)i(s=Math.min(f.start,s+5e3),c);c=l}f.start=f.pos}for(;s<f.pos;){var v=Math.min(f.pos,s+5e3);i(v,c),s=v}}var Mt=!1,At=!1;function Lt(r,t,e){this.marker=r,this.from=t,this.to=e}function St(r,t){if(r)for(var e=0;e<r.length;++e){var n=r[e];if(n.marker==t)return n}}function Tt(r,t){for(var e,n=0;n<r.length;++n)r[n]!=t&&(e||(e=[])).push(r[n]);return e}function Nt(r,t){if(t.full)return null;var e=tt(r,t.from.line)&&Qr(r,t.from.line).markedSpans,n=tt(r,t.to.line)&&Qr(r,t.to.line).markedSpans;if(!e&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==it(t.from,t.to),u=function(r,t,e){var n;if(r)for(var i=0;i<r.length;++i){var o=r[i],a=o.marker;null!=o.from&&!(a.inclusiveLeft?o.from<=t:o.from<t)&&(o.from!=t||"bookmark"!=a.type||e&&o.marker.insertLeft)||(n||(n=[])).push(new Lt(a,o.from,null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)?null:o.to))}return n}(e,i,a),l=function(r,t,e){var n;if(r)for(var i=0;i<r.length;++i){var o=r[i],a=o.marker;(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!e||o.marker.insertLeft))&&(n||(n=[])).push(new Lt(a,null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)?null:o.from-t,null==o.to?null:o.to-t))}return n}(n,o,a),s=1==t.text.length,c=Y(t.text).length+(s?i:0);if(u)for(var f=0;f<u.length;++f){var d=u[f];if(null==d.to){var h=St(l,d.marker);h?s&&(d.to=null==h.to?null:h.to+c):d.to=i}}if(l)for(var v=0;v<l.length;++v){var m=l[v];null!=m.to&&(m.to+=c),null==m.from?St(u,m.marker)||(m.from=c,s&&(u||(u=[])).push(m)):(m.from+=c,s&&(u||(u=[])).push(m))}u&&(u=Et(u)),l&&l!=u&&(l=Et(l));var p=[u];if(!s){var g,b=t.text.length-2;if(b>0&&u)for(var w=0;w<u.length;++w)null==u[w].to&&(g||(g=[])).push(new Lt(u[w].marker,null,null));for(var k=0;k<b;++k)p.push(g);p.push(l)}return p}function Et(r){for(var t=0;t<r.length;++t){var e=r[t];null!=e.from&&e.from==e.to&&!1!==e.marker.clearWhenEmpty&&r.splice(t--,1)}return r.length?r:null}function Dt(r){var t=r.markedSpans;if(t){for(var e=0;e<t.length;++e)t[e].marker.detachLine(r);r.markedSpans=null}}function zt(r,t){if(t){for(var e=0;e<t.length;++e)t[e].marker.attachLine(r);r.markedSpans=t}}function jt(r){return r.inclusiveLeft?-1:0}function Bt(r){return r.inclusiveRight?1:0}function It(r,t){var e=r.lines.length-t.lines.length;if(0!=e)return e;var n=r.find(),i=t.find(),o=it(n.from,i.from)||jt(r)-jt(t);return o?-o:it(n.to,i.to)||Bt(r)-Bt(t)||t.id-r.id}function Rt(r,t){var e,n=At&&r.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!e||It(e,i.marker)<0)&&(e=i.marker);return e}function Ft(r){return Rt(r,!0)}function Ot(r){return Rt(r,!1)}function Ut(r,t){var e,n=At&&r.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!e||It(e,o.marker)<0)&&(e=o.marker)}return e}function _t(r,t,e,n,i){var o=Qr(r,t),a=At&&o.markedSpans;if(a)for(var u=0;u<a.length;++u){var l=a[u];if(l.marker.collapsed){var s=l.marker.find(0),c=it(s.from,e)||jt(l.marker)-jt(i),f=it(s.to,n)||Bt(l.marker)-Bt(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?it(s.to,e)>=0:it(s.to,e)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?it(s.from,n)<=0:it(s.from,n)<0)))return!0}}}function Pt(r){for(var t;t=Ft(r);)r=t.find(-1,!0).line;return r}function qt(r,t){var e=Qr(r,t),n=Pt(e);return e==n?t:Zr(n)}function Wt(r,t){if(t>r.lastLine())return t;var e,n=Qr(r,t);if(!$t(r,n))return t;for(;e=Ot(n);)n=e.find(1,!0).line;return Zr(n)+1}function $t(r,t){var e=At&&t.markedSpans;if(e)for(var n=void 0,i=0;i<e.length;++i)if((n=e[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Gt(r,t,n))return!0}}function Gt(r,t,e){if(null==e.to){var n=e.marker.find(1,!0);return Gt(r,n.line,St(n.line.markedSpans,e.marker))}if(e.marker.inclusiveRight&&e.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==e.to&&(null==i.to||i.to!=e.from)&&(i.marker.inclusiveLeft||e.marker.inclusiveRight)&&Gt(r,t,i))return!0}function Ht(r){for(var t=0,e=(r=Pt(r)).parent,n=0;n<e.lines.length;++n){var i=e.lines[n];if(i==r)break;t+=i.height}for(var o=e.parent;o;o=(e=o).parent)for(var a=0;a<o.children.length;++a){var u=o.children[a];if(u==e)break;t+=u.height}return t}function Kt(r){if(0==r.height)return 0;for(var t,e=r.text.length,n=r;t=Ft(n);){var i=t.find(0,!0);n=i.from.line,e+=i.from.ch-i.to.ch}for(n=r;t=Ot(n);){var o=t.find(0,!0);e-=n.text.length-o.from.ch,e+=(n=o.to.line).text.length-o.to.ch}return e}function Vt(r){var t=r.display,e=r.doc;t.maxLine=Qr(e,e.first),t.maxLineLength=Kt(t.maxLine),t.maxLineChanged=!0,e.iter((function(r){var e=Kt(r);e>t.maxLineLength&&(t.maxLineLength=e,t.maxLine=r)}))}var Qt=function(r,t,e){this.text=r,zt(this,t),this.height=e?e(this):1};function Jt(r){r.parent=null,Dt(r)}Qt.prototype.lineNo=function(){return Zr(this)},yr(Qt);var Yt={},Xt={};function Zt(r,t){if(!r||/^\s*$/.test(r))return null;var e=t.addModeClass?Xt:Yt;return e[r]||(e[r]=r.replace(/\S+/g,"cm-$&"))}function re(r,t){var e=D("span",null,null,l?"padding-right: .1px":null),n={pre:D("pre",[e],"CodeMirror-line"),content:e,col:0,pos:0,cm:r,trailingSpace:!1,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=ee,zr(r.display.measure)&&(a=dr(o,r.doc.direction))&&(n.addToken=ne(n.addToken,a)),n.map=[],oe(o,n,mt(r,o,t!=r.display.externalMeasured&&Zr(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=I(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=I(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Dr(r.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return gr(r,"renderLine",r,t.line,n.pre),n.pre.className&&(n.textClass=I(n.pre.className,n.textClass||"")),n}function te(r){var t=E("span","•","cm-invalidchar");return t.title="\\u"+r.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ee(r,t,e,n,i,o,l){if(t){var s,c=r.splitSpaces?function(r,t){if(r.length>1&&!/ /.test(r))return r;for(var e=t,n="",i=0;i<r.length;i++){var o=r.charAt(i);" "!=o||!e||i!=r.length-1&&32!=r.charCodeAt(i+1)||(o=" "),n+=o,e=" "==o}return n}(t,r.trailingSpace):t,f=r.cm.state.specialChars,d=!1;if(f.test(t)){s=document.createDocumentFragment();for(var h=0;;){f.lastIndex=h;var v=f.exec(t),m=v?v.index-h:t.length-h;if(m){var p=document.createTextNode(c.slice(h,h+m));s.appendChild(a&&u<9?E("span",[p]):p),r.map.push(r.pos,r.pos+m,p),r.col+=m,r.pos+=m}if(!v)break;h+=m+1;var g=void 0;if("\t"==v[0]){var b=r.cm.options.tabSize,w=b-r.col%b;(g=s.appendChild(E("span",J(w),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),r.col+=w}else"\r"==v[0]||"\n"==v[0]?((g=s.appendChild(E("span","\r"==v[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",v[0]),r.col+=1):((g=r.cm.options.specialCharPlaceholder(v[0])).setAttribute("cm-text",v[0]),s.appendChild(a&&u<9?E("span",[g]):g),r.col+=1);r.map.push(r.pos,r.pos+1,g),r.pos++}}else r.col+=t.length,s=document.createTextNode(c),r.map.push(r.pos,r.pos+t.length,s),a&&u<9&&(d=!0),r.pos+=t.length;if(r.trailingSpace=32==c.charCodeAt(t.length-1),e||n||i||d||o||l){var k=e||"";n&&(k+=n),i&&(k+=i);var y=E("span",[s],k,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&y.setAttribute(x,l[x]);return r.content.appendChild(y)}r.content.appendChild(s)}}function ne(r,t){return function(e,n,i,o,a,u,l){i=i?i+" cm-force-border":"cm-force-border";for(var s=e.pos,c=s+n.length;;){for(var f=void 0,d=0;d<t.length&&!((f=t[d]).to>s&&f.from<=s);d++);if(f.to>=c)return r(e,n,i,o,a,u,l);r(e,n.slice(0,f.to-s),i,o,null,u,l),o=null,n=n.slice(f.to-s),s=f.to}}}function ie(r,t,e,n){var i=!n&&e.widgetNode;i&&r.map.push(r.pos,r.pos+t,i),!n&&r.cm.display.input.needsContentAttribute&&(i||(i=r.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",e.id)),i&&(r.cm.display.input.setUneditable(i),r.content.appendChild(i)),r.pos+=t,r.trailingSpace=!1}function oe(r,t,e){var n=r.markedSpans,i=r.text,o=0;if(n)for(var a,u,l,s,c,f,d,h=i.length,v=0,m=1,p="",g=0;;){if(g==v){l=s=c=u="",d=null,f=null,g=1/0;for(var b=[],w=void 0,k=0;k<n.length;++k){var y=n[k],x=y.marker;if("bookmark"==x.type&&y.from==v&&x.widgetNode)b.push(x);else if(y.from<=v&&(null==y.to||y.to>v||x.collapsed&&y.to==v&&y.from==v)){if(null!=y.to&&y.to!=v&&g>y.to&&(g=y.to,s=""),x.className&&(l+=" "+x.className),x.css&&(u=(u?u+";":"")+x.css),x.startStyle&&y.from==v&&(c+=" "+x.startStyle),x.endStyle&&y.to==g&&(w||(w=[])).push(x.endStyle,y.to),x.title&&((d||(d={})).title=x.title),x.attributes)for(var C in x.attributes)(d||(d={}))[C]=x.attributes[C];x.collapsed&&(!f||It(f.marker,x)<0)&&(f=y)}else y.from>v&&g>y.from&&(g=y.from)}if(w)for(var M=0;M<w.length;M+=2)w[M+1]==g&&(s+=" "+w[M]);if(!f||f.from==v)for(var A=0;A<b.length;++A)ie(t,0,b[A]);if(f&&(f.from||0)==v){if(ie(t,(null==f.to?h+1:f.to)-v,f.marker,null==f.from),null==f.to)return;f.to==v&&(f=!1)}}if(v>=h)break;for(var L=Math.min(h,g);;){if(p){var S=v+p.length;if(!f){var T=S>L?p.slice(0,L-v):p;t.addToken(t,T,a?a+l:l,c,v+T.length==g?s:"",u,d)}if(S>=L){p=p.slice(L-v),v=L;break}v=S,c=""}p=i.slice(o,o=e[m++]),a=Zt(e[m++],t.cm.options)}}else for(var N=1;N<e.length;N+=2)t.addToken(t,i.slice(o,o=e[N]),Zt(e[N+1],t.cm.options))}function ae(r,t,e){this.line=t,this.rest=function(r){for(var t,e;t=Ot(r);)r=t.find(1,!0).line,(e||(e=[])).push(r);return e}(t),this.size=this.rest?Zr(Y(this.rest))-e+1:1,this.node=this.text=null,this.hidden=$t(r,t)}function ue(r,t,e){for(var n,i=[],o=t;o<e;o=n){var a=new ae(r.doc,Qr(r.doc,o),o);n=o+a.size,i.push(a)}return i}var le=null;var se=null;function ce(r,t){var e=mr(r,t);if(e.length){var n,i=Array.prototype.slice.call(arguments,2);le?n=le.delayedCallbacks:se?n=se:(n=se=[],setTimeout(fe,0));for(var o=function(r){n.push((function(){return e[r].apply(null,i)}))},a=0;a<e.length;++a)o(a)}}function fe(){var r=se;se=null;for(var t=0;t<r.length;++t)r[t]()}function de(r,t,e,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?me(r,t):"gutter"==o?ge(r,t,e,n):"class"==o?pe(r,t):"widget"==o&&be(r,t,n)}t.changes=null}function he(r){return r.node==r.text&&(r.node=E("div",null,null,"position: relative"),r.text.parentNode&&r.text.parentNode.replaceChild(r.node,r.text),r.node.appendChild(r.text),a&&u<8&&(r.node.style.zIndex=2)),r.node}function ve(r,t){var e=r.display.externalMeasured;return e&&e.line==t.line?(r.display.externalMeasured=null,t.measure=e.measure,e.built):re(r,t)}function me(r,t){var e=t.text.className,n=ve(r,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,pe(r,t)):e&&(t.text.className=e)}function pe(r,t){(function(r,t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(e&&(e+=" CodeMirror-linebackground"),t.background)e?t.background.className=e:(t.background.parentNode.removeChild(t.background),t.background=null);else if(e){var n=he(t);t.background=n.insertBefore(E("div",null,e),n.firstChild),r.display.input.setUneditable(t.background)}})(r,t),t.line.wrapClass?he(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=""),t.text.className=(t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass)||""}function ge(r,t,e,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=he(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),r.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var a=he(t),u=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(u.setAttribute("aria-hidden","true"),r.display.input.setUneditable(u),a.insertBefore(u,t.text),t.line.gutterClass&&(u.className+=" "+t.line.gutterClass),!r.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=u.appendChild(E("div",et(r.options,e),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<r.display.gutterSpecs.length;++l){var s=r.display.gutterSpecs[l].className,c=o.hasOwnProperty(s)&&o[s];c&&u.appendChild(E("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[s]+"px; width: "+n.gutterWidth[s]+"px"))}}}function be(r,t,e){t.alignable&&(t.alignable=null);for(var n=A("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);ke(r,t,e)}function we(r,t,e,n){var i=ve(r,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pe(r,t),ge(r,t,e,n),ke(r,t,n),t.node}function ke(r,t,e){if(ye(r,t.line,t,e,!0),t.rest)for(var n=0;n<t.rest.length;n++)ye(r,t.rest[n],t,e,!1)}function ye(r,t,e,n,i){if(t.widgets)for(var o=he(e),a=0,u=t.widgets;a<u.length;++a){var l=u[a],s=E("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||s.setAttribute("cm-ignore-events","true"),xe(l,s,e,n),r.display.input.setUneditable(s),i&&l.above?o.insertBefore(s,e.gutter||e.text):o.appendChild(s),ce(l,"redraw")}}function xe(r,t,e,n){if(r.noHScroll){(e.alignable||(e.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",r.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}r.coverGutter&&(t.style.zIndex=5,t.style.position="relative",r.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ce(r){if(null!=r.height)return r.height;var t=r.doc.cm;if(!t)return 0;if(!z(document.body,r.node)){var e="position: relative;";r.coverGutter&&(e+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),r.noHScroll&&(e+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,E("div",[r.node],null,e))}return r.height=r.node.parentNode.offsetHeight}function Me(r,t){for(var e=Lr(t);e!=r.wrapper;e=e.parentNode)if(!e||1==e.nodeType&&"true"==e.getAttribute("cm-ignore-events")||e.parentNode==r.sizer&&e!=r.mover)return!0}function Ae(r){return r.lineSpace.offsetTop}function Le(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Se(r){if(r.cachedPaddingH)return r.cachedPaddingH;var t=N(r.measure,E("pre","x","CodeMirror-line-like")),e=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(r.cachedPaddingH=n),n}function Te(r){return 50-r.display.nativeBarWidth}function Ne(r){return r.display.scroller.clientWidth-Te(r)-r.display.barWidth}function Ee(r){return r.display.scroller.clientHeight-Te(r)-r.display.barHeight}function De(r,t,e){if(r.line==t)return{map:r.measure.map,cache:r.measure.cache};if(r.rest){for(var n=0;n<r.rest.length;n++)if(r.rest[n]==t)return{map:r.measure.maps[n],cache:r.measure.caches[n]};for(var i=0;i<r.rest.length;i++)if(Zr(r.rest[i])>e)return{map:r.measure.maps[i],cache:r.measure.caches[i],before:!0}}}function ze(r,t,e,n){return Ie(r,Be(r,t),e,n)}function je(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo)return r.display.view[hn(r,t)];var e=r.display.externalMeasured;return e&&t>=e.lineN&&t<e.lineN+e.size?e:void 0}function Be(r,t){var e=Zr(t),n=je(r,e);n&&!n.text?n=null:n&&n.changes&&(de(r,n,e,ln(r)),r.curOp.forceUpdate=!0),n||(n=function(r,t){var e=Zr(t=Pt(t)),n=r.display.externalMeasured=new ae(r.doc,t,e);n.lineN=e;var i=n.built=re(r,n);return n.text=i.pre,N(r.display.lineMeasure,i.pre),n}(r,t));var i=De(n,t,e);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Ie(r,t,e,n,i){t.before&&(e=-1);var o,l=e+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(r,t,e){var n=r.options.lineWrapping,i=n&&Ne(r);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),u=0;u<a.length-1;u++){var l=a[u],s=a[u+1];Math.abs(l.bottom-s.bottom)>2&&o.push((l.bottom+s.top)/2-e.top)}}o.push(e.bottom-e.top)}}(r,t.view,t.rect),t.hasHeights=!0),(o=function(r,t,e,n){var i,o=Oe(t.map,e,n),l=o.node,s=o.start,c=o.end,f=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;s&&ar(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+c<o.coverEnd&&ar(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&u<9&&0==s&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Ue(L(l,s,c).getClientRects(),n)).left||i.right||0==s)break;c=s,s-=1,f="right"}a&&u<11&&(i=function(r,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(r){if(null!=Fr)return Fr;var t=N(r,E("span","x")),e=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Fr=Math.abs(e.left-n.left)>1}(r))return t;var e=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*e,right:t.right*e,top:t.top*n,bottom:t.bottom*n}}(r.display.measure,i))}else{var h;s>0&&(f=n="right"),i=r.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(a&&u<9&&!s&&(!i||!i.left&&!i.right)){var v=l.parentNode.getClientRects()[0];i=v?{left:v.left,right:v.left+un(r.display),top:v.top,bottom:v.bottom}:Fe}for(var m=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(m+p)/2,b=t.view.measure.heights,w=0;w<b.length-1&&!(g<b[w]);w++);var k={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:w?b[w-1]:0,bottom:b[w]};return i.left||i.right||(k.bogus=!0),r.options.singleCursorHeightPerLine||(k.rtop=m,k.rbottom=p),k}(r,t,e,n)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Re,Fe={left:0,right:0,top:0,bottom:0};function Oe(r,t,e){for(var n,i,o,a,u,l,s=0;s<r.length;s+=3)if(l=r[s+1],t<(u=r[s])?(i=0,o=1,a="left"):t<l?o=1+(i=t-u):(s==r.length-3||t==l&&r[s+3]>t)&&(i=(o=l-u)-1,t>=l&&(a="right")),null!=i){if(n=r[s+2],u==l&&e==(n.insertLeft?"left":"right")&&(a=e),"left"==e&&0==i)for(;s&&r[s-2]==r[s-3]&&r[s-1].insertLeft;)n=r[2+(s-=3)],a="left";if("right"==e&&i==l-u)for(;s<r.length-3&&r[s+3]==r[s+4]&&!r[s+5].insertLeft;)n=r[(s+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:u,coverEnd:l}}function Ue(r,t){var e=Fe;if("left"==t)for(var n=0;n<r.length&&(e=r[n]).left==e.right;n++);else for(var i=r.length-1;i>=0&&(e=r[i]).left==e.right;i--);return e}function _e(r){if(r.measure&&(r.measure.cache={},r.measure.heights=null,r.rest))for(var t=0;t<r.rest.length;t++)r.measure.caches[t]={}}function Pe(r){r.display.externalMeasure=null,T(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++)_e(r.display.view[t])}function qe(r){Pe(r),r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null,r.options.lineWrapping||(r.display.maxLineChanged=!0),r.display.lineNumChars=null}function We(r){return c&&g?-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft)):r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function $e(r){return c&&g?-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop)):r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function Ge(r){var t=Pt(r).widgets,e=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(e+=Ce(t[n]));return e}function He(r,t,e,n,i){if(!i){var o=Ge(t);e.top+=o,e.bottom+=o}if("line"==n)return e;n||(n="local");var a=Ht(t);if("local"==n?a+=Ae(r.display):a-=r.display.viewOffset,"page"==n||"window"==n){var u=r.display.lineSpace.getBoundingClientRect();a+=u.top+("window"==n?0:$e(F(r)));var l=u.left+("window"==n?0:We(F(r)));e.left+=l,e.right+=l}return e.top+=a,e.bottom+=a,e}function Ke(r,t,e){if("div"==e)return t;var n=t.left,i=t.top;if("page"==e)n-=We(F(r)),i-=$e(F(r));else if("local"==e||!e){var o=r.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=r.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Ve(r,t,e,n,i){return n||(n=Qr(r.doc,t.line)),He(r,n,ze(r,n,t.ch,i),e)}function Qe(r,t,e,n,i,o){function a(t,a){var u=Ie(r,i,t,a?"right":"left",o);return a?u.left=u.right:u.right=u.left,He(r,n,u,e)}n=n||Qr(r.doc,t.line),i||(i=Be(r,n));var u=dr(n,r.doc.direction),l=t.ch,s=t.sticky;if(l>=n.text.length?(l=n.text.length,s="before"):l<=0&&(l=0,s="after"),!u)return a("before"==s?l-1:l,"before"==s);function c(r,t,e){return a(e?r-1:r,1==u[t].level!=e)}var f=cr(u,l,s),d=sr,h=c(l,f,"before"==s);return null!=d&&(h.other=c(l,d,"before"!=s)),h}function Je(r,t){var e=0;t=ct(r.doc,t),r.options.lineWrapping||(e=un(r.display)*t.ch);var n=Qr(r.doc,t.line),i=Ht(n)+Ae(r.display);return{left:e,right:e,top:i,bottom:i+n.height}}function Ye(r,t,e,n,i){var o=nt(r,t,e);return o.xRel=i,n&&(o.outside=n),o}function Xe(r,t,e){var n=r.doc;if((e+=r.display.viewOffset)<0)return Ye(n.first,0,null,-1,-1);var i=rt(n,e),o=n.first+n.size-1;if(i>o)return Ye(n.first+n.size-1,Qr(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=Qr(n,i);;){var u=en(r,a,i,t,e),l=Ut(a,u.ch+(u.xRel>0||u.outside>0?1:0));if(!l)return u;var s=l.find(1);if(s.line==i)return s;a=Qr(n,i=s.line)}}function Ze(r,t,e,n){n-=Ge(t);var i=t.text.length,o=lr((function(t){return Ie(r,e,t-1).bottom<=n}),i,0);return{begin:o,end:i=lr((function(t){return Ie(r,e,t).top>n}),o,i)}}function rn(r,t,e,n){return e||(e=Be(r,t)),Ze(r,t,e,He(r,t,Ie(r,e,n),"line").top)}function tn(r,t,e,n){return!(r.bottom<=e)&&(r.top>e||(n?r.left:r.right)>t)}function en(r,t,e,n,i){i-=Ht(t);var o=Be(r,t),a=Ge(t),u=0,l=t.text.length,s=!0,c=dr(t,r.doc.direction);if(c){var f=(r.options.lineWrapping?on:nn)(r,t,e,o,c,n,i);u=(s=1!=f.level)?f.from:f.to-1,l=s?f.to:f.from-1}var d,h,v=null,m=null,p=lr((function(t){var e=Ie(r,o,t);return e.top+=a,e.bottom+=a,!!tn(e,n,i,!1)&&(e.top<=i&&e.left<=n&&(v=t,m=e),!0)}),u,l),g=!1;if(m){var b=n-m.left<m.right-n,w=b==s;p=v+(w?0:1),h=w?"after":"before",d=b?m.left:m.right}else{s||p!=l&&p!=u||p++,h=0==p?"after":p==t.text.length?"before":Ie(r,o,p-(s?1:0)).bottom+a<=i==s?"after":"before";var k=Qe(r,nt(e,p,h),"line",t,o);d=k.left,g=i<k.top?-1:i>=k.bottom?1:0}return Ye(e,p=ur(t.text,p,1),h,g,n-d)}function nn(r,t,e,n,i,o,a){var u=lr((function(u){var l=i[u],s=1!=l.level;return tn(Qe(r,nt(e,s?l.to:l.from,s?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),l=i[u];if(u>0){var s=1!=l.level,c=Qe(r,nt(e,s?l.from:l.to,s?"after":"before"),"line",t,n);tn(c,o,a,!0)&&c.top>a&&(l=i[u-1])}return l}function on(r,t,e,n,i,o,a){var u=Ze(r,t,n,a),l=u.begin,s=u.end;/\s/.test(t.text.charAt(s-1))&&s--;for(var c=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=s||h.to<=l)){var v=Ie(r,n,1!=h.level?Math.min(s,h.to)-1:Math.max(l,h.from)).right,m=v<o?o-v+1e9:v-o;(!c||f>m)&&(c=h,f=m)}}return c||(c=i[i.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>s&&(c={from:c.from,to:s,level:c.level}),c}function an(r){if(null!=r.cachedTextHeight)return r.cachedTextHeight;if(null==Re){Re=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Re.appendChild(document.createTextNode("x")),Re.appendChild(E("br"));Re.appendChild(document.createTextNode("x"))}N(r.measure,Re);var e=Re.offsetHeight/50;return e>3&&(r.cachedTextHeight=e),T(r.measure),e||1}function un(r){if(null!=r.cachedCharWidth)return r.cachedCharWidth;var t=E("span","xxxxxxxxxx"),e=E("pre",[t],"CodeMirror-line-like");N(r.measure,e);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(r.cachedCharWidth=i),i||10}function ln(r){for(var t=r.display,e={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var u=r.display.gutterSpecs[a].className;e[u]=o.offsetLeft+o.clientLeft+i,n[u]=o.clientWidth}return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:e,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function cn(r){var t=an(r.display),e=r.options.lineWrapping,n=e&&Math.max(5,r.display.scroller.clientWidth/un(r.display)-3);return function(i){if($t(r.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return e?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function fn(r){var t=r.doc,e=cn(r);t.iter((function(r){var t=e(r);t!=r.height&&Xr(r,t)}))}function dn(r,t,e,n){var i=r.display;if(!e&&"true"==Lr(t).getAttribute("cm-not-content"))return null;var o,a,u=i.lineSpace.getBoundingClientRect();try{o=t.clientX-u.left,a=t.clientY-u.top}catch(r){return null}var l,s=Xe(r,o,a);if(n&&s.xRel>0&&(l=Qr(r.doc,s.line).text).length==s.ch){var c=P(l,l.length,r.options.tabSize)-l.length;s=nt(s.line,Math.max(0,Math.round((o-Se(r.display).left)/un(r.display))-c))}return s}function hn(r,t){if(t>=r.display.viewTo)return null;if((t-=r.display.viewFrom)<0)return null;for(var e=r.display.view,n=0;n<e.length;n++)if((t-=e[n].size)<0)return n}function vn(r,t,e,n){null==t&&(t=r.doc.first),null==e&&(e=r.doc.first+r.doc.size),n||(n=0);var i=r.display;if(n&&e<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),r.curOp.viewChanged=!0,t>=i.viewTo)At&&qt(r.doc,t)<i.viewTo&&pn(r);else if(e<=i.viewFrom)At&&Wt(r.doc,e+n)>i.viewFrom?pn(r):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&e>=i.viewTo)pn(r);else if(t<=i.viewFrom){var o=gn(r,e,e+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):pn(r)}else if(e>=i.viewTo){var a=gn(r,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pn(r)}else{var u=gn(r,t,t,-1),l=gn(r,e,e+n,1);u&&l?(i.view=i.view.slice(0,u.index).concat(ue(r,u.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):pn(r)}var s=i.externalMeasured;s&&(e<s.lineN?s.lineN+=n:t<s.lineN+s.size&&(i.externalMeasured=null))}function mn(r,t,e){r.curOp.viewChanged=!0;var n=r.display,i=r.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[hn(r,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==W(a,e)&&a.push(e)}}}function pn(r){r.display.viewFrom=r.display.viewTo=r.doc.first,r.display.view=[],r.display.viewOffset=0}function gn(r,t,e,n){var i,o=hn(r,t),a=r.display.view;if(!At||e==r.doc.first+r.doc.size)return{index:o,lineN:e};for(var u=r.display.viewFrom,l=0;l<o;l++)u+=a[l].size;if(u!=t){if(n>0){if(o==a.length-1)return null;i=u+a[o].size-t,o++}else i=u-t;t+=i,e+=i}for(;qt(r.doc,e)!=e;){if(o==(n<0?0:a.length-1))return null;e+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:e}}function bn(r){for(var t=r.display.view,e=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++e}return e}function wn(r){r.display.input.showSelection(r.display.input.prepareSelection())}function kn(r,t){void 0===t&&(t=!0);var e=r.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=r.options.$customCursor;a&&(t=!0);for(var u=0;u<e.sel.ranges.length;u++)if(t||u!=e.sel.primIndex){var l=e.sel.ranges[u];if(!(l.from().line>=r.display.viewTo||l.to().line<r.display.viewFrom)){var s=l.empty();if(a){var c=a(r,l);c&&yn(r,c,i)}else(s||r.options.showCursorWhenSelecting)&&yn(r,l.head,i);s||Cn(r,l,o)}}return n}function yn(r,t,e){var n=Qe(r,t,"div",null,null,!r.options.singleCursorHeightPerLine),i=e.appendChild(E("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*r.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=Ve(r,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:r.defaultCharWidth())+"px"}if(n.other){var u=e.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="",u.style.left=n.other.left+"px",u.style.top=n.other.top+"px",u.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function xn(r,t){return r.top-t.top||r.left-t.left}function Cn(r,t,e){var n=r.display,i=r.doc,o=document.createDocumentFragment(),a=Se(r.display),u=a.left,l=Math.max(n.sizerWidth,Ne(r)-n.sizer.offsetLeft)-a.right,s="ltr"==i.direction;function c(r,t,e,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(null==e?l-r:e)+"px;\n height: "+(n-t)+"px"))}function f(t,e,n){var o,a,f=Qr(i,t),d=f.text.length;function h(e,n){return Ve(r,nt(t,e),"div",f,n)}function v(t,e,n){var i=rn(r,f,null,t),o="ltr"==e==("after"==n)?"left":"right";return h("after"==n?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var m=dr(f,i.direction);return function(r,t,e,n){if(!r)return n(t,e,"ltr",0);for(var i=!1,o=0;o<r.length;++o){var a=r[o];(a.from<e&&a.to>t||t==e&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,e),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,e,"ltr")}(m,e||0,null==n?d:n,(function(r,t,i,f){var p="ltr"==i,g=h(r,p?"left":"right"),b=h(t-1,p?"right":"left"),w=null==e&&0==r,k=null==n&&t==d,y=0==f,x=!m||f==m.length-1;if(b.top-g.top<=3){var C=(s?w:k)&&y?u:(p?g:b).left;c(C,g.top,((s?k:w)&&x?l:(p?b:g).right)-C,g.bottom)}else{var M,A,L,S;p?(M=s&&w&&y?u:g.left,A=s?l:v(r,i,"before"),L=s?u:v(t,i,"after"),S=s&&k&&x?l:b.right):(M=s?v(r,i,"before"):u,A=!s&&w&&y?l:g.right,L=!s&&k&&x?u:b.left,S=s?v(t,i,"after"):l),c(M,g.top,A-M,g.bottom),g.bottom<b.top&&c(u,g.bottom,null,b.top),c(L,b.top,S-L,b.bottom)}(!o||xn(g,o)<0)&&(o=g),xn(b,o)<0&&(o=b),(!a||xn(g,a)<0)&&(a=g),xn(b,a)<0&&(a=b)})),{start:o,end:a}}var d=t.from(),h=t.to();if(d.line==h.line)f(d.line,d.ch,h.ch);else{var v=Qr(i,d.line),m=Qr(i,h.line),p=Pt(v)==Pt(m),g=f(d.line,d.ch,p?v.text.length+1:null).end,b=f(h.line,p?0:null,h.ch).start;p&&(g.top<b.top-2?(c(g.right,g.top,null,g.bottom),c(u,b.top,b.left,b.bottom)):c(g.right,g.top,b.left-g.right,g.bottom)),g.bottom<b.top&&c(u,g.bottom,null,b.top)}e.appendChild(o)}function Mn(r){if(r.state.focused){var t=r.display;clearInterval(t.blinker);var e=!0;t.cursorDiv.style.visibility="",r.options.cursorBlinkRate>0?t.blinker=setInterval((function(){r.hasFocus()||Tn(r),t.cursorDiv.style.visibility=(e=!e)?"":"hidden"}),r.options.cursorBlinkRate):r.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function An(r){r.hasFocus()||(r.display.input.focus(),r.state.focused||Sn(r))}function Ln(r){r.state.delayingBlurEvent=!0,setTimeout((function(){r.state.delayingBlurEvent&&(r.state.delayingBlurEvent=!1,r.state.focused&&Tn(r))}),100)}function Sn(r,t){r.state.delayingBlurEvent&&!r.state.draggingText&&(r.state.delayingBlurEvent=!1),"nocursor"!=r.options.readOnly&&(r.state.focused||(gr(r,"focus",r,t),r.state.focused=!0,B(r.display.wrapper,"CodeMirror-focused"),r.curOp||r.display.selForContextMenu==r.doc.sel||(r.display.input.reset(),l&&setTimeout((function(){return r.display.input.reset(!0)}),20)),r.display.input.receivedFocus()),Mn(r))}function Tn(r,t){r.state.delayingBlurEvent||(r.state.focused&&(gr(r,"blur",r,t),r.state.focused=!1,S(r.display.wrapper,"CodeMirror-focused")),clearInterval(r.display.blinker),setTimeout((function(){r.state.focused||(r.display.shift=!1)}),150))}function Nn(r){for(var t=r.display,e=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var s=t.view[l],c=r.options.lineWrapping,f=void 0,d=0;if(!s.hidden){if(i+=s.line.height,a&&u<8){var h=s.node.offsetTop+s.node.offsetHeight;f=h-e,e=h}else{var v=s.node.getBoundingClientRect();f=v.bottom-v.top,!c&&s.text.firstChild&&(d=s.text.firstChild.getBoundingClientRect().right-v.left-1)}var m=s.line.height-f;if((m>.005||m<-.005)&&(i<n&&(o-=m),Xr(s.line,f),En(s.line),s.rest))for(var p=0;p<s.rest.length;p++)En(s.rest[p]);if(d>r.display.sizerWidth){var g=Math.ceil(d/un(r.display));g>r.display.maxLineLength&&(r.display.maxLineLength=g,r.display.maxLine=s.line,r.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function En(r){if(r.widgets)for(var t=0;t<r.widgets.length;++t){var e=r.widgets[t],n=e.node.parentNode;n&&(e.height=n.offsetHeight)}}function Dn(r,t,e){var n=e&&null!=e.top?Math.max(0,e.top):r.scroller.scrollTop;n=Math.floor(n-Ae(r));var i=e&&null!=e.bottom?e.bottom:n+r.wrapper.clientHeight,o=rt(t,n),a=rt(t,i);if(e&&e.ensure){var u=e.ensure.from.line,l=e.ensure.to.line;u<o?(o=u,a=rt(t,Ht(Qr(t,u))+r.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=rt(t,Ht(Qr(t,l))-r.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function zn(r,t){var e=r.display,n=an(r.display);t.top<0&&(t.top=0);var i=r.curOp&&null!=r.curOp.scrollTop?r.curOp.scrollTop:e.scroller.scrollTop,o=Ee(r),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var u=r.doc.height+Le(e),l=t.bottom>u-n;if(t.top<i)a.scrollTop=t.top<n?0:t.top;else if(t.bottom>i+o){var s=Math.min(t.top,(l?u:t.bottom)-o);s!=i&&(a.scrollTop=s)}var c=r.options.fixedGutter?0:e.gutters.offsetWidth,f=r.curOp&&null!=r.curOp.scrollLeft?r.curOp.scrollLeft:e.scroller.scrollLeft-c,d=Ne(r)-e.gutters.offsetWidth,h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left+c-(h?0:10)):t.right>d+f-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function jn(r,t){null!=t&&(Rn(r),r.curOp.scrollTop=(null==r.curOp.scrollTop?r.doc.scrollTop:r.curOp.scrollTop)+t)}function Bn(r){Rn(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function In(r,t,e){null==t&&null==e||Rn(r),null!=t&&(r.curOp.scrollLeft=t),null!=e&&(r.curOp.scrollTop=e)}function Rn(r){var t=r.curOp.scrollToPos;t&&(r.curOp.scrollToPos=null,Fn(r,Je(r,t.from),Je(r,t.to),t.margin))}function Fn(r,t,e,n){var i=zn(r,{left:Math.min(t.left,e.left),top:Math.min(t.top,e.top)-n,right:Math.max(t.right,e.right),bottom:Math.max(t.bottom,e.bottom)+n});In(r,i.scrollLeft,i.scrollTop)}function On(r,t){Math.abs(r.doc.scrollTop-t)<2||(e||di(r,{top:t}),Un(r,t,!0),e&&di(r),ai(r,100))}function Un(r,t,e){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t)),(r.display.scroller.scrollTop!=t||e)&&(r.doc.scrollTop=t,r.display.scrollbars.setScrollTop(t),r.display.scroller.scrollTop!=t&&(r.display.scroller.scrollTop=t))}function _n(r,t,e,n){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth)),(e?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!n||(r.doc.scrollLeft=t,mi(r),r.display.scroller.scrollLeft!=t&&(r.display.scroller.scrollLeft=t),r.display.scrollbars.setScrollLeft(t))}function Pn(r){var t=r.display,e=t.gutters.offsetWidth,n=Math.round(r.doc.height+Le(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?e:0,docHeight:n,scrollHeight:n+Te(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:e}}var qn=function(r,t,e){this.cm=e;var n=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,r(n),r(i),vr(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),vr(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&u<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qn.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1,e=r.scrollHeight>r.clientHeight+1,n=r.nativeBarWidth;return e?(this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0",this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+(r.viewHeight-(t?n:0)))+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),t?(this.horiz.style.display="block",this.horiz.style.right=e?n+"px":"0",this.horiz.style.left=r.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+(r.viewWidth-r.barLeft-(e?n:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&r.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:e?n:0,bottom:t?n:0}},qn.prototype.setScrollLeft=function(r){this.horiz.scrollLeft!=r&&(this.horiz.scrollLeft=r),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qn.prototype.setScrollTop=function(r){this.vert.scrollTop!=r&&(this.vert.scrollTop=r),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qn.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=w&&!v?"12px":"18px",this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new q,this.disableVert=new q},qn.prototype.enableZeroWidthBar=function(r,t,e){r.style.visibility="",t.set(1e3,(function n(){var i=r.getBoundingClientRect();("vert"==e?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=r?r.style.visibility="hidden":t.set(1e3,n)}))},qn.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz),r.removeChild(this.vert)};var Wn=function(){};function $n(r,t){t||(t=Pn(r));var e=r.display.barWidth,n=r.display.barHeight;Gn(r,t);for(var i=0;i<4&&e!=r.display.barWidth||n!=r.display.barHeight;i++)e!=r.display.barWidth&&r.options.lineWrapping&&Nn(r),Gn(r,Pn(r)),e=r.display.barWidth,n=r.display.barHeight}function Gn(r,t){var e=r.display,n=e.scrollbars.update(t);e.sizer.style.paddingRight=(e.barWidth=n.right)+"px",e.sizer.style.paddingBottom=(e.barHeight=n.bottom)+"px",e.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(e.scrollbarFiller.style.display="block",e.scrollbarFiller.style.height=n.bottom+"px",e.scrollbarFiller.style.width=n.right+"px"):e.scrollbarFiller.style.display="",n.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter?(e.gutterFiller.style.display="block",e.gutterFiller.style.height=n.bottom+"px",e.gutterFiller.style.width=t.gutterWidth+"px"):e.gutterFiller.style.display=""}Wn.prototype.update=function(){return{bottom:0,right:0}},Wn.prototype.setScrollLeft=function(){},Wn.prototype.setScrollTop=function(){},Wn.prototype.clear=function(){};var Hn={native:qn,null:Wn};function Kn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&S(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Hn[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller),vr(t,"mousedown",(function(){r.state.focused&&setTimeout((function(){return r.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,e){"horizontal"==e?_n(r,t):On(r,t)}),r),r.display.scrollbars.addClass&&B(r.display.wrapper,r.display.scrollbars.addClass)}var Vn=0;function Qn(r){var t;r.curOp={cm:r,viewChanged:!1,startHeight:r.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vn,markArrays:null},t=r.curOp,le?le.ops.push(t):t.ownsGroup=le={ops:[t],delayedCallbacks:[]}}function Jn(r){var t=r.curOp;t&&function(r,t){var e=r.ownsGroup;if(e)try{!function(r){var t=r.delayedCallbacks,e=0;do{for(;e<t.length;e++)t[e].call(null);for(var n=0;n<r.ops.length;n++){var i=r.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(e<t.length)}(e)}finally{le=null,t(e)}}(t,(function(r){for(var t=0;t<r.ops.length;t++)r.ops[t].cm.curOp=null;!function(r){for(var t=r.ops,e=0;e<t.length;e++)Yn(t[e]);for(var n=0;n<t.length;n++)Xn(t[n]);for(var i=0;i<t.length;i++)Zn(t[i]);for(var o=0;o<t.length;o++)ri(t[o]);for(var a=0;a<t.length;a++)ti(t[a])}(r)}))}function Yn(r){var t=r.cm,e=t.display;(function(r){var t=r.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Te(r)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Te(r)+"px",t.scrollbarsClipped=!0)})(t),r.updateMaxLine&&Vt(t),r.mustUpdate=r.viewChanged||r.forceUpdate||null!=r.scrollTop||r.scrollToPos&&(r.scrollToPos.from.line<e.viewFrom||r.scrollToPos.to.line>=e.viewTo)||e.maxLineChanged&&t.options.lineWrapping,r.update=r.mustUpdate&&new li(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function Xn(r){r.updatedDisplay=r.mustUpdate&&ci(r.cm,r.update)}function Zn(r){var t=r.cm,e=t.display;r.updatedDisplay&&Nn(t),r.barMeasure=Pn(t),e.maxLineChanged&&!t.options.lineWrapping&&(r.adjustWidthTo=ze(t,e.maxLine,e.maxLine.text.length).left+3,t.display.sizerWidth=r.adjustWidthTo,r.barMeasure.scrollWidth=Math.max(e.scroller.clientWidth,e.sizer.offsetLeft+r.adjustWidthTo+Te(t)+t.display.barWidth),r.maxScrollLeft=Math.max(0,e.sizer.offsetLeft+r.adjustWidthTo-Ne(t))),(r.updatedDisplay||r.selectionChanged)&&(r.preparedSelection=e.input.prepareSelection())}function ri(r){var t=r.cm;null!=r.adjustWidthTo&&(t.display.sizer.style.minWidth=r.adjustWidthTo+"px",r.maxScrollLeft<t.doc.scrollLeft&&_n(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),!0),t.display.maxLineChanged=!1);var e=r.focus&&r.focus==j(F(t));r.preparedSelection&&t.display.input.showSelection(r.preparedSelection,e),(r.updatedDisplay||r.startHeight!=t.doc.height)&&$n(t,r.barMeasure),r.updatedDisplay&&vi(t,r.barMeasure),r.selectionChanged&&Mn(t),t.state.focused&&r.updateInput&&t.display.input.reset(r.typing),e&&An(r.cm)}function ti(r){var t=r.cm,e=t.display,n=t.doc;r.updatedDisplay&&fi(t,r.update),null==e.wheelStartX||null==r.scrollTop&&null==r.scrollLeft&&!r.scrollToPos||(e.wheelStartX=e.wheelStartY=null),null!=r.scrollTop&&Un(t,r.scrollTop,r.forceScroll),null!=r.scrollLeft&&_n(t,r.scrollLeft,!0,!0),r.scrollToPos&&function(r,t){if(!br(r,"scrollCursorIntoView")){var e=r.display,n=e.sizer.getBoundingClientRect(),i=null,o=e.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var a=E("div","​",null,"position: absolute;\n top: "+(t.top-e.viewOffset-Ae(r.display))+"px;\n height: "+(t.bottom-t.top+Te(r)+e.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(a),a.scrollIntoView(i),r.display.lineSpace.removeChild(a)}}}(t,function(r,t,e,n){var i;null==n&&(n=0),r.options.lineWrapping||t!=e||(e="before"==t.sticky?nt(t.line,t.ch+1,"before"):t,t=t.ch?nt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,u=Qe(r,t),l=e&&e!=t?Qe(r,e):u,s=zn(r,i={left:Math.min(u.left,l.left),top:Math.min(u.top,l.top)-n,right:Math.max(u.left,l.left),bottom:Math.max(u.bottom,l.bottom)+n}),c=r.doc.scrollTop,f=r.doc.scrollLeft;if(null!=s.scrollTop&&(On(r,s.scrollTop),Math.abs(r.doc.scrollTop-c)>1&&(a=!0)),null!=s.scrollLeft&&(_n(r,s.scrollLeft),Math.abs(r.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,ct(n,r.scrollToPos.from),ct(n,r.scrollToPos.to),r.scrollToPos.margin));var i=r.maybeHiddenMarkers,o=r.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||gr(i[a],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&gr(o[u],"unhide");e.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),r.changeObjs&&gr(t,"changes",t,r.changeObjs),r.update&&r.update.finish()}function ei(r,t){if(r.curOp)return t();Qn(r);try{return t()}finally{Jn(r)}}function ni(r,t){return function(){if(r.curOp)return t.apply(r,arguments);Qn(r);try{return t.apply(r,arguments)}finally{Jn(r)}}}function ii(r){return function(){if(this.curOp)return r.apply(this,arguments);Qn(this);try{return r.apply(this,arguments)}finally{Jn(this)}}}function oi(r){return function(){var t=this.cm;if(!t||t.curOp)return r.apply(this,arguments);Qn(t);try{return r.apply(this,arguments)}finally{Jn(t)}}}function ai(r,t){r.doc.highlightFrontier<r.display.viewTo&&r.state.highlight.set(t,U(ui,r))}function ui(r){var t=r.doc;if(!(t.highlightFrontier>=r.display.viewTo)){var e=+new Date+r.options.workTime,n=pt(r,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(n.line>=r.display.viewFrom){var a=o.styles,u=o.text.length>r.options.maxHighlightLength?Gr(t.mode,n.state):null,l=vt(r,o,n,!0);u&&(n.state=u),o.styles=l.styles;var s=o.styleClasses,c=l.classes;c?o.styleClasses=c:s&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||s!=c&&(!s||!c||s.bgClass!=c.bgClass||s.textClass!=c.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=o.styles[d];f&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=r.options.maxHighlightLength&&gt(r,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>e)return ai(r,r.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ei(r,(function(){for(var t=0;t<i.length;t++)mn(r,i[t],"text")}))}}var li=function(r,t,e){var n=r.display;this.viewport=t,this.visible=Dn(n,r.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ne(r),this.force=e,this.dims=ln(r),this.events=[]};function si(r){if(r.hasFocus())return null;var t=j(F(r));if(!t||!z(r.display.lineDiv,t))return null;var e={activeElt:t};if(window.getSelection){var n=O(r).getSelection();n.anchorNode&&n.extend&&z(r.display.lineDiv,n.anchorNode)&&(e.anchorNode=n.anchorNode,e.anchorOffset=n.anchorOffset,e.focusNode=n.focusNode,e.focusOffset=n.focusOffset)}return e}function ci(r,t){var e=r.display,n=r.doc;if(t.editorIsHidden)return pn(r),!1;if(!t.force&&t.visible.from>=e.viewFrom&&t.visible.to<=e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>=e.viewTo)&&e.renderedView==e.view&&0==bn(r))return!1;pi(r)&&(pn(r),t.dims=ln(r));var i=n.first+n.size,o=Math.max(t.visible.from-r.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+r.options.viewportMargin);e.viewFrom<o&&o-e.viewFrom<20&&(o=Math.max(n.first,e.viewFrom)),e.viewTo>a&&e.viewTo-a<20&&(a=Math.min(i,e.viewTo)),At&&(o=qt(r.doc,o),a=Wt(r.doc,a));var u=o!=e.viewFrom||a!=e.viewTo||e.lastWrapHeight!=t.wrapperHeight||e.lastWrapWidth!=t.wrapperWidth;(function(r,t,e){var n=r.display;0==n.view.length||t>=n.viewTo||e<=n.viewFrom?(n.view=ue(r,t,e),n.viewFrom=t):(n.viewFrom>t?n.view=ue(r,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(hn(r,t))),n.viewFrom=t,n.viewTo<e?n.view=n.view.concat(ue(r,n.viewTo,e)):n.viewTo>e&&(n.view=n.view.slice(0,hn(r,e)))),n.viewTo=e})(r,o,a),e.viewOffset=Ht(Qr(r.doc,e.viewFrom)),r.display.mover.style.top=e.viewOffset+"px";var s=bn(r);if(!u&&0==s&&!t.force&&e.renderedView==e.view&&(null==e.updateLineNumbers||e.updateLineNumbers>=e.viewTo))return!1;var c=si(r);return s>4&&(e.lineDiv.style.display="none"),function(r,t,e){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function u(t){var e=t.nextSibling;return l&&w&&r.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),e}for(var s=n.view,c=n.viewFrom,f=0;f<s.length;f++){var d=s[f];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=u(a);var h=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(W(d.changes,"gutter")>-1&&(h=!1),de(r,d,c,e)),h&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(et(r.options,c)))),a=d.node.nextSibling}else{var v=we(r,d,c,e);o.insertBefore(v,a)}c+=d.size}for(;a;)a=u(a)}(r,e.updateLineNumbers,t.dims),s>4&&(e.lineDiv.style.display=""),e.renderedView=e.view,function(r){if(r&&r.activeElt&&r.activeElt!=j(r.activeElt.ownerDocument)&&(r.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&z(document.body,r.anchorNode)&&z(document.body,r.focusNode))){var t=r.activeElt.ownerDocument,e=t.defaultView.getSelection(),n=t.createRange();n.setEnd(r.anchorNode,r.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(r.focusNode,r.focusOffset)}}(c),T(e.cursorDiv),T(e.selectionDiv),e.gutters.style.height=e.sizer.style.minHeight=0,u&&(e.lastWrapHeight=t.wrapperHeight,e.lastWrapWidth=t.wrapperWidth,ai(r,400)),e.updateLineNumbers=null,!0}function fi(r,t){for(var e=t.viewport,n=!0;;n=!1){if(n&&r.options.lineWrapping&&t.oldDisplayWidth!=Ne(r))n&&(t.visible=Dn(r.display,r.doc,e));else if(e&&null!=e.top&&(e={top:Math.min(r.doc.height+Le(r.display)-Ee(r),e.top)}),t.visible=Dn(r.display,r.doc,e),t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo)break;if(!ci(r,t))break;Nn(r);var i=Pn(r);wn(r),$n(r,i),vi(r,i),t.force=!1}t.signal(r,"update",r),r.display.viewFrom==r.display.reportedViewFrom&&r.display.viewTo==r.display.reportedViewTo||(t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo),r.display.reportedViewFrom=r.display.viewFrom,r.display.reportedViewTo=r.display.viewTo)}function di(r,t){var e=new li(r,t);if(ci(r,e)){Nn(r),fi(r,e);var n=Pn(r);wn(r),$n(r,n),vi(r,n),e.finish()}}function hi(r){r.sizer.style.marginLeft=r.gutters.offsetWidth+"px",ce(r,"gutterChanged",r)}function vi(r,t){r.display.sizer.style.minHeight=t.docHeight+"px",r.display.heightForcer.style.top=t.docHeight+"px",r.display.gutters.style.height=t.docHeight+r.display.barHeight+Te(r)+"px"}function mi(r){var t=r.display,e=t.view;if(t.alignWidgets||t.gutters.firstChild&&r.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+r.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<e.length;a++)if(!e[a].hidden){r.options.fixedGutter&&(e[a].gutter&&(e[a].gutter.style.left=o),e[a].gutterBackground&&(e[a].gutterBackground.style.left=o));var u=e[a].alignable;if(u)for(var l=0;l<u.length;l++)u[l].style.left=o}r.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function pi(r){if(!r.options.lineNumbers)return!1;var t=r.doc,e=et(r.options,t.first+t.size-1),n=r.display;if(e.length!=n.lineNumChars){var i=n.measure.appendChild(E("div",[E("div",e)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?e.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",hi(r.display),!0}return!1}function gi(r,t){for(var e=[],n=!1,i=0;i<r.length;i++){var o=r[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}e.push({className:o,style:a})}return t&&!n&&e.push({className:"CodeMirror-linenumbers",style:null}),e}function bi(r){var t=r.gutters,e=r.gutterSpecs;T(t),r.lineGutter=null;for(var n=0;n<e.length;++n){var i=e[n],o=i.className,a=i.style,u=t.appendChild(E("div",null,"CodeMirror-gutter "+o));a&&(u.style.cssText=a),"CodeMirror-linenumbers"==o&&(r.lineGutter=u,u.style.width=(r.lineNumWidth||1)+"px")}t.style.display=e.length?"":"none",hi(r)}function wi(r){bi(r.display),vn(r),mi(r)}function ki(r,t,n,i){var o=this;this.input=n,o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=E("div",null,"CodeMirror-cursors"),o.measure=E("div",null,"CodeMirror-measure"),o.lineMeasure=E("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var s=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[s],null,"position: relative"),o.sizer=E("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=E("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=E("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),c&&f>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&u<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||e&&b||(o.scroller.draggable=!0),r&&(r.appendChild?r.appendChild(o.wrapper):r(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=gi(i.gutters,i.lineNumbers),bi(o),n.init(o)}li.prototype.signal=function(r,t){kr(r,t)&&this.events.push(arguments)},li.prototype.finish=function(){for(var r=0;r<this.events.length;r++)gr.apply(null,this.events[r])};var yi=0,xi=null;function Ci(r){var t=r.wheelDeltaX,e=r.wheelDeltaY;return null==t&&r.detail&&r.axis==r.HORIZONTAL_AXIS&&(t=r.detail),null==e&&r.detail&&r.axis==r.VERTICAL_AXIS?e=r.detail:null==e&&(e=r.wheelDelta),{x:t,y:e}}function Mi(r){var t=Ci(r);return t.x*=xi,t.y*=xi,t}function Ai(r,t){c&&102==f&&(null==r.display.chromeScrollHack?r.display.sizer.style.pointerEvents="none":clearTimeout(r.display.chromeScrollHack),r.display.chromeScrollHack=setTimeout((function(){r.display.chromeScrollHack=null,r.display.sizer.style.pointerEvents=""}),100));var n=Ci(t),i=n.x,o=n.y,a=xi;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var u=r.display,s=u.scroller,h=s.scrollHeight>s.clientHeight;if(i&&s.scrollWidth>s.clientWidth||o&&h){if(o&&w&&l)r:for(var v=t.target,m=u.view;v!=s;v=v.parentNode)for(var p=0;p<m.length;p++)if(m[p].node==v){r.display.currentWheelTarget=v;break r}if(i&&!e&&!d&&null!=a)return o&&h&&On(r,Math.max(0,s.scrollTop+o*a)),_n(r,Math.max(0,s.scrollLeft+i*a)),(!o||o&&h)&&xr(t),void(u.wheelStartX=null);if(o&&null!=a){var g=o*a,b=r.doc.scrollTop,k=b+u.wrapper.clientHeight;g<0?b=Math.max(0,b+g-50):k=Math.min(r.doc.height,k+g+50),di(r,{top:b,bottom:k})}yi<20&&0!==t.deltaMode&&(null==u.wheelStartX?(u.wheelStartX=s.scrollLeft,u.wheelStartY=s.scrollTop,u.wheelDX=i,u.wheelDY=o,setTimeout((function(){if(null!=u.wheelStartX){var r=s.scrollLeft-u.wheelStartX,t=s.scrollTop-u.wheelStartY,e=t&&u.wheelDY&&t/u.wheelDY||r&&u.wheelDX&&r/u.wheelDX;u.wheelStartX=u.wheelStartY=null,e&&(xi=(xi*yi+e)/(yi+1),++yi)}}),200)):(u.wheelDX+=i,u.wheelDY+=o))}}a?xi=-.53:e?xi=15:c?xi=-.7:h&&(xi=-1/3);var Li=function(r,t){this.ranges=r,this.primIndex=t};Li.prototype.primary=function(){return this.ranges[this.primIndex]},Li.prototype.equals=function(r){if(r==this)return!0;if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var e=this.ranges[t],n=r.ranges[t];if(!ot(e.anchor,n.anchor)||!ot(e.head,n.head))return!1}return!0},Li.prototype.deepCopy=function(){for(var r=[],t=0;t<this.ranges.length;t++)r[t]=new Si(at(this.ranges[t].anchor),at(this.ranges[t].head));return new Li(r,this.primIndex)},Li.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++)if(!this.ranges[r].empty())return!0;return!1},Li.prototype.contains=function(r,t){t||(t=r);for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e];if(it(t,n.from())>=0&&it(r,n.to())<=0)return e}return-1};var Si=function(r,t){this.anchor=r,this.head=t};function Ti(r,t,e){var n=r&&r.options.selectionsMayTouch,i=t[e];t.sort((function(r,t){return it(r.from(),t.from())})),e=W(t,i);for(var o=1;o<t.length;o++){var a=t[o],u=t[o-1],l=it(u.to(),a.from());if(n&&!a.empty()?l>0:l>=0){var s=lt(u.from(),a.from()),c=ut(u.to(),a.to()),f=u.empty()?a.from()==a.head:u.from()==u.head;o<=e&&--e,t.splice(--o,2,new Si(f?c:s,f?s:c))}}return new Li(t,e)}function Ni(r,t){return new Li([new Si(r,t||r)],0)}function Ei(r){return r.text?nt(r.from.line+r.text.length-1,Y(r.text).length+(1==r.text.length?r.from.ch:0)):r.to}function Di(r,t){if(it(r,t.from)<0)return r;if(it(r,t.to)<=0)return Ei(t);var e=r.line+t.text.length-(t.to.line-t.from.line)-1,n=r.ch;return r.line==t.to.line&&(n+=Ei(t).ch-t.to.ch),nt(e,n)}function zi(r,t){for(var e=[],n=0;n<r.sel.ranges.length;n++){var i=r.sel.ranges[n];e.push(new Si(Di(i.anchor,t),Di(i.head,t)))}return Ti(r.cm,e,r.sel.primIndex)}function ji(r,t,e){return r.line==t.line?nt(e.line,r.ch-t.ch+e.ch):nt(e.line+(r.line-t.line),r.ch)}function Bi(r){r.doc.mode=qr(r.options,r.doc.modeOption),Ii(r)}function Ii(r){r.doc.iter((function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)})),r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first,ai(r,100),r.state.modeGen++,r.curOp&&vn(r)}function Ri(r,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function Fi(r,t,e,n){function i(r){return e?e[r]:null}function o(r,e,i){(function(r,t,e,n){r.text=t,r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null),null!=r.order&&(r.order=null),Dt(r),zt(r,e);var i=n?n(r):1;i!=r.height&&Xr(r,i)})(r,e,i,n),ce(r,"change",r,t)}function a(r,t){for(var e=[],o=r;o<t;++o)e.push(new Qt(s[o],i(o),n));return e}var u=t.from,l=t.to,s=t.text,c=Qr(r,u.line),f=Qr(r,l.line),d=Y(s),h=i(s.length-1),v=l.line-u.line;if(t.full)r.insert(0,a(0,s.length)),r.remove(s.length,r.size-s.length);else if(Ri(r,t)){var m=a(0,s.length-1);o(f,f.text,h),v&&r.remove(u.line,v),m.length&&r.insert(u.line,m)}else if(c==f)if(1==s.length)o(c,c.text.slice(0,u.ch)+d+c.text.slice(l.ch),h);else{var p=a(1,s.length-1);p.push(new Qt(d+c.text.slice(l.ch),h,n)),o(c,c.text.slice(0,u.ch)+s[0],i(0)),r.insert(u.line+1,p)}else if(1==s.length)o(c,c.text.slice(0,u.ch)+s[0]+f.text.slice(l.ch),i(0)),r.remove(u.line+1,v);else{o(c,c.text.slice(0,u.ch)+s[0],i(0)),o(f,d+f.text.slice(l.ch),h);var g=a(1,s.length-1);v>1&&r.remove(u.line+1,v-1),r.insert(u.line+1,g)}ce(r,"change",r,t)}function Oi(r,t,e){!function r(n,i,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var u=n.linked[a];if(u.doc!=i){var l=o&&u.sharedHist;e&&!l||(t(u.doc,l),r(u.doc,n,l))}}}(r,null,!0)}function Ui(r,t){if(t.cm)throw new Error("This document is already in use.");r.doc=t,t.cm=r,fn(r),Bi(r),_i(r),r.options.direction=t.direction,r.options.lineWrapping||Vt(r),r.options.mode=t.modeOption,vn(r)}function _i(r){("rtl"==r.doc.direction?B:S)(r.display.lineDiv,"CodeMirror-rtl")}function Pi(r){this.done=[],this.undone=[],this.undoDepth=r?r.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=r?r.maxGeneration:1}function qi(r,t){var e={from:at(t.from),to:Ei(t),text:Jr(r,t.from,t.to)};return Ki(r,e,t.from.line,t.to.line+1),Oi(r,(function(r){return Ki(r,e,t.from.line,t.to.line+1)}),!0),e}function Wi(r){for(;r.length&&Y(r).ranges;)r.pop()}function $i(r,t,e,n){var i=r.history;i.undone.length=0;var o,a,u=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>u-(r.cm?r.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(r,t){return t?(Wi(r.done),Y(r.done)):r.done.length&&!Y(r.done).ranges?Y(r.done):r.done.length>1&&!r.done[r.done.length-2].ranges?(r.done.pop(),Y(r.done)):void 0}(i,i.lastOp==n)))a=Y(o.changes),0==it(t.from,t.to)&&0==it(t.from,a.to)?a.to=Ei(t):o.changes.push(qi(r,t));else{var l=Y(i.done);for(l&&l.ranges||Hi(r.sel,i.done),o={changes:[qi(r,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(e),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=u,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||gr(r,"historyAdded")}function Gi(r,t,e,n){var i=r.history,o=n&&n.origin;e==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(r,t,e,n){var i=t.charAt(0);return"*"==i||"+"==i&&e.ranges.length==n.ranges.length&&e.somethingSelected()==n.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}(r,o,Y(i.done),t))?i.done[i.done.length-1]=t:Hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=e,n&&!1!==n.clearRedo&&Wi(i.undone)}function Hi(r,t){var e=Y(t);e&&e.ranges&&e.equals(r)||t.push(r)}function Ki(r,t,e,n){var i=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,e),Math.min(r.first+r.size,n),(function(e){e.markedSpans&&((i||(i=t["spans_"+r.id]={}))[o]=e.markedSpans),++o}))}function Vi(r){if(!r)return null;for(var t,e=0;e<r.length;++e)r[e].marker.explicitlyCleared?t||(t=r.slice(0,e)):t&&t.push(r[e]);return t?t.length?t:null:r}function Qi(r,t){var e=function(r,t){var e=t["spans_"+r.id];if(!e)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Vi(e[i]));return n}(r,t),n=Nt(r,t);if(!e)return n;if(!n)return e;for(var i=0;i<e.length;++i){var o=e[i],a=n[i];if(o&&a)r:for(var u=0;u<a.length;++u){for(var l=a[u],s=0;s<o.length;++s)if(o[s].marker==l.marker)continue r;o.push(l)}else a&&(e[i]=a)}return e}function Ji(r,t,e){for(var n=[],i=0;i<r.length;++i){var o=r[i];if(o.ranges)n.push(e?Li.prototype.deepCopy.call(o):o);else{var a=o.changes,u=[];n.push({changes:u});for(var l=0;l<a.length;++l){var s=a[l],c=void 0;if(u.push({from:s.from,to:s.to,text:s.text}),t)for(var f in s)(c=f.match(/^spans_(\d+)$/))&&W(t,Number(c[1]))>-1&&(Y(u)[f]=s[f],delete s[f])}}}return n}function Yi(r,t,e,n){if(n){var i=r.anchor;if(e){var o=it(t,i)<0;o!=it(e,i)<0?(i=t,t=e):o!=it(t,e)<0&&(t=e)}return new Si(i,t)}return new Si(e||t,t)}function Xi(r,t,e,n,i){null==i&&(i=r.cm&&(r.cm.display.shift||r.extend)),no(r,new Li([Yi(r.sel.primary(),t,e,i)],0),n)}function Zi(r,t,e){for(var n=[],i=r.cm&&(r.cm.display.shift||r.extend),o=0;o<r.sel.ranges.length;o++)n[o]=Yi(r.sel.ranges[o],t[o],null,i);no(r,Ti(r.cm,n,r.sel.primIndex),e)}function ro(r,t,e,n){var i=r.sel.ranges.slice(0);i[t]=e,no(r,Ti(r.cm,i,r.sel.primIndex),n)}function to(r,t,e,n){no(r,Ni(t,e),n)}function eo(r,t,e){var n=r.history.done,i=Y(n);i&&i.ranges?(n[n.length-1]=t,io(r,t,e)):no(r,t,e)}function no(r,t,e){io(r,t,e),Gi(r,r.sel,r.cm?r.cm.curOp.id:NaN,e)}function io(r,t,e){(kr(r,"beforeSelectionChange")||r.cm&&kr(r.cm,"beforeSelectionChange"))&&(t=function(r,t,e){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var e=0;e<t.length;e++)this.ranges[e]=new Si(ct(r,t[e].anchor),ct(r,t[e].head))},origin:e&&e.origin};return gr(r,"beforeSelectionChange",r,n),r.cm&&gr(r.cm,"beforeSelectionChange",r.cm,n),n.ranges!=t.ranges?Ti(r.cm,n.ranges,n.ranges.length-1):t}(r,t,e));var n=e&&e.bias||(it(t.primary().head,r.sel.primary().head)<0?-1:1);oo(r,uo(r,t,n,!0)),e&&!1===e.scroll||!r.cm||"nocursor"==r.cm.getOption("readOnly")||Bn(r.cm)}function oo(r,t){t.equals(r.sel)||(r.sel=t,r.cm&&(r.cm.curOp.updateInput=1,r.cm.curOp.selectionChanged=!0,wr(r.cm)),ce(r,"cursorActivity",r))}function ao(r){oo(r,uo(r,r.sel,null,!1))}function uo(r,t,e,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],u=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o],l=so(r,a.anchor,u&&u.anchor,e,n),s=a.head==a.anchor?l:so(r,a.head,u&&u.head,e,n);(i||l!=a.anchor||s!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(l,s))}return i?Ti(r.cm,i,t.primIndex):t}function lo(r,t,e,n,i){var o=Qr(r,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var u=o.markedSpans[a],l=u.marker,s="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==u.from||(s?u.from<=t.ch:u.from<t.ch))&&(null==u.to||(c?u.to>=t.ch:u.to>t.ch))){if(i&&(gr(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(e){var f=l.find(n<0?1:-1),d=void 0;if((n<0?c:s)&&(f=co(r,f,-n,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(d=it(f,e))&&(n<0?d<0:d>0))return lo(r,f,t,n,i)}var h=l.find(n<0?-1:1);return(n<0?s:c)&&(h=co(r,h,n,h.line==t.line?o:null)),h?lo(r,h,t,n,i):null}}return t}function so(r,t,e,n,i){var o=n||1;return lo(r,t,e,o,i)||!i&&lo(r,t,e,o,!0)||lo(r,t,e,-o,i)||!i&&lo(r,t,e,-o,!0)||(r.cantEdit=!0,nt(r.first,0))}function co(r,t,e,n){return e<0&&0==t.ch?t.line>r.first?ct(r,nt(t.line-1)):null:e>0&&t.ch==(n||Qr(r,t.line)).text.length?t.line<r.first+r.size-1?nt(t.line+1,0):null:new nt(t.line,t.ch+e)}function fo(r){r.setSelection(nt(r.firstLine(),0),nt(r.lastLine()),G)}function ho(r,t,e){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return e&&(n.update=function(t,e,i,o){t&&(n.from=ct(r,t)),e&&(n.to=ct(r,e)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),gr(r,"beforeChange",r,n),r.cm&&gr(r.cm,"beforeChange",r.cm,n),n.canceled?(r.cm&&(r.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function vo(r,t,e){if(r.cm){if(!r.cm.curOp)return ni(r.cm,vo)(r,t,e);if(r.cm.state.suppressEdits)return}if(!(kr(r,"beforeChange")||r.cm&&kr(r.cm,"beforeChange"))||(t=ho(r,t,!0))){var n=Mt&&!e&&function(r,t,e){var n=null;if(r.iter(t.line,e.line+1,(function(r){if(r.markedSpans)for(var t=0;t<r.markedSpans.length;++t){var e=r.markedSpans[t].marker;!e.readOnly||n&&-1!=W(n,e)||(n||(n=[])).push(e)}})),!n)return null;for(var i=[{from:t,to:e}],o=0;o<n.length;++o)for(var a=n[o],u=a.find(0),l=0;l<i.length;++l){var s=i[l];if(!(it(s.to,u.from)<0||it(s.from,u.to)>0)){var c=[l,1],f=it(s.from,u.from),d=it(s.to,u.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:s.from,to:u.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:u.to,to:s.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(r,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)mo(r,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else mo(r,t)}}function mo(r,t){if(1!=t.text.length||""!=t.text[0]||0!=it(t.from,t.to)){var e=zi(r,t);$i(r,t,e,r.cm?r.cm.curOp.id:NaN),bo(r,t,e,Nt(r,t));var n=[];Oi(r,(function(r,e){e||-1!=W(n,r.history)||(xo(r.history,t),n.push(r.history)),bo(r,t,null,Nt(r,t))}))}}function po(r,t,e){var n=r.cm&&r.cm.state.suppressEdits;if(!n||e){for(var i,o=r.history,a=r.sel,u="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,s=0;s<u.length&&(i=u[s],e?!i.ranges||i.equals(r.sel):i.ranges);s++);if(s!=u.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=u.pop()).ranges){if(n)return void u.push(i);break}if(Hi(i,l),e&&!i.equals(r.sel))return void no(r,i,{clearRedo:!1});a=i}var c=[];Hi(a,l),l.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=kr(r,"beforeChange")||r.cm&&kr(r.cm,"beforeChange"),d=function(e){var n=i.changes[e];if(n.origin=t,f&&!ho(r,n,!1))return u.length=0,{};c.push(qi(r,n));var o=e?zi(r,n):Y(u);bo(r,n,o,Qi(r,n)),!e&&r.cm&&r.cm.scrollIntoView({from:n.from,to:Ei(n)});var a=[];Oi(r,(function(r,t){t||-1!=W(a,r.history)||(xo(r.history,n),a.push(r.history)),bo(r,n,null,Qi(r,n))}))},h=i.changes.length-1;h>=0;--h){var v=d(h);if(v)return v.v}}}}function go(r,t){if(0!=t&&(r.first+=t,r.sel=new Li(X(r.sel.ranges,(function(r){return new Si(nt(r.anchor.line+t,r.anchor.ch),nt(r.head.line+t,r.head.ch))})),r.sel.primIndex),r.cm)){vn(r.cm,r.first,r.first-t,t);for(var e=r.cm.display,n=e.viewFrom;n<e.viewTo;n++)mn(r.cm,n,"gutter")}}function bo(r,t,e,n){if(r.cm&&!r.cm.curOp)return ni(r.cm,bo)(r,t,e,n);if(t.to.line<r.first)go(r,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>r.lastLine())){if(t.from.line<r.first){var i=t.text.length-1-(r.first-t.from.line);go(r,i),t={from:nt(r.first,0),to:nt(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=r.lastLine();t.to.line>o&&(t={from:t.from,to:nt(o,Qr(r,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(r,t.from,t.to),e||(e=zi(r,t)),r.cm?function(r,t,e){var n=r.doc,i=r.display,o=t.from,a=t.to,u=!1,l=o.line;r.options.lineWrapping||(l=Zr(Pt(Qr(n,o.line))),n.iter(l,a.line+1,(function(r){if(r==i.maxLine)return u=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&wr(r),Fi(n,t,e,cn(r)),r.options.lineWrapping||(n.iter(l,o.line+t.text.length,(function(r){var t=Kt(r);t>i.maxLineLength&&(i.maxLine=r,i.maxLineLength=t,i.maxLineChanged=!0,u=!1)})),u&&(r.curOp.updateMaxLine=!0)),function(r,t){if(r.modeFrontier=Math.min(r.modeFrontier,t),!(r.highlightFrontier<t-10)){for(var e=r.first,n=t-1;n>e;n--){var i=Qr(r,n).stateAfter;if(i&&(!(i instanceof dt)||n+i.lookAhead<t)){e=n+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,e)}}(n,o.line),ai(r,400);var s=t.text.length-(a.line-o.line)-1;t.full?vn(r):o.line!=a.line||1!=t.text.length||Ri(r.doc,t)?vn(r,o.line,a.line+1,s):mn(r,o.line,"text");var c=kr(r,"changes"),f=kr(r,"change");if(f||c){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&ce(r,"change",r,d),c&&(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(d)}r.display.selForContextMenu=null}(r.cm,t,n):Fi(r,t,n),io(r,e,G),r.cantEdit&&so(r,nt(r.firstLine(),0))&&(r.cantEdit=!1)}}function wo(r,t,e,n,i){var o;n||(n=e),it(n,e)<0&&(e=(o=[n,e])[0],n=o[1]),"string"==typeof t&&(t=r.splitLines(t)),vo(r,{from:e,to:n,text:t,origin:i})}function ko(r,t,e,n){e<r.line?r.line+=n:t<r.line&&(r.line=t,r.ch=0)}function yo(r,t,e,n){for(var i=0;i<r.length;++i){var o=r[i],a=!0;if(o.ranges){o.copied||((o=r[i]=o.deepCopy()).copied=!0);for(var u=0;u<o.ranges.length;u++)ko(o.ranges[u].anchor,t,e,n),ko(o.ranges[u].head,t,e,n)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(e<s.from.line)s.from=nt(s.from.line+n,s.from.ch),s.to=nt(s.to.line+n,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(r.splice(0,i+1),i=0)}}}function xo(r,t){var e=t.from.line,n=t.to.line,i=t.text.length-(n-e)-1;yo(r.done,e,n,i),yo(r.undone,e,n,i)}function Co(r,t,e,n){var i=t,o=t;return"number"==typeof t?o=Qr(r,st(r,t)):i=Zr(t),null==i?null:(n(o,i)&&r.cm&&mn(r.cm,i,e),o)}function Mo(r){this.lines=r,this.parent=null;for(var t=0,e=0;e<r.length;++e)r[e].parent=this,t+=r[e].height;this.height=t}function Ao(r){this.children=r;for(var t=0,e=0,n=0;n<r.length;++n){var i=r[n];t+=i.chunkSize(),e+=i.height,i.parent=this}this.size=t,this.height=e,this.parent=null}Si.prototype.from=function(){return lt(this.anchor,this.head)},Si.prototype.to=function(){return ut(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var e=r,n=r+t;e<n;++e){var i=this.lines[e];this.height-=i.height,Jt(i),ce(i,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,e){this.height+=e,this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(r,t,e){for(var n=r+t;r<n;++r)if(e(this.lines[r]))return!0}},Ao.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var e=0;e<this.children.length;++e){var n=this.children[e],i=n.chunkSize();if(r<i){var o=Math.min(t,i-r),a=n.height;if(n.removeInner(r,o),this.height-=a-n.height,i==o&&(this.children.splice(e--,1),n.parent=null),0==(t-=o))break;r=0}else r-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var u=[];this.collapse(u),this.children=[new Mo(u)],this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t)this.children[t].collapse(r)},insertInner:function(r,t,e){this.size+=t.length,this.height+=e;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(r<=o){if(i.insertInner(r,t,e),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,u=a;u<i.lines.length;){var l=new Mo(i.lines.slice(u,u+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var r=this;do{var t=new Ao(r.children.splice(r.children.length-5,5));if(r.parent){r.size-=t.size,r.height-=t.height;var e=W(r.parent.children,r);r.parent.children.splice(e+1,0,t)}else{var n=new Ao(r.children);n.parent=r,r.children=[n,t],r=n}t.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()}},iterN:function(r,t,e){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(r<o){var a=Math.min(t,o-r);if(i.iterN(r,a,e))return!0;if(0==(t-=a))break;r=0}else r-=o}}};var Lo=function(r,t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&(this[n]=e[n]);this.doc=r,this.node=t};function So(r,t,e){Ht(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)&&jn(r,e)}Lo.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,e=this.line,n=Zr(e);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(e.widgets=null);var o=Ce(this);Xr(e,Math.max(0,e.height-o)),r&&(ei(r,(function(){So(r,e,-o),mn(r,n,"widget")})),ce(r,"lineWidgetCleared",r,this,n))}},Lo.prototype.changed=function(){var r=this,t=this.height,e=this.doc.cm,n=this.line;this.height=null;var i=Ce(this)-t;i&&($t(this.doc,n)||Xr(n,n.height+i),e&&ei(e,(function(){e.curOp.forceUpdate=!0,So(e,n,i),ce(e,"lineWidgetChanged",e,r,Zr(n))})))},yr(Lo);var To=0,No=function(r,t){this.lines=[],this.type=t,this.doc=r,this.id=++To};function Eo(r,t,e,n,i){if(n&&n.shared)return function(r,t,e,n,i){(n=_(n)).shared=!1;var o=[Eo(r,t,e,n,i)],a=o[0],u=n.widgetNode;return Oi(r,(function(r){u&&(n.widgetNode=u.cloneNode(!0)),o.push(Eo(r,ct(r,t),ct(r,e),n,i));for(var l=0;l<r.linked.length;++l)if(r.linked[l].isParent)return;a=Y(o)})),new Do(o,a)}(r,t,e,n,i);if(r.cm&&!r.cm.curOp)return ni(r.cm,Eo)(r,t,e,n,i);var o=new No(r,i),a=it(t,e);if(n&&_(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(_t(r,t.line,t,e,o)||t.line!=e.line&&_t(r,e.line,t,e,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At=!0}o.addToHistory&&$i(r,{from:t,to:e,origin:"markText"},r.sel,NaN);var u,l=t.line,s=r.cm;if(r.iter(l,e.line+1,(function(n){s&&o.collapsed&&!s.options.lineWrapping&&Pt(n)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&Xr(n,0),function(r,t,e){var n=e&&window.WeakSet&&(e.markedSpans||(e.markedSpans=new WeakSet));n&&r.markedSpans&&n.has(r.markedSpans)?r.markedSpans.push(t):(r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t],n&&n.add(r.markedSpans)),t.marker.attachLine(r)}(n,new Lt(o,l==t.line?t.ch:null,l==e.line?e.ch:null),r.cm&&r.cm.curOp),++l})),o.collapsed&&r.iter(t.line,e.line+1,(function(t){$t(r,t)&&Xr(t,0)})),o.clearOnEnter&&vr(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Mt=!0,(r.history.done.length||r.history.undone.length)&&r.clearHistory()),o.collapsed&&(o.id=++To,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)vn(s,t.line,e.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=e.line;c++)mn(s,c,"text");o.atomic&&ao(s.doc),ce(s,"markerAdded",s,o)}return o}No.prototype.clear=function(){if(!this.explicitlyCleared){var r=this.doc.cm,t=r&&!r.curOp;if(t&&Qn(r),kr(this,"clear")){var e=this.find();e&&ce(this,"clear",e.from,e.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],u=St(a.markedSpans,this);r&&!this.collapsed?mn(r,Zr(a),"text"):r&&(null!=u.to&&(i=Zr(a)),null!=u.from&&(n=Zr(a))),a.markedSpans=Tt(a.markedSpans,u),null==u.from&&this.collapsed&&!$t(this.doc,a)&&r&&Xr(a,an(r.display))}if(r&&this.collapsed&&!r.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var s=Pt(this.lines[l]),c=Kt(s);c>r.display.maxLineLength&&(r.display.maxLine=s,r.display.maxLineLength=c,r.display.maxLineChanged=!0)}null!=n&&r&&this.collapsed&&vn(r,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,r&&ao(r.doc)),r&&ce(r,"markerCleared",r,this,n,i),t&&Jn(r),this.parent&&this.parent.clear()}},No.prototype.find=function(r,t){var e,n;null==r&&"bookmark"==this.type&&(r=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=St(o.markedSpans,this);if(null!=a.from&&(e=nt(t?o:Zr(o),a.from),-1==r))return e;if(null!=a.to&&(n=nt(t?o:Zr(o),a.to),1==r))return n}return e&&{from:e,to:n}},No.prototype.changed=function(){var r=this,t=this.find(-1,!0),e=this,n=this.doc.cm;t&&n&&ei(n,(function(){var i=t.line,o=Zr(t.line),a=je(n,o);if(a&&(_e(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!$t(e.doc,i)&&null!=e.height){var u=e.height;e.height=null;var l=Ce(e)-u;l&&Xr(i,i.height+l)}ce(n,"markerChanged",n,r)}))},No.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(r)},No.prototype.detachLine=function(r){if(this.lines.splice(W(this.lines,r),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},yr(No);var Do=function(r,t){this.markers=r,this.primary=t;for(var e=0;e<r.length;++e)r[e].parent=this};function zo(r){return r.findMarks(nt(r.first,0),r.clipPos(nt(r.lastLine())),(function(r){return r.parent}))}function jo(r){for(var t=function(t){var e=r[t],n=[e.primary.doc];Oi(e.primary.doc,(function(r){return n.push(r)}));for(var i=0;i<e.markers.length;i++){var o=e.markers[i];-1==W(n,o.doc)&&(o.parent=null,e.markers.splice(i--,1))}},e=0;e<r.length;e++)t(e)}Do.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var r=0;r<this.markers.length;++r)this.markers[r].clear();ce(this,"clear")}},Do.prototype.find=function(r,t){return this.primary.find(r,t)},yr(Do);var Bo=0,Io=function(r,t,e,n,i){if(!(this instanceof Io))return new Io(r,t,e,n,i);null==e&&(e=0),Ao.call(this,[new Mo([new Qt("",null)])]),this.first=e,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=e;var o=nt(e,0);this.sel=Ni(o),this.history=new Pi(null),this.id=++Bo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof r&&(r=this.splitLines(r)),Fi(this,{from:o,to:o,text:r}),no(this,Ni(o),G)};Io.prototype=rr(Ao.prototype,{constructor:Io,iter:function(r,t,e){e?this.iterN(r-this.first,t-r,e):this.iterN(this.first,this.first+this.size,r)},insert:function(r,t){for(var e=0,n=0;n<t.length;++n)e+=t[n].height;this.insertInner(r-this.first,t,e)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=Yr(this,this.first,this.first+this.size);return!1===r?t:t.join(r||this.lineSeparator())},setValue:oi((function(r){var t=nt(this.first,0),e=this.first+this.size-1;vo(this,{from:t,to:nt(e,Qr(this,e).text.length),text:this.splitLines(r),origin:"setValue",full:!0},!0),this.cm&&In(this.cm,0,0),no(this,Ni(t),G)})),replaceRange:function(r,t,e,n){wo(this,r,t=ct(this,t),e=e?ct(this,e):t,n)},getRange:function(r,t,e){var n=Jr(this,ct(this,r),ct(this,t));return!1===e?n:n.join(""===e?"":e||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(tt(this,r))return Qr(this,r)},getLineNumber:function(r){return Zr(r)},getLineHandleVisualStart:function(r){return"number"==typeof r&&(r=Qr(this,r)),Pt(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return ct(this,r)},getCursor:function(r){var t=this.sel.primary();return null==r||"head"==r?t.head:"anchor"==r?t.anchor:"end"==r||"to"==r||!1===r?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:oi((function(r,t,e){to(this,ct(this,"number"==typeof r?nt(r,t||0):r),null,e)})),setSelection:oi((function(r,t,e){to(this,ct(this,r),ct(this,t||r),e)})),extendSelection:oi((function(r,t,e){Xi(this,ct(this,r),t&&ct(this,t),e)})),extendSelections:oi((function(r,t){Zi(this,ft(this,r),t)})),extendSelectionsBy:oi((function(r,t){Zi(this,ft(this,X(this.sel.ranges,r)),t)})),setSelections:oi((function(r,t,e){if(r.length){for(var n=[],i=0;i<r.length;i++)n[i]=new Si(ct(this,r[i].anchor),ct(this,r[i].head||r[i].anchor));null==t&&(t=Math.min(r.length-1,this.sel.primIndex)),no(this,Ti(this.cm,n,t),e)}})),addSelection:oi((function(r,t,e){var n=this.sel.ranges.slice(0);n.push(new Si(ct(this,r),ct(this,t||r))),no(this,Ti(this.cm,n,n.length-1),e)})),getSelection:function(r){for(var t,e=this.sel.ranges,n=0;n<e.length;n++){var i=Jr(this,e[n].from(),e[n].to());t=t?t.concat(i):i}return!1===r?t:t.join(r||this.lineSeparator())},getSelections:function(r){for(var t=[],e=this.sel.ranges,n=0;n<e.length;n++){var i=Jr(this,e[n].from(),e[n].to());!1!==r&&(i=i.join(r||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(r,t,e){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=r;this.replaceSelections(n,t,e||"+input")},replaceSelections:oi((function(r,t,e){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(r[o]),origin:e}}for(var u=t&&"end"!=t&&function(r,t,e){for(var n=[],i=nt(r.first,0),o=i,a=0;a<t.length;a++){var u=t[a],l=ji(u.from,i,o),s=ji(Ei(u),i,o);if(i=u.to,o=s,"around"==e){var c=r.sel.ranges[a],f=it(c.head,c.anchor)<0;n[a]=new Si(f?s:l,f?l:s)}else n[a]=new Si(l,l)}return new Li(n,r.sel.primIndex)}(this,n,t),l=n.length-1;l>=0;l--)vo(this,n[l]);u?eo(this,u):this.cm&&Bn(this.cm)})),undo:oi((function(){po(this,"undo")})),redo:oi((function(){po(this,"redo")})),undoSelection:oi((function(){po(this,"undo",!0)})),redoSelection:oi((function(){po(this,"redo",!0)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){for(var r=this.history,t=0,e=0,n=0;n<r.done.length;n++)r.done[n].ranges||++t;for(var i=0;i<r.undone.length;i++)r.undone[i].ranges||++e;return{undo:t,redo:e}},clearHistory:function(){var r=this;this.history=new Pi(this.history),Oi(this,(function(t){return t.history=r.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(r){return r&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:Ji(this.history.done),undone:Ji(this.history.undone)}},setHistory:function(r){var t=this.history=new Pi(this.history);t.done=Ji(r.done.slice(0),null,!0),t.undone=Ji(r.undone.slice(0),null,!0)},setGutterMarker:oi((function(r,t,e){return Co(this,r,"gutter",(function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=e,!e&&ir(n)&&(r.gutterMarkers=null),!0}))})),clearGutter:oi((function(r){var t=this;this.iter((function(e){e.gutterMarkers&&e.gutterMarkers[r]&&Co(t,e,"gutter",(function(){return e.gutterMarkers[r]=null,ir(e.gutterMarkers)&&(e.gutterMarkers=null),!0}))}))})),lineInfo:function(r){var t;if("number"==typeof r){if(!tt(this,r))return null;if(t=r,!(r=Qr(this,r)))return null}else if(null==(t=Zr(r)))return null;return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:oi((function(r,t,e){return Co(this,r,"gutter"==t?"gutter":"class",(function(r){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(r[n]){if(A(e).test(r[n]))return!1;r[n]+=" "+e}else r[n]=e;return!0}))})),removeLineClass:oi((function(r,t,e){return Co(this,r,"gutter"==t?"gutter":"class",(function(r){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=r[n];if(!i)return!1;if(null==e)r[n]=null;else{var o=i.match(A(e));if(!o)return!1;var a=o.index+o[0].length;r[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:oi((function(r,t,e){return function(r,t,e,n){var i=new Lo(r,e,n),o=r.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Co(r,t,"widget",(function(t){var e=t.widgets||(t.widgets=[]);if(null==i.insertAt?e.push(i):e.splice(Math.min(e.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!$t(r,t)){var n=Ht(t)<r.scrollTop;Xr(t,t.height+Ce(i)),n&&jn(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ce(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Zr(t)),i}(this,r,t,e)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,e){return Eo(this,ct(this,r),ct(this,t),e,e&&e.type||"range")},setBookmark:function(r,t){var e={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Eo(this,r=ct(this,r),r,e,"bookmark")},findMarksAt:function(r){var t=[],e=Qr(this,(r=ct(this,r)).line).markedSpans;if(e)for(var n=0;n<e.length;++n){var i=e[n];(null==i.from||i.from<=r.ch)&&(null==i.to||i.to>=r.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(r,t,e){r=ct(this,r),t=ct(this,t);var n=[],i=r.line;return this.iter(r.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var u=0;u<a.length;u++){var l=a[u];null!=l.to&&i==r.line&&r.ch>=l.to||null==l.from&&i!=r.line||null!=l.from&&i==t.line&&l.from>=t.ch||e&&!e(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var r=[];return this.iter((function(t){var e=t.markedSpans;if(e)for(var n=0;n<e.length;++n)null!=e[n].from&&r.push(e[n].marker)})),r},posFromIndex:function(r){var t,e=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>r)return t=r,!0;r-=o,++e})),ct(this,nt(e,t))},indexFromPos:function(r){var t=(r=ct(this,r)).ch;if(r.line<this.first||r.ch<0)return 0;var e=this.lineSeparator().length;return this.iter(this.first,r.line,(function(r){t+=r.text.length+e})),t},copy:function(r){var t=new Io(Yr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,r&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(r){r||(r={});var t=this.first,e=this.first+this.size;null!=r.from&&r.from>t&&(t=r.from),null!=r.to&&r.to<e&&(e=r.to);var n=new Io(Yr(this,t,e),r.mode||this.modeOption,t,this.lineSep,this.direction);return r.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:r.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:r.sharedHist}],function(r,t){for(var e=0;e<t.length;e++){var n=t[e],i=n.find(),o=r.clipPos(i.from),a=r.clipPos(i.to);if(it(o,a)){var u=Eo(r,o,a,n.primary,n.primary.type);n.markers.push(u),u.parent=n}}}(n,zo(this)),n},unlinkDoc:function(r){if(r instanceof Da&&(r=r.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==r){this.linked.splice(t,1),r.unlinkDoc(this),jo(zo(this));break}if(r.history==this.history){var e=[r.id];Oi(r,(function(r){return e.push(r.id)}),!0),r.history=new Pi(null),r.history.done=Ji(this.history.done,e),r.history.undone=Ji(this.history.undone,e)}},iterLinkedDocs:function(r){Oi(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){return this.lineSep?r.split(this.lineSep):Br(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oi((function(r){var t;"rtl"!=r&&(r="ltr"),r!=this.direction&&(this.direction=r,this.iter((function(r){return r.order=null})),this.cm&&ei(t=this.cm,(function(){_i(t),vn(t)})))}))}),Io.prototype.eachLine=Io.prototype.iter;var Ro=0;function Fo(r){var t=this;if(Oo(t),!br(t,r)&&!Me(t.display,r)){xr(r),a&&(Ro=+new Date);var e=dn(t,r,!0),n=r.dataTransfer.files;if(e&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),u=0,l=function(){++u==i&&ni(t,(function(){var r={from:e=ct(t.doc,e),to:e,text:t.doc.splitLines(o.filter((function(r){return null!=r})).join(t.doc.lineSeparator())),origin:"paste"};vo(t.doc,r),eo(t.doc,Ni(ct(t.doc,e),ct(t.doc,Ei(r))))}))()},s=function(r,e){if(t.options.allowDropFileTypes&&-1==W(t.options.allowDropFileTypes,r.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var r=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(r)||(o[e]=r),l()},n.readAsText(r)}},c=0;c<n.length;c++)s(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(e)>-1)return t.state.draggingText(r),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=r.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),io(t.doc,Ni(e,e)),d)for(var h=0;h<d.length;++h)wo(t.doc,"",d[h].anchor,d[h].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(r){}}}}function Oo(r){r.display.dragCursor&&(r.display.lineSpace.removeChild(r.display.dragCursor),r.display.dragCursor=null)}function Uo(r){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),e=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&e.push(i)}e.length&&e[0].operation((function(){for(var t=0;t<e.length;t++)r(e[t])}))}}var _o=!1;function Po(){var r;_o||(vr(window,"resize",(function(){null==r&&(r=setTimeout((function(){r=null,Uo(qo)}),100))})),vr(window,"blur",(function(){return Uo(Tn)})),_o=!0)}function qo(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,r.setSize()}for(var Wo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$o=0;$o<10;$o++)Wo[$o+48]=Wo[$o+96]=String($o);for(var Go=65;Go<=90;Go++)Wo[Go]=String.fromCharCode(Go);for(var Ho=1;Ho<=12;Ho++)Wo[Ho+111]=Wo[Ho+63235]="F"+Ho;var Ko={};function Vo(r){var t,e,n,i,o=r.split(/-(?!$)/);r=o[o.length-1];for(var a=0;a<o.length-1;a++){var u=o[a];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))e=!0;else{if(!/^s(hift)?$/i.test(u))throw new Error("Unrecognized modifier name: "+u);n=!0}}return t&&(r="Alt-"+r),e&&(r="Ctrl-"+r),i&&(r="Cmd-"+r),n&&(r="Shift-"+r),r}function Qo(r){var t={};for(var e in r)if(r.hasOwnProperty(e)){var n=r[e];if(/^(name|fallthrough|(de|at)tach)$/.test(e))continue;if("..."==n){delete r[e];continue}for(var i=X(e.split(" "),Vo),o=0;o<i.length;o++){var a=void 0,u=void 0;o==i.length-1?(u=i.join(" "),a=n):(u=i.slice(0,o+1).join(" "),a="...");var l=t[u];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+u)}else t[u]=a}delete r[e]}for(var s in t)r[s]=t[s];return r}function Jo(r,t,e,n){var i=(t=ra(t)).call?t.call(r,n):t[r];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&e(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Jo(r,t.fallthrough,e,n);for(var o=0;o<t.fallthrough.length;o++){var a=Jo(r,t.fallthrough[o],e,n);if(a)return a}}}function Yo(r){var t="string"==typeof r?r:Wo[r.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Xo(r,t,e){var n=r;return t.altKey&&"Alt"!=n&&(r="Alt-"+r),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(r="Cmd-"+r),!e&&t.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r}function Zo(r,t){if(d&&34==r.keyCode&&r.char)return!1;var e=Wo[r.keyCode];return null!=e&&!r.altGraphKey&&(3==r.keyCode&&r.code&&(e=r.code),Xo(e,r,t))}function ra(r){return"string"==typeof r?Ko[r]:r}function ta(r,t){for(var e=r.doc.sel.ranges,n=[],i=0;i<e.length;i++){for(var o=t(e[i]);n.length&&it(o.from,Y(n).to)<=0;){var a=n.pop();if(it(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}ei(r,(function(){for(var t=n.length-1;t>=0;t--)wo(r.doc,"",n[t].from,n[t].to,"+delete");Bn(r)}))}function ea(r,t,e){var n=ur(r.text,t+e,e);return n<0||n>r.text.length?null:n}function na(r,t,e){var n=ea(r,t.ch,e);return null==n?null:new nt(t.line,n,e<0?"after":"before")}function ia(r,t,e,n,i){if(r){"rtl"==t.doc.direction&&(i=-i);var o=dr(e,t.doc.direction);if(o){var a,u=i<0?Y(o):o[0],l=i<0==(1==u.level)?"after":"before";if(u.level>0||"rtl"==t.doc.direction){var s=Be(t,e),c=Ie(t,s,a=i<0?e.text.length-1:0).top;a=lr((function(r){return Ie(t,s,r).top==c}),i<0==(1==u.level)?u.from:u.to-1,a),"before"==l&&(a=ea(e,a,1))}else a=i<0?u.to:u.from;return new nt(n,a,l)}}return new nt(n,i<0?e.text.length:0,i<0?"before":"after")}Ko.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ko.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ko.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ko.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ko.default=w?Ko.macDefault:Ko.pcDefault;var oa={selectAll:fo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),G)},killLine:function(r){return ta(r,(function(t){if(t.empty()){var e=Qr(r.doc,t.head.line).text.length;return t.head.ch==e&&t.head.line<r.lastLine()?{from:t.head,to:nt(t.head.line+1,0)}:{from:t.head,to:nt(t.head.line,e)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(r){return ta(r,(function(t){return{from:nt(t.from().line,0),to:ct(r.doc,nt(t.to().line+1,0))}}))},delLineLeft:function(r){return ta(r,(function(r){return{from:nt(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return ta(r,(function(t){var e=r.charCoords(t.head,"div").top+5;return{from:r.coordsChar({left:0,top:e},"div"),to:t.from()}}))},delWrappedLineRight:function(r){return ta(r,(function(t){var e=r.charCoords(t.head,"div").top+5,n=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div");return{from:t.from(),to:n}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(nt(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(nt(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return aa(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return ua(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return function(r,t){var e=Qr(r.doc,t),n=function(r){for(var t;t=Ot(r);)r=t.find(1,!0).line;return r}(e);return n!=e&&(t=Zr(n)),ia(!0,r,e,t,-1)}(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div")}),K)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:e},"div")}),K)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5,n=r.coordsChar({left:0,top:e},"div");return n.ch<r.getLine(n.line).search(/\S/)?ua(r,t.head):n}),K)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){for(var t=[],e=r.listSelections(),n=r.options.tabSize,i=0;i<e.length;i++){var o=e[i].from(),a=P(r.getLine(o.line),o.ch,n);t.push(J(n-a%n))}r.replaceSelections(t)},defaultTab:function(r){r.somethingSelected()?r.indentSelection("add"):r.execCommand("insertTab")},transposeChars:function(r){return ei(r,(function(){for(var t=r.listSelections(),e=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=Qr(r.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new nt(i.line,i.ch-1)),i.ch>0)i=new nt(i.line,i.ch+1),r.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),nt(i.line,i.ch-2),i,"+transpose");else if(i.line>r.doc.first){var a=Qr(r.doc,i.line-1).text;a&&(i=new nt(i.line,1),r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+a.charAt(a.length-1),nt(i.line-1,a.length-1),i,"+transpose"))}e.push(new Si(i,i))}r.setSelections(e)}))},newlineAndIndent:function(r){return ei(r,(function(){for(var t=r.listSelections(),e=t.length-1;e>=0;e--)r.replaceRange(r.doc.lineSeparator(),t[e].anchor,t[e].head,"+input");t=r.listSelections();for(var n=0;n<t.length;n++)r.indentLine(t[n].from().line,null,!0);Bn(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function aa(r,t){var e=Qr(r.doc,t),n=Pt(e);return n!=e&&(t=Zr(n)),ia(!0,r,n,t,1)}function ua(r,t){var e=aa(r,t.line),n=Qr(r.doc,e.line),i=dr(n,r.doc.direction);if(!i||0==i[0].level){var o=Math.max(e.ch,n.text.search(/\S/));return nt(e.line,t.line==e.line&&t.ch<=o&&t.ch?0:o,e.sticky)}return e}function la(r,t,e){if("string"==typeof t&&!(t=oa[t]))return!1;r.display.input.ensurePolled();var n=r.display.shift,i=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),e&&(r.display.shift=!1),i=t(r)!=$}finally{r.display.shift=n,r.state.suppressEdits=!1}return i}var sa=new q;function ca(r,t,e,n){var i=r.state.keySeq;if(i){if(Yo(t))return"handled";if(/\'$/.test(t)?r.state.keySeq=null:sa.set(50,(function(){r.state.keySeq==i&&(r.state.keySeq=null,r.display.input.reset())})),fa(r,i+" "+t,e,n))return!0}return fa(r,t,e,n)}function fa(r,t,e,n){var i=function(r,t,e){for(var n=0;n<r.state.keyMaps.length;n++){var i=Jo(t,r.state.keyMaps[n],e,r);if(i)return i}return r.options.extraKeys&&Jo(t,r.options.extraKeys,e,r)||Jo(t,r.options.keyMap,e,r)}(r,t,n);return"multi"==i&&(r.state.keySeq=t),"handled"==i&&ce(r,"keyHandled",r,t,e),"handled"!=i&&"multi"!=i||(xr(e),Mn(r)),!!i}function da(r,t){var e=Zo(t,!0);return!!e&&(t.shiftKey&&!r.state.keySeq?ca(r,"Shift-"+e,t,(function(t){return la(r,t,!0)}))||ca(r,e,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return la(r,t)})):ca(r,e,t,(function(t){return la(r,t)})))}var ha=null;function va(r){var t=this;if(!(r.target&&r.target!=t.display.input.getField()||(t.curOp.focus=j(F(t)),br(t,r)))){a&&u<11&&27==r.keyCode&&(r.returnValue=!1);var n=r.keyCode;t.display.shift=16==n||r.shiftKey;var i=da(t,r);d&&(ha=i?n:null,i||88!=n||Rr||!(w?r.metaKey:r.ctrlKey)||t.replaceSelection("",null,"cut")),e&&!w&&!i&&46==n&&r.shiftKey&&!r.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(r){var t=r.display.lineDiv;function e(r){18!=r.keyCode&&r.altKey||(S(t,"CodeMirror-crosshair"),pr(document,"keyup",e),pr(document,"mouseover",e))}B(t,"CodeMirror-crosshair"),vr(document,"keyup",e),vr(document,"mouseover",e)}(t)}}function ma(r){16==r.keyCode&&(this.doc.sel.shift=!1),br(this,r)}function pa(r){var t=this;if(!(r.target&&r.target!=t.display.input.getField()||Me(t.display,r)||br(t,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey)){var e=r.keyCode,n=r.charCode;if(d&&e==ha)return ha=null,void xr(r);if(!d||r.which&&!(r.which<10)||!da(t,r)){var i=String.fromCharCode(null==n?e:n);"\b"!=i&&(function(r,t,e){return ca(r,"'"+e+"'",t,(function(t){return la(r,t,!0)}))}(t,r,i)||t.display.input.onKeyPress(r))}}}var ga,ba,wa=function(r,t,e){this.time=r,this.pos=t,this.button=e};function ka(r){var t=this,e=t.display;if(!(br(t,r)||e.activeTouch&&e.input.supportsTouch()))if(e.input.ensurePolled(),e.shift=r.shiftKey,Me(e,r))l||(e.scroller.draggable=!1,setTimeout((function(){return e.scroller.draggable=!0}),100));else if(!Ca(t,r)){var n=dn(t,r),i=Sr(r),o=n?function(r,t){var e=+new Date;return ba&&ba.compare(e,r,t)?(ga=ba=null,"triple"):ga&&ga.compare(e,r,t)?(ba=new wa(e,r,t),ga=null,"double"):(ga=new wa(e,r,t),ba=null,"single")}(n,i):"single";O(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(r),n&&function(r,t,e,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),ca(r,Xo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=oa[t]),!t)return!1;var n=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),n=t(r,e)!=$}finally{r.state.suppressEdits=!1}return n}))}(t,i,n,o,r)||(1==i?n?function(r,t,e,n){a?setTimeout(U(An,r),0):r.curOp.focus=j(F(r));var i,o=function(r,t,e){var n=r.getOption("configureMouse"),i=n?n(r,t,e):{};return null==i.unit&&(i.unit=(k?e.shiftKey&&e.metaKey:e.altKey)?"rectangle":"single"==t?"char":"double"==t?"word":"line"),(null==i.extend||r.doc.extend)&&(i.extend=r.doc.extend||e.shiftKey),null==i.addNew&&(i.addNew=w?e.metaKey:e.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(w?e.altKey:e.ctrlKey)),i}(r,e,n),s=r.doc.sel;r.options.dragDrop&&Er&&!r.isReadOnly()&&"single"==e&&(i=s.contains(t))>-1&&(it((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(it(i.to(),t)>0||t.xRel<0)?function(r,t,e,n){var i=r.display,o=!1,s=ni(r,(function(t){l&&(i.scroller.draggable=!1),r.state.draggingText=!1,r.state.delayingBlurEvent&&(r.hasFocus()?r.state.delayingBlurEvent=!1:Ln(r)),pr(i.wrapper.ownerDocument,"mouseup",s),pr(i.wrapper.ownerDocument,"mousemove",c),pr(i.scroller,"dragstart",f),pr(i.scroller,"drop",s),o||(xr(t),n.addNew||Xi(r.doc,e,null,null,n.extend),l&&!h||a&&9==u?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10},f=function(){return o=!0};l&&(i.scroller.draggable=!0),r.state.draggingText=s,s.copy=!n.moveOnDrag,vr(i.wrapper.ownerDocument,"mouseup",s),vr(i.wrapper.ownerDocument,"mousemove",c),vr(i.scroller,"dragstart",f),vr(i.scroller,"drop",s),r.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(r,n,t,o):function(r,t,e,n){a&&Ln(r);var i=r.display,o=r.doc;xr(t);var u,l,s=o.sel,c=s.ranges;if(n.addNew&&!n.extend?(l=o.sel.contains(e),u=l>-1?c[l]:new Si(e,e)):(u=o.sel.primary(),l=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(u=new Si(e,e)),e=dn(r,t,!0,!0),l=-1;else{var f=ya(r,e,n.unit);u=n.extend?Yi(u,f.anchor,f.head,n.extend):f}n.addNew?-1==l?(l=c.length,no(o,Ti(r,c.concat([u]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==n.unit&&!n.extend?(no(o,Ti(r,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):ro(o,l,u,H):(l=0,no(o,new Li([u],0),H),s=o.sel);var d=e;function h(t){if(0!=it(d,t))if(d=t,"rectangle"==n.unit){for(var i=[],a=r.options.tabSize,c=P(Qr(o,e.line).text,e.ch,a),f=P(Qr(o,t.line).text,t.ch,a),h=Math.min(c,f),v=Math.max(c,f),m=Math.min(e.line,t.line),p=Math.min(r.lastLine(),Math.max(e.line,t.line));m<=p;m++){var g=Qr(o,m).text,b=V(g,h,a);h==v?i.push(new Si(nt(m,b),nt(m,b))):g.length>b&&i.push(new Si(nt(m,b),nt(m,V(g,v,a))))}i.length||i.push(new Si(e,e)),no(o,Ti(r,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),r.scrollIntoView(t)}else{var w,k=u,y=ya(r,t,n.unit),x=k.anchor;it(y.anchor,x)>0?(w=y.head,x=lt(k.from(),y.anchor)):(w=y.anchor,x=ut(k.to(),y.head));var C=s.ranges.slice(0);C[l]=function(r,t){var e=t.anchor,n=t.head,i=Qr(r.doc,e.line);if(0==it(e,n)&&e.sticky==n.sticky)return t;var o=dr(i);if(!o)return t;var a=cr(o,e.ch,e.sticky),u=o[a];if(u.from!=e.ch&&u.to!=e.ch)return t;var l,s=a+(u.from==e.ch==(1!=u.level)?0:1);if(0==s||s==o.length)return t;if(n.line!=e.line)l=(n.line-e.line)*("ltr"==r.doc.direction?1:-1)>0;else{var c=cr(o,n.ch,n.sticky),f=c-a||(n.ch-e.ch)*(1==u.level?-1:1);l=c==s-1||c==s?f<0:f>0}var d=o[s+(l?-1:0)],h=l==(1==d.level),v=h?d.from:d.to,m=h?"after":"before";return e.ch==v&&e.sticky==m?t:new Si(new nt(e.line,v,m),n)}(r,new Si(ct(o,x),w)),no(o,Ti(r,C,l),H)}}var v=i.wrapper.getBoundingClientRect(),m=0;function p(t){var e=++m,a=dn(r,t,!0,"rectangle"==n.unit);if(a)if(0!=it(a,d)){r.curOp.focus=j(F(r)),h(a);var u=Dn(i,o);(a.line>=u.to||a.line<u.from)&&setTimeout(ni(r,(function(){m==e&&p(t)})),150)}else{var l=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;l&&setTimeout(ni(r,(function(){m==e&&(i.scroller.scrollTop+=l,p(t))})),50)}}function g(t){r.state.selectingText=!1,m=1/0,t&&(xr(t),i.input.focus()),pr(i.wrapper.ownerDocument,"mousemove",b),pr(i.wrapper.ownerDocument,"mouseup",w),o.history.lastSelOrigin=null}var b=ni(r,(function(r){0!==r.buttons&&Sr(r)?p(r):g(r)})),w=ni(r,g);r.state.selectingText=w,vr(i.wrapper.ownerDocument,"mousemove",b),vr(i.wrapper.ownerDocument,"mouseup",w)}(r,n,t,o)}(t,n,o,r):Lr(r)==e.scroller&&xr(r):2==i?(n&&Xi(t.doc,n),setTimeout((function(){return e.input.focus()}),20)):3==i&&(M?t.display.input.onContextMenu(r):Ln(t)))}}function ya(r,t,e){if("char"==e)return new Si(t,t);if("word"==e)return r.findWordAt(t);if("line"==e)return new Si(nt(t.line,0),ct(r.doc,nt(t.line+1,0)));var n=e(r,t);return new Si(n.from,n.to)}function xa(r,t,e,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(r){return!1}if(i>=Math.floor(r.display.gutters.getBoundingClientRect().right))return!1;n&&xr(t);var a=r.display,u=a.lineDiv.getBoundingClientRect();if(o>u.bottom||!kr(r,e))return Mr(t);o-=u.top-a.viewOffset;for(var l=0;l<r.display.gutterSpecs.length;++l){var s=a.gutters.childNodes[l];if(s&&s.getBoundingClientRect().right>=i)return gr(r,e,r,rt(r.doc,o),r.display.gutterSpecs[l].className,t),Mr(t)}}function Ca(r,t){return xa(r,t,"gutterClick",!0)}function Ma(r,t){Me(r.display,t)||function(r,t){return!!kr(r,"gutterContextMenu")&&xa(r,t,"gutterContextMenu",!1)}(r,t)||br(r,t,"contextmenu")||M||r.display.input.onContextMenu(t)}function Aa(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qe(r)}wa.prototype.compare=function(r,t,e){return this.time+400>r&&0==it(t,this.pos)&&e==this.button};var La={toString:function(){return"CodeMirror.Init"}},Sa={},Ta={};function Na(r,t,e){if(!t!=!(e&&e!=La)){var n=r.display.dragFunctions,i=t?vr:pr;i(r.display.scroller,"dragstart",n.start),i(r.display.scroller,"dragenter",n.enter),i(r.display.scroller,"dragover",n.over),i(r.display.scroller,"dragleave",n.leave),i(r.display.scroller,"drop",n.drop)}}function Ea(r){r.options.lineWrapping?(B(r.display.wrapper,"CodeMirror-wrap"),r.display.sizer.style.minWidth="",r.display.sizerWidth=null):(S(r.display.wrapper,"CodeMirror-wrap"),Vt(r)),fn(r),vn(r),qe(r),setTimeout((function(){return $n(r)}),100)}function Da(r,t){var e=this;if(!(this instanceof Da))return new Da(r,t);this.options=t=t?_(t):{},_(Sa,t,!1);var n=t.value;"string"==typeof n?n=new Io(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Da.inputStyles[t.inputStyle](this),o=this.display=new ki(r,n,i,t);for(var s in o.wrapper.CodeMirror=this,Aa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},t.autofocus&&!b&&o.input.focus(),a&&u<11&&setTimeout((function(){return e.display.input.reset(!0)}),20),function(r){var t=r.display;vr(t.scroller,"mousedown",ni(r,ka)),vr(t.scroller,"dblclick",a&&u<11?ni(r,(function(t){if(!br(r,t)){var e=dn(r,t);if(e&&!Ca(r,t)&&!Me(r.display,t)){xr(t);var n=r.findWordAt(e);Xi(r.doc,n.anchor,n.head)}}})):function(t){return br(r,t)||xr(t)}),vr(t.scroller,"contextmenu",(function(t){return Ma(r,t)})),vr(t.input.getField(),"contextmenu",(function(e){t.scroller.contains(e.target)||Ma(r,e)}));var e,n={end:0};function i(){t.activeTouch&&(e=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(r){if(1!=r.touches.length)return!1;var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(r,t){if(null==t.left)return!0;var e=t.left-r.left,n=t.top-r.top;return e*e+n*n>400}vr(t.scroller,"touchstart",(function(i){if(!br(r,i)&&!o(i)&&!Ca(r,i)){t.input.ensurePolled(),clearTimeout(e);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),vr(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),vr(t.scroller,"touchend",(function(e){var n=t.activeTouch;if(n&&!Me(t,e)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,a=r.coordsChar(t.activeTouch,"page");o=!n.prev||l(n,n.prev)?new Si(a,a):!n.prev.prev||l(n,n.prev.prev)?r.findWordAt(a):new Si(nt(a.line,0),ct(r.doc,nt(a.line+1,0))),r.setSelection(o.anchor,o.head),r.focus(),xr(e)}i()})),vr(t.scroller,"touchcancel",i),vr(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(On(r,t.scroller.scrollTop),_n(r,t.scroller.scrollLeft,!0),gr(r,"scroll",r))})),vr(t.scroller,"mousewheel",(function(t){return Ai(r,t)})),vr(t.scroller,"DOMMouseScroll",(function(t){return Ai(r,t)})),vr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){br(r,t)||Ar(t)},over:function(t){br(r,t)||(function(r,t){var e=dn(r,t);if(e){var n=document.createDocumentFragment();yn(r,e,n),r.display.dragCursor||(r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),N(r.display.dragCursor,n)}}(r,t),Ar(t))},start:function(t){return function(r,t){if(a&&(!r.state.draggingText||+new Date-Ro<100))Ar(t);else if(!br(r,t)&&!Me(r.display,t)&&(t.dataTransfer.setData("Text",r.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var e=E("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(e.width=e.height=1,r.display.wrapper.appendChild(e),e._top=e.offsetTop),t.dataTransfer.setDragImage(e,0,0),d&&e.parentNode.removeChild(e)}}(r,t)},drop:ni(r,Fo),leave:function(t){br(r,t)||Oo(r)}};var s=t.input.getField();vr(s,"keyup",(function(t){return ma.call(r,t)})),vr(s,"keydown",ni(r,va)),vr(s,"keypress",ni(r,pa)),vr(s,"focus",(function(t){return Sn(r,t)})),vr(s,"blur",(function(t){return Tn(r,t)}))}(this),Po(),Qn(this),this.curOp.forceUpdate=!0,Ui(this,n),t.autofocus&&!b||this.hasFocus()?setTimeout((function(){e.hasFocus()&&!e.state.focused&&Sn(e)}),20):Tn(this),Ta)Ta.hasOwnProperty(s)&&Ta[s](this,t[s],La);pi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<za.length;++c)za[c](this);Jn(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Da.defaults=Sa,Da.optionHandlers=Ta;var za=[];function ja(r,t,e,n){var i,o=r.doc;null==e&&(e="add"),"smart"==e&&(o.mode.indent?i=pt(r,t).state:e="prev");var a=r.options.tabSize,u=Qr(o,t),l=P(u.text,null,a);u.stateAfter&&(u.stateAfter=null);var s,c=u.text.match(/^\s*/)[0];if(n||/\S/.test(u.text)){if("smart"==e&&((s=o.mode.indent(i,u.text.slice(c.length),u.text))==$||s>150)){if(!n)return;e="prev"}}else s=0,e="not";"prev"==e?s=t>o.first?P(Qr(o,t-1).text,null,a):0:"add"==e?s=l+r.options.indentUnit:"subtract"==e?s=l-r.options.indentUnit:"number"==typeof e&&(s=l+e),s=Math.max(0,s);var f="",d=0;if(r.options.indentWithTabs)for(var h=Math.floor(s/a);h;--h)d+=a,f+="\t";if(d<s&&(f+=J(s-d)),f!=c)return wo(o,f,nt(t,0),nt(t,c.length),"+input"),u.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==t&&m.head.ch<c.length){var p=nt(t,c.length);ro(o,v,new Si(p,p));break}}}Da.defineInitHook=function(r){return za.push(r)};var Ba=null;function Ia(r){Ba=r}function Ra(r,t,e,n,i){var o=r.doc;r.display.shift=!1,n||(n=o.sel);var a=+new Date-200,u="paste"==i||r.state.pasteIncoming>a,l=Br(t),s=null;if(u&&n.ranges.length>1)if(Ba&&Ba.text.join("\n")==t){if(n.ranges.length%Ba.text.length==0){s=[];for(var c=0;c<Ba.text.length;c++)s.push(o.splitLines(Ba.text[c]))}}else l.length==n.ranges.length&&r.options.pasteLinesPerSelection&&(s=X(l,(function(r){return[r]})));for(var f=r.curOp.updateInput,d=n.ranges.length-1;d>=0;d--){var h=n.ranges[d],v=h.from(),m=h.to();h.empty()&&(e&&e>0?v=nt(v.line,v.ch-e):r.state.overwrite&&!u?m=nt(m.line,Math.min(Qr(o,m.line).text.length,m.ch+Y(l).length)):u&&Ba&&Ba.lineWise&&Ba.text.join("\n")==l.join("\n")&&(v=m=nt(v.line,0)));var p={from:v,to:m,text:s?s[d%s.length]:l,origin:i||(u?"paste":r.state.cutIncoming>a?"cut":"+input")};vo(r.doc,p),ce(r,"inputRead",r,p)}t&&!u&&Oa(r,t),Bn(r),r.curOp.updateInput<2&&(r.curOp.updateInput=f),r.curOp.typing=!0,r.state.pasteIncoming=r.state.cutIncoming=-1}function Fa(r,t){var e=r.clipboardData&&r.clipboardData.getData("Text");if(e)return r.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||ei(t,(function(){return Ra(t,e,0,null,"paste")})),!0}function Oa(r,t){if(r.options.electricChars&&r.options.smartIndent)for(var e=r.doc.sel,n=e.ranges.length-1;n>=0;n--){var i=e.ranges[n];if(!(i.head.ch>100||n&&e.ranges[n-1].head.line==i.head.line)){var o=r.getModeAt(i.head),a=!1;if(o.electricChars){for(var u=0;u<o.electricChars.length;u++)if(t.indexOf(o.electricChars.charAt(u))>-1){a=ja(r,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qr(r.doc,i.head.line).text.slice(0,i.head.ch))&&(a=ja(r,i.head.line,"smart"));a&&ce(r,"electricInput",r,i.head.line)}}}function Ua(r){for(var t=[],e=[],n=0;n<r.doc.sel.ranges.length;n++){var i=r.doc.sel.ranges[n].head.line,o={anchor:nt(i,0),head:nt(i+1,0)};e.push(o),t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:e}}function _a(r,t,e,n){r.setAttribute("autocorrect",e?"":"off"),r.setAttribute("autocapitalize",n?"":"off"),r.setAttribute("spellcheck",!!t)}function Pa(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?r.style.width="1000px":r.setAttribute("wrap","off"),p&&(r.style.border="1px solid black"),_a(r),t}function qa(r,t,e,n,i){var o=t,a=e,u=Qr(r,t.line),l=i&&"rtl"==r.direction?-e:e;function s(o){var a,s;if("codepoint"==n){var c=u.text.charCodeAt(t.ch+(e>0?0:-1));a=isNaN(c)?null:new nt(t.line,Math.max(0,Math.min(u.text.length,t.ch+e*((e>0?c>=55296&&c<56320:c>=56320&&c<57343)?2:1))),-e)}else a=i?function(r,t,e,n){var i=dr(t,r.doc.direction);if(!i)return na(t,e,n);e.ch>=t.text.length?(e.ch=t.text.length,e.sticky="before"):e.ch<=0&&(e.ch=0,e.sticky="after");var o=cr(i,e.ch,e.sticky),a=i[o];if("ltr"==r.doc.direction&&a.level%2==0&&(n>0?a.to>e.ch:a.from<e.ch))return na(t,e,n);var u,l=function(r,e){return ea(t,r instanceof nt?r.ch:r,e)},s=function(e){return r.options.lineWrapping?(u=u||Be(r,t),rn(r,t,u,e)):{begin:0,end:t.text.length}},c=s("before"==e.sticky?l(e,-1):e.ch);if("rtl"==r.doc.direction||1==a.level){var f=1==a.level==n<0,d=l(e,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=c.end:d>=a.from&&d>=c.begin))return new nt(e.line,d,f?"before":"after")}var h=function(r,t,n){for(var o=function(r,t){return t?new nt(e.line,l(r,1),"before"):new nt(e.line,r,"after")};r>=0&&r<i.length;r+=t){var a=i[r],u=t>0==(1!=a.level),s=u?n.begin:l(n.end,-1);if(a.from<=s&&s<a.to)return o(s,u);if(s=u?a.from:l(a.to,-1),n.begin<=s&&s<n.end)return o(s,u)}},v=h(o+n,n,c);if(v)return v;var m=n>0?c.end:l(c.begin,-1);return null==m||n>0&&m==t.text.length||!(v=h(n>0?0:i.length-1,n,s(m)))?null:v}(r.cm,u,t,e):na(u,t,e);if(null==a){if(o||((s=t.line+l)<r.first||s>=r.first+r.size||(t=new nt(s,t.ch,t.sticky),!(u=Qr(r,s)))))return!1;t=ia(i,r.cm,u,t.line,l)}else t=a;return!0}if("char"==n||"codepoint"==n)s();else if("column"==n)s(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,d=r.cm&&r.cm.getHelper(t,"wordChars"),h=!0;!(e<0)||s(!h);h=!1){var v=u.text.charAt(t.ch)||"\n",m=nr(v,d)?"w":f&&"\n"==v?"n":!f||/\s/.test(v)?null:"p";if(!f||h||m||(m="s"),c&&c!=m){e<0&&(e=1,s(),t.sticky="after");break}if(m&&(c=m),e>0&&!s(!h))break}var p=so(r,t,o,a,!0);return ot(o,p)&&(p.hitSide=!0),p}function Wa(r,t,e,n){var i,o,a=r.doc,u=t.left;if("page"==n){var l=Math.min(r.display.wrapper.clientHeight,O(r).innerHeight||a(r).documentElement.clientHeight),s=Math.max(l-.5*an(r.display),3);i=(e>0?t.bottom:t.top)+e*s}else"line"==n&&(i=e>0?t.bottom+3:t.top-3);for(;(o=Xe(r,u,i)).outside;){if(e<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*e}return o}var $a=function(r){this.cm=r,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ga(r,t){var e=je(r,t.line);if(!e||e.hidden)return null;var n=Qr(r.doc,t.line),i=De(e,n,t.line),o=dr(n,r.doc.direction),a="left";o&&(a=cr(o,t.ch)%2?"right":"left");var u=Oe(i.map,t.ch,a);return u.offset="right"==u.collapse?u.end:u.start,u}function Ha(r,t){return t&&(r.bad=!0),r}function Ka(r,t,e){var n;if(t==r.display.lineDiv){if(!(n=r.display.lineDiv.childNodes[e]))return Ha(r.clipPos(nt(r.display.viewTo-1)),!0);t=null,e=0}else for(n=t;;n=n.parentNode){if(!n||n==r.display.lineDiv)return null;if(n.parentNode&&n.parentNode==r.display.lineDiv)break}for(var i=0;i<r.display.view.length;i++){var o=r.display.view[i];if(o.node==n)return Va(o,t,e)}}function Va(r,t,e){var n=r.text.firstChild,i=!1;if(!t||!z(n,t))return Ha(nt(Zr(r.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[e],e=0,!t)){var o=r.rest?Y(r.rest):r.line;return Ha(nt(Zr(o),o.text.length),i)}var a=3==t.nodeType?t:null,u=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,e&&(e=a.nodeValue.length));u.parentNode!=n;)u=u.parentNode;var l=r.measure,s=l.maps;function c(t,e,n){for(var i=-1;i<(s?s.length:0);i++)for(var o=i<0?l.map:s[i],a=0;a<o.length;a+=3){var u=o[a+2];if(u==t||u==e){var c=Zr(i<0?r.line:r.rest[i]),f=o[a]+n;return(n<0||u!=t)&&(f=o[a+(n?1:0)]),nt(c,f)}}}var f=c(a,u,e);if(f)return Ha(f,i);for(var d=u.nextSibling,h=a?a.nodeValue.length-e:0;d;d=d.nextSibling){if(f=c(d,d.firstChild,0))return Ha(nt(f.line,f.ch-h),i);h+=d.textContent.length}for(var v=u.previousSibling,m=e;v;v=v.previousSibling){if(f=c(v,v.firstChild,-1))return Ha(nt(f.line,f.ch+m),i);m+=v.textContent.length}}$a.prototype.init=function(r){var t=this,e=this,n=e.cm,i=e.div=r.lineDiv;function o(r){for(var t=r.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(r){if(o(r)&&!br(n,r)){if(n.somethingSelected())Ia({lineWise:!1,text:n.getSelections()}),"cut"==r.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ua(n);Ia({lineWise:!0,text:t.text}),"cut"==r.type&&n.operation((function(){n.setSelections(t.ranges,0,G),n.replaceSelection("",null,"cut")}))}if(r.clipboardData){r.clipboardData.clearData();var a=Ba.text.join("\n");if(r.clipboardData.setData("Text",a),r.clipboardData.getData("Text")==a)return void r.preventDefault()}var u=Pa(),l=u.firstChild;n.display.lineSpace.insertBefore(u,n.display.lineSpace.firstChild),l.value=Ba.text.join("\n");var s=j(i.ownerDocument);R(l),setTimeout((function(){n.display.lineSpace.removeChild(u),s.focus(),s==i&&e.showPrimarySelection()}),50)}}i.contentEditable=!0,_a(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),vr(i,"paste",(function(r){!o(r)||br(n,r)||Fa(r,n)||u<=11&&setTimeout(ni(n,(function(){return t.updateFromDOM()})),20)})),vr(i,"compositionstart",(function(r){t.composing={data:r.data,done:!1}})),vr(i,"compositionupdate",(function(r){t.composing||(t.composing={data:r.data,done:!1})})),vr(i,"compositionend",(function(r){t.composing&&(r.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),vr(i,"touchstart",(function(){return e.forceCompositionEnd()})),vr(i,"input",(function(){t.composing||t.readFromDOMSoon()})),vr(i,"copy",a),vr(i,"cut",a)},$a.prototype.screenReaderLabelChanged=function(r){r?this.div.setAttribute("aria-label",r):this.div.removeAttribute("aria-label")},$a.prototype.prepareSelection=function(){var r=kn(this.cm,!1);return r.focus=j(this.div.ownerDocument)==this.div,r},$a.prototype.showSelection=function(r,t){r&&this.cm.display.view.length&&((r.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(r))},$a.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$a.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)r.removeAllRanges();else{var a=Ka(t,r.anchorNode,r.anchorOffset),u=Ka(t,r.focusNode,r.focusOffset);if(!a||a.bad||!u||u.bad||0!=it(lt(a,u),i)||0!=it(ut(a,u),o)){var l=t.display.view,s=i.line>=t.display.viewFrom&&Ga(t,i)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ga(t,o);if(!c){var f=l[l.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(s&&c){var h,v=r.rangeCount&&r.getRangeAt(0);try{h=L(s.node,s.offset,c.offset,c.node)}catch(r){}h&&(!e&&t.state.focused?(r.collapse(s.node,s.offset),h.collapsed||(r.removeAllRanges(),r.addRange(h))):(r.removeAllRanges(),r.addRange(h)),v&&null==r.anchorNode?r.addRange(v):e&&this.startGracePeriod()),this.rememberSelection()}else r.removeAllRanges()}}},$a.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){r.gracePeriod=!1,r.selectionChanged()&&r.cm.operation((function(){return r.cm.curOp.selectionChanged=!0}))}),20)},$a.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors),N(this.cm.display.selectionDiv,r.selection)},$a.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode,this.lastAnchorOffset=r.anchorOffset,this.lastFocusNode=r.focusNode,this.lastFocusOffset=r.focusOffset},$a.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount)return!1;var t=r.getRangeAt(0).commonAncestorContainer;return z(this.div,t)},$a.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&j(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},$a.prototype.blur=function(){this.div.blur()},$a.prototype.getField=function(){return this.div},$a.prototype.supportsTouch=function(){return!0},$a.prototype.receivedFocus=function(){var r=this,t=this;this.selectionInEditor()?setTimeout((function(){return r.pollSelection()}),20):ei(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}))},$a.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset},$a.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var r=this.getSelection(),t=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&function(r){for(var t=r;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(r.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var e=Ka(t,r.anchorNode,r.anchorOffset),n=Ka(t,r.focusNode,r.focusOffset);e&&n&&ei(t,(function(){no(t.doc,Ni(e,n),G),(e.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},$a.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var r,t,e,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),u=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=nt(a.line-1,Qr(n.doc,a.line-1).length)),u.ch==Qr(n.doc,u.line).text.length&&u.line<n.lastLine()&&(u=nt(u.line+1,0)),a.line<i.viewFrom||u.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(r=hn(n,a.line))?(t=Zr(i.view[0].line),e=i.view[0].node):(t=Zr(i.view[r].line),e=i.view[r-1].node.nextSibling);var l,s,c=hn(n,u.line);if(c==i.view.length-1?(l=i.viewTo-1,s=i.lineDiv.lastChild):(l=Zr(i.view[c+1].line)-1,s=i.view[c+1].node.previousSibling),!e)return!1;for(var f=n.doc.splitLines(function(r,t,e,n,i){var o="",a=!1,u=r.doc.lineSeparator(),l=!1;function s(){a&&(o+=u,l&&(o+=u),a=l=!1)}function c(r){r&&(s(),o+=r)}function f(t){if(1==t.nodeType){var e=t.getAttribute("cm-text");if(e)return void c(e);var o,d=t.getAttribute("cm-marker");if(d){var h=r.findMarks(nt(n,0),nt(i+1,0),(p=+d,function(r){return r.id==p}));return void(h.length&&(o=h[0].find(0))&&c(Jr(r.doc,o.from,o.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;var v=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;v&&s();for(var m=0;m<t.childNodes.length;m++)f(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),v&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var p}for(;f(t),t!=e;)t=t.nextSibling,l=!1;return o}(n,e,s,t,l)),d=Jr(n.doc,nt(t,0),nt(l,Qr(n.doc,l).text.length));f.length>1&&d.length>1;)if(Y(f)==Y(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,v=0,m=f[0],p=d[0],g=Math.min(m.length,p.length);h<g&&m.charCodeAt(h)==p.charCodeAt(h);)++h;for(var b=Y(f),w=Y(d),k=Math.min(b.length-(1==f.length?h:0),w.length-(1==d.length?h:0));v<k&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1);)++v;if(1==f.length&&1==d.length&&t==a.line)for(;h&&h>a.ch&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1);)h--,v++;f[f.length-1]=b.slice(0,b.length-v).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var y=nt(t,h),x=nt(l,d.length?Y(d).length-v:0);return f.length>1||f[0]||it(y,x)?(wo(n.doc,f,y,x,"+input"),!0):void 0},$a.prototype.ensurePolled=function(){this.forceCompositionEnd()},$a.prototype.reset=function(){this.forceCompositionEnd()},$a.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},$a.prototype.readFromDOMSoon=function(){var r=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(r.readDOMTimeout=null,r.composing){if(!r.composing.done)return;r.composing=null}r.updateFromDOM()}),80))},$a.prototype.updateFromDOM=function(){var r=this;!this.cm.isReadOnly()&&this.pollContent()||ei(this.cm,(function(){return vn(r.cm)}))},$a.prototype.setUneditable=function(r){r.contentEditable="false"},$a.prototype.onKeyPress=function(r){0==r.charCode||this.composing||(r.preventDefault(),this.cm.isReadOnly()||ni(this.cm,Ra)(this.cm,String.fromCharCode(null==r.charCode?r.keyCode:r.charCode),0))},$a.prototype.readOnlyChanged=function(r){this.div.contentEditable=String("nocursor"!=r)},$a.prototype.onContextMenu=function(){},$a.prototype.resetPosition=function(){},$a.prototype.needsContentAttribute=!0;var Qa=function(r){this.cm=r,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null,this.resetting=!1};Qa.prototype.init=function(r){var t=this,e=this,n=this.cm;this.createField(r);var i=this.textarea;function o(r){if(!br(n,r)){if(n.somethingSelected())Ia({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ua(n);Ia({lineWise:!0,text:t.text}),"cut"==r.type?n.setSelections(t.ranges,null,G):(e.prevInput="",i.value=t.text.join("\n"),R(i))}"cut"==r.type&&(n.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),p&&(i.style.width="0px"),vr(i,"input",(function(){a&&u>=9&&t.hasSelection&&(t.hasSelection=null),e.poll()})),vr(i,"paste",(function(r){br(n,r)||Fa(r,n)||(n.state.pasteIncoming=+new Date,e.fastPoll())})),vr(i,"cut",o),vr(i,"copy",o),vr(r.scroller,"paste",(function(t){if(!Me(r,t)&&!br(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void e.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),vr(r.lineSpace,"selectstart",(function(t){Me(r,t)||xr(t)})),vr(i,"compositionstart",(function(){var r=n.getCursor("from");e.composing&&e.composing.range.clear(),e.composing={start:r,range:n.markText(r,n.getCursor("to"),{className:"CodeMirror-composing"})}})),vr(i,"compositionend",(function(){e.composing&&(e.poll(),e.composing.range.clear(),e.composing=null)}))},Qa.prototype.createField=function(){this.wrapper=Pa(),this.textarea=this.wrapper.firstChild},Qa.prototype.screenReaderLabelChanged=function(r){r?this.textarea.setAttribute("aria-label",r):this.textarea.removeAttribute("aria-label")},Qa.prototype.prepareSelection=function(){var r=this.cm,t=r.display,e=r.doc,n=kn(r);if(r.options.moveInputWithCursor){var i=Qe(r,e.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Qa.prototype.showSelection=function(r){var t=this.cm.display;N(t.cursorDiv,r.cursors),N(t.selectionDiv,r.selection),null!=r.teTop&&(this.wrapper.style.top=r.teTop+"px",this.wrapper.style.left=r.teLeft+"px")},Qa.prototype.reset=function(r){if(!(this.contextMenuPending||this.composing&&r)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var e=t.getSelection();this.textarea.value=e,t.state.focused&&R(this.textarea),a&&u>=9&&(this.hasSelection=e)}else r||(this.prevInput=this.textarea.value="",a&&u>=9&&(this.hasSelection=null));this.resetting=!1}},Qa.prototype.getField=function(){return this.textarea},Qa.prototype.supportsTouch=function(){return!1},Qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||j(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(r){}},Qa.prototype.blur=function(){this.textarea.blur()},Qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Qa.prototype.receivedFocus=function(){this.slowPoll()},Qa.prototype.slowPoll=function(){var r=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){r.poll(),r.cm.state.focused&&r.slowPoll()}))},Qa.prototype.fastPoll=function(){var r=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function e(){t.poll()||r?(t.pollingFast=!1,t.slowPoll()):(r=!0,t.polling.set(60,e))}))},Qa.prototype.poll=function(){var r=this,t=this.cm,e=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Ir(e)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=e.value;if(i==n&&!t.somethingSelected())return!1;if(a&&u>=9&&this.hasSelection===i||w&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return ei(t,(function(){Ra(t,i.slice(l),n.length-l,null,r.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?e.value=r.prevInput="":r.prevInput=i,r.composing&&(r.composing.range.clear(),r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Qa.prototype.onKeyPress=function(){a&&u>=9&&(this.hasSelection=null),this.fastPoll()},Qa.prototype.onContextMenu=function(r){var t=this,e=t.cm,n=e.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=dn(e,r),s=n.scroller.scrollTop;if(o&&!d){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(o)&&ni(e,no)(e.doc,Ni(o),G);var c,f=i.style.cssText,h=t.wrapper.style.cssText,v=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-v.top-5)+"px; left: "+(r.clientX-v.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=i.ownerDocument.defaultView.scrollY),n.input.focus(),l&&i.ownerDocument.defaultView.scrollTo(null,c),n.input.reset(),e.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=e.doc.sel,clearTimeout(n.detectingSelectAll),a&&u>=9&&p(),M){Ar(r);var m=function(){pr(window,"mouseup",m),setTimeout(g,20)};vr(window,"mouseup",m)}else setTimeout(g,50)}function p(){if(null!=i.selectionStart){var r=e.somethingSelected(),o="​"+(r?i.value:"");i.value="⇚",i.value=o,t.prevInput=r?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=e.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&u<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=s),null!=i.selectionStart)){(!a||a&&u<9)&&p();var r=0,o=function(){n.selForContextMenu==e.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ni(e,fo)(e):r++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Qa.prototype.readOnlyChanged=function(r){r||this.reset(),this.textarea.disabled="nocursor"==r,this.textarea.readOnly=!!r},Qa.prototype.setUneditable=function(){},Qa.prototype.needsContentAttribute=!1,function(r){var t=r.optionHandlers;function e(e,n,i,o){r.defaults[e]=n,i&&(t[e]=o?function(r,t,e){e!=La&&i(r,t,e)}:i)}r.defineOption=e,r.Init=La,e("value","",(function(r,t){return r.setValue(t)}),!0),e("mode",null,(function(r,t){r.doc.modeOption=t,Bi(r)}),!0),e("indentUnit",2,Bi,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,(function(r){Ii(r),qe(r),vn(r)}),!0),e("lineSeparator",null,(function(r,t){if(r.doc.lineSep=t,t){var e=[],n=r.doc.first;r.doc.iter((function(r){for(var i=0;;){var o=r.text.indexOf(t,i);if(-1==o)break;i=o+t.length,e.push(nt(n,o))}n++}));for(var i=e.length-1;i>=0;i--)wo(r.doc,t,e[i],nt(e[i].line,e[i].ch+t.length))}})),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,t,e){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),e!=La&&r.refresh()})),e("specialCharPlaceholder",te,(function(r){return r.refresh()}),!0),e("electricChars",!0),e("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),e("spellcheck",!1,(function(r,t){return r.getInputField().spellcheck=t}),!0),e("autocorrect",!1,(function(r,t){return r.getInputField().autocorrect=t}),!0),e("autocapitalize",!1,(function(r,t){return r.getInputField().autocapitalize=t}),!0),e("rtlMoveVisually",!y),e("wholeLineUpdateBefore",!0),e("theme","default",(function(r){Aa(r),wi(r)}),!0),e("keyMap","default",(function(r,t,e){var n=ra(t),i=e!=La&&ra(e);i&&i.detach&&i.detach(r,n),n.attach&&n.attach(r,i||null)})),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,Ea,!0),e("gutters",[],(function(r,t){r.display.gutterSpecs=gi(t,r.options.lineNumbers),wi(r)}),!0),e("fixedGutter",!0,(function(r,t){r.display.gutters.style.left=t?sn(r.display)+"px":"0",r.refresh()}),!0),e("coverGutterNextToScrollbar",!1,(function(r){return $n(r)}),!0),e("scrollbarStyle","native",(function(r){Kn(r),$n(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),!0),e("lineNumbers",!1,(function(r,t){r.display.gutterSpecs=gi(r.options.gutters,t),wi(r)}),!0),e("firstLineNumber",1,wi,!0),e("lineNumberFormatter",(function(r){return r}),wi,!0),e("showCursorWhenSelecting",!1,wn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,(function(r,t){"nocursor"==t&&(Tn(r),r.display.input.blur()),r.display.input.readOnlyChanged(t)})),e("screenReaderLabel",null,(function(r,t){r.display.input.screenReaderLabelChanged(t=""===t?null:t)})),e("disableInput",!1,(function(r,t){t||r.display.input.reset()}),!0),e("dragDrop",!0,Na),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,wn,!0),e("singleCursorHeightPerLine",!0,wn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Ii,!0),e("addModeClass",!1,Ii,!0),e("pollInterval",100),e("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t})),e("historyEventDelay",1250),e("viewportMargin",10,(function(r){return r.refresh()}),!0),e("maxHighlightLength",1e4,Ii,!0),e("moveInputWithCursor",!0,(function(r,t){t||r.display.input.resetPosition()})),e("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""})),e("autofocus",null),e("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),!0),e("phrases",null)}(Da),function(r){var t=r.optionHandlers,e=r.helpers={};r.prototype={constructor:r,focus:function(){O(this).focus(),this.display.input.focus()},setOption:function(r,e){var n=this.options,i=n[r];n[r]==e&&"mode"!=r||(n[r]=e,t.hasOwnProperty(r)&&ni(this,t[r])(this,e,i),gr(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](ra(r))},removeKeyMap:function(r){for(var t=this.state.keyMaps,e=0;e<t.length;++e)if(t[e]==r||t[e].name==r)return t.splice(e,1),!0},addOverlay:ii((function(t,e){var n=t.token?t:r.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");(function(r,t,e){for(var n=0,i=e(t);n<r.length&&e(r[n])<=i;)n++;r.splice(n,0,t)})(this.state.overlays,{mode:n,modeSpec:t,opaque:e&&e.opaque,priority:e&&e.priority||0},(function(r){return r.priority})),this.state.modeGen++,vn(this)})),removeOverlay:ii((function(r){for(var t=this.state.overlays,e=0;e<t.length;++e){var n=t[e].modeSpec;if(n==r||"string"==typeof r&&n.name==r)return t.splice(e,1),this.state.modeGen++,void vn(this)}})),indentLine:ii((function(r,t,e){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),tt(this.doc,r)&&ja(this,r,t,e)})),indentSelection:ii((function(r){for(var t=this.doc.sel.ranges,e=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>e&&(ja(this,i.head.line,r,!0),e=i.head.line,n==this.doc.sel.primIndex&&Bn(this));else{var o=i.from(),a=i.to(),u=Math.max(e,o.line);e=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=u;l<e;++l)ja(this,l,r);var s=this.doc.sel.ranges;0==o.ch&&t.length==s.length&&s[n].from().ch>0&&ro(this.doc,n,new Si(o,s[n].to()),G)}}})),getTokenAt:function(r,t){return yt(this,r,t)},getLineTokens:function(r,t){return yt(this,nt(r),t,!0)},getTokenTypeAt:function(r){r=ct(this.doc,r);var t,e=mt(this,Qr(this.doc,r.line)),n=0,i=(e.length-1)/2,o=r.ch;if(0==o)t=e[2];else for(;;){var a=n+i>>1;if((a?e[2*a-1]:0)>=o)i=a;else{if(!(e[2*a+1]<o)){t=e[2*a+2];break}n=a+1}}var u=t?t.indexOf("overlay "):-1;return u<0?t:0==u?null:t.slice(0,u-1)},getModeAt:function(t){var e=this.doc.mode;return e.innerMode?r.innerMode(e,this.getTokenAt(t).state).mode:e},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var n=[];if(!e.hasOwnProperty(t))return n;var i=e[t],o=this.getModeAt(r);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var u=i[o[t][a]];u&&n.push(u)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var l=0;l<i._global.length;l++){var s=i._global[l];s.pred(o,this)&&-1==W(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(r,t){var e=this.doc;return pt(this,(r=st(e,null==r?e.first+e.size-1:r))+1,t).state},cursorCoords:function(r,t){var e=this.doc.sel.primary();return Qe(this,null==r?e.head:"object"==typeof r?ct(this.doc,r):r?e.from():e.to(),t||"page")},charCoords:function(r,t){return Ve(this,ct(this.doc,r),t||"page")},coordsChar:function(r,t){return Xe(this,(r=Ke(this,r,t||"page")).left,r.top)},lineAtHeight:function(r,t){return r=Ke(this,{top:r,left:0},t||"page").top,rt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,e){var n,i=!1;if("number"==typeof r){var o=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>o&&(r=o,i=!0),n=Qr(this.doc,r)}else n=r;return He(this,n,{top:0,left:0},t||"page",e||i).top+(i?this.doc.height-Ht(n):0)},defaultTextHeight:function(){return an(this.display)},defaultCharWidth:function(){return un(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,e,n,i){var o,a,u=this.display,l=(r=Qe(this,ct(this.doc,r))).bottom,s=r.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==n)l=r.top;else if("above"==n||"near"==n){var c=Math.max(u.wrapper.clientHeight,this.doc.height),f=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==n||r.bottom+t.offsetHeight>c)&&r.top>t.offsetHeight?l=r.top-t.offsetHeight:r.bottom+t.offsetHeight<=c&&(l=r.bottom),s+t.offsetWidth>f&&(s=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),e&&(null!=(a=zn(o=this,{left:s,top:l,right:s+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&On(o,a.scrollTop),null!=a.scrollLeft&&_n(o,a.scrollLeft))},triggerOnKeyDown:ii(va),triggerOnKeyPress:ii(pa),triggerOnKeyUp:ma,triggerOnMouseDown:ii(ka),execCommand:function(r){if(oa.hasOwnProperty(r))return oa[r].call(null,this)},triggerElectric:ii((function(r){Oa(this,r)})),findPosH:function(r,t,e,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ct(this.doc,r),a=0;a<t&&!(o=qa(this.doc,o,i,e,n)).hitSide;++a);return o},moveH:ii((function(r,t){var e=this;this.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?qa(e.doc,n.head,r,t,e.options.rtlMoveVisually):r<0?n.from():n.to()}),K)})),deleteH:ii((function(r,t){var e=this.doc;this.doc.sel.somethingSelected()?e.replaceSelection("",null,"+delete"):ta(this,(function(n){var i=qa(e,n.head,r,t,!1);return r<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(r,t,e,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=ct(this.doc,r),u=0;u<t;++u){var l=Qe(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Wa(this,l,i,e)).hitSide)break}return a},moveV:ii((function(r,t){var e=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return r<0?a.from():a.to();var u=Qe(e,a.head,"div");null!=a.goalColumn&&(u.left=a.goalColumn),i.push(u.left);var l=Wa(e,u,r,t);return"page"==t&&a==n.sel.primary()&&jn(e,Ve(e,l,"div").top-u.top),l}),K),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(r){var t=Qr(this.doc,r.line).text,e=r.ch,n=r.ch;if(t){var i=this.getHelper(r,"wordChars");"before"!=r.sticky&&n!=t.length||!e?++n:--e;for(var o=t.charAt(e),a=nr(o,i)?function(r){return nr(r,i)}:/\s/.test(o)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!nr(r)};e>0&&a(t.charAt(e-1));)--e;for(;n<t.length&&a(t.charAt(n));)++n}return new Si(nt(r.line,e),nt(r.line,n))},toggleOverwrite:function(r){null!=r&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),gr(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==j(F(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ii((function(r,t){In(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Te(this)-this.display.barHeight,width:r.scrollWidth-Te(this)-this.display.barWidth,clientHeight:Ee(this),clientWidth:Ne(this)}},scrollIntoView:ii((function(r,t){null==r?(r={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof r?r={from:nt(r,0),to:null}:null==r.from&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=t||0,null!=r.from.line?function(r,t){Rn(r),r.curOp.scrollToPos=t}(this,r):Fn(this,r.from,r.to,r.margin)})),setSize:ii((function(r,t){var e=this,n=function(r){return"number"==typeof r||/^\d+$/.test(String(r))?r+"px":r};null!=r&&(this.display.wrapper.style.width=n(r)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Pe(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(r){if(r.widgets)for(var t=0;t<r.widgets.length;t++)if(r.widgets[t].noHScroll){mn(e,i,"widget");break}++i})),this.curOp.forceUpdate=!0,gr(this,"refresh",this)})),operation:function(r){return ei(this,r)},startOperation:function(){return Qn(this)},endOperation:function(){return Jn(this)},refresh:ii((function(){var r=this.display.cachedTextHeight;vn(this),this.curOp.forceUpdate=!0,qe(this),In(this,this.doc.scrollLeft,this.doc.scrollTop),hi(this.display),(null==r||Math.abs(r-an(this.display))>.5||this.options.lineWrapping)&&fn(this),gr(this,"refresh",this)})),swapDoc:ii((function(r){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ui(this,r),qe(this),this.display.input.reset(),In(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ce(this,"swapDoc",this,t),t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},yr(r),r.registerHelper=function(t,n,i){e.hasOwnProperty(t)||(e[t]=r[t]={_global:[]}),e[t][n]=i},r.registerGlobalHelper=function(t,n,i,o){r.registerHelper(t,n,o),e[t]._global.push({pred:i,val:o})}}(Da);var Ja="iter insert remove copy getEditor constructor".split(" ");for(var Ya in Io.prototype)Io.prototype.hasOwnProperty(Ya)&&W(Ja,Ya)<0&&(Da.prototype[Ya]=function(r){return function(){return r.apply(this.doc,arguments)}}(Io.prototype[Ya]));return yr(Io),Da.inputStyles={textarea:Qa,contenteditable:$a},Da.defineMode=function(r){Da.defaults.mode||"null"==r||(Da.defaults.mode=r),_r.apply(this,arguments)},Da.defineMIME=function(r,t){Ur[r]=t},Da.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}})),Da.defineMIME("text/plain","null"),Da.defineExtension=function(r,t){Da.prototype[r]=t},Da.defineDocExtension=function(r,t){Io.prototype[r]=t},Da.fromTextArea=function(r,t){if((t=t?_(t):{}).value=r.value,!t.tabindex&&r.tabIndex&&(t.tabindex=r.tabIndex),!t.placeholder&&r.placeholder&&(t.placeholder=r.placeholder),null==t.autofocus){var e=j(r.ownerDocument);t.autofocus=e==r||null!=r.getAttribute("autofocus")&&e==document.body}function n(){r.value=u.getValue()}var i;if(r.form&&(vr(r.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=r.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(r){}}t.finishInit=function(e){e.save=n,e.getTextArea=function(){return r},e.toTextArea=function(){e.toTextArea=isNaN,n(),r.parentNode.removeChild(e.getWrapperElement()),r.style.display="",r.form&&(pr(r.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof r.form.submit||(r.form.submit=i))}},r.style.display="none";var u=Da((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return u},function(r){r.off=pr,r.on=vr,r.wheelEventPixels=Mi,r.Doc=Io,r.splitLines=Br,r.countColumn=P,r.findColumn=V,r.isWordChar=er,r.Pass=$,r.signal=gr,r.Line=Qt,r.changeEnd=Ei,r.scrollbarModel=Hn,r.Pos=nt,r.cmpPos=it,r.modes=Or,r.mimeModes=Ur,r.resolveMode=Pr,r.getMode=qr,r.modeExtensions=Wr,r.extendMode=$r,r.copyState=Gr,r.startState=Kr,r.innerMode=Hr,r.commands=oa,r.keyMap=Ko,r.keyName=Zo,r.isModifierKey=Yo,r.lookupKey=Jo,r.normalizeKeyMap=Qo,r.StringStream=Vr,r.SharedTextMarker=Do,r.TextMarker=No,r.LineWidget=Lo,r.e_preventDefault=xr,r.e_stopPropagation=Cr,r.e_stop=Ar,r.addClass=B,r.contains=z,r.rmClass=S,r.keyNames=Wo}(Da),Da.version="5.65.9",Da}()),s.exports}var f,d=a(c()),h={};function v(){return f||(f=1,function(r){function t(r){for(var t={},e=0;e<r.length;++e)t[r[e].toLowerCase()]=!0;return t}r.defineMode("css",(function(t,e){var n=e.inline;e.propertyKeywords||(e=r.resolveMode("text/css"));var i,o,a=t.indentUnit,u=e.tokenHooks,l=e.documentTypes||{},s=e.mediaTypes||{},c=e.mediaFeatures||{},f=e.mediaValueKeywords||{},d=e.propertyKeywords||{},h=e.nonStandardPropertyKeywords||{},v=e.fontProperties||{},m=e.counterDescriptors||{},p=e.colorKeywords||{},g=e.valueKeywords||{},b=e.allowNested,w=!0===e.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function y(r,t){return i=t,r}function x(r,t){var e=r.next();if(u[e]){var n=u[e](r,t);if(!1!==n)return n}return"@"==e?(r.eatWhile(/[\w\\\-]/),y("def",r.current())):"="==e||("~"==e||"|"==e)&&r.eat("=")?y(null,"compare"):'"'==e||"'"==e?(t.tokenize=C(e),t.tokenize(r,t)):"#"==e?(r.eatWhile(/[\w\\\-]/),y("atom","hash")):"!"==e?(r.match(/^\s*\w*/),y("keyword","important")):/\d/.test(e)||"."==e&&r.eat(/\d/)?(r.eatWhile(/[\w.%]/),y("number","unit")):"-"!==e?/[,+>*\/]/.test(e)?y(null,"select-op"):"."==e&&r.match(/^-?[_a-z][_a-z0-9-]*/i)?y("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(e)?y(null,e):r.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(r.current())&&(t.tokenize=M),y("variable callee","variable")):/[\w\\\-]/.test(e)?(r.eatWhile(/[\w\\\-]/),y("property","word")):y(null,null):/[\d.]/.test(r.peek())?(r.eatWhile(/[\w.%]/),y("number","unit")):r.match(/^-[\w\\\-]*/)?(r.eatWhile(/[\w\\\-]/),r.match(/^\s*:/,!1)?y("variable-2","variable-definition"):y("variable-2","variable")):r.match(/^\w+-/)?y("meta","meta"):void 0}function C(r){return function(t,e){for(var n,i=!1;null!=(n=t.next());){if(n==r&&!i){")"==r&&t.backUp(1);break}i=!i&&"\\"==n}return(n==r||!i&&")"!=r)&&(e.tokenize=null),y("string","string")}}function M(r,t){return r.next(),t.tokenize=r.match(/^\s*[\"\')]/,!1)?null:C(")"),y(null,"(")}function A(r,t,e){this.type=r,this.indent=t,this.prev=e}function L(r,t,e,n){return r.context=new A(e,t.indentation()+(!1===n?0:a),r.context),e}function S(r){return r.context.prev&&(r.context=r.context.prev),r.context.type}function T(r,t,e){return D[e.context.type](r,t,e)}function N(r,t,e,n){for(var i=n||1;i>0;i--)e.context=e.context.prev;return T(r,t,e)}function E(r){var t=r.current().toLowerCase();o=g.hasOwnProperty(t)?"atom":p.hasOwnProperty(t)?"keyword":"variable"}var D={top:function(r,t,e){if("{"==r)return L(e,t,"block");if("}"==r&&e.context.prev)return S(e);if(w&&/@component/i.test(r))return L(e,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(r))return L(e,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(r))return L(e,t,"atBlock");if(/^@(font-face|counter-style)/i.test(r))return e.stateArg=r,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(r))return"keyframes";if(r&&"@"==r.charAt(0))return L(e,t,"at");if("hash"==r)o="builtin";else if("word"==r)o="tag";else{if("variable-definition"==r)return"maybeprop";if("interpolation"==r)return L(e,t,"interpolation");if(":"==r)return"pseudo";if(b&&"("==r)return L(e,t,"parens")}return e.context.type},block:function(r,t,e){if("word"==r){var n=t.current().toLowerCase();return d.hasOwnProperty(n)?(o="property","maybeprop"):h.hasOwnProperty(n)?(o=k?"string-2":"property","maybeprop"):b?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==r?"block":b||"hash"!=r&&"qualifier"!=r?D.top(r,t,e):(o="error","block")},maybeprop:function(r,t,e){return":"==r?L(e,t,"prop"):T(r,t,e)},prop:function(r,t,e){if(";"==r)return S(e);if("{"==r&&b)return L(e,t,"propBlock");if("}"==r||"{"==r)return N(r,t,e);if("("==r)return L(e,t,"parens");if("hash"!=r||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==r)E(t);else if("interpolation"==r)return L(e,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(r,t,e){return"}"==r?S(e):"word"==r?(o="property","maybeprop"):e.context.type},parens:function(r,t,e){return"{"==r||"}"==r?N(r,t,e):")"==r?S(e):"("==r?L(e,t,"parens"):"interpolation"==r?L(e,t,"interpolation"):("word"==r&&E(t),"parens")},pseudo:function(r,t,e){return"meta"==r?"pseudo":"word"==r?(o="variable-3",e.context.type):T(r,t,e)},documentTypes:function(r,t,e){return"word"==r&&l.hasOwnProperty(t.current())?(o="tag",e.context.type):D.atBlock(r,t,e)},atBlock:function(r,t,e){if("("==r)return L(e,t,"atBlock_parens");if("}"==r||";"==r)return N(r,t,e);if("{"==r)return S(e)&&L(e,t,b?"block":"top");if("interpolation"==r)return L(e,t,"interpolation");if("word"==r){var n=t.current().toLowerCase();o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":f.hasOwnProperty(n)?"keyword":d.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?k?"string-2":"property":g.hasOwnProperty(n)?"atom":p.hasOwnProperty(n)?"keyword":"error"}return e.context.type},atComponentBlock:function(r,t,e){return"}"==r?N(r,t,e):"{"==r?S(e)&&L(e,t,b?"block":"top",!1):("word"==r&&(o="error"),e.context.type)},atBlock_parens:function(r,t,e){return")"==r?S(e):"{"==r||"}"==r?N(r,t,e,2):D.atBlock(r,t,e)},restricted_atBlock_before:function(r,t,e){return"{"==r?L(e,t,"restricted_atBlock"):"word"==r&&"@counter-style"==e.stateArg?(o="variable","restricted_atBlock_before"):T(r,t,e)},restricted_atBlock:function(r,t,e){return"}"==r?(e.stateArg=null,S(e)):"word"==r?(o="@font-face"==e.stateArg&&!v.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==e.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(r,t,e){return"word"==r?(o="variable","keyframes"):"{"==r?L(e,t,"top"):T(r,t,e)},at:function(r,t,e){return";"==r?S(e):"{"==r||"}"==r?N(r,t,e):("word"==r?o="tag":"hash"==r&&(o="builtin"),"at")},interpolation:function(r,t,e){return"}"==r?S(e):"{"==r||";"==r?N(r,t,e):("word"==r?o="variable":"variable"!=r&&"("!=r&&")"!=r&&(o="error"),"interpolation")}};return{startState:function(r){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new A(n?"block":"top",r||0,null)}},token:function(r,t){if(!t.tokenize&&r.eatSpace())return null;var e=(t.tokenize||x)(r,t);return e&&"object"==typeof e&&(i=e[1],e=e[0]),o=e,"comment"!=i&&(t.state=D[t.state](i,r,t)),o},indent:function(r,t){var e=r.context,n=t&&t.charAt(0),i=e.indent;return"prop"!=e.type||"}"!=n&&")"!=n||(e=e.prev),e.prev&&("}"!=n||"block"!=e.type&&"top"!=e.type&&"interpolation"!=e.type&&"restricted_atBlock"!=e.type?(")"!=n||"parens"!=e.type&&"atBlock_parens"!=e.type)&&("{"!=n||"at"!=e.type&&"atBlock"!=e.type)||(i=Math.max(0,e.indent-a)):i=(e=e.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:e.lineComment,fold:"brace"}}));var e=["domain","regexp","url","url-prefix"],n=t(e),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],u=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],s=t(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(c),d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(d),v=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),p=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],g=t(p),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=t(b),k=e.concat(i).concat(a).concat(l).concat(c).concat(d).concat(p).concat(b);function y(r,t){for(var e,n=!1;null!=(e=r.next());){if(n&&"/"==e){t.tokenize=null;break}n="*"==e}return["comment","comment"]}r.registerHelper("hintWords","css",k),r.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:u,mediaValueKeywords:s,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:v,counterDescriptors:m,colorKeywords:g,valueKeywords:w,tokenHooks:{"/":function(r,t){return!!r.eat("*")&&(t.tokenize=y,y(r,t))}},name:"css"}),r.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:s,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:g,valueKeywords:w,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(r,t){return r.eat("/")?(r.skipToEnd(),["comment","comment"]):r.eat("*")?(t.tokenize=y,y(r,t)):["operator","operator"]},":":function(r){return!!r.match(/^\s*\{/,!1)&&[null,null]},$:function(r){return r.match(/^[\w-]+/),r.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(r){return!!r.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),r.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:s,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:g,valueKeywords:w,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(r,t){return r.eat("/")?(r.skipToEnd(),["comment","comment"]):r.eat("*")?(t.tokenize=y,y(r,t)):["operator","operator"]},"@":function(r){return r.eat("{")?[null,"interpolation"]:!r.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(r.eatWhile(/[\w\\\-]/),r.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),r.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:u,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:v,counterDescriptors:m,colorKeywords:g,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(r,t){return!!r.eat("*")&&(t.tokenize=y,y(r,t))}},name:"css",helperType:"gss"})}(c())),h}v();var m;var p,g,b,w,k,y={};function x(){return p||(p=1,function(r){r.defineMode("javascript",(function(t,e){var n,i,o=t.indentUnit,a=e.statementIndent,u=e.jsonld,l=e.json||u,s=!1!==e.trackScope,c=e.typescript,f=e.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),e=r("keyword b"),n=r("keyword c"),i=r("keyword d"),o=r("operator"),a={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:e,do:e,try:e,finally:e,return:i,break:i,continue:i,new:r("new"),delete:n,void:n,throw:n,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:r("this"),class:r("class"),super:r("atom"),yield:n,export:r("export"),import:r("import"),extends:n,await:n}}(),h=/[+\-*&%=<>!?|~^@]/,v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(r,t,e){return n=r,i=e,t}function p(r,t){var e,n=r.next();if('"'==n||"'"==n)return t.tokenize=(e=n,function(r,t){var n,i=!1;if(u&&"@"==r.peek()&&r.match(v))return t.tokenize=p,m("jsonld-keyword","meta");for(;null!=(n=r.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(t.tokenize=p),m("string","string")}),t.tokenize(r,t);if("."==n&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&r.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&r.eat(">"))return m("=>","operator");if("0"==n&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return r.eat("*")?(t.tokenize=g,g(r,t)):r.eat("/")?(r.skipToEnd(),m("comment","comment")):Zr(r,t,1)?(function(r){for(var t,e=!1,n=!1;null!=(t=r.next());){if(!e){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}e=!e&&"\\"==t}}(r),r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(r.eat("="),m("operator","operator",r.current()));if("`"==n)return t.tokenize=b,b(r,t);if("#"==n&&"!"==r.peek())return r.skipToEnd(),m("meta","meta");if("#"==n&&r.eatWhile(f))return m("variable","property");if("<"==n&&r.match("!--")||"-"==n&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start)))return r.skipToEnd(),m("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(r.eat("=")?"!"!=n&&"="!=n||r.eat("="):/[<>*+\-|&?]/.test(n)&&(r.eat(n),">"==n&&r.eat(n))),"?"==n&&r.eat(".")?m("."):m("operator","operator",r.current());if(f.test(n)){r.eatWhile(f);var i=r.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return m(o.type,o.style,i)}if("async"==i&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",i)}return m("variable","variable",i)}}function g(r,t){for(var e,n=!1;e=r.next();){if("/"==e&&n){t.tokenize=p;break}n="*"==e}return m("comment","comment")}function b(r,t){for(var e,n=!1;null!=(e=r.next());){if(!n&&("`"==e||"$"==e&&r.eat("{"))){t.tokenize=p;break}n=!n&&"\\"==e}return m("quasi","string-2",r.current())}function w(r,t){t.fatArrowAt&&(t.fatArrowAt=null);var e=r.string.indexOf("=>",r.start);if(!(e<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,e));n&&(e=n.index)}for(var i=0,o=!1,a=e-1;a>=0;--a){var u=r.string.charAt(a),l="([{}])".indexOf(u);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==u&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(f.test(u))o=!0;else if(/["'\/`]/.test(u))for(;;--a){if(0==a)return;if(r.string.charAt(a-1)==u&&"\\"!=r.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function y(r,t,e,n,i,o){this.indented=r,this.column=t,this.type=e,this.prev=i,this.info=o,null!=n&&(this.align=n)}function x(r,t){if(!s)return!1;for(var e=r.localVars;e;e=e.next)if(e.name==t)return!0;for(var n=r.context;n;n=n.prev)for(e=n.vars;e;e=e.next)if(e.name==t)return!0}function C(r,t,e,n,i){var o=r.cc;for(M.state=r,M.stream=i,M.marked=null,M.cc=o,M.style=t,r.lexical.hasOwnProperty("align")||(r.lexical.align=!0);;)if((o.length?o.pop():l?q:_)(e,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return M.marked?M.marked:"variable"==e&&x(r,n)?"variable-2":t}}var M={state:null,marked:null,cc:null};function A(){for(var r=arguments.length-1;r>=0;r--)M.cc.push(arguments[r])}function L(){return A.apply(null,arguments),!0}function S(r,t){for(var e=t;e;e=e.next)if(e.name==r)return!0;return!1}function T(r){var t=M.state;if(M.marked="def",s){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=N(r,t.context);if(null!=n)return void(t.context=n)}else if(!S(r,t.localVars))return void(t.localVars=new z(r,t.localVars));e.globalVars&&!S(r,t.globalVars)&&(t.globalVars=new z(r,t.globalVars))}}function N(r,t){if(t){if(t.block){var e=N(r,t.prev);return e?e==t.prev?t:new D(e,t.vars,!0):null}return S(r,t.vars)?t:new D(t.prev,new z(r,t.vars),!1)}return null}function E(r){return"public"==r||"private"==r||"protected"==r||"abstract"==r||"readonly"==r}function D(r,t,e){this.prev=r,this.vars=t,this.block=e}function z(r,t){this.name=r,this.next=t}var j=new z("this",new z("arguments",null));function B(){M.state.context=new D(M.state.context,M.state.localVars,!1),M.state.localVars=j}function I(){M.state.context=new D(M.state.context,M.state.localVars,!0),M.state.localVars=null}function R(){M.state.localVars=M.state.context.vars,M.state.context=M.state.context.prev}function F(r,t){var e=function(){var e=M.state,n=e.indented;if("stat"==e.lexical.type)n=e.lexical.indented;else for(var i=e.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;e.lexical=new y(n,M.stream.column(),r,null,e.lexical,t)};return e.lex=!0,e}function O(){var r=M.state;r.lexical.prev&&(")"==r.lexical.type&&(r.indented=r.lexical.indented),r.lexical=r.lexical.prev)}function U(r){return function t(e){return e==r?L():";"==r||"}"==e||")"==e||"]"==e?A():L(t)}}function _(r,t){return"var"==r?L(F("vardef",t),Mr,U(";"),O):"keyword a"==r?L(F("form"),$,_,O):"keyword b"==r?L(F("form"),_,O):"keyword d"==r?M.stream.match(/^\s*$/,!1)?L():L(F("stat"),H,U(";"),O):"debugger"==r?L(U(";")):"{"==r?L(F("}"),I,lr,O,R):";"==r?L():"if"==r?("else"==M.state.lexical.info&&M.state.cc[M.state.cc.length-1]==O&&M.state.cc.pop()(),L(F("form"),$,_,O,Er)):"function"==r?L(Br):"for"==r?L(F("form"),I,Dr,_,R,O):"class"==r||c&&"interface"==t?(M.marked="keyword",L(F("form","class"==r?r:t),Ur,O)):"variable"==r?c&&"declare"==t?(M.marked="keyword",L(_)):c&&("module"==t||"enum"==t||"type"==t)&&M.stream.match(/^\s*\w/,!1)?(M.marked="keyword","enum"==t?L(Yr):"type"==t?L(Rr,U("operator"),hr,U(";")):L(F("form"),Ar,U("{"),F("}"),lr,O,O)):c&&"namespace"==t?(M.marked="keyword",L(F("form"),q,_,O)):c&&"abstract"==t?(M.marked="keyword",L(_)):L(F("stat"),tr):"switch"==r?L(F("form"),$,U("{"),F("}","switch"),I,lr,O,O,R):"case"==r?L(q,U(":")):"default"==r?L(U(":")):"catch"==r?L(F("form"),B,P,_,O,R):"export"==r?L(F("stat"),Wr,O):"import"==r?L(F("stat"),Gr,O):"async"==r?L(_):"@"==t?L(q,_):A(F("stat"),q,U(";"),O)}function P(r){if("("==r)return L(Fr,U(")"))}function q(r,t){return G(r,t,!1)}function W(r,t){return G(r,t,!0)}function $(r){return"("!=r?A():L(F(")"),H,U(")"),O)}function G(r,t,e){if(M.state.fatArrowAt==M.stream.start){var n=e?X:Y;if("("==r)return L(B,F(")"),ar(Fr,")"),O,U("=>"),n,R);if("variable"==r)return A(B,Ar,U("=>"),n,R)}var i=e?V:K;return k.hasOwnProperty(r)?L(i):"function"==r?L(Br,i):"class"==r||c&&"interface"==t?(M.marked="keyword",L(F("form"),Or,O)):"keyword c"==r||"async"==r?L(e?W:q):"("==r?L(F(")"),H,U(")"),O,i):"operator"==r||"spread"==r?L(e?W:q):"["==r?L(F("]"),Jr,O,i):"{"==r?ur(nr,"}",null,i):"quasi"==r?A(Q,i):"new"==r?L(function(r){return function(t){return"."==t?L(r?rr:Z):"variable"==t&&c?L(yr,r?V:K):A(r?W:q)}}(e)):L()}function H(r){return r.match(/[;\}\)\],]/)?A():A(q)}function K(r,t){return","==r?L(H):V(r,t,!1)}function V(r,t,e){var n=0==e?K:V,i=0==e?q:W;return"=>"==r?L(B,e?X:Y,R):"operator"==r?/\+\+|--/.test(t)||c&&"!"==t?L(n):c&&"<"==t&&M.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?L(F(">"),ar(hr,">"),O,n):"?"==t?L(q,U(":"),i):L(i):"quasi"==r?A(Q,n):";"!=r?"("==r?ur(W,")","call",n):"."==r?L(er,n):"["==r?L(F("]"),H,U("]"),O,n):c&&"as"==t?(M.marked="keyword",L(hr,n)):"regexp"==r?(M.state.lastType=M.marked="operator",M.stream.backUp(M.stream.pos-M.stream.start-1),L(i)):void 0:void 0}function Q(r,t){return"quasi"!=r?A():"${"!=t.slice(t.length-2)?L(Q):L(H,J)}function J(r){if("}"==r)return M.marked="string-2",M.state.tokenize=b,L(Q)}function Y(r){return w(M.stream,M.state),A("{"==r?_:q)}function X(r){return w(M.stream,M.state),A("{"==r?_:W)}function Z(r,t){if("target"==t)return M.marked="keyword",L(K)}function rr(r,t){if("target"==t)return M.marked="keyword",L(V)}function tr(r){return":"==r?L(O,_):A(K,U(";"),O)}function er(r){if("variable"==r)return M.marked="property",L()}function nr(r,t){return"async"==r?(M.marked="property",L(nr)):"variable"==r||"keyword"==M.style?(M.marked="property","get"==t||"set"==t?L(ir):(c&&M.state.fatArrowAt==M.stream.start&&(e=M.stream.match(/^\s*:\s*/,!1))&&(M.state.fatArrowAt=M.stream.pos+e[0].length),L(or))):"number"==r||"string"==r?(M.marked=u?"property":M.style+" property",L(or)):"jsonld-keyword"==r?L(or):c&&E(t)?(M.marked="keyword",L(nr)):"["==r?L(q,sr,U("]"),or):"spread"==r?L(W,or):"*"==t?(M.marked="keyword",L(nr)):":"==r?A(or):void 0;var e}function ir(r){return"variable"!=r?A(or):(M.marked="property",L(Br))}function or(r){return":"==r?L(W):"("==r?A(Br):void 0}function ar(r,t,e){function n(i,o){if(e?e.indexOf(i)>-1:","==i){var a=M.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),L((function(e,n){return e==t||n==t?A():A(r)}),n)}return i==t||o==t?L():e&&e.indexOf(";")>-1?A(r):L(U(t))}return function(e,i){return e==t||i==t?L():A(r,n)}}function ur(r,t,e){for(var n=3;n<arguments.length;n++)M.cc.push(arguments[n]);return L(F(t,e),ar(r,t),O)}function lr(r){return"}"==r?L():A(_,lr)}function sr(r,t){if(c){if(":"==r)return L(hr);if("?"==t)return L(sr)}}function cr(r,t){if(c&&(":"==r||"in"==t))return L(hr)}function fr(r){if(c&&":"==r)return M.stream.match(/^\s*\w+\s+is\b/,!1)?L(q,dr,hr):L(hr)}function dr(r,t){if("is"==t)return M.marked="keyword",L()}function hr(r,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(M.marked="keyword",L("typeof"==t?W:hr)):"variable"==r||"void"==t?(M.marked="type",L(kr)):"|"==t||"&"==t?L(hr):"string"==r||"number"==r||"atom"==r?L(kr):"["==r?L(F("]"),ar(hr,"]",","),O,kr):"{"==r?L(F("}"),mr,O,kr):"("==r?L(ar(wr,")"),vr,kr):"<"==r?L(ar(hr,">"),hr):"quasi"==r?A(gr,kr):void 0}function vr(r){if("=>"==r)return L(hr)}function mr(r){return r.match(/[\}\)\]]/)?L():","==r||";"==r?L(mr):A(pr,mr)}function pr(r,t){return"variable"==r||"keyword"==M.style?(M.marked="property",L(pr)):"?"==t||"number"==r||"string"==r?L(pr):":"==r?L(hr):"["==r?L(U("variable"),cr,U("]"),pr):"("==r?A(Ir,pr):r.match(/[;\}\)\],]/)?void 0:L()}function gr(r,t){return"quasi"!=r?A():"${"!=t.slice(t.length-2)?L(gr):L(hr,br)}function br(r){if("}"==r)return M.marked="string-2",M.state.tokenize=b,L(gr)}function wr(r,t){return"variable"==r&&M.stream.match(/^\s*[?:]/,!1)||"?"==t?L(wr):":"==r?L(hr):"spread"==r?L(wr):A(hr)}function kr(r,t){return"<"==t?L(F(">"),ar(hr,">"),O,kr):"|"==t||"."==r||"&"==t?L(hr):"["==r?L(hr,U("]"),kr):"extends"==t||"implements"==t?(M.marked="keyword",L(hr)):"?"==t?L(hr,U(":"),hr):void 0}function yr(r,t){if("<"==t)return L(F(">"),ar(hr,">"),O,kr)}function xr(){return A(hr,Cr)}function Cr(r,t){if("="==t)return L(hr)}function Mr(r,t){return"enum"==t?(M.marked="keyword",L(Yr)):A(Ar,sr,Tr,Nr)}function Ar(r,t){return c&&E(t)?(M.marked="keyword",L(Ar)):"variable"==r?(T(t),L()):"spread"==r?L(Ar):"["==r?ur(Sr,"]"):"{"==r?ur(Lr,"}"):void 0}function Lr(r,t){return"variable"!=r||M.stream.match(/^\s*:/,!1)?("variable"==r&&(M.marked="property"),"spread"==r?L(Ar):"}"==r?A():"["==r?L(q,U("]"),U(":"),Lr):L(U(":"),Ar,Tr)):(T(t),L(Tr))}function Sr(){return A(Ar,Tr)}function Tr(r,t){if("="==t)return L(W)}function Nr(r){if(","==r)return L(Mr)}function Er(r,t){if("keyword b"==r&&"else"==t)return L(F("form","else"),_,O)}function Dr(r,t){return"await"==t?L(Dr):"("==r?L(F(")"),zr,O):void 0}function zr(r){return"var"==r?L(Mr,jr):"variable"==r?L(jr):A(jr)}function jr(r,t){return")"==r?L():";"==r?L(jr):"in"==t||"of"==t?(M.marked="keyword",L(q,jr)):A(q,jr)}function Br(r,t){return"*"==t?(M.marked="keyword",L(Br)):"variable"==r?(T(t),L(Br)):"("==r?L(B,F(")"),ar(Fr,")"),O,fr,_,R):c&&"<"==t?L(F(">"),ar(xr,">"),O,Br):void 0}function Ir(r,t){return"*"==t?(M.marked="keyword",L(Ir)):"variable"==r?(T(t),L(Ir)):"("==r?L(B,F(")"),ar(Fr,")"),O,fr,R):c&&"<"==t?L(F(">"),ar(xr,">"),O,Ir):void 0}function Rr(r,t){return"keyword"==r||"variable"==r?(M.marked="type",L(Rr)):"<"==t?L(F(">"),ar(xr,">"),O):void 0}function Fr(r,t){return"@"==t&&L(q,Fr),"spread"==r?L(Fr):c&&E(t)?(M.marked="keyword",L(Fr)):c&&"this"==r?L(sr,Tr):A(Ar,sr,Tr)}function Or(r,t){return"variable"==r?Ur(r,t):_r(r,t)}function Ur(r,t){if("variable"==r)return T(t),L(_r)}function _r(r,t){return"<"==t?L(F(">"),ar(xr,">"),O,_r):"extends"==t||"implements"==t||c&&","==r?("implements"==t&&(M.marked="keyword"),L(c?hr:q,_r)):"{"==r?L(F("}"),Pr,O):void 0}function Pr(r,t){return"async"==r||"variable"==r&&("static"==t||"get"==t||"set"==t||c&&E(t))&&M.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(M.marked="keyword",L(Pr)):"variable"==r||"keyword"==M.style?(M.marked="property",L(qr,Pr)):"number"==r||"string"==r?L(qr,Pr):"["==r?L(q,sr,U("]"),qr,Pr):"*"==t?(M.marked="keyword",L(Pr)):c&&"("==r?A(Ir,Pr):";"==r||","==r?L(Pr):"}"==r?L():"@"==t?L(q,Pr):void 0}function qr(r,t){if("!"==t)return L(qr);if("?"==t)return L(qr);if(":"==r)return L(hr,Tr);if("="==t)return L(W);var e=M.state.lexical.prev;return A(e&&"interface"==e.info?Ir:Br)}function Wr(r,t){return"*"==t?(M.marked="keyword",L(Qr,U(";"))):"default"==t?(M.marked="keyword",L(q,U(";"))):"{"==r?L(ar($r,"}"),Qr,U(";")):A(_)}function $r(r,t){return"as"==t?(M.marked="keyword",L(U("variable"))):"variable"==r?A(W,$r):void 0}function Gr(r){return"string"==r?L():"("==r?A(q):"."==r?A(K):A(Hr,Kr,Qr)}function Hr(r,t){return"{"==r?ur(Hr,"}"):("variable"==r&&T(t),"*"==t&&(M.marked="keyword"),L(Vr))}function Kr(r){if(","==r)return L(Hr,Kr)}function Vr(r,t){if("as"==t)return M.marked="keyword",L(Hr)}function Qr(r,t){if("from"==t)return M.marked="keyword",L(q)}function Jr(r){return"]"==r?L():A(ar(W,"]"))}function Yr(){return A(F("form"),Ar,U("{"),F("}"),ar(Xr,"}"),O,O)}function Xr(){return A(Ar,Tr)}function Zr(r,t,e){return t.tokenize==p&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(r.string.slice(0,r.pos-(e||0)))}return B.lex=I.lex=!0,R.lex=!0,O.lex=!0,{startState:function(r){var t={tokenize:p,lastType:"sof",cc:[],lexical:new y((r||0)-o,0,"block",!1),localVars:e.localVars,context:e.localVars&&new D(null,null,!1),indented:r||0};return e.globalVars&&"object"==typeof e.globalVars&&(t.globalVars=e.globalVars),t},token:function(r,t){if(r.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=r.indentation(),w(r,t)),t.tokenize!=g&&r.eatSpace())return null;var e=t.tokenize(r,t);return"comment"==n?e:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",C(t,e,n,i,r))},indent:function(t,n){if(t.tokenize==g||t.tokenize==b)return r.Pass;if(t.tokenize!=p)return 0;var i,u=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==O)l=l.prev;else if(c!=Er&&c!=R)break}for(;("stat"==l.type||"form"==l.type)&&("}"==u||(i=t.cc[t.cc.length-1])&&(i==K||i==V)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,d=u==f;return"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==f&&"{"==u?l.indented:"form"==f?l.indented+o:"stat"==f?l.indented+(function(r,t){return"operator"==r.lastType||","==r.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?a||o:0):"switch"!=l.info||d||0==e.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:o):l.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:u,jsonMode:l,expressionAllowed:Zr,skipExpression:function(t){C(t,"atom","atom","true",new r.StringStream("",2,null))}}})),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(c())),y}g||(g=1,function(r){var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var e={};function n(r,t){var n=r.match(function(r){return e[r]||(e[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(r,t){return new RegExp((t?"^":"")+"</\\s*"+r+"\\s*>","i")}function o(r,t){for(var e in r)for(var n=t[e]||(t[e]=[]),i=r[e],o=i.length-1;o>=0;o--)n.unshift(i[o])}r.defineMode("htmlmixed",(function(e,a){var u=r.getMode(e,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag,allowMissingTagName:a.allowMissingTagName}),l={},s=a&&a.tags,c=a&&a.scriptTypes;if(o(t,l),s&&o(s,l),c)for(var f=c.length-1;f>=0;f--)l.script.unshift(["type",c[f].matches,c[f].mode]);function d(t,o){var a,s=u.token(t,o.htmlState),c=/\btag\b/.test(s);if(c&&!/[<>\s\/]/.test(t.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&c&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==t.current()&&function(r,t){for(var e=0;e<r.length;e++){var i=r[e];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}(l[f[1]],f[2]),v=r.getMode(e,h),m=i(f[1],!0),p=i(f[1],!1);o.token=function(r,t){return r.match(m,!1)?(t.token=d,t.localState=t.localMode=null,null):function(r,t,e){var n=r.current(),i=n.search(t);return i>-1?r.backUp(n.length-i):n.match(/<\/?$/)&&(r.backUp(n.length),r.match(t,!1)||r.match(n)),e}(r,p,t.localMode.token(r,t.localState))},o.localMode=v,o.localState=r.startState(v,u.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return s}return{startState:function(){return{token:d,inTag:null,localMode:null,localState:null,htmlState:r.startState(u)}},copyState:function(t){var e;return t.localState&&(e=r.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:e,htmlState:r.copyState(u,t.htmlState)}},token:function(r,t){return t.token(r,t)},indent:function(t,e,n){return!t.localMode||/^\s*<\//.test(e)?u.indent(t.htmlState,e,n):t.localMode.indent?t.localMode.indent(t.localState,e,n):r.Pass},innerMode:function(r){return{state:r.localState||r.htmlState,mode:r.localMode||u}}}}),"xml","javascript","css"),r.defineMIME("text/html","htmlmixed")}(c(),m||(m=1,function(r){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},e={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};r.defineMode("xml",(function(n,i){var o,a,u=n.indentUnit,l={},s=i.htmlMode?t:e;for(var c in s)l[c]=s[c];for(var c in i)l[c]=i[c];function f(r,t){function e(e){return t.tokenize=e,e(r,t)}var n=r.next();return"<"==n?r.eat("!")?r.eat("[")?r.match("CDATA[")?e(h("atom","]]>")):null:r.match("--")?e(h("comment","--\x3e")):r.match("DOCTYPE",!0,!0)?(r.eatWhile(/[\w\._\-]/),e(v(1))):null:r.eat("?")?(r.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=r.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==n?(r.eat("#")?r.eat("x")?r.eatWhile(/[a-fA-F\d]/)&&r.eat(";"):r.eatWhile(/[\d]/)&&r.eat(";"):r.eatWhile(/[\w\.\-:]/)&&r.eat(";"))?"atom":"error":(r.eatWhile(/[^&<]/),null)}function d(r,t){var e,n,i=r.next();if(">"==i||"/"==i&&r.eat(">"))return t.tokenize=f,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=f,t.state=w,t.tagName=t.tagStart=null;var a=t.tokenize(r,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(e=i,n=function(r,t){for(;!r.eol();)if(r.next()==e){t.tokenize=d;break}return"string"},n.isInAttribute=!0,n),t.stringStartCol=r.column(),t.tokenize(r,t)):(r.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(r,t){return function(e,n){for(;!e.eol();){if(e.match(t)){n.tokenize=f;break}e.next()}return r}}function v(r){return function(t,e){for(var n;null!=(n=t.next());){if("<"==n)return e.tokenize=v(r+1),e.tokenize(t,e);if(">"==n){if(1==r){e.tokenize=f;break}return e.tokenize=v(r-1),e.tokenize(t,e)}}return"meta"}}function m(r){return r&&r.toLowerCase()}function p(r,t,e){this.prev=r.context,this.tagName=t||"",this.indent=r.indented,this.startOfLine=e,(l.doNotIndent.hasOwnProperty(t)||r.context&&r.context.noIndent)&&(this.noIndent=!0)}function g(r){r.context&&(r.context=r.context.prev)}function b(r,t){for(var e;;){if(!r.context)return;if(!l.contextGrabbers.hasOwnProperty(m(e=r.context.tagName))||!l.contextGrabbers[m(e)].hasOwnProperty(m(t)))return;g(r)}}function w(r,t,e){return"openTag"==r?(e.tagStart=t.column(),k):"closeTag"==r?y:w}function k(r,t,e){return"word"==r?(e.tagName=t.current(),a="tag",M):l.allowMissingTagName&&"endTag"==r?(a="tag bracket",M(r,0,e)):(a="error",k)}function y(r,t,e){if("word"==r){var n=t.current();return e.context&&e.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(m(e.context.tagName))&&g(e),e.context&&e.context.tagName==n||!1===l.matchClosing?(a="tag",x):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==r?(a="tag bracket",x(r,0,e)):(a="error",C)}function x(r,t,e){return"endTag"!=r?(a="error",x):(g(e),w)}function C(r,t,e){return a="error",x(r,0,e)}function M(r,t,e){if("word"==r)return a="attribute",A;if("endTag"==r||"selfcloseTag"==r){var n=e.tagName,i=e.tagStart;return e.tagName=e.tagStart=null,"selfcloseTag"==r||l.autoSelfClosers.hasOwnProperty(m(n))?b(e,n):(b(e,n),e.context=new p(e,n,i==e.indented)),w}return a="error",M}function A(r,t,e){return"equals"==r?L:(l.allowMissing||(a="error"),M(r,0,e))}function L(r,t,e){return"string"==r?S:"word"==r&&l.allowUnquoted?(a="string",M):(a="error",M(r,0,e))}function S(r,t,e){return"string"==r?S:M(r,0,e)}return f.isInText=!0,{startState:function(r){var t={tokenize:f,state:w,indented:r||0,tagName:null,tagStart:null,context:null};return null!=r&&(t.baseIndent=r),t},token:function(r,t){if(!t.tagName&&r.sol()&&(t.indented=r.indentation()),r.eatSpace())return null;o=null;var e=t.tokenize(r,t);return(e||o)&&"comment"!=e&&(a=null,t.state=t.state(o||e,r,t),a&&(e="error"==a?e+" error":a)),e},indent:function(t,e,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+u;if(i&&i.noIndent)return r.Pass;if(t.tokenize!=d&&t.tokenize!=f)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+u*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(e))return 0;var o=e&&/^<(\/)?([\w_:\.-]*)/.exec(e);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(m(i.tagName)))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[m(i.tagName)];if(!a||!a.hasOwnProperty(m(o[2])))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+u:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(r){r.state==L&&(r.state=M)},xmlCurrentTag:function(r){return r.tagName?{name:r.tagName,close:"closeTag"==r.type}:null},xmlCurrentContext:function(r){for(var t=[],e=r.context;e;e=e.prev)t.push(e.tagName);return t.reverse()}}})),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})}(c())),x(),v())),x(),b||(b=1,function(r){r.defineMode("jinja2",(function(){var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],t=/^[+\-*&%=<>!?|~^]/,e=/^[:\[\(\{]/,n=["true","false"],i=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function o(o,a){var u=o.peek();if(a.incomment)return o.skipTo("#}")?(o.eatWhile(/\#|}/),a.incomment=!1):o.skipToEnd(),"comment";if(a.intag){if(a.operator){if(a.operator=!1,o.match(n))return"atom";if(o.match(i))return"number"}if(a.sign){if(a.sign=!1,o.match(n))return"atom";if(o.match(i))return"number"}if(a.instring)return u==a.instring&&(a.instring=!1),o.next(),"string";if("'"==u||'"'==u)return a.instring=u,o.next(),"string";if(a.inbraces>0&&")"==u)o.next(),a.inbraces--;else if("("==u)o.next(),a.inbraces++;else if(a.inbrackets>0&&"]"==u)o.next(),a.inbrackets--;else if("["==u)o.next(),a.inbrackets++;else{if(!a.lineTag&&(o.match(a.intag+"}")||o.eat("-")&&o.match(a.intag+"}")))return a.intag=!1,"tag";if(o.match(t))return a.operator=!0,"operator";if(o.match(e))a.sign=!0;else{if(1==o.column()&&a.lineTag&&o.match(r))return"keyword";if(o.eat(" ")||o.sol()){if(o.match(r))return"keyword";if(o.match(n))return"atom";if(o.match(i))return"number";o.sol()&&o.next()}else o.next()}}return"variable"}if(o.eat("{")){if(o.eat("#"))return a.incomment=!0,o.skipTo("#}")?(o.eatWhile(/\#|}/),a.incomment=!1):o.skipToEnd(),"comment";if(u=o.eat(/\{|%/))return a.intag=u,a.inbraces=0,a.inbrackets=0,"{"==u&&(a.intag="}"),o.eat("-"),"tag"}else if(o.eat("#")){if("#"==o.peek())return o.skipToEnd(),"comment";if(!o.eol())return a.intag=!0,a.lineTag=!0,a.inbraces=0,a.inbrackets=0,"tag"}o.next()}return r=new RegExp("(("+r.join(")|(")+"))\\b"),n=new RegExp("(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(r,t){var e=t.tokenize(r,t);return r.eol()&&t.lineTag&&!t.instring&&0==t.inbraces&&0==t.inbrackets&&(t.intag=!1,t.lineTag=!1),e},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}})),r.defineMIME("text/jinja2","jinja2")}(c())),w||(w=1,function(r){var t="CodeMirror-activeline",e="CodeMirror-activeline-background",n="CodeMirror-activeline-gutter";function i(r){for(var i=0;i<r.state.activeLines.length;i++)r.removeLineClass(r.state.activeLines[i],"wrap",t),r.removeLineClass(r.state.activeLines[i],"background",e),r.removeLineClass(r.state.activeLines[i],"gutter",n)}function o(r,o){for(var a=[],u=0;u<o.length;u++){var l=o[u],s=r.getOption("styleActiveLine");if("object"==typeof s&&s.nonEmpty?l.anchor.line==l.head.line:l.empty()){var c=r.getLineHandleVisualStart(l.head.line);a[a.length-1]!=c&&a.push(c)}}(function(r,t){if(r.length!=t.length)return!1;for(var e=0;e<r.length;e++)if(r[e]!=t[e])return!1;return!0})(r.state.activeLines,a)||r.operation((function(){i(r);for(var o=0;o<a.length;o++)r.addLineClass(a[o],"wrap",t),r.addLineClass(a[o],"background",e),r.addLineClass(a[o],"gutter",n);r.state.activeLines=a}))}function a(r,t){o(r,t.ranges)}r.defineOption("styleActiveLine",!1,(function(t,e,n){var u=n!=r.Init&&n;e!=u&&(u&&(t.off("beforeSelectionChange",a),i(t),delete t.state.activeLines),e&&(t.state.activeLines=[],o(t,t.listSelections()),t.on("beforeSelectionChange",a)))}))}(c())),k||(k=1,function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),e=r.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var u=r.getLineHandle(t.line),l=t.ch-1,s=o&&o.afterCursor;null==s&&(s=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className));var c=i(o),f=!s&&l>=0&&c.test(u.text.charAt(l))&&n[u.text.charAt(l)]||c.test(u.text.charAt(l+1))&&n[u.text.charAt(++l)];if(!f)return null;var d=">"==f.charAt(1)?1:-1;if(o&&o.strict&&d>0!=(l==t.ch))return null;var h=r.getTokenTypeAt(e(t.line,l+1)),v=a(r,e(t.line,l+(d>0?1:0)),d,h,o);return null==v?null:{from:e(t.line,l),to:v&&v.pos,match:v&&v.ch==f.charAt(0),forward:d>0}}function a(r,t,o,a,u){for(var l=u&&u.maxScanLineLength||1e4,s=u&&u.maxScanLines||1e3,c=[],f=i(u),d=o>0?Math.min(t.line+s,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-s),h=t.line;h!=d;h+=o){var v=r.getLine(h);if(v){var m=o>0?0:v.length-1,p=o>0?v.length:-1;if(!(v.length>l))for(h==t.line&&(m=t.ch-(o<0?1:0));m!=p;m+=o){var g=v.charAt(m);if(f.test(g)&&(void 0===a||(r.getTokenTypeAt(e(h,m+1))||"")==(a||""))){var b=n[g];if(b&&">"==b.charAt(1)==o>0)c.push(g);else{if(!c.length)return{pos:e(h,m),ch:g};c.pop()}}}}}return h-o!=(o>0?r.lastLine():r.firstLine())&&null}function u(r,n,i){for(var a=r.state.matchBrackets.maxHighlightLineLength||1e3,u=i&&i.highlightNonMatching,l=[],s=r.listSelections(),c=0;c<s.length;c++){var f=s[c].empty()&&o(r,s[c].head,i);if(f&&(f.match||!1!==u)&&r.getLine(f.from.line).length<=a){var d=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(r.markText(f.from,e(f.from.line,f.from.ch+1),{className:d})),f.to&&r.getLine(f.to.line).length<=a&&l.push(r.markText(f.to,e(f.to.line,f.to.ch+1),{className:d}))}}if(l.length){t&&r.state.focused&&r.focus();var h=function(){r.operation((function(){for(var r=0;r<l.length;r++)l[r].clear()}))};if(!n)return h;setTimeout(h,800)}}function l(r){r.operation((function(){r.state.matchBrackets.currentlyHighlighted&&(r.state.matchBrackets.currentlyHighlighted(),r.state.matchBrackets.currentlyHighlighted=null),r.state.matchBrackets.currentlyHighlighted=u(r,!1,r.state.matchBrackets)}))}function s(r){r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted&&(r.state.matchBrackets.currentlyHighlighted(),r.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,(function(t,e,n){n&&n!=r.Init&&(t.off("cursorActivity",l),t.off("focus",l),t.off("blur",s),s(t)),e&&(t.state.matchBrackets="object"==typeof e?e:{},t.on("cursorActivity",l),t.on("focus",l),t.on("blur",s))})),r.defineExtension("matchBrackets",(function(){u(this,!0)})),r.defineExtension("findMatchingBracket",(function(r,t,e){return(e||"boolean"==typeof t)&&(e?(e.strict=t,t=e):t=t?{strict:!0}:null),o(this,r,t)})),r.defineExtension("scanForBracket",(function(r,t,e,n){return a(this,r,t,e,n)}))}(c()));var C,M,A,L,S={};function T(){return C||(C=1,function(r){var t=r.Pos;function e(r,t){return r.line-t.line||r.ch-t.ch}var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(r,t,e,n){this.line=t,this.ch=e,this.cm=r,this.text=r.getLine(t),this.min=n?Math.max(n.from,r.firstLine()):r.firstLine(),this.max=n?Math.min(n.to-1,r.lastLine()):r.lastLine()}function a(r,e){var n=r.cm.getTokenTypeAt(t(r.line,e));return n&&/\btag\b/.test(n)}function u(r){if(!(r.line>=r.max))return r.ch=0,r.text=r.cm.getLine(++r.line),!0}function l(r){if(!(r.line<=r.min))return r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0}function s(r){for(;;){var t=r.text.indexOf(">",r.ch);if(-1==t){if(u(r))continue;return}if(a(r,t+1)){var e=r.text.lastIndexOf("/",t),n=e>-1&&!/\S/.test(r.text.slice(e+1,t));return r.ch=t+1,n?"selfClose":"regular"}r.ch=t+1}}function c(r){for(;;){var t=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(-1==t){if(l(r))continue;return}if(a(r,t+1)){i.lastIndex=t,r.ch=t;var e=i.exec(r.text);if(e&&e.index==t)return e}else r.ch=t}}function f(r){for(;;){i.lastIndex=r.ch;var t=i.exec(r.text);if(!t){if(u(r))continue;return}if(a(r,t.index+1))return r.ch=t.index+t[0].length,t;r.ch=t.index+1}}function d(r){for(;;){var t=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(-1==t){if(l(r))continue;return}if(a(r,t+1)){var e=r.text.lastIndexOf("/",t),n=e>-1&&!/\S/.test(r.text.slice(e+1,t));return r.ch=t+1,n?"selfClose":"regular"}r.ch=t}}function h(r,e){for(var n=[];;){var i,o=f(r),a=r.line,u=r.ch-(o?o[0].length:0);if(!o||!(i=s(r)))return;if("selfClose"!=i)if(o[1]){for(var l=n.length-1;l>=0;--l)if(n[l]==o[2]){n.length=l;break}if(l<0&&(!e||e==o[2]))return{tag:o[2],from:t(a,u),to:t(r.line,r.ch)}}else n.push(o[2])}}function v(r,e){for(var n=[];;){var i=d(r);if(!i)return;if("selfClose"!=i){var o=r.line,a=r.ch,u=c(r);if(!u)return;if(u[1])n.push(u[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==u[2]){n.length=l;break}if(l<0&&(!e||e==u[2]))return{tag:u[2],from:t(r.line,r.ch),to:t(o,a)}}}else c(r)}}r.registerHelper("fold","xml",(function(r,n){for(var i=new o(r,n.line,0);;){var a=f(i);if(!a||i.line!=n.line)return;var u=s(i);if(!u)return;if(!a[1]&&"selfClose"!=u){var l=t(i.line,i.ch),c=h(i,a[2]);return c&&e(c.from,l)>0?{from:l,to:c.from}:null}}})),r.findMatchingTag=function(r,n,i){var a=new o(r,n.line,n.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var u=s(a),l=u&&t(a.line,a.ch),f=u&&c(a);if(u&&f&&!(e(a,n)>0)){var d={from:t(a.line,a.ch),to:l,tag:f[2]};return"selfClose"==u?{open:d,close:null,at:"open"}:f[1]?{open:v(a,f[2]),close:d,at:"close"}:{open:d,close:h(a=new o(r,l.line,l.ch,i),f[2]),at:"open"}}}},r.findEnclosingTag=function(r,t,e,n){for(var i=new o(r,t.line,t.ch,e);;){var a=v(i,n);if(!a)break;var u=h(new o(r,t.line,t.ch,e),a.tag);if(u)return{open:a,close:u}}},r.scanForClosingTag=function(r,t,e,n){return h(new o(r,t.line,t.ch,n?{from:0,to:n}:null),e)}}(c())),S}M||(M=1,function(r){function t(r){r.state.tagHit&&r.state.tagHit.clear(),r.state.tagOther&&r.state.tagOther.clear(),r.state.tagHit=r.state.tagOther=null}function e(e){e.state.failedTagMatch=!1,e.operation((function(){if(t(e),!e.somethingSelected()){var n=e.getCursor(),i=e.getViewport();i.from=Math.min(i.from,n.line),i.to=Math.max(n.line+1,i.to);var o=r.findMatchingTag(e,n,i);if(o){if(e.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(e.state.tagHit=e.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var u="close"==o.at?o.open:o.close;u?e.state.tagOther=e.markText(u.from,u.to,{className:"CodeMirror-matchingtag"}):e.state.failedTagMatch=!0}}}))}function n(r){r.state.failedTagMatch&&e(r)}r.defineOption("matchTags",!1,(function(i,o,a){a&&a!=r.Init&&(i.off("cursorActivity",e),i.off("viewportChange",n),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",e),i.on("viewportChange",n),e(i))})),r.commands.toMatchingTag=function(t){var e=r.findMatchingTag(t,t.getCursor());if(e){var n="close"==e.at?e.open:e.close;n&&t.extendSelection(n.to,n.from)}}}(c(),T())),A||(A=1,function(r){var t="CodeMirror-lint-markers";function e(r){r.parentNode&&r.parentNode.removeChild(r)}function n(t,n,i,o){var a=function(t,e,n){var i=document.createElement("div");function o(t){if(!i.parentNode)return r.off(document,"mousemove",o);i.style.top=Math.max(0,t.clientY-i.offsetHeight-5)+"px",i.style.left=t.clientX+5+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(n.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),r.on(document,"mousemove",o),o(e),null!=i.style.opacity&&(i.style.opacity=1),i}(t,n,i);function u(){var t;r.off(o,"mouseout",u),a&&((t=a).parentNode&&(null==t.style.opacity&&e(t),t.style.opacity=0,setTimeout((function(){e(t)}),600)),a=null)}var l=setInterval((function(){if(a)for(var r=o;;r=r.parentNode){if(r&&11==r.nodeType&&(r=r.host),r==document.body)return;if(!r){u();break}}if(!a)return clearInterval(l)}),400);r.on(o,"mouseout",u)}function i(r,t,e){for(var i in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},o)this.options[i]=o[i];for(var i in t)o.hasOwnProperty(i)?null!=t[i]&&(this.options[i]=t[i]):t.options||(this.linterOptions[i]=t[i]);this.timeout=null,this.hasGutter=e,this.onMouseOver=function(t){!function(r,t){var e=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(e.className)){for(var i=e.getBoundingClientRect(),o=r.findMarksAt(r.coordsChar({left:(i.left+i.right)/2,top:(i.top+i.bottom)/2},"client")),a=[],u=0;u<o.length;++u){var s=o[u].__annotation;s&&a.push(s)}a.length&&function(r,t,e){for(var i=e.target||e.srcElement,o=document.createDocumentFragment(),a=0;a<t.length;a++)o.appendChild(l(t[a]));n(r,e,o,i)}(r,a,t)}}(r,t)},this.waitingFor=0}var o={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function a(r){var e=r.state.lint;e.hasGutter&&r.clearGutter(t),e.options.highlightLines&&function(r){r.eachLine((function(t){var e=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);e&&r.removeLineClass(t,"wrap",e[0])}))}(r);for(var n=0;n<e.marked.length;++n)e.marked[n].clear();e.marked.length=0}function u(t,e,i,o,a){var u=document.createElement("div"),l=u;return u.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+i,o&&((l=u.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=a&&r.on(l,"mouseover",(function(r){n(t,r,e,l)})),u}function l(r){var t=r.severity;t||(t="error");var e=document.createElement("div");return e.className="CodeMirror-lint-message CodeMirror-lint-message-"+t,void 0!==r.messageHTML?e.innerHTML=r.messageHTML:e.appendChild(document.createTextNode(r.message)),e}function s(t){var e=t.state.lint;if(e){var n=e.options,i=n.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(i)if(n.async||i.async)!function(t,e){var n=t.state.lint,i=++n.waitingFor;function o(){i=-1,t.off("change",o)}t.on("change",o),e(t.getValue(),(function(e,a){t.off("change",o),n.waitingFor==i&&(a&&e instanceof r&&(e=a),t.operation((function(){c(t,e)})))}),n.linterOptions,t)}(t,i);else{var o=i(t.getValue(),e.linterOptions,t);if(!o)return;o.then?o.then((function(r){t.operation((function(){c(t,r)}))})):t.operation((function(){c(t,o)}))}}}function c(r,e){var n,i,o=r.state.lint;if(o){var s=o.options;a(r);for(var c=function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e],i=n.from.line;(t[i]||(t[i]=[])).push(n)}return t}(e),f=0;f<c.length;++f){var d=c[f];if(d){var h=[];d=d.filter((function(r){return!(h.indexOf(r.message)>-1)&&h.push(r.message)}));for(var v=null,m=o.hasGutter&&document.createDocumentFragment(),p=0;p<d.length;++p){var g=d[p],b=g.severity;b||(b="error"),i=b,v="error"==(n=v)?n:i,s.formatAnnotation&&(g=s.formatAnnotation(g)),o.hasGutter&&m.appendChild(l(g)),g.to&&o.marked.push(r.markText(g.from,g.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+b,__annotation:g}))}o.hasGutter&&r.setGutterMarker(f,t,u(r,m,v,c[f].length>1,s.tooltips)),s.highlightLines&&r.addLineClass(f,"wrap","CodeMirror-lint-line-"+v)}}s.onUpdateLinting&&s.onUpdateLinting(e,c,r)}}function f(r){var t=r.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){s(r)}),t.options.delay))}r.defineOption("lint",!1,(function(e,n,o){if(o&&o!=r.Init&&(a(e),!1!==e.state.lint.options.lintOnChange&&e.off("change",f),r.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver),clearTimeout(e.state.lint.timeout),delete e.state.lint),n){for(var u=e.getOption("gutters"),l=!1,c=0;c<u.length;++c)u[c]==t&&(l=!0);var d=e.state.lint=new i(e,n,l);d.options.lintOnChange&&e.on("change",f),0!=d.options.tooltips&&"gutter"!=d.options.tooltips&&r.on(e.getWrapperElement(),"mouseover",d.onMouseOver),s(e)}})),r.defineExtension("performLint",(function(){s(this)}))}(c())),L||(L=1,function(r){r.registerHelper("lint","json",(function(t){var e=[];if(!window.jsonlint)return window.console&&window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."),e;var n=window.jsonlint.parser||window.jsonlint;n.parseError=function(t,n){var i=n.loc;e.push({from:r.Pos(i.first_line-1,i.first_column),to:r.Pos(i.last_line-1,i.last_column),message:t})};try{n.parse(t)}catch(r){}return e}))}(c()));var N,E,D;E||(E=1,function(r){r.defineOption("foldGutter",!1,(function(t,n,i){var o;i&&i!=r.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",l),t.off("changes",c),t.off("viewportChange",f),t.off("fold",d),t.off("unfold",d),t.off("swapDoc",c),t.off("optionChange",s)),n&&(t.state.foldGutter=new e((!0===(o=n)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),u(t),t.on("gutterClick",l),t.on("changes",c),t.on("viewportChange",f),t.on("fold",d),t.on("unfold",d),t.on("swapDoc",c),t.on("optionChange",s))}));var t=r.Pos;function e(r){this.options=r,this.from=this.to=0}function n(r,e){for(var n=r.findMarks(t(e,0),t(e+1,0)),i=0;i<n.length;++i)if(n[i].__isFold){var o=n[i].find(-1);if(o&&o.line===e)return n[i]}}function i(r){if("string"==typeof r){var t=document.createElement("div");return t.className=r+" CodeMirror-guttermarker-subtle",t}return r.cloneNode(!0)}function o(r,e,o){var u=r.state.foldGutter.options,l=e-1,s=r.foldOption(u,"minFoldSize"),c=r.foldOption(u,"rangeFinder"),f="string"==typeof u.indicatorFolded&&a(u.indicatorFolded),d="string"==typeof u.indicatorOpen&&a(u.indicatorOpen);r.eachLine(e,o,(function(e){++l;var o=null,a=e.gutterMarkers;if(a&&(a=a[u.gutter]),n(r,l)){if(f&&a&&f.test(a.className))return;o=i(u.indicatorFolded)}else{var h=t(l,0),v=c&&c(r,h);if(v&&v.to.line-v.from.line>=s){if(d&&a&&d.test(a.className))return;o=i(u.indicatorOpen)}}(o||a)&&r.setGutterMarker(e,u.gutter,o)}))}function a(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function u(r){var t=r.getViewport(),e=r.state.foldGutter;e&&(r.operation((function(){o(r,t.from,t.to)})),e.from=t.from,e.to=t.to)}function l(r,e,i){var o=r.state.foldGutter;if(o){var a=o.options;if(i==a.gutter){var u=n(r,e);u?u.clear():r.foldCode(t(e,0),a)}}}function s(r,t){"mode"==t&&c(r)}function c(r){var t=r.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){u(r)}),e.foldOnChangeTimeSpan||600)}}function f(r){var t=r.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var e=r.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?u(r):r.operation((function(){e.from<t.from&&(o(r,e.from,t.from),t.from=e.from),e.to>t.to&&(o(r,t.to,e.to),t.to=e.to)}))}),e.updateViewportTimeSpan||400)}}function d(r,t){var e=r.state.foldGutter;if(e){var n=t.line;n>=e.from&&n<e.to&&o(r,n,n+1)}}}(c(),N||(N=1,function(r){function t(t,e,i,o){if(i&&i.call){var a=i;i=null}else a=n(t,i,"rangeFinder");"number"==typeof e&&(e=r.Pos(e,0));var u=n(t,i,"minFoldSize");function l(r){var n=a(t,e);if(!n||n.to.line-n.from.line<u)return null;if("fold"===o)return n;for(var i=t.findMarksAt(n.from),l=0;l<i.length;++l)if(i[l].__isFold){if(!r)return null;n.cleared=!0,i[l].clear()}return n}var s=l(!0);if(n(t,i,"scanUp"))for(;!s&&e.line>t.firstLine();)e=r.Pos(e.line-1,0),s=l(!1);if(s&&!s.cleared&&"unfold"!==o){var c=function(r,t,e){var i=n(r,t,"widget");if("function"==typeof i&&(i=i(e.from,e.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0));return i}(t,i,s);r.on(c,"mousedown",(function(t){f.clear(),r.e_preventDefault(t)}));var f=t.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(t,i,"clearOnEnter"),__isFold:!0});f.on("clear",(function(e,n){r.signal(t,"unfold",t,e,n)})),r.signal(t,"fold",t,s.from,s.to)}}r.newFoldFunction=function(r,e){return function(n,i){t(n,i,{rangeFinder:r,widget:e})}},r.defineExtension("foldCode",(function(r,e,n){t(this,r,e,n)})),r.defineExtension("isFolded",(function(r){for(var t=this.findMarksAt(r),e=0;e<t.length;++e)if(t[e].__isFold)return!0})),r.commands.toggleFold=function(r){r.foldCode(r.getCursor())},r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")},r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(t){t.operation((function(){for(var e=t.firstLine(),n=t.lastLine();e<=n;e++)t.foldCode(r.Pos(e,0),{scanUp:!1},"fold")}))},r.commands.unfoldAll=function(t){t.operation((function(){for(var e=t.firstLine(),n=t.lastLine();e<=n;e++)t.foldCode(r.Pos(e,0),{scanUp:!1},"unfold")}))},r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,e){for(var n=0;n<r.length;++n){var i=r[n](t,e);if(i)return i}}})),r.registerHelper("fold","auto",(function(r,t){for(var e=r.getHelpers(t,"fold"),n=0;n<e.length;n++){var i=e[n](r,t);if(i)return i}}));var e={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function n(r,t,n){if(t&&void 0!==t[n])return t[n];var i=r.options.foldOptions;return i&&void 0!==i[n]?i[n]:e[n]}r.defineOption("foldOptions",null),r.defineExtension("foldOption",(function(r,t){return n(this,r,t)}))}(c())))),D||(D=1,function(r){function t(t){return function(e,n){var i=n.line,o=e.getLine(i);function a(t){for(var a,u=n.ch,l=0;;){var s=u<=0?-1:o.lastIndexOf(t[0],u-1);if(-1!=s){if(1==l&&s<n.ch)break;if(a=e.getTokenTypeAt(r.Pos(i,s+1)),!/^(comment|string)/.test(a))return{ch:s+1,tokenType:a,pair:t};u=s-1}else{if(1==l)break;l=1,u=o.length}}}function u(t){var n,o,a=1,u=e.lastLine(),l=t.ch;r:for(var s=i;s<=u;++s)for(var c=e.getLine(s),f=s==i?l:0;;){var d=c.indexOf(t.pair[0],f),h=c.indexOf(t.pair[1],f);if(d<0&&(d=c.length),h<0&&(h=c.length),(f=Math.min(d,h))==c.length)break;if(e.getTokenTypeAt(r.Pos(s,f+1))==t.tokenType)if(f==d)++a;else if(! --a){n=s,o=f;break r}++f}return null==n||i==n?null:{from:r.Pos(i,l),to:r.Pos(n,o)}}for(var l=[],s=0;s<t.length;s++){var c=a(t[s]);c&&l.push(c)}for(l.sort((function(r,t){return r.ch-t.ch})),s=0;s<l.length;s++){var f=u(l[s]);if(f)return f}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",(function(t,e){function n(e){if(e<t.firstLine()||e>t.lastLine())return null;var n=t.getTokenAt(r.Pos(e,1));if(/\S/.test(n.string)||(n=t.getTokenAt(r.Pos(e,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var i=e,o=Math.min(t.lastLine(),e+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:n.end,end:r.Pos(i,a)}}}var i,o=e.line,a=n(o);if(!a||n(o-1)||(i=n(o-2))&&i.end.line==o-1)return null;for(var u=a.end;;){var l=n(u.line+1);if(null==l)break;u=l.end}return{from:t.clipPos(r.Pos(o,a.startCh+1)),to:u}})),r.registerHelper("fold","include",(function(t,e){function n(e){if(e<t.firstLine()||e>t.lastLine())return null;var n=t.getTokenAt(r.Pos(e,1));return/\S/.test(n.string)||(n=t.getTokenAt(r.Pos(e,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=e.line,o=n(i);if(null==o||null!=n(i-1))return null;for(var a=i;null!=n(a+1);)++a;return{from:r.Pos(i,o+1),to:t.clipPos(r.Pos(a))}}))}(c())),T();var z,j={exports:{}},B=(z||(z=1,function(r){var t=function(){var r,t,e,n,i,o,a,u,l,s,c,f,d=!0,h={},v=(i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=function(t){throw{name:"SyntaxError",message:t,at:r,text:e}},a=function(n){return n&&n!==t&&o("Expected '"+n+"' instead of '"+t+"'"),t=e.charAt(r),r+=1,t},u=function(){var r,e="";for("-"===t&&(e="-",a("-"));t>="0"&&t<="9";)e+=t,a();if("."===t)for(e+=".";a()&&t>="0"&&t<="9";)e+=t;if("e"===t||"E"===t)for(e+=t,a(),"-"!==t&&"+"!==t||(e+=t,a());t>="0"&&t<="9";)e+=t,a();if(r=+e,isFinite(r))return r;o("Bad number")},l=function(){var r,e,n,u="";if('"'===t)for(;a();){if('"'===t)return a(),u;if("\\"===t)if(a(),"u"===t){for(n=0,e=0;e<4&&(r=parseInt(a(),16),isFinite(r));e+=1)n=16*n+r;u+=String.fromCharCode(n)}else{if("string"!=typeof i[t])break;u+=i[t]}else u+=t}o("Bad string")},s=function(){for(;t&&t<=" ";)a()},n=function(){switch(s(),t){case"{":return function(){var r,e={};if("{"===t){if(a("{"),s(),"}"===t)return a("}"),e;for(;t;){if(r=l(),s(),a(":"),Object.hasOwnProperty.call(e,r)&&o("Duplicate key '"+r+"'"),e[r]=n(),s(),"}"===t)return a("}"),e;a(","),s()}}o("Bad object")}();case"[":return function(){var r=[];if("["===t){if(a("["),s(),"]"===t)return a("]"),r;for(;t;){if(r.push(n()),s(),"]"===t)return a("]"),r;a(","),s()}}o("Bad array")}();case'"':return l();case"-":return u();default:return t>="0"&&t<="9"?u():function(){switch(t){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+t+"'")}()}},function(i,a){var u;return e=i,r=0,t=" ",u=n(),s(),t&&o("Syntax error"),"function"==typeof a?function r(t,e){var n,i,o=t[e];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(void 0!==(i=r(o,n))?o[n]=i:delete o[n]);return a.call(t,e,o)}({"":u},""):u}),m=(c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(r,t,e,n,i,o){var a=o.length-1;switch(i){case 1:this.$=r.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(r);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=o[a-1];case 13:this.$={};break;case 14:case 19:this.$=o[a-1];break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[];break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(r){throw new Error(r)},parse:function(r){var t=this,e=[0],n=[null],i=[],o=this.table,a="",u=0,l=0,s=0;this.lexer.setInput(r),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;function f(){var r;return"number"!=typeof(r=t.lexer.lex()||1)&&(r=t.symbols_[r]||r),r}i.push(c),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,h,v,m,p,g,b,w,k={};;){if(this.defaultActions[v=e[e.length-1]]?m=this.defaultActions[v]:(null==d&&(d=f()),m=o[v]&&o[v][d]),void 0===m||!m.length||!m[0]){if(!s){for(g in w=[],o[v])this.terminals_[g]&&g>2&&w.push("'"+this.terminals_[g]+"'");var y="";y=this.lexer.showPosition?"Parse error on line "+(u+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+this.terminals_[d]+"'":"Parse error on line "+(u+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(y,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:c,expected:w})}if(3==s){if(1==d)throw new Error(y||"Parsing halted.");l=this.lexer.yyleng,a=this.lexer.yytext,u=this.lexer.yylineno,c=this.lexer.yylloc,d=f()}for(;!(2..toString()in o[v]);){if(0==v)throw new Error(y||"Parsing halted.");e.length=e.length-2*1,n.length=n.length-1,i.length=i.length-1,v=e[e.length-1]}h=d,d=2,m=o[v=e[e.length-1]]&&o[v][2],s=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+d);switch(m[0]){case 1:e.push(d),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),e.push(m[1]),d=null,h?(d=h,h=null):(l=this.lexer.yyleng,a=this.lexer.yytext,u=this.lexer.yylineno,c=this.lexer.yylloc,s>0&&s--);break;case 2:if(k.$=n[n.length-(b=this.productions_[m[1]][1])],k._$={first_line:i[i.length-(b||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(b||1)].first_column,last_column:i[i.length-1].last_column},void 0!==(p=this.performAction.call(k,a,l,u,this.yy,m[1],n,i)))return p;b&&(e=e.slice(0,-1*b*2),n=n.slice(0,-1*b),i=i.slice(0,-1*b)),e.push(this.productions_[m[1]][0]),n.push(k.$),i.push(k._$),e.push(o[e[e.length-2]][e[e.length-1]]);break;case 3:return!0}}return!0}},f=function(){var r={EOF:1,parseError:function(r,t){if(!this.yy.parseError)throw new Error(r);this.yy.parseError(r,t)},setInput:function(r){return this._input=r,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var r=this._input[0];return this.yytext+=r,this.yyleng++,this.match+=r,this.matched+=r,r.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),r},unput:function(r){return this._input=r+this._input,this},more:function(){return this._more=!0,this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var r,t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),a=0;a<o.length&&(!(e=this._input.match(this.rules[o[a]]))||t&&!(e[0].length>t[0].length)||(t=e,n=a,this.options.flex));a++);return t?((i=t[0].match(/\n.*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,o[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return void 0!==r?r:this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(r){this.begin(r)},options:{},performAction:function(r,t,e){switch(e){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return r}(),c.lexer=f,c),p=m.parse;return m.parse=function(r){var t=p.call(m,r),e=void 0===v?d("./doug-json-parse"):v;try{e(r)}catch(t){if(/Duplicate key|Bad string|Unexpected/.test(t.message)){var n=r.substring(0,t.at).split("\n"),i=n.length;throw this.parseError(t.message,{line:i,col:n[i-1].length-1,message:t.message.replace(/./,(function(r){return r.toLowerCase()}))}),SyntaxError(t.message+" on line "+i)}}return t},void 0!==h&&(h.parser=m,h.parse=function(){return m.parse.apply(m,arguments)},h.main=function(r){if(!r[1])throw new Error("Usage: "+r[0]+" FILE");if("undefined"!=typeof process)var t=d("fs").readFileSync(d("path").join(process.cwd(),r[1]),"utf8");else t=d("file").path(d("file").cwd()).join(r[1]).read({charset:"utf-8"});return h.parser.parse(t)},!1===d.main&&h.main("undefined"!=typeof process?process.argv.slice(1):d("system").args)),h}();r.exports&&(r.exports=t)}(j)),j.exports),I=a(B);const R=class{constructor(n){r(this,n),this.change=t(this,"change"),this.value="",this.readonly=!1,this.disabled=!1,this.invalid=!1,this.required=!1,this.lineNumbers=!1,this.lineWrapping=!1,this.fold=!1,this.lint=!1,this.colorScheme="auto",this.translationLanguage="en",this.showCopyButton=!0,this.wasCopied="idle",this.handleChangeDarkMode=()=>{"auto"===this.colorScheme&&this.forceRedraw()},this.handleChange=()=>{this.change.emit(this.editor.getValue())},this.handleResize=()=>{this.editor&&this.editor.refresh()},this.renderHelperLine=()=>{if(this.helperText)return e("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid})},this.copyCode=async()=>{var r,t,e;const n=null!==(e=null!==(t=null===(r=this.editor)||void 0===r?void 0:r.getValue())&&void 0!==t?t:this.value)&&void 0!==e?e:"";try{await navigator.clipboard.writeText(n),this.wasCopied="success",setTimeout((()=>{this.wasCopied="idle"}),2e3)}catch(r){console.error("Failed to copy to clipboard:",r),this.wasCopied="failed"}},this.labelId=o(),this.helperTextId=o()}connectedCallback(){this.observer=new ResizeObserver(this.handleResize),this.observer.observe(this.host),this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){var r;this.observer.unobserve(this.host),null===(r=this.editor)||void 0===r||r.off("change",this.handleChange),this.editor=null,this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const t=this.host.shadowRoot.querySelector(".editor");for(const r of null==t?void 0:t.childNodes)r.remove()}componentDidRender(){this.editor||(this.editor=this.createEditor(),this.updateInputFieldAccessibilityAttributes())}watchValue(r){this.editor&&r!==this.editor.getValue()&&this.editor.getDoc().setValue(r||"")}watchDisabled(){this.updateEditorReadOnlyState(),this.updateInputFieldAccessibilityAttributes()}watchReadonly(){this.updateEditorReadOnlyState(),this.updateInputFieldAccessibilityAttributes()}watchInvalid(){this.updateInputFieldAccessibilityAttributes()}watchRequired(){this.updateInputFieldAccessibilityAttributes()}watchHelperText(){this.updateInputFieldAccessibilityAttributes()}createEditor(){const r=this.getOptions(),t=d(this.host.shadowRoot.querySelector(".editor"),r);return t.on("change",this.handleChange),t.setOption("extraKeys",{Tab:r=>{const t=" ".repeat(r.getOption("indentUnit"));r.replaceSelection(t)}}),t}getOptions(){let r=this.language,t="lime light";const e=[];return this.isDarkMode()&&(t="lime dark"),"json"===this.language?(r={name:"application/json",json:!0},this.lint&&(e.push("CodeMirror-lint-markers"),"jsonlint"in window||(window.jsonlint=I))):"typescript"===this.language?r={name:"application/typescript",typescript:!0}:"html"===this.language&&(r="htmlmixed"),this.fold&&e.push("CodeMirror-foldgutter"),{mode:r,value:this.value||"",theme:t,readOnly:this.getReadOnlyOption(),tabSize:4,indentUnit:4,lineNumbers:this.lineNumbers,lineWrapping:this.lineWrapping,styleActiveLine:!0,matchBrackets:!0,matchTags:{bothTags:!0},lint:this.lint,foldGutter:this.fold,gutters:e}}isDarkMode(){return"auto"!==this.colorScheme?"dark"===this.colorScheme:this.darkMode.matches}render(){const r={editor:!0,readonly:this.readonly||this.disabled,disabled:this.disabled,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return e(n,{key:"47f27484ea6a4271fba45f81aa97a9ab9c0d7c28"},this.renderCopyButton(),e("limel-notched-outline",{key:"cc455855470c242d667b80a1b778007c6582439b",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:!0},e("div",{key:"11942b528f9110ee14cf8ef54f6c588fde1a6113",slot:"content",class:r})),this.renderHelperLine())}forceRedraw(){this.random=Math.random()}renderCopyButton(){var r;if(((null===(r=this.editor)||void 0===r?void 0:r.getValue())||this.value)&&!this.disabled&&this.showCopyButton)return e("button",{class:"copy-button",onClick:this.copyCode,type:"button","aria-live":"polite","aria-atomic":"true","aria-label":this.getButtonAriaLabel()},this.getButtonText())}getButtonText(){return u.get("success"===this.wasCopied?"code-editor.copied":"failed"===this.wasCopied?"code-editor.copy-failed":"code-editor.copy",this.translationLanguage)}getButtonAriaLabel(){const r=this.label||u.get("code-editor",this.translationLanguage);return u.get({success:"code-editor.copied-aria-label",failed:"code-editor.copy-failed-aria-label",idle:"code-editor.copy-aria-label"}[this.wasCopied],this.translationLanguage,{label:r})}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}updateEditorReadOnlyState(){this.editor&&this.editor.setOption("readOnly",this.getReadOnlyOption())}getReadOnlyOption(){return this.disabled?"nocursor":this.readonly}updateInputFieldAccessibilityAttributes(){if(!this.editor)return;const r=this.editor.getInputField();r&&(r.id=this.labelId,this.helperText?(r.setAttribute("aria-describedby",this.helperTextId),r.setAttribute("aria-controls",this.helperTextId)):(r.removeAttribute("aria-describedby"),r.removeAttribute("aria-controls")),this.required?r.setAttribute("aria-required","true"):r.removeAttribute("aria-required"),this.invalid?r.setAttribute("aria-invalid","true"):r.removeAttribute("aria-invalid"),this.disabled?r.setAttribute("aria-disabled","true"):r.removeAttribute("aria-disabled"),this.readonly||this.disabled?r.setAttribute("aria-readonly","true"):r.removeAttribute("aria-readonly"))}get host(){return i(this)}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],readonly:[{watchReadonly:0}],invalid:[{watchInvalid:0}],required:[{watchRequired:0}],helperText:[{watchHelperText:0}]}}};R.style="@charset \"UTF-8\";.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(limel-code-editor){isolation:isolate;position:relative;display:flex;flex-direction:column;width:100%;font-size:var(--code-editor-font-size, 0.8125rem);--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)}:host(limel-code-editor) .cm-attribute,:host(limel-code-editor) .cm-property,:host(limel-code-editor) .cm-keyword{color:rgb(var(--color-violet-light))}:host(limel-code-editor) .cm-operator{color:rgb(var(--color-sky-dark))}:host(limel-code-editor) .cm-variable{color:rgb(var(--color-pink-light))}:host(limel-code-editor) .cm-variable-2{color:rgb(var(--contrast-1100))}:host(limel-code-editor) .cm-variable-3,:host(limel-code-editor) .cm-type{color:rgb(var(--color-amber-darker))}:host(limel-code-editor) .cm-builtin,:host(limel-code-editor) .cm-meta{color:rgb(var(--color-amber-default))}:host(limel-code-editor) .cm-atom{color:rgb(var(--color-coral-default))}:host(limel-code-editor) .cm-tag,:host(limel-code-editor) .cm-number{color:rgb(var(--color-magenta-default))}:host(limel-code-editor) .cm-def{color:rgb(var(--color-sky-default))}:host(limel-code-editor) .cm-string{color:rgb(var(--color-green-dark))}:host(limel-code-editor) .cm-string-2{color:rgb(var(--color-pink-default))}:host(limel-code-editor) .cm-qualifier{color:rgb(var(--color-grass-default))}:host(limel-code-editor) .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host(limel-code-editor) .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}@media (prefers-color-scheme: dark){:root:not([data-theme=force-light]) :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root:not([data-theme=force-light]) :host .cm-attribute,:root:not([data-theme=force-light]) :host .cm-property,:root:not([data-theme=force-light]) :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root:not([data-theme=force-light]) :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root:not([data-theme=force-light]) :host .cm-variable-3,:root:not([data-theme=force-light]) :host .cm-type{color:rgb(var(--color-yellow-light))}:root:not([data-theme=force-light]) :host .cm-atom{color:rgb(var(--color-coral-light))}:root:not([data-theme=force-light]) :host .cm-tag,:root:not([data-theme=force-light]) :host .cm-number{color:rgb(var(--color-magenta-light))}:root:not([data-theme=force-light]) :host .cm-def{color:rgb(var(--color-sky-light))}:root:not([data-theme=force-light]) :host .cm-string{color:rgb(var(--color-lime-light))}:root:not([data-theme=force-light]) :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root:not([data-theme=force-light]) :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root:not([data-theme=force-light]) :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}}:root[data-theme=force-dark] :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root[data-theme=force-dark] :host .cm-attribute,:root[data-theme=force-dark] :host .cm-property,:root[data-theme=force-dark] :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root[data-theme=force-dark] :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root[data-theme=force-dark] :host .cm-variable-3,:root[data-theme=force-dark] :host .cm-type{color:rgb(var(--color-yellow-light))}:root[data-theme=force-dark] :host .cm-atom{color:rgb(var(--color-coral-light))}:root[data-theme=force-dark] :host .cm-tag,:root[data-theme=force-dark] :host .cm-number{color:rgb(var(--color-magenta-light))}:root[data-theme=force-dark] :host .cm-def{color:rgb(var(--color-sky-light))}:root[data-theme=force-dark] :host .cm-string{color:rgb(var(--color-lime-light))}:root[data-theme=force-dark] :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root[data-theme=force-dark] :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root[data-theme=force-dark] :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor{display:flex;align-items:stretch;width:100%;min-height:2.5rem}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;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-lines{padding:0.25rem 0}.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;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cdefs/%3E%3Cpath%20fill='rgb(255,255,255)'%20d='M7.219%205.781L5.78%207.22%2014.563%2016%205.78%2024.781%207.22%2026.22%2016%2017.437l8.781%208.782%201.438-1.438L17.437%2016l8.782-8.781L24.78%205.78%2016%2014.563z'/%3E%3C/svg%3E\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:transparent;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus,.cm-s-lime .CodeMirror-foldmarker:focus-visible{will-change:color, background-color, box-shadow, transform}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.cm-s-lime .CodeMirror-foldmarker{text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3E%3Ccircle%20fill='rgba(186,186,192,0.7)'%20cx='16'%20cy='16'%20r='2'/%3E%3Ccircle%20fill='rgba(186,186,192,0.7)'%20cx='26'%20cy='16'%20r='2'/%3E%3Ccircle%20fill='rgba(186,186,192,0.7)'%20cx='6'%20cy='16'%20r='2'/%3E%3C/svg%3E\");background-size:contain;background-repeat:no-repeat;background-position:center}.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}limel-notched-outline{flex-grow:1}.copy-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.copy-button:hover,.copy-button:focus,.copy-button:focus-visible{will-change:color, background-color, box-shadow, transform}.copy-button:hover,.copy-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.copy-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.copy-button:hover,.copy-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.copy-button:focus{outline:none}.copy-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.copy-button{position:absolute;top:0.25rem;right:0.25rem;z-index:1;padding:0.25rem 0.5rem;border-radius:0.375rem;font-size:0.75rem;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease), opacity var(--limel-clickable-transition-speed, 0.4s) ease;opacity:0}:host(limel-code-editor:hover) .copy-button,:host(limel-code-editor:focus-within) .copy-button{opacity:1}:host(limel-code-editor:focus),:host(limel-code-editor:focus-visible),:host(limel-code-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-code-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-code-editor:focus) limel-helper-line,:host(limel-code-editor:focus-visible) limel-helper-line,:host(limel-code-editor:focus-within) limel-helper-line,:host(limel-code-editor:hover) limel-helper-line{will-change:grid-template-rows}";export{R as limel_code_editor}
1
+ import{r,c as t,h as e,H as n,a as i}from"./p-xvTBZcD2.js";import{c as o}from"./p-JbKhhoXs.js";import{g as a}from"./p-BFTU3MAI.js";import{t as u}from"./p-6rJPElLH.js";var l,s={exports:{}};function c(){return l||(l=1,s.exports=function(){var r=navigator.userAgent,t=navigator.platform,e=/gecko\/\d/i.test(r),n=/MSIE \d/.test(r),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),o=/Edge\/(\d+)/.exec(r),a=n||i||o,u=a&&(n?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(r),s=l&&/Qt\/\d+\.\d+/.test(r),c=!o&&/Chrome\/(\d+)/.exec(r),f=c&&+c[1],d=/Opera\//.test(r),h=/Apple Computer/.test(navigator.vendor),v=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),m=/PhantomJS/.test(r),p=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),g=/Android/.test(r),b=p||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),w=p||/Mac/.test(t),k=/\bCrOS\b/.test(r),y=/win/i.test(t),x=d&&r.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var C=w&&(s||d&&(null==x||x<12.11)),M=e||a&&u>=9;function A(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L,S=function(r,t){var e=r.className,n=A(t).exec(e);if(n){var i=e.slice(n.index+n[0].length);r.className=e.slice(0,n.index)+(i?n[1]+i:"")}};function T(r){for(var t=r.childNodes.length;t>0;--t)r.removeChild(r.firstChild);return r}function N(r,t){return T(r).appendChild(t)}function E(r,t,e,n){var i=document.createElement(r);if(e&&(i.className=e),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function D(r,t,e,n){var i=E(r,t,e,n);return i.setAttribute("role","presentation"),i}function z(r,t){if(3==t.nodeType&&(t=t.parentNode),r.contains)return r.contains(t);do{if(11==t.nodeType&&(t=t.host),t==r)return!0}while(t=t.parentNode)}function j(r){var t;try{t=r.activeElement}catch(e){t=r.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function B(r,t){var e=r.className;A(t).test(e)||(r.className+=(e?" ":"")+t)}function I(r,t){for(var e=r.split(" "),n=0;n<e.length;n++)e[n]&&!A(e[n]).test(t)&&(t+=" "+e[n]);return t}L=document.createRange?function(r,t,e,n){var i=document.createRange();return i.setEnd(n||r,e),i.setStart(r,t),i}:function(r,t,e){var n=document.body.createTextRange();try{n.moveToElementText(r.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",e),n.moveStart("character",t),n};var R=function(r){r.select()};function F(r){return r.display.wrapper.ownerDocument}function O(r){return F(r).defaultView}function U(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function _(r,t,e){for(var n in t||(t={}),r)!r.hasOwnProperty(n)||!1===e&&t.hasOwnProperty(n)||(t[n]=r[n]);return t}function P(r,t,e,n,i){null==t&&-1==(t=r.search(/[^\s\u00a0]/))&&(t=r.length);for(var o=n||0,a=i||0;;){var u=r.indexOf("\t",o);if(u<0||u>=t)return a+(t-o);a+=u-o,a+=e-a%e,o=u+1}}p?R=function(r){r.selectionStart=0,r.selectionEnd=r.value.length}:a&&(R=function(r){try{r.select()}catch(r){}});var q=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};function W(r,t){for(var e=0;e<r.length;++e)if(r[e]==t)return e;return-1}q.prototype.onTimeout=function(r){r.id=0,r.time<=+new Date?r.f():setTimeout(r.handler,r.time-+new Date)},q.prototype.set=function(r,t){this.f=t;var e=+new Date+r;(!this.id||e<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,r),this.time=e)};var $={toString:function(){return"CodeMirror.Pass"}},G={scroll:!1},H={origin:"*mouse"},K={origin:"+move"};function V(r,t,e){for(var n=0,i=0;;){var o=r.indexOf("\t",n);-1==o&&(o=r.length);var a=o-n;if(o==r.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=e-i%e)>=t)return n}}var Q=[""];function J(r){for(;Q.length<=r;)Q.push(Y(Q)+" ");return Q[r]}function Y(r){return r[r.length-1]}function X(r,t){for(var e=[],n=0;n<r.length;n++)e[n]=t(r[n],n);return e}function Z(){}function rr(r,t){var e;return Object.create?e=Object.create(r):(Z.prototype=r,e=new Z),t&&_(t,e),e}var tr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function er(r){return/\w/.test(r)||r>"€"&&(r.toUpperCase()!=r.toLowerCase()||tr.test(r))}function nr(r,t){return t?!!(t.source.indexOf("\\w")>-1&&er(r))||t.test(r):er(r)}function ir(r){for(var t in r)if(r.hasOwnProperty(t)&&r[t])return!1;return!0}var or=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ar(r){return r.charCodeAt(0)>=768&&or.test(r)}function ur(r,t,e){for(;(e<0?t>0:t<r.length)&&ar(r.charAt(t));)t+=e;return t}function lr(r,t,e){for(var n=t>e?-1:1;;){if(t==e)return t;var i=(t+e)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return r(o)?t:e;r(o)?e=o:t=o+n}}var sr=null;function cr(r,t,e){var n;sr=null;for(var i=0;i<r.length;++i){var o=r[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==e?n=i:sr=i),o.from==t&&(o.from!=o.to&&"before"!=e?n=i:sr=i)}return null!=n?n:sr}var fr=function(){var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,e=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(r,t,e){this.level=r,this.from=t,this.to=e}return function(a,u){var l,s="ltr"==u?"L":"R";if(0==a.length||"ltr"==u&&!r.test(a))return!1;for(var c=a.length,f=[],d=0;d<c;++d)f.push((l=a.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(l):1424<=l&&l<=1524?"R":1536<=l&&l<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(l-1536):1774<=l&&l<=2220?"r":8192<=l&&l<=8203?"w":8204==l?"b":"L");for(var h=0,v=s;h<c;++h){var m=f[h];"m"==m?f[h]=v:v=m}for(var p=0,g=s;p<c;++p){var b=f[p];"1"==b&&"r"==g?f[p]="n":e.test(b)&&(g=b,"r"==b&&(f[p]="R"))}for(var w=1,k=f[0];w<c-1;++w){var y=f[w];"+"==y&&"1"==k&&"1"==f[w+1]?f[w]="1":","!=y||k!=f[w+1]||"1"!=k&&"n"!=k||(f[w]=k),k=y}for(var x=0;x<c;++x){var C=f[x];if(","==C)f[x]="N";else if("%"==C){var M=void 0;for(M=x+1;M<c&&"%"==f[M];++M);for(var A=x&&"!"==f[x-1]||M<c&&"1"==f[M]?"1":"N",L=x;L<M;++L)f[L]=A;x=M-1}}for(var S=0,T=s;S<c;++S){var N=f[S];"L"==T&&"1"==N?f[S]="L":e.test(N)&&(T=N)}for(var E=0;E<c;++E)if(t.test(f[E])){var D=void 0;for(D=E+1;D<c&&t.test(f[D]);++D);for(var z="L"==(E?f[E-1]:s),j=z==("L"==(D<c?f[D]:s))?z?"L":"R":s,B=E;B<D;++B)f[B]=j;E=D-1}for(var I,R=[],F=0;F<c;)if(n.test(f[F])){var O=F;for(++F;F<c&&n.test(f[F]);++F);R.push(new o(0,O,F))}else{var U=F,_=R.length,P="rtl"==u?1:0;for(++F;F<c&&"L"!=f[F];++F);for(var q=U;q<F;)if(i.test(f[q])){U<q&&(R.splice(_,0,new o(1,U,q)),_+=P);var W=q;for(++q;q<F&&i.test(f[q]);++q);R.splice(_,0,new o(2,W,q)),_+=P,U=q}else++q;U<F&&R.splice(_,0,new o(1,U,F))}return"ltr"==u&&(1==R[0].level&&(I=a.match(/^\s+/))&&(R[0].from=I[0].length,R.unshift(new o(0,0,I[0].length))),1==Y(R).level&&(I=a.match(/\s+$/))&&(Y(R).to-=I[0].length,R.push(new o(0,c-I[0].length,c)))),"rtl"==u?R.reverse():R}}();function dr(r,t){var e=r.order;return null==e&&(e=r.order=fr(r.text,t)),e}var hr=[],vr=function(r,t,e){if(r.addEventListener)r.addEventListener(t,e,!1);else if(r.attachEvent)r.attachEvent("on"+t,e);else{var n=r._handlers||(r._handlers={});n[t]=(n[t]||hr).concat(e)}};function mr(r,t){return r._handlers&&r._handlers[t]||hr}function pr(r,t,e){if(r.removeEventListener)r.removeEventListener(t,e,!1);else if(r.detachEvent)r.detachEvent("on"+t,e);else{var n=r._handlers,i=n&&n[t];if(i){var o=W(i,e);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function gr(r,t){var e=mr(r,t);if(e.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<e.length;++i)e[i].apply(null,n)}function br(r,t,e){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),gr(r,e||t.type,r,t),Mr(t)||t.codemirrorIgnore}function wr(r){var t=r._handlers&&r._handlers.cursorActivity;if(t)for(var e=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==W(e,t[n])&&e.push(t[n])}function kr(r,t){return mr(r,t).length>0}function yr(r){r.prototype.on=function(r,t){vr(this,r,t)},r.prototype.off=function(r,t){pr(this,r,t)}}function xr(r){r.preventDefault?r.preventDefault():r.returnValue=!1}function Cr(r){r.stopPropagation?r.stopPropagation():r.cancelBubble=!0}function Mr(r){return null!=r.defaultPrevented?r.defaultPrevented:0==r.returnValue}function Ar(r){xr(r),Cr(r)}function Lr(r){return r.target||r.srcElement}function Sr(r){var t=r.which;return null==t&&(1&r.button?t=1:2&r.button?t=3:4&r.button&&(t=2)),w&&r.ctrlKey&&1==t&&(t=3),t}var Tr,Nr,Er=function(){if(a&&u<9)return!1;var r=E("div");return"draggable"in r||"dragDrop"in r}();function Dr(r){if(null==Tr){var t=E("span","​");N(r,E("span",[t,document.createTextNode("x")])),0!=r.firstChild.offsetHeight&&(Tr=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&u<8))}var e=Tr?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return e.setAttribute("cm-text",""),e}function zr(r){if(null!=Nr)return Nr;var t=N(r,document.createTextNode("AخA")),e=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return T(r),!(!e||e.left==e.right)&&(Nr=n.right-e.right<3)}var jr,Br=3!="\n\nb".split(/\n/).length?function(r){for(var t=0,e=[],n=r.length;t<=n;){var i=r.indexOf("\n",t);-1==i&&(i=r.length);var o=r.slice(t,"\r"==r.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(e.push(o.slice(0,a)),t+=a+1):(e.push(o),t=i+1)}return e}:function(r){return r.split(/\r\n?|\n/)},Ir=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return!1}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}return!(!t||t.parentElement()!=r)&&0!=t.compareEndPoints("StartToEnd",t)},Rr="oncopy"in(jr=E("div"))||(jr.setAttribute("oncopy","return;"),"function"==typeof jr.oncopy),Fr=null;var Or={},Ur={};function _r(r,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Or[r]=t}function Pr(r){if("string"==typeof r&&Ur.hasOwnProperty(r))r=Ur[r];else if(r&&"string"==typeof r.name&&Ur.hasOwnProperty(r.name)){var t=Ur[r.name];"string"==typeof t&&(t={name:t}),(r=rr(t,r)).name=t.name}else{if("string"==typeof r&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r))return Pr("application/xml");if("string"==typeof r&&/^[\w\-]+\/[\w\-]+\+json$/.test(r))return Pr("application/json")}return"string"==typeof r?{name:r}:r||{name:"null"}}function qr(r,t){t=Pr(t);var e=Or[t.name];if(!e)return qr(r,"text/plain");var n=e(r,t);if(Wr.hasOwnProperty(t.name)){var i=Wr[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Wr={};function $r(r,t){_(t,Wr.hasOwnProperty(r)?Wr[r]:Wr[r]={})}function Gr(r,t){if(!0===t)return t;if(r.copyState)return r.copyState(t);var e={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),e[n]=i}return e}function Hr(r,t){for(var e;r.innerMode&&(e=r.innerMode(t))&&e.mode!=r;)t=e.state,r=e.mode;return e||{mode:r,state:t}}function Kr(r,t,e){return!r.startState||r.startState(t,e)}var Vr=function(r,t,e){this.pos=this.start=0,this.string=r,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=e};function Qr(r,t){if((t-=r.first)<0||t>=r.size)throw new Error("There is no line "+(t+r.first)+" in the document.");for(var e=r;!e.lines;)for(var n=0;;++n){var i=e.children[n],o=i.chunkSize();if(t<o){e=i;break}t-=o}return e.lines[t]}function Jr(r,t,e){var n=[],i=t.line;return r.iter(t.line,e.line+1,(function(r){var o=r.text;i==e.line&&(o=o.slice(0,e.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function Yr(r,t,e){var n=[];return r.iter(t,e,(function(r){n.push(r.text)})),n}function Xr(r,t){var e=t-r.height;if(e)for(var n=r;n;n=n.parent)n.height+=e}function Zr(r){if(null==r.parent)return null;for(var t=r.parent,e=W(t.lines,r),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)e+=n.children[i].chunkSize();return e+t.first}function rt(r,t){var e=r.first;r:do{for(var n=0;n<r.children.length;++n){var i=r.children[n],o=i.height;if(t<o){r=i;continue r}t-=o,e+=i.chunkSize()}return e}while(!r.lines);for(var a=0;a<r.lines.length;++a){var u=r.lines[a].height;if(t<u)break;t-=u}return e+a}function tt(r,t){return t>=r.first&&t<r.first+r.size}function et(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function nt(r,t,e){if(void 0===e&&(e=null),!(this instanceof nt))return new nt(r,t,e);this.line=r,this.ch=t,this.sticky=e}function it(r,t){return r.line-t.line||r.ch-t.ch}function ot(r,t){return r.sticky==t.sticky&&0==it(r,t)}function at(r){return nt(r.line,r.ch)}function ut(r,t){return it(r,t)<0?t:r}function lt(r,t){return it(r,t)<0?r:t}function st(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function ct(r,t){if(t.line<r.first)return nt(r.first,0);var e=r.first+r.size-1;return t.line>e?nt(e,Qr(r,e).text.length):function(r,t){var e=r.ch;return null==e||e>t?nt(r.line,t):e<0?nt(r.line,0):r}(t,Qr(r,t.line).text.length)}function ft(r,t){for(var e=[],n=0;n<t.length;n++)e[n]=ct(r,t[n]);return e}Vr.prototype.eol=function(){return this.pos>=this.string.length},Vr.prototype.sol=function(){return this.pos==this.lineStart},Vr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vr.prototype.eat=function(r){var t=this.string.charAt(this.pos);if("string"==typeof r?t==r:t&&(r.test?r.test(t):r(t)))return++this.pos,t},Vr.prototype.eatWhile=function(r){for(var t=this.pos;this.eat(r););return this.pos>t},Vr.prototype.eatSpace=function(){for(var r=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>r},Vr.prototype.skipToEnd=function(){this.pos=this.string.length},Vr.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1)return this.pos=t,!0},Vr.prototype.backUp=function(r){this.pos-=r},Vr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Vr.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Vr.prototype.match=function(r,t,e){if("string"!=typeof r){var n=this.string.slice(this.pos).match(r);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(r){return e?r.toLowerCase():r};if(i(this.string.substr(this.pos,r.length))==i(r))return!1!==t&&(this.pos+=r.length),!0},Vr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vr.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}},Vr.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)},Vr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};var dt=function(r,t){this.state=r,this.lookAhead=t},ht=function(r,t,e,n){this.state=t,this.doc=r,this.line=e,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function vt(r,t,e,n){var i=[r.state.modeGen],o={};Ct(r,t.text,r.doc.mode,e,(function(r,t){return i.push(r,t)}),o,n);for(var a=e.state,u=function(n){e.baseTokens=i;var u=r.state.overlays[n],l=1,s=0;e.state=!0,Ct(r,t.text,u.mode,e,(function(r,t){for(var e=l;s<r;){var n=i[l];n>r&&i.splice(l,1,r,i[l+1],n),l+=2,s=Math.min(r,n)}if(t)if(u.opaque)i.splice(e,l-e,r,"overlay "+t),l=e+2;else for(;e<l;e+=2){var o=i[e+1];i[e+1]=(o?o+" ":"")+"overlay "+t}}),o),e.state=a,e.baseTokens=null,e.baseTokenPos=1},l=0;l<r.state.overlays.length;++l)u(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mt(r,t,e){if(!t.styles||t.styles[0]!=r.state.modeGen){var n=pt(r,Zr(t)),i=t.text.length>r.options.maxHighlightLength&&Gr(r.doc.mode,n.state),o=vt(r,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),e===r.doc.highlightFrontier&&(r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier))}return t.styles}function pt(r,t,e){var n=r.doc,i=r.display;if(!n.mode.startState)return new ht(n,!0,t);var o=function(r,t,e){for(var n,i,o=r.doc,a=e?-1:t-(r.doc.mode.innerMode?1e3:100),u=t;u>a;--u){if(u<=o.first)return o.first;var l=Qr(o,u-1),s=l.stateAfter;if(s&&(!e||u+(s instanceof dt?s.lookAhead:0)<=o.modeFrontier))return u;var c=P(l.text,null,r.options.tabSize);(null==i||n>c)&&(i=u-1,n=c)}return i}(r,t,e),a=o>n.first&&Qr(n,o-1).stateAfter,u=a?ht.fromSaved(n,a,o):new ht(n,Kr(n.mode),o);return n.iter(o,t,(function(e){gt(r,e.text,u);var n=u.line;e.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?u.save():null,u.nextLine()})),e&&(n.modeFrontier=u.line),u}function gt(r,t,e,n){var i=r.doc.mode,o=new Vr(t,r.options.tabSize,e);for(o.start=o.pos=n||0,""==t&&bt(i,e.state);!o.eol();)wt(i,o,e.state),o.start=o.pos}function bt(r,t){if(r.blankLine)return r.blankLine(t);if(r.innerMode){var e=Hr(r,t);return e.mode.blankLine?e.mode.blankLine(e.state):void 0}}function wt(r,t,e,n){for(var i=0;i<10;i++){n&&(n[0]=Hr(r,e).mode);var o=r.token(t,e);if(t.pos>t.start)return o}throw new Error("Mode "+r.name+" failed to advance stream.")}ht.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);return null!=t&&r>this.maxLookAhead&&(this.maxLookAhead=r),t},ht.prototype.baseToken=function(r){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=r;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}},ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ht.fromSaved=function(r,t,e){return t instanceof dt?new ht(r,Gr(r.mode,t.state),e,t.lookAhead):new ht(r,Gr(r.mode,t),e)},ht.prototype.save=function(r){var t=!1!==r?Gr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new dt(t,this.maxLookAhead):t};var kt=function(r,t,e){this.start=r.start,this.end=r.pos,this.string=r.current(),this.type=t||null,this.state=e};function yt(r,t,e,n){var i,o,a=r.doc,u=a.mode,l=Qr(a,(t=ct(a,t)).line),s=pt(r,t.line,e),c=new Vr(l.text,r.options.tabSize,s);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=wt(u,c,s.state),n&&o.push(new kt(c,i,Gr(a.mode,s.state)));return n?o:new kt(c,i,s.state)}function xt(r,t){if(r)for(;;){var e=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!e)break;r=r.slice(0,e.index)+r.slice(e.index+e[0].length);var n=e[1]?"bgClass":"textClass";null==t[n]?t[n]=e[2]:new RegExp("(?:^|\\s)"+e[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+e[2])}return r}function Ct(r,t,e,n,i,o,a){var u=e.flattenSpans;null==u&&(u=r.options.flattenSpans);var l,s=0,c=null,f=new Vr(t,r.options.tabSize,n),d=r.options.addModeClass&&[null];for(""==t&&xt(bt(e,n.state),o);!f.eol();){if(f.pos>r.options.maxHighlightLength?(u=!1,a&&gt(r,t,n,f.pos),f.pos=t.length,l=null):l=xt(wt(e,f,n.state,d),o),d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!u||c!=l){for(;s<f.start;)i(s=Math.min(f.start,s+5e3),c);c=l}f.start=f.pos}for(;s<f.pos;){var v=Math.min(f.pos,s+5e3);i(v,c),s=v}}var Mt=!1,At=!1;function Lt(r,t,e){this.marker=r,this.from=t,this.to=e}function St(r,t){if(r)for(var e=0;e<r.length;++e){var n=r[e];if(n.marker==t)return n}}function Tt(r,t){for(var e,n=0;n<r.length;++n)r[n]!=t&&(e||(e=[])).push(r[n]);return e}function Nt(r,t){if(t.full)return null;var e=tt(r,t.from.line)&&Qr(r,t.from.line).markedSpans,n=tt(r,t.to.line)&&Qr(r,t.to.line).markedSpans;if(!e&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==it(t.from,t.to),u=function(r,t,e){var n;if(r)for(var i=0;i<r.length;++i){var o=r[i],a=o.marker;null!=o.from&&!(a.inclusiveLeft?o.from<=t:o.from<t)&&(o.from!=t||"bookmark"!=a.type||e&&o.marker.insertLeft)||(n||(n=[])).push(new Lt(a,o.from,null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)?null:o.to))}return n}(e,i,a),l=function(r,t,e){var n;if(r)for(var i=0;i<r.length;++i){var o=r[i],a=o.marker;(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!e||o.marker.insertLeft))&&(n||(n=[])).push(new Lt(a,null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)?null:o.from-t,null==o.to?null:o.to-t))}return n}(n,o,a),s=1==t.text.length,c=Y(t.text).length+(s?i:0);if(u)for(var f=0;f<u.length;++f){var d=u[f];if(null==d.to){var h=St(l,d.marker);h?s&&(d.to=null==h.to?null:h.to+c):d.to=i}}if(l)for(var v=0;v<l.length;++v){var m=l[v];null!=m.to&&(m.to+=c),null==m.from?St(u,m.marker)||(m.from=c,s&&(u||(u=[])).push(m)):(m.from+=c,s&&(u||(u=[])).push(m))}u&&(u=Et(u)),l&&l!=u&&(l=Et(l));var p=[u];if(!s){var g,b=t.text.length-2;if(b>0&&u)for(var w=0;w<u.length;++w)null==u[w].to&&(g||(g=[])).push(new Lt(u[w].marker,null,null));for(var k=0;k<b;++k)p.push(g);p.push(l)}return p}function Et(r){for(var t=0;t<r.length;++t){var e=r[t];null!=e.from&&e.from==e.to&&!1!==e.marker.clearWhenEmpty&&r.splice(t--,1)}return r.length?r:null}function Dt(r){var t=r.markedSpans;if(t){for(var e=0;e<t.length;++e)t[e].marker.detachLine(r);r.markedSpans=null}}function zt(r,t){if(t){for(var e=0;e<t.length;++e)t[e].marker.attachLine(r);r.markedSpans=t}}function jt(r){return r.inclusiveLeft?-1:0}function Bt(r){return r.inclusiveRight?1:0}function It(r,t){var e=r.lines.length-t.lines.length;if(0!=e)return e;var n=r.find(),i=t.find(),o=it(n.from,i.from)||jt(r)-jt(t);return o?-o:it(n.to,i.to)||Bt(r)-Bt(t)||t.id-r.id}function Rt(r,t){var e,n=At&&r.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!e||It(e,i.marker)<0)&&(e=i.marker);return e}function Ft(r){return Rt(r,!0)}function Ot(r){return Rt(r,!1)}function Ut(r,t){var e,n=At&&r.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!e||It(e,o.marker)<0)&&(e=o.marker)}return e}function _t(r,t,e,n,i){var o=Qr(r,t),a=At&&o.markedSpans;if(a)for(var u=0;u<a.length;++u){var l=a[u];if(l.marker.collapsed){var s=l.marker.find(0),c=it(s.from,e)||jt(l.marker)-jt(i),f=it(s.to,n)||Bt(l.marker)-Bt(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?it(s.to,e)>=0:it(s.to,e)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?it(s.from,n)<=0:it(s.from,n)<0)))return!0}}}function Pt(r){for(var t;t=Ft(r);)r=t.find(-1,!0).line;return r}function qt(r,t){var e=Qr(r,t),n=Pt(e);return e==n?t:Zr(n)}function Wt(r,t){if(t>r.lastLine())return t;var e,n=Qr(r,t);if(!$t(r,n))return t;for(;e=Ot(n);)n=e.find(1,!0).line;return Zr(n)+1}function $t(r,t){var e=At&&t.markedSpans;if(e)for(var n=void 0,i=0;i<e.length;++i)if((n=e[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Gt(r,t,n))return!0}}function Gt(r,t,e){if(null==e.to){var n=e.marker.find(1,!0);return Gt(r,n.line,St(n.line.markedSpans,e.marker))}if(e.marker.inclusiveRight&&e.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==e.to&&(null==i.to||i.to!=e.from)&&(i.marker.inclusiveLeft||e.marker.inclusiveRight)&&Gt(r,t,i))return!0}function Ht(r){for(var t=0,e=(r=Pt(r)).parent,n=0;n<e.lines.length;++n){var i=e.lines[n];if(i==r)break;t+=i.height}for(var o=e.parent;o;o=(e=o).parent)for(var a=0;a<o.children.length;++a){var u=o.children[a];if(u==e)break;t+=u.height}return t}function Kt(r){if(0==r.height)return 0;for(var t,e=r.text.length,n=r;t=Ft(n);){var i=t.find(0,!0);n=i.from.line,e+=i.from.ch-i.to.ch}for(n=r;t=Ot(n);){var o=t.find(0,!0);e-=n.text.length-o.from.ch,e+=(n=o.to.line).text.length-o.to.ch}return e}function Vt(r){var t=r.display,e=r.doc;t.maxLine=Qr(e,e.first),t.maxLineLength=Kt(t.maxLine),t.maxLineChanged=!0,e.iter((function(r){var e=Kt(r);e>t.maxLineLength&&(t.maxLineLength=e,t.maxLine=r)}))}var Qt=function(r,t,e){this.text=r,zt(this,t),this.height=e?e(this):1};function Jt(r){r.parent=null,Dt(r)}Qt.prototype.lineNo=function(){return Zr(this)},yr(Qt);var Yt={},Xt={};function Zt(r,t){if(!r||/^\s*$/.test(r))return null;var e=t.addModeClass?Xt:Yt;return e[r]||(e[r]=r.replace(/\S+/g,"cm-$&"))}function re(r,t){var e=D("span",null,null,l?"padding-right: .1px":null),n={pre:D("pre",[e],"CodeMirror-line"),content:e,col:0,pos:0,cm:r,trailingSpace:!1,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=ee,zr(r.display.measure)&&(a=dr(o,r.doc.direction))&&(n.addToken=ne(n.addToken,a)),n.map=[],oe(o,n,mt(r,o,t!=r.display.externalMeasured&&Zr(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=I(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=I(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Dr(r.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return gr(r,"renderLine",r,t.line,n.pre),n.pre.className&&(n.textClass=I(n.pre.className,n.textClass||"")),n}function te(r){var t=E("span","•","cm-invalidchar");return t.title="\\u"+r.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ee(r,t,e,n,i,o,l){if(t){var s,c=r.splitSpaces?function(r,t){if(r.length>1&&!/ /.test(r))return r;for(var e=t,n="",i=0;i<r.length;i++){var o=r.charAt(i);" "!=o||!e||i!=r.length-1&&32!=r.charCodeAt(i+1)||(o=" "),n+=o,e=" "==o}return n}(t,r.trailingSpace):t,f=r.cm.state.specialChars,d=!1;if(f.test(t)){s=document.createDocumentFragment();for(var h=0;;){f.lastIndex=h;var v=f.exec(t),m=v?v.index-h:t.length-h;if(m){var p=document.createTextNode(c.slice(h,h+m));s.appendChild(a&&u<9?E("span",[p]):p),r.map.push(r.pos,r.pos+m,p),r.col+=m,r.pos+=m}if(!v)break;h+=m+1;var g=void 0;if("\t"==v[0]){var b=r.cm.options.tabSize,w=b-r.col%b;(g=s.appendChild(E("span",J(w),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),r.col+=w}else"\r"==v[0]||"\n"==v[0]?((g=s.appendChild(E("span","\r"==v[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",v[0]),r.col+=1):((g=r.cm.options.specialCharPlaceholder(v[0])).setAttribute("cm-text",v[0]),s.appendChild(a&&u<9?E("span",[g]):g),r.col+=1);r.map.push(r.pos,r.pos+1,g),r.pos++}}else r.col+=t.length,s=document.createTextNode(c),r.map.push(r.pos,r.pos+t.length,s),a&&u<9&&(d=!0),r.pos+=t.length;if(r.trailingSpace=32==c.charCodeAt(t.length-1),e||n||i||d||o||l){var k=e||"";n&&(k+=n),i&&(k+=i);var y=E("span",[s],k,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&y.setAttribute(x,l[x]);return r.content.appendChild(y)}r.content.appendChild(s)}}function ne(r,t){return function(e,n,i,o,a,u,l){i=i?i+" cm-force-border":"cm-force-border";for(var s=e.pos,c=s+n.length;;){for(var f=void 0,d=0;d<t.length&&!((f=t[d]).to>s&&f.from<=s);d++);if(f.to>=c)return r(e,n,i,o,a,u,l);r(e,n.slice(0,f.to-s),i,o,null,u,l),o=null,n=n.slice(f.to-s),s=f.to}}}function ie(r,t,e,n){var i=!n&&e.widgetNode;i&&r.map.push(r.pos,r.pos+t,i),!n&&r.cm.display.input.needsContentAttribute&&(i||(i=r.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",e.id)),i&&(r.cm.display.input.setUneditable(i),r.content.appendChild(i)),r.pos+=t,r.trailingSpace=!1}function oe(r,t,e){var n=r.markedSpans,i=r.text,o=0;if(n)for(var a,u,l,s,c,f,d,h=i.length,v=0,m=1,p="",g=0;;){if(g==v){l=s=c=u="",d=null,f=null,g=1/0;for(var b=[],w=void 0,k=0;k<n.length;++k){var y=n[k],x=y.marker;if("bookmark"==x.type&&y.from==v&&x.widgetNode)b.push(x);else if(y.from<=v&&(null==y.to||y.to>v||x.collapsed&&y.to==v&&y.from==v)){if(null!=y.to&&y.to!=v&&g>y.to&&(g=y.to,s=""),x.className&&(l+=" "+x.className),x.css&&(u=(u?u+";":"")+x.css),x.startStyle&&y.from==v&&(c+=" "+x.startStyle),x.endStyle&&y.to==g&&(w||(w=[])).push(x.endStyle,y.to),x.title&&((d||(d={})).title=x.title),x.attributes)for(var C in x.attributes)(d||(d={}))[C]=x.attributes[C];x.collapsed&&(!f||It(f.marker,x)<0)&&(f=y)}else y.from>v&&g>y.from&&(g=y.from)}if(w)for(var M=0;M<w.length;M+=2)w[M+1]==g&&(s+=" "+w[M]);if(!f||f.from==v)for(var A=0;A<b.length;++A)ie(t,0,b[A]);if(f&&(f.from||0)==v){if(ie(t,(null==f.to?h+1:f.to)-v,f.marker,null==f.from),null==f.to)return;f.to==v&&(f=!1)}}if(v>=h)break;for(var L=Math.min(h,g);;){if(p){var S=v+p.length;if(!f){var T=S>L?p.slice(0,L-v):p;t.addToken(t,T,a?a+l:l,c,v+T.length==g?s:"",u,d)}if(S>=L){p=p.slice(L-v),v=L;break}v=S,c=""}p=i.slice(o,o=e[m++]),a=Zt(e[m++],t.cm.options)}}else for(var N=1;N<e.length;N+=2)t.addToken(t,i.slice(o,o=e[N]),Zt(e[N+1],t.cm.options))}function ae(r,t,e){this.line=t,this.rest=function(r){for(var t,e;t=Ot(r);)r=t.find(1,!0).line,(e||(e=[])).push(r);return e}(t),this.size=this.rest?Zr(Y(this.rest))-e+1:1,this.node=this.text=null,this.hidden=$t(r,t)}function ue(r,t,e){for(var n,i=[],o=t;o<e;o=n){var a=new ae(r.doc,Qr(r.doc,o),o);n=o+a.size,i.push(a)}return i}var le=null;var se=null;function ce(r,t){var e=mr(r,t);if(e.length){var n,i=Array.prototype.slice.call(arguments,2);le?n=le.delayedCallbacks:se?n=se:(n=se=[],setTimeout(fe,0));for(var o=function(r){n.push((function(){return e[r].apply(null,i)}))},a=0;a<e.length;++a)o(a)}}function fe(){var r=se;se=null;for(var t=0;t<r.length;++t)r[t]()}function de(r,t,e,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?me(r,t):"gutter"==o?ge(r,t,e,n):"class"==o?pe(r,t):"widget"==o&&be(r,t,n)}t.changes=null}function he(r){return r.node==r.text&&(r.node=E("div",null,null,"position: relative"),r.text.parentNode&&r.text.parentNode.replaceChild(r.node,r.text),r.node.appendChild(r.text),a&&u<8&&(r.node.style.zIndex=2)),r.node}function ve(r,t){var e=r.display.externalMeasured;return e&&e.line==t.line?(r.display.externalMeasured=null,t.measure=e.measure,e.built):re(r,t)}function me(r,t){var e=t.text.className,n=ve(r,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,pe(r,t)):e&&(t.text.className=e)}function pe(r,t){(function(r,t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(e&&(e+=" CodeMirror-linebackground"),t.background)e?t.background.className=e:(t.background.parentNode.removeChild(t.background),t.background=null);else if(e){var n=he(t);t.background=n.insertBefore(E("div",null,e),n.firstChild),r.display.input.setUneditable(t.background)}})(r,t),t.line.wrapClass?he(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=""),t.text.className=(t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass)||""}function ge(r,t,e,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=he(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),r.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var a=he(t),u=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(u.setAttribute("aria-hidden","true"),r.display.input.setUneditable(u),a.insertBefore(u,t.text),t.line.gutterClass&&(u.className+=" "+t.line.gutterClass),!r.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=u.appendChild(E("div",et(r.options,e),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<r.display.gutterSpecs.length;++l){var s=r.display.gutterSpecs[l].className,c=o.hasOwnProperty(s)&&o[s];c&&u.appendChild(E("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[s]+"px; width: "+n.gutterWidth[s]+"px"))}}}function be(r,t,e){t.alignable&&(t.alignable=null);for(var n=A("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);ke(r,t,e)}function we(r,t,e,n){var i=ve(r,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pe(r,t),ge(r,t,e,n),ke(r,t,n),t.node}function ke(r,t,e){if(ye(r,t.line,t,e,!0),t.rest)for(var n=0;n<t.rest.length;n++)ye(r,t.rest[n],t,e,!1)}function ye(r,t,e,n,i){if(t.widgets)for(var o=he(e),a=0,u=t.widgets;a<u.length;++a){var l=u[a],s=E("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||s.setAttribute("cm-ignore-events","true"),xe(l,s,e,n),r.display.input.setUneditable(s),i&&l.above?o.insertBefore(s,e.gutter||e.text):o.appendChild(s),ce(l,"redraw")}}function xe(r,t,e,n){if(r.noHScroll){(e.alignable||(e.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",r.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}r.coverGutter&&(t.style.zIndex=5,t.style.position="relative",r.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ce(r){if(null!=r.height)return r.height;var t=r.doc.cm;if(!t)return 0;if(!z(document.body,r.node)){var e="position: relative;";r.coverGutter&&(e+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),r.noHScroll&&(e+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,E("div",[r.node],null,e))}return r.height=r.node.parentNode.offsetHeight}function Me(r,t){for(var e=Lr(t);e!=r.wrapper;e=e.parentNode)if(!e||1==e.nodeType&&"true"==e.getAttribute("cm-ignore-events")||e.parentNode==r.sizer&&e!=r.mover)return!0}function Ae(r){return r.lineSpace.offsetTop}function Le(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Se(r){if(r.cachedPaddingH)return r.cachedPaddingH;var t=N(r.measure,E("pre","x","CodeMirror-line-like")),e=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(r.cachedPaddingH=n),n}function Te(r){return 50-r.display.nativeBarWidth}function Ne(r){return r.display.scroller.clientWidth-Te(r)-r.display.barWidth}function Ee(r){return r.display.scroller.clientHeight-Te(r)-r.display.barHeight}function De(r,t,e){if(r.line==t)return{map:r.measure.map,cache:r.measure.cache};if(r.rest){for(var n=0;n<r.rest.length;n++)if(r.rest[n]==t)return{map:r.measure.maps[n],cache:r.measure.caches[n]};for(var i=0;i<r.rest.length;i++)if(Zr(r.rest[i])>e)return{map:r.measure.maps[i],cache:r.measure.caches[i],before:!0}}}function ze(r,t,e,n){return Ie(r,Be(r,t),e,n)}function je(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo)return r.display.view[hn(r,t)];var e=r.display.externalMeasured;return e&&t>=e.lineN&&t<e.lineN+e.size?e:void 0}function Be(r,t){var e=Zr(t),n=je(r,e);n&&!n.text?n=null:n&&n.changes&&(de(r,n,e,ln(r)),r.curOp.forceUpdate=!0),n||(n=function(r,t){var e=Zr(t=Pt(t)),n=r.display.externalMeasured=new ae(r.doc,t,e);n.lineN=e;var i=n.built=re(r,n);return n.text=i.pre,N(r.display.lineMeasure,i.pre),n}(r,t));var i=De(n,t,e);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Ie(r,t,e,n,i){t.before&&(e=-1);var o,l=e+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(r,t,e){var n=r.options.lineWrapping,i=n&&Ne(r);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),u=0;u<a.length-1;u++){var l=a[u],s=a[u+1];Math.abs(l.bottom-s.bottom)>2&&o.push((l.bottom+s.top)/2-e.top)}}o.push(e.bottom-e.top)}}(r,t.view,t.rect),t.hasHeights=!0),(o=function(r,t,e,n){var i,o=Oe(t.map,e,n),l=o.node,s=o.start,c=o.end,f=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;s&&ar(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+c<o.coverEnd&&ar(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&u<9&&0==s&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Ue(L(l,s,c).getClientRects(),n)).left||i.right||0==s)break;c=s,s-=1,f="right"}a&&u<11&&(i=function(r,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(r){if(null!=Fr)return Fr;var t=N(r,E("span","x")),e=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Fr=Math.abs(e.left-n.left)>1}(r))return t;var e=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*e,right:t.right*e,top:t.top*n,bottom:t.bottom*n}}(r.display.measure,i))}else{var h;s>0&&(f=n="right"),i=r.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(a&&u<9&&!s&&(!i||!i.left&&!i.right)){var v=l.parentNode.getClientRects()[0];i=v?{left:v.left,right:v.left+un(r.display),top:v.top,bottom:v.bottom}:Fe}for(var m=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(m+p)/2,b=t.view.measure.heights,w=0;w<b.length-1&&!(g<b[w]);w++);var k={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:w?b[w-1]:0,bottom:b[w]};return i.left||i.right||(k.bogus=!0),r.options.singleCursorHeightPerLine||(k.rtop=m,k.rbottom=p),k}(r,t,e,n)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Re,Fe={left:0,right:0,top:0,bottom:0};function Oe(r,t,e){for(var n,i,o,a,u,l,s=0;s<r.length;s+=3)if(l=r[s+1],t<(u=r[s])?(i=0,o=1,a="left"):t<l?o=1+(i=t-u):(s==r.length-3||t==l&&r[s+3]>t)&&(i=(o=l-u)-1,t>=l&&(a="right")),null!=i){if(n=r[s+2],u==l&&e==(n.insertLeft?"left":"right")&&(a=e),"left"==e&&0==i)for(;s&&r[s-2]==r[s-3]&&r[s-1].insertLeft;)n=r[2+(s-=3)],a="left";if("right"==e&&i==l-u)for(;s<r.length-3&&r[s+3]==r[s+4]&&!r[s+5].insertLeft;)n=r[(s+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:u,coverEnd:l}}function Ue(r,t){var e=Fe;if("left"==t)for(var n=0;n<r.length&&(e=r[n]).left==e.right;n++);else for(var i=r.length-1;i>=0&&(e=r[i]).left==e.right;i--);return e}function _e(r){if(r.measure&&(r.measure.cache={},r.measure.heights=null,r.rest))for(var t=0;t<r.rest.length;t++)r.measure.caches[t]={}}function Pe(r){r.display.externalMeasure=null,T(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++)_e(r.display.view[t])}function qe(r){Pe(r),r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null,r.options.lineWrapping||(r.display.maxLineChanged=!0),r.display.lineNumChars=null}function We(r){return c&&g?-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft)):r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function $e(r){return c&&g?-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop)):r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function Ge(r){var t=Pt(r).widgets,e=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(e+=Ce(t[n]));return e}function He(r,t,e,n,i){if(!i){var o=Ge(t);e.top+=o,e.bottom+=o}if("line"==n)return e;n||(n="local");var a=Ht(t);if("local"==n?a+=Ae(r.display):a-=r.display.viewOffset,"page"==n||"window"==n){var u=r.display.lineSpace.getBoundingClientRect();a+=u.top+("window"==n?0:$e(F(r)));var l=u.left+("window"==n?0:We(F(r)));e.left+=l,e.right+=l}return e.top+=a,e.bottom+=a,e}function Ke(r,t,e){if("div"==e)return t;var n=t.left,i=t.top;if("page"==e)n-=We(F(r)),i-=$e(F(r));else if("local"==e||!e){var o=r.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=r.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Ve(r,t,e,n,i){return n||(n=Qr(r.doc,t.line)),He(r,n,ze(r,n,t.ch,i),e)}function Qe(r,t,e,n,i,o){function a(t,a){var u=Ie(r,i,t,a?"right":"left",o);return a?u.left=u.right:u.right=u.left,He(r,n,u,e)}n=n||Qr(r.doc,t.line),i||(i=Be(r,n));var u=dr(n,r.doc.direction),l=t.ch,s=t.sticky;if(l>=n.text.length?(l=n.text.length,s="before"):l<=0&&(l=0,s="after"),!u)return a("before"==s?l-1:l,"before"==s);function c(r,t,e){return a(e?r-1:r,1==u[t].level!=e)}var f=cr(u,l,s),d=sr,h=c(l,f,"before"==s);return null!=d&&(h.other=c(l,d,"before"!=s)),h}function Je(r,t){var e=0;t=ct(r.doc,t),r.options.lineWrapping||(e=un(r.display)*t.ch);var n=Qr(r.doc,t.line),i=Ht(n)+Ae(r.display);return{left:e,right:e,top:i,bottom:i+n.height}}function Ye(r,t,e,n,i){var o=nt(r,t,e);return o.xRel=i,n&&(o.outside=n),o}function Xe(r,t,e){var n=r.doc;if((e+=r.display.viewOffset)<0)return Ye(n.first,0,null,-1,-1);var i=rt(n,e),o=n.first+n.size-1;if(i>o)return Ye(n.first+n.size-1,Qr(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=Qr(n,i);;){var u=en(r,a,i,t,e),l=Ut(a,u.ch+(u.xRel>0||u.outside>0?1:0));if(!l)return u;var s=l.find(1);if(s.line==i)return s;a=Qr(n,i=s.line)}}function Ze(r,t,e,n){n-=Ge(t);var i=t.text.length,o=lr((function(t){return Ie(r,e,t-1).bottom<=n}),i,0);return{begin:o,end:i=lr((function(t){return Ie(r,e,t).top>n}),o,i)}}function rn(r,t,e,n){return e||(e=Be(r,t)),Ze(r,t,e,He(r,t,Ie(r,e,n),"line").top)}function tn(r,t,e,n){return!(r.bottom<=e)&&(r.top>e||(n?r.left:r.right)>t)}function en(r,t,e,n,i){i-=Ht(t);var o=Be(r,t),a=Ge(t),u=0,l=t.text.length,s=!0,c=dr(t,r.doc.direction);if(c){var f=(r.options.lineWrapping?on:nn)(r,t,e,o,c,n,i);u=(s=1!=f.level)?f.from:f.to-1,l=s?f.to:f.from-1}var d,h,v=null,m=null,p=lr((function(t){var e=Ie(r,o,t);return e.top+=a,e.bottom+=a,!!tn(e,n,i,!1)&&(e.top<=i&&e.left<=n&&(v=t,m=e),!0)}),u,l),g=!1;if(m){var b=n-m.left<m.right-n,w=b==s;p=v+(w?0:1),h=w?"after":"before",d=b?m.left:m.right}else{s||p!=l&&p!=u||p++,h=0==p?"after":p==t.text.length?"before":Ie(r,o,p-(s?1:0)).bottom+a<=i==s?"after":"before";var k=Qe(r,nt(e,p,h),"line",t,o);d=k.left,g=i<k.top?-1:i>=k.bottom?1:0}return Ye(e,p=ur(t.text,p,1),h,g,n-d)}function nn(r,t,e,n,i,o,a){var u=lr((function(u){var l=i[u],s=1!=l.level;return tn(Qe(r,nt(e,s?l.to:l.from,s?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),l=i[u];if(u>0){var s=1!=l.level,c=Qe(r,nt(e,s?l.from:l.to,s?"after":"before"),"line",t,n);tn(c,o,a,!0)&&c.top>a&&(l=i[u-1])}return l}function on(r,t,e,n,i,o,a){var u=Ze(r,t,n,a),l=u.begin,s=u.end;/\s/.test(t.text.charAt(s-1))&&s--;for(var c=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=s||h.to<=l)){var v=Ie(r,n,1!=h.level?Math.min(s,h.to)-1:Math.max(l,h.from)).right,m=v<o?o-v+1e9:v-o;(!c||f>m)&&(c=h,f=m)}}return c||(c=i[i.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>s&&(c={from:c.from,to:s,level:c.level}),c}function an(r){if(null!=r.cachedTextHeight)return r.cachedTextHeight;if(null==Re){Re=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Re.appendChild(document.createTextNode("x")),Re.appendChild(E("br"));Re.appendChild(document.createTextNode("x"))}N(r.measure,Re);var e=Re.offsetHeight/50;return e>3&&(r.cachedTextHeight=e),T(r.measure),e||1}function un(r){if(null!=r.cachedCharWidth)return r.cachedCharWidth;var t=E("span","xxxxxxxxxx"),e=E("pre",[t],"CodeMirror-line-like");N(r.measure,e);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(r.cachedCharWidth=i),i||10}function ln(r){for(var t=r.display,e={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var u=r.display.gutterSpecs[a].className;e[u]=o.offsetLeft+o.clientLeft+i,n[u]=o.clientWidth}return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:e,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function cn(r){var t=an(r.display),e=r.options.lineWrapping,n=e&&Math.max(5,r.display.scroller.clientWidth/un(r.display)-3);return function(i){if($t(r.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return e?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function fn(r){var t=r.doc,e=cn(r);t.iter((function(r){var t=e(r);t!=r.height&&Xr(r,t)}))}function dn(r,t,e,n){var i=r.display;if(!e&&"true"==Lr(t).getAttribute("cm-not-content"))return null;var o,a,u=i.lineSpace.getBoundingClientRect();try{o=t.clientX-u.left,a=t.clientY-u.top}catch(r){return null}var l,s=Xe(r,o,a);if(n&&s.xRel>0&&(l=Qr(r.doc,s.line).text).length==s.ch){var c=P(l,l.length,r.options.tabSize)-l.length;s=nt(s.line,Math.max(0,Math.round((o-Se(r.display).left)/un(r.display))-c))}return s}function hn(r,t){if(t>=r.display.viewTo)return null;if((t-=r.display.viewFrom)<0)return null;for(var e=r.display.view,n=0;n<e.length;n++)if((t-=e[n].size)<0)return n}function vn(r,t,e,n){null==t&&(t=r.doc.first),null==e&&(e=r.doc.first+r.doc.size),n||(n=0);var i=r.display;if(n&&e<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),r.curOp.viewChanged=!0,t>=i.viewTo)At&&qt(r.doc,t)<i.viewTo&&pn(r);else if(e<=i.viewFrom)At&&Wt(r.doc,e+n)>i.viewFrom?pn(r):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&e>=i.viewTo)pn(r);else if(t<=i.viewFrom){var o=gn(r,e,e+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):pn(r)}else if(e>=i.viewTo){var a=gn(r,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pn(r)}else{var u=gn(r,t,t,-1),l=gn(r,e,e+n,1);u&&l?(i.view=i.view.slice(0,u.index).concat(ue(r,u.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):pn(r)}var s=i.externalMeasured;s&&(e<s.lineN?s.lineN+=n:t<s.lineN+s.size&&(i.externalMeasured=null))}function mn(r,t,e){r.curOp.viewChanged=!0;var n=r.display,i=r.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[hn(r,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==W(a,e)&&a.push(e)}}}function pn(r){r.display.viewFrom=r.display.viewTo=r.doc.first,r.display.view=[],r.display.viewOffset=0}function gn(r,t,e,n){var i,o=hn(r,t),a=r.display.view;if(!At||e==r.doc.first+r.doc.size)return{index:o,lineN:e};for(var u=r.display.viewFrom,l=0;l<o;l++)u+=a[l].size;if(u!=t){if(n>0){if(o==a.length-1)return null;i=u+a[o].size-t,o++}else i=u-t;t+=i,e+=i}for(;qt(r.doc,e)!=e;){if(o==(n<0?0:a.length-1))return null;e+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:e}}function bn(r){for(var t=r.display.view,e=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++e}return e}function wn(r){r.display.input.showSelection(r.display.input.prepareSelection())}function kn(r,t){void 0===t&&(t=!0);var e=r.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=r.options.$customCursor;a&&(t=!0);for(var u=0;u<e.sel.ranges.length;u++)if(t||u!=e.sel.primIndex){var l=e.sel.ranges[u];if(!(l.from().line>=r.display.viewTo||l.to().line<r.display.viewFrom)){var s=l.empty();if(a){var c=a(r,l);c&&yn(r,c,i)}else(s||r.options.showCursorWhenSelecting)&&yn(r,l.head,i);s||Cn(r,l,o)}}return n}function yn(r,t,e){var n=Qe(r,t,"div",null,null,!r.options.singleCursorHeightPerLine),i=e.appendChild(E("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*r.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=Ve(r,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:r.defaultCharWidth())+"px"}if(n.other){var u=e.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="",u.style.left=n.other.left+"px",u.style.top=n.other.top+"px",u.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function xn(r,t){return r.top-t.top||r.left-t.left}function Cn(r,t,e){var n=r.display,i=r.doc,o=document.createDocumentFragment(),a=Se(r.display),u=a.left,l=Math.max(n.sizerWidth,Ne(r)-n.sizer.offsetLeft)-a.right,s="ltr"==i.direction;function c(r,t,e,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(null==e?l-r:e)+"px;\n height: "+(n-t)+"px"))}function f(t,e,n){var o,a,f=Qr(i,t),d=f.text.length;function h(e,n){return Ve(r,nt(t,e),"div",f,n)}function v(t,e,n){var i=rn(r,f,null,t),o="ltr"==e==("after"==n)?"left":"right";return h("after"==n?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var m=dr(f,i.direction);return function(r,t,e,n){if(!r)return n(t,e,"ltr",0);for(var i=!1,o=0;o<r.length;++o){var a=r[o];(a.from<e&&a.to>t||t==e&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,e),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,e,"ltr")}(m,e||0,null==n?d:n,(function(r,t,i,f){var p="ltr"==i,g=h(r,p?"left":"right"),b=h(t-1,p?"right":"left"),w=null==e&&0==r,k=null==n&&t==d,y=0==f,x=!m||f==m.length-1;if(b.top-g.top<=3){var C=(s?w:k)&&y?u:(p?g:b).left;c(C,g.top,((s?k:w)&&x?l:(p?b:g).right)-C,g.bottom)}else{var M,A,L,S;p?(M=s&&w&&y?u:g.left,A=s?l:v(r,i,"before"),L=s?u:v(t,i,"after"),S=s&&k&&x?l:b.right):(M=s?v(r,i,"before"):u,A=!s&&w&&y?l:g.right,L=!s&&k&&x?u:b.left,S=s?v(t,i,"after"):l),c(M,g.top,A-M,g.bottom),g.bottom<b.top&&c(u,g.bottom,null,b.top),c(L,b.top,S-L,b.bottom)}(!o||xn(g,o)<0)&&(o=g),xn(b,o)<0&&(o=b),(!a||xn(g,a)<0)&&(a=g),xn(b,a)<0&&(a=b)})),{start:o,end:a}}var d=t.from(),h=t.to();if(d.line==h.line)f(d.line,d.ch,h.ch);else{var v=Qr(i,d.line),m=Qr(i,h.line),p=Pt(v)==Pt(m),g=f(d.line,d.ch,p?v.text.length+1:null).end,b=f(h.line,p?0:null,h.ch).start;p&&(g.top<b.top-2?(c(g.right,g.top,null,g.bottom),c(u,b.top,b.left,b.bottom)):c(g.right,g.top,b.left-g.right,g.bottom)),g.bottom<b.top&&c(u,g.bottom,null,b.top)}e.appendChild(o)}function Mn(r){if(r.state.focused){var t=r.display;clearInterval(t.blinker);var e=!0;t.cursorDiv.style.visibility="",r.options.cursorBlinkRate>0?t.blinker=setInterval((function(){r.hasFocus()||Tn(r),t.cursorDiv.style.visibility=(e=!e)?"":"hidden"}),r.options.cursorBlinkRate):r.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function An(r){r.hasFocus()||(r.display.input.focus(),r.state.focused||Sn(r))}function Ln(r){r.state.delayingBlurEvent=!0,setTimeout((function(){r.state.delayingBlurEvent&&(r.state.delayingBlurEvent=!1,r.state.focused&&Tn(r))}),100)}function Sn(r,t){r.state.delayingBlurEvent&&!r.state.draggingText&&(r.state.delayingBlurEvent=!1),"nocursor"!=r.options.readOnly&&(r.state.focused||(gr(r,"focus",r,t),r.state.focused=!0,B(r.display.wrapper,"CodeMirror-focused"),r.curOp||r.display.selForContextMenu==r.doc.sel||(r.display.input.reset(),l&&setTimeout((function(){return r.display.input.reset(!0)}),20)),r.display.input.receivedFocus()),Mn(r))}function Tn(r,t){r.state.delayingBlurEvent||(r.state.focused&&(gr(r,"blur",r,t),r.state.focused=!1,S(r.display.wrapper,"CodeMirror-focused")),clearInterval(r.display.blinker),setTimeout((function(){r.state.focused||(r.display.shift=!1)}),150))}function Nn(r){for(var t=r.display,e=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var s=t.view[l],c=r.options.lineWrapping,f=void 0,d=0;if(!s.hidden){if(i+=s.line.height,a&&u<8){var h=s.node.offsetTop+s.node.offsetHeight;f=h-e,e=h}else{var v=s.node.getBoundingClientRect();f=v.bottom-v.top,!c&&s.text.firstChild&&(d=s.text.firstChild.getBoundingClientRect().right-v.left-1)}var m=s.line.height-f;if((m>.005||m<-.005)&&(i<n&&(o-=m),Xr(s.line,f),En(s.line),s.rest))for(var p=0;p<s.rest.length;p++)En(s.rest[p]);if(d>r.display.sizerWidth){var g=Math.ceil(d/un(r.display));g>r.display.maxLineLength&&(r.display.maxLineLength=g,r.display.maxLine=s.line,r.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function En(r){if(r.widgets)for(var t=0;t<r.widgets.length;++t){var e=r.widgets[t],n=e.node.parentNode;n&&(e.height=n.offsetHeight)}}function Dn(r,t,e){var n=e&&null!=e.top?Math.max(0,e.top):r.scroller.scrollTop;n=Math.floor(n-Ae(r));var i=e&&null!=e.bottom?e.bottom:n+r.wrapper.clientHeight,o=rt(t,n),a=rt(t,i);if(e&&e.ensure){var u=e.ensure.from.line,l=e.ensure.to.line;u<o?(o=u,a=rt(t,Ht(Qr(t,u))+r.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=rt(t,Ht(Qr(t,l))-r.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function zn(r,t){var e=r.display,n=an(r.display);t.top<0&&(t.top=0);var i=r.curOp&&null!=r.curOp.scrollTop?r.curOp.scrollTop:e.scroller.scrollTop,o=Ee(r),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var u=r.doc.height+Le(e),l=t.bottom>u-n;if(t.top<i)a.scrollTop=t.top<n?0:t.top;else if(t.bottom>i+o){var s=Math.min(t.top,(l?u:t.bottom)-o);s!=i&&(a.scrollTop=s)}var c=r.options.fixedGutter?0:e.gutters.offsetWidth,f=r.curOp&&null!=r.curOp.scrollLeft?r.curOp.scrollLeft:e.scroller.scrollLeft-c,d=Ne(r)-e.gutters.offsetWidth,h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left+c-(h?0:10)):t.right>d+f-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function jn(r,t){null!=t&&(Rn(r),r.curOp.scrollTop=(null==r.curOp.scrollTop?r.doc.scrollTop:r.curOp.scrollTop)+t)}function Bn(r){Rn(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function In(r,t,e){null==t&&null==e||Rn(r),null!=t&&(r.curOp.scrollLeft=t),null!=e&&(r.curOp.scrollTop=e)}function Rn(r){var t=r.curOp.scrollToPos;t&&(r.curOp.scrollToPos=null,Fn(r,Je(r,t.from),Je(r,t.to),t.margin))}function Fn(r,t,e,n){var i=zn(r,{left:Math.min(t.left,e.left),top:Math.min(t.top,e.top)-n,right:Math.max(t.right,e.right),bottom:Math.max(t.bottom,e.bottom)+n});In(r,i.scrollLeft,i.scrollTop)}function On(r,t){Math.abs(r.doc.scrollTop-t)<2||(e||di(r,{top:t}),Un(r,t,!0),e&&di(r),ai(r,100))}function Un(r,t,e){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t)),(r.display.scroller.scrollTop!=t||e)&&(r.doc.scrollTop=t,r.display.scrollbars.setScrollTop(t),r.display.scroller.scrollTop!=t&&(r.display.scroller.scrollTop=t))}function _n(r,t,e,n){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth)),(e?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!n||(r.doc.scrollLeft=t,mi(r),r.display.scroller.scrollLeft!=t&&(r.display.scroller.scrollLeft=t),r.display.scrollbars.setScrollLeft(t))}function Pn(r){var t=r.display,e=t.gutters.offsetWidth,n=Math.round(r.doc.height+Le(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?e:0,docHeight:n,scrollHeight:n+Te(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:e}}var qn=function(r,t,e){this.cm=e;var n=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,r(n),r(i),vr(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),vr(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&u<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qn.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1,e=r.scrollHeight>r.clientHeight+1,n=r.nativeBarWidth;return e?(this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0",this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+(r.viewHeight-(t?n:0)))+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),t?(this.horiz.style.display="block",this.horiz.style.right=e?n+"px":"0",this.horiz.style.left=r.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+(r.viewWidth-r.barLeft-(e?n:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&r.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:e?n:0,bottom:t?n:0}},qn.prototype.setScrollLeft=function(r){this.horiz.scrollLeft!=r&&(this.horiz.scrollLeft=r),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qn.prototype.setScrollTop=function(r){this.vert.scrollTop!=r&&(this.vert.scrollTop=r),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qn.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=w&&!v?"12px":"18px",this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new q,this.disableVert=new q},qn.prototype.enableZeroWidthBar=function(r,t,e){r.style.visibility="",t.set(1e3,(function n(){var i=r.getBoundingClientRect();("vert"==e?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=r?r.style.visibility="hidden":t.set(1e3,n)}))},qn.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz),r.removeChild(this.vert)};var Wn=function(){};function $n(r,t){t||(t=Pn(r));var e=r.display.barWidth,n=r.display.barHeight;Gn(r,t);for(var i=0;i<4&&e!=r.display.barWidth||n!=r.display.barHeight;i++)e!=r.display.barWidth&&r.options.lineWrapping&&Nn(r),Gn(r,Pn(r)),e=r.display.barWidth,n=r.display.barHeight}function Gn(r,t){var e=r.display,n=e.scrollbars.update(t);e.sizer.style.paddingRight=(e.barWidth=n.right)+"px",e.sizer.style.paddingBottom=(e.barHeight=n.bottom)+"px",e.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(e.scrollbarFiller.style.display="block",e.scrollbarFiller.style.height=n.bottom+"px",e.scrollbarFiller.style.width=n.right+"px"):e.scrollbarFiller.style.display="",n.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter?(e.gutterFiller.style.display="block",e.gutterFiller.style.height=n.bottom+"px",e.gutterFiller.style.width=t.gutterWidth+"px"):e.gutterFiller.style.display=""}Wn.prototype.update=function(){return{bottom:0,right:0}},Wn.prototype.setScrollLeft=function(){},Wn.prototype.setScrollTop=function(){},Wn.prototype.clear=function(){};var Hn={native:qn,null:Wn};function Kn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&S(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Hn[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller),vr(t,"mousedown",(function(){r.state.focused&&setTimeout((function(){return r.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,e){"horizontal"==e?_n(r,t):On(r,t)}),r),r.display.scrollbars.addClass&&B(r.display.wrapper,r.display.scrollbars.addClass)}var Vn=0;function Qn(r){var t;r.curOp={cm:r,viewChanged:!1,startHeight:r.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vn,markArrays:null},t=r.curOp,le?le.ops.push(t):t.ownsGroup=le={ops:[t],delayedCallbacks:[]}}function Jn(r){var t=r.curOp;t&&function(r,t){var e=r.ownsGroup;if(e)try{!function(r){var t=r.delayedCallbacks,e=0;do{for(;e<t.length;e++)t[e].call(null);for(var n=0;n<r.ops.length;n++){var i=r.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(e<t.length)}(e)}finally{le=null,t(e)}}(t,(function(r){for(var t=0;t<r.ops.length;t++)r.ops[t].cm.curOp=null;!function(r){for(var t=r.ops,e=0;e<t.length;e++)Yn(t[e]);for(var n=0;n<t.length;n++)Xn(t[n]);for(var i=0;i<t.length;i++)Zn(t[i]);for(var o=0;o<t.length;o++)ri(t[o]);for(var a=0;a<t.length;a++)ti(t[a])}(r)}))}function Yn(r){var t=r.cm,e=t.display;(function(r){var t=r.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Te(r)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Te(r)+"px",t.scrollbarsClipped=!0)})(t),r.updateMaxLine&&Vt(t),r.mustUpdate=r.viewChanged||r.forceUpdate||null!=r.scrollTop||r.scrollToPos&&(r.scrollToPos.from.line<e.viewFrom||r.scrollToPos.to.line>=e.viewTo)||e.maxLineChanged&&t.options.lineWrapping,r.update=r.mustUpdate&&new li(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function Xn(r){r.updatedDisplay=r.mustUpdate&&ci(r.cm,r.update)}function Zn(r){var t=r.cm,e=t.display;r.updatedDisplay&&Nn(t),r.barMeasure=Pn(t),e.maxLineChanged&&!t.options.lineWrapping&&(r.adjustWidthTo=ze(t,e.maxLine,e.maxLine.text.length).left+3,t.display.sizerWidth=r.adjustWidthTo,r.barMeasure.scrollWidth=Math.max(e.scroller.clientWidth,e.sizer.offsetLeft+r.adjustWidthTo+Te(t)+t.display.barWidth),r.maxScrollLeft=Math.max(0,e.sizer.offsetLeft+r.adjustWidthTo-Ne(t))),(r.updatedDisplay||r.selectionChanged)&&(r.preparedSelection=e.input.prepareSelection())}function ri(r){var t=r.cm;null!=r.adjustWidthTo&&(t.display.sizer.style.minWidth=r.adjustWidthTo+"px",r.maxScrollLeft<t.doc.scrollLeft&&_n(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),!0),t.display.maxLineChanged=!1);var e=r.focus&&r.focus==j(F(t));r.preparedSelection&&t.display.input.showSelection(r.preparedSelection,e),(r.updatedDisplay||r.startHeight!=t.doc.height)&&$n(t,r.barMeasure),r.updatedDisplay&&vi(t,r.barMeasure),r.selectionChanged&&Mn(t),t.state.focused&&r.updateInput&&t.display.input.reset(r.typing),e&&An(r.cm)}function ti(r){var t=r.cm,e=t.display,n=t.doc;r.updatedDisplay&&fi(t,r.update),null==e.wheelStartX||null==r.scrollTop&&null==r.scrollLeft&&!r.scrollToPos||(e.wheelStartX=e.wheelStartY=null),null!=r.scrollTop&&Un(t,r.scrollTop,r.forceScroll),null!=r.scrollLeft&&_n(t,r.scrollLeft,!0,!0),r.scrollToPos&&function(r,t){if(!br(r,"scrollCursorIntoView")){var e=r.display,n=e.sizer.getBoundingClientRect(),i=null,o=e.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var a=E("div","​",null,"position: absolute;\n top: "+(t.top-e.viewOffset-Ae(r.display))+"px;\n height: "+(t.bottom-t.top+Te(r)+e.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(a),a.scrollIntoView(i),r.display.lineSpace.removeChild(a)}}}(t,function(r,t,e,n){var i;null==n&&(n=0),r.options.lineWrapping||t!=e||(e="before"==t.sticky?nt(t.line,t.ch+1,"before"):t,t=t.ch?nt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,u=Qe(r,t),l=e&&e!=t?Qe(r,e):u,s=zn(r,i={left:Math.min(u.left,l.left),top:Math.min(u.top,l.top)-n,right:Math.max(u.left,l.left),bottom:Math.max(u.bottom,l.bottom)+n}),c=r.doc.scrollTop,f=r.doc.scrollLeft;if(null!=s.scrollTop&&(On(r,s.scrollTop),Math.abs(r.doc.scrollTop-c)>1&&(a=!0)),null!=s.scrollLeft&&(_n(r,s.scrollLeft),Math.abs(r.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,ct(n,r.scrollToPos.from),ct(n,r.scrollToPos.to),r.scrollToPos.margin));var i=r.maybeHiddenMarkers,o=r.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||gr(i[a],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&gr(o[u],"unhide");e.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),r.changeObjs&&gr(t,"changes",t,r.changeObjs),r.update&&r.update.finish()}function ei(r,t){if(r.curOp)return t();Qn(r);try{return t()}finally{Jn(r)}}function ni(r,t){return function(){if(r.curOp)return t.apply(r,arguments);Qn(r);try{return t.apply(r,arguments)}finally{Jn(r)}}}function ii(r){return function(){if(this.curOp)return r.apply(this,arguments);Qn(this);try{return r.apply(this,arguments)}finally{Jn(this)}}}function oi(r){return function(){var t=this.cm;if(!t||t.curOp)return r.apply(this,arguments);Qn(t);try{return r.apply(this,arguments)}finally{Jn(t)}}}function ai(r,t){r.doc.highlightFrontier<r.display.viewTo&&r.state.highlight.set(t,U(ui,r))}function ui(r){var t=r.doc;if(!(t.highlightFrontier>=r.display.viewTo)){var e=+new Date+r.options.workTime,n=pt(r,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(n.line>=r.display.viewFrom){var a=o.styles,u=o.text.length>r.options.maxHighlightLength?Gr(t.mode,n.state):null,l=vt(r,o,n,!0);u&&(n.state=u),o.styles=l.styles;var s=o.styleClasses,c=l.classes;c?o.styleClasses=c:s&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||s!=c&&(!s||!c||s.bgClass!=c.bgClass||s.textClass!=c.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=o.styles[d];f&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=r.options.maxHighlightLength&&gt(r,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>e)return ai(r,r.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ei(r,(function(){for(var t=0;t<i.length;t++)mn(r,i[t],"text")}))}}var li=function(r,t,e){var n=r.display;this.viewport=t,this.visible=Dn(n,r.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ne(r),this.force=e,this.dims=ln(r),this.events=[]};function si(r){if(r.hasFocus())return null;var t=j(F(r));if(!t||!z(r.display.lineDiv,t))return null;var e={activeElt:t};if(window.getSelection){var n=O(r).getSelection();n.anchorNode&&n.extend&&z(r.display.lineDiv,n.anchorNode)&&(e.anchorNode=n.anchorNode,e.anchorOffset=n.anchorOffset,e.focusNode=n.focusNode,e.focusOffset=n.focusOffset)}return e}function ci(r,t){var e=r.display,n=r.doc;if(t.editorIsHidden)return pn(r),!1;if(!t.force&&t.visible.from>=e.viewFrom&&t.visible.to<=e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>=e.viewTo)&&e.renderedView==e.view&&0==bn(r))return!1;pi(r)&&(pn(r),t.dims=ln(r));var i=n.first+n.size,o=Math.max(t.visible.from-r.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+r.options.viewportMargin);e.viewFrom<o&&o-e.viewFrom<20&&(o=Math.max(n.first,e.viewFrom)),e.viewTo>a&&e.viewTo-a<20&&(a=Math.min(i,e.viewTo)),At&&(o=qt(r.doc,o),a=Wt(r.doc,a));var u=o!=e.viewFrom||a!=e.viewTo||e.lastWrapHeight!=t.wrapperHeight||e.lastWrapWidth!=t.wrapperWidth;(function(r,t,e){var n=r.display;0==n.view.length||t>=n.viewTo||e<=n.viewFrom?(n.view=ue(r,t,e),n.viewFrom=t):(n.viewFrom>t?n.view=ue(r,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(hn(r,t))),n.viewFrom=t,n.viewTo<e?n.view=n.view.concat(ue(r,n.viewTo,e)):n.viewTo>e&&(n.view=n.view.slice(0,hn(r,e)))),n.viewTo=e})(r,o,a),e.viewOffset=Ht(Qr(r.doc,e.viewFrom)),r.display.mover.style.top=e.viewOffset+"px";var s=bn(r);if(!u&&0==s&&!t.force&&e.renderedView==e.view&&(null==e.updateLineNumbers||e.updateLineNumbers>=e.viewTo))return!1;var c=si(r);return s>4&&(e.lineDiv.style.display="none"),function(r,t,e){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function u(t){var e=t.nextSibling;return l&&w&&r.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),e}for(var s=n.view,c=n.viewFrom,f=0;f<s.length;f++){var d=s[f];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=u(a);var h=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(W(d.changes,"gutter")>-1&&(h=!1),de(r,d,c,e)),h&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(et(r.options,c)))),a=d.node.nextSibling}else{var v=we(r,d,c,e);o.insertBefore(v,a)}c+=d.size}for(;a;)a=u(a)}(r,e.updateLineNumbers,t.dims),s>4&&(e.lineDiv.style.display=""),e.renderedView=e.view,function(r){if(r&&r.activeElt&&r.activeElt!=j(r.activeElt.ownerDocument)&&(r.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&z(document.body,r.anchorNode)&&z(document.body,r.focusNode))){var t=r.activeElt.ownerDocument,e=t.defaultView.getSelection(),n=t.createRange();n.setEnd(r.anchorNode,r.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(r.focusNode,r.focusOffset)}}(c),T(e.cursorDiv),T(e.selectionDiv),e.gutters.style.height=e.sizer.style.minHeight=0,u&&(e.lastWrapHeight=t.wrapperHeight,e.lastWrapWidth=t.wrapperWidth,ai(r,400)),e.updateLineNumbers=null,!0}function fi(r,t){for(var e=t.viewport,n=!0;;n=!1){if(n&&r.options.lineWrapping&&t.oldDisplayWidth!=Ne(r))n&&(t.visible=Dn(r.display,r.doc,e));else if(e&&null!=e.top&&(e={top:Math.min(r.doc.height+Le(r.display)-Ee(r),e.top)}),t.visible=Dn(r.display,r.doc,e),t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo)break;if(!ci(r,t))break;Nn(r);var i=Pn(r);wn(r),$n(r,i),vi(r,i),t.force=!1}t.signal(r,"update",r),r.display.viewFrom==r.display.reportedViewFrom&&r.display.viewTo==r.display.reportedViewTo||(t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo),r.display.reportedViewFrom=r.display.viewFrom,r.display.reportedViewTo=r.display.viewTo)}function di(r,t){var e=new li(r,t);if(ci(r,e)){Nn(r),fi(r,e);var n=Pn(r);wn(r),$n(r,n),vi(r,n),e.finish()}}function hi(r){r.sizer.style.marginLeft=r.gutters.offsetWidth+"px",ce(r,"gutterChanged",r)}function vi(r,t){r.display.sizer.style.minHeight=t.docHeight+"px",r.display.heightForcer.style.top=t.docHeight+"px",r.display.gutters.style.height=t.docHeight+r.display.barHeight+Te(r)+"px"}function mi(r){var t=r.display,e=t.view;if(t.alignWidgets||t.gutters.firstChild&&r.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+r.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<e.length;a++)if(!e[a].hidden){r.options.fixedGutter&&(e[a].gutter&&(e[a].gutter.style.left=o),e[a].gutterBackground&&(e[a].gutterBackground.style.left=o));var u=e[a].alignable;if(u)for(var l=0;l<u.length;l++)u[l].style.left=o}r.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function pi(r){if(!r.options.lineNumbers)return!1;var t=r.doc,e=et(r.options,t.first+t.size-1),n=r.display;if(e.length!=n.lineNumChars){var i=n.measure.appendChild(E("div",[E("div",e)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?e.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",hi(r.display),!0}return!1}function gi(r,t){for(var e=[],n=!1,i=0;i<r.length;i++){var o=r[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}e.push({className:o,style:a})}return t&&!n&&e.push({className:"CodeMirror-linenumbers",style:null}),e}function bi(r){var t=r.gutters,e=r.gutterSpecs;T(t),r.lineGutter=null;for(var n=0;n<e.length;++n){var i=e[n],o=i.className,a=i.style,u=t.appendChild(E("div",null,"CodeMirror-gutter "+o));a&&(u.style.cssText=a),"CodeMirror-linenumbers"==o&&(r.lineGutter=u,u.style.width=(r.lineNumWidth||1)+"px")}t.style.display=e.length?"":"none",hi(r)}function wi(r){bi(r.display),vn(r),mi(r)}function ki(r,t,n,i){var o=this;this.input=n,o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=E("div",null,"CodeMirror-cursors"),o.measure=E("div",null,"CodeMirror-measure"),o.lineMeasure=E("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var s=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[s],null,"position: relative"),o.sizer=E("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=E("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=E("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),c&&f>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&u<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||e&&b||(o.scroller.draggable=!0),r&&(r.appendChild?r.appendChild(o.wrapper):r(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=gi(i.gutters,i.lineNumbers),bi(o),n.init(o)}li.prototype.signal=function(r,t){kr(r,t)&&this.events.push(arguments)},li.prototype.finish=function(){for(var r=0;r<this.events.length;r++)gr.apply(null,this.events[r])};var yi=0,xi=null;function Ci(r){var t=r.wheelDeltaX,e=r.wheelDeltaY;return null==t&&r.detail&&r.axis==r.HORIZONTAL_AXIS&&(t=r.detail),null==e&&r.detail&&r.axis==r.VERTICAL_AXIS?e=r.detail:null==e&&(e=r.wheelDelta),{x:t,y:e}}function Mi(r){var t=Ci(r);return t.x*=xi,t.y*=xi,t}function Ai(r,t){c&&102==f&&(null==r.display.chromeScrollHack?r.display.sizer.style.pointerEvents="none":clearTimeout(r.display.chromeScrollHack),r.display.chromeScrollHack=setTimeout((function(){r.display.chromeScrollHack=null,r.display.sizer.style.pointerEvents=""}),100));var n=Ci(t),i=n.x,o=n.y,a=xi;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var u=r.display,s=u.scroller,h=s.scrollHeight>s.clientHeight;if(i&&s.scrollWidth>s.clientWidth||o&&h){if(o&&w&&l)r:for(var v=t.target,m=u.view;v!=s;v=v.parentNode)for(var p=0;p<m.length;p++)if(m[p].node==v){r.display.currentWheelTarget=v;break r}if(i&&!e&&!d&&null!=a)return o&&h&&On(r,Math.max(0,s.scrollTop+o*a)),_n(r,Math.max(0,s.scrollLeft+i*a)),(!o||o&&h)&&xr(t),void(u.wheelStartX=null);if(o&&null!=a){var g=o*a,b=r.doc.scrollTop,k=b+u.wrapper.clientHeight;g<0?b=Math.max(0,b+g-50):k=Math.min(r.doc.height,k+g+50),di(r,{top:b,bottom:k})}yi<20&&0!==t.deltaMode&&(null==u.wheelStartX?(u.wheelStartX=s.scrollLeft,u.wheelStartY=s.scrollTop,u.wheelDX=i,u.wheelDY=o,setTimeout((function(){if(null!=u.wheelStartX){var r=s.scrollLeft-u.wheelStartX,t=s.scrollTop-u.wheelStartY,e=t&&u.wheelDY&&t/u.wheelDY||r&&u.wheelDX&&r/u.wheelDX;u.wheelStartX=u.wheelStartY=null,e&&(xi=(xi*yi+e)/(yi+1),++yi)}}),200)):(u.wheelDX+=i,u.wheelDY+=o))}}a?xi=-.53:e?xi=15:c?xi=-.7:h&&(xi=-1/3);var Li=function(r,t){this.ranges=r,this.primIndex=t};Li.prototype.primary=function(){return this.ranges[this.primIndex]},Li.prototype.equals=function(r){if(r==this)return!0;if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var e=this.ranges[t],n=r.ranges[t];if(!ot(e.anchor,n.anchor)||!ot(e.head,n.head))return!1}return!0},Li.prototype.deepCopy=function(){for(var r=[],t=0;t<this.ranges.length;t++)r[t]=new Si(at(this.ranges[t].anchor),at(this.ranges[t].head));return new Li(r,this.primIndex)},Li.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++)if(!this.ranges[r].empty())return!0;return!1},Li.prototype.contains=function(r,t){t||(t=r);for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e];if(it(t,n.from())>=0&&it(r,n.to())<=0)return e}return-1};var Si=function(r,t){this.anchor=r,this.head=t};function Ti(r,t,e){var n=r&&r.options.selectionsMayTouch,i=t[e];t.sort((function(r,t){return it(r.from(),t.from())})),e=W(t,i);for(var o=1;o<t.length;o++){var a=t[o],u=t[o-1],l=it(u.to(),a.from());if(n&&!a.empty()?l>0:l>=0){var s=lt(u.from(),a.from()),c=ut(u.to(),a.to()),f=u.empty()?a.from()==a.head:u.from()==u.head;o<=e&&--e,t.splice(--o,2,new Si(f?c:s,f?s:c))}}return new Li(t,e)}function Ni(r,t){return new Li([new Si(r,t||r)],0)}function Ei(r){return r.text?nt(r.from.line+r.text.length-1,Y(r.text).length+(1==r.text.length?r.from.ch:0)):r.to}function Di(r,t){if(it(r,t.from)<0)return r;if(it(r,t.to)<=0)return Ei(t);var e=r.line+t.text.length-(t.to.line-t.from.line)-1,n=r.ch;return r.line==t.to.line&&(n+=Ei(t).ch-t.to.ch),nt(e,n)}function zi(r,t){for(var e=[],n=0;n<r.sel.ranges.length;n++){var i=r.sel.ranges[n];e.push(new Si(Di(i.anchor,t),Di(i.head,t)))}return Ti(r.cm,e,r.sel.primIndex)}function ji(r,t,e){return r.line==t.line?nt(e.line,r.ch-t.ch+e.ch):nt(e.line+(r.line-t.line),r.ch)}function Bi(r){r.doc.mode=qr(r.options,r.doc.modeOption),Ii(r)}function Ii(r){r.doc.iter((function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)})),r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first,ai(r,100),r.state.modeGen++,r.curOp&&vn(r)}function Ri(r,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function Fi(r,t,e,n){function i(r){return e?e[r]:null}function o(r,e,i){(function(r,t,e,n){r.text=t,r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null),null!=r.order&&(r.order=null),Dt(r),zt(r,e);var i=n?n(r):1;i!=r.height&&Xr(r,i)})(r,e,i,n),ce(r,"change",r,t)}function a(r,t){for(var e=[],o=r;o<t;++o)e.push(new Qt(s[o],i(o),n));return e}var u=t.from,l=t.to,s=t.text,c=Qr(r,u.line),f=Qr(r,l.line),d=Y(s),h=i(s.length-1),v=l.line-u.line;if(t.full)r.insert(0,a(0,s.length)),r.remove(s.length,r.size-s.length);else if(Ri(r,t)){var m=a(0,s.length-1);o(f,f.text,h),v&&r.remove(u.line,v),m.length&&r.insert(u.line,m)}else if(c==f)if(1==s.length)o(c,c.text.slice(0,u.ch)+d+c.text.slice(l.ch),h);else{var p=a(1,s.length-1);p.push(new Qt(d+c.text.slice(l.ch),h,n)),o(c,c.text.slice(0,u.ch)+s[0],i(0)),r.insert(u.line+1,p)}else if(1==s.length)o(c,c.text.slice(0,u.ch)+s[0]+f.text.slice(l.ch),i(0)),r.remove(u.line+1,v);else{o(c,c.text.slice(0,u.ch)+s[0],i(0)),o(f,d+f.text.slice(l.ch),h);var g=a(1,s.length-1);v>1&&r.remove(u.line+1,v-1),r.insert(u.line+1,g)}ce(r,"change",r,t)}function Oi(r,t,e){!function r(n,i,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var u=n.linked[a];if(u.doc!=i){var l=o&&u.sharedHist;e&&!l||(t(u.doc,l),r(u.doc,n,l))}}}(r,null,!0)}function Ui(r,t){if(t.cm)throw new Error("This document is already in use.");r.doc=t,t.cm=r,fn(r),Bi(r),_i(r),r.options.direction=t.direction,r.options.lineWrapping||Vt(r),r.options.mode=t.modeOption,vn(r)}function _i(r){("rtl"==r.doc.direction?B:S)(r.display.lineDiv,"CodeMirror-rtl")}function Pi(r){this.done=[],this.undone=[],this.undoDepth=r?r.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=r?r.maxGeneration:1}function qi(r,t){var e={from:at(t.from),to:Ei(t),text:Jr(r,t.from,t.to)};return Ki(r,e,t.from.line,t.to.line+1),Oi(r,(function(r){return Ki(r,e,t.from.line,t.to.line+1)}),!0),e}function Wi(r){for(;r.length&&Y(r).ranges;)r.pop()}function $i(r,t,e,n){var i=r.history;i.undone.length=0;var o,a,u=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>u-(r.cm?r.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(r,t){return t?(Wi(r.done),Y(r.done)):r.done.length&&!Y(r.done).ranges?Y(r.done):r.done.length>1&&!r.done[r.done.length-2].ranges?(r.done.pop(),Y(r.done)):void 0}(i,i.lastOp==n)))a=Y(o.changes),0==it(t.from,t.to)&&0==it(t.from,a.to)?a.to=Ei(t):o.changes.push(qi(r,t));else{var l=Y(i.done);for(l&&l.ranges||Hi(r.sel,i.done),o={changes:[qi(r,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(e),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=u,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||gr(r,"historyAdded")}function Gi(r,t,e,n){var i=r.history,o=n&&n.origin;e==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(r,t,e,n){var i=t.charAt(0);return"*"==i||"+"==i&&e.ranges.length==n.ranges.length&&e.somethingSelected()==n.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}(r,o,Y(i.done),t))?i.done[i.done.length-1]=t:Hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=e,n&&!1!==n.clearRedo&&Wi(i.undone)}function Hi(r,t){var e=Y(t);e&&e.ranges&&e.equals(r)||t.push(r)}function Ki(r,t,e,n){var i=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,e),Math.min(r.first+r.size,n),(function(e){e.markedSpans&&((i||(i=t["spans_"+r.id]={}))[o]=e.markedSpans),++o}))}function Vi(r){if(!r)return null;for(var t,e=0;e<r.length;++e)r[e].marker.explicitlyCleared?t||(t=r.slice(0,e)):t&&t.push(r[e]);return t?t.length?t:null:r}function Qi(r,t){var e=function(r,t){var e=t["spans_"+r.id];if(!e)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Vi(e[i]));return n}(r,t),n=Nt(r,t);if(!e)return n;if(!n)return e;for(var i=0;i<e.length;++i){var o=e[i],a=n[i];if(o&&a)r:for(var u=0;u<a.length;++u){for(var l=a[u],s=0;s<o.length;++s)if(o[s].marker==l.marker)continue r;o.push(l)}else a&&(e[i]=a)}return e}function Ji(r,t,e){for(var n=[],i=0;i<r.length;++i){var o=r[i];if(o.ranges)n.push(e?Li.prototype.deepCopy.call(o):o);else{var a=o.changes,u=[];n.push({changes:u});for(var l=0;l<a.length;++l){var s=a[l],c=void 0;if(u.push({from:s.from,to:s.to,text:s.text}),t)for(var f in s)(c=f.match(/^spans_(\d+)$/))&&W(t,Number(c[1]))>-1&&(Y(u)[f]=s[f],delete s[f])}}}return n}function Yi(r,t,e,n){if(n){var i=r.anchor;if(e){var o=it(t,i)<0;o!=it(e,i)<0?(i=t,t=e):o!=it(t,e)<0&&(t=e)}return new Si(i,t)}return new Si(e||t,t)}function Xi(r,t,e,n,i){null==i&&(i=r.cm&&(r.cm.display.shift||r.extend)),no(r,new Li([Yi(r.sel.primary(),t,e,i)],0),n)}function Zi(r,t,e){for(var n=[],i=r.cm&&(r.cm.display.shift||r.extend),o=0;o<r.sel.ranges.length;o++)n[o]=Yi(r.sel.ranges[o],t[o],null,i);no(r,Ti(r.cm,n,r.sel.primIndex),e)}function ro(r,t,e,n){var i=r.sel.ranges.slice(0);i[t]=e,no(r,Ti(r.cm,i,r.sel.primIndex),n)}function to(r,t,e,n){no(r,Ni(t,e),n)}function eo(r,t,e){var n=r.history.done,i=Y(n);i&&i.ranges?(n[n.length-1]=t,io(r,t,e)):no(r,t,e)}function no(r,t,e){io(r,t,e),Gi(r,r.sel,r.cm?r.cm.curOp.id:NaN,e)}function io(r,t,e){(kr(r,"beforeSelectionChange")||r.cm&&kr(r.cm,"beforeSelectionChange"))&&(t=function(r,t,e){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var e=0;e<t.length;e++)this.ranges[e]=new Si(ct(r,t[e].anchor),ct(r,t[e].head))},origin:e&&e.origin};return gr(r,"beforeSelectionChange",r,n),r.cm&&gr(r.cm,"beforeSelectionChange",r.cm,n),n.ranges!=t.ranges?Ti(r.cm,n.ranges,n.ranges.length-1):t}(r,t,e));var n=e&&e.bias||(it(t.primary().head,r.sel.primary().head)<0?-1:1);oo(r,uo(r,t,n,!0)),e&&!1===e.scroll||!r.cm||"nocursor"==r.cm.getOption("readOnly")||Bn(r.cm)}function oo(r,t){t.equals(r.sel)||(r.sel=t,r.cm&&(r.cm.curOp.updateInput=1,r.cm.curOp.selectionChanged=!0,wr(r.cm)),ce(r,"cursorActivity",r))}function ao(r){oo(r,uo(r,r.sel,null,!1))}function uo(r,t,e,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],u=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o],l=so(r,a.anchor,u&&u.anchor,e,n),s=a.head==a.anchor?l:so(r,a.head,u&&u.head,e,n);(i||l!=a.anchor||s!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(l,s))}return i?Ti(r.cm,i,t.primIndex):t}function lo(r,t,e,n,i){var o=Qr(r,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var u=o.markedSpans[a],l=u.marker,s="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==u.from||(s?u.from<=t.ch:u.from<t.ch))&&(null==u.to||(c?u.to>=t.ch:u.to>t.ch))){if(i&&(gr(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(e){var f=l.find(n<0?1:-1),d=void 0;if((n<0?c:s)&&(f=co(r,f,-n,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(d=it(f,e))&&(n<0?d<0:d>0))return lo(r,f,t,n,i)}var h=l.find(n<0?-1:1);return(n<0?s:c)&&(h=co(r,h,n,h.line==t.line?o:null)),h?lo(r,h,t,n,i):null}}return t}function so(r,t,e,n,i){var o=n||1;return lo(r,t,e,o,i)||!i&&lo(r,t,e,o,!0)||lo(r,t,e,-o,i)||!i&&lo(r,t,e,-o,!0)||(r.cantEdit=!0,nt(r.first,0))}function co(r,t,e,n){return e<0&&0==t.ch?t.line>r.first?ct(r,nt(t.line-1)):null:e>0&&t.ch==(n||Qr(r,t.line)).text.length?t.line<r.first+r.size-1?nt(t.line+1,0):null:new nt(t.line,t.ch+e)}function fo(r){r.setSelection(nt(r.firstLine(),0),nt(r.lastLine()),G)}function ho(r,t,e){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return e&&(n.update=function(t,e,i,o){t&&(n.from=ct(r,t)),e&&(n.to=ct(r,e)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),gr(r,"beforeChange",r,n),r.cm&&gr(r.cm,"beforeChange",r.cm,n),n.canceled?(r.cm&&(r.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function vo(r,t,e){if(r.cm){if(!r.cm.curOp)return ni(r.cm,vo)(r,t,e);if(r.cm.state.suppressEdits)return}if(!(kr(r,"beforeChange")||r.cm&&kr(r.cm,"beforeChange"))||(t=ho(r,t,!0))){var n=Mt&&!e&&function(r,t,e){var n=null;if(r.iter(t.line,e.line+1,(function(r){if(r.markedSpans)for(var t=0;t<r.markedSpans.length;++t){var e=r.markedSpans[t].marker;!e.readOnly||n&&-1!=W(n,e)||(n||(n=[])).push(e)}})),!n)return null;for(var i=[{from:t,to:e}],o=0;o<n.length;++o)for(var a=n[o],u=a.find(0),l=0;l<i.length;++l){var s=i[l];if(!(it(s.to,u.from)<0||it(s.from,u.to)>0)){var c=[l,1],f=it(s.from,u.from),d=it(s.to,u.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:s.from,to:u.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:u.to,to:s.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(r,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)mo(r,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else mo(r,t)}}function mo(r,t){if(1!=t.text.length||""!=t.text[0]||0!=it(t.from,t.to)){var e=zi(r,t);$i(r,t,e,r.cm?r.cm.curOp.id:NaN),bo(r,t,e,Nt(r,t));var n=[];Oi(r,(function(r,e){e||-1!=W(n,r.history)||(xo(r.history,t),n.push(r.history)),bo(r,t,null,Nt(r,t))}))}}function po(r,t,e){var n=r.cm&&r.cm.state.suppressEdits;if(!n||e){for(var i,o=r.history,a=r.sel,u="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,s=0;s<u.length&&(i=u[s],e?!i.ranges||i.equals(r.sel):i.ranges);s++);if(s!=u.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=u.pop()).ranges){if(n)return void u.push(i);break}if(Hi(i,l),e&&!i.equals(r.sel))return void no(r,i,{clearRedo:!1});a=i}var c=[];Hi(a,l),l.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=kr(r,"beforeChange")||r.cm&&kr(r.cm,"beforeChange"),d=function(e){var n=i.changes[e];if(n.origin=t,f&&!ho(r,n,!1))return u.length=0,{};c.push(qi(r,n));var o=e?zi(r,n):Y(u);bo(r,n,o,Qi(r,n)),!e&&r.cm&&r.cm.scrollIntoView({from:n.from,to:Ei(n)});var a=[];Oi(r,(function(r,t){t||-1!=W(a,r.history)||(xo(r.history,n),a.push(r.history)),bo(r,n,null,Qi(r,n))}))},h=i.changes.length-1;h>=0;--h){var v=d(h);if(v)return v.v}}}}function go(r,t){if(0!=t&&(r.first+=t,r.sel=new Li(X(r.sel.ranges,(function(r){return new Si(nt(r.anchor.line+t,r.anchor.ch),nt(r.head.line+t,r.head.ch))})),r.sel.primIndex),r.cm)){vn(r.cm,r.first,r.first-t,t);for(var e=r.cm.display,n=e.viewFrom;n<e.viewTo;n++)mn(r.cm,n,"gutter")}}function bo(r,t,e,n){if(r.cm&&!r.cm.curOp)return ni(r.cm,bo)(r,t,e,n);if(t.to.line<r.first)go(r,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>r.lastLine())){if(t.from.line<r.first){var i=t.text.length-1-(r.first-t.from.line);go(r,i),t={from:nt(r.first,0),to:nt(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=r.lastLine();t.to.line>o&&(t={from:t.from,to:nt(o,Qr(r,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(r,t.from,t.to),e||(e=zi(r,t)),r.cm?function(r,t,e){var n=r.doc,i=r.display,o=t.from,a=t.to,u=!1,l=o.line;r.options.lineWrapping||(l=Zr(Pt(Qr(n,o.line))),n.iter(l,a.line+1,(function(r){if(r==i.maxLine)return u=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&wr(r),Fi(n,t,e,cn(r)),r.options.lineWrapping||(n.iter(l,o.line+t.text.length,(function(r){var t=Kt(r);t>i.maxLineLength&&(i.maxLine=r,i.maxLineLength=t,i.maxLineChanged=!0,u=!1)})),u&&(r.curOp.updateMaxLine=!0)),function(r,t){if(r.modeFrontier=Math.min(r.modeFrontier,t),!(r.highlightFrontier<t-10)){for(var e=r.first,n=t-1;n>e;n--){var i=Qr(r,n).stateAfter;if(i&&(!(i instanceof dt)||n+i.lookAhead<t)){e=n+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,e)}}(n,o.line),ai(r,400);var s=t.text.length-(a.line-o.line)-1;t.full?vn(r):o.line!=a.line||1!=t.text.length||Ri(r.doc,t)?vn(r,o.line,a.line+1,s):mn(r,o.line,"text");var c=kr(r,"changes"),f=kr(r,"change");if(f||c){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&ce(r,"change",r,d),c&&(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(d)}r.display.selForContextMenu=null}(r.cm,t,n):Fi(r,t,n),io(r,e,G),r.cantEdit&&so(r,nt(r.firstLine(),0))&&(r.cantEdit=!1)}}function wo(r,t,e,n,i){var o;n||(n=e),it(n,e)<0&&(e=(o=[n,e])[0],n=o[1]),"string"==typeof t&&(t=r.splitLines(t)),vo(r,{from:e,to:n,text:t,origin:i})}function ko(r,t,e,n){e<r.line?r.line+=n:t<r.line&&(r.line=t,r.ch=0)}function yo(r,t,e,n){for(var i=0;i<r.length;++i){var o=r[i],a=!0;if(o.ranges){o.copied||((o=r[i]=o.deepCopy()).copied=!0);for(var u=0;u<o.ranges.length;u++)ko(o.ranges[u].anchor,t,e,n),ko(o.ranges[u].head,t,e,n)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(e<s.from.line)s.from=nt(s.from.line+n,s.from.ch),s.to=nt(s.to.line+n,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(r.splice(0,i+1),i=0)}}}function xo(r,t){var e=t.from.line,n=t.to.line,i=t.text.length-(n-e)-1;yo(r.done,e,n,i),yo(r.undone,e,n,i)}function Co(r,t,e,n){var i=t,o=t;return"number"==typeof t?o=Qr(r,st(r,t)):i=Zr(t),null==i?null:(n(o,i)&&r.cm&&mn(r.cm,i,e),o)}function Mo(r){this.lines=r,this.parent=null;for(var t=0,e=0;e<r.length;++e)r[e].parent=this,t+=r[e].height;this.height=t}function Ao(r){this.children=r;for(var t=0,e=0,n=0;n<r.length;++n){var i=r[n];t+=i.chunkSize(),e+=i.height,i.parent=this}this.size=t,this.height=e,this.parent=null}Si.prototype.from=function(){return lt(this.anchor,this.head)},Si.prototype.to=function(){return ut(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var e=r,n=r+t;e<n;++e){var i=this.lines[e];this.height-=i.height,Jt(i),ce(i,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,e){this.height+=e,this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(r,t,e){for(var n=r+t;r<n;++r)if(e(this.lines[r]))return!0}},Ao.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var e=0;e<this.children.length;++e){var n=this.children[e],i=n.chunkSize();if(r<i){var o=Math.min(t,i-r),a=n.height;if(n.removeInner(r,o),this.height-=a-n.height,i==o&&(this.children.splice(e--,1),n.parent=null),0==(t-=o))break;r=0}else r-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var u=[];this.collapse(u),this.children=[new Mo(u)],this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t)this.children[t].collapse(r)},insertInner:function(r,t,e){this.size+=t.length,this.height+=e;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(r<=o){if(i.insertInner(r,t,e),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,u=a;u<i.lines.length;){var l=new Mo(i.lines.slice(u,u+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var r=this;do{var t=new Ao(r.children.splice(r.children.length-5,5));if(r.parent){r.size-=t.size,r.height-=t.height;var e=W(r.parent.children,r);r.parent.children.splice(e+1,0,t)}else{var n=new Ao(r.children);n.parent=r,r.children=[n,t],r=n}t.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()}},iterN:function(r,t,e){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(r<o){var a=Math.min(t,o-r);if(i.iterN(r,a,e))return!0;if(0==(t-=a))break;r=0}else r-=o}}};var Lo=function(r,t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&(this[n]=e[n]);this.doc=r,this.node=t};function So(r,t,e){Ht(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)&&jn(r,e)}Lo.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,e=this.line,n=Zr(e);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(e.widgets=null);var o=Ce(this);Xr(e,Math.max(0,e.height-o)),r&&(ei(r,(function(){So(r,e,-o),mn(r,n,"widget")})),ce(r,"lineWidgetCleared",r,this,n))}},Lo.prototype.changed=function(){var r=this,t=this.height,e=this.doc.cm,n=this.line;this.height=null;var i=Ce(this)-t;i&&($t(this.doc,n)||Xr(n,n.height+i),e&&ei(e,(function(){e.curOp.forceUpdate=!0,So(e,n,i),ce(e,"lineWidgetChanged",e,r,Zr(n))})))},yr(Lo);var To=0,No=function(r,t){this.lines=[],this.type=t,this.doc=r,this.id=++To};function Eo(r,t,e,n,i){if(n&&n.shared)return function(r,t,e,n,i){(n=_(n)).shared=!1;var o=[Eo(r,t,e,n,i)],a=o[0],u=n.widgetNode;return Oi(r,(function(r){u&&(n.widgetNode=u.cloneNode(!0)),o.push(Eo(r,ct(r,t),ct(r,e),n,i));for(var l=0;l<r.linked.length;++l)if(r.linked[l].isParent)return;a=Y(o)})),new Do(o,a)}(r,t,e,n,i);if(r.cm&&!r.cm.curOp)return ni(r.cm,Eo)(r,t,e,n,i);var o=new No(r,i),a=it(t,e);if(n&&_(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(_t(r,t.line,t,e,o)||t.line!=e.line&&_t(r,e.line,t,e,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At=!0}o.addToHistory&&$i(r,{from:t,to:e,origin:"markText"},r.sel,NaN);var u,l=t.line,s=r.cm;if(r.iter(l,e.line+1,(function(n){s&&o.collapsed&&!s.options.lineWrapping&&Pt(n)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&Xr(n,0),function(r,t,e){var n=e&&window.WeakSet&&(e.markedSpans||(e.markedSpans=new WeakSet));n&&r.markedSpans&&n.has(r.markedSpans)?r.markedSpans.push(t):(r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t],n&&n.add(r.markedSpans)),t.marker.attachLine(r)}(n,new Lt(o,l==t.line?t.ch:null,l==e.line?e.ch:null),r.cm&&r.cm.curOp),++l})),o.collapsed&&r.iter(t.line,e.line+1,(function(t){$t(r,t)&&Xr(t,0)})),o.clearOnEnter&&vr(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Mt=!0,(r.history.done.length||r.history.undone.length)&&r.clearHistory()),o.collapsed&&(o.id=++To,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)vn(s,t.line,e.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=e.line;c++)mn(s,c,"text");o.atomic&&ao(s.doc),ce(s,"markerAdded",s,o)}return o}No.prototype.clear=function(){if(!this.explicitlyCleared){var r=this.doc.cm,t=r&&!r.curOp;if(t&&Qn(r),kr(this,"clear")){var e=this.find();e&&ce(this,"clear",e.from,e.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],u=St(a.markedSpans,this);r&&!this.collapsed?mn(r,Zr(a),"text"):r&&(null!=u.to&&(i=Zr(a)),null!=u.from&&(n=Zr(a))),a.markedSpans=Tt(a.markedSpans,u),null==u.from&&this.collapsed&&!$t(this.doc,a)&&r&&Xr(a,an(r.display))}if(r&&this.collapsed&&!r.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var s=Pt(this.lines[l]),c=Kt(s);c>r.display.maxLineLength&&(r.display.maxLine=s,r.display.maxLineLength=c,r.display.maxLineChanged=!0)}null!=n&&r&&this.collapsed&&vn(r,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,r&&ao(r.doc)),r&&ce(r,"markerCleared",r,this,n,i),t&&Jn(r),this.parent&&this.parent.clear()}},No.prototype.find=function(r,t){var e,n;null==r&&"bookmark"==this.type&&(r=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=St(o.markedSpans,this);if(null!=a.from&&(e=nt(t?o:Zr(o),a.from),-1==r))return e;if(null!=a.to&&(n=nt(t?o:Zr(o),a.to),1==r))return n}return e&&{from:e,to:n}},No.prototype.changed=function(){var r=this,t=this.find(-1,!0),e=this,n=this.doc.cm;t&&n&&ei(n,(function(){var i=t.line,o=Zr(t.line),a=je(n,o);if(a&&(_e(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!$t(e.doc,i)&&null!=e.height){var u=e.height;e.height=null;var l=Ce(e)-u;l&&Xr(i,i.height+l)}ce(n,"markerChanged",n,r)}))},No.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(r)},No.prototype.detachLine=function(r){if(this.lines.splice(W(this.lines,r),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},yr(No);var Do=function(r,t){this.markers=r,this.primary=t;for(var e=0;e<r.length;++e)r[e].parent=this};function zo(r){return r.findMarks(nt(r.first,0),r.clipPos(nt(r.lastLine())),(function(r){return r.parent}))}function jo(r){for(var t=function(t){var e=r[t],n=[e.primary.doc];Oi(e.primary.doc,(function(r){return n.push(r)}));for(var i=0;i<e.markers.length;i++){var o=e.markers[i];-1==W(n,o.doc)&&(o.parent=null,e.markers.splice(i--,1))}},e=0;e<r.length;e++)t(e)}Do.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var r=0;r<this.markers.length;++r)this.markers[r].clear();ce(this,"clear")}},Do.prototype.find=function(r,t){return this.primary.find(r,t)},yr(Do);var Bo=0,Io=function(r,t,e,n,i){if(!(this instanceof Io))return new Io(r,t,e,n,i);null==e&&(e=0),Ao.call(this,[new Mo([new Qt("",null)])]),this.first=e,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=e;var o=nt(e,0);this.sel=Ni(o),this.history=new Pi(null),this.id=++Bo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof r&&(r=this.splitLines(r)),Fi(this,{from:o,to:o,text:r}),no(this,Ni(o),G)};Io.prototype=rr(Ao.prototype,{constructor:Io,iter:function(r,t,e){e?this.iterN(r-this.first,t-r,e):this.iterN(this.first,this.first+this.size,r)},insert:function(r,t){for(var e=0,n=0;n<t.length;++n)e+=t[n].height;this.insertInner(r-this.first,t,e)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=Yr(this,this.first,this.first+this.size);return!1===r?t:t.join(r||this.lineSeparator())},setValue:oi((function(r){var t=nt(this.first,0),e=this.first+this.size-1;vo(this,{from:t,to:nt(e,Qr(this,e).text.length),text:this.splitLines(r),origin:"setValue",full:!0},!0),this.cm&&In(this.cm,0,0),no(this,Ni(t),G)})),replaceRange:function(r,t,e,n){wo(this,r,t=ct(this,t),e=e?ct(this,e):t,n)},getRange:function(r,t,e){var n=Jr(this,ct(this,r),ct(this,t));return!1===e?n:n.join(""===e?"":e||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(tt(this,r))return Qr(this,r)},getLineNumber:function(r){return Zr(r)},getLineHandleVisualStart:function(r){return"number"==typeof r&&(r=Qr(this,r)),Pt(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return ct(this,r)},getCursor:function(r){var t=this.sel.primary();return null==r||"head"==r?t.head:"anchor"==r?t.anchor:"end"==r||"to"==r||!1===r?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:oi((function(r,t,e){to(this,ct(this,"number"==typeof r?nt(r,t||0):r),null,e)})),setSelection:oi((function(r,t,e){to(this,ct(this,r),ct(this,t||r),e)})),extendSelection:oi((function(r,t,e){Xi(this,ct(this,r),t&&ct(this,t),e)})),extendSelections:oi((function(r,t){Zi(this,ft(this,r),t)})),extendSelectionsBy:oi((function(r,t){Zi(this,ft(this,X(this.sel.ranges,r)),t)})),setSelections:oi((function(r,t,e){if(r.length){for(var n=[],i=0;i<r.length;i++)n[i]=new Si(ct(this,r[i].anchor),ct(this,r[i].head||r[i].anchor));null==t&&(t=Math.min(r.length-1,this.sel.primIndex)),no(this,Ti(this.cm,n,t),e)}})),addSelection:oi((function(r,t,e){var n=this.sel.ranges.slice(0);n.push(new Si(ct(this,r),ct(this,t||r))),no(this,Ti(this.cm,n,n.length-1),e)})),getSelection:function(r){for(var t,e=this.sel.ranges,n=0;n<e.length;n++){var i=Jr(this,e[n].from(),e[n].to());t=t?t.concat(i):i}return!1===r?t:t.join(r||this.lineSeparator())},getSelections:function(r){for(var t=[],e=this.sel.ranges,n=0;n<e.length;n++){var i=Jr(this,e[n].from(),e[n].to());!1!==r&&(i=i.join(r||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(r,t,e){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=r;this.replaceSelections(n,t,e||"+input")},replaceSelections:oi((function(r,t,e){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(r[o]),origin:e}}for(var u=t&&"end"!=t&&function(r,t,e){for(var n=[],i=nt(r.first,0),o=i,a=0;a<t.length;a++){var u=t[a],l=ji(u.from,i,o),s=ji(Ei(u),i,o);if(i=u.to,o=s,"around"==e){var c=r.sel.ranges[a],f=it(c.head,c.anchor)<0;n[a]=new Si(f?s:l,f?l:s)}else n[a]=new Si(l,l)}return new Li(n,r.sel.primIndex)}(this,n,t),l=n.length-1;l>=0;l--)vo(this,n[l]);u?eo(this,u):this.cm&&Bn(this.cm)})),undo:oi((function(){po(this,"undo")})),redo:oi((function(){po(this,"redo")})),undoSelection:oi((function(){po(this,"undo",!0)})),redoSelection:oi((function(){po(this,"redo",!0)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){for(var r=this.history,t=0,e=0,n=0;n<r.done.length;n++)r.done[n].ranges||++t;for(var i=0;i<r.undone.length;i++)r.undone[i].ranges||++e;return{undo:t,redo:e}},clearHistory:function(){var r=this;this.history=new Pi(this.history),Oi(this,(function(t){return t.history=r.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(r){return r&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:Ji(this.history.done),undone:Ji(this.history.undone)}},setHistory:function(r){var t=this.history=new Pi(this.history);t.done=Ji(r.done.slice(0),null,!0),t.undone=Ji(r.undone.slice(0),null,!0)},setGutterMarker:oi((function(r,t,e){return Co(this,r,"gutter",(function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=e,!e&&ir(n)&&(r.gutterMarkers=null),!0}))})),clearGutter:oi((function(r){var t=this;this.iter((function(e){e.gutterMarkers&&e.gutterMarkers[r]&&Co(t,e,"gutter",(function(){return e.gutterMarkers[r]=null,ir(e.gutterMarkers)&&(e.gutterMarkers=null),!0}))}))})),lineInfo:function(r){var t;if("number"==typeof r){if(!tt(this,r))return null;if(t=r,!(r=Qr(this,r)))return null}else if(null==(t=Zr(r)))return null;return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:oi((function(r,t,e){return Co(this,r,"gutter"==t?"gutter":"class",(function(r){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(r[n]){if(A(e).test(r[n]))return!1;r[n]+=" "+e}else r[n]=e;return!0}))})),removeLineClass:oi((function(r,t,e){return Co(this,r,"gutter"==t?"gutter":"class",(function(r){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=r[n];if(!i)return!1;if(null==e)r[n]=null;else{var o=i.match(A(e));if(!o)return!1;var a=o.index+o[0].length;r[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:oi((function(r,t,e){return function(r,t,e,n){var i=new Lo(r,e,n),o=r.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Co(r,t,"widget",(function(t){var e=t.widgets||(t.widgets=[]);if(null==i.insertAt?e.push(i):e.splice(Math.min(e.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!$t(r,t)){var n=Ht(t)<r.scrollTop;Xr(t,t.height+Ce(i)),n&&jn(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ce(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Zr(t)),i}(this,r,t,e)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,e){return Eo(this,ct(this,r),ct(this,t),e,e&&e.type||"range")},setBookmark:function(r,t){var e={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Eo(this,r=ct(this,r),r,e,"bookmark")},findMarksAt:function(r){var t=[],e=Qr(this,(r=ct(this,r)).line).markedSpans;if(e)for(var n=0;n<e.length;++n){var i=e[n];(null==i.from||i.from<=r.ch)&&(null==i.to||i.to>=r.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(r,t,e){r=ct(this,r),t=ct(this,t);var n=[],i=r.line;return this.iter(r.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var u=0;u<a.length;u++){var l=a[u];null!=l.to&&i==r.line&&r.ch>=l.to||null==l.from&&i!=r.line||null!=l.from&&i==t.line&&l.from>=t.ch||e&&!e(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var r=[];return this.iter((function(t){var e=t.markedSpans;if(e)for(var n=0;n<e.length;++n)null!=e[n].from&&r.push(e[n].marker)})),r},posFromIndex:function(r){var t,e=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>r)return t=r,!0;r-=o,++e})),ct(this,nt(e,t))},indexFromPos:function(r){var t=(r=ct(this,r)).ch;if(r.line<this.first||r.ch<0)return 0;var e=this.lineSeparator().length;return this.iter(this.first,r.line,(function(r){t+=r.text.length+e})),t},copy:function(r){var t=new Io(Yr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,r&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(r){r||(r={});var t=this.first,e=this.first+this.size;null!=r.from&&r.from>t&&(t=r.from),null!=r.to&&r.to<e&&(e=r.to);var n=new Io(Yr(this,t,e),r.mode||this.modeOption,t,this.lineSep,this.direction);return r.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:r.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:r.sharedHist}],function(r,t){for(var e=0;e<t.length;e++){var n=t[e],i=n.find(),o=r.clipPos(i.from),a=r.clipPos(i.to);if(it(o,a)){var u=Eo(r,o,a,n.primary,n.primary.type);n.markers.push(u),u.parent=n}}}(n,zo(this)),n},unlinkDoc:function(r){if(r instanceof Da&&(r=r.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==r){this.linked.splice(t,1),r.unlinkDoc(this),jo(zo(this));break}if(r.history==this.history){var e=[r.id];Oi(r,(function(r){return e.push(r.id)}),!0),r.history=new Pi(null),r.history.done=Ji(this.history.done,e),r.history.undone=Ji(this.history.undone,e)}},iterLinkedDocs:function(r){Oi(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){return this.lineSep?r.split(this.lineSep):Br(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oi((function(r){var t;"rtl"!=r&&(r="ltr"),r!=this.direction&&(this.direction=r,this.iter((function(r){return r.order=null})),this.cm&&ei(t=this.cm,(function(){_i(t),vn(t)})))}))}),Io.prototype.eachLine=Io.prototype.iter;var Ro=0;function Fo(r){var t=this;if(Oo(t),!br(t,r)&&!Me(t.display,r)){xr(r),a&&(Ro=+new Date);var e=dn(t,r,!0),n=r.dataTransfer.files;if(e&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),u=0,l=function(){++u==i&&ni(t,(function(){var r={from:e=ct(t.doc,e),to:e,text:t.doc.splitLines(o.filter((function(r){return null!=r})).join(t.doc.lineSeparator())),origin:"paste"};vo(t.doc,r),eo(t.doc,Ni(ct(t.doc,e),ct(t.doc,Ei(r))))}))()},s=function(r,e){if(t.options.allowDropFileTypes&&-1==W(t.options.allowDropFileTypes,r.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var r=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(r)||(o[e]=r),l()},n.readAsText(r)}},c=0;c<n.length;c++)s(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(e)>-1)return t.state.draggingText(r),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=r.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),io(t.doc,Ni(e,e)),d)for(var h=0;h<d.length;++h)wo(t.doc,"",d[h].anchor,d[h].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(r){}}}}function Oo(r){r.display.dragCursor&&(r.display.lineSpace.removeChild(r.display.dragCursor),r.display.dragCursor=null)}function Uo(r){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),e=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&e.push(i)}e.length&&e[0].operation((function(){for(var t=0;t<e.length;t++)r(e[t])}))}}var _o=!1;function Po(){var r;_o||(vr(window,"resize",(function(){null==r&&(r=setTimeout((function(){r=null,Uo(qo)}),100))})),vr(window,"blur",(function(){return Uo(Tn)})),_o=!0)}function qo(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,r.setSize()}for(var Wo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$o=0;$o<10;$o++)Wo[$o+48]=Wo[$o+96]=String($o);for(var Go=65;Go<=90;Go++)Wo[Go]=String.fromCharCode(Go);for(var Ho=1;Ho<=12;Ho++)Wo[Ho+111]=Wo[Ho+63235]="F"+Ho;var Ko={};function Vo(r){var t,e,n,i,o=r.split(/-(?!$)/);r=o[o.length-1];for(var a=0;a<o.length-1;a++){var u=o[a];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))e=!0;else{if(!/^s(hift)?$/i.test(u))throw new Error("Unrecognized modifier name: "+u);n=!0}}return t&&(r="Alt-"+r),e&&(r="Ctrl-"+r),i&&(r="Cmd-"+r),n&&(r="Shift-"+r),r}function Qo(r){var t={};for(var e in r)if(r.hasOwnProperty(e)){var n=r[e];if(/^(name|fallthrough|(de|at)tach)$/.test(e))continue;if("..."==n){delete r[e];continue}for(var i=X(e.split(" "),Vo),o=0;o<i.length;o++){var a=void 0,u=void 0;o==i.length-1?(u=i.join(" "),a=n):(u=i.slice(0,o+1).join(" "),a="...");var l=t[u];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+u)}else t[u]=a}delete r[e]}for(var s in t)r[s]=t[s];return r}function Jo(r,t,e,n){var i=(t=ra(t)).call?t.call(r,n):t[r];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&e(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Jo(r,t.fallthrough,e,n);for(var o=0;o<t.fallthrough.length;o++){var a=Jo(r,t.fallthrough[o],e,n);if(a)return a}}}function Yo(r){var t="string"==typeof r?r:Wo[r.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Xo(r,t,e){var n=r;return t.altKey&&"Alt"!=n&&(r="Alt-"+r),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(r="Cmd-"+r),!e&&t.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r}function Zo(r,t){if(d&&34==r.keyCode&&r.char)return!1;var e=Wo[r.keyCode];return null!=e&&!r.altGraphKey&&(3==r.keyCode&&r.code&&(e=r.code),Xo(e,r,t))}function ra(r){return"string"==typeof r?Ko[r]:r}function ta(r,t){for(var e=r.doc.sel.ranges,n=[],i=0;i<e.length;i++){for(var o=t(e[i]);n.length&&it(o.from,Y(n).to)<=0;){var a=n.pop();if(it(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}ei(r,(function(){for(var t=n.length-1;t>=0;t--)wo(r.doc,"",n[t].from,n[t].to,"+delete");Bn(r)}))}function ea(r,t,e){var n=ur(r.text,t+e,e);return n<0||n>r.text.length?null:n}function na(r,t,e){var n=ea(r,t.ch,e);return null==n?null:new nt(t.line,n,e<0?"after":"before")}function ia(r,t,e,n,i){if(r){"rtl"==t.doc.direction&&(i=-i);var o=dr(e,t.doc.direction);if(o){var a,u=i<0?Y(o):o[0],l=i<0==(1==u.level)?"after":"before";if(u.level>0||"rtl"==t.doc.direction){var s=Be(t,e),c=Ie(t,s,a=i<0?e.text.length-1:0).top;a=lr((function(r){return Ie(t,s,r).top==c}),i<0==(1==u.level)?u.from:u.to-1,a),"before"==l&&(a=ea(e,a,1))}else a=i<0?u.to:u.from;return new nt(n,a,l)}}return new nt(n,i<0?e.text.length:0,i<0?"before":"after")}Ko.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ko.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ko.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ko.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ko.default=w?Ko.macDefault:Ko.pcDefault;var oa={selectAll:fo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),G)},killLine:function(r){return ta(r,(function(t){if(t.empty()){var e=Qr(r.doc,t.head.line).text.length;return t.head.ch==e&&t.head.line<r.lastLine()?{from:t.head,to:nt(t.head.line+1,0)}:{from:t.head,to:nt(t.head.line,e)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(r){return ta(r,(function(t){return{from:nt(t.from().line,0),to:ct(r.doc,nt(t.to().line+1,0))}}))},delLineLeft:function(r){return ta(r,(function(r){return{from:nt(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return ta(r,(function(t){var e=r.charCoords(t.head,"div").top+5;return{from:r.coordsChar({left:0,top:e},"div"),to:t.from()}}))},delWrappedLineRight:function(r){return ta(r,(function(t){var e=r.charCoords(t.head,"div").top+5,n=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div");return{from:t.from(),to:n}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(nt(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(nt(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return aa(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return ua(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return function(r,t){var e=Qr(r.doc,t),n=function(r){for(var t;t=Ot(r);)r=t.find(1,!0).line;return r}(e);return n!=e&&(t=Zr(n)),ia(!0,r,e,t,-1)}(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div")}),K)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:e},"div")}),K)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5,n=r.coordsChar({left:0,top:e},"div");return n.ch<r.getLine(n.line).search(/\S/)?ua(r,t.head):n}),K)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){for(var t=[],e=r.listSelections(),n=r.options.tabSize,i=0;i<e.length;i++){var o=e[i].from(),a=P(r.getLine(o.line),o.ch,n);t.push(J(n-a%n))}r.replaceSelections(t)},defaultTab:function(r){r.somethingSelected()?r.indentSelection("add"):r.execCommand("insertTab")},transposeChars:function(r){return ei(r,(function(){for(var t=r.listSelections(),e=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=Qr(r.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new nt(i.line,i.ch-1)),i.ch>0)i=new nt(i.line,i.ch+1),r.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),nt(i.line,i.ch-2),i,"+transpose");else if(i.line>r.doc.first){var a=Qr(r.doc,i.line-1).text;a&&(i=new nt(i.line,1),r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+a.charAt(a.length-1),nt(i.line-1,a.length-1),i,"+transpose"))}e.push(new Si(i,i))}r.setSelections(e)}))},newlineAndIndent:function(r){return ei(r,(function(){for(var t=r.listSelections(),e=t.length-1;e>=0;e--)r.replaceRange(r.doc.lineSeparator(),t[e].anchor,t[e].head,"+input");t=r.listSelections();for(var n=0;n<t.length;n++)r.indentLine(t[n].from().line,null,!0);Bn(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function aa(r,t){var e=Qr(r.doc,t),n=Pt(e);return n!=e&&(t=Zr(n)),ia(!0,r,n,t,1)}function ua(r,t){var e=aa(r,t.line),n=Qr(r.doc,e.line),i=dr(n,r.doc.direction);if(!i||0==i[0].level){var o=Math.max(e.ch,n.text.search(/\S/));return nt(e.line,t.line==e.line&&t.ch<=o&&t.ch?0:o,e.sticky)}return e}function la(r,t,e){if("string"==typeof t&&!(t=oa[t]))return!1;r.display.input.ensurePolled();var n=r.display.shift,i=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),e&&(r.display.shift=!1),i=t(r)!=$}finally{r.display.shift=n,r.state.suppressEdits=!1}return i}var sa=new q;function ca(r,t,e,n){var i=r.state.keySeq;if(i){if(Yo(t))return"handled";if(/\'$/.test(t)?r.state.keySeq=null:sa.set(50,(function(){r.state.keySeq==i&&(r.state.keySeq=null,r.display.input.reset())})),fa(r,i+" "+t,e,n))return!0}return fa(r,t,e,n)}function fa(r,t,e,n){var i=function(r,t,e){for(var n=0;n<r.state.keyMaps.length;n++){var i=Jo(t,r.state.keyMaps[n],e,r);if(i)return i}return r.options.extraKeys&&Jo(t,r.options.extraKeys,e,r)||Jo(t,r.options.keyMap,e,r)}(r,t,n);return"multi"==i&&(r.state.keySeq=t),"handled"==i&&ce(r,"keyHandled",r,t,e),"handled"!=i&&"multi"!=i||(xr(e),Mn(r)),!!i}function da(r,t){var e=Zo(t,!0);return!!e&&(t.shiftKey&&!r.state.keySeq?ca(r,"Shift-"+e,t,(function(t){return la(r,t,!0)}))||ca(r,e,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return la(r,t)})):ca(r,e,t,(function(t){return la(r,t)})))}var ha=null;function va(r){var t=this;if(!(r.target&&r.target!=t.display.input.getField()||(t.curOp.focus=j(F(t)),br(t,r)))){a&&u<11&&27==r.keyCode&&(r.returnValue=!1);var n=r.keyCode;t.display.shift=16==n||r.shiftKey;var i=da(t,r);d&&(ha=i?n:null,i||88!=n||Rr||!(w?r.metaKey:r.ctrlKey)||t.replaceSelection("",null,"cut")),e&&!w&&!i&&46==n&&r.shiftKey&&!r.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(r){var t=r.display.lineDiv;function e(r){18!=r.keyCode&&r.altKey||(S(t,"CodeMirror-crosshair"),pr(document,"keyup",e),pr(document,"mouseover",e))}B(t,"CodeMirror-crosshair"),vr(document,"keyup",e),vr(document,"mouseover",e)}(t)}}function ma(r){16==r.keyCode&&(this.doc.sel.shift=!1),br(this,r)}function pa(r){var t=this;if(!(r.target&&r.target!=t.display.input.getField()||Me(t.display,r)||br(t,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey)){var e=r.keyCode,n=r.charCode;if(d&&e==ha)return ha=null,void xr(r);if(!d||r.which&&!(r.which<10)||!da(t,r)){var i=String.fromCharCode(null==n?e:n);"\b"!=i&&(function(r,t,e){return ca(r,"'"+e+"'",t,(function(t){return la(r,t,!0)}))}(t,r,i)||t.display.input.onKeyPress(r))}}}var ga,ba,wa=function(r,t,e){this.time=r,this.pos=t,this.button=e};function ka(r){var t=this,e=t.display;if(!(br(t,r)||e.activeTouch&&e.input.supportsTouch()))if(e.input.ensurePolled(),e.shift=r.shiftKey,Me(e,r))l||(e.scroller.draggable=!1,setTimeout((function(){return e.scroller.draggable=!0}),100));else if(!Ca(t,r)){var n=dn(t,r),i=Sr(r),o=n?function(r,t){var e=+new Date;return ba&&ba.compare(e,r,t)?(ga=ba=null,"triple"):ga&&ga.compare(e,r,t)?(ba=new wa(e,r,t),ga=null,"double"):(ga=new wa(e,r,t),ba=null,"single")}(n,i):"single";O(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(r),n&&function(r,t,e,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),ca(r,Xo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=oa[t]),!t)return!1;var n=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),n=t(r,e)!=$}finally{r.state.suppressEdits=!1}return n}))}(t,i,n,o,r)||(1==i?n?function(r,t,e,n){a?setTimeout(U(An,r),0):r.curOp.focus=j(F(r));var i,o=function(r,t,e){var n=r.getOption("configureMouse"),i=n?n(r,t,e):{};return null==i.unit&&(i.unit=(k?e.shiftKey&&e.metaKey:e.altKey)?"rectangle":"single"==t?"char":"double"==t?"word":"line"),(null==i.extend||r.doc.extend)&&(i.extend=r.doc.extend||e.shiftKey),null==i.addNew&&(i.addNew=w?e.metaKey:e.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(w?e.altKey:e.ctrlKey)),i}(r,e,n),s=r.doc.sel;r.options.dragDrop&&Er&&!r.isReadOnly()&&"single"==e&&(i=s.contains(t))>-1&&(it((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(it(i.to(),t)>0||t.xRel<0)?function(r,t,e,n){var i=r.display,o=!1,s=ni(r,(function(t){l&&(i.scroller.draggable=!1),r.state.draggingText=!1,r.state.delayingBlurEvent&&(r.hasFocus()?r.state.delayingBlurEvent=!1:Ln(r)),pr(i.wrapper.ownerDocument,"mouseup",s),pr(i.wrapper.ownerDocument,"mousemove",c),pr(i.scroller,"dragstart",f),pr(i.scroller,"drop",s),o||(xr(t),n.addNew||Xi(r.doc,e,null,null,n.extend),l&&!h||a&&9==u?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10},f=function(){return o=!0};l&&(i.scroller.draggable=!0),r.state.draggingText=s,s.copy=!n.moveOnDrag,vr(i.wrapper.ownerDocument,"mouseup",s),vr(i.wrapper.ownerDocument,"mousemove",c),vr(i.scroller,"dragstart",f),vr(i.scroller,"drop",s),r.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(r,n,t,o):function(r,t,e,n){a&&Ln(r);var i=r.display,o=r.doc;xr(t);var u,l,s=o.sel,c=s.ranges;if(n.addNew&&!n.extend?(l=o.sel.contains(e),u=l>-1?c[l]:new Si(e,e)):(u=o.sel.primary(),l=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(u=new Si(e,e)),e=dn(r,t,!0,!0),l=-1;else{var f=ya(r,e,n.unit);u=n.extend?Yi(u,f.anchor,f.head,n.extend):f}n.addNew?-1==l?(l=c.length,no(o,Ti(r,c.concat([u]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==n.unit&&!n.extend?(no(o,Ti(r,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):ro(o,l,u,H):(l=0,no(o,new Li([u],0),H),s=o.sel);var d=e;function h(t){if(0!=it(d,t))if(d=t,"rectangle"==n.unit){for(var i=[],a=r.options.tabSize,c=P(Qr(o,e.line).text,e.ch,a),f=P(Qr(o,t.line).text,t.ch,a),h=Math.min(c,f),v=Math.max(c,f),m=Math.min(e.line,t.line),p=Math.min(r.lastLine(),Math.max(e.line,t.line));m<=p;m++){var g=Qr(o,m).text,b=V(g,h,a);h==v?i.push(new Si(nt(m,b),nt(m,b))):g.length>b&&i.push(new Si(nt(m,b),nt(m,V(g,v,a))))}i.length||i.push(new Si(e,e)),no(o,Ti(r,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),r.scrollIntoView(t)}else{var w,k=u,y=ya(r,t,n.unit),x=k.anchor;it(y.anchor,x)>0?(w=y.head,x=lt(k.from(),y.anchor)):(w=y.anchor,x=ut(k.to(),y.head));var C=s.ranges.slice(0);C[l]=function(r,t){var e=t.anchor,n=t.head,i=Qr(r.doc,e.line);if(0==it(e,n)&&e.sticky==n.sticky)return t;var o=dr(i);if(!o)return t;var a=cr(o,e.ch,e.sticky),u=o[a];if(u.from!=e.ch&&u.to!=e.ch)return t;var l,s=a+(u.from==e.ch==(1!=u.level)?0:1);if(0==s||s==o.length)return t;if(n.line!=e.line)l=(n.line-e.line)*("ltr"==r.doc.direction?1:-1)>0;else{var c=cr(o,n.ch,n.sticky),f=c-a||(n.ch-e.ch)*(1==u.level?-1:1);l=c==s-1||c==s?f<0:f>0}var d=o[s+(l?-1:0)],h=l==(1==d.level),v=h?d.from:d.to,m=h?"after":"before";return e.ch==v&&e.sticky==m?t:new Si(new nt(e.line,v,m),n)}(r,new Si(ct(o,x),w)),no(o,Ti(r,C,l),H)}}var v=i.wrapper.getBoundingClientRect(),m=0;function p(t){var e=++m,a=dn(r,t,!0,"rectangle"==n.unit);if(a)if(0!=it(a,d)){r.curOp.focus=j(F(r)),h(a);var u=Dn(i,o);(a.line>=u.to||a.line<u.from)&&setTimeout(ni(r,(function(){m==e&&p(t)})),150)}else{var l=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;l&&setTimeout(ni(r,(function(){m==e&&(i.scroller.scrollTop+=l,p(t))})),50)}}function g(t){r.state.selectingText=!1,m=1/0,t&&(xr(t),i.input.focus()),pr(i.wrapper.ownerDocument,"mousemove",b),pr(i.wrapper.ownerDocument,"mouseup",w),o.history.lastSelOrigin=null}var b=ni(r,(function(r){0!==r.buttons&&Sr(r)?p(r):g(r)})),w=ni(r,g);r.state.selectingText=w,vr(i.wrapper.ownerDocument,"mousemove",b),vr(i.wrapper.ownerDocument,"mouseup",w)}(r,n,t,o)}(t,n,o,r):Lr(r)==e.scroller&&xr(r):2==i?(n&&Xi(t.doc,n),setTimeout((function(){return e.input.focus()}),20)):3==i&&(M?t.display.input.onContextMenu(r):Ln(t)))}}function ya(r,t,e){if("char"==e)return new Si(t,t);if("word"==e)return r.findWordAt(t);if("line"==e)return new Si(nt(t.line,0),ct(r.doc,nt(t.line+1,0)));var n=e(r,t);return new Si(n.from,n.to)}function xa(r,t,e,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(r){return!1}if(i>=Math.floor(r.display.gutters.getBoundingClientRect().right))return!1;n&&xr(t);var a=r.display,u=a.lineDiv.getBoundingClientRect();if(o>u.bottom||!kr(r,e))return Mr(t);o-=u.top-a.viewOffset;for(var l=0;l<r.display.gutterSpecs.length;++l){var s=a.gutters.childNodes[l];if(s&&s.getBoundingClientRect().right>=i)return gr(r,e,r,rt(r.doc,o),r.display.gutterSpecs[l].className,t),Mr(t)}}function Ca(r,t){return xa(r,t,"gutterClick",!0)}function Ma(r,t){Me(r.display,t)||function(r,t){return!!kr(r,"gutterContextMenu")&&xa(r,t,"gutterContextMenu",!1)}(r,t)||br(r,t,"contextmenu")||M||r.display.input.onContextMenu(t)}function Aa(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qe(r)}wa.prototype.compare=function(r,t,e){return this.time+400>r&&0==it(t,this.pos)&&e==this.button};var La={toString:function(){return"CodeMirror.Init"}},Sa={},Ta={};function Na(r,t,e){if(!t!=!(e&&e!=La)){var n=r.display.dragFunctions,i=t?vr:pr;i(r.display.scroller,"dragstart",n.start),i(r.display.scroller,"dragenter",n.enter),i(r.display.scroller,"dragover",n.over),i(r.display.scroller,"dragleave",n.leave),i(r.display.scroller,"drop",n.drop)}}function Ea(r){r.options.lineWrapping?(B(r.display.wrapper,"CodeMirror-wrap"),r.display.sizer.style.minWidth="",r.display.sizerWidth=null):(S(r.display.wrapper,"CodeMirror-wrap"),Vt(r)),fn(r),vn(r),qe(r),setTimeout((function(){return $n(r)}),100)}function Da(r,t){var e=this;if(!(this instanceof Da))return new Da(r,t);this.options=t=t?_(t):{},_(Sa,t,!1);var n=t.value;"string"==typeof n?n=new Io(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Da.inputStyles[t.inputStyle](this),o=this.display=new ki(r,n,i,t);for(var s in o.wrapper.CodeMirror=this,Aa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},t.autofocus&&!b&&o.input.focus(),a&&u<11&&setTimeout((function(){return e.display.input.reset(!0)}),20),function(r){var t=r.display;vr(t.scroller,"mousedown",ni(r,ka)),vr(t.scroller,"dblclick",a&&u<11?ni(r,(function(t){if(!br(r,t)){var e=dn(r,t);if(e&&!Ca(r,t)&&!Me(r.display,t)){xr(t);var n=r.findWordAt(e);Xi(r.doc,n.anchor,n.head)}}})):function(t){return br(r,t)||xr(t)}),vr(t.scroller,"contextmenu",(function(t){return Ma(r,t)})),vr(t.input.getField(),"contextmenu",(function(e){t.scroller.contains(e.target)||Ma(r,e)}));var e,n={end:0};function i(){t.activeTouch&&(e=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(r){if(1!=r.touches.length)return!1;var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(r,t){if(null==t.left)return!0;var e=t.left-r.left,n=t.top-r.top;return e*e+n*n>400}vr(t.scroller,"touchstart",(function(i){if(!br(r,i)&&!o(i)&&!Ca(r,i)){t.input.ensurePolled(),clearTimeout(e);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),vr(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),vr(t.scroller,"touchend",(function(e){var n=t.activeTouch;if(n&&!Me(t,e)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,a=r.coordsChar(t.activeTouch,"page");o=!n.prev||l(n,n.prev)?new Si(a,a):!n.prev.prev||l(n,n.prev.prev)?r.findWordAt(a):new Si(nt(a.line,0),ct(r.doc,nt(a.line+1,0))),r.setSelection(o.anchor,o.head),r.focus(),xr(e)}i()})),vr(t.scroller,"touchcancel",i),vr(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(On(r,t.scroller.scrollTop),_n(r,t.scroller.scrollLeft,!0),gr(r,"scroll",r))})),vr(t.scroller,"mousewheel",(function(t){return Ai(r,t)})),vr(t.scroller,"DOMMouseScroll",(function(t){return Ai(r,t)})),vr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){br(r,t)||Ar(t)},over:function(t){br(r,t)||(function(r,t){var e=dn(r,t);if(e){var n=document.createDocumentFragment();yn(r,e,n),r.display.dragCursor||(r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),N(r.display.dragCursor,n)}}(r,t),Ar(t))},start:function(t){return function(r,t){if(a&&(!r.state.draggingText||+new Date-Ro<100))Ar(t);else if(!br(r,t)&&!Me(r.display,t)&&(t.dataTransfer.setData("Text",r.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var e=E("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(e.width=e.height=1,r.display.wrapper.appendChild(e),e._top=e.offsetTop),t.dataTransfer.setDragImage(e,0,0),d&&e.parentNode.removeChild(e)}}(r,t)},drop:ni(r,Fo),leave:function(t){br(r,t)||Oo(r)}};var s=t.input.getField();vr(s,"keyup",(function(t){return ma.call(r,t)})),vr(s,"keydown",ni(r,va)),vr(s,"keypress",ni(r,pa)),vr(s,"focus",(function(t){return Sn(r,t)})),vr(s,"blur",(function(t){return Tn(r,t)}))}(this),Po(),Qn(this),this.curOp.forceUpdate=!0,Ui(this,n),t.autofocus&&!b||this.hasFocus()?setTimeout((function(){e.hasFocus()&&!e.state.focused&&Sn(e)}),20):Tn(this),Ta)Ta.hasOwnProperty(s)&&Ta[s](this,t[s],La);pi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<za.length;++c)za[c](this);Jn(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Da.defaults=Sa,Da.optionHandlers=Ta;var za=[];function ja(r,t,e,n){var i,o=r.doc;null==e&&(e="add"),"smart"==e&&(o.mode.indent?i=pt(r,t).state:e="prev");var a=r.options.tabSize,u=Qr(o,t),l=P(u.text,null,a);u.stateAfter&&(u.stateAfter=null);var s,c=u.text.match(/^\s*/)[0];if(n||/\S/.test(u.text)){if("smart"==e&&((s=o.mode.indent(i,u.text.slice(c.length),u.text))==$||s>150)){if(!n)return;e="prev"}}else s=0,e="not";"prev"==e?s=t>o.first?P(Qr(o,t-1).text,null,a):0:"add"==e?s=l+r.options.indentUnit:"subtract"==e?s=l-r.options.indentUnit:"number"==typeof e&&(s=l+e),s=Math.max(0,s);var f="",d=0;if(r.options.indentWithTabs)for(var h=Math.floor(s/a);h;--h)d+=a,f+="\t";if(d<s&&(f+=J(s-d)),f!=c)return wo(o,f,nt(t,0),nt(t,c.length),"+input"),u.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==t&&m.head.ch<c.length){var p=nt(t,c.length);ro(o,v,new Si(p,p));break}}}Da.defineInitHook=function(r){return za.push(r)};var Ba=null;function Ia(r){Ba=r}function Ra(r,t,e,n,i){var o=r.doc;r.display.shift=!1,n||(n=o.sel);var a=+new Date-200,u="paste"==i||r.state.pasteIncoming>a,l=Br(t),s=null;if(u&&n.ranges.length>1)if(Ba&&Ba.text.join("\n")==t){if(n.ranges.length%Ba.text.length==0){s=[];for(var c=0;c<Ba.text.length;c++)s.push(o.splitLines(Ba.text[c]))}}else l.length==n.ranges.length&&r.options.pasteLinesPerSelection&&(s=X(l,(function(r){return[r]})));for(var f=r.curOp.updateInput,d=n.ranges.length-1;d>=0;d--){var h=n.ranges[d],v=h.from(),m=h.to();h.empty()&&(e&&e>0?v=nt(v.line,v.ch-e):r.state.overwrite&&!u?m=nt(m.line,Math.min(Qr(o,m.line).text.length,m.ch+Y(l).length)):u&&Ba&&Ba.lineWise&&Ba.text.join("\n")==l.join("\n")&&(v=m=nt(v.line,0)));var p={from:v,to:m,text:s?s[d%s.length]:l,origin:i||(u?"paste":r.state.cutIncoming>a?"cut":"+input")};vo(r.doc,p),ce(r,"inputRead",r,p)}t&&!u&&Oa(r,t),Bn(r),r.curOp.updateInput<2&&(r.curOp.updateInput=f),r.curOp.typing=!0,r.state.pasteIncoming=r.state.cutIncoming=-1}function Fa(r,t){var e=r.clipboardData&&r.clipboardData.getData("Text");if(e)return r.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||ei(t,(function(){return Ra(t,e,0,null,"paste")})),!0}function Oa(r,t){if(r.options.electricChars&&r.options.smartIndent)for(var e=r.doc.sel,n=e.ranges.length-1;n>=0;n--){var i=e.ranges[n];if(!(i.head.ch>100||n&&e.ranges[n-1].head.line==i.head.line)){var o=r.getModeAt(i.head),a=!1;if(o.electricChars){for(var u=0;u<o.electricChars.length;u++)if(t.indexOf(o.electricChars.charAt(u))>-1){a=ja(r,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qr(r.doc,i.head.line).text.slice(0,i.head.ch))&&(a=ja(r,i.head.line,"smart"));a&&ce(r,"electricInput",r,i.head.line)}}}function Ua(r){for(var t=[],e=[],n=0;n<r.doc.sel.ranges.length;n++){var i=r.doc.sel.ranges[n].head.line,o={anchor:nt(i,0),head:nt(i+1,0)};e.push(o),t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:e}}function _a(r,t,e,n){r.setAttribute("autocorrect",e?"":"off"),r.setAttribute("autocapitalize",n?"":"off"),r.setAttribute("spellcheck",!!t)}function Pa(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?r.style.width="1000px":r.setAttribute("wrap","off"),p&&(r.style.border="1px solid black"),_a(r),t}function qa(r,t,e,n,i){var o=t,a=e,u=Qr(r,t.line),l=i&&"rtl"==r.direction?-e:e;function s(o){var a,s;if("codepoint"==n){var c=u.text.charCodeAt(t.ch+(e>0?0:-1));a=isNaN(c)?null:new nt(t.line,Math.max(0,Math.min(u.text.length,t.ch+e*((e>0?c>=55296&&c<56320:c>=56320&&c<57343)?2:1))),-e)}else a=i?function(r,t,e,n){var i=dr(t,r.doc.direction);if(!i)return na(t,e,n);e.ch>=t.text.length?(e.ch=t.text.length,e.sticky="before"):e.ch<=0&&(e.ch=0,e.sticky="after");var o=cr(i,e.ch,e.sticky),a=i[o];if("ltr"==r.doc.direction&&a.level%2==0&&(n>0?a.to>e.ch:a.from<e.ch))return na(t,e,n);var u,l=function(r,e){return ea(t,r instanceof nt?r.ch:r,e)},s=function(e){return r.options.lineWrapping?(u=u||Be(r,t),rn(r,t,u,e)):{begin:0,end:t.text.length}},c=s("before"==e.sticky?l(e,-1):e.ch);if("rtl"==r.doc.direction||1==a.level){var f=1==a.level==n<0,d=l(e,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=c.end:d>=a.from&&d>=c.begin))return new nt(e.line,d,f?"before":"after")}var h=function(r,t,n){for(var o=function(r,t){return t?new nt(e.line,l(r,1),"before"):new nt(e.line,r,"after")};r>=0&&r<i.length;r+=t){var a=i[r],u=t>0==(1!=a.level),s=u?n.begin:l(n.end,-1);if(a.from<=s&&s<a.to)return o(s,u);if(s=u?a.from:l(a.to,-1),n.begin<=s&&s<n.end)return o(s,u)}},v=h(o+n,n,c);if(v)return v;var m=n>0?c.end:l(c.begin,-1);return null==m||n>0&&m==t.text.length||!(v=h(n>0?0:i.length-1,n,s(m)))?null:v}(r.cm,u,t,e):na(u,t,e);if(null==a){if(o||((s=t.line+l)<r.first||s>=r.first+r.size||(t=new nt(s,t.ch,t.sticky),!(u=Qr(r,s)))))return!1;t=ia(i,r.cm,u,t.line,l)}else t=a;return!0}if("char"==n||"codepoint"==n)s();else if("column"==n)s(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,d=r.cm&&r.cm.getHelper(t,"wordChars"),h=!0;!(e<0)||s(!h);h=!1){var v=u.text.charAt(t.ch)||"\n",m=nr(v,d)?"w":f&&"\n"==v?"n":!f||/\s/.test(v)?null:"p";if(!f||h||m||(m="s"),c&&c!=m){e<0&&(e=1,s(),t.sticky="after");break}if(m&&(c=m),e>0&&!s(!h))break}var p=so(r,t,o,a,!0);return ot(o,p)&&(p.hitSide=!0),p}function Wa(r,t,e,n){var i,o,a=r.doc,u=t.left;if("page"==n){var l=Math.min(r.display.wrapper.clientHeight,O(r).innerHeight||a(r).documentElement.clientHeight),s=Math.max(l-.5*an(r.display),3);i=(e>0?t.bottom:t.top)+e*s}else"line"==n&&(i=e>0?t.bottom+3:t.top-3);for(;(o=Xe(r,u,i)).outside;){if(e<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*e}return o}var $a=function(r){this.cm=r,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ga(r,t){var e=je(r,t.line);if(!e||e.hidden)return null;var n=Qr(r.doc,t.line),i=De(e,n,t.line),o=dr(n,r.doc.direction),a="left";o&&(a=cr(o,t.ch)%2?"right":"left");var u=Oe(i.map,t.ch,a);return u.offset="right"==u.collapse?u.end:u.start,u}function Ha(r,t){return t&&(r.bad=!0),r}function Ka(r,t,e){var n;if(t==r.display.lineDiv){if(!(n=r.display.lineDiv.childNodes[e]))return Ha(r.clipPos(nt(r.display.viewTo-1)),!0);t=null,e=0}else for(n=t;;n=n.parentNode){if(!n||n==r.display.lineDiv)return null;if(n.parentNode&&n.parentNode==r.display.lineDiv)break}for(var i=0;i<r.display.view.length;i++){var o=r.display.view[i];if(o.node==n)return Va(o,t,e)}}function Va(r,t,e){var n=r.text.firstChild,i=!1;if(!t||!z(n,t))return Ha(nt(Zr(r.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[e],e=0,!t)){var o=r.rest?Y(r.rest):r.line;return Ha(nt(Zr(o),o.text.length),i)}var a=3==t.nodeType?t:null,u=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,e&&(e=a.nodeValue.length));u.parentNode!=n;)u=u.parentNode;var l=r.measure,s=l.maps;function c(t,e,n){for(var i=-1;i<(s?s.length:0);i++)for(var o=i<0?l.map:s[i],a=0;a<o.length;a+=3){var u=o[a+2];if(u==t||u==e){var c=Zr(i<0?r.line:r.rest[i]),f=o[a]+n;return(n<0||u!=t)&&(f=o[a+(n?1:0)]),nt(c,f)}}}var f=c(a,u,e);if(f)return Ha(f,i);for(var d=u.nextSibling,h=a?a.nodeValue.length-e:0;d;d=d.nextSibling){if(f=c(d,d.firstChild,0))return Ha(nt(f.line,f.ch-h),i);h+=d.textContent.length}for(var v=u.previousSibling,m=e;v;v=v.previousSibling){if(f=c(v,v.firstChild,-1))return Ha(nt(f.line,f.ch+m),i);m+=v.textContent.length}}$a.prototype.init=function(r){var t=this,e=this,n=e.cm,i=e.div=r.lineDiv;function o(r){for(var t=r.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(r){if(o(r)&&!br(n,r)){if(n.somethingSelected())Ia({lineWise:!1,text:n.getSelections()}),"cut"==r.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ua(n);Ia({lineWise:!0,text:t.text}),"cut"==r.type&&n.operation((function(){n.setSelections(t.ranges,0,G),n.replaceSelection("",null,"cut")}))}if(r.clipboardData){r.clipboardData.clearData();var a=Ba.text.join("\n");if(r.clipboardData.setData("Text",a),r.clipboardData.getData("Text")==a)return void r.preventDefault()}var u=Pa(),l=u.firstChild;n.display.lineSpace.insertBefore(u,n.display.lineSpace.firstChild),l.value=Ba.text.join("\n");var s=j(i.ownerDocument);R(l),setTimeout((function(){n.display.lineSpace.removeChild(u),s.focus(),s==i&&e.showPrimarySelection()}),50)}}i.contentEditable=!0,_a(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),vr(i,"paste",(function(r){!o(r)||br(n,r)||Fa(r,n)||u<=11&&setTimeout(ni(n,(function(){return t.updateFromDOM()})),20)})),vr(i,"compositionstart",(function(r){t.composing={data:r.data,done:!1}})),vr(i,"compositionupdate",(function(r){t.composing||(t.composing={data:r.data,done:!1})})),vr(i,"compositionend",(function(r){t.composing&&(r.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),vr(i,"touchstart",(function(){return e.forceCompositionEnd()})),vr(i,"input",(function(){t.composing||t.readFromDOMSoon()})),vr(i,"copy",a),vr(i,"cut",a)},$a.prototype.screenReaderLabelChanged=function(r){r?this.div.setAttribute("aria-label",r):this.div.removeAttribute("aria-label")},$a.prototype.prepareSelection=function(){var r=kn(this.cm,!1);return r.focus=j(this.div.ownerDocument)==this.div,r},$a.prototype.showSelection=function(r,t){r&&this.cm.display.view.length&&((r.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(r))},$a.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$a.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)r.removeAllRanges();else{var a=Ka(t,r.anchorNode,r.anchorOffset),u=Ka(t,r.focusNode,r.focusOffset);if(!a||a.bad||!u||u.bad||0!=it(lt(a,u),i)||0!=it(ut(a,u),o)){var l=t.display.view,s=i.line>=t.display.viewFrom&&Ga(t,i)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ga(t,o);if(!c){var f=l[l.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(s&&c){var h,v=r.rangeCount&&r.getRangeAt(0);try{h=L(s.node,s.offset,c.offset,c.node)}catch(r){}h&&(!e&&t.state.focused?(r.collapse(s.node,s.offset),h.collapsed||(r.removeAllRanges(),r.addRange(h))):(r.removeAllRanges(),r.addRange(h)),v&&null==r.anchorNode?r.addRange(v):e&&this.startGracePeriod()),this.rememberSelection()}else r.removeAllRanges()}}},$a.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){r.gracePeriod=!1,r.selectionChanged()&&r.cm.operation((function(){return r.cm.curOp.selectionChanged=!0}))}),20)},$a.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors),N(this.cm.display.selectionDiv,r.selection)},$a.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode,this.lastAnchorOffset=r.anchorOffset,this.lastFocusNode=r.focusNode,this.lastFocusOffset=r.focusOffset},$a.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount)return!1;var t=r.getRangeAt(0).commonAncestorContainer;return z(this.div,t)},$a.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&j(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},$a.prototype.blur=function(){this.div.blur()},$a.prototype.getField=function(){return this.div},$a.prototype.supportsTouch=function(){return!0},$a.prototype.receivedFocus=function(){var r=this,t=this;this.selectionInEditor()?setTimeout((function(){return r.pollSelection()}),20):ei(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}))},$a.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset},$a.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var r=this.getSelection(),t=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&function(r){for(var t=r;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(r.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var e=Ka(t,r.anchorNode,r.anchorOffset),n=Ka(t,r.focusNode,r.focusOffset);e&&n&&ei(t,(function(){no(t.doc,Ni(e,n),G),(e.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},$a.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var r,t,e,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),u=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=nt(a.line-1,Qr(n.doc,a.line-1).length)),u.ch==Qr(n.doc,u.line).text.length&&u.line<n.lastLine()&&(u=nt(u.line+1,0)),a.line<i.viewFrom||u.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(r=hn(n,a.line))?(t=Zr(i.view[0].line),e=i.view[0].node):(t=Zr(i.view[r].line),e=i.view[r-1].node.nextSibling);var l,s,c=hn(n,u.line);if(c==i.view.length-1?(l=i.viewTo-1,s=i.lineDiv.lastChild):(l=Zr(i.view[c+1].line)-1,s=i.view[c+1].node.previousSibling),!e)return!1;for(var f=n.doc.splitLines(function(r,t,e,n,i){var o="",a=!1,u=r.doc.lineSeparator(),l=!1;function s(){a&&(o+=u,l&&(o+=u),a=l=!1)}function c(r){r&&(s(),o+=r)}function f(t){if(1==t.nodeType){var e=t.getAttribute("cm-text");if(e)return void c(e);var o,d=t.getAttribute("cm-marker");if(d){var h=r.findMarks(nt(n,0),nt(i+1,0),(p=+d,function(r){return r.id==p}));return void(h.length&&(o=h[0].find(0))&&c(Jr(r.doc,o.from,o.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;var v=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;v&&s();for(var m=0;m<t.childNodes.length;m++)f(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),v&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var p}for(;f(t),t!=e;)t=t.nextSibling,l=!1;return o}(n,e,s,t,l)),d=Jr(n.doc,nt(t,0),nt(l,Qr(n.doc,l).text.length));f.length>1&&d.length>1;)if(Y(f)==Y(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,v=0,m=f[0],p=d[0],g=Math.min(m.length,p.length);h<g&&m.charCodeAt(h)==p.charCodeAt(h);)++h;for(var b=Y(f),w=Y(d),k=Math.min(b.length-(1==f.length?h:0),w.length-(1==d.length?h:0));v<k&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1);)++v;if(1==f.length&&1==d.length&&t==a.line)for(;h&&h>a.ch&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1);)h--,v++;f[f.length-1]=b.slice(0,b.length-v).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var y=nt(t,h),x=nt(l,d.length?Y(d).length-v:0);return f.length>1||f[0]||it(y,x)?(wo(n.doc,f,y,x,"+input"),!0):void 0},$a.prototype.ensurePolled=function(){this.forceCompositionEnd()},$a.prototype.reset=function(){this.forceCompositionEnd()},$a.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},$a.prototype.readFromDOMSoon=function(){var r=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(r.readDOMTimeout=null,r.composing){if(!r.composing.done)return;r.composing=null}r.updateFromDOM()}),80))},$a.prototype.updateFromDOM=function(){var r=this;!this.cm.isReadOnly()&&this.pollContent()||ei(this.cm,(function(){return vn(r.cm)}))},$a.prototype.setUneditable=function(r){r.contentEditable="false"},$a.prototype.onKeyPress=function(r){0==r.charCode||this.composing||(r.preventDefault(),this.cm.isReadOnly()||ni(this.cm,Ra)(this.cm,String.fromCharCode(null==r.charCode?r.keyCode:r.charCode),0))},$a.prototype.readOnlyChanged=function(r){this.div.contentEditable=String("nocursor"!=r)},$a.prototype.onContextMenu=function(){},$a.prototype.resetPosition=function(){},$a.prototype.needsContentAttribute=!0;var Qa=function(r){this.cm=r,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null,this.resetting=!1};Qa.prototype.init=function(r){var t=this,e=this,n=this.cm;this.createField(r);var i=this.textarea;function o(r){if(!br(n,r)){if(n.somethingSelected())Ia({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ua(n);Ia({lineWise:!0,text:t.text}),"cut"==r.type?n.setSelections(t.ranges,null,G):(e.prevInput="",i.value=t.text.join("\n"),R(i))}"cut"==r.type&&(n.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),p&&(i.style.width="0px"),vr(i,"input",(function(){a&&u>=9&&t.hasSelection&&(t.hasSelection=null),e.poll()})),vr(i,"paste",(function(r){br(n,r)||Fa(r,n)||(n.state.pasteIncoming=+new Date,e.fastPoll())})),vr(i,"cut",o),vr(i,"copy",o),vr(r.scroller,"paste",(function(t){if(!Me(r,t)&&!br(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void e.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),vr(r.lineSpace,"selectstart",(function(t){Me(r,t)||xr(t)})),vr(i,"compositionstart",(function(){var r=n.getCursor("from");e.composing&&e.composing.range.clear(),e.composing={start:r,range:n.markText(r,n.getCursor("to"),{className:"CodeMirror-composing"})}})),vr(i,"compositionend",(function(){e.composing&&(e.poll(),e.composing.range.clear(),e.composing=null)}))},Qa.prototype.createField=function(){this.wrapper=Pa(),this.textarea=this.wrapper.firstChild},Qa.prototype.screenReaderLabelChanged=function(r){r?this.textarea.setAttribute("aria-label",r):this.textarea.removeAttribute("aria-label")},Qa.prototype.prepareSelection=function(){var r=this.cm,t=r.display,e=r.doc,n=kn(r);if(r.options.moveInputWithCursor){var i=Qe(r,e.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Qa.prototype.showSelection=function(r){var t=this.cm.display;N(t.cursorDiv,r.cursors),N(t.selectionDiv,r.selection),null!=r.teTop&&(this.wrapper.style.top=r.teTop+"px",this.wrapper.style.left=r.teLeft+"px")},Qa.prototype.reset=function(r){if(!(this.contextMenuPending||this.composing&&r)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var e=t.getSelection();this.textarea.value=e,t.state.focused&&R(this.textarea),a&&u>=9&&(this.hasSelection=e)}else r||(this.prevInput=this.textarea.value="",a&&u>=9&&(this.hasSelection=null));this.resetting=!1}},Qa.prototype.getField=function(){return this.textarea},Qa.prototype.supportsTouch=function(){return!1},Qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||j(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(r){}},Qa.prototype.blur=function(){this.textarea.blur()},Qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Qa.prototype.receivedFocus=function(){this.slowPoll()},Qa.prototype.slowPoll=function(){var r=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){r.poll(),r.cm.state.focused&&r.slowPoll()}))},Qa.prototype.fastPoll=function(){var r=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function e(){t.poll()||r?(t.pollingFast=!1,t.slowPoll()):(r=!0,t.polling.set(60,e))}))},Qa.prototype.poll=function(){var r=this,t=this.cm,e=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Ir(e)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=e.value;if(i==n&&!t.somethingSelected())return!1;if(a&&u>=9&&this.hasSelection===i||w&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return ei(t,(function(){Ra(t,i.slice(l),n.length-l,null,r.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?e.value=r.prevInput="":r.prevInput=i,r.composing&&(r.composing.range.clear(),r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Qa.prototype.onKeyPress=function(){a&&u>=9&&(this.hasSelection=null),this.fastPoll()},Qa.prototype.onContextMenu=function(r){var t=this,e=t.cm,n=e.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=dn(e,r),s=n.scroller.scrollTop;if(o&&!d){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(o)&&ni(e,no)(e.doc,Ni(o),G);var c,f=i.style.cssText,h=t.wrapper.style.cssText,v=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-v.top-5)+"px; left: "+(r.clientX-v.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=i.ownerDocument.defaultView.scrollY),n.input.focus(),l&&i.ownerDocument.defaultView.scrollTo(null,c),n.input.reset(),e.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=e.doc.sel,clearTimeout(n.detectingSelectAll),a&&u>=9&&p(),M){Ar(r);var m=function(){pr(window,"mouseup",m),setTimeout(g,20)};vr(window,"mouseup",m)}else setTimeout(g,50)}function p(){if(null!=i.selectionStart){var r=e.somethingSelected(),o="​"+(r?i.value:"");i.value="⇚",i.value=o,t.prevInput=r?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=e.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&u<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=s),null!=i.selectionStart)){(!a||a&&u<9)&&p();var r=0,o=function(){n.selForContextMenu==e.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ni(e,fo)(e):r++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Qa.prototype.readOnlyChanged=function(r){r||this.reset(),this.textarea.disabled="nocursor"==r,this.textarea.readOnly=!!r},Qa.prototype.setUneditable=function(){},Qa.prototype.needsContentAttribute=!1,function(r){var t=r.optionHandlers;function e(e,n,i,o){r.defaults[e]=n,i&&(t[e]=o?function(r,t,e){e!=La&&i(r,t,e)}:i)}r.defineOption=e,r.Init=La,e("value","",(function(r,t){return r.setValue(t)}),!0),e("mode",null,(function(r,t){r.doc.modeOption=t,Bi(r)}),!0),e("indentUnit",2,Bi,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,(function(r){Ii(r),qe(r),vn(r)}),!0),e("lineSeparator",null,(function(r,t){if(r.doc.lineSep=t,t){var e=[],n=r.doc.first;r.doc.iter((function(r){for(var i=0;;){var o=r.text.indexOf(t,i);if(-1==o)break;i=o+t.length,e.push(nt(n,o))}n++}));for(var i=e.length-1;i>=0;i--)wo(r.doc,t,e[i],nt(e[i].line,e[i].ch+t.length))}})),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,t,e){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),e!=La&&r.refresh()})),e("specialCharPlaceholder",te,(function(r){return r.refresh()}),!0),e("electricChars",!0),e("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),e("spellcheck",!1,(function(r,t){return r.getInputField().spellcheck=t}),!0),e("autocorrect",!1,(function(r,t){return r.getInputField().autocorrect=t}),!0),e("autocapitalize",!1,(function(r,t){return r.getInputField().autocapitalize=t}),!0),e("rtlMoveVisually",!y),e("wholeLineUpdateBefore",!0),e("theme","default",(function(r){Aa(r),wi(r)}),!0),e("keyMap","default",(function(r,t,e){var n=ra(t),i=e!=La&&ra(e);i&&i.detach&&i.detach(r,n),n.attach&&n.attach(r,i||null)})),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,Ea,!0),e("gutters",[],(function(r,t){r.display.gutterSpecs=gi(t,r.options.lineNumbers),wi(r)}),!0),e("fixedGutter",!0,(function(r,t){r.display.gutters.style.left=t?sn(r.display)+"px":"0",r.refresh()}),!0),e("coverGutterNextToScrollbar",!1,(function(r){return $n(r)}),!0),e("scrollbarStyle","native",(function(r){Kn(r),$n(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),!0),e("lineNumbers",!1,(function(r,t){r.display.gutterSpecs=gi(r.options.gutters,t),wi(r)}),!0),e("firstLineNumber",1,wi,!0),e("lineNumberFormatter",(function(r){return r}),wi,!0),e("showCursorWhenSelecting",!1,wn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,(function(r,t){"nocursor"==t&&(Tn(r),r.display.input.blur()),r.display.input.readOnlyChanged(t)})),e("screenReaderLabel",null,(function(r,t){r.display.input.screenReaderLabelChanged(t=""===t?null:t)})),e("disableInput",!1,(function(r,t){t||r.display.input.reset()}),!0),e("dragDrop",!0,Na),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,wn,!0),e("singleCursorHeightPerLine",!0,wn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Ii,!0),e("addModeClass",!1,Ii,!0),e("pollInterval",100),e("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t})),e("historyEventDelay",1250),e("viewportMargin",10,(function(r){return r.refresh()}),!0),e("maxHighlightLength",1e4,Ii,!0),e("moveInputWithCursor",!0,(function(r,t){t||r.display.input.resetPosition()})),e("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""})),e("autofocus",null),e("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),!0),e("phrases",null)}(Da),function(r){var t=r.optionHandlers,e=r.helpers={};r.prototype={constructor:r,focus:function(){O(this).focus(),this.display.input.focus()},setOption:function(r,e){var n=this.options,i=n[r];n[r]==e&&"mode"!=r||(n[r]=e,t.hasOwnProperty(r)&&ni(this,t[r])(this,e,i),gr(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](ra(r))},removeKeyMap:function(r){for(var t=this.state.keyMaps,e=0;e<t.length;++e)if(t[e]==r||t[e].name==r)return t.splice(e,1),!0},addOverlay:ii((function(t,e){var n=t.token?t:r.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");(function(r,t,e){for(var n=0,i=e(t);n<r.length&&e(r[n])<=i;)n++;r.splice(n,0,t)})(this.state.overlays,{mode:n,modeSpec:t,opaque:e&&e.opaque,priority:e&&e.priority||0},(function(r){return r.priority})),this.state.modeGen++,vn(this)})),removeOverlay:ii((function(r){for(var t=this.state.overlays,e=0;e<t.length;++e){var n=t[e].modeSpec;if(n==r||"string"==typeof r&&n.name==r)return t.splice(e,1),this.state.modeGen++,void vn(this)}})),indentLine:ii((function(r,t,e){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),tt(this.doc,r)&&ja(this,r,t,e)})),indentSelection:ii((function(r){for(var t=this.doc.sel.ranges,e=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>e&&(ja(this,i.head.line,r,!0),e=i.head.line,n==this.doc.sel.primIndex&&Bn(this));else{var o=i.from(),a=i.to(),u=Math.max(e,o.line);e=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=u;l<e;++l)ja(this,l,r);var s=this.doc.sel.ranges;0==o.ch&&t.length==s.length&&s[n].from().ch>0&&ro(this.doc,n,new Si(o,s[n].to()),G)}}})),getTokenAt:function(r,t){return yt(this,r,t)},getLineTokens:function(r,t){return yt(this,nt(r),t,!0)},getTokenTypeAt:function(r){r=ct(this.doc,r);var t,e=mt(this,Qr(this.doc,r.line)),n=0,i=(e.length-1)/2,o=r.ch;if(0==o)t=e[2];else for(;;){var a=n+i>>1;if((a?e[2*a-1]:0)>=o)i=a;else{if(!(e[2*a+1]<o)){t=e[2*a+2];break}n=a+1}}var u=t?t.indexOf("overlay "):-1;return u<0?t:0==u?null:t.slice(0,u-1)},getModeAt:function(t){var e=this.doc.mode;return e.innerMode?r.innerMode(e,this.getTokenAt(t).state).mode:e},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var n=[];if(!e.hasOwnProperty(t))return n;var i=e[t],o=this.getModeAt(r);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var u=i[o[t][a]];u&&n.push(u)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var l=0;l<i._global.length;l++){var s=i._global[l];s.pred(o,this)&&-1==W(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(r,t){var e=this.doc;return pt(this,(r=st(e,null==r?e.first+e.size-1:r))+1,t).state},cursorCoords:function(r,t){var e=this.doc.sel.primary();return Qe(this,null==r?e.head:"object"==typeof r?ct(this.doc,r):r?e.from():e.to(),t||"page")},charCoords:function(r,t){return Ve(this,ct(this.doc,r),t||"page")},coordsChar:function(r,t){return Xe(this,(r=Ke(this,r,t||"page")).left,r.top)},lineAtHeight:function(r,t){return r=Ke(this,{top:r,left:0},t||"page").top,rt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,e){var n,i=!1;if("number"==typeof r){var o=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>o&&(r=o,i=!0),n=Qr(this.doc,r)}else n=r;return He(this,n,{top:0,left:0},t||"page",e||i).top+(i?this.doc.height-Ht(n):0)},defaultTextHeight:function(){return an(this.display)},defaultCharWidth:function(){return un(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,e,n,i){var o,a,u=this.display,l=(r=Qe(this,ct(this.doc,r))).bottom,s=r.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==n)l=r.top;else if("above"==n||"near"==n){var c=Math.max(u.wrapper.clientHeight,this.doc.height),f=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==n||r.bottom+t.offsetHeight>c)&&r.top>t.offsetHeight?l=r.top-t.offsetHeight:r.bottom+t.offsetHeight<=c&&(l=r.bottom),s+t.offsetWidth>f&&(s=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),e&&(null!=(a=zn(o=this,{left:s,top:l,right:s+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&On(o,a.scrollTop),null!=a.scrollLeft&&_n(o,a.scrollLeft))},triggerOnKeyDown:ii(va),triggerOnKeyPress:ii(pa),triggerOnKeyUp:ma,triggerOnMouseDown:ii(ka),execCommand:function(r){if(oa.hasOwnProperty(r))return oa[r].call(null,this)},triggerElectric:ii((function(r){Oa(this,r)})),findPosH:function(r,t,e,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ct(this.doc,r),a=0;a<t&&!(o=qa(this.doc,o,i,e,n)).hitSide;++a);return o},moveH:ii((function(r,t){var e=this;this.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?qa(e.doc,n.head,r,t,e.options.rtlMoveVisually):r<0?n.from():n.to()}),K)})),deleteH:ii((function(r,t){var e=this.doc;this.doc.sel.somethingSelected()?e.replaceSelection("",null,"+delete"):ta(this,(function(n){var i=qa(e,n.head,r,t,!1);return r<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(r,t,e,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=ct(this.doc,r),u=0;u<t;++u){var l=Qe(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Wa(this,l,i,e)).hitSide)break}return a},moveV:ii((function(r,t){var e=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return r<0?a.from():a.to();var u=Qe(e,a.head,"div");null!=a.goalColumn&&(u.left=a.goalColumn),i.push(u.left);var l=Wa(e,u,r,t);return"page"==t&&a==n.sel.primary()&&jn(e,Ve(e,l,"div").top-u.top),l}),K),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(r){var t=Qr(this.doc,r.line).text,e=r.ch,n=r.ch;if(t){var i=this.getHelper(r,"wordChars");"before"!=r.sticky&&n!=t.length||!e?++n:--e;for(var o=t.charAt(e),a=nr(o,i)?function(r){return nr(r,i)}:/\s/.test(o)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!nr(r)};e>0&&a(t.charAt(e-1));)--e;for(;n<t.length&&a(t.charAt(n));)++n}return new Si(nt(r.line,e),nt(r.line,n))},toggleOverwrite:function(r){null!=r&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),gr(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==j(F(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ii((function(r,t){In(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Te(this)-this.display.barHeight,width:r.scrollWidth-Te(this)-this.display.barWidth,clientHeight:Ee(this),clientWidth:Ne(this)}},scrollIntoView:ii((function(r,t){null==r?(r={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof r?r={from:nt(r,0),to:null}:null==r.from&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=t||0,null!=r.from.line?function(r,t){Rn(r),r.curOp.scrollToPos=t}(this,r):Fn(this,r.from,r.to,r.margin)})),setSize:ii((function(r,t){var e=this,n=function(r){return"number"==typeof r||/^\d+$/.test(String(r))?r+"px":r};null!=r&&(this.display.wrapper.style.width=n(r)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Pe(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(r){if(r.widgets)for(var t=0;t<r.widgets.length;t++)if(r.widgets[t].noHScroll){mn(e,i,"widget");break}++i})),this.curOp.forceUpdate=!0,gr(this,"refresh",this)})),operation:function(r){return ei(this,r)},startOperation:function(){return Qn(this)},endOperation:function(){return Jn(this)},refresh:ii((function(){var r=this.display.cachedTextHeight;vn(this),this.curOp.forceUpdate=!0,qe(this),In(this,this.doc.scrollLeft,this.doc.scrollTop),hi(this.display),(null==r||Math.abs(r-an(this.display))>.5||this.options.lineWrapping)&&fn(this),gr(this,"refresh",this)})),swapDoc:ii((function(r){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ui(this,r),qe(this),this.display.input.reset(),In(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ce(this,"swapDoc",this,t),t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},yr(r),r.registerHelper=function(t,n,i){e.hasOwnProperty(t)||(e[t]=r[t]={_global:[]}),e[t][n]=i},r.registerGlobalHelper=function(t,n,i,o){r.registerHelper(t,n,o),e[t]._global.push({pred:i,val:o})}}(Da);var Ja="iter insert remove copy getEditor constructor".split(" ");for(var Ya in Io.prototype)Io.prototype.hasOwnProperty(Ya)&&W(Ja,Ya)<0&&(Da.prototype[Ya]=function(r){return function(){return r.apply(this.doc,arguments)}}(Io.prototype[Ya]));return yr(Io),Da.inputStyles={textarea:Qa,contenteditable:$a},Da.defineMode=function(r){Da.defaults.mode||"null"==r||(Da.defaults.mode=r),_r.apply(this,arguments)},Da.defineMIME=function(r,t){Ur[r]=t},Da.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}})),Da.defineMIME("text/plain","null"),Da.defineExtension=function(r,t){Da.prototype[r]=t},Da.defineDocExtension=function(r,t){Io.prototype[r]=t},Da.fromTextArea=function(r,t){if((t=t?_(t):{}).value=r.value,!t.tabindex&&r.tabIndex&&(t.tabindex=r.tabIndex),!t.placeholder&&r.placeholder&&(t.placeholder=r.placeholder),null==t.autofocus){var e=j(r.ownerDocument);t.autofocus=e==r||null!=r.getAttribute("autofocus")&&e==document.body}function n(){r.value=u.getValue()}var i;if(r.form&&(vr(r.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=r.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(r){}}t.finishInit=function(e){e.save=n,e.getTextArea=function(){return r},e.toTextArea=function(){e.toTextArea=isNaN,n(),r.parentNode.removeChild(e.getWrapperElement()),r.style.display="",r.form&&(pr(r.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof r.form.submit||(r.form.submit=i))}},r.style.display="none";var u=Da((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return u},function(r){r.off=pr,r.on=vr,r.wheelEventPixels=Mi,r.Doc=Io,r.splitLines=Br,r.countColumn=P,r.findColumn=V,r.isWordChar=er,r.Pass=$,r.signal=gr,r.Line=Qt,r.changeEnd=Ei,r.scrollbarModel=Hn,r.Pos=nt,r.cmpPos=it,r.modes=Or,r.mimeModes=Ur,r.resolveMode=Pr,r.getMode=qr,r.modeExtensions=Wr,r.extendMode=$r,r.copyState=Gr,r.startState=Kr,r.innerMode=Hr,r.commands=oa,r.keyMap=Ko,r.keyName=Zo,r.isModifierKey=Yo,r.lookupKey=Jo,r.normalizeKeyMap=Qo,r.StringStream=Vr,r.SharedTextMarker=Do,r.TextMarker=No,r.LineWidget=Lo,r.e_preventDefault=xr,r.e_stopPropagation=Cr,r.e_stop=Ar,r.addClass=B,r.contains=z,r.rmClass=S,r.keyNames=Wo}(Da),Da.version="5.65.9",Da}()),s.exports}var f,d=a(c()),h={};function v(){return f||(f=1,function(r){function t(r){for(var t={},e=0;e<r.length;++e)t[r[e].toLowerCase()]=!0;return t}r.defineMode("css",(function(t,e){var n=e.inline;e.propertyKeywords||(e=r.resolveMode("text/css"));var i,o,a=t.indentUnit,u=e.tokenHooks,l=e.documentTypes||{},s=e.mediaTypes||{},c=e.mediaFeatures||{},f=e.mediaValueKeywords||{},d=e.propertyKeywords||{},h=e.nonStandardPropertyKeywords||{},v=e.fontProperties||{},m=e.counterDescriptors||{},p=e.colorKeywords||{},g=e.valueKeywords||{},b=e.allowNested,w=!0===e.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function y(r,t){return i=t,r}function x(r,t){var e=r.next();if(u[e]){var n=u[e](r,t);if(!1!==n)return n}return"@"==e?(r.eatWhile(/[\w\\\-]/),y("def",r.current())):"="==e||("~"==e||"|"==e)&&r.eat("=")?y(null,"compare"):'"'==e||"'"==e?(t.tokenize=C(e),t.tokenize(r,t)):"#"==e?(r.eatWhile(/[\w\\\-]/),y("atom","hash")):"!"==e?(r.match(/^\s*\w*/),y("keyword","important")):/\d/.test(e)||"."==e&&r.eat(/\d/)?(r.eatWhile(/[\w.%]/),y("number","unit")):"-"!==e?/[,+>*\/]/.test(e)?y(null,"select-op"):"."==e&&r.match(/^-?[_a-z][_a-z0-9-]*/i)?y("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(e)?y(null,e):r.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(r.current())&&(t.tokenize=M),y("variable callee","variable")):/[\w\\\-]/.test(e)?(r.eatWhile(/[\w\\\-]/),y("property","word")):y(null,null):/[\d.]/.test(r.peek())?(r.eatWhile(/[\w.%]/),y("number","unit")):r.match(/^-[\w\\\-]*/)?(r.eatWhile(/[\w\\\-]/),r.match(/^\s*:/,!1)?y("variable-2","variable-definition"):y("variable-2","variable")):r.match(/^\w+-/)?y("meta","meta"):void 0}function C(r){return function(t,e){for(var n,i=!1;null!=(n=t.next());){if(n==r&&!i){")"==r&&t.backUp(1);break}i=!i&&"\\"==n}return(n==r||!i&&")"!=r)&&(e.tokenize=null),y("string","string")}}function M(r,t){return r.next(),t.tokenize=r.match(/^\s*[\"\')]/,!1)?null:C(")"),y(null,"(")}function A(r,t,e){this.type=r,this.indent=t,this.prev=e}function L(r,t,e,n){return r.context=new A(e,t.indentation()+(!1===n?0:a),r.context),e}function S(r){return r.context.prev&&(r.context=r.context.prev),r.context.type}function T(r,t,e){return D[e.context.type](r,t,e)}function N(r,t,e,n){for(var i=n||1;i>0;i--)e.context=e.context.prev;return T(r,t,e)}function E(r){var t=r.current().toLowerCase();o=g.hasOwnProperty(t)?"atom":p.hasOwnProperty(t)?"keyword":"variable"}var D={top:function(r,t,e){if("{"==r)return L(e,t,"block");if("}"==r&&e.context.prev)return S(e);if(w&&/@component/i.test(r))return L(e,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(r))return L(e,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(r))return L(e,t,"atBlock");if(/^@(font-face|counter-style)/i.test(r))return e.stateArg=r,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(r))return"keyframes";if(r&&"@"==r.charAt(0))return L(e,t,"at");if("hash"==r)o="builtin";else if("word"==r)o="tag";else{if("variable-definition"==r)return"maybeprop";if("interpolation"==r)return L(e,t,"interpolation");if(":"==r)return"pseudo";if(b&&"("==r)return L(e,t,"parens")}return e.context.type},block:function(r,t,e){if("word"==r){var n=t.current().toLowerCase();return d.hasOwnProperty(n)?(o="property","maybeprop"):h.hasOwnProperty(n)?(o=k?"string-2":"property","maybeprop"):b?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==r?"block":b||"hash"!=r&&"qualifier"!=r?D.top(r,t,e):(o="error","block")},maybeprop:function(r,t,e){return":"==r?L(e,t,"prop"):T(r,t,e)},prop:function(r,t,e){if(";"==r)return S(e);if("{"==r&&b)return L(e,t,"propBlock");if("}"==r||"{"==r)return N(r,t,e);if("("==r)return L(e,t,"parens");if("hash"!=r||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==r)E(t);else if("interpolation"==r)return L(e,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(r,t,e){return"}"==r?S(e):"word"==r?(o="property","maybeprop"):e.context.type},parens:function(r,t,e){return"{"==r||"}"==r?N(r,t,e):")"==r?S(e):"("==r?L(e,t,"parens"):"interpolation"==r?L(e,t,"interpolation"):("word"==r&&E(t),"parens")},pseudo:function(r,t,e){return"meta"==r?"pseudo":"word"==r?(o="variable-3",e.context.type):T(r,t,e)},documentTypes:function(r,t,e){return"word"==r&&l.hasOwnProperty(t.current())?(o="tag",e.context.type):D.atBlock(r,t,e)},atBlock:function(r,t,e){if("("==r)return L(e,t,"atBlock_parens");if("}"==r||";"==r)return N(r,t,e);if("{"==r)return S(e)&&L(e,t,b?"block":"top");if("interpolation"==r)return L(e,t,"interpolation");if("word"==r){var n=t.current().toLowerCase();o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":f.hasOwnProperty(n)?"keyword":d.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?k?"string-2":"property":g.hasOwnProperty(n)?"atom":p.hasOwnProperty(n)?"keyword":"error"}return e.context.type},atComponentBlock:function(r,t,e){return"}"==r?N(r,t,e):"{"==r?S(e)&&L(e,t,b?"block":"top",!1):("word"==r&&(o="error"),e.context.type)},atBlock_parens:function(r,t,e){return")"==r?S(e):"{"==r||"}"==r?N(r,t,e,2):D.atBlock(r,t,e)},restricted_atBlock_before:function(r,t,e){return"{"==r?L(e,t,"restricted_atBlock"):"word"==r&&"@counter-style"==e.stateArg?(o="variable","restricted_atBlock_before"):T(r,t,e)},restricted_atBlock:function(r,t,e){return"}"==r?(e.stateArg=null,S(e)):"word"==r?(o="@font-face"==e.stateArg&&!v.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==e.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(r,t,e){return"word"==r?(o="variable","keyframes"):"{"==r?L(e,t,"top"):T(r,t,e)},at:function(r,t,e){return";"==r?S(e):"{"==r||"}"==r?N(r,t,e):("word"==r?o="tag":"hash"==r&&(o="builtin"),"at")},interpolation:function(r,t,e){return"}"==r?S(e):"{"==r||";"==r?N(r,t,e):("word"==r?o="variable":"variable"!=r&&"("!=r&&")"!=r&&(o="error"),"interpolation")}};return{startState:function(r){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new A(n?"block":"top",r||0,null)}},token:function(r,t){if(!t.tokenize&&r.eatSpace())return null;var e=(t.tokenize||x)(r,t);return e&&"object"==typeof e&&(i=e[1],e=e[0]),o=e,"comment"!=i&&(t.state=D[t.state](i,r,t)),o},indent:function(r,t){var e=r.context,n=t&&t.charAt(0),i=e.indent;return"prop"!=e.type||"}"!=n&&")"!=n||(e=e.prev),e.prev&&("}"!=n||"block"!=e.type&&"top"!=e.type&&"interpolation"!=e.type&&"restricted_atBlock"!=e.type?(")"!=n||"parens"!=e.type&&"atBlock_parens"!=e.type)&&("{"!=n||"at"!=e.type&&"atBlock"!=e.type)||(i=Math.max(0,e.indent-a)):i=(e=e.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:e.lineComment,fold:"brace"}}));var e=["domain","regexp","url","url-prefix"],n=t(e),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],u=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],s=t(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(c),d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(d),v=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),p=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],g=t(p),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=t(b),k=e.concat(i).concat(a).concat(l).concat(c).concat(d).concat(p).concat(b);function y(r,t){for(var e,n=!1;null!=(e=r.next());){if(n&&"/"==e){t.tokenize=null;break}n="*"==e}return["comment","comment"]}r.registerHelper("hintWords","css",k),r.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:u,mediaValueKeywords:s,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:v,counterDescriptors:m,colorKeywords:g,valueKeywords:w,tokenHooks:{"/":function(r,t){return!!r.eat("*")&&(t.tokenize=y,y(r,t))}},name:"css"}),r.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:s,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:g,valueKeywords:w,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(r,t){return r.eat("/")?(r.skipToEnd(),["comment","comment"]):r.eat("*")?(t.tokenize=y,y(r,t)):["operator","operator"]},":":function(r){return!!r.match(/^\s*\{/,!1)&&[null,null]},$:function(r){return r.match(/^[\w-]+/),r.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(r){return!!r.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),r.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:s,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:g,valueKeywords:w,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(r,t){return r.eat("/")?(r.skipToEnd(),["comment","comment"]):r.eat("*")?(t.tokenize=y,y(r,t)):["operator","operator"]},"@":function(r){return r.eat("{")?[null,"interpolation"]:!r.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(r.eatWhile(/[\w\\\-]/),r.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),r.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:u,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:v,counterDescriptors:m,colorKeywords:g,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(r,t){return!!r.eat("*")&&(t.tokenize=y,y(r,t))}},name:"css",helperType:"gss"})}(c())),h}v();var m;var p,g,b,w,k,y={};function x(){return p||(p=1,function(r){r.defineMode("javascript",(function(t,e){var n,i,o=t.indentUnit,a=e.statementIndent,u=e.jsonld,l=e.json||u,s=!1!==e.trackScope,c=e.typescript,f=e.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),e=r("keyword b"),n=r("keyword c"),i=r("keyword d"),o=r("operator"),a={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:e,do:e,try:e,finally:e,return:i,break:i,continue:i,new:r("new"),delete:n,void:n,throw:n,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:r("this"),class:r("class"),super:r("atom"),yield:n,export:r("export"),import:r("import"),extends:n,await:n}}(),h=/[+\-*&%=<>!?|~^@]/,v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(r,t,e){return n=r,i=e,t}function p(r,t){var e,n=r.next();if('"'==n||"'"==n)return t.tokenize=(e=n,function(r,t){var n,i=!1;if(u&&"@"==r.peek()&&r.match(v))return t.tokenize=p,m("jsonld-keyword","meta");for(;null!=(n=r.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(t.tokenize=p),m("string","string")}),t.tokenize(r,t);if("."==n&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&r.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&r.eat(">"))return m("=>","operator");if("0"==n&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return r.eat("*")?(t.tokenize=g,g(r,t)):r.eat("/")?(r.skipToEnd(),m("comment","comment")):Zr(r,t,1)?(function(r){for(var t,e=!1,n=!1;null!=(t=r.next());){if(!e){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}e=!e&&"\\"==t}}(r),r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(r.eat("="),m("operator","operator",r.current()));if("`"==n)return t.tokenize=b,b(r,t);if("#"==n&&"!"==r.peek())return r.skipToEnd(),m("meta","meta");if("#"==n&&r.eatWhile(f))return m("variable","property");if("<"==n&&r.match("!--")||"-"==n&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start)))return r.skipToEnd(),m("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(r.eat("=")?"!"!=n&&"="!=n||r.eat("="):/[<>*+\-|&?]/.test(n)&&(r.eat(n),">"==n&&r.eat(n))),"?"==n&&r.eat(".")?m("."):m("operator","operator",r.current());if(f.test(n)){r.eatWhile(f);var i=r.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return m(o.type,o.style,i)}if("async"==i&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",i)}return m("variable","variable",i)}}function g(r,t){for(var e,n=!1;e=r.next();){if("/"==e&&n){t.tokenize=p;break}n="*"==e}return m("comment","comment")}function b(r,t){for(var e,n=!1;null!=(e=r.next());){if(!n&&("`"==e||"$"==e&&r.eat("{"))){t.tokenize=p;break}n=!n&&"\\"==e}return m("quasi","string-2",r.current())}function w(r,t){t.fatArrowAt&&(t.fatArrowAt=null);var e=r.string.indexOf("=>",r.start);if(!(e<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,e));n&&(e=n.index)}for(var i=0,o=!1,a=e-1;a>=0;--a){var u=r.string.charAt(a),l="([{}])".indexOf(u);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==u&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(f.test(u))o=!0;else if(/["'\/`]/.test(u))for(;;--a){if(0==a)return;if(r.string.charAt(a-1)==u&&"\\"!=r.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function y(r,t,e,n,i,o){this.indented=r,this.column=t,this.type=e,this.prev=i,this.info=o,null!=n&&(this.align=n)}function x(r,t){if(!s)return!1;for(var e=r.localVars;e;e=e.next)if(e.name==t)return!0;for(var n=r.context;n;n=n.prev)for(e=n.vars;e;e=e.next)if(e.name==t)return!0}function C(r,t,e,n,i){var o=r.cc;for(M.state=r,M.stream=i,M.marked=null,M.cc=o,M.style=t,r.lexical.hasOwnProperty("align")||(r.lexical.align=!0);;)if((o.length?o.pop():l?q:_)(e,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return M.marked?M.marked:"variable"==e&&x(r,n)?"variable-2":t}}var M={state:null,marked:null,cc:null};function A(){for(var r=arguments.length-1;r>=0;r--)M.cc.push(arguments[r])}function L(){return A.apply(null,arguments),!0}function S(r,t){for(var e=t;e;e=e.next)if(e.name==r)return!0;return!1}function T(r){var t=M.state;if(M.marked="def",s){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=N(r,t.context);if(null!=n)return void(t.context=n)}else if(!S(r,t.localVars))return void(t.localVars=new z(r,t.localVars));e.globalVars&&!S(r,t.globalVars)&&(t.globalVars=new z(r,t.globalVars))}}function N(r,t){if(t){if(t.block){var e=N(r,t.prev);return e?e==t.prev?t:new D(e,t.vars,!0):null}return S(r,t.vars)?t:new D(t.prev,new z(r,t.vars),!1)}return null}function E(r){return"public"==r||"private"==r||"protected"==r||"abstract"==r||"readonly"==r}function D(r,t,e){this.prev=r,this.vars=t,this.block=e}function z(r,t){this.name=r,this.next=t}var j=new z("this",new z("arguments",null));function B(){M.state.context=new D(M.state.context,M.state.localVars,!1),M.state.localVars=j}function I(){M.state.context=new D(M.state.context,M.state.localVars,!0),M.state.localVars=null}function R(){M.state.localVars=M.state.context.vars,M.state.context=M.state.context.prev}function F(r,t){var e=function(){var e=M.state,n=e.indented;if("stat"==e.lexical.type)n=e.lexical.indented;else for(var i=e.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;e.lexical=new y(n,M.stream.column(),r,null,e.lexical,t)};return e.lex=!0,e}function O(){var r=M.state;r.lexical.prev&&(")"==r.lexical.type&&(r.indented=r.lexical.indented),r.lexical=r.lexical.prev)}function U(r){return function t(e){return e==r?L():";"==r||"}"==e||")"==e||"]"==e?A():L(t)}}function _(r,t){return"var"==r?L(F("vardef",t),Mr,U(";"),O):"keyword a"==r?L(F("form"),$,_,O):"keyword b"==r?L(F("form"),_,O):"keyword d"==r?M.stream.match(/^\s*$/,!1)?L():L(F("stat"),H,U(";"),O):"debugger"==r?L(U(";")):"{"==r?L(F("}"),I,lr,O,R):";"==r?L():"if"==r?("else"==M.state.lexical.info&&M.state.cc[M.state.cc.length-1]==O&&M.state.cc.pop()(),L(F("form"),$,_,O,Er)):"function"==r?L(Br):"for"==r?L(F("form"),I,Dr,_,R,O):"class"==r||c&&"interface"==t?(M.marked="keyword",L(F("form","class"==r?r:t),Ur,O)):"variable"==r?c&&"declare"==t?(M.marked="keyword",L(_)):c&&("module"==t||"enum"==t||"type"==t)&&M.stream.match(/^\s*\w/,!1)?(M.marked="keyword","enum"==t?L(Yr):"type"==t?L(Rr,U("operator"),hr,U(";")):L(F("form"),Ar,U("{"),F("}"),lr,O,O)):c&&"namespace"==t?(M.marked="keyword",L(F("form"),q,_,O)):c&&"abstract"==t?(M.marked="keyword",L(_)):L(F("stat"),tr):"switch"==r?L(F("form"),$,U("{"),F("}","switch"),I,lr,O,O,R):"case"==r?L(q,U(":")):"default"==r?L(U(":")):"catch"==r?L(F("form"),B,P,_,O,R):"export"==r?L(F("stat"),Wr,O):"import"==r?L(F("stat"),Gr,O):"async"==r?L(_):"@"==t?L(q,_):A(F("stat"),q,U(";"),O)}function P(r){if("("==r)return L(Fr,U(")"))}function q(r,t){return G(r,t,!1)}function W(r,t){return G(r,t,!0)}function $(r){return"("!=r?A():L(F(")"),H,U(")"),O)}function G(r,t,e){if(M.state.fatArrowAt==M.stream.start){var n=e?X:Y;if("("==r)return L(B,F(")"),ar(Fr,")"),O,U("=>"),n,R);if("variable"==r)return A(B,Ar,U("=>"),n,R)}var i=e?V:K;return k.hasOwnProperty(r)?L(i):"function"==r?L(Br,i):"class"==r||c&&"interface"==t?(M.marked="keyword",L(F("form"),Or,O)):"keyword c"==r||"async"==r?L(e?W:q):"("==r?L(F(")"),H,U(")"),O,i):"operator"==r||"spread"==r?L(e?W:q):"["==r?L(F("]"),Jr,O,i):"{"==r?ur(nr,"}",null,i):"quasi"==r?A(Q,i):"new"==r?L(function(r){return function(t){return"."==t?L(r?rr:Z):"variable"==t&&c?L(yr,r?V:K):A(r?W:q)}}(e)):L()}function H(r){return r.match(/[;\}\)\],]/)?A():A(q)}function K(r,t){return","==r?L(H):V(r,t,!1)}function V(r,t,e){var n=0==e?K:V,i=0==e?q:W;return"=>"==r?L(B,e?X:Y,R):"operator"==r?/\+\+|--/.test(t)||c&&"!"==t?L(n):c&&"<"==t&&M.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?L(F(">"),ar(hr,">"),O,n):"?"==t?L(q,U(":"),i):L(i):"quasi"==r?A(Q,n):";"!=r?"("==r?ur(W,")","call",n):"."==r?L(er,n):"["==r?L(F("]"),H,U("]"),O,n):c&&"as"==t?(M.marked="keyword",L(hr,n)):"regexp"==r?(M.state.lastType=M.marked="operator",M.stream.backUp(M.stream.pos-M.stream.start-1),L(i)):void 0:void 0}function Q(r,t){return"quasi"!=r?A():"${"!=t.slice(t.length-2)?L(Q):L(H,J)}function J(r){if("}"==r)return M.marked="string-2",M.state.tokenize=b,L(Q)}function Y(r){return w(M.stream,M.state),A("{"==r?_:q)}function X(r){return w(M.stream,M.state),A("{"==r?_:W)}function Z(r,t){if("target"==t)return M.marked="keyword",L(K)}function rr(r,t){if("target"==t)return M.marked="keyword",L(V)}function tr(r){return":"==r?L(O,_):A(K,U(";"),O)}function er(r){if("variable"==r)return M.marked="property",L()}function nr(r,t){return"async"==r?(M.marked="property",L(nr)):"variable"==r||"keyword"==M.style?(M.marked="property","get"==t||"set"==t?L(ir):(c&&M.state.fatArrowAt==M.stream.start&&(e=M.stream.match(/^\s*:\s*/,!1))&&(M.state.fatArrowAt=M.stream.pos+e[0].length),L(or))):"number"==r||"string"==r?(M.marked=u?"property":M.style+" property",L(or)):"jsonld-keyword"==r?L(or):c&&E(t)?(M.marked="keyword",L(nr)):"["==r?L(q,sr,U("]"),or):"spread"==r?L(W,or):"*"==t?(M.marked="keyword",L(nr)):":"==r?A(or):void 0;var e}function ir(r){return"variable"!=r?A(or):(M.marked="property",L(Br))}function or(r){return":"==r?L(W):"("==r?A(Br):void 0}function ar(r,t,e){function n(i,o){if(e?e.indexOf(i)>-1:","==i){var a=M.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),L((function(e,n){return e==t||n==t?A():A(r)}),n)}return i==t||o==t?L():e&&e.indexOf(";")>-1?A(r):L(U(t))}return function(e,i){return e==t||i==t?L():A(r,n)}}function ur(r,t,e){for(var n=3;n<arguments.length;n++)M.cc.push(arguments[n]);return L(F(t,e),ar(r,t),O)}function lr(r){return"}"==r?L():A(_,lr)}function sr(r,t){if(c){if(":"==r)return L(hr);if("?"==t)return L(sr)}}function cr(r,t){if(c&&(":"==r||"in"==t))return L(hr)}function fr(r){if(c&&":"==r)return M.stream.match(/^\s*\w+\s+is\b/,!1)?L(q,dr,hr):L(hr)}function dr(r,t){if("is"==t)return M.marked="keyword",L()}function hr(r,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(M.marked="keyword",L("typeof"==t?W:hr)):"variable"==r||"void"==t?(M.marked="type",L(kr)):"|"==t||"&"==t?L(hr):"string"==r||"number"==r||"atom"==r?L(kr):"["==r?L(F("]"),ar(hr,"]",","),O,kr):"{"==r?L(F("}"),mr,O,kr):"("==r?L(ar(wr,")"),vr,kr):"<"==r?L(ar(hr,">"),hr):"quasi"==r?A(gr,kr):void 0}function vr(r){if("=>"==r)return L(hr)}function mr(r){return r.match(/[\}\)\]]/)?L():","==r||";"==r?L(mr):A(pr,mr)}function pr(r,t){return"variable"==r||"keyword"==M.style?(M.marked="property",L(pr)):"?"==t||"number"==r||"string"==r?L(pr):":"==r?L(hr):"["==r?L(U("variable"),cr,U("]"),pr):"("==r?A(Ir,pr):r.match(/[;\}\)\],]/)?void 0:L()}function gr(r,t){return"quasi"!=r?A():"${"!=t.slice(t.length-2)?L(gr):L(hr,br)}function br(r){if("}"==r)return M.marked="string-2",M.state.tokenize=b,L(gr)}function wr(r,t){return"variable"==r&&M.stream.match(/^\s*[?:]/,!1)||"?"==t?L(wr):":"==r?L(hr):"spread"==r?L(wr):A(hr)}function kr(r,t){return"<"==t?L(F(">"),ar(hr,">"),O,kr):"|"==t||"."==r||"&"==t?L(hr):"["==r?L(hr,U("]"),kr):"extends"==t||"implements"==t?(M.marked="keyword",L(hr)):"?"==t?L(hr,U(":"),hr):void 0}function yr(r,t){if("<"==t)return L(F(">"),ar(hr,">"),O,kr)}function xr(){return A(hr,Cr)}function Cr(r,t){if("="==t)return L(hr)}function Mr(r,t){return"enum"==t?(M.marked="keyword",L(Yr)):A(Ar,sr,Tr,Nr)}function Ar(r,t){return c&&E(t)?(M.marked="keyword",L(Ar)):"variable"==r?(T(t),L()):"spread"==r?L(Ar):"["==r?ur(Sr,"]"):"{"==r?ur(Lr,"}"):void 0}function Lr(r,t){return"variable"!=r||M.stream.match(/^\s*:/,!1)?("variable"==r&&(M.marked="property"),"spread"==r?L(Ar):"}"==r?A():"["==r?L(q,U("]"),U(":"),Lr):L(U(":"),Ar,Tr)):(T(t),L(Tr))}function Sr(){return A(Ar,Tr)}function Tr(r,t){if("="==t)return L(W)}function Nr(r){if(","==r)return L(Mr)}function Er(r,t){if("keyword b"==r&&"else"==t)return L(F("form","else"),_,O)}function Dr(r,t){return"await"==t?L(Dr):"("==r?L(F(")"),zr,O):void 0}function zr(r){return"var"==r?L(Mr,jr):"variable"==r?L(jr):A(jr)}function jr(r,t){return")"==r?L():";"==r?L(jr):"in"==t||"of"==t?(M.marked="keyword",L(q,jr)):A(q,jr)}function Br(r,t){return"*"==t?(M.marked="keyword",L(Br)):"variable"==r?(T(t),L(Br)):"("==r?L(B,F(")"),ar(Fr,")"),O,fr,_,R):c&&"<"==t?L(F(">"),ar(xr,">"),O,Br):void 0}function Ir(r,t){return"*"==t?(M.marked="keyword",L(Ir)):"variable"==r?(T(t),L(Ir)):"("==r?L(B,F(")"),ar(Fr,")"),O,fr,R):c&&"<"==t?L(F(">"),ar(xr,">"),O,Ir):void 0}function Rr(r,t){return"keyword"==r||"variable"==r?(M.marked="type",L(Rr)):"<"==t?L(F(">"),ar(xr,">"),O):void 0}function Fr(r,t){return"@"==t&&L(q,Fr),"spread"==r?L(Fr):c&&E(t)?(M.marked="keyword",L(Fr)):c&&"this"==r?L(sr,Tr):A(Ar,sr,Tr)}function Or(r,t){return"variable"==r?Ur(r,t):_r(r,t)}function Ur(r,t){if("variable"==r)return T(t),L(_r)}function _r(r,t){return"<"==t?L(F(">"),ar(xr,">"),O,_r):"extends"==t||"implements"==t||c&&","==r?("implements"==t&&(M.marked="keyword"),L(c?hr:q,_r)):"{"==r?L(F("}"),Pr,O):void 0}function Pr(r,t){return"async"==r||"variable"==r&&("static"==t||"get"==t||"set"==t||c&&E(t))&&M.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(M.marked="keyword",L(Pr)):"variable"==r||"keyword"==M.style?(M.marked="property",L(qr,Pr)):"number"==r||"string"==r?L(qr,Pr):"["==r?L(q,sr,U("]"),qr,Pr):"*"==t?(M.marked="keyword",L(Pr)):c&&"("==r?A(Ir,Pr):";"==r||","==r?L(Pr):"}"==r?L():"@"==t?L(q,Pr):void 0}function qr(r,t){if("!"==t)return L(qr);if("?"==t)return L(qr);if(":"==r)return L(hr,Tr);if("="==t)return L(W);var e=M.state.lexical.prev;return A(e&&"interface"==e.info?Ir:Br)}function Wr(r,t){return"*"==t?(M.marked="keyword",L(Qr,U(";"))):"default"==t?(M.marked="keyword",L(q,U(";"))):"{"==r?L(ar($r,"}"),Qr,U(";")):A(_)}function $r(r,t){return"as"==t?(M.marked="keyword",L(U("variable"))):"variable"==r?A(W,$r):void 0}function Gr(r){return"string"==r?L():"("==r?A(q):"."==r?A(K):A(Hr,Kr,Qr)}function Hr(r,t){return"{"==r?ur(Hr,"}"):("variable"==r&&T(t),"*"==t&&(M.marked="keyword"),L(Vr))}function Kr(r){if(","==r)return L(Hr,Kr)}function Vr(r,t){if("as"==t)return M.marked="keyword",L(Hr)}function Qr(r,t){if("from"==t)return M.marked="keyword",L(q)}function Jr(r){return"]"==r?L():A(ar(W,"]"))}function Yr(){return A(F("form"),Ar,U("{"),F("}"),ar(Xr,"}"),O,O)}function Xr(){return A(Ar,Tr)}function Zr(r,t,e){return t.tokenize==p&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(r.string.slice(0,r.pos-(e||0)))}return B.lex=I.lex=!0,R.lex=!0,O.lex=!0,{startState:function(r){var t={tokenize:p,lastType:"sof",cc:[],lexical:new y((r||0)-o,0,"block",!1),localVars:e.localVars,context:e.localVars&&new D(null,null,!1),indented:r||0};return e.globalVars&&"object"==typeof e.globalVars&&(t.globalVars=e.globalVars),t},token:function(r,t){if(r.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=r.indentation(),w(r,t)),t.tokenize!=g&&r.eatSpace())return null;var e=t.tokenize(r,t);return"comment"==n?e:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",C(t,e,n,i,r))},indent:function(t,n){if(t.tokenize==g||t.tokenize==b)return r.Pass;if(t.tokenize!=p)return 0;var i,u=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==O)l=l.prev;else if(c!=Er&&c!=R)break}for(;("stat"==l.type||"form"==l.type)&&("}"==u||(i=t.cc[t.cc.length-1])&&(i==K||i==V)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,d=u==f;return"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==f&&"{"==u?l.indented:"form"==f?l.indented+o:"stat"==f?l.indented+(function(r,t){return"operator"==r.lastType||","==r.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?a||o:0):"switch"!=l.info||d||0==e.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:o):l.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:u,jsonMode:l,expressionAllowed:Zr,skipExpression:function(t){C(t,"atom","atom","true",new r.StringStream("",2,null))}}})),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(c())),y}g||(g=1,function(r){var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var e={};function n(r,t){var n=r.match(function(r){return e[r]||(e[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(r,t){return new RegExp((t?"^":"")+"</\\s*"+r+"\\s*>","i")}function o(r,t){for(var e in r)for(var n=t[e]||(t[e]=[]),i=r[e],o=i.length-1;o>=0;o--)n.unshift(i[o])}r.defineMode("htmlmixed",(function(e,a){var u=r.getMode(e,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag,allowMissingTagName:a.allowMissingTagName}),l={},s=a&&a.tags,c=a&&a.scriptTypes;if(o(t,l),s&&o(s,l),c)for(var f=c.length-1;f>=0;f--)l.script.unshift(["type",c[f].matches,c[f].mode]);function d(t,o){var a,s=u.token(t,o.htmlState),c=/\btag\b/.test(s);if(c&&!/[<>\s\/]/.test(t.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&c&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==t.current()&&function(r,t){for(var e=0;e<r.length;e++){var i=r[e];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}(l[f[1]],f[2]),v=r.getMode(e,h),m=i(f[1],!0),p=i(f[1],!1);o.token=function(r,t){return r.match(m,!1)?(t.token=d,t.localState=t.localMode=null,null):function(r,t,e){var n=r.current(),i=n.search(t);return i>-1?r.backUp(n.length-i):n.match(/<\/?$/)&&(r.backUp(n.length),r.match(t,!1)||r.match(n)),e}(r,p,t.localMode.token(r,t.localState))},o.localMode=v,o.localState=r.startState(v,u.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return s}return{startState:function(){return{token:d,inTag:null,localMode:null,localState:null,htmlState:r.startState(u)}},copyState:function(t){var e;return t.localState&&(e=r.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:e,htmlState:r.copyState(u,t.htmlState)}},token:function(r,t){return t.token(r,t)},indent:function(t,e,n){return!t.localMode||/^\s*<\//.test(e)?u.indent(t.htmlState,e,n):t.localMode.indent?t.localMode.indent(t.localState,e,n):r.Pass},innerMode:function(r){return{state:r.localState||r.htmlState,mode:r.localMode||u}}}}),"xml","javascript","css"),r.defineMIME("text/html","htmlmixed")}(c(),m||(m=1,function(r){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},e={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};r.defineMode("xml",(function(n,i){var o,a,u=n.indentUnit,l={},s=i.htmlMode?t:e;for(var c in s)l[c]=s[c];for(var c in i)l[c]=i[c];function f(r,t){function e(e){return t.tokenize=e,e(r,t)}var n=r.next();return"<"==n?r.eat("!")?r.eat("[")?r.match("CDATA[")?e(h("atom","]]>")):null:r.match("--")?e(h("comment","--\x3e")):r.match("DOCTYPE",!0,!0)?(r.eatWhile(/[\w\._\-]/),e(v(1))):null:r.eat("?")?(r.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=r.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==n?(r.eat("#")?r.eat("x")?r.eatWhile(/[a-fA-F\d]/)&&r.eat(";"):r.eatWhile(/[\d]/)&&r.eat(";"):r.eatWhile(/[\w\.\-:]/)&&r.eat(";"))?"atom":"error":(r.eatWhile(/[^&<]/),null)}function d(r,t){var e,n,i=r.next();if(">"==i||"/"==i&&r.eat(">"))return t.tokenize=f,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=f,t.state=w,t.tagName=t.tagStart=null;var a=t.tokenize(r,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(e=i,n=function(r,t){for(;!r.eol();)if(r.next()==e){t.tokenize=d;break}return"string"},n.isInAttribute=!0,n),t.stringStartCol=r.column(),t.tokenize(r,t)):(r.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(r,t){return function(e,n){for(;!e.eol();){if(e.match(t)){n.tokenize=f;break}e.next()}return r}}function v(r){return function(t,e){for(var n;null!=(n=t.next());){if("<"==n)return e.tokenize=v(r+1),e.tokenize(t,e);if(">"==n){if(1==r){e.tokenize=f;break}return e.tokenize=v(r-1),e.tokenize(t,e)}}return"meta"}}function m(r){return r&&r.toLowerCase()}function p(r,t,e){this.prev=r.context,this.tagName=t||"",this.indent=r.indented,this.startOfLine=e,(l.doNotIndent.hasOwnProperty(t)||r.context&&r.context.noIndent)&&(this.noIndent=!0)}function g(r){r.context&&(r.context=r.context.prev)}function b(r,t){for(var e;;){if(!r.context)return;if(!l.contextGrabbers.hasOwnProperty(m(e=r.context.tagName))||!l.contextGrabbers[m(e)].hasOwnProperty(m(t)))return;g(r)}}function w(r,t,e){return"openTag"==r?(e.tagStart=t.column(),k):"closeTag"==r?y:w}function k(r,t,e){return"word"==r?(e.tagName=t.current(),a="tag",M):l.allowMissingTagName&&"endTag"==r?(a="tag bracket",M(r,0,e)):(a="error",k)}function y(r,t,e){if("word"==r){var n=t.current();return e.context&&e.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(m(e.context.tagName))&&g(e),e.context&&e.context.tagName==n||!1===l.matchClosing?(a="tag",x):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==r?(a="tag bracket",x(r,0,e)):(a="error",C)}function x(r,t,e){return"endTag"!=r?(a="error",x):(g(e),w)}function C(r,t,e){return a="error",x(r,0,e)}function M(r,t,e){if("word"==r)return a="attribute",A;if("endTag"==r||"selfcloseTag"==r){var n=e.tagName,i=e.tagStart;return e.tagName=e.tagStart=null,"selfcloseTag"==r||l.autoSelfClosers.hasOwnProperty(m(n))?b(e,n):(b(e,n),e.context=new p(e,n,i==e.indented)),w}return a="error",M}function A(r,t,e){return"equals"==r?L:(l.allowMissing||(a="error"),M(r,0,e))}function L(r,t,e){return"string"==r?S:"word"==r&&l.allowUnquoted?(a="string",M):(a="error",M(r,0,e))}function S(r,t,e){return"string"==r?S:M(r,0,e)}return f.isInText=!0,{startState:function(r){var t={tokenize:f,state:w,indented:r||0,tagName:null,tagStart:null,context:null};return null!=r&&(t.baseIndent=r),t},token:function(r,t){if(!t.tagName&&r.sol()&&(t.indented=r.indentation()),r.eatSpace())return null;o=null;var e=t.tokenize(r,t);return(e||o)&&"comment"!=e&&(a=null,t.state=t.state(o||e,r,t),a&&(e="error"==a?e+" error":a)),e},indent:function(t,e,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+u;if(i&&i.noIndent)return r.Pass;if(t.tokenize!=d&&t.tokenize!=f)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+u*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(e))return 0;var o=e&&/^<(\/)?([\w_:\.-]*)/.exec(e);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(m(i.tagName)))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[m(i.tagName)];if(!a||!a.hasOwnProperty(m(o[2])))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+u:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(r){r.state==L&&(r.state=M)},xmlCurrentTag:function(r){return r.tagName?{name:r.tagName,close:"closeTag"==r.type}:null},xmlCurrentContext:function(r){for(var t=[],e=r.context;e;e=e.prev)t.push(e.tagName);return t.reverse()}}})),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})}(c())),x(),v())),x(),b||(b=1,function(r){r.defineMode("jinja2",(function(){var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],t=/^[+\-*&%=<>!?|~^]/,e=/^[:\[\(\{]/,n=["true","false"],i=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function o(o,a){var u=o.peek();if(a.incomment)return o.skipTo("#}")?(o.eatWhile(/\#|}/),a.incomment=!1):o.skipToEnd(),"comment";if(a.intag){if(a.operator){if(a.operator=!1,o.match(n))return"atom";if(o.match(i))return"number"}if(a.sign){if(a.sign=!1,o.match(n))return"atom";if(o.match(i))return"number"}if(a.instring)return u==a.instring&&(a.instring=!1),o.next(),"string";if("'"==u||'"'==u)return a.instring=u,o.next(),"string";if(a.inbraces>0&&")"==u)o.next(),a.inbraces--;else if("("==u)o.next(),a.inbraces++;else if(a.inbrackets>0&&"]"==u)o.next(),a.inbrackets--;else if("["==u)o.next(),a.inbrackets++;else{if(!a.lineTag&&(o.match(a.intag+"}")||o.eat("-")&&o.match(a.intag+"}")))return a.intag=!1,"tag";if(o.match(t))return a.operator=!0,"operator";if(o.match(e))a.sign=!0;else{if(1==o.column()&&a.lineTag&&o.match(r))return"keyword";if(o.eat(" ")||o.sol()){if(o.match(r))return"keyword";if(o.match(n))return"atom";if(o.match(i))return"number";o.sol()&&o.next()}else o.next()}}return"variable"}if(o.eat("{")){if(o.eat("#"))return a.incomment=!0,o.skipTo("#}")?(o.eatWhile(/\#|}/),a.incomment=!1):o.skipToEnd(),"comment";if(u=o.eat(/\{|%/))return a.intag=u,a.inbraces=0,a.inbrackets=0,"{"==u&&(a.intag="}"),o.eat("-"),"tag"}else if(o.eat("#")){if("#"==o.peek())return o.skipToEnd(),"comment";if(!o.eol())return a.intag=!0,a.lineTag=!0,a.inbraces=0,a.inbrackets=0,"tag"}o.next()}return r=new RegExp("(("+r.join(")|(")+"))\\b"),n=new RegExp("(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(r,t){var e=t.tokenize(r,t);return r.eol()&&t.lineTag&&!t.instring&&0==t.inbraces&&0==t.inbrackets&&(t.intag=!1,t.lineTag=!1),e},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}})),r.defineMIME("text/jinja2","jinja2")}(c())),w||(w=1,function(r){var t="CodeMirror-activeline",e="CodeMirror-activeline-background",n="CodeMirror-activeline-gutter";function i(r){for(var i=0;i<r.state.activeLines.length;i++)r.removeLineClass(r.state.activeLines[i],"wrap",t),r.removeLineClass(r.state.activeLines[i],"background",e),r.removeLineClass(r.state.activeLines[i],"gutter",n)}function o(r,o){for(var a=[],u=0;u<o.length;u++){var l=o[u],s=r.getOption("styleActiveLine");if("object"==typeof s&&s.nonEmpty?l.anchor.line==l.head.line:l.empty()){var c=r.getLineHandleVisualStart(l.head.line);a[a.length-1]!=c&&a.push(c)}}(function(r,t){if(r.length!=t.length)return!1;for(var e=0;e<r.length;e++)if(r[e]!=t[e])return!1;return!0})(r.state.activeLines,a)||r.operation((function(){i(r);for(var o=0;o<a.length;o++)r.addLineClass(a[o],"wrap",t),r.addLineClass(a[o],"background",e),r.addLineClass(a[o],"gutter",n);r.state.activeLines=a}))}function a(r,t){o(r,t.ranges)}r.defineOption("styleActiveLine",!1,(function(t,e,n){var u=n!=r.Init&&n;e!=u&&(u&&(t.off("beforeSelectionChange",a),i(t),delete t.state.activeLines),e&&(t.state.activeLines=[],o(t,t.listSelections()),t.on("beforeSelectionChange",a)))}))}(c())),k||(k=1,function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),e=r.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var u=r.getLineHandle(t.line),l=t.ch-1,s=o&&o.afterCursor;null==s&&(s=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className));var c=i(o),f=!s&&l>=0&&c.test(u.text.charAt(l))&&n[u.text.charAt(l)]||c.test(u.text.charAt(l+1))&&n[u.text.charAt(++l)];if(!f)return null;var d=">"==f.charAt(1)?1:-1;if(o&&o.strict&&d>0!=(l==t.ch))return null;var h=r.getTokenTypeAt(e(t.line,l+1)),v=a(r,e(t.line,l+(d>0?1:0)),d,h,o);return null==v?null:{from:e(t.line,l),to:v&&v.pos,match:v&&v.ch==f.charAt(0),forward:d>0}}function a(r,t,o,a,u){for(var l=u&&u.maxScanLineLength||1e4,s=u&&u.maxScanLines||1e3,c=[],f=i(u),d=o>0?Math.min(t.line+s,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-s),h=t.line;h!=d;h+=o){var v=r.getLine(h);if(v){var m=o>0?0:v.length-1,p=o>0?v.length:-1;if(!(v.length>l))for(h==t.line&&(m=t.ch-(o<0?1:0));m!=p;m+=o){var g=v.charAt(m);if(f.test(g)&&(void 0===a||(r.getTokenTypeAt(e(h,m+1))||"")==(a||""))){var b=n[g];if(b&&">"==b.charAt(1)==o>0)c.push(g);else{if(!c.length)return{pos:e(h,m),ch:g};c.pop()}}}}}return h-o!=(o>0?r.lastLine():r.firstLine())&&null}function u(r,n,i){for(var a=r.state.matchBrackets.maxHighlightLineLength||1e3,u=i&&i.highlightNonMatching,l=[],s=r.listSelections(),c=0;c<s.length;c++){var f=s[c].empty()&&o(r,s[c].head,i);if(f&&(f.match||!1!==u)&&r.getLine(f.from.line).length<=a){var d=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(r.markText(f.from,e(f.from.line,f.from.ch+1),{className:d})),f.to&&r.getLine(f.to.line).length<=a&&l.push(r.markText(f.to,e(f.to.line,f.to.ch+1),{className:d}))}}if(l.length){t&&r.state.focused&&r.focus();var h=function(){r.operation((function(){for(var r=0;r<l.length;r++)l[r].clear()}))};if(!n)return h;setTimeout(h,800)}}function l(r){r.operation((function(){r.state.matchBrackets.currentlyHighlighted&&(r.state.matchBrackets.currentlyHighlighted(),r.state.matchBrackets.currentlyHighlighted=null),r.state.matchBrackets.currentlyHighlighted=u(r,!1,r.state.matchBrackets)}))}function s(r){r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted&&(r.state.matchBrackets.currentlyHighlighted(),r.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,(function(t,e,n){n&&n!=r.Init&&(t.off("cursorActivity",l),t.off("focus",l),t.off("blur",s),s(t)),e&&(t.state.matchBrackets="object"==typeof e?e:{},t.on("cursorActivity",l),t.on("focus",l),t.on("blur",s))})),r.defineExtension("matchBrackets",(function(){u(this,!0)})),r.defineExtension("findMatchingBracket",(function(r,t,e){return(e||"boolean"==typeof t)&&(e?(e.strict=t,t=e):t=t?{strict:!0}:null),o(this,r,t)})),r.defineExtension("scanForBracket",(function(r,t,e,n){return a(this,r,t,e,n)}))}(c()));var C,M,A,L,S={};function T(){return C||(C=1,function(r){var t=r.Pos;function e(r,t){return r.line-t.line||r.ch-t.ch}var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(r,t,e,n){this.line=t,this.ch=e,this.cm=r,this.text=r.getLine(t),this.min=n?Math.max(n.from,r.firstLine()):r.firstLine(),this.max=n?Math.min(n.to-1,r.lastLine()):r.lastLine()}function a(r,e){var n=r.cm.getTokenTypeAt(t(r.line,e));return n&&/\btag\b/.test(n)}function u(r){if(!(r.line>=r.max))return r.ch=0,r.text=r.cm.getLine(++r.line),!0}function l(r){if(!(r.line<=r.min))return r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0}function s(r){for(;;){var t=r.text.indexOf(">",r.ch);if(-1==t){if(u(r))continue;return}if(a(r,t+1)){var e=r.text.lastIndexOf("/",t),n=e>-1&&!/\S/.test(r.text.slice(e+1,t));return r.ch=t+1,n?"selfClose":"regular"}r.ch=t+1}}function c(r){for(;;){var t=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(-1==t){if(l(r))continue;return}if(a(r,t+1)){i.lastIndex=t,r.ch=t;var e=i.exec(r.text);if(e&&e.index==t)return e}else r.ch=t}}function f(r){for(;;){i.lastIndex=r.ch;var t=i.exec(r.text);if(!t){if(u(r))continue;return}if(a(r,t.index+1))return r.ch=t.index+t[0].length,t;r.ch=t.index+1}}function d(r){for(;;){var t=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(-1==t){if(l(r))continue;return}if(a(r,t+1)){var e=r.text.lastIndexOf("/",t),n=e>-1&&!/\S/.test(r.text.slice(e+1,t));return r.ch=t+1,n?"selfClose":"regular"}r.ch=t}}function h(r,e){for(var n=[];;){var i,o=f(r),a=r.line,u=r.ch-(o?o[0].length:0);if(!o||!(i=s(r)))return;if("selfClose"!=i)if(o[1]){for(var l=n.length-1;l>=0;--l)if(n[l]==o[2]){n.length=l;break}if(l<0&&(!e||e==o[2]))return{tag:o[2],from:t(a,u),to:t(r.line,r.ch)}}else n.push(o[2])}}function v(r,e){for(var n=[];;){var i=d(r);if(!i)return;if("selfClose"!=i){var o=r.line,a=r.ch,u=c(r);if(!u)return;if(u[1])n.push(u[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==u[2]){n.length=l;break}if(l<0&&(!e||e==u[2]))return{tag:u[2],from:t(r.line,r.ch),to:t(o,a)}}}else c(r)}}r.registerHelper("fold","xml",(function(r,n){for(var i=new o(r,n.line,0);;){var a=f(i);if(!a||i.line!=n.line)return;var u=s(i);if(!u)return;if(!a[1]&&"selfClose"!=u){var l=t(i.line,i.ch),c=h(i,a[2]);return c&&e(c.from,l)>0?{from:l,to:c.from}:null}}})),r.findMatchingTag=function(r,n,i){var a=new o(r,n.line,n.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var u=s(a),l=u&&t(a.line,a.ch),f=u&&c(a);if(u&&f&&!(e(a,n)>0)){var d={from:t(a.line,a.ch),to:l,tag:f[2]};return"selfClose"==u?{open:d,close:null,at:"open"}:f[1]?{open:v(a,f[2]),close:d,at:"close"}:{open:d,close:h(a=new o(r,l.line,l.ch,i),f[2]),at:"open"}}}},r.findEnclosingTag=function(r,t,e,n){for(var i=new o(r,t.line,t.ch,e);;){var a=v(i,n);if(!a)break;var u=h(new o(r,t.line,t.ch,e),a.tag);if(u)return{open:a,close:u}}},r.scanForClosingTag=function(r,t,e,n){return h(new o(r,t.line,t.ch,n?{from:0,to:n}:null),e)}}(c())),S}M||(M=1,function(r){function t(r){r.state.tagHit&&r.state.tagHit.clear(),r.state.tagOther&&r.state.tagOther.clear(),r.state.tagHit=r.state.tagOther=null}function e(e){e.state.failedTagMatch=!1,e.operation((function(){if(t(e),!e.somethingSelected()){var n=e.getCursor(),i=e.getViewport();i.from=Math.min(i.from,n.line),i.to=Math.max(n.line+1,i.to);var o=r.findMatchingTag(e,n,i);if(o){if(e.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(e.state.tagHit=e.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var u="close"==o.at?o.open:o.close;u?e.state.tagOther=e.markText(u.from,u.to,{className:"CodeMirror-matchingtag"}):e.state.failedTagMatch=!0}}}))}function n(r){r.state.failedTagMatch&&e(r)}r.defineOption("matchTags",!1,(function(i,o,a){a&&a!=r.Init&&(i.off("cursorActivity",e),i.off("viewportChange",n),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",e),i.on("viewportChange",n),e(i))})),r.commands.toMatchingTag=function(t){var e=r.findMatchingTag(t,t.getCursor());if(e){var n="close"==e.at?e.open:e.close;n&&t.extendSelection(n.to,n.from)}}}(c(),T())),A||(A=1,function(r){var t="CodeMirror-lint-markers";function e(r){r.parentNode&&r.parentNode.removeChild(r)}function n(t,n,i,o){var a=function(t,e,n){var i=document.createElement("div");function o(t){if(!i.parentNode)return r.off(document,"mousemove",o);i.style.top=Math.max(0,t.clientY-i.offsetHeight-5)+"px",i.style.left=t.clientX+5+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(n.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),r.on(document,"mousemove",o),o(e),null!=i.style.opacity&&(i.style.opacity=1),i}(t,n,i);function u(){var t;r.off(o,"mouseout",u),a&&((t=a).parentNode&&(null==t.style.opacity&&e(t),t.style.opacity=0,setTimeout((function(){e(t)}),600)),a=null)}var l=setInterval((function(){if(a)for(var r=o;;r=r.parentNode){if(r&&11==r.nodeType&&(r=r.host),r==document.body)return;if(!r){u();break}}if(!a)return clearInterval(l)}),400);r.on(o,"mouseout",u)}function i(r,t,e){for(var i in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},o)this.options[i]=o[i];for(var i in t)o.hasOwnProperty(i)?null!=t[i]&&(this.options[i]=t[i]):t.options||(this.linterOptions[i]=t[i]);this.timeout=null,this.hasGutter=e,this.onMouseOver=function(t){!function(r,t){var e=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(e.className)){for(var i=e.getBoundingClientRect(),o=r.findMarksAt(r.coordsChar({left:(i.left+i.right)/2,top:(i.top+i.bottom)/2},"client")),a=[],u=0;u<o.length;++u){var s=o[u].__annotation;s&&a.push(s)}a.length&&function(r,t,e){for(var i=e.target||e.srcElement,o=document.createDocumentFragment(),a=0;a<t.length;a++)o.appendChild(l(t[a]));n(r,e,o,i)}(r,a,t)}}(r,t)},this.waitingFor=0}var o={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function a(r){var e=r.state.lint;e.hasGutter&&r.clearGutter(t),e.options.highlightLines&&function(r){r.eachLine((function(t){var e=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);e&&r.removeLineClass(t,"wrap",e[0])}))}(r);for(var n=0;n<e.marked.length;++n)e.marked[n].clear();e.marked.length=0}function u(t,e,i,o,a){var u=document.createElement("div"),l=u;return u.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+i,o&&((l=u.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=a&&r.on(l,"mouseover",(function(r){n(t,r,e,l)})),u}function l(r){var t=r.severity;t||(t="error");var e=document.createElement("div");return e.className="CodeMirror-lint-message CodeMirror-lint-message-"+t,void 0!==r.messageHTML?e.innerHTML=r.messageHTML:e.appendChild(document.createTextNode(r.message)),e}function s(t){var e=t.state.lint;if(e){var n=e.options,i=n.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(i)if(n.async||i.async)!function(t,e){var n=t.state.lint,i=++n.waitingFor;function o(){i=-1,t.off("change",o)}t.on("change",o),e(t.getValue(),(function(e,a){t.off("change",o),n.waitingFor==i&&(a&&e instanceof r&&(e=a),t.operation((function(){c(t,e)})))}),n.linterOptions,t)}(t,i);else{var o=i(t.getValue(),e.linterOptions,t);if(!o)return;o.then?o.then((function(r){t.operation((function(){c(t,r)}))})):t.operation((function(){c(t,o)}))}}}function c(r,e){var n,i,o=r.state.lint;if(o){var s=o.options;a(r);for(var c=function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e],i=n.from.line;(t[i]||(t[i]=[])).push(n)}return t}(e),f=0;f<c.length;++f){var d=c[f];if(d){var h=[];d=d.filter((function(r){return!(h.indexOf(r.message)>-1)&&h.push(r.message)}));for(var v=null,m=o.hasGutter&&document.createDocumentFragment(),p=0;p<d.length;++p){var g=d[p],b=g.severity;b||(b="error"),i=b,v="error"==(n=v)?n:i,s.formatAnnotation&&(g=s.formatAnnotation(g)),o.hasGutter&&m.appendChild(l(g)),g.to&&o.marked.push(r.markText(g.from,g.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+b,__annotation:g}))}o.hasGutter&&r.setGutterMarker(f,t,u(r,m,v,c[f].length>1,s.tooltips)),s.highlightLines&&r.addLineClass(f,"wrap","CodeMirror-lint-line-"+v)}}s.onUpdateLinting&&s.onUpdateLinting(e,c,r)}}function f(r){var t=r.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){s(r)}),t.options.delay))}r.defineOption("lint",!1,(function(e,n,o){if(o&&o!=r.Init&&(a(e),!1!==e.state.lint.options.lintOnChange&&e.off("change",f),r.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver),clearTimeout(e.state.lint.timeout),delete e.state.lint),n){for(var u=e.getOption("gutters"),l=!1,c=0;c<u.length;++c)u[c]==t&&(l=!0);var d=e.state.lint=new i(e,n,l);d.options.lintOnChange&&e.on("change",f),0!=d.options.tooltips&&"gutter"!=d.options.tooltips&&r.on(e.getWrapperElement(),"mouseover",d.onMouseOver),s(e)}})),r.defineExtension("performLint",(function(){s(this)}))}(c())),L||(L=1,function(r){r.registerHelper("lint","json",(function(t){var e=[];if(!window.jsonlint)return window.console&&window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."),e;var n=window.jsonlint.parser||window.jsonlint;n.parseError=function(t,n){var i=n.loc;e.push({from:r.Pos(i.first_line-1,i.first_column),to:r.Pos(i.last_line-1,i.last_column),message:t})};try{n.parse(t)}catch(r){}return e}))}(c()));var N,E,D;E||(E=1,function(r){r.defineOption("foldGutter",!1,(function(t,n,i){var o;i&&i!=r.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",l),t.off("changes",c),t.off("viewportChange",f),t.off("fold",d),t.off("unfold",d),t.off("swapDoc",c),t.off("optionChange",s)),n&&(t.state.foldGutter=new e((!0===(o=n)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),u(t),t.on("gutterClick",l),t.on("changes",c),t.on("viewportChange",f),t.on("fold",d),t.on("unfold",d),t.on("swapDoc",c),t.on("optionChange",s))}));var t=r.Pos;function e(r){this.options=r,this.from=this.to=0}function n(r,e){for(var n=r.findMarks(t(e,0),t(e+1,0)),i=0;i<n.length;++i)if(n[i].__isFold){var o=n[i].find(-1);if(o&&o.line===e)return n[i]}}function i(r){if("string"==typeof r){var t=document.createElement("div");return t.className=r+" CodeMirror-guttermarker-subtle",t}return r.cloneNode(!0)}function o(r,e,o){var u=r.state.foldGutter.options,l=e-1,s=r.foldOption(u,"minFoldSize"),c=r.foldOption(u,"rangeFinder"),f="string"==typeof u.indicatorFolded&&a(u.indicatorFolded),d="string"==typeof u.indicatorOpen&&a(u.indicatorOpen);r.eachLine(e,o,(function(e){++l;var o=null,a=e.gutterMarkers;if(a&&(a=a[u.gutter]),n(r,l)){if(f&&a&&f.test(a.className))return;o=i(u.indicatorFolded)}else{var h=t(l,0),v=c&&c(r,h);if(v&&v.to.line-v.from.line>=s){if(d&&a&&d.test(a.className))return;o=i(u.indicatorOpen)}}(o||a)&&r.setGutterMarker(e,u.gutter,o)}))}function a(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function u(r){var t=r.getViewport(),e=r.state.foldGutter;e&&(r.operation((function(){o(r,t.from,t.to)})),e.from=t.from,e.to=t.to)}function l(r,e,i){var o=r.state.foldGutter;if(o){var a=o.options;if(i==a.gutter){var u=n(r,e);u?u.clear():r.foldCode(t(e,0),a)}}}function s(r,t){"mode"==t&&c(r)}function c(r){var t=r.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){u(r)}),e.foldOnChangeTimeSpan||600)}}function f(r){var t=r.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var e=r.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?u(r):r.operation((function(){e.from<t.from&&(o(r,e.from,t.from),t.from=e.from),e.to>t.to&&(o(r,t.to,e.to),t.to=e.to)}))}),e.updateViewportTimeSpan||400)}}function d(r,t){var e=r.state.foldGutter;if(e){var n=t.line;n>=e.from&&n<e.to&&o(r,n,n+1)}}}(c(),N||(N=1,function(r){function t(t,e,i,o){if(i&&i.call){var a=i;i=null}else a=n(t,i,"rangeFinder");"number"==typeof e&&(e=r.Pos(e,0));var u=n(t,i,"minFoldSize");function l(r){var n=a(t,e);if(!n||n.to.line-n.from.line<u)return null;if("fold"===o)return n;for(var i=t.findMarksAt(n.from),l=0;l<i.length;++l)if(i[l].__isFold){if(!r)return null;n.cleared=!0,i[l].clear()}return n}var s=l(!0);if(n(t,i,"scanUp"))for(;!s&&e.line>t.firstLine();)e=r.Pos(e.line-1,0),s=l(!1);if(s&&!s.cleared&&"unfold"!==o){var c=function(r,t,e){var i=n(r,t,"widget");if("function"==typeof i&&(i=i(e.from,e.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0));return i}(t,i,s);r.on(c,"mousedown",(function(t){f.clear(),r.e_preventDefault(t)}));var f=t.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(t,i,"clearOnEnter"),__isFold:!0});f.on("clear",(function(e,n){r.signal(t,"unfold",t,e,n)})),r.signal(t,"fold",t,s.from,s.to)}}r.newFoldFunction=function(r,e){return function(n,i){t(n,i,{rangeFinder:r,widget:e})}},r.defineExtension("foldCode",(function(r,e,n){t(this,r,e,n)})),r.defineExtension("isFolded",(function(r){for(var t=this.findMarksAt(r),e=0;e<t.length;++e)if(t[e].__isFold)return!0})),r.commands.toggleFold=function(r){r.foldCode(r.getCursor())},r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")},r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(t){t.operation((function(){for(var e=t.firstLine(),n=t.lastLine();e<=n;e++)t.foldCode(r.Pos(e,0),{scanUp:!1},"fold")}))},r.commands.unfoldAll=function(t){t.operation((function(){for(var e=t.firstLine(),n=t.lastLine();e<=n;e++)t.foldCode(r.Pos(e,0),{scanUp:!1},"unfold")}))},r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,e){for(var n=0;n<r.length;++n){var i=r[n](t,e);if(i)return i}}})),r.registerHelper("fold","auto",(function(r,t){for(var e=r.getHelpers(t,"fold"),n=0;n<e.length;n++){var i=e[n](r,t);if(i)return i}}));var e={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function n(r,t,n){if(t&&void 0!==t[n])return t[n];var i=r.options.foldOptions;return i&&void 0!==i[n]?i[n]:e[n]}r.defineOption("foldOptions",null),r.defineExtension("foldOption",(function(r,t){return n(this,r,t)}))}(c())))),D||(D=1,function(r){function t(t){return function(e,n){var i=n.line,o=e.getLine(i);function a(t){for(var a,u=n.ch,l=0;;){var s=u<=0?-1:o.lastIndexOf(t[0],u-1);if(-1!=s){if(1==l&&s<n.ch)break;if(a=e.getTokenTypeAt(r.Pos(i,s+1)),!/^(comment|string)/.test(a))return{ch:s+1,tokenType:a,pair:t};u=s-1}else{if(1==l)break;l=1,u=o.length}}}function u(t){var n,o,a=1,u=e.lastLine(),l=t.ch;r:for(var s=i;s<=u;++s)for(var c=e.getLine(s),f=s==i?l:0;;){var d=c.indexOf(t.pair[0],f),h=c.indexOf(t.pair[1],f);if(d<0&&(d=c.length),h<0&&(h=c.length),(f=Math.min(d,h))==c.length)break;if(e.getTokenTypeAt(r.Pos(s,f+1))==t.tokenType)if(f==d)++a;else if(! --a){n=s,o=f;break r}++f}return null==n||i==n?null:{from:r.Pos(i,l),to:r.Pos(n,o)}}for(var l=[],s=0;s<t.length;s++){var c=a(t[s]);c&&l.push(c)}for(l.sort((function(r,t){return r.ch-t.ch})),s=0;s<l.length;s++){var f=u(l[s]);if(f)return f}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",(function(t,e){function n(e){if(e<t.firstLine()||e>t.lastLine())return null;var n=t.getTokenAt(r.Pos(e,1));if(/\S/.test(n.string)||(n=t.getTokenAt(r.Pos(e,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var i=e,o=Math.min(t.lastLine(),e+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:n.end,end:r.Pos(i,a)}}}var i,o=e.line,a=n(o);if(!a||n(o-1)||(i=n(o-2))&&i.end.line==o-1)return null;for(var u=a.end;;){var l=n(u.line+1);if(null==l)break;u=l.end}return{from:t.clipPos(r.Pos(o,a.startCh+1)),to:u}})),r.registerHelper("fold","include",(function(t,e){function n(e){if(e<t.firstLine()||e>t.lastLine())return null;var n=t.getTokenAt(r.Pos(e,1));return/\S/.test(n.string)||(n=t.getTokenAt(r.Pos(e,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=e.line,o=n(i);if(null==o||null!=n(i-1))return null;for(var a=i;null!=n(a+1);)++a;return{from:r.Pos(i,o+1),to:t.clipPos(r.Pos(a))}}))}(c())),T();var z,j={exports:{}},B=(z||(z=1,function(r){var t=function(){var r,t,e,n,i,o,a,u,l,s,c,f,d=!0,h={},v=(i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=function(t){throw{name:"SyntaxError",message:t,at:r,text:e}},a=function(n){return n&&n!==t&&o("Expected '"+n+"' instead of '"+t+"'"),t=e.charAt(r),r+=1,t},u=function(){var r,e="";for("-"===t&&(e="-",a("-"));t>="0"&&t<="9";)e+=t,a();if("."===t)for(e+=".";a()&&t>="0"&&t<="9";)e+=t;if("e"===t||"E"===t)for(e+=t,a(),"-"!==t&&"+"!==t||(e+=t,a());t>="0"&&t<="9";)e+=t,a();if(r=+e,isFinite(r))return r;o("Bad number")},l=function(){var r,e,n,u="";if('"'===t)for(;a();){if('"'===t)return a(),u;if("\\"===t)if(a(),"u"===t){for(n=0,e=0;e<4&&(r=parseInt(a(),16),isFinite(r));e+=1)n=16*n+r;u+=String.fromCharCode(n)}else{if("string"!=typeof i[t])break;u+=i[t]}else u+=t}o("Bad string")},s=function(){for(;t&&t<=" ";)a()},n=function(){switch(s(),t){case"{":return function(){var r,e={};if("{"===t){if(a("{"),s(),"}"===t)return a("}"),e;for(;t;){if(r=l(),s(),a(":"),Object.hasOwnProperty.call(e,r)&&o("Duplicate key '"+r+"'"),e[r]=n(),s(),"}"===t)return a("}"),e;a(","),s()}}o("Bad object")}();case"[":return function(){var r=[];if("["===t){if(a("["),s(),"]"===t)return a("]"),r;for(;t;){if(r.push(n()),s(),"]"===t)return a("]"),r;a(","),s()}}o("Bad array")}();case'"':return l();case"-":return u();default:return t>="0"&&t<="9"?u():function(){switch(t){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+t+"'")}()}},function(i,a){var u;return e=i,r=0,t=" ",u=n(),s(),t&&o("Syntax error"),"function"==typeof a?function r(t,e){var n,i,o=t[e];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(void 0!==(i=r(o,n))?o[n]=i:delete o[n]);return a.call(t,e,o)}({"":u},""):u}),m=(c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(r,t,e,n,i,o){var a=o.length-1;switch(i){case 1:this.$=r.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(r);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=o[a-1];case 13:this.$={};break;case 14:case 19:this.$=o[a-1];break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[];break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(r){throw new Error(r)},parse:function(r){var t=this,e=[0],n=[null],i=[],o=this.table,a="",u=0,l=0,s=0;this.lexer.setInput(r),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;function f(){var r;return"number"!=typeof(r=t.lexer.lex()||1)&&(r=t.symbols_[r]||r),r}i.push(c),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,h,v,m,p,g,b,w,k={};;){if(this.defaultActions[v=e[e.length-1]]?m=this.defaultActions[v]:(null==d&&(d=f()),m=o[v]&&o[v][d]),void 0===m||!m.length||!m[0]){if(!s){for(g in w=[],o[v])this.terminals_[g]&&g>2&&w.push("'"+this.terminals_[g]+"'");var y="";y=this.lexer.showPosition?"Parse error on line "+(u+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+this.terminals_[d]+"'":"Parse error on line "+(u+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(y,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:c,expected:w})}if(3==s){if(1==d)throw new Error(y||"Parsing halted.");l=this.lexer.yyleng,a=this.lexer.yytext,u=this.lexer.yylineno,c=this.lexer.yylloc,d=f()}for(;!(2..toString()in o[v]);){if(0==v)throw new Error(y||"Parsing halted.");e.length=e.length-2*1,n.length=n.length-1,i.length=i.length-1,v=e[e.length-1]}h=d,d=2,m=o[v=e[e.length-1]]&&o[v][2],s=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+d);switch(m[0]){case 1:e.push(d),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),e.push(m[1]),d=null,h?(d=h,h=null):(l=this.lexer.yyleng,a=this.lexer.yytext,u=this.lexer.yylineno,c=this.lexer.yylloc,s>0&&s--);break;case 2:if(k.$=n[n.length-(b=this.productions_[m[1]][1])],k._$={first_line:i[i.length-(b||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(b||1)].first_column,last_column:i[i.length-1].last_column},void 0!==(p=this.performAction.call(k,a,l,u,this.yy,m[1],n,i)))return p;b&&(e=e.slice(0,-1*b*2),n=n.slice(0,-1*b),i=i.slice(0,-1*b)),e.push(this.productions_[m[1]][0]),n.push(k.$),i.push(k._$),e.push(o[e[e.length-2]][e[e.length-1]]);break;case 3:return!0}}return!0}},f=function(){var r={EOF:1,parseError:function(r,t){if(!this.yy.parseError)throw new Error(r);this.yy.parseError(r,t)},setInput:function(r){return this._input=r,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var r=this._input[0];return this.yytext+=r,this.yyleng++,this.match+=r,this.matched+=r,r.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),r},unput:function(r){return this._input=r+this._input,this},more:function(){return this._more=!0,this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var r,t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),a=0;a<o.length&&(!(e=this._input.match(this.rules[o[a]]))||t&&!(e[0].length>t[0].length)||(t=e,n=a,this.options.flex));a++);return t?((i=t[0].match(/\n.*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,o[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return void 0!==r?r:this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(r){this.begin(r)},options:{},performAction:function(r,t,e){switch(e){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return r}(),c.lexer=f,c),p=m.parse;return m.parse=function(r){var t=p.call(m,r),e=void 0===v?d("./doug-json-parse"):v;try{e(r)}catch(t){if(/Duplicate key|Bad string|Unexpected/.test(t.message)){var n=r.substring(0,t.at).split("\n"),i=n.length;throw this.parseError(t.message,{line:i,col:n[i-1].length-1,message:t.message.replace(/./,(function(r){return r.toLowerCase()}))}),SyntaxError(t.message+" on line "+i)}}return t},void 0!==h&&(h.parser=m,h.parse=function(){return m.parse.apply(m,arguments)},h.main=function(r){if(!r[1])throw new Error("Usage: "+r[0]+" FILE");if("undefined"!=typeof process)var t=d("fs").readFileSync(d("path").join(process.cwd(),r[1]),"utf8");else t=d("file").path(d("file").cwd()).join(r[1]).read({charset:"utf-8"});return h.parser.parse(t)},!1===d.main&&h.main("undefined"!=typeof process?process.argv.slice(1):d("system").args)),h}();r.exports&&(r.exports=t)}(j)),j.exports),I=a(B);const R=class{constructor(n){r(this,n),this.change=t(this,"change"),this.value="",this.readonly=!1,this.disabled=!1,this.invalid=!1,this.required=!1,this.lineNumbers=!1,this.lineWrapping=!1,this.fold=!1,this.lint=!1,this.colorScheme="auto",this.translationLanguage="en",this.showCopyButton=!0,this.wasCopied="idle",this.handleChangeDarkMode=()=>{"auto"===this.colorScheme&&this.forceRedraw()},this.handleChange=()=>{this.change.emit(this.editor.getValue())},this.handleResize=()=>{this.editor&&this.editor.refresh()},this.renderHelperLine=()=>{if(this.helperText)return e("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid})},this.copyCode=async()=>{var r,t,e;const n=null!==(e=null!==(t=null===(r=this.editor)||void 0===r?void 0:r.getValue())&&void 0!==t?t:this.value)&&void 0!==e?e:"";try{await navigator.clipboard.writeText(n),this.wasCopied="success",setTimeout((()=>{this.wasCopied="idle"}),2e3)}catch(r){console.error("Failed to copy to clipboard:",r),this.wasCopied="failed"}},this.labelId=o(),this.helperTextId=o()}connectedCallback(){this.observer=new ResizeObserver(this.handleResize),this.observer.observe(this.host),this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){var r;this.observer.unobserve(this.host),null===(r=this.editor)||void 0===r||r.off("change",this.handleChange),this.editor=null,this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const t=this.host.shadowRoot.querySelector(".editor");for(const r of null==t?void 0:t.childNodes)r.remove()}componentDidRender(){this.editor||(this.editor=this.createEditor(),this.updateInputFieldAccessibilityAttributes())}watchValue(r){this.editor&&r!==this.editor.getValue()&&this.editor.getDoc().setValue(r||"")}watchDisabled(){this.updateEditorReadOnlyState(),this.updateInputFieldAccessibilityAttributes()}watchReadonly(){this.updateEditorReadOnlyState(),this.updateInputFieldAccessibilityAttributes()}watchInvalid(){this.updateInputFieldAccessibilityAttributes()}watchRequired(){this.updateInputFieldAccessibilityAttributes()}watchHelperText(){this.updateInputFieldAccessibilityAttributes()}createEditor(){const r=this.getOptions(),t=d(this.host.shadowRoot.querySelector(".editor"),r);return t.on("change",this.handleChange),t.setOption("extraKeys",{Tab:r=>{const t=" ".repeat(r.getOption("indentUnit"));r.replaceSelection(t)}}),t}getOptions(){let r=this.language,t="lime light";const e=[];return this.isDarkMode()&&(t="lime dark"),"json"===this.language?(r={name:"application/json",json:!0},this.lint&&(e.push("CodeMirror-lint-markers"),"jsonlint"in window||(window.jsonlint=I))):"typescript"===this.language?r={name:"application/typescript",typescript:!0}:"html"===this.language&&(r="htmlmixed"),this.fold&&e.push("CodeMirror-foldgutter"),{mode:r,value:this.value||"",theme:t,readOnly:this.getReadOnlyOption(),tabSize:4,indentUnit:4,lineNumbers:this.lineNumbers,lineWrapping:this.lineWrapping,styleActiveLine:!0,matchBrackets:!0,matchTags:{bothTags:!0},lint:this.lint,foldGutter:this.fold,gutters:e}}isDarkMode(){return"auto"!==this.colorScheme?"dark"===this.colorScheme:this.darkMode.matches}render(){const r={editor:!0,readonly:this.readonly||this.disabled,disabled:this.disabled,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return e(n,{key:"47f27484ea6a4271fba45f81aa97a9ab9c0d7c28"},this.renderCopyButton(),e("limel-notched-outline",{key:"cc455855470c242d667b80a1b778007c6582439b",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:!0},e("div",{key:"11942b528f9110ee14cf8ef54f6c588fde1a6113",slot:"content",class:r})),this.renderHelperLine())}forceRedraw(){this.random=Math.random()}renderCopyButton(){var r;if(((null===(r=this.editor)||void 0===r?void 0:r.getValue())||this.value)&&!this.disabled&&this.showCopyButton)return e("button",{class:"copy-button",onClick:this.copyCode,type:"button","aria-live":"polite","aria-atomic":"true","aria-label":this.getButtonAriaLabel()},this.getButtonText())}getButtonText(){return u.get("success"===this.wasCopied?"code-editor.copied":"failed"===this.wasCopied?"code-editor.copy-failed":"code-editor.copy",this.translationLanguage)}getButtonAriaLabel(){const r=this.label||u.get("code-editor",this.translationLanguage);return u.get({success:"code-editor.copied-aria-label",failed:"code-editor.copy-failed-aria-label",idle:"code-editor.copy-aria-label"}[this.wasCopied],this.translationLanguage,{label:r})}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}updateEditorReadOnlyState(){this.editor&&this.editor.setOption("readOnly",this.getReadOnlyOption())}getReadOnlyOption(){return this.disabled?"nocursor":this.readonly}updateInputFieldAccessibilityAttributes(){if(!this.editor)return;const r=this.editor.getInputField();r&&(r.id=this.labelId,this.helperText?(r.setAttribute("aria-describedby",this.helperTextId),r.setAttribute("aria-controls",this.helperTextId)):(r.removeAttribute("aria-describedby"),r.removeAttribute("aria-controls")),this.required?r.setAttribute("aria-required","true"):r.removeAttribute("aria-required"),this.invalid?r.setAttribute("aria-invalid","true"):r.removeAttribute("aria-invalid"),this.disabled?r.setAttribute("aria-disabled","true"):r.removeAttribute("aria-disabled"),this.readonly||this.disabled?r.setAttribute("aria-readonly","true"):r.removeAttribute("aria-readonly"))}get host(){return i(this)}static get watchers(){return{value:[{watchValue:0}],disabled:[{watchDisabled:0}],readonly:[{watchReadonly:0}],invalid:[{watchInvalid:0}],required:[{watchRequired:0}],helperText:[{watchHelperText:0}]}}};R.style="@charset \"UTF-8\";.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{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.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, 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, 0.4)}.cm-force-border{padding-right:0.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 0.4s;-moz-transition:opacity 0.4s;-webkit-transition:opacity 0.4s;-o-transition:opacity 0.4s;-ms-transition:opacity 0.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:0.3;cursor:pointer}.CodeMirror-foldgutter{width:0.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"▾\"}.CodeMirror-foldgutter-folded:after{content:\"▸\"}:host(limel-code-editor){isolation:isolate;position:relative;display:flex;flex-direction:column;width:100%;font-size:var(--code-editor-font-size, 0.8125rem);--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)}:host(limel-code-editor) .cm-attribute,:host(limel-code-editor) .cm-property,:host(limel-code-editor) .cm-keyword{color:rgb(var(--color-violet-light))}:host(limel-code-editor) .cm-operator{color:rgb(var(--color-sky-dark))}:host(limel-code-editor) .cm-variable{color:rgb(var(--color-pink-light))}:host(limel-code-editor) .cm-variable-2{color:rgb(var(--contrast-1100))}:host(limel-code-editor) .cm-variable-3,:host(limel-code-editor) .cm-type{color:rgb(var(--color-amber-darker))}:host(limel-code-editor) .cm-builtin,:host(limel-code-editor) .cm-meta{color:rgb(var(--color-amber-default))}:host(limel-code-editor) .cm-atom{color:rgb(var(--color-coral-default))}:host(limel-code-editor) .cm-tag,:host(limel-code-editor) .cm-number{color:rgb(var(--color-magenta-default))}:host(limel-code-editor) .cm-def{color:rgb(var(--color-sky-default))}:host(limel-code-editor) .cm-string{color:rgb(var(--color-green-dark))}:host(limel-code-editor) .cm-string-2{color:rgb(var(--color-pink-default))}:host(limel-code-editor) .cm-qualifier{color:rgb(var(--color-grass-default))}:host(limel-code-editor) .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host(limel-code-editor) .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}@media (prefers-color-scheme: dark){:root:not([data-theme=force-light]) :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root:not([data-theme=force-light]) :host .cm-attribute,:root:not([data-theme=force-light]) :host .cm-property,:root:not([data-theme=force-light]) :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root:not([data-theme=force-light]) :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root:not([data-theme=force-light]) :host .cm-variable-3,:root:not([data-theme=force-light]) :host .cm-type{color:rgb(var(--color-yellow-light))}:root:not([data-theme=force-light]) :host .cm-atom{color:rgb(var(--color-coral-light))}:root:not([data-theme=force-light]) :host .cm-tag,:root:not([data-theme=force-light]) :host .cm-number{color:rgb(var(--color-magenta-light))}:root:not([data-theme=force-light]) :host .cm-def{color:rgb(var(--color-sky-light))}:root:not([data-theme=force-light]) :host .cm-string{color:rgb(var(--color-lime-light))}:root:not([data-theme=force-light]) :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root:not([data-theme=force-light]) :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root:not([data-theme=force-light]) :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}}:root[data-theme=force-dark] :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root[data-theme=force-dark] :host .cm-attribute,:root[data-theme=force-dark] :host .cm-property,:root[data-theme=force-dark] :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root[data-theme=force-dark] :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root[data-theme=force-dark] :host .cm-variable-3,:root[data-theme=force-dark] :host .cm-type{color:rgb(var(--color-yellow-light))}:root[data-theme=force-dark] :host .cm-atom{color:rgb(var(--color-coral-light))}:root[data-theme=force-dark] :host .cm-tag,:root[data-theme=force-dark] :host .cm-number{color:rgb(var(--color-magenta-light))}:root[data-theme=force-dark] :host .cm-def{color:rgb(var(--color-sky-light))}:root[data-theme=force-dark] :host .cm-string{color:rgb(var(--color-lime-light))}:root[data-theme=force-dark] :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root[data-theme=force-dark] :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root[data-theme=force-dark] :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor{display:flex;align-items:stretch;width:100%;min-height:2.5rem}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;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-lines{padding:0.25rem 0}.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;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cdefs/%3E%3Cpath%20fill='rgb(255,255,255)'%20d='M7.219%205.781L5.78%207.22%2014.563%2016%205.78%2024.781%207.22%2026.22%2016%2017.437l8.781%208.782%201.438-1.438L17.437%2016l8.782-8.781L24.78%205.78%2016%2014.563z'/%3E%3C/svg%3E\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:transparent;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus,.cm-s-lime .CodeMirror-foldmarker:focus-visible{will-change:color, background-color, box-shadow, transform}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.cm-s-lime .CodeMirror-foldmarker{text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3E%3Ccircle%20fill='rgba(186,186,192,0.7)'%20cx='16'%20cy='16'%20r='2'/%3E%3Ccircle%20fill='rgba(186,186,192,0.7)'%20cx='26'%20cy='16'%20r='2'/%3E%3Ccircle%20fill='rgba(186,186,192,0.7)'%20cx='6'%20cy='16'%20r='2'/%3E%3C/svg%3E\");background-size:contain;background-repeat:no-repeat;background-position:center}.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}limel-notched-outline{flex-grow:1}.copy-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.copy-button:hover,.copy-button:focus,.copy-button:focus-visible{will-change:color, background-color, box-shadow, transform}.copy-button:hover,.copy-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.copy-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.copy-button:hover,.copy-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.copy-button:focus{outline:none}.copy-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.copy-button{position:absolute;top:0.25rem;right:0.25rem;z-index:1;padding:0.25rem 0.5rem;border-radius:0.375rem;font-size:0.75rem;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease), opacity var(--limel-clickable-transition-speed, 0.4s) ease;opacity:0}:host(limel-code-editor:hover) .copy-button,:host(limel-code-editor:focus-within) .copy-button{opacity:1}:host(limel-code-editor:focus),:host(limel-code-editor:focus-visible),:host(limel-code-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-code-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-code-editor:focus) limel-helper-line,:host(limel-code-editor:focus-visible) limel-helper-line,:host(limel-code-editor:focus-within) limel-helper-line,:host(limel-code-editor:hover) limel-helper-line{will-change:grid-template-rows}";export{R as limel_code_editor}