-
Notifications
You must be signed in to change notification settings - Fork 549
/
codemirror.js
1073 lines (991 loc) · 463 KB
/
codemirror.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// codemirror.js
// addon/comment/comment.js
// addon/comment/continuecomment.js
// addon/edit/closebrackets.js
// addon/edit/matchbrackets.js
// addon/edit/closetag.js
// addon/hint/show-hint.js
// addon/hint/css-hint.js
// addon/hint/html-hint.js
// addon/hint/xml-hint.js
// addon/lint/lint.js
// addon/lint/css-lint.js
// addon/display/panel.js
// addon/search/search.js
// addon/search/searchcursor.js
// addon/scroll/simplescrollbars.js
// addon/scroll/annotatescrollbar.js
// addon/search/matchesonscrollbar.js
// addon/search/match-highlighter.js
// addon/fold/foldcode.js
// addon/fold/foldgutter.js
// addon/fold/brace-fold.js
// addon/fold/xml-fold.js
// addon/fold/indent-fold.js
// addon/fold/comment-fold.js
// addon/edit/matchtags.js
// addon/dialog/dialog.js
// keymap/vim.js
// addon/mode/overlay.js
// addon/mode/simple.js
// mode/meta.js
// mode/clike/clike.js
// mode/css/css.js
// mode/dart/dart.js
// mode/htmlmixed/htmlmixed.js
// mode/javascript/javascript.js
// mode/markdown/markdown.js
// mode/properties/properties.js
// mode/shell/shell.js
// mode/xml/xml.js
// mode/yaml/yaml.js
// codemirror.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(y,E,D){y instanceof String&&(y=String(y));for(var v=y.length,M=0;M<v;M++){var ja=y[M];if(E.call(D,ja,M,y))return{i:M,v:ja}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(y,E,D){if(y==Array.prototype||y==Object.prototype)return y;y[E]=D.value;return y};$jscomp.getGlobal=function(y){y=["object"==typeof globalThis&&globalThis,y,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var E=0;E<y.length;++E){var D=y[E];if(D&&D.Math==Math)return D}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(y,E){var D=$jscomp.propertyToPolyfillSymbol[E];if(null==D)return y[E];D=y[D];return void 0!==D?D:y[E]};
$jscomp.polyfill=function(y,E,D,v){E&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(y,E,D,v):$jscomp.polyfillUnisolated(y,E,D,v))};$jscomp.polyfillUnisolated=function(y,E,D,v){D=$jscomp.global;y=y.split(".");for(v=0;v<y.length-1;v++){var M=y[v];if(!(M in D))return;D=D[M]}y=y[y.length-1];v=D[y];E=E(v);E!=v&&null!=E&&$jscomp.defineProperty(D,y,{configurable:!0,writable:!0,value:E})};
$jscomp.polyfillIsolated=function(y,E,D,v){var M=y.split(".");y=1===M.length;v=M[0];v=!y&&v in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var ja=0;ja<M.length-1;ja++){var ka=M[ja];if(!(ka in v))return;v=v[ka]}M=M[M.length-1];D=$jscomp.IS_SYMBOL_NATIVE&&"es6"===D?v[M]:null;E=E(D);null!=E&&(y?$jscomp.defineProperty($jscomp.polyfills,M,{configurable:!0,writable:!0,value:E}):E!==D&&(void 0===$jscomp.propertyToPolyfillSymbol[M]&&(D=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[M]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(M):$jscomp.POLYFILL_PREFIX+D+"$"+M),$jscomp.defineProperty(v,$jscomp.propertyToPolyfillSymbol[M],{configurable:!0,writable:!0,value:E})))};$jscomp.polyfill("Array.prototype.find",function(y){return y?y:function(E,D){return $jscomp.findInternal(this,E,D).v}},"es6","es3");
(function(y,E){"object"===typeof exports&&"undefined"!==typeof module?module.exports=E():"function"===typeof define&&define.amd?define(E):(y=y||self,y.CodeMirror=E())})(this,function(){function y(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function E(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function D(a,b){return E(a).appendChild(b)}function v(a,b,d,c){a=document.createElement(a);d&&(a.className=d);c&&(a.style.cssText=c);if("string"==typeof b)a.appendChild(document.createTextNode(b));
else if(b)for(d=0;d<b.length;++d)a.appendChild(b[d]);return a}function M(a,b,d,c){a=v(a,b,d,c);a.setAttribute("role","presentation");return a}function ja(a,b){3==b.nodeType&&(b=b.parentNode);if(a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)}function ka(a){try{var b=a.activeElement}catch(d){b=a.body||null}for(;b&&b.shadowRoot&&b.shadowRoot.activeElement;)b=b.shadowRoot.activeElement;return b}function Ya(a,b){var d=a.className;y(b).test(d)||(a.className+=
(d?" ":"")+b)}function fd(a,b){a=a.split(" ");for(var d=0;d<a.length;d++)a[d]&&!y(a[d]).test(b)&&(b+=" "+a[d]);return b}function qa(a){return a.display.wrapper.ownerDocument}function gd(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Za(a,b,d){b||(b={});for(var c in a)!a.hasOwnProperty(c)||!1===d&&b.hasOwnProperty(c)||(b[c]=a[c]);return b}function wa(a,b,d,c,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));c=c||0;for(e=e||0;;){var f=a.indexOf("\t",
c);if(0>f||f>=b)return e+(b-c);e+=f-c;e+=d-e%d;c=f+1}}function ea(a,b){for(var d=0;d<a.length;++d)if(a[d]==b)return d;return-1}function hd(a,b,d){for(var c=0,e=0;;){var f=a.indexOf("\t",c);-1==f&&(f=a.length);var g=f-c;if(f==a.length||e+g>=b)return c+Math.min(g,b-e);e+=f-c;e+=d-e%d;c=f+1;if(e>=b)return c}}function id(a){for(;vc.length<=a;)vc.push(J(vc)+" ");return vc[a]}function J(a){return a[a.length-1]}function wc(a,b){for(var d=[],c=0;c<a.length;c++)d[c]=b(a[c],c);return d}function yg(a,b,d){for(var c=
0,e=d(b);c<a.length&&d(a[c])<=e;)c++;a.splice(c,0,b)}function qe(){}function re(a,b){Object.create?a=Object.create(a):(qe.prototype=a,a=new qe);b&&Za(b,a);return a}function jd(a){return/\w/.test(a)||"\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||zg.test(a))}function xc(a,b){return b?-1<b.source.indexOf("\\w")&&jd(a)?!0:b.test(a):jd(a)}function se(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function kd(a){return 768<=a.charCodeAt(0)&&Ag.test(a)}function te(a,b,d){for(;(0>d?0<b:
b<a.length)&&kd(a.charAt(b));)b+=d;return b}function Jb(a,b,d){for(var c=b>d?-1:1;;){if(b==d)return b;var e=(b+d)/2;e=0>c?Math.ceil(e):Math.floor(e);if(e==b)return a(e)?b:d;a(e)?d=e:b=e+c}}function Bg(a,b,d,c){if(!a)return c(b,d,"ltr",0);for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<d&&g.to>b||b==d&&g.to==b)c(Math.max(g.from,b),Math.min(g.to,d),1==g.level?"rtl":"ltr",f),e=!0}e||c(b,d,"ltr")}function Kb(a,b,d){var c;Lb=null;for(var e=0;e<a.length;++e){var f=a[e];if(f.from<b&&f.to>b)return e;
f.to==b&&(f.from!=f.to&&"before"==d?c=e:Lb=e);f.from==b&&(f.from!=f.to&&"before"!=d?c=e:Lb=e)}return null!=c?c:Lb}function Ja(a,b){var d=a.order;null==d&&(d=a.order=Cg(a.text,b));return d}function ta(a,b,d){if(a.removeEventListener)a.removeEventListener(b,d,!1);else if(a.detachEvent)a.detachEvent("on"+b,d);else{var c=(a=a._handlers)&&a[b];c&&(d=ea(c,d),-1<d&&(a[b]=c.slice(0,d).concat(c.slice(d+1))))}}function W(a,b){var d=a._handlers&&a._handlers[b]||yc;if(d.length)for(var c=Array.prototype.slice.call(arguments,
2),e=0;e<d.length;++e)d[e].apply(null,c)}function Z(a,b,d){"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}});W(a,d||b.type,a,b);return ld(b)||b.codemirrorIgnore}function ue(a){var b=a._handlers&&a._handlers.cursorActivity;if(b){a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]);for(var d=0;d<b.length;++d)-1==ea(a,b[d])&&a.push(b[d])}}function xa(a,b){return 0<(a._handlers&&a._handlers[b]||yc).length}function pb(a){a.prototype.on=function(b,d){z(this,
b,d)};a.prototype.off=function(b,d){ta(this,b,d)}}function la(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function ve(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function ld(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function Mb(a){la(a);ve(a)}function we(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));ya&&a.ctrlKey&&1==b&&(b=3);return b}function Dg(a,b){2<arguments.length&&(b.dependencies=Array.prototype.slice.call(arguments,
2));md[a]=b}function zc(a){if("string"==typeof a&&qb.hasOwnProperty(a))a=qb[a];else if(a&&"string"==typeof a.name&&qb.hasOwnProperty(a.name)){var b=qb[a.name];"string"==typeof b&&(b={name:b});a=re(b,a);a.name=b.name}else{if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return zc("application/xml");if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return zc("application/json")}return"string"==typeof a?{name:a}:a||{name:"null"}}function nd(a,b){b=zc(b);var d=md[b.name];if(!d)return nd(a,
"text/plain");a=d(a,b);if(rb.hasOwnProperty(b.name)){d=rb[b.name];for(var c in d)d.hasOwnProperty(c)&&(a.hasOwnProperty(c)&&(a["_"+c]=a[c]),a[c]=d[c])}a.name=b.name;b.helperType&&(a.helperType=b.helperType);if(b.modeProps)for(var e in b.modeProps)a[e]=b.modeProps[e];return a}function Eg(a,b){a=rb.hasOwnProperty(a)?rb[a]:rb[a]={};Za(b,a)}function $a(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);a={};for(var d in b){var c=b[d];c instanceof Array&&(c=c.concat([]));a[d]=c}return a}function od(a,
b){for(var d;a.innerMode;){d=a.innerMode(b);if(!d||d.mode==a)break;b=d.state;a=d.mode}return d||{mode:a,state:b}}function xe(a,b,d){return a.startState?a.startState(b,d):!0}function w(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(;!a.lines;)for(var d=0;;++d){var c=a.children[d],e=c.chunkSize();if(b<e){a=c;break}b-=e}return a.lines[b]}function ab(a,b,d){var c=[],e=b.line;a.iter(b.line,d.line+1,function(f){f=f.text;e==d.line&&(f=f.slice(0,d.ch));
e==b.line&&(f=f.slice(b.ch));c.push(f);++e});return c}function pd(a,b,d){var c=[];a.iter(b,d,function(e){c.push(e.text)});return c}function Ea(a,b){if(b-=a.height)for(;a;a=a.parent)a.height+=b}function N(a){if(null==a.parent)return null;var b=a.parent;a=ea(b.lines,a);for(var d=b.parent;d;b=d,d=d.parent)for(var c=0;d.children[c]!=b;++c)a+=d.children[c].chunkSize();return a+b.first}function bb(a,b){var d=a.first;a:do{for(var c=0;c<a.children.length;++c){var e=a.children[c],f=e.height;if(b<f){a=e;continue a}b-=
f;d+=e.chunkSize()}return d}while(!a.lines);for(c=0;c<a.lines.length;++c){e=a.lines[c].height;if(b<e)break;b-=e}return d+c}function Nb(a,b){return b>=a.first&&b<a.first+a.size}function qd(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function t(a,b,d){void 0===d&&(d=null);if(!(this instanceof t))return new t(a,b,d);this.line=a;this.ch=b;this.sticky=d}function B(a,b){return a.line-b.line||a.ch-b.ch}function rd(a,b){return a.sticky==b.sticky&&0==B(a,b)}function sd(a){return t(a.line,
a.ch)}function Ac(a,b){return 0>B(a,b)?b:a}function Bc(a,b){return 0>B(a,b)?a:b}function C(a,b){if(b.line<a.first)return t(a.first,0);var d=a.first+a.size-1;if(b.line>d)return t(d,w(a,d).text.length);a=w(a,b.line).text.length;d=b.ch;b=null==d||d>a?t(b.line,a):0>d?t(b.line,0):b;return b}function ye(a,b){for(var d=[],c=0;c<b.length;c++)d[c]=C(a,b[c]);return d}function ze(a,b,d,c){var e=[a.state.modeGen],f={};Ae(a,b.text,a.doc.mode,d,function(k,l){return e.push(k,l)},f,c);var g=d.state;c=function(k){d.baseTokens=
e;var l=a.state.overlays[k],m=1,n=0;d.state=!0;Ae(a,b.text,l.mode,d,function(p,q){for(var r=m;n<p;){var u=e[m];u>p&&e.splice(m,1,p,e[m+1],u);m+=2;n=Math.min(p,u)}if(q)if(l.opaque)e.splice(r,m-r,p,"overlay "+q),m=r+2;else for(;r<m;r+=2)p=e[r+1],e[r+1]=(p?p+" ":"")+"overlay "+q},f);d.state=g;d.baseTokens=null;d.baseTokenPos=1};for(var h=0;h<a.state.overlays.length;++h)c(h);return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Be(a,b,d){if(!b.styles||b.styles[0]!=a.state.modeGen){var c=Ob(a,
N(b)),e=b.text.length>a.options.maxHighlightLength&&$a(a.doc.mode,c.state),f=ze(a,b,c);e&&(c.state=e);b.stateAfter=c.save(!e);b.styles=f.styles;f.classes?b.styleClasses=f.classes:b.styleClasses&&(b.styleClasses=null);d===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return b.styles}function Ob(a,b,d){var c=a.doc,e=a.display;if(!c.mode.startState)return new Fa(c,!0,b);var f=Fg(a,b,d),g=f>c.first&&w(c,f-1).stateAfter,h=g?Fa.fromSaved(c,g,f):new Fa(c,
xe(c.mode),f);c.iter(f,b,function(k){td(a,k.text,h);var l=h.line;k.stateAfter=l==b-1||0==l%5||l>=e.viewFrom&&l<e.viewTo?h.save():null;h.nextLine()});d&&(c.modeFrontier=h.line);return h}function td(a,b,d,c){var e=a.doc.mode;a=new X(b,a.options.tabSize,d);a.start=a.pos=c||0;for(""==b&&Ce(e,d.state);!a.eol();)ud(e,a,d.state),a.start=a.pos}function Ce(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode&&(a=od(a,b),a.mode.blankLine))return a.mode.blankLine(a.state)}function ud(a,b,d,c){for(var e=
0;10>e;e++){c&&(c[0]=od(a,d).mode);var f=a.token(b,d);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.");}function De(a,b,d,c){var e=a.doc,f=e.mode;b=C(e,b);var g=w(e,b.line);d=Ob(a,b.line,d);a=new X(g.text,a.options.tabSize,d);var h;for(c&&(h=[]);(c||a.pos<b.ch)&&!a.eol();){a.start=a.pos;var k=ud(f,a,d.state);c&&h.push(new Ee(a,k,$a(e.mode,d.state)))}return c?h:new Ee(a,k,d.state)}function Fe(a,b){if(a)for(;;){var d=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!d)break;
a=a.slice(0,d.index)+a.slice(d.index+d[0].length);var c=d[1]?"bgClass":"textClass";null==b[c]?b[c]=d[2]:(new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)")).test(b[c])||(b[c]+=" "+d[2])}return a}function Ae(a,b,d,c,e,f,g){var h=d.flattenSpans;null==h&&(h=a.options.flattenSpans);var k=0,l=null,m=new X(b,a.options.tabSize,c),n=a.options.addModeClass&&[null];for(""==b&&Fe(Ce(d,c.state),f);!m.eol();){if(m.pos>a.options.maxHighlightLength){h=!1;g&&td(a,b,c,m.pos);m.pos=b.length;var p=null}else p=Fe(ud(d,m,c.state,
n),f);if(n){var q=n[0].name;q&&(p="m-"+(p?q+" "+p:q))}if(!h||l!=p){for(;k<m.start;)k=Math.min(m.start,k+5E3),e(k,l);l=p}m.start=m.pos}for(;k<m.pos;)a=Math.min(m.pos,k+5E3),e(a,l),k=a}function Fg(a,b,d){for(var c,e,f=a.doc,g=d?-1:b-(a.doc.mode.innerMode?1E3:100);b>g;--b){if(b<=f.first)return f.first;var h=w(f,b-1),k=h.stateAfter;if(k&&(!d||b+(k instanceof Cc?k.lookAhead:0)<=f.modeFrontier))return b;h=wa(h.text,null,a.options.tabSize);if(null==e||c>h)e=b-1,c=h}return e}function Gg(a,b){a.modeFrontier=
Math.min(a.modeFrontier,b);if(!(a.highlightFrontier<b-10)){for(var d=a.first,c=b-1;c>d;c--){var e=w(a,c).stateAfter;if(e&&(!(e instanceof Cc)||c+e.lookAhead<b)){d=c+1;break}}a.highlightFrontier=Math.min(a.highlightFrontier,d)}}function Dc(a,b,d){this.marker=a;this.from=b;this.to=d}function Pb(a,b){if(a)for(var d=0;d<a.length;++d){var c=a[d];if(c.marker==b)return c}}function vd(a,b){if(b.full)return null;var d=Nb(a,b.from.line)&&w(a,b.from.line).markedSpans,c=Nb(a,b.to.line)&&w(a,b.to.line).markedSpans;
if(!d&&!c)return null;a=b.from.ch;var e=b.to.ch,f=0==B(b.from,b.to),g;if(d)for(var h=0;h<d.length;++h){var k=d[h],l=k.marker;if(null==k.from||(l.inclusiveLeft?k.from<=a:k.from<a)||!(k.from!=a||"bookmark"!=l.type||f&&k.marker.insertLeft)){var m=null==k.to||(l.inclusiveRight?k.to>=a:k.to>a);(g||(g=[])).push(new Dc(l,k.from,m?null:k.to))}}d=g;var n;if(c)for(g=0;g<c.length;++g)if(h=c[g],k=h.marker,null==h.to||(k.inclusiveRight?h.to>=e:h.to>e)||h.from==e&&"bookmark"==k.type&&(!f||h.marker.insertLeft))l=
null==h.from||(k.inclusiveLeft?h.from<=e:h.from<e),(n||(n=[])).push(new Dc(k,l?null:h.from-e,null==h.to?null:h.to-e));c=1==b.text.length;e=J(b.text).length+(c?a:0);if(d)for(f=0;f<d.length;++f)if(g=d[f],null==g.to)(h=Pb(n,g.marker),h)?c&&(g.to=null==h.to?null:h.to+e):g.to=a;if(n)for(a=0;a<n.length;++a)f=n[a],null!=f.to&&(f.to+=e),null==f.from?Pb(d,f.marker)||(f.from=e,c&&(d||(d=[])).push(f)):(f.from+=e,c&&(d||(d=[])).push(f));d&&(d=Ge(d));n&&n!=d&&(n=Ge(n));a=[d];if(!c){b=b.text.length-2;var p;if(0<
b&&d)for(c=0;c<d.length;++c)null==d[c].to&&(p||(p=[])).push(new Dc(d[c].marker,null,null));for(d=0;d<b;++d)a.push(p);a.push(n)}return a}function Ge(a){for(var b=0;b<a.length;++b){var d=a[b];null!=d.from&&d.from==d.to&&!1!==d.marker.clearWhenEmpty&&a.splice(b--,1)}return a.length?a:null}function Hg(a,b,d){var c=null;a.iter(b.line,d.line+1,function(m){if(m.markedSpans)for(var n=0;n<m.markedSpans.length;++n){var p=m.markedSpans[n].marker;!p.readOnly||c&&-1!=ea(c,p)||(c||(c=[])).push(p)}});if(!c)return null;
a=[{from:b,to:d}];for(b=0;b<c.length;++b){d=c[b];for(var e=d.find(0),f=0;f<a.length;++f){var g=a[f];if(!(0>B(g.to,e.from)||0<B(g.from,e.to))){var h=[f,1],k=B(g.from,e.from),l=B(g.to,e.to);(0>k||!d.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0<l||!d.inclusiveRight&&!l)&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-3}}}return a}function He(a){var b=a.markedSpans;if(b){for(var d=0;d<b.length;++d)b[d].marker.detachLine(a);a.markedSpans=null}}function Ie(a,b){if(b){for(var d=0;d<
b.length;++d)b[d].marker.attachLine(a);a.markedSpans=b}}function wd(a,b){var d=a.lines.length-b.lines.length;if(0!=d)return d;d=a.find();var c=b.find(),e=B(d.from,c.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(d=B(d.to,c.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))?d:b.id-a.id}function sb(a,b){a=Ka&&a.markedSpans;if(a)for(var d,c=0;c<a.length;++c)if(d=a[c],d.marker.collapsed&&null==(b?d.from:d.to)&&(!e||0>wd(e,d.marker)))var e=d.marker;return e}function Je(a,b,d,c,e){a=
w(a,b);if(a=Ka&&a.markedSpans)for(b=0;b<a.length;++b){var f=a[b];if(f.marker.collapsed){var g=f.marker.find(0),h=B(g.from,d)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=B(g.to,c)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=h&&0>=k||0>=h&&0<=k)&&(0>=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0<=B(g.to,d):0<B(g.to,d))||0<=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0>=B(g.from,c):0>B(g.from,c))))return!0}}}function za(a){for(var b;b=sb(a,!0);)a=b.find(-1,!0).line;return a}
function xd(a,b){a=w(a,b);var d=za(a);return a==d?b:N(d)}function Ke(a,b){if(b>a.lastLine())return b;var d=w(a,b);if(!Pa(a,d))return b;for(;a=sb(d,!1);)d=a.find(1,!0).line;return N(d)+1}function Pa(a,b){var d=Ka&&b.markedSpans;if(d)for(var c,e=0;e<d.length;++e)if(c=d[e],c.marker.collapsed&&(null==c.from||!c.marker.widgetNode&&0==c.from&&c.marker.inclusiveLeft&&yd(a,b,c)))return!0}function yd(a,b,d){if(null==d.to)return b=d.marker.find(1,!0),yd(a,b.line,Pb(b.line.markedSpans,d.marker));if(d.marker.inclusiveRight&&
d.to==b.text.length)return!0;for(var c,e=0;e<b.markedSpans.length;++e)if(c=b.markedSpans[e],c.marker.collapsed&&!c.marker.widgetNode&&c.from==d.to&&(null==c.to||c.to!=d.from)&&(c.marker.inclusiveLeft||d.marker.inclusiveRight)&&yd(a,b,c))return!0}function Ga(a){a=za(a);for(var b=0,d=a.parent,c=0;c<d.lines.length;++c){var e=d.lines[c];if(e==a)break;else b+=e.height}for(a=d.parent;a;d=a,a=d.parent)for(c=0;c<a.children.length&&(e=a.children[c],e!=d);++c)b+=e.height;return b}function Ec(a){if(0==a.height)return 0;
for(var b=a.text.length,d,c=a;d=sb(c,!0);)d=d.find(0,!0),c=d.from.line,b+=d.from.ch-d.to.ch;for(c=a;d=sb(c,!1);)a=d.find(0,!0),b-=c.text.length-a.from.ch,c=a.to.line,b+=c.text.length-a.to.ch;return b}function zd(a){var b=a.display;a=a.doc;b.maxLine=w(a,a.first);b.maxLineLength=Ec(b.maxLine);b.maxLineChanged=!0;a.iter(function(d){var c=Ec(d);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=d)})}function Le(a,b){if(!a||/^\s*$/.test(a))return null;b=b.addModeClass?Ig:Jg;return b[a]||(b[a]=a.replace(/\S+/g,
"cm-$&"))}function Me(a,b){var d=M("span",null,null,fa?"padding-right: .1px":null);d={pre:M("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:a.getOption("lineWrapping")};b.measure={};for(var c=0;c<=(b.rest?b.rest.length:0);c++){var e=c?b.rest[c-1]:b.line,f=void 0;d.pos=0;d.addToken=Kg;var g=a.display.measure;if(null!=Ad)g=Ad;else{var h=D(g,document.createTextNode("A\u062eA")),k=Qb(h,0,1).getBoundingClientRect();h=Qb(h,1,2).getBoundingClientRect();E(g);g=k&&k.left!=
k.right?Ad=3>h.right-k.right:!1}g&&(f=Ja(e,a.doc.direction))&&(d.addToken=Lg(d.addToken,f));d.map=[];var l=b!=a.display.externalMeasured&&N(e);a:{var m=h=k=g=void 0,n=void 0,p=void 0,q=void 0;f=d;l=Be(a,e,l);var r=e.markedSpans,u=e.text,A=0;if(r)for(var Y=u.length,x=0,P=1,K="",Q=0;;){if(Q==x){n=m=h=p="";k=g=null;Q=Infinity;for(var S=[],F=void 0,R=0;R<r.length;++R){var H=r[R],L=H.marker;if("bookmark"==L.type&&H.from==x&&L.widgetNode)S.push(L);else if(H.from<=x&&(null==H.to||H.to>x||L.collapsed&&H.to==
x&&H.from==x)){null!=H.to&&H.to!=x&&Q>H.to&&(Q=H.to,m="");L.className&&(n+=" "+L.className);L.css&&(p=(p?p+";":"")+L.css);L.startStyle&&H.from==x&&(h+=" "+L.startStyle);L.endStyle&&H.to==Q&&(F||(F=[])).push(L.endStyle,H.to);L.title&&((g||(g={})).title=L.title);if(L.attributes)for(var ha in L.attributes)(g||(g={}))[ha]=L.attributes[ha];L.collapsed&&(!k||0>wd(k.marker,L))&&(k=H)}else H.from>x&&Q>H.from&&(Q=H.from)}if(F)for(R=0;R<F.length;R+=2)F[R+1]==Q&&(m+=" "+F[R]);if(!k||k.from==x)for(F=0;F<S.length;++F)Ne(f,
0,S[F]);if(k&&(k.from||0)==x){Ne(f,(null==k.to?Y+1:k.to)-x,k.marker,null==k.from);if(null==k.to)break a;k.to==x&&(k=!1)}}if(x>=Y)break;for(S=Math.min(Y,Q);;){if(K){F=x+K.length;k||(R=F>S?K.slice(0,S-x):K,f.addToken(f,R,q?q+n:n,h,x+R.length==Q?m:"",p,g));if(F>=S){K=K.slice(S-x);x=S;break}x=F;h=""}K=u.slice(A,A=l[P++]);q=Le(l[P++],f.cm.options)}}else for(g=1;g<l.length;g+=2)f.addToken(f,u.slice(A,A=l[g]),Le(l[g+1],f.cm.options))}e.styleClasses&&(e.styleClasses.bgClass&&(d.bgClass=fd(e.styleClasses.bgClass,
d.bgClass||"")),e.styleClasses.textClass&&(d.textClass=fd(e.styleClasses.textClass,d.textClass||"")));0==d.map.length&&(e=d.map,f=e.push,g=d.content,k=g.appendChild,h=a.display.measure,null==Bd&&(m=v("span","\u200b"),D(h,v("span",[m,document.createTextNode("x")])),0!=h.firstChild.offsetHeight&&(Bd=1>=m.offsetWidth&&2<m.offsetHeight&&!(G&&8>T))),h=Bd?v("span","\u200b"):v("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px"),h.setAttribute("cm-text",""),f.call(e,0,0,k.call(g,
h)));0==c?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}fa&&(ha=d.content.lastChild,/\bcm-tab\b/.test(ha.className)||ha.querySelector&&ha.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack");W(a,"renderLine",a,b.line,d.pre);d.pre.className&&(d.textClass=fd(d.pre.className,d.textClass||""));return d}function Mg(a){var b=v("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);
b.setAttribute("aria-label",b.title);return b}function Kg(a,b,d,c,e,f,g){if(b){if(a.splitSpaces){var h=a.trailingSpace;if(1<b.length&&!/ /.test(b))h=b;else{for(var k="",l=0;l<b.length;l++){var m=b.charAt(l);" "!=m||!h||l!=b.length-1&&32!=b.charCodeAt(l+1)||(m="\u00a0");k+=m;h=" "==m}h=k}}else h=b;k=h;l=a.cm.state.specialChars;m=!1;if(l.test(b)){h=document.createDocumentFragment();for(var n=0;;){l.lastIndex=n;var p=l.exec(b),q=p?p.index-n:b.length-n;if(q){var r=document.createTextNode(k.slice(n,n+
q));G&&9>T?h.appendChild(v("span",[r])):h.appendChild(r);a.map.push(a.pos,a.pos+q,r);a.col+=q;a.pos+=q}if(!p)break;n+=q+1;"\t"==p[0]?(p=a.cm.options.tabSize,p-=a.col%p,q=h.appendChild(v("span",id(p),"cm-tab")),q.setAttribute("role","presentation"),q.setAttribute("cm-text","\t"),a.col+=p):("\r"==p[0]||"\n"==p[0]?(q=h.appendChild(v("span","\r"==p[0]?"\u240d":"\u2424","cm-invalidchar")),q.setAttribute("cm-text",p[0])):(q=a.cm.options.specialCharPlaceholder(p[0]),q.setAttribute("cm-text",p[0]),G&&9>T?
h.appendChild(v("span",[q])):h.appendChild(q)),a.col+=1);a.map.push(a.pos,a.pos+1,q);a.pos++}}else a.col+=b.length,h=document.createTextNode(k),a.map.push(a.pos,a.pos+b.length,h),G&&9>T&&(m=!0),a.pos+=b.length;a.trailingSpace=32==k.charCodeAt(b.length-1);if(d||c||e||m||f||g){b=d||"";c&&(b+=c);e&&(b+=e);c=v("span",[h],b,f);if(g)for(var u in g)g.hasOwnProperty(u)&&"style"!=u&&"class"!=u&&c.setAttribute(u,g[u]);return a.content.appendChild(c)}a.content.appendChild(h)}}function Lg(a,b){return function(d,
c,e,f,g,h,k){e=e?e+" cm-force-border":"cm-force-border";for(var l=d.pos,m=l+c.length;;){for(var n=void 0,p=0;p<b.length&&!(n=b[p],n.to>l&&n.from<=l);p++);if(n.to>=m)return a(d,c,e,f,g,h,k);a(d,c.slice(0,n.to-l),e,f,null,h,k);f=null;c=c.slice(n.to-l);l=n.to}}}function Ne(a,b,d,c){var e=!c&&d.widgetNode;e&&a.map.push(a.pos,a.pos+b,e);!c&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",d.id));e&&(a.cm.display.input.setUneditable(e),
a.content.appendChild(e));a.pos+=b;a.trailingSpace=!1}function Oe(a,b,d){for(var c=this.line=b,e;c=sb(c,!1);)c=c.find(1,!0).line,(e||(e=[])).push(c);this.size=(this.rest=e)?N(J(this.rest))-d+1:1;this.node=this.text=null;this.hidden=Pa(a,b)}function Fc(a,b,d){var c=[],e;for(e=b;e<d;)b=new Oe(a.doc,w(a.doc,e),e),e+=b.size,c.push(b);return c}function Ng(a,b){if(a=a.ownsGroup)try{var d=a.delayedCallbacks,c=0;do{for(;c<d.length;c++)d[c].call(null);for(var e=0;e<a.ops.length;e++){var f=a.ops[e];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<
f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(c<d.length)}finally{tb=null,b(a)}}function aa(a,b){var d=a._handlers&&a._handlers[b]||yc;if(d.length){var c=Array.prototype.slice.call(arguments,2);if(tb)var e=tb.delayedCallbacks;else Rb?e=Rb:(e=Rb=[],setTimeout(Og,0));for(var f=function(h){e.push(function(){return d[h].apply(null,c)})},g=0;g<d.length;++g)f(g)}}function Og(){var a=Rb;Rb=null;for(var b=0;b<a.length;++b)a[b]()}function Pe(a,b,
d,c){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];if("text"==f){f=a;var g=b,h=g.text.className,k=Qe(f,g);g.text==g.node&&(g.node=k.pre);g.text.parentNode.replaceChild(k.pre,g.text);g.text=k.pre;k.bgClass!=g.bgClass||k.textClass!=g.textClass?(g.bgClass=k.bgClass,g.textClass=k.textClass,Cd(f,g)):h&&(g.text.className=h)}else if("gutter"==f)Re(a,b,d,c);else if("class"==f)Cd(a,b);else if("widget"==f){f=a;g=b;h=c;g.alignable&&(g.alignable=null);k=y("CodeMirror-linewidget");for(var l=g.node.firstChild,
m;l;l=m)m=l.nextSibling,k.test(l.className)&&g.node.removeChild(l);Se(f,g,h)}}b.changes=null}function Sb(a){a.node==a.text&&(a.node=v("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),G&&8>T&&(a.node.style.zIndex=2));return a.node}function Qe(a,b){var d=a.display.externalMeasured;return d&&d.line==b.line?(a.display.externalMeasured=null,b.measure=d.measure,d.built):Me(a,b)}function Cd(a,b){var d=b.bgClass?b.bgClass+" "+
(b.line.bgClass||""):b.line.bgClass;d&&(d+=" CodeMirror-linebackground");if(b.background)d?b.background.className=d:(b.background.parentNode.removeChild(b.background),b.background=null);else if(d){var c=Sb(b);b.background=c.insertBefore(v("div",null,d),c.firstChild);a.display.input.setUneditable(b.background)}b.line.wrapClass?Sb(b).className=b.line.wrapClass:b.node!=b.text&&(b.node.className="");b.text.className=(b.textClass?b.textClass+" "+(b.line.textClass||""):b.line.textClass)||""}function Re(a,
b,d,c){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null);if(b.line.gutterClass){var e=Sb(b);b.gutterBackground=v("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?c.fixedPos:-c.gutterTotalWidth)+"px; width: "+c.gutterTotalWidth+"px");a.display.input.setUneditable(b.gutterBackground);e.insertBefore(b.gutterBackground,b.text)}e=b.line.gutterMarkers;if(a.options.lineNumbers||
e){var f=Sb(b),g=b.gutter=v("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?c.fixedPos:-c.gutterTotalWidth)+"px");g.setAttribute("aria-hidden","true");a.display.input.setUneditable(g);f.insertBefore(g,b.text);b.line.gutterClass&&(g.className+=" "+b.line.gutterClass);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(v("div",qd(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+c.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+
a.display.lineNumInnerWidth+"px")));if(e)for(b=0;b<a.display.gutterSpecs.length;++b)d=a.display.gutterSpecs[b].className,(f=e.hasOwnProperty(d)&&e[d])&&g.appendChild(v("div",[f],"CodeMirror-gutter-elt","left: "+c.gutterLeft[d]+"px; width: "+c.gutterWidth[d]+"px"))}}function Pg(a,b,d,c){var e=Qe(a,b);b.text=b.node=e.pre;e.bgClass&&(b.bgClass=e.bgClass);e.textClass&&(b.textClass=e.textClass);Cd(a,b);Re(a,b,d,c);Se(a,b,c);return b.node}function Se(a,b,d){Te(a,b.line,b,d,!0);if(b.rest)for(var c=0;c<b.rest.length;c++)Te(a,
b.rest[c],b,d,!1)}function Te(a,b,d,c,e){if(b.widgets){var f=Sb(d),g=0;for(b=b.widgets;g<b.length;++g){var h=b[g],k=v("div",[h.node],"CodeMirror-linewidget"+(h.className?" "+h.className:""));h.handleMouseEvents||k.setAttribute("cm-ignore-events","true");var l=h,m=k,n=c;if(l.noHScroll){(d.alignable||(d.alignable=[])).push(m);var p=n.wrapperWidth;m.style.left=n.fixedPos+"px";l.coverGutter||(p-=n.gutterTotalWidth,m.style.paddingLeft=n.gutterTotalWidth+"px");m.style.width=p+"px"}l.coverGutter&&(m.style.zIndex=
5,m.style.position="relative",l.noHScroll||(m.style.marginLeft=-n.gutterTotalWidth+"px"));a.display.input.setUneditable(k);e&&h.above?f.insertBefore(k,d.gutter||d.text):f.appendChild(k);aa(h,"redraw")}}}function Tb(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!ja(document.body,a.node)){var d="position: relative;";a.coverGutter&&(d+="margin-left: -"+b.display.gutters.offsetWidth+"px;");a.noHScroll&&(d+="width: "+b.display.wrapper.clientWidth+"px;");D(b.display.measure,v("div",
[a.node],null,d))}return a.height=a.node.parentNode.offsetHeight}function La(a,b){for(b=b.target||b.srcElement;b!=a.wrapper;b=b.parentNode)if(!b||1==b.nodeType&&"true"==b.getAttribute("cm-ignore-events")||b.parentNode==a.sizer&&b!=a.mover)return!0}function Dd(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Ue(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=D(a.measure,v("pre","x","CodeMirror-line-like"));b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle;b={left:parseInt(b.paddingLeft),
right:parseInt(b.paddingRight)};isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b);return b}function Ha(a){return 50-a.display.nativeBarWidth}function cb(a){return a.display.scroller.clientWidth-Ha(a)-a.display.barWidth}function Ed(a){return a.display.scroller.clientHeight-Ha(a)-a.display.barHeight}function Ve(a,b,d){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};if(a.rest){for(var c=0;c<a.rest.length;c++)if(a.rest[c]==b)return{map:a.measure.maps[c],cache:a.measure.caches[c]};for(b=
0;b<a.rest.length;b++)if(N(a.rest[b])>d)return{map:a.measure.maps[b],cache:a.measure.caches[b],before:!0}}}function Fd(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[db(a,b)];if((a=a.display.externalMeasured)&&b>=a.lineN&&b<a.lineN+a.size)return a}function eb(a,b){var d=N(b),c=Fd(a,d);c&&!c.text?c=null:c&&c.changes&&(Pe(a,c,d,Gd(a)),a.curOp.forceUpdate=!0);if(!c){var e=za(b);c=N(e);e=a.display.externalMeasured=new Oe(a.doc,e,c);e.lineN=c;c=e.built=Me(a,e);e.text=c.pre;D(a.display.lineMeasure,
c.pre);c=e}a=Ve(c,b,d);return{line:b,view:c,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function Aa(a,b,d,c,e){b.before&&(d=-1);var f=d+(c||"");if(b.cache.hasOwnProperty(f))a=b.cache[f];else{b.rect||(b.rect=b.view.text.getBoundingClientRect());if(!b.hasHeights){var g=b.view,h=b.rect,k=a.options.lineWrapping,l=k&&cb(a);if(!g.measure.heights||k&&g.measure.width!=l){var m=g.measure.heights=[];if(k)for(g.measure.width=l,g=g.text.firstChild.getClientRects(),k=0;k<g.length-1;k++){l=
g[k];var n=g[k+1];2<Math.abs(l.bottom-n.bottom)&&m.push((l.bottom+n.top)/2-h.top)}m.push(h.bottom-h.top)}b.hasHeights=!0}m=c;g=We(b.map,d,m);c=g.node;h=g.start;k=g.end;d=g.collapse;if(3==c.nodeType){for(var p=0;4>p;p++){for(;h&&kd(b.line.text.charAt(g.coverStart+h));)--h;for(;g.coverStart+k<g.coverEnd&&kd(b.line.text.charAt(g.coverStart+k));)++k;if(G&&9>T&&0==h&&k==g.coverEnd-g.coverStart)var q=c.parentNode.getBoundingClientRect();else{q=Qb(c,h,k).getClientRects();k=Xe;if("left"==m)for(l=0;l<q.length&&
(k=q[l]).left==k.right;l++);else for(l=q.length-1;0<=l&&(k=q[l]).left==k.right;l--);q=k}if(q.left||q.right||0==h)break;k=h;--h;d="right"}G&&11>T&&((p=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=Hd?p=Hd:(m=D(a.display.measure,v("span","x")),p=m.getBoundingClientRect(),m=Qb(m,0,1).getBoundingClientRect(),p=Hd=1<Math.abs(p.left-m.left)),p=!p),p||(p=screen.logicalXDPI/screen.deviceXDPI,m=screen.logicalYDPI/screen.deviceYDPI,q={left:q.left*p,right:q.right*p,
top:q.top*m,bottom:q.bottom*m}))}else 0<h&&(d=m="right"),q=a.options.lineWrapping&&1<(p=c.getClientRects()).length?p["right"==m?p.length-1:0]:c.getBoundingClientRect();!(G&&9>T)||h||q&&(q.left||q.right)||(q=(q=c.parentNode.getClientRects()[0])?{left:q.left,right:q.left+ub(a.display),top:q.top,bottom:q.bottom}:Xe);c=q.top-b.rect.top;h=q.bottom-b.rect.top;p=(c+h)/2;m=b.view.measure.heights;for(g=0;g<m.length-1&&!(p<m[g]);g++);d={left:("right"==d?q.right:q.left)-b.rect.left,right:("left"==d?q.left:q.right)-
b.rect.left,top:g?m[g-1]:0,bottom:m[g]};q.left||q.right||(d.bogus=!0);a.options.singleCursorHeightPerLine||(d.rtop=c,d.rbottom=h);a=d;a.bogus||(b.cache[f]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function We(a,b,d){for(var c,e,f,g,h,k,l=0;l<a.length;l+=3){h=a[l];k=a[l+1];if(b<h)e=0,f=1,g="left";else if(b<k)e=b-h,f=e+1;else if(l==a.length-3||b==k&&a[l+3]>b)f=k-h,e=f-1,b>=k&&(g="right");if(null!=e){c=a[l+2];h==k&&d==(c.insertLeft?"left":"right")&&(g=d);if("left"==
d&&0==e)for(;l&&a[l-2]==a[l-3]&&a[l-1].insertLeft;)c=a[(l-=3)+2],g="left";if("right"==d&&e==k-h)for(;l<a.length-3&&a[l+3]==a[l+4]&&!a[l+5].insertLeft;)c=a[(l+=3)+2],g="right";break}}return{node:c,start:e,end:f,collapse:g,coverStart:h,coverEnd:k}}function Ye(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function Ze(a){a.display.externalMeasure=null;E(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)Ye(a.display.view[b])}
function Ub(a){Ze(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function $e(a){return Qa&&Gc?-(a.body.getBoundingClientRect().left-parseInt(getComputedStyle(a.body).marginLeft)):a.defaultView.pageXOffset||(a.documentElement||a.body).scrollLeft}function af(a){return Qa&&Gc?-(a.body.getBoundingClientRect().top-parseInt(getComputedStyle(a.body).marginTop)):a.defaultView.pageYOffset||
(a.documentElement||a.body).scrollTop}function Id(a){a=za(a).widgets;var b=0;if(a)for(var d=0;d<a.length;++d)a[d].above&&(b+=Tb(a[d]));return b}function Hc(a,b,d,c,e){e||(e=Id(b),d.top+=e,d.bottom+=e);if("line"==c)return d;c||(c="local");b=Ga(b);b="local"==c?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==c||"window"==c)e=a.display.lineSpace.getBoundingClientRect(),b+=e.top+("window"==c?0:af(qa(a))),a=e.left+("window"==c?0:$e(qa(a))),d.left+=a,d.right+=a;d.top+=b;d.bottom+=b;return d}
function bf(a,b,d){if("div"==d)return b;var c=b.left;b=b.top;"page"==d?(c-=$e(qa(a)),b-=af(qa(a))):"local"!=d&&d||(d=a.display.sizer.getBoundingClientRect(),c+=d.left,b+=d.top);a=a.display.lineSpace.getBoundingClientRect();return{left:c-a.left,top:b-a.top}}function Ic(a,b,d,c,e){c||(c=w(a.doc,b.line));var f=c;b=b.ch;c=Aa(a,eb(a,c),b,e);return Hc(a,f,c,d)}function Ba(a,b,d,c,e,f){function g(p,q){p=Aa(a,e,p,q?"right":"left",f);q?p.left=p.right:p.right=p.left;return Hc(a,c,p,d)}function h(p,q,r){return g(r?
p-1:p,1==k[q].level!=r)}c=c||w(a.doc,b.line);e||(e=eb(a,c));var k=Ja(c,a.doc.direction),l=b.ch;b=b.sticky;l>=c.text.length?(l=c.text.length,b="before"):0>=l&&(l=0,b="after");if(!k)return g("before"==b?l-1:l,"before"==b);var m=Kb(k,l,b),n=Lb;m=h(l,m,"before"==b);null!=n&&(m.other=h(l,n,"before"!=b));return m}function cf(a,b){var d=0;b=C(a.doc,b);a.options.lineWrapping||(d=ub(a.display)*b.ch);b=w(a.doc,b.line);a=Ga(b)+a.display.lineSpace.offsetTop;return{left:d,right:d,top:a,bottom:a+b.height}}function Jd(a,
b,d,c,e){a=t(a,b,d);a.xRel=e;c&&(a.outside=c);return a}function Kd(a,b,d){var c=a.doc;d+=a.display.viewOffset;if(0>d)return Jd(c.first,0,null,-1,-1);var e=bb(c,d),f=c.first+c.size-1;if(e>f)return Jd(c.first+c.size-1,w(c,f).text.length,null,1,1);0>b&&(b=0);for(var g=w(c,e);;){f=Qg(a,g,e,b,d);var h=void 0;var k=f.ch+(0<f.xRel||0<f.outside?1:0);if(g=Ka&&g.markedSpans)for(var l=0;l<g.length;++l){var m=g[l];m.marker.collapsed&&(null==m.from||m.from<k)&&(null==m.to||m.to>k)&&(!h||0>wd(h,m.marker))&&(h=
m.marker)}if(!h)return f;f=h.find(1);if(f.line==e)return f;g=w(c,e=f.line)}}function df(a,b,d,c){c-=Id(b);b=b.text.length;var e=Jb(function(f){return Aa(a,d,f-1).bottom<=c},b,0);b=Jb(function(f){return Aa(a,d,f).top>c},e,b);return{begin:e,end:b}}function ef(a,b,d,c){d||(d=eb(a,b));c=Hc(a,b,Aa(a,d,c),"line").top;return df(a,b,d,c)}function Ld(a,b,d,c){return a.bottom<=d?!1:a.top>d?!0:(c?a.left:a.right)>b}function Qg(a,b,d,c,e){e-=Ga(b);var f=eb(a,b),g=Id(b),h=0,k=b.text.length,l=!0,m=Ja(b,a.doc.direction);
m&&(m=(a.options.lineWrapping?Rg:Sg)(a,b,d,f,m,c,e),h=(l=1!=m.level)?m.from:m.to-1,k=l?m.to:m.from-1);var n=null,p=null;m=Jb(function(r){var u=Aa(a,f,r);u.top+=g;u.bottom+=g;if(!Ld(u,c,e,!1))return!1;u.top<=e&&u.left<=c&&(n=r,p=u);return!0},h,k);var q=!1;p?(h=c-p.left<p.right-c,l=h==l,m=n+(l?0:1),l=l?"after":"before",h=h?p.left:p.right):(l||m!=k&&m!=h||m++,l=0==m?"after":m==b.text.length?"before":Aa(a,f,m-(l?1:0)).bottom+g<=e==l?"after":"before",q=Ba(a,t(d,m,l),"line",b,f),h=q.left,q=e<q.top?-1:e>=
q.bottom?1:0);m=te(b.text,m,1);return Jd(d,m,l,q,c-h)}function Sg(a,b,d,c,e,f,g){var h=Jb(function(m){m=e[m];var n=1!=m.level;return Ld(Ba(a,t(d,n?m.to:m.from,n?"before":"after"),"line",b,c),f,g,!0)},0,e.length-1),k=e[h];if(0<h){var l=1!=k.level;l=Ba(a,t(d,l?k.from:k.to,l?"after":"before"),"line",b,c);Ld(l,f,g,!0)&&l.top>g&&(k=e[h-1])}return k}function Rg(a,b,d,c,e,f,g){g=df(a,b,c,g);d=g.begin;g=g.end;/\s/.test(b.text.charAt(g-1))&&g--;for(var h=b=null,k=0;k<e.length;k++){var l=e[k];if(!(l.from>=
g||l.to<=d)){var m=Aa(a,c,1!=l.level?Math.min(g,l.to)-1:Math.max(d,l.from)).right;m=m<f?f-m+1E9:m-f;if(!b||h>m)b=l,h=m}}b||(b=e[e.length-1]);b.from<d&&(b={from:d,to:b.to,level:b.level});b.to>g&&(b={from:b.from,to:g,level:b.level});return b}function vb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==fb){fb=v("pre",null,"CodeMirror-line-like");for(var b=0;49>b;++b)fb.appendChild(document.createTextNode("x")),fb.appendChild(v("br"));fb.appendChild(document.createTextNode("x"))}D(a.measure,
fb);b=fb.offsetHeight/50;3<b&&(a.cachedTextHeight=b);E(a.measure);return b||1}function ub(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=v("span","xxxxxxxxxx"),d=v("pre",[b],"CodeMirror-line-like");D(a.measure,d);b=b.getBoundingClientRect();b=(b.right-b.left)/10;2<b&&(a.cachedCharWidth=b);return b||10}function Gd(a){for(var b=a.display,d={},c={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g){var h=a.display.gutterSpecs[g].className;d[h]=f.offsetLeft+f.clientLeft+
e;c[h]=f.clientWidth}return{fixedPos:Md(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:d,gutterWidth:c,wrapperWidth:b.wrapper.clientWidth}}function Md(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function ff(a){var b=vb(a.display),d=a.options.lineWrapping,c=d&&Math.max(5,a.display.scroller.clientWidth/ub(a.display)-3);return function(e){if(Pa(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);
return d?f+(Math.ceil(e.text.length/c)||1)*b:f+b}}function Nd(a){var b=a.doc,d=ff(a);b.iter(function(c){var e=d(c);e!=c.height&&Ea(c,e)})}function gb(a,b,d,c){var e=a.display;if(!d&&"true"==(b.target||b.srcElement).getAttribute("cm-not-content"))return null;d=e.lineSpace.getBoundingClientRect();try{var f=b.clientX-d.left;var g=b.clientY-d.top}catch(k){return null}b=Kd(a,f,g);var h;c&&0<b.xRel&&(h=w(a.doc,b.line).text).length==b.ch&&(c=wa(h,h.length,a.options.tabSize)-h.length,b=t(b.line,Math.max(0,
Math.round((f-Ue(a.display).left)/ub(a.display))-c)));return b}function db(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;a=a.display.view;for(var d=0;d<a.length;d++)if(b-=a[d].size,0>b)return d}function ma(a,b,d,c){null==b&&(b=a.doc.first);null==d&&(d=a.doc.first+a.doc.size);c||(c=0);var e=a.display;c&&d<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)Ka&&xd(a.doc,b)<e.viewTo&&Ra(a);else if(d<=
e.viewFrom)Ka&&Ke(a.doc,d+c)>e.viewFrom?Ra(a):(e.viewFrom+=c,e.viewTo+=c);else if(b<=e.viewFrom&&d>=e.viewTo)Ra(a);else if(b<=e.viewFrom){var f=Jc(a,d,d+c,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=c):Ra(a)}else if(d>=e.viewTo)(f=Jc(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Ra(a);else{f=Jc(a,b,b,-1);var g=Jc(a,d,d+c,1);f&&g?(e.view=e.view.slice(0,f.index).concat(Fc(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=c):Ra(a)}if(a=e.externalMeasured)d<
a.lineN?a.lineN+=c:b<a.lineN+a.size&&(e.externalMeasured=null)}function Sa(a,b,d){a.curOp.viewChanged=!0;var c=a.display,e=a.display.externalMeasured;e&&b>=e.lineN&&b<e.lineN+e.size&&(c.externalMeasured=null);b<c.viewFrom||b>=c.viewTo||(a=c.view[db(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==ea(a,d)&&a.push(d)))}function Ra(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function Jc(a,b,d,c){var e=db(a,b),f=a.display.view;if(!Ka||d==a.doc.first+
a.doc.size)return{index:e,lineN:d};for(var g=a.display.viewFrom,h=0;h<e;h++)g+=f[h].size;if(g!=b){if(0<c){if(e==f.length-1)return null;b=g+f[e].size-b;e++}else b=g-b;d+=b}for(;xd(a.doc,d)!=d;){if(e==(0>c?0:f.length-1))return null;d+=c*f[e-(0>c?1:0)].size;e+=c}return{index:e,lineN:d}}function gf(a){a=a.display.view;for(var b=0,d=0;d<a.length;d++){var c=a[d];c.hidden||c.node&&!c.changes||++b}return b}function Vb(a){a.display.input.showSelection(a.display.input.prepareSelection())}function hf(a,b){void 0===
b&&(b=!0);var d=a.doc,c={},e=c.cursors=document.createDocumentFragment(),f=c.selection=document.createDocumentFragment(),g=a.options.$customCursor;g&&(b=!0);for(var h=0;h<d.sel.ranges.length;h++)if(b||h!=d.sel.primIndex){var k=d.sel.ranges[h];if(!(k.from().line>=a.display.viewTo||k.to().line<a.display.viewFrom)){var l=k.empty();if(g){var m=g(a,k);m&&Od(a,m,e)}else(l||a.options.showCursorWhenSelecting)&&Od(a,k.head,e);l||Tg(a,k,f)}}return c}function Od(a,b,d){var c=Ba(a,b,"div",null,null,!a.options.singleCursorHeightPerLine),
e=d.appendChild(v("div","\u00a0","CodeMirror-cursor"));e.style.left=c.left+"px";e.style.top=c.top+"px";e.style.height=Math.max(0,c.bottom-c.top)*a.options.cursorHeight+"px";/\bcm-fat-cursor\b/.test(a.getWrapperElement().className)&&(b=Ic(a,b,"div",null,null),b=b.right-b.left,e.style.width=(0<b?b:a.defaultCharWidth())+"px");c.other&&(a=d.appendChild(v("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor")),a.style.display="",a.style.left=c.other.left+"px",a.style.top=c.other.top+"px",a.style.height=
.85*(c.other.bottom-c.other.top)+"px")}function Kc(a,b){return a.top-b.top||a.left-b.left}function Tg(a,b,d){function c(q,r,u,A){0>r&&(r=0);r=Math.round(r);A=Math.round(A);h.appendChild(v("div",null,"CodeMirror-selected","position: absolute; left: "+q+"px;\n top: "+r+"px; width: "+(null==u?m-q:u)+"px;\n height: "+(A-r)+"px"))}function e(q,r,u){function A(F,R){return Ic(a,t(q,F),"div",x,R)}function Y(F,R,H){F=ef(a,x,null,F);R="ltr"==R==("after"==
H)?"left":"right";H="after"==H?F.begin:F.end-(/\s/.test(x.text.charAt(F.end-1))?2:1);return A(H,R)[R]}var x=w(g,q),P=x.text.length,K,Q,S=Ja(x,g.direction);Bg(S,r||0,null==u?P:u,function(F,R,H,L){var ha="ltr"==H,na=A(F,ha?"left":"right"),ua=A(R-1,ha?"right":"left"),hb=null==r&&0==F,ib=null==u&&R==P,Pd=0==L;L=!S||L==S.length-1;3>=ua.top-na.top?(R=(n?hb:ib)&&Pd?l:(ha?na:ua).left,c(R,na.top,((n?ib:hb)&&L?m:(ha?ua:na).right)-R,na.bottom)):(ha?(ha=n&&hb&&Pd?l:na.left,hb=n?m:Y(F,H,"before"),F=n?l:Y(R,H,
"after"),ib=n&&ib&&L?m:ua.right):(ha=n?Y(F,H,"before"):l,hb=!n&&hb&&Pd?m:na.right,F=!n&&ib&&L?l:ua.left,ib=n?Y(R,H,"after"):m),c(ha,na.top,hb-ha,na.bottom),na.bottom<ua.top&&c(l,na.bottom,null,ua.top),c(F,ua.top,ib-F,ua.bottom));if(!K||0>Kc(na,K))K=na;0>Kc(ua,K)&&(K=ua);if(!Q||0>Kc(na,Q))Q=na;0>Kc(ua,Q)&&(Q=ua)});return{start:K,end:Q}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=Ue(a.display),l=k.left,m=Math.max(f.sizerWidth,cb(a)-f.sizer.offsetLeft)-k.right,n="ltr"==g.direction;
f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var p=w(g,f.line);k=w(g,b.line);k=za(p)==za(k);f=e(f.line,f.ch,k?p.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.top<b.top-2?(c(f.right,f.top,null,f.bottom),c(l,b.top,b.left,b.bottom)):c(f.right,f.top,b.left-f.right,f.bottom));f.bottom<b.top&&c(l,f.bottom,null,b.top)}d.appendChild(h)}function Qd(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var d=!0;b.cursorDiv.style.visibility="";0<a.options.cursorBlinkRate?
b.blinker=setInterval(function(){a.hasFocus()||wb(a);b.cursorDiv.style.visibility=(d=!d)?"":"hidden"},a.options.cursorBlinkRate):0>a.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function jf(a){a.hasFocus()||(a.display.input.focus(),a.state.focused||Rd(a))}function Sd(a){a.state.delayingBlurEvent=!0;setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,a.state.focused&&wb(a))},100)}function Rd(a,b){a.state.delayingBlurEvent&&!a.state.draggingText&&(a.state.delayingBlurEvent=
!1);"nocursor"!=a.options.readOnly&&(a.state.focused||(W(a,"focus",a,b),a.state.focused=!0,Ya(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),fa&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Qd(a))}function wb(a,b){a.state.delayingBlurEvent||(a.state.focused&&(W(a,"blur",a,b),a.state.focused=!1,jb(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||
(a.display.shift=!1)},150))}function Lc(a){for(var b=a.display,d=b.lineDiv.offsetTop,c=Math.max(0,b.scroller.getBoundingClientRect().top),e=b.lineDiv.getBoundingClientRect().top,f=0,g=0;g<b.view.length;g++){var h=b.view[g],k=a.options.lineWrapping,l=0;if(!h.hidden){e+=h.line.height;if(G&&8>T){k=h.node.offsetTop+h.node.offsetHeight;var m=k-d;d=k}else{var n=h.node.getBoundingClientRect();m=n.bottom-n.top;!k&&h.text.firstChild&&(l=h.text.firstChild.getBoundingClientRect().right-n.left-1)}k=h.line.height-
m;if(.005<k||-.005>k)if(e<c&&(f-=k),Ea(h.line,m),kf(h.line),h.rest)for(m=0;m<h.rest.length;m++)kf(h.rest[m]);l>a.display.sizerWidth&&(l=Math.ceil(l/ub(a.display)),l>a.display.maxLineLength&&(a.display.maxLineLength=l,a.display.maxLine=h.line,a.display.maxLineChanged=!0))}}2<Math.abs(f)&&(b.scroller.scrollTop+=f)}function kf(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b){var d=a.widgets[b],c=d.node.parentNode;c&&(d.height=c.offsetHeight)}}function Mc(a,b,d){var c=d&&null!=d.top?Math.max(0,d.top):
a.scroller.scrollTop;c=Math.floor(c-a.lineSpace.offsetTop);var e=d&&null!=d.bottom?d.bottom:c+a.wrapper.clientHeight;c=bb(b,c);e=bb(b,e);if(d&&d.ensure){var f=d.ensure.from.line;d=d.ensure.to.line;f<c?(c=f,e=bb(b,Ga(w(b,f))+a.wrapper.clientHeight)):Math.min(d,b.lastLine())>=e&&(c=bb(b,Ga(w(b,d))-a.wrapper.clientHeight),e=d)}return{from:c,to:Math.max(e,c+1)}}function Td(a,b){var d=a.display,c=vb(a.display);0>b.top&&(b.top=0);var e=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:d.scroller.scrollTop,
f=Ed(a),g={};b.bottom-b.top>f&&(b.bottom=b.top+f);var h=a.doc.height+Dd(d),k=b.top<c;c=b.bottom>h-c;b.top<e?g.scrollTop=k?0:b.top:b.bottom>e+f&&(f=Math.min(b.top,(c?h:b.bottom)-f),f!=e&&(g.scrollTop=f));e=a.options.fixedGutter?0:d.gutters.offsetWidth;f=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:d.scroller.scrollLeft-e;a=cb(a)-d.gutters.offsetWidth;if(d=b.right-b.left>a)b.right=b.left+a;10>b.left?g.scrollLeft=0:b.left<f?g.scrollLeft=Math.max(0,b.left+e-(d?0:10)):b.right>a+f-3&&(g.scrollLeft=
b.right+(d?0:10)-a);return g}function Nc(a,b){null!=b&&(Oc(a),a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+b)}function xb(a){Oc(a);var b=a.getCursor();a.curOp.scrollToPos={from:b,to:b,margin:a.options.cursorScrollMargin}}function Wb(a,b,d){null==b&&null==d||Oc(a);null!=b&&(a.curOp.scrollLeft=b);null!=d&&(a.curOp.scrollTop=d)}function Oc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var d=cf(a,b.from),c=cf(a,b.to);lf(a,d,c,b.margin)}}function lf(a,b,d,
c){b=Td(a,{left:Math.min(b.left,d.left),top:Math.min(b.top,d.top)-c,right:Math.max(b.right,d.right),bottom:Math.max(b.bottom,d.bottom)+c});Wb(a,b.scrollLeft,b.scrollTop)}function Xb(a,b){2>Math.abs(a.doc.scrollTop-b)||(Ma||Ud(a,{top:b}),mf(a,b,!0),Ma&&Ud(a),Yb(a,100))}function mf(a,b,d){b=Math.max(0,Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,b));if(a.display.scroller.scrollTop!=b||d)a.doc.scrollTop=b,a.display.scrollbars.setScrollTop(b),a.display.scroller.scrollTop!=
b&&(a.display.scroller.scrollTop=b)}function kb(a,b,d,c){b=Math.max(0,Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth));(d?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))&&!c||(a.doc.scrollLeft=b,nf(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function Zb(a){var b=a.display,d=b.gutters.offsetWidth,c=Math.round(a.doc.height+Dd(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,
scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?d:0,docHeight:c,scrollHeight:c+Ha(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:d}}function yb(a,b){b||(b=Zb(a));var d=a.display.barWidth,c=a.display.barHeight;of(a,b);for(b=0;4>b&&d!=a.display.barWidth||c!=a.display.barHeight;b++)d!=a.display.barWidth&&a.options.lineWrapping&&Lc(a),of(a,Zb(a)),d=a.display.barWidth,c=a.display.barHeight}function of(a,b){var d=
a.display,c=d.scrollbars.update(b);d.sizer.style.paddingRight=(d.barWidth=c.right)+"px";d.sizer.style.paddingBottom=(d.barHeight=c.bottom)+"px";d.heightForcer.style.borderBottom=c.bottom+"px solid transparent";c.right&&c.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=c.bottom+"px",d.scrollbarFiller.style.width=c.right+"px"):d.scrollbarFiller.style.display="";c.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(d.gutterFiller.style.display="block",
d.gutterFiller.style.height=c.bottom+"px",d.gutterFiller.style.width=b.gutterWidth+"px"):d.gutterFiller.style.display=""}function pf(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&jb(a.display.wrapper,a.display.scrollbars.addClass));a.display.scrollbars=new qf[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);z(b,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)});
b.setAttribute("cm-not-content","true")},function(b,d){"horizontal"==d?kb(a,b):Xb(a,b)},a);a.display.scrollbars.addClass&&Ya(a.display.wrapper,a.display.scrollbars.addClass)}function lb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.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:++Ug,markArrays:null};a=a.curOp;tb?tb.ops.push(a):a.ownsGroup=
tb={ops:[a],delayedCallbacks:[]}}function mb(a){(a=a.curOp)&&Ng(a,function(b){for(var d=0;d<b.ops.length;d++)b.ops[d].cm.curOp=null;b=b.ops;for(d=0;d<b.length;d++){var c=b[d],e=c.cm,f=e.display,g=e.display;!g.scrollbarsClipped&&g.scroller.offsetWidth&&(g.nativeBarWidth=g.scroller.offsetWidth-g.scroller.clientWidth,g.heightForcer.style.height=Ha(e)+"px",g.sizer.style.marginBottom=-g.nativeBarWidth+"px",g.sizer.style.borderRightWidth=Ha(e)+"px",g.scrollbarsClipped=!0);c.updateMaxLine&&zd(e);c.mustUpdate=
c.viewChanged||c.forceUpdate||null!=c.scrollTop||c.scrollToPos&&(c.scrollToPos.from.line<f.viewFrom||c.scrollToPos.to.line>=f.viewTo)||f.maxLineChanged&&e.options.lineWrapping;c.update=c.mustUpdate&&new Pc(e,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}for(d=0;d<b.length;d++)c=b[d],c.updatedDisplay=c.mustUpdate&&Vd(c.cm,c.update);for(d=0;d<b.length;d++)if(c=b[d],e=c.cm,f=e.display,c.updatedDisplay&&Lc(e),c.barMeasure=Zb(e),f.maxLineChanged&&!e.options.lineWrapping&&(g=f.maxLine.text.length,
g=Aa(e,eb(e,f.maxLine),g,void 0),c.adjustWidthTo=g.left+3,e.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(f.scroller.clientWidth,f.sizer.offsetLeft+c.adjustWidthTo+Ha(e)+e.display.barWidth),c.maxScrollLeft=Math.max(0,f.sizer.offsetLeft+c.adjustWidthTo-cb(e))),c.updatedDisplay||c.selectionChanged)c.preparedSelection=f.input.prepareSelection();for(d=0;d<b.length;d++)c=b[d],e=c.cm,null!=c.adjustWidthTo&&(e.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft<e.doc.scrollLeft&&
kb(e,Math.min(e.display.scroller.scrollLeft,c.maxScrollLeft),!0),e.display.maxLineChanged=!1),f=c.focus&&c.focus==ka(qa(e)),c.preparedSelection&&e.display.input.showSelection(c.preparedSelection,f),(c.updatedDisplay||c.startHeight!=e.doc.height)&&yb(e,c.barMeasure),c.updatedDisplay&&Wd(e,c.barMeasure),c.selectionChanged&&Qd(e),e.state.focused&&c.updateInput&&e.display.input.reset(c.typing),f&&jf(c.cm);for(d=0;d<b.length;d++){var h=void 0;c=b[d];e=c.cm;f=e.display;g=e.doc;c.updatedDisplay&&rf(e,c.update);
null==f.wheelStartX||null==c.scrollTop&&null==c.scrollLeft&&!c.scrollToPos||(f.wheelStartX=f.wheelStartY=null);null!=c.scrollTop&&mf(e,c.scrollTop,c.forceScroll);null!=c.scrollLeft&&kb(e,c.scrollLeft,!0,!0);if(c.scrollToPos){var k=C(g,c.scrollToPos.from);var l=C(g,c.scrollToPos.to);var m=c.scrollToPos.margin;null==m&&(m=0);e.options.lineWrapping||k!=l||(l="before"==k.sticky?t(k.line,k.ch+1,"before"):k,k=k.ch?t(k.line,"before"==k.sticky?k.ch-1:k.ch,"after"):k);for(var n=0;5>n;n++){var p=!1;h=Ba(e,
k);var q=l&&l!=k?Ba(e,l):h;h={left:Math.min(h.left,q.left),top:Math.min(h.top,q.top)-m,right:Math.max(h.left,q.left),bottom:Math.max(h.bottom,q.bottom)+m};q=Td(e,h);var r=e.doc.scrollTop,u=e.doc.scrollLeft;null!=q.scrollTop&&(Xb(e,q.scrollTop),1<Math.abs(e.doc.scrollTop-r)&&(p=!0));null!=q.scrollLeft&&(kb(e,q.scrollLeft),1<Math.abs(e.doc.scrollLeft-u)&&(p=!0));if(!p)break}l=h;Z(e,"scrollCursorIntoView")||(m=e.display,n=m.sizer.getBoundingClientRect(),k=null,p=m.wrapper.ownerDocument,0>l.top+n.top?
k=!0:l.bottom+n.top>(p.defaultView.innerHeight||p.documentElement.clientHeight)&&(k=!1),null==k||Vg||(l=v("div","\u200b",null,"position: absolute;\n top: "+(l.top-m.viewOffset-e.display.lineSpace.offsetTop)+"px;\n height: "+(l.bottom-l.top+Ha(e)+m.barHeight)+"px;\n left: "+l.left+"px; width: "+Math.max(2,l.right-l.left)+"px;"),e.display.lineSpace.appendChild(l),l.scrollIntoView(k),e.display.lineSpace.removeChild(l)))}l=c.maybeHiddenMarkers;
k=c.maybeUnhiddenMarkers;if(l)for(m=0;m<l.length;++m)l[m].lines.length||W(l[m],"hide");if(k)for(l=0;l<k.length;++l)k[l].lines.length&&W(k[l],"unhide");f.wrapper.offsetHeight&&(g.scrollTop=e.display.scroller.scrollTop);c.changeObjs&&W(e,"changes",e,c.changeObjs);c.update&&c.update.finish()}})}function ra(a,b){if(a.curOp)return b();lb(a);try{return b()}finally{mb(a)}}function ba(a,b){return function(){if(a.curOp)return b.apply(a,arguments);lb(a);try{return b.apply(a,arguments)}finally{mb(a)}}}function ia(a){return function(){if(this.curOp)return a.apply(this,
arguments);lb(this);try{return a.apply(this,arguments)}finally{mb(this)}}}function ca(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);lb(b);try{return a.apply(this,arguments)}finally{mb(b)}}}function Yb(a,b){a.doc.highlightFrontier<a.display.viewTo&&a.state.highlight.set(b,gd(Wg,a))}function Wg(a){var b=a.doc;if(!(b.highlightFrontier>=a.display.viewTo)){var d=+new Date+a.options.workTime,c=Ob(a,b.highlightFrontier),e=[];b.iter(c.line,Math.min(b.first+b.size,a.display.viewTo+
500),function(f){if(c.line>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength?$a(b.mode,c.state):null,k=ze(a,f,c,!0);h&&(c.state=h);f.styles=k.styles;h=f.styleClasses;(k=k.classes)?f.styleClasses=k:h&&(f.styleClasses=null);k=!g||g.length!=f.styles.length||h!=k&&(!h||!k||h.bgClass!=k.bgClass||h.textClass!=k.textClass);for(h=0;!k&&h<g.length;++h)k=g[h]!=f.styles[h];k&&e.push(c.line);f.stateAfter=c.save()}else f.text.length<=a.options.maxHighlightLength&&td(a,f.text,c),
f.stateAfter=0==c.line%5?c.save():null;c.nextLine();if(+new Date>d)return Yb(a,a.options.workDelay),!0});b.highlightFrontier=c.line;b.modeFrontier=Math.max(b.modeFrontier,c.line);e.length&&ra(a,function(){for(var f=0;f<e.length;f++)Sa(a,e[f],"text")})}}function Vd(a,b){var d=a.display,c=a.doc;if(b.editorIsHidden)return Ra(a),!1;if(!b.force&&b.visible.from>=d.viewFrom&&b.visible.to<=d.viewTo&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&0==gf(a))return!1;sf(a)&&
(Ra(a),b.dims=Gd(a));var e=c.first+c.size,f=Math.max(b.visible.from-a.options.viewportMargin,c.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);d.viewFrom<f&&20>f-d.viewFrom&&(f=Math.max(c.first,d.viewFrom));d.viewTo>g&&20>d.viewTo-g&&(g=Math.min(e,d.viewTo));Ka&&(f=xd(a.doc,f),g=Ke(a.doc,g));c=f!=d.viewFrom||g!=d.viewTo||d.lastWrapHeight!=b.wrapperHeight||d.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=Fc(a,f,g),e.viewFrom=f):(e.viewFrom>
f?e.view=Fc(a,f,e.viewFrom).concat(e.view):e.viewFrom<f&&(e.view=e.view.slice(db(a,f))),e.viewFrom=f,e.viewTo<g?e.view=e.view.concat(Fc(a,e.viewTo,g)):e.viewTo>g&&(e.view=e.view.slice(0,db(a,g))));e.viewTo=g;d.viewOffset=Ga(w(a.doc,d.viewFrom));a.display.mover.style.top=d.viewOffset+"px";g=gf(a);if(!c&&0==g&&!b.force&&d.renderedView==d.view&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo))return!1;a.hasFocus()?f=null:(f=ka(qa(a)))&&ja(a.display.lineDiv,f)?(f={activeElt:f},window.getSelection&&
(e=qa(a).defaultView.getSelection(),e.anchorNode&&e.extend&&ja(a.display.lineDiv,e.anchorNode)&&(f.anchorNode=e.anchorNode,f.anchorOffset=e.anchorOffset,f.focusNode=e.focusNode,f.focusOffset=e.focusOffset))):f=null;4<g&&(d.lineDiv.style.display="none");Xg(a,d.updateLineNumbers,b.dims);4<g&&(d.lineDiv.style.display="");d.renderedView=d.view;(g=f)&&g.activeElt&&g.activeElt!=ka(g.activeElt.ownerDocument)&&(g.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(g.activeElt.nodeName)&&g.anchorNode&&ja(document.body,
g.anchorNode)&&ja(document.body,g.focusNode)&&(e=g.activeElt.ownerDocument,f=e.defaultView.getSelection(),e=e.createRange(),e.setEnd(g.anchorNode,g.anchorOffset),e.collapse(!1),f.removeAllRanges(),f.addRange(e),f.extend(g.focusNode,g.focusOffset)));E(d.cursorDiv);E(d.selectionDiv);d.gutters.style.height=d.sizer.style.minHeight=0;c&&(d.lastWrapHeight=b.wrapperHeight,d.lastWrapWidth=b.wrapperWidth,Yb(a,400));d.updateLineNumbers=null;return!0}function rf(a,b){for(var d=b.viewport,c=!0;;c=!1){if(c&&a.options.lineWrapping&&
b.oldDisplayWidth!=cb(a))c&&(b.visible=Mc(a.display,a.doc,d));else if(d&&null!=d.top&&(d={top:Math.min(a.doc.height+Dd(a.display)-Ed(a),d.top)}),b.visible=Mc(a.display,a.doc,d),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!Vd(a,b))break;Lc(a);c=Zb(a);Vb(a);yb(a,c);Wd(a,c);b.force=!1}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=
a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function Ud(a,b){b=new Pc(a,b);if(Vd(a,b)){Lc(a);rf(a,b);var d=Zb(a);Vb(a);yb(a,d);Wd(a,d);b.finish()}}function Xg(a,b,d){function c(p){var q=p.nextSibling;fa&&ya&&a.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p);return q}var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,k=e.view;e=e.viewFrom;for(var l=0;l<k.length;l++){var m=k[l];if(!m.hidden)if(m.node&&m.node.parentNode==g){for(;h!=m.node;)h=
c(h);h=f&&null!=b&&b<=e&&m.lineNumber;m.changes&&(-1<ea(m.changes,"gutter")&&(h=!1),Pe(a,m,e,d));h&&(E(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(qd(a.options,e))));h=m.node.nextSibling}else{var n=Pg(a,m,e,d);g.insertBefore(n,h)}e+=m.size}for(;h;)h=c(h)}function Xd(a){a.sizer.style.marginLeft=a.gutters.offsetWidth+"px";aa(a,"gutterChanged",a)}function Wd(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";a.display.heightForcer.style.top=b.docHeight+"px";a.display.gutters.style.height=
b.docHeight+a.display.barHeight+Ha(a)+"px"}function nf(a){var b=a.display,d=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=Md(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=c+"px",g=0;g<d.length;g++)if(!d[g].hidden){a.options.fixedGutter&&(d[g].gutter&&(d[g].gutter.style.left=f),d[g].gutterBackground&&(d[g].gutterBackground.style.left=f));var h=d[g].alignable;if(h)for(var k=0;k<h.length;k++)h[k].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=
c+e+"px")}}function sf(a){if(!a.options.lineNumbers)return!1;var b=a.doc;b=qd(a.options,b.first+b.size-1);var d=a.display;if(b.length!=d.lineNumChars){var c=d.measure.appendChild(v("div",[v("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=c.firstChild.offsetWidth;c=c.offsetWidth-e;d.lineGutter.style.width="";d.lineNumInnerWidth=Math.max(e,d.lineGutter.offsetWidth-c)+1;d.lineNumWidth=d.lineNumInnerWidth+c;d.lineNumChars=d.lineNumInnerWidth?b.length:-1;d.lineGutter.style.width=d.lineNumWidth+
"px";Xd(a.display);return!0}return!1}function Yd(a,b){for(var d=[],c=!1,e=0;e<a.length;e++){var f=a[e],g=null;"string"!=typeof f&&(g=f.style,f=f.className);if("CodeMirror-linenumbers"==f)if(b)c=!0;else continue;d.push({className:f,style:g})}b&&!c&&d.push({className:"CodeMirror-linenumbers",style:null});return d}function tf(a){var b=a.gutters,d=a.gutterSpecs;E(b);a.lineGutter=null;for(var c=0;c<d.length;++c){var e=d[c],f=e.className;e=e.style;var g=b.appendChild(v("div",null,"CodeMirror-gutter "+f));
e&&(g.style.cssText=e);"CodeMirror-linenumbers"==f&&(a.lineGutter=g,g.style.width=(a.lineNumWidth||1)+"px")}b.style.display=d.length?"":"none";Xd(a)}function $b(a){tf(a.display);ma(a);nf(a)}function Yg(a,b,d,c){this.input=d;this.scrollbarFiller=v("div",null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content","true");this.gutterFiller=v("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content","true");this.lineDiv=M("div",null,"CodeMirror-code");
this.selectionDiv=v("div",null,null,"position: relative; z-index: 1");this.cursorDiv=v("div",null,"CodeMirror-cursors");this.measure=v("div",null,"CodeMirror-measure");this.lineMeasure=v("div",null,"CodeMirror-measure");this.lineSpace=M("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var e=M("div",[this.lineSpace],"CodeMirror-lines");this.mover=v("div",[e],null,"position: relative");this.sizer=v("div",[this.mover],"CodeMirror-sizer");
this.sizerWidth=null;this.heightForcer=v("div",null,null,"position: absolute; height: 50px; width: 1px;");this.gutters=v("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=v("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=v("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");Qa&&105<=uf&&(this.wrapper.style.clipPath="inset(0px)");this.wrapper.setAttribute("translate","no");G&&8>
T&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);fa||Ma&&ac||(this.scroller.draggable=!0);a&&(a.appendChild?a.appendChild(this.wrapper):a(this.wrapper));this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth=
this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;this.gutterSpecs=Yd(c.gutters,c.lineNumbers);tf(this);d.init(this)}function vf(a){var b=a.wheelDeltaX,d=a.wheelDeltaY;null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail);null==d&&a.detail&&a.axis==a.VERTICAL_AXIS?
d=a.detail:null==d&&(d=a.wheelDelta);return{x:b,y:d}}function Zg(a){a=vf(a);a.x*=Na;a.y*=Na;return a}function wf(a,b){Qa&&102==uf&&(null==a.display.chromeScrollHack?a.display.sizer.style.pointerEvents="none":clearTimeout(a.display.chromeScrollHack),a.display.chromeScrollHack=setTimeout(function(){a.display.chromeScrollHack=null;a.display.sizer.style.pointerEvents=""},100));var d=vf(b),c=d.x;d=d.y;var e=Na;0===b.deltaMode&&(c=b.deltaX,d=b.deltaY,e=1);var f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,
k=g.scrollHeight>g.clientHeight;if(c&&h||d&&k){if(d&&ya&&fa){h=b.target;var l=f.view;a:for(;h!=g;h=h.parentNode)for(var m=0;m<l.length;m++)if(l[m].node==h){a.display.currentWheelTarget=h;break a}}!c||Ma||Ca||null==e?(d&&null!=e&&(e*=d,k=a.doc.scrollTop,h=k+f.wrapper.clientHeight,0>e?k=Math.max(0,k+e-50):h=Math.min(a.doc.height,h+e+50),Ud(a,{top:k,bottom:h})),20>Qc&&0!==b.deltaMode&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=c,f.wheelDY=d,setTimeout(function(){if(null!=
f.wheelStartX){var n=g.scrollLeft-f.wheelStartX,p=g.scrollTop-f.wheelStartY;n=p&&f.wheelDY&&p/f.wheelDY||n&&f.wheelDX&&n/f.wheelDX;f.wheelStartX=f.wheelStartY=null;n&&(Na=(Na*Qc+n)/(Qc+1),++Qc)}},200)):(f.wheelDX+=c,f.wheelDY+=d))):(d&&k&&Xb(a,Math.max(0,g.scrollTop+d*e)),kb(a,Math.max(0,g.scrollLeft+c*e)),(!d||d&&k)&&la(b),f.wheelStartX=null)}}function Da(a,b,d){a=a&&a.options.selectionsMayTouch;d=b[d];b.sort(function(k,l){return B(k.from(),l.from())});d=ea(b,d);for(var c=1;c<b.length;c++){var e=
b[c],f=b[c-1],g=B(f.to(),e.from());if(a&&!e.empty()?0<g:0<=g){g=Bc(f.from(),e.from());var h=Ac(f.to(),e.to());e=f.empty()?e.from()==e.head:f.from()==f.head;c<=d&&--d;b.splice(--c,2,new I(e?h:g,e?g:h))}}return new va(b,d)}function Oa(a,b){return new va([new I(a,b||a)],0)}function Ta(a){return a.text?t(a.from.line+a.text.length-1,J(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function xf(a,b){if(0>B(a,b.from))return a;if(0>=B(a,b.to))return Ta(b);var d=a.line+b.text.length-(b.to.line-b.from.line)-
1,c=a.ch;a.line==b.to.line&&(c+=Ta(b).ch-b.to.ch);return t(d,c)}function Zd(a,b){for(var d=[],c=0;c<a.sel.ranges.length;c++){var e=a.sel.ranges[c];d.push(new I(xf(e.anchor,b),xf(e.head,b)))}return Da(a.cm,d,a.sel.primIndex)}function yf(a,b,d){return a.line==b.line?t(d.line,a.ch-b.ch+d.ch):t(d.line+(a.line-b.line),a.ch)}function $d(a){a.doc.mode=nd(a.options,a.doc.modeOption);bc(a)}function bc(a){a.doc.iter(function(b){b.stateAfter&&(b.stateAfter=null);b.styles&&(b.styles=null)});a.doc.modeFrontier=
a.doc.highlightFrontier=a.doc.first;Yb(a,100);a.state.modeGen++;a.curOp&&ma(a)}function zf(a,b){return 0==b.from.ch&&0==b.to.ch&&""==J(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function ae(a,b,d,c){function e(r,u,A){r.text=u;r.stateAfter&&(r.stateAfter=null);r.styles&&(r.styles=null);null!=r.order&&(r.order=null);He(r);Ie(r,A);u=c?c(r):1;u!=r.height&&Ea(r,u);aa(r,"change",r,b)}function f(r,u){for(var A=[];r<u;++r)A.push(new zb(k[r],d?d[r]:null,c));return A}var g=b.from,h=b.to,k=b.text,
l=w(a,g.line),m=w(a,h.line),n=J(k),p=d?d[k.length-1]:null,q=h.line-g.line;b.full?(a.insert(0,f(0,k.length)),a.remove(k.length,a.size-k.length)):zf(a,b)?(h=f(0,k.length-1),e(m,m.text,p),q&&a.remove(g.line,q),h.length&&a.insert(g.line,h)):l==m?1==k.length?e(l,l.text.slice(0,g.ch)+n+l.text.slice(h.ch),p):(q=f(1,k.length-1),q.push(new zb(n+l.text.slice(h.ch),p,c)),e(l,l.text.slice(0,g.ch)+k[0],d?d[0]:null),a.insert(g.line+1,q)):1==k.length?(e(l,l.text.slice(0,g.ch)+k[0]+m.text.slice(h.ch),d?d[0]:null),
a.remove(g.line+1,q)):(e(l,l.text.slice(0,g.ch)+k[0],d?d[0]:null),e(m,n+m.text.slice(h.ch),p),p=f(1,k.length-1),1<q&&a.remove(g.line+1,q-1),a.insert(g.line+1,p));aa(a,"change",a,b)}function Ua(a,b,d){function c(e,f,g){if(e.linked)for(var h=0;h<e.linked.length;++h){var k=e.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!d||l)b(k.doc,l),c(k.doc,e,l)}}}c(a,null,!0)}function Af(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;Nd(a);$d(a);Bf(a);a.options.direction=b.direction;
a.options.lineWrapping||zd(a);a.options.mode=b.modeOption;ma(a)}function Bf(a){("rtl"==a.doc.direction?Ya:jb)(a.display.lineDiv,"CodeMirror-rtl")}function $g(a){ra(a,function(){Bf(a);ma(a)})}function Rc(a){this.done=[];this.undone=[];this.undoDepth=a?a.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=this.maxGeneration=a?a.maxGeneration:1}function be(a,b){var d={from:sd(b.from),to:Ta(b),text:ab(a,b.from,b.to)};
Cf(a,d,b.from.line,b.to.line+1);Ua(a,function(c){return Cf(c,d,b.from.line,b.to.line+1)},!0);return d}function Df(a){for(;a.length;)if(J(a).ranges)a.pop();else break}function Ef(a,b,d,c){var e=a.history;e.undone.length=0;var f=+new Date,g;if(g=e.lastOp==c||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&e.lastModTime>f-(a.cm?a.cm.options.historyEventDelay:500)||"*"==b.origin.charAt(0))){if(e.lastOp==c){Df(e.done);var h=J(e.done)}else e.done.length&&!J(e.done).ranges?h=J(e.done):1<e.done.length&&
!e.done[e.done.length-2].ranges?(e.done.pop(),h=J(e.done)):h=void 0;g=h}if(g){var k=J(h.changes);0==B(b.from,b.to)&&0==B(b.from,k.to)?k.to=Ta(b):h.changes.push(be(a,b))}else for((h=J(e.done))&&h.ranges||Sc(a.sel,e.done),h={changes:[be(a,b)],generation:e.generation},e.done.push(h);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(d);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=c;e.lastOrigin=e.lastSelOrigin=b.origin;k||W(a,"historyAdded")}
function Sc(a,b){var d=J(b);d&&d.ranges&&d.equals(a)||b.push(a)}function Cf(a,b,d,c){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,d),Math.min(a.first+a.size,c),function(g){g.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=g.markedSpans);++f})}function Ff(a,b){var d;if(d=b["spans_"+a.id]){for(var c=[],e=0;e<b.text.length;++e){var f=c,g=f.push;var h=void 0;var k=d[e];if(k){for(var l=0;l<k.length;++l)k[l].marker.explicitlyCleared?h||(h=k.slice(0,l)):h&&h.push(k[l]);h=h?h.length?h:null:k}else h=null;
g.call(f,h)}d=c}else d=null;a=vd(a,b);if(!d)return a;if(!a)return d;for(b=0;b<d.length;++b)if(c=d[b],e=a[b],c&&e)a:for(f=0;f<e.length;++f){g=e[f];for(h=0;h<c.length;++h)if(c[h].marker==g.marker)continue a;c.push(g)}else e&&(d[b]=e);return d}function Ab(a,b,d){for(var c=[],e=0;e<a.length;++e){var f=a[e];if(f.ranges)c.push(d?va.prototype.deepCopy.call(f):f);else{f=f.changes;var g=[];c.push({changes:g});for(var h=0;h<f.length;++h){var k=f[h],l;g.push({from:k.from,to:k.to,text:k.text});if(b)for(var m in k)(l=
m.match(/^spans_(\d+)$/))&&-1<ea(b,Number(l[1]))&&(J(g)[m]=k[m],delete k[m])}}}return c}function ce(a,b,d,c){return c?(a=a.anchor,d&&(c=0>B(b,a),c!=0>B(d,a)?(a=b,b=d):c!=0>B(b,d)&&(b=d)),new I(a,b)):new I(d||b,b)}function Tc(a,b,d,c,e){null==e&&(e=a.cm&&(a.cm.display.shift||a.extend));da(a,new va([ce(a.sel.primary(),b,d,e)],0),c)}function Gf(a,b,d){for(var c=[],e=a.cm&&(a.cm.display.shift||a.extend),f=0;f<a.sel.ranges.length;f++)c[f]=ce(a.sel.ranges[f],b[f],null,e);b=Da(a.cm,c,a.sel.primIndex);da(a,
b,d)}function de(a,b,d,c){var e=a.sel.ranges.slice(0);e[b]=d;da(a,Da(a.cm,e,a.sel.primIndex),c)}function ah(a,b,d){d={ranges:b.ranges,update:function(c){this.ranges=[];for(var e=0;e<c.length;e++)this.ranges[e]=new I(C(a,c[e].anchor),C(a,c[e].head))},origin:d&&d.origin};W(a,"beforeSelectionChange",a,d);a.cm&&W(a.cm,"beforeSelectionChange",a.cm,d);return d.ranges!=b.ranges?Da(a.cm,d.ranges,d.ranges.length-1):b}function Hf(a,b,d){var c=a.history.done,e=J(c);e&&e.ranges?(c[c.length-1]=b,Uc(a,b,d)):da(a,
b,d)}function da(a,b,d){Uc(a,b,d);b=a.sel;var c=a.cm?a.cm.curOp.id:NaN,e=a.history,f=d&&d.origin,g;if(!(g=c==e.lastSelOp)&&(g=f&&e.lastSelOrigin==f)&&!(g=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){g=J(e.done);var h=f.charAt(0);g="*"==h||"+"==h&&g.ranges.length==b.ranges.length&&g.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}g?e.done[e.done.length-1]=b:Sc(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=f;e.lastSelOp=c;
d&&!1!==d.clearRedo&&Df(e.undone)}function Uc(a,b,d){if(xa(a,"beforeSelectionChange")||a.cm&&xa(a.cm,"beforeSelectionChange"))b=ah(a,b,d);var c=d&&d.bias||(0>B(b.primary().head,a.sel.primary().head)?-1:1);If(a,Jf(a,b,c,!0));d&&!1===d.scroll||!a.cm||"nocursor"==a.cm.getOption("readOnly")||xb(a.cm)}function If(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=1,a.cm.curOp.selectionChanged=!0,ue(a.cm)),aa(a,"cursorActivity",a))}function Kf(a){If(a,Jf(a,a.sel,null,!1))}function Jf(a,b,d,c){for(var e,
f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],k=Vc(a,g.anchor,h&&h.anchor,d,c);h=g.head==g.anchor?k:Vc(a,g.head,h&&h.head,d,c);if(e||k!=g.anchor||h!=g.head)e||(e=b.ranges.slice(0,f)),e[f]=new I(k,h)}return e?Da(a.cm,e,b.primIndex):b}function Bb(a,b,d,c,e){var f=w(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],k=h.marker,l="selectLeft"in k?!k.selectLeft:k.inclusiveLeft,m="selectRight"in k?!k.selectRight:
k.inclusiveRight;if((null==h.from||(l?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(m?h.to>=b.ch:h.to>b.ch))){if(e&&(W(k,"beforeCursorEnter"),k.explicitlyCleared))if(f.markedSpans){--g;continue}else break;if(k.atomic){if(d){g=k.find(0>c?1:-1);h=void 0;if(0>c?m:l)g=Lf(a,g,-c,g&&g.line==b.line?f:null);if(g&&g.line==b.line&&(h=B(g,d))&&(0>c?0>h:0<h))return Bb(a,g,b,c,e)}d=k.find(0>c?-1:1);if(0>c?l:m)d=Lf(a,d,c,d.line==b.line?f:null);return d?Bb(a,d,b,c,e):null}}}return b}function Vc(a,b,d,c,e){c=c||1;b=
Bb(a,b,d,c,e)||!e&&Bb(a,b,d,c,!0)||Bb(a,b,d,-c,e)||!e&&Bb(a,b,d,-c,!0);return b?b:(a.cantEdit=!0,t(a.first,0))}function Lf(a,b,d,c){return 0>d&&0==b.ch?b.line>a.first?C(a,t(b.line-1)):null:0<d&&b.ch==(c||w(a,b.line)).text.length?b.line<a.first+a.size-1?t(b.line+1,0):null:new t(b.line,b.ch+d)}function Mf(a){a.setSelection(t(a.firstLine(),0),t(a.lastLine()),Ia)}function Nf(a,b,d){var c={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){return c.canceled=!0}};d&&(c.update=
function(e,f,g,h){e&&(c.from=C(a,e));f&&(c.to=C(a,f));g&&(c.text=g);void 0!==h&&(c.origin=h)});W(a,"beforeChange",a,c);a.cm&&W(a.cm,"beforeChange",a.cm,c);return c.canceled?(a.cm&&(a.cm.curOp.updateInput=2),null):{from:c.from,to:c.to,text:c.text,origin:c.origin}}function Cb(a,b,d){if(a.cm){if(!a.cm.curOp)return ba(a.cm,Cb)(a,b,d);if(a.cm.state.suppressEdits)return}if(xa(a,"beforeChange")||a.cm&&xa(a.cm,"beforeChange"))if(b=Nf(a,b,!0),!b)return;if(d=Of&&!d&&Hg(a,b.from,b.to))for(var c=d.length-1;0<=
c;--c)Pf(a,{from:d[c].from,to:d[c].to,text:c?[""]:b.text,origin:b.origin});else Pf(a,b)}function Pf(a,b){if(1!=b.text.length||""!=b.text[0]||0!=B(b.from,b.to)){var d=Zd(a,b);Ef(a,b,d,a.cm?a.cm.curOp.id:NaN);cc(a,b,d,vd(a,b));var c=[];Ua(a,function(e,f){f||-1!=ea(c,e.history)||(Qf(e.history,b),c.push(e.history));cc(e,b,null,vd(e,b))})}}function Wc(a,b,d){var c=a.cm&&a.cm.state.suppressEdits;if(!c||d){for(var e=a.history,f,g=a.sel,h="undo"==b?e.done:e.undone,k="undo"==b?e.undone:e.done,l=0;l<h.length&&
(f=h[l],d?!f.ranges||f.equals(a.sel):f.ranges);l++);if(l!=h.length){for(e.lastOrigin=e.lastSelOrigin=null;;)if(f=h.pop(),f.ranges){Sc(f,k);if(d&&!f.equals(a.sel)){da(a,f,{clearRedo:!1});return}g=f}else{if(c){h.push(f);return}break}var m=[];Sc(g,k);k.push({changes:m,generation:e.generation});e.generation=f.generation||++e.maxGeneration;var n=xa(a,"beforeChange")||a.cm&&xa(a.cm,"beforeChange");d=function(p){var q=f.changes[p];q.origin=b;if(n&&!Nf(a,q,!1))return h.length=0,{};m.push(be(a,q));var r=p?
Zd(a,q):J(h);cc(a,q,r,Ff(a,q));!p&&a.cm&&a.cm.scrollIntoView({from:q.from,to:Ta(q)});var u=[];Ua(a,function(A,Y){Y||-1!=ea(u,A.history)||(Qf(A.history,q),u.push(A.history));cc(A,q,null,Ff(A,q))})};for(c=f.changes.length-1;0<=c;--c)if(e=d(c))return e.v}}}function Rf(a,b){if(0!=b&&(a.first+=b,a.sel=new va(wc(a.sel.ranges,function(e){return new I(t(e.anchor.line+b,e.anchor.ch),t(e.head.line+b,e.head.ch))}),a.sel.primIndex),a.cm)){ma(a.cm,a.first,a.first-b,b);for(var d=a.cm.display,c=d.viewFrom;c<d.viewTo;c++)Sa(a.cm,
c,"gutter")}}function cc(a,b,d,c){if(a.cm&&!a.cm.curOp)return ba(a.cm,cc)(a,b,d,c);if(b.to.line<a.first)Rf(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Rf(a,e);b={from:t(a.first,0),to:t(b.to.line+e,b.to.ch),text:[J(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:t(e,w(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=ab(a,b.from,b.to);d||(d=Zd(a,b));a.cm?bh(a.cm,
b,c):ae(a,b,c);Uc(a,d,Ia);a.cantEdit&&Vc(a,t(a.firstLine(),0))&&(a.cantEdit=!1)}}function bh(a,b,d){var c=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=N(za(w(c,f.line))),c.iter(k,g.line+1,function(l){if(l==e.maxLine)return h=!0}));-1<c.sel.contains(b.from,b.to)&&ue(a);ae(c,b,d,ff(a));a.options.lineWrapping||(c.iter(k,f.line+b.text.length,function(l){var m=Ec(l);m>e.maxLineLength&&(e.maxLine=l,e.maxLineLength=m,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));
Gg(c,f.line);Yb(a,400);d=b.text.length-(g.line-f.line)-1;b.full?ma(a):f.line!=g.line||1!=b.text.length||zf(a.doc,b)?ma(a,f.line,g.line+1,d):Sa(a,f.line,"text");d=xa(a,"changes");if((c=xa(a,"change"))||d)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},c&&aa(a,"change",a,b),d&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function Db(a,b,d,c,e){c||(c=d);0>B(c,d)&&(c=[c,d],d=c[0],c=c[1]);"string"==typeof b&&(b=a.splitLines(b));Cb(a,{from:d,to:c,
text:b,origin:e})}function Sf(a,b,d,c){d<a.line?a.line+=c:b<a.line&&(a.line=b,a.ch=0)}function Tf(a,b,d,c){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges)for(f.copied||(f=a[e]=f.deepCopy(),f.copied=!0),g=0;g<f.ranges.length;g++)Sf(f.ranges[g].anchor,b,d,c),Sf(f.ranges[g].head,b,d,c);else{for(var h=0;h<f.changes.length;++h){var k=f.changes[h];if(d<k.from.line)k.from=t(k.from.line+c,k.from.ch),k.to=t(k.to.line+c,k.to.ch);else if(b<=k.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function Qf(a,
b){var d=b.from.line,c=b.to.line;b=b.text.length-(c-d)-1;Tf(a.done,d,c,b);Tf(a.undone,d,c,b)}function dc(a,b,d,c){var e=b,f=b;"number"==typeof b?f=w(a,Math.max(a.first,Math.min(b,a.first+a.size-1))):e=N(b);if(null==e)return null;c(f,e)&&a.cm&&Sa(a.cm,e,d);return f}function ec(a){this.lines=a;this.parent=null;for(var b=0,d=0;d<a.length;++d)a[d].parent=this,b+=a[d].height;this.height=b}function fc(a){this.children=a;for(var b=0,d=0,c=0;c<a.length;++c){var e=a[c];b+=e.chunkSize();d+=e.height;e.parent=
this}this.size=b;this.height=d;this.parent=null}function ch(a,b,d,c){var e=new gc(a,d,c),f=a.cm;f&&e.noHScroll&&(f.display.alignWidgets=!0);dc(a,b,"widget",function(g){var h=g.widgets||(g.widgets=[]);null==e.insertAt?h.push(e):h.splice(Math.min(h.length,Math.max(0,e.insertAt)),0,e);e.line=g;f&&!Pa(a,g)&&(h=Ga(g)<a.scrollTop,Ea(g,g.height+Tb(e)),h&&Nc(f,e.height),f.curOp.forceUpdate=!0);return!0});f&&aa(f,"lineWidgetAdded",f,e,"number"==typeof b?b:N(b));return e}function Eb(a,b,d,c,e){if(c&&c.shared)return dh(a,
b,d,c,e);if(a.cm&&!a.cm.curOp)return ba(a.cm,Eb)(a,b,d,c,e);var f=new Va(a,e);e=B(b,d);c&&Za(c,f,!1);if(0<e||0==e&&!1!==f.clearWhenEmpty)return f;f.replacedWith&&(f.collapsed=!0,f.widgetNode=M("span",[f.replacedWith],"CodeMirror-widget"),c.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),c.insertLeft&&(f.widgetNode.insertLeft=!0));if(f.collapsed){if(Je(a,b.line,b,d,f)||b.line!=d.line&&Je(a,d.line,b,d,f))throw Error("Inserting collapsed marker partially overlapping an existing one");
Ka=!0}f.addToHistory&&Ef(a,{from:b,to:d,origin:"markText"},a.sel,NaN);var g=b.line,h=a.cm,k;a.iter(g,d.line+1,function(l){h&&f.collapsed&&!h.options.lineWrapping&&za(l)==h.display.maxLine&&(k=!0);f.collapsed&&g!=b.line&&Ea(l,0);var m=new Dc(f,g==b.line?b.ch:null,g==d.line?d.ch:null),n=a.cm&&a.cm.curOp;(n=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet)))&&l.markedSpans&&n.has(l.markedSpans)?l.markedSpans.push(m):(l.markedSpans=l.markedSpans?l.markedSpans.concat([m]):[m],n&&n.add(l.markedSpans));
m.marker.attachLine(l);++g});f.collapsed&&a.iter(b.line,d.line+1,function(l){Pa(a,l)&&Ea(l,0)});f.clearOnEnter&&z(f,"beforeCursorEnter",function(){return f.clear()});f.readOnly&&(Of=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());f.collapsed&&(f.id=++Uf,f.atomic=!0);if(h){k&&(h.curOp.updateMaxLine=!0);if(f.collapsed)ma(h,b.line,d.line+1);else if(f.className||f.startStyle||f.endStyle||f.css||f.attributes||f.title)for(c=b.line;c<=d.line;c++)Sa(h,c,"text");f.atomic&&Kf(h.doc);
aa(h,"markerAdded",h,f)}return f}function dh(a,b,d,c,e){c=Za(c);c.shared=!1;var f=[Eb(a,b,d,c,e)],g=f[0],h=c.widgetNode;Ua(a,function(k){h&&(c.widgetNode=h.cloneNode(!0));f.push(Eb(k,C(k,b),C(k,d),c,e));for(var l=0;l<k.linked.length;++l)if(k.linked[l].isParent)return;g=J(f)});return new hc(f,g)}function Vf(a){return a.findMarks(t(a.first,0),a.clipPos(t(a.lastLine())),function(b){return b.parent})}function eh(a){for(var b=function(c){c=a[c];var e=[c.primary.doc];Ua(c.primary.doc,function(h){return e.push(h)});
for(var f=0;f<c.markers.length;f++){var g=c.markers[f];-1==ea(e,g.doc)&&(g.parent=null,c.markers.splice(f--,1))}},d=0;d<a.length;d++)b(d)}function fh(a){var b=this;Wf(b);if(!Z(b,a)&&!La(b.display,a)){la(a);G&&(Xf=+new Date);var d=gb(b,a,!0),c=a.dataTransfer.files;if(d&&!b.isReadOnly())if(c&&c.length&&window.FileReader&&window.File)for(var e=c.length,f=Array(e),g=0,h=function(){++g==e&&ba(b,function(){d=C(b.doc,d);var m={from:d,to:d,text:b.doc.splitLines(f.filter(function(n){return null!=n}).join(b.doc.lineSeparator())),
origin:"paste"};Cb(b.doc,m);Hf(b.doc,Oa(C(b.doc,d),C(b.doc,Ta(m))))})()},k=function(m,n){if(b.options.allowDropFileTypes&&-1==ea(b.options.allowDropFileTypes,m.type))h();else{var p=new FileReader;p.onerror=function(){return h()};p.onload=function(){var q=p.result;/[\x00-\x08\x0e-\x1f]{2}/.test(q)||(f[n]=q);h()};p.readAsText(m)}},l=0;l<c.length;l++)k(c[l],l);else if(b.state.draggingText&&-1<b.doc.sel.contains(d))b.state.draggingText(a),setTimeout(function(){return b.display.input.focus()},20);else try{if(k=
a.dataTransfer.getData("Text")){b.state.draggingText&&!b.state.draggingText.copy&&(l=b.listSelections());Uc(b.doc,Oa(d,d));if(l)for(c=0;c<l.length;++c)Db(b.doc,"",l[c].anchor,l[c].head,"drag");b.replaceSelection(k,"around","paste");b.display.input.focus()}}catch(m){}}}function Wf(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function Yf(a){if(document.getElementsByClassName){for(var b=document.getElementsByClassName("CodeMirror"),d=[],c=
0;c<b.length;c++){var e=b[c].CodeMirror;e&&d.push(e)}d.length&&d[0].operation(function(){for(var f=0;f<d.length;f++)a(d[f])})}}function gh(){var a;z(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null;Yf(hh)},100))});z(window,"blur",function(){return Yf(wb)})}function hh(a){var b=a.display;b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null;b.scrollbarsClipped=!1;a.setSize()}function ih(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var d,c,e,f,g=0;g<b.length-1;g++){var h=b[g];
if(/^(cmd|meta|m)$/i.test(h))f=!0;else if(/^a(lt)?$/i.test(h))d=!0;else if(/^(c|ctrl|control)$/i.test(h))c=!0;else if(/^s(hift)?$/i.test(h))e=!0;else throw Error("Unrecognized modifier name: "+h);}d&&(a="Alt-"+a);c&&(a="Ctrl-"+a);f&&(a="Cmd-"+a);e&&(a="Shift-"+a);return a}function jh(a){var b={},d;for(d in a)if(a.hasOwnProperty(d)){var c=a[d];if(!/^(name|fallthrough|(de|at)tach)$/.test(d)){if("..."!=c)for(var e=wc(d.split(" "),ih),f=0;f<e.length;f++){if(f==e.length-1){var g=e.join(" ");var h=c}else g=
e.slice(0,f+1).join(" "),h="...";var k=b[g];if(!k)b[g]=h;else if(k!=h)throw Error("Inconsistent bindings for "+g);}delete a[d]}}for(var l in b)a[l]=b[l];return a}function Fb(a,b,d,c){b=Xc(b);var e=b.call?b.call(a,c):b[a];if(!1===e)return"nothing";if("..."===e)return"multi";if(null!=e&&d(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return Fb(a,b.fallthrough,d,c);for(e=0;e<b.fallthrough.length;e++){var f=Fb(a,b.fallthrough[e],d,c);if(f)return f}}}
function Zf(a){a="string"==typeof a?a:Wa[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function $f(a,b,d){var c=a;b.altKey&&"Alt"!=c&&(a="Alt-"+a);(ag?b.metaKey:b.ctrlKey)&&"Ctrl"!=c&&(a="Ctrl-"+a);(ag?b.ctrlKey:b.metaKey)&&"Mod"!=c&&(a="Cmd-"+a);!d&&b.shiftKey&&"Shift"!=c&&(a="Shift-"+a);return a}function bg(a,b){if(Ca&&34==a.keyCode&&a["char"])return!1;var d=Wa[a.keyCode];if(null==d||a.altGraphKey)return!1;3==a.keyCode&&a.code&&(d=a.code);return $f(d,a,b)}function Xc(a){return"string"==
typeof a?ic[a]:a}function Gb(a,b){for(var d=a.doc.sel.ranges,c=[],e=0;e<d.length;e++){for(var f=b(d[e]);c.length&&0>=B(f.from,J(c).to);){var g=c.pop();if(0>B(g.from,f.from)){f.from=g.from;break}}c.push(f)}ra(a,function(){for(var h=c.length-1;0<=h;h--)Db(a.doc,"",c[h].from,c[h].to,"+delete");xb(a)})}function ee(a,b,d){b=te(a.text,b+d,d);return 0>b||b>a.text.length?null:b}function fe(a,b,d){a=ee(a,b.ch,d);return null==a?null:new t(b.line,a,0>d?"after":"before")}function ge(a,b,d,c,e){if(a&&("rtl"==
b.doc.direction&&(e=-e),a=Ja(d,b.doc.direction))){a=0>e?J(a):a[0];var f=0>e==(1==a.level)?"after":"before";if(0<a.level||"rtl"==b.doc.direction){var g=eb(b,d);var h=0>e?d.text.length-1:0;var k=Aa(b,g,h).top;h=Jb(function(l){return Aa(b,g,l).top==k},0>e==(1==a.level)?a.from:a.to-1,h);"before"==f&&(h=ee(d,h,1))}else h=0>e?a.to:a.from;return new t(c,h,f)}return new t(c,0>e?d.text.length:0,0>e?"before":"after")}function kh(a,b,d,c){var e=Ja(b,a.doc.direction);if(!e)return fe(b,d,c);d.ch>=b.text.length?
(d.ch=b.text.length,d.sticky="before"):0>=d.ch&&(d.ch=0,d.sticky="after");var f=Kb(e,d.ch,d.sticky),g=e[f];if("ltr"==a.doc.direction&&0==g.level%2&&(0<c?g.to>d.ch:g.from<d.ch))return fe(b,d,c);var h=function(q,r){return ee(b,q instanceof t?q.ch:q,r)},k,l=function(q){if(!a.options.lineWrapping)return{begin:0,end:b.text.length};k=k||eb(a,b);return ef(a,b,k,q)},m=l("before"==d.sticky?h(d,-1):d.ch);if("rtl"==a.doc.direction||1==g.level){var n=1==g.level==0>c,p=h(d,n?1:-1);if(null!=p&&(n?p<=g.to&&p<=m.end:
p>=g.from&&p>=m.begin))return new t(d.line,p,n?"before":"after")}g=function(q,r,u){for(var A=function(K,Q){return Q?new t(d.line,h(K,1),"before"):new t(d.line,K,"after")};0<=q&&q<e.length;q+=r){var Y=e[q],x=0<r==(1!=Y.level),P=x?u.begin:h(u.end,-1);if(Y.from<=P&&P<Y.to)return A(P,x);P=x?Y.from:h(Y.to,-1);if(u.begin<=P&&P<u.end)return A(P,x)}};if(f=g(f+c,c,m))return f;m=0<c?m.end:h(m.begin,-1);return null==m||0<c&&m==b.text.length||!(f=g(0<c?0:e.length-1,c,l(m)))?null:f}function cg(a,b){var d=w(a.doc,
b),c=za(d);c!=d&&(b=N(c));return ge(!0,a,c,b,1)}function dg(a,b){var d=cg(a,b.line),c=w(a.doc,d.line);a=Ja(c,a.doc.direction);return a&&0!=a[0].level?d:(c=Math.max(d.ch,c.text.search(/\S/)),t(d.line,b.line==d.line&&b.ch<=c&&b.ch?0:c,d.sticky))}function Yc(a,b,d){if("string"==typeof b&&(b=jc[b],!b))return!1;a.display.input.ensurePolled();var c=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),d&&(a.display.shift=!1),e=b(a)!=Zc}finally{a.display.shift=c,a.state.suppressEdits=!1}return e}
function kc(a,b,d,c){var e=a.state.keySeq;if(e){if(Zf(b))return"handled";/'$/.test(b)?a.state.keySeq=null:lh.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())});if(eg(a,e+" "+b,d,c))return!0}return eg(a,b,d,c)}function eg(a,b,d,c){a:{for(var e=0;e<a.state.keyMaps.length;e++){var f=Fb(b,a.state.keyMaps[e],c,a);if(f){c=f;break a}}c=a.options.extraKeys&&Fb(b,a.options.extraKeys,c,a)||Fb(b,a.options.keyMap,c,a)}"multi"==c&&(a.state.keySeq=b);"handled"==c&&aa(a,"keyHandled",
a,b,d);if("handled"==c||"multi"==c)la(d),Qd(a);return!!c}function fg(a,b){var d=bg(b,!0);return d?b.shiftKey&&!a.state.keySeq?kc(a,"Shift-"+d,b,function(c){return Yc(a,c,!0)})||kc(a,d,b,function(c){if("string"==typeof c?/^go[A-Z]/.test(c):c.motion)return Yc(a,c)}):kc(a,d,b,function(c){return Yc(a,c)}):!1}function mh(a,b,d){return kc(a,"'"+d+"'",b,function(c){return Yc(a,c,!0)})}function gg(a){if(!a.target||a.target==this.display.input.getField())if(this.curOp.focus=ka(qa(this)),!Z(this,a)){G&&11>
T&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var d=fg(this,a);Ca&&(he=d?b:null,!d&&88==b&&!nh&&(ya?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));Ma&&!ya&&!d&&46==b&&a.shiftKey&&!a.ctrlKey&&document.execCommand&&document.execCommand("cut");18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||oh(this)}}function oh(a){function b(c){18!=c.keyCode&&c.altKey||(jb(d,"CodeMirror-crosshair"),ta(document,"keyup",b),ta(document,"mouseover",
b))}var d=a.display.lineDiv;Ya(d,"CodeMirror-crosshair");z(document,"keyup",b);z(document,"mouseover",b)}function hg(a){16==a.keyCode&&(this.doc.sel.shift=!1);Z(this,a)}function ig(a){if(!(a.target&&a.target!=this.display.input.getField()||La(this.display,a)||Z(this,a)||a.ctrlKey&&!a.altKey||ya&&a.metaKey)){var b=a.keyCode,d=a.charCode;if(Ca&&b==he)he=null,la(a);else if(!Ca||a.which&&!(10>a.which)||!fg(this,a))if(b=String.fromCharCode(null==d?b:d),"\b"!=b&&!mh(this,a,b))this.display.input.onKeyPress(a)}}
function ph(a,b){var d=+new Date;if(lc&&lc.compare(d,a,b))return mc=lc=null,"triple";if(mc&&mc.compare(d,a,b))return lc=new ie(d,a,b),mc=null,"double";mc=new ie(d,a,b);lc=null;return"single"}function jg(a){var b=this.display;if(!(Z(this,a)||b.activeTouch&&b.input.supportsTouch()))if(b.input.ensurePolled(),b.shift=a.shiftKey,La(b,a))fa||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));else if(!$c(this,a,"gutterClick",!0)){var d=gb(this,a),c=we(a),e=d?ph(d,c):"single";
qa(this).defaultView.focus();1==c&&this.state.selectingText&&this.state.selectingText(a);if(!d||!qh(this,c,d,e,a))if(1==c)d?rh(this,d,e,a):(a.target||a.srcElement)==b.scroller&&la(a);else if(2==c)d&&Tc(this.doc,d),setTimeout(function(){return b.input.focus()},20);else if(3==c)if(je)this.display.input.onContextMenu(a);else Sd(this)}}function qh(a,b,d,c,e){var f="Click";"double"==c?f="Double"+f:"triple"==c&&(f="Triple"+f);return kc(a,$f((1==b?"Left":2==b?"Middle":"Right")+f,e),e,function(g){"string"==
typeof g&&(g=jc[g]);if(!g)return!1;var h=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),h=g(a,d)!=Zc}finally{a.state.suppressEdits=!1}return h})}function rh(a,b,d,c){G?setTimeout(gd(jf,a),0):a.curOp.focus=ka(qa(a));var e=a.getOption("configureMouse");e=e?e(a,d,c):{};null==e.unit&&(e.unit=(sh?c.shiftKey&&c.metaKey:c.altKey)?"rectangle":"single"==d?"char":"double"==d?"word":"line");if(null==e.extend||a.doc.extend)e.extend=a.doc.extend||c.shiftKey;null==e.addNew&&(e.addNew=ya?c.metaKey:c.ctrlKey);
null==e.moveOnDrag&&(e.moveOnDrag=!(ya?c.altKey:c.ctrlKey));var f=a.doc.sel,g;a.options.dragDrop&&th&&!a.isReadOnly()&&"single"==d&&-1<(g=f.contains(b))&&(0>B((g=f.ranges[g]).from(),b)||0<b.xRel)&&(0<B(g.to(),b)||0>b.xRel)?uh(a,c,b,e):vh(a,c,b,e)}function uh(a,b,d,c){var e=a.display,f=!1,g=ba(a,function(l){fa&&(e.scroller.draggable=!1);a.state.draggingText=!1;a.state.delayingBlurEvent&&(a.hasFocus()?a.state.delayingBlurEvent=!1:Sd(a));ta(e.wrapper.ownerDocument,"mouseup",g);ta(e.wrapper.ownerDocument,
"mousemove",h);ta(e.scroller,"dragstart",k);ta(e.scroller,"drop",g);f||(la(l),c.addNew||Tc(a.doc,d,null,null,c.extend),fa&&!ad||G&&9==T?setTimeout(function(){e.wrapper.ownerDocument.body.focus({preventScroll:!0});e.input.focus()},20):e.input.focus())}),h=function(l){f=f||10<=Math.abs(b.clientX-l.clientX)+Math.abs(b.clientY-l.clientY)},k=function(){return f=!0};fa&&(e.scroller.draggable=!0);a.state.draggingText=g;g.copy=!c.moveOnDrag;z(e.wrapper.ownerDocument,"mouseup",g);z(e.wrapper.ownerDocument,
"mousemove",h);z(e.scroller,"dragstart",k);z(e.scroller,"drop",g);a.state.delayingBlurEvent=!0;setTimeout(function(){return e.input.focus()},20);e.scroller.dragDrop&&e.scroller.dragDrop()}function kg(a,b,d){if("char"==d)return new I(b,b);if("word"==d)return a.findWordAt(b);if("line"==d)return new I(t(b.line,0),C(a.doc,t(b.line+1,0)));a=d(a,b);return new I(a.from,a.to)}function vh(a,b,d,c){function e(x){if(0!=B(q,x))if(q=x,"rectangle"==c.unit){var P=[],K=a.options.tabSize,Q=wa(w(k,d.line).text,d.ch,
K),S=wa(w(k,x.line).text,x.ch,K),F=Math.min(Q,S);Q=Math.max(Q,S);S=Math.min(d.line,x.line);for(var R=Math.min(a.lastLine(),Math.max(d.line,x.line));S<=R;S++){var H=w(k,S).text,L=hd(H,F,K);F==Q?P.push(new I(t(S,L),t(S,L))):H.length>L&&P.push(new I(t(S,L),t(S,hd(H,Q,K))))}P.length||P.push(new I(d,d));da(k,Da(a,l.ranges.slice(0,n).concat(P),n),{origin:"*mouse",scroll:!1});a.scrollIntoView(x)}else P=p,F=kg(a,x,c.unit),x=P.anchor,0<B(F.anchor,x)?(K=F.head,x=Bc(P.from(),F.anchor)):(K=F.anchor,x=Ac(P.to(),
F.head)),P=l.ranges.slice(0),P[n]=wh(a,new I(C(k,x),K)),da(k,Da(a,P,n),ke)}function f(x){var P=++u,K=gb(a,x,!0,"rectangle"==c.unit);if(K)if(0!=B(K,q)){a.curOp.focus=ka(qa(a));e(K);var Q=Mc(h,k);(K.line>=Q.to||K.line<Q.from)&&setTimeout(ba(a,function(){u==P&&f(x)}),150)}else{var S=x.clientY<r.top?-20:x.clientY>r.bottom?20:0;S&&setTimeout(ba(a,function(){u==P&&(h.scroller.scrollTop+=S,f(x))}),50)}}function g(x){a.state.selectingText=!1;u=Infinity;x&&(la(x),h.input.focus());ta(h.wrapper.ownerDocument,
"mousemove",A);ta(h.wrapper.ownerDocument,"mouseup",Y);k.history.lastSelOrigin=null}G&&Sd(a);var h=a.display,k=a.doc;la(b);var l=k.sel,m=l.ranges;if(c.addNew&&!c.extend){var n=k.sel.contains(d);var p=-1<n?m[n]:new I(d,d)}else p=k.sel.primary(),n=k.sel.primIndex;"rectangle"==c.unit?(c.addNew||(p=new I(d,d)),d=gb(a,b,!0,!0),n=-1):(b=kg(a,d,c.unit),p=c.extend?ce(p,b.anchor,b.head,c.extend):b);c.addNew?-1==n?(n=m.length,da(k,Da(a,m.concat([p]),n),{scroll:!1,origin:"*mouse"})):1<m.length&&m[n].empty()&&
"char"==c.unit&&!c.extend?(da(k,Da(a,m.slice(0,n).concat(m.slice(n+1)),0),{scroll:!1,origin:"*mouse"}),l=k.sel):de(k,n,p,ke):(n=0,da(k,new va([p],0),ke),l=k.sel);var q=d,r=h.wrapper.getBoundingClientRect(),u=0,A=ba(a,function(x){0!==x.buttons&&we(x)?f(x):g(x)}),Y=ba(a,g);a.state.selectingText=Y;z(h.wrapper.ownerDocument,"mousemove",A);z(h.wrapper.ownerDocument,"mouseup",Y)}function wh(a,b){var d=b.anchor,c=b.head,e=w(a.doc,d.line);if(0==B(d,c)&&d.sticky==c.sticky)return b;e=Ja(e);if(!e)return b;var f=
Kb(e,d.ch,d.sticky),g=e[f];if(g.from!=d.ch&&g.to!=d.ch)return b;var h=f+(g.from==d.ch==(1!=g.level)?0:1);if(0==h||h==e.length)return b;c.line!=d.line?a=0<(c.line-d.line)*("ltr"==a.doc.direction?1:-1):(a=Kb(e,c.ch,c.sticky),f=a-f||(c.ch-d.ch)*(1==g.level?-1:1),a=a==h-1||a==h?0>f:0<f);e=e[h+(a?-1:0)];e=(h=a==(1==e.level))?e.from:e.to;h=h?"after":"before";return d.ch==e&&d.sticky==h?b:new I(new t(d.line,e,h),c)}function $c(a,b,d,c){if(b.touches){var e=b.touches[0].clientX;var f=b.touches[0].clientY}else try{e=
b.clientX,f=b.clientY}catch(k){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;c&&la(b);c=a.display;var g=c.lineDiv.getBoundingClientRect();if(f>g.bottom||!xa(a,d))return ld(b);f-=g.top-c.viewOffset;for(g=0;g<a.display.gutterSpecs.length;++g){var h=c.gutters.childNodes[g];if(h&&h.getBoundingClientRect().right>=e)return e=bb(a.doc,f),W(a,d,a,e,a.display.gutterSpecs[g].className,b),ld(b)}}function lg(a,b){var d;(d=La(a.display,b))||(d=xa(a,"gutterContextMenu")?$c(a,
b,"gutterContextMenu",!1):!1);if(!d&&!Z(a,b,"contextmenu")&&!je)a.display.input.onContextMenu(b)}function mg(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");Ub(a)}function xh(a,b,d){!b!=!(d&&d!=Hb)&&(d=a.display.dragFunctions,b=b?z:ta,b(a.display.scroller,"dragstart",d.start),b(a.display.scroller,"dragenter",d.enter),b(a.display.scroller,"dragover",d.over),b(a.display.scroller,"dragleave",d.leave),b(a.display.scroller,
"drop",d.drop))}function yh(a){a.options.lineWrapping?(Ya(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(jb(a.display.wrapper,"CodeMirror-wrap"),zd(a));Nd(a);ma(a);Ub(a);setTimeout(function(){return yb(a)},100)}function U(a,b){var d=this;if(!(this instanceof U))return new U(a,b);this.options=b=b?Za(b):{};Za(ng,b,!1);var c=b.value;"string"==typeof c?c=new oa(c,b.mode,null,b.lineSeparator,b.direction):b.mode&&(c.modeOption=b.mode);this.doc=c;var e=
new U.inputStyles[b.inputStyle](this);a=this.display=new Yg(a,c,e,b);a.wrapper.CodeMirror=this;mg(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");pf(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 Xa,keySeq:null,specialChars:null};b.autofocus&&!ac&&a.input.focus();G&&11>T&&setTimeout(function(){return d.display.input.reset(!0)},
20);zh(this);og||(gh(),og=!0);lb(this);this.curOp.forceUpdate=!0;Af(this,c);b.autofocus&&!ac||this.hasFocus()?setTimeout(function(){d.hasFocus()&&!d.state.focused&&Rd(d)},20):wb(this);for(var f in bd)if(bd.hasOwnProperty(f))bd[f](this,b[f],Hb);sf(this);b.finishInit&&b.finishInit(this);for(c=0;c<le.length;++c)le[c](this);mb(this);fa&&b.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function zh(a){function b(){c.activeTouch&&(e=
setTimeout(function(){return c.activeTouch=null},1E3),f=c.activeTouch,f.end=+new Date)}function d(h,k){if(null==k.left)return!0;var l=k.left-h.left;h=k.top-h.top;return 400<l*l+h*h}var c=a.display;z(c.scroller,"mousedown",ba(a,jg));G&&11>T?z(c.scroller,"dblclick",ba(a,function(h){if(!Z(a,h)){var k=gb(a,h);!k||$c(a,h,"gutterClick",!0)||La(a.display,h)||(la(h),h=a.findWordAt(k),Tc(a.doc,h.anchor,h.head))}})):z(c.scroller,"dblclick",function(h){return Z(a,h)||la(h)});z(c.scroller,"contextmenu",function(h){return lg(a,
h)});z(c.input.getField(),"contextmenu",function(h){c.scroller.contains(h.target)||lg(a,h)});var e,f={end:0};z(c.scroller,"touchstart",function(h){var k;if(k=!Z(a,h))1!=h.touches.length?k=!1:(k=h.touches[0],k=1>=k.radiusX&&1>=k.radiusY),k=!k;k&&!$c(a,h,"gutterClick",!0)&&(c.input.ensurePolled(),clearTimeout(e),k=+new Date,c.activeTouch={start:k,moved:!1,prev:300>=k-f.end?f:null},1==h.touches.length&&(c.activeTouch.left=h.touches[0].pageX,c.activeTouch.top=h.touches[0].pageY))});z(c.scroller,"touchmove",
function(){c.activeTouch&&(c.activeTouch.moved=!0)});z(c.scroller,"touchend",function(h){var k=c.activeTouch;if(k&&!La(c,h)&&null!=k.left&&!k.moved&&300>new Date-k.start){var l=a.coordsChar(c.activeTouch,"page");k=!k.prev||d(k,k.prev)?new I(l,l):!k.prev.prev||d(k,k.prev.prev)?a.findWordAt(l):new I(t(l.line,0),C(a.doc,t(l.line+1,0)));a.setSelection(k.anchor,k.head);a.focus();la(h)}b()});z(c.scroller,"touchcancel",b);z(c.scroller,"scroll",function(){c.scroller.clientHeight&&(Xb(a,c.scroller.scrollTop),
kb(a,c.scroller.scrollLeft,!0),W(a,"scroll",a))});z(c.scroller,"mousewheel",function(h){return wf(a,h)});z(c.scroller,"DOMMouseScroll",function(h){return wf(a,h)});z(c.wrapper,"scroll",function(){return c.wrapper.scrollTop=c.wrapper.scrollLeft=0});c.dragFunctions={enter:function(h){Z(a,h)||Mb(h)},over:function(h){if(!Z(a,h)){var k=gb(a,h);if(k){var l=document.createDocumentFragment();Od(a,k,l);a.display.dragCursor||(a.display.dragCursor=v("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,
a.display.cursorDiv));D(a.display.dragCursor,l)}Mb(h)}},start:function(h){if(G&&(!a.state.draggingText||100>+new Date-Xf))Mb(h);else if(!Z(a,h)&&!La(a.display,h)&&(h.dataTransfer.setData("Text",a.getSelection()),h.dataTransfer.effectAllowed="copyMove",h.dataTransfer.setDragImage&&!ad)){var k=v("img",null,null,"position: fixed; left: 0; top: 0;");k.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";Ca&&(k.width=k.height=1,a.display.wrapper.appendChild(k),k._top=k.offsetTop);
h.dataTransfer.setDragImage(k,0,0);Ca&&k.parentNode.removeChild(k)}},drop:ba(a,fh),leave:function(h){Z(a,h)||Wf(a)}};var g=c.input.getField();z(g,"keyup",function(h){return hg.call(a,h)});z(g,"keydown",ba(a,gg));z(g,"keypress",ba(a,ig));z(g,"focus",function(h){return Rd(a,h)});z(g,"blur",function(h){return wb(a,h)})}function nc(a,b,d,c){var e=a.doc,f;null==d&&(d="add");"smart"==d&&(e.mode.indent?f=Ob(a,b).state:d="prev");var g=a.options.tabSize,h=w(e,b),k=wa(h.text,null,g);h.stateAfter&&(h.stateAfter=
null);var l=h.text.match(/^\s*/)[0];if(!c&&!/\S/.test(h.text)){var m=0;d="not"}else if("smart"==d&&(m=e.mode.indent(f,h.text.slice(l.length),h.text),m==Zc||150<m)){if(!c)return;d="prev"}"prev"==d?m=b>e.first?wa(w(e,b-1).text,null,g):0:"add"==d?m=k+a.options.indentUnit:"subtract"==d?m=k-a.options.indentUnit:"number"==typeof d&&(m=k+d);m=Math.max(0,m);d="";c=0;if(a.options.indentWithTabs)for(a=Math.floor(m/g);a;--a)c+=g,d+="\t";c<m&&(d+=id(m-c));if(d!=l)return Db(e,d,t(b,0),t(b,l.length),"+input"),
h.stateAfter=null,!0;for(g=0;g<e.sel.ranges.length;g++)if(h=e.sel.ranges[g],h.head.line==b&&h.head.ch<l.length){b=t(b,l.length);de(e,g,new I(b,b));break}}function me(a,b,d,c,e){var f=a.doc;a.display.shift=!1;c||(c=f.sel);var g=+new Date-200,h="paste"==e||a.state.pasteIncoming>g,k=ne(b),l=null;if(h&&1<c.ranges.length)if(sa&&sa.text.join("\n")==b){if(0==c.ranges.length%sa.text.length){l=[];for(var m=0;m<sa.text.length;m++)l.push(f.splitLines(sa.text[m]))}}else k.length==c.ranges.length&&a.options.pasteLinesPerSelection&&
(l=wc(k,function(u){return[u]}));m=a.curOp.updateInput;for(var n=c.ranges.length-1;0<=n;n--){var p=c.ranges[n],q=p.from(),r=p.to();p.empty()&&(d&&0<d?q=t(q.line,q.ch-d):a.state.overwrite&&!h?r=t(r.line,Math.min(w(f,r.line).text.length,r.ch+J(k).length)):h&&sa&&sa.lineWise&&sa.text.join("\n")==k.join("\n")&&(q=r=t(q.line,0)));p={from:q,to:r,text:l?l[n%l.length]:k,origin:e||(h?"paste":a.state.cutIncoming>g?"cut":"+input")};Cb(a.doc,p);aa(a,"inputRead",a,p)}b&&!h&&pg(a,b);xb(a);2>a.curOp.updateInput&&
(a.curOp.updateInput=m);a.curOp.typing=!0;a.state.pasteIncoming=a.state.cutIncoming=-1}function qg(a,b){var d=a.clipboardData&&a.clipboardData.getData("Text");if(d)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||!b.hasFocus()||ra(b,function(){return me(b,d,0,null,"paste")}),!0}function pg(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var d=a.doc.sel,c=d.ranges.length-1;0<=c;c--){var e=d.ranges[c];if(!(100<e.head.ch||c&&d.ranges[c-1].head.line==e.head.line)){var f=a.getModeAt(e.head),
g=!1;if(f.electricChars)for(var h=0;h<f.electricChars.length;h++){if(-1<b.indexOf(f.electricChars.charAt(h))){g=nc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(w(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=nc(a,e.head.line,"smart"));g&&aa(a,"electricInput",a,e.head.line)}}}function rg(a){for(var b=[],d=[],c=0;c<a.doc.sel.ranges.length;c++){var e=a.doc.sel.ranges[c].head.line;e={anchor:t(e,0),head:t(e+1,0)};d.push(e);b.push(a.getRange(e.anchor,e.head))}return{text:b,
ranges:d}}function oe(a,b,d,c){a.setAttribute("autocorrect",d?"on":"off");a.setAttribute("autocapitalize",c?"on":"off");a.setAttribute("spellcheck",!!b)}function sg(){var a=v("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),b=v("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");fa?a.style.width="1000px":a.setAttribute("wrap","off");oc&&(a.style.border="1px solid black");return b}function pe(a,
b,d,c,e){function f(u){if("codepoint"==c){var A=k.text.charCodeAt(b.ch+(0<d?0:-1));A=isNaN(A)?null:new t(b.line,Math.max(0,Math.min(k.text.length,b.ch+d*((0<d?55296<=A&&56320>A:56320<=A&&57343>A)?2:1))),-d)}else A=e?kh(a.cm,k,b,d):fe(k,b,d);if(null==A){if(u=!u)u=b.line+l,u<a.first||u>=a.first+a.size?u=!1:(b=new t(u,b.ch,b.sticky),u=k=w(a,u));if(u)b=ge(e,a.cm,k,b.line,l);else return!1}else b=A;return!0}var g=b,h=d,k=w(a,b.line),l=e&&"rtl"==a.direction?-d:d;if("char"==c||"codepoint"==c)f();else if("column"==
c)f(!0);else if("word"==c||"group"==c)for(var m=null,n="group"==c,p=a.cm&&a.cm.getHelper(b,"wordChars"),q=!0;!(0>d)||f(!q);q=!1){var r=k.text.charAt(b.ch)||"\n";r=xc(r,p)?"w":n&&"\n"==r?"n":!n||/\s/.test(r)?null:"p";!n||q||r||(r="s");if(m&&m!=r){0>d&&(d=1,f(),b.sticky="after");break}r&&(m=r);if(0<d&&!f(!q))break}h=Vc(a,b,g,h,!0);rd(g,h)&&(h.hitSide=!0);return h}function tg(a,b,d,c){var e=a.doc,f=b.left;if("page"==c){var g=Math.min(a.display.wrapper.clientHeight,qa(a).defaultView.innerHeight||e(a).documentElement.clientHeight);
g=Math.max(g-.5*vb(a.display),3);g=(0<d?b.bottom:b.top)+d*g}else"line"==c&&(g=0<d?b.bottom+3:b.top-3);for(;;){b=Kd(a,f,g);if(!b.outside)break;if(0>d?0>=g:g>=e.height){b.hitSide=!0;break}g+=5*d}return b}function ug(a,b){var d=Fd(a,b.line);if(!d||d.hidden)return null;var c=w(a.doc,b.line);d=Ve(d,c,b.line);a=Ja(c,a.doc.direction);c="left";a&&(c=Kb(a,b.ch)%2?"right":"left");b=We(d.map,b.ch,c);b.offset="right"==b.collapse?b.end:b.start;return b}function Ah(a){for(;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;
return!1}function Ib(a,b){b&&(a.bad=!0);return a}function Bh(a,b,d,c,e){function f(q){return function(r){return r.id==q}}function g(){m&&(l+=n,p&&(l+=n),m=p=!1)}function h(q){q&&(g(),l+=q)}function k(q){if(1==q.nodeType){var r=q.getAttribute("cm-text");if(r)h(r);else{r=q.getAttribute("cm-marker");var u;if(r)q=a.findMarks(t(c,0),t(e+1,0),f(+r)),q.length&&(u=q[0].find(0))&&h(ab(a.doc,u.from,u.to).join(n));else if("false"!=q.getAttribute("contenteditable")&&(u=/^(pre|div|p|li|table|br)$/i.test(q.nodeName),
/^br$/i.test(q.nodeName)||0!=q.textContent.length)){u&&g();for(r=0;r<q.childNodes.length;r++)k(q.childNodes[r]);/^(pre|p)$/i.test(q.nodeName)&&(p=!0);u&&(m=!0)}}}else 3==q.nodeType&&h(q.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var l="",m=!1,n=a.doc.lineSeparator(),p=!1;;){k(b);if(b==d)break;b=b.nextSibling;p=!1}return l}function cd(a,b,d){if(b==a.display.lineDiv){var c=a.display.lineDiv.childNodes[d];if(!c)return Ib(a.clipPos(t(a.display.viewTo-1)),!0);b=null;d=0}else for(c=b;;c=
c.parentNode){if(!c||c==a.display.lineDiv)return null;if(c.parentNode&&c.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==c)return Ch(f,b,d)}}function Ch(a,b,d){function c(m,n,p){for(var q=-1;q<(l?l.length:0);q++)for(var r=0>q?k.map:l[q],u=0;u<r.length;u+=3){var A=r[u+2];if(A==m||A==n){n=N(0>q?a.line:a.rest[q]);q=r[u]+p;if(0>p||A!=m)q=r[u+(p?1:0)];return t(n,q)}}}var e=a.text.firstChild,f=!1;if(!b||!ja(e,b))return Ib(t(N(a.line),0),!0);
if(b==e&&(f=!0,b=e.childNodes[d],d=0,!b))return d=a.rest?J(a.rest):a.line,Ib(t(N(d),d.text.length),f);var g=3==b.nodeType?b:null,h=b;g||1!=b.childNodes.length||3!=b.firstChild.nodeType||(g=b.firstChild,d&&(d=g.nodeValue.length));for(;h.parentNode!=e;)h=h.parentNode;var k=a.measure,l=k.maps;if(b=c(g,h,d))return Ib(b,f);e=h.nextSibling;for(g=g?g.nodeValue.length-d:0;e;e=e.nextSibling){if(b=c(e,e.firstChild,0))return Ib(t(b.line,b.ch-g),f);g+=e.textContent.length}for(h=h.previousSibling;h;h=h.previousSibling){if(b=
c(h,h.firstChild,-1))return Ib(t(b.line,b.ch+d),f);d+=h.textContent.length}}var pa=navigator.userAgent,vg=navigator.platform,Ma=/gecko\/\d/i.test(pa),wg=/MSIE \d/.test(pa),xg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pa),dd=/Edge\/(\d+)/.exec(pa),G=wg||xg||dd,T=G&&(wg?document.documentMode||6:+(dd||xg)[1]),fa=!dd&&/WebKit\//.test(pa),Dh=fa&&/Qt\/\d+\.\d+/.test(pa),Qa=!dd&&/Chrome\/(\d+)/.exec(pa),uf=Qa&&+Qa[1],Ca=/Opera\//.test(pa),ad=/Apple Computer/.test(navigator.vendor),Eh=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(pa),
Vg=/PhantomJS/.test(pa),oc=ad&&(/Mobile\/\w+/.test(pa)||2<navigator.maxTouchPoints),Gc=/Android/.test(pa),ac=oc||Gc||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(pa),ya=oc||/Mac/.test(vg),sh=/\bCrOS\b/.test(pa),Fh=/win/i.test(vg),nb=Ca&&pa.match(/Version\/(\d*\.\d*)/);nb&&(nb=Number(nb[1]));nb&&15<=nb&&(Ca=!1,fa=!0);var ag=ya&&(Dh||Ca&&(null==nb||12.11>nb)),je=Ma||G&&9<=T,jb=function(a,b){var d=a.className;if(b=y(b).exec(d)){var c=d.slice(b.index+b[0].length);a.className=d.slice(0,b.index)+
(c?b[1]+c:"")}};var Qb=document.createRange?function(a,b,d,c){var e=document.createRange();e.setEnd(c||a,d);e.setStart(a,b);return e}:function(a,b,d){var c=document.body.createTextRange();try{c.moveToElementText(a.parentNode)}catch(e){return c}c.collapse(!0);c.moveEnd("character",d);c.moveStart("character",b);return c};var pc=function(a){a.select()};oc?pc=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:G&&(pc=function(a){try{a.select()}catch(b){}});var Xa=function(){this.f=this.id=null;
this.time=0;this.handler=gd(this.onTimeout,this)};Xa.prototype.onTimeout=function(a){a.id=0;a.time<=+new Date?a.f():setTimeout(a.handler,a.time-+new Date)};Xa.prototype.set=function(a,b){this.f=b;b=+new Date+a;if(!this.id||b<this.time)clearTimeout(this.id),this.id=setTimeout(this.handler,a),this.time=b};var Zc={toString:function(){return"CodeMirror.Pass"}},Ia={scroll:!1},ke={origin:"*mouse"},qc={origin:"+move"},vc=[""],zg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,
Ag=/[\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]/,
Lb=null,Cg=function(){function a(g,h,k){this.level=g;this.from=h;this.to=k}var b=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,c=/[LRr]/,e=/[Lb1n]/,f=/[1n]/;return function(g,h){var k="ltr"==h?"L":"R";if(0==g.length||"ltr"==h&&!b.test(g))return!1;for(var l=g.length,m=[],n=0;n<l;++n){var p=m,q=p.push;var r=g.charCodeAt(n);r=247>=r?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(r):
1424<=r&&1524>=r?"R":1536<=r&&1785>=r?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(r-1536):1774<=r&&2220>=r?"r":8192<=r&&8203>=r?"w":8204==r?"b":"L";q.call(p,r)}n=0;for(p=k;n<l;++n)q=m[n],"m"==q?m[n]=p:p=q;n=0;for(p=k;n<l;++n)q=m[n],"1"==q&&"r"==p?m[n]="n":c.test(q)&&(p=q,"r"==q&&(m[n]=
"R"));n=1;for(p=m[0];n<l-1;++n)q=m[n],"+"==q&&"1"==p&&"1"==m[n+1]?m[n]="1":","!=q||p!=m[n+1]||"1"!=p&&"n"!=p||(m[n]=p),p=q;for(n=0;n<l;++n)if(p=m[n],","==p)m[n]="N";else if("%"==p){for(p=n+1;p<l&&"%"==m[p];++p);for(q=n&&"!"==m[n-1]||p<l&&"1"==m[p]?"1":"N";n<p;++n)m[n]=q;n=p-1}n=0;for(p=k;n<l;++n)q=m[n],"L"==p&&"1"==q?m[n]="L":c.test(q)&&(p=q);for(p=0;p<l;++p)if(d.test(m[p])){for(n=p+1;n<l&&d.test(m[n]);++n);q="L"==(p?m[p-1]:k);for(q=q==("L"==(n<l?m[n]:k))?q?"L":"R":k;p<n;++p)m[p]=q;p=n-1}k=[];var u;
for(n=0;n<l;)if(e.test(m[n])){p=n;for(++n;n<l&&e.test(m[n]);++n);k.push(new a(0,p,n))}else{var A=n;p=k.length;q="rtl"==h?1:0;for(++n;n<l&&"L"!=m[n];++n);for(r=A;r<n;)if(f.test(m[r])){A<r&&(k.splice(p,0,new a(1,A,r)),p+=q);A=r;for(++r;r<n&&f.test(m[r]);++r);k.splice(p,0,new a(2,A,r));p+=q;A=r}else++r;A<n&&k.splice(p,0,new a(1,A,n))}"ltr"==h&&(1==k[0].level&&(u=g.match(/^\s+/))&&(k[0].from=u[0].length,k.unshift(new a(0,0,u[0].length))),1==J(k).level&&(u=g.match(/\s+$/))&&(J(k).to-=u[0].length,k.push(new a(0,
l-u[0].length,l))));return"rtl"==h?k.reverse():k}}(),yc=[],z=function(a,b,d){a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent?a.attachEvent("on"+b,d):(a=a._handlers||(a._handlers={}),a[b]=(a[b]||yc).concat(d))},th=function(){if(G&&9>T)return!1;var a=v("div");return"draggable"in a||"dragDrop"in a}(),Bd,Ad,ne=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,d=[],c=a.length;b<=c;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");
-1!=g?(d.push(f.slice(0,g)),b+=g+1):(d.push(f),b=e+1)}return d}:function(a){return a.split(/\r\n?|\n/)},Gh=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(d){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},nh=function(){var a=v("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),Hd=null,md={},qb={},rb={},X=
function(a,b,d){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0;this.lineOracle=d};X.prototype.eol=function(){return this.pos>=this.string.length};X.prototype.sol=function(){return this.pos==this.lineStart};X.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};X.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)};X.prototype.eat=function(a){var b=this.string.charAt(this.pos);
if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b};X.prototype.eatWhile=function(a){for(var b=this.pos;this.eat(a););return this.pos>b};X.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a};X.prototype.skipToEnd=function(){this.pos=this.string.length};X.prototype.skipTo=function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0};X.prototype.backUp=function(a){this.pos-=a};X.prototype.column=
function(){this.lastColumnPos<this.start&&(this.lastColumnValue=wa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue-(this.lineStart?wa(this.string,this.lineStart,this.tabSize):0)};X.prototype.indentation=function(){return wa(this.string,null,this.tabSize)-(this.lineStart?wa(this.string,this.lineStart,this.tabSize):0)};X.prototype.match=function(a,b,d){if("string"==typeof a){var c=function(f){return d?f.toLowerCase():
f},e=this.string.substr(this.pos,a.length);if(c(e)==c(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}};X.prototype.current=function(){return this.string.slice(this.start,this.pos)};X.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}};X.prototype.lookAhead=function(a){var b=this.lineOracle;return b&&b.lookAhead(a)};X.prototype.baseToken=function(){var a=
this.lineOracle;return a&&a.baseToken(this.pos)};var Cc=function(a,b){this.state=a;this.lookAhead=b},Fa=function(a,b,d,c){this.state=b;this.doc=a;this.line=d;this.maxLookAhead=c||0;this.baseTokens=null;this.baseTokenPos=1};Fa.prototype.lookAhead=function(a){var b=this.doc.getLine(this.line+a);null!=b&&a>this.maxLookAhead&&(this.maxLookAhead=a);return b};Fa.prototype.baseToken=function(a){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)this.baseTokenPos+=2;var b=this.baseTokens[this.baseTokenPos+
1];return{type:b&&b.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}};Fa.prototype.nextLine=function(){this.line++;0<this.maxLookAhead&&this.maxLookAhead--};Fa.fromSaved=function(a,b,d){return b instanceof Cc?new Fa(a,$a(a.mode,b.state),d,b.lookAhead):new Fa(a,$a(a.mode,b),d)};Fa.prototype.save=function(a){a=!1!==a?$a(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new Cc(a,this.maxLookAhead):a};var Ee=function(a,b,d){this.start=a.start;this.end=a.pos;this.string=
a.current();this.type=b||null;this.state=d},Of=!1,Ka=!1,zb=function(a,b,d){this.text=a;Ie(this,b);this.height=d?d(this):1};zb.prototype.lineNo=function(){return N(this)};pb(zb);var Jg={},Ig={},tb=null,Rb=null,Xe={left:0,right:0,top:0,bottom:0},fb,ob=function(a,b,d){this.cm=d;var c=this.vert=v("div",[v("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=v("div",[v("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");c.tabIndex=e.tabIndex=-1;a(c);a(e);z(c,
"scroll",function(){c.clientHeight&&b(c.scrollTop,"vertical")});z(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;G&&8>T&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ob.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,d=a.scrollHeight>a.clientHeight+1,c=a.nativeBarWidth;d?(this.vert.style.display="block",this.vert.style.bottom=b?c+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-
(b?c:0)))+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=d?c+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(d?c:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0<a.clientHeight&&(0==c&&this.zeroWidthHack(),this.checkedZeroWidth=!0);return{right:d?
c:0,bottom:b?c:0}};ob.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")};ob.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")};ob.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=ya&&!Eh?"12px":"18px";this.horiz.style.visibility=this.vert.style.visibility=
"hidden";this.disableHoriz=new Xa;this.disableVert=new Xa};ob.prototype.enableZeroWidthBar=function(a,b,d){function c(){var e=a.getBoundingClientRect();("vert"==d?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1))!=a?a.style.visibility="hidden":b.set(1E3,c)}a.style.visibility="";b.set(1E3,c)};ob.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz);a.removeChild(this.vert)};var rc=function(){};rc.prototype.update=
function(){return{bottom:0,right:0}};rc.prototype.setScrollLeft=function(){};rc.prototype.setScrollTop=function(){};rc.prototype.clear=function(){};var qf={"native":ob,"null":rc},Ug=0,Pc=function(a,b,d){var c=a.display;this.viewport=b;this.visible=Mc(c,a.doc,b);this.editorIsHidden=!c.wrapper.offsetWidth;this.wrapperHeight=c.wrapper.clientHeight;this.wrapperWidth=c.wrapper.clientWidth;this.oldDisplayWidth=cb(a);this.force=d;this.dims=Gd(a);this.events=[]};Pc.prototype.signal=function(a,b){xa(a,b)&&
this.events.push(arguments)};Pc.prototype.finish=function(){for(var a=0;a<this.events.length;a++)W.apply(null,this.events[a])};var Qc=0,Na=null;G?Na=-.53:Ma?Na=15:Qa?Na=-.7:ad&&(Na=-1/3);var va=function(a,b){this.ranges=a;this.primIndex=b};va.prototype.primary=function(){return this.ranges[this.primIndex]};va.prototype.equals=function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var d=this.ranges[b],c=a.ranges[b];
if(!rd(d.anchor,c.anchor)||!rd(d.head,c.head))return!1}return!0};va.prototype.deepCopy=function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new I(sd(this.ranges[b].anchor),sd(this.ranges[b].head));return new va(a,this.primIndex)};va.prototype.somethingSelected=function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1};va.prototype.contains=function(a,b){b||(b=a);for(var d=0;d<this.ranges.length;d++){var c=this.ranges[d];if(0<=B(b,c.from())&&0>=B(a,c.to()))return d}return-1};
var I=function(a,b){this.anchor=a;this.head=b};I.prototype.from=function(){return Bc(this.anchor,this.head)};I.prototype.to=function(){return Ac(this.anchor,this.head)};I.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};ec.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var d=a,c=a+b;d<c;++d){var e=this.lines[d];this.height-=e.height;var f=e;f.parent=null;He(f);aa(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,
this.lines)},insertInner:function(a,b,d){this.height+=d;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this},iterN:function(a,b,d){for(b=a+b;a<b;++a)if(d(this.lines[a]))return!0}};fc.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var d=0;d<this.children.length;++d){var c=this.children[d],e=c.chunkSize();if(a<e){var f=Math.min(b,e-a),g=c.height;c.removeInner(a,f);this.height-=g-c.height;e==f&&(this.children.splice(d--,
1),c.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(1<this.children.length||!(this.children[0]instanceof ec))&&(a=[],this.collapse(a),this.children=[new ec(a)],this.children[0].parent=this)},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,d){this.size+=b.length;this.height+=d;for(var c=0;c<this.children.length;++c){var e=this.children[c],f=e.chunkSize();if(a<=f){e.insertInner(a,b,d);if(e.lines&&50<e.lines.length){for(b=
a=e.lines.length%25+25;b<e.lines.length;)d=new ec(e.lines.slice(b,b+=25)),e.height-=d.height,this.children.splice(++c,0,d),d.parent=this;e.lines=e.lines.slice(0,a);this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5);b=new fc(b);if(a.parent){a.size-=b.size;a.height-=b.height;var d=ea(a.parent.children,a);a.parent.children.splice(d+1,0,b)}else d=new fc(a.children),d.parent=a,a.children=[d,b],a=d;b.parent=a.parent}while(10<
a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,d){for(var c=0;c<this.children.length;++c){var e=this.children[c],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,d))return!0;if(0==(b-=f))break;a=0}else a-=f}}};var gc=function(a,b,d){if(d)for(var c in d)d.hasOwnProperty(c)&&(this[c]=d[c]);this.doc=a;this.node=b};gc.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,d=this.line,c=N(d);if(null!=c&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||
(d.widgets=null);var f=Tb(this);Ea(d,Math.max(0,d.height-f));a&&(ra(a,function(){var g=-f;Ga(d)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Nc(a,g);Sa(a,c,"widget")}),aa(a,"lineWidgetCleared",a,this,c))}};gc.prototype.changed=function(){var a=this,b=this.height,d=this.doc.cm,c=this.line;this.height=null;var e=Tb(this)-b;e&&(Pa(this.doc,c)||Ea(c,c.height+e),d&&ra(d,function(){d.curOp.forceUpdate=!0;Ga(c)<(d.curOp&&d.curOp.scrollTop||d.doc.scrollTop)&&Nc(d,e);aa(d,"lineWidgetChanged",d,a,N(c))}))};
pb(gc);var Uf=0,Va=function(a,b){this.lines=[];this.type=b;this.doc=a;this.id=++Uf};Va.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&lb(a);if(xa(this,"clear")){var d=this.find();d&&aa(this,"clear",d.from,d.to)}for(var c=d=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=Pb(f.markedSpans,this);a&&!this.collapsed?Sa(a,N(f),"text"):a&&(null!=g.to&&(c=N(f)),null!=g.from&&(d=N(f)));for(var h=f,k=void 0,l=f.markedSpans,m=g,n=0;n<l.length;++n)l[n]!=m&&(k||
(k=[])).push(l[n]);h.markedSpans=k;null==g.from&&this.collapsed&&!Pa(this.doc,f)&&a&&Ea(f,vb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=za(this.lines[e]),g=Ec(f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=d&&a&&this.collapsed&&ma(a,d,c+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Kf(a.doc));a&&aa(a,"markerCleared",a,this,d,
c);b&&mb(a);this.parent&&this.parent.clear()}};Va.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var d,c,e=0;e<this.lines.length;++e){var f=this.lines[e],g=Pb(f.markedSpans,this);if(null!=g.from&&(d=t(b?f:N(f),g.from),-1==a))return d;if(null!=g.to&&(c=t(b?f:N(f),g.to),1==a))return c}return d&&{from:d,to:c}};Va.prototype.changed=function(){var a=this,b=this.find(-1,!0),d=this,c=this.doc.cm;b&&c&&ra(c,function(){var e=b.line,f=N(b.line);if(f=Fd(c,f))Ye(f),c.curOp.selectionChanged=
c.curOp.forceUpdate=!0;c.curOp.updateMaxLine=!0;Pa(d.doc,e)||null==d.height||(f=d.height,d.height=null,(f=Tb(d)-f)&&Ea(e,e.height+f));aa(c,"markerChanged",c,a)})};Va.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=ea(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};Va.prototype.detachLine=function(a){this.lines.splice(ea(this.lines,a),1);!this.lines.length&&this.doc.cm&&
(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};pb(Va);var hc=function(a,b){this.markers=a;this.primary=b;for(b=0;b<a.length;++b)a[b].parent=this};hc.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();aa(this,"clear")}};hc.prototype.find=function(a,b){return this.primary.find(a,b)};pb(hc);var Hh=0,oa=function(a,b,d,c,e){if(!(this instanceof oa))return new oa(a,b,d,c,e);null==
d&&(d=0);fc.call(this,[new ec([new zb("",null)])]);this.first=d;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=d;d=t(d,0);this.sel=Oa(d);this.history=new Rc(null);this.id=++Hh;this.modeOption=b;this.lineSep=c;this.direction="rtl"==e?"rtl":"ltr";this.extend=!1;"string"==typeof a&&(a=this.splitLines(a));ae(this,{from:d,to:d,text:a});da(this,Oa(d),Ia)};oa.prototype=re(fc.prototype,{constructor:oa,iter:function(a,b,d){d?this.iterN(a-this.first,
b-a,d):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var d=0,c=0;c<b.length;++c)d+=b[c].height;this.insertInner(a-this.first,b,d)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=pd(this,this.first,this.first+this.size);return!1===a?b:b.join(a||this.lineSeparator())},setValue:ca(function(a){var b=t(this.first,0),d=this.first+this.size-1;Cb(this,{from:b,to:t(d,w(this,d).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0);this.cm&&
Wb(this.cm,0,0);da(this,Oa(b),Ia)}),replaceRange:function(a,b,d,c){b=C(this,b);d=d?C(this,d):b;Db(this,a,b,d,c)},getRange:function(a,b,d){a=ab(this,C(this,a),C(this,b));return!1===d?a:""===d?a.join(""):a.join(d||this.lineSeparator())},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){if(Nb(this,a))return w(this,a)},getLineNumber:function(a){return N(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=w(this,a));return za(a)},lineCount:function(){return this.size},
firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return C(this,a)},getCursor:function(a){var b=this.sel.primary();return null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||"to"==a||!1===a?b.to():b.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ca(function(a,b,d){a=C(this,"number"==typeof a?t(a,b||0):a);da(this,Oa(a,null),d)}),setSelection:ca(function(a,
b,d){var c=C(this,a);a=C(this,b||a);da(this,Oa(c,a),d)}),extendSelection:ca(function(a,b,d){Tc(this,C(this,a),b&&C(this,b),d)}),extendSelections:ca(function(a,b){Gf(this,ye(this,a),b)}),extendSelectionsBy:ca(function(a,b){a=wc(this.sel.ranges,a);Gf(this,ye(this,a),b)}),setSelections:ca(function(a,b,d){if(a.length){for(var c=[],e=0;e<a.length;e++)c[e]=new I(C(this,a[e].anchor),C(this,a[e].head||a[e].anchor));null==b&&(b=Math.min(a.length-1,this.sel.primIndex));da(this,Da(this.cm,c,b),d)}}),addSelection:ca(function(a,
b,d){var c=this.sel.ranges.slice(0);c.push(new I(C(this,a),C(this,b||a)));da(this,Da(this.cm,c,c.length-1),d)}),getSelection:function(a){for(var b=this.sel.ranges,d,c=0;c<b.length;c++){var e=ab(this,b[c].from(),b[c].to());d=d?d.concat(e):e}return!1===a?d:d.join(a||this.lineSeparator())},getSelections:function(a){for(var b=[],d=this.sel.ranges,c=0;c<d.length;c++){var e=ab(this,d[c].from(),d[c].to());!1!==a&&(e=e.join(a||this.lineSeparator()));b[c]=e}return b},replaceSelection:function(a,b,d){for(var c=
[],e=0;e<this.sel.ranges.length;e++)c[e]=a;this.replaceSelections(c,b,d||"+input")},replaceSelections:ca(function(a,b,d){for(var c=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];c[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:d}}if(a=b&&"end"!=b){a=[];e=d=t(this.first,0);for(f=0;f<c.length;f++){var h=c[f];g=yf(h.from,d,e);var k=yf(Ta(h),d,e);d=h.to;e=k;"around"==b?(h=this.sel.ranges[f],h=0>B(h.head,h.anchor),a[f]=new I(h?k:g,h?g:k)):a[f]=new I(g,g)}a=new va(a,this.sel.primIndex)}b=
a;for(a=c.length-1;0<=a;a--)Cb(this,c[a]);b?Hf(this,b):this.cm&&xb(this.cm)}),undo:ca(function(){Wc(this,"undo")}),redo:ca(function(){Wc(this,"redo")}),undoSelection:ca(function(){Wc(this,"undo",!0)}),redoSelection:ca(function(){Wc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,d=0,c=0;c<a.done.length;c++)a.done[c].ranges||++b;for(c=0;c<a.undone.length;c++)a.undone[c].ranges||++d;return{undo:b,
redo:d}},clearHistory:function(){var a=this;this.history=new Rc(this.history);Ua(this,function(b){return b.history=a.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Ab(this.history.done),undone:Ab(this.history.undone)}},
setHistory:function(a){var b=this.history=new Rc(this.history);b.done=Ab(a.done.slice(0),null,!0);b.undone=Ab(a.undone.slice(0),null,!0)},setGutterMarker:ca(function(a,b,d){return dc(this,a,"gutter",function(c){var e=c.gutterMarkers||(c.gutterMarkers={});e[b]=d;!d&&se(e)&&(c.gutterMarkers=null);return!0})}),clearGutter:ca(function(a){var b=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[a]&&dc(b,d,"gutter",function(){d.gutterMarkers[a]=null;se(d.gutterMarkers)&&(d.gutterMarkers=null);
return!0})})}),lineInfo:function(a){if("number"==typeof a){if(!Nb(this,a))return null;var b=a;a=w(this,a);if(!a)return null}else if(b=N(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:ca(function(a,b,d){return dc(this,a,"gutter"==b?"gutter":"class",function(c){var e="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(c[e]){if(y(d).test(c[e]))return!1;
c[e]+=" "+d}else c[e]=d;return!0})}),removeLineClass:ca(function(a,b,d){return dc(this,a,"gutter"==b?"gutter":"class",function(c){var e="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",f=c[e];if(f)if(null==d)c[e]=null;else{var g=f.match(y(d));if(!g)return!1;var h=g.index+g[0].length;c[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:ca(function(a,b,d){return ch(this,a,b,d)}),removeLineWidget:function(a){a.clear()},
markText:function(a,b,d){return Eb(this,C(this,a),C(this,b),d,d&&d.type||"range")},setBookmark:function(a,b){b={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};a=C(this,a);return Eb(this,a,a,b,"bookmark")},findMarksAt:function(a){a=C(this,a);var b=[],d=w(this,a.line).markedSpans;if(d)for(var c=0;c<d.length;++c){var e=d[c];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||
e.marker)}return b},findMarks:function(a,b,d){a=C(this,a);b=C(this,b);var c=[],e=a.line;this.iter(a.line,b.line+1,function(f){if(f=f.markedSpans)for(var g=0;g<f.length;g++){var h=f[g];null!=h.to&&e==a.line&&a.ch>=h.to||null==h.from&&e!=a.line||null!=h.from&&e==b.line&&h.from>=b.ch||d&&!d(h.marker)||c.push(h.marker.parent||h.marker)}++e});return c},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var d=0;d<b.length;++d)null!=b[d].from&&a.push(b[d].marker)});return a},posFromIndex:function(a){var b,
d=this.first,c=this.lineSeparator().length;this.iter(function(e){e=e.text.length+c;if(e>a)return b=a,!0;a-=e;++d});return C(this,t(d,b))},indexFromPos:function(a){a=C(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;var d=this.lineSeparator().length;this.iter(this.first,a.line,function(c){b+=c.text.length+d});return b},copy:function(a){var b=new oa(pd(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;
b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,d=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<d&&(d=a.to);b=new oa(pd(this,b,d),a.mode||this.modeOption,b,this.lineSep,this.direction);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];a=Vf(this);
for(d=0;d<a.length;d++){var c=a[d],e=c.find(),f=b.clipPos(e.from);e=b.clipPos(e.to);B(f,e)&&(f=Eb(b,f,e,c.primary,c.primary.type),c.markers.push(f),f.parent=c)}return b},unlinkDoc:function(a){a instanceof U&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);eh(Vf(this));break}if(a.history==this.history){var d=[a.id];Ua(a,function(c){return d.push(c.id)},!0);a.history=new Rc(null);a.history.done=Ab(this.history.done,d);
a.history.undone=Ab(this.history.undone,d)}},iterLinkedDocs:function(a){Ua(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):ne(a)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ca(function(a){"rtl"!=a&&(a="ltr");a!=this.direction&&(this.direction=a,this.iter(function(b){return b.order=null}),this.cm&&$g(this.cm))})});oa.prototype.eachLine=oa.prototype.iter;for(var Xf=0,og=!1,Wa={3:"Pause",
8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",
63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},sc=0;10>sc;sc++)Wa[sc+48]=Wa[sc+96]=String(sc);for(var ed=65;90>=ed;ed++)Wa[ed]=String.fromCharCode(ed);for(var tc=1;12>=tc;tc++)Wa[tc+111]=Wa[tc+63235]="F"+tc;var ic={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"},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"},emacsy:{"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars",
"Ctrl-O":"openLine"},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"]}};ic["default"]=ya?ic.macDefault:ic.pcDefault;var jc={selectAll:Mf,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Ia)},killLine:function(a){return Gb(a,function(b){if(b.empty()){var d=
w(a.doc,b.head.line).text.length;return b.head.ch==d&&b.head.line<a.lastLine()?{from:b.head,to:t(b.head.line+1,0)}:{from:b.head,to:t(b.head.line,d)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){return Gb(a,function(b){return{from:t(b.from().line,0),to:C(a.doc,t(b.to().line+1,0))}})},delLineLeft:function(a){return Gb(a,function(b){return{from:t(b.from().line,0),to:b.from()}})},delWrappedLineLeft:function(a){return Gb(a,function(b){var d=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,
top:d},"div"),to:b.from()}})},delWrappedLineRight:function(a){return Gb(a,function(b){var d=a.charCoords(b.head,"div").top+5;d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:d},"div");return{from:b.from(),to:d}})},undo:function(a){return a.undo()},redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(t(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(t(a.lastLine()))},
goLineStart:function(a){return a.extendSelectionsBy(function(b){return cg(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy(function(b){return dg(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){return a.extendSelectionsBy(function(b){b=b.head.line;var d=w(a.doc,b);var c=d;for(var e;e=sb(c,!1);)c=e.find(1,!0).line;c!=d&&(b=N(c));return ge(!0,a,d,b,-1)},{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy(function(b){b=
a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div")},qc)},goLineLeft:function(a){return a.extendSelectionsBy(function(b){b=a.cursorCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:b},"div")},qc)},goLineLeftSmart:function(a){return a.extendSelectionsBy(function(b){var d=a.cursorCoords(b.head,"div").top+5;d=a.coordsChar({left:0,top:d},"div");return d.ch<a.getLine(d.line).search(/\S/)?dg(a,b.head):d},qc)},goLineUp:function(a){return a.moveV(-1,
"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,"char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,
"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,"codepoint")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,"word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},
indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],d=a.listSelections(),c=a.options.tabSize,e=0;e<d.length;e++){var f=d[e].from();f=wa(a.getLine(f.line),f.ch,c);b.push(id(c-f%c))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return ra(a,function(){for(var b=a.listSelections(),d=[],c=0;c<b.length;c++)if(b[c].empty()){var e=
b[c].head,f=w(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new t(e.line,e.ch-1)),0<e.ch)e=new t(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),t(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=w(a.doc,e.line-1).text;g&&(e=new t(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),t(e.line-1,g.length-1),e,"+transpose"))}d.push(new I(e,e))}a.setSelections(d)})},newlineAndIndent:function(a){return ra(a,function(){for(var b=a.listSelections(),
d=b.length-1;0<=d;d--)a.replaceRange(a.doc.lineSeparator(),b[d].anchor,b[d].head,"+input");b=a.listSelections();for(d=0;d<b.length;d++)a.indentLine(b[d].from().line,null,!0);xb(a)})},openLine:function(a){return a.replaceSelection("\n","start")},toggleOverwrite:function(a){return a.toggleOverwrite()}},lh=new Xa,he=null,ie=function(a,b,d){this.time=a;this.pos=b;this.button=d};ie.prototype.compare=function(a,b,d){return this.time+400>a&&0==B(b,this.pos)&&d==this.button};var mc,lc,Hb={toString:function(){return"CodeMirror.Init"}},
ng={},bd={};U.defaults=ng;U.optionHandlers=bd;var le=[];U.defineInitHook=function(a){return le.push(a)};var sa=null,O=function(a){this.cm=a;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new Xa;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};O.prototype.init=function(a){function b(h){for(h=h.target;h;h=h.parentNode){if(h==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(h.className))break}return!1}function d(h){if(b(h)&&!Z(f,
h)){if(f.somethingSelected())sa={lineWise:!1,text:f.getSelections()},"cut"==h.type&&f.replaceSelection("",null,"cut");else if(f.options.lineWiseCopyCut){var k=rg(f);sa={lineWise:!0,text:k.text};"cut"==h.type&&f.operation(function(){f.setSelections(k.ranges,0,Ia);f.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var l=sa.text.join("\n");h.clipboardData.setData("Text",l);if(h.clipboardData.getData("Text")==l){h.preventDefault();return}}var m=sg();h=m.firstChild;
oe(h);f.display.lineSpace.insertBefore(m,f.display.lineSpace.firstChild);h.value=sa.text.join("\n");var n=ka(g.ownerDocument);pc(h);setTimeout(function(){f.display.lineSpace.removeChild(m);n.focus();n==g&&e.showPrimarySelection()},50)}}var c=this,e=this,f=e.cm,g=e.div=a.lineDiv;g.contentEditable=!0;oe(g,f.options.spellcheck,f.options.autocorrect,f.options.autocapitalize);z(g,"paste",function(h){!b(h)||Z(f,h)||qg(h,f)||11>=T&&setTimeout(ba(f,function(){return c.updateFromDOM()}),20)});z(g,"compositionstart",
function(h){c.composing={data:h.data,done:!1}});z(g,"compositionupdate",function(h){c.composing||(c.composing={data:h.data,done:!1})});z(g,"compositionend",function(h){c.composing&&(h.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)});z(g,"touchstart",function(){return e.forceCompositionEnd()});z(g,"input",function(){c.composing||c.readFromDOMSoon()});z(g,"copy",d);z(g,"cut",d)};O.prototype.screenReaderLabelChanged=function(a){a?this.div.setAttribute("aria-label",a):this.div.removeAttribute("aria-label")};
O.prototype.prepareSelection=function(){var a=hf(this.cm,!1);a.focus=ka(this.div.ownerDocument)==this.div;return a};O.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))};O.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};O.prototype.showPrimarySelection=function(){var a=this.getSelection(),b=this.cm,d=b.doc.sel.primary(),c=d.from();d=d.to();if(b.display.viewTo==
b.display.viewFrom||c.line>=b.display.viewTo||d.line<b.display.viewFrom)a.removeAllRanges();else{var e=cd(b,a.anchorNode,a.anchorOffset),f=cd(b,a.focusNode,a.focusOffset);if(!e||e.bad||!f||f.bad||0!=B(Bc(e,f),c)||0!=B(Ac(e,f),d))if(e=b.display.view,c=c.line>=b.display.viewFrom&&ug(b,c)||{node:e[0].measure.map[2],offset:0},d=d.line<b.display.viewTo&&ug(b,d),d||(d=e[e.length-1].measure,d=d.maps?d.maps[d.maps.length-1]:d.map,d={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}),c&&d){e=a.rangeCount&&
a.getRangeAt(0);try{var g=Qb(c.node,c.offset,d.offset,d.node)}catch(h){}g&&(!Ma&&b.state.focused?(a.collapse(c.node,c.offset),g.collapsed||(a.removeAllRanges(),a.addRange(g))):(a.removeAllRanges(),a.addRange(g)),e&&null==a.anchorNode?a.addRange(e):Ma&&this.startGracePeriod());this.rememberSelection()}else a.removeAllRanges()}};O.prototype.startGracePeriod=function(){var a=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){a.gracePeriod=!1;a.selectionChanged()&&a.cm.operation(function(){return a.cm.curOp.selectionChanged=
!0})},20)};O.prototype.showMultipleSelections=function(a){D(this.cm.display.cursorDiv,a.cursors);D(this.cm.display.selectionDiv,a.selection)};O.prototype.rememberSelection=function(){var a=this.getSelection();this.lastAnchorNode=a.anchorNode;this.lastAnchorOffset=a.anchorOffset;this.lastFocusNode=a.focusNode;this.lastFocusOffset=a.focusOffset};O.prototype.selectionInEditor=function(){var a=this.getSelection();if(!a.rangeCount)return!1;a=a.getRangeAt(0).commonAncestorContainer;return ja(this.div,a)};
O.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&ka(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())};O.prototype.blur=function(){this.div.blur()};O.prototype.getField=function(){return this.div};O.prototype.supportsTouch=function(){return!0};O.prototype.receivedFocus=function(){function a(){d.cm.state.focused&&(d.pollSelection(),d.polling.set(d.cm.options.pollInterval,a))}var b=this,d=this;this.selectionInEditor()?
setTimeout(function(){return b.pollSelection()},20):ra(this.cm,function(){return d.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,a)};O.prototype.selectionChanged=function(){var a=this.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset};O.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var a=this.getSelection(),
b=this.cm;if(Gc&&Qa&&this.cm.display.gutterSpecs.length&&Ah(a.anchorNode))this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();else if(!this.composing){this.rememberSelection();var d=cd(b,a.anchorNode,a.anchorOffset),c=cd(b,a.focusNode,a.focusOffset);d&&c&&ra(b,function(){da(b.doc,Oa(d,c),Ia);if(d.bad||c.bad)b.curOp.selectionChanged=!0})}}};O.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=
null);var a=this.cm,b=a.display,d=a.doc.sel.primary(),c=d.from(),e=d.to();0==c.ch&&c.line>a.firstLine()&&(c=t(c.line-1,w(a.doc,c.line-1).length));e.ch==w(a.doc,e.line).text.length&&e.line<a.lastLine()&&(e=t(e.line+1,0));if(c.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f;c.line==b.viewFrom||0==(f=db(a,c.line))?(d=N(b.view[0].line),f=b.view[0].node):(d=N(b.view[f].line),f=b.view[f-1].node.nextSibling);var g=db(a,e.line);g==b.view.length-1?(e=b.viewTo-1,b=b.lineDiv.lastChild):(e=N(b.view[g+1].line)-
1,b=b.view[g+1].node.previousSibling);if(!f)return!1;b=a.doc.splitLines(Bh(a,f,b,d,e));for(f=ab(a.doc,t(d,0),t(e,w(a.doc,e).text.length));1<b.length&&1<f.length;)if(J(b)==J(f))b.pop(),f.pop(),e--;else if(b[0]==f[0])b.shift(),f.shift(),d++;else break;var h=0;g=0;for(var k=b[0],l=f[0],m=Math.min(k.length,l.length);h<m&&k.charCodeAt(h)==l.charCodeAt(h);)++h;k=J(b);l=J(f);for(m=Math.min(k.length-(1==b.length?h:0),l.length-(1==f.length?h:0));g<m&&k.charCodeAt(k.length-g-1)==l.charCodeAt(l.length-g-1);)++g;
if(1==b.length&&1==f.length&&d==c.line)for(;h&&h>c.ch&&k.charCodeAt(k.length-g-1)==l.charCodeAt(l.length-g-1);)h--,g++;b[b.length-1]=k.slice(0,k.length-g).replace(/^\u200b+/,"");b[0]=b[0].slice(h).replace(/\u200b+$/,"");c=t(d,h);d=t(e,f.length?J(f).length-g:0);if(1<b.length||b[0]||B(c,d))return Db(a.doc,b,c,d,"+input"),!0};O.prototype.ensurePolled=function(){this.forceCompositionEnd()};O.prototype.reset=function(){this.forceCompositionEnd()};O.prototype.forceCompositionEnd=function(){this.composing&&
(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())};O.prototype.readFromDOMSoon=function(){var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){a.readDOMTimeout=null;if(a.composing)if(a.composing.done)a.composing=null;else return;a.updateFromDOM()},80))};O.prototype.updateFromDOM=function(){var a=this;!this.cm.isReadOnly()&&this.pollContent()||ra(this.cm,function(){return ma(a.cm)})};O.prototype.setUneditable=function(a){a.contentEditable=
"false"};O.prototype.onKeyPress=function(a){0==a.charCode||this.composing||(a.preventDefault(),this.cm.isReadOnly()||ba(this.cm,me)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))};O.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)};O.prototype.onContextMenu=function(){};O.prototype.resetPosition=function(){};O.prototype.needsContentAttribute=!0;var V=function(a){this.cm=a;this.prevInput="";this.pollingFast=!1;this.polling=new Xa;this.hasSelection=
!1;this.composing=null;this.resetting=!1};V.prototype.init=function(a){function b(g){if(!Z(e,g)){if(e.somethingSelected())sa={lineWise:!1,text:e.getSelections()};else if(e.options.lineWiseCopyCut){var h=rg(e);sa={lineWise:!0,text:h.text};"cut"==g.type?e.setSelections(h.ranges,null,Ia):(c.prevInput="",f.value=h.text.join("\n"),pc(f))}else return;"cut"==g.type&&(e.state.cutIncoming=+new Date)}}var d=this,c=this,e=this.cm;this.createField(a);var f=this.textarea;a.wrapper.insertBefore(this.wrapper,a.wrapper.firstChild);
oc&&(f.style.width="0px");z(f,"input",function(){G&&9<=T&&d.hasSelection&&(d.hasSelection=null);c.poll()});z(f,"paste",function(g){Z(e,g)||qg(g,e)||(e.state.pasteIncoming=+new Date,c.fastPoll())});z(f,"cut",b);z(f,"copy",b);z(a.scroller,"paste",function(g){if(!La(a,g)&&!Z(e,g))if(f.dispatchEvent){var h=new Event("paste");h.clipboardData=g.clipboardData;f.dispatchEvent(h)}else e.state.pasteIncoming=+new Date,c.focus()});z(a.lineSpace,"selectstart",function(g){La(a,g)||la(g)});z(f,"compositionstart",
function(){var g=e.getCursor("from");c.composing&&c.composing.range.clear();c.composing={start:g,range:e.markText(g,e.getCursor("to"),{className:"CodeMirror-composing"})}});z(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})};V.prototype.createField=function(a){this.wrapper=sg();this.textarea=this.wrapper.firstChild;a=this.cm.options;oe(this.textarea,a.spellcheck,a.autocorrect,a.autocapitalize)};V.prototype.screenReaderLabelChanged=function(a){a?this.textarea.setAttribute("aria-label",
a):this.textarea.removeAttribute("aria-label")};V.prototype.prepareSelection=function(){var a=this.cm,b=a.display,d=a.doc,c=hf(a);if(a.options.moveInputWithCursor){a=Ba(a,d.sel.primary().head,"div");d=b.wrapper.getBoundingClientRect();var e=b.lineDiv.getBoundingClientRect();c.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+e.top-d.top));c.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+e.left-d.left))}return c};V.prototype.showSelection=function(a){var b=this.cm.display;D(b.cursorDiv,
a.cursors);D(b.selectionDiv,a.selection);null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")};V.prototype.reset=function(a){if(!(this.contextMenuPending||this.composing&&a)){var b=this.cm;this.resetting=!0;b.somethingSelected()?(this.prevInput="",a=b.getSelection(),this.textarea.value=a,b.state.focused&&pc(this.textarea),G&&9<=T&&(this.hasSelection=a)):a||(this.prevInput=this.textarea.value="",G&&9<=T&&(this.hasSelection=null));this.resetting=!1}};V.prototype.getField=
function(){return this.textarea};V.prototype.supportsTouch=function(){return!1};V.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!ac||ka(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(a){}};V.prototype.blur=function(){this.textarea.blur()};V.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};V.prototype.receivedFocus=function(){this.slowPoll()};V.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,
function(){a.poll();a.cm.state.focused&&a.slowPoll()})};V.prototype.fastPoll=function(){function a(){d.poll()||b?(d.pollingFast=!1,d.slowPoll()):(b=!0,d.polling.set(60,a))}var b=!1,d=this;d.pollingFast=!0;d.polling.set(20,a)};V.prototype.poll=function(){var a=this,b=this.cm,d=this.textarea,c=this.prevInput;if(this.contextMenuPending||this.resetting||!b.state.focused||Gh(d)&&!c&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=d.value;if(e==c&&!b.somethingSelected())return!1;
if(G&&9<=T&&this.hasSelection===e||ya&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==b.display.selForContextMenu){var f=e.charCodeAt(0);8203!=f||c||(c="\u200b");if(8666==f)return this.reset(),this.cm.execCommand("undo")}var g=0;for(f=Math.min(c.length,e.length);g<f&&c.charCodeAt(g)==e.charCodeAt(g);)++g;ra(b,function(){me(b,e.slice(g),c.length-g,null,a.composing?"*compose":null);1E3<e.length||-1<e.indexOf("\n")?d.value=a.prevInput="":a.prevInput=e;a.composing&&(a.composing.range.clear(),
a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))});return!0};V.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)};V.prototype.onKeyPress=function(){G&&9<=T&&(this.hasSelection=null);this.fastPoll()};V.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var q=e.somethingSelected(),r="\u200b"+(q?g.value:"");g.value="\u21da";g.value=r;c.prevInput=q?"":"\u200b";g.selectionStart=1;g.selectionEnd=
r.length;f.selForContextMenu=e.doc.sel}}function d(){if(c.contextMenuPending==d&&(c.contextMenuPending=!1,c.wrapper.style.cssText=m,g.style.cssText=l,G&&9>T&&f.scrollbars.setScrollTop(f.scroller.scrollTop=k),null!=g.selectionStart)){(!G||G&&9>T)&&b();var q=0,r=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&0<g.selectionEnd&&"\u200b"==c.prevInput?ba(e,Mf)(e):10>q++?f.detectingSelectAll=setTimeout(r,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(r,
200)}}var c=this,e=c.cm,f=e.display,g=c.textarea;c.contextMenuPending&&c.contextMenuPending();var h=gb(e,a),k=f.scroller.scrollTop;if(h&&!Ca){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(h)&&ba(e,da)(e.doc,Oa(h),Ia);var l=g.style.cssText,m=c.wrapper.style.cssText;h=c.wrapper.offsetParent.getBoundingClientRect();c.wrapper.style.cssText="position: static";g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-h.top-5)+"px; left: "+(a.clientX-h.left-
5)+"px;\n z-index: 1000; background: "+(G?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(fa)var n=g.ownerDocument.defaultView.scrollY;f.input.focus();fa&&g.ownerDocument.defaultView.scrollTo(null,n);f.input.reset();e.somethingSelected()||(g.value=c.prevInput=" ");c.contextMenuPending=d;f.selForContextMenu=e.doc.sel;clearTimeout(f.detectingSelectAll);G&&9<=T&&b();if(je){Mb(a);var p=
function(){ta(window,"mouseup",p);setTimeout(d,20)};z(window,"mouseup",p)}else setTimeout(d,50)}};V.prototype.readOnlyChanged=function(a){a||this.reset();this.textarea.disabled="nocursor"==a;this.textarea.readOnly=!!a};V.prototype.setUneditable=function(){};V.prototype.needsContentAttribute=!1;(function(a){function b(c,e,f,g){a.defaults[c]=e;f&&(d[c]=g?function(h,k,l){l!=Hb&&f(h,k,l)}:f)}var d=a.optionHandlers;a.defineOption=b;a.Init=Hb;b("value","",function(c,e){return c.setValue(e)},!0);b("mode",
null,function(c,e){c.doc.modeOption=e;$d(c)},!0);b("indentUnit",2,$d,!0);b("indentWithTabs",!1);b("smartIndent",!0);b("tabSize",4,function(c){bc(c);Ub(c);ma(c)},!0);b("lineSeparator",null,function(c,e){if(c.doc.lineSep=e){var f=[],g=c.doc.first;c.doc.iter(function(k){for(var l=0;;){var m=k.text.indexOf(e,l);if(-1==m)break;l=m+e.length;f.push(t(g,m))}g++});for(var h=f.length-1;0<=h;h--)Db(c.doc,e,f[h],t(f[h].line,f[h].ch+e.length))}});b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,
function(c,e,f){c.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g");f!=Hb&&c.refresh()});b("specialCharPlaceholder",Mg,function(c){return c.refresh()},!0);b("electricChars",!0);b("inputStyle",ac?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor");},!0);b("spellcheck",!1,function(c,e){return c.getInputField().spellcheck=e},!0);b("autocorrect",!1,function(c,e){return c.getInputField().autocorrect=e},!0);b("autocapitalize",
!1,function(c,e){return c.getInputField().autocapitalize=e},!0);b("rtlMoveVisually",!Fh);b("wholeLineUpdateBefore",!0);b("theme","default",function(c){mg(c);$b(c)},!0);b("keyMap","default",function(c,e,f){e=Xc(e);(f=f!=Hb&&Xc(f))&&f.detach&&f.detach(c,e);e.attach&&e.attach(c,f||null)});b("extraKeys",null);b("configureMouse",null);b("lineWrapping",!1,yh,!0);b("gutters",[],function(c,e){c.display.gutterSpecs=Yd(e,c.options.lineNumbers);$b(c)},!0);b("fixedGutter",!0,function(c,e){c.display.gutters.style.left=
e?Md(c.display)+"px":"0";c.refresh()},!0);b("coverGutterNextToScrollbar",!1,function(c){return yb(c)},!0);b("scrollbarStyle","native",function(c){pf(c);yb(c);c.display.scrollbars.setScrollTop(c.doc.scrollTop);c.display.scrollbars.setScrollLeft(c.doc.scrollLeft)},!0);b("lineNumbers",!1,function(c,e){c.display.gutterSpecs=Yd(c.options.gutters,e);$b(c)},!0);b("firstLineNumber",1,$b,!0);b("lineNumberFormatter",function(c){return c},$b,!0);b("showCursorWhenSelecting",!1,Vb,!0);b("resetSelectionOnContextMenu",
!0);b("lineWiseCopyCut",!0);b("pasteLinesPerSelection",!0);b("selectionsMayTouch",!1);b("readOnly",!1,function(c,e){"nocursor"==e&&(wb(c),c.display.input.blur());c.display.input.readOnlyChanged(e)});b("screenReaderLabel",null,function(c,e){c.display.input.screenReaderLabelChanged(""===e?null:e)});b("disableInput",!1,function(c,e){e||c.display.input.reset()},!0);b("dragDrop",!0,xh);b("allowDropFileTypes",null);b("cursorBlinkRate",530);b("cursorScrollMargin",0);b("cursorHeight",1,Vb,!0);b("singleCursorHeightPerLine",
!0,Vb,!0);b("workTime",100);b("workDelay",100);b("flattenSpans",!0,bc,!0);b("addModeClass",!1,bc,!0);b("pollInterval",100);b("undoDepth",200,function(c,e){return c.doc.history.undoDepth=e});b("historyEventDelay",1250);b("viewportMargin",10,function(c){return c.refresh()},!0);b("maxHighlightLength",1E4,bc,!0);b("moveInputWithCursor",!0,function(c,e){e||c.display.input.resetPosition()});b("tabindex",null,function(c,e){return c.display.input.getField().tabIndex=e||""});b("autofocus",null);b("direction",
"ltr",function(c,e){return c.doc.setDirection(e)},!0);b("phrases",null)})(U);(function(a){var b=a.optionHandlers,d=a.helpers={};a.prototype={constructor:a,focus:function(){qa(this).defaultView.focus();this.display.input.focus()},setOption:function(c,e){var f=this.options,g=f[c];if(f[c]!=e||"mode"==c)f[c]=e,b.hasOwnProperty(c)&&ba(this,b[c])(this,e,g),W(this,"optionChange",this,c)},getOption:function(c){return this.options[c]},getDoc:function(){return this.doc},addKeyMap:function(c,e){this.state.keyMaps[e?
"push":"unshift"](Xc(c))},removeKeyMap:function(c){for(var e=this.state.keyMaps,f=0;f<e.length;++f)if(e[f]==c||e[f].name==c)return e.splice(f,1),!0},addOverlay:ia(function(c,e){var f=c.token?c:a.getMode(this.options,c);if(f.startState)throw Error("Overlays may not be stateful.");yg(this.state.overlays,{mode:f,modeSpec:c,opaque:e&&e.opaque,priority:e&&e.priority||0},function(g){return g.priority});this.state.modeGen++;ma(this)}),removeOverlay:ia(function(c){for(var e=this.state.overlays,f=0;f<e.length;++f){var g=
e[f].modeSpec;if(g==c||"string"==typeof c&&g.name==c){e.splice(f,1);this.state.modeGen++;ma(this);break}}}),indentLine:ia(function(c,e,f){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract");Nb(this.doc,c)&&nc(this,c,e,f)}),indentSelection:ia(function(c){for(var e=this.doc.sel.ranges,f=-1,g=0;g<e.length;g++){var h=e[g];if(h.empty())h.head.line>f&&(nc(this,h.head.line,c,!0),f=h.head.line,g==this.doc.sel.primIndex&&xb(this));else{var k=h.from();
h=h.to();var l=Math.max(f,k.line);f=Math.min(this.lastLine(),h.line-(h.ch?0:1))+1;for(h=l;h<f;++h)nc(this,h,c);h=this.doc.sel.ranges;0==k.ch&&e.length==h.length&&0<h[g].from().ch&&de(this.doc,g,new I(k,h[g].to()),Ia)}}}),getTokenAt:function(c,e){return De(this,c,e)},getLineTokens:function(c,e){return De(this,t(c),e,!0)},getTokenTypeAt:function(c){c=C(this.doc,c);var e=Be(this,w(this.doc,c.line)),f=0,g=(e.length-1)/2;c=c.ch;if(0==c)e=e[2];else for(;;){var h=f+g>>1;if((h?e[2*h-1]:0)>=c)g=h;else if(e[2*
h+1]<c)f=h+1;else{e=e[2*h+2];break}}f=e?e.indexOf("overlay "):-1;return 0>f?e:0==f?null:e.slice(0,f-1)},getModeAt:function(c){var e=this.doc.mode;return e.innerMode?a.innerMode(e,this.getTokenAt(c).state).mode:e},getHelper:function(c,e){return this.getHelpers(c,e)[0]},getHelpers:function(c,e){var f=[];if(!d.hasOwnProperty(e))return f;var g=d[e];c=this.getModeAt(c);if("string"==typeof c[e])g[c[e]]&&f.push(g[c[e]]);else if(c[e])for(var h=0;h<c[e].length;h++){var k=g[c[e][h]];k&&f.push(k)}else c.helperType&&
g[c.helperType]?f.push(g[c.helperType]):g[c.name]&&f.push(g[c.name]);for(e=0;e<g._global.length;e++)h=g._global[e],h.pred(c,this)&&-1==ea(f,h.val)&&f.push(h.val);return f},getStateAfter:function(c,e){var f=this.doc;c=Math.max(f.first,Math.min(null==c?f.first+f.size-1:c,f.first+f.size-1));return Ob(this,c+1,e).state},cursorCoords:function(c,e){var f=this.doc.sel.primary();c=null==c?f.head:"object"==typeof c?C(this.doc,c):c?f.from():f.to();return Ba(this,c,e||"page")},charCoords:function(c,e){return Ic(this,
C(this.doc,c),e||"page")},coordsChar:function(c,e){c=bf(this,c,e||"page");return Kd(this,c.left,c.top)},lineAtHeight:function(c,e){c=bf(this,{top:c,left:0},e||"page").top;return bb(this.doc,c+this.display.viewOffset)},heightAtLine:function(c,e,f){var g=!1;if("number"==typeof c){var h=this.doc.first+this.doc.size-1;c<this.doc.first?c=this.doc.first:c>h&&(c=h,g=!0);c=w(this.doc,c)}return Hc(this,c,{top:0,left:0},e||"page",f||g).top+(g?this.doc.height-Ga(c):0)},defaultTextHeight:function(){return vb(this.display)},
defaultCharWidth:function(){return ub(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(c,e,f,g,h){var k=this.display;c=Ba(this,C(this.doc,c));var l=c.bottom,m=c.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(e);k.sizer.appendChild(e);if("over"==g)l=c.top;else if("above"==g||"near"==g){var n=Math.max(k.wrapper.clientHeight,this.doc.height),p=Math.max(k.sizer.clientWidth,k.lineSpace.clientWidth);
("above"==g||c.bottom+e.offsetHeight>n)&&c.top>e.offsetHeight?l=c.top-e.offsetHeight:c.bottom+e.offsetHeight<=n&&(l=c.bottom);m+e.offsetWidth>p&&(m=p-e.offsetWidth)}e.style.top=l+"px";e.style.left=e.style.right="";"right"==h?(m=k.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==h?m=0:"middle"==h&&(m=(k.sizer.clientWidth-e.offsetWidth)/2),e.style.left=m+"px");f&&(c=Td(this,{left:m,top:l,right:m+e.offsetWidth,bottom:l+e.offsetHeight}),null!=c.scrollTop&&Xb(this,c.scrollTop),null!=c.scrollLeft&&
kb(this,c.scrollLeft))},triggerOnKeyDown:ia(gg),triggerOnKeyPress:ia(ig),triggerOnKeyUp:hg,triggerOnMouseDown:ia(jg),execCommand:function(c){if(jc.hasOwnProperty(c))return jc[c].call(null,this)},triggerElectric:ia(function(c){pg(this,c)}),findPosH:function(c,e,f,g){var h=1;0>e&&(h=-1,e=-e);c=C(this.doc,c);for(var k=0;k<e&&(c=pe(this.doc,c,h,f,g),!c.hitSide);++k);return c},moveH:ia(function(c,e){var f=this;this.extendSelectionsBy(function(g){return f.display.shift||f.doc.extend||g.empty()?pe(f.doc,
g.head,c,e,f.options.rtlMoveVisually):0>c?g.from():g.to()},qc)}),deleteH:ia(function(c,e){var f=this.doc;this.doc.sel.somethingSelected()?f.replaceSelection("",null,"+delete"):Gb(this,function(g){var h=pe(f,g.head,c,e,!1);return 0>c?{from:h,to:g.head}:{from:g.head,to:h}})}),findPosV:function(c,e,f,g){var h=1;0>e&&(h=-1,e=-e);var k=C(this.doc,c);for(c=0;c<e&&(k=Ba(this,k,"div"),null==g?g=k.left:k.left=g,k=tg(this,k,h,f),!k.hitSide);++c);return k},moveV:ia(function(c,e){var f=this,g=this.doc,h=[],k=
!this.display.shift&&!g.extend&&g.sel.somethingSelected();g.extendSelectionsBy(function(m){if(k)return 0>c?m.from():m.to();var n=Ba(f,m.head,"div");null!=m.goalColumn&&(n.left=m.goalColumn);h.push(n.left);var p=tg(f,n,c,e);"page"==e&&m==g.sel.primary()&&Nc(f,Ic(f,p,"div").top-n.top);return p},qc);if(h.length)for(var l=0;l<g.sel.ranges.length;l++)g.sel.ranges[l].goalColumn=h[l]}),findWordAt:function(c){var e=w(this.doc,c.line).text,f=c.ch,g=c.ch;if(e){var h=this.getHelper(c,"wordChars");"before"!=
c.sticky&&g!=e.length||!f?++g:--f;var k=e.charAt(f);for(k=xc(k,h)?function(l){return xc(l,h)}:/\s/.test(k)?function(l){return/\s/.test(l)}:function(l){return!/\s/.test(l)&&!xc(l)};0<f&&k(e.charAt(f-1));)--f;for(;g<e.length&&k(e.charAt(g));)++g}return new I(t(c.line,f),t(c.line,g))},toggleOverwrite:function(c){if(null==c||c!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?Ya(this.display.cursorDiv,"CodeMirror-overwrite"):jb(this.display.cursorDiv,"CodeMirror-overwrite"),W(this,"overwriteToggle",
this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ka(qa(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ia(function(c,e){Wb(this,c,e)}),getScrollInfo:function(){var c=this.display.scroller;return{left:c.scrollLeft,top:c.scrollTop,height:c.scrollHeight-Ha(this)-this.display.barHeight,width:c.scrollWidth-Ha(this)-this.display.barWidth,clientHeight:Ed(this),clientWidth:cb(this)}},scrollIntoView:ia(function(c,e){null==c?(c=
{from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof c?c={from:t(c,0),to:null}:null==c.from&&(c={from:c,to:null});c.to||(c.to=c.from);c.margin=e||0;null!=c.from.line?(Oc(this),this.curOp.scrollToPos=c):lf(this,c.from,c.to,c.margin)}),setSize:ia(function(c,e){var f=this,g=function(k){return"number"==typeof k||/^\d+$/.test(String(k))?k+"px":k};null!=c&&(this.display.wrapper.style.width=g(c));null!=e&&(this.display.wrapper.style.height=g(e));this.options.lineWrapping&&
Ze(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(k){if(k.widgets)for(var l=0;l<k.widgets.length;l++)if(k.widgets[l].noHScroll){Sa(f,h,"widget");break}++h});this.curOp.forceUpdate=!0;W(this,"refresh",this)}),operation:function(c){return ra(this,c)},startOperation:function(){return lb(this)},endOperation:function(){return mb(this)},refresh:ia(function(){var c=this.display.cachedTextHeight;ma(this);this.curOp.forceUpdate=!0;Ub(this);Wb(this,this.doc.scrollLeft,this.doc.scrollTop);
Xd(this.display);(null==c||.5<Math.abs(c-vb(this.display))||this.options.lineWrapping)&&Nd(this);W(this,"refresh",this)}),swapDoc:ia(function(c){var e=this.doc;e.cm=null;this.state.selectingText&&this.state.selectingText();Af(this,c);Ub(this);this.display.input.reset();Wb(this,c.scrollLeft,c.scrollTop);this.curOp.forceScroll=!0;aa(this,"swapDoc",this,e);return e}),phrase:function(c){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,c)?e[c]:c},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}};pb(a);a.registerHelper=function(c,e,f){d.hasOwnProperty(c)||(d[c]=a[c]={_global:[]});d[c][e]=f};a.registerGlobalHelper=function(c,e,f,g){a.registerHelper(c,e,g);d[c]._global.push({pred:f,val:g})}})(U);var Ih="iter insert remove copy getEditor constructor".split(" "),uc;for(uc in oa.prototype)oa.prototype.hasOwnProperty(uc)&&
0>ea(Ih,uc)&&(U.prototype[uc]=function(a){return function(){return a.apply(this.doc,arguments)}}(oa.prototype[uc]));pb(oa);U.inputStyles={textarea:V,contenteditable:O};U.defineMode=function(a){U.defaults.mode||"null"==a||(U.defaults.mode=a);Dg.apply(this,arguments)};U.defineMIME=function(a,b){qb[a]=b};U.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}});U.defineMIME("text/plain","null");U.defineExtension=function(a,b){U.prototype[a]=b};U.defineDocExtension=function(a,b){oa.prototype[a]=
b};U.fromTextArea=function(a,b){function d(){a.value=h.getValue()}b=b?Za(b):{};b.value=a.value;!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var c=ka(a.ownerDocument);b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(z(a.form,"submit",d),!b.leaveSubmitMethodAlone)){var e=a.form;var f=e.submit;try{var g=e.submit=function(){d();e.submit=f;e.submit();e.submit=g}}catch(k){}}b.finishInit=
function(k){k.save=d;k.getTextArea=function(){return a};k.toTextArea=function(){k.toTextArea=isNaN;d();a.parentNode.removeChild(k.getWrapperElement());a.style.display="";a.form&&(ta(a.form,"submit",d),b.leaveSubmitMethodAlone||"function"!=typeof a.form.submit||(a.form.submit=f))}};a.style.display="none";var h=U(function(k){return a.parentNode.insertBefore(k,a.nextSibling)},b);return h};(function(a){a.off=ta;a.on=z;a.wheelEventPixels=Zg;a.Doc=oa;a.splitLines=ne;a.countColumn=wa;a.findColumn=hd;a.isWordChar=
jd;a.Pass=Zc;a.signal=W;a.Line=zb;a.changeEnd=Ta;a.scrollbarModel=qf;a.Pos=t;a.cmpPos=B;a.modes=md;a.mimeModes=qb;a.resolveMode=zc;a.getMode=nd;a.modeExtensions=rb;a.extendMode=Eg;a.copyState=$a;a.startState=xe;a.innerMode=od;a.commands=jc;a.keyMap=ic;a.keyName=bg;a.isModifierKey=Zf;a.lookupKey=Fb;a.normalizeKeyMap=jh;a.StringStream=X;a.SharedTextMarker=hc;a.TextMarker=Va;a.LineWidget=gc;a.e_preventDefault=la;a.e_stopPropagation=ve;a.e_stop=Mb;a.addClass=Ya;a.contains=ja;a.rmClass=jb;a.keyNames=Wa})(U);
U.version="5.65.13";return U});
// comment.js
(function(r){"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){function I(c){c=c.search(u);return-1==c?0:c}function J(c,d,a){return/\bstring\b/.test(c.getTokenTypeAt(l(d.line,0)))&&!/^['"`]/.test(a)}function G(c,d){var a=c.getMode();return!1!==a.useInnerComments&&a.innerMode?c.getModeAt(d):a}var E={},u=/[^\s\u00a0]/,l=r.Pos,K=r.cmpPos;r.commands.toggleComment=function(c){c.toggleComment()};
r.defineExtension("toggleComment",function(c){c||(c=E);for(var d=Infinity,a=this.listSelections(),b=null,e=a.length-1;0<=e;e--){var g=a[e].from(),f=a[e].to();g.line>=d||(f.line>=d&&(f=l(d,0)),d=g.line,null==b?this.uncomment(g,f,c)?b="un":(this.lineComment(g,f,c),b="line"):"un"==b?this.uncomment(g,f,c):this.lineComment(g,f,c))}});r.defineExtension("lineComment",function(c,d,a){a||(a=E);var b=this,e=G(b,c),g=b.getLine(c.line);if(null!=g&&!J(b,c,g)){var f=a.lineComment||e.lineComment;if(f){var m=Math.min(0!=
d.ch||d.line==c.line?d.line+1:d.line,b.lastLine()+1),v=null==a.padding?" ":a.padding,k=a.commentBlankLines||c.line==d.line;b.operation(function(){if(a.indent){for(var q=null,h=c.line;h<m;++h){var n=b.getLine(h);n=-1===n.search(u)?n:n.slice(0,I(n));if(null==q||q.length>n.length)q=n}for(h=c.line;h<m;++h){n=b.getLine(h);var t=q.length;if(k||u.test(n))n.slice(0,t)!=q&&(t=I(n)),b.replaceRange(q+f+v,l(h,0),l(h,t))}}else for(h=c.line;h<m;++h)(k||u.test(b.getLine(h)))&&b.replaceRange(f+v,l(h,0))})}else if(a.blockCommentStart||
e.blockCommentStart)a.fullLines=!0,b.blockComment(c,d,a)}});r.defineExtension("blockComment",function(c,d,a){a||(a=E);var b=this,e=G(b,c),g=a.blockCommentStart||e.blockCommentStart,f=a.blockCommentEnd||e.blockCommentEnd;if(!g||!f)(a.lineComment||e.lineComment)&&0!=a.fullLines&&b.lineComment(c,d,a);else if(!/\bcomment\b/.test(b.getTokenTypeAt(l(c.line,0)))){var m=Math.min(d.line,b.lastLine());m!=c.line&&0==d.ch&&u.test(b.getLine(m))&&--m;var v=null==a.padding?" ":a.padding;c.line>m||b.operation(function(){if(0!=
a.fullLines){var k=u.test(b.getLine(m));b.replaceRange(v+f,l(m));b.replaceRange(g+v,l(c.line,0));var q=a.blockCommentLead||e.blockCommentLead;if(null!=q)for(var h=c.line+1;h<=m;++h)(h!=m||k)&&b.replaceRange(q+v,l(h,0))}else k=0==K(b.getCursor("to"),d),q=!b.somethingSelected(),b.replaceRange(f,d),k&&b.setSelection(q?d:b.getCursor("from"),d),b.replaceRange(g,c)})}});r.defineExtension("uncomment",function(c,d,a){a||(a=E);var b=this,e=G(b,c),g=Math.min(0!=d.ch||d.line==c.line?d.line:d.line-1,b.lastLine()),
f=Math.min(c.line,g),m=a.lineComment||e.lineComment,v=[],k=null==a.padding?" ":a.padding,q;a:if(m){for(var h=f;h<=g;++h){var n=b.getLine(h),t=n.indexOf(m);-1<t&&!/comment/.test(b.getTokenTypeAt(l(h,t+1)))&&(t=-1);if(-1==t&&u.test(n))break a;if(-1<t&&u.test(n.slice(0,t)))break a;v.push(n)}b.operation(function(){for(var p=f;p<=g;++p){var A=v[p-f],x=A.indexOf(m),w=x+m.length;0>x||(A.slice(w,w+k.length)==k&&(w+=k.length),q=!0,b.replaceRange("",l(p,x),l(p,w)))}});if(q)return!0}var y=a.blockCommentStart||
e.blockCommentStart,z=a.blockCommentEnd||e.blockCommentEnd;if(!y||!z)return!1;var H=a.blockCommentLead||e.blockCommentLead,C=b.getLine(f),D=C.indexOf(y);if(-1==D)return!1;var F=g==f?C:b.getLine(g),B=F.indexOf(z,g==f?D+y.length:0);a=l(f,D+1);e=l(g,B+1);if(-1==B||!/comment/.test(b.getTokenTypeAt(a))||!/comment/.test(b.getTokenTypeAt(e))||-1<b.getRange(a,e,"\n").indexOf(z))return!1;e=C.lastIndexOf(y,c.ch);a=-1==e?-1:C.slice(0,c.ch).indexOf(z,e+y.length);if(-1!=e&&-1!=a&&a+z.length!=c.ch)return!1;a=F.indexOf(z,
d.ch);c=F.slice(d.ch).lastIndexOf(y,a-d.ch);e=-1==a||-1==c?-1:d.ch+c;if(-1!=a&&-1!=e&&e!=d.ch)return!1;b.operation(function(){b.replaceRange("",l(g,B-(k&&F.slice(B-k.length,B)==k?k.length:0)),l(g,B+z.length));var p=D+y.length;k&&C.slice(p,p+k.length)==k&&(p+=k.length);b.replaceRange("",l(f,D),l(f,p));if(H)for(p=f+1;p<=g;++p){var A=b.getLine(p),x=A.indexOf(H);if(-1!=x&&!u.test(A.slice(0,x))){var w=x+H.length;k&&A.slice(w,w+k.length)==k&&(w+=k.length);b.replaceRange("",l(p,x),l(p,w))}}});return!0})});
// continuecomment.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,c,b){if(null==a)throw new TypeError("The 'this' value for String.prototype."+b+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+b+" must not be a regular expression");return a+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){if(a==Array.prototype||a==Object.prototype)return a;a[c]=b.value;return a};
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var c=0;c<a.length;++c){var b=a[c];if(b&&b.Math==Math)return b}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,c){var b=$jscomp.propertyToPolyfillSymbol[c];if(null==b)return a[c];b=a[b];return void 0!==b?b:a[c]};$jscomp.polyfill=function(a,c,b,e){c&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,c,b,e):$jscomp.polyfillUnisolated(a,c,b,e))};
$jscomp.polyfillUnisolated=function(a,c,b,e){b=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var g=a[e];if(!(g in b))return;b=b[g]}a=a[a.length-1];e=b[a];c=c(e);c!=e&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})};
$jscomp.polyfillIsolated=function(a,c,b,e){var g=a.split(".");a=1===g.length;e=g[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var r=0;r<g.length-1;r++){var d=g[r];if(!(d in e))return;e=e[d]}g=g[g.length-1];b=$jscomp.IS_SYMBOL_NATIVE&&"es6"===b?e[g]:null;c=c(b);null!=c&&(a?$jscomp.defineProperty($jscomp.polyfills,g,{configurable:!0,writable:!0,value:c}):c!==b&&(void 0===$jscomp.propertyToPolyfillSymbol[g]&&(b=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[g]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(g):$jscomp.POLYFILL_PREFIX+b+"$"+g),$jscomp.defineProperty(e,$jscomp.propertyToPolyfillSymbol[g],{configurable:!0,writable:!0,value:c})))};$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(c){var b=$jscomp.checkStringArgs(this,null,"repeat");if(0>c||1342177279<c)throw new RangeError("Invalid count value");c|=0;for(var e="";c;)if(c&1&&(e+=b),c>>>=1)b+=b;return e}},"es6","es3");
(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){function c(d){if(d.getOption("disableInput"))return a.Pass;for(var k=d.listSelections(),h,w=[],u=0;u<k.length;u++){var l=k[u].head;if(!/\bcomment\b/.test(d.getTokenTypeAt(l)))return a.Pass;var p=d.getModeAt(l);if(!h)h=p;else if(h!=p)return a.Pass;var m=null,f,q=h.blockCommentStart;p=h.lineComment;if(q&&
h.blockCommentContinue){var n=d.getLine(l.line);var v=n.lastIndexOf(h.blockCommentEnd,l.ch-h.blockCommentEnd.length);if(!(-1!=v&&v==l.ch-h.blockCommentEnd.length||p&&-1<(f=n.lastIndexOf(p,l.ch-1))&&/\bcomment\b/.test(d.getTokenTypeAt({line:l.line,ch:f+1}))))if(l.ch>=q.length&&-1<(f=n.lastIndexOf(q,l.ch-q.length))&&f>v)if(b(0,n)>=f)m=n.slice(0,f);else{q=d.options.tabSize;var x;f=a.countColumn(n,f,q);m=d.options.indentWithTabs?r.call("\t",x=Math.floor(f/q))+r.call(" ",f-q*x):r.call(" ",f)}else-1<(f=
n.indexOf(h.blockCommentContinue))&&f<=l.ch&&f<=b(0,n)&&(m=n.slice(0,f));null!=m&&(m+=h.blockCommentContinue)}null==m&&p&&e(d)&&((null==n&&(n=d.getLine(l.line)),f=n.indexOf(p),l.ch||f)?-1<f&&b(0,n)>=f&&(m=-1<b(l.ch,n),m||(l=d.getLine(l.line+1)||"",m=l.indexOf(p),m=-1<m&&b(0,l)>=m||null),m&&(m=n.slice(0,f)+p+n.slice(f+p.length).match(/^\s*/)[0])):m="");if(null==m)return a.Pass;w[u]="\n"+m}d.operation(function(){for(var t=k.length-1;0<=t;t--)d.replaceRange(w[t],k[t].from(),k[t].to(),"+insert")})}function b(d,
k){g.lastIndex=d;return(d=g.exec(k))?d.index:-1}function e(d){return(d=d.getOption("continueComments"))&&"object"==typeof d?!1!==d.continueLineComment:!0}var g=/\S/g,r=String.prototype.repeat||function(d){return Array(d+1).join(this)};a.defineOption("continueComments",null,function(d,k,h){h&&h!=a.Init&&d.removeKeyMap("continueComment");k&&(h="Enter","string"==typeof k?h=k:"object"==typeof k&&k.key&&(h=k.key),k={name:"continueComment"},k[h]=c,d.addKeyMap(k))})});
// closebrackets.js
(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function u(a,b){return"pairs"==b&&"string"==typeof a?a:"object"==typeof a&&null!=a[b]?a[b]:C[b]}function D(a){for(var b=0;b<a.length;b++){var c=a.charAt(b),d="'"+c+"'";x[d]||(x[d]=H(c))}}function H(a){return function(b){return I(b,a)}}function y(a){var b=a.state.closeBrackets;return!b||b.override?b:a.getModeAt(a.getCursor()).closeBrackets||
b}function v(a,b){for(var c=[],d=a.listSelections(),g=0,k=0;k<d.length;k++){var h=d[k];h.head==a.getCursor()&&(g=k);h=h.head.ch||0<b?{line:h.head.line,ch:h.head.ch+b}:{line:h.head.line-1};c.push({anchor:h,head:h})}a.setSelections(c,g)}function I(a,b){var c=y(a);if(!c||a.getOption("disableInput"))return e.Pass;var d=u(c,"pairs"),g=d.indexOf(b);if(-1==g)return e.Pass;var k=u(c,"closeBefore");c=u(c,"triples");for(var h=d.charAt(g+1)==b,E=a.listSelections(),z=0==g%2,q,A=0;A<E.length;A++){var w=E[A],f=
w.head;var m=a.getRange(f,l(f.line,f.ch+1));if(z&&!w.empty())m="surround";else if(!h&&z||m!=b)if(h&&1<f.ch&&0<=c.indexOf(b)&&a.getRange(l(f.line,f.ch-2),f)==b+b){if(2<f.ch&&/\bstring/.test(a.getTokenTypeAt(l(f.line,f.ch-2))))return e.Pass;m="addFour"}else if(h){w=0==f.ch?" ":a.getRange(l(f.line,f.ch-1),f);if(e.isWordChar(m)||w==b||e.isWordChar(w))return e.Pass;m="both"}else if(z&&(0===m.length||/\s/.test(m)||-1<k.indexOf(m)))m="both";else return e.Pass;else m=h&&J(a,f)?"both":0<=c.indexOf(b)&&a.getRange(f,
l(f.line,f.ch+3))==b+b+b?"skipThree":"skip";if(!q)q=m;else if(q!=m)return e.Pass}var t=g%2?d.charAt(g-1):b,B=g%2?b:d.charAt(g+1);a.operation(function(){if("skip"==q)v(a,1);else if("skipThree"==q)v(a,3);else if("surround"==q){for(var n=a.getSelections(),p=0;p<n.length;p++)n[p]=t+n[p]+B;a.replaceSelections(n,"around");n=a.listSelections().slice();for(p=0;p<n.length;p++){var K=n,L=p;var r=n[p];var F=0<e.cmpPos(r.anchor,r.head);r={anchor:new l(r.anchor.line,r.anchor.ch+(F?-1:1)),head:new l(r.head.line,
r.head.ch+(F?1:-1))};K[L]=r}a.setSelections(n)}else"both"==q?(a.replaceSelection(t+B,null),a.triggerElectric(t+B),v(a,-1)):"addFour"==q&&(a.replaceSelection(t+t+t+t,"before"),v(a,1))})}function G(a,b){a=a.getRange(l(b.line,b.ch-1),l(b.line,b.ch+1));return 2==a.length?a:null}function J(a,b){var c=a.getTokenAt(l(b.line,b.ch+1));return/\bstring/.test(c.type)&&c.start==b.ch&&(0==b.ch||!/\bstring/.test(a.getTokenTypeAt(b)))}var C={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},
l=e.Pos;e.defineOption("autoCloseBrackets",!1,function(a,b,c){c&&c!=e.Init&&(a.removeKeyMap(x),a.state.closeBrackets=null);b&&(D(u(b,"pairs")),a.state.closeBrackets=b,a.addKeyMap(x))});var x={Backspace:function(a){var b=y(a);if(!b||a.getOption("disableInput"))return e.Pass;var c=u(b,"pairs");b=a.listSelections();for(var d=0;d<b.length;d++){if(!b[d].empty())return e.Pass;var g=G(a,b[d].head);if(!g||0!=c.indexOf(g)%2)return e.Pass}for(d=b.length-1;0<=d;d--)c=b[d].head,a.replaceRange("",l(c.line,c.ch-
1),l(c.line,c.ch+1),"+delete")},Enter:function(a){var b=y(a);b=b&&u(b,"explode");if(!b||a.getOption("disableInput"))return e.Pass;for(var c=a.listSelections(),d=0;d<c.length;d++){if(!c[d].empty())return e.Pass;var g=G(a,c[d].head);if(!g||0!=b.indexOf(g)%2)return e.Pass}a.operation(function(){var k=a.lineSeparator()||"\n";a.replaceSelection(k+k,null);v(a,-1);c=a.listSelections();for(k=0;k<c.length;k++){var h=c[k].head.line;a.indentLine(h,null,!0);a.indentLine(h+1,null,!0)}})}};D(C.pairs+"`")});
// matchbrackets.js
(function(k){"object"==typeof exports&&"object"==typeof module?k(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],k):k(CodeMirror)})(function(k){function v(a,c,b){var f=a.getLineHandle(c.line),d=c.ch-1,g=b&&b.afterCursor;null==g&&(g=/(^| )cm-fat-cursor($| )/.test(a.getWrapperElement().className));var h=b&&b.bracketRegex||/[(){}[\]]/;f=!g&&0<=d&&h.test(f.text.charAt(d))&&t[f.text.charAt(d)]||h.test(f.text.charAt(d+1))&&t[f.text.charAt(++d)];if(!f)return null;
g=">"==f.charAt(1)?1:-1;if(b&&b.strict&&0<g!=(d==c.ch))return null;h=a.getTokenTypeAt(p(c.line,d+1));a=w(a,p(c.line,d+(0<g?1:0)),g,h,b);return null==a?null:{from:p(c.line,d),to:a&&a.pos,match:a&&a.ch==f.charAt(0),forward:0<g}}function w(a,c,b,f,d){var g=d&&d.maxScanLineLength||1E4,h=d&&d.maxScanLines||1E3,m=[];d=d&&d.bracketRegex||/[(){}[\]]/;h=0<b?Math.min(c.line+h,a.lastLine()+1):Math.max(a.firstLine()-1,c.line-h);for(var e=c.line;e!=h;e+=b){var n=a.getLine(e);if(n){var l=0<b?0:n.length-1,z=0<b?
n.length:-1;if(!(n.length>g))for(e==c.line&&(l=c.ch-(0>b?1:0));l!=z;l+=b){var q=n.charAt(l);if(d.test(q)&&(void 0===f||(a.getTokenTypeAt(p(e,l+1))||"")==(f||""))){var x=t[q];if(x&&">"==x.charAt(1)==0<b)m.push(q);else if(m.length)m.pop();else return{pos:p(e,l),ch:q}}}}}return e-b==(0<b?a.lastLine():a.firstLine())?!1:null}function y(a,c,b){for(var f=a.state.matchBrackets.maxHighlightLineLength||1E3,d=b&&b.highlightNonMatching,g=[],h=a.listSelections(),m=0;m<h.length;m++){var e=h[m].empty()&&v(a,h[m].head,
b);if(e&&(e.match||!1!==d)&&a.getLine(e.from.line).length<=f){var n=e.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";g.push(a.markText(e.from,p(e.from.line,e.from.ch+1),{className:n}));e.to&&a.getLine(e.to.line).length<=f&&g.push(a.markText(e.to,p(e.to.line,e.to.ch+1),{className:n}))}}if(g.length)if(A&&a.state.focused&&a.focus(),b=function(){a.operation(function(){for(var l=0;l<g.length;l++)g[l].clear()})},c)setTimeout(b,800);else return b}function r(a){a.operation(function(){a.state.matchBrackets.currentlyHighlighted&&
(a.state.matchBrackets.currentlyHighlighted(),a.state.matchBrackets.currentlyHighlighted=null);a.state.matchBrackets.currentlyHighlighted=y(a,!1,a.state.matchBrackets)})}function u(a){a.state.matchBrackets&&a.state.matchBrackets.currentlyHighlighted&&(a.state.matchBrackets.currentlyHighlighted(),a.state.matchBrackets.currentlyHighlighted=null)}var A=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),p=k.Pos,t={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<",
"<":">>",">":"<<"};k.defineOption("matchBrackets",!1,function(a,c,b){b&&b!=k.Init&&(a.off("cursorActivity",r),a.off("focus",r),a.off("blur",u),u(a));c&&(a.state.matchBrackets="object"==typeof c?c:{},a.on("cursorActivity",r),a.on("focus",r),a.on("blur",u))});k.defineExtension("matchBrackets",function(){y(this,!0)});k.defineExtension("findMatchingBracket",function(a,c,b){if(b||"boolean"==typeof c)b?(b.strict=c,c=b):c=c?{strict:!0}:null;return v(this,a,c)});k.defineExtension("scanForBracket",function(a,
c,b,f){return w(this,a,c,b,f)})});
// closetag.js
(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],g):g(CodeMirror)})(function(g){function w(b){if(b.getOption("disableInput"))return g.Pass;for(var f=b.listSelections(),d=[],c=b.getOption("autoCloseTags"),h=0;h<f.length;h++){if(!f[h].empty())return g.Pass;var e=f[h].head,a=b.getTokenAt(e),m=g.innerMode(b.getMode(),a.state),n=m.state,k=
m.mode.xmlCurrentTag&&m.mode.xmlCurrentTag(n),l=k&&k.name;if(!l)return g.Pass;var p="html"==m.mode.configuration,r="object"==typeof c&&c.dontCloseTags||p&&x;p="object"==typeof c&&c.indentTags||p&&y;a.end>e.ch&&(l=l.slice(0,l.length-a.end+e.ch));var t=l.toLowerCase();if(!l||"string"==a.type&&(a.end!=e.ch||!/["']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&k.close||a.string.indexOf("/")==e.ch-a.start-1||r&&-1<q(r,t)||u(b,m.mode.xmlCurrentContext&&m.mode.xmlCurrentContext(n)||
[],l,e,!0))return g.Pass;(a="object"==typeof c&&c.emptyTags)&&-1<q(a,l)?d[h]={text:"/>",newPos:g.Pos(e.line,e.ch+2)}:(a=p&&-1<q(p,t),d[h]={indent:a,text:">"+(a?"\n\n":"")+"</"+l+">",newPos:a?g.Pos(e.line+1,0):g.Pos(e.line,e.ch+1)})}c="object"==typeof c&&c.dontIndentOnAutoClose;for(h=f.length-1;0<=h;h--)e=d[h],b.replaceRange(e.text,f[h].head,f[h].anchor,"+insert"),l=b.listSelections().slice(0),l[h]={head:e.newPos,anchor:e.newPos},b.setSelections(l),!c&&e.indent&&(b.indentLine(e.newPos.line,null,!0),
b.indentLine(e.newPos.line+1,null,!0))}function v(b,f){var d=b.listSelections(),c=[],h=f?"/":"</",e=b.getOption("autoCloseTags");e="object"==typeof e&&e.dontIndentOnSlash;for(var a=0;a<d.length;a++){if(!d[a].empty())return g.Pass;var m=d[a].head,n=b.getTokenAt(m),k=g.innerMode(b.getMode(),n.state),l=k.state;if(f&&("string"==n.type||"<"!=n.string.charAt(0)||n.start!=m.ch-1))return g.Pass;var p="xml"!=k.mode.name&&"htmlmixed"==b.getMode().name;if(p&&"javascript"==k.mode.name)k=h+"script";else if(p&&
"css"==k.mode.name)k=h+"style";else{k=k.mode.xmlCurrentContext&&k.mode.xmlCurrentContext(l);l=k.length?k[k.length-1]:"";if(!k||k.length&&u(b,k,l,m))return g.Pass;k=h+l}">"!=b.getLine(m.line).charAt(n.end)&&(k+=">");c[a]=k}b.replaceSelections(c);d=b.listSelections();if(!e)for(a=0;a<d.length;a++)(a==d.length-1||d[a].head.line<d[a+1].head.line)&&b.indentLine(d[a].head.line)}function q(b,f){if(b.indexOf)return b.indexOf(f);for(var d=0,c=b.length;d<c;++d)if(b[d]==f)return d;return-1}function u(b,f,d,c,
h){if(!g.scanForClosingTag)return!1;var e=Math.min(b.lastLine()+1,c.line+500);c=g.scanForClosingTag(b,c,null,e);if(!c||c.tag!=d)return!1;h=h?1:0;for(var a=f.length-1;0<=a;a--)if(f[a]==d)++h;else break;c=c.to;for(a=1;a<h;a++){f=g.scanForClosingTag(b,c,null,e);if(!f||f.tag!=d)return!1;c=f.to}return!0}g.defineOption("autoCloseTags",!1,function(b,f,d){d!=g.Init&&d&&b.removeKeyMap("autoCloseTags");if(f){d={name:"autoCloseTags"};if("object"!=typeof f||!1!==f.whenClosing)d["'/'"]=function(c){c=c.getOption("disableInput")?
g.Pass:v(c,!0);return c};if("object"!=typeof f||!1!==f.whenOpening)d["'>'"]=function(c){return w(c)};b.addKeyMap(d)}});var x="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),y="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".split(" ");g.commands.closeTag=function(b){return v(b)}});
// show-hint.js
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function B(a,b){this.cm=a;this.options=b;this.widget=null;this.tick=this.debounce=0;this.startPos=this.cm.getCursor("start");this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;if(this.options.updateOnCursorActivity){var c=this;a.on("cursorActivity",this.activityFunc=
function(){c.cursorActivity()})}}function K(a,b){function c(r,g){var m="string"!=typeof g?function(k){return g(k,b)}:d.hasOwnProperty(g)?d[g]:g;p[r]=m}var d={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close};/Mac/.test(navigator.platform)&&(d["Ctrl-P"]=function(){b.moveFocus(-1)},
d["Ctrl-N"]=function(){b.moveFocus(1)});var e=a.options.customKeys,p=e?{}:d;if(e)for(var f in e)e.hasOwnProperty(f)&&c(f,e[f]);if(a=a.options.extraKeys)for(f in a)a.hasOwnProperty(f)&&c(f,a[f]);return p}function C(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function D(a,b){this.id="cm-complete-"+Math.floor(Math.random(1E6));this.completion=a;this.data=b;this.picked=!1;var c=this,d=a.cm,e=d.getInputField().ownerDocument,p=e.defaultView||e.parentWindow,
f=this.hints=e.createElement("ul");f.setAttribute("role","listbox");f.setAttribute("aria-expanded","true");f.id=this.id;f.className="CodeMirror-hints "+a.cm.options.theme;this.selectedHint=b.selectedHint||0;for(var r=b.list,g=0;g<r.length;++g){var m=f.appendChild(e.createElement("li")),k=r[g],q="CodeMirror-hint"+(g!=this.selectedHint?"":" CodeMirror-hint-active");null!=k.className&&(q=k.className+" "+q);m.className=q;g==this.selectedHint&&m.setAttribute("aria-selected","true");m.id=this.id+"-"+g;
m.setAttribute("role","option");k.render?k.render(m,b,k):m.appendChild(e.createTextNode(k.displayText||("string"==typeof k?k:k.text)));m.hintId=g}var n=a.options.container||e.body;g=d.cursorCoords(a.options.alignWithWord?b.from:null);var w=g.left,x=g.bottom,E=!0;q=m=0;if(n!==e.body){k=-1!==["absolute","relative","fixed"].indexOf(p.getComputedStyle(n).position)?n:n.offsetParent;q=k.getBoundingClientRect();var t=e.body.getBoundingClientRect();m=q.left-t.left-k.scrollLeft;q=q.top-t.top-k.scrollTop}f.style.left=
w-m+"px";f.style.top=x-q+"px";k=p.innerWidth||Math.max(e.body.offsetWidth,e.documentElement.offsetWidth);t=p.innerHeight||Math.max(e.body.offsetHeight,e.documentElement.offsetHeight);n.appendChild(f);d.getInputField().setAttribute("aria-autocomplete","list");d.getInputField().setAttribute("aria-owns",this.id);d.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);n=a.options.moveOnOverlap?f.getBoundingClientRect():new DOMRect;var F=a.options.paddingForScrollbar?f.scrollHeight>
f.clientHeight+1:!1,u;setTimeout(function(){u=d.getScrollInfo()});if(0<n.bottom-t){var y=n.bottom-n.top,z=n.top-(g.bottom-g.top)-2;t-n.top<z?(y>z&&(f.style.height=(y=z)+"px"),f.style.top=(x=g.top-y)+q+"px",E=!1):f.style.height=t-n.top-2+"px"}q=n.right-k;F&&(q+=d.display.nativeBarWidth);0<q&&(n.right-n.left>k&&(f.style.width=k-5+"px",q-=n.right-n.left-k),f.style.left=(w=Math.max(g.left-q-m,0))+"px");if(F)for(g=f.firstChild;g;g=g.nextSibling)g.style.paddingRight=d.display.nativeBarWidth+"px";d.addKeyMap(this.keyMap=
K(a,{moveFocus:function(l,v){c.changeActive(c.selectedHint+l,v)},setFocus:function(l){c.changeActive(l)},menuSize:function(){return c.screenAmount()},length:r.length,close:function(){a.close()},pick:function(){c.pick()},data:b}));if(a.options.closeOnUnfocus){var G;d.on("blur",this.onBlur=function(){G=setTimeout(function(){a.close()},100)});d.on("focus",this.onFocus=function(){clearTimeout(G)})}d.on("scroll",this.onScroll=function(){var l=d.getScrollInfo(),v=d.getWrapperElement().getBoundingClientRect();
u||(u=d.getScrollInfo());var H=x+u.top-l.top,A=H-(p.pageYOffset||(e.documentElement||e.body).scrollTop);E||(A+=f.offsetHeight);if(A<=v.top||A>=v.bottom)return a.close();f.style.top=H+"px";f.style.left=w+u.left-l.left+"px"});h.on(f,"dblclick",function(l){(l=C(f,l.target||l.srcElement))&&null!=l.hintId&&(c.changeActive(l.hintId),c.pick())});h.on(f,"click",function(l){(l=C(f,l.target||l.srcElement))&&null!=l.hintId&&(c.changeActive(l.hintId),a.options.completeOnSingleClick&&c.pick())});h.on(f,"mousedown",
function(){setTimeout(function(){d.focus()},20)});g=this.getSelectedHintRange();0===g.from&&0===g.to||this.scrollToActive();h.signal(b,"select",r[this.selectedHint],f.childNodes[this.selectedHint]);return!0}function L(a,b){if(!a.somethingSelected())return b;a=[];for(var c=0;c<b.length;c++)b[c].supportsSelection&&a.push(b[c]);return a}function I(a,b,c,d){a.async?a(b,d,c):(a=a(b,c))&&a.then?a.then(d):d(a)}h.showHint=function(a,b,c){if(!b)return a.showHint(c);c&&c.async&&(b.async=!0);b={hint:b};if(c)for(var d in c)b[d]=
c[d];return a.showHint(b)};h.defineExtension("showHint",function(a){var b=this.getCursor("start"),c=this.options.hintOptions,d={},e;for(e in J)d[e]=J[e];if(c)for(e in c)void 0!==c[e]&&(d[e]=c[e]);if(a)for(e in a)void 0!==a[e]&&(d[e]=a[e]);d.hint.resolve&&(d.hint=d.hint.resolve(this,b));a=d;b=this.listSelections();if(!(1<b.length)){if(this.somethingSelected()){if(!a.hint.supportsSelection)return;for(e=0;e<b.length;e++)if(b[e].head.line!=b[e].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();
b=this.state.completionActive=new B(this,a);b.options.hint&&(h.signal(this,"startCompletion",this),b.update(!0))}});h.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});var M=window.requestAnimationFrame||function(a){return setTimeout(a,1E3/60)},N=window.cancelAnimationFrame||clearTimeout;B.prototype={close:function(){this.active()&&(this.tick=this.cm.state.completionActive=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",
this.activityFunc),this.widget&&this.data&&h.signal(this.data,"close"),this.widget&&this.widget.close(),h.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(a,b){var c=a.list[b],d=this;this.cm.operation(function(){c.hint?c.hint(d.cm,a,c):d.cm.replaceRange("string"==typeof c?c:c.text,c.from||a.from,c.to||a.to,"complete");h.signal(a,"pick",c);d.cm.scrollIntoView()});this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&
(N(this.debounce),this.debounce=0);var a=this.startPos;this.data&&(a=this.data.from);var b=this.cm.getCursor(),c=this.cm.getLine(b.line);if(b.line!=this.startPos.line||c.length-b.ch!=this.startLen-this.startPos.ch||b.ch<a.ch||this.cm.somethingSelected()||!b.ch||this.options.closeCharacters.test(c.charAt(b.ch-1)))this.close();else{var d=this;this.debounce=M(function(){d.update()});this.widget&&this.widget.disable()}},update:function(a){if(null!=this.tick){var b=this,c=++this.tick;I(this.options.hint,
this.cm,this.options,function(d){b.tick==c&&b.finishUpdate(d,a)})}},finishUpdate:function(a,b){this.data&&h.signal(this.data,"update");b=this.widget&&this.widget.picked||b&&this.options.completeSingle;this.widget&&this.widget.close();(this.data=a)&&a.list.length&&(b&&1==a.list.length?this.pick(a,0):(this.widget=new D(this,a),h.signal(a,"shown")))}};D.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null;this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);var a=this.completion.cm.getInputField();a.removeAttribute("aria-activedescendant");a.removeAttribute("aria-owns");a=this.completion.cm;this.completion.options.closeOnUnfocus&&(a.off("blur",this.onBlur),a.off("focus",this.onFocus));a.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var a=this;this.keyMap={Enter:function(){a.picked=!0}};this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,
this.selectedHint)},changeActive:function(a,b){a>=this.data.list.length?a=b?this.data.list.length-1:0:0>a&&(a=b?0:this.data.list.length-1);if(this.selectedHint!=a){if(b=this.hints.childNodes[this.selectedHint])b.className=b.className.replace(" CodeMirror-hint-active",""),b.removeAttribute("aria-selected");b=this.hints.childNodes[this.selectedHint=a];b.className+=" CodeMirror-hint-active";b.setAttribute("aria-selected","true");this.completion.cm.getInputField().setAttribute("aria-activedescendant",
b.id);this.scrollToActive();h.signal(this.data,"select",this.data.list[this.selectedHint],b)}},scrollToActive:function(){var a=this.getSelectedHintRange(),b=this.hints.childNodes[a.from];a=this.hints.childNodes[a.to];var c=this.hints.firstChild;b.offsetTop<this.hints.scrollTop?this.hints.scrollTop=b.offsetTop-c.offsetTop:a.offsetTop+a.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=a.offsetTop+a.offsetHeight-this.hints.clientHeight+c.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/
this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var a=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-a),to:Math.min(this.data.list.length-1,this.selectedHint+a)}}};h.registerHelper("hint","auto",{resolve:function(a,b){var c=a.getHelpers(b,"hint"),d;return c.length?(a=function(e,p,f){function r(m){if(m==g.length)return p(null);I(g[m],e,f,function(k){k&&0<k.list.length?p(k):r(m+1)})}var g=L(e,c);r(0)},a.async=!0,a.supportsSelection=!0,a):(d=
a.getHelper(a.getCursor(),"hintWords"))?function(e){return h.hint.fromList(e,{words:d})}:h.hint.anyword?function(e,p){return h.hint.anyword(e,p)}:function(){}}});h.registerHelper("hint","fromList",function(a,b){var c=a.getCursor(),d=a.getTokenAt(c);a=h.Pos(c.line,d.start);d.start<c.ch&&/\w/.test(d.string.charAt(c.ch-d.start-1))?d=d.string.substr(0,c.ch-d.start):(d="",a=c);for(var e=[],p=0;p<b.words.length;p++){var f=b.words[p];f.slice(0,d.length)==d&&e.push(f)}if(e.length)return{list:e,from:a,to:c}});
h.commands.autocomplete=h.showHint;var J={hint:h.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};h.defineOption("hintOptions",null)});
// css-hint.js
(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],b):b(CodeMirror)})(function(b){var n={active:1,after:1,before:1,checked:1,"default":1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,
not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};b.registerHelper("hint","css",function(d){function f(p){for(var m in p)h&&0!=m.lastIndexOf(h,0)||k.push(m)}var e=d.getCursor(),c=d.getTokenAt(e),a=b.innerMode(d.getMode(),c.state);if("css"==a.mode.name){if("keyword"==c.type&&0=="!important".indexOf(c.string))return{list:["!important"],
from:b.Pos(e.line,c.start),to:b.Pos(e.line,c.end)};d=c.start;var l=e.ch,h=c.string.slice(0,l-d);/[^\w$_-]/.test(h)&&(h="",d=l=e.ch);var g=b.resolveMode("text/css"),k=[];a=a.state.state;if("pseudo"==a||"variable-3"==c.type)f(n);else if("block"==a||"maybeprop"==a)f(g.propertyKeywords);else if("prop"==a||"parens"==a||"at"==a||"params"==a)f(g.valueKeywords),f(g.colorKeywords);else if("media"==a||"media_parens"==a)f(g.mediaTypes),f(g.mediaFeatures);if(k.length)return{list:k,from:b.Pos(e.line,d),to:b.Pos(e.line,
l)}}})});
// html-hint.js
(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],b):b(CodeMirror)})(function(b){function q(h){for(var c in k)k.hasOwnProperty(c)&&(h.attrs[c]=k[c])}var f="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),
e=["_blank","_self","_top","_parent"],l=["ascii","utf-8","utf-16","latin1","latin1"],m=["get","post","put","delete"],n=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g="all;screen;print;embossed;braille;handheld;print;projection;screen;tty;tv;speech;3d-glasses;resolution [>][<][=] [X];device-aspect-ratio: X/Y;orientation:portrait;orientation:landscape;device-height: [X];device-width: [X]".split(";"),a={attrs:{}},d={a:{attrs:{href:null,ping:null,type:null,media:g,target:e,
hreflang:f}},abbr:a,acronym:a,address:a,applet:a,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:g,hreflang:f,type:null,shape:["default","rect","circle","poly"]}},article:a,aside:a,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:a,base:{attrs:{href:null,target:e}},basefont:a,bdi:a,bdo:a,big:a,blockquote:{attrs:{cite:null}},body:a,br:a,
button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:n,formmethod:m,formnovalidate:["","novalidate"],formtarget:e,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:a,center:a,cite:a,code:a,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},
data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:a,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:a,dir:a,div:a,dialog:{attrs:{open:null}},dl:a,dt:a,em:a,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:a,figure:a,font:a,footer:a,form:{attrs:{action:null,name:null,"accept-charset":l,
autocomplete:["on","off"],enctype:n,method:m,novalidate:["","novalidate"],target:e}},frame:a,frameset:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,head:{attrs:{},children:"title base link style meta script noscript command".split(" ")},header:a,hgroup:a,hr:a,html:{attrs:{manifest:null},children:["head","body"]},i:a,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,
src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:n,formmethod:m,formnovalidate:["","novalidate"],
formtarget:e,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:"hidden text search tel url email password datetime date month week time datetime-local number range color checkbox radio file submit image reset button".split(" ")}},ins:{attrs:{cite:null,datetime:null}},kbd:a,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:a,li:{attrs:{value:null}},link:{attrs:{href:null,
type:null,hreflang:f,media:g,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:a,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:l,name:"viewport application-name author description generator keywords".split(" "),"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:a,noframes:a,noscript:a,object:{attrs:{data:null,
type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:a,param:{attrs:{name:null,value:null}},pre:a,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:a,rt:a,ruby:a,s:a,samp:a,
script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:l}},section:a,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:a,source:{attrs:{src:null,type:null,media:null}},span:a,strike:a,strong:a,style:{attrs:{type:["text/css"],media:g,scoped:null}},sub:a,summary:a,sup:a,table:a,tbody:a,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,
name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:a,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:a,time:{attrs:{datetime:null}},title:a,tr:a,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:f}},tt:a,u:a,ul:a,"var":a,video:{attrs:{src:null,poster:null,
width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:a},k={accesskey:"abcdefghijklmnopqrstuvwxyz0123456789".split(""),"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,
itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],autocorrect:["true","false"],autocapitalize:["true","false"],style:null,tabindex:"123456789".split(""),title:null,translate:["yes","no"],onclick:null,rel:"stylesheet alternate author bookmark help license next nofollow noreferrer prefetch prev search tag".split(" ")};q(a);for(var p in d)d.hasOwnProperty(p)&&d[p]!=a&&q(d[p]);b.htmlSchema=d;b.registerHelper("hint","html",function(h,c){var r={schemaInfo:d};
if(c)for(var t in c)r[t]=c[t];return b.hint.xml(h,r)})});
// xml-hint.js
(function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)})(function(n){function q(d,b,v){return v?0<=d.indexOf(b):0==d.lastIndexOf(b,0)}var w=n.Pos;n.registerHelper("hint","xml",function(d,b){function v(){return{list:p,from:r?w(k.line,null==z?a.start:z):k,to:r?w(k.line,a.end):k}}var c=b&&b.schemaInfo,t=b&&b.quoteChar||'"',u=b&&b.matchInMiddle;if(c){var k=d.getCursor(),a=
d.getTokenAt(k);a.end>k.ch&&(a.end=k.ch,a.string=a.string.slice(0,k.ch-a.start));b=n.innerMode(d.getMode(),a.state);if(b.mode.xmlCurrentTag){var p=[],r=!1,m=/\btag\b/.test(a.type)&&!/>$/.test(a.string),C=m&&/^\w/.test(a.string),z;if(C){var e=d.getLine(k.line).slice(Math.max(0,a.start-2),a.start);(e=/<\/$/.test(e)?"close":/<$/.test(e)?"open":null)&&(z=a.start-("close"==e?2:1))}else m&&"<"==a.string?e="open":m&&"</"==a.string&&(e="close");var A=b.mode.xmlCurrentTag(b.state);if(!m&&!A||e){if(C)var h=
a.string;r=e;var g=b.mode.xmlCurrentContext?b.mode.xmlCurrentContext(b.state):[];m=(b=g.length&&g[g.length-1])&&c[b];if((g=b?m&&m.children:c["!top"])&&"close"!=e)for(d=0;d<g.length;++d)h&&!q(g[d],h,u)||p.push("<"+g[d]);else if("close"!=e)for(var f in c)!c.hasOwnProperty(f)||"!top"==f||"!attrs"==f||h&&!q(f,h,u)||p.push("<"+f);b&&(!h||"close"==e&&q(b,h,u))&&p.push("</"+b+">")}else{f=(m=A&&c[A.name])&&m.attrs;c=c["!attrs"];if(!f&&!c)return;if(!f)f=c;else if(c){e={};for(var l in c)c.hasOwnProperty(l)&&
(e[l]=c[l]);for(l in f)f.hasOwnProperty(l)&&(e[l]=f[l]);f=e}if("string"==a.type||"="==a.string){e=d.getRange(w(k.line,Math.max(0,k.ch-60)),w(k.line,"string"==a.type?a.start:a.end));c=e.match(/([^\s\u00a0=<>"']+)=$/);if(!c||!f.hasOwnProperty(c[1])||!(g=f[c[1]]))return;"function"==typeof g&&(g=g.call(this,d));"string"==a.type&&(h=a.string,c=0,/['"]/.test(a.string.charAt(0))&&(t=a.string.charAt(0),h=a.string.slice(1),c++),l=a.string.length,/['"]/.test(a.string.charAt(l-1))&&(t=a.string.charAt(l-1),h=
a.string.substr(c,l-2)),c&&(d=d.getLine(k.line),d.length>a.end&&d.charAt(a.end)==t&&a.end++),r=!0);d=function(x){if(x)for(var y=0;y<x.length;++y)h&&!q(x[y],h,u)||p.push(t+x[y]+t);return v()};return g&&g.then?g.then(d):d(g)}"attribute"==a.type&&(h=a.string,r=!0);for(var B in f)!f.hasOwnProperty(B)||h&&!q(B,h,u)||p.push(B)}return v()}}})});
// lint.js
(function(k){"object"==typeof exports&&"object"==typeof module?k(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],k):k(CodeMirror)})(function(k){function A(a,b,e){function d(f){if(!c.parentNode)return k.off(document,"mousemove",d);c.style.top=Math.max(0,f.clientY-c.offsetHeight-5)+"px";c.style.left=f.clientX+5+"px"}var c=document.createElement("div");c.className="CodeMirror-lint-tooltip cm-s-"+a.options.theme;c.appendChild(e.cloneNode(!0));a.state.lint.options.selfContain?
a.getWrapperElement().appendChild(c):document.body.appendChild(c);k.on(document,"mousemove",d);d(b);null!=c.style.opacity&&(c.style.opacity=1);return c}function B(a){a.parentNode&&(null==a.style.opacity&&a.parentNode&&a.parentNode.removeChild(a),a.style.opacity=0,setTimeout(function(){a.parentNode&&a.parentNode.removeChild(a)},600))}function u(a,b,e,d){function c(){k.off(d,"mouseout",c);f&&(B(f),f=null)}var f=A(a,b,e),h=setInterval(function(){if(f)for(var g=d;;g=g.parentNode){g&&11==g.nodeType&&(g=
g.host);if(g==document.body)return;if(!g){c();break}}if(!f)return clearInterval(h)},400);k.on(d,"mouseout",c)}function C(a,b,e){this.marked=[];b instanceof Function&&(b={getAnnotations:b});b&&!0!==b||(b={});this.options={};this.linterOptions=b.options||{};for(var d in p)this.options[d]=p[d];for(d in b)p.hasOwnProperty(d)?null!=b[d]&&(this.options[d]=b[d]):b.options||(this.linterOptions[d]=b[d]);this.timeout=null;this.hasGutter=e;this.onMouseOver=function(c){var f=c.target||c.srcElement;if(/\bCodeMirror-lint-mark-/.test(f.className)){f=
f.getBoundingClientRect();var h=a.findMarksAt(a.coordsChar({left:(f.left+f.right)/2,top:(f.top+f.bottom)/2},"client"));f=[];for(var g=0;g<h.length;++g){var l=h[g].__annotation;l&&f.push(l)}if(f.length){h=c.target||c.srcElement;g=document.createDocumentFragment();for(l=0;l<f.length;l++)g.appendChild(v(f[l]));u(a,c,g,h)}}};this.waitingFor=0}function w(a){var b=a.state.lint;b.hasGutter&&a.clearGutter("CodeMirror-lint-markers");b.options.highlightLines&&D(a);for(a=0;a<b.marked.length;++a)b.marked[a].clear();
b.marked.length=0}function D(a){a.eachLine(function(b){var e=b.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(b.wrapClass);e&&a.removeLineClass(b,"wrap",e[0])})}function E(a,b,e,d,c){var f=document.createElement("div"),h=f;f.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+e;d&&(h=f.appendChild(document.createElement("div")),h.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple");if(0!=c)k.on(h,"mouseover",function(g){u(a,g,b,h)});return f}function F(a){for(var b=[],e=0;e<
a.length;++e){var d=a[e],c=d.from.line;(b[c]||(b[c]=[])).push(d)}return b}function v(a){var b=a.severity;b||(b="error");var e=document.createElement("div");e.className="CodeMirror-lint-message CodeMirror-lint-message-"+b;"undefined"!=typeof a.messageHTML?e.innerHTML=a.messageHTML:e.appendChild(document.createTextNode(a.message));return e}function G(a,b){function e(){c=-1;a.off("change",e)}var d=a.state.lint,c=++d.waitingFor;a.on("change",e);b(a.getValue(),function(f,h){a.off("change",e);d.waitingFor==
c&&(h&&f instanceof k&&(f=h),a.operation(function(){q(a,f)}))},d.linterOptions,a)}function r(a){var b=a.state.lint;if(b){var e=b.options,d=e.getAnnotations||a.getHelper(k.Pos(0,0),"lint");if(d)if(e.async||d.async)G(a,d);else{var c=d(a.getValue(),b.linterOptions,a);c&&(c.then?c.then(function(f){a.operation(function(){q(a,f)})}):a.operation(function(){q(a,c)}))}}}function q(a,b){var e=a.state.lint;if(e){var d=e.options;w(a);for(var c=F(b),f=0;f<c.length;++f){var h=c[f];if(h){var g=[];h=h.filter(function(x){return-1<
g.indexOf(x.message)?!1:g.push(x.message)});for(var l=null,y=e.hasGutter&&document.createDocumentFragment(),t=0;t<h.length;++t){var m=h[t],n=m.severity;n||(n="error");"error"!=l&&(l=n);d.formatAnnotation&&(m=d.formatAnnotation(m));e.hasGutter&&y.appendChild(v(m));m.to&&e.marked.push(a.markText(m.from,m.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+n,__annotation:m}))}e.hasGutter&&a.setGutterMarker(f,"CodeMirror-lint-markers",E(a,y,l,1<c[f].length,d.tooltips));d.highlightLines&&a.addLineClass(f,
"wrap","CodeMirror-lint-line-"+l)}}if(d.onUpdateLinting)d.onUpdateLinting(b,c,a)}}function z(a){var b=a.state.lint;b&&(clearTimeout(b.timeout),b.timeout=setTimeout(function(){r(a)},b.options.delay))}var p={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};k.defineOption("lint",!1,function(a,b,e){e&&e!=k.Init&&(w(a),!1!==a.state.lint.options.lintOnChange&&a.off("change",z),k.off(a.getWrapperElement(),"mouseover",
a.state.lint.onMouseOver),clearTimeout(a.state.lint.timeout),delete a.state.lint);if(b){e=a.getOption("gutters");for(var d=!1,c=0;c<e.length;++c)"CodeMirror-lint-markers"==e[c]&&(d=!0);b=a.state.lint=new C(a,b,d);if(b.options.lintOnChange)a.on("change",z);if(0!=b.options.tooltips&&"gutter"!=b.options.tooltips)k.on(a.getWrapperElement(),"mouseover",b.onMouseOver);r(a)}});k.defineExtension("performLint",function(){r(this)})});
// css-lint.js
(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){b.registerHelper("lint","css",function(c,a){var d=[];if(!window.CSSLint)return window.console&&window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run."),d;c=CSSLint.verify(c,a).messages;for(var e=0;e<c.length;e++){a=c[e];var f=a.line-1,g=a.col;d.push({from:b.Pos(a.line-
1,a.col-1),to:b.Pos(f,g),message:a.message,severity:a.type})}return d})});
// panel.js
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function g(b,a,e,c){this.cm=b;this.node=a;this.options=e;this.height=c;this.cleared=!1}function p(b){var a=b.getWrapperElement(),e=window.getComputedStyle?window.getComputedStyle(a):a.currentStyle,c=parseInt(e.height),d=b.state.panels={setHeight:a.style.height,panels:[],wrapper:document.createElement("div")};
e=b.hasFocus();var k=b.getScrollInfo();a.parentNode.insertBefore(d.wrapper,a);d.wrapper.appendChild(a);b.scrollTo(k.left,k.top);e&&b.focus();b._setSize=b.setSize;null!=c&&(b.setSize=function(q,f){f||(f=d.wrapper.offsetHeight);d.setHeight=f;if("number"!=typeof f){var l=/^(\d+\.?\d*)px$/.exec(f);l?f=Number(l[1]):(d.wrapper.style.height=f,f=d.wrapper.offsetHeight)}l=f-d.panels.map(function(m){return m.node.getBoundingClientRect().height}).reduce(function(m,r){return m+r},0);b._setSize(q,l);c=f})}function n(b,
a){for(a=a.nextSibling;a;a=a.nextSibling)if(a==b.getWrapperElement())return!0;return!1}h.defineExtension("addPanel",function(b,a){a=a||{};this.state.panels||p(this);var e=this.state.panels,c=e.wrapper,d=this.getWrapperElement(),k=a.replace instanceof g&&!a.replace.cleared;a.after instanceof g&&!a.after.cleared?c.insertBefore(b,a.before.node.nextSibling):a.before instanceof g&&!a.before.cleared?c.insertBefore(b,a.before.node):k?(c.insertBefore(b,a.replace.node),a.replace.clear(!0)):"bottom"==a.position?
c.appendChild(b):"before-bottom"==a.position?c.insertBefore(b,d.nextSibling):"after-top"==a.position?c.insertBefore(b,d):c.insertBefore(b,c.firstChild);c=a&&a.height||b.offsetHeight;d=new g(this,b,a,c);e.panels.push(d);this.setSize();a.stable&&n(this,b)&&this.scrollTo(null,this.getScrollInfo().top+c);return d});g.prototype.clear=function(b){if(!this.cleared){this.cleared=!0;var a=this.cm.state.panels;a.panels.splice(a.panels.indexOf(this),1);this.cm.setSize();this.options.stable&&n(this.cm,this.node)&&
this.cm.scrollTo(null,this.cm.getScrollInfo().top-this.height);a.wrapper.removeChild(this.node);if(0==a.panels.length&&!b){b=this.cm;a=b.state.panels;b.state.panels=null;var e=b.getWrapperElement(),c=b.hasFocus(),d=b.getScrollInfo();a.wrapper.parentNode.replaceChild(e,a.wrapper);b.scrollTo(d.left,d.top);c&&b.focus();e.style.height=a.setHeight;b.setSize=b._setSize;b.setSize()}}};g.prototype.changed=function(){this.height=this.node.getBoundingClientRect().height;this.cm.setSize()}});
// search.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,h,g){b instanceof String&&(b=String(b));for(var l=b.length,k=0;k<l;k++){var t=b[k];if(h.call(g,t,k,b))return{i:k,v:t}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,h,g){if(b==Array.prototype||b==Object.prototype)return b;b[h]=g.value;return b};$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var h=0;h<b.length;++h){var g=b[h];if(g&&g.Math==Math)return g}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(b,h){var g=$jscomp.propertyToPolyfillSymbol[h];if(null==g)return b[h];g=b[g];return void 0!==g?g:b[h]};
$jscomp.polyfill=function(b,h,g,l){h&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,h,g,l):$jscomp.polyfillUnisolated(b,h,g,l))};$jscomp.polyfillUnisolated=function(b,h,g,l){g=$jscomp.global;b=b.split(".");for(l=0;l<b.length-1;l++){var k=b[l];if(!(k in g))return;g=g[k]}b=b[b.length-1];l=g[b];h=h(l);h!=l&&null!=h&&$jscomp.defineProperty(g,b,{configurable:!0,writable:!0,value:h})};
$jscomp.polyfillIsolated=function(b,h,g,l){var k=b.split(".");b=1===k.length;l=k[0];l=!b&&l in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var t=0;t<k.length-1;t++){var A=k[t];if(!(A in l))return;l=l[A]}k=k[k.length-1];g=$jscomp.IS_SYMBOL_NATIVE&&"es6"===g?l[k]:null;h=h(g);null!=h&&(b?$jscomp.defineProperty($jscomp.polyfills,k,{configurable:!0,writable:!0,value:h}):h!==g&&(void 0===$jscomp.propertyToPolyfillSymbol[k]&&(g=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[k]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(k):$jscomp.POLYFILL_PREFIX+g+"$"+k),$jscomp.defineProperty(l,$jscomp.propertyToPolyfillSymbol[k],{configurable:!0,writable:!0,value:h})))};$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(h,g){return $jscomp.findInternal(this,h,g).v}},"es6","es3");
(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],b):b(CodeMirror)})(function(b){function h(a,c){"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g"));return{token:function(e){a.lastIndex=e.pos;
var d=a.exec(e.string);if(d&&d.index==e.pos)return e.pos+=d[0].length||1,"searching";d?e.pos=d.index:e.skipToEnd()}}}function g(){this.overlay=this.posFrom=this.posTo=this.lastQuery=this.query=null}function l(a){return a.state.search||(a.state.search=new g)}function k(a){return"string"==typeof a&&a==a.toLowerCase()}function t(a,c,e){return a.getSearchCursor(c,e,{caseFold:k(c),multiline:!0})}function A(a,c,e,d,f){a.openDialog(c,d,{value:e,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){y(a)},
onKeyDown:f,bottom:a.options.search.bottom})}function D(a,c,e,d,f){a.openDialog?a.openDialog(c,f,{value:d,selectValueOnOpen:!0,bottom:a.options.search.bottom}):f(prompt(e,d))}function J(a,c,e,d){if(a.openConfirm)a.openConfirm(c,d);else if(confirm(e))d[0]()}function E(a){return a.replace(/\\([nrt\\])/g,function(c,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"==e?"\\":c})}function F(a){var c=a.match(/^\/(.*)\/([a-z]*)$/);if(c)try{a=new RegExp(c[1],-1==c[2].indexOf("i")?"":"i")}catch(e){}else a=E(a);
if("string"==typeof a?""==a:a.test(""))a=/x^/;return a}function B(a,c,e){c.queryText=e;c.query=F(e);a.removeOverlay(c.overlay,k(c.query));c.overlay=h(c.query,k(c.query));a.addOverlay(c.overlay);a.showMatchesOnScrollbar&&(c.annotate&&(c.annotate.clear(),c.annotate=null),c.annotate=a.showMatchesOnScrollbar(c.query,k(c.query)))}function x(a,c,e,d){var f=l(a);if(f.query)return C(a,c);var n=a.getSelection()||f.lastQuery;n instanceof RegExp&&"x^"==n.source&&(n=null);if(e&&a.openDialog){var u=null,r=function(q,
w){b.e_stop(w);q&&(q!=f.queryText&&(B(a,f,q),f.posFrom=f.posTo=a.getCursor()),u&&(u.style.opacity=1),C(a,w.shiftKey,function(p,v){var z;3>v.line&&document.querySelector&&(z=a.display.wrapper.querySelector(".CodeMirror-dialog"))&&z.getBoundingClientRect().bottom-4>a.cursorCoords(v,"window").top&&((u=z).style.opacity=.4)}))};A(a,G(a),n,r,function(q,w){var p=b.keyName(q),v=a.getOption("extraKeys");p=v&&v[p]||b.keyMap[a.getOption("keyMap")][p];if("findNext"==p||"findPrev"==p||"findPersistentNext"==p||
"findPersistentPrev"==p)b.e_stop(q),B(a,l(a),w),a.execCommand(p);else if("find"==p||"findPersistent"==p)b.e_stop(q),r(w,q)});d&&n&&(B(a,f,n),C(a,c))}else D(a,G(a),"Search for:",n,function(q){q&&!f.query&&a.operation(function(){B(a,f,q);f.posFrom=f.posTo=a.getCursor();C(a,c)})})}function C(a,c,e){a.operation(function(){var d=l(a),f=t(a,d.query,c?d.posFrom:d.posTo);if(!f.find(c)&&(f=t(a,d.query,c?b.Pos(a.lastLine()):b.Pos(a.firstLine(),0)),!f.find(c)))return;a.setSelection(f.from(),f.to());a.scrollIntoView({from:f.from(),
to:f.to()},20);d.posFrom=f.from();d.posTo=f.to();e&&e(f.from(),f.to())})}function y(a){a.operation(function(){var c=l(a);if(c.lastQuery=c.query)c.query=c.queryText=null,a.removeOverlay(c.overlay),c.annotate&&(c.annotate.clear(),c.annotate=null)})}function m(a,c){var e=a?document.createElement(a):document.createDocumentFragment(),d;for(d in c)e[d]=c[d];for(d=2;d<arguments.length;d++){var f=arguments[d];e.appendChild("string"==typeof f?document.createTextNode(f):f)}return e}function G(a){var c=m("label",
{className:"CodeMirror-search-label"},a.phrase("Search:"),m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));c.setAttribute("for","CodeMirror-search-field");return m("",null,c," ",m("span",{style:"color: #666",className:"CodeMirror-search-hint"},a.phrase("(Use /re/ syntax for regexp search)")))}function K(a){return m("",null," ",m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",m("span",{style:"color: #666",
className:"CodeMirror-search-hint"},a.phrase("(Use /re/ syntax for regexp search)")))}function L(a){return m("",null,m("span",{className:"CodeMirror-search-label"},a.phrase("Replace?"))," ",m("button",{},a.phrase("Yes"))," ",m("button",{},a.phrase("No"))," ",m("button",{},a.phrase("All"))," ",m("button",{},a.phrase("Stop")))}function H(a,c,e){a.operation(function(){for(var d=t(a,c);d.findNext();)if("string"!=typeof c){var f=a.getRange(d.from(),d.to()).match(c);d.replace(e.replace(/\$(\d)/g,function(n,
u){return f[u]}))}else d.replace(e)})}function I(a,c){if(!a.getOption("readOnly")){var e=a.getSelection()||l(a).lastQuery,d=c?a.phrase("Replace all:"):a.phrase("Replace:"),f=m("",null,m("span",{className:"CodeMirror-search-label"},d),K(a));D(a,f,d,e,function(n){n&&(n=F(n),D(a,m("",null,m("span",{className:"CodeMirror-search-label"},a.phrase("With:"))," ",m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})),a.phrase("Replace with:"),"",function(u){u=E(u);if(c)H(a,n,u);
else{y(a);var r=t(a,n,a.getCursor("from")),q=function(){var p=r.from(),v;if(!(v=r.findNext())&&(r=t(a,n),!(v=r.findNext())||p&&r.from().line==p.line&&r.from().ch==p.ch))return;a.setSelection(r.from(),r.to());a.scrollIntoView({from:r.from(),to:r.to()});J(a,L(a),a.phrase("Replace?"),[function(){w(v)},q,function(){H(a,n,u)}])},w=function(p){r.replace("string"==typeof n?u:u.replace(/\$(\d)/g,function(v,z){return p[z]}));q()};q()}}))})}}b.defineOption("search",{bottom:!1});b.commands.find=function(a){y(a);
x(a)};b.commands.findPersistent=function(a){y(a);x(a,!1,!0)};b.commands.findPersistentNext=function(a){x(a,!1,!0,!0)};b.commands.findPersistentPrev=function(a){x(a,!0,!0,!0)};b.commands.findNext=x;b.commands.findPrev=function(a){x(a,!0)};b.commands.clearSearch=y;b.commands.replace=I;b.commands.replaceAll=function(a){I(a,!0)}});
// searchcursor.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(f,g,h){f instanceof String&&(f=String(f));for(var p=f.length,l=0;l<p;l++){var u=f[l];if(g.call(h,u,l,f))return{i:l,v:u}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,g,h){if(f==Array.prototype||f==Object.prototype)return f;f[g]=h.value;return f};$jscomp.getGlobal=function(f){f=["object"==typeof globalThis&&globalThis,f,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var g=0;g<f.length;++g){var h=f[g];if(h&&h.Math==Math)return h}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(f,g){var h=$jscomp.propertyToPolyfillSymbol[g];if(null==h)return f[g];h=f[h];return void 0!==h?h:f[g]};
$jscomp.polyfill=function(f,g,h,p){g&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(f,g,h,p):$jscomp.polyfillUnisolated(f,g,h,p))};$jscomp.polyfillUnisolated=function(f,g,h,p){h=$jscomp.global;f=f.split(".");for(p=0;p<f.length-1;p++){var l=f[p];if(!(l in h))return;h=h[l]}f=f[f.length-1];p=h[f];g=g(p);g!=p&&null!=g&&$jscomp.defineProperty(h,f,{configurable:!0,writable:!0,value:g})};
$jscomp.polyfillIsolated=function(f,g,h,p){var l=f.split(".");f=1===l.length;p=l[0];p=!f&&p in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var u=0;u<l.length-1;u++){var w=l[u];if(!(w in p))return;p=p[w]}l=l[l.length-1];h=$jscomp.IS_SYMBOL_NATIVE&&"es6"===h?p[l]:null;g=g(h);null!=g&&(f?$jscomp.defineProperty($jscomp.polyfills,l,{configurable:!0,writable:!0,value:g}):g!==h&&(void 0===$jscomp.propertyToPolyfillSymbol[l]&&(h=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[l]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(l):$jscomp.POLYFILL_PREFIX+h+"$"+l),$jscomp.defineProperty(p,$jscomp.propertyToPolyfillSymbol[l],{configurable:!0,writable:!0,value:g})))};$jscomp.polyfill("Array.prototype.find",function(f){return f?f:function(g,h){return $jscomp.findInternal(this,g,h).v}},"es6","es3");
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function g(b,a){var c=b.flags;for(var e=c=null!=c?c:(b.ignoreCase?"i":"")+(b.global?"g":"")+(b.multiline?"m":""),d=0;d<a.length;d++)-1==e.indexOf(a.charAt(d))&&(e+=a.charAt(d));return c==e?b:new RegExp(b.source,e)}function h(b,a,c){a=g(a,"g");var e=c.line,d=c.ch;for(c=b.lastLine();e<=c;e++,d=0)if(a.lastIndex=
d,d=b.getLine(e),d=a.exec(d))return{from:q(e,d.index),to:q(e,d.index+d[0].length),match:d}}function p(b,a,c){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(a.source))return h(b,a,c);a=g(a,"gm");for(var e,d=1,k=c.line,m=b.lastLine();k<=m;){for(var n=0;n<d&&!(k>m);n++){var r=b.getLine(k++);e=null==e?r:e+"\n"+r}d*=2;a.lastIndex=c.ch;if(n=a.exec(e))return a=e.slice(0,n.index).split("\n"),b=n[0].split("\n"),c=c.line+a.length-1,a=a[a.length-1].length,{from:q(c,a),to:q(c+b.length-1,1==b.length?a+b[0].length:b[b.length-
1].length),match:n}}}function l(b,a,c){for(var e,d=0;d<=b.length;){a.lastIndex=d;d=a.exec(b);if(!d)break;var k=d.index+d[0].length;if(k>b.length-c)break;if(!e||k>e.index+e[0].length)e=d;d=d.index+1}return e}function u(b,a,c){a=g(a,"g");var e=c.line,d=c.ch;for(c=b.firstLine();e>=c;e--,d=-1){var k=b.getLine(e);if(d=l(k,a,0>d?0:k.length-d))return{from:q(e,d.index),to:q(e,d.index+d[0].length),match:d}}}function w(b,a,c){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(a.source))return u(b,a,c);a=g(a,"gm");var e=1,
d=b.getLine(c.line).length-c.ch;c=c.line;for(var k=b.firstLine();c>=k;){for(var m=0;m<e&&c>=k;m++){var n=b.getLine(c--);var r=null==r?n:n+"\n"+r}e*=2;if(m=l(r,a,d))return a=r.slice(0,m.index).split("\n"),b=m[0].split("\n"),c+=a.length,a=a[a.length-1].length,{from:q(c,a),to:q(c+b.length-1,1==b.length?a+b[0].length:b[b.length-1].length),match:m}}}function v(b,a,c,e){if(b.length==a.length)return c;var d=0;for(a=c+Math.max(0,b.length-a.length);;){if(d==a)return d;var k=d+a>>1,m=e(b.slice(0,k)).length;
if(m==c)return k;m>c?a=k:d=k+1}}function C(b,a,c,e){if(!a.length)return null;e=e?x:y;a=e(a).split(/\r|\n\r?/);var d=c.line;c=c.ch;var k=b.lastLine()+1-a.length;a:for(;d<=k;d++,c=0){var m=b.getLine(d).slice(c),n=e(m);if(1==a.length){var r=n.indexOf(a[0]);if(-1==r)continue a;v(m,n,r,e);return{from:q(d,v(m,n,r,e)+c),to:q(d,v(m,n,r+a[0].length,e)+c)}}r=n.length-a[0].length;if(n.slice(r)!=a[0])continue a;for(var t=1;t<a.length-1;t++)if(e(b.getLine(d+t))!=a[t])continue a;t=b.getLine(d+a.length-1);var B=
e(t),z=a[a.length-1];if(B.slice(0,z.length)!=z)continue a;return{from:q(d,v(m,n,r,e)+c),to:q(d+a.length-1,v(t,B,z.length,e))}}}function D(b,a,c,e){if(!a.length)return null;e=e?x:y;a=e(a).split(/\r|\n\r?/);var d=c.line,k=c.ch,m=b.firstLine()-1+a.length;a:for(;d>=m;d--,k=-1){var n=b.getLine(d);-1<k&&(n=n.slice(0,k));k=e(n);if(1==a.length){c=k.lastIndexOf(a[0]);if(-1==c)continue a;return{from:q(d,v(n,k,c,e)),to:q(d,v(n,k,c+a[0].length,e))}}var r=a[a.length-1];if(k.slice(0,r.length)!=r)continue a;var t=
1;for(c=d-a.length+1;t<a.length-1;t++)if(e(b.getLine(c+t))!=a[t])continue a;c=b.getLine(d+1-a.length);t=e(c);if(t.slice(t.length-a[0].length)!=a[0])continue a;return{from:q(d+1-a.length,v(c,t,c.length-a[0].length,e)),to:q(d,v(n,k,r.length,e))}}}function A(b,a,c,e){this.afterEmptyMatch=this.atOccurrence=!1;this.doc=b;c=c?b.clipPos(c):q(0,0);this.pos={from:c,to:c};if("object"==typeof e)var d=e.caseFold;else d=e,e=null;"string"==typeof a?(null==d&&(d=!1),this.matches=function(k,m){return(k?D:C)(b,a,
m,d)}):(a=g(a,"gm"),this.matches=e&&!1===e.multiline?function(k,m){return(k?u:h)(b,a,m)}:function(k,m){return(k?w:p)(b,a,m)})}var q=f.Pos;if(String.prototype.normalize){var x=function(b){return b.normalize("NFD").toLowerCase()};var y=function(b){return b.normalize("NFD")}}else x=function(b){return b.toLowerCase()},y=function(b){return b};A.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(b){var a=this.doc.clipPos(b?this.pos.from:this.pos.to);
if(this.afterEmptyMatch&&this.atOccurrence&&(a=q(a.line,a.ch),b?(a.ch--,0>a.ch&&(a.line--,a.ch=(this.doc.getLine(a.line)||"").length)):(a.ch++,a.ch>(this.doc.getLine(a.line)||"").length&&(a.ch=0,a.line++)),0!=f.cmpPos(a,this.doc.clipPos(a))))return this.atOccurrence=!1;this.afterEmptyMatch=(a=this.matches(b,a))&&0==f.cmpPos(a.from,a.to);if(a)return this.pos=a,this.atOccurrence=!0,this.pos.match||!0;b=q(b?this.doc.firstLine():this.doc.lastLine()+1,0);this.pos={from:b,to:b};return this.atOccurrence=
!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(b,a){this.atOccurrence&&(b=f.splitLines(b),this.doc.replaceRange(b,this.pos.from,this.pos.to,a),this.pos.to=q(this.pos.from.line+b.length-1,b[b.length-1].length+(1==b.length?this.pos.from.ch:0)))}};f.defineExtension("getSearchCursor",function(b,a,c){return new A(this.doc,b,a,c)});f.defineDocExtension("getSearchCursor",function(b,a,c){return new A(this,b,a,c)});f.defineExtension("selectMatches",
function(b,a){var c=[];for(b=this.getSearchCursor(b,this.getCursor("from"),a);b.findNext()&&!(0<f.cmpPos(b.to(),this.getCursor("to")));)c.push({anchor:b.from(),head:b.to()});c.length&&this.setSelections(c,0)})});
// simplescrollbars.js
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function l(a,b,e){function g(f){var h=c.wheelEventPixels(f)["horizontal"==d.orientation?"x":"y"],m=d.pos;d.moveTo(d.pos+h);d.pos!=m&&c.e_preventDefault(f)}this.orientation=b;this.scroll=e;this.screen=this.total=this.size=1;this.pos=0;this.node=document.createElement("div");this.node.className=a+"-"+b;
this.inner=this.node.appendChild(document.createElement("div"));var d=this;c.on(this.inner,"mousedown",function(f){function h(){c.off(document,"mousemove",m);c.off(document,"mouseup",h)}function m(n){if(1!=n.which)return h();d.moveTo(q+d.total/d.size*(n[p]-r))}if(1==f.which){c.e_preventDefault(f);var p="horizontal"==d.orientation?"pageX":"pageY",r=f[p],q=d.pos;c.on(document,"mousemove",m);c.on(document,"mouseup",h)}});c.on(this.node,"click",function(f){c.e_preventDefault(f);var h=d.inner.getBoundingClientRect();
d.moveTo(d.pos+("horizontal"==d.orientation?f.clientX<h.left?-1:f.clientX>h.right?1:0:f.clientY<h.top?-1:f.clientY>h.bottom?1:0)*d.screen)});c.on(this.node,"mousewheel",g);c.on(this.node,"DOMMouseScroll",g)}function k(a,b,e){this.addClass=a;this.horiz=new l(a,"horizontal",e);b(this.horiz.node);this.vert=new l(a,"vertical",e);b(this.vert.node);this.width=null}l.prototype.setPos=function(a,b){0>a&&(a=0);a>this.total-this.screen&&(a=this.total-this.screen);if(!b&&a==this.pos)return!1;this.pos=a;this.inner.style["horizontal"==
this.orientation?"left":"top"]=this.size/this.total*a+"px";return!0};l.prototype.moveTo=function(a){this.setPos(a)&&this.scroll(a,this.orientation)};l.prototype.update=function(a,b,e){var g=this.screen!=b||this.total!=a||this.size!=e;g&&(this.screen=b,this.total=a,this.size=e);a=this.size/this.total*this.screen;10>a&&(this.size-=10-a,a=10);this.inner.style["horizontal"==this.orientation?"width":"height"]=a+"px";this.setPos(this.pos,g)};k.prototype.update=function(a){if(null==this.width){var b=window.getComputedStyle?
window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;b&&(this.width=parseInt(b.height))}b=this.width||0;var e=a.scrollWidth>a.clientWidth+1,g=a.scrollHeight>a.clientHeight+1;this.vert.node.style.display=g?"block":"none";this.horiz.node.style.display=e?"block":"none";g&&(this.vert.update(a.scrollHeight,a.clientHeight,a.viewHeight-(e?b:0)),this.vert.node.style.bottom=e?b+"px":"0");e&&(this.horiz.update(a.scrollWidth,a.clientWidth,a.viewWidth-(g?b:0)-a.barLeft),this.horiz.node.style.right=
g?b+"px":"0",this.horiz.node.style.left=a.barLeft+"px");return{right:g?b:0,bottom:e?b:0}};k.prototype.setScrollTop=function(a){this.vert.setPos(a)};k.prototype.setScrollLeft=function(a){this.horiz.setPos(a)};k.prototype.clear=function(){var a=this.horiz.node.parentNode;a.removeChild(this.horiz.node);a.removeChild(this.vert.node)};c.scrollbarModel.simple=function(a,b){return new k("CodeMirror-simplescroll",a,b)};c.scrollbarModel.overlay=function(a,b){return new k("CodeMirror-overlayscroll",a,b)}});
// annotatescrollbar.js
(function(k){"object"==typeof exports&&"object"==typeof module?k(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],k):k(CodeMirror)})(function(k){function m(a,e){function b(f){clearTimeout(c.doRedraw);c.doRedraw=setTimeout(function(){c.redraw()},f)}this.cm=a;this.options=e;this.buttonHeight=e.scrollButtonHeight||a.getOption("scrollButtonHeight");this.annotations=[];this.doRedraw=this.doUpdate=null;this.div=a.getWrapperElement().appendChild(document.createElement("div"));
this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none";this.computeScale();var c=this;a.on("refresh",this.resizeHandler=function(){clearTimeout(c.doUpdate);c.doUpdate=setTimeout(function(){c.computeScale()&&b(20)},100)});a.on("markerAdded",this.resizeHandler);a.on("markerCleared",this.resizeHandler);if(!1!==e.listenForChanges)a.on("changes",this.changeHandler=function(){b(250)})}k.defineExtension("annotateScrollbar",function(a){"string"==typeof a&&(a={className:a});
return new m(this,a)});k.defineOption("scrollButtonHeight",0);m.prototype.computeScale=function(){var a=this.cm;a=(a.getWrapperElement().clientHeight-a.display.barHeight-2*this.buttonHeight)/a.getScrollerElement().scrollHeight;if(a!=this.hScale)return this.hScale=a,!0};m.prototype.update=function(a){this.annotations=a;this.redraw()};m.prototype.redraw=function(a){function e(n,v){if(p!=n.line){p=n.line;d=b.getLineHandle(n.line);var q=b.getLineHandleVisualStart(d);q!=d&&(p=b.getLineNumber(q),d=q)}return d.widgets&&
d.widgets.length||w&&d.height>y?b.charCoords(n,"local")[v?"top":"bottom"]:b.heightAtLine(d,"local")+(v?0:d.height)}!1!==a&&this.computeScale();var b=this.cm;a=this.hScale;var c=document.createDocumentFragment(),f=this.annotations,w=b.getOption("lineWrapping"),y=w&&1.5*b.defaultTextHeight(),p=null,d=null,x=b.lastLine();if(b.display.barWidth)for(var g=0,r;g<f.length;g++){var h=f[g];if(!(h.to.line>x)){for(var t=r||e(h.from,!0)*a,l=e(h.to,!1)*a;g<f.length-1&&!(f[g+1].to.line>x);){r=e(f[g+1].from,!0)*
a;if(r>l+.9)break;h=f[++g];l=e(h.to,!1)*a}if(l!=t){l=Math.max(l-t,3);var u=c.appendChild(document.createElement("div"));u.style.cssText="position: absolute; right: 0px; width: "+Math.max(b.display.barWidth-1,2)+"px; top: "+(t+this.buttonHeight)+"px; height: "+l+"px";u.className=this.options.className;h.id&&u.setAttribute("annotation-id",h.id)}}}this.div.textContent="";this.div.appendChild(c)};m.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler);this.cm.off("markerAdded",this.resizeHandler);
this.cm.off("markerCleared",this.resizeHandler);this.changeHandler&&this.cm.off("changes",this.changeHandler);this.div.parentNode.removeChild(this.div)}});
// matchesonscrollbar.js
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],f):f(CodeMirror)})(function(f){function g(a,c,b,d){this.cm=a;this.options=d;var e={listenForChanges:!1},h;for(h in d)e[h]=d[h];e.className||(e.className="CodeMirror-search-match");this.annotation=a.annotateScrollbar(e);this.query=
c;this.caseFold=b;this.gap={from:a.firstLine(),to:a.lastLine()+1};this.matches=[];this.update=null;this.findMatches();this.annotation.update(this.matches);var l=this;a.on("change",this.changeHandler=function(n,m){l.onChange(m)})}function k(a,c,b){return a<=c?a:Math.max(c,a+b)}f.defineExtension("showMatchesOnScrollbar",function(a,c,b){"string"==typeof b&&(b={className:b});b||(b={});return new g(this,a,c,b)});g.prototype.findMatches=function(){if(this.gap){for(var a=0;a<this.matches.length;a++){var c=
this.matches[a];if(c.from.line>=this.gap.to)break;c.to.line>=this.gap.from&&this.matches.splice(a--,1)}for(var b=this.cm.getSearchCursor(this.query,f.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),d=this.options&&this.options.maxMatches||1E3;b.findNext();){c={from:b.from(),to:b.to()};if(c.from.line>=this.gap.to)break;this.matches.splice(a++,0,c);if(this.matches.length>d)break}this.gap=null}};g.prototype.onChange=function(a){var c=a.from.line,b=f.changeEnd(a).line,
d=b-a.to.line;this.gap?(this.gap.from=Math.min(k(this.gap.from,c,d),a.from.line),this.gap.to=Math.max(k(this.gap.to,c,d),a.from.line)):this.gap={from:a.from.line,to:b+1};if(d)for(a=0;a<this.matches.length;a++){b=this.matches[a];var e=k(b.from.line,c,d);e!=b.from.line&&(b.from=f.Pos(e,b.from.ch));e=k(b.to.line,c,d);e!=b.to.line&&(b.to=f.Pos(e,b.to.ch))}clearTimeout(this.update);var h=this;this.update=setTimeout(function(){h.updateAfterChange()},250)};g.prototype.updateAfterChange=function(){this.findMatches();
this.annotation.update(this.matches)};g.prototype.clear=function(){this.cm.off("change",this.changeHandler);this.annotation.clear()}});
// match-highlighter.js
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],f):f(CodeMirror)})(function(f){function r(a){this.options={};for(var b in h)this.options[b]=(a&&a.hasOwnProperty(b)?a:h)[b];this.matchesonscroll=this.overlay=this.timeout=null;this.active=!1}function k(a){var b=a.state.matchHighlighter;(b.active||a.hasFocus())&&l(a,b)}function m(a){var b=
a.state.matchHighlighter;b.active||(b.active=!0,l(a,b))}function l(a,b){clearTimeout(b.timeout);b.timeout=setTimeout(function(){n(a)},b.options.delay)}function p(a,b,d,c){var e=a.state.matchHighlighter;a.addOverlay(e.overlay=t(b,d,c));e.options.annotateScrollbar&&a.showMatchesOnScrollbar&&(b=d?new RegExp((/\w/.test(b.charAt(0))?"\\b":"")+b.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(b.charAt(b.length-1))?"\\b":"")):b,e.matchesonscroll=a.showMatchesOnScrollbar(b,!1,{className:"CodeMirror-selection-highlight-scrollbar"}))}
function q(a){var b=a.state.matchHighlighter;b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null,b.matchesonscroll&&(b.matchesonscroll.clear(),b.matchesonscroll=null))}function n(a){a.operation(function(){var b=a.state.matchHighlighter;q(a);if(!a.somethingSelected()&&b.options.showToken){for(var d=!0===b.options.showToken?/[\w$]/:b.options.showToken,c=a.getCursor(),e=a.getLine(c.line),g=c=c.ch;c&&d.test(e.charAt(c-1));)--c;for(;g<e.length&&d.test(e.charAt(g));)++g;c<g&&p(a,e.slice(c,g),d,b.options.style)}else if(d=
a.getCursor("from"),e=a.getCursor("to"),d.line==e.line){if(c=b.options.wordsOnly){a:if(null!==a.getRange(d,e).match(/^\w+$/)){if(0<d.ch&&(c={line:d.line,ch:d.ch-1},c=a.getRange(c,d),null===c.match(/\W/))){c=!1;break a}if(e.ch<a.getLine(d.line).length&&(c={line:e.line,ch:e.ch+1},c=a.getRange(e,c),null===c.match(/\W/))){c=!1;break a}c=!0}else c=!1;c=!c}c||(d=a.getRange(d,e),b.options.trim&&(d=d.replace(/^\s+|\s+$/g,"")),d.length>=b.options.minChars&&p(a,d,!1,b.options.style))}})}function t(a,b,d){return{token:function(c){var e;
if(e=c.match(a))(e=!b)||(e=(!c.start||!b.test(c.string.charAt(c.start-1)))&&(c.pos==c.string.length||!b.test(c.string.charAt(c.pos))));if(e)return d;c.next();c.skipTo(a.charAt(0))||c.skipToEnd()}}}var h={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};f.defineOption("highlightSelectionMatches",!1,function(a,b,d){d&&d!=f.Init&&(q(a),clearTimeout(a.state.matchHighlighter.timeout),a.state.matchHighlighter=null,a.off("cursorActivity",k),a.off("focus",
m));if(b){b=a.state.matchHighlighter=new r(b);if(a.hasFocus())b.active=!0,n(a);else a.on("focus",m);a.on("cursorActivity",k)}})});
// foldcode.js
(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function p(a,b,c,e){function h(l){var f=q(a,b);if(!f||f.to.line-f.from.line<u)return null;if("fold"===e)return f;for(var n=a.findMarksAt(f.from),m=0;m<n.length;++m)if(n[m].__isFold){if(!l)return null;f.cleared=!0;n[m].clear()}return f}if(c&&c.call){var q=c;c=null}else q=k(a,c,"rangeFinder");"number"==
typeof b&&(b=d.Pos(b,0));var u=k(a,c,"minFoldSize"),g=h(!0);if(k(a,c,"scanUp"))for(;!g&&b.line>a.firstLine();)b=d.Pos(b.line-1,0),g=h(!1);if(g&&!g.cleared&&"unfold"!==e){var r=v(a,c,g);d.on(r,"mousedown",function(l){t.clear();d.e_preventDefault(l)});var t=a.markText(g.from,g.to,{replacedWith:r,clearOnEnter:k(a,c,"clearOnEnter"),__isFold:!0});t.on("clear",function(l,f){d.signal(a,"unfold",a,l,f)});d.signal(a,"fold",a,g.from,g.to)}}function v(a,b,c){a=k(a,b,"widget");"function"==typeof a&&(a=a(c.from,
c.to));"string"==typeof a?(c=document.createTextNode(a),a=document.createElement("span"),a.appendChild(c),a.className="CodeMirror-foldmarker"):a&&(a=a.cloneNode(!0));return a}function k(a,b,c){return b&&void 0!==b[c]?b[c]:(a=a.options.foldOptions)&&void 0!==a[c]?a[c]:w[c]}d.newFoldFunction=function(a,b){return function(c,e){p(c,e,{rangeFinder:a,widget:b})}};d.defineExtension("foldCode",function(a,b,c){p(this,a,b,c)});d.defineExtension("isFolded",function(a){a=this.findMarksAt(a);for(var b=0;b<a.length;++b)if(a[b].__isFold)return!0});
d.commands.toggleFold=function(a){a.foldCode(a.getCursor())};d.commands.fold=function(a){a.foldCode(a.getCursor(),null,"fold")};d.commands.unfold=function(a){a.foldCode(a.getCursor(),{scanUp:!1},"unfold")};d.commands.foldAll=function(a){a.operation(function(){for(var b=a.firstLine(),c=a.lastLine();b<=c;b++)a.foldCode(d.Pos(b,0),{scanUp:!1},"fold")})};d.commands.unfoldAll=function(a){a.operation(function(){for(var b=a.firstLine(),c=a.lastLine();b<=c;b++)a.foldCode(d.Pos(b,0),{scanUp:!1},"unfold")})};
d.registerHelper("fold","combine",function(){var a=Array.prototype.slice.call(arguments,0);return function(b,c){for(var e=0;e<a.length;++e){var h=a[e](b,c);if(h)return h}}});d.registerHelper("fold","auto",function(a,b){for(var c=a.getHelpers(b,"fold"),e=0;e<c.length;e++){var h=c[e](a,b);if(h)return h}});var w={rangeFinder:d.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};d.defineOption("foldOptions",null);d.defineExtension("foldOption",function(a,b){return k(this,a,b)})});
// foldgutter.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,e,d){c instanceof String&&(c=String(c));for(var k=c.length,f=0;f<k;f++){var l=c[f];if(e.call(d,l,f,c))return{i:f,v:l}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,e,d){if(c==Array.prototype||c==Object.prototype)return c;c[e]=d.value;return c};$jscomp.getGlobal=function(c){c=["object"==typeof globalThis&&globalThis,c,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<c.length;++e){var d=c[e];if(d&&d.Math==Math)return d}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(c,e){var d=$jscomp.propertyToPolyfillSymbol[e];if(null==d)return c[e];d=c[d];return void 0!==d?d:c[e]};
$jscomp.polyfill=function(c,e,d,k){e&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(c,e,d,k):$jscomp.polyfillUnisolated(c,e,d,k))};$jscomp.polyfillUnisolated=function(c,e,d,k){d=$jscomp.global;c=c.split(".");for(k=0;k<c.length-1;k++){var f=c[k];if(!(f in d))return;d=d[f]}c=c[c.length-1];k=d[c];e=e(k);e!=k&&null!=e&&$jscomp.defineProperty(d,c,{configurable:!0,writable:!0,value:e})};
$jscomp.polyfillIsolated=function(c,e,d,k){var f=c.split(".");c=1===f.length;k=f[0];k=!c&&k in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var l=0;l<f.length-1;l++){var n=f[l];if(!(n in k))return;k=k[n]}f=f[f.length-1];d=$jscomp.IS_SYMBOL_NATIVE&&"es6"===d?k[f]:null;e=e(d);null!=e&&(c?$jscomp.defineProperty($jscomp.polyfills,f,{configurable:!0,writable:!0,value:e}):e!==d&&(void 0===$jscomp.propertyToPolyfillSymbol[f]&&(d=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(f):$jscomp.POLYFILL_PREFIX+d+"$"+f),$jscomp.defineProperty(k,$jscomp.propertyToPolyfillSymbol[f],{configurable:!0,writable:!0,value:e})))};$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(e,d){return $jscomp.findInternal(this,e,d).v}},"es6","es3");
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],c):c(CodeMirror)})(function(c){function e(a){this.options=a;this.from=this.to=0}function d(a,b){a=a.findMarks(q(b,0),q(b+1,0));for(var g=0;g<a.length;++g)if(a[g].__isFold){var h=a[g].find(-1);if(h&&h.line===b)return a[g]}}function k(a){if("string"==typeof a){var b=document.createElement("div");b.className=
a+" CodeMirror-guttermarker-subtle";return b}return a.cloneNode(!0)}function f(a,b,g){var h=a.state.foldGutter.options,v=b-1,C=a.foldOption(h,"minFoldSize"),w=a.foldOption(h,"rangeFinder"),x="string"==typeof h.indicatorFolded&&new RegExp("(^|\\s)"+h.indicatorFolded+"(?:$|\\s)\\s*"),y="string"==typeof h.indicatorOpen&&new RegExp("(^|\\s)"+h.indicatorOpen+"(?:$|\\s)\\s*");a.eachLine(b,g,function(z){++v;var r=null,m=z.gutterMarkers;m&&(m=m[h.gutter]);if(d(a,v)){if(x&&m&&x.test(m.className))return;r=
k(h.indicatorFolded)}else{var t=q(v,0);if((t=w&&w(a,t))&&t.to.line-t.from.line>=C){if(y&&m&&y.test(m.className))return;r=k(h.indicatorOpen)}}(r||m)&&a.setGutterMarker(z,h.gutter,r)})}function l(a){var b=a.getViewport(),g=a.state.foldGutter;g&&(a.operation(function(){f(a,b.from,b.to)}),g.from=b.from,g.to=b.to)}function n(a,b,g){var h=a.state.foldGutter;h&&(h=h.options,g==h.gutter&&((g=d(a,b))?g.clear():a.foldCode(q(b,0),h)))}function A(a,b){"mode"==b&&p(a)}function p(a){var b=a.state.foldGutter;if(b){var g=
b.options;b.from=b.to=0;clearTimeout(b.changeUpdate);b.changeUpdate=setTimeout(function(){l(a)},g.foldOnChangeTimeSpan||600)}}function B(a){var b=a.state.foldGutter;if(b){var g=b.options;clearTimeout(b.changeUpdate);b.changeUpdate=setTimeout(function(){var h=a.getViewport();b.from==b.to||20<h.from-b.to||20<b.from-h.to?l(a):a.operation(function(){h.from<b.from&&(f(a,h.from,b.from),b.from=h.from);h.to>b.to&&(f(a,b.to,h.to),b.to=h.to)})},g.updateViewportTimeSpan||400)}}function u(a,b){var g=a.state.foldGutter;
g&&(b=b.line,b>=g.from&&b<g.to&&f(a,b,b+1))}c.defineOption("foldGutter",!1,function(a,b,g){g&&g!=c.Init&&(a.clearGutter(a.state.foldGutter.options.gutter),a.state.foldGutter=null,a.off("gutterClick",n),a.off("changes",p),a.off("viewportChange",B),a.off("fold",u),a.off("unfold",u),a.off("swapDoc",p),a.off("optionChange",A));b&&(g=a.state,!0===b&&(b={}),null==b.gutter&&(b.gutter="CodeMirror-foldgutter"),null==b.indicatorOpen&&(b.indicatorOpen="CodeMirror-foldgutter-open"),null==b.indicatorFolded&&(b.indicatorFolded=
"CodeMirror-foldgutter-folded"),g.foldGutter=new e(b),l(a),a.on("gutterClick",n),a.on("changes",p),a.on("viewportChange",B),a.on("fold",u),a.on("unfold",u),a.on("swapDoc",p),a.on("optionChange",A))});var q=c.Pos});
// brace-fold.js
(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){function y(d){return function(b,f){function p(n){var g=f.ch;for(var u=0;;){var q=0>=g?-1:c.lastIndexOf(n[0],g-1);if(-1==q){if(1==u)break;u=1;g=c.length}else{if(1==u&&q<f.ch)break;g=b.getTokenTypeAt(a.Pos(e,q+1));if(!/^(comment|string)/.test(g))return{ch:q+1,tokenType:g,pair:n};g=q-1}}}function h(n){var g=
1,u=b.lastLine(),q=n.ch,t=e;a:for(;t<=u;++t)for(var v=b.getLine(t),k=t==e?q:0;;){var w=v.indexOf(n.pair[0],k);k=v.indexOf(n.pair[1],k);0>w&&(w=v.length);0>k&&(k=v.length);k=Math.min(w,k);if(k==v.length)break;if(b.getTokenTypeAt(a.Pos(t,k+1))==n.tokenType)if(k==w)++g;else if(!--g){var x=t;var z=k;break a}++k}return null==x||e==x?null:{from:a.Pos(e,q),to:a.Pos(x,z)}}for(var e=f.line,c=b.getLine(e),m=[],l=0;l<d.length;l++){var r=p(d[l]);r&&m.push(r)}m.sort(function(n,g){return n.ch-g.ch});for(l=0;l<
m.length;l++)if(r=h(m[l]))return r;return null}}a.registerHelper("fold","brace",y([["{","}"],["[","]"]]));a.registerHelper("fold","brace-paren",y([["{","}"],["[","]"],["(",")"]]));a.registerHelper("fold","import",function(d,b){function f(c){if(c<d.firstLine()||c>d.lastLine())return null;var m=d.getTokenAt(a.Pos(c,1));/\S/.test(m.string)||(m=d.getTokenAt(a.Pos(c,m.end+1)));if("keyword"!=m.type||"import"!=m.string)return null;var l=c;for(c=Math.min(d.lastLine(),c+10);l<=c;++l){var r=d.getLine(l).indexOf(";");
if(-1!=r)return{startCh:m.end,end:a.Pos(l,r)}}}b=b.line;var p=f(b),h;if(!p||f(b-1)||(h=f(b-2))&&h.end.line==b-1)return null;for(h=p.end;;){var e=f(h.line+1);if(null==e)break;h=e.end}return{from:d.clipPos(a.Pos(b,p.startCh+1)),to:h}});a.registerHelper("fold","include",function(d,b){function f(e){if(e<d.firstLine()||e>d.lastLine())return null;var c=d.getTokenAt(a.Pos(e,1));/\S/.test(c.string)||(c=d.getTokenAt(a.Pos(e,c.end+1)));if("meta"==c.type&&"#include"==c.string.slice(0,8))return c.start+8}b=b.line;
var p=f(b);if(null==p||null!=f(b-1))return null;for(var h=b;null!=f(h+1);)++h;return{from:a.Pos(b,p+1),to:d.clipPos(a.Pos(h))}})});
// xml-fold.js
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function l(a,b,d,c){this.line=b;this.ch=d;this.cm=a;this.text=a.getLine(b);this.min=c?Math.max(c.from,a.firstLine()):a.firstLine();this.max=c?Math.min(c.to-1,a.lastLine()):a.lastLine()}function n(a,b){return(a=a.cm.getTokenTypeAt(k(a.line,b)))&&/\btag\b/.test(a)}function u(a){if(!(a.line>=a.max))return a.ch=
0,a.text=a.cm.getLine(++a.line),!0}function v(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function r(a){for(;;){var b=a.text.indexOf(">",a.ch);if(-1==b)if(u(a))continue;else break;if(n(a,b+1)){var d=a.text.lastIndexOf("/",b);d=-1<d&&!/\S/.test(a.text.slice(d+1,b));a.ch=b+1;return d?"selfClose":"regular"}a.ch=b+1}}function t(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(-1==b)if(v(a))continue;else break;if(n(a,b+1)){p.lastIndex=b;a.ch=b;var d=p.exec(a.text);
if(d&&d.index==b)return d}else a.ch=b}}function w(a){for(;;){p.lastIndex=a.ch;var b=p.exec(a.text);if(!b)if(u(a))continue;else break;if(n(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}function q(a,b){for(var d=[];;){var c=w(a),f,e=a.line,g=a.ch-(c?c[0].length:0);if(!c||!(f=r(a)))break;if("selfClose"!=f)if(c[1]){for(var m=d.length-1;0<=m;--m)if(d[m]==c[2]){d.length=m;break}if(0>m&&(!b||b==c[2]))return{tag:c[2],from:k(e,g),to:k(a.line,a.ch)}}else d.push(c[2])}}function x(a,b){for(var d=
[];;){var c;a:for(c=a;;){var f=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(-1==f)if(v(c))continue;else{c=void 0;break a}if(n(c,f+1)){var e=c.text.lastIndexOf("/",f);e=-1<e&&!/\S/.test(c.text.slice(e+1,f));c.ch=f+1;c=e?"selfClose":"regular";break a}else c.ch=f}if(!c)break;if("selfClose"==c)t(a);else{c=a.line;f=a.ch;e=t(a);if(!e)break;if(e[1])d.push(e[2]);else{for(var g=d.length-1;0<=g;--g)if(d[g]==e[2]){d.length=g;break}if(0>g&&(!b||b==e[2]))return{tag:e[2],from:k(a.line,a.ch),to:k(c,f)}}}}}var k=h.Pos,
p=RegExp("<(/?)([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][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");h.registerHelper("fold","xml",function(a,b){for(a=new l(a,b.line,0);;){var d=w(a);if(!d||
a.line!=b.line)break;var c=r(a);if(!c)break;if(!d[1]&&"selfClose"!=c){b=k(a.line,a.ch);if(d=a=q(a,d[2]))d=a.from,d=0<(d.line-b.line||d.ch-b.ch);return d?{from:b,to:a.from}:null}}});h.findMatchingTag=function(a,b,d){var c=new l(a,b.line,b.ch,d);if(-1!=c.text.indexOf(">")||-1!=c.text.indexOf("<")){var f=r(c),e=f&&k(c.line,c.ch),g=f&&t(c);if(f&&g&&!(0<(c.line-b.line||c.ch-b.ch))){b={from:k(c.line,c.ch),to:e,tag:g[2]};if("selfClose"==f)return{open:b,close:null,at:"open"};if(g[1])return{open:x(c,g[2]),
close:b,at:"close"};c=new l(a,e.line,e.ch,d);return{open:b,close:q(c,g[2]),at:"open"}}}};h.findEnclosingTag=function(a,b,d,c){for(var f=new l(a,b.line,b.ch,d);;){var e=x(f,c);if(!e)break;var g=new l(a,b.line,b.ch,d);if(g=q(g,e.tag))return{open:e,close:g}}};h.scanForClosingTag=function(a,b,d,c){a=new l(a,b.line,b.ch,c?{from:0,to:c}:null);return q(a,d)}});
// indent-fold.js
(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){function g(b,c){var e=b.getLine(c),d=e.search(/\S/);return-1==d||/\bcomment\b/.test(b.getTokenTypeAt(a.Pos(c,d+1)))?-1:a.countColumn(e,null,b.getOption("tabSize"))}a.registerHelper("fold","indent",function(b,c){var e=g(b,c.line);if(!(0>e)){for(var d=null,f=c.line+1,k=b.lastLine();f<=k;++f){var h=g(b,f);
if(-1!=h)if(h>e)d=f;else break}if(d)return{from:a.Pos(c.line,b.getLine(c.line).length),to:a.Pos(d,b.getLine(d).length)}}})});
// comment-fold.js
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){c.registerGlobalHelper("fold","comment",function(d){return d.blockCommentStart&&d.blockCommentEnd},function(d,e){var f=d.getModeAt(e),m=f.blockCommentStart;f=f.blockCommentEnd;if(m&&f){for(var g=e.line,h=d.getLine(g),a=e.ch,k=0;;)if(a=0>=a?-1:h.lastIndexOf(m,a-1),-1==a){if(1==k)return;k=1;a=h.length}else{if(1==
k&&a<e.ch)return;if(/comment/.test(d.getTokenTypeAt(c.Pos(g,a+1)))&&(0==a||h.slice(a-f.length,a)==f||!/comment/.test(d.getTokenTypeAt(c.Pos(g,a))))){e=a+m.length;break}--a}h=1;k=d.lastLine();a=g;a:for(;a<=k;++a)for(var l=d.getLine(a),b=a==g?e:0;;){var n=l.indexOf(m,b);b=l.indexOf(f,b);0>n&&(n=l.length);0>b&&(b=l.length);b=Math.min(n,b);if(b==l.length)break;if(b==n)++h;else if(!--h){var p=a;var q=b;break a}++b}if(null!=p&&(g!=p||q!=e))return{from:c.Pos(g,e),to:c.Pos(p,q)}}})});
// matchtags.js
(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],d):d(CodeMirror)})(function(d){function f(a){a.state.tagHit&&a.state.tagHit.clear();a.state.tagOther&&a.state.tagOther.clear();a.state.tagHit=a.state.tagOther=null}function e(a){a.state.failedTagMatch=!1;a.operation(function(){f(a);if(!a.somethingSelected()){var b=a.getCursor(),c=a.getViewport();
c.from=Math.min(c.from,b.line);c.to=Math.max(b.line+1,c.to);if(b=d.findMatchingTag(a,b,c))a.state.matchBothTags&&(c="open"==b.at?b.open:b.close)&&(a.state.tagHit=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"})),(b="close"==b.at?b.open:b.close)?a.state.tagOther=a.markText(b.from,b.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}})}function g(a){a.state.failedTagMatch&&e(a)}d.defineOption("matchTags",!1,function(a,b,c){c&&c!=d.Init&&(a.off("cursorActivity",e),a.off("viewportChange",
g),f(a));b&&(a.state.matchBothTags="object"==typeof b&&b.bothTags,a.on("cursorActivity",e),a.on("viewportChange",g),e(a))});d.commands.toMatchingTag=function(a){var b=d.findMatchingTag(a,a.getCursor());b&&(b="close"==b.at?b.open:b.close)&&a.extendSelection(b.to,b.from)}});
// dialog.js
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function m(b,g,a){b=b.getWrapperElement();var d=b.appendChild(document.createElement("div"));d.className=a?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top";"string"==typeof g?d.innerHTML=g:d.appendChild(g);c.addClass(b,"dialog-opened");return d}function n(b,g){b.state.currentNotificationClose&&
b.state.currentNotificationClose();b.state.currentNotificationClose=g}c.defineExtension("openDialog",function(b,g,a){function d(e){if("string"==typeof e)f.value=e;else if(!k&&(k=!0,c.rmClass(h.parentNode,"dialog-opened"),h.parentNode.removeChild(h),l.focus(),a.onClose))a.onClose(h)}a||(a={});n(this,null);var h=m(this,b,a.bottom),k=!1,l=this,f=h.getElementsByTagName("input")[0];if(f){f.focus();a.value&&(f.value=a.value,!1!==a.selectValueOnOpen&&f.select());if(a.onInput)c.on(f,"input",function(e){a.onInput(e,
f.value,d)});if(a.onKeyUp)c.on(f,"keyup",function(e){a.onKeyUp(e,f.value,d)});c.on(f,"keydown",function(e){if(!(a&&a.onKeyDown&&a.onKeyDown(e,f.value,d))){if(27==e.keyCode||!1!==a.closeOnEnter&&13==e.keyCode)f.blur(),c.e_stop(e),d();13==e.keyCode&&g(f.value,e)}});if(!1!==a.closeOnBlur)c.on(h,"focusout",function(e){null!==e.relatedTarget&&d()})}else if(b=h.getElementsByTagName("button")[0]){c.on(b,"click",function(){d();l.focus()});if(!1!==a.closeOnBlur)c.on(b,"blur",d);b.focus()}return d});c.defineExtension("openConfirm",
function(b,g,a){function d(){k||(k=!0,c.rmClass(h.parentNode,"dialog-opened"),h.parentNode.removeChild(h),l.focus())}n(this,null);var h=m(this,b,a&&a.bottom);b=h.getElementsByTagName("button");var k=!1,l=this,f=1;b[0].focus();for(a=0;a<b.length;++a){var e=b[a];(function(p){c.on(e,"click",function(q){c.e_preventDefault(q);d();p&&p(l)})})(g[a]);c.on(e,"blur",function(){--f;setTimeout(function(){0>=f&&d()},200)});c.on(e,"focus",function(){++f})}});c.defineExtension("openNotification",function(b,g){function a(){h||
(h=!0,clearTimeout(k),c.rmClass(d.parentNode,"dialog-opened"),d.parentNode.removeChild(d))}n(this,a);var d=m(this,b,g&&g.bottom),h=!1,k;b=g&&"undefined"!==typeof g.duration?g.duration:5E3;c.on(d,"click",function(l){c.e_preventDefault(l);a()});b&&(k=setTimeout(a,b));return a})});
// vim.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(t,x,p){t instanceof String&&(t=String(t));for(var B=t.length,C=0;C<B;C++){var K=t[C];if(x.call(p,K,C,t))return{i:C,v:K}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(t,x,p){if(t==Array.prototype||t==Object.prototype)return t;t[x]=p.value;return t};$jscomp.getGlobal=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var x=0;x<t.length;++x){var p=t[x];if(p&&p.Math==Math)return p}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(t,x){var p=$jscomp.propertyToPolyfillSymbol[x];if(null==p)return t[x];p=t[p];return void 0!==p?p:t[x]};
$jscomp.polyfill=function(t,x,p,B){x&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(t,x,p,B):$jscomp.polyfillUnisolated(t,x,p,B))};$jscomp.polyfillUnisolated=function(t,x,p,B){p=$jscomp.global;t=t.split(".");for(B=0;B<t.length-1;B++){var C=t[B];if(!(C in p))return;p=p[C]}t=t[t.length-1];B=p[t];x=x(B);x!=B&&null!=x&&$jscomp.defineProperty(p,t,{configurable:!0,writable:!0,value:x})};
$jscomp.polyfillIsolated=function(t,x,p,B){var C=t.split(".");t=1===C.length;B=C[0];B=!t&&B in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var K=0;K<C.length-1;K++){var T=C[K];if(!(T in B))return;B=B[T]}C=C[C.length-1];p=$jscomp.IS_SYMBOL_NATIVE&&"es6"===p?B[C]:null;x=x(p);null!=x&&(t?$jscomp.defineProperty($jscomp.polyfills,C,{configurable:!0,writable:!0,value:x}):x!==p&&(void 0===$jscomp.propertyToPolyfillSymbol[C]&&(p=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[C]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(C):$jscomp.POLYFILL_PREFIX+p+"$"+C),$jscomp.defineProperty(B,$jscomp.propertyToPolyfillSymbol[C],{configurable:!0,writable:!0,value:x})))};$jscomp.polyfill("Array.prototype.find",function(t){return t?t:function(x,p){return $jscomp.findInternal(this,x,p).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(t){var x=0;return function(){return x<t.length?{done:!1,value:t[x++]}:{done:!0}}};$jscomp.arrayIterator=function(t){return{next:$jscomp.arrayIteratorImpl(t)}};
$jscomp.initSymbol=function(){};$jscomp.polyfill("Symbol",function(t){if(t)return t;var x=function(K,T){this.$jscomp$symbol$id_=K;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:T})};x.prototype.toString=function(){return this.$jscomp$symbol$id_};var p="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",B=0,C=function(K){if(this instanceof C)throw new TypeError("Symbol is not a constructor");return new x(p+(K||"")+"_"+B++,K)};return C},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var x="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),p=0;p<x.length;p++){var B=$jscomp.global[x[p]];"function"===typeof B&&"function"!=typeof B.prototype[t]&&$jscomp.defineProperty(B.prototype,t,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return t},"es6",
"es3");$jscomp.iteratorPrototype=function(t){t={next:t};t[Symbol.iterator]=function(){return this};return t};$jscomp.iteratorFromArray=function(t,x){t instanceof String&&(t+="");var p=0,B=!1,C={next:function(){if(!B&&p<t.length){var K=p++;return{value:x(K,t[K]),done:!1}}B=!0;return{done:!0,value:void 0}}};C[Symbol.iterator]=function(){return C};return C};$jscomp.polyfill("Array.prototype.keys",function(t){return t?t:function(){return $jscomp.iteratorFromArray(this,function(x){return x})}},"es6","es3");
$jscomp.checkStringArgs=function(t,x,p){if(null==t)throw new TypeError("The 'this' value for String.prototype."+p+" must not be null or undefined");if(x instanceof RegExp)throw new TypeError("First argument to String.prototype."+p+" must not be a regular expression");return t+""};
$jscomp.polyfill("String.prototype.repeat",function(t){return t?t:function(x){var p=$jscomp.checkStringArgs(this,null,"repeat");if(0>x||1342177279<x)throw new RangeError("Invalid count value");x|=0;for(var B="";x;)if(x&1&&(B+=p),x>>>=1)p+=p;return B}},"es6","es3");
(function(t){"object"==typeof exports&&"object"==typeof module?t(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"],t):t(CodeMirror)})(function(t){function x(p){function B(a,b){a=a.state.vim;if(!a||a.insertMode)return b.head;var c=a.sel.head;if(!c)return b.head;
if(!a.visualBlock||b.head.line==c.line)return b.from()!=b.anchor||b.empty()||b.head.line!=c.line||b.head.ch==c.ch?b.head:new r(b.head.line,b.head.ch-1)}function C(a){a.setOption("disableInput",!0);a.setOption("showCursorWhenSelecting",!1);p.signal(a,"vim-mode-change",{mode:"normal"});a.on("cursorActivity",Na);pa(a);p.on(a.getInputField(),"paste",Oa(a))}function K(a,b){this==p.keyMap.vim&&(a.options.$customCursor=null,p.rmClass(a.getWrapperElement(),"cm-fat-cursor"));b&&b.attach==T||(a.setOption("disableInput",
!1),a.off("cursorActivity",Na),p.off(a.getInputField(),"paste",Oa(a)),a.state.vim=null,qa&&clearTimeout(qa))}function T(a,b){this==p.keyMap.vim&&(a.curOp&&(a.curOp.selectionChanged=!0),a.options.$customCursor=B,p.addClass(a.getWrapperElement(),"cm-fat-cursor"));b&&b.attach==T||C(a)}function ya(a,b){if(b){if(this[a])return this[a];a=Cb(a);if(!a)return!1;var c=Z.findKey(b,a);"function"==typeof c&&p.signal(b,"vim-keypress",a);return c}}function Cb(a){if("'"==a.charAt(0))return a.charAt(1);a=a.split(/-(?!$)/);
var b=a[a.length-1];if(1==a.length&&1==a[0].length||2==a.length&&"Shift"==a[0]&&1==b.length)return!1;for(var c=!1,d=0;d<a.length;d++){var f=a[d];f in Pa?a[d]=Pa[f]:c=!0;f in Qa&&(a[d]=Qa[f])}if(!c)return!1;ja.test(b)&&(a[a.length-1]=b.toLowerCase());return"<"+a.join("-")+">"}function Oa(a){var b=a.state.vim;b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(L(a.getCursor(),0,1)),ra.enterInsertMode(a,{},b))});return b.onPasteFn}function za(a,b){for(var c=[],d=a;d<a+b;d++)c.push(String.fromCharCode(d));
return c}function Aa(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function P(a){return/^\s*$/.test(a)}function ka(a){return-1!=".?!".indexOf(a)}function Ba(a,b){for(var c=0;c<b.length;c++)if(b[c]==a)return!0;return!1}function sa(a,b,c,d,f){if(void 0===b&&!f)throw Error("defaultValue is required unless callback is provided");c||(c="string");aa[a]={type:c,defaultValue:b,callback:f};if(d)for(c=0;c<d.length;c++)aa[d[c]]=aa[a];b&&Ca(a,b)}function Ca(a,b,c,d){var f=aa[a];d=d||{};d=d.scope;if(!f)return Error("Unknown option: "+
a);if("boolean"==f.type){if(b&&!0!==b)return Error("Invalid argument: "+a+"="+b);!1!==b&&(b=!0)}f.callback?("local"!==d&&f.callback(b,void 0),"global"!==d&&c&&f.callback(b,c)):("local"!==d&&(f.value="boolean"==f.type?!!b:b),"global"!==d&&c&&(c.state.vim.options[a]={value:b}))}function fa(a,b,c){var d=aa[a];c=c||{};c=c.scope;if(!d)return Error("Unknown option: "+a);if(d.callback){a=b&&d.callback(void 0,b);if("global"!==c&&void 0!==a)return a;if("local"!==c)return d.callback()}else return a="global"!==
c&&b&&b.state.vim.options[a],(a||"local"!==c&&d||{}).value}function Ra(){this.latestRegister=void 0;this.isRecording=this.isPlaying=!1;this.replaySearchQueries=[];this.onRecordingDone=void 0;this.lastInsertModeChanges=Sa()}function pa(a){a.state.vim||(a.state.vim={inputState:new ta,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,
sel:{},options:{}});return a.state.vim}function Ta(){v={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Db(),macroModeState:new Ra,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Ua({}),searchHistoryController:new Da,exCommandHistoryController:new Da};for(var a in aa){var b=aa[a];b.value=b.defaultValue}}function ta(){this.prefixRepeat=[];this.motionRepeat=[];this.motionArgs=this.motion=this.operatorArgs=this.operator=null;this.keyBuffer=
[];this.registerName=null}function N(a,b){a.state.vim.inputState=new ta;p.signal(a,"vim-command-done",b)}function U(a,b,c){this.clear();this.keyBuffer=[a||""];this.insertModeChanges=[];this.searchQueries=[];this.linewise=!!b;this.blockwise=!!c}function Ua(a){this.registers=a;this.unnamedRegister=a['"']=new U;a["."]=new U;a[":"]=new U;a["/"]=new U}function Da(){this.historyBuffer=[];this.iterator=0;this.initialPrefix=null}function Va(a,b){for(var c=[],d=0;d<b;d++)c.push(a);return c}function Q(a,b){var c=
a.state.vim,d=c.insertMode||c.visualMode;c=Math.min(Math.max(a.firstLine(),b.line),a.lastLine());a=J(a,c)-1+!!d;return new r(c,Math.min(Math.max(0,b.ch),a))}function ua(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function L(a,b,c){"object"===typeof b&&(c=b.ch,b=b.line);return new r(a.line+b,a.ch+c)}function Wa(a,b,c){return function(){for(var d=0;d<c;d++)b(a)}}function H(a){return new r(a.line,a.ch)}function R(a,b){return a.ch==b.ch&&a.line==b.line}function I(a,b){return a.line<
b.line||a.line==b.line&&a.ch<b.ch?!0:!1}function S(a,b){2<arguments.length&&(b=S.apply(void 0,Array.prototype.slice.call(arguments,1)));return I(a,b)?a:b}function ha(a,b){2<arguments.length&&(b=ha.apply(void 0,Array.prototype.slice.call(arguments,1)));return I(a,b)?b:a}function Xa(a,b,c){a=I(a,b);b=I(b,c);return a&&b}function J(a,b){return a.getLine(b).length}function Ea(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Eb(a,b,c){var d=J(a,b);c=Array(c-d+1).join(" ");a.setCursor(new r(b,
d));a.replaceRange(c,a.getCursor())}function Ya(a,b){var c=[],d=a.listSelections(),f=H(a.clipPos(b)),e=!R(b,f),h;a:{var k=a.getCursor("head");for(h=0;h<d.length;h++){var g=R(d[h].anchor,k),l=R(d[h].head,k);if(g||l)break a}h=-1}k=R(d[h].head,d[h].anchor);g=d.length-1;var m=g-h>h?g:0;h=d[m].anchor;var n=Math.min(h.line,f.line);g=Math.max(h.line,f.line);l=h.ch;f=f.ch;d=d[m].head.ch-l;m=f-l;0<d&&0>=m?(l++,e||f--):0>d&&0<=m?(l--,k||f++):0>d&&-1==m&&(l--,f++);for(e=n;e<=g;e++)d={anchor:new r(e,l),head:new r(e,
f)},c.push(d);a.setSelections(c);b.ch=f;h.ch=l;return h}function Za(a,b,c){for(var d=[],f=0;f<c;f++){var e=L(b,f,0);d.push({anchor:e,head:e})}a.setSelections(d,0)}function Fb(a,b){var c=b.lastSelection,d=function(){var e=a.listSelections(),h=e[0];e=e[e.length-1];h=I(h.anchor,h.head)?h.anchor:h.head;e=I(e.anchor,e.head)?e.head:e.anchor;return[h,e]},f=function(){var e=a.getCursor(),h=a.getCursor(),k=c.visualBlock;if(k){h=new r(e.line+k.height,e.ch+k.width);k=[];for(var g=e.line;g<h.line;g++){var l=
new r(g,e.ch),m=new r(g,h.ch);k.push({anchor:l,head:m})}a.setSelections(k)}else g=c.anchorMark.find(),l=c.headMark.find(),k=l.line-g.line,g=l.ch-g.ch,h={line:h.line+k,ch:k?h.ch:g+h.ch},c.visualLine&&(e=new r(e.line,0),h=new r(h.line,J(a,h.line))),a.setSelection(e,h);return[e,h]};return b.visualMode?d():f()}function $a(a,b){var c=b.sel.anchor,d=b.sel.head;b.lastPastedText&&(d=a.posFromIndex(a.indexFromPos(c)+b.lastPastedText.length),b.lastPastedText=null);b.lastSelection={anchorMark:a.setBookmark(c),
headMark:a.setBookmark(d),anchor:H(c),head:H(d),visualMode:b.visualMode,visualLine:b.visualLine,visualBlock:b.visualBlock}}function la(a,b,c){var d=a.state.vim;b=b||d.sel;c=c||d.visualLine?"line":d.visualBlock?"block":"char";b=Fa(a,b,c);a.setSelections(b.ranges,b.primary)}function Fa(a,b,c,d){var f=H(b.head),e=H(b.anchor);if("char"==c)return f=d||I(b.head,b.anchor)?0:1,a=I(b.head,b.anchor)?1:0,f=L(b.head,0,f),e=L(b.anchor,0,a),{ranges:[{anchor:e,head:f}],primary:0};if("line"==c)return I(b.head,b.anchor)?
(f.ch=0,e.ch=J(a,e.line)):(e.ch=0,b=a.lastLine(),f.line>b&&(f.line=b),f.ch=J(a,f.line)),{ranges:[{anchor:e,head:f}],primary:0};if("block"==c){b=Math.min(e.line,f.line);a=e.ch;c=Math.max(e.line,f.line);e=f.ch;a<e?e+=1:a+=1;c=c-b+1;f=f.line==b?0:c-1;d=[];for(var h=0;h<c;h++)d.push({anchor:new r(b+h,a),head:new r(b+h,e)});return{ranges:d,primary:f}}}function V(a,b){var c=a.state.vim;!1!==b&&a.setCursor(Q(a,c.sel.head));$a(a,c);c.visualMode=!1;c.visualLine=!1;c.visualBlock=!1;c.insertMode||p.signal(a,
"vim-mode-change",{mode:"normal"})}function W(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function va(a,b,c,d,f){c=a.getCursor("head");1==a.getSelection().length&&(c=S(c,a.getCursor("anchor")));a=a.getLine(c.line);var e=c.ch;for(f=f?wa[0]:Ga[0];!f(a.charAt(e));)if(e++,e>=a.length)return null;d?f=Ga[0]:(f=wa[0],f(a.charAt(e))||(f=wa[1]));for(d=e;f(a.charAt(d))&&d<a.length;)d++;for(;f(a.charAt(e))&&0<=e;)e--;e++;if(b){for(b=d;/\s/.test(a.charAt(d))&&d<a.length;)d++;if(b==d){for(b=
e;/\s/.test(a.charAt(e-1))&&0<e;)e--;e||(e=b)}}return{start:new r(c.line,e),end:new r(c.line,d)}}function ab(a,b){v.lastCharacterSearch.increment=a;v.lastCharacterSearch.forward=b.forward;v.lastCharacterSearch.selectedCharacter=b.selectedCharacter}function bb(a,b,c,d,f){b=new r(b.line+c.repeat-1,Infinity);c=a.clipPos(b);c.ch--;f||(d.lastHPos=Infinity,d.lastHSPos=a.charCoords(c,"div").left);return b}function Ha(a,b,c,d){for(var f=a.getCursor(),e=f.ch,h,k=0;k<b;k++){h=a.getLine(f.line);var g=d;h=c?
h.indexOf(g,e+1):h.lastIndexOf(g,e-1);if(-1==h)return null;e=h}return new r(a.getCursor().line,h)}function ba(a,b,c,d){Ba(c,Gb)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function cb(a,b,c,d,f){function e(l,m,n){return n?!a.getLine(l)!=!a.getLine(l+m):!!a.getLine(l)&&!a.getLine(l+m)}b=b.line;var h=a.firstLine(),k=a.lastLine(),g=b;if(d){for(;h<=g&&g<=k&&0<c;)e(g,d)&&c--,g+=d;return new r(g,0)}g=a.state.vim;g.visualLine&&e(b,1,!0)&&(g=g.sel.anchor,e(g.line,-1,!0)&&(f&&g.line==b||
(b+=1)));d=!a.getLine(b);for(g=b;g<=k&&c;g++)e(g,1,!0)&&(f&&!a.getLine(g)==d||c--);c=new r(g,0);g>k&&!d?d=!0:f=!1;for(g=b;g>h&&(f&&!a.getLine(g)!=d&&g!=b||!e(g,-1,!0));g--);return{start:new r(g,0),end:c}}function db(a,b,c,d,f){function e(g){0>g.pos+g.dir||g.pos+g.dir>=g.line.length?g.line=null:g.pos+=g.dir}function h(g,l,m,n){g={line:g.getLine(l),ln:l,pos:m,dir:n};if(""===g.line)return{ln:g.ln,pos:g.pos};l=g.pos;for(e(g);null!==g.line;){l=g.pos;if(ka(g.line[g.pos]))if(f){for(e(g);null!==g.line;)if(P(g.line[g.pos]))l=
g.pos,e(g);else break;break}else return{ln:g.ln,pos:g.pos+1};e(g)}return{ln:g.ln,pos:l+1}}function k(g,l,m,n){g=g.getLine(l);l={line:g,ln:l,pos:m,dir:n};if(""===l.line)return{ln:l.ln,pos:l.pos};m=l.pos;for(e(l);null!==l.line;){if(!P(l.line[l.pos])&&!ka(l.line[l.pos]))m=l.pos;else if(ka(l.line[l.pos]))return f?P(l.line[l.pos+1])?{ln:l.ln,pos:l.pos+1}:{ln:l.ln,pos:m}:{ln:l.ln,pos:m};e(l)}l.line=g;return f&&P(l.line[l.pos])?{ln:l.ln,pos:l.pos}:{ln:l.ln,pos:m}}for(b={ln:b.line,pos:b.ch};0<c;)b=0>d?k(a,
b.ln,b.pos,d):h(a,b.ln,b.pos,d),c--;return new r(b.ln,b.pos)}function Hb(a,b,c,d){function f(k,g){0>g.pos+g.dir||g.pos+g.dir>=g.line.length?(g.ln+=g.dir,Aa(k,g.ln)?(g.line=k.getLine(g.ln),g.pos=0<g.dir?0:g.line.length-1):(g.line=null,g.ln=null,g.pos=null)):g.pos+=g.dir}function e(k,g,l,m){var n=k.getLine(g),u=""===n;n={line:n,ln:g,pos:l,dir:m};g={ln:n.ln,pos:n.pos};l=""===n.line;for(f(k,n);null!==n.line;){g.ln=n.ln;g.pos=n.pos;if(""!==n.line||l){if(u&&""!==n.line&&!P(n.line[n.pos]))return{ln:n.ln,
pos:n.pos};!ka(n.line[n.pos])||u||n.pos!==n.line.length-1&&!P(n.line[n.pos+1])||(u=!0)}else return{ln:n.ln,pos:n.pos};f(k,n)}n=k.getLine(g.ln);g.pos=0;for(k=n.length-1;0<=k;--k)if(!P(n[k])){g.pos=k;break}return g}function h(k,g,l,m){var n=k.getLine(g);n={line:n,ln:g,pos:l,dir:m};g={ln:n.ln,pos:null};l=""===n.line;for(f(k,n);null!==n.line;){if(""!==n.line||l){if(ka(n.line[n.pos])&&null!==g.pos&&(n.ln!==g.ln||n.pos+1!==g.pos))return g;""===n.line||P(n.line[n.pos])||(l=!1,g={ln:n.ln,pos:n.pos})}else return null!==
g.pos?g:{ln:n.ln,pos:n.pos};f(k,n)}n=k.getLine(g.ln);for(k=g.pos=0;k<n.length;++k)if(!P(n[k])){g.pos=k;break}return g}for(b={ln:b.line,pos:b.ch};0<c;)b=0>d?h(a,b.ln,b.pos,d):e(a,b.ln,b.pos,d),c--;return new r(b.ln,b.pos)}function eb(){}function X(a){a=a.state.vim;return a.searchState_||(a.searchState_=new eb)}function fb(a,b){b=gb(a,b)||[];if(!b.length)return[];var c=[];if(0===b[0]){for(var d=0;d<b.length;d++)"number"==typeof b[d]&&c.push(a.substring(b[d]+1,b[d+1]));return c}}function gb(a,b){b||
(b="/");for(var c=!1,d=[],f=0;f<a.length;f++){var e=a.charAt(f);c||e!=b||d.push(f);c=!c&&"\\"==e}return d}function da(a){"string"===typeof a&&(a=document.createElement(a));for(var b,c=1;c<arguments.length;c++)if(b=arguments[c])if("object"!==typeof b&&(b=document.createTextNode(b)),b.nodeType)a.appendChild(b);else for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&("$"===d[0]?a.style[d.slice(1)]=b[d]:a.setAttribute(d,b[d]));return a}function G(a,b){b=da("div",{$color:"red",$whiteSpace:"pre",
class:"cm-vim-message"},b);a.openNotification?a.openNotification(b,{bottom:!0,duration:5E3}):alert(b.innerText)}function xa(a,b){var c=b.prefix;var d=b.desc;c=da(document.createDocumentFragment(),da("span",{$fontFamily:"monospace",$whiteSpace:"pre"},c,da("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false"})),d&&da("span",{$color:"#888"},d));a.openDialog?a.openDialog(c,b.onClose,{onKeyDown:b.onKeyDown,onKeyUp:b.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:b.value}):(a="",
"string"!=typeof b.prefix&&b.prefix&&(a+=b.prefix.textContent),b.desc&&(a+=" "+b.desc),b.onClose(prompt(a,"")))}function ma(a,b,c,d){if(b){var f=X(a);c=!!c;d=!!d;v.registerController.getRegister("/").setText(b);if(b instanceof RegExp)var e=b;else{var h=gb(b,"/");if(h.length){var k=b.substring(0,h[0]);e=-1!=b.substring(h[0]).indexOf("i")}else k=b;if(k){if(!fa("pcre")){b=k;h=!1;k=[];for(var g=-1;g<b.length;g++){var l=b.charAt(g)||"",m=b.charAt(g+1)||"",n=m&&-1!="|(){".indexOf(m);h?("\\"===l&&n||k.push(l),
h=!1):"\\"===l?(h=!0,m&&-1!="}".indexOf(m)&&(n=!0),n&&"\\"!==m||k.push(l)):(k.push(l),n&&"\\"!==m&&k.push("\\"))}k=k.join("")}d&&(c=/^[^A-Z]*$/.test(k));e=new RegExp(k,c||e?"im":"m")}else e=null}if(e){hb(a,e);a:if(a=f.getQuery(),e instanceof RegExp&&a instanceof RegExp){c=["global","multiline","ignoreCase","source"];for(d=0;d<c.length;d++)if(b=c[d],e[b]!==a[b]){a=!1;break a}a=!0}else a=!1;if(a)return e;f.setQuery(e);return e}}}function Ib(a){if("^"==a.source.charAt(0))var b=!0;return{token:function(c){if(b&&
!c.sol())c.skipToEnd();else{var d=c.match(a,!1);if(d){if(0==d[0].length)return c.next(),"searching";if(!c.sol()&&(c.backUp(1),!a.exec(c.next()+d[0])))return c.next(),null;c.match(a);return"searching"}for(;!c.eol()&&(c.next(),!c.match(a,!1)););}},query:a}}function hb(a,b){clearTimeout(qa);qa=setTimeout(function(){if(a.state.vim){var c=X(a),d=c.getOverlay();d&&b==d.query||(d&&a.removeOverlay(d),d=Ib(b),a.addOverlay(d),a.showMatchesOnScrollbar&&(c.getScrollbarAnnotate()&&c.getScrollbarAnnotate().clear(),
c.setScrollbarAnnotate(a.showMatchesOnScrollbar(b))),c.setOverlay(d))}},50)}function ib(a,b,c,d){void 0===d&&(d=1);return a.operation(function(){for(var f=a.getCursor(),e=a.getSearchCursor(c,f),h=0;h<d;h++){var k=e.find(b);if(0==h&&k&&R(e.from(),f)){var g=b?e.from():e.to();(k=e.find(b))&&!k[0]&&R(e.from(),g)&&a.getLine(g.line).length==g.ch&&(k=e.find(b))}if(!k&&(e=a.getSearchCursor(c,b?new r(a.lastLine()):new r(a.firstLine(),0)),!e.find(b)))return}return e.from()})}function Jb(a,b,c,d,f){void 0===
d&&(d=1);return a.operation(function(){var e=a.getCursor(),h=a.getSearchCursor(c,e),k=h.find(!b);!f.visualMode&&k&&R(h.from(),e)&&h.find(!b);for(e=0;e<d;e++)if(k=h.find(b),!k&&(h=a.getSearchCursor(c,b?new r(a.lastLine()):new r(a.firstLine(),0)),!h.find(b)))return;return[h.from(),h.to()]})}function Ia(a){var b=X(a);a.removeOverlay(X(a).getOverlay());b.setOverlay(null);b.getScrollbarAnnotate()&&(b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(null))}function Kb(a,b,c){"number"!=typeof a&&(a=
a.line);return b instanceof Array?Ba(a,b):"number"==typeof c?a>=b&&a<=c:a==b}function Ja(a){var b=a.getScrollInfo(),c=a.coordsChar({left:0,top:6+b.top},"local");a=a.coordsChar({left:0,top:b.clientHeight-10+b.top},"local");return{top:c.line,bottom:a.line}}function jb(a,b,c){return"'"==c||"`"==c?v.jumpList.find(a,-1)||new r(0,0):"."==c?kb(a):(a=b.marks[c])&&a.find()}function kb(a){a=a.doc.history.done;for(var b=a.length;b--;)if(a[b].changes)return H(a[b].changes[0].to)}function Lb(a,b,c,d,f,e,h,k,g){function l(){a.operation(function(){for(;!q;)m(),
u();w()})}function m(){var F=a.getRange(e.from(),e.to()).replace(h,k),z=e.to().line;e.replace(F);A=e.to().line;f+=A-z;D=A<z}function n(){var F=y&&H(e.to()),z=e.findNext();z&&!z[0]&&F&&R(e.from(),F)&&(z=e.findNext());return z}function u(){for(;n()&&Kb(e.from(),d,f);)if(c||e.from().line!=A||D){a.scrollIntoView(e.from(),30);a.setSelection(e.from(),e.to());y=e.from();q=!1;return}q=!0}function w(F){F&&F();a.focus();y&&(a.setCursor(y),F=a.state.vim,F.exMode=!1,F.lastHPos=F.lastHSPos=y.ch);g&&g()}a.state.vim.exMode=
!0;var q=!1,y,A,D;u();q?G(a,"No matches for "+h.source):b?xa(a,{prefix:da("span","replace with ",da("strong",k)," (y/n/a/q/l)"),onKeyDown:function(F,z,E){p.e_stop(F);switch(p.keyName(F)){case "Y":m();u();break;case "N":u();break;case "A":F=g;g=void 0;a.operation(l);g=F;break;case "L":m();case "Q":case "Esc":case "Ctrl-C":case "Ctrl-[":w(E)}q&&w(E);return!0}}):(l(),g&&g())}function na(a){var b=a.state.vim,c=v.macroModeState,d=v.registerController.getRegister("."),f=c.isPlaying,e=c.lastInsertModeChanges;
f||(a.off("change",lb),p.off(a.getInputField(),"keydown",mb));!f&&1<b.insertModeRepeat&&(nb(a,b,b.insertModeRepeat-1,!0),b.lastEditInputState.repeatOverride=b.insertModeRepeat);delete b.insertModeRepeat;b.insertMode=!1;a.setCursor(a.getCursor().line,a.getCursor().ch-1);a.setOption("keyMap","vim");a.setOption("disableInput",!0);a.toggleOverwrite(!1);d.setText(e.changes.join(""));p.signal(a,"vim-mode-change",{mode:"normal"});c.isRecording&&(c.isPlaying||(a=v.registerController.getRegister(c.latestRegister))&&
a.pushInsertModeChanges&&a.pushInsertModeChanges(c.lastInsertModeChanges))}function ob(a){O.unshift(a)}function lb(a,b){var c=v.macroModeState,d=c.lastInsertModeChanges;if(!c.isPlaying)for(;b;){d.expectCursorActivityForChange=!0;if(1<d.ignoreCount)d.ignoreCount--;else if("+input"==b.origin||"paste"==b.origin||void 0===b.origin)c=a.listSelections().length,1<c&&(d.ignoreCount=c),c=b.text.join("\n"),d.maybeReset&&(d.changes=[],d.maybeReset=!1),c&&(a.state.overwrite&&!/\n/.test(c)?d.changes.push([c]):
d.changes.push(c));b=b.next}}function Na(a){var b=a.state.vim;b.insertMode?(a=v.macroModeState,a.isPlaying||(a=a.lastInsertModeChanges,a.expectCursorActivityForChange?a.expectCursorActivityForChange=!1:a.maybeReset=!0)):a.curOp.isVimOp||pb(a,b)}function pb(a,b){var c=a.getCursor("anchor"),d=a.getCursor("head");b.visualMode&&!a.somethingSelected()?V(a,!1):b.visualMode||b.insertMode||!a.somethingSelected()||(b.visualMode=!0,b.visualLine=!1,p.signal(a,"vim-mode-change",{mode:"visual"}));if(b.visualMode){var f=
I(d,c)?0:-1,e=I(d,c)?-1:0;d=L(d,0,f);c=L(c,0,e);b.sel={anchor:c,head:d};ba(a,b,"<",S(d,c));ba(a,b,">",ha(d,c))}else b.insertMode||(b.lastHPos=a.getCursor().ch)}function Ka(a){this.keyName=a}function mb(a){function b(){c.maybeReset&&(c.changes=[],c.maybeReset=!1);c.changes.push(new Ka(d));return!0}var c=v.macroModeState.lastInsertModeChanges,d=p.keyName(a);d&&(-1==d.indexOf("Delete")&&-1==d.indexOf("Backspace")||p.lookupKey(d,"vim-insert",b))}function nb(a,b,c,d){function f(){k?ea.processAction(a,
b,b.lastEditActionCommand):ea.evalInput(a,b)}function e(m){0<h.lastInsertModeChanges.changes.length&&(m=b.lastEditActionCommand?m:1,qb(a,h.lastInsertModeChanges.changes,m))}var h=v.macroModeState;h.isPlaying=!0;var k=!!b.lastEditActionCommand,g=b.inputState;b.inputState=b.lastEditInputState;if(k&&b.lastEditActionCommand.interlaceInsertRepeat)for(var l=0;l<c;l++)f(),e(1);else d||f(),e(c);b.inputState=g;b.insertMode&&!d&&na(a);h.isPlaying=!1}function qb(a,b,c){function d(n){if("string"==typeof n)p.commands[n](a);
else n(a);return!0}var f=a.getCursor("head"),e=v.macroModeState.lastInsertModeChanges.visualBlock;e&&(Za(a,f,e+1),c=a.listSelections().length,a.setCursor(f));for(var h=0;h<c;h++){e&&a.setCursor(L(f,h,0));for(var k=0;k<b.length;k++){var g=b[k];if(g instanceof Ka)p.lookupKey(g.keyName,"vim-insert",d);else if("string"==typeof g)a.replaceSelection(g);else{var l=a.getCursor(),m=L(l,0,g[0].length);a.replaceRange(g[0],l,m);a.setCursor(m)}}}e&&a.setCursor(L(f,0,1))}function La(a){var b=new a.constructor;
Object.keys(a).forEach(function(c){var d=a[c];Array.isArray(d)?d=d.slice():d&&"object"==typeof d&&d.constructor!=Object&&(d=La(d));b[c]=d});a.sel&&(b.sel={head:a.sel.head&&H(a.sel.head),anchor:a.sel.anchor&&H(a.sel.anchor)});return b}var r=p.Pos,O=[{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:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},
{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:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",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:"keyToKey",toKeys:"i",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:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{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:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{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-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",
context:"insert"},{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:"gi",type:"action",action:"enterInsertMode",isEdit:!0,
actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},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:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},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},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!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:"zb",type:"action",
action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",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"}],Ma=O.length,rb=[{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:"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:"vglobal",shortName:"v"},{name:"global",shortName:"g"}];p.defineOption("vimMode",
!1,function(a,b,c){b&&"vim"!=a.getOption("keyMap")?a.setOption("keyMap","vim"):!b&&c!=p.Init&&/^vim/.test(a.getOption("keyMap"))&&a.setOption("keyMap","default")});var Pa={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A",CapsLock:""},Qa={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},Mb=/[\d]/,wa=[p.isWordChar,function(a){return a&&!p.isWordChar(a)&&!/\s/.test(a)}],Ga=[function(a){return/\S/.test(a)}],sb=za(65,26),tb=za(97,26),ub=za(48,10),Gb=[].concat(sb,tb,ub,["<",">"]),vb=[].concat(sb,tb,ub,'-".:_/'.split(""));
try{var ja=RegExp("^[\\p{Lu}]$","u")}catch(a){ja=/^[A-Z]$/}var aa={};sa("filetype",void 0,"string",["ft"],function(a,b){if(void 0!==b){if(void 0===a)return a=b.getOption("mode"),"null"==a?"":a;b.setOption("mode",""==a?"null":a)}});var Db=function(){function a(e,h){b+=h;b>c?b=c:b<d&&(b=d);var k=f[(100+b)%100];if(k&&!k.find()){h=0<h?1:-1;var g;e=e.getCursor();do if(b+=h,(k=f[(100+b)%100])&&(g=k.find())&&!R(e,g))break;while(b<c&&b>d)}return k}var b=-1,c=0,d=0,f=Array(100);return{cachedCursor:void 0,
add:function(e,h,k){function g(m){var n=++b%100,u=f[n];u&&u.clear();f[n]=e.setBookmark(m)}var l=f[b%100];l?(l=l.find())&&!R(l,h)&&g(h):g(h);g(k);c=b;d=b-100+1;0>d&&(d=0)},find:function(e,h){var k=b;e=a(e,h);b=k;return e&&e.find()},move:a}},Sa=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};Ra.prototype={exitMacroRecordMode:function(){var a=v.macroModeState;if(a.onRecordingDone)a.onRecordingDone();
a.onRecordingDone=void 0;a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=v.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(b=da("span",{class:"cm-vim-message"},"recording @"+b),this.onRecordingDone=a.openDialog(b,null,{bottom:!0})),this.isRecording=!0)}};var v,oa,Z={enterVimMode:C,buildKeyMap:function(){},getRegisterController:function(){return v.registerController},resetVimGlobalState_:Ta,getVimGlobalState_:function(){return v},maybeInitVimState_:pa,
suppressErrorLogging:!1,InsertModeKey:Ka,map:function(a,b,c){Y.map(a,b,c)},unmap:function(a,b){return Y.unmap(a,b)},noremap:function(a,b,c){function d(n){return n?[n]:["normal","insert","visual"]}for(var f=d(c),e=O.length,h=e-Ma;h<e&&f.length;h++){var k=O[h];if(!(k.keys!=b||c&&k.context&&k.context!==c)&&"ex"!==k.type.substr(0,2)&&"key"!==k.type.substr(0,3)){var g={},l;for(l in k)g[l]=k[l];g.keys=a;c&&!g.context&&(g.context=c);this._mapCommand(g);var m=d(k.context);f=f.filter(function(n){return-1===
m.indexOf(n)})}}},mapclear:function(a){var b=O.length,c=O.slice(0,b-Ma);O=O.slice(b-Ma);if(a)for(b=c.length-1;0<=b;b--){var d=c[b];if(a!==d.context)if(d.context)this._mapCommand(d);else{var f=["normal","insert","visual"],e;for(e in f)if(f[e]!==a){var h={},k;for(k in d)h[k]=d[k];h.context=f[e];this._mapCommand(h)}}}},setOption:Ca,getOption:fa,defineOption:sa,defineEx:function(a,b,c){if(!b)b=a;else if(0!==a.indexOf(b))throw Error('(Vim.defineEx) "'+b+'" is not a prefix of "'+a+'", command not registered');
wb[a]=c;Y.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){a=this.findKey(a,b,c);if("function"===typeof a)return a()},multiSelectHandleKey:function(a,b,c){var d=!1,f=Z.maybeInitVimState_(a),e=f.visualBlock||f.wasInVisualBlock,h=a.isInMultiSelectMode();f.wasInVisualBlock&&!h?f.wasInVisualBlock=!1:h&&f.visualBlock&&(f.wasInVisualBlock=!0);if("<Esc>"!=b||f.insertMode||f.visualMode||!h||"<Esc>"!=f.status)if(e||!h||a.inVirtualSelectionMode)d=Z.handleKey(a,b,c);else{var k=La(f);
a.operation(function(){a.curOp.isVimOp=!0;a.forEachSelection(function(){var g=a.getCursor("head"),l=a.getCursor("anchor"),m=I(g,l)?0:-1,n=I(g,l)?-1:0;g=L(g,0,m);l=L(l,0,n);a.state.vim.sel.head=g;a.state.vim.sel.anchor=l;d=Z.handleKey(a,b,c);a.virtualSelection&&(a.state.vim=La(k))});a.curOp.cursorActivity&&!d&&(a.curOp.cursorActivity=!1);a.state.vim=f},!0)}else N(a);!d||f.visualMode||f.insert||f.visualMode==a.somethingSelected()||pb(a,f);return d},findKey:function(a,b,c){function d(){if("<Esc>"==b){if(h.visualMode)V(a);
else if(h.insertMode)na(a);else return;N(a);return!0}}function f(){if(d())return!0;for(var g=h.inputState.keyBuffer+=b,l=1==b.length,m=ea.matchCommand(g,O,h.inputState,"insert");1<g.length&&"full"!=m.type;){g=h.inputState.keyBuffer=g.slice(1);var n=ea.matchCommand(g,O,h.inputState,"insert");"none"!=n.type&&(m=n)}if("none"==m.type)return N(a),!1;if("partial"==m.type)return oa&&window.clearTimeout(oa),oa=window.setTimeout(function(){h.insertMode&&h.inputState.keyBuffer&&N(a)},fa("insertModeEscKeysTimeout")),
!l;oa&&window.clearTimeout(oa);if(l){l=a.listSelections();for(n=0;n<l.length;n++){var u=l[n].head;a.replaceRange("",L(u,0,-(g.length-1)),u,"+input")}v.macroModeState.lastInsertModeChanges.changes.pop()}N(a);return m.command}function e(){a:{var g=v.macroModeState;if(g.isRecording){if("q"==b){g.exitMacroRecordMode();N(a);var l=!0;break a}"mapping"!=c&&(l=b,g.isPlaying||(g=v.registerController.getRegister(g.latestRegister))&&g.pushText(l))}l=void 0}if(l||d())return!0;l=h.inputState.keyBuffer+=b;if(/^[1-9]\d*$/.test(l))return!0;
g=/^(\d*)(.*)$/.exec(l);if(!g)return N(a),!1;var m=h.visualMode?"visual":"normal";g=g[2]||g[1];h.inputState.operatorShortcut&&h.inputState.operatorShortcut.slice(-1)==g&&(g=h.inputState.operatorShortcut);m=ea.matchCommand(g,O,h.inputState,m);if("none"==m.type)return N(a),!1;if("partial"==m.type)return!0;if("clear"==m.type)return N(a),!0;h.inputState.keyBuffer="";g=/^(\d*)(.*)$/.exec(l);g[1]&&"0"!=g[1]&&h.inputState.pushRepeatDigit(g[1]);return m.command}var h=pa(a);var k=h.insertMode?f():e();return!1===
k?h.insertMode||1!==b.length?void 0:function(){return!0}:!0===k?function(){return!0}:function(){return a.operation(function(){a.curOp.isVimOp=!0;try{if("keyToKey"==k.type)for(var g=k.toKeys,l;g;)l=/<\w+-.+?>|<\w+>|./.exec(g),b=l[0],g=g.substring(l.index+b.length),Z.handleKey(a,b,"mapping");else ea.processCommand(a,h,k)}catch(m){throw a.state.vim=void 0,pa(a),Z.suppressErrorLogging||console.log(m),m;}return!0})}},handleEx:function(a,b){Y.processCommand(a,b)},defineMotion:function(a,b){ca[a]=b},defineAction:function(a,
b){ra[a]=b},defineOperator:function(a,b){xb[a]=b},mapCommand:function(a,b,c,d,f){a={keys:a,type:b};a[b]=c;a[b+"Args"]=d;for(var e in f)a[e]=f[e];ob(a)},_mapCommand:ob,defineRegister:function(a,b){var c=v.registerController.registers;if(!a||1!=a.length)throw Error("Register name must be 1 character");if(c[a])throw Error("Register already defined "+a);c[a]=b;vb.push(a)},exitVisualMode:V,exitInsertMode:na};ta.prototype.pushRepeatDigit=function(a){this.operator?this.motionRepeat=this.motionRepeat.concat(a):
this.prefixRepeat=this.prefixRepeat.concat(a)};ta.prototype.getRepeat=function(){var a=0;if(0<this.prefixRepeat.length||0<this.motionRepeat.length)a=1,0<this.prefixRepeat.length&&(a*=parseInt(this.prefixRepeat.join(""),10)),0<this.motionRepeat.length&&(a*=parseInt(this.motionRepeat.join(""),10));return a};U.prototype={setText:function(a,b,c){this.keyBuffer=[a||""];this.linewise=!!b;this.blockwise=!!c},pushText:function(a,b){b&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0);this.keyBuffer.push(a)},
pushInsertModeChanges:function(a){this.insertModeChanges.push(Sa(a))},pushSearchQuery:function(a){this.searchQueries.push(a)},clear:function(){this.keyBuffer=[];this.insertModeChanges=[];this.searchQueries=[];this.linewise=!1},toString:function(){return this.keyBuffer.join("")}};Ua.prototype={pushText:function(a,b,c,d,f){if("_"!==a){d&&"\n"!==c.charAt(c.length-1)&&(c+="\n");var e=this.isValidRegister(a)?this.getRegister(a):null;if(e)ja.test(a)?e.pushText(c,d):e.setText(c,d,f),this.unnamedRegister.setText(e.toString(),
d);else{switch(b){case "yank":this.registers["0"]=new U(c,d,f);break;case "delete":case "change":-1==c.indexOf("\n")?this.registers["-"]=new U(c,d):(this.shiftNumericRegisters_(),this.registers["1"]=new U(c,d))}this.unnamedRegister.setText(c,d,f)}}},getRegister:function(a){if(!this.isValidRegister(a))return this.unnamedRegister;a=a.toLowerCase();this.registers[a]||(this.registers[a]=new U);return this.registers[a]},isValidRegister:function(a){return a&&Ba(a,vb)},shiftNumericRegisters_:function(){for(var a=
9;2<=a;a--)this.registers[a]=this.getRegister(""+(a-1))}};Da.prototype={nextMatch:function(a,b){var c=this.historyBuffer,d=b?-1:1;null===this.initialPrefix&&(this.initialPrefix=a);for(var f=this.iterator+d;b?0<=f:f<c.length;f+=d)for(var e=c[f],h=0;h<=e.length;h++)if(this.initialPrefix==e.substring(0,h))return this.iterator=f,e;if(f>=c.length)return this.iterator=c.length,this.initialPrefix;if(0>f)return a},pushInput:function(a){var b=this.historyBuffer.indexOf(a);-1<b&&this.historyBuffer.splice(b,
1);a.length&&this.historyBuffer.push(a)},reset:function(){this.initialPrefix=null;this.iterator=this.historyBuffer.length}};var ea={matchCommand:function(a,b,c,d){var f=[];var e=[];for(var h=0;h<b.length;h++){var k=b[h],g;if(g=!("insert"==d&&"insert"!=k.context||k.context&&k.context!=d||c.operator&&"action"==k.type)){var l=a;var m=k.keys;if("<character>"==m.slice(-11)){g=m.length-11;var n=l.slice(0,g);m=m.slice(0,g);l=n==m&&l.length>g?"full":0==m.indexOf(n)?"partial":!1}else l=l==m?"full":0==m.indexOf(l)?
"partial":!1;g=l}g&&("partial"==l&&f.push(k),"full"==l&&e.push(k))}b=f.length&&f;e=e.length&&e;if(!e&&!b)return{type:"none"};if(!e&&b)return{type:"partial"};var u;for(b=0;b<e.length;b++)d=e[b],u||(u=d);if("<character>"==u.keys.slice(-11)){a=(e=/^.*(<[^>]+>)$/.exec(a))?e[1]:a.slice(-1);if(1<a.length)switch(a){case "<CR>":a="\n";break;case "<Space>":a=" ";break;default:a=""}if(!a||1<a.length)return{type:"clear"};c.selectedCharacter=a}return{type:"full",command:u}},processCommand:function(a,b,c){b.inputState.repeatOverride=
c.repeatOverride;switch(c.type){case "motion":this.processMotion(a,b,c);break;case "operator":this.processOperator(a,b,c);break;case "operatorMotion":this.processOperatorMotion(a,b,c);break;case "action":this.processAction(a,b,c);break;case "search":this.processSearch(a,b,c);break;case "ex":case "keyToEx":this.processEx(a,b,c)}},processMotion:function(a,b,c){b.inputState.motion=c.motion;b.inputState.motionArgs=ua(c.motionArgs);this.evalInput(a,b)},processOperator:function(a,b,c){var d=b.inputState;
if(d.operator){if(d.operator==c.operator){d.motion="expandToLine";d.motionArgs={linewise:!0};this.evalInput(a,b);return}N(a)}d.operator=c.operator;d.operatorArgs=ua(c.operatorArgs);1<c.keys.length&&(d.operatorShortcut=c.keys);c.exitVisualBlock&&(b.visualBlock=!1,la(a));b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,f=ua(c.operatorMotionArgs);f&&d&&f.visualLine&&(b.visualLine=!0);this.processOperator(a,b,c);d||this.processMotion(a,b,c)},processAction:function(a,
b,c){var d=b.inputState,f=d.getRepeat(),e=!!f,h=ua(c.actionArgs)||{};d.selectedCharacter&&(h.selectedCharacter=d.selectedCharacter);c.operator&&this.processOperator(a,b,c);c.motion&&this.processMotion(a,b,c);(c.motion||c.operator)&&this.evalInput(a,b);h.repeat=f||1;h.repeatIsExplicit=e;h.registerName=d.registerName;N(a);b.lastMotion=null;c.isEdit&&this.recordLastEdit(b,d,c);ra[c.action](a,h,b)},processSearch:function(a,b,c){function d(q,y,A){v.searchHistoryController.pushInput(q);v.searchHistoryController.reset();
try{ma(a,q,y,A)}catch(D){G(a,"Invalid regex: "+q);N(a);return}ea.processMotion(a,b,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:c.searchArgs.toJumplist}})}function f(q){a.scrollTo(n.left,n.top);d(q,!0,!0);var y=v.macroModeState;y.isRecording&&(y.isPlaying||(y=v.registerController.getRegister(y.latestRegister))&&y.pushSearchQuery&&y.pushSearchQuery(q))}function e(q,y,A){var D=p.keyName(q);if("Up"==D||"Down"==D){var F=q.target?q.target.selectionEnd:0;y=v.searchHistoryController.nextMatch(y,
"Up"==D?!0:!1)||"";A(y);F&&q.target&&(q.target.selectionEnd=q.target.selectionStart=Math.min(F,q.target.value.length))}else"Left"!=D&&"Right"!=D&&"Ctrl"!=D&&"Alt"!=D&&"Shift"!=D&&v.searchHistoryController.reset();try{var z=ma(a,y,!0,!0)}catch(E){}z?a.scrollIntoView(ib(a,!k,z),30):(Ia(a),a.scrollTo(n.left,n.top))}function h(q,y,A){var D=p.keyName(q);"Esc"==D||"Ctrl-C"==D||"Ctrl-["==D||"Backspace"==D&&""==y?(v.searchHistoryController.pushInput(y),v.searchHistoryController.reset(),ma(a,m),Ia(a),a.scrollTo(n.left,
n.top),p.e_stop(q),N(a),A(),a.focus()):"Up"==D||"Down"==D?p.e_stop(q):"Ctrl-U"==D&&(p.e_stop(q),A(""))}if(a.getSearchCursor){var k=c.searchArgs.forward,g=c.searchArgs.wholeWordOnly;X(a).setReversed(!k);var l=k?"/":"?",m=X(a).getQuery(),n=a.getScrollInfo();switch(c.searchArgs.querySrc){case "prompt":g=v.macroModeState;g.isPlaying?(l=g.replaySearchQueries.shift(),d(l,!0,!1)):xa(a,{onClose:f,prefix:l,desc:"(JavaScript regexp)",onKeyUp:e,onKeyDown:h});break;case "wordUnderCursor":var u=va(a,!1,!0,!1,
!0),w=!0;u||(u=va(a,!1,!0,!1,!1),w=!1);u&&(l=a.getLine(u.start.line).substring(u.start.ch,u.end.ch),l=w&&g?"\\b"+l+"\\b":l.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),v.jumpList.cachedCursor=a.getCursor(),a.setCursor(u.start),d(l,!0,!1))}}},processEx:function(a,b,c){function d(e){v.exCommandHistoryController.pushInput(e);v.exCommandHistoryController.reset();Y.processCommand(a,e);N(a)}function f(e,h,k){var g=p.keyName(e);if("Esc"==g||"Ctrl-C"==g||"Ctrl-["==g||"Backspace"==g&&""==h)v.exCommandHistoryController.pushInput(h),
v.exCommandHistoryController.reset(),p.e_stop(e),N(a),k(),a.focus();if("Up"==g||"Down"==g){p.e_stop(e);var l=e.target?e.target.selectionEnd:0;h=v.exCommandHistoryController.nextMatch(h,"Up"==g?!0:!1)||"";k(h);l&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(l,e.target.value.length))}else"Ctrl-U"==g?(p.e_stop(e),k("")):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&v.exCommandHistoryController.reset()}"keyToEx"==c.type?Y.processCommand(a,c.exArgs.input):b.visualMode?xa(a,
{onClose:d,prefix:":",value:"'<,'>",onKeyDown:f,selectValueOnOpen:!1}):xa(a,{onClose:d,prefix:":",onKeyDown:f})},evalInput:function(a,b){var c=b.inputState,d=c.motion,f=c.motionArgs||{},e=c.operator,h=c.operatorArgs||{},k=c.registerName,g=b.sel,l=H(b.visualMode?Q(a,g.head):a.getCursor("head")),m=H(b.visualMode?Q(a,g.anchor):a.getCursor("anchor")),n=H(l);m=H(m);e&&this.recordLastEdit(b,c);var u=void 0!==c.repeatOverride?c.repeatOverride:c.getRepeat();if(0<u&&f.explicitRepeat)f.repeatIsExplicit=!0;
else if(f.noRepeat||!f.explicitRepeat&&0===u)u=1,f.repeatIsExplicit=!1;c.selectedCharacter&&(f.selectedCharacter=h.selectedCharacter=c.selectedCharacter);f.repeat=u;N(a);if(d){var w=ca[d](a,l,f,b,c);b.lastMotion=ca[d];if(!w)return;f.toJumplist&&(d=v.jumpList,(c=d.cachedCursor)?(R(c,w)||v.jumpList.add(a,c,w),delete d.cachedCursor):R(l,w)||v.jumpList.add(a,l,w));if(w instanceof Array){var q=w[0];w=w[1]}w||(w=H(l));b.visualMode?(b.visualBlock&&Infinity===w.ch||(w=Q(a,w)),q&&(q=Q(a,q)),q=q||m,g.anchor=
q,g.head=w,la(a),ba(a,b,"<",I(q,w)?q:w),ba(a,b,">",I(q,w)?w:q)):e||(w=Q(a,w),a.setCursor(w.line,w.ch))}if(e){h.lastSel?(q=m,g=h.lastSel,w=Math.abs(g.head.line-g.anchor.line),l=Math.abs(g.head.ch-g.anchor.ch),w=g.visualLine?new r(m.line+w,m.ch):g.visualBlock?new r(m.line+w,m.ch+l):g.head.line==g.anchor.line?new r(m.line,m.ch+l):new r(m.line+w,m.ch),b.visualMode=!0,b.visualLine=g.visualLine,b.visualBlock=g.visualBlock,g=b.sel={anchor:q,head:w},la(a)):b.visualMode&&(h.lastSel={anchor:H(g.anchor),head:H(g.head),
visualBlock:b.visualBlock,visualLine:b.visualLine});if(b.visualMode){if(q=S(g.head,g.anchor),g=ha(g.head,g.anchor),n=b.visualLine||h.linewise,f=b.visualBlock?"block":n?"line":"char",q=Fa(a,{anchor:q,head:g},f),n)if(g=q.ranges,"block"==f)for(f=0;f<g.length;f++)g[f].head.ch=J(a,g[f].head.line);else"line"==f&&(g[0].head=new r(g[0].head.line+1,0))}else{q=H(q||m);g=H(w||n);I(g,q)&&(n=q,q=g,g=n);if(n=f.linewise||h.linewise)l=g,q.ch=0,l.ch=0,l.line++;else if(f.forward&&(l=g,d=a.getRange(q,l),/\n\s*$/.test(d))){d=
d.split("\n");d.pop();for(c=d.pop();0<d.length&&c&&P(c);c=d.pop())l.line--,l.ch=0;c?(l.line--,l.ch=J(a,l.line)):l.ch=0}q=Fa(a,{anchor:q,head:g},"char",!f.inclusive||n)}a.setSelections(q.ranges,q.primary);b.lastMotion=null;h.repeat=u;h.registerName=k;h.linewise=n;e=xb[e](a,h,q.ranges,m,w);b.visualMode&&V(a,null!=e);e&&a.setCursor(e)}},recordLastEdit:function(a,b,c){var d=v.macroModeState;d.isPlaying||(a.lastEditInputState=b,a.lastEditActionCommand=c,d.lastInsertModeChanges.changes=[],d.lastInsertModeChanges.expectCursorActivityForChange=
!1,d.lastInsertModeChanges.visualBlock=a.visualBlock?a.sel.head.line-a.sel.anchor.line:0)}},ca={moveToTopLine:function(a,b,c){b=Ja(a).top+c.repeat-1;return new r(b,W(a.getLine(b)))},moveToMiddleLine:function(a){var b=Ja(a);b=Math.floor(.5*(b.top+b.bottom));return new r(b,W(a.getLine(b)))},moveToBottomLine:function(a,b,c){b=Ja(a).bottom-c.repeat+1;return new r(b,W(a.getLine(b)))},expandToLine:function(a,b,c){return new r(b.line+c.repeat-1,Infinity)},findNext:function(a,b,c){b=X(a);var d=b.getQuery();
if(d){var f=!c.forward;f=b.isReversed()?!f:f;hb(a,d);return ib(a,f,d,c.repeat)}},findAndSelectNextInclusive:function(a,b,c,d,f){b=X(a);var e=b.getQuery();if(e){var h=!c.forward;h=b.isReversed()?!h:h;if(e=Jb(a,h,e,c.repeat,d)){if(f.operator)return e;f=e[0];e=new r(e[1].line,e[1].ch-1);if(d.visualMode){if(d.visualLine||d.visualBlock)d.visualLine=!1,d.visualBlock=!1,p.signal(a,"vim-mode-change",{mode:"visual",subMode:""});if(a=d.sel.anchor)return b.isReversed()?c.forward?[a,f]:[a,e]:c.forward?[a,e]:
[a,f]}else d.visualMode=!0,d.visualLine=!1,d.visualBlock=!1,p.signal(a,"vim-mode-change",{mode:"visual",subMode:""});return h?[e,f]:[f,e]}}},goToMark:function(a,b,c,d){return(b=jb(a,d,c.selectedCharacter))?c.linewise?{line:b.line,ch:W(a.getLine(b.line))}:b:null},moveToOtherHighlightedEnd:function(a,b,c,d){return d.visualBlock&&c.sameLine?(b=d.sel,[Q(a,new r(b.anchor.line,b.head.ch)),Q(a,new r(b.head.line,b.anchor.ch))]):[d.sel.head,d.sel.anchor]},jumpToMark:function(a,b,c,d){for(var f=0;f<c.repeat;f++){var e=
b,h;for(h in d.marks)if(/^[a-z]$/.test(h)){var k=d.marks[h].find();if(c.forward?!I(k,e):!I(e,k))if(!c.linewise||k.line!=e.line){var g=R(e,b),l=c.forward?Xa(e,k,b):Xa(b,k,e);if(g||l)b=k}}}c.linewise&&(b=new r(b.line,W(a.getLine(b.line))));return b},moveByCharacters:function(a,b,c){a=c.repeat;return new r(b.line,c.forward?b.ch+a:b.ch-a)},moveByLines:function(a,b,c,d){var f=b.ch;switch(d.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:f=
d.lastHPos;break;default:d.lastHPos=f}var e=c.repeat+(c.repeatOffset||0),h=c.forward?b.line+e:b.line-e,k=a.firstLine(),g=a.lastLine();e=a.findPosV(b,c.forward?e:-e,"line",d.lastHSPos);if(c.forward?e.line>h:e.line<h)h=e.line,f=e.ch;if(h<k&&b.line==k)return this.moveToStartOfLine(a,b,c,d);if(h>g&&b.line==g)return bb(a,b,c,d,!0);c.toFirstChar&&(f=W(a.getLine(h)),d.lastHPos=f);d.lastHSPos=a.charCoords(new r(h,f),"div").left;return new r(h,f)},moveByDisplayLines:function(a,b,c,d){switch(d.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;
default:d.lastHSPos=a.charCoords(b,"div").left}var f=c.repeat;b=a.findPosV(b,c.forward?f:-f,"line",d.lastHSPos);b.hitSide&&(c.forward?(c={top:a.charCoords(b,"div").top+8,left:d.lastHSPos},b=a.coordsChar(c,"div")):(c=a.charCoords(new r(a.firstLine(),0),"div"),c.left=d.lastHSPos,b=a.coordsChar(c,"div")));d.lastHPos=b.ch;return b},moveByPage:function(a,b,c){var d=c.repeat;return a.findPosV(b,c.forward?d:-d,"page")},moveByParagraph:function(a,b,c){return cb(a,b,c.repeat,c.forward?1:-1)},moveBySentence:function(a,
b,c){return Hb(a,b,c.repeat,c.forward?1:-1)},moveByScroll:function(a,b,c,d){var f=a.getScrollInfo(),e=c.repeat;e||(e=f.clientHeight/(2*a.defaultTextHeight()));var h=a.charCoords(b,"local");c.repeat=e;b=ca.moveByDisplayLines(a,b,c,d);if(!b)return null;c=a.charCoords(b,"local");a.scrollTo(null,f.top+c.top-h.top);return b},moveByWords:function(a,b,c){var d=b,f=c.repeat;b=!!c.forward;var e=!!c.wordEnd,h=!!c.bigWord;c=H(d);var k=[];(b&&!e||!b&&e)&&f++;for(var g=!(b&&e),l=0;l<f;l++){b:{var m=a;var n=b,
u=h,w=g,q=d.line,y=d.ch,A=m.getLine(q),D=n?1:-1;u=u?Ga:wa;if(w&&""==A){q+=D;A=m.getLine(q);if(!Aa(m,q)){m=null;break b}y=n?0:A.length}for(;;){if(w&&""==A){m={from:0,to:0,line:q};break b}n=0<D?A.length:-1;for(var F,z;y!=n;){for(var E=!1,M=0;M<u.length&&!E;++M)if(u[M](A.charAt(y))){for(F=y;y!=n&&u[M](A.charAt(y));)y+=D;z=y;E=F!=z;if(F!=d.ch||q!=d.line||z!=F+D){m={from:Math.min(F,z+1),to:Math.max(F,z),line:q};break b}}E||(y+=D)}q+=D;if(!Aa(m,q)){m=null;break b}A=m.getLine(q);y=0<D?0:A.length}}if(!m){h=
J(a,a.lastLine());k.push(b?{line:a.lastLine(),from:h,to:h}:{line:0,from:0,to:0});break}k.push(m);d=new r(m.line,b?m.to-1:m.from)}a=k.length!=f;f=k[0];h=k.pop();b&&!e?(a||f.from==c.ch&&f.line==c.line||(h=k.pop()),b=new r(h.line,h.from)):b&&e?b=new r(h.line,h.to-1):!b&&e?(a||f.to==c.ch&&f.line==c.line||(h=k.pop()),b=new r(h.line,h.to)):b=new r(h.line,h.from);return b},moveTillCharacter:function(a,b,c){a=Ha(a,c.repeat,c.forward,c.selectedCharacter);b=c.forward?-1:1;ab(b,c);if(!a)return null;a.ch+=b;
return a},moveToCharacter:function(a,b,c){var d=c.repeat;ab(0,c);return Ha(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat,f=c.forward,e=c.selectedCharacter;c=H(a.getCursor());var h=f?1:-1,k=f?a.lineCount():-1,g=c.ch,l=c.line,m=a.getLine(l);f={lineText:m,nextCh:m.charAt(g),lastCh:null,index:g,symb:e,reverseSymb:(f?{")":"(","}":"{"}:{"(":")","{":"}"})[e],forward:f,depth:0,curMoveThrough:!1};if(g=Nb[e]){e=yb[g].init;g=yb[g].isComplete;for(e&&e(f);l!==k&&d;)f.index+=
h,f.nextCh=f.lineText.charAt(f.index),f.nextCh||(l+=h,f.lineText=a.getLine(l)||"",0<h?f.index=0:(e=f.lineText.length,f.index=0<e?e-1:0),f.nextCh=f.lineText.charAt(f.index)),g(f)&&(c.line=l,c.ch=f.index,d--);a=f.nextCh||f.curMoveThrough?new r(l,f.index):c}else a=c;return a||b},moveToColumn:function(a,b,c,d){c=c.repeat;d.lastHPos=c-1;d.lastHSPos=a.charCoords(b,"div").left;b=a.getCursor().line;return Q(a,new r(b,c-1))},moveToEol:function(a,b,c,d){return bb(a,b,c,d,!1)},moveToFirstNonWhiteSpaceCharacter:function(a,
b){return new r(b.line,W(a.getLine(b.line)))},moveToMatchedSymbol:function(a,b){for(var c=b.line,d=b.ch,f=a.getLine(c),e;d<f.length&&(!(e=f.charAt(d))||-1=="()[]{}".indexOf(e)||(e=a.getTokenTypeAt(new r(c,d+1)),"string"===e||"comment"===e));d++);return d<f.length?(b="<"===d||">"===d?/[(){}[\]<>]/:/[(){}[\]]/,a.findMatchingBracket(new r(c,d),{bracketRegex:b}).to):b},moveToStartOfLine:function(a,b){return new r(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b,c){b=c.forward?a.lastLine():a.firstLine();
c.repeatIsExplicit&&(b=c.repeat-a.getOption("firstLineNumber"));return new r(b,W(a.getLine(b)))},moveToStartOfDisplayLine:function(a){a.execCommand("goLineLeft");return a.getCursor()},moveToEndOfDisplayLine:function(a){a.execCommand("goLineRight");a=a.getCursor();"before"==a.sticky&&a.ch--;return a},textObjectManipulation:function(a,b,c,d){var f={"'":!0,'"':!0,"`":!0},e=c.selectedCharacter;"b"==e?e="(":"B"==e&&(e="{");var h=!c.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",
">":"<"}[e]){var k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[e];var g={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[e];c=a.getLine(b.line).charAt(b.ch)===g?1:0;g=a.scanForBracket(new r(b.line,b.ch+c),-1,void 0,{bracketRegex:k});k=a.scanForBracket(new r(b.line,b.ch+c),1,void 0,{bracketRegex:k});if(g&&k){g=g.pos;k=k.pos;if(g.line==k.line&&g.ch>k.ch||g.line>k.line)b=g,g=k,k=b;h?k.ch+=1:g.ch+=1;b={start:g,end:k}}else b={start:b,end:b}}else if(f[e]){c=
e;b=H(b);d=a.getLine(b.line).split("");e=d.indexOf(c);b.ch<e?b.ch=e:e<b.ch&&d[b.ch]==c&&(k=b.ch,--b.ch);if(d[b.ch]!=c||k)for(e=b.ch;-1<e&&!g;e--)d[e]==c&&(g=e+1);else g=b.ch+1;if(g&&!k)for(e=g,f=d.length;e<f&&!k;e++)d[e]==c&&(k=e);g&&k?(h&&(--g,++k),b={start:new r(b.line,g),end:new r(b.line,k)}):b={start:b,end:b}}else if("W"===e)b=va(a,h,!0,!0);else if("w"===e)b=va(a,h,!0,!1);else if("p"===e)if(b=cb(a,b,c.repeat,0,h),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{if(h=d.inputState.operatorArgs)h.linewise=
!0;b.end.line--}else if("t"===e)b=p.findMatchingTag&&p.findEnclosingTag?(g=p.findMatchingTag(a,b)||p.findEnclosingTag(a,b))&&g.open&&g.close?h?{start:g.open.from,end:g.close.to}:{start:g.open.to,end:g.close.from}:{start:b,end:b}:{start:b,end:b};else if("s"===e)g=a.getLine(b.line),0<b.ch&&ka(g[b.ch])&&--b.ch,g=db(a,b,c.repeat,1,h),h=db(a,b,c.repeat,-1,h),P(a.getLine(h.line)[h.ch])&&P(a.getLine(g.line)[g.ch-1])&&(h={line:h.line,ch:h.ch+1}),b={start:h,end:g};else return null;return a.state.vim.visualMode?
(h=b.start,b=b.end,k=a.state.vim.sel,g=k.head,k=k.anchor,I(b,h)&&(c=b,b=h,h=c),I(g,k)?(g=S(h,g),k=ha(k,b)):(k=S(h,k),g=ha(g,b),g=L(g,0,-1),-1==g.ch&&g.line!=a.firstLine()&&(g=new r(g.line-1,J(a,g.line-1)))),[k,g]):[b.start,b.end]},repeatLastCharacterSearch:function(a,b,c){var d=v.lastCharacterSearch,f=c.repeat,e=c.forward===d.forward,h=(d.increment?1:0)*(e?-1:1);a.moveH(-h,"char");c.inclusive=e?!0:!1;c=Ha(a,f,e,d.selectedCharacter);if(!c)return a.moveH(h,"char"),b;c.ch+=h;return c}},xb={change:function(a,
b,c){var d=a.state.vim;var f=c[0].anchor;var e=c[0].head;if(d.visualMode)if(b.fullLine){e.ch=Number.MAX_VALUE;e.line--;a.setSelection(f,e);var h=a.getSelection();a.replaceSelection("")}else h=a.getSelection(),f=Va("",c.length),a.replaceSelections(f),f=S(c[0].head,c[0].anchor);else{h=a.getRange(f,e);d=d.lastEditInputState||{};if("moveByWords"==d.motion&&!P(h)){var k=/\s+$/.exec(h);k&&d.motionArgs&&d.motionArgs.forward&&(e=L(e,0,-k[0].length),h=h.slice(0,-k[0].length))}d=new r(f.line-1,Number.MAX_VALUE);
k=a.firstLine()==a.lastLine();e.line>a.lastLine()&&b.linewise&&!k?a.replaceRange("",d,e):a.replaceRange("",f,e);b.linewise&&(k||(a.setCursor(d),p.commands.newlineAndIndent(a)),f.ch=Number.MAX_VALUE)}v.registerController.pushText(b.registerName,"change",h,b.linewise,1<c.length);ra.enterInsertMode(a,{head:f},a.state.vim)},"delete":function(a,b,c){var d=a.state.vim;if(d.visualBlock){var f=a.getSelection();var e=Va("",c.length);a.replaceSelections(e);c=S(c[0].head,c[0].anchor)}else e=c[0].anchor,c=c[0].head,
b.linewise&&c.line!=a.firstLine()&&e.line==a.lastLine()&&e.line==c.line-1&&(e.line==a.firstLine()?e.ch=0:e=new r(e.line-1,J(a,e.line-1))),f=a.getRange(e,c),a.replaceRange("",e,c),c=e,b.linewise&&(c=ca.moveToFirstNonWhiteSpaceCharacter(a,e));v.registerController.pushText(b.registerName,"delete",f,b.linewise,d.visualBlock);return Q(a,c)},indent:function(a,b,c){var d=a.state.vim;if(a.indentMore){d=d.visualMode?b.repeat:1;for(var f=0;f<d;f++)b.indentRight?a.indentMore():a.indentLess()}else{f=c[0].anchor.line;
var e=d.visualBlock?c[c.length-1].anchor.line:c[0].head.line;d=d.visualMode?b.repeat:1;b.linewise&&e--;for(var h=f;h<=e;h++)for(f=0;f<d;f++)a.indentLine(h,b.indentRight)}return ca.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},indentAuto:function(a,b,c){a.execCommand("indentAuto");return ca.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,f){for(var e=a.getSelections(),h=[],k=b.toLower,g=0;g<e.length;g++){var l=e[g],m="";if(!0===k)m=l.toLowerCase();else if(!1===k)m=
l.toUpperCase();else for(var n=0;n<l.length;n++){var u=l.charAt(n);m+=ja.test(u)?u.toLowerCase():u.toUpperCase()}h.push(m)}a.replaceSelections(h);return b.shouldMoveCursor?f:!a.state.vim.visualMode&&b.linewise&&c[0].anchor.line+1==c[0].head.line?ca.moveToFirstNonWhiteSpaceCharacter(a,d):b.linewise?d:S(c[0].anchor,c[0].head)},yank:function(a,b,c,d){var f=a.state.vim;a=a.getSelection();c=f.visualMode?S(f.sel.anchor,f.sel.head,c[0].head,c[0].anchor):d;v.registerController.pushText(b.registerName,"yank",
a,b.linewise,f.visualBlock);return c}},ra={jumpListWalk:function(a,b,c){c.visualMode||(c=b.repeat,b=(b=(b=v.jumpList.move(a,b.forward?c:-c))?b.find():void 0)?b:a.getCursor(),a.setCursor(b))},scroll:function(a,b,c){if(!c.visualMode){var d=b.repeat||1;c=a.defaultTextHeight();var f=a.getScrollInfo().top;d*=c;f=b.forward?f+d:f-d;d=H(a.getCursor());var e=a.charCoords(d,"local");b.forward?f>e.top?(d.line+=(f-e.top)/c,d.line=Math.ceil(d.line),a.setCursor(d),e=a.charCoords(d,"local"),a.scrollTo(null,e.top)):
a.scrollTo(null,f):(b=f+a.getScrollInfo().clientHeight,b<e.bottom?(d.line-=(e.bottom-b)/c,d.line=Math.floor(d.line),a.setCursor(d),e=a.charCoords(d,"local"),a.scrollTo(null,e.bottom-a.getScrollInfo().clientHeight)):a.scrollTo(null,f))}},scrollToCursor:function(a,b){var c=a.getCursor().line,d=a.charCoords(new r(c,0),"local"),f=a.getScrollInfo().clientHeight,e=d.top;switch(b.position){case "center":e=d.bottom-f/2;break;case "bottom":b=new r(c,a.getLine(c).length-1),b=a.charCoords(b,"local").bottom-
e,e=e-f+b}a.scrollTo(null,e)},replayMacro:function(a,b,c){var d=b.selectedCharacter;b=b.repeat;var f=v.macroModeState;for("@"==d?d=f.latestRegister:f.latestRegister=d;b--;){var e=a,h=c,k=f,g=d,l=v.registerController.getRegister(g);if(":"==g)l.keyBuffer[0]&&Y.processCommand(e,l.keyBuffer[0]);else{g=l.keyBuffer;var m=0;k.isPlaying=!0;k.replaySearchQueries=l.searchQueries.slice(0);for(var n=0;n<g.length;n++)for(var u=g[n],w,q;u;)w=/<\w+-.+?>|<\w+>|./.exec(u),q=w[0],u=u.substring(w.index+q.length),Z.handleKey(e,
q,"macro"),h.insertMode&&(w=l.insertModeChanges[m++].changes,v.macroModeState.lastInsertModeChanges.changes=w,qb(e,w,1),na(e))}k.isPlaying=!1}},enterMacroRecordMode:function(a,b){var c=v.macroModeState;b=b.selectedCharacter;v.registerController.isValidRegister(b)&&c.enterMacroRecordMode(a,b)},toggleOverwrite:function(a){a.state.overwrite?(a.toggleOverwrite(!1),a.setOption("keyMap","vim-insert"),p.signal(a,"vim-mode-change",{mode:"insert"})):(a.toggleOverwrite(!0),a.setOption("keyMap","vim-replace"),
p.signal(a,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(a,b,c){if(!a.getOption("readOnly")){c.insertMode=!0;c.insertModeRepeat=b&&b.repeat||1;var d=b?b.insertAt:null,f=c.sel,e=b.head||a.getCursor("head"),h=a.listSelections().length;if("eol"==d)e=new r(e.line,J(a,e.line));else if("bol"==d)e=new r(e.line,0);else if("charAfter"==d)e=L(e,0,1);else if("firstNonBlank"==d)e=ca.moveToFirstNonWhiteSpaceCharacter(a,e);else if("startOfSelectedArea"==d){if(!c.visualMode)return;c.visualBlock?
(e=new r(Math.min(f.head.line,f.anchor.line),Math.min(f.head.ch,f.anchor.ch)),h=Math.abs(f.head.line-f.anchor.line)+1):e=f.head.line<f.anchor.line?f.head:new r(f.anchor.line,0)}else if("endOfSelectedArea"==d){if(!c.visualMode)return;c.visualBlock?(e=new r(Math.min(f.head.line,f.anchor.line),Math.max(f.head.ch,f.anchor.ch)+1),h=Math.abs(f.head.line-f.anchor.line)+1):e=f.head.line>=f.anchor.line?L(f.head,0,1):new r(f.anchor.line,0)}else if("inplace"==d){if(c.visualMode)return}else"lastEdit"==d&&(e=
kb(a)||e);a.setOption("disableInput",!1);b&&b.replace?(a.toggleOverwrite(!0),a.setOption("keyMap","vim-replace"),p.signal(a,"vim-mode-change",{mode:"replace"})):(a.toggleOverwrite(!1),a.setOption("keyMap","vim-insert"),p.signal(a,"vim-mode-change",{mode:"insert"}));v.macroModeState.isPlaying||(a.on("change",lb),p.on(a.getInputField(),"keydown",mb));c.visualMode&&V(a);Za(a,e,h)}},toggleVisualMode:function(a,b,c){var d=b.repeat,f=a.getCursor();c.visualMode?c.visualLine^b.linewise||c.visualBlock^b.blockwise?
(c.visualLine=!!b.linewise,c.visualBlock=!!b.blockwise,p.signal(a,"vim-mode-change",{mode:"visual",subMode:c.visualLine?"linewise":c.visualBlock?"blockwise":""}),la(a)):V(a):(c.visualMode=!0,c.visualLine=!!b.linewise,c.visualBlock=!!b.blockwise,b=Q(a,new r(f.line,f.ch+d-1)),c.sel={anchor:f,head:b},p.signal(a,"vim-mode-change",{mode:"visual",subMode:c.visualLine?"linewise":c.visualBlock?"blockwise":""}),la(a),ba(a,c,"<",S(f,b)),ba(a,c,">",ha(f,b)))},reselectLastSelection:function(a,b,c){b=c.lastSelection;
c.visualMode&&$a(a,c);if(b){var d=b.anchorMark.find(),f=b.headMark.find();d&&f&&(c.sel={anchor:d,head:f},c.visualMode=!0,c.visualLine=b.visualLine,c.visualBlock=b.visualBlock,la(a),ba(a,c,"<",S(d,f)),ba(a,c,">",ha(d,f)),p.signal(a,"vim-mode-change",{mode:"visual",subMode:c.visualLine?"linewise":c.visualBlock?"blockwise":""}))}},joinLines:function(a,b,c){if(c.visualMode){var d=a.getCursor("anchor");var f=a.getCursor("head");if(I(f,d)){var e=f;f=d;d=e}f.ch=J(a,f.line)-1}else f=Math.max(b.repeat,2),
d=a.getCursor(),f=Q(a,new r(d.line+f-1,Infinity));for(var h=0,k=d.line;k<f.line;k++){h=J(a,d.line);e=new r(d.line+1,J(a,d.line+1));var g=a.getRange(d,e);g=b.keepSpaces?g.replace(/\n\r?/g,""):g.replace(/\n\s*/g," ");a.replaceRange(g,d,e)}b=new r(d.line,h);c.visualMode&&V(a,!1);a.setCursor(b)},newLineAndEnterInsertMode:function(a,b,c){c.insertMode=!0;var d=H(a.getCursor());d.line!==a.firstLine()||b.after?(d.line=b.after?d.line:d.line-1,d.ch=J(a,d.line),a.setCursor(d),(p.commands.newlineAndIndentContinueComment||
p.commands.newlineAndIndent)(a)):(a.replaceRange("\n",new r(a.firstLine(),0)),a.setCursor(a.firstLine(),0));this.enterInsertMode(a,{repeat:b.repeat},c)},paste:function(a,b,c){var d=H(a.getCursor()),f=v.registerController.getRegister(b.registerName),e=f.toString();if(e){if(b.matchIndent){var h=a.getOption("tabSize"),k=function(q){var y=q.split("\t").length-1;q=q.split(" ").length-1;return y*h+1*q},g=a.getLine(a.getCursor().line),l=k(g.match(/^\s*/)[0]);g=e.replace(/\n$/,"");var m=e!==g,n=k(e.match(/^\s*/)[0]);
e=g.replace(/^\s*/gm,function(q){q=l+(k(q)-n);return 0>q?"":a.getOption("indentWithTabs")?Array(Math.floor(q/h)+1).join("\t"):Array(q+1).join(" ")});e+=m?"\n":""}1<b.repeat&&(e=Array(b.repeat+1).join(e));g=f.linewise;if(f=f.blockwise){e=e.split("\n");g&&e.pop();for(m=0;m<e.length;m++)e[m]=""==e[m]?" ":e[m];d.ch+=b.after?1:0;d.ch=Math.min(J(a,d.line),d.ch)}else g?c.visualMode?e=c.visualLine?e.slice(0,-1):"\n"+e.slice(0,e.length-1)+"\n":b.after?(e="\n"+e.slice(0,e.length-1),d.ch=J(a,d.line)):d.ch=0:
d.ch+=b.after?1:0;var u;if(c.visualMode){c.lastPastedText=e;b=Fb(a,c);d=b[0];b=b[1];m=a.getSelection();var w=a.listSelections();w=Array(w.length).join("1").split("1");c.lastSelection&&(u=c.lastSelection.headMark.find());v.registerController.unnamedRegister.setText(m);f?(a.replaceSelections(w),b=new r(d.line+e.length-1,d.ch),a.setCursor(d),Ya(a,b),a.replaceSelections(e),e=d):c.visualBlock?(a.replaceSelections(w),a.setCursor(d),a.replaceRange(e,d,d),e=d):(a.replaceRange(e,d,b),e=a.posFromIndex(a.indexFromPos(d)+
e.length-1));u&&(c.lastSelection.headMark=a.setBookmark(u));g&&(e.ch=0)}else if(f){a.setCursor(d);for(m=0;m<e.length;m++)u=d.line+m,u>a.lastLine()&&a.replaceRange("\n",new r(u,0)),J(a,u)<d.ch&&Eb(a,u,d.ch);a.setCursor(d);Ya(a,new r(d.line+e.length-1,d.ch));a.replaceSelections(e);e=d}else a.replaceRange(e,d),g&&b.after?e=new r(d.line+1,W(a.getLine(d.line+1))):g&&!b.after?e=new r(d.line,W(a.getLine(d.line))):!g&&b.after?(u=a.indexFromPos(d),e=a.posFromIndex(u+e.length-1)):(u=a.indexFromPos(d),e=a.posFromIndex(u+
e.length));c.visualMode&&V(a,!1);a.setCursor(e)}},undo:function(a,b){a.operation(function(){Wa(a,p.commands.undo,b.repeat)();a.setCursor(a.getCursor("anchor"))})},redo:function(a,b){Wa(a,p.commands.redo,b.repeat)()},setRegister:function(a,b,c){c.inputState.registerName=b.selectedCharacter},setMark:function(a,b,c){ba(a,c,b.selectedCharacter,a.getCursor())},replace:function(a,b,c){var d=b.selectedCharacter,f=a.getCursor(),e=a.listSelections();if(c.visualMode){f=a.getCursor("start");var h=a.getCursor("end")}else h=
a.getLine(f.line),b=f.ch+b.repeat,b>h.length&&(b=h.length),h=new r(f.line,b);"\n"==d?(c.visualMode||a.replaceRange("",f,h),(p.commands.newlineAndIndentContinueComment||p.commands.newlineAndIndent)(a)):(b=a.getRange(f,h),b=b.replace(/[^\n]/g,d),c.visualBlock?(f=Array(a.getOption("tabSize")+1).join(" "),b=a.getSelection(),b=b.replace(/\t/g,f).replace(/[^\n]/g,d).split("\n"),a.replaceSelections(b)):a.replaceRange(b,f,h),c.visualMode?(f=I(e[0].anchor,e[0].head)?e[0].anchor:e[0].head,a.setCursor(f),V(a,
!1)):a.setCursor(L(h,0,-1)))},incrementNumberToken:function(a,b){for(var c=a.getCursor(),d=a.getLine(c.line),f=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,e,h,k;null!==(e=f.exec(d))&&!(h=e.index,k=h+e[0].length,c.ch<k););if((b.backtrack||!(k<=c.ch))&&e){d=e[2]||e[4];f=e[3]||e[5];var g=b.increase?1:-1,l={"0b":2,0:8,"":10,"0x":16}[d.toLowerCase()];b=(parseInt(e[1]+f,l)+g*b.repeat).toString(l);e=d?Array(f.length-b.length+1+e[1].length).join("0"):"";b="-"===b.charAt(0)?"-"+d+e+b.substr(1):d+e+b;e=new r(c.line,
h);k=new r(c.line,k);a.replaceRange(b,e,k);a.setCursor(new r(c.line,h+b.length-1))}},repeatLastEdit:function(a,b,c){if(c.lastEditInputState){var d=b.repeat;d&&b.repeatIsExplicit?c.lastEditInputState.repeatOverride=d:d=c.lastEditInputState.repeatOverride||d;nb(a,c,d,!1)}},indent:function(a,b){a.indentLine(a.getCursor().line,b.indentRight)},exitInsertMode:na},Nb={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},
yb={bracket:{isComplete:function(a){if(a.nextCh===a.symb){if(a.depth++,1<=a.depth)return!0}else a.nextCh===a.reverseSymb&&a.depth--;return!1}},section:{init:function(a){a.curMoveThrough=!0;a.symb=(a.forward?"]":"[")===a.symb?"{":"}"},isComplete:function(a){return 0===a.index&&a.nextCh===a.symb}},comment:{isComplete:function(a){var b="*"===a.lastCh&&"/"===a.nextCh;a.lastCh=a.nextCh;return b}},method:{init:function(a){a.symb="m"===a.symb?"{":"}";a.reverseSymb="{"===a.symb?"}":"{"},isComplete:function(a){return a.nextCh===
a.symb?!0:!1}},preprocess:{init:function(a){a.index=0},isComplete:function(a){if("#"===a.nextCh){var b=a.lineText.match(/^#(\w+)/)[1];if("endif"===b){if(a.forward&&0===a.depth)return!0;a.depth++}else if("if"===b){if(!a.forward&&0===a.depth)return!0;a.depth--}if("else"===b&&0===a.depth)return!0}return!1}}};sa("pcre",!0,"boolean");eb.prototype={getQuery:function(){return v.query},setQuery:function(a){v.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=
a},isReversed:function(){return v.isReversed},setReversed:function(a){v.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var zb={"\\n":"\n","\\r":"\r","\\t":"\t"},Ab={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t","\\&":"&"},qa=0,Bb=function(){this.buildCommandMap_()};Bb.prototype={processCommand:function(a,b,c){var d=this;a.operation(function(){a.curOp.isVimOp=!0;d._processCommand(a,b,c)})},_processCommand:function(a,b,
c){var d=a.state.vim,f=v.registerController.getRegister(":"),e=f.toString();d.visualMode&&V(a);d=new p.StringStream(b);f.setText(b);c=c||{};c.input=b;try{this.parseInput_(a,d,c)}catch(g){throw G(a,g.toString()),g;}var h;if(c.commandName){if(h=this.matchCommand_(c.commandName)){var k=h.name;h.excludeFromCommandHistory&&f.setText(e);this.parseCommandArgs_(d,c,h);if("exToKey"==h.type){for(b=0;b<h.toKeys.length;b++)Z.handleKey(a,h.toKeys[b],"mapping");return}if("exToEx"==h.type){this.processCommand(a,
h.toInput);return}}}else void 0!==c.line&&(k="move");if(k)try{wb[k](a,c),h&&h.possiblyAsync||!c.callback||c.callback()}catch(g){throw G(a,g.toString()),g;}else G(a,'Not an editor command ":'+b+'"')},parseInput_:function(a,b,c){b.eatWhile(":");b.eat("%")?(c.line=a.firstLine(),c.lineEnd=a.lastLine()):(c.line=this.parseLineSpec_(a,b),void 0!==c.line&&b.eat(",")&&(c.lineEnd=this.parseLineSpec_(a,b)));a=b.match(/^(\w+|!!|@@|[!#&*<=>@~])/);c.commandName=a?a[1]:b.match(/.*/)[0];return c},parseLineSpec_:function(a,
b){var c=b.match(/^(\d+)/);if(c)return parseInt(c[1],10)-1;switch(b.next()){case ".":return this.parseLineSpecOffset_(b,a.getCursor().line);case "$":return this.parseLineSpecOffset_(b,a.lastLine());case "'":c=b.next();a=jb(a,a.state.vim,c);if(!a)throw Error("Mark not set");return this.parseLineSpecOffset_(b,a.line);case "-":case "+":return b.backUp(1),this.parseLineSpecOffset_(b,a.getCursor().line);default:b.backUp(1)}},parseLineSpecOffset_:function(a,b){if(a=a.match(/^([+-])?(\d+)/)){var c=parseInt(a[2],
10);b="-"==a[1]?b-c:b+c}return b},parseCommandArgs_:function(a,b,c){a.eol()||(b.argString=a.match(/.*/)[0],a=c.argDelimiter||/\s+/,a=Ea(b.argString).split(a),a.length&&a[0]&&(b.args=a))},matchCommand_:function(a){for(var b=a.length;0<b;b--){var c=a.substring(0,b);if(this.commandMap_[c]&&(c=this.commandMap_[c],0===c.name.indexOf(a)))return c}return null},buildCommandMap_:function(){this.commandMap_={};for(var a=0;a<rb.length;a++){var b=rb[a];this.commandMap_[b.shortName||b.name]=b}},map:function(a,
b,c){if(":"!=a&&":"==a.charAt(0)){if(c)throw Error("Mode not supported for ex mappings");c=a.substring(1);":"!=b&&":"==b.charAt(0)?this.commandMap_[c]={name:c,type:"exToEx",toInput:b.substring(1),user:!0}:this.commandMap_[c]={name:c,type:"exToKey",toKeys:b,user:!0}}else b=":"!=b&&":"==b.charAt(0)?{keys:a,type:"keyToEx",exArgs:{input:b.substring(1)}}:{keys:a,type:"keyToKey",toKeys:b},c&&(b.context=c),O.unshift(b)},unmap:function(a,b){if(":"!=a&&":"==a.charAt(0)){if(b)throw Error("Mode not supported for ex mappings");
a=a.substring(1);if(this.commandMap_[a]&&this.commandMap_[a].user)return delete this.commandMap_[a],!0}else for(var c=0;c<O.length;c++)if(a==O[c].keys&&O[c].context===b)return O.splice(c,1),!0}};var wb={colorscheme:function(a,b){!b.args||1>b.args.length?G(a,a.getOption("theme")):a.setOption("theme",b.args[0])},map:function(a,b,c){var d=b.args;!d||2>d.length?a&&G(a,"Invalid mapping: "+b.input):Y.map(d[0],d[1],c)},imap:function(a,b){this.map(a,b,"insert")},nmap:function(a,b){this.map(a,b,"normal")},
vmap:function(a,b){this.map(a,b,"visual")},unmap:function(a,b,c){var d=b.args;(!d||1>d.length||!Y.unmap(d[0],c))&&a&&G(a,"No such mapping: "+b.input)},move:function(a,b){ea.processCommand(a,a.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:b.line+1})},set:function(a,b){var c=b.args,d=b.setCfg||{};if(!c||1>c.length)a&&G(a,"Invalid mapping: "+b.input);else{var f=c[0].split("=");c=f[0];f=f[1];var e=!1;if("?"==c.charAt(c.length-
1)){if(f)throw Error("Trailing characters: "+b.argString);c=c.substring(0,c.length-1);e=!0}void 0===f&&"no"==c.substring(0,2)&&(c=c.substring(2),f=!1);(b=aa[c]&&"boolean"==aa[c].type)&&void 0==f&&(f=!0);!b&&void 0===f||e?(d=fa(c,a,d),d instanceof Error?G(a,d.message):!0===d||!1===d?G(a," "+(d?"":"no")+c):G(a," "+c+"="+d)):(d=Ca(c,f,a,d),d instanceof Error&&G(a,d.message))}},setlocal:function(a,b){b.setCfg={scope:"local"};this.set(a,b)},setglobal:function(a,b){b.setCfg={scope:"global"};this.set(a,
b)},registers:function(a,b){var c=b.args;b=v.registerController.registers;var d="----------Registers----------\n\n";if(c){c=c.join("");for(var f=0;f<c.length;f++)if(h=c.charAt(f),v.registerController.isValidRegister(h)){var e=b[h]||new U;d+='"'+h+" "+e.toString()+"\n"}}else for(var h in b)c=b[h].toString(),c.length&&(d+='"'+h+" "+c+"\n");G(a,d)},sort:function(a,b){function c(z,E){if(f){var M=z;z=E;E=M}e&&(z=z.toLowerCase(),E=E.toLowerCase());M=k&&u.exec(z);var ia=k&&u.exec(E);if(!M)return z<
E?-1:1;M=parseInt((M[1]+M[2]).toLowerCase(),w);ia=parseInt((ia[1]+ia[2]).toLowerCase(),w);return M-ia}function d(z,E){if(f){var M=z;z=E;E=M}e&&(z[0]=z[0].toLowerCase(),E[0]=E[0].toLowerCase());return z[0]<E[0]?-1:1}var f,e,h,k,g,l=function(){if(b.argString){var z=new p.StringStream(b.argString);z.eat("!")&&(f=!0);if(!z.eol()){if(!z.eatSpace())return"Invalid arguments";var E=z.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!E&&!z.eol())return"Invalid arguments";if(E[1]){e=-1!=E[1].indexOf("i");h=-1!=E[1].indexOf("u");
z=-1!=E[1].indexOf("d")||-1!=E[1].indexOf("n")&&1;var M=-1!=E[1].indexOf("x")&&1,ia=-1!=E[1].indexOf("o")&&1;if(1<z+M+ia)return"Invalid arguments";k=z&&"decimal"||M&&"hex"||ia&&"octal"}E[2]&&(g=new RegExp(E[2].substr(1,E[2].length-2),e?"i":""))}}}();if(l)G(a,l+": "+b.argString);else{l=b.line||a.firstLine();var m=b.lineEnd||b.line||a.lastLine();if(l!=m){l=new r(l,0);m=new r(m,J(a,m));var n=a.getRange(l,m).split("\n"),u=g?g:"decimal"==k?/(-?)([\d]+)/:"hex"==k?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==k?/([0-7]+)/:
null,w="decimal"==k?10:"hex"==k?16:"octal"==k?8:null,q=[],y=[];if(k||g)for(var A=0;A<n.length;A++){var D=g?n[A].match(g):null;D&&""!=D[0]?q.push(D):!g&&u.exec(n[A])?q.push(n[A]):y.push(n[A])}else y=n;q.sort(g?d:c);if(g)for(A=0;A<q.length;A++)q[A]=q[A].input;else k||y.sort(c);n=f?q.concat(y):y.concat(q);if(h)for(q=n,n=[],A=0;A<q.length;A++){q[A]!=F&&n.push(q[A]);var F=q[A]}a.replaceRange(n.join("\n"),l,m)}}},vglobal:function(a,b){this.global(a,b)},global:function(a,b){var c=b.argString;if(c){var d=
"v"===b.commandName[0],f=void 0!==b.line?b.line:a.firstLine();b=b.lineEnd||b.line||a.lastLine();var e=fb(c,"/");if(e.length){c=e[0];var h=e.slice(1,e.length).join("/")}if(c)try{ma(a,c,!0,!0)}catch(m){G(a,"Invalid regex: "+c);return}c=X(a).getQuery();for(var k=[];f<=b;f++)e=a.getLineHandle(f),c.test(e.text)!==d&&k.push(h?e:e.text);if(h){var g=0,l=function(){if(g<k.length){var m=k[g++];m=a.getLineNumber(m);null==m?l():Y.processCommand(a,m+1+h,{callback:l})}};l()}else G(a,k.join("\n"))}else G(a,"Regular Expression missing from global")},
substitute:function(a,b){if(!a.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var c=b.argString,d=c?fb(c,c[0]):[],f="",e,h=!1,k=!1;if(d.length){var g=d[0];fa("pcre")&&""!==g&&(g=(new RegExp(g)).source);f=d[1];if(void 0!==f){if(fa("pcre")){f=f.replace(/([^\\])&/g,"$1$$&");f=new p.StringStream(f);for(e=[];!f.eol();){for(;f.peek()&&"\\"!=f.peek();)e.push(f.next());c=!1;for(var l in Ab)if(f.match(l,!0)){c=!0;e.push(Ab[l]);
break}c||e.push(f.next())}f=e.join("")}else{l=!1;e=[];for(c=-1;c<f.length;c++){var m=f.charAt(c)||"",n=f.charAt(c+1)||"";zb[m+n]?(e.push(zb[m+n]),c++):l?(e.push(m),l=!1):"\\"===m?(l=!0,Mb.test(n)||"$"===n?e.push("$"):"/"!==n&&"\\"!==n&&e.push("\\")):("$"===m&&e.push("$"),e.push(m),"/"===n&&e.push("\\"))}f=e.join("")}v.lastSubstituteReplacePart=f}e=d[2]?d[2].split(" "):[]}else if(c&&c.length){G(a,"Substitutions should be of the form :s/pattern/replace/");return}if(e){d=e[0];var u=parseInt(e[1]);d&&
(-1!=d.indexOf("c")&&(h=!0),-1!=d.indexOf("g")&&(k=!0),g=fa("pcre")?g+"/"+d:g.replace(/\//g,"\\/")+"/"+d)}if(g)try{ma(a,g,!0,!0)}catch(w){G(a,"Invalid regex: "+g);return}f=f||v.lastSubstituteReplacePart;void 0===f?G(a,"No previous substitute regular expression"):(g=X(a).getQuery(),d=void 0!==b.line?b.line:a.getCursor().line,l=b.lineEnd||d,d==a.firstLine()&&l==a.lastLine()&&(l=Infinity),u&&(d=l,l=d+u-1),u=Q(a,new r(d,0)),u=a.getSearchCursor(g,u),Lb(a,h,k,d,l,u,g,f,b.callback))},redo:p.commands.redo,
undo:p.commands.undo,write:function(a){p.commands.save?p.commands.save(a):a.save&&a.save()},nohlsearch:function(a){Ia(a)},yank:function(a){var b=H(a.getCursor()).line;a=a.getLine(b);v.registerController.pushText("0","yank",a,!0,!0)},delmarks:function(a,b){if(b.argString&&Ea(b.argString))for(var c=a.state.vim,d=new p.StringStream(Ea(b.argString));!d.eol();){d.eatSpace();var f=d.pos;if(!d.match(/[a-zA-Z]/,!1)){G(a,"Invalid argument: "+b.argString.substring(f));break}var e=d.next();if(d.match("-",!0)){if(!d.match(/[a-zA-Z]/,
!1)){G(a,"Invalid argument: "+b.argString.substring(f));break}var h=d.next();if(/^[a-z]$/.test(e)&&/^[a-z]$/.test(h)||ja.test(e)&&ja.test(h)){e=e.charCodeAt(0);h=h.charCodeAt(0);if(e>=h){G(a,"Invalid argument: "+b.argString.substring(f));break}for(f=0;f<=h-e;f++){var k=String.fromCharCode(e+f);delete c.marks[k]}}else{G(a,"Invalid argument: "+e+"-");break}}else delete c.marks[e]}else G(a,"Argument required")}},Y=new Bb;p.keyMap.vim={attach:T,detach:K,call:ya};sa("insertModeEscKeysTimeout",200,"number");
p.keyMap["vim-insert"]={fallthrough:["default"],attach:T,detach:K,call:ya};p.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:T,detach:K,call:ya};Ta();return Z}t.Vim=function(p){p.Vim=x(p);return p.Vim}(t)});
// overlay.js
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){c.overlayMode=function(d,f,g){return{startState:function(){return{base:c.startState(d),overlay:c.startState(f),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:c.copyState(d,b.base),overlay:c.copyState(f,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,
overlayCur:null}},token:function(b,a){if(b!=a.streamSeen||Math.min(a.basePos,a.overlayPos)<b.start)a.streamSeen=b,a.basePos=a.overlayPos=b.start;b.start==a.basePos&&(a.baseCur=d.token(b,a.base),a.basePos=b.pos);b.start==a.overlayPos&&(b.pos=b.start,a.overlayCur=f.token(b,a.overlay),a.overlayPos=b.pos);b.pos=Math.min(a.basePos,a.overlayPos);return null==a.overlayCur?a.baseCur:null!=a.baseCur&&a.overlay.combineTokens||g&&null==a.overlay.combineTokens?a.baseCur+" "+a.overlayCur:a.overlayCur},indent:d.indent&&
function(b,a,e){return d.indent(b.base,a,e)},electricChars:d.electricChars,innerMode:function(b){return{state:b.base,mode:d}},blankLine:function(b){var a,e;d.blankLine&&(a=d.blankLine(b.base));f.blankLine&&(e=f.blankLine(b.overlay));return null==e?a:g&&null!=a?a+" "+e:e}}}});
// simple.js
(function(m){"object"==typeof exports&&"object"==typeof module?m(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){function u(b,e){if(!b.hasOwnProperty(e))throw Error("Undefined state "+e+" in simple mode");}function t(b,e){if(!b)return/(?:)/;var c="";b instanceof RegExp?(b.ignoreCase&&(c="i"),b.unicode&&(c+="u"),b=b.source):b=String(b);return new RegExp((!1===e?"":"^")+"(?:"+b+")",c)}function w(b){if(!b)return null;
if(b.apply)return b;if("string"==typeof b)return b.replace(/\./g," ");for(var e=[],c=0;c<b.length;c++)e.push(b[c]&&b[c].replace(/\./g," "));return e}function x(b,e){(b.next||b.push)&&u(e,b.next||b.push);this.regex=t(b.regex);this.token=w(b.token);this.data=b}function y(b,e){return function(c,a){if(a.pending){var d=a.pending.shift();0==a.pending.length&&(a.pending=null);c.pos+=d.text.length;return d.token}if(a.local){if(a.local.end&&c.match(a.local.end))d=a.local.endToken||null,a.local=a.localState=
null;else{d=a.local.mode.token(c,a.localState);var h;a.local.endScan&&(h=a.local.endScan.exec(c.current()))&&(c.pos=c.start+h.index)}return d}for(var k=b[a.state],f=0;f<k.length;f++)if(d=k[f],h=(!d.data.sol||c.sol())&&c.match(d.regex)){d.data.next?a.state=d.data.next:d.data.push?((a.stack||(a.stack=[])).push(a.state),a.state=d.data.push):d.data.pop&&a.stack&&a.stack.length&&(a.state=a.stack.pop());if(d.data.mode){k=void 0;var n=e;f=a;var l=d.data.mode,p=d.token;if(l.persistent)for(var g=f.persistentStates;g&&
!k;g=g.next)if(l.spec?v(l.spec,g.spec):l.mode==g.mode)k=g;n=k?k.mode:l.mode||m.getMode(n,l.spec);g=k?k.state:m.startState(n);l.persistent&&!k&&(f.persistentStates={mode:n,spec:l.spec,state:g,next:f.persistentStates});f.localState=g;f.local={mode:n,end:l.end&&t(l.end),endScan:l.end&&!1!==l.forceEnd&&t(l.end,!1),endToken:p&&p.join?p[p.length-1]:p}}d.data.indent&&a.indent.push(c.indentation()+e.indentUnit);d.data.dedent&&a.indent.pop();(k=d.token)&&k.apply&&(k=k(h));if(2<h.length&&d.token&&"string"!=
typeof d.token){for(f=2;f<h.length;f++)h[f]&&(a.pending||(a.pending=[])).push({text:h[f],token:d.token[f-1]});c.backUp(h[0].length-(h[1]?h[1].length:0));return k[0]}return k&&k.join?k[0]:k}c.next();return null}}function v(b,e){if(b===e)return!0;if(!b||"object"!=typeof b||!e||"object"!=typeof e)return!1;var c=0,a;for(a in b)if(b.hasOwnProperty(a)){if(!e.hasOwnProperty(a)||!v(b[a],e[a]))return!1;c++}for(a in e)e.hasOwnProperty(a)&&c--;return 0==c}function z(b,e){return function(c,a,d){if(c.local&&c.local.mode.indent)return c.local.mode.indent(c.localState,
a,d);if(!(d=null==c.indent||c.local)&&(d=e.dontIndentStates)){a:{d=e.dontIndentStates;for(var h=0;h<d.length;h++)if(d[h]===c.state){d=!0;break a}d=void 0}d=-1<d}if(d)return m.Pass;d=c.indent.length-1;h=b[c.state];a:for(;;){for(var k=0;k<h.length;k++){var f=h[k];if(f.data.dedent&&!1!==f.data.dedentIfLineStart){var n=f.regex.exec(a);if(n&&n[0]){d--;if(f.next||f.push)h=b[f.next||f.push];a=a.slice(n[0].length);continue a}}}break}return 0>d?0:c.indent[d]}}m.defineSimpleMode=function(b,e){m.defineMode(b,
function(c){return m.simpleMode(c,e)})};m.simpleMode=function(b,e){u(e,"start");var c={},a=e.meta||{},d=!1,h;for(h in e)if(h!=a&&e.hasOwnProperty(h))for(var k=c[h]=[],f=e[h],n=0;n<f.length;n++){var l=f[n];k.push(new x(l,e));if(l.indent||l.dedent)d=!0}b={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:d?[]:null}},copyState:function(g){var r={state:g.state,pending:g.pending,local:g.local,localState:null,indent:g.indent&&g.indent.slice(0)};g.localState&&(r.localState=
m.copyState(g.local.mode,g.localState));g.stack&&(r.stack=g.stack.slice(0));for(var q=g.persistentStates;q;q=q.next)r.persistentStates={mode:q.mode,spec:q.spec,state:q.state==g.localState?r.localState:m.copyState(q.mode,q.state),next:r.persistentStates};return r},token:y(c,b),innerMode:function(g){return g.local&&{mode:g.local.mode,state:g.localState}},indent:z(c,a)};if(a)for(var p in a)a.hasOwnProperty(p)&&(b[p]=a[p]);return b}});
// meta.js
(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})(function(a){a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",
mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:"cpp c++ cc cxx hpp h++ hh hxx".split(" "),alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",
mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",
mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",
ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",
ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},
{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",
ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",
ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript",
"text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",
mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",
mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",
mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",
mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:"php php3 php4 php5 php7 phtml".split(" ")},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:"txt text conf def list log".split(" ")},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",
ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",
ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",
mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",
mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},
{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},
{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:"123456789".split("")},
{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",
mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},
{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",
mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var f=0;f<a.modeInfo.length;f++){var g=a.modeInfo[f];g.mimes&&(g.mime=g.mimes[0])}a.findModeByMIME=function(b){b=b.toLowerCase();for(var d=0;d<a.modeInfo.length;d++){var c=a.modeInfo[d];if(c.mime==b)return c;if(c.mimes)for(var e=0;e<c.mimes.length;e++)if(c.mimes[e]==b)return c}if(/\+xml$/.test(b))return a.findModeByMIME("application/xml");if(/\+json$/.test(b))return a.findModeByMIME("application/json")};a.findModeByExtension=function(b){b=
b.toLowerCase();for(var d=0;d<a.modeInfo.length;d++){var c=a.modeInfo[d];if(c.ext)for(var e=0;e<c.ext.length;e++)if(c.ext[e]==b)return c}};a.findModeByFileName=function(b){for(var d=0;d<a.modeInfo.length;d++){var c=a.modeInfo[d];if(c.file&&c.file.test(b))return c}d=b.lastIndexOf(".");if(b=-1<d&&b.substring(d+1,b.length))return a.findModeByExtension(b)};a.findModeByName=function(b){b=b.toLowerCase();for(var d=0;d<a.modeInfo.length;d++){var c=a.modeInfo[d];if(c.name.toLowerCase()==b)return c;if(c.alias)for(var e=
0;e<c.alias.length;e++)if(c.alias[e].toLowerCase()==b)return c}}});
// clike.js
(function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){function G(a,b,c,h,l,n){this.indented=a;this.column=b;this.type=c;this.info=h;this.align=l;this.prev=n}function B(a,b,c,h){var l=a.indented;a.context&&"statement"==a.context.type&&"statement"!=c&&(l=a.context.indented);return a.context=new G(l,b,c,h,null,a.context)}function z(a){var b=a.context.type;if(")"==
b||"]"==b||"}"==b)a.indented=a.context.indented;return a.context=a.context.prev}function I(a,b,c){if("variable"==b.prevToken||"type"==b.prevToken||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,c))||b.typeAtEndOfLine&&a.column()==a.indentation())return!0}function J(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.info)return!1;a=a.prev}}function f(a){var b={};a=a.split(" ");for(var c=0;c<a.length;++c)b[a[c]]=!0;return b}function r(a,b){return"function"===typeof a?a(b):
a.propertyIsEnumerable(b)}function A(a){return r(X,a)||/.+_t$/.test(a)}function K(a){return A(a)||r(Y,a)}function u(a,b){if(!b.startOfLine)return!1;for(var c,h=null;c=a.peek();){if("\\"==c&&a.match(/^.$/)){h=u;break}else if("/"==c&&a.match(/^\/[\/\*]/,!1))break;a.next()}b.tokenize=h;return"meta"}function C(a,b){return"type"==b.prevToken?"type":!1}function D(a){return!a||2>a.length||"_"!=a[0]?!1:"_"==a[1]||a[1]!==a[1].toLowerCase()}function m(a){a.eatWhile(/[\w\.']/);return"number"}function v(a,b){a.backUp(1);
if(a.match(/^(?:R|u8R|uR|UR|LR)/)){var c=a.match(/^"([^\s\\()]{0,16})\(/);if(!c)return!1;b.cpp11RawStringDelim=c[1];b.tokenize=L;return L(a,b)}if(a.match(/^(?:u8|u|U|L)/))return a.match(/^["']/,!1)?"string":!1;a.next();return!1}function M(a){return(a=/(\w+)::~?(\w+)$/.exec(a))&&a[1]==a[2]}function N(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function L(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");a.match(new RegExp(".*?\\)"+c+'"'))?
b.tokenize=null:a.skipToEnd();return"string"}function q(a,b){function c(n){if(n)for(var w in n)n.hasOwnProperty(w)&&h.push(w)}"string"==typeof a&&(a=[a]);var h=[];c(b.keywords);c(b.types);c(b.builtin);c(b.atoms);h.length&&(b.helperType=a[0],t.registerHelper("hintWords",a[0],h));for(var l=0;l<a.length;++l)t.defineMIME(a[l],b)}function O(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}function E(a){return function(b,c){for(var h;h=b.next();)if("*"==
h&&b.eat("/"))if(1==a){c.tokenize=null;break}else return c.tokenize=E(a-1),c.tokenize(b,c);else if("/"==h&&b.eat("*"))return c.tokenize=E(a+1),c.tokenize(b,c);return"comment"}}function Z(a){return function(b,c){for(var h=!1,l,n=!1;!b.eol();){if(!a&&!h&&b.match('"')){n=!0;break}if(a&&b.match('"""')){n=!0;break}l=b.next();!h&&"$"==l&&b.match("{")&&b.skipTo("}");h=!h&&"\\"==l&&!a}if(n||!a)c.tokenize=null;return"string"}}function P(a){return function(b,c){for(var h=!1,l,n=!1;!b.eol();){if(!h&&b.match('"')&&
("single"==a||b.match('""'))){n=!0;break}if(!h&&b.match("``")){F=P(a);n=!0;break}l=b.next();h="single"==a&&!h&&"\\"==l}n&&(c.tokenize=null);return"string"}}t.defineMode("clike",function(a,b){function c(d,g){var e=d.next();if(y[e]){var k=y[e](d,g);if(!1!==k)return k}if('"'==e||"'"==e)return g.tokenize=h(e),g.tokenize(d,g);if(aa.test(e)){d.backUp(1);if(d.match(ba))return"number";d.next()}if(ca.test(e))return p=e,null;if("/"==e){if(d.eat("*"))return g.tokenize=l,l(d,g);if(d.eat("/"))return d.skipToEnd(),
"comment"}if(Q.test(e)){for(;!d.match(/^\/[\/*]/,!1)&&d.eat(Q););return"operator"}d.eatWhile(R);if(S)for(;d.match(S);)d.eatWhile(R);d=d.current();return r(da,d)?(r(T,d)&&(p="newstatement"),r(ea,d)&&(H=!0),"keyword"):r(fa,d)?"type":r(ha,d)||U&&U(d)?(r(T,d)&&(p="newstatement"),"builtin"):r(ia,d)?"atom":"variable"}function h(d){return function(g,e){for(var k=!1,x,V=!1;null!=(x=g.next());){if(x==d&&!k){V=!0;break}k=!k&&"\\"==x}if(V||!k&&!ja)e.tokenize=null;return"string"}}function l(d,g){for(var e=!1,
k;k=d.next();){if("/"==k&&e){g.tokenize=null;break}e="*"==k}return"comment"}function n(d,g){b.typeFirstDefinitions&&d.eol()&&J(g.context)&&(g.typeAtEndOfLine=I(d,g,d.pos))}var w=a.indentUnit,W=b.statementIndentUnit||w,ka=b.dontAlignCalls,da=b.keywords||{},fa=b.types||{},ha=b.builtin||{},T=b.blockKeywords||{},ea=b.defKeywords||{},ia=b.atoms||{},y=b.hooks||{},ja=b.multiLineStrings,la=!1!==b.indentStatements,S=b.namespaceSeparator,ca=b.isPunctuationChar||/[\[\]{}\(\),;:\.]/,aa=b.numberStart||/[\d\.]/,
ba=b.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Q=b.isOperatorChar||/[+\-*&%=<>!?|\/]/,R=b.isIdentifierChar||/[\w\$_\xa1-\uffff]/,U=b.isReservedIdentifier||!1,p,H;return{startState:function(d){return{tokenize:null,context:new G((d||0)-w,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(d,g){var e=g.context;d.sol()&&(null==e.align&&(e.align=!1),g.indented=d.indentation(),g.startOfLine=!0);if(d.eatSpace())return n(d,g),null;p=H=null;var k=
(g.tokenize||c)(d,g);if("comment"==k||"meta"==k)return k;null==e.align&&(e.align=!0);if(";"==p||":"==p||","==p&&d.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==g.context.type;)z(g);else if("{"==p)B(g,d.column(),"}");else if("["==p)B(g,d.column(),"]");else if("("==p)B(g,d.column(),")");else if("}"==p){for(;"statement"==e.type;)e=z(g);for("}"==e.type&&(e=z(g));"statement"==e.type;)e=z(g)}else p==e.type?z(g):la&&(("}"==e.type||"top"==e.type)&&";"!=p||"statement"==e.type&&"newstatement"==p)&&B(g,d.column(),
"statement",d.current());"variable"==k&&("def"==g.prevToken||b.typeFirstDefinitions&&I(d,g,d.start)&&J(g.context)&&d.match(/^\s*\(/,!1))&&(k="def");y.token&&(e=y.token(d,g,k),void 0!==e&&(k=e));"def"==k&&!1===b.styleDefs&&(k="variable");g.startOfLine=!1;g.prevToken=H?"def":k||p;n(d,g);return k},indent:function(d,g){if(d.tokenize!=c&&null!=d.tokenize||d.typeAtEndOfLine)return t.Pass;var e=d.context,k=g&&g.charAt(0),x=k==e.type;"statement"==e.type&&"}"==k&&(e=e.prev);if(b.dontIndentStatements)for(;"statement"==
e.type&&b.dontIndentStatements.test(e.info);)e=e.prev;if(y.indent&&(d=y.indent(d,e,g,w),"number"==typeof d))return d;d=e.prev&&"switch"==e.prev.info;if(b.allmanIndentation&&/[{(]/.test(k)){for(;"top"!=e.type&&"}"!=e.type;)e=e.prev;return e.indented}return"statement"==e.type?e.indented+("{"==k?0:W):!e.align||ka&&")"==e.type?")"!=e.type||x?e.indented+(x?0:w)+(x||!d||/^(?:case|default)\b/.test(g)?0:w):e.indented+W:e.column+(x?0:1)},electricInput:!1!==b.indentSwitch?/^\s*(?:case .*?:|default:|\{\}?|\})$/:
/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var X=f("int long char short double float unsigned signed void bool"),Y=f("SEL instancetype id Class Protocol BOOL");q(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:f("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"),types:A,blockKeywords:f("case do else for if switch while struct enum union"),
defKeywords:f("struct enum union"),typeFirstDefinitions:!0,atoms:f("NULL true false"),isReservedIdentifier:D,hooks:{"#":u,"*":C},modeProps:{fold:["brace","include"]}});q(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:f("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 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:A,blockKeywords:f("case do else for if switch while struct enum union class try catch"),defKeywords:f("struct enum union class namespace"),typeFirstDefinitions:!0,atoms:f("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:D,hooks:{"#":u,"*":C,u:v,U:v,L:v,R:v,0:m,1:m,2:m,3:m,4:m,5:m,6:m,7:m,8:m,9:m,token:function(a,b,c){if("variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken)&&M(a.current()))return"def"}},
namespaceSeparator:"::",modeProps:{fold:["brace","include"]}});q("text/x-java",{name:"clike",keywords:f("abstract assert break case catch class const continue default do else enum extends final finally 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:f("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),
blockKeywords:f("catch class do else finally for if switch try while"),defKeywords:f("class interface enum @interface"),typeFirstDefinitions:!0,atoms:f("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(a){if(a.match("interface",!1))return!1;a.eatWhile(/[\w\$_]/);return"meta"},'"':function(a,b){if(!a.match(/""$/))return!1;b.tokenize=O;return b.tokenize(a,b)}},modeProps:{fold:["brace","import"]}});q("text/x-csharp",{name:"clike",
keywords:f("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 init interface internal is lock namespace new operator out override params private protected public readonly record ref required 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:f("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:f("catch class do else finally for foreach if struct switch try while"),defKeywords:f("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:f("true false null"),hooks:{"@":function(a,b){if(a.eat('"'))return b.tokenize=
N,N(a,b);a.eatWhile(/[\w\$_]/);return"meta"}}});q("text/x-scala",{name:"clike",keywords:f("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:f("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:f("catch class enum do else finally for forSome if match switch try while"),defKeywords:f("class enum def object package trait type val var"),atoms:f("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"},'"':function(a,b){if(!a.match('""'))return!1;b.tokenize=O;return b.tokenize(a,b)},"'":function(a){if(a.match(/^(\\[^'\s]+|[^\\'])'/))return"string-2";a.eatWhile(/[\w\$_\xa1-\uffff]/);
return"atom"},"=":function(a,b){var c=b.context;return"}"==c.type&&c.align&&a.eat(">")?(b.context=new G(c.indented,c.column,c.type,c.info,null,c.prev),"operator"):!1},"/":function(a,b){if(!a.eat("*"))return!1;b.tokenize=E(1);return b.tokenize(a,b)}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});q("text/x-kotlin",{name:"clike",keywords:f("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 value"),
types:f("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:f("catch class do else finally for if where try while enum"),defKeywords:f("class val var object interface fun"),atoms:f("true false null this"),hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"},"*":function(a,b){return"."==b.prevToken?"variable":"operator"},'"':function(a,b){b.tokenize=Z(a.match('""'));return b.tokenize(a,b)},"/":function(a,b){if(!a.eat("*"))return!1;
b.tokenize=E(1);return b.tokenize(a,b)},indent:function(a,b,c,h){var l=c&&c.charAt(0);if(("}"==a.prevToken||")"==a.prevToken)&&""==c)return a.indented;if("operator"==a.prevToken&&"}"!=c&&"}"!=a.context.type||"variable"==a.prevToken&&"."==l||("}"==a.prevToken||")"==a.prevToken)&&"."==l)return 2*h+b.indented;if(b.align&&"}"==b.type)return b.indented+(a.context.type==(c||"").charAt(0)?0:h)}},modeProps:{closeBrackets:{triples:'"'}}});q(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:f("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),
types:f("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:f("for while do if else struct"),builtin:f("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:f("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_TextureMatrixTranspose 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:{"#":u},modeProps:{fold:["brace","include"]}});q("text/x-nesc",{name:"clike",keywords:f("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 as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:A,blockKeywords:f("case do else for if switch while struct enum union"),
atoms:f("null true false"),hooks:{"#":u},modeProps:{fold:["brace","include"]}});q("text/x-objectivec",{name:"clike",keywords:f("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 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:K,builtin:f("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_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:f("case do else for if switch while struct enum union @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:f("struct enum union @interface @implementation @protocol @class"),
dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:f("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:D,hooks:{"#":u,"*":C},modeProps:{fold:["brace","include"]}});q("text/x-objectivec++",{name:"clike",keywords:f("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 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 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:K,builtin:f("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_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:f("case do else for if switch while struct enum union @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:f("struct enum union @interface @implementation @protocol @class class namespace"),
dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:f("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:D,hooks:{"#":u,"*":C,u:v,U:v,L:v,R:v,0:m,1:m,2:m,3:m,4:m,5:m,6:m,7:m,8:m,9:m,token:function(a,b,c){if("variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken)&&M(a.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}});q("text/x-squirrel",{name:"clike",keywords:f("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),
types:A,blockKeywords:f("case catch class else for foreach if switch try while"),defKeywords:f("function local class"),typeFirstDefinitions:!0,atoms:f("true false null"),hooks:{"#":u},modeProps:{fold:["brace","include"]}});var F=null;q("text/x-ceylon",{name:"clike",keywords:f("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(a){a=a.charAt(0);return a===a.toUpperCase()&&a!==a.toLowerCase()},blockKeywords:f("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:f("class dynamic function interface module object package value"),builtin:f("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:f("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"},'"':function(a,b){b.tokenize=P(a.match('""')?"triple":"single");return b.tokenize(a,b)},"`":function(a,b){if(!F||!a.match("`"))return!1;b.tokenize=
F;F=null;return b.tokenize(a,b)},"'":function(a){a.eatWhile(/[\w\$_\xa1-\uffff]/);return"atom"},token:function(a,b,c){if(("variable"==c||"type"==c)&&"."==b.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})});
// css.js
(function(l){"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],l):l(CodeMirror)})(function(l){function m(d){for(var e={},f=0;f<d.length;++f)e[d[f].toLowerCase()]=!0;return e}function q(d,e){for(var f=!1,u;null!=(u=d.next());){if(f&&"/"==u){e.tokenize=null;break}f="*"==u}return["comment","comment"]}l.defineMode("css",function(d,e){function f(a,c){v=c;return a}function u(a,c){var b=a.next();if(G[b]){var k=
G[b](a,c);if(!1!==k)return k}if("@"==b)return a.eatWhile(/[\w\\\-]/),f("def",a.current());if("="==b||("~"==b||"|"==b)&&a.eat("="))return f(null,"compare");if('"'==b||"'"==b)return c.tokenize=H(b),c.tokenize(a,c);if("#"==b)return a.eatWhile(/[\w\\\-]/),f("atom","hash");if("!"==b)return a.match(/^\s*\w*/),f("keyword","important");if(/\d/.test(b)||"."==b&&a.eat(/\d/))return a.eatWhile(/[\w.%]/),f("number","unit");if("-"===b){if(/[\d.]/.test(a.peek()))return a.eatWhile(/[\w.%]/),f("number","unit");if(a.match(/^-[\w\\\-]*/))return a.eatWhile(/[\w\\\-]/),
a.match(/^\s*:/,!1)?f("variable-2","variable-definition"):f("variable-2","variable");if(a.match(/^\w+-/))return f("meta","meta")}else return/[,+>*\/]/.test(b)?f(null,"select-op"):"."==b&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?f("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(b)?f(null,b):a.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(a.current())&&(c.tokenize=aa),f("variable callee","variable")):/[\w\\\-]/.test(b)?(a.eatWhile(/[\w\\\-]/),f("property","word")):f(null,null)}function H(a){return function(c,
b){for(var k=!1,w;null!=(w=c.next());){if(w==a&&!k){")"==a&&c.backUp(1);break}k=!k&&"\\"==w}if(w==a||!k&&")"!=a)b.tokenize=null;return f("string","string")}}function aa(a,c){a.next();a.match(/^\s*["')]/,!1)?c.tokenize=null:c.tokenize=H(")");return f(null,"(")}function I(a,c,b){this.type=a;this.indent=c;this.prev=b}function h(a,c,b,k){a.context=new I(b,c.indentation()+(!1===k?0:J),a.context);return b}function n(a){a.context.prev&&(a.context=a.context.prev);return a.context.type}function r(a,c,b,k){for(k=
k||1;0<k;k--)b.context=b.context.prev;return p[b.context.type](a,c,b)}function K(a){a=a.current().toLowerCase();g=L.hasOwnProperty(a)?"atom":M.hasOwnProperty(a)?"keyword":"variable"}var N=e.inline;e.propertyKeywords||(e=l.resolveMode("text/css"));var J=d.indentUnit,G=e.tokenHooks,ba=e.documentTypes||{},ca=e.mediaTypes||{},da=e.mediaFeatures||{},ea=e.mediaValueKeywords||{},O=e.propertyKeywords||{},P=e.nonStandardPropertyKeywords||{},fa=e.fontProperties||{},ha=e.counterDescriptors||{},M=e.colorKeywords||
{},L=e.valueKeywords||{},t=e.allowNested,ia=!0===e.supportsAtComponent,Q=!1!==d.highlightNonStandardPropertyKeywords,v,g,p={top:function(a,c,b){if("{"==a)return h(b,c,"block");if("}"==a&&b.context.prev)return n(b);if(ia&&/@component/i.test(a))return h(b,c,"atComponentBlock");if(/^@(-moz-)?document$/i.test(a))return h(b,c,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(a))return h(b,c,"atBlock");if(/^@(font-face|counter-style)/i.test(a))return b.stateArg=a,"restricted_atBlock_before";
if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return h(b,c,"at");if("hash"==a)g="builtin";else if("word"==a)g="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return h(b,c,"interpolation");if(":"==a)return"pseudo";if(t&&"("==a)return h(b,c,"parens")}return b.context.type},block:function(a,c,b){if("word"==a){a=c.current().toLowerCase();if(O.hasOwnProperty(a))return g="property","maybeprop";if(P.hasOwnProperty(a))return g=Q?"string-2":
"property","maybeprop";if(t)return g=c.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block";g+=" error";return"maybeprop"}if("meta"==a)return"block";if(t||"hash"!=a&&"qualifier"!=a)return p.top(a,c,b);g="error";return"block"},maybeprop:function(a,c,b){return":"==a?h(b,c,"prop"):p[b.context.type](a,c,b)},prop:function(a,c,b){if(";"==a)return n(b);if("{"==a&&t)return h(b,c,"propBlock");if("}"==a||"{"==a)return r(a,c,b);if("("==a)return h(b,c,"parens");if("hash"==a&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(c.current()))g+=
" error";else if("word"==a)K(c);else if("interpolation"==a)return h(b,c,"interpolation");return"prop"},propBlock:function(a,c,b){return"}"==a?n(b):"word"==a?(g="property","maybeprop"):b.context.type},parens:function(a,c,b){if("{"==a||"}"==a)return r(a,c,b);if(")"==a)return n(b);if("("==a)return h(b,c,"parens");if("interpolation"==a)return h(b,c,"interpolation");"word"==a&&K(c);return"parens"},pseudo:function(a,c,b){return"meta"==a?"pseudo":"word"==a?(g="variable-3",b.context.type):p[b.context.type](a,
c,b)},documentTypes:function(a,c,b){return"word"==a&&ba.hasOwnProperty(c.current())?(g="tag",b.context.type):p.atBlock(a,c,b)},atBlock:function(a,c,b){if("("==a)return h(b,c,"atBlock_parens");if("}"==a||";"==a)return r(a,c,b);if("{"==a)return n(b)&&h(b,c,t?"block":"top");if("interpolation"==a)return h(b,c,"interpolation");"word"==a&&(a=c.current().toLowerCase(),g="only"==a||"not"==a||"and"==a||"or"==a?"keyword":ca.hasOwnProperty(a)?"attribute":da.hasOwnProperty(a)?"property":ea.hasOwnProperty(a)?
"keyword":O.hasOwnProperty(a)?"property":P.hasOwnProperty(a)?Q?"string-2":"property":L.hasOwnProperty(a)?"atom":M.hasOwnProperty(a)?"keyword":"error");return b.context.type},atComponentBlock:function(a,c,b){if("}"==a)return r(a,c,b);if("{"==a)return n(b)&&h(b,c,t?"block":"top",!1);"word"==a&&(g="error");return b.context.type},atBlock_parens:function(a,c,b){return")"==a?n(b):"{"==a||"}"==a?r(a,c,b,2):p.atBlock(a,c,b)},restricted_atBlock_before:function(a,c,b){return"{"==a?h(b,c,"restricted_atBlock"):
"word"==a&&"@counter-style"==b.stateArg?(g="variable","restricted_atBlock_before"):p[b.context.type](a,c,b)},restricted_atBlock:function(a,c,b){return"}"==a?(b.stateArg=null,n(b)):"word"==a?(g="@font-face"==b.stateArg&&!fa.hasOwnProperty(c.current().toLowerCase())||"@counter-style"==b.stateArg&&!ha.hasOwnProperty(c.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(a,c,b){return"word"==a?(g="variable","keyframes"):"{"==a?h(b,c,"top"):p[b.context.type](a,
c,b)},at:function(a,c,b){if(";"==a)return n(b);if("{"==a||"}"==a)return r(a,c,b);"word"==a?g="tag":"hash"==a&&(g="builtin");return"at"},interpolation:function(a,c,b){if("}"==a)return n(b);if("{"==a||";"==a)return r(a,c,b);"word"==a?g="variable":"variable"!=a&&"("!=a&&")"!=a&&(g="error");return"interpolation"}};return{startState:function(a){return{tokenize:null,state:N?"block":"top",stateArg:null,context:new I(N?"block":"top",a||0,null)}},token:function(a,c){if(!c.tokenize&&a.eatSpace())return null;
var b=(c.tokenize||u)(a,c);b&&"object"==typeof b&&(v=b[1],b=b[0]);g=b;"comment"!=v&&(c.state=p[c.state](v,a,c));return g},indent:function(a,c){a=a.context;c=c&&c.charAt(0);var b=a.indent;"prop"!=a.type||"}"!=c&&")"!=c||(a=a.prev);if(a.prev)if("}"==c&&("block"==a.type||"top"==a.type||"interpolation"==a.type||"restricted_atBlock"==a.type))a=a.prev,b=a.indent;else if(")"==c&&("parens"==a.type||"atBlock_parens"==a.type)||"{"==c&&("at"==a.type||"atBlock"==a.type))b=Math.max(0,a.indent-J);return b},electricChars:"}",
blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:e.lineComment,fold:"brace"}});var x=["domain","regexp","url","url-prefix"],R=m(x),S="all aural braille handheld print projection screen tty tv embossed".split(" "),y=m(S),T="width min-width max-width height min-height max-height device-width min-device-width max-device-width device-height min-device-height max-device-height aspect-ratio min-aspect-ratio max-aspect-ratio device-aspect-ratio min-device-aspect-ratio max-device-aspect-ratio color min-color max-color color-index min-color-index max-color-index monochrome min-monochrome max-monochrome resolution min-resolution max-resolution scan grid orientation device-pixel-ratio min-device-pixel-ratio max-device-pixel-ratio pointer any-pointer hover any-hover prefers-color-scheme dynamic-range video-dynamic-range".split(" "),
z=m(T),U="landscape portrait none coarse fine on-demand hover interlace progressive dark light standard high".split(" "),F=m(U),V="align-content align-items align-self alignment-adjust alignment-baseline all anchor-point animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backdrop-filter backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-position-x background-position-y background-repeat background-size baseline-shift binding bleed block-size bookmark-label bookmark-level bookmark-state bookmark-target border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side caret-color clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns contain content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit fit-content fit-position flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float float-offset flow-from flow-into font font-family font-feature-settings font-kerning font-language-override font-optical-sizing font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-variation-settings font-weight gap grid grid-area grid-auto-columns grid-auto-flow grid-auto-rows grid-column grid-column-end grid-column-gap grid-column-start grid-gap grid-row grid-row-end grid-row-gap grid-row-start grid-template grid-template-areas grid-template-columns grid-template-rows hanging-punctuation height hyphens icon image-orientation image-rendering image-resolution inline-box-align inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start isolation justify-content justify-items justify-self left letter-spacing line-break line-height line-height-step line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type max-block-size max-height max-inline-size max-width min-block-size min-height min-inline-size min-width mix-blend-mode move-to nav-down nav-index nav-left nav-right nav-up object-fit object-position offset offset-anchor offset-distance offset-path offset-position offset-rotate opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin pitch pitch-range place-content place-items place-self play-during position presentation-level punctuation-trim quotes region-break-after region-break-before region-break-inside region-fragment rendering-intent resize rest rest-after rest-before richness right rotate rotation rotation-point row-gap ruby-align ruby-overhang ruby-position ruby-span scale scroll-behavior scroll-margin scroll-margin-block scroll-margin-block-end scroll-margin-block-start scroll-margin-bottom scroll-margin-inline scroll-margin-inline-end scroll-margin-inline-start scroll-margin-left scroll-margin-right scroll-margin-top scroll-padding scroll-padding-block scroll-padding-block-end scroll-padding-block-start scroll-padding-bottom scroll-padding-inline scroll-padding-inline-end scroll-padding-inline-start scroll-padding-left scroll-padding-right scroll-padding-top scroll-snap-align scroll-snap-type shape-image-threshold shape-inside shape-margin shape-outside size speak speak-as speak-header speak-numeral speak-punctuation speech-rate stress string-set tab-size table-layout target target-name target-new target-position text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-decoration-skip text-decoration-skip-ink text-decoration-style text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-height text-indent text-justify text-orientation text-outline text-overflow text-rendering text-shadow text-size-adjust text-space-collapse text-transform text-underline-position text-wrap top touch-action transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function translate unicode-bidi user-select vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index clip-path clip-rule mask enable-background filter flood-color flood-opacity lighting-color stop-color stop-opacity pointer-events color-interpolation color-interpolation-filters color-rendering fill fill-opacity fill-rule image-rendering marker marker-end marker-mid marker-start paint-order shape-rendering stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-rendering baseline-shift dominant-baseline glyph-orientation-horizontal glyph-orientation-vertical text-anchor writing-mode".split(" "),
A=m(V),W="accent-color aspect-ratio border-block border-block-color border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-block-style border-block-width border-inline border-inline-color border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-inline-style border-inline-width content-visibility margin-block margin-block-end margin-block-start margin-inline margin-inline-end margin-inline-start overflow-anchor overscroll-behavior padding-block padding-block-end padding-block-start padding-inline padding-inline-end padding-inline-start scroll-snap-stop scrollbar-3d-light-color scrollbar-arrow-color scrollbar-base-color scrollbar-dark-shadow-color scrollbar-face-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-track-color searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration shape-inside zoom".split(" "),
B=m(W),C=m("font-display font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),X=m("additive-symbols fallback negative pad prefix range speak-as suffix symbols system".split(" ")),Y="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),
D=m(Y),Z="above absolute activeborder additive activecaption afar after-white-space ahead alias all all-scroll alphabetic alternate always amharic amharic-abegede antialiased appworkspace arabic-indic armenian asterisks attr auto auto-flow avoid avoid-column avoid-page avoid-region axis-pan background backwards baseline below bidi-override binary bengali blink block block-axis blur bold bolder border border-box both bottom break break-all break-word brightness bullets button buttonface buttonhighlight buttonshadow buttontext calc cambodian capitalize caps-lock-indicator caption captiontext caret cell center checkbox circle cjk-decimal cjk-earthly-branch cjk-heavenly-stem cjk-ideographic clear clip close-quote col-resize collapse color color-burn color-dodge column column-reverse compact condensed conic-gradient contain content contents content-box context-menu continuous contrast copy counter counters cover crop cross crosshair cubic-bezier currentcolor cursive cyclic darken dashed decimal decimal-leading-zero default default-button dense destination-atop destination-in destination-out destination-over devanagari difference disc discard disclosure-closed disclosure-open document dot-dash dot-dot-dash dotted double down drop-shadow e-resize ease ease-in ease-in-out ease-out element ellipse ellipsis embed end ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig ethiopic-numeric ew-resize exclusion expanded extends extra-condensed extra-expanded fantasy fast fill fill-box fixed flat flex flex-end flex-start footnotes forwards from geometricPrecision georgian grayscale graytext grid groove gujarati gurmukhi hand hangul hangul-consonant hard-light hebrew help hidden hide higher highlight highlighttext hiragana hiragana-iroha horizontal hsl hsla hue hue-rotate icon ignore inactiveborder inactivecaption inactivecaptiontext infinite infobackground infotext inherit initial inline inline-axis inline-block inline-flex inline-grid inline-table inset inside intrinsic invert italic japanese-formal japanese-informal justify kannada katakana katakana-iroha keep-all khmer korean-hangul-formal korean-hanja-formal korean-hanja-informal landscape lao large larger left level lighter lighten line-through linear linear-gradient lines list-item listbox listitem local logical loud lower lower-alpha lower-armenian lower-greek lower-hexadecimal lower-latin lower-norwegian lower-roman lowercase ltr luminosity malayalam manipulation match matrix matrix3d media-play-button media-slider media-sliderthumb media-volume-slider media-volume-sliderthumb medium menu menulist menulist-button menutext message-box middle min-intrinsic mix mongolian monospace move multiple multiple_mask_images multiply myanmar n-resize narrower ne-resize nesw-resize no-close-quote no-drop no-open-quote no-repeat none normal not-allowed nowrap ns-resize numbers numeric nw-resize nwse-resize oblique octal opacity open-quote optimizeLegibility optimizeSpeed oriya oromo outset outside outside-shape overlay overline padding padding-box painted page paused persian perspective pinch-zoom plus-darker plus-lighter pointer polygon portrait pre pre-line pre-wrap preserve-3d progress push-button radial-gradient radio read-only read-write read-write-plaintext-only rectangle region relative repeat repeating-linear-gradient repeating-radial-gradient repeating-conic-gradient repeat-x repeat-y reset reverse rgb rgba ridge right rotate rotate3d rotateX rotateY rotateZ round row row-resize row-reverse rtl run-in running s-resize sans-serif saturate saturation scale scale3d scaleX scaleY scaleZ screen scroll scrollbar scroll-position se-resize searchfield searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration self-start self-end semi-condensed semi-expanded separate sepia serif show sidama simp-chinese-formal simp-chinese-informal single skew skewX skewY skip-white-space slide slider-horizontal slider-vertical sliderthumb-horizontal sliderthumb-vertical slow small small-caps small-caption smaller soft-light solid somali source-atop source-in source-out source-over space space-around space-between space-evenly spell-out square square-button start static status-bar stretch stroke stroke-box sub subpixel-antialiased svg_masks super sw-resize symbolic symbols system-ui table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group tamil telugu text text-bottom text-top textarea textfield thai thick thin threeddarkshadow threedface threedhighlight threedlightshadow threedshadow tibetan tigre tigrinya-er tigrinya-er-abegede tigrinya-et tigrinya-et-abegede to top trad-chinese-formal trad-chinese-informal transform translate translate3d translateX translateY translateZ transparent ultra-condensed ultra-expanded underline unidirectional-pan unset up upper-alpha upper-armenian upper-greek upper-hexadecimal upper-latin upper-norwegian upper-roman uppercase urdu url var vertical vertical-text view-box visible visibleFill visiblePainted visibleStroke visual w-resize wait wave wider window windowframe windowtext words wrap wrap-reverse x-large x-small xor xx-large xx-small".split(" "),
E=m(Z);x=x.concat(S).concat(T).concat(U).concat(V).concat(W).concat(Y).concat(Z);l.registerHelper("hintWords","css",x);l.defineMIME("text/css",{documentTypes:R,mediaTypes:y,mediaFeatures:z,mediaValueKeywords:F,propertyKeywords:A,nonStandardPropertyKeywords:B,fontProperties:C,counterDescriptors:X,colorKeywords:D,valueKeywords:E,tokenHooks:{"/":function(d,e){if(!d.eat("*"))return!1;e.tokenize=q;return q(d,e)}},name:"css"});l.defineMIME("text/x-scss",{mediaTypes:y,mediaFeatures:z,mediaValueKeywords:F,
propertyKeywords:A,nonStandardPropertyKeywords:B,colorKeywords:D,valueKeywords:E,fontProperties:C,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(d,e){return d.eat("/")?(d.skipToEnd(),["comment","comment"]):d.eat("*")?(e.tokenize=q,q(d,e)):["operator","operator"]},":":function(d){return d.match(/^\s*\{/,!1)?[null,null]:!1},$:function(d){d.match(/^[\w-]+/);return d.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(d){return d.eat("{")?[null,"interpolation"]:
!1}},name:"css",helperType:"scss"});l.defineMIME("text/x-less",{mediaTypes:y,mediaFeatures:z,mediaValueKeywords:F,propertyKeywords:A,nonStandardPropertyKeywords:B,colorKeywords:D,valueKeywords:E,fontProperties:C,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(d,e){return d.eat("/")?(d.skipToEnd(),["comment","comment"]):d.eat("*")?(e.tokenize=q,q(d,e)):["operator","operator"]},"@":function(d){if(d.eat("{"))return[null,"interpolation"];if(d.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,
!1))return!1;d.eatWhile(/[\w\\\-]/);return d.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});l.defineMIME("text/x-gss",{documentTypes:R,mediaTypes:y,mediaFeatures:z,propertyKeywords:A,nonStandardPropertyKeywords:B,fontProperties:C,counterDescriptors:X,colorKeywords:D,valueKeywords:E,supportsAtComponent:!0,tokenHooks:{"/":function(d,e){if(!d.eat("*"))return!1;e.tokenize=q;return q(d,e)}},name:"css",
helperType:"gss"})});
// dart.js
(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],d):d(CodeMirror)})(function(d){function g(b){for(var a={},c=0;c<b.length;++c)a[b[c]]=!0;return a}function k(b,a,c,f){function n(e,l){for(var h=!1;!e.eol();){if(!f&&!h&&"$"==e.peek()){e=l;(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize);l.tokenize=v;break}var p=e.next();if(p==
b&&!h&&(!q||e.match(b+b))){l.tokenize=null;break}h=!f&&!h&&"\\"==p}return"string"}var q=!1;if(a.eat(b))if(a.eat(b))q=!0;else return"string";c.tokenize=n;return n(a,c)}function v(b,a){b.eat("$");b.eat("{")?a.tokenize=null:a.tokenize=w;return null}function w(b,a){b.eatWhile(/[\w_]/);a.tokenize=(a.interpolationStack||(a.interpolationStack=[])).pop();return"variable"}function m(b){return function(a,c){for(var f;f=a.next();)if("*"==f&&a.eat("/"))if(1==b){c.tokenize=null;break}else return c.tokenize=m(b-
1),c.tokenize(a,c);else if("/"==f&&a.eat("*"))return c.tokenize=m(b+1),c.tokenize(a,c);return"comment"}}var r="this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline".split(" "),t=["true",
"false","null"],u="void bool num int double dynamic var String Null Never".split(" ");d.defineMIME("application/dart",{name:"clike",keywords:g(r),blockKeywords:g("try catch finally do else for if switch while".split(" ")),builtin:g(u),atoms:g(t),hooks:{"@":function(b){b.eatWhile(/[\w\$_\.]/);return"meta"},"'":function(b,a){return k("'",b,a,!1)},'"':function(b,a){return k('"',b,a,!1)},r:function(b,a){var c=b.peek();return"'"==c||'"'==c?k(b.next(),b,a,!0):!1},"}":function(b,a){return 0<(a.interpolationStack?
a.interpolationStack.length:0)?(a.tokenize=(a.interpolationStack||(a.interpolationStack=[])).pop(),null):!1},"/":function(b,a){if(!b.eat("*"))return!1;a.tokenize=m(1);return a.tokenize(b,a)},token:function(b,a,c){if("variable"==c&&RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g").test(b.current()))return"variable-2"}}});d.registerHelper("hintWords","application/dart",r.concat(t).concat(u));d.defineMode("dart",function(b){return d.getMode(b,"application/dart")},"clike")});
// htmlmixed.js
(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)})(function(e){function t(m,c){for(var k in m)for(var f=c[k]||(c[k]=[]),d=m[k],g=d.length-1;0<=g;g--)f.unshift(d[g])}function x(m,c){for(var k=0;k<m.length;k++){var f=m[k],d;if(!(d=!f[0])){d=
f[1];var g=d.test;var a=c;var b=a.match;var h=f[0];var l=u[h];h=l?l:u[h]=new RegExp("\\s+"+h+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");a=(a=b.call(a,h))?/^\s*(.*?)\s*$/.exec(a[2])[1]:"";d=g.call(d,a)}if(d)return f[2]}}var y={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"]]},u={};e.defineMode("htmlmixed",function(m,c){function k(a,b){var h=f.token(a,b.htmlState),l=/\btag\b/.test(h),r;if(l&&!/[<>\s\/]/.test(a.current())&&(r=b.htmlState.tagName&&b.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(r))b.inTag=r+" ";else if(b.inTag&&l&&/>$/.test(a.current())){l=/^([\S]+) (.*)/.exec(b.inTag);b.inTag=null;a=">"==a.current()&&x(d[l[1]],l[2]);a=e.getMode(m,a);var z=new RegExp("^</\\s*"+l[1]+"\\s*>","i"),v=new RegExp("</\\s*"+l[1]+"\\s*>",
"i");b.token=function(n,p){if(n.match(z,!1))return p.token=k,p.localState=p.localMode=null;p=p.localMode.token(n,p.localState);var q=n.current(),w=q.search(v);-1<w?n.backUp(q.length-w):q.match(/<\/?$/)&&(n.backUp(q.length),n.match(v,!1)||n.match(q));return p};b.localMode=a;b.localState=e.startState(a,f.indent(b.htmlState,"",""))}else b.inTag&&(b.inTag+=a.current(),a.eol()&&(b.inTag+=" "));return h}var f=e.getMode(m,{name:"xml",htmlMode:!0,multilineTagIndentFactor:c.multilineTagIndentFactor,multilineTagIndentPastTag:c.multilineTagIndentPastTag,
allowMissingTagName:c.allowMissingTagName}),d={},g=c&&c.tags;c=c&&c.scriptTypes;t(y,d);g&&t(g,d);if(c)for(g=c.length-1;0<=g;g--)d.script.unshift(["type",c[g].matches,c[g].mode]);return{startState:function(){var a=e.startState(f);return{token:k,inTag:null,localMode:null,localState:null,htmlState:a}},copyState:function(a){var b;a.localState&&(b=e.copyState(a.localMode,a.localState));return{token:a.token,inTag:a.inTag,localMode:a.localMode,localState:b,htmlState:e.copyState(f,a.htmlState)}},token:function(a,
b){return b.token(a,b)},indent:function(a,b,h){return!a.localMode||/^\s*<\//.test(b)?f.indent(a.htmlState,b,h):a.localMode.indent?a.localMode.indent(a.localState,b,h):e.Pass},innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||f}}}},"xml","javascript","css");e.defineMIME("text/html","htmlmixed")});
// javascript.js
(function(v){"object"==typeof exports&&"object"==typeof module?v(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],v):v(CodeMirror)})(function(v){v.defineMode("javascript",function(Ua,A){var p,w,f;function u(a,b,d){V=a;ca=d;return b}function I(a,b){var d=a.next();if('"'==d||"'"==d)return b.tokenize=Va(d),b.tokenize(a,b);if("."==d&&a.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return u("number","number");if("."==d&&a.match(".."))return u("spread","meta");
if(/[\[\]{}\(\),;:\.]/.test(d))return u(d);if("="==d&&a.eat(">"))return u("=>","operator");if("0"==d&&a.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return u("number","number");if(/\d/.test(d))return a.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),u("number","number");if("/"==d){if(a.eat("*"))return b.tokenize=da,da(a,b);if(a.eat("/"))return a.skipToEnd(),u("comment","comment");if(Aa(a,b,1)){a:for(var e=b=!1;null!=(d=a.next());){if(!b){if("/"==d&&!e)break a;"["==d?e=!0:e&&"]"==d&&(e=
!1)}b=!b&&"\\"==d}a.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return u("regexp","string-2")}a.eat("=");return u("operator","operator",a.current())}if("`"==d)return b.tokenize=W,W(a,b);if("#"==d&&"!"==a.peek())return a.skipToEnd(),u("meta","meta");if("#"==d&&a.eatWhile(ea))return u("variable","property");if("<"==d&&a.match("!--")||"-"==d&&a.match("->")&&!/\S/.test(a.string.slice(0,a.start)))return a.skipToEnd(),u("comment","comment");if(Ba.test(d))return">"==d&&b.lexical&&">"==b.lexical.type||(a.eat("=")?
"!"!=d&&"="!=d||a.eat("="):/[<>*+\-|&?]/.test(d)&&(a.eat(d),">"==d&&a.eat(d))),"?"==d&&a.eat(".")?u("."):u("operator","operator",a.current());if(ea.test(d)){a.eatWhile(ea);d=a.current();if("."!=b.lastType){if(Ca.propertyIsEnumerable(d))return a=Ca[d],u(a.type,a.style,d);if("async"==d&&a.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return u("async","keyword",d)}return u("variable","variable",d)}}function Va(a){return function(b,d){var e=!1,h;if(fa&&"@"==b.peek()&&b.match(Wa))return d.tokenize=
I,u("jsonld-keyword","meta");for(;null!=(h=b.next())&&(h!=a||e);)e=!e&&"\\"==h;e||(d.tokenize=I);return u("string","string")}}function da(a,b){for(var d=!1,e;e=a.next();){if("/"==e&&d){b.tokenize=I;break}d="*"==e}return u("comment","comment")}function W(a,b){for(var d=!1,e;null!=(e=a.next());){if(!d&&("`"==e||"$"==e&&a.eat("{"))){b.tokenize=I;break}d=!d&&"\\"==e}return u("quasi","string-2",a.current())}function qa(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var d=a.string.indexOf("=>",a.start);if(!(0>
d)){if(r){var e=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,d));e&&(d=e.index)}e=0;var h=!1;for(--d;0<=d;--d){var m=a.string.charAt(d),y="([{}])".indexOf(m);if(0<=y&&3>y){if(!e){++d;break}if(0==--e){"("==m&&(h=!0);break}}else if(3<=y&&6>y)++e;else if(ea.test(m))h=!0;else if(/["'\/`]/.test(m))for(;;--d){if(0==d)return;if(a.string.charAt(d-1)==m&&"\\"!=a.string.charAt(d-2)){d--;break}}else if(h&&!e){++d;break}}h&&!e&&(b.fatArrowAt=d)}}function Da(a,b,d,e,h,m){this.indented=
a;this.column=b;this.type=d;this.prev=h;this.info=m;null!=e&&(this.align=e)}function Ea(a,b,d,e,h){var m=a.cc;p=a;w=h;f=null;ra=m;X=b;a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;)if((m.length?m.pop():J?t:x)(d,e)){for(;m.length&&m[m.length-1].lex;)m.pop()();if(f)return f;if(d="variable"==d)a:if(Fa){for(d=a.localVars;d;d=d.next)if(d.name==e){d=!0;break a}for(a=a.context;a;a=a.prev)for(d=a.vars;d;d=d.next)if(d.name==e){d=!0;break a}d=void 0}else d=!1;return d?"variable-2":b}}function k(){for(var a=
arguments.length-1;0<=a;a--)ra.push(arguments[a])}function c(){k.apply(null,arguments);return!0}function sa(a,b){for(;b;b=b.next)if(b.name==a)return!0;return!1}function O(a){var b=p;f="def";if(Fa){if(b.context)if("var"==b.lexical.info&&b.context&&b.context.block){var d=Ga(a,b.context);if(null!=d){b.context=d;return}}else if(!sa(a,b.localVars)){b.localVars=new Y(a,b.localVars);return}A.globalVars&&!sa(a,b.globalVars)&&(b.globalVars=new Y(a,b.globalVars))}}function Ga(a,b){return b?b.block?(a=Ga(a,
b.prev))?a==b.prev?b:new Z(a,b.vars,!0):null:sa(a,b.vars)?b:new Z(b.prev,new Y(a,b.vars),!1):null}function ha(a){return"public"==a||"private"==a||"protected"==a||"abstract"==a||"readonly"==a}function Z(a,b,d){this.prev=a;this.vars=b;this.block=d}function Y(a,b){this.name=a;this.next=b}function K(){p.context=new Z(p.context,p.localVars,!1);p.localVars=Xa}function ia(){p.context=new Z(p.context,p.localVars,!0);p.localVars=null}function C(){p.localVars=p.context.vars;p.context=p.context.prev}function l(a,
b){var d=function(){var e=p,h=e.indented;if("stat"==e.lexical.type)h=e.lexical.indented;else for(var m=e.lexical;m&&")"==m.type&&m.align;m=m.prev)h=m.indented;e.lexical=new Da(h,w.column(),a,null,e.lexical,b)};d.lex=!0;return d}function g(){var a=p;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function n(a){function b(d){return d==a?c():";"==a||"}"==d||")"==d||"]"==d?k():c(b)}return b}function x(a,b){return"var"==a?c(l("vardef",b),ta,n(";"),g):"keyword a"==
a?c(l("form"),ua,x,g):"keyword b"==a?c(l("form"),x,g):"keyword d"==a?w.match(/^\s*$/,!1)?c():c(l("stat"),P,n(";"),g):"debugger"==a?c(n(";")):"{"==a?c(l("}"),ia,ja,g,C):";"==a?c():"if"==a?("else"==p.lexical.info&&p.cc[p.cc.length-1]==g&&p.cc.pop()(),c(l("form"),ua,x,g,Ha)):"function"==a?c(G):"for"==a?c(l("form"),ia,Ia,x,C,g):"class"==a||r&&"interface"==b?(f="keyword",c(l("form","class"==a?a:b),Ja,g)):"variable"==a?r&&"declare"==b?(f="keyword",c(x)):r&&("module"==b||"enum"==b||"type"==b)&&w.match(/^\s*\w/,
!1)?(f="keyword","enum"==b?c(Ka):"type"==b?c(La,n("operator"),q,n(";")):c(l("form"),D,n("{"),l("}"),ja,g,g)):r&&"namespace"==b?(f="keyword",c(l("form"),t,x,g)):r&&"abstract"==b?(f="keyword",c(x)):c(l("stat"),Ya):"switch"==a?c(l("form"),ua,n("{"),l("}","switch"),ia,ja,g,g,C):"case"==a?c(t,n(":")):"default"==a?c(n(":")):"catch"==a?c(l("form"),K,Za,x,g,C):"export"==a?c(l("stat"),$a,g):"import"==a?c(l("stat"),ab,g):"async"==a?c(x):"@"==b?c(t,x):k(l("stat"),t,n(";"),g)}function Za(a){if("("==a)return c(L,
n(")"))}function t(a,b){return Ma(a,b,!1)}function B(a,b){return Ma(a,b,!0)}function ua(a){return"("!=a?k():c(l(")"),P,n(")"),g)}function Ma(a,b,d){if(p.fatArrowAt==w.start){var e=d?Na:Oa;if("("==a)return c(K,l(")"),z(L,")"),g,n("=>"),e,C);if("variable"==a)return k(K,D,n("=>"),e,C)}e=d?Q:M;return bb.hasOwnProperty(a)?c(e):"function"==a?c(G,e):"class"==a||r&&"interface"==b?(f="keyword",c(l("form"),cb,g)):"keyword c"==a||"async"==a?c(d?B:t):"("==a?c(l(")"),P,n(")"),g,e):"operator"==a||"spread"==a?c(d?
B:t):"["==a?c(l("]"),db,g,e):"{"==a?aa(ka,"}",null,e):"quasi"==a?k(la,e):"new"==a?c(eb(d)):c()}function P(a){return a.match(/[;\}\)\],]/)?k():k(t)}function M(a,b){return","==a?c(P):Q(a,b,!1)}function Q(a,b,d){var e=0==d?M:Q,h=0==d?t:B;if("=>"==a)return c(K,d?Na:Oa,C);if("operator"==a)return/\+\+|--/.test(b)||r&&"!"==b?c(e):r&&"<"==b&&w.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(l(">"),z(q,">"),g,e):"?"==b?c(t,n(":"),h):c(h);if("quasi"==a)return k(la,e);if(";"!=a){if("("==a)return aa(B,")","call",e);if("."==
a)return c(fb,e);if("["==a)return c(l("]"),P,n("]"),g,e);if(r&&"as"==b)return f="keyword",c(q,e);if("regexp"==a)return p.lastType=f="operator",w.backUp(w.pos-w.start-1),c(h)}}function la(a,b){return"quasi"!=a?k():"${"!=b.slice(b.length-2)?c(la):c(P,gb)}function gb(a){if("}"==a)return f="string-2",p.tokenize=W,c(la)}function Oa(a){qa(w,p);return k("{"==a?x:t)}function Na(a){qa(w,p);return k("{"==a?x:B)}function eb(a){return function(b){return"."==b?c(a?hb:ib):"variable"==b&&r?c(jb,a?Q:M):k(a?B:t)}}
function ib(a,b){if("target"==b)return f="keyword",c(M)}function hb(a,b){if("target"==b)return f="keyword",c(Q)}function Ya(a){return":"==a?c(g,x):k(M,n(";"),g)}function fb(a){if("variable"==a)return f="property",c()}function ka(a,b){if("async"==a)return f="property",c(ka);if("variable"==a||"keyword"==X){f="property";if("get"==b||"set"==b)return c(kb);var d;r&&p.fatArrowAt==w.start&&(d=w.match(/^\s*:\s*/,!1))&&(p.fatArrowAt=w.pos+d[0].length);return c(N)}if("number"==a||"string"==a)return f=fa?"property":
X+" property",c(N);if("jsonld-keyword"==a)return c(N);if(r&&ha(b))return f="keyword",c(ka);if("["==a)return c(t,R,n("]"),N);if("spread"==a)return c(B,N);if("*"==b)return f="keyword",c(ka);if(":"==a)return k(N)}function kb(a){if("variable"!=a)return k(N);f="property";return c(G)}function N(a){if(":"==a)return c(B);if("("==a)return k(G)}function z(a,b,d){function e(h,m){return(d?-1<d.indexOf(h):","==h)?(h=p.lexical,"call"==h.info&&(h.pos=(h.pos||0)+1),c(function(y,va){return y==b||va==b?k():k(a)},e)):
h==b||m==b?c():d&&-1<d.indexOf(";")?k(a):c(n(b))}return function(h,m){return h==b||m==b?c():k(a,e)}}function aa(a,b,d){for(var e=3;e<arguments.length;e++)ra.push(arguments[e]);return c(l(b,d),z(a,b),g)}function ja(a){return"}"==a?c():k(x,ja)}function R(a,b){if(r){if(":"==a)return c(q);if("?"==b)return c(R)}}function lb(a,b){if(r&&(":"==a||"in"==b))return c(q)}function Pa(a){if(r&&":"==a)return w.match(/^\s*\w+\s+is\b/,!1)?c(t,mb,q):c(q)}function mb(a,b){if("is"==b)return f="keyword",c()}function q(a,
b){if("keyof"==b||"typeof"==b||"infer"==b||"readonly"==b)return f="keyword",c("typeof"==b?B:q);if("variable"==a||"void"==b)return f="type",c(E);if("|"==b||"&"==b)return c(q);if("string"==a||"number"==a||"atom"==a)return c(E);if("["==a)return c(l("]"),z(q,"]",","),g,E);if("{"==a)return c(l("}"),wa,g,E);if("("==a)return c(z(xa,")"),nb,E);if("<"==a)return c(z(q,">"),q);if("quasi"==a)return k(ya,E)}function nb(a){if("=>"==a)return c(q)}function wa(a){return a.match(/[\}\)\]]/)?c():","==a||";"==a?c(wa):
k(ba,wa)}function ba(a,b){if("variable"==a||"keyword"==X)return f="property",c(ba);if("?"==b||"number"==a||"string"==a)return c(ba);if(":"==a)return c(q);if("["==a)return c(n("variable"),lb,n("]"),ba);if("("==a)return k(S,ba);if(!a.match(/[;\}\)\],]/))return c()}function ya(a,b){return"quasi"!=a?k():"${"!=b.slice(b.length-2)?c(ya):c(q,ob)}function ob(a){if("}"==a)return f="string-2",p.tokenize=W,c(ya)}function xa(a,b){return"variable"==a&&w.match(/^\s*[?:]/,!1)||"?"==b?c(xa):":"==a?c(q):"spread"==
a?c(xa):k(q)}function E(a,b){if("<"==b)return c(l(">"),z(q,">"),g,E);if("|"==b||"."==a||"&"==b)return c(q);if("["==a)return c(q,n("]"),E);if("extends"==b||"implements"==b)return f="keyword",c(q);if("?"==b)return c(q,n(":"),q)}function jb(a,b){if("<"==b)return c(l(">"),z(q,">"),g,E)}function ma(){return k(q,pb)}function pb(a,b){if("="==b)return c(q)}function ta(a,b){return"enum"==b?(f="keyword",c(Ka)):k(D,R,H,qb)}function D(a,b){if(r&&ha(b))return f="keyword",c(D);if("variable"==a)return O(b),c();
if("spread"==a)return c(D);if("["==a)return aa(rb,"]");if("{"==a)return aa(Qa,"}")}function Qa(a,b){if("variable"==a&&!w.match(/^\s*:/,!1))return O(b),c(H);"variable"==a&&(f="property");return"spread"==a?c(D):"}"==a?k():"["==a?c(t,n("]"),n(":"),Qa):c(n(":"),D,H)}function rb(){return k(D,H)}function H(a,b){if("="==b)return c(B)}function qb(a){if(","==a)return c(ta)}function Ha(a,b){if("keyword b"==a&&"else"==b)return c(l("form","else"),x,g)}function Ia(a,b){if("await"==b)return c(Ia);if("("==a)return c(l(")"),
sb,g)}function sb(a){return"var"==a?c(ta,T):"variable"==a?c(T):k(T)}function T(a,b){return")"==a?c():";"==a?c(T):"in"==b||"of"==b?(f="keyword",c(t,T)):k(t,T)}function G(a,b){if("*"==b)return f="keyword",c(G);if("variable"==a)return O(b),c(G);if("("==a)return c(K,l(")"),z(L,")"),g,Pa,x,C);if(r&&"<"==b)return c(l(">"),z(ma,">"),g,G)}function S(a,b){if("*"==b)return f="keyword",c(S);if("variable"==a)return O(b),c(S);if("("==a)return c(K,l(")"),z(L,")"),g,Pa,C);if(r&&"<"==b)return c(l(">"),z(ma,">"),
g,S)}function La(a,b){if("keyword"==a||"variable"==a)return f="type",c(La);if("<"==b)return c(l(">"),z(ma,">"),g)}function L(a,b){"@"==b&&c(t,L);return"spread"==a?c(L):r&&ha(b)?(f="keyword",c(L)):r&&"this"==a?c(R,H):k(D,R,H)}function cb(a,b){return"variable"==a?Ja(a,b):na(a,b)}function Ja(a,b){if("variable"==a)return O(b),c(na)}function na(a,b){if("<"==b)return c(l(">"),z(ma,">"),g,na);if("extends"==b||"implements"==b||r&&","==a)return"implements"==b&&(f="keyword"),c(r?q:t,na);if("{"==a)return c(l("}"),
F,g)}function F(a,b){if("async"==a||"variable"==a&&("static"==b||"get"==b||"set"==b||r&&ha(b))&&w.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return f="keyword",c(F);if("variable"==a||"keyword"==X)return f="property",c(oa,F);if("number"==a||"string"==a)return c(oa,F);if("["==a)return c(t,R,n("]"),oa,F);if("*"==b)return f="keyword",c(F);if(r&&"("==a)return k(S,F);if(";"==a||","==a)return c(F);if("}"==a)return c();if("@"==b)return c(t,F)}function oa(a,b){if("!"==b||"?"==b)return c(oa);if(":"==a)return c(q,H);
if("="==b)return c(B);a=p.lexical.prev;return k(a&&"interface"==a.info?S:G)}function $a(a,b){return"*"==b?(f="keyword",c(za,n(";"))):"default"==b?(f="keyword",c(t,n(";"))):"{"==a?c(z(Ra,"}"),za,n(";")):k(x)}function Ra(a,b){if("as"==b)return f="keyword",c(n("variable"));if("variable"==a)return k(B,Ra)}function ab(a){return"string"==a?c():"("==a?k(t):"."==a?k(M):k(pa,Sa,za)}function pa(a,b){if("{"==a)return aa(pa,"}");"variable"==a&&O(b);"*"==b&&(f="keyword");return c(tb)}function Sa(a){if(","==a)return c(pa,
Sa)}function tb(a,b){if("as"==b)return f="keyword",c(pa)}function za(a,b){if("from"==b)return f="keyword",c(t)}function db(a){return"]"==a?c():k(z(B,"]"))}function Ka(){return k(l("form"),D,n("{"),l("}"),z(ub,"}"),g,g)}function ub(){return k(D,H)}function Aa(a,b,d){return b.tokenize==I&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(b.lastType)||"quasi"==b.lastType&&/\{\s*$/.test(a.string.slice(0,a.pos-(d||0)))}var U=Ua.indentUnit,Ta=A.statementIndent,fa=A.jsonld,
J=A.json||fa,Fa=!1!==A.trackScope,r=A.typescript,ea=A.wordCharacters||/[\w$\xa1-\uffff]/,Ca=function(){function a(va){return{type:va,style:"keyword"}}var b=a("keyword a"),d=a("keyword b"),e=a("keyword c"),h=a("keyword d"),m=a("operator"),y={type:"atom",style:"atom"};return{"if":a("if"),"while":b,"with":b,"else":d,"do":d,"try":d,"finally":d,"return":h,"break":h,"continue":h,"new":a("new"),"delete":e,"void":e,"throw":e,"debugger":a("debugger"),"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),