Version Description
Download this release
Release Info
Developer | arniebradfo |
Plugin | HTML Editor Syntax Highlighter |
Version | 2.3.4 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.3.4
- dist/hesh.css → hesh.css +502 -509
- dist/hesh.js → hesh.js +1 -1
- html-editor-syntax-highlighter.php +75 -16
- readme.txt +9 -1
dist/hesh.css → hesh.css
RENAMED
@@ -1,11 +1,4 @@
|
|
1 |
-
|
2 |
-
* Plugin Name: HTML Editor Syntax Highlighter
|
3 |
-
* Author: James Bradford
|
4 |
-
* Author URI: http://bradford.digital/
|
5 |
-
* Author: Peter Mukhortov
|
6 |
-
* Author URI: http://mukhortov.com/
|
7 |
-
* Version: 2.3.2
|
8 |
-
**/.CodeMirror {
|
9 |
font-family: monospace;
|
10 |
height: 300px;
|
11 |
color: #000;
|
@@ -1596,89 +1589,6 @@ span.CodeMirror-selectedtext {
|
|
1596 |
color: #9c9e9e!important;
|
1597 |
}
|
1598 |
|
1599 |
-
.cm-s-duotone-dark.CodeMirror {
|
1600 |
-
background: #2a2734;
|
1601 |
-
color: #6c6783;
|
1602 |
-
}
|
1603 |
-
|
1604 |
-
.cm-s-duotone-dark div.CodeMirror-selected {
|
1605 |
-
background: #545167!important;
|
1606 |
-
}
|
1607 |
-
|
1608 |
-
.cm-s-duotone-dark .CodeMirror-gutters {
|
1609 |
-
background: #2a2734;
|
1610 |
-
border-right: 0;
|
1611 |
-
}
|
1612 |
-
|
1613 |
-
.cm-s-duotone-dark .CodeMirror-linenumber {
|
1614 |
-
color: #545167;
|
1615 |
-
}
|
1616 |
-
|
1617 |
-
.cm-s-duotone-dark .CodeMirror-cursor {
|
1618 |
-
border-left: 1px solid #ffad5c;
|
1619 |
-
border-right: .5em solid #ffad5c;
|
1620 |
-
opacity: .5;
|
1621 |
-
}
|
1622 |
-
|
1623 |
-
.cm-s-duotone-dark .CodeMirror-activeline-background {
|
1624 |
-
background: #363342;
|
1625 |
-
opacity: .5;
|
1626 |
-
}
|
1627 |
-
|
1628 |
-
.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor {
|
1629 |
-
background: #ffad5c;
|
1630 |
-
opacity: .5;
|
1631 |
-
}
|
1632 |
-
|
1633 |
-
.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 {
|
1634 |
-
color: #fc9;
|
1635 |
-
}
|
1636 |
-
|
1637 |
-
.cm-s-duotone-dark span.cm-property {
|
1638 |
-
color: #9a86fd;
|
1639 |
-
}
|
1640 |
-
|
1641 |
-
.cm-s-duotone-dark span.cm-negative,.cm-s-duotone-dark span.cm-punctuation,.cm-s-duotone-dark span.cm-unit {
|
1642 |
-
color: #e09142;
|
1643 |
-
}
|
1644 |
-
|
1645 |
-
.cm-s-duotone-dark span.cm-string {
|
1646 |
-
color: #ffb870;
|
1647 |
-
}
|
1648 |
-
|
1649 |
-
.cm-s-duotone-dark span.cm-operator {
|
1650 |
-
color: #ffad5c;
|
1651 |
-
}
|
1652 |
-
|
1653 |
-
.cm-s-duotone-dark span.cm-positive {
|
1654 |
-
color: #6a51e6;
|
1655 |
-
}
|
1656 |
-
|
1657 |
-
.cm-s-duotone-dark span.cm-string-2,.cm-s-duotone-dark span.cm-type,.cm-s-duotone-dark span.cm-url,.cm-s-duotone-dark span.cm-variable-2,.cm-s-duotone-dark span.cm-variable-3 {
|
1658 |
-
color: #7a63ee;
|
1659 |
-
}
|
1660 |
-
|
1661 |
-
.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 {
|
1662 |
-
color: #eeebff;
|
1663 |
-
}
|
1664 |
-
|
1665 |
-
.cm-s-duotone-dark span.cm-bracket,.cm-s-duotone-dark span.cm-comment {
|
1666 |
-
color: #6c6783;
|
1667 |
-
}
|
1668 |
-
|
1669 |
-
.cm-s-duotone-dark span.cm-error,.cm-s-duotone-dark span.cm-invalidchar {
|
1670 |
-
color: red;
|
1671 |
-
}
|
1672 |
-
|
1673 |
-
.cm-s-duotone-dark span.cm-header {
|
1674 |
-
font-weight: 400;
|
1675 |
-
}
|
1676 |
-
|
1677 |
-
.cm-s-duotone-dark .CodeMirror-matchingbracket {
|
1678 |
-
text-decoration: underline;
|
1679 |
-
color: #eeebff!important;
|
1680 |
-
}
|
1681 |
-
|
1682 |
.cm-s-dracula.CodeMirror,.cm-s-dracula .CodeMirror-gutters {
|
1683 |
background-color: #282a36!important;
|
1684 |
color: #f8f8f2!important;
|
@@ -1774,6 +1684,89 @@ span.CodeMirror-selectedtext {
|
|
1774 |
color: #fff!important;
|
1775 |
}
|
1776 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1777 |
.cm-s-duotone-light.CodeMirror {
|
1778 |
background: #faf8f5;
|
1779 |
color: #b29762;
|
@@ -1849,59 +1842,6 @@ span.CodeMirror-selectedtext {
|
|
1849 |
color: #faf8f5!important;
|
1850 |
}
|
1851 |
|
1852 |
-
.cm-s-elegant span.cm-atom,.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string {
|
1853 |
-
color: #762;
|
1854 |
-
}
|
1855 |
-
|
1856 |
-
.cm-s-elegant span.cm-comment {
|
1857 |
-
color: #262;
|
1858 |
-
font-style: italic;
|
1859 |
-
line-height: 1em;
|
1860 |
-
}
|
1861 |
-
|
1862 |
-
.cm-s-elegant span.cm-meta {
|
1863 |
-
color: #555;
|
1864 |
-
font-style: italic;
|
1865 |
-
line-height: 1em;
|
1866 |
-
}
|
1867 |
-
|
1868 |
-
.cm-s-elegant span.cm-variable {
|
1869 |
-
color: #000;
|
1870 |
-
}
|
1871 |
-
|
1872 |
-
.cm-s-elegant span.cm-variable-2 {
|
1873 |
-
color: #b11;
|
1874 |
-
}
|
1875 |
-
|
1876 |
-
.cm-s-elegant span.cm-qualifier {
|
1877 |
-
color: #555;
|
1878 |
-
}
|
1879 |
-
|
1880 |
-
.cm-s-elegant span.cm-keyword {
|
1881 |
-
color: #730;
|
1882 |
-
}
|
1883 |
-
|
1884 |
-
.cm-s-elegant span.cm-builtin {
|
1885 |
-
color: #30a;
|
1886 |
-
}
|
1887 |
-
|
1888 |
-
.cm-s-elegant span.cm-link {
|
1889 |
-
color: #762;
|
1890 |
-
}
|
1891 |
-
|
1892 |
-
.cm-s-elegant span.cm-error {
|
1893 |
-
background-color: #fdd;
|
1894 |
-
}
|
1895 |
-
|
1896 |
-
.cm-s-elegant .CodeMirror-activeline-background {
|
1897 |
-
background: #e8f2ff;
|
1898 |
-
}
|
1899 |
-
|
1900 |
-
.cm-s-elegant .CodeMirror-matchingbracket {
|
1901 |
-
outline: 1px solid grey;
|
1902 |
-
color: #000!important;
|
1903 |
-
}
|
1904 |
-
|
1905 |
.cm-s-eclipse span.cm-meta {
|
1906 |
color: #ff1717;
|
1907 |
}
|
@@ -1985,38 +1925,91 @@ span.CodeMirror-selectedtext {
|
|
1985 |
color: #000!important;
|
1986 |
}
|
1987 |
|
1988 |
-
.cm-s-
|
1989 |
-
|
1990 |
-
color: #fff;
|
1991 |
}
|
1992 |
|
1993 |
-
.cm-s-
|
1994 |
-
|
|
|
|
|
1995 |
}
|
1996 |
|
1997 |
-
.cm-s-
|
1998 |
-
|
|
|
|
|
1999 |
}
|
2000 |
|
2001 |
-
.cm-s-
|
2002 |
-
|
2003 |
}
|
2004 |
|
2005 |
-
.cm-s-
|
2006 |
-
|
2007 |
-
border-right: 1px solid #aaa;
|
2008 |
}
|
2009 |
|
2010 |
-
.cm-s-
|
2011 |
-
color: #
|
2012 |
}
|
2013 |
|
2014 |
-
.cm-s-
|
2015 |
-
color: #
|
2016 |
}
|
2017 |
|
2018 |
-
.cm-s-
|
2019 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020 |
}
|
2021 |
|
2022 |
.cm-s-erlang-dark span.cm-quote {
|
@@ -2382,86 +2375,6 @@ span.CodeMirror-selectedtext {
|
|
2382 |
background: #000;
|
2383 |
}
|
2384 |
|
2385 |
-
.cm-s-isotope.CodeMirror {
|
2386 |
-
background: #000;
|
2387 |
-
color: #e0e0e0;
|
2388 |
-
}
|
2389 |
-
|
2390 |
-
.cm-s-isotope div.CodeMirror-selected {
|
2391 |
-
background: #404040!important;
|
2392 |
-
}
|
2393 |
-
|
2394 |
-
.cm-s-isotope .CodeMirror-gutters {
|
2395 |
-
background: #000;
|
2396 |
-
border-right: 0;
|
2397 |
-
}
|
2398 |
-
|
2399 |
-
.cm-s-isotope .CodeMirror-linenumber {
|
2400 |
-
color: gray;
|
2401 |
-
}
|
2402 |
-
|
2403 |
-
.cm-s-isotope .CodeMirror-cursor {
|
2404 |
-
border-left: 1px solid silver!important;
|
2405 |
-
}
|
2406 |
-
|
2407 |
-
.cm-s-isotope span.cm-comment {
|
2408 |
-
color: #30f;
|
2409 |
-
}
|
2410 |
-
|
2411 |
-
.cm-s-isotope span.cm-atom,.cm-s-isotope span.cm-number {
|
2412 |
-
color: #c0f;
|
2413 |
-
}
|
2414 |
-
|
2415 |
-
.cm-s-isotope span.cm-attribute,.cm-s-isotope span.cm-property {
|
2416 |
-
color: #3f0;
|
2417 |
-
}
|
2418 |
-
|
2419 |
-
.cm-s-isotope span.cm-keyword {
|
2420 |
-
color: red;
|
2421 |
-
}
|
2422 |
-
|
2423 |
-
.cm-s-isotope span.cm-string {
|
2424 |
-
color: #f09;
|
2425 |
-
}
|
2426 |
-
|
2427 |
-
.cm-s-isotope span.cm-variable {
|
2428 |
-
color: #3f0;
|
2429 |
-
}
|
2430 |
-
|
2431 |
-
.cm-s-isotope span.cm-variable-2 {
|
2432 |
-
color: #06f;
|
2433 |
-
}
|
2434 |
-
|
2435 |
-
.cm-s-isotope span.cm-def {
|
2436 |
-
color: #f90;
|
2437 |
-
}
|
2438 |
-
|
2439 |
-
.cm-s-isotope span.cm-error {
|
2440 |
-
background: red;
|
2441 |
-
color: silver;
|
2442 |
-
}
|
2443 |
-
|
2444 |
-
.cm-s-isotope span.cm-bracket {
|
2445 |
-
color: #e0e0e0;
|
2446 |
-
}
|
2447 |
-
|
2448 |
-
.cm-s-isotope span.cm-tag {
|
2449 |
-
color: red;
|
2450 |
-
}
|
2451 |
-
|
2452 |
-
.cm-s-isotope span.cm-link {
|
2453 |
-
color: #c0f;
|
2454 |
-
}
|
2455 |
-
|
2456 |
-
.cm-s-isotope .CodeMirror-matchingbracket {
|
2457 |
-
text-decoration: underline;
|
2458 |
-
color: #fff!important;
|
2459 |
-
}
|
2460 |
-
|
2461 |
-
.cm-s-isotope .CodeMirror-activeline-background {
|
2462 |
-
background: #202020;
|
2463 |
-
}
|
2464 |
-
|
2465 |
.cm-s-idea span.cm-meta {
|
2466 |
color: olive;
|
2467 |
}
|
@@ -2545,6 +2458,86 @@ span.CodeMirror-selectedtext {
|
|
2545 |
color: #5c6065!important;
|
2546 |
}
|
2547 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2548 |
.cm-s-lesser-dark {
|
2549 |
line-height: 1.3em;
|
2550 |
}
|
@@ -3754,98 +3747,6 @@ div.cm-s-mdn-like span.CodeMirror-matchingbracket {
|
|
3754 |
color: #fff!important;
|
3755 |
}
|
3756 |
|
3757 |
-
.cm-s-oceanic-next.CodeMirror {
|
3758 |
-
background: #304148;
|
3759 |
-
color: #f8f8f2;
|
3760 |
-
}
|
3761 |
-
|
3762 |
-
.cm-s-oceanic-next div.CodeMirror-selected {
|
3763 |
-
background: rgba(101,115,126,.33);
|
3764 |
-
}
|
3765 |
-
|
3766 |
-
.cm-s-oceanic-next .CodeMirror-line::selection,.cm-s-oceanic-next .CodeMirror-line>span::selection,.cm-s-oceanic-next .CodeMirror-line>span>span::selection {
|
3767 |
-
background: rgba(101,115,126,.33);
|
3768 |
-
}
|
3769 |
-
|
3770 |
-
.cm-s-oceanic-next .CodeMirror-line::-moz-selection,.cm-s-oceanic-next .CodeMirror-line>span::-moz-selection,.cm-s-oceanic-next .CodeMirror-line>span>span::-moz-selection {
|
3771 |
-
background: rgba(101,115,126,.33);
|
3772 |
-
}
|
3773 |
-
|
3774 |
-
.cm-s-oceanic-next .CodeMirror-gutters {
|
3775 |
-
background: #304148;
|
3776 |
-
border-right: 10px;
|
3777 |
-
}
|
3778 |
-
|
3779 |
-
.cm-s-oceanic-next .CodeMirror-guttermarker {
|
3780 |
-
color: #fff;
|
3781 |
-
}
|
3782 |
-
|
3783 |
-
.cm-s-oceanic-next .CodeMirror-guttermarker-subtle,.cm-s-oceanic-next .CodeMirror-linenumber {
|
3784 |
-
color: #d0d0d0;
|
3785 |
-
}
|
3786 |
-
|
3787 |
-
.cm-s-oceanic-next .CodeMirror-cursor {
|
3788 |
-
border-left: 1px solid #f8f8f0;
|
3789 |
-
}
|
3790 |
-
|
3791 |
-
.cm-s-oceanic-next span.cm-comment {
|
3792 |
-
color: #65737e;
|
3793 |
-
}
|
3794 |
-
|
3795 |
-
.cm-s-oceanic-next span.cm-atom {
|
3796 |
-
color: #c594c5;
|
3797 |
-
}
|
3798 |
-
|
3799 |
-
.cm-s-oceanic-next span.cm-number {
|
3800 |
-
color: #f99157;
|
3801 |
-
}
|
3802 |
-
|
3803 |
-
.cm-s-oceanic-next span.cm-property {
|
3804 |
-
color: #99c794;
|
3805 |
-
}
|
3806 |
-
|
3807 |
-
.cm-s-oceanic-next span.cm-attribute,.cm-s-oceanic-next span.cm-keyword {
|
3808 |
-
color: #c594c5;
|
3809 |
-
}
|
3810 |
-
|
3811 |
-
.cm-s-oceanic-next span.cm-builtin {
|
3812 |
-
color: #66d9ef;
|
3813 |
-
}
|
3814 |
-
|
3815 |
-
.cm-s-oceanic-next span.cm-string {
|
3816 |
-
color: #99c794;
|
3817 |
-
}
|
3818 |
-
|
3819 |
-
.cm-s-oceanic-next span.cm-variable,.cm-s-oceanic-next span.cm-variable-2,.cm-s-oceanic-next span.cm-variable-3 {
|
3820 |
-
color: #f8f8f2;
|
3821 |
-
}
|
3822 |
-
|
3823 |
-
.cm-s-oceanic-next span.cm-def {
|
3824 |
-
color: #69c;
|
3825 |
-
}
|
3826 |
-
|
3827 |
-
.cm-s-oceanic-next span.cm-bracket {
|
3828 |
-
color: #5fb3b3;
|
3829 |
-
}
|
3830 |
-
|
3831 |
-
.cm-s-oceanic-next span.cm-header,.cm-s-oceanic-next span.cm-link,.cm-s-oceanic-next span.cm-tag {
|
3832 |
-
color: #c594c5;
|
3833 |
-
}
|
3834 |
-
|
3835 |
-
.cm-s-oceanic-next span.cm-error {
|
3836 |
-
background: #c594c5;
|
3837 |
-
color: #f8f8f0;
|
3838 |
-
}
|
3839 |
-
|
3840 |
-
.cm-s-oceanic-next .CodeMirror-activeline-background {
|
3841 |
-
background: rgba(101,115,126,.33);
|
3842 |
-
}
|
3843 |
-
|
3844 |
-
.cm-s-oceanic-next .CodeMirror-matchingbracket {
|
3845 |
-
text-decoration: underline;
|
3846 |
-
color: #fff!important;
|
3847 |
-
}
|
3848 |
-
|
3849 |
.cm-s-nord.CodeMirror {
|
3850 |
background: #2e3440;
|
3851 |
color: #d8dee9;
|
@@ -3946,94 +3847,94 @@ div.cm-s-mdn-like span.CodeMirror-matchingbracket {
|
|
3946 |
color: #fff!important;
|
3947 |
}
|
3948 |
|
3949 |
-
.cm-s-
|
3950 |
-
background: #
|
3951 |
-
color: #
|
3952 |
}
|
3953 |
|
3954 |
-
.cm-s-
|
3955 |
-
background:
|
3956 |
}
|
3957 |
|
3958 |
-
.cm-s-
|
3959 |
-
background: rgba(
|
3960 |
}
|
3961 |
|
3962 |
-
.cm-s-
|
3963 |
-
background: rgba(
|
3964 |
}
|
3965 |
|
3966 |
-
.cm-s-
|
3967 |
-
background: #
|
3968 |
-
border-right:
|
3969 |
}
|
3970 |
|
3971 |
-
.cm-s-
|
3972 |
-
color: #
|
3973 |
}
|
3974 |
|
3975 |
-
.cm-s-
|
3976 |
-
color: #
|
3977 |
}
|
3978 |
|
3979 |
-
.cm-s-
|
3980 |
-
border-left: 1px solid #
|
3981 |
}
|
3982 |
|
3983 |
-
.cm-s-
|
3984 |
-
color: #
|
3985 |
}
|
3986 |
|
3987 |
-
.cm-s-
|
3988 |
-
color: #
|
3989 |
}
|
3990 |
|
3991 |
-
.cm-s-
|
3992 |
-
color: #
|
3993 |
}
|
3994 |
|
3995 |
-
.cm-s-
|
3996 |
-
color: #
|
3997 |
}
|
3998 |
|
3999 |
-
.cm-s-
|
4000 |
-
color: #
|
4001 |
}
|
4002 |
|
4003 |
-
.cm-s-
|
4004 |
-
color: #
|
4005 |
}
|
4006 |
|
4007 |
-
.cm-s-
|
4008 |
-
color: #
|
4009 |
}
|
4010 |
|
4011 |
-
.cm-s-
|
4012 |
-
color: #
|
4013 |
}
|
4014 |
|
4015 |
-
.cm-s-
|
4016 |
-
color: #
|
4017 |
}
|
4018 |
|
4019 |
-
.cm-s-
|
4020 |
-
color: #
|
4021 |
}
|
4022 |
|
4023 |
-
.cm-s-
|
4024 |
-
color: #
|
4025 |
}
|
4026 |
|
4027 |
-
.cm-s-
|
4028 |
-
background: #
|
4029 |
-
color: #
|
4030 |
}
|
4031 |
|
4032 |
-
.cm-s-
|
4033 |
-
background:
|
4034 |
}
|
4035 |
|
4036 |
-
.cm-s-
|
4037 |
text-decoration: underline;
|
4038 |
color: #fff!important;
|
4039 |
}
|
@@ -4074,60 +3975,152 @@ div.cm-s-mdn-like span.CodeMirror-matchingbracket {
|
|
4074 |
color: #ffb86c;
|
4075 |
}
|
4076 |
|
4077 |
-
.cm-s-panda-syntax .cm-tag {
|
4078 |
-
color: #ff2c6d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4079 |
}
|
4080 |
|
4081 |
-
.cm-s-
|
4082 |
-
color: #
|
4083 |
}
|
4084 |
|
4085 |
-
.cm-s-
|
4086 |
-
color: #
|
4087 |
}
|
4088 |
|
4089 |
-
.cm-s-
|
4090 |
-
color: #
|
4091 |
}
|
4092 |
|
4093 |
-
.cm-s-
|
4094 |
-
color: #
|
4095 |
}
|
4096 |
|
4097 |
-
.cm-s-
|
4098 |
-
color: #
|
4099 |
}
|
4100 |
|
4101 |
-
.cm-s-
|
4102 |
-
color: #
|
4103 |
}
|
4104 |
|
4105 |
-
.cm-s-
|
4106 |
-
color: #
|
4107 |
}
|
4108 |
|
4109 |
-
.cm-s-
|
4110 |
-
color: #
|
4111 |
}
|
4112 |
|
4113 |
-
.cm-s-
|
4114 |
-
color: #
|
4115 |
}
|
4116 |
|
4117 |
-
.cm-s-
|
4118 |
-
|
4119 |
-
|
4120 |
-
color: #e6e6e6;
|
4121 |
}
|
4122 |
|
4123 |
-
.cm-s-
|
4124 |
-
background: #
|
4125 |
-
border-right-color: hsla(0,0%,100%,.1);
|
4126 |
}
|
4127 |
|
4128 |
-
.cm-s-
|
4129 |
-
|
4130 |
-
|
4131 |
}
|
4132 |
|
4133 |
.cm-s-paraiso-light.CodeMirror {
|
@@ -5714,75 +5707,6 @@ div.cm-s-mdn-like span.CodeMirror-matchingbracket {
|
|
5714 |
color: #fff!important;
|
5715 |
}
|
5716 |
|
5717 |
-
.cm-s-xq-light span.cm-keyword {
|
5718 |
-
line-height: 1em;
|
5719 |
-
font-weight: 700;
|
5720 |
-
color: #5a5cad;
|
5721 |
-
}
|
5722 |
-
|
5723 |
-
.cm-s-xq-light span.cm-atom {
|
5724 |
-
color: #6c8cd5;
|
5725 |
-
}
|
5726 |
-
|
5727 |
-
.cm-s-xq-light span.cm-number {
|
5728 |
-
color: #164;
|
5729 |
-
}
|
5730 |
-
|
5731 |
-
.cm-s-xq-light span.cm-def {
|
5732 |
-
text-decoration: underline;
|
5733 |
-
}
|
5734 |
-
|
5735 |
-
.cm-s-xq-light span.cm-type,.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3 {
|
5736 |
-
color: #000;
|
5737 |
-
}
|
5738 |
-
|
5739 |
-
.cm-s-xq-light span.cm-comment {
|
5740 |
-
color: #0080ff;
|
5741 |
-
font-style: italic;
|
5742 |
-
}
|
5743 |
-
|
5744 |
-
.cm-s-xq-light span.cm-string {
|
5745 |
-
color: red;
|
5746 |
-
}
|
5747 |
-
|
5748 |
-
.cm-s-xq-light span.cm-meta {
|
5749 |
-
color: #ff0;
|
5750 |
-
}
|
5751 |
-
|
5752 |
-
.cm-s-xq-light span.cm-qualifier {
|
5753 |
-
color: grey;
|
5754 |
-
}
|
5755 |
-
|
5756 |
-
.cm-s-xq-light span.cm-builtin {
|
5757 |
-
color: #7ea656;
|
5758 |
-
}
|
5759 |
-
|
5760 |
-
.cm-s-xq-light span.cm-bracket {
|
5761 |
-
color: #cc7;
|
5762 |
-
}
|
5763 |
-
|
5764 |
-
.cm-s-xq-light span.cm-tag {
|
5765 |
-
color: #3f7f7f;
|
5766 |
-
}
|
5767 |
-
|
5768 |
-
.cm-s-xq-light span.cm-attribute {
|
5769 |
-
color: #7f007f;
|
5770 |
-
}
|
5771 |
-
|
5772 |
-
.cm-s-xq-light span.cm-error {
|
5773 |
-
color: red;
|
5774 |
-
}
|
5775 |
-
|
5776 |
-
.cm-s-xq-light .CodeMirror-activeline-background {
|
5777 |
-
background: #e8f2ff;
|
5778 |
-
}
|
5779 |
-
|
5780 |
-
.cm-s-xq-light .CodeMirror-matchingbracket {
|
5781 |
-
outline: 1px solid grey;
|
5782 |
-
color: #000!important;
|
5783 |
-
background: #ff0;
|
5784 |
-
}
|
5785 |
-
|
5786 |
.cm-s-xq-dark.CodeMirror {
|
5787 |
background: #0a001f;
|
5788 |
color: #f8f8f8;
|
@@ -5891,6 +5815,75 @@ div.cm-s-mdn-like span.CodeMirror-matchingbracket {
|
|
5891 |
color: #fff!important;
|
5892 |
}
|
5893 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5894 |
.cm-s-yeti.CodeMirror {
|
5895 |
background-color: #eceae8!important;
|
5896 |
color: #d1c9c0!important;
|
@@ -6745,6 +6738,22 @@ td.CodeMirror-settings__heading {
|
|
6745 |
margin: 6px!important;
|
6746 |
}
|
6747 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6748 |
.heshFullscreen {
|
6749 |
z-index: 99999;
|
6750 |
position: fixed!important;
|
@@ -6772,36 +6781,6 @@ td.CodeMirror-settings__heading {
|
|
6772 |
content: "\f506";
|
6773 |
}
|
6774 |
|
6775 |
-
.cm-matchhighlight,.CodeMirror-matchingbracket,.CodeMirror-matchingtag {
|
6776 |
-
background-color: rgba(0,255,175,.2);
|
6777 |
-
}
|
6778 |
-
|
6779 |
-
#cm_content_fullscreen {
|
6780 |
-
display: inline-block;
|
6781 |
-
}
|
6782 |
-
|
6783 |
-
.wp-editor-expand #cm_content_fullscreen {
|
6784 |
-
display: none;
|
6785 |
-
}
|
6786 |
-
|
6787 |
-
#ed_toolbar {
|
6788 |
-
z-index: 10;
|
6789 |
-
}
|
6790 |
-
|
6791 |
-
.hesh-content-resize-handle {
|
6792 |
-
position: absolute;
|
6793 |
-
right: 0;
|
6794 |
-
bottom: 0;
|
6795 |
-
width: 12px;
|
6796 |
-
height: 12px;
|
6797 |
-
z-index: 8;
|
6798 |
-
margin: 1px!important;
|
6799 |
-
}
|
6800 |
-
|
6801 |
-
#template .CodeMirror {
|
6802 |
-
min-height: 0;
|
6803 |
-
}
|
6804 |
-
|
6805 |
body.wp-admin div.edit-post-text-editor,body.wp-admin div.editor-post-title__block {
|
6806 |
max-width: none;
|
6807 |
padding: 0;
|
@@ -6827,6 +6806,20 @@ body.wp-admin .edit-post-text-editor .editor-post-title__block textarea {
|
|
6827 |
margin: 0;
|
6828 |
}
|
6829 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6830 |
@media screen and (min-width:782px) {
|
6831 |
.CodeMirror-settings__toggle {
|
6832 |
height: 35px;
|
1 |
+
.CodeMirror {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
font-family: monospace;
|
3 |
height: 300px;
|
4 |
color: #000;
|
1589 |
color: #9c9e9e!important;
|
1590 |
}
|
1591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1592 |
.cm-s-dracula.CodeMirror,.cm-s-dracula .CodeMirror-gutters {
|
1593 |
background-color: #282a36!important;
|
1594 |
color: #f8f8f2!important;
|
1684 |
color: #fff!important;
|
1685 |
}
|
1686 |
|
1687 |
+
.cm-s-duotone-dark.CodeMirror {
|
1688 |
+
background: #2a2734;
|
1689 |
+
color: #6c6783;
|
1690 |
+
}
|
1691 |
+
|
1692 |
+
.cm-s-duotone-dark div.CodeMirror-selected {
|
1693 |
+
background: #545167!important;
|
1694 |
+
}
|
1695 |
+
|
1696 |
+
.cm-s-duotone-dark .CodeMirror-gutters {
|
1697 |
+
background: #2a2734;
|
1698 |
+
border-right: 0;
|
1699 |
+
}
|
1700 |
+
|
1701 |
+
.cm-s-duotone-dark .CodeMirror-linenumber {
|
1702 |
+
color: #545167;
|
1703 |
+
}
|
1704 |
+
|
1705 |
+
.cm-s-duotone-dark .CodeMirror-cursor {
|
1706 |
+
border-left: 1px solid #ffad5c;
|
1707 |
+
border-right: .5em solid #ffad5c;
|
1708 |
+
opacity: .5;
|
1709 |
+
}
|
1710 |
+
|
1711 |
+
.cm-s-duotone-dark .CodeMirror-activeline-background {
|
1712 |
+
background: #363342;
|
1713 |
+
opacity: .5;
|
1714 |
+
}
|
1715 |
+
|
1716 |
+
.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor {
|
1717 |
+
background: #ffad5c;
|
1718 |
+
opacity: .5;
|
1719 |
+
}
|
1720 |
+
|
1721 |
+
.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 {
|
1722 |
+
color: #fc9;
|
1723 |
+
}
|
1724 |
+
|
1725 |
+
.cm-s-duotone-dark span.cm-property {
|
1726 |
+
color: #9a86fd;
|
1727 |
+
}
|
1728 |
+
|
1729 |
+
.cm-s-duotone-dark span.cm-negative,.cm-s-duotone-dark span.cm-punctuation,.cm-s-duotone-dark span.cm-unit {
|
1730 |
+
color: #e09142;
|
1731 |
+
}
|
1732 |
+
|
1733 |
+
.cm-s-duotone-dark span.cm-string {
|
1734 |
+
color: #ffb870;
|
1735 |
+
}
|
1736 |
+
|
1737 |
+
.cm-s-duotone-dark span.cm-operator {
|
1738 |
+
color: #ffad5c;
|
1739 |
+
}
|
1740 |
+
|
1741 |
+
.cm-s-duotone-dark span.cm-positive {
|
1742 |
+
color: #6a51e6;
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
.cm-s-duotone-dark span.cm-string-2,.cm-s-duotone-dark span.cm-type,.cm-s-duotone-dark span.cm-url,.cm-s-duotone-dark span.cm-variable-2,.cm-s-duotone-dark span.cm-variable-3 {
|
1746 |
+
color: #7a63ee;
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
.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 {
|
1750 |
+
color: #eeebff;
|
1751 |
+
}
|
1752 |
+
|
1753 |
+
.cm-s-duotone-dark span.cm-bracket,.cm-s-duotone-dark span.cm-comment {
|
1754 |
+
color: #6c6783;
|
1755 |
+
}
|
1756 |
+
|
1757 |
+
.cm-s-duotone-dark span.cm-error,.cm-s-duotone-dark span.cm-invalidchar {
|
1758 |
+
color: red;
|
1759 |
+
}
|
1760 |
+
|
1761 |
+
.cm-s-duotone-dark span.cm-header {
|
1762 |
+
font-weight: 400;
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
.cm-s-duotone-dark .CodeMirror-matchingbracket {
|
1766 |
+
text-decoration: underline;
|
1767 |
+
color: #eeebff!important;
|
1768 |
+
}
|
1769 |
+
|
1770 |
.cm-s-duotone-light.CodeMirror {
|
1771 |
background: #faf8f5;
|
1772 |
color: #b29762;
|
1842 |
color: #faf8f5!important;
|
1843 |
}
|
1844 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1845 |
.cm-s-eclipse span.cm-meta {
|
1846 |
color: #ff1717;
|
1847 |
}
|
1925 |
color: #000!important;
|
1926 |
}
|
1927 |
|
1928 |
+
.cm-s-elegant span.cm-atom,.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string {
|
1929 |
+
color: #762;
|
|
|
1930 |
}
|
1931 |
|
1932 |
+
.cm-s-elegant span.cm-comment {
|
1933 |
+
color: #262;
|
1934 |
+
font-style: italic;
|
1935 |
+
line-height: 1em;
|
1936 |
}
|
1937 |
|
1938 |
+
.cm-s-elegant span.cm-meta {
|
1939 |
+
color: #555;
|
1940 |
+
font-style: italic;
|
1941 |
+
line-height: 1em;
|
1942 |
}
|
1943 |
|
1944 |
+
.cm-s-elegant span.cm-variable {
|
1945 |
+
color: #000;
|
1946 |
}
|
1947 |
|
1948 |
+
.cm-s-elegant span.cm-variable-2 {
|
1949 |
+
color: #b11;
|
|
|
1950 |
}
|
1951 |
|
1952 |
+
.cm-s-elegant span.cm-qualifier {
|
1953 |
+
color: #555;
|
1954 |
}
|
1955 |
|
1956 |
+
.cm-s-elegant span.cm-keyword {
|
1957 |
+
color: #730;
|
1958 |
}
|
1959 |
|
1960 |
+
.cm-s-elegant span.cm-builtin {
|
1961 |
+
color: #30a;
|
1962 |
+
}
|
1963 |
+
|
1964 |
+
.cm-s-elegant span.cm-link {
|
1965 |
+
color: #762;
|
1966 |
+
}
|
1967 |
+
|
1968 |
+
.cm-s-elegant span.cm-error {
|
1969 |
+
background-color: #fdd;
|
1970 |
+
}
|
1971 |
+
|
1972 |
+
.cm-s-elegant .CodeMirror-activeline-background {
|
1973 |
+
background: #e8f2ff;
|
1974 |
+
}
|
1975 |
+
|
1976 |
+
.cm-s-elegant .CodeMirror-matchingbracket {
|
1977 |
+
outline: 1px solid grey;
|
1978 |
+
color: #000!important;
|
1979 |
+
}
|
1980 |
+
|
1981 |
+
.cm-s-erlang-dark.CodeMirror {
|
1982 |
+
background: #002240;
|
1983 |
+
color: #fff;
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
.cm-s-erlang-dark div.CodeMirror-selected {
|
1987 |
+
background: #b36539;
|
1988 |
+
}
|
1989 |
+
|
1990 |
+
.cm-s-erlang-dark .CodeMirror-line::selection,.cm-s-erlang-dark .CodeMirror-line>span::selection,.cm-s-erlang-dark .CodeMirror-line>span>span::selection {
|
1991 |
+
background: rgba(179,101,57,.99);
|
1992 |
+
}
|
1993 |
+
|
1994 |
+
.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 {
|
1995 |
+
background: rgba(179,101,57,.99);
|
1996 |
+
}
|
1997 |
+
|
1998 |
+
.cm-s-erlang-dark .CodeMirror-gutters {
|
1999 |
+
background: #002240;
|
2000 |
+
border-right: 1px solid #aaa;
|
2001 |
+
}
|
2002 |
+
|
2003 |
+
.cm-s-erlang-dark .CodeMirror-guttermarker {
|
2004 |
+
color: #fff;
|
2005 |
+
}
|
2006 |
+
|
2007 |
+
.cm-s-erlang-dark .CodeMirror-guttermarker-subtle,.cm-s-erlang-dark .CodeMirror-linenumber {
|
2008 |
+
color: #d0d0d0;
|
2009 |
+
}
|
2010 |
+
|
2011 |
+
.cm-s-erlang-dark .CodeMirror-cursor {
|
2012 |
+
border-left: 1px solid #fff;
|
2013 |
}
|
2014 |
|
2015 |
.cm-s-erlang-dark span.cm-quote {
|
2375 |
background: #000;
|
2376 |
}
|
2377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2378 |
.cm-s-idea span.cm-meta {
|
2379 |
color: olive;
|
2380 |
}
|
2458 |
color: #5c6065!important;
|
2459 |
}
|
2460 |
|
2461 |
+
.cm-s-isotope.CodeMirror {
|
2462 |
+
background: #000;
|
2463 |
+
color: #e0e0e0;
|
2464 |
+
}
|
2465 |
+
|
2466 |
+
.cm-s-isotope div.CodeMirror-selected {
|
2467 |
+
background: #404040!important;
|
2468 |
+
}
|
2469 |
+
|
2470 |
+
.cm-s-isotope .CodeMirror-gutters {
|
2471 |
+
background: #000;
|
2472 |
+
border-right: 0;
|
2473 |
+
}
|
2474 |
+
|
2475 |
+
.cm-s-isotope .CodeMirror-linenumber {
|
2476 |
+
color: gray;
|
2477 |
+
}
|
2478 |
+
|
2479 |
+
.cm-s-isotope .CodeMirror-cursor {
|
2480 |
+
border-left: 1px solid silver!important;
|
2481 |
+
}
|
2482 |
+
|
2483 |
+
.cm-s-isotope span.cm-comment {
|
2484 |
+
color: #30f;
|
2485 |
+
}
|
2486 |
+
|
2487 |
+
.cm-s-isotope span.cm-atom,.cm-s-isotope span.cm-number {
|
2488 |
+
color: #c0f;
|
2489 |
+
}
|
2490 |
+
|
2491 |
+
.cm-s-isotope span.cm-attribute,.cm-s-isotope span.cm-property {
|
2492 |
+
color: #3f0;
|
2493 |
+
}
|
2494 |
+
|
2495 |
+
.cm-s-isotope span.cm-keyword {
|
2496 |
+
color: red;
|
2497 |
+
}
|
2498 |
+
|
2499 |
+
.cm-s-isotope span.cm-string {
|
2500 |
+
color: #f09;
|
2501 |
+
}
|
2502 |
+
|
2503 |
+
.cm-s-isotope span.cm-variable {
|
2504 |
+
color: #3f0;
|
2505 |
+
}
|
2506 |
+
|
2507 |
+
.cm-s-isotope span.cm-variable-2 {
|
2508 |
+
color: #06f;
|
2509 |
+
}
|
2510 |
+
|
2511 |
+
.cm-s-isotope span.cm-def {
|
2512 |
+
color: #f90;
|
2513 |
+
}
|
2514 |
+
|
2515 |
+
.cm-s-isotope span.cm-error {
|
2516 |
+
background: red;
|
2517 |
+
color: silver;
|
2518 |
+
}
|
2519 |
+
|
2520 |
+
.cm-s-isotope span.cm-bracket {
|
2521 |
+
color: #e0e0e0;
|
2522 |
+
}
|
2523 |
+
|
2524 |
+
.cm-s-isotope span.cm-tag {
|
2525 |
+
color: red;
|
2526 |
+
}
|
2527 |
+
|
2528 |
+
.cm-s-isotope span.cm-link {
|
2529 |
+
color: #c0f;
|
2530 |
+
}
|
2531 |
+
|
2532 |
+
.cm-s-isotope .CodeMirror-matchingbracket {
|
2533 |
+
text-decoration: underline;
|
2534 |
+
color: #fff!important;
|
2535 |
+
}
|
2536 |
+
|
2537 |
+
.cm-s-isotope .CodeMirror-activeline-background {
|
2538 |
+
background: #202020;
|
2539 |
+
}
|
2540 |
+
|
2541 |
.cm-s-lesser-dark {
|
2542 |
line-height: 1.3em;
|
2543 |
}
|
3747 |
color: #fff!important;
|
3748 |
}
|
3749 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3750 |
.cm-s-nord.CodeMirror {
|
3751 |
background: #2e3440;
|
3752 |
color: #d8dee9;
|
3847 |
color: #fff!important;
|
3848 |
}
|
3849 |
|
3850 |
+
.cm-s-oceanic-next.CodeMirror {
|
3851 |
+
background: #304148;
|
3852 |
+
color: #f8f8f2;
|
3853 |
}
|
3854 |
|
3855 |
+
.cm-s-oceanic-next div.CodeMirror-selected {
|
3856 |
+
background: rgba(101,115,126,.33);
|
3857 |
}
|
3858 |
|
3859 |
+
.cm-s-oceanic-next .CodeMirror-line::selection,.cm-s-oceanic-next .CodeMirror-line>span::selection,.cm-s-oceanic-next .CodeMirror-line>span>span::selection {
|
3860 |
+
background: rgba(101,115,126,.33);
|
3861 |
}
|
3862 |
|
3863 |
+
.cm-s-oceanic-next .CodeMirror-line::-moz-selection,.cm-s-oceanic-next .CodeMirror-line>span::-moz-selection,.cm-s-oceanic-next .CodeMirror-line>span>span::-moz-selection {
|
3864 |
+
background: rgba(101,115,126,.33);
|
3865 |
}
|
3866 |
|
3867 |
+
.cm-s-oceanic-next .CodeMirror-gutters {
|
3868 |
+
background: #304148;
|
3869 |
+
border-right: 10px;
|
3870 |
}
|
3871 |
|
3872 |
+
.cm-s-oceanic-next .CodeMirror-guttermarker {
|
3873 |
+
color: #fff;
|
3874 |
}
|
3875 |
|
3876 |
+
.cm-s-oceanic-next .CodeMirror-guttermarker-subtle,.cm-s-oceanic-next .CodeMirror-linenumber {
|
3877 |
+
color: #d0d0d0;
|
3878 |
}
|
3879 |
|
3880 |
+
.cm-s-oceanic-next .CodeMirror-cursor {
|
3881 |
+
border-left: 1px solid #f8f8f0;
|
3882 |
}
|
3883 |
|
3884 |
+
.cm-s-oceanic-next span.cm-comment {
|
3885 |
+
color: #65737e;
|
3886 |
}
|
3887 |
|
3888 |
+
.cm-s-oceanic-next span.cm-atom {
|
3889 |
+
color: #c594c5;
|
3890 |
}
|
3891 |
|
3892 |
+
.cm-s-oceanic-next span.cm-number {
|
3893 |
+
color: #f99157;
|
3894 |
}
|
3895 |
|
3896 |
+
.cm-s-oceanic-next span.cm-property {
|
3897 |
+
color: #99c794;
|
3898 |
}
|
3899 |
|
3900 |
+
.cm-s-oceanic-next span.cm-attribute,.cm-s-oceanic-next span.cm-keyword {
|
3901 |
+
color: #c594c5;
|
3902 |
}
|
3903 |
|
3904 |
+
.cm-s-oceanic-next span.cm-builtin {
|
3905 |
+
color: #66d9ef;
|
3906 |
}
|
3907 |
|
3908 |
+
.cm-s-oceanic-next span.cm-string {
|
3909 |
+
color: #99c794;
|
3910 |
}
|
3911 |
|
3912 |
+
.cm-s-oceanic-next span.cm-variable,.cm-s-oceanic-next span.cm-variable-2,.cm-s-oceanic-next span.cm-variable-3 {
|
3913 |
+
color: #f8f8f2;
|
3914 |
}
|
3915 |
|
3916 |
+
.cm-s-oceanic-next span.cm-def {
|
3917 |
+
color: #69c;
|
3918 |
}
|
3919 |
|
3920 |
+
.cm-s-oceanic-next span.cm-bracket {
|
3921 |
+
color: #5fb3b3;
|
3922 |
}
|
3923 |
|
3924 |
+
.cm-s-oceanic-next span.cm-header,.cm-s-oceanic-next span.cm-link,.cm-s-oceanic-next span.cm-tag {
|
3925 |
+
color: #c594c5;
|
3926 |
}
|
3927 |
|
3928 |
+
.cm-s-oceanic-next span.cm-error {
|
3929 |
+
background: #c594c5;
|
3930 |
+
color: #f8f8f0;
|
3931 |
}
|
3932 |
|
3933 |
+
.cm-s-oceanic-next .CodeMirror-activeline-background {
|
3934 |
+
background: rgba(101,115,126,.33);
|
3935 |
}
|
3936 |
|
3937 |
+
.cm-s-oceanic-next .CodeMirror-matchingbracket {
|
3938 |
text-decoration: underline;
|
3939 |
color: #fff!important;
|
3940 |
}
|
3975 |
color: #ffb86c;
|
3976 |
}
|
3977 |
|
3978 |
+
.cm-s-panda-syntax .cm-tag {
|
3979 |
+
color: #ff2c6d;
|
3980 |
+
}
|
3981 |
+
|
3982 |
+
.cm-s-panda-syntax .cm-meta {
|
3983 |
+
color: #b084eb;
|
3984 |
+
}
|
3985 |
+
|
3986 |
+
.cm-s-panda-syntax .cm-number {
|
3987 |
+
color: #ffb86c;
|
3988 |
+
}
|
3989 |
+
|
3990 |
+
.cm-s-panda-syntax .cm-atom {
|
3991 |
+
color: #ff2c6d;
|
3992 |
+
}
|
3993 |
+
|
3994 |
+
.cm-s-panda-syntax .cm-keyword {
|
3995 |
+
color: #ff75b5;
|
3996 |
+
}
|
3997 |
+
|
3998 |
+
.cm-s-panda-syntax .cm-variable {
|
3999 |
+
color: #ffb86c;
|
4000 |
+
}
|
4001 |
+
|
4002 |
+
.cm-s-panda-syntax .cm-type,.cm-s-panda-syntax .cm-variable-2,.cm-s-panda-syntax .cm-variable-3 {
|
4003 |
+
color: #ff9ac1;
|
4004 |
+
}
|
4005 |
+
|
4006 |
+
.cm-s-panda-syntax .cm-def {
|
4007 |
+
color: #e6e6e6;
|
4008 |
+
}
|
4009 |
+
|
4010 |
+
.cm-s-panda-syntax .cm-property {
|
4011 |
+
color: #f3f3f3;
|
4012 |
+
}
|
4013 |
+
|
4014 |
+
.cm-s-panda-syntax .cm-attribute,.cm-s-panda-syntax .cm-unit {
|
4015 |
+
color: #ffb86c;
|
4016 |
+
}
|
4017 |
+
|
4018 |
+
.cm-s-panda-syntax .CodeMirror-matchingbracket {
|
4019 |
+
border-bottom: 1px dotted #19f9d8;
|
4020 |
+
padding-bottom: 2px;
|
4021 |
+
color: #e6e6e6;
|
4022 |
+
}
|
4023 |
+
|
4024 |
+
.cm-s-panda-syntax .CodeMirror-gutters {
|
4025 |
+
background: #292a2b;
|
4026 |
+
border-right-color: hsla(0,0%,100%,.1);
|
4027 |
+
}
|
4028 |
+
|
4029 |
+
.cm-s-panda-syntax .CodeMirror-linenumber {
|
4030 |
+
color: #e6e6e6;
|
4031 |
+
opacity: .6;
|
4032 |
+
}
|
4033 |
+
|
4034 |
+
.cm-s-paraiso-dark.CodeMirror {
|
4035 |
+
background: #2f1e2e;
|
4036 |
+
color: #b9b6b0;
|
4037 |
+
}
|
4038 |
+
|
4039 |
+
.cm-s-paraiso-dark div.CodeMirror-selected {
|
4040 |
+
background: #41323f;
|
4041 |
+
}
|
4042 |
+
|
4043 |
+
.cm-s-paraiso-dark .CodeMirror-line::selection,.cm-s-paraiso-dark .CodeMirror-line>span::selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::selection {
|
4044 |
+
background: rgba(65,50,63,.99);
|
4045 |
+
}
|
4046 |
+
|
4047 |
+
.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 {
|
4048 |
+
background: rgba(65,50,63,.99);
|
4049 |
+
}
|
4050 |
+
|
4051 |
+
.cm-s-paraiso-dark .CodeMirror-gutters {
|
4052 |
+
background: #2f1e2e;
|
4053 |
+
border-right: 0;
|
4054 |
+
}
|
4055 |
+
|
4056 |
+
.cm-s-paraiso-dark .CodeMirror-guttermarker {
|
4057 |
+
color: #ef6155;
|
4058 |
+
}
|
4059 |
+
|
4060 |
+
.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle,.cm-s-paraiso-dark .CodeMirror-linenumber {
|
4061 |
+
color: #776e71;
|
4062 |
+
}
|
4063 |
+
|
4064 |
+
.cm-s-paraiso-dark .CodeMirror-cursor {
|
4065 |
+
border-left: 1px solid #8d8687;
|
4066 |
+
}
|
4067 |
+
|
4068 |
+
.cm-s-paraiso-dark span.cm-comment {
|
4069 |
+
color: #e96ba8;
|
4070 |
+
}
|
4071 |
+
|
4072 |
+
.cm-s-paraiso-dark span.cm-atom,.cm-s-paraiso-dark span.cm-number {
|
4073 |
+
color: #815ba4;
|
4074 |
}
|
4075 |
|
4076 |
+
.cm-s-paraiso-dark span.cm-attribute,.cm-s-paraiso-dark span.cm-property {
|
4077 |
+
color: #48b685;
|
4078 |
}
|
4079 |
|
4080 |
+
.cm-s-paraiso-dark span.cm-keyword {
|
4081 |
+
color: #ef6155;
|
4082 |
}
|
4083 |
|
4084 |
+
.cm-s-paraiso-dark span.cm-string {
|
4085 |
+
color: #fec418;
|
4086 |
}
|
4087 |
|
4088 |
+
.cm-s-paraiso-dark span.cm-variable {
|
4089 |
+
color: #48b685;
|
4090 |
}
|
4091 |
|
4092 |
+
.cm-s-paraiso-dark span.cm-variable-2 {
|
4093 |
+
color: #06b6ef;
|
4094 |
}
|
4095 |
|
4096 |
+
.cm-s-paraiso-dark span.cm-def {
|
4097 |
+
color: #f99b15;
|
4098 |
}
|
4099 |
|
4100 |
+
.cm-s-paraiso-dark span.cm-bracket {
|
4101 |
+
color: #b9b6b0;
|
4102 |
}
|
4103 |
|
4104 |
+
.cm-s-paraiso-dark span.cm-tag {
|
4105 |
+
color: #ef6155;
|
4106 |
}
|
4107 |
|
4108 |
+
.cm-s-paraiso-dark span.cm-link {
|
4109 |
+
color: #815ba4;
|
4110 |
}
|
4111 |
|
4112 |
+
.cm-s-paraiso-dark span.cm-error {
|
4113 |
+
background: #ef6155;
|
4114 |
+
color: #8d8687;
|
|
|
4115 |
}
|
4116 |
|
4117 |
+
.cm-s-paraiso-dark .CodeMirror-activeline-background {
|
4118 |
+
background: #4d344a;
|
|
|
4119 |
}
|
4120 |
|
4121 |
+
.cm-s-paraiso-dark .CodeMirror-matchingbracket {
|
4122 |
+
text-decoration: underline;
|
4123 |
+
color: #fff!important;
|
4124 |
}
|
4125 |
|
4126 |
.cm-s-paraiso-light.CodeMirror {
|
5707 |
color: #fff!important;
|
5708 |
}
|
5709 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5710 |
.cm-s-xq-dark.CodeMirror {
|
5711 |
background: #0a001f;
|
5712 |
color: #f8f8f8;
|
5815 |
color: #fff!important;
|
5816 |
}
|
5817 |
|
5818 |
+
.cm-s-xq-light span.cm-keyword {
|
5819 |
+
line-height: 1em;
|
5820 |
+
font-weight: 700;
|
5821 |
+
color: #5a5cad;
|
5822 |
+
}
|
5823 |
+
|
5824 |
+
.cm-s-xq-light span.cm-atom {
|
5825 |
+
color: #6c8cd5;
|
5826 |
+
}
|
5827 |
+
|
5828 |
+
.cm-s-xq-light span.cm-number {
|
5829 |
+
color: #164;
|
5830 |
+
}
|
5831 |
+
|
5832 |
+
.cm-s-xq-light span.cm-def {
|
5833 |
+
text-decoration: underline;
|
5834 |
+
}
|
5835 |
+
|
5836 |
+
.cm-s-xq-light span.cm-type,.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3 {
|
5837 |
+
color: #000;
|
5838 |
+
}
|
5839 |
+
|
5840 |
+
.cm-s-xq-light span.cm-comment {
|
5841 |
+
color: #0080ff;
|
5842 |
+
font-style: italic;
|
5843 |
+
}
|
5844 |
+
|
5845 |
+
.cm-s-xq-light span.cm-string {
|
5846 |
+
color: red;
|
5847 |
+
}
|
5848 |
+
|
5849 |
+
.cm-s-xq-light span.cm-meta {
|
5850 |
+
color: #ff0;
|
5851 |
+
}
|
5852 |
+
|
5853 |
+
.cm-s-xq-light span.cm-qualifier {
|
5854 |
+
color: grey;
|
5855 |
+
}
|
5856 |
+
|
5857 |
+
.cm-s-xq-light span.cm-builtin {
|
5858 |
+
color: #7ea656;
|
5859 |
+
}
|
5860 |
+
|
5861 |
+
.cm-s-xq-light span.cm-bracket {
|
5862 |
+
color: #cc7;
|
5863 |
+
}
|
5864 |
+
|
5865 |
+
.cm-s-xq-light span.cm-tag {
|
5866 |
+
color: #3f7f7f;
|
5867 |
+
}
|
5868 |
+
|
5869 |
+
.cm-s-xq-light span.cm-attribute {
|
5870 |
+
color: #7f007f;
|
5871 |
+
}
|
5872 |
+
|
5873 |
+
.cm-s-xq-light span.cm-error {
|
5874 |
+
color: red;
|
5875 |
+
}
|
5876 |
+
|
5877 |
+
.cm-s-xq-light .CodeMirror-activeline-background {
|
5878 |
+
background: #e8f2ff;
|
5879 |
+
}
|
5880 |
+
|
5881 |
+
.cm-s-xq-light .CodeMirror-matchingbracket {
|
5882 |
+
outline: 1px solid grey;
|
5883 |
+
color: #000!important;
|
5884 |
+
background: #ff0;
|
5885 |
+
}
|
5886 |
+
|
5887 |
.cm-s-yeti.CodeMirror {
|
5888 |
background-color: #eceae8!important;
|
5889 |
color: #d1c9c0!important;
|
6738 |
margin: 6px!important;
|
6739 |
}
|
6740 |
|
6741 |
+
.cm-matchhighlight,.CodeMirror-matchingbracket,.CodeMirror-matchingtag {
|
6742 |
+
background-color: rgba(0,255,175,.2);
|
6743 |
+
}
|
6744 |
+
|
6745 |
+
#cm_content_fullscreen {
|
6746 |
+
display: inline-block;
|
6747 |
+
}
|
6748 |
+
|
6749 |
+
.wp-editor-expand #cm_content_fullscreen {
|
6750 |
+
display: none;
|
6751 |
+
}
|
6752 |
+
|
6753 |
+
#ed_toolbar {
|
6754 |
+
z-index: 10;
|
6755 |
+
}
|
6756 |
+
|
6757 |
.heshFullscreen {
|
6758 |
z-index: 99999;
|
6759 |
position: fixed!important;
|
6781 |
content: "\f506";
|
6782 |
}
|
6783 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6784 |
body.wp-admin div.edit-post-text-editor,body.wp-admin div.editor-post-title__block {
|
6785 |
max-width: none;
|
6786 |
padding: 0;
|
6806 |
margin: 0;
|
6807 |
}
|
6808 |
|
6809 |
+
.hesh-content-resize-handle {
|
6810 |
+
position: absolute;
|
6811 |
+
right: 0;
|
6812 |
+
bottom: 0;
|
6813 |
+
width: 12px;
|
6814 |
+
height: 12px;
|
6815 |
+
z-index: 8;
|
6816 |
+
margin: 1px!important;
|
6817 |
+
}
|
6818 |
+
|
6819 |
+
#template .CodeMirror {
|
6820 |
+
min-height: 0;
|
6821 |
+
}
|
6822 |
+
|
6823 |
@media screen and (min-width:782px) {
|
6824 |
.CodeMirror-settings__toggle {
|
6825 |
height: 35px;
|
dist/hesh.js → hesh.js
RENAMED
@@ -1 +1 @@
|
|
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";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),w=r||n||i,k=w&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),a=!i&&/Chrome\//.test(e),g=/Opera\//.test(e),l=/Apple Computer/.test(navigator.vendor),s=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),c=/PhantomJS/.test(e),u=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),f=/Android/.test(e),d=u||f||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=u||/Mac/.test(t),h=/\bCrOS\b/.test(e),p=/win/i.test(t),v=g&&e.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&15<=v&&(b=!(g=!1));var y=x&&(o||g&&(null==v||v<12.11)),C=m||w&&9<=k;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,L=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function T(e,t){return M(e).appendChild(t)}function O(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 A(e,t,r,n){var i=O(e,t,r,n);return i.setAttribute("role","presentation"),i}function E(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 N(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function I(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n]);return t}_=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 R=function(e){e.select()};function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function D(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function F(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||t<=s)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}u?R=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:w&&(R=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null};function W(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}z.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var q=30,H={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},K={origin:"*mouse"},U={origin:"+move"};function V(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||t<=i+a)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}var $=[""];function G(e){for(;$.length<=e;)$.push(X($)+" ");return $[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Q(){}function J(e,t){var r;return r=Object.create?Object.create(e):(Q.prototype=e,new Q),t&&D(t,r),r}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return 768<=e.charCodeAt(0)&&ne.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var n=r<t?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function se(e,t,r){var n=this;this.input=r,n.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=A("div",null,"CodeMirror-code"),n.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=O("div",null,"CodeMirror-cursors"),n.measure=O("div",null,"CodeMirror-measure"),n.lineMeasure=O("div",null,"CodeMirror-measure"),n.lineSpace=A("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var i=A("div",[n.lineSpace],"CodeMirror-lines");n.mover=O("div",[i],null,"position: relative"),n.sizer=O("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=O("div",null,null,"position: absolute; height: "+q+"px; width: 1px;"),n.gutters=O("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=O("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=O("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),w&&k<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),b||m&&d||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function le(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 ce(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function ue(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function fe(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function de(e){if(null==e.parent)return null;for(var t=e.parent,r=W(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function he(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 s=e.lines[a].height;if(t<s)break;t-=s}return r+a}function pe(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,r){if(void 0===r&&(r=null),!(this instanceof ge))return new ge(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return ge(e.line,e.ch)}function xe(e,t){return ve(e,t)<0?t:e}function we(e,t){return ve(e,t)<0?e:t}function ke(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return ge(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?ge(o,le(e,o).text.length):(n=le(e,(r=t).line).text.length,null==(i=r.ch)||n<i?ge(r.line,n):i<0?ge(r.line,0):r)}function Se(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Ce(e,t[n]);return r}var _e=!1,Le=!1;function Me(e,t,r){this.marker=e,this.from=t,this.to=r}function Te(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ae(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Oe(e,t){if(t.full)return null;var r=pe(e,t.from.line)&&le(e,t.from.line).markedSpans,n=pe(e,t.to.line)&&le(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==ve(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||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 Me(a,o.from,s?null:o.to))}}return n}(r,i,a),l=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||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 Me(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,u=X(t.text).length+(c?i:0);if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null==d.to){var h=Te(l,d.marker);h?c&&(d.to=null==h.to?null:h.to+u):d.to=i}}if(l)for(var p=0;p<l.length;++p){var m=l[p];if(null!=m.to&&(m.to+=u),null==m.from)Te(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m));else m.from+=u,c&&(s||(s=[])).push(m)}s&&(s=Ee(s)),l&&l!=s&&(l=Ee(l));var g=[s];if(!c){var v,y=t.text.length-2;if(0<y&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Me(s[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function Ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ne(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Ie(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Pe(e){return e.inclusiveLeft?-1:0}function Re(e){return e.inclusiveRight?1:0}function Be(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ve(n.from,i.from)||Pe(e)-Pe(t);if(o)return-o;var a=ve(n.to,i.to)||Re(e)-Re(t);return a||t.id-e.id}function De(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Be(r,i.marker)<0)&&(r=i.marker);return r}function Fe(e){return De(e,!0)}function ze(e){return De(e,!1)}function We(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Be(r,o.marker)<0)&&(r=o.marker)}return r}function qe(e,t,r,n,i){var o=le(e,t),a=Le&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ve(c.from,r)||Pe(l.marker)-Pe(i),f=ve(c.to,n)||Re(l.marker)-Re(i);if(!(0<=u&&f<=0||u<=0&&0<=f)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?0<=ve(c.to,r):0<ve(c.to,r))||0<=u&&(l.marker.inclusiveRight&&i.inclusiveLeft?ve(c.from,n)<=0:ve(c.from,n)<0)))return!0}}}function He(e){for(var t;t=Fe(e);)e=t.find(-1,!0).line;return e}function je(e,t){var r=le(e,t),n=He(r);return r==n?t:de(n)}function Ke(e,t){if(t>e.lastLine())return t;var r,n=le(e,t);if(!Ue(e,n))return t;for(;r=ze(n);)n=r.find(1,!0).line;return de(n)+1}function Ue(e,t){var r=Le&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).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,Te(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]).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 $e(e){for(var t=0,r=(e=He(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;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==r)break;t+=s.height}return t}function Ge(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Fe(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ze(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Xe(e){var r=e.display,t=e.doc;r.maxLine=le(t,t.first),r.maxLineLength=Ge(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=Ge(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var Ye=null;function Qe(e,t,r){var n;Ye=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:Ye=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Ye=i)}return null!=n?n:Ye}var Je=function(){var D="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",F="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var z=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,W=/[stwN]/,q=/[LRr]/,H=/[Lb1n]/,j=/[1n]/;function K(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!z.test(e))return!1;for(var n,i=e.length,o=[],a=0;a<i;++a)o.push((n=e.charCodeAt(a))<=247?D.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?F.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var s=0,l=r;s<i;++s){var c=o[s];"m"==c?o[s]=l:l=c}for(var u=0,f=r;u<i;++u){var d=o[u];"1"==d&&"r"==f?o[u]="n":q.test(d)&&"r"==(f=d)&&(o[u]="R")}for(var h=1,p=o[0];h<i-1;++h){var m=o[h];"+"==m&&"1"==p&&"1"==o[h+1]?o[h]="1":","!=m||p!=o[h+1]||"1"!=p&&"n"!=p||(o[h]=p),p=m}for(var g=0;g<i;++g){var v=o[g];if(","==v)o[g]="N";else if("%"==v){var y=void 0;for(y=g+1;y<i&&"%"==o[y];++y);for(var b=g&&"!"==o[g-1]||y<i&&"1"==o[y]?"1":"N",x=g;x<y;++x)o[x]=b;g=y-1}}for(var w=0,k=r;w<i;++w){var C=o[w];"L"==k&&"1"==C?o[w]="L":q.test(C)&&(k=C)}for(var S=0;S<i;++S)if(W.test(o[S])){var _=void 0;for(_=S+1;_<i&&W.test(o[_]);++_);for(var L="L"==(S?o[S-1]:r),M=L==("L"==(_<i?o[_]:r))?L?"L":"R":r,T=S;T<_;++T)o[T]=M;S=_-1}for(var A,O=[],E=0;E<i;)if(H.test(o[E])){var N=E;for(++E;E<i&&H.test(o[E]);++E);O.push(new K(0,N,E))}else{var I=E,P=O.length;for(++E;E<i&&"L"!=o[E];++E);for(var R=I;R<E;)if(j.test(o[R])){I<R&&O.splice(P,0,new K(1,I,R));var B=R;for(++R;R<E&&j.test(o[R]);++R);O.splice(P,0,new K(2,B,R)),I=R}else++R;I<E&&O.splice(P,0,new K(1,I,E))}return"ltr"==t&&(1==O[0].level&&(A=e.match(/^\s+/))&&(O[0].from=A[0].length,O.unshift(new K(0,0,A[0].length))),1==X(O).level&&(A=e.match(/\s+$/))&&(X(O).to-=A[0].length,O.push(new K(0,i-A[0].length,i)))),"rtl"==t?O.reverse():O}}();function Ze(e,t){var r=e.order;return null==r&&(r=e.order=Je(e.text,t)),r}var et=[],tt=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]||et).concat(r)}};function rt(e,t){return e._handlers&&e._handlers[t]||et}function nt(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=W(i,r);-1<o&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function it(e,t){var r=rt(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 ot(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),it(e,r||t.type,e,t),ft(t)||t.codemirrorIgnore}function at(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)-1==W(r,t[n])&&r.push(t[n])}function st(e,t){return 0<rt(e,t).length}function lt(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function ct(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ft(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function dt(e){ct(e),ut(e)}function ht(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),x&&e.ctrlKey&&1==t&&(t=3),t}var mt,gt,vt=function(){if(w&&k<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==mt){var t=O("span","");T(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&2<t.offsetHeight&&!(w&&k<8))}var r=mt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function bt(e){if(null!=gt)return gt;var t=T(e,document.createTextNode("AخA")),r=_(t,0,1).getBoundingClientRect(),n=_(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(gt=n.right-r.right<3)}var xt,wt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(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/)},kt=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)},Ct="oncopy"in(xt=O("div"))||(xt.setAttribute("oncopy","return;"),"function"==typeof xt.oncopy),St=null;var _t={},Lt={};function Mt(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Tt(e,t){t=Mt(t);var r=_t[t.name];if(!r)return Tt(e,"text/plain");var n=r(e,t);if(At.hasOwnProperty(t.name)){var i=At[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var At={};function Ot(e,t){D(t,At.hasOwnProperty(e)?At[e]:At[e]={})}function Et(e,t){if(!0===t)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 Nt(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 It(e,t,r){return!e.startState||e.startState(t,r)}var Pt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.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},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.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)},Pt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(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!1!==t&&(this.pos+=e.length),!0},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Rt=function(e,t){this.state=e,this.lookAhead=t},Bt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function Dt(t,r,n,e){var l=[t.state.modeGen],i={};Vt(t,r.text,t.doc.mode,n,function(e,t){return l.push(e,t)},i,e);for(var c=n.state,o=function(e){n.baseTokens=l;var o=t.state.overlays[e],a=1,s=0;n.state=!0,Vt(t,r.text,o.mode,n,function(e,t){for(var r=a;s<e;){var n=l[a];e<n&&l.splice(a,1,e,l[a+1],n),a+=2,s=Math.min(e,n)}if(t)if(o.opaque)l.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var i=l[r+1];l[r+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=c,n.baseTokens=null,n.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:l,classes:i.bgClass||i.textClass?i:null}}function Ft(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=zt(e,de(t)),i=t.text.length>e.options.maxHighlightLength&&Et(e.doc.mode,n.state),o=Dt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function zt(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new Bt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;a<s;--s){if(s<=o.first)return o.first;var l=le(o,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof Rt?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==i||u<n)&&(i=s-1,n=u)}return i}(r,n,e),a=o>t.first&&le(t,o-1).stateAfter,s=a?Bt.fromSaved(t,a,o):new Bt(t,It(t.mode),o);return t.iter(o,n,function(e){Wt(r,e.text,s);var t=s.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?s.save():null,s.nextLine()}),e&&(t.modeFrontier=s.line),s}function Wt(e,t,r,n){var i=e.doc.mode,o=new Pt(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&qt(i,r.state);!o.eol();)Ht(i,o,r.state),o.start=o.pos}function qt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Nt(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Ht(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Nt(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.")}Bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Bt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Bt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},Bt.fromSaved=function(e,t,r){return t instanceof Rt?new Bt(e,Et(e.mode,t.state),r,t.lookAhead):new Bt(e,Et(e.mode,t),r)},Bt.prototype.save=function(e){var t=!1!==e?Et(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new Rt(t,this.maxLookAhead):t};var jt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Kt(e,t,r,n){var i,o,a=e.doc,s=a.mode,l=le(a,(t=Ce(a,t)).line),c=zt(e,t.line,r),u=new Pt(l.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Ht(s,u,c.state),n&&o.push(new jt(u,i,Et(a.mode,c.state)));return n?o:new jt(u,i,c.state)}function Ut(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 Vt(e,t,r,n,i,o,a){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,f=new Pt(t,e.options.tabSize,n),d=e.options.addModeClass&&[null];for(""==t&&Ut(qt(r,n.state),o);!f.eol();){if(l=f.pos>e.options.maxHighlightLength?(s=!1,a&&Wt(e,t,n,f.pos),f.pos=t.length,null):Ut(Ht(r,f,n.state,d),o),d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=l}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}var $t=function(e,t,r){this.text=e,Ie(this,t),this.height=r?r(this):1};$t.prototype.lineNo=function(){return de(this)},lt($t);var Gt={},Xt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Xt:Gt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var r=A("span",null,null,b?"padding-right: .1px":null),n={pre:A("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=Zt,bt(e.display.measure)&&(a=Ze(o,e.doc.direction))&&(n.addToken=er(n.addToken,a)),n.map=[],rr(o,n,Ft(e,o,t!=e.display.externalMeasured&&de(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(yt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function Jt(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,r,n,i,o,a){if(t){var s,l=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.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}(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1;if(c.test(t)){s=document.createDocumentFragment();for(var f=0;;){c.lastIndex=f;var d=c.exec(t),h=d?d.index-f:t.length-f;if(h){var p=document.createTextNode(l.slice(f,f+h));w&&k<9?s.appendChild(O("span",[p])):s.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!d)break;f+=h+1;var m=void 0;if("\t"==d[0]){var g=e.cm.options.tabSize,v=g-e.col%g;(m=s.appendChild(O("span",G(v),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=v}else"\r"==d[0]||"\n"==d[0]?(m=s.appendChild(O("span","\r"==d[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",d[0]):((m=e.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),w&&k<9?s.appendChild(O("span",[m])):s.appendChild(m)),e.col+=1;e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,s=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,s),w&&k<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==l.charCodeAt(t.length-1),r||n||i||u||o){var y=r||"";n&&(y+=n),i&&(y+=i);var b=O("span",[s],y,o);if(a)for(var x in a)a.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&b.setAttribute(x,a[x]);return e.content.appendChild(b)}e.content.appendChild(s)}}function er(f,d){return function(e,t,r,n,i,o,a){r=r?r+" cm-force-border":"cm-force-border";for(var s=e.pos,l=s+t.length;;){for(var c=void 0,u=0;u<d.length&&!((c=d[u]).to>s&&c.from<=s);u++);if(c.to>=l)return f(e,t,r,n,i,o,a);f(e,t.slice(0,c.to-s),r,n,null,o,a),n=null,t=t.slice(c.to-s),s=c.to}}}function tr(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 rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,s,l,c,u,f,d,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",f=d=null,v=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var w=n[x],k=w.marker;if("bookmark"==k.type&&w.from==p&&k.widgetNode)y.push(k);else if(w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&((d||(d={})).title=k.title),k.attributes)for(var C in k.attributes)(d||(d={}))[C]=k.attributes[C];k.collapsed&&(!f||Be(f.marker,k)<0)&&(f=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!f||f.from==p)for(var _=0;_<y.length;++_)tr(t,0,y[_]);if(f&&(f.from||0)==p){if(tr(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(h<=p)break;for(var L=Math.min(h,v);;){if(g){var M=p+g.length;if(!f){var T=L<M?g.slice(0,L-p):g;t.addToken(t,T,a?a+l:l,u,p+T.length==v?c:"",s,d)}if(L<=M){g=g.slice(L-p),p=L;break}p=M,u=""}g=i.slice(o,o=r[m++]),a=Yt(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),Yt(r[A+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=ze(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?de(X(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ue(e,t)}function ir(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new nr(e.doc,le(e.doc,o),o);n=o+a.size,i.push(a)}return i}var or=null;var ar=null;function sr(e,t){var r=rt(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(lr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function lr(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?dr(e,t):"gutter"==o?pr(e,t,r,n):"class"==o?hr(e,t):"widget"==o&&mr(e,t,n)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),w&&k<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Qt(e,t)}function dr(e,t){var r=t.text.className,n=fr(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,hr(e,t)):r&&(t.text.className=r)}function hr(e,t){!function(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 n=ur(t);t.background=n.insertBefore(O("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(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 pr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ur(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=ur(t),s=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(O("div",me(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var c=e.options.gutters[l],u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(O("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function mr(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);gr(e,t,r)}function gr(e,t,r){if(vr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)vr(e,t.rest[n],t,r,!1)}function vr(e,t,r,n,i){if(t.widgets)for(var o=ur(r),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=O("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),yr(l,c,r,n),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),sr(l,"redraw")}}function yr(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 br(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,O("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function xr(e,t){for(var r=ht(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 wr(e){return e.lineSpace.offsetTop}function kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Cr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,O("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Sr(e){return q-e.display.nativeBarWidth}function _r(e){return e.display.scroller.clientWidth-Sr(e)-e.display.barWidth}function Lr(e){return e.display.scroller.clientHeight-Sr(e)-e.display.barHeight}function Mr(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(de(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Tr(e,t,r,n){return Er(e,Or(e,t),r,n)}function Ar(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[sn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Or(e,t){var r=de(t),n=Ar(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,tn(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=de(t=He(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var i=n.built=Qt(e,n);return n.text=i.pre,T(e.display.lineMeasure,i.pre),n}(e,t));var i=Mr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Er(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||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&_r(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(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];2<Math.abs(l.bottom-c.bottom)&&o.push((l.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Pr(t.map,r,n),a=o.node,s=o.start,l=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;s&&ie(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+l));)++l;if((i=w&&k<9&&0==s&&l==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Rr(_(a,s,l).getClientRects(),n)).left||i.right||0==s)break;l=s,s-=1,c="right"}w&&k<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=St)return St;var t=T(e,O("span","x")),r=t.getBoundingClientRect(),n=_(t,0,1).getBoundingClientRect();return St=1<Math.abs(r.left-n.left)}(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}}(e.display.measure,i))}else{var f;0<s&&(c=n="right"),i=e.options.lineWrapping&&1<(f=a.getClientRects()).length?f["right"==n?f.length-1:0]:a.getBoundingClientRect()}if(w&&k<9&&!s&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+en(e.display),top:d.top,bottom:d.bottom}:Ir}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};i.left||i.right||(x.bogus=!0);e.options.singleCursorHeightPerLine||(x.rtop=h,x.rbottom=p);return x}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Nr,Ir={left:0,right:0,top:0,bottom:0};function Pr(e,t,r){for(var n,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=(i=t-s)+1:(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,l<=t&&(a="right")),null!=i){if(n=e[c+2],s==l&&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==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function Rr(e,t){var r=Ir;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;0<=i&&(r=e[i]).left==r.right;i--);return r}function Br(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 Dr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Br(e.display.view[t])}function Fr(e){Dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function zr(){return a&&f?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Wr(){return a&&f?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function Hr(e,t,r,n,i){if(!i){var o=qr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=$e(t);if("local"==n?a+=wr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==n?0:Wr());var l=s.left+("window"==n?0:zr());r.left+=l,r.right+=l}return r.top+=a,r.bottom+=a,r}function jr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=zr(),i-=Wr();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 Kr(e,t,r,n,i){return n||(n=le(e.doc,t.line)),Hr(e,n,Tr(e,n,t.ch,i),r)}function Ur(n,e,i,o,a,s){function l(e,t){var r=Er(n,a,e,t?"right":"left",s);return t?r.left=r.right:r.right=r.left,Hr(n,o,r,i)}o=o||le(n.doc,e.line),a||(a=Or(n,o));var c=Ze(o,n.doc.direction),t=e.ch,r=e.sticky;if(t>=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!c)return l("before"==r?t-1:t,"before"==r);function u(e,t,r){return l(r?e-1:e,1==c[t].level!=r)}var f=Qe(c,t,r),d=Ye,h=u(t,f,"before"==r);return null!=d&&(h.other=u(t,d,"before"!=r)),h}function Vr(e,t){var r=0;t=Ce(e.doc,t),e.options.lineWrapping||(r=en(e.display)*t.ch);var n=le(e.doc,t.line),i=$e(n)+wr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function $r(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function Gr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return $r(n.first,0,null,!0,-1);var i=he(n,r),o=n.first+n.size-1;if(o<i)return $r(n.first+n.size-1,le(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=le(n,i);;){var s=Jr(e,a,i,t,r),l=We(a,s.ch+(0<s.xRel?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=le(n,i=c.line)}}function Xr(t,e,r,n){n-=qr(e);var i=e.text.length,o=ae(function(e){return Er(t,r,e-1).bottom<=n},i,0);return{begin:o,end:i=ae(function(e){return Er(t,r,e).top>n},o,i)}}function Yr(e,t,r,n){return r||(r=Or(e,t)),Xr(e,t,r,Hr(e,t,Er(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(r,e,t,n,i){i-=$e(e);var o=Or(r,e),a=qr(e),s=0,l=e.text.length,c=!0,u=Ze(e,r.doc.direction);if(u){var f=(r.options.lineWrapping?function(e,t,r,n,i,o,a){var s=Xr(e,t,n,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=c||h.to<=l)){var p=1!=h.level,m=Er(e,n,p?Math.min(c,h.to)-1:Math.max(l,h.from)).right,g=m<o?o-m+1e9:m-o;(!u||g<f)&&(u=h,f=g)}}u||(u=i[i.length-1]);u.from<l&&(u={from:l,to:u.to,level:u.level});u.to>c&&(u={from:u.from,to:c,level:u.level});return u}:function(n,i,o,a,s,l,c){var e=ae(function(e){var t=s[e],r=1!=t.level;return Qr(Ur(n,ge(o,r?t.to:t.from,r?"before":"after"),"line",i,a),l,c,!0)},0,s.length-1),t=s[e];if(0<e){var r=1!=t.level,u=Ur(n,ge(o,r?t.from:t.to,r?"after":"before"),"line",i,a);Qr(u,l,c,!0)&&u.top>c&&(t=s[e-1])}return t})(r,e,t,o,u,n,i);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var d,h,p=null,m=null,g=ae(function(e){var t=Er(r,o,e);return t.top+=a,t.bottom+=a,!!Qr(t,n,i,!1)&&(t.top<=i&&t.left<=n&&(p=e,m=t),!0)},s,l),v=!1;if(m){var y=n-m.left<m.right-n,b=y==c;g=p+(b?0:1),h=b?"after":"before",d=y?m.left:m.right}else{c||g!=l&&g!=s||g++,h=0==g?"after":g==e.text.length?"before":Er(r,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var x=Ur(r,ge(t,g,h),"line",e,o);d=x.left,v=i<x.top||i>=x.bottom}return $r(t,g=oe(e.text,g,1),h,v,n-d)}function Zr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Nr){Nr=O("pre");for(var t=0;t<49;++t)Nr.appendChild(document.createTextNode("x")),Nr.appendChild(O("br"));Nr.appendChild(document.createTextNode("x"))}T(e.measure,Nr);var r=Nr.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),M(e.measure),r||1}function en(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),r=O("pre",[t]);T(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function tn(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:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function nn(n){var i=Zr(n.display),o=n.options.lineWrapping,a=o&&Math.max(5,n.display.scroller.clientWidth/en(n.display)-3);return function(e){if(Ue(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function on(e){var t=e.doc,r=nn(e);t.iter(function(e){var t=r(e);t!=e.height&&fe(e,t)})}function an(e,t,r,n){var i=e.display;if(!r&&"true"==ht(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=Gr(e,o,a);if(n&&1==c.xRel&&(l=le(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=ge(c.line,Math.max(0,Math.round((o-Cr(e.display).left)/en(e.display))-u))}return c}function sn(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 ln(e){e.display.input.showSelection(e.display.input.prepareSelection())}function cn(e,t){void 0===t&&(t=!0);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||a!=r.sel.primIndex){var s=r.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&un(e,s.head,i),l||dn(e,s,o)}}return n}function un(e,t,r){var n=Ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function fn(e,t){return e.top-t.top||e.left-t.left}function dn(a,e,t){var r=a.display,n=a.doc,i=document.createDocumentFragment(),o=Cr(a.display),L=o.left,M=Math.max(r.sizerWidth,_r(a)-r.sizer.offsetLeft)-o.right,T="ltr"==n.direction;function A(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?M-e:r)+"px;\n height: "+(n-t)+"px"))}function s(r,y,b){var x,w,o=le(n,r),k=o.text.length;function C(e,t){return Kr(a,ge(r,e),"div",o,t)}function S(e,t,r){var n=Yr(a,o,null,e),i="ltr"==t==("after"==r)?"left":"right";return C("after"==r?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1),i)[i]}var _=Ze(o,n.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);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",o),i=!0)}i||n(t,r,"ltr")}(_,y||0,null==b?k:b,function(e,t,r,n){var i="ltr"==r,o=C(e,i?"left":"right"),a=C(t-1,i?"right":"left"),s=null==y&&0==e,l=null==b&&t==k,c=0==n,u=!_||n==_.length-1;if(a.top-o.top<=3){var f=(T?l:s)&&u,d=(T?s:l)&&c?L:(i?o:a).left,h=f?M:(i?a:o).right;A(d,o.top,h-d,o.bottom)}else{var p,m,g,v;v=i?(p=T&&s&&c?L:o.left,m=T?M:S(e,r,"before"),g=T?L:S(t,r,"after"),T&&l&&u?M:a.right):(p=T?S(e,r,"before"):L,m=!T&&s&&c?M:o.right,g=!T&&l&&u?L:a.left,T?S(t,r,"after"):M),A(p,o.top,m-p,o.bottom),o.bottom<a.top&&A(L,o.bottom,null,a.top),A(g,a.top,v-g,a.bottom)}(!x||fn(o,x)<0)&&(x=o),fn(a,x)<0&&(x=a),(!w||fn(o,w)<0)&&(w=o),fn(a,w)<0&&(w=a)}),{start:x,end:w}}var l=e.from(),c=e.to();if(l.line==c.line)s(l.line,l.ch,c.ch);else{var u=le(n,l.line),f=le(n,c.line),d=He(u)==He(f),h=s(l.line,l.ch,d?u.text.length+1:null).end,p=s(c.line,d?0:null,c.ch).start;d&&(h.top<p.top-2?(A(h.right,h.top,null,h.bottom),A(L,p.top,p.left,p.bottom)):A(h.right,h.top,p.left-h.right,h.bottom)),h.bottom<p.top&&A(L,h.bottom,null,p.top)}t.appendChild(i)}function hn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?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 pn(e){e.state.focused||(e.display.input.focus(),gn(e))}function mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vn(e))},100)}function gn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e))}function vn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,s=0;if(!i.hidden){if(w&&k<8){var l=i.node.offsetTop+i.node.offsetHeight;a=l-r,r=l}else{var c=i.node.getBoundingClientRect();a=c.bottom-c.top,!o&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var u=i.line.height-a;if((.005<u||u<-.005)&&(fe(i.line,a),bn(i.line),i.rest))for(var f=0;f<i.rest.length;f++)bn(i.rest[f]);if(s>e.display.sizerWidth){var d=Math.ceil(s/en(e.display));d>e.display.maxLineLength&&(e.display.maxLineLength=d,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function bn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function xn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-wr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=he(t,n),a=he(t,i);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<o?a=he(t,$e(le(t,o=s))+e.wrapper.clientHeight):Math.min(l,t.lastLine())>=a&&(o=he(t,$e(le(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function wn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rn(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 s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function kn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=me(e.options,t.first+t.size-1),n=e.display;if(r.length==n.lineNumChars)return!1;var i=n.measure.appendChild(O("div",[O("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",si(e),!0}function Cn(e,t){var r=e.display,n=Zr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Lr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+kr(r),l=t.top<n,c=t.bottom>s-n;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,d=_r(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 Sn(e,t){null!=t&&(Mn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function _n(e){Mn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ln(e,t,r){null==t&&null==r||Mn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Mn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Tn(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Tn(e,t,r,n){var i=Cn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ln(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||ai(e,{top:t}),On(e,t,!0),m&&ai(e),ti(e,100))}function On(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function En(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,wn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Nn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(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+Sr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var In=function(e,t,r){this.cm=r;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),tt(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),tt(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,w&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};In.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&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},In.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},In.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},In.prototype.zeroWidthHack=function(){var e=x&&!s?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},In.prototype.enableZeroWidthBar=function(r,n,i){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=r?r.style.pointerEvents="none":n.set(1e3,e)})},In.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Pn=function(){};function Rn(e,t){t||(t=Nn(e));var r=e.display.barWidth,n=e.display.barHeight;Bn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&yn(e),Bn(e,Nn(e)),r=e.display.barWidth,n=e.display.barHeight}function Bn(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=""}Pn.prototype.update=function(){return{bottom:0,right:0}},Pn.prototype.setScrollLeft=function(){},Pn.prototype.setScrollTop=function(){},Pn.prototype.clear=function(){};var Dn={native:In,null:Pn};function Fn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&L(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Dn[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),tt(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?En(r,e):An(r,e)},r),r.display.scrollbars.addClass&&I(r.display.wrapper,r.display.scrollbars.addClass)}var zn=0;function Wn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++zn},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function qn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(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)}(r)}finally{or=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Hn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ii(i.cm,i.update);var i;for(var o=0;o<t.length;o++)jn(t[o]);for(var a=0;a<t.length;a++)Kn(t[a]);for(var s=0;s<t.length;s++)Un(t[s])}(e)})}function Hn(e){var t,r,n=e.cm,i=n.display;!(r=(t=n).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Sr(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Sr(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Xe(n),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ni(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function jn(e){var t=e.cm,r=t.display;e.updatedDisplay&&yn(t),e.barMeasure=Nn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Tr(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+Sr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-_r(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Kn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&En(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Rn(t,e.barMeasure),e.updatedDisplay&&li(t,e.barMeasure),e.selectionChanged&&hn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&pn(e.cm)}function Un(e){var t=e.cm,r=t.display,n=t.doc;(e.updatedDisplay&&oi(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&On(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&En(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!ot(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=O("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-wr(e.display))+"px;\n height: "+(t.bottom-t.top+Sr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Ur(e,t),l=r&&r!=t?Ur(e,r):s,c=Cn(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(An(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(En(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-f)&&(a=!0)),!a)break}return i}(t,Ce(n,e.scrollToPos.from),Ce(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||it(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&it(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&it(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Vn(e,t){if(e.curOp)return t();Wn(e);try{return t()}finally{qn(e)}}function $n(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Wn(e);try{return t.apply(e,arguments)}finally{qn(e)}}}function Gn(e){return function(){if(this.curOp)return e.apply(this,arguments);Wn(this);try{return e.apply(this,arguments)}finally{qn(this)}}}function Xn(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Wn(e);try{return t.apply(this,arguments)}finally{qn(e)}}}function Yn(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)Le&&je(e.doc,t)<i.viewTo&&Jn(e);else if(r<=i.viewFrom)Le&&Ke(e.doc,r+n)>i.viewFrom?Jn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Jn(e);else if(t<=i.viewFrom){var o=Zn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Jn(e)}else if(r>=i.viewTo){var a=Zn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jn(e)}else{var s=Zn(e,t,t,-1),l=Zn(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(ir(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):Jn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function Qn(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[sn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==W(a,r)&&a.push(r)}}}function Jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zn(e,t,r,n){var i,o=sn(e,t),a=e.display.view;if(!Le||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(0<n){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;je(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 ei(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 ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(ri,e))}function ri(l){var c=l.doc;if(!(c.highlightFrontier>=l.display.viewTo)){var u=+new Date+l.options.workTime,f=zt(l,c.highlightFrontier),d=[];c.iter(f.line,Math.min(c.first+c.size,l.display.viewTo+500),function(e){if(f.line>=l.display.viewFrom){var t=e.styles,r=e.text.length>l.options.maxHighlightLength?Et(c.mode,f.state):null,n=Dt(l,e,f,!0);r&&(f.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var a=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),s=0;!a&&s<t.length;++s)a=t[s]!=e.styles[s];a&&d.push(f.line),e.stateAfter=f.save(),f.nextLine()}else e.text.length<=l.options.maxHighlightLength&&Wt(l,e.text,f),e.stateAfter=f.line%5==0?f.save():null,f.nextLine();if(+new Date>u)return ti(l,l.options.workDelay),!0}),c.highlightFrontier=f.line,c.modeFrontier=Math.max(c.modeFrontier,f.line),d.length&&Vn(l,function(){for(var e=0;e<d.length;e++)Qn(l,d[e],"text")})}}var ni=function(e,t,r){var n=e.display;this.viewport=t,this.visible=xn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=_r(e),this.force=r,this.dims=tn(e),this.events=[]};function ii(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==ei(e))return!1;kn(e)&&(Jn(e),t.dims=tn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Le&&(o=je(e.doc,o),a=Ke(e.doc,a));var s,l,c,u,f=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;l=o,c=a,0==(u=(s=e).display).view.length||l>=u.viewTo||c<=u.viewFrom?(u.view=ir(s,l,c),u.viewFrom=l):(u.viewFrom>l?u.view=ir(s,l,u.viewFrom).concat(u.view):u.viewFrom<l&&(u.view=u.view.slice(sn(s,l))),u.viewFrom=l,u.viewTo<c?u.view=u.view.concat(ir(s,u.viewTo,c)):u.viewTo>c&&(u.view=u.view.slice(0,sn(s,c)))),u.viewTo=c,r.viewOffset=$e(le(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var d=ei(e);if(!f&&0==d&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var h=function(e){if(e.hasFocus())return null;var t=N();if(!t||!E(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&E(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4<d&&(r.lineDiv.style.display="none"),function(r,e,t){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function s(e){var t=e.nextSibling;return b&&x&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var l=n.view,c=n.viewFrom,u=0;u<l.length;u++){var f=l[u];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var d=i&&null!=e&&e<=c&&f.lineNumber;f.changes&&(-1<W(f.changes,"gutter")&&(d=!1),cr(r,f,c,t)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(me(r.options,c)))),a=f.node.nextSibling}else{var h=(g=c,v=t,void 0,y=fr(p=r,m=f),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),hr(p,m),pr(p,m,g,v),gr(p,m,v),m.node);o.insertBefore(h,a)}c+=f.size}var p,m,g,v,y;for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),4<d&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=N()&&(e.activeElt.focus(),e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(h),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,f&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ti(e,400)),!(r.updateLineNumbers=null)}function oi(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=_r(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Lr(e),r.top)}),t.visible=xn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ii(e,t);n=!1){yn(e);var i=Nn(e);ln(e),Rn(e,i),li(e,i),t.force=!1}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 ai(e,t){var r=new ni(e,t);if(ii(e,r)){yn(e),oi(e,r);var n=Nn(e);ln(e),Rn(e,n),li(e,n),r.finish()}}function si(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function li(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+Sr(e)+"px"}function ci(e){var t=e.display.gutters,r=e.options.gutters;M(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(O("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",si(e)}function ui(e){var t=W(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ni.prototype.signal=function(e,t){st(e,t)&&this.events.push(arguments)},ni.prototype.finish=function(){for(var e=0;e<this.events.length;e++)it.apply(null,this.events[e])};var fi=0,di=null;function hi(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 pi(e){var t=hi(e);return t.x*=di,t.y*=di,t}function mi(e,t){var r=hi(t),n=r.x,i=r.y,o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(n&&s||i&&l){if(i&&x&&b)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&&!m&&!g&&null!=di)return i&&l&&An(e,Math.max(0,a.scrollTop+i*di)),En(e,Math.max(0,a.scrollLeft+n*di)),(!i||i&&l)&&ct(t),void(o.wheelStartX=null);if(i&&null!=di){var d=i*di,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),ai(e,{top:h,bottom:p})}fi<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&&(di=(di*fi+r)/(fi+1),++fi)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}w?di=-.53:m?di=15:a?di=-.7:l&&(di=-1/3);var gi=function(e,t){this.ranges=e,this.primIndex=t};gi.prototype.primary=function(){return this.ranges[this.primIndex]},gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!ye(r.anchor,n.anchor)||!ye(r.head,n.head))return!1}return!0},gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new vi(be(this.ranges[t].anchor),be(this.ranges[t].head));return new gi(e,this.primIndex)},gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},gi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=ve(t,n.from())&&ve(e,n.to())<=0)return r}return-1};var vi=function(e,t){this.anchor=e,this.head=t};function yi(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ve(e.from(),t.from())}),r=W(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=ve(s.to(),a.from());if(n&&!a.empty()?0<l:0<=l){var c=we(s.from(),a.from()),u=xe(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new vi(f?u:c,f?c:u))}}return new gi(t,r)}function bi(e,t){return new gi([new vi(e,t||e)],0)}function xi(e){return e.text?ge(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function wi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return xi(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+=xi(t).ch-t.to.ch),ge(r,n)}function ki(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new vi(wi(i.anchor,t),wi(i.head,t)))}return yi(e.cm,r,e.sel.primIndex)}function Ci(e,t,r){return e.line==t.line?ge(r.line,e.ch-t.ch+r.ch):ge(r.line+(e.line-t.line),e.ch)}function Si(e){e.doc.mode=Tt(e.options,e.doc.modeOption),_i(e)}function _i(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&Yn(e)}function Li(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ne(e),Ie(e,r);var i=n?n(e):1;i!=e.height&&fe(e,i)}(e,t,r,i),sr(e,"change",e,n)}function a(e,t){for(var r=[],n=e;n<t;++n)r.push(new $t(c[n],o(n),i));return r}var s=n.from,l=n.to,c=n.text,u=le(e,s.line),f=le(e,l.line),d=X(c),h=o(c.length-1),p=l.line-s.line;if(n.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Li(e,n)){var m=a(0,c.length-1);r(f,f.text,h),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(u==f)if(1==c.length)r(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),h);else{var g=a(1,c.length-1);g.push(new $t(d+u.text.slice(l.ch),h,i)),r(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,g)}else if(1==c.length)r(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),o(0)),e.remove(s.line+1,p);else{r(u,u.text.slice(0,s.ch)+c[0],o(0)),r(f,d+f.text.slice(l.ch),h);var v=a(1,c.length-1);1<p&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}sr(e,"change",e,n)}function Ti(e,s,l){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var a=n&&o.sharedHist;l&&!a||(s(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function Ai(e,t){if(t.cm)throw new Error("This document is already in use.");on((e.doc=t).cm=e),Si(e),Oi(e),e.options.lineWrapping||Xe(e),e.options.mode=t.modeOption,Yn(e)}function Oi(e){("rtl"==e.doc.direction?I:L)(e.display.lineDiv,"CodeMirror-rtl")}function Ei(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 Ni(e,t){var r={from:be(t.from),to:xi(t),text:ce(e,t.from,t.to)};return Di(e,r,t.from.line,t.to.line+1),Ti(e,function(e){return Di(e,r,t.from.line,t.to.line+1)},!0),r}function Ii(e){for(;e.length;){if(!X(e).ranges)break;e.pop()}}function Pi(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,s,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(s=i).lastOp==n?(Ii(s.done),X(s.done)):s.done.length&&!X(s.done).ranges?X(s.done):1<s.done.length&&!s.done[s.done.length-2].ranges?(s.done.pop(),X(s.done)):void 0))a=X(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,a.to)?a.to=xi(t):o.changes.push(Ni(e,t));else{var c=X(i.done);for(c&&c.ranges||Bi(e.sel,i.done),o={changes:[Ni(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||it(e,"historyAdded")}function Ri(e,t,r,n){var i,o,a,s,l,c=e.history,u=n&&n.origin;r==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(i=e,o=u,a=X(c.done),s=t,"*"==(l=o.charAt(0))||"+"==l&&a.ranges.length==s.ranges.length&&a.somethingSelected()==s.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:Bi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,n&&!1!==n.clearRedo&&Ii(c.undone)}function Bi(e,t){var r=X(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Di(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i||(i=r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Fi(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 zi(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Fi(r[i]));return n}(e,t),n=Oe(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 s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(r[i]=a)}return r}function Wi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?gi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];n.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&-1<W(t,Number(u[1]))&&(X(s)[f]=c[f],delete c[f])}}}return n}function qi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ve(t,i)<0;o!=ve(r,i)<0?(i=t,t=r):o!=ve(t,r)<0&&(t=r)}return new vi(i,t)}return new vi(r||t,t)}function Hi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),$i(e,new gi([qi(e.sel.primary(),t,r,i)],0),n)}function ji(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=qi(e.sel.ranges[o],t[o],null,i);$i(e,yi(e.cm,n,e.sel.primIndex),r)}function Ki(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,$i(e,yi(e.cm,i,e.sel.primIndex),n)}function Ui(e,t,r,n){$i(e,bi(t,r),n)}function Vi(e,t,r){var n=e.history.done,i=X(n);i&&i.ranges?Gi(e,n[n.length-1]=t,r):$i(e,t,r)}function $i(e,t,r){Gi(e,t,r),Ri(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Gi(e,t,r){var n,i,o,a;(st(e,"beforeSelectionChange")||e.cm&&st(e.cm,"beforeSelectionChange"))&&(n=e,o=r,a={ranges:(i=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new vi(Ce(n,e[t].anchor),Ce(n,e[t].head))},origin:o&&o.origin},it(n,"beforeSelectionChange",n,a),n.cm&&it(n.cm,"beforeSelectionChange",n.cm,a),t=a.ranges!=i.ranges?yi(n.cm,a.ranges,a.ranges.length-1):i),Xi(e,Qi(e,t,r&&r.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||_n(e.cm)}function Xi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,at(e.cm)),sr(e,"cursorActivity",e))}function Yi(e){Xi(e,Qi(e,e.sel,null,!1))}function Qi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Zi(e,a.anchor,s&&s.anchor,r,n),c=Zi(e,a.head,s&&s.head,r,n);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new vi(l,c))}return i?yi(e.cm,i,t.primIndex):t}function Ji(e,t,r,n,i){var o=le(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker;if((null==s.from||(l.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(l.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(it(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var c=l.find(n<0?1:-1),u=void 0;if((n<0?l.inclusiveRight:l.inclusiveLeft)&&(c=eo(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ve(c,r))&&(n<0?u<0:0<u))return Ji(e,c,t,n,i)}var f=l.find(n<0?-1:1);return(n<0?l.inclusiveLeft:l.inclusiveRight)&&(f=eo(e,f,n,f.line==t.line?o:null)),f?Ji(e,f,t,n,i):null}}return t}function Zi(e,t,r,n,i){var o=n||1,a=Ji(e,t,r,o,i)||!i&&Ji(e,t,r,o,!0)||Ji(e,t,r,-o,i)||!i&&Ji(e,t,r,-o,!0);return a||(e.cantEdit=!0,ge(e.first,0))}function eo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Ce(e,ge(t.line-1)):null:0<r&&t.ch==(n||le(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+r)}function to(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),j)}function ro(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=Ce(i,e)),t&&(o.to=Ce(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),it(i,"beforeChange",i,o),i.cm&&it(i.cm,"beforeChange",i.cm,o),o.canceled?(i.cm&&(i.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function no(e,t,r){if(e.cm){if(!e.cm.curOp)return $n(e.cm,no)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(st(e,"beforeChange")||e.cm&&st(e.cm,"beforeChange"))||(t=ro(e,t,!0))){var n=_e&&!r&&function(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&&-1!=W(n,r)||(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],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(ve(c.to,s.from)<0||0<ve(c.from,s.to))){var u=[l,1],f=ve(c.from,s.from),d=ve(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(0<d||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)io(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else io(e,t)}}function io(e,r){if(1!=r.text.length||""!=r.text[0]||0!=ve(r.from,r.to)){var t=ki(e,r);Pi(e,r,t,e.cm?e.cm.curOp.id:NaN),so(e,r,t,Oe(e,r));var n=[];Ti(e,function(e,t){t||-1!=W(n,e.history)||(fo(e.history,r),n.push(e.history)),so(e,r,null,Oe(e,r))})}}function oo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,r=i.history,n=i.sel,s="undo"==o?r.done:r.undone,l="undo"==o?r.undone:r.done,c=0;c<s.length&&(a=s[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=s.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(!(a=s.pop()).ranges){if(t)return void s.push(a);break}if(Bi(a,l),e&&!a.equals(i.sel))return void $i(i,a,{clearRedo:!1});n=a}var u=[];Bi(n,l),l.push({changes:u,generation:r.generation}),r.generation=a.generation||++r.maxGeneration;for(var f=st(i,"beforeChange")||i.cm&&st(i.cm,"beforeChange"),d=function(e){var r=a.changes[e];if(r.origin=o,f&&!ro(i,r,!1))return s.length=0,{};u.push(Ni(i,r));var t=e?ki(i,r):X(s);so(i,r,t,zi(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:xi(r)});var n=[];Ti(i,function(e,t){t||-1!=W(n,e.history)||(fo(e.history,r),n.push(e.history)),so(e,r,null,zi(e,r))})},h=a.changes.length-1;0<=h;--h){var p=d(h);if(p)return p.v}}}}function ao(e,t){if(0!=t&&(e.first+=t,e.sel=new gi(Y(e.sel.ranges,function(e){return new vi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Yn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Qn(e.cm,n,"gutter")}}function so(e,t,r,n){if(e.cm&&!e.cm.curOp)return $n(e.cm,so)(e,t,r,n);if(t.to.line<e.first)ao(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ao(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,le(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),r||(r=ki(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=de(He(le(n,o.line))),n.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0}));-1<n.sel.contains(t.from,t.to)&&at(e);Mi(n,t,r,nn(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,function(e){var t=Ge(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;r<n;n--){var i=le(e,n).stateAfter;if(i&&(!(i instanceof Rt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ti(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Yn(e):o.line!=a.line||1!=t.text.length||Li(e.doc,t)?Yn(e,o.line,a.line+1,c):Qn(e,o.line,"text");var u=st(e,"changes"),f=st(e,"change");if(f||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&sr(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,n):Mi(e,t,n),Gi(e,r,j)}}function lo(e,t,r,n,i){var o;n||(n=r),ve(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),no(e,{from:r,to:n,text:t,origin:i})}function co(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function uo(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()).copied=!0);for(var s=0;s<o.ranges.length;s++)co(o.ranges[s].anchor,t,r,n),co(o.ranges[s].head,t,r,n)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(r<c.from.line)c.from=ge(c.from.line+n,c.from.ch),c.to=ge(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 fo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;uo(e.done,r,n,i),uo(e.undone,r,n,i)}function ho(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=le(e,ke(e,t)):i=de(t),null==i?null:(n(o,i)&&e.cm&&Qn(e.cm,i,r),o)}function po(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function mo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}vi.prototype.from=function(){return we(this.anchor,this.head)},vi.prototype.to=function(){return xe(this.anchor,this.head)},vi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,n=e,i=e+t;n<i;++n){var o=this.lines[n];this.height-=o.height,(r=o).parent=null,Ne(r),sr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof po))){var s=[];this.collapse(s),this.children=[new po(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&50<i.lines.length){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new po(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new mo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=W(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new mo(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var go=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function vo(e,t,r){$e(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sn(e,r)}go.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=de(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=br(this);fe(r,Math.max(0,r.height-o)),e&&(Vn(e,function(){vo(e,r,-o),Qn(e,n,"widget")}),sr(e,"lineWidgetCleared",e,this,n))}},go.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=br(this)-t;i&&(Ue(this.doc,n)||fe(n,n.height+i),r&&Vn(r,function(){r.curOp.forceUpdate=!0,vo(r,n,i),sr(r,"lineWidgetChanged",r,e,de(n))}))},lt(go);var yo=0,bo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};function xo(t,n,i,e,r){if(e&&e.shared)return function(e,r,n,i,o){(i=D(i)).shared=!1;var a=[xo(e,r,n,i,o)],s=a[0],l=i.widgetNode;return Ti(e,function(e){l&&(i.widgetNode=l.cloneNode(!0)),a.push(xo(e,Ce(e,r),Ce(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;s=X(a)}),new wo(a,s)}(t,n,i,e,r);if(t.cm&&!t.cm.curOp)return $n(t.cm,xo)(t,n,i,e,r);var o=new bo(t,r),a=ve(n,i);if(e&&D(e,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(qe(t,n.line,n,i,o)||n.line!=i.line&&qe(t,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Pi(t,{from:n,to:i,origin:"markText"},t.sel,NaN);var s,l=n.line,c=t.cm;if(t.iter(l,i.line+1,function(e){var t,r;c&&o.collapsed&&!c.options.lineWrapping&&He(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=n.line&&fe(e,0),t=e,r=new Me(o,l==n.line?n.ch:null,l==i.line?i.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],r.marker.attachLine(t),++l}),o.collapsed&&t.iter(n.line,i.line+1,function(e){Ue(t,e)&&fe(e,0)}),o.clearOnEnter&&tt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(_e=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++yo,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Yn(c,n.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=n.line;u<=i.line;u++)Qn(c,u,"text");o.atomic&&Yi(c.doc),sr(c,"markerAdded",c,o)}return o}bo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&Wn(t),st(this,"clear")){var n=this.find();n&&sr(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var s=e.lines[a],l=Te(s.markedSpans,e);t&&!e.collapsed?Qn(t,de(s),"text"):t&&(null!=l.to&&(o=de(s)),null!=l.from&&(i=de(s))),s.markedSpans=Ae(s.markedSpans,l),null==l.from&&e.collapsed&&!Ue(e.doc,s)&&t&&fe(s,Zr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=He(e.lines[c]),f=Ge(u);f>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Yn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Yi(t.doc)),t&&sr(t,"markerCleared",t,this,i,o),r&&qn(t),this.parent&&this.parent.clear()}},bo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Te(o.markedSpans,this);if(null!=a.from&&(r=ge(t?o:de(o),a.from),-1==e))return r;if(null!=a.to&&(n=ge(t?o:de(o),a.to),1==e))return n}return r&&{from:r,to:n}},bo.prototype.changed=function(){var o=this,a=this.find(-1,!0),s=this,l=this.doc.cm;a&&l&&Vn(l,function(){var e=a.line,t=de(a.line),r=Ar(l,t);if(r&&(Br(r),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ue(s.doc,e)&&null!=s.height){var n=s.height;s.height=null;var i=br(s)-n;i&&fe(e,e.height+i)}sr(l,"markerChanged",l,o)})},bo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bo.prototype.detachLine=function(e){if(this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},lt(bo);var wo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ko(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function Co(o){for(var e=function(e){var t=o[e],r=[t.primary.doc];Ti(t.primary.doc,function(e){return r.push(e)});for(var n=0;n<t.markers.length;n++){var i=t.markers[n];-1==W(r,i.doc)&&(i.parent=null,t.markers.splice(n--,1))}},t=0;t<o.length;t++)e(t)}wo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},wo.prototype.find=function(e,t){return this.primary.find(e,t)},lt(wo);var So=0,_o=function(e,t,r,n,i){if(!(this instanceof _o))return new _o(e,t,r,n,i);null==r&&(r=0),mo.call(this,[new po([new $t("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ge(r,0);this.sel=bi(o),this.history=new Ei(null),this.id=++So,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mi(this,{from:o,to:o,text:e}),$i(this,bi(o),j)};_o.prototype=J(mo.prototype,{constructor:_o,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=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Xn(function(e){var t=ge(this.first,0),r=this.first+this.size-1;no(this,{from:t,to:ge(r,le(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ln(this.cm,0,0),$i(this,bi(t),j)}),replaceRange:function(e,t,r,n){lo(this,e,t=Ce(this,t),r=r?Ce(this,r):t,n)},getRange:function(e,t,r){var n=ce(this,Ce(this,e),Ce(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return le(this,e)},getLineNumber:function(e){return de(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=le(this,e)),He(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(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||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Xn(function(e,t,r){Ui(this,Ce(this,"number"==typeof e?ge(e,t||0):e),null,r)}),setSelection:Xn(function(e,t,r){Ui(this,Ce(this,e),Ce(this,t||e),r)}),extendSelection:Xn(function(e,t,r){Hi(this,Ce(this,e),t&&Ce(this,t),r)}),extendSelections:Xn(function(e,t){ji(this,Se(this,e),t)}),extendSelectionsBy:Xn(function(e,t){ji(this,Se(this,Y(this.sel.ranges,e)),t)}),setSelections:Xn(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new vi(Ce(this,e[i].anchor),Ce(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),$i(this,yi(this.cm,n,t),r)}}),addSelection:Xn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new vi(Ce(this,e),Ce(this,t||e))),$i(this,yi(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},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:Xn(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=ge(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=Ci(s.from,i,o),c=Ci(xi(s),i,o);if(i=s.to,o=c,"around"==r){var u=e.sel.ranges[a],f=ve(u.head,u.anchor)<0;n[a]=new vi(f?c:l,f?l:c)}else n[a]=new vi(l,l)}return new gi(n,e.sel.primIndex)}(this,n,t),l=n.length-1;0<=l;l--)no(this,n[l]);s?Vi(this,s):this.cm&&_n(this.cm)}),undo:Xn(function(){oo(this,"undo")}),redo:Xn(function(){oo(this,"redo")}),undoSelection:Xn(function(){oo(this,"undo",!0)}),redoSelection:Xn(function(){oo(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 Ei(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:Wi(this.history.done),undone:Wi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ei(this.history.maxGeneration);t.done=Wi(e.done.slice(0),null,!0),t.undone=Wi(e.undone.slice(0),null,!0)},setGutterMarker:Xn(function(e,r,n){return ho(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&re(t)&&(e.gutterMarkers=null),!0})}),clearGutter:Xn(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ho(r,e,"gutter",function(){return e.gutterMarkers[t]=null,re(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(!(e=le(this,t=e)))return null}else if(null==(t=de(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:Xn(function(e,r,n){return ho(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(S(n).test(e[t]))return!1;e[t]+=" "+n}else e[t]=n;return!0})}),removeLineClass:Xn(function(e,o,a){return ho(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(!r)return!1;if(null==a)e[t]=null;else{var n=r.match(S(a));if(!n)return!1;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return!0})}),addLineWidget:Xn(function(e,t,r){return i=e,o=new go(n=this,t,r),(a=n.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),ho(n,i,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==o.insertAt?t.push(o):t.splice(Math.min(t.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ue(n,e)){var r=$e(e)<n.scrollTop;fe(e,e.height+br(o)),r&&Sn(a,o.height),a.curOp.forceUpdate=!0}return!0}),a&&sr(a,"lineWidgetAdded",a,o,"number"==typeof i?i:de(i)),o;var n,i,o,a}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return xo(this,Ce(this,e),Ce(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 xo(this,e=Ce(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=le(this,(e=Ce(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(i,o,a){i=Ce(this,i),o=Ce(this,o);var s=[],l=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];null!=n.to&&l==i.line&&i.ch>=n.to||null==n.from&&l!=i.line||null!=n.from&&l==o.line&&n.from>=o.ch||a&&!a(n.marker)||s.push(n.marker.parent||n.marker)}++l}),s},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(r<t)return n=r,!0;r-=t,++i}),Ce(this,ge(i,n))},indexFromPos:function(e){var t=(e=Ce(this,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 _o(ue(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 _o(ue(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}],function(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(ve(o,a)){var s=xo(e,o,a,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,ko(this)),n},unlinkDoc:function(e){if(e instanceof ka&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Co(ko(this));break}}if(e.history==this.history){var r=[e.id];Ti(e,function(e){return r.push(e.id)},!0),e.history=new Ei(null),e.history.done=Wi(this.history.done,r),e.history.undone=Wi(this.history.undone,r)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):wt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Xn(function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Vn(t=this.cm,function(){Oi(t),Yn(t)}))})}),_o.prototype.eachLine=_o.prototype.iter;var Lo=0;function Mo(e){var i=this;if(To(i),!ot(i,e)&&!xr(i.display,e)){ct(e),w&&(Lo=+new Date);var o=an(i,e,!0),t=e.dataTransfer.files;if(o&&!i.isReadOnly())if(t&&t.length&&window.FileReader&&window.File)for(var a=t.length,s=Array(a),l=0,r=function(e,r){if(!i.options.allowDropFileTypes||-1!=W(i.options.allowDropFileTypes,e.type)){var n=new FileReader;n.onload=$n(i,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),s[r]=e,++l==a){var t={from:o=Ce(i.doc,o),to:o,text:i.doc.splitLines(s.join(i.doc.lineSeparator())),origin:"paste"};no(i.doc,t),Vi(i.doc,bi(o,xi(t)))}}),n.readAsText(e)}},n=0;n<a;++n)r(t[n],n);else{if(i.state.draggingText&&-1<i.doc.sel.contains(o))return i.state.draggingText(e),void setTimeout(function(){return i.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(i.state.draggingText&&!i.state.draggingText.copy&&(u=i.listSelections()),Gi(i.doc,bi(o,o)),u)for(var f=0;f<u.length;++f)lo(i.doc,"",u[f].anchor,u[f].head,"drag");i.replaceSelection(c,"around","paste"),i.display.input.focus()}}catch(e){}}}}function To(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ao(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var e=0;e<r.length;e++)t(r[e])})}}var Oo=!1;function Eo(){var e;Oo||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ao(No)},100))}),tt(window,"blur",function(){return Ao(vn)}),Oo=!0)}function No(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Io={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Po=0;Po<10;Po++)Io[Po+48]=Io[Po+96]=String(Po);for(var Ro=65;Ro<=90;Ro++)Io[Ro]=String.fromCharCode(Ro);for(var Bo=1;Bo<=12;Bo++)Io[Bo+111]=Io[Bo+63235]="F"+Bo;var Do={};function Fo(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function zo(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=Y(r.split(" "),Fo),o=0;o<i.length;o++){var a=void 0,s=void 0;a=o==i.length-1?(s=i.join(" "),n):(s=i.slice(0,o+1).join(" "),"...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Wo(e,t,r,n){var i=(t=Ko(t)).call?t.call(e,n):t[e];if(!1===i)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 Wo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Wo(e,t.fallthrough[o],r,n);if(a)return a}}}function qo(e){var t="string"==typeof e?e:Io[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ho(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function jo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var r=Io[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Ho(r,e,t))}function Ko(e){return"string"==typeof e?Do[e]:e}function Uo(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ve(o.from,X(n).to)<=0;){var a=n.pop();if(ve(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Vn(t,function(){for(var e=n.length-1;0<=e;e--)lo(t.doc,"",n[e].from,n[e].to,"+delete");_n(t)})}function Vo(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function $o(e,t,r){var n=Vo(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function Go(e,t,r,n,i){if(e){var o=Ze(r,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(0<s.level||"rtl"==t.doc.direction){var c=Or(t,r);a=i<0?r.text.length-1:0;var u=Er(t,c,a).top;a=ae(function(e){return Er(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Vo(r,a,1))}else a=i<0?s.to:s.from;return new ge(n,a,l)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}Do.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"},Do.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"},Do.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"},Do.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"]},Do.default=x?Do.macDefault:Do.pcDefault;var Xo={selectAll:to,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(r){return Uo(r,function(e){if(e.empty()){var t=le(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:ge(e.head.line+1,0)}:{from:e.head,to:ge(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return Uo(t,function(e){return{from:ge(e.from().line,0),to:Ce(t.doc,ge(e.to().line+1,0))}})},delLineLeft:function(e){return Uo(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return Uo(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){return Uo(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},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(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return Yo(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return Qo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var r=le(e.doc,t),n=function(e){for(var t;t=ze(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=de(n));return Go(!0,e,r,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},U)},goLineLeft:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},U)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?Qo(n,e.head):r},U)},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(G(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return Vn(a,function(){for(var e=a.listSelections(),t=[],r=0;r<e.length;r++)if(e[r].empty()){var n=e[r].head,i=le(a.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new ge(n.line,n.ch-1)),0<n.ch)n=new ge(n.line,n.ch+1),a.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),ge(n.line,n.ch-2),n,"+transpose");else if(n.line>a.doc.first){var o=le(a.doc,n.line-1).text;o&&(n=new ge(n.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),ge(n.line-1,o.length-1),n,"+transpose"))}t.push(new vi(n,n))}a.setSelections(t)})},newlineAndIndent:function(n){return Vn(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;r<e.length;r++)n.indentLine(e[r].from().line,null,!0);_n(n)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Yo(e,t){var r=le(e.doc,t),n=He(r);return n!=r&&(t=de(n)),Go(!0,e,n,t,1)}function Qo(e,t){var r=Yo(e,t.line),n=le(e.doc,r.line),i=Ze(n,e.doc.direction);if(i&&0!=i[0].level)return r;var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ge(r.line,a?0:o,r.sticky)}function Jo(e,t,r){if("string"==typeof t&&!(t=Xo[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)!=H}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var Zo=new z;function ea(e,t,r,n){var i=e.state.keySeq;if(i){if(qo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Zo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ta(e,i+" "+t,r,n))return!0}return ta(e,t,r,n)}function ta(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Wo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Wo(t,e.options.extraKeys,r,e)||Wo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(ct(r),hn(e)),!!i}function ra(t,e){var r=jo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?ea(t,"Shift-"+r,e,function(e){return Jo(t,e,!0)})||ea(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return Jo(t,e)}):ea(t,r,e,function(e){return Jo(t,e)}))}var na=null;function ia(e){var t=this;if(t.curOp.focus=N(),!ot(t,e)){w&&k<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ra(t,e);g&&(na=n?r:null,!n&&88==r&&!Ct&&(x?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),nt(document,"keyup",r),nt(document,"mouseover",r))}I(t,"CodeMirror-crosshair"),tt(document,"keyup",r),tt(document,"mouseover",r)}(t)}}function oa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ot(this,e)}function aa(e){var t=this;if(!(xr(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(g&&r==na)return na=null,void ct(e);if(!g||e.which&&!(e.which<10)||!ra(t,e)){var i,o=String.fromCharCode(null==n?r:n);if("\b"!=o)if(!ea(i=t,"'"+o+"'",e,function(e){return Jo(i,e,!0)}))t.display.input.onKeyPress(e)}}}var sa,la,ca=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ua(e){var t=this,r=t.display;if(!(ot(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,xr(r,e))b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!ha(t,e)){var n,i,o,a=an(t,e),s=pt(e),l=a?(n=a,i=s,o=+new Date,la&&la.compare(o,n,i)?(sa=la=null,"triple"):sa&&sa.compare(o,n,i)?(la=new ca(o,n,i),sa=null,"double"):(sa=new ca(o,n,i),la=null,"single")):"single";window.focus(),1==s&&t.state.selectingText&&t.state.selectingText(e),a&&function(r,e,n,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ea(r,Ho(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=Xo[e]),!e)return!1;var t=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),t=e(r,n)!=H}finally{r.state.suppressEdits=!1}return t})}(t,s,a,l,e)||(1==s?a?function(e,t,r,n){w?setTimeout(B(pn,e),0):e.curOp.focus=N();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=h?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=x?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(x?r.altKey:r.ctrlKey));return i}(e,r,n),a=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==r&&-1<(i=a.contains(t))&&(ve((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ve(i.to(),t)||t.xRel<0)?function(t,r,n,i){var o=t.display,a=!1,s=$n(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,nt(o.wrapper.ownerDocument,"mouseup",s),nt(o.wrapper.ownerDocument,"mousemove",l),nt(o.scroller,"dragstart",c),nt(o.scroller,"drop",s),a||(ct(e),i.addNew||Hi(t.doc,n,null,null,i.extend),b||w&&9==k?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),l=function(e){a=a||10<=Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)},c=function(){return a=!0};b&&(o.scroller.draggable=!0);(t.state.draggingText=s).copy=!i.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();tt(o.wrapper.ownerDocument,"mouseup",s),tt(o.wrapper.ownerDocument,"mousemove",l),tt(o.scroller,"dragstart",c),tt(o.scroller,"drop",s),mn(t),setTimeout(function(){return o.input.focus()},20)}(e,n,t,o):function(g,e,v,y){var a=g.display,b=g.doc;ct(e);var x,w,k=b.sel,t=k.ranges;y.addNew&&!y.extend?(w=b.sel.contains(v),x=-1<w?t[w]:new vi(v,v)):(x=b.sel.primary(),w=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(x=new vi(v,v)),v=an(g,e,!0,!0),w=-1;else{var r=fa(g,v,y.unit);x=y.extend?qi(x,r.anchor,r.head,y.extend):r}y.addNew?-1==w?(w=t.length,$i(b,yi(g,t.concat([x]),w),{scroll:!1,origin:"*mouse"})):1<t.length&&t[w].empty()&&"char"==y.unit&&!y.extend?($i(b,yi(g,t.slice(0,w).concat(t.slice(w+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Ki(b,w,x,K):($i(b,new gi([x],w=0),K),k=b.sel);var C=v;function s(e){if(0!=ve(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],r=g.options.tabSize,n=F(le(b,v.line).text,v.ch,r),i=F(le(b,e.line).text,e.ch,r),o=Math.min(n,i),a=Math.max(n,i),s=Math.min(v.line,e.line),l=Math.min(g.lastLine(),Math.max(v.line,e.line));s<=l;s++){var c=le(b,s).text,u=V(c,o,r);o==a?t.push(new vi(ge(s,u),ge(s,u))):c.length>u&&t.push(new vi(ge(s,u),ge(s,V(c,a,r))))}t.length||t.push(new vi(v,v)),$i(b,yi(g,k.ranges.slice(0,w).concat(t),w),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var f,d=x,h=fa(g,e,y.unit),p=d.anchor;p=0<ve(h.anchor,p)?(f=h.head,we(d.from(),h.anchor)):(f=h.anchor,xe(d.to(),h.head));var m=k.ranges.slice(0);m[w]=function(e,t){var r=t.anchor,n=t.head,i=le(e.doc,r.line);if(0==ve(r,n)&&r.sticky==n.sticky)return t;var o=Ze(i);if(!o)return t;var a=Qe(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,c=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)l=0<(n.line-r.line)*("ltr"==e.doc.direction?1:-1);else{var u=Qe(o,n.ch,n.sticky),f=u-a||(n.ch-r.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:0<f}var d=o[c+(l?-1:0)],h=l==(1==d.level),p=h?d.from:d.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new vi(new ge(r.line,p,m),n)}(g,new vi(Ce(b,p),f)),$i(b,yi(g,m,w),K)}}var l=a.wrapper.getBoundingClientRect(),c=0;function n(e){g.state.selectingText=!1,c=1/0,ct(e),a.input.focus(),nt(a.wrapper.ownerDocument,"mousemove",i),nt(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=$n(g,function(e){0!==e.buttons&&pt(e)?function e(t){var r=++c;var n=an(g,t,!0,"rectangle"==y.unit);if(!n)return;if(0!=ve(n,C)){g.curOp.focus=N(),s(n);var i=xn(a,b);(n.line>=i.to||n.line<i.from)&&setTimeout($n(g,function(){c==r&&e(t)}),150)}else{var o=t.clientY<l.top?-20:t.clientY>l.bottom?20:0;o&&setTimeout($n(g,function(){c==r&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):n(e)}),o=$n(g,n);g.state.selectingText=o,tt(a.wrapper.ownerDocument,"mousemove",i),tt(a.wrapper.ownerDocument,"mouseup",o)}(e,n,t,o)}(t,a,l,e):ht(e)==r.scroller&&ct(e):2==s?(a&&Hi(t.doc,a),setTimeout(function(){return r.input.focus()},20)):3==s&&(C?t.display.input.onContextMenu(e):mn(t)))}}function fa(e,t,r){if("char"==r)return new vi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new vi(ge(t.line,0),Ce(e.doc,ge(t.line+1,0)));var n=r(e,t);return new vi(n.from,n.to)}function da(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ct(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!st(e,r))return ft(t);o-=s.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return it(e,r,e,he(e.doc,o),e.options.gutters[l],t),ft(t)}}function ha(e,t){return da(e,t,"gutterClick",!0)}function pa(e,t){var r,n;xr(e.display,t)||(n=t,st(r=e,"gutterContextMenu")&&da(r,n,"gutterContextMenu",!1))||(ot(e,t,"contextmenu")||C||e.display.input.onContextMenu(t))}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fr(e)}ca.prototype.compare=function(e,t,r){return this.time+400>e&&0==ve(t,this.pos)&&r==this.button};var ga={toString:function(){return"CodeMirror.Init"}},va={},ya={};function ba(e){ci(e),Yn(e),wn(e)}function xa(e,t,r){if(!t!=!(r&&r!=ga)){var n=e.display.dragFunctions,i=t?tt:nt;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 wa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Xe(e)),on(e),Yn(e),Fr(e),setTimeout(function(){return Rn(e)},100)}function ka(e,t){var r=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?D(t):{},D(va,t,!1),ui(t);var n=t.value;"string"==typeof n?n=new _o(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new ka.inputStyles[t.inputStyle](this),o=this.display=new se(e,n,i);for(var a in ci(o.wrapper.CodeMirror=this),ma(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fn(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 z,keySeq:null,specialChars:null},t.autofocus&&!d&&o.input.focus(),w&&k<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;tt(o.scroller,"mousedown",$n(i,ua)),tt(o.scroller,"dblclick",w&&k<11?$n(i,function(e){if(!ot(i,e)){var t=an(i,e);if(t&&!ha(i,e)&&!xr(i.display,e)){ct(e);var r=i.findWordAt(t);Hi(i.doc,r.anchor,r.head)}}}):function(e){return ot(i,e)||ct(e)});tt(o.scroller,"contextmenu",function(e){return pa(i,e)});var r,n={end:0};function a(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}tt(o.scroller,"touchstart",function(e){if(!ot(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ha(i,e)){o.input.ensurePolled(),clearTimeout(r);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),tt(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),tt(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!xr(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(o.activeTouch,"page");r=!t.prev||s(t,t.prev)?new vi(n,n):!t.prev.prev||s(t,t.prev.prev)?i.findWordAt(n):new vi(ge(n.line,0),Ce(i.doc,ge(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),ct(e)}a()}),tt(o.scroller,"touchcancel",a),tt(o.scroller,"scroll",function(){o.scroller.clientHeight&&(An(i,o.scroller.scrollTop),En(i,o.scroller.scrollLeft,!0),it(i,"scroll",i))}),tt(o.scroller,"mousewheel",function(e){return mi(i,e)}),tt(o.scroller,"DOMMouseScroll",function(e){return mi(i,e)}),tt(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){ot(i,e)||dt(e)},over:function(e){ot(i,e)||(!function(e,t){var r=an(e,t);if(r){var n=document.createDocumentFragment();un(e,r,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,n)}}(i,e),dt(e))},start:function(e){return function(e,t){if(w&&(!e.state.draggingText||+new Date-Lo<100))dt(t);else if(!ot(e,t)&&!xr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!l)){var r=O("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}(i,e)},drop:$n(i,Mo),leave:function(e){ot(i,e)||To(i)}};var e=o.input.getField();tt(e,"keyup",function(e){return oa.call(i,e)}),tt(e,"keydown",$n(i,ia)),tt(e,"keypress",$n(i,aa)),tt(e,"focus",function(e){return gn(i,e)}),tt(e,"blur",function(e){return vn(i,e)})}(this),Eo(),Wn(this),this.curOp.forceUpdate=!0,Ai(this,n),t.autofocus&&!d||this.hasFocus()?setTimeout(B(gn,this),20):vn(this),ya)ya.hasOwnProperty(a)&&ya[a](r,t[a],ga);kn(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Ca.length;++s)Ca[s](r);qn(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=va,ka.optionHandlers=ya;var Ca=[];function Sa(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=zt(e,t).state:r="prev");var a=e.options.tabSize,s=le(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==H||150<c)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?F(le(o,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)d+=a,f+="\t";if(d<c&&(f+=G(c-d)),f!=u)return lo(o,f,ge(t,0),ge(t,u.length),"+input"),!(s.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=ge(t,u.length);Ki(o,p,new vi(g,g));break}}}ka.defineInitHook=function(e){return Ca.push(e)};var _a=null;function La(e){_a=e}function Ma(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=wt(t),c=null;if(s&&1<n.ranges.length)if(_a&&_a.text.join("\n")==t){if(n.ranges.length%_a.text.length==0){c=[];for(var u=0;u<_a.text.length;u++)c.push(o.splitLines(_a.text[u]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=Y(l,function(e){return[e]}));for(var f=e.curOp.updateInput,d=n.ranges.length-1;0<=d;d--){var h=n.ranges[d],p=h.from(),m=h.to();h.empty()&&(r&&0<r?p=ge(p.line,p.ch-r):e.state.overwrite&&!s?m=ge(m.line,Math.min(le(o,m.line).text.length,m.ch+X(l).length)):s&&_a&&_a.lineWise&&_a.text.join("\n")==t&&(p=m=ge(p.line,0)));var g={from:p,to:m,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};no(e.doc,g),sr(e,"inputRead",e,g)}t&&!s&&Aa(e,t),_n(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ta(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vn(t,function(){return Ma(t,r,0,null,"paste")}),!0}function Aa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(-1<t.indexOf(o.electricChars.charAt(s))){a=Sa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(le(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Sa(e,i.head.line,"smart"));a&&sr(e,"electricInput",e,i.head.line)}}}function Oa(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:ge(i,0),head:ge(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ea(e,t,r,n){e.setAttribute("autocorrect",!!r),e.setAttribute("autocapitalize",!!n),e.setAttribute("spellcheck",!!t)}function Na(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),u&&(e.style.border="1px solid black"),Ea(e),t}function Ia(n,i,o,e,a){var t=i,r=o,s=le(n,i.line);function l(e){var t,r;if(null==(t=a?function(t,r,s,e){var l=Ze(r,t.doc.direction);if(!l)return $o(r,s,e);s.ch>=r.text.length?(s.ch=r.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var n=Qe(l,s.ch,s.sticky),i=l[n];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>s.ch:i.from<s.ch))return $o(r,s,e);var o,c=function(e,t){return Vo(r,e instanceof ge?e.ch:e,t)},a=function(e){return t.options.lineWrapping?(o=o||Or(t,r),Yr(t,r,o,e)):{begin:0,end:r.text.length}},u=a("before"==s.sticky?c(s,-1):s.ch);if("rtl"==t.doc.direction||1==i.level){var f=1==i.level==e<0,d=c(s,f?1:-1);if(null!=d&&(f?d<=i.to&&d<=u.end:d>=i.from&&d>=u.begin)){var h=f?"before":"after";return new ge(s.line,d,h)}}var p=function(e,t,r){for(var n=function(e,t){return t?new ge(s.line,c(e,1),"before"):new ge(s.line,e,"after")};0<=e&&e<l.length;e+=t){var i=l[e],o=0<t==(1!=i.level),a=o?r.begin:c(r.end,-1);if(i.from<=a&&a<i.to)return n(a,o);if(a=o?i.from:c(i.to,-1),r.begin<=a&&a<r.end)return n(a,o)}},m=p(n+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==r.text.length||!(m=p(0<e?0:l.length-1,e,a(g)))?null:m}(n.cm,s,i,o):$o(s,i,o))){if(e||(r=i.line+o)<n.first||r>=n.first+n.size||(i=new ge(r,i.ch,i.sticky),!(s=le(n,r))))return!1;i=Go(a,n.cm,s,i.line,o)}else i=t;return!0}if("char"==e)l();else if("column"==e)l(!0);else if("word"==e||"group"==e)for(var c=null,u="group"==e,f=n.cm&&n.cm.getHelper(i,"wordChars"),d=!0;!(o<0)||l(!d);d=!1){var h=s.text.charAt(i.ch)||"\n",p=te(h,f)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||d||p||(p="s"),c&&c!=p){o<0&&(o=1,l(),i.sticky="after");break}if(p&&(c=p),0<o&&!l(!d))break}var m=Zi(n,i,t,r,!0);return ye(t,m)&&(m.hitSide=!0),m}function Pa(e,t,r,n){var i,o,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Zr(e.display),3);i=(0<r?t.bottom:t.top)+r*c}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;(o=Gr(e,s,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var Ra=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ba(e,t){var r=Ar(e,t.line);if(!r||r.hidden)return null;var n=le(e.doc,t.line),i=Mr(r,n,t.line),o=Ze(n,e.doc.direction),a="left";o&&(a=Qe(o,t.ch)%2?"right":"left");var s=Pr(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Da(e,t){return t&&(e.bad=!0),e}function Fa(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Da(e.clipPos(ge(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 za(o,t,r)}}function za(c,e,t){var r=c.text.firstChild,n=!1;if(!e||!E(r,e))return Da(ge(de(c.line),0),!0);if(e==r&&(n=!0,e=r.childNodes[t],t=0,!e)){var i=c.rest?X(c.rest):c.line;return Da(ge(de(i),i.text.length),n)}var o=3==e.nodeType?e:null,a=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t&&(t=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var u=c.measure,f=u.maps;function s(e,t,r){for(var n=-1;n<(f?f.length:0);n++)for(var i=n<0?u.map:f[n],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var s=de(n<0?c.line:c.rest[n]),l=i[o]+r;return(r<0||a!=e)&&(l=i[o+(r?1:0)]),ge(s,l)}}}var l=s(o,a,t);if(l)return Da(l,n);for(var d=a.nextSibling,h=o?o.nodeValue.length-t:0;d;d=d.nextSibling){if(l=s(d,d.firstChild,0))return Da(ge(l.line,l.ch-h),n);h+=d.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(l=s(p,p.firstChild,-1))return Da(ge(l.line,l.ch+m),n);m+=p.textContent.length}}Ra.prototype.init=function(e){var t=this,a=this,s=a.cm,l=a.div=e.lineDiv;function r(e){if(!ot(s,e)){if(s.somethingSelected())La({lineWise:!1,text:s.getSelections()}),"cut"==e.type&&s.replaceSelection("",null,"cut");else{if(!s.options.lineWiseCopyCut)return;var t=Oa(s);La({lineWise:!0,text:t.text}),"cut"==e.type&&s.operation(function(){s.setSelections(t.ranges,0,j),s.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=_a.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=Na(),i=n.firstChild;s.display.lineSpace.insertBefore(n,s.display.lineSpace.firstChild),i.value=_a.text.join("\n");var o=document.activeElement;R(i),setTimeout(function(){s.display.lineSpace.removeChild(n),o.focus(),o==l&&a.showPrimarySelection()},50)}}Ea(l,s.options.spellcheck,s.options.autocorrect,s.options.autocapitalize),tt(l,"paste",function(e){ot(s,e)||Ta(e,s)||k<=11&&setTimeout($n(s,function(){return t.updateFromDOM()}),20)}),tt(l,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),tt(l,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),tt(l,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),tt(l,"touchstart",function(){return a.forceCompositionEnd()}),tt(l,"input",function(){t.composing||t.readFromDOMSoon()}),tt(l,"copy",r),tt(l,"cut",r)},Ra.prototype.prepareSelection=function(){var e=cn(this.cm,!1);return e.focus=this.cm.state.focused,e},Ra.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ra.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ra.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Fa(t,e.anchorNode,e.anchorOffset),a=Fa(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ve(we(o,a),n)||0!=ve(xe(o,a),i)){var s=t.display.view,l=n.line>=t.display.viewFrom&&Ba(t,n)||{node:s[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Ba(t,i);if(!c){var u=s[s.length-1].measure,f=u.maps?u.maps[u.maps.length-1]:u.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(l&&c){var d,h=e.rangeCount&&e.getRangeAt(0);try{d=_(l.node,l.offset,c.offset,c.node)}catch(e){}d&&(!m&&t.state.focused?(e.collapse(l.node,l.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),h&&null==e.anchorNode?e.addRange(h):m&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ra.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)},Ra.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Ra.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ra.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Ra.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ra.prototype.blur=function(){this.div.blur()},Ra.prototype.getField=function(){return this.div},Ra.prototype.supportsTouch=function(){return!0},Ra.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Vn(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},Ra.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ra.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(f&&a&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(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=Fa(t,e.anchorNode,e.anchorOffset),n=Fa(t,e.focusNode,e.focusOffset);r&&n&&Vn(t,function(){$i(t.doc,bi(r,n),j),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Ra.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ge(a.line-1,le(n.doc,a.line-1).length)),s.ch==le(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=ge(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;r=a.line==i.viewFrom||0==(e=sn(n,a.line))?(t=de(i.view[0].line),i.view[0].node):(t=de(i.view[e].line),i.view[e-1].node.nextSibling);var l,c,u=sn(n,s.line);if(c=u==i.view.length-1?(l=i.viewTo-1,i.lineDiv.lastChild):(l=de(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(l,e,t,c,u){var r="",f=!1,d=l.doc.lineSeparator(),h=!1;function p(){f&&(r+=d,h&&(r+=d),f=h=!1)}function m(e){e&&(p(),r+=e)}function g(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void m(t);var r,n=e.getAttribute("cm-marker");if(n){var i=l.findMarks(ge(c,0),ge(u+1,0),(s=+n,function(e){return e.id==s}));return void(i.length&&(r=i[0].find(0))&&m(ce(l.doc,r.from,r.to).join(d)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;o&&p();for(var a=0;a<e.childNodes.length;a++)g(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(h=!0),o&&(f=!0)}else 3==e.nodeType&&m(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var s}for(;g(e),e!=t;)e=e.nextSibling,h=!1;return r}(n,r,c,t,l)),d=ce(n.doc,ge(t,0),ge(l,le(n.doc,l).text.length));1<f.length&&1<d.length;)if(X(f)==X(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=X(f),b=X(d),x=Math.min(y.length-(1==f.length?h:0),b.length-(1==d.length?h:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==d.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var w=ge(t,h),k=ge(l,d.length?X(d).length-p:0);return 1<f.length||f[0]||ve(w,k)?(lo(n.doc,f,w,k,"+input"),!0):void 0},Ra.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ra.prototype.reset=function(){this.forceCompositionEnd()},Ra.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ra.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))},Ra.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vn(this.cm,function(){return Yn(e.cm)})},Ra.prototype.setUneditable=function(e){e.contentEditable="false"},Ra.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||$n(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ra.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ra.prototype.onContextMenu=function(){},Ra.prototype.resetPosition=function(){},Ra.prototype.needsContentAttribute=!0;var Wa,qa,Ha,ja=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};ja.prototype.init=function(r){var e=this,n=this,i=this.cm;this.createField(r);var o=this.textarea;function t(e){if(!ot(i,e)){if(i.somethingSelected())La({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Oa(i);La({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,j):(n.prevInput="",o.value=t.text.join("\n"),R(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),u&&(o.style.width="0px"),tt(o,"input",function(){w&&9<=k&&e.hasSelection&&(e.hasSelection=null),n.poll()}),tt(o,"paste",function(e){ot(i,e)||Ta(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())}),tt(o,"cut",t),tt(o,"copy",t),tt(r.scroller,"paste",function(e){if(!xr(r,e)&&!ot(i,e)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var t=new Event("paste");t.clipboardData=e.clipboardData,o.dispatchEvent(t)}}),tt(r.lineSpace,"selectstart",function(e){xr(r,e)||ct(e)}),tt(o,"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"})}}),tt(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ja.prototype.createField=function(e){this.wrapper=Na(),this.textarea=this.wrapper.firstChild},ja.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=cn(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},ja.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ja.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&R(this.textarea),w&&9<=k&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",w&&9<=k&&(this.hasSelection=null))}},ja.prototype.getField=function(){return this.textarea},ja.prototype.supportsTouch=function(){return!1},ja.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!d||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},ja.prototype.blur=function(){this.textarea.blur()},ja.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ja.prototype.receivedFocus=function(){this.slowPoll()},ja.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ja.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},ja.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||kt(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(w&&9<=k&&this.hasSelection===i||x&&/[\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,s=Math.min(n.length,i.length);a<s&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Vn(t,function(){Ma(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?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},ja.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ja.prototype.onKeyPress=function(){w&&9<=k&&(this.hasSelection=null),this.fastPoll()},ja.prototype.onContextMenu=function(e){var r=this,n=r.cm,i=n.display,o=r.textarea;r.contextMenuPending&&r.contextMenuPending();var t=an(n,e),a=i.scroller.scrollTop;if(t&&!g){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(t)&&$n(n,$i)(n.doc,bi(t),j);var s,l=o.style.cssText,c=r.wrapper.style.cssText,u=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n z-index: 1000; background: "+(w?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",b&&(s=window.scrollY),i.input.focus(),b&&window.scrollTo(null,s),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=h,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),w&&9<=k&&d(),C){dt(e);var f=function(){nt(window,"mouseup",f),setTimeout(h,20)};tt(window,"mouseup",f)}else setTimeout(h,50)}function d(){if(null!=o.selectionStart){var e=n.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,r.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function h(){if(r.contextMenuPending==h&&(r.contextMenuPending=!1,r.wrapper.style.cssText=c,o.style.cssText=l,w&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a),null!=o.selectionStart)){(!w||w&&k<9)&&d();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==r.prevInput?$n(n,to)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},ja.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ja.prototype.setUneditable=function(){},ja.prototype.needsContentAttribute=!1,function(i){var o=i.optionHandlers;function e(e,t,n,r){i.defaults[e]=t,n&&(o[e]=r?function(e,t,r){r!=ga&&n(e,t,r)}:n)}i.defineOption=e,i.Init=ga,e("value","",function(e,t){return e.setValue(t)},!0),e("mode",null,function(e,t){e.doc.modeOption=t,Si(e)},!0),e("indentUnit",2,Si,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(e){_i(e),Fr(e),Yn(e)},!0),e("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(ge(o,r))}o++});for(var t=i.length-1;0<=t;t--)lo(e.doc,n,i[t],ge(i[t].line,i[t].ch+n.length))}}),e("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!=ga&&e.refresh()}),e("specialCharPlaceholder",Jt,function(e){return e.refresh()},!0),e("electricChars",!0),e("inputStyle",d?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),e("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),e("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),e("rtlMoveVisually",!p),e("wholeLineUpdateBefore",!0),e("theme","default",function(e){ma(e),ba(e)},!0),e("keyMap","default",function(e,t,r){var n=Ko(t),i=r!=ga&&Ko(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,wa,!0),e("gutters",[],function(e){ui(e.options),ba(e)},!0),e("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rn(e.display)+"px":"0",e.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(e){return Rn(e)},!0),e("scrollbarStyle","native",function(e){Fn(e),Rn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),e("lineNumbers",!1,function(e){ui(e.options),ba(e)},!0),e("firstLineNumber",1,ba,!0),e("lineNumberFormatter",function(e){return e},ba,!0),e("showCursorWhenSelecting",!1,ln,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,function(e,t){"nocursor"==t&&(vn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),e("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),e("dragDrop",!0,xa),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,ln,!0),e("singleCursorHeightPerLine",!0,ln,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,_i,!0),e("addModeClass",!1,_i,!0),e("pollInterval",100),e("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),e("historyEventDelay",1250),e("viewportMargin",10,function(e){return e.refresh()},!0),e("maxHighlightLength",1e4,_i,!0),e("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),e("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),e("autofocus",null),e("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),e("phrases",null)}(ka),qa=(Wa=ka).optionHandlers,Ha=Wa.helpers={},Wa.prototype={constructor:Wa,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,qa.hasOwnProperty(e)&&$n(this,qa[e])(this,t,n),it(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"](Ko(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:Gn(function(e,t){var r=e.token?e:Wa.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,Yn(this)}),removeOverlay:Gn(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Yn(this)}}),indentLine:Gn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&Sa(this,e,t,r)}),indentSelection:Gn(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&&(Sa(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&_n(t));else{var a=o.from(),s=o.to(),l=Math.max(n,a.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var c=l;c<n;++c)Sa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&0<u[i].from().ch&&Ki(t.doc,i,new vi(a,u[i].to()),j)}}}),getTokenAt:function(e,t){return Kt(this,e,t)},getLineTokens:function(e,t){return Kt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,r=Ft(this,le(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 s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?Wa.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ha.hasOwnProperty(t))return r;var n=Ha[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var s=0;s<n._global.length;s++){var l=n._global[s];l.pred(i,this)&&-1==W(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var r=this.doc;return zt(this,(e=ke(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Ur(this,null==e?r.head:"object"==typeof e?Ce(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Kr(this,Ce(this.doc,e),t||"page")},coordsChar:function(e,t){return Gr(this,(e=jr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=jr(this,{top:e,left:0},t||"page").top,he(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:o<e&&(e=o,i=!0),n=le(this.doc,e)}else n=e;return Hr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-$e(n):0)},defaultTextHeight:function(){return Zr(this.display)},defaultCharWidth:function(){return en(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,s,l=this.display,c=(e=Ur(this,Ce(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Cn(o,a)).scrollTop&&An(o,s.scrollTop),null!=s.scrollLeft&&En(o,s.scrollLeft))},triggerOnKeyDown:Gn(ia),triggerOnKeyPress:Gn(aa),triggerOnKeyUp:oa,triggerOnMouseDown:Gn(ua),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Gn(function(e){Aa(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),a=0;a<t&&!(o=Ia(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:Gn(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?Ia(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},U)}),deleteH:Gn(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):Uo(this,function(e){var t=Ia(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=Ce(this.doc,e),s=0;s<t;++s){var l=Ur(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Pa(this,l,i,r)).hitSide)break}return a},moveV:Gn(function(n,i){var o=this,a=this.doc,s=[],l=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(e){if(l)return n<0?e.from():e.to();var t=Ur(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),s.push(t.left);var r=Pa(o,t,n,i);return"page"==i&&e==a.sel.primary()&&Sn(o,Kr(o,r,"div").top-t.top),r},U),s.length)for(var e=0;e<a.sel.ranges.length;e++)a.sel.ranges[e].goalColumn=s[e]}),findWordAt:function(e){var t=le(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new vi(ge(e.line,r),ge(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),it(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Gn(function(e,t){Ln(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Sr(this)-this.display.barHeight,width:e.scrollWidth-Sr(this)-this.display.barWidth,clientHeight:Lr(this),clientWidth:_r(this)}},scrollIntoView:Gn(function(e,t){var r,n;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(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?(n=e,Mn(r=this),r.curOp.scrollToPos=n):Tn(this,e.from,e.to,e.margin)}),setSize:Gn(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&&Dr(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){Qn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,it(this,"refresh",this)}),operation:function(e){return Vn(this,e)},startOperation:function(){return Wn(this)},endOperation:function(){return qn(this)},refresh:Gn(function(){var e=this.display.cachedTextHeight;Yn(this),this.curOp.forceUpdate=!0,Fr(this),Ln(this,this.doc.scrollLeft,this.doc.scrollTop),si(this),(null==e||.5<Math.abs(e-Zr(this.display)))&&on(this),it(this,"refresh",this)}),swapDoc:Gn(function(e){var t=this.doc;return t.cm=null,Ai(this,e),Fr(this),this.display.input.reset(),Ln(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},lt(Wa),Wa.registerHelper=function(e,t,r){Ha.hasOwnProperty(e)||(Ha[e]=Wa[e]={_global:[]}),Ha[e][t]=r},Wa.registerGlobalHelper=function(e,t,r,n){Wa.registerHelper(e,t,n),Ha[e]._global.push({pred:r,val:n})};var Ka,Ua="iter insert remove copy getEditor constructor".split(" ");for(var Va in _o.prototype)_o.prototype.hasOwnProperty(Va)&&W(Ua,Va)<0&&(ka.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(_o.prototype[Va]));return lt(_o),ka.inputStyles={textarea:ja,contenteditable:Ra},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_t[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){Lt[e]=t},ka.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){_o.prototype[e]=t},ka.fromTextArea=function(t,e){if((e=e?D(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=N();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}function n(){t.value=s.getValue()}var i;if(t.form&&(tt(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(nt(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var s=ka(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return s},(Ka=ka).off=nt,Ka.on=tt,Ka.wheelEventPixels=pi,Ka.Doc=_o,Ka.splitLines=wt,Ka.countColumn=F,Ka.findColumn=V,Ka.isWordChar=ee,Ka.Pass=H,Ka.signal=it,Ka.Line=$t,Ka.changeEnd=xi,Ka.scrollbarModel=Dn,Ka.Pos=ge,Ka.cmpPos=ve,Ka.modes=_t,Ka.mimeModes=Lt,Ka.resolveMode=Mt,Ka.getMode=Tt,Ka.modeExtensions=At,Ka.extendMode=Ot,Ka.copyState=Et,Ka.startState=It,Ka.innerMode=Nt,Ka.commands=Xo,Ka.keyMap=Do,Ka.keyName=jo,Ka.isModifierKey=qo,Ka.lookupKey=Wo,Ka.normalizeKeyMap=zo,Ka.StringStream=Pt,Ka.SharedTextMarker=wo,Ka.TextMarker=bo,Ka.LineWidget=go,Ka.e_preventDefault=ct,Ka.e_stopPropagation=ut,Ka.e_stop=dt,Ka.addClass=I,Ka.contains=E,Ka.rmClass=L,Ka.keyNames=Io,ka.version="5.44.0",ka}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(C){"use strict";var S={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},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};C.defineMode("xml",function(e,t){var a,o,s=e.indentUnit,l={},r=t.htmlMode?S:_;for(var n in r)l[n]=r[n];for(var n in t)l[n]=t[n];function c(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(i("atom","]]>")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=i("meta","?>"),"meta"):(a=t.eat("/")?"closeTag":"openTag",r.tokenize=u,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function u(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=c,a=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return a="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=u;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=c,t.state=p,t.tagName=t.tagStart=null;var n,i,o=t.tokenize(e,t);return o?o+" tag error":"tag error"}function i(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=c;break}e.next()}return r}}function f(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(r)||!l.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",b):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,r)):(o="error",m)}function g(e,t,r){if("word"!=e)return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,r)):(o="error",y);var n=t.current();return r.context&&r.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||!1===l.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,r){return"endTag"!=e?(o="error",v):(d(r),p)}function y(e,t,r){return o="error",v(e,0,r)}function b(e,t,r){if("word"==e)return o="attribute",x;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(n)?h(r,n):(h(r,n),r.context=new f(r,n,i==r.indented)),p}function x(e,t,r){return"equals"==e?w:(l.allowMissing||(o="error"),b(e,0,r))}function w(e,t,r){return"string"==e?k:"word"==e&&l.allowUnquoted?(o="string",b):(o="error",b(e,0,r))}function k(e,t,r){return"string"==e?k:b(e,0,r)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,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;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!=r&&(o=null,t.state=t.state(a||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(n&&n.noIndent)return C.Pass;if(e.tokenize!=u&&e.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!l.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=l.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=b)}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.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";$e.defineMode("javascript",function(e,f){var n,i,d=e.indentUnit,h=f.statementIndent,a=f.jsonld,s=f.json||a,c=f.typescript,u=f.wordCharacters||/[\w$\xa1-\uffff]/,l=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),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:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,r){return n=e,i=r,t}function v(e,t){var i,r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(a&&"@"==e.peek()&&e.match(m))return t.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=v),g("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return g("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=y)(e,t):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Ve(e,t,1)?(function(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}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return(t.tokenize=b)(e,t);if("#"==r)return e.skipToEnd(),g("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),g("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current();if("."!=t.lastType){if(l.propertyIsEnumerable(n)){var o=l[n];return g(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function y(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var x="([{}])";function o(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){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;0<=a;--a){var s=e.string.charAt(a),l=x.indexOf(s);if(0<=l&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(3<=l&&l<6)++i;else if(u.test(s))o=!0;else{if(/["'\/]/.test(s))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(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 C(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(r=n.vars;r;r=r.next)if(r.name==t)return!0}var S={state:null,column:null,marked:null,cc:null};function _(){for(var e=arguments.length-1;0<=e;e--)S.cc.push(arguments[e])}function L(){return _.apply(null,arguments),!0}function M(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function r(e){var t=S.state;if(S.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,r){{if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new A(n,r.vars,!0):null}return M(t,r.vars)?r:new A(r.prev,new O(t,r.vars),!1)}return null}}(e,t.context);if(null!=r)return void(t.context=r)}else if(!M(e,t.localVars))return void(t.localVars=new O(e,t.localVars));f.globalVars&&!M(e,t.globalVars)&&(t.globalVars=new O(e,t.globalVars))}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function A(e,t,r){this.prev=e,this.vars=t,this.block=r}function O(e,t){this.name=e,this.next=t}var t=new O("this",new O("arguments",null));function E(){S.state.context=new A(S.state.context,S.state.localVars,!1),S.state.localVars=t}function N(){S.state.context=new A(S.state.context,S.state.localVars,!0),S.state.localVars=null}function I(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function P(n,i){var e=function(){var e=S.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new k(t,S.stream.column(),n,null,e.lexical,i)};return e.lex=!0,e}function R(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function B(r){return function e(t){return t==r?L():";"==r||"}"==t||")"==t||"]"==t?_():L(e)}}function D(e,t){return"var"==e?L(P("vardef",t),ve,B(";"),R):"keyword a"==e?L(P("form"),q,D,R):"keyword b"==e?L(P("form"),D,R):"keyword d"==e?S.stream.match(/^\s*$/,!1)?L():L(P("stat"),j,B(";"),R):"debugger"==e?L(B(";")):"{"==e?L(P("}"),N,oe,R,I):";"==e?L():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==R&&S.state.cc.pop()(),L(P("form"),q,D,R,Ce)):"function"==e?L(Me):"for"==e?L(P("form"),Se,D,R):"class"==e||c&&"interface"==t?(S.marked="keyword",L(P("form","class"==e?e:t),Ne,R)):"variable"==e?c&&"declare"==t?(S.marked="keyword",L(D)):c&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?L(Ke):"type"==t?L(Ae,B("operator"),ce,B(";")):L(P("form"),ye,B("{"),P("}"),oe,R,R)):c&&"namespace"==t?(S.marked="keyword",L(P("form"),z,D,R)):c&&"abstract"==t?(S.marked="keyword",L(D)):L(P("stat"),J):"switch"==e?L(P("form"),q,B("{"),P("}","switch"),N,oe,R,R,I):"case"==e?L(z,B(":")):"default"==e?L(B(":")):"catch"==e?L(P("form"),E,F,D,R,I):"export"==e?L(P("stat"),Be,R):"import"==e?L(P("stat"),Fe,R):"async"==e?L(D):"@"==t?L(z,D):_(P("stat"),z,B(";"),R)}function F(e){if("("==e)return L(Oe,B(")"))}function z(e,t){return H(e,t,!1)}function W(e,t){return H(e,t,!0)}function q(e){return"("!=e?_():L(P(")"),z,B(")"),R)}function H(e,t,r){if(S.state.fatArrowAt==S.stream.start){var n=r?X:G;if("("==e)return L(E,P(")"),ne(Oe,")"),R,B("=>"),n,I);if("variable"==e)return _(E,ye,B("=>"),n,I)}var i,o=r?U:K;return w.hasOwnProperty(e)?L(o):"function"==e?L(Me,o):"class"==e||c&&"interface"==t?(S.marked="keyword",L(P("form"),Ee,R)):"keyword c"==e||"async"==e?L(r?W:z):"("==e?L(P(")"),j,B(")"),R,o):"operator"==e||"spread"==e?L(r?W:z):"["==e?L(P("]"),je,R,o):"{"==e?ie(ee,"}",null,o):"quasi"==e?_(V,o):"new"==e?L((i=r,function(e){return"."==e?L(i?Q:Y):"variable"==e&&c?L(pe,i?U:K):_(i?W:z)})):"import"==e?L(z):L()}function j(e){return e.match(/[;\}\)\],]/)?_():_(z)}function K(e,t){return","==e?L(z):U(e,t,!1)}function U(e,t,r){var n=0==r?K:U,i=0==r?z:W;return"=>"==e?L(E,r?X:G,I):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?L(n):c&&"<"==t&&S.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?L(P(">"),ne(ce,">"),R,n):"?"==t?L(z,B(":"),i):L(i):"quasi"==e?_(V,n):";"!=e?"("==e?ie(W,")","call",n):"."==e?L(Z,n):"["==e?L(P("]"),j,B("]"),R,n):c&&"as"==t?(S.marked="keyword",L(ce,n)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),L(i)):void 0:void 0}function V(e,t){return"quasi"!=e?_():"${"!=t.slice(t.length-2)?L(V):L(z,$)}function $(e){if("}"==e)return S.marked="string-2",S.state.tokenize=b,L(V)}function G(e){return o(S.stream,S.state),_("{"==e?D:z)}function X(e){return o(S.stream,S.state),_("{"==e?D:W)}function Y(e,t){if("target"==t)return S.marked="keyword",L(K)}function Q(e,t){if("target"==t)return S.marked="keyword",L(U)}function J(e){return":"==e?L(R,D):_(K,B(";"),R)}function Z(e){if("variable"==e)return S.marked="property",L()}function ee(e,t){if("async"==e)return S.marked="property",L(ee);if("variable"==e||"keyword"==S.style){return S.marked="property","get"==t||"set"==t?L(te):(c&&S.state.fatArrowAt==S.stream.start&&(r=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+r[0].length),L(re));var r}else{if("number"==e||"string"==e)return S.marked=a?"property":S.style+" property",L(re);if("jsonld-keyword"==e)return L(re);if(c&&T(t))return S.marked="keyword",L(ee);if("["==e)return L(z,ae,B("]"),re);if("spread"==e)return L(W,re);if("*"==t)return S.marked="keyword",L(ee);if(":"==e)return _(re)}}function te(e){return"variable"!=e?_(re):(S.marked="property",L(Me))}function re(e){return":"==e?L(W):"("==e?_(Me):void 0}function ne(n,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var r=S.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),L(function(e,t){return e==i||t==i?_():_(n)},a)}return e==i||t==i?L():o&&-1<o.indexOf(";")?_(n):L(B(i))}return function(e,t){return e==i||t==i?L():_(n,a)}}function ie(e,t,r){for(var n=3;n<arguments.length;n++)S.cc.push(arguments[n]);return L(P(t,r),ne(e,t),R)}function oe(e){return"}"==e?L():_(D,oe)}function ae(e,t){if(c){if(":"==e||"in"==t)return L(ce);if("?"==t)return L(ae)}}function se(e){if(c&&":"==e)return S.stream.match(/^\s*\w+\s+is\b/,!1)?L(z,le,ce):L(ce)}function le(e,t){if("is"==t)return S.marked="keyword",L()}function ce(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(S.marked="keyword",L("typeof"==t?W:ce)):"variable"==e||"void"==t?(S.marked="type",L(he)):"|"==t||"&"==t?L(ce):"string"==e||"number"==e||"atom"==e?L(he):"["==e?L(P("]"),ne(ce,"]",","),R,he):"{"==e?L(P("}"),ne(fe,"}",",;"),R,he):"("==e?L(ne(de,")"),ue,he):"<"==e?L(ne(ce,">"),ce):void 0}function ue(e){if("=>"==e)return L(ce)}function fe(e,t){return"variable"==e||"keyword"==S.style?(S.marked="property",L(fe)):"?"==t||"number"==e||"string"==e?L(fe):":"==e?L(ce):"["==e?L(B("variable"),ae,B("]"),fe):"("==e?_(Te,fe):void 0}function de(e,t){return"variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?L(de):":"==e?L(ce):"spread"==e?L(de):_(ce)}function he(e,t){return"<"==t?L(P(">"),ne(ce,">"),R,he):"|"==t||"."==e||"&"==t?L(ce):"["==e?L(ce,B("]"),he):"extends"==t||"implements"==t?(S.marked="keyword",L(ce)):"?"==t?L(ce,B(":"),ce):void 0}function pe(e,t){if("<"==t)return L(P(">"),ne(ce,">"),R,he)}function me(){return _(ce,ge)}function ge(e,t){if("="==t)return L(ce)}function ve(e,t){return"enum"==t?(S.marked="keyword",L(Ke)):_(ye,ae,we,ke)}function ye(e,t){return c&&T(t)?(S.marked="keyword",L(ye)):"variable"==e?(r(t),L()):"spread"==e?L(ye):"["==e?ie(xe,"]"):"{"==e?ie(be,"}"):void 0}function be(e,t){return"variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?L(ye):"}"==e?_():"["==e?L(z,B("]"),B(":"),be):L(B(":"),ye,we)):(r(t),L(we))}function xe(){return _(ye,we)}function we(e,t){if("="==t)return L(W)}function ke(e){if(","==e)return L(ve)}function Ce(e,t){if("keyword b"==e&&"else"==t)return L(P("form","else"),D,R)}function Se(e,t){return"await"==t?L(Se):"("==e?L(P(")"),_e,R):void 0}function _e(e){return"var"==e?L(ve,Le):"variable"==e?L(Le):_(Le)}function Le(e,t){return")"==e?L():";"==e?L(Le):"in"==t||"of"==t?(S.marked="keyword",L(z,Le)):_(z,Le)}function Me(e,t){return"*"==t?(S.marked="keyword",L(Me)):"variable"==e?(r(t),L(Me)):"("==e?L(E,P(")"),ne(Oe,")"),R,se,D,I):c&&"<"==t?L(P(">"),ne(me,">"),R,Me):void 0}function Te(e,t){return"*"==t?(S.marked="keyword",L(Te)):"variable"==e?(r(t),L(Te)):"("==e?L(E,P(")"),ne(Oe,")"),R,se,I):c&&"<"==t?L(P(">"),ne(me,">"),R,Te):void 0}function Ae(e,t){return"keyword"==e||"variable"==e?(S.marked="type",L(Ae)):"<"==t?L(P(">"),ne(me,">"),R):void 0}function Oe(e,t){return"@"==t&&L(z,Oe),"spread"==e?L(Oe):c&&T(t)?(S.marked="keyword",L(Oe)):c&&"this"==e?L(ae,we):_(ye,ae,we)}function Ee(e,t){return"variable"==e?Ne(e,t):Ie(e,t)}function Ne(e,t){if("variable"==e)return r(t),L(Ie)}function Ie(e,t){return"<"==t?L(P(">"),ne(me,">"),R,Ie):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(S.marked="keyword"),L(c?ce:z,Ie)):"{"==e?L(P("}"),Pe,R):void 0}function Pe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&T(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",L(Pe)):"variable"==e||"keyword"==S.style?(S.marked="property",L(c?Re:Me,Pe)):"number"==e||"string"==e?L(c?Re:Me,Pe):"["==e?L(z,ae,B("]"),c?Re:Me,Pe):"*"==t?(S.marked="keyword",L(Pe)):c&&"("==e?_(Te,Pe):";"==e||","==e?L(Pe):"}"==e?L():"@"==t?L(z,Pe):void 0}function Re(e,t){if("?"==t)return L(Re);if(":"==e)return L(ce,we);if("="==t)return L(W);var r=S.state.lexical.prev;return _(r&&"interface"==r.info?Te:Me)}function Be(e,t){return"*"==t?(S.marked="keyword",L(He,B(";"))):"default"==t?(S.marked="keyword",L(z,B(";"))):"{"==e?L(ne(De,"}"),He,B(";")):_(D)}function De(e,t){return"as"==t?(S.marked="keyword",L(B("variable"))):"variable"==e?_(W,De):void 0}function Fe(e){return"string"==e?L():"("==e?_(z):_(ze,We,He)}function ze(e,t){return"{"==e?ie(ze,"}"):("variable"==e&&r(t),"*"==t&&(S.marked="keyword"),L(qe))}function We(e){if(","==e)return L(ze,We)}function qe(e,t){if("as"==t)return S.marked="keyword",L(ze)}function He(e,t){if("from"==t)return S.marked="keyword",L(z)}function je(e){return"]"==e?L():_(ne(W,"]"))}function Ke(){return _(P("form"),ye,B("{"),P("}"),ne(Ue,"}"),R,R)}function Ue(){return _(ye,we)}function Ve(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return R.lex=I.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-d,0,"block",!1),localVars:f.localVars,context:f.localVars&&new A(null,null,!1),indented:e||0};return f.globalVars&&"object"==typeof f.globalVars&&(t.globalVars=f.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),o(e,t)),t.tokenize!=y&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",function(e,t,r,n,i){var o=e.cc;for(S.state=e,S.stream=i,S.marked=null,S.cc=o,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?z:D)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==r&&C(e,n)?"variable-2":t}}(t,r,n,i,e))},indent:function(e,t){if(e.tokenize==y)return $e.Pass;if(e.tokenize!=v)return 0;var r,n=t&&t.charAt(0),i=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var a=e.cc[o];if(a==R)i=i.prev;else if(a!=Ce)break}for(;("stat"==i.type||"form"==i.type)&&("}"==n||(r=e.cc[e.cc.length-1])&&(r==K||r==U)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;h&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var s,l,c=i.type,u=n==c;return"vardef"==c?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==c&&"{"==n?i.indented:"form"==c?i.indented+d:"stat"==c?i.indented+(l=t,"operator"==(s=e).lastType||","==s.lastType||p.test(l.charAt(0))||/[,.]/.test(l.charAt(0))?h||d:0):"switch"!=i.info||u||0==f.doubleIndentSwitch?i.align?i.column+(u?0:1):i.indented+(u?0:d):i.indented+(/^(?:case|default)\b/.test(t)?d:2*d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:a,jsonMode:s,expressionAllowed:Ve,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=z&&t!=W||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(O){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}O.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=O.resolveMode("text/css"));var n,i,o=e.indentUnit,a=t.tokenHooks,s=t.documentTypes||{},l=t.mediaTypes||{},c=t.mediaFeatures||{},u=t.mediaValueKeywords||{},f=t.propertyKeywords||{},d=t.nonStandardPropertyKeywords||{},h=t.fontProperties||{},p=t.counterDescriptors||{},m=t.colorKeywords||{},g=t.valueKeywords||{},v=t.allowNested,y=t.lineComment,b=!0===t.supportsAtComponent;function x(e,t){return n=t,e}function w(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return(r==i||!n&&")"!=i)&&(t.tokenize=null),x("string","string")}}function k(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=w(")"),x(null,"(")}function C(e,t,r){this.type=e,this.indent=t,this.prev=r}function S(e,t,r,n){return e.context=new C(r,t.indentation()+(!1===n?0:o),e.context),r}function _(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function L(e,t,r){return A[r.context.type](e,t,r)}function M(e,t,r,n){for(var i=n||1;0<i;i--)r.context=r.context.prev;return L(e,t,r)}function T(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var A={top:function(e,t,r){if("{"==e)return S(r,t,"block");if("}"==e&&r.context.prev)return _(r);if(b&&/@component/i.test(e))return S(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return S(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return S(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return S(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return S(r,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return S(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?A.top(e,t,r):(i="error","block");var n=t.current().toLowerCase();return f.hasOwnProperty(n)?(i="property","maybeprop"):d.hasOwnProperty(n)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,r){return":"==e?S(r,t,"prop"):L(e,t,r)},prop:function(e,t,r){if(";"==e)return _(r);if("{"==e&&v)return S(r,t,"propBlock");if("}"==e||"{"==e)return M(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)T(t);else if("interpolation"==e)return S(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?_(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?M(e,t,r):")"==e?_(r):"("==e?S(r,t,"parens"):"interpolation"==e?S(r,t,"interpolation"):("word"==e&&T(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):L(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(i="tag",r.context.type):A.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return S(r,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,r);if("{"==e)return _(r)&&S(r,t,v?"block":"top");if("interpolation"==e)return S(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();i="only"==n||"not"==n||"and"==n||"or"==n?"keyword":l.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":u.hasOwnProperty(n)?"keyword":f.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?M(e,t,r):"{"==e?_(r)&&S(r,t,v?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?_(r):"{"==e||"}"==e?M(e,t,r,2):A.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?S(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):L(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,_(r)):"word"==e?(i="@font-face"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?S(r,t,"top"):L(e,t,r)},at:function(e,t,r){return";"==e?_(r):"{"==e||"}"==e?M(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?_(r):"{"==e||";"==e?M(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new C(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(a[r]){var n=a[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),x("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?x(null,"compare"):'"'==r||"'"==r?(t.tokenize=w(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==r?(e.match(/^\s*\w*/),x("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),x("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?x(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?x(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=k),x("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(n=r[1],r=r[0]),i=r,"comment"!=n&&(t.state=A[t.state](n,e,t)),i},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-o)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],r=e(t),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(n),o=["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"],a=e(o),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],l=e(s),c=["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","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","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","justify-items","justify-self","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","mix-blend-mode","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","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","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"],u=e(c),f=["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"],d=e(f),h=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["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"],g=e(m),v=["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","self-start","self-end","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","space-evenly","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"],y=e(v),b=t.concat(n).concat(o).concat(s).concat(c).concat(f).concat(m).concat(v);function x(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}O.registerHelper("hintWords","css",b),O.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x)(e,t)}},name:"css"}),O.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,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"}),O.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x)(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/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),O.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:u,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x)(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(p){"use strict";var i={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var o={};function m(e,t){var r,n=e.match(o[r=t]||(o[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function a(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;0<=o;o--)n.unshift(i[o])}p.defineMode("htmlmixed",function(u,e){var f=p.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),d={},t=e&&e.tags,r=e&&e.scriptTypes;if(a(i,d),t&&a(t,d),r)for(var n=r.length-1;0<=n;n--)d.script.unshift(["type",r[n].matches,r[n].mode]);function h(e,t){var r,n=f.token(e,t.htmlState),i=/\btag\b/.test(n);if(i&&!/[<>\s\/]/.test(e.current())&&(r=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(r))t.inTag=r+" ";else if(t.inTag&&i&&/>$/.test(e.current())){var o=/^([\S]+) (.*)/.exec(t.inTag);t.inTag=null;var a=">"==e.current()&&function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(m(t,n[0])))return n[2]}}(d[o[1]],o[2]),s=p.getMode(u,a),l=g(o[1],!0),c=g(o[1],!1);t.token=function(e,t){return e.match(l,!1)?(t.token=h,t.localState=t.localMode=null,null):(r=e,n=c,i=t.localMode.token(e,t.localState),o=r.current(),-1<(a=o.search(n))?r.backUp(o.length-a):o.match(/<\/?$/)&&(r.backUp(o.length),r.match(n,!1)||r.match(o)),i);var r,n,i,o,a},t.localMode=s,t.localState=p.startState(s,f.indent(t.htmlState,"",""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return n}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:p.startState(f)}},copyState:function(e){var t;return e.localState&&(t=p.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:p.copyState(f,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t,r){return!e.localMode||/^\s*<\//.test(t)?f.indent(e.htmlState,t,r):e.localMode.indent?e.localMode.indent(e.localState,t,r):p.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||f}}}},"xml","javascript","css"),p.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(O){"use strict";function E(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 N(e,t,r,n){var i=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(i=e.context.indented),e.context=new E(i,t,r,n,null,e.context)}function I(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function P(e,t,r){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,r))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function R(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function B(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}O.defineMode("clike",function(e,s){var a,l,c=e.indentUnit,u=s.statementIndentUnit||c,f=s.dontAlignCalls,d=s.keywords||{},h=s.types||{},p=s.builtin||{},m=s.blockKeywords||{},g=s.defKeywords||{},v=s.atoms||{},y=s.hooks||{},b=s.multiLineStrings,o=!1!==s.indentStatements,t=!1!==s.indentSwitch,x=s.namespaceSeparator,w=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,k=s.numberStart||/[\d\.]/,C=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,S=s.isOperatorChar||/[+\-*&%=<>!?|\/]/,_=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/,L=s.isReservedIdentifier||!1;function M(e,t){var o,r=e.next();if(y[r]){var n=y[r](e,t);if(!1!==n)return n}if('"'==r||"'"==r)return t.tokenize=(o=r,function(e,t){for(var r,n=!1,i=!1;null!=(r=e.next());){if(r==o&&!n){i=!0;break}n=!n&&"\\"==r}return(i||!n&&!b)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(w.test(r))return a=r,null;if(k.test(r)){if(e.backUp(1),e.match(C))return"number";e.next()}if("/"==r){if(e.eat("*"))return(t.tokenize=T)(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(S.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(S););return"operator"}if(e.eatWhile(_),x)for(;e.match(x);)e.eatWhile(_);var i=e.current();return B(d,i)?(B(m,i)&&(a="newstatement"),B(g,i)&&(l=!0),"keyword"):B(h,i)?"type":B(p,i)||L&&L(i)?(B(m,i)&&(a="newstatement"),"builtin"):B(v,i)?"atom":"variable"}function T(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function A(e,t){s.typeFirstDefinitions&&e.eol()&&R(t.context)&&(t.typeAtEndOfLine=P(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new E((e||0)-c,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return A(e,t),null;a=l=null;var n=(t.tokenize||M)(e,t);if("comment"==n||"meta"==n)return n;if(null==r.align&&(r.align=!0),";"==a||":"==a||","==a&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)I(t);else if("{"==a)N(t,e.column(),"}");else if("["==a)N(t,e.column(),"]");else if("("==a)N(t,e.column(),")");else if("}"==a){for(;"statement"==r.type;)r=I(t);for("}"==r.type&&(r=I(t));"statement"==r.type;)r=I(t)}else a==r.type?I(t):o&&(("}"==r.type||"top"==r.type)&&";"!=a||"statement"==r.type&&"newstatement"==a)&&N(t,e.column(),"statement",e.current());if("variable"==n&&("def"==t.prevToken||s.typeFirstDefinitions&&P(e,t,e.start)&&R(t.context)&&e.match(/^\s*\(/,!1))&&(n="def"),y.token){var i=y.token(e,t,n);void 0!==i&&(n=i)}return"def"==n&&!1===s.styleDefs&&(n="variable"),t.startOfLine=!1,t.prevToken=l?"def":n||a,A(e,t),n},indent:function(e,t){if(e.tokenize!=M&&null!=e.tokenize||e.typeAtEndOfLine)return O.Pass;var r=e.context,n=t&&t.charAt(0),i=n==r.type;if("statement"==r.type&&"}"==n&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(y.indent){var o=y.indent(e,r,t,c);if("number"==typeof o)return o}var a=r.prev&&"switch"==r.prev.info;if(s.allmanIndentation&&/[{(]/.test(n)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==n?0:u):!r.align||f&&")"==r.type?")"!=r.type||i?r.indented+(i?0:c)+(i||!a||/^(?:case|default)\b/.test(t)?0:c):r.indented+u:r.column+(i?0:1)},electricInput:t?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var t="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",r=e("int long char short double float unsigned signed void bool"),n=e("SEL instancetype id Class Protocol BOOL");function i(e){return B(r,e)||/.+_t/.test(e)}var o="case do else for if switch while struct enum union",a="struct enum union";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 l(e,t){return"type"==t.prevToken&&"type"}function c(e){return!(!e||e.length<2)&&("_"==e[0]&&("_"==e[1]||e[1]!==e[1].toLowerCase()))}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=h)(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function d(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 p(e,t){"string"==typeof e&&(e=[e]);var r=[];function n(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}n(t.keywords),n(t.types),n(t.builtin),n(t.atoms),r.length&&(t.helperType=e[0],O.registerHelper("hintWords",e[0],r));for(var i=0;i<e.length;++i)O.defineMIME(e[i],t)}function m(e,t){for(var r=!1;!e.eol();){if(!r&&e.match('"""')){t.tokenize=null;break}r="\\"==e.next()&&!r}return"string"}p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:e(t),types:i,blockKeywords:e(o),defKeywords:e(a),typeFirstDefinitions:!0,atoms:e("NULL true false"),isReservedIdentifier:c,hooks:{"#":s,"*":l},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:e(t+"alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq"),types:i,blockKeywords:e(o+" class try catch"),defKeywords:e(a+" class namespace"),typeFirstDefinitions:!0,atoms:e("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:c,hooks:{"#":s,"*":l,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)&&(n=e.current(),(i=/(\w+)::~?(\w+)$/.exec(n))&&i[1]==i[2]))return"def";var n,i}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:e("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:e("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:e("catch class do else finally for if switch try while"),defKeywords:e("class interface enum @interface"),typeFirstDefinitions:!0,atoms:e("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"]}}),p("text/x-csharp",{name:"clike",keywords:e("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:e("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:e("catch class do else finally for foreach if struct switch try while"),defKeywords:e("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=d)(e,t):(e.eatWhile(/[\w\$_]/),"meta")}}}),p("text/x-scala",{name:"clike",keywords:e("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:e("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:e("catch class enum do else finally for forSome if match switch try while"),defKeywords:e("class enum def object package trait type val var"),atoms:e("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=m,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,t){var r=t.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(t.context=new E(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function n(i){return function(e,t){for(var r;r=e.next();){if("*"==r&&e.eat("/")){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=null;break}if("/"==r&&e.eat("*"))return t.tokenize=n(i+1),t.tokenize(e,t)}return"comment"}}(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),p("text/x-kotlin",{name:"clike",keywords:e("package as typealias class interface this super val operator var fun for is in This throw return annotation 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 actual expect setparam"),types:e("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 Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:e("catch class do else finally for if where try while enum"),defKeywords:e("class val var object interface fun"),atoms:e("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){var o;return t.tokenize=(o=e.match('""'),function(e,t){for(var r,n=!1,i=!1;!e.eol();){if(!o&&!n&&e.match('"')){i=!0;break}if(o&&e.match('"""')){i=!0;break}r=e.next(),!n&&"$"==r&&e.match("{")&&e.skipTo("}"),n=!n&&"\\"==r&&!o}return!i&&o||(t.tokenize=null),"string"}),t.tokenize(e,t)},indent:function(e,t,r,n){var i=r&&r.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=r?"operator"==e.prevToken&&"}"!=r||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*n+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(r||"").charAt(0)?0:n):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),p(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:e("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:e("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:e("for while do if else struct"),builtin:e("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:e("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"]}}),p("text/x-nesc",{name:"clike",keywords:e(t+" 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:i,blockKeywords:e(o),atoms:e("null true false"),hooks:{"#":s},modeProps:{fold:["brace","include"]}}),p("text/x-objectivec",{name:"clike",keywords:e(t+" bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available"),types:function(e){return i(e)||B(n,e)},builtin:e("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINED NS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT"),blockKeywords:e(o+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:e(a+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:e("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:c,hooks:{"#":s,"*":l},modeProps:{fold:["brace","include"]}}),p("text/x-squirrel",{name:"clike",keywords:e("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:i,blockKeywords:e("case catch class else for foreach if switch try while"),defKeywords:e("function local class"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"#":s},modeProps:{fold:["brace","include"]}});var g=null;p("text/x-ceylon",{name:"clike",keywords:e("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:e("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:e("class dynamic function interface module object package value"),builtin:e("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:e("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=function o(a){return function(e,t){for(var r,n=!1,i=!1;!e.eol();){if(!n&&e.match('"')&&("single"==a||e.match('""'))){i=!0;break}if(!n&&e.match("``")){g=o(a),i=!0;break}r=e.next(),n="single"==a&&!n&&"\\"==r}return i&&(t.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!g||!e.match("`"))&&(t.tokenize=g,g=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,r){if(("variable"==r||"type"==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(c){"use strict";function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function s(i,o,a){return 0==i.length?l(o):function(e,t){for(var r=i[0],n=0;n<r.length;n++)if(e.match(r[n][0]))return t.tokenize=s(i.slice(1),o),r[n][1];return t.tokenize=l(o,a),"string"}}function l(r,n){return function(e,t){return function(e,t,r,n){if(!1!==n&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(!1!==n&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=s([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,n)),e.match(/\-\>\w/,!1)&&(t.tokenize=s([[["->",null]],[[/[\w]+/,"variable"]]],r,n)),"variable-2";var i=!1;for(;!e.eol()&&(i||!1===n||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!i&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}i="\\"==e.next()&&!i}return"string"}(e,t,r,n)}}var t="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",r="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="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";c.registerHelper("hintWords","php",[t,r,n].join(" ").split(" ")),c.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:e(t),blockKeywords:e("catch do else elseif for foreach if switch try while finally"),defKeywords:e("class function interface namespace trait"),atoms:e(r),builtin:e(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var r;if(r=e.match(/<<\s*/)){var n=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var i=e.current().slice(r[0].length+(n?2:1));if(n&&e.eat(n),i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=l(i,"'"!=n),"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=l('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&0<t.tokStack.length&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=l(t.tokStack[t.tokStack.length-2])),!1}}};c.defineMode("php",function(e,r){var s=c.getMode(e,r&&r.htmlMode||"text/html"),l=c.getMode(e,i);return{startState:function(){var e=c.startState(s),t=r.startOpen?c.startState(l):null;return{html:e,php:t,curMode:r.startOpen?l:s,curState:r.startOpen?t:e,pending:null}},copyState:function(e){var t,r=e.html,n=c.copyState(s,r),i=e.php,o=i&&c.copyState(l,i);return t=e.curMode==s?n:o,{html:n,php:o,curMode:e.curMode,curState:t,pending:e.pending}},token:function(e,t){var r=t.curMode==l;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),r)return r&&null==t.php.tokenize&&e.match("?>")?(t.curMode=s,t.curState=t.html,t.php.context.prev||(t.php=null),"meta"):l.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=l,t.php||(t.php=c.startState(l,s.indent(t.html,"",""))),t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var n="string"}else n=t.pending&&e.pos<t.pending.end?(e.pos=t.pending.end,t.pending.style):s.token(e,t.curState);t.pending&&(t.pending=null);var i,o=e.current(),a=o.search(/<\?/);return-1!=a&&("string"==n&&(i=o.match(/[\'\"]$/))&&!/\?>/.test(o)?t.pending=i[0]:t.pending={end:e.pos,style:n},e.backUp(o.length-a)),n},indent:function(e,t,r){return e.curMode!=l&&/^\s*<\//.test(t)||e.curMode==l&&/^\?>/.test(t)?s.indent(e.html,t,r):e.curMode.indent(e.curState,t,r)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),c.defineMIME("application/x-httpd-php","php"),c.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),c.defineMIME("text/x-php",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";var C={allowUnquoted:!0,allowMissing:!0,caseFold:!0};e.defineMode("shortcode",function(e,t){var a,s,o=e.indentUnit,l={},r=C;for(var n in r)l[n]=r[n];for(var i in t)l[i]=t[i];function c(e,t){return"["===e.next()?"["===e.peek()?(t.tokenize=u,"comment"):/\s/.test(e.peek())?null:(a=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):(e.eatWhile(/[^\[]/),null)}function u(e,t){var r=function(e,t){return e.next(),t.tokenize=c,"comment"};return r.isInEscape=!0,"]"===e.next()&&"]"===e.peek()&&(t.tokenize=r),e.eatWhile(/[^\]]/),null}function f(e,t){var r=e.next();if("]"===r||"/"===r&&e.eat("]"))return t.tokenize=c,a="endTag","tag bracket";if("="===r)return a="equals",null;if("["!==r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){var r=e.next();return r===n?(t.tokenize=f,"string"):/[\[\]]/.test(r)?"string error":(e.eatWhile(/[^\[\]\'\"]/),"string")}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=\[\]\"\']*[^\s\u00a0=\[\]\"\'\/]/),"word");t.tokenize=c,t.state=p,t.tagName=t.tagStart=null;var n,i,o=t.tokenize(e,t);return o?o+" tag error":"tag error"}function d(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 h(e){e.context&&(e.context=e.context.prev)}function p(e,t,r){return"openTag"===e?(r.tagStart=t.column(),m):"closeTag"===e?g:p}function m(e,t,r){if("word"!==e)return s="error",m;var n=t.current();return s=/[\[\]\/\'\"<>&]/.test(n)?"error":(r.tagName=t.current(),"tag"),b}function g(e,t,r){if("word"!==e)return s="error",y;var n=t.current();if(r.context&&r.context.tagName===n||!1===l.matchClosing)return s="tag",v;if(r.context&&0<r.context.tagHistory.indexOf(n)){for(var i=r.context.tagHistory.indexOf(n),o=0;o<i;o++)h(r);return s="tag",v}return s="tag error",y}function v(e,t,r){return"endTag"!==e?(s="error",v):(h(r),p)}function y(e,t,r){return s="error",v(e,0,r)}function b(e,t,r){if("word"===e)return s=/^[a-z0-9_\-]+$/i.test(t.current())?"attribute":"error",x;if("endTag"!==e)return s="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,r.context=new d(r,n,i===r.indented),p}function x(e,t,r){return"equals"===e?w:(l.allowMissing||(s="error"),b(e,t,r))}function w(e,t,r){return"string"===e?k:"word"===e&&l.allowUnquoted?(s="string",b):(s="error",b(e,t,r))}function k(e,t,r){return"string"===e?k:b(e,t,r)}return u.isInEscape=c.isInText=!0,{startState:function(e){var t={tokenize:c,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;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!==r&&(s=null,t.state=t.state(a||r,e,t),s&&(r="error"===s?r+" error":s)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart===e.indented?e.stringStartCol+1:e.indented+o;if(e.tokenize!==f&&e.tokenize!==c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+o*(l.multilineTagIndentFactor||1);var i=t&&/^\[(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n&&n.tagName===i[2];){n=n.prev;break}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+o:e.baseIndent||0},skipAttribute:function(e){e.state===w&&(e.state=b)}}})}),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(r){"use strict";r.defineMode("wordpresspost",function(e,t){var a=r.getMode(e,{name:"htmlmixed",multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag}),s=r.getMode(e,{name:"shortcode",multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag});function l(e,t){t.isInShortcode=!0;var r=s.token(e,t.shortcodeState),n=t.shortcodeState.tokenize.isInText,i=t.shortcodeState.tokenize.isInEscape;if(n)t.token=c;else if(i&&/\]/.test(e.current())){var o=e.current(),a=o.search(/\]/);e.backUp(o.length-a-1),"]"!==e.peek()&&(t.token=c)}return r}function c(e,t){t.isInShortcode=!1;var r=a.token(e,t.htmlmixedState),n=t.htmlmixedState.htmlState.tokenize.isInText;if(n&&/\[/.test(e.current())&&!t.htmlmixedState.localState&&null===r){var i=e.current(),o=i.search(/\[/);e.backUp(i.length-o),null==t.shortcodeState&&(t.shortcodeState=s.startState(a.indent(t.htmlmixedState,""))),t.token=l}else n&&/<!\-\-more|<!\-\-(noteaser|nextpage)\-\->?/.test(e.current())&&!t.htmlmixedState.localState&&"comment"===r&&(e.backUp(e.current().length),t.token=u);return r}function u(e,t){return e.match("\x3c!--more")?"meta":e.match("--\x3e")||e.match("\x3c!--noteaser--\x3e")||e.match("\x3c!--nextpage--\x3e")?(t.token=c,"meta"):(e.eatWhile(/[^\-/]/),"string")}return{startState:function(){return{token:c,isInShortcode:!1,shortcodeState:null,htmlmixedState:a.startState()}},copyState:function(e){var t;return e.shortcodeState&&(t=r.copyState(s,e.shortcodeState)),{token:e.token,shortcodeState:t,htmlmixedState:r.copyState(a,e.htmlmixedState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.isInShortcode?e.isInShortcode?s.indent(e.shortcodeState,t):r.Pass:a.indent(e.htmlmixedState,t)},innerMode:function(e){return e.isInShortcode?{state:e.shortcodeState,mode:s}:{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(i){"use strict";var s="CodeMirror-activeline",l="CodeMirror-activeline-background",c="CodeMirror-activeline-gutter";function u(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",s),e.removeLineClass(e.state.activeLines[t],"background",l),e.removeLineClass(e.state.activeLines[t],"gutter",c)}function o(t,e){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=t.getOption("styleActiveLine");if("object"==typeof o&&o.nonEmpty?i.anchor.line==i.head.line:i.empty()){var a=t.getLineHandleVisualStart(i.head.line);r[r.length-1]!=a&&r.push(a)}}(function(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})(t.state.activeLines,r)||t.operation(function(){u(t);for(var e=0;e<r.length;e++)t.addLineClass(r[e],"wrap",s),t.addLineClass(r[e],"background",l),t.addLineClass(r[e],"gutter",c);t.state.activeLines=r})}function a(e,t){o(e,t.ranges)}i.defineOption("styleActiveLine",!1,function(e,t,r){var n=r!=i.Init&&r;t!=n&&(n&&(e.off("beforeSelectionChange",a),u(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";var v,y,b=i.Pos;function p(e,t){for(var r,n,i=null!=(n=(r=e).flags)?n:(r.ignoreCase?"i":"")+(r.global?"g":"")+(r.multiline?"m":""),o=i,a=0;a<t.length;a++)-1==o.indexOf(t.charAt(a))&&(o+=t.charAt(a));return i==o?e:new RegExp(e.source,o)}function m(e,t,r){t=p(t,"g");for(var n=r.line,i=r.ch,o=e.lastLine();n<=o;n++,i=0){t.lastIndex=i;var a=e.getLine(n),s=t.exec(a);if(s)return{from:b(n,s.index),to:b(n,s.index+s[0].length),match:s}}}function g(e,t){for(var r,n=0;;){t.lastIndex=n;var i=t.exec(e);if(!i)return r;if((n=(r=i).index+(r[0].length||1))==e.length)return r}}function x(e,t,r,n){if(e.length==t.length)return r;for(var i=0,o=r+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=n(e.slice(0,a)).length;if(s==r)return a;r<s?o=a:i=a+1}}function n(r,n,e,t){var i;this.atOccurrence=!1,this.doc=r,e=e?r.clipPos(e):b(0,0),this.pos={from:e,to:e},"object"==typeof t?i=t.caseFold:(i=t,t=null),"string"==typeof n?(null==i&&(i=!1),this.matches=function(e,t){return(e?function(e,t,r,n){if(!t.length)return null;var i=n?v:y,o=i(t).split(/\r|\n\r?/);e:for(var a=r.line,s=r.ch,l=e.firstLine()-1+o.length;l<=a;a--,s=-1){var c=e.getLine(a);-1<s&&(c=c.slice(0,s));var u=i(c);if(1==o.length){var f=u.lastIndexOf(o[0]);if(-1==f)continue e;return{from:b(a,x(c,u,f,i)),to:b(a,x(c,u,f+o[0].length,i))}}var d=o[o.length-1];if(u.slice(0,d.length)==d){var h=1;for(r=a-o.length+1;h<o.length-1;h++)if(i(e.getLine(r+h))!=o[h])continue e;var p=e.getLine(a+1-o.length),m=i(p);if(m.slice(m.length-o[0].length)==o[0])return{from:b(a+1-o.length,x(p,m,p.length-o[0].length,i)),to:b(a,x(c,u,d.length,i))}}}}:function(e,t,r,n){if(!t.length)return null;var i=n?v:y,o=i(t).split(/\r|\n\r?/);e:for(var a=r.line,s=r.ch,l=e.lastLine()+1-o.length;a<=l;a++,s=0){var c=e.getLine(a).slice(s),u=i(c);if(1==o.length){var f=u.indexOf(o[0]);if(-1==f)continue e;return r=x(c,u,f,i)+s,{from:b(a,x(c,u,f,i)+s),to:b(a,x(c,u,f+o[0].length,i)+s)}}var d=u.length-o[0].length;if(u.slice(d)==o[0]){for(var h=1;h<o.length-1;h++)if(i(e.getLine(a+h))!=o[h])continue e;var p=e.getLine(a+o.length-1),m=i(p),g=o[o.length-1];if(m.slice(0,g.length)==g)return{from:b(a,x(c,u,d,i)+s),to:b(a+o.length-1,x(p,m,g.length,i))}}}})(r,n,t,i)}):(n=p(n,"gm"),t&&!1===t.multiline?this.matches=function(e,t){return(e?function(e,t,r){t=p(t,"g");for(var n=r.line,i=r.ch,o=e.firstLine();o<=n;n--,i=-1){var a=e.getLine(n);-1<i&&(a=a.slice(0,i));var s=g(a,t);if(s)return{from:b(n,s.index),to:b(n,s.index+s[0].length),match:s}}}:m)(r,n,t)}:this.matches=function(e,t){return(e?function(e,t,r){t=p(t,"gm");for(var n,i=1,o=r.line,a=e.firstLine();a<=o;){for(var s=0;s<i;s++){var l=e.getLine(o--);n=null==n?l.slice(0,r.ch):l+"\n"+n}i*=2;var c=g(n,t);if(c){var u=n.slice(0,c.index).split("\n"),f=c[0].split("\n"),d=o+u.length,h=u[u.length-1].length;return{from:b(d,h),to:b(d+f.length-1,1==f.length?h+f[0].length:f[f.length-1].length),match:c}}}}:function(e,t,r){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source))return m(e,t,r);t=p(t,"gm");for(var n,i=1,o=r.line,a=e.lastLine();o<=a;){for(var s=0;s<i&&!(a<o);s++){var l=e.getLine(o++);n=null==n?l:n+"\n"+l}i*=2,t.lastIndex=r.ch;var c=t.exec(n);if(c){var u=n.slice(0,c.index).split("\n"),f=c[0].split("\n"),d=r.line+u.length-1,h=u[u.length-1].length;return{from:b(d,h),to:b(d+f.length-1,1==f.length?h+f[0].length:f[f.length-1].length),match:c}}}})(r,n,t)})}y=String.prototype.normalize?(v=function(e){return e.normalize("NFD").toLowerCase()},function(e){return e.normalize("NFD")}):(v=function(e){return e.toLowerCase()},function(e){return e}),n.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){for(var t=this.matches(e,this.doc.clipPos(e?this.pos.from:this.pos.to));t&&0==i.cmpPos(t.from,t.to);)e?t.from.ch?t.from=b(t.from.line,t.from.ch-1):t=t.from.line==this.doc.firstLine()?null:this.matches(e,this.doc.clipPos(b(t.from.line-1))):t.to.ch<this.doc.getLine(t.to.line).length?t.to=b(t.to.line,t.to.ch+1):t=t.to.line==this.doc.lastLine()?null:this.matches(e,b(t.to.line+1,0));if(t)return this.pos=t,this.atOccurrence=!0,this.pos.match||!0;var r=b(e?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:r,to:r},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e,t){if(this.atOccurrence){var r=i.splitLines(e);this.doc.replaceRange(r,this.pos.from,this.pos.to,t),this.pos.to=b(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},i.defineExtension("getSearchCursor",function(e,t,r){return new n(this.doc,e,t,r)}),i.defineDocExtension("getSearchCursor",function(e,t,r){return new n(this,e,t,r)}),i.defineExtension("selectMatches",function(e,t){for(var r=[],n=this.getSearchCursor(e,this.getCursor("from"),t);n.findNext()&&!(0<i.cmpPos(n.to(),this.getCursor("to")));)r.push({anchor:n.from(),head:n.to()});r.length&&this.setSelections(r,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(h){"use strict";function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function p(e){return e.state.search||(e.state.search=new t)}function o(e){return"string"==typeof e&&e==e.toLowerCase()}function m(e,t,r){return e.getSearchCursor(t,r,{caseFold:o(t),multiline:!0})}function g(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0}):i(prompt(r,n))}function n(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function a(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=n(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function v(e,t,r){var n,i;t.queryText=r,t.query=a(r),e.removeOverlay(t.overlay,o(t.query)),t.overlay=(n=t.query,i=o(t.query),"string"==typeof n?n=new RegExp(n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i?"gi":"g"):n.global||(n=new RegExp(n.source,n.ignoreCase?"gi":"g")),{token:function(e){n.lastIndex=e.pos;var t=n.exec(e.string);if(t&&t.index==e.pos)return e.pos+=t[0].length||1,"searching";t?e.pos=t.index:e.skipToEnd()}}),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,o(t.query)))}function r(o,t,e,r){var n=p(o);if(n.query)return y(o,t);var i,a,s,l,c,u=o.getSelection()||n.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),e&&o.openDialog){var f=null,d=function(e,t){h.e_stop(t),e&&(e!=n.queryText&&(v(o,n,e),n.posFrom=n.posTo=o.getCursor()),f&&(f.style.opacity=1),y(o,t.shiftKey,function(e,t){var r;t.line<3&&document.querySelector&&(r=o.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>o.cursorCoords(t,"window").top&&((f=r).style.opacity=.4)}))};a=x(i=o),s=u,l=d,c=function(e,t){var r=h.keyName(e),n=o.getOption("extraKeys"),i=n&&n[r]||h.keyMap[o.getOption("keyMap")][r];"findNext"==i||"findPrev"==i||"findPersistentNext"==i||"findPersistentPrev"==i?(h.e_stop(e),v(o,p(o),t),o.execCommand(i)):"find"!=i&&"findPersistent"!=i||(h.e_stop(e),d(t,e))},i.openDialog(a,l,{value:s,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(i)},onKeyDown:c}),r&&u&&(v(o,n,u),y(o,t))}else g(o,x(o),"Search for:",u,function(e){e&&!n.query&&o.operation(function(){v(o,n,e),n.posFrom=n.posTo=o.getCursor(),y(o,t)})})}function y(r,n,i){r.operation(function(){var e=p(r),t=m(r,e.query,n?e.posFrom:e.posTo);(t.find(n)||(t=m(r,e.query,n?h.Pos(r.lastLine()):h.Pos(r.firstLine(),0))).find(n))&&(r.setSelection(t.from(),t.to()),r.scrollIntoView({from:t.from(),to:t.to()},20),e.posFrom=t.from(),e.posTo=t.to(),i&&i(t.from(),t.to()))})}function b(t){t.operation(function(){var e=p(t);e.lastQuery=e.query,e.query&&(e.query=e.queryText=null,t.removeOverlay(e.overlay),e.annotate&&(e.annotate.clear(),e.annotate=null))})}function x(e){return'<span class="CodeMirror-search-label">'+e.phrase("Search:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function w(t,n,i){t.operation(function(){for(var e=m(t,n);e.findNext();)if("string"!=typeof n){var r=t.getRange(e.from(),e.to()).match(n);e.replace(i.replace(/\$(\d)/g,function(e,t){return r[t]}))}else e.replace(i)})}function i(d,e){if(!d.getOption("readOnly")){var t=d.getSelection()||p(d).lastQuery,r='<span class="CodeMirror-search-label">'+(e?d.phrase("Replace all:"):d.phrase("Replace:"))+"</span>";g(d,r+(' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+d.phrase("(Use /re/ syntax for regexp search)")+"</span>"),r,t,function(f){f&&(f=a(f),g(d,'<span class="CodeMirror-search-label">'+d.phrase("With:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',d.phrase("Replace with:"),"",function(s){if(s=n(s),e)w(d,f,s);else{b(d);var l=m(d,f,d.getCursor("from")),c=function(){var e,t,r,n,i,o,a=l.from();!(e=l.findNext())&&(l=m(d,f),!(e=l.findNext())||a&&l.from().line==a.line&&l.from().ch==a.ch)||(d.setSelection(l.from(),l.to()),d.scrollIntoView({from:l.from(),to:l.to()}),r='<span class="CodeMirror-search-label">'+(o=t=d).phrase("Replace?")+"</span> <button>"+o.phrase("Yes")+"</button> <button>"+o.phrase("No")+"</button> <button>"+o.phrase("All")+"</button> <button>"+o.phrase("Stop")+"</button> ",n=d.phrase("Replace?"),i=[function(){u(e)},c,function(){w(d,f,s)}],t.openConfirm?t.openConfirm(r,i):confirm(n)&&i[0]())},u=function(r){l.replace("string"==typeof f?s:s.replace(/\$(\d)/g,function(e,t){return r[t]})),c()};c()}}))})}}h.commands.find=function(e){b(e),r(e)},h.commands.findPersistent=function(e){b(e),r(e,!1,!0)},h.commands.findPersistentNext=function(e){r(e,!1,!0,!0)},h.commands.findPersistentPrev=function(e){r(e,!0,!0,!0)},h.commands.findNext=r,h.commands.findPrev=function(e){r(e,!0)},h.commands.clearSearch=b,h.commands.replace=i,h.commands.replaceAll=function(e){i(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(f){function d(e,t,r){var n,i=e.getWrapperElement();return(n=i.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?n.innerHTML=t:n.appendChild(t),f.addClass(i,"dialog-opened"),n}function h(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}f.defineExtension("openDialog",function(e,t,r){r||(r={}),h(this,null);var n=d(this,e,r.bottom),i=!1,o=this;function a(e){if("string"==typeof e)l.value=e;else{if(i)return;i=!0,f.rmClass(n.parentNode,"dialog-opened"),n.parentNode.removeChild(n),o.focus(),r.onClose&&r.onClose(n)}}var s,l=n.getElementsByTagName("input")[0];return l?(l.focus(),r.value&&(l.value=r.value,!1!==r.selectValueOnOpen&&l.select()),r.onInput&&f.on(l,"input",function(e){r.onInput(e,l.value,a)}),r.onKeyUp&&f.on(l,"keyup",function(e){r.onKeyUp(e,l.value,a)}),f.on(l,"keydown",function(e){r&&r.onKeyDown&&r.onKeyDown(e,l.value,a)||((27==e.keyCode||!1!==r.closeOnEnter&&13==e.keyCode)&&(l.blur(),f.e_stop(e),a()),13==e.keyCode&&t(l.value,e))}),!1!==r.closeOnBlur&&f.on(l,"blur",a)):(s=n.getElementsByTagName("button")[0])&&(f.on(s,"click",function(){a(),o.focus()}),!1!==r.closeOnBlur&&f.on(s,"blur",a),s.focus()),a}),f.defineExtension("openConfirm",function(e,t,r){h(this,null);var n=d(this,e,r&&r.bottom),i=n.getElementsByTagName("button"),o=!1,a=this,s=1;function l(){o||(o=!0,f.rmClass(n.parentNode,"dialog-opened"),n.parentNode.removeChild(n),a.focus())}i[0].focus();for(var c=0;c<i.length;++c){var u=i[c];!function(t){f.on(u,"click",function(e){f.e_preventDefault(e),l(),t&&t(a)})}(t[c]),f.on(u,"blur",function(){--s,setTimeout(function(){s<=0&&l()},200)}),f.on(u,"focus",function(){++s})}}),f.defineExtension("openNotification",function(e,t){h(this,a);var r,n=d(this,e,t&&t.bottom),i=!1,o=t&&void 0!==t.duration?t.duration:5e3;function a(){i||(i=!0,clearTimeout(r),f.rmClass(n.parentNode,"dialog-opened"),n.parentNode.removeChild(n))}return f.on(n,"click",function(e){f.e_preventDefault(e),a()}),o&&(r=setTimeout(a,o)),a})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){"use strict";function n(e,t,r){this.orientation=t,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+t,this.inner=this.node.appendChild(document.createElement("div"));var a=this;function n(e){var t=s.wheelEventPixels(e)["horizontal"==a.orientation?"x":"y"],r=a.pos;a.moveTo(a.pos+t),a.pos!=r&&s.e_preventDefault(e)}s.on(this.inner,"mousedown",function(e){if(1==e.which){s.e_preventDefault(e);var t="horizontal"==a.orientation?"pageX":"pageY",r=e[t],n=a.pos;s.on(document,"mousemove",o),s.on(document,"mouseup",i)}function i(){s.off(document,"mousemove",o),s.off(document,"mouseup",i)}function o(e){if(1!=e.which)return i();a.moveTo(n+(e[t]-r)*(a.total/a.size))}}),s.on(this.node,"click",function(e){s.e_preventDefault(e);var t,r=a.inner.getBoundingClientRect();t="horizontal"==a.orientation?e.clientX<r.left?-1:e.clientX>r.right?1:0:e.clientY<r.top?-1:e.clientY>r.bottom?1:0,a.moveTo(a.pos+t*a.screen)}),s.on(this.node,"mousewheel",n),s.on(this.node,"DOMMouseScroll",n)}n.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)},n.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};function r(e,t,r){this.addClass=e,this.horiz=new n(e,"horizontal",r),t(this.horiz.node),this.vert=new n(e,"vertical",r),t(this.vert.node),this.width=null}n.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)},s.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},s.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";var L={},M=/[^\s\u00a0]/,T=e.Pos;function d(e){var t=e.search(M);return-1==t?0:t}function A(e,t){var r=e.getMode();return!1!==r.useInnerComments&&r.innerMode?e.getModeAt(t):r}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=L);for(var t=1/0,r=this.listSelections(),n=null,i=r.length-1;0<=i;i--){var o=r[i].from(),a=r[i].to();o.line>=t||(a.line>=t&&(a=T(t,0)),t=o.line,null==n?n=this.uncomment(o,a,e)?"un":(this.lineComment(o,a,e),"line"):"un"==n?this.uncomment(o,a,e):this.lineComment(o,a,e))}}),e.defineExtension("lineComment",function(o,e,a){a||(a=L);var s=this,t=A(s,o),r=s.getLine(o.line);if(null!=r&&(n=o,i=r,!/\bstring\b/.test(s.getTokenTypeAt(T(n.line,0)))||/^[\'\"\`]/.test(i))){var n,i,l=a.lineComment||t.lineComment;if(l){var c=Math.min(0!=e.ch||e.line==o.line?e.line+1:e.line,s.lastLine()+1),u=null==a.padding?" ":a.padding,f=a.commentBlankLines||o.line==e.line;s.operation(function(){if(a.indent){for(var e=null,t=o.line;t<c;++t){var r=(n=s.getLine(t)).slice(0,d(n));(null==e||e.length>r.length)&&(e=r)}for(t=o.line;t<c;++t){var n=s.getLine(t),i=e.length;(f||M.test(n))&&(n.slice(0,i)!=e&&(i=d(n)),s.replaceRange(e+l+u,T(t,0),T(t,i)))}}else for(t=o.line;t<c;++t)(f||M.test(s.getLine(t)))&&s.replaceRange(l+u,T(t,0))})}else(a.blockCommentStart||t.blockCommentStart)&&(a.fullLines=!0,s.blockComment(o,e,a))}}),e.defineExtension("blockComment",function(n,i,o){o||(o=L);var a=this,s=A(a,n),l=o.blockCommentStart||s.blockCommentStart,c=o.blockCommentEnd||s.blockCommentEnd;if(l&&c){if(!/\bcomment\b/.test(a.getTokenTypeAt(T(n.line,0)))){var u=Math.min(i.line,a.lastLine());u!=n.line&&0==i.ch&&M.test(a.getLine(u))&&--u;var f=null==o.padding?" ":o.padding;n.line>u||a.operation(function(){if(0!=o.fullLines){var e=M.test(a.getLine(u));a.replaceRange(f+c,T(u)),a.replaceRange(l+f,T(n.line,0));var t=o.blockCommentLead||s.blockCommentLead;if(null!=t)for(var r=n.line+1;r<=u;++r)(r!=u||e)&&a.replaceRange(t+f,T(r,0))}else a.replaceRange(c,i),a.replaceRange(l,n)})}}else(o.lineComment||s.lineComment)&&0!=o.fullLines&&a.lineComment(n,i,o)}),e.defineExtension("uncomment",function(e,t,r){r||(r=L);var i,o=this,n=A(o,e),a=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,o.lastLine()),s=Math.min(e.line,a),l=r.lineComment||n.lineComment,c=[],u=null==r.padding?" ":r.padding;e:if(l){for(var f=s;f<=a;++f){var d=o.getLine(f),h=d.indexOf(l);if(-1<h&&!/comment/.test(o.getTokenTypeAt(T(f,h+1)))&&(h=-1),-1==h&&M.test(d))break e;if(-1<h&&M.test(d.slice(0,h)))break e;c.push(d)}if(o.operation(function(){for(var e=s;e<=a;++e){var t=c[e-s],r=t.indexOf(l),n=r+l.length;r<0||(t.slice(n,n+u.length)==u&&(n+=u.length),i=!0,o.replaceRange("",T(e,r),T(e,n)))}}),i)return!0}var p=r.blockCommentStart||n.blockCommentStart,m=r.blockCommentEnd||n.blockCommentEnd;if(!p||!m)return!1;var g=r.blockCommentLead||n.blockCommentLead,v=o.getLine(s),y=v.indexOf(p);if(-1==y)return!1;var b=a==s?v:o.getLine(a),x=b.indexOf(m,a==s?y+p.length:0),w=T(s,y+1),k=T(a,x+1);if(-1==x||!/comment/.test(o.getTokenTypeAt(w))||!/comment/.test(o.getTokenTypeAt(k))||-1<o.getRange(w,k,"\n").indexOf(m))return!1;var C=v.lastIndexOf(p,e.ch),S=-1==C?-1:v.slice(0,e.ch).indexOf(m,C+p.length);if(-1!=C&&-1!=S&&S+m.length!=e.ch)return!1;S=b.indexOf(m,t.ch);var _=b.slice(t.ch).lastIndexOf(p,S-t.ch);return C=-1==S||-1==_?-1:t.ch+_,(-1==S||-1==C||C==t.ch)&&(o.operation(function(){o.replaceRange("",T(a,x-(u&&b.slice(x-u.length,x)==u?u.length:0)),T(a,x+m.length));var e=y+p.length;if(u&&v.slice(e,e+u.length)==u&&(e+=u.length),o.replaceRange("",T(s,y),T(s,e)),g)for(var t=s+1;t<=a;++t){var r=o.getLine(t),n=r.indexOf(g);if(-1!=n&&!M.test(r.slice(0,n))){var i=n+g.length;u&&r.slice(i,i+u.length)==u&&(i+=u.length),o.replaceRange("",T(t,n),T(t,i))}}}),!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(u){"use strict";function i(i,o,e,a){if(e&&e.call){var s=e;e=null}else s=f(i,e,"rangeFinder");"number"==typeof o&&(o=u.Pos(o,0));var l=f(i,e,"minFoldSize");function t(e){var t=s(i,o);if(!t||t.to.line-t.from.line<l)return null;for(var r=i.findMarksAt(t.from),n=0;n<r.length;++n)if(r[n].__isFold&&"fold"!==a){if(!e)return null;t.cleared=!0,r[n].clear()}return t}var r=t(!0);if(f(i,e,"scanUp"))for(;!r&&o.line>i.firstLine();)o=u.Pos(o.line-1,0),r=t(!1);if(r&&!r.cleared&&"unfold"!==a){var n=function(e,t){var r=f(e,t,"widget");if("string"==typeof r){var n=document.createTextNode(r);(r=document.createElement("span")).appendChild(n),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}(i,e);u.on(n,"mousedown",function(e){c.clear(),u.e_preventDefault(e)});var c=i.markText(r.from,r.to,{replacedWith:n,clearOnEnter:f(i,e,"clearOnEnter"),__isFold:!0});c.on("clear",function(e,t){u.signal(i,"unfold",i,e,t)}),u.signal(i,"fold",i,r.from,r.to)}}u.newFoldFunction=function(r,n){return function(e,t){i(e,t,{rangeFinder:r,widget:n})}},u.defineExtension("foldCode",function(e,t,r){i(this,e,t,r)}),u.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),r=0;r<t.length;++r)if(t[r].__isFold)return!0}),u.commands.toggleFold=function(e){e.foldCode(e.getCursor())},u.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},u.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},u.commands.foldAll=function(r){r.operation(function(){for(var e=r.firstLine(),t=r.lastLine();e<=t;e++)r.foldCode(u.Pos(e,0),null,"fold")})},u.commands.unfoldAll=function(r){r.operation(function(){for(var e=r.firstLine(),t=r.lastLine();e<=t;e++)r.foldCode(u.Pos(e,0),null,"unfold")})},u.registerHelper("fold","combine",function(){var i=Array.prototype.slice.call(arguments,0);return function(e,t){for(var r=0;r<i.length;++r){var n=i[r](e,t);if(n)return n}}}),u.registerHelper("fold","auto",function(e,t){for(var r=e.getHelpers(t,"fold"),n=0;n<r.length;n++){var i=r[n](e,t);if(i)return i}});var o={rangeFinder:u.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function f(e,t,r){if(t&&void 0!==t[r])return t[r];var n=e.options.foldOptions;return n&&void 0!==n[r]?n[r]:o[r]}u.defineOption("foldOptions",null),u.defineExtension("foldOption",function(e,t){return f(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(n){"use strict";n.defineOption("foldGutter",!1,function(e,t,r){r&&r!=n.Init&&(e.clearGutter(e.state.foldGutter.options.gutter),e.state.foldGutter=null,e.off("gutterClick",s),e.off("change",l),e.off("viewportChange",d),e.off("fold",h),e.off("unfold",h),e.off("swapDoc",l)),t&&(e.state.foldGutter=new i(function(e){!0===e&&(e={});null==e.gutter&&(e.gutter="CodeMirror-foldgutter");null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open");null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded");return e}(t)),a(e),e.on("gutterClick",s),e.on("change",l),e.on("viewportChange",d),e.on("fold",h),e.on("unfold",h),e.on("swapDoc",l))});var c=n.Pos;function i(e){this.options=e,this.from=this.to=0}function u(e,t){for(var r=e.findMarks(c(t,0),c(t+1,0)),n=0;n<r.length;++n)if(r[n].__isFold&&r[n].find().from.line==t)return r[n]}function f(e){if("string"!=typeof e)return e.cloneNode(!0);var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}function o(i,e,t){var o=i.state.foldGutter.options,a=e,s=i.foldOption(o,"minFoldSize"),l=i.foldOption(o,"rangeFinder");i.eachLine(e,t,function(e){var t=null;if(u(i,a))t=f(o.indicatorFolded);else{var r=c(a,0),n=l&&l(i,r);n&&n.to.line-n.from.line>=s&&(t=f(o.indicatorOpen))}i.setGutterMarker(e,o.gutter,t),++a})}function a(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation(function(){o(e,t.from,t.to)}),r.from=t.from,r.to=t.to)}function s(e,t,r){var n=e.state.foldGutter;if(n){var i=n.options;if(r==i.gutter){var o=u(e,t);o?o.clear():e.foldCode(c(t,0),i.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},r.foldOnChangeTimeSpan||600)}}function d(t){var r=t.state.foldGutter;if(r){var e=r.options;clearTimeout(r.changeUpdate),r.changeUpdate=setTimeout(function(){var e=t.getViewport();r.from==r.to||20<e.from-r.to||20<r.from-e.to?a(t):t.operation(function(){e.from<r.from&&(o(t,e.from,r.from),r.from=e.from),e.to>r.to&&(o(t,r.to,e.to),r.to=e.to)})},e.updateViewportTimeSpan||400)}}function h(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n<r.to&&o(e,n,n+1)}}}),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 l=e.Pos;function c(e,t){return e.line-t.line||e.ch-t.ch}var t="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",n=new RegExp("<(/?)(["+t+"][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-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function u(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function i(e,t){var r=e.cm.getTokenTypeAt(l(e.line,t));return r&&/\btag\b/.test(r)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function f(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function h(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(o(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function m(e,t){for(var r=[];;){var n,i=h(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(n=f(e)))return;if("selfClose"!=n)if(i[1]){for(var s=r.length-1;0<=s;--s)if(r[s]==i[2]){r.length=s;break}if(s<0&&(!t||t==i[2]))return{tag:i[2],from:l(o,a),to:l(e.line,e.ch)}}else r.push(i[2])}}function g(e,t){for(var r=[];;){var n=p(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=d(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var s=r.length-1;0<=s;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:l(e.line,e.ch),to:l(i,o)}}}else d(e)}}e.registerHelper("fold","xml",function(e,t){for(var r=new u(e,t.line,0);;){var n=h(r);if(!n||r.line!=t.line)return;var i=f(r);if(!i)return;if(!n[1]&&"selfClose"!=i){var o=l(r.line,r.ch),a=m(r,n[2]);return a&&0<c(a.from,o)?{from:o,to:a.from}:null}}}),e.findMatchingTag=function(e,t,r){var n=new u(e,t.line,t.ch,r);if(-1!=n.text.indexOf(">")||-1!=n.text.indexOf("<")){var i=f(n),o=i&&l(n.line,n.ch),a=i&&d(n);if(i&&a&&!(0<c(n,t))){var s={from:l(n.line,n.ch),to:o,tag:a[2]};return"selfClose"==i?{open:s,close:null,at:"open"}:a[1]?{open:g(n,a[2]),close:s,at:"close"}:{open:s,close:m(n=new u(e,o.line,o.ch,r),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new u(e,t.line,t.ch,r);;){var o=g(i,n);if(!o)break;var a=m(new u(e,t.line,t.ch,r),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,r,n){return m(new u(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){"use strict";function l(e,t){var r=e.getLine(t),n=r.search(/\S/);return-1==n||/\bcomment\b/.test(e.getTokenTypeAt(s.Pos(t,n+1)))?-1:s.countColumn(r,null,e.getOption("tabSize"))}s.registerHelper("fold","indent",function(e,t){var r=l(e,t.line);if(!(r<0)){for(var n=null,i=t.line+1,o=e.lastLine();i<=o;++i){var a=l(e,i);if(-1==a);else{if(!(r<a))break;n=i}}return n?{from:s.Pos(t.line,e.getLine(t.line).length),to:s.Pos(n,e.getLine(n).length)}:void 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(n){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),m=n.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function v(e){return e&&e.bracketRegex||/[(){}[\]]/}function f(e,t,r){var n=e.getLineHandle(t.line),i=t.ch-1,o=r&&r.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var a=v(r),s=!o&&0<=i&&a.test(n.text.charAt(i))&&g[n.text.charAt(i)]||a.test(n.text.charAt(i+1))&&g[n.text.charAt(++i)];if(!s)return null;var l=">"==s.charAt(1)?1:-1;if(r&&r.strict&&0<l!=(i==t.ch))return null;var c=e.getTokenTypeAt(m(t.line,i+1)),u=d(e,m(t.line,i+(0<l?1:0)),l,c||null,r);return null==u?null:{from:m(t.line,i),to:u&&u.pos,match:u&&u.ch==s.charAt(0),forward:0<l}}function d(e,t,r,n,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,s=[],l=v(i),c=0<r?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=r){var f=e.getLine(u);if(f){var d=0<r?0:f.length-1,h=0<r?f.length:-1;if(!(f.length>o))for(u==t.line&&(d=t.ch-(r<0?1:0));d!=h;d+=r){var p=f.charAt(d);if(l.test(p)&&(void 0===n||e.getTokenTypeAt(m(u,d+1))==n))if(">"==g[p].charAt(1)==0<r)s.push(p);else{if(!s.length)return{pos:m(u,d),ch:p};s.pop()}}}}return u-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,i=[],o=e.listSelections(),a=0;a<o.length;a++){var s=o[a].empty()&&f(e,o[a].head,r);if(s&&e.getLine(s.from.line).length<=n){var l=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(s.from,m(s.from.line,s.from.ch+1),{className:l})),s.to&&e.getLine(s.to.line).length<=n&&i.push(e.markText(s.to,m(s.to.line,s.to.ch+1),{className:l}))}}if(i.length){u&&e.state.focused&&e.focus();var c=function(){e.operation(function(){for(var e=0;e<i.length;e++)i[e].clear()})};if(!t)return c;setTimeout(c,800)}}function i(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=t(e,!1,e.state.matchBrackets)})}n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&(e.off("cursorActivity",i),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",i))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(t=r?(r.strict=t,r):t?{strict:!0}:null),f(this,e,t)}),n.defineExtension("scanForBracket",function(e,t,r,n){return d(this,e,t,r,n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(a){"use strict";function s(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(o){o.state.failedTagMatch=!1,o.operation(function(){if(s(o),!o.somethingSelected()){var e=o.getCursor(),t=o.getViewport();t.from=Math.min(t.from,e.line),t.to=Math.max(e.line+1,t.to);var r=a.findMatchingTag(o,e,t);if(r){if(o.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(o.state.tagHit=o.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var i="close"==r.at?r.open:r.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}a.defineOption("matchTags",!1,function(e,t,r){r&&r!=a.Init&&(e.off("cursorActivity",n),e.off("viewportChange",i),s(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",n),e.on("viewportChange",i),n(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var r="close"==t.at?t.open:t.close;r&&e.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],e):e(CodeMirror)}(function(i){"use strict";var r={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(e){for(var t in this.options={},r)this.options[t]=(e&&e.hasOwnProperty(t)?e:r)[t];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function a(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&n(e,t)}function s(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,n(e,t))}function n(e,t){clearTimeout(t.timeout),t.timeout=setTimeout(function(){l(e)},t.options.delay)}function u(e,t,r,n){var i,o,a,s=e.state.matchHighlighter;if(e.addOverlay(s.overlay=(i=t,o=r,a=n,{token:function(e){if(e.match(i)&&(!o||(r=o,!((t=e).start&&r.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&r.test(t.string.charAt(t.pos))))))return a;var t,r;e.next(),e.skipTo(i.charAt(0))||e.skipToEnd()}})),s.options.annotateScrollbar&&e.showMatchesOnScrollbar){var l=r?new RegExp("\\b"+t.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+"\\b"):t;s.matchesonscroll=e.showMatchesOnScrollbar(l,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function f(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function l(c){c.operation(function(){var e=c.state.matchHighlighter;if(f(c),c.somethingSelected()||!e.options.showToken){var t=c.getCursor("from"),r=c.getCursor("to");if(t.line==r.line&&(!e.options.wordsOnly||function(e,t,r){{if(null===e.getRange(t,r).match(/^\w+$/))return!1;if(0<t.ch){var n={line:t.line,ch:t.ch-1},i=e.getRange(n,t);if(null===i.match(/\W/))return!1}if(r.ch<e.getLine(t.line).length){var n={line:r.line,ch:r.ch+1},i=e.getRange(r,n);if(null===i.match(/\W/))return!1}return!0}}(c,t,r))){var n=c.getRange(t,r);e.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=e.options.minChars&&u(c,n,!1,e.options.style)}}else{for(var i=!0===e.options.showToken?/[\w$]/:e.options.showToken,o=c.getCursor(),a=c.getLine(o.line),s=o.ch,l=s;s&&i.test(a.charAt(s-1));)--s;for(;l<a.length&&i.test(a.charAt(l));)++l;s<l&&u(c,a.slice(s,l),i,e.options.style)}})}i.defineOption("highlightSelectionMatches",!1,function(e,t,r){if(r&&r!=i.Init&&(f(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",a),e.off("focus",s)),t){var n=e.state.matchHighlighter=new o(t);e.hasFocus()?(n.active=!0,l(e)):e.on("focus",s),e.on("cursorActivity",a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(y){y.defineOption("autoCloseTags",!1,function(e,t,r){if(r!=y.Init&&r&&e.removeKeyMap("autoCloseTags"),t){var n={name:"autoCloseTags"};("object"!=typeof t||t.whenClosing)&&(n["'/'"]=function(e){return(t=e).getOption("disableInput")?y.Pass:i(t,!0);var t}),("object"!=typeof t||t.whenOpening)&&(n["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return y.Pass;for(var t=e.listSelections(),r=[],n=e.getOption("autoCloseTags"),i=0;i<t.length;i++){if(!t[i].empty())return y.Pass;var o=t[i].head,a=e.getTokenAt(o),s=y.innerMode(e.getMode(),a.state),l=s.state;if("xml"!=s.mode.name||!l.tagName)return y.Pass;var c="html"==s.mode.configuration,u="object"==typeof n&&n.dontCloseTags||c&&b,f="object"==typeof n&&n.indentTags||c&&x,d=l.tagName;a.end>o.ch&&(d=d.slice(0,d.length-a.end+o.ch));var h=d.toLowerCase();if(!d||"string"==a.type&&(a.end!=o.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&"closeTag"==l.type||a.string.indexOf("/")==a.string.length-1||u&&-1<w(u,h)||k(e,d,o,l,!0))return y.Pass;var p=f&&-1<w(f,h);r[i]={indent:p,text:">"+(p?"\n\n":"")+"</"+d+">",newPos:p?y.Pos(o.line+1,0):y.Pos(o.line,o.ch+1)}}for(var m="object"==typeof n&&n.dontIndentOnAutoClose,i=t.length-1;0<=i;i--){var g=r[i];e.replaceRange(g.text,t[i].head,t[i].anchor,"+insert");var v=e.listSelections().slice(0);v[i]={head:g.newPos,anchor:g.newPos},e.setSelections(v),!m&&g.indent&&(e.indentLine(g.newPos.line,null,!0),e.indentLine(g.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(n)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],x=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function i(e,t){for(var r=e.listSelections(),n=[],i=t?"/":"</",o=e.getOption("autoCloseTags"),a="object"==typeof o&&o.dontIndentOnSlash,s=0;s<r.length;s++){if(!r[s].empty())return y.Pass;var l,c=r[s].head,u=e.getTokenAt(c),f=y.innerMode(e.getMode(),u.state),d=f.state;if(t&&("string"==u.type||"<"!=u.string.charAt(0)||u.start!=c.ch-1))return y.Pass;if("xml"!=f.mode.name)if("htmlmixed"==e.getMode().name&&"javascript"==f.mode.name)l=i+"script";else{if("htmlmixed"!=e.getMode().name||"css"!=f.mode.name)return y.Pass;l=i+"style"}else{if(!d.context||!d.context.tagName||k(e,d.context.tagName,c,d))return y.Pass;l=i+d.context.tagName}">"!=e.getLine(c.line).charAt(u.end)&&(l+=">"),n[s]=l}if(e.replaceSelections(n),r=e.listSelections(),!a)for(s=0;s<r.length;s++)(s==r.length-1||r[s].head.line<r[s+1].head.line)&&e.indentLine(r[s].head.line)}function w(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function k(e,t,r,n,i){if(!y.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,r.line+500),a=y.scanForClosingTag(e,r,null,o);if(!a||a.tag!=t)return!1;for(var s=n.context,l=i?1:0;s&&s.tagName==t;s=s.prev)++l;r=a.to;for(var c=1;c<l;c++){var u=y.scanForClosingTag(e,r,null,o);if(!u||u.tag!=t)return!1;r=u.to}return!0}y.commands.closeTag=function(e){return i(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(w){var r={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},k=w.Pos;function C(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:r[t]}w.defineOption("autoCloseBrackets",!1,function(e,t,r){r&&r!=w.Init&&(e.removeKeyMap(i),e.state.closeBrackets=null),t&&(n(C(t,"pairs")),e.state.closeBrackets=t,e.addKeyMap(i))});var i={Backspace:function(e){var t=S(e);if(!t||e.getOption("disableInput"))return w.Pass;for(var r=C(t,"pairs"),n=e.listSelections(),i=0;i<n.length;i++){if(!n[i].empty())return w.Pass;var o=s(e,n[i].head);if(!o||r.indexOf(o)%2!=0)return w.Pass}for(var i=n.length-1;0<=i;i--){var a=n[i].head;e.replaceRange("",k(a.line,a.ch-1),k(a.line,a.ch+1),"+delete")}},Enter:function(n){var e=S(n),t=e&&C(e,"explode");if(!t||n.getOption("disableInput"))return w.Pass;for(var i=n.listSelections(),r=0;r<i.length;r++){if(!i[r].empty())return w.Pass;var o=s(n,i[r].head);if(!o||t.indexOf(o)%2!=0)return w.Pass}n.operation(function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),n.execCommand("goCharLeft"),i=n.listSelections();for(var t=0;t<i.length;t++){var r=i[t].head.line;n.indentLine(r,null,!0),n.indentLine(r+1,null,!0)}})}};function n(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n="'"+r+"'";i[n]||(i[n]=o(r))}}function o(t){return function(e){return function(i,e){var t=S(i);if(!t||i.getOption("disableInput"))return w.Pass;var r=C(t,"pairs"),n=r.indexOf(e);if(-1==n)return w.Pass;for(var o,a=C(t,"triples"),s=r.charAt(n+1)==e,l=i.listSelections(),c=n%2==0,u=0;u<l.length;u++){var f,d=l[u],h=d.head,p=i.getRange(h,k(h.line,h.ch+1));if(c&&!d.empty())f="surround";else if(!s&&c||p!=e)if(s&&1<h.ch&&0<=a.indexOf(e)&&i.getRange(k(h.line,h.ch-2),h)==e+e){if(2<h.ch&&/\bstring/.test(i.getTokenTypeAt(k(h.line,h.ch-2))))return w.Pass;f="addFour"}else if(s){var m=0==h.ch?" ":i.getRange(k(h.line,h.ch-1),h);if(w.isWordChar(p)||m==e||w.isWordChar(m))return w.Pass;f="both"}else{if(!c)return w.Pass;f="both"}else f=!s||(v=h,void 0,y=(g=i).getTokenAt(k(v.line,v.ch+1)),!/\bstring/.test(y.type)||y.start!=v.ch||0!=v.ch&&/\bstring/.test(g.getTokenTypeAt(v)))?0<=a.indexOf(e)&&i.getRange(h,k(h.line,h.ch+3))==e+e+e?"skipThree":"skip":"both";if(o){if(o!=f)return w.Pass}else o=f}var g,v,y;var b=n%2?r.charAt(n-1):e,x=n%2?e:r.charAt(n+1);i.operation(function(){if("skip"==o)i.execCommand("goCharRight");else if("skipThree"==o)for(var e=0;e<3;e++)i.execCommand("goCharRight");else if("surround"==o){for(var t=i.getSelections(),e=0;e<t.length;e++)t[e]=b+t[e]+x;i.replaceSelections(t,"around"),t=i.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=(r=t[e],void 0,n=0<w.cmpPos(r.anchor,r.head),{anchor:new k(r.anchor.line,r.anchor.ch+(n?-1:1)),head:new k(r.head.line,r.head.ch+(n?1:-1))});i.setSelections(t)}else"both"==o?(i.replaceSelection(b+x,null),i.triggerElectric(b+x),i.execCommand("goCharLeft")):"addFour"==o&&(i.replaceSelection(b+b+b+b,"before"),i.execCommand("goCharRight"));var r,n})}(e,t)}}function S(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function s(e,t){var r=e.getRange(k(t.line,t.ch-1),k(t.line,t.ch+1));return 2==r.length?r:null}n(r.pairs+"`")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(f){"use strict";var e=f.commands,d=f.Pos;function t(t,r){t.extendSelectionsBy(function(e){return t.display.shift||t.doc.extend||e.empty()?function(e,t,r){if(r<0&&0==t.ch)return e.clipPos(d(t.line-1));var n=e.getLine(t.line);if(0<r&&t.ch>=n.length)return e.clipPos(d(t.line+1,0));for(var i,o="start",a=t.ch,s=r<0?0:n.length,l=0;a!=s;a+=r,l++){var c=n.charAt(r<0?a-1:a),u="_"!=c&&f.isWordChar(c)?"w":"o";if("w"==u&&c.toUpperCase()==c&&(u="W"),"start"==o)"o"!=u&&(o="in",i=u);else if("in"==o&&i!=u){if("w"==i&&"W"==u&&r<0&&a--,"W"==i&&"w"==u&&0<r){i="w";continue}break}}return d(t.line,a)}(t.doc,e.head,r):r<0?e.from():e.to()})}function r(a,s){if(a.isReadOnly())return f.Pass;a.operation(function(){for(var e=a.listSelections().length,t=[],r=-1,n=0;n<e;n++){var i=a.listSelections()[n].head;if(!(i.line<=r)){var o=d(i.line+(s?0:1),0);a.replaceRange("\n",o,null,"+insertLine"),a.indentLine(o.line,null,!0),t.push({head:o,anchor:o}),r=i.line+1}}a.setSelections(t)}),a.execCommand("indentAuto")}function c(e,t){for(var r=t.ch,n=r,i=e.getLine(t.line);r&&f.isWordChar(i.charAt(r-1));)--r;for(;n<i.length&&f.isWordChar(i.charAt(n));)++n;return{from:d(t.line,r),to:d(t.line,n),word:i.slice(r,n)}}function n(e,t){for(var r=e.listSelections(),n=[],i=0;i<r.length;i++){var o=r[i],a=e.findPosV(o.anchor,t,"line",o.anchor.goalColumn),s=e.findPosV(o.head,t,"line",o.head.goalColumn);a.goalColumn=null!=o.anchor.goalColumn?o.anchor.goalColumn:e.cursorCoords(o.anchor,"div").left,s.goalColumn=null!=o.head.goalColumn?o.head.goalColumn:e.cursorCoords(o.head,"div").left;var l={anchor:a,head:s};n.push(o),n.push(l)}e.setSelections(n)}e.goSubwordLeft=function(e){t(e,-1)},e.goSubwordRight=function(e){t(e,1)},e.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var r=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=r&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},e.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var r=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=r&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},e.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)for(var i=t[n].from(),o=t[n].to(),a=i.line;a<=o.line;++a)o.line>i.line&&a==o.line&&0==o.ch||r.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(r,0)},e.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},e.selectLine=function(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n];r.push({anchor:d(i.from().line,0),head:d(i.to().line+1,0)})}e.setSelections(r)},e.insertLineAfter=function(e){return r(e,!1)},e.insertLineBefore=function(e){return r(e,!0)},e.selectNextOccurrence=function(e){var t=e.getCursor("from"),r=e.getCursor("to"),n=e.state.sublimeFindFullWord==e.doc.sel;if(0==f.cmpPos(t,r)){var i=c(e,t);if(!i.word)return;e.setSelection(i.from,i.to),n=!0}else{var o=e.getRange(t,r),a=n?new RegExp("\\b"+o+"\\b"):o,s=e.getSearchCursor(a,r),l=s.findNext();if(l||(l=(s=e.getSearchCursor(a,d(e.firstLine(),0))).findNext()),!l||function(e,t,r){for(var n=0;n<e.length;n++)if(e[n].from()==t&&e[n].to()==r)return!0;return!1}(e.listSelections(),s.from(),s.to()))return f.Pass;e.addSelection(s.from(),s.to())}n&&(e.state.sublimeFindFullWord=e.doc.sel)},e.addCursorToPrevLine=function(e){n(e,-1)},e.addCursorToNextLine=function(e){n(e,1)};function i(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n],o=i.head,a=e.scanForBracket(o,-1);if(!a)return!1;for(;;){var s=e.scanForBracket(o,1);if(!s)return!1;if(s.ch=="(){}[]".charAt("(){}[]".indexOf(a.ch)+1)){var l=d(a.pos.line,a.pos.ch+1);if(0!=f.cmpPos(l,i.from())||0!=f.cmpPos(s.pos,i.to())){r.push({anchor:l,head:s.pos});break}if(!(a=e.scanForBracket(a.pos,-1)))return!1}o=d(s.pos.line,s.pos.ch+1)}}return e.setSelections(r),!0}function o(s,l){if(s.isReadOnly())return f.Pass;for(var c,e=s.listSelections(),u=[],t=0;t<e.length;t++){var r=e[t];if(!r.empty()){for(var n=r.from().line,i=r.to().line;t<e.length-1&&e[t+1].from().line==i;)i=e[++t].to().line;e[t].to().ch||i--,u.push(n,i)}}u.length?c=!0:u.push(s.firstLine(),s.lastLine()),s.operation(function(){for(var e=[],t=0;t<u.length;t+=2){var r=u[t],n=u[t+1],i=d(r,0),o=d(n),a=s.getRange(i,o,!1);l?a.sort():a.sort(function(e,t){var r=e.toUpperCase(),n=t.toUpperCase();return r!=n&&(e=r,t=n),e<t?-1:e==t?0:1}),s.replaceRange(a,i,o),c&&e.push({anchor:i,head:d(n+1,0)})}c&&s.setSelections(e,0)})}function a(s,l){s.operation(function(){for(var e=s.listSelections(),t=[],r=[],n=0;n<e.length;n++){(o=e[n]).empty()?(t.push(n),r.push("")):r.push(l(s.getRange(o.from(),o.to())))}s.replaceSelections(r,"around","case");var i;for(n=t.length-1;0<=n;n--){var o=e[t[n]];if(!(i&&0<f.cmpPos(o.head,i))){var a=c(s,o.head);i=a.from,s.replaceRange(l(a.word),a.from,a.to)}}})}function s(e){var t=e.getCursor("from"),r=e.getCursor("to");if(0==f.cmpPos(t,r)){var n=c(e,t);if(!n.word)return;t=n.from,r=n.to}return{from:t,to:r,query:e.getRange(t,r),word:n}}function l(e,t){var r=s(e);if(r){var n=r.query,i=e.getSearchCursor(n,t?r.to:r.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(n,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):r.word&&e.setSelection(r.from,r.to))}}e.selectScope=function(e){i(e)||e.execCommand("selectAll")},e.selectBetweenBrackets=function(e){if(!i(e))return f.Pass},e.goToBracket=function(n){n.extendSelectionsBy(function(e){var t=n.scanForBracket(e.head,1);if(t&&0!=f.cmpPos(t.pos,e.head))return t.pos;var r=n.scanForBracket(e.head,-1);return r&&d(r.pos.line,r.pos.ch+1)||e.head})},e.swapLineUp=function(i){if(i.isReadOnly())return f.Pass;for(var e=i.listSelections(),o=[],t=i.firstLine()-1,a=[],r=0;r<e.length;r++){var n=e[r],s=n.from().line-1,l=n.to().line;a.push({anchor:d(n.anchor.line-1,n.anchor.ch),head:d(n.head.line-1,n.head.ch)}),0!=n.to().ch||n.empty()||--l,t<s?o.push(s,l):o.length&&(o[o.length-1]=l),t=l}i.operation(function(){for(var e=0;e<o.length;e+=2){var t=o[e],r=o[e+1],n=i.getLine(t);i.replaceRange("",d(t,0),d(t+1,0),"+swapLine"),r>i.lastLine()?i.replaceRange("\n"+n,d(i.lastLine()),null,"+swapLine"):i.replaceRange(n+"\n",d(r,0),null,"+swapLine")}i.setSelections(a),i.scrollIntoView()})},e.swapLineDown=function(i){if(i.isReadOnly())return f.Pass;for(var e=i.listSelections(),o=[],t=i.lastLine()+1,r=e.length-1;0<=r;r--){var n=e[r],a=n.to().line+1,s=n.from().line;0!=n.to().ch||n.empty()||a--,a<t?o.push(a,s):o.length&&(o[o.length-1]=s),t=s}i.operation(function(){for(var e=o.length-2;0<=e;e-=2){var t=o[e],r=o[e+1],n=i.getLine(t);t==i.lastLine()?i.replaceRange("",d(t-1),d(t),"+swapLine"):i.replaceRange("",d(t,0),d(t+1,0),"+swapLine"),i.replaceRange(n+"\n",d(r,0),null,"+swapLine")}i.scrollIntoView()})},e.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},e.joinLines=function(l){for(var e=l.listSelections(),c=[],t=0;t<e.length;t++){for(var r=e[t],n=r.from(),i=n.line,o=r.to().line;t<e.length-1&&e[t+1].from().line==o;)o=e[++t].to().line;c.push({start:i,end:o,anchor:!r.empty()&&n})}l.operation(function(){for(var e=0,t=[],r=0;r<c.length;r++){for(var n,i=c[r],o=i.anchor&&d(i.anchor.line-e,i.anchor.ch),a=i.start;a<=i.end;a++){var s=a-e;a==i.end&&(n=d(s,l.getLine(s).length+1)),s<l.lastLine()&&(l.replaceRange(" ",d(s),d(s+1,/^\s*/.exec(l.getLine(s+1))[0].length)),++e)}t.push({anchor:o||n,head:n})}l.setSelections(t,0)})},e.duplicateLine=function(n){n.operation(function(){for(var e=n.listSelections().length,t=0;t<e;t++){var r=n.listSelections()[t];r.empty()?n.replaceRange(n.getLine(r.head.line)+"\n",d(r.head.line,0)):n.replaceRange(n.getRange(r.from(),r.to()),r.from())}n.scrollIntoView()})},e.sortLines=function(e){o(e,!0)},e.sortLinesInsensitive=function(e){o(e,!1)},e.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var r=t.shift(),n=r.find();if(n)return t.push(r),e.setSelection(n.from,n.to)}},e.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var r=t[t.length-1].find();if(r)return e.setSelection(r.from,r.to);t.pop()}},e.toggleBookmark=function(e){for(var t=e.listSelections(),r=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),n=0;n<t.length;n++){for(var i=t[n].from(),o=t[n].to(),a=t[n].empty()?e.findMarksAt(i):e.findMarks(i,o),s=0;s<a.length;s++)if(a[s].sublimeBookmark){a[s].clear();for(var l=0;l<r.length;l++)r[l]==a[s]&&r.splice(l--,1);break}s==a.length&&r.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},e.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var r=0;r<t.length;r++)t[r].clear();t.length=0},e.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,r=[];if(t)for(var n=0;n<t.length;n++){var i=t[n].find();i?r.push({anchor:i.from,head:i.to}):t.splice(n--,0)}r.length&&e.setSelections(r,0)},e.smartBackspace=function(l){if(l.somethingSelected())return f.Pass;l.operation(function(){for(var e=l.listSelections(),t=l.getOption("indentUnit"),r=e.length-1;0<=r;r--){var n=e[r].head,i=l.getRange({line:n.line,ch:0},n),o=f.countColumn(i,null,l.getOption("tabSize")),a=l.findPosH(n,-1,"char",!1);if(i&&!/\S/.test(i)&&o%t==0){var s=new d(n.line,f.findColumn(i,o-t,t));s.ch!=n.ch&&(a=s)}l.replaceRange("",a,n,"+delete")}})},e.delLineRight=function(r){r.operation(function(){for(var e=r.listSelections(),t=e.length-1;0<=t;t--)r.replaceRange("",e[t].anchor,d(e[t].to().line),"+delete");r.scrollIntoView()})},e.upcaseAtCursor=function(e){a(e,function(e){return e.toUpperCase()})},e.downcaseAtCursor=function(e){a(e,function(e){return e.toLowerCase()})},e.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},e.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},e.deleteToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();if(t){var r=e.getCursor(),n=t;if(0<f.cmpPos(r,n)){var i=n;n=r,r=i}e.state.sublimeKilled=e.getRange(r,n),e.replaceRange("",r,n)}},e.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},e.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},e.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},e.findUnder=function(e){l(e,!0)},e.findUnderPrevious=function(e){l(e,!1)},e.findAllUnder=function(e){var t=s(e);if(t){for(var r=e.getSearchCursor(t.query),n=[],i=-1;r.findNext();)n.push({anchor:r.from(),head:r.to()}),r.from().line<=t.from.line&&r.from().ch<=t.from.ch&&i++;e.setSelections(n,i)}};var u=f.keyMap;u.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},f.normalizeKeyMap(u.macSublime),u.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},f.normalizeKeyMap(u.pcSublime);var h=u.default==u.macDefault;u.sublime=h?u.macSublime:u.pcSublime}),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 l=e.Pos;function c(e,t){return e.line==t.line&&e.ch==t.ch}var o=[];function a(e){o.push(e),50<o.length&&o.shift()}function r(e){return o[o.length-(e?Math.min(e,1):1)]||""}var s=null;function u(e,t,r,n,i){null==i&&(i=e.getRange(t,r)),"grow"==n&&s&&s.cm==e&&c(t,s.pos)&&e.isClean(s.gen)?function(e){if(!o.length)return a(e);o[o.length-1]+=e}(i):!1!==n&&a(i),e.replaceRange("",t,r,"+delete"),s="grow"==n?{cm:e,pos:t,gen:e.changeGeneration()}:null}function t(e,t,r){return e.findPosH(t,r,"char",!0)}function n(e,t,r){return e.findPosH(t,r,"word",!0)}function i(e,t,r){return e.findPosV(t,r,"line",e.doc.sel.goalColumn)}function f(e,t,r){return e.findPosV(t,r,"page",e.doc.sel.goalColumn)}function d(e,t,r){for(var n=t.line,i=e.getLine(n),o=/\S/.test(r<0?i.slice(0,t.ch):i.slice(t.ch)),a=e.firstLine(),s=e.lastLine();;){if((n+=r)<a||s<n)return e.clipPos(l(n-r,r<0?0:null));if(i=e.getLine(n),/\S/.test(i))o=!0;else if(o)return l(n,0)}}function h(e,t,r){for(var n=t.line,i=t.ch,o=e.getLine(t.line),a=!1;;){var s=o.charAt(i+(r<0?-1:0));if(s){if(a&&/[!?.]/.test(s))return l(n,i+(0<r?1:0));a||(a=/\w/.test(s)),i+=r}else{if(n==(r<0?e.firstLine():e.lastLine()))return l(n,i);if(o=e.getLine(n+r),!/\S/.test(o))return l(n,i);n+=r,i=r<0?o.length:0}}}function p(e,t,r){var n;if(e.findMatchingBracket&&(n=e.findMatchingBracket(t,{strict:!0}))&&n.match&&(n.forward?1:-1)==r)return 0<r?l(n.to.line,n.to.ch+1):n.to;for(var i=!0;;i=!1){var o=e.getTokenAt(t),a=l(t.line,r<0?o.start:o.end);if(!(i&&0<r&&o.end==t.ch)&&/\w/.test(o.string))return a;var s=e.findPosH(a,r,"char");if(c(a,s))return t;t=s}}function m(e,t){var r=e.state.emacsPrefix;return r?(S(e),"-"==r?-1:Number(r)):t?null:1}function g(t){var n="string"==typeof t?function(e){e.execCommand(t)}:t;return function(e){var t=m(e);n(e);for(var r=1;r<t;++r)n(e)}}function v(e,t,r,n){var i=m(e);i<0&&(n=-n,i=-i);for(var o=0;o<i;++o){var a=r(e,t,n);if(c(a,t))break;t=a}return t}function y(t,r){var e=function(e){e.extendSelection(v(e,e.getCursor(),t,r))};return e.motion=!0,e}function b(e,t,r,n){for(var i,o=e.listSelections(),a=o.length;a--;)u(e,i=o[a].head,v(e,i,t,r),n)}function x(e,t){if(e.somethingSelected()){for(var r,n=e.listSelections(),i=n.length;i--;)u(e,(r=n[i]).anchor,r.head,t);return!0}}function w(e,t){e.state.emacsPrefix?"-"!=t&&(e.state.emacsPrefix+=t):(e.state.emacsPrefix=t,e.on("keyHandled",C),e.on("inputRead",_))}var k={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};function C(e,t){e.state.emacsPrefixMap||k.hasOwnProperty(t)||S(e)}function S(e){e.state.emacsPrefix=null,e.off("keyHandled",C),e.off("inputRead",_)}function _(e,t){var r=m(e);if(1<r&&"+input"==t.origin){for(var n=t.text.join("\n"),i="",o=1;o<r;++o)i+=n;e.replaceSelection(i)}}function L(e,t){("string"!=typeof t||!/^\d$/.test(t)&&"Ctrl-U"!=t)&&(e.removeKeyMap(E),e.state.emacsPrefixMap=!1,e.off("keyHandled",L),e.off("inputRead",L))}function M(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",function(){e.setExtending(!1)})}function T(e){e.setExtending(!1),e.setCursor(e.getCursor())}function A(e,t){var r=e.getCursor(),n=e.findPosH(r,1,"word");e.replaceRange(t(e.getRange(r,n)),r,n),e.setCursor(n)}e.emacs={kill:u,killRegion:x,repeated:g};var O=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){u(e,e.getCursor("start"),e.getCursor("end"),!0)},"Ctrl-K":g(function(e){var t=e.getCursor(),r=e.clipPos(l(t.line)),n=e.getRange(t,r);/\S/.test(n)||(n+="\n",r=l(t.line+1,0)),u(e,t,r,"grow",n)}),"Alt-W":function(e){a(e.getSelection()),T(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(r(m(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection((1<o.length&&o.pop(),r()),"around","paste")},"Ctrl-Space":M,"Ctrl-Shift-2":M,"Ctrl-F":y(t,1),"Ctrl-B":y(t,-1),Right:y(t,1),Left:y(t,-1),"Ctrl-D":function(e){b(e,t,1,!1)},Delete:function(e){x(e,!1)||b(e,t,1,!1)},"Ctrl-H":function(e){b(e,t,-1,!1)},Backspace:function(e){x(e,!1)||b(e,t,-1,!1)},"Alt-F":y(n,1),"Alt-B":y(n,-1),"Alt-Right":y(n,1),"Alt-Left":y(n,-1),"Alt-D":function(e){b(e,n,1,"grow")},"Alt-Backspace":function(e){b(e,n,-1,"grow")},"Ctrl-N":y(i,1),"Ctrl-P":y(i,-1),Down:y(i,1),Up:y(i,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":y(f,-1),"Ctrl-V":y(f,1),PageUp:y(f,-1),PageDown:y(f,1),"Ctrl-Up":y(d,-1),"Ctrl-Down":y(d,1),"Alt-A":y(h,-1),"Alt-E":y(h,1),"Alt-K":function(e){b(e,h,1,"grow")},"Ctrl-Alt-K":function(e){b(e,p,1,"grow")},"Ctrl-Alt-Backspace":function(e){b(e,p,-1,"grow")},"Ctrl-Alt-F":y(p,1),"Ctrl-Alt-B":y(p,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(v(e,t,p,1),t)},"Ctrl-Alt-T":function(e){var t=p(e,e.getCursor(),-1),r=p(e,t,1),n=p(e,r,1),i=p(e,n,-1);e.replaceRange(e.getRange(i,n)+e.getRange(r,i)+e.getRange(t,r),t,n)},"Ctrl-Alt-U":g(function(e){for(var t=e.getCursor(),r=t.line,n=t.ch,i=[];r>=e.firstLine();){for(var o=e.getLine(r),a=null==n?o.length:n;0<a;)if(")"==(n=o.charAt(--a)))i.push("(");else if("]"==n)i.push("[");else if("}"==n)i.push("{");else if(/[\(\{\[]/.test(n)&&(!i.length||i.pop()!=n))return e.extendSelection(l(r,a));--r,n=null}}),"Alt-Space":function(e){for(var t=e.getCursor(),r=t.ch,n=t.ch,i=e.getLine(t.line);r&&/\s/.test(i.charAt(r-1));)--r;for(;n<i.length&&/\s/.test(i.charAt(n));)++n;e.replaceRange(" ",l(t.line,r),l(t.line,n))},"Ctrl-O":g(function(e){e.replaceSelection("\n","start")}),"Ctrl-T":g(function(e){e.execCommand("transposeChars")}),"Alt-C":g(function(e){A(e,function(e){var t=e.search(/\w/);return-1==t?e:e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1).toLowerCase()})}),"Alt-U":g(function(e){A(e,function(e){return e.toUpperCase()})}),"Alt-L":g(function(e){A(e,function(e){return e.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":g("undo"),"Shift-Ctrl--":g("undo"),"Ctrl-Z":g("undo"),"Cmd-Z":g("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":function(e){e.execCommand("clearSearch"),T(e)},"Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":g(function(e){e.replaceSelection("\n","end")}),Tab:"indentAuto","Alt-G G":function(r){var e,t,n,i=m(r,!0);if(null!=i&&0<i)return r.setCursor(i-1);t="Goto line",n=function(e){var t;e&&!isNaN(t=Number(e))&&t==(0|t)&&0<t&&r.setCursor(t-1)},(e=r).openDialog?e.openDialog(t+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(t,""))},"Ctrl-X Tab":function(e){e.indentSelection(m(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":g("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){u(e,e.getCursor(),h(e,e.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":g("insertTab"),"Ctrl-U":function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(E),e.on("keyHandled",L),e.on("inputRead",L)}}),E={"Ctrl-G":S};function N(t){E[t]=function(e){w(e,t)},O["Ctrl-"+t]=function(e){w(e,t)},k["Ctrl-"+t]=!0}for(var I=0;I<10;++I)N(String(I));N("-")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(Ge){"use strict";var Xe=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],Ye=Xe.length,Qe=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Je=Ge.Pos;Ge.Vim=function(){function e(e,t){var r;this==Ge.keyMap.vim&&(Ge.rmClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&(function(e){var t=e.state.fatCursorMarks;if(t)for(var r=0;r<t.length;r++)t[r].clear();e.state.fatCursorMarks=null,e.off("cursorActivity",a)}(e),e.getInputField().style.caretColor="")),t&&t.attach==i||((r=e).setOption("disableInput",!1),r.off("cursorActivity",He),Ge.off(r.getInputField(),"paste",c(r)),r.state.vim=null)}function i(e,t){var r,n;this==Ge.keyMap.vim&&(Ge.addClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&((r=e).state.fatCursorMarks=o(r),r.on("cursorActivity",a),e.getInputField().style.caretColor="transparent")),t&&t.attach==i||((n=e).setOption("disableInput",!0),n.setOption("showCursorWhenSelecting",!1),Ge.signal(n,"vim-mode-change",{mode:"normal"}),n.on("cursorActivity",He),A(n),Ge.on(n.getInputField(),"paste",c(n)))}function o(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n];if(i.empty())if(i.anchor.ch<e.getLine(i.anchor.line).length)r.push(e.markText(i.anchor,Je(i.anchor.line,i.anchor.ch+1),{className:"cm-fat-cursor-mark"}));else{var o=document.createElement("span");o.textContent=" ",o.className="cm-fat-cursor-mark",r.push(e.setBookmark(i.anchor,{widget:o}))}}return r}function a(e){var t=e.state.fatCursorMarks;if(t)for(var r=0;r<t.length;r++)t[r].clear();e.state.fatCursorMarks=o(e)}function t(e,t){if(t){if(this[e])return this[e];var r=function(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,i=0;i<t.length;i++){var o=t[i];o in s?t[i]=s[o]:n=!0,o in l&&(t[i]=l[o])}return!!n&&(b(r)&&(t[t.length-1]=r.toLowerCase()),"<"+t.join("-")+">")}(e);if(!r)return!1;var n=Ge.Vim.findKey(t,r);return"function"==typeof n&&Ge.signal(t,"vim-keypress",r),n}}Ge.defineOption("vimMode",!1,function(e,t,r){t&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!t&&r!=Ge.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")});var s={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},l={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(V(e.getCursor(),0,1)),j.enterInsertMode(e,{},t))}),t.onPasteFn}var m=/[\d]/,g=[Ge.isWordChar,function(e){return e&&!Ge.isWordChar(e)&&!/\s/.test(e)}],v=[function(e){return/\S/.test(e)}];function r(e,t){for(var r=[],n=e;n<e+t;n++)r.push(String.fromCharCode(n));return r}var n=r(65,26),u=r(97,26),f=r(48,10),d=[].concat(n,u,f,["<",">"]),h=[].concat(n,u,f,["-",'"',".",":","/"]);function y(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function b(e){return/^[A-Z]$/.test(e)}function N(e){return/^\s*$/.test(e)}function x(e){return-1!=".?!".indexOf(e)}function w(e,t){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1}var k={};function C(e,t,r,n,i){if(void 0===t&&!i)throw Error("defaultValue is required unless callback is provided");if(r||(r="string"),k[e]={type:r,defaultValue:t,callback:i},n)for(var o=0;o<n.length;o++)k[n[o]]=k[e];t&&S(e,t)}function S(e,t,r,n){var i=k[e],o=(n=n||{}).scope;if(!i)return new Error("Unknown option: "+e);if("boolean"==i.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}i.callback?("local"!==o&&i.callback(t,void 0),"global"!==o&&r&&i.callback(t,r)):("local"!==o&&(i.value="boolean"==i.type?!!t:t),"global"!==o&&r&&(r.state.vim.options[e]={value:t}))}function _(e,t,r){var n=k[e],i=(r=r||{}).scope;if(!n)return new Error("Unknown option: "+e);if(n.callback){var o=t&&n.callback(void 0,t);return"global"!==i&&void 0!==o?o:"local"!==i?n.callback():void 0}return((o="global"!==i&&t&&t.state.vim.options[e])||"local"!==i&&n||{}).value}C("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e)return"null"==(r=t.getOption("mode"))?"":r;var r=""==e?"null":e;t.setOption("mode",r)}});var z,L,M=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function T(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=M()}function A(e){return e.state.vim||(e.state.vim={inputState:new I,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function O(){var a,s,l,c;for(var e in z={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:(a=-1,s=0,l=0,c=new Array(100),{cachedCursor:void 0,add:function(n,e,t){var r=c[a%100];function i(e){var t=++a%100,r=c[t];r&&r.clear(),c[t]=n.setBookmark(e)}if(r){var o=r.find();o&&!Y(o,e)&&i(e)}else i(e);i(t),(l=(s=a)-100+1)<0&&(l=0)},move:function(e,t){s<(a+=t)?a=s:a<l&&(a=l);var r=c[(100+a)%100];if(r&&!r.find()){var n,i=0<t?1:-1,o=e.getCursor();do{if((r=c[(100+(a+=i))%100])&&(n=r.find())&&!Y(o,n))break}while(a<s&&l<a)}return r}}),macroModeState:new T,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new B({}),searchHistoryController:new D,exCommandHistoryController:new D},k){var t=k[e];t.value=t.defaultValue}}var E={buildKeyMap:function(){},getRegisterController:function(){return z.registerController},resetVimGlobalState_:O,getVimGlobalState_:function(){return z},maybeInitVimState_:A,suppressErrorLogging:(T.prototype={exitMacroRecordMode:function(){var e=z.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=z.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}},!1),InsertModeKey:Ke,map:function(e,t,r){De.map(e,t,r)},unmap:function(e,t){De.unmap(e,t)},noremap:function(e,t,r){function n(e){return e?[e]:["normal","insert","visual"]}for(var i=n(r),o=Xe.length,a=o-Ye;a<o&&i.length;a++){var s=Xe[a];if(!(s.keys!=t||r&&s.context&&s.context!==r||"ex"===s.type.substr(0,2)||"key"===s.type.substr(0,3))){var l={};for(var c in s)l[c]=s[c];l.keys=e,r&&!l.context&&(l.context=r),this._mapCommand(l);var u=n(s.context);i=i.filter(function(e){return-1===u.indexOf(e)})}}},mapclear:function(e){var t=Xe.length,r=Ye,n=Xe.slice(0,t-r);if(Xe=Xe.slice(t-r),e)for(var i=n.length-1;0<=i;i--){var o=n[i];if(e!==o.context)if(o.context)this._mapCommand(o);else{var a=["normal","insert","visual"];for(var s in a)if(a[s]!==e){var l={};for(var c in o)l[c]=o[c];l.context=a[s],this._mapCommand(l)}}}},setOption:S,getOption:_,defineOption:C,defineEx:function(e,t,r){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;Be[e]=r,De.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);if("function"==typeof n)return n()},findKey:function(s,l,t){var e,c=A(s);function i(){var e=z.macroModeState;if(e.isRecording){if("q"==l)return e.exitMacroRecordMode(),P(s),!0;"mapping"!=t&&function(e,t){if(!e.isPlaying){var r=e.latestRegister,n=z.registerController.getRegister(r);n&&n.pushText(t)}}(e,l)}}function u(){if("<Esc>"==l)return P(s),c.visualMode?le(s):c.insertMode&&Fe(s),!0}return!1===(e=c.insertMode?function(){if(u())return!0;for(var e=c.inputState.keyBuffer=c.inputState.keyBuffer+l,t=1==l.length,r=F.matchCommand(e,Xe,c.inputState,"insert");1<e.length&&"full"!=r.type;){e=c.inputState.keyBuffer=e.slice(1);var n=F.matchCommand(e,Xe,c.inputState,"insert");"none"!=n.type&&(r=n)}if("none"==r.type)return P(s),!1;if("partial"==r.type)return L&&window.clearTimeout(L),L=window.setTimeout(function(){c.insertMode&&c.inputState.keyBuffer&&P(s)},_("insertModeEscKeysTimeout")),!t;if(L&&window.clearTimeout(L),t){for(var i=s.listSelections(),o=0;o<i.length;o++){var a=i[o].head;s.replaceRange("",V(a,0,-(e.length-1)),a,"+input")}z.macroModeState.lastInsertModeChanges.changes.pop()}return P(s),r.command}():function(){if(i()||u())return!0;var e=c.inputState.keyBuffer=c.inputState.keyBuffer+l;if(/^[1-9]\d*$/.test(e))return!0;if(!(t=/^(\d*)(.*)$/.exec(e)))return P(s),!1;var t,r=c.visualMode?"visual":"normal",n=F.matchCommand(t[2]||t[1],Xe,c.inputState,r);return"none"==n.type?(P(s),!1):"partial"==n.type||(c.inputState.keyBuffer="",(t=/^(\d*)(.*)$/.exec(e))[1]&&"0"!=t[1]&&c.inputState.pushRepeatDigit(t[1]),n.command)}())?c.insertMode||1!==l.length?void 0:function(){return!0}:!0===e?function(){return!0}:function(){return s.operation(function(){s.curOp.isVimOp=!0;try{"keyToKey"==e.type?function(e){for(var t;e;)t=/<\w+-.+?>|<\w+>|./.exec(e),l=t[0],e=e.substring(t.index+l.length),Ge.Vim.handleKey(s,l,"mapping")}(e.toKeys):F.processCommand(s,c,e)}catch(e){throw s.state.vim=void 0,A(s),Ge.Vim.suppressErrorLogging||console.log(e),e}return!0})}},handleEx:function(e,t){De.processCommand(e,t)},defineMotion:function(e,t){W[e]=t},defineAction:function(e,t){j[e]=t},defineOperator:function(e,t){H[e]=t},mapCommand:function(e,t,r,n,i){var o={keys:e,type:t};for(var a in o[t]=r,o[t+"Args"]=n,i)o[a]=i[a];ze(o)},_mapCommand:ze,defineRegister:function(e,t){var r=z.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(r[e])throw Error("Register already defined "+e);r[e]=t,h.push(e)},exitVisualMode:le,exitInsertMode:Fe};function I(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function P(e,t){e.state.vim.inputState=new I,Ge.signal(e,"vim-command-done",t)}function R(e,t,r){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!r}function B(e){this.registers=e,this.unnamedRegister=e['"']=new R,e["."]=new R,e[":"]=new R,e["/"]=new R}function D(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}I.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},I.prototype.getRepeat=function(){var e=0;return(0<this.prefixRepeat.length||0<this.motionRepeat.length)&&(e=1,0<this.prefixRepeat.length&&(e*=parseInt(this.prefixRepeat.join(""),10)),0<this.motionRepeat.length&&(e*=parseInt(this.motionRepeat.join(""),10))),e},R.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(M(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},B.prototype={pushText:function(e,t,r,n,i){n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var o=this.isValidRegister(e)?this.getRegister(e):null;if(o)b(e)?o.pushText(r,n):o.setText(r,n,i),this.unnamedRegister.setText(o.toString(),n);else{switch(t){case"yank":this.registers[0]=new R(r,n,i);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new R(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new R(r,n))}this.unnamedRegister.setText(r,n,i)}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new R),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&w(e,h)},shiftNumericRegisters_:function(){for(var e=9;2<=e;e--)this.registers[e]=this.getRegister(""+(e-1))}},D.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var i=this.iterator+n;t?0<=i:i<r.length;i+=n)for(var o=r[i],a=0;a<=o.length;a++)if(this.initialPrefix==o.substring(0,a))return this.iterator=i,o;return i>=r.length?(this.iterator=r.length,this.initialPrefix):i<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);-1<t&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var F={matchCommand:function(e,t,r,n){var i,o=function(e,t,r,n){for(var i,o=[],a=[],s=0;s<t.length;s++){var l=t[s];"insert"==r&&"insert"!=l.context||l.context&&l.context!=r||n.operator&&"action"==l.type||!(i=$(e,l.keys))||("partial"==i&&o.push(l),"full"==i&&a.push(l))}return{partial:o.length&&o,full:a.length&&a}}(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var a=0;a<o.full.length;a++){var s=o.full[a];i||(i=s)}if("<character>"==i.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(1<r.length)switch(r){case"<CR>":r="\n";break;case"<Space>":r=" ";break;default:r=""}return r}(e);if(!l)return{type:"none"};r.selectedCharacter=l}return{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r);break;case"ex":case"keyToEx":this.processEx(e,t,r)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=U(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);P(e)}n.operator=r.operator,n.operatorArgs=U(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,i=U(r.operatorMotionArgs);i&&n&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,i=n.getRepeat(),o=!!i,a=U(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=i||1,a.repeatIsExplicit=o,a.registerName=n.registerName,P(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),j[r.action](e,a,t)},processSearch:function(s,n,i){if(s.getSearchCursor){var l=i.searchArgs.forward,e=i.searchArgs.wholeWordOnly;xe(s).setReversed(!l);var t=l?"/":"?",o=xe(s).getQuery(),c=s.getScrollInfo();switch(i.searchArgs.querySrc){case"prompt":var r=z.macroModeState;r.isPlaying?d(f=r.replaySearchQueries.shift(),!0,!1):Te(s,{onClose:function(e){s.scrollTo(c.left,c.top),d(e,!0,!0);var t=z.macroModeState;t.isRecording&&function(e,t){if(!e.isPlaying){var r=e.latestRegister,n=z.registerController.getRegister(r);n&&n.pushSearchQuery&&n.pushSearchQuery(t)}}(t,e)},prefix:t,desc:Me,onKeyUp:function(e,t,r){var n,i,o,a=Ge.keyName(e);"Up"==a||"Down"==a?(n="Up"==a,i=e.target?e.target.selectionEnd:0,r(t=z.searchHistoryController.nextMatch(t,n)||""),i&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(i,e.target.value.length))):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&z.searchHistoryController.reset();try{o=Ae(s,t,!0,!0)}catch(e){}o?s.scrollIntoView(Ee(s,!l,o),30):(Ne(s),s.scrollTo(c.left,c.top))},onKeyDown:function(e,t,r){var n=Ge.keyName(e);"Esc"==n||"Ctrl-C"==n||"Ctrl-["==n||"Backspace"==n&&""==t?(z.searchHistoryController.pushInput(t),z.searchHistoryController.reset(),Ae(s,o),Ne(s),s.scrollTo(c.left,c.top),Ge.e_stop(e),P(s),r(),s.focus()):"Up"==n||"Down"==n?Ge.e_stop(e):"Ctrl-U"==n&&(Ge.e_stop(e),r(""))}});break;case"wordUnderCursor":var a=ue(s,!1,0,!1,!0),u=!0;if(a||(a=ue(s,!1,0,!1,!1),u=!1),!a)return;var f=s.getLine(a.start.line).substring(a.start.ch,a.end.ch);f=u&&e?"\\b"+f+"\\b":f.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),z.jumpList.cachedCursor=s.getCursor(),s.setCursor(a.start),d(f,!0,!1)}}function d(t,e,r){z.searchHistoryController.pushInput(t),z.searchHistoryController.reset();try{Ae(s,t,e,r)}catch(e){return Le(s,"Invalid regex: "+t),void P(s)}F.processMotion(s,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:i.searchArgs.toJumplist}})}},processEx:function(a,e,t){function r(e){z.exCommandHistoryController.pushInput(e),z.exCommandHistoryController.reset(),De.processCommand(a,e)}function n(e,t,r){var n,i,o=Ge.keyName(e);("Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==t)&&(z.exCommandHistoryController.pushInput(t),z.exCommandHistoryController.reset(),Ge.e_stop(e),P(a),r(),a.focus()),"Up"==o||"Down"==o?(Ge.e_stop(e),n="Up"==o,i=e.target?e.target.selectionEnd:0,r(t=z.exCommandHistoryController.nextMatch(t,n)||""),i&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(i,e.target.value.length))):"Ctrl-U"==o?(Ge.e_stop(e),r("")):"Left"!=o&&"Right"!=o&&"Ctrl"!=o&&"Alt"!=o&&"Shift"!=o&&z.exCommandHistoryController.reset()}"keyToEx"==t.type?De.processCommand(a,t.exArgs.input):e.visualMode?Te(a,{onClose:r,prefix:":",value:"'<,'>",onKeyDown:n,selectValueOnOpen:!1}):Te(a,{onClose:r,prefix:":",onKeyDown:n})},evalInput:function(e,t){var r,n,i,o,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,d=t.sel,h=X(t.visualMode?K(e,d.head):e.getCursor("head")),p=X(t.visualMode?K(e,d.anchor):e.getCursor("anchor")),m=X(h),g=X(p);if(c&&this.recordLastEdit(t,a),0<(i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat())&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,P(e),s){var v=W[s](e,h,l,t);if(t.lastMotion=W[s],!v)return;if(l.toJumplist){var y=z.jumpList,b=y.cachedCursor;b?(fe(e,b,v),delete y.cachedCursor):fe(e,h,v)}(r=v instanceof Array?(n=v[0],v[1]):v)||(r=X(h)),t.visualMode?(t.visualBlock&&r.ch===1/0||(r=K(e,r,t.visualBlock)),n&&(n=K(e,n,!0)),n=n||g,d.anchor=n,d.head=r,ae(e),ve(e,t,"<",Q(n,r)?n:r),ve(e,t,">",Q(n,r)?r:n)):c||(r=K(e,r),e.setCursor(r.line,r.ch))}if(c){if(u.lastSel){n=g;var x=u.lastSel,w=Math.abs(x.head.line-x.anchor.line),k=Math.abs(x.head.ch-x.anchor.ch);r=x.visualLine?Je(g.line+w,g.ch):x.visualBlock?Je(g.line+w,g.ch+k):x.head.line==x.anchor.line?Je(g.line,g.ch+k):Je(g.line+w,g.ch),t.visualMode=!0,t.visualLine=x.visualLine,t.visualBlock=x.visualBlock,d=t.sel={anchor:n,head:r},ae(e)}else t.visualMode&&(u.lastSel={anchor:X(d.anchor),head:X(d.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var C,S,_,L,M;if(t.visualMode){if(C=J(d.head,d.anchor),S=Z(d.head,d.anchor),_=t.visualLine||u.linewise,M=se(e,{anchor:C,head:S},L=t.visualBlock?"block":_?"line":"char"),_){var T=M.ranges;if("block"==L)for(var A=0;A<T.length;A++)T[A].head.ch=te(e,T[A].head.line);else"line"==L&&(T[0].head=Je(T[0].head.line+1,0))}}else{if(C=X(n||g),Q(S=X(r||m),C)){var O=C;C=S,S=O}(_=l.linewise||u.linewise)?(o=S,C.ch=0,o.ch=0,o.line++):l.forward&&function(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var i=n.split("\n");i.pop();for(var o=i.pop();0<i.length&&o&&N(o);o=i.pop())r.line--,r.ch=0;r.ch=o?(r.line--,te(e,r.line)):0}}(e,C,S),M=se(e,{anchor:C,head:S},L="char",!l.inclusive||_)}e.setSelections(M.ranges,M.primary),t.lastMotion=null,u.repeat=i,u.registerName=f,u.linewise=_;var E=H[c](e,u,M.ranges,g,r);t.visualMode&&le(e,null!=E),E&&e.setCursor(E)}},recordLastEdit:function(e,t,r){var n=z.macroModeState;n.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=r,n.lastInsertModeChanges.changes=[],n.lastInsertModeChanges.expectCursorActivityForChange=!1)}},W={moveToTopLine:function(e,t,r){var n=Ie(e).top+r.repeat-1;return Je(n,ce(e.getLine(n)))},moveToMiddleLine:function(e){var t=Ie(e),r=Math.floor(.5*(t.top+t.bottom));return Je(r,ce(e.getLine(r)))},moveToBottomLine:function(e,t,r){var n=Ie(e).bottom-r.repeat+1;return Je(n,ce(e.getLine(n)))},expandToLine:function(e,t,r){return Je(t.line+r.repeat-1,1/0)},findNext:function(e,t,r){var n=xe(e),i=n.getQuery();if(i){var o=!r.forward;return o=n.isReversed()?!o:o,Oe(e,i),Ee(e,o,i,r.repeat)}},goToMark:function(e,t,r,n){var i=Pe(e,n,r.selectedCharacter);return i?r.linewise?{line:i.line,ch:ce(e.getLine(i.line))}:i:null},moveToOtherHighlightedEnd:function(e,t,r,n){if(n.visualBlock&&r.sameLine){var i=n.sel;return[K(e,Je(i.anchor.line,i.head.ch)),K(e,Je(i.head.line,i.anchor.ch))]}return[n.sel.head,n.sel.anchor]},jumpToMark:function(e,t,r,n){for(var i=t,o=0;o<r.repeat;o++){var a=i;for(var s in n.marks)if(p(s)){var l=n.marks[s].find();if(!((r.forward?Q(l,a):Q(a,l))||r.linewise&&l.line==a.line)){var c=Y(a,i),u=r.forward?ee(a,l,i):ee(i,l,a);(c||u)&&(i=l)}}}return r.linewise&&(i=Je(i.line,ce(e.getLine(i.line)))),i},moveByCharacters:function(e,t,r){var n=t,i=r.repeat,o=r.forward?n.ch+i:n.ch-i;return Je(n.line,o)},moveByLines:function(e,t,r,n){var i=t,o=i.ch;switch(n.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:o=n.lastHPos;break;default:n.lastHPos=o}var a=r.repeat+(r.repeatOffset||0),s=r.forward?i.line+a:i.line-a,l=e.firstLine(),c=e.lastLine();return s<l&&i.line==l?this.moveToStartOfLine(e,t,r,n):c<s&&i.line==c?this.moveToEol(e,t,r,n):(r.toFirstChar&&(o=ce(e.getLine(s)),n.lastHPos=o),n.lastHSPos=e.charCoords(Je(s,o),"div").left,Je(s,o))},moveByDisplayLines:function(e,t,r,n){var i=t;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(i,"div").left}var o=r.repeat;if((s=e.findPosV(i,r.forward?o:-o,"line",n.lastHSPos)).hitSide)if(r.forward)var a={top:e.charCoords(s,"div").top+8,left:n.lastHSPos},s=e.coordsChar(a,"div");else{var l=e.charCoords(Je(e.firstLine(),0),"div");l.left=n.lastHSPos,s=e.coordsChar(l,"div")}return n.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,i=r.repeat;return e.findPosV(n,r.forward?i:-i,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return ye(e,t,r.repeat,n)},moveBySentence:function(e,t,r){var n=r.forward?1:-1;return function(e,t,r,n){function u(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!y(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=0<t.dir?0:t.line.length-1}else t.pos+=t.dir}function i(e,t,r,n){var i=e.getLine(t),o=""===i,a={line:i,ln:t,pos:r,dir:n},s={ln:a.ln,pos:a.pos},l=""===a.line;for(u(e,a);null!==a.line;){if(s.ln=a.ln,s.pos=a.pos,""===a.line&&!l)return{ln:a.ln,pos:a.pos};if(o&&""!==a.line&&!N(a.line[a.pos]))return{ln:a.ln,pos:a.pos};!x(a.line[a.pos])||o||a.pos!==a.line.length-1&&!N(a.line[a.pos+1])||(o=!0),u(e,a)}var i=e.getLine(s.ln);s.pos=0;for(var c=i.length-1;0<=c;--c)if(!N(i[c])){s.pos=c;break}return s}function o(e,t,r,n){var i=e.getLine(t),o={line:i,ln:t,pos:r,dir:n},a={ln:o.ln,pos:null},s=""===o.line;for(u(e,o);null!==o.line;){if(""===o.line&&!s)return null!==a.pos?a:{ln:o.ln,pos:o.pos};if(x(o.line[o.pos])&&null!==a.pos&&(o.ln!==a.ln||o.pos+1!==a.pos))return a;""===o.line||N(o.line[o.pos])||(s=!1,a={ln:o.ln,pos:o.pos}),u(e,o)}for(var i=e.getLine(a.ln),l=a.pos=0;l<i.length;++l)if(!N(i[l])){a.pos=l;break}return a}for(var a={ln:t.line,pos:t.ch};0<r;)a=n<0?o(e,a.ln,a.pos,n):i(e,a.ln,a.pos,n),r--;return Je(a.ln,a.pos)}(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var i=e.getScrollInfo(),o=null,a=r.repeat;a||(a=i.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");if(r.repeat=a,!(o=W.moveByDisplayLines(e,t,r,n)))return null;var l=e.charCoords(o,"local");return e.scrollTo(null,i.top+l.top-s.top),o},moveByWords:function(e,t,r){return function(e,t,r,n,i,o){var a=X(t),s=[];(n&&!i||!n&&i)&&r++;for(var l=!(n&&i),c=0;c<r;c++){var u=me(e,t,n,o,l);if(!u){var f=te(e,e.lastLine());s.push(n?{line:e.lastLine(),from:f,to:f}:{line:0,from:0,to:0});break}s.push(u),t=Je(u.line,n?u.to-1:u.from)}var d=s.length!=r,h=s[0],p=s.pop();return n&&!i?(d||h.from==a.ch&&h.line==a.line||(p=s.pop()),Je(p.line,p.from)):n&&i?Je(p.line,p.to-1):!n&&i?(d||h.to==a.ch&&h.line==a.line||(p=s.pop()),Je(p.line,p.to)):Je(p.line,p.from)}(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=ge(e,r.repeat,r.forward,r.selectedCharacter),i=r.forward?-1:1;return de(i,r),n?(n.ch+=i,n):null},moveToCharacter:function(e,t,r){var n=r.repeat;return de(0,r),ge(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){return function(e,t,r,n){var i=X(e.getCursor()),o=r?1:-1,a=r?e.lineCount():-1,s=i.ch,l=i.line,c=e.getLine(l),u={lineText:c,nextCh:c.charAt(s),lastCh:null,index:s,symb:n,reverseSymb:(r?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:r,depth:0,curMoveThrough:!1},f=he[n];if(!f)return i;var d=pe[f].init,h=pe[f].isComplete;for(d&&d(u);l!==a&&t;){if(u.index+=o,u.nextCh=u.lineText.charAt(u.index),!u.nextCh){if(l+=o,u.lineText=e.getLine(l)||"",0<o)u.index=0;else{var p=u.lineText.length;u.index=0<p?p-1:0}u.nextCh=u.lineText.charAt(u.index)}h(u)&&(i.line=l,i.ch=u.index,t--)}return u.nextCh||u.curMoveThrough?Je(l,u.index):i}(e,r.repeat,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var i,o,a,s=r.repeat;return n.lastHPos=s-1,n.lastHSPos=e.charCoords(t,"div").left,o=s,a=(i=e).getCursor().line,K(i,Je(a,o-1))},moveToEol:function(e,t,r,n){var i=t;n.lastHPos=1/0;var o=Je(i.line+r.repeat-1,1/0),a=e.clipPos(o);return a.ch--,n.lastHSPos=e.charCoords(a,"div").left,o},moveToFirstNonWhiteSpaceCharacter:function(e,t){var r=t;return Je(r.line,ce(e.getLine(r.line)))},moveToMatchedSymbol:function(e,t){for(var r,n=t,i=n.line,o=n.ch,a=e.getLine(i);o<a.length;o++)if((r=a.charAt(o))&&-1!="()[]{}".indexOf(r)){var s=e.getTokenTypeAt(Je(i,o+1));if("string"!==s&&"comment"!==s)break}return o<a.length?e.findMatchingBracket(Je(i,o),{bracketRegex:/[(){}[\]<>]/}).to:n},moveToStartOfLine:function(e,t){return Je(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,r){var n=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(n=r.repeat-e.getOption("firstLineNumber")),Je(n,ce(e.getLine(n)))},textObjectManipulation:function(e,t,r,n){var i=r.selectedCharacter;"b"==i?i="(":"B"==i&&(i="{");var o,a,s,l,c,u,f,d,h=!r.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[i])o=function(e,t,r,n){var i,o,a=t,s={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[r],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[r],c=e.getLine(a.line).charAt(a.ch)===l?1:0;if(i=e.scanForBracket(Je(a.line,a.ch+c),-1,void 0,{bracketRegex:s}),o=e.scanForBracket(Je(a.line,a.ch+c),1,void 0,{bracketRegex:s}),!i||!o)return{start:a,end:a};if(i=i.pos,o=o.pos,i.line==o.line&&i.ch>o.ch||i.line>o.line){var u=i;i=o,o=u}return n?o.ch+=1:i.ch+=1,{start:i,end:o}}(e,t,i,h);else if({"'":!0,'"':!0}[i])o=function(e,t,r,n){var i,o,a,s,l=X(t),c=e.getLine(l.line).split(""),u=c.indexOf(r);if(l.ch<u?l.ch=u:u<l.ch&&c[l.ch]==r&&(o=l.ch,--l.ch),c[l.ch]!=r||o)for(a=l.ch;-1<a&&!i;a--)c[a]==r&&(i=a+1);else i=l.ch+1;if(i&&!o)for(a=i,s=c.length;a<s&&!o;a++)c[a]==r&&(o=a);return i&&o?(n&&(--i,++o),{start:Je(l.line,i),end:Je(l.line,o)}):{start:l,end:l}}(e,t,i,h);else if("W"===i)o=ue(e,h,0,!0);else if("w"===i)o=ue(e,h,0,!1);else{if("p"!==i)return null;if(o=ye(e,t,r.repeat,0,h),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var p=n.inputState.operatorArgs;p&&(p.linewise=!0),o.end.line--}}return e.state.vim.visualMode?(a=e,s=o.start,l=o.end,u=a.state.vim.sel,f=u.head,d=u.anchor,Q(l,s)&&(c=l,l=s,s=c),Q(f,d)?(f=J(s,f),d=Z(d,l)):(d=J(s,d),-1==(f=V(f=Z(f,l),0,-1)).ch&&f.line!=a.firstLine()&&(f=Je(f.line-1,te(a,f.line-1)))),[d,f]):[o.start,o.end]},repeatLastCharacterSearch:function(e,t,r){var n=z.lastCharacterSearch,i=r.repeat,o=r.forward===n.forward,a=(n.increment?1:0)*(o?-1:1);e.moveH(-a,"char"),r.inclusive=!!o;var s=ge(e,i,o,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}};function q(e,t){for(var r=[],n=0;n<t;n++)r.push(e);return r}var H={change:function(e,t,r){var n,i,o=e.state.vim;if(z.macroModeState.lastInsertModeChanges.inVisualBlock=o.visualBlock,o.visualMode){i=e.getSelection();var a=q("",r.length);e.replaceSelections(a),n=J(r[0].head,r[0].anchor)}else{var s=r[0].anchor,l=r[0].head;i=e.getRange(s,l);var c=o.lastEditInputState||{};if("moveByWords"==c.motion&&!N(i)){var u=/\s+$/.exec(i);u&&c.motionArgs&&c.motionArgs.forward&&(l=V(l,0,-u[0].length),i=i.slice(0,-u[0].length))}var f=new Je(s.line-1,Number.MAX_VALUE),d=e.firstLine()==e.lastLine();l.line>e.lastLine()&&t.linewise&&!d?e.replaceRange("",f,l):e.replaceRange("",s,l),t.linewise&&(d||(e.setCursor(f),Ge.commands.newlineAndIndent(e)),s.ch=Number.MAX_VALUE),n=s}z.registerController.pushText(t.registerName,"change",i,t.linewise,1<r.length),j.enterInsertMode(e,{head:n},e.state.vim)},delete:function(e,t,r){var n,i,o=e.state.vim;if(o.visualBlock){i=e.getSelection();var a=q("",r.length);e.replaceSelections(a),n=r[0].anchor}else{var s=r[0].anchor,l=r[0].head;t.linewise&&l.line!=e.firstLine()&&s.line==e.lastLine()&&s.line==l.line-1&&(s.line==e.firstLine()?s.ch=0:s=Je(s.line-1,te(e,s.line-1))),i=e.getRange(s,l),e.replaceRange("",s,l),n=s,t.linewise&&(n=W.moveToFirstNonWhiteSpaceCharacter(e,s))}return z.registerController.pushText(t.registerName,"delete",i,t.linewise,o.visualBlock),K(e,n,o.insertMode)},indent:function(e,t,r){var n=e.state.vim,i=r[0].anchor.line,o=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&o--;for(var s=i;s<=o;s++)for(var l=0;l<a;l++)e.indentLine(s,t.indentRight);return W.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},indentAuto:function(e,t,r){return e.execCommand("indentAuto"),W.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,i){for(var o=e.getSelections(),a=[],s=t.toLower,l=0;l<o.length;l++){var c=o[l],u="";if(!0===s)u=c.toLowerCase();else if(!1===s)u=c.toUpperCase();else for(var f=0;f<c.length;f++){var d=c.charAt(f);u+=b(d)?d.toLowerCase():d.toUpperCase()}a.push(u)}return e.replaceSelections(a),t.shouldMoveCursor?i:!e.state.vim.visualMode&&t.linewise&&r[0].anchor.line+1==r[0].head.line?W.moveToFirstNonWhiteSpaceCharacter(e,n):t.linewise?n:J(r[0].anchor,r[0].head)},yank:function(e,t,r,n){var i=e.state.vim,o=e.getSelection(),a=i.visualMode?J(i.sel.anchor,i.sel.head,r[0].head,r[0].anchor):n;return z.registerController.pushText(t.registerName,"yank",o,t.linewise,i.visualBlock),a}};var j={jumpListWalk:function(e,t,r){if(!r.visualMode){var n=t.repeat,i=t.forward,o=z.jumpList.move(e,i?n:-n),a=o?o.find():void 0;a=a||e.getCursor(),e.setCursor(a)}},scroll:function(e,t,r){if(!r.visualMode){var n=t.repeat||1,i=e.defaultTextHeight(),o=e.getScrollInfo().top,a=i*n,s=t.forward?o+a:o-a,l=X(e.getCursor()),c=e.charCoords(l,"local");if(t.forward)s>c.top?(l.line+=(s-c.top)/i,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u<c.bottom?(l.line-=(c.bottom-u)/i,l.line=Math.floor(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,s)}}},scrollToCursor:function(e,t){var r=e.getCursor().line,n=e.charCoords(Je(r,0),"local"),i=e.getScrollInfo().clientHeight,o=n.top,a=n.bottom-o;switch(t.position){case"center":o=o-i/2+a;break;case"bottom":o=o-i+a}e.scrollTo(null,o)},replayMacro:function(e,t,r){var n=t.selectedCharacter,i=t.repeat,o=z.macroModeState;for("@"==n&&(n=o.latestRegister);i--;)We(e,r,o,n)},enterMacroRecordMode:function(e,t){var r=z.macroModeState,n=t.selectedCharacter;z.registerController.isValidRegister(n)&&r.enterMacroRecordMode(e,n)},toggleOverwrite:function(e){e.state.overwrite?(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),Ge.signal(e,"vim-mode-change",{mode:"insert"})):(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),Ge.signal(e,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(e,t,r){if(!e.getOption("readOnly")){r.insertMode=!0,r.insertModeRepeat=t&&t.repeat||1;var n=t?t.insertAt:null,i=r.sel,o=t.head||e.getCursor("head"),a=e.listSelections().length;if("eol"==n)o=Je(o.line,te(e,o.line));else if("charAfter"==n)o=V(o,0,1);else if("firstNonBlank"==n)o=W.moveToFirstNonWhiteSpaceCharacter(e,o);else if("startOfSelectedArea"==n)r.visualBlock?(o=Je(Math.min(i.head.line,i.anchor.line),Math.min(i.head.ch,i.anchor.ch)),a=Math.abs(i.head.line-i.anchor.line)+1):o=i.head.line<i.anchor.line?i.head:Je(i.anchor.line,0);else if("endOfSelectedArea"==n)r.visualBlock?(o=Je(Math.min(i.head.line,i.anchor.line),Math.max(i.head.ch+1,i.anchor.ch)),a=Math.abs(i.head.line-i.anchor.line)+1):o=i.head.line>=i.anchor.line?V(i.head,0,1):Je(i.anchor.line,0);else if("inplace"==n&&r.visualMode)return;e.setOption("disableInput",!1),t&&t.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),Ge.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),Ge.signal(e,"vim-mode-change",{mode:"insert"})),z.macroModeState.isPlaying||(e.on("change",qe),Ge.on(e.getInputField(),"keydown",Ue)),r.visualMode&&le(e),ie(e,o,a)}},toggleVisualMode:function(e,t,r){var n,i=t.repeat,o=e.getCursor();r.visualMode?r.visualLine^t.linewise||r.visualBlock^t.blockwise?(r.visualLine=!!t.linewise,r.visualBlock=!!t.blockwise,Ge.signal(e,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),ae(e)):le(e):(r.visualMode=!0,r.visualLine=!!t.linewise,r.visualBlock=!!t.blockwise,n=K(e,Je(o.line,o.ch+i-1),!0),r.sel={anchor:o,head:n},Ge.signal(e,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),ae(e),ve(e,r,"<",J(o,n)),ve(e,r,">",Z(o,n)))},reselectLastSelection:function(e,t,r){var n=r.lastSelection;if(r.visualMode&&oe(e,r),n){var i=n.anchorMark.find(),o=n.headMark.find();if(!i||!o)return;r.sel={anchor:i,head:o},r.visualMode=!0,r.visualLine=n.visualLine,r.visualBlock=n.visualBlock,ae(e),ve(e,r,"<",J(i,o)),ve(e,r,">",Z(i,o)),Ge.signal(e,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""})}},joinLines:function(e,t,r){var n,i;if(r.visualMode){if(n=e.getCursor("anchor"),Q(i=e.getCursor("head"),n)){var o=i;i=n,n=o}i.ch=te(e,i.line)-1}else{var a=Math.max(t.repeat,2);n=e.getCursor(),i=K(e,Je(n.line+a-1,1/0))}for(var s=0,l=n.line;l<i.line;l++){s=te(e,n.line),o=Je(n.line+1,te(e,n.line+1));var c=e.getRange(n,o);c=c.replace(/\n\s*/g," "),e.replaceRange(c,n,o)}var u=Je(n.line,s);r.visualMode&&le(e,!1),e.setCursor(u)},newLineAndEnterInsertMode:function(e,t,r){r.insertMode=!0;var n=X(e.getCursor());n.line!==e.firstLine()||t.after?(n.line=t.after?n.line:n.line-1,n.ch=te(e,n.line),e.setCursor(n),(Ge.commands.newlineAndIndentContinueComment||Ge.commands.newlineAndIndent)(e)):(e.replaceRange("\n",Je(e.firstLine(),0)),e.setCursor(e.firstLine(),0)),this.enterInsertMode(e,{repeat:t.repeat},r)},paste:function(n,e,t){var r,i,o,a,s,l=X(n.getCursor()),c=z.registerController.getRegister(e.registerName);if(v=c.toString()){if(e.matchIndent){var u=n.getOption("tabSize"),f=function(e){var t=e.split("\t").length-1,r=e.split(" ").length-1;return t*u+1*r},d=n.getLine(n.getCursor().line),h=f(d.match(/^\s*/)[0]),p=v.replace(/\n$/,""),m=v!==p,g=f(v.match(/^\s*/)[0]),v=p.replace(/^\s*/gm,function(e){var t=h+(f(e)-g);if(t<0)return"";if(n.getOption("indentWithTabs")){var r=Math.floor(t/u);return Array(r+1).join("\t")}return Array(t+1).join(" ")});v+=m?"\n":""}1<e.repeat&&(v=Array(e.repeat+1).join(v));var y,b,x,w,k,C,S,_,L,M,T=c.linewise,A=c.blockwise;if(T)t.visualMode?v=t.visualLine?v.slice(0,-1):"\n"+v.slice(0,v.length-1)+"\n":e.after?(v="\n"+v.slice(0,v.length-1),l.ch=te(n,l.line)):l.ch=0;else{if(A){v=v.split("\n");for(var O=0;O<v.length;O++)v[O]=""==v[O]?" ":v[O]}l.ch+=e.after?1:0}if(t.visualMode){var E;t.lastPastedText=v;var N=(x=n,k=(w=t).lastSelection,w.visualMode?(C=x.listSelections(),S=C[0],_=C[C.length-1],L=Q(S.anchor,S.head)?S.anchor:S.head,M=Q(_.anchor,_.head)?_.head:_.anchor,[L,M]):function(){var e=x.getCursor(),t=x.getCursor(),r=k.visualBlock;if(r){var n=r.width,i=r.height;t=Je(e.line+i,e.ch+n);for(var o=[],a=e.line;a<t.line;a++){var s=Je(a,e.ch),l=Je(a,t.ch),c={anchor:s,head:l};o.push(c)}x.setSelections(o)}else{var u=k.anchorMark.find(),f=k.headMark.find(),d=f.line-u.line,h=f.ch-u.ch;t={line:t.line+d,ch:d?t.ch:h+t.ch},k.visualLine&&(e=Je(e.line,0),t=Je(t.line,te(x,t.line))),x.setSelection(e,t)}return[e,t]}()),I=N[0],P=N[1],R=n.getSelection(),B=n.listSelections(),D=new Array(B.length).join("1").split("1");t.lastSelection&&(E=t.lastSelection.headMark.find()),z.registerController.unnamedRegister.setText(R),y=A?(n.replaceSelections(D),P=Je(I.line+v.length-1,I.ch),n.setCursor(I),ne(n,P),n.replaceSelections(v),I):t.visualBlock?(n.replaceSelections(D),n.setCursor(I),n.replaceRange(v,I,I),I):(n.replaceRange(v,I,P),n.posFromIndex(n.indexFromPos(I)+v.length-1)),E&&(t.lastSelection.headMark=n.setBookmark(E)),T&&(y.ch=0)}else if(A){for(n.setCursor(l),O=0;O<v.length;O++){var F=l.line+O;F>n.lastLine()&&n.replaceRange("\n",Je(F,0)),te(n,F)<l.ch&&(r=n,i=F,o=l.ch,void 0,a=te(r,i),s=new Array(o-a+1).join(" "),r.setCursor(Je(i,a)),r.replaceRange(s,r.getCursor()))}n.setCursor(l),ne(n,Je(l.line+v.length-1,l.ch)),n.replaceSelections(v),y=l}else n.replaceRange(v,l),y=T&&e.after?Je(l.line+1,ce(n.getLine(l.line+1))):T&&!e.after?Je(l.line,ce(n.getLine(l.line))):!T&&e.after?(b=n.indexFromPos(l),n.posFromIndex(b+v.length-1)):(b=n.indexFromPos(l),n.posFromIndex(b+v.length));t.visualMode&&le(n,!1),n.setCursor(y)}},undo:function(e,t){e.operation(function(){G(e,Ge.commands.undo,t.repeat)(),e.setCursor(e.getCursor("anchor"))})},redo:function(e,t){G(e,Ge.commands.redo,t.repeat)()},setRegister:function(e,t,r){r.inputState.registerName=t.selectedCharacter},setMark:function(e,t,r){ve(e,r,t.selectedCharacter,e.getCursor())},replace:function(e,t,r){var n,i,o=t.selectedCharacter,a=e.getCursor(),s=e.listSelections();if(r.visualMode)a=e.getCursor("start"),i=e.getCursor("end");else{var l=e.getLine(a.line);(n=a.ch+t.repeat)>l.length&&(n=l.length),i=Je(a.line,n)}if("\n"==o)r.visualMode||e.replaceRange("",a,i),(Ge.commands.newlineAndIndentContinueComment||Ge.commands.newlineAndIndent)(e);else{var c=e.getRange(a,i);if(c=c.replace(/[^\n]/g,o),r.visualBlock){var u=new Array(e.getOption("tabSize")+1).join(" ");c=(c=e.getSelection()).replace(/\t/g,u).replace(/[^\n]/g,o).split("\n"),e.replaceSelections(c)}else e.replaceRange(c,a,i);r.visualMode?(a=Q(s[0].anchor,s[0].head)?s[0].anchor:s[0].head,e.setCursor(a),le(e,!1)):e.setCursor(V(i,0,-1))}},incrementNumberToken:function(e,t){for(var r,n,i,o,a=e.getCursor(),s=e.getLine(a.line),l=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(r=l.exec(s))&&(i=(n=r.index)+r[0].length,!(a.ch<i)););if((t.backtrack||!(i<=a.ch))&&r){var c=r[2]||r[4],u=r[3]||r[5],f=t.increase?1:-1,d={"0b":2,0:8,"":10,"0x":16}[c.toLowerCase()];o=(parseInt(r[1]+u,d)+f*t.repeat).toString(d);var h=c?new Array(u.length-o.length+1+r[1].length).join("0"):"";o="-"===o.charAt(0)?"-"+c+h+o.substr(1):c+h+o;var p=Je(a.line,n),m=Je(a.line,i);e.replaceRange(o,p,m),e.setCursor(Je(a.line,n+o.length-1))}},repeatLastEdit:function(e,t,r){if(r.lastEditInputState){var n=t.repeat;n&&t.repeatIsExplicit?r.lastEditInputState.repeatOverride=n:n=r.lastEditInputState.repeatOverride||n,Ve(e,r,n,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:Fe};function K(e,t,r){var n=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=te(e,n)-1;i=r?i+1:i;var o=Math.min(Math.max(0,t.ch),i);return Je(n,o)}function U(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function V(e,t,r){return"object"==typeof t&&(r=t.ch,t=t.line),Je(e.line+t,e.ch+r)}function $(e,t){if("<character>"!=t.slice(-11))return e==t?"full":0==t.indexOf(e)&&"partial";var r=t.length-11,n=e.slice(0,r),i=t.slice(0,r);return n==i&&e.length>r?"full":0==i.indexOf(n)&&"partial"}function G(t,r,n){return function(){for(var e=0;e<n;e++)r(t)}}function X(e){return Je(e.line,e.ch)}function Y(e,t){return e.ch==t.ch&&e.line==t.line}function Q(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function J(e,t){return 2<arguments.length&&(t=J.apply(void 0,Array.prototype.slice.call(arguments,1))),Q(e,t)?e:t}function Z(e,t){return 2<arguments.length&&(t=Z.apply(void 0,Array.prototype.slice.call(arguments,1))),Q(e,t)?t:e}function ee(e,t,r){var n=Q(e,t),i=Q(t,r);return n&&i}function te(e,t){return e.getLine(t).length}function re(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ne(e,t){var r=[],n=e.listSelections(),i=X(e.clipPos(t)),o=!Y(t,i),a=function(e,t,r){for(var n=0;n<e.length;n++){var i="head"!=r&&Y(e[n].anchor,t),o="anchor"!=r&&Y(e[n].head,t);if(i||o)return n}return-1}(n,e.getCursor("head")),s=Y(n[a].head,n[a].anchor),l=n.length-1,c=a<l-a?l:0,u=n[c].anchor,f=Math.min(u.line,i.line),d=Math.max(u.line,i.line),h=u.ch,p=i.ch,m=n[c].head.ch-h,g=p-h;0<m&&g<=0?(h++,o||p--):m<0&&0<=g?(h--,s||p++):m<0&&-1==g&&(h--,p++);for(var v=f;v<=d;v++){var y={anchor:new Je(v,h),head:new Je(v,p)};r.push(y)}return e.setSelections(r),t.ch=p,u.ch=h,u}function ie(e,t,r){for(var n=[],i=0;i<r;i++){var o=V(t,i,0);n.push({anchor:o,head:o})}e.setSelections(n,0)}function oe(e,t){var r=t.sel.anchor,n=t.sel.head;t.lastPastedText&&(n=e.posFromIndex(e.indexFromPos(r)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(r),headMark:e.setBookmark(n),anchor:X(r),head:X(n),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function ae(e,t,r){var n=e.state.vim,i=se(e,t=t||n.sel,r=r||n.visualLine?"line":n.visualBlock?"block":"char");e.setSelections(i.ranges,i.primary),je(e)}function se(e,t,r,n){var i=X(t.head),o=X(t.anchor);if("char"==r){var a=n||Q(t.head,t.anchor)?0:1,s=Q(t.head,t.anchor)?1:0;return i=V(t.head,0,a),{ranges:[{anchor:o=V(t.anchor,0,s),head:i}],primary:0}}if("line"==r){if(Q(t.head,t.anchor))i.ch=0,o.ch=te(e,o.line);else{o.ch=0;var l=e.lastLine();i.line>l&&(i.line=l),i.ch=te(e,i.line)}return{ranges:[{anchor:o,head:i}],primary:0}}if("block"==r){for(var c=Math.min(o.line,i.line),u=Math.min(o.ch,i.ch),f=Math.max(o.line,i.line),d=Math.max(o.ch,i.ch)+1,h=f-c+1,p=i.line==c?0:h-1,m=[],g=0;g<h;g++)m.push({anchor:Je(c+g,u),head:Je(c+g,d)});return{ranges:m,primary:p}}}function le(e,t){var r=e.state.vim;!1!==t&&e.setCursor(K(e,r.sel.head)),oe(e,r),r.visualMode=!1,r.visualLine=!1,r.visualBlock=!1,Ge.signal(e,"vim-mode-change",{mode:"normal"}),r.fakeCursor&&r.fakeCursor.clear()}function ce(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ue(e,t,r,n,i){for(var o,a,s=(a=(o=e).getCursor("head"),1==o.getSelection().length&&(a=J(a,o.getCursor("anchor"))),a),l=e.getLine(s.line),c=s.ch,u=i?g[0]:v[0];!u(l.charAt(c));)if(++c>=l.length)return null;n?u=v[0]:(u=g[0])(l.charAt(c))||(u=g[1]);for(var f=c,d=c;u(l.charAt(f))&&f<l.length;)f++;for(;u(l.charAt(d))&&0<=d;)d--;if(d++,t){for(var h=f;/\s/.test(l.charAt(f))&&f<l.length;)f++;if(h==f){for(var p=d;/\s/.test(l.charAt(d-1))&&0<d;)d--;d||(d=p)}}return{start:Je(s.line,d),end:Je(s.line,f)}}function fe(e,t,r){Y(t,r)||z.jumpList.add(e,t,r)}function de(e,t){z.lastCharacterSearch.increment=e,z.lastCharacterSearch.forward=t.forward,z.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var he={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},pe={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,1<=e.depth)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function me(e,t,r,n,i){var o=t.line,a=t.ch,s=e.getLine(o),l=r?1:-1,c=n?v:g;if(i&&""==s){if(o+=l,s=e.getLine(o),!y(e,o))return null;a=r?0:s.length}for(;;){if(i&&""==s)return{from:0,to:0,line:o};for(var u=0<l?s.length:-1,f=u,d=u;a!=u;){for(var h=!1,p=0;p<c.length&&!h;++p)if(c[p](s.charAt(a))){for(f=a;a!=u&&c[p](s.charAt(a));)a+=l;if(h=f!=(d=a),f==t.ch&&o==t.line&&d==f+l)continue;return{from:Math.min(f,d+1),to:Math.max(f,d),line:o}}h||(a+=l)}if(!y(e,o+=l))return null;s=e.getLine(o),a=0<l?0:s.length}}function ge(e,t,r,n){for(var i,o=e.getCursor(),a=o.ch,s=0;s<t;s++){if(-1==(l=a,c=e.getLine(o.line),u=n,f=!0,d=void 0,r?-1==(d=c.indexOf(u,l+1))||f||(d-=1):-1==(d=c.lastIndexOf(u,l-1))||f||(d+=1),i=d))return null;a=i}var l,c,u,f,d;return Je(e.getCursor().line,i)}function ve(e,t,r,n){w(r,d)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function ye(t,e,r,n,i){var o,a=e.line,s=t.firstLine(),l=t.lastLine(),c=a;function u(e){return!t.getLine(e)}function f(e,t,r){return r?u(e)!=u(e+t):!u(e)&&u(e+t)}if(n){for(;s<=c&&c<=l&&0<r;)f(c,n)&&r--,c+=n;return new Je(c,0)}var d=t.state.vim;if(d.visualLine&&f(a,1,!0)){var h=d.sel.anchor;f(h.line,-1,!0)&&(i&&h.line==a||(a+=1))}var p=u(a);for(c=a;c<=l&&r;c++)f(c,1,!0)&&(i&&u(c)==p||r--);for(o=new Je(c,0),l<c&&!p?p=!0:i=!1,c=a;s<c&&(i&&u(c)!=p&&c!=a||!f(c,-1,!0));c--);return{start:new Je(c,0),end:o}}function be(){}function xe(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new be)}function we(e,t){var r=ke(e,t)||[];if(!r.length)return[];var n=[];if(0===r[0]){for(var i=0;i<r.length;i++)"number"==typeof r[i]&&n.push(e.substring(r[i]+1,r[i+1]));return n}}function ke(e,t){t||(t="/");for(var r=!1,n=[],i=0;i<e.length;i++){var o=e.charAt(i);r||o!=t||n.push(i),r=!r&&"\\"==o}return n}C("pcre",!0,"boolean"),be.prototype={getQuery:function(){return z.query},setQuery:function(e){z.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return z.isReversed},setReversed:function(e){z.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Ce={"\\n":"\n","\\r":"\r","\\t":"\t"};var Se={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"};function _e(e,t,r){if(z.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var n,i,o=ke(e,"/");return o.length?(n=e.substring(0,o[0]),i=-1!=e.substring(o[0]).indexOf("i")):n=e,n?(_("pcre")||(n=function(e){for(var t=!1,r=[],n=-1;n<e.length;n++){var i=e.charAt(n)||"",o=e.charAt(n+1)||"",a=o&&-1!="|(){".indexOf(o);t?("\\"===i&&a||r.push(i),t=!1):"\\"===i?(t=!0,o&&-1!="}".indexOf(o)&&(a=!0),a&&"\\"!==o||r.push(i)):(r.push(i),a&&"\\"!==o&&r.push("\\"))}return r.join("")}(n)),r&&(t=/^[^A-Z]*$/.test(n)),new RegExp(n,t||i?"i":void 0)):null}function Le(e,t){e.openNotification?e.openNotification('<span style="color: red">'+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}var Me="(Javascript regexp)";function Te(e,t){var r,n,i,o,a,s,l,c,u=(t.prefix||"")+" "+(t.desc||""),f=(r=t.prefix,n=t.desc,i='<span style="font-family: monospace; white-space: pre">'+(r||"")+'<input type="text"></span>',n&&(i+=' <span style="color: #888">'+n+"</span>"),i);o=e,a=f,s=u,l=t.onClose,c=t,o.openDialog?o.openDialog(a,l,{bottom:!0,value:c.value,onKeyDown:c.onKeyDown,onKeyUp:c.onKeyUp,selectValueOnOpen:!1}):l(prompt(s,""))}function Ae(e,t,r,n){if(t){var i=xe(e),o=_e(t,!!r,!!n);if(o)return Oe(e,o),function(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;n<r.length;n++){var i=r[n];if(e[i]!==t[i])return!1}return!0}return!1}(o,i.getQuery())||i.setQuery(o),o}}function Oe(e,t){var r=xe(e),n=r.getOverlay();n&&t==n.query||(n&&e.removeOverlay(n),n=function(r){if("^"==r.source.charAt(0))var n=!0;return{token:function(e){if(!n||e.sol()){var t=e.match(r,!1);if(t)return 0==t[0].length?(e.next(),"searching"):e.sol()||(e.backUp(1),r.exec(e.next()+t[0]))?(e.match(r),"searching"):(e.next(),null);for(;!e.eol()&&(e.next(),!e.match(r,!1)););}else e.skipToEnd()},query:r}}(t),e.addOverlay(n),e.showMatchesOnScrollbar&&(r.getScrollbarAnnotate()&&r.getScrollbarAnnotate().clear(),r.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),r.setOverlay(n))}function Ee(i,o,a,s){return void 0===s&&(s=1),i.operation(function(){for(var e=i.getCursor(),t=i.getSearchCursor(a,e),r=0;r<s;r++){var n=t.find(o);if(0==r&&n&&Y(t.from(),e)&&(n=t.find(o)),!n&&!(t=i.getSearchCursor(a,o?Je(i.lastLine()):Je(i.firstLine(),0))).find(o))return}return t.from()})}function Ne(e){var t=xe(e);e.removeOverlay(xe(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Ie(e){var t=e.getScrollInfo(),r=e.coordsChar({left:0,top:6+t.top},"local"),n=t.clientHeight-10+t.top,i=e.coordsChar({left:0,top:n},"local");return{top:r.line,bottom:i.line}}function Pe(e,t,r){if("'"==r){var n=e.doc.history.done,i=n[n.length-2];return i&&i.ranges&&i.ranges[0].head}if("."==r){if(0==e.doc.history.lastModTime)return;var o=e.doc.history.done.filter(function(e){if(void 0!==e.changes)return e});return o.reverse(),o[0].changes[0].to}var a=t.marks[r];return a&&a.find()}var Re=function(){this.buildCommandMap_()};Re.prototype={processCommand:function(e,t,r){var n=this;e.operation(function(){e.curOp.isVimOp=!0,n._processCommand(e,t,r)})},_processCommand:function(t,e,r){var n=t.state.vim,i=z.registerController.getRegister(":"),o=i.toString();n.visualMode&&le(t);var a=new Ge.StringStream(e);i.setText(e);var s,l,c=r||{};c.input=e;try{this.parseInput_(t,a,c)}catch(e){throw Le(t,e),e}if(c.commandName){if(s=this.matchCommand_(c.commandName)){if(l=s.name,s.excludeFromCommandHistory&&i.setText(o),this.parseCommandArgs_(a,c,s),"exToKey"==s.type){for(var u=0;u<s.toKeys.length;u++)Ge.Vim.handleKey(t,s.toKeys[u],"mapping");return}if("exToEx"==s.type)return void this.processCommand(t,s.toInput)}}else void 0!==c.line&&(l="move");if(l)try{Be[l](t,c),s&&s.possiblyAsync||!c.callback||c.callback()}catch(e){throw Le(t,e),e}else Le(t,'Not an editor command ":'+e+'"')},parseInput_:function(e,t,r){t.eatWhile(":"),t.eat("%")?(r.line=e.firstLine(),r.lineEnd=e.lastLine()):(r.line=this.parseLineSpec_(e,t),void 0!==r.line&&t.eat(",")&&(r.lineEnd=this.parseLineSpec_(e,t)));var n=t.match(/^(\w+)/);return r.commandName=n?n[1]:t.match(/.*/)[0],r},parseLineSpec_:function(e,t){var r=t.match(/^(\d+)/);if(r)return parseInt(r[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var n=t.next(),i=Pe(e,e.state.vim,n);if(!i)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,i.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var r=e.match(/^([+-])?(\d+)/);if(r){var n=parseInt(r[2],10);"-"==r[1]?t-=n:t+=n}return t},parseCommandArgs_:function(e,t,r){if(!e.eol()){t.argString=e.match(/.*/)[0];var n=r.argDelimiter||/\s+/,i=re(t.argString).split(n);i.length&&i[0]&&(t.args=i)}},matchCommand_:function(e){for(var t=e.length;0<t;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<Qe.length;e++){var t=Qe[e],r=t.shortName||t.name;this.commandMap_[r]=t}},map:function(e,t,r){if(":"!=e&&":"==e.charAt(0)){if(r)throw Error("Mode not supported for ex mappings");var n=e.substring(1);":"!=t&&":"==t.charAt(0)?this.commandMap_[n]={name:n,type:"exToEx",toInput:t.substring(1),user:!0}:this.commandMap_[n]={name:n,type:"exToKey",toKeys:t,user:!0}}else if(":"!=t&&":"==t.charAt(0)){var i={keys:e,type:"keyToEx",exArgs:{input:t.substring(1)}};r&&(i.context=r),Xe.unshift(i)}else i={keys:e,type:"keyToKey",toKeys:t},r&&(i.context=r),Xe.unshift(i)},unmap:function(e,t){if(":"!=e&&":"==e.charAt(0)){if(t)throw Error("Mode not supported for ex mappings");var r=e.substring(1);if(this.commandMap_[r]&&this.commandMap_[r].user)return void delete this.commandMap_[r]}else for(var n=e,i=0;i<Xe.length;i++)if(n==Xe[i].keys&&Xe[i].context===t)return void Xe.splice(i,1);throw Error("No such mapping.")}};var Be={colorscheme:function(e,t){!t.args||t.args.length<1?Le(e,e.getOption("theme")):e.setOption("theme",t.args[0])},map:function(e,t,r){var n=t.args;!n||n.length<2?e&&Le(e,"Invalid mapping: "+t.input):De.map(n[0],n[1],r)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,r){var n=t.args;!n||n.length<1?e&&Le(e,"No such mapping: "+t.input):De.unmap(n[0],r)},move:function(e,t){F.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var r=t.args,n=t.setCfg||{};if(!r||r.length<1)e&&Le(e,"Invalid mapping: "+t.input);else{var i=r[0].split("="),o=i[0],a=i[1],s=!1;if("?"==o.charAt(o.length-1)){if(a)throw Error("Trailing characters: "+t.argString);o=o.substring(0,o.length-1),s=!0}void 0===a&&"no"==o.substring(0,2)&&(o=o.substring(2),a=!1);var l=k[o]&&"boolean"==k[o].type;if(l&&null==a&&(a=!0),!l&&void 0===a||s){var c=_(o,e,n);c instanceof Error?Le(e,c.message):Le(e,!0===c||!1===c?" "+(c?"":"no")+o:" "+o+"="+c)}else{var u=S(o,a,e,n);u instanceof Error&&Le(e,u.message)}}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var r=t.args,n=z.registerController.registers,i="----------Registers----------<br><br>";if(r){r=r.join("");for(var o=0;o<r.length;o++)a=r.charAt(o),z.registerController.isValidRegister(a)&&(i+='"'+a+" "+(n[a]||new R).toString()+"<br>")}else for(var a in n){var s=n[a].toString();s.length&&(i+='"'+a+" "+s+"<br>")}Le(e,i)},sort:function(e,o){var a,s,l,c,u,t=function(){if(o.argString){var e=new Ge.StringStream(o.argString);if(e.eat("!")&&(a=!0),e.eol())return;if(!e.eatSpace())return"Invalid arguments";var t=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!t&&!e.eol())return"Invalid arguments";if(t[1]){s=-1!=t[1].indexOf("i"),l=-1!=t[1].indexOf("u");var r=-1!=t[1].indexOf("d")||-1!=t[1].indexOf("n")&&1,n=-1!=t[1].indexOf("x")&&1,i=-1!=t[1].indexOf("o")&&1;if(1<r+n+i)return"Invalid arguments";c=(r?"decimal":n&&"hex")||i&&"octal"}t[2]&&(u=new RegExp(t[2].substr(1,t[2].length-2),s?"i":""))}}();if(t)Le(e,t+": "+o.argString);else{var r=o.line||e.firstLine(),n=o.lineEnd||o.line||e.lastLine();if(r!=n){var i=Je(r,0),f=Je(n,te(e,n)),d=e.getRange(i,f).split("\n"),h=u||("decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null),p="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,m=[],g=[];if(c||u)for(var v=0;v<d.length;v++){var y=u?d[v].match(u):null;y&&""!=y[0]?m.push(y):!u&&h.exec(d[v])?m.push(d[v]):g.push(d[v])}else g=d;if(m.sort(u?function(e,t){var r;return a&&(r=e,e=t,t=r),s&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}:w),u)for(v=0;v<m.length;v++)m[v]=m[v].input;else c||g.sort(w);if(d=a?m.concat(g):g.concat(m),l){var b,x=d;for(d=[],v=0;v<x.length;v++)x[v]!=b&&d.push(x[v]),b=x[v]}e.replaceRange(d.join("\n"),i,f)}}function w(e,t){var r;a&&(r=e,e=t,t=r),s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&h.exec(e),i=c&&h.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),p))-(i=parseInt((i[1]+i[2]).toLowerCase(),p)):e<t?-1:1}},global:function(t,e){var r=e.argString;if(r){var n,i=void 0!==e.line?e.line:t.firstLine(),o=e.lineEnd||e.line||t.lastLine(),a=we(r,"/"),s=r;if(a.length&&(s=a[0],n=a.slice(1,a.length).join("/")),s)try{Ae(t,s,!0,!0)}catch(e){return void Le(t,"Invalid regex: "+s)}for(var l=xe(t).getQuery(),c=[],u="",f=i;f<=o;f++)l.test(t.getLine(f))&&(c.push(f+1),u+=t.getLine(f)+"<br>");if(n){var d=0,h=function(){if(d<c.length){var e=c[d]+n;De.processCommand(t,e,{callback:h})}d++};h()}else Le(t,u)}else Le(t,"Regular Expression missing from global")},substitute:function(t,e){if(!t.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var r,n,i,o,a=e.argString,s=a?we(a,a[0]):[],l="",c=!1,u=!1;if(s.length)r=s[0],l=s[1],r&&"$"===r[r.length-1]&&(r=r.slice(0,r.length-1)+"\\n",l=l?l+"\n":"\n"),void 0!==l&&(l=_("pcre")?function(e){for(var t=new Ge.StringStream(e),r=[];!t.eol();){for(;t.peek()&&"\\"!=t.peek();)r.push(t.next());var n=!1;for(var i in Se)if(t.match(i,!0)){n=!0,r.push(Se[i]);break}n||r.push(t.next())}return r.join("")}(l):function(e){for(var t,r=!1,n=[],i=-1;i<e.length;i++){var o=e.charAt(i)||"",a=e.charAt(i+1)||"";Ce[o+a]?(n.push(Ce[o+a]),i++):r?(n.push(o),r=!1):"\\"===o?(r=!0,t=a,m.test(t)||"$"===a?n.push("$"):"/"!==a&&"\\"!==a&&n.push("\\")):("$"===o&&n.push("$"),n.push(o),"/"===a&&n.push("\\"))}return n.join("")}(l),z.lastSubstituteReplacePart=l),n=s[2]?s[2].split(" "):[];else if(a&&a.length)return void Le(t,"Substitutions should be of the form :s/pattern/replace/");if(n&&(i=n[0],o=parseInt(n[1]),i&&(-1!=i.indexOf("c")&&(c=!0,i.replace("c","")),-1!=i.indexOf("g")&&(u=!0,i.replace("g","")),r=r.replace(/\//g,"\\/")+"/"+i)),r)try{Ae(t,r,!0,!0)}catch(e){return void Le(t,"Invalid regex: "+r)}if(void 0!==(l=l||z.lastSubstituteReplacePart)){var f=xe(t).getQuery(),d=void 0!==e.line?e.line:t.getCursor().line,h=e.lineEnd||d;d==t.firstLine()&&h==t.lastLine()&&(h=1/0),o&&(h=(d=h)+o-1);var p=K(t,Je(d,0));!function(i,e,n,o,a,s,r,l,c){var u=!(i.state.vim.exMode=!0),f=s.from();function d(){i.operation(function(){for(;!u;)h(),p();m()})}function h(){var e=i.getRange(s.from(),s.to()),t=e.replace(r,l);s.replace(t)}function p(){for(;s.findNext()&&(e=s.from(),t=o,r=a,"number"!=typeof e&&(e=e.line),t instanceof Array?w(e,t):r?t<=e&&e<=r:e==t);)if(n||!f||s.from().line!=f.line)return i.scrollIntoView(s.from(),30),i.setSelection(s.from(),s.to()),f=s.from(),void(u=!1);var e,t,r;u=!0}function m(e){if(e&&e(),i.focus(),f){i.setCursor(f);var t=i.state.vim;t.exMode=!1,t.lastHPos=t.lastHSPos=f.ch}c&&c()}p(),u?Le(i,"No matches for "+r.source):e?Te(i,{prefix:"replace with <strong>"+l+"</strong> (y/n/a/q/l)",onKeyDown:function(e,t,r){switch(Ge.e_stop(e),Ge.keyName(e)){case"Y":h(),p();break;case"N":p();break;case"A":var n=c;c=void 0,i.operation(d),c=n;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":m(r)}return u&&m(r),!0}}):(d(),c&&c())}(t,c,u,d,h,t.getSearchCursor(f,p),f,l,e.callback)}else Le(t,"No previous substitute regular expression")},redo:Ge.commands.redo,undo:Ge.commands.undo,write:function(e){Ge.commands.save?Ge.commands.save(e):e.save&&e.save()},nohlsearch:function(e){Ne(e)},yank:function(e){var t=X(e.getCursor()).line,r=e.getLine(t);z.registerController.pushText("0","yank",r,!0,!0)},delmarks:function(e,t){if(t.argString&&re(t.argString))for(var r=e.state.vim,n=new Ge.StringStream(re(t.argString));!n.eol();){n.eatSpace();var i=n.pos;if(!n.match(/[a-zA-Z]/,!1))return void Le(e,"Invalid argument: "+t.argString.substring(i));var o=n.next();if(n.match("-",!0)){if(!n.match(/[a-zA-Z]/,!1))return void Le(e,"Invalid argument: "+t.argString.substring(i));var a=o,s=n.next();if(!(p(a)&&p(s)||b(a)&&b(s)))return void Le(e,"Invalid argument: "+a+"-");var l=a.charCodeAt(0),c=s.charCodeAt(0);if(c<=l)return void Le(e,"Invalid argument: "+t.argString.substring(i));for(var u=0;u<=c-l;u++){var f=String.fromCharCode(l+u);delete r.marks[f]}}else delete r.marks[o]}else Le(e,"Argument required")}},De=new Re;function Fe(e){var t=e.state.vim,r=z.macroModeState,n=z.registerController.getRegister("."),i=r.isPlaying,o=r.lastInsertModeChanges;i||(e.off("change",qe),Ge.off(e.getInputField(),"keydown",Ue)),!i&&1<t.insertModeRepeat&&(Ve(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),n.setText(o.changes.join("")),Ge.signal(e,"vim-mode-change",{mode:"normal"}),r.isRecording&&function(e){if(!e.isPlaying){var t=e.latestRegister,r=z.registerController.getRegister(t);r&&r.pushInsertModeChanges&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}(r)}function ze(e){Xe.unshift(e)}function We(e,t,r,n){var i=z.registerController.getRegister(n);if(":"==n)return i.keyBuffer[0]&&De.processCommand(e,i.keyBuffer[0]),void(r.isPlaying=!1);var o=i.keyBuffer,a=0;r.isPlaying=!0,r.replaySearchQueries=i.searchQueries.slice(0);for(var s=0;s<o.length;s++)for(var l,c,u=o[s];u;)if(c=(l=/<\w+-.+?>|<\w+>|./.exec(u))[0],u=u.substring(l.index+c.length),Ge.Vim.handleKey(e,c,"macro"),t.insertMode){var f=i.insertModeChanges[a++].changes;$e(e,z.macroModeState.lastInsertModeChanges.changes=f,1),Fe(e)}r.isPlaying=!1}function qe(e,t){var r=z.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,1<n.ignoreCount)n.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var i=e.listSelections().length;1<i&&(n.ignoreCount=i);var o=t.text.join("\n");n.maybeReset&&(n.changes=[],n.maybeReset=!1),o&&(e.state.overwrite&&!/\n/.test(o)?n.changes.push([o]):n.changes.push(o))}t=t.next}}function He(e){var t=e.state.vim;if(t.insertMode){var r=z.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.maybeReset=!0}else e.curOp.isVimOp||function(e,t){var r=e.getCursor("anchor"),n=e.getCursor("head");if(t.visualMode&&!e.somethingSelected()?le(e,!1):t.visualMode||t.insertMode||!e.somethingSelected()||(t.visualMode=!0,t.visualLine=!1,Ge.signal(e,"vim-mode-change",{mode:"visual"})),t.visualMode){var i=Q(n,r)?0:-1,o=Q(n,r)?-1:0;n=V(n,0,i),r=V(r,0,o),t.sel={anchor:r,head:n},ve(e,t,"<",J(n,r)),ve(e,t,">",Z(n,r))}else t.insertMode||(t.lastHPos=e.getCursor().ch)}(e,t);t.visualMode&&je(e)}function je(e){var t=e.state.vim,r=K(e,X(t.sel.head)),n=V(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function Ke(e){this.keyName=e}function Ue(e){var t=z.macroModeState.lastInsertModeChanges,r=Ge.keyName(e);r&&(-1==r.indexOf("Delete")&&-1==r.indexOf("Backspace")||Ge.lookupKey(r,"vim-insert",function(){return t.maybeReset&&(t.changes=[],t.maybeReset=!1),t.changes.push(new Ke(r)),!0}))}function Ve(r,n,e,t){var i=z.macroModeState;i.isPlaying=!0;var o=!!n.lastEditActionCommand,a=n.inputState;function s(){o?F.processAction(r,n,n.lastEditActionCommand):F.evalInput(r,n)}function l(e){if(0<i.lastInsertModeChanges.changes.length){e=n.lastEditActionCommand?e:1;var t=i.lastInsertModeChanges;$e(r,t.changes,e)}}if(n.inputState=n.lastEditInputState,o&&n.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c<e;c++)s(),l(1);else t||s(),l(e);n.inputState=a,n.insertMode&&!t&&Fe(r),i.isPlaying=!1}function $e(t,e,r){function n(e){return"string"==typeof e?Ge.commands[e](t):e(t),!0}var i,o,a=t.getCursor("head"),s=z.macroModeState.lastInsertModeChanges.inVisualBlock;if(s){var l=t.state.vim.lastSelection,c=(i=l.anchor,{line:(o=l.head).line-i.line,ch:o.line-i.line});ie(t,a,c.line+1),r=t.listSelections().length,t.setCursor(a)}for(var u=0;u<r;u++){s&&t.setCursor(V(a,u,0));for(var f=0;f<e.length;f++){var d=e[f];if(d instanceof Ke)Ge.lookupKey(d.keyName,"vim-insert",n);else if("string"==typeof d){var h=t.getCursor();t.replaceRange(d,h,h)}else{var p=t.getCursor(),m=V(p,0,d[0].length);t.replaceRange(d[0],p,m)}}}s&&t.setCursor(V(a,0,1))}return Ge.keyMap.vim={attach:i,detach:e,call:t},C("insertModeEscKeysTimeout",200,"number"),Ge.keyMap["vim-insert"]={fallthrough:["default"],attach:i,detach:e,call:t},Ge.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:i,detach:e,call:t},O(),E}()}),function(l,u,c,t,f){"use strict";var d,h,o,p=l.getElementById("CodeMirror-settings"),n=l.getElementById("CodeMirror-settings__form"),m=l.getElementById("ed_toolbar"),g=l.getElementById("content")||l.getElementById("newcontent"),r=l.getElementById("content-html"),i=l.getElementById("content-tmce"),a=null!=l.getElementById("post_ID")?l.getElementById("post_ID").value:0,v=l.getElementById("editor-expand-toggle"),y={isVisualEnabled:null!=l.getElementById("content-tmce"),isThemeOrPlugin:null!=l.getElementById("newcontent"),isActive:function(){return null!=d},isVisualActive:function(){return null!=l.getElementsByClassName("tmce-active")[0]},isGutenberg:null!=(wp.data&&wp.data.select("core/edit-post")),isGutenbergVisualActive:function(){return"visual"===wp.data.select("core/edit-post").getEditorMode()},isFullHeight:function(){return!!v&&v.checked},previousSettingsPosition:"none",settingsPosition:function(){var e,t=this;return e=m?"absolute"===m.style.position?"0px"===m.style.top?"top":"bottom":"fixed"===m.style.position?"middle":"normal":"none",u.setTimeout(function(){t.previousSettingsPosition=e},0),e},charWidth:0},b={mode:"wordpresspost",tabMode:"indent",indentWithTabs:!0,smartIndent:!1,enterMode:"keep",styleActiveLine:!0,electricChars:!1,showCursorWhenSelecting:!0,viewportMargin:10,extraKeys:{F11:function(){P()},Esc:function(){P(!0)},"Ctrl-S":function(){e()},"Cmd-S":function(){e()}}};function e(){y.isGutenberg?(Q(),wp.data.dispatch("core/editor").savePost()):(l.getElementById("save-post")||l.getElementById("publish")||l.getElementById("submit")).click()}function s(t){var r=!1;return function(){var e=arguments;r||(t.apply(this,e),r=!0,u.requestAnimationFrame(function(){u.requestAnimationFrame(function(){r=!1})}))}}function x(){for(var e=-1;e<p.children.length;e++){var t=e<0?o:p.children[e];null!=t&&(t.style.position="",t.style.top="",t.style.left="",t.style.right="",t.style.width="")}}var w=s(k);function k(e){S();var t=y.settingsPosition();if(t!==y.previousSettingsPosition||e&&"resize"===e.type)switch(R(),t){case"top":x();break;case"middle":!function(){for(var e=m.getBoundingClientRect(),t=-1;t<p.children.length;t++){var r=t<0?o:p.children[t];null!=r&&(r.style.position="fixed",r.style.top=e.bottom+"px",r.style.right=l.documentElement.getBoundingClientRect().width-e.right+"px",r.id.match(/toggle/gi)||(r.style.left=e.left+"px",r.style.width="auto"))}}();break;case"bottom":!function(){for(var e=m.getBoundingClientRect(),t=d.getWrapperElement().getBoundingClientRect(),r=-1;r<p.children.length;r++){var n=r<0?o:p.children[r];null!=n&&(n.style.position="absolute",n.style.top=-1*(t.top-e.bottom)+"px",n.style.left="",n.style.right="",n.style.width="")}}()}}var C=!!navigator.userAgent.match(/Trident/gi);function S(){if(n){var e=n.getBoundingClientRect().top,t=l.getElementById("post-status-info").getBoundingClientRect().top-e,r=u.innerHeight-e;n.style.maxHeight=Math.min(t,r)-6+"px",C&&(n.style.height=n.style.maxHeight)}}function _(){y.isFullHeight()?(d.setOption("viewportMargin",1/0),d.on("change",R),u.addEventListener("scroll",w),u.addEventListener("resize",w),u.addEventListener("resize",D),d.getWrapperElement().style.height="auto",k(),F(),u.setTimeout(function(){S(),R()},100)):(d.setOption("viewportMargin",b.viewportMargin),d.off("change",R),u.removeEventListener("scroll",w),u.removeEventListener("resize",w),u.removeEventListener("resize",D),d.getWrapperElement().style.marginTop="",n.style.maxHeight="",C&&(n.style.height=""),x(),B())}function L(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.addedNodes[0]&&r.addedNodes[0].classList.contains("CodeMirror-dialog"))for(var n=(o=r.addedNodes[0]).getElementsByTagName("button"),i=0;i<n.length;i++){n[i].classList="button button-small"}else o=void 0}}function M(e){e.target.id.match(/advanced/gi)?p.classList.contains("open-advanced")?T("open"):T("advanced"):p.classList.contains("open")?T("closed"):T("open")}function T(e){switch(e){case"open":p.classList.add("open"),p.classList.remove("open-advanced"),p.classList.remove("closed");break;case"advanced":p.classList.add("open"),p.classList.add("open-advanced"),p.classList.remove("closed");break;default:p.classList.remove("open"),p.classList.remove("open-advanced"),p.classList.add("closed")}}function A(){y.charWidth=d.defaultCharWidth()*(f.fontSize/13)}function O(e){var t=+e.target.value;switch(t=isNaN(t)?e.target.value:t,"checkbox"===e.target.type&&(t=e.target.checked),e.target.id){case"fontSize":f.fontSize=t,h.style.fontSize=t+"px",A(),d.refresh();break;case"lineHeight":f.lineHeight=t,h.style.lineHeight=t+"em",d.refresh();break;case"matchTags":f.matchTags=t,d.setOption("matchTags",t?{bothTags:!0}:null);break;case"scrollbarStyle":f.scrollbarStyle=t,d.setOption("scrollbarStyle",t?"overlay":null);break;case"foldGutter":d.setOption("gutters",t?["CodeMirror-linenumbers","CodeMirror-foldgutter"]:[]);case"tabSize":d.setOption("indentUnit",t);default:f[e.target.id]=t,d.setOption(e.target.id,t)}switch(e.target.id){case"lineNumbers":t&&f.foldGutter&&d.setOption("gutters",["CodeMirror-linenumbers","CodeMirror-foldgutter"])}}function E(){var e=t("#CodeMirror-settings__form").serializeArray();t.post(f.ajaxUrl,e,function(e){})}var N=l.getElementById("wp-content-editor-container"),I="heshFullscreen";function P(e){e=!0===e,y.isFullHeight()?N.classList.remove(I):(N.classList.contains(I)||e?N.classList.remove(I):N.classList.add(I),d.focus())}function R(){d.save(),d.getTextArea().style.height=d.getWrapperElement().getBoundingClientRect().height+"px"}function B(){d.getWrapperElement().style.height=d.getTextArea().style.height}var D=s(F);function F(){d.getWrapperElement().style.marginTop=m.offsetHeight+"px"}var z,W,q=200,H=500;function j(e){W=H+(e.pageY-z),d.getWrapperElement().style.height=Math.max(q,W)+"px"}function K(e){z=e.pageY,!0,l.addEventListener("mousemove",j),l.addEventListener("mouseup",U),e.preventDefault()}function U(e){!1,H=Math.max(q,W),l.removeEventListener("mousemove",j),d.refresh(),l.removeEventListener("mouseup",U)}function V(e){W=H=e,d.getWrapperElement().style.height=H+"px";var t=l.createElement("div");t.className="hesh-content-resize-handle",t.id="content-resize-handle",d.getWrapperElement().appendChild(t),l.getElementById("content-resize-handle").addEventListener("mousedown",K)}function $(){var e=(function(e){var t=("; "+l.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}("hesh_plugin_selection_state")||"0,0,0,0,0,0,0").split(",");a===e[0]&&(d.doc.setSelection({line:+e[1],ch:+e[2]},{line:+e[3],ch:+e[4]},{scroll:!1}),d.scrollTo(+e[5],+e[6]))}var G=s(X);function X(){var e=d.doc.listSelections()[0],t=d.getScrollInfo();l.cookie="hesh_plugin_selection_state="+a+","+e.anchor.line+","+e.anchor.ch+","+e.head.line+","+e.head.ch+","+t.left+","+t.top}function Y(){var t,r,n,e,i,o,a=d.doc.listSelections()[0];t=r=n=0,d.doc.eachLine(function(e){n<=a.head.line-1&&(t+=e.text.length+1),n<=a.anchor.line-1&&(r+=e.text.length+1),n++}),t+=a.head.ch,r+=a.anchor.ch,d.getTextArea().setSelectionRange(Math.min(r,t),Math.max(r,t)),d.getTextArea().focus(),e=d.getTextArea().value.length,i=u.setInterval(function(){e!==d.getTextArea().value.length&&(u.clearInterval(i),function(){var e=d.getTextArea().selectionStart,t=d.getTextArea().selectionEnd,r=d.getScrollInfo(),n={top:u.pageYOffset,left:u.pageXOffset};d.doc.setValue(d.getTextArea().value),d.focus();var i=0,o=0,a=0,s=e,l=t,c=d.getLineHandle(a).text.length+1;for(;c<=s&&c<=l;)a++,c<=s&&(s-=c,i=a),c<=l&&(l-=c,o=a),c=d.getLineHandle(a).text.length+1;d.doc.setSelection({line:i,ch:s},{line:o,ch:l},{scroll:!1}),u.scrollTo(n.left,n.top),d.scrollTo(r.left,r.top),d.save()}())},10),o=function(){u.clearInterval(i),d.off("focus",o)},d.on("focus",o)}function Q(){d.save(),X(),wp.data.dispatch("core/editor").resetBlocks(wp.blocks.parse(d.getTextArea().value)),d.setValue(wp.data.select("core/editor").getEditedPostContent()),$()}function J(){if(!y.isActive()&&(y.isGutenberg&&(g=l.getElementsByClassName("editor-post-text-editor")[0]),null!=g)){var e,t,r,n,i,o,a,s;if(b.theme=f.theme,b.lineNumbers=!!f.lineNumbers,b.foldGutter=!!f.foldGutter,b.gutters=b.foldGutter?["CodeMirror-linenumbers","CodeMirror-foldgutter"]:[],b.tabSize=b.indentUnit=+f.tabSize,b.lineWrapping=!!f.lineWrapping,b.matchBrackets=!!f.matchBrackets,b.autoCloseTags=!!f.autoCloseTags,b.autoCloseBrackets=!!f.autoCloseBrackets,b.highlightSelectionMatches=!!f.highlightSelectionMatches,b.matchTags=!!f.matchTags&&{bothTags:!0},b.scrollbarStyle=f.scrollbarStyle?"overlay":null,b.keyMap=f.keyMap,b.autofocus=l.getElementById("title")&&!!l.getElementById("title").value&&0<l.getElementById("title").value.length,y.isThemeOrPlugin&&(e=l.querySelector(".fileedit-sub .alignleft").textContent.match(/\.[a-z\d]{2,}/gi),t=e[e.length-1].match(/[a-z]*/gi)[1],b.mode={php:"php",css:"css",xml:"xml",html:"htmlmixed",js:"javascript",json:"javascript"}[t]),d=c.fromTextArea(g,b),h=d.getWrapperElement().querySelector(".CodeMirror-code"),g.classList.add("CodeMirror-mirrored"),y.isGutenberg?d.on("blur",Q):d.on("change",function(){d.save()}),$(),d.on("cursorActivity",G),d.on("scroll",G),y.isThemeOrPlugin)V(u.innerHeight-d.getWrapperElement().getBoundingClientRect().top-100);else if(y.isGutenberg){V(u.innerHeight-d.getWrapperElement().getBoundingClientRect().top-16)}else m.addEventListener("mousedown",Y),r=u.send_to_editor,u.send_to_editor=function(e){y.isActive()&&"content"===u.wpActiveEditor?(d.replaceSelection(e),d.save()):r(e)},l.getElementById("content-resize-handle").addEventListener("mousedown",function(){l.addEventListener("mousemove",B)}),l.addEventListener("mouseup",function(){l.removeEventListener("mousemove",B)}),v&&(v.addEventListener("change",_),_()),m.insertAdjacentHTML("afterbegin",'<button type="button" id="cm_content_fullscreen" class="ed_button qt-dfw" title="Full Screen"></button>'),l.getElementById("cm_content_fullscreen").onclick=P;!function(){d.getWrapperElement().appendChild(p),p.style.display="block",p.querySelector(".CodeMirror-settings__toggle").addEventListener("click",M),p.querySelector(".CodeMirror-settings__toggle-advanced").addEventListener("click",M),new MutationObserver(L).observe(d.getWrapperElement(),{childList:!0});for(var e=p.querySelectorAll(".CodeMirror-settings__option"),t=0;t<e.length;t++){var r=e[t];r.addEventListener("change",E),r.addEventListener("change",O)}}(),n=+f.fontSize,i=+f.lineHeight,h.style.fontSize=n+"px",f.fontSize=n,h.style.lineHeight=i+"em",f.lineHeight=i,A(),d.refresh(),o=".CodeMirror pre > * { text-indent: 0px; }",a=l.head||l.getElementsByTagName("head")[0],(s=l.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=o:s.appendChild(l.createTextNode(o)),a.appendChild(s),d.on("renderLine",function(e,t,r){var n=c.countColumn(t.text,null,e.getOption("tabSize"))*y.charWidth;r.style.textIndent="-"+n+"px",r.style.paddingLeft=4+n+"px"}),d.refresh()}}function Z(){y.isActive()&&(T("closed"),d.toTextArea(),d=void 0)}function ee(){if(y.isThemeOrPlugin)J();else if(y.isGutenberg){var e=y.isGutenbergVisualActive();wp.data.subscribe(function(){y.isGutenbergVisualActive()!==e&&((e=y.isGutenbergVisualActive())?Z():u.setTimeout(J,0))}),e||J()}else y.isVisualEnabled?(r.addEventListener("click",function(){u.setTimeout(J,0)}),i.addEventListener("click",Z),y.isVisualActive()||J()):(J(),l.body.className+=" visual-editor-is-disabled")}"complete"!==l.readyState?u.addEventListener?u.addEventListener("load",ee,!1):u.attachEvent&&u.attachEvent("onload",ee):ee()}(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";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),w=r||n||i,k=w&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),a=!i&&/Chrome\//.test(e),g=/Opera\//.test(e),l=/Apple Computer/.test(navigator.vendor),s=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),c=/PhantomJS/.test(e),u=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),f=/Android/.test(e),d=u||f||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=u||/Mac/.test(t),h=/\bCrOS\b/.test(e),p=/win/i.test(t),v=g&&e.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&15<=v&&(b=!(g=!1));var y=x&&(o||g&&(null==v||v<12.11)),C=m||w&&9<=k;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,L=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function T(e,t){return M(e).appendChild(t)}function O(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 A(e,t,r,n){var i=O(e,t,r,n);return i.setAttribute("role","presentation"),i}function E(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 N(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function I(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n]);return t}_=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 R=function(e){e.select()};function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function D(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function F(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||t<=s)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}u?R=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:w&&(R=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null};function W(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}z.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var q=30,H={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},K={origin:"*mouse"},U={origin:"+move"};function V(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||t<=i+a)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}var $=[""];function G(e){for(;$.length<=e;)$.push(X($)+" ");return $[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Q(){}function J(e,t){var r;return r=Object.create?Object.create(e):(Q.prototype=e,new Q),t&&D(t,r),r}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return 768<=e.charCodeAt(0)&&ne.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var n=r<t?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function se(e,t,r){var n=this;this.input=r,n.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=A("div",null,"CodeMirror-code"),n.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=O("div",null,"CodeMirror-cursors"),n.measure=O("div",null,"CodeMirror-measure"),n.lineMeasure=O("div",null,"CodeMirror-measure"),n.lineSpace=A("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var i=A("div",[n.lineSpace],"CodeMirror-lines");n.mover=O("div",[i],null,"position: relative"),n.sizer=O("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=O("div",null,null,"position: absolute; height: "+q+"px; width: 1px;"),n.gutters=O("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=O("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=O("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),w&&k<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),b||m&&d||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function le(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 ce(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function ue(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function fe(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function de(e){if(null==e.parent)return null;for(var t=e.parent,r=W(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function he(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 s=e.lines[a].height;if(t<s)break;t-=s}return r+a}function pe(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,r){if(void 0===r&&(r=null),!(this instanceof ge))return new ge(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return ge(e.line,e.ch)}function xe(e,t){return ve(e,t)<0?t:e}function we(e,t){return ve(e,t)<0?e:t}function ke(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return ge(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?ge(o,le(e,o).text.length):(n=le(e,(r=t).line).text.length,null==(i=r.ch)||n<i?ge(r.line,n):i<0?ge(r.line,0):r)}function Se(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Ce(e,t[n]);return r}var _e=!1,Le=!1;function Me(e,t,r){this.marker=e,this.from=t,this.to=r}function Te(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ae(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Oe(e,t){if(t.full)return null;var r=pe(e,t.from.line)&&le(e,t.from.line).markedSpans,n=pe(e,t.to.line)&&le(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==ve(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||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 Me(a,o.from,s?null:o.to))}}return n}(r,i,a),l=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||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 Me(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,u=X(t.text).length+(c?i:0);if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null==d.to){var h=Te(l,d.marker);h?c&&(d.to=null==h.to?null:h.to+u):d.to=i}}if(l)for(var p=0;p<l.length;++p){var m=l[p];if(null!=m.to&&(m.to+=u),null==m.from)Te(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m));else m.from+=u,c&&(s||(s=[])).push(m)}s&&(s=Ee(s)),l&&l!=s&&(l=Ee(l));var g=[s];if(!c){var v,y=t.text.length-2;if(0<y&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Me(s[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function Ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ne(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Ie(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Pe(e){return e.inclusiveLeft?-1:0}function Re(e){return e.inclusiveRight?1:0}function Be(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ve(n.from,i.from)||Pe(e)-Pe(t);if(o)return-o;var a=ve(n.to,i.to)||Re(e)-Re(t);return a||t.id-e.id}function De(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Be(r,i.marker)<0)&&(r=i.marker);return r}function Fe(e){return De(e,!0)}function ze(e){return De(e,!1)}function We(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Be(r,o.marker)<0)&&(r=o.marker)}return r}function qe(e,t,r,n,i){var o=le(e,t),a=Le&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ve(c.from,r)||Pe(l.marker)-Pe(i),f=ve(c.to,n)||Re(l.marker)-Re(i);if(!(0<=u&&f<=0||u<=0&&0<=f)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?0<=ve(c.to,r):0<ve(c.to,r))||0<=u&&(l.marker.inclusiveRight&&i.inclusiveLeft?ve(c.from,n)<=0:ve(c.from,n)<0)))return!0}}}function He(e){for(var t;t=Fe(e);)e=t.find(-1,!0).line;return e}function je(e,t){var r=le(e,t),n=He(r);return r==n?t:de(n)}function Ke(e,t){if(t>e.lastLine())return t;var r,n=le(e,t);if(!Ue(e,n))return t;for(;r=ze(n);)n=r.find(1,!0).line;return de(n)+1}function Ue(e,t){var r=Le&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).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,Te(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]).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 $e(e){for(var t=0,r=(e=He(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;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==r)break;t+=s.height}return t}function Ge(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Fe(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ze(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Xe(e){var r=e.display,t=e.doc;r.maxLine=le(t,t.first),r.maxLineLength=Ge(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=Ge(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var Ye=null;function Qe(e,t,r){var n;Ye=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:Ye=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Ye=i)}return null!=n?n:Ye}var Je=function(){var D="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",F="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var z=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,W=/[stwN]/,q=/[LRr]/,H=/[Lb1n]/,j=/[1n]/;function K(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!z.test(e))return!1;for(var n,i=e.length,o=[],a=0;a<i;++a)o.push((n=e.charCodeAt(a))<=247?D.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?F.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var s=0,l=r;s<i;++s){var c=o[s];"m"==c?o[s]=l:l=c}for(var u=0,f=r;u<i;++u){var d=o[u];"1"==d&&"r"==f?o[u]="n":q.test(d)&&"r"==(f=d)&&(o[u]="R")}for(var h=1,p=o[0];h<i-1;++h){var m=o[h];"+"==m&&"1"==p&&"1"==o[h+1]?o[h]="1":","!=m||p!=o[h+1]||"1"!=p&&"n"!=p||(o[h]=p),p=m}for(var g=0;g<i;++g){var v=o[g];if(","==v)o[g]="N";else if("%"==v){var y=void 0;for(y=g+1;y<i&&"%"==o[y];++y);for(var b=g&&"!"==o[g-1]||y<i&&"1"==o[y]?"1":"N",x=g;x<y;++x)o[x]=b;g=y-1}}for(var w=0,k=r;w<i;++w){var C=o[w];"L"==k&&"1"==C?o[w]="L":q.test(C)&&(k=C)}for(var S=0;S<i;++S)if(W.test(o[S])){var _=void 0;for(_=S+1;_<i&&W.test(o[_]);++_);for(var L="L"==(S?o[S-1]:r),M=L==("L"==(_<i?o[_]:r))?L?"L":"R":r,T=S;T<_;++T)o[T]=M;S=_-1}for(var A,O=[],E=0;E<i;)if(H.test(o[E])){var N=E;for(++E;E<i&&H.test(o[E]);++E);O.push(new K(0,N,E))}else{var I=E,P=O.length;for(++E;E<i&&"L"!=o[E];++E);for(var R=I;R<E;)if(j.test(o[R])){I<R&&O.splice(P,0,new K(1,I,R));var B=R;for(++R;R<E&&j.test(o[R]);++R);O.splice(P,0,new K(2,B,R)),I=R}else++R;I<E&&O.splice(P,0,new K(1,I,E))}return"ltr"==t&&(1==O[0].level&&(A=e.match(/^\s+/))&&(O[0].from=A[0].length,O.unshift(new K(0,0,A[0].length))),1==X(O).level&&(A=e.match(/\s+$/))&&(X(O).to-=A[0].length,O.push(new K(0,i-A[0].length,i)))),"rtl"==t?O.reverse():O}}();function Ze(e,t){var r=e.order;return null==r&&(r=e.order=Je(e.text,t)),r}var et=[],tt=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]||et).concat(r)}};function rt(e,t){return e._handlers&&e._handlers[t]||et}function nt(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=W(i,r);-1<o&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function it(e,t){var r=rt(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 ot(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),it(e,r||t.type,e,t),ft(t)||t.codemirrorIgnore}function at(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)-1==W(r,t[n])&&r.push(t[n])}function st(e,t){return 0<rt(e,t).length}function lt(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function ct(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ft(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function dt(e){ct(e),ut(e)}function ht(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),x&&e.ctrlKey&&1==t&&(t=3),t}var mt,gt,vt=function(){if(w&&k<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==mt){var t=O("span","");T(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&2<t.offsetHeight&&!(w&&k<8))}var r=mt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function bt(e){if(null!=gt)return gt;var t=T(e,document.createTextNode("AخA")),r=_(t,0,1).getBoundingClientRect(),n=_(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(gt=n.right-r.right<3)}var xt,wt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(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/)},kt=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)},Ct="oncopy"in(xt=O("div"))||(xt.setAttribute("oncopy","return;"),"function"==typeof xt.oncopy),St=null;var _t={},Lt={};function Mt(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Tt(e,t){t=Mt(t);var r=_t[t.name];if(!r)return Tt(e,"text/plain");var n=r(e,t);if(At.hasOwnProperty(t.name)){var i=At[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var At={};function Ot(e,t){D(t,At.hasOwnProperty(e)?At[e]:At[e]={})}function Et(e,t){if(!0===t)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 Nt(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 It(e,t,r){return!e.startState||e.startState(t,r)}var Pt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.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},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.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)},Pt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(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!1!==t&&(this.pos+=e.length),!0},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Rt=function(e,t){this.state=e,this.lookAhead=t},Bt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function Dt(t,r,n,e){var l=[t.state.modeGen],i={};Vt(t,r.text,t.doc.mode,n,function(e,t){return l.push(e,t)},i,e);for(var c=n.state,o=function(e){n.baseTokens=l;var o=t.state.overlays[e],a=1,s=0;n.state=!0,Vt(t,r.text,o.mode,n,function(e,t){for(var r=a;s<e;){var n=l[a];e<n&&l.splice(a,1,e,l[a+1],n),a+=2,s=Math.min(e,n)}if(t)if(o.opaque)l.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var i=l[r+1];l[r+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=c,n.baseTokens=null,n.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:l,classes:i.bgClass||i.textClass?i:null}}function Ft(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=zt(e,de(t)),i=t.text.length>e.options.maxHighlightLength&&Et(e.doc.mode,n.state),o=Dt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function zt(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new Bt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;a<s;--s){if(s<=o.first)return o.first;var l=le(o,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof Rt?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,e.options.tabSize);(null==i||u<n)&&(i=s-1,n=u)}return i}(r,n,e),a=o>t.first&&le(t,o-1).stateAfter,s=a?Bt.fromSaved(t,a,o):new Bt(t,It(t.mode),o);return t.iter(o,n,function(e){Wt(r,e.text,s);var t=s.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?s.save():null,s.nextLine()}),e&&(t.modeFrontier=s.line),s}function Wt(e,t,r,n){var i=e.doc.mode,o=new Pt(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&qt(i,r.state);!o.eol();)Ht(i,o,r.state),o.start=o.pos}function qt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Nt(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Ht(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Nt(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.")}Bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Bt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Bt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},Bt.fromSaved=function(e,t,r){return t instanceof Rt?new Bt(e,Et(e.mode,t.state),r,t.lookAhead):new Bt(e,Et(e.mode,t),r)},Bt.prototype.save=function(e){var t=!1!==e?Et(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new Rt(t,this.maxLookAhead):t};var jt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Kt(e,t,r,n){var i,o,a=e.doc,s=a.mode,l=le(a,(t=Ce(a,t)).line),c=zt(e,t.line,r),u=new Pt(l.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Ht(s,u,c.state),n&&o.push(new jt(u,i,Et(a.mode,c.state)));return n?o:new jt(u,i,c.state)}function Ut(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 Vt(e,t,r,n,i,o,a){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,f=new Pt(t,e.options.tabSize,n),d=e.options.addModeClass&&[null];for(""==t&&Ut(qt(r,n.state),o);!f.eol();){if(l=f.pos>e.options.maxHighlightLength?(s=!1,a&&Wt(e,t,n,f.pos),f.pos=t.length,null):Ut(Ht(r,f,n.state,d),o),d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=l}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}var $t=function(e,t,r){this.text=e,Ie(this,t),this.height=r?r(this):1};$t.prototype.lineNo=function(){return de(this)},lt($t);var Gt={},Xt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Xt:Gt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var r=A("span",null,null,b?"padding-right: .1px":null),n={pre:A("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=Zt,bt(e.display.measure)&&(a=Ze(o,e.doc.direction))&&(n.addToken=er(n.addToken,a)),n.map=[],rr(o,n,Ft(e,o,t!=e.display.externalMeasured&&de(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(yt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function Jt(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,r,n,i,o,a){if(t){var s,l=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.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}(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1;if(c.test(t)){s=document.createDocumentFragment();for(var f=0;;){c.lastIndex=f;var d=c.exec(t),h=d?d.index-f:t.length-f;if(h){var p=document.createTextNode(l.slice(f,f+h));w&&k<9?s.appendChild(O("span",[p])):s.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!d)break;f+=h+1;var m=void 0;if("\t"==d[0]){var g=e.cm.options.tabSize,v=g-e.col%g;(m=s.appendChild(O("span",G(v),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=v}else"\r"==d[0]||"\n"==d[0]?(m=s.appendChild(O("span","\r"==d[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",d[0]):((m=e.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),w&&k<9?s.appendChild(O("span",[m])):s.appendChild(m)),e.col+=1;e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,s=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,s),w&&k<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==l.charCodeAt(t.length-1),r||n||i||u||o){var y=r||"";n&&(y+=n),i&&(y+=i);var b=O("span",[s],y,o);if(a)for(var x in a)a.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&b.setAttribute(x,a[x]);return e.content.appendChild(b)}e.content.appendChild(s)}}function er(f,d){return function(e,t,r,n,i,o,a){r=r?r+" cm-force-border":"cm-force-border";for(var s=e.pos,l=s+t.length;;){for(var c=void 0,u=0;u<d.length&&!((c=d[u]).to>s&&c.from<=s);u++);if(c.to>=l)return f(e,t,r,n,i,o,a);f(e,t.slice(0,c.to-s),r,n,null,o,a),n=null,t=t.slice(c.to-s),s=c.to}}}function tr(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 rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,s,l,c,u,f,d,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",f=d=null,v=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var w=n[x],k=w.marker;if("bookmark"==k.type&&w.from==p&&k.widgetNode)y.push(k);else if(w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&((d||(d={})).title=k.title),k.attributes)for(var C in k.attributes)(d||(d={}))[C]=k.attributes[C];k.collapsed&&(!f||Be(f.marker,k)<0)&&(f=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!f||f.from==p)for(var _=0;_<y.length;++_)tr(t,0,y[_]);if(f&&(f.from||0)==p){if(tr(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(h<=p)break;for(var L=Math.min(h,v);;){if(g){var M=p+g.length;if(!f){var T=L<M?g.slice(0,L-p):g;t.addToken(t,T,a?a+l:l,u,p+T.length==v?c:"",s,d)}if(L<=M){g=g.slice(L-p),p=L;break}p=M,u=""}g=i.slice(o,o=r[m++]),a=Yt(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),Yt(r[A+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=ze(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?de(X(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ue(e,t)}function ir(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new nr(e.doc,le(e.doc,o),o);n=o+a.size,i.push(a)}return i}var or=null;var ar=null;function sr(e,t){var r=rt(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(lr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function lr(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?dr(e,t):"gutter"==o?pr(e,t,r,n):"class"==o?hr(e,t):"widget"==o&&mr(e,t,n)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),w&&k<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Qt(e,t)}function dr(e,t){var r=t.text.className,n=fr(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,hr(e,t)):r&&(t.text.className=r)}function hr(e,t){!function(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 n=ur(t);t.background=n.insertBefore(O("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(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 pr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ur(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=ur(t),s=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(O("div",me(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var c=e.options.gutters[l],u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(O("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function mr(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);gr(e,t,r)}function gr(e,t,r){if(vr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)vr(e,t.rest[n],t,r,!1)}function vr(e,t,r,n,i){if(t.widgets)for(var o=ur(r),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=O("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),yr(l,c,r,n),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),sr(l,"redraw")}}function yr(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 br(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,O("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function xr(e,t){for(var r=ht(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 wr(e){return e.lineSpace.offsetTop}function kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Cr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,O("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Sr(e){return q-e.display.nativeBarWidth}function _r(e){return e.display.scroller.clientWidth-Sr(e)-e.display.barWidth}function Lr(e){return e.display.scroller.clientHeight-Sr(e)-e.display.barHeight}function Mr(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(de(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Tr(e,t,r,n){return Er(e,Or(e,t),r,n)}function Ar(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[sn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Or(e,t){var r=de(t),n=Ar(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,tn(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=de(t=He(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var i=n.built=Qt(e,n);return n.text=i.pre,T(e.display.lineMeasure,i.pre),n}(e,t));var i=Mr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Er(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||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&_r(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(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];2<Math.abs(l.bottom-c.bottom)&&o.push((l.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Pr(t.map,r,n),a=o.node,s=o.start,l=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;s&&ie(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+l));)++l;if((i=w&&k<9&&0==s&&l==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Rr(_(a,s,l).getClientRects(),n)).left||i.right||0==s)break;l=s,s-=1,c="right"}w&&k<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=St)return St;var t=T(e,O("span","x")),r=t.getBoundingClientRect(),n=_(t,0,1).getBoundingClientRect();return St=1<Math.abs(r.left-n.left)}(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}}(e.display.measure,i))}else{var f;0<s&&(c=n="right"),i=e.options.lineWrapping&&1<(f=a.getClientRects()).length?f["right"==n?f.length-1:0]:a.getBoundingClientRect()}if(w&&k<9&&!s&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+en(e.display),top:d.top,bottom:d.bottom}:Ir}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};i.left||i.right||(x.bogus=!0);e.options.singleCursorHeightPerLine||(x.rtop=h,x.rbottom=p);return x}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Nr,Ir={left:0,right:0,top:0,bottom:0};function Pr(e,t,r){for(var n,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=(i=t-s)+1:(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,l<=t&&(a="right")),null!=i){if(n=e[c+2],s==l&&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==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function Rr(e,t){var r=Ir;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;0<=i&&(r=e[i]).left==r.right;i--);return r}function Br(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 Dr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Br(e.display.view[t])}function Fr(e){Dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function zr(){return a&&f?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Wr(){return a&&f?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function Hr(e,t,r,n,i){if(!i){var o=qr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=$e(t);if("local"==n?a+=wr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==n?0:Wr());var l=s.left+("window"==n?0:zr());r.left+=l,r.right+=l}return r.top+=a,r.bottom+=a,r}function jr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=zr(),i-=Wr();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 Kr(e,t,r,n,i){return n||(n=le(e.doc,t.line)),Hr(e,n,Tr(e,n,t.ch,i),r)}function Ur(n,e,i,o,a,s){function l(e,t){var r=Er(n,a,e,t?"right":"left",s);return t?r.left=r.right:r.right=r.left,Hr(n,o,r,i)}o=o||le(n.doc,e.line),a||(a=Or(n,o));var c=Ze(o,n.doc.direction),t=e.ch,r=e.sticky;if(t>=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!c)return l("before"==r?t-1:t,"before"==r);function u(e,t,r){return l(r?e-1:e,1==c[t].level!=r)}var f=Qe(c,t,r),d=Ye,h=u(t,f,"before"==r);return null!=d&&(h.other=u(t,d,"before"!=r)),h}function Vr(e,t){var r=0;t=Ce(e.doc,t),e.options.lineWrapping||(r=en(e.display)*t.ch);var n=le(e.doc,t.line),i=$e(n)+wr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function $r(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function Gr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return $r(n.first,0,null,!0,-1);var i=he(n,r),o=n.first+n.size-1;if(o<i)return $r(n.first+n.size-1,le(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=le(n,i);;){var s=Jr(e,a,i,t,r),l=We(a,s.ch+(0<s.xRel?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=le(n,i=c.line)}}function Xr(t,e,r,n){n-=qr(e);var i=e.text.length,o=ae(function(e){return Er(t,r,e-1).bottom<=n},i,0);return{begin:o,end:i=ae(function(e){return Er(t,r,e).top>n},o,i)}}function Yr(e,t,r,n){return r||(r=Or(e,t)),Xr(e,t,r,Hr(e,t,Er(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(r,e,t,n,i){i-=$e(e);var o=Or(r,e),a=qr(e),s=0,l=e.text.length,c=!0,u=Ze(e,r.doc.direction);if(u){var f=(r.options.lineWrapping?function(e,t,r,n,i,o,a){var s=Xr(e,t,n,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=c||h.to<=l)){var p=1!=h.level,m=Er(e,n,p?Math.min(c,h.to)-1:Math.max(l,h.from)).right,g=m<o?o-m+1e9:m-o;(!u||g<f)&&(u=h,f=g)}}u||(u=i[i.length-1]);u.from<l&&(u={from:l,to:u.to,level:u.level});u.to>c&&(u={from:u.from,to:c,level:u.level});return u}:function(n,i,o,a,s,l,c){var e=ae(function(e){var t=s[e],r=1!=t.level;return Qr(Ur(n,ge(o,r?t.to:t.from,r?"before":"after"),"line",i,a),l,c,!0)},0,s.length-1),t=s[e];if(0<e){var r=1!=t.level,u=Ur(n,ge(o,r?t.from:t.to,r?"after":"before"),"line",i,a);Qr(u,l,c,!0)&&u.top>c&&(t=s[e-1])}return t})(r,e,t,o,u,n,i);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var d,h,p=null,m=null,g=ae(function(e){var t=Er(r,o,e);return t.top+=a,t.bottom+=a,!!Qr(t,n,i,!1)&&(t.top<=i&&t.left<=n&&(p=e,m=t),!0)},s,l),v=!1;if(m){var y=n-m.left<m.right-n,b=y==c;g=p+(b?0:1),h=b?"after":"before",d=y?m.left:m.right}else{c||g!=l&&g!=s||g++,h=0==g?"after":g==e.text.length?"before":Er(r,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var x=Ur(r,ge(t,g,h),"line",e,o);d=x.left,v=i<x.top||i>=x.bottom}return $r(t,g=oe(e.text,g,1),h,v,n-d)}function Zr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Nr){Nr=O("pre");for(var t=0;t<49;++t)Nr.appendChild(document.createTextNode("x")),Nr.appendChild(O("br"));Nr.appendChild(document.createTextNode("x"))}T(e.measure,Nr);var r=Nr.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),M(e.measure),r||1}function en(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),r=O("pre",[t]);T(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function tn(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:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function nn(n){var i=Zr(n.display),o=n.options.lineWrapping,a=o&&Math.max(5,n.display.scroller.clientWidth/en(n.display)-3);return function(e){if(Ue(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function on(e){var t=e.doc,r=nn(e);t.iter(function(e){var t=r(e);t!=e.height&&fe(e,t)})}function an(e,t,r,n){var i=e.display;if(!r&&"true"==ht(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=Gr(e,o,a);if(n&&1==c.xRel&&(l=le(e.doc,c.line).text).length==c.ch){var u=F(l,l.length,e.options.tabSize)-l.length;c=ge(c.line,Math.max(0,Math.round((o-Cr(e.display).left)/en(e.display))-u))}return c}function sn(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 ln(e){e.display.input.showSelection(e.display.input.prepareSelection())}function cn(e,t){void 0===t&&(t=!0);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||a!=r.sel.primIndex){var s=r.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&un(e,s.head,i),l||dn(e,s,o)}}return n}function un(e,t,r){var n=Ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function fn(e,t){return e.top-t.top||e.left-t.left}function dn(a,e,t){var r=a.display,n=a.doc,i=document.createDocumentFragment(),o=Cr(a.display),L=o.left,M=Math.max(r.sizerWidth,_r(a)-r.sizer.offsetLeft)-o.right,T="ltr"==n.direction;function A(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?M-e:r)+"px;\n height: "+(n-t)+"px"))}function s(r,y,b){var x,w,o=le(n,r),k=o.text.length;function C(e,t){return Kr(a,ge(r,e),"div",o,t)}function S(e,t,r){var n=Yr(a,o,null,e),i="ltr"==t==("after"==r)?"left":"right";return C("after"==r?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1),i)[i]}var _=Ze(o,n.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);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",o),i=!0)}i||n(t,r,"ltr")}(_,y||0,null==b?k:b,function(e,t,r,n){var i="ltr"==r,o=C(e,i?"left":"right"),a=C(t-1,i?"right":"left"),s=null==y&&0==e,l=null==b&&t==k,c=0==n,u=!_||n==_.length-1;if(a.top-o.top<=3){var f=(T?l:s)&&u,d=(T?s:l)&&c?L:(i?o:a).left,h=f?M:(i?a:o).right;A(d,o.top,h-d,o.bottom)}else{var p,m,g,v;v=i?(p=T&&s&&c?L:o.left,m=T?M:S(e,r,"before"),g=T?L:S(t,r,"after"),T&&l&&u?M:a.right):(p=T?S(e,r,"before"):L,m=!T&&s&&c?M:o.right,g=!T&&l&&u?L:a.left,T?S(t,r,"after"):M),A(p,o.top,m-p,o.bottom),o.bottom<a.top&&A(L,o.bottom,null,a.top),A(g,a.top,v-g,a.bottom)}(!x||fn(o,x)<0)&&(x=o),fn(a,x)<0&&(x=a),(!w||fn(o,w)<0)&&(w=o),fn(a,w)<0&&(w=a)}),{start:x,end:w}}var l=e.from(),c=e.to();if(l.line==c.line)s(l.line,l.ch,c.ch);else{var u=le(n,l.line),f=le(n,c.line),d=He(u)==He(f),h=s(l.line,l.ch,d?u.text.length+1:null).end,p=s(c.line,d?0:null,c.ch).start;d&&(h.top<p.top-2?(A(h.right,h.top,null,h.bottom),A(L,p.top,p.left,p.bottom)):A(h.right,h.top,p.left-h.right,h.bottom)),h.bottom<p.top&&A(L,h.bottom,null,p.top)}t.appendChild(i)}function hn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?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 pn(e){e.state.focused||(e.display.input.focus(),gn(e))}function mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vn(e))},100)}function gn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e))}function vn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,s=0;if(!i.hidden){if(w&&k<8){var l=i.node.offsetTop+i.node.offsetHeight;a=l-r,r=l}else{var c=i.node.getBoundingClientRect();a=c.bottom-c.top,!o&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var u=i.line.height-a;if((.005<u||u<-.005)&&(fe(i.line,a),bn(i.line),i.rest))for(var f=0;f<i.rest.length;f++)bn(i.rest[f]);if(s>e.display.sizerWidth){var d=Math.ceil(s/en(e.display));d>e.display.maxLineLength&&(e.display.maxLineLength=d,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function bn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function xn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-wr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=he(t,n),a=he(t,i);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<o?a=he(t,$e(le(t,o=s))+e.wrapper.clientHeight):Math.min(l,t.lastLine())>=a&&(o=he(t,$e(le(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function wn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rn(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 s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function kn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=me(e.options,t.first+t.size-1),n=e.display;if(r.length==n.lineNumChars)return!1;var i=n.measure.appendChild(O("div",[O("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",si(e),!0}function Cn(e,t){var r=e.display,n=Zr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Lr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+kr(r),l=t.top<n,c=t.bottom>s-n;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,d=_r(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 Sn(e,t){null!=t&&(Mn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function _n(e){Mn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ln(e,t,r){null==t&&null==r||Mn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Mn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Tn(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Tn(e,t,r,n){var i=Cn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ln(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||ai(e,{top:t}),On(e,t,!0),m&&ai(e),ti(e,100))}function On(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function En(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,wn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Nn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(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+Sr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var In=function(e,t,r){this.cm=r;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),tt(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),tt(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,w&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};In.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&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},In.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},In.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},In.prototype.zeroWidthHack=function(){var e=x&&!s?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},In.prototype.enableZeroWidthBar=function(r,n,i){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=r?r.style.pointerEvents="none":n.set(1e3,e)})},In.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Pn=function(){};function Rn(e,t){t||(t=Nn(e));var r=e.display.barWidth,n=e.display.barHeight;Bn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&yn(e),Bn(e,Nn(e)),r=e.display.barWidth,n=e.display.barHeight}function Bn(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=""}Pn.prototype.update=function(){return{bottom:0,right:0}},Pn.prototype.setScrollLeft=function(){},Pn.prototype.setScrollTop=function(){},Pn.prototype.clear=function(){};var Dn={native:In,null:Pn};function Fn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&L(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Dn[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),tt(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?En(r,e):An(r,e)},r),r.display.scrollbars.addClass&&I(r.display.wrapper,r.display.scrollbars.addClass)}var zn=0;function Wn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++zn},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function qn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(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)}(r)}finally{or=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Hn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ii(i.cm,i.update);var i;for(var o=0;o<t.length;o++)jn(t[o]);for(var a=0;a<t.length;a++)Kn(t[a]);for(var s=0;s<t.length;s++)Un(t[s])}(e)})}function Hn(e){var t,r,n=e.cm,i=n.display;!(r=(t=n).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Sr(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Sr(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Xe(n),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ni(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function jn(e){var t=e.cm,r=t.display;e.updatedDisplay&&yn(t),e.barMeasure=Nn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Tr(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+Sr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-_r(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Kn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&En(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Rn(t,e.barMeasure),e.updatedDisplay&&li(t,e.barMeasure),e.selectionChanged&&hn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&pn(e.cm)}function Un(e){var t=e.cm,r=t.display,n=t.doc;(e.updatedDisplay&&oi(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&On(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&En(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!ot(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=O("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-wr(e.display))+"px;\n height: "+(t.bottom-t.top+Sr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Ur(e,t),l=r&&r!=t?Ur(e,r):s,c=Cn(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(An(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(En(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-f)&&(a=!0)),!a)break}return i}(t,Ce(n,e.scrollToPos.from),Ce(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||it(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&it(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&it(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Vn(e,t){if(e.curOp)return t();Wn(e);try{return t()}finally{qn(e)}}function $n(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Wn(e);try{return t.apply(e,arguments)}finally{qn(e)}}}function Gn(e){return function(){if(this.curOp)return e.apply(this,arguments);Wn(this);try{return e.apply(this,arguments)}finally{qn(this)}}}function Xn(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Wn(e);try{return t.apply(this,arguments)}finally{qn(e)}}}function Yn(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)Le&&je(e.doc,t)<i.viewTo&&Jn(e);else if(r<=i.viewFrom)Le&&Ke(e.doc,r+n)>i.viewFrom?Jn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Jn(e);else if(t<=i.viewFrom){var o=Zn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Jn(e)}else if(r>=i.viewTo){var a=Zn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jn(e)}else{var s=Zn(e,t,t,-1),l=Zn(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(ir(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):Jn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function Qn(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[sn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==W(a,r)&&a.push(r)}}}function Jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zn(e,t,r,n){var i,o=sn(e,t),a=e.display.view;if(!Le||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(0<n){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;je(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 ei(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 ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(ri,e))}function ri(l){var c=l.doc;if(!(c.highlightFrontier>=l.display.viewTo)){var u=+new Date+l.options.workTime,f=zt(l,c.highlightFrontier),d=[];c.iter(f.line,Math.min(c.first+c.size,l.display.viewTo+500),function(e){if(f.line>=l.display.viewFrom){var t=e.styles,r=e.text.length>l.options.maxHighlightLength?Et(c.mode,f.state):null,n=Dt(l,e,f,!0);r&&(f.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var a=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),s=0;!a&&s<t.length;++s)a=t[s]!=e.styles[s];a&&d.push(f.line),e.stateAfter=f.save(),f.nextLine()}else e.text.length<=l.options.maxHighlightLength&&Wt(l,e.text,f),e.stateAfter=f.line%5==0?f.save():null,f.nextLine();if(+new Date>u)return ti(l,l.options.workDelay),!0}),c.highlightFrontier=f.line,c.modeFrontier=Math.max(c.modeFrontier,f.line),d.length&&Vn(l,function(){for(var e=0;e<d.length;e++)Qn(l,d[e],"text")})}}var ni=function(e,t,r){var n=e.display;this.viewport=t,this.visible=xn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=_r(e),this.force=r,this.dims=tn(e),this.events=[]};function ii(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==ei(e))return!1;kn(e)&&(Jn(e),t.dims=tn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Le&&(o=je(e.doc,o),a=Ke(e.doc,a));var s,l,c,u,f=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;l=o,c=a,0==(u=(s=e).display).view.length||l>=u.viewTo||c<=u.viewFrom?(u.view=ir(s,l,c),u.viewFrom=l):(u.viewFrom>l?u.view=ir(s,l,u.viewFrom).concat(u.view):u.viewFrom<l&&(u.view=u.view.slice(sn(s,l))),u.viewFrom=l,u.viewTo<c?u.view=u.view.concat(ir(s,u.viewTo,c)):u.viewTo>c&&(u.view=u.view.slice(0,sn(s,c)))),u.viewTo=c,r.viewOffset=$e(le(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var d=ei(e);if(!f&&0==d&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var h=function(e){if(e.hasFocus())return null;var t=N();if(!t||!E(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&E(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4<d&&(r.lineDiv.style.display="none"),function(r,e,t){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function s(e){var t=e.nextSibling;return b&&x&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var l=n.view,c=n.viewFrom,u=0;u<l.length;u++){var f=l[u];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var d=i&&null!=e&&e<=c&&f.lineNumber;f.changes&&(-1<W(f.changes,"gutter")&&(d=!1),cr(r,f,c,t)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(me(r.options,c)))),a=f.node.nextSibling}else{var h=(g=c,v=t,void 0,y=fr(p=r,m=f),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),hr(p,m),pr(p,m,g,v),gr(p,m,v),m.node);o.insertBefore(h,a)}c+=f.size}var p,m,g,v,y;for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),4<d&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=N()&&(e.activeElt.focus(),e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(h),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,f&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ti(e,400)),!(r.updateLineNumbers=null)}function oi(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=_r(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Lr(e),r.top)}),t.visible=xn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ii(e,t);n=!1){yn(e);var i=Nn(e);ln(e),Rn(e,i),li(e,i),t.force=!1}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 ai(e,t){var r=new ni(e,t);if(ii(e,r)){yn(e),oi(e,r);var n=Nn(e);ln(e),Rn(e,n),li(e,n),r.finish()}}function si(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function li(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+Sr(e)+"px"}function ci(e){var t=e.display.gutters,r=e.options.gutters;M(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(O("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",si(e)}function ui(e){var t=W(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ni.prototype.signal=function(e,t){st(e,t)&&this.events.push(arguments)},ni.prototype.finish=function(){for(var e=0;e<this.events.length;e++)it.apply(null,this.events[e])};var fi=0,di=null;function hi(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 pi(e){var t=hi(e);return t.x*=di,t.y*=di,t}function mi(e,t){var r=hi(t),n=r.x,i=r.y,o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(n&&s||i&&l){if(i&&x&&b)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&&!m&&!g&&null!=di)return i&&l&&An(e,Math.max(0,a.scrollTop+i*di)),En(e,Math.max(0,a.scrollLeft+n*di)),(!i||i&&l)&&ct(t),void(o.wheelStartX=null);if(i&&null!=di){var d=i*di,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),ai(e,{top:h,bottom:p})}fi<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&&(di=(di*fi+r)/(fi+1),++fi)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}w?di=-.53:m?di=15:a?di=-.7:l&&(di=-1/3);var gi=function(e,t){this.ranges=e,this.primIndex=t};gi.prototype.primary=function(){return this.ranges[this.primIndex]},gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!ye(r.anchor,n.anchor)||!ye(r.head,n.head))return!1}return!0},gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new vi(be(this.ranges[t].anchor),be(this.ranges[t].head));return new gi(e,this.primIndex)},gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},gi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=ve(t,n.from())&&ve(e,n.to())<=0)return r}return-1};var vi=function(e,t){this.anchor=e,this.head=t};function yi(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ve(e.from(),t.from())}),r=W(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=ve(s.to(),a.from());if(n&&!a.empty()?0<l:0<=l){var c=we(s.from(),a.from()),u=xe(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new vi(f?u:c,f?c:u))}}return new gi(t,r)}function bi(e,t){return new gi([new vi(e,t||e)],0)}function xi(e){return e.text?ge(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function wi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return xi(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+=xi(t).ch-t.to.ch),ge(r,n)}function ki(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new vi(wi(i.anchor,t),wi(i.head,t)))}return yi(e.cm,r,e.sel.primIndex)}function Ci(e,t,r){return e.line==t.line?ge(r.line,e.ch-t.ch+r.ch):ge(r.line+(e.line-t.line),e.ch)}function Si(e){e.doc.mode=Tt(e.options,e.doc.modeOption),_i(e)}function _i(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&Yn(e)}function Li(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ne(e),Ie(e,r);var i=n?n(e):1;i!=e.height&&fe(e,i)}(e,t,r,i),sr(e,"change",e,n)}function a(e,t){for(var r=[],n=e;n<t;++n)r.push(new $t(c[n],o(n),i));return r}var s=n.from,l=n.to,c=n.text,u=le(e,s.line),f=le(e,l.line),d=X(c),h=o(c.length-1),p=l.line-s.line;if(n.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Li(e,n)){var m=a(0,c.length-1);r(f,f.text,h),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(u==f)if(1==c.length)r(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),h);else{var g=a(1,c.length-1);g.push(new $t(d+u.text.slice(l.ch),h,i)),r(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,g)}else if(1==c.length)r(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),o(0)),e.remove(s.line+1,p);else{r(u,u.text.slice(0,s.ch)+c[0],o(0)),r(f,d+f.text.slice(l.ch),h);var v=a(1,c.length-1);1<p&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}sr(e,"change",e,n)}function Ti(e,s,l){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var a=n&&o.sharedHist;l&&!a||(s(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function Ai(e,t){if(t.cm)throw new Error("This document is already in use.");on((e.doc=t).cm=e),Si(e),Oi(e),e.options.lineWrapping||Xe(e),e.options.mode=t.modeOption,Yn(e)}function Oi(e){("rtl"==e.doc.direction?I:L)(e.display.lineDiv,"CodeMirror-rtl")}function Ei(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 Ni(e,t){var r={from:be(t.from),to:xi(t),text:ce(e,t.from,t.to)};return Di(e,r,t.from.line,t.to.line+1),Ti(e,function(e){return Di(e,r,t.from.line,t.to.line+1)},!0),r}function Ii(e){for(;e.length;){if(!X(e).ranges)break;e.pop()}}function Pi(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,s,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(s=i).lastOp==n?(Ii(s.done),X(s.done)):s.done.length&&!X(s.done).ranges?X(s.done):1<s.done.length&&!s.done[s.done.length-2].ranges?(s.done.pop(),X(s.done)):void 0))a=X(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,a.to)?a.to=xi(t):o.changes.push(Ni(e,t));else{var c=X(i.done);for(c&&c.ranges||Bi(e.sel,i.done),o={changes:[Ni(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||it(e,"historyAdded")}function Ri(e,t,r,n){var i,o,a,s,l,c=e.history,u=n&&n.origin;r==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(i=e,o=u,a=X(c.done),s=t,"*"==(l=o.charAt(0))||"+"==l&&a.ranges.length==s.ranges.length&&a.somethingSelected()==s.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:Bi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,n&&!1!==n.clearRedo&&Ii(c.undone)}function Bi(e,t){var r=X(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Di(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i||(i=r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Fi(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 zi(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Fi(r[i]));return n}(e,t),n=Oe(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 s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(r[i]=a)}return r}function Wi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?gi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];n.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&-1<W(t,Number(u[1]))&&(X(s)[f]=c[f],delete c[f])}}}return n}function qi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ve(t,i)<0;o!=ve(r,i)<0?(i=t,t=r):o!=ve(t,r)<0&&(t=r)}return new vi(i,t)}return new vi(r||t,t)}function Hi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),$i(e,new gi([qi(e.sel.primary(),t,r,i)],0),n)}function ji(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=qi(e.sel.ranges[o],t[o],null,i);$i(e,yi(e.cm,n,e.sel.primIndex),r)}function Ki(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,$i(e,yi(e.cm,i,e.sel.primIndex),n)}function Ui(e,t,r,n){$i(e,bi(t,r),n)}function Vi(e,t,r){var n=e.history.done,i=X(n);i&&i.ranges?Gi(e,n[n.length-1]=t,r):$i(e,t,r)}function $i(e,t,r){Gi(e,t,r),Ri(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Gi(e,t,r){var n,i,o,a;(st(e,"beforeSelectionChange")||e.cm&&st(e.cm,"beforeSelectionChange"))&&(n=e,o=r,a={ranges:(i=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new vi(Ce(n,e[t].anchor),Ce(n,e[t].head))},origin:o&&o.origin},it(n,"beforeSelectionChange",n,a),n.cm&&it(n.cm,"beforeSelectionChange",n.cm,a),t=a.ranges!=i.ranges?yi(n.cm,a.ranges,a.ranges.length-1):i),Xi(e,Qi(e,t,r&&r.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||_n(e.cm)}function Xi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,at(e.cm)),sr(e,"cursorActivity",e))}function Yi(e){Xi(e,Qi(e,e.sel,null,!1))}function Qi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Zi(e,a.anchor,s&&s.anchor,r,n),c=Zi(e,a.head,s&&s.head,r,n);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new vi(l,c))}return i?yi(e.cm,i,t.primIndex):t}function Ji(e,t,r,n,i){var o=le(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker;if((null==s.from||(l.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(l.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(it(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var c=l.find(n<0?1:-1),u=void 0;if((n<0?l.inclusiveRight:l.inclusiveLeft)&&(c=eo(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ve(c,r))&&(n<0?u<0:0<u))return Ji(e,c,t,n,i)}var f=l.find(n<0?-1:1);return(n<0?l.inclusiveLeft:l.inclusiveRight)&&(f=eo(e,f,n,f.line==t.line?o:null)),f?Ji(e,f,t,n,i):null}}return t}function Zi(e,t,r,n,i){var o=n||1,a=Ji(e,t,r,o,i)||!i&&Ji(e,t,r,o,!0)||Ji(e,t,r,-o,i)||!i&&Ji(e,t,r,-o,!0);return a||(e.cantEdit=!0,ge(e.first,0))}function eo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Ce(e,ge(t.line-1)):null:0<r&&t.ch==(n||le(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+r)}function to(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),j)}function ro(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=Ce(i,e)),t&&(o.to=Ce(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),it(i,"beforeChange",i,o),i.cm&&it(i.cm,"beforeChange",i.cm,o),o.canceled?(i.cm&&(i.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function no(e,t,r){if(e.cm){if(!e.cm.curOp)return $n(e.cm,no)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(st(e,"beforeChange")||e.cm&&st(e.cm,"beforeChange"))||(t=ro(e,t,!0))){var n=_e&&!r&&function(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&&-1!=W(n,r)||(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],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(ve(c.to,s.from)<0||0<ve(c.from,s.to))){var u=[l,1],f=ve(c.from,s.from),d=ve(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(0<d||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)io(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else io(e,t)}}function io(e,r){if(1!=r.text.length||""!=r.text[0]||0!=ve(r.from,r.to)){var t=ki(e,r);Pi(e,r,t,e.cm?e.cm.curOp.id:NaN),so(e,r,t,Oe(e,r));var n=[];Ti(e,function(e,t){t||-1!=W(n,e.history)||(fo(e.history,r),n.push(e.history)),so(e,r,null,Oe(e,r))})}}function oo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,r=i.history,n=i.sel,s="undo"==o?r.done:r.undone,l="undo"==o?r.undone:r.done,c=0;c<s.length&&(a=s[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=s.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(!(a=s.pop()).ranges){if(t)return void s.push(a);break}if(Bi(a,l),e&&!a.equals(i.sel))return void $i(i,a,{clearRedo:!1});n=a}var u=[];Bi(n,l),l.push({changes:u,generation:r.generation}),r.generation=a.generation||++r.maxGeneration;for(var f=st(i,"beforeChange")||i.cm&&st(i.cm,"beforeChange"),d=function(e){var r=a.changes[e];if(r.origin=o,f&&!ro(i,r,!1))return s.length=0,{};u.push(Ni(i,r));var t=e?ki(i,r):X(s);so(i,r,t,zi(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:xi(r)});var n=[];Ti(i,function(e,t){t||-1!=W(n,e.history)||(fo(e.history,r),n.push(e.history)),so(e,r,null,zi(e,r))})},h=a.changes.length-1;0<=h;--h){var p=d(h);if(p)return p.v}}}}function ao(e,t){if(0!=t&&(e.first+=t,e.sel=new gi(Y(e.sel.ranges,function(e){return new vi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Yn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Qn(e.cm,n,"gutter")}}function so(e,t,r,n){if(e.cm&&!e.cm.curOp)return $n(e.cm,so)(e,t,r,n);if(t.to.line<e.first)ao(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ao(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,le(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),r||(r=ki(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=de(He(le(n,o.line))),n.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0}));-1<n.sel.contains(t.from,t.to)&&at(e);Mi(n,t,r,nn(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,function(e){var t=Ge(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;r<n;n--){var i=le(e,n).stateAfter;if(i&&(!(i instanceof Rt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ti(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Yn(e):o.line!=a.line||1!=t.text.length||Li(e.doc,t)?Yn(e,o.line,a.line+1,c):Qn(e,o.line,"text");var u=st(e,"changes"),f=st(e,"change");if(f||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&sr(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,n):Mi(e,t,n),Gi(e,r,j)}}function lo(e,t,r,n,i){var o;n||(n=r),ve(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),no(e,{from:r,to:n,text:t,origin:i})}function co(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function uo(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()).copied=!0);for(var s=0;s<o.ranges.length;s++)co(o.ranges[s].anchor,t,r,n),co(o.ranges[s].head,t,r,n)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(r<c.from.line)c.from=ge(c.from.line+n,c.from.ch),c.to=ge(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 fo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;uo(e.done,r,n,i),uo(e.undone,r,n,i)}function ho(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=le(e,ke(e,t)):i=de(t),null==i?null:(n(o,i)&&e.cm&&Qn(e.cm,i,r),o)}function po(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function mo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}vi.prototype.from=function(){return we(this.anchor,this.head)},vi.prototype.to=function(){return xe(this.anchor,this.head)},vi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,n=e,i=e+t;n<i;++n){var o=this.lines[n];this.height-=o.height,(r=o).parent=null,Ne(r),sr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof po))){var s=[];this.collapse(s),this.children=[new po(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&50<i.lines.length){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new po(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new mo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=W(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new mo(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var go=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function vo(e,t,r){$e(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sn(e,r)}go.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=de(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=br(this);fe(r,Math.max(0,r.height-o)),e&&(Vn(e,function(){vo(e,r,-o),Qn(e,n,"widget")}),sr(e,"lineWidgetCleared",e,this,n))}},go.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=br(this)-t;i&&(Ue(this.doc,n)||fe(n,n.height+i),r&&Vn(r,function(){r.curOp.forceUpdate=!0,vo(r,n,i),sr(r,"lineWidgetChanged",r,e,de(n))}))},lt(go);var yo=0,bo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};function xo(t,n,i,e,r){if(e&&e.shared)return function(e,r,n,i,o){(i=D(i)).shared=!1;var a=[xo(e,r,n,i,o)],s=a[0],l=i.widgetNode;return Ti(e,function(e){l&&(i.widgetNode=l.cloneNode(!0)),a.push(xo(e,Ce(e,r),Ce(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;s=X(a)}),new wo(a,s)}(t,n,i,e,r);if(t.cm&&!t.cm.curOp)return $n(t.cm,xo)(t,n,i,e,r);var o=new bo(t,r),a=ve(n,i);if(e&&D(e,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(qe(t,n.line,n,i,o)||n.line!=i.line&&qe(t,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Pi(t,{from:n,to:i,origin:"markText"},t.sel,NaN);var s,l=n.line,c=t.cm;if(t.iter(l,i.line+1,function(e){var t,r;c&&o.collapsed&&!c.options.lineWrapping&&He(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=n.line&&fe(e,0),t=e,r=new Me(o,l==n.line?n.ch:null,l==i.line?i.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],r.marker.attachLine(t),++l}),o.collapsed&&t.iter(n.line,i.line+1,function(e){Ue(t,e)&&fe(e,0)}),o.clearOnEnter&&tt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(_e=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++yo,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Yn(c,n.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=n.line;u<=i.line;u++)Qn(c,u,"text");o.atomic&&Yi(c.doc),sr(c,"markerAdded",c,o)}return o}bo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&Wn(t),st(this,"clear")){var n=this.find();n&&sr(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var s=e.lines[a],l=Te(s.markedSpans,e);t&&!e.collapsed?Qn(t,de(s),"text"):t&&(null!=l.to&&(o=de(s)),null!=l.from&&(i=de(s))),s.markedSpans=Ae(s.markedSpans,l),null==l.from&&e.collapsed&&!Ue(e.doc,s)&&t&&fe(s,Zr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=He(e.lines[c]),f=Ge(u);f>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Yn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Yi(t.doc)),t&&sr(t,"markerCleared",t,this,i,o),r&&qn(t),this.parent&&this.parent.clear()}},bo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Te(o.markedSpans,this);if(null!=a.from&&(r=ge(t?o:de(o),a.from),-1==e))return r;if(null!=a.to&&(n=ge(t?o:de(o),a.to),1==e))return n}return r&&{from:r,to:n}},bo.prototype.changed=function(){var o=this,a=this.find(-1,!0),s=this,l=this.doc.cm;a&&l&&Vn(l,function(){var e=a.line,t=de(a.line),r=Ar(l,t);if(r&&(Br(r),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ue(s.doc,e)&&null!=s.height){var n=s.height;s.height=null;var i=br(s)-n;i&&fe(e,e.height+i)}sr(l,"markerChanged",l,o)})},bo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bo.prototype.detachLine=function(e){if(this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},lt(bo);var wo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ko(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function Co(o){for(var e=function(e){var t=o[e],r=[t.primary.doc];Ti(t.primary.doc,function(e){return r.push(e)});for(var n=0;n<t.markers.length;n++){var i=t.markers[n];-1==W(r,i.doc)&&(i.parent=null,t.markers.splice(n--,1))}},t=0;t<o.length;t++)e(t)}wo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},wo.prototype.find=function(e,t){return this.primary.find(e,t)},lt(wo);var So=0,_o=function(e,t,r,n,i){if(!(this instanceof _o))return new _o(e,t,r,n,i);null==r&&(r=0),mo.call(this,[new po([new $t("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ge(r,0);this.sel=bi(o),this.history=new Ei(null),this.id=++So,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mi(this,{from:o,to:o,text:e}),$i(this,bi(o),j)};_o.prototype=J(mo.prototype,{constructor:_o,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=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Xn(function(e){var t=ge(this.first,0),r=this.first+this.size-1;no(this,{from:t,to:ge(r,le(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ln(this.cm,0,0),$i(this,bi(t),j)}),replaceRange:function(e,t,r,n){lo(this,e,t=Ce(this,t),r=r?Ce(this,r):t,n)},getRange:function(e,t,r){var n=ce(this,Ce(this,e),Ce(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return le(this,e)},getLineNumber:function(e){return de(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=le(this,e)),He(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(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||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Xn(function(e,t,r){Ui(this,Ce(this,"number"==typeof e?ge(e,t||0):e),null,r)}),setSelection:Xn(function(e,t,r){Ui(this,Ce(this,e),Ce(this,t||e),r)}),extendSelection:Xn(function(e,t,r){Hi(this,Ce(this,e),t&&Ce(this,t),r)}),extendSelections:Xn(function(e,t){ji(this,Se(this,e),t)}),extendSelectionsBy:Xn(function(e,t){ji(this,Se(this,Y(this.sel.ranges,e)),t)}),setSelections:Xn(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new vi(Ce(this,e[i].anchor),Ce(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),$i(this,yi(this.cm,n,t),r)}}),addSelection:Xn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new vi(Ce(this,e),Ce(this,t||e))),$i(this,yi(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},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:Xn(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=ge(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=Ci(s.from,i,o),c=Ci(xi(s),i,o);if(i=s.to,o=c,"around"==r){var u=e.sel.ranges[a],f=ve(u.head,u.anchor)<0;n[a]=new vi(f?c:l,f?l:c)}else n[a]=new vi(l,l)}return new gi(n,e.sel.primIndex)}(this,n,t),l=n.length-1;0<=l;l--)no(this,n[l]);s?Vi(this,s):this.cm&&_n(this.cm)}),undo:Xn(function(){oo(this,"undo")}),redo:Xn(function(){oo(this,"redo")}),undoSelection:Xn(function(){oo(this,"undo",!0)}),redoSelection:Xn(function(){oo(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 Ei(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:Wi(this.history.done),undone:Wi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ei(this.history.maxGeneration);t.done=Wi(e.done.slice(0),null,!0),t.undone=Wi(e.undone.slice(0),null,!0)},setGutterMarker:Xn(function(e,r,n){return ho(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&re(t)&&(e.gutterMarkers=null),!0})}),clearGutter:Xn(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ho(r,e,"gutter",function(){return e.gutterMarkers[t]=null,re(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(!(e=le(this,t=e)))return null}else if(null==(t=de(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:Xn(function(e,r,n){return ho(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(S(n).test(e[t]))return!1;e[t]+=" "+n}else e[t]=n;return!0})}),removeLineClass:Xn(function(e,o,a){return ho(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(!r)return!1;if(null==a)e[t]=null;else{var n=r.match(S(a));if(!n)return!1;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return!0})}),addLineWidget:Xn(function(e,t,r){return i=e,o=new go(n=this,t,r),(a=n.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),ho(n,i,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==o.insertAt?t.push(o):t.splice(Math.min(t.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ue(n,e)){var r=$e(e)<n.scrollTop;fe(e,e.height+br(o)),r&&Sn(a,o.height),a.curOp.forceUpdate=!0}return!0}),a&&sr(a,"lineWidgetAdded",a,o,"number"==typeof i?i:de(i)),o;var n,i,o,a}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return xo(this,Ce(this,e),Ce(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 xo(this,e=Ce(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=le(this,(e=Ce(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(i,o,a){i=Ce(this,i),o=Ce(this,o);var s=[],l=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];null!=n.to&&l==i.line&&i.ch>=n.to||null==n.from&&l!=i.line||null!=n.from&&l==o.line&&n.from>=o.ch||a&&!a(n.marker)||s.push(n.marker.parent||n.marker)}++l}),s},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(r<t)return n=r,!0;r-=t,++i}),Ce(this,ge(i,n))},indexFromPos:function(e){var t=(e=Ce(this,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 _o(ue(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 _o(ue(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}],function(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(ve(o,a)){var s=xo(e,o,a,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,ko(this)),n},unlinkDoc:function(e){if(e instanceof ka&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Co(ko(this));break}}if(e.history==this.history){var r=[e.id];Ti(e,function(e){return r.push(e.id)},!0),e.history=new Ei(null),e.history.done=Wi(this.history.done,r),e.history.undone=Wi(this.history.undone,r)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):wt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Xn(function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Vn(t=this.cm,function(){Oi(t),Yn(t)}))})}),_o.prototype.eachLine=_o.prototype.iter;var Lo=0;function Mo(e){var i=this;if(To(i),!ot(i,e)&&!xr(i.display,e)){ct(e),w&&(Lo=+new Date);var o=an(i,e,!0),t=e.dataTransfer.files;if(o&&!i.isReadOnly())if(t&&t.length&&window.FileReader&&window.File)for(var a=t.length,s=Array(a),l=0,r=function(e,r){if(!i.options.allowDropFileTypes||-1!=W(i.options.allowDropFileTypes,e.type)){var n=new FileReader;n.onload=$n(i,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),s[r]=e,++l==a){var t={from:o=Ce(i.doc,o),to:o,text:i.doc.splitLines(s.join(i.doc.lineSeparator())),origin:"paste"};no(i.doc,t),Vi(i.doc,bi(o,xi(t)))}}),n.readAsText(e)}},n=0;n<a;++n)r(t[n],n);else{if(i.state.draggingText&&-1<i.doc.sel.contains(o))return i.state.draggingText(e),void setTimeout(function(){return i.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(i.state.draggingText&&!i.state.draggingText.copy&&(u=i.listSelections()),Gi(i.doc,bi(o,o)),u)for(var f=0;f<u.length;++f)lo(i.doc,"",u[f].anchor,u[f].head,"drag");i.replaceSelection(c,"around","paste"),i.display.input.focus()}}catch(e){}}}}function To(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ao(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var e=0;e<r.length;e++)t(r[e])})}}var Oo=!1;function Eo(){var e;Oo||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ao(No)},100))}),tt(window,"blur",function(){return Ao(vn)}),Oo=!0)}function No(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Io={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Po=0;Po<10;Po++)Io[Po+48]=Io[Po+96]=String(Po);for(var Ro=65;Ro<=90;Ro++)Io[Ro]=String.fromCharCode(Ro);for(var Bo=1;Bo<=12;Bo++)Io[Bo+111]=Io[Bo+63235]="F"+Bo;var Do={};function Fo(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function zo(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=Y(r.split(" "),Fo),o=0;o<i.length;o++){var a=void 0,s=void 0;a=o==i.length-1?(s=i.join(" "),n):(s=i.slice(0,o+1).join(" "),"...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Wo(e,t,r,n){var i=(t=Ko(t)).call?t.call(e,n):t[e];if(!1===i)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 Wo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Wo(e,t.fallthrough[o],r,n);if(a)return a}}}function qo(e){var t="string"==typeof e?e:Io[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ho(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function jo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var r=Io[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Ho(r,e,t))}function Ko(e){return"string"==typeof e?Do[e]:e}function Uo(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ve(o.from,X(n).to)<=0;){var a=n.pop();if(ve(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Vn(t,function(){for(var e=n.length-1;0<=e;e--)lo(t.doc,"",n[e].from,n[e].to,"+delete");_n(t)})}function Vo(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function $o(e,t,r){var n=Vo(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function Go(e,t,r,n,i){if(e){var o=Ze(r,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(0<s.level||"rtl"==t.doc.direction){var c=Or(t,r);a=i<0?r.text.length-1:0;var u=Er(t,c,a).top;a=ae(function(e){return Er(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Vo(r,a,1))}else a=i<0?s.to:s.from;return new ge(n,a,l)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}Do.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"},Do.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"},Do.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"},Do.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"]},Do.default=x?Do.macDefault:Do.pcDefault;var Xo={selectAll:to,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(r){return Uo(r,function(e){if(e.empty()){var t=le(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:ge(e.head.line+1,0)}:{from:e.head,to:ge(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return Uo(t,function(e){return{from:ge(e.from().line,0),to:Ce(t.doc,ge(e.to().line+1,0))}})},delLineLeft:function(e){return Uo(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return Uo(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){return Uo(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},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(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return Yo(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return Qo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var r=le(e.doc,t),n=function(e){for(var t;t=ze(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=de(n));return Go(!0,e,r,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},U)},goLineLeft:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},U)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?Qo(n,e.head):r},U)},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(G(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return Vn(a,function(){for(var e=a.listSelections(),t=[],r=0;r<e.length;r++)if(e[r].empty()){var n=e[r].head,i=le(a.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new ge(n.line,n.ch-1)),0<n.ch)n=new ge(n.line,n.ch+1),a.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),ge(n.line,n.ch-2),n,"+transpose");else if(n.line>a.doc.first){var o=le(a.doc,n.line-1).text;o&&(n=new ge(n.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),ge(n.line-1,o.length-1),n,"+transpose"))}t.push(new vi(n,n))}a.setSelections(t)})},newlineAndIndent:function(n){return Vn(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;r<e.length;r++)n.indentLine(e[r].from().line,null,!0);_n(n)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Yo(e,t){var r=le(e.doc,t),n=He(r);return n!=r&&(t=de(n)),Go(!0,e,n,t,1)}function Qo(e,t){var r=Yo(e,t.line),n=le(e.doc,r.line),i=Ze(n,e.doc.direction);if(i&&0!=i[0].level)return r;var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ge(r.line,a?0:o,r.sticky)}function Jo(e,t,r){if("string"==typeof t&&!(t=Xo[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)!=H}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var Zo=new z;function ea(e,t,r,n){var i=e.state.keySeq;if(i){if(qo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Zo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ta(e,i+" "+t,r,n))return!0}return ta(e,t,r,n)}function ta(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Wo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Wo(t,e.options.extraKeys,r,e)||Wo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(ct(r),hn(e)),!!i}function ra(t,e){var r=jo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?ea(t,"Shift-"+r,e,function(e){return Jo(t,e,!0)})||ea(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return Jo(t,e)}):ea(t,r,e,function(e){return Jo(t,e)}))}var na=null;function ia(e){var t=this;if(t.curOp.focus=N(),!ot(t,e)){w&&k<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ra(t,e);g&&(na=n?r:null,!n&&88==r&&!Ct&&(x?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),nt(document,"keyup",r),nt(document,"mouseover",r))}I(t,"CodeMirror-crosshair"),tt(document,"keyup",r),tt(document,"mouseover",r)}(t)}}function oa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ot(this,e)}function aa(e){var t=this;if(!(xr(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(g&&r==na)return na=null,void ct(e);if(!g||e.which&&!(e.which<10)||!ra(t,e)){var i,o=String.fromCharCode(null==n?r:n);if("\b"!=o)if(!ea(i=t,"'"+o+"'",e,function(e){return Jo(i,e,!0)}))t.display.input.onKeyPress(e)}}}var sa,la,ca=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ua(e){var t=this,r=t.display;if(!(ot(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,xr(r,e))b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!ha(t,e)){var n,i,o,a=an(t,e),s=pt(e),l=a?(n=a,i=s,o=+new Date,la&&la.compare(o,n,i)?(sa=la=null,"triple"):sa&&sa.compare(o,n,i)?(la=new ca(o,n,i),sa=null,"double"):(sa=new ca(o,n,i),la=null,"single")):"single";window.focus(),1==s&&t.state.selectingText&&t.state.selectingText(e),a&&function(r,e,n,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ea(r,Ho(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=Xo[e]),!e)return!1;var t=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),t=e(r,n)!=H}finally{r.state.suppressEdits=!1}return t})}(t,s,a,l,e)||(1==s?a?function(e,t,r,n){w?setTimeout(B(pn,e),0):e.curOp.focus=N();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=h?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=x?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(x?r.altKey:r.ctrlKey));return i}(e,r,n),a=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==r&&-1<(i=a.contains(t))&&(ve((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ve(i.to(),t)||t.xRel<0)?function(t,r,n,i){var o=t.display,a=!1,s=$n(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,nt(o.wrapper.ownerDocument,"mouseup",s),nt(o.wrapper.ownerDocument,"mousemove",l),nt(o.scroller,"dragstart",c),nt(o.scroller,"drop",s),a||(ct(e),i.addNew||Hi(t.doc,n,null,null,i.extend),b||w&&9==k?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),l=function(e){a=a||10<=Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)},c=function(){return a=!0};b&&(o.scroller.draggable=!0);(t.state.draggingText=s).copy=!i.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();tt(o.wrapper.ownerDocument,"mouseup",s),tt(o.wrapper.ownerDocument,"mousemove",l),tt(o.scroller,"dragstart",c),tt(o.scroller,"drop",s),mn(t),setTimeout(function(){return o.input.focus()},20)}(e,n,t,o):function(g,e,v,y){var a=g.display,b=g.doc;ct(e);var x,w,k=b.sel,t=k.ranges;y.addNew&&!y.extend?(w=b.sel.contains(v),x=-1<w?t[w]:new vi(v,v)):(x=b.sel.primary(),w=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(x=new vi(v,v)),v=an(g,e,!0,!0),w=-1;else{var r=fa(g,v,y.unit);x=y.extend?qi(x,r.anchor,r.head,y.extend):r}y.addNew?-1==w?(w=t.length,$i(b,yi(g,t.concat([x]),w),{scroll:!1,origin:"*mouse"})):1<t.length&&t[w].empty()&&"char"==y.unit&&!y.extend?($i(b,yi(g,t.slice(0,w).concat(t.slice(w+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Ki(b,w,x,K):($i(b,new gi([x],w=0),K),k=b.sel);var C=v;function s(e){if(0!=ve(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],r=g.options.tabSize,n=F(le(b,v.line).text,v.ch,r),i=F(le(b,e.line).text,e.ch,r),o=Math.min(n,i),a=Math.max(n,i),s=Math.min(v.line,e.line),l=Math.min(g.lastLine(),Math.max(v.line,e.line));s<=l;s++){var c=le(b,s).text,u=V(c,o,r);o==a?t.push(new vi(ge(s,u),ge(s,u))):c.length>u&&t.push(new vi(ge(s,u),ge(s,V(c,a,r))))}t.length||t.push(new vi(v,v)),$i(b,yi(g,k.ranges.slice(0,w).concat(t),w),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var f,d=x,h=fa(g,e,y.unit),p=d.anchor;p=0<ve(h.anchor,p)?(f=h.head,we(d.from(),h.anchor)):(f=h.anchor,xe(d.to(),h.head));var m=k.ranges.slice(0);m[w]=function(e,t){var r=t.anchor,n=t.head,i=le(e.doc,r.line);if(0==ve(r,n)&&r.sticky==n.sticky)return t;var o=Ze(i);if(!o)return t;var a=Qe(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,c=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)l=0<(n.line-r.line)*("ltr"==e.doc.direction?1:-1);else{var u=Qe(o,n.ch,n.sticky),f=u-a||(n.ch-r.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:0<f}var d=o[c+(l?-1:0)],h=l==(1==d.level),p=h?d.from:d.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new vi(new ge(r.line,p,m),n)}(g,new vi(Ce(b,p),f)),$i(b,yi(g,m,w),K)}}var l=a.wrapper.getBoundingClientRect(),c=0;function n(e){g.state.selectingText=!1,c=1/0,ct(e),a.input.focus(),nt(a.wrapper.ownerDocument,"mousemove",i),nt(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=$n(g,function(e){0!==e.buttons&&pt(e)?function e(t){var r=++c;var n=an(g,t,!0,"rectangle"==y.unit);if(!n)return;if(0!=ve(n,C)){g.curOp.focus=N(),s(n);var i=xn(a,b);(n.line>=i.to||n.line<i.from)&&setTimeout($n(g,function(){c==r&&e(t)}),150)}else{var o=t.clientY<l.top?-20:t.clientY>l.bottom?20:0;o&&setTimeout($n(g,function(){c==r&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):n(e)}),o=$n(g,n);g.state.selectingText=o,tt(a.wrapper.ownerDocument,"mousemove",i),tt(a.wrapper.ownerDocument,"mouseup",o)}(e,n,t,o)}(t,a,l,e):ht(e)==r.scroller&&ct(e):2==s?(a&&Hi(t.doc,a),setTimeout(function(){return r.input.focus()},20)):3==s&&(C?t.display.input.onContextMenu(e):mn(t)))}}function fa(e,t,r){if("char"==r)return new vi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new vi(ge(t.line,0),Ce(e.doc,ge(t.line+1,0)));var n=r(e,t);return new vi(n.from,n.to)}function da(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ct(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!st(e,r))return ft(t);o-=s.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return it(e,r,e,he(e.doc,o),e.options.gutters[l],t),ft(t)}}function ha(e,t){return da(e,t,"gutterClick",!0)}function pa(e,t){var r,n;xr(e.display,t)||(n=t,st(r=e,"gutterContextMenu")&&da(r,n,"gutterContextMenu",!1))||(ot(e,t,"contextmenu")||C||e.display.input.onContextMenu(t))}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fr(e)}ca.prototype.compare=function(e,t,r){return this.time+400>e&&0==ve(t,this.pos)&&r==this.button};var ga={toString:function(){return"CodeMirror.Init"}},va={},ya={};function ba(e){ci(e),Yn(e),wn(e)}function xa(e,t,r){if(!t!=!(r&&r!=ga)){var n=e.display.dragFunctions,i=t?tt:nt;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 wa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Xe(e)),on(e),Yn(e),Fr(e),setTimeout(function(){return Rn(e)},100)}function ka(e,t){var r=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?D(t):{},D(va,t,!1),ui(t);var n=t.value;"string"==typeof n?n=new _o(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new ka.inputStyles[t.inputStyle](this),o=this.display=new se(e,n,i);for(var a in ci(o.wrapper.CodeMirror=this),ma(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fn(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 z,keySeq:null,specialChars:null},t.autofocus&&!d&&o.input.focus(),w&&k<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;tt(o.scroller,"mousedown",$n(i,ua)),tt(o.scroller,"dblclick",w&&k<11?$n(i,function(e){if(!ot(i,e)){var t=an(i,e);if(t&&!ha(i,e)&&!xr(i.display,e)){ct(e);var r=i.findWordAt(t);Hi(i.doc,r.anchor,r.head)}}}):function(e){return ot(i,e)||ct(e)});tt(o.scroller,"contextmenu",function(e){return pa(i,e)});var r,n={end:0};function a(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}tt(o.scroller,"touchstart",function(e){if(!ot(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ha(i,e)){o.input.ensurePolled(),clearTimeout(r);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),tt(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),tt(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!xr(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(o.activeTouch,"page");r=!t.prev||s(t,t.prev)?new vi(n,n):!t.prev.prev||s(t,t.prev.prev)?i.findWordAt(n):new vi(ge(n.line,0),Ce(i.doc,ge(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),ct(e)}a()}),tt(o.scroller,"touchcancel",a),tt(o.scroller,"scroll",function(){o.scroller.clientHeight&&(An(i,o.scroller.scrollTop),En(i,o.scroller.scrollLeft,!0),it(i,"scroll",i))}),tt(o.scroller,"mousewheel",function(e){return mi(i,e)}),tt(o.scroller,"DOMMouseScroll",function(e){return mi(i,e)}),tt(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){ot(i,e)||dt(e)},over:function(e){ot(i,e)||(!function(e,t){var r=an(e,t);if(r){var n=document.createDocumentFragment();un(e,r,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,n)}}(i,e),dt(e))},start:function(e){return function(e,t){if(w&&(!e.state.draggingText||+new Date-Lo<100))dt(t);else if(!ot(e,t)&&!xr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!l)){var r=O("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}(i,e)},drop:$n(i,Mo),leave:function(e){ot(i,e)||To(i)}};var e=o.input.getField();tt(e,"keyup",function(e){return oa.call(i,e)}),tt(e,"keydown",$n(i,ia)),tt(e,"keypress",$n(i,aa)),tt(e,"focus",function(e){return gn(i,e)}),tt(e,"blur",function(e){return vn(i,e)})}(this),Eo(),Wn(this),this.curOp.forceUpdate=!0,Ai(this,n),t.autofocus&&!d||this.hasFocus()?setTimeout(B(gn,this),20):vn(this),ya)ya.hasOwnProperty(a)&&ya[a](r,t[a],ga);kn(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Ca.length;++s)Ca[s](r);qn(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=va,ka.optionHandlers=ya;var Ca=[];function Sa(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=zt(e,t).state:r="prev");var a=e.options.tabSize,s=le(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==H||150<c)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?F(le(o,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)d+=a,f+="\t";if(d<c&&(f+=G(c-d)),f!=u)return lo(o,f,ge(t,0),ge(t,u.length),"+input"),!(s.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=ge(t,u.length);Ki(o,p,new vi(g,g));break}}}ka.defineInitHook=function(e){return Ca.push(e)};var _a=null;function La(e){_a=e}function Ma(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=wt(t),c=null;if(s&&1<n.ranges.length)if(_a&&_a.text.join("\n")==t){if(n.ranges.length%_a.text.length==0){c=[];for(var u=0;u<_a.text.length;u++)c.push(o.splitLines(_a.text[u]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=Y(l,function(e){return[e]}));for(var f=e.curOp.updateInput,d=n.ranges.length-1;0<=d;d--){var h=n.ranges[d],p=h.from(),m=h.to();h.empty()&&(r&&0<r?p=ge(p.line,p.ch-r):e.state.overwrite&&!s?m=ge(m.line,Math.min(le(o,m.line).text.length,m.ch+X(l).length)):s&&_a&&_a.lineWise&&_a.text.join("\n")==t&&(p=m=ge(p.line,0)));var g={from:p,to:m,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};no(e.doc,g),sr(e,"inputRead",e,g)}t&&!s&&Aa(e,t),_n(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ta(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vn(t,function(){return Ma(t,r,0,null,"paste")}),!0}function Aa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(-1<t.indexOf(o.electricChars.charAt(s))){a=Sa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(le(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Sa(e,i.head.line,"smart"));a&&sr(e,"electricInput",e,i.head.line)}}}function Oa(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:ge(i,0),head:ge(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ea(e,t,r,n){e.setAttribute("autocorrect",!!r),e.setAttribute("autocapitalize",!!n),e.setAttribute("spellcheck",!!t)}function Na(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),u&&(e.style.border="1px solid black"),Ea(e),t}function Ia(n,i,o,e,a){var t=i,r=o,s=le(n,i.line);function l(e){var t,r;if(null==(t=a?function(t,r,s,e){var l=Ze(r,t.doc.direction);if(!l)return $o(r,s,e);s.ch>=r.text.length?(s.ch=r.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var n=Qe(l,s.ch,s.sticky),i=l[n];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>s.ch:i.from<s.ch))return $o(r,s,e);var o,c=function(e,t){return Vo(r,e instanceof ge?e.ch:e,t)},a=function(e){return t.options.lineWrapping?(o=o||Or(t,r),Yr(t,r,o,e)):{begin:0,end:r.text.length}},u=a("before"==s.sticky?c(s,-1):s.ch);if("rtl"==t.doc.direction||1==i.level){var f=1==i.level==e<0,d=c(s,f?1:-1);if(null!=d&&(f?d<=i.to&&d<=u.end:d>=i.from&&d>=u.begin)){var h=f?"before":"after";return new ge(s.line,d,h)}}var p=function(e,t,r){for(var n=function(e,t){return t?new ge(s.line,c(e,1),"before"):new ge(s.line,e,"after")};0<=e&&e<l.length;e+=t){var i=l[e],o=0<t==(1!=i.level),a=o?r.begin:c(r.end,-1);if(i.from<=a&&a<i.to)return n(a,o);if(a=o?i.from:c(i.to,-1),r.begin<=a&&a<r.end)return n(a,o)}},m=p(n+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==r.text.length||!(m=p(0<e?0:l.length-1,e,a(g)))?null:m}(n.cm,s,i,o):$o(s,i,o))){if(e||(r=i.line+o)<n.first||r>=n.first+n.size||(i=new ge(r,i.ch,i.sticky),!(s=le(n,r))))return!1;i=Go(a,n.cm,s,i.line,o)}else i=t;return!0}if("char"==e)l();else if("column"==e)l(!0);else if("word"==e||"group"==e)for(var c=null,u="group"==e,f=n.cm&&n.cm.getHelper(i,"wordChars"),d=!0;!(o<0)||l(!d);d=!1){var h=s.text.charAt(i.ch)||"\n",p=te(h,f)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||d||p||(p="s"),c&&c!=p){o<0&&(o=1,l(),i.sticky="after");break}if(p&&(c=p),0<o&&!l(!d))break}var m=Zi(n,i,t,r,!0);return ye(t,m)&&(m.hitSide=!0),m}function Pa(e,t,r,n){var i,o,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Zr(e.display),3);i=(0<r?t.bottom:t.top)+r*c}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;(o=Gr(e,s,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var Ra=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ba(e,t){var r=Ar(e,t.line);if(!r||r.hidden)return null;var n=le(e.doc,t.line),i=Mr(r,n,t.line),o=Ze(n,e.doc.direction),a="left";o&&(a=Qe(o,t.ch)%2?"right":"left");var s=Pr(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Da(e,t){return t&&(e.bad=!0),e}function Fa(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Da(e.clipPos(ge(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 za(o,t,r)}}function za(c,e,t){var r=c.text.firstChild,n=!1;if(!e||!E(r,e))return Da(ge(de(c.line),0),!0);if(e==r&&(n=!0,e=r.childNodes[t],t=0,!e)){var i=c.rest?X(c.rest):c.line;return Da(ge(de(i),i.text.length),n)}var o=3==e.nodeType?e:null,a=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t&&(t=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var u=c.measure,f=u.maps;function s(e,t,r){for(var n=-1;n<(f?f.length:0);n++)for(var i=n<0?u.map:f[n],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var s=de(n<0?c.line:c.rest[n]),l=i[o]+r;return(r<0||a!=e)&&(l=i[o+(r?1:0)]),ge(s,l)}}}var l=s(o,a,t);if(l)return Da(l,n);for(var d=a.nextSibling,h=o?o.nodeValue.length-t:0;d;d=d.nextSibling){if(l=s(d,d.firstChild,0))return Da(ge(l.line,l.ch-h),n);h+=d.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(l=s(p,p.firstChild,-1))return Da(ge(l.line,l.ch+m),n);m+=p.textContent.length}}Ra.prototype.init=function(e){var t=this,a=this,s=a.cm,l=a.div=e.lineDiv;function r(e){if(!ot(s,e)){if(s.somethingSelected())La({lineWise:!1,text:s.getSelections()}),"cut"==e.type&&s.replaceSelection("",null,"cut");else{if(!s.options.lineWiseCopyCut)return;var t=Oa(s);La({lineWise:!0,text:t.text}),"cut"==e.type&&s.operation(function(){s.setSelections(t.ranges,0,j),s.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=_a.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=Na(),i=n.firstChild;s.display.lineSpace.insertBefore(n,s.display.lineSpace.firstChild),i.value=_a.text.join("\n");var o=document.activeElement;R(i),setTimeout(function(){s.display.lineSpace.removeChild(n),o.focus(),o==l&&a.showPrimarySelection()},50)}}Ea(l,s.options.spellcheck,s.options.autocorrect,s.options.autocapitalize),tt(l,"paste",function(e){ot(s,e)||Ta(e,s)||k<=11&&setTimeout($n(s,function(){return t.updateFromDOM()}),20)}),tt(l,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),tt(l,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),tt(l,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),tt(l,"touchstart",function(){return a.forceCompositionEnd()}),tt(l,"input",function(){t.composing||t.readFromDOMSoon()}),tt(l,"copy",r),tt(l,"cut",r)},Ra.prototype.prepareSelection=function(){var e=cn(this.cm,!1);return e.focus=this.cm.state.focused,e},Ra.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ra.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ra.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Fa(t,e.anchorNode,e.anchorOffset),a=Fa(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ve(we(o,a),n)||0!=ve(xe(o,a),i)){var s=t.display.view,l=n.line>=t.display.viewFrom&&Ba(t,n)||{node:s[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Ba(t,i);if(!c){var u=s[s.length-1].measure,f=u.maps?u.maps[u.maps.length-1]:u.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(l&&c){var d,h=e.rangeCount&&e.getRangeAt(0);try{d=_(l.node,l.offset,c.offset,c.node)}catch(e){}d&&(!m&&t.state.focused?(e.collapse(l.node,l.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),h&&null==e.anchorNode?e.addRange(h):m&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ra.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)},Ra.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Ra.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ra.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Ra.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ra.prototype.blur=function(){this.div.blur()},Ra.prototype.getField=function(){return this.div},Ra.prototype.supportsTouch=function(){return!0},Ra.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Vn(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},Ra.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ra.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(f&&a&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(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=Fa(t,e.anchorNode,e.anchorOffset),n=Fa(t,e.focusNode,e.focusOffset);r&&n&&Vn(t,function(){$i(t.doc,bi(r,n),j),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Ra.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ge(a.line-1,le(n.doc,a.line-1).length)),s.ch==le(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=ge(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;r=a.line==i.viewFrom||0==(e=sn(n,a.line))?(t=de(i.view[0].line),i.view[0].node):(t=de(i.view[e].line),i.view[e-1].node.nextSibling);var l,c,u=sn(n,s.line);if(c=u==i.view.length-1?(l=i.viewTo-1,i.lineDiv.lastChild):(l=de(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(l,e,t,c,u){var r="",f=!1,d=l.doc.lineSeparator(),h=!1;function p(){f&&(r+=d,h&&(r+=d),f=h=!1)}function m(e){e&&(p(),r+=e)}function g(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void m(t);var r,n=e.getAttribute("cm-marker");if(n){var i=l.findMarks(ge(c,0),ge(u+1,0),(s=+n,function(e){return e.id==s}));return void(i.length&&(r=i[0].find(0))&&m(ce(l.doc,r.from,r.to).join(d)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;o&&p();for(var a=0;a<e.childNodes.length;a++)g(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(h=!0),o&&(f=!0)}else 3==e.nodeType&&m(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var s}for(;g(e),e!=t;)e=e.nextSibling,h=!1;return r}(n,r,c,t,l)),d=ce(n.doc,ge(t,0),ge(l,le(n.doc,l).text.length));1<f.length&&1<d.length;)if(X(f)==X(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=X(f),b=X(d),x=Math.min(y.length-(1==f.length?h:0),b.length-(1==d.length?h:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==d.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var w=ge(t,h),k=ge(l,d.length?X(d).length-p:0);return 1<f.length||f[0]||ve(w,k)?(lo(n.doc,f,w,k,"+input"),!0):void 0},Ra.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ra.prototype.reset=function(){this.forceCompositionEnd()},Ra.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ra.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))},Ra.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vn(this.cm,function(){return Yn(e.cm)})},Ra.prototype.setUneditable=function(e){e.contentEditable="false"},Ra.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||$n(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ra.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ra.prototype.onContextMenu=function(){},Ra.prototype.resetPosition=function(){},Ra.prototype.needsContentAttribute=!0;var Wa,qa,Ha,ja=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};ja.prototype.init=function(r){var e=this,n=this,i=this.cm;this.createField(r);var o=this.textarea;function t(e){if(!ot(i,e)){if(i.somethingSelected())La({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Oa(i);La({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,j):(n.prevInput="",o.value=t.text.join("\n"),R(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),u&&(o.style.width="0px"),tt(o,"input",function(){w&&9<=k&&e.hasSelection&&(e.hasSelection=null),n.poll()}),tt(o,"paste",function(e){ot(i,e)||Ta(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())}),tt(o,"cut",t),tt(o,"copy",t),tt(r.scroller,"paste",function(e){if(!xr(r,e)&&!ot(i,e)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var t=new Event("paste");t.clipboardData=e.clipboardData,o.dispatchEvent(t)}}),tt(r.lineSpace,"selectstart",function(e){xr(r,e)||ct(e)}),tt(o,"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"})}}),tt(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ja.prototype.createField=function(e){this.wrapper=Na(),this.textarea=this.wrapper.firstChild},ja.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=cn(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},ja.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ja.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&R(this.textarea),w&&9<=k&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",w&&9<=k&&(this.hasSelection=null))}},ja.prototype.getField=function(){return this.textarea},ja.prototype.supportsTouch=function(){return!1},ja.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!d||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},ja.prototype.blur=function(){this.textarea.blur()},ja.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ja.prototype.receivedFocus=function(){this.slowPoll()},ja.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ja.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},ja.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||kt(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(w&&9<=k&&this.hasSelection===i||x&&/[\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,s=Math.min(n.length,i.length);a<s&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Vn(t,function(){Ma(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?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},ja.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ja.prototype.onKeyPress=function(){w&&9<=k&&(this.hasSelection=null),this.fastPoll()},ja.prototype.onContextMenu=function(e){var r=this,n=r.cm,i=n.display,o=r.textarea;r.contextMenuPending&&r.contextMenuPending();var t=an(n,e),a=i.scroller.scrollTop;if(t&&!g){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(t)&&$n(n,$i)(n.doc,bi(t),j);var s,l=o.style.cssText,c=r.wrapper.style.cssText,u=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n z-index: 1000; background: "+(w?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",b&&(s=window.scrollY),i.input.focus(),b&&window.scrollTo(null,s),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=h,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),w&&9<=k&&d(),C){dt(e);var f=function(){nt(window,"mouseup",f),setTimeout(h,20)};tt(window,"mouseup",f)}else setTimeout(h,50)}function d(){if(null!=o.selectionStart){var e=n.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,r.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function h(){if(r.contextMenuPending==h&&(r.contextMenuPending=!1,r.wrapper.style.cssText=c,o.style.cssText=l,w&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a),null!=o.selectionStart)){(!w||w&&k<9)&&d();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==r.prevInput?$n(n,to)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},ja.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ja.prototype.setUneditable=function(){},ja.prototype.needsContentAttribute=!1,function(i){var o=i.optionHandlers;function e(e,t,n,r){i.defaults[e]=t,n&&(o[e]=r?function(e,t,r){r!=ga&&n(e,t,r)}:n)}i.defineOption=e,i.Init=ga,e("value","",function(e,t){return e.setValue(t)},!0),e("mode",null,function(e,t){e.doc.modeOption=t,Si(e)},!0),e("indentUnit",2,Si,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(e){_i(e),Fr(e),Yn(e)},!0),e("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(ge(o,r))}o++});for(var t=i.length-1;0<=t;t--)lo(e.doc,n,i[t],ge(i[t].line,i[t].ch+n.length))}}),e("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!=ga&&e.refresh()}),e("specialCharPlaceholder",Jt,function(e){return e.refresh()},!0),e("electricChars",!0),e("inputStyle",d?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),e("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),e("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),e("rtlMoveVisually",!p),e("wholeLineUpdateBefore",!0),e("theme","default",function(e){ma(e),ba(e)},!0),e("keyMap","default",function(e,t,r){var n=Ko(t),i=r!=ga&&Ko(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,wa,!0),e("gutters",[],function(e){ui(e.options),ba(e)},!0),e("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rn(e.display)+"px":"0",e.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(e){return Rn(e)},!0),e("scrollbarStyle","native",function(e){Fn(e),Rn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),e("lineNumbers",!1,function(e){ui(e.options),ba(e)},!0),e("firstLineNumber",1,ba,!0),e("lineNumberFormatter",function(e){return e},ba,!0),e("showCursorWhenSelecting",!1,ln,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,function(e,t){"nocursor"==t&&(vn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),e("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),e("dragDrop",!0,xa),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,ln,!0),e("singleCursorHeightPerLine",!0,ln,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,_i,!0),e("addModeClass",!1,_i,!0),e("pollInterval",100),e("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),e("historyEventDelay",1250),e("viewportMargin",10,function(e){return e.refresh()},!0),e("maxHighlightLength",1e4,_i,!0),e("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),e("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),e("autofocus",null),e("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),e("phrases",null)}(ka),qa=(Wa=ka).optionHandlers,Ha=Wa.helpers={},Wa.prototype={constructor:Wa,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,qa.hasOwnProperty(e)&&$n(this,qa[e])(this,t,n),it(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"](Ko(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:Gn(function(e,t){var r=e.token?e:Wa.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,Yn(this)}),removeOverlay:Gn(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Yn(this)}}),indentLine:Gn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&Sa(this,e,t,r)}),indentSelection:Gn(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&&(Sa(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&_n(t));else{var a=o.from(),s=o.to(),l=Math.max(n,a.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var c=l;c<n;++c)Sa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&0<u[i].from().ch&&Ki(t.doc,i,new vi(a,u[i].to()),j)}}}),getTokenAt:function(e,t){return Kt(this,e,t)},getLineTokens:function(e,t){return Kt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,r=Ft(this,le(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 s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?Wa.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ha.hasOwnProperty(t))return r;var n=Ha[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var s=0;s<n._global.length;s++){var l=n._global[s];l.pred(i,this)&&-1==W(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var r=this.doc;return zt(this,(e=ke(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Ur(this,null==e?r.head:"object"==typeof e?Ce(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Kr(this,Ce(this.doc,e),t||"page")},coordsChar:function(e,t){return Gr(this,(e=jr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=jr(this,{top:e,left:0},t||"page").top,he(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:o<e&&(e=o,i=!0),n=le(this.doc,e)}else n=e;return Hr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-$e(n):0)},defaultTextHeight:function(){return Zr(this.display)},defaultCharWidth:function(){return en(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,s,l=this.display,c=(e=Ur(this,Ce(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Cn(o,a)).scrollTop&&An(o,s.scrollTop),null!=s.scrollLeft&&En(o,s.scrollLeft))},triggerOnKeyDown:Gn(ia),triggerOnKeyPress:Gn(aa),triggerOnKeyUp:oa,triggerOnMouseDown:Gn(ua),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Gn(function(e){Aa(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),a=0;a<t&&!(o=Ia(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:Gn(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?Ia(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},U)}),deleteH:Gn(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):Uo(this,function(e){var t=Ia(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=Ce(this.doc,e),s=0;s<t;++s){var l=Ur(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Pa(this,l,i,r)).hitSide)break}return a},moveV:Gn(function(n,i){var o=this,a=this.doc,s=[],l=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(e){if(l)return n<0?e.from():e.to();var t=Ur(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),s.push(t.left);var r=Pa(o,t,n,i);return"page"==i&&e==a.sel.primary()&&Sn(o,Kr(o,r,"div").top-t.top),r},U),s.length)for(var e=0;e<a.sel.ranges.length;e++)a.sel.ranges[e].goalColumn=s[e]}),findWordAt:function(e){var t=le(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new vi(ge(e.line,r),ge(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),it(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Gn(function(e,t){Ln(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Sr(this)-this.display.barHeight,width:e.scrollWidth-Sr(this)-this.display.barWidth,clientHeight:Lr(this),clientWidth:_r(this)}},scrollIntoView:Gn(function(e,t){var r,n;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(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?(n=e,Mn(r=this),r.curOp.scrollToPos=n):Tn(this,e.from,e.to,e.margin)}),setSize:Gn(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&&Dr(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){Qn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,it(this,"refresh",this)}),operation:function(e){return Vn(this,e)},startOperation:function(){return Wn(this)},endOperation:function(){return qn(this)},refresh:Gn(function(){var e=this.display.cachedTextHeight;Yn(this),this.curOp.forceUpdate=!0,Fr(this),Ln(this,this.doc.scrollLeft,this.doc.scrollTop),si(this),(null==e||.5<Math.abs(e-Zr(this.display)))&&on(this),it(this,"refresh",this)}),swapDoc:Gn(function(e){var t=this.doc;return t.cm=null,Ai(this,e),Fr(this),this.display.input.reset(),Ln(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},lt(Wa),Wa.registerHelper=function(e,t,r){Ha.hasOwnProperty(e)||(Ha[e]=Wa[e]={_global:[]}),Ha[e][t]=r},Wa.registerGlobalHelper=function(e,t,r,n){Wa.registerHelper(e,t,n),Ha[e]._global.push({pred:r,val:n})};var Ka,Ua="iter insert remove copy getEditor constructor".split(" ");for(var Va in _o.prototype)_o.prototype.hasOwnProperty(Va)&&W(Ua,Va)<0&&(ka.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(_o.prototype[Va]));return lt(_o),ka.inputStyles={textarea:ja,contenteditable:Ra},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_t[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){Lt[e]=t},ka.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){_o.prototype[e]=t},ka.fromTextArea=function(t,e){if((e=e?D(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=N();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}function n(){t.value=s.getValue()}var i;if(t.form&&(tt(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(nt(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var s=ka(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return s},(Ka=ka).off=nt,Ka.on=tt,Ka.wheelEventPixels=pi,Ka.Doc=_o,Ka.splitLines=wt,Ka.countColumn=F,Ka.findColumn=V,Ka.isWordChar=ee,Ka.Pass=H,Ka.signal=it,Ka.Line=$t,Ka.changeEnd=xi,Ka.scrollbarModel=Dn,Ka.Pos=ge,Ka.cmpPos=ve,Ka.modes=_t,Ka.mimeModes=Lt,Ka.resolveMode=Mt,Ka.getMode=Tt,Ka.modeExtensions=At,Ka.extendMode=Ot,Ka.copyState=Et,Ka.startState=It,Ka.innerMode=Nt,Ka.commands=Xo,Ka.keyMap=Do,Ka.keyName=jo,Ka.isModifierKey=qo,Ka.lookupKey=Wo,Ka.normalizeKeyMap=zo,Ka.StringStream=Pt,Ka.SharedTextMarker=wo,Ka.TextMarker=bo,Ka.LineWidget=go,Ka.e_preventDefault=ct,Ka.e_stopPropagation=ut,Ka.e_stop=dt,Ka.addClass=I,Ka.contains=E,Ka.rmClass=L,Ka.keyNames=Io,ka.version="5.44.0",ka}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(C){"use strict";var S={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},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};C.defineMode("xml",function(e,t){var a,o,s=e.indentUnit,l={},r=t.htmlMode?S:_;for(var n in r)l[n]=r[n];for(var n in t)l[n]=t[n];function c(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(i("atom","]]>")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=i("meta","?>"),"meta"):(a=t.eat("/")?"closeTag":"openTag",r.tokenize=u,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function u(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=c,a=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return a="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=u;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=c,t.state=p,t.tagName=t.tagStart=null;var n,i,o=t.tokenize(e,t);return o?o+" tag error":"tag error"}function i(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=c;break}e.next()}return r}}function f(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(r)||!l.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",b):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,r)):(o="error",m)}function g(e,t,r){if("word"!=e)return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,r)):(o="error",y);var n=t.current();return r.context&&r.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||!1===l.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,r){return"endTag"!=e?(o="error",v):(d(r),p)}function y(e,t,r){return o="error",v(e,0,r)}function b(e,t,r){if("word"==e)return o="attribute",x;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(n)?h(r,n):(h(r,n),r.context=new f(r,n,i==r.indented)),p}function x(e,t,r){return"equals"==e?w:(l.allowMissing||(o="error"),b(e,0,r))}function w(e,t,r){return"string"==e?k:"word"==e&&l.allowUnquoted?(o="string",b):(o="error",b(e,0,r))}function k(e,t,r){return"string"==e?k:b(e,0,r)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,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;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!=r&&(o=null,t.state=t.state(a||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(n&&n.noIndent)return C.Pass;if(e.tokenize!=u&&e.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!l.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=l.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=b)}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.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";$e.defineMode("javascript",function(e,f){var n,i,d=e.indentUnit,h=f.statementIndent,a=f.jsonld,s=f.json||a,c=f.typescript,u=f.wordCharacters||/[\w$\xa1-\uffff]/,l=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),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:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,r){return n=e,i=r,t}function v(e,t){var i,r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(a&&"@"==e.peek()&&e.match(m))return t.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=v),g("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return g("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=y)(e,t):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Ve(e,t,1)?(function(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}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return(t.tokenize=b)(e,t);if("#"==r)return e.skipToEnd(),g("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),g("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current();if("."!=t.lastType){if(l.propertyIsEnumerable(n)){var o=l[n];return g(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function y(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var x="([{}])";function o(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){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;0<=a;--a){var s=e.string.charAt(a),l=x.indexOf(s);if(0<=l&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(3<=l&&l<6)++i;else if(u.test(s))o=!0;else{if(/["'\/]/.test(s))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(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 C(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(r=n.vars;r;r=r.next)if(r.name==t)return!0}var S={state:null,column:null,marked:null,cc:null};function _(){for(var e=arguments.length-1;0<=e;e--)S.cc.push(arguments[e])}function L(){return _.apply(null,arguments),!0}function M(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function r(e){var t=S.state;if(S.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,r){{if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new A(n,r.vars,!0):null}return M(t,r.vars)?r:new A(r.prev,new O(t,r.vars),!1)}return null}}(e,t.context);if(null!=r)return void(t.context=r)}else if(!M(e,t.localVars))return void(t.localVars=new O(e,t.localVars));f.globalVars&&!M(e,t.globalVars)&&(t.globalVars=new O(e,t.globalVars))}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function A(e,t,r){this.prev=e,this.vars=t,this.block=r}function O(e,t){this.name=e,this.next=t}var t=new O("this",new O("arguments",null));function E(){S.state.context=new A(S.state.context,S.state.localVars,!1),S.state.localVars=t}function N(){S.state.context=new A(S.state.context,S.state.localVars,!0),S.state.localVars=null}function I(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function P(n,i){var e=function(){var e=S.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new k(t,S.stream.column(),n,null,e.lexical,i)};return e.lex=!0,e}function R(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function B(r){return function e(t){return t==r?L():";"==r||"}"==t||")"==t||"]"==t?_():L(e)}}function D(e,t){return"var"==e?L(P("vardef",t),ve,B(";"),R):"keyword a"==e?L(P("form"),q,D,R):"keyword b"==e?L(P("form"),D,R):"keyword d"==e?S.stream.match(/^\s*$/,!1)?L():L(P("stat"),j,B(";"),R):"debugger"==e?L(B(";")):"{"==e?L(P("}"),N,oe,R,I):";"==e?L():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==R&&S.state.cc.pop()(),L(P("form"),q,D,R,Ce)):"function"==e?L(Me):"for"==e?L(P("form"),Se,D,R):"class"==e||c&&"interface"==t?(S.marked="keyword",L(P("form","class"==e?e:t),Ne,R)):"variable"==e?c&&"declare"==t?(S.marked="keyword",L(D)):c&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?L(Ke):"type"==t?L(Ae,B("operator"),ce,B(";")):L(P("form"),ye,B("{"),P("}"),oe,R,R)):c&&"namespace"==t?(S.marked="keyword",L(P("form"),z,D,R)):c&&"abstract"==t?(S.marked="keyword",L(D)):L(P("stat"),J):"switch"==e?L(P("form"),q,B("{"),P("}","switch"),N,oe,R,R,I):"case"==e?L(z,B(":")):"default"==e?L(B(":")):"catch"==e?L(P("form"),E,F,D,R,I):"export"==e?L(P("stat"),Be,R):"import"==e?L(P("stat"),Fe,R):"async"==e?L(D):"@"==t?L(z,D):_(P("stat"),z,B(";"),R)}function F(e){if("("==e)return L(Oe,B(")"))}function z(e,t){return H(e,t,!1)}function W(e,t){return H(e,t,!0)}function q(e){return"("!=e?_():L(P(")"),z,B(")"),R)}function H(e,t,r){if(S.state.fatArrowAt==S.stream.start){var n=r?X:G;if("("==e)return L(E,P(")"),ne(Oe,")"),R,B("=>"),n,I);if("variable"==e)return _(E,ye,B("=>"),n,I)}var i,o=r?U:K;return w.hasOwnProperty(e)?L(o):"function"==e?L(Me,o):"class"==e||c&&"interface"==t?(S.marked="keyword",L(P("form"),Ee,R)):"keyword c"==e||"async"==e?L(r?W:z):"("==e?L(P(")"),j,B(")"),R,o):"operator"==e||"spread"==e?L(r?W:z):"["==e?L(P("]"),je,R,o):"{"==e?ie(ee,"}",null,o):"quasi"==e?_(V,o):"new"==e?L((i=r,function(e){return"."==e?L(i?Q:Y):"variable"==e&&c?L(pe,i?U:K):_(i?W:z)})):"import"==e?L(z):L()}function j(e){return e.match(/[;\}\)\],]/)?_():_(z)}function K(e,t){return","==e?L(z):U(e,t,!1)}function U(e,t,r){var n=0==r?K:U,i=0==r?z:W;return"=>"==e?L(E,r?X:G,I):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?L(n):c&&"<"==t&&S.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?L(P(">"),ne(ce,">"),R,n):"?"==t?L(z,B(":"),i):L(i):"quasi"==e?_(V,n):";"!=e?"("==e?ie(W,")","call",n):"."==e?L(Z,n):"["==e?L(P("]"),j,B("]"),R,n):c&&"as"==t?(S.marked="keyword",L(ce,n)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),L(i)):void 0:void 0}function V(e,t){return"quasi"!=e?_():"${"!=t.slice(t.length-2)?L(V):L(z,$)}function $(e){if("}"==e)return S.marked="string-2",S.state.tokenize=b,L(V)}function G(e){return o(S.stream,S.state),_("{"==e?D:z)}function X(e){return o(S.stream,S.state),_("{"==e?D:W)}function Y(e,t){if("target"==t)return S.marked="keyword",L(K)}function Q(e,t){if("target"==t)return S.marked="keyword",L(U)}function J(e){return":"==e?L(R,D):_(K,B(";"),R)}function Z(e){if("variable"==e)return S.marked="property",L()}function ee(e,t){if("async"==e)return S.marked="property",L(ee);if("variable"==e||"keyword"==S.style){return S.marked="property","get"==t||"set"==t?L(te):(c&&S.state.fatArrowAt==S.stream.start&&(r=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+r[0].length),L(re));var r}else{if("number"==e||"string"==e)return S.marked=a?"property":S.style+" property",L(re);if("jsonld-keyword"==e)return L(re);if(c&&T(t))return S.marked="keyword",L(ee);if("["==e)return L(z,ae,B("]"),re);if("spread"==e)return L(W,re);if("*"==t)return S.marked="keyword",L(ee);if(":"==e)return _(re)}}function te(e){return"variable"!=e?_(re):(S.marked="property",L(Me))}function re(e){return":"==e?L(W):"("==e?_(Me):void 0}function ne(n,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var r=S.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),L(function(e,t){return e==i||t==i?_():_(n)},a)}return e==i||t==i?L():o&&-1<o.indexOf(";")?_(n):L(B(i))}return function(e,t){return e==i||t==i?L():_(n,a)}}function ie(e,t,r){for(var n=3;n<arguments.length;n++)S.cc.push(arguments[n]);return L(P(t,r),ne(e,t),R)}function oe(e){return"}"==e?L():_(D,oe)}function ae(e,t){if(c){if(":"==e||"in"==t)return L(ce);if("?"==t)return L(ae)}}function se(e){if(c&&":"==e)return S.stream.match(/^\s*\w+\s+is\b/,!1)?L(z,le,ce):L(ce)}function le(e,t){if("is"==t)return S.marked="keyword",L()}function ce(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(S.marked="keyword",L("typeof"==t?W:ce)):"variable"==e||"void"==t?(S.marked="type",L(he)):"|"==t||"&"==t?L(ce):"string"==e||"number"==e||"atom"==e?L(he):"["==e?L(P("]"),ne(ce,"]",","),R,he):"{"==e?L(P("}"),ne(fe,"}",",;"),R,he):"("==e?L(ne(de,")"),ue,he):"<"==e?L(ne(ce,">"),ce):void 0}function ue(e){if("=>"==e)return L(ce)}function fe(e,t){return"variable"==e||"keyword"==S.style?(S.marked="property",L(fe)):"?"==t||"number"==e||"string"==e?L(fe):":"==e?L(ce):"["==e?L(B("variable"),ae,B("]"),fe):"("==e?_(Te,fe):void 0}function de(e,t){return"variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?L(de):":"==e?L(ce):"spread"==e?L(de):_(ce)}function he(e,t){return"<"==t?L(P(">"),ne(ce,">"),R,he):"|"==t||"."==e||"&"==t?L(ce):"["==e?L(ce,B("]"),he):"extends"==t||"implements"==t?(S.marked="keyword",L(ce)):"?"==t?L(ce,B(":"),ce):void 0}function pe(e,t){if("<"==t)return L(P(">"),ne(ce,">"),R,he)}function me(){return _(ce,ge)}function ge(e,t){if("="==t)return L(ce)}function ve(e,t){return"enum"==t?(S.marked="keyword",L(Ke)):_(ye,ae,we,ke)}function ye(e,t){return c&&T(t)?(S.marked="keyword",L(ye)):"variable"==e?(r(t),L()):"spread"==e?L(ye):"["==e?ie(xe,"]"):"{"==e?ie(be,"}"):void 0}function be(e,t){return"variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?L(ye):"}"==e?_():"["==e?L(z,B("]"),B(":"),be):L(B(":"),ye,we)):(r(t),L(we))}function xe(){return _(ye,we)}function we(e,t){if("="==t)return L(W)}function ke(e){if(","==e)return L(ve)}function Ce(e,t){if("keyword b"==e&&"else"==t)return L(P("form","else"),D,R)}function Se(e,t){return"await"==t?L(Se):"("==e?L(P(")"),_e,R):void 0}function _e(e){return"var"==e?L(ve,Le):"variable"==e?L(Le):_(Le)}function Le(e,t){return")"==e?L():";"==e?L(Le):"in"==t||"of"==t?(S.marked="keyword",L(z,Le)):_(z,Le)}function Me(e,t){return"*"==t?(S.marked="keyword",L(Me)):"variable"==e?(r(t),L(Me)):"("==e?L(E,P(")"),ne(Oe,")"),R,se,D,I):c&&"<"==t?L(P(">"),ne(me,">"),R,Me):void 0}function Te(e,t){return"*"==t?(S.marked="keyword",L(Te)):"variable"==e?(r(t),L(Te)):"("==e?L(E,P(")"),ne(Oe,")"),R,se,I):c&&"<"==t?L(P(">"),ne(me,">"),R,Te):void 0}function Ae(e,t){return"keyword"==e||"variable"==e?(S.marked="type",L(Ae)):"<"==t?L(P(">"),ne(me,">"),R):void 0}function Oe(e,t){return"@"==t&&L(z,Oe),"spread"==e?L(Oe):c&&T(t)?(S.marked="keyword",L(Oe)):c&&"this"==e?L(ae,we):_(ye,ae,we)}function Ee(e,t){return"variable"==e?Ne(e,t):Ie(e,t)}function Ne(e,t){if("variable"==e)return r(t),L(Ie)}function Ie(e,t){return"<"==t?L(P(">"),ne(me,">"),R,Ie):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(S.marked="keyword"),L(c?ce:z,Ie)):"{"==e?L(P("}"),Pe,R):void 0}function Pe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&T(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",L(Pe)):"variable"==e||"keyword"==S.style?(S.marked="property",L(c?Re:Me,Pe)):"number"==e||"string"==e?L(c?Re:Me,Pe):"["==e?L(z,ae,B("]"),c?Re:Me,Pe):"*"==t?(S.marked="keyword",L(Pe)):c&&"("==e?_(Te,Pe):";"==e||","==e?L(Pe):"}"==e?L():"@"==t?L(z,Pe):void 0}function Re(e,t){if("?"==t)return L(Re);if(":"==e)return L(ce,we);if("="==t)return L(W);var r=S.state.lexical.prev;return _(r&&"interface"==r.info?Te:Me)}function Be(e,t){return"*"==t?(S.marked="keyword",L(He,B(";"))):"default"==t?(S.marked="keyword",L(z,B(";"))):"{"==e?L(ne(De,"}"),He,B(";")):_(D)}function De(e,t){return"as"==t?(S.marked="keyword",L(B("variable"))):"variable"==e?_(W,De):void 0}function Fe(e){return"string"==e?L():"("==e?_(z):_(ze,We,He)}function ze(e,t){return"{"==e?ie(ze,"}"):("variable"==e&&r(t),"*"==t&&(S.marked="keyword"),L(qe))}function We(e){if(","==e)return L(ze,We)}function qe(e,t){if("as"==t)return S.marked="keyword",L(ze)}function He(e,t){if("from"==t)return S.marked="keyword",L(z)}function je(e){return"]"==e?L():_(ne(W,"]"))}function Ke(){return _(P("form"),ye,B("{"),P("}"),ne(Ue,"}"),R,R)}function Ue(){return _(ye,we)}function Ve(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return R.lex=I.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-d,0,"block",!1),localVars:f.localVars,context:f.localVars&&new A(null,null,!1),indented:e||0};return f.globalVars&&"object"==typeof f.globalVars&&(t.globalVars=f.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),o(e,t)),t.tokenize!=y&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",function(e,t,r,n,i){var o=e.cc;for(S.state=e,S.stream=i,S.marked=null,S.cc=o,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?z:D)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==r&&C(e,n)?"variable-2":t}}(t,r,n,i,e))},indent:function(e,t){if(e.tokenize==y)return $e.Pass;if(e.tokenize!=v)return 0;var r,n=t&&t.charAt(0),i=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var a=e.cc[o];if(a==R)i=i.prev;else if(a!=Ce)break}for(;("stat"==i.type||"form"==i.type)&&("}"==n||(r=e.cc[e.cc.length-1])&&(r==K||r==U)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;h&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var s,l,c=i.type,u=n==c;return"vardef"==c?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==c&&"{"==n?i.indented:"form"==c?i.indented+d:"stat"==c?i.indented+(l=t,"operator"==(s=e).lastType||","==s.lastType||p.test(l.charAt(0))||/[,.]/.test(l.charAt(0))?h||d:0):"switch"!=i.info||u||0==f.doubleIndentSwitch?i.align?i.column+(u?0:1):i.indented+(u?0:d):i.indented+(/^(?:case|default)\b/.test(t)?d:2*d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:a,jsonMode:s,expressionAllowed:Ve,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=z&&t!=W||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(O){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}O.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=O.resolveMode("text/css"));var n,i,o=e.indentUnit,a=t.tokenHooks,s=t.documentTypes||{},l=t.mediaTypes||{},c=t.mediaFeatures||{},u=t.mediaValueKeywords||{},f=t.propertyKeywords||{},d=t.nonStandardPropertyKeywords||{},h=t.fontProperties||{},p=t.counterDescriptors||{},m=t.colorKeywords||{},g=t.valueKeywords||{},v=t.allowNested,y=t.lineComment,b=!0===t.supportsAtComponent;function x(e,t){return n=t,e}function w(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return(r==i||!n&&")"!=i)&&(t.tokenize=null),x("string","string")}}function k(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=w(")"),x(null,"(")}function C(e,t,r){this.type=e,this.indent=t,this.prev=r}function S(e,t,r,n){return e.context=new C(r,t.indentation()+(!1===n?0:o),e.context),r}function _(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function L(e,t,r){return A[r.context.type](e,t,r)}function M(e,t,r,n){for(var i=n||1;0<i;i--)r.context=r.context.prev;return L(e,t,r)}function T(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var A={top:function(e,t,r){if("{"==e)return S(r,t,"block");if("}"==e&&r.context.prev)return _(r);if(b&&/@component/i.test(e))return S(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return S(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return S(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return S(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return S(r,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return S(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?A.top(e,t,r):(i="error","block");var n=t.current().toLowerCase();return f.hasOwnProperty(n)?(i="property","maybeprop"):d.hasOwnProperty(n)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,r){return":"==e?S(r,t,"prop"):L(e,t,r)},prop:function(e,t,r){if(";"==e)return _(r);if("{"==e&&v)return S(r,t,"propBlock");if("}"==e||"{"==e)return M(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)T(t);else if("interpolation"==e)return S(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?_(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?M(e,t,r):")"==e?_(r):"("==e?S(r,t,"parens"):"interpolation"==e?S(r,t,"interpolation"):("word"==e&&T(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):L(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(i="tag",r.context.type):A.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return S(r,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,r);if("{"==e)return _(r)&&S(r,t,v?"block":"top");if("interpolation"==e)return S(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();i="only"==n||"not"==n||"and"==n||"or"==n?"keyword":l.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":u.hasOwnProperty(n)?"keyword":f.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?M(e,t,r):"{"==e?_(r)&&S(r,t,v?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?_(r):"{"==e||"}"==e?M(e,t,r,2):A.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?S(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):L(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,_(r)):"word"==e?(i="@font-face"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?S(r,t,"top"):L(e,t,r)},at:function(e,t,r){return";"==e?_(r):"{"==e||"}"==e?M(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?_(r):"{"==e||";"==e?M(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new C(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(a[r]){var n=a[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),x("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?x(null,"compare"):'"'==r||"'"==r?(t.tokenize=w(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==r?(e.match(/^\s*\w*/),x("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),x("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?x(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?x(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=k),x("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(n=r[1],r=r[0]),i=r,"comment"!=n&&(t.state=A[t.state](n,e,t)),i},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-o)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],r=e(t),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(n),o=["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"],a=e(o),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],l=e(s),c=["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","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","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","justify-items","justify-self","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","mix-blend-mode","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","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","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"],u=e(c),f=["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"],d=e(f),h=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["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"],g=e(m),v=["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","self-start","self-end","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","space-evenly","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"],y=e(v),b=t.concat(n).concat(o).concat(s).concat(c).concat(f).concat(m).concat(v);function x(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}O.registerHelper("hintWords","css",b),O.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x)(e,t)}},name:"css"}),O.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,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"}),O.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x)(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/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),O.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:u,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x)(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(p){"use strict";var i={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var o={};function m(e,t){var r,n=e.match(o[r=t]||(o[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function a(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;0<=o;o--)n.unshift(i[o])}p.defineMode("htmlmixed",function(u,e){var f=p.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),d={},t=e&&e.tags,r=e&&e.scriptTypes;if(a(i,d),t&&a(t,d),r)for(var n=r.length-1;0<=n;n--)d.script.unshift(["type",r[n].matches,r[n].mode]);function h(e,t){var r,n=f.token(e,t.htmlState),i=/\btag\b/.test(n);if(i&&!/[<>\s\/]/.test(e.current())&&(r=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(r))t.inTag=r+" ";else if(t.inTag&&i&&/>$/.test(e.current())){var o=/^([\S]+) (.*)/.exec(t.inTag);t.inTag=null;var a=">"==e.current()&&function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(m(t,n[0])))return n[2]}}(d[o[1]],o[2]),s=p.getMode(u,a),l=g(o[1],!0),c=g(o[1],!1);t.token=function(e,t){return e.match(l,!1)?(t.token=h,t.localState=t.localMode=null,null):(r=e,n=c,i=t.localMode.token(e,t.localState),o=r.current(),-1<(a=o.search(n))?r.backUp(o.length-a):o.match(/<\/?$/)&&(r.backUp(o.length),r.match(n,!1)||r.match(o)),i);var r,n,i,o,a},t.localMode=s,t.localState=p.startState(s,f.indent(t.htmlState,"",""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return n}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:p.startState(f)}},copyState:function(e){var t;return e.localState&&(t=p.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:p.copyState(f,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t,r){return!e.localMode||/^\s*<\//.test(t)?f.indent(e.htmlState,t,r):e.localMode.indent?e.localMode.indent(e.localState,t,r):p.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||f}}}},"xml","javascript","css"),p.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(O){"use strict";function E(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 N(e,t,r,n){var i=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(i=e.context.indented),e.context=new E(i,t,r,n,null,e.context)}function I(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function P(e,t,r){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,r))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function R(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function B(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}O.defineMode("clike",function(e,s){var a,l,c=e.indentUnit,u=s.statementIndentUnit||c,f=s.dontAlignCalls,d=s.keywords||{},h=s.types||{},p=s.builtin||{},m=s.blockKeywords||{},g=s.defKeywords||{},v=s.atoms||{},y=s.hooks||{},b=s.multiLineStrings,o=!1!==s.indentStatements,t=!1!==s.indentSwitch,x=s.namespaceSeparator,w=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,k=s.numberStart||/[\d\.]/,C=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,S=s.isOperatorChar||/[+\-*&%=<>!?|\/]/,_=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/,L=s.isReservedIdentifier||!1;function M(e,t){var o,r=e.next();if(y[r]){var n=y[r](e,t);if(!1!==n)return n}if('"'==r||"'"==r)return t.tokenize=(o=r,function(e,t){for(var r,n=!1,i=!1;null!=(r=e.next());){if(r==o&&!n){i=!0;break}n=!n&&"\\"==r}return(i||!n&&!b)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(w.test(r))return a=r,null;if(k.test(r)){if(e.backUp(1),e.match(C))return"number";e.next()}if("/"==r){if(e.eat("*"))return(t.tokenize=T)(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(S.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(S););return"operator"}if(e.eatWhile(_),x)for(;e.match(x);)e.eatWhile(_);var i=e.current();return B(d,i)?(B(m,i)&&(a="newstatement"),B(g,i)&&(l=!0),"keyword"):B(h,i)?"type":B(p,i)||L&&L(i)?(B(m,i)&&(a="newstatement"),"builtin"):B(v,i)?"atom":"variable"}function T(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function A(e,t){s.typeFirstDefinitions&&e.eol()&&R(t.context)&&(t.typeAtEndOfLine=P(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new E((e||0)-c,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return A(e,t),null;a=l=null;var n=(t.tokenize||M)(e,t);if("comment"==n||"meta"==n)return n;if(null==r.align&&(r.align=!0),";"==a||":"==a||","==a&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)I(t);else if("{"==a)N(t,e.column(),"}");else if("["==a)N(t,e.column(),"]");else if("("==a)N(t,e.column(),")");else if("}"==a){for(;"statement"==r.type;)r=I(t);for("}"==r.type&&(r=I(t));"statement"==r.type;)r=I(t)}else a==r.type?I(t):o&&(("}"==r.type||"top"==r.type)&&";"!=a||"statement"==r.type&&"newstatement"==a)&&N(t,e.column(),"statement",e.current());if("variable"==n&&("def"==t.prevToken||s.typeFirstDefinitions&&P(e,t,e.start)&&R(t.context)&&e.match(/^\s*\(/,!1))&&(n="def"),y.token){var i=y.token(e,t,n);void 0!==i&&(n=i)}return"def"==n&&!1===s.styleDefs&&(n="variable"),t.startOfLine=!1,t.prevToken=l?"def":n||a,A(e,t),n},indent:function(e,t){if(e.tokenize!=M&&null!=e.tokenize||e.typeAtEndOfLine)return O.Pass;var r=e.context,n=t&&t.charAt(0),i=n==r.type;if("statement"==r.type&&"}"==n&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(y.indent){var o=y.indent(e,r,t,c);if("number"==typeof o)return o}var a=r.prev&&"switch"==r.prev.info;if(s.allmanIndentation&&/[{(]/.test(n)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==n?0:u):!r.align||f&&")"==r.type?")"!=r.type||i?r.indented+(i?0:c)+(i||!a||/^(?:case|default)\b/.test(t)?0:c):r.indented+u:r.column+(i?0:1)},electricInput:t?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var t="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",r=e("int long char short double float unsigned signed void bool"),n=e("SEL instancetype id Class Protocol BOOL");function i(e){return B(r,e)||/.+_t/.test(e)}var o="case do else for if switch while struct enum union",a="struct enum union";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 l(e,t){return"type"==t.prevToken&&"type"}function c(e){return!(!e||e.length<2)&&("_"==e[0]&&("_"==e[1]||e[1]!==e[1].toLowerCase()))}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=h)(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function d(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 p(e,t){"string"==typeof e&&(e=[e]);var r=[];function n(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}n(t.keywords),n(t.types),n(t.builtin),n(t.atoms),r.length&&(t.helperType=e[0],O.registerHelper("hintWords",e[0],r));for(var i=0;i<e.length;++i)O.defineMIME(e[i],t)}function m(e,t){for(var r=!1;!e.eol();){if(!r&&e.match('"""')){t.tokenize=null;break}r="\\"==e.next()&&!r}return"string"}p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:e(t),types:i,blockKeywords:e(o),defKeywords:e(a),typeFirstDefinitions:!0,atoms:e("NULL true false"),isReservedIdentifier:c,hooks:{"#":s,"*":l},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:e(t+"alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq"),types:i,blockKeywords:e(o+" class try catch"),defKeywords:e(a+" class namespace"),typeFirstDefinitions:!0,atoms:e("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:c,hooks:{"#":s,"*":l,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)&&(n=e.current(),(i=/(\w+)::~?(\w+)$/.exec(n))&&i[1]==i[2]))return"def";var n,i}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:e("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:e("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:e("catch class do else finally for if switch try while"),defKeywords:e("class interface enum @interface"),typeFirstDefinitions:!0,atoms:e("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"]}}),p("text/x-csharp",{name:"clike",keywords:e("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:e("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:e("catch class do else finally for foreach if struct switch try while"),defKeywords:e("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=d)(e,t):(e.eatWhile(/[\w\$_]/),"meta")}}}),p("text/x-scala",{name:"clike",keywords:e("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:e("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:e("catch class enum do else finally for forSome if match switch try while"),defKeywords:e("class enum def object package trait type val var"),atoms:e("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=m,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,t){var r=t.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(t.context=new E(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function n(i){return function(e,t){for(var r;r=e.next();){if("*"==r&&e.eat("/")){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=null;break}if("/"==r&&e.eat("*"))return t.tokenize=n(i+1),t.tokenize(e,t)}return"comment"}}(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),p("text/x-kotlin",{name:"clike",keywords:e("package as typealias class interface this super val operator var fun for is in This throw return annotation 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 actual expect setparam"),types:e("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 Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:e("catch class do else finally for if where try while enum"),defKeywords:e("class val var object interface fun"),atoms:e("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){var o;return t.tokenize=(o=e.match('""'),function(e,t){for(var r,n=!1,i=!1;!e.eol();){if(!o&&!n&&e.match('"')){i=!0;break}if(o&&e.match('"""')){i=!0;break}r=e.next(),!n&&"$"==r&&e.match("{")&&e.skipTo("}"),n=!n&&"\\"==r&&!o}return!i&&o||(t.tokenize=null),"string"}),t.tokenize(e,t)},indent:function(e,t,r,n){var i=r&&r.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=r?"operator"==e.prevToken&&"}"!=r||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*n+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(r||"").charAt(0)?0:n):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),p(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:e("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:e("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:e("for while do if else struct"),builtin:e("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:e("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"]}}),p("text/x-nesc",{name:"clike",keywords:e(t+" 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:i,blockKeywords:e(o),atoms:e("null true false"),hooks:{"#":s},modeProps:{fold:["brace","include"]}}),p("text/x-objectivec",{name:"clike",keywords:e(t+" bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available"),types:function(e){return i(e)||B(n,e)},builtin:e("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINED NS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT"),blockKeywords:e(o+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:e(a+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:e("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:c,hooks:{"#":s,"*":l},modeProps:{fold:["brace","include"]}}),p("text/x-squirrel",{name:"clike",keywords:e("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:i,blockKeywords:e("case catch class else for foreach if switch try while"),defKeywords:e("function local class"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"#":s},modeProps:{fold:["brace","include"]}});var g=null;p("text/x-ceylon",{name:"clike",keywords:e("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:e("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:e("class dynamic function interface module object package value"),builtin:e("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:e("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=function o(a){return function(e,t){for(var r,n=!1,i=!1;!e.eol();){if(!n&&e.match('"')&&("single"==a||e.match('""'))){i=!0;break}if(!n&&e.match("``")){g=o(a),i=!0;break}r=e.next(),n="single"==a&&!n&&"\\"==r}return i&&(t.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!g||!e.match("`"))&&(t.tokenize=g,g=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,r){if(("variable"==r||"type"==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(c){"use strict";function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function s(i,o,a){return 0==i.length?l(o):function(e,t){for(var r=i[0],n=0;n<r.length;n++)if(e.match(r[n][0]))return t.tokenize=s(i.slice(1),o),r[n][1];return t.tokenize=l(o,a),"string"}}function l(r,n){return function(e,t){return function(e,t,r,n){if(!1!==n&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(!1!==n&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=s([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,n)),e.match(/\-\>\w/,!1)&&(t.tokenize=s([[["->",null]],[[/[\w]+/,"variable"]]],r,n)),"variable-2";var i=!1;for(;!e.eol()&&(i||!1===n||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!i&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}i="\\"==e.next()&&!i}return"string"}(e,t,r,n)}}var t="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",r="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="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";c.registerHelper("hintWords","php",[t,r,n].join(" ").split(" ")),c.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:e(t),blockKeywords:e("catch do else elseif for foreach if switch try while finally"),defKeywords:e("class function interface namespace trait"),atoms:e(r),builtin:e(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var r;if(r=e.match(/<<\s*/)){var n=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var i=e.current().slice(r[0].length+(n?2:1));if(n&&e.eat(n),i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=l(i,"'"!=n),"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=l('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&0<t.tokStack.length&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=l(t.tokStack[t.tokStack.length-2])),!1}}};c.defineMode("php",function(e,r){var s=c.getMode(e,r&&r.htmlMode||"text/html"),l=c.getMode(e,i);return{startState:function(){var e=c.startState(s),t=r.startOpen?c.startState(l):null;return{html:e,php:t,curMode:r.startOpen?l:s,curState:r.startOpen?t:e,pending:null}},copyState:function(e){var t,r=e.html,n=c.copyState(s,r),i=e.php,o=i&&c.copyState(l,i);return t=e.curMode==s?n:o,{html:n,php:o,curMode:e.curMode,curState:t,pending:e.pending}},token:function(e,t){var r=t.curMode==l;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),r)return r&&null==t.php.tokenize&&e.match("?>")?(t.curMode=s,t.curState=t.html,t.php.context.prev||(t.php=null),"meta"):l.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=l,t.php||(t.php=c.startState(l,s.indent(t.html,"",""))),t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var n="string"}else n=t.pending&&e.pos<t.pending.end?(e.pos=t.pending.end,t.pending.style):s.token(e,t.curState);t.pending&&(t.pending=null);var i,o=e.current(),a=o.search(/<\?/);return-1!=a&&("string"==n&&(i=o.match(/[\'\"]$/))&&!/\?>/.test(o)?t.pending=i[0]:t.pending={end:e.pos,style:n},e.backUp(o.length-a)),n},indent:function(e,t,r){return e.curMode!=l&&/^\s*<\//.test(t)||e.curMode==l&&/^\?>/.test(t)?s.indent(e.html,t,r):e.curMode.indent(e.curState,t,r)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),c.defineMIME("application/x-httpd-php","php"),c.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),c.defineMIME("text/x-php",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";var C={allowUnquoted:!0,allowMissing:!0,caseFold:!0};e.defineMode("shortcode",function(e,t){var a,s,o=e.indentUnit,l={},r=C;for(var n in r)l[n]=r[n];for(var i in t)l[i]=t[i];function c(e,t){return"["===e.next()?"["===e.peek()?(t.tokenize=u,"comment"):/\s/.test(e.peek())?null:(a=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):(e.eatWhile(/[^\[]/),null)}function u(e,t){var r=function(e,t){return e.next(),t.tokenize=c,"comment"};return r.isInEscape=!0,"]"===e.next()&&"]"===e.peek()&&(t.tokenize=r),e.eatWhile(/[^\]]/),null}function f(e,t){var r=e.next();if("]"===r||"/"===r&&e.eat("]"))return t.tokenize=c,a="endTag","tag bracket";if("="===r)return a="equals",null;if("["!==r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){var r=e.next();return r===n?(t.tokenize=f,"string"):/[\[\]]/.test(r)?"string error":(e.eatWhile(/[^\[\]\'\"]/),"string")}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=\[\]\"\']*[^\s\u00a0=\[\]\"\'\/]/),"word");t.tokenize=c,t.state=p,t.tagName=t.tagStart=null;var n,i,o=t.tokenize(e,t);return o?o+" tag error":"tag error"}function d(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 h(e){e.context&&(e.context=e.context.prev)}function p(e,t,r){return"openTag"===e?(r.tagStart=t.column(),m):"closeTag"===e?g:p}function m(e,t,r){if("word"!==e)return s="error",m;var n=t.current();return s=/[\[\]\/\'\"<>&]/.test(n)?"error":(r.tagName=t.current(),"tag"),b}function g(e,t,r){if("word"!==e)return s="error",y;var n=t.current();if(r.context&&r.context.tagName===n||!1===l.matchClosing)return s="tag",v;if(r.context&&0<r.context.tagHistory.indexOf(n)){for(var i=r.context.tagHistory.indexOf(n),o=0;o<i;o++)h(r);return s="tag",v}return s="tag error",y}function v(e,t,r){return"endTag"!==e?(s="error",v):(h(r),p)}function y(e,t,r){return s="error",v(e,0,r)}function b(e,t,r){if("word"===e)return s=/^[a-z0-9_\-]+$/i.test(t.current())?"attribute":"error",x;if("endTag"!==e)return s="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,r.context=new d(r,n,i===r.indented),p}function x(e,t,r){return"equals"===e?w:(l.allowMissing||(s="error"),b(e,t,r))}function w(e,t,r){return"string"===e?k:"word"===e&&l.allowUnquoted?(s="string",b):(s="error",b(e,t,r))}function k(e,t,r){return"string"===e?k:b(e,t,r)}return u.isInEscape=c.isInText=!0,{startState:function(e){var t={tokenize:c,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;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!==r&&(s=null,t.state=t.state(a||r,e,t),s&&(r="error"===s?r+" error":s)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart===e.indented?e.stringStartCol+1:e.indented+o;if(e.tokenize!==f&&e.tokenize!==c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+o*(l.multilineTagIndentFactor||1);var i=t&&/^\[(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n&&n.tagName===i[2];){n=n.prev;break}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+o:e.baseIndent||0},skipAttribute:function(e){e.state===w&&(e.state=b)}}})}),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(r){"use strict";r.defineMode("wordpresspost",function(e,t){var a=r.getMode(e,{name:"htmlmixed",multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag}),s=r.getMode(e,{name:"shortcode",multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag});function l(e,t){t.isInShortcode=!0;var r=s.token(e,t.shortcodeState),n=t.shortcodeState.tokenize.isInText,i=t.shortcodeState.tokenize.isInEscape;if(n)t.token=c;else if(i&&/\]/.test(e.current())){var o=e.current(),a=o.search(/\]/);e.backUp(o.length-a-1),"]"!==e.peek()&&(t.token=c)}return r}function c(e,t){t.isInShortcode=!1;var r=a.token(e,t.htmlmixedState),n=t.htmlmixedState.htmlState.tokenize.isInText;if(n&&/\[/.test(e.current())&&!t.htmlmixedState.localState&&null===r){var i=e.current(),o=i.search(/\[/);e.backUp(i.length-o),null==t.shortcodeState&&(t.shortcodeState=s.startState(a.indent(t.htmlmixedState,""))),t.token=l}else n&&/<!\-\-more|<!\-\-(noteaser|nextpage)\-\->?/.test(e.current())&&!t.htmlmixedState.localState&&"comment"===r&&(e.backUp(e.current().length),t.token=u);return r}function u(e,t){return e.match("\x3c!--more")?"meta":e.match("--\x3e")||e.match("\x3c!--noteaser--\x3e")||e.match("\x3c!--nextpage--\x3e")?(t.token=c,"meta"):(e.eatWhile(/[^\-/]/),"string")}return{startState:function(){return{token:c,isInShortcode:!1,shortcodeState:null,htmlmixedState:a.startState()}},copyState:function(e){var t;return e.shortcodeState&&(t=r.copyState(s,e.shortcodeState)),{token:e.token,shortcodeState:t,htmlmixedState:r.copyState(a,e.htmlmixedState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.isInShortcode?e.isInShortcode?s.indent(e.shortcodeState,t):r.Pass:a.indent(e.htmlmixedState,t)},innerMode:function(e){return e.isInShortcode?{state:e.shortcodeState,mode:s}:{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(i){"use strict";var s="CodeMirror-activeline",l="CodeMirror-activeline-background",c="CodeMirror-activeline-gutter";function u(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",s),e.removeLineClass(e.state.activeLines[t],"background",l),e.removeLineClass(e.state.activeLines[t],"gutter",c)}function o(t,e){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=t.getOption("styleActiveLine");if("object"==typeof o&&o.nonEmpty?i.anchor.line==i.head.line:i.empty()){var a=t.getLineHandleVisualStart(i.head.line);r[r.length-1]!=a&&r.push(a)}}(function(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})(t.state.activeLines,r)||t.operation(function(){u(t);for(var e=0;e<r.length;e++)t.addLineClass(r[e],"wrap",s),t.addLineClass(r[e],"background",l),t.addLineClass(r[e],"gutter",c);t.state.activeLines=r})}function a(e,t){o(e,t.ranges)}i.defineOption("styleActiveLine",!1,function(e,t,r){var n=r!=i.Init&&r;t!=n&&(n&&(e.off("beforeSelectionChange",a),u(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";var v,y,b=i.Pos;function p(e,t){for(var r,n,i=null!=(n=(r=e).flags)?n:(r.ignoreCase?"i":"")+(r.global?"g":"")+(r.multiline?"m":""),o=i,a=0;a<t.length;a++)-1==o.indexOf(t.charAt(a))&&(o+=t.charAt(a));return i==o?e:new RegExp(e.source,o)}function m(e,t,r){t=p(t,"g");for(var n=r.line,i=r.ch,o=e.lastLine();n<=o;n++,i=0){t.lastIndex=i;var a=e.getLine(n),s=t.exec(a);if(s)return{from:b(n,s.index),to:b(n,s.index+s[0].length),match:s}}}function g(e,t){for(var r,n=0;;){t.lastIndex=n;var i=t.exec(e);if(!i)return r;if((n=(r=i).index+(r[0].length||1))==e.length)return r}}function x(e,t,r,n){if(e.length==t.length)return r;for(var i=0,o=r+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=n(e.slice(0,a)).length;if(s==r)return a;r<s?o=a:i=a+1}}function n(r,n,e,t){var i;this.atOccurrence=!1,this.doc=r,e=e?r.clipPos(e):b(0,0),this.pos={from:e,to:e},"object"==typeof t?i=t.caseFold:(i=t,t=null),"string"==typeof n?(null==i&&(i=!1),this.matches=function(e,t){return(e?function(e,t,r,n){if(!t.length)return null;var i=n?v:y,o=i(t).split(/\r|\n\r?/);e:for(var a=r.line,s=r.ch,l=e.firstLine()-1+o.length;l<=a;a--,s=-1){var c=e.getLine(a);-1<s&&(c=c.slice(0,s));var u=i(c);if(1==o.length){var f=u.lastIndexOf(o[0]);if(-1==f)continue e;return{from:b(a,x(c,u,f,i)),to:b(a,x(c,u,f+o[0].length,i))}}var d=o[o.length-1];if(u.slice(0,d.length)==d){var h=1;for(r=a-o.length+1;h<o.length-1;h++)if(i(e.getLine(r+h))!=o[h])continue e;var p=e.getLine(a+1-o.length),m=i(p);if(m.slice(m.length-o[0].length)==o[0])return{from:b(a+1-o.length,x(p,m,p.length-o[0].length,i)),to:b(a,x(c,u,d.length,i))}}}}:function(e,t,r,n){if(!t.length)return null;var i=n?v:y,o=i(t).split(/\r|\n\r?/);e:for(var a=r.line,s=r.ch,l=e.lastLine()+1-o.length;a<=l;a++,s=0){var c=e.getLine(a).slice(s),u=i(c);if(1==o.length){var f=u.indexOf(o[0]);if(-1==f)continue e;return r=x(c,u,f,i)+s,{from:b(a,x(c,u,f,i)+s),to:b(a,x(c,u,f+o[0].length,i)+s)}}var d=u.length-o[0].length;if(u.slice(d)==o[0]){for(var h=1;h<o.length-1;h++)if(i(e.getLine(a+h))!=o[h])continue e;var p=e.getLine(a+o.length-1),m=i(p),g=o[o.length-1];if(m.slice(0,g.length)==g)return{from:b(a,x(c,u,d,i)+s),to:b(a+o.length-1,x(p,m,g.length,i))}}}})(r,n,t,i)}):(n=p(n,"gm"),t&&!1===t.multiline?this.matches=function(e,t){return(e?function(e,t,r){t=p(t,"g");for(var n=r.line,i=r.ch,o=e.firstLine();o<=n;n--,i=-1){var a=e.getLine(n);-1<i&&(a=a.slice(0,i));var s=g(a,t);if(s)return{from:b(n,s.index),to:b(n,s.index+s[0].length),match:s}}}:m)(r,n,t)}:this.matches=function(e,t){return(e?function(e,t,r){t=p(t,"gm");for(var n,i=1,o=r.line,a=e.firstLine();a<=o;){for(var s=0;s<i;s++){var l=e.getLine(o--);n=null==n?l.slice(0,r.ch):l+"\n"+n}i*=2;var c=g(n,t);if(c){var u=n.slice(0,c.index).split("\n"),f=c[0].split("\n"),d=o+u.length,h=u[u.length-1].length;return{from:b(d,h),to:b(d+f.length-1,1==f.length?h+f[0].length:f[f.length-1].length),match:c}}}}:function(e,t,r){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source))return m(e,t,r);t=p(t,"gm");for(var n,i=1,o=r.line,a=e.lastLine();o<=a;){for(var s=0;s<i&&!(a<o);s++){var l=e.getLine(o++);n=null==n?l:n+"\n"+l}i*=2,t.lastIndex=r.ch;var c=t.exec(n);if(c){var u=n.slice(0,c.index).split("\n"),f=c[0].split("\n"),d=r.line+u.length-1,h=u[u.length-1].length;return{from:b(d,h),to:b(d+f.length-1,1==f.length?h+f[0].length:f[f.length-1].length),match:c}}}})(r,n,t)})}y=String.prototype.normalize?(v=function(e){return e.normalize("NFD").toLowerCase()},function(e){return e.normalize("NFD")}):(v=function(e){return e.toLowerCase()},function(e){return e}),n.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){for(var t=this.matches(e,this.doc.clipPos(e?this.pos.from:this.pos.to));t&&0==i.cmpPos(t.from,t.to);)e?t.from.ch?t.from=b(t.from.line,t.from.ch-1):t=t.from.line==this.doc.firstLine()?null:this.matches(e,this.doc.clipPos(b(t.from.line-1))):t.to.ch<this.doc.getLine(t.to.line).length?t.to=b(t.to.line,t.to.ch+1):t=t.to.line==this.doc.lastLine()?null:this.matches(e,b(t.to.line+1,0));if(t)return this.pos=t,this.atOccurrence=!0,this.pos.match||!0;var r=b(e?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:r,to:r},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e,t){if(this.atOccurrence){var r=i.splitLines(e);this.doc.replaceRange(r,this.pos.from,this.pos.to,t),this.pos.to=b(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},i.defineExtension("getSearchCursor",function(e,t,r){return new n(this.doc,e,t,r)}),i.defineDocExtension("getSearchCursor",function(e,t,r){return new n(this,e,t,r)}),i.defineExtension("selectMatches",function(e,t){for(var r=[],n=this.getSearchCursor(e,this.getCursor("from"),t);n.findNext()&&!(0<i.cmpPos(n.to(),this.getCursor("to")));)r.push({anchor:n.from(),head:n.to()});r.length&&this.setSelections(r,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(h){"use strict";function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function p(e){return e.state.search||(e.state.search=new t)}function o(e){return"string"==typeof e&&e==e.toLowerCase()}function m(e,t,r){return e.getSearchCursor(t,r,{caseFold:o(t),multiline:!0})}function g(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0}):i(prompt(r,n))}function n(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function a(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=n(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function v(e,t,r){var n,i;t.queryText=r,t.query=a(r),e.removeOverlay(t.overlay,o(t.query)),t.overlay=(n=t.query,i=o(t.query),"string"==typeof n?n=new RegExp(n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i?"gi":"g"):n.global||(n=new RegExp(n.source,n.ignoreCase?"gi":"g")),{token:function(e){n.lastIndex=e.pos;var t=n.exec(e.string);if(t&&t.index==e.pos)return e.pos+=t[0].length||1,"searching";t?e.pos=t.index:e.skipToEnd()}}),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,o(t.query)))}function r(o,t,e,r){var n=p(o);if(n.query)return y(o,t);var i,a,s,l,c,u=o.getSelection()||n.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),e&&o.openDialog){var f=null,d=function(e,t){h.e_stop(t),e&&(e!=n.queryText&&(v(o,n,e),n.posFrom=n.posTo=o.getCursor()),f&&(f.style.opacity=1),y(o,t.shiftKey,function(e,t){var r;t.line<3&&document.querySelector&&(r=o.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>o.cursorCoords(t,"window").top&&((f=r).style.opacity=.4)}))};a=x(i=o),s=u,l=d,c=function(e,t){var r=h.keyName(e),n=o.getOption("extraKeys"),i=n&&n[r]||h.keyMap[o.getOption("keyMap")][r];"findNext"==i||"findPrev"==i||"findPersistentNext"==i||"findPersistentPrev"==i?(h.e_stop(e),v(o,p(o),t),o.execCommand(i)):"find"!=i&&"findPersistent"!=i||(h.e_stop(e),d(t,e))},i.openDialog(a,l,{value:s,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(i)},onKeyDown:c}),r&&u&&(v(o,n,u),y(o,t))}else g(o,x(o),"Search for:",u,function(e){e&&!n.query&&o.operation(function(){v(o,n,e),n.posFrom=n.posTo=o.getCursor(),y(o,t)})})}function y(r,n,i){r.operation(function(){var e=p(r),t=m(r,e.query,n?e.posFrom:e.posTo);(t.find(n)||(t=m(r,e.query,n?h.Pos(r.lastLine()):h.Pos(r.firstLine(),0))).find(n))&&(r.setSelection(t.from(),t.to()),r.scrollIntoView({from:t.from(),to:t.to()},20),e.posFrom=t.from(),e.posTo=t.to(),i&&i(t.from(),t.to()))})}function b(t){t.operation(function(){var e=p(t);e.lastQuery=e.query,e.query&&(e.query=e.queryText=null,t.removeOverlay(e.overlay),e.annotate&&(e.annotate.clear(),e.annotate=null))})}function x(e){return'<span class="CodeMirror-search-label">'+e.phrase("Search:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function w(t,n,i){t.operation(function(){for(var e=m(t,n);e.findNext();)if("string"!=typeof n){var r=t.getRange(e.from(),e.to()).match(n);e.replace(i.replace(/\$(\d)/g,function(e,t){return r[t]}))}else e.replace(i)})}function i(d,e){if(!d.getOption("readOnly")){var t=d.getSelection()||p(d).lastQuery,r='<span class="CodeMirror-search-label">'+(e?d.phrase("Replace all:"):d.phrase("Replace:"))+"</span>";g(d,r+(' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+d.phrase("(Use /re/ syntax for regexp search)")+"</span>"),r,t,function(f){f&&(f=a(f),g(d,'<span class="CodeMirror-search-label">'+d.phrase("With:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',d.phrase("Replace with:"),"",function(s){if(s=n(s),e)w(d,f,s);else{b(d);var l=m(d,f,d.getCursor("from")),c=function(){var e,t,r,n,i,o,a=l.from();!(e=l.findNext())&&(l=m(d,f),!(e=l.findNext())||a&&l.from().line==a.line&&l.from().ch==a.ch)||(d.setSelection(l.from(),l.to()),d.scrollIntoView({from:l.from(),to:l.to()}),r='<span class="CodeMirror-search-label">'+(o=t=d).phrase("Replace?")+"</span> <button>"+o.phrase("Yes")+"</button> <button>"+o.phrase("No")+"</button> <button>"+o.phrase("All")+"</button> <button>"+o.phrase("Stop")+"</button> ",n=d.phrase("Replace?"),i=[function(){u(e)},c,function(){w(d,f,s)}],t.openConfirm?t.openConfirm(r,i):confirm(n)&&i[0]())},u=function(r){l.replace("string"==typeof f?s:s.replace(/\$(\d)/g,function(e,t){return r[t]})),c()};c()}}))})}}h.commands.find=function(e){b(e),r(e)},h.commands.findPersistent=function(e){b(e),r(e,!1,!0)},h.commands.findPersistentNext=function(e){r(e,!1,!0,!0)},h.commands.findPersistentPrev=function(e){r(e,!0,!0,!0)},h.commands.findNext=r,h.commands.findPrev=function(e){r(e,!0)},h.commands.clearSearch=b,h.commands.replace=i,h.commands.replaceAll=function(e){i(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(f){function d(e,t,r){var n,i=e.getWrapperElement();return(n=i.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?n.innerHTML=t:n.appendChild(t),f.addClass(i,"dialog-opened"),n}function h(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}f.defineExtension("openDialog",function(e,t,r){r||(r={}),h(this,null);var n=d(this,e,r.bottom),i=!1,o=this;function a(e){if("string"==typeof e)l.value=e;else{if(i)return;i=!0,f.rmClass(n.parentNode,"dialog-opened"),n.parentNode.removeChild(n),o.focus(),r.onClose&&r.onClose(n)}}var s,l=n.getElementsByTagName("input")[0];return l?(l.focus(),r.value&&(l.value=r.value,!1!==r.selectValueOnOpen&&l.select()),r.onInput&&f.on(l,"input",function(e){r.onInput(e,l.value,a)}),r.onKeyUp&&f.on(l,"keyup",function(e){r.onKeyUp(e,l.value,a)}),f.on(l,"keydown",function(e){r&&r.onKeyDown&&r.onKeyDown(e,l.value,a)||((27==e.keyCode||!1!==r.closeOnEnter&&13==e.keyCode)&&(l.blur(),f.e_stop(e),a()),13==e.keyCode&&t(l.value,e))}),!1!==r.closeOnBlur&&f.on(l,"blur",a)):(s=n.getElementsByTagName("button")[0])&&(f.on(s,"click",function(){a(),o.focus()}),!1!==r.closeOnBlur&&f.on(s,"blur",a),s.focus()),a}),f.defineExtension("openConfirm",function(e,t,r){h(this,null);var n=d(this,e,r&&r.bottom),i=n.getElementsByTagName("button"),o=!1,a=this,s=1;function l(){o||(o=!0,f.rmClass(n.parentNode,"dialog-opened"),n.parentNode.removeChild(n),a.focus())}i[0].focus();for(var c=0;c<i.length;++c){var u=i[c];!function(t){f.on(u,"click",function(e){f.e_preventDefault(e),l(),t&&t(a)})}(t[c]),f.on(u,"blur",function(){--s,setTimeout(function(){s<=0&&l()},200)}),f.on(u,"focus",function(){++s})}}),f.defineExtension("openNotification",function(e,t){h(this,a);var r,n=d(this,e,t&&t.bottom),i=!1,o=t&&void 0!==t.duration?t.duration:5e3;function a(){i||(i=!0,clearTimeout(r),f.rmClass(n.parentNode,"dialog-opened"),n.parentNode.removeChild(n))}return f.on(n,"click",function(e){f.e_preventDefault(e),a()}),o&&(r=setTimeout(a,o)),a})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){"use strict";function n(e,t,r){this.orientation=t,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+t,this.inner=this.node.appendChild(document.createElement("div"));var a=this;function n(e){var t=s.wheelEventPixels(e)["horizontal"==a.orientation?"x":"y"],r=a.pos;a.moveTo(a.pos+t),a.pos!=r&&s.e_preventDefault(e)}s.on(this.inner,"mousedown",function(e){if(1==e.which){s.e_preventDefault(e);var t="horizontal"==a.orientation?"pageX":"pageY",r=e[t],n=a.pos;s.on(document,"mousemove",o),s.on(document,"mouseup",i)}function i(){s.off(document,"mousemove",o),s.off(document,"mouseup",i)}function o(e){if(1!=e.which)return i();a.moveTo(n+(e[t]-r)*(a.total/a.size))}}),s.on(this.node,"click",function(e){s.e_preventDefault(e);var t,r=a.inner.getBoundingClientRect();t="horizontal"==a.orientation?e.clientX<r.left?-1:e.clientX>r.right?1:0:e.clientY<r.top?-1:e.clientY>r.bottom?1:0,a.moveTo(a.pos+t*a.screen)}),s.on(this.node,"mousewheel",n),s.on(this.node,"DOMMouseScroll",n)}n.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)},n.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};function r(e,t,r){this.addClass=e,this.horiz=new n(e,"horizontal",r),t(this.horiz.node),this.vert=new n(e,"vertical",r),t(this.vert.node),this.width=null}n.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)},s.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},s.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";var L={},M=/[^\s\u00a0]/,T=e.Pos;function d(e){var t=e.search(M);return-1==t?0:t}function A(e,t){var r=e.getMode();return!1!==r.useInnerComments&&r.innerMode?e.getModeAt(t):r}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=L);for(var t=1/0,r=this.listSelections(),n=null,i=r.length-1;0<=i;i--){var o=r[i].from(),a=r[i].to();o.line>=t||(a.line>=t&&(a=T(t,0)),t=o.line,null==n?n=this.uncomment(o,a,e)?"un":(this.lineComment(o,a,e),"line"):"un"==n?this.uncomment(o,a,e):this.lineComment(o,a,e))}}),e.defineExtension("lineComment",function(o,e,a){a||(a=L);var s=this,t=A(s,o),r=s.getLine(o.line);if(null!=r&&(n=o,i=r,!/\bstring\b/.test(s.getTokenTypeAt(T(n.line,0)))||/^[\'\"\`]/.test(i))){var n,i,l=a.lineComment||t.lineComment;if(l){var c=Math.min(0!=e.ch||e.line==o.line?e.line+1:e.line,s.lastLine()+1),u=null==a.padding?" ":a.padding,f=a.commentBlankLines||o.line==e.line;s.operation(function(){if(a.indent){for(var e=null,t=o.line;t<c;++t){var r=(n=s.getLine(t)).slice(0,d(n));(null==e||e.length>r.length)&&(e=r)}for(t=o.line;t<c;++t){var n=s.getLine(t),i=e.length;(f||M.test(n))&&(n.slice(0,i)!=e&&(i=d(n)),s.replaceRange(e+l+u,T(t,0),T(t,i)))}}else for(t=o.line;t<c;++t)(f||M.test(s.getLine(t)))&&s.replaceRange(l+u,T(t,0))})}else(a.blockCommentStart||t.blockCommentStart)&&(a.fullLines=!0,s.blockComment(o,e,a))}}),e.defineExtension("blockComment",function(n,i,o){o||(o=L);var a=this,s=A(a,n),l=o.blockCommentStart||s.blockCommentStart,c=o.blockCommentEnd||s.blockCommentEnd;if(l&&c){if(!/\bcomment\b/.test(a.getTokenTypeAt(T(n.line,0)))){var u=Math.min(i.line,a.lastLine());u!=n.line&&0==i.ch&&M.test(a.getLine(u))&&--u;var f=null==o.padding?" ":o.padding;n.line>u||a.operation(function(){if(0!=o.fullLines){var e=M.test(a.getLine(u));a.replaceRange(f+c,T(u)),a.replaceRange(l+f,T(n.line,0));var t=o.blockCommentLead||s.blockCommentLead;if(null!=t)for(var r=n.line+1;r<=u;++r)(r!=u||e)&&a.replaceRange(t+f,T(r,0))}else a.replaceRange(c,i),a.replaceRange(l,n)})}}else(o.lineComment||s.lineComment)&&0!=o.fullLines&&a.lineComment(n,i,o)}),e.defineExtension("uncomment",function(e,t,r){r||(r=L);var i,o=this,n=A(o,e),a=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,o.lastLine()),s=Math.min(e.line,a),l=r.lineComment||n.lineComment,c=[],u=null==r.padding?" ":r.padding;e:if(l){for(var f=s;f<=a;++f){var d=o.getLine(f),h=d.indexOf(l);if(-1<h&&!/comment/.test(o.getTokenTypeAt(T(f,h+1)))&&(h=-1),-1==h&&M.test(d))break e;if(-1<h&&M.test(d.slice(0,h)))break e;c.push(d)}if(o.operation(function(){for(var e=s;e<=a;++e){var t=c[e-s],r=t.indexOf(l),n=r+l.length;r<0||(t.slice(n,n+u.length)==u&&(n+=u.length),i=!0,o.replaceRange("",T(e,r),T(e,n)))}}),i)return!0}var p=r.blockCommentStart||n.blockCommentStart,m=r.blockCommentEnd||n.blockCommentEnd;if(!p||!m)return!1;var g=r.blockCommentLead||n.blockCommentLead,v=o.getLine(s),y=v.indexOf(p);if(-1==y)return!1;var b=a==s?v:o.getLine(a),x=b.indexOf(m,a==s?y+p.length:0),w=T(s,y+1),k=T(a,x+1);if(-1==x||!/comment/.test(o.getTokenTypeAt(w))||!/comment/.test(o.getTokenTypeAt(k))||-1<o.getRange(w,k,"\n").indexOf(m))return!1;var C=v.lastIndexOf(p,e.ch),S=-1==C?-1:v.slice(0,e.ch).indexOf(m,C+p.length);if(-1!=C&&-1!=S&&S+m.length!=e.ch)return!1;S=b.indexOf(m,t.ch);var _=b.slice(t.ch).lastIndexOf(p,S-t.ch);return C=-1==S||-1==_?-1:t.ch+_,(-1==S||-1==C||C==t.ch)&&(o.operation(function(){o.replaceRange("",T(a,x-(u&&b.slice(x-u.length,x)==u?u.length:0)),T(a,x+m.length));var e=y+p.length;if(u&&v.slice(e,e+u.length)==u&&(e+=u.length),o.replaceRange("",T(s,y),T(s,e)),g)for(var t=s+1;t<=a;++t){var r=o.getLine(t),n=r.indexOf(g);if(-1!=n&&!M.test(r.slice(0,n))){var i=n+g.length;u&&r.slice(i,i+u.length)==u&&(i+=u.length),o.replaceRange("",T(t,n),T(t,i))}}}),!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(u){"use strict";function i(i,o,e,a){if(e&&e.call){var s=e;e=null}else s=f(i,e,"rangeFinder");"number"==typeof o&&(o=u.Pos(o,0));var l=f(i,e,"minFoldSize");function t(e){var t=s(i,o);if(!t||t.to.line-t.from.line<l)return null;for(var r=i.findMarksAt(t.from),n=0;n<r.length;++n)if(r[n].__isFold&&"fold"!==a){if(!e)return null;t.cleared=!0,r[n].clear()}return t}var r=t(!0);if(f(i,e,"scanUp"))for(;!r&&o.line>i.firstLine();)o=u.Pos(o.line-1,0),r=t(!1);if(r&&!r.cleared&&"unfold"!==a){var n=function(e,t){var r=f(e,t,"widget");if("string"==typeof r){var n=document.createTextNode(r);(r=document.createElement("span")).appendChild(n),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}(i,e);u.on(n,"mousedown",function(e){c.clear(),u.e_preventDefault(e)});var c=i.markText(r.from,r.to,{replacedWith:n,clearOnEnter:f(i,e,"clearOnEnter"),__isFold:!0});c.on("clear",function(e,t){u.signal(i,"unfold",i,e,t)}),u.signal(i,"fold",i,r.from,r.to)}}u.newFoldFunction=function(r,n){return function(e,t){i(e,t,{rangeFinder:r,widget:n})}},u.defineExtension("foldCode",function(e,t,r){i(this,e,t,r)}),u.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),r=0;r<t.length;++r)if(t[r].__isFold)return!0}),u.commands.toggleFold=function(e){e.foldCode(e.getCursor())},u.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},u.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},u.commands.foldAll=function(r){r.operation(function(){for(var e=r.firstLine(),t=r.lastLine();e<=t;e++)r.foldCode(u.Pos(e,0),null,"fold")})},u.commands.unfoldAll=function(r){r.operation(function(){for(var e=r.firstLine(),t=r.lastLine();e<=t;e++)r.foldCode(u.Pos(e,0),null,"unfold")})},u.registerHelper("fold","combine",function(){var i=Array.prototype.slice.call(arguments,0);return function(e,t){for(var r=0;r<i.length;++r){var n=i[r](e,t);if(n)return n}}}),u.registerHelper("fold","auto",function(e,t){for(var r=e.getHelpers(t,"fold"),n=0;n<r.length;n++){var i=r[n](e,t);if(i)return i}});var o={rangeFinder:u.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function f(e,t,r){if(t&&void 0!==t[r])return t[r];var n=e.options.foldOptions;return n&&void 0!==n[r]?n[r]:o[r]}u.defineOption("foldOptions",null),u.defineExtension("foldOption",function(e,t){return f(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(n){"use strict";n.defineOption("foldGutter",!1,function(e,t,r){r&&r!=n.Init&&(e.clearGutter(e.state.foldGutter.options.gutter),e.state.foldGutter=null,e.off("gutterClick",s),e.off("change",l),e.off("viewportChange",d),e.off("fold",h),e.off("unfold",h),e.off("swapDoc",l)),t&&(e.state.foldGutter=new i(function(e){!0===e&&(e={});null==e.gutter&&(e.gutter="CodeMirror-foldgutter");null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open");null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded");return e}(t)),a(e),e.on("gutterClick",s),e.on("change",l),e.on("viewportChange",d),e.on("fold",h),e.on("unfold",h),e.on("swapDoc",l))});var c=n.Pos;function i(e){this.options=e,this.from=this.to=0}function u(e,t){for(var r=e.findMarks(c(t,0),c(t+1,0)),n=0;n<r.length;++n)if(r[n].__isFold&&r[n].find().from.line==t)return r[n]}function f(e){if("string"!=typeof e)return e.cloneNode(!0);var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}function o(i,e,t){var o=i.state.foldGutter.options,a=e,s=i.foldOption(o,"minFoldSize"),l=i.foldOption(o,"rangeFinder");i.eachLine(e,t,function(e){var t=null;if(u(i,a))t=f(o.indicatorFolded);else{var r=c(a,0),n=l&&l(i,r);n&&n.to.line-n.from.line>=s&&(t=f(o.indicatorOpen))}i.setGutterMarker(e,o.gutter,t),++a})}function a(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation(function(){o(e,t.from,t.to)}),r.from=t.from,r.to=t.to)}function s(e,t,r){var n=e.state.foldGutter;if(n){var i=n.options;if(r==i.gutter){var o=u(e,t);o?o.clear():e.foldCode(c(t,0),i.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},r.foldOnChangeTimeSpan||600)}}function d(t){var r=t.state.foldGutter;if(r){var e=r.options;clearTimeout(r.changeUpdate),r.changeUpdate=setTimeout(function(){var e=t.getViewport();r.from==r.to||20<e.from-r.to||20<r.from-e.to?a(t):t.operation(function(){e.from<r.from&&(o(t,e.from,r.from),r.from=e.from),e.to>r.to&&(o(t,r.to,e.to),r.to=e.to)})},e.updateViewportTimeSpan||400)}}function h(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n<r.to&&o(e,n,n+1)}}}),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 l=e.Pos;function c(e,t){return e.line-t.line||e.ch-t.ch}var t="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",n=new RegExp("<(/?)(["+t+"][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-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function u(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function i(e,t){var r=e.cm.getTokenTypeAt(l(e.line,t));return r&&/\btag\b/.test(r)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function f(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function h(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(o(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function m(e,t){for(var r=[];;){var n,i=h(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(n=f(e)))return;if("selfClose"!=n)if(i[1]){for(var s=r.length-1;0<=s;--s)if(r[s]==i[2]){r.length=s;break}if(s<0&&(!t||t==i[2]))return{tag:i[2],from:l(o,a),to:l(e.line,e.ch)}}else r.push(i[2])}}function g(e,t){for(var r=[];;){var n=p(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=d(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var s=r.length-1;0<=s;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:l(e.line,e.ch),to:l(i,o)}}}else d(e)}}e.registerHelper("fold","xml",function(e,t){for(var r=new u(e,t.line,0);;){var n=h(r);if(!n||r.line!=t.line)return;var i=f(r);if(!i)return;if(!n[1]&&"selfClose"!=i){var o=l(r.line,r.ch),a=m(r,n[2]);return a&&0<c(a.from,o)?{from:o,to:a.from}:null}}}),e.findMatchingTag=function(e,t,r){var n=new u(e,t.line,t.ch,r);if(-1!=n.text.indexOf(">")||-1!=n.text.indexOf("<")){var i=f(n),o=i&&l(n.line,n.ch),a=i&&d(n);if(i&&a&&!(0<c(n,t))){var s={from:l(n.line,n.ch),to:o,tag:a[2]};return"selfClose"==i?{open:s,close:null,at:"open"}:a[1]?{open:g(n,a[2]),close:s,at:"close"}:{open:s,close:m(n=new u(e,o.line,o.ch,r),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new u(e,t.line,t.ch,r);;){var o=g(i,n);if(!o)break;var a=m(new u(e,t.line,t.ch,r),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,r,n){return m(new u(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){"use strict";function l(e,t){var r=e.getLine(t),n=r.search(/\S/);return-1==n||/\bcomment\b/.test(e.getTokenTypeAt(s.Pos(t,n+1)))?-1:s.countColumn(r,null,e.getOption("tabSize"))}s.registerHelper("fold","indent",function(e,t){var r=l(e,t.line);if(!(r<0)){for(var n=null,i=t.line+1,o=e.lastLine();i<=o;++i){var a=l(e,i);if(-1==a);else{if(!(r<a))break;n=i}}return n?{from:s.Pos(t.line,e.getLine(t.line).length),to:s.Pos(n,e.getLine(n).length)}:void 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(n){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),m=n.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function v(e){return e&&e.bracketRegex||/[(){}[\]]/}function f(e,t,r){var n=e.getLineHandle(t.line),i=t.ch-1,o=r&&r.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var a=v(r),s=!o&&0<=i&&a.test(n.text.charAt(i))&&g[n.text.charAt(i)]||a.test(n.text.charAt(i+1))&&g[n.text.charAt(++i)];if(!s)return null;var l=">"==s.charAt(1)?1:-1;if(r&&r.strict&&0<l!=(i==t.ch))return null;var c=e.getTokenTypeAt(m(t.line,i+1)),u=d(e,m(t.line,i+(0<l?1:0)),l,c||null,r);return null==u?null:{from:m(t.line,i),to:u&&u.pos,match:u&&u.ch==s.charAt(0),forward:0<l}}function d(e,t,r,n,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,s=[],l=v(i),c=0<r?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=r){var f=e.getLine(u);if(f){var d=0<r?0:f.length-1,h=0<r?f.length:-1;if(!(f.length>o))for(u==t.line&&(d=t.ch-(r<0?1:0));d!=h;d+=r){var p=f.charAt(d);if(l.test(p)&&(void 0===n||e.getTokenTypeAt(m(u,d+1))==n))if(">"==g[p].charAt(1)==0<r)s.push(p);else{if(!s.length)return{pos:m(u,d),ch:p};s.pop()}}}}return u-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,i=[],o=e.listSelections(),a=0;a<o.length;a++){var s=o[a].empty()&&f(e,o[a].head,r);if(s&&e.getLine(s.from.line).length<=n){var l=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(s.from,m(s.from.line,s.from.ch+1),{className:l})),s.to&&e.getLine(s.to.line).length<=n&&i.push(e.markText(s.to,m(s.to.line,s.to.ch+1),{className:l}))}}if(i.length){u&&e.state.focused&&e.focus();var c=function(){e.operation(function(){for(var e=0;e<i.length;e++)i[e].clear()})};if(!t)return c;setTimeout(c,800)}}function i(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=t(e,!1,e.state.matchBrackets)})}n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&(e.off("cursorActivity",i),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",i))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(t=r?(r.strict=t,r):t?{strict:!0}:null),f(this,e,t)}),n.defineExtension("scanForBracket",function(e,t,r,n){return d(this,e,t,r,n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(a){"use strict";function s(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(o){o.state.failedTagMatch=!1,o.operation(function(){if(s(o),!o.somethingSelected()){var e=o.getCursor(),t=o.getViewport();t.from=Math.min(t.from,e.line),t.to=Math.max(e.line+1,t.to);var r=a.findMatchingTag(o,e,t);if(r){if(o.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(o.state.tagHit=o.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var i="close"==r.at?r.open:r.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}a.defineOption("matchTags",!1,function(e,t,r){r&&r!=a.Init&&(e.off("cursorActivity",n),e.off("viewportChange",i),s(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",n),e.on("viewportChange",i),n(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var r="close"==t.at?t.open:t.close;r&&e.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],e):e(CodeMirror)}(function(i){"use strict";var r={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(e){for(var t in this.options={},r)this.options[t]=(e&&e.hasOwnProperty(t)?e:r)[t];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function a(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&n(e,t)}function s(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,n(e,t))}function n(e,t){clearTimeout(t.timeout),t.timeout=setTimeout(function(){l(e)},t.options.delay)}function u(e,t,r,n){var i,o,a,s=e.state.matchHighlighter;if(e.addOverlay(s.overlay=(i=t,o=r,a=n,{token:function(e){if(e.match(i)&&(!o||(r=o,!((t=e).start&&r.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&r.test(t.string.charAt(t.pos))))))return a;var t,r;e.next(),e.skipTo(i.charAt(0))||e.skipToEnd()}})),s.options.annotateScrollbar&&e.showMatchesOnScrollbar){var l=r?new RegExp("\\b"+t.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+"\\b"):t;s.matchesonscroll=e.showMatchesOnScrollbar(l,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function f(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function l(c){c.operation(function(){var e=c.state.matchHighlighter;if(f(c),c.somethingSelected()||!e.options.showToken){var t=c.getCursor("from"),r=c.getCursor("to");if(t.line==r.line&&(!e.options.wordsOnly||function(e,t,r){{if(null===e.getRange(t,r).match(/^\w+$/))return!1;if(0<t.ch){var n={line:t.line,ch:t.ch-1},i=e.getRange(n,t);if(null===i.match(/\W/))return!1}if(r.ch<e.getLine(t.line).length){var n={line:r.line,ch:r.ch+1},i=e.getRange(r,n);if(null===i.match(/\W/))return!1}return!0}}(c,t,r))){var n=c.getRange(t,r);e.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=e.options.minChars&&u(c,n,!1,e.options.style)}}else{for(var i=!0===e.options.showToken?/[\w$]/:e.options.showToken,o=c.getCursor(),a=c.getLine(o.line),s=o.ch,l=s;s&&i.test(a.charAt(s-1));)--s;for(;l<a.length&&i.test(a.charAt(l));)++l;s<l&&u(c,a.slice(s,l),i,e.options.style)}})}i.defineOption("highlightSelectionMatches",!1,function(e,t,r){if(r&&r!=i.Init&&(f(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",a),e.off("focus",s)),t){var n=e.state.matchHighlighter=new o(t);e.hasFocus()?(n.active=!0,l(e)):e.on("focus",s),e.on("cursorActivity",a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(y){y.defineOption("autoCloseTags",!1,function(e,t,r){if(r!=y.Init&&r&&e.removeKeyMap("autoCloseTags"),t){var n={name:"autoCloseTags"};("object"!=typeof t||t.whenClosing)&&(n["'/'"]=function(e){return(t=e).getOption("disableInput")?y.Pass:i(t,!0);var t}),("object"!=typeof t||t.whenOpening)&&(n["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return y.Pass;for(var t=e.listSelections(),r=[],n=e.getOption("autoCloseTags"),i=0;i<t.length;i++){if(!t[i].empty())return y.Pass;var o=t[i].head,a=e.getTokenAt(o),s=y.innerMode(e.getMode(),a.state),l=s.state;if("xml"!=s.mode.name||!l.tagName)return y.Pass;var c="html"==s.mode.configuration,u="object"==typeof n&&n.dontCloseTags||c&&b,f="object"==typeof n&&n.indentTags||c&&x,d=l.tagName;a.end>o.ch&&(d=d.slice(0,d.length-a.end+o.ch));var h=d.toLowerCase();if(!d||"string"==a.type&&(a.end!=o.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&"closeTag"==l.type||a.string.indexOf("/")==a.string.length-1||u&&-1<w(u,h)||k(e,d,o,l,!0))return y.Pass;var p=f&&-1<w(f,h);r[i]={indent:p,text:">"+(p?"\n\n":"")+"</"+d+">",newPos:p?y.Pos(o.line+1,0):y.Pos(o.line,o.ch+1)}}for(var m="object"==typeof n&&n.dontIndentOnAutoClose,i=t.length-1;0<=i;i--){var g=r[i];e.replaceRange(g.text,t[i].head,t[i].anchor,"+insert");var v=e.listSelections().slice(0);v[i]={head:g.newPos,anchor:g.newPos},e.setSelections(v),!m&&g.indent&&(e.indentLine(g.newPos.line,null,!0),e.indentLine(g.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(n)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],x=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function i(e,t){for(var r=e.listSelections(),n=[],i=t?"/":"</",o=e.getOption("autoCloseTags"),a="object"==typeof o&&o.dontIndentOnSlash,s=0;s<r.length;s++){if(!r[s].empty())return y.Pass;var l,c=r[s].head,u=e.getTokenAt(c),f=y.innerMode(e.getMode(),u.state),d=f.state;if(t&&("string"==u.type||"<"!=u.string.charAt(0)||u.start!=c.ch-1))return y.Pass;if("xml"!=f.mode.name)if("htmlmixed"==e.getMode().name&&"javascript"==f.mode.name)l=i+"script";else{if("htmlmixed"!=e.getMode().name||"css"!=f.mode.name)return y.Pass;l=i+"style"}else{if(!d.context||!d.context.tagName||k(e,d.context.tagName,c,d))return y.Pass;l=i+d.context.tagName}">"!=e.getLine(c.line).charAt(u.end)&&(l+=">"),n[s]=l}if(e.replaceSelections(n),r=e.listSelections(),!a)for(s=0;s<r.length;s++)(s==r.length-1||r[s].head.line<r[s+1].head.line)&&e.indentLine(r[s].head.line)}function w(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function k(e,t,r,n,i){if(!y.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,r.line+500),a=y.scanForClosingTag(e,r,null,o);if(!a||a.tag!=t)return!1;for(var s=n.context,l=i?1:0;s&&s.tagName==t;s=s.prev)++l;r=a.to;for(var c=1;c<l;c++){var u=y.scanForClosingTag(e,r,null,o);if(!u||u.tag!=t)return!1;r=u.to}return!0}y.commands.closeTag=function(e){return i(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(w){var r={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},k=w.Pos;function C(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:r[t]}w.defineOption("autoCloseBrackets",!1,function(e,t,r){r&&r!=w.Init&&(e.removeKeyMap(i),e.state.closeBrackets=null),t&&(n(C(t,"pairs")),e.state.closeBrackets=t,e.addKeyMap(i))});var i={Backspace:function(e){var t=S(e);if(!t||e.getOption("disableInput"))return w.Pass;for(var r=C(t,"pairs"),n=e.listSelections(),i=0;i<n.length;i++){if(!n[i].empty())return w.Pass;var o=s(e,n[i].head);if(!o||r.indexOf(o)%2!=0)return w.Pass}for(var i=n.length-1;0<=i;i--){var a=n[i].head;e.replaceRange("",k(a.line,a.ch-1),k(a.line,a.ch+1),"+delete")}},Enter:function(n){var e=S(n),t=e&&C(e,"explode");if(!t||n.getOption("disableInput"))return w.Pass;for(var i=n.listSelections(),r=0;r<i.length;r++){if(!i[r].empty())return w.Pass;var o=s(n,i[r].head);if(!o||t.indexOf(o)%2!=0)return w.Pass}n.operation(function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),n.execCommand("goCharLeft"),i=n.listSelections();for(var t=0;t<i.length;t++){var r=i[t].head.line;n.indentLine(r,null,!0),n.indentLine(r+1,null,!0)}})}};function n(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n="'"+r+"'";i[n]||(i[n]=o(r))}}function o(t){return function(e){return function(i,e){var t=S(i);if(!t||i.getOption("disableInput"))return w.Pass;var r=C(t,"pairs"),n=r.indexOf(e);if(-1==n)return w.Pass;for(var o,a=C(t,"triples"),s=r.charAt(n+1)==e,l=i.listSelections(),c=n%2==0,u=0;u<l.length;u++){var f,d=l[u],h=d.head,p=i.getRange(h,k(h.line,h.ch+1));if(c&&!d.empty())f="surround";else if(!s&&c||p!=e)if(s&&1<h.ch&&0<=a.indexOf(e)&&i.getRange(k(h.line,h.ch-2),h)==e+e){if(2<h.ch&&/\bstring/.test(i.getTokenTypeAt(k(h.line,h.ch-2))))return w.Pass;f="addFour"}else if(s){var m=0==h.ch?" ":i.getRange(k(h.line,h.ch-1),h);if(w.isWordChar(p)||m==e||w.isWordChar(m))return w.Pass;f="both"}else{if(!c)return w.Pass;f="both"}else f=!s||(v=h,void 0,y=(g=i).getTokenAt(k(v.line,v.ch+1)),!/\bstring/.test(y.type)||y.start!=v.ch||0!=v.ch&&/\bstring/.test(g.getTokenTypeAt(v)))?0<=a.indexOf(e)&&i.getRange(h,k(h.line,h.ch+3))==e+e+e?"skipThree":"skip":"both";if(o){if(o!=f)return w.Pass}else o=f}var g,v,y;var b=n%2?r.charAt(n-1):e,x=n%2?e:r.charAt(n+1);i.operation(function(){if("skip"==o)i.execCommand("goCharRight");else if("skipThree"==o)for(var e=0;e<3;e++)i.execCommand("goCharRight");else if("surround"==o){for(var t=i.getSelections(),e=0;e<t.length;e++)t[e]=b+t[e]+x;i.replaceSelections(t,"around"),t=i.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=(r=t[e],void 0,n=0<w.cmpPos(r.anchor,r.head),{anchor:new k(r.anchor.line,r.anchor.ch+(n?-1:1)),head:new k(r.head.line,r.head.ch+(n?1:-1))});i.setSelections(t)}else"both"==o?(i.replaceSelection(b+x,null),i.triggerElectric(b+x),i.execCommand("goCharLeft")):"addFour"==o&&(i.replaceSelection(b+b+b+b,"before"),i.execCommand("goCharRight"));var r,n})}(e,t)}}function S(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function s(e,t){var r=e.getRange(k(t.line,t.ch-1),k(t.line,t.ch+1));return 2==r.length?r:null}n(r.pairs+"`")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(f){"use strict";var e=f.commands,d=f.Pos;function t(t,r){t.extendSelectionsBy(function(e){return t.display.shift||t.doc.extend||e.empty()?function(e,t,r){if(r<0&&0==t.ch)return e.clipPos(d(t.line-1));var n=e.getLine(t.line);if(0<r&&t.ch>=n.length)return e.clipPos(d(t.line+1,0));for(var i,o="start",a=t.ch,s=r<0?0:n.length,l=0;a!=s;a+=r,l++){var c=n.charAt(r<0?a-1:a),u="_"!=c&&f.isWordChar(c)?"w":"o";if("w"==u&&c.toUpperCase()==c&&(u="W"),"start"==o)"o"!=u&&(o="in",i=u);else if("in"==o&&i!=u){if("w"==i&&"W"==u&&r<0&&a--,"W"==i&&"w"==u&&0<r){i="w";continue}break}}return d(t.line,a)}(t.doc,e.head,r):r<0?e.from():e.to()})}function r(a,s){if(a.isReadOnly())return f.Pass;a.operation(function(){for(var e=a.listSelections().length,t=[],r=-1,n=0;n<e;n++){var i=a.listSelections()[n].head;if(!(i.line<=r)){var o=d(i.line+(s?0:1),0);a.replaceRange("\n",o,null,"+insertLine"),a.indentLine(o.line,null,!0),t.push({head:o,anchor:o}),r=i.line+1}}a.setSelections(t)}),a.execCommand("indentAuto")}function c(e,t){for(var r=t.ch,n=r,i=e.getLine(t.line);r&&f.isWordChar(i.charAt(r-1));)--r;for(;n<i.length&&f.isWordChar(i.charAt(n));)++n;return{from:d(t.line,r),to:d(t.line,n),word:i.slice(r,n)}}function n(e,t){for(var r=e.listSelections(),n=[],i=0;i<r.length;i++){var o=r[i],a=e.findPosV(o.anchor,t,"line",o.anchor.goalColumn),s=e.findPosV(o.head,t,"line",o.head.goalColumn);a.goalColumn=null!=o.anchor.goalColumn?o.anchor.goalColumn:e.cursorCoords(o.anchor,"div").left,s.goalColumn=null!=o.head.goalColumn?o.head.goalColumn:e.cursorCoords(o.head,"div").left;var l={anchor:a,head:s};n.push(o),n.push(l)}e.setSelections(n)}e.goSubwordLeft=function(e){t(e,-1)},e.goSubwordRight=function(e){t(e,1)},e.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var r=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=r&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},e.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var r=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=r&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},e.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)for(var i=t[n].from(),o=t[n].to(),a=i.line;a<=o.line;++a)o.line>i.line&&a==o.line&&0==o.ch||r.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(r,0)},e.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},e.selectLine=function(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n];r.push({anchor:d(i.from().line,0),head:d(i.to().line+1,0)})}e.setSelections(r)},e.insertLineAfter=function(e){return r(e,!1)},e.insertLineBefore=function(e){return r(e,!0)},e.selectNextOccurrence=function(e){var t=e.getCursor("from"),r=e.getCursor("to"),n=e.state.sublimeFindFullWord==e.doc.sel;if(0==f.cmpPos(t,r)){var i=c(e,t);if(!i.word)return;e.setSelection(i.from,i.to),n=!0}else{var o=e.getRange(t,r),a=n?new RegExp("\\b"+o+"\\b"):o,s=e.getSearchCursor(a,r),l=s.findNext();if(l||(l=(s=e.getSearchCursor(a,d(e.firstLine(),0))).findNext()),!l||function(e,t,r){for(var n=0;n<e.length;n++)if(e[n].from()==t&&e[n].to()==r)return!0;return!1}(e.listSelections(),s.from(),s.to()))return f.Pass;e.addSelection(s.from(),s.to())}n&&(e.state.sublimeFindFullWord=e.doc.sel)},e.addCursorToPrevLine=function(e){n(e,-1)},e.addCursorToNextLine=function(e){n(e,1)};function i(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n],o=i.head,a=e.scanForBracket(o,-1);if(!a)return!1;for(;;){var s=e.scanForBracket(o,1);if(!s)return!1;if(s.ch=="(){}[]".charAt("(){}[]".indexOf(a.ch)+1)){var l=d(a.pos.line,a.pos.ch+1);if(0!=f.cmpPos(l,i.from())||0!=f.cmpPos(s.pos,i.to())){r.push({anchor:l,head:s.pos});break}if(!(a=e.scanForBracket(a.pos,-1)))return!1}o=d(s.pos.line,s.pos.ch+1)}}return e.setSelections(r),!0}function o(s,l){if(s.isReadOnly())return f.Pass;for(var c,e=s.listSelections(),u=[],t=0;t<e.length;t++){var r=e[t];if(!r.empty()){for(var n=r.from().line,i=r.to().line;t<e.length-1&&e[t+1].from().line==i;)i=e[++t].to().line;e[t].to().ch||i--,u.push(n,i)}}u.length?c=!0:u.push(s.firstLine(),s.lastLine()),s.operation(function(){for(var e=[],t=0;t<u.length;t+=2){var r=u[t],n=u[t+1],i=d(r,0),o=d(n),a=s.getRange(i,o,!1);l?a.sort():a.sort(function(e,t){var r=e.toUpperCase(),n=t.toUpperCase();return r!=n&&(e=r,t=n),e<t?-1:e==t?0:1}),s.replaceRange(a,i,o),c&&e.push({anchor:i,head:d(n+1,0)})}c&&s.setSelections(e,0)})}function a(s,l){s.operation(function(){for(var e=s.listSelections(),t=[],r=[],n=0;n<e.length;n++){(o=e[n]).empty()?(t.push(n),r.push("")):r.push(l(s.getRange(o.from(),o.to())))}s.replaceSelections(r,"around","case");var i;for(n=t.length-1;0<=n;n--){var o=e[t[n]];if(!(i&&0<f.cmpPos(o.head,i))){var a=c(s,o.head);i=a.from,s.replaceRange(l(a.word),a.from,a.to)}}})}function s(e){var t=e.getCursor("from"),r=e.getCursor("to");if(0==f.cmpPos(t,r)){var n=c(e,t);if(!n.word)return;t=n.from,r=n.to}return{from:t,to:r,query:e.getRange(t,r),word:n}}function l(e,t){var r=s(e);if(r){var n=r.query,i=e.getSearchCursor(n,t?r.to:r.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(n,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):r.word&&e.setSelection(r.from,r.to))}}e.selectScope=function(e){i(e)||e.execCommand("selectAll")},e.selectBetweenBrackets=function(e){if(!i(e))return f.Pass},e.goToBracket=function(n){n.extendSelectionsBy(function(e){var t=n.scanForBracket(e.head,1);if(t&&0!=f.cmpPos(t.pos,e.head))return t.pos;var r=n.scanForBracket(e.head,-1);return r&&d(r.pos.line,r.pos.ch+1)||e.head})},e.swapLineUp=function(i){if(i.isReadOnly())return f.Pass;for(var e=i.listSelections(),o=[],t=i.firstLine()-1,a=[],r=0;r<e.length;r++){var n=e[r],s=n.from().line-1,l=n.to().line;a.push({anchor:d(n.anchor.line-1,n.anchor.ch),head:d(n.head.line-1,n.head.ch)}),0!=n.to().ch||n.empty()||--l,t<s?o.push(s,l):o.length&&(o[o.length-1]=l),t=l}i.operation(function(){for(var e=0;e<o.length;e+=2){var t=o[e],r=o[e+1],n=i.getLine(t);i.replaceRange("",d(t,0),d(t+1,0),"+swapLine"),r>i.lastLine()?i.replaceRange("\n"+n,d(i.lastLine()),null,"+swapLine"):i.replaceRange(n+"\n",d(r,0),null,"+swapLine")}i.setSelections(a),i.scrollIntoView()})},e.swapLineDown=function(i){if(i.isReadOnly())return f.Pass;for(var e=i.listSelections(),o=[],t=i.lastLine()+1,r=e.length-1;0<=r;r--){var n=e[r],a=n.to().line+1,s=n.from().line;0!=n.to().ch||n.empty()||a--,a<t?o.push(a,s):o.length&&(o[o.length-1]=s),t=s}i.operation(function(){for(var e=o.length-2;0<=e;e-=2){var t=o[e],r=o[e+1],n=i.getLine(t);t==i.lastLine()?i.replaceRange("",d(t-1),d(t),"+swapLine"):i.replaceRange("",d(t,0),d(t+1,0),"+swapLine"),i.replaceRange(n+"\n",d(r,0),null,"+swapLine")}i.scrollIntoView()})},e.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},e.joinLines=function(l){for(var e=l.listSelections(),c=[],t=0;t<e.length;t++){for(var r=e[t],n=r.from(),i=n.line,o=r.to().line;t<e.length-1&&e[t+1].from().line==o;)o=e[++t].to().line;c.push({start:i,end:o,anchor:!r.empty()&&n})}l.operation(function(){for(var e=0,t=[],r=0;r<c.length;r++){for(var n,i=c[r],o=i.anchor&&d(i.anchor.line-e,i.anchor.ch),a=i.start;a<=i.end;a++){var s=a-e;a==i.end&&(n=d(s,l.getLine(s).length+1)),s<l.lastLine()&&(l.replaceRange(" ",d(s),d(s+1,/^\s*/.exec(l.getLine(s+1))[0].length)),++e)}t.push({anchor:o||n,head:n})}l.setSelections(t,0)})},e.duplicateLine=function(n){n.operation(function(){for(var e=n.listSelections().length,t=0;t<e;t++){var r=n.listSelections()[t];r.empty()?n.replaceRange(n.getLine(r.head.line)+"\n",d(r.head.line,0)):n.replaceRange(n.getRange(r.from(),r.to()),r.from())}n.scrollIntoView()})},e.sortLines=function(e){o(e,!0)},e.sortLinesInsensitive=function(e){o(e,!1)},e.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var r=t.shift(),n=r.find();if(n)return t.push(r),e.setSelection(n.from,n.to)}},e.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var r=t[t.length-1].find();if(r)return e.setSelection(r.from,r.to);t.pop()}},e.toggleBookmark=function(e){for(var t=e.listSelections(),r=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),n=0;n<t.length;n++){for(var i=t[n].from(),o=t[n].to(),a=t[n].empty()?e.findMarksAt(i):e.findMarks(i,o),s=0;s<a.length;s++)if(a[s].sublimeBookmark){a[s].clear();for(var l=0;l<r.length;l++)r[l]==a[s]&&r.splice(l--,1);break}s==a.length&&r.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},e.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var r=0;r<t.length;r++)t[r].clear();t.length=0},e.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,r=[];if(t)for(var n=0;n<t.length;n++){var i=t[n].find();i?r.push({anchor:i.from,head:i.to}):t.splice(n--,0)}r.length&&e.setSelections(r,0)},e.smartBackspace=function(l){if(l.somethingSelected())return f.Pass;l.operation(function(){for(var e=l.listSelections(),t=l.getOption("indentUnit"),r=e.length-1;0<=r;r--){var n=e[r].head,i=l.getRange({line:n.line,ch:0},n),o=f.countColumn(i,null,l.getOption("tabSize")),a=l.findPosH(n,-1,"char",!1);if(i&&!/\S/.test(i)&&o%t==0){var s=new d(n.line,f.findColumn(i,o-t,t));s.ch!=n.ch&&(a=s)}l.replaceRange("",a,n,"+delete")}})},e.delLineRight=function(r){r.operation(function(){for(var e=r.listSelections(),t=e.length-1;0<=t;t--)r.replaceRange("",e[t].anchor,d(e[t].to().line),"+delete");r.scrollIntoView()})},e.upcaseAtCursor=function(e){a(e,function(e){return e.toUpperCase()})},e.downcaseAtCursor=function(e){a(e,function(e){return e.toLowerCase()})},e.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},e.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},e.deleteToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();if(t){var r=e.getCursor(),n=t;if(0<f.cmpPos(r,n)){var i=n;n=r,r=i}e.state.sublimeKilled=e.getRange(r,n),e.replaceRange("",r,n)}},e.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},e.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},e.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},e.findUnder=function(e){l(e,!0)},e.findUnderPrevious=function(e){l(e,!1)},e.findAllUnder=function(e){var t=s(e);if(t){for(var r=e.getSearchCursor(t.query),n=[],i=-1;r.findNext();)n.push({anchor:r.from(),head:r.to()}),r.from().line<=t.from.line&&r.from().ch<=t.from.ch&&i++;e.setSelections(n,i)}};var u=f.keyMap;u.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},f.normalizeKeyMap(u.macSublime),u.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},f.normalizeKeyMap(u.pcSublime);var h=u.default==u.macDefault;u.sublime=h?u.macSublime:u.pcSublime}),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 l=e.Pos;function c(e,t){return e.line==t.line&&e.ch==t.ch}var o=[];function a(e){o.push(e),50<o.length&&o.shift()}function r(e){return o[o.length-(e?Math.min(e,1):1)]||""}var s=null;function u(e,t,r,n,i){null==i&&(i=e.getRange(t,r)),"grow"==n&&s&&s.cm==e&&c(t,s.pos)&&e.isClean(s.gen)?function(e){if(!o.length)return a(e);o[o.length-1]+=e}(i):!1!==n&&a(i),e.replaceRange("",t,r,"+delete"),s="grow"==n?{cm:e,pos:t,gen:e.changeGeneration()}:null}function t(e,t,r){return e.findPosH(t,r,"char",!0)}function n(e,t,r){return e.findPosH(t,r,"word",!0)}function i(e,t,r){return e.findPosV(t,r,"line",e.doc.sel.goalColumn)}function f(e,t,r){return e.findPosV(t,r,"page",e.doc.sel.goalColumn)}function d(e,t,r){for(var n=t.line,i=e.getLine(n),o=/\S/.test(r<0?i.slice(0,t.ch):i.slice(t.ch)),a=e.firstLine(),s=e.lastLine();;){if((n+=r)<a||s<n)return e.clipPos(l(n-r,r<0?0:null));if(i=e.getLine(n),/\S/.test(i))o=!0;else if(o)return l(n,0)}}function h(e,t,r){for(var n=t.line,i=t.ch,o=e.getLine(t.line),a=!1;;){var s=o.charAt(i+(r<0?-1:0));if(s){if(a&&/[!?.]/.test(s))return l(n,i+(0<r?1:0));a||(a=/\w/.test(s)),i+=r}else{if(n==(r<0?e.firstLine():e.lastLine()))return l(n,i);if(o=e.getLine(n+r),!/\S/.test(o))return l(n,i);n+=r,i=r<0?o.length:0}}}function p(e,t,r){var n;if(e.findMatchingBracket&&(n=e.findMatchingBracket(t,{strict:!0}))&&n.match&&(n.forward?1:-1)==r)return 0<r?l(n.to.line,n.to.ch+1):n.to;for(var i=!0;;i=!1){var o=e.getTokenAt(t),a=l(t.line,r<0?o.start:o.end);if(!(i&&0<r&&o.end==t.ch)&&/\w/.test(o.string))return a;var s=e.findPosH(a,r,"char");if(c(a,s))return t;t=s}}function m(e,t){var r=e.state.emacsPrefix;return r?(S(e),"-"==r?-1:Number(r)):t?null:1}function g(t){var n="string"==typeof t?function(e){e.execCommand(t)}:t;return function(e){var t=m(e);n(e);for(var r=1;r<t;++r)n(e)}}function v(e,t,r,n){var i=m(e);i<0&&(n=-n,i=-i);for(var o=0;o<i;++o){var a=r(e,t,n);if(c(a,t))break;t=a}return t}function y(t,r){var e=function(e){e.extendSelection(v(e,e.getCursor(),t,r))};return e.motion=!0,e}function b(e,t,r,n){for(var i,o=e.listSelections(),a=o.length;a--;)u(e,i=o[a].head,v(e,i,t,r),n)}function x(e,t){if(e.somethingSelected()){for(var r,n=e.listSelections(),i=n.length;i--;)u(e,(r=n[i]).anchor,r.head,t);return!0}}function w(e,t){e.state.emacsPrefix?"-"!=t&&(e.state.emacsPrefix+=t):(e.state.emacsPrefix=t,e.on("keyHandled",C),e.on("inputRead",_))}var k={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};function C(e,t){e.state.emacsPrefixMap||k.hasOwnProperty(t)||S(e)}function S(e){e.state.emacsPrefix=null,e.off("keyHandled",C),e.off("inputRead",_)}function _(e,t){var r=m(e);if(1<r&&"+input"==t.origin){for(var n=t.text.join("\n"),i="",o=1;o<r;++o)i+=n;e.replaceSelection(i)}}function L(e,t){("string"!=typeof t||!/^\d$/.test(t)&&"Ctrl-U"!=t)&&(e.removeKeyMap(E),e.state.emacsPrefixMap=!1,e.off("keyHandled",L),e.off("inputRead",L))}function M(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",function(){e.setExtending(!1)})}function T(e){e.setExtending(!1),e.setCursor(e.getCursor())}function A(e,t){var r=e.getCursor(),n=e.findPosH(r,1,"word");e.replaceRange(t(e.getRange(r,n)),r,n),e.setCursor(n)}e.emacs={kill:u,killRegion:x,repeated:g};var O=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){u(e,e.getCursor("start"),e.getCursor("end"),!0)},"Ctrl-K":g(function(e){var t=e.getCursor(),r=e.clipPos(l(t.line)),n=e.getRange(t,r);/\S/.test(n)||(n+="\n",r=l(t.line+1,0)),u(e,t,r,"grow",n)}),"Alt-W":function(e){a(e.getSelection()),T(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(r(m(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection((1<o.length&&o.pop(),r()),"around","paste")},"Ctrl-Space":M,"Ctrl-Shift-2":M,"Ctrl-F":y(t,1),"Ctrl-B":y(t,-1),Right:y(t,1),Left:y(t,-1),"Ctrl-D":function(e){b(e,t,1,!1)},Delete:function(e){x(e,!1)||b(e,t,1,!1)},"Ctrl-H":function(e){b(e,t,-1,!1)},Backspace:function(e){x(e,!1)||b(e,t,-1,!1)},"Alt-F":y(n,1),"Alt-B":y(n,-1),"Alt-Right":y(n,1),"Alt-Left":y(n,-1),"Alt-D":function(e){b(e,n,1,"grow")},"Alt-Backspace":function(e){b(e,n,-1,"grow")},"Ctrl-N":y(i,1),"Ctrl-P":y(i,-1),Down:y(i,1),Up:y(i,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":y(f,-1),"Ctrl-V":y(f,1),PageUp:y(f,-1),PageDown:y(f,1),"Ctrl-Up":y(d,-1),"Ctrl-Down":y(d,1),"Alt-A":y(h,-1),"Alt-E":y(h,1),"Alt-K":function(e){b(e,h,1,"grow")},"Ctrl-Alt-K":function(e){b(e,p,1,"grow")},"Ctrl-Alt-Backspace":function(e){b(e,p,-1,"grow")},"Ctrl-Alt-F":y(p,1),"Ctrl-Alt-B":y(p,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(v(e,t,p,1),t)},"Ctrl-Alt-T":function(e){var t=p(e,e.getCursor(),-1),r=p(e,t,1),n=p(e,r,1),i=p(e,n,-1);e.replaceRange(e.getRange(i,n)+e.getRange(r,i)+e.getRange(t,r),t,n)},"Ctrl-Alt-U":g(function(e){for(var t=e.getCursor(),r=t.line,n=t.ch,i=[];r>=e.firstLine();){for(var o=e.getLine(r),a=null==n?o.length:n;0<a;)if(")"==(n=o.charAt(--a)))i.push("(");else if("]"==n)i.push("[");else if("}"==n)i.push("{");else if(/[\(\{\[]/.test(n)&&(!i.length||i.pop()!=n))return e.extendSelection(l(r,a));--r,n=null}}),"Alt-Space":function(e){for(var t=e.getCursor(),r=t.ch,n=t.ch,i=e.getLine(t.line);r&&/\s/.test(i.charAt(r-1));)--r;for(;n<i.length&&/\s/.test(i.charAt(n));)++n;e.replaceRange(" ",l(t.line,r),l(t.line,n))},"Ctrl-O":g(function(e){e.replaceSelection("\n","start")}),"Ctrl-T":g(function(e){e.execCommand("transposeChars")}),"Alt-C":g(function(e){A(e,function(e){var t=e.search(/\w/);return-1==t?e:e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1).toLowerCase()})}),"Alt-U":g(function(e){A(e,function(e){return e.toUpperCase()})}),"Alt-L":g(function(e){A(e,function(e){return e.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":g("undo"),"Shift-Ctrl--":g("undo"),"Ctrl-Z":g("undo"),"Cmd-Z":g("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":function(e){e.execCommand("clearSearch"),T(e)},"Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":g(function(e){e.replaceSelection("\n","end")}),Tab:"indentAuto","Alt-G G":function(r){var e,t,n,i=m(r,!0);if(null!=i&&0<i)return r.setCursor(i-1);t="Goto line",n=function(e){var t;e&&!isNaN(t=Number(e))&&t==(0|t)&&0<t&&r.setCursor(t-1)},(e=r).openDialog?e.openDialog(t+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(t,""))},"Ctrl-X Tab":function(e){e.indentSelection(m(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":g("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){u(e,e.getCursor(),h(e,e.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":g("insertTab"),"Ctrl-U":function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(E),e.on("keyHandled",L),e.on("inputRead",L)}}),E={"Ctrl-G":S};function N(t){E[t]=function(e){w(e,t)},O["Ctrl-"+t]=function(e){w(e,t)},k["Ctrl-"+t]=!0}for(var I=0;I<10;++I)N(String(I));N("-")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(Ge){"use strict";var Xe=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],Ye=Xe.length,Qe=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Je=Ge.Pos;Ge.Vim=function(){function e(e,t){var r;this==Ge.keyMap.vim&&(Ge.rmClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&(function(e){var t=e.state.fatCursorMarks;if(t)for(var r=0;r<t.length;r++)t[r].clear();e.state.fatCursorMarks=null,e.off("cursorActivity",a)}(e),e.getInputField().style.caretColor="")),t&&t.attach==i||((r=e).setOption("disableInput",!1),r.off("cursorActivity",He),Ge.off(r.getInputField(),"paste",c(r)),r.state.vim=null)}function i(e,t){var r,n;this==Ge.keyMap.vim&&(Ge.addClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&((r=e).state.fatCursorMarks=o(r),r.on("cursorActivity",a),e.getInputField().style.caretColor="transparent")),t&&t.attach==i||((n=e).setOption("disableInput",!0),n.setOption("showCursorWhenSelecting",!1),Ge.signal(n,"vim-mode-change",{mode:"normal"}),n.on("cursorActivity",He),A(n),Ge.on(n.getInputField(),"paste",c(n)))}function o(e){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n];if(i.empty())if(i.anchor.ch<e.getLine(i.anchor.line).length)r.push(e.markText(i.anchor,Je(i.anchor.line,i.anchor.ch+1),{className:"cm-fat-cursor-mark"}));else{var o=document.createElement("span");o.textContent=" ",o.className="cm-fat-cursor-mark",r.push(e.setBookmark(i.anchor,{widget:o}))}}return r}function a(e){var t=e.state.fatCursorMarks;if(t)for(var r=0;r<t.length;r++)t[r].clear();e.state.fatCursorMarks=o(e)}function t(e,t){if(t){if(this[e])return this[e];var r=function(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,i=0;i<t.length;i++){var o=t[i];o in s?t[i]=s[o]:n=!0,o in l&&(t[i]=l[o])}return!!n&&(b(r)&&(t[t.length-1]=r.toLowerCase()),"<"+t.join("-")+">")}(e);if(!r)return!1;var n=Ge.Vim.findKey(t,r);return"function"==typeof n&&Ge.signal(t,"vim-keypress",r),n}}Ge.defineOption("vimMode",!1,function(e,t,r){t&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!t&&r!=Ge.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")});var s={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},l={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(V(e.getCursor(),0,1)),j.enterInsertMode(e,{},t))}),t.onPasteFn}var m=/[\d]/,g=[Ge.isWordChar,function(e){return e&&!Ge.isWordChar(e)&&!/\s/.test(e)}],v=[function(e){return/\S/.test(e)}];function r(e,t){for(var r=[],n=e;n<e+t;n++)r.push(String.fromCharCode(n));return r}var n=r(65,26),u=r(97,26),f=r(48,10),d=[].concat(n,u,f,["<",">"]),h=[].concat(n,u,f,["-",'"',".",":","/"]);function y(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function b(e){return/^[A-Z]$/.test(e)}function N(e){return/^\s*$/.test(e)}function x(e){return-1!=".?!".indexOf(e)}function w(e,t){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1}var k={};function C(e,t,r,n,i){if(void 0===t&&!i)throw Error("defaultValue is required unless callback is provided");if(r||(r="string"),k[e]={type:r,defaultValue:t,callback:i},n)for(var o=0;o<n.length;o++)k[n[o]]=k[e];t&&S(e,t)}function S(e,t,r,n){var i=k[e],o=(n=n||{}).scope;if(!i)return new Error("Unknown option: "+e);if("boolean"==i.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}i.callback?("local"!==o&&i.callback(t,void 0),"global"!==o&&r&&i.callback(t,r)):("local"!==o&&(i.value="boolean"==i.type?!!t:t),"global"!==o&&r&&(r.state.vim.options[e]={value:t}))}function _(e,t,r){var n=k[e],i=(r=r||{}).scope;if(!n)return new Error("Unknown option: "+e);if(n.callback){var o=t&&n.callback(void 0,t);return"global"!==i&&void 0!==o?o:"local"!==i?n.callback():void 0}return((o="global"!==i&&t&&t.state.vim.options[e])||"local"!==i&&n||{}).value}C("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e)return"null"==(r=t.getOption("mode"))?"":r;var r=""==e?"null":e;t.setOption("mode",r)}});var z,L,M=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function T(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=M()}function A(e){return e.state.vim||(e.state.vim={inputState:new I,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function O(){var a,s,l,c;for(var e in z={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:(a=-1,s=0,l=0,c=new Array(100),{cachedCursor:void 0,add:function(n,e,t){var r=c[a%100];function i(e){var t=++a%100,r=c[t];r&&r.clear(),c[t]=n.setBookmark(e)}if(r){var o=r.find();o&&!Y(o,e)&&i(e)}else i(e);i(t),(l=(s=a)-100+1)<0&&(l=0)},move:function(e,t){s<(a+=t)?a=s:a<l&&(a=l);var r=c[(100+a)%100];if(r&&!r.find()){var n,i=0<t?1:-1,o=e.getCursor();do{if((r=c[(100+(a+=i))%100])&&(n=r.find())&&!Y(o,n))break}while(a<s&&l<a)}return r}}),macroModeState:new T,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new B({}),searchHistoryController:new D,exCommandHistoryController:new D},k){var t=k[e];t.value=t.defaultValue}}var E={buildKeyMap:function(){},getRegisterController:function(){return z.registerController},resetVimGlobalState_:O,getVimGlobalState_:function(){return z},maybeInitVimState_:A,suppressErrorLogging:(T.prototype={exitMacroRecordMode:function(){var e=z.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=z.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}},!1),InsertModeKey:Ke,map:function(e,t,r){De.map(e,t,r)},unmap:function(e,t){De.unmap(e,t)},noremap:function(e,t,r){function n(e){return e?[e]:["normal","insert","visual"]}for(var i=n(r),o=Xe.length,a=o-Ye;a<o&&i.length;a++){var s=Xe[a];if(!(s.keys!=t||r&&s.context&&s.context!==r||"ex"===s.type.substr(0,2)||"key"===s.type.substr(0,3))){var l={};for(var c in s)l[c]=s[c];l.keys=e,r&&!l.context&&(l.context=r),this._mapCommand(l);var u=n(s.context);i=i.filter(function(e){return-1===u.indexOf(e)})}}},mapclear:function(e){var t=Xe.length,r=Ye,n=Xe.slice(0,t-r);if(Xe=Xe.slice(t-r),e)for(var i=n.length-1;0<=i;i--){var o=n[i];if(e!==o.context)if(o.context)this._mapCommand(o);else{var a=["normal","insert","visual"];for(var s in a)if(a[s]!==e){var l={};for(var c in o)l[c]=o[c];l.context=a[s],this._mapCommand(l)}}}},setOption:S,getOption:_,defineOption:C,defineEx:function(e,t,r){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;Be[e]=r,De.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);if("function"==typeof n)return n()},findKey:function(s,l,t){var e,c=A(s);function i(){var e=z.macroModeState;if(e.isRecording){if("q"==l)return e.exitMacroRecordMode(),P(s),!0;"mapping"!=t&&function(e,t){if(!e.isPlaying){var r=e.latestRegister,n=z.registerController.getRegister(r);n&&n.pushText(t)}}(e,l)}}function u(){if("<Esc>"==l)return P(s),c.visualMode?le(s):c.insertMode&&Fe(s),!0}return!1===(e=c.insertMode?function(){if(u())return!0;for(var e=c.inputState.keyBuffer=c.inputState.keyBuffer+l,t=1==l.length,r=F.matchCommand(e,Xe,c.inputState,"insert");1<e.length&&"full"!=r.type;){e=c.inputState.keyBuffer=e.slice(1);var n=F.matchCommand(e,Xe,c.inputState,"insert");"none"!=n.type&&(r=n)}if("none"==r.type)return P(s),!1;if("partial"==r.type)return L&&window.clearTimeout(L),L=window.setTimeout(function(){c.insertMode&&c.inputState.keyBuffer&&P(s)},_("insertModeEscKeysTimeout")),!t;if(L&&window.clearTimeout(L),t){for(var i=s.listSelections(),o=0;o<i.length;o++){var a=i[o].head;s.replaceRange("",V(a,0,-(e.length-1)),a,"+input")}z.macroModeState.lastInsertModeChanges.changes.pop()}return P(s),r.command}():function(){if(i()||u())return!0;var e=c.inputState.keyBuffer=c.inputState.keyBuffer+l;if(/^[1-9]\d*$/.test(e))return!0;if(!(t=/^(\d*)(.*)$/.exec(e)))return P(s),!1;var t,r=c.visualMode?"visual":"normal",n=F.matchCommand(t[2]||t[1],Xe,c.inputState,r);return"none"==n.type?(P(s),!1):"partial"==n.type||(c.inputState.keyBuffer="",(t=/^(\d*)(.*)$/.exec(e))[1]&&"0"!=t[1]&&c.inputState.pushRepeatDigit(t[1]),n.command)}())?c.insertMode||1!==l.length?void 0:function(){return!0}:!0===e?function(){return!0}:function(){return s.operation(function(){s.curOp.isVimOp=!0;try{"keyToKey"==e.type?function(e){for(var t;e;)t=/<\w+-.+?>|<\w+>|./.exec(e),l=t[0],e=e.substring(t.index+l.length),Ge.Vim.handleKey(s,l,"mapping")}(e.toKeys):F.processCommand(s,c,e)}catch(e){throw s.state.vim=void 0,A(s),Ge.Vim.suppressErrorLogging||console.log(e),e}return!0})}},handleEx:function(e,t){De.processCommand(e,t)},defineMotion:function(e,t){W[e]=t},defineAction:function(e,t){j[e]=t},defineOperator:function(e,t){H[e]=t},mapCommand:function(e,t,r,n,i){var o={keys:e,type:t};for(var a in o[t]=r,o[t+"Args"]=n,i)o[a]=i[a];ze(o)},_mapCommand:ze,defineRegister:function(e,t){var r=z.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(r[e])throw Error("Register already defined "+e);r[e]=t,h.push(e)},exitVisualMode:le,exitInsertMode:Fe};function I(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function P(e,t){e.state.vim.inputState=new I,Ge.signal(e,"vim-command-done",t)}function R(e,t,r){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!r}function B(e){this.registers=e,this.unnamedRegister=e['"']=new R,e["."]=new R,e[":"]=new R,e["/"]=new R}function D(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}I.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},I.prototype.getRepeat=function(){var e=0;return(0<this.prefixRepeat.length||0<this.motionRepeat.length)&&(e=1,0<this.prefixRepeat.length&&(e*=parseInt(this.prefixRepeat.join(""),10)),0<this.motionRepeat.length&&(e*=parseInt(this.motionRepeat.join(""),10))),e},R.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(M(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},B.prototype={pushText:function(e,t,r,n,i){n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var o=this.isValidRegister(e)?this.getRegister(e):null;if(o)b(e)?o.pushText(r,n):o.setText(r,n,i),this.unnamedRegister.setText(o.toString(),n);else{switch(t){case"yank":this.registers[0]=new R(r,n,i);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new R(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new R(r,n))}this.unnamedRegister.setText(r,n,i)}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new R),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&w(e,h)},shiftNumericRegisters_:function(){for(var e=9;2<=e;e--)this.registers[e]=this.getRegister(""+(e-1))}},D.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var i=this.iterator+n;t?0<=i:i<r.length;i+=n)for(var o=r[i],a=0;a<=o.length;a++)if(this.initialPrefix==o.substring(0,a))return this.iterator=i,o;return i>=r.length?(this.iterator=r.length,this.initialPrefix):i<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);-1<t&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var F={matchCommand:function(e,t,r,n){var i,o=function(e,t,r,n){for(var i,o=[],a=[],s=0;s<t.length;s++){var l=t[s];"insert"==r&&"insert"!=l.context||l.context&&l.context!=r||n.operator&&"action"==l.type||!(i=$(e,l.keys))||("partial"==i&&o.push(l),"full"==i&&a.push(l))}return{partial:o.length&&o,full:a.length&&a}}(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var a=0;a<o.full.length;a++){var s=o.full[a];i||(i=s)}if("<character>"==i.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(1<r.length)switch(r){case"<CR>":r="\n";break;case"<Space>":r=" ";break;default:r=""}return r}(e);if(!l)return{type:"none"};r.selectedCharacter=l}return{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r);break;case"ex":case"keyToEx":this.processEx(e,t,r)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=U(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);P(e)}n.operator=r.operator,n.operatorArgs=U(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,i=U(r.operatorMotionArgs);i&&n&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,i=n.getRepeat(),o=!!i,a=U(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=i||1,a.repeatIsExplicit=o,a.registerName=n.registerName,P(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),j[r.action](e,a,t)},processSearch:function(s,n,i){if(s.getSearchCursor){var l=i.searchArgs.forward,e=i.searchArgs.wholeWordOnly;xe(s).setReversed(!l);var t=l?"/":"?",o=xe(s).getQuery(),c=s.getScrollInfo();switch(i.searchArgs.querySrc){case"prompt":var r=z.macroModeState;r.isPlaying?d(f=r.replaySearchQueries.shift(),!0,!1):Te(s,{onClose:function(e){s.scrollTo(c.left,c.top),d(e,!0,!0);var t=z.macroModeState;t.isRecording&&function(e,t){if(!e.isPlaying){var r=e.latestRegister,n=z.registerController.getRegister(r);n&&n.pushSearchQuery&&n.pushSearchQuery(t)}}(t,e)},prefix:t,desc:Me,onKeyUp:function(e,t,r){var n,i,o,a=Ge.keyName(e);"Up"==a||"Down"==a?(n="Up"==a,i=e.target?e.target.selectionEnd:0,r(t=z.searchHistoryController.nextMatch(t,n)||""),i&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(i,e.target.value.length))):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&z.searchHistoryController.reset();try{o=Ae(s,t,!0,!0)}catch(e){}o?s.scrollIntoView(Ee(s,!l,o),30):(Ne(s),s.scrollTo(c.left,c.top))},onKeyDown:function(e,t,r){var n=Ge.keyName(e);"Esc"==n||"Ctrl-C"==n||"Ctrl-["==n||"Backspace"==n&&""==t?(z.searchHistoryController.pushInput(t),z.searchHistoryController.reset(),Ae(s,o),Ne(s),s.scrollTo(c.left,c.top),Ge.e_stop(e),P(s),r(),s.focus()):"Up"==n||"Down"==n?Ge.e_stop(e):"Ctrl-U"==n&&(Ge.e_stop(e),r(""))}});break;case"wordUnderCursor":var a=ue(s,!1,0,!1,!0),u=!0;if(a||(a=ue(s,!1,0,!1,!1),u=!1),!a)return;var f=s.getLine(a.start.line).substring(a.start.ch,a.end.ch);f=u&&e?"\\b"+f+"\\b":f.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),z.jumpList.cachedCursor=s.getCursor(),s.setCursor(a.start),d(f,!0,!1)}}function d(t,e,r){z.searchHistoryController.pushInput(t),z.searchHistoryController.reset();try{Ae(s,t,e,r)}catch(e){return Le(s,"Invalid regex: "+t),void P(s)}F.processMotion(s,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:i.searchArgs.toJumplist}})}},processEx:function(a,e,t){function r(e){z.exCommandHistoryController.pushInput(e),z.exCommandHistoryController.reset(),De.processCommand(a,e)}function n(e,t,r){var n,i,o=Ge.keyName(e);("Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==t)&&(z.exCommandHistoryController.pushInput(t),z.exCommandHistoryController.reset(),Ge.e_stop(e),P(a),r(),a.focus()),"Up"==o||"Down"==o?(Ge.e_stop(e),n="Up"==o,i=e.target?e.target.selectionEnd:0,r(t=z.exCommandHistoryController.nextMatch(t,n)||""),i&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(i,e.target.value.length))):"Ctrl-U"==o?(Ge.e_stop(e),r("")):"Left"!=o&&"Right"!=o&&"Ctrl"!=o&&"Alt"!=o&&"Shift"!=o&&z.exCommandHistoryController.reset()}"keyToEx"==t.type?De.processCommand(a,t.exArgs.input):e.visualMode?Te(a,{onClose:r,prefix:":",value:"'<,'>",onKeyDown:n,selectValueOnOpen:!1}):Te(a,{onClose:r,prefix:":",onKeyDown:n})},evalInput:function(e,t){var r,n,i,o,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,d=t.sel,h=X(t.visualMode?K(e,d.head):e.getCursor("head")),p=X(t.visualMode?K(e,d.anchor):e.getCursor("anchor")),m=X(h),g=X(p);if(c&&this.recordLastEdit(t,a),0<(i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat())&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,P(e),s){var v=W[s](e,h,l,t);if(t.lastMotion=W[s],!v)return;if(l.toJumplist){var y=z.jumpList,b=y.cachedCursor;b?(fe(e,b,v),delete y.cachedCursor):fe(e,h,v)}(r=v instanceof Array?(n=v[0],v[1]):v)||(r=X(h)),t.visualMode?(t.visualBlock&&r.ch===1/0||(r=K(e,r,t.visualBlock)),n&&(n=K(e,n,!0)),n=n||g,d.anchor=n,d.head=r,ae(e),ve(e,t,"<",Q(n,r)?n:r),ve(e,t,">",Q(n,r)?r:n)):c||(r=K(e,r),e.setCursor(r.line,r.ch))}if(c){if(u.lastSel){n=g;var x=u.lastSel,w=Math.abs(x.head.line-x.anchor.line),k=Math.abs(x.head.ch-x.anchor.ch);r=x.visualLine?Je(g.line+w,g.ch):x.visualBlock?Je(g.line+w,g.ch+k):x.head.line==x.anchor.line?Je(g.line,g.ch+k):Je(g.line+w,g.ch),t.visualMode=!0,t.visualLine=x.visualLine,t.visualBlock=x.visualBlock,d=t.sel={anchor:n,head:r},ae(e)}else t.visualMode&&(u.lastSel={anchor:X(d.anchor),head:X(d.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var C,S,_,L,M;if(t.visualMode){if(C=J(d.head,d.anchor),S=Z(d.head,d.anchor),_=t.visualLine||u.linewise,M=se(e,{anchor:C,head:S},L=t.visualBlock?"block":_?"line":"char"),_){var T=M.ranges;if("block"==L)for(var A=0;A<T.length;A++)T[A].head.ch=te(e,T[A].head.line);else"line"==L&&(T[0].head=Je(T[0].head.line+1,0))}}else{if(C=X(n||g),Q(S=X(r||m),C)){var O=C;C=S,S=O}(_=l.linewise||u.linewise)?(o=S,C.ch=0,o.ch=0,o.line++):l.forward&&function(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var i=n.split("\n");i.pop();for(var o=i.pop();0<i.length&&o&&N(o);o=i.pop())r.line--,r.ch=0;r.ch=o?(r.line--,te(e,r.line)):0}}(e,C,S),M=se(e,{anchor:C,head:S},L="char",!l.inclusive||_)}e.setSelections(M.ranges,M.primary),t.lastMotion=null,u.repeat=i,u.registerName=f,u.linewise=_;var E=H[c](e,u,M.ranges,g,r);t.visualMode&&le(e,null!=E),E&&e.setCursor(E)}},recordLastEdit:function(e,t,r){var n=z.macroModeState;n.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=r,n.lastInsertModeChanges.changes=[],n.lastInsertModeChanges.expectCursorActivityForChange=!1)}},W={moveToTopLine:function(e,t,r){var n=Ie(e).top+r.repeat-1;return Je(n,ce(e.getLine(n)))},moveToMiddleLine:function(e){var t=Ie(e),r=Math.floor(.5*(t.top+t.bottom));return Je(r,ce(e.getLine(r)))},moveToBottomLine:function(e,t,r){var n=Ie(e).bottom-r.repeat+1;return Je(n,ce(e.getLine(n)))},expandToLine:function(e,t,r){return Je(t.line+r.repeat-1,1/0)},findNext:function(e,t,r){var n=xe(e),i=n.getQuery();if(i){var o=!r.forward;return o=n.isReversed()?!o:o,Oe(e,i),Ee(e,o,i,r.repeat)}},goToMark:function(e,t,r,n){var i=Pe(e,n,r.selectedCharacter);return i?r.linewise?{line:i.line,ch:ce(e.getLine(i.line))}:i:null},moveToOtherHighlightedEnd:function(e,t,r,n){if(n.visualBlock&&r.sameLine){var i=n.sel;return[K(e,Je(i.anchor.line,i.head.ch)),K(e,Je(i.head.line,i.anchor.ch))]}return[n.sel.head,n.sel.anchor]},jumpToMark:function(e,t,r,n){for(var i=t,o=0;o<r.repeat;o++){var a=i;for(var s in n.marks)if(p(s)){var l=n.marks[s].find();if(!((r.forward?Q(l,a):Q(a,l))||r.linewise&&l.line==a.line)){var c=Y(a,i),u=r.forward?ee(a,l,i):ee(i,l,a);(c||u)&&(i=l)}}}return r.linewise&&(i=Je(i.line,ce(e.getLine(i.line)))),i},moveByCharacters:function(e,t,r){var n=t,i=r.repeat,o=r.forward?n.ch+i:n.ch-i;return Je(n.line,o)},moveByLines:function(e,t,r,n){var i=t,o=i.ch;switch(n.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:o=n.lastHPos;break;default:n.lastHPos=o}var a=r.repeat+(r.repeatOffset||0),s=r.forward?i.line+a:i.line-a,l=e.firstLine(),c=e.lastLine();return s<l&&i.line==l?this.moveToStartOfLine(e,t,r,n):c<s&&i.line==c?this.moveToEol(e,t,r,n):(r.toFirstChar&&(o=ce(e.getLine(s)),n.lastHPos=o),n.lastHSPos=e.charCoords(Je(s,o),"div").left,Je(s,o))},moveByDisplayLines:function(e,t,r,n){var i=t;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(i,"div").left}var o=r.repeat;if((s=e.findPosV(i,r.forward?o:-o,"line",n.lastHSPos)).hitSide)if(r.forward)var a={top:e.charCoords(s,"div").top+8,left:n.lastHSPos},s=e.coordsChar(a,"div");else{var l=e.charCoords(Je(e.firstLine(),0),"div");l.left=n.lastHSPos,s=e.coordsChar(l,"div")}return n.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,i=r.repeat;return e.findPosV(n,r.forward?i:-i,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return ye(e,t,r.repeat,n)},moveBySentence:function(e,t,r){var n=r.forward?1:-1;return function(e,t,r,n){function u(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!y(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=0<t.dir?0:t.line.length-1}else t.pos+=t.dir}function i(e,t,r,n){var i=e.getLine(t),o=""===i,a={line:i,ln:t,pos:r,dir:n},s={ln:a.ln,pos:a.pos},l=""===a.line;for(u(e,a);null!==a.line;){if(s.ln=a.ln,s.pos=a.pos,""===a.line&&!l)return{ln:a.ln,pos:a.pos};if(o&&""!==a.line&&!N(a.line[a.pos]))return{ln:a.ln,pos:a.pos};!x(a.line[a.pos])||o||a.pos!==a.line.length-1&&!N(a.line[a.pos+1])||(o=!0),u(e,a)}var i=e.getLine(s.ln);s.pos=0;for(var c=i.length-1;0<=c;--c)if(!N(i[c])){s.pos=c;break}return s}function o(e,t,r,n){var i=e.getLine(t),o={line:i,ln:t,pos:r,dir:n},a={ln:o.ln,pos:null},s=""===o.line;for(u(e,o);null!==o.line;){if(""===o.line&&!s)return null!==a.pos?a:{ln:o.ln,pos:o.pos};if(x(o.line[o.pos])&&null!==a.pos&&(o.ln!==a.ln||o.pos+1!==a.pos))return a;""===o.line||N(o.line[o.pos])||(s=!1,a={ln:o.ln,pos:o.pos}),u(e,o)}for(var i=e.getLine(a.ln),l=a.pos=0;l<i.length;++l)if(!N(i[l])){a.pos=l;break}return a}for(var a={ln:t.line,pos:t.ch};0<r;)a=n<0?o(e,a.ln,a.pos,n):i(e,a.ln,a.pos,n),r--;return Je(a.ln,a.pos)}(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var i=e.getScrollInfo(),o=null,a=r.repeat;a||(a=i.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");if(r.repeat=a,!(o=W.moveByDisplayLines(e,t,r,n)))return null;var l=e.charCoords(o,"local");return e.scrollTo(null,i.top+l.top-s.top),o},moveByWords:function(e,t,r){return function(e,t,r,n,i,o){var a=X(t),s=[];(n&&!i||!n&&i)&&r++;for(var l=!(n&&i),c=0;c<r;c++){var u=me(e,t,n,o,l);if(!u){var f=te(e,e.lastLine());s.push(n?{line:e.lastLine(),from:f,to:f}:{line:0,from:0,to:0});break}s.push(u),t=Je(u.line,n?u.to-1:u.from)}var d=s.length!=r,h=s[0],p=s.pop();return n&&!i?(d||h.from==a.ch&&h.line==a.line||(p=s.pop()),Je(p.line,p.from)):n&&i?Je(p.line,p.to-1):!n&&i?(d||h.to==a.ch&&h.line==a.line||(p=s.pop()),Je(p.line,p.to)):Je(p.line,p.from)}(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=ge(e,r.repeat,r.forward,r.selectedCharacter),i=r.forward?-1:1;return de(i,r),n?(n.ch+=i,n):null},moveToCharacter:function(e,t,r){var n=r.repeat;return de(0,r),ge(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){return function(e,t,r,n){var i=X(e.getCursor()),o=r?1:-1,a=r?e.lineCount():-1,s=i.ch,l=i.line,c=e.getLine(l),u={lineText:c,nextCh:c.charAt(s),lastCh:null,index:s,symb:n,reverseSymb:(r?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:r,depth:0,curMoveThrough:!1},f=he[n];if(!f)return i;var d=pe[f].init,h=pe[f].isComplete;for(d&&d(u);l!==a&&t;){if(u.index+=o,u.nextCh=u.lineText.charAt(u.index),!u.nextCh){if(l+=o,u.lineText=e.getLine(l)||"",0<o)u.index=0;else{var p=u.lineText.length;u.index=0<p?p-1:0}u.nextCh=u.lineText.charAt(u.index)}h(u)&&(i.line=l,i.ch=u.index,t--)}return u.nextCh||u.curMoveThrough?Je(l,u.index):i}(e,r.repeat,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var i,o,a,s=r.repeat;return n.lastHPos=s-1,n.lastHSPos=e.charCoords(t,"div").left,o=s,a=(i=e).getCursor().line,K(i,Je(a,o-1))},moveToEol:function(e,t,r,n){var i=t;n.lastHPos=1/0;var o=Je(i.line+r.repeat-1,1/0),a=e.clipPos(o);return a.ch--,n.lastHSPos=e.charCoords(a,"div").left,o},moveToFirstNonWhiteSpaceCharacter:function(e,t){var r=t;return Je(r.line,ce(e.getLine(r.line)))},moveToMatchedSymbol:function(e,t){for(var r,n=t,i=n.line,o=n.ch,a=e.getLine(i);o<a.length;o++)if((r=a.charAt(o))&&-1!="()[]{}".indexOf(r)){var s=e.getTokenTypeAt(Je(i,o+1));if("string"!==s&&"comment"!==s)break}return o<a.length?e.findMatchingBracket(Je(i,o),{bracketRegex:/[(){}[\]<>]/}).to:n},moveToStartOfLine:function(e,t){return Je(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,r){var n=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(n=r.repeat-e.getOption("firstLineNumber")),Je(n,ce(e.getLine(n)))},textObjectManipulation:function(e,t,r,n){var i=r.selectedCharacter;"b"==i?i="(":"B"==i&&(i="{");var o,a,s,l,c,u,f,d,h=!r.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[i])o=function(e,t,r,n){var i,o,a=t,s={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[r],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[r],c=e.getLine(a.line).charAt(a.ch)===l?1:0;if(i=e.scanForBracket(Je(a.line,a.ch+c),-1,void 0,{bracketRegex:s}),o=e.scanForBracket(Je(a.line,a.ch+c),1,void 0,{bracketRegex:s}),!i||!o)return{start:a,end:a};if(i=i.pos,o=o.pos,i.line==o.line&&i.ch>o.ch||i.line>o.line){var u=i;i=o,o=u}return n?o.ch+=1:i.ch+=1,{start:i,end:o}}(e,t,i,h);else if({"'":!0,'"':!0}[i])o=function(e,t,r,n){var i,o,a,s,l=X(t),c=e.getLine(l.line).split(""),u=c.indexOf(r);if(l.ch<u?l.ch=u:u<l.ch&&c[l.ch]==r&&(o=l.ch,--l.ch),c[l.ch]!=r||o)for(a=l.ch;-1<a&&!i;a--)c[a]==r&&(i=a+1);else i=l.ch+1;if(i&&!o)for(a=i,s=c.length;a<s&&!o;a++)c[a]==r&&(o=a);return i&&o?(n&&(--i,++o),{start:Je(l.line,i),end:Je(l.line,o)}):{start:l,end:l}}(e,t,i,h);else if("W"===i)o=ue(e,h,0,!0);else if("w"===i)o=ue(e,h,0,!1);else{if("p"!==i)return null;if(o=ye(e,t,r.repeat,0,h),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var p=n.inputState.operatorArgs;p&&(p.linewise=!0),o.end.line--}}return e.state.vim.visualMode?(a=e,s=o.start,l=o.end,u=a.state.vim.sel,f=u.head,d=u.anchor,Q(l,s)&&(c=l,l=s,s=c),Q(f,d)?(f=J(s,f),d=Z(d,l)):(d=J(s,d),-1==(f=V(f=Z(f,l),0,-1)).ch&&f.line!=a.firstLine()&&(f=Je(f.line-1,te(a,f.line-1)))),[d,f]):[o.start,o.end]},repeatLastCharacterSearch:function(e,t,r){var n=z.lastCharacterSearch,i=r.repeat,o=r.forward===n.forward,a=(n.increment?1:0)*(o?-1:1);e.moveH(-a,"char"),r.inclusive=!!o;var s=ge(e,i,o,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}};function q(e,t){for(var r=[],n=0;n<t;n++)r.push(e);return r}var H={change:function(e,t,r){var n,i,o=e.state.vim;if(z.macroModeState.lastInsertModeChanges.inVisualBlock=o.visualBlock,o.visualMode){i=e.getSelection();var a=q("",r.length);e.replaceSelections(a),n=J(r[0].head,r[0].anchor)}else{var s=r[0].anchor,l=r[0].head;i=e.getRange(s,l);var c=o.lastEditInputState||{};if("moveByWords"==c.motion&&!N(i)){var u=/\s+$/.exec(i);u&&c.motionArgs&&c.motionArgs.forward&&(l=V(l,0,-u[0].length),i=i.slice(0,-u[0].length))}var f=new Je(s.line-1,Number.MAX_VALUE),d=e.firstLine()==e.lastLine();l.line>e.lastLine()&&t.linewise&&!d?e.replaceRange("",f,l):e.replaceRange("",s,l),t.linewise&&(d||(e.setCursor(f),Ge.commands.newlineAndIndent(e)),s.ch=Number.MAX_VALUE),n=s}z.registerController.pushText(t.registerName,"change",i,t.linewise,1<r.length),j.enterInsertMode(e,{head:n},e.state.vim)},delete:function(e,t,r){var n,i,o=e.state.vim;if(o.visualBlock){i=e.getSelection();var a=q("",r.length);e.replaceSelections(a),n=r[0].anchor}else{var s=r[0].anchor,l=r[0].head;t.linewise&&l.line!=e.firstLine()&&s.line==e.lastLine()&&s.line==l.line-1&&(s.line==e.firstLine()?s.ch=0:s=Je(s.line-1,te(e,s.line-1))),i=e.getRange(s,l),e.replaceRange("",s,l),n=s,t.linewise&&(n=W.moveToFirstNonWhiteSpaceCharacter(e,s))}return z.registerController.pushText(t.registerName,"delete",i,t.linewise,o.visualBlock),K(e,n,o.insertMode)},indent:function(e,t,r){var n=e.state.vim,i=r[0].anchor.line,o=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&o--;for(var s=i;s<=o;s++)for(var l=0;l<a;l++)e.indentLine(s,t.indentRight);return W.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},indentAuto:function(e,t,r){return e.execCommand("indentAuto"),W.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,i){for(var o=e.getSelections(),a=[],s=t.toLower,l=0;l<o.length;l++){var c=o[l],u="";if(!0===s)u=c.toLowerCase();else if(!1===s)u=c.toUpperCase();else for(var f=0;f<c.length;f++){var d=c.charAt(f);u+=b(d)?d.toLowerCase():d.toUpperCase()}a.push(u)}return e.replaceSelections(a),t.shouldMoveCursor?i:!e.state.vim.visualMode&&t.linewise&&r[0].anchor.line+1==r[0].head.line?W.moveToFirstNonWhiteSpaceCharacter(e,n):t.linewise?n:J(r[0].anchor,r[0].head)},yank:function(e,t,r,n){var i=e.state.vim,o=e.getSelection(),a=i.visualMode?J(i.sel.anchor,i.sel.head,r[0].head,r[0].anchor):n;return z.registerController.pushText(t.registerName,"yank",o,t.linewise,i.visualBlock),a}};var j={jumpListWalk:function(e,t,r){if(!r.visualMode){var n=t.repeat,i=t.forward,o=z.jumpList.move(e,i?n:-n),a=o?o.find():void 0;a=a||e.getCursor(),e.setCursor(a)}},scroll:function(e,t,r){if(!r.visualMode){var n=t.repeat||1,i=e.defaultTextHeight(),o=e.getScrollInfo().top,a=i*n,s=t.forward?o+a:o-a,l=X(e.getCursor()),c=e.charCoords(l,"local");if(t.forward)s>c.top?(l.line+=(s-c.top)/i,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u<c.bottom?(l.line-=(c.bottom-u)/i,l.line=Math.floor(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,s)}}},scrollToCursor:function(e,t){var r=e.getCursor().line,n=e.charCoords(Je(r,0),"local"),i=e.getScrollInfo().clientHeight,o=n.top,a=n.bottom-o;switch(t.position){case"center":o=o-i/2+a;break;case"bottom":o=o-i+a}e.scrollTo(null,o)},replayMacro:function(e,t,r){var n=t.selectedCharacter,i=t.repeat,o=z.macroModeState;for("@"==n&&(n=o.latestRegister);i--;)We(e,r,o,n)},enterMacroRecordMode:function(e,t){var r=z.macroModeState,n=t.selectedCharacter;z.registerController.isValidRegister(n)&&r.enterMacroRecordMode(e,n)},toggleOverwrite:function(e){e.state.overwrite?(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),Ge.signal(e,"vim-mode-change",{mode:"insert"})):(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),Ge.signal(e,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(e,t,r){if(!e.getOption("readOnly")){r.insertMode=!0,r.insertModeRepeat=t&&t.repeat||1;var n=t?t.insertAt:null,i=r.sel,o=t.head||e.getCursor("head"),a=e.listSelections().length;if("eol"==n)o=Je(o.line,te(e,o.line));else if("charAfter"==n)o=V(o,0,1);else if("firstNonBlank"==n)o=W.moveToFirstNonWhiteSpaceCharacter(e,o);else if("startOfSelectedArea"==n)r.visualBlock?(o=Je(Math.min(i.head.line,i.anchor.line),Math.min(i.head.ch,i.anchor.ch)),a=Math.abs(i.head.line-i.anchor.line)+1):o=i.head.line<i.anchor.line?i.head:Je(i.anchor.line,0);else if("endOfSelectedArea"==n)r.visualBlock?(o=Je(Math.min(i.head.line,i.anchor.line),Math.max(i.head.ch+1,i.anchor.ch)),a=Math.abs(i.head.line-i.anchor.line)+1):o=i.head.line>=i.anchor.line?V(i.head,0,1):Je(i.anchor.line,0);else if("inplace"==n&&r.visualMode)return;e.setOption("disableInput",!1),t&&t.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),Ge.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),Ge.signal(e,"vim-mode-change",{mode:"insert"})),z.macroModeState.isPlaying||(e.on("change",qe),Ge.on(e.getInputField(),"keydown",Ue)),r.visualMode&&le(e),ie(e,o,a)}},toggleVisualMode:function(e,t,r){var n,i=t.repeat,o=e.getCursor();r.visualMode?r.visualLine^t.linewise||r.visualBlock^t.blockwise?(r.visualLine=!!t.linewise,r.visualBlock=!!t.blockwise,Ge.signal(e,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),ae(e)):le(e):(r.visualMode=!0,r.visualLine=!!t.linewise,r.visualBlock=!!t.blockwise,n=K(e,Je(o.line,o.ch+i-1),!0),r.sel={anchor:o,head:n},Ge.signal(e,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""}),ae(e),ve(e,r,"<",J(o,n)),ve(e,r,">",Z(o,n)))},reselectLastSelection:function(e,t,r){var n=r.lastSelection;if(r.visualMode&&oe(e,r),n){var i=n.anchorMark.find(),o=n.headMark.find();if(!i||!o)return;r.sel={anchor:i,head:o},r.visualMode=!0,r.visualLine=n.visualLine,r.visualBlock=n.visualBlock,ae(e),ve(e,r,"<",J(i,o)),ve(e,r,">",Z(i,o)),Ge.signal(e,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""})}},joinLines:function(e,t,r){var n,i;if(r.visualMode){if(n=e.getCursor("anchor"),Q(i=e.getCursor("head"),n)){var o=i;i=n,n=o}i.ch=te(e,i.line)-1}else{var a=Math.max(t.repeat,2);n=e.getCursor(),i=K(e,Je(n.line+a-1,1/0))}for(var s=0,l=n.line;l<i.line;l++){s=te(e,n.line),o=Je(n.line+1,te(e,n.line+1));var c=e.getRange(n,o);c=c.replace(/\n\s*/g," "),e.replaceRange(c,n,o)}var u=Je(n.line,s);r.visualMode&&le(e,!1),e.setCursor(u)},newLineAndEnterInsertMode:function(e,t,r){r.insertMode=!0;var n=X(e.getCursor());n.line!==e.firstLine()||t.after?(n.line=t.after?n.line:n.line-1,n.ch=te(e,n.line),e.setCursor(n),(Ge.commands.newlineAndIndentContinueComment||Ge.commands.newlineAndIndent)(e)):(e.replaceRange("\n",Je(e.firstLine(),0)),e.setCursor(e.firstLine(),0)),this.enterInsertMode(e,{repeat:t.repeat},r)},paste:function(n,e,t){var r,i,o,a,s,l=X(n.getCursor()),c=z.registerController.getRegister(e.registerName);if(v=c.toString()){if(e.matchIndent){var u=n.getOption("tabSize"),f=function(e){var t=e.split("\t").length-1,r=e.split(" ").length-1;return t*u+1*r},d=n.getLine(n.getCursor().line),h=f(d.match(/^\s*/)[0]),p=v.replace(/\n$/,""),m=v!==p,g=f(v.match(/^\s*/)[0]),v=p.replace(/^\s*/gm,function(e){var t=h+(f(e)-g);if(t<0)return"";if(n.getOption("indentWithTabs")){var r=Math.floor(t/u);return Array(r+1).join("\t")}return Array(t+1).join(" ")});v+=m?"\n":""}1<e.repeat&&(v=Array(e.repeat+1).join(v));var y,b,x,w,k,C,S,_,L,M,T=c.linewise,A=c.blockwise;if(T)t.visualMode?v=t.visualLine?v.slice(0,-1):"\n"+v.slice(0,v.length-1)+"\n":e.after?(v="\n"+v.slice(0,v.length-1),l.ch=te(n,l.line)):l.ch=0;else{if(A){v=v.split("\n");for(var O=0;O<v.length;O++)v[O]=""==v[O]?" ":v[O]}l.ch+=e.after?1:0}if(t.visualMode){var E;t.lastPastedText=v;var N=(x=n,k=(w=t).lastSelection,w.visualMode?(C=x.listSelections(),S=C[0],_=C[C.length-1],L=Q(S.anchor,S.head)?S.anchor:S.head,M=Q(_.anchor,_.head)?_.head:_.anchor,[L,M]):function(){var e=x.getCursor(),t=x.getCursor(),r=k.visualBlock;if(r){var n=r.width,i=r.height;t=Je(e.line+i,e.ch+n);for(var o=[],a=e.line;a<t.line;a++){var s=Je(a,e.ch),l=Je(a,t.ch),c={anchor:s,head:l};o.push(c)}x.setSelections(o)}else{var u=k.anchorMark.find(),f=k.headMark.find(),d=f.line-u.line,h=f.ch-u.ch;t={line:t.line+d,ch:d?t.ch:h+t.ch},k.visualLine&&(e=Je(e.line,0),t=Je(t.line,te(x,t.line))),x.setSelection(e,t)}return[e,t]}()),I=N[0],P=N[1],R=n.getSelection(),B=n.listSelections(),D=new Array(B.length).join("1").split("1");t.lastSelection&&(E=t.lastSelection.headMark.find()),z.registerController.unnamedRegister.setText(R),y=A?(n.replaceSelections(D),P=Je(I.line+v.length-1,I.ch),n.setCursor(I),ne(n,P),n.replaceSelections(v),I):t.visualBlock?(n.replaceSelections(D),n.setCursor(I),n.replaceRange(v,I,I),I):(n.replaceRange(v,I,P),n.posFromIndex(n.indexFromPos(I)+v.length-1)),E&&(t.lastSelection.headMark=n.setBookmark(E)),T&&(y.ch=0)}else if(A){for(n.setCursor(l),O=0;O<v.length;O++){var F=l.line+O;F>n.lastLine()&&n.replaceRange("\n",Je(F,0)),te(n,F)<l.ch&&(r=n,i=F,o=l.ch,void 0,a=te(r,i),s=new Array(o-a+1).join(" "),r.setCursor(Je(i,a)),r.replaceRange(s,r.getCursor()))}n.setCursor(l),ne(n,Je(l.line+v.length-1,l.ch)),n.replaceSelections(v),y=l}else n.replaceRange(v,l),y=T&&e.after?Je(l.line+1,ce(n.getLine(l.line+1))):T&&!e.after?Je(l.line,ce(n.getLine(l.line))):!T&&e.after?(b=n.indexFromPos(l),n.posFromIndex(b+v.length-1)):(b=n.indexFromPos(l),n.posFromIndex(b+v.length));t.visualMode&&le(n,!1),n.setCursor(y)}},undo:function(e,t){e.operation(function(){G(e,Ge.commands.undo,t.repeat)(),e.setCursor(e.getCursor("anchor"))})},redo:function(e,t){G(e,Ge.commands.redo,t.repeat)()},setRegister:function(e,t,r){r.inputState.registerName=t.selectedCharacter},setMark:function(e,t,r){ve(e,r,t.selectedCharacter,e.getCursor())},replace:function(e,t,r){var n,i,o=t.selectedCharacter,a=e.getCursor(),s=e.listSelections();if(r.visualMode)a=e.getCursor("start"),i=e.getCursor("end");else{var l=e.getLine(a.line);(n=a.ch+t.repeat)>l.length&&(n=l.length),i=Je(a.line,n)}if("\n"==o)r.visualMode||e.replaceRange("",a,i),(Ge.commands.newlineAndIndentContinueComment||Ge.commands.newlineAndIndent)(e);else{var c=e.getRange(a,i);if(c=c.replace(/[^\n]/g,o),r.visualBlock){var u=new Array(e.getOption("tabSize")+1).join(" ");c=(c=e.getSelection()).replace(/\t/g,u).replace(/[^\n]/g,o).split("\n"),e.replaceSelections(c)}else e.replaceRange(c,a,i);r.visualMode?(a=Q(s[0].anchor,s[0].head)?s[0].anchor:s[0].head,e.setCursor(a),le(e,!1)):e.setCursor(V(i,0,-1))}},incrementNumberToken:function(e,t){for(var r,n,i,o,a=e.getCursor(),s=e.getLine(a.line),l=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(r=l.exec(s))&&(i=(n=r.index)+r[0].length,!(a.ch<i)););if((t.backtrack||!(i<=a.ch))&&r){var c=r[2]||r[4],u=r[3]||r[5],f=t.increase?1:-1,d={"0b":2,0:8,"":10,"0x":16}[c.toLowerCase()];o=(parseInt(r[1]+u,d)+f*t.repeat).toString(d);var h=c?new Array(u.length-o.length+1+r[1].length).join("0"):"";o="-"===o.charAt(0)?"-"+c+h+o.substr(1):c+h+o;var p=Je(a.line,n),m=Je(a.line,i);e.replaceRange(o,p,m),e.setCursor(Je(a.line,n+o.length-1))}},repeatLastEdit:function(e,t,r){if(r.lastEditInputState){var n=t.repeat;n&&t.repeatIsExplicit?r.lastEditInputState.repeatOverride=n:n=r.lastEditInputState.repeatOverride||n,Ve(e,r,n,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:Fe};function K(e,t,r){var n=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=te(e,n)-1;i=r?i+1:i;var o=Math.min(Math.max(0,t.ch),i);return Je(n,o)}function U(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function V(e,t,r){return"object"==typeof t&&(r=t.ch,t=t.line),Je(e.line+t,e.ch+r)}function $(e,t){if("<character>"!=t.slice(-11))return e==t?"full":0==t.indexOf(e)&&"partial";var r=t.length-11,n=e.slice(0,r),i=t.slice(0,r);return n==i&&e.length>r?"full":0==i.indexOf(n)&&"partial"}function G(t,r,n){return function(){for(var e=0;e<n;e++)r(t)}}function X(e){return Je(e.line,e.ch)}function Y(e,t){return e.ch==t.ch&&e.line==t.line}function Q(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function J(e,t){return 2<arguments.length&&(t=J.apply(void 0,Array.prototype.slice.call(arguments,1))),Q(e,t)?e:t}function Z(e,t){return 2<arguments.length&&(t=Z.apply(void 0,Array.prototype.slice.call(arguments,1))),Q(e,t)?t:e}function ee(e,t,r){var n=Q(e,t),i=Q(t,r);return n&&i}function te(e,t){return e.getLine(t).length}function re(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ne(e,t){var r=[],n=e.listSelections(),i=X(e.clipPos(t)),o=!Y(t,i),a=function(e,t,r){for(var n=0;n<e.length;n++){var i="head"!=r&&Y(e[n].anchor,t),o="anchor"!=r&&Y(e[n].head,t);if(i||o)return n}return-1}(n,e.getCursor("head")),s=Y(n[a].head,n[a].anchor),l=n.length-1,c=a<l-a?l:0,u=n[c].anchor,f=Math.min(u.line,i.line),d=Math.max(u.line,i.line),h=u.ch,p=i.ch,m=n[c].head.ch-h,g=p-h;0<m&&g<=0?(h++,o||p--):m<0&&0<=g?(h--,s||p++):m<0&&-1==g&&(h--,p++);for(var v=f;v<=d;v++){var y={anchor:new Je(v,h),head:new Je(v,p)};r.push(y)}return e.setSelections(r),t.ch=p,u.ch=h,u}function ie(e,t,r){for(var n=[],i=0;i<r;i++){var o=V(t,i,0);n.push({anchor:o,head:o})}e.setSelections(n,0)}function oe(e,t){var r=t.sel.anchor,n=t.sel.head;t.lastPastedText&&(n=e.posFromIndex(e.indexFromPos(r)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(r),headMark:e.setBookmark(n),anchor:X(r),head:X(n),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function ae(e,t,r){var n=e.state.vim,i=se(e,t=t||n.sel,r=r||n.visualLine?"line":n.visualBlock?"block":"char");e.setSelections(i.ranges,i.primary),je(e)}function se(e,t,r,n){var i=X(t.head),o=X(t.anchor);if("char"==r){var a=n||Q(t.head,t.anchor)?0:1,s=Q(t.head,t.anchor)?1:0;return i=V(t.head,0,a),{ranges:[{anchor:o=V(t.anchor,0,s),head:i}],primary:0}}if("line"==r){if(Q(t.head,t.anchor))i.ch=0,o.ch=te(e,o.line);else{o.ch=0;var l=e.lastLine();i.line>l&&(i.line=l),i.ch=te(e,i.line)}return{ranges:[{anchor:o,head:i}],primary:0}}if("block"==r){for(var c=Math.min(o.line,i.line),u=Math.min(o.ch,i.ch),f=Math.max(o.line,i.line),d=Math.max(o.ch,i.ch)+1,h=f-c+1,p=i.line==c?0:h-1,m=[],g=0;g<h;g++)m.push({anchor:Je(c+g,u),head:Je(c+g,d)});return{ranges:m,primary:p}}}function le(e,t){var r=e.state.vim;!1!==t&&e.setCursor(K(e,r.sel.head)),oe(e,r),r.visualMode=!1,r.visualLine=!1,r.visualBlock=!1,Ge.signal(e,"vim-mode-change",{mode:"normal"}),r.fakeCursor&&r.fakeCursor.clear()}function ce(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ue(e,t,r,n,i){for(var o,a,s=(a=(o=e).getCursor("head"),1==o.getSelection().length&&(a=J(a,o.getCursor("anchor"))),a),l=e.getLine(s.line),c=s.ch,u=i?g[0]:v[0];!u(l.charAt(c));)if(++c>=l.length)return null;n?u=v[0]:(u=g[0])(l.charAt(c))||(u=g[1]);for(var f=c,d=c;u(l.charAt(f))&&f<l.length;)f++;for(;u(l.charAt(d))&&0<=d;)d--;if(d++,t){for(var h=f;/\s/.test(l.charAt(f))&&f<l.length;)f++;if(h==f){for(var p=d;/\s/.test(l.charAt(d-1))&&0<d;)d--;d||(d=p)}}return{start:Je(s.line,d),end:Je(s.line,f)}}function fe(e,t,r){Y(t,r)||z.jumpList.add(e,t,r)}function de(e,t){z.lastCharacterSearch.increment=e,z.lastCharacterSearch.forward=t.forward,z.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var he={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},pe={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,1<=e.depth)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function me(e,t,r,n,i){var o=t.line,a=t.ch,s=e.getLine(o),l=r?1:-1,c=n?v:g;if(i&&""==s){if(o+=l,s=e.getLine(o),!y(e,o))return null;a=r?0:s.length}for(;;){if(i&&""==s)return{from:0,to:0,line:o};for(var u=0<l?s.length:-1,f=u,d=u;a!=u;){for(var h=!1,p=0;p<c.length&&!h;++p)if(c[p](s.charAt(a))){for(f=a;a!=u&&c[p](s.charAt(a));)a+=l;if(h=f!=(d=a),f==t.ch&&o==t.line&&d==f+l)continue;return{from:Math.min(f,d+1),to:Math.max(f,d),line:o}}h||(a+=l)}if(!y(e,o+=l))return null;s=e.getLine(o),a=0<l?0:s.length}}function ge(e,t,r,n){for(var i,o=e.getCursor(),a=o.ch,s=0;s<t;s++){if(-1==(l=a,c=e.getLine(o.line),u=n,f=!0,d=void 0,r?-1==(d=c.indexOf(u,l+1))||f||(d-=1):-1==(d=c.lastIndexOf(u,l-1))||f||(d+=1),i=d))return null;a=i}var l,c,u,f,d;return Je(e.getCursor().line,i)}function ve(e,t,r,n){w(r,d)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function ye(t,e,r,n,i){var o,a=e.line,s=t.firstLine(),l=t.lastLine(),c=a;function u(e){return!t.getLine(e)}function f(e,t,r){return r?u(e)!=u(e+t):!u(e)&&u(e+t)}if(n){for(;s<=c&&c<=l&&0<r;)f(c,n)&&r--,c+=n;return new Je(c,0)}var d=t.state.vim;if(d.visualLine&&f(a,1,!0)){var h=d.sel.anchor;f(h.line,-1,!0)&&(i&&h.line==a||(a+=1))}var p=u(a);for(c=a;c<=l&&r;c++)f(c,1,!0)&&(i&&u(c)==p||r--);for(o=new Je(c,0),l<c&&!p?p=!0:i=!1,c=a;s<c&&(i&&u(c)!=p&&c!=a||!f(c,-1,!0));c--);return{start:new Je(c,0),end:o}}function be(){}function xe(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new be)}function we(e,t){var r=ke(e,t)||[];if(!r.length)return[];var n=[];if(0===r[0]){for(var i=0;i<r.length;i++)"number"==typeof r[i]&&n.push(e.substring(r[i]+1,r[i+1]));return n}}function ke(e,t){t||(t="/");for(var r=!1,n=[],i=0;i<e.length;i++){var o=e.charAt(i);r||o!=t||n.push(i),r=!r&&"\\"==o}return n}C("pcre",!0,"boolean"),be.prototype={getQuery:function(){return z.query},setQuery:function(e){z.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return z.isReversed},setReversed:function(e){z.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Ce={"\\n":"\n","\\r":"\r","\\t":"\t"};var Se={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"};function _e(e,t,r){if(z.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var n,i,o=ke(e,"/");return o.length?(n=e.substring(0,o[0]),i=-1!=e.substring(o[0]).indexOf("i")):n=e,n?(_("pcre")||(n=function(e){for(var t=!1,r=[],n=-1;n<e.length;n++){var i=e.charAt(n)||"",o=e.charAt(n+1)||"",a=o&&-1!="|(){".indexOf(o);t?("\\"===i&&a||r.push(i),t=!1):"\\"===i?(t=!0,o&&-1!="}".indexOf(o)&&(a=!0),a&&"\\"!==o||r.push(i)):(r.push(i),a&&"\\"!==o&&r.push("\\"))}return r.join("")}(n)),r&&(t=/^[^A-Z]*$/.test(n)),new RegExp(n,t||i?"i":void 0)):null}function Le(e,t){e.openNotification?e.openNotification('<span style="color: red">'+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}var Me="(Javascript regexp)";function Te(e,t){var r,n,i,o,a,s,l,c,u=(t.prefix||"")+" "+(t.desc||""),f=(r=t.prefix,n=t.desc,i='<span style="font-family: monospace; white-space: pre">'+(r||"")+'<input type="text"></span>',n&&(i+=' <span style="color: #888">'+n+"</span>"),i);o=e,a=f,s=u,l=t.onClose,c=t,o.openDialog?o.openDialog(a,l,{bottom:!0,value:c.value,onKeyDown:c.onKeyDown,onKeyUp:c.onKeyUp,selectValueOnOpen:!1}):l(prompt(s,""))}function Ae(e,t,r,n){if(t){var i=xe(e),o=_e(t,!!r,!!n);if(o)return Oe(e,o),function(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;n<r.length;n++){var i=r[n];if(e[i]!==t[i])return!1}return!0}return!1}(o,i.getQuery())||i.setQuery(o),o}}function Oe(e,t){var r=xe(e),n=r.getOverlay();n&&t==n.query||(n&&e.removeOverlay(n),n=function(r){if("^"==r.source.charAt(0))var n=!0;return{token:function(e){if(!n||e.sol()){var t=e.match(r,!1);if(t)return 0==t[0].length?(e.next(),"searching"):e.sol()||(e.backUp(1),r.exec(e.next()+t[0]))?(e.match(r),"searching"):(e.next(),null);for(;!e.eol()&&(e.next(),!e.match(r,!1)););}else e.skipToEnd()},query:r}}(t),e.addOverlay(n),e.showMatchesOnScrollbar&&(r.getScrollbarAnnotate()&&r.getScrollbarAnnotate().clear(),r.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),r.setOverlay(n))}function Ee(i,o,a,s){return void 0===s&&(s=1),i.operation(function(){for(var e=i.getCursor(),t=i.getSearchCursor(a,e),r=0;r<s;r++){var n=t.find(o);if(0==r&&n&&Y(t.from(),e)&&(n=t.find(o)),!n&&!(t=i.getSearchCursor(a,o?Je(i.lastLine()):Je(i.firstLine(),0))).find(o))return}return t.from()})}function Ne(e){var t=xe(e);e.removeOverlay(xe(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Ie(e){var t=e.getScrollInfo(),r=e.coordsChar({left:0,top:6+t.top},"local"),n=t.clientHeight-10+t.top,i=e.coordsChar({left:0,top:n},"local");return{top:r.line,bottom:i.line}}function Pe(e,t,r){if("'"==r){var n=e.doc.history.done,i=n[n.length-2];return i&&i.ranges&&i.ranges[0].head}if("."==r){if(0==e.doc.history.lastModTime)return;var o=e.doc.history.done.filter(function(e){if(void 0!==e.changes)return e});return o.reverse(),o[0].changes[0].to}var a=t.marks[r];return a&&a.find()}var Re=function(){this.buildCommandMap_()};Re.prototype={processCommand:function(e,t,r){var n=this;e.operation(function(){e.curOp.isVimOp=!0,n._processCommand(e,t,r)})},_processCommand:function(t,e,r){var n=t.state.vim,i=z.registerController.getRegister(":"),o=i.toString();n.visualMode&&le(t);var a=new Ge.StringStream(e);i.setText(e);var s,l,c=r||{};c.input=e;try{this.parseInput_(t,a,c)}catch(e){throw Le(t,e),e}if(c.commandName){if(s=this.matchCommand_(c.commandName)){if(l=s.name,s.excludeFromCommandHistory&&i.setText(o),this.parseCommandArgs_(a,c,s),"exToKey"==s.type){for(var u=0;u<s.toKeys.length;u++)Ge.Vim.handleKey(t,s.toKeys[u],"mapping");return}if("exToEx"==s.type)return void this.processCommand(t,s.toInput)}}else void 0!==c.line&&(l="move");if(l)try{Be[l](t,c),s&&s.possiblyAsync||!c.callback||c.callback()}catch(e){throw Le(t,e),e}else Le(t,'Not an editor command ":'+e+'"')},parseInput_:function(e,t,r){t.eatWhile(":"),t.eat("%")?(r.line=e.firstLine(),r.lineEnd=e.lastLine()):(r.line=this.parseLineSpec_(e,t),void 0!==r.line&&t.eat(",")&&(r.lineEnd=this.parseLineSpec_(e,t)));var n=t.match(/^(\w+)/);return r.commandName=n?n[1]:t.match(/.*/)[0],r},parseLineSpec_:function(e,t){var r=t.match(/^(\d+)/);if(r)return parseInt(r[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var n=t.next(),i=Pe(e,e.state.vim,n);if(!i)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,i.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var r=e.match(/^([+-])?(\d+)/);if(r){var n=parseInt(r[2],10);"-"==r[1]?t-=n:t+=n}return t},parseCommandArgs_:function(e,t,r){if(!e.eol()){t.argString=e.match(/.*/)[0];var n=r.argDelimiter||/\s+/,i=re(t.argString).split(n);i.length&&i[0]&&(t.args=i)}},matchCommand_:function(e){for(var t=e.length;0<t;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<Qe.length;e++){var t=Qe[e],r=t.shortName||t.name;this.commandMap_[r]=t}},map:function(e,t,r){if(":"!=e&&":"==e.charAt(0)){if(r)throw Error("Mode not supported for ex mappings");var n=e.substring(1);":"!=t&&":"==t.charAt(0)?this.commandMap_[n]={name:n,type:"exToEx",toInput:t.substring(1),user:!0}:this.commandMap_[n]={name:n,type:"exToKey",toKeys:t,user:!0}}else if(":"!=t&&":"==t.charAt(0)){var i={keys:e,type:"keyToEx",exArgs:{input:t.substring(1)}};r&&(i.context=r),Xe.unshift(i)}else i={keys:e,type:"keyToKey",toKeys:t},r&&(i.context=r),Xe.unshift(i)},unmap:function(e,t){if(":"!=e&&":"==e.charAt(0)){if(t)throw Error("Mode not supported for ex mappings");var r=e.substring(1);if(this.commandMap_[r]&&this.commandMap_[r].user)return void delete this.commandMap_[r]}else for(var n=e,i=0;i<Xe.length;i++)if(n==Xe[i].keys&&Xe[i].context===t)return void Xe.splice(i,1);throw Error("No such mapping.")}};var Be={colorscheme:function(e,t){!t.args||t.args.length<1?Le(e,e.getOption("theme")):e.setOption("theme",t.args[0])},map:function(e,t,r){var n=t.args;!n||n.length<2?e&&Le(e,"Invalid mapping: "+t.input):De.map(n[0],n[1],r)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,r){var n=t.args;!n||n.length<1?e&&Le(e,"No such mapping: "+t.input):De.unmap(n[0],r)},move:function(e,t){F.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var r=t.args,n=t.setCfg||{};if(!r||r.length<1)e&&Le(e,"Invalid mapping: "+t.input);else{var i=r[0].split("="),o=i[0],a=i[1],s=!1;if("?"==o.charAt(o.length-1)){if(a)throw Error("Trailing characters: "+t.argString);o=o.substring(0,o.length-1),s=!0}void 0===a&&"no"==o.substring(0,2)&&(o=o.substring(2),a=!1);var l=k[o]&&"boolean"==k[o].type;if(l&&null==a&&(a=!0),!l&&void 0===a||s){var c=_(o,e,n);c instanceof Error?Le(e,c.message):Le(e,!0===c||!1===c?" "+(c?"":"no")+o:" "+o+"="+c)}else{var u=S(o,a,e,n);u instanceof Error&&Le(e,u.message)}}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var r=t.args,n=z.registerController.registers,i="----------Registers----------<br><br>";if(r){r=r.join("");for(var o=0;o<r.length;o++)a=r.charAt(o),z.registerController.isValidRegister(a)&&(i+='"'+a+" "+(n[a]||new R).toString()+"<br>")}else for(var a in n){var s=n[a].toString();s.length&&(i+='"'+a+" "+s+"<br>")}Le(e,i)},sort:function(e,o){var a,s,l,c,u,t=function(){if(o.argString){var e=new Ge.StringStream(o.argString);if(e.eat("!")&&(a=!0),e.eol())return;if(!e.eatSpace())return"Invalid arguments";var t=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!t&&!e.eol())return"Invalid arguments";if(t[1]){s=-1!=t[1].indexOf("i"),l=-1!=t[1].indexOf("u");var r=-1!=t[1].indexOf("d")||-1!=t[1].indexOf("n")&&1,n=-1!=t[1].indexOf("x")&&1,i=-1!=t[1].indexOf("o")&&1;if(1<r+n+i)return"Invalid arguments";c=(r?"decimal":n&&"hex")||i&&"octal"}t[2]&&(u=new RegExp(t[2].substr(1,t[2].length-2),s?"i":""))}}();if(t)Le(e,t+": "+o.argString);else{var r=o.line||e.firstLine(),n=o.lineEnd||o.line||e.lastLine();if(r!=n){var i=Je(r,0),f=Je(n,te(e,n)),d=e.getRange(i,f).split("\n"),h=u||("decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null),p="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,m=[],g=[];if(c||u)for(var v=0;v<d.length;v++){var y=u?d[v].match(u):null;y&&""!=y[0]?m.push(y):!u&&h.exec(d[v])?m.push(d[v]):g.push(d[v])}else g=d;if(m.sort(u?function(e,t){var r;return a&&(r=e,e=t,t=r),s&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}:w),u)for(v=0;v<m.length;v++)m[v]=m[v].input;else c||g.sort(w);if(d=a?m.concat(g):g.concat(m),l){var b,x=d;for(d=[],v=0;v<x.length;v++)x[v]!=b&&d.push(x[v]),b=x[v]}e.replaceRange(d.join("\n"),i,f)}}function w(e,t){var r;a&&(r=e,e=t,t=r),s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&h.exec(e),i=c&&h.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),p))-(i=parseInt((i[1]+i[2]).toLowerCase(),p)):e<t?-1:1}},global:function(t,e){var r=e.argString;if(r){var n,i=void 0!==e.line?e.line:t.firstLine(),o=e.lineEnd||e.line||t.lastLine(),a=we(r,"/"),s=r;if(a.length&&(s=a[0],n=a.slice(1,a.length).join("/")),s)try{Ae(t,s,!0,!0)}catch(e){return void Le(t,"Invalid regex: "+s)}for(var l=xe(t).getQuery(),c=[],u="",f=i;f<=o;f++)l.test(t.getLine(f))&&(c.push(f+1),u+=t.getLine(f)+"<br>");if(n){var d=0,h=function(){if(d<c.length){var e=c[d]+n;De.processCommand(t,e,{callback:h})}d++};h()}else Le(t,u)}else Le(t,"Regular Expression missing from global")},substitute:function(t,e){if(!t.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var r,n,i,o,a=e.argString,s=a?we(a,a[0]):[],l="",c=!1,u=!1;if(s.length)r=s[0],l=s[1],r&&"$"===r[r.length-1]&&(r=r.slice(0,r.length-1)+"\\n",l=l?l+"\n":"\n"),void 0!==l&&(l=_("pcre")?function(e){for(var t=new Ge.StringStream(e),r=[];!t.eol();){for(;t.peek()&&"\\"!=t.peek();)r.push(t.next());var n=!1;for(var i in Se)if(t.match(i,!0)){n=!0,r.push(Se[i]);break}n||r.push(t.next())}return r.join("")}(l):function(e){for(var t,r=!1,n=[],i=-1;i<e.length;i++){var o=e.charAt(i)||"",a=e.charAt(i+1)||"";Ce[o+a]?(n.push(Ce[o+a]),i++):r?(n.push(o),r=!1):"\\"===o?(r=!0,t=a,m.test(t)||"$"===a?n.push("$"):"/"!==a&&"\\"!==a&&n.push("\\")):("$"===o&&n.push("$"),n.push(o),"/"===a&&n.push("\\"))}return n.join("")}(l),z.lastSubstituteReplacePart=l),n=s[2]?s[2].split(" "):[];else if(a&&a.length)return void Le(t,"Substitutions should be of the form :s/pattern/replace/");if(n&&(i=n[0],o=parseInt(n[1]),i&&(-1!=i.indexOf("c")&&(c=!0,i.replace("c","")),-1!=i.indexOf("g")&&(u=!0,i.replace("g","")),r=r.replace(/\//g,"\\/")+"/"+i)),r)try{Ae(t,r,!0,!0)}catch(e){return void Le(t,"Invalid regex: "+r)}if(void 0!==(l=l||z.lastSubstituteReplacePart)){var f=xe(t).getQuery(),d=void 0!==e.line?e.line:t.getCursor().line,h=e.lineEnd||d;d==t.firstLine()&&h==t.lastLine()&&(h=1/0),o&&(h=(d=h)+o-1);var p=K(t,Je(d,0));!function(i,e,n,o,a,s,r,l,c){var u=!(i.state.vim.exMode=!0),f=s.from();function d(){i.operation(function(){for(;!u;)h(),p();m()})}function h(){var e=i.getRange(s.from(),s.to()),t=e.replace(r,l);s.replace(t)}function p(){for(;s.findNext()&&(e=s.from(),t=o,r=a,"number"!=typeof e&&(e=e.line),t instanceof Array?w(e,t):r?t<=e&&e<=r:e==t);)if(n||!f||s.from().line!=f.line)return i.scrollIntoView(s.from(),30),i.setSelection(s.from(),s.to()),f=s.from(),void(u=!1);var e,t,r;u=!0}function m(e){if(e&&e(),i.focus(),f){i.setCursor(f);var t=i.state.vim;t.exMode=!1,t.lastHPos=t.lastHSPos=f.ch}c&&c()}p(),u?Le(i,"No matches for "+r.source):e?Te(i,{prefix:"replace with <strong>"+l+"</strong> (y/n/a/q/l)",onKeyDown:function(e,t,r){switch(Ge.e_stop(e),Ge.keyName(e)){case"Y":h(),p();break;case"N":p();break;case"A":var n=c;c=void 0,i.operation(d),c=n;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":m(r)}return u&&m(r),!0}}):(d(),c&&c())}(t,c,u,d,h,t.getSearchCursor(f,p),f,l,e.callback)}else Le(t,"No previous substitute regular expression")},redo:Ge.commands.redo,undo:Ge.commands.undo,write:function(e){Ge.commands.save?Ge.commands.save(e):e.save&&e.save()},nohlsearch:function(e){Ne(e)},yank:function(e){var t=X(e.getCursor()).line,r=e.getLine(t);z.registerController.pushText("0","yank",r,!0,!0)},delmarks:function(e,t){if(t.argString&&re(t.argString))for(var r=e.state.vim,n=new Ge.StringStream(re(t.argString));!n.eol();){n.eatSpace();var i=n.pos;if(!n.match(/[a-zA-Z]/,!1))return void Le(e,"Invalid argument: "+t.argString.substring(i));var o=n.next();if(n.match("-",!0)){if(!n.match(/[a-zA-Z]/,!1))return void Le(e,"Invalid argument: "+t.argString.substring(i));var a=o,s=n.next();if(!(p(a)&&p(s)||b(a)&&b(s)))return void Le(e,"Invalid argument: "+a+"-");var l=a.charCodeAt(0),c=s.charCodeAt(0);if(c<=l)return void Le(e,"Invalid argument: "+t.argString.substring(i));for(var u=0;u<=c-l;u++){var f=String.fromCharCode(l+u);delete r.marks[f]}}else delete r.marks[o]}else Le(e,"Argument required")}},De=new Re;function Fe(e){var t=e.state.vim,r=z.macroModeState,n=z.registerController.getRegister("."),i=r.isPlaying,o=r.lastInsertModeChanges;i||(e.off("change",qe),Ge.off(e.getInputField(),"keydown",Ue)),!i&&1<t.insertModeRepeat&&(Ve(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),n.setText(o.changes.join("")),Ge.signal(e,"vim-mode-change",{mode:"normal"}),r.isRecording&&function(e){if(!e.isPlaying){var t=e.latestRegister,r=z.registerController.getRegister(t);r&&r.pushInsertModeChanges&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}(r)}function ze(e){Xe.unshift(e)}function We(e,t,r,n){var i=z.registerController.getRegister(n);if(":"==n)return i.keyBuffer[0]&&De.processCommand(e,i.keyBuffer[0]),void(r.isPlaying=!1);var o=i.keyBuffer,a=0;r.isPlaying=!0,r.replaySearchQueries=i.searchQueries.slice(0);for(var s=0;s<o.length;s++)for(var l,c,u=o[s];u;)if(c=(l=/<\w+-.+?>|<\w+>|./.exec(u))[0],u=u.substring(l.index+c.length),Ge.Vim.handleKey(e,c,"macro"),t.insertMode){var f=i.insertModeChanges[a++].changes;$e(e,z.macroModeState.lastInsertModeChanges.changes=f,1),Fe(e)}r.isPlaying=!1}function qe(e,t){var r=z.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,1<n.ignoreCount)n.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var i=e.listSelections().length;1<i&&(n.ignoreCount=i);var o=t.text.join("\n");n.maybeReset&&(n.changes=[],n.maybeReset=!1),o&&(e.state.overwrite&&!/\n/.test(o)?n.changes.push([o]):n.changes.push(o))}t=t.next}}function He(e){var t=e.state.vim;if(t.insertMode){var r=z.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.maybeReset=!0}else e.curOp.isVimOp||function(e,t){var r=e.getCursor("anchor"),n=e.getCursor("head");if(t.visualMode&&!e.somethingSelected()?le(e,!1):t.visualMode||t.insertMode||!e.somethingSelected()||(t.visualMode=!0,t.visualLine=!1,Ge.signal(e,"vim-mode-change",{mode:"visual"})),t.visualMode){var i=Q(n,r)?0:-1,o=Q(n,r)?-1:0;n=V(n,0,i),r=V(r,0,o),t.sel={anchor:r,head:n},ve(e,t,"<",J(n,r)),ve(e,t,">",Z(n,r))}else t.insertMode||(t.lastHPos=e.getCursor().ch)}(e,t);t.visualMode&&je(e)}function je(e){var t=e.state.vim,r=K(e,X(t.sel.head)),n=V(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function Ke(e){this.keyName=e}function Ue(e){var t=z.macroModeState.lastInsertModeChanges,r=Ge.keyName(e);r&&(-1==r.indexOf("Delete")&&-1==r.indexOf("Backspace")||Ge.lookupKey(r,"vim-insert",function(){return t.maybeReset&&(t.changes=[],t.maybeReset=!1),t.changes.push(new Ke(r)),!0}))}function Ve(r,n,e,t){var i=z.macroModeState;i.isPlaying=!0;var o=!!n.lastEditActionCommand,a=n.inputState;function s(){o?F.processAction(r,n,n.lastEditActionCommand):F.evalInput(r,n)}function l(e){if(0<i.lastInsertModeChanges.changes.length){e=n.lastEditActionCommand?e:1;var t=i.lastInsertModeChanges;$e(r,t.changes,e)}}if(n.inputState=n.lastEditInputState,o&&n.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c<e;c++)s(),l(1);else t||s(),l(e);n.inputState=a,n.insertMode&&!t&&Fe(r),i.isPlaying=!1}function $e(t,e,r){function n(e){return"string"==typeof e?Ge.commands[e](t):e(t),!0}var i,o,a=t.getCursor("head"),s=z.macroModeState.lastInsertModeChanges.inVisualBlock;if(s){var l=t.state.vim.lastSelection,c=(i=l.anchor,{line:(o=l.head).line-i.line,ch:o.line-i.line});ie(t,a,c.line+1),r=t.listSelections().length,t.setCursor(a)}for(var u=0;u<r;u++){s&&t.setCursor(V(a,u,0));for(var f=0;f<e.length;f++){var d=e[f];if(d instanceof Ke)Ge.lookupKey(d.keyName,"vim-insert",n);else if("string"==typeof d){var h=t.getCursor();t.replaceRange(d,h,h)}else{var p=t.getCursor(),m=V(p,0,d[0].length);t.replaceRange(d[0],p,m)}}}s&&t.setCursor(V(a,0,1))}return Ge.keyMap.vim={attach:i,detach:e,call:t},C("insertModeEscKeysTimeout",200,"number"),Ge.keyMap["vim-insert"]={fallthrough:["default"],attach:i,detach:e,call:t},Ge.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:i,detach:e,call:t},O(),E}()}),function(l,u,c,t,f){"use strict";var d,h,o,p=l.getElementById("CodeMirror-settings"),n=l.getElementById("CodeMirror-settings__form"),m=l.getElementById("ed_toolbar"),g=l.getElementById("content")||l.getElementById("newcontent"),r=l.getElementById("content-html"),i=l.getElementById("content-tmce"),a=null!=l.getElementById("post_ID")?l.getElementById("post_ID").value:0,v=l.getElementById("editor-expand-toggle"),y={isVisualEnabled:null!=l.getElementById("content-tmce"),isThemeOrPlugin:null!=l.getElementById("newcontent"),isActive:function(){return null!=d},isVisualActive:function(){return null!=l.getElementsByClassName("tmce-active")[0]},isGutenberg:null!=(wp.data&&wp.data.select("core/edit-post")),isGutenbergVisualActive:function(){return"visual"===wp.data.select("core/edit-post").getEditorMode()},isFullHeight:function(){return!!v&&v.checked},previousSettingsPosition:"none",settingsPosition:function(){var e,t=this;return e=m?"absolute"===m.style.position?"0px"===m.style.top?"top":"bottom":"fixed"===m.style.position?"middle":"normal":"none",u.setTimeout(function(){t.previousSettingsPosition=e},0),e},charWidth:0},b={mode:"wordpresspost",tabMode:"indent",indentWithTabs:!0,smartIndent:!1,enterMode:"keep",styleActiveLine:!0,electricChars:!1,showCursorWhenSelecting:!0,viewportMargin:10,extraKeys:{F11:function(){P()},Esc:function(){P(!0)},"Ctrl-S":function(){e()},"Cmd-S":function(){e()}}};function e(){y.isGutenberg?(Q(),wp.data.dispatch("core/editor").savePost()):(l.getElementById("save-post")||l.getElementById("publish")||l.getElementById("submit")).click()}function s(t){var r=!1;return function(){var e=arguments;r||(t.apply(this,e),r=!0,u.requestAnimationFrame(function(){u.requestAnimationFrame(function(){r=!1})}))}}function x(){for(var e=-1;e<p.children.length;e++){var t=e<0?o:p.children[e];null!=t&&(t.style.position="",t.style.top="",t.style.left="",t.style.right="",t.style.width="")}}var w=s(k);function k(e){S();var t=y.settingsPosition();if(t!==y.previousSettingsPosition||e&&"resize"===e.type)switch(R(),t){case"top":x();break;case"middle":!function(){for(var e=m.getBoundingClientRect(),t=-1;t<p.children.length;t++){var r=t<0?o:p.children[t];null!=r&&(r.style.position="fixed",r.style.top=e.bottom+"px",r.style.right=l.documentElement.getBoundingClientRect().width-e.right+"px",r.id.match(/toggle/gi)||(r.style.left=e.left+"px",r.style.width="auto"))}}();break;case"bottom":!function(){for(var e=m.getBoundingClientRect(),t=d.getWrapperElement().getBoundingClientRect(),r=-1;r<p.children.length;r++){var n=r<0?o:p.children[r];null!=n&&(n.style.position="absolute",n.style.top=-1*(t.top-e.bottom)+"px",n.style.left="",n.style.right="",n.style.width="")}}()}}var C=!!navigator.userAgent.match(/Trident/gi);function S(){if(n){var e=n.getBoundingClientRect().top,t=l.getElementById("post-status-info").getBoundingClientRect().top-e,r=u.innerHeight-e;n.style.maxHeight=Math.min(t,r)-6+"px",C&&(n.style.height=n.style.maxHeight)}}function _(){y.isFullHeight()?(d.setOption("viewportMargin",1/0),d.on("change",R),u.addEventListener("scroll",w),u.addEventListener("resize",w),u.addEventListener("resize",D),d.getWrapperElement().style.height="auto",k(),F(),u.setTimeout(function(){S(),R()},100)):(d.setOption("viewportMargin",b.viewportMargin),d.off("change",R),u.removeEventListener("scroll",w),u.removeEventListener("resize",w),u.removeEventListener("resize",D),d.getWrapperElement().style.marginTop="",n.style.maxHeight="",C&&(n.style.height=""),x(),B())}function L(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.addedNodes[0]&&r.addedNodes[0].classList.contains("CodeMirror-dialog"))for(var n=(o=r.addedNodes[0]).getElementsByTagName("button"),i=0;i<n.length;i++){n[i].classList="button button-small"}else o=void 0}}function M(e){e.target.id.match(/advanced/gi)?p.classList.contains("open-advanced")?T("open"):T("advanced"):p.classList.contains("open")?T("closed"):T("open")}function T(e){switch(e){case"open":p.classList.add("open"),p.classList.remove("open-advanced"),p.classList.remove("closed");break;case"advanced":p.classList.add("open"),p.classList.add("open-advanced"),p.classList.remove("closed");break;default:p.classList.remove("open"),p.classList.remove("open-advanced"),p.classList.add("closed")}}function A(){y.charWidth=d.defaultCharWidth()*(f.fontSize/13)}function O(e){var t=+e.target.value;switch(t=isNaN(t)?e.target.value:t,"checkbox"===e.target.type&&(t=e.target.checked),e.target.id){case"fontSize":f.fontSize=t,h.style.fontSize=t+"px",A(),d.refresh();break;case"lineHeight":f.lineHeight=t,h.style.lineHeight=t+"em",d.refresh();break;case"matchTags":f.matchTags=t,d.setOption("matchTags",t?{bothTags:!0}:null);break;case"scrollbarStyle":f.scrollbarStyle=t,d.setOption("scrollbarStyle",t?"overlay":null);break;case"foldGutter":d.setOption("gutters",t?["CodeMirror-linenumbers","CodeMirror-foldgutter"]:[]);case"tabSize":d.setOption("indentUnit",t);default:f[e.target.id]=t,d.setOption(e.target.id,t)}switch(e.target.id){case"lineNumbers":t&&f.foldGutter&&d.setOption("gutters",["CodeMirror-linenumbers","CodeMirror-foldgutter"])}}function E(){var e=t("#CodeMirror-settings__form").serializeArray();t.post(f.ajaxUrl,e,function(e){})}var N=l.getElementById("wp-content-editor-container"),I="heshFullscreen";function P(e){e=!0===e,y.isFullHeight()?N.classList.remove(I):(N.classList.contains(I)||e?N.classList.remove(I):N.classList.add(I),d.focus())}function R(){d.save(),d.getTextArea().style.height=d.getWrapperElement().getBoundingClientRect().height+"px"}function B(){d.getWrapperElement().style.height=d.getTextArea().style.height}var D=s(F);function F(){d.getWrapperElement().style.marginTop=m.offsetHeight+"px"}var z,W,q=200,H=500;function j(e){W=H+(e.pageY-z),d.getWrapperElement().style.height=Math.max(q,W)+"px"}function K(e){z=e.pageY,!0,l.addEventListener("mousemove",j),l.addEventListener("mouseup",U),e.preventDefault()}function U(e){!1,H=Math.max(q,W),l.removeEventListener("mousemove",j),d.refresh(),l.removeEventListener("mouseup",U)}function V(e){W=H=e,d.getWrapperElement().style.height=H+"px";var t=l.createElement("div");t.className="hesh-content-resize-handle",t.id="content-resize-handle",d.getWrapperElement().appendChild(t),l.getElementById("content-resize-handle").addEventListener("mousedown",K)}function $(){var e=(function(e){var t=("; "+l.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}("hesh_plugin_selection_state")||"0,0,0,0,0,0,0").split(",");a===e[0]&&(d.doc.setSelection({line:+e[1],ch:+e[2]},{line:+e[3],ch:+e[4]},{scroll:!1}),d.scrollTo(+e[5],+e[6]))}var G=s(X);function X(){var e=d.doc.listSelections()[0],t=d.getScrollInfo();l.cookie="hesh_plugin_selection_state="+a+","+e.anchor.line+","+e.anchor.ch+","+e.head.line+","+e.head.ch+","+t.left+","+t.top}function Y(){var t,r,n,e,i,o,a=d.doc.listSelections()[0];t=r=n=0,d.doc.eachLine(function(e){n<=a.head.line-1&&(t+=e.text.length+1),n<=a.anchor.line-1&&(r+=e.text.length+1),n++}),t+=a.head.ch,r+=a.anchor.ch,d.getTextArea().setSelectionRange(Math.min(r,t),Math.max(r,t)),d.getTextArea().focus(),e=d.getTextArea().value.length,i=u.setInterval(function(){e!==d.getTextArea().value.length&&(u.clearInterval(i),function(){var e=d.getTextArea().selectionStart,t=d.getTextArea().selectionEnd,r=d.getScrollInfo(),n={top:u.pageYOffset,left:u.pageXOffset};d.doc.setValue(d.getTextArea().value),d.focus();var i=0,o=0,a=0,s=e,l=t,c=d.getLineHandle(a).text.length+1;for(;c<=s&&c<=l;)a++,c<=s&&(s-=c,i=a),c<=l&&(l-=c,o=a),c=d.getLineHandle(a).text.length+1;d.doc.setSelection({line:i,ch:s},{line:o,ch:l},{scroll:!1}),u.scrollTo(n.left,n.top),d.scrollTo(r.left,r.top),d.save()}())},10),o=function(){u.clearInterval(i),d.off("focus",o)},d.on("focus",o)}function Q(){d.save(),X(),wp.data.dispatch("core/editor").resetBlocks(wp.blocks.parse(d.getTextArea().value)),d.setValue(wp.data.select("core/editor").getEditedPostContent()),$()}function J(){if(!y.isActive()&&(y.isGutenberg&&(g=l.getElementsByClassName("editor-post-text-editor")[0]),null!=g)){var e,t,r,n,i,o,a,s;if(b.theme=f.theme,b.lineNumbers=!!f.lineNumbers,b.foldGutter=!!f.foldGutter,b.gutters=b.foldGutter?["CodeMirror-linenumbers","CodeMirror-foldgutter"]:[],b.tabSize=b.indentUnit=+f.tabSize,b.lineWrapping=!!f.lineWrapping,b.matchBrackets=!!f.matchBrackets,b.autoCloseTags=!!f.autoCloseTags,b.autoCloseBrackets=!!f.autoCloseBrackets,b.surveyNoticeDismissedB=!!f.surveyNoticeDismissedB,b.highlightSelectionMatches=!!f.highlightSelectionMatches,b.matchTags=!!f.matchTags&&{bothTags:!0},b.scrollbarStyle=f.scrollbarStyle?"overlay":null,b.keyMap=f.keyMap,b.autofocus=l.getElementById("title")&&!!l.getElementById("title").value&&0<l.getElementById("title").value.length,y.isThemeOrPlugin&&(e=l.querySelector(".fileedit-sub .alignleft").textContent.match(/\.[a-z\d]{2,}/gi),t=e[e.length-1].match(/[a-z]*/gi)[1],b.mode={php:"php",css:"css",xml:"xml",html:"htmlmixed",js:"javascript",json:"javascript"}[t]),d=c.fromTextArea(g,b),h=d.getWrapperElement().querySelector(".CodeMirror-code"),g.classList.add("CodeMirror-mirrored"),y.isGutenberg?d.on("blur",Q):d.on("change",function(){d.save()}),$(),d.on("cursorActivity",G),d.on("scroll",G),y.isThemeOrPlugin)V(u.innerHeight-d.getWrapperElement().getBoundingClientRect().top-100);else if(y.isGutenberg){V(u.innerHeight-d.getWrapperElement().getBoundingClientRect().top-16)}else m.addEventListener("mousedown",Y),r=u.send_to_editor,u.send_to_editor=function(e){y.isActive()&&"content"===u.wpActiveEditor?(d.replaceSelection(e),d.save()):r(e)},l.getElementById("content-resize-handle").addEventListener("mousedown",function(){l.addEventListener("mousemove",B)}),l.addEventListener("mouseup",function(){l.removeEventListener("mousemove",B)}),v&&(v.addEventListener("change",_),_()),m.insertAdjacentHTML("afterbegin",'<button type="button" id="cm_content_fullscreen" class="ed_button qt-dfw" title="Full Screen"></button>'),l.getElementById("cm_content_fullscreen").onclick=P;!function(){d.getWrapperElement().appendChild(p),p.style.display="block",p.querySelector(".CodeMirror-settings__toggle").addEventListener("click",M),p.querySelector(".CodeMirror-settings__toggle-advanced").addEventListener("click",M),new MutationObserver(L).observe(d.getWrapperElement(),{childList:!0});var e=l.querySelector(".notice-hesh .notice-dismiss");e&&e.addEventListener("click",function(){var e=l.getElementById("surveyNoticeDismissedB");e&&(e.value=!0),E()});for(var t=p.querySelectorAll(".CodeMirror-settings__option"),r=0;r<t.length;r++){var n=t[r];n.addEventListener("change",E),n.addEventListener("change",O)}}(),n=+f.fontSize,i=+f.lineHeight,h.style.fontSize=n+"px",f.fontSize=n,h.style.lineHeight=i+"em",f.lineHeight=i,A(),d.refresh(),o=".CodeMirror pre > * { text-indent: 0px; }",a=l.head||l.getElementsByTagName("head")[0],(s=l.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=o:s.appendChild(l.createTextNode(o)),a.appendChild(s),d.on("renderLine",function(e,t,r){var n=c.countColumn(t.text,null,e.getOption("tabSize"))*y.charWidth;r.style.textIndent="-"+n+"px",r.style.paddingLeft=4+n+"px"}),d.refresh()}}function Z(){y.isActive()&&(T("closed"),d.toTextArea(),d=void 0)}function ee(){if(y.isThemeOrPlugin)J();else if(y.isGutenberg){var e=y.isGutenbergVisualActive();wp.data.subscribe(function(){y.isGutenbergVisualActive()!==e&&((e=y.isGutenbergVisualActive())?Z():u.setTimeout(J,0))}),e||J()}else y.isVisualEnabled?(r.addEventListener("click",function(){u.setTimeout(J,0)}),i.addEventListener("click",Z),y.isVisualActive()||J()):(J(),l.body.className+=" visual-editor-is-disabled")}"complete"!==l.readyState?u.addEventListener?u.addEventListener("load",ee,!1):u.attachEvent&&u.attachEvent("onload",ee):ee()}(document,window,window.CodeMirror,window.jQuery,window.heshOptions);
|
html-editor-syntax-highlighter.php
CHANGED
@@ -17,10 +17,10 @@
|
|
17 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
18 |
* GitHub Branch: master
|
19 |
* GitHub Plugin URI: https://github.com/mukhortov/HESH-WordPress-Plugin
|
20 |
-
* Version: 2.3.
|
21 |
* Requires at least: 4.0.15
|
22 |
* Tested up to: 5.1.0
|
23 |
-
* Stable tag: 2.3.
|
24 |
**/
|
25 |
|
26 |
// Check for required PHP version
|
@@ -32,26 +32,28 @@ if ( preg_match( '#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'] ) ) {
|
|
32 |
die('You are not allowed to call this page directly.');
|
33 |
}
|
34 |
|
35 |
-
define( 'HESH_LIBS', plugins_url( '/
|
36 |
|
37 |
-
class
|
38 |
|
39 |
public function __construct () {
|
40 |
add_action( 'admin_init', array(&$this, 'hesh_set_options') );
|
41 |
-
add_action( 'admin_enqueue_scripts', array(&$this, 'hesh_admin_enqueue_scripts' ) );
|
42 |
add_action( 'wp_ajax_'.$this->formProcessName, array(&$this, 'hesh_options_form_process'));
|
43 |
-
|
44 |
-
}
|
45 |
-
|
46 |
-
// Enqueued scripts and styles for hesh.js
|
47 |
-
public function hesh_admin_enqueue_scripts () {
|
48 |
-
|
49 |
// Load only on certain pages
|
50 |
if (
|
51 |
!strstr($_SERVER['SCRIPT_NAME'], 'post.php') &&
|
52 |
!strstr($_SERVER['SCRIPT_NAME'], 'post-new.php') &&
|
53 |
!strstr($_SERVER['SCRIPT_NAME'], 'editor.php')
|
54 |
) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
// get the plugin version number for cache busting purposes
|
57 |
$plugData = get_plugin_data( __FILE__ ); // need this temporary var to support versions of php < 5.4
|
@@ -75,11 +77,13 @@ class wp_html_editor_syntax {
|
|
75 |
// this shows up in js as window.heshOptions
|
76 |
$heshOptions = array(
|
77 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
|
|
|
78 |
);
|
79 |
|
80 |
// place all the userPreferences into the heshOptions object
|
81 |
foreach ($this->userPreferences as $id => $value) {
|
82 |
$heshOptions[$id] = $value['current'];
|
|
|
83 |
}
|
84 |
wp_localize_script(
|
85 |
'heshJs', // for hesh.js
|
@@ -89,6 +93,7 @@ class wp_html_editor_syntax {
|
|
89 |
|
90 |
}
|
91 |
|
|
|
92 |
private $formProcessName = 'hesh_options_form';
|
93 |
private $nonceSecretCode = 'secret-code';
|
94 |
private $prefix = 'hesh_';
|
@@ -96,6 +101,16 @@ class wp_html_editor_syntax {
|
|
96 |
public function hesh_set_options() {
|
97 |
$this->userPreferences = array(
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
// PRIMARY OPTIONS // added in the primary settings bar
|
100 |
'theme' => array(
|
101 |
'title' => 'Theme',
|
@@ -229,6 +244,7 @@ class wp_html_editor_syntax {
|
|
229 |
if ($setting === 'true') $setting = true;
|
230 |
if ($setting === 'false') $setting = false;
|
231 |
if (is_numeric($setting)) $setting = floatval($setting);
|
|
|
232 |
update_user_meta( get_current_user_id(), $this->prefix.$id, $setting);
|
233 |
}
|
234 |
}
|
@@ -356,8 +372,22 @@ class wp_html_editor_syntax {
|
|
356 |
endforeach;
|
357 |
$this->hesh_output_fieldset();
|
358 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
|
360 |
public function hesh_output_form() {
|
|
|
361 |
?>
|
362 |
<div class="CodeMirror-settings closed" id="CodeMirror-settings" style="display:none;">
|
363 |
<form
|
@@ -369,8 +399,10 @@ class wp_html_editor_syntax {
|
|
369 |
<header class="CodeMirror-settings__header CodeMirror-settings__docked">
|
370 |
<?php
|
371 |
foreach ($this->userPreferences as $id => $value) {
|
372 |
-
if ( $value['set'] === '
|
373 |
-
|
|
|
|
|
374 |
}
|
375 |
?>
|
376 |
<a
|
@@ -387,7 +419,12 @@ class wp_html_editor_syntax {
|
|
387 |
Advanced Options
|
388 |
</h1>
|
389 |
<!-- <small>These features are experimental and may have bugs</small> -->
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
391 |
<?php
|
392 |
|
393 |
$this->hesh_output_fieldset('Highlighting');
|
@@ -413,7 +450,10 @@ class wp_html_editor_syntax {
|
|
413 |
</div>
|
414 |
<footer class="CodeMirror-settings__footer CodeMirror-settings__docked">
|
415 |
<p class="CodeMirror-settings__foot-content CodeMirror-settings__feedback">
|
416 |
-
<small>
|
|
|
|
|
|
|
417 |
<a href="https://wordpress.org/support/plugin/html-editor-syntax-highlighter/reviews/#new-post" target="_blank">review</a>,
|
418 |
fork on
|
419 |
<a href="https://github.com/mukhortov/HESH-WordPress-Plugin/" target="_blank">Github</a>,
|
@@ -434,6 +474,25 @@ class wp_html_editor_syntax {
|
|
434 |
<div class="CodeMirror-settings__toggle" id="CodeMirror-settings__toggle"></div>
|
435 |
</div>
|
436 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
}
|
438 |
|
439 |
private $cssThemes = array(
|
@@ -494,7 +553,7 @@ class wp_html_editor_syntax {
|
|
494 |
}
|
495 |
|
496 |
if ( is_admin() ) {
|
497 |
-
$hesh = new
|
498 |
}
|
499 |
|
500 |
?>
|
17 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
18 |
* GitHub Branch: master
|
19 |
* GitHub Plugin URI: https://github.com/mukhortov/HESH-WordPress-Plugin
|
20 |
+
* Version: 2.3.4
|
21 |
* Requires at least: 4.0.15
|
22 |
* Tested up to: 5.1.0
|
23 |
+
* Stable tag: 2.3.4
|
24 |
**/
|
25 |
|
26 |
// Check for required PHP version
|
32 |
die('You are not allowed to call this page directly.');
|
33 |
}
|
34 |
|
35 |
+
define( 'HESH_LIBS', plugins_url( '/', __FILE__ ) );
|
36 |
|
37 |
+
class Wp_Html_Editor_Syntax_Highlighter {
|
38 |
|
39 |
public function __construct () {
|
40 |
add_action( 'admin_init', array(&$this, 'hesh_set_options') );
|
|
|
41 |
add_action( 'wp_ajax_'.$this->formProcessName, array(&$this, 'hesh_options_form_process'));
|
42 |
+
|
|
|
|
|
|
|
|
|
|
|
43 |
// Load only on certain pages
|
44 |
if (
|
45 |
!strstr($_SERVER['SCRIPT_NAME'], 'post.php') &&
|
46 |
!strstr($_SERVER['SCRIPT_NAME'], 'post-new.php') &&
|
47 |
!strstr($_SERVER['SCRIPT_NAME'], 'editor.php')
|
48 |
) return;
|
49 |
+
|
50 |
+
add_action( 'admin_enqueue_scripts', array(&$this, 'hesh_admin_enqueue_scripts' ) );
|
51 |
+
add_action( 'admin_footer', array(&$this, 'hesh_output_form') );
|
52 |
+
add_action( 'admin_notices', array(&$this, 'display_survey_notice' ));
|
53 |
+
}
|
54 |
+
|
55 |
+
// Enqueued scripts and styles for hesh.js
|
56 |
+
public function hesh_admin_enqueue_scripts () {
|
57 |
|
58 |
// get the plugin version number for cache busting purposes
|
59 |
$plugData = get_plugin_data( __FILE__ ); // need this temporary var to support versions of php < 5.4
|
77 |
// this shows up in js as window.heshOptions
|
78 |
$heshOptions = array(
|
79 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
|
80 |
+
// 'nonce' => wp_create_nonce( $this->formProcessName ) // TODO: use this instead of the hidden field?
|
81 |
);
|
82 |
|
83 |
// place all the userPreferences into the heshOptions object
|
84 |
foreach ($this->userPreferences as $id => $value) {
|
85 |
$heshOptions[$id] = $value['current'];
|
86 |
+
// error_log( $id . ': ' . $heshOptions[$id] . ' type: ' . gettype($heshOptions[$id]) ); // for debug
|
87 |
}
|
88 |
wp_localize_script(
|
89 |
'heshJs', // for hesh.js
|
93 |
|
94 |
}
|
95 |
|
96 |
+
private $surveyLink = 'https://goo.gl/forms/xvaHgd7sZEbBbFAL2';
|
97 |
private $formProcessName = 'hesh_options_form';
|
98 |
private $nonceSecretCode = 'secret-code';
|
99 |
private $prefix = 'hesh_';
|
101 |
public function hesh_set_options() {
|
102 |
$this->userPreferences = array(
|
103 |
|
104 |
+
// HIDDEN OPTIONS // added in the primary settings bar
|
105 |
+
'surveyNoticeDismissedB' => array(
|
106 |
+
'title' => 'UX Survey Notice Dismissed',
|
107 |
+
'type' => 'hidden',
|
108 |
+
// 'current' => false, // reset for debug
|
109 |
+
'current' => get_user_meta( get_current_user_id(), $this->prefix.'surveyNoticeDismissedB' , true),
|
110 |
+
'default' => false,
|
111 |
+
'set' => 'hidden',
|
112 |
+
),
|
113 |
+
|
114 |
// PRIMARY OPTIONS // added in the primary settings bar
|
115 |
'theme' => array(
|
116 |
'title' => 'Theme',
|
244 |
if ($setting === 'true') $setting = true;
|
245 |
if ($setting === 'false') $setting = false;
|
246 |
if (is_numeric($setting)) $setting = floatval($setting);
|
247 |
+
// error_log( $id . ': ' . $setting . ' type: ' . gettype($setting) ); // for debug
|
248 |
update_user_meta( get_current_user_id(), $this->prefix.$id, $setting);
|
249 |
}
|
250 |
}
|
372 |
endforeach;
|
373 |
$this->hesh_output_fieldset();
|
374 |
}
|
375 |
+
|
376 |
+
private function hesh_output_hidden($id, $config) {
|
377 |
+
extract($config);
|
378 |
+
?>
|
379 |
+
<input
|
380 |
+
type="hidden"
|
381 |
+
id="<?php echo $id; ?>"
|
382 |
+
name="<?php echo $id; ?>"
|
383 |
+
value="<?php echo $current; ?>"
|
384 |
+
class="CodeMirror-settings__option"
|
385 |
+
/>
|
386 |
+
<?php
|
387 |
+
}
|
388 |
|
389 |
public function hesh_output_form() {
|
390 |
+
// ob_start();
|
391 |
?>
|
392 |
<div class="CodeMirror-settings closed" id="CodeMirror-settings" style="display:none;">
|
393 |
<form
|
399 |
<header class="CodeMirror-settings__header CodeMirror-settings__docked">
|
400 |
<?php
|
401 |
foreach ($this->userPreferences as $id => $value) {
|
402 |
+
if ( $value['set'] === 'primary' )
|
403 |
+
$this->hesh_output_option($id,$value);
|
404 |
+
if ( $value['set'] === 'hidden' )
|
405 |
+
$this->hesh_output_hidden($id,$value);
|
406 |
}
|
407 |
?>
|
408 |
<a
|
419 |
Advanced Options
|
420 |
</h1>
|
421 |
<!-- <small>These features are experimental and may have bugs</small> -->
|
422 |
+
<small>
|
423 |
+
<strong>HELP!</strong>
|
424 |
+
Please consider taking a short <a href="<?php echo $this->surveyLink; ?>" target="_blank" >User Experience Survey</a>
|
425 |
+
to provide feedback that will help shape the new version 3.0 of this plugin.
|
426 |
+
</small>
|
427 |
+
</td></tr>
|
428 |
<?php
|
429 |
|
430 |
$this->hesh_output_fieldset('Highlighting');
|
450 |
</div>
|
451 |
<footer class="CodeMirror-settings__footer CodeMirror-settings__docked">
|
452 |
<p class="CodeMirror-settings__foot-content CodeMirror-settings__feedback">
|
453 |
+
<small>
|
454 |
+
Provide
|
455 |
+
<a href="<?php echo $this->surveyLink; ?>" target="_blank" >feedback</a>,
|
456 |
+
Leave a
|
457 |
<a href="https://wordpress.org/support/plugin/html-editor-syntax-highlighter/reviews/#new-post" target="_blank">review</a>,
|
458 |
fork on
|
459 |
<a href="https://github.com/mukhortov/HESH-WordPress-Plugin/" target="_blank">Github</a>,
|
474 |
<div class="CodeMirror-settings__toggle" id="CodeMirror-settings__toggle"></div>
|
475 |
</div>
|
476 |
<?php
|
477 |
+
// return ob_get_clean();
|
478 |
+
}
|
479 |
+
|
480 |
+
public function display_survey_notice() {
|
481 |
+
if ( $this->userPreferences['surveyNoticeDismissedB']['current'] ) return;
|
482 |
+
// https://codex.wordpress.org/Plugin_API/Action_Reference/admin_notices
|
483 |
+
?>
|
484 |
+
<div class="notice notice-info is-dismissible notice-hesh">
|
485 |
+
<p>
|
486 |
+
<strong style="font-size:1.5em;">Please Take A Short Syntax Highlighter UX Survey</strong>
|
487 |
+
<br/>
|
488 |
+
A new version of the HTML Editor Syntax Highlighter Is Coming!
|
489 |
+
Please take this 5 minute user experience survey, and share your opinion to help shape new features in the v3.0 update.
|
490 |
+
A survey link is also available in the <em>Advanced Options</em>.
|
491 |
+
<br/><br/>
|
492 |
+
<a href="<?php echo $this->surveyLink; ?>" target="_blank" class="button button-primary">Take the UX Survey</a>
|
493 |
+
</p>
|
494 |
+
</div>
|
495 |
+
<?php
|
496 |
}
|
497 |
|
498 |
private $cssThemes = array(
|
553 |
}
|
554 |
|
555 |
if ( is_admin() ) {
|
556 |
+
$hesh = new Wp_Html_Editor_Syntax_Highlighter();
|
557 |
}
|
558 |
|
559 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/mukhortov/5
|
|
4 |
Tags: syntax highlighter, codemirror, text editor, code highlighter, code coloring, editor, html editor, gutenberg, code editor, theme editor, plugin editor, syntax, highlighting, highlighter, syntax highlighting, codemirror.js, code,
|
5 |
Requires at least: 4.0.15
|
6 |
Tested up to: 5.1.0
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPL-2.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -27,6 +27,9 @@ Add syntax highlighting in the Classic Post & Page HTML text editor, Gutenberg C
|
|
27 |
|
28 |
If you would like to contribute to this plugin, view the [github repo](https://github.com/mukhortov/HESH-WordPress-Plugin).
|
29 |
|
|
|
|
|
|
|
30 |
== Frequently Asked Questions ==
|
31 |
|
32 |
|
@@ -120,6 +123,11 @@ __Not really...__ It is partially supported in IE 11. Known bugs are tracked [he
|
|
120 |
|
121 |
== Changelog ==
|
122 |
|
|
|
|
|
|
|
|
|
|
|
123 |
= 2.3.2 =
|
124 |
* added a seventh screenshot
|
125 |
* removed [`smartIndent`](https://codemirror.net/doc/manual.html#option_smartIndent) because its annoying
|
4 |
Tags: syntax highlighter, codemirror, text editor, code highlighter, code coloring, editor, html editor, gutenberg, code editor, theme editor, plugin editor, syntax, highlighting, highlighter, syntax highlighting, codemirror.js, code,
|
5 |
Requires at least: 4.0.15
|
6 |
Tested up to: 5.1.0
|
7 |
+
Stable tag: 2.3.4
|
8 |
License: GPL-2.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
27 |
|
28 |
If you would like to contribute to this plugin, view the [github repo](https://github.com/mukhortov/HESH-WordPress-Plugin).
|
29 |
|
30 |
+
If you're a regular user of this plugin, please consider taking a short [User Experience Survey](https://goo.gl/forms/xvaHgd7sZEbBbFAL2) to provide feedback that will help shape the new version 3.0.
|
31 |
+
|
32 |
+
|
33 |
== Frequently Asked Questions ==
|
34 |
|
35 |
|
123 |
|
124 |
== Changelog ==
|
125 |
|
126 |
+
= 2.3.3 =
|
127 |
+
* Updated Release process
|
128 |
+
* Fix bug: #80 Only activate on pages where the editor will run
|
129 |
+
* Added UX survey notice.
|
130 |
+
|
131 |
= 2.3.2 =
|
132 |
* added a seventh screenshot
|
133 |
* removed [`smartIndent`](https://codemirror.net/doc/manual.html#option_smartIndent) because its annoying
|