Version Description
- added search & replace with dialog
- added highlighing options
- added auto-close tags and brackets option
- added code-folding option
- added scrollbars option
- added keyMap options
- added Default and None themes
- fixed bug: made tab management agnostic to tab count and names - #50
Download this release
Release Info
Developer | arniebradfo |
Plugin | HTML Editor Syntax Highlighter |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.2.0
- css.json +0 -50
- dist/hesh.css +3 -3
- dist/hesh.js +8041 -65
- dist/hesh.min.css +1 -1
- dist/hesh.min.js +9 -9
css.json
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
[
|
2 |
-
"3024-day",
|
3 |
-
"3024-night",
|
4 |
-
"abcdef",
|
5 |
-
"ambiance-mobile",
|
6 |
-
"ambiance",
|
7 |
-
"base16-dark",
|
8 |
-
"base16-light",
|
9 |
-
"bespin",
|
10 |
-
"blackboard",
|
11 |
-
"cobalt",
|
12 |
-
"colorforth",
|
13 |
-
"dracula",
|
14 |
-
"duotone-dark",
|
15 |
-
"duotone-light",
|
16 |
-
"eclipse",
|
17 |
-
"elegant",
|
18 |
-
"erlang-dark",
|
19 |
-
"hopscotch",
|
20 |
-
"icecoder",
|
21 |
-
"isotope",
|
22 |
-
"lesser-dark",
|
23 |
-
"liquibyte",
|
24 |
-
"material",
|
25 |
-
"mbo",
|
26 |
-
"mdn-like",
|
27 |
-
"midnight",
|
28 |
-
"monokai",
|
29 |
-
"neat",
|
30 |
-
"neo",
|
31 |
-
"night",
|
32 |
-
"panda-syntax",
|
33 |
-
"paraiso-dark",
|
34 |
-
"paraiso-light",
|
35 |
-
"pastel-on-dark",
|
36 |
-
"railscasts",
|
37 |
-
"rubyblue",
|
38 |
-
"seti",
|
39 |
-
"solarized",
|
40 |
-
"the-matrix",
|
41 |
-
"tomorrow-night-bright",
|
42 |
-
"tomorrow-night-eighties",
|
43 |
-
"ttcn",
|
44 |
-
"twilight",
|
45 |
-
"vibrant-ink",
|
46 |
-
"xq-dark",
|
47 |
-
"xq-light",
|
48 |
-
"yeti",
|
49 |
-
"zenburn"
|
50 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dist/hesh.css
CHANGED
@@ -4,8 +4,8 @@
|
|
4 |
* Author URI: http://arniebradfo.com/
|
5 |
* Author: Peter Mukhortov
|
6 |
* Author URI: http://mukhortov.com/
|
7 |
-
* Version: 2.0
|
8 |
-
|
9 |
/* Set height, width, borders, and global font properties here */
|
10 |
font-family: monospace;
|
11 |
height: 300px;
|
@@ -1845,4 +1845,4 @@ THE SOFTWARE.
|
|
1845 |
* Also using parts of https://github.com/xavi/coderay-lighttable-theme
|
1846 |
* "
|
1847 |
* From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css
|
1848 |
-
*/.cm-s-zenburn .CodeMirror-gutters {background: #3f3f3f !important;}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded {color: #999;}.cm-s-zenburn .CodeMirror-cursor {border-left: 1px solid white;}.cm-s-zenburn {background-color: #3f3f3f;color: #dcdccc;}.cm-s-zenburn span.cm-builtin {color: #dcdccc;font-weight: bold;}.cm-s-zenburn span.cm-comment {color: #7f9f7f;}.cm-s-zenburn span.cm-keyword {color: #f0dfaf;font-weight: bold;}.cm-s-zenburn span.cm-atom {color: #bfebbf;}.cm-s-zenburn span.cm-def {color: #dcdccc;}.cm-s-zenburn span.cm-variable {color: #dfaf8f;}.cm-s-zenburn span.cm-variable-2 {color: #dcdccc;}.cm-s-zenburn span.cm-string {color: #cc9393;}.cm-s-zenburn span.cm-string-2 {color: #cc9393;}.cm-s-zenburn span.cm-number {color: #dcdccc;}.cm-s-zenburn span.cm-tag {color: #93e0e3;}.cm-s-zenburn span.cm-property {color: #dfaf8f;}.cm-s-zenburn span.cm-attribute {color: #dfaf8f;}.cm-s-zenburn span.cm-qualifier {color: #7cb8bb;}.cm-s-zenburn span.cm-meta {color: #f0dfaf;}.cm-s-zenburn span.cm-header {color: #f0efd0;}.cm-s-zenburn span.cm-operator {color: #f0efd0;}.cm-s-zenburn span.CodeMirror-matchingbracket {box-sizing: border-box;background: transparent;border-bottom: 1px solid;}.cm-s-zenburn span.CodeMirror-nonmatchingbracket {border-bottom: 1px solid;background: none;}.cm-s-zenburn .CodeMirror-activeline {background: #000000;}.cm-s-zenburn .CodeMirror-activeline-background {background: #000000;}.cm-s-zenburn div.CodeMirror-selected {background: #545454;}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected {background: #4f4f4f;}.CodeMirror {font: inherit;}.CodeMirror-scroll {font-family: Menlo Regular, Consolas, Monaco, monospace;line-height: 150%;position: relative;}.CodeMirror-settings {color: #444;height: 0;width: 100%;z-index: 9;text-shadow: none;}.CodeMirror-settings__toggle {border-radius: 3px;z-index: 11;box-sizing: border-box;position: absolute;top: 0;right: 0;margin: 6px;display: block;cursor: pointer;}.CodeMirror-settings__toggle:after {content: '\f111';font-family: dashicons;line-height: 1em;display: inline-block;}.CodeMirror-settings__toggle:before {border: 1px solid #ddd;border-radius: 3px;z-index: -1;content: '';background-color: white;transition: 250ms ease;transition-property: transform opacity;position: absolute;top: 0;right: 0;bottom: 0;left: 0;}.CodeMirror-settings__wrapper {pointer-events: none;visibility: hidden;}.CodeMirror-settings__docked,.CodeMirror-settings__body {pointer-events: initial;visibility: visible;}.CodeMirror-settings__wrapper {position: absolute;width: calc(100% - 12px );max-height: calc(100% - 12px );top: 0;margin: 6px;box-sizing: border-box;z-index: 9;display: -ms-flexbox;display: flex;-ms-flex-direction: column;flex-direction: column;}.CodeMirror-settings__docked {-ms-flex: 0 0 auto;flex: 0 0 auto;z-index: 10;background-color: white;box-sizing: border-box;}.CodeMirror-settings__header {border-top-left-radius: 3px;border-top-right-radius: 3px;border: 1px solid #ddd;padding: 4px;border-bottom-left-radius: 3px;border-bottom-right-radius: 3px;}.CodeMirror-settings__body {-ms-flex: 1 1 auto;flex: 1 1 auto;box-sizing: border-box;padding: 1px 12px;overflow-y: auto;background-color: rgba(255, 255, 255, 0.93);border-left: 1px solid #ddd;border-right: 1px solid #ddd;}.CodeMirror-settings__footer {border-bottom-left-radius: 3px;border-bottom-right-radius: 3px;border: 1px solid #ddd;padding: 6px 12px;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;-ms-flex-align: baseline;align-items: baseline;-ms-flex-line-pack: center;align-content: center;-ms-flex-pack: justify;justify-content: space-between;}td.CodeMirror-settings__heading {padding: 0;}.CodeMirror-settings__foot-content {margin: 0;}.CodeMirror-settings__toggle,.CodeMirror-settings__toggle-advanced,.CodeMirror-settings__header,.CodeMirror-settings__body,.CodeMirror-settings__footer,.CodeMirror-settings__wrapper {transition: 250ms ease;transition-property: opacity, transform;transform-origin: top right;}.CodeMirror-settings.closed .CodeMirror-settings__toggle-advanced:before {content: 'more...';}.CodeMirror-settings.closed .CodeMirror-settings__toggle {opacity: .5;}.CodeMirror-settings.closed .CodeMirror-settings__toggle:hover {opacity: 1;}.CodeMirror-settings.closed .CodeMirror-settings__toggle:before {opacity: 1;}.CodeMirror-settings.closed .CodeMirror-settings__wrapper {opacity: 0;transform: scaleX(0);}.CodeMirror-settings.closed .CodeMirror-settings__body,.CodeMirror-settings.closed .CodeMirror-settings__footer {visibility: hidden;opacity: 0;transform: translate(0, -20px);transition: opacity 250ms ease, transform 250ms ease, visibility 1ms ease 250ms;}.CodeMirror-settings.open .CodeMirror-settings__toggle-advanced:before {content: 'more...';}.CodeMirror-settings.open .CodeMirror-settings__toggle:after {content: '\f158';}.CodeMirror-settings.open .CodeMirror-settings__toggle:before {opacity: 0;}.CodeMirror-settings.open .CodeMirror-settings__wrapper {opacity: 1;transform: scaleX(1);}.CodeMirror-settings.open .CodeMirror-settings__body,.CodeMirror-settings.open .CodeMirror-settings__footer {visibility: hidden;opacity: 0;transform: translate(0, -20px);transition: opacity 250ms ease, transform 250ms ease, visibility 1ms ease 250ms;}.CodeMirror-settings.open-advanced .CodeMirror-settings__toggle-advanced:before {content: 'less';}.CodeMirror-settings.open-advanced .CodeMirror-settings__header {border-bottom-left-radius: 0;border-bottom-right-radius: 0;}.CodeMirror-settings.open-advanced .CodeMirror-settings__body,.CodeMirror-settings.open-advanced .CodeMirror-settings__footer {visibility: visible;opacity: 1;transform: translate(0, 0);transition: visibility 1ms ease, opacity 250ms ease 1ms, transform 250ms ease 1ms;}.CodeMirror-settings__button {position: relative;}.CodeMirror-settings__button:active {transform: none !important;}.CodeMirror-settings__button select,.CodeMirror-settings__button input {display: block;position: absolute;top: 0;right: 0;bottom: 0;left: 0;-webkit-appearance: none;margin: 0;padding: 0;border: none;height: auto;font-size: 0;line-height: 0;height: 100% !important;width: 100% !important;background: none;opacity: 0;}.CodeMirror-settings__button option {font-size: 12px;}.CodeMirror-settings__button--select:after {content: '\f140';font-family: dashicons;vertical-align: top;display: inline-block;margin: 0 -5px -4px;}.CodeMirror-settings__toggle-advanced {cursor: pointer;display: inline-block;line-height: 25px;padding: 0 4px;vertical-align: middle;}.wp-editor-expand .CodeMirror {min-height: 300px;}.wp-editor-expand .CodeMirror .CodeMirror-scroll {padding-bottom: 330px !important;margin-bottom: -330px !important;}.CodeMirror-mirrored {display: block !important;position: fixed !important;left: -9999px !important;top: -9999px !important;z-index: -999 !important;opacity: 0 !important;}#template .CodeMirror div {margin-right: initial;}#template .CodeMirror p {width: auto;}.CodeMirror-vscrollbar {display: none !important;}.CodeMirror-scroll {margin-right: -30px !important;}.CodeMirror-settings__toggle {margin: 6px !important;}.heshFullscreen {z-index: 99999;position: fixed !important;top: 0;left: 0;right: 0;bottom: 0;height: 100%;background: #fff;padding: 2% 2% 0;}.heshFullscreen .CodeMirror {border: 1px solid #ccc;border-radius: 0 0 4px 4px;height: 85% !important;}.heshFullscreen #ed_toolbar {border: 1px solid #ccc;border-bottom: 0;border-radius: 4px 4px 0 0;}.heshFullscreen #cm_content_fullscreen:before {content: '\f506';}#cm_content_fullscreen {display: inline-block;}.wp-editor-expand #cm_content_fullscreen {display: none;}.hesh-content-resize-handle {position: absolute;right: 0;bottom: 0;width: 12px;height: 12px;z-index: 8;margin: 1px !important;}#ed_toolbar {z-index: 10;}@media screen and (min-width: 782px) {.CodeMirror-settings__toggle {height: 35px;}.CodeMirror-settings__toggle {width: 35px;}.CodeMirror-settings__toggle:after {font-size: 20px;}.CodeMirror-settings__toggle:after {margin: 7px;}.CodeMirror-settings__docked {min-height: 35px;}.CodeMirror-settings__header {padding-right: 35px;}.CodeMirror-settings__button--select:after {font-size: 16px;}.CodeMirror-settings__button--select:after {margin-top: 0;}#template .CodeMirror {margin-right: 20px;}}@media screen and (max-width: 781px) {.CodeMirror-settings__toggle {height: 44px;}.CodeMirror-settings__toggle {width: 44px;}.CodeMirror-settings__toggle:after {font-size: 28px;}.CodeMirror-settings__toggle:after {margin: 8px;}.CodeMirror-settings__docked {min-height: 44px;}.CodeMirror-settings__header {padding-right: 44px;}.CodeMirror-settings__button--select:after {font-size: 20px;}.CodeMirror-settings__button--select:after {margin-top: -2px;}#template .CodeMirror {margin-right: initial;}}@media screen and (max-height: 550px) {.heshFullscreen .CodeMirror {height: 75% !important;}}@media print {/* Hide the cursor when printing */.CodeMirror div.CodeMirror-cursors {visibility: hidden;}}@keyframes blink {50% {background-color: transparent;}}
|
4 |
* Author URI: http://arniebradfo.com/
|
5 |
* Author: Peter Mukhortov
|
6 |
* Author URI: http://mukhortov.com/
|
7 |
+
* Version: 2.2.0
|
8 |
+
**//* BASICS */.CodeMirror {
|
9 |
/* Set height, width, borders, and global font properties here */
|
10 |
font-family: monospace;
|
11 |
height: 300px;
|
1845 |
* Also using parts of https://github.com/xavi/coderay-lighttable-theme
|
1846 |
* "
|
1847 |
* From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css
|
1848 |
+
*/.cm-s-zenburn .CodeMirror-gutters {background: #3f3f3f !important;}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded {color: #999;}.cm-s-zenburn .CodeMirror-cursor {border-left: 1px solid white;}.cm-s-zenburn {background-color: #3f3f3f;color: #dcdccc;}.cm-s-zenburn span.cm-builtin {color: #dcdccc;font-weight: bold;}.cm-s-zenburn span.cm-comment {color: #7f9f7f;}.cm-s-zenburn span.cm-keyword {color: #f0dfaf;font-weight: bold;}.cm-s-zenburn span.cm-atom {color: #bfebbf;}.cm-s-zenburn span.cm-def {color: #dcdccc;}.cm-s-zenburn span.cm-variable {color: #dfaf8f;}.cm-s-zenburn span.cm-variable-2 {color: #dcdccc;}.cm-s-zenburn span.cm-string {color: #cc9393;}.cm-s-zenburn span.cm-string-2 {color: #cc9393;}.cm-s-zenburn span.cm-number {color: #dcdccc;}.cm-s-zenburn span.cm-tag {color: #93e0e3;}.cm-s-zenburn span.cm-property {color: #dfaf8f;}.cm-s-zenburn span.cm-attribute {color: #dfaf8f;}.cm-s-zenburn span.cm-qualifier {color: #7cb8bb;}.cm-s-zenburn span.cm-meta {color: #f0dfaf;}.cm-s-zenburn span.cm-header {color: #f0efd0;}.cm-s-zenburn span.cm-operator {color: #f0efd0;}.cm-s-zenburn span.CodeMirror-matchingbracket {box-sizing: border-box;background: transparent;border-bottom: 1px solid;}.cm-s-zenburn span.CodeMirror-nonmatchingbracket {border-bottom: 1px solid;background: none;}.cm-s-zenburn .CodeMirror-activeline {background: #000000;}.cm-s-zenburn .CodeMirror-activeline-background {background: #000000;}.cm-s-zenburn div.CodeMirror-selected {background: #545454;}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected {background: #4f4f4f;}.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";}.CodeMirror {font: inherit;}.CodeMirror-scroll {font-family: Menlo Regular, Consolas, Monaco, monospace;line-height: 150%;position: relative;}.CodeMirror-settings {color: #444;height: 0;width: 100%;z-index: 9;text-shadow: none;}.CodeMirror-settings__toggle {border-radius: 3px;z-index: 11;box-sizing: border-box;position: absolute;top: 0;right: 0;margin: 6px;display: block;cursor: pointer;}.CodeMirror-settings__toggle:after {content: '\f111';font-family: dashicons;line-height: 1em;display: inline-block;}.CodeMirror-settings__toggle:before {border: 1px solid #ddd;border-radius: 3px;z-index: -1;content: '';background-color: white;transition: 250ms ease;transition-property: transform opacity;position: absolute;top: 0;right: 0;bottom: 0;left: 0;}.CodeMirror-settings__wrapper {pointer-events: none;visibility: hidden;}.CodeMirror-settings__docked,.CodeMirror-settings__body {pointer-events: initial;visibility: visible;}.CodeMirror-settings__wrapper {position: absolute;width: calc(100% - 12px );max-height: calc(100% - 12px );top: 0;margin: 6px;box-sizing: border-box;z-index: 9;display: -ms-flexbox;display: flex;-ms-flex-direction: column;flex-direction: column;}.CodeMirror-settings__docked {-ms-flex: 0 0 auto;flex: 0 0 auto;z-index: 10;background-color: white;box-sizing: border-box;}.CodeMirror-settings__header {border-top-left-radius: 3px;border-top-right-radius: 3px;border: 1px solid #ddd;padding: 4px;border-bottom-left-radius: 3px;border-bottom-right-radius: 3px;}.CodeMirror-settings__body {-ms-flex: 1 1 auto;flex: 1 1 auto;box-sizing: border-box;padding: 1px 12px;overflow-y: auto;background-color: rgba(255, 255, 255, 0.93);border-left: 1px solid #ddd;border-right: 1px solid #ddd;}.CodeMirror-settings__footer {border-bottom-left-radius: 3px;border-bottom-right-radius: 3px;border: 1px solid #ddd;padding: 6px 12px;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;-ms-flex-align: baseline;align-items: baseline;-ms-flex-line-pack: center;align-content: center;-ms-flex-pack: justify;justify-content: space-between;}.CodeMirror-settings-advanced__description {margin-left: 10px;opacity: 0.6;}td.CodeMirror-settings__heading {padding: 0;padding-bottom: 12px;}.CodeMirror-settings__foot-content {margin: 0;}.CodeMirror-settings__toggle,.CodeMirror-settings__toggle-advanced,.CodeMirror-settings__header,.CodeMirror-settings__body,.CodeMirror-settings__footer,.CodeMirror-settings__wrapper {transition: 250ms ease;transition-property: opacity, transform;transform-origin: top right;}.CodeMirror-settings.closed .CodeMirror-settings__toggle-advanced:before {content: 'more...';}.CodeMirror-settings.closed .CodeMirror-settings__toggle {opacity: .5;}.CodeMirror-settings.closed .CodeMirror-settings__toggle:hover {opacity: 1;}.CodeMirror-settings.closed .CodeMirror-settings__toggle:before {opacity: 1;}.CodeMirror-settings.closed .CodeMirror-settings__wrapper {opacity: 0;transform: scaleX(0);}.CodeMirror-settings.closed .CodeMirror-settings__body,.CodeMirror-settings.closed .CodeMirror-settings__footer {visibility: hidden;opacity: 0;transform: translate(0, -20px);transition: opacity 250ms ease, transform 250ms ease, visibility 1ms ease 250ms;}.CodeMirror-settings.open .CodeMirror-settings__toggle-advanced:before {content: 'more...';}.CodeMirror-settings.open .CodeMirror-settings__toggle:after {content: '\f158';}.CodeMirror-settings.open .CodeMirror-settings__toggle:before {opacity: 0;}.CodeMirror-settings.open .CodeMirror-settings__wrapper {opacity: 1;transform: scaleX(1);}.CodeMirror-settings.open .CodeMirror-settings__body,.CodeMirror-settings.open .CodeMirror-settings__footer {visibility: hidden;opacity: 0;transform: translate(0, -20px);transition: opacity 250ms ease, transform 250ms ease, visibility 1ms ease 250ms;}.CodeMirror-settings.open-advanced .CodeMirror-settings__toggle-advanced:before {content: 'less';}.CodeMirror-settings.open-advanced .CodeMirror-settings__header {border-bottom-left-radius: 0;border-bottom-right-radius: 0;}.CodeMirror-settings.open-advanced .CodeMirror-settings__body,.CodeMirror-settings.open-advanced .CodeMirror-settings__footer {visibility: visible;opacity: 1;transform: translate(0, 0);transition: visibility 1ms ease, opacity 250ms ease 1ms, transform 250ms ease 1ms;}.CodeMirror-settings__button {position: relative;}.CodeMirror-settings__button:active {transform: none !important;}.CodeMirror-settings__button select,.CodeMirror-settings__button input {display: block;position: absolute;top: 0;right: 0;bottom: 0;left: 0;-webkit-appearance: none;margin: 0;padding: 0;border: none;height: auto;font-size: 0;line-height: 0;height: 100% !important;width: 100% !important;background: none;opacity: 0;}.CodeMirror-settings__button option {font-size: 12px;}.CodeMirror-settings__button--select:after {content: '\f140';font-family: dashicons;vertical-align: top;display: inline-block;margin: 0 -5px -4px;}.CodeMirror-settings__toggle-advanced {cursor: pointer;display: inline-block;line-height: 25px;padding: 0 4px;vertical-align: middle;}.CodeMirror-dialog {position: absolute;left: 0;right: 0;top: 0;width: calc(100% - 12px );margin: 6px;box-sizing: border-box;display: -ms-flexbox;display: flex;-ms-flex-align: center;align-items: center;z-index: 12;padding-left: 12px;border-radius: 3px;border: 1px solid #ddd;color: #444;background-color: white;}.CodeMirror-dialog:after {position: absolute;right: 0;top: 0;bottom: 0;content: '\f158';font-family: dashicons;line-height: 1em;cursor: pointer;}.CodeMirror-dialog input {border: none;outline: none;background: rgba(0, 0, 0, 0.05);color: inherit;font-family: monospace;margin: -1px 12px;padding: 0 12px;-ms-flex-item-align: stretch;-ms-grid-row-align: stretch;align-self: stretch;-ms-flex: 1 1 auto;flex: 1 1 auto;}.CodeMirror-dialog input,.CodeMirror-dialog input:focus {box-shadow: none;}.CodeMirror-dialog button {margin: 0 2px !important;}.CodeMirror-dialog button:first-of-type {margin-left: 12px !important;}.CodeMirror-dialog span {-ms-flex-item-align: stretch;align-self: stretch;display: -ms-flexbox;display: flex;-ms-flex-align: center;align-items: center;}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler {display: none !important;}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical {position: absolute;z-index: 6;transition: opacity 100ms linear;opacity: 0.5;}.CodeMirror-overlayscroll-horizontal:hover,.CodeMirror-overlayscroll-vertical:hover {opacity: 1;}.CodeMirror-overlayscroll-horizontal:active,.CodeMirror-overlayscroll-vertical:active {opacity: 0.75;}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div {position: absolute;background: transparent !important;}.CodeMirror-overlayscroll-horizontal div:after,.CodeMirror-overlayscroll-vertical div:after {content: '';background-color: #f5f5f5;border: 1px solid #ddd;border-radius: 4px;position: absolute;}.CodeMirror-overlayscroll-horizontal {bottom: 0;left: 0;height: 8px;margin-bottom: 6px;}.CodeMirror-overlayscroll-horizontal div {top: 0;bottom: 0;}.CodeMirror-overlayscroll-horizontal div:after {top: 0;bottom: 0;left: 6px;right: 6px;}.CodeMirror-overlayscroll-vertical {right: 0;top: 0;width: 8px;margin-right: 6px;}.CodeMirror-overlayscroll-vertical div {left: 0;right: 0;}.CodeMirror-overlayscroll-vertical div:after {left: 0;right: 0;bottom: 6px;}.wp-editor-expand .CodeMirror {min-height: 300px;}.wp-editor-expand .CodeMirror .CodeMirror-scroll {padding-bottom: 330px !important;margin-bottom: -330px !important;}.CodeMirror-mirrored {display: block !important;position: fixed !important;left: -9999px !important;top: -9999px !important;z-index: -999 !important;opacity: 0 !important;}#template .CodeMirror div {margin-right: initial;}#template .CodeMirror p {width: auto;}.CodeMirror-vscrollbar {display: none !important;}.CodeMirror-scroll {margin-right: -30px !important;}.CodeMirror-settings__toggle {margin: 6px !important;}.heshFullscreen {z-index: 99999;position: fixed !important;top: 0;left: 0;right: 0;bottom: 0;height: 100%;background: #fff;padding: 2% 2% 0;}.heshFullscreen .CodeMirror {border: 1px solid #ccc;border-radius: 0 0 4px 4px;height: 85% !important;}.heshFullscreen #ed_toolbar {border: 1px solid #ccc;border-bottom: 0;border-radius: 4px 4px 0 0;}.heshFullscreen #cm_content_fullscreen:before {content: '\f506';}.cm-matchhighlight,.CodeMirror-matchingbracket,.CodeMirror-matchingtag {background-color: rgba(0, 255, 175, 0.2);}#cm_content_fullscreen {display: inline-block;}.wp-editor-expand #cm_content_fullscreen {display: none;}.hesh-content-resize-handle {position: absolute;right: 0;bottom: 0;width: 12px;height: 12px;z-index: 8;margin: 1px !important;}#ed_toolbar {z-index: 10;}@media screen and (min-width: 782px) {.CodeMirror-settings__toggle {height: 35px;}.CodeMirror-settings__toggle {width: 35px;}.CodeMirror-settings__toggle:after {font-size: 20px;}.CodeMirror-settings__toggle:after {margin: 7px;}.CodeMirror-settings__docked {min-height: 35px;}.CodeMirror-settings__header {padding-right: 35px;}.CodeMirror-settings__button--select:after {font-size: 16px;}.CodeMirror-settings__button--select:after {margin-top: 0;}.CodeMirror-dialog {height: 35px;}.CodeMirror-dialog {padding-right: 35px;}.CodeMirror-dialog:after {font-size: 20px;}.CodeMirror-dialog:after {margin: 7px;}.CodeMirror-overlayscroll-vertical div:after {top: 47px;}#template .CodeMirror {margin-right: 20px;}}@media screen and (max-width: 781px) {.CodeMirror-settings__toggle {height: 44px;}.CodeMirror-settings__toggle {width: 44px;}.CodeMirror-settings__toggle:after {font-size: 28px;}.CodeMirror-settings__toggle:after {margin: 8px;}.CodeMirror-settings__docked {min-height: 44px;}.CodeMirror-settings__header {padding-right: 44px;}.CodeMirror-settings__button--select:after {font-size: 20px;}.CodeMirror-settings__button--select:after {margin-top: -2px;}.CodeMirror-dialog {height: 44px;}.CodeMirror-dialog {padding-right: 44px;}.CodeMirror-dialog:after {font-size: 28px;}.CodeMirror-dialog:after {margin: 8px;}.CodeMirror-overlayscroll-vertical div:after {top: 56px;}#template .CodeMirror {margin-right: initial;}}@media screen and (max-height: 550px) {.heshFullscreen .CodeMirror {height: 75% !important;}}@media print {/* Hide the cursor when printing */.CodeMirror div.CodeMirror-cursors {visibility: hidden;}}@keyframes blink {50% {background-color: transparent;}}
|
dist/hesh.js
CHANGED
@@ -13463,16 +13463,7932 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13463 |
CodeM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|
13468 |
* @author James Bradford
|
13469 |
* @link http://arniebradfo.com/
|
13470 |
* @author Petr Mukhortov
|
13471 |
* @link http://mukhortov.com/
|
13472 |
-
* @since 2.0
|
13473 |
*/
|
13474 |
|
13475 |
-
|
13476 |
|
13477 |
(function (
|
13478 |
document,
|
@@ -13489,25 +21405,26 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13489 |
var editor;
|
13490 |
var scrollPanel;
|
13491 |
var settingsPanel = document.getElementById('CodeMirror-settings');
|
|
|
13492 |
var theForm = document.getElementById('CodeMirror-settings__form');
|
13493 |
var toolbar = document.getElementById('ed_toolbar');
|
13494 |
var target = document.getElementById('content') || document.getElementById('newcontent');
|
13495 |
var tabText = document.getElementById('content-html');
|
13496 |
-
var
|
13497 |
var publishButton = document.getElementById('save-post') || document.getElementById('publish');
|
13498 |
var postID = document.getElementById('post_ID') != null ? document.getElementById('post_ID').value : 0;
|
13499 |
var fullHeightToggle = document.getElementById('editor-expand-toggle');
|
13500 |
|
13501 |
var state = {
|
13502 |
-
|
13503 |
isThemeOrPlugin: document.getElementById('newcontent') != null,
|
13504 |
|
13505 |
isActive: function () {
|
13506 |
return document.getElementsByClassName('CodeMirror')[0] != null;
|
13507 |
},
|
13508 |
|
13509 |
-
|
13510 |
-
return document.getElementsByClassName('
|
13511 |
},
|
13512 |
|
13513 |
isFullHeight: function () {
|
@@ -13541,15 +21458,15 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13541 |
var options = {
|
13542 |
mode: 'wordpresspost',
|
13543 |
tabMode: 'indent',
|
13544 |
-
matchBrackets: true,
|
13545 |
indentWithTabs: true,
|
13546 |
enterMode: 'keep',
|
13547 |
styleActiveLine: true,
|
13548 |
electricChars: false,
|
|
|
13549 |
viewportMargin: 10,
|
13550 |
extraKeys: {
|
13551 |
'F11': function () {
|
13552 |
-
toggleFullscreen();
|
13553 |
},
|
13554 |
'Esc': function () {
|
13555 |
toggleFullscreen(true);
|
@@ -13559,23 +21476,32 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13559 |
},
|
13560 |
'Cmd-S': function () {
|
13561 |
publishButton.click();
|
13562 |
-
}
|
13563 |
},
|
13564 |
};
|
13565 |
|
13566 |
function updateOptions() {
|
13567 |
options.theme = heshOptions.theme;
|
13568 |
options.lineNumbers = !!heshOptions.lineNumbers;
|
|
|
|
|
13569 |
options.tabSize = options.indentUnit = +heshOptions.tabSize; // indentUnit must always equal tabSize
|
13570 |
options.lineWrapping = !!heshOptions.lineWrapping;
|
13571 |
-
options.
|
13572 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13573 |
&& document.getElementById('title').value.length > 0;
|
13574 |
}
|
13575 |
-
|
13576 |
|
13577 |
|
13578 |
-
|
|
|
13579 |
var wait = false;
|
13580 |
return function () {
|
13581 |
var context = this, args = arguments;
|
@@ -13592,10 +21518,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13592 |
}
|
13593 |
|
13594 |
|
13595 |
-
|
13596 |
function setSettingsPositionTopValues() {
|
13597 |
-
for (var
|
13598 |
-
var element = settingsPanel.children[
|
|
|
13599 |
element.style.position = '';
|
13600 |
element.style.top = '';
|
13601 |
element.style.left = '';
|
@@ -13606,8 +21533,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13606 |
|
13607 |
function setSettingsPositionMiddleValues() {
|
13608 |
var toolbarRect = toolbar.getBoundingClientRect();
|
13609 |
-
for (var
|
13610 |
-
var element = settingsPanel.children[
|
|
|
13611 |
element.style.position = 'fixed';
|
13612 |
element.style.top = toolbarRect.bottom + 'px';
|
13613 |
element.style.right = (document.documentElement.getBoundingClientRect().width - toolbarRect.right) + 'px';
|
@@ -13621,8 +21549,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13621 |
function setSettingsPositionBottomValues() {
|
13622 |
var toolbarRect = toolbar.getBoundingClientRect();
|
13623 |
var codeMirrorRect = editor.getWrapperElement().getBoundingClientRect();
|
13624 |
-
for (var
|
13625 |
-
var element = settingsPanel.children[
|
|
|
13626 |
element.style.position = 'absolute';
|
13627 |
element.style.top = (codeMirrorRect.top - toolbarRect.bottom) * -1 + 'px';
|
13628 |
element.style.left = '';
|
@@ -13656,7 +21585,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13656 |
|
13657 |
|
13658 |
var isIE = !!navigator.userAgent.match(/Trident/ig);
|
13659 |
-
|
13660 |
function updateFullHeightMaxHeight() {
|
13661 |
if (!theForm) return;
|
13662 |
var margin = 6; // arbitrary
|
@@ -13711,6 +21640,26 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13711 |
}
|
13712 |
|
13713 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13714 |
|
13715 |
// initalize the settings panel
|
13716 |
function attachSettings() {
|
@@ -13720,18 +21669,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13720 |
settingsPanel.querySelector('.CodeMirror-settings__toggle').addEventListener('click', toggleSettings);
|
13721 |
settingsPanel.querySelector('.CodeMirror-settings__toggle-advanced').addEventListener('click', toggleSettings);
|
13722 |
|
|
|
|
|
|
|
13723 |
// attach all the inputs to live update
|
13724 |
var options = settingsPanel.querySelectorAll('.CodeMirror-settings__option');
|
13725 |
-
for (var
|
13726 |
-
var option = options[
|
13727 |
option.addEventListener('change', submitForm);
|
|
|
13728 |
}
|
13729 |
-
settingsPanel.querySelector('#theme').addEventListener('change', updateOption);
|
13730 |
-
settingsPanel.querySelector('#tabSize').addEventListener('change', updateOption);
|
13731 |
-
settingsPanel.querySelector('#lineWrapping').addEventListener('change', updateOption);
|
13732 |
-
settingsPanel.querySelector('#lineNumbers').addEventListener('change', updateOption);
|
13733 |
-
settingsPanel.querySelector('#fontSize').addEventListener('change', updateFontSize);
|
13734 |
-
settingsPanel.querySelector('#lineHeight').addEventListener('change', updateLineHeight);
|
13735 |
}
|
13736 |
|
13737 |
// toggle classes for settingsPanel state
|
@@ -13766,22 +21713,64 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13766 |
}
|
13767 |
}
|
13768 |
|
13769 |
-
|
|
|
|
|
13770 |
|
13771 |
// set a codemirror option from an input.onchange event callback
|
13772 |
function updateOption(event) {
|
13773 |
var value = +event.target.value;
|
13774 |
value = isNaN(value) ? event.target.value : value;
|
13775 |
-
if (event.target.
|
13776 |
value = event.target.checked;
|
13777 |
-
heshOptions[event.target.id] = value;
|
13778 |
-
editor.setOption(event.target.id, value);
|
13779 |
-
if(event.target.id === 'tabSize') // special case for tabSize
|
13780 |
-
editor.setOption('indentUnit', value); // indentUnit must always equal tabSize
|
13781 |
-
}
|
13782 |
|
13783 |
-
|
13784 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13785 |
}
|
13786 |
|
13787 |
function setFontSizeAndLineHeight(fontSize, lineHeight) {
|
@@ -13793,21 +21782,6 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13793 |
editor.refresh();
|
13794 |
}
|
13795 |
|
13796 |
-
function updateFontSize(event) {
|
13797 |
-
var fontSize = event.target.value;
|
13798 |
-
heshOptions.fontSize = fontSize;
|
13799 |
-
scrollPanel.style.fontSize = fontSize + 'px';
|
13800 |
-
setCharWidth();
|
13801 |
-
editor.refresh();
|
13802 |
-
}
|
13803 |
-
|
13804 |
-
function updateLineHeight(event) {
|
13805 |
-
var lineHeight = event.target.value;
|
13806 |
-
heshOptions.lineHeight = lineHeight;
|
13807 |
-
scrollPanel.style.lineHeight = lineHeight + 'em';
|
13808 |
-
editor.refresh();
|
13809 |
-
}
|
13810 |
-
|
13811 |
|
13812 |
|
13813 |
// updates the user settings in the wordpress DB
|
@@ -13815,7 +21789,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13815 |
var formArray = $('#CodeMirror-settings__form').serializeArray();
|
13816 |
// TODO: drop jQuery dependency
|
13817 |
// console.log(formArray); // for debug
|
13818 |
-
$.post(heshOptions.ajaxUrl, formArray, function (
|
13819 |
// console.log(response); // for debug
|
13820 |
});
|
13821 |
}
|
@@ -13835,10 +21809,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13835 |
|
13836 |
function toggleFullscreen(esc) {
|
13837 |
esc = esc === true ? true : false;
|
13838 |
-
if (state.isFullHeight()){
|
13839 |
fullscreenBox.classList.remove(fullscreenClass);
|
13840 |
} else {
|
13841 |
-
if (!fullscreenBox.classList.contains(fullscreenClass) && !esc){
|
13842 |
fullscreenBox.classList.add(fullscreenClass);
|
13843 |
} else {
|
13844 |
fullscreenBox.classList.remove(fullscreenClass);
|
@@ -13958,7 +21932,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
13958 |
}
|
13959 |
|
13960 |
|
13961 |
-
|
13962 |
// make wrapped text line up with the base indentation of the line
|
13963 |
// https://codemirror.net/demo/indentwrap.html
|
13964 |
function indentWrappedLine() {
|
@@ -14000,12 +21974,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
14000 |
|
14001 |
function runTextAreaChangeDetection() {
|
14002 |
var currentValueLength = editor.getTextArea().value.length;
|
14003 |
-
var checkForChanges = window.setInterval(function(){
|
14004 |
// console.log(editor.getTextArea().value.length);
|
14005 |
if (currentValueLength === editor.getTextArea().value.length) return;
|
14006 |
window.clearInterval(checkForChanges);
|
14007 |
returnFocusFromTextArea();
|
14008 |
-
},10);
|
14009 |
var clearCheckForChanges = function () {
|
14010 |
window.clearInterval(checkForChanges);
|
14011 |
editor.off('focus', clearCheckForChanges);
|
@@ -14069,7 +22043,6 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
14069 |
window.send_to_editor = whichSendToEditor;
|
14070 |
}
|
14071 |
|
14072 |
-
|
14073 |
function startEditor() {
|
14074 |
if (state.isActive()) return;
|
14075 |
|
@@ -14117,15 +22090,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
14117 |
function initialise() {
|
14118 |
if (state.isThemeOrPlugin) {
|
14119 |
startEditor();
|
14120 |
-
} else if (state.
|
14121 |
tabText.addEventListener('click', function () {
|
14122 |
window.setTimeout(startEditor, 0);
|
14123 |
});
|
14124 |
-
|
14125 |
-
|
|
|
|
|
|
|
|
|
14126 |
} else {
|
14127 |
startEditor();
|
14128 |
-
document.body.className += ' visual-editor-is-disabled';
|
14129 |
}
|
14130 |
}
|
14131 |
|
@@ -14144,4 +22120,4 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
14144 |
window.CodeMirror,
|
14145 |
window.jQuery,
|
14146 |
window.heshOptions
|
14147 |
-
);
|
13463 |
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
|
13464 |
});
|
13465 |
|
13466 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
13467 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
13468 |
+
|
13469 |
+
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
13470 |
+
|
13471 |
+
(function(mod) {
|
13472 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
13473 |
+
mod(require("../../lib/codemirror"));
|
13474 |
+
else if (typeof define == "function" && define.amd) // AMD
|
13475 |
+
define(["../../lib/codemirror"], mod);
|
13476 |
+
else // Plain browser env
|
13477 |
+
mod(CodeMirror);
|
13478 |
+
})(function(CodeMirror) {
|
13479 |
+
function dialogDiv(cm, template, bottom) {
|
13480 |
+
var wrap = cm.getWrapperElement();
|
13481 |
+
var dialog;
|
13482 |
+
dialog = wrap.appendChild(document.createElement("div"));
|
13483 |
+
if (bottom)
|
13484 |
+
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
|
13485 |
+
else
|
13486 |
+
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
13487 |
+
|
13488 |
+
if (typeof template == "string") {
|
13489 |
+
dialog.innerHTML = template;
|
13490 |
+
} else { // Assuming it's a detached DOM element.
|
13491 |
+
dialog.appendChild(template);
|
13492 |
+
}
|
13493 |
+
return dialog;
|
13494 |
+
}
|
13495 |
+
|
13496 |
+
function closeNotification(cm, newVal) {
|
13497 |
+
if (cm.state.currentNotificationClose)
|
13498 |
+
cm.state.currentNotificationClose();
|
13499 |
+
cm.state.currentNotificationClose = newVal;
|
13500 |
+
}
|
13501 |
+
|
13502 |
+
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
13503 |
+
if (!options) options = {};
|
13504 |
+
|
13505 |
+
closeNotification(this, null);
|
13506 |
+
|
13507 |
+
var dialog = dialogDiv(this, template, options.bottom);
|
13508 |
+
var closed = false, me = this;
|
13509 |
+
function close(newVal) {
|
13510 |
+
if (typeof newVal == 'string') {
|
13511 |
+
inp.value = newVal;
|
13512 |
+
} else {
|
13513 |
+
if (closed) return;
|
13514 |
+
closed = true;
|
13515 |
+
dialog.parentNode.removeChild(dialog);
|
13516 |
+
me.focus();
|
13517 |
+
|
13518 |
+
if (options.onClose) options.onClose(dialog);
|
13519 |
+
}
|
13520 |
+
}
|
13521 |
+
|
13522 |
+
var inp = dialog.getElementsByTagName("input")[0], button;
|
13523 |
+
if (inp) {
|
13524 |
+
inp.focus();
|
13525 |
+
|
13526 |
+
if (options.value) {
|
13527 |
+
inp.value = options.value;
|
13528 |
+
if (options.selectValueOnOpen !== false) {
|
13529 |
+
inp.select();
|
13530 |
+
}
|
13531 |
+
}
|
13532 |
+
|
13533 |
+
if (options.onInput)
|
13534 |
+
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
|
13535 |
+
if (options.onKeyUp)
|
13536 |
+
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
|
13537 |
+
|
13538 |
+
CodeMirror.on(inp, "keydown", function(e) {
|
13539 |
+
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
13540 |
+
if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
|
13541 |
+
inp.blur();
|
13542 |
+
CodeMirror.e_stop(e);
|
13543 |
+
close();
|
13544 |
+
}
|
13545 |
+
if (e.keyCode == 13) callback(inp.value, e);
|
13546 |
+
});
|
13547 |
+
|
13548 |
+
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
|
13549 |
+
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
13550 |
+
CodeMirror.on(button, "click", function() {
|
13551 |
+
close();
|
13552 |
+
me.focus();
|
13553 |
+
});
|
13554 |
+
|
13555 |
+
if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
|
13556 |
+
|
13557 |
+
button.focus();
|
13558 |
+
}
|
13559 |
+
return close;
|
13560 |
+
});
|
13561 |
+
|
13562 |
+
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
13563 |
+
closeNotification(this, null);
|
13564 |
+
var dialog = dialogDiv(this, template, options && options.bottom);
|
13565 |
+
var buttons = dialog.getElementsByTagName("button");
|
13566 |
+
var closed = false, me = this, blurring = 1;
|
13567 |
+
function close() {
|
13568 |
+
if (closed) return;
|
13569 |
+
closed = true;
|
13570 |
+
dialog.parentNode.removeChild(dialog);
|
13571 |
+
me.focus();
|
13572 |
+
}
|
13573 |
+
buttons[0].focus();
|
13574 |
+
for (var i = 0; i < buttons.length; ++i) {
|
13575 |
+
var b = buttons[i];
|
13576 |
+
(function(callback) {
|
13577 |
+
CodeMirror.on(b, "click", function(e) {
|
13578 |
+
CodeMirror.e_preventDefault(e);
|
13579 |
+
close();
|
13580 |
+
if (callback) callback(me);
|
13581 |
+
});
|
13582 |
+
})(callbacks[i]);
|
13583 |
+
CodeMirror.on(b, "blur", function() {
|
13584 |
+
--blurring;
|
13585 |
+
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
13586 |
+
});
|
13587 |
+
CodeMirror.on(b, "focus", function() { ++blurring; });
|
13588 |
+
}
|
13589 |
+
});
|
13590 |
+
|
13591 |
+
/*
|
13592 |
+
* openNotification
|
13593 |
+
* Opens a notification, that can be closed with an optional timer
|
13594 |
+
* (default 5000ms timer) and always closes on click.
|
13595 |
+
*
|
13596 |
+
* If a notification is opened while another is opened, it will close the
|
13597 |
+
* currently opened one and open the new one immediately.
|
13598 |
+
*/
|
13599 |
+
CodeMirror.defineExtension("openNotification", function(template, options) {
|
13600 |
+
closeNotification(this, close);
|
13601 |
+
var dialog = dialogDiv(this, template, options && options.bottom);
|
13602 |
+
var closed = false, doneTimer;
|
13603 |
+
var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
|
13604 |
+
|
13605 |
+
function close() {
|
13606 |
+
if (closed) return;
|
13607 |
+
closed = true;
|
13608 |
+
clearTimeout(doneTimer);
|
13609 |
+
dialog.parentNode.removeChild(dialog);
|
13610 |
+
}
|
13611 |
+
|
13612 |
+
CodeMirror.on(dialog, 'click', function(e) {
|
13613 |
+
CodeMirror.e_preventDefault(e);
|
13614 |
+
close();
|
13615 |
+
});
|
13616 |
+
|
13617 |
+
if (duration)
|
13618 |
+
doneTimer = setTimeout(close, duration);
|
13619 |
+
|
13620 |
+
return close;
|
13621 |
+
});
|
13622 |
+
});
|
13623 |
+
|
13624 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
13625 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
13626 |
+
|
13627 |
+
(function(mod) {
|
13628 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
13629 |
+
mod(require("../../lib/codemirror"));
|
13630 |
+
else if (typeof define == "function" && define.amd) // AMD
|
13631 |
+
define(["../../lib/codemirror"], mod);
|
13632 |
+
else // Plain browser env
|
13633 |
+
mod(CodeMirror);
|
13634 |
+
})(function(CodeMirror) {
|
13635 |
+
"use strict";
|
13636 |
+
|
13637 |
+
function Bar(cls, orientation, scroll) {
|
13638 |
+
this.orientation = orientation;
|
13639 |
+
this.scroll = scroll;
|
13640 |
+
this.screen = this.total = this.size = 1;
|
13641 |
+
this.pos = 0;
|
13642 |
+
|
13643 |
+
this.node = document.createElement("div");
|
13644 |
+
this.node.className = cls + "-" + orientation;
|
13645 |
+
this.inner = this.node.appendChild(document.createElement("div"));
|
13646 |
+
|
13647 |
+
var self = this;
|
13648 |
+
CodeMirror.on(this.inner, "mousedown", function(e) {
|
13649 |
+
if (e.which != 1) return;
|
13650 |
+
CodeMirror.e_preventDefault(e);
|
13651 |
+
var axis = self.orientation == "horizontal" ? "pageX" : "pageY";
|
13652 |
+
var start = e[axis], startpos = self.pos;
|
13653 |
+
function done() {
|
13654 |
+
CodeMirror.off(document, "mousemove", move);
|
13655 |
+
CodeMirror.off(document, "mouseup", done);
|
13656 |
+
}
|
13657 |
+
function move(e) {
|
13658 |
+
if (e.which != 1) return done();
|
13659 |
+
self.moveTo(startpos + (e[axis] - start) * (self.total / self.size));
|
13660 |
+
}
|
13661 |
+
CodeMirror.on(document, "mousemove", move);
|
13662 |
+
CodeMirror.on(document, "mouseup", done);
|
13663 |
+
});
|
13664 |
+
|
13665 |
+
CodeMirror.on(this.node, "click", function(e) {
|
13666 |
+
CodeMirror.e_preventDefault(e);
|
13667 |
+
var innerBox = self.inner.getBoundingClientRect(), where;
|
13668 |
+
if (self.orientation == "horizontal")
|
13669 |
+
where = e.clientX < innerBox.left ? -1 : e.clientX > innerBox.right ? 1 : 0;
|
13670 |
+
else
|
13671 |
+
where = e.clientY < innerBox.top ? -1 : e.clientY > innerBox.bottom ? 1 : 0;
|
13672 |
+
self.moveTo(self.pos + where * self.screen);
|
13673 |
+
});
|
13674 |
+
|
13675 |
+
function onWheel(e) {
|
13676 |
+
var moved = CodeMirror.wheelEventPixels(e)[self.orientation == "horizontal" ? "x" : "y"];
|
13677 |
+
var oldPos = self.pos;
|
13678 |
+
self.moveTo(self.pos + moved);
|
13679 |
+
if (self.pos != oldPos) CodeMirror.e_preventDefault(e);
|
13680 |
+
}
|
13681 |
+
CodeMirror.on(this.node, "mousewheel", onWheel);
|
13682 |
+
CodeMirror.on(this.node, "DOMMouseScroll", onWheel);
|
13683 |
+
}
|
13684 |
+
|
13685 |
+
Bar.prototype.setPos = function(pos, force) {
|
13686 |
+
if (pos < 0) pos = 0;
|
13687 |
+
if (pos > this.total - this.screen) pos = this.total - this.screen;
|
13688 |
+
if (!force && pos == this.pos) return false;
|
13689 |
+
this.pos = pos;
|
13690 |
+
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
|
13691 |
+
(pos * (this.size / this.total)) + "px";
|
13692 |
+
return true
|
13693 |
+
};
|
13694 |
+
|
13695 |
+
Bar.prototype.moveTo = function(pos) {
|
13696 |
+
if (this.setPos(pos)) this.scroll(pos, this.orientation);
|
13697 |
+
}
|
13698 |
+
|
13699 |
+
var minButtonSize = 10;
|
13700 |
+
|
13701 |
+
Bar.prototype.update = function(scrollSize, clientSize, barSize) {
|
13702 |
+
var sizeChanged = this.screen != clientSize || this.total != scrollSize || this.size != barSize
|
13703 |
+
if (sizeChanged) {
|
13704 |
+
this.screen = clientSize;
|
13705 |
+
this.total = scrollSize;
|
13706 |
+
this.size = barSize;
|
13707 |
+
}
|
13708 |
+
|
13709 |
+
var buttonSize = this.screen * (this.size / this.total);
|
13710 |
+
if (buttonSize < minButtonSize) {
|
13711 |
+
this.size -= minButtonSize - buttonSize;
|
13712 |
+
buttonSize = minButtonSize;
|
13713 |
+
}
|
13714 |
+
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
|
13715 |
+
buttonSize + "px";
|
13716 |
+
this.setPos(this.pos, sizeChanged);
|
13717 |
+
};
|
13718 |
+
|
13719 |
+
function SimpleScrollbars(cls, place, scroll) {
|
13720 |
+
this.addClass = cls;
|
13721 |
+
this.horiz = new Bar(cls, "horizontal", scroll);
|
13722 |
+
place(this.horiz.node);
|
13723 |
+
this.vert = new Bar(cls, "vertical", scroll);
|
13724 |
+
place(this.vert.node);
|
13725 |
+
this.width = null;
|
13726 |
+
}
|
13727 |
+
|
13728 |
+
SimpleScrollbars.prototype.update = function(measure) {
|
13729 |
+
if (this.width == null) {
|
13730 |
+
var style = window.getComputedStyle ? window.getComputedStyle(this.horiz.node) : this.horiz.node.currentStyle;
|
13731 |
+
if (style) this.width = parseInt(style.height);
|
13732 |
+
}
|
13733 |
+
var width = this.width || 0;
|
13734 |
+
|
13735 |
+
var needsH = measure.scrollWidth > measure.clientWidth + 1;
|
13736 |
+
var needsV = measure.scrollHeight > measure.clientHeight + 1;
|
13737 |
+
this.vert.node.style.display = needsV ? "block" : "none";
|
13738 |
+
this.horiz.node.style.display = needsH ? "block" : "none";
|
13739 |
+
|
13740 |
+
if (needsV) {
|
13741 |
+
this.vert.update(measure.scrollHeight, measure.clientHeight,
|
13742 |
+
measure.viewHeight - (needsH ? width : 0));
|
13743 |
+
this.vert.node.style.bottom = needsH ? width + "px" : "0";
|
13744 |
+
}
|
13745 |
+
if (needsH) {
|
13746 |
+
this.horiz.update(measure.scrollWidth, measure.clientWidth,
|
13747 |
+
measure.viewWidth - (needsV ? width : 0) - measure.barLeft);
|
13748 |
+
this.horiz.node.style.right = needsV ? width + "px" : "0";
|
13749 |
+
this.horiz.node.style.left = measure.barLeft + "px";
|
13750 |
+
}
|
13751 |
+
|
13752 |
+
return {right: needsV ? width : 0, bottom: needsH ? width : 0};
|
13753 |
+
};
|
13754 |
+
|
13755 |
+
SimpleScrollbars.prototype.setScrollTop = function(pos) {
|
13756 |
+
this.vert.setPos(pos);
|
13757 |
+
};
|
13758 |
+
|
13759 |
+
SimpleScrollbars.prototype.setScrollLeft = function(pos) {
|
13760 |
+
this.horiz.setPos(pos);
|
13761 |
+
};
|
13762 |
+
|
13763 |
+
SimpleScrollbars.prototype.clear = function() {
|
13764 |
+
var parent = this.horiz.node.parentNode;
|
13765 |
+
parent.removeChild(this.horiz.node);
|
13766 |
+
parent.removeChild(this.vert.node);
|
13767 |
+
};
|
13768 |
+
|
13769 |
+
CodeMirror.scrollbarModel.simple = function(place, scroll) {
|
13770 |
+
return new SimpleScrollbars("CodeMirror-simplescroll", place, scroll);
|
13771 |
+
};
|
13772 |
+
CodeMirror.scrollbarModel.overlay = function(place, scroll) {
|
13773 |
+
return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll);
|
13774 |
+
};
|
13775 |
+
});
|
13776 |
+
|
13777 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
13778 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
13779 |
+
|
13780 |
+
(function(mod) {
|
13781 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
13782 |
+
mod(require("../../lib/codemirror"));
|
13783 |
+
else if (typeof define == "function" && define.amd) // AMD
|
13784 |
+
define(["../../lib/codemirror"], mod);
|
13785 |
+
else // Plain browser env
|
13786 |
+
mod(CodeMirror);
|
13787 |
+
})(function(CodeMirror) {
|
13788 |
+
"use strict";
|
13789 |
+
|
13790 |
+
var noOptions = {};
|
13791 |
+
var nonWS = /[^\s\u00a0]/;
|
13792 |
+
var Pos = CodeMirror.Pos;
|
13793 |
+
|
13794 |
+
function firstNonWS(str) {
|
13795 |
+
var found = str.search(nonWS);
|
13796 |
+
return found == -1 ? 0 : found;
|
13797 |
+
}
|
13798 |
+
|
13799 |
+
CodeMirror.commands.toggleComment = function(cm) {
|
13800 |
+
cm.toggleComment();
|
13801 |
+
};
|
13802 |
+
|
13803 |
+
CodeMirror.defineExtension("toggleComment", function(options) {
|
13804 |
+
if (!options) options = noOptions;
|
13805 |
+
var cm = this;
|
13806 |
+
var minLine = Infinity, ranges = this.listSelections(), mode = null;
|
13807 |
+
for (var i = ranges.length - 1; i >= 0; i--) {
|
13808 |
+
var from = ranges[i].from(), to = ranges[i].to();
|
13809 |
+
if (from.line >= minLine) continue;
|
13810 |
+
if (to.line >= minLine) to = Pos(minLine, 0);
|
13811 |
+
minLine = from.line;
|
13812 |
+
if (mode == null) {
|
13813 |
+
if (cm.uncomment(from, to, options)) mode = "un";
|
13814 |
+
else { cm.lineComment(from, to, options); mode = "line"; }
|
13815 |
+
} else if (mode == "un") {
|
13816 |
+
cm.uncomment(from, to, options);
|
13817 |
+
} else {
|
13818 |
+
cm.lineComment(from, to, options);
|
13819 |
+
}
|
13820 |
+
}
|
13821 |
+
});
|
13822 |
+
|
13823 |
+
// Rough heuristic to try and detect lines that are part of multi-line string
|
13824 |
+
function probablyInsideString(cm, pos, line) {
|
13825 |
+
return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line)
|
13826 |
+
}
|
13827 |
+
|
13828 |
+
function getMode(cm, pos) {
|
13829 |
+
var mode = cm.getMode()
|
13830 |
+
return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos)
|
13831 |
+
}
|
13832 |
+
|
13833 |
+
CodeMirror.defineExtension("lineComment", function(from, to, options) {
|
13834 |
+
if (!options) options = noOptions;
|
13835 |
+
var self = this, mode = getMode(self, from);
|
13836 |
+
var firstLine = self.getLine(from.line);
|
13837 |
+
if (firstLine == null || probablyInsideString(self, from, firstLine)) return;
|
13838 |
+
|
13839 |
+
var commentString = options.lineComment || mode.lineComment;
|
13840 |
+
if (!commentString) {
|
13841 |
+
if (options.blockCommentStart || mode.blockCommentStart) {
|
13842 |
+
options.fullLines = true;
|
13843 |
+
self.blockComment(from, to, options);
|
13844 |
+
}
|
13845 |
+
return;
|
13846 |
+
}
|
13847 |
+
|
13848 |
+
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
|
13849 |
+
var pad = options.padding == null ? " " : options.padding;
|
13850 |
+
var blankLines = options.commentBlankLines || from.line == to.line;
|
13851 |
+
|
13852 |
+
self.operation(function() {
|
13853 |
+
if (options.indent) {
|
13854 |
+
var baseString = null;
|
13855 |
+
for (var i = from.line; i < end; ++i) {
|
13856 |
+
var line = self.getLine(i);
|
13857 |
+
var whitespace = line.slice(0, firstNonWS(line));
|
13858 |
+
if (baseString == null || baseString.length > whitespace.length) {
|
13859 |
+
baseString = whitespace;
|
13860 |
+
}
|
13861 |
+
}
|
13862 |
+
for (var i = from.line; i < end; ++i) {
|
13863 |
+
var line = self.getLine(i), cut = baseString.length;
|
13864 |
+
if (!blankLines && !nonWS.test(line)) continue;
|
13865 |
+
if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
|
13866 |
+
self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
|
13867 |
+
}
|
13868 |
+
} else {
|
13869 |
+
for (var i = from.line; i < end; ++i) {
|
13870 |
+
if (blankLines || nonWS.test(self.getLine(i)))
|
13871 |
+
self.replaceRange(commentString + pad, Pos(i, 0));
|
13872 |
+
}
|
13873 |
+
}
|
13874 |
+
});
|
13875 |
+
});
|
13876 |
+
|
13877 |
+
CodeMirror.defineExtension("blockComment", function(from, to, options) {
|
13878 |
+
if (!options) options = noOptions;
|
13879 |
+
var self = this, mode = getMode(self, from);
|
13880 |
+
var startString = options.blockCommentStart || mode.blockCommentStart;
|
13881 |
+
var endString = options.blockCommentEnd || mode.blockCommentEnd;
|
13882 |
+
if (!startString || !endString) {
|
13883 |
+
if ((options.lineComment || mode.lineComment) && options.fullLines != false)
|
13884 |
+
self.lineComment(from, to, options);
|
13885 |
+
return;
|
13886 |
+
}
|
13887 |
+
if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return
|
13888 |
+
|
13889 |
+
var end = Math.min(to.line, self.lastLine());
|
13890 |
+
if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
|
13891 |
+
|
13892 |
+
var pad = options.padding == null ? " " : options.padding;
|
13893 |
+
if (from.line > end) return;
|
13894 |
+
|
13895 |
+
self.operation(function() {
|
13896 |
+
if (options.fullLines != false) {
|
13897 |
+
var lastLineHasText = nonWS.test(self.getLine(end));
|
13898 |
+
self.replaceRange(pad + endString, Pos(end));
|
13899 |
+
self.replaceRange(startString + pad, Pos(from.line, 0));
|
13900 |
+
var lead = options.blockCommentLead || mode.blockCommentLead;
|
13901 |
+
if (lead != null) for (var i = from.line + 1; i <= end; ++i)
|
13902 |
+
if (i != end || lastLineHasText)
|
13903 |
+
self.replaceRange(lead + pad, Pos(i, 0));
|
13904 |
+
} else {
|
13905 |
+
self.replaceRange(endString, to);
|
13906 |
+
self.replaceRange(startString, from);
|
13907 |
+
}
|
13908 |
+
});
|
13909 |
+
});
|
13910 |
+
|
13911 |
+
CodeMirror.defineExtension("uncomment", function(from, to, options) {
|
13912 |
+
if (!options) options = noOptions;
|
13913 |
+
var self = this, mode = getMode(self, from);
|
13914 |
+
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
|
13915 |
+
|
13916 |
+
// Try finding line comments
|
13917 |
+
var lineString = options.lineComment || mode.lineComment, lines = [];
|
13918 |
+
var pad = options.padding == null ? " " : options.padding, didSomething;
|
13919 |
+
lineComment: {
|
13920 |
+
if (!lineString) break lineComment;
|
13921 |
+
for (var i = start; i <= end; ++i) {
|
13922 |
+
var line = self.getLine(i);
|
13923 |
+
var found = line.indexOf(lineString);
|
13924 |
+
if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
|
13925 |
+
if (found == -1 && nonWS.test(line)) break lineComment;
|
13926 |
+
if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
|
13927 |
+
lines.push(line);
|
13928 |
+
}
|
13929 |
+
self.operation(function() {
|
13930 |
+
for (var i = start; i <= end; ++i) {
|
13931 |
+
var line = lines[i - start];
|
13932 |
+
var pos = line.indexOf(lineString), endPos = pos + lineString.length;
|
13933 |
+
if (pos < 0) continue;
|
13934 |
+
if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
|
13935 |
+
didSomething = true;
|
13936 |
+
self.replaceRange("", Pos(i, pos), Pos(i, endPos));
|
13937 |
+
}
|
13938 |
+
});
|
13939 |
+
if (didSomething) return true;
|
13940 |
+
}
|
13941 |
+
|
13942 |
+
// Try block comments
|
13943 |
+
var startString = options.blockCommentStart || mode.blockCommentStart;
|
13944 |
+
var endString = options.blockCommentEnd || mode.blockCommentEnd;
|
13945 |
+
if (!startString || !endString) return false;
|
13946 |
+
var lead = options.blockCommentLead || mode.blockCommentLead;
|
13947 |
+
var startLine = self.getLine(start), open = startLine.indexOf(startString)
|
13948 |
+
if (open == -1) return false
|
13949 |
+
var endLine = end == start ? startLine : self.getLine(end)
|
13950 |
+
var close = endLine.indexOf(endString, end == start ? open + startString.length : 0);
|
13951 |
+
if (close == -1 && start != end) {
|
13952 |
+
endLine = self.getLine(--end);
|
13953 |
+
close = endLine.indexOf(endString);
|
13954 |
+
}
|
13955 |
+
var insideStart = Pos(start, open + 1), insideEnd = Pos(end, close + 1)
|
13956 |
+
if (close == -1 ||
|
13957 |
+
!/comment/.test(self.getTokenTypeAt(insideStart)) ||
|
13958 |
+
!/comment/.test(self.getTokenTypeAt(insideEnd)) ||
|
13959 |
+
self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1)
|
13960 |
+
return false;
|
13961 |
+
|
13962 |
+
// Avoid killing block comments completely outside the selection.
|
13963 |
+
// Positions of the last startString before the start of the selection, and the first endString after it.
|
13964 |
+
var lastStart = startLine.lastIndexOf(startString, from.ch);
|
13965 |
+
var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);
|
13966 |
+
if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;
|
13967 |
+
// Positions of the first endString after the end of the selection, and the last startString before it.
|
13968 |
+
firstEnd = endLine.indexOf(endString, to.ch);
|
13969 |
+
var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);
|
13970 |
+
lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;
|
13971 |
+
if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;
|
13972 |
+
|
13973 |
+
self.operation(function() {
|
13974 |
+
self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
|
13975 |
+
Pos(end, close + endString.length));
|
13976 |
+
var openEnd = open + startString.length;
|
13977 |
+
if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
|
13978 |
+
self.replaceRange("", Pos(start, open), Pos(start, openEnd));
|
13979 |
+
if (lead) for (var i = start + 1; i <= end; ++i) {
|
13980 |
+
var line = self.getLine(i), found = line.indexOf(lead);
|
13981 |
+
if (found == -1 || nonWS.test(line.slice(0, found))) continue;
|
13982 |
+
var foundEnd = found + lead.length;
|
13983 |
+
if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
|
13984 |
+
self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
|
13985 |
+
}
|
13986 |
+
});
|
13987 |
+
return true;
|
13988 |
+
});
|
13989 |
+
});
|
13990 |
+
|
13991 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
13992 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
13993 |
+
|
13994 |
+
(function(mod) {
|
13995 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
13996 |
+
mod(require("../../lib/codemirror"));
|
13997 |
+
else if (typeof define == "function" && define.amd) // AMD
|
13998 |
+
define(["../../lib/codemirror"], mod);
|
13999 |
+
else // Plain browser env
|
14000 |
+
mod(CodeMirror);
|
14001 |
+
})(function(CodeMirror) {
|
14002 |
+
"use strict";
|
14003 |
+
|
14004 |
+
function doFold(cm, pos, options, force) {
|
14005 |
+
if (options && options.call) {
|
14006 |
+
var finder = options;
|
14007 |
+
options = null;
|
14008 |
+
} else {
|
14009 |
+
var finder = getOption(cm, options, "rangeFinder");
|
14010 |
+
}
|
14011 |
+
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
|
14012 |
+
var minSize = getOption(cm, options, "minFoldSize");
|
14013 |
+
|
14014 |
+
function getRange(allowFolded) {
|
14015 |
+
var range = finder(cm, pos);
|
14016 |
+
if (!range || range.to.line - range.from.line < minSize) return null;
|
14017 |
+
var marks = cm.findMarksAt(range.from);
|
14018 |
+
for (var i = 0; i < marks.length; ++i) {
|
14019 |
+
if (marks[i].__isFold && force !== "fold") {
|
14020 |
+
if (!allowFolded) return null;
|
14021 |
+
range.cleared = true;
|
14022 |
+
marks[i].clear();
|
14023 |
+
}
|
14024 |
+
}
|
14025 |
+
return range;
|
14026 |
+
}
|
14027 |
+
|
14028 |
+
var range = getRange(true);
|
14029 |
+
if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) {
|
14030 |
+
pos = CodeMirror.Pos(pos.line - 1, 0);
|
14031 |
+
range = getRange(false);
|
14032 |
+
}
|
14033 |
+
if (!range || range.cleared || force === "unfold") return;
|
14034 |
+
|
14035 |
+
var myWidget = makeWidget(cm, options);
|
14036 |
+
CodeMirror.on(myWidget, "mousedown", function(e) {
|
14037 |
+
myRange.clear();
|
14038 |
+
CodeMirror.e_preventDefault(e);
|
14039 |
+
});
|
14040 |
+
var myRange = cm.markText(range.from, range.to, {
|
14041 |
+
replacedWith: myWidget,
|
14042 |
+
clearOnEnter: getOption(cm, options, "clearOnEnter"),
|
14043 |
+
__isFold: true
|
14044 |
+
});
|
14045 |
+
myRange.on("clear", function(from, to) {
|
14046 |
+
CodeMirror.signal(cm, "unfold", cm, from, to);
|
14047 |
+
});
|
14048 |
+
CodeMirror.signal(cm, "fold", cm, range.from, range.to);
|
14049 |
+
}
|
14050 |
+
|
14051 |
+
function makeWidget(cm, options) {
|
14052 |
+
var widget = getOption(cm, options, "widget");
|
14053 |
+
if (typeof widget == "string") {
|
14054 |
+
var text = document.createTextNode(widget);
|
14055 |
+
widget = document.createElement("span");
|
14056 |
+
widget.appendChild(text);
|
14057 |
+
widget.className = "CodeMirror-foldmarker";
|
14058 |
+
}
|
14059 |
+
return widget;
|
14060 |
+
}
|
14061 |
+
|
14062 |
+
// Clumsy backwards-compatible interface
|
14063 |
+
CodeMirror.newFoldFunction = function(rangeFinder, widget) {
|
14064 |
+
return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
|
14065 |
+
};
|
14066 |
+
|
14067 |
+
// New-style interface
|
14068 |
+
CodeMirror.defineExtension("foldCode", function(pos, options, force) {
|
14069 |
+
doFold(this, pos, options, force);
|
14070 |
+
});
|
14071 |
+
|
14072 |
+
CodeMirror.defineExtension("isFolded", function(pos) {
|
14073 |
+
var marks = this.findMarksAt(pos);
|
14074 |
+
for (var i = 0; i < marks.length; ++i)
|
14075 |
+
if (marks[i].__isFold) return true;
|
14076 |
+
});
|
14077 |
+
|
14078 |
+
CodeMirror.commands.toggleFold = function(cm) {
|
14079 |
+
cm.foldCode(cm.getCursor());
|
14080 |
+
};
|
14081 |
+
CodeMirror.commands.fold = function(cm) {
|
14082 |
+
cm.foldCode(cm.getCursor(), null, "fold");
|
14083 |
+
};
|
14084 |
+
CodeMirror.commands.unfold = function(cm) {
|
14085 |
+
cm.foldCode(cm.getCursor(), null, "unfold");
|
14086 |
+
};
|
14087 |
+
CodeMirror.commands.foldAll = function(cm) {
|
14088 |
+
cm.operation(function() {
|
14089 |
+
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
|
14090 |
+
cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
|
14091 |
+
});
|
14092 |
+
};
|
14093 |
+
CodeMirror.commands.unfoldAll = function(cm) {
|
14094 |
+
cm.operation(function() {
|
14095 |
+
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
|
14096 |
+
cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
|
14097 |
+
});
|
14098 |
+
};
|
14099 |
+
|
14100 |
+
CodeMirror.registerHelper("fold", "combine", function() {
|
14101 |
+
var funcs = Array.prototype.slice.call(arguments, 0);
|
14102 |
+
return function(cm, start) {
|
14103 |
+
for (var i = 0; i < funcs.length; ++i) {
|
14104 |
+
var found = funcs[i](cm, start);
|
14105 |
+
if (found) return found;
|
14106 |
+
}
|
14107 |
+
};
|
14108 |
+
});
|
14109 |
+
|
14110 |
+
CodeMirror.registerHelper("fold", "auto", function(cm, start) {
|
14111 |
+
var helpers = cm.getHelpers(start, "fold");
|
14112 |
+
for (var i = 0; i < helpers.length; i++) {
|
14113 |
+
var cur = helpers[i](cm, start);
|
14114 |
+
if (cur) return cur;
|
14115 |
+
}
|
14116 |
+
});
|
14117 |
+
|
14118 |
+
var defaultOptions = {
|
14119 |
+
rangeFinder: CodeMirror.fold.auto,
|
14120 |
+
widget: "\u2194",
|
14121 |
+
minFoldSize: 0,
|
14122 |
+
scanUp: false,
|
14123 |
+
clearOnEnter: true
|
14124 |
+
};
|
14125 |
+
|
14126 |
+
CodeMirror.defineOption("foldOptions", null);
|
14127 |
+
|
14128 |
+
function getOption(cm, options, name) {
|
14129 |
+
if (options && options[name] !== undefined)
|
14130 |
+
return options[name];
|
14131 |
+
var editorOptions = cm.options.foldOptions;
|
14132 |
+
if (editorOptions && editorOptions[name] !== undefined)
|
14133 |
+
return editorOptions[name];
|
14134 |
+
return defaultOptions[name];
|
14135 |
+
}
|
14136 |
+
|
14137 |
+
CodeMirror.defineExtension("foldOption", function(options, name) {
|
14138 |
+
return getOption(this, options, name);
|
14139 |
+
});
|
14140 |
+
});
|
14141 |
+
|
14142 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14143 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14144 |
+
|
14145 |
+
(function(mod) {
|
14146 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14147 |
+
mod(require("../../lib/codemirror"), require("./foldcode"));
|
14148 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14149 |
+
define(["../../lib/codemirror", "./foldcode"], mod);
|
14150 |
+
else // Plain browser env
|
14151 |
+
mod(CodeMirror);
|
14152 |
+
})(function(CodeMirror) {
|
14153 |
+
"use strict";
|
14154 |
+
|
14155 |
+
CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
|
14156 |
+
if (old && old != CodeMirror.Init) {
|
14157 |
+
cm.clearGutter(cm.state.foldGutter.options.gutter);
|
14158 |
+
cm.state.foldGutter = null;
|
14159 |
+
cm.off("gutterClick", onGutterClick);
|
14160 |
+
cm.off("change", onChange);
|
14161 |
+
cm.off("viewportChange", onViewportChange);
|
14162 |
+
cm.off("fold", onFold);
|
14163 |
+
cm.off("unfold", onFold);
|
14164 |
+
cm.off("swapDoc", onChange);
|
14165 |
+
}
|
14166 |
+
if (val) {
|
14167 |
+
cm.state.foldGutter = new State(parseOptions(val));
|
14168 |
+
updateInViewport(cm);
|
14169 |
+
cm.on("gutterClick", onGutterClick);
|
14170 |
+
cm.on("change", onChange);
|
14171 |
+
cm.on("viewportChange", onViewportChange);
|
14172 |
+
cm.on("fold", onFold);
|
14173 |
+
cm.on("unfold", onFold);
|
14174 |
+
cm.on("swapDoc", onChange);
|
14175 |
+
}
|
14176 |
+
});
|
14177 |
+
|
14178 |
+
var Pos = CodeMirror.Pos;
|
14179 |
+
|
14180 |
+
function State(options) {
|
14181 |
+
this.options = options;
|
14182 |
+
this.from = this.to = 0;
|
14183 |
+
}
|
14184 |
+
|
14185 |
+
function parseOptions(opts) {
|
14186 |
+
if (opts === true) opts = {};
|
14187 |
+
if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
|
14188 |
+
if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
|
14189 |
+
if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
|
14190 |
+
return opts;
|
14191 |
+
}
|
14192 |
+
|
14193 |
+
function isFolded(cm, line) {
|
14194 |
+
var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
|
14195 |
+
for (var i = 0; i < marks.length; ++i)
|
14196 |
+
if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
|
14197 |
+
}
|
14198 |
+
|
14199 |
+
function marker(spec) {
|
14200 |
+
if (typeof spec == "string") {
|
14201 |
+
var elt = document.createElement("div");
|
14202 |
+
elt.className = spec + " CodeMirror-guttermarker-subtle";
|
14203 |
+
return elt;
|
14204 |
+
} else {
|
14205 |
+
return spec.cloneNode(true);
|
14206 |
+
}
|
14207 |
+
}
|
14208 |
+
|
14209 |
+
function updateFoldInfo(cm, from, to) {
|
14210 |
+
var opts = cm.state.foldGutter.options, cur = from;
|
14211 |
+
var minSize = cm.foldOption(opts, "minFoldSize");
|
14212 |
+
var func = cm.foldOption(opts, "rangeFinder");
|
14213 |
+
cm.eachLine(from, to, function(line) {
|
14214 |
+
var mark = null;
|
14215 |
+
if (isFolded(cm, cur)) {
|
14216 |
+
mark = marker(opts.indicatorFolded);
|
14217 |
+
} else {
|
14218 |
+
var pos = Pos(cur, 0);
|
14219 |
+
var range = func && func(cm, pos);
|
14220 |
+
if (range && range.to.line - range.from.line >= minSize)
|
14221 |
+
mark = marker(opts.indicatorOpen);
|
14222 |
+
}
|
14223 |
+
cm.setGutterMarker(line, opts.gutter, mark);
|
14224 |
+
++cur;
|
14225 |
+
});
|
14226 |
+
}
|
14227 |
+
|
14228 |
+
function updateInViewport(cm) {
|
14229 |
+
var vp = cm.getViewport(), state = cm.state.foldGutter;
|
14230 |
+
if (!state) return;
|
14231 |
+
cm.operation(function() {
|
14232 |
+
updateFoldInfo(cm, vp.from, vp.to);
|
14233 |
+
});
|
14234 |
+
state.from = vp.from; state.to = vp.to;
|
14235 |
+
}
|
14236 |
+
|
14237 |
+
function onGutterClick(cm, line, gutter) {
|
14238 |
+
var state = cm.state.foldGutter;
|
14239 |
+
if (!state) return;
|
14240 |
+
var opts = state.options;
|
14241 |
+
if (gutter != opts.gutter) return;
|
14242 |
+
var folded = isFolded(cm, line);
|
14243 |
+
if (folded) folded.clear();
|
14244 |
+
else cm.foldCode(Pos(line, 0), opts.rangeFinder);
|
14245 |
+
}
|
14246 |
+
|
14247 |
+
function onChange(cm) {
|
14248 |
+
var state = cm.state.foldGutter;
|
14249 |
+
if (!state) return;
|
14250 |
+
var opts = state.options;
|
14251 |
+
state.from = state.to = 0;
|
14252 |
+
clearTimeout(state.changeUpdate);
|
14253 |
+
state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
|
14254 |
+
}
|
14255 |
+
|
14256 |
+
function onViewportChange(cm) {
|
14257 |
+
var state = cm.state.foldGutter;
|
14258 |
+
if (!state) return;
|
14259 |
+
var opts = state.options;
|
14260 |
+
clearTimeout(state.changeUpdate);
|
14261 |
+
state.changeUpdate = setTimeout(function() {
|
14262 |
+
var vp = cm.getViewport();
|
14263 |
+
if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
|
14264 |
+
updateInViewport(cm);
|
14265 |
+
} else {
|
14266 |
+
cm.operation(function() {
|
14267 |
+
if (vp.from < state.from) {
|
14268 |
+
updateFoldInfo(cm, vp.from, state.from);
|
14269 |
+
state.from = vp.from;
|
14270 |
+
}
|
14271 |
+
if (vp.to > state.to) {
|
14272 |
+
updateFoldInfo(cm, state.to, vp.to);
|
14273 |
+
state.to = vp.to;
|
14274 |
+
}
|
14275 |
+
});
|
14276 |
+
}
|
14277 |
+
}, opts.updateViewportTimeSpan || 400);
|
14278 |
+
}
|
14279 |
+
|
14280 |
+
function onFold(cm, from) {
|
14281 |
+
var state = cm.state.foldGutter;
|
14282 |
+
if (!state) return;
|
14283 |
+
var line = from.line;
|
14284 |
+
if (line >= state.from && line < state.to)
|
14285 |
+
updateFoldInfo(cm, line, line + 1);
|
14286 |
+
}
|
14287 |
+
});
|
14288 |
+
|
14289 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14290 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14291 |
+
|
14292 |
+
(function(mod) {
|
14293 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14294 |
+
mod(require("../../lib/codemirror"));
|
14295 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14296 |
+
define(["../../lib/codemirror"], mod);
|
14297 |
+
else // Plain browser env
|
14298 |
+
mod(CodeMirror);
|
14299 |
+
})(function(CodeMirror) {
|
14300 |
+
"use strict";
|
14301 |
+
|
14302 |
+
var Pos = CodeMirror.Pos;
|
14303 |
+
function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }
|
14304 |
+
|
14305 |
+
var nameStartChar = "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";
|
14306 |
+
var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
14307 |
+
var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
|
14308 |
+
|
14309 |
+
function Iter(cm, line, ch, range) {
|
14310 |
+
this.line = line; this.ch = ch;
|
14311 |
+
this.cm = cm; this.text = cm.getLine(line);
|
14312 |
+
this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();
|
14313 |
+
this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();
|
14314 |
+
}
|
14315 |
+
|
14316 |
+
function tagAt(iter, ch) {
|
14317 |
+
var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));
|
14318 |
+
return type && /\btag\b/.test(type);
|
14319 |
+
}
|
14320 |
+
|
14321 |
+
function nextLine(iter) {
|
14322 |
+
if (iter.line >= iter.max) return;
|
14323 |
+
iter.ch = 0;
|
14324 |
+
iter.text = iter.cm.getLine(++iter.line);
|
14325 |
+
return true;
|
14326 |
+
}
|
14327 |
+
function prevLine(iter) {
|
14328 |
+
if (iter.line <= iter.min) return;
|
14329 |
+
iter.text = iter.cm.getLine(--iter.line);
|
14330 |
+
iter.ch = iter.text.length;
|
14331 |
+
return true;
|
14332 |
+
}
|
14333 |
+
|
14334 |
+
function toTagEnd(iter) {
|
14335 |
+
for (;;) {
|
14336 |
+
var gt = iter.text.indexOf(">", iter.ch);
|
14337 |
+
if (gt == -1) { if (nextLine(iter)) continue; else return; }
|
14338 |
+
if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
|
14339 |
+
var lastSlash = iter.text.lastIndexOf("/", gt);
|
14340 |
+
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
14341 |
+
iter.ch = gt + 1;
|
14342 |
+
return selfClose ? "selfClose" : "regular";
|
14343 |
+
}
|
14344 |
+
}
|
14345 |
+
function toTagStart(iter) {
|
14346 |
+
for (;;) {
|
14347 |
+
var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1;
|
14348 |
+
if (lt == -1) { if (prevLine(iter)) continue; else return; }
|
14349 |
+
if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }
|
14350 |
+
xmlTagStart.lastIndex = lt;
|
14351 |
+
iter.ch = lt;
|
14352 |
+
var match = xmlTagStart.exec(iter.text);
|
14353 |
+
if (match && match.index == lt) return match;
|
14354 |
+
}
|
14355 |
+
}
|
14356 |
+
|
14357 |
+
function toNextTag(iter) {
|
14358 |
+
for (;;) {
|
14359 |
+
xmlTagStart.lastIndex = iter.ch;
|
14360 |
+
var found = xmlTagStart.exec(iter.text);
|
14361 |
+
if (!found) { if (nextLine(iter)) continue; else return; }
|
14362 |
+
if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }
|
14363 |
+
iter.ch = found.index + found[0].length;
|
14364 |
+
return found;
|
14365 |
+
}
|
14366 |
+
}
|
14367 |
+
function toPrevTag(iter) {
|
14368 |
+
for (;;) {
|
14369 |
+
var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1;
|
14370 |
+
if (gt == -1) { if (prevLine(iter)) continue; else return; }
|
14371 |
+
if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
|
14372 |
+
var lastSlash = iter.text.lastIndexOf("/", gt);
|
14373 |
+
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
14374 |
+
iter.ch = gt + 1;
|
14375 |
+
return selfClose ? "selfClose" : "regular";
|
14376 |
+
}
|
14377 |
+
}
|
14378 |
+
|
14379 |
+
function findMatchingClose(iter, tag) {
|
14380 |
+
var stack = [];
|
14381 |
+
for (;;) {
|
14382 |
+
var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);
|
14383 |
+
if (!next || !(end = toTagEnd(iter))) return;
|
14384 |
+
if (end == "selfClose") continue;
|
14385 |
+
if (next[1]) { // closing tag
|
14386 |
+
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
|
14387 |
+
stack.length = i;
|
14388 |
+
break;
|
14389 |
+
}
|
14390 |
+
if (i < 0 && (!tag || tag == next[2])) return {
|
14391 |
+
tag: next[2],
|
14392 |
+
from: Pos(startLine, startCh),
|
14393 |
+
to: Pos(iter.line, iter.ch)
|
14394 |
+
};
|
14395 |
+
} else { // opening tag
|
14396 |
+
stack.push(next[2]);
|
14397 |
+
}
|
14398 |
+
}
|
14399 |
+
}
|
14400 |
+
function findMatchingOpen(iter, tag) {
|
14401 |
+
var stack = [];
|
14402 |
+
for (;;) {
|
14403 |
+
var prev = toPrevTag(iter);
|
14404 |
+
if (!prev) return;
|
14405 |
+
if (prev == "selfClose") { toTagStart(iter); continue; }
|
14406 |
+
var endLine = iter.line, endCh = iter.ch;
|
14407 |
+
var start = toTagStart(iter);
|
14408 |
+
if (!start) return;
|
14409 |
+
if (start[1]) { // closing tag
|
14410 |
+
stack.push(start[2]);
|
14411 |
+
} else { // opening tag
|
14412 |
+
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {
|
14413 |
+
stack.length = i;
|
14414 |
+
break;
|
14415 |
+
}
|
14416 |
+
if (i < 0 && (!tag || tag == start[2])) return {
|
14417 |
+
tag: start[2],
|
14418 |
+
from: Pos(iter.line, iter.ch),
|
14419 |
+
to: Pos(endLine, endCh)
|
14420 |
+
};
|
14421 |
+
}
|
14422 |
+
}
|
14423 |
+
}
|
14424 |
+
|
14425 |
+
CodeMirror.registerHelper("fold", "xml", function(cm, start) {
|
14426 |
+
var iter = new Iter(cm, start.line, 0);
|
14427 |
+
for (;;) {
|
14428 |
+
var openTag = toNextTag(iter), end;
|
14429 |
+
if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
|
14430 |
+
if (!openTag[1] && end != "selfClose") {
|
14431 |
+
var startPos = Pos(iter.line, iter.ch);
|
14432 |
+
var endPos = findMatchingClose(iter, openTag[2]);
|
14433 |
+
return endPos && {from: startPos, to: endPos.from};
|
14434 |
+
}
|
14435 |
+
}
|
14436 |
+
});
|
14437 |
+
CodeMirror.findMatchingTag = function(cm, pos, range) {
|
14438 |
+
var iter = new Iter(cm, pos.line, pos.ch, range);
|
14439 |
+
if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return;
|
14440 |
+
var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch);
|
14441 |
+
var start = end && toTagStart(iter);
|
14442 |
+
if (!end || !start || cmp(iter, pos) > 0) return;
|
14443 |
+
var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]};
|
14444 |
+
if (end == "selfClose") return {open: here, close: null, at: "open"};
|
14445 |
+
|
14446 |
+
if (start[1]) { // closing tag
|
14447 |
+
return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"};
|
14448 |
+
} else { // opening tag
|
14449 |
+
iter = new Iter(cm, to.line, to.ch, range);
|
14450 |
+
return {open: here, close: findMatchingClose(iter, start[2]), at: "open"};
|
14451 |
+
}
|
14452 |
+
};
|
14453 |
+
|
14454 |
+
CodeMirror.findEnclosingTag = function(cm, pos, range) {
|
14455 |
+
var iter = new Iter(cm, pos.line, pos.ch, range);
|
14456 |
+
for (;;) {
|
14457 |
+
var open = findMatchingOpen(iter);
|
14458 |
+
if (!open) break;
|
14459 |
+
var forward = new Iter(cm, pos.line, pos.ch, range);
|
14460 |
+
var close = findMatchingClose(forward, open.tag);
|
14461 |
+
if (close) return {open: open, close: close};
|
14462 |
+
}
|
14463 |
+
};
|
14464 |
+
|
14465 |
+
// Used by addon/edit/closetag.js
|
14466 |
+
CodeMirror.scanForClosingTag = function(cm, pos, name, end) {
|
14467 |
+
var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);
|
14468 |
+
return findMatchingClose(iter, name);
|
14469 |
+
};
|
14470 |
+
});
|
14471 |
+
|
14472 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14473 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14474 |
+
|
14475 |
+
(function(mod) {
|
14476 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14477 |
+
mod(require("../../lib/codemirror"));
|
14478 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14479 |
+
define(["../../lib/codemirror"], mod);
|
14480 |
+
else // Plain browser env
|
14481 |
+
mod(CodeMirror);
|
14482 |
+
})(function(CodeMirror) {
|
14483 |
+
"use strict";
|
14484 |
+
|
14485 |
+
function lineIndent(cm, lineNo) {
|
14486 |
+
var text = cm.getLine(lineNo)
|
14487 |
+
var spaceTo = text.search(/\S/)
|
14488 |
+
if (spaceTo == -1 || /\bcomment\b/.test(cm.getTokenTypeAt(CodeMirror.Pos(lineNo, spaceTo + 1))))
|
14489 |
+
return -1
|
14490 |
+
return CodeMirror.countColumn(text, null, cm.getOption("tabSize"))
|
14491 |
+
}
|
14492 |
+
!
|
14493 |
+
CodeMirror.registerHelper("fold", "indent", function(cm, start) {
|
14494 |
+
var myIndent = lineIndent(cm, start.line)
|
14495 |
+
if (myIndent < 0) return
|
14496 |
+
var lastLineInFold = null
|
14497 |
+
|
14498 |
+
// Go through lines until we find a line that definitely doesn't belong in
|
14499 |
+
// the block we're folding, or to the end.
|
14500 |
+
for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
|
14501 |
+
var indent = lineIndent(cm, i)
|
14502 |
+
if (indent == -1) {
|
14503 |
+
} else if (indent > myIndent) {
|
14504 |
+
// Lines with a greater indent are considered part of the block.
|
14505 |
+
lastLineInFold = i;
|
14506 |
+
} else {
|
14507 |
+
// If this line has non-space, non-comment content, and is
|
14508 |
+
// indented less or equal to the start line, it is the start of
|
14509 |
+
// another block.
|
14510 |
+
break;
|
14511 |
+
}
|
14512 |
+
}
|
14513 |
+
if (lastLineInFold) return {
|
14514 |
+
from: CodeMirror.Pos(start.line, cm.getLine(start.line).length),
|
14515 |
+
to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
|
14516 |
+
};
|
14517 |
+
});
|
14518 |
+
|
14519 |
+
});
|
14520 |
+
|
14521 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14522 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14523 |
+
|
14524 |
+
(function(mod) {
|
14525 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14526 |
+
mod(require("../../lib/codemirror"));
|
14527 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14528 |
+
define(["../../lib/codemirror"], mod);
|
14529 |
+
else // Plain browser env
|
14530 |
+
mod(CodeMirror);
|
14531 |
+
})(function(CodeMirror) {
|
14532 |
+
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
14533 |
+
(document.documentMode == null || document.documentMode < 8);
|
14534 |
+
|
14535 |
+
var Pos = CodeMirror.Pos;
|
14536 |
+
|
14537 |
+
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
14538 |
+
|
14539 |
+
function findMatchingBracket(cm, where, strict, config) {
|
14540 |
+
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
14541 |
+
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
14542 |
+
if (!match) return null;
|
14543 |
+
var dir = match.charAt(1) == ">" ? 1 : -1;
|
14544 |
+
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
14545 |
+
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
14546 |
+
|
14547 |
+
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
14548 |
+
if (found == null) return null;
|
14549 |
+
return {from: Pos(where.line, pos), to: found && found.pos,
|
14550 |
+
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
14551 |
+
}
|
14552 |
+
|
14553 |
+
// bracketRegex is used to specify which type of bracket to scan
|
14554 |
+
// should be a regexp, e.g. /[[\]]/
|
14555 |
+
//
|
14556 |
+
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
14557 |
+
//
|
14558 |
+
// Returns false when no bracket was found, null when it reached
|
14559 |
+
// maxScanLines and gave up
|
14560 |
+
function scanForBracket(cm, where, dir, style, config) {
|
14561 |
+
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
14562 |
+
var maxScanLines = (config && config.maxScanLines) || 1000;
|
14563 |
+
|
14564 |
+
var stack = [];
|
14565 |
+
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
14566 |
+
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
14567 |
+
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
14568 |
+
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
14569 |
+
var line = cm.getLine(lineNo);
|
14570 |
+
if (!line) continue;
|
14571 |
+
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
14572 |
+
if (line.length > maxScanLen) continue;
|
14573 |
+
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
14574 |
+
for (; pos != end; pos += dir) {
|
14575 |
+
var ch = line.charAt(pos);
|
14576 |
+
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
14577 |
+
var match = matching[ch];
|
14578 |
+
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
14579 |
+
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
14580 |
+
else stack.pop();
|
14581 |
+
}
|
14582 |
+
}
|
14583 |
+
}
|
14584 |
+
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
14585 |
+
}
|
14586 |
+
|
14587 |
+
function matchBrackets(cm, autoclear, config) {
|
14588 |
+
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
14589 |
+
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
14590 |
+
var marks = [], ranges = cm.listSelections();
|
14591 |
+
for (var i = 0; i < ranges.length; i++) {
|
14592 |
+
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
14593 |
+
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
14594 |
+
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
14595 |
+
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
14596 |
+
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
14597 |
+
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
14598 |
+
}
|
14599 |
+
}
|
14600 |
+
|
14601 |
+
if (marks.length) {
|
14602 |
+
// Kludge to work around the IE bug from issue #1193, where text
|
14603 |
+
// input stops going to the textare whever this fires.
|
14604 |
+
if (ie_lt8 && cm.state.focused) cm.focus();
|
14605 |
+
|
14606 |
+
var clear = function() {
|
14607 |
+
cm.operation(function() {
|
14608 |
+
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
14609 |
+
});
|
14610 |
+
};
|
14611 |
+
if (autoclear) setTimeout(clear, 800);
|
14612 |
+
else return clear;
|
14613 |
+
}
|
14614 |
+
}
|
14615 |
+
|
14616 |
+
var currentlyHighlighted = null;
|
14617 |
+
function doMatchBrackets(cm) {
|
14618 |
+
cm.operation(function() {
|
14619 |
+
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
14620 |
+
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
14621 |
+
});
|
14622 |
+
}
|
14623 |
+
|
14624 |
+
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
14625 |
+
if (old && old != CodeMirror.Init) {
|
14626 |
+
cm.off("cursorActivity", doMatchBrackets);
|
14627 |
+
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
14628 |
+
}
|
14629 |
+
if (val) {
|
14630 |
+
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
14631 |
+
cm.on("cursorActivity", doMatchBrackets);
|
14632 |
+
}
|
14633 |
+
});
|
14634 |
+
|
14635 |
+
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
14636 |
+
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
14637 |
+
return findMatchingBracket(this, pos, strict, config);
|
14638 |
+
});
|
14639 |
+
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
14640 |
+
return scanForBracket(this, pos, dir, style, config);
|
14641 |
+
});
|
14642 |
+
});
|
14643 |
+
|
14644 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14645 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14646 |
+
|
14647 |
+
(function(mod) {
|
14648 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14649 |
+
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
14650 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14651 |
+
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
14652 |
+
else // Plain browser env
|
14653 |
+
mod(CodeMirror);
|
14654 |
+
})(function(CodeMirror) {
|
14655 |
+
"use strict";
|
14656 |
+
|
14657 |
+
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
|
14658 |
+
if (old && old != CodeMirror.Init) {
|
14659 |
+
cm.off("cursorActivity", doMatchTags);
|
14660 |
+
cm.off("viewportChange", maybeUpdateMatch);
|
14661 |
+
clear(cm);
|
14662 |
+
}
|
14663 |
+
if (val) {
|
14664 |
+
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
|
14665 |
+
cm.on("cursorActivity", doMatchTags);
|
14666 |
+
cm.on("viewportChange", maybeUpdateMatch);
|
14667 |
+
doMatchTags(cm);
|
14668 |
+
}
|
14669 |
+
});
|
14670 |
+
|
14671 |
+
function clear(cm) {
|
14672 |
+
if (cm.state.tagHit) cm.state.tagHit.clear();
|
14673 |
+
if (cm.state.tagOther) cm.state.tagOther.clear();
|
14674 |
+
cm.state.tagHit = cm.state.tagOther = null;
|
14675 |
+
}
|
14676 |
+
|
14677 |
+
function doMatchTags(cm) {
|
14678 |
+
cm.state.failedTagMatch = false;
|
14679 |
+
cm.operation(function() {
|
14680 |
+
clear(cm);
|
14681 |
+
if (cm.somethingSelected()) return;
|
14682 |
+
var cur = cm.getCursor(), range = cm.getViewport();
|
14683 |
+
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
|
14684 |
+
var match = CodeMirror.findMatchingTag(cm, cur, range);
|
14685 |
+
if (!match) return;
|
14686 |
+
if (cm.state.matchBothTags) {
|
14687 |
+
var hit = match.at == "open" ? match.open : match.close;
|
14688 |
+
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
|
14689 |
+
}
|
14690 |
+
var other = match.at == "close" ? match.open : match.close;
|
14691 |
+
if (other)
|
14692 |
+
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
|
14693 |
+
else
|
14694 |
+
cm.state.failedTagMatch = true;
|
14695 |
+
});
|
14696 |
+
}
|
14697 |
+
|
14698 |
+
function maybeUpdateMatch(cm) {
|
14699 |
+
if (cm.state.failedTagMatch) doMatchTags(cm);
|
14700 |
+
}
|
14701 |
+
|
14702 |
+
CodeMirror.commands.toMatchingTag = function(cm) {
|
14703 |
+
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
|
14704 |
+
if (found) {
|
14705 |
+
var other = found.at == "close" ? found.open : found.close;
|
14706 |
+
if (other) cm.extendSelection(other.to, other.from);
|
14707 |
+
}
|
14708 |
+
};
|
14709 |
+
});
|
14710 |
+
|
14711 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14712 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14713 |
+
|
14714 |
+
// Highlighting text that matches the selection
|
14715 |
+
//
|
14716 |
+
// Defines an option highlightSelectionMatches, which, when enabled,
|
14717 |
+
// will style strings that match the selection throughout the
|
14718 |
+
// document.
|
14719 |
+
//
|
14720 |
+
// The option can be set to true to simply enable it, or to a
|
14721 |
+
// {minChars, style, wordsOnly, showToken, delay} object to explicitly
|
14722 |
+
// configure it. minChars is the minimum amount of characters that should be
|
14723 |
+
// selected for the behavior to occur, and style is the token style to
|
14724 |
+
// apply to the matches. This will be prefixed by "cm-" to create an
|
14725 |
+
// actual CSS class name. If wordsOnly is enabled, the matches will be
|
14726 |
+
// highlighted only if the selected text is a word. showToken, when enabled,
|
14727 |
+
// will cause the current token to be highlighted when nothing is selected.
|
14728 |
+
// delay is used to specify how much time to wait, in milliseconds, before
|
14729 |
+
// highlighting the matches. If annotateScrollbar is enabled, the occurences
|
14730 |
+
// will be highlighted on the scrollbar via the matchesonscrollbar addon.
|
14731 |
+
|
14732 |
+
(function(mod) {
|
14733 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14734 |
+
mod(require("../../lib/codemirror"), require("./matchesonscrollbar"));
|
14735 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14736 |
+
define(["../../lib/codemirror", "./matchesonscrollbar"], mod);
|
14737 |
+
else // Plain browser env
|
14738 |
+
mod(CodeMirror);
|
14739 |
+
})(function(CodeMirror) {
|
14740 |
+
"use strict";
|
14741 |
+
|
14742 |
+
var defaults = {
|
14743 |
+
style: "matchhighlight",
|
14744 |
+
minChars: 2,
|
14745 |
+
delay: 100,
|
14746 |
+
wordsOnly: false,
|
14747 |
+
annotateScrollbar: false,
|
14748 |
+
showToken: false,
|
14749 |
+
trim: true
|
14750 |
+
}
|
14751 |
+
|
14752 |
+
function State(options) {
|
14753 |
+
this.options = {}
|
14754 |
+
for (var name in defaults)
|
14755 |
+
this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name]
|
14756 |
+
this.overlay = this.timeout = null;
|
14757 |
+
this.matchesonscroll = null;
|
14758 |
+
this.active = false;
|
14759 |
+
}
|
14760 |
+
|
14761 |
+
CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
|
14762 |
+
if (old && old != CodeMirror.Init) {
|
14763 |
+
removeOverlay(cm);
|
14764 |
+
clearTimeout(cm.state.matchHighlighter.timeout);
|
14765 |
+
cm.state.matchHighlighter = null;
|
14766 |
+
cm.off("cursorActivity", cursorActivity);
|
14767 |
+
cm.off("focus", onFocus)
|
14768 |
+
}
|
14769 |
+
if (val) {
|
14770 |
+
var state = cm.state.matchHighlighter = new State(val);
|
14771 |
+
if (cm.hasFocus()) {
|
14772 |
+
state.active = true
|
14773 |
+
highlightMatches(cm)
|
14774 |
+
} else {
|
14775 |
+
cm.on("focus", onFocus)
|
14776 |
+
}
|
14777 |
+
cm.on("cursorActivity", cursorActivity);
|
14778 |
+
}
|
14779 |
+
});
|
14780 |
+
|
14781 |
+
function cursorActivity(cm) {
|
14782 |
+
var state = cm.state.matchHighlighter;
|
14783 |
+
if (state.active || cm.hasFocus()) scheduleHighlight(cm, state)
|
14784 |
+
}
|
14785 |
+
|
14786 |
+
function onFocus(cm) {
|
14787 |
+
var state = cm.state.matchHighlighter
|
14788 |
+
if (!state.active) {
|
14789 |
+
state.active = true
|
14790 |
+
scheduleHighlight(cm, state)
|
14791 |
+
}
|
14792 |
+
}
|
14793 |
+
|
14794 |
+
function scheduleHighlight(cm, state) {
|
14795 |
+
clearTimeout(state.timeout);
|
14796 |
+
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay);
|
14797 |
+
}
|
14798 |
+
|
14799 |
+
function addOverlay(cm, query, hasBoundary, style) {
|
14800 |
+
var state = cm.state.matchHighlighter;
|
14801 |
+
cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
|
14802 |
+
if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
|
14803 |
+
var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
|
14804 |
+
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
|
14805 |
+
{className: "CodeMirror-selection-highlight-scrollbar"});
|
14806 |
+
}
|
14807 |
+
}
|
14808 |
+
|
14809 |
+
function removeOverlay(cm) {
|
14810 |
+
var state = cm.state.matchHighlighter;
|
14811 |
+
if (state.overlay) {
|
14812 |
+
cm.removeOverlay(state.overlay);
|
14813 |
+
state.overlay = null;
|
14814 |
+
if (state.matchesonscroll) {
|
14815 |
+
state.matchesonscroll.clear();
|
14816 |
+
state.matchesonscroll = null;
|
14817 |
+
}
|
14818 |
+
}
|
14819 |
+
}
|
14820 |
+
|
14821 |
+
function highlightMatches(cm) {
|
14822 |
+
cm.operation(function() {
|
14823 |
+
var state = cm.state.matchHighlighter;
|
14824 |
+
removeOverlay(cm);
|
14825 |
+
if (!cm.somethingSelected() && state.options.showToken) {
|
14826 |
+
var re = state.options.showToken === true ? /[\w$]/ : state.options.showToken;
|
14827 |
+
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
|
14828 |
+
while (start && re.test(line.charAt(start - 1))) --start;
|
14829 |
+
while (end < line.length && re.test(line.charAt(end))) ++end;
|
14830 |
+
if (start < end)
|
14831 |
+
addOverlay(cm, line.slice(start, end), re, state.options.style);
|
14832 |
+
return;
|
14833 |
+
}
|
14834 |
+
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
14835 |
+
if (from.line != to.line) return;
|
14836 |
+
if (state.options.wordsOnly && !isWord(cm, from, to)) return;
|
14837 |
+
var selection = cm.getRange(from, to)
|
14838 |
+
if (state.options.trim) selection = selection.replace(/^\s+|\s+$/g, "")
|
14839 |
+
if (selection.length >= state.options.minChars)
|
14840 |
+
addOverlay(cm, selection, false, state.options.style);
|
14841 |
+
});
|
14842 |
+
}
|
14843 |
+
|
14844 |
+
function isWord(cm, from, to) {
|
14845 |
+
var str = cm.getRange(from, to);
|
14846 |
+
if (str.match(/^\w+$/) !== null) {
|
14847 |
+
if (from.ch > 0) {
|
14848 |
+
var pos = {line: from.line, ch: from.ch - 1};
|
14849 |
+
var chr = cm.getRange(pos, from);
|
14850 |
+
if (chr.match(/\W/) === null) return false;
|
14851 |
+
}
|
14852 |
+
if (to.ch < cm.getLine(from.line).length) {
|
14853 |
+
var pos = {line: to.line, ch: to.ch + 1};
|
14854 |
+
var chr = cm.getRange(to, pos);
|
14855 |
+
if (chr.match(/\W/) === null) return false;
|
14856 |
+
}
|
14857 |
+
return true;
|
14858 |
+
} else return false;
|
14859 |
+
}
|
14860 |
+
|
14861 |
+
function boundariesAround(stream, re) {
|
14862 |
+
return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) &&
|
14863 |
+
(stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos)));
|
14864 |
+
}
|
14865 |
+
|
14866 |
+
function makeOverlay(query, hasBoundary, style) {
|
14867 |
+
return {token: function(stream) {
|
14868 |
+
if (stream.match(query) &&
|
14869 |
+
(!hasBoundary || boundariesAround(stream, hasBoundary)))
|
14870 |
+
return style;
|
14871 |
+
stream.next();
|
14872 |
+
stream.skipTo(query.charAt(0)) || stream.skipToEnd();
|
14873 |
+
}};
|
14874 |
+
}
|
14875 |
+
});
|
14876 |
+
|
14877 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
14878 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
14879 |
+
|
14880 |
+
/**
|
14881 |
+
* Tag-closer extension for CodeMirror.
|
14882 |
+
*
|
14883 |
+
* This extension adds an "autoCloseTags" option that can be set to
|
14884 |
+
* either true to get the default behavior, or an object to further
|
14885 |
+
* configure its behavior.
|
14886 |
+
*
|
14887 |
+
* These are supported options:
|
14888 |
+
*
|
14889 |
+
* `whenClosing` (default true)
|
14890 |
+
* Whether to autoclose when the '/' of a closing tag is typed.
|
14891 |
+
* `whenOpening` (default true)
|
14892 |
+
* Whether to autoclose the tag when the final '>' of an opening
|
14893 |
+
* tag is typed.
|
14894 |
+
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
14895 |
+
* An array of tag names that should not be autoclosed.
|
14896 |
+
* `indentTags` (default is block tags for HTML, none for XML)
|
14897 |
+
* An array of tag names that should, when opened, cause a
|
14898 |
+
* blank line to be added inside the tag, and the blank line and
|
14899 |
+
* closing line to be indented.
|
14900 |
+
*
|
14901 |
+
* See demos/closetag.html for a usage example.
|
14902 |
+
*/
|
14903 |
+
|
14904 |
+
(function(mod) {
|
14905 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14906 |
+
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
14907 |
+
else if (typeof define == "function" && define.amd) // AMD
|
14908 |
+
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
14909 |
+
else // Plain browser env
|
14910 |
+
mod(CodeMirror);
|
14911 |
+
})(function(CodeMirror) {
|
14912 |
+
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
14913 |
+
if (old != CodeMirror.Init && old)
|
14914 |
+
cm.removeKeyMap("autoCloseTags");
|
14915 |
+
if (!val) return;
|
14916 |
+
var map = {name: "autoCloseTags"};
|
14917 |
+
if (typeof val != "object" || val.whenClosing)
|
14918 |
+
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
14919 |
+
if (typeof val != "object" || val.whenOpening)
|
14920 |
+
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
14921 |
+
cm.addKeyMap(map);
|
14922 |
+
});
|
14923 |
+
|
14924 |
+
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
14925 |
+
"source", "track", "wbr"];
|
14926 |
+
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
14927 |
+
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
14928 |
+
|
14929 |
+
function autoCloseGT(cm) {
|
14930 |
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
14931 |
+
var ranges = cm.listSelections(), replacements = [];
|
14932 |
+
for (var i = 0; i < ranges.length; i++) {
|
14933 |
+
if (!ranges[i].empty()) return CodeMirror.Pass;
|
14934 |
+
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
14935 |
+
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
14936 |
+
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
|
14937 |
+
|
14938 |
+
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
14939 |
+
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
14940 |
+
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
14941 |
+
|
14942 |
+
var tagName = state.tagName;
|
14943 |
+
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
14944 |
+
var lowerTagName = tagName.toLowerCase();
|
14945 |
+
// Don't process the '>' at the end of an end-tag or self-closing tag
|
14946 |
+
if (!tagName ||
|
14947 |
+
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
14948 |
+
tok.type == "tag" && state.type == "closeTag" ||
|
14949 |
+
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
14950 |
+
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
14951 |
+
closingTagExists(cm, tagName, pos, state, true))
|
14952 |
+
return CodeMirror.Pass;
|
14953 |
+
|
14954 |
+
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
14955 |
+
replacements[i] = {indent: indent,
|
14956 |
+
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
14957 |
+
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
14958 |
+
}
|
14959 |
+
|
14960 |
+
for (var i = ranges.length - 1; i >= 0; i--) {
|
14961 |
+
var info = replacements[i];
|
14962 |
+
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
14963 |
+
var sel = cm.listSelections().slice(0);
|
14964 |
+
sel[i] = {head: info.newPos, anchor: info.newPos};
|
14965 |
+
cm.setSelections(sel);
|
14966 |
+
if (info.indent) {
|
14967 |
+
cm.indentLine(info.newPos.line, null, true);
|
14968 |
+
cm.indentLine(info.newPos.line + 1, null, true);
|
14969 |
+
}
|
14970 |
+
}
|
14971 |
+
}
|
14972 |
+
|
14973 |
+
function autoCloseCurrent(cm, typingSlash) {
|
14974 |
+
var ranges = cm.listSelections(), replacements = [];
|
14975 |
+
var head = typingSlash ? "/" : "</";
|
14976 |
+
for (var i = 0; i < ranges.length; i++) {
|
14977 |
+
if (!ranges[i].empty()) return CodeMirror.Pass;
|
14978 |
+
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
14979 |
+
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
14980 |
+
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
14981 |
+
tok.start != pos.ch - 1))
|
14982 |
+
return CodeMirror.Pass;
|
14983 |
+
// Kludge to get around the fact that we are not in XML mode
|
14984 |
+
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
14985 |
+
// work for other XML embedded languages (there is no general
|
14986 |
+
// way to go from a mixed mode to its current XML state).
|
14987 |
+
var replacement;
|
14988 |
+
if (inner.mode.name != "xml") {
|
14989 |
+
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
|
14990 |
+
replacement = head + "script";
|
14991 |
+
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
|
14992 |
+
replacement = head + "style";
|
14993 |
+
else
|
14994 |
+
return CodeMirror.Pass;
|
14995 |
+
} else {
|
14996 |
+
if (!state.context || !state.context.tagName ||
|
14997 |
+
closingTagExists(cm, state.context.tagName, pos, state))
|
14998 |
+
return CodeMirror.Pass;
|
14999 |
+
replacement = head + state.context.tagName;
|
15000 |
+
}
|
15001 |
+
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
|
15002 |
+
replacements[i] = replacement;
|
15003 |
+
}
|
15004 |
+
cm.replaceSelections(replacements);
|
15005 |
+
ranges = cm.listSelections();
|
15006 |
+
for (var i = 0; i < ranges.length; i++)
|
15007 |
+
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
15008 |
+
cm.indentLine(ranges[i].head.line);
|
15009 |
+
}
|
15010 |
+
|
15011 |
+
function autoCloseSlash(cm) {
|
15012 |
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
15013 |
+
return autoCloseCurrent(cm, true);
|
15014 |
+
}
|
15015 |
+
|
15016 |
+
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
15017 |
+
|
15018 |
+
function indexOf(collection, elt) {
|
15019 |
+
if (collection.indexOf) return collection.indexOf(elt);
|
15020 |
+
for (var i = 0, e = collection.length; i < e; ++i)
|
15021 |
+
if (collection[i] == elt) return i;
|
15022 |
+
return -1;
|
15023 |
+
}
|
15024 |
+
|
15025 |
+
// If xml-fold is loaded, we use its functionality to try and verify
|
15026 |
+
// whether a given tag is actually unclosed.
|
15027 |
+
function closingTagExists(cm, tagName, pos, state, newTag) {
|
15028 |
+
if (!CodeMirror.scanForClosingTag) return false;
|
15029 |
+
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
15030 |
+
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
15031 |
+
if (!nextClose || nextClose.tag != tagName) return false;
|
15032 |
+
var cx = state.context;
|
15033 |
+
// If the immediate wrapping context contains onCx instances of
|
15034 |
+
// the same tag, a closing tag only exists if there are at least
|
15035 |
+
// that many closing tags of that type following.
|
15036 |
+
for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
|
15037 |
+
pos = nextClose.to;
|
15038 |
+
for (var i = 1; i < onCx; i++) {
|
15039 |
+
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
15040 |
+
if (!next || next.tag != tagName) return false;
|
15041 |
+
pos = next.to;
|
15042 |
+
}
|
15043 |
+
return true;
|
15044 |
+
}
|
15045 |
+
});
|
15046 |
+
|
15047 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
15048 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
15049 |
+
|
15050 |
+
(function(mod) {
|
15051 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
15052 |
+
mod(require("../../lib/codemirror"));
|
15053 |
+
else if (typeof define == "function" && define.amd) // AMD
|
15054 |
+
define(["../../lib/codemirror"], mod);
|
15055 |
+
else // Plain browser env
|
15056 |
+
mod(CodeMirror);
|
15057 |
+
})(function(CodeMirror) {
|
15058 |
+
var defaults = {
|
15059 |
+
pairs: "()[]{}''\"\"",
|
15060 |
+
triples: "",
|
15061 |
+
explode: "[]{}"
|
15062 |
+
};
|
15063 |
+
|
15064 |
+
var Pos = CodeMirror.Pos;
|
15065 |
+
|
15066 |
+
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
15067 |
+
if (old && old != CodeMirror.Init) {
|
15068 |
+
cm.removeKeyMap(keyMap);
|
15069 |
+
cm.state.closeBrackets = null;
|
15070 |
+
}
|
15071 |
+
if (val) {
|
15072 |
+
cm.state.closeBrackets = val;
|
15073 |
+
cm.addKeyMap(keyMap);
|
15074 |
+
}
|
15075 |
+
});
|
15076 |
+
|
15077 |
+
function getOption(conf, name) {
|
15078 |
+
if (name == "pairs" && typeof conf == "string") return conf;
|
15079 |
+
if (typeof conf == "object" && conf[name] != null) return conf[name];
|
15080 |
+
return defaults[name];
|
15081 |
+
}
|
15082 |
+
|
15083 |
+
var bind = defaults.pairs + "`";
|
15084 |
+
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
|
15085 |
+
for (var i = 0; i < bind.length; i++)
|
15086 |
+
keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
|
15087 |
+
|
15088 |
+
function handler(ch) {
|
15089 |
+
return function(cm) { return handleChar(cm, ch); };
|
15090 |
+
}
|
15091 |
+
|
15092 |
+
function getConfig(cm) {
|
15093 |
+
var deflt = cm.state.closeBrackets;
|
15094 |
+
if (!deflt || deflt.override) return deflt;
|
15095 |
+
var mode = cm.getModeAt(cm.getCursor());
|
15096 |
+
return mode.closeBrackets || deflt;
|
15097 |
+
}
|
15098 |
+
|
15099 |
+
function handleBackspace(cm) {
|
15100 |
+
var conf = getConfig(cm);
|
15101 |
+
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
15102 |
+
|
15103 |
+
var pairs = getOption(conf, "pairs");
|
15104 |
+
var ranges = cm.listSelections();
|
15105 |
+
for (var i = 0; i < ranges.length; i++) {
|
15106 |
+
if (!ranges[i].empty()) return CodeMirror.Pass;
|
15107 |
+
var around = charsAround(cm, ranges[i].head);
|
15108 |
+
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
15109 |
+
}
|
15110 |
+
for (var i = ranges.length - 1; i >= 0; i--) {
|
15111 |
+
var cur = ranges[i].head;
|
15112 |
+
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
|
15113 |
+
}
|
15114 |
+
}
|
15115 |
+
|
15116 |
+
function handleEnter(cm) {
|
15117 |
+
var conf = getConfig(cm);
|
15118 |
+
var explode = conf && getOption(conf, "explode");
|
15119 |
+
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
|
15120 |
+
|
15121 |
+
var ranges = cm.listSelections();
|
15122 |
+
for (var i = 0; i < ranges.length; i++) {
|
15123 |
+
if (!ranges[i].empty()) return CodeMirror.Pass;
|
15124 |
+
var around = charsAround(cm, ranges[i].head);
|
15125 |
+
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
15126 |
+
}
|
15127 |
+
cm.operation(function() {
|
15128 |
+
cm.replaceSelection("\n\n", null);
|
15129 |
+
cm.execCommand("goCharLeft");
|
15130 |
+
ranges = cm.listSelections();
|
15131 |
+
for (var i = 0; i < ranges.length; i++) {
|
15132 |
+
var line = ranges[i].head.line;
|
15133 |
+
cm.indentLine(line, null, true);
|
15134 |
+
cm.indentLine(line + 1, null, true);
|
15135 |
+
}
|
15136 |
+
});
|
15137 |
+
}
|
15138 |
+
|
15139 |
+
function contractSelection(sel) {
|
15140 |
+
var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
|
15141 |
+
return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
|
15142 |
+
head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
|
15143 |
+
}
|
15144 |
+
|
15145 |
+
function handleChar(cm, ch) {
|
15146 |
+
var conf = getConfig(cm);
|
15147 |
+
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
15148 |
+
|
15149 |
+
var pairs = getOption(conf, "pairs");
|
15150 |
+
var pos = pairs.indexOf(ch);
|
15151 |
+
if (pos == -1) return CodeMirror.Pass;
|
15152 |
+
var triples = getOption(conf, "triples");
|
15153 |
+
|
15154 |
+
var identical = pairs.charAt(pos + 1) == ch;
|
15155 |
+
var ranges = cm.listSelections();
|
15156 |
+
var opening = pos % 2 == 0;
|
15157 |
+
|
15158 |
+
var type;
|
15159 |
+
for (var i = 0; i < ranges.length; i++) {
|
15160 |
+
var range = ranges[i], cur = range.head, curType;
|
15161 |
+
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
15162 |
+
if (opening && !range.empty()) {
|
15163 |
+
curType = "surround";
|
15164 |
+
} else if ((identical || !opening) && next == ch) {
|
15165 |
+
if (identical && stringStartsAfter(cm, cur))
|
15166 |
+
curType = "both";
|
15167 |
+
else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
|
15168 |
+
curType = "skipThree";
|
15169 |
+
else
|
15170 |
+
curType = "skip";
|
15171 |
+
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
15172 |
+
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
|
15173 |
+
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
|
15174 |
+
curType = "addFour";
|
15175 |
+
} else if (identical) {
|
15176 |
+
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
|
15177 |
+
else return CodeMirror.Pass;
|
15178 |
+
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
|
15179 |
+
isClosingBracket(next, pairs) ||
|
15180 |
+
/\s/.test(next))) {
|
15181 |
+
curType = "both";
|
15182 |
+
} else {
|
15183 |
+
return CodeMirror.Pass;
|
15184 |
+
}
|
15185 |
+
if (!type) type = curType;
|
15186 |
+
else if (type != curType) return CodeMirror.Pass;
|
15187 |
+
}
|
15188 |
+
|
15189 |
+
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
|
15190 |
+
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
|
15191 |
+
cm.operation(function() {
|
15192 |
+
if (type == "skip") {
|
15193 |
+
cm.execCommand("goCharRight");
|
15194 |
+
} else if (type == "skipThree") {
|
15195 |
+
for (var i = 0; i < 3; i++)
|
15196 |
+
cm.execCommand("goCharRight");
|
15197 |
+
} else if (type == "surround") {
|
15198 |
+
var sels = cm.getSelections();
|
15199 |
+
for (var i = 0; i < sels.length; i++)
|
15200 |
+
sels[i] = left + sels[i] + right;
|
15201 |
+
cm.replaceSelections(sels, "around");
|
15202 |
+
sels = cm.listSelections().slice();
|
15203 |
+
for (var i = 0; i < sels.length; i++)
|
15204 |
+
sels[i] = contractSelection(sels[i]);
|
15205 |
+
cm.setSelections(sels);
|
15206 |
+
} else if (type == "both") {
|
15207 |
+
cm.replaceSelection(left + right, null);
|
15208 |
+
cm.triggerElectric(left + right);
|
15209 |
+
cm.execCommand("goCharLeft");
|
15210 |
+
} else if (type == "addFour") {
|
15211 |
+
cm.replaceSelection(left + left + left + left, "before");
|
15212 |
+
cm.execCommand("goCharRight");
|
15213 |
+
}
|
15214 |
+
});
|
15215 |
+
}
|
15216 |
+
|
15217 |
+
function isClosingBracket(ch, pairs) {
|
15218 |
+
var pos = pairs.lastIndexOf(ch);
|
15219 |
+
return pos > -1 && pos % 2 == 1;
|
15220 |
+
}
|
15221 |
+
|
15222 |
+
function charsAround(cm, pos) {
|
15223 |
+
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
|
15224 |
+
Pos(pos.line, pos.ch + 1));
|
15225 |
+
return str.length == 2 ? str : null;
|
15226 |
+
}
|
15227 |
+
|
15228 |
+
// Project the token type that will exists after the given char is
|
15229 |
+
// typed, and use it to determine whether it would cause the start
|
15230 |
+
// of a string token.
|
15231 |
+
function enteringString(cm, pos, ch) {
|
15232 |
+
var line = cm.getLine(pos.line);
|
15233 |
+
var token = cm.getTokenAt(pos);
|
15234 |
+
if (/\bstring2?\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;
|
15235 |
+
var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
|
15236 |
+
stream.pos = stream.start = token.start;
|
15237 |
+
for (;;) {
|
15238 |
+
var type1 = cm.getMode().token(stream, token.state);
|
15239 |
+
if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
|
15240 |
+
stream.start = stream.pos;
|
15241 |
+
}
|
15242 |
+
}
|
15243 |
+
|
15244 |
+
function stringStartsAfter(cm, pos) {
|
15245 |
+
var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
|
15246 |
+
return /\bstring/.test(token.type) && token.start == pos.ch
|
15247 |
+
}
|
15248 |
+
});
|
15249 |
+
|
15250 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
15251 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
15252 |
+
|
15253 |
+
// A rough approximation of Sublime Text's keybindings
|
15254 |
+
// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js
|
15255 |
+
|
15256 |
+
(function(mod) {
|
15257 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
15258 |
+
mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/edit/matchbrackets"));
|
15259 |
+
else if (typeof define == "function" && define.amd) // AMD
|
15260 |
+
define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/edit/matchbrackets"], mod);
|
15261 |
+
else // Plain browser env
|
15262 |
+
mod(CodeMirror);
|
15263 |
+
})(function(CodeMirror) {
|
15264 |
+
"use strict";
|
15265 |
+
|
15266 |
+
var map = CodeMirror.keyMap.sublime = {fallthrough: "default"};
|
15267 |
+
var cmds = CodeMirror.commands;
|
15268 |
+
var Pos = CodeMirror.Pos;
|
15269 |
+
var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault;
|
15270 |
+
var ctrl = mac ? "Cmd-" : "Ctrl-";
|
15271 |
+
|
15272 |
+
// This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.
|
15273 |
+
function findPosSubword(doc, start, dir) {
|
15274 |
+
if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));
|
15275 |
+
var line = doc.getLine(start.line);
|
15276 |
+
if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));
|
15277 |
+
var state = "start", type;
|
15278 |
+
for (var pos = start.ch, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {
|
15279 |
+
var next = line.charAt(dir < 0 ? pos - 1 : pos);
|
15280 |
+
var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o";
|
15281 |
+
if (cat == "w" && next.toUpperCase() == next) cat = "W";
|
15282 |
+
if (state == "start") {
|
15283 |
+
if (cat != "o") { state = "in"; type = cat; }
|
15284 |
+
} else if (state == "in") {
|
15285 |
+
if (type != cat) {
|
15286 |
+
if (type == "w" && cat == "W" && dir < 0) pos--;
|
15287 |
+
if (type == "W" && cat == "w" && dir > 0) { type = "w"; continue; }
|
15288 |
+
break;
|
15289 |
+
}
|
15290 |
+
}
|
15291 |
+
}
|
15292 |
+
return Pos(start.line, pos);
|
15293 |
+
}
|
15294 |
+
|
15295 |
+
function moveSubword(cm, dir) {
|
15296 |
+
cm.extendSelectionsBy(function(range) {
|
15297 |
+
if (cm.display.shift || cm.doc.extend || range.empty())
|
15298 |
+
return findPosSubword(cm.doc, range.head, dir);
|
15299 |
+
else
|
15300 |
+
return dir < 0 ? range.from() : range.to();
|
15301 |
+
});
|
15302 |
+
}
|
15303 |
+
|
15304 |
+
var goSubwordCombo = mac ? "Ctrl-" : "Alt-";
|
15305 |
+
|
15306 |
+
cmds[map[goSubwordCombo + "Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); };
|
15307 |
+
cmds[map[goSubwordCombo + "Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); };
|
15308 |
+
|
15309 |
+
if (mac) map["Cmd-Left"] = "goLineStartSmart";
|
15310 |
+
|
15311 |
+
var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-";
|
15312 |
+
|
15313 |
+
cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) {
|
15314 |
+
var info = cm.getScrollInfo();
|
15315 |
+
if (!cm.somethingSelected()) {
|
15316 |
+
var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local");
|
15317 |
+
if (cm.getCursor().line >= visibleBottomLine)
|
15318 |
+
cm.execCommand("goLineUp");
|
15319 |
+
}
|
15320 |
+
cm.scrollTo(null, info.top - cm.defaultTextHeight());
|
15321 |
+
};
|
15322 |
+
cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) {
|
15323 |
+
var info = cm.getScrollInfo();
|
15324 |
+
if (!cm.somethingSelected()) {
|
15325 |
+
var visibleTopLine = cm.lineAtHeight(info.top, "local")+1;
|
15326 |
+
if (cm.getCursor().line <= visibleTopLine)
|
15327 |
+
cm.execCommand("goLineDown");
|
15328 |
+
}
|
15329 |
+
cm.scrollTo(null, info.top + cm.defaultTextHeight());
|
15330 |
+
};
|
15331 |
+
|
15332 |
+
cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) {
|
15333 |
+
var ranges = cm.listSelections(), lineRanges = [];
|
15334 |
+
for (var i = 0; i < ranges.length; i++) {
|
15335 |
+
var from = ranges[i].from(), to = ranges[i].to();
|
15336 |
+
for (var line = from.line; line <= to.line; ++line)
|
15337 |
+
if (!(to.line > from.line && line == to.line && to.ch == 0))
|
15338 |
+
lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),
|
15339 |
+
head: line == to.line ? to : Pos(line)});
|
15340 |
+
}
|
15341 |
+
cm.setSelections(lineRanges, 0);
|
15342 |
+
};
|
15343 |
+
|
15344 |
+
map["Shift-Tab"] = "indentLess";
|
15345 |
+
|
15346 |
+
cmds[map["Esc"] = "singleSelectionTop"] = function(cm) {
|
15347 |
+
var range = cm.listSelections()[0];
|
15348 |
+
cm.setSelection(range.anchor, range.head, {scroll: false});
|
15349 |
+
};
|
15350 |
+
|
15351 |
+
cmds[map[ctrl + "L"] = "selectLine"] = function(cm) {
|
15352 |
+
var ranges = cm.listSelections(), extended = [];
|
15353 |
+
for (var i = 0; i < ranges.length; i++) {
|
15354 |
+
var range = ranges[i];
|
15355 |
+
extended.push({anchor: Pos(range.from().line, 0),
|
15356 |
+
head: Pos(range.to().line + 1, 0)});
|
15357 |
+
}
|
15358 |
+
cm.setSelections(extended);
|
15359 |
+
};
|
15360 |
+
|
15361 |
+
map["Shift-Ctrl-K"] = "deleteLine";
|
15362 |
+
|
15363 |
+
function insertLine(cm, above) {
|
15364 |
+
if (cm.isReadOnly()) return CodeMirror.Pass
|
15365 |
+
cm.operation(function() {
|
15366 |
+
var len = cm.listSelections().length, newSelection = [], last = -1;
|
15367 |
+
for (var i = 0; i < len; i++) {
|
15368 |
+
var head = cm.listSelections()[i].head;
|
15369 |
+
if (head.line <= last) continue;
|
15370 |
+
var at = Pos(head.line + (above ? 0 : 1), 0);
|
15371 |
+
cm.replaceRange("\n", at, null, "+insertLine");
|
15372 |
+
cm.indentLine(at.line, null, true);
|
15373 |
+
newSelection.push({head: at, anchor: at});
|
15374 |
+
last = head.line + 1;
|
15375 |
+
}
|
15376 |
+
cm.setSelections(newSelection);
|
15377 |
+
});
|
15378 |
+
cm.execCommand("indentAuto");
|
15379 |
+
}
|
15380 |
+
|
15381 |
+
cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); };
|
15382 |
+
|
15383 |
+
cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { return insertLine(cm, true); };
|
15384 |
+
|
15385 |
+
function wordAt(cm, pos) {
|
15386 |
+
var start = pos.ch, end = start, line = cm.getLine(pos.line);
|
15387 |
+
while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;
|
15388 |
+
while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;
|
15389 |
+
return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};
|
15390 |
+
}
|
15391 |
+
|
15392 |
+
cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) {
|
15393 |
+
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
15394 |
+
var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;
|
15395 |
+
if (CodeMirror.cmpPos(from, to) == 0) {
|
15396 |
+
var word = wordAt(cm, from);
|
15397 |
+
if (!word.word) return;
|
15398 |
+
cm.setSelection(word.from, word.to);
|
15399 |
+
fullWord = true;
|
15400 |
+
} else {
|
15401 |
+
var text = cm.getRange(from, to);
|
15402 |
+
var query = fullWord ? new RegExp("\\b" + text + "\\b") : text;
|
15403 |
+
var cur = cm.getSearchCursor(query, to);
|
15404 |
+
var found = cur.findNext();
|
15405 |
+
if (!found) {
|
15406 |
+
cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0));
|
15407 |
+
found = cur.findNext();
|
15408 |
+
}
|
15409 |
+
if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to()))
|
15410 |
+
return CodeMirror.Pass
|
15411 |
+
cm.addSelection(cur.from(), cur.to());
|
15412 |
+
}
|
15413 |
+
if (fullWord)
|
15414 |
+
cm.state.sublimeFindFullWord = cm.doc.sel;
|
15415 |
+
};
|
15416 |
+
|
15417 |
+
function isSelectedRange(ranges, from, to) {
|
15418 |
+
for (var i = 0; i < ranges.length; i++)
|
15419 |
+
if (ranges[i].from() == from && ranges[i].to() == to) return true
|
15420 |
+
return false
|
15421 |
+
}
|
15422 |
+
|
15423 |
+
var mirror = "(){}[]";
|
15424 |
+
function selectBetweenBrackets(cm) {
|
15425 |
+
var ranges = cm.listSelections(), newRanges = []
|
15426 |
+
for (var i = 0; i < ranges.length; i++) {
|
15427 |
+
var range = ranges[i], pos = range.head, opening = cm.scanForBracket(pos, -1);
|
15428 |
+
if (!opening) return false;
|
15429 |
+
for (;;) {
|
15430 |
+
var closing = cm.scanForBracket(pos, 1);
|
15431 |
+
if (!closing) return false;
|
15432 |
+
if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {
|
15433 |
+
newRanges.push({anchor: Pos(opening.pos.line, opening.pos.ch + 1),
|
15434 |
+
head: closing.pos});
|
15435 |
+
break;
|
15436 |
+
}
|
15437 |
+
pos = Pos(closing.pos.line, closing.pos.ch + 1);
|
15438 |
+
}
|
15439 |
+
}
|
15440 |
+
cm.setSelections(newRanges);
|
15441 |
+
return true;
|
15442 |
+
}
|
15443 |
+
|
15444 |
+
cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) {
|
15445 |
+
selectBetweenBrackets(cm) || cm.execCommand("selectAll");
|
15446 |
+
};
|
15447 |
+
cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) {
|
15448 |
+
if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;
|
15449 |
+
};
|
15450 |
+
|
15451 |
+
cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) {
|
15452 |
+
cm.extendSelectionsBy(function(range) {
|
15453 |
+
var next = cm.scanForBracket(range.head, 1);
|
15454 |
+
if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;
|
15455 |
+
var prev = cm.scanForBracket(range.head, -1);
|
15456 |
+
return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head;
|
15457 |
+
});
|
15458 |
+
};
|
15459 |
+
|
15460 |
+
var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-";
|
15461 |
+
|
15462 |
+
cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) {
|
15463 |
+
if (cm.isReadOnly()) return CodeMirror.Pass
|
15464 |
+
var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];
|
15465 |
+
for (var i = 0; i < ranges.length; i++) {
|
15466 |
+
var range = ranges[i], from = range.from().line - 1, to = range.to().line;
|
15467 |
+
newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch),
|
15468 |
+
head: Pos(range.head.line - 1, range.head.ch)});
|
15469 |
+
if (range.to().ch == 0 && !range.empty()) --to;
|
15470 |
+
if (from > at) linesToMove.push(from, to);
|
15471 |
+
else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;
|
15472 |
+
at = to;
|
15473 |
+
}
|
15474 |
+
cm.operation(function() {
|
15475 |
+
for (var i = 0; i < linesToMove.length; i += 2) {
|
15476 |
+
var from = linesToMove[i], to = linesToMove[i + 1];
|
15477 |
+
var line = cm.getLine(from);
|
15478 |
+
cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine");
|
15479 |
+
if (to > cm.lastLine())
|
15480 |
+
cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine");
|
15481 |
+
else
|
15482 |
+
cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine");
|
15483 |
+
}
|
15484 |
+
cm.setSelections(newSels);
|
15485 |
+
cm.scrollIntoView();
|
15486 |
+
});
|
15487 |
+
};
|
15488 |
+
|
15489 |
+
cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) {
|
15490 |
+
if (cm.isReadOnly()) return CodeMirror.Pass
|
15491 |
+
var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;
|
15492 |
+
for (var i = ranges.length - 1; i >= 0; i--) {
|
15493 |
+
var range = ranges[i], from = range.to().line + 1, to = range.from().line;
|
15494 |
+
if (range.to().ch == 0 && !range.empty()) from--;
|
15495 |
+
if (from < at) linesToMove.push(from, to);
|
15496 |
+
else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;
|
15497 |
+
at = to;
|
15498 |
+
}
|
15499 |
+
cm.operation(function() {
|
15500 |
+
for (var i = linesToMove.length - 2; i >= 0; i -= 2) {
|
15501 |
+
var from = linesToMove[i], to = linesToMove[i + 1];
|
15502 |
+
var line = cm.getLine(from);
|
15503 |
+
if (from == cm.lastLine())
|
15504 |
+
cm.replaceRange("", Pos(from - 1), Pos(from), "+swapLine");
|
15505 |
+
else
|
15506 |
+
cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine");
|
15507 |
+
cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine");
|
15508 |
+
}
|
15509 |
+
cm.scrollIntoView();
|
15510 |
+
});
|
15511 |
+
};
|
15512 |
+
|
15513 |
+
cmds[map[ctrl + "/"] = "toggleCommentIndented"] = function(cm) {
|
15514 |
+
cm.toggleComment({ indent: true });
|
15515 |
+
}
|
15516 |
+
|
15517 |
+
cmds[map[ctrl + "J"] = "joinLines"] = function(cm) {
|
15518 |
+
var ranges = cm.listSelections(), joined = [];
|
15519 |
+
for (var i = 0; i < ranges.length; i++) {
|
15520 |
+
var range = ranges[i], from = range.from();
|
15521 |
+
var start = from.line, end = range.to().line;
|
15522 |
+
while (i < ranges.length - 1 && ranges[i + 1].from().line == end)
|
15523 |
+
end = ranges[++i].to().line;
|
15524 |
+
joined.push({start: start, end: end, anchor: !range.empty() && from});
|
15525 |
+
}
|
15526 |
+
cm.operation(function() {
|
15527 |
+
var offset = 0, ranges = [];
|
15528 |
+
for (var i = 0; i < joined.length; i++) {
|
15529 |
+
var obj = joined[i];
|
15530 |
+
var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head;
|
15531 |
+
for (var line = obj.start; line <= obj.end; line++) {
|
15532 |
+
var actual = line - offset;
|
15533 |
+
if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);
|
15534 |
+
if (actual < cm.lastLine()) {
|
15535 |
+
cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length));
|
15536 |
+
++offset;
|
15537 |
+
}
|
15538 |
+
}
|
15539 |
+
ranges.push({anchor: anchor || head, head: head});
|
15540 |
+
}
|
15541 |
+
cm.setSelections(ranges, 0);
|
15542 |
+
});
|
15543 |
+
};
|
15544 |
+
|
15545 |
+
cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) {
|
15546 |
+
cm.operation(function() {
|
15547 |
+
var rangeCount = cm.listSelections().length;
|
15548 |
+
for (var i = 0; i < rangeCount; i++) {
|
15549 |
+
var range = cm.listSelections()[i];
|
15550 |
+
if (range.empty())
|
15551 |
+
cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));
|
15552 |
+
else
|
15553 |
+
cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());
|
15554 |
+
}
|
15555 |
+
cm.scrollIntoView();
|
15556 |
+
});
|
15557 |
+
};
|
15558 |
+
|
15559 |
+
if (!mac) map[ctrl + "T"] = "transposeChars";
|
15560 |
+
|
15561 |
+
function sortLines(cm, caseSensitive) {
|
15562 |
+
if (cm.isReadOnly()) return CodeMirror.Pass
|
15563 |
+
var ranges = cm.listSelections(), toSort = [], selected;
|
15564 |
+
for (var i = 0; i < ranges.length; i++) {
|
15565 |
+
var range = ranges[i];
|
15566 |
+
if (range.empty()) continue;
|
15567 |
+
var from = range.from().line, to = range.to().line;
|
15568 |
+
while (i < ranges.length - 1 && ranges[i + 1].from().line == to)
|
15569 |
+
to = ranges[++i].to().line;
|
15570 |
+
if (!ranges[i].to().ch) to--;
|
15571 |
+
toSort.push(from, to);
|
15572 |
+
}
|
15573 |
+
if (toSort.length) selected = true;
|
15574 |
+
else toSort.push(cm.firstLine(), cm.lastLine());
|
15575 |
+
|
15576 |
+
cm.operation(function() {
|
15577 |
+
var ranges = [];
|
15578 |
+
for (var i = 0; i < toSort.length; i += 2) {
|
15579 |
+
var from = toSort[i], to = toSort[i + 1];
|
15580 |
+
var start = Pos(from, 0), end = Pos(to);
|
15581 |
+
var lines = cm.getRange(start, end, false);
|
15582 |
+
if (caseSensitive)
|
15583 |
+
lines.sort();
|
15584 |
+
else
|
15585 |
+
lines.sort(function(a, b) {
|
15586 |
+
var au = a.toUpperCase(), bu = b.toUpperCase();
|
15587 |
+
if (au != bu) { a = au; b = bu; }
|
15588 |
+
return a < b ? -1 : a == b ? 0 : 1;
|
15589 |
+
});
|
15590 |
+
cm.replaceRange(lines, start, end);
|
15591 |
+
if (selected) ranges.push({anchor: start, head: Pos(to + 1, 0)});
|
15592 |
+
}
|
15593 |
+
if (selected) cm.setSelections(ranges, 0);
|
15594 |
+
});
|
15595 |
+
}
|
15596 |
+
|
15597 |
+
cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); };
|
15598 |
+
cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); };
|
15599 |
+
|
15600 |
+
cmds[map["F2"] = "nextBookmark"] = function(cm) {
|
15601 |
+
var marks = cm.state.sublimeBookmarks;
|
15602 |
+
if (marks) while (marks.length) {
|
15603 |
+
var current = marks.shift();
|
15604 |
+
var found = current.find();
|
15605 |
+
if (found) {
|
15606 |
+
marks.push(current);
|
15607 |
+
return cm.setSelection(found.from, found.to);
|
15608 |
+
}
|
15609 |
+
}
|
15610 |
+
};
|
15611 |
+
|
15612 |
+
cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) {
|
15613 |
+
var marks = cm.state.sublimeBookmarks;
|
15614 |
+
if (marks) while (marks.length) {
|
15615 |
+
marks.unshift(marks.pop());
|
15616 |
+
var found = marks[marks.length - 1].find();
|
15617 |
+
if (!found)
|
15618 |
+
marks.pop();
|
15619 |
+
else
|
15620 |
+
return cm.setSelection(found.from, found.to);
|
15621 |
+
}
|
15622 |
+
};
|
15623 |
+
|
15624 |
+
cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) {
|
15625 |
+
var ranges = cm.listSelections();
|
15626 |
+
var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);
|
15627 |
+
for (var i = 0; i < ranges.length; i++) {
|
15628 |
+
var from = ranges[i].from(), to = ranges[i].to();
|
15629 |
+
var found = cm.findMarks(from, to);
|
15630 |
+
for (var j = 0; j < found.length; j++) {
|
15631 |
+
if (found[j].sublimeBookmark) {
|
15632 |
+
found[j].clear();
|
15633 |
+
for (var k = 0; k < marks.length; k++)
|
15634 |
+
if (marks[k] == found[j])
|
15635 |
+
marks.splice(k--, 1);
|
15636 |
+
break;
|
15637 |
+
}
|
15638 |
+
}
|
15639 |
+
if (j == found.length)
|
15640 |
+
marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false}));
|
15641 |
+
}
|
15642 |
+
};
|
15643 |
+
|
15644 |
+
cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) {
|
15645 |
+
var marks = cm.state.sublimeBookmarks;
|
15646 |
+
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
|
15647 |
+
marks.length = 0;
|
15648 |
+
};
|
15649 |
+
|
15650 |
+
cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) {
|
15651 |
+
var marks = cm.state.sublimeBookmarks, ranges = [];
|
15652 |
+
if (marks) for (var i = 0; i < marks.length; i++) {
|
15653 |
+
var found = marks[i].find();
|
15654 |
+
if (!found)
|
15655 |
+
marks.splice(i--, 0);
|
15656 |
+
else
|
15657 |
+
ranges.push({anchor: found.from, head: found.to});
|
15658 |
+
}
|
15659 |
+
if (ranges.length)
|
15660 |
+
cm.setSelections(ranges, 0);
|
15661 |
+
};
|
15662 |
+
|
15663 |
+
map["Alt-Q"] = "wrapLines";
|
15664 |
+
|
15665 |
+
var cK = ctrl + "K ";
|
15666 |
+
|
15667 |
+
function modifyWordOrSelection(cm, mod) {
|
15668 |
+
cm.operation(function() {
|
15669 |
+
var ranges = cm.listSelections(), indices = [], replacements = [];
|
15670 |
+
for (var i = 0; i < ranges.length; i++) {
|
15671 |
+
var range = ranges[i];
|
15672 |
+
if (range.empty()) { indices.push(i); replacements.push(""); }
|
15673 |
+
else replacements.push(mod(cm.getRange(range.from(), range.to())));
|
15674 |
+
}
|
15675 |
+
cm.replaceSelections(replacements, "around", "case");
|
15676 |
+
for (var i = indices.length - 1, at; i >= 0; i--) {
|
15677 |
+
var range = ranges[indices[i]];
|
15678 |
+
if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;
|
15679 |
+
var word = wordAt(cm, range.head);
|
15680 |
+
at = word.from;
|
15681 |
+
cm.replaceRange(mod(word.word), word.from, word.to);
|
15682 |
+
}
|
15683 |
+
});
|
15684 |
+
}
|
15685 |
+
|
15686 |
+
map[cK + ctrl + "Backspace"] = "delLineLeft";
|
15687 |
+
|
15688 |
+
cmds[map["Backspace"] = "smartBackspace"] = function(cm) {
|
15689 |
+
if (cm.somethingSelected()) return CodeMirror.Pass;
|
15690 |
+
|
15691 |
+
cm.operation(function() {
|
15692 |
+
var cursors = cm.listSelections();
|
15693 |
+
var indentUnit = cm.getOption("indentUnit");
|
15694 |
+
|
15695 |
+
for (var i = cursors.length - 1; i >= 0; i--) {
|
15696 |
+
var cursor = cursors[i].head;
|
15697 |
+
var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor);
|
15698 |
+
var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize"));
|
15699 |
+
|
15700 |
+
// Delete by one character by default
|
15701 |
+
var deletePos = cm.findPosH(cursor, -1, "char", false);
|
15702 |
+
|
15703 |
+
if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) {
|
15704 |
+
var prevIndent = new Pos(cursor.line,
|
15705 |
+
CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit));
|
15706 |
+
|
15707 |
+
// Smart delete only if we found a valid prevIndent location
|
15708 |
+
if (prevIndent.ch != cursor.ch) deletePos = prevIndent;
|
15709 |
+
}
|
15710 |
+
|
15711 |
+
cm.replaceRange("", deletePos, cursor, "+delete");
|
15712 |
+
}
|
15713 |
+
});
|
15714 |
+
};
|
15715 |
+
|
15716 |
+
cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
|
15717 |
+
cm.operation(function() {
|
15718 |
+
var ranges = cm.listSelections();
|
15719 |
+
for (var i = ranges.length - 1; i >= 0; i--)
|
15720 |
+
cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete");
|
15721 |
+
cm.scrollIntoView();
|
15722 |
+
});
|
15723 |
+
};
|
15724 |
+
|
15725 |
+
cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) {
|
15726 |
+
modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });
|
15727 |
+
};
|
15728 |
+
cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) {
|
15729 |
+
modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });
|
15730 |
+
};
|
15731 |
+
|
15732 |
+
cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) {
|
15733 |
+
if (cm.state.sublimeMark) cm.state.sublimeMark.clear();
|
15734 |
+
cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
|
15735 |
+
};
|
15736 |
+
cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) {
|
15737 |
+
var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
|
15738 |
+
if (found) cm.setSelection(cm.getCursor(), found);
|
15739 |
+
};
|
15740 |
+
cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) {
|
15741 |
+
var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
|
15742 |
+
if (found) {
|
15743 |
+
var from = cm.getCursor(), to = found;
|
15744 |
+
if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }
|
15745 |
+
cm.state.sublimeKilled = cm.getRange(from, to);
|
15746 |
+
cm.replaceRange("", from, to);
|
15747 |
+
}
|
15748 |
+
};
|
15749 |
+
cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {
|
15750 |
+
var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
|
15751 |
+
if (found) {
|
15752 |
+
cm.state.sublimeMark.clear();
|
15753 |
+
cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
|
15754 |
+
cm.setCursor(found);
|
15755 |
+
}
|
15756 |
+
};
|
15757 |
+
cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) {
|
15758 |
+
if (cm.state.sublimeKilled != null)
|
15759 |
+
cm.replaceSelection(cm.state.sublimeKilled, null, "paste");
|
15760 |
+
};
|
15761 |
+
|
15762 |
+
map[cK + ctrl + "G"] = "clearBookmarks";
|
15763 |
+
cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) {
|
15764 |
+
var pos = cm.cursorCoords(null, "local");
|
15765 |
+
cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
|
15766 |
+
};
|
15767 |
+
|
15768 |
+
var selectLinesCombo = mac ? "Ctrl-Shift-" : "Ctrl-Alt-";
|
15769 |
+
cmds[map[selectLinesCombo + "Up"] = "selectLinesUpward"] = function(cm) {
|
15770 |
+
cm.operation(function() {
|
15771 |
+
var ranges = cm.listSelections();
|
15772 |
+
for (var i = 0; i < ranges.length; i++) {
|
15773 |
+
var range = ranges[i];
|
15774 |
+
if (range.head.line > cm.firstLine())
|
15775 |
+
cm.addSelection(Pos(range.head.line - 1, range.head.ch));
|
15776 |
+
}
|
15777 |
+
});
|
15778 |
+
};
|
15779 |
+
cmds[map[selectLinesCombo + "Down"] = "selectLinesDownward"] = function(cm) {
|
15780 |
+
cm.operation(function() {
|
15781 |
+
var ranges = cm.listSelections();
|
15782 |
+
for (var i = 0; i < ranges.length; i++) {
|
15783 |
+
var range = ranges[i];
|
15784 |
+
if (range.head.line < cm.lastLine())
|
15785 |
+
cm.addSelection(Pos(range.head.line + 1, range.head.ch));
|
15786 |
+
}
|
15787 |
+
});
|
15788 |
+
};
|
15789 |
+
|
15790 |
+
function getTarget(cm) {
|
15791 |
+
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
15792 |
+
if (CodeMirror.cmpPos(from, to) == 0) {
|
15793 |
+
var word = wordAt(cm, from);
|
15794 |
+
if (!word.word) return;
|
15795 |
+
from = word.from;
|
15796 |
+
to = word.to;
|
15797 |
+
}
|
15798 |
+
return {from: from, to: to, query: cm.getRange(from, to), word: word};
|
15799 |
+
}
|
15800 |
+
|
15801 |
+
function findAndGoTo(cm, forward) {
|
15802 |
+
var target = getTarget(cm);
|
15803 |
+
if (!target) return;
|
15804 |
+
var query = target.query;
|
15805 |
+
var cur = cm.getSearchCursor(query, forward ? target.to : target.from);
|
15806 |
+
|
15807 |
+
if (forward ? cur.findNext() : cur.findPrevious()) {
|
15808 |
+
cm.setSelection(cur.from(), cur.to());
|
15809 |
+
} else {
|
15810 |
+
cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0)
|
15811 |
+
: cm.clipPos(Pos(cm.lastLine())));
|
15812 |
+
if (forward ? cur.findNext() : cur.findPrevious())
|
15813 |
+
cm.setSelection(cur.from(), cur.to());
|
15814 |
+
else if (target.word)
|
15815 |
+
cm.setSelection(target.from, target.to);
|
15816 |
+
}
|
15817 |
+
};
|
15818 |
+
cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); };
|
15819 |
+
cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); };
|
15820 |
+
cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) {
|
15821 |
+
var target = getTarget(cm);
|
15822 |
+
if (!target) return;
|
15823 |
+
var cur = cm.getSearchCursor(target.query);
|
15824 |
+
var matches = [];
|
15825 |
+
var primaryIndex = -1;
|
15826 |
+
while (cur.findNext()) {
|
15827 |
+
matches.push({anchor: cur.from(), head: cur.to()});
|
15828 |
+
if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch)
|
15829 |
+
primaryIndex++;
|
15830 |
+
}
|
15831 |
+
cm.setSelections(matches, primaryIndex);
|
15832 |
+
};
|
15833 |
+
|
15834 |
+
map["Shift-" + ctrl + "["] = "fold";
|
15835 |
+
map["Shift-" + ctrl + "]"] = "unfold";
|
15836 |
+
map[cK + ctrl + "0"] = map[cK + ctrl + "J"] = "unfoldAll";
|
15837 |
+
|
15838 |
+
map[ctrl + "I"] = "findIncremental";
|
15839 |
+
map["Shift-" + ctrl + "I"] = "findIncrementalReverse";
|
15840 |
+
map[ctrl + "H"] = "replace";
|
15841 |
+
map["F3"] = "findNext";
|
15842 |
+
map["Shift-F3"] = "findPrev";
|
15843 |
+
|
15844 |
+
CodeMirror.normalizeKeyMap(map);
|
15845 |
+
});
|
15846 |
+
|
15847 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
15848 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
15849 |
+
|
15850 |
+
(function(mod) {
|
15851 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
15852 |
+
mod(require("../lib/codemirror"));
|
15853 |
+
else if (typeof define == "function" && define.amd) // AMD
|
15854 |
+
define(["../lib/codemirror"], mod);
|
15855 |
+
else // Plain browser env
|
15856 |
+
mod(CodeMirror);
|
15857 |
+
})(function(CodeMirror) {
|
15858 |
+
"use strict";
|
15859 |
+
|
15860 |
+
var Pos = CodeMirror.Pos;
|
15861 |
+
function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
|
15862 |
+
|
15863 |
+
// Kill 'ring'
|
15864 |
+
|
15865 |
+
var killRing = [];
|
15866 |
+
function addToRing(str) {
|
15867 |
+
killRing.push(str);
|
15868 |
+
if (killRing.length > 50) killRing.shift();
|
15869 |
+
}
|
15870 |
+
function growRingTop(str) {
|
15871 |
+
if (!killRing.length) return addToRing(str);
|
15872 |
+
killRing[killRing.length - 1] += str;
|
15873 |
+
}
|
15874 |
+
function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; }
|
15875 |
+
function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
|
15876 |
+
|
15877 |
+
var lastKill = null;
|
15878 |
+
|
15879 |
+
function kill(cm, from, to, mayGrow, text) {
|
15880 |
+
if (text == null) text = cm.getRange(from, to);
|
15881 |
+
|
15882 |
+
if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
|
15883 |
+
growRingTop(text);
|
15884 |
+
else
|
15885 |
+
addToRing(text);
|
15886 |
+
cm.replaceRange("", from, to, "+delete");
|
15887 |
+
|
15888 |
+
if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
|
15889 |
+
else lastKill = null;
|
15890 |
+
}
|
15891 |
+
|
15892 |
+
// Boundaries of various units
|
15893 |
+
|
15894 |
+
function byChar(cm, pos, dir) {
|
15895 |
+
return cm.findPosH(pos, dir, "char", true);
|
15896 |
+
}
|
15897 |
+
|
15898 |
+
function byWord(cm, pos, dir) {
|
15899 |
+
return cm.findPosH(pos, dir, "word", true);
|
15900 |
+
}
|
15901 |
+
|
15902 |
+
function byLine(cm, pos, dir) {
|
15903 |
+
return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn);
|
15904 |
+
}
|
15905 |
+
|
15906 |
+
function byPage(cm, pos, dir) {
|
15907 |
+
return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn);
|
15908 |
+
}
|
15909 |
+
|
15910 |
+
function byParagraph(cm, pos, dir) {
|
15911 |
+
var no = pos.line, line = cm.getLine(no);
|
15912 |
+
var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));
|
15913 |
+
var fst = cm.firstLine(), lst = cm.lastLine();
|
15914 |
+
for (;;) {
|
15915 |
+
no += dir;
|
15916 |
+
if (no < fst || no > lst)
|
15917 |
+
return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));
|
15918 |
+
line = cm.getLine(no);
|
15919 |
+
var hasText = /\S/.test(line);
|
15920 |
+
if (hasText) sawText = true;
|
15921 |
+
else if (sawText) return Pos(no, 0);
|
15922 |
+
}
|
15923 |
+
}
|
15924 |
+
|
15925 |
+
function bySentence(cm, pos, dir) {
|
15926 |
+
var line = pos.line, ch = pos.ch;
|
15927 |
+
var text = cm.getLine(pos.line), sawWord = false;
|
15928 |
+
for (;;) {
|
15929 |
+
var next = text.charAt(ch + (dir < 0 ? -1 : 0));
|
15930 |
+
if (!next) { // End/beginning of line reached
|
15931 |
+
if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);
|
15932 |
+
text = cm.getLine(line + dir);
|
15933 |
+
if (!/\S/.test(text)) return Pos(line, ch);
|
15934 |
+
line += dir;
|
15935 |
+
ch = dir < 0 ? text.length : 0;
|
15936 |
+
continue;
|
15937 |
+
}
|
15938 |
+
if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));
|
15939 |
+
if (!sawWord) sawWord = /\w/.test(next);
|
15940 |
+
ch += dir;
|
15941 |
+
}
|
15942 |
+
}
|
15943 |
+
|
15944 |
+
function byExpr(cm, pos, dir) {
|
15945 |
+
var wrap;
|
15946 |
+
if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))
|
15947 |
+
&& wrap.match && (wrap.forward ? 1 : -1) == dir)
|
15948 |
+
return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
|
15949 |
+
|
15950 |
+
for (var first = true;; first = false) {
|
15951 |
+
var token = cm.getTokenAt(pos);
|
15952 |
+
var after = Pos(pos.line, dir < 0 ? token.start : token.end);
|
15953 |
+
if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) {
|
15954 |
+
var newPos = cm.findPosH(after, dir, "char");
|
15955 |
+
if (posEq(after, newPos)) return pos;
|
15956 |
+
else pos = newPos;
|
15957 |
+
} else {
|
15958 |
+
return after;
|
15959 |
+
}
|
15960 |
+
}
|
15961 |
+
}
|
15962 |
+
|
15963 |
+
// Prefixes (only crudely supported)
|
15964 |
+
|
15965 |
+
function getPrefix(cm, precise) {
|
15966 |
+
var digits = cm.state.emacsPrefix;
|
15967 |
+
if (!digits) return precise ? null : 1;
|
15968 |
+
clearPrefix(cm);
|
15969 |
+
return digits == "-" ? -1 : Number(digits);
|
15970 |
+
}
|
15971 |
+
|
15972 |
+
function repeated(cmd) {
|
15973 |
+
var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd;
|
15974 |
+
return function(cm) {
|
15975 |
+
var prefix = getPrefix(cm);
|
15976 |
+
f(cm);
|
15977 |
+
for (var i = 1; i < prefix; ++i) f(cm);
|
15978 |
+
};
|
15979 |
+
}
|
15980 |
+
|
15981 |
+
function findEnd(cm, pos, by, dir) {
|
15982 |
+
var prefix = getPrefix(cm);
|
15983 |
+
if (prefix < 0) { dir = -dir; prefix = -prefix; }
|
15984 |
+
for (var i = 0; i < prefix; ++i) {
|
15985 |
+
var newPos = by(cm, pos, dir);
|
15986 |
+
if (posEq(newPos, pos)) break;
|
15987 |
+
pos = newPos;
|
15988 |
+
}
|
15989 |
+
return pos;
|
15990 |
+
}
|
15991 |
+
|
15992 |
+
function move(by, dir) {
|
15993 |
+
var f = function(cm) {
|
15994 |
+
cm.extendSelection(findEnd(cm, cm.getCursor(), by, dir));
|
15995 |
+
};
|
15996 |
+
f.motion = true;
|
15997 |
+
return f;
|
15998 |
+
}
|
15999 |
+
|
16000 |
+
function killTo(cm, by, dir) {
|
16001 |
+
var selections = cm.listSelections(), cursor;
|
16002 |
+
var i = selections.length;
|
16003 |
+
while (i--) {
|
16004 |
+
cursor = selections[i].head;
|
16005 |
+
kill(cm, cursor, findEnd(cm, cursor, by, dir), true);
|
16006 |
+
}
|
16007 |
+
}
|
16008 |
+
|
16009 |
+
function killRegion(cm) {
|
16010 |
+
if (cm.somethingSelected()) {
|
16011 |
+
var selections = cm.listSelections(), selection;
|
16012 |
+
var i = selections.length;
|
16013 |
+
while (i--) {
|
16014 |
+
selection = selections[i];
|
16015 |
+
kill(cm, selection.anchor, selection.head);
|
16016 |
+
}
|
16017 |
+
return true;
|
16018 |
+
}
|
16019 |
+
}
|
16020 |
+
|
16021 |
+
function addPrefix(cm, digit) {
|
16022 |
+
if (cm.state.emacsPrefix) {
|
16023 |
+
if (digit != "-") cm.state.emacsPrefix += digit;
|
16024 |
+
return;
|
16025 |
+
}
|
16026 |
+
// Not active yet
|
16027 |
+
cm.state.emacsPrefix = digit;
|
16028 |
+
cm.on("keyHandled", maybeClearPrefix);
|
16029 |
+
cm.on("inputRead", maybeDuplicateInput);
|
16030 |
+
}
|
16031 |
+
|
16032 |
+
var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true};
|
16033 |
+
|
16034 |
+
function maybeClearPrefix(cm, arg) {
|
16035 |
+
if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg))
|
16036 |
+
clearPrefix(cm);
|
16037 |
+
}
|
16038 |
+
|
16039 |
+
function clearPrefix(cm) {
|
16040 |
+
cm.state.emacsPrefix = null;
|
16041 |
+
cm.off("keyHandled", maybeClearPrefix);
|
16042 |
+
cm.off("inputRead", maybeDuplicateInput);
|
16043 |
+
}
|
16044 |
+
|
16045 |
+
function maybeDuplicateInput(cm, event) {
|
16046 |
+
var dup = getPrefix(cm);
|
16047 |
+
if (dup > 1 && event.origin == "+input") {
|
16048 |
+
var one = event.text.join("\n"), txt = "";
|
16049 |
+
for (var i = 1; i < dup; ++i) txt += one;
|
16050 |
+
cm.replaceSelection(txt);
|
16051 |
+
}
|
16052 |
+
}
|
16053 |
+
|
16054 |
+
function addPrefixMap(cm) {
|
16055 |
+
cm.state.emacsPrefixMap = true;
|
16056 |
+
cm.addKeyMap(prefixMap);
|
16057 |
+
cm.on("keyHandled", maybeRemovePrefixMap);
|
16058 |
+
cm.on("inputRead", maybeRemovePrefixMap);
|
16059 |
+
}
|
16060 |
+
|
16061 |
+
function maybeRemovePrefixMap(cm, arg) {
|
16062 |
+
if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return;
|
16063 |
+
cm.removeKeyMap(prefixMap);
|
16064 |
+
cm.state.emacsPrefixMap = false;
|
16065 |
+
cm.off("keyHandled", maybeRemovePrefixMap);
|
16066 |
+
cm.off("inputRead", maybeRemovePrefixMap);
|
16067 |
+
}
|
16068 |
+
|
16069 |
+
// Utilities
|
16070 |
+
|
16071 |
+
function setMark(cm) {
|
16072 |
+
cm.setCursor(cm.getCursor());
|
16073 |
+
cm.setExtending(!cm.getExtending());
|
16074 |
+
cm.on("change", function() { cm.setExtending(false); });
|
16075 |
+
}
|
16076 |
+
|
16077 |
+
function clearMark(cm) {
|
16078 |
+
cm.setExtending(false);
|
16079 |
+
cm.setCursor(cm.getCursor());
|
16080 |
+
}
|
16081 |
+
|
16082 |
+
function getInput(cm, msg, f) {
|
16083 |
+
if (cm.openDialog)
|
16084 |
+
cm.openDialog(msg + ": <input type=\"text\" style=\"width: 10em\"/>", f, {bottom: true});
|
16085 |
+
else
|
16086 |
+
f(prompt(msg, ""));
|
16087 |
+
}
|
16088 |
+
|
16089 |
+
function operateOnWord(cm, op) {
|
16090 |
+
var start = cm.getCursor(), end = cm.findPosH(start, 1, "word");
|
16091 |
+
cm.replaceRange(op(cm.getRange(start, end)), start, end);
|
16092 |
+
cm.setCursor(end);
|
16093 |
+
}
|
16094 |
+
|
16095 |
+
function toEnclosingExpr(cm) {
|
16096 |
+
var pos = cm.getCursor(), line = pos.line, ch = pos.ch;
|
16097 |
+
var stack = [];
|
16098 |
+
while (line >= cm.firstLine()) {
|
16099 |
+
var text = cm.getLine(line);
|
16100 |
+
for (var i = ch == null ? text.length : ch; i > 0;) {
|
16101 |
+
var ch = text.charAt(--i);
|
16102 |
+
if (ch == ")")
|
16103 |
+
stack.push("(");
|
16104 |
+
else if (ch == "]")
|
16105 |
+
stack.push("[");
|
16106 |
+
else if (ch == "}")
|
16107 |
+
stack.push("{");
|
16108 |
+
else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch))
|
16109 |
+
return cm.extendSelection(Pos(line, i));
|
16110 |
+
}
|
16111 |
+
--line; ch = null;
|
16112 |
+
}
|
16113 |
+
}
|
16114 |
+
|
16115 |
+
function quit(cm) {
|
16116 |
+
cm.execCommand("clearSearch");
|
16117 |
+
clearMark(cm);
|
16118 |
+
}
|
16119 |
+
|
16120 |
+
CodeMirror.emacs = {kill: kill, killRegion: killRegion, repeated: repeated};
|
16121 |
+
|
16122 |
+
// Actual keymap
|
16123 |
+
|
16124 |
+
var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
|
16125 |
+
"Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));},
|
16126 |
+
"Ctrl-K": repeated(function(cm) {
|
16127 |
+
var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
|
16128 |
+
var text = cm.getRange(start, end);
|
16129 |
+
if (!/\S/.test(text)) {
|
16130 |
+
text += "\n";
|
16131 |
+
end = Pos(start.line + 1, 0);
|
16132 |
+
}
|
16133 |
+
kill(cm, start, end, true, text);
|
16134 |
+
}),
|
16135 |
+
"Alt-W": function(cm) {
|
16136 |
+
addToRing(cm.getSelection());
|
16137 |
+
clearMark(cm);
|
16138 |
+
},
|
16139 |
+
"Ctrl-Y": function(cm) {
|
16140 |
+
var start = cm.getCursor();
|
16141 |
+
cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
|
16142 |
+
cm.setSelection(start, cm.getCursor());
|
16143 |
+
},
|
16144 |
+
"Alt-Y": function(cm) {cm.replaceSelection(popFromRing(), "around", "paste");},
|
16145 |
+
|
16146 |
+
"Ctrl-Space": setMark, "Ctrl-Shift-2": setMark,
|
16147 |
+
|
16148 |
+
"Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
|
16149 |
+
"Right": move(byChar, 1), "Left": move(byChar, -1),
|
16150 |
+
"Ctrl-D": function(cm) { killTo(cm, byChar, 1); },
|
16151 |
+
"Delete": function(cm) { killRegion(cm) || killTo(cm, byChar, 1); },
|
16152 |
+
"Ctrl-H": function(cm) { killTo(cm, byChar, -1); },
|
16153 |
+
"Backspace": function(cm) { killRegion(cm) || killTo(cm, byChar, -1); },
|
16154 |
+
|
16155 |
+
"Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
|
16156 |
+
"Alt-D": function(cm) { killTo(cm, byWord, 1); },
|
16157 |
+
"Alt-Backspace": function(cm) { killTo(cm, byWord, -1); },
|
16158 |
+
|
16159 |
+
"Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1),
|
16160 |
+
"Down": move(byLine, 1), "Up": move(byLine, -1),
|
16161 |
+
"Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
16162 |
+
"End": "goLineEnd", "Home": "goLineStart",
|
16163 |
+
|
16164 |
+
"Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1),
|
16165 |
+
"PageUp": move(byPage, -1), "PageDown": move(byPage, 1),
|
16166 |
+
|
16167 |
+
"Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1),
|
16168 |
+
|
16169 |
+
"Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1),
|
16170 |
+
"Alt-K": function(cm) { killTo(cm, bySentence, 1); },
|
16171 |
+
|
16172 |
+
"Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); },
|
16173 |
+
"Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); },
|
16174 |
+
"Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1),
|
16175 |
+
|
16176 |
+
"Shift-Ctrl-Alt-2": function(cm) {
|
16177 |
+
var cursor = cm.getCursor();
|
16178 |
+
cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor);
|
16179 |
+
},
|
16180 |
+
"Ctrl-Alt-T": function(cm) {
|
16181 |
+
var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);
|
16182 |
+
var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1);
|
16183 |
+
cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) +
|
16184 |
+
cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
|
16185 |
+
},
|
16186 |
+
"Ctrl-Alt-U": repeated(toEnclosingExpr),
|
16187 |
+
|
16188 |
+
"Alt-Space": function(cm) {
|
16189 |
+
var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line);
|
16190 |
+
while (from && /\s/.test(text.charAt(from - 1))) --from;
|
16191 |
+
while (to < text.length && /\s/.test(text.charAt(to))) ++to;
|
16192 |
+
cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
|
16193 |
+
},
|
16194 |
+
"Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }),
|
16195 |
+
"Ctrl-T": repeated(function(cm) {
|
16196 |
+
cm.execCommand("transposeChars");
|
16197 |
+
}),
|
16198 |
+
|
16199 |
+
"Alt-C": repeated(function(cm) {
|
16200 |
+
operateOnWord(cm, function(w) {
|
16201 |
+
var letter = w.search(/\w/);
|
16202 |
+
if (letter == -1) return w;
|
16203 |
+
return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase();
|
16204 |
+
});
|
16205 |
+
}),
|
16206 |
+
"Alt-U": repeated(function(cm) {
|
16207 |
+
operateOnWord(cm, function(w) { return w.toUpperCase(); });
|
16208 |
+
}),
|
16209 |
+
"Alt-L": repeated(function(cm) {
|
16210 |
+
operateOnWord(cm, function(w) { return w.toLowerCase(); });
|
16211 |
+
}),
|
16212 |
+
|
16213 |
+
"Alt-;": "toggleComment",
|
16214 |
+
|
16215 |
+
"Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
|
16216 |
+
"Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
|
16217 |
+
"Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
|
16218 |
+
"Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace",
|
16219 |
+
"Alt-/": "autocomplete",
|
16220 |
+
"Enter": "newlineAndIndent",
|
16221 |
+
"Ctrl-J": repeated(function(cm) { cm.replaceSelection("\n", "end"); }),
|
16222 |
+
"Tab": "indentAuto",
|
16223 |
+
|
16224 |
+
"Alt-G G": function(cm) {
|
16225 |
+
var prefix = getPrefix(cm, true);
|
16226 |
+
if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
|
16227 |
+
|
16228 |
+
getInput(cm, "Goto line", function(str) {
|
16229 |
+
var num;
|
16230 |
+
if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
|
16231 |
+
cm.setCursor(num - 1);
|
16232 |
+
});
|
16233 |
+
},
|
16234 |
+
|
16235 |
+
"Ctrl-X Tab": function(cm) {
|
16236 |
+
cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
|
16237 |
+
},
|
16238 |
+
"Ctrl-X Ctrl-X": function(cm) {
|
16239 |
+
cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
|
16240 |
+
},
|
16241 |
+
"Ctrl-X Ctrl-S": "save",
|
16242 |
+
"Ctrl-X Ctrl-W": "save",
|
16243 |
+
"Ctrl-X S": "saveAll",
|
16244 |
+
"Ctrl-X F": "open",
|
16245 |
+
"Ctrl-X U": repeated("undo"),
|
16246 |
+
"Ctrl-X K": "close",
|
16247 |
+
"Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },
|
16248 |
+
"Ctrl-X H": "selectAll",
|
16249 |
+
|
16250 |
+
"Ctrl-Q Tab": repeated("insertTab"),
|
16251 |
+
"Ctrl-U": addPrefixMap
|
16252 |
+
});
|
16253 |
+
|
16254 |
+
var prefixMap = {"Ctrl-G": clearPrefix};
|
16255 |
+
function regPrefix(d) {
|
16256 |
+
prefixMap[d] = function(cm) { addPrefix(cm, d); };
|
16257 |
+
keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); };
|
16258 |
+
prefixPreservingKeys["Ctrl-" + d] = true;
|
16259 |
+
}
|
16260 |
+
for (var i = 0; i < 10; ++i) regPrefix(String(i));
|
16261 |
+
regPrefix("-");
|
16262 |
+
});
|
16263 |
+
|
16264 |
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
16265 |
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
16266 |
+
|
16267 |
+
/**
|
16268 |
+
* Supported keybindings:
|
16269 |
+
* Too many to list. Refer to defaultKeyMap below.
|
16270 |
+
*
|
16271 |
+
* Supported Ex commands:
|
16272 |
+
* Refer to defaultExCommandMap below.
|
16273 |
+
*
|
16274 |
+
* Registers: unnamed, -, a-z, A-Z, 0-9
|
16275 |
+
* (Does not respect the special case for number registers when delete
|
16276 |
+
* operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
|
16277 |
+
* TODO: Implement the remaining registers.
|
16278 |
+
*
|
16279 |
+
* Marks: a-z, A-Z, and 0-9
|
16280 |
+
* TODO: Implement the remaining special marks. They have more complex
|
16281 |
+
* behavior.
|
16282 |
+
*
|
16283 |
+
* Events:
|
16284 |
+
* 'vim-mode-change' - raised on the editor anytime the current mode changes,
|
16285 |
+
* Event object: {mode: "visual", subMode: "linewise"}
|
16286 |
+
*
|
16287 |
+
* Code structure:
|
16288 |
+
* 1. Default keymap
|
16289 |
+
* 2. Variable declarations and short basic helpers
|
16290 |
+
* 3. Instance (External API) implementation
|
16291 |
+
* 4. Internal state tracking objects (input state, counter) implementation
|
16292 |
+
* and instantiation
|
16293 |
+
* 5. Key handler (the main command dispatcher) implementation
|
16294 |
+
* 6. Motion, operator, and action implementations
|
16295 |
+
* 7. Helper functions for the key handler, motions, operators, and actions
|
16296 |
+
* 8. Set up Vim to work as a keymap for CodeMirror.
|
16297 |
+
* 9. Ex command implementations.
|
16298 |
+
*/
|
16299 |
+
|
16300 |
+
(function(mod) {
|
16301 |
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
16302 |
+
mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/edit/matchbrackets.js"));
|
16303 |
+
else if (typeof define == "function" && define.amd) // AMD
|
16304 |
+
define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/edit/matchbrackets"], mod);
|
16305 |
+
else // Plain browser env
|
16306 |
+
mod(CodeMirror);
|
16307 |
+
})(function(CodeMirror) {
|
16308 |
+
'use strict';
|
16309 |
+
|
16310 |
+
var defaultKeymap = [
|
16311 |
+
// Key to key mapping. This goes first to make it possible to override
|
16312 |
+
// existing mappings.
|
16313 |
+
{ keys: '<Left>', type: 'keyToKey', toKeys: 'h' },
|
16314 |
+
{ keys: '<Right>', type: 'keyToKey', toKeys: 'l' },
|
16315 |
+
{ keys: '<Up>', type: 'keyToKey', toKeys: 'k' },
|
16316 |
+
{ keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
|
16317 |
+
{ keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
|
16318 |
+
{ keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'},
|
16319 |
+
{ keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' },
|
16320 |
+
{ keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },
|
16321 |
+
{ keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' },
|
16322 |
+
{ keys: '<S-BS>', type: 'keyToKey', toKeys: 'b', context: 'normal' },
|
16323 |
+
{ keys: '<C-n>', type: 'keyToKey', toKeys: 'j' },
|
16324 |
+
{ keys: '<C-p>', type: 'keyToKey', toKeys: 'k' },
|
16325 |
+
{ keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>' },
|
16326 |
+
{ keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>' },
|
16327 |
+
{ keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
|
16328 |
+
{ keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
|
16329 |
+
{ keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },
|
16330 |
+
{ keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'},
|
16331 |
+
{ keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },
|
16332 |
+
{ keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' },
|
16333 |
+
{ keys: '<Home>', type: 'keyToKey', toKeys: '0' },
|
16334 |
+
{ keys: '<End>', type: 'keyToKey', toKeys: '$' },
|
16335 |
+
{ keys: '<PageUp>', type: 'keyToKey', toKeys: '<C-b>' },
|
16336 |
+
{ keys: '<PageDown>', type: 'keyToKey', toKeys: '<C-f>' },
|
16337 |
+
{ keys: '<CR>', type: 'keyToKey', toKeys: 'j^', context: 'normal' },
|
16338 |
+
{ keys: '<Ins>', type: 'action', action: 'toggleOverwrite', context: 'insert' },
|
16339 |
+
// Motions
|
16340 |
+
{ keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }},
|
16341 |
+
{ keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }},
|
16342 |
+
{ keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }},
|
16343 |
+
{ keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }},
|
16344 |
+
{ keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }},
|
16345 |
+
{ keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }},
|
16346 |
+
{ keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }},
|
16347 |
+
{ keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }},
|
16348 |
+
{ keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }},
|
16349 |
+
{ keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }},
|
16350 |
+
{ keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }},
|
16351 |
+
{ keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }},
|
16352 |
+
{ keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }},
|
16353 |
+
{ keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }},
|
16354 |
+
{ keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }},
|
16355 |
+
{ keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }},
|
16356 |
+
{ keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }},
|
16357 |
+
{ keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }},
|
16358 |
+
{ keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }},
|
16359 |
+
{ keys: '<C-f>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }},
|
16360 |
+
{ keys: '<C-b>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }},
|
16361 |
+
{ keys: '<C-d>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }},
|
16362 |
+
{ keys: '<C-u>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }},
|
16363 |
+
{ keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},
|
16364 |
+
{ keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},
|
16365 |
+
{ keys: '0', type: 'motion', motion: 'moveToStartOfLine' },
|
16366 |
+
{ keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' },
|
16367 |
+
{ keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }},
|
16368 |
+
{ keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }},
|
16369 |
+
{ keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }},
|
16370 |
+
{ keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }},
|
16371 |
+
{ keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }},
|
16372 |
+
{ keys: 'f<character>', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }},
|
16373 |
+
{ keys: 'F<character>', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }},
|
16374 |
+
{ keys: 't<character>', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }},
|
16375 |
+
{ keys: 'T<character>', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }},
|
16376 |
+
{ keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }},
|
16377 |
+
{ keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }},
|
16378 |
+
{ keys: '\'<character>', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}},
|
16379 |
+
{ keys: '`<character>', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}},
|
16380 |
+
{ keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },
|
16381 |
+
{ keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },
|
16382 |
+
{ keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },
|
16383 |
+
{ keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },
|
16384 |
+
// the next two aren't motions but must come before more general motion declarations
|
16385 |
+
{ keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}},
|
16386 |
+
{ keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}},
|
16387 |
+
{ keys: ']<character>', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}},
|
16388 |
+
{ keys: '[<character>', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}},
|
16389 |
+
{ keys: '|', type: 'motion', motion: 'moveToColumn'},
|
16390 |
+
{ keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'},
|
16391 |
+
{ keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'},
|
16392 |
+
// Operators
|
16393 |
+
{ keys: 'd', type: 'operator', operator: 'delete' },
|
16394 |
+
{ keys: 'y', type: 'operator', operator: 'yank' },
|
16395 |
+
{ keys: 'c', type: 'operator', operator: 'change' },
|
16396 |
+
{ keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }},
|
16397 |
+
{ keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }},
|
16398 |
+
{ keys: 'g~', type: 'operator', operator: 'changeCase' },
|
16399 |
+
{ keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true },
|
16400 |
+
{ keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true },
|
16401 |
+
{ keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }},
|
16402 |
+
{ keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }},
|
16403 |
+
// Operator-Motion dual commands
|
16404 |
+
{ keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }},
|
16405 |
+
{ keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }},
|
16406 |
+
{ keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
|
16407 |
+
{ keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'},
|
16408 |
+
{ keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'expandToLine', motionArgs: { linewise: true }, context: 'normal'},
|
16409 |
+
{ keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'},
|
16410 |
+
{ keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
|
16411 |
+
{ keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'},
|
16412 |
+
{ keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'},
|
16413 |
+
{ keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'},
|
16414 |
+
{ keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
|
16415 |
+
// Actions
|
16416 |
+
{ keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }},
|
16417 |
+
{ keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }},
|
16418 |
+
{ keys: '<C-e>', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }},
|
16419 |
+
{ keys: '<C-y>', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }},
|
16420 |
+
{ keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' },
|
16421 |
+
{ keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' },
|
16422 |
+
{ keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' },
|
16423 |
+
{ keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' },
|
16424 |
+
{ keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' },
|
16425 |
+
{ keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' },
|
16426 |
+
{ keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' },
|
16427 |
+
{ keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' },
|
16428 |
+
{ keys: 'v', type: 'action', action: 'toggleVisualMode' },
|
16429 |
+
{ keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }},
|
16430 |
+
{ keys: '<C-v>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }},
|
16431 |
+
{ keys: '<C-q>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }},
|
16432 |
+
{ keys: 'gv', type: 'action', action: 'reselectLastSelection' },
|
16433 |
+
{ keys: 'J', type: 'action', action: 'joinLines', isEdit: true },
|
16434 |
+
{ keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }},
|
16435 |
+
{ keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }},
|
16436 |
+
{ keys: 'r<character>', type: 'action', action: 'replace', isEdit: true },
|
16437 |
+
{ keys: '@<character>', type: 'action', action: 'replayMacro' },
|
16438 |
+
{ keys: 'q<character>', type: 'action', action: 'enterMacroRecordMode' },
|
16439 |
+
// Handle Replace-mode as a special case of insert mode.
|
16440 |
+
{ keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }},
|
16441 |
+
{ keys: 'u', type: 'action', action: 'undo', context: 'normal' },
|
16442 |
+
{ keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true },
|
16443 |
+
{ keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true },
|
16444 |
+
{ keys: '<C-r>', type: 'action', action: 'redo' },
|
16445 |
+
{ keys: 'm<character>', type: 'action', action: 'setMark' },
|
16446 |
+
{ keys: '"<character>', type: 'action', action: 'setRegister' },
|
16447 |
+
{ keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }},
|
16448 |
+
{ keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
|
16449 |
+
{ keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }},
|
16450 |
+
{ keys: 'z<CR>', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
|
16451 |
+
{ keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }},
|
16452 |
+
{ keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
|
16453 |
+
{ keys: '.', type: 'action', action: 'repeatLastEdit' },
|
16454 |
+
{ keys: '<C-a>', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: true, backtrack: false}},
|
16455 |
+
{ keys: '<C-x>', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}},
|
16456 |
+
{ keys: '<C-t>', type: 'action', action: 'indent', actionArgs: { indentRight: true }, context: 'insert' },
|
16457 |
+
{ keys: '<C-d>', type: 'action', action: 'indent', actionArgs: { indentRight: false }, context: 'insert' },
|
16458 |
+
// Text object motions
|
16459 |
+
{ keys: 'a<character>', type: 'motion', motion: 'textObjectManipulation' },
|
16460 |
+
{ keys: 'i<character>', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }},
|
16461 |
+
// Search
|
16462 |
+
{ keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }},
|
16463 |
+
{ keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }},
|
16464 |
+
{ keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},
|
16465 |
+
{ keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},
|
16466 |
+
{ keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }},
|
16467 |
+
{ keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }},
|
16468 |
+
// Ex command
|
16469 |
+
{ keys: ':', type: 'ex' }
|
16470 |
+
];
|
16471 |
+
|
16472 |
+
/**
|
16473 |
+
* Ex commands
|
16474 |
+
* Care must be taken when adding to the default Ex command map. For any
|
16475 |
+
* pair of commands that have a shared prefix, at least one of their
|
16476 |
+
* shortNames must not match the prefix of the other command.
|
16477 |
+
*/
|
16478 |
+
var defaultExCommandMap = [
|
16479 |
+
{ name: 'colorscheme', shortName: 'colo' },
|
16480 |
+
{ name: 'map' },
|
16481 |
+
{ name: 'imap', shortName: 'im' },
|
16482 |
+
{ name: 'nmap', shortName: 'nm' },
|
16483 |
+
{ name: 'vmap', shortName: 'vm' },
|
16484 |
+
{ name: 'unmap' },
|
16485 |
+
{ name: 'write', shortName: 'w' },
|
16486 |
+
{ name: 'undo', shortName: 'u' },
|
16487 |
+
{ name: 'redo', shortName: 'red' },
|
16488 |
+
{ name: 'set', shortName: 'se' },
|
16489 |
+
{ name: 'set', shortName: 'se' },
|
16490 |
+
{ name: 'setlocal', shortName: 'setl' },
|
16491 |
+
{ name: 'setglobal', shortName: 'setg' },
|
16492 |
+
{ name: 'sort', shortName: 'sor' },
|
16493 |
+
{ name: 'substitute', shortName: 's', possiblyAsync: true },
|
16494 |
+
{ name: 'nohlsearch', shortName: 'noh' },
|
16495 |
+
{ name: 'yank', shortName: 'y' },
|
16496 |
+
{ name: 'delmarks', shortName: 'delm' },
|
16497 |
+
{ name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
|
16498 |
+
{ name: 'global', shortName: 'g' }
|
16499 |
+
];
|
16500 |
+
|
16501 |
+
var Pos = CodeMirror.Pos;
|
16502 |
+
|
16503 |
+
var Vim = function() {
|
16504 |
+
function enterVimMode(cm) {
|
16505 |
+
cm.setOption('disableInput', true);
|
16506 |
+
cm.setOption('showCursorWhenSelecting', false);
|
16507 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
|
16508 |
+
cm.on('cursorActivity', onCursorActivity);
|
16509 |
+
maybeInitVimState(cm);
|
16510 |
+
CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm));
|
16511 |
+
}
|
16512 |
+
|
16513 |
+
function leaveVimMode(cm) {
|
16514 |
+
cm.setOption('disableInput', false);
|
16515 |
+
cm.off('cursorActivity', onCursorActivity);
|
16516 |
+
CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
|
16517 |
+
cm.state.vim = null;
|
16518 |
+
}
|
16519 |
+
|
16520 |
+
function detachVimMap(cm, next) {
|
16521 |
+
if (this == CodeMirror.keyMap.vim)
|
16522 |
+
CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
|
16523 |
+
|
16524 |
+
if (!next || next.attach != attachVimMap)
|
16525 |
+
leaveVimMode(cm, false);
|
16526 |
+
}
|
16527 |
+
function attachVimMap(cm, prev) {
|
16528 |
+
if (this == CodeMirror.keyMap.vim)
|
16529 |
+
CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor");
|
16530 |
+
|
16531 |
+
if (!prev || prev.attach != attachVimMap)
|
16532 |
+
enterVimMode(cm);
|
16533 |
+
}
|
16534 |
+
|
16535 |
+
// Deprecated, simply setting the keymap works again.
|
16536 |
+
CodeMirror.defineOption('vimMode', false, function(cm, val, prev) {
|
16537 |
+
if (val && cm.getOption("keyMap") != "vim")
|
16538 |
+
cm.setOption("keyMap", "vim");
|
16539 |
+
else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap")))
|
16540 |
+
cm.setOption("keyMap", "default");
|
16541 |
+
});
|
16542 |
+
|
16543 |
+
function cmKey(key, cm) {
|
16544 |
+
if (!cm) { return undefined; }
|
16545 |
+
if (this[key]) { return this[key]; }
|
16546 |
+
var vimKey = cmKeyToVimKey(key);
|
16547 |
+
if (!vimKey) {
|
16548 |
+
return false;
|
16549 |
+
}
|
16550 |
+
var cmd = CodeMirror.Vim.findKey(cm, vimKey);
|
16551 |
+
if (typeof cmd == 'function') {
|
16552 |
+
CodeMirror.signal(cm, 'vim-keypress', vimKey);
|
16553 |
+
}
|
16554 |
+
return cmd;
|
16555 |
+
}
|
16556 |
+
|
16557 |
+
var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'};
|
16558 |
+
var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del',Insert:'Ins'};
|
16559 |
+
function cmKeyToVimKey(key) {
|
16560 |
+
if (key.charAt(0) == '\'') {
|
16561 |
+
// Keypress character binding of format "'a'"
|
16562 |
+
return key.charAt(1);
|
16563 |
+
}
|
16564 |
+
var pieces = key.split(/-(?!$)/);
|
16565 |
+
var lastPiece = pieces[pieces.length - 1];
|
16566 |
+
if (pieces.length == 1 && pieces[0].length == 1) {
|
16567 |
+
// No-modifier bindings use literal character bindings above. Skip.
|
16568 |
+
return false;
|
16569 |
+
} else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) {
|
16570 |
+
// Ignore Shift+char bindings as they should be handled by literal character.
|
16571 |
+
return false;
|
16572 |
+
}
|
16573 |
+
var hasCharacter = false;
|
16574 |
+
for (var i = 0; i < pieces.length; i++) {
|
16575 |
+
var piece = pieces[i];
|
16576 |
+
if (piece in modifiers) { pieces[i] = modifiers[piece]; }
|
16577 |
+
else { hasCharacter = true; }
|
16578 |
+
if (piece in specialKeys) { pieces[i] = specialKeys[piece]; }
|
16579 |
+
}
|
16580 |
+
if (!hasCharacter) {
|
16581 |
+
// Vim does not support modifier only keys.
|
16582 |
+
return false;
|
16583 |
+
}
|
16584 |
+
// TODO: Current bindings expect the character to be lower case, but
|
16585 |
+
// it looks like vim key notation uses upper case.
|
16586 |
+
if (isUpperCase(lastPiece)) {
|
16587 |
+
pieces[pieces.length - 1] = lastPiece.toLowerCase();
|
16588 |
+
}
|
16589 |
+
return '<' + pieces.join('-') + '>';
|
16590 |
+
}
|
16591 |
+
|
16592 |
+
function getOnPasteFn(cm) {
|
16593 |
+
var vim = cm.state.vim;
|
16594 |
+
if (!vim.onPasteFn) {
|
16595 |
+
vim.onPasteFn = function() {
|
16596 |
+
if (!vim.insertMode) {
|
16597 |
+
cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));
|
16598 |
+
actions.enterInsertMode(cm, {}, vim);
|
16599 |
+
}
|
16600 |
+
};
|
16601 |
+
}
|
16602 |
+
return vim.onPasteFn;
|
16603 |
+
}
|
16604 |
+
|
16605 |
+
var numberRegex = /[\d]/;
|
16606 |
+
var wordCharTest = [CodeMirror.isWordChar, function(ch) {
|
16607 |
+
return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch);
|
16608 |
+
}], bigWordCharTest = [function(ch) {
|
16609 |
+
return /\S/.test(ch);
|
16610 |
+
}];
|
16611 |
+
function makeKeyRange(start, size) {
|
16612 |
+
var keys = [];
|
16613 |
+
for (var i = start; i < start + size; i++) {
|
16614 |
+
keys.push(String.fromCharCode(i));
|
16615 |
+
}
|
16616 |
+
return keys;
|
16617 |
+
}
|
16618 |
+
var upperCaseAlphabet = makeKeyRange(65, 26);
|
16619 |
+
var lowerCaseAlphabet = makeKeyRange(97, 26);
|
16620 |
+
var numbers = makeKeyRange(48, 10);
|
16621 |
+
var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
|
16622 |
+
var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']);
|
16623 |
+
|
16624 |
+
function isLine(cm, line) {
|
16625 |
+
return line >= cm.firstLine() && line <= cm.lastLine();
|
16626 |
+
}
|
16627 |
+
function isLowerCase(k) {
|
16628 |
+
return (/^[a-z]$/).test(k);
|
16629 |
+
}
|
16630 |
+
function isMatchableSymbol(k) {
|
16631 |
+
return '()[]{}'.indexOf(k) != -1;
|
16632 |
+
}
|
16633 |
+
function isNumber(k) {
|
16634 |
+
return numberRegex.test(k);
|
16635 |
+
}
|
16636 |
+
function isUpperCase(k) {
|
16637 |
+
return (/^[A-Z]$/).test(k);
|
16638 |
+
}
|
16639 |
+
function isWhiteSpaceString(k) {
|
16640 |
+
return (/^\s*$/).test(k);
|
16641 |
+
}
|
16642 |
+
function inArray(val, arr) {
|
16643 |
+
for (var i = 0; i < arr.length; i++) {
|
16644 |
+
if (arr[i] == val) {
|
16645 |
+
return true;
|
16646 |
+
}
|
16647 |
+
}
|
16648 |
+
return false;
|
16649 |
+
}
|
16650 |
+
|
16651 |
+
var options = {};
|
16652 |
+
function defineOption(name, defaultValue, type, aliases, callback) {
|
16653 |
+
if (defaultValue === undefined && !callback) {
|
16654 |
+
throw Error('defaultValue is required unless callback is provided');
|
16655 |
+
}
|
16656 |
+
if (!type) { type = 'string'; }
|
16657 |
+
options[name] = {
|
16658 |
+
type: type,
|
16659 |
+
defaultValue: defaultValue,
|
16660 |
+
callback: callback
|
16661 |
+
};
|
16662 |
+
if (aliases) {
|
16663 |
+
for (var i = 0; i < aliases.length; i++) {
|
16664 |
+
options[aliases[i]] = options[name];
|
16665 |
+
}
|
16666 |
+
}
|
16667 |
+
if (defaultValue) {
|
16668 |
+
setOption(name, defaultValue);
|
16669 |
+
}
|
16670 |
+
}
|
16671 |
+
|
16672 |
+
function setOption(name, value, cm, cfg) {
|
16673 |
+
var option = options[name];
|
16674 |
+
cfg = cfg || {};
|
16675 |
+
var scope = cfg.scope;
|
16676 |
+
if (!option) {
|
16677 |
+
throw Error('Unknown option: ' + name);
|
16678 |
+
}
|
16679 |
+
if (option.type == 'boolean') {
|
16680 |
+
if (value && value !== true) {
|
16681 |
+
throw Error('Invalid argument: ' + name + '=' + value);
|
16682 |
+
} else if (value !== false) {
|
16683 |
+
// Boolean options are set to true if value is not defined.
|
16684 |
+
value = true;
|
16685 |
+
}
|
16686 |
+
}
|
16687 |
+
if (option.callback) {
|
16688 |
+
if (scope !== 'local') {
|
16689 |
+
option.callback(value, undefined);
|
16690 |
+
}
|
16691 |
+
if (scope !== 'global' && cm) {
|
16692 |
+
option.callback(value, cm);
|
16693 |
+
}
|
16694 |
+
} else {
|
16695 |
+
if (scope !== 'local') {
|
16696 |
+
option.value = option.type == 'boolean' ? !!value : value;
|
16697 |
+
}
|
16698 |
+
if (scope !== 'global' && cm) {
|
16699 |
+
cm.state.vim.options[name] = {value: value};
|
16700 |
+
}
|
16701 |
+
}
|
16702 |
+
}
|
16703 |
+
|
16704 |
+
function getOption(name, cm, cfg) {
|
16705 |
+
var option = options[name];
|
16706 |
+
cfg = cfg || {};
|
16707 |
+
var scope = cfg.scope;
|
16708 |
+
if (!option) {
|
16709 |
+
throw Error('Unknown option: ' + name);
|
16710 |
+
}
|
16711 |
+
if (option.callback) {
|
16712 |
+
var local = cm && option.callback(undefined, cm);
|
16713 |
+
if (scope !== 'global' && local !== undefined) {
|
16714 |
+
return local;
|
16715 |
+
}
|
16716 |
+
if (scope !== 'local') {
|
16717 |
+
return option.callback();
|
16718 |
+
}
|
16719 |
+
return;
|
16720 |
+
} else {
|
16721 |
+
var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);
|
16722 |
+
return (local || (scope !== 'local') && option || {}).value;
|
16723 |
+
}
|
16724 |
+
}
|
16725 |
+
|
16726 |
+
defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) {
|
16727 |
+
// Option is local. Do nothing for global.
|
16728 |
+
if (cm === undefined) {
|
16729 |
+
return;
|
16730 |
+
}
|
16731 |
+
// The 'filetype' option proxies to the CodeMirror 'mode' option.
|
16732 |
+
if (name === undefined) {
|
16733 |
+
var mode = cm.getOption('mode');
|
16734 |
+
return mode == 'null' ? '' : mode;
|
16735 |
+
} else {
|
16736 |
+
var mode = name == '' ? 'null' : name;
|
16737 |
+
cm.setOption('mode', mode);
|
16738 |
+
}
|
16739 |
+
});
|
16740 |
+
|
16741 |
+
var createCircularJumpList = function() {
|
16742 |
+
var size = 100;
|
16743 |
+
var pointer = -1;
|
16744 |
+
var head = 0;
|
16745 |
+
var tail = 0;
|
16746 |
+
var buffer = new Array(size);
|
16747 |
+
function add(cm, oldCur, newCur) {
|
16748 |
+
var current = pointer % size;
|
16749 |
+
var curMark = buffer[current];
|
16750 |
+
function useNextSlot(cursor) {
|
16751 |
+
var next = ++pointer % size;
|
16752 |
+
var trashMark = buffer[next];
|
16753 |
+
if (trashMark) {
|
16754 |
+
trashMark.clear();
|
16755 |
+
}
|
16756 |
+
buffer[next] = cm.setBookmark(cursor);
|
16757 |
+
}
|
16758 |
+
if (curMark) {
|
16759 |
+
var markPos = curMark.find();
|
16760 |
+
// avoid recording redundant cursor position
|
16761 |
+
if (markPos && !cursorEqual(markPos, oldCur)) {
|
16762 |
+
useNextSlot(oldCur);
|
16763 |
+
}
|
16764 |
+
} else {
|
16765 |
+
useNextSlot(oldCur);
|
16766 |
+
}
|
16767 |
+
useNextSlot(newCur);
|
16768 |
+
head = pointer;
|
16769 |
+
tail = pointer - size + 1;
|
16770 |
+
if (tail < 0) {
|
16771 |
+
tail = 0;
|
16772 |
+
}
|
16773 |
+
}
|
16774 |
+
function move(cm, offset) {
|
16775 |
+
pointer += offset;
|
16776 |
+
if (pointer > head) {
|
16777 |
+
pointer = head;
|
16778 |
+
} else if (pointer < tail) {
|
16779 |
+
pointer = tail;
|
16780 |
+
}
|
16781 |
+
var mark = buffer[(size + pointer) % size];
|
16782 |
+
// skip marks that are temporarily removed from text buffer
|
16783 |
+
if (mark && !mark.find()) {
|
16784 |
+
var inc = offset > 0 ? 1 : -1;
|
16785 |
+
var newCur;
|
16786 |
+
var oldCur = cm.getCursor();
|
16787 |
+
do {
|
16788 |
+
pointer += inc;
|
16789 |
+
mark = buffer[(size + pointer) % size];
|
16790 |
+
// skip marks that are the same as current position
|
16791 |
+
if (mark &&
|
16792 |
+
(newCur = mark.find()) &&
|
16793 |
+
!cursorEqual(oldCur, newCur)) {
|
16794 |
+
break;
|
16795 |
+
}
|
16796 |
+
} while (pointer < head && pointer > tail);
|
16797 |
+
}
|
16798 |
+
return mark;
|
16799 |
+
}
|
16800 |
+
return {
|
16801 |
+
cachedCursor: undefined, //used for # and * jumps
|
16802 |
+
add: add,
|
16803 |
+
move: move
|
16804 |
+
};
|
16805 |
+
};
|
16806 |
+
|
16807 |
+
// Returns an object to track the changes associated insert mode. It
|
16808 |
+
// clones the object that is passed in, or creates an empty object one if
|
16809 |
+
// none is provided.
|
16810 |
+
var createInsertModeChanges = function(c) {
|
16811 |
+
if (c) {
|
16812 |
+
// Copy construction
|
16813 |
+
return {
|
16814 |
+
changes: c.changes,
|
16815 |
+
expectCursorActivityForChange: c.expectCursorActivityForChange
|
16816 |
+
};
|
16817 |
+
}
|
16818 |
+
return {
|
16819 |
+
// Change list
|
16820 |
+
changes: [],
|
16821 |
+
// Set to true on change, false on cursorActivity.
|
16822 |
+
expectCursorActivityForChange: false
|
16823 |
+
};
|
16824 |
+
};
|
16825 |
+
|
16826 |
+
function MacroModeState() {
|
16827 |
+
this.latestRegister = undefined;
|
16828 |
+
this.isPlaying = false;
|
16829 |
+
this.isRecording = false;
|
16830 |
+
this.replaySearchQueries = [];
|
16831 |
+
this.onRecordingDone = undefined;
|
16832 |
+
this.lastInsertModeChanges = createInsertModeChanges();
|
16833 |
+
}
|
16834 |
+
MacroModeState.prototype = {
|
16835 |
+
exitMacroRecordMode: function() {
|
16836 |
+
var macroModeState = vimGlobalState.macroModeState;
|
16837 |
+
if (macroModeState.onRecordingDone) {
|
16838 |
+
macroModeState.onRecordingDone(); // close dialog
|
16839 |
+
}
|
16840 |
+
macroModeState.onRecordingDone = undefined;
|
16841 |
+
macroModeState.isRecording = false;
|
16842 |
+
},
|
16843 |
+
enterMacroRecordMode: function(cm, registerName) {
|
16844 |
+
var register =
|
16845 |
+
vimGlobalState.registerController.getRegister(registerName);
|
16846 |
+
if (register) {
|
16847 |
+
register.clear();
|
16848 |
+
this.latestRegister = registerName;
|
16849 |
+
if (cm.openDialog) {
|
16850 |
+
this.onRecordingDone = cm.openDialog(
|
16851 |
+
'(recording)['+registerName+']', null, {bottom:true});
|
16852 |
+
}
|
16853 |
+
this.isRecording = true;
|
16854 |
+
}
|
16855 |
+
}
|
16856 |
+
};
|
16857 |
+
|
16858 |
+
function maybeInitVimState(cm) {
|
16859 |
+
if (!cm.state.vim) {
|
16860 |
+
// Store instance state in the CodeMirror object.
|
16861 |
+
cm.state.vim = {
|
16862 |
+
inputState: new InputState(),
|
16863 |
+
// Vim's input state that triggered the last edit, used to repeat
|
16864 |
+
// motions and operators with '.'.
|
16865 |
+
lastEditInputState: undefined,
|
16866 |
+
// Vim's action command before the last edit, used to repeat actions
|
16867 |
+
// with '.' and insert mode repeat.
|
16868 |
+
lastEditActionCommand: undefined,
|
16869 |
+
// When using jk for navigation, if you move from a longer line to a
|
16870 |
+
// shorter line, the cursor may clip to the end of the shorter line.
|
16871 |
+
// If j is pressed again and cursor goes to the next line, the
|
16872 |
+
// cursor should go back to its horizontal position on the longer
|
16873 |
+
// line if it can. This is to keep track of the horizontal position.
|
16874 |
+
lastHPos: -1,
|
16875 |
+
// Doing the same with screen-position for gj/gk
|
16876 |
+
lastHSPos: -1,
|
16877 |
+
// The last motion command run. Cleared if a non-motion command gets
|
16878 |
+
// executed in between.
|
16879 |
+
lastMotion: null,
|
16880 |
+
marks: {},
|
16881 |
+
// Mark for rendering fake cursor for visual mode.
|
16882 |
+
fakeCursor: null,
|
16883 |
+
insertMode: false,
|
16884 |
+
// Repeat count for changes made in insert mode, triggered by key
|
16885 |
+
// sequences like 3,i. Only exists when insertMode is true.
|
16886 |
+
insertModeRepeat: undefined,
|
16887 |
+
visualMode: false,
|
16888 |
+
// If we are in visual line mode. No effect if visualMode is false.
|
16889 |
+
visualLine: false,
|
16890 |
+
visualBlock: false,
|
16891 |
+
lastSelection: null,
|
16892 |
+
lastPastedText: null,
|
16893 |
+
sel: {},
|
16894 |
+
// Buffer-local/window-local values of vim options.
|
16895 |
+
options: {}
|
16896 |
+
};
|
16897 |
+
}
|
16898 |
+
return cm.state.vim;
|
16899 |
+
}
|
16900 |
+
var vimGlobalState;
|
16901 |
+
function resetVimGlobalState() {
|
16902 |
+
vimGlobalState = {
|
16903 |
+
// The current search query.
|
16904 |
+
searchQuery: null,
|
16905 |
+
// Whether we are searching backwards.
|
16906 |
+
searchIsReversed: false,
|
16907 |
+
// Replace part of the last substituted pattern
|
16908 |
+
lastSubstituteReplacePart: undefined,
|
16909 |
+
jumpList: createCircularJumpList(),
|
16910 |
+
macroModeState: new MacroModeState,
|
16911 |
+
// Recording latest f, t, F or T motion command.
|
16912 |
+
lastCharacterSearch: {increment:0, forward:true, selectedCharacter:''},
|
16913 |
+
registerController: new RegisterController({}),
|
16914 |
+
// search history buffer
|
16915 |
+
searchHistoryController: new HistoryController({}),
|
16916 |
+
// ex Command history buffer
|
16917 |
+
exCommandHistoryController : new HistoryController({})
|
16918 |
+
};
|
16919 |
+
for (var optionName in options) {
|
16920 |
+
var option = options[optionName];
|
16921 |
+
option.value = option.defaultValue;
|
16922 |
+
}
|
16923 |
+
}
|
16924 |
+
|
16925 |
+
var lastInsertModeKeyTimer;
|
16926 |
+
var vimApi= {
|
16927 |
+
buildKeyMap: function() {
|
16928 |
+
// TODO: Convert keymap into dictionary format for fast lookup.
|
16929 |
+
},
|
16930 |
+
// Testing hook, though it might be useful to expose the register
|
16931 |
+
// controller anyways.
|
16932 |
+
getRegisterController: function() {
|
16933 |
+
return vimGlobalState.registerController;
|
16934 |
+
},
|
16935 |
+
// Testing hook.
|
16936 |
+
resetVimGlobalState_: resetVimGlobalState,
|
16937 |
+
|
16938 |
+
// Testing hook.
|
16939 |
+
getVimGlobalState_: function() {
|
16940 |
+
return vimGlobalState;
|
16941 |
+
},
|
16942 |
+
|
16943 |
+
// Testing hook.
|
16944 |
+
maybeInitVimState_: maybeInitVimState,
|
16945 |
+
|
16946 |
+
suppressErrorLogging: false,
|
16947 |
+
|
16948 |
+
InsertModeKey: InsertModeKey,
|
16949 |
+
map: function(lhs, rhs, ctx) {
|
16950 |
+
// Add user defined key bindings.
|
16951 |
+
exCommandDispatcher.map(lhs, rhs, ctx);
|
16952 |
+
},
|
16953 |
+
unmap: function(lhs, ctx) {
|
16954 |
+
exCommandDispatcher.unmap(lhs, ctx);
|
16955 |
+
},
|
16956 |
+
// TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace
|
16957 |
+
// them, or somehow make them work with the existing CodeMirror setOption/getOption API.
|
16958 |
+
setOption: setOption,
|
16959 |
+
getOption: getOption,
|
16960 |
+
defineOption: defineOption,
|
16961 |
+
defineEx: function(name, prefix, func){
|
16962 |
+
if (!prefix) {
|
16963 |
+
prefix = name;
|
16964 |
+
} else if (name.indexOf(prefix) !== 0) {
|
16965 |
+
throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered');
|
16966 |
+
}
|
16967 |
+
exCommands[name]=func;
|
16968 |
+
exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'};
|
16969 |
+
},
|
16970 |
+
handleKey: function (cm, key, origin) {
|
16971 |
+
var command = this.findKey(cm, key, origin);
|
16972 |
+
if (typeof command === 'function') {
|
16973 |
+
return command();
|
16974 |
+
}
|
16975 |
+
},
|
16976 |
+
/**
|
16977 |
+
* This is the outermost function called by CodeMirror, after keys have
|
16978 |
+
* been mapped to their Vim equivalents.
|
16979 |
+
*
|
16980 |
+
* Finds a command based on the key (and cached keys if there is a
|
16981 |
+
* multi-key sequence). Returns `undefined` if no key is matched, a noop
|
16982 |
+
* function if a partial match is found (multi-key), and a function to
|
16983 |
+
* execute the bound command if a a key is matched. The function always
|
16984 |
+
* returns true.
|
16985 |
+
*/
|
16986 |
+
findKey: function(cm, key, origin) {
|
16987 |
+
var vim = maybeInitVimState(cm);
|
16988 |
+
function handleMacroRecording() {
|
16989 |
+
var macroModeState = vimGlobalState.macroModeState;
|
16990 |
+
if (macroModeState.isRecording) {
|
16991 |
+
if (key == 'q') {
|
16992 |
+
macroModeState.exitMacroRecordMode();
|
16993 |
+
clearInputState(cm);
|
16994 |
+
return true;
|
16995 |
+
}
|
16996 |
+
if (origin != 'mapping') {
|
16997 |
+
logKey(macroModeState, key);
|
16998 |
+
}
|
16999 |
+
}
|
17000 |
+
}
|
17001 |
+
function handleEsc() {
|
17002 |
+
if (key == '<Esc>') {
|
17003 |
+
// Clear input state and get back to normal mode.
|
17004 |
+
clearInputState(cm);
|
17005 |
+
if (vim.visualMode) {
|
17006 |
+
exitVisualMode(cm);
|
17007 |
+
} else if (vim.insertMode) {
|
17008 |
+
exitInsertMode(cm);
|
17009 |
+
}
|
17010 |
+
return true;
|
17011 |
+
}
|
17012 |
+
}
|
17013 |
+
function doKeyToKey(keys) {
|
17014 |
+
// TODO: prevent infinite recursion.
|
17015 |
+
var match;
|
17016 |
+
while (keys) {
|
17017 |
+
// Pull off one command key, which is either a single character
|
17018 |
+
// or a special sequence wrapped in '<' and '>', e.g. '<Space>'.
|
17019 |
+
match = (/<\w+-.+?>|<\w+>|./).exec(keys);
|
17020 |
+
key = match[0];
|
17021 |
+
keys = keys.substring(match.index + key.length);
|
17022 |
+
CodeMirror.Vim.handleKey(cm, key, 'mapping');
|
17023 |
+
}
|
17024 |
+
}
|
17025 |
+
|
17026 |
+
function handleKeyInsertMode() {
|
17027 |
+
if (handleEsc()) { return true; }
|
17028 |
+
var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
|
17029 |
+
var keysAreChars = key.length == 1;
|
17030 |
+
var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');
|
17031 |
+
// Need to check all key substrings in insert mode.
|
17032 |
+
while (keys.length > 1 && match.type != 'full') {
|
17033 |
+
var keys = vim.inputState.keyBuffer = keys.slice(1);
|
17034 |
+
var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');
|
17035 |
+
if (thisMatch.type != 'none') { match = thisMatch; }
|
17036 |
+
}
|
17037 |
+
if (match.type == 'none') { clearInputState(cm); return false; }
|
17038 |
+
else if (match.type == 'partial') {
|
17039 |
+
if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); }
|
17040 |
+
lastInsertModeKeyTimer = window.setTimeout(
|
17041 |
+
function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } },
|
17042 |
+
getOption('insertModeEscKeysTimeout'));
|
17043 |
+
return !keysAreChars;
|
17044 |
+
}
|
17045 |
+
|
17046 |
+
if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); }
|
17047 |
+
if (keysAreChars) {
|
17048 |
+
var selections = cm.listSelections();
|
17049 |
+
for (var i = 0; i < selections.length; i++) {
|
17050 |
+
var here = selections[i].head;
|
17051 |
+
cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input');
|
17052 |
+
}
|
17053 |
+
vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop();
|
17054 |
+
}
|
17055 |
+
clearInputState(cm);
|
17056 |
+
return match.command;
|
17057 |
+
}
|
17058 |
+
|
17059 |
+
function handleKeyNonInsertMode() {
|
17060 |
+
if (handleMacroRecording() || handleEsc()) { return true; };
|
17061 |
+
|
17062 |
+
var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
|
17063 |
+
if (/^[1-9]\d*$/.test(keys)) { return true; }
|
17064 |
+
|
17065 |
+
var keysMatcher = /^(\d*)(.*)$/.exec(keys);
|
17066 |
+
if (!keysMatcher) { clearInputState(cm); return false; }
|
17067 |
+
var context = vim.visualMode ? 'visual' :
|
17068 |
+
'normal';
|
17069 |
+
var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context);
|
17070 |
+
if (match.type == 'none') { clearInputState(cm); return false; }
|
17071 |
+
else if (match.type == 'partial') { return true; }
|
17072 |
+
|
17073 |
+
vim.inputState.keyBuffer = '';
|
17074 |
+
var keysMatcher = /^(\d*)(.*)$/.exec(keys);
|
17075 |
+
if (keysMatcher[1] && keysMatcher[1] != '0') {
|
17076 |
+
vim.inputState.pushRepeatDigit(keysMatcher[1]);
|
17077 |
+
}
|
17078 |
+
return match.command;
|
17079 |
+
}
|
17080 |
+
|
17081 |
+
var command;
|
17082 |
+
if (vim.insertMode) { command = handleKeyInsertMode(); }
|
17083 |
+
else { command = handleKeyNonInsertMode(); }
|
17084 |
+
if (command === false) {
|
17085 |
+
return undefined;
|
17086 |
+
} else if (command === true) {
|
17087 |
+
// TODO: Look into using CodeMirror's multi-key handling.
|
17088 |
+
// Return no-op since we are caching the key. Counts as handled, but
|
17089 |
+
// don't want act on it just yet.
|
17090 |
+
return function() { return true; };
|
17091 |
+
} else {
|
17092 |
+
return function() {
|
17093 |
+
return cm.operation(function() {
|
17094 |
+
cm.curOp.isVimOp = true;
|
17095 |
+
try {
|
17096 |
+
if (command.type == 'keyToKey') {
|
17097 |
+
doKeyToKey(command.toKeys);
|
17098 |
+
} else {
|
17099 |
+
commandDispatcher.processCommand(cm, vim, command);
|
17100 |
+
}
|
17101 |
+
} catch (e) {
|
17102 |
+
// clear VIM state in case it's in a bad state.
|
17103 |
+
cm.state.vim = undefined;
|
17104 |
+
maybeInitVimState(cm);
|
17105 |
+
if (!CodeMirror.Vim.suppressErrorLogging) {
|
17106 |
+
console['log'](e);
|
17107 |
+
}
|
17108 |
+
throw e;
|
17109 |
+
}
|
17110 |
+
return true;
|
17111 |
+
});
|
17112 |
+
};
|
17113 |
+
}
|
17114 |
+
},
|
17115 |
+
handleEx: function(cm, input) {
|
17116 |
+
exCommandDispatcher.processCommand(cm, input);
|
17117 |
+
},
|
17118 |
+
|
17119 |
+
defineMotion: defineMotion,
|
17120 |
+
defineAction: defineAction,
|
17121 |
+
defineOperator: defineOperator,
|
17122 |
+
mapCommand: mapCommand,
|
17123 |
+
_mapCommand: _mapCommand,
|
17124 |
+
|
17125 |
+
defineRegister: defineRegister,
|
17126 |
+
|
17127 |
+
exitVisualMode: exitVisualMode,
|
17128 |
+
exitInsertMode: exitInsertMode
|
17129 |
+
};
|
17130 |
+
|
17131 |
+
// Represents the current input state.
|
17132 |
+
function InputState() {
|
17133 |
+
this.prefixRepeat = [];
|
17134 |
+
this.motionRepeat = [];
|
17135 |
+
|
17136 |
+
this.operator = null;
|
17137 |
+
this.operatorArgs = null;
|
17138 |
+
this.motion = null;
|
17139 |
+
this.motionArgs = null;
|
17140 |
+
this.keyBuffer = []; // For matching multi-key commands.
|
17141 |
+
this.registerName = null; // Defaults to the unnamed register.
|
17142 |
+
}
|
17143 |
+
InputState.prototype.pushRepeatDigit = function(n) {
|
17144 |
+
if (!this.operator) {
|
17145 |
+
this.prefixRepeat = this.prefixRepeat.concat(n);
|
17146 |
+
} else {
|
17147 |
+
this.motionRepeat = this.motionRepeat.concat(n);
|
17148 |
+
}
|
17149 |
+
};
|
17150 |
+
InputState.prototype.getRepeat = function() {
|
17151 |
+
var repeat = 0;
|
17152 |
+
if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {
|
17153 |
+
repeat = 1;
|
17154 |
+
if (this.prefixRepeat.length > 0) {
|
17155 |
+
repeat *= parseInt(this.prefixRepeat.join(''), 10);
|
17156 |
+
}
|
17157 |
+
if (this.motionRepeat.length > 0) {
|
17158 |
+
repeat *= parseInt(this.motionRepeat.join(''), 10);
|
17159 |
+
}
|
17160 |
+
}
|
17161 |
+
return repeat;
|
17162 |
+
};
|
17163 |
+
|
17164 |
+
function clearInputState(cm, reason) {
|
17165 |
+
cm.state.vim.inputState = new InputState();
|
17166 |
+
CodeMirror.signal(cm, 'vim-command-done', reason);
|
17167 |
+
}
|
17168 |
+
|
17169 |
+
/*
|
17170 |
+
* Register stores information about copy and paste registers. Besides
|
17171 |
+
* text, a register must store whether it is linewise (i.e., when it is
|
17172 |
+
* pasted, should it insert itself into a new line, or should the text be
|
17173 |
+
* inserted at the cursor position.)
|
17174 |
+
*/
|
17175 |
+
function Register(text, linewise, blockwise) {
|
17176 |
+
this.clear();
|
17177 |
+
this.keyBuffer = [text || ''];
|
17178 |
+
this.insertModeChanges = [];
|
17179 |
+
this.searchQueries = [];
|
17180 |
+
this.linewise = !!linewise;
|
17181 |
+
this.blockwise = !!blockwise;
|
17182 |
+
}
|
17183 |
+
Register.prototype = {
|
17184 |
+
setText: function(text, linewise, blockwise) {
|
17185 |
+
this.keyBuffer = [text || ''];
|
17186 |
+
this.linewise = !!linewise;
|
17187 |
+
this.blockwise = !!blockwise;
|
17188 |
+
},
|
17189 |
+
pushText: function(text, linewise) {
|
17190 |
+
// if this register has ever been set to linewise, use linewise.
|
17191 |
+
if (linewise) {
|
17192 |
+
if (!this.linewise) {
|
17193 |
+
this.keyBuffer.push('\n');
|
17194 |
+
}
|
17195 |
+
this.linewise = true;
|
17196 |
+
}
|
17197 |
+
this.keyBuffer.push(text);
|
17198 |
+
},
|
17199 |
+
pushInsertModeChanges: function(changes) {
|
17200 |
+
this.insertModeChanges.push(createInsertModeChanges(changes));
|
17201 |
+
},
|
17202 |
+
pushSearchQuery: function(query) {
|
17203 |
+
this.searchQueries.push(query);
|
17204 |
+
},
|
17205 |
+
clear: function() {
|
17206 |
+
this.keyBuffer = [];
|
17207 |
+
this.insertModeChanges = [];
|
17208 |
+
this.searchQueries = [];
|
17209 |
+
this.linewise = false;
|
17210 |
+
},
|
17211 |
+
toString: function() {
|
17212 |
+
return this.keyBuffer.join('');
|
17213 |
+
}
|
17214 |
+
};
|
17215 |
+
|
17216 |
+
/**
|
17217 |
+
* Defines an external register.
|
17218 |
+
*
|
17219 |
+
* The name should be a single character that will be used to reference the register.
|
17220 |
+
* The register should support setText, pushText, clear, and toString(). See Register
|
17221 |
+
* for a reference implementation.
|
17222 |
+
*/
|
17223 |
+
function defineRegister(name, register) {
|
17224 |
+
var registers = vimGlobalState.registerController.registers[name];
|
17225 |
+
if (!name || name.length != 1) {
|
17226 |
+
throw Error('Register name must be 1 character');
|
17227 |
+
}
|
17228 |
+
if (registers[name]) {
|
17229 |
+
throw Error('Register already defined ' + name);
|
17230 |
+
}
|
17231 |
+
registers[name] = register;
|
17232 |
+
validRegisters.push(name);
|
17233 |
+
}
|
17234 |
+
|
17235 |
+
/*
|
17236 |
+
* vim registers allow you to keep many independent copy and paste buffers.
|
17237 |
+
* See http://usevim.com/2012/04/13/registers/ for an introduction.
|
17238 |
+
*
|
17239 |
+
* RegisterController keeps the state of all the registers. An initial
|
17240 |
+
* state may be passed in. The unnamed register '"' will always be
|
17241 |
+
* overridden.
|
17242 |
+
*/
|
17243 |
+
function RegisterController(registers) {
|
17244 |
+
this.registers = registers;
|
17245 |
+
this.unnamedRegister = registers['"'] = new Register();
|
17246 |
+
registers['.'] = new Register();
|
17247 |
+
registers[':'] = new Register();
|
17248 |
+
registers['/'] = new Register();
|
17249 |
+
}
|
17250 |
+
RegisterController.prototype = {
|
17251 |
+
pushText: function(registerName, operator, text, linewise, blockwise) {
|
17252 |
+
if (linewise && text.charAt(0) == '\n') {
|
17253 |
+
text = text.slice(1) + '\n';
|
17254 |
+
}
|
17255 |
+
if (linewise && text.charAt(text.length - 1) !== '\n'){
|
17256 |
+
text += '\n';
|
17257 |
+
}
|
17258 |
+
// Lowercase and uppercase registers refer to the same register.
|
17259 |
+
// Uppercase just means append.
|
17260 |
+
var register = this.isValidRegister(registerName) ?
|
17261 |
+
this.getRegister(registerName) : null;
|
17262 |
+
// if no register/an invalid register was specified, things go to the
|
17263 |
+
// default registers
|
17264 |
+
if (!register) {
|
17265 |
+
switch (operator) {
|
17266 |
+
case 'yank':
|
17267 |
+
// The 0 register contains the text from the most recent yank.
|
17268 |
+
this.registers['0'] = new Register(text, linewise, blockwise);
|
17269 |
+
break;
|
17270 |
+
case 'delete':
|
17271 |
+
case 'change':
|
17272 |
+
if (text.indexOf('\n') == -1) {
|
17273 |
+
// Delete less than 1 line. Update the small delete register.
|
17274 |
+
this.registers['-'] = new Register(text, linewise);
|
17275 |
+
} else {
|
17276 |
+
// Shift down the contents of the numbered registers and put the
|
17277 |
+
// deleted text into register 1.
|
17278 |
+
this.shiftNumericRegisters_();
|
17279 |
+
this.registers['1'] = new Register(text, linewise);
|
17280 |
+
}
|
17281 |
+
break;
|
17282 |
+
}
|
17283 |
+
// Make sure the unnamed register is set to what just happened
|
17284 |
+
this.unnamedRegister.setText(text, linewise, blockwise);
|
17285 |
+
return;
|
17286 |
+
}
|
17287 |
+
|
17288 |
+
// If we've gotten to this point, we've actually specified a register
|
17289 |
+
var append = isUpperCase(registerName);
|
17290 |
+
if (append) {
|
17291 |
+
register.pushText(text, linewise);
|
17292 |
+
} else {
|
17293 |
+
register.setText(text, linewise, blockwise);
|
17294 |
+
}
|
17295 |
+
// The unnamed register always has the same value as the last used
|
17296 |
+
// register.
|
17297 |
+
this.unnamedRegister.setText(register.toString(), linewise);
|
17298 |
+
},
|
17299 |
+
// Gets the register named @name. If one of @name doesn't already exist,
|
17300 |
+
// create it. If @name is invalid, return the unnamedRegister.
|
17301 |
+
getRegister: function(name) {
|
17302 |
+
if (!this.isValidRegister(name)) {
|
17303 |
+
return this.unnamedRegister;
|
17304 |
+
}
|
17305 |
+
name = name.toLowerCase();
|
17306 |
+
if (!this.registers[name]) {
|
17307 |
+
this.registers[name] = new Register();
|
17308 |
+
}
|
17309 |
+
return this.registers[name];
|
17310 |
+
},
|
17311 |
+
isValidRegister: function(name) {
|
17312 |
+
return name && inArray(name, validRegisters);
|
17313 |
+
},
|
17314 |
+
shiftNumericRegisters_: function() {
|
17315 |
+
for (var i = 9; i >= 2; i--) {
|
17316 |
+
this.registers[i] = this.getRegister('' + (i - 1));
|
17317 |
+
}
|
17318 |
+
}
|
17319 |
+
};
|
17320 |
+
function HistoryController() {
|
17321 |
+
this.historyBuffer = [];
|
17322 |
+
this.iterator = 0;
|
17323 |
+
this.initialPrefix = null;
|
17324 |
+
}
|
17325 |
+
HistoryController.prototype = {
|
17326 |
+
// the input argument here acts a user entered prefix for a small time
|
17327 |
+
// until we start autocompletion in which case it is the autocompleted.
|
17328 |
+
nextMatch: function (input, up) {
|
17329 |
+
var historyBuffer = this.historyBuffer;
|
17330 |
+
var dir = up ? -1 : 1;
|
17331 |
+
if (this.initialPrefix === null) this.initialPrefix = input;
|
17332 |
+
for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) {
|
17333 |
+
var element = historyBuffer[i];
|
17334 |
+
for (var j = 0; j <= element.length; j++) {
|
17335 |
+
if (this.initialPrefix == element.substring(0, j)) {
|
17336 |
+
this.iterator = i;
|
17337 |
+
return element;
|
17338 |
+
}
|
17339 |
+
}
|
17340 |
+
}
|
17341 |
+
// should return the user input in case we reach the end of buffer.
|
17342 |
+
if (i >= historyBuffer.length) {
|
17343 |
+
this.iterator = historyBuffer.length;
|
17344 |
+
return this.initialPrefix;
|
17345 |
+
}
|
17346 |
+
// return the last autocompleted query or exCommand as it is.
|
17347 |
+
if (i < 0 ) return input;
|
17348 |
+
},
|
17349 |
+
pushInput: function(input) {
|
17350 |
+
var index = this.historyBuffer.indexOf(input);
|
17351 |
+
if (index > -1) this.historyBuffer.splice(index, 1);
|
17352 |
+
if (input.length) this.historyBuffer.push(input);
|
17353 |
+
},
|
17354 |
+
reset: function() {
|
17355 |
+
this.initialPrefix = null;
|
17356 |
+
this.iterator = this.historyBuffer.length;
|
17357 |
+
}
|
17358 |
+
};
|
17359 |
+
var commandDispatcher = {
|
17360 |
+
matchCommand: function(keys, keyMap, inputState, context) {
|
17361 |
+
var matches = commandMatches(keys, keyMap, context, inputState);
|
17362 |
+
if (!matches.full && !matches.partial) {
|
17363 |
+
return {type: 'none'};
|
17364 |
+
} else if (!matches.full && matches.partial) {
|
17365 |
+
return {type: 'partial'};
|
17366 |
+
}
|
17367 |
+
|
17368 |
+
var bestMatch;
|
17369 |
+
for (var i = 0; i < matches.full.length; i++) {
|
17370 |
+
var match = matches.full[i];
|
17371 |
+
if (!bestMatch) {
|
17372 |
+
bestMatch = match;
|
17373 |
+
}
|
17374 |
+
}
|
17375 |
+
if (bestMatch.keys.slice(-11) == '<character>') {
|
17376 |
+
inputState.selectedCharacter = lastChar(keys);
|
17377 |
+
}
|
17378 |
+
return {type: 'full', command: bestMatch};
|
17379 |
+
},
|
17380 |
+
processCommand: function(cm, vim, command) {
|
17381 |
+
vim.inputState.repeatOverride = command.repeatOverride;
|
17382 |
+
switch (command.type) {
|
17383 |
+
case 'motion':
|
17384 |
+
this.processMotion(cm, vim, command);
|
17385 |
+
break;
|
17386 |
+
case 'operator':
|
17387 |
+
this.processOperator(cm, vim, command);
|
17388 |
+
break;
|
17389 |
+
case 'operatorMotion':
|
17390 |
+
this.processOperatorMotion(cm, vim, command);
|
17391 |
+
break;
|
17392 |
+
case 'action':
|
17393 |
+
this.processAction(cm, vim, command);
|
17394 |
+
break;
|
17395 |
+
case 'search':
|
17396 |
+
this.processSearch(cm, vim, command);
|
17397 |
+
break;
|
17398 |
+
case 'ex':
|
17399 |
+
case 'keyToEx':
|
17400 |
+
this.processEx(cm, vim, command);
|
17401 |
+
break;
|
17402 |
+
default:
|
17403 |
+
break;
|
17404 |
+
}
|
17405 |
+
},
|
17406 |
+
processMotion: function(cm, vim, command) {
|
17407 |
+
vim.inputState.motion = command.motion;
|
17408 |
+
vim.inputState.motionArgs = copyArgs(command.motionArgs);
|
17409 |
+
this.evalInput(cm, vim);
|
17410 |
+
},
|
17411 |
+
processOperator: function(cm, vim, command) {
|
17412 |
+
var inputState = vim.inputState;
|
17413 |
+
if (inputState.operator) {
|
17414 |
+
if (inputState.operator == command.operator) {
|
17415 |
+
// Typing an operator twice like 'dd' makes the operator operate
|
17416 |
+
// linewise
|
17417 |
+
inputState.motion = 'expandToLine';
|
17418 |
+
inputState.motionArgs = { linewise: true };
|
17419 |
+
this.evalInput(cm, vim);
|
17420 |
+
return;
|
17421 |
+
} else {
|
17422 |
+
// 2 different operators in a row doesn't make sense.
|
17423 |
+
clearInputState(cm);
|
17424 |
+
}
|
17425 |
+
}
|
17426 |
+
inputState.operator = command.operator;
|
17427 |
+
inputState.operatorArgs = copyArgs(command.operatorArgs);
|
17428 |
+
if (vim.visualMode) {
|
17429 |
+
// Operating on a selection in visual mode. We don't need a motion.
|
17430 |
+
this.evalInput(cm, vim);
|
17431 |
+
}
|
17432 |
+
},
|
17433 |
+
processOperatorMotion: function(cm, vim, command) {
|
17434 |
+
var visualMode = vim.visualMode;
|
17435 |
+
var operatorMotionArgs = copyArgs(command.operatorMotionArgs);
|
17436 |
+
if (operatorMotionArgs) {
|
17437 |
+
// Operator motions may have special behavior in visual mode.
|
17438 |
+
if (visualMode && operatorMotionArgs.visualLine) {
|
17439 |
+
vim.visualLine = true;
|
17440 |
+
}
|
17441 |
+
}
|
17442 |
+
this.processOperator(cm, vim, command);
|
17443 |
+
if (!visualMode) {
|
17444 |
+
this.processMotion(cm, vim, command);
|
17445 |
+
}
|
17446 |
+
},
|
17447 |
+
processAction: function(cm, vim, command) {
|
17448 |
+
var inputState = vim.inputState;
|
17449 |
+
var repeat = inputState.getRepeat();
|
17450 |
+
var repeatIsExplicit = !!repeat;
|
17451 |
+
var actionArgs = copyArgs(command.actionArgs) || {};
|
17452 |
+
if (inputState.selectedCharacter) {
|
17453 |
+
actionArgs.selectedCharacter = inputState.selectedCharacter;
|
17454 |
+
}
|
17455 |
+
// Actions may or may not have motions and operators. Do these first.
|
17456 |
+
if (command.operator) {
|
17457 |
+
this.processOperator(cm, vim, command);
|
17458 |
+
}
|
17459 |
+
if (command.motion) {
|
17460 |
+
this.processMotion(cm, vim, command);
|
17461 |
+
}
|
17462 |
+
if (command.motion || command.operator) {
|
17463 |
+
this.evalInput(cm, vim);
|
17464 |
+
}
|
17465 |
+
actionArgs.repeat = repeat || 1;
|
17466 |
+
actionArgs.repeatIsExplicit = repeatIsExplicit;
|
17467 |
+
actionArgs.registerName = inputState.registerName;
|
17468 |
+
clearInputState(cm);
|
17469 |
+
vim.lastMotion = null;
|
17470 |
+
if (command.isEdit) {
|
17471 |
+
this.recordLastEdit(vim, inputState, command);
|
17472 |
+
}
|
17473 |
+
actions[command.action](cm, actionArgs, vim);
|
17474 |
+
},
|
17475 |
+
processSearch: function(cm, vim, command) {
|
17476 |
+
if (!cm.getSearchCursor) {
|
17477 |
+
// Search depends on SearchCursor.
|
17478 |
+
return;
|
17479 |
+
}
|
17480 |
+
var forward = command.searchArgs.forward;
|
17481 |
+
var wholeWordOnly = command.searchArgs.wholeWordOnly;
|
17482 |
+
getSearchState(cm).setReversed(!forward);
|
17483 |
+
var promptPrefix = (forward) ? '/' : '?';
|
17484 |
+
var originalQuery = getSearchState(cm).getQuery();
|
17485 |
+
var originalScrollPos = cm.getScrollInfo();
|
17486 |
+
function handleQuery(query, ignoreCase, smartCase) {
|
17487 |
+
vimGlobalState.searchHistoryController.pushInput(query);
|
17488 |
+
vimGlobalState.searchHistoryController.reset();
|
17489 |
+
try {
|
17490 |
+
updateSearchQuery(cm, query, ignoreCase, smartCase);
|
17491 |
+
} catch (e) {
|
17492 |
+
showConfirm(cm, 'Invalid regex: ' + query);
|
17493 |
+
clearInputState(cm);
|
17494 |
+
return;
|
17495 |
+
}
|
17496 |
+
commandDispatcher.processMotion(cm, vim, {
|
17497 |
+
type: 'motion',
|
17498 |
+
motion: 'findNext',
|
17499 |
+
motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }
|
17500 |
+
});
|
17501 |
+
}
|
17502 |
+
function onPromptClose(query) {
|
17503 |
+
cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
|
17504 |
+
handleQuery(query, true /** ignoreCase */, true /** smartCase */);
|
17505 |
+
var macroModeState = vimGlobalState.macroModeState;
|
17506 |
+
if (macroModeState.isRecording) {
|
17507 |
+
logSearchQuery(macroModeState, query);
|
17508 |
+
}
|
17509 |
+
}
|
17510 |
+
function onPromptKeyUp(e, query, close) {
|
17511 |
+
var keyName = CodeMirror.keyName(e), up, offset;
|
17512 |
+
if (keyName == 'Up' || keyName == 'Down') {
|
17513 |
+
up = keyName == 'Up' ? true : false;
|
17514 |
+
offset = e.target ? e.target.selectionEnd : 0;
|
17515 |
+
query = vimGlobalState.searchHistoryController.nextMatch(query, up) || '';
|
17516 |
+
close(query);
|
17517 |
+
if (offset && e.target) e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);
|
17518 |
+
} else {
|
17519 |
+
if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
|
17520 |
+
vimGlobalState.searchHistoryController.reset();
|
17521 |
+
}
|
17522 |
+
var parsedQuery;
|
17523 |
+
try {
|
17524 |
+
parsedQuery = updateSearchQuery(cm, query,
|
17525 |
+
true /** ignoreCase */, true /** smartCase */);
|
17526 |
+
} catch (e) {
|
17527 |
+
// Swallow bad regexes for incremental search.
|
17528 |
+
}
|
17529 |
+
if (parsedQuery) {
|
17530 |
+
cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);
|
17531 |
+
} else {
|
17532 |
+
clearSearchHighlight(cm);
|
17533 |
+
cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
|
17534 |
+
}
|
17535 |
+
}
|
17536 |
+
function onPromptKeyDown(e, query, close) {
|
17537 |
+
var keyName = CodeMirror.keyName(e);
|
17538 |
+
if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||
|
17539 |
+
(keyName == 'Backspace' && query == '')) {
|
17540 |
+
vimGlobalState.searchHistoryController.pushInput(query);
|
17541 |
+
vimGlobalState.searchHistoryController.reset();
|
17542 |
+
updateSearchQuery(cm, originalQuery);
|
17543 |
+
clearSearchHighlight(cm);
|
17544 |
+
cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
|
17545 |
+
CodeMirror.e_stop(e);
|
17546 |
+
clearInputState(cm);
|
17547 |
+
close();
|
17548 |
+
cm.focus();
|
17549 |
+
} else if (keyName == 'Up' || keyName == 'Down') {
|
17550 |
+
CodeMirror.e_stop(e);
|
17551 |
+
} else if (keyName == 'Ctrl-U') {
|
17552 |
+
// Ctrl-U clears input.
|
17553 |
+
CodeMirror.e_stop(e);
|
17554 |
+
close('');
|
17555 |
+
}
|
17556 |
+
}
|
17557 |
+
switch (command.searchArgs.querySrc) {
|
17558 |
+
case 'prompt':
|
17559 |
+
var macroModeState = vimGlobalState.macroModeState;
|
17560 |
+
if (macroModeState.isPlaying) {
|
17561 |
+
var query = macroModeState.replaySearchQueries.shift();
|
17562 |
+
handleQuery(query, true /** ignoreCase */, false /** smartCase */);
|
17563 |
+
} else {
|
17564 |
+
showPrompt(cm, {
|
17565 |
+
onClose: onPromptClose,
|
17566 |
+
prefix: promptPrefix,
|
17567 |
+
desc: searchPromptDesc,
|
17568 |
+
onKeyUp: onPromptKeyUp,
|
17569 |
+
onKeyDown: onPromptKeyDown
|
17570 |
+
});
|
17571 |
+
}
|
17572 |
+
break;
|
17573 |
+
case 'wordUnderCursor':
|
17574 |
+
var word = expandWordUnderCursor(cm, false /** inclusive */,
|
17575 |
+
true /** forward */, false /** bigWord */,
|
17576 |
+
true /** noSymbol */);
|
17577 |
+
var isKeyword = true;
|
17578 |
+
if (!word) {
|
17579 |
+
word = expandWordUnderCursor(cm, false /** inclusive */,
|
17580 |
+
true /** forward */, false /** bigWord */,
|
17581 |
+
false /** noSymbol */);
|
17582 |
+
isKeyword = false;
|
17583 |
+
}
|
17584 |
+
if (!word) {
|
17585 |
+
return;
|
17586 |
+
}
|
17587 |
+
var query = cm.getLine(word.start.line).substring(word.start.ch,
|
17588 |
+
word.end.ch);
|
17589 |
+
if (isKeyword && wholeWordOnly) {
|
17590 |
+
query = '\\b' + query + '\\b';
|
17591 |
+
} else {
|
17592 |
+
query = escapeRegex(query);
|
17593 |
+
}
|
17594 |
+
|
17595 |
+
// cachedCursor is used to save the old position of the cursor
|
17596 |
+
// when * or # causes vim to seek for the nearest word and shift
|
17597 |
+
// the cursor before entering the motion.
|
17598 |
+
vimGlobalState.jumpList.cachedCursor = cm.getCursor();
|
17599 |
+
cm.setCursor(word.start);
|
17600 |
+
|
17601 |
+
handleQuery(query, true /** ignoreCase */, false /** smartCase */);
|
17602 |
+
break;
|
17603 |
+
}
|
17604 |
+
},
|
17605 |
+
processEx: function(cm, vim, command) {
|
17606 |
+
function onPromptClose(input) {
|
17607 |
+
// Give the prompt some time to close so that if processCommand shows
|
17608 |
+
// an error, the elements don't overlap.
|
17609 |
+
vimGlobalState.exCommandHistoryController.pushInput(input);
|
17610 |
+
vimGlobalState.exCommandHistoryController.reset();
|
17611 |
+
exCommandDispatcher.processCommand(cm, input);
|
17612 |
+
}
|
17613 |
+
function onPromptKeyDown(e, input, close) {
|
17614 |
+
var keyName = CodeMirror.keyName(e), up, offset;
|
17615 |
+
if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||
|
17616 |
+
(keyName == 'Backspace' && input == '')) {
|
17617 |
+
vimGlobalState.exCommandHistoryController.pushInput(input);
|
17618 |
+
vimGlobalState.exCommandHistoryController.reset();
|
17619 |
+
CodeMirror.e_stop(e);
|
17620 |
+
clearInputState(cm);
|
17621 |
+
close();
|
17622 |
+
cm.focus();
|
17623 |
+
}
|
17624 |
+
if (keyName == 'Up' || keyName == 'Down') {
|
17625 |
+
CodeMirror.e_stop(e);
|
17626 |
+
up = keyName == 'Up' ? true : false;
|
17627 |
+
offset = e.target ? e.target.selectionEnd : 0;
|
17628 |
+
input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || '';
|
17629 |
+
close(input);
|
17630 |
+
if (offset && e.target) e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);
|
17631 |
+
} else if (keyName == 'Ctrl-U') {
|
17632 |
+
// Ctrl-U clears input.
|
17633 |
+
CodeMirror.e_stop(e);
|
17634 |
+
close('');
|
17635 |
+
} else {
|
17636 |
+
if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
|
17637 |
+
vimGlobalState.exCommandHistoryController.reset();
|
17638 |
+
}
|
17639 |
+
}
|
17640 |
+
if (command.type == 'keyToEx') {
|
17641 |
+
// Handle user defined Ex to Ex mappings
|
17642 |
+
exCommandDispatcher.processCommand(cm, command.exArgs.input);
|
17643 |
+
} else {
|
17644 |
+
if (vim.visualMode) {
|
17645 |
+
showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
|
17646 |
+
onKeyDown: onPromptKeyDown});
|
17647 |
+
} else {
|
17648 |
+
showPrompt(cm, { onClose: onPromptClose, prefix: ':',
|
17649 |
+
onKeyDown: onPromptKeyDown});
|
17650 |
+
}
|
17651 |
+
}
|
17652 |
+
},
|
17653 |
+
evalInput: function(cm, vim) {
|
17654 |
+
// If the motion command is set, execute both the operator and motion.
|
17655 |
+
// Otherwise return.
|
17656 |
+
var inputState = vim.inputState;
|
17657 |
+
var motion = inputState.motion;
|
17658 |
+
var motionArgs = inputState.motionArgs || {};
|
17659 |
+
var operator = inputState.operator;
|
17660 |
+
var operatorArgs = inputState.operatorArgs || {};
|
17661 |
+
var registerName = inputState.registerName;
|
17662 |
+
var sel = vim.sel;
|
17663 |
+
// TODO: Make sure cm and vim selections are identical outside visual mode.
|
17664 |
+
var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head'));
|
17665 |
+
var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor'));
|
17666 |
+
var oldHead = copyCursor(origHead);
|
17667 |
+
var oldAnchor = copyCursor(origAnchor);
|
17668 |
+
var newHead, newAnchor;
|
17669 |
+
var repeat;
|
17670 |
+
if (operator) {
|
17671 |
+
this.recordLastEdit(vim, inputState);
|
17672 |
+
}
|
17673 |
+
if (inputState.repeatOverride !== undefined) {
|
17674 |
+
// If repeatOverride is specified, that takes precedence over the
|
17675 |
+
// input state's repeat. Used by Ex mode and can be user defined.
|
17676 |
+
repeat = inputState.repeatOverride;
|
17677 |
+
} else {
|
17678 |
+
repeat = inputState.getRepeat();
|
17679 |
+
}
|
17680 |
+
if (repeat > 0 && motionArgs.explicitRepeat) {
|
17681 |
+
motionArgs.repeatIsExplicit = true;
|
17682 |
+
} else if (motionArgs.noRepeat ||
|
17683 |
+
(!motionArgs.explicitRepeat && repeat === 0)) {
|
17684 |
+
repeat = 1;
|
17685 |
+
motionArgs.repeatIsExplicit = false;
|
17686 |
+
}
|
17687 |
+
if (inputState.selectedCharacter) {
|
17688 |
+
// If there is a character input, stick it in all of the arg arrays.
|
17689 |
+
motionArgs.selectedCharacter = operatorArgs.selectedCharacter =
|
17690 |
+
inputState.selectedCharacter;
|
17691 |
+
}
|
17692 |
+
motionArgs.repeat = repeat;
|
17693 |
+
clearInputState(cm);
|
17694 |
+
if (motion) {
|
17695 |
+
var motionResult = motions[motion](cm, origHead, motionArgs, vim);
|
17696 |
+
vim.lastMotion = motions[motion];
|
17697 |
+
if (!motionResult) {
|
17698 |
+
return;
|
17699 |
+
}
|
17700 |
+
if (motionArgs.toJumplist) {
|
17701 |
+
var jumpList = vimGlobalState.jumpList;
|
17702 |
+
// if the current motion is # or *, use cachedCursor
|
17703 |
+
var cachedCursor = jumpList.cachedCursor;
|
17704 |
+
if (cachedCursor) {
|
17705 |
+
recordJumpPosition(cm, cachedCursor, motionResult);
|
17706 |
+
delete jumpList.cachedCursor;
|
17707 |
+
} else {
|
17708 |
+
recordJumpPosition(cm, origHead, motionResult);
|
17709 |
+
}
|
17710 |
+
}
|
17711 |
+
if (motionResult instanceof Array) {
|
17712 |
+
newAnchor = motionResult[0];
|
17713 |
+
newHead = motionResult[1];
|
17714 |
+
} else {
|
17715 |
+
newHead = motionResult;
|
17716 |
+
}
|
17717 |
+
// TODO: Handle null returns from motion commands better.
|
17718 |
+
if (!newHead) {
|
17719 |
+
newHead = copyCursor(origHead);
|
17720 |
+
}
|
17721 |
+
if (vim.visualMode) {
|
17722 |
+
if (!(vim.visualBlock && newHead.ch === Infinity)) {
|
17723 |
+
newHead = clipCursorToContent(cm, newHead, vim.visualBlock);
|
17724 |
+
}
|
17725 |
+
if (newAnchor) {
|
17726 |
+
newAnchor = clipCursorToContent(cm, newAnchor, true);
|
17727 |
+
}
|
17728 |
+
newAnchor = newAnchor || oldAnchor;
|
17729 |
+
sel.anchor = newAnchor;
|
17730 |
+
sel.head = newHead;
|
17731 |
+
updateCmSelection(cm);
|
17732 |
+
updateMark(cm, vim, '<',
|
17733 |
+
cursorIsBefore(newAnchor, newHead) ? newAnchor
|
17734 |
+
: newHead);
|
17735 |
+
updateMark(cm, vim, '>',
|
17736 |
+
cursorIsBefore(newAnchor, newHead) ? newHead
|
17737 |
+
: newAnchor);
|
17738 |
+
} else if (!operator) {
|
17739 |
+
newHead = clipCursorToContent(cm, newHead);
|
17740 |
+
cm.setCursor(newHead.line, newHead.ch);
|
17741 |
+
}
|
17742 |
+
}
|
17743 |
+
if (operator) {
|
17744 |
+
if (operatorArgs.lastSel) {
|
17745 |
+
// Replaying a visual mode operation
|
17746 |
+
newAnchor = oldAnchor;
|
17747 |
+
var lastSel = operatorArgs.lastSel;
|
17748 |
+
var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line);
|
17749 |
+
var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch);
|
17750 |
+
if (lastSel.visualLine) {
|
17751 |
+
// Linewise Visual mode: The same number of lines.
|
17752 |
+
newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
|
17753 |
+
} else if (lastSel.visualBlock) {
|
17754 |
+
// Blockwise Visual mode: The same number of lines and columns.
|
17755 |
+
newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset);
|
17756 |
+
} else if (lastSel.head.line == lastSel.anchor.line) {
|
17757 |
+
// Normal Visual mode within one line: The same number of characters.
|
17758 |
+
newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset);
|
17759 |
+
} else {
|
17760 |
+
// Normal Visual mode with several lines: The same number of lines, in the
|
17761 |
+
// last line the same number of characters as in the last line the last time.
|
17762 |
+
newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
|
17763 |
+
}
|
17764 |
+
vim.visualMode = true;
|
17765 |
+
vim.visualLine = lastSel.visualLine;
|
17766 |
+
vim.visualBlock = lastSel.visualBlock;
|
17767 |
+
sel = vim.sel = {
|
17768 |
+
anchor: newAnchor,
|
17769 |
+
head: newHead
|
17770 |
+
};
|
17771 |
+
updateCmSelection(cm);
|
17772 |
+
} else if (vim.visualMode) {
|
17773 |
+
operatorArgs.lastSel = {
|
17774 |
+
anchor: copyCursor(sel.anchor),
|
17775 |
+
head: copyCursor(sel.head),
|
17776 |
+
visualBlock: vim.visualBlock,
|
17777 |
+
visualLine: vim.visualLine
|
17778 |
+
};
|
17779 |
+
}
|
17780 |
+
var curStart, curEnd, linewise, mode;
|
17781 |
+
var cmSel;
|
17782 |
+
if (vim.visualMode) {
|
17783 |
+
// Init visual op
|
17784 |
+
curStart = cursorMin(sel.head, sel.anchor);
|
17785 |
+
curEnd = cursorMax(sel.head, sel.anchor);
|
17786 |
+
linewise = vim.visualLine || operatorArgs.linewise;
|
17787 |
+
mode = vim.visualBlock ? 'block' :
|
17788 |
+
linewise ? 'line' :
|
17789 |
+
'char';
|
17790 |
+
cmSel = makeCmSelection(cm, {
|
17791 |
+
anchor: curStart,
|
17792 |
+
head: curEnd
|
17793 |
+
}, mode);
|
17794 |
+
if (linewise) {
|
17795 |
+
var ranges = cmSel.ranges;
|
17796 |
+
if (mode == 'block') {
|
17797 |
+
// Linewise operators in visual block mode extend to end of line
|
17798 |
+
for (var i = 0; i < ranges.length; i++) {
|
17799 |
+
ranges[i].head.ch = lineLength(cm, ranges[i].head.line);
|
17800 |
+
}
|
17801 |
+
} else if (mode == 'line') {
|
17802 |
+
ranges[0].head = Pos(ranges[0].head.line + 1, 0);
|
17803 |
+
}
|
17804 |
+
}
|
17805 |
+
} else {
|
17806 |
+
// Init motion op
|
17807 |
+
curStart = copyCursor(newAnchor || oldAnchor);
|
17808 |
+
curEnd = copyCursor(newHead || oldHead);
|
17809 |
+
if (cursorIsBefore(curEnd, curStart)) {
|
17810 |
+
var tmp = curStart;
|
17811 |
+
curStart = curEnd;
|
17812 |
+
curEnd = tmp;
|
17813 |
+
}
|
17814 |
+
linewise = motionArgs.linewise || operatorArgs.linewise;
|
17815 |
+
if (linewise) {
|
17816 |
+
// Expand selection to entire line.
|
17817 |
+
expandSelectionToLine(cm, curStart, curEnd);
|
17818 |
+
} else if (motionArgs.forward) {
|
17819 |
+
// Clip to trailing newlines only if the motion goes forward.
|
17820 |
+
clipToLine(cm, curStart, curEnd);
|
17821 |
+
}
|
17822 |
+
mode = 'char';
|
17823 |
+
var exclusive = !motionArgs.inclusive || linewise;
|
17824 |
+
cmSel = makeCmSelection(cm, {
|
17825 |
+
anchor: curStart,
|
17826 |
+
head: curEnd
|
17827 |
+
}, mode, exclusive);
|
17828 |
+
}
|
17829 |
+
cm.setSelections(cmSel.ranges, cmSel.primary);
|
17830 |
+
vim.lastMotion = null;
|
17831 |
+
operatorArgs.repeat = repeat; // For indent in visual mode.
|
17832 |
+
operatorArgs.registerName = registerName;
|
17833 |
+
// Keep track of linewise as it affects how paste and change behave.
|
17834 |
+
operatorArgs.linewise = linewise;
|
17835 |
+
var operatorMoveTo = operators[operator](
|
17836 |
+
cm, operatorArgs, cmSel.ranges, oldAnchor, newHead);
|
17837 |
+
if (vim.visualMode) {
|
17838 |
+
exitVisualMode(cm, operatorMoveTo != null);
|
17839 |
+
}
|
17840 |
+
if (operatorMoveTo) {
|
17841 |
+
cm.setCursor(operatorMoveTo);
|
17842 |
+
}
|
17843 |
+
}
|
17844 |
+
},
|
17845 |
+
recordLastEdit: function(vim, inputState, actionCommand) {
|
17846 |
+
var macroModeState = vimGlobalState.macroModeState;
|
17847 |
+
if (macroModeState.isPlaying) { return; }
|
17848 |
+
vim.lastEditInputState = inputState;
|
17849 |
+
vim.lastEditActionCommand = actionCommand;
|
17850 |
+
macroModeState.lastInsertModeChanges.changes = [];
|
17851 |
+
macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
|
17852 |
+
}
|
17853 |
+
};
|
17854 |
+
|
17855 |
+
/**
|
17856 |
+
* typedef {Object{line:number,ch:number}} Cursor An object containing the
|
17857 |
+
* position of the cursor.
|
17858 |
+
*/
|
17859 |
+
// All of the functions below return Cursor objects.
|
17860 |
+
var motions = {
|
17861 |
+
moveToTopLine: function(cm, _head, motionArgs) {
|
17862 |
+
var line = getUserVisibleLines(cm).top + motionArgs.repeat -1;
|
17863 |
+
return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
|
17864 |
+
},
|
17865 |
+
moveToMiddleLine: function(cm) {
|
17866 |
+
var range = getUserVisibleLines(cm);
|
17867 |
+
var line = Math.floor((range.top + range.bottom) * 0.5);
|
17868 |
+
return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
|
17869 |
+
},
|
17870 |
+
moveToBottomLine: function(cm, _head, motionArgs) {
|
17871 |
+
var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;
|
17872 |
+
return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
|
17873 |
+
},
|
17874 |
+
expandToLine: function(_cm, head, motionArgs) {
|
17875 |
+
// Expands forward to end of line, and then to next line if repeat is
|
17876 |
+
// >1. Does not handle backward motion!
|
17877 |
+
var cur = head;
|
17878 |
+
return Pos(cur.line + motionArgs.repeat - 1, Infinity);
|
17879 |
+
},
|
17880 |
+
findNext: function(cm, _head, motionArgs) {
|
17881 |
+
var state = getSearchState(cm);
|
17882 |
+
var query = state.getQuery();
|
17883 |
+
if (!query) {
|
17884 |
+
return;
|
17885 |
+
}
|
17886 |
+
var prev = !motionArgs.forward;
|
17887 |
+
// If search is initiated with ? instead of /, negate direction.
|
17888 |
+
prev = (state.isReversed()) ? !prev : prev;
|
17889 |
+
highlightSearchMatches(cm, query);
|
17890 |
+
return findNext(cm, prev/** prev */, query, motionArgs.repeat);
|
17891 |
+
},
|
17892 |
+
goToMark: function(cm, _head, motionArgs, vim) {
|
17893 |
+
var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);
|
17894 |
+
if (pos) {
|
17895 |
+
return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;
|
17896 |
+
}
|
17897 |
+
return null;
|
17898 |
+
},
|
17899 |
+
moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) {
|
17900 |
+
if (vim.visualBlock && motionArgs.sameLine) {
|
17901 |
+
var sel = vim.sel;
|
17902 |
+
return [
|
17903 |
+
clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)),
|
17904 |
+
clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch))
|
17905 |
+
];
|
17906 |
+
} else {
|
17907 |
+
return ([vim.sel.head, vim.sel.anchor]);
|
17908 |
+
}
|
17909 |
+
},
|
17910 |
+
jumpToMark: function(cm, head, motionArgs, vim) {
|
17911 |
+
var best = head;
|
17912 |
+
for (var i = 0; i < motionArgs.repeat; i++) {
|
17913 |
+
var cursor = best;
|
17914 |
+
for (var key in vim.marks) {
|
17915 |
+
if (!isLowerCase(key)) {
|
17916 |
+
continue;
|
17917 |
+
}
|
17918 |
+
var mark = vim.marks[key].find();
|
17919 |
+
var isWrongDirection = (motionArgs.forward) ?
|
17920 |
+
cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);
|
17921 |
+
|
17922 |
+
if (isWrongDirection) {
|
17923 |
+
continue;
|
17924 |
+
}
|
17925 |
+
if (motionArgs.linewise && (mark.line == cursor.line)) {
|
17926 |
+
continue;
|
17927 |
+
}
|
17928 |
+
|
17929 |
+
var equal = cursorEqual(cursor, best);
|
17930 |
+
var between = (motionArgs.forward) ?
|
17931 |
+
cursorIsBetween(cursor, mark, best) :
|
17932 |
+
cursorIsBetween(best, mark, cursor);
|
17933 |
+
|
17934 |
+
if (equal || between) {
|
17935 |
+
best = mark;
|
17936 |
+
}
|
17937 |
+
}
|
17938 |
+
}
|
17939 |
+
|
17940 |
+
if (motionArgs.linewise) {
|
17941 |
+
// Vim places the cursor on the first non-whitespace character of
|
17942 |
+
// the line if there is one, else it places the cursor at the end
|
17943 |
+
// of the line, regardless of whether a mark was found.
|
17944 |
+
best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));
|
17945 |
+
}
|
17946 |
+
return best;
|
17947 |
+
},
|
17948 |
+
moveByCharacters: function(_cm, head, motionArgs) {
|
17949 |
+
var cur = head;
|
17950 |
+
var repeat = motionArgs.repeat;
|
17951 |
+
var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;
|
17952 |
+
return Pos(cur.line, ch);
|
17953 |
+
},
|
17954 |
+
moveByLines: function(cm, head, motionArgs, vim) {
|
17955 |
+
var cur = head;
|
17956 |
+
var endCh = cur.ch;
|
17957 |
+
// Depending what our last motion was, we may want to do different
|
17958 |
+
// things. If our last motion was moving vertically, we want to
|
17959 |
+
// preserve the HPos from our last horizontal move. If our last motion
|
17960 |
+
// was going to the end of a line, moving vertically we should go to
|
17961 |
+
// the end of the line, etc.
|
17962 |
+
switch (vim.lastMotion) {
|
17963 |
+
case this.moveByLines:
|
17964 |
+
case this.moveByDisplayLines:
|
17965 |
+
case this.moveByScroll:
|
17966 |
+
case this.moveToColumn:
|
17967 |
+
case this.moveToEol:
|
17968 |
+
endCh = vim.lastHPos;
|
17969 |
+
break;
|
17970 |
+
default:
|
17971 |
+
vim.lastHPos = endCh;
|
17972 |
+
}
|
17973 |
+
var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0);
|
17974 |
+
var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;
|
17975 |
+
var first = cm.firstLine();
|
17976 |
+
var last = cm.lastLine();
|
17977 |
+
// Vim go to line begin or line end when cursor at first/last line and
|
17978 |
+
// move to previous/next line is triggered.
|
17979 |
+
if (line < first && cur.line == first){
|
17980 |
+
return this.moveToStartOfLine(cm, head, motionArgs, vim);
|
17981 |
+
}else if (line > last && cur.line == last){
|
17982 |
+
return this.moveToEol(cm, head, motionArgs, vim);
|
17983 |
+
}
|
17984 |
+
if (motionArgs.toFirstChar){
|
17985 |
+
endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
|
17986 |
+
vim.lastHPos = endCh;
|
17987 |
+
}
|
17988 |
+
vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left;
|
17989 |
+
return Pos(line, endCh);
|
17990 |
+
},
|
17991 |
+
moveByDisplayLines: function(cm, head, motionArgs, vim) {
|
17992 |
+
var cur = head;
|
17993 |
+
switch (vim.lastMotion) {
|
17994 |
+
case this.moveByDisplayLines:
|
17995 |
+
case this.moveByScroll:
|
17996 |
+
case this.moveByLines:
|
17997 |
+
case this.moveToColumn:
|
17998 |
+
case this.moveToEol:
|
17999 |
+
break;
|
18000 |
+
default:
|
18001 |
+
vim.lastHSPos = cm.charCoords(cur,'div').left;
|
18002 |
+
}
|
18003 |
+
var repeat = motionArgs.repeat;
|
18004 |
+
var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos);
|
18005 |
+
if (res.hitSide) {
|
18006 |
+
if (motionArgs.forward) {
|
18007 |
+
var lastCharCoords = cm.charCoords(res, 'div');
|
18008 |
+
var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };
|
18009 |
+
var res = cm.coordsChar(goalCoords, 'div');
|
18010 |
+
} else {
|
18011 |
+
var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div');
|
18012 |
+
resCoords.left = vim.lastHSPos;
|
18013 |
+
res = cm.coordsChar(resCoords, 'div');
|
18014 |
+
}
|
18015 |
+
}
|
18016 |
+
vim.lastHPos = res.ch;
|
18017 |
+
return res;
|
18018 |
+
},
|
18019 |
+
moveByPage: function(cm, head, motionArgs) {
|
18020 |
+
// CodeMirror only exposes functions that move the cursor page down, so
|
18021 |
+
// doing this bad hack to move the cursor and move it back. evalInput
|
18022 |
+
// will move the cursor to where it should be in the end.
|
18023 |
+
var curStart = head;
|
18024 |
+
var repeat = motionArgs.repeat;
|
18025 |
+
return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page');
|
18026 |
+
},
|
18027 |
+
moveByParagraph: function(cm, head, motionArgs) {
|
18028 |
+
var dir = motionArgs.forward ? 1 : -1;
|
18029 |
+
return findParagraph(cm, head, motionArgs.repeat, dir);
|
18030 |
+
},
|
18031 |
+
moveByScroll: function(cm, head, motionArgs, vim) {
|
18032 |
+
var scrollbox = cm.getScrollInfo();
|
18033 |
+
var curEnd = null;
|
18034 |
+
var repeat = motionArgs.repeat;
|
18035 |
+
if (!repeat) {
|
18036 |
+
repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());
|
18037 |
+
}
|
18038 |
+
var orig = cm.charCoords(head, 'local');
|
18039 |
+
motionArgs.repeat = repeat;
|
18040 |
+
var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim);
|
18041 |
+
if (!curEnd) {
|
18042 |
+
return null;
|
18043 |
+
}
|
18044 |
+
var dest = cm.charCoords(curEnd, 'local');
|
18045 |
+
cm.scrollTo(null, scrollbox.top + dest.top - orig.top);
|
18046 |
+
return curEnd;
|
18047 |
+
},
|
18048 |
+
moveByWords: function(cm, head, motionArgs) {
|
18049 |
+
return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward,
|
18050 |
+
!!motionArgs.wordEnd, !!motionArgs.bigWord);
|
18051 |
+
},
|
18052 |
+
moveTillCharacter: function(cm, _head, motionArgs) {
|
18053 |
+
var repeat = motionArgs.repeat;
|
18054 |
+
var curEnd = moveToCharacter(cm, repeat, motionArgs.forward,
|
18055 |
+
motionArgs.selectedCharacter);
|
18056 |
+
var increment = motionArgs.forward ? -1 : 1;
|
18057 |
+
recordLastCharacterSearch(increment, motionArgs);
|
18058 |
+
if (!curEnd) return null;
|
18059 |
+
curEnd.ch += increment;
|
18060 |
+
return curEnd;
|
18061 |
+
},
|
18062 |
+
moveToCharacter: function(cm, head, motionArgs) {
|
18063 |
+
var repeat = motionArgs.repeat;
|
18064 |
+
recordLastCharacterSearch(0, motionArgs);
|
18065 |
+
return moveToCharacter(cm, repeat, motionArgs.forward,
|
18066 |
+
motionArgs.selectedCharacter) || head;
|
18067 |
+
},
|
18068 |
+
moveToSymbol: function(cm, head, motionArgs) {
|
18069 |
+
var repeat = motionArgs.repeat;
|
18070 |
+
return findSymbol(cm, repeat, motionArgs.forward,
|
18071 |
+
motionArgs.selectedCharacter) || head;
|
18072 |
+
},
|
18073 |
+
moveToColumn: function(cm, head, motionArgs, vim) {
|
18074 |
+
var repeat = motionArgs.repeat;
|
18075 |
+
// repeat is equivalent to which column we want to move to!
|
18076 |
+
vim.lastHPos = repeat - 1;
|
18077 |
+
vim.lastHSPos = cm.charCoords(head,'div').left;
|
18078 |
+
return moveToColumn(cm, repeat);
|
18079 |
+
},
|
18080 |
+
moveToEol: function(cm, head, motionArgs, vim) {
|
18081 |
+
var cur = head;
|
18082 |
+
vim.lastHPos = Infinity;
|
18083 |
+
var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
|
18084 |
+
var end=cm.clipPos(retval);
|
18085 |
+
end.ch--;
|
18086 |
+
vim.lastHSPos = cm.charCoords(end,'div').left;
|
18087 |
+
return retval;
|
18088 |
+
},
|
18089 |
+
moveToFirstNonWhiteSpaceCharacter: function(cm, head) {
|
18090 |
+
// Go to the start of the line where the text begins, or the end for
|
18091 |
+
// whitespace-only lines
|
18092 |
+
var cursor = head;
|
18093 |
+
return Pos(cursor.line,
|
18094 |
+
findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));
|
18095 |
+
},
|
18096 |
+
moveToMatchedSymbol: function(cm, head) {
|
18097 |
+
var cursor = head;
|
18098 |
+
var line = cursor.line;
|
18099 |
+
var ch = cursor.ch;
|
18100 |
+
var lineText = cm.getLine(line);
|
18101 |
+
var symbol;
|
18102 |
+
do {
|
18103 |
+
symbol = lineText.charAt(ch++);
|
18104 |
+
if (symbol && isMatchableSymbol(symbol)) {
|
18105 |
+
var style = cm.getTokenTypeAt(Pos(line, ch));
|
18106 |
+
if (style !== "string" && style !== "comment") {
|
18107 |
+
break;
|
18108 |
+
}
|
18109 |
+
}
|
18110 |
+
} while (symbol);
|
18111 |
+
if (symbol) {
|
18112 |
+
var matched = cm.findMatchingBracket(Pos(line, ch));
|
18113 |
+
return matched.to;
|
18114 |
+
} else {
|
18115 |
+
return cursor;
|
18116 |
+
}
|
18117 |
+
},
|
18118 |
+
moveToStartOfLine: function(_cm, head) {
|
18119 |
+
return Pos(head.line, 0);
|
18120 |
+
},
|
18121 |
+
moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) {
|
18122 |
+
var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();
|
18123 |
+
if (motionArgs.repeatIsExplicit) {
|
18124 |
+
lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');
|
18125 |
+
}
|
18126 |
+
return Pos(lineNum,
|
18127 |
+
findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));
|
18128 |
+
},
|
18129 |
+
textObjectManipulation: function(cm, head, motionArgs, vim) {
|
18130 |
+
// TODO: lots of possible exceptions that can be thrown here. Try da(
|
18131 |
+
// outside of a () block.
|
18132 |
+
|
18133 |
+
// TODO: adding <> >< to this map doesn't work, presumably because
|
18134 |
+
// they're operators
|
18135 |
+
var mirroredPairs = {'(': ')', ')': '(',
|
18136 |
+
'{': '}', '}': '{',
|
18137 |
+
'[': ']', ']': '['};
|
18138 |
+
var selfPaired = {'\'': true, '"': true};
|
18139 |
+
|
18140 |
+
var character = motionArgs.selectedCharacter;
|
18141 |
+
// 'b' refers to '()' block.
|
18142 |
+
// 'B' refers to '{}' block.
|
18143 |
+
if (character == 'b') {
|
18144 |
+
character = '(';
|
18145 |
+
} else if (character == 'B') {
|
18146 |
+
character = '{';
|
18147 |
+
}
|
18148 |
+
|
18149 |
+
// Inclusive is the difference between a and i
|
18150 |
+
// TODO: Instead of using the additional text object map to perform text
|
18151 |
+
// object operations, merge the map into the defaultKeyMap and use
|
18152 |
+
// motionArgs to define behavior. Define separate entries for 'aw',
|
18153 |
+
// 'iw', 'a[', 'i[', etc.
|
18154 |
+
var inclusive = !motionArgs.textObjectInner;
|
18155 |
+
|
18156 |
+
var tmp;
|
18157 |
+
if (mirroredPairs[character]) {
|
18158 |
+
tmp = selectCompanionObject(cm, head, character, inclusive);
|
18159 |
+
} else if (selfPaired[character]) {
|
18160 |
+
tmp = findBeginningAndEnd(cm, head, character, inclusive);
|
18161 |
+
} else if (character === 'W') {
|
18162 |
+
tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,
|
18163 |
+
true /** bigWord */);
|
18164 |
+
} else if (character === 'w') {
|
18165 |
+
tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,
|
18166 |
+
false /** bigWord */);
|
18167 |
+
} else if (character === 'p') {
|
18168 |
+
tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive);
|
18169 |
+
motionArgs.linewise = true;
|
18170 |
+
if (vim.visualMode) {
|
18171 |
+
if (!vim.visualLine) { vim.visualLine = true; }
|
18172 |
+
} else {
|
18173 |
+
var operatorArgs = vim.inputState.operatorArgs;
|
18174 |
+
if (operatorArgs) { operatorArgs.linewise = true; }
|
18175 |
+
tmp.end.line--;
|
18176 |
+
}
|
18177 |
+
} else {
|
18178 |
+
// No text object defined for this, don't move.
|
18179 |
+
return null;
|
18180 |
+
}
|
18181 |
+
|
18182 |
+
if (!cm.state.vim.visualMode) {
|
18183 |
+
return [tmp.start, tmp.end];
|
18184 |
+
} else {
|
18185 |
+
return expandSelection(cm, tmp.start, tmp.end);
|
18186 |
+
}
|
18187 |
+
},
|
18188 |
+
|
18189 |
+
repeatLastCharacterSearch: function(cm, head, motionArgs) {
|
18190 |
+
var lastSearch = vimGlobalState.lastCharacterSearch;
|
18191 |
+
var repeat = motionArgs.repeat;
|
18192 |
+
var forward = motionArgs.forward === lastSearch.forward;
|
18193 |
+
var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);
|
18194 |
+
cm.moveH(-increment, 'char');
|
18195 |
+
motionArgs.inclusive = forward ? true : false;
|
18196 |
+
var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);
|
18197 |
+
if (!curEnd) {
|
18198 |
+
cm.moveH(increment, 'char');
|
18199 |
+
return head;
|
18200 |
+
}
|
18201 |
+
curEnd.ch += increment;
|
18202 |
+
return curEnd;
|
18203 |
+
}
|
18204 |
+
};
|
18205 |
+
|
18206 |
+
function defineMotion(name, fn) {
|
18207 |
+
motions[name] = fn;
|
18208 |
+
}
|
18209 |
+
|
18210 |
+
function fillArray(val, times) {
|
18211 |
+
var arr = [];
|
18212 |
+
for (var i = 0; i < times; i++) {
|
18213 |
+
arr.push(val);
|
18214 |
+
}
|
18215 |
+
return arr;
|
18216 |
+
}
|
18217 |
+
/**
|
18218 |
+
* An operator acts on a text selection. It receives the list of selections
|
18219 |
+
* as input. The corresponding CodeMirror selection is guaranteed to
|
18220 |
+
* match the input selection.
|
18221 |
+
*/
|
18222 |
+
var operators = {
|
18223 |
+
change: function(cm, args, ranges) {
|
18224 |
+
var finalHead, text;
|
18225 |
+
var vim = cm.state.vim;
|
18226 |
+
vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock;
|
18227 |
+
if (!vim.visualMode) {
|
18228 |
+
var anchor = ranges[0].anchor,
|
18229 |
+
head = ranges[0].head;
|
18230 |
+
text = cm.getRange(anchor, head);
|
18231 |
+
var lastState = vim.lastEditInputState || {};
|
18232 |
+
if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) {
|
18233 |
+
// Exclude trailing whitespace if the range is not all whitespace.
|
18234 |
+
var match = (/\s+$/).exec(text);
|
18235 |
+
if (match && lastState.motionArgs && lastState.motionArgs.forward) {
|
18236 |
+
head = offsetCursor(head, 0, - match[0].length);
|
18237 |
+
text = text.slice(0, - match[0].length);
|
18238 |
+
}
|
18239 |
+
}
|
18240 |
+
var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE);
|
18241 |
+
var wasLastLine = cm.firstLine() == cm.lastLine();
|
18242 |
+
if (head.line > cm.lastLine() && args.linewise && !wasLastLine) {
|
18243 |
+
cm.replaceRange('', prevLineEnd, head);
|
18244 |
+
} else {
|
18245 |
+
cm.replaceRange('', anchor, head);
|
18246 |
+
}
|
18247 |
+
if (args.linewise) {
|
18248 |
+
// Push the next line back down, if there is a next line.
|
18249 |
+
if (!wasLastLine) {
|
18250 |
+
cm.setCursor(prevLineEnd);
|
18251 |
+
CodeMirror.commands.newlineAndIndent(cm);
|
18252 |
+
}
|
18253 |
+
// make sure cursor ends up at the end of the line.
|
18254 |
+
anchor.ch = Number.MAX_VALUE;
|
18255 |
+
}
|
18256 |
+
finalHead = anchor;
|
18257 |
+
} else {
|
18258 |
+
text = cm.getSelection();
|
18259 |
+
var replacement = fillArray('', ranges.length);
|
18260 |
+
cm.replaceSelections(replacement);
|
18261 |
+
finalHead = cursorMin(ranges[0].head, ranges[0].anchor);
|
18262 |
+
}
|
18263 |
+
vimGlobalState.registerController.pushText(
|
18264 |
+
args.registerName, 'change', text,
|
18265 |
+
args.linewise, ranges.length > 1);
|
18266 |
+
actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim);
|
18267 |
+
},
|
18268 |
+
// delete is a javascript keyword.
|
18269 |
+
'delete': function(cm, args, ranges) {
|
18270 |
+
var finalHead, text;
|
18271 |
+
var vim = cm.state.vim;
|
18272 |
+
if (!vim.visualBlock) {
|
18273 |
+
var anchor = ranges[0].anchor,
|
18274 |
+
head = ranges[0].head;
|
18275 |
+
if (args.linewise &&
|
18276 |
+
head.line != cm.firstLine() &&
|
18277 |
+
anchor.line == cm.lastLine() &&
|
18278 |
+
anchor.line == head.line - 1) {
|
18279 |
+
// Special case for dd on last line (and first line).
|
18280 |
+
if (anchor.line == cm.firstLine()) {
|
18281 |
+
anchor.ch = 0;
|
18282 |
+
} else {
|
18283 |
+
anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1));
|
18284 |
+
}
|
18285 |
+
}
|
18286 |
+
text = cm.getRange(anchor, head);
|
18287 |
+
cm.replaceRange('', anchor, head);
|
18288 |
+
finalHead = anchor;
|
18289 |
+
if (args.linewise) {
|
18290 |
+
finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor);
|
18291 |
+
}
|
18292 |
+
} else {
|
18293 |
+
text = cm.getSelection();
|
18294 |
+
var replacement = fillArray('', ranges.length);
|
18295 |
+
cm.replaceSelections(replacement);
|
18296 |
+
finalHead = ranges[0].anchor;
|
18297 |
+
}
|
18298 |
+
vimGlobalState.registerController.pushText(
|
18299 |
+
args.registerName, 'delete', text,
|
18300 |
+
args.linewise, vim.visualBlock);
|
18301 |
+
return clipCursorToContent(cm, finalHead);
|
18302 |
+
},
|
18303 |
+
indent: function(cm, args, ranges) {
|
18304 |
+
var vim = cm.state.vim;
|
18305 |
+
var startLine = ranges[0].anchor.line;
|
18306 |
+
var endLine = vim.visualBlock ?
|
18307 |
+
ranges[ranges.length - 1].anchor.line :
|
18308 |
+
ranges[0].head.line;
|
18309 |
+
// In visual mode, n> shifts the selection right n times, instead of
|
18310 |
+
// shifting n lines right once.
|
18311 |
+
var repeat = (vim.visualMode) ? args.repeat : 1;
|
18312 |
+
if (args.linewise) {
|
18313 |
+
// The only way to delete a newline is to delete until the start of
|
18314 |
+
// the next line, so in linewise mode evalInput will include the next
|
18315 |
+
// line. We don't want this in indent, so we go back a line.
|
18316 |
+
endLine--;
|
18317 |
+
}
|
18318 |
+
for (var i = startLine; i <= endLine; i++) {
|
18319 |
+
for (var j = 0; j < repeat; j++) {
|
18320 |
+
cm.indentLine(i, args.indentRight);
|
18321 |
+
}
|
18322 |
+
}
|
18323 |
+
return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
|
18324 |
+
},
|
18325 |
+
changeCase: function(cm, args, ranges, oldAnchor, newHead) {
|
18326 |
+
var selections = cm.getSelections();
|
18327 |
+
var swapped = [];
|
18328 |
+
var toLower = args.toLower;
|
18329 |
+
for (var j = 0; j < selections.length; j++) {
|
18330 |
+
var toSwap = selections[j];
|
18331 |
+
var text = '';
|
18332 |
+
if (toLower === true) {
|
18333 |
+
text = toSwap.toLowerCase();
|
18334 |
+
} else if (toLower === false) {
|
18335 |
+
text = toSwap.toUpperCase();
|
18336 |
+
} else {
|
18337 |
+
for (var i = 0; i < toSwap.length; i++) {
|
18338 |
+
var character = toSwap.charAt(i);
|
18339 |
+
text += isUpperCase(character) ? character.toLowerCase() :
|
18340 |
+
character.toUpperCase();
|
18341 |
+
}
|
18342 |
+
}
|
18343 |
+
swapped.push(text);
|
18344 |
+
}
|
18345 |
+
cm.replaceSelections(swapped);
|
18346 |
+
if (args.shouldMoveCursor){
|
18347 |
+
return newHead;
|
18348 |
+
} else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) {
|
18349 |
+
return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor);
|
18350 |
+
} else if (args.linewise){
|
18351 |
+
return oldAnchor;
|
18352 |
+
} else {
|
18353 |
+
return cursorMin(ranges[0].anchor, ranges[0].head);
|
18354 |
+
}
|
18355 |
+
},
|
18356 |
+
yank: function(cm, args, ranges, oldAnchor) {
|
18357 |
+
var vim = cm.state.vim;
|
18358 |
+
var text = cm.getSelection();
|
18359 |
+
var endPos = vim.visualMode
|
18360 |
+
? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor)
|
18361 |
+
: oldAnchor;
|
18362 |
+
vimGlobalState.registerController.pushText(
|
18363 |
+
args.registerName, 'yank',
|
18364 |
+
text, args.linewise, vim.visualBlock);
|
18365 |
+
return endPos;
|
18366 |
+
}
|
18367 |
+
};
|
18368 |
+
|
18369 |
+
function defineOperator(name, fn) {
|
18370 |
+
operators[name] = fn;
|
18371 |
+
}
|
18372 |
+
|
18373 |
+
var actions = {
|
18374 |
+
jumpListWalk: function(cm, actionArgs, vim) {
|
18375 |
+
if (vim.visualMode) {
|
18376 |
+
return;
|
18377 |
+
}
|
18378 |
+
var repeat = actionArgs.repeat;
|
18379 |
+
var forward = actionArgs.forward;
|
18380 |
+
var jumpList = vimGlobalState.jumpList;
|
18381 |
+
|
18382 |
+
var mark = jumpList.move(cm, forward ? repeat : -repeat);
|
18383 |
+
var markPos = mark ? mark.find() : undefined;
|
18384 |
+
markPos = markPos ? markPos : cm.getCursor();
|
18385 |
+
cm.setCursor(markPos);
|
18386 |
+
},
|
18387 |
+
scroll: function(cm, actionArgs, vim) {
|
18388 |
+
if (vim.visualMode) {
|
18389 |
+
return;
|
18390 |
+
}
|
18391 |
+
var repeat = actionArgs.repeat || 1;
|
18392 |
+
var lineHeight = cm.defaultTextHeight();
|
18393 |
+
var top = cm.getScrollInfo().top;
|
18394 |
+
var delta = lineHeight * repeat;
|
18395 |
+
var newPos = actionArgs.forward ? top + delta : top - delta;
|
18396 |
+
var cursor = copyCursor(cm.getCursor());
|
18397 |
+
var cursorCoords = cm.charCoords(cursor, 'local');
|
18398 |
+
if (actionArgs.forward) {
|
18399 |
+
if (newPos > cursorCoords.top) {
|
18400 |
+
cursor.line += (newPos - cursorCoords.top) / lineHeight;
|
18401 |
+
cursor.line = Math.ceil(cursor.line);
|
18402 |
+
cm.setCursor(cursor);
|
18403 |
+
cursorCoords = cm.charCoords(cursor, 'local');
|
18404 |
+
cm.scrollTo(null, cursorCoords.top);
|
18405 |
+
} else {
|
18406 |
+
// Cursor stays within bounds. Just reposition the scroll window.
|
18407 |
+
cm.scrollTo(null, newPos);
|
18408 |
+
}
|
18409 |
+
} else {
|
18410 |
+
var newBottom = newPos + cm.getScrollInfo().clientHeight;
|
18411 |
+
if (newBottom < cursorCoords.bottom) {
|
18412 |
+
cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight;
|
18413 |
+
cursor.line = Math.floor(cursor.line);
|
18414 |
+
cm.setCursor(cursor);
|
18415 |
+
cursorCoords = cm.charCoords(cursor, 'local');
|
18416 |
+
cm.scrollTo(
|
18417 |
+
null, cursorCoords.bottom - cm.getScrollInfo().clientHeight);
|
18418 |
+
} else {
|
18419 |
+
// Cursor stays within bounds. Just reposition the scroll window.
|
18420 |
+
cm.scrollTo(null, newPos);
|
18421 |
+
}
|
18422 |
+
}
|
18423 |
+
},
|
18424 |
+
scrollToCursor: function(cm, actionArgs) {
|
18425 |
+
var lineNum = cm.getCursor().line;
|
18426 |
+
var charCoords = cm.charCoords(Pos(lineNum, 0), 'local');
|
18427 |
+
var height = cm.getScrollInfo().clientHeight;
|
18428 |
+
var y = charCoords.top;
|
18429 |
+
var lineHeight = charCoords.bottom - y;
|
18430 |
+
switch (actionArgs.position) {
|
18431 |
+
case 'center': y = y - (height / 2) + lineHeight;
|
18432 |
+
break;
|
18433 |
+
case 'bottom': y = y - height + lineHeight;
|
18434 |
+
break;
|
18435 |
+
}
|
18436 |
+
cm.scrollTo(null, y);
|
18437 |
+
},
|
18438 |
+
replayMacro: function(cm, actionArgs, vim) {
|
18439 |
+
var registerName = actionArgs.selectedCharacter;
|
18440 |
+
var repeat = actionArgs.repeat;
|
18441 |
+
var macroModeState = vimGlobalState.macroModeState;
|
18442 |
+
if (registerName == '@') {
|
18443 |
+
registerName = macroModeState.latestRegister;
|
18444 |
+
}
|
18445 |
+
while(repeat--){
|
18446 |
+
executeMacroRegister(cm, vim, macroModeState, registerName);
|
18447 |
+
}
|
18448 |
+
},
|
18449 |
+
enterMacroRecordMode: function(cm, actionArgs) {
|
18450 |
+
var macroModeState = vimGlobalState.macroModeState;
|
18451 |
+
var registerName = actionArgs.selectedCharacter;
|
18452 |
+
macroModeState.enterMacroRecordMode(cm, registerName);
|
18453 |
+
},
|
18454 |
+
toggleOverwrite: function(cm) {
|
18455 |
+
if (!cm.state.overwrite) {
|
18456 |
+
cm.toggleOverwrite(true);
|
18457 |
+
cm.setOption('keyMap', 'vim-replace');
|
18458 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"});
|
18459 |
+
} else {
|
18460 |
+
cm.toggleOverwrite(false);
|
18461 |
+
cm.setOption('keyMap', 'vim-insert');
|
18462 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"});
|
18463 |
+
}
|
18464 |
+
},
|
18465 |
+
enterInsertMode: function(cm, actionArgs, vim) {
|
18466 |
+
if (cm.getOption('readOnly')) { return; }
|
18467 |
+
vim.insertMode = true;
|
18468 |
+
vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;
|
18469 |
+
var insertAt = (actionArgs) ? actionArgs.insertAt : null;
|
18470 |
+
var sel = vim.sel;
|
18471 |
+
var head = actionArgs.head || cm.getCursor('head');
|
18472 |
+
var height = cm.listSelections().length;
|
18473 |
+
if (insertAt == 'eol') {
|
18474 |
+
head = Pos(head.line, lineLength(cm, head.line));
|
18475 |
+
} else if (insertAt == 'charAfter') {
|
18476 |
+
head = offsetCursor(head, 0, 1);
|
18477 |
+
} else if (insertAt == 'firstNonBlank') {
|
18478 |
+
head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head);
|
18479 |
+
} else if (insertAt == 'startOfSelectedArea') {
|
18480 |
+
if (!vim.visualBlock) {
|
18481 |
+
if (sel.head.line < sel.anchor.line) {
|
18482 |
+
head = sel.head;
|
18483 |
+
} else {
|
18484 |
+
head = Pos(sel.anchor.line, 0);
|
18485 |
+
}
|
18486 |
+
} else {
|
18487 |
+
head = Pos(
|
18488 |
+
Math.min(sel.head.line, sel.anchor.line),
|
18489 |
+
Math.min(sel.head.ch, sel.anchor.ch));
|
18490 |
+
height = Math.abs(sel.head.line - sel.anchor.line) + 1;
|
18491 |
+
}
|
18492 |
+
} else if (insertAt == 'endOfSelectedArea') {
|
18493 |
+
if (!vim.visualBlock) {
|
18494 |
+
if (sel.head.line >= sel.anchor.line) {
|
18495 |
+
head = offsetCursor(sel.head, 0, 1);
|
18496 |
+
} else {
|
18497 |
+
head = Pos(sel.anchor.line, 0);
|
18498 |
+
}
|
18499 |
+
} else {
|
18500 |
+
head = Pos(
|
18501 |
+
Math.min(sel.head.line, sel.anchor.line),
|
18502 |
+
Math.max(sel.head.ch + 1, sel.anchor.ch));
|
18503 |
+
height = Math.abs(sel.head.line - sel.anchor.line) + 1;
|
18504 |
+
}
|
18505 |
+
} else if (insertAt == 'inplace') {
|
18506 |
+
if (vim.visualMode){
|
18507 |
+
return;
|
18508 |
+
}
|
18509 |
+
}
|
18510 |
+
cm.setOption('disableInput', false);
|
18511 |
+
if (actionArgs && actionArgs.replace) {
|
18512 |
+
// Handle Replace-mode as a special case of insert mode.
|
18513 |
+
cm.toggleOverwrite(true);
|
18514 |
+
cm.setOption('keyMap', 'vim-replace');
|
18515 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"});
|
18516 |
+
} else {
|
18517 |
+
cm.toggleOverwrite(false);
|
18518 |
+
cm.setOption('keyMap', 'vim-insert');
|
18519 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"});
|
18520 |
+
}
|
18521 |
+
if (!vimGlobalState.macroModeState.isPlaying) {
|
18522 |
+
// Only record if not replaying.
|
18523 |
+
cm.on('change', onChange);
|
18524 |
+
CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
|
18525 |
+
}
|
18526 |
+
if (vim.visualMode) {
|
18527 |
+
exitVisualMode(cm);
|
18528 |
+
}
|
18529 |
+
selectForInsert(cm, head, height);
|
18530 |
+
},
|
18531 |
+
toggleVisualMode: function(cm, actionArgs, vim) {
|
18532 |
+
var repeat = actionArgs.repeat;
|
18533 |
+
var anchor = cm.getCursor();
|
18534 |
+
var head;
|
18535 |
+
// TODO: The repeat should actually select number of characters/lines
|
18536 |
+
// equal to the repeat times the size of the previous visual
|
18537 |
+
// operation.
|
18538 |
+
if (!vim.visualMode) {
|
18539 |
+
// Entering visual mode
|
18540 |
+
vim.visualMode = true;
|
18541 |
+
vim.visualLine = !!actionArgs.linewise;
|
18542 |
+
vim.visualBlock = !!actionArgs.blockwise;
|
18543 |
+
head = clipCursorToContent(
|
18544 |
+
cm, Pos(anchor.line, anchor.ch + repeat - 1),
|
18545 |
+
true /** includeLineBreak */);
|
18546 |
+
vim.sel = {
|
18547 |
+
anchor: anchor,
|
18548 |
+
head: head
|
18549 |
+
};
|
18550 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""});
|
18551 |
+
updateCmSelection(cm);
|
18552 |
+
updateMark(cm, vim, '<', cursorMin(anchor, head));
|
18553 |
+
updateMark(cm, vim, '>', cursorMax(anchor, head));
|
18554 |
+
} else if (vim.visualLine ^ actionArgs.linewise ||
|
18555 |
+
vim.visualBlock ^ actionArgs.blockwise) {
|
18556 |
+
// Toggling between modes
|
18557 |
+
vim.visualLine = !!actionArgs.linewise;
|
18558 |
+
vim.visualBlock = !!actionArgs.blockwise;
|
18559 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""});
|
18560 |
+
updateCmSelection(cm);
|
18561 |
+
} else {
|
18562 |
+
exitVisualMode(cm);
|
18563 |
+
}
|
18564 |
+
},
|
18565 |
+
reselectLastSelection: function(cm, _actionArgs, vim) {
|
18566 |
+
var lastSelection = vim.lastSelection;
|
18567 |
+
if (vim.visualMode) {
|
18568 |
+
updateLastSelection(cm, vim);
|
18569 |
+
}
|
18570 |
+
if (lastSelection) {
|
18571 |
+
var anchor = lastSelection.anchorMark.find();
|
18572 |
+
var head = lastSelection.headMark.find();
|
18573 |
+
if (!anchor || !head) {
|
18574 |
+
// If the marks have been destroyed due to edits, do nothing.
|
18575 |
+
return;
|
18576 |
+
}
|
18577 |
+
vim.sel = {
|
18578 |
+
anchor: anchor,
|
18579 |
+
head: head
|
18580 |
+
};
|
18581 |
+
vim.visualMode = true;
|
18582 |
+
vim.visualLine = lastSelection.visualLine;
|
18583 |
+
vim.visualBlock = lastSelection.visualBlock;
|
18584 |
+
updateCmSelection(cm);
|
18585 |
+
updateMark(cm, vim, '<', cursorMin(anchor, head));
|
18586 |
+
updateMark(cm, vim, '>', cursorMax(anchor, head));
|
18587 |
+
CodeMirror.signal(cm, 'vim-mode-change', {
|
18588 |
+
mode: 'visual',
|
18589 |
+
subMode: vim.visualLine ? 'linewise' :
|
18590 |
+
vim.visualBlock ? 'blockwise' : ''});
|
18591 |
+
}
|
18592 |
+
},
|
18593 |
+
joinLines: function(cm, actionArgs, vim) {
|
18594 |
+
var curStart, curEnd;
|
18595 |
+
if (vim.visualMode) {
|
18596 |
+
curStart = cm.getCursor('anchor');
|
18597 |
+
curEnd = cm.getCursor('head');
|
18598 |
+
if (cursorIsBefore(curEnd, curStart)) {
|
18599 |
+
var tmp = curEnd;
|
18600 |
+
curEnd = curStart;
|
18601 |
+
curStart = tmp;
|
18602 |
+
}
|
18603 |
+
curEnd.ch = lineLength(cm, curEnd.line) - 1;
|
18604 |
+
} else {
|
18605 |
+
// Repeat is the number of lines to join. Minimum 2 lines.
|
18606 |
+
var repeat = Math.max(actionArgs.repeat, 2);
|
18607 |
+
curStart = cm.getCursor();
|
18608 |
+
curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1,
|
18609 |
+
Infinity));
|
18610 |
+
}
|
18611 |
+
var finalCh = 0;
|
18612 |
+
for (var i = curStart.line; i < curEnd.line; i++) {
|
18613 |
+
finalCh = lineLength(cm, curStart.line);
|
18614 |
+
var tmp = Pos(curStart.line + 1,
|
18615 |
+
lineLength(cm, curStart.line + 1));
|
18616 |
+
var text = cm.getRange(curStart, tmp);
|
18617 |
+
text = text.replace(/\n\s*/g, ' ');
|
18618 |
+
cm.replaceRange(text, curStart, tmp);
|
18619 |
+
}
|
18620 |
+
var curFinalPos = Pos(curStart.line, finalCh);
|
18621 |
+
if (vim.visualMode) {
|
18622 |
+
exitVisualMode(cm, false);
|
18623 |
+
}
|
18624 |
+
cm.setCursor(curFinalPos);
|
18625 |
+
},
|
18626 |
+
newLineAndEnterInsertMode: function(cm, actionArgs, vim) {
|
18627 |
+
vim.insertMode = true;
|
18628 |
+
var insertAt = copyCursor(cm.getCursor());
|
18629 |
+
if (insertAt.line === cm.firstLine() && !actionArgs.after) {
|
18630 |
+
// Special case for inserting newline before start of document.
|
18631 |
+
cm.replaceRange('\n', Pos(cm.firstLine(), 0));
|
18632 |
+
cm.setCursor(cm.firstLine(), 0);
|
18633 |
+
} else {
|
18634 |
+
insertAt.line = (actionArgs.after) ? insertAt.line :
|
18635 |
+
insertAt.line - 1;
|
18636 |
+
insertAt.ch = lineLength(cm, insertAt.line);
|
18637 |
+
cm.setCursor(insertAt);
|
18638 |
+
var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||
|
18639 |
+
CodeMirror.commands.newlineAndIndent;
|
18640 |
+
newlineFn(cm);
|
18641 |
+
}
|
18642 |
+
this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);
|
18643 |
+
},
|
18644 |
+
paste: function(cm, actionArgs, vim) {
|
18645 |
+
var cur = copyCursor(cm.getCursor());
|
18646 |
+
var register = vimGlobalState.registerController.getRegister(
|
18647 |
+
actionArgs.registerName);
|
18648 |
+
var text = register.toString();
|
18649 |
+
if (!text) {
|
18650 |
+
return;
|
18651 |
+
}
|
18652 |
+
if (actionArgs.matchIndent) {
|
18653 |
+
var tabSize = cm.getOption("tabSize");
|
18654 |
+
// length that considers tabs and tabSize
|
18655 |
+
var whitespaceLength = function(str) {
|
18656 |
+
var tabs = (str.split("\t").length - 1);
|
18657 |
+
var spaces = (str.split(" ").length - 1);
|
18658 |
+
return tabs * tabSize + spaces * 1;
|
18659 |
+
};
|
18660 |
+
var currentLine = cm.getLine(cm.getCursor().line);
|
18661 |
+
var indent = whitespaceLength(currentLine.match(/^\s*/)[0]);
|
18662 |
+
// chomp last newline b/c don't want it to match /^\s*/gm
|
18663 |
+
var chompedText = text.replace(/\n$/, '');
|
18664 |
+
var wasChomped = text !== chompedText;
|
18665 |
+
var firstIndent = whitespaceLength(text.match(/^\s*/)[0]);
|
18666 |
+
var text = chompedText.replace(/^\s*/gm, function(wspace) {
|
18667 |
+
var newIndent = indent + (whitespaceLength(wspace) - firstIndent);
|
18668 |
+
if (newIndent < 0) {
|
18669 |
+
return "";
|
18670 |
+
}
|
18671 |
+
else if (cm.getOption("indentWithTabs")) {
|
18672 |
+
var quotient = Math.floor(newIndent / tabSize);
|
18673 |
+
return Array(quotient + 1).join('\t');
|
18674 |
+
}
|
18675 |
+
else {
|
18676 |
+
return Array(newIndent + 1).join(' ');
|
18677 |
+
}
|
18678 |
+
});
|
18679 |
+
text += wasChomped ? "\n" : "";
|
18680 |
+
}
|
18681 |
+
if (actionArgs.repeat > 1) {
|
18682 |
+
var text = Array(actionArgs.repeat + 1).join(text);
|
18683 |
+
}
|
18684 |
+
var linewise = register.linewise;
|
18685 |
+
var blockwise = register.blockwise;
|
18686 |
+
if (linewise) {
|
18687 |
+
if(vim.visualMode) {
|
18688 |
+
text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n';
|
18689 |
+
} else if (actionArgs.after) {
|
18690 |
+
// Move the newline at the end to the start instead, and paste just
|
18691 |
+
// before the newline character of the line we are on right now.
|
18692 |
+
text = '\n' + text.slice(0, text.length - 1);
|
18693 |
+
cur.ch = lineLength(cm, cur.line);
|
18694 |
+
} else {
|
18695 |
+
cur.ch = 0;
|
18696 |
+
}
|
18697 |
+
} else {
|
18698 |
+
if (blockwise) {
|
18699 |
+
text = text.split('\n');
|
18700 |
+
for (var i = 0; i < text.length; i++) {
|
18701 |
+
text[i] = (text[i] == '') ? ' ' : text[i];
|
18702 |
+
}
|
18703 |
+
}
|
18704 |
+
cur.ch += actionArgs.after ? 1 : 0;
|
18705 |
+
}
|
18706 |
+
var curPosFinal;
|
18707 |
+
var idx;
|
18708 |
+
if (vim.visualMode) {
|
18709 |
+
// save the pasted text for reselection if the need arises
|
18710 |
+
vim.lastPastedText = text;
|
18711 |
+
var lastSelectionCurEnd;
|
18712 |
+
var selectedArea = getSelectedAreaRange(cm, vim);
|
18713 |
+
var selectionStart = selectedArea[0];
|
18714 |
+
var selectionEnd = selectedArea[1];
|
18715 |
+
var selectedText = cm.getSelection();
|
18716 |
+
var selections = cm.listSelections();
|
18717 |
+
var emptyStrings = new Array(selections.length).join('1').split('1');
|
18718 |
+
// save the curEnd marker before it get cleared due to cm.replaceRange.
|
18719 |
+
if (vim.lastSelection) {
|
18720 |
+
lastSelectionCurEnd = vim.lastSelection.headMark.find();
|
18721 |
+
}
|
18722 |
+
// push the previously selected text to unnamed register
|
18723 |
+
vimGlobalState.registerController.unnamedRegister.setText(selectedText);
|
18724 |
+
if (blockwise) {
|
18725 |
+
// first delete the selected text
|
18726 |
+
cm.replaceSelections(emptyStrings);
|
18727 |
+
// Set new selections as per the block length of the yanked text
|
18728 |
+
selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch);
|
18729 |
+
cm.setCursor(selectionStart);
|
18730 |
+
selectBlock(cm, selectionEnd);
|
18731 |
+
cm.replaceSelections(text);
|
18732 |
+
curPosFinal = selectionStart;
|
18733 |
+
} else if (vim.visualBlock) {
|
18734 |
+
cm.replaceSelections(emptyStrings);
|
18735 |
+
cm.setCursor(selectionStart);
|
18736 |
+
cm.replaceRange(text, selectionStart, selectionStart);
|
18737 |
+
curPosFinal = selectionStart;
|
18738 |
+
} else {
|
18739 |
+
cm.replaceRange(text, selectionStart, selectionEnd);
|
18740 |
+
curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1);
|
18741 |
+
}
|
18742 |
+
// restore the the curEnd marker
|
18743 |
+
if(lastSelectionCurEnd) {
|
18744 |
+
vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd);
|
18745 |
+
}
|
18746 |
+
if (linewise) {
|
18747 |
+
curPosFinal.ch=0;
|
18748 |
+
}
|
18749 |
+
} else {
|
18750 |
+
if (blockwise) {
|
18751 |
+
cm.setCursor(cur);
|
18752 |
+
for (var i = 0; i < text.length; i++) {
|
18753 |
+
var line = cur.line+i;
|
18754 |
+
if (line > cm.lastLine()) {
|
18755 |
+
cm.replaceRange('\n', Pos(line, 0));
|
18756 |
+
}
|
18757 |
+
var lastCh = lineLength(cm, line);
|
18758 |
+
if (lastCh < cur.ch) {
|
18759 |
+
extendLineToColumn(cm, line, cur.ch);
|
18760 |
+
}
|
18761 |
+
}
|
18762 |
+
cm.setCursor(cur);
|
18763 |
+
selectBlock(cm, Pos(cur.line + text.length-1, cur.ch));
|
18764 |
+
cm.replaceSelections(text);
|
18765 |
+
curPosFinal = cur;
|
18766 |
+
} else {
|
18767 |
+
cm.replaceRange(text, cur);
|
18768 |
+
// Now fine tune the cursor to where we want it.
|
18769 |
+
if (linewise && actionArgs.after) {
|
18770 |
+
curPosFinal = Pos(
|
18771 |
+
cur.line + 1,
|
18772 |
+
findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)));
|
18773 |
+
} else if (linewise && !actionArgs.after) {
|
18774 |
+
curPosFinal = Pos(
|
18775 |
+
cur.line,
|
18776 |
+
findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)));
|
18777 |
+
} else if (!linewise && actionArgs.after) {
|
18778 |
+
idx = cm.indexFromPos(cur);
|
18779 |
+
curPosFinal = cm.posFromIndex(idx + text.length - 1);
|
18780 |
+
} else {
|
18781 |
+
idx = cm.indexFromPos(cur);
|
18782 |
+
curPosFinal = cm.posFromIndex(idx + text.length);
|
18783 |
+
}
|
18784 |
+
}
|
18785 |
+
}
|
18786 |
+
if (vim.visualMode) {
|
18787 |
+
exitVisualMode(cm, false);
|
18788 |
+
}
|
18789 |
+
cm.setCursor(curPosFinal);
|
18790 |
+
},
|
18791 |
+
undo: function(cm, actionArgs) {
|
18792 |
+
cm.operation(function() {
|
18793 |
+
repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();
|
18794 |
+
cm.setCursor(cm.getCursor('anchor'));
|
18795 |
+
});
|
18796 |
+
},
|
18797 |
+
redo: function(cm, actionArgs) {
|
18798 |
+
repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();
|
18799 |
+
},
|
18800 |
+
setRegister: function(_cm, actionArgs, vim) {
|
18801 |
+
vim.inputState.registerName = actionArgs.selectedCharacter;
|
18802 |
+
},
|
18803 |
+
setMark: function(cm, actionArgs, vim) {
|
18804 |
+
var markName = actionArgs.selectedCharacter;
|
18805 |
+
updateMark(cm, vim, markName, cm.getCursor());
|
18806 |
+
},
|
18807 |
+
replace: function(cm, actionArgs, vim) {
|
18808 |
+
var replaceWith = actionArgs.selectedCharacter;
|
18809 |
+
var curStart = cm.getCursor();
|
18810 |
+
var replaceTo;
|
18811 |
+
var curEnd;
|
18812 |
+
var selections = cm.listSelections();
|
18813 |
+
if (vim.visualMode) {
|
18814 |
+
curStart = cm.getCursor('start');
|
18815 |
+
curEnd = cm.getCursor('end');
|
18816 |
+
} else {
|
18817 |
+
var line = cm.getLine(curStart.line);
|
18818 |
+
replaceTo = curStart.ch + actionArgs.repeat;
|
18819 |
+
if (replaceTo > line.length) {
|
18820 |
+
replaceTo=line.length;
|
18821 |
+
}
|
18822 |
+
curEnd = Pos(curStart.line, replaceTo);
|
18823 |
+
}
|
18824 |
+
if (replaceWith=='\n') {
|
18825 |
+
if (!vim.visualMode) cm.replaceRange('', curStart, curEnd);
|
18826 |
+
// special case, where vim help says to replace by just one line-break
|
18827 |
+
(CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);
|
18828 |
+
} else {
|
18829 |
+
var replaceWithStr = cm.getRange(curStart, curEnd);
|
18830 |
+
//replace all characters in range by selected, but keep linebreaks
|
18831 |
+
replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith);
|
18832 |
+
if (vim.visualBlock) {
|
18833 |
+
// Tabs are split in visua block before replacing
|
18834 |
+
var spaces = new Array(cm.getOption("tabSize")+1).join(' ');
|
18835 |
+
replaceWithStr = cm.getSelection();
|
18836 |
+
replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n');
|
18837 |
+
cm.replaceSelections(replaceWithStr);
|
18838 |
+
} else {
|
18839 |
+
cm.replaceRange(replaceWithStr, curStart, curEnd);
|
18840 |
+
}
|
18841 |
+
if (vim.visualMode) {
|
18842 |
+
curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ?
|
18843 |
+
selections[0].anchor : selections[0].head;
|
18844 |
+
cm.setCursor(curStart);
|
18845 |
+
exitVisualMode(cm, false);
|
18846 |
+
} else {
|
18847 |
+
cm.setCursor(offsetCursor(curEnd, 0, -1));
|
18848 |
+
}
|
18849 |
+
}
|
18850 |
+
},
|
18851 |
+
incrementNumberToken: function(cm, actionArgs) {
|
18852 |
+
var cur = cm.getCursor();
|
18853 |
+
var lineStr = cm.getLine(cur.line);
|
18854 |
+
var re = /-?\d+/g;
|
18855 |
+
var match;
|
18856 |
+
var start;
|
18857 |
+
var end;
|
18858 |
+
var numberStr;
|
18859 |
+
var token;
|
18860 |
+
while ((match = re.exec(lineStr)) !== null) {
|
18861 |
+
token = match[0];
|
18862 |
+
start = match.index;
|
18863 |
+
end = start + token.length;
|
18864 |
+
if (cur.ch < end)break;
|
18865 |
+
}
|
18866 |
+
if (!actionArgs.backtrack && (end <= cur.ch))return;
|
18867 |
+
if (token) {
|
18868 |
+
var increment = actionArgs.increase ? 1 : -1;
|
18869 |
+
var number = parseInt(token) + (increment * actionArgs.repeat);
|
18870 |
+
var from = Pos(cur.line, start);
|
18871 |
+
var to = Pos(cur.line, end);
|
18872 |
+
numberStr = number.toString();
|
18873 |
+
cm.replaceRange(numberStr, from, to);
|
18874 |
+
} else {
|
18875 |
+
return;
|
18876 |
+
}
|
18877 |
+
cm.setCursor(Pos(cur.line, start + numberStr.length - 1));
|
18878 |
+
},
|
18879 |
+
repeatLastEdit: function(cm, actionArgs, vim) {
|
18880 |
+
var lastEditInputState = vim.lastEditInputState;
|
18881 |
+
if (!lastEditInputState) { return; }
|
18882 |
+
var repeat = actionArgs.repeat;
|
18883 |
+
if (repeat && actionArgs.repeatIsExplicit) {
|
18884 |
+
vim.lastEditInputState.repeatOverride = repeat;
|
18885 |
+
} else {
|
18886 |
+
repeat = vim.lastEditInputState.repeatOverride || repeat;
|
18887 |
+
}
|
18888 |
+
repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);
|
18889 |
+
},
|
18890 |
+
indent: function(cm, actionArgs) {
|
18891 |
+
cm.indentLine(cm.getCursor().line, actionArgs.indentRight);
|
18892 |
+
},
|
18893 |
+
exitInsertMode: exitInsertMode
|
18894 |
+
};
|
18895 |
+
|
18896 |
+
function defineAction(name, fn) {
|
18897 |
+
actions[name] = fn;
|
18898 |
+
}
|
18899 |
+
|
18900 |
+
/*
|
18901 |
+
* Below are miscellaneous utility functions used by vim.js
|
18902 |
+
*/
|
18903 |
+
|
18904 |
+
/**
|
18905 |
+
* Clips cursor to ensure that line is within the buffer's range
|
18906 |
+
* If includeLineBreak is true, then allow cur.ch == lineLength.
|
18907 |
+
*/
|
18908 |
+
function clipCursorToContent(cm, cur, includeLineBreak) {
|
18909 |
+
var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
|
18910 |
+
var maxCh = lineLength(cm, line) - 1;
|
18911 |
+
maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;
|
18912 |
+
var ch = Math.min(Math.max(0, cur.ch), maxCh);
|
18913 |
+
return Pos(line, ch);
|
18914 |
+
}
|
18915 |
+
function copyArgs(args) {
|
18916 |
+
var ret = {};
|
18917 |
+
for (var prop in args) {
|
18918 |
+
if (args.hasOwnProperty(prop)) {
|
18919 |
+
ret[prop] = args[prop];
|
18920 |
+
}
|
18921 |
+
}
|
18922 |
+
return ret;
|
18923 |
+
}
|
18924 |
+
function offsetCursor(cur, offsetLine, offsetCh) {
|
18925 |
+
if (typeof offsetLine === 'object') {
|
18926 |
+
offsetCh = offsetLine.ch;
|
18927 |
+
offsetLine = offsetLine.line;
|
18928 |
+
}
|
18929 |
+
return Pos(cur.line + offsetLine, cur.ch + offsetCh);
|
18930 |
+
}
|
18931 |
+
function getOffset(anchor, head) {
|
18932 |
+
return {
|
18933 |
+
line: head.line - anchor.line,
|
18934 |
+
ch: head.line - anchor.line
|
18935 |
+
};
|
18936 |
+
}
|
18937 |
+
function commandMatches(keys, keyMap, context, inputState) {
|
18938 |
+
// Partial matches are not applied. They inform the key handler
|
18939 |
+
// that the current key sequence is a subsequence of a valid key
|
18940 |
+
// sequence, so that the key buffer is not cleared.
|
18941 |
+
var match, partial = [], full = [];
|
18942 |
+
for (var i = 0; i < keyMap.length; i++) {
|
18943 |
+
var command = keyMap[i];
|
18944 |
+
if (context == 'insert' && command.context != 'insert' ||
|
18945 |
+
command.context && command.context != context ||
|
18946 |
+
inputState.operator && command.type == 'action' ||
|
18947 |
+
!(match = commandMatch(keys, command.keys))) { continue; }
|
18948 |
+
if (match == 'partial') { partial.push(command); }
|
18949 |
+
if (match == 'full') { full.push(command); }
|
18950 |
+
}
|
18951 |
+
return {
|
18952 |
+
partial: partial.length && partial,
|
18953 |
+
full: full.length && full
|
18954 |
+
};
|
18955 |
+
}
|
18956 |
+
function commandMatch(pressed, mapped) {
|
18957 |
+
if (mapped.slice(-11) == '<character>') {
|
18958 |
+
// Last character matches anything.
|
18959 |
+
var prefixLen = mapped.length - 11;
|
18960 |
+
var pressedPrefix = pressed.slice(0, prefixLen);
|
18961 |
+
var mappedPrefix = mapped.slice(0, prefixLen);
|
18962 |
+
return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' :
|
18963 |
+
mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false;
|
18964 |
+
} else {
|
18965 |
+
return pressed == mapped ? 'full' :
|
18966 |
+
mapped.indexOf(pressed) == 0 ? 'partial' : false;
|
18967 |
+
}
|
18968 |
+
}
|
18969 |
+
function lastChar(keys) {
|
18970 |
+
var match = /^.*(<[\w\-]+>)$/.exec(keys);
|
18971 |
+
var selectedCharacter = match ? match[1] : keys.slice(-1);
|
18972 |
+
if (selectedCharacter.length > 1){
|
18973 |
+
switch(selectedCharacter){
|
18974 |
+
case '<CR>':
|
18975 |
+
selectedCharacter='\n';
|
18976 |
+
break;
|
18977 |
+
case '<Space>':
|
18978 |
+
selectedCharacter=' ';
|
18979 |
+
break;
|
18980 |
+
default:
|
18981 |
+
break;
|
18982 |
+
}
|
18983 |
+
}
|
18984 |
+
return selectedCharacter;
|
18985 |
+
}
|
18986 |
+
function repeatFn(cm, fn, repeat) {
|
18987 |
+
return function() {
|
18988 |
+
for (var i = 0; i < repeat; i++) {
|
18989 |
+
fn(cm);
|
18990 |
+
}
|
18991 |
+
};
|
18992 |
+
}
|
18993 |
+
function copyCursor(cur) {
|
18994 |
+
return Pos(cur.line, cur.ch);
|
18995 |
+
}
|
18996 |
+
function cursorEqual(cur1, cur2) {
|
18997 |
+
return cur1.ch == cur2.ch && cur1.line == cur2.line;
|
18998 |
+
}
|
18999 |
+
function cursorIsBefore(cur1, cur2) {
|
19000 |
+
if (cur1.line < cur2.line) {
|
19001 |
+
return true;
|
19002 |
+
}
|
19003 |
+
if (cur1.line == cur2.line && cur1.ch < cur2.ch) {
|
19004 |
+
return true;
|
19005 |
+
}
|
19006 |
+
return false;
|
19007 |
+
}
|
19008 |
+
function cursorMin(cur1, cur2) {
|
19009 |
+
if (arguments.length > 2) {
|
19010 |
+
cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1));
|
19011 |
+
}
|
19012 |
+
return cursorIsBefore(cur1, cur2) ? cur1 : cur2;
|
19013 |
+
}
|
19014 |
+
function cursorMax(cur1, cur2) {
|
19015 |
+
if (arguments.length > 2) {
|
19016 |
+
cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1));
|
19017 |
+
}
|
19018 |
+
return cursorIsBefore(cur1, cur2) ? cur2 : cur1;
|
19019 |
+
}
|
19020 |
+
function cursorIsBetween(cur1, cur2, cur3) {
|
19021 |
+
// returns true if cur2 is between cur1 and cur3.
|
19022 |
+
var cur1before2 = cursorIsBefore(cur1, cur2);
|
19023 |
+
var cur2before3 = cursorIsBefore(cur2, cur3);
|
19024 |
+
return cur1before2 && cur2before3;
|
19025 |
+
}
|
19026 |
+
function lineLength(cm, lineNum) {
|
19027 |
+
return cm.getLine(lineNum).length;
|
19028 |
+
}
|
19029 |
+
function trim(s) {
|
19030 |
+
if (s.trim) {
|
19031 |
+
return s.trim();
|
19032 |
+
}
|
19033 |
+
return s.replace(/^\s+|\s+$/g, '');
|
19034 |
+
}
|
19035 |
+
function escapeRegex(s) {
|
19036 |
+
return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1');
|
19037 |
+
}
|
19038 |
+
function extendLineToColumn(cm, lineNum, column) {
|
19039 |
+
var endCh = lineLength(cm, lineNum);
|
19040 |
+
var spaces = new Array(column-endCh+1).join(' ');
|
19041 |
+
cm.setCursor(Pos(lineNum, endCh));
|
19042 |
+
cm.replaceRange(spaces, cm.getCursor());
|
19043 |
+
}
|
19044 |
+
// This functions selects a rectangular block
|
19045 |
+
// of text with selectionEnd as any of its corner
|
19046 |
+
// Height of block:
|
19047 |
+
// Difference in selectionEnd.line and first/last selection.line
|
19048 |
+
// Width of the block:
|
19049 |
+
// Distance between selectionEnd.ch and any(first considered here) selection.ch
|
19050 |
+
function selectBlock(cm, selectionEnd) {
|
19051 |
+
var selections = [], ranges = cm.listSelections();
|
19052 |
+
var head = copyCursor(cm.clipPos(selectionEnd));
|
19053 |
+
var isClipped = !cursorEqual(selectionEnd, head);
|
19054 |
+
var curHead = cm.getCursor('head');
|
19055 |
+
var primIndex = getIndex(ranges, curHead);
|
19056 |
+
var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor);
|
19057 |
+
var max = ranges.length - 1;
|
19058 |
+
var index = max - primIndex > primIndex ? max : 0;
|
19059 |
+
var base = ranges[index].anchor;
|
19060 |
+
|
19061 |
+
var firstLine = Math.min(base.line, head.line);
|
19062 |
+
var lastLine = Math.max(base.line, head.line);
|
19063 |
+
var baseCh = base.ch, headCh = head.ch;
|
19064 |
+
|
19065 |
+
var dir = ranges[index].head.ch - baseCh;
|
19066 |
+
var newDir = headCh - baseCh;
|
19067 |
+
if (dir > 0 && newDir <= 0) {
|
19068 |
+
baseCh++;
|
19069 |
+
if (!isClipped) { headCh--; }
|
19070 |
+
} else if (dir < 0 && newDir >= 0) {
|
19071 |
+
baseCh--;
|
19072 |
+
if (!wasClipped) { headCh++; }
|
19073 |
+
} else if (dir < 0 && newDir == -1) {
|
19074 |
+
baseCh--;
|
19075 |
+
headCh++;
|
19076 |
+
}
|
19077 |
+
for (var line = firstLine; line <= lastLine; line++) {
|
19078 |
+
var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)};
|
19079 |
+
selections.push(range);
|
19080 |
+
}
|
19081 |
+
primIndex = head.line == lastLine ? selections.length - 1 : 0;
|
19082 |
+
cm.setSelections(selections);
|
19083 |
+
selectionEnd.ch = headCh;
|
19084 |
+
base.ch = baseCh;
|
19085 |
+
return base;
|
19086 |
+
}
|
19087 |
+
function selectForInsert(cm, head, height) {
|
19088 |
+
var sel = [];
|
19089 |
+
for (var i = 0; i < height; i++) {
|
19090 |
+
var lineHead = offsetCursor(head, i, 0);
|
19091 |
+
sel.push({anchor: lineHead, head: lineHead});
|
19092 |
+
}
|
19093 |
+
cm.setSelections(sel, 0);
|
19094 |
+
}
|
19095 |
+
// getIndex returns the index of the cursor in the selections.
|
19096 |
+
function getIndex(ranges, cursor, end) {
|
19097 |
+
for (var i = 0; i < ranges.length; i++) {
|
19098 |
+
var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);
|
19099 |
+
var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);
|
19100 |
+
if (atAnchor || atHead) {
|
19101 |
+
return i;
|
19102 |
+
}
|
19103 |
+
}
|
19104 |
+
return -1;
|
19105 |
+
}
|
19106 |
+
function getSelectedAreaRange(cm, vim) {
|
19107 |
+
var lastSelection = vim.lastSelection;
|
19108 |
+
var getCurrentSelectedAreaRange = function() {
|
19109 |
+
var selections = cm.listSelections();
|
19110 |
+
var start = selections[0];
|
19111 |
+
var end = selections[selections.length-1];
|
19112 |
+
var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head;
|
19113 |
+
var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor;
|
19114 |
+
return [selectionStart, selectionEnd];
|
19115 |
+
};
|
19116 |
+
var getLastSelectedAreaRange = function() {
|
19117 |
+
var selectionStart = cm.getCursor();
|
19118 |
+
var selectionEnd = cm.getCursor();
|
19119 |
+
var block = lastSelection.visualBlock;
|
19120 |
+
if (block) {
|
19121 |
+
var width = block.width;
|
19122 |
+
var height = block.height;
|
19123 |
+
selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width);
|
19124 |
+
var selections = [];
|
19125 |
+
// selectBlock creates a 'proper' rectangular block.
|
19126 |
+
// We do not want that in all cases, so we manually set selections.
|
19127 |
+
for (var i = selectionStart.line; i < selectionEnd.line; i++) {
|
19128 |
+
var anchor = Pos(i, selectionStart.ch);
|
19129 |
+
var head = Pos(i, selectionEnd.ch);
|
19130 |
+
var range = {anchor: anchor, head: head};
|
19131 |
+
selections.push(range);
|
19132 |
+
}
|
19133 |
+
cm.setSelections(selections);
|
19134 |
+
} else {
|
19135 |
+
var start = lastSelection.anchorMark.find();
|
19136 |
+
var end = lastSelection.headMark.find();
|
19137 |
+
var line = end.line - start.line;
|
19138 |
+
var ch = end.ch - start.ch;
|
19139 |
+
selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch};
|
19140 |
+
if (lastSelection.visualLine) {
|
19141 |
+
selectionStart = Pos(selectionStart.line, 0);
|
19142 |
+
selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line));
|
19143 |
+
}
|
19144 |
+
cm.setSelection(selectionStart, selectionEnd);
|
19145 |
+
}
|
19146 |
+
return [selectionStart, selectionEnd];
|
19147 |
+
};
|
19148 |
+
if (!vim.visualMode) {
|
19149 |
+
// In case of replaying the action.
|
19150 |
+
return getLastSelectedAreaRange();
|
19151 |
+
} else {
|
19152 |
+
return getCurrentSelectedAreaRange();
|
19153 |
+
}
|
19154 |
+
}
|
19155 |
+
// Updates the previous selection with the current selection's values. This
|
19156 |
+
// should only be called in visual mode.
|
19157 |
+
function updateLastSelection(cm, vim) {
|
19158 |
+
var anchor = vim.sel.anchor;
|
19159 |
+
var head = vim.sel.head;
|
19160 |
+
// To accommodate the effect of lastPastedText in the last selection
|
19161 |
+
if (vim.lastPastedText) {
|
19162 |
+
head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length);
|
19163 |
+
vim.lastPastedText = null;
|
19164 |
+
}
|
19165 |
+
vim.lastSelection = {'anchorMark': cm.setBookmark(anchor),
|
19166 |
+
'headMark': cm.setBookmark(head),
|
19167 |
+
'anchor': copyCursor(anchor),
|
19168 |
+
'head': copyCursor(head),
|
19169 |
+
'visualMode': vim.visualMode,
|
19170 |
+
'visualLine': vim.visualLine,
|
19171 |
+
'visualBlock': vim.visualBlock};
|
19172 |
+
}
|
19173 |
+
function expandSelection(cm, start, end) {
|
19174 |
+
var sel = cm.state.vim.sel;
|
19175 |
+
var head = sel.head;
|
19176 |
+
var anchor = sel.anchor;
|
19177 |
+
var tmp;
|
19178 |
+
if (cursorIsBefore(end, start)) {
|
19179 |
+
tmp = end;
|
19180 |
+
end = start;
|
19181 |
+
start = tmp;
|
19182 |
+
}
|
19183 |
+
if (cursorIsBefore(head, anchor)) {
|
19184 |
+
head = cursorMin(start, head);
|
19185 |
+
anchor = cursorMax(anchor, end);
|
19186 |
+
} else {
|
19187 |
+
anchor = cursorMin(start, anchor);
|
19188 |
+
head = cursorMax(head, end);
|
19189 |
+
head = offsetCursor(head, 0, -1);
|
19190 |
+
if (head.ch == -1 && head.line != cm.firstLine()) {
|
19191 |
+
head = Pos(head.line - 1, lineLength(cm, head.line - 1));
|
19192 |
+
}
|
19193 |
+
}
|
19194 |
+
return [anchor, head];
|
19195 |
+
}
|
19196 |
+
/**
|
19197 |
+
* Updates the CodeMirror selection to match the provided vim selection.
|
19198 |
+
* If no arguments are given, it uses the current vim selection state.
|
19199 |
+
*/
|
19200 |
+
function updateCmSelection(cm, sel, mode) {
|
19201 |
+
var vim = cm.state.vim;
|
19202 |
+
sel = sel || vim.sel;
|
19203 |
+
var mode = mode ||
|
19204 |
+
vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';
|
19205 |
+
var cmSel = makeCmSelection(cm, sel, mode);
|
19206 |
+
cm.setSelections(cmSel.ranges, cmSel.primary);
|
19207 |
+
updateFakeCursor(cm);
|
19208 |
+
}
|
19209 |
+
function makeCmSelection(cm, sel, mode, exclusive) {
|
19210 |
+
var head = copyCursor(sel.head);
|
19211 |
+
var anchor = copyCursor(sel.anchor);
|
19212 |
+
if (mode == 'char') {
|
19213 |
+
var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;
|
19214 |
+
var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;
|
19215 |
+
head = offsetCursor(sel.head, 0, headOffset);
|
19216 |
+
anchor = offsetCursor(sel.anchor, 0, anchorOffset);
|
19217 |
+
return {
|
19218 |
+
ranges: [{anchor: anchor, head: head}],
|
19219 |
+
primary: 0
|
19220 |
+
};
|
19221 |
+
} else if (mode == 'line') {
|
19222 |
+
if (!cursorIsBefore(sel.head, sel.anchor)) {
|
19223 |
+
anchor.ch = 0;
|
19224 |
+
|
19225 |
+
var lastLine = cm.lastLine();
|
19226 |
+
if (head.line > lastLine) {
|
19227 |
+
head.line = lastLine;
|
19228 |
+
}
|
19229 |
+
head.ch = lineLength(cm, head.line);
|
19230 |
+
} else {
|
19231 |
+
head.ch = 0;
|
19232 |
+
anchor.ch = lineLength(cm, anchor.line);
|
19233 |
+
}
|
19234 |
+
return {
|
19235 |
+
ranges: [{anchor: anchor, head: head}],
|
19236 |
+
primary: 0
|
19237 |
+
};
|
19238 |
+
} else if (mode == 'block') {
|
19239 |
+
var top = Math.min(anchor.line, head.line),
|
19240 |
+
left = Math.min(anchor.ch, head.ch),
|
19241 |
+
bottom = Math.max(anchor.line, head.line),
|
19242 |
+
right = Math.max(anchor.ch, head.ch) + 1;
|
19243 |
+
var height = bottom - top + 1;
|
19244 |
+
var primary = head.line == top ? 0 : height - 1;
|
19245 |
+
var ranges = [];
|
19246 |
+
for (var i = 0; i < height; i++) {
|
19247 |
+
ranges.push({
|
19248 |
+
anchor: Pos(top + i, left),
|
19249 |
+
head: Pos(top + i, right)
|
19250 |
+
});
|
19251 |
+
}
|
19252 |
+
return {
|
19253 |
+
ranges: ranges,
|
19254 |
+
primary: primary
|
19255 |
+
};
|
19256 |
+
}
|
19257 |
+
}
|
19258 |
+
function getHead(cm) {
|
19259 |
+
var cur = cm.getCursor('head');
|
19260 |
+
if (cm.getSelection().length == 1) {
|
19261 |
+
// Small corner case when only 1 character is selected. The "real"
|
19262 |
+
// head is the left of head and anchor.
|
19263 |
+
cur = cursorMin(cur, cm.getCursor('anchor'));
|
19264 |
+
}
|
19265 |
+
return cur;
|
19266 |
+
}
|
19267 |
+
|
19268 |
+
/**
|
19269 |
+
* If moveHead is set to false, the CodeMirror selection will not be
|
19270 |
+
* touched. The caller assumes the responsibility of putting the cursor
|
19271 |
+
* in the right place.
|
19272 |
+
*/
|
19273 |
+
function exitVisualMode(cm, moveHead) {
|
19274 |
+
var vim = cm.state.vim;
|
19275 |
+
if (moveHead !== false) {
|
19276 |
+
cm.setCursor(clipCursorToContent(cm, vim.sel.head));
|
19277 |
+
}
|
19278 |
+
updateLastSelection(cm, vim);
|
19279 |
+
vim.visualMode = false;
|
19280 |
+
vim.visualLine = false;
|
19281 |
+
vim.visualBlock = false;
|
19282 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
|
19283 |
+
if (vim.fakeCursor) {
|
19284 |
+
vim.fakeCursor.clear();
|
19285 |
+
}
|
19286 |
+
}
|
19287 |
+
|
19288 |
+
// Remove any trailing newlines from the selection. For
|
19289 |
+
// example, with the caret at the start of the last word on the line,
|
19290 |
+
// 'dw' should word, but not the newline, while 'w' should advance the
|
19291 |
+
// caret to the first character of the next line.
|
19292 |
+
function clipToLine(cm, curStart, curEnd) {
|
19293 |
+
var selection = cm.getRange(curStart, curEnd);
|
19294 |
+
// Only clip if the selection ends with trailing newline + whitespace
|
19295 |
+
if (/\n\s*$/.test(selection)) {
|
19296 |
+
var lines = selection.split('\n');
|
19297 |
+
// We know this is all whitespace.
|
19298 |
+
lines.pop();
|
19299 |
+
|
19300 |
+
// Cases:
|
19301 |
+
// 1. Last word is an empty line - do not clip the trailing '\n'
|
19302 |
+
// 2. Last word is not an empty line - clip the trailing '\n'
|
19303 |
+
var line;
|
19304 |
+
// Find the line containing the last word, and clip all whitespace up
|
19305 |
+
// to it.
|
19306 |
+
for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {
|
19307 |
+
curEnd.line--;
|
19308 |
+
curEnd.ch = 0;
|
19309 |
+
}
|
19310 |
+
// If the last word is not an empty line, clip an additional newline
|
19311 |
+
if (line) {
|
19312 |
+
curEnd.line--;
|
19313 |
+
curEnd.ch = lineLength(cm, curEnd.line);
|
19314 |
+
} else {
|
19315 |
+
curEnd.ch = 0;
|
19316 |
+
}
|
19317 |
+
}
|
19318 |
+
}
|
19319 |
+
|
19320 |
+
// Expand the selection to line ends.
|
19321 |
+
function expandSelectionToLine(_cm, curStart, curEnd) {
|
19322 |
+
curStart.ch = 0;
|
19323 |
+
curEnd.ch = 0;
|
19324 |
+
curEnd.line++;
|
19325 |
+
}
|
19326 |
+
|
19327 |
+
function findFirstNonWhiteSpaceCharacter(text) {
|
19328 |
+
if (!text) {
|
19329 |
+
return 0;
|
19330 |
+
}
|
19331 |
+
var firstNonWS = text.search(/\S/);
|
19332 |
+
return firstNonWS == -1 ? text.length : firstNonWS;
|
19333 |
+
}
|
19334 |
+
|
19335 |
+
function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {
|
19336 |
+
var cur = getHead(cm);
|
19337 |
+
var line = cm.getLine(cur.line);
|
19338 |
+
var idx = cur.ch;
|
19339 |
+
|
19340 |
+
// Seek to first word or non-whitespace character, depending on if
|
19341 |
+
// noSymbol is true.
|
19342 |
+
var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0];
|
19343 |
+
while (!test(line.charAt(idx))) {
|
19344 |
+
idx++;
|
19345 |
+
if (idx >= line.length) { return null; }
|
19346 |
+
}
|
19347 |
+
|
19348 |
+
if (bigWord) {
|
19349 |
+
test = bigWordCharTest[0];
|
19350 |
+
} else {
|
19351 |
+
test = wordCharTest[0];
|
19352 |
+
if (!test(line.charAt(idx))) {
|
19353 |
+
test = wordCharTest[1];
|
19354 |
+
}
|
19355 |
+
}
|
19356 |
+
|
19357 |
+
var end = idx, start = idx;
|
19358 |
+
while (test(line.charAt(end)) && end < line.length) { end++; }
|
19359 |
+
while (test(line.charAt(start)) && start >= 0) { start--; }
|
19360 |
+
start++;
|
19361 |
+
|
19362 |
+
if (inclusive) {
|
19363 |
+
// If present, include all whitespace after word.
|
19364 |
+
// Otherwise, include all whitespace before word, except indentation.
|
19365 |
+
var wordEnd = end;
|
19366 |
+
while (/\s/.test(line.charAt(end)) && end < line.length) { end++; }
|
19367 |
+
if (wordEnd == end) {
|
19368 |
+
var wordStart = start;
|
19369 |
+
while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; }
|
19370 |
+
if (!start) { start = wordStart; }
|
19371 |
+
}
|
19372 |
+
}
|
19373 |
+
return { start: Pos(cur.line, start), end: Pos(cur.line, end) };
|
19374 |
+
}
|
19375 |
+
|
19376 |
+
function recordJumpPosition(cm, oldCur, newCur) {
|
19377 |
+
if (!cursorEqual(oldCur, newCur)) {
|
19378 |
+
vimGlobalState.jumpList.add(cm, oldCur, newCur);
|
19379 |
+
}
|
19380 |
+
}
|
19381 |
+
|
19382 |
+
function recordLastCharacterSearch(increment, args) {
|
19383 |
+
vimGlobalState.lastCharacterSearch.increment = increment;
|
19384 |
+
vimGlobalState.lastCharacterSearch.forward = args.forward;
|
19385 |
+
vimGlobalState.lastCharacterSearch.selectedCharacter = args.selectedCharacter;
|
19386 |
+
}
|
19387 |
+
|
19388 |
+
var symbolToMode = {
|
19389 |
+
'(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',
|
19390 |
+
'[': 'section', ']': 'section',
|
19391 |
+
'*': 'comment', '/': 'comment',
|
19392 |
+
'm': 'method', 'M': 'method',
|
19393 |
+
'#': 'preprocess'
|
19394 |
+
};
|
19395 |
+
var findSymbolModes = {
|
19396 |
+
bracket: {
|
19397 |
+
isComplete: function(state) {
|
19398 |
+
if (state.nextCh === state.symb) {
|
19399 |
+
state.depth++;
|
19400 |
+
if (state.depth >= 1)return true;
|
19401 |
+
} else if (state.nextCh === state.reverseSymb) {
|
19402 |
+
state.depth--;
|
19403 |
+
}
|
19404 |
+
return false;
|
19405 |
+
}
|
19406 |
+
},
|
19407 |
+
section: {
|
19408 |
+
init: function(state) {
|
19409 |
+
state.curMoveThrough = true;
|
19410 |
+
state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';
|
19411 |
+
},
|
19412 |
+
isComplete: function(state) {
|
19413 |
+
return state.index === 0 && state.nextCh === state.symb;
|
19414 |
+
}
|
19415 |
+
},
|
19416 |
+
comment: {
|
19417 |
+
isComplete: function(state) {
|
19418 |
+
var found = state.lastCh === '*' && state.nextCh === '/';
|
19419 |
+
state.lastCh = state.nextCh;
|
19420 |
+
return found;
|
19421 |
+
}
|
19422 |
+
},
|
19423 |
+
// TODO: The original Vim implementation only operates on level 1 and 2.
|
19424 |
+
// The current implementation doesn't check for code block level and
|
19425 |
+
// therefore it operates on any levels.
|
19426 |
+
method: {
|
19427 |
+
init: function(state) {
|
19428 |
+
state.symb = (state.symb === 'm' ? '{' : '}');
|
19429 |
+
state.reverseSymb = state.symb === '{' ? '}' : '{';
|
19430 |
+
},
|
19431 |
+
isComplete: function(state) {
|
19432 |
+
if (state.nextCh === state.symb)return true;
|
19433 |
+
return false;
|
19434 |
+
}
|
19435 |
+
},
|
19436 |
+
preprocess: {
|
19437 |
+
init: function(state) {
|
19438 |
+
state.index = 0;
|
19439 |
+
},
|
19440 |
+
isComplete: function(state) {
|
19441 |
+
if (state.nextCh === '#') {
|
19442 |
+
var token = state.lineText.match(/#(\w+)/)[1];
|
19443 |
+
if (token === 'endif') {
|
19444 |
+
if (state.forward && state.depth === 0) {
|
19445 |
+
return true;
|
19446 |
+
}
|
19447 |
+
state.depth++;
|
19448 |
+
} else if (token === 'if') {
|
19449 |
+
if (!state.forward && state.depth === 0) {
|
19450 |
+
return true;
|
19451 |
+
}
|
19452 |
+
state.depth--;
|
19453 |
+
}
|
19454 |
+
if (token === 'else' && state.depth === 0)return true;
|
19455 |
+
}
|
19456 |
+
return false;
|
19457 |
+
}
|
19458 |
+
}
|
19459 |
+
};
|
19460 |
+
function findSymbol(cm, repeat, forward, symb) {
|
19461 |
+
var cur = copyCursor(cm.getCursor());
|
19462 |
+
var increment = forward ? 1 : -1;
|
19463 |
+
var endLine = forward ? cm.lineCount() : -1;
|
19464 |
+
var curCh = cur.ch;
|
19465 |
+
var line = cur.line;
|
19466 |
+
var lineText = cm.getLine(line);
|
19467 |
+
var state = {
|
19468 |
+
lineText: lineText,
|
19469 |
+
nextCh: lineText.charAt(curCh),
|
19470 |
+
lastCh: null,
|
19471 |
+
index: curCh,
|
19472 |
+
symb: symb,
|
19473 |
+
reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],
|
19474 |
+
forward: forward,
|
19475 |
+
depth: 0,
|
19476 |
+
curMoveThrough: false
|
19477 |
+
};
|
19478 |
+
var mode = symbolToMode[symb];
|
19479 |
+
if (!mode)return cur;
|
19480 |
+
var init = findSymbolModes[mode].init;
|
19481 |
+
var isComplete = findSymbolModes[mode].isComplete;
|
19482 |
+
if (init) { init(state); }
|
19483 |
+
while (line !== endLine && repeat) {
|
19484 |
+
state.index += increment;
|
19485 |
+
state.nextCh = state.lineText.charAt(state.index);
|
19486 |
+
if (!state.nextCh) {
|
19487 |
+
line += increment;
|
19488 |
+
state.lineText = cm.getLine(line) || '';
|
19489 |
+
if (increment > 0) {
|
19490 |
+
state.index = 0;
|
19491 |
+
} else {
|
19492 |
+
var lineLen = state.lineText.length;
|
19493 |
+
state.index = (lineLen > 0) ? (lineLen-1) : 0;
|
19494 |
+
}
|
19495 |
+
state.nextCh = state.lineText.charAt(state.index);
|
19496 |
+
}
|
19497 |
+
if (isComplete(state)) {
|
19498 |
+
cur.line = line;
|
19499 |
+
cur.ch = state.index;
|
19500 |
+
repeat--;
|
19501 |
+
}
|
19502 |
+
}
|
19503 |
+
if (state.nextCh || state.curMoveThrough) {
|
19504 |
+
return Pos(line, state.index);
|
19505 |
+
}
|
19506 |
+
return cur;
|
19507 |
+
}
|
19508 |
+
|
19509 |
+
/**
|
19510 |
+
* Returns the boundaries of the next word. If the cursor in the middle of
|
19511 |
+
* the word, then returns the boundaries of the current word, starting at
|
19512 |
+
* the cursor. If the cursor is at the start/end of a word, and we are going
|
19513 |
+
* forward/backward, respectively, find the boundaries of the next word.
|
19514 |
+
*
|
19515 |
+
* @param {CodeMirror} cm CodeMirror object.
|
19516 |
+
* @param {Cursor} cur The cursor position.
|
19517 |
+
* @param {boolean} forward True to search forward. False to search
|
19518 |
+
* backward.
|
19519 |
+
* @param {boolean} bigWord True if punctuation count as part of the word.
|
19520 |
+
* False if only [a-zA-Z0-9] characters count as part of the word.
|
19521 |
+
* @param {boolean} emptyLineIsWord True if empty lines should be treated
|
19522 |
+
* as words.
|
19523 |
+
* @return {Object{from:number, to:number, line: number}} The boundaries of
|
19524 |
+
* the word, or null if there are no more words.
|
19525 |
+
*/
|
19526 |
+
function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
|
19527 |
+
var lineNum = cur.line;
|
19528 |
+
var pos = cur.ch;
|
19529 |
+
var line = cm.getLine(lineNum);
|
19530 |
+
var dir = forward ? 1 : -1;
|
19531 |
+
var charTests = bigWord ? bigWordCharTest: wordCharTest;
|
19532 |
+
|
19533 |
+
if (emptyLineIsWord && line == '') {
|
19534 |
+
lineNum += dir;
|
19535 |
+
line = cm.getLine(lineNum);
|
19536 |
+
if (!isLine(cm, lineNum)) {
|
19537 |
+
return null;
|
19538 |
+
}
|
19539 |
+
pos = (forward) ? 0 : line.length;
|
19540 |
+
}
|
19541 |
+
|
19542 |
+
while (true) {
|
19543 |
+
if (emptyLineIsWord && line == '') {
|
19544 |
+
return { from: 0, to: 0, line: lineNum };
|
19545 |
+
}
|
19546 |
+
var stop = (dir > 0) ? line.length : -1;
|
19547 |
+
var wordStart = stop, wordEnd = stop;
|
19548 |
+
// Find bounds of next word.
|
19549 |
+
while (pos != stop) {
|
19550 |
+
var foundWord = false;
|
19551 |
+
for (var i = 0; i < charTests.length && !foundWord; ++i) {
|
19552 |
+
if (charTests[i](line.charAt(pos))) {
|
19553 |
+
wordStart = pos;
|
19554 |
+
// Advance to end of word.
|
19555 |
+
while (pos != stop && charTests[i](line.charAt(pos))) {
|
19556 |
+
pos += dir;
|
19557 |
+
}
|
19558 |
+
wordEnd = pos;
|
19559 |
+
foundWord = wordStart != wordEnd;
|
19560 |
+
if (wordStart == cur.ch && lineNum == cur.line &&
|
19561 |
+
wordEnd == wordStart + dir) {
|
19562 |
+
// We started at the end of a word. Find the next one.
|
19563 |
+
continue;
|
19564 |
+
} else {
|
19565 |
+
return {
|
19566 |
+
from: Math.min(wordStart, wordEnd + 1),
|
19567 |
+
to: Math.max(wordStart, wordEnd),
|
19568 |
+
line: lineNum };
|
19569 |
+
}
|
19570 |
+
}
|
19571 |
+
}
|
19572 |
+
if (!foundWord) {
|
19573 |
+
pos += dir;
|
19574 |
+
}
|
19575 |
+
}
|
19576 |
+
// Advance to next/prev line.
|
19577 |
+
lineNum += dir;
|
19578 |
+
if (!isLine(cm, lineNum)) {
|
19579 |
+
return null;
|
19580 |
+
}
|
19581 |
+
line = cm.getLine(lineNum);
|
19582 |
+
pos = (dir > 0) ? 0 : line.length;
|
19583 |
+
}
|
19584 |
+
}
|
19585 |
+
|
19586 |
+
/**
|
19587 |
+
* @param {CodeMirror} cm CodeMirror object.
|
19588 |
+
* @param {Pos} cur The position to start from.
|
19589 |
+
* @param {int} repeat Number of words to move past.
|
19590 |
+
* @param {boolean} forward True to search forward. False to search
|
19591 |
+
* backward.
|
19592 |
+
* @param {boolean} wordEnd True to move to end of word. False to move to
|
19593 |
+
* beginning of word.
|
19594 |
+
* @param {boolean} bigWord True if punctuation count as part of the word.
|
19595 |
+
* False if only alphabet characters count as part of the word.
|
19596 |
+
* @return {Cursor} The position the cursor should move to.
|
19597 |
+
*/
|
19598 |
+
function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) {
|
19599 |
+
var curStart = copyCursor(cur);
|
19600 |
+
var words = [];
|
19601 |
+
if (forward && !wordEnd || !forward && wordEnd) {
|
19602 |
+
repeat++;
|
19603 |
+
}
|
19604 |
+
// For 'e', empty lines are not considered words, go figure.
|
19605 |
+
var emptyLineIsWord = !(forward && wordEnd);
|
19606 |
+
for (var i = 0; i < repeat; i++) {
|
19607 |
+
var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);
|
19608 |
+
if (!word) {
|
19609 |
+
var eodCh = lineLength(cm, cm.lastLine());
|
19610 |
+
words.push(forward
|
19611 |
+
? {line: cm.lastLine(), from: eodCh, to: eodCh}
|
19612 |
+
: {line: 0, from: 0, to: 0});
|
19613 |
+
break;
|
19614 |
+
}
|
19615 |
+
words.push(word);
|
19616 |
+
cur = Pos(word.line, forward ? (word.to - 1) : word.from);
|
19617 |
+
}
|
19618 |
+
var shortCircuit = words.length != repeat;
|
19619 |
+
var firstWord = words[0];
|
19620 |
+
var lastWord = words.pop();
|
19621 |
+
if (forward && !wordEnd) {
|
19622 |
+
// w
|
19623 |
+
if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {
|
19624 |
+
// We did not start in the middle of a word. Discard the extra word at the end.
|
19625 |
+
lastWord = words.pop();
|
19626 |
+
}
|
19627 |
+
return Pos(lastWord.line, lastWord.from);
|
19628 |
+
} else if (forward && wordEnd) {
|
19629 |
+
return Pos(lastWord.line, lastWord.to - 1);
|
19630 |
+
} else if (!forward && wordEnd) {
|
19631 |
+
// ge
|
19632 |
+
if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
|
19633 |
+
// We did not start in the middle of a word. Discard the extra word at the end.
|
19634 |
+
lastWord = words.pop();
|
19635 |
+
}
|
19636 |
+
return Pos(lastWord.line, lastWord.to);
|
19637 |
+
} else {
|
19638 |
+
// b
|
19639 |
+
return Pos(lastWord.line, lastWord.from);
|
19640 |
+
}
|
19641 |
+
}
|
19642 |
+
|
19643 |
+
function moveToCharacter(cm, repeat, forward, character) {
|
19644 |
+
var cur = cm.getCursor();
|
19645 |
+
var start = cur.ch;
|
19646 |
+
var idx;
|
19647 |
+
for (var i = 0; i < repeat; i ++) {
|
19648 |
+
var line = cm.getLine(cur.line);
|
19649 |
+
idx = charIdxInLine(start, line, character, forward, true);
|
19650 |
+
if (idx == -1) {
|
19651 |
+
return null;
|
19652 |
+
}
|
19653 |
+
start = idx;
|
19654 |
+
}
|
19655 |
+
return Pos(cm.getCursor().line, idx);
|
19656 |
+
}
|
19657 |
+
|
19658 |
+
function moveToColumn(cm, repeat) {
|
19659 |
+
// repeat is always >= 1, so repeat - 1 always corresponds
|
19660 |
+
// to the column we want to go to.
|
19661 |
+
var line = cm.getCursor().line;
|
19662 |
+
return clipCursorToContent(cm, Pos(line, repeat - 1));
|
19663 |
+
}
|
19664 |
+
|
19665 |
+
function updateMark(cm, vim, markName, pos) {
|
19666 |
+
if (!inArray(markName, validMarks)) {
|
19667 |
+
return;
|
19668 |
+
}
|
19669 |
+
if (vim.marks[markName]) {
|
19670 |
+
vim.marks[markName].clear();
|
19671 |
+
}
|
19672 |
+
vim.marks[markName] = cm.setBookmark(pos);
|
19673 |
+
}
|
19674 |
+
|
19675 |
+
function charIdxInLine(start, line, character, forward, includeChar) {
|
19676 |
+
// Search for char in line.
|
19677 |
+
// motion_options: {forward, includeChar}
|
19678 |
+
// If includeChar = true, include it too.
|
19679 |
+
// If forward = true, search forward, else search backwards.
|
19680 |
+
// If char is not found on this line, do nothing
|
19681 |
+
var idx;
|
19682 |
+
if (forward) {
|
19683 |
+
idx = line.indexOf(character, start + 1);
|
19684 |
+
if (idx != -1 && !includeChar) {
|
19685 |
+
idx -= 1;
|
19686 |
+
}
|
19687 |
+
} else {
|
19688 |
+
idx = line.lastIndexOf(character, start - 1);
|
19689 |
+
if (idx != -1 && !includeChar) {
|
19690 |
+
idx += 1;
|
19691 |
+
}
|
19692 |
+
}
|
19693 |
+
return idx;
|
19694 |
+
}
|
19695 |
+
|
19696 |
+
function findParagraph(cm, head, repeat, dir, inclusive) {
|
19697 |
+
var line = head.line;
|
19698 |
+
var min = cm.firstLine();
|
19699 |
+
var max = cm.lastLine();
|
19700 |
+
var start, end, i = line;
|
19701 |
+
function isEmpty(i) { return !cm.getLine(i); }
|
19702 |
+
function isBoundary(i, dir, any) {
|
19703 |
+
if (any) { return isEmpty(i) != isEmpty(i + dir); }
|
19704 |
+
return !isEmpty(i) && isEmpty(i + dir);
|
19705 |
+
}
|
19706 |
+
if (dir) {
|
19707 |
+
while (min <= i && i <= max && repeat > 0) {
|
19708 |
+
if (isBoundary(i, dir)) { repeat--; }
|
19709 |
+
i += dir;
|
19710 |
+
}
|
19711 |
+
return new Pos(i, 0);
|
19712 |
+
}
|
19713 |
+
|
19714 |
+
var vim = cm.state.vim;
|
19715 |
+
if (vim.visualLine && isBoundary(line, 1, true)) {
|
19716 |
+
var anchor = vim.sel.anchor;
|
19717 |
+
if (isBoundary(anchor.line, -1, true)) {
|
19718 |
+
if (!inclusive || anchor.line != line) {
|
19719 |
+
line += 1;
|
19720 |
+
}
|
19721 |
+
}
|
19722 |
+
}
|
19723 |
+
var startState = isEmpty(line);
|
19724 |
+
for (i = line; i <= max && repeat; i++) {
|
19725 |
+
if (isBoundary(i, 1, true)) {
|
19726 |
+
if (!inclusive || isEmpty(i) != startState) {
|
19727 |
+
repeat--;
|
19728 |
+
}
|
19729 |
+
}
|
19730 |
+
}
|
19731 |
+
end = new Pos(i, 0);
|
19732 |
+
// select boundary before paragraph for the last one
|
19733 |
+
if (i > max && !startState) { startState = true; }
|
19734 |
+
else { inclusive = false; }
|
19735 |
+
for (i = line; i > min; i--) {
|
19736 |
+
if (!inclusive || isEmpty(i) == startState || i == line) {
|
19737 |
+
if (isBoundary(i, -1, true)) { break; }
|
19738 |
+
}
|
19739 |
+
}
|
19740 |
+
start = new Pos(i, 0);
|
19741 |
+
return { start: start, end: end };
|
19742 |
+
}
|
19743 |
+
|
19744 |
+
// TODO: perhaps this finagling of start and end positions belonds
|
19745 |
+
// in codemirror/replaceRange?
|
19746 |
+
function selectCompanionObject(cm, head, symb, inclusive) {
|
19747 |
+
var cur = head, start, end;
|
19748 |
+
|
19749 |
+
var bracketRegexp = ({
|
19750 |
+
'(': /[()]/, ')': /[()]/,
|
19751 |
+
'[': /[[\]]/, ']': /[[\]]/,
|
19752 |
+
'{': /[{}]/, '}': /[{}]/})[symb];
|
19753 |
+
var openSym = ({
|
19754 |
+
'(': '(', ')': '(',
|
19755 |
+
'[': '[', ']': '[',
|
19756 |
+
'{': '{', '}': '{'})[symb];
|
19757 |
+
var curChar = cm.getLine(cur.line).charAt(cur.ch);
|
19758 |
+
// Due to the behavior of scanForBracket, we need to add an offset if the
|
19759 |
+
// cursor is on a matching open bracket.
|
19760 |
+
var offset = curChar === openSym ? 1 : 0;
|
19761 |
+
|
19762 |
+
start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp});
|
19763 |
+
end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp});
|
19764 |
+
|
19765 |
+
if (!start || !end) {
|
19766 |
+
return { start: cur, end: cur };
|
19767 |
+
}
|
19768 |
+
|
19769 |
+
start = start.pos;
|
19770 |
+
end = end.pos;
|
19771 |
+
|
19772 |
+
if ((start.line == end.line && start.ch > end.ch)
|
19773 |
+
|| (start.line > end.line)) {
|
19774 |
+
var tmp = start;
|
19775 |
+
start = end;
|
19776 |
+
end = tmp;
|
19777 |
+
}
|
19778 |
+
|
19779 |
+
if (inclusive) {
|
19780 |
+
end.ch += 1;
|
19781 |
+
} else {
|
19782 |
+
start.ch += 1;
|
19783 |
+
}
|
19784 |
+
|
19785 |
+
return { start: start, end: end };
|
19786 |
+
}
|
19787 |
+
|
19788 |
+
// Takes in a symbol and a cursor and tries to simulate text objects that
|
19789 |
+
// have identical opening and closing symbols
|
19790 |
+
// TODO support across multiple lines
|
19791 |
+
function findBeginningAndEnd(cm, head, symb, inclusive) {
|
19792 |
+
var cur = copyCursor(head);
|
19793 |
+
var line = cm.getLine(cur.line);
|
19794 |
+
var chars = line.split('');
|
19795 |
+
var start, end, i, len;
|
19796 |
+
var firstIndex = chars.indexOf(symb);
|
19797 |
+
|
19798 |
+
// the decision tree is to always look backwards for the beginning first,
|
19799 |
+
// but if the cursor is in front of the first instance of the symb,
|
19800 |
+
// then move the cursor forward
|
19801 |
+
if (cur.ch < firstIndex) {
|
19802 |
+
cur.ch = firstIndex;
|
19803 |
+
// Why is this line even here???
|
19804 |
+
// cm.setCursor(cur.line, firstIndex+1);
|
19805 |
+
}
|
19806 |
+
// otherwise if the cursor is currently on the closing symbol
|
19807 |
+
else if (firstIndex < cur.ch && chars[cur.ch] == symb) {
|
19808 |
+
end = cur.ch; // assign end to the current cursor
|
19809 |
+
--cur.ch; // make sure to look backwards
|
19810 |
+
}
|
19811 |
+
|
19812 |
+
// if we're currently on the symbol, we've got a start
|
19813 |
+
if (chars[cur.ch] == symb && !end) {
|
19814 |
+
start = cur.ch + 1; // assign start to ahead of the cursor
|
19815 |
+
} else {
|
19816 |
+
// go backwards to find the start
|
19817 |
+
for (i = cur.ch; i > -1 && !start; i--) {
|
19818 |
+
if (chars[i] == symb) {
|
19819 |
+
start = i + 1;
|
19820 |
+
}
|
19821 |
+
}
|
19822 |
+
}
|
19823 |
+
|
19824 |
+
// look forwards for the end symbol
|
19825 |
+
if (start && !end) {
|
19826 |
+
for (i = start, len = chars.length; i < len && !end; i++) {
|
19827 |
+
if (chars[i] == symb) {
|
19828 |
+
end = i;
|
19829 |
+
}
|
19830 |
+
}
|
19831 |
+
}
|
19832 |
+
|
19833 |
+
// nothing found
|
19834 |
+
if (!start || !end) {
|
19835 |
+
return { start: cur, end: cur };
|
19836 |
+
}
|
19837 |
+
|
19838 |
+
// include the symbols
|
19839 |
+
if (inclusive) {
|
19840 |
+
--start; ++end;
|
19841 |
+
}
|
19842 |
+
|
19843 |
+
return {
|
19844 |
+
start: Pos(cur.line, start),
|
19845 |
+
end: Pos(cur.line, end)
|
19846 |
+
};
|
19847 |
+
}
|
19848 |
+
|
19849 |
+
// Search functions
|
19850 |
+
defineOption('pcre', true, 'boolean');
|
19851 |
+
function SearchState() {}
|
19852 |
+
SearchState.prototype = {
|
19853 |
+
getQuery: function() {
|
19854 |
+
return vimGlobalState.query;
|
19855 |
+
},
|
19856 |
+
setQuery: function(query) {
|
19857 |
+
vimGlobalState.query = query;
|
19858 |
+
},
|
19859 |
+
getOverlay: function() {
|
19860 |
+
return this.searchOverlay;
|
19861 |
+
},
|
19862 |
+
setOverlay: function(overlay) {
|
19863 |
+
this.searchOverlay = overlay;
|
19864 |
+
},
|
19865 |
+
isReversed: function() {
|
19866 |
+
return vimGlobalState.isReversed;
|
19867 |
+
},
|
19868 |
+
setReversed: function(reversed) {
|
19869 |
+
vimGlobalState.isReversed = reversed;
|
19870 |
+
},
|
19871 |
+
getScrollbarAnnotate: function() {
|
19872 |
+
return this.annotate;
|
19873 |
+
},
|
19874 |
+
setScrollbarAnnotate: function(annotate) {
|
19875 |
+
this.annotate = annotate;
|
19876 |
+
}
|
19877 |
+
};
|
19878 |
+
function getSearchState(cm) {
|
19879 |
+
var vim = cm.state.vim;
|
19880 |
+
return vim.searchState_ || (vim.searchState_ = new SearchState());
|
19881 |
+
}
|
19882 |
+
function dialog(cm, template, shortText, onClose, options) {
|
19883 |
+
if (cm.openDialog) {
|
19884 |
+
cm.openDialog(template, onClose, { bottom: true, value: options.value,
|
19885 |
+
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
|
19886 |
+
selectValueOnOpen: false});
|
19887 |
+
}
|
19888 |
+
else {
|
19889 |
+
onClose(prompt(shortText, ''));
|
19890 |
+
}
|
19891 |
+
}
|
19892 |
+
function splitBySlash(argString) {
|
19893 |
+
var slashes = findUnescapedSlashes(argString) || [];
|
19894 |
+
if (!slashes.length) return [];
|
19895 |
+
var tokens = [];
|
19896 |
+
// in case of strings like foo/bar
|
19897 |
+
if (slashes[0] !== 0) return;
|
19898 |
+
for (var i = 0; i < slashes.length; i++) {
|
19899 |
+
if (typeof slashes[i] == 'number')
|
19900 |
+
tokens.push(argString.substring(slashes[i] + 1, slashes[i+1]));
|
19901 |
+
}
|
19902 |
+
return tokens;
|
19903 |
+
}
|
19904 |
+
|
19905 |
+
function findUnescapedSlashes(str) {
|
19906 |
+
var escapeNextChar = false;
|
19907 |
+
var slashes = [];
|
19908 |
+
for (var i = 0; i < str.length; i++) {
|
19909 |
+
var c = str.charAt(i);
|
19910 |
+
if (!escapeNextChar && c == '/') {
|
19911 |
+
slashes.push(i);
|
19912 |
+
}
|
19913 |
+
escapeNextChar = !escapeNextChar && (c == '\\');
|
19914 |
+
}
|
19915 |
+
return slashes;
|
19916 |
+
}
|
19917 |
+
|
19918 |
+
// Translates a search string from ex (vim) syntax into javascript form.
|
19919 |
+
function translateRegex(str) {
|
19920 |
+
// When these match, add a '\' if unescaped or remove one if escaped.
|
19921 |
+
var specials = '|(){';
|
19922 |
+
// Remove, but never add, a '\' for these.
|
19923 |
+
var unescape = '}';
|
19924 |
+
var escapeNextChar = false;
|
19925 |
+
var out = [];
|
19926 |
+
for (var i = -1; i < str.length; i++) {
|
19927 |
+
var c = str.charAt(i) || '';
|
19928 |
+
var n = str.charAt(i+1) || '';
|
19929 |
+
var specialComesNext = (n && specials.indexOf(n) != -1);
|
19930 |
+
if (escapeNextChar) {
|
19931 |
+
if (c !== '\\' || !specialComesNext) {
|
19932 |
+
out.push(c);
|
19933 |
+
}
|
19934 |
+
escapeNextChar = false;
|
19935 |
+
} else {
|
19936 |
+
if (c === '\\') {
|
19937 |
+
escapeNextChar = true;
|
19938 |
+
// Treat the unescape list as special for removing, but not adding '\'.
|
19939 |
+
if (n && unescape.indexOf(n) != -1) {
|
19940 |
+
specialComesNext = true;
|
19941 |
+
}
|
19942 |
+
// Not passing this test means removing a '\'.
|
19943 |
+
if (!specialComesNext || n === '\\') {
|
19944 |
+
out.push(c);
|
19945 |
+
}
|
19946 |
+
} else {
|
19947 |
+
out.push(c);
|
19948 |
+
if (specialComesNext && n !== '\\') {
|
19949 |
+
out.push('\\');
|
19950 |
+
}
|
19951 |
+
}
|
19952 |
+
}
|
19953 |
+
}
|
19954 |
+
return out.join('');
|
19955 |
+
}
|
19956 |
+
|
19957 |
+
// Translates the replace part of a search and replace from ex (vim) syntax into
|
19958 |
+
// javascript form. Similar to translateRegex, but additionally fixes back references
|
19959 |
+
// (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'.
|
19960 |
+
var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'};
|
19961 |
+
function translateRegexReplace(str) {
|
19962 |
+
var escapeNextChar = false;
|
19963 |
+
var out = [];
|
19964 |
+
for (var i = -1; i < str.length; i++) {
|
19965 |
+
var c = str.charAt(i) || '';
|
19966 |
+
var n = str.charAt(i+1) || '';
|
19967 |
+
if (charUnescapes[c + n]) {
|
19968 |
+
out.push(charUnescapes[c+n]);
|
19969 |
+
i++;
|
19970 |
+
} else if (escapeNextChar) {
|
19971 |
+
// At any point in the loop, escapeNextChar is true if the previous
|
19972 |
+
// character was a '\' and was not escaped.
|
19973 |
+
out.push(c);
|
19974 |
+
escapeNextChar = false;
|
19975 |
+
} else {
|
19976 |
+
if (c === '\\') {
|
19977 |
+
escapeNextChar = true;
|
19978 |
+
if ((isNumber(n) || n === '$')) {
|
19979 |
+
out.push('$');
|
19980 |
+
} else if (n !== '/' && n !== '\\') {
|
19981 |
+
out.push('\\');
|
19982 |
+
}
|
19983 |
+
} else {
|
19984 |
+
if (c === '$') {
|
19985 |
+
out.push('$');
|
19986 |
+
}
|
19987 |
+
out.push(c);
|
19988 |
+
if (n === '/') {
|
19989 |
+
out.push('\\');
|
19990 |
+
}
|
19991 |
+
}
|
19992 |
+
}
|
19993 |
+
}
|
19994 |
+
return out.join('');
|
19995 |
+
}
|
19996 |
+
|
19997 |
+
// Unescape \ and / in the replace part, for PCRE mode.
|
19998 |
+
var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'};
|
19999 |
+
function unescapeRegexReplace(str) {
|
20000 |
+
var stream = new CodeMirror.StringStream(str);
|
20001 |
+
var output = [];
|
20002 |
+
while (!stream.eol()) {
|
20003 |
+
// Search for \.
|
20004 |
+
while (stream.peek() && stream.peek() != '\\') {
|
20005 |
+
output.push(stream.next());
|
20006 |
+
}
|
20007 |
+
var matched = false;
|
20008 |
+
for (var matcher in unescapes) {
|
20009 |
+
if (stream.match(matcher, true)) {
|
20010 |
+
matched = true;
|
20011 |
+
output.push(unescapes[matcher]);
|
20012 |
+
break;
|
20013 |
+
}
|
20014 |
+
}
|
20015 |
+
if (!matched) {
|
20016 |
+
// Don't change anything
|
20017 |
+
output.push(stream.next());
|
20018 |
+
}
|
20019 |
+
}
|
20020 |
+
return output.join('');
|
20021 |
+
}
|
20022 |
+
|
20023 |
+
/**
|
20024 |
+
* Extract the regular expression from the query and return a Regexp object.
|
20025 |
+
* Returns null if the query is blank.
|
20026 |
+
* If ignoreCase is passed in, the Regexp object will have the 'i' flag set.
|
20027 |
+
* If smartCase is passed in, and the query contains upper case letters,
|
20028 |
+
* then ignoreCase is overridden, and the 'i' flag will not be set.
|
20029 |
+
* If the query contains the /i in the flag part of the regular expression,
|
20030 |
+
* then both ignoreCase and smartCase are ignored, and 'i' will be passed
|
20031 |
+
* through to the Regex object.
|
20032 |
+
*/
|
20033 |
+
function parseQuery(query, ignoreCase, smartCase) {
|
20034 |
+
// First update the last search register
|
20035 |
+
var lastSearchRegister = vimGlobalState.registerController.getRegister('/');
|
20036 |
+
lastSearchRegister.setText(query);
|
20037 |
+
// Check if the query is already a regex.
|
20038 |
+
if (query instanceof RegExp) { return query; }
|
20039 |
+
// First try to extract regex + flags from the input. If no flags found,
|
20040 |
+
// extract just the regex. IE does not accept flags directly defined in
|
20041 |
+
// the regex string in the form /regex/flags
|
20042 |
+
var slashes = findUnescapedSlashes(query);
|
20043 |
+
var regexPart;
|
20044 |
+
var forceIgnoreCase;
|
20045 |
+
if (!slashes.length) {
|
20046 |
+
// Query looks like 'regexp'
|
20047 |
+
regexPart = query;
|
20048 |
+
} else {
|
20049 |
+
// Query looks like 'regexp/...'
|
20050 |
+
regexPart = query.substring(0, slashes[0]);
|
20051 |
+
var flagsPart = query.substring(slashes[0]);
|
20052 |
+
forceIgnoreCase = (flagsPart.indexOf('i') != -1);
|
20053 |
+
}
|
20054 |
+
if (!regexPart) {
|
20055 |
+
return null;
|
20056 |
+
}
|
20057 |
+
if (!getOption('pcre')) {
|
20058 |
+
regexPart = translateRegex(regexPart);
|
20059 |
+
}
|
20060 |
+
if (smartCase) {
|
20061 |
+
ignoreCase = (/^[^A-Z]*$/).test(regexPart);
|
20062 |
+
}
|
20063 |
+
var regexp = new RegExp(regexPart,
|
20064 |
+
(ignoreCase || forceIgnoreCase) ? 'i' : undefined);
|
20065 |
+
return regexp;
|
20066 |
+
}
|
20067 |
+
function showConfirm(cm, text) {
|
20068 |
+
if (cm.openNotification) {
|
20069 |
+
cm.openNotification('<span style="color: red">' + text + '</span>',
|
20070 |
+
{bottom: true, duration: 5000});
|
20071 |
+
} else {
|
20072 |
+
alert(text);
|
20073 |
+
}
|
20074 |
+
}
|
20075 |
+
function makePrompt(prefix, desc) {
|
20076 |
+
var raw = '<span style="font-family: monospace; white-space: pre">' +
|
20077 |
+
(prefix || "") + '<input type="text"></span>';
|
20078 |
+
if (desc)
|
20079 |
+
raw += ' <span style="color: #888">' + desc + '</span>';
|
20080 |
+
return raw;
|
20081 |
+
}
|
20082 |
+
var searchPromptDesc = '(Javascript regexp)';
|
20083 |
+
function showPrompt(cm, options) {
|
20084 |
+
var shortText = (options.prefix || '') + ' ' + (options.desc || '');
|
20085 |
+
var prompt = makePrompt(options.prefix, options.desc);
|
20086 |
+
dialog(cm, prompt, shortText, options.onClose, options);
|
20087 |
+
}
|
20088 |
+
function regexEqual(r1, r2) {
|
20089 |
+
if (r1 instanceof RegExp && r2 instanceof RegExp) {
|
20090 |
+
var props = ['global', 'multiline', 'ignoreCase', 'source'];
|
20091 |
+
for (var i = 0; i < props.length; i++) {
|
20092 |
+
var prop = props[i];
|
20093 |
+
if (r1[prop] !== r2[prop]) {
|
20094 |
+
return false;
|
20095 |
+
}
|
20096 |
+
}
|
20097 |
+
return true;
|
20098 |
+
}
|
20099 |
+
return false;
|
20100 |
+
}
|
20101 |
+
// Returns true if the query is valid.
|
20102 |
+
function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {
|
20103 |
+
if (!rawQuery) {
|
20104 |
+
return;
|
20105 |
+
}
|
20106 |
+
var state = getSearchState(cm);
|
20107 |
+
var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);
|
20108 |
+
if (!query) {
|
20109 |
+
return;
|
20110 |
+
}
|
20111 |
+
highlightSearchMatches(cm, query);
|
20112 |
+
if (regexEqual(query, state.getQuery())) {
|
20113 |
+
return query;
|
20114 |
+
}
|
20115 |
+
state.setQuery(query);
|
20116 |
+
return query;
|
20117 |
+
}
|
20118 |
+
function searchOverlay(query) {
|
20119 |
+
if (query.source.charAt(0) == '^') {
|
20120 |
+
var matchSol = true;
|
20121 |
+
}
|
20122 |
+
return {
|
20123 |
+
token: function(stream) {
|
20124 |
+
if (matchSol && !stream.sol()) {
|
20125 |
+
stream.skipToEnd();
|
20126 |
+
return;
|
20127 |
+
}
|
20128 |
+
var match = stream.match(query, false);
|
20129 |
+
if (match) {
|
20130 |
+
if (match[0].length == 0) {
|
20131 |
+
// Matched empty string, skip to next.
|
20132 |
+
stream.next();
|
20133 |
+
return 'searching';
|
20134 |
+
}
|
20135 |
+
if (!stream.sol()) {
|
20136 |
+
// Backtrack 1 to match \b
|
20137 |
+
stream.backUp(1);
|
20138 |
+
if (!query.exec(stream.next() + match[0])) {
|
20139 |
+
stream.next();
|
20140 |
+
return null;
|
20141 |
+
}
|
20142 |
+
}
|
20143 |
+
stream.match(query);
|
20144 |
+
return 'searching';
|
20145 |
+
}
|
20146 |
+
while (!stream.eol()) {
|
20147 |
+
stream.next();
|
20148 |
+
if (stream.match(query, false)) break;
|
20149 |
+
}
|
20150 |
+
},
|
20151 |
+
query: query
|
20152 |
+
};
|
20153 |
+
}
|
20154 |
+
function highlightSearchMatches(cm, query) {
|
20155 |
+
var searchState = getSearchState(cm);
|
20156 |
+
var overlay = searchState.getOverlay();
|
20157 |
+
if (!overlay || query != overlay.query) {
|
20158 |
+
if (overlay) {
|
20159 |
+
cm.removeOverlay(overlay);
|
20160 |
+
}
|
20161 |
+
overlay = searchOverlay(query);
|
20162 |
+
cm.addOverlay(overlay);
|
20163 |
+
if (cm.showMatchesOnScrollbar) {
|
20164 |
+
if (searchState.getScrollbarAnnotate()) {
|
20165 |
+
searchState.getScrollbarAnnotate().clear();
|
20166 |
+
}
|
20167 |
+
searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));
|
20168 |
+
}
|
20169 |
+
searchState.setOverlay(overlay);
|
20170 |
+
}
|
20171 |
+
}
|
20172 |
+
function findNext(cm, prev, query, repeat) {
|
20173 |
+
if (repeat === undefined) { repeat = 1; }
|
20174 |
+
return cm.operation(function() {
|
20175 |
+
var pos = cm.getCursor();
|
20176 |
+
var cursor = cm.getSearchCursor(query, pos);
|
20177 |
+
for (var i = 0; i < repeat; i++) {
|
20178 |
+
var found = cursor.find(prev);
|
20179 |
+
if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); }
|
20180 |
+
if (!found) {
|
20181 |
+
// SearchCursor may have returned null because it hit EOF, wrap
|
20182 |
+
// around and try again.
|
20183 |
+
cursor = cm.getSearchCursor(query,
|
20184 |
+
(prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );
|
20185 |
+
if (!cursor.find(prev)) {
|
20186 |
+
return;
|
20187 |
+
}
|
20188 |
+
}
|
20189 |
+
}
|
20190 |
+
return cursor.from();
|
20191 |
+
});
|
20192 |
+
}
|
20193 |
+
function clearSearchHighlight(cm) {
|
20194 |
+
var state = getSearchState(cm);
|
20195 |
+
cm.removeOverlay(getSearchState(cm).getOverlay());
|
20196 |
+
state.setOverlay(null);
|
20197 |
+
if (state.getScrollbarAnnotate()) {
|
20198 |
+
state.getScrollbarAnnotate().clear();
|
20199 |
+
state.setScrollbarAnnotate(null);
|
20200 |
+
}
|
20201 |
+
}
|
20202 |
+
/**
|
20203 |
+
* Check if pos is in the specified range, INCLUSIVE.
|
20204 |
+
* Range can be specified with 1 or 2 arguments.
|
20205 |
+
* If the first range argument is an array, treat it as an array of line
|
20206 |
+
* numbers. Match pos against any of the lines.
|
20207 |
+
* If the first range argument is a number,
|
20208 |
+
* if there is only 1 range argument, check if pos has the same line
|
20209 |
+
* number
|
20210 |
+
* if there are 2 range arguments, then check if pos is in between the two
|
20211 |
+
* range arguments.
|
20212 |
+
*/
|
20213 |
+
function isInRange(pos, start, end) {
|
20214 |
+
if (typeof pos != 'number') {
|
20215 |
+
// Assume it is a cursor position. Get the line number.
|
20216 |
+
pos = pos.line;
|
20217 |
+
}
|
20218 |
+
if (start instanceof Array) {
|
20219 |
+
return inArray(pos, start);
|
20220 |
+
} else {
|
20221 |
+
if (end) {
|
20222 |
+
return (pos >= start && pos <= end);
|
20223 |
+
} else {
|
20224 |
+
return pos == start;
|
20225 |
+
}
|
20226 |
+
}
|
20227 |
+
}
|
20228 |
+
function getUserVisibleLines(cm) {
|
20229 |
+
var scrollInfo = cm.getScrollInfo();
|
20230 |
+
var occludeToleranceTop = 6;
|
20231 |
+
var occludeToleranceBottom = 10;
|
20232 |
+
var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local');
|
20233 |
+
var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top;
|
20234 |
+
var to = cm.coordsChar({left:0, top: bottomY}, 'local');
|
20235 |
+
return {top: from.line, bottom: to.line};
|
20236 |
+
}
|
20237 |
+
|
20238 |
+
function getMarkPos(cm, vim, markName) {
|
20239 |
+
if (markName == '\'') {
|
20240 |
+
var history = cm.doc.history.done;
|
20241 |
+
var event = history[history.length - 2];
|
20242 |
+
return event && event.ranges && event.ranges[0].head;
|
20243 |
+
}
|
20244 |
+
|
20245 |
+
var mark = vim.marks[markName];
|
20246 |
+
return mark && mark.find();
|
20247 |
+
}
|
20248 |
+
|
20249 |
+
var ExCommandDispatcher = function() {
|
20250 |
+
this.buildCommandMap_();
|
20251 |
+
};
|
20252 |
+
ExCommandDispatcher.prototype = {
|
20253 |
+
processCommand: function(cm, input, opt_params) {
|
20254 |
+
var that = this;
|
20255 |
+
cm.operation(function () {
|
20256 |
+
cm.curOp.isVimOp = true;
|
20257 |
+
that._processCommand(cm, input, opt_params);
|
20258 |
+
});
|
20259 |
+
},
|
20260 |
+
_processCommand: function(cm, input, opt_params) {
|
20261 |
+
var vim = cm.state.vim;
|
20262 |
+
var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');
|
20263 |
+
var previousCommand = commandHistoryRegister.toString();
|
20264 |
+
if (vim.visualMode) {
|
20265 |
+
exitVisualMode(cm);
|
20266 |
+
}
|
20267 |
+
var inputStream = new CodeMirror.StringStream(input);
|
20268 |
+
// update ": with the latest command whether valid or invalid
|
20269 |
+
commandHistoryRegister.setText(input);
|
20270 |
+
var params = opt_params || {};
|
20271 |
+
params.input = input;
|
20272 |
+
try {
|
20273 |
+
this.parseInput_(cm, inputStream, params);
|
20274 |
+
} catch(e) {
|
20275 |
+
showConfirm(cm, e);
|
20276 |
+
throw e;
|
20277 |
+
}
|
20278 |
+
var command;
|
20279 |
+
var commandName;
|
20280 |
+
if (!params.commandName) {
|
20281 |
+
// If only a line range is defined, move to the line.
|
20282 |
+
if (params.line !== undefined) {
|
20283 |
+
commandName = 'move';
|
20284 |
+
}
|
20285 |
+
} else {
|
20286 |
+
command = this.matchCommand_(params.commandName);
|
20287 |
+
if (command) {
|
20288 |
+
commandName = command.name;
|
20289 |
+
if (command.excludeFromCommandHistory) {
|
20290 |
+
commandHistoryRegister.setText(previousCommand);
|
20291 |
+
}
|
20292 |
+
this.parseCommandArgs_(inputStream, params, command);
|
20293 |
+
if (command.type == 'exToKey') {
|
20294 |
+
// Handle Ex to Key mapping.
|
20295 |
+
for (var i = 0; i < command.toKeys.length; i++) {
|
20296 |
+
CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping');
|
20297 |
+
}
|
20298 |
+
return;
|
20299 |
+
} else if (command.type == 'exToEx') {
|
20300 |
+
// Handle Ex to Ex mapping.
|
20301 |
+
this.processCommand(cm, command.toInput);
|
20302 |
+
return;
|
20303 |
+
}
|
20304 |
+
}
|
20305 |
+
}
|
20306 |
+
if (!commandName) {
|
20307 |
+
showConfirm(cm, 'Not an editor command ":' + input + '"');
|
20308 |
+
return;
|
20309 |
+
}
|
20310 |
+
try {
|
20311 |
+
exCommands[commandName](cm, params);
|
20312 |
+
// Possibly asynchronous commands (e.g. substitute, which might have a
|
20313 |
+
// user confirmation), are responsible for calling the callback when
|
20314 |
+
// done. All others have it taken care of for them here.
|
20315 |
+
if ((!command || !command.possiblyAsync) && params.callback) {
|
20316 |
+
params.callback();
|
20317 |
+
}
|
20318 |
+
} catch(e) {
|
20319 |
+
showConfirm(cm, e);
|
20320 |
+
throw e;
|
20321 |
+
}
|
20322 |
+
},
|
20323 |
+
parseInput_: function(cm, inputStream, result) {
|
20324 |
+
inputStream.eatWhile(':');
|
20325 |
+
// Parse range.
|
20326 |
+
if (inputStream.eat('%')) {
|
20327 |
+
result.line = cm.firstLine();
|
20328 |
+
result.lineEnd = cm.lastLine();
|
20329 |
+
} else {
|
20330 |
+
result.line = this.parseLineSpec_(cm, inputStream);
|
20331 |
+
if (result.line !== undefined && inputStream.eat(',')) {
|
20332 |
+
result.lineEnd = this.parseLineSpec_(cm, inputStream);
|
20333 |
+
}
|
20334 |
+
}
|
20335 |
+
|
20336 |
+
// Parse command name.
|
20337 |
+
var commandMatch = inputStream.match(/^(\w+)/);
|
20338 |
+
if (commandMatch) {
|
20339 |
+
result.commandName = commandMatch[1];
|
20340 |
+
} else {
|
20341 |
+
result.commandName = inputStream.match(/.*/)[0];
|
20342 |
+
}
|
20343 |
+
|
20344 |
+
return result;
|
20345 |
+
},
|
20346 |
+
parseLineSpec_: function(cm, inputStream) {
|
20347 |
+
var numberMatch = inputStream.match(/^(\d+)/);
|
20348 |
+
if (numberMatch) {
|
20349 |
+
return parseInt(numberMatch[1], 10) - 1;
|
20350 |
+
}
|
20351 |
+
switch (inputStream.next()) {
|
20352 |
+
case '.':
|
20353 |
+
return cm.getCursor().line;
|
20354 |
+
case '$':
|
20355 |
+
return cm.lastLine();
|
20356 |
+
case '\'':
|
20357 |
+
var markName = inputStream.next();
|
20358 |
+
var markPos = getMarkPos(cm, cm.state.vim, markName);
|
20359 |
+
if (!markPos) throw new Error('Mark not set');
|
20360 |
+
return markPos.line;
|
20361 |
+
default:
|
20362 |
+
inputStream.backUp(1);
|
20363 |
+
return undefined;
|
20364 |
+
}
|
20365 |
+
},
|
20366 |
+
parseCommandArgs_: function(inputStream, params, command) {
|
20367 |
+
if (inputStream.eol()) {
|
20368 |
+
return;
|
20369 |
+
}
|
20370 |
+
params.argString = inputStream.match(/.*/)[0];
|
20371 |
+
// Parse command-line arguments
|
20372 |
+
var delim = command.argDelimiter || /\s+/;
|
20373 |
+
var args = trim(params.argString).split(delim);
|
20374 |
+
if (args.length && args[0]) {
|
20375 |
+
params.args = args;
|
20376 |
+
}
|
20377 |
+
},
|
20378 |
+
matchCommand_: function(commandName) {
|
20379 |
+
// Return the command in the command map that matches the shortest
|
20380 |
+
// prefix of the passed in command name. The match is guaranteed to be
|
20381 |
+
// unambiguous if the defaultExCommandMap's shortNames are set up
|
20382 |
+
// correctly. (see @code{defaultExCommandMap}).
|
20383 |
+
for (var i = commandName.length; i > 0; i--) {
|
20384 |
+
var prefix = commandName.substring(0, i);
|
20385 |
+
if (this.commandMap_[prefix]) {
|
20386 |
+
var command = this.commandMap_[prefix];
|
20387 |
+
if (command.name.indexOf(commandName) === 0) {
|
20388 |
+
return command;
|
20389 |
+
}
|
20390 |
+
}
|
20391 |
+
}
|
20392 |
+
return null;
|
20393 |
+
},
|
20394 |
+
buildCommandMap_: function() {
|
20395 |
+
this.commandMap_ = {};
|
20396 |
+
for (var i = 0; i < defaultExCommandMap.length; i++) {
|
20397 |
+
var command = defaultExCommandMap[i];
|
20398 |
+
var key = command.shortName || command.name;
|
20399 |
+
this.commandMap_[key] = command;
|
20400 |
+
}
|
20401 |
+
},
|
20402 |
+
map: function(lhs, rhs, ctx) {
|
20403 |
+
if (lhs != ':' && lhs.charAt(0) == ':') {
|
20404 |
+
if (ctx) { throw Error('Mode not supported for ex mappings'); }
|
20405 |
+
var commandName = lhs.substring(1);
|
20406 |
+
if (rhs != ':' && rhs.charAt(0) == ':') {
|
20407 |
+
// Ex to Ex mapping
|
20408 |
+
this.commandMap_[commandName] = {
|
20409 |
+
name: commandName,
|
20410 |
+
type: 'exToEx',
|
20411 |
+
toInput: rhs.substring(1),
|
20412 |
+
user: true
|
20413 |
+
};
|
20414 |
+
} else {
|
20415 |
+
// Ex to key mapping
|
20416 |
+
this.commandMap_[commandName] = {
|
20417 |
+
name: commandName,
|
20418 |
+
type: 'exToKey',
|
20419 |
+
toKeys: rhs,
|
20420 |
+
user: true
|
20421 |
+
};
|
20422 |
+
}
|
20423 |
+
} else {
|
20424 |
+
if (rhs != ':' && rhs.charAt(0) == ':') {
|
20425 |
+
// Key to Ex mapping.
|
20426 |
+
var mapping = {
|
20427 |
+
keys: lhs,
|
20428 |
+
type: 'keyToEx',
|
20429 |
+
exArgs: { input: rhs.substring(1) }
|
20430 |
+
};
|
20431 |
+
if (ctx) { mapping.context = ctx; }
|
20432 |
+
defaultKeymap.unshift(mapping);
|
20433 |
+
} else {
|
20434 |
+
// Key to key mapping
|
20435 |
+
var mapping = {
|
20436 |
+
keys: lhs,
|
20437 |
+
type: 'keyToKey',
|
20438 |
+
toKeys: rhs
|
20439 |
+
};
|
20440 |
+
if (ctx) { mapping.context = ctx; }
|
20441 |
+
defaultKeymap.unshift(mapping);
|
20442 |
+
}
|
20443 |
+
}
|
20444 |
+
},
|
20445 |
+
unmap: function(lhs, ctx) {
|
20446 |
+
if (lhs != ':' && lhs.charAt(0) == ':') {
|
20447 |
+
// Ex to Ex or Ex to key mapping
|
20448 |
+
if (ctx) { throw Error('Mode not supported for ex mappings'); }
|
20449 |
+
var commandName = lhs.substring(1);
|
20450 |
+
if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {
|
20451 |
+
delete this.commandMap_[commandName];
|
20452 |
+
return;
|
20453 |
+
}
|
20454 |
+
} else {
|
20455 |
+
// Key to Ex or key to key mapping
|
20456 |
+
var keys = lhs;
|
20457 |
+
for (var i = 0; i < defaultKeymap.length; i++) {
|
20458 |
+
if (keys == defaultKeymap[i].keys
|
20459 |
+
&& defaultKeymap[i].context === ctx) {
|
20460 |
+
defaultKeymap.splice(i, 1);
|
20461 |
+
return;
|
20462 |
+
}
|
20463 |
+
}
|
20464 |
+
}
|
20465 |
+
throw Error('No such mapping.');
|
20466 |
+
}
|
20467 |
+
};
|
20468 |
+
|
20469 |
+
var exCommands = {
|
20470 |
+
colorscheme: function(cm, params) {
|
20471 |
+
if (!params.args || params.args.length < 1) {
|
20472 |
+
showConfirm(cm, cm.getOption('theme'));
|
20473 |
+
return;
|
20474 |
+
}
|
20475 |
+
cm.setOption('theme', params.args[0]);
|
20476 |
+
},
|
20477 |
+
map: function(cm, params, ctx) {
|
20478 |
+
var mapArgs = params.args;
|
20479 |
+
if (!mapArgs || mapArgs.length < 2) {
|
20480 |
+
if (cm) {
|
20481 |
+
showConfirm(cm, 'Invalid mapping: ' + params.input);
|
20482 |
+
}
|
20483 |
+
return;
|
20484 |
+
}
|
20485 |
+
exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx);
|
20486 |
+
},
|
20487 |
+
imap: function(cm, params) { this.map(cm, params, 'insert'); },
|
20488 |
+
nmap: function(cm, params) { this.map(cm, params, 'normal'); },
|
20489 |
+
vmap: function(cm, params) { this.map(cm, params, 'visual'); },
|
20490 |
+
unmap: function(cm, params, ctx) {
|
20491 |
+
var mapArgs = params.args;
|
20492 |
+
if (!mapArgs || mapArgs.length < 1) {
|
20493 |
+
if (cm) {
|
20494 |
+
showConfirm(cm, 'No such mapping: ' + params.input);
|
20495 |
+
}
|
20496 |
+
return;
|
20497 |
+
}
|
20498 |
+
exCommandDispatcher.unmap(mapArgs[0], ctx);
|
20499 |
+
},
|
20500 |
+
move: function(cm, params) {
|
20501 |
+
commandDispatcher.processCommand(cm, cm.state.vim, {
|
20502 |
+
type: 'motion',
|
20503 |
+
motion: 'moveToLineOrEdgeOfDocument',
|
20504 |
+
motionArgs: { forward: false, explicitRepeat: true,
|
20505 |
+
linewise: true },
|
20506 |
+
repeatOverride: params.line+1});
|
20507 |
+
},
|
20508 |
+
set: function(cm, params) {
|
20509 |
+
var setArgs = params.args;
|
20510 |
+
// Options passed through to the setOption/getOption calls. May be passed in by the
|
20511 |
+
// local/global versions of the set command
|
20512 |
+
var setCfg = params.setCfg || {};
|
20513 |
+
if (!setArgs || setArgs.length < 1) {
|
20514 |
+
if (cm) {
|
20515 |
+
showConfirm(cm, 'Invalid mapping: ' + params.input);
|
20516 |
+
}
|
20517 |
+
return;
|
20518 |
+
}
|
20519 |
+
var expr = setArgs[0].split('=');
|
20520 |
+
var optionName = expr[0];
|
20521 |
+
var value = expr[1];
|
20522 |
+
var forceGet = false;
|
20523 |
+
|
20524 |
+
if (optionName.charAt(optionName.length - 1) == '?') {
|
20525 |
+
// If post-fixed with ?, then the set is actually a get.
|
20526 |
+
if (value) { throw Error('Trailing characters: ' + params.argString); }
|
20527 |
+
optionName = optionName.substring(0, optionName.length - 1);
|
20528 |
+
forceGet = true;
|
20529 |
+
}
|
20530 |
+
if (value === undefined && optionName.substring(0, 2) == 'no') {
|
20531 |
+
// To set boolean options to false, the option name is prefixed with
|
20532 |
+
// 'no'.
|
20533 |
+
optionName = optionName.substring(2);
|
20534 |
+
value = false;
|
20535 |
+
}
|
20536 |
+
|
20537 |
+
var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';
|
20538 |
+
if (optionIsBoolean && value == undefined) {
|
20539 |
+
// Calling set with a boolean option sets it to true.
|
20540 |
+
value = true;
|
20541 |
+
}
|
20542 |
+
// If no value is provided, then we assume this is a get.
|
20543 |
+
if (!optionIsBoolean && value === undefined || forceGet) {
|
20544 |
+
var oldValue = getOption(optionName, cm, setCfg);
|
20545 |
+
if (oldValue === true || oldValue === false) {
|
20546 |
+
showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
|
20547 |
+
} else {
|
20548 |
+
showConfirm(cm, ' ' + optionName + '=' + oldValue);
|
20549 |
+
}
|
20550 |
+
} else {
|
20551 |
+
setOption(optionName, value, cm, setCfg);
|
20552 |
+
}
|
20553 |
+
},
|
20554 |
+
setlocal: function (cm, params) {
|
20555 |
+
// setCfg is passed through to setOption
|
20556 |
+
params.setCfg = {scope: 'local'};
|
20557 |
+
this.set(cm, params);
|
20558 |
+
},
|
20559 |
+
setglobal: function (cm, params) {
|
20560 |
+
// setCfg is passed through to setOption
|
20561 |
+
params.setCfg = {scope: 'global'};
|
20562 |
+
this.set(cm, params);
|
20563 |
+
},
|
20564 |
+
registers: function(cm, params) {
|
20565 |
+
var regArgs = params.args;
|
20566 |
+
var registers = vimGlobalState.registerController.registers;
|
20567 |
+
var regInfo = '----------Registers----------<br><br>';
|
20568 |
+
if (!regArgs) {
|
20569 |
+
for (var registerName in registers) {
|
20570 |
+
var text = registers[registerName].toString();
|
20571 |
+
if (text.length) {
|
20572 |
+
regInfo += '"' + registerName + ' ' + text + '<br>';
|
20573 |
+
}
|
20574 |
+
}
|
20575 |
+
} else {
|
20576 |
+
var registerName;
|
20577 |
+
regArgs = regArgs.join('');
|
20578 |
+
for (var i = 0; i < regArgs.length; i++) {
|
20579 |
+
registerName = regArgs.charAt(i);
|
20580 |
+
if (!vimGlobalState.registerController.isValidRegister(registerName)) {
|
20581 |
+
continue;
|
20582 |
+
}
|
20583 |
+
var register = registers[registerName] || new Register();
|
20584 |
+
regInfo += '"' + registerName + ' ' + register.toString() + '<br>';
|
20585 |
+
}
|
20586 |
+
}
|
20587 |
+
showConfirm(cm, regInfo);
|
20588 |
+
},
|
20589 |
+
sort: function(cm, params) {
|
20590 |
+
var reverse, ignoreCase, unique, number, pattern;
|
20591 |
+
function parseArgs() {
|
20592 |
+
if (params.argString) {
|
20593 |
+
var args = new CodeMirror.StringStream(params.argString);
|
20594 |
+
if (args.eat('!')) { reverse = true; }
|
20595 |
+
if (args.eol()) { return; }
|
20596 |
+
if (!args.eatSpace()) { return 'Invalid arguments'; }
|
20597 |
+
var opts = args.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);
|
20598 |
+
if (!opts && !args.eol()) { return 'Invalid arguments'; }
|
20599 |
+
if (opts[1]) {
|
20600 |
+
ignoreCase = opts[1].indexOf('i') != -1;
|
20601 |
+
unique = opts[1].indexOf('u') != -1;
|
20602 |
+
var decimal = opts[1].indexOf('d') != -1 || opts[1].indexOf('n') != -1 && 1;
|
20603 |
+
var hex = opts[1].indexOf('x') != -1 && 1;
|
20604 |
+
var octal = opts[1].indexOf('o') != -1 && 1;
|
20605 |
+
if (decimal + hex + octal > 1) { return 'Invalid arguments'; }
|
20606 |
+
number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
|
20607 |
+
}
|
20608 |
+
if (opts[2]) {
|
20609 |
+
pattern = new RegExp(opts[2].substr(1, opts[2].length - 2), ignoreCase ? 'i' : '');
|
20610 |
+
}
|
20611 |
+
}
|
20612 |
+
}
|
20613 |
+
var err = parseArgs();
|
20614 |
+
if (err) {
|
20615 |
+
showConfirm(cm, err + ': ' + params.argString);
|
20616 |
+
return;
|
20617 |
+
}
|
20618 |
+
var lineStart = params.line || cm.firstLine();
|
20619 |
+
var lineEnd = params.lineEnd || params.line || cm.lastLine();
|
20620 |
+
if (lineStart == lineEnd) { return; }
|
20621 |
+
var curStart = Pos(lineStart, 0);
|
20622 |
+
var curEnd = Pos(lineEnd, lineLength(cm, lineEnd));
|
20623 |
+
var text = cm.getRange(curStart, curEnd).split('\n');
|
20624 |
+
var numberRegex = pattern ? pattern :
|
20625 |
+
(number == 'decimal') ? /(-?)([\d]+)/ :
|
20626 |
+
(number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :
|
20627 |
+
(number == 'octal') ? /([0-7]+)/ : null;
|
20628 |
+
var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;
|
20629 |
+
var numPart = [], textPart = [];
|
20630 |
+
if (number || pattern) {
|
20631 |
+
for (var i = 0; i < text.length; i++) {
|
20632 |
+
var matchPart = pattern ? text[i].match(pattern) : null;
|
20633 |
+
if (matchPart && matchPart[0] != '') {
|
20634 |
+
numPart.push(matchPart);
|
20635 |
+
} else if (!pattern && numberRegex.exec(text[i])) {
|
20636 |
+
numPart.push(text[i]);
|
20637 |
+
} else {
|
20638 |
+
textPart.push(text[i]);
|
20639 |
+
}
|
20640 |
+
}
|
20641 |
+
} else {
|
20642 |
+
textPart = text;
|
20643 |
+
}
|
20644 |
+
function compareFn(a, b) {
|
20645 |
+
if (reverse) { var tmp; tmp = a; a = b; b = tmp; }
|
20646 |
+
if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); }
|
20647 |
+
var anum = number && numberRegex.exec(a);
|
20648 |
+
var bnum = number && numberRegex.exec(b);
|
20649 |
+
if (!anum) { return a < b ? -1 : 1; }
|
20650 |
+
anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);
|
20651 |
+
bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);
|
20652 |
+
return anum - bnum;
|
20653 |
+
}
|
20654 |
+
function comparePatternFn(a, b) {
|
20655 |
+
if (reverse) { var tmp; tmp = a; a = b; b = tmp; }
|
20656 |
+
if (ignoreCase) { a[0] = a[0].toLowerCase(); b[0] = b[0].toLowerCase(); }
|
20657 |
+
return (a[0] < b[0]) ? -1 : 1;
|
20658 |
+
}
|
20659 |
+
numPart.sort(pattern ? comparePatternFn : compareFn);
|
20660 |
+
if (pattern) {
|
20661 |
+
for (var i = 0; i < numPart.length; i++) {
|
20662 |
+
numPart[i] = numPart[i].input;
|
20663 |
+
}
|
20664 |
+
} else if (!number) { textPart.sort(compareFn); }
|
20665 |
+
text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);
|
20666 |
+
if (unique) { // Remove duplicate lines
|
20667 |
+
var textOld = text;
|
20668 |
+
var lastLine;
|
20669 |
+
text = [];
|
20670 |
+
for (var i = 0; i < textOld.length; i++) {
|
20671 |
+
if (textOld[i] != lastLine) {
|
20672 |
+
text.push(textOld[i]);
|
20673 |
+
}
|
20674 |
+
lastLine = textOld[i];
|
20675 |
+
}
|
20676 |
+
}
|
20677 |
+
cm.replaceRange(text.join('\n'), curStart, curEnd);
|
20678 |
+
},
|
20679 |
+
global: function(cm, params) {
|
20680 |
+
// a global command is of the form
|
20681 |
+
// :[range]g/pattern/[cmd]
|
20682 |
+
// argString holds the string /pattern/[cmd]
|
20683 |
+
var argString = params.argString;
|
20684 |
+
if (!argString) {
|
20685 |
+
showConfirm(cm, 'Regular Expression missing from global');
|
20686 |
+
return;
|
20687 |
+
}
|
20688 |
+
// range is specified here
|
20689 |
+
var lineStart = (params.line !== undefined) ? params.line : cm.firstLine();
|
20690 |
+
var lineEnd = params.lineEnd || params.line || cm.lastLine();
|
20691 |
+
// get the tokens from argString
|
20692 |
+
var tokens = splitBySlash(argString);
|
20693 |
+
var regexPart = argString, cmd;
|
20694 |
+
if (tokens.length) {
|
20695 |
+
regexPart = tokens[0];
|
20696 |
+
cmd = tokens.slice(1, tokens.length).join('/');
|
20697 |
+
}
|
20698 |
+
if (regexPart) {
|
20699 |
+
// If regex part is empty, then use the previous query. Otherwise
|
20700 |
+
// use the regex part as the new query.
|
20701 |
+
try {
|
20702 |
+
updateSearchQuery(cm, regexPart, true /** ignoreCase */,
|
20703 |
+
true /** smartCase */);
|
20704 |
+
} catch (e) {
|
20705 |
+
showConfirm(cm, 'Invalid regex: ' + regexPart);
|
20706 |
+
return;
|
20707 |
+
}
|
20708 |
+
}
|
20709 |
+
// now that we have the regexPart, search for regex matches in the
|
20710 |
+
// specified range of lines
|
20711 |
+
var query = getSearchState(cm).getQuery();
|
20712 |
+
var matchedLines = [], content = '';
|
20713 |
+
for (var i = lineStart; i <= lineEnd; i++) {
|
20714 |
+
var matched = query.test(cm.getLine(i));
|
20715 |
+
if (matched) {
|
20716 |
+
matchedLines.push(i+1);
|
20717 |
+
content+= cm.getLine(i) + '<br>';
|
20718 |
+
}
|
20719 |
+
}
|
20720 |
+
// if there is no [cmd], just display the list of matched lines
|
20721 |
+
if (!cmd) {
|
20722 |
+
showConfirm(cm, content);
|
20723 |
+
return;
|
20724 |
+
}
|
20725 |
+
var index = 0;
|
20726 |
+
var nextCommand = function() {
|
20727 |
+
if (index < matchedLines.length) {
|
20728 |
+
var command = matchedLines[index] + cmd;
|
20729 |
+
exCommandDispatcher.processCommand(cm, command, {
|
20730 |
+
callback: nextCommand
|
20731 |
+
});
|
20732 |
+
}
|
20733 |
+
index++;
|
20734 |
+
};
|
20735 |
+
nextCommand();
|
20736 |
+
},
|
20737 |
+
substitute: function(cm, params) {
|
20738 |
+
if (!cm.getSearchCursor) {
|
20739 |
+
throw new Error('Search feature not available. Requires searchcursor.js or ' +
|
20740 |
+
'any other getSearchCursor implementation.');
|
20741 |
+
}
|
20742 |
+
var argString = params.argString;
|
20743 |
+
var tokens = argString ? splitBySlash(argString) : [];
|
20744 |
+
var regexPart, replacePart = '', trailing, flagsPart, count;
|
20745 |
+
var confirm = false; // Whether to confirm each replace.
|
20746 |
+
var global = false; // True to replace all instances on a line, false to replace only 1.
|
20747 |
+
if (tokens.length) {
|
20748 |
+
regexPart = tokens[0];
|
20749 |
+
replacePart = tokens[1];
|
20750 |
+
if (replacePart !== undefined) {
|
20751 |
+
if (getOption('pcre')) {
|
20752 |
+
replacePart = unescapeRegexReplace(replacePart);
|
20753 |
+
} else {
|
20754 |
+
replacePart = translateRegexReplace(replacePart);
|
20755 |
+
}
|
20756 |
+
vimGlobalState.lastSubstituteReplacePart = replacePart;
|
20757 |
+
}
|
20758 |
+
trailing = tokens[2] ? tokens[2].split(' ') : [];
|
20759 |
+
} else {
|
20760 |
+
// either the argString is empty or its of the form ' hello/world'
|
20761 |
+
// actually splitBySlash returns a list of tokens
|
20762 |
+
// only if the string starts with a '/'
|
20763 |
+
if (argString && argString.length) {
|
20764 |
+
showConfirm(cm, 'Substitutions should be of the form ' +
|
20765 |
+
':s/pattern/replace/');
|
20766 |
+
return;
|
20767 |
+
}
|
20768 |
+
}
|
20769 |
+
// After the 3rd slash, we can have flags followed by a space followed
|
20770 |
+
// by count.
|
20771 |
+
if (trailing) {
|
20772 |
+
flagsPart = trailing[0];
|
20773 |
+
count = parseInt(trailing[1]);
|
20774 |
+
if (flagsPart) {
|
20775 |
+
if (flagsPart.indexOf('c') != -1) {
|
20776 |
+
confirm = true;
|
20777 |
+
flagsPart.replace('c', '');
|
20778 |
+
}
|
20779 |
+
if (flagsPart.indexOf('g') != -1) {
|
20780 |
+
global = true;
|
20781 |
+
flagsPart.replace('g', '');
|
20782 |
+
}
|
20783 |
+
regexPart = regexPart + '/' + flagsPart;
|
20784 |
+
}
|
20785 |
+
}
|
20786 |
+
if (regexPart) {
|
20787 |
+
// If regex part is empty, then use the previous query. Otherwise use
|
20788 |
+
// the regex part as the new query.
|
20789 |
+
try {
|
20790 |
+
updateSearchQuery(cm, regexPart, true /** ignoreCase */,
|
20791 |
+
true /** smartCase */);
|
20792 |
+
} catch (e) {
|
20793 |
+
showConfirm(cm, 'Invalid regex: ' + regexPart);
|
20794 |
+
return;
|
20795 |
+
}
|
20796 |
+
}
|
20797 |
+
replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart;
|
20798 |
+
if (replacePart === undefined) {
|
20799 |
+
showConfirm(cm, 'No previous substitute regular expression');
|
20800 |
+
return;
|
20801 |
+
}
|
20802 |
+
var state = getSearchState(cm);
|
20803 |
+
var query = state.getQuery();
|
20804 |
+
var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
|
20805 |
+
var lineEnd = params.lineEnd || lineStart;
|
20806 |
+
if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) {
|
20807 |
+
lineEnd = Infinity;
|
20808 |
+
}
|
20809 |
+
if (count) {
|
20810 |
+
lineStart = lineEnd;
|
20811 |
+
lineEnd = lineStart + count - 1;
|
20812 |
+
}
|
20813 |
+
var startPos = clipCursorToContent(cm, Pos(lineStart, 0));
|
20814 |
+
var cursor = cm.getSearchCursor(query, startPos);
|
20815 |
+
doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback);
|
20816 |
+
},
|
20817 |
+
redo: CodeMirror.commands.redo,
|
20818 |
+
undo: CodeMirror.commands.undo,
|
20819 |
+
write: function(cm) {
|
20820 |
+
if (CodeMirror.commands.save) {
|
20821 |
+
// If a save command is defined, call it.
|
20822 |
+
CodeMirror.commands.save(cm);
|
20823 |
+
} else if (cm.save) {
|
20824 |
+
// Saves to text area if no save command is defined and cm.save() is available.
|
20825 |
+
cm.save();
|
20826 |
+
}
|
20827 |
+
},
|
20828 |
+
nohlsearch: function(cm) {
|
20829 |
+
clearSearchHighlight(cm);
|
20830 |
+
},
|
20831 |
+
yank: function (cm) {
|
20832 |
+
var cur = copyCursor(cm.getCursor());
|
20833 |
+
var line = cur.line;
|
20834 |
+
var lineText = cm.getLine(line);
|
20835 |
+
vimGlobalState.registerController.pushText(
|
20836 |
+
'0', 'yank', lineText, true, true);
|
20837 |
+
},
|
20838 |
+
delmarks: function(cm, params) {
|
20839 |
+
if (!params.argString || !trim(params.argString)) {
|
20840 |
+
showConfirm(cm, 'Argument required');
|
20841 |
+
return;
|
20842 |
+
}
|
20843 |
+
|
20844 |
+
var state = cm.state.vim;
|
20845 |
+
var stream = new CodeMirror.StringStream(trim(params.argString));
|
20846 |
+
while (!stream.eol()) {
|
20847 |
+
stream.eatSpace();
|
20848 |
+
|
20849 |
+
// Record the streams position at the beginning of the loop for use
|
20850 |
+
// in error messages.
|
20851 |
+
var count = stream.pos;
|
20852 |
+
|
20853 |
+
if (!stream.match(/[a-zA-Z]/, false)) {
|
20854 |
+
showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
|
20855 |
+
return;
|
20856 |
+
}
|
20857 |
+
|
20858 |
+
var sym = stream.next();
|
20859 |
+
// Check if this symbol is part of a range
|
20860 |
+
if (stream.match('-', true)) {
|
20861 |
+
// This symbol is part of a range.
|
20862 |
+
|
20863 |
+
// The range must terminate at an alphabetic character.
|
20864 |
+
if (!stream.match(/[a-zA-Z]/, false)) {
|
20865 |
+
showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
|
20866 |
+
return;
|
20867 |
+
}
|
20868 |
+
|
20869 |
+
var startMark = sym;
|
20870 |
+
var finishMark = stream.next();
|
20871 |
+
// The range must terminate at an alphabetic character which
|
20872 |
+
// shares the same case as the start of the range.
|
20873 |
+
if (isLowerCase(startMark) && isLowerCase(finishMark) ||
|
20874 |
+
isUpperCase(startMark) && isUpperCase(finishMark)) {
|
20875 |
+
var start = startMark.charCodeAt(0);
|
20876 |
+
var finish = finishMark.charCodeAt(0);
|
20877 |
+
if (start >= finish) {
|
20878 |
+
showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
|
20879 |
+
return;
|
20880 |
+
}
|
20881 |
+
|
20882 |
+
// Because marks are always ASCII values, and we have
|
20883 |
+
// determined that they are the same case, we can use
|
20884 |
+
// their char codes to iterate through the defined range.
|
20885 |
+
for (var j = 0; j <= finish - start; j++) {
|
20886 |
+
var mark = String.fromCharCode(start + j);
|
20887 |
+
delete state.marks[mark];
|
20888 |
+
}
|
20889 |
+
} else {
|
20890 |
+
showConfirm(cm, 'Invalid argument: ' + startMark + '-');
|
20891 |
+
return;
|
20892 |
+
}
|
20893 |
+
} else {
|
20894 |
+
// This symbol is a valid mark, and is not part of a range.
|
20895 |
+
delete state.marks[sym];
|
20896 |
+
}
|
20897 |
+
}
|
20898 |
+
}
|
20899 |
+
};
|
20900 |
+
|
20901 |
+
var exCommandDispatcher = new ExCommandDispatcher();
|
20902 |
+
|
20903 |
+
/**
|
20904 |
+
* @param {CodeMirror} cm CodeMirror instance we are in.
|
20905 |
+
* @param {boolean} confirm Whether to confirm each replace.
|
20906 |
+
* @param {Cursor} lineStart Line to start replacing from.
|
20907 |
+
* @param {Cursor} lineEnd Line to stop replacing at.
|
20908 |
+
* @param {RegExp} query Query for performing matches with.
|
20909 |
+
* @param {string} replaceWith Text to replace matches with. May contain $1,
|
20910 |
+
* $2, etc for replacing captured groups using Javascript replace.
|
20911 |
+
* @param {function()} callback A callback for when the replace is done.
|
20912 |
+
*/
|
20913 |
+
function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query,
|
20914 |
+
replaceWith, callback) {
|
20915 |
+
// Set up all the functions.
|
20916 |
+
cm.state.vim.exMode = true;
|
20917 |
+
var done = false;
|
20918 |
+
var lastPos = searchCursor.from();
|
20919 |
+
function replaceAll() {
|
20920 |
+
cm.operation(function() {
|
20921 |
+
while (!done) {
|
20922 |
+
replace();
|
20923 |
+
next();
|
20924 |
+
}
|
20925 |
+
stop();
|
20926 |
+
});
|
20927 |
+
}
|
20928 |
+
function replace() {
|
20929 |
+
var text = cm.getRange(searchCursor.from(), searchCursor.to());
|
20930 |
+
var newText = text.replace(query, replaceWith);
|
20931 |
+
searchCursor.replace(newText);
|
20932 |
+
}
|
20933 |
+
function next() {
|
20934 |
+
// The below only loops to skip over multiple occurrences on the same
|
20935 |
+
// line when 'global' is not true.
|
20936 |
+
while(searchCursor.findNext() &&
|
20937 |
+
isInRange(searchCursor.from(), lineStart, lineEnd)) {
|
20938 |
+
if (!global && lastPos && searchCursor.from().line == lastPos.line) {
|
20939 |
+
continue;
|
20940 |
+
}
|
20941 |
+
cm.scrollIntoView(searchCursor.from(), 30);
|
20942 |
+
cm.setSelection(searchCursor.from(), searchCursor.to());
|
20943 |
+
lastPos = searchCursor.from();
|
20944 |
+
done = false;
|
20945 |
+
return;
|
20946 |
+
}
|
20947 |
+
done = true;
|
20948 |
+
}
|
20949 |
+
function stop(close) {
|
20950 |
+
if (close) { close(); }
|
20951 |
+
cm.focus();
|
20952 |
+
if (lastPos) {
|
20953 |
+
cm.setCursor(lastPos);
|
20954 |
+
var vim = cm.state.vim;
|
20955 |
+
vim.exMode = false;
|
20956 |
+
vim.lastHPos = vim.lastHSPos = lastPos.ch;
|
20957 |
+
}
|
20958 |
+
if (callback) { callback(); }
|
20959 |
+
}
|
20960 |
+
function onPromptKeyDown(e, _value, close) {
|
20961 |
+
// Swallow all keys.
|
20962 |
+
CodeMirror.e_stop(e);
|
20963 |
+
var keyName = CodeMirror.keyName(e);
|
20964 |
+
switch (keyName) {
|
20965 |
+
case 'Y':
|
20966 |
+
replace(); next(); break;
|
20967 |
+
case 'N':
|
20968 |
+
next(); break;
|
20969 |
+
case 'A':
|
20970 |
+
// replaceAll contains a call to close of its own. We don't want it
|
20971 |
+
// to fire too early or multiple times.
|
20972 |
+
var savedCallback = callback;
|
20973 |
+
callback = undefined;
|
20974 |
+
cm.operation(replaceAll);
|
20975 |
+
callback = savedCallback;
|
20976 |
+
break;
|
20977 |
+
case 'L':
|
20978 |
+
replace();
|
20979 |
+
// fall through and exit.
|
20980 |
+
case 'Q':
|
20981 |
+
case 'Esc':
|
20982 |
+
case 'Ctrl-C':
|
20983 |
+
case 'Ctrl-[':
|
20984 |
+
stop(close);
|
20985 |
+
break;
|
20986 |
+
}
|
20987 |
+
if (done) { stop(close); }
|
20988 |
+
return true;
|
20989 |
+
}
|
20990 |
+
|
20991 |
+
// Actually do replace.
|
20992 |
+
next();
|
20993 |
+
if (done) {
|
20994 |
+
showConfirm(cm, 'No matches for ' + query.source);
|
20995 |
+
return;
|
20996 |
+
}
|
20997 |
+
if (!confirm) {
|
20998 |
+
replaceAll();
|
20999 |
+
if (callback) { callback(); };
|
21000 |
+
return;
|
21001 |
+
}
|
21002 |
+
showPrompt(cm, {
|
21003 |
+
prefix: 'replace with <strong>' + replaceWith + '</strong> (y/n/a/q/l)',
|
21004 |
+
onKeyDown: onPromptKeyDown
|
21005 |
+
});
|
21006 |
+
}
|
21007 |
+
|
21008 |
+
CodeMirror.keyMap.vim = {
|
21009 |
+
attach: attachVimMap,
|
21010 |
+
detach: detachVimMap,
|
21011 |
+
call: cmKey
|
21012 |
+
};
|
21013 |
+
|
21014 |
+
function exitInsertMode(cm) {
|
21015 |
+
var vim = cm.state.vim;
|
21016 |
+
var macroModeState = vimGlobalState.macroModeState;
|
21017 |
+
var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');
|
21018 |
+
var isPlaying = macroModeState.isPlaying;
|
21019 |
+
var lastChange = macroModeState.lastInsertModeChanges;
|
21020 |
+
// In case of visual block, the insertModeChanges are not saved as a
|
21021 |
+
// single word, so we convert them to a single word
|
21022 |
+
// so as to update the ". register as expected in real vim.
|
21023 |
+
var text = [];
|
21024 |
+
if (!isPlaying) {
|
21025 |
+
var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1;
|
21026 |
+
var changes = lastChange.changes;
|
21027 |
+
var text = [];
|
21028 |
+
var i = 0;
|
21029 |
+
// In case of multiple selections in blockwise visual,
|
21030 |
+
// the inserted text, for example: 'f<Backspace>oo', is stored as
|
21031 |
+
// 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines).
|
21032 |
+
// We push the contents of the changes array as per the following:
|
21033 |
+
// 1. In case of InsertModeKey, just increment by 1.
|
21034 |
+
// 2. In case of a character, jump by selLength (2 in the example).
|
21035 |
+
while (i < changes.length) {
|
21036 |
+
// This loop will convert 'ff<bs>oooo' to 'f<bs>oo'.
|
21037 |
+
text.push(changes[i]);
|
21038 |
+
if (changes[i] instanceof InsertModeKey) {
|
21039 |
+
i++;
|
21040 |
+
} else {
|
21041 |
+
i+= selLength;
|
21042 |
+
}
|
21043 |
+
}
|
21044 |
+
lastChange.changes = text;
|
21045 |
+
cm.off('change', onChange);
|
21046 |
+
CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
|
21047 |
+
}
|
21048 |
+
if (!isPlaying && vim.insertModeRepeat > 1) {
|
21049 |
+
// Perform insert mode repeat for commands like 3,a and 3,o.
|
21050 |
+
repeatLastEdit(cm, vim, vim.insertModeRepeat - 1,
|
21051 |
+
true /** repeatForInsert */);
|
21052 |
+
vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;
|
21053 |
+
}
|
21054 |
+
delete vim.insertModeRepeat;
|
21055 |
+
vim.insertMode = false;
|
21056 |
+
cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1);
|
21057 |
+
cm.setOption('keyMap', 'vim');
|
21058 |
+
cm.setOption('disableInput', true);
|
21059 |
+
cm.toggleOverwrite(false); // exit replace mode if we were in it.
|
21060 |
+
// update the ". register before exiting insert mode
|
21061 |
+
insertModeChangeRegister.setText(lastChange.changes.join(''));
|
21062 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
|
21063 |
+
if (macroModeState.isRecording) {
|
21064 |
+
logInsertModeChange(macroModeState);
|
21065 |
+
}
|
21066 |
+
}
|
21067 |
+
|
21068 |
+
function _mapCommand(command) {
|
21069 |
+
defaultKeymap.unshift(command);
|
21070 |
+
}
|
21071 |
+
|
21072 |
+
function mapCommand(keys, type, name, args, extra) {
|
21073 |
+
var command = {keys: keys, type: type};
|
21074 |
+
command[type] = name;
|
21075 |
+
command[type + "Args"] = args;
|
21076 |
+
for (var key in extra)
|
21077 |
+
command[key] = extra[key];
|
21078 |
+
_mapCommand(command);
|
21079 |
+
}
|
21080 |
+
|
21081 |
+
// The timeout in milliseconds for the two-character ESC keymap should be
|
21082 |
+
// adjusted according to your typing speed to prevent false positives.
|
21083 |
+
defineOption('insertModeEscKeysTimeout', 200, 'number');
|
21084 |
+
|
21085 |
+
CodeMirror.keyMap['vim-insert'] = {
|
21086 |
+
// TODO: override navigation keys so that Esc will cancel automatic
|
21087 |
+
// indentation from o, O, i_<CR>
|
21088 |
+
fallthrough: ['default'],
|
21089 |
+
attach: attachVimMap,
|
21090 |
+
detach: detachVimMap,
|
21091 |
+
call: cmKey
|
21092 |
+
};
|
21093 |
+
|
21094 |
+
CodeMirror.keyMap['vim-replace'] = {
|
21095 |
+
'Backspace': 'goCharLeft',
|
21096 |
+
fallthrough: ['vim-insert'],
|
21097 |
+
attach: attachVimMap,
|
21098 |
+
detach: detachVimMap,
|
21099 |
+
call: cmKey
|
21100 |
+
};
|
21101 |
+
|
21102 |
+
function executeMacroRegister(cm, vim, macroModeState, registerName) {
|
21103 |
+
var register = vimGlobalState.registerController.getRegister(registerName);
|
21104 |
+
if (registerName == ':') {
|
21105 |
+
// Read-only register containing last Ex command.
|
21106 |
+
if (register.keyBuffer[0]) {
|
21107 |
+
exCommandDispatcher.processCommand(cm, register.keyBuffer[0]);
|
21108 |
+
}
|
21109 |
+
macroModeState.isPlaying = false;
|
21110 |
+
return;
|
21111 |
+
}
|
21112 |
+
var keyBuffer = register.keyBuffer;
|
21113 |
+
var imc = 0;
|
21114 |
+
macroModeState.isPlaying = true;
|
21115 |
+
macroModeState.replaySearchQueries = register.searchQueries.slice(0);
|
21116 |
+
for (var i = 0; i < keyBuffer.length; i++) {
|
21117 |
+
var text = keyBuffer[i];
|
21118 |
+
var match, key;
|
21119 |
+
while (text) {
|
21120 |
+
// Pull off one command key, which is either a single character
|
21121 |
+
// or a special sequence wrapped in '<' and '>', e.g. '<Space>'.
|
21122 |
+
match = (/<\w+-.+?>|<\w+>|./).exec(text);
|
21123 |
+
key = match[0];
|
21124 |
+
text = text.substring(match.index + key.length);
|
21125 |
+
CodeMirror.Vim.handleKey(cm, key, 'macro');
|
21126 |
+
if (vim.insertMode) {
|
21127 |
+
var changes = register.insertModeChanges[imc++].changes;
|
21128 |
+
vimGlobalState.macroModeState.lastInsertModeChanges.changes =
|
21129 |
+
changes;
|
21130 |
+
repeatInsertModeChanges(cm, changes, 1);
|
21131 |
+
exitInsertMode(cm);
|
21132 |
+
}
|
21133 |
+
}
|
21134 |
+
};
|
21135 |
+
macroModeState.isPlaying = false;
|
21136 |
+
}
|
21137 |
+
|
21138 |
+
function logKey(macroModeState, key) {
|
21139 |
+
if (macroModeState.isPlaying) { return; }
|
21140 |
+
var registerName = macroModeState.latestRegister;
|
21141 |
+
var register = vimGlobalState.registerController.getRegister(registerName);
|
21142 |
+
if (register) {
|
21143 |
+
register.pushText(key);
|
21144 |
+
}
|
21145 |
+
}
|
21146 |
+
|
21147 |
+
function logInsertModeChange(macroModeState) {
|
21148 |
+
if (macroModeState.isPlaying) { return; }
|
21149 |
+
var registerName = macroModeState.latestRegister;
|
21150 |
+
var register = vimGlobalState.registerController.getRegister(registerName);
|
21151 |
+
if (register && register.pushInsertModeChanges) {
|
21152 |
+
register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);
|
21153 |
+
}
|
21154 |
+
}
|
21155 |
+
|
21156 |
+
function logSearchQuery(macroModeState, query) {
|
21157 |
+
if (macroModeState.isPlaying) { return; }
|
21158 |
+
var registerName = macroModeState.latestRegister;
|
21159 |
+
var register = vimGlobalState.registerController.getRegister(registerName);
|
21160 |
+
if (register && register.pushSearchQuery) {
|
21161 |
+
register.pushSearchQuery(query);
|
21162 |
+
}
|
21163 |
+
}
|
21164 |
+
|
21165 |
+
/**
|
21166 |
+
* Listens for changes made in insert mode.
|
21167 |
+
* Should only be active in insert mode.
|
21168 |
+
*/
|
21169 |
+
function onChange(_cm, changeObj) {
|
21170 |
+
var macroModeState = vimGlobalState.macroModeState;
|
21171 |
+
var lastChange = macroModeState.lastInsertModeChanges;
|
21172 |
+
if (!macroModeState.isPlaying) {
|
21173 |
+
while(changeObj) {
|
21174 |
+
lastChange.expectCursorActivityForChange = true;
|
21175 |
+
if (changeObj.origin == '+input' || changeObj.origin == 'paste'
|
21176 |
+
|| changeObj.origin === undefined /* only in testing */) {
|
21177 |
+
var text = changeObj.text.join('\n');
|
21178 |
+
if (lastChange.maybeReset) {
|
21179 |
+
lastChange.changes = [];
|
21180 |
+
lastChange.maybeReset = false;
|
21181 |
+
}
|
21182 |
+
lastChange.changes.push(text);
|
21183 |
+
}
|
21184 |
+
// Change objects may be chained with next.
|
21185 |
+
changeObj = changeObj.next;
|
21186 |
+
}
|
21187 |
+
}
|
21188 |
+
}
|
21189 |
+
|
21190 |
+
/**
|
21191 |
+
* Listens for any kind of cursor activity on CodeMirror.
|
21192 |
+
*/
|
21193 |
+
function onCursorActivity(cm) {
|
21194 |
+
var vim = cm.state.vim;
|
21195 |
+
if (vim.insertMode) {
|
21196 |
+
// Tracking cursor activity in insert mode (for macro support).
|
21197 |
+
var macroModeState = vimGlobalState.macroModeState;
|
21198 |
+
if (macroModeState.isPlaying) { return; }
|
21199 |
+
var lastChange = macroModeState.lastInsertModeChanges;
|
21200 |
+
if (lastChange.expectCursorActivityForChange) {
|
21201 |
+
lastChange.expectCursorActivityForChange = false;
|
21202 |
+
} else {
|
21203 |
+
// Cursor moved outside the context of an edit. Reset the change.
|
21204 |
+
lastChange.maybeReset = true;
|
21205 |
+
}
|
21206 |
+
} else if (!cm.curOp.isVimOp) {
|
21207 |
+
handleExternalSelection(cm, vim);
|
21208 |
+
}
|
21209 |
+
if (vim.visualMode) {
|
21210 |
+
updateFakeCursor(cm);
|
21211 |
+
}
|
21212 |
+
}
|
21213 |
+
function updateFakeCursor(cm) {
|
21214 |
+
var vim = cm.state.vim;
|
21215 |
+
var from = clipCursorToContent(cm, copyCursor(vim.sel.head));
|
21216 |
+
var to = offsetCursor(from, 0, 1);
|
21217 |
+
if (vim.fakeCursor) {
|
21218 |
+
vim.fakeCursor.clear();
|
21219 |
+
}
|
21220 |
+
vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'});
|
21221 |
+
}
|
21222 |
+
function handleExternalSelection(cm, vim) {
|
21223 |
+
var anchor = cm.getCursor('anchor');
|
21224 |
+
var head = cm.getCursor('head');
|
21225 |
+
// Enter or exit visual mode to match mouse selection.
|
21226 |
+
if (vim.visualMode && !cm.somethingSelected()) {
|
21227 |
+
exitVisualMode(cm, false);
|
21228 |
+
} else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) {
|
21229 |
+
vim.visualMode = true;
|
21230 |
+
vim.visualLine = false;
|
21231 |
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"});
|
21232 |
+
}
|
21233 |
+
if (vim.visualMode) {
|
21234 |
+
// Bind CodeMirror selection model to vim selection model.
|
21235 |
+
// Mouse selections are considered visual characterwise.
|
21236 |
+
var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;
|
21237 |
+
var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;
|
21238 |
+
head = offsetCursor(head, 0, headOffset);
|
21239 |
+
anchor = offsetCursor(anchor, 0, anchorOffset);
|
21240 |
+
vim.sel = {
|
21241 |
+
anchor: anchor,
|
21242 |
+
head: head
|
21243 |
+
};
|
21244 |
+
updateMark(cm, vim, '<', cursorMin(head, anchor));
|
21245 |
+
updateMark(cm, vim, '>', cursorMax(head, anchor));
|
21246 |
+
} else if (!vim.insertMode) {
|
21247 |
+
// Reset lastHPos if selection was modified by something outside of vim mode e.g. by mouse.
|
21248 |
+
vim.lastHPos = cm.getCursor().ch;
|
21249 |
+
}
|
21250 |
+
}
|
21251 |
+
|
21252 |
+
/** Wrapper for special keys pressed in insert mode */
|
21253 |
+
function InsertModeKey(keyName) {
|
21254 |
+
this.keyName = keyName;
|
21255 |
+
}
|
21256 |
+
|
21257 |
+
/**
|
21258 |
+
* Handles raw key down events from the text area.
|
21259 |
+
* - Should only be active in insert mode.
|
21260 |
+
* - For recording deletes in insert mode.
|
21261 |
+
*/
|
21262 |
+
function onKeyEventTargetKeyDown(e) {
|
21263 |
+
var macroModeState = vimGlobalState.macroModeState;
|
21264 |
+
var lastChange = macroModeState.lastInsertModeChanges;
|
21265 |
+
var keyName = CodeMirror.keyName(e);
|
21266 |
+
if (!keyName) { return; }
|
21267 |
+
function onKeyFound() {
|
21268 |
+
if (lastChange.maybeReset) {
|
21269 |
+
lastChange.changes = [];
|
21270 |
+
lastChange.maybeReset = false;
|
21271 |
+
}
|
21272 |
+
lastChange.changes.push(new InsertModeKey(keyName));
|
21273 |
+
return true;
|
21274 |
+
}
|
21275 |
+
if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {
|
21276 |
+
CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound);
|
21277 |
+
}
|
21278 |
+
}
|
21279 |
+
|
21280 |
+
/**
|
21281 |
+
* Repeats the last edit, which includes exactly 1 command and at most 1
|
21282 |
+
* insert. Operator and motion commands are read from lastEditInputState,
|
21283 |
+
* while action commands are read from lastEditActionCommand.
|
21284 |
+
*
|
21285 |
+
* If repeatForInsert is true, then the function was called by
|
21286 |
+
* exitInsertMode to repeat the insert mode changes the user just made. The
|
21287 |
+
* corresponding enterInsertMode call was made with a count.
|
21288 |
+
*/
|
21289 |
+
function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
|
21290 |
+
var macroModeState = vimGlobalState.macroModeState;
|
21291 |
+
macroModeState.isPlaying = true;
|
21292 |
+
var isAction = !!vim.lastEditActionCommand;
|
21293 |
+
var cachedInputState = vim.inputState;
|
21294 |
+
function repeatCommand() {
|
21295 |
+
if (isAction) {
|
21296 |
+
commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);
|
21297 |
+
} else {
|
21298 |
+
commandDispatcher.evalInput(cm, vim);
|
21299 |
+
}
|
21300 |
+
}
|
21301 |
+
function repeatInsert(repeat) {
|
21302 |
+
if (macroModeState.lastInsertModeChanges.changes.length > 0) {
|
21303 |
+
// For some reason, repeat cw in desktop VIM does not repeat
|
21304 |
+
// insert mode changes. Will conform to that behavior.
|
21305 |
+
repeat = !vim.lastEditActionCommand ? 1 : repeat;
|
21306 |
+
var changeObject = macroModeState.lastInsertModeChanges;
|
21307 |
+
repeatInsertModeChanges(cm, changeObject.changes, repeat);
|
21308 |
+
}
|
21309 |
+
}
|
21310 |
+
vim.inputState = vim.lastEditInputState;
|
21311 |
+
if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {
|
21312 |
+
// o and O repeat have to be interlaced with insert repeats so that the
|
21313 |
+
// insertions appear on separate lines instead of the last line.
|
21314 |
+
for (var i = 0; i < repeat; i++) {
|
21315 |
+
repeatCommand();
|
21316 |
+
repeatInsert(1);
|
21317 |
+
}
|
21318 |
+
} else {
|
21319 |
+
if (!repeatForInsert) {
|
21320 |
+
// Hack to get the cursor to end up at the right place. If I is
|
21321 |
+
// repeated in insert mode repeat, cursor will be 1 insert
|
21322 |
+
// change set left of where it should be.
|
21323 |
+
repeatCommand();
|
21324 |
+
}
|
21325 |
+
repeatInsert(repeat);
|
21326 |
+
}
|
21327 |
+
vim.inputState = cachedInputState;
|
21328 |
+
if (vim.insertMode && !repeatForInsert) {
|
21329 |
+
// Don't exit insert mode twice. If repeatForInsert is set, then we
|
21330 |
+
// were called by an exitInsertMode call lower on the stack.
|
21331 |
+
exitInsertMode(cm);
|
21332 |
+
}
|
21333 |
+
macroModeState.isPlaying = false;
|
21334 |
+
};
|
21335 |
+
|
21336 |
+
function repeatInsertModeChanges(cm, changes, repeat) {
|
21337 |
+
function keyHandler(binding) {
|
21338 |
+
if (typeof binding == 'string') {
|
21339 |
+
CodeMirror.commands[binding](cm);
|
21340 |
+
} else {
|
21341 |
+
binding(cm);
|
21342 |
+
}
|
21343 |
+
return true;
|
21344 |
+
}
|
21345 |
+
var head = cm.getCursor('head');
|
21346 |
+
var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock;
|
21347 |
+
if (inVisualBlock) {
|
21348 |
+
// Set up block selection again for repeating the changes.
|
21349 |
+
var vim = cm.state.vim;
|
21350 |
+
var lastSel = vim.lastSelection;
|
21351 |
+
var offset = getOffset(lastSel.anchor, lastSel.head);
|
21352 |
+
selectForInsert(cm, head, offset.line + 1);
|
21353 |
+
repeat = cm.listSelections().length;
|
21354 |
+
cm.setCursor(head);
|
21355 |
+
}
|
21356 |
+
for (var i = 0; i < repeat; i++) {
|
21357 |
+
if (inVisualBlock) {
|
21358 |
+
cm.setCursor(offsetCursor(head, i, 0));
|
21359 |
+
}
|
21360 |
+
for (var j = 0; j < changes.length; j++) {
|
21361 |
+
var change = changes[j];
|
21362 |
+
if (change instanceof InsertModeKey) {
|
21363 |
+
CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler);
|
21364 |
+
} else {
|
21365 |
+
var cur = cm.getCursor();
|
21366 |
+
cm.replaceRange(change, cur, cur);
|
21367 |
+
}
|
21368 |
+
}
|
21369 |
+
}
|
21370 |
+
if (inVisualBlock) {
|
21371 |
+
cm.setCursor(offsetCursor(head, 0, 1));
|
21372 |
+
}
|
21373 |
+
}
|
21374 |
+
|
21375 |
+
resetVimGlobalState();
|
21376 |
+
return vimApi;
|
21377 |
+
};
|
21378 |
+
// Initialize Vim and make it available as an API.
|
21379 |
+
CodeMirror.Vim = Vim();
|
21380 |
+
});
|
21381 |
+
|
21382 |
/**
|
21383 |
* @name HTML Editor Syntax Highlighter
|
21384 |
* @author James Bradford
|
21385 |
* @link http://arniebradfo.com/
|
21386 |
* @author Petr Mukhortov
|
21387 |
* @link http://mukhortov.com/
|
21388 |
+
* @since 2.2.0
|
21389 |
*/
|
21390 |
|
21391 |
+
console.log(window.heshOptions); // from wordpress php
|
21392 |
|
21393 |
(function (
|
21394 |
document,
|
21405 |
var editor;
|
21406 |
var scrollPanel;
|
21407 |
var settingsPanel = document.getElementById('CodeMirror-settings');
|
21408 |
+
var dialogPanel;
|
21409 |
var theForm = document.getElementById('CodeMirror-settings__form');
|
21410 |
var toolbar = document.getElementById('ed_toolbar');
|
21411 |
var target = document.getElementById('content') || document.getElementById('newcontent');
|
21412 |
var tabText = document.getElementById('content-html');
|
21413 |
+
var tabsAll = document.getElementsByClassName('wp-switch-editor');
|
21414 |
var publishButton = document.getElementById('save-post') || document.getElementById('publish');
|
21415 |
var postID = document.getElementById('post_ID') != null ? document.getElementById('post_ID').value : 0;
|
21416 |
var fullHeightToggle = document.getElementById('editor-expand-toggle');
|
21417 |
|
21418 |
var state = {
|
21419 |
+
textTabHasSibilings: tabsAll.length > 1,
|
21420 |
isThemeOrPlugin: document.getElementById('newcontent') != null,
|
21421 |
|
21422 |
isActive: function () {
|
21423 |
return document.getElementsByClassName('CodeMirror')[0] != null;
|
21424 |
},
|
21425 |
|
21426 |
+
isTextTabSelected: function () {
|
21427 |
+
return document.getElementsByClassName('html-active')[0] != null;
|
21428 |
},
|
21429 |
|
21430 |
isFullHeight: function () {
|
21458 |
var options = {
|
21459 |
mode: 'wordpresspost',
|
21460 |
tabMode: 'indent',
|
|
|
21461 |
indentWithTabs: true,
|
21462 |
enterMode: 'keep',
|
21463 |
styleActiveLine: true,
|
21464 |
electricChars: false,
|
21465 |
+
showCursorWhenSelecting: true,
|
21466 |
viewportMargin: 10,
|
21467 |
extraKeys: {
|
21468 |
'F11': function () {
|
21469 |
+
toggleFullscreen();
|
21470 |
},
|
21471 |
'Esc': function () {
|
21472 |
toggleFullscreen(true);
|
21476 |
},
|
21477 |
'Cmd-S': function () {
|
21478 |
publishButton.click();
|
21479 |
+
},
|
21480 |
},
|
21481 |
};
|
21482 |
|
21483 |
function updateOptions() {
|
21484 |
options.theme = heshOptions.theme;
|
21485 |
options.lineNumbers = !!heshOptions.lineNumbers;
|
21486 |
+
options.foldGutter = !!heshOptions.foldGutter;
|
21487 |
+
options.gutters = options.foldGutter ? ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'] : [];
|
21488 |
options.tabSize = options.indentUnit = +heshOptions.tabSize; // indentUnit must always equal tabSize
|
21489 |
options.lineWrapping = !!heshOptions.lineWrapping;
|
21490 |
+
options.matchBrackets = !!heshOptions.matchBrackets;
|
21491 |
+
options.autoCloseTags = !!heshOptions.autoCloseTags;
|
21492 |
+
options.autoCloseBrackets = !!heshOptions.autoCloseBrackets;
|
21493 |
+
options.highlightSelectionMatches = !!heshOptions.highlightSelectionMatches;
|
21494 |
+
options.matchTags = !!heshOptions.matchTags ? { bothTags: true } : false;
|
21495 |
+
options.scrollbarStyle = !!heshOptions.scrollbarStyle ? 'overlay' : null;
|
21496 |
+
options.keyMap = heshOptions.keyMap;
|
21497 |
+
options.autofocus = document.getElementById('title')
|
21498 |
+
&& !!document.getElementById('title').value
|
21499 |
&& document.getElementById('title').value.length > 0;
|
21500 |
}
|
|
|
21501 |
|
21502 |
|
21503 |
+
|
21504 |
+
function throttleAnimationFrame(callback) {
|
21505 |
var wait = false;
|
21506 |
return function () {
|
21507 |
var context = this, args = arguments;
|
21518 |
}
|
21519 |
|
21520 |
|
21521 |
+
|
21522 |
function setSettingsPositionTopValues() {
|
21523 |
+
for (var i = -1; i < settingsPanel.children.length; i++) {
|
21524 |
+
var element = i < 0 ? dialogPanel : settingsPanel.children[i];
|
21525 |
+
if (element == null) continue;
|
21526 |
element.style.position = '';
|
21527 |
element.style.top = '';
|
21528 |
element.style.left = '';
|
21533 |
|
21534 |
function setSettingsPositionMiddleValues() {
|
21535 |
var toolbarRect = toolbar.getBoundingClientRect();
|
21536 |
+
for (var i = -1; i < settingsPanel.children.length; i++) {
|
21537 |
+
var element = i < 0 ? dialogPanel : settingsPanel.children[i];
|
21538 |
+
if (element == null) continue;
|
21539 |
element.style.position = 'fixed';
|
21540 |
element.style.top = toolbarRect.bottom + 'px';
|
21541 |
element.style.right = (document.documentElement.getBoundingClientRect().width - toolbarRect.right) + 'px';
|
21549 |
function setSettingsPositionBottomValues() {
|
21550 |
var toolbarRect = toolbar.getBoundingClientRect();
|
21551 |
var codeMirrorRect = editor.getWrapperElement().getBoundingClientRect();
|
21552 |
+
for (var i = -1; i < settingsPanel.children.length; i++) {
|
21553 |
+
var element = i < 0 ? dialogPanel : settingsPanel.children[i];
|
21554 |
+
if (element == null) continue;
|
21555 |
element.style.position = 'absolute';
|
21556 |
element.style.top = (codeMirrorRect.top - toolbarRect.bottom) * -1 + 'px';
|
21557 |
element.style.left = '';
|
21585 |
|
21586 |
|
21587 |
var isIE = !!navigator.userAgent.match(/Trident/ig);
|
21588 |
+
|
21589 |
function updateFullHeightMaxHeight() {
|
21590 |
if (!theForm) return;
|
21591 |
var margin = 6; // arbitrary
|
21640 |
}
|
21641 |
|
21642 |
|
21643 |
+
function trackDialog(mutations) {
|
21644 |
+
for (var i = 0; i < mutations.length; i++) {
|
21645 |
+
var mutation = mutations[i];
|
21646 |
+
if (mutation.addedNodes[0] && mutation.addedNodes[0].classList.contains('CodeMirror-dialog')){
|
21647 |
+
dialogPanel = mutation.addedNodes[0];
|
21648 |
+
var buttons = dialogPanel.getElementsByTagName('button');
|
21649 |
+
for (var j = 0; j < buttons.length; j++) {
|
21650 |
+
var button = buttons[j];
|
21651 |
+
button.classList = 'button button-small';
|
21652 |
+
}
|
21653 |
+
// console.log('put breakpoint here');
|
21654 |
+
}
|
21655 |
+
else{
|
21656 |
+
dialogPanel = undefined;
|
21657 |
+
continue;
|
21658 |
+
}
|
21659 |
+
}
|
21660 |
+
}
|
21661 |
+
|
21662 |
+
|
21663 |
|
21664 |
// initalize the settings panel
|
21665 |
function attachSettings() {
|
21669 |
settingsPanel.querySelector('.CodeMirror-settings__toggle').addEventListener('click', toggleSettings);
|
21670 |
settingsPanel.querySelector('.CodeMirror-settings__toggle-advanced').addEventListener('click', toggleSettings);
|
21671 |
|
21672 |
+
var observer = new MutationObserver(trackDialog);
|
21673 |
+
observer.observe(editor.getWrapperElement(), { childList: true });
|
21674 |
+
|
21675 |
// attach all the inputs to live update
|
21676 |
var options = settingsPanel.querySelectorAll('.CodeMirror-settings__option');
|
21677 |
+
for (var i = 0; i < options.length; i++) {
|
21678 |
+
var option = options[i];
|
21679 |
option.addEventListener('change', submitForm);
|
21680 |
+
option.addEventListener('change', updateOption);
|
21681 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
21682 |
}
|
21683 |
|
21684 |
// toggle classes for settingsPanel state
|
21713 |
}
|
21714 |
}
|
21715 |
|
21716 |
+
function setCharWidth() {
|
21717 |
+
state.charWidth = editor.defaultCharWidth() * (heshOptions.fontSize / 13);
|
21718 |
+
}
|
21719 |
|
21720 |
// set a codemirror option from an input.onchange event callback
|
21721 |
function updateOption(event) {
|
21722 |
var value = +event.target.value;
|
21723 |
value = isNaN(value) ? event.target.value : value;
|
21724 |
+
if (event.target.type === 'checkbox')
|
21725 |
value = event.target.checked;
|
|
|
|
|
|
|
|
|
|
|
21726 |
|
21727 |
+
switch (event.target.id) {
|
21728 |
+
case 'fontSize':
|
21729 |
+
heshOptions.fontSize = value;
|
21730 |
+
scrollPanel.style.fontSize = value + 'px';
|
21731 |
+
setCharWidth();
|
21732 |
+
editor.refresh();
|
21733 |
+
break;
|
21734 |
+
|
21735 |
+
case 'lineHeight':
|
21736 |
+
heshOptions.lineHeight = value;
|
21737 |
+
scrollPanel.style.lineHeight = value + 'em';
|
21738 |
+
editor.refresh();
|
21739 |
+
break;
|
21740 |
+
|
21741 |
+
case 'matchTags':
|
21742 |
+
heshOptions.matchTags = value;
|
21743 |
+
editor.setOption('matchTags', value ? { bothTags: true } : null);
|
21744 |
+
break;
|
21745 |
+
|
21746 |
+
case 'scrollbarStyle':
|
21747 |
+
heshOptions.scrollbarStyle = value;
|
21748 |
+
editor.setOption('scrollbarStyle', value ? 'overlay' : null);
|
21749 |
+
break;
|
21750 |
+
|
21751 |
+
case 'foldGutter':
|
21752 |
+
editor.setOption('gutters', value ? ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'] : []);
|
21753 |
+
// break; // fallthrough expected here
|
21754 |
+
|
21755 |
+
case 'tabSize':
|
21756 |
+
editor.setOption('indentUnit', value); // indentUnit must always equal tabSize
|
21757 |
+
// break; // fallthrough expected here
|
21758 |
+
|
21759 |
+
default:
|
21760 |
+
heshOptions[event.target.id] = value;
|
21761 |
+
editor.setOption(event.target.id, value);
|
21762 |
+
break;
|
21763 |
+
}
|
21764 |
+
|
21765 |
+
switch (event.target.id) { // clean up lap
|
21766 |
+
case 'lineNumbers':
|
21767 |
+
if (value && !!heshOptions.foldGutter)
|
21768 |
+
editor.setOption('gutters', ['CodeMirror-linenumbers', 'CodeMirror-foldgutter']);
|
21769 |
+
// case 'keyMap':
|
21770 |
+
// stopEditor();
|
21771 |
+
// startEditor();
|
21772 |
+
}
|
21773 |
+
|
21774 |
}
|
21775 |
|
21776 |
function setFontSizeAndLineHeight(fontSize, lineHeight) {
|
21782 |
editor.refresh();
|
21783 |
}
|
21784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21785 |
|
21786 |
|
21787 |
// updates the user settings in the wordpress DB
|
21789 |
var formArray = $('#CodeMirror-settings__form').serializeArray();
|
21790 |
// TODO: drop jQuery dependency
|
21791 |
// console.log(formArray); // for debug
|
21792 |
+
$.post(heshOptions.ajaxUrl, formArray, function (response) {
|
21793 |
// console.log(response); // for debug
|
21794 |
});
|
21795 |
}
|
21809 |
|
21810 |
function toggleFullscreen(esc) {
|
21811 |
esc = esc === true ? true : false;
|
21812 |
+
if (state.isFullHeight()) {
|
21813 |
fullscreenBox.classList.remove(fullscreenClass);
|
21814 |
} else {
|
21815 |
+
if (!fullscreenBox.classList.contains(fullscreenClass) && !esc) {
|
21816 |
fullscreenBox.classList.add(fullscreenClass);
|
21817 |
} else {
|
21818 |
fullscreenBox.classList.remove(fullscreenClass);
|
21932 |
}
|
21933 |
|
21934 |
|
21935 |
+
|
21936 |
// make wrapped text line up with the base indentation of the line
|
21937 |
// https://codemirror.net/demo/indentwrap.html
|
21938 |
function indentWrappedLine() {
|
21974 |
|
21975 |
function runTextAreaChangeDetection() {
|
21976 |
var currentValueLength = editor.getTextArea().value.length;
|
21977 |
+
var checkForChanges = window.setInterval(function () {
|
21978 |
// console.log(editor.getTextArea().value.length);
|
21979 |
if (currentValueLength === editor.getTextArea().value.length) return;
|
21980 |
window.clearInterval(checkForChanges);
|
21981 |
returnFocusFromTextArea();
|
21982 |
+
}, 10);
|
21983 |
var clearCheckForChanges = function () {
|
21984 |
window.clearInterval(checkForChanges);
|
21985 |
editor.off('focus', clearCheckForChanges);
|
22043 |
window.send_to_editor = whichSendToEditor;
|
22044 |
}
|
22045 |
|
|
|
22046 |
function startEditor() {
|
22047 |
if (state.isActive()) return;
|
22048 |
|
22090 |
function initialise() {
|
22091 |
if (state.isThemeOrPlugin) {
|
22092 |
startEditor();
|
22093 |
+
} else if (state.textTabHasSibilings) {
|
22094 |
tabText.addEventListener('click', function () {
|
22095 |
window.setTimeout(startEditor, 0);
|
22096 |
});
|
22097 |
+
for (var i = 0; i < tabsAll.length; i++) {
|
22098 |
+
var tab = tabsAll[i];
|
22099 |
+
if (tab.id === 'content-html') continue; // its the "Text" tab
|
22100 |
+
tab.addEventListener('click', stopEditor);
|
22101 |
+
}
|
22102 |
+
if (state.isTextTabSelected()) startEditor();
|
22103 |
} else {
|
22104 |
startEditor();
|
|
|
22105 |
}
|
22106 |
}
|
22107 |
|
22120 |
window.CodeMirror,
|
22121 |
window.jQuery,
|
22122 |
window.heshOptions
|
22123 |
+
);
|
dist/hesh.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.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:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;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-animate-fat-cursor{width:auto;border:0;animation:a 1.06s steps(1) infinite;background-color:#7e7}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;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:700}.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{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,.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-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display: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:-30px}.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{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;font-variant-ligatures:contextual}.CodeMirror-wrap pre{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;overflow:auto}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{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}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{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:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}.cm-s-3024-day div.CodeMirror-selected{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::-moz-selection{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::selection,.cm-s-3024-day .CodeMirror-line>span::selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::-moz-selection{background:#d9d9d9}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d9d9d9}.cm-s-3024-day .CodeMirror-gutters{background:#f7f7f7;border-right:0}.cm-s-3024-day .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-day .CodeMirror-guttermarker-subtle,.cm-s-3024-day .CodeMirror-linenumber{color:#807d7c}.cm-s-3024-day .CodeMirror-cursor{border-left:1px solid #5c5855}.cm-s-3024-day span.cm-comment{color:#cdab53}.cm-s-3024-day span.cm-atom,.cm-s-3024-day span.cm-number{color:#a16a94}.cm-s-3024-day span.cm-attribute,.cm-s-3024-day span.cm-property{color:#01a252}.cm-s-3024-day span.cm-keyword{color:#db2d20}.cm-s-3024-day span.cm-string{color:#fded02}.cm-s-3024-day span.cm-variable{color:#01a252}.cm-s-3024-day span.cm-variable-2{color:#01a0e4}.cm-s-3024-day span.cm-def{color:#e8bbd0}.cm-s-3024-day span.cm-bracket{color:#3a3432}.cm-s-3024-day span.cm-tag{color:#db2d20}.cm-s-3024-day span.cm-link{color:#a16a94}.cm-s-3024-day span.cm-error{background:#db2d20;color:#5c5855}.cm-s-3024-day .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-3024-day .CodeMirror-matchingbracket{text-decoration:underline;color:#a16a94!important}.cm-s-3024-night.CodeMirror{background:#090300;color:#d6d5d4}.cm-s-3024-night div.CodeMirror-selected{background:#3a3432}.cm-s-3024-night .CodeMirror-line::selection,.cm-s-3024-night .CodeMirror-line>span::selection,.cm-s-3024-night .CodeMirror-line>span>span::selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-line::-moz-selection,.cm-s-3024-night .CodeMirror-line>span::-moz-selection,.cm-s-3024-night .CodeMirror-line>span>span::-moz-selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-gutters{background:#090300;border-right:0}.cm-s-3024-night .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-night .CodeMirror-guttermarker-subtle,.cm-s-3024-night .CodeMirror-linenumber{color:#5c5855}.cm-s-3024-night .CodeMirror-cursor{border-left:1px solid #807d7c}.cm-s-3024-night span.cm-comment{color:#cdab53}.cm-s-3024-night span.cm-atom,.cm-s-3024-night span.cm-number{color:#a16a94}.cm-s-3024-night span.cm-attribute,.cm-s-3024-night span.cm-property{color:#01a252}.cm-s-3024-night span.cm-keyword{color:#db2d20}.cm-s-3024-night span.cm-string{color:#fded02}.cm-s-3024-night span.cm-variable{color:#01a252}.cm-s-3024-night span.cm-variable-2{color:#01a0e4}.cm-s-3024-night span.cm-def{color:#e8bbd0}.cm-s-3024-night span.cm-bracket{color:#d6d5d4}.cm-s-3024-night span.cm-tag{color:#db2d20}.cm-s-3024-night span.cm-link{color:#a16a94}.cm-s-3024-night span.cm-error{background:#db2d20;color:#807d7c}.cm-s-3024-night .CodeMirror-activeline-background{background:#2f2f2f}.cm-s-3024-night .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-abcdef.CodeMirror{background:#0f0f0f;color:#defdef}.cm-s-abcdef div.CodeMirror-selected{background:#515151}.cm-s-abcdef .CodeMirror-line::selection,.cm-s-abcdef .CodeMirror-line>span::selection,.cm-s-abcdef .CodeMirror-line>span>span::selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-line::-moz-selection,.cm-s-abcdef .CodeMirror-line>span::-moz-selection,.cm-s-abcdef .CodeMirror-line>span>span::-moz-selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-gutters{background:#555;border-right:2px solid #314151}.cm-s-abcdef .CodeMirror-guttermarker{color:#222}.cm-s-abcdef .CodeMirror-guttermarker-subtle{color:azure}.cm-s-abcdef .CodeMirror-linenumber{color:#fff}.cm-s-abcdef .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-abcdef span.cm-keyword{color:#b8860b;font-weight:700}.cm-s-abcdef span.cm-atom{color:#77f}.cm-s-abcdef span.cm-number{color:violet}.cm-s-abcdef span.cm-def{color:#fffabc}.cm-s-abcdef span.cm-variable{color:#abcdef}.cm-s-abcdef span.cm-variable-2{color:#cacbcc}.cm-s-abcdef span.cm-variable-3{color:#def}.cm-s-abcdef span.cm-property{color:#fedcba}.cm-s-abcdef span.cm-operator{color:#ff0}.cm-s-abcdef span.cm-comment{color:#7a7b7c;font-style:italic}.cm-s-abcdef span.cm-string{color:#2b4}.cm-s-abcdef span.cm-meta{color:#c9f}.cm-s-abcdef span.cm-qualifier{color:#fff700}.cm-s-abcdef span.cm-builtin{color:#30aabc}.cm-s-abcdef span.cm-bracket{color:#8a8a8a}.cm-s-abcdef span.cm-tag{color:#fd4}.cm-s-abcdef span.cm-attribute{color:#df0}.cm-s-abcdef span.cm-error{color:red}.cm-s-abcdef span.cm-header{color:#7fffd4;font-weight:700}.cm-s-abcdef span.cm-link{color:#8a2be2}.cm-s-abcdef .CodeMirror-activeline-background{background:#314151}.cm-s-ambiance.CodeMirror{box-shadow:none}.cm-s-ambiance .cm-header{color:blue}.cm-s-ambiance .cm-quote{color:#24c2c7}.cm-s-ambiance .cm-keyword{color:#cda869}.cm-s-ambiance .cm-atom{color:#cf7ea9}.cm-s-ambiance .cm-number{color:#78cf8a}.cm-s-ambiance .cm-def{color:#aac6e3}.cm-s-ambiance .cm-variable{color:#ffb795}.cm-s-ambiance .cm-variable-2{color:#eed1b3}.cm-s-ambiance .cm-variable-3{color:#faded3}.cm-s-ambiance .cm-property{color:#eed1b3}.cm-s-ambiance .cm-operator{color:#fa8d6a}.cm-s-ambiance .cm-comment{color:#555;font-style:italic}.cm-s-ambiance .cm-string{color:#8f9d6a}.cm-s-ambiance .cm-string-2{color:#9d937c}.cm-s-ambiance .cm-meta{color:#d2a8a1}.cm-s-ambiance .cm-qualifier{color:#ff0}.cm-s-ambiance .cm-builtin{color:#99c}.cm-s-ambiance .cm-bracket{color:#24c2c7}.cm-s-ambiance .cm-tag{color:#fee4ff}.cm-s-ambiance .cm-attribute{color:#9b859d}.cm-s-ambiance .cm-hr{color:pink}.cm-s-ambiance .cm-link{color:#f4c20b}.cm-s-ambiance .cm-special{color:#ff9d00}.cm-s-ambiance .cm-error{color:#af2018}.cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0}.cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22}.cm-s-ambiance div.CodeMirror-selected{background:hsla(0,0%,100%,.15)}.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-ambiance .CodeMirror-line::selection,.cm-s-ambiance .CodeMirror-line>span::selection,.cm-s-ambiance .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-ambiance .CodeMirror-line::-moz-selection,.cm-s-ambiance .CodeMirror-line>span::-moz-selection,.cm-s-ambiance .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-ambiance.CodeMirror{line-height:1.4em;color:#e6e1dc;background-color:#202020;box-shadow:inset 0 0 10px #000}.cm-s-ambiance .CodeMirror-gutters{background:#3d3d3d;border-right:1px solid #4d4d4d;box-shadow:0 10px 20px #000}.cm-s-ambiance .CodeMirror-linenumber{text-shadow:0 1px 1px #4d4d4d;color:#111;padding:0 5px}.cm-s-ambiance .CodeMirror-guttermarker{color:#aaa}.cm-s-ambiance .CodeMirror-guttermarker-subtle{color:#111}.cm-s-ambiance .CodeMirror-cursor{border-left:1px solid #7991e8}.cm-s-ambiance .CodeMirror-activeline-background{background:none repeat scroll 0 0 hsla(0,0%,100%,.031)}.cm-s-ambiance.CodeMirror,.cm-s-ambiance .CodeMirror-gutters{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGln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iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC")}.cm-s-base16-dark.CodeMirror{background:#151515;color:#e0e0e0}.cm-s-base16-dark div.CodeMirror-selected{background:#303030}.cm-s-base16-dark .CodeMirror-line::selection,.cm-s-base16-dark .CodeMirror-line>span::selection,.cm-s-base16-dark .CodeMirror-line>span>span::selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-line::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-gutters{background:#151515;border-right:0}.cm-s-base16-dark .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-dark .CodeMirror-guttermarker-subtle,.cm-s-base16-dark .CodeMirror-linenumber{color:#505050}.cm-s-base16-dark .CodeMirror-cursor{border-left:1px solid #b0b0b0}.cm-s-base16-dark span.cm-comment{color:#8f5536}.cm-s-base16-dark span.cm-atom,.cm-s-base16-dark span.cm-number{color:#aa759f}.cm-s-base16-dark span.cm-attribute,.cm-s-base16-dark span.cm-property{color:#90a959}.cm-s-base16-dark span.cm-keyword{color:#ac4142}.cm-s-base16-dark span.cm-string{color:#f4bf75}.cm-s-base16-dark span.cm-variable{color:#90a959}.cm-s-base16-dark span.cm-variable-2{color:#6a9fb5}.cm-s-base16-dark span.cm-def{color:#d28445}.cm-s-base16-dark span.cm-bracket{color:#e0e0e0}.cm-s-base16-dark span.cm-tag{color:#ac4142}.cm-s-base16-dark span.cm-link{color:#aa759f}.cm-s-base16-dark span.cm-error{background:#ac4142;color:#b0b0b0}.cm-s-base16-dark .CodeMirror-activeline-background{background:#202020}.cm-s-base16-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::selection,.cm-s-base16-light .CodeMirror-line>span::selection,.cm-s-base16-light .CodeMirror-line>span>span::selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::-moz-selection,.cm-s-base16-light .CodeMirror-line>span::-moz-selection,.cm-s-base16-light .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-base16-light .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-light .CodeMirror-guttermarker-subtle,.cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}.cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050}.cm-s-base16-light span.cm-comment{color:#8f5536}.cm-s-base16-light span.cm-atom,.cm-s-base16-light span.cm-number{color:#aa759f}.cm-s-base16-light span.cm-attribute,.cm-s-base16-light span.cm-property{color:#90a959}.cm-s-base16-light span.cm-keyword{color:#ac4142}.cm-s-base16-light span.cm-string{color:#f4bf75}.cm-s-base16-light span.cm-variable{color:#90a959}.cm-s-base16-light span.cm-variable-2{color:#6a9fb5}.cm-s-base16-light span.cm-def{color:#d28445}.cm-s-base16-light span.cm-bracket{color:#202020}.cm-s-base16-light span.cm-tag{color:#ac4142}.cm-s-base16-light span.cm-link{color:#aa759f}.cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}.cm-s-base16-light .CodeMirror-activeline-background{background:#dddcdc}.cm-s-base16-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-bespin.CodeMirror{background:#28211c;color:#9d9b97}.cm-s-bespin div.CodeMirror-selected{background:#36312e!important}.cm-s-bespin .CodeMirror-gutters{background:#28211c;border-right:0}.cm-s-bespin .CodeMirror-linenumber{color:#666}.cm-s-bespin .CodeMirror-cursor{border-left:1px solid #797977!important}.cm-s-bespin span.cm-comment{color:#937121}.cm-s-bespin span.cm-atom,.cm-s-bespin span.cm-number{color:#9b859d}.cm-s-bespin span.cm-attribute,.cm-s-bespin span.cm-property{color:#54be0d}.cm-s-bespin span.cm-keyword{color:#cf6a4c}.cm-s-bespin span.cm-string{color:#f9ee98}.cm-s-bespin span.cm-variable{color:#54be0d}.cm-s-bespin span.cm-variable-2{color:#5ea6ea}.cm-s-bespin span.cm-def{color:#cf7d34}.cm-s-bespin span.cm-error{background:#cf6a4c;color:#797977}.cm-s-bespin span.cm-bracket{color:#9d9b97}.cm-s-bespin span.cm-tag{color:#cf6a4c}.cm-s-bespin span.cm-link{color:#9b859d}.cm-s-bespin .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-bespin .CodeMirror-activeline-background{background:#404040}.cm-s-blackboard.CodeMirror{background:#0c1021;color:#f8f8f8}.cm-s-blackboard div.CodeMirror-selected{background:#253b76}.cm-s-blackboard .CodeMirror-line::selection,.cm-s-blackboard .CodeMirror-line>span::selection,.cm-s-blackboard .CodeMirror-line>span>span::selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-line::-moz-selection,.cm-s-blackboard .CodeMirror-line>span::-moz-selection,.cm-s-blackboard .CodeMirror-line>span>span::-moz-selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-gutters{background:#0c1021;border-right:0}.cm-s-blackboard .CodeMirror-guttermarker{color:#fbde2d}.cm-s-blackboard .CodeMirror-guttermarker-subtle,.cm-s-blackboard .CodeMirror-linenumber{color:#888}.cm-s-blackboard .CodeMirror-cursor{border-left:1px solid #a7a7a7}.cm-s-blackboard .cm-keyword{color:#fbde2d}.cm-s-blackboard .cm-atom,.cm-s-blackboard .cm-number{color:#d8fa3c}.cm-s-blackboard .cm-def{color:#8da6ce}.cm-s-blackboard .cm-variable{color:#ff6400}.cm-s-blackboard .cm-operator{color:#fbde2d}.cm-s-blackboard .cm-comment{color:#aeaeae}.cm-s-blackboard .cm-string,.cm-s-blackboard .cm-string-2{color:#61ce3c}.cm-s-blackboard .cm-meta{color:#d8fa3c}.cm-s-blackboard .cm-attribute,.cm-s-blackboard .cm-builtin,.cm-s-blackboard .cm-tag{color:#8da6ce}.cm-s-blackboard .cm-header{color:#ff6400}.cm-s-blackboard .cm-hr{color:#aeaeae}.cm-s-blackboard .cm-link{color:#8da6ce}.cm-s-blackboard .cm-error{background:#9d1e15;color:#f8f8f8}.cm-s-blackboard .CodeMirror-activeline-background{background:#3c3636}.cm-s-blackboard .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-cobalt.CodeMirror{background:#002240;color:#fff}.cm-s-cobalt div.CodeMirror-selected{background:#b36539}.cm-s-cobalt .CodeMirror-line::selection,.cm-s-cobalt .CodeMirror-line>span::selection,.cm-s-cobalt .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-line::-moz-selection,.cm-s-cobalt .CodeMirror-line>span::-moz-selection,.cm-s-cobalt .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-cobalt .CodeMirror-guttermarker{color:#ffee80}.cm-s-cobalt .CodeMirror-guttermarker-subtle,.cm-s-cobalt .CodeMirror-linenumber{color:#d0d0d0}.cm-s-cobalt .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-cobalt span.cm-comment{color:#08f}.cm-s-cobalt span.cm-atom{color:#845dc4}.cm-s-cobalt span.cm-attribute,.cm-s-cobalt span.cm-number{color:#ff80e1}.cm-s-cobalt span.cm-keyword{color:#ffee80}.cm-s-cobalt span.cm-string{color:#3ad900}.cm-s-cobalt span.cm-meta{color:#ff9d00}.cm-s-cobalt span.cm-tag,.cm-s-cobalt span.cm-variable-2{color:#9effff}.cm-s-cobalt span.cm-def,.cm-s-cobalt span.cm-variable-3{color:#fff}.cm-s-cobalt span.cm-bracket{color:#d8d8d8}.cm-s-cobalt span.cm-builtin,.cm-s-cobalt span.cm-special{color:#ff9e59}.cm-s-cobalt span.cm-link{color:#845dc4}.cm-s-cobalt span.cm-error{color:#9d1e15}.cm-s-cobalt .CodeMirror-activeline-background{background:#002d57}.cm-s-cobalt .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-colorforth.CodeMirror{background:#000;color:#f8f8f8}.cm-s-colorforth .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-colorforth .CodeMirror-guttermarker{color:#ffbd40}.cm-s-colorforth .CodeMirror-guttermarker-subtle{color:#78846f}.cm-s-colorforth .CodeMirror-linenumber{color:#bababa}.cm-s-colorforth .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-colorforth span.cm-comment{color:#ededed}.cm-s-colorforth span.cm-def{color:#ff1c1c;font-weight:700}.cm-s-colorforth span.cm-keyword{color:#ffd900}.cm-s-colorforth span.cm-builtin{color:#00d95a}.cm-s-colorforth span.cm-variable{color:#73ff00}.cm-s-colorforth span.cm-string{color:#007bff}.cm-s-colorforth span.cm-number{color:#00c4ff}.cm-s-colorforth span.cm-atom{color:#606060}.cm-s-colorforth span.cm-variable-2{color:#eee}.cm-s-colorforth span.cm-variable-3{color:#ddd}.cm-s-colorforth span.cm-meta{color:#ff0}.cm-s-colorforth span.cm-qualifier{color:#fff700}.cm-s-colorforth span.cm-bracket{color:#cc7}.cm-s-colorforth span.cm-tag{color:#ffbd40}.cm-s-colorforth span.cm-attribute{color:#fff700}.cm-s-colorforth span.cm-error{color:red}.cm-s-colorforth div.CodeMirror-selected{background:#333d53}.cm-s-colorforth span.cm-compilation{background:hsla(0,0%,100%,.12)}.cm-s-colorforth .CodeMirror-activeline-background{background:#253540}.cm-s-dracula.CodeMirror,.cm-s-dracula .CodeMirror-gutters{background-color:#282a36!important;color:#f8f8f2!important;border:none}.cm-s-dracula .CodeMirror-gutters{color:#282a36}.cm-s-dracula .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-activeline-background{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-duotone-dark.CodeMirror{background:#2a2734;color:#6c6783}.cm-s-duotone-dark div.CodeMirror-selected{background:#545167!important}.cm-s-duotone-dark .CodeMirror-gutters{background:#2a2734;border-right:0}.cm-s-duotone-dark .CodeMirror-linenumber{color:#545167}.cm-s-duotone-dark .CodeMirror-cursor{border-left:1px solid #ffad5c;border-right:.5em solid #ffad5c;opacity:.5}.cm-s-duotone-dark .CodeMirror-activeline-background{background:#363342;opacity:.5}.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor{background:#ffad5c;opacity:.5}.cm-s-duotone-dark span.cm-atom,.cm-s-duotone-dark span.cm-attribute,.cm-s-duotone-dark span.cm-hr,.cm-s-duotone-dark span.cm-keyword,.cm-s-duotone-dark span.cm-link,.cm-s-duotone-dark span.cm-number,.cm-s-duotone-dark span.cm-quote,.cm-s-duotone-dark span.cm-variable{color:#fc9}.cm-s-duotone-dark span.cm-property{color:#9a86fd}.cm-s-duotone-dark span.cm-negative,.cm-s-duotone-dark span.cm-punctuation,.cm-s-duotone-dark span.cm-unit{color:#e09142}.cm-s-duotone-dark span.cm-string{color:#ffb870}.cm-s-duotone-dark span.cm-operator{color:#ffad5c}.cm-s-duotone-dark span.cm-positive{color:#6a51e6}.cm-s-duotone-dark span.cm-string-2,.cm-s-duotone-dark span.cm-url,.cm-s-duotone-dark span.cm-variable-2,.cm-s-duotone-dark span.cm-variable-3{color:#7a63ee}.cm-s-duotone-dark span.cm-builtin,.cm-s-duotone-dark span.cm-def,.cm-s-duotone-dark span.cm-em,.cm-s-duotone-dark span.cm-header,.cm-s-duotone-dark span.cm-qualifier,.cm-s-duotone-dark span.cm-tag{color:#eeebff}.cm-s-duotone-dark span.cm-bracket,.cm-s-duotone-dark span.cm-comment{color:#6c6783}.cm-s-duotone-dark span.cm-error,.cm-s-duotone-dark span.cm-invalidchar{color:red}.cm-s-duotone-dark span.cm-header{font-weight:400}.cm-s-duotone-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#eeebff!important}.cm-s-duotone-light.CodeMirror{background:#faf8f5;color:#b29762}.cm-s-duotone-light div.CodeMirror-selected{background:#e3dcce!important}.cm-s-duotone-light .CodeMirror-gutters{background:#faf8f5;border-right:0}.cm-s-duotone-light .CodeMirror-linenumber{color:#cdc4b1}.cm-s-duotone-light .CodeMirror-cursor{border-left:1px solid #93abdc;border-right:.5em solid #93abdc;opacity:.5}.cm-s-duotone-light .CodeMirror-activeline-background{background:#e3dcce;opacity:.5}.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor{background:#93abdc;opacity:.5}.cm-s-duotone-light-light span.cm-hr,.cm-s-duotone-light-light span.cm-link,.cm-s-duotone-light span.cm-atom,.cm-s-duotone-light span.cm-attribute,.cm-s-duotone-light span.cm-keyword,.cm-s-duotone-light span.cm-number,.cm-s-duotone-light span.cm-quote,.cm-s-duotone-light span.cm-variable{color:#063289}.cm-s-duotone-light span.cm-property{color:#b29762}.cm-s-duotone-light span.cm-negative,.cm-s-duotone-light span.cm-punctuation,.cm-s-duotone-light span.cm-unit{color:#063289}.cm-s-duotone-light span.cm-operator,.cm-s-duotone-light span.cm-string{color:#1659df}.cm-s-duotone-light span.cm-positive,.cm-s-duotone-light span.cm-string-2,.cm-s-duotone-light span.cm-url,.cm-s-duotone-light span.cm-variable-2,.cm-s-duotone-light span.cm-variable-3{color:#896724}.cm-s-duotone-light span.cm-builtin,.cm-s-duotone-light span.cm-def,.cm-s-duotone-light span.cm-em,.cm-s-duotone-light span.cm-header,.cm-s-duotone-light span.cm-qualifier,.cm-s-duotone-light span.cm-tag{color:#2d2006}.cm-s-duotone-light span.cm-bracket,.cm-s-duotone-light span.cm-comment{color:#b6ad9a}.cm-s-duotone-light span.cm-error,.cm-s-duotone-light span.cm-invalidchar{color:red}.cm-s-duotone-light span.cm-header{font-weight:400}.cm-s-duotone-light .CodeMirror-matchingbracket{text-decoration:underline;color:#faf8f5!important}.cm-s-eclipse span.cm-meta{color:#ff1717}.cm-s-eclipse span.cm-keyword{line-height:1em;font-weight:700;color:#7f0055}.cm-s-eclipse span.cm-atom{color:#219}.cm-s-eclipse span.cm-number{color:#164}.cm-s-eclipse span.cm-def{color:#00f}.cm-s-eclipse span.cm-variable{color:#000}.cm-s-eclipse span.cm-variable-2,.cm-s-eclipse span.cm-variable-3{color:#0000c0}.cm-s-eclipse span.cm-operator,.cm-s-eclipse span.cm-property{color:#000}.cm-s-eclipse span.cm-comment{color:#3f7f5f}.cm-s-eclipse span.cm-string{color:#2a00ff}.cm-s-eclipse span.cm-string-2{color:#f50}.cm-s-eclipse span.cm-qualifier{color:#555}.cm-s-eclipse span.cm-builtin{color:#30a}.cm-s-eclipse span.cm-bracket{color:#cc7}.cm-s-eclipse span.cm-tag{color:#170}.cm-s-eclipse span.cm-attribute{color:#00c}.cm-s-eclipse span.cm-link{color:#219}.cm-s-eclipse span.cm-error{color:red}.cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-eclipse .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}.cm-s-elegant span.cm-atom,.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string{color:#762}.cm-s-elegant span.cm-comment{color:#262;font-style:italic;line-height:1em}.cm-s-elegant span.cm-meta{color:#555;font-style:italic;line-height:1em}.cm-s-elegant span.cm-variable{color:#000}.cm-s-elegant span.cm-variable-2{color:#b11}.cm-s-elegant span.cm-qualifier{color:#555}.cm-s-elegant span.cm-keyword{color:#730}.cm-s-elegant span.cm-builtin{color:#30a}.cm-s-elegant span.cm-link{color:#762}.cm-s-elegant span.cm-error{background-color:#fdd}.cm-s-elegant .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-elegant .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}.cm-s-erlang-dark.CodeMirror{background:#002240;color:#fff}.cm-s-erlang-dark div.CodeMirror-selected{background:#b36539}.cm-s-erlang-dark .CodeMirror-line::selection,.cm-s-erlang-dark .CodeMirror-line>span::selection,.cm-s-erlang-dark .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-line::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-erlang-dark .CodeMirror-guttermarker{color:#fff}.cm-s-erlang-dark .CodeMirror-guttermarker-subtle,.cm-s-erlang-dark .CodeMirror-linenumber{color:#d0d0d0}.cm-s-erlang-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-erlang-dark span.cm-quote{color:#ccc}.cm-s-erlang-dark span.cm-atom{color:#f133f1}.cm-s-erlang-dark span.cm-attribute{color:#ff80e1}.cm-s-erlang-dark span.cm-bracket{color:#ff9d00}.cm-s-erlang-dark span.cm-builtin{color:#eaa}.cm-s-erlang-dark span.cm-comment{color:#77f}.cm-s-erlang-dark span.cm-def{color:#e7a}.cm-s-erlang-dark span.cm-keyword{color:#ffee80}.cm-s-erlang-dark span.cm-meta{color:#50fefe}.cm-s-erlang-dark span.cm-number{color:#ffd0d0}.cm-s-erlang-dark span.cm-operator{color:#d55}.cm-s-erlang-dark span.cm-property,.cm-s-erlang-dark span.cm-qualifier{color:#ccc}.cm-s-erlang-dark span.cm-special{color:#fbb}.cm-s-erlang-dark span.cm-string{color:#3ad900}.cm-s-erlang-dark span.cm-string-2{color:#ccc}.cm-s-erlang-dark span.cm-tag{color:#9effff}.cm-s-erlang-dark span.cm-variable{color:#50fe50}.cm-s-erlang-dark span.cm-variable-2{color:#e0e}.cm-s-erlang-dark span.cm-variable-3{color:#ccc}.cm-s-erlang-dark span.cm-error{color:#9d1e15}.cm-s-erlang-dark .CodeMirror-activeline-background{background:#013461}.cm-s-erlang-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42!important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498!important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom,.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-attribute,.cm-s-hopscotch span.cm-property{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}.cm-s-icecoder{color:#666;background:#1d1d1b}.cm-s-icecoder span.cm-keyword{color:#eee;font-weight:700}.cm-s-icecoder span.cm-atom{color:#e1c76e}.cm-s-icecoder span.cm-number{color:#6cb5d9}.cm-s-icecoder span.cm-def{color:#b9ca4a}.cm-s-icecoder span.cm-variable{color:#6cb5d9}.cm-s-icecoder span.cm-variable-2{color:#cc1e5c}.cm-s-icecoder span.cm-variable-3{color:#f9602c}.cm-s-icecoder span.cm-property{color:#eee}.cm-s-icecoder span.cm-operator{color:#9179bb}.cm-s-icecoder span.cm-comment{color:#97a3aa}.cm-s-icecoder span.cm-string{color:#b9ca4a}.cm-s-icecoder span.cm-string-2{color:#6cb5d9}.cm-s-icecoder span.cm-meta,.cm-s-icecoder span.cm-qualifier{color:#555}.cm-s-icecoder span.cm-builtin{color:#214e7b}.cm-s-icecoder span.cm-bracket{color:#cc7}.cm-s-icecoder span.cm-tag{color:#e8e8e8}.cm-s-icecoder span.cm-attribute{color:#099}.cm-s-icecoder span.cm-header{color:#6a0d6a}.cm-s-icecoder span.cm-quote{color:#186718}.cm-s-icecoder span.cm-hr{color:#888}.cm-s-icecoder span.cm-link{color:#e1c76e}.cm-s-icecoder span.cm-error{color:#d00}.cm-s-icecoder .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-icecoder div.CodeMirror-selected{color:#fff;background:#037}.cm-s-icecoder .CodeMirror-gutters{background:#1d1d1b;min-width:41px;border-right:0}.cm-s-icecoder .CodeMirror-linenumber{color:#555;cursor:default}.cm-s-icecoder .CodeMirror-matchingbracket{color:#fff!important;background:#555!important}.cm-s-icecoder .CodeMirror-activeline-background{background:#000}.cm-s-isotope.CodeMirror{background:#000;color:#e0e0e0}.cm-s-isotope div.CodeMirror-selected{background:#404040!important}.cm-s-isotope .CodeMirror-gutters{background:#000;border-right:0}.cm-s-isotope .CodeMirror-linenumber{color:gray}.cm-s-isotope .CodeMirror-cursor{border-left:1px solid silver!important}.cm-s-isotope span.cm-comment{color:#30f}.cm-s-isotope span.cm-atom,.cm-s-isotope span.cm-number{color:#c0f}.cm-s-isotope span.cm-attribute,.cm-s-isotope span.cm-property{color:#3f0}.cm-s-isotope span.cm-keyword{color:red}.cm-s-isotope span.cm-string{color:#f09}.cm-s-isotope span.cm-variable{color:#3f0}.cm-s-isotope span.cm-variable-2{color:#06f}.cm-s-isotope span.cm-def{color:#f90}.cm-s-isotope span.cm-error{background:red;color:silver}.cm-s-isotope span.cm-bracket{color:#e0e0e0}.cm-s-isotope span.cm-tag{color:red}.cm-s-isotope span.cm-link{color:#c0f}.cm-s-isotope .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-isotope .CodeMirror-activeline-background{background:#202020}.cm-s-lesser-dark{line-height:1.3em}.cm-s-lesser-dark.CodeMirror{background:#262626;color:#ebefe7;text-shadow:0 -1px 1px #262626}.cm-s-lesser-dark div.CodeMirror-selected{background:#45443b}.cm-s-lesser-dark .CodeMirror-line::selection,.cm-s-lesser-dark .CodeMirror-line>span::selection,.cm-s-lesser-dark .CodeMirror-line>span>span::selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-line::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-lesser-dark pre{padding:0 8px}.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket{color:#7efc7e}.cm-s-lesser-dark .CodeMirror-gutters{background:#262626;border-right:1px solid #aaa}.cm-s-lesser-dark .CodeMirror-guttermarker{color:#599eff}.cm-s-lesser-dark .CodeMirror-guttermarker-subtle,.cm-s-lesser-dark .CodeMirror-linenumber{color:#777}.cm-s-lesser-dark span.cm-header{color:#a0a}.cm-s-lesser-dark span.cm-quote{color:#090}.cm-s-lesser-dark span.cm-keyword{color:#599eff}.cm-s-lesser-dark span.cm-atom{color:#c2b470}.cm-s-lesser-dark span.cm-number{color:#b35e4d}.cm-s-lesser-dark span.cm-def{color:#fff}.cm-s-lesser-dark span.cm-variable{color:#d9bf8c}.cm-s-lesser-dark span.cm-variable-2{color:#669199}.cm-s-lesser-dark span.cm-variable-3{color:#fff}.cm-s-lesser-dark span.cm-operator,.cm-s-lesser-dark span.cm-property{color:#92a75c}.cm-s-lesser-dark span.cm-comment{color:#666}.cm-s-lesser-dark span.cm-string{color:#bcd279}.cm-s-lesser-dark span.cm-string-2{color:#f50}.cm-s-lesser-dark span.cm-meta{color:#738c73}.cm-s-lesser-dark span.cm-qualifier{color:#555}.cm-s-lesser-dark span.cm-builtin{color:#ff9e59}.cm-s-lesser-dark span.cm-bracket{color:#ebefe7}.cm-s-lesser-dark span.cm-tag{color:#669199}.cm-s-lesser-dark span.cm-attribute{color:#00c}.cm-s-lesser-dark span.cm-hr{color:#999}.cm-s-lesser-dark span.cm-link{color:#00c}.cm-s-lesser-dark span.cm-error{color:#9d1e15}.cm-s-lesser-dark .CodeMirror-activeline-background{background:#3c3a3a}.cm-s-lesser-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-liquibyte.CodeMirror{background-color:#000;color:#fff;line-height:1.2em;font-size:1em}.cm-s-liquibyte .CodeMirror-focused .cm-matchhighlight{text-decoration:underline;-webkit-text-decoration-color:#0f0;text-decoration-color:#0f0;-webkit-text-decoration-style:wavy;text-decoration-style:wavy}.cm-s-liquibyte .cm-trailingspace{text-decoration:line-through;-webkit-text-decoration-color:red;text-decoration-color:red;-webkit-text-decoration-style:dotted;text-decoration-style:dotted}.cm-s-liquibyte .cm-tab{text-decoration:line-through;-webkit-text-decoration-color:#404040;text-decoration-color:#404040;-webkit-text-decoration-style:dotted;text-decoration-style:dotted}.cm-s-liquibyte .CodeMirror-gutters{background-color:#262626;border-right:1px solid #505050;padding-right:.8em}.cm-s-liquibyte .CodeMirror-gutter-elt div{font-size:1.2em}.cm-s-liquibyte .CodeMirror-linenumber{color:#606060;padding-left:0}.cm-s-liquibyte .CodeMirror-cursor{border-left:1px solid #eee}.cm-s-liquibyte span.cm-comment{color:green}.cm-s-liquibyte span.cm-def{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-keyword{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-builtin{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-variable{color:#5967ff;font-weight:700}.cm-s-liquibyte span.cm-string{color:#ff8000}.cm-s-liquibyte span.cm-number{color:#0f0;font-weight:700}.cm-s-liquibyte span.cm-atom{color:#bf3030;font-weight:700}.cm-s-liquibyte span.cm-variable-2{color:#007f7f;font-weight:700}.cm-s-liquibyte span.cm-variable-3{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-property{color:#999;font-weight:700}.cm-s-liquibyte span.cm-operator{color:#fff}.cm-s-liquibyte span.cm-meta{color:#0f0}.cm-s-liquibyte span.cm-qualifier{color:#fff700;font-weight:700}.cm-s-liquibyte span.cm-bracket{color:#cc7}.cm-s-liquibyte span.cm-tag{color:#ff0;font-weight:700}.cm-s-liquibyte span.cm-attribute{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-error{color:red}.cm-s-liquibyte div.CodeMirror-selected{background-color:rgba(255,0,0,.25)}.cm-s-liquibyte span.cm-compilation{background-color:hsla(0,0%,100%,.12)}.cm-s-liquibyte .CodeMirror-activeline-background{background-color:rgba(0,255,0,.15)}.cm-s-liquibyte .CodeMirror span.CodeMirror-matchingbracket{color:#0f0;font-weight:700}.cm-s-liquibyte .CodeMirror span.CodeMirror-nonmatchingbracket{color:red;font-weight:700}.CodeMirror-matchingtag{background-color:rgba(150,255,0,.3)}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover,div.CodeMirror-simplescroll-vertical div:hover{background-color:rgba(80,80,80,.7)}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div,div.CodeMirror-simplescroll-vertical div{background-color:rgba(80,80,80,.3);border:1px solid #404040;border-radius:5px}.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div{border-top:1px solid #404040;border-bottom:1px solid #404040}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div{border-left:1px solid #404040;border-right:1px solid #404040}.cm-s-liquibyte div.CodeMirror-simplescroll-vertical{background-color:#262626}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal{background-color:#262626;border-top:1px solid #404040}.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div,div.CodeMirror-overlayscroll-vertical div{background-color:#404040;border-radius:5px}.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div,.cm-s-liquibyte div.CodeMirror-overlayscroll-vertical div{border:1px solid #404040}.cm-s-material.CodeMirror{background-color:#263238;color:#e9eded}.cm-s-material .CodeMirror-gutters{background:#263238;color:#537f7e;border:none}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#537f7e}.cm-s-material .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-material div.CodeMirror-selected{background:hsla(0,0%,100%,.15)}.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-material .CodeMirror-activeline-background{background:transparent}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#e9eded}.cm-s-material .cm-variable-2{color:#80cbc4}.cm-s-material .cm-variable-3{color:#82b1ff}.cm-s-material .cm-builtin{color:#decb6b}.cm-s-material .cm-atom,.cm-s-material .cm-number{color:#f77669}.cm-s-material .cm-def{color:#e9eded}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#80cbc4}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#82b1ff}.cm-s-material .cm-meta,.cm-s-material .cm-tag{color:#80cbc4}.cm-s-material .cm-attribute{color:#ffcb6b}.cm-s-material .cm-property{color:#80cbae}.cm-s-material .cm-qualifier,.cm-s-material .cm-variable-3{color:#decb6b}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-error{color:#fff;background-color:#ec5f67}.cm-s-material .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-mbo.CodeMirror{background:#2c2c2c;color:#ffffec}.cm-s-mbo div.CodeMirror-selected{background:#716c62}.cm-s-mbo .CodeMirror-line::selection,.cm-s-mbo .CodeMirror-line>span::selection,.cm-s-mbo .CodeMirror-line>span>span::selection{background:hsla(40,7%,41%,.99)}.cm-s-mbo .CodeMirror-line::-moz-selection,.cm-s-mbo .CodeMirror-line>span::-moz-selection,.cm-s-mbo .CodeMirror-line>span>span::-moz-selection{background:hsla(40,7%,41%,.99)}.cm-s-mbo .CodeMirror-gutters{background:#4e4e4e;border-right:0}.cm-s-mbo .CodeMirror-guttermarker{color:#fff}.cm-s-mbo .CodeMirror-guttermarker-subtle{color:grey}.cm-s-mbo .CodeMirror-linenumber{color:#dadada}.cm-s-mbo .CodeMirror-cursor{border-left:1px solid #ffffec}.cm-s-mbo span.cm-comment{color:#95958a}.cm-s-mbo span.cm-atom,.cm-s-mbo span.cm-number{color:#00a8c6}.cm-s-mbo span.cm-attribute,.cm-s-mbo span.cm-property{color:#9ddfe9}.cm-s-mbo span.cm-keyword{color:#ffb928}.cm-s-mbo span.cm-string{color:#ffcf6c}.cm-s-mbo span.cm-string.cm-property,.cm-s-mbo span.cm-variable{color:#ffffec}.cm-s-mbo span.cm-variable-2{color:#00a8c6}.cm-s-mbo span.cm-def{color:#ffffec}.cm-s-mbo span.cm-bracket{color:#fffffc;font-weight:700}.cm-s-mbo span.cm-tag{color:#9ddfe9}.cm-s-mbo span.cm-link{color:#f54b07}.cm-s-mbo span.cm-error{border-bottom:#636363;color:#ffffec}.cm-s-mbo span.cm-qualifier{color:#ffffec}.cm-s-mbo .CodeMirror-activeline-background{background:#494b41}.cm-s-mbo .CodeMirror-matchingbracket{color:#ffb928!important}.cm-s-mbo .CodeMirror-matchingtag{background:hsla(0,0%,100%,.37)}.cm-s-mdn-like.CodeMirror{color:#999;background-color:#fff}.cm-s-mdn-like div.CodeMirror-selected{background:#cfc}.cm-s-mdn-like .CodeMirror-line::selection,.cm-s-mdn-like .CodeMirror-line>span::selection,.cm-s-mdn-like .CodeMirror-line>span>span::selection{background:#cfc}.cm-s-mdn-like .CodeMirror-line::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span>span::-moz-selection{background:#cfc}.cm-s-mdn-like .CodeMirror-gutters{background:#f8f8f8;border-left:6px solid rgba(0,83,159,.65);color:#333}.cm-s-mdn-like .CodeMirror-linenumber{color:#aaa;padding-left:8px}.cm-s-mdn-like .CodeMirror-cursor{border-left:2px solid #222}.cm-s-mdn-like .cm-keyword{color:#6262ff}.cm-s-mdn-like .cm-atom{color:#f90}.cm-s-mdn-like .cm-number{color:#ca7841}.cm-s-mdn-like .cm-def{color:#8da6ce}.cm-s-mdn-like span.cm-tag,.cm-s-mdn-like span.cm-variable-2{color:#690}.cm-s-mdn-like .cm-variable,.cm-s-mdn-like span.cm-def,.cm-s-mdn-like span.cm-variable-3{color:#07a}.cm-s-mdn-like .cm-property{color:#905}.cm-s-mdn-like .cm-qualifier{color:#690}.cm-s-mdn-like .cm-operator{color:#cda869}.cm-s-mdn-like .cm-comment{color:#777;font-weight:400}.cm-s-mdn-like .cm-string{color:#07a;font-style:italic}.cm-s-mdn-like .cm-string-2{color:#bd6b18}.cm-s-mdn-like .cm-meta{color:#000}.cm-s-mdn-like .cm-builtin{color:#9b7536}.cm-s-mdn-like .cm-tag{color:#997643}.cm-s-mdn-like .cm-attribute{color:#d6bb6d}.cm-s-mdn-like .cm-header{color:#ff6400}.cm-s-mdn-like .cm-hr{color:#aeaeae}.cm-s-mdn-like .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-mdn-like .cm-error{border-bottom:1px solid red}div.cm-s-mdn-like .CodeMirror-activeline-background{background:#efefff}div.cm-s-mdn-like span.CodeMirror-matchingbracket{outline:1px solid grey;color:inherit}.cm-s-mdn-like.CodeMirror{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8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rcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=)}.cm-s-midnight span.CodeMirror-matchhighlight{background:#494949}.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight{background:#314d67!important}.cm-s-midnight .CodeMirror-activeline-background{background:#253540}.cm-s-midnight.CodeMirror{background:#0f192a;color:#d1edff;border-top:1px solid #000;border-bottom:1px solid #000}.cm-s-midnight div.CodeMirror-selected{background:#314d67}.cm-s-midnight .CodeMirror-line::selection,.cm-s-midnight .CodeMirror-line>span::selection,.cm-s-midnight .CodeMirror-line>span>span::selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-line::-moz-selection,.cm-s-midnight .CodeMirror-line>span::-moz-selection,.cm-s-midnight .CodeMirror-line>span>span::-moz-selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-gutters{background:#0f192a;border-right:1px solid}.cm-s-midnight .CodeMirror-guttermarker{color:#fff}.cm-s-midnight .CodeMirror-guttermarker-subtle,.cm-s-midnight .CodeMirror-linenumber{color:#d0d0d0}.cm-s-midnight .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-midnight span.cm-comment{color:#428bdd}.cm-s-midnight span.cm-atom{color:#ae81ff}.cm-s-midnight span.cm-number{color:#d1edff}.cm-s-midnight span.cm-attribute,.cm-s-midnight span.cm-property{color:#a6e22e}.cm-s-midnight span.cm-keyword{color:#e83737}.cm-s-midnight span.cm-string{color:#1dc116}.cm-s-midnight span.cm-variable,.cm-s-midnight span.cm-variable-2{color:#ffaa3e}.cm-s-midnight span.cm-def{color:#4dd}.cm-s-midnight span.cm-bracket{color:#d1edff}.cm-s-midnight span.cm-tag{color:#449}.cm-s-midnight span.cm-link{color:#ae81ff}.cm-s-midnight span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-midnight .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai div.CodeMirror-selected{background:#49483e}.cm-s-monokai .CodeMirror-line::selection,.cm-s-monokai .CodeMirror-line>span::selection,.cm-s-monokai .CodeMirror-line>span>span::selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-line::-moz-selection,.cm-s-monokai .CodeMirror-line>span::-moz-selection,.cm-s-monokai .CodeMirror-line>span>span::-moz-selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0}.cm-s-monokai .CodeMirror-guttermarker{color:#fff}.cm-s-monokai .CodeMirror-guttermarker-subtle,.cm-s-monokai .CodeMirror-linenumber{color:#d0d0d0}.cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-monokai span.cm-comment{color:#75715e}.cm-s-monokai span.cm-atom,.cm-s-monokai span.cm-number{color:#ae81ff}.cm-s-monokai span.cm-attribute,.cm-s-monokai span.cm-property{color:#a6e22e}.cm-s-monokai span.cm-keyword{color:#f92672}.cm-s-monokai span.cm-builtin{color:#66d9ef}.cm-s-monokai span.cm-string{color:#e6db74}.cm-s-monokai span.cm-variable{color:#f8f8f2}.cm-s-monokai span.cm-variable-2{color:#9effff}.cm-s-monokai span.cm-variable-3{color:#66d9ef}.cm-s-monokai span.cm-def{color:#fd971f}.cm-s-monokai span.cm-bracket{color:#f8f8f2}.cm-s-monokai span.cm-tag{color:#f92672}.cm-s-monokai span.cm-header,.cm-s-monokai span.cm-link{color:#ae81ff}.cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-monokai .CodeMirror-activeline-background{background:#373831}.cm-s-monokai .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-neat span.cm-comment{color:#a86}.cm-s-neat span.cm-keyword{line-height:1em;font-weight:700;color:blue}.cm-s-neat span.cm-string{color:#a22}.cm-s-neat span.cm-builtin{line-height:1em;font-weight:700;color:#077}.cm-s-neat span.cm-special{line-height:1em;font-weight:700;color:#0aa}.cm-s-neat span.cm-variable{color:#000}.cm-s-neat span.cm-atom,.cm-s-neat span.cm-number{color:#3a3}.cm-s-neat span.cm-meta{color:#555}.cm-s-neat span.cm-link{color:#3a3}.cm-s-neat .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-neat .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}.cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-qualifier,.cm-s-neo .cm-variable{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{border:none;border-right:10px solid transparent;background-color:transparent}.cm-s-neo .CodeMirror-linenumber{padding:0;color:#e0e2e5}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{width:auto;border:0;background:hsla(223,4%,62%,.37);z-index:1}.cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447}.cm-s-night .CodeMirror-line::selection,.cm-s-night .CodeMirror-line>span::selection,.cm-s-night .CodeMirror-line>span>span::selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-line::-moz-selection,.cm-s-night .CodeMirror-line>span::-moz-selection,.cm-s-night .CodeMirror-line>span>span::-moz-selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-guttermarker{color:#fff}.cm-s-night .CodeMirror-guttermarker-subtle{color:#bbb}.cm-s-night .CodeMirror-linenumber{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-night span.cm-comment{color:#8900d1}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-attribute,.cm-s-night span.cm-number{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-tag,.cm-s-night span.cm-variable-2{color:#99b2ff}.cm-s-night span.cm-def,.cm-s-night span.cm-variable-3{color:#fff}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}.cm-s-night span.cm-link{color:#845dc4}.cm-s-night span.cm-error{color:#9d1e15}.cm-s-night .CodeMirror-activeline-background{background:#1c005a}.cm-s-night .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-panda-syntax{background:#292a2b;color:#e6e6e6;line-height:1.5;font-family:Operator Mono,Source Sans Pro,Menlo,Monaco,Consolas,Courier New,monospace}.cm-s-panda-syntax .CodeMirror-cursor{border-color:#ff2c6d}.cm-s-panda-syntax .CodeMirror-activeline-background{background:rgba(99,123,156,.1)}.cm-s-panda-syntax .CodeMirror-selected{background:#fff}.cm-s-panda-syntax .cm-comment{font-style:italic;color:#676b79}.cm-s-panda-syntax .cm-operator{color:#f3f3f3}.cm-s-panda-syntax .cm-string{color:#19f9d8}.cm-s-panda-syntax .cm-string-2{color:#ffb86c}.cm-s-panda-syntax .cm-tag{color:#ff2c6d}.cm-s-panda-syntax .cm-meta{color:#b084eb}.cm-s-panda-syntax .cm-number{color:#ffb86c}.cm-s-panda-syntax .cm-atom{color:#ff2c6d}.cm-s-panda-syntax .cm-keyword{color:#ff75b5}.cm-s-panda-syntax .cm-variable{color:#ffb86c}.cm-s-panda-syntax .cm-variable-2,.cm-s-panda-syntax .cm-variable-3{color:#ff9ac1}.cm-s-panda-syntax .cm-def{color:#e6e6e6}.cm-s-panda-syntax .cm-property{color:#f3f3f3}.cm-s-panda-syntax .cm-attribute,.cm-s-panda-syntax .cm-unit{color:#ffb86c}.cm-s-panda-syntax .CodeMirror-matchingbracket{border-bottom:1px dotted #19f9d8;padding-bottom:2px;color:#e6e6e6}.cm-s-panda-syntax .CodeMirror-gutters{background:#292a2b;border-right-color:hsla(0,0%,100%,.1)}.cm-s-panda-syntax .CodeMirror-linenumber{color:#e6e6e6;opacity:.6}.cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}.cm-s-paraiso-dark div.CodeMirror-selected{background:#41323f}.cm-s-paraiso-dark .CodeMirror-line::selection,.cm-s-paraiso-dark .CodeMirror-line>span::selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-line::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-gutters{background:#2f1e2e;border-right:0}.cm-s-paraiso-dark .CodeMirror-guttermarker{color:#ef6155}.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle,.cm-s-paraiso-dark .CodeMirror-linenumber{color:#776e71}.cm-s-paraiso-dark .CodeMirror-cursor{border-left:1px solid #8d8687}.cm-s-paraiso-dark span.cm-comment{color:#e96ba8}.cm-s-paraiso-dark span.cm-atom,.cm-s-paraiso-dark span.cm-number{color:#815ba4}.cm-s-paraiso-dark span.cm-attribute,.cm-s-paraiso-dark span.cm-property{color:#48b685}.cm-s-paraiso-dark span.cm-keyword{color:#ef6155}.cm-s-paraiso-dark span.cm-string{color:#fec418}.cm-s-paraiso-dark span.cm-variable{color:#48b685}.cm-s-paraiso-dark span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-dark span.cm-def{color:#f99b15}.cm-s-paraiso-dark span.cm-bracket{color:#b9b6b0}.cm-s-paraiso-dark span.cm-tag{color:#ef6155}.cm-s-paraiso-dark span.cm-link{color:#815ba4}.cm-s-paraiso-dark span.cm-error{background:#ef6155;color:#8d8687}.cm-s-paraiso-dark .CodeMirror-activeline-background{background:#4d344a}.cm-s-paraiso-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-paraiso-light.CodeMirror{background:#e7e9db;color:#41323f}.cm-s-paraiso-light div.CodeMirror-selected{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::selection,.cm-s-paraiso-light .CodeMirror-line>span::selection,.cm-s-paraiso-light .CodeMirror-line>span>span::selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span>span::-moz-selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-gutters{background:#e7e9db;border-right:0}.cm-s-paraiso-light .CodeMirror-guttermarker{color:#000}.cm-s-paraiso-light .CodeMirror-guttermarker-subtle,.cm-s-paraiso-light .CodeMirror-linenumber{color:#8d8687}.cm-s-paraiso-light .CodeMirror-cursor{border-left:1px solid #776e71}.cm-s-paraiso-light span.cm-comment{color:#e96ba8}.cm-s-paraiso-light span.cm-atom,.cm-s-paraiso-light span.cm-number{color:#815ba4}.cm-s-paraiso-light span.cm-attribute,.cm-s-paraiso-light span.cm-property{color:#48b685}.cm-s-paraiso-light span.cm-keyword{color:#ef6155}.cm-s-paraiso-light span.cm-string{color:#fec418}.cm-s-paraiso-light span.cm-variable{color:#48b685}.cm-s-paraiso-light span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-light span.cm-def{color:#f99b15}.cm-s-paraiso-light span.cm-bracket{color:#41323f}.cm-s-paraiso-light span.cm-tag{color:#ef6155}.cm-s-paraiso-light span.cm-link{color:#815ba4}.cm-s-paraiso-light span.cm-error{background:#ef6155;color:#776e71}.cm-s-paraiso-light .CodeMirror-activeline-background{background:#cfd1c4}.cm-s-paraiso-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-pastel-on-dark.CodeMirror{background:#2c2827;color:#8f938f;line-height:1.5}.cm-s-pastel-on-dark div.CodeMirror-selected{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::selection,.cm-s-pastel-on-dark .CodeMirror-line>span::selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-gutters{background:#34302f;border-right:0;padding:0 3px}.cm-s-pastel-on-dark .CodeMirror-guttermarker{color:#fff}.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle,.cm-s-pastel-on-dark .CodeMirror-linenumber{color:#8f938f}.cm-s-pastel-on-dark .CodeMirror-cursor{border-left:1px solid #a7a7a7}.cm-s-pastel-on-dark span.cm-comment{color:#a6c6ff}.cm-s-pastel-on-dark span.cm-atom{color:#de8e30}.cm-s-pastel-on-dark span.cm-number{color:#ccc}.cm-s-pastel-on-dark span.cm-property{color:#8f938f}.cm-s-pastel-on-dark span.cm-attribute{color:#a6e22e}.cm-s-pastel-on-dark span.cm-keyword{color:#aeb2f8}.cm-s-pastel-on-dark span.cm-string{color:#66a968}.cm-s-pastel-on-dark span.cm-variable{color:#aeb2f8}.cm-s-pastel-on-dark span.cm-variable-2{color:#bebf55}.cm-s-pastel-on-dark span.cm-variable-3{color:#de8e30}.cm-s-pastel-on-dark span.cm-def{color:#757ad8}.cm-s-pastel-on-dark span.cm-bracket{color:#f8f8f2}.cm-s-pastel-on-dark span.cm-tag{color:#c1c144}.cm-s-pastel-on-dark span.cm-link{color:#ae81ff}.cm-s-pastel-on-dark span.cm-builtin,.cm-s-pastel-on-dark span.cm-qualifier{color:#c1c144}.cm-s-pastel-on-dark span.cm-error{background:#757ad8;color:#f8f8f0}.cm-s-pastel-on-dark .CodeMirror-activeline-background{background:hsla(0,0%,100%,.031)}.cm-s-pastel-on-dark .CodeMirror-matchingbracket{border:1px solid hsla(0,0%,100%,.25);color:#8f938f!important;margin:-1px -1px 0}.cm-s-railscasts.CodeMirror{background:#2b2b2b;color:#f4f1ed}.cm-s-railscasts div.CodeMirror-selected{background:#272935!important}.cm-s-railscasts .CodeMirror-gutters{background:#2b2b2b;border-right:0}.cm-s-railscasts .CodeMirror-linenumber{color:#5a647e}.cm-s-railscasts .CodeMirror-cursor{border-left:1px solid #d4cfc9!important}.cm-s-railscasts span.cm-comment{color:#bc9458}.cm-s-railscasts span.cm-atom,.cm-s-railscasts span.cm-number{color:#b6b3eb}.cm-s-railscasts span.cm-attribute,.cm-s-railscasts span.cm-property{color:#a5c261}.cm-s-railscasts span.cm-keyword{color:#da4939}.cm-s-railscasts span.cm-string{color:#ffc66d}.cm-s-railscasts span.cm-variable{color:#a5c261}.cm-s-railscasts span.cm-variable-2{color:#6d9cbe}.cm-s-railscasts span.cm-def{color:#cc7833}.cm-s-railscasts span.cm-error{background:#da4939;color:#d4cfc9}.cm-s-railscasts span.cm-bracket{color:#f4f1ed}.cm-s-railscasts span.cm-tag{color:#da4939}.cm-s-railscasts span.cm-link{color:#b6b3eb}.cm-s-railscasts .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-railscasts .CodeMirror-activeline-background{background:#303040}.cm-s-rubyblue.CodeMirror{background:#112435;color:#fff}.cm-s-rubyblue div.CodeMirror-selected{background:#38566f}.cm-s-rubyblue .CodeMirror-line::selection,.cm-s-rubyblue .CodeMirror-line>span::selection,.cm-s-rubyblue .CodeMirror-line>span>span::selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-line::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span>span::-moz-selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-gutters{background:#1f4661;border-right:7px solid #3e7087}.cm-s-rubyblue .CodeMirror-guttermarker{color:#fff}.cm-s-rubyblue .CodeMirror-guttermarker-subtle{color:#3e7087}.cm-s-rubyblue .CodeMirror-linenumber{color:#fff}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-rubyblue span.cm-comment{color:#999;font-style:italic;line-height:1em}.cm-s-rubyblue span.cm-atom{color:#f4c20b}.cm-s-rubyblue span.cm-attribute,.cm-s-rubyblue span.cm-number{color:#82c6e0}.cm-s-rubyblue span.cm-keyword{color:#f0f}.cm-s-rubyblue span.cm-string{color:#f08047}.cm-s-rubyblue span.cm-meta{color:#f0f}.cm-s-rubyblue span.cm-tag,.cm-s-rubyblue span.cm-variable-2{color:#7bd827}.cm-s-rubyblue span.cm-def,.cm-s-rubyblue span.cm-variable-3{color:#fff}.cm-s-rubyblue span.cm-bracket{color:#f0f}.cm-s-rubyblue span.cm-link{color:#f4c20b}.cm-s-rubyblue span.CodeMirror-matchingbracket{color:#f0f!important}.cm-s-rubyblue span.cm-builtin,.cm-s-rubyblue span.cm-special{color:#ff9d00}.cm-s-rubyblue span.cm-error{color:#af2018}.cm-s-rubyblue .CodeMirror-activeline-background{background:#173047}.cm-s-seti.CodeMirror{background-color:#151718!important;color:#cfd2d1!important;border:none}.cm-s-seti .CodeMirror-gutters{color:#404b53;background-color:#0e1112;border:none}.cm-s-seti .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-seti .CodeMirror-linenumber{color:#6d8a88}.cm-s-seti.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-seti .CodeMirror-line::selection,.cm-s-seti .CodeMirror-line>span::selection,.cm-s-seti .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-seti .CodeMirror-line::-moz-selection,.cm-s-seti .CodeMirror-line>span::-moz-selection,.cm-s-seti .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-seti span.cm-comment{color:#41535b}.cm-s-seti span.cm-string,.cm-s-seti span.cm-string-2{color:#55b5db}.cm-s-seti span.cm-number{color:#cd3f45}.cm-s-seti span.cm-variable{color:#55b5db}.cm-s-seti span.cm-variable-2{color:#a074c4}.cm-s-seti span.cm-def{color:#55b5db}.cm-s-seti span.cm-keyword{color:#ff79c6}.cm-s-seti span.cm-operator{color:#9fca56}.cm-s-seti span.cm-keyword{color:#e6cd69}.cm-s-seti span.cm-atom{color:#cd3f45}.cm-s-seti span.cm-meta,.cm-s-seti span.cm-tag{color:#55b5db}.cm-s-seti span.cm-attribute,.cm-s-seti span.cm-qualifier{color:#9fca56}.cm-s-seti span.cm-property{color:#a074c4}.cm-s-seti span.cm-builtin,.cm-s-seti span.cm-variable-3{color:#9fca56}.cm-s-seti .CodeMirror-activeline-background{background:#101213}.cm-s-seti .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted}.cm-s-solarized .cm-strong{color:#eee}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-light .CodeMirror-line>span::-moz-selection,.cm-s-light .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection,.cm-s-solarized.cm-s-light .CodeMirror-line::selection{background:#eee8d5}.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75;text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#7e7}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#7e7}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:hsla(0,0%,100%,.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.06)}.cm-s-the-matrix.CodeMirror{background:#000;color:#0f0}.cm-s-the-matrix div.CodeMirror-selected{background:#2d2d2d}.cm-s-the-matrix .CodeMirror-line::selection,.cm-s-the-matrix .CodeMirror-line>span::selection,.cm-s-the-matrix .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-line::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-gutters{background:#060;border-right:2px solid #0f0}.cm-s-the-matrix .CodeMirror-guttermarker{color:#0f0}.cm-s-the-matrix .CodeMirror-guttermarker-subtle,.cm-s-the-matrix .CodeMirror-linenumber{color:#fff}.cm-s-the-matrix .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-the-matrix span.cm-keyword{color:#008803;font-weight:700}.cm-s-the-matrix span.cm-atom{color:#3ff}.cm-s-the-matrix span.cm-number{color:#ffb94f}.cm-s-the-matrix span.cm-def{color:#99c}.cm-s-the-matrix span.cm-variable{color:#f6c}.cm-s-the-matrix span.cm-variable-2{color:#c6f}.cm-s-the-matrix span.cm-variable-3{color:#96f}.cm-s-the-matrix span.cm-property{color:#62ffa0}.cm-s-the-matrix span.cm-operator{color:#999}.cm-s-the-matrix span.cm-comment{color:#ccc}.cm-s-the-matrix span.cm-string{color:#39c}.cm-s-the-matrix span.cm-meta{color:#c9f}.cm-s-the-matrix span.cm-qualifier{color:#fff700}.cm-s-the-matrix span.cm-builtin{color:#30a}.cm-s-the-matrix span.cm-bracket{color:#cc7}.cm-s-the-matrix span.cm-tag{color:#ffbd40}.cm-s-the-matrix span.cm-attribute{color:#fff700}.cm-s-the-matrix span.cm-error{color:red}.cm-s-the-matrix .CodeMirror-activeline-background{background:#040}.cm-s-tomorrow-night-bright.CodeMirror{background:#000;color:#eaeaea}.cm-s-tomorrow-night-bright div.CodeMirror-selected{background:#424242}.cm-s-tomorrow-night-bright .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker{color:#e78c45}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-bright .CodeMirror-linenumber{color:#424242}.cm-s-tomorrow-night-bright .CodeMirror-cursor{border-left:1px solid #6a6a6a}.cm-s-tomorrow-night-bright span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-bright span.cm-atom,.cm-s-tomorrow-night-bright span.cm-number{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-attribute,.cm-s-tomorrow-night-bright span.cm-property{color:#9c9}.cm-s-tomorrow-night-bright span.cm-keyword{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-string{color:#e7c547}.cm-s-tomorrow-night-bright span.cm-variable{color:#b9ca4a}.cm-s-tomorrow-night-bright span.cm-variable-2{color:#7aa6da}.cm-s-tomorrow-night-bright span.cm-def{color:#e78c45}.cm-s-tomorrow-night-bright span.cm-bracket{color:#eaeaea}.cm-s-tomorrow-night-bright span.cm-tag{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-link{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-error{background:#d54e53;color:#6a6a6a}.cm-s-tomorrow-night-bright .CodeMirror-activeline-background{background:#2a2a2a}.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-tomorrow-night-eighties.CodeMirror{background:#000;color:#ccc}.cm-s-tomorrow-night-eighties div.CodeMirror-selected{background:#2d2d2d}.cm-s-tomorrow-night-eighties .CodeMirror-line::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker{color:#f2777a}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-eighties .CodeMirror-linenumber{color:#515151}.cm-s-tomorrow-night-eighties .CodeMirror-cursor{border-left:1px solid #6a6a6a}.cm-s-tomorrow-night-eighties span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-eighties span.cm-atom,.cm-s-tomorrow-night-eighties span.cm-number{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-attribute,.cm-s-tomorrow-night-eighties span.cm-property{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-keyword{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-string{color:#fc6}.cm-s-tomorrow-night-eighties span.cm-variable{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-variable-2{color:#69c}.cm-s-tomorrow-night-eighties span.cm-def{color:#f99157}.cm-s-tomorrow-night-eighties span.cm-bracket{color:#ccc}.cm-s-tomorrow-night-eighties span.cm-tag{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-link{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-error{background:#f2777a;color:#6a6a6a}.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background{background:#343600}.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-ttcn .cm-quote{color:#090}.cm-s-ttcn .cm-header,.cm-strong{font-weight:700}.cm-s-ttcn .cm-header{color:#00f;font-weight:700}.cm-s-ttcn .cm-atom{color:#219}.cm-s-ttcn .cm-attribute{color:#00c}.cm-s-ttcn .cm-bracket{color:#997}.cm-s-ttcn .cm-comment{color:#333}.cm-s-ttcn .cm-def{color:#00f}.cm-s-ttcn .cm-em{font-style:italic}.cm-s-ttcn .cm-error{color:red}.cm-s-ttcn .cm-hr{color:#999}.cm-s-ttcn .cm-keyword{font-weight:700}.cm-s-ttcn .cm-link{color:#00c;text-decoration:underline}.cm-s-ttcn .cm-meta{color:#555}.cm-s-ttcn .cm-negative{color:#d44}.cm-s-ttcn .cm-positive{color:#292}.cm-s-ttcn .cm-qualifier{color:#555}.cm-s-ttcn .cm-strikethrough{text-decoration:line-through}.cm-s-ttcn .cm-string{color:#006400}.cm-s-ttcn .cm-string-2{color:#f50}.cm-s-ttcn .cm-strong{font-weight:700}.cm-s-ttcn .cm-tag{color:#170}.cm-s-ttcn .cm-variable{color:#8b2252}.cm-s-ttcn .cm-variable-2{color:#05a}.cm-s-ttcn .cm-variable-3{color:#085}.cm-s-ttcn .cm-invalidchar{color:red}.cm-s-ttcn .cm-accessTypes,.cm-s-ttcn .cm-compareTypes{color:#27408b}.cm-s-ttcn .cm-cmipVerbs{color:#8b2252}.cm-s-ttcn .cm-modifier{color:#d2691e}.cm-s-ttcn .cm-status{color:#8b4545}.cm-s-ttcn .cm-storage{color:#a020f0}.cm-s-ttcn .cm-tags{color:#006400}.cm-s-ttcn .cm-externalCommands{color:#8b4545;font-weight:700}.cm-s-ttcn .cm-fileNCtrlMaskOptions,.cm-s-ttcn .cm-sectionTitle{color:#2e8b57;font-weight:700}.cm-s-ttcn .cm-booleanConsts,.cm-s-ttcn .cm-otherConsts,.cm-s-ttcn .cm-verdictConsts{color:#006400}.cm-s-ttcn .cm-configOps,.cm-s-ttcn .cm-functionOps,.cm-s-ttcn .cm-portOps,.cm-s-ttcn .cm-sutOps,.cm-s-ttcn .cm-timerOps,.cm-s-ttcn .cm-verdictOps{color:#00f}.cm-s-ttcn .cm-preprocessor,.cm-s-ttcn .cm-templateMatch,.cm-s-ttcn .cm-ttcn3Macros{color:#27408b}.cm-s-ttcn .cm-types{color:brown;font-weight:700}.cm-s-ttcn .cm-visibilityModifiers{font-weight:700}.cm-s-twilight.CodeMirror{background:#141414;color:#f7f7f7}.cm-s-twilight div.CodeMirror-selected{background:#323232}.cm-s-twilight .CodeMirror-line::selection,.cm-s-twilight .CodeMirror-line>span::selection,.cm-s-twilight .CodeMirror-line>span>span::selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-line::-moz-selection,.cm-s-twilight .CodeMirror-line>span::-moz-selection,.cm-s-twilight .CodeMirror-line>span>span::-moz-selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-gutters{background:#222;border-right:1px solid #aaa}.cm-s-twilight .CodeMirror-guttermarker{color:#fff}.cm-s-twilight .CodeMirror-guttermarker-subtle,.cm-s-twilight .CodeMirror-linenumber{color:#aaa}.cm-s-twilight .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-twilight .cm-keyword{color:#f9ee98}.cm-s-twilight .cm-atom{color:#fc0}.cm-s-twilight .cm-number{color:#ca7841}.cm-s-twilight .cm-def{color:#8da6ce}.cm-s-twilight span.cm-def,.cm-s-twilight span.cm-tag,.cm-s-twilight span.cm-variable-2,.cm-s-twilight span.cm-variable-3{color:#607392}.cm-s-twilight .cm-operator{color:#cda869}.cm-s-twilight .cm-comment{color:#777;font-style:italic;font-weight:400}.cm-s-twilight .cm-string{color:#8f9d6a;font-style:italic}.cm-s-twilight .cm-string-2{color:#bd6b18}.cm-s-twilight .cm-meta{background-color:#141414;color:#f7f7f7}.cm-s-twilight .cm-builtin{color:#cda869}.cm-s-twilight .cm-tag{color:#997643}.cm-s-twilight .cm-attribute{color:#d6bb6d}.cm-s-twilight .cm-header{color:#ff6400}.cm-s-twilight .cm-hr{color:#aeaeae}.cm-s-twilight .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-twilight .cm-error{border-bottom:1px solid red}.cm-s-twilight .CodeMirror-activeline-background{background:#27282e}.cm-s-twilight .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-vibrant-ink.CodeMirror{background:#000;color:#fff}.cm-s-vibrant-ink div.CodeMirror-selected{background:#35493c}.cm-s-vibrant-ink .CodeMirror-line::selection,.cm-s-vibrant-ink .CodeMirror-line>span::selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-line::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::-moz-selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-vibrant-ink .CodeMirror-guttermarker{color:#fff}.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle,.cm-s-vibrant-ink .CodeMirror-linenumber{color:#d0d0d0}.cm-s-vibrant-ink .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-vibrant-ink .cm-keyword{color:#cc7832}.cm-s-vibrant-ink .cm-atom{color:#fc0}.cm-s-vibrant-ink .cm-number{color:#ffee98}.cm-s-vibrant-ink .cm-def{color:#8da6ce}.cm-s-vibrant-ink span.cm-variable-2,.cm-s-vibrant-ink span.cm-variable-3,.cm-s-vibrant span.cm-def,.cm-s-vibrant span.cm-tag{color:#ffc66d}.cm-s-vibrant-ink .cm-operator{color:#888}.cm-s-vibrant-ink .cm-comment{color:gray;font-weight:700}.cm-s-vibrant-ink .cm-string{color:#a5c25c}.cm-s-vibrant-ink .cm-string-2{color:red}.cm-s-vibrant-ink .cm-meta{color:#d8fa3c}.cm-s-vibrant-ink .cm-attribute,.cm-s-vibrant-ink .cm-builtin,.cm-s-vibrant-ink .cm-tag{color:#8da6ce}.cm-s-vibrant-ink .cm-header{color:#ff6400}.cm-s-vibrant-ink .cm-hr{color:#aeaeae}.cm-s-vibrant-ink .cm-link{color:blue}.cm-s-vibrant-ink .cm-error{border-bottom:1px solid red}.cm-s-vibrant-ink .CodeMirror-activeline-background{background:#27282e}.cm-s-vibrant-ink .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-xq-dark.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-xq-dark div.CodeMirror-selected{background:#27007a}.cm-s-xq-dark .CodeMirror-line::selection,.cm-s-xq-dark .CodeMirror-line>span::selection,.cm-s-xq-dark .CodeMirror-line>span>span::selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-line::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-xq-dark .CodeMirror-guttermarker{color:#ffbd40}.cm-s-xq-dark .CodeMirror-guttermarker-subtle,.cm-s-xq-dark .CodeMirror-linenumber{color:#f8f8f8}.cm-s-xq-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-xq-dark span.cm-keyword{color:#ffbd40}.cm-s-xq-dark span.cm-atom{color:#6c8cd5}.cm-s-xq-dark span.cm-number{color:#164}.cm-s-xq-dark span.cm-def{color:#fff;text-decoration:underline}.cm-s-xq-dark span.cm-variable{color:#fff}.cm-s-xq-dark span.cm-variable-2{color:#eee}.cm-s-xq-dark span.cm-variable-3{color:#ddd}.cm-s-xq-dark span.cm-comment{color:gray}.cm-s-xq-dark span.cm-string{color:#9fee00}.cm-s-xq-dark span.cm-meta{color:#ff0}.cm-s-xq-dark span.cm-qualifier{color:#fff700}.cm-s-xq-dark span.cm-builtin{color:#30a}.cm-s-xq-dark span.cm-bracket{color:#cc7}.cm-s-xq-dark span.cm-tag{color:#ffbd40}.cm-s-xq-dark span.cm-attribute{color:#fff700}.cm-s-xq-dark span.cm-error{color:red}.cm-s-xq-dark .CodeMirror-activeline-background{background:#27282e}.cm-s-xq-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-xq-light span.cm-keyword{line-height:1em;font-weight:700;color:#5a5cad}.cm-s-xq-light span.cm-atom{color:#6c8cd5}.cm-s-xq-light span.cm-number{color:#164}.cm-s-xq-light span.cm-def{text-decoration:underline}.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3{color:#000}.cm-s-xq-light span.cm-comment{color:#0080ff;font-style:italic}.cm-s-xq-light span.cm-string{color:red}.cm-s-xq-light span.cm-meta{color:#ff0}.cm-s-xq-light span.cm-qualifier{color:grey}.cm-s-xq-light span.cm-builtin{color:#7ea656}.cm-s-xq-light span.cm-bracket{color:#cc7}.cm-s-xq-light span.cm-tag{color:#3f7f7f}.cm-s-xq-light span.cm-attribute{color:#7f007f}.cm-s-xq-light span.cm-error{color:red}.cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-xq-light .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important;background:#ff0}.cm-s-yeti.CodeMirror{background-color:#eceae8!important;color:#d1c9c0!important;border:none}.cm-s-yeti .CodeMirror-gutters{color:#adaba6;background-color:#e5e1db;border:none}.cm-s-yeti .CodeMirror-cursor{border-left:thin solid #d1c9c0}.cm-s-yeti .CodeMirror-linenumber{color:#adaba6}.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::selection,.cm-s-yeti .CodeMirror-line>span::selection,.cm-s-yeti .CodeMirror-line>span>span::selection{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::-moz-selection,.cm-s-yeti .CodeMirror-line>span::-moz-selection,.cm-s-yeti .CodeMirror-line>span>span::-moz-selection{background:#dcd8d2}.cm-s-yeti span.cm-comment{color:#d4c8be}.cm-s-yeti span.cm-string,.cm-s-yeti span.cm-string-2{color:#96c0d8}.cm-s-yeti span.cm-number{color:#a074c4}.cm-s-yeti span.cm-variable{color:#55b5db}.cm-s-yeti span.cm-variable-2{color:#a074c4}.cm-s-yeti span.cm-def{color:#55b5db}.cm-s-yeti span.cm-keyword,.cm-s-yeti span.cm-operator{color:#9fb96e}.cm-s-yeti span.cm-atom{color:#a074c4}.cm-s-yeti span.cm-meta,.cm-s-yeti span.cm-tag{color:#96c0d8}.cm-s-yeti span.cm-attribute{color:#9fb96e}.cm-s-yeti span.cm-qualifier{color:#96c0d8}.cm-s-yeti span.cm-builtin,.cm-s-yeti span.cm-property{color:#a074c4}.cm-s-yeti span.cm-variable-3{color:#96c0d8}.cm-s-yeti .CodeMirror-activeline-background{background:#e7e4e0}.cm-s-yeti .CodeMirror-matchingbracket{text-decoration:underline}.cm-s-zenburn .CodeMirror-gutters{background:#3f3f3f!important}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:#999}.cm-s-zenburn .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-zenburn{background-color:#3f3f3f;color:#dcdccc}.cm-s-zenburn span.cm-builtin{color:#dcdccc;font-weight:700}.cm-s-zenburn span.cm-comment{color:#7f9f7f}.cm-s-zenburn span.cm-keyword{color:#f0dfaf;font-weight:700}.cm-s-zenburn span.cm-atom{color:#bfebbf}.cm-s-zenburn span.cm-def{color:#dcdccc}.cm-s-zenburn span.cm-variable{color:#dfaf8f}.cm-s-zenburn span.cm-variable-2{color:#dcdccc}.cm-s-zenburn span.cm-string,.cm-s-zenburn span.cm-string-2{color:#cc9393}.cm-s-zenburn span.cm-number{color:#dcdccc}.cm-s-zenburn span.cm-tag{color:#93e0e3}.cm-s-zenburn span.cm-attribute,.cm-s-zenburn span.cm-property{color:#dfaf8f}.cm-s-zenburn span.cm-qualifier{color:#7cb8bb}.cm-s-zenburn span.cm-meta{color:#f0dfaf}.cm-s-zenburn span.cm-header,.cm-s-zenburn span.cm-operator{color:#f0efd0}.cm-s-zenburn span.CodeMirror-matchingbracket{box-sizing:border-box;background:transparent;border-bottom:1px solid}.cm-s-zenburn span.CodeMirror-nonmatchingbracket{border-bottom:1px solid;background:none}.cm-s-zenburn .CodeMirror-activeline,.cm-s-zenburn .CodeMirror-activeline-background{background:#000}.cm-s-zenburn div.CodeMirror-selected{background:#545454}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected{background:#4f4f4f}.CodeMirror{font:inherit}.CodeMirror-scroll{font-family:Menlo Regular,Consolas,Monaco,monospace;line-height:150%;position:relative}.CodeMirror-settings{color:#444;height:0;width:100%;z-index:9;text-shadow:none}.CodeMirror-settings__toggle{border-radius:3px;z-index:11;box-sizing:border-box;position:absolute;top:0;right:0;margin:6px;display:block;cursor:pointer}.CodeMirror-settings__toggle:after{content:"\f111";font-family:dashicons;line-height:1em;display:inline-block}.CodeMirror-settings__toggle:before{border:1px solid #ddd;border-radius:3px;z-index:-1;content:"";background-color:#fff;transition:.25s ease;transition-property:transform opacity;position:absolute;top:0;right:0;bottom:0;left:0}.CodeMirror-settings__wrapper{pointer-events:none;visibility:hidden}.CodeMirror-settings__body,.CodeMirror-settings__docked{pointer-events:auto;visibility:visible}.CodeMirror-settings__wrapper{position:absolute;width:calc(100% - 12px);max-height:calc(100% - 12px);top:0;margin:6px;box-sizing:border-box;z-index:9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.CodeMirror-settings__docked{-ms-flex:0 0 auto;flex:0 0 auto;z-index:10;background-color:#fff;box-sizing:border-box}.CodeMirror-settings__header{border-top-left-radius:3px;border-top-right-radius:3px;border:1px solid #ddd;padding:4px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.CodeMirror-settings__body{-ms-flex:1 1 auto;flex:1 1 auto;box-sizing:border-box;padding:1px 12px;overflow-y:auto;background-color:hsla(0,0%,100%,.93);border-left:1px solid #ddd;border-right:1px solid #ddd}.CodeMirror-settings__footer{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border:1px solid #ddd;padding:6px 12px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;-ms-flex-line-pack:center;align-content:center;-ms-flex-pack:justify;justify-content:space-between}td.CodeMirror-settings__heading{padding:0}.CodeMirror-settings__foot-content{margin:0}.CodeMirror-settings__body,.CodeMirror-settings__footer,.CodeMirror-settings__header,.CodeMirror-settings__toggle,.CodeMirror-settings__toggle-advanced,.CodeMirror-settings__wrapper{transition:.25s ease;transition-property:opacity,transform;transform-origin:top right}.CodeMirror-settings.closed .CodeMirror-settings__toggle-advanced:before{content:"more..."}.CodeMirror-settings.closed .CodeMirror-settings__toggle{opacity:.5}.CodeMirror-settings.closed .CodeMirror-settings__toggle:before,.CodeMirror-settings.closed .CodeMirror-settings__toggle:hover{opacity:1}.CodeMirror-settings.closed .CodeMirror-settings__wrapper{opacity:0;transform:scaleX(0)}.CodeMirror-settings.closed .CodeMirror-settings__body,.CodeMirror-settings.closed .CodeMirror-settings__footer{visibility:hidden;opacity:0;transform:translateY(-20px);transition:opacity .25s ease,transform .25s ease,visibility 1ms ease .25s}.CodeMirror-settings.open .CodeMirror-settings__toggle-advanced:before{content:"more..."}.CodeMirror-settings.open .CodeMirror-settings__toggle:after{content:"\f158"}.CodeMirror-settings.open .CodeMirror-settings__toggle:before{opacity:0}.CodeMirror-settings.open .CodeMirror-settings__wrapper{opacity:1;transform:scaleX(1)}.CodeMirror-settings.open .CodeMirror-settings__body,.CodeMirror-settings.open .CodeMirror-settings__footer{visibility:hidden;opacity:0;transform:translateY(-20px);transition:opacity .25s ease,transform .25s ease,visibility 1ms ease .25s}.CodeMirror-settings.open-advanced .CodeMirror-settings__toggle-advanced:before{content:"less"}.CodeMirror-settings.open-advanced .CodeMirror-settings__header{border-bottom-left-radius:0;border-bottom-right-radius:0}.CodeMirror-settings.open-advanced .CodeMirror-settings__body,.CodeMirror-settings.open-advanced .CodeMirror-settings__footer{visibility:visible;opacity:1;transform:translate(0);transition:visibility 1ms ease,opacity .25s ease 1ms,transform .25s ease 1ms}.CodeMirror-settings__button{position:relative}.CodeMirror-settings__button:active{transform:none!important}.CodeMirror-settings__button input,.CodeMirror-settings__button select{display:block;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-appearance:none;margin:0;padding:0;border:none;height:auto;font-size:0;line-height:0;height:100%!important;width:100%!important;background:none;opacity:0}.CodeMirror-settings__button option{font-size:12px}.CodeMirror-settings__button--select:after{content:"\f140";font-family:dashicons;vertical-align:top;display:inline-block;margin:0 -5px -4px}.CodeMirror-settings__toggle-advanced{cursor:pointer;display:inline-block;line-height:25px;padding:0 4px;vertical-align:middle}.wp-editor-expand .CodeMirror{min-height:300px}.wp-editor-expand .CodeMirror .CodeMirror-scroll{padding-bottom:330px!important;margin-bottom:-330px!important}.CodeMirror-mirrored{display:block!important;position:fixed!important;left:-9999px!important;top:-9999px!important;z-index:-999!important;opacity:0!important}#template .CodeMirror div{margin-right:0}#template .CodeMirror p{width:auto}.CodeMirror-vscrollbar{display:none!important}.CodeMirror-scroll{margin-right:-30px!important}.CodeMirror-settings__toggle{margin:6px!important}.heshFullscreen{z-index:99999;position:fixed!important;top:0;left:0;right:0;bottom:0;height:100%;background:#fff;padding:2% 2% 0}.heshFullscreen .CodeMirror{border:1px solid #ccc;border-radius:0 0 4px 4px;height:85%!important}.heshFullscreen #ed_toolbar{border:1px solid #ccc;border-bottom:0;border-radius:4px 4px 0 0}.heshFullscreen #cm_content_fullscreen:before{content:"\f506"}#cm_content_fullscreen{display:inline-block}.wp-editor-expand #cm_content_fullscreen{display:none}.hesh-content-resize-handle{position:absolute;right:0;bottom:0;width:12px;height:12px;z-index:8;margin:1px!important}#ed_toolbar{z-index:10}@media screen and (min-width:782px){.CodeMirror-settings__toggle{height:35px;width:35px}.CodeMirror-settings__toggle:after{font-size:20px;margin:7px}.CodeMirror-settings__docked{min-height:35px}.CodeMirror-settings__header{padding-right:35px}.CodeMirror-settings__button--select:after{font-size:16px;margin-top:0}#template .CodeMirror{margin-right:20px}}@media screen and (max-width:781px){.CodeMirror-settings__toggle{height:44px;width:44px}.CodeMirror-settings__toggle:after{font-size:28px;margin:8px}.CodeMirror-settings__docked{min-height:44px}.CodeMirror-settings__header{padding-right:44px}.CodeMirror-settings__button--select:after{font-size:20px;margin-top:-2px}#template .CodeMirror{margin-right:0}}@media screen and (max-height:550px){.heshFullscreen .CodeMirror{height:75%!important}}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}@keyframes a{50%{background-color:transparent}}
|
1 |
+
.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.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:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;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-animate-fat-cursor{width:auto;border:0;animation:a 1.06s steps(1) infinite;background-color:#7e7}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;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:700}.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{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,.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-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display: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:-30px}.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{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;font-variant-ligatures:contextual}.CodeMirror-wrap pre{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;overflow:auto}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{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}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{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:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}.cm-s-3024-day div.CodeMirror-selected{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::-moz-selection{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::selection,.cm-s-3024-day .CodeMirror-line>span::selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::-moz-selection{background:#d9d9d9}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d9d9d9}.cm-s-3024-day .CodeMirror-gutters{background:#f7f7f7;border-right:0}.cm-s-3024-day .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-day .CodeMirror-guttermarker-subtle,.cm-s-3024-day .CodeMirror-linenumber{color:#807d7c}.cm-s-3024-day .CodeMirror-cursor{border-left:1px solid #5c5855}.cm-s-3024-day span.cm-comment{color:#cdab53}.cm-s-3024-day span.cm-atom,.cm-s-3024-day span.cm-number{color:#a16a94}.cm-s-3024-day span.cm-attribute,.cm-s-3024-day span.cm-property{color:#01a252}.cm-s-3024-day span.cm-keyword{color:#db2d20}.cm-s-3024-day span.cm-string{color:#fded02}.cm-s-3024-day span.cm-variable{color:#01a252}.cm-s-3024-day span.cm-variable-2{color:#01a0e4}.cm-s-3024-day span.cm-def{color:#e8bbd0}.cm-s-3024-day span.cm-bracket{color:#3a3432}.cm-s-3024-day span.cm-tag{color:#db2d20}.cm-s-3024-day span.cm-link{color:#a16a94}.cm-s-3024-day span.cm-error{background:#db2d20;color:#5c5855}.cm-s-3024-day .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-3024-day .CodeMirror-matchingbracket{text-decoration:underline;color:#a16a94!important}.cm-s-3024-night.CodeMirror{background:#090300;color:#d6d5d4}.cm-s-3024-night div.CodeMirror-selected{background:#3a3432}.cm-s-3024-night .CodeMirror-line::selection,.cm-s-3024-night .CodeMirror-line>span::selection,.cm-s-3024-night .CodeMirror-line>span>span::selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-line::-moz-selection,.cm-s-3024-night .CodeMirror-line>span::-moz-selection,.cm-s-3024-night .CodeMirror-line>span>span::-moz-selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-gutters{background:#090300;border-right:0}.cm-s-3024-night .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-night .CodeMirror-guttermarker-subtle,.cm-s-3024-night .CodeMirror-linenumber{color:#5c5855}.cm-s-3024-night .CodeMirror-cursor{border-left:1px solid #807d7c}.cm-s-3024-night span.cm-comment{color:#cdab53}.cm-s-3024-night span.cm-atom,.cm-s-3024-night span.cm-number{color:#a16a94}.cm-s-3024-night span.cm-attribute,.cm-s-3024-night span.cm-property{color:#01a252}.cm-s-3024-night span.cm-keyword{color:#db2d20}.cm-s-3024-night span.cm-string{color:#fded02}.cm-s-3024-night span.cm-variable{color:#01a252}.cm-s-3024-night span.cm-variable-2{color:#01a0e4}.cm-s-3024-night span.cm-def{color:#e8bbd0}.cm-s-3024-night span.cm-bracket{color:#d6d5d4}.cm-s-3024-night span.cm-tag{color:#db2d20}.cm-s-3024-night span.cm-link{color:#a16a94}.cm-s-3024-night span.cm-error{background:#db2d20;color:#807d7c}.cm-s-3024-night .CodeMirror-activeline-background{background:#2f2f2f}.cm-s-3024-night .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-abcdef.CodeMirror{background:#0f0f0f;color:#defdef}.cm-s-abcdef div.CodeMirror-selected{background:#515151}.cm-s-abcdef .CodeMirror-line::selection,.cm-s-abcdef .CodeMirror-line>span::selection,.cm-s-abcdef .CodeMirror-line>span>span::selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-line::-moz-selection,.cm-s-abcdef .CodeMirror-line>span::-moz-selection,.cm-s-abcdef .CodeMirror-line>span>span::-moz-selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-gutters{background:#555;border-right:2px solid #314151}.cm-s-abcdef .CodeMirror-guttermarker{color:#222}.cm-s-abcdef .CodeMirror-guttermarker-subtle{color:azure}.cm-s-abcdef .CodeMirror-linenumber{color:#fff}.cm-s-abcdef .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-abcdef span.cm-keyword{color:#b8860b;font-weight:700}.cm-s-abcdef span.cm-atom{color:#77f}.cm-s-abcdef span.cm-number{color:violet}.cm-s-abcdef span.cm-def{color:#fffabc}.cm-s-abcdef span.cm-variable{color:#abcdef}.cm-s-abcdef span.cm-variable-2{color:#cacbcc}.cm-s-abcdef span.cm-variable-3{color:#def}.cm-s-abcdef span.cm-property{color:#fedcba}.cm-s-abcdef span.cm-operator{color:#ff0}.cm-s-abcdef span.cm-comment{color:#7a7b7c;font-style:italic}.cm-s-abcdef span.cm-string{color:#2b4}.cm-s-abcdef span.cm-meta{color:#c9f}.cm-s-abcdef span.cm-qualifier{color:#fff700}.cm-s-abcdef span.cm-builtin{color:#30aabc}.cm-s-abcdef span.cm-bracket{color:#8a8a8a}.cm-s-abcdef span.cm-tag{color:#fd4}.cm-s-abcdef span.cm-attribute{color:#df0}.cm-s-abcdef span.cm-error{color:red}.cm-s-abcdef span.cm-header{color:#7fffd4;font-weight:700}.cm-s-abcdef span.cm-link{color:#8a2be2}.cm-s-abcdef .CodeMirror-activeline-background{background:#314151}.cm-s-ambiance.CodeMirror{box-shadow:none}.cm-s-ambiance .cm-header{color:blue}.cm-s-ambiance .cm-quote{color:#24c2c7}.cm-s-ambiance .cm-keyword{color:#cda869}.cm-s-ambiance .cm-atom{color:#cf7ea9}.cm-s-ambiance .cm-number{color:#78cf8a}.cm-s-ambiance .cm-def{color:#aac6e3}.cm-s-ambiance .cm-variable{color:#ffb795}.cm-s-ambiance .cm-variable-2{color:#eed1b3}.cm-s-ambiance .cm-variable-3{color:#faded3}.cm-s-ambiance .cm-property{color:#eed1b3}.cm-s-ambiance .cm-operator{color:#fa8d6a}.cm-s-ambiance .cm-comment{color:#555;font-style:italic}.cm-s-ambiance .cm-string{color:#8f9d6a}.cm-s-ambiance .cm-string-2{color:#9d937c}.cm-s-ambiance .cm-meta{color:#d2a8a1}.cm-s-ambiance .cm-qualifier{color:#ff0}.cm-s-ambiance .cm-builtin{color:#99c}.cm-s-ambiance .cm-bracket{color:#24c2c7}.cm-s-ambiance .cm-tag{color:#fee4ff}.cm-s-ambiance .cm-attribute{color:#9b859d}.cm-s-ambiance .cm-hr{color:pink}.cm-s-ambiance .cm-link{color:#f4c20b}.cm-s-ambiance .cm-special{color:#ff9d00}.cm-s-ambiance .cm-error{color:#af2018}.cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0}.cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22}.cm-s-ambiance div.CodeMirror-selected{background:hsla(0,0%,100%,.15)}.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-ambiance .CodeMirror-line::selection,.cm-s-ambiance .CodeMirror-line>span::selection,.cm-s-ambiance .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-ambiance .CodeMirror-line::-moz-selection,.cm-s-ambiance .CodeMirror-line>span::-moz-selection,.cm-s-ambiance .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-ambiance.CodeMirror{line-height:1.4em;color:#e6e1dc;background-color:#202020;box-shadow:inset 0 0 10px #000}.cm-s-ambiance .CodeMirror-gutters{background:#3d3d3d;border-right:1px solid #4d4d4d;box-shadow:0 10px 20px #000}.cm-s-ambiance .CodeMirror-linenumber{text-shadow:0 1px 1px #4d4d4d;color:#111;padding:0 5px}.cm-s-ambiance .CodeMirror-guttermarker{color:#aaa}.cm-s-ambiance .CodeMirror-guttermarker-subtle{color:#111}.cm-s-ambiance .CodeMirror-cursor{border-left:1px solid #7991e8}.cm-s-ambiance .CodeMirror-activeline-background{background:none repeat scroll 0 0 hsla(0,0%,100%,.031)}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:#151515;color:#e0e0e0}.cm-s-base16-dark div.CodeMirror-selected{background:#303030}.cm-s-base16-dark .CodeMirror-line::selection,.cm-s-base16-dark .CodeMirror-line>span::selection,.cm-s-base16-dark .CodeMirror-line>span>span::selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-line::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-gutters{background:#151515;border-right:0}.cm-s-base16-dark .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-dark .CodeMirror-guttermarker-subtle,.cm-s-base16-dark .CodeMirror-linenumber{color:#505050}.cm-s-base16-dark .CodeMirror-cursor{border-left:1px solid #b0b0b0}.cm-s-base16-dark span.cm-comment{color:#8f5536}.cm-s-base16-dark span.cm-atom,.cm-s-base16-dark span.cm-number{color:#aa759f}.cm-s-base16-dark span.cm-attribute,.cm-s-base16-dark span.cm-property{color:#90a959}.cm-s-base16-dark span.cm-keyword{color:#ac4142}.cm-s-base16-dark span.cm-string{color:#f4bf75}.cm-s-base16-dark span.cm-variable{color:#90a959}.cm-s-base16-dark span.cm-variable-2{color:#6a9fb5}.cm-s-base16-dark span.cm-def{color:#d28445}.cm-s-base16-dark span.cm-bracket{color:#e0e0e0}.cm-s-base16-dark span.cm-tag{color:#ac4142}.cm-s-base16-dark span.cm-link{color:#aa759f}.cm-s-base16-dark span.cm-error{background:#ac4142;color:#b0b0b0}.cm-s-base16-dark .CodeMirror-activeline-background{background:#202020}.cm-s-base16-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::selection,.cm-s-base16-light .CodeMirror-line>span::selection,.cm-s-base16-light .CodeMirror-line>span>span::selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::-moz-selection,.cm-s-base16-light .CodeMirror-line>span::-moz-selection,.cm-s-base16-light .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-base16-light .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-light .CodeMirror-guttermarker-subtle,.cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}.cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050}.cm-s-base16-light span.cm-comment{color:#8f5536}.cm-s-base16-light span.cm-atom,.cm-s-base16-light span.cm-number{color:#aa759f}.cm-s-base16-light span.cm-attribute,.cm-s-base16-light span.cm-property{color:#90a959}.cm-s-base16-light span.cm-keyword{color:#ac4142}.cm-s-base16-light span.cm-string{color:#f4bf75}.cm-s-base16-light span.cm-variable{color:#90a959}.cm-s-base16-light span.cm-variable-2{color:#6a9fb5}.cm-s-base16-light span.cm-def{color:#d28445}.cm-s-base16-light span.cm-bracket{color:#202020}.cm-s-base16-light span.cm-tag{color:#ac4142}.cm-s-base16-light span.cm-link{color:#aa759f}.cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}.cm-s-base16-light .CodeMirror-activeline-background{background:#dddcdc}.cm-s-base16-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-bespin.CodeMirror{background:#28211c;color:#9d9b97}.cm-s-bespin div.CodeMirror-selected{background:#36312e!important}.cm-s-bespin .CodeMirror-gutters{background:#28211c;border-right:0}.cm-s-bespin .CodeMirror-linenumber{color:#666}.cm-s-bespin .CodeMirror-cursor{border-left:1px solid #797977!important}.cm-s-bespin span.cm-comment{color:#937121}.cm-s-bespin span.cm-atom,.cm-s-bespin span.cm-number{color:#9b859d}.cm-s-bespin span.cm-attribute,.cm-s-bespin span.cm-property{color:#54be0d}.cm-s-bespin span.cm-keyword{color:#cf6a4c}.cm-s-bespin span.cm-string{color:#f9ee98}.cm-s-bespin span.cm-variable{color:#54be0d}.cm-s-bespin span.cm-variable-2{color:#5ea6ea}.cm-s-bespin span.cm-def{color:#cf7d34}.cm-s-bespin span.cm-error{background:#cf6a4c;color:#797977}.cm-s-bespin span.cm-bracket{color:#9d9b97}.cm-s-bespin span.cm-tag{color:#cf6a4c}.cm-s-bespin span.cm-link{color:#9b859d}.cm-s-bespin .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-bespin .CodeMirror-activeline-background{background:#404040}.cm-s-blackboard.CodeMirror{background:#0c1021;color:#f8f8f8}.cm-s-blackboard div.CodeMirror-selected{background:#253b76}.cm-s-blackboard .CodeMirror-line::selection,.cm-s-blackboard .CodeMirror-line>span::selection,.cm-s-blackboard .CodeMirror-line>span>span::selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-line::-moz-selection,.cm-s-blackboard .CodeMirror-line>span::-moz-selection,.cm-s-blackboard .CodeMirror-line>span>span::-moz-selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-gutters{background:#0c1021;border-right:0}.cm-s-blackboard .CodeMirror-guttermarker{color:#fbde2d}.cm-s-blackboard .CodeMirror-guttermarker-subtle,.cm-s-blackboard .CodeMirror-linenumber{color:#888}.cm-s-blackboard .CodeMirror-cursor{border-left:1px solid #a7a7a7}.cm-s-blackboard .cm-keyword{color:#fbde2d}.cm-s-blackboard .cm-atom,.cm-s-blackboard .cm-number{color:#d8fa3c}.cm-s-blackboard .cm-def{color:#8da6ce}.cm-s-blackboard .cm-variable{color:#ff6400}.cm-s-blackboard .cm-operator{color:#fbde2d}.cm-s-blackboard .cm-comment{color:#aeaeae}.cm-s-blackboard .cm-string,.cm-s-blackboard .cm-string-2{color:#61ce3c}.cm-s-blackboard .cm-meta{color:#d8fa3c}.cm-s-blackboard .cm-attribute,.cm-s-blackboard .cm-builtin,.cm-s-blackboard .cm-tag{color:#8da6ce}.cm-s-blackboard .cm-header{color:#ff6400}.cm-s-blackboard .cm-hr{color:#aeaeae}.cm-s-blackboard .cm-link{color:#8da6ce}.cm-s-blackboard .cm-error{background:#9d1e15;color:#f8f8f8}.cm-s-blackboard .CodeMirror-activeline-background{background:#3c3636}.cm-s-blackboard .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-cobalt.CodeMirror{background:#002240;color:#fff}.cm-s-cobalt div.CodeMirror-selected{background:#b36539}.cm-s-cobalt .CodeMirror-line::selection,.cm-s-cobalt .CodeMirror-line>span::selection,.cm-s-cobalt .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-line::-moz-selection,.cm-s-cobalt .CodeMirror-line>span::-moz-selection,.cm-s-cobalt .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-cobalt .CodeMirror-guttermarker{color:#ffee80}.cm-s-cobalt .CodeMirror-guttermarker-subtle,.cm-s-cobalt .CodeMirror-linenumber{color:#d0d0d0}.cm-s-cobalt .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-cobalt span.cm-comment{color:#08f}.cm-s-cobalt span.cm-atom{color:#845dc4}.cm-s-cobalt span.cm-attribute,.cm-s-cobalt span.cm-number{color:#ff80e1}.cm-s-cobalt span.cm-keyword{color:#ffee80}.cm-s-cobalt span.cm-string{color:#3ad900}.cm-s-cobalt span.cm-meta{color:#ff9d00}.cm-s-cobalt span.cm-tag,.cm-s-cobalt span.cm-variable-2{color:#9effff}.cm-s-cobalt span.cm-def,.cm-s-cobalt span.cm-variable-3{color:#fff}.cm-s-cobalt span.cm-bracket{color:#d8d8d8}.cm-s-cobalt span.cm-builtin,.cm-s-cobalt span.cm-special{color:#ff9e59}.cm-s-cobalt span.cm-link{color:#845dc4}.cm-s-cobalt span.cm-error{color:#9d1e15}.cm-s-cobalt .CodeMirror-activeline-background{background:#002d57}.cm-s-cobalt .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-colorforth.CodeMirror{background:#000;color:#f8f8f8}.cm-s-colorforth .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-colorforth .CodeMirror-guttermarker{color:#ffbd40}.cm-s-colorforth .CodeMirror-guttermarker-subtle{color:#78846f}.cm-s-colorforth .CodeMirror-linenumber{color:#bababa}.cm-s-colorforth .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-colorforth span.cm-comment{color:#ededed}.cm-s-colorforth span.cm-def{color:#ff1c1c;font-weight:700}.cm-s-colorforth span.cm-keyword{color:#ffd900}.cm-s-colorforth span.cm-builtin{color:#00d95a}.cm-s-colorforth span.cm-variable{color:#73ff00}.cm-s-colorforth span.cm-string{color:#007bff}.cm-s-colorforth span.cm-number{color:#00c4ff}.cm-s-colorforth span.cm-atom{color:#606060}.cm-s-colorforth span.cm-variable-2{color:#eee}.cm-s-colorforth span.cm-variable-3{color:#ddd}.cm-s-colorforth span.cm-meta{color:#ff0}.cm-s-colorforth span.cm-qualifier{color:#fff700}.cm-s-colorforth span.cm-bracket{color:#cc7}.cm-s-colorforth span.cm-tag{color:#ffbd40}.cm-s-colorforth span.cm-attribute{color:#fff700}.cm-s-colorforth span.cm-error{color:red}.cm-s-colorforth div.CodeMirror-selected{background:#333d53}.cm-s-colorforth span.cm-compilation{background:hsla(0,0%,100%,.12)}.cm-s-colorforth .CodeMirror-activeline-background{background:#253540}.cm-s-dracula.CodeMirror,.cm-s-dracula .CodeMirror-gutters{background-color:#282a36!important;color:#f8f8f2!important;border:none}.cm-s-dracula .CodeMirror-gutters{color:#282a36}.cm-s-dracula .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-activeline-background{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-duotone-dark.CodeMirror{background:#2a2734;color:#6c6783}.cm-s-duotone-dark div.CodeMirror-selected{background:#545167!important}.cm-s-duotone-dark .CodeMirror-gutters{background:#2a2734;border-right:0}.cm-s-duotone-dark .CodeMirror-linenumber{color:#545167}.cm-s-duotone-dark .CodeMirror-cursor{border-left:1px solid #ffad5c;border-right:.5em solid #ffad5c;opacity:.5}.cm-s-duotone-dark .CodeMirror-activeline-background{background:#363342;opacity:.5}.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor{background:#ffad5c;opacity:.5}.cm-s-duotone-dark span.cm-atom,.cm-s-duotone-dark span.cm-attribute,.cm-s-duotone-dark span.cm-hr,.cm-s-duotone-dark span.cm-keyword,.cm-s-duotone-dark span.cm-link,.cm-s-duotone-dark span.cm-number,.cm-s-duotone-dark span.cm-quote,.cm-s-duotone-dark span.cm-variable{color:#fc9}.cm-s-duotone-dark span.cm-property{color:#9a86fd}.cm-s-duotone-dark span.cm-negative,.cm-s-duotone-dark span.cm-punctuation,.cm-s-duotone-dark span.cm-unit{color:#e09142}.cm-s-duotone-dark span.cm-string{color:#ffb870}.cm-s-duotone-dark span.cm-operator{color:#ffad5c}.cm-s-duotone-dark span.cm-positive{color:#6a51e6}.cm-s-duotone-dark span.cm-string-2,.cm-s-duotone-dark span.cm-url,.cm-s-duotone-dark span.cm-variable-2,.cm-s-duotone-dark span.cm-variable-3{color:#7a63ee}.cm-s-duotone-dark span.cm-builtin,.cm-s-duotone-dark span.cm-def,.cm-s-duotone-dark span.cm-em,.cm-s-duotone-dark span.cm-header,.cm-s-duotone-dark span.cm-qualifier,.cm-s-duotone-dark span.cm-tag{color:#eeebff}.cm-s-duotone-dark span.cm-bracket,.cm-s-duotone-dark span.cm-comment{color:#6c6783}.cm-s-duotone-dark span.cm-error,.cm-s-duotone-dark span.cm-invalidchar{color:red}.cm-s-duotone-dark span.cm-header{font-weight:400}.cm-s-duotone-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#eeebff!important}.cm-s-duotone-light.CodeMirror{background:#faf8f5;color:#b29762}.cm-s-duotone-light div.CodeMirror-selected{background:#e3dcce!important}.cm-s-duotone-light .CodeMirror-gutters{background:#faf8f5;border-right:0}.cm-s-duotone-light .CodeMirror-linenumber{color:#cdc4b1}.cm-s-duotone-light .CodeMirror-cursor{border-left:1px solid #93abdc;border-right:.5em solid #93abdc;opacity:.5}.cm-s-duotone-light .CodeMirror-activeline-background{background:#e3dcce;opacity:.5}.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor{background:#93abdc;opacity:.5}.cm-s-duotone-light-light span.cm-hr,.cm-s-duotone-light-light span.cm-link,.cm-s-duotone-light span.cm-atom,.cm-s-duotone-light span.cm-attribute,.cm-s-duotone-light span.cm-keyword,.cm-s-duotone-light span.cm-number,.cm-s-duotone-light span.cm-quote,.cm-s-duotone-light span.cm-variable{color:#063289}.cm-s-duotone-light span.cm-property{color:#b29762}.cm-s-duotone-light span.cm-negative,.cm-s-duotone-light span.cm-punctuation,.cm-s-duotone-light span.cm-unit{color:#063289}.cm-s-duotone-light span.cm-operator,.cm-s-duotone-light span.cm-string{color:#1659df}.cm-s-duotone-light span.cm-positive,.cm-s-duotone-light span.cm-string-2,.cm-s-duotone-light span.cm-url,.cm-s-duotone-light span.cm-variable-2,.cm-s-duotone-light span.cm-variable-3{color:#896724}.cm-s-duotone-light span.cm-builtin,.cm-s-duotone-light span.cm-def,.cm-s-duotone-light span.cm-em,.cm-s-duotone-light span.cm-header,.cm-s-duotone-light span.cm-qualifier,.cm-s-duotone-light span.cm-tag{color:#2d2006}.cm-s-duotone-light span.cm-bracket,.cm-s-duotone-light span.cm-comment{color:#b6ad9a}.cm-s-duotone-light span.cm-error,.cm-s-duotone-light span.cm-invalidchar{color:red}.cm-s-duotone-light span.cm-header{font-weight:400}.cm-s-duotone-light .CodeMirror-matchingbracket{text-decoration:underline;color:#faf8f5!important}.cm-s-eclipse span.cm-meta{color:#ff1717}.cm-s-eclipse span.cm-keyword{line-height:1em;font-weight:700;color:#7f0055}.cm-s-eclipse span.cm-atom{color:#219}.cm-s-eclipse span.cm-number{color:#164}.cm-s-eclipse span.cm-def{color:#00f}.cm-s-eclipse span.cm-variable{color:#000}.cm-s-eclipse span.cm-variable-2,.cm-s-eclipse span.cm-variable-3{color:#0000c0}.cm-s-eclipse span.cm-operator,.cm-s-eclipse span.cm-property{color:#000}.cm-s-eclipse span.cm-comment{color:#3f7f5f}.cm-s-eclipse span.cm-string{color:#2a00ff}.cm-s-eclipse span.cm-string-2{color:#f50}.cm-s-eclipse span.cm-qualifier{color:#555}.cm-s-eclipse span.cm-builtin{color:#30a}.cm-s-eclipse span.cm-bracket{color:#cc7}.cm-s-eclipse span.cm-tag{color:#170}.cm-s-eclipse span.cm-attribute{color:#00c}.cm-s-eclipse span.cm-link{color:#219}.cm-s-eclipse span.cm-error{color:red}.cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-eclipse .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}.cm-s-elegant span.cm-atom,.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string{color:#762}.cm-s-elegant span.cm-comment{color:#262;font-style:italic;line-height:1em}.cm-s-elegant span.cm-meta{color:#555;font-style:italic;line-height:1em}.cm-s-elegant span.cm-variable{color:#000}.cm-s-elegant span.cm-variable-2{color:#b11}.cm-s-elegant span.cm-qualifier{color:#555}.cm-s-elegant span.cm-keyword{color:#730}.cm-s-elegant span.cm-builtin{color:#30a}.cm-s-elegant span.cm-link{color:#762}.cm-s-elegant span.cm-error{background-color:#fdd}.cm-s-elegant .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-elegant .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}.cm-s-erlang-dark.CodeMirror{background:#002240;color:#fff}.cm-s-erlang-dark div.CodeMirror-selected{background:#b36539}.cm-s-erlang-dark .CodeMirror-line::selection,.cm-s-erlang-dark .CodeMirror-line>span::selection,.cm-s-erlang-dark .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-line::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-erlang-dark .CodeMirror-guttermarker{color:#fff}.cm-s-erlang-dark .CodeMirror-guttermarker-subtle,.cm-s-erlang-dark .CodeMirror-linenumber{color:#d0d0d0}.cm-s-erlang-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-erlang-dark span.cm-quote{color:#ccc}.cm-s-erlang-dark span.cm-atom{color:#f133f1}.cm-s-erlang-dark span.cm-attribute{color:#ff80e1}.cm-s-erlang-dark span.cm-bracket{color:#ff9d00}.cm-s-erlang-dark span.cm-builtin{color:#eaa}.cm-s-erlang-dark span.cm-comment{color:#77f}.cm-s-erlang-dark span.cm-def{color:#e7a}.cm-s-erlang-dark span.cm-keyword{color:#ffee80}.cm-s-erlang-dark span.cm-meta{color:#50fefe}.cm-s-erlang-dark span.cm-number{color:#ffd0d0}.cm-s-erlang-dark span.cm-operator{color:#d55}.cm-s-erlang-dark span.cm-property,.cm-s-erlang-dark span.cm-qualifier{color:#ccc}.cm-s-erlang-dark span.cm-special{color:#fbb}.cm-s-erlang-dark span.cm-string{color:#3ad900}.cm-s-erlang-dark span.cm-string-2{color:#ccc}.cm-s-erlang-dark span.cm-tag{color:#9effff}.cm-s-erlang-dark span.cm-variable{color:#50fe50}.cm-s-erlang-dark span.cm-variable-2{color:#e0e}.cm-s-erlang-dark span.cm-variable-3{color:#ccc}.cm-s-erlang-dark span.cm-error{color:#9d1e15}.cm-s-erlang-dark .CodeMirror-activeline-background{background:#013461}.cm-s-erlang-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42!important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498!important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom,.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-attribute,.cm-s-hopscotch span.cm-property{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}.cm-s-icecoder{color:#666;background:#1d1d1b}.cm-s-icecoder span.cm-keyword{color:#eee;font-weight:700}.cm-s-icecoder span.cm-atom{color:#e1c76e}.cm-s-icecoder span.cm-number{color:#6cb5d9}.cm-s-icecoder span.cm-def{color:#b9ca4a}.cm-s-icecoder span.cm-variable{color:#6cb5d9}.cm-s-icecoder span.cm-variable-2{color:#cc1e5c}.cm-s-icecoder span.cm-variable-3{color:#f9602c}.cm-s-icecoder span.cm-property{color:#eee}.cm-s-icecoder span.cm-operator{color:#9179bb}.cm-s-icecoder span.cm-comment{color:#97a3aa}.cm-s-icecoder span.cm-string{color:#b9ca4a}.cm-s-icecoder span.cm-string-2{color:#6cb5d9}.cm-s-icecoder span.cm-meta,.cm-s-icecoder span.cm-qualifier{color:#555}.cm-s-icecoder span.cm-builtin{color:#214e7b}.cm-s-icecoder span.cm-bracket{color:#cc7}.cm-s-icecoder span.cm-tag{color:#e8e8e8}.cm-s-icecoder span.cm-attribute{color:#099}.cm-s-icecoder span.cm-header{color:#6a0d6a}.cm-s-icecoder span.cm-quote{color:#186718}.cm-s-icecoder span.cm-hr{color:#888}.cm-s-icecoder span.cm-link{color:#e1c76e}.cm-s-icecoder span.cm-error{color:#d00}.cm-s-icecoder .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-icecoder div.CodeMirror-selected{color:#fff;background:#037}.cm-s-icecoder .CodeMirror-gutters{background:#1d1d1b;min-width:41px;border-right:0}.cm-s-icecoder .CodeMirror-linenumber{color:#555;cursor:default}.cm-s-icecoder .CodeMirror-matchingbracket{color:#fff!important;background:#555!important}.cm-s-icecoder .CodeMirror-activeline-background{background:#000}.cm-s-isotope.CodeMirror{background:#000;color:#e0e0e0}.cm-s-isotope div.CodeMirror-selected{background:#404040!important}.cm-s-isotope .CodeMirror-gutters{background:#000;border-right:0}.cm-s-isotope .CodeMirror-linenumber{color:gray}.cm-s-isotope .CodeMirror-cursor{border-left:1px solid silver!important}.cm-s-isotope span.cm-comment{color:#30f}.cm-s-isotope span.cm-atom,.cm-s-isotope span.cm-number{color:#c0f}.cm-s-isotope span.cm-attribute,.cm-s-isotope span.cm-property{color:#3f0}.cm-s-isotope span.cm-keyword{color:red}.cm-s-isotope span.cm-string{color:#f09}.cm-s-isotope span.cm-variable{color:#3f0}.cm-s-isotope span.cm-variable-2{color:#06f}.cm-s-isotope span.cm-def{color:#f90}.cm-s-isotope span.cm-error{background:red;color:silver}.cm-s-isotope span.cm-bracket{color:#e0e0e0}.cm-s-isotope span.cm-tag{color:red}.cm-s-isotope span.cm-link{color:#c0f}.cm-s-isotope .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-isotope .CodeMirror-activeline-background{background:#202020}.cm-s-lesser-dark{line-height:1.3em}.cm-s-lesser-dark.CodeMirror{background:#262626;color:#ebefe7;text-shadow:0 -1px 1px #262626}.cm-s-lesser-dark div.CodeMirror-selected{background:#45443b}.cm-s-lesser-dark .CodeMirror-line::selection,.cm-s-lesser-dark .CodeMirror-line>span::selection,.cm-s-lesser-dark .CodeMirror-line>span>span::selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-line::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-lesser-dark pre{padding:0 8px}.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket{color:#7efc7e}.cm-s-lesser-dark .CodeMirror-gutters{background:#262626;border-right:1px solid #aaa}.cm-s-lesser-dark .CodeMirror-guttermarker{color:#599eff}.cm-s-lesser-dark .CodeMirror-guttermarker-subtle,.cm-s-lesser-dark .CodeMirror-linenumber{color:#777}.cm-s-lesser-dark span.cm-header{color:#a0a}.cm-s-lesser-dark span.cm-quote{color:#090}.cm-s-lesser-dark span.cm-keyword{color:#599eff}.cm-s-lesser-dark span.cm-atom{color:#c2b470}.cm-s-lesser-dark span.cm-number{color:#b35e4d}.cm-s-lesser-dark span.cm-def{color:#fff}.cm-s-lesser-dark span.cm-variable{color:#d9bf8c}.cm-s-lesser-dark span.cm-variable-2{color:#669199}.cm-s-lesser-dark span.cm-variable-3{color:#fff}.cm-s-lesser-dark span.cm-operator,.cm-s-lesser-dark span.cm-property{color:#92a75c}.cm-s-lesser-dark span.cm-comment{color:#666}.cm-s-lesser-dark span.cm-string{color:#bcd279}.cm-s-lesser-dark span.cm-string-2{color:#f50}.cm-s-lesser-dark span.cm-meta{color:#738c73}.cm-s-lesser-dark span.cm-qualifier{color:#555}.cm-s-lesser-dark span.cm-builtin{color:#ff9e59}.cm-s-lesser-dark span.cm-bracket{color:#ebefe7}.cm-s-lesser-dark span.cm-tag{color:#669199}.cm-s-lesser-dark span.cm-attribute{color:#00c}.cm-s-lesser-dark span.cm-hr{color:#999}.cm-s-lesser-dark span.cm-link{color:#00c}.cm-s-lesser-dark span.cm-error{color:#9d1e15}.cm-s-lesser-dark .CodeMirror-activeline-background{background:#3c3a3a}.cm-s-lesser-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-liquibyte.CodeMirror{background-color:#000;color:#fff;line-height:1.2em;font-size:1em}.cm-s-liquibyte .CodeMirror-focused .cm-matchhighlight{text-decoration:underline;-webkit-text-decoration-color:#0f0;text-decoration-color:#0f0;-webkit-text-decoration-style:wavy;text-decoration-style:wavy}.cm-s-liquibyte .cm-trailingspace{text-decoration:line-through;-webkit-text-decoration-color:red;text-decoration-color:red;-webkit-text-decoration-style:dotted;text-decoration-style:dotted}.cm-s-liquibyte .cm-tab{text-decoration:line-through;-webkit-text-decoration-color:#404040;text-decoration-color:#404040;-webkit-text-decoration-style:dotted;text-decoration-style:dotted}.cm-s-liquibyte .CodeMirror-gutters{background-color:#262626;border-right:1px solid #505050;padding-right:.8em}.cm-s-liquibyte .CodeMirror-gutter-elt div{font-size:1.2em}.cm-s-liquibyte .CodeMirror-linenumber{color:#606060;padding-left:0}.cm-s-liquibyte .CodeMirror-cursor{border-left:1px solid #eee}.cm-s-liquibyte span.cm-comment{color:green}.cm-s-liquibyte span.cm-def{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-keyword{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-builtin{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-variable{color:#5967ff;font-weight:700}.cm-s-liquibyte span.cm-string{color:#ff8000}.cm-s-liquibyte span.cm-number{color:#0f0;font-weight:700}.cm-s-liquibyte span.cm-atom{color:#bf3030;font-weight:700}.cm-s-liquibyte span.cm-variable-2{color:#007f7f;font-weight:700}.cm-s-liquibyte span.cm-variable-3{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-property{color:#999;font-weight:700}.cm-s-liquibyte span.cm-operator{color:#fff}.cm-s-liquibyte span.cm-meta{color:#0f0}.cm-s-liquibyte span.cm-qualifier{color:#fff700;font-weight:700}.cm-s-liquibyte span.cm-bracket{color:#cc7}.cm-s-liquibyte span.cm-tag{color:#ff0;font-weight:700}.cm-s-liquibyte span.cm-attribute{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-error{color:red}.cm-s-liquibyte div.CodeMirror-selected{background-color:rgba(255,0,0,.25)}.cm-s-liquibyte span.cm-compilation{background-color:hsla(0,0%,100%,.12)}.cm-s-liquibyte .CodeMirror-activeline-background{background-color:rgba(0,255,0,.15)}.cm-s-liquibyte .CodeMirror span.CodeMirror-matchingbracket{color:#0f0;font-weight:700}.cm-s-liquibyte .CodeMirror span.CodeMirror-nonmatchingbracket{color:red;font-weight:700}.CodeMirror-matchingtag{background-color:rgba(150,255,0,.3)}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover,div.CodeMirror-simplescroll-vertical div:hover{background-color:rgba(80,80,80,.7)}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div,div.CodeMirror-simplescroll-vertical div{background-color:rgba(80,80,80,.3);border:1px solid #404040;border-radius:5px}.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div{border-top:1px solid #404040;border-bottom:1px solid #404040}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div{border-left:1px solid #404040;border-right:1px solid #404040}.cm-s-liquibyte div.CodeMirror-simplescroll-vertical{background-color:#262626}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal{background-color:#262626;border-top:1px solid #404040}.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div,div.CodeMirror-overlayscroll-vertical div{background-color:#404040;border-radius:5px}.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div,.cm-s-liquibyte div.CodeMirror-overlayscroll-vertical div{border:1px solid #404040}.cm-s-material.CodeMirror{background-color:#263238;color:#e9eded}.cm-s-material .CodeMirror-gutters{background:#263238;color:#537f7e;border:none}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#537f7e}.cm-s-material .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-material div.CodeMirror-selected{background:hsla(0,0%,100%,.15)}.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-material .CodeMirror-activeline-background{background:transparent}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#e9eded}.cm-s-material .cm-variable-2{color:#80cbc4}.cm-s-material .cm-variable-3{color:#82b1ff}.cm-s-material .cm-builtin{color:#decb6b}.cm-s-material .cm-atom,.cm-s-material .cm-number{color:#f77669}.cm-s-material .cm-def{color:#e9eded}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#80cbc4}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#82b1ff}.cm-s-material .cm-meta,.cm-s-material .cm-tag{color:#80cbc4}.cm-s-material .cm-attribute{color:#ffcb6b}.cm-s-material .cm-property{color:#80cbae}.cm-s-material .cm-qualifier,.cm-s-material .cm-variable-3{color:#decb6b}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-error{color:#fff;background-color:#ec5f67}.cm-s-material .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-mbo.CodeMirror{background:#2c2c2c;color:#ffffec}.cm-s-mbo div.CodeMirror-selected{background:#716c62}.cm-s-mbo .CodeMirror-line::selection,.cm-s-mbo .CodeMirror-line>span::selection,.cm-s-mbo .CodeMirror-line>span>span::selection{background:hsla(40,7%,41%,.99)}.cm-s-mbo .CodeMirror-line::-moz-selection,.cm-s-mbo .CodeMirror-line>span::-moz-selection,.cm-s-mbo .CodeMirror-line>span>span::-moz-selection{background:hsla(40,7%,41%,.99)}.cm-s-mbo .CodeMirror-gutters{background:#4e4e4e;border-right:0}.cm-s-mbo .CodeMirror-guttermarker{color:#fff}.cm-s-mbo .CodeMirror-guttermarker-subtle{color:grey}.cm-s-mbo .CodeMirror-linenumber{color:#dadada}.cm-s-mbo .CodeMirror-cursor{border-left:1px solid #ffffec}.cm-s-mbo span.cm-comment{color:#95958a}.cm-s-mbo span.cm-atom,.cm-s-mbo span.cm-number{color:#00a8c6}.cm-s-mbo span.cm-attribute,.cm-s-mbo span.cm-property{color:#9ddfe9}.cm-s-mbo span.cm-keyword{color:#ffb928}.cm-s-mbo span.cm-string{color:#ffcf6c}.cm-s-mbo span.cm-string.cm-property,.cm-s-mbo span.cm-variable{color:#ffffec}.cm-s-mbo span.cm-variable-2{color:#00a8c6}.cm-s-mbo span.cm-def{color:#ffffec}.cm-s-mbo span.cm-bracket{color:#fffffc;font-weight:700}.cm-s-mbo span.cm-tag{color:#9ddfe9}.cm-s-mbo span.cm-link{color:#f54b07}.cm-s-mbo span.cm-error{border-bottom:#636363;color:#ffffec}.cm-s-mbo span.cm-qualifier{color:#ffffec}.cm-s-mbo .CodeMirror-activeline-background{background:#494b41}.cm-s-mbo .CodeMirror-matchingbracket{color:#ffb928!important}.cm-s-mbo .CodeMirror-matchingtag{background:hsla(0,0%,100%,.37)}.cm-s-mdn-like.CodeMirror{color:#999;background-color:#fff}.cm-s-mdn-like div.CodeMirror-selected{background:#cfc}.cm-s-mdn-like .CodeMirror-line::selection,.cm-s-mdn-like .CodeMirror-line>span::selection,.cm-s-mdn-like .CodeMirror-line>span>span::selection{background:#cfc}.cm-s-mdn-like .CodeMirror-line::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span>span::-moz-selection{background:#cfc}.cm-s-mdn-like .CodeMirror-gutters{background:#f8f8f8;border-left:6px solid rgba(0,83,159,.65);color:#333}.cm-s-mdn-like .CodeMirror-linenumber{color:#aaa;padding-left:8px}.cm-s-mdn-like .CodeMirror-cursor{border-left:2px solid #222}.cm-s-mdn-like .cm-keyword{color:#6262ff}.cm-s-mdn-like .cm-atom{color:#f90}.cm-s-mdn-like .cm-number{color:#ca7841}.cm-s-mdn-like .cm-def{color:#8da6ce}.cm-s-mdn-like span.cm-tag,.cm-s-mdn-like span.cm-variable-2{color:#690}.cm-s-mdn-like .cm-variable,.cm-s-mdn-like span.cm-def,.cm-s-mdn-like span.cm-variable-3{color:#07a}.cm-s-mdn-like .cm-property{color:#905}.cm-s-mdn-like .cm-qualifier{color:#690}.cm-s-mdn-like .cm-operator{color:#cda869}.cm-s-mdn-like .cm-comment{color:#777;font-weight:400}.cm-s-mdn-like .cm-string{color:#07a;font-style:italic}.cm-s-mdn-like .cm-string-2{color:#bd6b18}.cm-s-mdn-like .cm-meta{color:#000}.cm-s-mdn-like .cm-builtin{color:#9b7536}.cm-s-mdn-like .cm-tag{color:#997643}.cm-s-mdn-like .cm-attribute{color:#d6bb6d}.cm-s-mdn-like .cm-header{color:#ff6400}.cm-s-mdn-like .cm-hr{color:#aeaeae}.cm-s-mdn-like .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-mdn-like .cm-error{border-bottom:1px solid red}div.cm-s-mdn-like .CodeMirror-activeline-background{background:#efefff}div.cm-s-mdn-like span.CodeMirror-matchingbracket{outline:1px solid grey;color:inherit}.cm-s-mdn-like.CodeMirror{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8C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ZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=)}.cm-s-midnight span.CodeMirror-matchhighlight{background:#494949}.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight{background:#314d67!important}.cm-s-midnight .CodeMirror-activeline-background{background:#253540}.cm-s-midnight.CodeMirror{background:#0f192a;color:#d1edff;border-top:1px solid #000;border-bottom:1px solid #000}.cm-s-midnight div.CodeMirror-selected{background:#314d67}.cm-s-midnight .CodeMirror-line::selection,.cm-s-midnight .CodeMirror-line>span::selection,.cm-s-midnight .CodeMirror-line>span>span::selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-line::-moz-selection,.cm-s-midnight .CodeMirror-line>span::-moz-selection,.cm-s-midnight .CodeMirror-line>span>span::-moz-selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-gutters{background:#0f192a;border-right:1px solid}.cm-s-midnight .CodeMirror-guttermarker{color:#fff}.cm-s-midnight .CodeMirror-guttermarker-subtle,.cm-s-midnight .CodeMirror-linenumber{color:#d0d0d0}.cm-s-midnight .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-midnight span.cm-comment{color:#428bdd}.cm-s-midnight span.cm-atom{color:#ae81ff}.cm-s-midnight span.cm-number{color:#d1edff}.cm-s-midnight span.cm-attribute,.cm-s-midnight span.cm-property{color:#a6e22e}.cm-s-midnight span.cm-keyword{color:#e83737}.cm-s-midnight span.cm-string{color:#1dc116}.cm-s-midnight span.cm-variable,.cm-s-midnight span.cm-variable-2{color:#ffaa3e}.cm-s-midnight span.cm-def{color:#4dd}.cm-s-midnight span.cm-bracket{color:#d1edff}.cm-s-midnight span.cm-tag{color:#449}.cm-s-midnight span.cm-link{color:#ae81ff}.cm-s-midnight span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-midnight .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai div.CodeMirror-selected{background:#49483e}.cm-s-monokai .CodeMirror-line::selection,.cm-s-monokai .CodeMirror-line>span::selection,.cm-s-monokai .CodeMirror-line>span>span::selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-line::-moz-selection,.cm-s-monokai .CodeMirror-line>span::-moz-selection,.cm-s-monokai .CodeMirror-line>span>span::-moz-selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0}.cm-s-monokai .CodeMirror-guttermarker{color:#fff}.cm-s-monokai .CodeMirror-guttermarker-subtle,.cm-s-monokai .CodeMirror-linenumber{color:#d0d0d0}.cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-monokai span.cm-comment{color:#75715e}.cm-s-monokai span.cm-atom,.cm-s-monokai span.cm-number{color:#ae81ff}.cm-s-monokai span.cm-attribute,.cm-s-monokai span.cm-property{color:#a6e22e}.cm-s-monokai span.cm-keyword{color:#f92672}.cm-s-monokai span.cm-builtin{color:#66d9ef}.cm-s-monokai span.cm-string{color:#e6db74}.cm-s-monokai span.cm-variable{color:#f8f8f2}.cm-s-monokai span.cm-variable-2{color:#9effff}.cm-s-monokai span.cm-variable-3{color:#66d9ef}.cm-s-monokai span.cm-def{color:#fd971f}.cm-s-monokai span.cm-bracket{color:#f8f8f2}.cm-s-monokai span.cm-tag{color:#f92672}.cm-s-monokai span.cm-header,.cm-s-monokai span.cm-link{color:#ae81ff}.cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-monokai .CodeMirror-activeline-background{background:#373831}.cm-s-monokai .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-neat span.cm-comment{color:#a86}.cm-s-neat span.cm-keyword{line-height:1em;font-weight:700;color:blue}.cm-s-neat span.cm-string{color:#a22}.cm-s-neat span.cm-builtin{line-height:1em;font-weight:700;color:#077}.cm-s-neat span.cm-special{line-height:1em;font-weight:700;color:#0aa}.cm-s-neat span.cm-variable{color:#000}.cm-s-neat span.cm-atom,.cm-s-neat span.cm-number{color:#3a3}.cm-s-neat span.cm-meta{color:#555}.cm-s-neat span.cm-link{color:#3a3}.cm-s-neat .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-neat .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}.cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-qualifier,.cm-s-neo .cm-variable{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{border:none;border-right:10px solid transparent;background-color:transparent}.cm-s-neo .CodeMirror-linenumber{padding:0;color:#e0e2e5}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{width:auto;border:0;background:hsla(223,4%,62%,.37);z-index:1}.cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447}.cm-s-night .CodeMirror-line::selection,.cm-s-night .CodeMirror-line>span::selection,.cm-s-night .CodeMirror-line>span>span::selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-line::-moz-selection,.cm-s-night .CodeMirror-line>span::-moz-selection,.cm-s-night .CodeMirror-line>span>span::-moz-selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-guttermarker{color:#fff}.cm-s-night .CodeMirror-guttermarker-subtle{color:#bbb}.cm-s-night .CodeMirror-linenumber{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-night span.cm-comment{color:#8900d1}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-attribute,.cm-s-night span.cm-number{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-tag,.cm-s-night span.cm-variable-2{color:#99b2ff}.cm-s-night span.cm-def,.cm-s-night span.cm-variable-3{color:#fff}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}.cm-s-night span.cm-link{color:#845dc4}.cm-s-night span.cm-error{color:#9d1e15}.cm-s-night .CodeMirror-activeline-background{background:#1c005a}.cm-s-night .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-panda-syntax{background:#292a2b;color:#e6e6e6;line-height:1.5;font-family:Operator Mono,Source Sans Pro,Menlo,Monaco,Consolas,Courier New,monospace}.cm-s-panda-syntax .CodeMirror-cursor{border-color:#ff2c6d}.cm-s-panda-syntax .CodeMirror-activeline-background{background:rgba(99,123,156,.1)}.cm-s-panda-syntax .CodeMirror-selected{background:#fff}.cm-s-panda-syntax .cm-comment{font-style:italic;color:#676b79}.cm-s-panda-syntax .cm-operator{color:#f3f3f3}.cm-s-panda-syntax .cm-string{color:#19f9d8}.cm-s-panda-syntax .cm-string-2{color:#ffb86c}.cm-s-panda-syntax .cm-tag{color:#ff2c6d}.cm-s-panda-syntax .cm-meta{color:#b084eb}.cm-s-panda-syntax .cm-number{color:#ffb86c}.cm-s-panda-syntax .cm-atom{color:#ff2c6d}.cm-s-panda-syntax .cm-keyword{color:#ff75b5}.cm-s-panda-syntax .cm-variable{color:#ffb86c}.cm-s-panda-syntax .cm-variable-2,.cm-s-panda-syntax .cm-variable-3{color:#ff9ac1}.cm-s-panda-syntax .cm-def{color:#e6e6e6}.cm-s-panda-syntax .cm-property{color:#f3f3f3}.cm-s-panda-syntax .cm-attribute,.cm-s-panda-syntax .cm-unit{color:#ffb86c}.cm-s-panda-syntax .CodeMirror-matchingbracket{border-bottom:1px dotted #19f9d8;padding-bottom:2px;color:#e6e6e6}.cm-s-panda-syntax .CodeMirror-gutters{background:#292a2b;border-right-color:hsla(0,0%,100%,.1)}.cm-s-panda-syntax .CodeMirror-linenumber{color:#e6e6e6;opacity:.6}.cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}.cm-s-paraiso-dark div.CodeMirror-selected{background:#41323f}.cm-s-paraiso-dark .CodeMirror-line::selection,.cm-s-paraiso-dark .CodeMirror-line>span::selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-line::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-gutters{background:#2f1e2e;border-right:0}.cm-s-paraiso-dark .CodeMirror-guttermarker{color:#ef6155}.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle,.cm-s-paraiso-dark .CodeMirror-linenumber{color:#776e71}.cm-s-paraiso-dark .CodeMirror-cursor{border-left:1px solid #8d8687}.cm-s-paraiso-dark span.cm-comment{color:#e96ba8}.cm-s-paraiso-dark span.cm-atom,.cm-s-paraiso-dark span.cm-number{color:#815ba4}.cm-s-paraiso-dark span.cm-attribute,.cm-s-paraiso-dark span.cm-property{color:#48b685}.cm-s-paraiso-dark span.cm-keyword{color:#ef6155}.cm-s-paraiso-dark span.cm-string{color:#fec418}.cm-s-paraiso-dark span.cm-variable{color:#48b685}.cm-s-paraiso-dark span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-dark span.cm-def{color:#f99b15}.cm-s-paraiso-dark span.cm-bracket{color:#b9b6b0}.cm-s-paraiso-dark span.cm-tag{color:#ef6155}.cm-s-paraiso-dark span.cm-link{color:#815ba4}.cm-s-paraiso-dark span.cm-error{background:#ef6155;color:#8d8687}.cm-s-paraiso-dark .CodeMirror-activeline-background{background:#4d344a}.cm-s-paraiso-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-paraiso-light.CodeMirror{background:#e7e9db;color:#41323f}.cm-s-paraiso-light div.CodeMirror-selected{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::selection,.cm-s-paraiso-light .CodeMirror-line>span::selection,.cm-s-paraiso-light .CodeMirror-line>span>span::selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span>span::-moz-selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-gutters{background:#e7e9db;border-right:0}.cm-s-paraiso-light .CodeMirror-guttermarker{color:#000}.cm-s-paraiso-light .CodeMirror-guttermarker-subtle,.cm-s-paraiso-light .CodeMirror-linenumber{color:#8d8687}.cm-s-paraiso-light .CodeMirror-cursor{border-left:1px solid #776e71}.cm-s-paraiso-light span.cm-comment{color:#e96ba8}.cm-s-paraiso-light span.cm-atom,.cm-s-paraiso-light span.cm-number{color:#815ba4}.cm-s-paraiso-light span.cm-attribute,.cm-s-paraiso-light span.cm-property{color:#48b685}.cm-s-paraiso-light span.cm-keyword{color:#ef6155}.cm-s-paraiso-light span.cm-string{color:#fec418}.cm-s-paraiso-light span.cm-variable{color:#48b685}.cm-s-paraiso-light span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-light span.cm-def{color:#f99b15}.cm-s-paraiso-light span.cm-bracket{color:#41323f}.cm-s-paraiso-light span.cm-tag{color:#ef6155}.cm-s-paraiso-light span.cm-link{color:#815ba4}.cm-s-paraiso-light span.cm-error{background:#ef6155;color:#776e71}.cm-s-paraiso-light .CodeMirror-activeline-background{background:#cfd1c4}.cm-s-paraiso-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-pastel-on-dark.CodeMirror{background:#2c2827;color:#8f938f;line-height:1.5}.cm-s-pastel-on-dark div.CodeMirror-selected{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::selection,.cm-s-pastel-on-dark .CodeMirror-line>span::selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-gutters{background:#34302f;border-right:0;padding:0 3px}.cm-s-pastel-on-dark .CodeMirror-guttermarker{color:#fff}.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle,.cm-s-pastel-on-dark .CodeMirror-linenumber{color:#8f938f}.cm-s-pastel-on-dark .CodeMirror-cursor{border-left:1px solid #a7a7a7}.cm-s-pastel-on-dark span.cm-comment{color:#a6c6ff}.cm-s-pastel-on-dark span.cm-atom{color:#de8e30}.cm-s-pastel-on-dark span.cm-number{color:#ccc}.cm-s-pastel-on-dark span.cm-property{color:#8f938f}.cm-s-pastel-on-dark span.cm-attribute{color:#a6e22e}.cm-s-pastel-on-dark span.cm-keyword{color:#aeb2f8}.cm-s-pastel-on-dark span.cm-string{color:#66a968}.cm-s-pastel-on-dark span.cm-variable{color:#aeb2f8}.cm-s-pastel-on-dark span.cm-variable-2{color:#bebf55}.cm-s-pastel-on-dark span.cm-variable-3{color:#de8e30}.cm-s-pastel-on-dark span.cm-def{color:#757ad8}.cm-s-pastel-on-dark span.cm-bracket{color:#f8f8f2}.cm-s-pastel-on-dark span.cm-tag{color:#c1c144}.cm-s-pastel-on-dark span.cm-link{color:#ae81ff}.cm-s-pastel-on-dark span.cm-builtin,.cm-s-pastel-on-dark span.cm-qualifier{color:#c1c144}.cm-s-pastel-on-dark span.cm-error{background:#757ad8;color:#f8f8f0}.cm-s-pastel-on-dark .CodeMirror-activeline-background{background:hsla(0,0%,100%,.031)}.cm-s-pastel-on-dark .CodeMirror-matchingbracket{border:1px solid hsla(0,0%,100%,.25);color:#8f938f!important;margin:-1px -1px 0}.cm-s-railscasts.CodeMirror{background:#2b2b2b;color:#f4f1ed}.cm-s-railscasts div.CodeMirror-selected{background:#272935!important}.cm-s-railscasts .CodeMirror-gutters{background:#2b2b2b;border-right:0}.cm-s-railscasts .CodeMirror-linenumber{color:#5a647e}.cm-s-railscasts .CodeMirror-cursor{border-left:1px solid #d4cfc9!important}.cm-s-railscasts span.cm-comment{color:#bc9458}.cm-s-railscasts span.cm-atom,.cm-s-railscasts span.cm-number{color:#b6b3eb}.cm-s-railscasts span.cm-attribute,.cm-s-railscasts span.cm-property{color:#a5c261}.cm-s-railscasts span.cm-keyword{color:#da4939}.cm-s-railscasts span.cm-string{color:#ffc66d}.cm-s-railscasts span.cm-variable{color:#a5c261}.cm-s-railscasts span.cm-variable-2{color:#6d9cbe}.cm-s-railscasts span.cm-def{color:#cc7833}.cm-s-railscasts span.cm-error{background:#da4939;color:#d4cfc9}.cm-s-railscasts span.cm-bracket{color:#f4f1ed}.cm-s-railscasts span.cm-tag{color:#da4939}.cm-s-railscasts span.cm-link{color:#b6b3eb}.cm-s-railscasts .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-railscasts .CodeMirror-activeline-background{background:#303040}.cm-s-rubyblue.CodeMirror{background:#112435;color:#fff}.cm-s-rubyblue div.CodeMirror-selected{background:#38566f}.cm-s-rubyblue .CodeMirror-line::selection,.cm-s-rubyblue .CodeMirror-line>span::selection,.cm-s-rubyblue .CodeMirror-line>span>span::selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-line::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span>span::-moz-selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-gutters{background:#1f4661;border-right:7px solid #3e7087}.cm-s-rubyblue .CodeMirror-guttermarker{color:#fff}.cm-s-rubyblue .CodeMirror-guttermarker-subtle{color:#3e7087}.cm-s-rubyblue .CodeMirror-linenumber{color:#fff}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-rubyblue span.cm-comment{color:#999;font-style:italic;line-height:1em}.cm-s-rubyblue span.cm-atom{color:#f4c20b}.cm-s-rubyblue span.cm-attribute,.cm-s-rubyblue span.cm-number{color:#82c6e0}.cm-s-rubyblue span.cm-keyword{color:#f0f}.cm-s-rubyblue span.cm-string{color:#f08047}.cm-s-rubyblue span.cm-meta{color:#f0f}.cm-s-rubyblue span.cm-tag,.cm-s-rubyblue span.cm-variable-2{color:#7bd827}.cm-s-rubyblue span.cm-def,.cm-s-rubyblue span.cm-variable-3{color:#fff}.cm-s-rubyblue span.cm-bracket{color:#f0f}.cm-s-rubyblue span.cm-link{color:#f4c20b}.cm-s-rubyblue span.CodeMirror-matchingbracket{color:#f0f!important}.cm-s-rubyblue span.cm-builtin,.cm-s-rubyblue span.cm-special{color:#ff9d00}.cm-s-rubyblue span.cm-error{color:#af2018}.cm-s-rubyblue .CodeMirror-activeline-background{background:#173047}.cm-s-seti.CodeMirror{background-color:#151718!important;color:#cfd2d1!important;border:none}.cm-s-seti .CodeMirror-gutters{color:#404b53;background-color:#0e1112;border:none}.cm-s-seti .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-seti .CodeMirror-linenumber{color:#6d8a88}.cm-s-seti.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-seti .CodeMirror-line::selection,.cm-s-seti .CodeMirror-line>span::selection,.cm-s-seti .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-seti .CodeMirror-line::-moz-selection,.cm-s-seti .CodeMirror-line>span::-moz-selection,.cm-s-seti .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-seti span.cm-comment{color:#41535b}.cm-s-seti span.cm-string,.cm-s-seti span.cm-string-2{color:#55b5db}.cm-s-seti span.cm-number{color:#cd3f45}.cm-s-seti span.cm-variable{color:#55b5db}.cm-s-seti span.cm-variable-2{color:#a074c4}.cm-s-seti span.cm-def{color:#55b5db}.cm-s-seti span.cm-keyword{color:#ff79c6}.cm-s-seti span.cm-operator{color:#9fca56}.cm-s-seti span.cm-keyword{color:#e6cd69}.cm-s-seti span.cm-atom{color:#cd3f45}.cm-s-seti span.cm-meta,.cm-s-seti span.cm-tag{color:#55b5db}.cm-s-seti span.cm-attribute,.cm-s-seti span.cm-qualifier{color:#9fca56}.cm-s-seti span.cm-property{color:#a074c4}.cm-s-seti span.cm-builtin,.cm-s-seti span.cm-variable-3{color:#9fca56}.cm-s-seti .CodeMirror-activeline-background{background:#101213}.cm-s-seti .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;-webkit-text-decoration-style:dotted;text-decoration-style:dotted}.cm-s-solarized .cm-strong{color:#eee}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-light .CodeMirror-line>span::-moz-selection,.cm-s-light .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection,.cm-s-solarized.cm-s-light .CodeMirror-line::selection{background:#eee8d5}.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75;text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#7e7}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#7e7}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:hsla(0,0%,100%,.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.06)}.cm-s-the-matrix.CodeMirror{background:#000;color:#0f0}.cm-s-the-matrix div.CodeMirror-selected{background:#2d2d2d}.cm-s-the-matrix .CodeMirror-line::selection,.cm-s-the-matrix .CodeMirror-line>span::selection,.cm-s-the-matrix .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-line::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-gutters{background:#060;border-right:2px solid #0f0}.cm-s-the-matrix .CodeMirror-guttermarker{color:#0f0}.cm-s-the-matrix .CodeMirror-guttermarker-subtle,.cm-s-the-matrix .CodeMirror-linenumber{color:#fff}.cm-s-the-matrix .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-the-matrix span.cm-keyword{color:#008803;font-weight:700}.cm-s-the-matrix span.cm-atom{color:#3ff}.cm-s-the-matrix span.cm-number{color:#ffb94f}.cm-s-the-matrix span.cm-def{color:#99c}.cm-s-the-matrix span.cm-variable{color:#f6c}.cm-s-the-matrix span.cm-variable-2{color:#c6f}.cm-s-the-matrix span.cm-variable-3{color:#96f}.cm-s-the-matrix span.cm-property{color:#62ffa0}.cm-s-the-matrix span.cm-operator{color:#999}.cm-s-the-matrix span.cm-comment{color:#ccc}.cm-s-the-matrix span.cm-string{color:#39c}.cm-s-the-matrix span.cm-meta{color:#c9f}.cm-s-the-matrix span.cm-qualifier{color:#fff700}.cm-s-the-matrix span.cm-builtin{color:#30a}.cm-s-the-matrix span.cm-bracket{color:#cc7}.cm-s-the-matrix span.cm-tag{color:#ffbd40}.cm-s-the-matrix span.cm-attribute{color:#fff700}.cm-s-the-matrix span.cm-error{color:red}.cm-s-the-matrix .CodeMirror-activeline-background{background:#040}.cm-s-tomorrow-night-bright.CodeMirror{background:#000;color:#eaeaea}.cm-s-tomorrow-night-bright div.CodeMirror-selected{background:#424242}.cm-s-tomorrow-night-bright .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker{color:#e78c45}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-bright .CodeMirror-linenumber{color:#424242}.cm-s-tomorrow-night-bright .CodeMirror-cursor{border-left:1px solid #6a6a6a}.cm-s-tomorrow-night-bright span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-bright span.cm-atom,.cm-s-tomorrow-night-bright span.cm-number{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-attribute,.cm-s-tomorrow-night-bright span.cm-property{color:#9c9}.cm-s-tomorrow-night-bright span.cm-keyword{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-string{color:#e7c547}.cm-s-tomorrow-night-bright span.cm-variable{color:#b9ca4a}.cm-s-tomorrow-night-bright span.cm-variable-2{color:#7aa6da}.cm-s-tomorrow-night-bright span.cm-def{color:#e78c45}.cm-s-tomorrow-night-bright span.cm-bracket{color:#eaeaea}.cm-s-tomorrow-night-bright span.cm-tag{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-link{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-error{background:#d54e53;color:#6a6a6a}.cm-s-tomorrow-night-bright .CodeMirror-activeline-background{background:#2a2a2a}.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-tomorrow-night-eighties.CodeMirror{background:#000;color:#ccc}.cm-s-tomorrow-night-eighties div.CodeMirror-selected{background:#2d2d2d}.cm-s-tomorrow-night-eighties .CodeMirror-line::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker{color:#f2777a}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-eighties .CodeMirror-linenumber{color:#515151}.cm-s-tomorrow-night-eighties .CodeMirror-cursor{border-left:1px solid #6a6a6a}.cm-s-tomorrow-night-eighties span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-eighties span.cm-atom,.cm-s-tomorrow-night-eighties span.cm-number{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-attribute,.cm-s-tomorrow-night-eighties span.cm-property{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-keyword{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-string{color:#fc6}.cm-s-tomorrow-night-eighties span.cm-variable{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-variable-2{color:#69c}.cm-s-tomorrow-night-eighties span.cm-def{color:#f99157}.cm-s-tomorrow-night-eighties span.cm-bracket{color:#ccc}.cm-s-tomorrow-night-eighties span.cm-tag{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-link{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-error{background:#f2777a;color:#6a6a6a}.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background{background:#343600}.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}.cm-s-ttcn .cm-quote{color:#090}.cm-s-ttcn .cm-header,.cm-strong{font-weight:700}.cm-s-ttcn .cm-header{color:#00f;font-weight:700}.cm-s-ttcn .cm-atom{color:#219}.cm-s-ttcn .cm-attribute{color:#00c}.cm-s-ttcn .cm-bracket{color:#997}.cm-s-ttcn .cm-comment{color:#333}.cm-s-ttcn .cm-def{color:#00f}.cm-s-ttcn .cm-em{font-style:italic}.cm-s-ttcn .cm-error{color:red}.cm-s-ttcn .cm-hr{color:#999}.cm-s-ttcn .cm-keyword{font-weight:700}.cm-s-ttcn .cm-link{color:#00c;text-decoration:underline}.cm-s-ttcn .cm-meta{color:#555}.cm-s-ttcn .cm-negative{color:#d44}.cm-s-ttcn .cm-positive{color:#292}.cm-s-ttcn .cm-qualifier{color:#555}.cm-s-ttcn .cm-strikethrough{text-decoration:line-through}.cm-s-ttcn .cm-string{color:#006400}.cm-s-ttcn .cm-string-2{color:#f50}.cm-s-ttcn .cm-strong{font-weight:700}.cm-s-ttcn .cm-tag{color:#170}.cm-s-ttcn .cm-variable{color:#8b2252}.cm-s-ttcn .cm-variable-2{color:#05a}.cm-s-ttcn .cm-variable-3{color:#085}.cm-s-ttcn .cm-invalidchar{color:red}.cm-s-ttcn .cm-accessTypes,.cm-s-ttcn .cm-compareTypes{color:#27408b}.cm-s-ttcn .cm-cmipVerbs{color:#8b2252}.cm-s-ttcn .cm-modifier{color:#d2691e}.cm-s-ttcn .cm-status{color:#8b4545}.cm-s-ttcn .cm-storage{color:#a020f0}.cm-s-ttcn .cm-tags{color:#006400}.cm-s-ttcn .cm-externalCommands{color:#8b4545;font-weight:700}.cm-s-ttcn .cm-fileNCtrlMaskOptions,.cm-s-ttcn .cm-sectionTitle{color:#2e8b57;font-weight:700}.cm-s-ttcn .cm-booleanConsts,.cm-s-ttcn .cm-otherConsts,.cm-s-ttcn .cm-verdictConsts{color:#006400}.cm-s-ttcn .cm-configOps,.cm-s-ttcn .cm-functionOps,.cm-s-ttcn .cm-portOps,.cm-s-ttcn .cm-sutOps,.cm-s-ttcn .cm-timerOps,.cm-s-ttcn .cm-verdictOps{color:#00f}.cm-s-ttcn .cm-preprocessor,.cm-s-ttcn .cm-templateMatch,.cm-s-ttcn .cm-ttcn3Macros{color:#27408b}.cm-s-ttcn .cm-types{color:brown;font-weight:700}.cm-s-ttcn .cm-visibilityModifiers{font-weight:700}.cm-s-twilight.CodeMirror{background:#141414;color:#f7f7f7}.cm-s-twilight div.CodeMirror-selected{background:#323232}.cm-s-twilight .CodeMirror-line::selection,.cm-s-twilight .CodeMirror-line>span::selection,.cm-s-twilight .CodeMirror-line>span>span::selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-line::-moz-selection,.cm-s-twilight .CodeMirror-line>span::-moz-selection,.cm-s-twilight .CodeMirror-line>span>span::-moz-selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-gutters{background:#222;border-right:1px solid #aaa}.cm-s-twilight .CodeMirror-guttermarker{color:#fff}.cm-s-twilight .CodeMirror-guttermarker-subtle,.cm-s-twilight .CodeMirror-linenumber{color:#aaa}.cm-s-twilight .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-twilight .cm-keyword{color:#f9ee98}.cm-s-twilight .cm-atom{color:#fc0}.cm-s-twilight .cm-number{color:#ca7841}.cm-s-twilight .cm-def{color:#8da6ce}.cm-s-twilight span.cm-def,.cm-s-twilight span.cm-tag,.cm-s-twilight span.cm-variable-2,.cm-s-twilight span.cm-variable-3{color:#607392}.cm-s-twilight .cm-operator{color:#cda869}.cm-s-twilight .cm-comment{color:#777;font-style:italic;font-weight:400}.cm-s-twilight .cm-string{color:#8f9d6a;font-style:italic}.cm-s-twilight .cm-string-2{color:#bd6b18}.cm-s-twilight .cm-meta{background-color:#141414;color:#f7f7f7}.cm-s-twilight .cm-builtin{color:#cda869}.cm-s-twilight .cm-tag{color:#997643}.cm-s-twilight .cm-attribute{color:#d6bb6d}.cm-s-twilight .cm-header{color:#ff6400}.cm-s-twilight .cm-hr{color:#aeaeae}.cm-s-twilight .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-twilight .cm-error{border-bottom:1px solid red}.cm-s-twilight .CodeMirror-activeline-background{background:#27282e}.cm-s-twilight .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-vibrant-ink.CodeMirror{background:#000;color:#fff}.cm-s-vibrant-ink div.CodeMirror-selected{background:#35493c}.cm-s-vibrant-ink .CodeMirror-line::selection,.cm-s-vibrant-ink .CodeMirror-line>span::selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-line::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::-moz-selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-vibrant-ink .CodeMirror-guttermarker{color:#fff}.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle,.cm-s-vibrant-ink .CodeMirror-linenumber{color:#d0d0d0}.cm-s-vibrant-ink .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-vibrant-ink .cm-keyword{color:#cc7832}.cm-s-vibrant-ink .cm-atom{color:#fc0}.cm-s-vibrant-ink .cm-number{color:#ffee98}.cm-s-vibrant-ink .cm-def{color:#8da6ce}.cm-s-vibrant-ink span.cm-variable-2,.cm-s-vibrant-ink span.cm-variable-3,.cm-s-vibrant span.cm-def,.cm-s-vibrant span.cm-tag{color:#ffc66d}.cm-s-vibrant-ink .cm-operator{color:#888}.cm-s-vibrant-ink .cm-comment{color:gray;font-weight:700}.cm-s-vibrant-ink .cm-string{color:#a5c25c}.cm-s-vibrant-ink .cm-string-2{color:red}.cm-s-vibrant-ink .cm-meta{color:#d8fa3c}.cm-s-vibrant-ink .cm-attribute,.cm-s-vibrant-ink .cm-builtin,.cm-s-vibrant-ink .cm-tag{color:#8da6ce}.cm-s-vibrant-ink .cm-header{color:#ff6400}.cm-s-vibrant-ink .cm-hr{color:#aeaeae}.cm-s-vibrant-ink .cm-link{color:blue}.cm-s-vibrant-ink .cm-error{border-bottom:1px solid red}.cm-s-vibrant-ink .CodeMirror-activeline-background{background:#27282e}.cm-s-vibrant-ink .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-xq-dark.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-xq-dark div.CodeMirror-selected{background:#27007a}.cm-s-xq-dark .CodeMirror-line::selection,.cm-s-xq-dark .CodeMirror-line>span::selection,.cm-s-xq-dark .CodeMirror-line>span>span::selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-line::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-xq-dark .CodeMirror-guttermarker{color:#ffbd40}.cm-s-xq-dark .CodeMirror-guttermarker-subtle,.cm-s-xq-dark .CodeMirror-linenumber{color:#f8f8f8}.cm-s-xq-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-xq-dark span.cm-keyword{color:#ffbd40}.cm-s-xq-dark span.cm-atom{color:#6c8cd5}.cm-s-xq-dark span.cm-number{color:#164}.cm-s-xq-dark span.cm-def{color:#fff;text-decoration:underline}.cm-s-xq-dark span.cm-variable{color:#fff}.cm-s-xq-dark span.cm-variable-2{color:#eee}.cm-s-xq-dark span.cm-variable-3{color:#ddd}.cm-s-xq-dark span.cm-comment{color:gray}.cm-s-xq-dark span.cm-string{color:#9fee00}.cm-s-xq-dark span.cm-meta{color:#ff0}.cm-s-xq-dark span.cm-qualifier{color:#fff700}.cm-s-xq-dark span.cm-builtin{color:#30a}.cm-s-xq-dark span.cm-bracket{color:#cc7}.cm-s-xq-dark span.cm-tag{color:#ffbd40}.cm-s-xq-dark span.cm-attribute{color:#fff700}.cm-s-xq-dark span.cm-error{color:red}.cm-s-xq-dark .CodeMirror-activeline-background{background:#27282e}.cm-s-xq-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}.cm-s-xq-light span.cm-keyword{line-height:1em;font-weight:700;color:#5a5cad}.cm-s-xq-light span.cm-atom{color:#6c8cd5}.cm-s-xq-light span.cm-number{color:#164}.cm-s-xq-light span.cm-def{text-decoration:underline}.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3{color:#000}.cm-s-xq-light span.cm-comment{color:#0080ff;font-style:italic}.cm-s-xq-light span.cm-string{color:red}.cm-s-xq-light span.cm-meta{color:#ff0}.cm-s-xq-light span.cm-qualifier{color:grey}.cm-s-xq-light span.cm-builtin{color:#7ea656}.cm-s-xq-light span.cm-bracket{color:#cc7}.cm-s-xq-light span.cm-tag{color:#3f7f7f}.cm-s-xq-light span.cm-attribute{color:#7f007f}.cm-s-xq-light span.cm-error{color:red}.cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-xq-light .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important;background:#ff0}.cm-s-yeti.CodeMirror{background-color:#eceae8!important;color:#d1c9c0!important;border:none}.cm-s-yeti .CodeMirror-gutters{color:#adaba6;background-color:#e5e1db;border:none}.cm-s-yeti .CodeMirror-cursor{border-left:thin solid #d1c9c0}.cm-s-yeti .CodeMirror-linenumber{color:#adaba6}.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::selection,.cm-s-yeti .CodeMirror-line>span::selection,.cm-s-yeti .CodeMirror-line>span>span::selection{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::-moz-selection,.cm-s-yeti .CodeMirror-line>span::-moz-selection,.cm-s-yeti .CodeMirror-line>span>span::-moz-selection{background:#dcd8d2}.cm-s-yeti span.cm-comment{color:#d4c8be}.cm-s-yeti span.cm-string,.cm-s-yeti span.cm-string-2{color:#96c0d8}.cm-s-yeti span.cm-number{color:#a074c4}.cm-s-yeti span.cm-variable{color:#55b5db}.cm-s-yeti span.cm-variable-2{color:#a074c4}.cm-s-yeti span.cm-def{color:#55b5db}.cm-s-yeti span.cm-keyword,.cm-s-yeti span.cm-operator{color:#9fb96e}.cm-s-yeti span.cm-atom{color:#a074c4}.cm-s-yeti span.cm-meta,.cm-s-yeti span.cm-tag{color:#96c0d8}.cm-s-yeti span.cm-attribute{color:#9fb96e}.cm-s-yeti span.cm-qualifier{color:#96c0d8}.cm-s-yeti span.cm-builtin,.cm-s-yeti span.cm-property{color:#a074c4}.cm-s-yeti span.cm-variable-3{color:#96c0d8}.cm-s-yeti .CodeMirror-activeline-background{background:#e7e4e0}.cm-s-yeti .CodeMirror-matchingbracket{text-decoration:underline}.cm-s-zenburn .CodeMirror-gutters{background:#3f3f3f!important}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:#999}.cm-s-zenburn .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-zenburn{background-color:#3f3f3f;color:#dcdccc}.cm-s-zenburn span.cm-builtin{color:#dcdccc;font-weight:700}.cm-s-zenburn span.cm-comment{color:#7f9f7f}.cm-s-zenburn span.cm-keyword{color:#f0dfaf;font-weight:700}.cm-s-zenburn span.cm-atom{color:#bfebbf}.cm-s-zenburn span.cm-def{color:#dcdccc}.cm-s-zenburn span.cm-variable{color:#dfaf8f}.cm-s-zenburn span.cm-variable-2{color:#dcdccc}.cm-s-zenburn span.cm-string,.cm-s-zenburn span.cm-string-2{color:#cc9393}.cm-s-zenburn span.cm-number{color:#dcdccc}.cm-s-zenburn span.cm-tag{color:#93e0e3}.cm-s-zenburn span.cm-attribute,.cm-s-zenburn span.cm-property{color:#dfaf8f}.cm-s-zenburn span.cm-qualifier{color:#7cb8bb}.cm-s-zenburn span.cm-meta{color:#f0dfaf}.cm-s-zenburn span.cm-header,.cm-s-zenburn span.cm-operator{color:#f0efd0}.cm-s-zenburn span.CodeMirror-matchingbracket{box-sizing:border-box;background:transparent;border-bottom:1px solid}.cm-s-zenburn span.CodeMirror-nonmatchingbracket{border-bottom:1px solid;background:none}.cm-s-zenburn .CodeMirror-activeline,.cm-s-zenburn .CodeMirror-activeline-background{background:#000}.cm-s-zenburn div.CodeMirror-selected{background:#545454}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected{background:#4f4f4f}.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-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror{font:inherit}.CodeMirror-scroll{font-family:Menlo Regular,Consolas,Monaco,monospace;line-height:150%;position:relative}.CodeMirror-settings{color:#444;height:0;width:100%;z-index:9;text-shadow:none}.CodeMirror-settings__toggle{border-radius:3px;z-index:11;box-sizing:border-box;position:absolute;top:0;right:0;margin:6px;display:block;cursor:pointer}.CodeMirror-settings__toggle:after{content:"\f111";font-family:dashicons;line-height:1em;display:inline-block}.CodeMirror-settings__toggle:before{border:1px solid #ddd;border-radius:3px;z-index:-1;content:"";background-color:#fff;transition:.25s ease;transition-property:transform opacity;position:absolute;top:0;right:0;bottom:0;left:0}.CodeMirror-settings__wrapper{pointer-events:none;visibility:hidden}.CodeMirror-settings__body,.CodeMirror-settings__docked{pointer-events:auto;visibility:visible}.CodeMirror-settings__wrapper{position:absolute;width:calc(100% - 12px);max-height:calc(100% - 12px);top:0;margin:6px;box-sizing:border-box;z-index:9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.CodeMirror-settings__docked{-ms-flex:0 0 auto;flex:0 0 auto;z-index:10;background-color:#fff;box-sizing:border-box}.CodeMirror-settings__header{border-top-left-radius:3px;border-top-right-radius:3px;border:1px solid #ddd;padding:4px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.CodeMirror-settings__body{-ms-flex:1 1 auto;flex:1 1 auto;box-sizing:border-box;padding:1px 12px;overflow-y:auto;background-color:hsla(0,0%,100%,.93);border-left:1px solid #ddd;border-right:1px solid #ddd}.CodeMirror-settings__footer{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border:1px solid #ddd;padding:6px 12px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;-ms-flex-line-pack:center;align-content:center;-ms-flex-pack:justify;justify-content:space-between}.CodeMirror-settings-advanced__description{margin-left:10px;opacity:.6}td.CodeMirror-settings__heading{padding:0;padding-bottom:12px}.CodeMirror-settings__foot-content{margin:0}.CodeMirror-settings__body,.CodeMirror-settings__footer,.CodeMirror-settings__header,.CodeMirror-settings__toggle,.CodeMirror-settings__toggle-advanced,.CodeMirror-settings__wrapper{transition:.25s ease;transition-property:opacity,transform;transform-origin:top right}.CodeMirror-settings.closed .CodeMirror-settings__toggle-advanced:before{content:"more..."}.CodeMirror-settings.closed .CodeMirror-settings__toggle{opacity:.5}.CodeMirror-settings.closed .CodeMirror-settings__toggle:before,.CodeMirror-settings.closed .CodeMirror-settings__toggle:hover{opacity:1}.CodeMirror-settings.closed .CodeMirror-settings__wrapper{opacity:0;transform:scaleX(0)}.CodeMirror-settings.closed .CodeMirror-settings__body,.CodeMirror-settings.closed .CodeMirror-settings__footer{visibility:hidden;opacity:0;transform:translateY(-20px);transition:opacity .25s ease,transform .25s ease,visibility 1ms ease .25s}.CodeMirror-settings.open .CodeMirror-settings__toggle-advanced:before{content:"more..."}.CodeMirror-settings.open .CodeMirror-settings__toggle:after{content:"\f158"}.CodeMirror-settings.open .CodeMirror-settings__toggle:before{opacity:0}.CodeMirror-settings.open .CodeMirror-settings__wrapper{opacity:1;transform:scaleX(1)}.CodeMirror-settings.open .CodeMirror-settings__body,.CodeMirror-settings.open .CodeMirror-settings__footer{visibility:hidden;opacity:0;transform:translateY(-20px);transition:opacity .25s ease,transform .25s ease,visibility 1ms ease .25s}.CodeMirror-settings.open-advanced .CodeMirror-settings__toggle-advanced:before{content:"less"}.CodeMirror-settings.open-advanced .CodeMirror-settings__header{border-bottom-left-radius:0;border-bottom-right-radius:0}.CodeMirror-settings.open-advanced .CodeMirror-settings__body,.CodeMirror-settings.open-advanced .CodeMirror-settings__footer{visibility:visible;opacity:1;transform:translate(0);transition:visibility 1ms ease,opacity .25s ease 1ms,transform .25s ease 1ms}.CodeMirror-settings__button{position:relative}.CodeMirror-settings__button:active{transform:none!important}.CodeMirror-settings__button input,.CodeMirror-settings__button select{display:block;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-appearance:none;margin:0;padding:0;border:none;height:auto;font-size:0;line-height:0;height:100%!important;width:100%!important;background:none;opacity:0}.CodeMirror-settings__button option{font-size:12px}.CodeMirror-settings__button--select:after{content:"\f140";font-family:dashicons;vertical-align:top;display:inline-block;margin:0 -5px -4px}.CodeMirror-settings__toggle-advanced{cursor:pointer;display:inline-block;line-height:25px;padding:0 4px;vertical-align:middle}.CodeMirror-dialog{position:absolute;left:0;right:0;top:0;width:calc(100% - 12px);margin:6px;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;z-index:12;padding-left:12px;border-radius:3px;border:1px solid #ddd;color:#444;background-color:#fff}.CodeMirror-dialog:after{position:absolute;right:0;top:0;bottom:0;content:"\f158";font-family:dashicons;line-height:1em;cursor:pointer}.CodeMirror-dialog input{border:none;outline:none;background:rgba(0,0,0,.05);color:inherit;font-family:monospace;margin:-1px 12px;padding:0 12px;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch;-ms-flex:1 1 auto;flex:1 1 auto}.CodeMirror-dialog input,.CodeMirror-dialog input:focus{box-shadow:none}.CodeMirror-dialog button{margin:0 2px!important}.CodeMirror-dialog button:first-of-type{margin-left:12px!important}.CodeMirror-dialog span{-ms-flex-item-align:stretch;align-self:stretch;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.CodeMirror-overlayscroll .CodeMirror-gutter-filler,.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler{display:none!important}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6;transition:opacity .1s linear;opacity:.5}.CodeMirror-overlayscroll-horizontal:hover,.CodeMirror-overlayscroll-vertical:hover{opacity:1}.CodeMirror-overlayscroll-horizontal:active,.CodeMirror-overlayscroll-vertical:active{opacity:.75}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:transparent!important}.CodeMirror-overlayscroll-horizontal div:after,.CodeMirror-overlayscroll-vertical div:after{content:"";background-color:#f5f5f5;border:1px solid #ddd;border-radius:4px;position:absolute}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:8px;margin-bottom:6px}.CodeMirror-overlayscroll-horizontal div{top:0;bottom:0}.CodeMirror-overlayscroll-horizontal div:after{top:0;bottom:0;left:6px;right:6px}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:8px;margin-right:6px}.CodeMirror-overlayscroll-vertical div{left:0;right:0}.CodeMirror-overlayscroll-vertical div:after{left:0;right:0;bottom:6px}.wp-editor-expand .CodeMirror{min-height:300px}.wp-editor-expand .CodeMirror .CodeMirror-scroll{padding-bottom:330px!important;margin-bottom:-330px!important}.CodeMirror-mirrored{display:block!important;position:fixed!important;left:-9999px!important;top:-9999px!important;z-index:-999!important;opacity:0!important}#template .CodeMirror div{margin-right:0}#template .CodeMirror p{width:auto}.CodeMirror-vscrollbar{display:none!important}.CodeMirror-scroll{margin-right:-30px!important}.CodeMirror-settings__toggle{margin:6px!important}.heshFullscreen{z-index:99999;position:fixed!important;top:0;left:0;right:0;bottom:0;height:100%;background:#fff;padding:2% 2% 0}.heshFullscreen .CodeMirror{border:1px solid #ccc;border-radius:0 0 4px 4px;height:85%!important}.heshFullscreen #ed_toolbar{border:1px solid #ccc;border-bottom:0;border-radius:4px 4px 0 0}.heshFullscreen #cm_content_fullscreen:before{content:"\f506"}.cm-matchhighlight,.CodeMirror-matchingbracket,.CodeMirror-matchingtag{background-color:rgba(0,255,175,.2)}#cm_content_fullscreen{display:inline-block}.wp-editor-expand #cm_content_fullscreen{display:none}.hesh-content-resize-handle{position:absolute;right:0;bottom:0;width:12px;height:12px;z-index:8;margin:1px!important}#ed_toolbar{z-index:10}@media screen and (min-width:782px){.CodeMirror-settings__toggle{height:35px;width:35px}.CodeMirror-settings__toggle:after{font-size:20px;margin:7px}.CodeMirror-settings__docked{min-height:35px}.CodeMirror-settings__header{padding-right:35px}.CodeMirror-settings__button--select:after{font-size:16px;margin-top:0}.CodeMirror-dialog{height:35px;padding-right:35px}.CodeMirror-dialog:after{font-size:20px;margin:7px}.CodeMirror-overlayscroll-vertical div:after{top:47px}#template .CodeMirror{margin-right:20px}}@media screen and (max-width:781px){.CodeMirror-settings__toggle{height:44px;width:44px}.CodeMirror-settings__toggle:after{font-size:28px;margin:8px}.CodeMirror-settings__docked{min-height:44px}.CodeMirror-settings__header{padding-right:44px}.CodeMirror-settings__button--select:after{font-size:20px;margin-top:-2px}.CodeMirror-dialog{height:44px;padding-right:44px}.CodeMirror-dialog:after{font-size:28px;margin:8px}.CodeMirror-overlayscroll-vertical div:after{top:56px}#template .CodeMirror{margin-right:0}}@media screen and (max-height:550px){.heshFullscreen .CodeMirror{height:75%!important}}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}@keyframes a{50%{background-color:transparent}}
|
dist/hesh.min.js
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),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 i(e,t,r,i){var o=n(e,t,r,i);return o.setAttribute("role","presentation"),o}function o(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function a(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function l(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function s(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function u(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function d(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/))==-1&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function f(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function p(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function h(e){for(;La.length<=e;)La.push(m(La)+" ");return La[e]}function m(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function v(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function y(){}function b(e,t){var r;return Object.create?r=Object.create(e):(y.prototype=e,r=new y),t&&u(t,r),r}function x(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ma.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&x(e))||t.test(e):x(e)}function k(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function _(e){return e.charCodeAt(0)>=768&&Ta.test(e)}function C(e,t,r){for(;(r<0?t>0:t<e.length)&&_(e.charAt(t));)t+=r;return t}function S(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function L(e,t,r){var o=this;this.input=r,o.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=n("div",null,"CodeMirror-cursors"),o.measure=n("div",null,"CodeMirror-measure"),o.lineMeasure=n("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=n("div",[a],null,"position: relative"),o.sizer=n("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=n("div",null,null,"position: absolute; height: "+wa+"px; width: 1px;"),o.gutters=n("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=n("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=n("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),Zo&&Qo<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Jo||$o&&sa||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(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,r.init(o)}function M(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function T(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function O(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function z(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function N(e){if(null==e.parent)return null;for(var t=e.parent,r=f(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function A(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function E(e,t){return t>=e.first&&t<e.first+e.size}function q(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function I(e,t,r){if(void 0===r&&(r=null),!(this instanceof I))return new I(e,t,r);this.line=e,this.ch=t,this.sticky=r}function W(e,t){return e.line-t.line||e.ch-t.ch}function P(e,t){return e.sticky==t.sticky&&0==W(e,t)}function D(e){return I(e.line,e.ch)}function H(e,t){return W(e,t)<0?t:e}function F(e,t){return W(e,t)<0?e:t}function B(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function j(e,t){if(t.line<e.first)return I(e.first,0);var r=e.first+e.size-1;return t.line>r?I(r,M(e,r).text.length):R(t,M(e,t.line).text.length)}function R(e,t){var r=e.ch;return null==r||r>t?I(e.line,t):r<0?I(e.line,0):e}function U(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=j(e,t[n]);return r}function V(){Oa=!0}function K(){za=!0}function $(e,t,r){this.marker=e,this.from=t,this.to=r}function G(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function X(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Y(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Z(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new $(a,o.from,s?null:o.to))}}return n}function Q(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new $(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function J(e,t){if(t.full)return null;var r=E(e,t.from.line)&&M(e,t.from.line).markedSpans,n=E(e,t.to.line)&&M(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==W(t.from,t.to),l=Z(r,i,a),s=Q(n,o,a),c=1==t.text.length,u=m(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var p=G(s,f.marker);p?c&&(f.to=null==p.to?null:p.to+u):f.to=i}}if(s)for(var h=0;h<s.length;++h){var g=s[h];if(null!=g.to&&(g.to+=u),null==g.from){var v=G(l,g.marker);v||(g.from=u,c&&(l||(l=[])).push(g))}else g.from+=u,c&&(l||(l=[])).push(g)}l&&(l=ee(l)),s&&s!=l&&(s=ee(s));var y=[l];if(!c){var b,x=t.text.length-2;if(x>0&&l)for(var w=0;w<l.length;++w)null==l[w].to&&(b||(b=[])).push(new $(l[w].marker,null,null));for(var k=0;k<x;++k)y.push(b);y.push(s)}return y}function ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function te(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&f(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(W(c.to,l.from)<0||W(c.from,l.to)>0)){var u=[s,1],d=W(c.from,l.from),p=W(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function re(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function ne(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function ae(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=W(n.from,i.from)||ie(e)-ie(t);if(o)return-o;var a=W(n.to,i.to)||oe(e)-oe(t);return a?a:t.id-e.id}function le(e,t){var r,n=za&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||ae(r,i.marker)<0)&&(r=i.marker);return r}function se(e){return le(e,!0)}function ce(e){return le(e,!1)}function ue(e,t,r,n,i){var o=M(e,t),a=za&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=W(c.from,r)||ie(s.marker)-ie(i),d=W(c.to,n)||oe(s.marker)-oe(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?W(c.to,r)>=0:W(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?W(c.from,n)<=0:W(c.from,n)<0)))return!0}}}function de(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function fe(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function pe(e){for(var t,r;t=ce(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function he(e,t){var r=M(e,t),n=de(r);return r==n?t:N(n)}function me(e,t){if(t>e.lastLine())return t;var r,n=M(e,t);if(!ge(e,n))return t;for(;r=ce(n);)n=r.find(1,!0).line;return N(n)+1}function ge(e,t){var r=za&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ve(e,t,n))return!0}}function ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ve(e,n.line,G(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ve(e,t,i))return!0}function ye(e){e=de(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function be(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=se(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ce(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function xe(e){var t=e.display,r=e.doc;t.maxLine=M(r,r.first),t.maxLineLength=be(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=be(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ke(e,t,r){var n;Na=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Na=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Na=i)}return null!=n?n:Na}function _e(e,t){var r=e.order;return null==r&&(r=e.order=Aa(e.text,t)),r}function Ce(e,t,r){var n=C(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Se(e,t,r){var n=Ce(e,t.ch,r);return null==n?null:new I(t.line,n,r<0?"after":"before")}function Le(e,t,r,n,i){if(e){var o=_e(r,t.doc.direction);if(o){var a,l=i<0?m(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Yt(t,r);a=i<0?r.text.length-1:0;var d=Zt(t,u,a).top;a=S(function(e){return Zt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Ce(r,a,1,!0))}else a=i<0?l.to:l.from;return new I(n,a,c)}}return new I(n,i<0?r.text.length:0,i<0?"before":"after")}function Me(e,t,r,n){var i=_e(t,e.doc.direction);if(!i)return Se(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=ke(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Se(t,r,n);var l,s=function(e,r){return Ce(t,e instanceof I?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||Yt(e,t),mr(e,t,l,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,f=s(r,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=u.end:f>=a.from&&f>=u.begin)){var p=d?"before":"after";return new I(r.line,f,p)}}var h=function(e,t,n){for(var o=function(e,t){return t?new I(r.line,s(e,1),"before"):new I(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},m=h(o+n,n,u);if(m)return m;var g=n>0?u.end:s(u.begin,-1);return null==g||n>0&&g==t.text.length||!(m=h(n>0?0:i.length-1,n,c(g)))?null:m}function Te(e,t){return e._handlers&&e._handlers[t]||Ea}function Oe(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=f(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ze(e,t){var r=Te(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ne(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ze(e,r||t.type,e,t),Pe(t)||t.codemirrorIgnore}function Ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)f(r,t[n])==-1&&r.push(t[n])}function Ee(e,t){return Te(e,t).length>0}function qe(e){e.prototype.on=function(e,t){qa(this,e,t)},e.prototype.off=function(e,t){Oe(this,e,t)}}function Ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function We(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Pe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function De(e){Ie(e),We(e)}function He(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ca&&e.ctrlKey&&1==t&&(t=3),t}function Be(e){if(null==ba){var t=n("span","");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ba=t.offsetWidth<=1&&t.offsetHeight>2&&!(Zo&&Qo<8))}var i=ba?n("span",""):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function je(e){if(null!=xa)return xa;var n=r(e,document.createTextNode("AخA")),i=pa(n,0,1).getBoundingClientRect(),o=pa(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(xa=o.right-i.right<3)}function Re(e){if(null!=Ha)return Ha;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=pa(t,0,1).getBoundingClientRect();return Ha=Math.abs(i.left-o.left)>1}function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fa[e]=t}function Ve(e,t){Ba[e]=t}function Ke(e){if("string"==typeof e&&Ba.hasOwnProperty(e))e=Ba[e];else if(e&&"string"==typeof e.name&&Ba.hasOwnProperty(e.name)){var t=Ba[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=Ke(t);var r=Fa[t.name];if(!r)return $e(e,"text/plain");var n=r(e,t);if(ja.hasOwnProperty(t.name)){var i=ja[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}function Ge(e,t){u(t,ja.hasOwnProperty(e)?ja[e]:ja[e]={})}function Xe(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ye(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ze(e,t,r){return!e.startState||e.startState(t,r)}function Qe(e,t,r,n){var i=[e.state.modeGen],o={};at(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=0;a<e.state.overlays.length;++a)!function(r){var n=e.state.overlays[r],a=1,l=0;at(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)}(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Je(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=et(e,N(t)),i=Qe(e,t,t.text.length>e.options.maxHighlightLength?Xe(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function et(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=lt(e,t,r),a=o>n.first&&M(n,o-1).stateAfter;return a=a?Xe(n.mode,a):Ze(n.mode),n.iter(o,t,function(r){tt(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?Xe(n.mode,a):null,++o}),r&&(n.frontier=o),a}function tt(e,t,r,n){var i=e.doc.mode,o=new Ra(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&rt(i,r);!o.eol();)nt(i,o,r),o.start=o.pos}function rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ye(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function nt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ye(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?Xe(a.mode,u):u}},a=e.doc,l=a.mode;t=j(a,t);var s,c=M(a,t.line),u=et(e,t.line,r),d=new Ra(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=nt(l,d,u),n&&s.push(o(!0));return n?s:o()}function ot(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function at(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Ra(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&ot(rt(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&tt(e,t,n,d.pos),d.pos=t.length,s=null):s=ot(nt(r,d,n,f),o),f){var p=f[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);i(h,u),c=h}}function lt(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=M(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=d(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function st(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),re(e),ne(e,r);var i=n?n(e):1;i!=e.height&&z(e,i)}function ct(e){e.parent=null,re(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$a:Ka;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function dt(e,t){var r=i("span",null,null,Jo?"padding-right: .1px":null),n={pre:i("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Zo||Jo)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,l=void 0;n.pos=0,n.addToken=pt,je(e.display.measure)&&(l=_e(a,e.doc.direction))&&(n.addToken=mt(n.addToken,l)),n.map=[];vt(a,n,Je(e,a,t!=e.display.externalMeasured&&N(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=s(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=s(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Be(e.display.measure))),0==o?(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(Jo){var c=n.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=s(n.pre.className,n.textClass||"")),n}function ft(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?ht(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var p=u.exec(t),m=p?p.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));Zo&&Qo<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",h(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(v=s.appendChild(n("span","\r"==p[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",p[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),Zo&&Qo<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),Zo&&Qo<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var x=r||"";i&&(x+=i),o&&(x+=o);var w=n("span",[s],x,l);return a&&(w.title=a),e.content.appendChild(w)}e.content.appendChild(s)}}function ht(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function mt(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function gt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var w=n[x],k=w.marker;"bookmark"==k.type&&w.from==h&&k.widgetNode?y.push(k):w.from<=h&&(null==w.to||w.to>h||k.collapsed&&w.to==h&&w.from==h)?(null!=w.to&&w.to!=h&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==h&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||ae(f.marker,k)<0)&&(f=w)):w.from>h&&v>w.from&&(v=w.from)}if(b)for(var _=0;_<b.length;_+=2)b[_+1]==v&&(c+=" "+b[_]);if(!f||f.from==h)for(var C=0;C<y.length;++C)gt(t,0,y[C]);if(f&&(f.from||0)==h){if(gt(t,(null==f.to?p+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=p)break;for(var S=Math.min(p,v);;){if(g){var L=h+g.length;if(!f){var M=L>S?g.slice(0,S-h):g;t.addToken(t,M,a?a+s:s,u,h+M.length==v?c:"",d,l)}if(L>=S){g=g.slice(S-h),h=S;break}h=L,u=""}g=i.slice(o,o=r[m++]),a=ut(r[m++],t.cm.options)}}else for(var T=1;T<r.length;T+=2)t.addToken(t,i.slice(o,o=r[T]),ut(r[T+1],t.cm.options))}function yt(e,t,r){this.line=t,this.rest=pe(t),this.size=this.rest?N(m(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ge(e,t)}function bt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new yt(e.doc,M(e.doc,o),o);n=o+a.size,i.push(a)}return i}function xt(e){Ga?Ga.ops.push(e):e.ownsGroup=Ga={ops:[e],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function kt(e,t){var r=e.ownsGroup;if(r)try{wt(r)}finally{Ga=null,t(r)}}function _t(e,t){var r=Te(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Ga?n=Ga.delayedCallbacks:Xa?n=Xa:(n=Xa=[],setTimeout(Ct,0));for(var o=0;o<r.length;++o)!function(e){n.push(function(){return r[e].apply(null,i)})}(o)}}function Ct(){var e=Xa;Xa=null;for(var t=0;t<e.length;++t)e[t]()}function St(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Ot(e,t):"gutter"==o?Nt(e,t,r,n):"class"==o?zt(e,t):"widget"==o&&At(e,t,n)}t.changes=null}function Lt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Zo&&Qo<8&&(e.node.style.zIndex=2)),e.node}function Mt(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=Lt(t);t.background=i.insertBefore(n("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function Tt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):dt(e,t)}function Ot(e,t){var r=t.text.className,n=Tt(e,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,zt(e,t)):r&&(t.text.className=r)}function zt(e,t){Mt(e,t),t.line.wrapClass?Lt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Nt(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Lt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Lt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",q(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var u=e.options.gutters[c],d=a.hasOwnProperty(u)&&a[u];d&&s.appendChild(n("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function At(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);qt(e,t,r)}function Et(e,t,r,n){var i=Tt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),zt(e,t),Nt(e,t,r,n),qt(e,t,n),t.node}function qt(e,t,r){if(It(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)It(e,t.rest[n],t,r,!1)}function It(e,t,r,i,o){if(t.widgets)for(var a=Lt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Wt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),_t(c,"redraw")}}function Wt(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Pt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Dt(e,t){for(var r=He(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ht(e){return e.lineSpace.offsetTop}function Ft(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Bt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function jt(e){return wa-e.display.nativeBarWidth}function Rt(e){return e.display.scroller.clientWidth-jt(e)-e.display.barWidth}function Ut(e){return e.display.scroller.clientHeight-jt(e)-e.display.barHeight}function Vt(e,t,r){var n=e.options.lineWrapping,i=n&&Rt(e);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(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Kt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(N(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function $t(e,t){t=de(t);var n=N(t),i=e.display.externalMeasured=new yt(e.doc,t,n);i.lineN=n;var o=i.built=dt(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Gt(e,t,r,n){return Zt(e,Yt(e,t),r,n)}function Xt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Cr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Yt(e,t){var r=N(t),n=Xt(e,r);n&&!n.text?n=null:n&&n.changes&&(St(e,n,r,br(e)),e.curOp.forceUpdate=!0),n||(n=$t(e,t));var i=Kt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,
|
2 |
-
before:i.before,hasHeights:!1}}function Zt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Vt(e,t.view,t.rect),t.hasHeights=!0),o=er(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Qt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[2+(c+=3)],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Jt(e,t){var r=Ya;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function er(e,t,r,n){var i,o=Qt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&_(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&_(t.line.text.charAt(o.coverStart+s));)++s;if(i=Zo&&Qo<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Jt(pa(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}Zo&&Qo<11&&(i=tr(e.display.measure,i))}else{l>0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(Zo&&Qo<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+yr(e.display),top:f.top,bottom:f.bottom}:Ya}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,b=g[v],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=p,x.rbottom=h),x}function tr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Re(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function rr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function nr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)rr(e.display.view[r])}function ir(e){nr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function or(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ar(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lr(e,t,r,n,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=Pt(t.widgets[o]);r.top+=a,r.bottom+=a}if("line"==n)return r;n||(n="local");var l=ye(t);if("local"==n?l+=Ht(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:ar());var c=s.left+("window"==n?0:or());r.left+=c,r.right+=c}return r.top+=l,r.bottom+=l,r}function sr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=or(),i-=ar();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function cr(e,t,r,n,i){return n||(n=M(e.doc,t.line)),lr(e,n,Gt(e,n,t.ch,i),r)}function ur(e,t,r,n,i,o){function a(t,a){var l=Zt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,lr(e,n,l,r)}function l(e,t,r){var n=s[t],i=n.level%2!=0;return a(r?e-1:e,i!=r)}n=n||M(e.doc,t.line),i||(i=Yt(e,n));var s=_e(n,e.doc.direction),c=t.ch,u=t.sticky;if(c>=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var d=ke(s,c,u),f=Na,p=l(c,d,"before"==u);return null!=f&&(p.other=l(c,f,"before"!=u)),p}function dr(e,t){var r=0;t=j(e.doc,t),e.options.lineWrapping||(r=yr(e.display)*t.ch);var n=M(e.doc,t.line),i=ye(n)+Ht(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function fr(e,t,r,n,i){var o=I(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function pr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return fr(n.first,0,null,!0,-1);var i=A(n,r),o=n.first+n.size-1;if(i>o)return fr(n.first+n.size-1,M(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=M(n,i);;){var l=gr(e,a,i,t,r),s=ce(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=N(a=c.to.line)}}function hr(e,t,r,n){var i=function(n){return lr(e,t,Zt(e,r,n),"line")},o=t.text.length,a=S(function(e){return i(e-1).bottom<=n},o,0);return o=S(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function mr(e,t,r,n){return hr(e,t,r,lr(e,t,Zt(e,r,n),"line").top)}function gr(e,t,r,n,i){i-=ye(t);var o,a=0,l=t.text.length,s=Yt(e,t);if(_e(t,e.doc.direction)){if(e.options.lineWrapping){var c;c=hr(e,t,s,i),a=c.begin,l=c.end}o=new I(r,a);var u,d,f=ur(e,o,"line",t,s).left,p=f<n?1:-1,h=f-n;do{if(u=h,d=o,null==(o=Me(e,t,o,p))||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=d;break}h=ur(e,o,"line",t,s).left-n}while(p<0!=h<0&&Math.abs(h)<=Math.abs(u));if(Math.abs(h)>Math.abs(u)){if(h<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=d}}else{var m=S(function(r){var o=lr(e,t,Zt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.right<n)&&n-o.left<o.right-n)},a,l);m=C(t.text,m,1),o=new I(r,m,m==l?"before":"after")}var g=ur(e,o,"line",t,s);return(i<g.top||g.bottom<i)&&(o.outside=!0),o.xRel=n<g.left?-1:n>g.right?1:0,o}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Va){Va=n("pre");for(var i=0;i<49;++i)Va.appendChild(document.createTextNode("x")),Va.appendChild(n("br"));Va.appendChild(document.createTextNode("x"))}r(e.measure,Va);var o=Va.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function yr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function br(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:xr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function xr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/yr(e.display)-3);return function(i){if(ge(e.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 r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function kr(e){var t=e.doc,r=wr(e);t.iter(function(e){var t=r(e);t!=e.height&&z(e,t)})}function _r(e,t,r,n){var i=e.display;if(!r&&"true"==He(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,c=pr(e,o,a);if(n&&1==c.xRel&&(s=M(e.doc,c.line).text).length==c.ch){var u=d(s,s.length,e.options.tabSize)-s.length;c=I(c.line,Math.max(0,Math.round((o-Bt(e.display).left)/yr(e.display))-u))}return c}function Cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function Sr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Lr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t!==!1||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Mr(e,l.head,i),s||Tr(e,l,o)}}return n}function Mr(e,t,r){var i=ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Tr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?d-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return cr(e,I(t,r),"div",c,n)}var a,s,c=M(l,t),f=c.text.length;return we(_e(c,l.direction),r||0,null==n?f:n,function(e,t,l){var c,p,h,m=o(e,"left");if(e==t)c=m,p=h=m.left;else{if(c=o(t-1,"right"),"rtl"==l){var g=m;m=c,c=g}p=m.left,h=c.right}null==r&&0==e&&(p=u),c.top-m.top>3&&(i(p,m.top,null,m.bottom),p=u,m.bottom<c.top&&i(p,m.bottom,null,c.top)),null==n&&t==f&&(h=d),(!a||m.top<a.top||m.top==a.top&&m.left<a.left)&&(a=m),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),p<u+1&&(p=u),i(p,c.top,h-p,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=Bt(e.display),u=c.left,d=Math.max(a.sizerWidth,Rt(e)-a.sizer.offsetLeft)-c.right,f=t.from(),p=t.to();if(f.line==p.line)o(f.line,f.ch,p.ch);else{var h=M(l,f.line),m=M(l,p.line),g=de(h)==de(m),v=o(f.line,f.ch,g?h.text.length+1:null).end,y=o(p.line,g?0:null,p.ch).start;g&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function Or(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function zr(e){e.state.focused||(e.display.input.focus(),Ar(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))},100)}function Ar(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ze(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Jo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Or(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,ga(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function qr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Ir(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=q(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Mn(e),!0}return!1}function Wr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(Zo&&Qo<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=vr(t)),(s>.001||s<-.001)&&(z(i.line,o),Pr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Pr(i.rest[c])}}}function Pr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Dr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ht(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=A(t,n),a=A(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=A(t,ye(M(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=A(t,ye(M(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Hr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,$o||Sn(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),$o&&Sn(e),xn(e,100))}function Fr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,qr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function jr(e){var t=Br(e);return t.x*=Qa,t.y*=Qa,t}function Rr(e,t){var r=Br(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&ca&&Jo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!$o&&!ra&&null!=Qa)return i&&s&&Hr(e,Math.max(0,Math.min(a.scrollTop+i*Qa,a.scrollHeight-a.clientHeight))),Fr(e,Math.max(0,Math.min(a.scrollLeft+n*Qa,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&Ie(t),void(o.wheelStartX=null);if(i&&null!=Qa){var f=i*Qa,p=e.doc.scrollTop,h=p+o.wrapper.clientHeight;f<0?p=Math.max(0,p+f-50):h=Math.min(e.doc.height,h+f+50),Sn(e,{top:p,bottom:h})}Za<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Qa=(Qa*Za+r)/(Za+1),++Za)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Ur(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ft(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+jt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Vr(e,t){t||(t=Ur(e));var r=e.display.barWidth,n=e.display.barHeight;Kr(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Wr(e),Kr(e,Ur(e)),r=e.display.barWidth,n=e.display.barHeight}function Kr(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function $r(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ga(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new tl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),qa(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Fr(e,t):Hr(e,t)},e),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)}function Gr(e,t){if(!Ne(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!oa){var a=n("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ht(e.display))+"px;\n height: "+(t.bottom-t.top+jt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Xr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1,l=ur(e,t),s=r&&r!=t?ur(e,r):l;i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n};var c=Zr(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Hr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function Yr(e,t){var r=Zr(e,t);null!=r.scrollTop&&Hr(e,r.scrollTop),null!=r.scrollLeft&&Fr(e,r.scrollLeft)}function Zr(e,t){var r=e.display,n=vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Ut(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ft(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Rt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(p?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function Qr(e,t,r){null==t&&null==r||en(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Jr(e){en(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?I(t.line,t.ch-1):t,n=I(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function en(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=dr(e,t.from),n=dr(e,t.to),i=Zr(e,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-t.margin,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+t.margin});e.scrollTo(i.scrollLeft,i.scrollTop)}}function tn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++rl},xt(e.curOp)}function rn(e){kt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;nn(e)})}function nn(e){for(var t=e.ops,r=0;r<t.length;r++)on(t[r]);for(var n=0;n<t.length;n++)an(t[n]);for(var i=0;i<t.length;i++)ln(t[i]);for(var o=0;o<t.length;o++)sn(t[o]);for(var a=0;a<t.length;a++)cn(t[a])}function on(e){var t=e.cm,r=t.display;kn(t),e.updateMaxLine&&xe(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new nl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function an(e){e.updatedDisplay=e.mustUpdate&&_n(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&Wr(t),e.barMeasure=Ur(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Gt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+jt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Rt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==a()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Vr(t,e.barMeasure),e.updatedDisplay&&Tn(t,e.barMeasure),e.selectionChanged&&Or(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&zr(e.cm)}function cn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Cn(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,qr(t)),e.scrollToPos){Gr(t,Xr(t,j(n,e.scrollToPos.from),j(n,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||ze(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&ze(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ze(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function un(e,t){if(e.curOp)return t();tn(e);try{return t()}finally{rn(e)}}function dn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tn(e);try{return t.apply(e,arguments)}finally{rn(e)}}}function fn(e){return function(){if(this.curOp)return e.apply(this,arguments);tn(this);try{return e.apply(this,arguments)}finally{rn(this)}}}function pn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tn(t);try{return e.apply(this,arguments)}finally{rn(t)}}}function hn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)za&&he(e.doc,t)<i.viewTo&&gn(e);else if(r<=i.viewFrom)za&&me(e.doc,r+n)>i.viewFrom?gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gn(e)}else if(r>=i.viewTo){var a=vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):gn(e)}else{var l=vn(e,t,t,-1),s=vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(bt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):gn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function mn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.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[Cr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);f(a,r)==-1&&a.push(r)}}}function gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=Cr(e,t),a=e.display.view;if(!za||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;he(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function yn(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=bt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=bt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Cr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(bt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Cr(e,r)))),n.viewTo=r}function bn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function xn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,c(wn,e))}function wn(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Xe(t.mode,et(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Qe(e,o,l?Xe(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(t.frontier),o.stateAfter=l?n:Xe(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&tt(e,o.text,n),o.stateAfter=t.frontier%5==0?Xe(t.mode,n):null;if(++t.frontier,+new Date>r)return xn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t<i.length;t++)mn(e,i[t],"text")})}}function kn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=jt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=jt(e)+"px",t.scrollbarsClipped=!0)}function _n(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return gn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==bn(e))return!1;Ir(e)&&(gn(e),r.dims=br(e));var o=i.first+i.size,l=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<l&&l-n.viewFrom<20&&(l=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),za&&(l=he(e.doc,l),s=me(e.doc,s));var c=l!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;yn(e,l,s),n.viewOffset=ye(M(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=bn(e);if(!c&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var d=a();return u>4&&(n.lineDiv.style.display="none"),Ln(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,d&&a()!=d&&d.offsetHeight&&d.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,c&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,xn(e,400)),n.updateLineNumbers=null,!0}function Cn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Rt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ft(e.display)-Ut(e),r.top)}),t.visible=Dr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&_n(e,t);n=!1){Wr(e);var i=Ur(e);Sr(e),Vr(e,i),Tn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Sn(e,t){var r=new nl(e,t);if(_n(e,r)){Wr(e),Cn(e,r);var n=Ur(e);Sr(e),Vr(e,n),Tn(e,n),r.finish()}}function Ln(e,r,n){function i(t){var r=t.nextSibling;return Jo&&ca&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,d=0;d<c.length;d++){var p=c[d];if(p.hidden);else if(p.node&&p.node.parentNode==l){for(;s!=p.node;)s=i(s);var h=a&&null!=r&&r<=u&&p.lineNumber;p.changes&&(f(p.changes,"gutter")>-1&&(h=!1),St(e,p,u,n)),h&&(t(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(q(e.options,u)))),s=p.node.nextSibling}else{var m=Et(e,p,u,n);l.insertBefore(m,s)}u+=p.size}for(;s;)s=i(s)}function Mn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Tn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+jt(e)+"px"}function On(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var a=i[o],l=r.appendChild(n("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",Mn(e)}function zn(e){var t=f(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Nn(e,t){var r=e[t];e.sort(function(e,t){return W(e.from(),t.from())}),t=f(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(W(o.to(),i.from())>=0){var a=F(o.from(),i.from()),l=H(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new ol(s?l:a,s?a:l))}}return new il(e,t)}function An(e,t){return new il([new ol(e,t||e)],0)}function En(e){return e.text?I(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function qn(e,t){if(W(e,t.from)<0)return e;if(W(e,t.to)<=0)return En(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=En(t).ch-t.to.ch),I(r,n)}function In(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new ol(qn(i.anchor,t),qn(i.head,t)))}return Nn(r,e.sel.primIndex)}function Wn(e,t,r){return e.line==t.line?I(r.line,e.ch-t.ch+r.ch):I(r.line+(e.line-t.line),e.ch)}function Pn(e,t,r){for(var n=[],i=I(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Wn(l.from,i,o),c=Wn(En(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=W(u.head,u.anchor)<0;n[a]=new ol(d?c:s,d?s:c)}else n[a]=new ol(s,s)}return new il(n,e.sel.primIndex)}function Dn(e){e.doc.mode=$e(e.options,e.doc.modeOption),Hn(e)}function Hn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,xn(e,100),e.state.modeGen++,e.curOp&&hn(e)}function Fn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==m(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Bn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){st(e,r,i,n),_t(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Ua(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,u=M(e,l.line),d=M(e,s.line),f=m(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Fn(e,t)){var g=a(0,c.length-1);o(d,d.text,p),h&&e.remove(l.line,h),g.length&&e.insert(l.line,g)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),p);else{
|
3 |
-
var v=a(1,c.length-1);v.push(new Ua(f+u.text.slice(s.ch),p,n)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),p);var y=a(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,y)}_t(e,"change",e,t)}function jn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function Rn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,kr(e),Dn(e),Un(e),e.options.lineWrapping||xe(e),e.options.mode=t.modeOption,hn(e)}function Un(e){("rtl"==e.doc.direction?l:ga)(e.display.lineDiv,"CodeMirror-rtl")}function Vn(e){un(e,function(){Un(e),hn(e)})}function Kn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function $n(e,t){var r={from:D(t.from),to:En(t),text:T(e,t.from,t.to)};return ei(e,r,t.from.line,t.to.line+1),jn(e,function(e){return ei(e,r,t.from.line,t.to.line+1)},!0),r}function Gn(e){for(;e.length;){if(!m(e).ranges)break;e.pop()}}function Xn(e,t){return t?(Gn(e.done),m(e.done)):e.done.length&&!m(e.done).ranges?m(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}function Yn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xn(i,i.lastOp==n)))a=m(o.changes),0==W(t.from,t.to)&&0==W(t.from,a.to)?a.to=En(t):o.changes.push($n(e,t));else{var s=m(i.done);for(s&&s.ranges||Jn(e.sel,i.done),o={changes:[$n(e,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(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||ze(e,"historyAdded")}function Zn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Qn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Zn(e,o,m(i.done),t))?i.done[i.done.length-1]=t:Jn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Gn(i.undone)}function Jn(e,t){var r=m(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ei(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ti(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ri(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(ti(r[i]));return n}function ni(e,t){var r=ri(e,t),n=J(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function ii(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?il.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&f(t,Number(u[1]))>-1&&(m(l)[d]=c[d],delete c[d])}}}return n}function oi(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=W(r,i)<0;o!=W(n,i)<0?(i=r,r=n):o!=W(r,n)<0&&(r=n)}return new ol(i,r)}return new ol(n||r,r)}function ai(e,t,r,n){fi(e,new il([oi(e,e.sel.primary(),t,r)],0),n)}function li(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=oi(e,e.sel.ranges[i],t[i],null);fi(e,Nn(n,e.sel.primIndex),r)}function si(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,fi(e,Nn(i,e.sel.primIndex),n)}function ci(e,t,r,n){fi(e,An(t,r),n)}function ui(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new ol(j(e,t[n].anchor),j(e,t[n].head))},origin:r&&r.origin};return ze(e,"beforeSelectionChange",e,n),e.cm&&ze(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Nn(n.ranges,n.ranges.length-1):t}function di(e,t,r){var n=e.history.done,i=m(n);i&&i.ranges?(n[n.length-1]=t,pi(e,t,r)):fi(e,t,r)}function fi(e,t,r){pi(e,t,r),Qn(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function pi(e,t,r){(Ee(e,"beforeSelectionChange")||e.cm&&Ee(e.cm,"beforeSelectionChange"))&&(t=ui(e,t,r)),hi(e,gi(e,t,r&&r.bias||(W(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&r.scroll===!1||!e.cm||Jr(e.cm)}function hi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ae(e.cm)),_t(e,"cursorActivity",e))}function mi(e){hi(e,gi(e,e.sel,null,!1),_a)}function gi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=yi(e,a.anchor,l&&l.anchor,r,n),c=yi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ol(s,c))}return i?Nn(i,t.primIndex):t}function vi(e,t,r,n,i){var o=M(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(ze(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=bi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=W(c,r))&&(n<0?u<0:u>0))return vi(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=bi(e,d,n,d.line==t.line?o:null)),d?vi(e,d,t,n,i):null}}return t}function yi(e,t,r,n,i){var o=n||1,a=vi(e,t,r,o,i)||!i&&vi(e,t,r,o,!0)||vi(e,t,r,-o,i)||!i&&vi(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,I(e.first,0))}function bi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?j(e,I(t.line-1)):null:r>0&&t.ch==(n||M(e,t.line)).text.length?t.line<e.first+e.size-1?I(t.line+1,0):null:new I(t.line,t.ch+r)}function xi(e){e.setSelection(I(e.firstLine(),0),I(e.lastLine()),_a)}function wi(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=j(e,t)),r&&(n.to=j(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),ze(e,"beforeChange",e,n),e.cm&&ze(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ki(e,t,r){if(e.cm){if(!e.cm.curOp)return dn(e.cm,ki)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"))||(t=wi(e,t,!0))){var n=Oa&&!r&&te(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)_i(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else _i(e,t)}}function _i(e,t){if(1!=t.text.length||""!=t.text[0]||0!=W(t.from,t.to)){var r=In(e,t);Yn(e,t,r,e.cm?e.cm.curOp.id:NaN),Li(e,t,r,J(e,t));var n=[];jn(e,function(e,r){r||f(n,e.history)!=-1||(Ni(e.history,t),n.push(e.history)),Li(e,t,null,J(e,t))})}}function Ci(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(Jn(n,l),r&&!n.equals(e.sel))return void fi(e,n,{clearRedo:!1});o=n}var c=[];Jn(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"),d=n.changes.length-1;d>=0;--d){var p=function(r){var i=n.changes[r];if(i.origin=t,u&&!wi(e,i,!1))return a.length=0,{};c.push($n(e,i));var o=r?In(e,i):m(a);Li(e,i,o,ni(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:En(i)});var l=[];jn(e,function(e,t){t||f(l,e.history)!=-1||(Ni(e.history,i),l.push(e.history)),Li(e,i,null,ni(e,i))})}(d);if(p)return p.v}}}}function Si(e,t){if(0!=t&&(e.first+=t,e.sel=new il(g(e.sel.ranges,function(e){return new ol(I(e.anchor.line+t,e.anchor.ch),I(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){hn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)mn(e.cm,n,"gutter")}}function Li(e,t,r,n){if(e.cm&&!e.cm.curOp)return dn(e.cm,Li)(e,t,r,n);if(t.to.line<e.first)return void Si(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Si(e,i),t={from:I(e.first,0),to:I(t.to.line+i,t.to.ch),text:[m(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:I(o,M(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=In(e,t)),e.cm?Mi(e.cm,t,n):Bn(e,t,n),pi(e,r,_a)}}function Mi(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=N(de(M(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ae(e),Bn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),xn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?hn(e):o.line!=a.line||1!=t.text.length||Fn(e.doc,t)?hn(e,o.line,a.line+1,c):mn(e,o.line,"text");var u=Ee(e,"changes"),d=Ee(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&_t(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Ti(e,t,r,n,i){if(n||(n=r),W(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),ki(e,{from:r,to:n,text:t,origin:i})}function Oi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function zi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Oi(o.ranges[l].anchor,t,r,n),Oi(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=I(c.from.line+n,c.from.ch),c.to=I(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Ni(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;zi(e.done,r,n,i),zi(e.undone,r,n,i)}function Ai(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=M(e,B(e,t)):i=N(t),null==i?null:(n(o,i)&&e.cm&&mn(e.cm,i,r),o)}function Ei(e,t,r){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Qr(e,null,r)}function qi(e,t,r,n){var i=new sl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ai(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ge(e,t)){var n=ye(t)<e.scrollTop;z(t,t.height+Pt(i)),n&&Qr(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),_t(o,"lineWidgetAdded",o,i,"number"==typeof t?t:N(t)),i}function Ii(e,t,r,n,o){if(n&&n.shared)return Wi(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return dn(e.cm,Ii)(e,t,r,n,o);var a=new ul(e,o),l=W(t,r);if(n&&u(n,a,!1),l>0||0==l&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ue(e,t.line,t,r,a)||t.line!=r.line&&ue(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");K()}a.addToHistory&&Yn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,c=t.line,d=e.cm;if(e.iter(c,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&de(e)==d.display.maxLine&&(s=!0),a.collapsed&&c!=t.line&&z(e,0),Y(e,new $(a,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),a.collapsed&&e.iter(t.line,r.line+1,function(t){ge(e,t)&&z(t,0)}),a.clearOnEnter&&qa(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(V(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++cl,a.atomic=!0),d){if(s&&(d.curOp.updateMaxLine=!0),a.collapsed)hn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)mn(d,f,"text");a.atomic&&mi(d.doc),_t(d,"markerAdded",d,a)}return a}function Wi(e,t,r,n,i){n=u(n),n.shared=!1;var o=[Ii(e,t,r,n,i)],a=o[0],l=n.widgetNode;return jn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Ii(e,j(e,t),j(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=m(o)}),new dl(o,a)}function Pi(e){return e.findMarks(I(e.first,0),e.clipPos(I(e.lastLine())),function(e){return e.parent})}function Di(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(W(o,a)){var l=Ii(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function Hi(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];jn(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];f(n,o.doc)==-1&&(o.parent=null,r.markers.splice(i--,1))}}(t)}function Fi(e){var t=this;if(Ri(t),!Ne(t,e)&&!Dt(t.display,e)){Ie(e),Zo&&(hl=+new Date);var r=_r(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=0;l<i;++l)!function(e,n){if(!t.options.allowDropFileTypes||f(t.options.allowDropFileTypes,e.type)!=-1){var l=new FileReader;l.onload=dn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){r=j(t.doc,r);var s={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};ki(t.doc,s),di(t.doc,An(r,En(s)))}}),l.readAsText(e)}}(n[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var s=e.dataTransfer.getData("Text");if(s){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),pi(t.doc,An(r,r)),c)for(var u=0;u<c.length;++u)Ti(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Bi(e,t){if(Zo&&(!e.state.draggingText||+new Date-hl<100))return void De(t);if(!Ne(e,t)&&!Dt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!na)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ra&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ra&&r.parentNode.removeChild(r)}}function ji(e,t){var i=_r(e,t);if(i){var o=document.createDocumentFragment();Mr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function Ri(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ui(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Vi(){ml||(Ki(),ml=!0)}function Ki(){var e;qa(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ui($i)},100))}),qa(window,"blur",function(){return Ui(Er)})}function $i(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gi(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Xi(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=g(r.split(" "),Gi),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Yi(e,t,r,n){t=Ji(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Yi(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Yi(e,t.fallthrough[o],r,n);if(a)return a}}}function Zi(e){var t="string"==typeof e?e:gl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Qi(e,t){if(ra&&34==e.keyCode&&e.char)return!1;var r=gl[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(ha?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(ha?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)}function Ji(e){return"string"==typeof e?xl[e]:e}function eo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&W(o.from,m(n).to)<=0;){var a=n.pop();if(W(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}un(e,function(){for(var t=n.length-1;t>=0;t--)Ti(e.doc,"",n[t].from,n[t].to,"+delete");Jr(e)})}function to(e,t){var r=M(e.doc,t),n=de(r);return n!=r&&(t=N(n)),Le(!0,e,n,t,1)}function ro(e,t){var r=M(e.doc,t),n=fe(r);return n!=r&&(t=N(n)),Le(!0,e,r,t,-1)}function no(e,t){var r=to(e,t.line),n=M(e.doc,r.line),i=_e(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return I(r.line,a?0:o,r.sticky)}return r}function io(e,t,r){if("string"==typeof t&&!(t=_l[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ka}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function oo(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Yi(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Yi(t,e.options.extraKeys,r,e)||Yi(t,e.options.keyMap,r,e)}function ao(e,t,r,n){var i=e.state.keySeq;if(i){if(Zi(t))return"handled";Cl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=oo(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&_t(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(Ie(r),Or(e)),i&&!o&&/\'$/.test(t)?(Ie(r),!0):!!o}function lo(e,t){var r=Qi(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ao(e,"Shift-"+r,t,function(t){return io(e,t,!0)})||ao(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return io(e,t)}):ao(e,r,t,function(t){return io(e,t)}))}function so(e,t,r){return ao(e,"'"+r+"'",t,function(t){return io(e,t,!0)})}function co(e){var t=this;if(t.curOp.focus=a(),!Ne(t,e)){Zo&&Qo<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=lo(t,e);ra&&(Sl=n?r:null,!n&&88==r&&!Da&&(ca?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||uo(t)}}function uo(e){function t(e){18!=e.keyCode&&e.altKey||(ga(r,"CodeMirror-crosshair"),Oe(document,"keyup",t),Oe(document,"mouseover",t))}var r=e.display.lineDiv;l(r,"CodeMirror-crosshair"),qa(document,"keyup",t),qa(document,"mouseover",t)}function fo(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ne(this,e)}function po(e){var t=this;if(!(Dt(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||ca&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(ra&&r==Sl)return Sl=null,void Ie(e);if(!ra||e.which&&!(e.which<10)||!lo(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(so(t,e,i)||t.display.input.onKeyPress(e))}}}function ho(e){var t=this,r=t.display;if(!(Ne(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,Dt(r,e))return void(Jo||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!bo(t,e)){var n=_r(t,e);switch(window.focus(),Fe(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?mo(t,e,n):He(e)==r.scroller&&Ie(e);break;case 2:Jo&&(t.state.lastMiddleDown=+new Date),n&&ai(t.doc,n),setTimeout(function(){return r.input.focus()},20),Ie(e);break;case 3:ma?xo(t,e):Nr(t)}}}}function mo(e,t,r){Zo?setTimeout(c(zr,e),0):e.curOp.focus=a();var n,i=+new Date;kl&&kl.time>i-400&&0==W(kl.pos,r)?n="triple":wl&&wl.time>i-400&&0==W(wl.pos,r)?(n="double",kl={time:i,pos:r}):(n="single",wl={time:i,pos:r});var o,l=e.doc.sel,s=ca?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ia&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(W((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(W(o.to(),r)>0||r.xRel<0)?go(e,t,r,s):vo(e,t,r,n,s)}function go(e,t,r,n){var i=e.display,o=+new Date,a=dn(e,function(l){Jo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Oe(document,"mouseup",a),Oe(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Ie(l),!n&&+new Date-200<o&&ai(e.doc,r),Jo||Zo&&9==Qo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});Jo&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=ca?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),qa(document,"mouseup",a),qa(i.scroller,"drop",a)}function vo(e,t,r,n,i){function o(t){if(0!=W(b,t))if(b=t,"rect"==n){for(var i=[],o=e.options.tabSize,a=d(M(u,r.line).text,r.ch,o),l=d(M(u,t.line).text,t.ch,o),s=Math.min(a,l),c=Math.max(a,l),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var y=M(u,g).text,x=p(y,s,o);s==c?i.push(new ol(I(g,x),I(g,x))):y.length>x&&i.push(new ol(I(g,x),I(g,p(y,c,o))))}i.length||i.push(new ol(r,r)),fi(u,Nn(m.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var w=f,k=w.anchor,_=t;if("single"!=n){var C;C="double"==n?e.findWordAt(t):new ol(I(t.line,0),j(u,I(t.line+1,0))),W(C.anchor,k)>0?(_=C.head,k=F(w.from(),C.anchor)):(_=C.anchor,k=H(w.to(),C.head))}var S=m.ranges.slice(0);S[h]=new ol(j(u,k),_),fi(u,Nn(S,h),Ca)}}function l(t){var r=++w,i=_r(e,t,!0,"rect"==n);if(i)if(0!=W(i,b)){e.curOp.focus=a(),o(i);var s=Dr(c,u);(i.line>=s.to||i.line<s.from)&&setTimeout(dn(e,function(){w==r&&l(t)}),150)}else{var d=t.clientY<x.top?-20:t.clientY>x.bottom?20:0;d&&setTimeout(dn(e,function(){w==r&&(c.scroller.scrollTop+=d,l(t))}),50)}}function s(t){e.state.selectingText=!1,w=1/0,Ie(t),c.input.focus(),Oe(document,"mousemove",k),Oe(document,"mouseup",_),u.history.lastSelOrigin=null}var c=e.display,u=e.doc;Ie(t);var f,h,m=u.sel,g=m.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),f=h>-1?g[h]:new ol(r,r)):(f=u.sel.primary(),h=u.sel.primIndex),ua?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(f=new ol(r,r)),r=_r(e,t,!0,!0),h=-1;else if("double"==n){var v=e.findWordAt(r);f=e.display.shift||u.extend?oi(u,f,v.anchor,v.head):v}else if("triple"==n){var y=new ol(I(r.line,0),j(u,I(r.line+1,0)));f=e.display.shift||u.extend?oi(u,f,y.anchor,y.head):y}else f=oi(u,f,r);i?h==-1?(h=g.length,fi(u,Nn(g.concat([f]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"single"==n&&!t.shiftKey?(fi(u,Nn(g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):si(u,h,f,Ca):(h=0,fi(u,new il([f],0),Ca),m=u.sel);var b=r,x=c.wrapper.getBoundingClientRect(),w=0,k=dn(e,function(e){Fe(e)?l(e):s(e)}),_=dn(e,s);e.state.selectingText=_,qa(document,"mousemove",k),qa(document,"mouseup",_)}function yo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ie(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ee(e,r))return Pe(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){return ze(e,r,e,A(e.doc,o),e.options.gutters[s],t),Pe(t)}}}function bo(e,t){return yo(e,t,"gutterClick",!0)}function xo(e,t){Dt(e.display,t)||wo(e,t)||Ne(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function wo(e,t){return!!Ee(e,"gutterContextMenu")&&yo(e,t,"gutterContextMenu",!1)}function ko(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ir(e)}function _o(e){On(e),hn(e),qr(e)}function Co(e,t,r){if(!t!=!(r&&r!=Ll)){var n=e.display.dragFunctions,i=t?qa:Oe;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function So(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ga(e.display.wrapper,"CodeMirror-wrap"),xe(e)),kr(e),hn(e),ir(e),setTimeout(function(){return Vr(e)},100)}function Lo(e,t){var r=this;if(!(this instanceof Lo))return new Lo(e,t);this.options=t=t?u(t):{},u(Ml,t,!1),zn(t);var n=t.value;"string"==typeof n&&(n=new pl(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new Lo.inputStyles[t.inputStyle](this),o=this.display=new L(e,n,i);o.wrapper.CodeMirror=this,On(this),ko(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(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 ya,keySeq:null,specialChars:null},t.autofocus&&!sa&&o.input.focus(),Zo&&Qo<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Mo(this),Vi(),tn(this),this.curOp.forceUpdate=!0,Rn(this,n),t.autofocus&&!sa||this.hasFocus()?setTimeout(c(Ar,this),20):Er(this);for(var a in Tl)Tl.hasOwnProperty(a)&&Tl[a](r,t[a],Ll);Ir(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Ol.length;++l)Ol[l](r);rn(this),Jo&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Mo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;qa(i.scroller,"mousedown",dn(e,ho)),Zo&&Qo<11?qa(i.scroller,"dblclick",dn(e,function(t){if(!Ne(e,t)){var r=_r(e,t);if(r&&!bo(e,t)&&!Dt(e.display,t)){Ie(t);var n=e.findWordAt(r);ai(e.doc,n.anchor,n.head)}}})):qa(i.scroller,"dblclick",function(t){return Ne(e,t)||Ie(t)}),ma||qa(i.scroller,"contextmenu",function(t){return xo(e,t)});var o,a={end:0};qa(i.scroller,"touchstart",function(t){if(!Ne(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),qa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),qa(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Dt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new ol(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new ol(I(l.line,0),j(e.doc,I(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ie(r)}t()}),qa(i.scroller,"touchcancel",t),qa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Hr(e,i.scroller.scrollTop),Fr(e,i.scroller.scrollLeft,!0),ze(e,"scroll",e))}),qa(i.scroller,"mousewheel",function(t){return Rr(e,t)}),qa(i.scroller,"DOMMouseScroll",function(t){return Rr(e,t)}),qa(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ne(e,t)||De(t)},over:function(t){Ne(e,t)||(ji(e,t),De(t))},start:function(t){return Bi(e,t)},drop:dn(e,Fi),leave:function(t){Ne(e,t)||Ri(e)}};var l=i.input.getField();qa(l,"keyup",function(t){return fo.call(e,t)}),qa(l,"keydown",dn(e,co)),qa(l,"keypress",dn(e,po)),qa(l,"focus",function(t){return Ar(e,t)}),qa(l,"blur",function(t){return Er(e,t)})}function To(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=et(e,t):r="prev");var a=e.options.tabSize,l=M(o,t),s=d(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==ka||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?d(M(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var f="",p=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)p+=a,f+="\t";if(p<c&&(f+=h(c-p)),f!=u)return Ti(o,f,I(t,0),I(t,u.length),"+input"),l.stateAfter=null,!0;for(var g=0;g<o.sel.ranges.length;g++){var v=o.sel.ranges[g];if(v.head.line==t&&v.head.ch<u.length){var y=I(t,u.length);si(o,g,new ol(y,y));break}}}function Oo(e){zl=e}function zo(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Wa(t),s=null;if(a&&n.ranges.length>1)if(zl&&zl.text.join("\n")==t){if(n.ranges.length%zl.text.length==0){s=[];for(var c=0;c<zl.text.length;c++)s.push(o.splitLines(zl.text[c]))}}else l.length==n.ranges.length&&(s=g(l,function(e){return[e]}));for(var u,d=n.ranges.length-1;d>=0;d--){var f=n.ranges[d],p=f.from(),h=f.to();f.empty()&&(r&&r>0?p=I(p.line,p.ch-r):e.state.overwrite&&!a?h=I(h.line,Math.min(M(o,h.line).text.length,h.ch+m(l).length)):zl&&zl.lineWise&&zl.text.join("\n")==t&&(p=h=I(p.line,0))),u=e.curOp.updateInput;var v={from:p,to:h,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};ki(e.doc,v),_t(e,"inputRead",e,v)}t&&!a&&Ao(e,t),Jr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function No(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return zo(t,r,0,null,"paste")}),!0}function Ao(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=To(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=To(e,i.head.line,"smart"));a&&_t(e,"electricInput",e,i.head.line)}}}function Eo(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:I(i,0),head:I(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function qo(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Io(){var e=n("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=n("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Jo?e.style.width="1000px":e.setAttribute("wrap","off"),aa&&(e.style.border="1px solid black"),qo(e),t}function Wo(e,t,r,n,i){function o(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new I(n,t.ch,t.sticky),
|
4 |
-
c=M(e,n))}function a(n){var a;if(null==(a=i?Me(e.cm,c,t,r):Se(c,t,r))){if(n||!o())return!1;t=Le(i,e.cm,c,t.line,r)}else t=a;return!0}var l=t,s=r,c=M(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,d="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||a(!p);p=!1){var h=c.text.charAt(t.ch)||"\n",m=w(h,f)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||p||m||(m="s"),u&&u!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(u=m),r>0&&!a(!p))break}var g=yi(e,t,l,s,!0);return P(l,g)&&(g.hitSide=!0),g}function Po(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=pr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Do(e,t){var r=Xt(e,t.line);if(!r||r.hidden)return null;var n=M(e.doc,t.line),i=Kt(r,n,t.line),o=_e(n,e.doc.direction),a="left";if(o){a=ke(o,t.ch)%2?"right":"left"}var l=Qt(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ho(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fo(e,t){return t&&(e.bad=!0),e}function Bo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(){u&&(c+=d,u=!1)}function l(e){e&&(a(),c+=e)}function s(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void l(r||t.textContent.replace(/\u200b/g,""));var c,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(I(n,0),I(i+1,0),o(+f));return void(p.length&&(c=p[0].find())&&l(T(e.doc,c.from,c.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p)$/i.test(t.nodeName);h&&a();for(var m=0;m<t.childNodes.length;m++)s(t.childNodes[m]);h&&(u=!0)}else 3==t.nodeType&&l(t.nodeValue)}for(var c="",u=!1,d=e.doc.lineSeparator();s(t),t!=r;)t=t.nextSibling;return c}function jo(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Fo(e.clipPos(I(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Ro(o,t,r)}}function Ro(e,t,r){function n(t,r,n){for(var i=-1;i<(d?d.length:0);i++)for(var o=i<0?u.map:d[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var s=N(i<0?e.line:e.rest[i]),c=o[a]+n;return(n<0||l!=t)&&(c=o[a+(n?1:0)]),I(s,c)}}}var i=e.text.firstChild,a=!1;if(!t||!o(i,t))return Fo(I(N(e.line),0),!0);if(t==i&&(a=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?m(e.rest):e.line;return Fo(I(N(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=e.measure,d=u.maps,f=n(s,c,r);if(f)return Fo(f,a);for(var p=c.nextSibling,h=s?s.nodeValue.length-r:0;p;p=p.nextSibling){if(f=n(p,p.firstChild,0))return Fo(I(f.line,f.ch-h),a);h+=p.textContent.length}for(var g=c.previousSibling,v=r;g;g=g.previousSibling){if(f=n(g,g.firstChild,-1))return Fo(I(f.line,f.ch+v),a);v+=g.textContent.length}}function Uo(e,t){function r(){e.value=s.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=a();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(qa(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Oe(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Lo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}var Vo=navigator.userAgent,Ko=navigator.platform,$o=/gecko\/\d/i.test(Vo),Go=/MSIE \d/.test(Vo),Xo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vo),Yo=/Edge\/(\d+)/.exec(Vo),Zo=Go||Xo||Yo,Qo=Zo&&(Go?document.documentMode||6:+(Yo||Xo)[1]),Jo=!Yo&&/WebKit\//.test(Vo),ea=Jo&&/Qt\/\d+\.\d+/.test(Vo),ta=!Yo&&/Chrome\//.test(Vo),ra=/Opera\//.test(Vo),na=/Apple Computer/.test(navigator.vendor),ia=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Vo),oa=/PhantomJS/.test(Vo),aa=!Yo&&/AppleWebKit/.test(Vo)&&/Mobile\/\w+/.test(Vo),la=/Android/.test(Vo),sa=aa||la||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Vo),ca=aa||/Mac/.test(Ko),ua=/\bCrOS\b/.test(Vo),da=/win/i.test(Ko),fa=ra&&Vo.match(/Version\/(\d*\.\d*)/);fa&&(fa=Number(fa[1])),fa&&fa>=15&&(ra=!1,Jo=!0);var pa,ha=ca&&(ea||ra&&(null==fa||fa<12.11)),ma=$o||Zo&&Qo>=9,ga=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};pa=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var va=function(e){e.select()};aa?va=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Zo&&(va=function(e){try{e.select()}catch(e){}});var ya=function(){this.id=null};ya.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ba,xa,wa=30,ka={toString:function(){return"CodeMirror.Pass"}},_a={scroll:!1},Ca={origin:"*mouse"},Sa={origin:"+move"},La=[""],Ma=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ta=/[\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]/,Oa=!1,za=!1,Na=null,Aa=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;return function(r,n){var c="ltr"==n?"L":"R";if(0==r.length||"ltr"==n&&!i.test(r))return!1;for(var u=r.length,d=[],f=0;f<u;++f)d.push(e(r.charCodeAt(f)));for(var p=0,h=c;p<u;++p){var g=d[p];"m"==g?d[p]=h:h=g}for(var v=0,y=c;v<u;++v){var b=d[v];"1"==b&&"r"==y?d[v]="n":a.test(b)&&(y=b,"r"==b&&(d[v]="R"))}for(var x=1,w=d[0];x<u-1;++x){var k=d[x];"+"==k&&"1"==w&&"1"==d[x+1]?d[x]="1":","!=k||w!=d[x+1]||"1"!=w&&"n"!=w||(d[x]=w),w=k}for(var _=0;_<u;++_){var C=d[_];if(","==C)d[_]="N";else if("%"==C){var S=void 0;for(S=_+1;S<u&&"%"==d[S];++S);for(var L=_&&"!"==d[_-1]||S<u&&"1"==d[S]?"1":"N",M=_;M<S;++M)d[M]=L;_=S-1}}for(var T=0,O=c;T<u;++T){var z=d[T];"L"==O&&"1"==z?d[T]="L":a.test(z)&&(O=z)}for(var N=0;N<u;++N)if(o.test(d[N])){var A=void 0;for(A=N+1;A<u&&o.test(d[A]);++A);for(var E="L"==(N?d[N-1]:c),q="L"==(A<u?d[A]:c),I=E==q?E?"L":"R":c,W=N;W<A;++W)d[W]=I;N=A-1}for(var P,D=[],H=0;H<u;)if(l.test(d[H])){var F=H;for(++H;H<u&&l.test(d[H]);++H);D.push(new t(0,F,H))}else{var B=H,j=D.length;for(++H;H<u&&"L"!=d[H];++H);for(var R=B;R<H;)if(s.test(d[R])){B<R&&D.splice(j,0,new t(1,B,R));var U=R;for(++R;R<H&&s.test(d[R]);++R);D.splice(j,0,new t(2,U,R)),B=R}else++R;B<H&&D.splice(j,0,new t(1,B,H))}return 1==D[0].level&&(P=r.match(/^\s+/))&&(D[0].from=P[0].length,D.unshift(new t(0,0,P[0].length))),1==m(D).level&&(P=r.match(/\s+$/))&&(m(D).to-=P[0].length,D.push(new t(0,u-P[0].length,u))),"rtl"==n?D.reverse():D}}(),Ea=[],qa=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Ea).concat(r)}},Ia=function(){if(Zo&&Qo<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Wa=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Pa=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Da=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ha=null,Fa={},Ba={},ja={},Ra=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Ra.prototype.eol=function(){return this.pos>=this.string.length},Ra.prototype.sol=function(){return this.pos==this.lineStart},Ra.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ra.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ra.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ra.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ra.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Ra.prototype.skipToEnd=function(){this.pos=this.string.length},Ra.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ra.prototype.backUp=function(e){this.pos-=e},Ra.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=d(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},Ra.prototype.indentation=function(){return d(this.string,null,this.tabSize)-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},Ra.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return t!==!1&&(this.pos+=e.length),!0},Ra.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ra.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var Ua=function(e,t,r){this.text=e,ne(this,t),this.height=r?r(this):1};Ua.prototype.lineNo=function(){return N(this)},qe(Ua);var Va,Ka={},$a={},Ga=null,Xa=null,Ya={left:0,right:0,top:0,bottom:0},Za=0,Qa=null;Zo?Qa=-.53:$o?Qa=15:ta?Qa=-.7:na&&(Qa=-1/3);var Ja=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),qa(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),qa(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Zo&&Qo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ja.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Ja.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Ja.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Ja.prototype.zeroWidthHack=function(){var e=ca&&!ia?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ya,this.disableVert=new ya},Ja.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect();document.elementFromPoint(n.left+1,n.bottom-1)!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},Ja.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var el=function(){};el.prototype.update=function(){return{bottom:0,right:0}},el.prototype.setScrollLeft=function(){},el.prototype.setScrollTop=function(){},el.prototype.clear=function(){};var tl={native:Ja,null:el},rl=0,nl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Dr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Rt(e),this.force=r,this.dims=br(e),this.events=[]};nl.prototype.signal=function(e,t){Ee(e,t)&&this.events.push(arguments)},nl.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)ze.apply(null,e.events[t])};var il=function(e,t){this.ranges=e,this.primIndex=t};il.prototype.primary=function(){return this.ranges[this.primIndex]},il.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!P(n.anchor,i.anchor)||!P(n.head,i.head))return!1}return!0},il.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new ol(D(e.ranges[r].anchor),D(e.ranges[r].head));return new il(t,this.primIndex)},il.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},il.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(W(t,i.from())>=0&&W(e,i.to())<=0)return n}return-1};var ol=function(e,t){this.anchor=e,this.head=t};ol.prototype.from=function(){return F(this.anchor,this.head)},ol.prototype.to=function(){return H(this.anchor,this.head)},ol.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var al=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r};al.prototype.chunkSize=function(){return this.lines.length},al.prototype.removeInner=function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,ct(o),_t(o,"delete")}this.lines.splice(e,t)},al.prototype.collapse=function(e){e.push.apply(e,this.lines)},al.prototype.insertInner=function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},al.prototype.iterN=function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0};var ll=function(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null};ll.prototype.chunkSize=function(){return this.size},ll.prototype.removeInner=function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof al))){var s=[];this.collapse(s),this.children=[new al(s)],this.children[0].parent=this}},ll.prototype.collapse=function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},ll.prototype.insertInner=function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new al(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},ll.prototype.maybeSpill=function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ll(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=f(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new ll(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},ll.prototype.iterN=function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=a}};var sl=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};sl.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=N(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var a=Pt(this);z(n,Math.max(0,n.height-a)),t&&(un(t,function(){Ei(t,n,-a),mn(t,i,"widget")}),_t(t,"lineWidgetCleared",t,this,i))}},sl.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Pt(this)-t;i&&(z(n,n.height+i),r&&un(r,function(){r.curOp.forceUpdate=!0,Ei(r,n,i),_t(r,"lineWidgetChanged",r,e,N(n))}))},qe(sl);var cl=0,ul=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++cl};ul.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&tn(t),Ee(this,"clear")){var n=this.find();n&&_t(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=G(l.markedSpans,e);t&&!e.collapsed?mn(t,N(l),"text"):t&&(null!=s.to&&(o=N(l)),null!=s.from&&(i=N(l))),l.markedSpans=X(l.markedSpans,s),null==s.from&&e.collapsed&&!ge(e.doc,l)&&t&&z(l,vr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=de(e.lines[c]),d=be(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&hn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&mi(t.doc)),t&&_t(t,"markerCleared",t,this,i,o),r&&rn(t),this.parent&&this.parent.clear()}},ul.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var a=r.lines[o],l=G(a.markedSpans,r);if(null!=l.from&&(n=I(t?a:N(a),l.from),e==-1))return n;if(null!=l.to&&(i=I(t?a:N(a),l.to),1==e))return i}return n&&{from:n,to:i}},ul.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&un(n,function(){var i=t.line,o=N(t.line),a=Xt(n,o);if(a&&(rr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ge(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=Pt(r)-l;s&&z(i,i.height+s)}_t(n,"markerChanged",n,e)})},ul.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&f(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ul.prototype.detachLine=function(e){if(this.lines.splice(f(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},qe(ul);var dl=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};dl.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();_t(this,"clear")}},dl.prototype.find=function(e,t){return this.primary.find(e,t)},qe(dl);var fl=0,pl=function(e,t,r,n,i){if(!(this instanceof pl))return new pl(e,t,r,n,i);null==r&&(r=0),ll.call(this,[new al([new Ua("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var o=I(r,0);this.sel=An(o),this.history=new Kn(null),this.id=++fl,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Bn(this,{from:o,to:o,text:e}),fi(this,An(o),_a)};pl.prototype=b(ll.prototype,{constructor:pl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=O(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:pn(function(e){var t=I(this.first,0),r=this.first+this.size-1;ki(this,{from:t,to:I(r,M(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),fi(this,An(t))}),replaceRange:function(e,t,r,n){t=j(this,t),r=r?j(this,r):t,Ti(this,e,t,r,n)},getRange:function(e,t,r){var n=T(this,j(this,e),j(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(E(this,e))return M(this,e)},getLineNumber:function(e){return N(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=M(this,e)),de(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return j(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:pn(function(e,t,r){ci(this,j(this,"number"==typeof e?I(e,t||0):e),null,r)}),setSelection:pn(function(e,t,r){ci(this,j(this,e),j(this,t||e),r)}),extendSelection:pn(function(e,t,r){ai(this,j(this,e),t&&j(this,t),r)}),extendSelections:pn(function(e,t){li(this,U(this,e),t)}),extendSelectionsBy:pn(function(e,t){li(this,U(this,g(this.sel.ranges,e)),t)}),setSelections:pn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new ol(j(n,e[o].anchor),j(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),fi(this,Nn(i,t),r)}}),addSelection:pn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new ol(j(this,e),j(this,t||e))),fi(this,Nn(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=T(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=T(t,n[i].from(),n[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:pn(function(e,t,r){for(var n=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:n.splitLines(e[a]),origin:r}}for(var s=t&&"end"!=t&&Pn(this,i,t),c=i.length-1;c>=0;c--)ki(n,i[c]);s?di(this,s):this.cm&&Jr(this.cm)}),undo:pn(function(){Ci(this,"undo")}),redo:pn(function(){Ci(this,"redo")}),undoSelection:pn(function(){Ci(this,"undo",!0)}),redoSelection:pn(function(){Ci(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Kn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ii(this.history.done),undone:ii(this.history.undone)}},setHistory:function(e){var t=this.history=new Kn(this.history.maxGeneration);t.done=ii(e.done.slice(0),null,!0),t.undone=ii(e.undone.slice(0),null,!0)},setGutterMarker:pn(function(e,t,r){return Ai(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&k(n)&&(e.gutterMarkers=null),!0})}),clearGutter:pn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Ai(t,r,"gutter",function(){return r.gutterMarkers[e]=null,k(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!E(this,e))return null;if(t=e,!(e=M(this,e)))return null}else if(null==(t=N(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:pn(function(t,r,n){return Ai(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:pn(function(t,r,n){return Ai(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var a=o.match(e(n));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:pn(function(e,t,r){return qi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Ii(this,j(this,e),j(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=j(this,e),Ii(this,e,e,r,"bookmark")},findMarksAt:function(e){e=j(this,e);var t=[],r=M(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=j(this,e),t=j(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),j(this,I(r,t))},indexFromPos:function(e){e=j(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new pl(O(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,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new pl(O(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Di(n,Pi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Lo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Hi(Pi(t));break}}if(e.history==this.history){var i=[e.id];jn(e,function(e){return i.push(e.id)},!0),e.history=new Kn(null),e.history.done=ii(this.history.done,i),e.history.undone=ii(this.history.undone,i)}},iterLinkedDocs:function(e){jn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Wa(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:pn(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Vn(this.cm))})}),pl.prototype.eachLine=pl.prototype.iter;for(var hl=0,ml=!1,gl={3:"Enter",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:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",
|
5 |
-
63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},vl=0;vl<10;vl++)gl[vl+48]=gl[vl+96]=String(vl);for(var yl=65;yl<=90;yl++)gl[yl]=String.fromCharCode(yl);for(var bl=1;bl<=12;bl++)gl[bl+111]=gl[bl+63235]="F"+bl;var xl={};xl.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"},xl.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"},xl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},xl.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"]},xl.default=ca?xl.macDefault:xl.pcDefault;var wl,kl,_l={selectAll:xi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),_a)},killLine:function(e){return eo(e,function(t){if(t.empty()){var r=M(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:I(t.head.line+1,0)}:{from:t.head,to:I(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return eo(e,function(t){return{from:I(t.from().line,0),to:j(e.doc,I(t.to().line+1,0))}})},delLineLeft:function(e){return eo(e,function(e){return{from:I(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return eo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return eo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(I(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(I(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return to(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return no(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ro(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Sa)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Sa)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?no(e,t.head):n},Sa)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=d(e.getLine(o.line),o.ch,n);t.push(h(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=M(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new I(i.line,i.ch-1)),i.ch>0)i=new I(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),I(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=M(e.doc,i.line-1).text;a&&(i=new I(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),I(i.line-1,a.length-1),i,"+transpose"))}r.push(new ol(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Jr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Cl=new ya,Sl=null,Ll={toString:function(){return"CodeMirror.Init"}},Ml={},Tl={};Lo.defaults=Ml,Lo.optionHandlers=Tl;var Ol=[];Lo.defineInitHook=function(e){return Ol.push(e)};var zl=null,Nl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ya,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Nl.prototype.init=function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())Oo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Eo(i);Oo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,_a),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=zl.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var a=Io(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=zl.text.join("\n");var s=document.activeElement;va(l),setTimeout(function(){i.display.lineSpace.removeChild(a),s.focus(),s==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;qo(o,i.options.spellcheck),qa(o,"paste",function(e){Ne(i,e)||No(e,i)||Qo<=11&&setTimeout(dn(i,function(){return r.updateFromDOM()}),20)}),qa(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),qa(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),qa(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),qa(o,"touchstart",function(){return n.forceCompositionEnd()}),qa(o,"input",function(){r.composing||r.readFromDOMSoon()}),qa(o,"copy",t),qa(o,"cut",t)},Nl.prototype.prepareSelection=function(){var e=Lr(this.cm,!1);return e.focus=this.cm.state.focused,e},Nl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Nl.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=jo(this.cm,e.anchorNode,e.anchorOffset),n=jo(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=W(F(r,n),t.from())||0!=W(H(r,n),t.to())){var i=Do(this.cm,t.from()),o=Do(this.cm,t.to());if(!i&&!o)return void e.removeAllRanges();var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};var u;try{u=pa(i.node,i.offset,o.offset,o.node)}catch(e){}u&&(!$o&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||(e.removeAllRanges(),e.addRange(u))):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):$o&&this.startGracePeriod()),this.rememberSelection()}},Nl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Nl.prototype.showMultipleSelections=function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},Nl.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Nl.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},Nl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Nl.prototype.blur=function(){this.div.blur()},Nl.prototype.getField=function(){return this.div},Nl.prototype.supportsTouch=function(){return!0},Nl.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():un(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Nl.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Nl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(la&&ta&&this.cm.options.gutters.length&&Ho(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=jo(t,e.anchorNode,e.anchorOffset),n=jo(t,e.focusNode,e.focusOffset);r&&n&&un(t,function(){fi(t.doc,An(r,n),_a),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Nl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=I(n.line-1,M(e.doc,n.line-1).length)),i.ch==M(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=I(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=Cr(e,n.line))?(a=N(t.view[0].line),l=t.view[0].node):(a=N(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Cr(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=N(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(Bo(e,l,c,a,s)),f=T(e.doc,I(a,0),I(s,M(e.doc,s).text.length));d.length>1&&f.length>1;)if(m(d)==m(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var p=0,h=0,g=d[0],v=f[0],y=Math.min(g.length,v.length);p<y&&g.charCodeAt(p)==v.charCodeAt(p);)++p;for(var b=m(d),x=m(f),w=Math.min(b.length-(1==d.length?p:0),x.length-(1==f.length?p:0));h<w&&b.charCodeAt(b.length-h-1)==x.charCodeAt(x.length-h-1);)++h;if(1==d.length&&1==f.length&&a==n.line)for(;p&&p>n.ch&&b.charCodeAt(b.length-h-1)==x.charCodeAt(x.length-h-1);)p--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var k=I(a,p),_=I(s,f.length?m(f).length-h:0);return d.length>1||d[0]||W(k,_)?(Ti(e.doc,d,k,_,"+input"),!0):void 0},Nl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Nl.prototype.reset=function(){this.forceCompositionEnd()},Nl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Nl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Nl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||un(this.cm,function(){return hn(e.cm)})},Nl.prototype.setUneditable=function(e){e.contentEditable="false"},Nl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||dn(this.cm,zo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Nl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Nl.prototype.onContextMenu=function(){},Nl.prototype.resetPosition=function(){},Nl.prototype.needsContentAttribute=!0;var Al=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ya,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Al.prototype.init=function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())Oo({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=zl.text.join("\n"),va(a));else{if(!i.options.lineWiseCopyCut)return;var t=Eo(i);Oo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,_a):(n.prevInput="",a.value=t.text.join("\n"),va(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Io(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),aa&&(a.style.width="0px"),qa(a,"input",function(){Zo&&Qo>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),qa(a,"paste",function(e){Ne(i,e)||No(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),qa(a,"cut",t),qa(a,"copy",t),qa(e.scroller,"paste",function(t){Dt(e,t)||Ne(i,t)||(i.state.pasteIncoming=!0,n.focus())}),qa(e.lineSpace,"selectstart",function(t){Dt(e,t)||Ie(t)}),qa(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),qa(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Al.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Lr(e);if(e.options.moveInputWithCursor){var i=ur(e,r.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},Al.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Al.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Da&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&va(this.textarea),Zo&&Qo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",Zo&&Qo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Al.prototype.getField=function(){return this.textarea},Al.prototype.supportsTouch=function(){return!1},Al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!sa||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},Al.prototype.blur=function(){this.textarea.blur()},Al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Al.prototype.receivedFocus=function(){this.slowPoll()},Al.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Al.prototype.fastPoll=function(){function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Al.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pa(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(Zo&&Qo>=9&&this.hasSelection===i||ca&&/[\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 a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return un(t,function(){zo(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Al.prototype.onKeyPress=function(){Zo&&Qo>=9&&(this.hasSelection=null),this.fastPoll()},Al.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t=""+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=u,a.style.cssText=c,Zo&&Qo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!Zo||Zo&&Qo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&""==n.prevInput?dn(i,xi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=_r(i,e),s=o.scroller.scrollTop;if(l&&!ra){i.options.resetSelectionOnContextMenu&&i.doc.sel.contains(l)==-1&&dn(i,fi)(i.doc,An(l),_a);var c=a.style.cssText,u=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var d=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(Zo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(Jo&&(f=window.scrollY),o.input.focus(),Jo&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Zo&&Qo>=9&&t(),ma){De(e);var p=function(){Oe(window,"mouseup",p),setTimeout(r,20)};qa(window,"mouseup",p)}else setTimeout(r,50)}},Al.prototype.readOnlyChanged=function(e){e||this.reset()},Al.prototype.setUneditable=function(){},Al.prototype.needsContentAttribute=!1,function(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Ll&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Ll,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Dn(e)},!0),t("indentUnit",2,Dn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Hn(e),ir(e),hn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(I(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ti(e.doc,t,r[i],I(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ll&&e.refresh()}),t("specialCharPlaceholder",ft,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",sa?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!da),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){ko(e),_o(e)},!0),t("keyMap","default",function(e,t,r){var n=Ji(t),i=r!=Ll&&Ji(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,So,!0),t("gutters",[],function(e){zn(e.options),_o(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?xr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Vr(e)},!0),t("scrollbarStyle","native",function(e){$r(e),Vr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){zn(e.options),_o(e)},!0),t("firstLineNumber",1,_o,!0),t("lineNumberFormatter",function(e){return e},_o,!0),t("showCursorWhenSelecting",!1,Sr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Er(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Co),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Sr,!0),t("singleCursorHeightPerLine",!0,Sr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Hn,!0),t("addModeClass",!1,Hn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Hn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Lo),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&dn(this,t[e])(this,r,i),ze(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ji(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:fn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,hn(this)}),removeOverlay:fn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void hn(t)}}),indentLine:fn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),E(this.doc,e)&&To(this,e,t,r)}),indentSelection:fn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(To(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Jr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)To(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&u[i].from().ch>0&&si(t.doc,i,new ol(a,u[i].to()),_a)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,I(e),t,!0)},getTokenTypeAt:function(e){e=j(this.doc,e);var t,r=Je(this,M(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,n)&&f(i,u.val)==-1&&i.push(u.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=B(r,null==e?r.first+r.size-1:e),et(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?j(this.doc,e):e?n.from():n.to(),ur(this,r,t||"page")},charCoords:function(e,t){return cr(this,j(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sr(this,e,t||"page"),pr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sr(this,{top:e,left:0},t||"page").top,A(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=M(this.doc,e)}else n=e;return lr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ye(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return yr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ur(this,j(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Yr(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:fn(co),triggerOnKeyPress:fn(po),triggerOnKeyUp:fo,execCommand:function(e){if(_l.hasOwnProperty(e))return _l[e].call(null,this)},triggerElectric:fn(function(e){Ao(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=j(this.doc,e),l=0;l<t&&(a=Wo(i.doc,a,o,r,n),!a.hitSide);++l);return a},moveH:fn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Wo(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Sa)}),deleteH:fn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):eo(this,function(r){var i=Wo(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,a=n;t<0&&(o=-1,t=-t);for(var l=j(this.doc,e),s=0;s<t;++s){var c=ur(i,l,"div");if(null==a?a=c.left:c.left=a,l=Po(i,c,o,r),l.hitSide)break}return l},moveV:fn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=ur(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Po(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Qr(r,null,cr(r,s,"div").top-l.top),s},Sa),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=M(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=r.length||!n?++i:--n;for(var a=r.charAt(n),l=w(a,o)?function(e){return w(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!w(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new ol(I(e.line,n),I(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?l(this.display.cursorDiv,"CodeMirror-overwrite"):ga(this.display.cursorDiv,"CodeMirror-overwrite"),ze(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==a()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:fn(function(e,t){null==e&&null==t||en(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-jt(this)-this.display.barHeight,width:e.scrollWidth-jt(this)-this.display.barWidth,clientHeight:Ut(this),clientWidth:Rt(this)}},scrollIntoView:fn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:I(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)en(this),this.curOp.scrollToPos=e;else{var r=Zr(this,{left:Math.min(e.from.left,e.to.left),top:Math.min(e.from.top,e.to.top)-e.margin,right:Math.max(e.from.right,e.to.right),bottom:Math.max(e.from.bottom,e.to.bottom)+e.margin});this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:fn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&nr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,ze(this,"refresh",this)}),operation:function(e){return un(this,e)},refresh:fn(function(){var e=this.display.cachedTextHeight;hn(this),this.curOp.forceUpdate=!0,ir(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),Mn(this),(null==e||Math.abs(e-vr(this.display))>.5)&&kr(this),ze(this,"refresh",this)}),
|
6 |
-
swapDoc:fn(function(e){var t=this.doc;return t.cm=null,Rn(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,_t(this,"swapDoc",this,t),t}),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}},qe(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Lo);var El="iter insert remove copy getEditor constructor".split(" ");for(var ql in pl.prototype)pl.prototype.hasOwnProperty(ql)&&f(El,ql)<0&&(Lo.prototype[ql]=function(e){return function(){return e.apply(this.doc,arguments)}}(pl.prototype[ql]));return qe(pl),Lo.inputStyles={textarea:Al,contenteditable:Nl},Lo.defineMode=function(e){Lo.defaults.mode||"null"==e||(Lo.defaults.mode=e),Ue.apply(this,arguments)},Lo.defineMIME=Ve,Lo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Lo.defineMIME("text/plain","null"),Lo.defineExtension=function(e,t){Lo.prototype[e]=t},Lo.defineDocExtension=function(e,t){pl.prototype[e]=t},Lo.fromTextArea=Uo,function(e){e.off=Oe,e.on=qa,e.wheelEventPixels=jr,e.Doc=pl,e.splitLines=Wa,e.countColumn=d,e.findColumn=p,e.isWordChar=x,e.Pass=ka,e.signal=ze,e.Line=Ua,e.changeEnd=En,e.scrollbarModel=tl,e.Pos=I,e.cmpPos=W,e.modes=Fa,e.mimeModes=Ba,e.resolveMode=Ke,e.getMode=$e,e.modeExtensions=ja,e.extendMode=Ge,e.copyState=Xe,e.startState=Ze,e.innerMode=Ye,e.commands=_l,e.keyMap=xl,e.keyName=Qi,e.isModifierKey=Zi,e.lookupKey=Yi,e.normalizeKeyMap=Xi,e.StringStream=Ra,e.SharedTextMarker=dl,e.TextMarker=ul,e.LineWidget=sl,e.e_preventDefault=Ie,e.e_stopPropagation=We,e.e_stop=De,e.addClass=l,e.contains=o,e.rmClass=ga,e.keyNames=gl}(Lo),Lo.version="5.25.0",Lo}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";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},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(_.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!_.contextGrabbers.hasOwnProperty(r)||!_.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,r){return"word"==e?(r.tagName=t.current(),M="tag",y):(M="error",h)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&_.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||_.matchClosing===!1?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,r){return"endTag"!=e?(M="error",g):(d(r),p)}function v(e,t,r){return M="error",g(e,t,r)}function y(e,t,r){if("word"==e)return M="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||_.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),p}return M="error",y}function b(e,t,r){return"equals"==e?x:(_.allowMissing||(M="error"),y(e,t,r))}function x(e,t,r){return"string"==e?w:"word"==e&&_.allowUnquoted?(M="string",y):(M="error",y(e,t,r))}function w(e,t,r){return"string"==e?w:y(e,t,r)}var k=n.indentUnit,_={},C=i.htmlMode?t:r;for(var S in C)_[S]=C[S];for(var S in i)_[S]=i[S];var L,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(M=null,t.state=t.state(L||r,e,t),M&&(r="error"==M?r+" error":M)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return _.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(_.multilineTagIndentFactor||1);if(_.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!_.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=_.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:_.htmlMode?"html":"xml",helperType:_.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Se=e,Le=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(qe),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(qe.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(qe),o("operator","operator",e.current());if(Ae.test(n)){e.eatWhile(Ae);var a=e.current(),u=Ee.propertyIsEnumerable(a)&&Ee[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Oe&&"@"==t.peek()&&t.match(Ie))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ne){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=We.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ae.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,i){var o=e.cc;for(De.state=e,De.stream=i,De.marked=null,De.cc=o,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():ze?_:k)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return De.marked?De.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function m(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=De.state;if(De.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=He}function y(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function b(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?m():";"==e?h():m(t)}return t}function k(e,t){return"var"==e?m(b("vardef",t.length),Q,w(";"),x):"keyword a"==e?m(b("form"),S,k,x):"keyword b"==e?m(b("form"),k,x):"{"==e?m(b("}"),V,x):";"==e?m():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==x&&De.state.cc.pop()(),m(b("form"),S,k,x,ne)):"function"==e?m(ce):"for"==e?m(b("form"),ie,k,x):"variable"==e?m(b("stat"),D):"switch"==e?m(b("form"),S,b("}","switch"),w("{"),V,x,x):"case"==e?m(_,w(":")):"default"==e?m(w(":")):"catch"==e?m(b("form"),v,w("("),ue,w(")"),k,x,y):"class"==e?m(b("form"),fe,x):"export"==e?m(b("stat"),ge,x):"import"==e?m(b("stat"),ye,x):"module"==e?m(b("form"),J,b("}"),w("{"),V,x,x):"type"==e?m($,w("operator"),$,w(";")):"async"==e?m(k):h(b("stat"),_,w(";"),x)}function _(e){return L(e,!1)}function C(e){return L(e,!0)}function S(e){return"("!=e?h():m(b(")"),_,w(")"),x)}function L(e,t){if(De.state.fatArrowAt==De.stream.start){var r=t?q:E;if("("==e)return m(v,b(")"),R(J,")"),x,w("=>"),r,y);if("variable"==e)return h(v,J,w("=>"),r,y)}var n=t?z:O;return Pe.hasOwnProperty(e)?m(n):"function"==e?m(ce,n):"class"==e?m(b("form"),de,x):"keyword c"==e||"async"==e?m(t?T:M):"("==e?m(b(")"),M,w(")"),x,n):"operator"==e||"spread"==e?m(t?C:_):"["==e?m(b("]"),_e,x,n):"{"==e?U(F,"}",null,n):"quasi"==e?h(N,n):"new"==e?m(I(t)):m()}function M(e){return e.match(/[;\}\)\],]/)?h():h(_)}function T(e){return e.match(/[;\}\)\],]/)?h():h(C)}function O(e,t){return","==e?m(_):z(e,t,!1)}function z(e,t,r){var n=0==r?O:z,i=0==r?_:C;return"=>"==e?m(v,r?q:E,y):"operator"==e?/\+\+|--/.test(t)?m(n):"?"==t?m(_,w(":"),i):m(i):"quasi"==e?h(N,n):";"!=e?"("==e?U(C,")","call",n):"."==e?m(H,n):"["==e?m(b("]"),M,w("]"),x,n):void 0:void 0}function N(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(N):m(_,A)}function A(e){if("}"==e)return De.marked="string-2",De.state.tokenize=c,m(N)}function E(e){return u(De.stream,De.state),h("{"==e?k:_)}function q(e){return u(De.stream,De.state),h("{"==e?k:C)}function I(e){return function(t){return"."==t?m(e?P:W):h(e?C:_)}}function W(e,t){if("target"==t)return De.marked="keyword",m(O)}function P(e,t){if("target"==t)return De.marked="keyword",m(z)}function D(e){return":"==e?m(x,k):h(O,w(";"),x)}function H(e){if("variable"==e)return De.marked="property",m()}function F(e,t){return"async"==e?(De.marked="property",m(F)):"variable"==e||"keyword"==De.style?(De.marked="property",m("get"==t||"set"==t?B:j)):"number"==e||"string"==e?(De.marked=Oe?"property":De.style+" property",m(j)):"jsonld-keyword"==e?m(j):"modifier"==e?m(F):"["==e?m(_,w("]"),j):"spread"==e?m(_):":"==e?h(j):void 0}function B(e){return"variable"!=e?h(j):(De.marked="property",m(ce))}function j(e){return":"==e?m(C):"("==e?h(ce):void 0}function R(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=De.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(r,n){return r==t||n==t?h():h(e)},n)}return i==t||o==t?m():m(w(t))}return function(r,i){return r==t||i==t?m():h(e,n)}}function U(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return m(b(t,r),R(e,t),x)}function V(e){return"}"==e?m():h(k,V)}function K(e,t){if(Ne){if(":"==e)return m($);if("?"==t)return m(K)}}function $(e){return"variable"==e?(De.marked="variable-3",m(Z)):"string"==e||"number"==e||"atom"==e?m(Z):"{"==e?m(b("}"),R(X,"}",",;"),x):"("==e?m(R(Y,")"),G):void 0}function G(e){if("=>"==e)return m($)}function X(e,t){return"variable"==e||"keyword"==De.style?(De.marked="property",m(X)):"?"==t?m(X):":"==e?m($):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m($):void 0}function Z(e,t){return"<"==t?m(b(">"),R($,">"),x,Z):"|"==t||"."==e?m($):"["==e?m(w("]"),Z):void 0}function Q(){return h(J,K,te,re)}function J(e,t){return"modifier"==e?m(J):"variable"==e?(g(t),m()):"spread"==e?m(J):"["==e?U(J,"]"):"{"==e?U(ee,"}"):void 0}function ee(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?m(J):"}"==e?h():m(w(":"),J,te)):(g(t),m(te))}function te(e,t){if("="==t)return m(C)}function re(e){if(","==e)return m(Q)}function ne(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),k,x)}function ie(e){if("("==e)return m(b(")"),oe,w(")"),x)}function oe(e){return"var"==e?m(Q,w(";"),le):";"==e?m(le):"variable"==e?m(ae):h(_,w(";"),le)}function ae(e,t){return"in"==t||"of"==t?(De.marked="keyword",m(_)):m(O,le)}function le(e,t){return";"==e?m(se):"in"==t||"of"==t?(De.marked="keyword",m(_)):h(_,w(";"),se)}function se(e){")"!=e&&m(_)}function ce(e,t){return"*"==t?(De.marked="keyword",m(ce)):"variable"==e?(g(t),m(ce)):"("==e?m(v,b(")"),R(ue,")"),x,K,k,y):void 0}function ue(e){return"spread"==e?m(ue):h(J,K,te)}function de(e,t){return"variable"==e?fe(e,t):pe(e,t)}function fe(e,t){if("variable"==e)return g(t),m(pe)}function pe(e,t){return"<"==t?m(b(">"),R($,">"),x,pe):"extends"==t||"implements"==t||Ne&&","==e?m(Ne?$:_,pe):"{"==e?m(b("}"),he,x):void 0}function he(e,t){return"variable"==e||"keyword"==De.style?("async"==t||"static"==t||"get"==t||"set"==t||Ne&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",m(he)):(De.marked="property",m(Ne?me:ce,he)):"["==e?m(_,w("]"),Ne?me:ce,he):"*"==t?(De.marked="keyword",m(he)):";"==e?m(he):"}"==e?m():void 0}function me(e,t){return"?"==t?m(me):":"==e?m($,te):"="==t?m(C):h(ce)}function ge(e,t){return"*"==t?(De.marked="keyword",m(ke,w(";"))):"default"==t?(De.marked="keyword",m(_,w(";"))):"{"==e?m(R(ve,"}"),ke,w(";")):h(k)}function ve(e,t){return"as"==t?(De.marked="keyword",m(w("variable"))):"variable"==e?h(C,ve):void 0}function ye(e){return"string"==e?m():h(be,xe,ke)}function be(e,t){return"{"==e?U(be,"}"):("variable"==e&&g(t),"*"==t&&(De.marked="keyword"),m(we))}function xe(e){if(","==e)return m(be,xe)}function we(e,t){if("as"==t)return De.marked="keyword",m(be)}function ke(e,t){if("from"==t)return De.marked="keyword",m(_)}function _e(e){return"]"==e?m():h(R(C,"]"))}function Ce(e,t){return"operator"==e.lastType||","==e.lastType||qe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Se,Le,Me=r.indentUnit,Te=n.statementIndent,Oe=n.jsonld,ze=n.json||Oe,Ne=n.typescript,Ae=n.wordCharacters||/[\w$\xa1-\uffff]/,Ee=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(Ne){var l={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),qe=/[+\-*&%=<>!?|~^]/,Ie=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,We="([{}])",Pe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},He={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Me,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Se?r:(t.lastType="operator"!=Se||"++"!=Le&&"--"!=Le?Se:"incdec",p(t,r,Se,Le,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==x)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==O||i==z)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Te&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Me:"stat"==d?l.indented+(Ce(t,r)?Te||Me:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Me):l.indented+(/^(?:case|default)\b/.test(r)?Me:2*Me)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ze?null:"/*",blockCommentEnd:ze?null:"*/",lineComment:ze?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ze?"json":"javascript",jsonldMode:Oe,jsonMode:ze,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=_&&t!=C||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return h=t,e}function i(e,t){var r=e.next();if(v[r]){var i=v[r](e,t);if(i!==!1)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return N[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();m=M.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var p=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},x=r.mediaFeatures||{},w=r.mediaValueKeywords||{},k=r.propertyKeywords||{},_=r.nonStandardPropertyKeywords||{},C=r.fontProperties||{},S=r.counterDescriptors||{},L=r.colorKeywords||{},M=r.valueKeywords||{},T=r.allowNested,O=r.lineComment,z=r.supportsAtComponent===!0,N={};return N.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(z&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return s(r,t,"parens")}return r.context.type},N.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(m="property","maybeprop"):_.hasOwnProperty(n)?(m="string-2","maybeprop"):T?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(m="error","block")},N.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},N.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&T)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else m+=" error";return"prop"},N.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(m="property","maybeprop"):r.context.type},N.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},N.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):u(e,t,r)},N.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):N.atBlock(e,t,r)},N.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,T?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":x.hasOwnProperty(n)?"property":w.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":_.hasOwnProperty(n)?"string-2":M.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},N.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,T?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},N.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):N.atBlock(e,t,r)},N.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,r)},N.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(m="@font-face"==r.stateArg&&!C.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},N.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},N.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},N.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:p?"block":"top",stateArg:null,context:new l(p?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(h=r[1],r=r[0]),m=r,t.state=N[t.state](h,e,t),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:O,fold:"brace"}})
|
7 |
-
;var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["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"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","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","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","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","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","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-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","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-weight","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","justify-content","left","letter-spacing","line-break","line-height","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","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","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","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","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","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-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","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","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","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(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(p),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["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","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","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","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","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","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],x=t(b),w=["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","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","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","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","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","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","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","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","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","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","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","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","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","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","semi-condensed","semi-expanded","separate","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","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","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","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","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"],k=t(w),_=n.concat(o).concat(l).concat(c).concat(d).concat(p).concat(b).concat(w);e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:x,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:x,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:x,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:x,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}var l={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"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,o){var l,d=c.token(n,o.htmlState),f=/\btag\b/.test(d);if(f&&!/[<>\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var p=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==n.current()&&a(u[p[1]],p[2]),m=e.getMode(r,h),g=i(p[1],!0),v=i(p[1],!1);o.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var p=f.length-1;p>=0;p--)u.script.unshift(["type",f[p].matches,f[p].mode]);return{startState:function(){return{token:s,inTag:null,localMode:null,localState:null,htmlState:e.startState(c)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.info=n,this.align=i,this.prev=o}function r(e,r,n,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=n&&(o=e.context.indented),e.context=new t(o,r,n,i,null,e.context)}function n(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,r){return"variable"==t.prevToken||"variable-3"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,r))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function l(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}function s(e,t){if(!t.startOfLine)return!1;for(var r,n=null;r=e.peek();){if("\\"==r&&e.match(/^.$/)){n=s;break}if("/"==r&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=n,"meta"}function c(e,t){return"variable-3"==t.prevToken&&"variable-3"}function u(e){return e.eatWhile(/[\w\.']/),"number"}function d(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var r=e.match(/"([^\s\\()]{0,16})\(/);return!!r&&(t.cpp11RawStringDelim=r[1],t.tokenize=h,h(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function f(e){var t=/(\w+)::(\w+)$/.exec(e);return t&&t[1]==t[2]}function p(e,t){for(var r;null!=(r=e.next());)if('"'==r&&!e.eat('"')){t.tokenize=null;break}return"string"}function h(e,t){var r=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+r+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function m(t,r){function n(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];n(r.keywords),n(r.types),n(r.builtin),n(r.atoms),i.length&&(r.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],r)}function g(e,t){for(var r=!1;!e.eol();){if(!r&&e.match('"""')){t.tokenize=null;break}r="\\"==e.next()&&!r}return"string"}function v(e){return function(t,r){for(var n,i=!1,o=!1;!t.eol();){if(!e&&!i&&t.match('"')){o=!0;break}if(e&&t.match('"""')){o=!0;break}n=t.next(),!i&&"$"==n&&t.match("{")&&t.skipTo("}"),i=!i&&"\\"==n&&!e}return!o&&e||(r.tokenize=null),"string"}}function y(e){return function(t,r){for(var n,i=!1,o=!1;!t.eol();){if(!i&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!i&&t.match("``")){w=y(e),o=!0;break}n=t.next(),i="single"==e&&!i&&"\\"==n}return o&&(r.tokenize=null),"string"}}e.defineMode("clike",function(a,s){function c(e,t){var r=e.next();if(C[r]){var n=C[r](e,t);if(n!==!1)return n}if('"'==r||"'"==r)return t.tokenize=u(r),t.tokenize(e,t);if(O.test(r))return p=r,null;if(z.test(r)){if(e.backUp(1),e.match(N))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=d,d(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(A.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(A););return"operator"}if(e.eatWhile(/[\w\$_\xa1-\uffff]/),T)for(;e.match(T);)e.eatWhile(/[\w\$_\xa1-\uffff]/);var i=e.current();return l(y,i)?(l(w,i)&&(p="newstatement"),l(k,i)&&(h=!0),"keyword"):l(b,i)?"variable-3":l(x,i)?(l(w,i)&&(p="newstatement"),"builtin"):l(_,i)?"atom":"variable"}function u(e){return function(t,r){for(var n,i=!1,o=!1;null!=(n=t.next());){if(n==e&&!i){o=!0;break}i=!i&&"\\"==n}return(o||!i&&!S)&&(r.tokenize=null),"string"}}function d(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function f(e,t){s.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}var p,h,m=a.indentUnit,g=s.statementIndentUnit||m,v=s.dontAlignCalls,y=s.keywords||{},b=s.types||{},x=s.builtin||{},w=s.blockKeywords||{},k=s.defKeywords||{},_=s.atoms||{},C=s.hooks||{},S=s.multiLineStrings,L=s.indentStatements!==!1,M=s.indentSwitch!==!1,T=s.namespaceSeparator,O=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,z=s.numberStart||/[\d\.]/,N=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,A=s.isOperatorChar||/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new t((e||0)-m,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return f(e,t),null;p=h=null;var l=(t.tokenize||c)(e,t);if("comment"==l||"meta"==l)return l;if(null==a.align&&(a.align=!0),";"==p||":"==p||","==p&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)n(t);else if("{"==p)r(t,e.column(),"}");else if("["==p)r(t,e.column(),"]");else if("("==p)r(t,e.column(),")");else if("}"==p){for(;"statement"==a.type;)a=n(t);for("}"==a.type&&(a=n(t));"statement"==a.type;)a=n(t)}else p==a.type?n(t):L&&(("}"==a.type||"top"==a.type)&&";"!=p||"statement"==a.type&&"newstatement"==p)&&r(t,e.column(),"statement",e.current());if("variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),C.token){var u=C.token(e,t,l);void 0!==u&&(l=u)}return"def"==l&&s.styleDefs===!1&&(l="variable"),t.startOfLine=!1,t.prevToken=h?"def":l||p,f(e,t),l},indent:function(t,r){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var n=t.context,i=r&&r.charAt(0);if("statement"==n.type&&"}"==i&&(n=n.prev),s.dontIndentStatements)for(;"statement"==n.type&&s.dontIndentStatements.test(n.info);)n=n.prev;if(C.indent){var o=C.indent(t,n,r);if("number"==typeof o)return o}var a=i==n.type,l=n.prev&&"switch"==n.prev.info;if(s.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=n.type&&"}"!=n.type;)n=n.prev;return n.indented}return"statement"==n.type?n.indented+("{"==i?0:g):!n.align||v&&")"==n.type?")"!=n.type||a?n.indented+(a?0:m)+(a||!l||/^(?:case|default)\b/.test(r)?0:m):n.indented+g:n.column+(a?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",x="int long char short double float unsigned signed void size_t ptrdiff_t";m(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),types:a(x+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:a("case do else for if switch while struct"),defKeywords:a("struct"),typeFirstDefinitions:!0,atoms:a("null true false"),hooks:{"#":s,"*":c},modeProps:{fold:["brace","include"]}}),m(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:a(x+" bool wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),defKeywords:a("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:a("true false null"),dontIndentStatements:/^template$/,hooks:{"#":s,"*":c,u:d,U:d,L:d,R:d,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,r){if("variable"==r&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&f(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),m("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface package enum @interface"),typeFirstDefinitions:!0,atoms:a("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),m("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),m("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class do else finally for forSome if match switch try while"),defKeywords:a("class def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,r){var n=r.context
|
8 |
-
;return!("}"!=n.type||!n.align||!e.eat(">"))&&(r.context=new t(n.indented,n.column,n.type,n.info,null,n.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),m("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object package interface fun"),atoms:a("true false null this"),hooks:{'"':function(e,t){return t.tokenize=v(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),m(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":s},modeProps:{fold:["brace","include"]}}),m("text/x-nesc",{name:"clike",keywords:a(b+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:a(x),blockKeywords:a("case do else for if switch while struct"),atoms:a("null true false"),hooks:{"#":s},modeProps:{fold:["brace","include"]}}),m("text/x-objectivec",{name:"clike",keywords:a(b+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:a(x),atoms:a("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":s,indent:function(e,t,r){if("statement"==t.type&&/^@\w/.test(r))return t.indented}},modeProps:{fold:"brace"}}),m("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:a(x),blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":s},modeProps:{fold:["brace","include"]}});var w=null;m("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=y(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!w||!e.match("`"))&&(t.tokenize=w,w=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,r){if(("variable"==r||"variable-3"==r)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function r(e,t,i){return 0==e.length?n(t):function(o,a){for(var l=e[0],s=0;s<l.length;s++)if(o.match(l[s][0]))return a.tokenize=r(e.slice(1),t),l[s][1];return a.tokenize=n(t,i),"string"}}function n(e,t){return function(r,n){return i(r,n,e,t)}}function i(e,t,n,i){if(i!==!1&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(i!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=r([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],n,i)),e.match(/\-\>\w/,!1)&&(t.tokenize=r([[["->",null]],[[/[\w]+/,"variable"]]],n,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(n)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var r;if(r=e.match(/<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(r[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=n(o,"'"!=i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=n('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=n(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,r){function n(t,r){var n=r.curMode==o;if(t.sol()&&r.pending&&'"'!=r.pending&&"'"!=r.pending&&(r.pending=null),n)return n&&null==r.php.tokenize&&t.match("?>")?(r.curMode=i,r.curState=r.html,r.php.context.prev||(r.php=null),"meta"):o.token(t,r.curState);if(t.match(/^<\?\w*/))return r.curMode=o,r.php||(r.php=e.startState(o,i.indent(r.html,""))),r.curState=r.php,"meta";if('"'==r.pending||"'"==r.pending){for(;!t.eol()&&t.next()!=r.pending;);var a="string"}else if(r.pending&&t.pos<r.pending.end){t.pos=r.pending.end;var a=r.pending.style}else var a=i.token(t,r.curState);r.pending&&(r.pending=null);var l,s=t.current(),c=s.search(/<\?/);return c!=-1&&("string"==a&&(l=s.match(/[\'\"]$/))&&!/\?>/.test(s)?r.pending=l[0]:r.pending={end:t.pos,style:a},t.backUp(s.length-c)),a}var i=e.getMode(t,"text/html"),o=e.getMode(t,s);return{startState:function(){var t=e.startState(i),n=r.startOpen?e.startState(o):null;return{html:t,php:n,curMode:r.startOpen?o:i,curState:r.startOpen?n:t,pending:null}},copyState:function(t){var r,n=t.html,a=e.copyState(i,n),l=t.php,s=l&&e.copyState(o,l);return r=t.curMode==i?a:s,{html:a,php:s,curMode:t.curMode,curState:r,pending:t.pending}},token:n,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={allowUnquoted:!0,allowMissing:!0,caseFold:!0};e.defineMode("shortcode",function(e,r){function n(e,t){return"["===e.next()?"["===e.peek()?(t.tokenize=i,"comment"):/\s/.test(e.peek())?null:(_=e.eat("/")?"closeTag":"openTag",t.tokenize=o,"tag bracket"):(e.eatWhile(/[^\[]/),null)}function i(e,t){var r=function(e,t){return e.next(),t.tokenize=n,"comment"};return r.isInEscape=!0,"]"===e.next()&&"]"===e.peek()&&(t.tokenize=r),e.eatWhile(/[^\]]/),null}function o(e,t){var r=e.next();if("]"===r||"/"===r&&e.eat("]"))return t.tokenize=n,_="endTag","tag bracket";if("="===r)return _="equals",null;if("["===r){t.tokenize=n,t.state=c,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=a(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=\[\]\"\']*[^\s\u00a0=\[\]\"\'\/]/),"word")}function a(e){var t=function(t,r){var n=t.next();return n===e?(r.tokenize=o,"string"):/[\[\]]/.test(n)?"string error":(t.eatWhile(/[^\[\]\'\"]/),"string")};return t.isInAttribute=!0,t}function l(e,t,r){this.tagHistory=[t],e.context&&(this.tagHistory=this.tagHistory.concat(e.context.tagHistory)),this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r}function s(e){e.context&&(e.context=e.context.prev)}function c(e,t,r){return"openTag"===e?(r.tagStart=t.column(),u):"closeTag"===e?d:c}function u(e,t,r){if("word"===e){var n=t.current();return/[\[\]\/\'\"<>&]/.test(n)?C="error":(r.tagName=t.current(),C="tag"),h}return C="error",u}function d(e,t,r){if("word"===e){var n=t.current();if(r.context&&r.context.tagName===n||b.matchClosing===!1)return C="tag",f;if(r.context&&r.context.tagHistory.indexOf(n)>0){for(var i=r.context.tagHistory.indexOf(n),o=0;o<i;o++)s(r);return C="tag",f}return C="tag error",p}return C="error",p}function f(e,t,r){return"endTag"!==e?(C="error",f):(s(r),c)}function p(e,t,r){return C="error",f(e,t,r)}function h(e,t,r){if("word"===e)return C=/^[a-z0-9_\-]+$/i.test(t.current())?"attribute":"error",m;if("endTag"===e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,r.context=new l(r,n,i===r.indented),c}return C="error",h}function m(e,t,r){return"equals"===e?g:(b.allowMissing||(C="error"),h(e,t,r))}function g(e,t,r){return"string"===e?v:"word"===e&&b.allowUnquoted?(C="string",h):(C="error",h(e,t,r))}function v(e,t,r){return"string"===e?v:h(e,t,r)}var y=e.indentUnit,b={},x=t;for(var w in x)b[w]=x[w];for(var k in r)b[k]=r[k];var _,C;return n.isInText=!0,i.isInEscape=!0,{startState:function(e){var t={tokenize:n,state:c,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;_=null;var r=t.tokenize(e,t);return(r||_)&&"comment"!==r&&(C=null,t.state=t.state(_||r,e,t),C&&(r="error"===C?r+" error":C)),r},indent:function(e,t,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart===e.indented?e.stringStartCol+1:e.indented+y;if(e.tokenize!==o&&e.tokenize!==n)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return b.multilineTagIndentPastTag!==!1?e.tagStart+e.tagName.length+2:e.tagStart+y*(b.multilineTagIndentFactor||1);var a=t&&/^\[(\/)?([\w_:\.-]*)/.exec(t);if(a&&a[1])for(;i;){if(i.tagName===a[2]){i=i.prev;break}break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+y:e.baseIndent||0},skipAttribute:function(e){e.state===g&&(e.state=h)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("wordpresspost",function(t,r){function n(e,t){t.isInShortcode=!0;var r=l.token(e,t.shortcodeState),n=t.shortcodeState.tokenize.isInText,o=t.shortcodeState.tokenize.isInEscape;if(n)t.token=i;else if(o&&/\]/.test(e.current())){var a=e.current(),s=a.search(/\]/);e.backUp(a.length-s-1),"]"!==e.peek()&&(t.token=i)}return r}function i(e,t){t.isInShortcode=!1;var r=a.token(e,t.htmlmixedState),i=t.htmlmixedState.htmlState.tokenize.isInText;if(i&&/\[/.test(e.current())&&!t.htmlmixedState.localState&&null===r){var s=e.current(),c=s.search(/\[/);e.backUp(s.length-c),null==t.shortcodeState&&(t.shortcodeState=l.startState(a.indent(t.htmlmixedState,""))),t.token=n}else i&&/<!\-\-more|<!\-\-(noteaser|nextpage)\-\->?/.test(e.current())&&!t.htmlmixedState.localState&&"comment"===r&&(e.backUp(e.current().length),t.token=o);return r}function o(e,t){return e.match("<!--more")?"meta":e.match("-->")||e.match("<!--noteaser-->")||e.match("<!--nextpage-->")?(t.token=i,"meta"):(e.eatWhile(/[^\-\/]/),"string")}var a=e.getMode(t,{name:"htmlmixed",multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),l=e.getMode(t,{name:"shortcode",multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag});return{startState:function(){return{token:i,isInShortcode:!1,shortcodeState:null,htmlmixedState:a.startState()}},copyState:function(t){var r;return t.shortcodeState&&(r=e.copyState(l,t.shortcodeState)),{token:t.token,shortcodeState:r,htmlmixedState:e.copyState(a,t.htmlmixedState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return t.isInShortcode?t.isInShortcode?l.indent(t.shortcodeState,r):e.Pass:a.indent(t.htmlmixedState,r)},innerMode:function(e){return e.isInShortcode?{state:e.shortcodeState,mode:l}:{state:e.htmlmixedState,mode:a}}}},"htmlmixed","shortcode")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a),e.removeLineClass(e.state.activeLines[t],"gutter",l)}function r(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function n(e,n){for(var i=[],s=0;s<n.length;s++){var c=n[s],u=e.getOption("styleActiveLine");if("object"==typeof u&&u.nonEmpty?c.anchor.line==c.head.line:c.empty()){var d=e.getLineHandleVisualStart(c.head.line);i[i.length-1]!=d&&i.push(d)}}r(e.state.activeLines,i)||e.operation(function(){t(e);for(var r=0;r<i.length;r++)e.addLineClass(i[r],"wrap",o),e.addLineClass(i[r],"background",a),e.addLineClass(i[r],"gutter",l);e.state.activeLines=i})}function i(e,t){n(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background",l="CodeMirror-activeline-gutter";e.defineOption("styleActiveLine",!1,function(r,o,a){var l=a!=e.Init&&a;o!=l&&(l&&(r.off("beforeSelectionChange",i),t(r),delete r.state.activeLines),o&&(r.state.activeLines=[],n(r,r.listSelections()),r.on("beforeSelectionChange",i)))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):n(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(r,i){if(r){t.lastIndex=0;for(var o,a,l=e.getLine(i.line).slice(0,i.ch),s=0;;){t.lastIndex=s;var c=t.exec(l);if(!c)break;if(o=c,a=o.index,(s=o.index+(o[0].length||1))==l.length)break}var u=o&&o[0].length||0;u||(0==a&&0==l.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var l=e.getLine(i.line),o=t.exec(l),u=o&&o[0].length||0,a=o&&o.index;a+u==l.length||u||(u=1)}if(o&&u)return{from:n(i.line,a),to:n(i.line,a+u),match:o}};else{var a=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)t.length?this.matches=function(i,o){if(i){var s=e.getLine(o.line).slice(0,o.ch),c=l(s),u=c.lastIndexOf(t);if(u>-1)return u=r(s,c,u),{from:n(o.line,u),to:n(o.line,u+a.length)}}else{var s=e.getLine(o.line).slice(o.ch),c=l(s),u=c.indexOf(t);if(u>-1)return u=r(s,c,u)+o.ch,{from:n(o.line,u),to:n(o.line,u+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,r){var i=s.length-1;if(t){if(r.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(r.line).slice(0,c[i].length))!=s[s.length-1])return;for(var o=n(r.line,c[i].length),a=r.line-1,u=i-1;u>=1;--u,--a)if(s[u]!=l(e.getLine(a)))return;var d=e.getLine(a),f=d.length-c[0].length;if(l(d.slice(f))!=s[0])return;return{from:n(a,f),to:o}}if(!(r.line+(s.length-1)>e.lastLine())){var d=e.getLine(r.line),f=d.length-c[0].length;if(l(d.slice(f))==s[0]){for(var p=n(r.line,f),a=r.line+1,u=1;u<i;++u,++a)if(s[u]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,c[i].length))==s[i])return{from:p,to:n(a,c[i].length)}}}}}}}function r(e,t,r){if(e.length==t.length)return r;for(var n=Math.min(r,e.length);;){var i=e.slice(0,n).toLowerCase().length;if(i<r)++n;else{if(!(i>r))return n;--n}}}var n=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=n(e,0);return r.pos={from:t,to:t},r.atOccurrence=!1,!1}for(var r=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=n(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=n(i.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,r,n){return new t(this.doc,e,r,n)}),e.defineDocExtension("getSearchCursor",function(e,r,n){return new t(this,e,r,n)}),e.defineExtension("selectMatches",function(t,r){for(var n=[],i=this.getSearchCursor(t,this.getCursor("from"),r);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)n.push({anchor:i.from(),head:i.to()});n.length&&this.setSelections(n,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var r=e.exec(t.string);if(r&&r.index==t.pos)return t.pos+=r[0].length||1,"searching";r?t.pos=r.index:t.skipToEnd()}}}function r(){
|
9 |
-
this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new r)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,r){return e.getSearchCursor(t,r,i(t))}function a(e,t,r,n,i){e.openDialog(t,n,{value:r,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i})}function l(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0}):i(prompt(r,n))}function s(e,t,r,n){e.openConfirm?e.openConfirm(t,n):confirm(r)&&n[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function u(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch(e){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function d(e,r,n){r.queryText=n,r.query=u(n),e.removeOverlay(r.overlay,i(r.query)),r.overlay=t(r.query,i(r.query)),e.addOverlay(r.overlay),e.showMatchesOnScrollbar&&(r.annotate&&(r.annotate.clear(),r.annotate=null),r.annotate=e.showMatchesOnScrollbar(r.query,i(r.query)))}function f(t,r,i,o){var s=n(t);if(s.query)return p(t,r);var c=t.getSelection()||s.lastQuery;if(i&&t.openDialog){var u=null,f=function(r,n){e.e_stop(n),r&&(r!=s.queryText&&(d(t,s,r),s.posFrom=s.posTo=t.getCursor()),u&&(u.style.opacity=1),p(t,n.shiftKey,function(e,r){var n;r.line<3&&document.querySelector&&(n=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&n.getBoundingClientRect().bottom-4>t.cursorCoords(r,"window").top&&((u=n).style.opacity=.4)}))};a(t,v,c,f,function(r,i){var o=e.keyName(r),a=e.keyMap[t.getOption("keyMap")][o];a||(a=t.getOption("extraKeys")[o]),"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(e.e_stop(r),d(t,n(t),i),t.execCommand(a)):"find"!=a&&"findPersistent"!=a||(e.e_stop(r),f(i,r))}),o&&c&&(d(t,s,c),p(t,r))}else l(t,v,"Search for:",c,function(e){e&&!s.query&&t.operation(function(){d(t,s,e),s.posFrom=s.posTo=t.getCursor(),p(t,r)})})}function p(t,r,i){t.operation(function(){var a=n(t),l=o(t,a.query,r?a.posFrom:a.posTo);(l.find(r)||(l=o(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),l.find(r)))&&(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),a.posFrom=l.from(),a.posTo=l.to(),i&&i(l.from(),l.to()))})}function h(e){e.operation(function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function m(e,t,r){e.operation(function(){for(var n=o(e,t);n.findNext();)if("string"!=typeof t){var i=e.getRange(n.from(),n.to()).match(t);n.replace(r.replace(/\$(\d)/g,function(e,t){return i[t]}))}else n.replace(r)})}function g(e,t){if(!e.getOption("readOnly")){var r=e.getSelection()||n(e).lastQuery,i=t?"Replace all:":"Replace:";l(e,i+y,i,r,function(r){r&&(r=u(r),l(e,b,"Replace with:","",function(n){if(n=c(n),t)m(e,r,n);else{h(e);var i=o(e,r,e.getCursor("from")),a=function(){var t,c=i.from();!(t=i.findNext())&&(i=o(e,r),!(t=i.findNext())||c&&i.from().line==c.line&&i.from().ch==c.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),s(e,x,"Replace?",[function(){l(t)},a,function(){m(e,r,n)}]))},l=function(e){i.replace("string"==typeof r?n:n.replace(/\$(\d)/g,function(t,r){return e[r]})),a()};a()}}))})}}var v='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',y=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',b='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',x="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";e.commands.find=function(e){h(e),f(e)},e.commands.findPersistent=function(e){h(e),f(e,!1,!0)},e.commands.findPersistentNext=function(e){f(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){f(e,!0,!0,!0)},e.commands.findNext=f,e.commands.findPrev=function(e){f(e,!0)},e.commands.clearSearch=h,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}}),function(e,t,r,n,i){"use strict";function o(){te.theme=i.theme,te.lineNumbers=!!i.lineNumbers,te.tabSize=te.indentUnit=+i.tabSize,te.lineWrapping=!!i.lineWrapping,te.autofocus=e.getElementById("title")&&!!e.getElementById("title").value&&e.getElementById("title").value.length>0}function a(e){var r=!1;return function(){var n=this,i=arguments;r||(e.apply(n,i),r=!0,t.requestAnimationFrame(function(){t.requestAnimationFrame(function(){r=!1})}))}}function l(){for(var e=0;e<V.children.length;e++){var t=V.children[e];t.style.position="",t.style.top="",t.style.left="",t.style.right="",t.style.width=""}}function s(){for(var t=$.getBoundingClientRect(),r=0;r<V.children.length;r++){var n=V.children[r];n.style.position="fixed",n.style.top=t.bottom+"px",n.style.right=e.documentElement.getBoundingClientRect().width-t.right+"px",n.id.match(/toggle/gi)||(n.style.left=t.left+"px",n.style.width="auto")}}function c(){for(var e=$.getBoundingClientRect(),t=R.getWrapperElement().getBoundingClientRect(),r=0;r<V.children.length;r++){var n=V.children[r];n.style.position="absolute",n.style.top=(t.top-e.bottom)*-1+"px",n.style.left="",n.style.right="",n.style.width=""}}function u(e){d();var t=ee.settingsPosition();if(t!==ee.previousSettingsPosition||e&&"resize"===e.type)switch(L(),t){case"top":l();break;case"middle":s();break;case"bottom":c();break;case"normal":case"none":}}function d(){if(K){var r=K.getBoundingClientRect().top,n=e.getElementById("post-status-info").getBoundingClientRect().top,i=n-r,o=t.innerHeight-r;K.style.maxHeight=Math.min(i,o)-6+"px",ne&&(K.style.height=K.style.maxHeight)}}function f(){K.style.maxHeight="",ne&&(K.style.height="")}function p(){J&&(J.addEventListener("change",h),h())}function h(){ee.isFullHeight()?(R.setOption("viewportMargin",1/0),R.on("change",L),t.addEventListener("scroll",re),t.addEventListener("resize",re),t.addEventListener("resize",ae),R.getWrapperElement().style.height="auto",u(),T(),t.setTimeout(function(){d(),L()},100)):(R.setOption("viewportMargin",te.viewportMargin),R.off("change",L),t.removeEventListener("scroll",re),t.removeEventListener("resize",re),t.removeEventListener("resize",ae),R.getWrapperElement().style.marginTop="",f(),l(),M())}function m(){R.getWrapperElement().appendChild(V),V.style.display="block",V.querySelector(".CodeMirror-settings__toggle").addEventListener("click",g),V.querySelector(".CodeMirror-settings__toggle-advanced").addEventListener("click",g);for(var e=V.querySelectorAll(".CodeMirror-settings__option"),t=0;t<e.length;t++){e[t].addEventListener("change",_)}V.querySelector("#theme").addEventListener("change",y),V.querySelector("#tabSize").addEventListener("change",y),V.querySelector("#lineWrapping").addEventListener("change",y),V.querySelector("#lineNumbers").addEventListener("change",y),V.querySelector("#fontSize").addEventListener("change",w),V.querySelector("#lineHeight").addEventListener("change",k)}function g(e){v(e.target.id.match(/advanced/gi)?V.classList.contains("open-advanced")?"open":"advanced":V.classList.contains("open")?"closed":"open")}function v(e){switch(e){case"open":V.classList.add("open"),V.classList.remove("open-advanced"),V.classList.remove("closed");break;case"advanced":V.classList.add("open"),V.classList.add("open-advanced"),V.classList.remove("closed");break;default:V.classList.remove("open"),V.classList.remove("open-advanced"),V.classList.add("closed")}}function y(e){var t=+e.target.value;t=isNaN(t)?e.target.value:t,null!=e.target.checked&&(t=e.target.checked),i[e.target.id]=t,R.setOption(e.target.id,t),"tabSize"===e.target.id&&R.setOption("indentUnit",t)}function b(){ee.charWidth=R.defaultCharWidth()*(i.fontSize/13)}function x(e,t){U.style.fontSize=e+"px",i.fontSize=e,U.style.lineHeight=t+"em",i.lineHeight=t,b(),R.refresh()}function w(e){var t=e.target.value;i.fontSize=t,U.style.fontSize=t+"px",b(),R.refresh()}function k(e){var t=e.target.value;i.lineHeight=t,U.style.lineHeight=t+"em",R.refresh()}function _(){var e=n("#CodeMirror-settings__form").serializeArray();n.post(i.ajaxUrl,e,function(){})}function C(){$.insertAdjacentHTML("afterbegin",'<button type="button" id="cm_content_fullscreen" class="ed_button qt-dfw" title="Full Screen"></button>'),e.getElementById("cm_content_fullscreen").onclick=S}function S(e){e=e===!0,ee.isFullHeight()?ie.classList.remove(oe):(ie.classList.contains(oe)||e?ie.classList.remove(oe):ie.classList.add(oe),R.focus())}function L(){R.save(),R.getTextArea().style.height=R.getWrapperElement().getBoundingClientRect().height+"px"}function M(){R.getWrapperElement().style.height=R.getTextArea().style.height}function T(){R.getWrapperElement().style.marginTop=$.offsetHeight+"px"}function O(){e.getElementById("content-resize-handle").addEventListener("mousedown",function(){e.addEventListener("mousemove",M)}),e.addEventListener("mouseup",function(){e.removeEventListener("mousemove",M)})}function z(){function t(e){l=r+(e.pageY-o),R.getWrapperElement().style.height=Math.max(n,l)+"px"}var r=500,n=200;R.getWrapperElement().style.height=r+"px";var i=e.createElement("div");i.className="hesh-content-resize-handle",i.id="content-resize-handle",R.getWrapperElement().appendChild(i);var o,a=!1,l=r;e.getElementById("content-resize-handle").addEventListener("mousedown",function(r){o=r.pageY,a=!0,e.addEventListener("mousemove",t),r.preventDefault()}),e.addEventListener("mouseup",function(){a=!1,r=Math.max(n,l),e.removeEventListener("mousemove",t),R.refresh()})}function N(){var t=e.querySelector(".fileedit-sub .alignleft"),r=t.textContent.match(/\.[a-z\d]{2,}/gi),n=r[r.length-1].match(/[a-z]*/gi)[1],i={php:"php",css:"css",xml:"xml",html:"htmlmixed",js:"javascript",json:"javascript"};te.mode=i[n]}function A(t){var r="; "+e.cookie,n=r.split("; "+t+"=");if(2===n.length)return n.pop().split(";").shift()}function E(){var e=(A("hesh_plugin_selection_state")||"0,0,0,0,0,0,0").split(",");Q===e[0]&&(R.doc.setSelection({line:+e[1],ch:+e[2]},{line:+e[3],ch:+e[4]},{scroll:!1}),R.scrollTo(+e[5],+e[6]))}function q(){var t=R.doc.listSelections()[0],r=R.getScrollInfo();e.cookie="hesh_plugin_selection_state="+Q+","+t.anchor.line+","+t.anchor.ch+","+t.head.line+","+t.head.ch+","+r.left+","+r.top}function I(){var t=".CodeMirror pre > * { text-indent: 0px; }",n=e.head||e.getElementsByTagName("head")[0],i=e.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=t:i.appendChild(e.createTextNode(t)),n.appendChild(i);R.on("renderLine",function(e,t,n){var i=r.countColumn(t.text,null,e.getOption("tabSize"))*ee.charWidth;n.style.textIndent="-"+i+"px",n.style.paddingLeft=4+i+"px"}),R.refresh()}function W(){var e,t,r,n=R.doc.listSelections()[0];e=t=r=0,R.doc.eachLine(function(i){r<=n.head.line-1&&(e+=i.text.length+1),r<=n.anchor.line-1&&(t+=i.text.length+1),r++}),e+=n.head.ch,t+=n.anchor.ch,R.getTextArea().setSelectionRange(Math.min(t,e),Math.max(t,e)),R.getTextArea().focus(),P()}function P(){var e=R.getTextArea().value.length,r=t.setInterval(function(){e!==R.getTextArea().value.length&&(t.clearInterval(r),D())},10),n=function(){t.clearInterval(r),R.off("focus",n)};R.on("focus",n)}function D(){var e=R.getTextArea().selectionStart,r=R.getTextArea().selectionEnd,n=R.getScrollInfo(),i={top:t.pageYOffset,left:t.pageXOffset};R.doc.setValue(R.getTextArea().value),R.focus();for(var o=0,a=0,l=0,s=e,c=r,u=R.getLineHandle(l).text.length+1;u<=s&&u<=c;)l++,u<=s&&(s-=u,o=l),u<=c&&(c-=u,a=l),u=R.getLineHandle(l).text.length+1;R.doc.setSelection({line:o,ch:s},{line:a,ch:c},{scroll:!1}),t.scrollTo(i.left,i.top),R.scrollTo(n.left,n.top),R.save()}function H(){var e=t.send_to_editor,r=function(r){ee.isActive()&&"content"===t.wpActiveEditor?(R.replaceSelection(r),R.save()):e(r)};t.send_to_editor=r}function F(){ee.isActive()||(o(),ee.isThemeOrPlugin&&N(),R=r.fromTextArea(G,te),U=R.getWrapperElement().querySelector(".CodeMirror-code"),G.classList.add("CodeMirror-mirrored"),R.on("change",function(){R.save()}),E(),R.on("cursorActivity",le),R.on("scroll",le),ee.isThemeOrPlugin?(z(),Z=e.getElementById("submit")):($.addEventListener("mousedown",W),H(),O(),p(),C()),m(),x(+i.fontSize,+i.lineHeight),I())}function B(){ee.isActive()&&(v("closed"),R.toTextArea())}function j(){ee.isThemeOrPlugin?F():ee.isVisualEnabled?(X.addEventListener("click",function(){t.setTimeout(F,0)}),Y.addEventListener("click",B),ee.isVisualActive()||F()):(F(),e.body.className+=" visual-editor-is-disabled")}var R,U,V=e.getElementById("CodeMirror-settings"),K=e.getElementById("CodeMirror-settings__form"),$=e.getElementById("ed_toolbar"),G=e.getElementById("content")||e.getElementById("newcontent"),X=e.getElementById("content-html"),Y=e.getElementById("content-tmce"),Z=e.getElementById("save-post")||e.getElementById("publish"),Q=null!=e.getElementById("post_ID")?e.getElementById("post_ID").value:0,J=e.getElementById("editor-expand-toggle"),ee={isVisualEnabled:null!=e.getElementById("content-tmce"),isThemeOrPlugin:null!=e.getElementById("newcontent"),isActive:function(){return null!=e.getElementsByClassName("CodeMirror")[0]},isVisualActive:function(){return null!=e.getElementsByClassName("tmce-active")[0]},isFullHeight:function(){return!!J&&J.checked},previousSettingsPosition:"none",settingsPosition:function(){var e,r=this;return e=$?"absolute"===$.style.position?"0px"===$.style.top?"top":"bottom":"fixed"===$.style.position?"middle":"normal":"none",t.setTimeout(function(){r.previousSettingsPosition=e},0),e},charWidth:0},te={mode:"wordpresspost",tabMode:"indent",matchBrackets:!0,indentWithTabs:!0,enterMode:"keep",styleActiveLine:!0,electricChars:!1,viewportMargin:10,extraKeys:{F11:function(){S()},Esc:function(){S(!0)},"Ctrl-S":function(){Z.click()},"Cmd-S":function(){Z.click()}}},re=a(u),ne=!!navigator.userAgent.match(/Trident/gi),ie=e.getElementById("wp-content-editor-container"),oe="heshFullscreen",ae=a(T),le=a(q);"complete"!==e.readyState?t.addEventListener?t.addEventListener("load",j,!1):t.attachEvent&&t.attachEvent("onload",j):j()}(document,window,window.CodeMirror,window.jQuery,window.heshOptions);
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),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 i(e,t,r,i){var o=n(e,t,r,i);return o.setAttribute("role","presentation"),o}function o(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function a(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function l(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function s(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function u(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function f(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/))==-1&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function d(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function h(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Ma.length<=e;)Ma.push(m(Ma)+" ");return Ma[e]}function m(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function v(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function y(){}function b(e,t){var r;return Object.create?r=Object.create(e):(y.prototype=e,r=new y),t&&u(t,r),r}function x(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||La.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&x(e))||t.test(e):x(e)}function k(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function C(e){return e.charCodeAt(0)>=768&&Ta.test(e)}function S(e,t,r){for(;(r<0?t>0:t<e.length)&&C(e.charAt(t));)t+=r;return t}function _(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function M(e,t,r){var o=this;this.input=r,o.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=n("div",null,"CodeMirror-cursors"),o.measure=n("div",null,"CodeMirror-measure"),o.lineMeasure=n("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=n("div",[a],null,"position: relative"),o.sizer=n("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=n("div",null,null,"position: absolute; height: "+wa+"px; width: 1px;"),o.gutters=n("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=n("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=n("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),Qo&&Jo<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Zo||$o&&sa||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(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,r.init(o)}function L(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function T(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function A(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function O(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function E(e){if(null==e.parent)return null;for(var t=e.parent,r=d(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function I(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function N(e,t){return t>=e.first&&t<e.first+e.size}function P(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function R(e,t,r){if(void 0===r&&(r=null),!(this instanceof R))return new R(e,t,r);this.line=e,this.ch=t,this.sticky=r}function B(e,t){return e.line-t.line||e.ch-t.ch}function z(e,t){return e.sticky==t.sticky&&0==B(e,t)}function D(e){return R(e.line,e.ch)}function W(e,t){return B(e,t)<0?t:e}function q(e,t){return B(e,t)<0?e:t}function F(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function H(e,t){if(t.line<e.first)return R(e.first,0);var r=e.first+e.size-1;return t.line>r?R(r,L(e,r).text.length):j(t,L(e,t.line).text.length)}function j(e,t){var r=e.ch;return null==r||r>t?R(e.line,t):r<0?R(e.line,0):e}function K(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=H(e,t[n]);return r}function U(){Aa=!0}function V(){Oa=!0}function $(e,t,r){this.marker=e,this.from=t,this.to=r}function G(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function X(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Y(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Q(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new $(a,o.from,s?null:o.to))}}return n}function J(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new $(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Z(e,t){if(t.full)return null;var r=N(e,t.from.line)&&L(e,t.from.line).markedSpans,n=N(e,t.to.line)&&L(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==B(t.from,t.to),l=Q(r,i,a),s=J(n,o,a),c=1==t.text.length,u=m(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null==d.to){var h=G(s,d.marker);h?c&&(d.to=null==h.to?null:h.to+u):d.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p];if(null!=g.to&&(g.to+=u),null==g.from){var v=G(l,g.marker);v||(g.from=u,c&&(l||(l=[])).push(g))}else g.from+=u,c&&(l||(l=[])).push(g)}l&&(l=ee(l)),s&&s!=l&&(s=ee(s));var y=[l];if(!c){var b,x=t.text.length-2;if(x>0&&l)for(var w=0;w<l.length;++w)null==l[w].to&&(b||(b=[])).push(new $(l[w].marker,null,null));for(var k=0;k<x;++k)y.push(b);y.push(s)}return y}function ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function te(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&d(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(B(c.to,l.from)<0||B(c.from,l.to)>0)){var u=[s,1],f=B(c.from,l.from),h=B(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function re(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function ne(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function ae(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=B(n.from,i.from)||ie(e)-ie(t);if(o)return-o;var a=B(n.to,i.to)||oe(e)-oe(t);return a?a:t.id-e.id}function le(e,t){var r,n=Oa&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||ae(r,i.marker)<0)&&(r=i.marker);return r}function se(e){return le(e,!0)}function ce(e){return le(e,!1)}function ue(e,t,r,n,i){var o=L(e,t),a=Oa&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=B(c.from,r)||ie(s.marker)-ie(i),f=B(c.to,n)||oe(s.marker)-oe(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?B(c.to,r)>=0:B(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?B(c.from,n)<=0:B(c.from,n)<0)))return!0}}}function fe(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function de(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function he(e){for(var t,r;t=ce(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=L(e,t),n=fe(r);return r==n?t:E(n)}function me(e,t){if(t>e.lastLine())return t;var r,n=L(e,t);if(!ge(e,n))return t;for(;r=ce(n);)n=r.find(1,!0).line;return E(n)+1}function ge(e,t){var r=Oa&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ve(e,t,n))return!0}}function ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ve(e,n.line,G(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ve(e,t,i))return!0}function ye(e){e=fe(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function be(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=se(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ce(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function xe(e){var t=e.display,r=e.doc;t.maxLine=L(r,r.first),t.maxLineLength=be(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=be(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ke(e,t,r){var n;Ea=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Ea=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Ea=i)}return null!=n?n:Ea}function Ce(e,t){var r=e.order;return null==r&&(r=e.order=Ia(e.text,t)),r}function Se(e,t,r){var n=S(e.text,t+r,r);return n<0||n>e.text.length?null:n}function _e(e,t,r){var n=Se(e,t.ch,r);return null==n?null:new R(t.line,n,r<0?"after":"before")}function Me(e,t,r,n,i){if(e){var o=Ce(r,t.doc.direction);if(o){var a,l=i<0?m(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Yt(t,r);a=i<0?r.text.length-1:0;var f=Qt(t,u,a).top;a=_(function(e){return Qt(t,u,e).top==f},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Se(r,a,1,!0))}else a=i<0?l.to:l.from;return new R(n,a,c)}}return new R(n,i<0?r.text.length:0,i<0?"before":"after")}function Le(e,t,r,n){var i=Ce(t,e.doc.direction);if(!i)return _e(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=ke(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return _e(t,r,n);var l,s=function(e,r){return Se(t,e instanceof R?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||Yt(e,t),mr(e,t,l,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==n<0,d=s(r,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var h=f?"before":"after";return new R(r.line,d,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new R(r.line,s(e,1),"before"):new R(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},m=p(o+n,n,u);if(m)return m;var g=n>0?u.end:s(u.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,c(g)))?null:m}function Te(e,t){return e._handlers&&e._handlers[t]||Na}function Ae(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=d(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Oe(e,t){var r=Te(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ee(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,r||t.type,e,t),ze(t)||t.codemirrorIgnore}function Ie(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)d(r,t[n])==-1&&r.push(t[n])}function Ne(e,t){return Te(e,t).length>0}function Pe(e){e.prototype.on=function(e,t){Pa(this,e,t)},e.prototype.off=function(e,t){Ae(this,e,t)}}function Re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Be(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ze(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function De(e){Re(e),Be(e)}function We(e){return e.target||e.srcElement}function qe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ca&&e.ctrlKey&&1==t&&(t=3),t}function Fe(e){if(null==ba){var t=n("span","");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ba=t.offsetWidth<=1&&t.offsetHeight>2&&!(Qo&&Jo<8))}var i=ba?n("span",""):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function He(e){if(null!=xa)return xa;var n=r(e,document.createTextNode("AخA")),i=ha(n,0,1).getBoundingClientRect(),o=ha(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(xa=o.right-i.right<3)}function je(e){if(null!=Wa)return Wa;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=ha(t,0,1).getBoundingClientRect();return Wa=Math.abs(i.left-o.left)>1}function Ke(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),qa[e]=t}function Ue(e,t){Fa[e]=t}function Ve(e){if("string"==typeof e&&Fa.hasOwnProperty(e))e=Fa[e];else if(e&&"string"==typeof e.name&&Fa.hasOwnProperty(e.name)){var t=Fa[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=Ve(t);var r=qa[t.name];if(!r)return $e(e,"text/plain");var n=r(e,t);if(Ha.hasOwnProperty(t.name)){var i=Ha[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}function Ge(e,t){u(t,Ha.hasOwnProperty(e)?Ha[e]:Ha[e]={})}function Xe(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ye(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Qe(e,t,r){return!e.startState||e.startState(t,r)}function Je(e,t,r,n){var i=[e.state.modeGen],o={};at(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=0;a<e.state.overlays.length;++a)!function(r){var n=e.state.overlays[r],a=1,l=0;at(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)}(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ze(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=et(e,E(t)),i=Je(e,t,t.text.length>e.options.maxHighlightLength?Xe(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function et(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=lt(e,t,r),a=o>n.first&&L(n,o-1).stateAfter;return a=a?Xe(n.mode,a):Qe(n.mode),n.iter(o,t,function(r){tt(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?Xe(n.mode,a):null,++o}),r&&(n.frontier=o),a}function tt(e,t,r,n){var i=e.doc.mode,o=new ja(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&rt(i,r);!o.eol();)nt(i,o,r),o.start=o.pos}function rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ye(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function nt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ye(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,r,n){var i,o=function(e){return{start:f.start,end:f.pos,string:f.current(),type:i||null,state:e?Xe(a.mode,u):u}},a=e.doc,l=a.mode;t=H(a,t);var s,c=L(a,t.line),u=et(e,t.line,r),f=new ja(c.text,e.options.tabSize);for(n&&(s=[]);(n||f.pos<t.ch)&&!f.eol();)f.start=f.pos,i=nt(l,f,u),n&&s.push(o(!0));return n?s:o()}function ot(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function at(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new ja(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&ot(rt(r,n),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&tt(e,t,n,f.pos),f.pos=t.length,s=null):s=ot(nt(r,f,n,d),o),d){var h=d[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e3),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}function lt(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=L(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=f(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function st(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),re(e),ne(e,r);var i=n?n(e):1;i!=e.height&&O(e,i)}function ct(e){e.parent=null,re(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$a:Va;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ft(e,t){var r=i("span",null,null,Zo?"padding-right: .1px":null),n={pre:i("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Qo||Zo)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,l=void 0;n.pos=0,n.addToken=ht,He(e.display.measure)&&(l=Ce(a,e.doc.direction))&&(n.addToken=mt(n.addToken,l)),n.map=[];vt(a,n,Ze(e,a,t!=e.display.externalMeasured&&E(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=s(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=s(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Fe(e.display.measure))),0==o?(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(Zo){var c=n.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=s(n.pre.className,n.textClass||"")),n}function dt(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ht(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,f=!1;if(u.test(t)){s=document.createDocumentFragment();for(var d=0;;){u.lastIndex=d;var h=u.exec(t),m=h?h.index-d:t.length-d;if(m){var g=document.createTextNode(c.slice(d,d+m));Qo&&Jo<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;d+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",p(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=s.appendChild(n("span","\r"==h[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),Qo&&Jo<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),Qo&&Jo<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||f||l){var x=r||"";i&&(x+=i),o&&(x+=o);var w=n("span",[s],x,l);return a&&(w.title=a),e.content.appendChild(w)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function mt(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var f=void 0,d=0;d<t.length&&(f=t[d],!(f.to>c&&f.from<=c));d++);if(f.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,f.to-c),i,o,null,l,s),o=null,n=n.slice(f.to-c),c=f.to}}}function gt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,f,d,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=f=l="",d=null,v=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var w=n[x],k=w.marker;"bookmark"==k.type&&w.from==p&&k.widgetNode?y.push(k):w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&!f&&(f=k.title),k.collapsed&&(!d||ae(d.marker,k)<0)&&(d=w)):w.from>p&&v>w.from&&(v=w.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!d||d.from==p)for(var S=0;S<y.length;++S)gt(t,0,y[S]);if(d&&(d.from||0)==p){if(gt(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(p>=h)break;for(var _=Math.min(h,v);;){if(g){var M=p+g.length;if(!d){var L=M>_?g.slice(0,_-p):g;t.addToken(t,L,a?a+s:s,u,p+L.length==v?c:"",f,l)}if(M>=_){g=g.slice(_-p),p=_;break}p=M,u=""}g=i.slice(o,o=r[m++]),a=ut(r[m++],t.cm.options)}}else for(var T=1;T<r.length;T+=2)t.addToken(t,i.slice(o,o=r[T]),ut(r[T+1],t.cm.options))}function yt(e,t,r){this.line=t,this.rest=he(t),this.size=this.rest?E(m(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ge(e,t)}function bt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new yt(e.doc,L(e.doc,o),o);n=o+a.size,i.push(a)}return i}function xt(e){Ga?Ga.ops.push(e):e.ownsGroup=Ga={ops:[e],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function kt(e,t){var r=e.ownsGroup;if(r)try{wt(r)}finally{Ga=null,t(r)}}function Ct(e,t){var r=Te(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Ga?n=Ga.delayedCallbacks:Xa?n=Xa:(n=Xa=[],setTimeout(St,0));for(var o=0;o<r.length;++o)!function(e){n.push(function(){return r[e].apply(null,i)})}(o)}}function St(){var e=Xa;Xa=null;for(var t=0;t<e.length;++t)e[t]()}function _t(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?At(e,t):"gutter"==o?Et(e,t,r,n):"class"==o?Ot(e,t):"widget"==o&&It(e,t,n)}t.changes=null}function Mt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Qo&&Jo<8&&(e.node.style.zIndex=2)),e.node}function Lt(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=Mt(t);t.background=i.insertBefore(n("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function Tt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ft(e,t)}function At(e,t){var r=t.text.className,n=Tt(e,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,Ot(e,t)):r&&(t.text.className=r)}function Ot(e,t){Lt(e,t),t.line.wrapClass?Mt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Et(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Mt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Mt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",P(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var u=e.options.gutters[c],f=a.hasOwnProperty(u)&&a[u];f&&s.appendChild(n("div",[f],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function It(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);Pt(e,t,r)}function Nt(e,t,r,n){var i=Tt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ot(e,t),Et(e,t,r,n),Pt(e,t,n),t.node}function Pt(e,t,r){if(Rt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Rt(e,t.rest[n],t,r,!1)}function Rt(e,t,r,i,o){if(t.widgets)for(var a=Mt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Bt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),Ct(c,"redraw")}}function Bt(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function zt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Dt(e,t){for(var r=We(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Wt(e){return e.lineSpace.offsetTop}function qt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ft(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Ht(e){return wa-e.display.nativeBarWidth}function jt(e){return e.display.scroller.clientWidth-Ht(e)-e.display.barWidth}function Kt(e){return e.display.scroller.clientHeight-Ht(e)-e.display.barHeight}function Ut(e,t,r){var n=e.options.lineWrapping,i=n&&jt(e);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(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Vt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(E(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function $t(e,t){t=fe(t);var n=E(t),i=e.display.externalMeasured=new yt(e.doc,t,n);i.lineN=n;var o=i.built=ft(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Gt(e,t,r,n){return Qt(e,Yt(e,t),r,n)}function Xt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Yt(e,t){var r=E(t),n=Xt(e,r);n&&!n.text?n=null:n&&n.changes&&(_t(e,n,r,br(e)),e.curOp.forceUpdate=!0),n||(n=$t(e,t));var i=Vt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,
|
2 |
+
before:i.before,hasHeights:!1}}function Qt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ut(e,t.view,t.rect),t.hasHeights=!0),o=er(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Jt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[2+(c+=3)],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Zt(e,t){var r=Ya;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function er(e,t,r,n){var i,o=Jt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&C(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&C(t.line.text.charAt(o.coverStart+s));)++s;if(i=Qo&&Jo<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Zt(ha(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}Qo&&Jo<11&&(i=tr(e.display.measure,i))}else{l>0&&(c=n="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==n?f.length-1:0]:a.getBoundingClientRect()}if(Qo&&Jo<9&&!l&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+yr(e.display),top:d.top,bottom:d.bottom}:Ya}for(var h=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(h+p)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,b=g[v],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=h,x.rbottom=p),x}function tr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!je(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function rr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function nr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)rr(e.display.view[r])}function ir(e){nr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function or(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ar(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lr(e,t,r,n,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=zt(t.widgets[o]);r.top+=a,r.bottom+=a}if("line"==n)return r;n||(n="local");var l=ye(t);if("local"==n?l+=Wt(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:ar());var c=s.left+("window"==n?0:or());r.left+=c,r.right+=c}return r.top+=l,r.bottom+=l,r}function sr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=or(),i-=ar();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function cr(e,t,r,n,i){return n||(n=L(e.doc,t.line)),lr(e,n,Gt(e,n,t.ch,i),r)}function ur(e,t,r,n,i,o){function a(t,a){var l=Qt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,lr(e,n,l,r)}function l(e,t,r){var n=s[t],i=n.level%2!=0;return a(r?e-1:e,i!=r)}n=n||L(e.doc,t.line),i||(i=Yt(e,n));var s=Ce(n,e.doc.direction),c=t.ch,u=t.sticky;if(c>=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var f=ke(s,c,u),d=Ea,h=l(c,f,"before"==u);return null!=d&&(h.other=l(c,d,"before"!=u)),h}function fr(e,t){var r=0;t=H(e.doc,t),e.options.lineWrapping||(r=yr(e.display)*t.ch);var n=L(e.doc,t.line),i=ye(n)+Wt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function dr(e,t,r,n,i){var o=R(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function hr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return dr(n.first,0,null,!0,-1);var i=I(n,r),o=n.first+n.size-1;if(i>o)return dr(n.first+n.size-1,L(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=L(n,i);;){var l=gr(e,a,i,t,r),s=ce(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=E(a=c.to.line)}}function pr(e,t,r,n){var i=function(n){return lr(e,t,Qt(e,r,n),"line")},o=t.text.length,a=_(function(e){return i(e-1).bottom<=n},o,0);return o=_(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function mr(e,t,r,n){return pr(e,t,r,lr(e,t,Qt(e,r,n),"line").top)}function gr(e,t,r,n,i){i-=ye(t);var o,a=0,l=t.text.length,s=Yt(e,t);if(Ce(t,e.doc.direction)){if(e.options.lineWrapping){var c;c=pr(e,t,s,i),a=c.begin,l=c.end}o=new R(r,a);var u,f,d=ur(e,o,"line",t,s).left,h=d<n?1:-1,p=d-n;do{if(u=p,f=o,null==(o=Le(e,t,o,h))||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=f;break}p=ur(e,o,"line",t,s).left-n}while(h<0!=p<0&&Math.abs(p)<=Math.abs(u));if(Math.abs(p)>Math.abs(u)){if(p<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=f}}else{var m=_(function(r){var o=lr(e,t,Qt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.right<n)&&n-o.left<o.right-n)},a,l);m=S(t.text,m,1),o=new R(r,m,m==l?"before":"after")}var g=ur(e,o,"line",t,s);return(i<g.top||g.bottom<i)&&(o.outside=!0),o.xRel=n<g.left?-1:n>g.right?1:0,o}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ua){Ua=n("pre");for(var i=0;i<49;++i)Ua.appendChild(document.createTextNode("x")),Ua.appendChild(n("br"));Ua.appendChild(document.createTextNode("x"))}r(e.measure,Ua);var o=Ua.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function yr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function br(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:xr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function xr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/yr(e.display)-3);return function(i){if(ge(e.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 r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function kr(e){var t=e.doc,r=wr(e);t.iter(function(e){var t=r(e);t!=e.height&&O(e,t)})}function Cr(e,t,r,n){var i=e.display;if(!r&&"true"==We(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,c=hr(e,o,a);if(n&&1==c.xRel&&(s=L(e.doc,c.line).text).length==c.ch){var u=f(s,s.length,e.options.tabSize)-s.length;c=R(c.line,Math.max(0,Math.round((o-Ft(e.display).left)/yr(e.display))-u))}return c}function Sr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function _r(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t!==!1||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Lr(e,l.head,i),s||Tr(e,l,o)}}return n}function Lr(e,t,r){var i=ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Tr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?f-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return cr(e,R(t,r),"div",c,n)}var a,s,c=L(l,t),d=c.text.length;return we(Ce(c,l.direction),r||0,null==n?d:n,function(e,t,l){var c,h,p,m=o(e,"left");if(e==t)c=m,h=p=m.left;else{if(c=o(t-1,"right"),"rtl"==l){var g=m;m=c,c=g}h=m.left,p=c.right}null==r&&0==e&&(h=u),c.top-m.top>3&&(i(h,m.top,null,m.bottom),h=u,m.bottom<c.top&&i(h,m.bottom,null,c.top)),null==n&&t==d&&(p=f),(!a||m.top<a.top||m.top==a.top&&m.left<a.left)&&(a=m),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),h<u+1&&(h=u),i(h,c.top,p-h,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=Ft(e.display),u=c.left,f=Math.max(a.sizerWidth,jt(e)-a.sizer.offsetLeft)-c.right,d=t.from(),h=t.to();if(d.line==h.line)o(d.line,d.ch,h.ch);else{var p=L(l,d.line),m=L(l,h.line),g=fe(p)==fe(m),v=o(d.line,d.ch,g?p.text.length+1:null).end,y=o(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function Ar(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Or(e){e.state.focused||(e.display.input.focus(),Ir(e))}function Er(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Nr(e))},100)}function Ir(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Oe(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Zo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ar(e))}function Nr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,t),e.state.focused=!1,ga(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Rr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=P(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ln(e),!0}return!1}function Br(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(Qo&&Jo<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=vr(t)),(s>.001||s<-.001)&&(O(i.line,o),zr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)zr(i.rest[c])}}}function zr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Dr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Wt(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=I(t,n),a=I(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=I(t,ye(L(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=I(t,ye(L(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Wr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,$o||_n(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),$o&&_n(e),xn(e,100))}function qr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Pr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Hr(e){var t=Fr(e);return t.x*=Ja,t.y*=Ja,t}function jr(e,t){var r=Fr(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&ca&&Zo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f<u.length;f++)if(u[f].node==c){e.display.currentWheelTarget=c;break e}if(n&&!$o&&!ra&&null!=Ja)return i&&s&&Wr(e,Math.max(0,Math.min(a.scrollTop+i*Ja,a.scrollHeight-a.clientHeight))),qr(e,Math.max(0,Math.min(a.scrollLeft+n*Ja,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&Re(t),void(o.wheelStartX=null);if(i&&null!=Ja){var d=i*Ja,h=e.doc.scrollTop,p=h+o.wrapper.clientHeight;d<0?h=Math.max(0,h+d-50):p=Math.min(e.doc.height,p+d+50),_n(e,{top:h,bottom:p})}Qa<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Ja=(Ja*Qa+r)/(Qa+1),++Qa)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Kr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+qt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Ht(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Ur(e,t){t||(t=Kr(e));var r=e.display.barWidth,n=e.display.barHeight;Vr(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Br(e),Vr(e,Kr(e)),r=e.display.barWidth,n=e.display.barHeight}function Vr(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function $r(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ga(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new tl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pa(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?qr(e,t):Wr(e,t)},e),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)}function Gr(e,t){if(!Ee(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!oa){var a=n("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Wt(e.display))+"px;\n height: "+(t.bottom-t.top+Ht(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Xr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1,l=ur(e,t),s=r&&r!=t?ur(e,r):l;i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n};var c=Qr(e,i),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(Wr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(qr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}function Yr(e,t){var r=Qr(e,t);null!=r.scrollTop&&Wr(e,r.scrollTop),null!=r.scrollLeft&&qr(e,r.scrollLeft)}function Qr(e,t){var r=e.display,n=vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Kt(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+qt(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,d=jt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),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-(h?0:10)):t.right>d+f-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function Jr(e,t,r){null==t&&null==r||en(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Zr(e){en(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?R(t.line,t.ch-1):t,n=R(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function en(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=fr(e,t.from),n=fr(e,t.to),i=Qr(e,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-t.margin,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+t.margin});e.scrollTo(i.scrollLeft,i.scrollTop)}}function tn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++rl},xt(e.curOp)}function rn(e){kt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;nn(e)})}function nn(e){for(var t=e.ops,r=0;r<t.length;r++)on(t[r]);for(var n=0;n<t.length;n++)an(t[n]);for(var i=0;i<t.length;i++)ln(t[i]);for(var o=0;o<t.length;o++)sn(t[o]);for(var a=0;a<t.length;a++)cn(t[a])}function on(e){var t=e.cm,r=t.display;kn(t),e.updateMaxLine&&xe(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new nl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function an(e){e.updatedDisplay=e.mustUpdate&&Cn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&Br(t),e.barMeasure=Kr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Gt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Ht(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-jt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&qr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==a()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&Tn(t,e.barMeasure),e.selectionChanged&&Ar(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Or(e.cm)}function cn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Sn(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,Pr(t)),e.scrollToPos){Gr(t,Xr(t,H(n,e.scrollToPos.from),H(n,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||Oe(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Oe(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Oe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function un(e,t){if(e.curOp)return t();tn(e);try{return t()}finally{rn(e)}}function fn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tn(e);try{return t.apply(e,arguments)}finally{rn(e)}}}function dn(e){return function(){if(this.curOp)return e.apply(this,arguments);tn(this);try{return e.apply(this,arguments)}finally{rn(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tn(t);try{return e.apply(this,arguments)}finally{rn(t)}}}function pn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Oa&&pe(e.doc,t)<i.viewTo&&gn(e);else if(r<=i.viewFrom)Oa&&me(e.doc,r+n)>i.viewFrom?gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gn(e)}else if(r>=i.viewTo){var a=vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):gn(e)}else{var l=vn(e,t,t,-1),s=vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(bt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):gn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function mn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.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[Sr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);d(a,r)==-1&&a.push(r)}}}function gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=Sr(e,t),a=e.display.view;if(!Oa||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function yn(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=bt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=bt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Sr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(bt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Sr(e,r)))),n.viewTo=r}function bn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function xn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,c(wn,e))}function wn(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Xe(t.mode,et(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Je(e,o,l?Xe(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=o.styles[d];f&&i.push(t.frontier),o.stateAfter=l?n:Xe(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&tt(e,o.text,n),o.stateAfter=t.frontier%5==0?Xe(t.mode,n):null;if(++t.frontier,+new Date>r)return xn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t<i.length;t++)mn(e,i[t],"text")})}}function kn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ht(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ht(e)+"px",t.scrollbarsClipped=!0)}function Cn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return gn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==bn(e))return!1;Rr(e)&&(gn(e),r.dims=br(e));var o=i.first+i.size,l=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<l&&l-n.viewFrom<20&&(l=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),Oa&&(l=pe(e.doc,l),s=me(e.doc,s));var c=l!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;yn(e,l,s),n.viewOffset=ye(L(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=bn(e);if(!c&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var f=a();return u>4&&(n.lineDiv.style.display="none"),Mn(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&a()!=f&&f.offsetHeight&&f.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,c&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,xn(e,400)),n.updateLineNumbers=null,!0}function Sn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=jt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+qt(e.display)-Kt(e),r.top)}),t.visible=Dr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Cn(e,t);n=!1){Br(e);var i=Kr(e);_r(e),Ur(e,i),Tn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _n(e,t){var r=new nl(e,t);if(Cn(e,r)){Br(e),Sn(e,r);var n=Kr(e);_r(e),Ur(e,n),Tn(e,n),r.finish()}}function Mn(e,r,n){function i(t){var r=t.nextSibling;return Zo&&ca&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,f=0;f<c.length;f++){var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=i(s);var p=a&&null!=r&&r<=u&&h.lineNumber;h.changes&&(d(h.changes,"gutter")>-1&&(p=!1),_t(e,h,u,n)),p&&(t(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(P(e.options,u)))),s=h.node.nextSibling}else{var m=Nt(e,h,u,n);l.insertBefore(m,s)}u+=h.size}for(;s;)s=i(s)}function Ln(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Tn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ht(e)+"px"}function An(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var a=i[o],l=r.appendChild(n("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",Ln(e)}function On(e){var t=d(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function En(e,t){var r=e[t];e.sort(function(e,t){return B(e.from(),t.from())}),t=d(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(B(o.to(),i.from())>=0){var a=q(o.from(),i.from()),l=W(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new ol(s?l:a,s?a:l))}}return new il(e,t)}function In(e,t){return new il([new ol(e,t||e)],0)}function Nn(e){return e.text?R(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Pn(e,t){if(B(e,t.from)<0)return e;if(B(e,t.to)<=0)return Nn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Nn(t).ch-t.to.ch),R(r,n)}function Rn(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new ol(Pn(i.anchor,t),Pn(i.head,t)))}return En(r,e.sel.primIndex)}function Bn(e,t,r){return e.line==t.line?R(r.line,e.ch-t.ch+r.ch):R(r.line+(e.line-t.line),e.ch)}function zn(e,t,r){for(var n=[],i=R(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Bn(l.from,i,o),c=Bn(Nn(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],f=B(u.head,u.anchor)<0;n[a]=new ol(f?c:s,f?s:c)}else n[a]=new ol(s,s)}return new il(n,e.sel.primIndex)}function Dn(e){e.doc.mode=$e(e.options,e.doc.modeOption),Wn(e)}function Wn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,xn(e,100),e.state.modeGen++,e.curOp&&pn(e)}function qn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==m(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){st(e,r,i,n),Ct(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Ka(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,u=L(e,l.line),f=L(e,s.line),d=m(c),h=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(qn(e,t)){var g=a(0,c.length-1);o(f,f.text,h),p&&e.remove(l.line,p),g.length&&e.insert(l.line,g)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+d+u.text.slice(s.ch),h);else{
|
3 |
+
var v=a(1,c.length-1);v.push(new Ka(d+u.text.slice(s.ch),h,n)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,d+f.text.slice(s.ch),h);var y=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,y)}Ct(e,"change",e,t)}function Hn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function jn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,kr(e),Dn(e),Kn(e),e.options.lineWrapping||xe(e),e.options.mode=t.modeOption,pn(e)}function Kn(e){("rtl"==e.doc.direction?l:ga)(e.display.lineDiv,"CodeMirror-rtl")}function Un(e){un(e,function(){Kn(e),pn(e)})}function Vn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function $n(e,t){var r={from:D(t.from),to:Nn(t),text:T(e,t.from,t.to)};return ei(e,r,t.from.line,t.to.line+1),Hn(e,function(e){return ei(e,r,t.from.line,t.to.line+1)},!0),r}function Gn(e){for(;e.length;){if(!m(e).ranges)break;e.pop()}}function Xn(e,t){return t?(Gn(e.done),m(e.done)):e.done.length&&!m(e.done).ranges?m(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}function Yn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xn(i,i.lastOp==n)))a=m(o.changes),0==B(t.from,t.to)&&0==B(t.from,a.to)?a.to=Nn(t):o.changes.push($n(e,t));else{var s=m(i.done);for(s&&s.ranges||Zn(e.sel,i.done),o={changes:[$n(e,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(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Oe(e,"historyAdded")}function Qn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Jn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Qn(e,o,m(i.done),t))?i.done[i.done.length-1]=t:Zn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Gn(i.undone)}function Zn(e,t){var r=m(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ei(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ti(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ri(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(ti(r[i]));return n}function ni(e,t){var r=ri(e,t),n=Z(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function ii(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?il.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&d(t,Number(u[1]))>-1&&(m(l)[f]=c[f],delete c[f])}}}return n}function oi(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=B(r,i)<0;o!=B(n,i)<0?(i=r,r=n):o!=B(r,n)<0&&(r=n)}return new ol(i,r)}return new ol(n||r,r)}function ai(e,t,r,n){di(e,new il([oi(e,e.sel.primary(),t,r)],0),n)}function li(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=oi(e,e.sel.ranges[i],t[i],null);di(e,En(n,e.sel.primIndex),r)}function si(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,di(e,En(i,e.sel.primIndex),n)}function ci(e,t,r,n){di(e,In(t,r),n)}function ui(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new ol(H(e,t[n].anchor),H(e,t[n].head))},origin:r&&r.origin};return Oe(e,"beforeSelectionChange",e,n),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?En(n.ranges,n.ranges.length-1):t}function fi(e,t,r){var n=e.history.done,i=m(n);i&&i.ranges?(n[n.length-1]=t,hi(e,t,r)):di(e,t,r)}function di(e,t,r){hi(e,t,r),Jn(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function hi(e,t,r){(Ne(e,"beforeSelectionChange")||e.cm&&Ne(e.cm,"beforeSelectionChange"))&&(t=ui(e,t,r)),pi(e,gi(e,t,r&&r.bias||(B(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&r.scroll===!1||!e.cm||Zr(e.cm)}function pi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ie(e.cm)),Ct(e,"cursorActivity",e))}function mi(e){pi(e,gi(e,e.sel,null,!1),Ca)}function gi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=yi(e,a.anchor,l&&l.anchor,r,n),c=yi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ol(s,c))}return i?En(i,t.primIndex):t}function vi(e,t,r,n,i){var o=L(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Oe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=bi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=B(c,r))&&(n<0?u<0:u>0))return vi(e,c,t,n,i)}var f=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(f=bi(e,f,n,f.line==t.line?o:null)),f?vi(e,f,t,n,i):null}}return t}function yi(e,t,r,n,i){var o=n||1,a=vi(e,t,r,o,i)||!i&&vi(e,t,r,o,!0)||vi(e,t,r,-o,i)||!i&&vi(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,R(e.first,0))}function bi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?H(e,R(t.line-1)):null:r>0&&t.ch==(n||L(e,t.line)).text.length?t.line<e.first+e.size-1?R(t.line+1,0):null:new R(t.line,t.ch+r)}function xi(e){e.setSelection(R(e.firstLine(),0),R(e.lastLine()),Ca)}function wi(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=H(e,t)),r&&(n.to=H(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),Oe(e,"beforeChange",e,n),e.cm&&Oe(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ki(e,t,r){if(e.cm){if(!e.cm.curOp)return fn(e.cm,ki)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ne(e,"beforeChange")||e.cm&&Ne(e.cm,"beforeChange"))||(t=wi(e,t,!0))){var n=Aa&&!r&&te(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Ci(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Ci(e,t)}}function Ci(e,t){if(1!=t.text.length||""!=t.text[0]||0!=B(t.from,t.to)){var r=Rn(e,t);Yn(e,t,r,e.cm?e.cm.curOp.id:NaN),Mi(e,t,r,Z(e,t));var n=[];Hn(e,function(e,r){r||d(n,e.history)!=-1||(Ei(e.history,t),n.push(e.history)),Mi(e,t,null,Z(e,t))})}}function Si(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(Zn(n,l),r&&!n.equals(e.sel))return void di(e,n,{clearRedo:!1});o=n}var c=[];Zn(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=Ne(e,"beforeChange")||e.cm&&Ne(e.cm,"beforeChange"),f=n.changes.length-1;f>=0;--f){var h=function(r){var i=n.changes[r];if(i.origin=t,u&&!wi(e,i,!1))return a.length=0,{};c.push($n(e,i));var o=r?Rn(e,i):m(a);Mi(e,i,o,ni(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Nn(i)});var l=[];Hn(e,function(e,t){t||d(l,e.history)!=-1||(Ei(e.history,i),l.push(e.history)),Mi(e,i,null,ni(e,i))})}(f);if(h)return h.v}}}}function _i(e,t){if(0!=t&&(e.first+=t,e.sel=new il(g(e.sel.ranges,function(e){return new ol(R(e.anchor.line+t,e.anchor.ch),R(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)mn(e.cm,n,"gutter")}}function Mi(e,t,r,n){if(e.cm&&!e.cm.curOp)return fn(e.cm,Mi)(e,t,r,n);if(t.to.line<e.first)return void _i(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);_i(e,i),t={from:R(e.first,0),to:R(t.to.line+i,t.to.ch),text:[m(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:R(o,L(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=Rn(e,t)),e.cm?Li(e.cm,t,n):Fn(e,t,n),hi(e,r,Ca)}}function Li(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=E(fe(L(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ie(e),Fn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),xn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pn(e):o.line!=a.line||1!=t.text.length||qn(e.doc,t)?pn(e,o.line,a.line+1,c):mn(e,o.line,"text");var u=Ne(e,"changes"),f=Ne(e,"change");if(f||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&Ct(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function Ti(e,t,r,n,i){if(n||(n=r),B(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),ki(e,{from:r,to:n,text:t,origin:i})}function Ai(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Oi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Ai(o.ranges[l].anchor,t,r,n),Ai(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=R(c.from.line+n,c.from.ch),c.to=R(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Ei(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Oi(e.done,r,n,i),Oi(e.undone,r,n,i)}function Ii(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=L(e,F(e,t)):i=E(t),null==i?null:(n(o,i)&&e.cm&&mn(e.cm,i,r),o)}function Ni(e,t,r){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Jr(e,null,r)}function Pi(e,t,r,n){var i=new sl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ii(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ge(e,t)){var n=ye(t)<e.scrollTop;O(t,t.height+zt(i)),n&&Jr(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),Ct(o,"lineWidgetAdded",o,i,"number"==typeof t?t:E(t)),i}function Ri(e,t,r,n,o){if(n&&n.shared)return Bi(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return fn(e.cm,Ri)(e,t,r,n,o);var a=new ul(e,o),l=B(t,r);if(n&&u(n,a,!1),l>0||0==l&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ue(e,t.line,t,r,a)||t.line!=r.line&&ue(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");V()}a.addToHistory&&Yn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,c=t.line,f=e.cm;if(e.iter(c,r.line+1,function(e){f&&a.collapsed&&!f.options.lineWrapping&&fe(e)==f.display.maxLine&&(s=!0),a.collapsed&&c!=t.line&&O(e,0),Y(e,new $(a,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),a.collapsed&&e.iter(t.line,r.line+1,function(t){ge(e,t)&&O(t,0)}),a.clearOnEnter&&Pa(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(U(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++cl,a.atomic=!0),f){if(s&&(f.curOp.updateMaxLine=!0),a.collapsed)pn(f,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var d=t.line;d<=r.line;d++)mn(f,d,"text");a.atomic&&mi(f.doc),Ct(f,"markerAdded",f,a)}return a}function Bi(e,t,r,n,i){n=u(n),n.shared=!1;var o=[Ri(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Hn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Ri(e,H(e,t),H(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=m(o)}),new fl(o,a)}function zi(e){return e.findMarks(R(e.first,0),e.clipPos(R(e.lastLine())),function(e){return e.parent})}function Di(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(B(o,a)){var l=Ri(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function Wi(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];Hn(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];d(n,o.doc)==-1&&(o.parent=null,r.markers.splice(i--,1))}}(t)}function qi(e){var t=this;if(ji(t),!Ee(t,e)&&!Dt(t.display,e)){Re(e),Qo&&(pl=+new Date);var r=Cr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=0;l<i;++l)!function(e,n){if(!t.options.allowDropFileTypes||d(t.options.allowDropFileTypes,e.type)!=-1){var l=new FileReader;l.onload=fn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){r=H(t.doc,r);var s={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};ki(t.doc,s),fi(t.doc,In(r,Nn(s)))}}),l.readAsText(e)}}(n[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var s=e.dataTransfer.getData("Text");if(s){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),hi(t.doc,In(r,r)),c)for(var u=0;u<c.length;++u)Ti(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Fi(e,t){if(Qo&&(!e.state.draggingText||+new Date-pl<100))return void De(t);if(!Ee(e,t)&&!Dt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!na)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ra&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ra&&r.parentNode.removeChild(r)}}function Hi(e,t){var i=Cr(e,t);if(i){var o=document.createDocumentFragment();Lr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function ji(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ki(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Ui(){ml||(Vi(),ml=!0)}function Vi(){var e;Pa(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ki($i)},100))}),Pa(window,"blur",function(){return Ki(Nr)})}function $i(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gi(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Xi(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=g(r.split(" "),Gi),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Yi(e,t,r,n){t=Zi(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Yi(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Yi(e,t.fallthrough[o],r,n);if(a)return a}}}function Qi(e){var t="string"==typeof e?e:gl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ji(e,t){if(ra&&34==e.keyCode&&e.char)return!1;var r=gl[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(pa?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(pa?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)}function Zi(e){return"string"==typeof e?xl[e]:e}function eo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&B(o.from,m(n).to)<=0;){var a=n.pop();if(B(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}un(e,function(){for(var t=n.length-1;t>=0;t--)Ti(e.doc,"",n[t].from,n[t].to,"+delete");Zr(e)})}function to(e,t){var r=L(e.doc,t),n=fe(r);return n!=r&&(t=E(n)),Me(!0,e,n,t,1)}function ro(e,t){var r=L(e.doc,t),n=de(r);return n!=r&&(t=E(n)),Me(!0,e,r,t,-1)}function no(e,t){var r=to(e,t.line),n=L(e.doc,r.line),i=Ce(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return R(r.line,a?0:o,r.sticky)}return r}function io(e,t,r){if("string"==typeof t&&!(t=Cl[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ka}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function oo(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Yi(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Yi(t,e.options.extraKeys,r,e)||Yi(t,e.options.keyMap,r,e)}function ao(e,t,r,n){var i=e.state.keySeq;if(i){if(Qi(t))return"handled";Sl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=oo(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ct(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(Re(r),Ar(e)),i&&!o&&/\'$/.test(t)?(Re(r),!0):!!o}function lo(e,t){var r=Ji(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ao(e,"Shift-"+r,t,function(t){return io(e,t,!0)})||ao(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return io(e,t)}):ao(e,r,t,function(t){return io(e,t)}))}function so(e,t,r){return ao(e,"'"+r+"'",t,function(t){return io(e,t,!0)})}function co(e){var t=this;if(t.curOp.focus=a(),!Ee(t,e)){Qo&&Jo<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=lo(t,e);ra&&(_l=n?r:null,!n&&88==r&&!Da&&(ca?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||uo(t)}}function uo(e){function t(e){18!=e.keyCode&&e.altKey||(ga(r,"CodeMirror-crosshair"),Ae(document,"keyup",t),Ae(document,"mouseover",t))}var r=e.display.lineDiv;l(r,"CodeMirror-crosshair"),Pa(document,"keyup",t),Pa(document,"mouseover",t)}function fo(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ee(this,e)}function ho(e){var t=this;if(!(Dt(t.display,e)||Ee(t,e)||e.ctrlKey&&!e.altKey||ca&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(ra&&r==_l)return _l=null,void Re(e);if(!ra||e.which&&!(e.which<10)||!lo(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(so(t,e,i)||t.display.input.onKeyPress(e))}}}function po(e){var t=this,r=t.display;if(!(Ee(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,Dt(r,e))return void(Zo||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!bo(t,e)){var n=Cr(t,e);switch(window.focus(),qe(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?mo(t,e,n):We(e)==r.scroller&&Re(e);break;case 2:Zo&&(t.state.lastMiddleDown=+new Date),n&&ai(t.doc,n),setTimeout(function(){return r.input.focus()},20),Re(e);break;case 3:ma?xo(t,e):Er(t)}}}}function mo(e,t,r){Qo?setTimeout(c(Or,e),0):e.curOp.focus=a();var n,i=+new Date;kl&&kl.time>i-400&&0==B(kl.pos,r)?n="triple":wl&&wl.time>i-400&&0==B(wl.pos,r)?(n="double",kl={time:i,pos:r}):(n="single",wl={time:i,pos:r});var o,l=e.doc.sel,s=ca?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ra&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(B((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(B(o.to(),r)>0||r.xRel<0)?go(e,t,r,s):vo(e,t,r,n,s)}function go(e,t,r,n){var i=e.display,o=+new Date,a=fn(e,function(l){Zo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ae(document,"mouseup",a),Ae(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Re(l),!n&&+new Date-200<o&&ai(e.doc,r),Zo||Qo&&9==Jo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});Zo&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=ca?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Pa(document,"mouseup",a),Pa(i.scroller,"drop",a)}function vo(e,t,r,n,i){function o(t){if(0!=B(b,t))if(b=t,"rect"==n){for(var i=[],o=e.options.tabSize,a=f(L(u,r.line).text,r.ch,o),l=f(L(u,t.line).text,t.ch,o),s=Math.min(a,l),c=Math.max(a,l),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var y=L(u,g).text,x=h(y,s,o);s==c?i.push(new ol(R(g,x),R(g,x))):y.length>x&&i.push(new ol(R(g,x),R(g,h(y,c,o))))}i.length||i.push(new ol(r,r)),di(u,En(m.ranges.slice(0,p).concat(i),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var w=d,k=w.anchor,C=t;if("single"!=n){var S;S="double"==n?e.findWordAt(t):new ol(R(t.line,0),H(u,R(t.line+1,0))),B(S.anchor,k)>0?(C=S.head,k=q(w.from(),S.anchor)):(C=S.anchor,k=W(w.to(),S.head))}var _=m.ranges.slice(0);_[p]=new ol(H(u,k),C),di(u,En(_,p),Sa)}}function l(t){var r=++w,i=Cr(e,t,!0,"rect"==n);if(i)if(0!=B(i,b)){e.curOp.focus=a(),o(i);var s=Dr(c,u);(i.line>=s.to||i.line<s.from)&&setTimeout(fn(e,function(){w==r&&l(t)}),150)}else{var f=t.clientY<x.top?-20:t.clientY>x.bottom?20:0;f&&setTimeout(fn(e,function(){w==r&&(c.scroller.scrollTop+=f,l(t))}),50)}}function s(t){e.state.selectingText=!1,w=1/0,Re(t),c.input.focus(),Ae(document,"mousemove",k),Ae(document,"mouseup",C),u.history.lastSelOrigin=null}var c=e.display,u=e.doc;Re(t);var d,p,m=u.sel,g=m.ranges;if(i&&!t.shiftKey?(p=u.sel.contains(r),d=p>-1?g[p]:new ol(r,r)):(d=u.sel.primary(),p=u.sel.primIndex),ua?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(d=new ol(r,r)),r=Cr(e,t,!0,!0),p=-1;else if("double"==n){var v=e.findWordAt(r);d=e.display.shift||u.extend?oi(u,d,v.anchor,v.head):v}else if("triple"==n){var y=new ol(R(r.line,0),H(u,R(r.line+1,0)));d=e.display.shift||u.extend?oi(u,d,y.anchor,y.head):y}else d=oi(u,d,r);i?p==-1?(p=g.length,di(u,En(g.concat([d]),p),{scroll:!1,origin:"*mouse"})):g.length>1&&g[p].empty()&&"single"==n&&!t.shiftKey?(di(u,En(g.slice(0,p).concat(g.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):si(u,p,d,Sa):(p=0,di(u,new il([d],0),Sa),m=u.sel);var b=r,x=c.wrapper.getBoundingClientRect(),w=0,k=fn(e,function(e){qe(e)?l(e):s(e)}),C=fn(e,s);e.state.selectingText=C,Pa(document,"mousemove",k),Pa(document,"mouseup",C)}function yo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Re(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ne(e,r))return ze(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){return Oe(e,r,e,I(e.doc,o),e.options.gutters[s],t),ze(t)}}}function bo(e,t){return yo(e,t,"gutterClick",!0)}function xo(e,t){Dt(e.display,t)||wo(e,t)||Ee(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function wo(e,t){return!!Ne(e,"gutterContextMenu")&&yo(e,t,"gutterContextMenu",!1)}function ko(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ir(e)}function Co(e){An(e),pn(e),Pr(e)}function So(e,t,r){if(!t!=!(r&&r!=Ml)){var n=e.display.dragFunctions,i=t?Pa:Ae;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function _o(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ga(e.display.wrapper,"CodeMirror-wrap"),xe(e)),kr(e),pn(e),ir(e),setTimeout(function(){return Ur(e)},100)}function Mo(e,t){var r=this;if(!(this instanceof Mo))return new Mo(e,t);this.options=t=t?u(t):{},u(Ll,t,!1),On(t);var n=t.value;"string"==typeof n&&(n=new hl(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new Mo.inputStyles[t.inputStyle](this),o=this.display=new M(e,n,i);o.wrapper.CodeMirror=this,An(this),ko(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(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 ya,keySeq:null,specialChars:null},t.autofocus&&!sa&&o.input.focus(),Qo&&Jo<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Lo(this),Ui(),tn(this),this.curOp.forceUpdate=!0,jn(this,n),t.autofocus&&!sa||this.hasFocus()?setTimeout(c(Ir,this),20):Nr(this);for(var a in Tl)Tl.hasOwnProperty(a)&&Tl[a](r,t[a],Ml);Rr(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Al.length;++l)Al[l](r);rn(this),Zo&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Lo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Pa(i.scroller,"mousedown",fn(e,po)),Qo&&Jo<11?Pa(i.scroller,"dblclick",fn(e,function(t){if(!Ee(e,t)){var r=Cr(e,t);if(r&&!bo(e,t)&&!Dt(e.display,t)){Re(t);var n=e.findWordAt(r);ai(e.doc,n.anchor,n.head)}}})):Pa(i.scroller,"dblclick",function(t){return Ee(e,t)||Re(t)}),ma||Pa(i.scroller,"contextmenu",function(t){return xo(e,t)});var o,a={end:0};Pa(i.scroller,"touchstart",function(t){if(!Ee(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Pa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Pa(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Dt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new ol(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new ol(R(l.line,0),H(e.doc,R(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Re(r)}t()}),Pa(i.scroller,"touchcancel",t),Pa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Wr(e,i.scroller.scrollTop),qr(e,i.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),Pa(i.scroller,"mousewheel",function(t){return jr(e,t)}),Pa(i.scroller,"DOMMouseScroll",function(t){return jr(e,t)}),Pa(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ee(e,t)||De(t)},over:function(t){Ee(e,t)||(Hi(e,t),De(t))},start:function(t){return Fi(e,t)},drop:fn(e,qi),leave:function(t){Ee(e,t)||ji(e)}};var l=i.input.getField();Pa(l,"keyup",function(t){return fo.call(e,t)}),Pa(l,"keydown",fn(e,co)),Pa(l,"keypress",fn(e,ho)),Pa(l,"focus",function(t){return Ir(e,t)}),Pa(l,"blur",function(t){return Nr(e,t)})}function To(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=et(e,t):r="prev");var a=e.options.tabSize,l=L(o,t),s=f(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==ka||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?f(L(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)h+=a,d+="\t";if(h<c&&(d+=p(c-h)),d!=u)return Ti(o,d,R(t,0),R(t,u.length),"+input"),l.stateAfter=null,!0;for(var g=0;g<o.sel.ranges.length;g++){var v=o.sel.ranges[g];if(v.head.line==t&&v.head.ch<u.length){var y=R(t,u.length);si(o,g,new ol(y,y));break}}}function Ao(e){Ol=e}function Oo(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Ba(t),s=null;if(a&&n.ranges.length>1)if(Ol&&Ol.text.join("\n")==t){if(n.ranges.length%Ol.text.length==0){s=[];for(var c=0;c<Ol.text.length;c++)s.push(o.splitLines(Ol.text[c]))}}else l.length==n.ranges.length&&(s=g(l,function(e){return[e]}));for(var u,f=n.ranges.length-1;f>=0;f--){var d=n.ranges[f],h=d.from(),p=d.to();d.empty()&&(r&&r>0?h=R(h.line,h.ch-r):e.state.overwrite&&!a?p=R(p.line,Math.min(L(o,p.line).text.length,p.ch+m(l).length)):Ol&&Ol.lineWise&&Ol.text.join("\n")==t&&(h=p=R(h.line,0))),u=e.curOp.updateInput;var v={from:h,to:p,text:s?s[f%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};ki(e.doc,v),Ct(e,"inputRead",e,v)}t&&!a&&Io(e,t),Zr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Eo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return Oo(t,r,0,null,"paste")}),!0}function Io(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=To(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(L(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=To(e,i.head.line,"smart"));a&&Ct(e,"electricInput",e,i.head.line)}}}function No(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:R(i,0),head:R(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Po(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Ro(){var e=n("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=n("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Zo?e.style.width="1000px":e.setAttribute("wrap","off"),aa&&(e.style.border="1px solid black"),Po(e),t}function Bo(e,t,r,n,i){function o(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new R(n,t.ch,t.sticky),
|
4 |
+
c=L(e,n))}function a(n){var a;if(null==(a=i?Le(e.cm,c,t,r):_e(c,t,r))){if(n||!o())return!1;t=Me(i,e.cm,c,t.line,r)}else t=a;return!0}var l=t,s=r,c=L(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,f="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||a(!h);h=!1){var p=c.text.charAt(t.ch)||"\n",m=w(p,d)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||h||m||(m="s"),u&&u!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(u=m),r>0&&!a(!h))break}var g=yi(e,t,l,s,!0);return z(l,g)&&(g.hitSide=!0),g}function zo(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=hr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Do(e,t){var r=Xt(e,t.line);if(!r||r.hidden)return null;var n=L(e.doc,t.line),i=Vt(r,n,t.line),o=Ce(n,e.doc.direction),a="left";if(o){a=ke(o,t.ch)%2?"right":"left"}var l=Jt(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Wo(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function qo(e,t){return t&&(e.bad=!0),e}function Fo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(){u&&(c+=f,u=!1)}function l(e){e&&(a(),c+=e)}function s(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void l(r||t.textContent.replace(/\u200b/g,""));var c,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(R(n,0),R(i+1,0),o(+d));return void(h.length&&(c=h[0].find())&&l(T(e.doc,c.from,c.to).join(f)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&a();for(var m=0;m<t.childNodes.length;m++)s(t.childNodes[m]);p&&(u=!0)}else 3==t.nodeType&&l(t.nodeValue)}for(var c="",u=!1,f=e.doc.lineSeparator();s(t),t!=r;)t=t.nextSibling;return c}function Ho(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return qo(e.clipPos(R(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return jo(o,t,r)}}function jo(e,t,r){function n(t,r,n){for(var i=-1;i<(f?f.length:0);i++)for(var o=i<0?u.map:f[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var s=E(i<0?e.line:e.rest[i]),c=o[a]+n;return(n<0||l!=t)&&(c=o[a+(n?1:0)]),R(s,c)}}}var i=e.text.firstChild,a=!1;if(!t||!o(i,t))return qo(R(E(e.line),0),!0);if(t==i&&(a=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?m(e.rest):e.line;return qo(R(E(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=e.measure,f=u.maps,d=n(s,c,r);if(d)return qo(d,a);for(var h=c.nextSibling,p=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(d=n(h,h.firstChild,0))return qo(R(d.line,d.ch-p),a);p+=h.textContent.length}for(var g=c.previousSibling,v=r;g;g=g.previousSibling){if(d=n(g,g.firstChild,-1))return qo(R(d.line,d.ch+v),a);v+=g.textContent.length}}function Ko(e,t){function r(){e.value=s.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=a();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(Pa(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Ae(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Mo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}var Uo=navigator.userAgent,Vo=navigator.platform,$o=/gecko\/\d/i.test(Uo),Go=/MSIE \d/.test(Uo),Xo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Uo),Yo=/Edge\/(\d+)/.exec(Uo),Qo=Go||Xo||Yo,Jo=Qo&&(Go?document.documentMode||6:+(Yo||Xo)[1]),Zo=!Yo&&/WebKit\//.test(Uo),ea=Zo&&/Qt\/\d+\.\d+/.test(Uo),ta=!Yo&&/Chrome\//.test(Uo),ra=/Opera\//.test(Uo),na=/Apple Computer/.test(navigator.vendor),ia=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Uo),oa=/PhantomJS/.test(Uo),aa=!Yo&&/AppleWebKit/.test(Uo)&&/Mobile\/\w+/.test(Uo),la=/Android/.test(Uo),sa=aa||la||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Uo),ca=aa||/Mac/.test(Vo),ua=/\bCrOS\b/.test(Uo),fa=/win/i.test(Vo),da=ra&&Uo.match(/Version\/(\d*\.\d*)/);da&&(da=Number(da[1])),da&&da>=15&&(ra=!1,Zo=!0);var ha,pa=ca&&(ea||ra&&(null==da||da<12.11)),ma=$o||Qo&&Jo>=9,ga=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};ha=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var va=function(e){e.select()};aa?va=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Qo&&(va=function(e){try{e.select()}catch(e){}});var ya=function(){this.id=null};ya.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ba,xa,wa=30,ka={toString:function(){return"CodeMirror.Pass"}},Ca={scroll:!1},Sa={origin:"*mouse"},_a={origin:"+move"},Ma=[""],La=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ta=/[\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]/,Aa=!1,Oa=!1,Ea=null,Ia=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;return function(r,n){var c="ltr"==n?"L":"R";if(0==r.length||"ltr"==n&&!i.test(r))return!1;for(var u=r.length,f=[],d=0;d<u;++d)f.push(e(r.charCodeAt(d)));for(var h=0,p=c;h<u;++h){var g=f[h];"m"==g?f[h]=p:p=g}for(var v=0,y=c;v<u;++v){var b=f[v];"1"==b&&"r"==y?f[v]="n":a.test(b)&&(y=b,"r"==b&&(f[v]="R"))}for(var x=1,w=f[0];x<u-1;++x){var k=f[x];"+"==k&&"1"==w&&"1"==f[x+1]?f[x]="1":","!=k||w!=f[x+1]||"1"!=w&&"n"!=w||(f[x]=w),w=k}for(var C=0;C<u;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var _=void 0;for(_=C+1;_<u&&"%"==f[_];++_);for(var M=C&&"!"==f[C-1]||_<u&&"1"==f[_]?"1":"N",L=C;L<_;++L)f[L]=M;C=_-1}}for(var T=0,A=c;T<u;++T){var O=f[T];"L"==A&&"1"==O?f[T]="L":a.test(O)&&(A=O)}for(var E=0;E<u;++E)if(o.test(f[E])){var I=void 0;for(I=E+1;I<u&&o.test(f[I]);++I);for(var N="L"==(E?f[E-1]:c),P="L"==(I<u?f[I]:c),R=N==P?N?"L":"R":c,B=E;B<I;++B)f[B]=R;E=I-1}for(var z,D=[],W=0;W<u;)if(l.test(f[W])){var q=W;for(++W;W<u&&l.test(f[W]);++W);D.push(new t(0,q,W))}else{var F=W,H=D.length;for(++W;W<u&&"L"!=f[W];++W);for(var j=F;j<W;)if(s.test(f[j])){F<j&&D.splice(H,0,new t(1,F,j));var K=j;for(++j;j<W&&s.test(f[j]);++j);D.splice(H,0,new t(2,K,j)),F=j}else++j;F<W&&D.splice(H,0,new t(1,F,W))}return 1==D[0].level&&(z=r.match(/^\s+/))&&(D[0].from=z[0].length,D.unshift(new t(0,0,z[0].length))),1==m(D).level&&(z=r.match(/\s+$/))&&(m(D).to-=z[0].length,D.push(new t(0,u-z[0].length,u))),"rtl"==n?D.reverse():D}}(),Na=[],Pa=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Na).concat(r)}},Ra=function(){if(Qo&&Jo<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Ba=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},za=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Da=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Wa=null,qa={},Fa={},Ha={},ja=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ja.prototype.eol=function(){return this.pos>=this.string.length},ja.prototype.sol=function(){return this.pos==this.lineStart},ja.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ja.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ja.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},ja.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ja.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},ja.prototype.skipToEnd=function(){this.pos=this.string.length},ja.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ja.prototype.backUp=function(e){this.pos-=e},ja.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=f(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?f(this.string,this.lineStart,this.tabSize):0)},ja.prototype.indentation=function(){return f(this.string,null,this.tabSize)-(this.lineStart?f(this.string,this.lineStart,this.tabSize):0)},ja.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return t!==!1&&(this.pos+=e.length),!0},ja.prototype.current=function(){return this.string.slice(this.start,this.pos)},ja.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var Ka=function(e,t,r){this.text=e,ne(this,t),this.height=r?r(this):1};Ka.prototype.lineNo=function(){return E(this)},Pe(Ka);var Ua,Va={},$a={},Ga=null,Xa=null,Ya={left:0,right:0,top:0,bottom:0},Qa=0,Ja=null;Qo?Ja=-.53:$o?Ja=15:ta?Ja=-.7:na&&(Ja=-1/3);var Za=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Pa(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Pa(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Qo&&Jo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Za.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Za.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Za.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Za.prototype.zeroWidthHack=function(){var e=ca&&!ia?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ya,this.disableVert=new ya},Za.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect();document.elementFromPoint(n.left+1,n.bottom-1)!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},Za.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var el=function(){};el.prototype.update=function(){return{bottom:0,right:0}},el.prototype.setScrollLeft=function(){},el.prototype.setScrollTop=function(){},el.prototype.clear=function(){};var tl={native:Za,null:el},rl=0,nl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Dr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=jt(e),this.force=r,this.dims=br(e),this.events=[]};nl.prototype.signal=function(e,t){Ne(e,t)&&this.events.push(arguments)},nl.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Oe.apply(null,e.events[t])};var il=function(e,t){this.ranges=e,this.primIndex=t};il.prototype.primary=function(){return this.ranges[this.primIndex]},il.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!z(n.anchor,i.anchor)||!z(n.head,i.head))return!1}return!0},il.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new ol(D(e.ranges[r].anchor),D(e.ranges[r].head));return new il(t,this.primIndex)},il.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},il.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(B(t,i.from())>=0&&B(e,i.to())<=0)return n}return-1};var ol=function(e,t){this.anchor=e,this.head=t};ol.prototype.from=function(){return q(this.anchor,this.head)},ol.prototype.to=function(){return W(this.anchor,this.head)},ol.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var al=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r};al.prototype.chunkSize=function(){return this.lines.length},al.prototype.removeInner=function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,ct(o),Ct(o,"delete")}this.lines.splice(e,t)},al.prototype.collapse=function(e){e.push.apply(e,this.lines)},al.prototype.insertInner=function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},al.prototype.iterN=function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0};var ll=function(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null};ll.prototype.chunkSize=function(){return this.size},ll.prototype.removeInner=function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof al))){var s=[];this.collapse(s),this.children=[new al(s)],this.children[0].parent=this}},ll.prototype.collapse=function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},ll.prototype.insertInner=function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new al(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},ll.prototype.maybeSpill=function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ll(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=d(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new ll(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},ll.prototype.iterN=function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=a}};var sl=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};sl.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=E(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var a=zt(this);O(n,Math.max(0,n.height-a)),t&&(un(t,function(){Ni(t,n,-a),mn(t,i,"widget")}),Ct(t,"lineWidgetCleared",t,this,i))}},sl.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=zt(this)-t;i&&(O(n,n.height+i),r&&un(r,function(){r.curOp.forceUpdate=!0,Ni(r,n,i),Ct(r,"lineWidgetChanged",r,e,E(n))}))},Pe(sl);var cl=0,ul=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++cl};ul.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&tn(t),Ne(this,"clear")){var n=this.find();n&&Ct(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=G(l.markedSpans,e);t&&!e.collapsed?mn(t,E(l),"text"):t&&(null!=s.to&&(o=E(l)),null!=s.from&&(i=E(l))),l.markedSpans=X(l.markedSpans,s),null==s.from&&e.collapsed&&!ge(e.doc,l)&&t&&O(l,vr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=fe(e.lines[c]),f=be(u);f>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&mi(t.doc)),t&&Ct(t,"markerCleared",t,this,i,o),r&&rn(t),this.parent&&this.parent.clear()}},ul.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var a=r.lines[o],l=G(a.markedSpans,r);if(null!=l.from&&(n=R(t?a:E(a),l.from),e==-1))return n;if(null!=l.to&&(i=R(t?a:E(a),l.to),1==e))return i}return n&&{from:n,to:i}},ul.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&un(n,function(){var i=t.line,o=E(t.line),a=Xt(n,o);if(a&&(rr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ge(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=zt(r)-l;s&&O(i,i.height+s)}Ct(n,"markerChanged",n,e)})},ul.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&d(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ul.prototype.detachLine=function(e){if(this.lines.splice(d(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Pe(ul);var fl=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};fl.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Ct(this,"clear")}},fl.prototype.find=function(e,t){return this.primary.find(e,t)},Pe(fl);var dl=0,hl=function(e,t,r,n,i){if(!(this instanceof hl))return new hl(e,t,r,n,i);null==r&&(r=0),ll.call(this,[new al([new Ka("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var o=R(r,0);this.sel=In(o),this.history=new Vn(null),this.id=++dl,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Fn(this,{from:o,to:o,text:e}),di(this,In(o),Ca)};hl.prototype=b(ll.prototype,{constructor:hl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=A(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=R(this.first,0),r=this.first+this.size-1;ki(this,{from:t,to:R(r,L(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),di(this,In(t))}),replaceRange:function(e,t,r,n){t=H(this,t),r=r?H(this,r):t,Ti(this,e,t,r,n)},getRange:function(e,t,r){var n=T(this,H(this,e),H(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(N(this,e))return L(this,e)},getLineNumber:function(e){return E(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=L(this,e)),fe(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return H(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hn(function(e,t,r){ci(this,H(this,"number"==typeof e?R(e,t||0):e),null,r)}),setSelection:hn(function(e,t,r){ci(this,H(this,e),H(this,t||e),r)}),extendSelection:hn(function(e,t,r){ai(this,H(this,e),t&&H(this,t),r)}),extendSelections:hn(function(e,t){li(this,K(this,e),t)}),extendSelectionsBy:hn(function(e,t){li(this,K(this,g(this.sel.ranges,e)),t)}),setSelections:hn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new ol(H(n,e[o].anchor),H(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),di(this,En(i,t),r)}}),addSelection:hn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new ol(H(this,e),H(this,t||e))),di(this,En(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=T(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=T(t,n[i].from(),n[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:hn(function(e,t,r){for(var n=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:n.splitLines(e[a]),origin:r}}for(var s=t&&"end"!=t&&zn(this,i,t),c=i.length-1;c>=0;c--)ki(n,i[c]);s?fi(this,s):this.cm&&Zr(this.cm)}),undo:hn(function(){Si(this,"undo")}),redo:hn(function(){Si(this,"redo")}),undoSelection:hn(function(){Si(this,"undo",!0)}),redoSelection:hn(function(){Si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Vn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ii(this.history.done),undone:ii(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=ii(e.done.slice(0),null,!0),t.undone=ii(e.undone.slice(0),null,!0)},setGutterMarker:hn(function(e,t,r){return Ii(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&k(n)&&(e.gutterMarkers=null),!0})}),clearGutter:hn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Ii(t,r,"gutter",function(){return r.gutterMarkers[e]=null,k(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!N(this,e))return null;if(t=e,!(e=L(this,e)))return null}else if(null==(t=E(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:hn(function(t,r,n){return Ii(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:hn(function(t,r,n){return Ii(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var a=o.match(e(n));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:hn(function(e,t,r){return Pi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Ri(this,H(this,e),H(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=H(this,e),Ri(this,e,e,r,"bookmark")},findMarksAt:function(e){e=H(this,e);var t=[],r=L(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=H(this,e),t=H(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),H(this,R(r,t))},indexFromPos:function(e){e=H(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new hl(A(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,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new hl(A(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Di(n,zi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Mo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Wi(zi(t));break}}if(e.history==this.history){var i=[e.id];Hn(e,function(e){return i.push(e.id)},!0),e.history=new Vn(null),e.history.done=ii(this.history.done,i),e.history.undone=ii(this.history.undone,i)}},iterLinkedDocs:function(e){Hn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ba(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:hn(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Un(this.cm))})}),hl.prototype.eachLine=hl.prototype.iter;for(var pl=0,ml=!1,gl={3:"Enter",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:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",
|
5 |
+
63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},vl=0;vl<10;vl++)gl[vl+48]=gl[vl+96]=String(vl);for(var yl=65;yl<=90;yl++)gl[yl]=String.fromCharCode(yl);for(var bl=1;bl<=12;bl++)gl[bl+111]=gl[bl+63235]="F"+bl;var xl={};xl.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"},xl.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"},xl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},xl.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"]},xl.default=ca?xl.macDefault:xl.pcDefault;var wl,kl,Cl={selectAll:xi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ca)},killLine:function(e){return eo(e,function(t){if(t.empty()){var r=L(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:R(t.head.line+1,0)}:{from:t.head,to:R(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return eo(e,function(t){return{from:R(t.from().line,0),to:H(e.doc,R(t.to().line+1,0))}})},delLineLeft:function(e){return eo(e,function(e){return{from:R(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return eo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return eo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(R(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(R(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return to(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return no(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ro(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},_a)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},_a)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?no(e,t.head):n},_a)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=f(e.getLine(o.line),o.ch,n);t.push(p(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=L(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new R(i.line,i.ch-1)),i.ch>0)i=new R(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),R(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=L(e.doc,i.line-1).text;a&&(i=new R(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),R(i.line-1,a.length-1),i,"+transpose"))}r.push(new ol(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Zr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Sl=new ya,_l=null,Ml={toString:function(){return"CodeMirror.Init"}},Ll={},Tl={};Mo.defaults=Ll,Mo.optionHandlers=Tl;var Al=[];Mo.defineInitHook=function(e){return Al.push(e)};var Ol=null,El=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ya,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};El.prototype.init=function(e){function t(e){if(!Ee(i,e)){if(i.somethingSelected())Ao({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=No(i);Ao({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ca),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Ol.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var a=Ro(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Ol.text.join("\n");var s=document.activeElement;va(l),setTimeout(function(){i.display.lineSpace.removeChild(a),s.focus(),s==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;Po(o,i.options.spellcheck),Pa(o,"paste",function(e){Ee(i,e)||Eo(e,i)||Jo<=11&&setTimeout(fn(i,function(){return r.updateFromDOM()}),20)}),Pa(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),Pa(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),Pa(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),Pa(o,"touchstart",function(){return n.forceCompositionEnd()}),Pa(o,"input",function(){r.composing||r.readFromDOMSoon()}),Pa(o,"copy",t),Pa(o,"cut",t)},El.prototype.prepareSelection=function(){var e=Mr(this.cm,!1);return e.focus=this.cm.state.focused,e},El.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},El.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=Ho(this.cm,e.anchorNode,e.anchorOffset),n=Ho(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=B(q(r,n),t.from())||0!=B(W(r,n),t.to())){var i=Do(this.cm,t.from()),o=Do(this.cm,t.to());if(!i&&!o)return void e.removeAllRanges();var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};var u;try{u=ha(i.node,i.offset,o.offset,o.node)}catch(e){}u&&(!$o&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||(e.removeAllRanges(),e.addRange(u))):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):$o&&this.startGracePeriod()),this.rememberSelection()}},El.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},El.prototype.showMultipleSelections=function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},El.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},El.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},El.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},El.prototype.blur=function(){this.div.blur()},El.prototype.getField=function(){return this.div},El.prototype.supportsTouch=function(){return!0},El.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():un(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},El.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},El.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(la&&ta&&this.cm.options.gutters.length&&Wo(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Ho(t,e.anchorNode,e.anchorOffset),n=Ho(t,e.focusNode,e.focusOffset);r&&n&&un(t,function(){di(t.doc,In(r,n),Ca),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},El.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=R(n.line-1,L(e.doc,n.line-1).length)),i.ch==L(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=R(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=Sr(e,n.line))?(a=E(t.view[0].line),l=t.view[0].node):(a=E(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Sr(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=E(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var f=e.doc.splitLines(Fo(e,l,c,a,s)),d=T(e.doc,R(a,0),R(s,L(e.doc,s).text.length));f.length>1&&d.length>1;)if(m(f)==m(d))f.pop(),d.pop(),s--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var h=0,p=0,g=f[0],v=d[0],y=Math.min(g.length,v.length);h<y&&g.charCodeAt(h)==v.charCodeAt(h);)++h;for(var b=m(f),x=m(d),w=Math.min(b.length-(1==f.length?h:0),x.length-(1==d.length?h:0));p<w&&b.charCodeAt(b.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(1==f.length&&1==d.length&&a==n.line)for(;h&&h>n.ch&&b.charCodeAt(b.length-p-1)==x.charCodeAt(x.length-p-1);)h--,p++;f[f.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var k=R(a,h),C=R(s,d.length?m(d).length-p:0);return f.length>1||f[0]||B(k,C)?(Ti(e.doc,f,k,C,"+input"),!0):void 0},El.prototype.ensurePolled=function(){this.forceCompositionEnd()},El.prototype.reset=function(){this.forceCompositionEnd()},El.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},El.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},El.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||un(this.cm,function(){return pn(e.cm)})},El.prototype.setUneditable=function(e){e.contentEditable="false"},El.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||fn(this.cm,Oo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},El.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},El.prototype.onContextMenu=function(){},El.prototype.resetPosition=function(){},El.prototype.needsContentAttribute=!0;var Il=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ya,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Il.prototype.init=function(e){function t(e){if(!Ee(i,e)){if(i.somethingSelected())Ao({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=Ol.text.join("\n"),va(a));else{if(!i.options.lineWiseCopyCut)return;var t=No(i);Ao({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ca):(n.prevInput="",a.value=t.text.join("\n"),va(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Ro(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),aa&&(a.style.width="0px"),Pa(a,"input",function(){Qo&&Jo>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Pa(a,"paste",function(e){Ee(i,e)||Eo(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Pa(a,"cut",t),Pa(a,"copy",t),Pa(e.scroller,"paste",function(t){Dt(e,t)||Ee(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Pa(e.lineSpace,"selectstart",function(t){Dt(e,t)||Re(t)}),Pa(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Pa(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Il.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mr(e);if(e.options.moveInputWithCursor){var i=ur(e,r.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},Il.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Il.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Da&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&va(this.textarea),Qo&&Jo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",Qo&&Jo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Il.prototype.getField=function(){return this.textarea},Il.prototype.supportsTouch=function(){return!1},Il.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!sa||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},Il.prototype.blur=function(){this.textarea.blur()},Il.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Il.prototype.receivedFocus=function(){this.slowPoll()},Il.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Il.prototype.fastPoll=function(){function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Il.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||za(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(Qo&&Jo>=9&&this.hasSelection===i||ca&&/[\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 a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return un(t,function(){Oo(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Il.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Il.prototype.onKeyPress=function(){Qo&&Jo>=9&&(this.hasSelection=null),this.fastPoll()},Il.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t=""+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=u,a.style.cssText=c,Qo&&Jo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!Qo||Qo&&Jo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&""==n.prevInput?fn(i,xi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=Cr(i,e),s=o.scroller.scrollTop;if(l&&!ra){i.options.resetSelectionOnContextMenu&&i.doc.sel.contains(l)==-1&&fn(i,di)(i.doc,In(l),Ca);var c=a.style.cssText,u=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(Qo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var d;if(Zo&&(d=window.scrollY),o.input.focus(),Zo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Qo&&Jo>=9&&t(),ma){De(e);var h=function(){Ae(window,"mouseup",h),setTimeout(r,20)};Pa(window,"mouseup",h)}else setTimeout(r,50)}},Il.prototype.readOnlyChanged=function(e){e||this.reset()},Il.prototype.setUneditable=function(){},Il.prototype.needsContentAttribute=!1,function(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Ml&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Ml,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Dn(e)},!0),t("indentUnit",2,Dn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Wn(e),ir(e),pn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(R(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ti(e.doc,t,r[i],R(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ml&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",sa?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!fa),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){ko(e),Co(e)},!0),t("keyMap","default",function(e,t,r){var n=Zi(t),i=r!=Ml&&Zi(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,_o,!0),t("gutters",[],function(e){On(e.options),Co(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?xr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Ur(e)},!0),t("scrollbarStyle","native",function(e){$r(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){On(e.options),Co(e)},!0),t("firstLineNumber",1,Co,!0),t("lineNumberFormatter",function(e){return e},Co,!0),t("showCursorWhenSelecting",!1,_r,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Nr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,So),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,_r,!0),t("singleCursorHeightPerLine",!0,_r,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Wn,!0),t("addModeClass",!1,Wn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Wn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Mo),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&fn(this,t[e])(this,r,i),Oe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Zi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:dn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,pn(this)}),removeOverlay:dn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void pn(t)}}),indentLine:dn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),N(this.doc,e)&&To(this,e,t,r)}),indentSelection:dn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(To(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Zr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)To(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&u[i].from().ch>0&&si(t.doc,i,new ol(a,u[i].to()),Ca)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,R(e),t,!0)},getTokenTypeAt:function(e){e=H(this.doc,e);var t,r=Ze(this,L(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,n)&&d(i,u.val)==-1&&i.push(u.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=F(r,null==e?r.first+r.size-1:e),et(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?H(this.doc,e):e?n.from():n.to(),ur(this,r,t||"page")},charCoords:function(e,t){return cr(this,H(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sr(this,e,t||"page"),hr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sr(this,{top:e,left:0},t||"page").top,I(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=L(this.doc,e)}else n=e;return lr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ye(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return yr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ur(this,H(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Yr(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:dn(co),triggerOnKeyPress:dn(ho),triggerOnKeyUp:fo,execCommand:function(e){if(Cl.hasOwnProperty(e))return Cl[e].call(null,this)},triggerElectric:dn(function(e){Io(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=H(this.doc,e),l=0;l<t&&(a=Bo(i.doc,a,o,r,n),!a.hitSide);++l);return a},moveH:dn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Bo(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},_a)}),deleteH:dn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):eo(this,function(r){var i=Bo(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,a=n;t<0&&(o=-1,t=-t);for(var l=H(this.doc,e),s=0;s<t;++s){var c=ur(i,l,"div");if(null==a?a=c.left:c.left=a,l=zo(i,c,o,r),l.hitSide)break}return l},moveV:dn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=ur(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=zo(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Jr(r,null,cr(r,s,"div").top-l.top),s},_a),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=L(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=r.length||!n?++i:--n;for(var a=r.charAt(n),l=w(a,o)?function(e){return w(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!w(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new ol(R(e.line,n),R(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?l(this.display.cursorDiv,"CodeMirror-overwrite"):ga(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==a()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:dn(function(e,t){null==e&&null==t||en(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ht(this)-this.display.barHeight,width:e.scrollWidth-Ht(this)-this.display.barWidth,clientHeight:Kt(this),clientWidth:jt(this)}},scrollIntoView:dn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:R(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)en(this),this.curOp.scrollToPos=e;else{var r=Qr(this,{left:Math.min(e.from.left,e.to.left),top:Math.min(e.from.top,e.to.top)-e.margin,right:Math.max(e.from.right,e.to.right),bottom:Math.max(e.from.bottom,e.to.bottom)+e.margin});this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:dn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&nr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(e){return un(this,e)},refresh:dn(function(){var e=this.display.cachedTextHeight;pn(this),this.curOp.forceUpdate=!0,ir(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),Ln(this),(null==e||Math.abs(e-vr(this.display))>.5)&&kr(this),Oe(this,"refresh",this)}),
|
6 |
+
swapDoc:dn(function(e){var t=this.doc;return t.cm=null,jn(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,t),t}),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}},Pe(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Mo);var Nl="iter insert remove copy getEditor constructor".split(" ");for(var Pl in hl.prototype)hl.prototype.hasOwnProperty(Pl)&&d(Nl,Pl)<0&&(Mo.prototype[Pl]=function(e){return function(){return e.apply(this.doc,arguments)}}(hl.prototype[Pl]));return Pe(hl),Mo.inputStyles={textarea:Il,contenteditable:El},Mo.defineMode=function(e){Mo.defaults.mode||"null"==e||(Mo.defaults.mode=e),Ke.apply(this,arguments)},Mo.defineMIME=Ue,Mo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Mo.defineMIME("text/plain","null"),Mo.defineExtension=function(e,t){Mo.prototype[e]=t},Mo.defineDocExtension=function(e,t){hl.prototype[e]=t},Mo.fromTextArea=Ko,function(e){e.off=Ae,e.on=Pa,e.wheelEventPixels=Hr,e.Doc=hl,e.splitLines=Ba,e.countColumn=f,e.findColumn=h,e.isWordChar=x,e.Pass=ka,e.signal=Oe,e.Line=Ka,e.changeEnd=Nn,e.scrollbarModel=tl,e.Pos=R,e.cmpPos=B,e.modes=qa,e.mimeModes=Fa,e.resolveMode=Ve,e.getMode=$e,e.modeExtensions=Ha,e.extendMode=Ge,e.copyState=Xe,e.startState=Qe,e.innerMode=Ye,e.commands=Cl,e.keyMap=xl,e.keyName=Ji,e.isModifierKey=Qi,e.lookupKey=Yi,e.normalizeKeyMap=Xi,e.StringStream=ja,e.SharedTextMarker=fl,e.TextMarker=ul,e.LineWidget=sl,e.e_preventDefault=Re,e.e_stopPropagation=Be,e.e_stop=De,e.addClass=l,e.contains=o,e.rmClass=ga,e.keyNames=gl}(Mo),Mo.version="5.25.0",Mo}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";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},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(M=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,M=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return M="equals",null;if("<"==r){t.tokenize=o,t.state=h,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function d(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;f(e)}}function h(e,t,r){return"openTag"==e?(r.tagStart=t.column(),p):"closeTag"==e?m:h}function p(e,t,r){return"word"==e?(r.tagName=t.current(),L="tag",y):(L="error",p)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&f(r),r.context&&r.context.tagName==n||C.matchClosing===!1?(L="tag",g):(L="tag error",v)}return L="error",v}function g(e,t,r){return"endTag"!=e?(L="error",g):(f(r),h)}function v(e,t,r){return L="error",g(e,t,r)}function y(e,t,r){if("word"==e)return L="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?d(r,n):(d(r,n),r.context=new u(r,n,i==r.indented)),h}return L="error",y}function b(e,t,r){return"equals"==e?x:(C.allowMissing||(L="error"),y(e,t,r))}function x(e,t,r){return"string"==e?w:"word"==e&&C.allowUnquoted?(L="string",y):(L="error",y(e,t,r))}function w(e,t,r){return"string"==e?w:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var _ in S)C[_]=S[_];for(var _ in i)C[_]=i[_];var M,L;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;M=null;var r=t.tokenize(e,t);return(r||M)&&"comment"!=r&&(L=null,t.state=t.state(M||r,e,t),L&&(r="error"==L?r+" error":L)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=C.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return _e=e,Me=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Pe),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(Pe.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(Pe),o("operator","operator",e.current());if(Ie.test(n)){e.eatWhile(Ie);var a=e.current(),u=Ne.propertyIsEnumerable(a)&&Ne[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Ae&&"@"==t.peek()&&t.match(Re))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ee){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=Be.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ie.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function f(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function h(e,t,r,n,i){var o=e.cc;for(De.state=e,De.stream=i,De.marked=null,De.cc=o,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():Oe?C:k)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return De.marked?De.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function m(){return p.apply(null,arguments),!0}function g(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=De.state;if(De.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=We}function y(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function b(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new f(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?m():";"==e?p():m(t)}return t}function k(e,t){return"var"==e?m(b("vardef",t.length),J,w(";"),x):"keyword a"==e?m(b("form"),_,k,x):"keyword b"==e?m(b("form"),k,x):"{"==e?m(b("}"),U,x):";"==e?m():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==x&&De.state.cc.pop()(),m(b("form"),_,k,x,ne)):"function"==e?m(ce):"for"==e?m(b("form"),ie,k,x):"variable"==e?m(b("stat"),D):"switch"==e?m(b("form"),_,b("}","switch"),w("{"),U,x,x):"case"==e?m(C,w(":")):"default"==e?m(w(":")):"catch"==e?m(b("form"),v,w("("),ue,w(")"),k,x,y):"class"==e?m(b("form"),de,x):"export"==e?m(b("stat"),ge,x):"import"==e?m(b("stat"),ye,x):"module"==e?m(b("form"),Z,b("}"),w("{"),U,x,x):"type"==e?m($,w("operator"),$,w(";")):"async"==e?m(k):p(b("stat"),C,w(";"),x)}function C(e){return M(e,!1)}function S(e){return M(e,!0)}function _(e){return"("!=e?p():m(b(")"),C,w(")"),x)}function M(e,t){if(De.state.fatArrowAt==De.stream.start){var r=t?P:N;if("("==e)return m(v,b(")"),j(Z,")"),x,w("=>"),r,y);if("variable"==e)return p(v,Z,w("=>"),r,y)}var n=t?O:A;return ze.hasOwnProperty(e)?m(n):"function"==e?m(ce,n):"class"==e?m(b("form"),fe,x):"keyword c"==e||"async"==e?m(t?T:L):"("==e?m(b(")"),L,w(")"),x,n):"operator"==e||"spread"==e?m(t?S:C):"["==e?m(b("]"),Ce,x,n):"{"==e?K(q,"}",null,n):"quasi"==e?p(E,n):"new"==e?m(R(t)):m()}function L(e){return e.match(/[;\}\)\],]/)?p():p(C)}function T(e){return e.match(/[;\}\)\],]/)?p():p(S)}function A(e,t){return","==e?m(C):O(e,t,!1)}function O(e,t,r){var n=0==r?A:O,i=0==r?C:S;return"=>"==e?m(v,r?P:N,y):"operator"==e?/\+\+|--/.test(t)?m(n):"?"==t?m(C,w(":"),i):m(i):"quasi"==e?p(E,n):";"!=e?"("==e?K(S,")","call",n):"."==e?m(W,n):"["==e?m(b("]"),L,w("]"),x,n):void 0:void 0}function E(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?m(E):m(C,I)}function I(e){if("}"==e)return De.marked="string-2",De.state.tokenize=c,m(E)}function N(e){return u(De.stream,De.state),p("{"==e?k:C)}function P(e){return u(De.stream,De.state),p("{"==e?k:S)}function R(e){return function(t){return"."==t?m(e?z:B):p(e?S:C)}}function B(e,t){if("target"==t)return De.marked="keyword",m(A)}function z(e,t){if("target"==t)return De.marked="keyword",m(O)}function D(e){return":"==e?m(x,k):p(A,w(";"),x)}function W(e){if("variable"==e)return De.marked="property",m()}function q(e,t){return"async"==e?(De.marked="property",m(q)):"variable"==e||"keyword"==De.style?(De.marked="property",m("get"==t||"set"==t?F:H)):"number"==e||"string"==e?(De.marked=Ae?"property":De.style+" property",m(H)):"jsonld-keyword"==e?m(H):"modifier"==e?m(q):"["==e?m(C,w("]"),H):"spread"==e?m(C):":"==e?p(H):void 0}function F(e){return"variable"!=e?p(H):(De.marked="property",m(ce))}function H(e){return":"==e?m(S):"("==e?p(ce):void 0}function j(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=De.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(r,n){return r==t||n==t?p():p(e)},n)}return i==t||o==t?m():m(w(t))}return function(r,i){return r==t||i==t?m():p(e,n)}}function K(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return m(b(t,r),j(e,t),x)}function U(e){return"}"==e?m():p(k,U)}function V(e,t){if(Ee){if(":"==e)return m($);if("?"==t)return m(V)}}function $(e){return"variable"==e?(De.marked="variable-3",m(Q)):"string"==e||"number"==e||"atom"==e?m(Q):"{"==e?m(b("}"),j(X,"}",",;"),x):"("==e?m(j(Y,")"),G):void 0}function G(e){if("=>"==e)return m($)}function X(e,t){return"variable"==e||"keyword"==De.style?(De.marked="property",m(X)):"?"==t?m(X):":"==e?m($):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m($):void 0}function Q(e,t){return"<"==t?m(b(">"),j($,">"),x,Q):"|"==t||"."==e?m($):"["==e?m(w("]"),Q):void 0}function J(){return p(Z,V,te,re)}function Z(e,t){return"modifier"==e?m(Z):"variable"==e?(g(t),m()):"spread"==e?m(Z):"["==e?K(Z,"]"):"{"==e?K(ee,"}"):void 0}function ee(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?m(Z):"}"==e?p():m(w(":"),Z,te)):(g(t),m(te))}function te(e,t){if("="==t)return m(S)}function re(e){if(","==e)return m(J)}function ne(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),k,x)}function ie(e){if("("==e)return m(b(")"),oe,w(")"),x)}function oe(e){return"var"==e?m(J,w(";"),le):";"==e?m(le):"variable"==e?m(ae):p(C,w(";"),le)}function ae(e,t){return"in"==t||"of"==t?(De.marked="keyword",m(C)):m(A,le)}function le(e,t){return";"==e?m(se):"in"==t||"of"==t?(De.marked="keyword",m(C)):p(C,w(";"),se)}function se(e){")"!=e&&m(C)}function ce(e,t){return"*"==t?(De.marked="keyword",m(ce)):"variable"==e?(g(t),m(ce)):"("==e?m(v,b(")"),j(ue,")"),x,V,k,y):void 0}function ue(e){return"spread"==e?m(ue):p(Z,V,te)}function fe(e,t){return"variable"==e?de(e,t):he(e,t)}function de(e,t){if("variable"==e)return g(t),m(he)}function he(e,t){return"<"==t?m(b(">"),j($,">"),x,he):"extends"==t||"implements"==t||Ee&&","==e?m(Ee?$:C,he):"{"==e?m(b("}"),pe,x):void 0}function pe(e,t){return"variable"==e||"keyword"==De.style?("async"==t||"static"==t||"get"==t||"set"==t||Ee&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",m(pe)):(De.marked="property",m(Ee?me:ce,pe)):"["==e?m(C,w("]"),Ee?me:ce,pe):"*"==t?(De.marked="keyword",m(pe)):";"==e?m(pe):"}"==e?m():void 0}function me(e,t){return"?"==t?m(me):":"==e?m($,te):"="==t?m(S):p(ce)}function ge(e,t){return"*"==t?(De.marked="keyword",m(ke,w(";"))):"default"==t?(De.marked="keyword",m(C,w(";"))):"{"==e?m(j(ve,"}"),ke,w(";")):p(k)}function ve(e,t){return"as"==t?(De.marked="keyword",m(w("variable"))):"variable"==e?p(S,ve):void 0}function ye(e){return"string"==e?m():p(be,xe,ke)}function be(e,t){return"{"==e?K(be,"}"):("variable"==e&&g(t),"*"==t&&(De.marked="keyword"),m(we))}function xe(e){if(","==e)return m(be,xe)}function we(e,t){if("as"==t)return De.marked="keyword",m(be)}function ke(e,t){if("from"==t)return De.marked="keyword",m(C)}function Ce(e){return"]"==e?m():p(j(S,"]"))}function Se(e,t){return"operator"==e.lastType||","==e.lastType||Pe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var _e,Me,Le=r.indentUnit,Te=n.statementIndent,Ae=n.jsonld,Oe=n.json||Ae,Ee=n.typescript,Ie=n.wordCharacters||/[\w$\xa1-\uffff]/,Ne=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(Ee){var l={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Pe=/[+\-*&%=<>!?|~^]/,Re=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Be="([{}])",ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},We={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new f((e||0)-Le,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==_e?r:(t.lastType="operator"!=_e||"++"!=Me&&"--"!=Me?_e:"incdec",h(t,r,_e,Me,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==x)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==A||i==O)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Te&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,d=o==f;return"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==f&&"{"==o?l.indented:"form"==f?l.indented+Le:"stat"==f?l.indented+(Se(t,r)?Te||Le:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:Le):l.indented+(/^(?:case|default)\b/.test(r)?Le:2*Le)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Oe?null:"/*",blockCommentEnd:Oe?null:"*/",lineComment:Oe?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Oe?"json":"javascript",jsonldMode:Ae,jsonMode:Oe,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return p=t,e}function i(e,t){var r=e.next();if(v[r]){var i=v[r](e,t);if(i!==!1)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return E[r.context.type](e,t,r)}function f(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function d(e){var t=e.current().toLowerCase();m=L.hasOwnProperty(t)?"atom":M.hasOwnProperty(t)?"keyword":"variable"}var h=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},x=r.mediaFeatures||{},w=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},_=r.counterDescriptors||{},M=r.colorKeywords||{},L=r.valueKeywords||{},T=r.allowNested,A=r.lineComment,O=r.supportsAtComponent===!0,E={};return E.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(O&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return s(r,t,"parens")}return r.context.type},E.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(m="property","maybeprop"):C.hasOwnProperty(n)?(m="string-2","maybeprop"):T?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?E.top(e,t,r):(m="error","block")},E.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},E.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&T)return s(r,t,"propBlock");if("}"==e||"{"==e)return f(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return s(r,t,"interpolation")}else m+=" error";return"prop"},E.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(m="property","maybeprop"):r.context.type},E.parens=function(e,t,r){return"{"==e||"}"==e?f(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&d(t),"parens")},E.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):u(e,t,r)},E.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):E.atBlock(e,t,r)},E.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return f(e,t,r);if("{"==e)return c(r)&&s(r,t,T?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":x.hasOwnProperty(n)?"property":w.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":L.hasOwnProperty(n)?"atom":M.hasOwnProperty(n)?"keyword":"error"}return r.context.type},E.atComponentBlock=function(e,t,r){return"}"==e?f(e,t,r):"{"==e?c(r)&&s(r,t,T?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},E.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?f(e,t,r,2):E.atBlock(e,t,r)},E.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,r)},E.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(m="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!_.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},E.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},E.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?f(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},E.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?f(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),m=r,t.state=E[t.state](p,e,t),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:A,fold:"brace"}})
|
7 |
+
;var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["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"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","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","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","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","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","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-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","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-weight","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","justify-content","left","letter-spacing","line-break","line-height","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","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","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","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","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","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-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","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","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","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"],d=t(f),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["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","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","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","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","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","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],x=t(b),w=["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","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","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","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","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","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","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","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","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","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","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","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","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","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","semi-condensed","semi-expanded","separate","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","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","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","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","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"],k=t(w),C=n.concat(o).concat(l).concat(c).concat(f).concat(h).concat(b).concat(w);e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:y,colorKeywords:x,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:y,colorKeywords:x,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}var l={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"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,o){var l,f=c.token(n,o.htmlState),d=/\btag\b/.test(f);if(d&&!/[<>\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&d&&/>$/.test(n.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==n.current()&&a(u[h[1]],h[2]),m=e.getMode(r,p),g=i(h[1],!0),v=i(h[1],!1);o.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return f}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},f=n&&n.tags,d=n&&n.scriptTypes;if(o(l,u),f&&o(f,u),d)for(var h=d.length-1;h>=0;h--)u.script.unshift(["type",d[h].matches,d[h].mode]);return{startState:function(){return{token:s,inTag:null,localMode:null,localState:null,htmlState:e.startState(c)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.info=n,this.align=i,this.prev=o}function r(e,r,n,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=n&&(o=e.context.indented),e.context=new t(o,r,n,i,null,e.context)}function n(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,r){return"variable"==t.prevToken||"variable-3"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,r))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function l(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}function s(e,t){if(!t.startOfLine)return!1;for(var r,n=null;r=e.peek();){if("\\"==r&&e.match(/^.$/)){n=s;break}if("/"==r&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=n,"meta"}function c(e,t){return"variable-3"==t.prevToken&&"variable-3"}function u(e){return e.eatWhile(/[\w\.']/),"number"}function f(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var r=e.match(/"([^\s\\()]{0,16})\(/);return!!r&&(t.cpp11RawStringDelim=r[1],t.tokenize=p,p(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function d(e){var t=/(\w+)::(\w+)$/.exec(e);return t&&t[1]==t[2]}function h(e,t){for(var r;null!=(r=e.next());)if('"'==r&&!e.eat('"')){t.tokenize=null;break}return"string"}function p(e,t){var r=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+r+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function m(t,r){function n(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];n(r.keywords),n(r.types),n(r.builtin),n(r.atoms),i.length&&(r.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],r)}function g(e,t){for(var r=!1;!e.eol();){if(!r&&e.match('"""')){t.tokenize=null;break}r="\\"==e.next()&&!r}return"string"}function v(e){return function(t,r){for(var n,i=!1,o=!1;!t.eol();){if(!e&&!i&&t.match('"')){o=!0;break}if(e&&t.match('"""')){o=!0;break}n=t.next(),!i&&"$"==n&&t.match("{")&&t.skipTo("}"),i=!i&&"\\"==n&&!e}return!o&&e||(r.tokenize=null),"string"}}function y(e){return function(t,r){for(var n,i=!1,o=!1;!t.eol();){if(!i&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!i&&t.match("``")){w=y(e),o=!0;break}n=t.next(),i="single"==e&&!i&&"\\"==n}return o&&(r.tokenize=null),"string"}}e.defineMode("clike",function(a,s){function c(e,t){var r=e.next();if(S[r]){var n=S[r](e,t);if(n!==!1)return n}if('"'==r||"'"==r)return t.tokenize=u(r),t.tokenize(e,t);if(A.test(r))return h=r,null;if(O.test(r)){if(e.backUp(1),e.match(E))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=f,f(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(I.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(I););return"operator"}if(e.eatWhile(/[\w\$_\xa1-\uffff]/),T)for(;e.match(T);)e.eatWhile(/[\w\$_\xa1-\uffff]/);var i=e.current();return l(y,i)?(l(w,i)&&(h="newstatement"),l(k,i)&&(p=!0),"keyword"):l(b,i)?"variable-3":l(x,i)?(l(w,i)&&(h="newstatement"),"builtin"):l(C,i)?"atom":"variable"}function u(e){return function(t,r){for(var n,i=!1,o=!1;null!=(n=t.next());){if(n==e&&!i){o=!0;break}i=!i&&"\\"==n}return(o||!i&&!_)&&(r.tokenize=null),"string"}}function f(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function d(e,t){s.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}var h,p,m=a.indentUnit,g=s.statementIndentUnit||m,v=s.dontAlignCalls,y=s.keywords||{},b=s.types||{},x=s.builtin||{},w=s.blockKeywords||{},k=s.defKeywords||{},C=s.atoms||{},S=s.hooks||{},_=s.multiLineStrings,M=s.indentStatements!==!1,L=s.indentSwitch!==!1,T=s.namespaceSeparator,A=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,O=s.numberStart||/[\d\.]/,E=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,I=s.isOperatorChar||/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new t((e||0)-m,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return d(e,t),null;h=p=null;var l=(t.tokenize||c)(e,t);if("comment"==l||"meta"==l)return l;if(null==a.align&&(a.align=!0),";"==h||":"==h||","==h&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)n(t);else if("{"==h)r(t,e.column(),"}");else if("["==h)r(t,e.column(),"]");else if("("==h)r(t,e.column(),")");else if("}"==h){for(;"statement"==a.type;)a=n(t);for("}"==a.type&&(a=n(t));"statement"==a.type;)a=n(t)}else h==a.type?n(t):M&&(("}"==a.type||"top"==a.type)&&";"!=h||"statement"==a.type&&"newstatement"==h)&&r(t,e.column(),"statement",e.current());if("variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),S.token){var u=S.token(e,t,l);void 0!==u&&(l=u)}return"def"==l&&s.styleDefs===!1&&(l="variable"),t.startOfLine=!1,t.prevToken=p?"def":l||h,d(e,t),l},indent:function(t,r){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var n=t.context,i=r&&r.charAt(0);if("statement"==n.type&&"}"==i&&(n=n.prev),s.dontIndentStatements)for(;"statement"==n.type&&s.dontIndentStatements.test(n.info);)n=n.prev;if(S.indent){var o=S.indent(t,n,r);if("number"==typeof o)return o}var a=i==n.type,l=n.prev&&"switch"==n.prev.info;if(s.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=n.type&&"}"!=n.type;)n=n.prev;return n.indented}return"statement"==n.type?n.indented+("{"==i?0:g):!n.align||v&&")"==n.type?")"!=n.type||a?n.indented+(a?0:m)+(a||!l||/^(?:case|default)\b/.test(r)?0:m):n.indented+g:n.column+(a?0:1)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",x="int long char short double float unsigned signed void size_t ptrdiff_t";m(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),types:a(x+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:a("case do else for if switch while struct"),defKeywords:a("struct"),typeFirstDefinitions:!0,atoms:a("null true false"),hooks:{"#":s,"*":c},modeProps:{fold:["brace","include"]}}),m(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:a(x+" bool wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),defKeywords:a("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:a("true false null"),dontIndentStatements:/^template$/,hooks:{"#":s,"*":c,u:f,U:f,L:f,R:f,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,r){if("variable"==r&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&d(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),m("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface package enum @interface"),typeFirstDefinitions:!0,atoms:a("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),m("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=h,h(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),m("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class do else finally for forSome if match switch try while"),defKeywords:a("class def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,r){var n=r.context
|
8 |
+
;return!("}"!=n.type||!n.align||!e.eat(">"))&&(r.context=new t(n.indented,n.column,n.type,n.info,null,n.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),m("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object package interface fun"),atoms:a("true false null this"),hooks:{'"':function(e,t){return t.tokenize=v(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),m(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":s},modeProps:{fold:["brace","include"]}}),m("text/x-nesc",{name:"clike",keywords:a(b+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:a(x),blockKeywords:a("case do else for if switch while struct"),atoms:a("null true false"),hooks:{"#":s},modeProps:{fold:["brace","include"]}}),m("text/x-objectivec",{name:"clike",keywords:a(b+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:a(x),atoms:a("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":s,indent:function(e,t,r){if("statement"==t.type&&/^@\w/.test(r))return t.indented}},modeProps:{fold:"brace"}}),m("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:a(x),blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":s},modeProps:{fold:["brace","include"]}});var w=null;m("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=y(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!w||!e.match("`"))&&(t.tokenize=w,w=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,r){if(("variable"==r||"variable-3"==r)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function r(e,t,i){return 0==e.length?n(t):function(o,a){for(var l=e[0],s=0;s<l.length;s++)if(o.match(l[s][0]))return a.tokenize=r(e.slice(1),t),l[s][1];return a.tokenize=n(t,i),"string"}}function n(e,t){return function(r,n){return i(r,n,e,t)}}function i(e,t,n,i){if(i!==!1&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(i!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=r([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],n,i)),e.match(/\-\>\w/,!1)&&(t.tokenize=r([[["->",null]],[[/[\w]+/,"variable"]]],n,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(n)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var r;if(r=e.match(/<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(r[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=n(o,"'"!=i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=n('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=n(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,r){function n(t,r){var n=r.curMode==o;if(t.sol()&&r.pending&&'"'!=r.pending&&"'"!=r.pending&&(r.pending=null),n)return n&&null==r.php.tokenize&&t.match("?>")?(r.curMode=i,r.curState=r.html,r.php.context.prev||(r.php=null),"meta"):o.token(t,r.curState);if(t.match(/^<\?\w*/))return r.curMode=o,r.php||(r.php=e.startState(o,i.indent(r.html,""))),r.curState=r.php,"meta";if('"'==r.pending||"'"==r.pending){for(;!t.eol()&&t.next()!=r.pending;);var a="string"}else if(r.pending&&t.pos<r.pending.end){t.pos=r.pending.end;var a=r.pending.style}else var a=i.token(t,r.curState);r.pending&&(r.pending=null);var l,s=t.current(),c=s.search(/<\?/);return c!=-1&&("string"==a&&(l=s.match(/[\'\"]$/))&&!/\?>/.test(s)?r.pending=l[0]:r.pending={end:t.pos,style:a},t.backUp(s.length-c)),a}var i=e.getMode(t,"text/html"),o=e.getMode(t,s);return{startState:function(){var t=e.startState(i),n=r.startOpen?e.startState(o):null;return{html:t,php:n,curMode:r.startOpen?o:i,curState:r.startOpen?n:t,pending:null}},copyState:function(t){var r,n=t.html,a=e.copyState(i,n),l=t.php,s=l&&e.copyState(o,l);return r=t.curMode==i?a:s,{html:a,php:s,curMode:t.curMode,curState:r,pending:t.pending}},token:n,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={allowUnquoted:!0,allowMissing:!0,caseFold:!0};e.defineMode("shortcode",function(e,r){function n(e,t){return"["===e.next()?"["===e.peek()?(t.tokenize=i,"comment"):/\s/.test(e.peek())?null:(C=e.eat("/")?"closeTag":"openTag",t.tokenize=o,"tag bracket"):(e.eatWhile(/[^\[]/),null)}function i(e,t){var r=function(e,t){return e.next(),t.tokenize=n,"comment"};return r.isInEscape=!0,"]"===e.next()&&"]"===e.peek()&&(t.tokenize=r),e.eatWhile(/[^\]]/),null}function o(e,t){var r=e.next();if("]"===r||"/"===r&&e.eat("]"))return t.tokenize=n,C="endTag","tag bracket";if("="===r)return C="equals",null;if("["===r){t.tokenize=n,t.state=c,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=a(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=\[\]\"\']*[^\s\u00a0=\[\]\"\'\/]/),"word")}function a(e){var t=function(t,r){var n=t.next();return n===e?(r.tokenize=o,"string"):/[\[\]]/.test(n)?"string error":(t.eatWhile(/[^\[\]\'\"]/),"string")};return t.isInAttribute=!0,t}function l(e,t,r){this.tagHistory=[t],e.context&&(this.tagHistory=this.tagHistory.concat(e.context.tagHistory)),this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r}function s(e){e.context&&(e.context=e.context.prev)}function c(e,t,r){return"openTag"===e?(r.tagStart=t.column(),u):"closeTag"===e?f:c}function u(e,t,r){if("word"===e){var n=t.current();return/[\[\]\/\'\"<>&]/.test(n)?S="error":(r.tagName=t.current(),S="tag"),p}return S="error",u}function f(e,t,r){if("word"===e){var n=t.current();if(r.context&&r.context.tagName===n||b.matchClosing===!1)return S="tag",d;if(r.context&&r.context.tagHistory.indexOf(n)>0){for(var i=r.context.tagHistory.indexOf(n),o=0;o<i;o++)s(r);return S="tag",d}return S="tag error",h}return S="error",h}function d(e,t,r){return"endTag"!==e?(S="error",d):(s(r),c)}function h(e,t,r){return S="error",d(e,t,r)}function p(e,t,r){if("word"===e)return S=/^[a-z0-9_\-]+$/i.test(t.current())?"attribute":"error",m;if("endTag"===e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,r.context=new l(r,n,i===r.indented),c}return S="error",p}function m(e,t,r){return"equals"===e?g:(b.allowMissing||(S="error"),p(e,t,r))}function g(e,t,r){return"string"===e?v:"word"===e&&b.allowUnquoted?(S="string",p):(S="error",p(e,t,r))}function v(e,t,r){return"string"===e?v:p(e,t,r)}var y=e.indentUnit,b={},x=t;for(var w in x)b[w]=x[w];for(var k in r)b[k]=r[k];var C,S;return n.isInText=!0,i.isInEscape=!0,{startState:function(e){var t={tokenize:n,state:c,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;C=null;var r=t.tokenize(e,t);return(r||C)&&"comment"!==r&&(S=null,t.state=t.state(C||r,e,t),S&&(r="error"===S?r+" error":S)),r},indent:function(e,t,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart===e.indented?e.stringStartCol+1:e.indented+y;if(e.tokenize!==o&&e.tokenize!==n)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return b.multilineTagIndentPastTag!==!1?e.tagStart+e.tagName.length+2:e.tagStart+y*(b.multilineTagIndentFactor||1);var a=t&&/^\[(\/)?([\w_:\.-]*)/.exec(t);if(a&&a[1])for(;i;){if(i.tagName===a[2]){i=i.prev;break}break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+y:e.baseIndent||0},skipAttribute:function(e){e.state===g&&(e.state=p)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("wordpresspost",function(t,r){function n(e,t){t.isInShortcode=!0;var r=l.token(e,t.shortcodeState),n=t.shortcodeState.tokenize.isInText,o=t.shortcodeState.tokenize.isInEscape;if(n)t.token=i;else if(o&&/\]/.test(e.current())){var a=e.current(),s=a.search(/\]/);e.backUp(a.length-s-1),"]"!==e.peek()&&(t.token=i)}return r}function i(e,t){t.isInShortcode=!1;var r=a.token(e,t.htmlmixedState),i=t.htmlmixedState.htmlState.tokenize.isInText;if(i&&/\[/.test(e.current())&&!t.htmlmixedState.localState&&null===r){var s=e.current(),c=s.search(/\[/);e.backUp(s.length-c),null==t.shortcodeState&&(t.shortcodeState=l.startState(a.indent(t.htmlmixedState,""))),t.token=n}else i&&/<!\-\-more|<!\-\-(noteaser|nextpage)\-\->?/.test(e.current())&&!t.htmlmixedState.localState&&"comment"===r&&(e.backUp(e.current().length),t.token=o);return r}function o(e,t){return e.match("<!--more")?"meta":e.match("-->")||e.match("<!--noteaser-->")||e.match("<!--nextpage-->")?(t.token=i,"meta"):(e.eatWhile(/[^\-\/]/),"string")}var a=e.getMode(t,{name:"htmlmixed",multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),l=e.getMode(t,{name:"shortcode",multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag});return{startState:function(){return{token:i,isInShortcode:!1,shortcodeState:null,htmlmixedState:a.startState()}},copyState:function(t){var r;return t.shortcodeState&&(r=e.copyState(l,t.shortcodeState)),{token:t.token,shortcodeState:r,htmlmixedState:e.copyState(a,t.htmlmixedState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return t.isInShortcode?t.isInShortcode?l.indent(t.shortcodeState,r):e.Pass:a.indent(t.htmlmixedState,r)},innerMode:function(e){return e.isInShortcode?{state:e.shortcodeState,mode:l}:{state:e.htmlmixedState,mode:a}}}},"htmlmixed","shortcode")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a),e.removeLineClass(e.state.activeLines[t],"gutter",l)}function r(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function n(e,n){for(var i=[],s=0;s<n.length;s++){var c=n[s],u=e.getOption("styleActiveLine");if("object"==typeof u&&u.nonEmpty?c.anchor.line==c.head.line:c.empty()){var f=e.getLineHandleVisualStart(c.head.line);i[i.length-1]!=f&&i.push(f)}}r(e.state.activeLines,i)||e.operation(function(){t(e);for(var r=0;r<i.length;r++)e.addLineClass(i[r],"wrap",o),e.addLineClass(i[r],"background",a),e.addLineClass(i[r],"gutter",l);e.state.activeLines=i})}function i(e,t){n(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background",l="CodeMirror-activeline-gutter";e.defineOption("styleActiveLine",!1,function(r,o,a){var l=a!=e.Init&&a;o!=l&&(l&&(r.off("beforeSelectionChange",i),t(r),delete r.state.activeLines),o&&(r.state.activeLines=[],n(r,r.listSelections()),r.on("beforeSelectionChange",i)))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):n(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(r,i){if(r){t.lastIndex=0;for(var o,a,l=e.getLine(i.line).slice(0,i.ch),s=0;;){t.lastIndex=s;var c=t.exec(l);if(!c)break;if(o=c,a=o.index,(s=o.index+(o[0].length||1))==l.length)break}var u=o&&o[0].length||0;u||(0==a&&0==l.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var l=e.getLine(i.line),o=t.exec(l),u=o&&o[0].length||0,a=o&&o.index;a+u==l.length||u||(u=1)}if(o&&u)return{from:n(i.line,a),to:n(i.line,a+u),match:o}};else{var a=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)t.length?this.matches=function(i,o){if(i){var s=e.getLine(o.line).slice(0,o.ch),c=l(s),u=c.lastIndexOf(t);if(u>-1)return u=r(s,c,u),{from:n(o.line,u),to:n(o.line,u+a.length)}}else{var s=e.getLine(o.line).slice(o.ch),c=l(s),u=c.indexOf(t);if(u>-1)return u=r(s,c,u)+o.ch,{from:n(o.line,u),to:n(o.line,u+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,r){var i=s.length-1;if(t){if(r.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(r.line).slice(0,c[i].length))!=s[s.length-1])return;for(var o=n(r.line,c[i].length),a=r.line-1,u=i-1;u>=1;--u,--a)if(s[u]!=l(e.getLine(a)))return;var f=e.getLine(a),d=f.length-c[0].length;if(l(f.slice(d))!=s[0])return;return{from:n(a,d),to:o}}if(!(r.line+(s.length-1)>e.lastLine())){var f=e.getLine(r.line),d=f.length-c[0].length;if(l(f.slice(d))==s[0]){for(var h=n(r.line,d),a=r.line+1,u=1;u<i;++u,++a)if(s[u]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,c[i].length))==s[i])return{from:h,to:n(a,c[i].length)}}}}}}}function r(e,t,r){if(e.length==t.length)return r;for(var n=Math.min(r,e.length);;){var i=e.slice(0,n).toLowerCase().length;if(i<r)++n;else{if(!(i>r))return n;--n}}}var n=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=n(e,0);return r.pos={from:t,to:t},r.atOccurrence=!1,!1}for(var r=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=n(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=n(i.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,r,n){return new t(this.doc,e,r,n)}),e.defineDocExtension("getSearchCursor",function(e,r,n){return new t(this,e,r,n)}),e.defineExtension("selectMatches",function(t,r){for(var n=[],i=this.getSearchCursor(t,this.getCursor("from"),r);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)n.push({anchor:i.from(),head:i.to()});n.length&&this.setSelections(n,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var r=e.exec(t.string);if(r&&r.index==t.pos)return t.pos+=r[0].length||1,"searching";r?t.pos=r.index:t.skipToEnd()}}}function r(){
|
9 |
+
this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new r)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,r){return e.getSearchCursor(t,r,i(t))}function a(e,t,r,n,i){e.openDialog(t,n,{value:r,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:i})}function l(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0}):i(prompt(r,n))}function s(e,t,r,n){e.openConfirm?e.openConfirm(t,n):confirm(r)&&n[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function u(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch(e){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function f(e,r,n){r.queryText=n,r.query=u(n),e.removeOverlay(r.overlay,i(r.query)),r.overlay=t(r.query,i(r.query)),e.addOverlay(r.overlay),e.showMatchesOnScrollbar&&(r.annotate&&(r.annotate.clear(),r.annotate=null),r.annotate=e.showMatchesOnScrollbar(r.query,i(r.query)))}function d(t,r,i,o){var s=n(t);if(s.query)return h(t,r);var c=t.getSelection()||s.lastQuery;if(i&&t.openDialog){var u=null,d=function(r,n){e.e_stop(n),r&&(r!=s.queryText&&(f(t,s,r),s.posFrom=s.posTo=t.getCursor()),u&&(u.style.opacity=1),h(t,n.shiftKey,function(e,r){var n;r.line<3&&document.querySelector&&(n=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&n.getBoundingClientRect().bottom-4>t.cursorCoords(r,"window").top&&((u=n).style.opacity=.4)}))};a(t,v,c,d,function(r,i){var o=e.keyName(r),a=e.keyMap[t.getOption("keyMap")][o];a||(a=t.getOption("extraKeys")[o]),"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(e.e_stop(r),f(t,n(t),i),t.execCommand(a)):"find"!=a&&"findPersistent"!=a||(e.e_stop(r),d(i,r))}),o&&c&&(f(t,s,c),h(t,r))}else l(t,v,"Search for:",c,function(e){e&&!s.query&&t.operation(function(){f(t,s,e),s.posFrom=s.posTo=t.getCursor(),h(t,r)})})}function h(t,r,i){t.operation(function(){var a=n(t),l=o(t,a.query,r?a.posFrom:a.posTo);(l.find(r)||(l=o(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),l.find(r)))&&(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),a.posFrom=l.from(),a.posTo=l.to(),i&&i(l.from(),l.to()))})}function p(e){e.operation(function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function m(e,t,r){e.operation(function(){for(var n=o(e,t);n.findNext();)if("string"!=typeof t){var i=e.getRange(n.from(),n.to()).match(t);n.replace(r.replace(/\$(\d)/g,function(e,t){return i[t]}))}else n.replace(r)})}function g(e,t){if(!e.getOption("readOnly")){var r=e.getSelection()||n(e).lastQuery,i=t?"Replace all:":"Replace:";l(e,i+y,i,r,function(r){r&&(r=u(r),l(e,b,"Replace with:","",function(n){if(n=c(n),t)m(e,r,n);else{p(e);var i=o(e,r,e.getCursor("from")),a=function(){var t,c=i.from();!(t=i.findNext())&&(i=o(e,r),!(t=i.findNext())||c&&i.from().line==c.line&&i.from().ch==c.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),s(e,x,"Replace?",[function(){l(t)},a,function(){m(e,r,n)}]))},l=function(e){i.replace("string"==typeof r?n:n.replace(/\$(\d)/g,function(t,r){return e[r]})),a()};a()}}))})}}var v='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',y=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',b='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',x="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";e.commands.find=function(e){p(e),d(e)},e.commands.findPersistent=function(e){p(e),d(e,!1,!0)},e.commands.findPersistentNext=function(e){d(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){d(e,!0,!0,!0)},e.commands.findNext=d,e.commands.findPrev=function(e){d(e,!0)},e.commands.clearSearch=p,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r){var n,i=e.getWrapperElement();return n=i.appendChild(document.createElement("div")),n.className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?n.innerHTML=t:n.appendChild(t),n}function r(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(n,i,o){function a(e){if("string"==typeof e)f.value=e;else{if(c)return;c=!0,s.parentNode.removeChild(s),u.focus(),o.onClose&&o.onClose(s)}}o||(o={}),r(this,null);var l,s=t(this,n,o.bottom),c=!1,u=this,f=s.getElementsByTagName("input")[0];return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(e){o.onInput(e,f.value,a)}),o.onKeyUp&&e.on(f,"keyup",function(e){o.onKeyUp(e,f.value,a)}),e.on(f,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t))}),o.closeOnBlur!==!1&&e.on(f,"blur",a)):(l=s.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(l,"blur",a),l.focus()),a}),e.defineExtension("openConfirm",function(n,i,o){function a(){c||(c=!0,l.parentNode.removeChild(l),u.focus())}r(this,null);var l=t(this,n,o&&o.bottom),s=l.getElementsByTagName("button"),c=!1,u=this,f=1;s[0].focus();for(var d=0;d<s.length;++d){var h=s[d];!function(t){e.on(h,"click",function(r){e.e_preventDefault(r),a(),t&&t(u)})}(i[d]),e.on(h,"blur",function(){--f,setTimeout(function(){f<=0&&a()},200)}),e.on(h,"focus",function(){++f})}}),e.defineExtension("openNotification",function(n,i){function o(){s||(s=!0,clearTimeout(a),l.parentNode.removeChild(l))}r(this,o);var a,l=t(this,n,i&&i.bottom),s=!1,c=i&&void 0!==i.duration?i.duration:5e3;return e.on(l,"click",function(t){e.e_preventDefault(t),o()}),c&&(a=setTimeout(o,c)),o})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r,n){function i(t){var r=e.wheelEventPixels(t)["horizontal"==o.orientation?"x":"y"],n=o.pos;o.moveTo(o.pos+r),o.pos!=n&&e.e_preventDefault(t)}this.orientation=r,this.scroll=n,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+r,this.inner=this.node.appendChild(document.createElement("div"));var o=this;e.on(this.inner,"mousedown",function(t){function r(){e.off(document,"mousemove",n),e.off(document,"mouseup",r)}function n(e){if(1!=e.which)return r();o.moveTo(l+(e[i]-a)*(o.total/o.size))}if(1==t.which){e.e_preventDefault(t);var i="horizontal"==o.orientation?"pageX":"pageY",a=t[i],l=o.pos;e.on(document,"mousemove",n),e.on(document,"mouseup",r)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var r,n=o.inner.getBoundingClientRect();r="horizontal"==o.orientation?t.clientX<n.left?-1:t.clientX>n.right?1:0:t.clientY<n.top?-1:t.clientY>n.bottom?1:0,o.moveTo(o.pos+r*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function r(e,r,n){this.addClass=e,this.horiz=new t(e,"horizontal",n),r(this.horiz.node),this.vert=new t(e,"vertical",n),r(this.vert.node),this.width=null}t.prototype.setPos=function(e,t){return e<0&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),!(!t&&e==this.pos)&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",!0)},t.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};t.prototype.update=function(e,t,r){var n=this.screen!=t||this.total!=e||this.size!=r;n&&(this.screen=t,this.total=e,this.size=r);var i=this.screen*(this.size/this.total);i<10&&(this.size-=10-i,i=10),this.inner.style["horizontal"==this.orientation?"width":"height"]=i+"px",this.setPos(this.pos,n)},r.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var r=this.width||0,n=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=n?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(n?r:0)),this.vert.node.style.bottom=n?r+"px":"0"),n&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?r:0)-e.barLeft),this.horiz.node.style.right=i?r+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?r:0,bottom:n?r:0}},r.prototype.setScrollTop=function(e){this.vert.setPos(e)},r.prototype.setScrollLeft=function(e){this.horiz.setPos(e)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(o);return t==-1?0:t}function r(e,t,r){return/\bstring\b/.test(e.getTokenTypeAt(a(t.line,0)))&&!/^[\'\"\`]/.test(r)}function n(e,t){var r=e.getMode();return r.useInnerComments!==!1&&r.innerMode?e.getModeAt(t):r}var i={},o=/[^\s\u00a0]/,a=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=i);for(var t=this,r=1/0,n=this.listSelections(),o=null,l=n.length-1;l>=0;l--){var s=n[l].from(),c=n[l].to();s.line>=r||(c.line>=r&&(c=a(r,0)),r=s.line,null==o?t.uncomment(s,c,e)?o="un":(t.lineComment(s,c,e),o="line"):"un"==o?t.uncomment(s,c,e):t.lineComment(s,c,e))}}),e.defineExtension("lineComment",function(e,l,s){s||(s=i);var c=this,u=n(c,e),f=c.getLine(e.line);if(null!=f&&!r(c,e,f)){var d=s.lineComment||u.lineComment;if(!d)return void((s.blockCommentStart||u.blockCommentStart)&&(s.fullLines=!0,c.blockComment(e,l,s)));var h=Math.min(0!=l.ch||l.line==e.line?l.line+1:l.line,c.lastLine()+1),p=null==s.padding?" ":s.padding,m=s.commentBlankLines||e.line==l.line;c.operation(function(){if(s.indent){for(var r=null,n=e.line;n<h;++n){var i=c.getLine(n),l=i.slice(0,t(i));(null==r||r.length>l.length)&&(r=l)}for(var n=e.line;n<h;++n){var i=c.getLine(n),u=r.length;(m||o.test(i))&&(i.slice(0,u)!=r&&(u=t(i)),c.replaceRange(r+d+p,a(n,0),a(n,u)))}}else for(var n=e.line;n<h;++n)(m||o.test(c.getLine(n)))&&c.replaceRange(d+p,a(n,0))})}}),e.defineExtension("blockComment",function(e,t,r){r||(r=i);var l=this,s=n(l,e),c=r.blockCommentStart||s.blockCommentStart,u=r.blockCommentEnd||s.blockCommentEnd;if(!c||!u)return void((r.lineComment||s.lineComment)&&0!=r.fullLines&&l.lineComment(e,t,r));if(!/\bcomment\b/.test(l.getTokenTypeAt(a(e.line,0)))){var f=Math.min(t.line,l.lastLine());f!=e.line&&0==t.ch&&o.test(l.getLine(f))&&--f;var d=null==r.padding?" ":r.padding;e.line>f||l.operation(function(){if(0!=r.fullLines){var n=o.test(l.getLine(f));l.replaceRange(d+u,a(f)),l.replaceRange(c+d,a(e.line,0));var i=r.blockCommentLead||s.blockCommentLead;if(null!=i)for(var h=e.line+1;h<=f;++h)(h!=f||n)&&l.replaceRange(i+d,a(h,0))}else l.replaceRange(u,t),l.replaceRange(c,e)})}}),e.defineExtension("uncomment",function(e,t,r){r||(r=i);var l,s=this,c=n(s,e),u=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,s.lastLine()),f=Math.min(e.line,u),d=r.lineComment||c.lineComment,h=[],p=null==r.padding?" ":r.padding;e:if(d){for(var m=f;m<=u;++m){var g=s.getLine(m),v=g.indexOf(d);if(v>-1&&!/comment/.test(s.getTokenTypeAt(a(m,v+1)))&&(v=-1),v==-1&&o.test(g))break e;if(v>-1&&o.test(g.slice(0,v)))break e;h.push(g)}if(s.operation(function(){for(var e=f;e<=u;++e){var t=h[e-f],r=t.indexOf(
|