PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.2.2
Defender Security – Malware Scanner, Login Security & Firewall v6.2.2
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / assets / js / shared-ui.js

shared-ui.js in Defender Security – Malware Scanner, Login Security & Firewall 6.2.2, at assets/js/shared-ui.js

24,400 lines 878.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*!
2 * WPMU DEV Shared UI
3 * Copyright 2018 - 2021 Incsub (https://incsub.com)
4 * Licensed under GPL v3 (http://www.gnu.org/licenses/gpl-3.0.html)
5 */
6 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
7
8 (function ($) {
9 // Enable strict mode.
10 'use strict'; // Create the defaults once
11
12 var pluginName = 'SUIAccordion',
13 defaults = {}; // The actual plugin constructor
14
15 function SUIAccordion(element, options) {
16 this.element = element;
17 this.$element = $(this.element);
18 this.settings = $.extend({}, defaults, options);
19 this._defaults = defaults;
20 this._name = pluginName;
21 this.init();
22 } // Avoid Plugin.prototype conflicts
23
24
25 $.extend(SUIAccordion.prototype, {
26 init: function init() {
27 var self = this;
28 this.$element.on('click', 'div.sui-accordion-item-header, tr.sui-accordion-item', function (event) {
29 var getItem = $(this).closest('.sui-accordion-item'),
30 getContent = getItem.nextUntil('.sui-accordion-item').filter('.sui-accordion-item-content'),
31 getParent = getItem.closest('.sui-accordion'),
32 getChart = getItem.find('.sui-chartjs-animated');
33 var clickedTarget = $(event.target);
34 var flexHeader = $(this),
35 flexItem = flexHeader.parent(),
36 flexChart = flexItem.find('.sui-chartjs-animated'),
37 flexParent = flexItem.parent(),
38 flexContent = flexHeader.next('.sui-accordion-item-body');
39 var tableItem = $(this),
40 tableContent = tableItem.nextUntil('.sui-accordion-item').filter('.sui-accordion-item-content');
41 var button = $(this).find('.sui-accordion-open-indicator > .sui-screen-reader-text'),
42 buttonText = button === null || button === void 0 ? void 0 : button.text(),
43 dataContent = button === null || button === void 0 ? void 0 : button.data('content');
44
45 if (clickedTarget.closest('.sui-accordion-item-action').length) {
46 return true;
47 } // CHECK: Flexbox
48
49
50 if (flexHeader.hasClass('sui-accordion-item-header')) {
51 if (flexItem.hasClass('sui-accordion-item--disabled')) {
52 flexItem.removeClass('sui-accordion-item--open');
53 } else {
54 if (flexItem.hasClass('sui-accordion-item--open')) {
55 flexItem.removeClass('sui-accordion-item--open');
56 } else {
57 flexItem.addClass('sui-accordion-item--open');
58 flexContent.attr('tabindex', '0').trigger('focus');
59 }
60 } // CHECK: Accordion Blocks
61
62
63 if (flexParent.hasClass('sui-accordion-block') && 0 !== flexChart.length) {
64 flexItem.find('.sui-accordion-item-data').addClass('sui-onload');
65 flexChart.removeClass('sui-chartjs-loaded');
66
67 if (flexItem.hasClass('sui-accordion-item--open')) {
68 setTimeout(function () {
69 flexItem.find('.sui-accordion-item-data').removeClass('sui-onload');
70 flexChart.addClass('sui-chartjs-loaded');
71 }, 1200);
72 }
73 }
74 } // CHECK: Table
75
76
77 if (tableItem.hasClass('sui-accordion-item')) {
78 if (tableItem.hasClass('sui-accordion-item--disabled')) {
79 tableContent.removeClass('sui-accordion-item--open');
80 } else {
81 if (tableItem.hasClass('sui-accordion-item--open')) {
82 tableItem.removeClass('sui-accordion-item--open');
83 tableContent.removeClass('sui-accordion-item--open');
84 } else {
85 tableItem.addClass('sui-accordion-item--open');
86 tableContent.addClass('sui-accordion-item--open');
87 tableContent.attr('tabindex', '0').trigger('focus');
88 }
89 }
90 } // Change button accessiblity content based on accordin open and close.
91
92
93 if (dataContent) {
94 button.html(dataContent);
95 button.data('content', buttonText);
96 }
97
98 event.stopPropagation();
99 });
100 }
101 }); // A really lightweight plugin wrapper around the constructor,
102 // preventing against multiple instantiations
103
104 $.fn[pluginName] = function (options) {
105 return this.each(function () {
106 // instance of SUIAccordion can be called with $(element).data('SUIAccordion')
107 if (!$.data(this, pluginName)) {
108 $.data(this, pluginName, new SUIAccordion(this, options));
109 }
110 });
111 };
112 })(jQuery, window, document);
113
114 (function ($) {
115 // Enable strict mode.
116 'use strict'; // Define global SUI object if it doesn't exist.
117
118 if ('object' !== _typeof(window.SUI)) {
119 window.SUI = {};
120 }
121
122 SUI.suiAccordion = function (el) {
123 var accordionTable = $(el);
124
125 function init() {
126 accordionTable.SUIAccordion({});
127 }
128
129 init();
130 return this;
131 };
132
133 if (0 !== $('.sui-2-12-24 .sui-accordion').length) {
134 $('.sui-2-12-24 .sui-accordion').each(function () {
135 SUI.suiAccordion(this);
136 });
137 }
138 })(jQuery);
139 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
140
141 // the semi-colon before function invocation is a safety net against concatenated
142 // scripts and/or other plugins which may not be closed properly.
143 ;
144
145 (function ($, ClipboardJS, window, document, undefined) {
146 'use strict'; // undefined is used here as the undefined global variable in ECMAScript 3 is
147 // mutable (ie. it can be changed by someone else). undefined isn't really being
148 // passed in so we can ensure the value of it is truly undefined. In ES5, undefined
149 // can no longer be modified.
150 // window and document are passed through as local variables rather than global
151 // as this (slightly) quickens the resolution process and can be more efficiently
152 // minified (especially when both are regularly referenced in your plugin).
153 // Create the defaults once
154
155 var pluginName = 'SUICodeSnippet',
156 defaults = {
157 copyText: 'Copy',
158 copiedText: 'Copied!'
159 }; // The actual plugin constructor
160
161 function SUICodeSnippet(element, options) {
162 this.element = element;
163 this.$element = $(this.element); // jQuery has an extend method which merges the contents of two or
164 // more objects, storing the result in the first object. The first object
165 // is generally empty as we don't want to alter the default options for
166 // future instances of the plugin
167
168 this.settings = $.extend({}, defaults, options);
169 this._defaults = defaults;
170 this._name = pluginName;
171 this._clipboardJs = null;
172 this._clipboardId = '';
173 this.init();
174 } // Avoid Plugin.prototype conflicts
175
176
177 $.extend(SUICodeSnippet.prototype, {
178 init: function init() {
179 var self = this,
180 button = ''; // check if its already wrapped
181
182 if (0 === this.$element.parent('sui-code-snippet-wrapper').length) {
183 // build markup
184 this.$element.wrap('<div class="sui-code-snippet-wrapper"></div>');
185 this._clipboardId = this.generateUniqueId();
186 button = '<button type="button" class="sui-button" id="sui-code-snippet-button-' + this._clipboardId + '" data-clipboard-target="#sui-code-snippet-' + this._clipboardId + '">' + this.settings.copyText + '</button>';
187 this.$element.attr('id', 'sui-code-snippet-' + this._clipboardId).after(button);
188 this._clipboardJs = new ClipboardJS('#sui-code-snippet-button-' + this._clipboardId); // attach events
189
190 this._clipboardJs.on('success', function (e) {
191 e.clearSelection();
192 self.showTooltip(e.trigger, self.settings.copiedText);
193 });
194
195 $('#sui-code-snippet-button-' + this._clipboardId).on('mouseleave.SUICodeSnippet', function () {
196 $(this).removeClass('sui-tooltip');
197 $(this).removeAttr('aria-label');
198 $(this).removeAttr('data-tooltip');
199 });
200 }
201 },
202 getClipboardJs: function getClipboardJs() {
203 return this._clipboardJs;
204 },
205 showTooltip: function showTooltip(e, msg) {
206 $(e).addClass('sui-tooltip');
207 $(e).attr('aria-label', msg);
208 $(e).attr('data-tooltip', msg);
209 },
210 generateUniqueId: function generateUniqueId() {
211 // Math.random should be unique because of its seeding algorithm.
212 // Convert it to base 36 (numbers + letters), and grab the first 9 characters
213 // after the decimal.
214 return '_' + Math.random().toString(36).substr(2, 9);
215 },
216 destroy: function destroy() {
217 if (null !== this._clipboardJs) {
218 this._clipboardJs.destroy();
219
220 this.$element.attr('id', '');
221 this.$element.unwrap('.sui-code-snippet-wrapper');
222 $('#sui-code-snippet-button-' + this._clipboardId).remove();
223 }
224 }
225 }); // A really lightweight plugin wrapper around the constructor,
226 // preventing against multiple instantiations
227
228 $.fn[pluginName] = function (options) {
229 return this.each(function () {
230 // instance of SUICodeSnippet can be called with $(element).data('SUICodeSnippet')
231 if (!$.data(this, pluginName)) {
232 $.data(this, pluginName, new SUICodeSnippet(this, options));
233 }
234 });
235 };
236 })(jQuery, ClipboardJS, window, document);
237
238 (function ($) {
239 // Enable strict mode.
240 'use strict'; // Define global SUI object if it doesn't exist.
241
242 if ('object' !== _typeof(window.SUI)) {
243 window.SUI = {};
244 }
245
246 SUI.suiCodeSnippet = function () {
247 // Convert all code snippet.
248 $('.sui-2-12-24 .sui-code-snippet:not(.sui-no-copy)').each(function () {
249 // backward compat of instantiate new accordion
250 $(this).SUICodeSnippet({});
251 });
252 }; // wait document ready first
253
254
255 $(document).ready(function () {
256 SUI.suiCodeSnippet();
257 });
258 })(jQuery);
259 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
260
261 (function ($) {
262 // Enable strict mode.
263 'use strict'; // Define global SUI object if it doesn't exist.
264
265 if ('object' !== _typeof(window.SUI)) {
266 window.SUI = {};
267 }
268
269 SUI.sliderBack = function (el) {
270 var slider = $(el),
271 dialog = slider.closest('.sui-dialog'),
272 slides = slider.find('.sui-slider-content > li');
273 var navigation = slider.find('.sui-slider-navigation'),
274 navButtons = navigation.find('button'),
275 btnBack = navigation.find('.sui-prev'),
276 btnNext = navigation.find('.sui-next');
277
278 if (!dialog.hasClass('sui-dialog-onboard')) {
279 return;
280 }
281
282 function init() {
283 var currSlide = slider.find('.sui-slider-content > li.sui-current'),
284 prevSlide = currSlide.prev();
285
286 if (!prevSlide.length) {
287 if (slider.hasClass('sui-infinite')) {
288 prevSlide = slider.find('.sui-slider-content > li:last');
289 currSlide.removeClass('sui-current');
290 currSlide.removeClass('sui-loaded');
291 prevSlide.addClass('sui-current');
292 prevSlide.addClass('fadeInLeft');
293 navButtons.prop('disabled', true);
294 setTimeout(function () {
295 prevSlide.addClass('sui-loaded');
296 prevSlide.removeClass('fadeInLeft');
297 }, 600);
298 setTimeout(function () {
299 navButtons.prop('disabled', false);
300 }, 650);
301 }
302 } else {
303 currSlide.removeClass('sui-current');
304 currSlide.removeClass('sui-loaded');
305 prevSlide.addClass('sui-current');
306 prevSlide.addClass('fadeInLeft');
307 navButtons.prop('disabled', true);
308
309 if (!slider.hasClass('sui-infinite')) {
310 btnNext.removeClass('sui-hidden');
311
312 if (slides.first().data('slide') === prevSlide.data('slide')) {
313 btnBack.addClass('sui-hidden');
314 }
315 }
316
317 setTimeout(function () {
318 prevSlide.addClass('sui-loaded');
319 prevSlide.removeClass('fadeInLeft');
320 }, 600);
321 setTimeout(function () {
322 navButtons.prop('disabled', false);
323 }, 650);
324 }
325 }
326
327 init();
328 return this;
329 };
330
331 SUI.sliderNext = function (el) {
332 var slider = $(el),
333 dialog = slider.closest('.sui-dialog'),
334 slides = slider.find('.sui-slider-content > li');
335 var navigation = slider.find('.sui-slider-navigation'),
336 navButtons = navigation.find('button'),
337 btnBack = navigation.find('.sui-prev'),
338 btnNext = navigation.find('.sui-next');
339
340 if (!dialog.hasClass('sui-dialog-onboard')) {
341 return;
342 }
343
344 function init() {
345 var currSlide = slider.find('.sui-slider-content > li.sui-current'),
346 nextSlide = currSlide.next();
347
348 if (!nextSlide.length) {
349 if (slider.hasClass('sui-infinite')) {
350 nextSlide = slider.find('.sui-slider-content > li:first');
351 currSlide.removeClass('sui-current');
352 currSlide.removeClass('sui-loaded');
353 nextSlide.addClass('sui-current');
354 nextSlide.addClass('fadeInRight');
355 navButtons.prop('disabled', true);
356 setTimeout(function () {
357 nextSlide.addClass('sui-loaded');
358 nextSlide.removeClass('fadeInRight');
359 }, 600);
360 setTimeout(function () {
361 navButtons.prop('disabled', false);
362 }, 650);
363 }
364 } else {
365 currSlide.removeClass('sui-current');
366 currSlide.removeClass('sui-loaded');
367 nextSlide.addClass('sui-current');
368 nextSlide.addClass('fadeInRight');
369 navButtons.prop('disabled', true);
370
371 if (!slider.hasClass('sui-infinite')) {
372 btnBack.removeClass('sui-hidden');
373
374 if (slides.length === nextSlide.data('slide')) {
375 btnNext.addClass('sui-hidden');
376 }
377 }
378
379 setTimeout(function () {
380 nextSlide.addClass('sui-loaded');
381 nextSlide.removeClass('fadeInRight');
382 }, 600);
383 setTimeout(function () {
384 navButtons.prop('disabled', false);
385 }, 650);
386 }
387 }
388
389 init();
390 return this;
391 };
392
393 SUI.sliderStep = function (el) {
394 var slider = $(el),
395 dialog = slider.closest('.sui-dialog');
396 var slides = slider.find('.sui-slider-content'),
397 slide = slides.find('> li');
398 var steps = slider.find('.sui-slider-steps'),
399 step = steps.find('li'),
400 button = step.find('button');
401 var navigation = slider.find('.sui-slider-navigation'),
402 navButtons = navigation.find('button'),
403 navBack = navigation.find('.sui-prev'),
404 navNext = navigation.find('.sui-next');
405
406 if (!dialog.hasClass('sui-dialog-onboard') && !steps.hasClass('sui-clickable')) {
407 return;
408 }
409
410 function reset() {
411 // Remove current class
412 slide.removeClass('sui-current'); // Remove loaded state
413
414 slide.removeClass('sui-loaded');
415 }
416
417 function load(element) {
418 var button = $(element),
419 index = button.data('slide');
420 var curSlide = button.closest('li[data-slide]'),
421 newSlide = slides.find('> li[data-slide="' + index + '"]');
422 newSlide.addClass('sui-current');
423
424 if (curSlide.data('slide') < newSlide.data('slide')) {
425 newSlide.addClass('fadeInRight');
426 } else {
427 newSlide.addClass('fadeInLeft');
428 }
429
430 navButtons.prop('disabled', true);
431
432 if (!slider.hasClass('sui-infinite')) {
433 if (1 === newSlide.data('slide')) {
434 navBack.addClass('sui-hidden');
435 navNext.removeClass('sui-hidden');
436 }
437
438 if (slide.length === newSlide.data('slide')) {
439 navBack.removeClass('sui-hidden');
440 navNext.addClass('sui-hidden');
441 }
442 }
443
444 setTimeout(function () {
445 newSlide.addClass('sui-loaded');
446
447 if (curSlide.data('slide') < newSlide.data('slide')) {
448 newSlide.removeClass('fadeInRight');
449 } else {
450 newSlide.removeClass('fadeInLeft');
451 }
452 }, 600);
453 setTimeout(function () {
454 navButtons.prop('disabled', false);
455 }, 650);
456 }
457
458 function init() {
459 if (button.length) {
460 button.on('click', function (e) {
461 reset();
462 load(this);
463 e.preventDefault();
464 e.stopPropagation();
465 });
466 }
467 }
468
469 init();
470 return this;
471 };
472
473 SUI.dialogSlider = function (el) {
474 var slider = $(el),
475 dialog = slider.closest('.sui-dialog'),
476 btnBack = slider.find('.sui-slider-navigation .sui-prev'),
477 btnNext = slider.find('.sui-slider-navigation .sui-next'),
478 tourBack = slider.find('*[data-a11y-dialog-tour-back]'),
479 tourNext = slider.find('*[data-a11y-dialog-tour-next]'),
480 steps = slider.find('.sui-slider-steps');
481
482 if (!dialog.hasClass('sui-dialog-onboard') || slider.hasClass('sui-slider-off')) {
483 return;
484 }
485
486 function init() {
487 if (btnBack.length) {
488 btnBack.on('click', function (e) {
489 SUI.sliderBack(slider);
490 e.preventDefault();
491 });
492 }
493
494 if (tourBack.length) {
495 tourBack.on('click', function (e) {
496 SUI.sliderBack(slider);
497 e.preventDefault();
498 });
499 }
500
501 if (btnNext.length) {
502 btnNext.on('click', function (e) {
503 SUI.sliderNext(slider);
504 e.preventDefault();
505 });
506 }
507
508 if (tourNext.length) {
509 tourNext.on('click', function (e) {
510 SUI.sliderNext(slider);
511 e.preventDefault();
512 });
513 }
514
515 if (steps.length) {
516 SUI.sliderStep(slider);
517 }
518 }
519
520 init();
521 return this;
522 };
523
524 $('.sui-2-12-24 .sui-slider').each(function () {
525 SUI.dialogSlider(this);
526 });
527 })(jQuery);
528 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
529
530 (function ($) {
531 // Enable strict mode.
532 'use strict'; // Define global SUI object if it doesn't exist.
533
534 if ('object' !== _typeof(window.SUI)) {
535 window.SUI = {};
536 }
537
538 SUI.linkDropdown = function () {
539 function closeAllDropdowns($except) {
540 var $dropdowns = $('.sui-2-12-24 .sui-dropdown');
541
542 if ($except) {
543 $dropdowns = $dropdowns.not($except);
544 }
545
546 $dropdowns.removeClass('open');
547 }
548
549 $('body').on('click', '.sui-dropdown-anchor', function (e) {
550 var $button = $(this),
551 $parent = $button.parent();
552 closeAllDropdowns($parent);
553
554 if ($parent.hasClass('sui-dropdown')) {
555 $parent.toggleClass('open');
556 }
557
558 e.preventDefault();
559 });
560 $('body').on('mouseup', function (e) {
561 var $anchor = $('.sui-2-12-24 .sui-dropdown-anchor');
562
563 if (!$anchor.is(e.target) && 0 === $anchor.has(e.target).length) {
564 closeAllDropdowns();
565 }
566 });
567 };
568
569 SUI.linkDropdown();
570 })(jQuery);
571 // This file is to be used for fixing up issues with IE11.
572 (function ($) {
573 var colorpickers = $('.sui-colorpicker-wrap'); // If IE11 remove SUI colorpicker styles.
574
575 if (!!navigator.userAgent.match(/Trident\/7\./) && colorpickers[0]) {
576 colorpickers.find('.sui-colorpicker').hide();
577 colorpickers.removeClass('sui-colorpicker-wrap');
578 }
579 })(jQuery);
580 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
581
582 (function () {
583 // Enable strict mode.
584 'use strict';
585
586 if ('object' !== _typeof(window.SUI)) {
587 window.SUI = {};
588 }
589 /**
590 * @namespace aria
591 */
592
593
594 var aria = aria || {}; // REF: Key codes.
595
596 aria.KeyCode = {
597 BACKSPACE: 8,
598 TAB: 9,
599 RETURN: 13,
600 ESC: 27,
601 SPACE: 32,
602 PAGE_UP: 33,
603 PAGE_DOWN: 34,
604 END: 35,
605 HOME: 36,
606 LEFT: 37,
607 UP: 38,
608 RIGHT: 39,
609 DOWN: 40,
610 DELETE: 46
611 };
612 aria.Utils = aria.Utils || {}; // UTILS: Remove function.
613
614 aria.Utils.remove = function (item) {
615 if (item.remove && 'function' === typeof item.remove) {
616 return item.remove();
617 }
618
619 if (item.parentNode && item.parentNode.removeChild && 'function' === typeof item.parentNode.removeChild) {
620 return item.parentNode.removeChild(item);
621 }
622
623 return false;
624 }; // UTILS: Verify if element can be focused.
625
626
627 aria.Utils.isFocusable = function (element) {
628 if (0 < element.tabIndex || 0 === element.tabIndex && null !== element.getAttribute('tabIndex')) {
629 return true;
630 }
631
632 if (element.disabled) {
633 return false;
634 }
635
636 switch (element.nodeName) {
637 case 'A':
638 return !!element.href && 'ignore' != element.rel;
639
640 case 'INPUT':
641 return 'hidden' != element.type && 'file' != element.type;
642
643 case 'BUTTON':
644 case 'SELECT':
645 case 'TEXTAREA':
646 return true;
647
648 default:
649 return false;
650 }
651 };
652 /**
653 * Simulate a click event.
654 * @public
655 * @param {Element} element the element to simulate a click on
656 */
657
658
659 aria.Utils.simulateClick = function (element) {
660 // Create our event (with options)
661 var evt = new MouseEvent('click', {
662 bubbles: true,
663 cancelable: true,
664 view: window
665 }); // If cancelled, don't dispatch our event
666
667 var canceled = !element.dispatchEvent(evt);
668 }; // When util functions move focus around, set this true so
669 // the focus listener can ignore the events.
670
671
672 aria.Utils.IgnoreUtilFocusChanges = false;
673 aria.Utils.dialogOpenClass = 'sui-has-modal';
674 /**
675 * @desc Set focus on descendant nodes until the first
676 * focusable element is found.
677 *
678 * @param element
679 * DOM node for which to find the first focusable descendant.
680 *
681 * @returns
682 * true if a focusable element is found and focus is set.
683 */
684
685 aria.Utils.focusFirstDescendant = function (element) {
686 for (var i = 0; i < element.childNodes.length; i++) {
687 var child = element.childNodes[i];
688
689 if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
690 return true;
691 }
692 }
693
694 return false;
695 }; // end focusFirstDescendant
696
697 /**
698 * @desc Find the last descendant node that is focusable.
699 *
700 * @param element
701 * DOM node for which to find the last focusable descendant.
702 *
703 * @returns
704 * true if a focusable element is found and focus is set.
705 */
706
707
708 aria.Utils.focusLastDescendant = function (element) {
709 for (var i = element.childNodes.length - 1; 0 <= i; i--) {
710 var child = element.childNodes[i];
711
712 if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
713 return true;
714 }
715 }
716
717 return false;
718 }; // end focusLastDescendant
719
720 /**
721 * @desc Set Attempt to set focus on the current node.
722 *
723 * @param element
724 * The node to attempt to focus on.
725 *
726 * @returns
727 * true if element is focused.
728 */
729
730
731 aria.Utils.attemptFocus = function (element) {
732 if (!aria.Utils.isFocusable(element)) {
733 return false;
734 }
735
736 aria.Utils.IgnoreUtilFocusChanges = true;
737
738 try {
739 element.focus();
740 } catch (e) {// Done.
741 }
742
743 aria.Utils.IgnoreUtilFocusChanges = false;
744 return document.activeElement === element;
745 }; // end attemptFocus
746 // Modals can open modals. Keep track of them with this array.
747
748
749 aria.OpenDialogList = aria.OpenDialogList || new Array(0);
750 /**
751 * @returns the last opened dialog (the current dialog)
752 */
753
754 aria.getCurrentDialog = function () {
755 if (aria.OpenDialogList && aria.OpenDialogList.length) {
756 return aria.OpenDialogList[aria.OpenDialogList.length - 1];
757 }
758 };
759
760 aria.closeCurrentDialog = function () {
761 var currentDialog = aria.getCurrentDialog();
762
763 if (currentDialog) {
764 currentDialog.close();
765 return true;
766 }
767
768 return false;
769 };
770
771 aria.handleEscape = function (event) {
772 var key = event.which || event.keyCode;
773
774 if (key === aria.KeyCode.ESC && aria.closeCurrentDialog()) {
775 event.stopPropagation();
776 }
777 };
778 /**
779 * @constructor
780 * @desc Dialog object providing modal focus management.
781 *
782 * Assumptions: The element serving as the dialog container is present in the
783 * DOM and hidden. The dialog container has role='dialog'.
784 *
785 * @param dialogId
786 * The ID of the element serving as the dialog container.
787 *
788 * @param focusAfterClosed
789 * Either the DOM node or the ID of the DOM node to focus when the
790 * dialog closes.
791 *
792 * @param focusFirst
793 * Optional parameter containing either the DOM node or the ID of the
794 * DOM node to focus when the dialog opens. If not specified, the
795 * first focusable element in the dialog will receive focus.
796 *
797 * @param hasOverlayMask
798 * Optional boolean parameter that when is set to "true" will enable
799 * a clickable overlay mask. This mask will fire close modal function
800 * when you click on it.
801 *
802 * @param isCloseOnEsc
803 * Default: true
804 * Optional boolean parameter that when it's set to "true", it will enable closing the
805 * dialog with the Esc key.
806 *
807 * @param isAnimated
808 * Default: true
809 * Optional boolean parameter that when it's set to "true", it will enable animation in dialog box.
810 */
811
812
813 aria.Dialog = function (dialogId, focusAfterClosed, focusFirst, hasOverlayMask) {
814 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
815 var isAnimated = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
816 this.dialogNode = document.getElementById(dialogId);
817
818 if (null === this.dialogNode) {
819 throw new Error('No element found with id="' + dialogId + '".');
820 }
821
822 var validRoles = ['dialog', 'alertdialog'];
823 var isDialog = (this.dialogNode.getAttribute('role') || '').trim().split(/\s+/g).some(function (token) {
824 return validRoles.some(function (role) {
825 return token === role;
826 });
827 });
828
829 if (!isDialog) {
830 throw new Error('Dialog() requires a DOM element with ARIA role of dialog or alertdialog.');
831 }
832
833 this.isCloseOnEsc = isCloseOnEsc; // Trigger the 'open' event at the beginning of the opening process.
834 // After validating the modal's attributes.
835
836 var openEvent = new Event('open');
837 this.dialogNode.dispatchEvent(openEvent); // Wrap in an individual backdrop element if one doesn't exist
838 // Native <dialog> elements use the ::backdrop pseudo-element, which
839 // works similarly.
840
841 var backdropClass = 'sui-modal';
842
843 if (this.dialogNode.parentNode.classList.contains(backdropClass)) {
844 this.backdropNode = this.dialogNode.parentNode;
845 } else {
846 this.backdropNode = document.createElement('div');
847 this.backdropNode.className = backdropClass;
848 this.backdropNode.setAttribute('data-markup', 'new');
849 this.dialogNode.parentNode.insertBefore(this.backdropNode, this.dialogNodev);
850 this.backdropNode.appendChild(this.dialogNode);
851 }
852
853 this.backdropNode.classList.add('sui-active'); // Disable scroll on the body element
854
855 document.body.parentNode.classList.add(aria.Utils.dialogOpenClass);
856
857 if ('string' === typeof focusAfterClosed) {
858 this.focusAfterClosed = document.getElementById(focusAfterClosed);
859 } else if ('object' === _typeof(focusAfterClosed)) {
860 this.focusAfterClosed = focusAfterClosed;
861 } else {
862 throw new Error('the focusAfterClosed parameter is required for the aria.Dialog constructor.');
863 }
864
865 if ('string' === typeof focusFirst) {
866 this.focusFirst = document.getElementById(focusFirst);
867 } else if ('object' === _typeof(focusFirst)) {
868 this.focusFirst = focusFirst;
869 } else {
870 this.focusFirst = null;
871 } // Bracket the dialog node with two invisible, focusable nodes.
872 // While this dialog is open, we use these to make sure that focus never
873 // leaves the document even if dialogNode is the first or last node.
874
875
876 var preDiv = document.createElement('div');
877 this.preNode = this.dialogNode.parentNode.insertBefore(preDiv, this.dialogNode);
878 this.preNode.tabIndex = 0;
879
880 if ('boolean' === typeof hasOverlayMask && true === hasOverlayMask) {
881 this.preNode.classList.add('sui-modal-overlay');
882
883 this.preNode.onclick = function () {
884 aria.getCurrentDialog().close();
885 };
886 }
887
888 var postDiv = document.createElement('div');
889 this.postNode = this.dialogNode.parentNode.insertBefore(postDiv, this.dialogNode.nextSibling);
890 this.postNode.tabIndex = 0; // If this modal is opening on top of one that is already open,
891 // get rid of the document focus listener of the open dialog.
892
893 if (0 < aria.OpenDialogList.length) {
894 aria.getCurrentDialog().removeListeners();
895 }
896
897 this.addListeners();
898 aria.OpenDialogList.push(this); // If isAnimated is set true then modal box will animate.
899
900 if (isAnimated) {
901 this.dialogNode.classList.add('sui-content-fade-in'); // make visible
902
903 this.dialogNode.classList.remove('sui-content-fade-out');
904 } else {
905 this.dialogNode.classList.remove('sui-content-fade-in');
906 this.dialogNode.classList.remove('sui-content-fade-out');
907 }
908
909 if (this.focusFirst) {
910 this.focusFirst.focus();
911 } else {
912 aria.Utils.focusFirstDescendant(this.dialogNode);
913 }
914
915 this.lastFocus = document.activeElement; // Trigger the 'afteropen' event at the end of the opening process.
916
917 var afterOpenEvent = new Event('afterOpen');
918 this.dialogNode.dispatchEvent(afterOpenEvent);
919 }; // end Dialog constructor.
920
921 /**
922 * @desc Hides the current top dialog, removes listeners of the top dialog,
923 * restore listeners of a parent dialog if one was open under the one that
924 * just closed, and sets focus on the element specified for focusAfterClosed.
925 *
926 * @param isAnimated
927 * Default: true
928 * Optional boolean parameter that when it's set to "true", it will enable animation in dialog box.
929 */
930
931
932 aria.Dialog.prototype.close = function () {
933 var isAnimated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
934 var self = this; // Trigger the 'close' event at the beginning of the closing process.
935
936 var closeEvent = new Event('close');
937 this.dialogNode.dispatchEvent(closeEvent);
938 aria.OpenDialogList.pop();
939 this.removeListeners();
940 this.preNode.parentNode.removeChild(this.preNode);
941 this.postNode.parentNode.removeChild(this.postNode); // If isAnimated is set true then modal box will animate.
942
943 if (isAnimated) {
944 this.dialogNode.classList.add('sui-content-fade-out');
945 this.dialogNode.classList.remove('sui-content-fade-in');
946 } else {
947 this.dialogNode.classList.remove('sui-content-fade-in');
948 this.dialogNode.classList.remove('sui-content-fade-out');
949 }
950
951 this.focusAfterClosed.focus();
952 setTimeout(function () {
953 self.backdropNode.classList.remove('sui-active');
954 }, 300);
955 setTimeout(function () {
956 var slides = self.dialogNode.querySelectorAll('.sui-modal-slide');
957
958 if (0 < slides.length) {
959 // Hide all slides.
960 for (var i = 0; i < slides.length; i++) {
961 slides[i].setAttribute('disabled', true);
962 slides[i].classList.remove('sui-loaded');
963 slides[i].classList.remove('sui-active');
964 slides[i].setAttribute('tabindex', '-1');
965 slides[i].setAttribute('aria-hidden', true);
966 } // Change modal size.
967
968
969 if (slides[0].hasAttribute('data-modal-size')) {
970 var newDialogSize = slides[0].getAttribute('data-modal-size');
971
972 switch (newDialogSize) {
973 case 'sm':
974 case 'small':
975 newDialogSize = 'sm';
976 break;
977
978 case 'md':
979 case 'med':
980 case 'medium':
981 newDialogSize = 'md';
982 break;
983
984 case 'lg':
985 case 'large':
986 newDialogSize = 'lg';
987 break;
988
989 case 'xl':
990 case 'extralarge':
991 case 'extraLarge':
992 case 'extra-large':
993 newDialogSize = 'xl';
994 break;
995
996 default:
997 newDialogSize = undefined;
998 }
999
1000 if (undefined !== newDialogSize) {
1001 // Remove others sizes from dialog to prevent any conflicts with styles.
1002 self.dialogNode.parentNode.classList.remove('sui-modal-sm');
1003 self.dialogNode.parentNode.classList.remove('sui-modal-md');
1004 self.dialogNode.parentNode.classList.remove('sui-modal-lg');
1005 self.dialogNode.parentNode.classList.remove('sui-modal-xl'); // Apply the new size to dialog.
1006
1007 self.dialogNode.parentNode.classList.add('sui-modal-' + newDialogSize);
1008 }
1009 } // Show first slide.
1010
1011
1012 slides[0].classList.add('sui-active');
1013 slides[0].classList.add('sui-loaded');
1014 slides[0].removeAttribute('disabled');
1015 slides[0].removeAttribute('tabindex');
1016 slides[0].removeAttribute('aria-hidden'); // Change modal label.
1017
1018 if (slides[0].hasAttribute('data-modal-labelledby')) {
1019 var newDialogLabel, getDialogLabel;
1020 newDialogLabel = '';
1021 getDialogLabel = slides[0].getAttribute('data-modal-labelledby');
1022
1023 if ('' !== getDialogLabel || undefined !== getDialogLabel) {
1024 newDialogLabel = getDialogLabel;
1025 }
1026
1027 self.dialogNode.setAttribute('aria-labelledby', newDialogLabel);
1028 } // Change modal description.
1029
1030
1031 if (slides[0].hasAttribute('data-modal-describedby')) {
1032 var newDialogDesc, getDialogDesc;
1033 newDialogDesc = '';
1034 getDialogDesc = slides[0].getAttribute('data-modal-describedby');
1035
1036 if ('' !== getDialogDesc || undefined !== getDialogDesc) {
1037 newDialogDesc = getDialogDesc;
1038 }
1039
1040 self.dialogNode.setAttribute('aria-describedby', newDialogDesc);
1041 }
1042 }
1043 }, 350); // If a dialog was open underneath this one, restore its listeners.
1044
1045 if (0 < aria.OpenDialogList.length) {
1046 aria.getCurrentDialog().addListeners();
1047 } else {
1048 document.body.parentNode.classList.remove(aria.Utils.dialogOpenClass);
1049 } // Trigger the 'afterclose' event at the end of the closing process.
1050
1051
1052 var afterCloseEvent = new Event('afterClose');
1053 this.dialogNode.dispatchEvent(afterCloseEvent);
1054 }; // end close.
1055
1056 /**
1057 * @desc Hides the current dialog and replaces it with another.
1058 *
1059 * @param newDialogId
1060 * ID of the dialog that will replace the currently open top dialog.
1061 *
1062 * @param newFocusAfterClosed
1063 * Optional ID or DOM node specifying where to place focus when the new dialog closes.
1064 * If not specified, focus will be placed on the element specified by the dialog being replaced.
1065 *
1066 * @param newFocusFirst
1067 * Optional ID or DOM node specifying where to place focus in the new dialog when it opens.
1068 * If not specified, the first focusable element will receive focus.
1069 *
1070 * @param hasOverlayMask
1071 * Optional boolean parameter that when is set to "true" will enable a clickable overlay
1072 * mask to the new opened dialog. This mask will fire close dialog function when you click it.
1073 *
1074 * @param isCloseOnEsc
1075 * Default: true
1076 * Optional boolean parameter that when it's set to "true", it will enable closing the
1077 * dialog with the Esc key.
1078 *
1079 * @param isAnimated
1080 * Default: true
1081 * Optional boolean parameter that when it's set to "true", it will enable animation in dialog box.
1082 */
1083
1084
1085 aria.Dialog.prototype.replace = function (newDialogId, newFocusAfterClosed, newFocusFirst, hasOverlayMask) {
1086 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1087 var isAnimated = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
1088 var self = this;
1089 aria.OpenDialogList.pop();
1090 this.removeListeners();
1091 aria.Utils.remove(this.preNode);
1092 aria.Utils.remove(this.postNode); // If isAnimated is set true then modal box will animate.
1093
1094 if (isAnimated) {
1095 this.dialogNode.classList.add('sui-content-fade-in'); // make visible
1096
1097 this.dialogNode.classList.remove('sui-content-fade-out');
1098 } else {
1099 this.dialogNode.classList.remove('sui-content-fade-in');
1100 this.dialogNode.classList.remove('sui-content-fade-out');
1101 }
1102
1103 this.backdropNode.classList.remove('sui-active');
1104 setTimeout(function () {
1105 var slides = self.dialogNode.querySelectorAll('.sui-modal-slide');
1106
1107 if (0 < slides.length) {
1108 // Hide all slides.
1109 for (var i = 0; i < slides.length; i++) {
1110 slides[i].setAttribute('disabled', true);
1111 slides[i].classList.remove('sui-loaded');
1112 slides[i].classList.remove('sui-active');
1113 slides[i].setAttribute('tabindex', '-1');
1114 slides[i].setAttribute('aria-hidden', true);
1115 } // Change modal size.
1116
1117
1118 if (slides[0].hasAttribute('data-modal-size')) {
1119 var newDialogSize = slides[0].getAttribute('data-modal-size');
1120
1121 switch (newDialogSize) {
1122 case 'sm':
1123 case 'small':
1124 newDialogSize = 'sm';
1125 break;
1126
1127 case 'md':
1128 case 'med':
1129 case 'medium':
1130 newDialogSize = 'md';
1131 break;
1132
1133 case 'lg':
1134 case 'large':
1135 newDialogSize = 'lg';
1136 break;
1137
1138 case 'xl':
1139 case 'extralarge':
1140 case 'extraLarge':
1141 case 'extra-large':
1142 newDialogSize = 'xl';
1143 break;
1144
1145 default:
1146 newDialogSize = undefined;
1147 }
1148
1149 if (undefined !== newDialogSize) {
1150 // Remove others sizes from dialog to prevent any conflicts with styles.
1151 self.dialogNode.parentNode.classList.remove('sui-modal-sm');
1152 self.dialogNode.parentNode.classList.remove('sui-modal-md');
1153 self.dialogNode.parentNode.classList.remove('sui-modal-lg');
1154 self.dialogNode.parentNode.classList.remove('sui-modal-xl'); // Apply the new size to dialog.
1155
1156 self.dialogNode.parentNode.classList.add('sui-modal-' + newDialogSize);
1157 }
1158 } // Show first slide.
1159
1160
1161 slides[0].classList.add('sui-active');
1162 slides[0].classList.add('sui-loaded');
1163 slides[0].removeAttribute('disabled');
1164 slides[0].removeAttribute('tabindex');
1165 slides[0].removeAttribute('aria-hidden'); // Change modal label.
1166
1167 if (slides[0].hasAttribute('data-modal-labelledby')) {
1168 var newDialogLabel, getDialogLabel;
1169 newDialogLabel = '';
1170 getDialogLabel = slides[0].getAttribute('data-modal-labelledby');
1171
1172 if ('' !== getDialogLabel || undefined !== getDialogLabel) {
1173 newDialogLabel = getDialogLabel;
1174 }
1175
1176 self.dialogNode.setAttribute('aria-labelledby', newDialogLabel);
1177 } // Change modal description.
1178
1179
1180 if (slides[0].hasAttribute('data-modal-describedby')) {
1181 var newDialogDesc, getDialogDesc;
1182 newDialogDesc = '';
1183 getDialogDesc = slides[0].getAttribute('data-modal-describedby');
1184
1185 if ('' !== getDialogDesc || undefined !== getDialogDesc) {
1186 newDialogDesc = getDialogDesc;
1187 }
1188
1189 self.dialogNode.setAttribute('aria-describedby', newDialogDesc);
1190 }
1191 }
1192 }, 350);
1193 var focusAfterClosed = newFocusAfterClosed || this.focusAfterClosed;
1194 var dialog = new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst, hasOverlayMask, isCloseOnEsc, isAnimated);
1195 }; // end replace
1196
1197 /**
1198 * @desc Uses the same dialog to display different content that will slide to show.
1199 *
1200 * @param newSlideId
1201 * ID of the slide that will replace the currently active slide content.
1202 *
1203 * @param newSlideFocus
1204 * Optional ID or DOM node specifying where to place focus in the new slide when it shows.
1205 * If not specified, the first focusable element will receive focus.
1206 *
1207 * @param newSlideEntrance
1208 * Determine if the new slide will show up from "left" or "right" of the screen.
1209 * If not specified, the slide entrance animation will be "fade in".
1210 */
1211
1212
1213 aria.Dialog.prototype.slide = function (newSlideId, newSlideFocus, newSlideEntrance) {
1214 var animation = 'sui-fadein',
1215 currentDialog = aria.getCurrentDialog(),
1216 getAllSlides = this.dialogNode.querySelectorAll('.sui-modal-slide'),
1217 getNewSlide = document.getElementById(newSlideId);
1218
1219 switch (newSlideEntrance) {
1220 case 'back':
1221 case 'left':
1222 animation = 'sui-fadein-left';
1223 break;
1224
1225 case 'next':
1226 case 'right':
1227 animation = 'sui-fadein-right';
1228 break;
1229
1230 default:
1231 animation = 'sui-fadein';
1232 break;
1233 } // Hide all slides.
1234
1235
1236 for (var i = 0; i < getAllSlides.length; i++) {
1237 getAllSlides[i].setAttribute('disabled', true);
1238 getAllSlides[i].classList.remove('sui-loaded');
1239 getAllSlides[i].classList.remove('sui-active');
1240 getAllSlides[i].setAttribute('tabindex', '-1');
1241 getAllSlides[i].setAttribute('aria-hidden', true);
1242 } // Change modal size.
1243
1244
1245 if (getNewSlide.hasAttribute('data-modal-size')) {
1246 var newDialogSize = getNewSlide.getAttribute('data-modal-size');
1247
1248 switch (newDialogSize) {
1249 case 'sm':
1250 case 'small':
1251 newDialogSize = 'sm';
1252 break;
1253
1254 case 'md':
1255 case 'med':
1256 case 'medium':
1257 newDialogSize = 'md';
1258 break;
1259
1260 case 'lg':
1261 case 'large':
1262 newDialogSize = 'lg';
1263 break;
1264
1265 case 'xl':
1266 case 'extralarge':
1267 case 'extraLarge':
1268 case 'extra-large':
1269 newDialogSize = 'xl';
1270 break;
1271
1272 default:
1273 newDialogSize = undefined;
1274 }
1275
1276 if (undefined !== newDialogSize) {
1277 // Remove others sizes from dialog to prevent any conflicts with styles.
1278 this.dialogNode.parentNode.classList.remove('sui-modal-sm');
1279 this.dialogNode.parentNode.classList.remove('sui-modal-md');
1280 this.dialogNode.parentNode.classList.remove('sui-modal-lg');
1281 this.dialogNode.parentNode.classList.remove('sui-modal-xl'); // Apply the new size to dialog.
1282
1283 this.dialogNode.parentNode.classList.add('sui-modal-' + newDialogSize);
1284 }
1285 } // Change modal label.
1286
1287
1288 if (getNewSlide.hasAttribute('data-modal-labelledby')) {
1289 var newDialogLabel, getDialogLabel;
1290 newDialogLabel = '';
1291 getDialogLabel = getNewSlide.getAttribute('data-modal-labelledby');
1292
1293 if ('' !== getDialogLabel || undefined !== getDialogLabel) {
1294 newDialogLabel = getDialogLabel;
1295 }
1296
1297 this.dialogNode.setAttribute('aria-labelledby', newDialogLabel);
1298 } // Change modal description.
1299
1300
1301 if (getNewSlide.hasAttribute('data-modal-describedby')) {
1302 var newDialogDesc, getDialogDesc;
1303 newDialogDesc = '';
1304 getDialogDesc = getNewSlide.getAttribute('data-modal-describedby');
1305
1306 if ('' !== getDialogDesc || undefined !== getDialogDesc) {
1307 newDialogDesc = getDialogDesc;
1308 }
1309
1310 this.dialogNode.setAttribute('aria-describedby', newDialogDesc);
1311 } // Show new slide.
1312
1313
1314 getNewSlide.classList.add('sui-active');
1315 getNewSlide.classList.add(animation);
1316 getNewSlide.removeAttribute('tabindex');
1317 getNewSlide.removeAttribute('aria-hidden');
1318 setTimeout(function () {
1319 getNewSlide.classList.add('sui-loaded');
1320 getNewSlide.classList.remove(animation);
1321 getNewSlide.removeAttribute('disabled');
1322 }, 600);
1323
1324 if ('string' === typeof newSlideFocus) {
1325 this.newSlideFocus = document.getElementById(newSlideFocus);
1326 } else if ('object' === _typeof(newSlideFocus)) {
1327 this.newSlideFocus = newSlideFocus;
1328 } else {
1329 this.newSlideFocus = null;
1330 }
1331
1332 if (this.newSlideFocus) {
1333 this.newSlideFocus.focus();
1334 } else {
1335 aria.Utils.focusFirstDescendant(this.dialogNode);
1336 }
1337 }; // end slide.
1338
1339
1340 aria.Dialog.prototype.addListeners = function () {
1341 document.addEventListener('focus', this.trapFocus, true);
1342
1343 if (this.isCloseOnEsc) {
1344 this.dialogNode.addEventListener('keyup', aria.handleEscape);
1345 }
1346 }; // end addListeners.
1347
1348
1349 aria.Dialog.prototype.removeListeners = function () {
1350 document.removeEventListener('focus', this.trapFocus, true);
1351 }; // end removeListeners.
1352
1353
1354 aria.Dialog.prototype.trapFocus = function (event) {
1355 if (aria.Utils.IgnoreUtilFocusChanges) {
1356 return;
1357 }
1358
1359 var currentDialog = aria.getCurrentDialog();
1360
1361 if (currentDialog.dialogNode.contains(event.target)) {
1362 currentDialog.lastFocus = event.target;
1363 } else {
1364 aria.Utils.focusFirstDescendant(currentDialog.dialogNode);
1365
1366 if (currentDialog.lastFocus == document.activeElement) {
1367 aria.Utils.focusLastDescendant(currentDialog.dialogNode);
1368 }
1369
1370 currentDialog.lastFocus = document.activeElement;
1371 }
1372 }; // end trapFocus.
1373
1374
1375 SUI.openModal = function (dialogId, focusAfterClosed, focusFirst, dialogOverlay) {
1376 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1377 var isAnimated = arguments.length > 5 ? arguments[5] : undefined;
1378 var dialog = new aria.Dialog(dialogId, focusAfterClosed, focusFirst, dialogOverlay, isCloseOnEsc, isAnimated);
1379 }; // end openModal.
1380
1381
1382 SUI.closeModal = function (isAnimated) {
1383 var topDialog = aria.getCurrentDialog();
1384 if (!topDialog) {
1385 return;
1386 }
1387 topDialog.close(isAnimated);
1388 }; // end closeDialog.
1389
1390
1391 SUI.replaceModal = function (newDialogId, newFocusAfterClosed, newFocusFirst, hasOverlayMask) {
1392 var isCloseOnEsc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1393 var isAnimated = arguments.length > 5 ? arguments[5] : undefined;
1394 var topDialog = aria.getCurrentDialog();
1395 /**
1396 * BUG #1:
1397 * When validating document.activeElement it always returns "false" but
1398 * even when "false" on Chrome function is fired correctly while on Firefox
1399 * and Safari this validation prevents function to be fired on click.
1400 *
1401 * if ( topDialog.dialogNode.contains( document.activeElement ) ) { ... }
1402 */
1403
1404 topDialog.replace(newDialogId, newFocusAfterClosed, newFocusFirst, hasOverlayMask, isCloseOnEsc, isAnimated);
1405 }; // end replaceModal.
1406
1407
1408 SUI.slideModal = function (newSlideId, newSlideFocus, newSlideEntrance) {
1409 var topDialog = aria.getCurrentDialog();
1410 topDialog.slide(newSlideId, newSlideFocus, newSlideEntrance);
1411 }; // end slideModal.
1412
1413 })();
1414
1415 (function ($) {
1416 // Enable strict mode.
1417 'use strict';
1418
1419 if ('object' !== _typeof(window.SUI)) {
1420 window.SUI = {};
1421 }
1422
1423 SUI.modalDialog = function () {
1424 function init() {
1425 var button, buttonOpen, buttonClose, buttonReplace, buttonSlide, overlayMask, modalId, slideId, closeFocus, newFocus, animation, isAnimated;
1426 buttonOpen = $('[data-modal-open]');
1427 buttonClose = $('[data-modal-close]');
1428 buttonReplace = $('[data-modal-replace]');
1429 buttonSlide = $('[data-modal-slide]');
1430 overlayMask = $('.sui-modal-overlay');
1431 buttonOpen.on('click', function (e) {
1432 button = $(this);
1433 modalId = button.attr('data-modal-open');
1434 closeFocus = button.attr('data-modal-close-focus');
1435 newFocus = button.attr('data-modal-open-focus');
1436 overlayMask = button.attr('data-modal-mask');
1437 isAnimated = button.attr('data-modal-animated');
1438 var isCloseOnEsc = 'false' === button.attr('data-esc-close') ? false : true;
1439
1440 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(closeFocus) || false === closeFocus || '' === closeFocus) {
1441 closeFocus = this;
1442 }
1443
1444 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(newFocus) || false === newFocus || '' === newFocus) {
1445 newFocus = undefined;
1446 }
1447
1448 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(overlayMask) && false !== overlayMask && 'true' === overlayMask) {
1449 overlayMask = true;
1450 } else {
1451 overlayMask = false;
1452 }
1453
1454 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(isAnimated) && false !== isAnimated && 'false' === isAnimated) {
1455 isAnimated = false;
1456 } else {
1457 isAnimated = true;
1458 }
1459
1460 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(modalId) && false !== modalId && '' !== modalId) {
1461 SUI.openModal(modalId, closeFocus, newFocus, overlayMask, isCloseOnEsc, isAnimated);
1462 }
1463
1464 e.preventDefault();
1465 });
1466 buttonReplace.on('click', function (e) {
1467 button = $(this);
1468 modalId = button.attr('data-modal-replace');
1469 closeFocus = button.attr('data-modal-close-focus');
1470 newFocus = button.attr('data-modal-open-focus');
1471 overlayMask = button.attr('data-modal-replace-mask');
1472 var isCloseOnEsc = 'false' === button.attr('data-esc-close') ? false : true;
1473
1474 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(closeFocus) || false === closeFocus || '' === closeFocus) {
1475 closeFocus = undefined;
1476 }
1477
1478 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(newFocus) || false === newFocus || '' === newFocus) {
1479 newFocus = undefined;
1480 }
1481
1482 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(overlayMask) && false !== overlayMask && 'true' === overlayMask) {
1483 overlayMask = true;
1484 } else {
1485 overlayMask = false;
1486 }
1487
1488 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(modalId) && false !== modalId && '' !== modalId) {
1489 SUI.replaceModal(modalId, closeFocus, newFocus, overlayMask, isCloseOnEsc, isAnimated);
1490 }
1491
1492 e.preventDefault();
1493 });
1494 buttonSlide.on('click', function (e) {
1495 button = $(this);
1496 slideId = button.attr('data-modal-slide');
1497 newFocus = button.attr('data-modal-slide-focus');
1498 animation = button.attr('data-modal-slide-intro');
1499
1500 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(newFocus) || false === newFocus || '' === newFocus) {
1501 newFocus = undefined;
1502 }
1503
1504 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === _typeof(animation) || false === animation || '' === animation) {
1505 animation = '';
1506 }
1507
1508 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(slideId) && false !== slideId && '' !== slideId) {
1509 SUI.slideModal(slideId, newFocus, animation);
1510 }
1511
1512 e.preventDefault();
1513 });
1514 buttonClose.on('click', function (e) {
1515 SUI.closeModal(isAnimated);
1516 e.preventDefault();
1517 });
1518 }
1519
1520 init();
1521 return this;
1522 };
1523
1524 SUI.modalDialog();
1525 })(jQuery);
1526 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
1527
1528 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1529
1530 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1531
1532 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1533
1534 (function ($) {
1535 // Enable strict mode.
1536 'use strict'; // Define global SUI object if it doesn't exists.
1537
1538 if ('object' !== _typeof(window.SUI)) {
1539 window.SUI = {};
1540 }
1541
1542 SUI.multistrings = function () {
1543 function buildWrapper(textarea, uniqid) {
1544 var parent = textarea.parent(),
1545 label = parent.find('> .sui-label'),
1546 description = parent.find('> .sui-description');
1547 /**
1548 * Build main wrapper for the whole multistring element.
1549 */
1550
1551 parent.wrap('<div class="sui-multistrings-wrap"></div>');
1552 /**
1553 * Build ARIA-ready element.
1554 */
1555 // Hide field.
1556
1557 parent.addClass('sui-multistrings-aria').removeClass('sui-form-field');
1558 /**
1559 * Build visual-ready element.
1560 */
1561 // Build a new field.
1562
1563 $('<div class="sui-form-field sui-multistrings" tabindex="-1" aria-hidden="true" />').insertAfter(parent);
1564 var newParent = parent.next('.sui-multistrings');
1565
1566 if (label.length) {
1567 newParent.append(label.clone());
1568
1569 if ('' !== newParent.find('.sui-label').attr('for')) {
1570 newParent.find('.sui-label').attr('for', newParent.find('.sui-label').attr('for') + '-input-multistrings');
1571 }
1572
1573 if ('' !== newParent.find('.sui-label').attr('id')) {
1574 newParent.find('.sui-label').attr('id', newParent.find('.sui-label').attr('id') + '-input-multistrings');
1575 }
1576 }
1577
1578 newParent.append('<ul class="sui-multistrings-list" />');
1579
1580 if (description.length) {
1581 newParent.append(description.clone());
1582 var $childDescription = newParent.find('.sui-description');
1583
1584 if ('' !== $childDescription.attr('id')) {
1585 var newId = $childDescription.attr('id') + '-input-multistrings';
1586 $childDescription.attr('id', newId);
1587 }
1588 }
1589 }
1590
1591 function bindFocus($mainWrapper) {
1592 var $listWrapper = $mainWrapper.find('.sui-multistrings');
1593 $listWrapper.on('click', function (e) {
1594 var $this = $(e.target);
1595
1596 if ('sui-multistrings-list' !== $this.attr('class')) {
1597 return;
1598 }
1599
1600 $listWrapper.find('.sui-multistrings-input input').trigger('focus');
1601 });
1602 var $input = $listWrapper.find('.sui-multistrings-input input'),
1603 $textarea = $mainWrapper.find('textarea'),
1604 $stringList = $mainWrapper.find('.sui-multistrings-list');
1605
1606 var addSuiFocus = function addSuiFocus($element) {
1607 $element.on('focus', function () {
1608 $stringList.addClass('sui-focus');
1609 $element.off('blur').on('blur', function () {
1610 $stringList.removeClass('sui-focus');
1611 });
1612 });
1613 };
1614
1615 addSuiFocus($input);
1616 addSuiFocus($textarea);
1617 }
1618
1619 function buildInput(textarea, uniqid) {
1620 var html = '',
1621 placeholder = '',
1622 ariaLabel = '',
1623 ariaDescription = '';
1624 var dataPlaceholder = textarea.attr('placeholder');
1625 var dataLabel = textarea.attr('data-field-label');
1626
1627 if ('undefined' !== typeof dataPlaceholder && '' !== dataPlaceholder) {
1628 placeholder = ' placeholder="' + dataPlaceholder + '"';
1629 }
1630
1631 if ('undefined' !== typeof dataLabel && '' !== dataLabel) {
1632 ariaLabel = ' aria-labelledby="' + uniqid + '-label"';
1633 textarea.attr('aria-labelledby', uniqid + '-label');
1634 } else {
1635 if (textarea.closest('.sui-form-field').find('.sui-label').length) {
1636 ariaLabel = ' aria-labelledby="' + uniqid + '-label"';
1637 }
1638
1639 textarea.attr('aria-labelledby', uniqid + '-label');
1640 }
1641
1642 if ('undefined' !== typeof dataLabel && '' !== dataLabel) {
1643 ariaDescription = ' aria-describedby="' + uniqid + '-description"';
1644 } else {
1645 if (textarea.closest('.sui-form-field').find('.sui-label').length) {
1646 ariaDescription = ' aria-ariaDescription="' + uniqid + '-description"';
1647 }
1648 }
1649
1650 html += '<li class="sui-multistrings-input">';
1651 html += '<input type="text" autocomplete="off"' + placeholder + ' id="' + uniqid + '"' + ariaLabel + ariaDescription + ' aria-autocomplete="none" />';
1652 html += '</li>';
1653 return html;
1654 }
1655
1656 function buildItem(itemName) {
1657 var html = '';
1658 html += '<li title="' + itemName + '">';
1659 html += '<i class="sui-icon-page sui-sm" aria-hidden="true"></i>';
1660 html += itemName;
1661 html += '<button class="sui-button-close">';
1662 html += '<i class="sui-icon-close" aria-hidden="true"></i>';
1663 html += '<span class="sui-screen-reader-text">Delete</span>';
1664 html += '</button>';
1665 html += '</li>';
1666 return html;
1667 }
1668
1669 function bindRemoveTag($mainWrapper) {
1670 var $removeButtons = $mainWrapper.find('.sui-multistrings-list .sui-button-close');
1671 $removeButtons.off('click').on('click', removeTag);
1672 }
1673
1674 function insertStringOnLoad(textarea, uniqid, disallowedCharsArray) {
1675 var html = '',
1676 $mainWrapper = textarea.closest('.sui-multistrings-wrap'),
1677 $entriesList = $mainWrapper.find('.sui-multistrings-list'),
1678 forbiddenRemoved = cleanTextarea(textarea.val(), disallowedCharsArray, true); // Split lines for inserting the tags and cleaning the new textarea value.
1679
1680 var splitStrings = forbiddenRemoved.split(/[\r\n]/gm),
1681 cleanStringsArray = []; // Insert the tags and add clean values to the cleanStringsArray.
1682
1683 for (var i = 0; i < splitStrings.length; i++) {
1684 var stringLine = splitStrings[i].trim();
1685
1686 if (0 === stringLine.length) {
1687 continue;
1688 }
1689
1690 html += buildItem(stringLine);
1691 cleanStringsArray.push(stringLine);
1692 } // Clean-up textarea value with the cleanStringsArray joined by newlines.
1693
1694
1695 var newTextareaValue = cleanStringsArray.join('\n');
1696 textarea.val(newTextareaValue); // Build input to insert strings.
1697
1698 html += buildInput(textarea, uniqid);
1699 $entriesList.append(html);
1700 bindRemoveTag($mainWrapper);
1701 }
1702
1703 function getDisallowedChars($mainWrapper) {
1704 var $textarea = $mainWrapper.find('textarea.sui-multistrings'),
1705 disallowedCharsArray = [];
1706 var customDisallowedKeys = $textarea.data('disallowedKeys');
1707
1708 if (customDisallowedKeys) {
1709 if ('number' === typeof customDisallowedKeys) {
1710 customDisallowedKeys = customDisallowedKeys.toString();
1711 } // Make an array from the user defined keys.
1712
1713
1714 var customKeysArray = customDisallowedKeys.split(',');
1715
1716 var _iterator = _createForOfIteratorHelper(customKeysArray),
1717 _step;
1718
1719 try {
1720 for (_iterator.s(); !(_step = _iterator.n()).done;) {
1721 var key = _step.value;
1722 // Convert to integer.
1723 var intKey = parseInt(key, 10); // And filter out any NaN.
1724
1725 if (!isNaN(intKey)) {
1726 // Convert ascii code to character.
1727 disallowedCharsArray.push(String.fromCharCode(intKey));
1728 }
1729 }
1730 } catch (err) {
1731 _iterator.e(err);
1732 } finally {
1733 _iterator.f();
1734 }
1735 }
1736
1737 return disallowedCharsArray;
1738 }
1739
1740 function getRegexPatternForDisallowedChars(disallowedCharsArray) {
1741 // Regex for removing the disallowed keys from the inserted strings.
1742 var escapeRegExp = function escapeRegExp(string) {
1743 return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1744 },
1745 disallowedPattern = escapeRegExp(disallowedCharsArray.join(''));
1746
1747 return disallowedPattern;
1748 }
1749
1750 function handleInsertTags($mainWrapper, disallowedCharsArray) {
1751 var $tagInput = $mainWrapper.find('.sui-multistrings-input input'),
1752 $textarea = $mainWrapper.find('textarea.sui-multistrings'),
1753 disallowedString = getRegexPatternForDisallowedChars(disallowedCharsArray),
1754 regex = new RegExp("[\r\n".concat(disallowedString, "]"), 'gm'); // Sanitize the values on keydown.
1755
1756 $tagInput.on('keydown', function (e) {
1757 // Do nothing if the key is from the disallowed ones.
1758 if (disallowedCharsArray.includes(e.key)) {
1759 e.preventDefault();
1760 return;
1761 }
1762
1763 var input = $(this),
1764 oldValue = $textarea.val(),
1765 newValue = input.val(); // Get rid of new lines, commas, and any chars passed by the admin from the newly entered value.
1766
1767 var newTrim = newValue.replace(regex, ''),
1768 isEnter = 13 === e.keyCode;
1769
1770 if (isEnter) {
1771 e.preventDefault();
1772 e.stopPropagation();
1773 } // If there's no value to add, don't insert any new value.
1774
1775
1776 if (0 !== newTrim.length && 0 !== newTrim.trim().length) {
1777 if (isEnter) {
1778 var newTextareaValue = oldValue.length ? "".concat(oldValue, "\n").concat(newTrim) : newTrim; // Print new value on textarea.
1779
1780 $textarea.val(newTextareaValue); // Print new value on the list.
1781
1782 var html = buildItem(newTrim);
1783 $(html).insertBefore($mainWrapper.find('.sui-multistrings-input')); // Clear input value.
1784
1785 input.val(''); // Bid the event to remove the tags.
1786
1787 bindRemoveTag($mainWrapper);
1788 } else {
1789 input.val(newTrim);
1790 }
1791 } else {
1792 input.val('');
1793 }
1794 });
1795 }
1796
1797 function handleTextareaChange($mainWrapper, disallowedCharsArray) {
1798 var textarea = $mainWrapper.find('textarea.sui-multistrings');
1799 var oldValue = textarea.val(),
1800 isTabTrapped = true; // Keep tab trapped when focusing on the textarea.
1801
1802 textarea.on('focus', function () {
1803 return isTabTrapped = true;
1804 });
1805 textarea.on('keydown', function (e) {
1806 // Do nothing if the key is from the disallowed ones.
1807 if (disallowedCharsArray.includes(e.key)) {
1808 e.preventDefault();
1809 return;
1810 } // If it's tab...
1811
1812
1813 if (9 === e.keyCode) {
1814 // Add a new line if it's trapped.
1815 if (isTabTrapped) {
1816 e.preventDefault();
1817 var start = this.selectionStart,
1818 end = this.selectionEnd; // Insert a new line where the caret is.
1819
1820 $(this).val($(this).val().substring(0, start) + '\n' + $(this).val().substring(end)); // Put caret at right position again.
1821
1822 this.selectionStart = start + 1;
1823 this.selectionEnd = this.selectionStart;
1824 } // Release the tab.
1825
1826 } else if (27 === e.keyCode) {
1827 isTabTrapped = false;
1828 }
1829 }).on('keyup change', function (e) {
1830 var currentValue = textarea.val(); // Nothing has changed, do nothing.
1831
1832 if (currentValue === oldValue) {
1833 return;
1834 } // Clear up the content.
1835
1836
1837 var cleanedCurrentValue = cleanTextarea(currentValue, disallowedCharsArray); // Set the current value as the old one for future iterations.
1838
1839 textarea.val(cleanedCurrentValue);
1840 oldValue = cleanedCurrentValue;
1841 var textboxValuesArray = cleanedCurrentValue.split(/[\r\n]+/gm),
1842 tags = $mainWrapper.find('.sui-multistrings-list li:not(.sui-multistrings-input)'),
1843 tagsTitles = [];
1844
1845 var _iterator2 = _createForOfIteratorHelper(tags),
1846 _step2;
1847
1848 try {
1849 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1850 var tag = _step2.value;
1851 tagsTitles.push($(tag).attr('title'));
1852 }
1853 } catch (err) {
1854 _iterator2.e(err);
1855 } finally {
1856 _iterator2.f();
1857 }
1858
1859 var areEqual = compareArrays(textboxValuesArray, tagsTitles); // The existing elements changed, update the existing tags.
1860
1861 if (!areEqual) {
1862 $mainWrapper.find('.sui-multistrings-list li:not(.sui-multistrings-input)').remove();
1863
1864 var _iterator3 = _createForOfIteratorHelper(textboxValuesArray),
1865 _step3;
1866
1867 try {
1868 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1869 var value = _step3.value;
1870 value = value.trim();
1871
1872 if (value.length) {
1873 // Print new value on the list.
1874 var html = buildItem(value);
1875 $(html).insertBefore($mainWrapper.find('.sui-multistrings-input'));
1876 }
1877 } // Bind the event to remove the tags.
1878
1879 } catch (err) {
1880 _iterator3.e(err);
1881 } finally {
1882 _iterator3.f();
1883 }
1884
1885 bindRemoveTag($mainWrapper);
1886 }
1887 });
1888 }
1889
1890 function compareArrays(firstArray, secondArray) {
1891 if (!Array.isArray(firstArray) || !Array.isArray(secondArray)) {
1892 return false;
1893 }
1894
1895 if (firstArray.length !== secondArray.length) {
1896 return false;
1897 }
1898
1899 return firstArray.every(function (value, index) {
1900 return value === secondArray[index];
1901 });
1902 }
1903
1904 function cleanTextarea(string, disallowedCharsArray) {
1905 var isLoad = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1906 var disallowedString = getRegexPatternForDisallowedChars(disallowedCharsArray),
1907 regex = new RegExp("[".concat(disallowedString, "]+|((\\r\\n|\\n|\\r)$)|^\\s*$"), 'gm');
1908 var clearedString = string.replace(regex, '');
1909
1910 if (!isLoad) {
1911 // Avoid removing the last newline if it existed.
1912 var endsInNewline = string.match(/\n$/);
1913
1914 if (endsInNewline) {
1915 clearedString += '\n';
1916 }
1917 }
1918
1919 return clearedString;
1920 }
1921
1922 function removeTag(e) {
1923 var $removeButton = $(e.currentTarget),
1924 $tag = $removeButton.closest('li');
1925 var $hiddenTextarea = $removeButton.closest('.sui-multistrings-wrap').find('textarea.sui-multistrings'),
1926 textareaValue = $hiddenTextarea.val(),
1927 removedTag = $tag.attr('title'),
1928 escapedRemovedTag = removedTag.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'),
1929 regex = new RegExp("^".concat(escapedRemovedTag, "\\s|^").concat(escapedRemovedTag, "$"), 'm'),
1930 newTextareaValue = textareaValue.replace(regex, ''); // Remove the string from the hidden textarea.
1931
1932 $hiddenTextarea.val(newTextareaValue);
1933 $hiddenTextarea.trigger('change'); // Remove the tag the close button belongs to.
1934
1935 $tag.remove();
1936 }
1937
1938 function init() {
1939 var multistrings = $('.sui-multistrings');
1940
1941 if (0 !== multistrings.length) {
1942 multistrings.each(function () {
1943 multistrings = $(this);
1944 var uniqueId = '';
1945 var hasUniqueId = 'undefined' !== typeof multistrings.attr('id') && '' !== multistrings.attr('id');
1946 var isTextarea = multistrings.is('textarea');
1947 var isWrapped = multistrings.parent().hasClass('sui-form-field');
1948
1949 if (!hasUniqueId) {
1950 throw new Error('Multistrings field require an ID attribute.');
1951 } else {
1952 uniqueId = multistrings.attr('id') + '-strings';
1953 }
1954
1955 if (!isTextarea) {
1956 throw new Error('Multistrings field with id="' + multistrings.attr('id') + '" needs to be "textarea".');
1957 }
1958
1959 if (!isWrapped) {
1960 throw new Error('Multistrings field needs to be wrapped inside "sui-form-field" div.');
1961 }
1962
1963 buildWrapper(multistrings, uniqueId);
1964 var $mainWrapper = multistrings.closest('.sui-multistrings-wrap'),
1965 disallowedCharsArray = getDisallowedChars($mainWrapper);
1966 insertStringOnLoad(multistrings, uniqueId, disallowedCharsArray);
1967 handleInsertTags($mainWrapper, disallowedCharsArray);
1968 handleTextareaChange($mainWrapper, disallowedCharsArray);
1969 bindFocus($mainWrapper);
1970 });
1971 }
1972 }
1973
1974 init();
1975 return this;
1976 };
1977
1978 SUI.multistrings();
1979 })(jQuery);
1980 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1981
1982 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1983
1984 (function ($) {
1985 // Enable strict mode.
1986 'use strict'; // Define global SUI object if it does not exist.
1987
1988 var _this = this;
1989
1990 if ('object' !== _typeof(window.SUI)) {
1991 window.SUI = {};
1992 }
1993 /**
1994 * @desc Notifications function to show when alert.
1995 *
1996 * Assumptions: The element serving as the alert container is present in the
1997 * DOM and hidden. The alert container has role='alert'.
1998 *
1999 * @param noticeId
2000 * The ID of the element serving as the alert container.
2001 *
2002 * @param noticeMessage
2003 * The content to be printed when the alert shows up. It accepts HTML.
2004 *
2005 * @param noticeOptions
2006 * An object with different paramethers to modify the alert appearance.
2007 */
2008
2009
2010 SUI.openNotice = function (noticeId, noticeMessage, noticeOptions) {
2011 // Get notification node by ID.
2012 var noticeNode = $('#' + noticeId);
2013 var nodeWrapper = noticeNode.parent(); // Check if element ID exists.
2014
2015 if (null === typeof noticeNode || 'undefined' === typeof noticeNode) {
2016 throw new Error('No element found with id="' + noticeId + '".');
2017 } // Check if element has correct attribute.
2018
2019
2020 if ('alert' !== noticeNode.attr('role')) {
2021 throw new Error('Notice requires a DOM element with ARIA role of alert.');
2022 } // Check if notice message is empty.
2023
2024
2025 if (null === typeof noticeMessage || 'undefined' === typeof noticeMessage || '' === noticeMessage) {
2026 throw new Error('Notice requires a message to print.');
2027 }
2028
2029 var utils = utils || {};
2030 /**
2031 * @desc Allowed types for notification.
2032 */
2033
2034 utils.allowedNotices = ['info', 'blue', 'green', 'success', 'yellow', 'warning', 'red', 'error', 'purple', 'upsell'];
2035 /**
2036 * @desc Verify if property is an array.
2037 */
2038
2039 utils.isObject = function (obj) {
2040 if ((null !== obj || 'undefined' !== obj) && $.isPlainObject(obj)) {
2041 return true;
2042 }
2043
2044 return false;
2045 };
2046 /**
2047 * @desc Deep merge two objects.
2048 * Watch out for infinite recursion on circular references.
2049 */
2050
2051
2052 utils.deepMerge = function (target) {
2053 for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2054 sources[_key - 1] = arguments[_key];
2055 }
2056
2057 if (!sources.length) {
2058 return target;
2059 }
2060
2061 var source = sources.shift();
2062
2063 if (utils.isObject(target) && utils.isObject(source)) {
2064 for (var key in source) {
2065 if (utils.isObject(source[key])) {
2066 if (!target[key]) {
2067 Object.assign(target, _defineProperty({}, key, {}));
2068 }
2069
2070 utils.deepMerge(target[key], source[key]);
2071 } else {
2072 Object.assign(target, _defineProperty({}, key, source[key]));
2073 }
2074 }
2075 }
2076
2077 return utils.deepMerge.apply(utils, [target].concat(sources));
2078 };
2079 /**
2080 * @desc Declare default styling options for notifications.
2081 */
2082
2083
2084 utils.setProperties = function () {
2085 var incomingOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2086 utils.options = [];
2087 var defaults = {
2088 type: 'default',
2089 icon: 'info',
2090 dismiss: {
2091 show: false,
2092 label: 'Close this notice',
2093 tooltip: ''
2094 },
2095 autoclose: {
2096 show: true,
2097 timeout: 3000
2098 }
2099 };
2100 utils.options[0] = utils.deepMerge(defaults, incomingOptions);
2101 };
2102
2103 utils.setProperties(noticeOptions);
2104 /**
2105 * @desc Build notice dismiss.
2106 */
2107
2108 utils.buildDismiss = function () {
2109 var html = '';
2110 var dismiss = utils.options[0].dismiss;
2111
2112 if (true === dismiss.show) {
2113 html = document.createElement('div');
2114 html.className = 'sui-notice-actions';
2115 var innerHTML = '';
2116
2117 if ('' !== dismiss.tooltip) {
2118 if (nodeWrapper.hasClass('sui-floating-notices')) {
2119 innerHTML += '<div class="sui-tooltip sui-tooltip-bottom" data-tooltip="' + dismiss.tooltip + '">';
2120 } else {
2121 innerHTML += '<div class="sui-tooltip" data-tooltip="' + dismiss.tooltip + '">';
2122 }
2123 }
2124
2125 innerHTML += '<button class="sui-button-icon">';
2126 innerHTML += '<i class="sui-icon-check" aria-hidden="true"></i>';
2127
2128 if ('' !== dismiss.label) {
2129 innerHTML += '<span class="sui-screen-reader-text">' + dismiss.label + '</span>';
2130 }
2131
2132 innerHTML += '</button>';
2133
2134 if ('' !== dismiss.tooltip) {
2135 innerHTML += '</div>';
2136 }
2137
2138 html.innerHTML = innerHTML;
2139 }
2140
2141 return html;
2142 };
2143 /**
2144 * @desc Build notice icon.
2145 */
2146
2147
2148 utils.buildIcon = function () {
2149 var html = '';
2150 var icon = utils.options[0].icon;
2151
2152 if ('' !== icon || 'undefined' !== typeof icon || null !== typeof icon) {
2153 html = document.createElement('span');
2154 html.className += 'sui-notice-icon sui-icon-' + icon + ' sui-md';
2155 html.setAttribute('aria-hidden', true);
2156
2157 if ('loader' === icon) {
2158 html.classList.add('sui-loading');
2159 }
2160 }
2161
2162 return html;
2163 };
2164 /**
2165 * @desc Build notice message.
2166 */
2167
2168
2169 utils.buildMessage = function () {
2170 var html = document.createElement('div');
2171 html.className = 'sui-notice-message';
2172 html.innerHTML = noticeMessage;
2173 html.prepend(utils.buildIcon());
2174 return html;
2175 };
2176 /**
2177 * @desc Build notice markup.
2178 */
2179
2180
2181 utils.buildNotice = function () {
2182 var html = document.createElement('div');
2183 html.className = 'sui-notice-content';
2184 html.append(utils.buildMessage(), utils.buildDismiss());
2185 return html;
2186 };
2187 /**
2188 * @desc Show notification message.
2189 */
2190
2191
2192 utils.showNotice = function (animation) {
2193 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2194 var type = utils.options[0].type;
2195 var dismiss = utils.options[0].dismiss;
2196 var autoclose = utils.options[0].autoclose; // Add active class.
2197
2198 noticeNode.addClass('sui-active'); // Check for allowed notification types.
2199
2200 $.each(utils.allowedNotices, function (key, value) {
2201 if (value === type) {
2202 noticeNode.addClass('sui-notice-' + value);
2203 }
2204 }); // Remove tabindex.
2205
2206 noticeNode.removeAttr('tabindex'); // Print notification message.
2207
2208 noticeNode.html(utils.buildNotice()); // Show animation.
2209
2210 if ('slide' === animation) {
2211 noticeNode.slideDown(timeout, function () {
2212 // Check if dismiss button enabled.
2213 if (true === dismiss.show) {
2214 // Focus dismiss button.
2215 noticeNode.find('.sui-notice-actions button').trigger('focus'); // Dismiss button.
2216
2217 noticeNode.find('.sui-notice-actions button').on('click', function () {
2218 SUI.closeNotice(noticeId);
2219 });
2220 } else {
2221 // Check if notice auto-closes.
2222 if (true === autoclose.show) {
2223 setTimeout(function () {
2224 return SUI.closeNotice(noticeId);
2225 }, parseInt(autoclose.timeout));
2226 }
2227 }
2228 });
2229 } else if ('fade' === animation) {
2230 noticeNode.fadeIn(timeout, function () {
2231 // Check if dismiss button enabled.
2232 if (true === dismiss.show) {
2233 // Focus dismiss button.
2234 noticeNode.find('.sui-notice-actions button').trigger('focus'); // Dismiss button.
2235
2236 noticeNode.find('.sui-notice-actions button').on('click', function () {
2237 SUI.closeNotice(noticeId);
2238 });
2239 } else {
2240 // Check if notice auto-closes.
2241 if (true === autoclose.show) {
2242 setTimeout(function () {
2243 return SUI.closeNotice(noticeId);
2244 }, parseInt(autoclose.timeout));
2245 }
2246 }
2247 });
2248 } else {
2249 noticeNode.show(timeout, function () {
2250 // Check if dismiss button enabled.
2251 if (true === dismiss.show) {
2252 // Focus dismiss button.
2253 noticeNode.find('.sui-notice-actions button').trigger('focus'); // Dismiss button.
2254
2255 noticeNode.find('.sui-notice-actions button').on('click', function () {
2256 SUI.closeNotice(noticeId);
2257 });
2258 } else {
2259 // Check if notice auto-closes.
2260 if (true === autoclose.show) {
2261 setTimeout(function () {
2262 return SUI.closeNotice(noticeId);
2263 }, parseInt(autoclose.timeout));
2264 }
2265 }
2266 });
2267 }
2268 };
2269 /**
2270 * @desc Open notification message.
2271 */
2272
2273
2274 utils.openNotice = function (animation) {
2275 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2276
2277 if (noticeNode.hasClass('sui-active')) {
2278 if ('slide' === animation) {
2279 noticeNode.slideUp(timeout, function () {
2280 utils.showNotice('slide', timeout);
2281 });
2282 } else if ('fade' === animation) {
2283 noticeNode.fadeOut(timeout, function () {
2284 utils.showNotice('fade', timeout);
2285 });
2286 } else {
2287 noticeNode.hide(timeout, function () {
2288 utils.showNotice(null, timeout);
2289 });
2290 }
2291 } else {
2292 // Show notice.
2293 utils.showNotice(animation, timeout);
2294 }
2295 };
2296 /**
2297 * @desc Initialize function.
2298 */
2299
2300
2301 var init = function init() {
2302 /**
2303 * When notice should float, it needs to be wrapped inside:
2304 * <div class="sui-floating-notices"></div>
2305 *
2306 * IMPORTANT: This wrapper goes before "sui-wrap" closing tag
2307 * and after modals markup.
2308 */
2309 if (nodeWrapper.hasClass('sui-floating-notices')) {
2310 utils.openNotice('slide');
2311 } else {
2312 utils.openNotice('fade');
2313 }
2314 };
2315
2316 init();
2317 return _this;
2318 };
2319 /**
2320 * @desc Close and clear the alert.
2321 *
2322 * Assumptions: The element that will trigger this function is part of alert content.
2323 *
2324 * @param noticeId
2325 * The ID of the element serving as the alert container.
2326 *
2327 */
2328
2329
2330 SUI.closeNotice = function (noticeId) {
2331 // Get notification node by ID.
2332 var noticeNode = $('#' + noticeId);
2333 var nodeWrapper = noticeNode.parent(); // Check if element ID exists.
2334
2335 if (null === typeof noticeNode || 'undefined' === typeof noticeNode) {
2336 throw new Error('No element found with id="' + noticeId + '".');
2337 }
2338
2339 var utils = utils || {};
2340 /**
2341 * @desc Allowed types for notification.
2342 */
2343
2344 utils.allowedNotices = ['info', 'blue', 'green', 'success', 'yellow', 'warning', 'red', 'error', 'purple', 'upsell'];
2345 /**
2346 * @desc Destroy notification.
2347 */
2348
2349 utils.hideNotice = function () {
2350 // Remove active class.
2351 noticeNode.removeClass('sui-active'); // Remove styling classes.
2352
2353 $.each(utils.allowedNotices, function (key, value) {
2354 noticeNode.removeClass('sui-notice-' + value);
2355 }); // Prevent TAB key from accessing the element.
2356
2357 noticeNode.attr('tabindex', '-1'); // Remove all content from notification.
2358
2359 noticeNode.empty();
2360 };
2361 /**
2362 * @desc Close notification message.
2363 */
2364
2365
2366 utils.closeNotice = function (animation) {
2367 var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
2368
2369 // Close animation.
2370 if ('slide' === animation) {
2371 noticeNode.slideUp(timeout, function () {
2372 return utils.hideNotice();
2373 });
2374 } else if ('fade' === animation) {
2375 noticeNode.fadeOut(timeout, function () {
2376 return utils.hideNotice();
2377 });
2378 } else {
2379 noticeNode.hide(timeout, function () {
2380 return utils.hideNotice();
2381 });
2382 }
2383 };
2384 /**
2385 * @desc Initialize function.
2386 */
2387
2388
2389 var init = function init() {
2390 /**
2391 * When notice should float, it needs to be wrapped inside:
2392 * <div class="sui-floating-notices"></div>
2393 *
2394 * IMPORTANT: This wrapper goes before "sui-wrap" closing tag
2395 * and after modals markup.
2396 */
2397 if (nodeWrapper.hasClass('sui-floating-notices')) {
2398 utils.closeNotice('slide');
2399 } else {
2400 utils.closeNotice('fade');
2401 }
2402 };
2403
2404 init();
2405 return _this;
2406 };
2407 /**
2408 * @desc Trigger open and close alert notification functions through element attributes.
2409 *
2410 * Assumptions: Elements in charge of triggering the actions will be a button or a non-hyperlink element.
2411 *
2412 */
2413
2414
2415 SUI.notice = function () {
2416 var notice = notice || {};
2417 notice.Utils = notice.Utils || {};
2418 /**
2419 * @desc Click an element to open a notification.
2420 */
2421
2422 notice.Utils.Open = function (element) {
2423 element.on('click', function () {
2424 self = $(this); // Define main variables for open function.
2425
2426 var noticeId = self.attr('data-notice-open');
2427 var noticeMessage = '';
2428 var noticeOptions = {}; // Define index to use on for loops.
2429
2430 var i; // Define maximum number of paragraphs.
2431
2432 var numbLines = 4; // Check if `data-notice-message` exists.
2433
2434 if (self.is('[data-notice-message]') && '' !== self.attr('data-notice-message')) {
2435 noticeMessage += self.attr('data-notice-message'); // If `data-notice-message` doesn't exists, look for `data-notice-paragraph-[i]` attributes.
2436 } else {
2437 for (i = 0; i < numbLines; i++) {
2438 var index = i + 1;
2439 var paragraph = 'data-notice-paragraph-' + index;
2440
2441 if (self.is('[' + paragraph + ']') && '' !== self.attr(paragraph)) {
2442 noticeMessage += '<p>' + self.attr(paragraph) + '</p>';
2443 }
2444 }
2445 } // Check if `data-notice-type` exists.
2446
2447
2448 if (self.is('[data-notice-type]') && '' !== self.attr('data-notice-dismiss-type')) {
2449 noticeOptions.type = self.attr('data-notice-type');
2450 } // Check if `data-notice-icon` exists.
2451
2452
2453 if (self.is('[data-notice-icon]')) {
2454 noticeOptions.icon = self.attr('data-notice-icon');
2455 } // Check if `data-notice-dismiss` exists.
2456
2457
2458 if (self.is('[data-notice-dismiss]')) {
2459 noticeOptions.dismiss = {};
2460
2461 if ('true' === self.attr('data-notice-dismiss')) {
2462 noticeOptions.dismiss.show = true;
2463 } else if ('false' === self.attr('data-notice-dismiss')) {
2464 noticeOptions.dismiss.show = false;
2465 }
2466 } // Check if `data-notice-dismiss-label` exists.
2467
2468
2469 if (self.is('[data-notice-dismiss-label]') && '' !== self.attr('data-notice-dismiss-label')) {
2470 noticeOptions.dismiss.label = self.attr('data-notice-dismiss-label');
2471 } // Check if `data-notice-dismiss-label` exists.
2472
2473
2474 if (self.is('[data-notice-dismiss-tooltip]') && '' !== self.attr('data-notice-dismiss-tooltip')) {
2475 noticeOptions.dismiss.tooltip = self.attr('data-notice-dismiss-tooltip');
2476 } // Check if `data-notice-autoclose` exists.
2477
2478
2479 if (self.is('[data-notice-autoclose]')) {
2480 noticeOptions.autoclose = {};
2481
2482 if ('true' === self.attr('data-notice-autoclose')) {
2483 noticeOptions.autoclose.show = true;
2484 } else if ('false' === self.attr('data-notice-autoclose')) {
2485 noticeOptions.autoclose.show = false;
2486 }
2487 } // Check if `data-notice-autoclose-timeout` exists.
2488
2489
2490 if (self.is('[data-notice-autoclose-timeout]')) {
2491 noticeOptions.autoclose = noticeOptions.autoclose || {};
2492 noticeOptions.autoclose.timeout = parseInt(self.attr('data-notice-autoclose-timeout'));
2493 }
2494
2495 SUI.openNotice(noticeId, noticeMessage, noticeOptions);
2496 });
2497 };
2498 /**
2499 * @desc Close a notification.
2500 */
2501
2502
2503 notice.Utils.Close = function (element) {
2504 element.on('click', function () {
2505 self = $(this);
2506 var noticeId;
2507
2508 if (self.is('[data-notice-close]')) {
2509 noticeId = self.closest('.sui-notice').attr('id');
2510
2511 if ('' !== self.attr('[data-notice-close]')) {
2512 noticeId = self.attr('data-notice-close');
2513 }
2514
2515 SUI.closeNotice(noticeId);
2516 }
2517 });
2518 };
2519
2520 var init = function init() {
2521 // Open a notification.
2522 var btnOpen = $('[data-notice-open]');
2523 notice.Utils.Open(btnOpen); // Close a notification.
2524
2525 var btnClose = $('[data-notice-close]');
2526 notice.Utils.Close(btnClose);
2527 };
2528
2529 init();
2530 return _this;
2531 };
2532
2533 SUI.notice();
2534 })(jQuery);
2535 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2536
2537 (function ($) {
2538 // Enable strict mode.
2539 'use strict'; // Define global SUI object if it doesn't exist.
2540
2541 if ('object' !== _typeof(window.SUI)) {
2542 window.SUI = {};
2543 }
2544
2545 SUI.showHidePassword = function () {
2546 $('.sui-2-12-24 .sui-form-field').each(function () {
2547 var $this = $(this);
2548
2549 if (0 !== $this.find('input[type="password"]').length) {
2550 $this.find('[class*="sui-button"], .sui-password-toggle').off('click.toggle-password').on('click.toggle-password', function () {
2551 var $button = $(this),
2552 $input = $button.parent().find('input'),
2553 $icon = $button.find('> span');
2554 $button.parent().toggleClass('sui-password-visible');
2555 $button.find('.sui-password-text').toggleClass('sui-hidden');
2556
2557 if ($button.parent().hasClass('sui-password-visible')) {
2558 $input.prop('type', 'text');
2559 $icon.removeClass('sui-icon-eye').addClass('sui-icon-eye-hide');
2560 } else {
2561 $input.prop('type', 'password');
2562 $icon.removeClass('sui-icon-eye-hide').addClass('sui-icon-eye');
2563 }
2564 });
2565 }
2566 });
2567 };
2568
2569 SUI.showHidePassword();
2570 })(jQuery);
2571 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2572
2573 (function ($) {
2574 // Enable strict mode.
2575 'use strict'; // Define global SUI object if it doesn't exist.
2576
2577 if ('object' !== _typeof(window.SUI)) {
2578 window.SUI = {};
2579 }
2580
2581 SUI.reviews = function (review, reviews, rating) {
2582 if (reviews <= 0) {
2583 return;
2584 }
2585
2586 function init() {
2587 var stars = Math.round(rating),
2588 starsBlock = review.find('.sui-reviews__stars')[0],
2589 i;
2590
2591 for (i = 0; i < stars; i++) {
2592 starsBlock.innerHTML += '<span class="sui-icon-star" aria-hidden="true"></span> ';
2593 }
2594
2595 review.find('.sui-reviews-rating').replaceWith(rating);
2596 review.find('.sui-reviews-customer-count').replaceWith(reviews);
2597 }
2598
2599 init();
2600 return this;
2601 }; // Update the reviews with the live stats.
2602
2603
2604 $('.sui-2-12-24 .sui-reviews').each(function () {
2605 var review = $(this);
2606 $.ajax({
2607 url: "https://api.reviews.co.uk/merchant/reviews?store=wpmudev-org",
2608 success: function success(data) {
2609 SUI.reviews(review, data.stats.reviews, data.stats.average_rating);
2610 }
2611 });
2612 });
2613 })(jQuery);
2614 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2615
2616 (function ($) {
2617 // Enable strict mode.
2618 'use strict'; // Define global SUI object if it doesn't exist.
2619
2620 if ('object' !== _typeof(window.SUI)) {
2621 window.SUI = {};
2622 }
2623
2624 SUI.loadCircleScore = function (el) {
2625 var dial = $(el).find('svg circle:last-child'),
2626 score = $(el).data('score'),
2627 radius = 42,
2628 circumference = 2 * Math.PI * radius,
2629 dashLength = circumference / 100 * score,
2630 gapLength = dashLength * 100 - score,
2631 svg = '<svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n' + '<circle stroke-width="16" cx="50" cy="50" r="42" />\n' + '<circle stroke-width="16" cx="50" cy="50" r="42" stroke-dasharray="0,' + gapLength + '" />\n' + '</svg>\n' + '<span class="sui-circle-score-label">' + score + '</span>\n'; // Add svg to score element, add loaded class, & change stroke-dasharray to represent target score/percentage.
2632
2633 $(el).prepend(svg).addClass('loaded').find('circle:last-child').css('animation', 'sui' + score + ' 3s forwards');
2634 };
2635
2636 $('.sui-2-12-24 .sui-circle-score').each(function () {
2637 SUI.loadCircleScore(this);
2638 });
2639 })(jQuery);
2640 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2641
2642 /*!
2643 * Select2 4.1.0-rc.0
2644 * https://select2.github.io
2645 *
2646 * Released under the MIT license
2647 * https://github.com/select2/select2/blob/master/LICENSE.md
2648 *
2649 * Modified logic/function,etc besides formatting should be marked with //SUI-SELECT2
2650 * For easy debugging process or update upstream of select
2651 */
2652 ;
2653
2654 (function (factory) {
2655 // Disable AMD and module exports. @edited
2656 if (false && typeof define === 'function' && define.amd) {
2657 // AMD. Register as an anonymous module.
2658 define(['jquery'], factory);
2659 } else if (false && (typeof module === "undefined" ? "undefined" : _typeof(module)) === 'object' && module.exports) {
2660 // Node/CommonJS
2661 module.exports = function (root, jQuery) {
2662 if (jQuery === undefined) {
2663 // require('jQuery') returns a factory that requires window to
2664 // build a jQuery instance, we normalize how we use modules
2665 // that require this pattern but the window provided is a noop
2666 // if it's defined (how jquery works)
2667 if (typeof window !== 'undefined') {
2668 jQuery = require('jquery');
2669 } else {
2670 jQuery = require('jquery')(root);
2671 }
2672 }
2673
2674 factory(jQuery);
2675 return jQuery;
2676 };
2677 } else {
2678 // Browser globals
2679 factory(jQuery);
2680 }
2681 })(function (jQuery) {
2682 // This is needed so we can catch the AMD loader configuration and use it
2683 // The inner file should be wrapped (by `banner.start.js`) in a function that
2684 // returns the AMD loader references.
2685 var S2 = function () {
2686 // Restore the Select2 AMD loader so it can be used
2687 // Needed mostly in the language files, where the loader is not inserted
2688 if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
2689 var S2 = jQuery.fn.select2.amd;
2690 }
2691
2692 var S2;
2693
2694 (function () {
2695 if (!S2 || !S2.requirejs) {
2696 if (!S2) {
2697 S2 = {};
2698 } else {
2699 require = S2;
2700 }
2701 /**
2702 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
2703 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
2704 */
2705 //Going sloppy to avoid 'use strict' string cost, but strict practices should
2706 //be followed.
2707
2708 /*global setTimeout: false */
2709
2710
2711 var requirejs, require, define;
2712
2713 (function (undef) {
2714 var main,
2715 _req,
2716 makeMap,
2717 handlers,
2718 defined = {},
2719 waiting = {},
2720 config = {},
2721 defining = {},
2722 hasOwn = Object.prototype.hasOwnProperty,
2723 aps = [].slice,
2724 jsSuffixRegExp = /\.js$/;
2725
2726 function hasProp(obj, prop) {
2727 return hasOwn.call(obj, prop);
2728 }
2729 /**
2730 * Given a relative module name, like ./something, normalize it to
2731 * a real name that can be mapped to a path.
2732 * @param {String} name the relative name
2733 * @param {String} baseName a real name that the name arg is relative
2734 * to.
2735 * @returns {String} normalized name
2736 */
2737
2738
2739 function normalize(name, baseName) {
2740 var nameParts,
2741 nameSegment,
2742 mapValue,
2743 foundMap,
2744 lastIndex,
2745 foundI,
2746 foundStarMap,
2747 starI,
2748 i,
2749 j,
2750 part,
2751 normalizedBaseParts,
2752 baseParts = baseName && baseName.split("/"),
2753 map = config.map,
2754 starMap = map && map['*'] || {}; //Adjust any relative paths.
2755
2756 if (name) {
2757 name = name.split('/');
2758 lastIndex = name.length - 1; // If wanting node ID compatibility, strip .js from end
2759 // of IDs. Have to do this here, and not in nameToUrl
2760 // because node allows either .js or non .js to map
2761 // to same file.
2762
2763 if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
2764 name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
2765 } // Starts with a '.' so need the baseName
2766
2767
2768 if (name[0].charAt(0) === '.' && baseParts) {
2769 //Convert baseName to array, and lop off the last part,
2770 //so that . matches that 'directory' and not name of the baseName's
2771 //module. For instance, baseName of 'one/two/three', maps to
2772 //'one/two/three.js', but we want the directory, 'one/two' for
2773 //this normalization.
2774 normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
2775 name = normalizedBaseParts.concat(name);
2776 } //start trimDots
2777
2778
2779 for (i = 0; i < name.length; i++) {
2780 part = name[i];
2781
2782 if (part === '.') {
2783 name.splice(i, 1);
2784 i -= 1;
2785 } else if (part === '..') {
2786 // If at the start, or previous value is still ..,
2787 // keep them so that when converted to a path it may
2788 // still work when converted to a path, even though
2789 // as an ID it is less than ideal. In larger point
2790 // releases, may be better to just kick out an error.
2791 if (i === 0 || i === 1 && name[2] === '..' || name[i - 1] === '..') {
2792 continue;
2793 } else if (i > 0) {
2794 name.splice(i - 1, 2);
2795 i -= 2;
2796 }
2797 }
2798 } //end trimDots
2799
2800
2801 name = name.join('/');
2802 } //Apply map config if available.
2803
2804
2805 if ((baseParts || starMap) && map) {
2806 nameParts = name.split('/');
2807
2808 for (i = nameParts.length; i > 0; i -= 1) {
2809 nameSegment = nameParts.slice(0, i).join("/");
2810
2811 if (baseParts) {
2812 //Find the longest baseName segment match in the config.
2813 //So, do joins on the biggest to smallest lengths of baseParts.
2814 for (j = baseParts.length; j > 0; j -= 1) {
2815 mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for
2816 //this name.
2817
2818 if (mapValue) {
2819 mapValue = mapValue[nameSegment];
2820
2821 if (mapValue) {
2822 //Match, update name to the new value.
2823 foundMap = mapValue;
2824 foundI = i;
2825 break;
2826 }
2827 }
2828 }
2829 }
2830
2831 if (foundMap) {
2832 break;
2833 } //Check for a star map match, but just hold on to it,
2834 //if there is a shorter segment match later in a matching
2835 //config, then favor over this star map.
2836
2837
2838 if (!foundStarMap && starMap && starMap[nameSegment]) {
2839 foundStarMap = starMap[nameSegment];
2840 starI = i;
2841 }
2842 }
2843
2844 if (!foundMap && foundStarMap) {
2845 foundMap = foundStarMap;
2846 foundI = starI;
2847 }
2848
2849 if (foundMap) {
2850 nameParts.splice(0, foundI, foundMap);
2851 name = nameParts.join('/');
2852 }
2853 }
2854
2855 return name;
2856 }
2857
2858 function makeRequire(relName, forceSync) {
2859 return function () {
2860 //A version of a require function that passes a moduleName
2861 //value for items that may need to
2862 //look up paths relative to the moduleName
2863 var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only
2864 //one arg, it is the array form without a callback. Insert
2865 //a null so that the following concat is correct.
2866
2867 if (typeof args[0] !== 'string' && args.length === 1) {
2868 args.push(null);
2869 }
2870
2871 return _req.apply(undef, args.concat([relName, forceSync]));
2872 };
2873 }
2874
2875 function makeNormalize(relName) {
2876 return function (name) {
2877 return normalize(name, relName);
2878 };
2879 }
2880
2881 function makeLoad(depName) {
2882 return function (value) {
2883 defined[depName] = value;
2884 };
2885 }
2886
2887 function callDep(name) {
2888 if (hasProp(waiting, name)) {
2889 var args = waiting[name];
2890 delete waiting[name];
2891 defining[name] = true;
2892 main.apply(undef, args);
2893 }
2894
2895 if (!hasProp(defined, name) && !hasProp(defining, name)) {
2896 throw new Error('No ' + name);
2897 }
2898
2899 return defined[name];
2900 } //Turns a plugin!resource to [plugin, resource]
2901 //with the plugin being undefined if the name
2902 //did not have a plugin prefix.
2903
2904
2905 function splitPrefix(name) {
2906 var prefix,
2907 index = name ? name.indexOf('!') : -1;
2908
2909 if (index > -1) {
2910 prefix = name.substring(0, index);
2911 name = name.substring(index + 1, name.length);
2912 }
2913
2914 return [prefix, name];
2915 } //Creates a parts array for a relName where first part is plugin ID,
2916 //second part is resource ID. Assumes relName has already been normalized.
2917
2918
2919 function makeRelParts(relName) {
2920 return relName ? splitPrefix(relName) : [];
2921 }
2922 /**
2923 * Makes a name map, normalizing the name, and using a plugin
2924 * for normalization if necessary. Grabs a ref to plugin
2925 * too, as an optimization.
2926 */
2927
2928
2929 makeMap = function makeMap(name, relParts) {
2930 var plugin,
2931 parts = splitPrefix(name),
2932 prefix = parts[0],
2933 relResourceName = relParts[1];
2934 name = parts[1];
2935
2936 if (prefix) {
2937 prefix = normalize(prefix, relResourceName);
2938 plugin = callDep(prefix);
2939 } //Normalize according
2940
2941
2942 if (prefix) {
2943 if (plugin && plugin.normalize) {
2944 name = plugin.normalize(name, makeNormalize(relResourceName));
2945 } else {
2946 name = normalize(name, relResourceName);
2947 }
2948 } else {
2949 name = normalize(name, relResourceName);
2950 parts = splitPrefix(name);
2951 prefix = parts[0];
2952 name = parts[1];
2953
2954 if (prefix) {
2955 plugin = callDep(prefix);
2956 }
2957 } //Using ridiculous property names for space reasons
2958
2959
2960 return {
2961 f: prefix ? prefix + '!' + name : name,
2962 //fullName
2963 n: name,
2964 pr: prefix,
2965 p: plugin
2966 };
2967 };
2968
2969 function makeConfig(name) {
2970 return function () {
2971 return config && config.config && config.config[name] || {};
2972 };
2973 }
2974
2975 handlers = {
2976 require: function require(name) {
2977 return makeRequire(name);
2978 },
2979 exports: function exports(name) {
2980 var e = defined[name];
2981
2982 if (typeof e !== 'undefined') {
2983 return e;
2984 } else {
2985 return defined[name] = {};
2986 }
2987 },
2988 module: function module(name) {
2989 return {
2990 id: name,
2991 uri: '',
2992 exports: defined[name],
2993 config: makeConfig(name)
2994 };
2995 }
2996 };
2997
2998 main = function main(name, deps, callback, relName) {
2999 var cjsModule,
3000 depName,
3001 ret,
3002 map,
3003 i,
3004 relParts,
3005 args = [],
3006 callbackType = _typeof(callback),
3007 usingExports; //Use name if no relName
3008
3009
3010 relName = relName || name;
3011 relParts = makeRelParts(relName); //Call the callback to define the module, if necessary.
3012
3013 if (callbackType === 'undefined' || callbackType === 'function') {
3014 //Pull out the defined dependencies and pass the ordered
3015 //values to the callback.
3016 //Default to [require, exports, module] if no deps
3017 deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
3018
3019 for (i = 0; i < deps.length; i += 1) {
3020 map = makeMap(deps[i], relParts);
3021 depName = map.f; //Fast path CommonJS standard dependencies.
3022
3023 if (depName === "require") {
3024 args[i] = handlers.require(name);
3025 } else if (depName === "exports") {
3026 //CommonJS module spec 1.1
3027 args[i] = handlers.exports(name);
3028 usingExports = true;
3029 } else if (depName === "module") {
3030 //CommonJS module spec 1.1
3031 cjsModule = args[i] = handlers.module(name);
3032 } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) {
3033 args[i] = callDep(depName);
3034 } else if (map.p) {
3035 map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
3036 args[i] = defined[depName];
3037 } else {
3038 throw new Error(name + ' missing ' + depName);
3039 }
3040 }
3041
3042 ret = callback ? callback.apply(defined[name], args) : undefined;
3043
3044 if (name) {
3045 //If setting exports via "module" is in play,
3046 //favor that over return value and exports. After that,
3047 //favor a non-undefined return value over exports use.
3048 if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) {
3049 defined[name] = cjsModule.exports;
3050 } else if (ret !== undef || !usingExports) {
3051 //Use the return value from the function.
3052 defined[name] = ret;
3053 }
3054 }
3055 } else if (name) {
3056 //May just be an object definition for the module. Only
3057 //worry about defining if have a module name.
3058 defined[name] = callback;
3059 }
3060 };
3061
3062 requirejs = require = _req = function req(deps, callback, relName, forceSync, alt) {
3063 if (typeof deps === "string") {
3064 if (handlers[deps]) {
3065 //callback in this case is really relName
3066 return handlers[deps](callback);
3067 } //Just return the module wanted. In this scenario, the
3068 //deps arg is the module name, and second arg (if passed)
3069 //is just the relName.
3070 //Normalize module name, if it contains . or ..
3071
3072
3073 return callDep(makeMap(deps, makeRelParts(callback)).f);
3074 } else if (!deps.splice) {
3075 //deps is a config object, not an array.
3076 config = deps;
3077
3078 if (config.deps) {
3079 _req(config.deps, config.callback);
3080 }
3081
3082 if (!callback) {
3083 return;
3084 }
3085
3086 if (callback.splice) {
3087 //callback is an array, which means it is a dependency list.
3088 //Adjust args if there are dependencies
3089 deps = callback;
3090 callback = relName;
3091 relName = null;
3092 } else {
3093 deps = undef;
3094 }
3095 } //Support require(['a'])
3096
3097
3098 callback = callback || function () {}; //If relName is a function, it is an errback handler,
3099 //so remove it.
3100
3101
3102 if (typeof relName === 'function') {
3103 relName = forceSync;
3104 forceSync = alt;
3105 } //Simulate async callback;
3106
3107
3108 if (forceSync) {
3109 main(undef, deps, callback, relName);
3110 } else {
3111 //Using a non-zero value because of concern for what old browsers
3112 //do, and latest browsers "upgrade" to 4 if lower value is used:
3113 //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
3114 //If want a value immediately, use require('id') instead -- something
3115 //that works in almond on the global level, but not guaranteed and
3116 //unlikely to work in other AMD implementations.
3117 setTimeout(function () {
3118 main(undef, deps, callback, relName);
3119 }, 4);
3120 }
3121
3122 return _req;
3123 };
3124 /**
3125 * Just drops the config on the floor, but returns req in case
3126 * the config return value is used.
3127 */
3128
3129
3130 _req.config = function (cfg) {
3131 return _req(cfg);
3132 };
3133 /**
3134 * Expose module registry for debugging and tooling
3135 */
3136
3137
3138 requirejs._defined = defined;
3139
3140 define = function define(name, deps, callback) {
3141 if (typeof name !== 'string') {
3142 throw new Error('See almond README: incorrect module build, no module name');
3143 } //This module may not have dependencies
3144
3145
3146 if (!deps.splice) {
3147 //deps is not an array, so probably means
3148 //an object literal or factory function for
3149 //the value. Adjust args.
3150 callback = deps;
3151 deps = [];
3152 }
3153
3154 if (!hasProp(defined, name) && !hasProp(waiting, name)) {
3155 waiting[name] = [name, deps, callback];
3156 }
3157 };
3158
3159 define.amd = {
3160 jQuery: true
3161 };
3162 })();
3163
3164 S2.requirejs = requirejs;
3165 S2.require = require;
3166 S2.define = define;
3167 }
3168 })();
3169
3170 S2.define("almond", function () {});
3171 /* global jQuery:false, $:false */
3172
3173 S2.define('jquery', [], function () {
3174 var _$ = jQuery || $;
3175
3176 if (_$ == null && console && console.error) {
3177 console.error('Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.');
3178 }
3179
3180 return _$;
3181 });
3182 S2.define('select2/utils', ['jquery'], function ($) {
3183 var Utils = {};
3184
3185 Utils.Extend = function (ChildClass, SuperClass) {
3186 var __hasProp = {}.hasOwnProperty;
3187
3188 function BaseConstructor() {
3189 this.constructor = ChildClass;
3190 }
3191
3192 for (var key in SuperClass) {
3193 if (__hasProp.call(SuperClass, key)) {
3194 ChildClass[key] = SuperClass[key];
3195 }
3196 }
3197
3198 BaseConstructor.prototype = SuperClass.prototype;
3199 ChildClass.prototype = new BaseConstructor();
3200 ChildClass.__super__ = SuperClass.prototype;
3201 return ChildClass;
3202 };
3203
3204 function getMethods(theClass) {
3205 var proto = theClass.prototype;
3206 var methods = [];
3207
3208 for (var methodName in proto) {
3209 var m = proto[methodName];
3210
3211 if (typeof m !== 'function') {
3212 continue;
3213 }
3214
3215 if (methodName === 'constructor') {
3216 continue;
3217 }
3218
3219 methods.push(methodName);
3220 }
3221
3222 return methods;
3223 }
3224
3225 Utils.Decorate = function (SuperClass, DecoratorClass) {
3226 var decoratedMethods = getMethods(DecoratorClass);
3227 var superMethods = getMethods(SuperClass);
3228
3229 function DecoratedClass() {
3230 var unshift = Array.prototype.unshift;
3231 var argCount = DecoratorClass.prototype.constructor.length;
3232 var calledConstructor = SuperClass.prototype.constructor;
3233
3234 if (argCount > 0) {
3235 unshift.call(arguments, SuperClass.prototype.constructor);
3236 calledConstructor = DecoratorClass.prototype.constructor;
3237 }
3238
3239 calledConstructor.apply(this, arguments);
3240 }
3241
3242 DecoratorClass.displayName = SuperClass.displayName;
3243
3244 function ctr() {
3245 this.constructor = DecoratedClass;
3246 }
3247
3248 DecoratedClass.prototype = new ctr();
3249
3250 for (var m = 0; m < superMethods.length; m++) {
3251 var superMethod = superMethods[m];
3252 DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod];
3253 }
3254
3255 var calledMethod = function calledMethod(methodName) {
3256 // Stub out the original method if it's not decorating an actual method
3257 var originalMethod = function originalMethod() {};
3258
3259 if (methodName in DecoratedClass.prototype) {
3260 originalMethod = DecoratedClass.prototype[methodName];
3261 }
3262
3263 var decoratedMethod = DecoratorClass.prototype[methodName];
3264 return function () {
3265 var unshift = Array.prototype.unshift;
3266 unshift.call(arguments, originalMethod);
3267 return decoratedMethod.apply(this, arguments);
3268 };
3269 };
3270
3271 for (var d = 0; d < decoratedMethods.length; d++) {
3272 var decoratedMethod = decoratedMethods[d];
3273 DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
3274 }
3275
3276 return DecoratedClass;
3277 };
3278
3279 var Observable = function Observable() {
3280 this.listeners = {};
3281 };
3282
3283 Observable.prototype.on = function (event, callback) {
3284 this.listeners = this.listeners || {};
3285
3286 if (event in this.listeners) {
3287 this.listeners[event].push(callback);
3288 } else {
3289 this.listeners[event] = [callback];
3290 }
3291 };
3292
3293 Observable.prototype.trigger = function (event) {
3294 var slice = Array.prototype.slice;
3295 var params = slice.call(arguments, 1);
3296 this.listeners = this.listeners || {}; // Params should always come in as an array
3297
3298 if (params == null) {
3299 params = [];
3300 } // If there are no arguments to the event, use a temporary object
3301
3302
3303 if (params.length === 0) {
3304 params.push({});
3305 } // Set the `_type` of the first object to the event
3306
3307
3308 params[0]._type = event;
3309
3310 if (event in this.listeners) {
3311 this.invoke(this.listeners[event], slice.call(arguments, 1));
3312 }
3313
3314 if ('*' in this.listeners) {
3315 this.invoke(this.listeners['*'], arguments);
3316 }
3317 };
3318
3319 Observable.prototype.invoke = function (listeners, params) {
3320 for (var i = 0, len = listeners.length; i < len; i++) {
3321 listeners[i].apply(this, params);
3322 }
3323 };
3324
3325 Utils.Observable = Observable;
3326
3327 Utils.generateChars = function (length) {
3328 var chars = '';
3329
3330 for (var i = 0; i < length; i++) {
3331 var randomChar = Math.floor(Math.random() * 36);
3332 chars += randomChar.toString(36);
3333 }
3334
3335 return chars;
3336 };
3337
3338 Utils.bind = function (func, context) {
3339 return function () {
3340 func.apply(context, arguments);
3341 };
3342 };
3343
3344 Utils._convertData = function (data) {
3345 for (var originalKey in data) {
3346 var keys = originalKey.split('-');
3347 var dataLevel = data;
3348
3349 if (keys.length === 1) {
3350 continue;
3351 }
3352
3353 for (var k = 0; k < keys.length; k++) {
3354 var key = keys[k]; // Lowercase the first letter
3355 // By default, dash-separated becomes camelCase
3356
3357 key = key.substring(0, 1).toLowerCase() + key.substring(1);
3358
3359 if (!(key in dataLevel)) {
3360 dataLevel[key] = {};
3361 }
3362
3363 if (k == keys.length - 1) {
3364 dataLevel[key] = data[originalKey];
3365 }
3366
3367 dataLevel = dataLevel[key];
3368 }
3369
3370 delete data[originalKey];
3371 }
3372
3373 return data;
3374 };
3375
3376 Utils.hasScroll = function (index, el) {
3377 // Adapted from the function created by @ShadowScripter
3378 // and adapted by @BillBarry on the Stack Exchange Code Review website.
3379 // The original code can be found at
3380 // http://codereview.stackexchange.com/q/13338
3381 // and was designed to be used with the Sizzle selector engine.
3382 var $el = $(el);
3383 var overflowX = el.style.overflowX;
3384 var overflowY = el.style.overflowY; //Check both x and y declarations
3385
3386 if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) {
3387 return false;
3388 }
3389
3390 if (overflowX === 'scroll' || overflowY === 'scroll') {
3391 return true;
3392 }
3393
3394 return $el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth;
3395 };
3396
3397 Utils.escapeMarkup = function (markup) {
3398 var replaceMap = {
3399 '\\': '&#92;',
3400 '&': '&amp;',
3401 '<': '&lt;',
3402 '>': '&gt;',
3403 '"': '&quot;',
3404 '\'': '&#39;',
3405 '/': '&#47;'
3406 }; // Do not try to escape the markup if it's not a string
3407
3408 if (typeof markup !== 'string') {
3409 return markup;
3410 }
3411
3412 return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
3413 return replaceMap[match];
3414 });
3415 }; // Cache objects in Utils.__cache instead of $.data (see #4346)
3416
3417
3418 Utils.__cache = {};
3419 var id = 0;
3420
3421 Utils.GetUniqueElementId = function (element) {
3422 // Get a unique element Id. If element has no id,
3423 // creates a new unique number, stores it in the id
3424 // attribute and returns the new id with a prefix.
3425 // If an id already exists, it simply returns it with a prefix.
3426 var select2Id = element.getAttribute('data-select2-id');
3427
3428 if (select2Id != null) {
3429 return select2Id;
3430 } // If element has id, use it.
3431
3432
3433 if (element.id) {
3434 select2Id = 'select2-data-' + element.id;
3435 } else {
3436 select2Id = 'select2-data-' + (++id).toString() + '-' + Utils.generateChars(4);
3437 }
3438
3439 element.setAttribute('data-select2-id', select2Id);
3440 return select2Id;
3441 };
3442
3443 Utils.StoreData = function (element, name, value) {
3444 // Stores an item in the cache for a specified element.
3445 // name is the cache key.
3446 var id = Utils.GetUniqueElementId(element);
3447
3448 if (!Utils.__cache[id]) {
3449 Utils.__cache[id] = {};
3450 }
3451
3452 Utils.__cache[id][name] = value;
3453 };
3454
3455 Utils.GetData = function (element, name) {
3456 // Retrieves a value from the cache by its key (name)
3457 // name is optional. If no name specified, return
3458 // all cache items for the specified element.
3459 // and for a specified element.
3460 var id = Utils.GetUniqueElementId(element);
3461
3462 if (name) {
3463 if (Utils.__cache[id]) {
3464 if (Utils.__cache[id][name] != null) {
3465 return Utils.__cache[id][name];
3466 }
3467
3468 return $(element).data(name); // Fallback to HTML5 data attribs.
3469 }
3470
3471 return $(element).data(name); // Fallback to HTML5 data attribs.
3472 } else {
3473 return Utils.__cache[id];
3474 }
3475 };
3476
3477 Utils.RemoveData = function (element) {
3478 // Removes all cached items for a specified element.
3479 var id = Utils.GetUniqueElementId(element);
3480
3481 if (Utils.__cache[id] != null) {
3482 delete Utils.__cache[id];
3483 }
3484
3485 element.removeAttribute('data-select2-id');
3486 };
3487
3488 Utils.copyNonInternalCssClasses = function (dest, src) {
3489 var classes;
3490 var destinationClasses = dest.getAttribute('class').trim().split(/\s+/);
3491 destinationClasses = destinationClasses.filter(function (clazz) {
3492 // Save all Select2 classes
3493 return clazz.indexOf('select2-') === 0;
3494 });
3495 var sourceClasses = src.getAttribute('class').trim().split(/\s+/);
3496 sourceClasses = sourceClasses.filter(function (clazz) {
3497 // Only copy non-Select2 classes
3498 return clazz.indexOf('select2-') !== 0;
3499 });
3500 var replacements = destinationClasses.concat(sourceClasses);
3501 dest.setAttribute('class', replacements.join(' '));
3502 };
3503
3504 return Utils;
3505 });
3506 S2.define('select2/results', ['jquery', './utils'], function ($, Utils) {
3507 function Results($element, options, dataAdapter) {
3508 this.$element = $element;
3509 this.data = dataAdapter;
3510 this.options = options;
3511
3512 Results.__super__.constructor.call(this);
3513 }
3514
3515 Utils.Extend(Results, Utils.Observable);
3516
3517 Results.prototype.render = function () {
3518 var $results = $('<ul class="select2-results__options" role="listbox"></ul>');
3519
3520 if (this.options.get('multiple')) {
3521 $results.attr('aria-multiselectable', 'true');
3522 }
3523
3524 this.$results = $results;
3525 return $results;
3526 };
3527
3528 Results.prototype.clear = function () {
3529 this.$results.empty();
3530 };
3531
3532 Results.prototype.displayMessage = function (params) {
3533 var escapeMarkup = this.options.get('escapeMarkup');
3534 this.clear();
3535 this.hideLoading();
3536 var $message = $('<li role="alert" aria-live="assertive"' + ' class="select2-results__option"></li>');
3537 var message = this.options.get('translations').get(params.message);
3538 $message.append(escapeMarkup(message(params.args)));
3539 $message[0].className += ' select2-results__message';
3540 this.$results.append($message);
3541 };
3542
3543 Results.prototype.hideMessages = function () {
3544 this.$results.find('.select2-results__message').remove();
3545 };
3546
3547 Results.prototype.append = function (data) {
3548 this.hideLoading();
3549 var $options = [];
3550
3551 if (data.results == null || data.results.length === 0) {
3552 if (this.$results.children().length === 0) {
3553 this.trigger('results:message', {
3554 message: 'noResults'
3555 });
3556 }
3557
3558 return;
3559 }
3560
3561 data.results = this.sort(data.results);
3562
3563 for (var d = 0; d < data.results.length; d++) {
3564 var item = data.results[d];
3565 var $option = this.option(item);
3566 $options.push($option);
3567 }
3568
3569 this.$results.append($options);
3570 };
3571
3572 Results.prototype.position = function ($results, $dropdown) {
3573 var $resultsContainer = $dropdown.find('.select2-results');
3574 $resultsContainer.append($results);
3575 };
3576
3577 Results.prototype.sort = function (data) {
3578 var sorter = this.options.get('sorter');
3579 return sorter(data);
3580 };
3581
3582 Results.prototype.highlightFirstItem = function () {
3583 var $options = this.$results.find('.select2-results__option--selectable');
3584 var $selected = $options.filter('.select2-results__option--selected'); // Check if there are any selected options
3585
3586 if ($selected.length > 0) {
3587 // If there are selected options, highlight the first
3588 $selected.first().trigger('mouseenter');
3589 } else {
3590 // If there are no selected options, highlight the first option
3591 // in the dropdown
3592 $options.first().trigger('mouseenter');
3593 }
3594
3595 this.ensureHighlightVisible();
3596 };
3597
3598 Results.prototype.setClasses = function () {
3599 var self = this;
3600 this.data.current(function (selected) {
3601 var selectedIds = selected.map(function (s) {
3602 return s.id.toString();
3603 });
3604 var $options = self.$results.find('.select2-results__option--selectable');
3605 $options.each(function () {
3606 var $option = $(this);
3607 var item = Utils.GetData(this, 'data'); // id needs to be converted to a string when comparing
3608
3609 var id = '' + item.id;
3610
3611 if (item.element != null && item.element.selected || item.element == null && selectedIds.indexOf(id) > -1) {
3612 this.classList.add('select2-results__option--selected');
3613 $option.attr('aria-selected', 'true');
3614 } else {
3615 this.classList.remove('select2-results__option--selected');
3616 $option.attr('aria-selected', 'false');
3617 }
3618 });
3619 });
3620 };
3621
3622 Results.prototype.showLoading = function (params) {
3623 this.hideLoading();
3624 var loadingMore = this.options.get('translations').get('searching');
3625 var loading = {
3626 disabled: true,
3627 loading: true,
3628 text: loadingMore(params)
3629 };
3630 var $loading = this.option(loading);
3631 $loading.className += ' loading-results';
3632 this.$results.prepend($loading);
3633 };
3634
3635 Results.prototype.hideLoading = function () {
3636 this.$results.find('.loading-results').remove();
3637 };
3638
3639 Results.prototype.option = function (data) {
3640 var option = document.createElement('li');
3641 option.classList.add('select2-results__option');
3642 option.classList.add('select2-results__option--selectable');
3643 var attrs = {
3644 'role': 'option'
3645 };
3646 var matches = window.Element.prototype.matches || window.Element.prototype.msMatchesSelector || window.Element.prototype.webkitMatchesSelector;
3647
3648 if (data.element != null && matches.call(data.element, ':disabled') || data.element == null && data.disabled) {
3649 attrs['aria-disabled'] = 'true';
3650 option.classList.remove('select2-results__option--selectable');
3651 option.classList.add('select2-results__option--disabled');
3652 }
3653
3654 if (data.id == null) {
3655 option.classList.remove('select2-results__option--selectable');
3656 }
3657
3658 if (data._resultId != null) {
3659 option.id = data._resultId;
3660 }
3661
3662 if (data.title) {
3663 option.title = data.title;
3664 }
3665
3666 if (data.children) {
3667 attrs.role = 'group';
3668 attrs['aria-label'] = data.text;
3669 option.classList.remove('select2-results__option--selectable');
3670 option.classList.add('select2-results__option--group');
3671 }
3672
3673 for (var attr in attrs) {
3674 var val = attrs[attr];
3675 option.setAttribute(attr, val);
3676 }
3677
3678 if (data.children) {
3679 var $option = $(option);
3680 var label = document.createElement('strong');
3681 label.className = 'select2-results__group';
3682 this.template(data, label);
3683 var $children = [];
3684
3685 for (var c = 0; c < data.children.length; c++) {
3686 var child = data.children[c];
3687 var $child = this.option(child);
3688 $children.push($child);
3689 }
3690
3691 var $childrenContainer = $('<ul></ul>', {
3692 'class': 'select2-results__options select2-results__options--nested',
3693 'role': 'none'
3694 });
3695 $childrenContainer.append($children);
3696 $option.append(label);
3697 $option.append($childrenContainer);
3698 } else {
3699 this.template(data, option);
3700 }
3701
3702 Utils.StoreData(option, 'data', data);
3703 return option;
3704 };
3705
3706 Results.prototype.bind = function (container, $container) {
3707 var self = this;
3708 var id = container.id + '-results';
3709 this.$results.attr('id', id);
3710 container.on('results:all', function (params) {
3711 self.clear();
3712 self.append(params.data);
3713
3714 if (container.isOpen()) {
3715 self.setClasses();
3716 self.highlightFirstItem();
3717 }
3718 });
3719 container.on('results:append', function (params) {
3720 self.append(params.data);
3721
3722 if (container.isOpen()) {
3723 self.setClasses();
3724 }
3725 });
3726 container.on('query', function (params) {
3727 self.hideMessages();
3728 self.showLoading(params);
3729 });
3730 container.on('select', function () {
3731 if (!container.isOpen()) {
3732 return;
3733 }
3734
3735 self.setClasses();
3736
3737 if (self.options.get('scrollAfterSelect')) {
3738 self.highlightFirstItem();
3739 }
3740 });
3741 container.on('unselect', function () {
3742 if (!container.isOpen()) {
3743 return;
3744 }
3745
3746 self.setClasses();
3747
3748 if (self.options.get('scrollAfterSelect')) {
3749 self.highlightFirstItem();
3750 }
3751 });
3752 container.on('open', function () {
3753 // When the dropdown is open, aria-expended="true"
3754 self.$results.attr('aria-expanded', 'true');
3755 self.$results.attr('aria-hidden', 'false');
3756 self.setClasses();
3757 self.ensureHighlightVisible();
3758 });
3759 container.on('close', function () {
3760 // When the dropdown is closed, aria-expended="false"
3761 self.$results.attr('aria-expanded', 'false');
3762 self.$results.attr('aria-hidden', 'true');
3763 self.$results.removeAttr('aria-activedescendant');
3764 });
3765 container.on('results:toggle', function () {
3766 var $highlighted = self.getHighlightedResults();
3767
3768 if ($highlighted.length === 0) {
3769 return;
3770 }
3771
3772 $highlighted.trigger('mouseup');
3773 });
3774 container.on('results:select', function () {
3775 var $highlighted = self.getHighlightedResults();
3776
3777 if ($highlighted.length === 0) {
3778 return;
3779 }
3780
3781 var data = Utils.GetData($highlighted[0], 'data');
3782
3783 if ($highlighted.hasClass('select2-results__option--selected')) {
3784 self.trigger('close', {});
3785 } else {
3786 self.trigger('select', {
3787 data: data
3788 });
3789 }
3790 });
3791 container.on('results:previous', function () {
3792 var $highlighted = self.getHighlightedResults();
3793 var $options = self.$results.find('.select2-results__option--selectable');
3794 var currentIndex = $options.index($highlighted); // If we are already at the top, don't move further
3795 // If no options, currentIndex will be -1
3796
3797 if (currentIndex <= 0) {
3798 return;
3799 }
3800
3801 var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first
3802
3803 if ($highlighted.length === 0) {
3804 nextIndex = 0;
3805 }
3806
3807 var $next = $options.eq(nextIndex);
3808 $next.trigger('mouseenter');
3809 var currentOffset = self.$results.offset().top;
3810 var nextTop = $next.offset().top;
3811 var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
3812
3813 if (nextIndex === 0) {
3814 self.$results.scrollTop(0);
3815 } else if (nextTop - currentOffset < 0) {
3816 self.$results.scrollTop(nextOffset);
3817 }
3818 });
3819 container.on('results:next', function () {
3820 var $highlighted = self.getHighlightedResults();
3821 var $options = self.$results.find('.select2-results__option--selectable');
3822 var currentIndex = $options.index($highlighted);
3823 var nextIndex = currentIndex + 1; // If we are at the last option, stay there
3824
3825 if (nextIndex >= $options.length) {
3826 return;
3827 }
3828
3829 var $next = $options.eq(nextIndex);
3830 $next.trigger('mouseenter');
3831 var currentOffset = self.$results.offset().top + self.$results.outerHeight(false);
3832 var nextBottom = $next.offset().top + $next.outerHeight(false);
3833 var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
3834
3835 if (nextIndex === 0) {
3836 self.$results.scrollTop(0);
3837 } else if (nextBottom > currentOffset) {
3838 self.$results.scrollTop(nextOffset);
3839 }
3840 });
3841 container.on('results:focus', function (params) {
3842 params.element[0].classList.add('select2-results__option--highlighted');
3843 params.element[0].setAttribute('aria-selected', 'true');
3844 });
3845 container.on('results:message', function (params) {
3846 self.displayMessage(params);
3847 });
3848
3849 if ($.fn.mousewheel) {
3850 this.$results.on('mousewheel', function (e) {
3851 var top = self.$results.scrollTop();
3852 var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
3853 var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
3854 var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
3855
3856 if (isAtTop) {
3857 self.$results.scrollTop(0);
3858 e.preventDefault();
3859 e.stopPropagation();
3860 } else if (isAtBottom) {
3861 self.$results.scrollTop(self.$results.get(0).scrollHeight - self.$results.height());
3862 e.preventDefault();
3863 e.stopPropagation();
3864 }
3865 });
3866 }
3867
3868 this.$results.on('mouseup', '.select2-results__option--selectable', function (evt) {
3869 var $this = $(this);
3870 var data = Utils.GetData(this, 'data');
3871
3872 if ($this.hasClass('select2-results__option--selected')) {
3873 if (self.options.get('multiple')) {
3874 self.trigger('unselect', {
3875 originalEvent: evt,
3876 data: data
3877 });
3878 } else {
3879 self.trigger('close', {});
3880 }
3881
3882 return;
3883 }
3884
3885 self.trigger('select', {
3886 originalEvent: evt,
3887 data: data
3888 });
3889 });
3890 this.$results.on('mouseenter', '.select2-results__option--selectable', function (evt) {
3891 var data = Utils.GetData(this, 'data');
3892 self.getHighlightedResults().removeClass('select2-results__option--highlighted').attr('aria-selected', 'false');
3893 self.trigger('results:focus', {
3894 data: data,
3895 element: $(this)
3896 });
3897 });
3898 };
3899
3900 Results.prototype.getHighlightedResults = function () {
3901 var $highlighted = this.$results.find('.select2-results__option--highlighted');
3902 return $highlighted;
3903 };
3904
3905 Results.prototype.destroy = function () {
3906 this.$results.remove();
3907 };
3908
3909 Results.prototype.ensureHighlightVisible = function () {
3910 var $highlighted = this.getHighlightedResults();
3911
3912 if ($highlighted.length === 0) {
3913 return;
3914 }
3915
3916 var $options = this.$results.find('.select2-results__option--selectable');
3917 var currentIndex = $options.index($highlighted);
3918 var currentOffset = this.$results.offset().top;
3919 var nextTop = $highlighted.offset().top;
3920 var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
3921 var offsetDelta = nextTop - currentOffset;
3922 nextOffset -= $highlighted.outerHeight(false) * 2;
3923
3924 if (currentIndex <= 2) {
3925 this.$results.scrollTop(0);
3926 } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
3927 this.$results.scrollTop(nextOffset);
3928 }
3929 };
3930
3931 Results.prototype.template = function (result, container) {
3932 var template = this.options.get('templateResult');
3933 var escapeMarkup = this.options.get('escapeMarkup');
3934 var content = template(result, container);
3935
3936 if (content == null) {
3937 container.style.display = 'none';
3938 } else if (typeof content === 'string') {
3939 container.innerHTML = escapeMarkup(content);
3940 } else {
3941 $(container).append(content);
3942 }
3943 };
3944
3945 return Results;
3946 });
3947 S2.define('select2/keys', [], function () {
3948 var KEYS = {
3949 BACKSPACE: 8,
3950 TAB: 9,
3951 ENTER: 13,
3952 SHIFT: 16,
3953 CTRL: 17,
3954 ALT: 18,
3955 ESC: 27,
3956 SPACE: 32,
3957 PAGE_UP: 33,
3958 PAGE_DOWN: 34,
3959 END: 35,
3960 HOME: 36,
3961 LEFT: 37,
3962 UP: 38,
3963 RIGHT: 39,
3964 DOWN: 40,
3965 DELETE: 46
3966 };
3967 return KEYS;
3968 });
3969 S2.define('select2/selection/base', ['jquery', '../utils', '../keys'], function ($, Utils, KEYS) {
3970 function BaseSelection($element, options) {
3971 this.$element = $element;
3972 this.options = options;
3973
3974 BaseSelection.__super__.constructor.call(this);
3975 }
3976
3977 Utils.Extend(BaseSelection, Utils.Observable);
3978
3979 BaseSelection.prototype.render = function () {
3980 var $selection = $('<span class="select2-selection" role="combobox" ' + ' aria-haspopup="true" aria-expanded="false">' + '</span>');
3981 this._tabindex = 0;
3982
3983 if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
3984 this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
3985 } else if (this.$element.attr('tabindex') != null) {
3986 this._tabindex = this.$element.attr('tabindex');
3987 }
3988
3989 $selection.attr('title', this.$element.attr('title'));
3990 $selection.attr('tabindex', this._tabindex);
3991 $selection.attr('aria-disabled', 'false');
3992 this.$selection = $selection;
3993 return $selection;
3994 };
3995
3996 BaseSelection.prototype.bind = function (container, $container) {
3997 var self = this;
3998 var resultsId = container.id + '-results';
3999 this.container = container;
4000 this.$selection.on('focus', function (evt) {
4001 self.trigger('focus', evt);
4002 });
4003 this.$selection.on('blur', function (evt) {
4004 self._handleBlur(evt);
4005 });
4006 this.$selection.on('keydown', function (evt) {
4007 self.trigger('keypress', evt);
4008
4009 if (evt.which === KEYS.SPACE) {
4010 evt.preventDefault();
4011 }
4012 });
4013 container.on('results:focus', function (params) {
4014 self.$selection.attr('aria-activedescendant', params.data._resultId);
4015 });
4016 container.on('selection:update', function (params) {
4017 self.update(params.data);
4018 });
4019 container.on('open', function () {
4020 // When the dropdown is open, aria-expanded="true"
4021 self.$selection.attr('aria-expanded', 'true');
4022 self.$selection.attr('aria-owns', resultsId);
4023
4024 self._attachCloseHandler(container);
4025 });
4026 container.on('close', function () {
4027 // When the dropdown is closed, aria-expanded="false"
4028 self.$selection.attr('aria-expanded', 'false');
4029 self.$selection.removeAttr('aria-activedescendant');
4030 self.$selection.removeAttr('aria-owns');
4031 self.$selection.trigger('focus');
4032
4033 self._detachCloseHandler(container);
4034 });
4035 container.on('enable', function () {
4036 self.$selection.attr('tabindex', self._tabindex);
4037 self.$selection.attr('aria-disabled', 'false');
4038 });
4039 container.on('disable', function () {
4040 self.$selection.attr('tabindex', '-1');
4041 self.$selection.attr('aria-disabled', 'true');
4042 });
4043 };
4044
4045 BaseSelection.prototype._handleBlur = function (evt) {
4046 var self = this; // This needs to be delayed as the active element is the body when the tab
4047 // key is pressed, possibly along with others.
4048
4049 window.setTimeout(function () {
4050 // Don't trigger `blur` if the focus is still in the selection
4051 if (document.activeElement == self.$selection[0] || $.contains(self.$selection[0], document.activeElement)) {
4052 return;
4053 }
4054
4055 self.trigger('blur', evt);
4056 }, 1);
4057 };
4058
4059 BaseSelection.prototype._attachCloseHandler = function (container) {
4060 $(document.body).on('mousedown.select2.' + container.id, function (e) {
4061 var $target = $(e.target);
4062 var $select = $target.closest('.select2');
4063 var $all = $('.select2.select2-container--open');
4064 $all.each(function () {
4065 if (this == $select[0]) {
4066 return;
4067 }
4068
4069 var $element = Utils.GetData(this, 'element'); // Renamed function. @edited
4070 // old: $element.select2('close');
4071
4072 $element.SUIselect2('close');
4073 });
4074 });
4075 };
4076
4077 BaseSelection.prototype._detachCloseHandler = function (container) {
4078 $(document.body).off('mousedown.select2.' + container.id);
4079 };
4080
4081 BaseSelection.prototype.position = function ($selection, $container) {
4082 var $selectionContainer = $container.find('.selection');
4083 $selectionContainer.append($selection);
4084 };
4085
4086 BaseSelection.prototype.destroy = function () {
4087 this._detachCloseHandler(this.container);
4088 };
4089
4090 BaseSelection.prototype.update = function (data) {
4091 throw new Error('The `update` method must be defined in child classes.');
4092 };
4093 /**
4094 * Helper method to abstract the "enabled" (not "disabled") state of this
4095 * object.
4096 *
4097 * @return {true} if the instance is not disabled.
4098 * @return {false} if the instance is disabled.
4099 */
4100
4101
4102 BaseSelection.prototype.isEnabled = function () {
4103 return !this.isDisabled();
4104 };
4105 /**
4106 * Helper method to abstract the "disabled" state of this object.
4107 *
4108 * @return {true} if the disabled option is true.
4109 * @return {false} if the disabled option is false.
4110 */
4111
4112
4113 BaseSelection.prototype.isDisabled = function () {
4114 return this.options.get('disabled');
4115 };
4116
4117 return BaseSelection;
4118 });
4119 S2.define('select2/selection/single', ['jquery', './base', '../utils', '../keys'], function ($, BaseSelection, Utils, KEYS) {
4120 function SingleSelection() {
4121 SingleSelection.__super__.constructor.apply(this, arguments);
4122 }
4123
4124 Utils.Extend(SingleSelection, BaseSelection);
4125
4126 SingleSelection.prototype.render = function () {
4127 var $selection = SingleSelection.__super__.render.call(this);
4128
4129 $selection[0].classList.add('select2-selection--single'); // Assign SUI icon to select button. @edited
4130
4131 $selection.html('<span class="select2-selection__rendered"></span>' + '<span class="select2-selection__arrow" role="presentation">' + '<span class="sui-icon-chevron-down sui-sm" aria-hidden="true"></span>' + '</span>');
4132 return $selection;
4133 };
4134
4135 SingleSelection.prototype.bind = function (container, $container) {
4136 var self = this;
4137
4138 SingleSelection.__super__.bind.apply(this, arguments);
4139
4140 var id = container.id + '-container';
4141 this.$selection.find('.select2-selection__rendered').attr('id', id).attr('role', 'textbox').attr('aria-readonly', 'true');
4142 this.$selection.attr('aria-labelledby', id);
4143 this.$selection.attr('aria-controls', id);
4144 this.$selection.on('mousedown', function (evt) {
4145 // Only respond to left clicks
4146 if (evt.which !== 1) {
4147 return;
4148 }
4149
4150 self.trigger('toggle', {
4151 originalEvent: evt
4152 });
4153 });
4154 this.$selection.on('focus', function (evt) {// User focuses on the container
4155 });
4156 this.$selection.on('blur', function (evt) {// User exits the container
4157 });
4158 container.on('focus', function (evt) {
4159 if (!container.isOpen()) {
4160 self.$selection.trigger('focus');
4161 }
4162 });
4163 };
4164
4165 SingleSelection.prototype.clear = function () {
4166 var $rendered = this.$selection.find('.select2-selection__rendered');
4167 $rendered.empty();
4168 $rendered.removeAttr('title'); // clear tooltip on empty
4169 };
4170
4171 SingleSelection.prototype.display = function (data, container) {
4172 var template = this.options.get('templateSelection');
4173 var escapeMarkup = this.options.get('escapeMarkup');
4174 return escapeMarkup(template(data, container));
4175 };
4176
4177 SingleSelection.prototype.selectionContainer = function () {
4178 return $('<span></span>');
4179 };
4180
4181 SingleSelection.prototype.update = function (data) {
4182 // Add icon when variables is empty. @edited
4183 if (data.length === 0) {
4184 this.clear();
4185
4186 if ('vars' === this.options.get('theme')) {
4187 this.$selection.find('.select2-selection__rendered').html('<span class="sui-icon-plus-circle sui-md" aria-hidden="true"></span>');
4188 }
4189
4190 return;
4191 }
4192
4193 var selection = data[0];
4194 var $rendered = this.$selection.find('.select2-selection__rendered');
4195 var formatted = this.display(selection, $rendered);
4196 $rendered.empty().append(formatted);
4197 var title = selection.title || selection.text;
4198
4199 if (title) {
4200 $rendered.attr('title', title);
4201 } else {
4202 $rendered.removeAttr('title');
4203 }
4204 };
4205
4206 return SingleSelection;
4207 });
4208 S2.define('select2/selection/multiple', ['jquery', './base', '../utils'], function ($, BaseSelection, Utils) {
4209 function MultipleSelection($element, options) {
4210 MultipleSelection.__super__.constructor.apply(this, arguments);
4211 }
4212
4213 Utils.Extend(MultipleSelection, BaseSelection);
4214
4215 MultipleSelection.prototype.render = function () {
4216 var $selection = MultipleSelection.__super__.render.call(this);
4217
4218 $selection[0].classList.add('select2-selection--multiple');
4219 $selection.html('<ul class="select2-selection__rendered"></ul>');
4220 return $selection;
4221 };
4222
4223 MultipleSelection.prototype.bind = function (container, $container) {
4224 var self = this;
4225
4226 MultipleSelection.__super__.bind.apply(this, arguments);
4227
4228 var id = container.id + '-container';
4229 this.$selection.find('.select2-selection__rendered').attr('id', id);
4230 this.$selection.on('click', function (evt) {
4231 self.trigger('toggle', {
4232 originalEvent: evt
4233 });
4234 });
4235 this.$selection.on('click', '.sui-button-icon', function (evt) {
4236 // Ignore the event if it is disabled
4237 if (self.isDisabled()) {
4238 return;
4239 }
4240
4241 var $remove = $(this);
4242 var $selection = $remove.parent();
4243 var data = Utils.GetData($selection[0], 'data');
4244 self.trigger('unselect', {
4245 originalEvent: evt,
4246 data: data
4247 });
4248 });
4249 this.$selection.on('keydown', '.sui-button-icon', function (evt) {
4250 // Ignore the event if it is disabled
4251 if (self.isDisabled()) {
4252 return;
4253 }
4254
4255 evt.stopPropagation();
4256 });
4257 };
4258
4259 MultipleSelection.prototype.clear = function () {
4260 var $rendered = this.$selection.find('.select2-selection__rendered');
4261 $rendered.empty();
4262 $rendered.removeAttr('title');
4263 $rendered.removeClass('has-option-selected');
4264 };
4265
4266 MultipleSelection.prototype.display = function (data, container) {
4267 var template = this.options.get('templateSelection');
4268 var escapeMarkup = this.options.get('escapeMarkup');
4269 return escapeMarkup(template(data, container));
4270 };
4271
4272 MultipleSelection.prototype.selectionContainer = function () {
4273 var $container = $('<li class="select2-selection__choice">' + '<span class="select2-selection__choice__display"></span>' + '<button type="button" class="sui-button-icon" ' + 'tabindex="-1">' + '<span class="sui-icon-close sui-sm" aria-hidden="true"></span>' + '</button>' + '</li>');
4274 return $container;
4275 };
4276
4277 MultipleSelection.prototype.update = function (data) {
4278 this.clear();
4279
4280 if (data.length === 0) {
4281 return;
4282 }
4283
4284 var $selections = [];
4285 var selectionIdPrefix = this.$selection.find('.select2-selection__rendered').attr('id') + '-choice-';
4286
4287 for (var d = 0; d < data.length; d++) {
4288 var selection = data[d];
4289 var $selection = this.selectionContainer();
4290 var formatted = this.display(selection, $selection);
4291 var selectionId = selectionIdPrefix + Utils.generateChars(4) + '-';
4292
4293 if (selection.id) {
4294 selectionId += selection.id;
4295 } else {
4296 selectionId += Utils.generateChars(4);
4297 }
4298
4299 $selection.find('.select2-selection__choice__display').append(formatted).attr('id', selectionId);
4300 var title = selection.title || selection.text;
4301
4302 if (title) {
4303 $selection.attr('title', title);
4304 }
4305
4306 var removeItem = this.options.get('translations').get('removeItem');
4307 var $remove = $selection.find('.sui-button-icon');
4308 $remove.attr('title', removeItem());
4309 $remove.attr('aria-label', removeItem());
4310 $remove.attr('aria-describedby', selectionId);
4311 Utils.StoreData($selection[0], 'data', selection);
4312 $selections.push($selection);
4313 }
4314
4315 var $rendered = this.$selection.find('.select2-selection__rendered');
4316 $rendered.append($selections).addClass('has-option-selected');
4317 };
4318
4319 return MultipleSelection;
4320 });
4321 S2.define('select2/selection/placeholder', [], function () {
4322 function Placeholder(decorated, $element, options) {
4323 this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4324 decorated.call(this, $element, options);
4325 }
4326
4327 Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
4328 if (typeof placeholder === 'string') {
4329 placeholder = {
4330 id: '',
4331 text: placeholder
4332 };
4333 }
4334
4335 return placeholder;
4336 };
4337
4338 Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
4339 var $placeholder = this.selectionContainer();
4340 $placeholder.html(this.display(placeholder));
4341 $placeholder[0].classList.add('select2-selection__placeholder');
4342 $placeholder[0].classList.remove('select2-selection__choice');
4343 var placeholderTitle = placeholder.title || placeholder.text || $placeholder.text();
4344 this.$selection.find('.select2-selection__rendered').attr('title', placeholderTitle);
4345 return $placeholder;
4346 };
4347
4348 Placeholder.prototype.update = function (decorated, data) {
4349 var singlePlaceholder = data.length == 1 && data[0].id != this.placeholder.id;
4350 var multipleSelections = data.length > 1;
4351
4352 if (multipleSelections || singlePlaceholder) {
4353 return decorated.call(this, data);
4354 }
4355
4356 this.clear();
4357 var $placeholder = this.createPlaceholder(this.placeholder);
4358 this.$selection.find('.select2-selection__rendered').append($placeholder);
4359 };
4360
4361 return Placeholder;
4362 });
4363 S2.define('select2/selection/allowClear', ['jquery', '../keys', '../utils'], function ($, KEYS, Utils) {
4364 function AllowClear() {}
4365
4366 AllowClear.prototype.bind = function (decorated, container, $container) {
4367 var self = this;
4368 decorated.call(this, container, $container);
4369
4370 if (this.placeholder == null) {
4371 if (this.options.get('debug') && window.console && console.error) {
4372 console.error('Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.');
4373 }
4374 }
4375
4376 this.$selection.on('mousedown', '.select2-selection__clear', function (evt) {
4377 self._handleClear(evt);
4378 });
4379 container.on('keypress', function (evt) {
4380 self._handleKeyboardClear(evt, container);
4381 });
4382 };
4383
4384 AllowClear.prototype._handleClear = function (_, evt) {
4385 // Ignore the event if it is disabled
4386 if (this.isDisabled()) {
4387 return;
4388 }
4389
4390 var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected
4391
4392 if ($clear.length === 0) {
4393 return;
4394 }
4395
4396 evt.stopPropagation();
4397 var data = Utils.GetData($clear[0], 'data');
4398 var previousVal = this.$element.val();
4399 this.$element.val(this.placeholder.id);
4400 var unselectData = {
4401 data: data
4402 };
4403 this.trigger('clear', unselectData);
4404
4405 if (unselectData.prevented) {
4406 this.$element.val(previousVal);
4407 return;
4408 }
4409
4410 for (var d = 0; d < data.length; d++) {
4411 unselectData = {
4412 data: data[d]
4413 }; // Trigger the `unselect` event, so people can prevent it from being
4414 // cleared.
4415
4416 this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out.
4417
4418 if (unselectData.prevented) {
4419 this.$element.val(previousVal);
4420 return;
4421 }
4422 }
4423
4424 this.$element.trigger('input').trigger('change');
4425 this.trigger('toggle', {});
4426 };
4427
4428 AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
4429 if (container.isOpen()) {
4430 return;
4431 }
4432
4433 if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
4434 this._handleClear(evt);
4435 }
4436 };
4437
4438 AllowClear.prototype.update = function (decorated, data) {
4439 decorated.call(this, data);
4440 this.$selection.find('.select2-selection__clear').remove();
4441 this.$selection[0].classList.remove('select2-selection--clearable');
4442
4443 if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) {
4444 return;
4445 }
4446
4447 var selectionId = this.$selection.find('.select2-selection__rendered').attr('id');
4448 var removeAll = this.options.get('translations').get('removeAllItems');
4449 var $remove = $('<button type="button" class="select2-selection__clear" tabindex="-1">' + '<span aria-hidden="true">&times;</span>' + '</button>');
4450 $remove.attr('title', removeAll());
4451 $remove.attr('aria-label', removeAll());
4452 $remove.attr('aria-describedby', selectionId);
4453 Utils.StoreData($remove[0], 'data', data);
4454 this.$selection.prepend($remove);
4455 this.$selection[0].classList.add('select2-selection--clearable');
4456 };
4457
4458 return AllowClear;
4459 });
4460 S2.define('select2/selection/search', ['jquery', '../utils', '../keys'], function ($, Utils, KEYS) {
4461 function Search(decorated, $element, options) {
4462 decorated.call(this, $element, options);
4463 }
4464
4465 Search.prototype.render = function (decorated) {
4466 var searchLabel = this.options.get('translations').get('search');
4467 var $search = $('<span class="select2-search select2-search--inline">' + '<textarea class="select2-search__field"' + ' type="search" tabindex="-1"' + ' autocorrect="off" autocapitalize="none"' + ' spellcheck="false" role="searchbox" aria-autocomplete="list" >' + '</textarea>' + '</span>');
4468 this.$searchContainer = $search;
4469 this.$search = $search.find('textarea');
4470 this.$search.prop('autocomplete', this.options.get('autocomplete'));
4471 this.$search.attr('aria-label', searchLabel());
4472 var $rendered = decorated.call(this);
4473
4474 this._transferTabIndex();
4475
4476 $rendered.append(this.$searchContainer);
4477 return $rendered;
4478 };
4479
4480 Search.prototype.bind = function (decorated, container, $container) {
4481 var self = this;
4482 var resultsId = container.id + '-results';
4483 var selectionId = container.id + '-container';
4484 decorated.call(this, container, $container);
4485 self.$search.attr('aria-describedby', selectionId);
4486 container.on('open', function () {
4487 self.$search.attr('aria-controls', resultsId);
4488 self.$search.trigger('focus');
4489 });
4490 container.on('close', function () {
4491 self.$search.val('');
4492 self.resizeSearch();
4493 self.$search.removeAttr('aria-controls');
4494 self.$search.removeAttr('aria-activedescendant');
4495 self.$search.trigger('focus');
4496 });
4497 container.on('enable', function () {
4498 self.$search.prop('disabled', false);
4499
4500 self._transferTabIndex();
4501 });
4502 container.on('disable', function () {
4503 self.$search.prop('disabled', true);
4504 });
4505 container.on('focus', function (evt) {
4506 self.$search.trigger('focus');
4507 });
4508 container.on('results:focus', function (params) {
4509 if (params.data._resultId) {
4510 self.$search.attr('aria-activedescendant', params.data._resultId);
4511 } else {
4512 self.$search.removeAttr('aria-activedescendant');
4513 }
4514 });
4515 this.$selection.on('focusin', '.select2-search--inline', function (evt) {
4516 self.trigger('focus', evt);
4517 });
4518 this.$selection.on('focusout', '.select2-search--inline', function (evt) {
4519 self._handleBlur(evt);
4520 });
4521 this.$selection.on('keydown', '.select2-search--inline', function (evt) {
4522 evt.stopPropagation();
4523 self.trigger('keypress', evt);
4524 self._keyUpPrevented = evt.isDefaultPrevented();
4525 var key = evt.which;
4526
4527 if (key === KEYS.BACKSPACE && self.$search.val() === '') {
4528 var $previousChoice = self.$selection.find('.select2-selection__choice').last();
4529
4530 if ($previousChoice.length > 0) {
4531 var item = Utils.GetData($previousChoice[0], 'data');
4532 self.searchRemoveChoice(item);
4533 evt.preventDefault();
4534 }
4535 }
4536 });
4537 this.$selection.on('click', '.select2-search--inline', function (evt) {
4538 if (self.$search.val()) {
4539 evt.stopPropagation();
4540 }
4541 }); // Try to detect the IE version should the `documentMode` property that
4542 // is stored on the document. This is only implemented in IE and is
4543 // slightly cleaner than doing a user agent check.
4544 // This property is not available in Edge, but Edge also doesn't have
4545 // this bug.
4546
4547 var msie = document.documentMode;
4548 var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event
4549 // This will prevent double-triggering of events for browsers which support
4550 // both the `keyup` and `input` events.
4551
4552 this.$selection.on('input.searchcheck', '.select2-search--inline', function (evt) {
4553 // IE will trigger the `input` event when a placeholder is used on a
4554 // search box. To get around this issue, we are forced to ignore all
4555 // `input` events in IE and keep using `keyup`.
4556 if (disableInputEvents) {
4557 self.$selection.off('input.search input.searchcheck');
4558 return;
4559 } // Unbind the duplicated `keyup` event
4560
4561
4562 self.$selection.off('keyup.search');
4563 });
4564 this.$selection.on('keyup.search input.search', '.select2-search--inline', function (evt) {
4565 // IE will trigger the `input` event when a placeholder is used on a
4566 // search box. To get around this issue, we are forced to ignore all
4567 // `input` events in IE and keep using `keyup`.
4568 if (disableInputEvents && evt.type === 'input') {
4569 self.$selection.off('input.search input.searchcheck');
4570 return;
4571 }
4572
4573 var key = evt.which; // We can freely ignore events from modifier keys
4574
4575 if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
4576 return;
4577 } // Tabbing will be handled during the `keydown` phase
4578
4579
4580 if (key == KEYS.TAB) {
4581 return;
4582 }
4583
4584 self.handleSearch(evt);
4585 });
4586 };
4587 /**
4588 * This method will transfer the tabindex attribute from the rendered
4589 * selection to the search box. This allows for the search box to be used as
4590 * the primary focus instead of the selection container.
4591 *
4592 * @private
4593 */
4594
4595
4596 Search.prototype._transferTabIndex = function (decorated) {
4597 this.$search.attr('tabindex', this.$selection.attr('tabindex'));
4598 this.$selection.attr('tabindex', '-1');
4599 };
4600
4601 Search.prototype.createPlaceholder = function (decorated, placeholder) {
4602 this.$search.attr('placeholder', placeholder.text);
4603 };
4604
4605 Search.prototype.update = function (decorated, data) {
4606 var searchHadFocus = this.$search[0] == document.activeElement;
4607 this.$search.attr('placeholder', '');
4608 decorated.call(this, data);
4609 this.resizeSearch();
4610
4611 if (searchHadFocus) {
4612 this.$search.trigger('focus');
4613 }
4614 };
4615
4616 Search.prototype.handleSearch = function () {
4617 this.resizeSearch();
4618
4619 if (!this._keyUpPrevented) {
4620 var input = this.$search.val();
4621 this.trigger('query', {
4622 term: input
4623 });
4624 }
4625
4626 this._keyUpPrevented = false;
4627 };
4628
4629 Search.prototype.searchRemoveChoice = function (decorated, item) {
4630 this.trigger('unselect', {
4631 data: item
4632 });
4633 this.$search.val(item.text);
4634 this.handleSearch();
4635 };
4636
4637 Search.prototype.resizeSearch = function () {
4638 this.$search.css('width', '25px');
4639 var width = '100%';
4640
4641 if (this.$search.attr('placeholder') === '') {
4642 var minimumWidth = this.$search.val().length + 1;
4643 width = minimumWidth * 0.75 + 'em';
4644 }
4645
4646 this.$search.css('width', width);
4647 };
4648
4649 return Search;
4650 });
4651 S2.define('select2/selection/selectionCss', ['../utils'], function (Utils) {
4652 function SelectionCSS() {}
4653
4654 SelectionCSS.prototype.render = function (decorated) {
4655 var $selection = decorated.call(this);
4656 var selectionCssClass = this.options.get('selectionCssClass') || '';
4657
4658 if (selectionCssClass.indexOf(':all:') !== -1) {
4659 selectionCssClass = selectionCssClass.replace(':all:', '');
4660 Utils.copyNonInternalCssClasses($selection[0], this.$element[0]);
4661 }
4662
4663 $selection.addClass(selectionCssClass);
4664 return $selection;
4665 };
4666
4667 return SelectionCSS;
4668 });
4669 S2.define('select2/selection/eventRelay', ['jquery'], function ($) {
4670 function EventRelay() {}
4671
4672 EventRelay.prototype.bind = function (decorated, container, $container) {
4673 var self = this;
4674 var relayEvents = ['open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting', 'clear', 'clearing'];
4675 var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting', 'clearing'];
4676 decorated.call(this, container, $container);
4677 container.on('*', function (name, params) {
4678 // Ignore events that should not be relayed
4679 if (relayEvents.indexOf(name) === -1) {
4680 return;
4681 } // The parameters should always be an object
4682
4683
4684 params = params || {}; // Generate the jQuery event for the Select2 event
4685
4686 var evt = $.Event('select2:' + name, {
4687 params: params
4688 });
4689 self.$element.trigger(evt); // Only handle preventable events if it was one
4690
4691 if (preventableEvents.indexOf(name) === -1) {
4692 return;
4693 }
4694
4695 params.prevented = evt.isDefaultPrevented();
4696 });
4697 };
4698
4699 return EventRelay;
4700 });
4701 S2.define('select2/translation', ['jquery', 'require'], function ($, require) {
4702 function Translation(dict) {
4703 this.dict = dict || {};
4704 }
4705
4706 Translation.prototype.all = function () {
4707 return this.dict;
4708 };
4709
4710 Translation.prototype.get = function (key) {
4711 return this.dict[key];
4712 };
4713
4714 Translation.prototype.extend = function (translation) {
4715 this.dict = $.extend({}, translation.all(), this.dict);
4716 }; // Static functions
4717
4718
4719 Translation._cache = {};
4720
4721 Translation.loadPath = function (path) {
4722 if (!(path in Translation._cache)) {
4723 var translations = require(path);
4724
4725 Translation._cache[path] = translations;
4726 }
4727
4728 return new Translation(Translation._cache[path]);
4729 };
4730
4731 return Translation;
4732 });
4733 S2.define('select2/diacritics', [], function () {
4734 var diacritics = {
4735 "\u24B6": 'A',
4736 "\uFF21": 'A',
4737 "\xC0": 'A',
4738 "\xC1": 'A',
4739 "\xC2": 'A',
4740 "\u1EA6": 'A',
4741 "\u1EA4": 'A',
4742 "\u1EAA": 'A',
4743 "\u1EA8": 'A',
4744 "\xC3": 'A',
4745 "\u0100": 'A',
4746 "\u0102": 'A',
4747 "\u1EB0": 'A',
4748 "\u1EAE": 'A',
4749 "\u1EB4": 'A',
4750 "\u1EB2": 'A',
4751 "\u0226": 'A',
4752 "\u01E0": 'A',
4753 "\xC4": 'A',
4754 "\u01DE": 'A',
4755 "\u1EA2": 'A',
4756 "\xC5": 'A',
4757 "\u01FA": 'A',
4758 "\u01CD": 'A',
4759 "\u0200": 'A',
4760 "\u0202": 'A',
4761 "\u1EA0": 'A',
4762 "\u1EAC": 'A',
4763 "\u1EB6": 'A',
4764 "\u1E00": 'A',
4765 "\u0104": 'A',
4766 "\u023A": 'A',
4767 "\u2C6F": 'A',
4768 "\uA732": 'AA',
4769 "\xC6": 'AE',
4770 "\u01FC": 'AE',
4771 "\u01E2": 'AE',
4772 "\uA734": 'AO',
4773 "\uA736": 'AU',
4774 "\uA738": 'AV',
4775 "\uA73A": 'AV',
4776 "\uA73C": 'AY',
4777 "\u24B7": 'B',
4778 "\uFF22": 'B',
4779 "\u1E02": 'B',
4780 "\u1E04": 'B',
4781 "\u1E06": 'B',
4782 "\u0243": 'B',
4783 "\u0182": 'B',
4784 "\u0181": 'B',
4785 "\u24B8": 'C',
4786 "\uFF23": 'C',
4787 "\u0106": 'C',
4788 "\u0108": 'C',
4789 "\u010A": 'C',
4790 "\u010C": 'C',
4791 "\xC7": 'C',
4792 "\u1E08": 'C',
4793 "\u0187": 'C',
4794 "\u023B": 'C',
4795 "\uA73E": 'C',
4796 "\u24B9": 'D',
4797 "\uFF24": 'D',
4798 "\u1E0A": 'D',
4799 "\u010E": 'D',
4800 "\u1E0C": 'D',
4801 "\u1E10": 'D',
4802 "\u1E12": 'D',
4803 "\u1E0E": 'D',
4804 "\u0110": 'D',
4805 "\u018B": 'D',
4806 "\u018A": 'D',
4807 "\u0189": 'D',
4808 "\uA779": 'D',
4809 "\u01F1": 'DZ',
4810 "\u01C4": 'DZ',
4811 "\u01F2": 'Dz',
4812 "\u01C5": 'Dz',
4813 "\u24BA": 'E',
4814 "\uFF25": 'E',
4815 "\xC8": 'E',
4816 "\xC9": 'E',
4817 "\xCA": 'E',
4818 "\u1EC0": 'E',
4819 "\u1EBE": 'E',
4820 "\u1EC4": 'E',
4821 "\u1EC2": 'E',
4822 "\u1EBC": 'E',
4823 "\u0112": 'E',
4824 "\u1E14": 'E',
4825 "\u1E16": 'E',
4826 "\u0114": 'E',
4827 "\u0116": 'E',
4828 "\xCB": 'E',
4829 "\u1EBA": 'E',
4830 "\u011A": 'E',
4831 "\u0204": 'E',
4832 "\u0206": 'E',
4833 "\u1EB8": 'E',
4834 "\u1EC6": 'E',
4835 "\u0228": 'E',
4836 "\u1E1C": 'E',
4837 "\u0118": 'E',
4838 "\u1E18": 'E',
4839 "\u1E1A": 'E',
4840 "\u0190": 'E',
4841 "\u018E": 'E',
4842 "\u24BB": 'F',
4843 "\uFF26": 'F',
4844 "\u1E1E": 'F',
4845 "\u0191": 'F',
4846 "\uA77B": 'F',
4847 "\u24BC": 'G',
4848 "\uFF27": 'G',
4849 "\u01F4": 'G',
4850 "\u011C": 'G',
4851 "\u1E20": 'G',
4852 "\u011E": 'G',
4853 "\u0120": 'G',
4854 "\u01E6": 'G',
4855 "\u0122": 'G',
4856 "\u01E4": 'G',
4857 "\u0193": 'G',
4858 "\uA7A0": 'G',
4859 "\uA77D": 'G',
4860 "\uA77E": 'G',
4861 "\u24BD": 'H',
4862 "\uFF28": 'H',
4863 "\u0124": 'H',
4864 "\u1E22": 'H',
4865 "\u1E26": 'H',
4866 "\u021E": 'H',
4867 "\u1E24": 'H',
4868 "\u1E28": 'H',
4869 "\u1E2A": 'H',
4870 "\u0126": 'H',
4871 "\u2C67": 'H',
4872 "\u2C75": 'H',
4873 "\uA78D": 'H',
4874 "\u24BE": 'I',
4875 "\uFF29": 'I',
4876 "\xCC": 'I',
4877 "\xCD": 'I',
4878 "\xCE": 'I',
4879 "\u0128": 'I',
4880 "\u012A": 'I',
4881 "\u012C": 'I',
4882 "\u0130": 'I',
4883 "\xCF": 'I',
4884 "\u1E2E": 'I',
4885 "\u1EC8": 'I',
4886 "\u01CF": 'I',
4887 "\u0208": 'I',
4888 "\u020A": 'I',
4889 "\u1ECA": 'I',
4890 "\u012E": 'I',
4891 "\u1E2C": 'I',
4892 "\u0197": 'I',
4893 "\u24BF": 'J',
4894 "\uFF2A": 'J',
4895 "\u0134": 'J',
4896 "\u0248": 'J',
4897 "\u24C0": 'K',
4898 "\uFF2B": 'K',
4899 "\u1E30": 'K',
4900 "\u01E8": 'K',
4901 "\u1E32": 'K',
4902 "\u0136": 'K',
4903 "\u1E34": 'K',
4904 "\u0198": 'K',
4905 "\u2C69": 'K',
4906 "\uA740": 'K',
4907 "\uA742": 'K',
4908 "\uA744": 'K',
4909 "\uA7A2": 'K',
4910 "\u24C1": 'L',
4911 "\uFF2C": 'L',
4912 "\u013F": 'L',
4913 "\u0139": 'L',
4914 "\u013D": 'L',
4915 "\u1E36": 'L',
4916 "\u1E38": 'L',
4917 "\u013B": 'L',
4918 "\u1E3C": 'L',
4919 "\u1E3A": 'L',
4920 "\u0141": 'L',
4921 "\u023D": 'L',
4922 "\u2C62": 'L',
4923 "\u2C60": 'L',
4924 "\uA748": 'L',
4925 "\uA746": 'L',
4926 "\uA780": 'L',
4927 "\u01C7": 'LJ',
4928 "\u01C8": 'Lj',
4929 "\u24C2": 'M',
4930 "\uFF2D": 'M',
4931 "\u1E3E": 'M',
4932 "\u1E40": 'M',
4933 "\u1E42": 'M',
4934 "\u2C6E": 'M',
4935 "\u019C": 'M',
4936 "\u24C3": 'N',
4937 "\uFF2E": 'N',
4938 "\u01F8": 'N',
4939 "\u0143": 'N',
4940 "\xD1": 'N',
4941 "\u1E44": 'N',
4942 "\u0147": 'N',
4943 "\u1E46": 'N',
4944 "\u0145": 'N',
4945 "\u1E4A": 'N',
4946 "\u1E48": 'N',
4947 "\u0220": 'N',
4948 "\u019D": 'N',
4949 "\uA790": 'N',
4950 "\uA7A4": 'N',
4951 "\u01CA": 'NJ',
4952 "\u01CB": 'Nj',
4953 "\u24C4": 'O',
4954 "\uFF2F": 'O',
4955 "\xD2": 'O',
4956 "\xD3": 'O',
4957 "\xD4": 'O',
4958 "\u1ED2": 'O',
4959 "\u1ED0": 'O',
4960 "\u1ED6": 'O',
4961 "\u1ED4": 'O',
4962 "\xD5": 'O',
4963 "\u1E4C": 'O',
4964 "\u022C": 'O',
4965 "\u1E4E": 'O',
4966 "\u014C": 'O',
4967 "\u1E50": 'O',
4968 "\u1E52": 'O',
4969 "\u014E": 'O',
4970 "\u022E": 'O',
4971 "\u0230": 'O',
4972 "\xD6": 'O',
4973 "\u022A": 'O',
4974 "\u1ECE": 'O',
4975 "\u0150": 'O',
4976 "\u01D1": 'O',
4977 "\u020C": 'O',
4978 "\u020E": 'O',
4979 "\u01A0": 'O',
4980 "\u1EDC": 'O',
4981 "\u1EDA": 'O',
4982 "\u1EE0": 'O',
4983 "\u1EDE": 'O',
4984 "\u1EE2": 'O',
4985 "\u1ECC": 'O',
4986 "\u1ED8": 'O',
4987 "\u01EA": 'O',
4988 "\u01EC": 'O',
4989 "\xD8": 'O',
4990 "\u01FE": 'O',
4991 "\u0186": 'O',
4992 "\u019F": 'O',
4993 "\uA74A": 'O',
4994 "\uA74C": 'O',
4995 "\u0152": 'OE',
4996 "\u01A2": 'OI',
4997 "\uA74E": 'OO',
4998 "\u0222": 'OU',
4999 "\u24C5": 'P',
5000 "\uFF30": 'P',
5001 "\u1E54": 'P',
5002 "\u1E56": 'P',
5003 "\u01A4": 'P',
5004 "\u2C63": 'P',
5005 "\uA750": 'P',
5006 "\uA752": 'P',
5007 "\uA754": 'P',
5008 "\u24C6": 'Q',
5009 "\uFF31": 'Q',
5010 "\uA756": 'Q',
5011 "\uA758": 'Q',
5012 "\u024A": 'Q',
5013 "\u24C7": 'R',
5014 "\uFF32": 'R',
5015 "\u0154": 'R',
5016 "\u1E58": 'R',
5017 "\u0158": 'R',
5018 "\u0210": 'R',
5019 "\u0212": 'R',
5020 "\u1E5A": 'R',
5021 "\u1E5C": 'R',
5022 "\u0156": 'R',
5023 "\u1E5E": 'R',
5024 "\u024C": 'R',
5025 "\u2C64": 'R',
5026 "\uA75A": 'R',
5027 "\uA7A6": 'R',
5028 "\uA782": 'R',
5029 "\u24C8": 'S',
5030 "\uFF33": 'S',
5031 "\u1E9E": 'S',
5032 "\u015A": 'S',
5033 "\u1E64": 'S',
5034 "\u015C": 'S',
5035 "\u1E60": 'S',
5036 "\u0160": 'S',
5037 "\u1E66": 'S',
5038 "\u1E62": 'S',
5039 "\u1E68": 'S',
5040 "\u0218": 'S',
5041 "\u015E": 'S',
5042 "\u2C7E": 'S',
5043 "\uA7A8": 'S',
5044 "\uA784": 'S',
5045 "\u24C9": 'T',
5046 "\uFF34": 'T',
5047 "\u1E6A": 'T',
5048 "\u0164": 'T',
5049 "\u1E6C": 'T',
5050 "\u021A": 'T',
5051 "\u0162": 'T',
5052 "\u1E70": 'T',
5053 "\u1E6E": 'T',
5054 "\u0166": 'T',
5055 "\u01AC": 'T',
5056 "\u01AE": 'T',
5057 "\u023E": 'T',
5058 "\uA786": 'T',
5059 "\uA728": 'TZ',
5060 "\u24CA": 'U',
5061 "\uFF35": 'U',
5062 "\xD9": 'U',
5063 "\xDA": 'U',
5064 "\xDB": 'U',
5065 "\u0168": 'U',
5066 "\u1E78": 'U',
5067 "\u016A": 'U',
5068 "\u1E7A": 'U',
5069 "\u016C": 'U',
5070 "\xDC": 'U',
5071 "\u01DB": 'U',
5072 "\u01D7": 'U',
5073 "\u01D5": 'U',
5074 "\u01D9": 'U',
5075 "\u1EE6": 'U',
5076 "\u016E": 'U',
5077 "\u0170": 'U',
5078 "\u01D3": 'U',
5079 "\u0214": 'U',
5080 "\u0216": 'U',
5081 "\u01AF": 'U',
5082 "\u1EEA": 'U',
5083 "\u1EE8": 'U',
5084 "\u1EEE": 'U',
5085 "\u1EEC": 'U',
5086 "\u1EF0": 'U',
5087 "\u1EE4": 'U',
5088 "\u1E72": 'U',
5089 "\u0172": 'U',
5090 "\u1E76": 'U',
5091 "\u1E74": 'U',
5092 "\u0244": 'U',
5093 "\u24CB": 'V',
5094 "\uFF36": 'V',
5095 "\u1E7C": 'V',
5096 "\u1E7E": 'V',
5097 "\u01B2": 'V',
5098 "\uA75E": 'V',
5099 "\u0245": 'V',
5100 "\uA760": 'VY',
5101 "\u24CC": 'W',
5102 "\uFF37": 'W',
5103 "\u1E80": 'W',
5104 "\u1E82": 'W',
5105 "\u0174": 'W',
5106 "\u1E86": 'W',
5107 "\u1E84": 'W',
5108 "\u1E88": 'W',
5109 "\u2C72": 'W',
5110 "\u24CD": 'X',
5111 "\uFF38": 'X',
5112 "\u1E8A": 'X',
5113 "\u1E8C": 'X',
5114 "\u24CE": 'Y',
5115 "\uFF39": 'Y',
5116 "\u1EF2": 'Y',
5117 "\xDD": 'Y',
5118 "\u0176": 'Y',
5119 "\u1EF8": 'Y',
5120 "\u0232": 'Y',
5121 "\u1E8E": 'Y',
5122 "\u0178": 'Y',
5123 "\u1EF6": 'Y',
5124 "\u1EF4": 'Y',
5125 "\u01B3": 'Y',
5126 "\u024E": 'Y',
5127 "\u1EFE": 'Y',
5128 "\u24CF": 'Z',
5129 "\uFF3A": 'Z',
5130 "\u0179": 'Z',
5131 "\u1E90": 'Z',
5132 "\u017B": 'Z',
5133 "\u017D": 'Z',
5134 "\u1E92": 'Z',
5135 "\u1E94": 'Z',
5136 "\u01B5": 'Z',
5137 "\u0224": 'Z',
5138 "\u2C7F": 'Z',
5139 "\u2C6B": 'Z',
5140 "\uA762": 'Z',
5141 "\u24D0": 'a',
5142 "\uFF41": 'a',
5143 "\u1E9A": 'a',
5144 "\xE0": 'a',
5145 "\xE1": 'a',
5146 "\xE2": 'a',
5147 "\u1EA7": 'a',
5148 "\u1EA5": 'a',
5149 "\u1EAB": 'a',
5150 "\u1EA9": 'a',
5151 "\xE3": 'a',
5152 "\u0101": 'a',
5153 "\u0103": 'a',
5154 "\u1EB1": 'a',
5155 "\u1EAF": 'a',
5156 "\u1EB5": 'a',
5157 "\u1EB3": 'a',
5158 "\u0227": 'a',
5159 "\u01E1": 'a',
5160 "\xE4": 'a',
5161 "\u01DF": 'a',
5162 "\u1EA3": 'a',
5163 "\xE5": 'a',
5164 "\u01FB": 'a',
5165 "\u01CE": 'a',
5166 "\u0201": 'a',
5167 "\u0203": 'a',
5168 "\u1EA1": 'a',
5169 "\u1EAD": 'a',
5170 "\u1EB7": 'a',
5171 "\u1E01": 'a',
5172 "\u0105": 'a',
5173 "\u2C65": 'a',
5174 "\u0250": 'a',
5175 "\uA733": 'aa',
5176 "\xE6": 'ae',
5177 "\u01FD": 'ae',
5178 "\u01E3": 'ae',
5179 "\uA735": 'ao',
5180 "\uA737": 'au',
5181 "\uA739": 'av',
5182 "\uA73B": 'av',
5183 "\uA73D": 'ay',
5184 "\u24D1": 'b',
5185 "\uFF42": 'b',
5186 "\u1E03": 'b',
5187 "\u1E05": 'b',
5188 "\u1E07": 'b',
5189 "\u0180": 'b',
5190 "\u0183": 'b',
5191 "\u0253": 'b',
5192 "\u24D2": 'c',
5193 "\uFF43": 'c',
5194 "\u0107": 'c',
5195 "\u0109": 'c',
5196 "\u010B": 'c',
5197 "\u010D": 'c',
5198 "\xE7": 'c',
5199 "\u1E09": 'c',
5200 "\u0188": 'c',
5201 "\u023C": 'c',
5202 "\uA73F": 'c',
5203 "\u2184": 'c',
5204 "\u24D3": 'd',
5205 "\uFF44": 'd',
5206 "\u1E0B": 'd',
5207 "\u010F": 'd',
5208 "\u1E0D": 'd',
5209 "\u1E11": 'd',
5210 "\u1E13": 'd',
5211 "\u1E0F": 'd',
5212 "\u0111": 'd',
5213 "\u018C": 'd',
5214 "\u0256": 'd',
5215 "\u0257": 'd',
5216 "\uA77A": 'd',
5217 "\u01F3": 'dz',
5218 "\u01C6": 'dz',
5219 "\u24D4": 'e',
5220 "\uFF45": 'e',
5221 "\xE8": 'e',
5222 "\xE9": 'e',
5223 "\xEA": 'e',
5224 "\u1EC1": 'e',
5225 "\u1EBF": 'e',
5226 "\u1EC5": 'e',
5227 "\u1EC3": 'e',
5228 "\u1EBD": 'e',
5229 "\u0113": 'e',
5230 "\u1E15": 'e',
5231 "\u1E17": 'e',
5232 "\u0115": 'e',
5233 "\u0117": 'e',
5234 "\xEB": 'e',
5235 "\u1EBB": 'e',
5236 "\u011B": 'e',
5237 "\u0205": 'e',
5238 "\u0207": 'e',
5239 "\u1EB9": 'e',
5240 "\u1EC7": 'e',
5241 "\u0229": 'e',
5242 "\u1E1D": 'e',
5243 "\u0119": 'e',
5244 "\u1E19": 'e',
5245 "\u1E1B": 'e',
5246 "\u0247": 'e',
5247 "\u025B": 'e',
5248 "\u01DD": 'e',
5249 "\u24D5": 'f',
5250 "\uFF46": 'f',
5251 "\u1E1F": 'f',
5252 "\u0192": 'f',
5253 "\uA77C": 'f',
5254 "\u24D6": 'g',
5255 "\uFF47": 'g',
5256 "\u01F5": 'g',
5257 "\u011D": 'g',
5258 "\u1E21": 'g',
5259 "\u011F": 'g',
5260 "\u0121": 'g',
5261 "\u01E7": 'g',
5262 "\u0123": 'g',
5263 "\u01E5": 'g',
5264 "\u0260": 'g',
5265 "\uA7A1": 'g',
5266 "\u1D79": 'g',
5267 "\uA77F": 'g',
5268 "\u24D7": 'h',
5269 "\uFF48": 'h',
5270 "\u0125": 'h',
5271 "\u1E23": 'h',
5272 "\u1E27": 'h',
5273 "\u021F": 'h',
5274 "\u1E25": 'h',
5275 "\u1E29": 'h',
5276 "\u1E2B": 'h',
5277 "\u1E96": 'h',
5278 "\u0127": 'h',
5279 "\u2C68": 'h',
5280 "\u2C76": 'h',
5281 "\u0265": 'h',
5282 "\u0195": 'hv',
5283 "\u24D8": 'i',
5284 "\uFF49": 'i',
5285 "\xEC": 'i',
5286 "\xED": 'i',
5287 "\xEE": 'i',
5288 "\u0129": 'i',
5289 "\u012B": 'i',
5290 "\u012D": 'i',
5291 "\xEF": 'i',
5292 "\u1E2F": 'i',
5293 "\u1EC9": 'i',
5294 "\u01D0": 'i',
5295 "\u0209": 'i',
5296 "\u020B": 'i',
5297 "\u1ECB": 'i',
5298 "\u012F": 'i',
5299 "\u1E2D": 'i',
5300 "\u0268": 'i',
5301 "\u0131": 'i',
5302 "\u24D9": 'j',
5303 "\uFF4A": 'j',
5304 "\u0135": 'j',
5305 "\u01F0": 'j',
5306 "\u0249": 'j',
5307 "\u24DA": 'k',
5308 "\uFF4B": 'k',
5309 "\u1E31": 'k',
5310 "\u01E9": 'k',
5311 "\u1E33": 'k',
5312 "\u0137": 'k',
5313 "\u1E35": 'k',
5314 "\u0199": 'k',
5315 "\u2C6A": 'k',
5316 "\uA741": 'k',
5317 "\uA743": 'k',
5318 "\uA745": 'k',
5319 "\uA7A3": 'k',
5320 "\u24DB": 'l',
5321 "\uFF4C": 'l',
5322 "\u0140": 'l',
5323 "\u013A": 'l',
5324 "\u013E": 'l',
5325 "\u1E37": 'l',
5326 "\u1E39": 'l',
5327 "\u013C": 'l',
5328 "\u1E3D": 'l',
5329 "\u1E3B": 'l',
5330 "\u017F": 'l',
5331 "\u0142": 'l',
5332 "\u019A": 'l',
5333 "\u026B": 'l',
5334 "\u2C61": 'l',
5335 "\uA749": 'l',
5336 "\uA781": 'l',
5337 "\uA747": 'l',
5338 "\u01C9": 'lj',
5339 "\u24DC": 'm',
5340 "\uFF4D": 'm',
5341 "\u1E3F": 'm',
5342 "\u1E41": 'm',
5343 "\u1E43": 'm',
5344 "\u0271": 'm',
5345 "\u026F": 'm',
5346 "\u24DD": 'n',
5347 "\uFF4E": 'n',
5348 "\u01F9": 'n',
5349 "\u0144": 'n',
5350 "\xF1": 'n',
5351 "\u1E45": 'n',
5352 "\u0148": 'n',
5353 "\u1E47": 'n',
5354 "\u0146": 'n',
5355 "\u1E4B": 'n',
5356 "\u1E49": 'n',
5357 "\u019E": 'n',
5358 "\u0272": 'n',
5359 "\u0149": 'n',
5360 "\uA791": 'n',
5361 "\uA7A5": 'n',
5362 "\u01CC": 'nj',
5363 "\u24DE": 'o',
5364 "\uFF4F": 'o',
5365 "\xF2": 'o',
5366 "\xF3": 'o',
5367 "\xF4": 'o',
5368 "\u1ED3": 'o',
5369 "\u1ED1": 'o',
5370 "\u1ED7": 'o',
5371 "\u1ED5": 'o',
5372 "\xF5": 'o',
5373 "\u1E4D": 'o',
5374 "\u022D": 'o',
5375 "\u1E4F": 'o',
5376 "\u014D": 'o',
5377 "\u1E51": 'o',
5378 "\u1E53": 'o',
5379 "\u014F": 'o',
5380 "\u022F": 'o',
5381 "\u0231": 'o',
5382 "\xF6": 'o',
5383 "\u022B": 'o',
5384 "\u1ECF": 'o',
5385 "\u0151": 'o',
5386 "\u01D2": 'o',
5387 "\u020D": 'o',
5388 "\u020F": 'o',
5389 "\u01A1": 'o',
5390 "\u1EDD": 'o',
5391 "\u1EDB": 'o',
5392 "\u1EE1": 'o',
5393 "\u1EDF": 'o',
5394 "\u1EE3": 'o',
5395 "\u1ECD": 'o',
5396 "\u1ED9": 'o',
5397 "\u01EB": 'o',
5398 "\u01ED": 'o',
5399 "\xF8": 'o',
5400 "\u01FF": 'o',
5401 "\u0254": 'o',
5402 "\uA74B": 'o',
5403 "\uA74D": 'o',
5404 "\u0275": 'o',
5405 "\u0153": 'oe',
5406 "\u01A3": 'oi',
5407 "\u0223": 'ou',
5408 "\uA74F": 'oo',
5409 "\u24DF": 'p',
5410 "\uFF50": 'p',
5411 "\u1E55": 'p',
5412 "\u1E57": 'p',
5413 "\u01A5": 'p',
5414 "\u1D7D": 'p',
5415 "\uA751": 'p',
5416 "\uA753": 'p',
5417 "\uA755": 'p',
5418 "\u24E0": 'q',
5419 "\uFF51": 'q',
5420 "\u024B": 'q',
5421 "\uA757": 'q',
5422 "\uA759": 'q',
5423 "\u24E1": 'r',
5424 "\uFF52": 'r',
5425 "\u0155": 'r',
5426 "\u1E59": 'r',
5427 "\u0159": 'r',
5428 "\u0211": 'r',
5429 "\u0213": 'r',
5430 "\u1E5B": 'r',
5431 "\u1E5D": 'r',
5432 "\u0157": 'r',
5433 "\u1E5F": 'r',
5434 "\u024D": 'r',
5435 "\u027D": 'r',
5436 "\uA75B": 'r',
5437 "\uA7A7": 'r',
5438 "\uA783": 'r',
5439 "\u24E2": 's',
5440 "\uFF53": 's',
5441 "\xDF": 's',
5442 "\u015B": 's',
5443 "\u1E65": 's',
5444 "\u015D": 's',
5445 "\u1E61": 's',
5446 "\u0161": 's',
5447 "\u1E67": 's',
5448 "\u1E63": 's',
5449 "\u1E69": 's',
5450 "\u0219": 's',
5451 "\u015F": 's',
5452 "\u023F": 's',
5453 "\uA7A9": 's',
5454 "\uA785": 's',
5455 "\u1E9B": 's',
5456 "\u24E3": 't',
5457 "\uFF54": 't',
5458 "\u1E6B": 't',
5459 "\u1E97": 't',
5460 "\u0165": 't',
5461 "\u1E6D": 't',
5462 "\u021B": 't',
5463 "\u0163": 't',
5464 "\u1E71": 't',
5465 "\u1E6F": 't',
5466 "\u0167": 't',
5467 "\u01AD": 't',
5468 "\u0288": 't',
5469 "\u2C66": 't',
5470 "\uA787": 't',
5471 "\uA729": 'tz',
5472 "\u24E4": 'u',
5473 "\uFF55": 'u',
5474 "\xF9": 'u',
5475 "\xFA": 'u',
5476 "\xFB": 'u',
5477 "\u0169": 'u',
5478 "\u1E79": 'u',
5479 "\u016B": 'u',
5480 "\u1E7B": 'u',
5481 "\u016D": 'u',
5482 "\xFC": 'u',
5483 "\u01DC": 'u',
5484 "\u01D8": 'u',
5485 "\u01D6": 'u',
5486 "\u01DA": 'u',
5487 "\u1EE7": 'u',
5488 "\u016F": 'u',
5489 "\u0171": 'u',
5490 "\u01D4": 'u',
5491 "\u0215": 'u',
5492 "\u0217": 'u',
5493 "\u01B0": 'u',
5494 "\u1EEB": 'u',
5495 "\u1EE9": 'u',
5496 "\u1EEF": 'u',
5497 "\u1EED": 'u',
5498 "\u1EF1": 'u',
5499 "\u1EE5": 'u',
5500 "\u1E73": 'u',
5501 "\u0173": 'u',
5502 "\u1E77": 'u',
5503 "\u1E75": 'u',
5504 "\u0289": 'u',
5505 "\u24E5": 'v',
5506 "\uFF56": 'v',
5507 "\u1E7D": 'v',
5508 "\u1E7F": 'v',
5509 "\u028B": 'v',
5510 "\uA75F": 'v',
5511 "\u028C": 'v',
5512 "\uA761": 'vy',
5513 "\u24E6": 'w',
5514 "\uFF57": 'w',
5515 "\u1E81": 'w',
5516 "\u1E83": 'w',
5517 "\u0175": 'w',
5518 "\u1E87": 'w',
5519 "\u1E85": 'w',
5520 "\u1E98": 'w',
5521 "\u1E89": 'w',
5522 "\u2C73": 'w',
5523 "\u24E7": 'x',
5524 "\uFF58": 'x',
5525 "\u1E8B": 'x',
5526 "\u1E8D": 'x',
5527 "\u24E8": 'y',
5528 "\uFF59": 'y',
5529 "\u1EF3": 'y',
5530 "\xFD": 'y',
5531 "\u0177": 'y',
5532 "\u1EF9": 'y',
5533 "\u0233": 'y',
5534 "\u1E8F": 'y',
5535 "\xFF": 'y',
5536 "\u1EF7": 'y',
5537 "\u1E99": 'y',
5538 "\u1EF5": 'y',
5539 "\u01B4": 'y',
5540 "\u024F": 'y',
5541 "\u1EFF": 'y',
5542 "\u24E9": 'z',
5543 "\uFF5A": 'z',
5544 "\u017A": 'z',
5545 "\u1E91": 'z',
5546 "\u017C": 'z',
5547 "\u017E": 'z',
5548 "\u1E93": 'z',
5549 "\u1E95": 'z',
5550 "\u01B6": 'z',
5551 "\u0225": 'z',
5552 "\u0240": 'z',
5553 "\u2C6C": 'z',
5554 "\uA763": 'z',
5555 "\u0386": "\u0391",
5556 "\u0388": "\u0395",
5557 "\u0389": "\u0397",
5558 "\u038A": "\u0399",
5559 "\u03AA": "\u0399",
5560 "\u038C": "\u039F",
5561 "\u038E": "\u03A5",
5562 "\u03AB": "\u03A5",
5563 "\u038F": "\u03A9",
5564 "\u03AC": "\u03B1",
5565 "\u03AD": "\u03B5",
5566 "\u03AE": "\u03B7",
5567 "\u03AF": "\u03B9",
5568 "\u03CA": "\u03B9",
5569 "\u0390": "\u03B9",
5570 "\u03CC": "\u03BF",
5571 "\u03CD": "\u03C5",
5572 "\u03CB": "\u03C5",
5573 "\u03B0": "\u03C5",
5574 "\u03CE": "\u03C9",
5575 "\u03C2": "\u03C3",
5576 "\u2019": '\''
5577 };
5578 return diacritics;
5579 });
5580 S2.define('select2/data/base', ['../utils'], function (Utils) {
5581 function BaseAdapter($element, options) {
5582 BaseAdapter.__super__.constructor.call(this);
5583 }
5584
5585 Utils.Extend(BaseAdapter, Utils.Observable);
5586
5587 BaseAdapter.prototype.current = function (callback) {
5588 throw new Error('The `current` method must be defined in child classes.');
5589 };
5590
5591 BaseAdapter.prototype.query = function (params, callback) {
5592 throw new Error('The `query` method must be defined in child classes.');
5593 };
5594
5595 BaseAdapter.prototype.bind = function (container, $container) {// Can be implemented in subclasses
5596 };
5597
5598 BaseAdapter.prototype.destroy = function () {// Can be implemented in subclasses
5599 };
5600
5601 BaseAdapter.prototype.generateResultId = function (container, data) {
5602 var id = container.id + '-result-';
5603 id += Utils.generateChars(4);
5604
5605 if (data.id != null) {
5606 id += '-' + data.id.toString();
5607 } else {
5608 id += '-' + Utils.generateChars(4);
5609 }
5610
5611 return id;
5612 };
5613
5614 return BaseAdapter;
5615 });
5616 S2.define('select2/data/select', ['./base', '../utils', 'jquery'], function (BaseAdapter, Utils, $) {
5617 function SelectAdapter($element, options) {
5618 this.$element = $element;
5619 this.options = options;
5620
5621 SelectAdapter.__super__.constructor.call(this);
5622 }
5623
5624 Utils.Extend(SelectAdapter, BaseAdapter);
5625
5626 SelectAdapter.prototype.current = function (callback) {
5627 var self = this;
5628 var data = Array.prototype.map.call(this.$element[0].querySelectorAll(':checked'), function (selectedElement) {
5629 return self.item($(selectedElement));
5630 });
5631 callback(data);
5632 };
5633
5634 SelectAdapter.prototype.select = function (data) {
5635 var self = this;
5636 data.selected = true; // If data.element is a DOM node, use it instead
5637
5638 if (data.element != null && data.element.tagName.toLowerCase() === 'option') {
5639 data.element.selected = true;
5640 this.$element.trigger('input').trigger('change');
5641 return;
5642 }
5643
5644 if (this.$element.prop('multiple')) {
5645 this.current(function (currentData) {
5646 var val = [];
5647 data = [data];
5648 data.push.apply(data, currentData);
5649
5650 for (var d = 0; d < data.length; d++) {
5651 var id = data[d].id;
5652
5653 if (val.indexOf(id) === -1) {
5654 val.push(id);
5655 }
5656 }
5657
5658 self.$element.val(val);
5659 self.$element.trigger('input').trigger('change');
5660 });
5661 } else {
5662 var val = data.id;
5663 this.$element.val(val);
5664 this.$element.trigger('input').trigger('change');
5665 }
5666 };
5667
5668 SelectAdapter.prototype.unselect = function (data) {
5669 var self = this;
5670
5671 if (!this.$element.prop('multiple')) {
5672 return;
5673 }
5674
5675 data.selected = false;
5676
5677 if (data.element != null && data.element.tagName.toLowerCase() === 'option') {
5678 data.element.selected = false;
5679 this.$element.trigger('input').trigger('change');
5680 return;
5681 }
5682
5683 this.current(function (currentData) {
5684 var val = [];
5685
5686 for (var d = 0; d < currentData.length; d++) {
5687 var id = currentData[d].id;
5688
5689 if (id !== data.id && val.indexOf(id) === -1) {
5690 val.push(id);
5691 }
5692 }
5693
5694 self.$element.val(val);
5695 self.$element.trigger('input').trigger('change');
5696 });
5697 };
5698
5699 SelectAdapter.prototype.bind = function (container, $container) {
5700 var self = this;
5701 this.container = container;
5702 container.on('select', function (params) {
5703 self.select(params.data);
5704 });
5705 container.on('unselect', function (params) {
5706 self.unselect(params.data);
5707 });
5708 };
5709
5710 SelectAdapter.prototype.destroy = function () {
5711 // Remove anything added to child elements
5712 this.$element.find('*').each(function () {
5713 // Remove any custom data set by Select2
5714 Utils.RemoveData(this);
5715 });
5716 };
5717
5718 SelectAdapter.prototype.query = function (params, callback) {
5719 var data = [];
5720 var self = this;
5721 var $options = this.$element.children();
5722 $options.each(function () {
5723 if (this.tagName.toLowerCase() !== 'option' && this.tagName.toLowerCase() !== 'optgroup') {
5724 return;
5725 }
5726
5727 var $option = $(this);
5728 var option = self.item($option);
5729 var matches = self.matches(params, option);
5730
5731 if (matches !== null) {
5732 data.push(matches);
5733 }
5734 });
5735 callback({
5736 results: data
5737 });
5738 };
5739
5740 SelectAdapter.prototype.addOptions = function ($options) {
5741 this.$element.append($options);
5742 };
5743
5744 SelectAdapter.prototype.option = function (data) {
5745 var option;
5746
5747 if (data.children) {
5748 option = document.createElement('optgroup');
5749 option.label = data.text;
5750 } else {
5751 option = document.createElement('option');
5752
5753 if (option.textContent !== undefined) {
5754 option.textContent = data.text;
5755 } else {
5756 option.innerText = data.text;
5757 }
5758 }
5759
5760 if (data.id !== undefined) {
5761 option.value = data.id;
5762 }
5763
5764 if (data.disabled) {
5765 option.disabled = true;
5766 }
5767
5768 if (data.selected) {
5769 option.selected = true;
5770 }
5771
5772 if (data.title) {
5773 option.title = data.title;
5774 }
5775
5776 var normalizedData = this._normalizeItem(data);
5777
5778 normalizedData.element = option; // Override the option's data with the combined data
5779
5780 Utils.StoreData(option, 'data', normalizedData);
5781 return $(option);
5782 };
5783
5784 SelectAdapter.prototype.item = function ($option) {
5785 var data = {};
5786 data = Utils.GetData($option[0], 'data');
5787
5788 if (data != null) {
5789 return data;
5790 }
5791
5792 var option = $option[0];
5793
5794 if (option.tagName.toLowerCase() === 'option') {
5795 data = {
5796 id: $option.val(),
5797 text: $option.text(),
5798 disabled: $option.prop('disabled'),
5799 selected: $option.prop('selected'),
5800 title: $option.prop('title')
5801 };
5802 } else if (option.tagName.toLowerCase() === 'optgroup') {
5803 data = {
5804 text: $option.prop('label'),
5805 children: [],
5806 title: $option.prop('title')
5807 };
5808 var $children = $option.children('option');
5809 var children = [];
5810
5811 for (var c = 0; c < $children.length; c++) {
5812 var $child = $($children[c]);
5813 var child = this.item($child);
5814 children.push(child);
5815 }
5816
5817 data.children = children;
5818 }
5819
5820 data = this._normalizeItem(data);
5821 data.element = $option[0];
5822 Utils.StoreData($option[0], 'data', data);
5823 return data;
5824 };
5825
5826 SelectAdapter.prototype._normalizeItem = function (item) {
5827 if (item !== Object(item)) {
5828 item = {
5829 id: item,
5830 text: item
5831 };
5832 }
5833
5834 item = $.extend({}, {
5835 text: ''
5836 }, item);
5837 var defaults = {
5838 selected: false,
5839 disabled: false
5840 };
5841
5842 if (item.id != null) {
5843 item.id = item.id.toString();
5844 }
5845
5846 if (item.text != null) {
5847 item.text = item.text.toString();
5848 }
5849
5850 if (item._resultId == null && item.id && this.container != null) {
5851 item._resultId = this.generateResultId(this.container, item);
5852 }
5853
5854 return $.extend({}, defaults, item);
5855 };
5856
5857 SelectAdapter.prototype.matches = function (params, data) {
5858 var matcher = this.options.get('matcher');
5859 return matcher(params, data);
5860 };
5861
5862 return SelectAdapter;
5863 });
5864 S2.define('select2/data/array', ['./select', '../utils', 'jquery'], function (SelectAdapter, Utils, $) {
5865 function ArrayAdapter($element, options) {
5866 this._dataToConvert = options.get('data') || [];
5867
5868 ArrayAdapter.__super__.constructor.call(this, $element, options);
5869 }
5870
5871 Utils.Extend(ArrayAdapter, SelectAdapter);
5872
5873 ArrayAdapter.prototype.bind = function (container, $container) {
5874 ArrayAdapter.__super__.bind.call(this, container, $container);
5875
5876 this.addOptions(this.convertToOptions(this._dataToConvert));
5877 };
5878
5879 ArrayAdapter.prototype.select = function (data) {
5880 var $option = this.$element.find('option').filter(function (i, elm) {
5881 return elm.value == data.id.toString();
5882 });
5883
5884 if ($option.length === 0) {
5885 $option = this.option(data);
5886 this.addOptions($option);
5887 }
5888
5889 ArrayAdapter.__super__.select.call(this, data);
5890 };
5891
5892 ArrayAdapter.prototype.convertToOptions = function (data) {
5893 var self = this;
5894 var $existing = this.$element.find('option');
5895 var existingIds = $existing.map(function () {
5896 return self.item($(this)).id;
5897 }).get();
5898 var $options = []; // Filter out all items except for the one passed in the argument
5899
5900 function onlyItem(item) {
5901 return function () {
5902 return $(this).val() == item.id;
5903 };
5904 }
5905
5906 for (var d = 0; d < data.length; d++) {
5907 var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data
5908
5909
5910 if (existingIds.indexOf(item.id) >= 0) {
5911 var $existingOption = $existing.filter(onlyItem(item));
5912 var existingData = this.item($existingOption);
5913 var newData = $.extend(true, {}, item, existingData);
5914 var $newOption = this.option(newData);
5915 $existingOption.replaceWith($newOption);
5916 continue;
5917 }
5918
5919 var $option = this.option(item);
5920
5921 if (item.children) {
5922 var $children = this.convertToOptions(item.children);
5923 $option.append($children);
5924 }
5925
5926 $options.push($option);
5927 }
5928
5929 return $options;
5930 };
5931
5932 return ArrayAdapter;
5933 });
5934 S2.define('select2/data/ajax', ['./array', '../utils', 'jquery'], function (ArrayAdapter, Utils, $) {
5935 function AjaxAdapter($element, options) {
5936 this.ajaxOptions = this._applyDefaults(options.get('ajax'));
5937
5938 if (this.ajaxOptions.processResults != null) {
5939 this.processResults = this.ajaxOptions.processResults;
5940 }
5941
5942 AjaxAdapter.__super__.constructor.call(this, $element, options);
5943 }
5944
5945 Utils.Extend(AjaxAdapter, ArrayAdapter);
5946
5947 AjaxAdapter.prototype._applyDefaults = function (options) {
5948 var defaults = {
5949 data: function data(params) {
5950 return $.extend({}, params, {
5951 q: params.term
5952 });
5953 },
5954 transport: function transport(params, success, failure) {
5955 var $request = $.ajax(params);
5956 $request.then(success);
5957 $request.fail(failure);
5958 return $request;
5959 }
5960 };
5961 return $.extend({}, defaults, options, true);
5962 };
5963
5964 AjaxAdapter.prototype.processResults = function (results) {
5965 return results;
5966 };
5967
5968 AjaxAdapter.prototype.query = function (params, callback) {
5969 var matches = [];
5970 var self = this;
5971
5972 if (this._request != null) {
5973 // JSONP requests cannot always be aborted
5974 if (typeof this._request.abort === 'function') {
5975 this._request.abort();
5976 }
5977
5978 this._request = null;
5979 }
5980
5981 var options = $.extend({
5982 type: 'GET'
5983 }, this.ajaxOptions);
5984
5985 if (typeof options.url === 'function') {
5986 options.url = options.url.call(this.$element, params);
5987 }
5988
5989 if (typeof options.data === 'function') {
5990 options.data = options.data.call(this.$element, params);
5991 }
5992
5993 function request() {
5994 var $request = options.transport(options, function (data) {
5995 var results = self.processResults(data, params);
5996
5997 if (self.options.get('debug') && window.console && console.error) {
5998 // Check to make sure that the response included a `results` key.
5999 if (!results || !results.results || !Array.isArray(results.results)) {
6000 console.error('Select2: The AJAX results did not return an array in the ' + '`results` key of the response.');
6001 }
6002 }
6003
6004 callback(results);
6005 }, function () {
6006 // Attempt to detect if a request was aborted
6007 // Only works if the transport exposes a status property
6008 if ('status' in $request && ($request.status === 0 || $request.status === '0')) {
6009 return;
6010 }
6011
6012 self.trigger('results:message', {
6013 message: 'errorLoading'
6014 });
6015 });
6016 self._request = $request;
6017 }
6018
6019 if (this.ajaxOptions.delay && params.term != null) {
6020 if (this._queryTimeout) {
6021 window.clearTimeout(this._queryTimeout);
6022 }
6023
6024 this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
6025 } else {
6026 request();
6027 }
6028 };
6029
6030 return AjaxAdapter;
6031 });
6032 S2.define('select2/data/tags', ['jquery'], function ($) {
6033 function Tags(decorated, $element, options) {
6034 var tags = options.get('tags');
6035 var createTag = options.get('createTag');
6036
6037 if (createTag !== undefined) {
6038 this.createTag = createTag;
6039 }
6040
6041 var insertTag = options.get('insertTag');
6042
6043 if (insertTag !== undefined) {
6044 this.insertTag = insertTag;
6045 }
6046
6047 decorated.call(this, $element, options);
6048
6049 if (Array.isArray(tags)) {
6050 for (var t = 0; t < tags.length; t++) {
6051 var tag = tags[t];
6052
6053 var item = this._normalizeItem(tag);
6054
6055 var $option = this.option(item);
6056 this.$element.append($option);
6057 }
6058 }
6059 }
6060
6061 Tags.prototype.query = function (decorated, params, callback) {
6062 var self = this;
6063
6064 this._removeOldTags();
6065
6066 if (params.term == null || params.page != null) {
6067 decorated.call(this, params, callback);
6068 return;
6069 }
6070
6071 function wrapper(obj, child) {
6072 var data = obj.results;
6073
6074 for (var i = 0; i < data.length; i++) {
6075 var option = data[i];
6076 var checkChildren = option.children != null && !wrapper({
6077 results: option.children
6078 }, true);
6079 var optionText = (option.text || '').toUpperCase();
6080 var paramsTerm = (params.term || '').toUpperCase();
6081 var checkText = optionText === paramsTerm;
6082
6083 if (checkText || checkChildren) {
6084 if (child) {
6085 return false;
6086 }
6087
6088 obj.data = data;
6089 callback(obj);
6090 return;
6091 }
6092 }
6093
6094 if (child) {
6095 return true;
6096 }
6097
6098 var tag = self.createTag(params);
6099
6100 if (tag != null) {
6101 var $option = self.option(tag);
6102 $option.attr('data-select2-tag', 'true');
6103 self.addOptions([$option]);
6104 self.insertTag(data, tag);
6105 }
6106
6107 obj.results = data;
6108 callback(obj);
6109 }
6110
6111 decorated.call(this, params, wrapper);
6112 };
6113
6114 Tags.prototype.createTag = function (decorated, params) {
6115 if (params.term == null) {
6116 return null;
6117 }
6118
6119 var term = params.term.trim();
6120
6121 if (term === '') {
6122 return null;
6123 }
6124
6125 return {
6126 id: term,
6127 text: term
6128 };
6129 };
6130
6131 Tags.prototype.insertTag = function (_, data, tag) {
6132 data.unshift(tag);
6133 };
6134
6135 Tags.prototype._removeOldTags = function (_) {
6136 var $options = this.$element.find('option[data-select2-tag]');
6137 $options.each(function () {
6138 if (this.selected) {
6139 return;
6140 }
6141
6142 $(this).remove();
6143 });
6144 };
6145
6146 return Tags;
6147 });
6148 S2.define('select2/data/tokenizer', ['jquery'], function ($) {
6149 function Tokenizer(decorated, $element, options) {
6150 var tokenizer = options.get('tokenizer');
6151
6152 if (tokenizer !== undefined) {
6153 this.tokenizer = tokenizer;
6154 }
6155
6156 decorated.call(this, $element, options);
6157 }
6158
6159 Tokenizer.prototype.bind = function (decorated, container, $container) {
6160 decorated.call(this, container, $container);
6161 this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field');
6162 };
6163
6164 Tokenizer.prototype.query = function (decorated, params, callback) {
6165 var self = this;
6166
6167 function createAndSelect(data) {
6168 // Normalize the data object so we can use it for checks
6169 var item = self._normalizeItem(data); // Check if the data object already exists as a tag
6170 // Select it if it doesn't
6171
6172
6173 var $existingOptions = self.$element.find('option').filter(function () {
6174 return $(this).val() === item.id;
6175 }); // If an existing option wasn't found for it, create the option
6176
6177 if (!$existingOptions.length) {
6178 var $option = self.option(item);
6179 $option.attr('data-select2-tag', true);
6180
6181 self._removeOldTags();
6182
6183 self.addOptions([$option]);
6184 } // Select the item, now that we know there is an option for it
6185
6186
6187 select(item);
6188 }
6189
6190 function select(data) {
6191 self.trigger('select', {
6192 data: data
6193 });
6194 }
6195
6196 params.term = params.term || '';
6197 var tokenData = this.tokenizer(params, this.options, createAndSelect);
6198
6199 if (tokenData.term !== params.term) {
6200 // Replace the search term if we have the search box
6201 if (this.$search.length) {
6202 this.$search.val(tokenData.term);
6203 this.$search.trigger('focus');
6204 }
6205
6206 params.term = tokenData.term;
6207 }
6208
6209 decorated.call(this, params, callback);
6210 };
6211
6212 Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
6213 var separators = options.get('tokenSeparators') || [];
6214 var term = params.term;
6215 var i = 0;
6216
6217 var createTag = this.createTag || function (params) {
6218 return {
6219 id: params.term,
6220 text: params.term
6221 };
6222 };
6223
6224 while (i < term.length) {
6225 var termChar = term[i];
6226
6227 if (separators.indexOf(termChar) === -1) {
6228 i++;
6229 continue;
6230 }
6231
6232 var part = term.substr(0, i);
6233 var partParams = $.extend({}, params, {
6234 term: part
6235 });
6236 var data = createTag(partParams);
6237
6238 if (data == null) {
6239 i++;
6240 continue;
6241 }
6242
6243 callback(data); // Reset the term to not include the tokenized portion
6244
6245 term = term.substr(i + 1) || '';
6246 i = 0;
6247 }
6248
6249 return {
6250 term: term
6251 };
6252 };
6253
6254 return Tokenizer;
6255 });
6256 S2.define('select2/data/minimumInputLength', [], function () {
6257 function MinimumInputLength(decorated, $e, options) {
6258 this.minimumInputLength = options.get('minimumInputLength');
6259 decorated.call(this, $e, options);
6260 }
6261
6262 MinimumInputLength.prototype.query = function (decorated, params, callback) {
6263 params.term = params.term || '';
6264
6265 if (params.term.length < this.minimumInputLength) {
6266 this.trigger('results:message', {
6267 message: 'inputTooShort',
6268 args: {
6269 minimum: this.minimumInputLength,
6270 input: params.term,
6271 params: params
6272 }
6273 });
6274 return;
6275 }
6276
6277 decorated.call(this, params, callback);
6278 };
6279
6280 return MinimumInputLength;
6281 });
6282 S2.define('select2/data/maximumInputLength', [], function () {
6283 function MaximumInputLength(decorated, $e, options) {
6284 this.maximumInputLength = options.get('maximumInputLength');
6285 decorated.call(this, $e, options);
6286 }
6287
6288 MaximumInputLength.prototype.query = function (decorated, params, callback) {
6289 params.term = params.term || '';
6290
6291 if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) {
6292 this.trigger('results:message', {
6293 message: 'inputTooLong',
6294 args: {
6295 maximum: this.maximumInputLength,
6296 input: params.term,
6297 params: params
6298 }
6299 });
6300 return;
6301 }
6302
6303 decorated.call(this, params, callback);
6304 };
6305
6306 return MaximumInputLength;
6307 });
6308 S2.define('select2/data/maximumSelectionLength', [], function () {
6309 function MaximumSelectionLength(decorated, $e, options) {
6310 this.maximumSelectionLength = options.get('maximumSelectionLength');
6311 decorated.call(this, $e, options);
6312 }
6313
6314 MaximumSelectionLength.prototype.bind = function (decorated, container, $container) {
6315 var self = this;
6316 decorated.call(this, container, $container);
6317 container.on('select', function () {
6318 self._checkIfMaximumSelected();
6319 });
6320 };
6321
6322 MaximumSelectionLength.prototype.query = function (decorated, params, callback) {
6323 var self = this;
6324
6325 this._checkIfMaximumSelected(function () {
6326 decorated.call(self, params, callback);
6327 });
6328 };
6329
6330 MaximumSelectionLength.prototype._checkIfMaximumSelected = function (_, successCallback) {
6331 var self = this;
6332 this.current(function (currentData) {
6333 var count = currentData != null ? currentData.length : 0;
6334
6335 if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) {
6336 self.trigger('results:message', {
6337 message: 'maximumSelected',
6338 args: {
6339 maximum: self.maximumSelectionLength
6340 }
6341 });
6342 return;
6343 }
6344
6345 if (successCallback) {
6346 successCallback();
6347 }
6348 });
6349 };
6350
6351 return MaximumSelectionLength;
6352 });
6353 S2.define('select2/dropdown', ['jquery', './utils'], function ($, Utils) {
6354 function Dropdown($element, options) {
6355 this.$element = $element;
6356 this.options = options;
6357
6358 Dropdown.__super__.constructor.call(this);
6359 }
6360
6361 Utils.Extend(Dropdown, Utils.Observable);
6362
6363 Dropdown.prototype.render = function () {
6364 // Change dropdown classname and markup. @edited
6365 var $dropdown = $('<span class="sui-select-dropdown">' + '<span class="select2-results"></span>' + '</span>');
6366 $dropdown.attr('dir', this.options.get('dir'));
6367 this.$dropdown = $dropdown;
6368 return $dropdown;
6369 };
6370
6371 Dropdown.prototype.bind = function () {// Should be implemented in subclasses
6372 };
6373
6374 Dropdown.prototype.position = function ($dropdown, $container) {// Should be implemented in subclasses
6375 };
6376
6377 Dropdown.prototype.destroy = function () {
6378 // Remove the dropdown from the DOM
6379 this.$dropdown.remove();
6380 };
6381
6382 return Dropdown;
6383 });
6384 S2.define('select2/dropdown/search', ['jquery'], function ($) {
6385 function Search() {}
6386
6387 Search.prototype.render = function (decorated) {
6388 var $rendered = decorated.call(this);
6389 var searchLabel = this.options.get('translations').get('search');
6390 var $search = $('<span class="select2-search select2-search--dropdown">' + '<input class="select2-search__field" type="search" tabindex="-1"' + ' autocorrect="off" autocapitalize="none"' + ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' + '</span>');
6391 this.$searchContainer = $search;
6392 this.$search = $search.find('input');
6393 this.$search.prop('autocomplete', this.options.get('autocomplete'));
6394 this.$search.attr('aria-label', searchLabel());
6395 $rendered.prepend($search);
6396 return $rendered;
6397 };
6398
6399 Search.prototype.bind = function (decorated, container, $container) {
6400 var self = this;
6401 var resultsId = container.id + '-results';
6402 decorated.call(this, container, $container);
6403 this.$search.on('keydown', function (evt) {
6404 self.trigger('keypress', evt);
6405 self._keyUpPrevented = evt.isDefaultPrevented();
6406 }); // Workaround for browsers which do not support the `input` event
6407 // This will prevent double-triggering of events for browsers which support
6408 // both the `keyup` and `input` events.
6409
6410 this.$search.on('input', function (evt) {
6411 // Unbind the duplicated `keyup` event
6412 $(this).off('keyup');
6413 });
6414 this.$search.on('keyup input', function (evt) {
6415 self.handleSearch(evt);
6416 });
6417 container.on('open', function () {
6418 self.$search.attr('tabindex', 0);
6419 self.$search.attr('aria-controls', resultsId);
6420 self.$search.trigger('focus');
6421 window.setTimeout(function () {
6422 self.$search.trigger('focus');
6423 }, 0);
6424 });
6425 container.on('close', function () {
6426 self.$search.attr('tabindex', -1);
6427 self.$search.removeAttr('aria-controls');
6428 self.$search.removeAttr('aria-activedescendant');
6429 self.$search.val('');
6430 self.$search.trigger('blur');
6431 });
6432 container.on('focus', function () {
6433 if (!container.isOpen()) {
6434 self.$search.trigger('focus');
6435 }
6436 });
6437 container.on('results:all', function (params) {
6438 if (params.query.term == null || params.query.term === '') {
6439 var showSearch = self.showSearch(params);
6440
6441 if (showSearch) {
6442 self.$searchContainer[0].classList.remove('select2-search--hide');
6443 } else {
6444 self.$searchContainer[0].classList.add('select2-search--hide');
6445 }
6446 }
6447 });
6448 container.on('results:focus', function (params) {
6449 if (params.data._resultId) {
6450 self.$search.attr('aria-activedescendant', params.data._resultId);
6451 } else {
6452 self.$search.removeAttr('aria-activedescendant');
6453 }
6454 });
6455 };
6456
6457 Search.prototype.handleSearch = function (evt) {
6458 if (!this._keyUpPrevented) {
6459 var input = this.$search.val();
6460 this.trigger('query', {
6461 term: input
6462 });
6463 }
6464
6465 this._keyUpPrevented = false;
6466 };
6467
6468 Search.prototype.showSearch = function (_, params) {
6469 return true;
6470 };
6471
6472 return Search;
6473 });
6474 S2.define('select2/dropdown/hidePlaceholder', [], function () {
6475 function HidePlaceholder(decorated, $element, options, dataAdapter) {
6476 this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
6477 decorated.call(this, $element, options, dataAdapter);
6478 }
6479
6480 HidePlaceholder.prototype.append = function (decorated, data) {
6481 data.results = this.removePlaceholder(data.results);
6482 decorated.call(this, data);
6483 };
6484
6485 HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
6486 if (typeof placeholder === 'string') {
6487 placeholder = {
6488 id: '',
6489 text: placeholder
6490 };
6491 }
6492
6493 return placeholder;
6494 };
6495
6496 HidePlaceholder.prototype.removePlaceholder = function (_, data) {
6497 var modifiedData = data.slice(0);
6498
6499 for (var d = data.length - 1; d >= 0; d--) {
6500 var item = data[d];
6501
6502 if (this.placeholder.id === item.id) {
6503 modifiedData.splice(d, 1);
6504 }
6505 }
6506
6507 return modifiedData;
6508 };
6509
6510 return HidePlaceholder;
6511 });
6512 S2.define('select2/dropdown/infiniteScroll', ['jquery'], function ($) {
6513 function InfiniteScroll(decorated, $element, options, dataAdapter) {
6514 this.lastParams = {};
6515 decorated.call(this, $element, options, dataAdapter);
6516 this.$loadingMore = this.createLoadingMore();
6517 this.loading = false;
6518 }
6519
6520 InfiniteScroll.prototype.append = function (decorated, data) {
6521 this.$loadingMore.remove();
6522 this.loading = false;
6523 decorated.call(this, data);
6524
6525 if (this.showLoadingMore(data)) {
6526 this.$results.append(this.$loadingMore);
6527 this.loadMoreIfNeeded();
6528 }
6529 };
6530
6531 InfiniteScroll.prototype.bind = function (decorated, container, $container) {
6532 var self = this;
6533 decorated.call(this, container, $container);
6534 container.on('query', function (params) {
6535 self.lastParams = params;
6536 self.loading = true;
6537 });
6538 container.on('query:append', function (params) {
6539 self.lastParams = params;
6540 self.loading = true;
6541 });
6542 this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
6543 };
6544
6545 InfiniteScroll.prototype.loadMoreIfNeeded = function () {
6546 var isLoadMoreVisible = $.contains(document.documentElement, this.$loadingMore[0]);
6547
6548 if (this.loading || !isLoadMoreVisible) {
6549 return;
6550 }
6551
6552 var currentOffset = this.$results.offset().top + this.$results.outerHeight(false);
6553 var loadingMoreOffset = this.$loadingMore.offset().top + this.$loadingMore.outerHeight(false);
6554
6555 if (currentOffset + 50 >= loadingMoreOffset) {
6556 this.loadMore();
6557 }
6558 };
6559
6560 InfiniteScroll.prototype.loadMore = function () {
6561 this.loading = true;
6562 var params = $.extend({}, {
6563 page: 1
6564 }, this.lastParams);
6565 params.page++;
6566 this.trigger('query:append', params);
6567 };
6568
6569 InfiniteScroll.prototype.showLoadingMore = function (_, data) {
6570 return data.pagination && data.pagination.more;
6571 };
6572
6573 InfiniteScroll.prototype.createLoadingMore = function () {
6574 var $option = $('<li ' + 'class="select2-results__option select2-results__option--load-more"' + 'role="option" aria-disabled="true"></li>');
6575 var message = this.options.get('translations').get('loadingMore');
6576 $option.html(message(this.lastParams));
6577 return $option;
6578 };
6579
6580 return InfiniteScroll;
6581 });
6582 S2.define('select2/dropdown/attachBody', ['jquery', '../utils'], function ($, Utils) {
6583 function AttachBody(decorated, $element, options) {
6584 this.$dropdownParent = $(options.get('dropdownParent') || document.body);
6585 decorated.call(this, $element, options);
6586 }
6587
6588 AttachBody.prototype.bind = function (decorated, container, $container) {
6589 var self = this;
6590 decorated.call(this, container, $container);
6591 container.on('open', function () {
6592 self._showDropdown();
6593
6594 self._attachPositioningHandler(container); // Must bind after the results handlers to ensure correct sizing
6595
6596
6597 self._bindContainerResultHandlers(container);
6598 });
6599 container.on('close', function () {
6600 self._hideDropdown();
6601
6602 self._detachPositioningHandler(container);
6603 });
6604 this.$dropdownContainer.on('mousedown', function (evt) {
6605 evt.stopPropagation();
6606 });
6607 };
6608
6609 AttachBody.prototype.destroy = function (decorated) {
6610 decorated.call(this);
6611 this.$dropdownContainer.remove();
6612 };
6613
6614 AttachBody.prototype.position = function (decorated, $dropdown, $container) {
6615 // Clone all of the container classes
6616 $dropdown.attr('class', $container.attr('class')); // Custom SUIselect dropdown. @edited
6617
6618 $dropdown.removeClass('select2');
6619 $dropdown.addClass('sui-select-dropdown-container--open');
6620 $dropdown[0].classList.remove('select2');
6621 $dropdown[0].classList.add('select2-container--open');
6622 $dropdown.css({
6623 position: 'absolute',
6624 top: -999999
6625 });
6626 this.$container = $container;
6627 };
6628
6629 AttachBody.prototype.render = function (decorated) {
6630 var $container = $('<span></span>');
6631 var $dropdown = decorated.call(this);
6632 $container.append($dropdown);
6633 this.$dropdownContainer = $container;
6634 return $container;
6635 };
6636
6637 AttachBody.prototype._hideDropdown = function (decorated) {
6638 this.$dropdownContainer.detach();
6639 };
6640
6641 AttachBody.prototype._bindContainerResultHandlers = function (decorated, container) {
6642 // These should only be bound once
6643 if (this._containerResultsHandlersBound) {
6644 return;
6645 }
6646
6647 var self = this;
6648 container.on('results:all', function () {
6649 self._positionDropdown();
6650
6651 self._resizeDropdown();
6652 });
6653 container.on('results:append', function () {
6654 self._positionDropdown();
6655
6656 self._resizeDropdown();
6657 });
6658 container.on('results:message', function () {
6659 self._positionDropdown();
6660
6661 self._resizeDropdown();
6662 });
6663 container.on('select', function () {
6664 self._positionDropdown();
6665
6666 self._resizeDropdown();
6667 });
6668 container.on('unselect', function () {
6669 self._positionDropdown();
6670
6671 self._resizeDropdown();
6672 });
6673 this._containerResultsHandlersBound = true;
6674 };
6675
6676 AttachBody.prototype._attachPositioningHandler = function (decorated, container) {
6677 var self = this;
6678 var scrollEvent = 'scroll.select2.' + container.id;
6679 var resizeEvent = 'resize.select2.' + container.id;
6680 var orientationEvent = 'orientationchange.select2.' + container.id;
6681 var $watchers = this.$container.parents().filter(Utils.hasScroll);
6682 $watchers.each(function () {
6683 Utils.StoreData(this, 'select2-scroll-position', {
6684 x: $(this).scrollLeft(),
6685 y: $(this).scrollTop()
6686 });
6687 });
6688 $watchers.on(scrollEvent, function (ev) {
6689 var position = Utils.GetData(this, 'select2-scroll-position');
6690 $(this).scrollTop(position.y);
6691 });
6692 $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) {
6693 self._positionDropdown();
6694
6695 self._resizeDropdown();
6696 });
6697 };
6698
6699 AttachBody.prototype._detachPositioningHandler = function (decorated, container) {
6700 var scrollEvent = 'scroll.select2.' + container.id;
6701 var resizeEvent = 'resize.select2.' + container.id;
6702 var orientationEvent = 'orientationchange.select2.' + container.id;
6703 var $watchers = this.$container.parents().filter(Utils.hasScroll);
6704 $watchers.off(scrollEvent);
6705 $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
6706 };
6707
6708 AttachBody.prototype._positionDropdown = function () {
6709 var $window = $(window); // Custom SUIselect dropdown. @edited
6710
6711 var isCurrentlyAbove = this.$dropdown[0].classList.contains('sui-select-dropdown--above');
6712 var isCurrentlyBelow = this.$dropdown[0].classList.contains('sui-select-dropdown--below');
6713 var newDirection = null;
6714 var offset = this.$container.offset();
6715 offset.bottom = offset.top + this.$container.outerHeight(false);
6716 var container = {
6717 height: this.$container.outerHeight(false)
6718 };
6719 container.top = offset.top;
6720 container.bottom = offset.top + container.height;
6721 var dropdown = {
6722 height: this.$dropdown.outerHeight(false)
6723 };
6724 var viewport = {
6725 top: $window.scrollTop(),
6726 bottom: $window.scrollTop() + $window.height()
6727 };
6728 var enoughRoomAbove = viewport.top < offset.top - dropdown.height;
6729 var enoughRoomBelow = viewport.bottom > offset.bottom + dropdown.height;
6730 var css = {
6731 left: offset.left,
6732 top: container.bottom
6733 }; // Determine what the parent element is to use for calculating the offset
6734
6735 var $offsetParent = this.$dropdownParent; // For statically positioned elements, we need to get the element
6736 // that is determining the offset
6737
6738 if ($offsetParent.css('position') === 'static') {
6739 $offsetParent = $offsetParent.offsetParent();
6740 }
6741
6742 var parentOffset = {
6743 top: 0,
6744 left: 0
6745 };
6746
6747 if ($.contains(document.body, $offsetParent[0]) || $offsetParent[0].isConnected) {
6748 parentOffset = $offsetParent.offset();
6749 }
6750
6751 css.top -= parentOffset.top;
6752 css.left -= parentOffset.left;
6753
6754 if (!isCurrentlyAbove && !isCurrentlyBelow) {
6755 newDirection = 'below';
6756 }
6757
6758 if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
6759 newDirection = 'above';
6760 } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
6761 newDirection = 'below';
6762 }
6763
6764 if (newDirection == 'above' || isCurrentlyAbove && newDirection !== 'below') {
6765 css.top = container.top - parentOffset.top - dropdown.height;
6766 } // Custom SUIselect dropdown. @edited
6767
6768
6769 if (newDirection != null) {
6770 this.$dropdown[0].classList.remove('sui-select-dropdown--below');
6771 this.$dropdown[0].classList.remove('sui-select-dropdown--above');
6772 this.$dropdown[0].classList.add('sui-select-dropdown--' + newDirection);
6773 this.$container[0].classList.remove('sui-select-container--below');
6774 this.$container[0].classList.remove('sui-select-container--above');
6775 this.$container[0].classList.add('sui-select-dropdown-container--' + newDirection);
6776 }
6777
6778 this.$dropdownContainer.css(css);
6779 };
6780
6781 AttachBody.prototype._resizeDropdown = function () {
6782 var css = {
6783 width: this.$container.outerWidth(false) + 'px'
6784 };
6785
6786 if (this.options.get('dropdownAutoWidth')) {
6787 css.minWidth = css.width;
6788 css.position = 'relative';
6789 css.width = 'auto';
6790 }
6791
6792 this.$dropdown.css(css);
6793 };
6794
6795 AttachBody.prototype._showDropdown = function (decorated) {
6796 this.$dropdownContainer.appendTo(this.$dropdownParent);
6797
6798 this._positionDropdown();
6799
6800 this._resizeDropdown();
6801 };
6802
6803 return AttachBody;
6804 });
6805 S2.define('select2/dropdown/minimumResultsForSearch', [], function () {
6806 function countResults(data) {
6807 var count = 0;
6808
6809 for (var d = 0; d < data.length; d++) {
6810 var item = data[d];
6811
6812 if (item.children) {
6813 count += countResults(item.children);
6814 } else {
6815 count++;
6816 }
6817 }
6818
6819 return count;
6820 }
6821
6822 function MinimumResultsForSearch(decorated, $element, options, dataAdapter) {
6823 this.minimumResultsForSearch = options.get('minimumResultsForSearch');
6824
6825 if (this.minimumResultsForSearch < 0) {
6826 this.minimumResultsForSearch = Infinity;
6827 }
6828
6829 decorated.call(this, $element, options, dataAdapter);
6830 }
6831
6832 MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
6833 if (countResults(params.data.results) < this.minimumResultsForSearch) {
6834 return false;
6835 }
6836
6837 return decorated.call(this, params);
6838 };
6839
6840 return MinimumResultsForSearch;
6841 });
6842 S2.define('select2/dropdown/selectOnClose', ['../utils'], function (Utils) {
6843 function SelectOnClose() {}
6844
6845 SelectOnClose.prototype.bind = function (decorated, container, $container) {
6846 var self = this;
6847 decorated.call(this, container, $container);
6848 container.on('close', function (params) {
6849 self._handleSelectOnClose(params);
6850 });
6851 };
6852
6853 SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
6854 if (params && params.originalSelect2Event != null) {
6855 var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or
6856 // unselect event
6857
6858 if (event._type === 'select' || event._type === 'unselect') {
6859 return;
6860 }
6861 }
6862
6863 var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results
6864
6865 if ($highlightedResults.length < 1) {
6866 return;
6867 }
6868
6869 var data = Utils.GetData($highlightedResults[0], 'data'); // Don't re-select already selected resulte
6870
6871 if (data.element != null && data.element.selected || data.element == null && data.selected) {
6872 return;
6873 }
6874
6875 this.trigger('select', {
6876 data: data
6877 });
6878 };
6879
6880 return SelectOnClose;
6881 });
6882 S2.define('select2/dropdown/closeOnSelect', [], function () {
6883 function CloseOnSelect() {}
6884
6885 CloseOnSelect.prototype.bind = function (decorated, container, $container) {
6886 var self = this;
6887 decorated.call(this, container, $container);
6888 container.on('select', function (evt) {
6889 self._selectTriggered(evt);
6890 });
6891 container.on('unselect', function (evt) {
6892 self._selectTriggered(evt);
6893 });
6894 };
6895
6896 CloseOnSelect.prototype._selectTriggered = function (_, evt) {
6897 var originalEvent = evt.originalEvent; // Don't close if the control key is being held
6898
6899 if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {
6900 return;
6901 }
6902
6903 this.trigger('close', {
6904 originalEvent: originalEvent,
6905 originalSelect2Event: evt
6906 });
6907 };
6908
6909 return CloseOnSelect;
6910 });
6911 S2.define('select2/dropdown/dropdownCss', ['../utils'], function (Utils) {
6912 function DropdownCSS() {}
6913
6914 DropdownCSS.prototype.render = function (decorated) {
6915 var $dropdown = decorated.call(this);
6916 var dropdownCssClass = this.options.get('dropdownCssClass') || '';
6917
6918 if (dropdownCssClass.indexOf(':all:') !== -1) {
6919 dropdownCssClass = dropdownCssClass.replace(':all:', '');
6920 Utils.copyNonInternalCssClasses($dropdown[0], this.$element[0]);
6921 }
6922
6923 $dropdown.addClass('sui-select-dropdown'); // FIX: Make sure "sui-select-dropdown" main class does not get erased. @edited
6924
6925 $dropdown.addClass(dropdownCssClass);
6926 return $dropdown;
6927 };
6928
6929 return DropdownCSS;
6930 });
6931 S2.define('select2/dropdown/tagsSearchHighlight', ['../utils'], function (Utils) {
6932 function TagsSearchHighlight() {}
6933
6934 TagsSearchHighlight.prototype.highlightFirstItem = function (decorated) {
6935 var $options = this.$results.find('.select2-results__option--selectable' + ':not(.select2-results__option--selected)');
6936
6937 if ($options.length > 0) {
6938 var $firstOption = $options.first();
6939 var data = Utils.GetData($firstOption[0], 'data');
6940 var firstElement = data.element;
6941
6942 if (firstElement && firstElement.getAttribute) {
6943 if (firstElement.getAttribute('data-select2-tag') === 'true') {
6944 $firstOption.trigger('mouseenter');
6945 return;
6946 }
6947 }
6948 }
6949
6950 decorated.call(this);
6951 };
6952
6953 return TagsSearchHighlight;
6954 });
6955 S2.define('select2/i18n/en', [], function () {
6956 // English
6957 return {
6958 errorLoading: function errorLoading() {
6959 return 'The results could not be loaded.';
6960 },
6961 inputTooLong: function inputTooLong(args) {
6962 var overChars = args.input.length - args.maximum;
6963 var message = 'Please delete ' + overChars + ' character';
6964
6965 if (overChars != 1) {
6966 message += 's';
6967 }
6968
6969 return message;
6970 },
6971 inputTooShort: function inputTooShort(args) {
6972 var remainingChars = args.minimum - args.input.length;
6973 var message = 'Please enter ' + remainingChars + ' or more characters';
6974 return message;
6975 },
6976 loadingMore: function loadingMore() {
6977 return 'Loading more results…';
6978 },
6979 maximumSelected: function maximumSelected(args) {
6980 var message = 'You can only select ' + args.maximum + ' item';
6981
6982 if (args.maximum != 1) {
6983 message += 's';
6984 }
6985
6986 return message;
6987 },
6988 noResults: function noResults() {
6989 return 'No results found';
6990 },
6991 searching: function searching() {
6992 return 'Searching…';
6993 },
6994 removeAllItems: function removeAllItems() {
6995 return 'Remove all items';
6996 },
6997 removeItem: function removeItem() {
6998 return 'Remove item';
6999 },
7000 search: function search() {
7001 return 'Search';
7002 }
7003 };
7004 });
7005 S2.define('select2/defaults', ['jquery', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/selectionCss', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './dropdown/dropdownCss', './dropdown/tagsSearchHighlight', './i18n/en'], function ($, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, SelectionCSS, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, DropdownCSS, TagsSearchHighlight, EnglishTranslation) {
7006 function Defaults() {
7007 this.reset();
7008 }
7009
7010 Defaults.prototype.apply = function (options) {
7011 options = $.extend(true, {}, this.defaults, options);
7012
7013 if (options.dataAdapter == null) {
7014 if (options.ajax != null) {
7015 options.dataAdapter = AjaxData;
7016 } else if (options.data != null) {
7017 options.dataAdapter = ArrayData;
7018 } else {
7019 options.dataAdapter = SelectData;
7020 }
7021
7022 if (options.minimumInputLength > 0) {
7023 options.dataAdapter = Utils.Decorate(options.dataAdapter, MinimumInputLength);
7024 }
7025
7026 if (options.maximumInputLength > 0) {
7027 options.dataAdapter = Utils.Decorate(options.dataAdapter, MaximumInputLength);
7028 }
7029
7030 if (options.maximumSelectionLength > 0) {
7031 options.dataAdapter = Utils.Decorate(options.dataAdapter, MaximumSelectionLength);
7032 }
7033
7034 if (options.tags) {
7035 options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
7036 }
7037
7038 if (options.tokenSeparators != null || options.tokenizer != null) {
7039 options.dataAdapter = Utils.Decorate(options.dataAdapter, Tokenizer);
7040 }
7041 }
7042
7043 if (options.resultsAdapter == null) {
7044 options.resultsAdapter = ResultsList;
7045
7046 if (options.ajax != null) {
7047 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, InfiniteScroll);
7048 }
7049
7050 if (options.placeholder != null) {
7051 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, HidePlaceholder);
7052 }
7053
7054 if (options.selectOnClose) {
7055 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, SelectOnClose);
7056 }
7057
7058 if (options.tags) {
7059 options.resultsAdapter = Utils.Decorate(options.resultsAdapter, TagsSearchHighlight);
7060 }
7061 }
7062
7063 if (options.dropdownAdapter == null) {
7064 if (options.multiple) {
7065 options.dropdownAdapter = Dropdown;
7066 } else {
7067 var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
7068 options.dropdownAdapter = SearchableDropdown;
7069 }
7070
7071 if (options.minimumResultsForSearch !== 0) {
7072 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, MinimumResultsForSearch);
7073 }
7074
7075 if (options.closeOnSelect) {
7076 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, CloseOnSelect);
7077 }
7078
7079 if (options.dropdownCssClass != null) {
7080 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, DropdownCSS);
7081 }
7082
7083 options.dropdownAdapter = Utils.Decorate(options.dropdownAdapter, AttachBody);
7084 }
7085
7086 if (options.selectionAdapter == null) {
7087 if (options.multiple) {
7088 options.selectionAdapter = MultipleSelection;
7089 } else {
7090 options.selectionAdapter = SingleSelection;
7091 } // Add the placeholder mixin if a placeholder was specified
7092
7093
7094 if (options.placeholder != null) {
7095 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, Placeholder);
7096 }
7097
7098 if (options.allowClear) {
7099 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, AllowClear);
7100 }
7101
7102 if (options.multiple) {
7103 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, SelectionSearch);
7104 }
7105
7106 if (options.selectionCssClass != null) {
7107 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, SelectionCSS);
7108 }
7109
7110 options.selectionAdapter = Utils.Decorate(options.selectionAdapter, EventRelay);
7111 } // If the defaults were not previously applied from an element, it is
7112 // possible for the language option to have not been resolved
7113
7114
7115 options.language = this._resolveLanguage(options.language); // Always fall back to English since it will always be complete
7116
7117 options.language.push('en');
7118 var uniqueLanguages = [];
7119
7120 for (var l = 0; l < options.language.length; l++) {
7121 var language = options.language[l];
7122
7123 if (uniqueLanguages.indexOf(language) === -1) {
7124 uniqueLanguages.push(language);
7125 }
7126 }
7127
7128 options.language = uniqueLanguages;
7129 options.translations = this._processTranslations(options.language, options.debug);
7130 return options;
7131 };
7132
7133 Defaults.prototype.reset = function () {
7134 function stripDiacritics(text) {
7135 // Used 'uni range + named function' from http://jsperf.com/diacritics/18
7136 function match(a) {
7137 return DIACRITICS[a] || a;
7138 }
7139
7140 return text.replace(/[^\u0000-\u007E]/g, match);
7141 }
7142
7143 function matcher(params, data) {
7144 // Always return the object if there is nothing to compare
7145 if (params.term == null || params.term.trim() === '') {
7146 return data;
7147 } // Do a recursive check for options with children
7148
7149
7150 if (data.children && data.children.length > 0) {
7151 // Clone the data object if there are children
7152 // This is required as we modify the object to remove any non-matches
7153 var match = $.extend(true, {}, data); // Check each child of the option
7154
7155 for (var c = data.children.length - 1; c >= 0; c--) {
7156 var child = data.children[c];
7157 var matches = matcher(params, child); // If there wasn't a match, remove the object in the array
7158
7159 if (matches == null) {
7160 match.children.splice(c, 1);
7161 }
7162 } // If any children matched, return the new object
7163
7164
7165 if (match.children.length > 0) {
7166 return match;
7167 } // If there were no matching children, check just the plain object
7168
7169
7170 return matcher(params, match);
7171 }
7172
7173 var original = stripDiacritics(data.text).toUpperCase();
7174 var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term
7175
7176 if (original.indexOf(term) > -1) {
7177 return data;
7178 } // If it doesn't contain the term, don't return anything
7179
7180
7181 return null;
7182 }
7183
7184 this.defaults = {
7185 amdLanguageBase: './i18n/',
7186 autocomplete: 'off',
7187 closeOnSelect: true,
7188 debug: false,
7189 dropdownAutoWidth: false,
7190 escapeMarkup: Utils.escapeMarkup,
7191 language: {},
7192 matcher: matcher,
7193 minimumInputLength: 0,
7194 maximumInputLength: 0,
7195 maximumSelectionLength: 0,
7196 minimumResultsForSearch: 0,
7197 selectOnClose: false,
7198 scrollAfterSelect: false,
7199 sorter: function sorter(data) {
7200 return data;
7201 },
7202 templateResult: function templateResult(result) {
7203 return result.text;
7204 },
7205 templateSelection: function templateSelection(selection) {
7206 return selection.text;
7207 },
7208 theme: 'default',
7209 width: 'resolve'
7210 };
7211 };
7212
7213 Defaults.prototype.applyFromElement = function (options, $element) {
7214 var optionLanguage = options.language;
7215 var defaultLanguage = this.defaults.language;
7216 var elementLanguage = $element.prop('lang');
7217 var parentLanguage = $element.closest('[lang]').prop('lang');
7218 var languages = Array.prototype.concat.call(this._resolveLanguage(elementLanguage), this._resolveLanguage(optionLanguage), this._resolveLanguage(defaultLanguage), this._resolveLanguage(parentLanguage));
7219 options.language = languages;
7220 return options;
7221 };
7222
7223 Defaults.prototype._resolveLanguage = function (language) {
7224 if (!language) {
7225 return [];
7226 }
7227
7228 if ($.isEmptyObject(language)) {
7229 return [];
7230 }
7231
7232 if ($.isPlainObject(language)) {
7233 return [language];
7234 }
7235
7236 var languages;
7237
7238 if (!Array.isArray(language)) {
7239 languages = [language];
7240 } else {
7241 languages = language;
7242 }
7243
7244 var resolvedLanguages = [];
7245
7246 for (var l = 0; l < languages.length; l++) {
7247 resolvedLanguages.push(languages[l]);
7248
7249 if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
7250 // Extract the region information if it is included
7251 var languageParts = languages[l].split('-');
7252 var baseLanguage = languageParts[0];
7253 resolvedLanguages.push(baseLanguage);
7254 }
7255 }
7256
7257 return resolvedLanguages;
7258 };
7259
7260 Defaults.prototype._processTranslations = function (languages, debug) {
7261 var translations = new Translation();
7262
7263 for (var l = 0; l < languages.length; l++) {
7264 var languageData = new Translation();
7265 var language = languages[l];
7266
7267 if (typeof language === 'string') {
7268 try {
7269 // Try to load it with the original name
7270 languageData = Translation.loadPath(language);
7271 } catch (e) {
7272 try {
7273 // If we couldn't load it, check if it wasn't the full path
7274 language = this.defaults.amdLanguageBase + language;
7275 languageData = Translation.loadPath(language);
7276 } catch (ex) {
7277 // The translation could not be loaded at all. Sometimes this is
7278 // because of a configuration problem, other times this can be
7279 // because of how Select2 helps load all possible translation files
7280 if (debug && window.console && console.warn) {
7281 console.warn('Select2: The language file for "' + language + '" could ' + 'not be automatically loaded. A fallback will be used instead.');
7282 }
7283 }
7284 }
7285 } else if ($.isPlainObject(language)) {
7286 languageData = new Translation(language);
7287 } else {
7288 languageData = language;
7289 }
7290
7291 translations.extend(languageData);
7292 }
7293
7294 return translations;
7295 };
7296
7297 Defaults.prototype.set = function (key, value) {
7298 var camelKey = $.camelCase(key);
7299 var data = {};
7300 data[camelKey] = value;
7301
7302 var convertedData = Utils._convertData(data);
7303
7304 $.extend(true, this.defaults, convertedData);
7305 };
7306
7307 var defaults = new Defaults();
7308 return defaults;
7309 });
7310 S2.define('select2/options', ['jquery', './defaults', './utils'], function ($, Defaults, Utils) {
7311 function Options(options, $element) {
7312 this.options = options;
7313
7314 if ($element != null) {
7315 this.fromElement($element);
7316 }
7317
7318 if ($element != null) {
7319 this.options = Defaults.applyFromElement(this.options, $element);
7320 }
7321
7322 this.options = Defaults.apply(this.options);
7323 }
7324
7325 Options.prototype.fromElement = function ($e) {
7326 var excludedData = ['select2'];
7327
7328 if (this.options.multiple == null) {
7329 this.options.multiple = $e.prop('multiple');
7330 }
7331
7332 if (this.options.disabled == null) {
7333 this.options.disabled = $e.prop('disabled');
7334 }
7335
7336 if (this.options.autocomplete == null && $e.prop('autocomplete')) {
7337 this.options.autocomplete = $e.prop('autocomplete');
7338 }
7339
7340 if (this.options.dir == null) {
7341 if ($e.prop('dir')) {
7342 this.options.dir = $e.prop('dir');
7343 } else if ($e.closest('[dir]').prop('dir')) {
7344 this.options.dir = $e.closest('[dir]').prop('dir');
7345 } else {
7346 this.options.dir = 'ltr';
7347 }
7348 }
7349
7350 $e.prop('disabled', this.options.disabled);
7351 $e.prop('multiple', this.options.multiple);
7352
7353 if (Utils.GetData($e[0], 'select2Tags')) {
7354 if (this.options.debug && window.console && console.warn) {
7355 console.warn('Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.');
7356 }
7357
7358 Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
7359 Utils.StoreData($e[0], 'tags', true);
7360 }
7361
7362 if (Utils.GetData($e[0], 'ajaxUrl')) {
7363 if (this.options.debug && window.console && console.warn) {
7364 console.warn('Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.');
7365 }
7366
7367 $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
7368 Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
7369 }
7370
7371 var dataset = {};
7372
7373 function upperCaseLetter(_, letter) {
7374 return letter.toUpperCase();
7375 } // Pre-load all of the attributes which are prefixed with `data-`
7376
7377
7378 for (var attr = 0; attr < $e[0].attributes.length; attr++) {
7379 var attributeName = $e[0].attributes[attr].name;
7380 var prefix = 'data-';
7381
7382 if (attributeName.substr(0, prefix.length) == prefix) {
7383 // Get the contents of the attribute after `data-`
7384 var dataName = attributeName.substring(prefix.length); // Get the data contents from the consistent source
7385 // This is more than likely the jQuery data helper
7386
7387 var dataValue = Utils.GetData($e[0], dataName); // camelCase the attribute name to match the spec
7388
7389 var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter); // Store the data attribute contents into the dataset since
7390
7391 dataset[camelDataName] = dataValue;
7392 }
7393 } // Prefer the element's `dataset` attribute if it exists
7394 // jQuery 1.x does not correctly handle data attributes with multiple dashes
7395
7396
7397 if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
7398 dataset = $.extend(true, {}, $e[0].dataset, dataset);
7399 } // Prefer our internal data cache if it exists
7400
7401
7402 var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
7403 data = Utils._convertData(data);
7404
7405 for (var key in data) {
7406 if (excludedData.indexOf(key) > -1) {
7407 continue;
7408 }
7409
7410 if ($.isPlainObject(this.options[key])) {
7411 $.extend(this.options[key], data[key]);
7412 } else {
7413 this.options[key] = data[key];
7414 }
7415 }
7416
7417 return this;
7418 };
7419
7420 Options.prototype.get = function (key) {
7421 return this.options[key];
7422 };
7423
7424 Options.prototype.set = function (key, val) {
7425 this.options[key] = val;
7426 };
7427
7428 return Options;
7429 });
7430 S2.define('select2/core', ['jquery', './options', './utils', './keys'], function ($, Options, Utils, KEYS) {
7431 var Select2 = function Select2($element, options) {
7432 if (Utils.GetData($element[0], 'select2') != null) {
7433 Utils.GetData($element[0], 'select2').destroy();
7434 }
7435
7436 this.$element = $element;
7437 this.id = this._generateId($element);
7438 options = options || {};
7439 this.options = new Options(options, $element);
7440
7441 Select2.__super__.constructor.call(this); // Set up the tabindex
7442
7443
7444 var tabindex = $element.attr('tabindex') || 0;
7445 Utils.StoreData($element[0], 'old-tabindex', tabindex);
7446 $element.attr('tabindex', '-1'); // Set up containers and adapters
7447
7448 var DataAdapter = this.options.get('dataAdapter');
7449 this.dataAdapter = new DataAdapter($element, this.options);
7450 var $container = this.render();
7451
7452 this._placeContainer($container);
7453
7454 var SelectionAdapter = this.options.get('selectionAdapter');
7455 this.selection = new SelectionAdapter($element, this.options);
7456 this.$selection = this.selection.render();
7457 this.selection.position(this.$selection, $container);
7458 var DropdownAdapter = this.options.get('dropdownAdapter');
7459 this.dropdown = new DropdownAdapter($element, this.options);
7460 this.$dropdown = this.dropdown.render();
7461 this.dropdown.position(this.$dropdown, $container);
7462 var ResultsAdapter = this.options.get('resultsAdapter');
7463 this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
7464 this.$results = this.results.render();
7465 this.results.position(this.$results, this.$dropdown); // Bind events
7466
7467 var self = this; // Bind the container to all of the adapters
7468
7469 this._bindAdapters(); // Register any DOM event handlers
7470
7471
7472 this._registerDomEvents(); // Register any internal event handlers
7473
7474
7475 this._registerDataEvents();
7476
7477 this._registerSelectionEvents();
7478
7479 this._registerDropdownEvents();
7480
7481 this._registerResultsEvents();
7482
7483 this._registerEvents(); // Set the initial state
7484
7485
7486 this.dataAdapter.current(function (initialData) {
7487 self.trigger('selection:update', {
7488 data: initialData
7489 });
7490 }); // Hide the original select
7491
7492 $element[0].classList.add('select2-hidden-accessible');
7493 $element.attr('aria-hidden', 'true'); // Hide the original select with SUI. @edited
7494
7495 $element.addClass('sui-screen-reader-text'); // Synchronize any monitored attributes
7496
7497 this._syncAttributes();
7498
7499 Utils.StoreData($element[0], 'select2', this); // Ensure backwards compatibility with $element.data('select2').
7500
7501 $element.data('select2', this);
7502 };
7503
7504 Utils.Extend(Select2, Utils.Observable);
7505
7506 Select2.prototype._generateId = function ($element) {
7507 var id = '';
7508
7509 if ($element.attr('id') != null) {
7510 id = $element.attr('id');
7511 } else if ($element.attr('name') != null) {
7512 id = $element.attr('name') + '-' + Utils.generateChars(2);
7513 } else {
7514 id = Utils.generateChars(4);
7515 }
7516
7517 id = id.replace(/(:|\.|\[|\]|,)/g, '');
7518 id = 'select2-' + id;
7519 return id;
7520 };
7521
7522 Select2.prototype._placeContainer = function ($container) {
7523 $container.insertAfter(this.$element);
7524
7525 var width = this._resolveWidth(this.$element, this.options.get('width'));
7526
7527 if (width != null) {
7528 $container.css('width', width);
7529 }
7530 };
7531
7532 Select2.prototype._resolveWidth = function ($element, method) {
7533 var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
7534
7535 if (method == 'resolve') {
7536 var styleWidth = this._resolveWidth($element, 'style');
7537
7538 if (styleWidth != null) {
7539 return styleWidth;
7540 }
7541
7542 return this._resolveWidth($element, 'element');
7543 }
7544
7545 if (method == 'element') {
7546 var elementWidth = $element.outerWidth(false);
7547
7548 if (elementWidth <= 0) {
7549 return 'auto';
7550 }
7551
7552 return elementWidth + 'px';
7553 }
7554
7555 if (method == 'style') {
7556 var style = $element.attr('style');
7557
7558 if (typeof style !== 'string') {
7559 return null;
7560 }
7561
7562 var attrs = style.split(';');
7563
7564 for (var i = 0, l = attrs.length; i < l; i = i + 1) {
7565 var attr = attrs[i].replace(/\s/g, '');
7566 var matches = attr.match(WIDTH);
7567
7568 if (matches !== null && matches.length >= 1) {
7569 return matches[1];
7570 }
7571 }
7572
7573 return null;
7574 }
7575
7576 if (method == 'computedstyle') {
7577 var computedStyle = window.getComputedStyle($element[0]);
7578 return computedStyle.width;
7579 }
7580
7581 return method;
7582 };
7583
7584 Select2.prototype._bindAdapters = function () {
7585 this.dataAdapter.bind(this, this.$container);
7586 this.selection.bind(this, this.$container);
7587 this.dropdown.bind(this, this.$container);
7588 this.results.bind(this, this.$container);
7589 };
7590
7591 Select2.prototype._registerDomEvents = function () {
7592 var self = this;
7593 this.$element.on('change.select2', function () {
7594 self.dataAdapter.current(function (data) {
7595 self.trigger('selection:update', {
7596 data: data
7597 });
7598 });
7599 });
7600 this.$element.on('focus.select2', function (evt) {
7601 self.trigger('focus', evt);
7602 });
7603 this._syncA = Utils.bind(this._syncAttributes, this);
7604 this._syncS = Utils.bind(this._syncSubtree, this);
7605 this._observer = new window.MutationObserver(function (mutations) {
7606 self._syncA();
7607
7608 self._syncS(mutations);
7609 });
7610
7611 this._observer.observe(this.$element[0], {
7612 attributes: true,
7613 childList: true,
7614 subtree: false
7615 });
7616 };
7617
7618 Select2.prototype._registerDataEvents = function () {
7619 var self = this;
7620 this.dataAdapter.on('*', function (name, params) {
7621 self.trigger(name, params);
7622 });
7623 };
7624
7625 Select2.prototype._registerSelectionEvents = function () {
7626 var self = this;
7627 var nonRelayEvents = ['toggle', 'focus'];
7628 this.selection.on('toggle', function () {
7629 self.toggleDropdown();
7630 });
7631 this.selection.on('focus', function (params) {
7632 self.focus(params);
7633 });
7634 this.selection.on('*', function (name, params) {
7635 if (nonRelayEvents.indexOf(name) !== -1) {
7636 return;
7637 }
7638
7639 self.trigger(name, params);
7640 });
7641 };
7642
7643 Select2.prototype._registerDropdownEvents = function () {
7644 var self = this;
7645 this.dropdown.on('*', function (name, params) {
7646 self.trigger(name, params);
7647 });
7648 };
7649
7650 Select2.prototype._registerResultsEvents = function () {
7651 var self = this;
7652 this.results.on('*', function (name, params) {
7653 self.trigger(name, params);
7654 });
7655 };
7656
7657 Select2.prototype._registerEvents = function () {
7658 var self = this;
7659 this.on('open', function () {
7660 self.$container[0].classList.add('select2-container--open');
7661 });
7662 this.on('close', function () {
7663 self.$container[0].classList.remove('select2-container--open');
7664 });
7665 this.on('enable', function () {
7666 self.$container[0].classList.remove('select2-container--disabled');
7667 });
7668 this.on('disable', function () {
7669 self.$container[0].classList.add('select2-container--disabled');
7670 });
7671 this.on('blur', function () {
7672 self.$container[0].classList.remove('select2-container--focus');
7673 });
7674 this.on('query', function (params) {
7675 if (!self.isOpen()) {
7676 self.trigger('open', {});
7677 }
7678
7679 this.dataAdapter.query(params, function (data) {
7680 self.trigger('results:all', {
7681 data: data,
7682 query: params
7683 });
7684 });
7685 });
7686 this.on('query:append', function (params) {
7687 this.dataAdapter.query(params, function (data) {
7688 self.trigger('results:append', {
7689 data: data,
7690 query: params
7691 });
7692 });
7693 });
7694 this.on('keypress', function (evt) {
7695 var key = evt.which;
7696
7697 if (self.isOpen()) {
7698 if (key === KEYS.ESC || key === KEYS.UP && evt.altKey) {
7699 self.close(evt);
7700 evt.preventDefault();
7701 } else if (key === KEYS.ENTER || key === KEYS.TAB) {
7702 self.trigger('results:select', {});
7703 evt.preventDefault();
7704 } else if (key === KEYS.SPACE && evt.ctrlKey) {
7705 self.trigger('results:toggle', {});
7706 evt.preventDefault();
7707 } else if (key === KEYS.UP) {
7708 self.trigger('results:previous', {});
7709 evt.preventDefault();
7710 } else if (key === KEYS.DOWN) {
7711 self.trigger('results:next', {});
7712 evt.preventDefault();
7713 }
7714 } else {
7715 if (key === KEYS.ENTER || key === KEYS.SPACE || key === KEYS.DOWN && evt.altKey) {
7716 self.open();
7717 evt.preventDefault();
7718 }
7719 }
7720 });
7721 };
7722
7723 Select2.prototype._syncAttributes = function () {
7724 this.options.set('disabled', this.$element.prop('disabled'));
7725
7726 if (this.isDisabled()) {
7727 if (this.isOpen()) {
7728 this.close();
7729 }
7730
7731 this.trigger('disable', {});
7732 } else {
7733 this.trigger('enable', {});
7734 }
7735 };
7736
7737 Select2.prototype._isChangeMutation = function (mutations) {
7738 var self = this;
7739
7740 if (mutations.addedNodes && mutations.addedNodes.length > 0) {
7741 for (var n = 0; n < mutations.addedNodes.length; n++) {
7742 var node = mutations.addedNodes[n];
7743
7744 if (node.selected) {
7745 return true;
7746 }
7747 }
7748 } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
7749 return true;
7750 } else if (Array.isArray(mutations)) {
7751 return mutations.some(function (mutation) {
7752 return self._isChangeMutation(mutation);
7753 });
7754 }
7755
7756 return false;
7757 };
7758
7759 Select2.prototype._syncSubtree = function (mutations) {
7760 var changed = this._isChangeMutation(mutations);
7761
7762 var self = this; // Only re-pull the data if we think there is a change
7763
7764 if (changed) {
7765 this.dataAdapter.current(function (currentData) {
7766 self.trigger('selection:update', {
7767 data: currentData
7768 });
7769 });
7770 }
7771 };
7772 /**
7773 * Override the trigger method to automatically trigger pre-events when
7774 * there are events that can be prevented.
7775 */
7776
7777
7778 Select2.prototype.trigger = function (name, args) {
7779 var actualTrigger = Select2.__super__.trigger;
7780 var preTriggerMap = {
7781 'open': 'opening',
7782 'close': 'closing',
7783 'select': 'selecting',
7784 'unselect': 'unselecting',
7785 'clear': 'clearing'
7786 };
7787
7788 if (args === undefined) {
7789 args = {};
7790 }
7791
7792 if (name in preTriggerMap) {
7793 var preTriggerName = preTriggerMap[name];
7794 var preTriggerArgs = {
7795 prevented: false,
7796 name: name,
7797 args: args
7798 };
7799 actualTrigger.call(this, preTriggerName, preTriggerArgs);
7800
7801 if (preTriggerArgs.prevented) {
7802 args.prevented = true;
7803 return;
7804 }
7805 }
7806
7807 actualTrigger.call(this, name, args);
7808 };
7809
7810 Select2.prototype.toggleDropdown = function () {
7811 if (this.isDisabled()) {
7812 return;
7813 }
7814
7815 if (this.isOpen()) {
7816 this.close();
7817 } else {
7818 this.open();
7819 }
7820 };
7821
7822 Select2.prototype.open = function () {
7823 if (this.isOpen()) {
7824 return;
7825 }
7826
7827 if (this.isDisabled()) {
7828 return;
7829 }
7830
7831 this.trigger('query', {});
7832 };
7833
7834 Select2.prototype.close = function (evt) {
7835 if (!this.isOpen()) {
7836 return;
7837 }
7838
7839 this.trigger('close', {
7840 originalEvent: evt
7841 });
7842 };
7843 /**
7844 * Helper method to abstract the "enabled" (not "disabled") state of this
7845 * object.
7846 *
7847 * @return {true} if the instance is not disabled.
7848 * @return {false} if the instance is disabled.
7849 */
7850
7851
7852 Select2.prototype.isEnabled = function () {
7853 return !this.isDisabled();
7854 };
7855 /**
7856 * Helper method to abstract the "disabled" state of this object.
7857 *
7858 * @return {true} if the disabled option is true.
7859 * @return {false} if the disabled option is false.
7860 */
7861
7862
7863 Select2.prototype.isDisabled = function () {
7864 return this.options.get('disabled');
7865 };
7866
7867 Select2.prototype.isOpen = function () {
7868 return this.$container[0].classList.contains('select2-container--open');
7869 };
7870
7871 Select2.prototype.hasFocus = function () {
7872 return this.$container[0].classList.contains('select2-container--focus');
7873 };
7874
7875 Select2.prototype.focus = function (data) {
7876 // No need to re-trigger focus events if we are already focused
7877 if (this.hasFocus()) {
7878 return;
7879 }
7880
7881 this.$container[0].classList.add('select2-container--focus');
7882 this.trigger('focus', {});
7883 };
7884
7885 Select2.prototype.enable = function (args) {
7886 if (this.options.get('debug') && window.console && console.warn) {
7887 console.warn('Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.');
7888 }
7889
7890 if (args == null || args.length === 0) {
7891 args = [true];
7892 }
7893
7894 var disabled = !args[0];
7895 this.$element.prop('disabled', disabled);
7896 };
7897
7898 Select2.prototype.data = function () {
7899 if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) {
7900 console.warn('Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.');
7901 }
7902
7903 var data = [];
7904 this.dataAdapter.current(function (currentData) {
7905 data = currentData;
7906 });
7907 return data;
7908 };
7909
7910 Select2.prototype.val = function (args) {
7911 if (this.options.get('debug') && window.console && console.warn) {
7912 console.warn('Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.');
7913 }
7914
7915 if (args == null || args.length === 0) {
7916 return this.$element.val();
7917 }
7918
7919 var newVal = args[0];
7920
7921 if (Array.isArray(newVal)) {
7922 newVal = newVal.map(function (obj) {
7923 return obj.toString();
7924 });
7925 }
7926
7927 this.$element.val(newVal).trigger('input').trigger('change');
7928 };
7929
7930 Select2.prototype.destroy = function () {
7931 Utils.RemoveData(this.$container[0]);
7932 this.$container.remove();
7933
7934 this._observer.disconnect();
7935
7936 this._observer = null;
7937 this._syncA = null;
7938 this._syncS = null;
7939 this.$element.off('.select2');
7940 this.$element.attr('tabindex', Utils.GetData(this.$element[0], 'old-tabindex')); // Remove SUI screen reader class. @edited
7941
7942 this.$element.removeClass('sui-screen-reader-text');
7943 this.$element[0].classList.remove('select2-hidden-accessible');
7944 this.$element.attr('aria-hidden', 'false');
7945 Utils.RemoveData(this.$element[0]);
7946 this.$element.removeData('select2');
7947 this.dataAdapter.destroy();
7948 this.selection.destroy();
7949 this.dropdown.destroy();
7950 this.results.destroy();
7951 this.dataAdapter = null;
7952 this.selection = null;
7953 this.dropdown = null;
7954 this.results = null;
7955 };
7956
7957 Select2.prototype.render = function () {
7958 var $container = $('<span class="select2 select2-container">' + '<span class="selection"></span>' + '<span class="dropdown-wrapper" aria-hidden="true"></span>' + '</span>');
7959 $container.attr('dir', this.options.get('dir'));
7960 this.$container = $container; // Add SUIselect class to select main div. @edited
7961
7962 this.$container[0].classList.add('sui-select'); // Additional class for themes. @edited
7963
7964 if ('default' !== this.options.get('theme')) {
7965 this.$container[0].classList.add('sui-select-theme--' + this.options.get('theme'));
7966 }
7967
7968 Utils.StoreData($container[0], 'element', this.$element);
7969 return $container;
7970 };
7971
7972 return Select2;
7973 });
7974 S2.define('jquery-mousewheel', ['jquery'], function ($) {
7975 // Used to shim jQuery.mousewheel for non-full builds.
7976 return $;
7977 });
7978 /**
7979 * Rebranding select2 to SUIselect2
7980 * It does avoid conflicts with other(s) that include select2 manually
7981 * @edited
7982 */
7983
7984 S2.define('sui.select2', ['jquery', 'jquery-mousewheel', './select2/core', './select2/defaults', './select2/utils'], function ($, _, Select2, Defaults, Utils) {
7985 // Rename function. @edited
7986 if ($.fn.SUIselect2 == null) {
7987 // All methods that should return the element
7988 var thisMethods = ['open', 'close', 'destroy']; // Rename function. @edited
7989
7990 $.fn.SUIselect2 = function (options) {
7991 options = options || {};
7992
7993 if (_typeof(options) === 'object') {
7994 this.each(function () {
7995 var instanceOptions = $.extend(true, {}, options);
7996 var instance = new Select2($(this), instanceOptions);
7997 });
7998 return this;
7999 } else if (typeof options === 'string') {
8000 var ret;
8001 var args = Array.prototype.slice.call(arguments, 1);
8002 this.each(function () {
8003 var instance = Utils.GetData(this, 'select2');
8004
8005 if (instance == null && window.console && console.error) {
8006 // Rename function on error message. @edited
8007 console.error('The SUIselect2(\'' + options + '\') method was called on an ' + 'element that is not using Select2.');
8008 }
8009
8010 ret = instance[options].apply(instance, args);
8011 }); // Check if we should be returning `this`
8012
8013 if (thisMethods.indexOf(options) > -1) {
8014 return this;
8015 }
8016
8017 return ret;
8018 } else {
8019 // Rename function on error message. @edited
8020 throw new Error('Invalid arguments for SUIselect2: ' + options);
8021 }
8022 };
8023 } // Rename function. @edited
8024
8025
8026 if ($.fn.SUIselect2.defaults == null) {
8027 $.fn.SUIselect2.defaults = Defaults; // Rename function. @edited
8028 }
8029
8030 return Select2;
8031 }); // Return the AMD loader configuration so it can be used outside of this file
8032
8033 return {
8034 define: S2.define,
8035 require: S2.require
8036 };
8037 }(); // Autoload the jQuery bindings
8038 // We know that all of the modules exist above this, so we're safe
8039
8040
8041 var select2 = S2.require('sui.select2'); // Rename function. @edited
8042 // Hold the AMD module references on the jQuery function that was just loaded
8043 // This allows Select2 to use the internal loader outside of this file, such
8044 // as in the language files.
8045 // jQuery.fn.select2.amd = S2;
8046 // Return the Select2 instance for anyone who is importing it.
8047
8048
8049 return select2;
8050 });
8051 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8052
8053 ;
8054
8055 (function ($) {
8056 // Define global SUI object if it doesn't exist.
8057 if ('object' !== _typeof(window.SUI)) {
8058 window.SUI = {};
8059 }
8060
8061 SUI.select = {};
8062
8063 SUI.select.formatIcon = function (data, container) {
8064 var markup;
8065 var label = data.text;
8066 var icon = $(data.element).attr('data-icon');
8067
8068 if (!data.id) {
8069 return label; // optgroup.
8070 }
8071
8072 if ('undefined' !== typeof icon) {
8073 markup = '<span class="sui-icon-' + icon.toLowerCase() + '" aria-hidden="true"></span> ' + label;
8074 } else {
8075 markup = label;
8076 }
8077
8078 return markup;
8079 };
8080
8081 SUI.select.formatIconSelection = function (data, container) {
8082 var markup;
8083 var label = data.text;
8084 var icon = $(data.element).attr('data-icon');
8085
8086 if ('undefined' !== typeof icon) {
8087 markup = '<span class="sui-icon-' + icon.toLowerCase() + '" aria-hidden="true"></span> ' + label;
8088 } else {
8089 markup = label;
8090 }
8091
8092 return markup;
8093 };
8094
8095 SUI.select.formatColor = function (data, container) {
8096 var markup, border;
8097 var label = data.text;
8098 var color = $(data.element).attr('data-color');
8099
8100 if (!data.id) {
8101 return label; // optgroup.
8102 }
8103
8104 if ('undefined' !== typeof color) {
8105 switch (color) {
8106 case '#FFF':
8107 case 'white':
8108 case '#FFFFFF':
8109 border = '#000';
8110 break;
8111
8112 case '#FAFAFA':
8113 case '#F8F8F8':
8114 case '#F2F2F2':
8115 border = '#333';
8116 break;
8117
8118 default:
8119 border = color;
8120 break;
8121 }
8122
8123 markup = '<span class="sui-color" style="border-color: ' + border + '; background-color: ' + color + ';" aria-hidden="true"></span> ' + label;
8124 } else {
8125 markup = label;
8126 }
8127
8128 return markup;
8129 };
8130
8131 SUI.select.formatColorSelection = function (data, container) {
8132 var markup;
8133 var label = data.text;
8134 var color = $(data.element).attr('data-color');
8135
8136 if ('undefined' !== typeof color) {
8137 switch (color) {
8138 case '#FFF':
8139 case 'white':
8140 case '#FFFFFF':
8141 border = '#000';
8142 break;
8143
8144 case '#FAFAFA':
8145 case '#F8F8F8':
8146 case '#F2F2F2':
8147 border = '#333';
8148 break;
8149
8150 default:
8151 border = color;
8152 break;
8153 }
8154
8155 markup = '<span class="sui-color" style="border-color: ' + border + '; background-color: ' + color + ';" aria-hidden="true"></span> ' + label;
8156 } else {
8157 markup = label;
8158 }
8159
8160 return markup;
8161 };
8162
8163 SUI.select.formatVars = function (data, container) {
8164 var markup;
8165 var label = data.text;
8166 var content = $(data.element).val();
8167
8168 if (!data.id) {
8169 return label; // optgroup.
8170 }
8171
8172 if ('undefined' !== typeof content) {
8173 markup = '<span class="sui-variable-name">' + label + '</span><span class="sui-variable-value">' + content + '</span> ';
8174 } else {
8175 markup = label;
8176 }
8177
8178 return markup;
8179 };
8180
8181 SUI.select.formatVarsSelection = function (data, container) {
8182 var markup;
8183 var label = data.text;
8184 markup = '<span class="sui-icon-plus-circle sui-md" aria-hidden="true"></span>';
8185 markup += '<span class="sui-screen-reader-text">' + label + '</span>';
8186 return markup;
8187 };
8188
8189 SUI.select.init = function (select) {
8190 var getParent = select.closest('.sui-modal-content'),
8191 getParentId = getParent.attr('id'),
8192 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-24'),
8193 hasSearch = 'true' === select.attr('data-search') ? 0 : -1,
8194 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8195 select.SUIselect2({
8196 dropdownParent: selectParent,
8197 minimumResultsForSearch: hasSearch,
8198 dropdownCssClass: isSmall
8199 });
8200 };
8201
8202 SUI.select.initIcon = function (select) {
8203 var getParent = select.closest('.sui-modal-content'),
8204 getParentId = getParent.attr('id'),
8205 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-24'),
8206 hasSearch = 'true' === select.attr('data-search') ? 0 : -1,
8207 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8208 select.SUIselect2({
8209 dropdownParent: selectParent,
8210 templateResult: SUI.select.formatIcon,
8211 templateSelection: SUI.select.formatIconSelection,
8212 escapeMarkup: function escapeMarkup(markup) {
8213 return markup;
8214 },
8215 minimumResultsForSearch: hasSearch,
8216 dropdownCssClass: isSmall
8217 });
8218 };
8219
8220 SUI.select.initColor = function (select) {
8221 var getParent = select.closest('.sui-modal-content'),
8222 getParentId = getParent.attr('id'),
8223 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-24'),
8224 hasSearch = 'true' === select.attr('data-search') ? 0 : -1,
8225 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8226 select.SUIselect2({
8227 dropdownParent: selectParent,
8228 templateResult: SUI.select.formatColor,
8229 templateSelection: SUI.select.formatColorSelection,
8230 escapeMarkup: function escapeMarkup(markup) {
8231 return markup;
8232 },
8233 minimumResultsForSearch: hasSearch,
8234 dropdownCssClass: isSmall
8235 });
8236 };
8237
8238 SUI.select.initSearch = function (select) {
8239 var getParent = select.closest('.sui-modal-content'),
8240 getParentId = getParent.attr('id'),
8241 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-24'),
8242 isSmall = select.hasClass('sui-select-sm') ? 'sui-select-dropdown-sm' : '';
8243 select.SUIselect2({
8244 dropdownParent: selectParent,
8245 minimumInputLength: 2,
8246 maximumSelectionLength: 1,
8247 dropdownCssClass: isSmall
8248 });
8249 };
8250
8251 SUI.select.initVars = function (select) {
8252 var getParent = select.closest('.sui-modal-content'),
8253 getParentId = getParent.attr('id'),
8254 selectParent = getParent.length ? $('#' + getParentId) : $('.sui-2-12-24'),
8255 hasSearch = 'true' === select.attr('data-search') ? 0 : -1;
8256 select.SUIselect2({
8257 theme: 'vars',
8258 dropdownParent: selectParent,
8259 templateResult: SUI.select.formatVars,
8260 templateSelection: SUI.select.formatVarsSelection,
8261 escapeMarkup: function escapeMarkup(markup) {
8262 return markup;
8263 },
8264 minimumResultsForSearch: hasSearch
8265 });
8266 };
8267
8268 $('.sui-select').each(function () {
8269 var select = $(this);
8270
8271 if ('icon' === select.data('theme')) {
8272 SUI.select.initIcon(select);
8273 } else if ('color' === select.data('theme')) {
8274 SUI.select.initColor(select);
8275 } else if ('search' === select.data('theme')) {
8276 SUI.select.initSearch(select);
8277 } else {
8278 SUI.select.init(select);
8279 }
8280 });
8281 $('.sui-variables').each(function () {
8282 var select = $(this);
8283 SUI.select.initVars(select);
8284 }); // add accessible class to the select.
8285
8286 if ($('.sui-color-accessible').length && $('.sui-select').length) {
8287 $('body').addClass('sui-select-accessible');
8288 }
8289 })(jQuery);
8290 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8291
8292 (function ($) {
8293 // Enable strict mode
8294 'use strict'; // Define global SUI object if it doesn't exist
8295
8296 if ('object' !== _typeof(window.SUI)) {
8297 window.SUI = {};
8298 }
8299
8300 SUI.sideTabs = function (element) {
8301 var $this = $(element),
8302 $label = $this.parent('label'),
8303 $data = $this.data('tab-menu'),
8304 $wrapper = $this.closest('.sui-side-tabs'),
8305 $alllabels = $wrapper.find('>.sui-tabs-menu .sui-tab-item'),
8306 $allinputs = $alllabels.find('input'),
8307 newContent;
8308 $this.on('click', function (e) {
8309 $alllabels.removeClass('active');
8310 $allinputs.removeProp('checked');
8311 $wrapper.find('> .sui-tabs-content > div[data-tab-content]').removeClass('active');
8312 $label.addClass('active');
8313 $this.prop('checked', true);
8314 newContent = $wrapper.find('.sui-tabs-content div[data-tab-content="' + $data + '"]');
8315
8316 if (newContent.length) {
8317 newContent.addClass('active');
8318 }
8319 });
8320 };
8321
8322 $('.sui-2-12-24 .sui-side-tabs label.sui-tab-item input').each(function () {
8323 SUI.sideTabs(this);
8324 });
8325 })(jQuery);
8326 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8327
8328 (function ($) {
8329 // Enable strict mode.
8330 'use strict'; // Define global SUI object if it doesn't exist.
8331
8332 if ('object' !== _typeof(window.SUI)) {
8333 window.SUI = {};
8334 }
8335
8336 SUI.floatInput = function () {
8337 $('body').ready(function () {
8338 var $moduleName = $('.sui-sidenav .sui-with-floating-input'),
8339 $pageHeader = $('.sui-header-inline'),
8340 $pageTitle = $pageHeader.find('.sui-header-title');
8341 var $titleWidth = $pageTitle.width(),
8342 $navWidth = $pageHeader.next().find('.sui-sidenav').width();
8343
8344 if ($titleWidth > $navWidth) {
8345 $moduleName.each(function () {
8346 $(this).css({
8347 'left': $titleWidth + 20 + 'px'
8348 });
8349 });
8350 }
8351 });
8352 };
8353
8354 SUI.floatInput();
8355 })(jQuery);
8356 (function ($) {
8357 // Enable strict mode.
8358 'use strict';
8359
8360 var _$stickies = [].slice.call(document.querySelectorAll('.sui-box-sticky'));
8361
8362 _$stickies.forEach(function (_$sticky) {
8363 if (CSS.supports && CSS.supports('position', 'sticky')) {
8364 if (null !== _$sticky.offsetParent) {
8365 apply_sticky_class(_$sticky);
8366 }
8367
8368 window.addEventListener('scroll', function () {
8369 if (null !== _$sticky.offsetParent) {
8370 apply_sticky_class(_$sticky);
8371 }
8372 });
8373 }
8374 });
8375
8376 function apply_sticky_class(_$sticky) {
8377 var currentOffset = _$sticky.getBoundingClientRect().top;
8378
8379 var stickyOffset = parseInt(getComputedStyle(_$sticky).top.replace('px', ''));
8380 var isStuck = currentOffset <= stickyOffset;
8381
8382 if (isStuck) {
8383 _$sticky.classList.add('sui-is-sticky');
8384 } else {
8385 _$sticky.classList.remove('sui-is-sticky');
8386 }
8387 }
8388 })(jQuery);
8389 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8390
8391 (function ($) {
8392 // Enable strict mode.
8393 'use strict'; // Define global SUI object if it doesn't exist.
8394
8395 if ('object' !== _typeof(window.SUI)) {
8396 window.SUI = {};
8397 }
8398
8399 SUI.suiTabs = function (config) {
8400 var data;
8401 var types = ['tab', 'pane'];
8402 var type;
8403 var groups = [];
8404 var activeGroups = [];
8405 var activeChildren = [];
8406 var activeItems = [];
8407 var indexGroup;
8408 var indexItem;
8409 var memory = [];
8410
8411 function init(options) {
8412 var groupIndex;
8413 var tabItems;
8414 var itemIndex;
8415 var hashId;
8416 data = options;
8417 setDefaults();
8418 groups.tab = document.querySelectorAll(data.tabGroup);
8419 groups.pane = document.querySelectorAll(data.paneGroup);
8420
8421 for (groupIndex = 0; groupIndex < groups.tab.length; groupIndex++) {
8422 tabItems = groups.tab[groupIndex].children;
8423
8424 for (itemIndex = 0; itemIndex < tabItems.length; itemIndex++) {
8425 tabItems[itemIndex].addEventListener('click', onClick.bind(this, groupIndex, itemIndex), false);
8426 indexGroup = groupIndex;
8427 indexItem = itemIndex;
8428
8429 if (window.location.hash) {
8430 hashId = window.location.hash.replace(/[^\w-_]/g, '');
8431
8432 if (hashId === tabItems[itemIndex].id) {
8433 setNodes(groupIndex, itemIndex);
8434 }
8435 }
8436 }
8437 }
8438 }
8439
8440 function onClick(groupIndex, itemIndex) {
8441 setNodes(groupIndex, itemIndex);
8442 setCallback();
8443 }
8444
8445 function setNodes(groupIndex, itemIndex) {
8446 var i;
8447 indexGroup = groupIndex;
8448 indexItem = itemIndex;
8449
8450 for (i = 0; i < types.length; i++) {
8451 type = types[i];
8452 setActiveGroup();
8453 setActiveChildren();
8454 setActiveItems();
8455 putActiveClass();
8456 }
8457
8458 memory[groupIndex] = [];
8459 memory[groupIndex][itemIndex] = true;
8460 }
8461
8462 function putActiveClass() {
8463 var i;
8464
8465 for (i = 0; i < activeChildren[type].length; i++) {
8466 activeChildren[type][i].classList.remove(data[type + 'Active']);
8467 }
8468
8469 activeItems[type].classList.add(data[type + 'Active']);
8470 }
8471
8472 function setDefaults() {
8473 var i;
8474
8475 for (i = 0; i < types.length; i++) {
8476 type = types[i];
8477 setOption(type + 'Group', '[data-' + type + 's]');
8478 setOption(type + 'Active', 'active');
8479 }
8480 }
8481
8482 function setOption(key, value) {
8483 data = data || [];
8484 data[key] = data[key] || value;
8485 }
8486
8487 function setActiveGroup() {
8488 activeGroups[type] = groups[type][indexGroup];
8489 }
8490
8491 function setActiveChildren() {
8492 activeChildren[type] = activeGroups[type].children;
8493 }
8494
8495 function setActiveItems() {
8496 activeItems[type] = activeChildren[type][indexItem];
8497 }
8498
8499 function setCallback() {
8500 if ('function' === typeof data.callback) {
8501 data.callback(activeItems.tab, activeItems.pane);
8502 }
8503 }
8504
8505 init(config);
8506 return;
8507 };
8508
8509 SUI.tabsOverflow = function ($el) {
8510 var tabs = $el.closest('.sui-tabs').find('[data-tabs], [role="tablist"]'),
8511 leftButton = $el.find('.sui-tabs-navigation--left'),
8512 rightButton = $el.find('.sui-tabs-navigation--right');
8513
8514 function overflowing() {
8515 if (tabs[0].scrollWidth > tabs.width()) {
8516 if (0 === tabs.scrollLeft()) {
8517 leftButton.addClass('sui-tabs-navigation--hidden');
8518 } else {
8519 leftButton.removeClass('sui-tabs-navigation--hidden');
8520 }
8521
8522 reachedEnd(0);
8523 return true;
8524 } else {
8525 leftButton.addClass('sui-tabs-navigation--hidden');
8526 rightButton.addClass('sui-tabs-navigation--hidden');
8527 return false;
8528 }
8529 }
8530
8531 overflowing();
8532
8533 function reachedEnd(offset) {
8534 var newScrollLeft, width, scrollWidth;
8535 newScrollLeft = tabs.scrollLeft() + offset;
8536 width = tabs.outerWidth();
8537 scrollWidth = tabs.get(0).scrollWidth;
8538
8539 if (scrollWidth - newScrollLeft <= width) {
8540 rightButton.addClass('sui-tabs-navigation--hidden');
8541 } else {
8542 rightButton.removeClass('sui-tabs-navigation--hidden');
8543 }
8544 }
8545
8546 leftButton.on('click', function () {
8547 rightButton.removeClass('sui-tabs-navigation--hidden');
8548
8549 if (0 >= tabs.scrollLeft() - 150) {
8550 leftButton.addClass('sui-tabs-navigation--hidden');
8551 }
8552
8553 tabs.animate({
8554 scrollLeft: '-=150'
8555 }, 400, function () {});
8556 return false;
8557 });
8558 rightButton.on('click', function () {
8559 leftButton.removeClass('sui-tabs-navigation--hidden');
8560 reachedEnd(150);
8561 tabs.animate({
8562 scrollLeft: '+=150'
8563 }, 400, function () {});
8564 return false;
8565 });
8566 $(window).on('resize', function () {
8567 overflowing();
8568 });
8569 tabs.on('scroll', function () {
8570 overflowing();
8571 });
8572 };
8573
8574 SUI.tabs = function (config) {
8575 var tablist = $('.sui-tabs > div[role="tablist"]');
8576 var data = config; // For easy reference.
8577
8578 var keys = {
8579 end: 35,
8580 home: 36,
8581 left: 37,
8582 up: 38,
8583 right: 39,
8584 down: 40,
8585 "delete": 46,
8586 enter: 13,
8587 space: 32
8588 }; // Add or substract depending on key pressed.
8589
8590 var direction = {
8591 37: -1,
8592 38: -1,
8593 39: 1,
8594 40: 1
8595 }; // Prevent function from running if tablist does not exist.
8596
8597 if (!tablist.length) {
8598 return;
8599 } // Deactivate all tabs and tab panels.
8600
8601
8602 function deactivateTabs(tabs, panels, inputs) {
8603 tabs.removeClass('active');
8604 tabs.attr('tabindex', '-1');
8605 tabs.attr('aria-selected', false);
8606 inputs.prop('checked', false);
8607 panels.removeClass('active');
8608 panels.prop('hidden', true);
8609 } // Activate current tab panel.
8610
8611
8612 function activateTab(tab) {
8613 var tabs = $(tab).closest('[role="tablist"]').find('[role="tab"]'),
8614 inputs = $(tab).closest('[role="tablist"]').find('input[type="radio"]'),
8615 panels = $(tab).closest('.sui-tabs').find('> .sui-tabs-content > [role="tabpanel"]'),
8616 controls = $(tab).attr('aria-controls'),
8617 input = $(tab).next('input[type="radio"]'),
8618 panel = $('#' + controls);
8619 deactivateTabs(tabs, panels, inputs);
8620 $(tab).addClass('active');
8621 $(tab).removeAttr('tabindex');
8622 $(tab).attr('aria-selected', true);
8623 input.prop('checked', true);
8624 panel.addClass('active');
8625 panel.prop('hidden', false);
8626 } // When a "tablist" aria-orientation is set to vertical,
8627 // only up and down arrow should function.
8628 // In all other cases only left and right should function.
8629
8630
8631 function determineOrientation(event, index, tablist) {
8632 var key = event.keyCode || event.which,
8633 vertical = 'vertical' === $(tablist).attr('aria-orientation'),
8634 proceed = false; // Check if aria orientation is set to vertical.
8635
8636 if (vertical) {
8637 if (keys.up === key || keys.down === key) {
8638 event.preventDefault();
8639 proceed = true;
8640 }
8641 } else {
8642 if (keys.left === key || keys.right === key) {
8643 proceed = true;
8644 }
8645 }
8646
8647 if (true === proceed) {
8648 switchTabOnArrowPress(event, index);
8649 }
8650 } // Either focus the next, previous, first, or last tab
8651 // depending on key pressed.
8652
8653
8654 function switchTabOnArrowPress(event, index) {
8655 var pressed, target, tabs;
8656 pressed = event.keyCode || event.which;
8657
8658 if (direction[pressed]) {
8659 target = event.target;
8660 tabs = $(target).closest('[role="tablist"]').find('> [role="tab"]');
8661
8662 if (undefined !== index) {
8663 if (tabs[index + direction[pressed]]) {
8664 tabs[index + direction[pressed]].focus();
8665 } else if (keys.left === pressed || keys.up === pressed) {
8666 tabs[tabs.length - 1].focus();
8667 } else if (keys.right === pressed || keys.down === pressed) {
8668 tabs[0].focus();
8669 }
8670 }
8671 }
8672 } // Callback function.
8673
8674
8675 function setCallback(currentTab) {
8676 var tab = $(currentTab),
8677 controls = tab.attr('aria-controls'),
8678 panel = $('#' + controls);
8679
8680 if ('function' === typeof data.callback) {
8681 data.callback(tab, panel);
8682 }
8683 } // When a tab is clicked, activateTab is fired to activate it.
8684
8685
8686 function clickEventListener(event) {
8687 var tab = event.target;
8688 activateTab(tab);
8689
8690 if (undefined !== data && 'undefined' !== data) {
8691 setCallback(tab);
8692 }
8693
8694 event.preventDefault();
8695 event.stopPropagation();
8696 }
8697
8698 function keydownEventListener(event, index, tablist) {
8699 var key = event.keyCode || event.which;
8700
8701 switch (key) {
8702 case keys.end:
8703 case keys.home:
8704 event.preventDefault();
8705 break;
8706 // Up and down are in keydown
8707 // because we need to prevent page scroll.
8708
8709 case keys.up:
8710 case keys.down:
8711 determineOrientation(event, index, tablist);
8712 break;
8713 }
8714 }
8715
8716 function keyupEventListener(event, index, tablist) {
8717 var key = event.keyCode || event.which;
8718
8719 switch (key) {
8720 case keys.left:
8721 case keys.right:
8722 determineOrientation(event, index, tablist);
8723 break;
8724
8725 case keys.enter:
8726 case keys.space:
8727 activateTab(event);
8728 break;
8729 }
8730 }
8731
8732 function init() {
8733 var tabgroup = tablist.closest('.sui-tabs'); // Run the function for each group of tabs to prevent conflicts
8734 // when having child tabs.
8735
8736 tabgroup.each(function () {
8737 var tabs, index;
8738 tabgroup = $(this);
8739 tablist = tabgroup.find('> [role="tablist"]');
8740 tabs = tablist.find('> [role="tab"]'); // Trigger events on click.
8741
8742 tabs.on('click', function (e) {
8743 clickEventListener(e); // Trigger events when pressing key.
8744 }).on('keydown', function (e) {
8745 index = $(this).index();
8746 keydownEventListener(e, index, tablist); // Trigger events when releasing key.
8747 }).on('keyup', function (e) {
8748 index = $(this).index();
8749 keyupEventListener(e, index, tablist);
8750 });
8751 });
8752 }
8753
8754 init();
8755 return this;
8756 };
8757
8758 if (0 !== $('.sui-2-12-24 .sui-tabs').length) {
8759 // Support tabs new markup.
8760 SUI.tabs(); // Support legacy tabs.
8761
8762 SUI.suiTabs();
8763 $('.sui-2-12-24 .sui-tabs-navigation').each(function () {
8764 SUI.tabsOverflow($(this));
8765 });
8766 }
8767 })(jQuery);
8768 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8769
8770 (function ($) {
8771 // Enable strict mode.
8772 'use strict'; // Define global SUI object if it doesn't exist.
8773
8774 if ('object' !== _typeof(window.SUI)) {
8775 window.SUI = {};
8776 }
8777
8778 SUI.treeOnLoad = function (element) {
8779 var tree = $(element),
8780 leaf = tree.find('li[role="treeitem"]'),
8781 branch = leaf.find('> ul[role="group"]'); // Hide sub-groups
8782
8783 branch.slideUp();
8784 leaf.each(function () {
8785 var leaf = $(this),
8786 openLeaf = leaf.attr('aria-expanded'),
8787 checkLeaf = leaf.attr('aria-selected'),
8788 node = leaf.find('> .sui-tree-node'),
8789 checkbox = node.find('> .sui-node-checkbox'),
8790 button = node.find('> span[role="button"], > button'),
8791 icon = node.find('> span[aria-hidden]'),
8792 branch = leaf.find('> ul[role="group"]'),
8793 innerLeaf = branch.find('> li[role="treeitem"]'),
8794 innerCheck = innerLeaf.find('> .sui-tree-node > .sui-node-checkbox'); // FIX: Remove unnecessary elements for leafs
8795
8796 if (('selector' === tree.data('tree') || 'selector' === tree.attr('data-tree')) && 0 !== icon.length) {
8797 button.remove();
8798 }
8799
8800 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(openLeaf) && false !== openLeaf) {
8801 // Open sub-groups
8802 if ('true' === openLeaf) {
8803 branch.slideDown();
8804 }
8805 } else {
8806 if (0 !== branch.length) {
8807 leaf.attr('aria-expanded', 'false');
8808 } else {
8809 // FIX: Remove unnecessary elements for leafs
8810 if (0 !== button.length) {
8811 button.remove();
8812 }
8813 }
8814 }
8815
8816 if ((typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) !== _typeof(checkLeaf) && false !== checkLeaf) {
8817 // Checked leafs
8818 if ('true' === checkLeaf && 0 < branch.length) {
8819 innerLeaf.attr('aria-selected', 'true');
8820
8821 if (0 !== checkbox.length && checkbox.is('label')) {
8822 checkbox.find('input').prop('checked', true);
8823 }
8824
8825 if (0 !== innerCheck.length && innerCheck.is('label')) {
8826 innerCheck.find('input').prop('checked', true);
8827 }
8828 }
8829 } else {
8830 // Unchecked leafs
8831 leaf.attr('aria-selected', 'false');
8832
8833 if (0 !== checkbox.length && checkbox.is('label')) {
8834 checkbox.find('input').prop('checked', false);
8835 }
8836 }
8837 });
8838 };
8839
8840 SUI.treeButton = function (element) {
8841 var button = $(element);
8842 button.on('click', function (e) {
8843 var button = $(this),
8844 leaf = button.closest('li[role="treeitem"]'),
8845 branch = leaf.find('> ul[role="group"]');
8846
8847 if (0 !== branch.length) {
8848 branch.slideToggle(250);
8849
8850 if ('true' === leaf.attr('aria-expanded')) {
8851 leaf.attr('aria-expanded', 'false');
8852 } else {
8853 leaf.attr('aria-expanded', 'true');
8854 }
8855 }
8856
8857 e.preventDefault();
8858 });
8859 };
8860
8861 SUI.treeCheckbox = function (element) {
8862 var checkbox = $(element);
8863 checkbox.on('click', function () {
8864 var checkbox = $(this),
8865 leaf = checkbox.closest('li[role="treeitem"]'),
8866 branches = leaf.find('ul[role="group"]'),
8867 leafs = branches.find('> li[role="treeitem"]'),
8868 checks = leafs.find('> .sui-tree-node > .sui-node-checkbox input'),
8869 topBranch = leaf.parent('ul'),
8870 topLeaf = topBranch.parent('li');
8871 var countIndex = 0,
8872 countTopBranches = topLeaf.parents('ul').length - 1;
8873
8874 if ('true' === leaf.attr('aria-selected')) {
8875 // Unselect current leaf
8876 leaf.attr('aria-selected', 'false'); // Unselect current checkbox
8877
8878 if (checkbox.is('input')) {
8879 checkbox.prop('checked', false);
8880 } // Unselect child leafs
8881
8882
8883 if (0 !== branches.length) {
8884 leafs.attr('aria-selected', 'false');
8885 } // Unselect child checkboxes
8886
8887
8888 if (0 !== checks.length) {
8889 checks.prop('checked', false);
8890 } // Unselect branch(es) when not all leafs are selected
8891
8892
8893 if (leaf.parent().is('ul') && 'group' === leaf.parent().attr('role')) {
8894 leaf.parents('ul').each(function () {
8895 var branch = $(this),
8896 leaf = branch.parent('li'),
8897 check = leaf.find('> .sui-tree-node > .sui-node-checkbox input');
8898
8899 if ('treeitem' === leaf.attr('role')) {
8900 leaf.attr('aria-selected', 'false');
8901
8902 if (0 !== check.length) {
8903 check.prop('checked', false);
8904 }
8905 }
8906 });
8907 }
8908 } else {
8909 // Select current leaf
8910 leaf.attr('aria-selected', 'true'); // Select current checkbox
8911
8912 if (checkbox.is('input')) {
8913 checkbox.prop('checked', true);
8914 } // Select child leafs
8915
8916
8917 if (0 !== branches.length) {
8918 leafs.attr('aria-selected', 'true');
8919 } // Select child checkboxes
8920
8921
8922 if (0 !== checks.length) {
8923 checks.prop('checked', true);
8924 } // Select top branch(es) when all leafs are selected
8925
8926
8927 if (0 === topLeaf.find('li[aria-selected="false"]').length) {
8928 topLeaf.attr('aria-selected', 'true');
8929
8930 for (countIndex = 0; countTopBranches >= countIndex; countIndex++) {
8931 topLeaf.parent('ul').eq(countIndex).each(function () {
8932 var branch = $(this),
8933 leafFalse = branch.find('> li[aria-selected="false"]');
8934
8935 if (0 === leafFalse.length) {
8936 branch.parent('li').attr('aria-selected', 'true');
8937 branch.parent('li').find('> .sui-tree-node > .sui-node-checkbox input').prop('checked', true);
8938 }
8939 });
8940 }
8941 }
8942 }
8943 });
8944 };
8945
8946 SUI.treeForm = function (element) {
8947 var button = $(element);
8948
8949 if ('add' === button.attr('data-button')) {
8950 button.on('click', function () {
8951 var button = $(this),
8952 leaf = button.closest('li[role="treeitem"]'),
8953 node = leaf.find('> .sui-tree-node'),
8954 expand = node.find('span[data-button="expander"]'),
8955 branch = leaf.find('> ul[role="group"]'),
8956 content = branch.find('> span[role="contentinfo"]');
8957
8958 if (0 !== content.length) {
8959 // Hide button
8960 button.hide();
8961 button.removeAttr('tabindex');
8962 button.attr('aria-hidden', 'true'); // Show content
8963
8964 content.addClass('sui-show');
8965 content.removeAttr('aria-hidden'); // FIX: Open tree if it's closed
8966
8967 if ('true' !== leaf.attr('aria-expanded')) {
8968 expand.trigger('click');
8969 } // Focus content
8970
8971
8972 content.trigger('focus');
8973 content.attr('tabindex', '-1');
8974 }
8975 });
8976 }
8977
8978 if ('remove' === button.attr('data-button')) {
8979 button.on('click', function () {
8980 var button = $(this),
8981 content = button.closest('span[role="contentinfo"]'),
8982 leaf = content.closest('li[role="treeitem"]'),
8983 node = leaf.find('> .sui-tree-node'),
8984 btnAdd = node.find('> span[data-button="add"]'); // Hide content
8985
8986 content.removeClass('sui-show');
8987 content.removeAttr('tabindex');
8988 content.attr('aria-hidden', 'true'); // Show button
8989
8990 btnAdd.show();
8991 btnAdd.removeAttr('aria-hidden');
8992 btnAdd.trigger('focus');
8993 btnAdd.attr('tabindex', '-1');
8994 });
8995 }
8996 };
8997
8998 SUI.suiTree = function (element, dynamic) {
8999 var tree = $(element);
9000
9001 if (!tree.hasClass('sui-tree') || (typeof undefined === "undefined" ? "undefined" : _typeof(undefined)) === tree.attr('data-tree')) {
9002 return;
9003 }
9004
9005 function button() {
9006 var leaf = tree.find('li[role="treeitem"]'),
9007 node = leaf.find('> .sui-tree-node'),
9008 button = node.find('> [data-button="expander"]'),
9009 label = node.find('> span.sui-node-text');
9010 button.each(function () {
9011 var button = $(this);
9012 SUI.treeButton(button);
9013 });
9014 label.each(function () {
9015 var label = $(this);
9016 SUI.treeButton(label);
9017 });
9018 }
9019
9020 function checkbox() {
9021 var leaf = tree.find('li[role="treeitem"]'),
9022 node = leaf.find('> .sui-tree-node'),
9023 checkbox = node.find('> .sui-node-checkbox');
9024 checkbox.each(function () {
9025 var checkbox = $(this).is('label') ? $(this).find('input') : $(this);
9026 SUI.treeCheckbox(checkbox);
9027 });
9028 }
9029
9030 function add() {
9031 var leaf = tree.find('li[role="treeitem"]'),
9032 node = leaf.find('> .sui-tree-node'),
9033 button = node.find('> [data-button="add"]');
9034 button.each(function () {
9035 var button = $(this);
9036 SUI.treeForm(button);
9037 });
9038 }
9039
9040 function remove() {
9041 var button = tree.find('[data-button="remove"]');
9042 button.each(function () {
9043 var button = $(this);
9044 SUI.treeForm(button);
9045 });
9046 }
9047
9048 function init() {
9049 if ('selector' === tree.data('tree') || 'directory' === tree.data('tree') || 'selector' === tree.attr('data-tree') || 'directory' === tree.atrr('data-tree')) {
9050 // Initial setup
9051 SUI.treeOnLoad(tree); // Expand action
9052
9053 button(); // Select action
9054
9055 checkbox(); // Add folder action
9056
9057 if (true === dynamic || 'true' === dynamic) {
9058 add();
9059 remove();
9060 }
9061 } // TEST: Verify if input is checked on load
9062 // if ( 'selector' === tree.data( 'tree' ) ) {
9063 //
9064 // if ( 0 !== tree.find( 'input' ).length ) {
9065 //
9066 // tree.find( 'input' ).each( function() {
9067 //
9068 // console.log( '#' + $( this ).attr( 'id' ) + ': ' + $( this ).prop( 'checked' ) );
9069 //
9070 // // Output:
9071 // // #input-id: value
9072 //
9073 // });
9074 // }
9075 // }
9076
9077 }
9078
9079 init();
9080 return this;
9081 };
9082
9083 if (0 !== $('.sui-2-12-24 .sui-tree').length) {
9084 $('.sui-2-12-24 .sui-tree').each(function () {
9085 SUI.suiTree($(this), true);
9086 });
9087 }
9088 })(jQuery);
9089 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9090
9091 (function ($) {
9092 // Enable strict mode.
9093 'use strict'; // Define global SUI object if it doesn't exist.
9094
9095 if ('object' !== _typeof(window.SUI)) {
9096 window.SUI = {};
9097 }
9098
9099 SUI.upload = function () {
9100 $('.sui-2-12-24 .sui-upload-group input[type="file"]').on('change', function (e) {
9101 var file = $(this)[0].files[0],
9102 message = $(this).find('~ .sui-upload-message');
9103
9104 if (file) {
9105 message.text(file.name);
9106 }
9107 }); // check whether element exist then execute js
9108
9109 if ($('.sui-2-12-24 .sui-file-upload').length) {
9110 // This will trigger on file change.
9111 $('.sui-2-12-24 .sui-file-browser input[type="file"]').on('change', function () {
9112 var parent = $(this).parent();
9113 var filename = $(this).val();
9114 var imageContainer = parent.find('.sui-upload-image');
9115
9116 if (filename) {
9117 var lastIndex = filename.lastIndexOf("\\");
9118
9119 if (lastIndex >= 0) {
9120 filename = filename.substring(lastIndex + 1); // To show uploaded file preview.
9121
9122 if (imageContainer.length) {
9123 var reader = new FileReader();
9124 var imagePreview = imageContainer.find('.sui-image-preview');
9125
9126 reader.onload = function (e) {
9127 imagePreview.attr('style', 'background-image: url(' + e.target.result + ' );');
9128 };
9129
9130 reader.readAsDataURL($(this)[0].files[0]);
9131 }
9132
9133 parent.find('.sui-upload-file > span').text(filename);
9134 parent.addClass('sui-has_file');
9135 }
9136 } else {
9137 if (imageContainer.length) {
9138 var imagePreview = imageContainer.find('.sui-image-preview');
9139 imagePreview.attr('style', 'background-image: url();');
9140 }
9141
9142 parent.find('.sui-upload-file > span').text('');
9143 parent.removeClass('sui-has_file');
9144 }
9145 }); // This will trigger on click of upload button
9146
9147 $('.sui-2-12-24 .sui-file-browser .sui-upload-button').on('click', function () {
9148 selectFile($(this));
9149 }); // This will trigger when user wants to remove the selected upload file
9150
9151 $('.sui-2-12-24 .sui-file-upload [aria-label="Remove file"]').on('click', function () {
9152 removeFile($(this));
9153 }); // This will trigger reupload of file
9154
9155 $('.sui-2-12-24 .sui-file-browser .sui-upload-image').on('click', function () {
9156 selectFile($(this));
9157 }); // upload drag and drop functionality
9158
9159 var isAdvancedUpload = function () {
9160 var div = document.createElement('div');
9161 return ('draggable' in div || 'ondragstart' in div && 'ondrop' in div) && 'FormData' in window && 'FileReader' in window;
9162 }();
9163
9164 var uploadArea = $('.sui-2-12-24 .sui-upload-button');
9165
9166 if (isAdvancedUpload) {
9167 var droppedFiles = false;
9168 uploadArea.on('drag dragstart dragend dragover dragenter dragleave drop', function (e) {
9169 e.preventDefault();
9170 e.stopPropagation();
9171 }).on('dragover dragenter', function () {
9172 uploadArea.addClass('sui-is-dragover');
9173 }).on('dragleave dragend drop', function () {
9174 uploadArea.removeClass('sui-is-dragover');
9175 }).on('drop', function (e) {
9176 droppedFiles = e.originalEvent.dataTransfer.files;
9177 uploadedFile($(this), droppedFiles[0], droppedFiles[0].name);
9178 });
9179 } // function to set uploaded file
9180
9181
9182 var uploadedFile = function uploadedFile(element, file, filename) {
9183 var parent = element.closest('.sui-upload');
9184 var imageContainer = parent.find('.sui-upload-image');
9185
9186 if (filename) {
9187 if (imageContainer.length) {
9188 var reader = new FileReader();
9189 var imagePreview = imageContainer.find('.sui-image-preview');
9190
9191 reader.onload = function (e) {
9192 imagePreview.attr('style', 'background-image: url(' + e.target.result + ' );');
9193 };
9194
9195 reader.readAsDataURL(file);
9196 }
9197
9198 parent.find('.sui-upload-file > span').text(filename);
9199 parent.addClass('sui-has_file');
9200 }
9201 }; // function to open browser file explorer for selecting file
9202
9203
9204 var selectFile = function selectFile(element) {
9205 var parent = element.closest('.sui-upload');
9206 var file = parent.find('input[type="file"]');
9207 file.trigger('click');
9208 }; // function to remove file
9209
9210
9211 var removeFile = function removeFile(element) {
9212 var parent = element.closest('.sui-upload');
9213 var file = parent.find('input[type="file"]');
9214 file.val('').change();
9215 };
9216 }
9217 };
9218
9219 SUI.upload();
9220 })(jQuery);
9221 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9222
9223 (function () {
9224 function o(n) {
9225 var i = e;
9226 n && (e[n] || (e[n] = {}), i = e[n]);
9227 if (!i.define || !i.define.packaged) t.original = i.define, i.define = t, i.define.packaged = !0;
9228 if (!i.require || !i.require.packaged) r.original = i.require, i.require = r, i.require.packaged = !0;
9229 }
9230
9231 var ACE_NAMESPACE = "ace",
9232 e = function () {
9233 return this;
9234 }();
9235
9236 !e && typeof window != "undefined" && (e = window);
9237 if (!ACE_NAMESPACE && typeof requirejs != "undefined") return;
9238
9239 var t = function t(e, n, r) {
9240 if (typeof e != "string") {
9241 t.original ? t.original.apply(this, arguments) : (console.error("dropping module because define wasn't a string."), console.trace());
9242 return;
9243 }
9244
9245 arguments.length == 2 && (r = n), t.modules[e] || (t.payloads[e] = r, t.modules[e] = null);
9246 };
9247
9248 t.modules = {}, t.payloads = {};
9249
9250 var n = function n(e, t, _n) {
9251 if (typeof t == "string") {
9252 var i = s(e, t);
9253 if (i != undefined) return _n && _n(), i;
9254 } else if (Object.prototype.toString.call(t) === "[object Array]") {
9255 var o = [];
9256
9257 for (var u = 0, a = t.length; u < a; ++u) {
9258 var f = s(e, t[u]);
9259 if (f == undefined && r.original) return;
9260 o.push(f);
9261 }
9262
9263 return _n && _n.apply(null, o) || !0;
9264 }
9265 },
9266 r = function r(e, t) {
9267 var i = n("", e, t);
9268 return i == undefined && r.original ? r.original.apply(this, arguments) : i;
9269 },
9270 i = function i(e, t) {
9271 if (t.indexOf("!") !== -1) {
9272 var n = t.split("!");
9273 return i(e, n[0]) + "!" + i(e, n[1]);
9274 }
9275
9276 if (t.charAt(0) == ".") {
9277 var r = e.split("/").slice(0, -1).join("/");
9278 t = r + "/" + t;
9279
9280 while (t.indexOf(".") !== -1 && s != t) {
9281 var s = t;
9282 t = t.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
9283 }
9284 }
9285
9286 return t;
9287 },
9288 s = function s(e, r) {
9289 r = i(e, r);
9290 var s = t.modules[r];
9291
9292 if (!s) {
9293 s = t.payloads[r];
9294
9295 if (typeof s == "function") {
9296 var o = {},
9297 u = {
9298 id: r,
9299 uri: "",
9300 exports: o,
9301 packaged: !0
9302 },
9303 a = function a(e, t) {
9304 return n(r, e, t);
9305 },
9306 f = s(a, o, u);
9307
9308 o = f || u.exports, t.modules[r] = o, delete t.payloads[r];
9309 }
9310
9311 s = t.modules[r] = o || s;
9312 }
9313
9314 return s;
9315 };
9316
9317 o(ACE_NAMESPACE);
9318 })(), ace.define("ace/lib/regexp", ["require", "exports", "module"], function (e, t, n) {
9319 "use strict";
9320
9321 function o(e) {
9322 return (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.extended ? "x" : "") + (e.sticky ? "y" : "");
9323 }
9324
9325 function u(e, t, n) {
9326 if (Array.prototype.indexOf) return e.indexOf(t, n);
9327
9328 for (var r = n || 0; r < e.length; r++) {
9329 if (e[r] === t) return r;
9330 }
9331
9332 return -1;
9333 }
9334
9335 var r = {
9336 exec: RegExp.prototype.exec,
9337 test: RegExp.prototype.test,
9338 match: String.prototype.match,
9339 replace: String.prototype.replace,
9340 split: String.prototype.split
9341 },
9342 i = r.exec.call(/()??/, "")[1] === undefined,
9343 s = function () {
9344 var e = /^/g;
9345 return r.test.call(e, ""), !e.lastIndex;
9346 }();
9347
9348 if (s && i) return;
9349 RegExp.prototype.exec = function (e) {
9350 var t = r.exec.apply(this, arguments),
9351 n,
9352 a;
9353
9354 if (typeof e == "string" && t) {
9355 !i && t.length > 1 && u(t, "") > -1 && (a = RegExp(this.source, r.replace.call(o(this), "g", "")), r.replace.call(e.slice(t.index), a, function () {
9356 for (var e = 1; e < arguments.length - 2; e++) {
9357 arguments[e] === undefined && (t[e] = undefined);
9358 }
9359 }));
9360 if (this._xregexp && this._xregexp.captureNames) for (var f = 1; f < t.length; f++) {
9361 n = this._xregexp.captureNames[f - 1], n && (t[n] = t[f]);
9362 }
9363 !s && this.global && !t[0].length && this.lastIndex > t.index && this.lastIndex--;
9364 }
9365
9366 return t;
9367 }, s || (RegExp.prototype.test = function (e) {
9368 var t = r.exec.call(this, e);
9369 return t && this.global && !t[0].length && this.lastIndex > t.index && this.lastIndex--, !!t;
9370 });
9371 }), ace.define("ace/lib/es5-shim", ["require", "exports", "module"], function (e, t, n) {
9372 function r() {}
9373
9374 function w(e) {
9375 try {
9376 return Object.defineProperty(e, "sentinel", {}), "sentinel" in e;
9377 } catch (t) {}
9378 }
9379
9380 function H(e) {
9381 return e = +e, e !== e ? e = 0 : e !== 0 && e !== 1 / 0 && e !== -1 / 0 && (e = (e > 0 || -1) * Math.floor(Math.abs(e))), e;
9382 }
9383
9384 function B(e) {
9385 var t = _typeof(e);
9386
9387 return e === null || t === "undefined" || t === "boolean" || t === "number" || t === "string";
9388 }
9389
9390 function j(e) {
9391 var t, n, r;
9392 if (B(e)) return e;
9393 n = e.valueOf;
9394
9395 if (typeof n == "function") {
9396 t = n.call(e);
9397 if (B(t)) return t;
9398 }
9399
9400 r = e.toString;
9401
9402 if (typeof r == "function") {
9403 t = r.call(e);
9404 if (B(t)) return t;
9405 }
9406
9407 throw new TypeError();
9408 }
9409
9410 Function.prototype.bind || (Function.prototype.bind = function (t) {
9411 var n = this;
9412 if (typeof n != "function") throw new TypeError("Function.prototype.bind called on incompatible " + n);
9413
9414 var i = u.call(arguments, 1),
9415 s = function s() {
9416 if (this instanceof s) {
9417 var e = n.apply(this, i.concat(u.call(arguments)));
9418 return Object(e) === e ? e : this;
9419 }
9420
9421 return n.apply(t, i.concat(u.call(arguments)));
9422 };
9423
9424 return n.prototype && (r.prototype = n.prototype, s.prototype = new r(), r.prototype = null), s;
9425 });
9426 var i = Function.prototype.call,
9427 s = Array.prototype,
9428 o = Object.prototype,
9429 u = s.slice,
9430 a = i.bind(o.toString),
9431 f = i.bind(o.hasOwnProperty),
9432 l,
9433 c,
9434 h,
9435 p,
9436 d;
9437 if (d = f(o, "__defineGetter__")) l = i.bind(o.__defineGetter__), c = i.bind(o.__defineSetter__), h = i.bind(o.__lookupGetter__), p = i.bind(o.__lookupSetter__);
9438 if ([1, 2].splice(0).length != 2) if (!function () {
9439 function e(e) {
9440 var t = new Array(e + 2);
9441 return t[0] = t[1] = 0, t;
9442 }
9443
9444 var t = [],
9445 n;
9446 t.splice.apply(t, e(20)), t.splice.apply(t, e(26)), n = t.length, t.splice(5, 0, "XXX"), n + 1 == t.length;
9447 if (n + 1 == t.length) return !0;
9448 }()) Array.prototype.splice = function (e, t) {
9449 var n = this.length;
9450 e > 0 ? e > n && (e = n) : e == void 0 ? e = 0 : e < 0 && (e = Math.max(n + e, 0)), e + t < n || (t = n - e);
9451 var r = this.slice(e, e + t),
9452 i = u.call(arguments, 2),
9453 s = i.length;
9454 if (e === n) s && this.push.apply(this, i);else {
9455 var o = Math.min(t, n - e),
9456 a = e + o,
9457 f = a + s - o,
9458 l = n - a,
9459 c = n - o;
9460 if (f < a) for (var h = 0; h < l; ++h) {
9461 this[f + h] = this[a + h];
9462 } else if (f > a) for (h = l; h--;) {
9463 this[f + h] = this[a + h];
9464 }
9465 if (s && e === c) this.length = c, this.push.apply(this, i);else {
9466 this.length = c + s;
9467
9468 for (h = 0; h < s; ++h) {
9469 this[e + h] = i[h];
9470 }
9471 }
9472 }
9473 return r;
9474 };else {
9475 var v = Array.prototype.splice;
9476
9477 Array.prototype.splice = function (e, t) {
9478 return arguments.length ? v.apply(this, [e === void 0 ? 0 : e, t === void 0 ? this.length - e : t].concat(u.call(arguments, 2))) : [];
9479 };
9480 }
9481 Array.isArray || (Array.isArray = function (t) {
9482 return a(t) == "[object Array]";
9483 });
9484 var m = Object("a"),
9485 g = m[0] != "a" || !(0 in m);
9486 Array.prototype.forEach || (Array.prototype.forEach = function (t) {
9487 var n = F(this),
9488 r = g && a(this) == "[object String]" ? this.split("") : n,
9489 i = arguments[1],
9490 s = -1,
9491 o = r.length >>> 0;
9492 if (a(t) != "[object Function]") throw new TypeError();
9493
9494 while (++s < o) {
9495 s in r && t.call(i, r[s], s, n);
9496 }
9497 }), Array.prototype.map || (Array.prototype.map = function (t) {
9498 var n = F(this),
9499 r = g && a(this) == "[object String]" ? this.split("") : n,
9500 i = r.length >>> 0,
9501 s = Array(i),
9502 o = arguments[1];
9503 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9504
9505 for (var u = 0; u < i; u++) {
9506 u in r && (s[u] = t.call(o, r[u], u, n));
9507 }
9508
9509 return s;
9510 }), Array.prototype.filter || (Array.prototype.filter = function (t) {
9511 var n = F(this),
9512 r = g && a(this) == "[object String]" ? this.split("") : n,
9513 i = r.length >>> 0,
9514 s = [],
9515 o,
9516 u = arguments[1];
9517 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9518
9519 for (var f = 0; f < i; f++) {
9520 f in r && (o = r[f], t.call(u, o, f, n) && s.push(o));
9521 }
9522
9523 return s;
9524 }), Array.prototype.every || (Array.prototype.every = function (t) {
9525 var n = F(this),
9526 r = g && a(this) == "[object String]" ? this.split("") : n,
9527 i = r.length >>> 0,
9528 s = arguments[1];
9529 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9530
9531 for (var o = 0; o < i; o++) {
9532 if (o in r && !t.call(s, r[o], o, n)) return !1;
9533 }
9534
9535 return !0;
9536 }), Array.prototype.some || (Array.prototype.some = function (t) {
9537 var n = F(this),
9538 r = g && a(this) == "[object String]" ? this.split("") : n,
9539 i = r.length >>> 0,
9540 s = arguments[1];
9541 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9542
9543 for (var o = 0; o < i; o++) {
9544 if (o in r && t.call(s, r[o], o, n)) return !0;
9545 }
9546
9547 return !1;
9548 }), Array.prototype.reduce || (Array.prototype.reduce = function (t) {
9549 var n = F(this),
9550 r = g && a(this) == "[object String]" ? this.split("") : n,
9551 i = r.length >>> 0;
9552 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9553 if (!i && arguments.length == 1) throw new TypeError("reduce of empty array with no initial value");
9554 var s = 0,
9555 o;
9556 if (arguments.length >= 2) o = arguments[1];else do {
9557 if (s in r) {
9558 o = r[s++];
9559 break;
9560 }
9561
9562 if (++s >= i) throw new TypeError("reduce of empty array with no initial value");
9563 } while (!0);
9564
9565 for (; s < i; s++) {
9566 s in r && (o = t.call(void 0, o, r[s], s, n));
9567 }
9568
9569 return o;
9570 }), Array.prototype.reduceRight || (Array.prototype.reduceRight = function (t) {
9571 var n = F(this),
9572 r = g && a(this) == "[object String]" ? this.split("") : n,
9573 i = r.length >>> 0;
9574 if (a(t) != "[object Function]") throw new TypeError(t + " is not a function");
9575 if (!i && arguments.length == 1) throw new TypeError("reduceRight of empty array with no initial value");
9576 var s,
9577 o = i - 1;
9578 if (arguments.length >= 2) s = arguments[1];else do {
9579 if (o in r) {
9580 s = r[o--];
9581 break;
9582 }
9583
9584 if (--o < 0) throw new TypeError("reduceRight of empty array with no initial value");
9585 } while (!0);
9586
9587 do {
9588 o in this && (s = t.call(void 0, s, r[o], o, n));
9589 } while (o--);
9590
9591 return s;
9592 });
9593 if (!Array.prototype.indexOf || [0, 1].indexOf(1, 2) != -1) Array.prototype.indexOf = function (t) {
9594 var n = g && a(this) == "[object String]" ? this.split("") : F(this),
9595 r = n.length >>> 0;
9596 if (!r) return -1;
9597 var i = 0;
9598 arguments.length > 1 && (i = H(arguments[1])), i = i >= 0 ? i : Math.max(0, r + i);
9599
9600 for (; i < r; i++) {
9601 if (i in n && n[i] === t) return i;
9602 }
9603
9604 return -1;
9605 };
9606 if (!Array.prototype.lastIndexOf || [0, 1].lastIndexOf(0, -3) != -1) Array.prototype.lastIndexOf = function (t) {
9607 var n = g && a(this) == "[object String]" ? this.split("") : F(this),
9608 r = n.length >>> 0;
9609 if (!r) return -1;
9610 var i = r - 1;
9611 arguments.length > 1 && (i = Math.min(i, H(arguments[1]))), i = i >= 0 ? i : r - Math.abs(i);
9612
9613 for (; i >= 0; i--) {
9614 if (i in n && t === n[i]) return i;
9615 }
9616
9617 return -1;
9618 };
9619 Object.getPrototypeOf || (Object.getPrototypeOf = function (t) {
9620 return t.__proto__ || (t.constructor ? t.constructor.prototype : o);
9621 });
9622
9623 if (!Object.getOwnPropertyDescriptor) {
9624 var y = "Object.getOwnPropertyDescriptor called on a non-object: ";
9625
9626 Object.getOwnPropertyDescriptor = function (t, n) {
9627 if (_typeof(t) != "object" && typeof t != "function" || t === null) throw new TypeError(y + t);
9628 if (!f(t, n)) return;
9629 var r, i, s;
9630 r = {
9631 enumerable: !0,
9632 configurable: !0
9633 };
9634
9635 if (d) {
9636 var u = t.__proto__;
9637 t.__proto__ = o;
9638 var i = h(t, n),
9639 s = p(t, n);
9640 t.__proto__ = u;
9641 if (i || s) return i && (r.get = i), s && (r.set = s), r;
9642 }
9643
9644 return r.value = t[n], r;
9645 };
9646 }
9647
9648 Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function (t) {
9649 return Object.keys(t);
9650 });
9651
9652 if (!Object.create) {
9653 var b;
9654 Object.prototype.__proto__ === null ? b = function b() {
9655 return {
9656 __proto__: null
9657 };
9658 } : b = function b() {
9659 var e = {};
9660
9661 for (var t in e) {
9662 e[t] = null;
9663 }
9664
9665 return e.constructor = e.hasOwnProperty = e.propertyIsEnumerable = e.isPrototypeOf = e.toLocaleString = e.toString = e.valueOf = e.__proto__ = null, e;
9666 }, Object.create = function (t, n) {
9667 var r;
9668 if (t === null) r = b();else {
9669 if (_typeof(t) != "object") throw new TypeError("typeof prototype[" + _typeof(t) + "] != 'object'");
9670
9671 var i = function i() {};
9672
9673 i.prototype = t, r = new i(), r.__proto__ = t;
9674 }
9675 return n !== void 0 && Object.defineProperties(r, n), r;
9676 };
9677 }
9678
9679 if (Object.defineProperty) {
9680 var E = w({}),
9681 S = typeof document == "undefined" || w(document.createElement("div"));
9682 if (!E || !S) var x = Object.defineProperty;
9683 }
9684
9685 if (!Object.defineProperty || x) {
9686 var T = "Property description must be an object: ",
9687 N = "Object.defineProperty called on non-object: ",
9688 C = "getters & setters can not be defined on this javascript engine";
9689
9690 Object.defineProperty = function (t, n, r) {
9691 if (_typeof(t) != "object" && typeof t != "function" || t === null) throw new TypeError(N + t);
9692 if (_typeof(r) != "object" && typeof r != "function" || r === null) throw new TypeError(T + r);
9693 if (x) try {
9694 return x.call(Object, t, n, r);
9695 } catch (i) {}
9696 if (f(r, "value")) {
9697 if (d && (h(t, n) || p(t, n))) {
9698 var s = t.__proto__;
9699 t.__proto__ = o, delete t[n], t[n] = r.value, t.__proto__ = s;
9700 } else t[n] = r.value;
9701 } else {
9702 if (!d) throw new TypeError(C);
9703 f(r, "get") && l(t, n, r.get), f(r, "set") && c(t, n, r.set);
9704 }
9705 return t;
9706 };
9707 }
9708
9709 Object.defineProperties || (Object.defineProperties = function (t, n) {
9710 for (var r in n) {
9711 f(n, r) && Object.defineProperty(t, r, n[r]);
9712 }
9713
9714 return t;
9715 }), Object.seal || (Object.seal = function (t) {
9716 return t;
9717 }), Object.freeze || (Object.freeze = function (t) {
9718 return t;
9719 });
9720
9721 try {
9722 Object.freeze(function () {});
9723 } catch (k) {
9724 Object.freeze = function (t) {
9725 return function (n) {
9726 return typeof n == "function" ? n : t(n);
9727 };
9728 }(Object.freeze);
9729 }
9730
9731 Object.preventExtensions || (Object.preventExtensions = function (t) {
9732 return t;
9733 }), Object.isSealed || (Object.isSealed = function (t) {
9734 return !1;
9735 }), Object.isFrozen || (Object.isFrozen = function (t) {
9736 return !1;
9737 }), Object.isExtensible || (Object.isExtensible = function (t) {
9738 if (Object(t) === t) throw new TypeError();
9739 var n = "";
9740
9741 while (f(t, n)) {
9742 n += "?";
9743 }
9744
9745 t[n] = !0;
9746 var r = f(t, n);
9747 return delete t[n], r;
9748 });
9749
9750 if (!Object.keys) {
9751 var L = !0,
9752 A = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],
9753 O = A.length;
9754
9755 for (var M in {
9756 toString: null
9757 }) {
9758 L = !1;
9759 }
9760
9761 Object.keys = function I(e) {
9762 if (_typeof(e) != "object" && typeof e != "function" || e === null) throw new TypeError("Object.keys called on a non-object");
9763 var I = [];
9764
9765 for (var t in e) {
9766 f(e, t) && I.push(t);
9767 }
9768
9769 if (L) for (var n = 0, r = O; n < r; n++) {
9770 var i = A[n];
9771 f(e, i) && I.push(i);
9772 }
9773 return I;
9774 };
9775 }
9776
9777 Date.now || (Date.now = function () {
9778 return new Date().getTime();
9779 });
9780 var _ = "\t\n\x0B\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";
9781
9782 if (!String.prototype.trim || _.trim()) {
9783 _ = "[" + _ + "]";
9784 var D = new RegExp("^" + _ + _ + "*"),
9785 P = new RegExp(_ + _ + "*$");
9786
9787 String.prototype.trim = function () {
9788 return String(this).replace(D, "").replace(P, "");
9789 };
9790 }
9791
9792 var F = function F(e) {
9793 if (e == null) throw new TypeError("can't convert " + e + " to object");
9794 return Object(e);
9795 };
9796 }), ace.define("ace/lib/fixoldbrowsers", ["require", "exports", "module", "ace/lib/regexp", "ace/lib/es5-shim"], function (e, t, n) {
9797 "use strict";
9798
9799 e("./regexp"), e("./es5-shim");
9800 }), ace.define("ace/lib/dom", ["require", "exports", "module"], function (e, t, n) {
9801 "use strict";
9802
9803 var r = "http://www.w3.org/1999/xhtml";
9804 t.getDocumentHead = function (e) {
9805 return e || (e = document), e.head || e.getElementsByTagName("head")[0] || e.documentElement;
9806 }, t.createElement = function (e, t) {
9807 return document.createElementNS ? document.createElementNS(t || r, e) : document.createElement(e);
9808 }, t.hasCssClass = function (e, t) {
9809 var n = (e.className + "").split(/\s+/g);
9810 return n.indexOf(t) !== -1;
9811 }, t.addCssClass = function (e, n) {
9812 t.hasCssClass(e, n) || (e.className += " " + n);
9813 }, t.removeCssClass = function (e, t) {
9814 var n = e.className.split(/\s+/g);
9815
9816 for (;;) {
9817 var r = n.indexOf(t);
9818 if (r == -1) break;
9819 n.splice(r, 1);
9820 }
9821
9822 e.className = n.join(" ");
9823 }, t.toggleCssClass = function (e, t) {
9824 var n = e.className.split(/\s+/g),
9825 r = !0;
9826
9827 for (;;) {
9828 var i = n.indexOf(t);
9829 if (i == -1) break;
9830 r = !1, n.splice(i, 1);
9831 }
9832
9833 return r && n.push(t), e.className = n.join(" "), r;
9834 }, t.setCssClass = function (e, n, r) {
9835 r ? t.addCssClass(e, n) : t.removeCssClass(e, n);
9836 }, t.hasCssString = function (e, t) {
9837 var n = 0,
9838 r;
9839 t = t || document;
9840
9841 if (t.createStyleSheet && (r = t.styleSheets)) {
9842 while (n < r.length) {
9843 if (r[n++].owningElement.id === e) return !0;
9844 }
9845 } else if (r = t.getElementsByTagName("style")) while (n < r.length) {
9846 if (r[n++].id === e) return !0;
9847 }
9848
9849 return !1;
9850 }, t.importCssString = function (n, r, i) {
9851 i = i || document;
9852 if (r && t.hasCssString(r, i)) return null;
9853 var s;
9854 r && (n += "\n/*# sourceURL=ace/css/" + r + " */"), i.createStyleSheet ? (s = i.createStyleSheet(), s.cssText = n, r && (s.owningElement.id = r)) : (s = t.createElement("style"), s.appendChild(i.createTextNode(n)), r && (s.id = r), t.getDocumentHead(i).appendChild(s));
9855 }, t.importCssStylsheet = function (e, n) {
9856 if (n.createStyleSheet) n.createStyleSheet(e);else {
9857 var r = t.createElement("link");
9858 r.rel = "stylesheet", r.href = e, t.getDocumentHead(n).appendChild(r);
9859 }
9860 }, t.getInnerWidth = function (e) {
9861 return parseInt(t.computedStyle(e, "paddingLeft"), 10) + parseInt(t.computedStyle(e, "paddingRight"), 10) + e.clientWidth;
9862 }, t.getInnerHeight = function (e) {
9863 return parseInt(t.computedStyle(e, "paddingTop"), 10) + parseInt(t.computedStyle(e, "paddingBottom"), 10) + e.clientHeight;
9864 }, t.scrollbarWidth = function (e) {
9865 var n = t.createElement("ace_inner");
9866 n.style.width = "100%", n.style.minWidth = "0px", n.style.height = "200px", n.style.display = "block";
9867 var r = t.createElement("ace_outer"),
9868 i = r.style;
9869 i.position = "absolute", i.left = "-10000px", i.overflow = "hidden", i.width = "200px", i.minWidth = "0px", i.height = "150px", i.display = "block", r.appendChild(n);
9870 var s = e.documentElement;
9871 s.appendChild(r);
9872 var o = n.offsetWidth;
9873 i.overflow = "scroll";
9874 var u = n.offsetWidth;
9875 return o == u && (u = r.clientWidth), s.removeChild(r), o - u;
9876 };
9877
9878 if (typeof document == "undefined") {
9879 t.importCssString = function () {};
9880
9881 return;
9882 }
9883
9884 window.pageYOffset !== undefined ? (t.getPageScrollTop = function () {
9885 return window.pageYOffset;
9886 }, t.getPageScrollLeft = function () {
9887 return window.pageXOffset;
9888 }) : (t.getPageScrollTop = function () {
9889 return document.body.scrollTop;
9890 }, t.getPageScrollLeft = function () {
9891 return document.body.scrollLeft;
9892 }), window.getComputedStyle ? t.computedStyle = function (e, t) {
9893 return t ? (window.getComputedStyle(e, "") || {})[t] || "" : window.getComputedStyle(e, "") || {};
9894 } : t.computedStyle = function (e, t) {
9895 return t ? e.currentStyle[t] : e.currentStyle;
9896 }, t.setInnerHtml = function (e, t) {
9897 var n = e.cloneNode(!1);
9898 return n.innerHTML = t, e.parentNode.replaceChild(n, e), n;
9899 }, "textContent" in document.documentElement ? (t.setInnerText = function (e, t) {
9900 e.textContent = t;
9901 }, t.getInnerText = function (e) {
9902 return e.textContent;
9903 }) : (t.setInnerText = function (e, t) {
9904 e.innerText = t;
9905 }, t.getInnerText = function (e) {
9906 return e.innerText;
9907 }), t.getParentWindow = function (e) {
9908 return e.defaultView || e.parentWindow;
9909 };
9910 }), ace.define("ace/lib/oop", ["require", "exports", "module"], function (e, t, n) {
9911 "use strict";
9912
9913 t.inherits = function (e, t) {
9914 e.super_ = t, e.prototype = Object.create(t.prototype, {
9915 constructor: {
9916 value: e,
9917 enumerable: !1,
9918 writable: !0,
9919 configurable: !0
9920 }
9921 });
9922 }, t.mixin = function (e, t) {
9923 for (var n in t) {
9924 e[n] = t[n];
9925 }
9926
9927 return e;
9928 }, t.implement = function (e, n) {
9929 t.mixin(e, n);
9930 };
9931 }), ace.define("ace/lib/keys", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/lib/oop"], function (e, t, n) {
9932 "use strict";
9933
9934 e("./fixoldbrowsers");
9935
9936 var r = e("./oop"),
9937 i = function () {
9938 var e = {
9939 MODIFIER_KEYS: {
9940 16: "Shift",
9941 17: "Ctrl",
9942 18: "Alt",
9943 224: "Meta"
9944 },
9945 KEY_MODS: {
9946 ctrl: 1,
9947 alt: 2,
9948 option: 2,
9949 shift: 4,
9950 "super": 8,
9951 meta: 8,
9952 command: 8,
9953 cmd: 8
9954 },
9955 FUNCTION_KEYS: {
9956 8: "Backspace",
9957 9: "Tab",
9958 13: "Return",
9959 19: "Pause",
9960 27: "Esc",
9961 32: "Space",
9962 33: "PageUp",
9963 34: "PageDown",
9964 35: "End",
9965 36: "Home",
9966 37: "Left",
9967 38: "Up",
9968 39: "Right",
9969 40: "Down",
9970 44: "Print",
9971 45: "Insert",
9972 46: "Delete",
9973 96: "Numpad0",
9974 97: "Numpad1",
9975 98: "Numpad2",
9976 99: "Numpad3",
9977 100: "Numpad4",
9978 101: "Numpad5",
9979 102: "Numpad6",
9980 103: "Numpad7",
9981 104: "Numpad8",
9982 105: "Numpad9",
9983 "-13": "NumpadEnter",
9984 112: "F1",
9985 113: "F2",
9986 114: "F3",
9987 115: "F4",
9988 116: "F5",
9989 117: "F6",
9990 118: "F7",
9991 119: "F8",
9992 120: "F9",
9993 121: "F10",
9994 122: "F11",
9995 123: "F12",
9996 144: "Numlock",
9997 145: "Scrolllock"
9998 },
9999 PRINTABLE_KEYS: {
10000 32: " ",
10001 48: "0",
10002 49: "1",
10003 50: "2",
10004 51: "3",
10005 52: "4",
10006 53: "5",
10007 54: "6",
10008 55: "7",
10009 56: "8",
10010 57: "9",
10011 59: ";",
10012 61: "=",
10013 65: "a",
10014 66: "b",
10015 67: "c",
10016 68: "d",
10017 69: "e",
10018 70: "f",
10019 71: "g",
10020 72: "h",
10021 73: "i",
10022 74: "j",
10023 75: "k",
10024 76: "l",
10025 77: "m",
10026 78: "n",
10027 79: "o",
10028 80: "p",
10029 81: "q",
10030 82: "r",
10031 83: "s",
10032 84: "t",
10033 85: "u",
10034 86: "v",
10035 87: "w",
10036 88: "x",
10037 89: "y",
10038 90: "z",
10039 107: "+",
10040 109: "-",
10041 110: ".",
10042 186: ";",
10043 187: "=",
10044 188: ",",
10045 189: "-",
10046 190: ".",
10047 191: "/",
10048 192: "`",
10049 219: "[",
10050 220: "\\",
10051 221: "]",
10052 222: "'",
10053 111: "/",
10054 106: "*"
10055 }
10056 },
10057 t,
10058 n;
10059
10060 for (n in e.FUNCTION_KEYS) {
10061 t = e.FUNCTION_KEYS[n].toLowerCase(), e[t] = parseInt(n, 10);
10062 }
10063
10064 for (n in e.PRINTABLE_KEYS) {
10065 t = e.PRINTABLE_KEYS[n].toLowerCase(), e[t] = parseInt(n, 10);
10066 }
10067
10068 return r.mixin(e, e.MODIFIER_KEYS), r.mixin(e, e.PRINTABLE_KEYS), r.mixin(e, e.FUNCTION_KEYS), e.enter = e["return"], e.escape = e.esc, e.del = e["delete"], e[173] = "-", function () {
10069 var t = ["cmd", "ctrl", "alt", "shift"];
10070
10071 for (var n = Math.pow(2, t.length); n--;) {
10072 e.KEY_MODS[n] = t.filter(function (t) {
10073 return n & e.KEY_MODS[t];
10074 }).join("-") + "-";
10075 }
10076 }(), e.KEY_MODS[0] = "", e.KEY_MODS[-1] = "input-", e;
10077 }();
10078
10079 r.mixin(t, i), t.keyCodeToString = function (e) {
10080 var t = i[e];
10081 return typeof t != "string" && (t = String.fromCharCode(e)), t.toLowerCase();
10082 };
10083 }), ace.define("ace/lib/useragent", ["require", "exports", "module"], function (e, t, n) {
10084 "use strict";
10085
10086 t.OS = {
10087 LINUX: "LINUX",
10088 MAC: "MAC",
10089 WINDOWS: "WINDOWS"
10090 }, t.getOS = function () {
10091 return t.isMac ? t.OS.MAC : t.isLinux ? t.OS.LINUX : t.OS.WINDOWS;
10092 };
10093 if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) != "object") return;
10094 var r = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(),
10095 i = navigator.userAgent;
10096 t.isWin = r == "win", t.isMac = r == "mac", t.isLinux = r == "linux", t.isIE = navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0 ? parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]) : parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]), t.isOldIE = t.isIE && t.isIE < 9, t.isGecko = t.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko", t.isOldGecko = t.isGecko && parseInt((i.match(/rv:(\d+)/) || [])[1], 10) < 4, t.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]", t.isWebKit = parseFloat(i.split("WebKit/")[1]) || undefined, t.isChrome = parseFloat(i.split(" Chrome/")[1]) || undefined, t.isAIR = i.indexOf("AdobeAIR") >= 0, t.isIPad = i.indexOf("iPad") >= 0, t.isChromeOS = i.indexOf(" CrOS ") >= 0, t.isIOS = /iPad|iPhone|iPod/.test(i) && !window.MSStream, t.isIOS && (t.isMac = !0);
10097 }), ace.define("ace/lib/event", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function (e, t, n) {
10098 "use strict";
10099
10100 function a(e, t, n) {
10101 var a = u(t);
10102
10103 if (!i.isMac && s) {
10104 t.getModifierState && (t.getModifierState("OS") || t.getModifierState("Win")) && (a |= 8);
10105
10106 if (s.altGr) {
10107 if ((3 & a) == 3) return;
10108 s.altGr = 0;
10109 }
10110
10111 if (n === 18 || n === 17) {
10112 var f = "location" in t ? t.location : t.keyLocation;
10113 if (n === 17 && f === 1) s[n] == 1 && (o = t.timeStamp);else if (n === 18 && a === 3 && f === 2) {
10114 var l = t.timeStamp - o;
10115 l < 50 && (s.altGr = !0);
10116 }
10117 }
10118 }
10119
10120 n in r.MODIFIER_KEYS && (n = -1), a & 8 && n >= 91 && n <= 93 && (n = -1);
10121
10122 if (!a && n === 13) {
10123 var f = "location" in t ? t.location : t.keyLocation;
10124
10125 if (f === 3) {
10126 e(t, a, -n);
10127 if (t.defaultPrevented) return;
10128 }
10129 }
10130
10131 if (i.isChromeOS && a & 8) {
10132 e(t, a, n);
10133 if (t.defaultPrevented) return;
10134 a &= -9;
10135 }
10136
10137 return !!a || n in r.FUNCTION_KEYS || n in r.PRINTABLE_KEYS ? e(t, a, n) : !1;
10138 }
10139
10140 function f() {
10141 s = Object.create(null);
10142 }
10143
10144 var r = e("./keys"),
10145 i = e("./useragent"),
10146 s = null,
10147 o = 0;
10148 t.addListener = function (e, t, n) {
10149 if (e.addEventListener) return e.addEventListener(t, n, !1);
10150
10151 if (e.attachEvent) {
10152 var r = function r() {
10153 n.call(e, window.event);
10154 };
10155
10156 n._wrapper = r, e.attachEvent("on" + t, r);
10157 }
10158 }, t.removeListener = function (e, t, n) {
10159 if (e.removeEventListener) return e.removeEventListener(t, n, !1);
10160 e.detachEvent && e.detachEvent("on" + t, n._wrapper || n);
10161 }, t.stopEvent = function (e) {
10162 return t.stopPropagation(e), t.preventDefault(e), !1;
10163 }, t.stopPropagation = function (e) {
10164 e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0;
10165 }, t.preventDefault = function (e) {
10166 e.preventDefault ? e.preventDefault() : e.returnValue = !1;
10167 }, t.getButton = function (e) {
10168 return e.type == "dblclick" ? 0 : e.type == "contextmenu" || i.isMac && e.ctrlKey && !e.altKey && !e.shiftKey ? 2 : e.preventDefault ? e.button : {
10169 1: 0,
10170 2: 2,
10171 4: 1
10172 }[e.button];
10173 }, t.capture = function (e, n, r) {
10174 function i(e) {
10175 n && n(e), r && r(e), t.removeListener(document, "mousemove", n, !0), t.removeListener(document, "mouseup", i, !0), t.removeListener(document, "dragstart", i, !0);
10176 }
10177
10178 return t.addListener(document, "mousemove", n, !0), t.addListener(document, "mouseup", i, !0), t.addListener(document, "dragstart", i, !0), i;
10179 }, t.addTouchMoveListener = function (e, n) {
10180 if ("ontouchmove" in e) {
10181 var r, i;
10182 t.addListener(e, "touchstart", function (e) {
10183 var t = e.changedTouches[0];
10184 r = t.clientX, i = t.clientY;
10185 }), t.addListener(e, "touchmove", function (e) {
10186 var t = 1,
10187 s = e.changedTouches[0];
10188 e.wheelX = -(s.clientX - r) / t, e.wheelY = -(s.clientY - i) / t, r = s.clientX, i = s.clientY, n(e);
10189 });
10190 }
10191 }, t.addMouseWheelListener = function (e, n) {
10192 "onmousewheel" in e ? t.addListener(e, "mousewheel", function (e) {
10193 var t = 8;
10194 e.wheelDeltaX !== undefined ? (e.wheelX = -e.wheelDeltaX / t, e.wheelY = -e.wheelDeltaY / t) : (e.wheelX = 0, e.wheelY = -e.wheelDelta / t), n(e);
10195 }) : "onwheel" in e ? t.addListener(e, "wheel", function (e) {
10196 var t = .35;
10197
10198 switch (e.deltaMode) {
10199 case e.DOM_DELTA_PIXEL:
10200 e.wheelX = e.deltaX * t || 0, e.wheelY = e.deltaY * t || 0;
10201 break;
10202
10203 case e.DOM_DELTA_LINE:
10204 case e.DOM_DELTA_PAGE:
10205 e.wheelX = (e.deltaX || 0) * 5, e.wheelY = (e.deltaY || 0) * 5;
10206 }
10207
10208 n(e);
10209 }) : t.addListener(e, "DOMMouseScroll", function (e) {
10210 e.axis && e.axis == e.HORIZONTAL_AXIS ? (e.wheelX = (e.detail || 0) * 5, e.wheelY = 0) : (e.wheelX = 0, e.wheelY = (e.detail || 0) * 5), n(e);
10211 });
10212 }, t.addMultiMouseDownListener = function (e, n, r, s) {
10213 function c(e) {
10214 t.getButton(e) !== 0 ? o = 0 : e.detail > 1 ? (o++, o > 4 && (o = 1)) : o = 1;
10215
10216 if (i.isIE) {
10217 var c = Math.abs(e.clientX - u) > 5 || Math.abs(e.clientY - a) > 5;
10218 if (!f || c) o = 1;
10219 f && clearTimeout(f), f = setTimeout(function () {
10220 f = null;
10221 }, n[o - 1] || 600), o == 1 && (u = e.clientX, a = e.clientY);
10222 }
10223
10224 e._clicks = o, r[s]("mousedown", e);
10225 if (o > 4) o = 0;else if (o > 1) return r[s](l[o], e);
10226 }
10227
10228 function h(e) {
10229 o = 2, f && clearTimeout(f), f = setTimeout(function () {
10230 f = null;
10231 }, n[o - 1] || 600), r[s]("mousedown", e), r[s](l[o], e);
10232 }
10233
10234 var o = 0,
10235 u,
10236 a,
10237 f,
10238 l = {
10239 2: "dblclick",
10240 3: "tripleclick",
10241 4: "quadclick"
10242 };
10243 Array.isArray(e) || (e = [e]), e.forEach(function (e) {
10244 t.addListener(e, "mousedown", c), i.isOldIE && t.addListener(e, "dblclick", h);
10245 });
10246 };
10247 var u = !i.isMac || !i.isOpera || "KeyboardEvent" in window ? function (e) {
10248 return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
10249 } : function (e) {
10250 return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
10251 };
10252 t.getModifierString = function (e) {
10253 return r.KEY_MODS[u(e)];
10254 }, t.addCommandKeyListener = function (e, n) {
10255 var r = t.addListener;
10256
10257 if (i.isOldGecko || i.isOpera && !("KeyboardEvent" in window)) {
10258 var o = null;
10259 r(e, "keydown", function (e) {
10260 o = e.keyCode;
10261 }), r(e, "keypress", function (e) {
10262 return a(n, e, o);
10263 });
10264 } else {
10265 var u = null;
10266 r(e, "keydown", function (e) {
10267 s[e.keyCode] = (s[e.keyCode] || 0) + 1;
10268 var t = a(n, e, e.keyCode);
10269 return u = e.defaultPrevented, t;
10270 }), r(e, "keypress", function (e) {
10271 u && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && (t.stopEvent(e), u = null);
10272 }), r(e, "keyup", function (e) {
10273 s[e.keyCode] = null;
10274 }), s || (f(), r(window, "focus", f));
10275 }
10276 };
10277
10278 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) == "object" && window.postMessage && !i.isOldIE) {
10279 var l = 1;
10280
10281 t.nextTick = function (e, n) {
10282 n = n || window;
10283 var r = "zero-timeout-message-" + l;
10284 t.addListener(n, "message", function i(s) {
10285 s.data == r && (t.stopPropagation(s), t.removeListener(n, "message", i), e());
10286 }), n.postMessage(r, "*");
10287 };
10288 }
10289
10290 t.nextFrame = (typeof window === "undefined" ? "undefined" : _typeof(window)) == "object" && (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame), t.nextFrame ? t.nextFrame = t.nextFrame.bind(window) : t.nextFrame = function (e) {
10291 setTimeout(e, 17);
10292 };
10293 }), ace.define("ace/lib/lang", ["require", "exports", "module"], function (e, t, n) {
10294 "use strict";
10295
10296 t.last = function (e) {
10297 return e[e.length - 1];
10298 }, t.stringReverse = function (e) {
10299 return e.split("").reverse().join("");
10300 }, t.stringRepeat = function (e, t) {
10301 var n = "";
10302
10303 while (t > 0) {
10304 t & 1 && (n += e);
10305 if (t >>= 1) e += e;
10306 }
10307
10308 return n;
10309 };
10310 var r = /^\s\s*/,
10311 i = /\s\s*$/;
10312 t.stringTrimLeft = function (e) {
10313 return e.replace(r, "");
10314 }, t.stringTrimRight = function (e) {
10315 return e.replace(i, "");
10316 }, t.copyObject = function (e) {
10317 var t = {};
10318
10319 for (var n in e) {
10320 t[n] = e[n];
10321 }
10322
10323 return t;
10324 }, t.copyArray = function (e) {
10325 var t = [];
10326
10327 for (var n = 0, r = e.length; n < r; n++) {
10328 e[n] && _typeof(e[n]) == "object" ? t[n] = this.copyObject(e[n]) : t[n] = e[n];
10329 }
10330
10331 return t;
10332 }, t.deepCopy = function s(e) {
10333 if (_typeof(e) != "object" || !e) return e;
10334 var t;
10335
10336 if (Array.isArray(e)) {
10337 t = [];
10338
10339 for (var n = 0; n < e.length; n++) {
10340 t[n] = s(e[n]);
10341 }
10342
10343 return t;
10344 }
10345
10346 if (Object.prototype.toString.call(e) !== "[object Object]") return e;
10347 t = {};
10348
10349 for (var n in e) {
10350 t[n] = s(e[n]);
10351 }
10352
10353 return t;
10354 }, t.arrayToMap = function (e) {
10355 var t = {};
10356
10357 for (var n = 0; n < e.length; n++) {
10358 t[e[n]] = 1;
10359 }
10360
10361 return t;
10362 }, t.createMap = function (e) {
10363 var t = Object.create(null);
10364
10365 for (var n in e) {
10366 t[n] = e[n];
10367 }
10368
10369 return t;
10370 }, t.arrayRemove = function (e, t) {
10371 for (var n = 0; n <= e.length; n++) {
10372 t === e[n] && e.splice(n, 1);
10373 }
10374 }, t.escapeRegExp = function (e) {
10375 return e.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
10376 }, t.escapeHTML = function (e) {
10377 return e.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
10378 }, t.getMatchOffsets = function (e, t) {
10379 var n = [];
10380 return e.replace(t, function (e) {
10381 n.push({
10382 offset: arguments[arguments.length - 2],
10383 length: e.length
10384 });
10385 }), n;
10386 }, t.deferredCall = function (e) {
10387 var t = null,
10388 n = function n() {
10389 t = null, e();
10390 },
10391 r = function r(e) {
10392 return r.cancel(), t = setTimeout(n, e || 0), r;
10393 };
10394
10395 return r.schedule = r, r.call = function () {
10396 return this.cancel(), e(), r;
10397 }, r.cancel = function () {
10398 return clearTimeout(t), t = null, r;
10399 }, r.isPending = function () {
10400 return t;
10401 }, r;
10402 }, t.delayedCall = function (e, t) {
10403 var n = null,
10404 r = function r() {
10405 n = null, e();
10406 },
10407 i = function i(e) {
10408 n == null && (n = setTimeout(r, e || t));
10409 };
10410
10411 return i.delay = function (e) {
10412 n && clearTimeout(n), n = setTimeout(r, e || t);
10413 }, i.schedule = i, i.call = function () {
10414 this.cancel(), e();
10415 }, i.cancel = function () {
10416 n && clearTimeout(n), n = null;
10417 }, i.isPending = function () {
10418 return n;
10419 }, i;
10420 };
10421 }), ace.define("ace/keyboard/textinput_ios", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/lib/dom", "ace/lib/lang", "ace/lib/keys"], function (e, t, n) {
10422 "use strict";
10423
10424 var r = e("../lib/event"),
10425 i = e("../lib/useragent"),
10426 s = e("../lib/dom"),
10427 o = e("../lib/lang"),
10428 u = e("../lib/keys"),
10429 a = u.KEY_MODS,
10430 f = i.isChrome < 18,
10431 l = i.isIE,
10432 c = function c(e, t) {
10433 function x(e) {
10434 if (m) return;
10435 m = !0;
10436 if (k) t = 0, n = e ? 0 : c.value.length - 1;else var t = 4,
10437 n = 5;
10438
10439 try {
10440 c.setSelectionRange(t, n);
10441 } catch (r) {}
10442
10443 m = !1;
10444 }
10445
10446 function T() {
10447 if (m) return;
10448 c.value = h, i.isWebKit && S.schedule();
10449 }
10450
10451 function R() {
10452 clearTimeout(q), q = setTimeout(function () {
10453 g && (c.style.cssText = g, g = ""), t.renderer.$keepTextAreaAtCursor == null && (t.renderer.$keepTextAreaAtCursor = !0, t.renderer.$moveTextAreaToCursor());
10454 }, 0);
10455 }
10456
10457 var n = this,
10458 c = s.createElement("textarea");
10459 c.className = i.isIOS ? "ace_text-input ace_text-input-ios" : "ace_text-input", i.isTouchPad && c.setAttribute("x-palm-disable-auto-cap", !0), c.setAttribute("wrap", "off"), c.setAttribute("autocorrect", "off"), c.setAttribute("autocapitalize", "off"), c.setAttribute("spellcheck", !1), c.style.opacity = "0", e.insertBefore(c, e.firstChild);
10460 var h = "\n aaaa a\n",
10461 p = !1,
10462 d = !1,
10463 v = !1,
10464 m = !1,
10465 g = "",
10466 y = !0;
10467
10468 try {
10469 var b = document.activeElement === c;
10470 } catch (w) {}
10471
10472 r.addListener(c, "blur", function (e) {
10473 t.onBlur(e), b = !1;
10474 }), r.addListener(c, "focus", function (e) {
10475 b = !0, t.onFocus(e), x();
10476 }), this.focus = function () {
10477 if (g) return c.focus();
10478 c.style.position = "fixed", c.focus();
10479 }, this.blur = function () {
10480 c.blur();
10481 }, this.isFocused = function () {
10482 return b;
10483 };
10484 var E = o.delayedCall(function () {
10485 b && x(y);
10486 }),
10487 S = o.delayedCall(function () {
10488 m || (c.value = h, b && x());
10489 });
10490 i.isWebKit || t.addEventListener("changeSelection", function () {
10491 t.selection.isEmpty() != y && (y = !y, E.schedule());
10492 }), T(), b && t.onFocus();
10493
10494 var N = function N(e) {
10495 return e.selectionStart === 0 && e.selectionEnd === e.value.length;
10496 },
10497 C = function C(e) {
10498 N(c) ? (t.selectAll(), x()) : k && x(t.selection.isEmpty());
10499 },
10500 k = null;
10501
10502 this.setInputHandler = function (e) {
10503 k = e;
10504 }, this.getInputHandler = function () {
10505 return k;
10506 };
10507
10508 var L = !1,
10509 A = function A(e) {
10510 if (c.selectionStart === 4 && c.selectionEnd === 5) return;
10511 k && (e = k(e), k = null), v ? (x(), e && t.onPaste(e), v = !1) : e == h.substr(0) && c.selectionStart === 4 ? L ? t.execCommand("del", {
10512 source: "ace"
10513 }) : t.execCommand("backspace", {
10514 source: "ace"
10515 }) : p || (e.substring(0, 9) == h && e.length > h.length ? e = e.substr(9) : e.substr(0, 4) == h.substr(0, 4) ? e = e.substr(4, e.length - h.length + 1) : e.charAt(e.length - 1) == h.charAt(0) && (e = e.slice(0, -1)), e != h.charAt(0) && e.charAt(e.length - 1) == h.charAt(0) && (e = e.slice(0, -1)), e && t.onTextInput(e)), p && (p = !1), L && (L = !1);
10516 },
10517 O = function O(e) {
10518 if (m) return;
10519 var t = c.value;
10520 A(t), T();
10521 },
10522 M = function M(e, t, n) {
10523 var r = e.clipboardData || window.clipboardData;
10524 if (!r || f) return;
10525 var i = l || n ? "Text" : "text/plain";
10526
10527 try {
10528 return t ? r.setData(i, t) !== !1 : r.getData(i);
10529 } catch (e) {
10530 if (!n) return M(e, t, !0);
10531 }
10532 },
10533 _ = function _(e, n) {
10534 var s = t.getCopyText();
10535 if (!s) return r.preventDefault(e);
10536 M(e, s) ? (i.isIOS && (d = n, c.value = "\n aa" + s + "a a\n", c.setSelectionRange(4, 4 + s.length), p = {
10537 value: s
10538 }), n ? t.onCut() : t.onCopy(), i.isIOS || r.preventDefault(e)) : (p = !0, c.value = s, c.select(), setTimeout(function () {
10539 p = !1, T(), x(), n ? t.onCut() : t.onCopy();
10540 }));
10541 },
10542 D = function D(e) {
10543 _(e, !0);
10544 },
10545 P = function P(e) {
10546 _(e, !1);
10547 },
10548 H = function H(e) {
10549 var n = M(e);
10550 typeof n == "string" ? (n && t.onPaste(n, e), i.isIE && setTimeout(x), r.preventDefault(e)) : (c.value = "", v = !0);
10551 };
10552
10553 r.addCommandKeyListener(c, t.onCommandKey.bind(t)), r.addListener(c, "select", C), r.addListener(c, "input", O), r.addListener(c, "cut", D), r.addListener(c, "copy", P), r.addListener(c, "paste", H);
10554
10555 var B = function B(e) {
10556 if (m || !t.onCompositionStart || t.$readOnly) return;
10557 m = {}, m.canUndo = t.session.$undoManager, t.onCompositionStart(), setTimeout(j, 0), t.on("mousedown", F), m.canUndo && !t.selection.isEmpty() && (t.insert(""), t.session.markUndoGroup(), t.selection.clearSelection()), t.session.markUndoGroup();
10558 },
10559 j = function j() {
10560 if (!m || !t.onCompositionUpdate || t.$readOnly) return;
10561 var e = c.value.replace(/\x01/g, "");
10562 if (m.lastValue === e) return;
10563 t.onCompositionUpdate(e), m.lastValue && t.undo(), m.canUndo && (m.lastValue = e);
10564
10565 if (m.lastValue) {
10566 var n = t.selection.getRange();
10567 t.insert(m.lastValue), t.session.markUndoGroup(), m.range = t.selection.getRange(), t.selection.setRange(n), t.selection.clearSelection();
10568 }
10569 },
10570 F = function F(e) {
10571 if (!t.onCompositionEnd || t.$readOnly) return;
10572 var n = m;
10573 m = !1;
10574 var r = setTimeout(function () {
10575 r = null;
10576 var e = c.value.replace(/\x01/g, "");
10577 if (m) return;
10578 e == n.lastValue ? T() : !n.lastValue && e && (T(), A(e));
10579 });
10580 k = function k(i) {
10581 return r && clearTimeout(r), i = i.replace(/\x01/g, ""), i == n.lastValue ? "" : (n.lastValue && r && t.undo(), i);
10582 }, t.onCompositionEnd(), t.removeListener("mousedown", F), e.type == "compositionend" && n.range && t.selection.setRange(n.range);
10583 var s = !!i.isChrome && i.isChrome >= 53 || !!i.isWebKit && i.isWebKit >= 603;
10584 s && O();
10585 },
10586 I = o.delayedCall(j, 50);
10587
10588 r.addListener(c, "compositionstart", B), i.isGecko ? r.addListener(c, "text", function () {
10589 I.schedule();
10590 }) : (r.addListener(c, "keyup", function () {
10591 I.schedule();
10592 }), r.addListener(c, "keydown", function () {
10593 I.schedule();
10594 })), r.addListener(c, "compositionend", F), this.getElement = function () {
10595 return c;
10596 }, this.setReadOnly = function (e) {
10597 c.readOnly = e;
10598 }, this.onContextMenu = function (e) {
10599 L = !0, x(t.selection.isEmpty()), t._emit("nativecontextmenu", {
10600 target: t,
10601 domEvent: e
10602 }), this.moveToMouse(e, !0);
10603 }, this.moveToMouse = function (e, n) {
10604 g || (g = c.style.cssText), c.style.cssText = (n ? "z-index:100000;" : "") + "height:" + c.style.height + ";" + (i.isIE ? "opacity:0.1;" : "");
10605
10606 var o = t.container.getBoundingClientRect(),
10607 u = s.computedStyle(t.container),
10608 a = o.top + (parseInt(u.borderTopWidth) || 0),
10609 f = o.left + (parseInt(o.borderLeftWidth) || 0),
10610 l = o.bottom - a - c.clientHeight - 2,
10611 h = function h(e) {
10612 c.style.left = e.clientX - f - 2 + "px", c.style.top = Math.min(e.clientY - a - 2, l) + "px";
10613 };
10614
10615 h(e);
10616 if (e.type != "mousedown") return;
10617 t.renderer.$keepTextAreaAtCursor && (t.renderer.$keepTextAreaAtCursor = null), clearTimeout(q), i.isWin && r.capture(t.container, h, R);
10618 }, this.onContextMenuClose = R;
10619
10620 var q,
10621 U = function U(e) {
10622 t.textInput.onContextMenu(e), R();
10623 };
10624
10625 r.addListener(c, "mouseup", U), r.addListener(c, "mousedown", function (e) {
10626 e.preventDefault(), R();
10627 }), r.addListener(t.renderer.scroller, "contextmenu", U), r.addListener(c, "contextmenu", U);
10628
10629 if (i.isIOS) {
10630 var z = null,
10631 W = !1;
10632 e.addEventListener("keydown", function (e) {
10633 z && clearTimeout(z), W = !0;
10634 }), e.addEventListener("keyup", function (e) {
10635 z = setTimeout(function () {
10636 W = !1;
10637 }, 100);
10638 });
10639
10640 var X = function X(e) {
10641 if (document.activeElement !== c) return;
10642 if (W) return;
10643 if (d) return setTimeout(function () {
10644 d = !1;
10645 }, 100);
10646 var n = c.selectionStart,
10647 r = c.selectionEnd;
10648 c.setSelectionRange(4, 5);
10649 if (n == r) switch (n) {
10650 case 0:
10651 t.onCommandKey(null, 0, u.up);
10652 break;
10653
10654 case 1:
10655 t.onCommandKey(null, 0, u.home);
10656 break;
10657
10658 case 2:
10659 t.onCommandKey(null, a.option, u.left);
10660 break;
10661
10662 case 4:
10663 t.onCommandKey(null, 0, u.left);
10664 break;
10665
10666 case 5:
10667 t.onCommandKey(null, 0, u.right);
10668 break;
10669
10670 case 7:
10671 t.onCommandKey(null, a.option, u.right);
10672 break;
10673
10674 case 8:
10675 t.onCommandKey(null, 0, u.end);
10676 break;
10677
10678 case 9:
10679 t.onCommandKey(null, 0, u.down);
10680 } else {
10681 switch (r) {
10682 case 6:
10683 t.onCommandKey(null, a.shift, u.right);
10684 break;
10685
10686 case 7:
10687 t.onCommandKey(null, a.shift | a.option, u.right);
10688 break;
10689
10690 case 8:
10691 t.onCommandKey(null, a.shift, u.end);
10692 break;
10693
10694 case 9:
10695 t.onCommandKey(null, a.shift, u.down);
10696 }
10697
10698 switch (n) {
10699 case 0:
10700 t.onCommandKey(null, a.shift, u.up);
10701 break;
10702
10703 case 1:
10704 t.onCommandKey(null, a.shift, u.home);
10705 break;
10706
10707 case 2:
10708 t.onCommandKey(null, a.shift | a.option, u.left);
10709 break;
10710
10711 case 3:
10712 t.onCommandKey(null, a.shift, u.left);
10713 }
10714 }
10715 };
10716
10717 document.addEventListener("selectionchange", X), t.on("destroy", function () {
10718 document.removeEventListener("selectionchange", X);
10719 });
10720 }
10721 };
10722
10723 t.TextInput = c;
10724 }), ace.define("ace/keyboard/textinput", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/lib/dom", "ace/lib/lang", "ace/keyboard/textinput_ios"], function (e, t, n) {
10725 "use strict";
10726
10727 var r = e("../lib/event"),
10728 i = e("../lib/useragent"),
10729 s = e("../lib/dom"),
10730 o = e("../lib/lang"),
10731 u = i.isChrome < 18,
10732 a = i.isIE,
10733 f = e("./textinput_ios").TextInput,
10734 l = function l(e, t) {
10735 function w(e) {
10736 if (p) return;
10737 p = !0;
10738 if (T) t = 0, r = e ? 0 : n.value.length - 1;else var t = e ? 2 : 1,
10739 r = 2;
10740
10741 try {
10742 n.setSelectionRange(t, r);
10743 } catch (i) {}
10744
10745 p = !1;
10746 }
10747
10748 function E() {
10749 if (p) return;
10750 n.value = l, i.isWebKit && b.schedule();
10751 }
10752
10753 function F() {
10754 clearTimeout(j), j = setTimeout(function () {
10755 d && (n.style.cssText = d, d = ""), t.renderer.$keepTextAreaAtCursor == null && (t.renderer.$keepTextAreaAtCursor = !0, t.renderer.$moveTextAreaToCursor());
10756 }, 0);
10757 }
10758
10759 if (i.isIOS) return f.call(this, e, t);
10760 var n = s.createElement("textarea");
10761 n.className = "ace_text-input", n.setAttribute("wrap", "off"), n.setAttribute("autocorrect", "off"), n.setAttribute("autocapitalize", "off"), n.setAttribute("spellcheck", !1), n.style.opacity = "0", e.insertBefore(n, e.firstChild);
10762 var l = "\u2028\u2028",
10763 c = !1,
10764 h = !1,
10765 p = !1,
10766 d = "",
10767 v = !0;
10768
10769 try {
10770 var m = document.activeElement === n;
10771 } catch (g) {}
10772
10773 r.addListener(n, "blur", function (e) {
10774 t.onBlur(e), m = !1;
10775 }), r.addListener(n, "focus", function (e) {
10776 m = !0, t.onFocus(e), w();
10777 }), this.focus = function () {
10778 if (d) return n.focus();
10779 var e = n.style.top;
10780 n.style.position = "fixed", n.style.top = "0px", n.focus(), setTimeout(function () {
10781 n.style.position = "", n.style.top == "0px" && (n.style.top = e);
10782 }, 0);
10783 }, this.blur = function () {
10784 n.blur();
10785 }, this.isFocused = function () {
10786 return m;
10787 };
10788 var y = o.delayedCall(function () {
10789 m && w(v);
10790 }),
10791 b = o.delayedCall(function () {
10792 p || (n.value = l, m && w());
10793 });
10794 i.isWebKit || t.addEventListener("changeSelection", function () {
10795 t.selection.isEmpty() != v && (v = !v, y.schedule());
10796 }), E(), m && t.onFocus();
10797
10798 var S = function S(e) {
10799 return e.selectionStart === 0 && e.selectionEnd === e.value.length;
10800 },
10801 x = function x(e) {
10802 c ? c = !1 : S(n) ? (t.selectAll(), w()) : T && w(t.selection.isEmpty());
10803 },
10804 T = null;
10805
10806 this.setInputHandler = function (e) {
10807 T = e;
10808 }, this.getInputHandler = function () {
10809 return T;
10810 };
10811
10812 var N = !1,
10813 C = function C(e) {
10814 T && (e = T(e), T = null), h ? (w(), e && t.onPaste(e), h = !1) : e == l.charAt(0) ? N ? t.execCommand("del", {
10815 source: "ace"
10816 }) : t.execCommand("backspace", {
10817 source: "ace"
10818 }) : (e.substring(0, 2) == l ? e = e.substr(2) : e.charAt(0) == l.charAt(0) ? e = e.substr(1) : e.charAt(e.length - 1) == l.charAt(0) && (e = e.slice(0, -1)), e.charAt(e.length - 1) == l.charAt(0) && (e = e.slice(0, -1)), e && t.onTextInput(e)), N && (N = !1);
10819 },
10820 k = function k(e) {
10821 if (p) return;
10822 var t = n.value;
10823 C(t), E();
10824 },
10825 L = function L(e, t, n) {
10826 var r = e.clipboardData || window.clipboardData;
10827 if (!r || u) return;
10828 var i = a || n ? "Text" : "text/plain";
10829
10830 try {
10831 return t ? r.setData(i, t) !== !1 : r.getData(i);
10832 } catch (e) {
10833 if (!n) return L(e, t, !0);
10834 }
10835 },
10836 A = function A(e, i) {
10837 var s = t.getCopyText();
10838 if (!s) return r.preventDefault(e);
10839 L(e, s) ? (i ? t.onCut() : t.onCopy(), r.preventDefault(e)) : (c = !0, n.value = s, n.select(), setTimeout(function () {
10840 c = !1, E(), w(), i ? t.onCut() : t.onCopy();
10841 }));
10842 },
10843 O = function O(e) {
10844 A(e, !0);
10845 },
10846 M = function M(e) {
10847 A(e, !1);
10848 },
10849 _ = function _(e) {
10850 var s = L(e);
10851 typeof s == "string" ? (s && t.onPaste(s, e), i.isIE && setTimeout(w), r.preventDefault(e)) : (n.value = "", h = !0);
10852 };
10853
10854 r.addCommandKeyListener(n, t.onCommandKey.bind(t)), r.addListener(n, "select", x), r.addListener(n, "input", k), r.addListener(n, "cut", O), r.addListener(n, "copy", M), r.addListener(n, "paste", _), (!("oncut" in n) || !("oncopy" in n) || !("onpaste" in n)) && r.addListener(e, "keydown", function (e) {
10855 if (i.isMac && !e.metaKey || !e.ctrlKey) return;
10856
10857 switch (e.keyCode) {
10858 case 67:
10859 M(e);
10860 break;
10861
10862 case 86:
10863 _(e);
10864
10865 break;
10866
10867 case 88:
10868 O(e);
10869 }
10870 });
10871
10872 var D = function D(e) {
10873 if (p || !t.onCompositionStart || t.$readOnly) return;
10874 p = {}, p.canUndo = t.session.$undoManager, t.onCompositionStart(), setTimeout(P, 0), t.on("mousedown", H), p.canUndo && !t.selection.isEmpty() && (t.insert(""), t.session.markUndoGroup(), t.selection.clearSelection()), t.session.markUndoGroup();
10875 },
10876 P = function P() {
10877 if (!p || !t.onCompositionUpdate || t.$readOnly) return;
10878 var e = n.value.replace(/\u2028/g, "");
10879 if (p.lastValue === e) return;
10880 t.onCompositionUpdate(e), p.lastValue && t.undo(), p.canUndo && (p.lastValue = e);
10881
10882 if (p.lastValue) {
10883 var r = t.selection.getRange();
10884 t.insert(p.lastValue), t.session.markUndoGroup(), p.range = t.selection.getRange(), t.selection.setRange(r), t.selection.clearSelection();
10885 }
10886 },
10887 H = function H(e) {
10888 if (!t.onCompositionEnd || t.$readOnly) return;
10889 var r = p;
10890 p = !1;
10891 var s = setTimeout(function () {
10892 s = null;
10893 var e = n.value.replace(/\u2028/g, "");
10894 if (p) return;
10895 e == r.lastValue ? E() : !r.lastValue && e && (E(), C(e));
10896 });
10897 T = function T(n) {
10898 return s && clearTimeout(s), n = n.replace(/\u2028/g, ""), n == r.lastValue ? "" : (r.lastValue && s && t.undo(), n);
10899 }, t.onCompositionEnd(), t.removeListener("mousedown", H), e.type == "compositionend" && r.range && t.selection.setRange(r.range);
10900 var o = !!i.isChrome && i.isChrome >= 53 || !!i.isWebKit && i.isWebKit >= 603;
10901 o && k();
10902 },
10903 B = o.delayedCall(P, 50);
10904
10905 r.addListener(n, "compositionstart", D), i.isGecko ? r.addListener(n, "text", function () {
10906 B.schedule();
10907 }) : (r.addListener(n, "keyup", function () {
10908 B.schedule();
10909 }), r.addListener(n, "keydown", function () {
10910 B.schedule();
10911 })), r.addListener(n, "compositionend", H), this.getElement = function () {
10912 return n;
10913 }, this.setReadOnly = function (e) {
10914 n.readOnly = e;
10915 }, this.onContextMenu = function (e) {
10916 N = !0, w(t.selection.isEmpty()), t._emit("nativecontextmenu", {
10917 target: t,
10918 domEvent: e
10919 }), this.moveToMouse(e, !0);
10920 }, this.moveToMouse = function (e, o) {
10921 d || (d = n.style.cssText), n.style.cssText = (o ? "z-index:100000;" : "") + "height:" + n.style.height + ";" + (i.isIE ? "opacity:0.1;" : "");
10922
10923 var u = t.container.getBoundingClientRect(),
10924 a = s.computedStyle(t.container),
10925 f = u.top + (parseInt(a.borderTopWidth) || 0),
10926 l = u.left + (parseInt(u.borderLeftWidth) || 0),
10927 c = u.bottom - f - n.clientHeight - 2,
10928 h = function h(e) {
10929 n.style.left = e.clientX - l - 2 + "px", n.style.top = Math.min(e.clientY - f - 2, c) + "px";
10930 };
10931
10932 h(e);
10933 if (e.type != "mousedown") return;
10934 t.renderer.$keepTextAreaAtCursor && (t.renderer.$keepTextAreaAtCursor = null), clearTimeout(j), i.isWin && r.capture(t.container, h, F);
10935 }, this.onContextMenuClose = F;
10936
10937 var j,
10938 I = function I(e) {
10939 t.textInput.onContextMenu(e), F();
10940 };
10941
10942 r.addListener(n, "mouseup", I), r.addListener(n, "mousedown", function (e) {
10943 e.preventDefault(), F();
10944 }), r.addListener(t.renderer.scroller, "contextmenu", I), r.addListener(n, "contextmenu", I);
10945 };
10946
10947 t.TextInput = l;
10948 }), ace.define("ace/mouse/default_handlers", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
10949 "use strict";
10950
10951 function u(e) {
10952 e.$clickSelection = null;
10953 var t = e.editor;
10954 t.setDefaultHandler("mousedown", this.onMouseDown.bind(e)), t.setDefaultHandler("dblclick", this.onDoubleClick.bind(e)), t.setDefaultHandler("tripleclick", this.onTripleClick.bind(e)), t.setDefaultHandler("quadclick", this.onQuadClick.bind(e)), t.setDefaultHandler("mousewheel", this.onMouseWheel.bind(e)), t.setDefaultHandler("touchmove", this.onTouchMove.bind(e));
10955 var n = ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"];
10956 n.forEach(function (t) {
10957 e[t] = this[t];
10958 }, this), e.selectByLines = this.extendSelectionBy.bind(e, "getLineRange"), e.selectByWords = this.extendSelectionBy.bind(e, "getWordRange");
10959 }
10960
10961 function a(e, t, n, r) {
10962 return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - t, 2));
10963 }
10964
10965 function f(e, t) {
10966 if (e.start.row == e.end.row) var n = 2 * t.column - e.start.column - e.end.column;else if (e.start.row == e.end.row - 1 && !e.start.column && !e.end.column) var n = t.column - 4;else var n = 2 * t.row - e.start.row - e.end.row;
10967 return n < 0 ? {
10968 cursor: e.start,
10969 anchor: e.end
10970 } : {
10971 cursor: e.end,
10972 anchor: e.start
10973 };
10974 }
10975
10976 var r = e("../lib/dom"),
10977 i = e("../lib/event"),
10978 s = e("../lib/useragent"),
10979 o = 0;
10980 (function () {
10981 this.onMouseDown = function (e) {
10982 var t = e.inSelection(),
10983 n = e.getDocumentPosition();
10984 this.mousedownEvent = e;
10985 var r = this.editor,
10986 i = e.getButton();
10987
10988 if (i !== 0) {
10989 var o = r.getSelectionRange(),
10990 u = o.isEmpty();
10991 r.$blockScrolling++, (u || i == 1) && r.selection.moveToPosition(n), r.$blockScrolling--, i == 2 && (r.textInput.onContextMenu(e.domEvent), s.isMozilla || e.preventDefault());
10992 return;
10993 }
10994
10995 this.mousedownEvent.time = Date.now();
10996
10997 if (t && !r.isFocused()) {
10998 r.focus();
10999
11000 if (this.$focusTimout && !this.$clickSelection && !r.inMultiSelectMode) {
11001 this.setState("focusWait"), this.captureMouse(e);
11002 return;
11003 }
11004 }
11005
11006 return this.captureMouse(e), this.startSelect(n, e.domEvent._clicks > 1), e.preventDefault();
11007 }, this.startSelect = function (e, t) {
11008 e = e || this.editor.renderer.screenToTextCoordinates(this.x, this.y);
11009 var n = this.editor;
11010 n.$blockScrolling++, this.mousedownEvent.getShiftKey() ? n.selection.selectToPosition(e) : t || n.selection.moveToPosition(e), t || this.select(), n.renderer.scroller.setCapture && n.renderer.scroller.setCapture(), n.setStyle("ace_selecting"), this.setState("select"), n.$blockScrolling--;
11011 }, this.select = function () {
11012 var e,
11013 t = this.editor,
11014 n = t.renderer.screenToTextCoordinates(this.x, this.y);
11015 t.$blockScrolling++;
11016
11017 if (this.$clickSelection) {
11018 var r = this.$clickSelection.comparePoint(n);
11019 if (r == -1) e = this.$clickSelection.end;else if (r == 1) e = this.$clickSelection.start;else {
11020 var i = f(this.$clickSelection, n);
11021 n = i.cursor, e = i.anchor;
11022 }
11023 t.selection.setSelectionAnchor(e.row, e.column);
11024 }
11025
11026 t.selection.selectToPosition(n), t.$blockScrolling--, t.renderer.scrollCursorIntoView();
11027 }, this.extendSelectionBy = function (e) {
11028 var t,
11029 n = this.editor,
11030 r = n.renderer.screenToTextCoordinates(this.x, this.y),
11031 i = n.selection[e](r.row, r.column);
11032 n.$blockScrolling++;
11033
11034 if (this.$clickSelection) {
11035 var s = this.$clickSelection.comparePoint(i.start),
11036 o = this.$clickSelection.comparePoint(i.end);
11037
11038 if (s == -1 && o <= 0) {
11039 t = this.$clickSelection.end;
11040 if (i.end.row != r.row || i.end.column != r.column) r = i.start;
11041 } else if (o == 1 && s >= 0) {
11042 t = this.$clickSelection.start;
11043 if (i.start.row != r.row || i.start.column != r.column) r = i.end;
11044 } else if (s == -1 && o == 1) r = i.end, t = i.start;else {
11045 var u = f(this.$clickSelection, r);
11046 r = u.cursor, t = u.anchor;
11047 }
11048
11049 n.selection.setSelectionAnchor(t.row, t.column);
11050 }
11051
11052 n.selection.selectToPosition(r), n.$blockScrolling--, n.renderer.scrollCursorIntoView();
11053 }, this.selectEnd = this.selectAllEnd = this.selectByWordsEnd = this.selectByLinesEnd = function () {
11054 this.$clickSelection = null, this.editor.unsetStyle("ace_selecting"), this.editor.renderer.scroller.releaseCapture && this.editor.renderer.scroller.releaseCapture();
11055 }, this.focusWait = function () {
11056 var e = a(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y),
11057 t = Date.now();
11058 (e > o || t - this.mousedownEvent.time > this.$focusTimout) && this.startSelect(this.mousedownEvent.getDocumentPosition());
11059 }, this.onDoubleClick = function (e) {
11060 var t = e.getDocumentPosition(),
11061 n = this.editor,
11062 r = n.session,
11063 i = r.getBracketRange(t);
11064 i ? (i.isEmpty() && (i.start.column--, i.end.column++), this.setState("select")) : (i = n.selection.getWordRange(t.row, t.column), this.setState("selectByWords")), this.$clickSelection = i, this.select();
11065 }, this.onTripleClick = function (e) {
11066 var t = e.getDocumentPosition(),
11067 n = this.editor;
11068 this.setState("selectByLines");
11069 var r = n.getSelectionRange();
11070 r.isMultiLine() && r.contains(t.row, t.column) ? (this.$clickSelection = n.selection.getLineRange(r.start.row), this.$clickSelection.end = n.selection.getLineRange(r.end.row).end) : this.$clickSelection = n.selection.getLineRange(t.row), this.select();
11071 }, this.onQuadClick = function (e) {
11072 var t = this.editor;
11073 t.selectAll(), this.$clickSelection = t.getSelectionRange(), this.setState("selectAll");
11074 }, this.onMouseWheel = function (e) {
11075 if (e.getAccelKey()) return;
11076 e.getShiftKey() && e.wheelY && !e.wheelX && (e.wheelX = e.wheelY, e.wheelY = 0);
11077 var t = e.domEvent.timeStamp,
11078 n = t - (this.$lastScrollTime || 0),
11079 r = this.editor,
11080 i = r.renderer.isScrollableBy(e.wheelX * e.speed, e.wheelY * e.speed);
11081 if (i || n < 200) return this.$lastScrollTime = t, r.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed), e.stop();
11082 }, this.onTouchMove = function (e) {
11083 var t = e.domEvent.timeStamp,
11084 n = t - (this.$lastScrollTime || 0),
11085 r = this.editor,
11086 i = r.renderer.isScrollableBy(e.wheelX * e.speed, e.wheelY * e.speed);
11087 if (i || n < 200) return this.$lastScrollTime = t, r.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed), e.stop();
11088 };
11089 }).call(u.prototype), t.DefaultHandlers = u;
11090 }), ace.define("ace/tooltip", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom"], function (e, t, n) {
11091 "use strict";
11092
11093 function s(e) {
11094 this.isOpen = !1, this.$element = null, this.$parentNode = e;
11095 }
11096
11097 var r = e("./lib/oop"),
11098 i = e("./lib/dom");
11099 (function () {
11100 this.$init = function () {
11101 return this.$element = i.createElement("div"), this.$element.className = "ace_tooltip", this.$element.style.display = "none", this.$parentNode.appendChild(this.$element), this.$element;
11102 }, this.getElement = function () {
11103 return this.$element || this.$init();
11104 }, this.setText = function (e) {
11105 i.setInnerText(this.getElement(), e);
11106 }, this.setHtml = function (e) {
11107 this.getElement().innerHTML = e;
11108 }, this.setPosition = function (e, t) {
11109 this.getElement().style.left = e + "px", this.getElement().style.top = t + "px";
11110 }, this.setClassName = function (e) {
11111 i.addCssClass(this.getElement(), e);
11112 }, this.show = function (e, t, n) {
11113 e != null && this.setText(e), t != null && n != null && this.setPosition(t, n), this.isOpen || (this.getElement().style.display = "block", this.isOpen = !0);
11114 }, this.hide = function () {
11115 this.isOpen && (this.getElement().style.display = "none", this.isOpen = !1);
11116 }, this.getHeight = function () {
11117 return this.getElement().offsetHeight;
11118 }, this.getWidth = function () {
11119 return this.getElement().offsetWidth;
11120 }, this.destroy = function () {
11121 this.isOpen = !1, this.$element && this.$element.parentNode && this.$element.parentNode.removeChild(this.$element);
11122 };
11123 }).call(s.prototype), t.Tooltip = s;
11124 }), ace.define("ace/mouse/default_gutter_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/event", "ace/tooltip"], function (e, t, n) {
11125 "use strict";
11126
11127 function u(e) {
11128 function l() {
11129 var r = u.getDocumentPosition().row,
11130 s = n.$annotations[r];
11131 if (!s) return c();
11132 var o = t.session.getLength();
11133
11134 if (r == o) {
11135 var a = t.renderer.pixelToScreenCoordinates(0, u.y).row,
11136 l = u.$pos;
11137 if (a > t.session.documentToScreenRow(l.row, l.column)) return c();
11138 }
11139
11140 if (f == s) return;
11141 f = s.text.join("<br/>"), i.setHtml(f), i.show(), t._signal("showGutterTooltip", i), t.on("mousewheel", c);
11142 if (e.$tooltipFollowsMouse) h(u);else {
11143 var p = u.domEvent.target,
11144 d = p.getBoundingClientRect(),
11145 v = i.getElement().style;
11146 v.left = d.right + "px", v.top = d.bottom + "px";
11147 }
11148 }
11149
11150 function c() {
11151 o && (o = clearTimeout(o)), f && (i.hide(), f = null, t._signal("hideGutterTooltip", i), t.removeEventListener("mousewheel", c));
11152 }
11153
11154 function h(e) {
11155 i.setPosition(e.x, e.y);
11156 }
11157
11158 var t = e.editor,
11159 n = t.renderer.$gutterLayer,
11160 i = new a(t.container);
11161 e.editor.setDefaultHandler("guttermousedown", function (r) {
11162 if (!t.isFocused() || r.getButton() != 0) return;
11163 var i = n.getRegion(r);
11164 if (i == "foldWidgets") return;
11165 var s = r.getDocumentPosition().row,
11166 o = t.session.selection;
11167 if (r.getShiftKey()) o.selectTo(s, 0);else {
11168 if (r.domEvent.detail == 2) return t.selectAll(), r.preventDefault();
11169 e.$clickSelection = t.selection.getLineRange(s);
11170 }
11171 return e.setState("selectByLines"), e.captureMouse(r), r.preventDefault();
11172 });
11173 var o, u, f;
11174 e.editor.setDefaultHandler("guttermousemove", function (t) {
11175 var n = t.domEvent.target || t.domEvent.srcElement;
11176 if (r.hasCssClass(n, "ace_fold-widget")) return c();
11177 f && e.$tooltipFollowsMouse && h(t), u = t;
11178 if (o) return;
11179 o = setTimeout(function () {
11180 o = null, u && !e.isMousePressed ? l() : c();
11181 }, 50);
11182 }), s.addListener(t.renderer.$gutter, "mouseout", function (e) {
11183 u = null;
11184 if (!f || o) return;
11185 o = setTimeout(function () {
11186 o = null, c();
11187 }, 50);
11188 }), t.on("changeSession", c);
11189 }
11190
11191 function a(e) {
11192 o.call(this, e);
11193 }
11194
11195 var r = e("../lib/dom"),
11196 i = e("../lib/oop"),
11197 s = e("../lib/event"),
11198 o = e("../tooltip").Tooltip;
11199 i.inherits(a, o), function () {
11200 this.setPosition = function (e, t) {
11201 var n = window.innerWidth || document.documentElement.clientWidth,
11202 r = window.innerHeight || document.documentElement.clientHeight,
11203 i = this.getWidth(),
11204 s = this.getHeight();
11205 e += 15, t += 15, e + i > n && (e -= e + i - n), t + s > r && (t -= 20 + s), o.prototype.setPosition.call(this, e, t);
11206 };
11207 }.call(a.prototype), t.GutterHandler = u;
11208 }), ace.define("ace/mouse/mouse_event", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
11209 "use strict";
11210
11211 var r = e("../lib/event"),
11212 i = e("../lib/useragent"),
11213 s = t.MouseEvent = function (e, t) {
11214 this.domEvent = e, this.editor = t, this.x = this.clientX = e.clientX, this.y = this.clientY = e.clientY, this.$pos = null, this.$inSelection = null, this.propagationStopped = !1, this.defaultPrevented = !1;
11215 };
11216
11217 (function () {
11218 this.stopPropagation = function () {
11219 r.stopPropagation(this.domEvent), this.propagationStopped = !0;
11220 }, this.preventDefault = function () {
11221 r.preventDefault(this.domEvent), this.defaultPrevented = !0;
11222 }, this.stop = function () {
11223 this.stopPropagation(), this.preventDefault();
11224 }, this.getDocumentPosition = function () {
11225 return this.$pos ? this.$pos : (this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY), this.$pos);
11226 }, this.inSelection = function () {
11227 if (this.$inSelection !== null) return this.$inSelection;
11228 var e = this.editor,
11229 t = e.getSelectionRange();
11230 if (t.isEmpty()) this.$inSelection = !1;else {
11231 var n = this.getDocumentPosition();
11232 this.$inSelection = t.contains(n.row, n.column);
11233 }
11234 return this.$inSelection;
11235 }, this.getButton = function () {
11236 return r.getButton(this.domEvent);
11237 }, this.getShiftKey = function () {
11238 return this.domEvent.shiftKey;
11239 }, this.getAccelKey = i.isMac ? function () {
11240 return this.domEvent.metaKey;
11241 } : function () {
11242 return this.domEvent.ctrlKey;
11243 };
11244 }).call(s.prototype);
11245 }), ace.define("ace/mouse/dragdrop_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
11246 "use strict";
11247
11248 function f(e) {
11249 function T(e, n) {
11250 var r = Date.now(),
11251 i = !n || e.row != n.row,
11252 s = !n || e.column != n.column;
11253 if (!S || i || s) t.$blockScrolling += 1, t.moveCursorToPosition(e), t.$blockScrolling -= 1, S = r, x = {
11254 x: p,
11255 y: d
11256 };else {
11257 var o = l(x.x, x.y, p, d);
11258 o > a ? S = null : r - S >= u && (t.renderer.scrollCursorIntoView(), S = null);
11259 }
11260 }
11261
11262 function N(e, n) {
11263 var r = Date.now(),
11264 i = t.renderer.layerConfig.lineHeight,
11265 s = t.renderer.layerConfig.characterWidth,
11266 u = t.renderer.scroller.getBoundingClientRect(),
11267 a = {
11268 x: {
11269 left: p - u.left,
11270 right: u.right - p
11271 },
11272 y: {
11273 top: d - u.top,
11274 bottom: u.bottom - d
11275 }
11276 },
11277 f = Math.min(a.x.left, a.x.right),
11278 l = Math.min(a.y.top, a.y.bottom),
11279 c = {
11280 row: e.row,
11281 column: e.column
11282 };
11283 f / s <= 2 && (c.column += a.x.left < a.x.right ? -3 : 2), l / i <= 1 && (c.row += a.y.top < a.y.bottom ? -1 : 1);
11284 var h = e.row != c.row,
11285 v = e.column != c.column,
11286 m = !n || e.row != n.row;
11287 h || v && !m ? E ? r - E >= o && t.renderer.scrollCursorIntoView(c) : E = r : E = null;
11288 }
11289
11290 function C() {
11291 var e = g;
11292 g = t.renderer.screenToTextCoordinates(p, d), T(g, e), N(g, e);
11293 }
11294
11295 function k() {
11296 m = t.selection.toOrientedRange(), h = t.session.addMarker(m, "ace_selection", t.getSelectionStyle()), t.clearSelection(), t.isFocused() && t.renderer.$cursorLayer.setBlinking(!1), clearInterval(v), C(), v = setInterval(C, 20), y = 0, i.addListener(document, "mousemove", O);
11297 }
11298
11299 function L() {
11300 clearInterval(v), t.session.removeMarker(h), h = null, t.$blockScrolling += 1, t.selection.fromOrientedRange(m), t.$blockScrolling -= 1, t.isFocused() && !w && t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()), m = null, g = null, y = 0, E = null, S = null, i.removeListener(document, "mousemove", O);
11301 }
11302
11303 function O() {
11304 A == null && (A = setTimeout(function () {
11305 A != null && h && L();
11306 }, 20));
11307 }
11308
11309 function M(e) {
11310 var t = e.types;
11311 return !t || Array.prototype.some.call(t, function (e) {
11312 return e == "text/plain" || e == "Text";
11313 });
11314 }
11315
11316 function _(e) {
11317 var t = ["copy", "copymove", "all", "uninitialized"],
11318 n = ["move", "copymove", "linkmove", "all", "uninitialized"],
11319 r = s.isMac ? e.altKey : e.ctrlKey,
11320 i = "uninitialized";
11321
11322 try {
11323 i = e.dataTransfer.effectAllowed.toLowerCase();
11324 } catch (e) {}
11325
11326 var o = "none";
11327 return r && t.indexOf(i) >= 0 ? o = "copy" : n.indexOf(i) >= 0 ? o = "move" : t.indexOf(i) >= 0 && (o = "copy"), o;
11328 }
11329
11330 var t = e.editor,
11331 n = r.createElement("img");
11332 n.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", s.isOpera && (n.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");
11333 var f = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"];
11334 f.forEach(function (t) {
11335 e[t] = this[t];
11336 }, this), t.addEventListener("mousedown", this.onMouseDown.bind(e));
11337 var c = t.container,
11338 h,
11339 p,
11340 d,
11341 v,
11342 m,
11343 g,
11344 y = 0,
11345 b,
11346 w,
11347 E,
11348 S,
11349 x;
11350 this.onDragStart = function (e) {
11351 if (this.cancelDrag || !c.draggable) {
11352 var r = this;
11353 return setTimeout(function () {
11354 r.startSelect(), r.captureMouse(e);
11355 }, 0), e.preventDefault();
11356 }
11357
11358 m = t.getSelectionRange();
11359 var i = e.dataTransfer;
11360 i.effectAllowed = t.getReadOnly() ? "copy" : "copyMove", s.isOpera && (t.container.appendChild(n), n.scrollTop = 0), i.setDragImage && i.setDragImage(n, 0, 0), s.isOpera && t.container.removeChild(n), i.clearData(), i.setData("Text", t.session.getTextRange()), w = !0, this.setState("drag");
11361 }, this.onDragEnd = function (e) {
11362 c.draggable = !1, w = !1, this.setState(null);
11363
11364 if (!t.getReadOnly()) {
11365 var n = e.dataTransfer.dropEffect;
11366 !b && n == "move" && t.session.remove(t.getSelectionRange()), t.renderer.$cursorLayer.setBlinking(!0);
11367 }
11368
11369 this.editor.unsetStyle("ace_dragging"), this.editor.renderer.setCursorStyle("");
11370 }, this.onDragEnter = function (e) {
11371 if (t.getReadOnly() || !M(e.dataTransfer)) return;
11372 return p = e.clientX, d = e.clientY, h || k(), y++, e.dataTransfer.dropEffect = b = _(e), i.preventDefault(e);
11373 }, this.onDragOver = function (e) {
11374 if (t.getReadOnly() || !M(e.dataTransfer)) return;
11375 return p = e.clientX, d = e.clientY, h || (k(), y++), A !== null && (A = null), e.dataTransfer.dropEffect = b = _(e), i.preventDefault(e);
11376 }, this.onDragLeave = function (e) {
11377 y--;
11378 if (y <= 0 && h) return L(), b = null, i.preventDefault(e);
11379 }, this.onDrop = function (e) {
11380 if (!g) return;
11381 var n = e.dataTransfer;
11382 if (w) switch (b) {
11383 case "move":
11384 m.contains(g.row, g.column) ? m = {
11385 start: g,
11386 end: g
11387 } : m = t.moveText(m, g);
11388 break;
11389
11390 case "copy":
11391 m = t.moveText(m, g, !0);
11392 } else {
11393 var r = n.getData("Text");
11394 m = {
11395 start: g,
11396 end: t.session.insert(g, r)
11397 }, t.focus(), b = null;
11398 }
11399 return L(), i.preventDefault(e);
11400 }, i.addListener(c, "dragstart", this.onDragStart.bind(e)), i.addListener(c, "dragend", this.onDragEnd.bind(e)), i.addListener(c, "dragenter", this.onDragEnter.bind(e)), i.addListener(c, "dragover", this.onDragOver.bind(e)), i.addListener(c, "dragleave", this.onDragLeave.bind(e)), i.addListener(c, "drop", this.onDrop.bind(e));
11401 var A = null;
11402 }
11403
11404 function l(e, t, n, r) {
11405 return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - t, 2));
11406 }
11407
11408 var r = e("../lib/dom"),
11409 i = e("../lib/event"),
11410 s = e("../lib/useragent"),
11411 o = 200,
11412 u = 200,
11413 a = 5;
11414 (function () {
11415 this.dragWait = function () {
11416 var e = Date.now() - this.mousedownEvent.time;
11417 e > this.editor.getDragDelay() && this.startDrag();
11418 }, this.dragWaitEnd = function () {
11419 var e = this.editor.container;
11420 e.draggable = !1, this.startSelect(this.mousedownEvent.getDocumentPosition()), this.selectEnd();
11421 }, this.dragReadyEnd = function (e) {
11422 this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()), this.editor.unsetStyle("ace_dragging"), this.editor.renderer.setCursorStyle(""), this.dragWaitEnd();
11423 }, this.startDrag = function () {
11424 this.cancelDrag = !1;
11425 var e = this.editor,
11426 t = e.container;
11427 t.draggable = !0, e.renderer.$cursorLayer.setBlinking(!1), e.setStyle("ace_dragging");
11428 var n = s.isWin ? "default" : "move";
11429 e.renderer.setCursorStyle(n), this.setState("dragReady");
11430 }, this.onMouseDrag = function (e) {
11431 var t = this.editor.container;
11432
11433 if (s.isIE && this.state == "dragReady") {
11434 var n = l(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
11435 n > 3 && t.dragDrop();
11436 }
11437
11438 if (this.state === "dragWait") {
11439 var n = l(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
11440 n > 0 && (t.draggable = !1, this.startSelect(this.mousedownEvent.getDocumentPosition()));
11441 }
11442 }, this.onMouseDown = function (e) {
11443 if (!this.$dragEnabled) return;
11444 this.mousedownEvent = e;
11445 var t = this.editor,
11446 n = e.inSelection(),
11447 r = e.getButton(),
11448 i = e.domEvent.detail || 1;
11449
11450 if (i === 1 && r === 0 && n) {
11451 if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey())) return;
11452 this.mousedownEvent.time = Date.now();
11453 var o = e.domEvent.target || e.domEvent.srcElement;
11454 "unselectable" in o && (o.unselectable = "on");
11455
11456 if (t.getDragDelay()) {
11457 if (s.isWebKit) {
11458 this.cancelDrag = !0;
11459 var u = t.container;
11460 u.draggable = !0;
11461 }
11462
11463 this.setState("dragWait");
11464 } else this.startDrag();
11465
11466 this.captureMouse(e, this.onMouseDrag.bind(this)), e.defaultPrevented = !0;
11467 }
11468 };
11469 }).call(f.prototype), t.DragdropHandler = f;
11470 }), ace.define("ace/lib/net", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
11471 "use strict";
11472
11473 var r = e("./dom");
11474 t.get = function (e, t) {
11475 var n = new XMLHttpRequest();
11476 n.open("GET", e, !0), n.onreadystatechange = function () {
11477 n.readyState === 4 && t(n.responseText);
11478 }, n.send(null);
11479 }, t.loadScript = function (e, t) {
11480 var n = r.getDocumentHead(),
11481 i = document.createElement("script");
11482 i.src = e, n.appendChild(i), i.onload = i.onreadystatechange = function (e, n) {
11483 if (n || !i.readyState || i.readyState == "loaded" || i.readyState == "complete") i = i.onload = i.onreadystatechange = null, n || t();
11484 };
11485 }, t.qualifyURL = function (e) {
11486 var t = document.createElement("a");
11487 return t.href = e, t.href;
11488 };
11489 }), ace.define("ace/lib/event_emitter", ["require", "exports", "module"], function (e, t, n) {
11490 "use strict";
11491
11492 var r = {},
11493 i = function i() {
11494 this.propagationStopped = !0;
11495 },
11496 s = function s() {
11497 this.defaultPrevented = !0;
11498 };
11499
11500 r._emit = r._dispatchEvent = function (e, t) {
11501 this._eventRegistry || (this._eventRegistry = {}), this._defaultHandlers || (this._defaultHandlers = {});
11502 var n = this._eventRegistry[e] || [],
11503 r = this._defaultHandlers[e];
11504 if (!n.length && !r) return;
11505 if (_typeof(t) != "object" || !t) t = {};
11506 t.type || (t.type = e), t.stopPropagation || (t.stopPropagation = i), t.preventDefault || (t.preventDefault = s), n = n.slice();
11507
11508 for (var o = 0; o < n.length; o++) {
11509 n[o](t, this);
11510 if (t.propagationStopped) break;
11511 }
11512
11513 if (r && !t.defaultPrevented) return r(t, this);
11514 }, r._signal = function (e, t) {
11515 var n = (this._eventRegistry || {})[e];
11516 if (!n) return;
11517 n = n.slice();
11518
11519 for (var r = 0; r < n.length; r++) {
11520 n[r](t, this);
11521 }
11522 }, r.once = function (e, t) {
11523 var n = this;
11524 t && this.addEventListener(e, function r() {
11525 n.removeEventListener(e, r), t.apply(null, arguments);
11526 });
11527 }, r.setDefaultHandler = function (e, t) {
11528 var n = this._defaultHandlers;
11529 n || (n = this._defaultHandlers = {
11530 _disabled_: {}
11531 });
11532
11533 if (n[e]) {
11534 var r = n[e],
11535 i = n._disabled_[e];
11536 i || (n._disabled_[e] = i = []), i.push(r);
11537 var s = i.indexOf(t);
11538 s != -1 && i.splice(s, 1);
11539 }
11540
11541 n[e] = t;
11542 }, r.removeDefaultHandler = function (e, t) {
11543 var n = this._defaultHandlers;
11544 if (!n) return;
11545 var r = n._disabled_[e];
11546
11547 if (n[e] == t) {
11548 var i = n[e];
11549 r && this.setDefaultHandler(e, r.pop());
11550 } else if (r) {
11551 var s = r.indexOf(t);
11552 s != -1 && r.splice(s, 1);
11553 }
11554 }, r.on = r.addEventListener = function (e, t, n) {
11555 this._eventRegistry = this._eventRegistry || {};
11556 var r = this._eventRegistry[e];
11557 return r || (r = this._eventRegistry[e] = []), r.indexOf(t) == -1 && r[n ? "unshift" : "push"](t), t;
11558 }, r.off = r.removeListener = r.removeEventListener = function (e, t) {
11559 this._eventRegistry = this._eventRegistry || {};
11560 var n = this._eventRegistry[e];
11561 if (!n) return;
11562 var r = n.indexOf(t);
11563 r !== -1 && n.splice(r, 1);
11564 }, r.removeAllListeners = function (e) {
11565 this._eventRegistry && (this._eventRegistry[e] = []);
11566 }, t.EventEmitter = r;
11567 }), ace.define("ace/lib/app_config", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function (e, t, n) {
11568 "no use strict";
11569
11570 function o(e) {
11571 typeof console != "undefined" && console.warn && console.warn.apply(console, arguments);
11572 }
11573
11574 function u(e, t) {
11575 var n = new Error(e);
11576 n.data = t, (typeof console === "undefined" ? "undefined" : _typeof(console)) == "object" && console.error && console.error(n), setTimeout(function () {
11577 throw n;
11578 });
11579 }
11580
11581 var r = e("./oop"),
11582 i = e("./event_emitter").EventEmitter,
11583 s = {
11584 setOptions: function setOptions(e) {
11585 Object.keys(e).forEach(function (t) {
11586 this.setOption(t, e[t]);
11587 }, this);
11588 },
11589 getOptions: function getOptions(e) {
11590 var t = {};
11591 return e ? Array.isArray(e) || (t = e, e = Object.keys(t)) : e = Object.keys(this.$options), e.forEach(function (e) {
11592 t[e] = this.getOption(e);
11593 }, this), t;
11594 },
11595 setOption: function setOption(e, t) {
11596 if (this["$" + e] === t) return;
11597 var n = this.$options[e];
11598 if (!n) return o('misspelled option "' + e + '"');
11599 if (n.forwardTo) return this[n.forwardTo] && this[n.forwardTo].setOption(e, t);
11600 n.handlesSet || (this["$" + e] = t), n && n.set && n.set.call(this, t);
11601 },
11602 getOption: function getOption(e) {
11603 var t = this.$options[e];
11604 return t ? t.forwardTo ? this[t.forwardTo] && this[t.forwardTo].getOption(e) : t && t.get ? t.get.call(this) : this["$" + e] : o('misspelled option "' + e + '"');
11605 }
11606 },
11607 a = function a() {
11608 this.$defaultOptions = {};
11609 };
11610
11611 (function () {
11612 r.implement(this, i), this.defineOptions = function (e, t, n) {
11613 return e.$options || (this.$defaultOptions[t] = e.$options = {}), Object.keys(n).forEach(function (t) {
11614 var r = n[t];
11615 typeof r == "string" && (r = {
11616 forwardTo: r
11617 }), r.name || (r.name = t), e.$options[r.name] = r, "initialValue" in r && (e["$" + r.name] = r.initialValue);
11618 }), r.implement(e, s), this;
11619 }, this.resetOptions = function (e) {
11620 Object.keys(e.$options).forEach(function (t) {
11621 var n = e.$options[t];
11622 "value" in n && e.setOption(t, n.value);
11623 });
11624 }, this.setDefaultValue = function (e, t, n) {
11625 var r = this.$defaultOptions[e] || (this.$defaultOptions[e] = {});
11626 r[t] && (r.forwardTo ? this.setDefaultValue(r.forwardTo, t, n) : r[t].value = n);
11627 }, this.setDefaultValues = function (e, t) {
11628 Object.keys(t).forEach(function (n) {
11629 this.setDefaultValue(e, n, t[n]);
11630 }, this);
11631 }, this.warn = o, this.reportError = u;
11632 }).call(a.prototype), t.AppConfig = a;
11633 }), ace.define("ace/config", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/lib/net", "ace/lib/app_config"], function (e, t, n) {
11634 "no use strict";
11635
11636 function f(r) {
11637 if (!u || !u.document) return;
11638 a.packaged = r || e.packaged || n.packaged || u.define && define.packaged;
11639 var i = {},
11640 s = "",
11641 o = document.currentScript || document._currentScript,
11642 f = o && o.ownerDocument || document,
11643 c = f.getElementsByTagName("script");
11644
11645 for (var h = 0; h < c.length; h++) {
11646 var p = c[h],
11647 d = p.src || p.getAttribute("src");
11648 if (!d) continue;
11649 var v = p.attributes;
11650
11651 for (var m = 0, g = v.length; m < g; m++) {
11652 var y = v[m];
11653 y.name.indexOf("data-ace-") === 0 && (i[l(y.name.replace(/^data-ace-/, ""))] = y.value);
11654 }
11655
11656 var b = d.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);
11657 b && (s = b[1]);
11658 }
11659
11660 s && (i.base = i.base || s, i.packaged = !0), i.basePath = i.base, i.workerPath = i.workerPath || i.base, i.modePath = i.modePath || i.base, i.themePath = i.themePath || i.base, delete i.base;
11661
11662 for (var w in i) {
11663 typeof i[w] != "undefined" && t.set(w, i[w]);
11664 }
11665 }
11666
11667 function l(e) {
11668 return e.replace(/-(.)/g, function (e, t) {
11669 return t.toUpperCase();
11670 });
11671 }
11672
11673 var r = e("./lib/lang"),
11674 i = e("./lib/oop"),
11675 s = e("./lib/net"),
11676 o = e("./lib/app_config").AppConfig;
11677 n.exports = t = new o();
11678
11679 var u = function () {
11680 return this || typeof window != "undefined" && window;
11681 }(),
11682 a = {
11683 packaged: !1,
11684 workerPath: null,
11685 modePath: null,
11686 themePath: null,
11687 basePath: "",
11688 suffix: ".js",
11689 $moduleUrls: {}
11690 };
11691
11692 t.get = function (e) {
11693 if (!a.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
11694 return a[e];
11695 }, t.set = function (e, t) {
11696 if (!a.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
11697 a[e] = t;
11698 }, t.all = function () {
11699 return r.copyObject(a);
11700 }, t.moduleUrl = function (e, t) {
11701 if (a.$moduleUrls[e]) return a.$moduleUrls[e];
11702 var n = e.split("/");
11703 t = t || n[n.length - 2] || "";
11704 var r = t == "snippets" ? "/" : "-",
11705 i = n[n.length - 1];
11706
11707 if (t == "worker" && r == "-") {
11708 var s = new RegExp("^" + t + "[\\-_]|[\\-_]" + t + "$", "g");
11709 i = i.replace(s, "");
11710 }
11711
11712 (!i || i == t) && n.length > 1 && (i = n[n.length - 2]);
11713 var o = a[t + "Path"];
11714 return o == null ? o = a.basePath : r == "/" && (t = r = ""), o && o.slice(-1) != "/" && (o += "/"), o + t + r + i + this.get("suffix");
11715 }, t.setModuleUrl = function (e, t) {
11716 return a.$moduleUrls[e] = t;
11717 }, t.$loading = {}, t.loadModule = function (n, r) {
11718 var i, o;
11719 Array.isArray(n) && (o = n[0], n = n[1]);
11720
11721 try {
11722 i = e(n);
11723 } catch (u) {}
11724
11725 if (i && !t.$loading[n]) return r && r(i);
11726 t.$loading[n] || (t.$loading[n] = []), t.$loading[n].push(r);
11727 if (t.$loading[n].length > 1) return;
11728
11729 var a = function a() {
11730 e([n], function (e) {
11731 t._emit("load.module", {
11732 name: n,
11733 module: e
11734 });
11735
11736 var r = t.$loading[n];
11737 t.$loading[n] = null, r.forEach(function (t) {
11738 t && t(e);
11739 });
11740 });
11741 };
11742
11743 if (!t.get("packaged")) return a();
11744 s.loadScript(t.moduleUrl(n, o), a);
11745 }, t.init = f;
11746 }), ace.define("ace/mouse/mouse_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/mouse/default_handlers", "ace/mouse/default_gutter_handler", "ace/mouse/mouse_event", "ace/mouse/dragdrop_handler", "ace/config"], function (e, t, n) {
11747 "use strict";
11748
11749 var r = e("../lib/event"),
11750 i = e("../lib/useragent"),
11751 s = e("./default_handlers").DefaultHandlers,
11752 o = e("./default_gutter_handler").GutterHandler,
11753 u = e("./mouse_event").MouseEvent,
11754 a = e("./dragdrop_handler").DragdropHandler,
11755 f = e("../config"),
11756 l = function l(e) {
11757 var t = this;
11758 this.editor = e, new s(this), new o(this), new a(this);
11759
11760 var n = function n(t) {
11761 var n = !document.hasFocus || !document.hasFocus() || !e.isFocused() && document.activeElement == (e.textInput && e.textInput.getElement());
11762 n && window.focus(), e.focus();
11763 },
11764 u = e.renderer.getMouseEventTarget();
11765
11766 r.addListener(u, "click", this.onMouseEvent.bind(this, "click")), r.addListener(u, "mousemove", this.onMouseMove.bind(this, "mousemove")), r.addMultiMouseDownListener([u, e.renderer.scrollBarV && e.renderer.scrollBarV.inner, e.renderer.scrollBarH && e.renderer.scrollBarH.inner, e.textInput && e.textInput.getElement()].filter(Boolean), [400, 300, 250], this, "onMouseEvent"), r.addMouseWheelListener(e.container, this.onMouseWheel.bind(this, "mousewheel")), r.addTouchMoveListener(e.container, this.onTouchMove.bind(this, "touchmove"));
11767 var f = e.renderer.$gutter;
11768 r.addListener(f, "mousedown", this.onMouseEvent.bind(this, "guttermousedown")), r.addListener(f, "click", this.onMouseEvent.bind(this, "gutterclick")), r.addListener(f, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick")), r.addListener(f, "mousemove", this.onMouseEvent.bind(this, "guttermousemove")), r.addListener(u, "mousedown", n), r.addListener(f, "mousedown", n), i.isIE && e.renderer.scrollBarV && (r.addListener(e.renderer.scrollBarV.element, "mousedown", n), r.addListener(e.renderer.scrollBarH.element, "mousedown", n)), e.on("mousemove", function (n) {
11769 if (t.state || t.$dragDelay || !t.$dragEnabled) return;
11770 var r = e.renderer.screenToTextCoordinates(n.x, n.y),
11771 i = e.session.selection.getRange(),
11772 s = e.renderer;
11773 !i.isEmpty() && i.insideStart(r.row, r.column) ? s.setCursorStyle("default") : s.setCursorStyle("");
11774 });
11775 };
11776
11777 (function () {
11778 this.onMouseEvent = function (e, t) {
11779 this.editor._emit(e, new u(t, this.editor));
11780 }, this.onMouseMove = function (e, t) {
11781 var n = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
11782 if (!n || !n.length) return;
11783
11784 this.editor._emit(e, new u(t, this.editor));
11785 }, this.onMouseWheel = function (e, t) {
11786 var n = new u(t, this.editor);
11787 n.speed = this.$scrollSpeed * 2, n.wheelX = t.wheelX, n.wheelY = t.wheelY, this.editor._emit(e, n);
11788 }, this.onTouchMove = function (e, t) {
11789 var n = new u(t, this.editor);
11790 n.speed = 1, n.wheelX = t.wheelX, n.wheelY = t.wheelY, this.editor._emit(e, n);
11791 }, this.setState = function (e) {
11792 this.state = e;
11793 }, this.captureMouse = function (e, t) {
11794 this.x = e.x, this.y = e.y, this.isMousePressed = !0;
11795 var n = this.editor.renderer;
11796 n.$keepTextAreaAtCursor && (n.$keepTextAreaAtCursor = null);
11797
11798 var s = this,
11799 o = function o(e) {
11800 if (!e) return;
11801 if (i.isWebKit && !e.which && s.releaseMouse) return s.releaseMouse();
11802 s.x = e.clientX, s.y = e.clientY, t && t(e), s.mouseEvent = new u(e, s.editor), s.$mouseMoved = !0;
11803 },
11804 a = function a(e) {
11805 clearInterval(l), f(), s[s.state + "End"] && s[s.state + "End"](e), s.state = "", n.$keepTextAreaAtCursor == null && (n.$keepTextAreaAtCursor = !0, n.$moveTextAreaToCursor()), s.isMousePressed = !1, s.$onCaptureMouseMove = s.releaseMouse = null, e && s.onMouseEvent("mouseup", e);
11806 },
11807 f = function f() {
11808 s[s.state] && s[s.state](), s.$mouseMoved = !1;
11809 };
11810
11811 if (i.isOldIE && e.domEvent.type == "dblclick") return setTimeout(function () {
11812 a(e);
11813 });
11814 s.$onCaptureMouseMove = o, s.releaseMouse = r.capture(this.editor.container, o, a);
11815 var l = setInterval(f, 20);
11816 }, this.releaseMouse = null, this.cancelContextMenu = function () {
11817 var e = function (t) {
11818 if (t && t.domEvent && t.domEvent.type != "contextmenu") return;
11819 this.editor.off("nativecontextmenu", e), t && t.domEvent && r.stopEvent(t.domEvent);
11820 }.bind(this);
11821
11822 setTimeout(e, 10), this.editor.on("nativecontextmenu", e);
11823 };
11824 }).call(l.prototype), f.defineOptions(l.prototype, "mouseHandler", {
11825 scrollSpeed: {
11826 initialValue: 2
11827 },
11828 dragDelay: {
11829 initialValue: i.isMac ? 150 : 0
11830 },
11831 dragEnabled: {
11832 initialValue: !0
11833 },
11834 focusTimout: {
11835 initialValue: 0
11836 },
11837 tooltipFollowsMouse: {
11838 initialValue: !0
11839 }
11840 }), t.MouseHandler = l;
11841 }), ace.define("ace/mouse/fold_handler", ["require", "exports", "module"], function (e, t, n) {
11842 "use strict";
11843
11844 function r(e) {
11845 e.on("click", function (t) {
11846 var n = t.getDocumentPosition(),
11847 r = e.session,
11848 i = r.getFoldAt(n.row, n.column, 1);
11849 i && (t.getAccelKey() ? r.removeFold(i) : r.expandFold(i), t.stop());
11850 }), e.on("gutterclick", function (t) {
11851 var n = e.renderer.$gutterLayer.getRegion(t);
11852
11853 if (n == "foldWidgets") {
11854 var r = t.getDocumentPosition().row,
11855 i = e.session;
11856 i.foldWidgets && i.foldWidgets[r] && e.session.onFoldWidgetClick(r, t), e.isFocused() || e.focus(), t.stop();
11857 }
11858 }), e.on("gutterdblclick", function (t) {
11859 var n = e.renderer.$gutterLayer.getRegion(t);
11860
11861 if (n == "foldWidgets") {
11862 var r = t.getDocumentPosition().row,
11863 i = e.session,
11864 s = i.getParentFoldRangeData(r, !0),
11865 o = s.range || s.firstRange;
11866
11867 if (o) {
11868 r = o.start.row;
11869 var u = i.getFoldAt(r, i.getLine(r).length, 1);
11870 u ? i.removeFold(u) : (i.addFold("...", o), e.renderer.scrollCursorIntoView({
11871 row: o.start.row,
11872 column: 0
11873 }));
11874 }
11875
11876 t.stop();
11877 }
11878 });
11879 }
11880
11881 t.FoldHandler = r;
11882 }), ace.define("ace/keyboard/keybinding", ["require", "exports", "module", "ace/lib/keys", "ace/lib/event"], function (e, t, n) {
11883 "use strict";
11884
11885 var r = e("../lib/keys"),
11886 i = e("../lib/event"),
11887 s = function s(e) {
11888 this.$editor = e, this.$data = {
11889 editor: e
11890 }, this.$handlers = [], this.setDefaultHandler(e.commands);
11891 };
11892
11893 (function () {
11894 this.setDefaultHandler = function (e) {
11895 this.removeKeyboardHandler(this.$defaultHandler), this.$defaultHandler = e, this.addKeyboardHandler(e, 0);
11896 }, this.setKeyboardHandler = function (e) {
11897 var t = this.$handlers;
11898 if (t[t.length - 1] == e) return;
11899
11900 while (t[t.length - 1] && t[t.length - 1] != this.$defaultHandler) {
11901 this.removeKeyboardHandler(t[t.length - 1]);
11902 }
11903
11904 this.addKeyboardHandler(e, 1);
11905 }, this.addKeyboardHandler = function (e, t) {
11906 if (!e) return;
11907 typeof e == "function" && !e.handleKeyboard && (e.handleKeyboard = e);
11908 var n = this.$handlers.indexOf(e);
11909 n != -1 && this.$handlers.splice(n, 1), t == undefined ? this.$handlers.push(e) : this.$handlers.splice(t, 0, e), n == -1 && e.attach && e.attach(this.$editor);
11910 }, this.removeKeyboardHandler = function (e) {
11911 var t = this.$handlers.indexOf(e);
11912 return t == -1 ? !1 : (this.$handlers.splice(t, 1), e.detach && e.detach(this.$editor), !0);
11913 }, this.getKeyboardHandler = function () {
11914 return this.$handlers[this.$handlers.length - 1];
11915 }, this.getStatusText = function () {
11916 var e = this.$data,
11917 t = e.editor;
11918 return this.$handlers.map(function (n) {
11919 return n.getStatusText && n.getStatusText(t, e) || "";
11920 }).filter(Boolean).join(" ");
11921 }, this.$callKeyboardHandlers = function (e, t, n, r) {
11922 var s,
11923 o = !1,
11924 u = this.$editor.commands;
11925
11926 for (var a = this.$handlers.length; a--;) {
11927 s = this.$handlers[a].handleKeyboard(this.$data, e, t, n, r);
11928 if (!s || !s.command) continue;
11929 s.command == "null" ? o = !0 : o = u.exec(s.command, this.$editor, s.args, r), o && r && e != -1 && s.passEvent != 1 && s.command.passEvent != 1 && i.stopEvent(r);
11930 if (o) break;
11931 }
11932
11933 return !o && e == -1 && (s = {
11934 command: "insertstring"
11935 }, o = u.exec("insertstring", this.$editor, t)), o && this.$editor._signal && this.$editor._signal("keyboardActivity", s), o;
11936 }, this.onCommandKey = function (e, t, n) {
11937 var i = r.keyCodeToString(n);
11938 this.$callKeyboardHandlers(t, i, n, e);
11939 }, this.onTextInput = function (e) {
11940 this.$callKeyboardHandlers(-1, e);
11941 };
11942 }).call(s.prototype), t.KeyBinding = s;
11943 }), ace.define("ace/range", ["require", "exports", "module"], function (e, t, n) {
11944 "use strict";
11945
11946 var r = function r(e, t) {
11947 return e.row - t.row || e.column - t.column;
11948 },
11949 i = function i(e, t, n, r) {
11950 this.start = {
11951 row: e,
11952 column: t
11953 }, this.end = {
11954 row: n,
11955 column: r
11956 };
11957 };
11958
11959 (function () {
11960 this.isEqual = function (e) {
11961 return this.start.row === e.start.row && this.end.row === e.end.row && this.start.column === e.start.column && this.end.column === e.end.column;
11962 }, this.toString = function () {
11963 return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]";
11964 }, this.contains = function (e, t) {
11965 return this.compare(e, t) == 0;
11966 }, this.compareRange = function (e) {
11967 var t,
11968 n = e.end,
11969 r = e.start;
11970 return t = this.compare(n.row, n.column), t == 1 ? (t = this.compare(r.row, r.column), t == 1 ? 2 : t == 0 ? 1 : 0) : t == -1 ? -2 : (t = this.compare(r.row, r.column), t == -1 ? -1 : t == 1 ? 42 : 0);
11971 }, this.comparePoint = function (e) {
11972 return this.compare(e.row, e.column);
11973 }, this.containsRange = function (e) {
11974 return this.comparePoint(e.start) == 0 && this.comparePoint(e.end) == 0;
11975 }, this.intersects = function (e) {
11976 var t = this.compareRange(e);
11977 return t == -1 || t == 0 || t == 1;
11978 }, this.isEnd = function (e, t) {
11979 return this.end.row == e && this.end.column == t;
11980 }, this.isStart = function (e, t) {
11981 return this.start.row == e && this.start.column == t;
11982 }, this.setStart = function (e, t) {
11983 _typeof(e) == "object" ? (this.start.column = e.column, this.start.row = e.row) : (this.start.row = e, this.start.column = t);
11984 }, this.setEnd = function (e, t) {
11985 _typeof(e) == "object" ? (this.end.column = e.column, this.end.row = e.row) : (this.end.row = e, this.end.column = t);
11986 }, this.inside = function (e, t) {
11987 return this.compare(e, t) == 0 ? this.isEnd(e, t) || this.isStart(e, t) ? !1 : !0 : !1;
11988 }, this.insideStart = function (e, t) {
11989 return this.compare(e, t) == 0 ? this.isEnd(e, t) ? !1 : !0 : !1;
11990 }, this.insideEnd = function (e, t) {
11991 return this.compare(e, t) == 0 ? this.isStart(e, t) ? !1 : !0 : !1;
11992 }, this.compare = function (e, t) {
11993 return !this.isMultiLine() && e === this.start.row ? t < this.start.column ? -1 : t > this.end.column ? 1 : 0 : e < this.start.row ? -1 : e > this.end.row ? 1 : this.start.row === e ? t >= this.start.column ? 0 : -1 : this.end.row === e ? t <= this.end.column ? 0 : 1 : 0;
11994 }, this.compareStart = function (e, t) {
11995 return this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
11996 }, this.compareEnd = function (e, t) {
11997 return this.end.row == e && this.end.column == t ? 1 : this.compare(e, t);
11998 }, this.compareInside = function (e, t) {
11999 return this.end.row == e && this.end.column == t ? 1 : this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
12000 }, this.clipRows = function (e, t) {
12001 if (this.end.row > t) var n = {
12002 row: t + 1,
12003 column: 0
12004 };else if (this.end.row < e) var n = {
12005 row: e,
12006 column: 0
12007 };
12008 if (this.start.row > t) var r = {
12009 row: t + 1,
12010 column: 0
12011 };else if (this.start.row < e) var r = {
12012 row: e,
12013 column: 0
12014 };
12015 return i.fromPoints(r || this.start, n || this.end);
12016 }, this.extend = function (e, t) {
12017 var n = this.compare(e, t);
12018 if (n == 0) return this;
12019 if (n == -1) var r = {
12020 row: e,
12021 column: t
12022 };else var s = {
12023 row: e,
12024 column: t
12025 };
12026 return i.fromPoints(r || this.start, s || this.end);
12027 }, this.isEmpty = function () {
12028 return this.start.row === this.end.row && this.start.column === this.end.column;
12029 }, this.isMultiLine = function () {
12030 return this.start.row !== this.end.row;
12031 }, this.clone = function () {
12032 return i.fromPoints(this.start, this.end);
12033 }, this.collapseRows = function () {
12034 return this.end.column == 0 ? new i(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new i(this.start.row, 0, this.end.row, 0);
12035 }, this.toScreenRange = function (e) {
12036 var t = e.documentToScreenPosition(this.start),
12037 n = e.documentToScreenPosition(this.end);
12038 return new i(t.row, t.column, n.row, n.column);
12039 }, this.moveBy = function (e, t) {
12040 this.start.row += e, this.start.column += t, this.end.row += e, this.end.column += t;
12041 };
12042 }).call(i.prototype), i.fromPoints = function (e, t) {
12043 return new i(e.row, e.column, t.row, t.column);
12044 }, i.comparePoints = r, i.comparePoints = function (e, t) {
12045 return e.row - t.row || e.column - t.column;
12046 }, t.Range = i;
12047 }), ace.define("ace/selection", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter", "ace/range"], function (e, t, n) {
12048 "use strict";
12049
12050 var r = e("./lib/oop"),
12051 i = e("./lib/lang"),
12052 s = e("./lib/event_emitter").EventEmitter,
12053 o = e("./range").Range,
12054 u = function u(e) {
12055 this.session = e, this.doc = e.getDocument(), this.clearSelection(), this.lead = this.selectionLead = this.doc.createAnchor(0, 0), this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0);
12056 var t = this;
12057 this.lead.on("change", function (e) {
12058 t._emit("changeCursor"), t.$isEmpty || t._emit("changeSelection"), !t.$keepDesiredColumnOnChange && e.old.column != e.value.column && (t.$desiredColumn = null);
12059 }), this.selectionAnchor.on("change", function () {
12060 t.$isEmpty || t._emit("changeSelection");
12061 });
12062 };
12063
12064 (function () {
12065 r.implement(this, s), this.isEmpty = function () {
12066 return this.$isEmpty || this.anchor.row == this.lead.row && this.anchor.column == this.lead.column;
12067 }, this.isMultiLine = function () {
12068 return this.isEmpty() ? !1 : this.getRange().isMultiLine();
12069 }, this.getCursor = function () {
12070 return this.lead.getPosition();
12071 }, this.setSelectionAnchor = function (e, t) {
12072 this.anchor.setPosition(e, t), this.$isEmpty && (this.$isEmpty = !1, this._emit("changeSelection"));
12073 }, this.getSelectionAnchor = function () {
12074 return this.$isEmpty ? this.getSelectionLead() : this.anchor.getPosition();
12075 }, this.getSelectionLead = function () {
12076 return this.lead.getPosition();
12077 }, this.shiftSelection = function (e) {
12078 if (this.$isEmpty) {
12079 this.moveCursorTo(this.lead.row, this.lead.column + e);
12080 return;
12081 }
12082
12083 var t = this.getSelectionAnchor(),
12084 n = this.getSelectionLead(),
12085 r = this.isBackwards();
12086 (!r || t.column !== 0) && this.setSelectionAnchor(t.row, t.column + e), (r || n.column !== 0) && this.$moveSelection(function () {
12087 this.moveCursorTo(n.row, n.column + e);
12088 });
12089 }, this.isBackwards = function () {
12090 var e = this.anchor,
12091 t = this.lead;
12092 return e.row > t.row || e.row == t.row && e.column > t.column;
12093 }, this.getRange = function () {
12094 var e = this.anchor,
12095 t = this.lead;
12096 return this.isEmpty() ? o.fromPoints(t, t) : this.isBackwards() ? o.fromPoints(t, e) : o.fromPoints(e, t);
12097 }, this.clearSelection = function () {
12098 this.$isEmpty || (this.$isEmpty = !0, this._emit("changeSelection"));
12099 }, this.selectAll = function () {
12100 var e = this.doc.getLength() - 1;
12101 this.setSelectionAnchor(0, 0), this.moveCursorTo(e, this.doc.getLine(e).length);
12102 }, this.setRange = this.setSelectionRange = function (e, t) {
12103 t ? (this.setSelectionAnchor(e.end.row, e.end.column), this.selectTo(e.start.row, e.start.column)) : (this.setSelectionAnchor(e.start.row, e.start.column), this.selectTo(e.end.row, e.end.column)), this.getRange().isEmpty() && (this.$isEmpty = !0), this.$desiredColumn = null;
12104 }, this.$moveSelection = function (e) {
12105 var t = this.lead;
12106 this.$isEmpty && this.setSelectionAnchor(t.row, t.column), e.call(this);
12107 }, this.selectTo = function (e, t) {
12108 this.$moveSelection(function () {
12109 this.moveCursorTo(e, t);
12110 });
12111 }, this.selectToPosition = function (e) {
12112 this.$moveSelection(function () {
12113 this.moveCursorToPosition(e);
12114 });
12115 }, this.moveTo = function (e, t) {
12116 this.clearSelection(), this.moveCursorTo(e, t);
12117 }, this.moveToPosition = function (e) {
12118 this.clearSelection(), this.moveCursorToPosition(e);
12119 }, this.selectUp = function () {
12120 this.$moveSelection(this.moveCursorUp);
12121 }, this.selectDown = function () {
12122 this.$moveSelection(this.moveCursorDown);
12123 }, this.selectRight = function () {
12124 this.$moveSelection(this.moveCursorRight);
12125 }, this.selectLeft = function () {
12126 this.$moveSelection(this.moveCursorLeft);
12127 }, this.selectLineStart = function () {
12128 this.$moveSelection(this.moveCursorLineStart);
12129 }, this.selectLineEnd = function () {
12130 this.$moveSelection(this.moveCursorLineEnd);
12131 }, this.selectFileEnd = function () {
12132 this.$moveSelection(this.moveCursorFileEnd);
12133 }, this.selectFileStart = function () {
12134 this.$moveSelection(this.moveCursorFileStart);
12135 }, this.selectWordRight = function () {
12136 this.$moveSelection(this.moveCursorWordRight);
12137 }, this.selectWordLeft = function () {
12138 this.$moveSelection(this.moveCursorWordLeft);
12139 }, this.getWordRange = function (e, t) {
12140 if (typeof t == "undefined") {
12141 var n = e || this.lead;
12142 e = n.row, t = n.column;
12143 }
12144
12145 return this.session.getWordRange(e, t);
12146 }, this.selectWord = function () {
12147 this.setSelectionRange(this.getWordRange());
12148 }, this.selectAWord = function () {
12149 var e = this.getCursor(),
12150 t = this.session.getAWordRange(e.row, e.column);
12151 this.setSelectionRange(t);
12152 }, this.getLineRange = function (e, t) {
12153 var n = typeof e == "number" ? e : this.lead.row,
12154 r,
12155 i = this.session.getFoldLine(n);
12156 return i ? (n = i.start.row, r = i.end.row) : r = n, t === !0 ? new o(n, 0, r, this.session.getLine(r).length) : new o(n, 0, r + 1, 0);
12157 }, this.selectLine = function () {
12158 this.setSelectionRange(this.getLineRange());
12159 }, this.moveCursorUp = function () {
12160 this.moveCursorBy(-1, 0);
12161 }, this.moveCursorDown = function () {
12162 this.moveCursorBy(1, 0);
12163 }, this.wouldMoveIntoSoftTab = function (e, t, n) {
12164 var r = e.column,
12165 i = e.column + t;
12166 return n < 0 && (r = e.column - t, i = e.column), this.session.isTabStop(e) && this.doc.getLine(e.row).slice(r, i).split(" ").length - 1 == t;
12167 }, this.moveCursorLeft = function () {
12168 var e = this.lead.getPosition(),
12169 t;
12170 if (t = this.session.getFoldAt(e.row, e.column, -1)) this.moveCursorTo(t.start.row, t.start.column);else if (e.column === 0) e.row > 0 && this.moveCursorTo(e.row - 1, this.doc.getLine(e.row - 1).length);else {
12171 var n = this.session.getTabSize();
12172 this.wouldMoveIntoSoftTab(e, n, -1) && !this.session.getNavigateWithinSoftTabs() ? this.moveCursorBy(0, -n) : this.moveCursorBy(0, -1);
12173 }
12174 }, this.moveCursorRight = function () {
12175 var e = this.lead.getPosition(),
12176 t;
12177 if (t = this.session.getFoldAt(e.row, e.column, 1)) this.moveCursorTo(t.end.row, t.end.column);else if (this.lead.column == this.doc.getLine(this.lead.row).length) this.lead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.lead.row + 1, 0);else {
12178 var n = this.session.getTabSize(),
12179 e = this.lead;
12180 this.wouldMoveIntoSoftTab(e, n, 1) && !this.session.getNavigateWithinSoftTabs() ? this.moveCursorBy(0, n) : this.moveCursorBy(0, 1);
12181 }
12182 }, this.moveCursorLineStart = function () {
12183 var e = this.lead.row,
12184 t = this.lead.column,
12185 n = this.session.documentToScreenRow(e, t),
12186 r = this.session.screenToDocumentPosition(n, 0),
12187 i = this.session.getDisplayLine(e, null, r.row, r.column),
12188 s = i.match(/^\s*/);
12189 s[0].length != t && !this.session.$useEmacsStyleLineStart && (r.column += s[0].length), this.moveCursorToPosition(r);
12190 }, this.moveCursorLineEnd = function () {
12191 var e = this.lead,
12192 t = this.session.getDocumentLastRowColumnPosition(e.row, e.column);
12193
12194 if (this.lead.column == t.column) {
12195 var n = this.session.getLine(t.row);
12196
12197 if (t.column == n.length) {
12198 var r = n.search(/\s+$/);
12199 r > 0 && (t.column = r);
12200 }
12201 }
12202
12203 this.moveCursorTo(t.row, t.column);
12204 }, this.moveCursorFileEnd = function () {
12205 var e = this.doc.getLength() - 1,
12206 t = this.doc.getLine(e).length;
12207 this.moveCursorTo(e, t);
12208 }, this.moveCursorFileStart = function () {
12209 this.moveCursorTo(0, 0);
12210 }, this.moveCursorLongWordRight = function () {
12211 var e = this.lead.row,
12212 t = this.lead.column,
12213 n = this.doc.getLine(e),
12214 r = n.substring(t),
12215 i;
12216 this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0;
12217 var s = this.session.getFoldAt(e, t, 1);
12218
12219 if (s) {
12220 this.moveCursorTo(s.end.row, s.end.column);
12221 return;
12222 }
12223
12224 if (i = this.session.nonTokenRe.exec(r)) t += this.session.nonTokenRe.lastIndex, this.session.nonTokenRe.lastIndex = 0, r = n.substring(t);
12225
12226 if (t >= n.length) {
12227 this.moveCursorTo(e, n.length), this.moveCursorRight(), e < this.doc.getLength() - 1 && this.moveCursorWordRight();
12228 return;
12229 }
12230
12231 if (i = this.session.tokenRe.exec(r)) t += this.session.tokenRe.lastIndex, this.session.tokenRe.lastIndex = 0;
12232 this.moveCursorTo(e, t);
12233 }, this.moveCursorLongWordLeft = function () {
12234 var e = this.lead.row,
12235 t = this.lead.column,
12236 n;
12237
12238 if (n = this.session.getFoldAt(e, t, -1)) {
12239 this.moveCursorTo(n.start.row, n.start.column);
12240 return;
12241 }
12242
12243 var r = this.session.getFoldStringAt(e, t, -1);
12244 r == null && (r = this.doc.getLine(e).substring(0, t));
12245 var s = i.stringReverse(r),
12246 o;
12247 this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0;
12248 if (o = this.session.nonTokenRe.exec(s)) t -= this.session.nonTokenRe.lastIndex, s = s.slice(this.session.nonTokenRe.lastIndex), this.session.nonTokenRe.lastIndex = 0;
12249
12250 if (t <= 0) {
12251 this.moveCursorTo(e, 0), this.moveCursorLeft(), e > 0 && this.moveCursorWordLeft();
12252 return;
12253 }
12254
12255 if (o = this.session.tokenRe.exec(s)) t -= this.session.tokenRe.lastIndex, this.session.tokenRe.lastIndex = 0;
12256 this.moveCursorTo(e, t);
12257 }, this.$shortWordEndIndex = function (e) {
12258 var t,
12259 n = 0,
12260 r,
12261 i = /\s/,
12262 s = this.session.tokenRe;
12263 s.lastIndex = 0;
12264 if (t = this.session.tokenRe.exec(e)) n = this.session.tokenRe.lastIndex;else {
12265 while ((r = e[n]) && i.test(r)) {
12266 n++;
12267 }
12268
12269 if (n < 1) {
12270 s.lastIndex = 0;
12271
12272 while ((r = e[n]) && !s.test(r)) {
12273 s.lastIndex = 0, n++;
12274
12275 if (i.test(r)) {
12276 if (n > 2) {
12277 n--;
12278 break;
12279 }
12280
12281 while ((r = e[n]) && i.test(r)) {
12282 n++;
12283 }
12284
12285 if (n > 2) break;
12286 }
12287 }
12288 }
12289 }
12290 return s.lastIndex = 0, n;
12291 }, this.moveCursorShortWordRight = function () {
12292 var e = this.lead.row,
12293 t = this.lead.column,
12294 n = this.doc.getLine(e),
12295 r = n.substring(t),
12296 i = this.session.getFoldAt(e, t, 1);
12297 if (i) return this.moveCursorTo(i.end.row, i.end.column);
12298
12299 if (t == n.length) {
12300 var s = this.doc.getLength();
12301
12302 do {
12303 e++, r = this.doc.getLine(e);
12304 } while (e < s && /^\s*$/.test(r));
12305
12306 /^\s+/.test(r) || (r = ""), t = 0;
12307 }
12308
12309 var o = this.$shortWordEndIndex(r);
12310 this.moveCursorTo(e, t + o);
12311 }, this.moveCursorShortWordLeft = function () {
12312 var e = this.lead.row,
12313 t = this.lead.column,
12314 n;
12315 if (n = this.session.getFoldAt(e, t, -1)) return this.moveCursorTo(n.start.row, n.start.column);
12316 var r = this.session.getLine(e).substring(0, t);
12317
12318 if (t === 0) {
12319 do {
12320 e--, r = this.doc.getLine(e);
12321 } while (e > 0 && /^\s*$/.test(r));
12322
12323 t = r.length, /\s+$/.test(r) || (r = "");
12324 }
12325
12326 var s = i.stringReverse(r),
12327 o = this.$shortWordEndIndex(s);
12328 return this.moveCursorTo(e, t - o);
12329 }, this.moveCursorWordRight = function () {
12330 this.session.$selectLongWords ? this.moveCursorLongWordRight() : this.moveCursorShortWordRight();
12331 }, this.moveCursorWordLeft = function () {
12332 this.session.$selectLongWords ? this.moveCursorLongWordLeft() : this.moveCursorShortWordLeft();
12333 }, this.moveCursorBy = function (e, t) {
12334 var n = this.session.documentToScreenPosition(this.lead.row, this.lead.column);
12335 t === 0 && (this.$desiredColumn ? n.column = this.$desiredColumn : this.$desiredColumn = n.column);
12336 var r = this.session.screenToDocumentPosition(n.row + e, n.column);
12337 e !== 0 && t === 0 && r.row === this.lead.row && r.column === this.lead.column && this.session.lineWidgets && this.session.lineWidgets[r.row] && (r.row > 0 || e > 0) && r.row++, this.moveCursorTo(r.row, r.column + t, t === 0);
12338 }, this.moveCursorToPosition = function (e) {
12339 this.moveCursorTo(e.row, e.column);
12340 }, this.moveCursorTo = function (e, t, n) {
12341 var r = this.session.getFoldAt(e, t, 1);
12342 r && (e = r.start.row, t = r.start.column), this.$keepDesiredColumnOnChange = !0, this.lead.setPosition(e, t), this.$keepDesiredColumnOnChange = !1, n || (this.$desiredColumn = null);
12343 }, this.moveCursorToScreen = function (e, t, n) {
12344 var r = this.session.screenToDocumentPosition(e, t);
12345 this.moveCursorTo(r.row, r.column, n);
12346 }, this.detach = function () {
12347 this.lead.detach(), this.anchor.detach(), this.session = this.doc = null;
12348 }, this.fromOrientedRange = function (e) {
12349 this.setSelectionRange(e, e.cursor == e.start), this.$desiredColumn = e.desiredColumn || this.$desiredColumn;
12350 }, this.toOrientedRange = function (e) {
12351 var t = this.getRange();
12352 return e ? (e.start.column = t.start.column, e.start.row = t.start.row, e.end.column = t.end.column, e.end.row = t.end.row) : e = t, e.cursor = this.isBackwards() ? e.start : e.end, e.desiredColumn = this.$desiredColumn, e;
12353 }, this.getRangeOfMovements = function (e) {
12354 var t = this.getCursor();
12355
12356 try {
12357 e(this);
12358 var n = this.getCursor();
12359 return o.fromPoints(t, n);
12360 } catch (r) {
12361 return o.fromPoints(t, t);
12362 } finally {
12363 this.moveCursorToPosition(t);
12364 }
12365 }, this.toJSON = function () {
12366 if (this.rangeCount) var e = this.ranges.map(function (e) {
12367 var t = e.clone();
12368 return t.isBackwards = e.cursor == e.start, t;
12369 });else {
12370 var e = this.getRange();
12371 e.isBackwards = this.isBackwards();
12372 }
12373 return e;
12374 }, this.fromJSON = function (e) {
12375 if (e.start == undefined) {
12376 if (this.rangeList) {
12377 this.toSingleRange(e[0]);
12378
12379 for (var t = e.length; t--;) {
12380 var n = o.fromPoints(e[t].start, e[t].end);
12381 e[t].isBackwards && (n.cursor = n.start), this.addRange(n, !0);
12382 }
12383
12384 return;
12385 }
12386
12387 e = e[0];
12388 }
12389
12390 this.rangeList && this.toSingleRange(e), this.setSelectionRange(e, e.isBackwards);
12391 }, this.isEqual = function (e) {
12392 if ((e.length || this.rangeCount) && e.length != this.rangeCount) return !1;
12393 if (!e.length || !this.ranges) return this.getRange().isEqual(e);
12394
12395 for (var t = this.ranges.length; t--;) {
12396 if (!this.ranges[t].isEqual(e[t])) return !1;
12397 }
12398
12399 return !0;
12400 };
12401 }).call(u.prototype), t.Selection = u;
12402 }), ace.define("ace/tokenizer", ["require", "exports", "module", "ace/config"], function (e, t, n) {
12403 "use strict";
12404
12405 var r = e("./config"),
12406 i = 2e3,
12407 s = function s(e) {
12408 this.states = e, this.regExps = {}, this.matchMappings = {};
12409
12410 for (var t in this.states) {
12411 var n = this.states[t],
12412 r = [],
12413 i = 0,
12414 s = this.matchMappings[t] = {
12415 defaultToken: "text"
12416 },
12417 o = "g",
12418 u = [];
12419
12420 for (var a = 0; a < n.length; a++) {
12421 var f = n[a];
12422 f.defaultToken && (s.defaultToken = f.defaultToken), f.caseInsensitive && (o = "gi");
12423 if (f.regex == null) continue;
12424 f.regex instanceof RegExp && (f.regex = f.regex.toString().slice(1, -1));
12425 var l = f.regex,
12426 c = new RegExp("(?:(" + l + ")|(.))").exec("a").length - 2;
12427 Array.isArray(f.token) ? f.token.length == 1 || c == 1 ? f.token = f.token[0] : c - 1 != f.token.length ? (this.reportError("number of classes and regexp groups doesn't match", {
12428 rule: f,
12429 groupCount: c - 1
12430 }), f.token = f.token[0]) : (f.tokenArray = f.token, f.token = null, f.onMatch = this.$arrayTokens) : typeof f.token == "function" && !f.onMatch && (c > 1 ? f.onMatch = this.$applyToken : f.onMatch = f.token), c > 1 && (/\\\d/.test(f.regex) ? l = f.regex.replace(/\\([0-9]+)/g, function (e, t) {
12431 return "\\" + (parseInt(t, 10) + i + 1);
12432 }) : (c = 1, l = this.removeCapturingGroups(f.regex)), !f.splitRegex && typeof f.token != "string" && u.push(f)), s[i] = a, i += c, r.push(l), f.onMatch || (f.onMatch = null);
12433 }
12434
12435 r.length || (s[0] = 0, r.push("$")), u.forEach(function (e) {
12436 e.splitRegex = this.createSplitterRegexp(e.regex, o);
12437 }, this), this.regExps[t] = new RegExp("(" + r.join(")|(") + ")|($)", o);
12438 }
12439 };
12440
12441 (function () {
12442 this.$setMaxTokenCount = function (e) {
12443 i = e | 0;
12444 }, this.$applyToken = function (e) {
12445 var t = this.splitRegex.exec(e).slice(1),
12446 n = this.token.apply(this, t);
12447 if (typeof n == "string") return [{
12448 type: n,
12449 value: e
12450 }];
12451 var r = [];
12452
12453 for (var i = 0, s = n.length; i < s; i++) {
12454 t[i] && (r[r.length] = {
12455 type: n[i],
12456 value: t[i]
12457 });
12458 }
12459
12460 return r;
12461 }, this.$arrayTokens = function (e) {
12462 if (!e) return [];
12463 var t = this.splitRegex.exec(e);
12464 if (!t) return "text";
12465 var n = [],
12466 r = this.tokenArray;
12467
12468 for (var i = 0, s = r.length; i < s; i++) {
12469 t[i + 1] && (n[n.length] = {
12470 type: r[i],
12471 value: t[i + 1]
12472 });
12473 }
12474
12475 return n;
12476 }, this.removeCapturingGroups = function (e) {
12477 var t = e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, function (e, t) {
12478 return t ? "(?:" : e;
12479 });
12480 return t;
12481 }, this.createSplitterRegexp = function (e, t) {
12482 if (e.indexOf("(?=") != -1) {
12483 var n = 0,
12484 r = !1,
12485 i = {};
12486 e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function (e, t, s, o, u, a) {
12487 return r ? r = u != "]" : u ? r = !0 : o ? (n == i.stack && (i.end = a + 1, i.stack = -1), n--) : s && (n++, s.length != 1 && (i.stack = n, i.start = a)), e;
12488 }), i.end != null && /^\)*$/.test(e.substr(i.end)) && (e = e.substring(0, i.start) + e.substr(i.end));
12489 }
12490
12491 return e.charAt(0) != "^" && (e = "^" + e), e.charAt(e.length - 1) != "$" && (e += "$"), new RegExp(e, (t || "").replace("g", ""));
12492 }, this.getLineTokens = function (e, t) {
12493 if (t && typeof t != "string") {
12494 var n = t.slice(0);
12495 t = n[0], t === "#tmp" && (n.shift(), t = n.shift());
12496 } else var n = [];
12497
12498 var r = t || "start",
12499 s = this.states[r];
12500 s || (r = "start", s = this.states[r]);
12501 var o = this.matchMappings[r],
12502 u = this.regExps[r];
12503 u.lastIndex = 0;
12504 var a,
12505 f = [],
12506 l = 0,
12507 c = 0,
12508 h = {
12509 type: null,
12510 value: ""
12511 };
12512
12513 while (a = u.exec(e)) {
12514 var p = o.defaultToken,
12515 d = null,
12516 v = a[0],
12517 m = u.lastIndex;
12518
12519 if (m - v.length > l) {
12520 var g = e.substring(l, m - v.length);
12521 h.type == p ? h.value += g : (h.type && f.push(h), h = {
12522 type: p,
12523 value: g
12524 });
12525 }
12526
12527 for (var y = 0; y < a.length - 2; y++) {
12528 if (a[y + 1] === undefined) continue;
12529 d = s[o[y]], d.onMatch ? p = d.onMatch(v, r, n, e) : p = d.token, d.next && (typeof d.next == "string" ? r = d.next : r = d.next(r, n), s = this.states[r], s || (this.reportError("state doesn't exist", r), r = "start", s = this.states[r]), o = this.matchMappings[r], l = m, u = this.regExps[r], u.lastIndex = m), d.consumeLineEnd && (l = m);
12530 break;
12531 }
12532
12533 if (v) if (typeof p == "string") !!d && d.merge === !1 || h.type !== p ? (h.type && f.push(h), h = {
12534 type: p,
12535 value: v
12536 }) : h.value += v;else if (p) {
12537 h.type && f.push(h), h = {
12538 type: null,
12539 value: ""
12540 };
12541
12542 for (var y = 0; y < p.length; y++) {
12543 f.push(p[y]);
12544 }
12545 }
12546 if (l == e.length) break;
12547 l = m;
12548
12549 if (c++ > i) {
12550 c > 2 * e.length && this.reportError("infinite loop with in ace tokenizer", {
12551 startState: t,
12552 line: e
12553 });
12554
12555 while (l < e.length) {
12556 h.type && f.push(h), h = {
12557 value: e.substring(l, l += 2e3),
12558 type: "overflow"
12559 };
12560 }
12561
12562 r = "start", n = [];
12563 break;
12564 }
12565 }
12566
12567 return h.type && f.push(h), n.length > 1 && n[0] !== r && n.unshift("#tmp", r), {
12568 tokens: f,
12569 state: n.length ? n : r
12570 };
12571 }, this.reportError = r.reportError;
12572 }).call(s.prototype), t.Tokenizer = s;
12573 }), ace.define("ace/mode/text_highlight_rules", ["require", "exports", "module", "ace/lib/lang"], function (e, t, n) {
12574 "use strict";
12575
12576 var r = e("../lib/lang"),
12577 i = function i() {
12578 this.$rules = {
12579 start: [{
12580 token: "empty_line",
12581 regex: "^$"
12582 }, {
12583 defaultToken: "text"
12584 }]
12585 };
12586 };
12587
12588 (function () {
12589 this.addRules = function (e, t) {
12590 if (!t) {
12591 for (var n in e) {
12592 this.$rules[n] = e[n];
12593 }
12594
12595 return;
12596 }
12597
12598 for (var n in e) {
12599 var r = e[n];
12600
12601 for (var i = 0; i < r.length; i++) {
12602 var s = r[i];
12603 if (s.next || s.onMatch) typeof s.next == "string" && s.next.indexOf(t) !== 0 && (s.next = t + s.next), s.nextState && s.nextState.indexOf(t) !== 0 && (s.nextState = t + s.nextState);
12604 }
12605
12606 this.$rules[t + n] = r;
12607 }
12608 }, this.getRules = function () {
12609 return this.$rules;
12610 }, this.embedRules = function (e, t, n, i, s) {
12611 var o = typeof e == "function" ? new e().getRules() : e;
12612 if (i) for (var u = 0; u < i.length; u++) {
12613 i[u] = t + i[u];
12614 } else {
12615 i = [];
12616
12617 for (var a in o) {
12618 i.push(t + a);
12619 }
12620 }
12621 this.addRules(o, t);
12622
12623 if (n) {
12624 var f = Array.prototype[s ? "push" : "unshift"];
12625
12626 for (var u = 0; u < i.length; u++) {
12627 f.apply(this.$rules[i[u]], r.deepCopy(n));
12628 }
12629 }
12630
12631 this.$embeds || (this.$embeds = []), this.$embeds.push(t);
12632 }, this.getEmbeds = function () {
12633 return this.$embeds;
12634 };
12635
12636 var e = function e(_e, t) {
12637 return (_e != "start" || t.length) && t.unshift(this.nextState, _e), this.nextState;
12638 },
12639 t = function t(e, _t) {
12640 return _t.shift(), _t.shift() || "start";
12641 };
12642
12643 this.normalizeRules = function () {
12644 function i(s) {
12645 var o = r[s];
12646 o.processed = !0;
12647
12648 for (var u = 0; u < o.length; u++) {
12649 var a = o[u],
12650 f = null;
12651 Array.isArray(a) && (f = a, a = {}), !a.regex && a.start && (a.regex = a.start, a.next || (a.next = []), a.next.push({
12652 defaultToken: a.token
12653 }, {
12654 token: a.token + ".end",
12655 regex: a.end || a.start,
12656 next: "pop"
12657 }), a.token = a.token + ".start", a.push = !0);
12658 var l = a.next || a.push;
12659
12660 if (l && Array.isArray(l)) {
12661 var c = a.stateName;
12662 c || (c = a.token, typeof c != "string" && (c = c[0] || ""), r[c] && (c += n++)), r[c] = l, a.next = c, i(c);
12663 } else l == "pop" && (a.next = t);
12664
12665 a.push && (a.nextState = a.next || a.push, a.next = e, delete a.push);
12666 if (a.rules) for (var h in a.rules) {
12667 r[h] ? r[h].push && r[h].push.apply(r[h], a.rules[h]) : r[h] = a.rules[h];
12668 }
12669 var p = typeof a == "string" ? a : a.include;
12670 p && (Array.isArray(p) ? f = p.map(function (e) {
12671 return r[e];
12672 }) : f = r[p]);
12673
12674 if (f) {
12675 var d = [u, 1].concat(f);
12676 a.noEscape && (d = d.filter(function (e) {
12677 return !e.next;
12678 })), o.splice.apply(o, d), u--;
12679 }
12680
12681 a.keywordMap && (a.token = this.createKeywordMapper(a.keywordMap, a.defaultToken || "text", a.caseInsensitive), delete a.defaultToken);
12682 }
12683 }
12684
12685 var n = 0,
12686 r = this.$rules;
12687 Object.keys(r).forEach(i, this);
12688 }, this.createKeywordMapper = function (e, t, n, r) {
12689 var i = Object.create(null);
12690 return Object.keys(e).forEach(function (t) {
12691 var s = e[t];
12692 n && (s = s.toLowerCase());
12693 var o = s.split(r || "|");
12694
12695 for (var u = o.length; u--;) {
12696 i[o[u]] = t;
12697 }
12698 }), Object.getPrototypeOf(i) && (i.__proto__ = null), this.$keywordList = Object.keys(i), e = null, n ? function (e) {
12699 return i[e.toLowerCase()] || t;
12700 } : function (e) {
12701 return i[e] || t;
12702 };
12703 }, this.getKeywords = function () {
12704 return this.$keywords;
12705 };
12706 }).call(i.prototype), t.TextHighlightRules = i;
12707 }), ace.define("ace/mode/behaviour", ["require", "exports", "module"], function (e, t, n) {
12708 "use strict";
12709
12710 var r = function r() {
12711 this.$behaviours = {};
12712 };
12713
12714 (function () {
12715 this.add = function (e, t, n) {
12716 switch (undefined) {
12717 case this.$behaviours:
12718 this.$behaviours = {};
12719
12720 case this.$behaviours[e]:
12721 this.$behaviours[e] = {};
12722 }
12723
12724 this.$behaviours[e][t] = n;
12725 }, this.addBehaviours = function (e) {
12726 for (var t in e) {
12727 for (var n in e[t]) {
12728 this.add(t, n, e[t][n]);
12729 }
12730 }
12731 }, this.remove = function (e) {
12732 this.$behaviours && this.$behaviours[e] && delete this.$behaviours[e];
12733 }, this.inherit = function (e, t) {
12734 if (typeof e == "function") var n = new e().getBehaviours(t);else var n = e.getBehaviours(t);
12735 this.addBehaviours(n);
12736 }, this.getBehaviours = function (e) {
12737 if (!e) return this.$behaviours;
12738 var t = {};
12739
12740 for (var n = 0; n < e.length; n++) {
12741 this.$behaviours[e[n]] && (t[e[n]] = this.$behaviours[e[n]]);
12742 }
12743
12744 return t;
12745 };
12746 }).call(r.prototype), t.Behaviour = r;
12747 }), ace.define("ace/token_iterator", ["require", "exports", "module"], function (e, t, n) {
12748 "use strict";
12749
12750 var r = function r(e, t, n) {
12751 this.$session = e, this.$row = t, this.$rowTokens = e.getTokens(t);
12752 var r = e.getTokenAt(t, n);
12753 this.$tokenIndex = r ? r.index : -1;
12754 };
12755
12756 (function () {
12757 this.stepBackward = function () {
12758 this.$tokenIndex -= 1;
12759
12760 while (this.$tokenIndex < 0) {
12761 this.$row -= 1;
12762 if (this.$row < 0) return this.$row = 0, null;
12763 this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = this.$rowTokens.length - 1;
12764 }
12765
12766 return this.$rowTokens[this.$tokenIndex];
12767 }, this.stepForward = function () {
12768 this.$tokenIndex += 1;
12769 var e;
12770
12771 while (this.$tokenIndex >= this.$rowTokens.length) {
12772 this.$row += 1, e || (e = this.$session.getLength());
12773 if (this.$row >= e) return this.$row = e - 1, null;
12774 this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = 0;
12775 }
12776
12777 return this.$rowTokens[this.$tokenIndex];
12778 }, this.getCurrentToken = function () {
12779 return this.$rowTokens[this.$tokenIndex];
12780 }, this.getCurrentTokenRow = function () {
12781 return this.$row;
12782 }, this.getCurrentTokenColumn = function () {
12783 var e = this.$rowTokens,
12784 t = this.$tokenIndex,
12785 n = e[t].start;
12786 if (n !== undefined) return n;
12787 n = 0;
12788
12789 while (t > 0) {
12790 t -= 1, n += e[t].value.length;
12791 }
12792
12793 return n;
12794 }, this.getCurrentTokenPosition = function () {
12795 return {
12796 row: this.$row,
12797 column: this.getCurrentTokenColumn()
12798 };
12799 };
12800 }).call(r.prototype), t.TokenIterator = r;
12801 }), ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
12802 "use strict";
12803
12804 var r = e("../../lib/oop"),
12805 i = e("../behaviour").Behaviour,
12806 s = e("../../token_iterator").TokenIterator,
12807 o = e("../../lib/lang"),
12808 u = ["text", "paren.rparen", "punctuation.operator"],
12809 a = ["text", "paren.rparen", "punctuation.operator", "comment"],
12810 f,
12811 l = {},
12812 c = {
12813 '"': '"',
12814 "'": "'"
12815 },
12816 h = function h(e) {
12817 var t = -1;
12818 e.multiSelect && (t = e.selection.index, l.rangeCount != e.multiSelect.rangeCount && (l = {
12819 rangeCount: e.multiSelect.rangeCount
12820 }));
12821 if (l[t]) return f = l[t];
12822 f = l[t] = {
12823 autoInsertedBrackets: 0,
12824 autoInsertedRow: -1,
12825 autoInsertedLineEnd: "",
12826 maybeInsertedBrackets: 0,
12827 maybeInsertedRow: -1,
12828 maybeInsertedLineStart: "",
12829 maybeInsertedLineEnd: ""
12830 };
12831 },
12832 p = function p(e, t, n, r) {
12833 var i = e.end.row - e.start.row;
12834 return {
12835 text: n + t + r,
12836 selection: [0, e.start.column + 1, i, e.end.column + (i ? 0 : 1)]
12837 };
12838 },
12839 d = function d(e) {
12840 this.add("braces", "insertion", function (t, n, r, i, s) {
12841 var u = r.getCursorPosition(),
12842 a = i.doc.getLine(u.row);
12843
12844 if (s == "{") {
12845 h(r);
12846 var l = r.getSelectionRange(),
12847 c = i.doc.getTextRange(l);
12848 if (c !== "" && c !== "{" && r.getWrapBehavioursEnabled()) return p(l, c, "{", "}");
12849 if (d.isSaneInsertion(r, i)) return /[\]\}\)]/.test(a[u.column]) || r.inMultiSelectMode || e && e.braces ? (d.recordAutoInsert(r, i, "}"), {
12850 text: "{}",
12851 selection: [1, 1]
12852 }) : (d.recordMaybeInsert(r, i, "{"), {
12853 text: "{",
12854 selection: [1, 1]
12855 });
12856 } else if (s == "}") {
12857 h(r);
12858 var v = a.substring(u.column, u.column + 1);
12859
12860 if (v == "}") {
12861 var m = i.$findOpeningBracket("}", {
12862 column: u.column + 1,
12863 row: u.row
12864 });
12865 if (m !== null && d.isAutoInsertedClosing(u, a, s)) return d.popAutoInsertedClosing(), {
12866 text: "",
12867 selection: [1, 1]
12868 };
12869 }
12870 } else {
12871 if (s == "\n" || s == "\r\n") {
12872 h(r);
12873 var g = "";
12874 d.isMaybeInsertedClosing(u, a) && (g = o.stringRepeat("}", f.maybeInsertedBrackets), d.clearMaybeInsertedClosing());
12875 var v = a.substring(u.column, u.column + 1);
12876
12877 if (v === "}") {
12878 var y = i.findMatchingBracket({
12879 row: u.row,
12880 column: u.column + 1
12881 }, "}");
12882 if (!y) return null;
12883 var b = this.$getIndent(i.getLine(y.row));
12884 } else {
12885 if (!g) {
12886 d.clearMaybeInsertedClosing();
12887 return;
12888 }
12889
12890 var b = this.$getIndent(a);
12891 }
12892
12893 var w = b + i.getTabString();
12894 return {
12895 text: "\n" + w + "\n" + b + g,
12896 selection: [1, w.length, 1, w.length]
12897 };
12898 }
12899
12900 d.clearMaybeInsertedClosing();
12901 }
12902 }), this.add("braces", "deletion", function (e, t, n, r, i) {
12903 var s = r.doc.getTextRange(i);
12904
12905 if (!i.isMultiLine() && s == "{") {
12906 h(n);
12907 var o = r.doc.getLine(i.start.row),
12908 u = o.substring(i.end.column, i.end.column + 1);
12909 if (u == "}") return i.end.column++, i;
12910 f.maybeInsertedBrackets--;
12911 }
12912 }), this.add("parens", "insertion", function (e, t, n, r, i) {
12913 if (i == "(") {
12914 h(n);
12915 var s = n.getSelectionRange(),
12916 o = r.doc.getTextRange(s);
12917 if (o !== "" && n.getWrapBehavioursEnabled()) return p(s, o, "(", ")");
12918 if (d.isSaneInsertion(n, r)) return d.recordAutoInsert(n, r, ")"), {
12919 text: "()",
12920 selection: [1, 1]
12921 };
12922 } else if (i == ")") {
12923 h(n);
12924 var u = n.getCursorPosition(),
12925 a = r.doc.getLine(u.row),
12926 f = a.substring(u.column, u.column + 1);
12927
12928 if (f == ")") {
12929 var l = r.$findOpeningBracket(")", {
12930 column: u.column + 1,
12931 row: u.row
12932 });
12933 if (l !== null && d.isAutoInsertedClosing(u, a, i)) return d.popAutoInsertedClosing(), {
12934 text: "",
12935 selection: [1, 1]
12936 };
12937 }
12938 }
12939 }), this.add("parens", "deletion", function (e, t, n, r, i) {
12940 var s = r.doc.getTextRange(i);
12941
12942 if (!i.isMultiLine() && s == "(") {
12943 h(n);
12944 var o = r.doc.getLine(i.start.row),
12945 u = o.substring(i.start.column + 1, i.start.column + 2);
12946 if (u == ")") return i.end.column++, i;
12947 }
12948 }), this.add("brackets", "insertion", function (e, t, n, r, i) {
12949 if (i == "[") {
12950 h(n);
12951 var s = n.getSelectionRange(),
12952 o = r.doc.getTextRange(s);
12953 if (o !== "" && n.getWrapBehavioursEnabled()) return p(s, o, "[", "]");
12954 if (d.isSaneInsertion(n, r)) return d.recordAutoInsert(n, r, "]"), {
12955 text: "[]",
12956 selection: [1, 1]
12957 };
12958 } else if (i == "]") {
12959 h(n);
12960 var u = n.getCursorPosition(),
12961 a = r.doc.getLine(u.row),
12962 f = a.substring(u.column, u.column + 1);
12963
12964 if (f == "]") {
12965 var l = r.$findOpeningBracket("]", {
12966 column: u.column + 1,
12967 row: u.row
12968 });
12969 if (l !== null && d.isAutoInsertedClosing(u, a, i)) return d.popAutoInsertedClosing(), {
12970 text: "",
12971 selection: [1, 1]
12972 };
12973 }
12974 }
12975 }), this.add("brackets", "deletion", function (e, t, n, r, i) {
12976 var s = r.doc.getTextRange(i);
12977
12978 if (!i.isMultiLine() && s == "[") {
12979 h(n);
12980 var o = r.doc.getLine(i.start.row),
12981 u = o.substring(i.start.column + 1, i.start.column + 2);
12982 if (u == "]") return i.end.column++, i;
12983 }
12984 }), this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
12985 var s = r.$mode.$quotes || c;
12986
12987 if (i.length == 1 && s[i]) {
12988 if (this.lineCommentStart && this.lineCommentStart.indexOf(i) != -1) return;
12989 h(n);
12990 var o = i,
12991 u = n.getSelectionRange(),
12992 a = r.doc.getTextRange(u);
12993 if (a !== "" && (a.length != 1 || !s[a]) && n.getWrapBehavioursEnabled()) return p(u, a, o, o);
12994
12995 if (!a) {
12996 var f = n.getCursorPosition(),
12997 l = r.doc.getLine(f.row),
12998 d = l.substring(f.column - 1, f.column),
12999 v = l.substring(f.column, f.column + 1),
13000 m = r.getTokenAt(f.row, f.column),
13001 g = r.getTokenAt(f.row, f.column + 1);
13002 if (d == "\\" && m && /escape/.test(m.type)) return null;
13003 var y = m && /string|escape/.test(m.type),
13004 b = !g || /string|escape/.test(g.type),
13005 w;
13006 if (v == o) w = y !== b, w && /string\.end/.test(g.type) && (w = !1);else {
13007 if (y && !b) return null;
13008 if (y && b) return null;
13009 var E = r.$mode.tokenRe;
13010 E.lastIndex = 0;
13011 var S = E.test(d);
13012 E.lastIndex = 0;
13013 var x = E.test(d);
13014 if (S || x) return null;
13015 if (v && !/[\s;,.})\]\\]/.test(v)) return null;
13016 w = !0;
13017 }
13018 return {
13019 text: w ? o + o : "",
13020 selection: [1, 1]
13021 };
13022 }
13023 }
13024 }), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
13025 var s = r.doc.getTextRange(i);
13026
13027 if (!i.isMultiLine() && (s == '"' || s == "'")) {
13028 h(n);
13029 var o = r.doc.getLine(i.start.row),
13030 u = o.substring(i.start.column + 1, i.start.column + 2);
13031 if (u == s) return i.end.column++, i;
13032 }
13033 });
13034 };
13035
13036 d.isSaneInsertion = function (e, t) {
13037 var n = e.getCursorPosition(),
13038 r = new s(t, n.row, n.column);
13039
13040 if (!this.$matchTokenType(r.getCurrentToken() || "text", u)) {
13041 var i = new s(t, n.row, n.column + 1);
13042 if (!this.$matchTokenType(i.getCurrentToken() || "text", u)) return !1;
13043 }
13044
13045 return r.stepForward(), r.getCurrentTokenRow() !== n.row || this.$matchTokenType(r.getCurrentToken() || "text", a);
13046 }, d.$matchTokenType = function (e, t) {
13047 return t.indexOf(e.type || e) > -1;
13048 }, d.recordAutoInsert = function (e, t, n) {
13049 var r = e.getCursorPosition(),
13050 i = t.doc.getLine(r.row);
13051 this.isAutoInsertedClosing(r, i, f.autoInsertedLineEnd[0]) || (f.autoInsertedBrackets = 0), f.autoInsertedRow = r.row, f.autoInsertedLineEnd = n + i.substr(r.column), f.autoInsertedBrackets++;
13052 }, d.recordMaybeInsert = function (e, t, n) {
13053 var r = e.getCursorPosition(),
13054 i = t.doc.getLine(r.row);
13055 this.isMaybeInsertedClosing(r, i) || (f.maybeInsertedBrackets = 0), f.maybeInsertedRow = r.row, f.maybeInsertedLineStart = i.substr(0, r.column) + n, f.maybeInsertedLineEnd = i.substr(r.column), f.maybeInsertedBrackets++;
13056 }, d.isAutoInsertedClosing = function (e, t, n) {
13057 return f.autoInsertedBrackets > 0 && e.row === f.autoInsertedRow && n === f.autoInsertedLineEnd[0] && t.substr(e.column) === f.autoInsertedLineEnd;
13058 }, d.isMaybeInsertedClosing = function (e, t) {
13059 return f.maybeInsertedBrackets > 0 && e.row === f.maybeInsertedRow && t.substr(e.column) === f.maybeInsertedLineEnd && t.substr(0, e.column) == f.maybeInsertedLineStart;
13060 }, d.popAutoInsertedClosing = function () {
13061 f.autoInsertedLineEnd = f.autoInsertedLineEnd.substr(1), f.autoInsertedBrackets--;
13062 }, d.clearMaybeInsertedClosing = function () {
13063 f && (f.maybeInsertedBrackets = 0, f.maybeInsertedRow = -1);
13064 }, r.inherits(d, i), t.CstyleBehaviour = d;
13065 }), ace.define("ace/unicode", ["require", "exports", "module"], function (e, t, n) {
13066 "use strict";
13067
13068 function r(e) {
13069 var n = /\w{4}/g;
13070
13071 for (var r in e) {
13072 t.packages[r] = e[r].replace(n, "\\u$&");
13073 }
13074 }
13075
13076 t.packages = {}, r({
13077 L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
13078 Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",
13079 Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",
13080 Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
13081 Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",
13082 Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
13083 M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",
13084 Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",
13085 Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",
13086 Me: "0488048906DE20DD-20E020E2-20E4A670-A672",
13087 N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
13088 Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
13089 Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
13090 No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",
13091 P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",
13092 Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",
13093 Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
13094 Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
13095 Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
13096 Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
13097 Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
13098 Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",
13099 S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",
13100 Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",
13101 Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
13102 Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",
13103 So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",
13104 Z: "002000A01680180E2000-200A20282029202F205F3000",
13105 Zs: "002000A01680180E2000-200A202F205F3000",
13106 Zl: "2028",
13107 Zp: "2029",
13108 C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",
13109 Cc: "0000-001F007F-009F",
13110 Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
13111 Co: "E000-F8FF",
13112 Cs: "D800-DFFF",
13113 Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"
13114 });
13115 }), ace.define("ace/mode/text", ["require", "exports", "module", "ace/tokenizer", "ace/mode/text_highlight_rules", "ace/mode/behaviour/cstyle", "ace/unicode", "ace/lib/lang", "ace/token_iterator", "ace/range"], function (e, t, n) {
13116 "use strict";
13117
13118 var r = e("../tokenizer").Tokenizer,
13119 i = e("./text_highlight_rules").TextHighlightRules,
13120 s = e("./behaviour/cstyle").CstyleBehaviour,
13121 o = e("../unicode"),
13122 u = e("../lib/lang"),
13123 a = e("../token_iterator").TokenIterator,
13124 f = e("../range").Range,
13125 l = function l() {
13126 this.HighlightRules = i;
13127 };
13128
13129 (function () {
13130 this.$defaultBehaviour = new s(), this.tokenRe = new RegExp("^[" + o.packages.L + o.packages.Mn + o.packages.Mc + o.packages.Nd + o.packages.Pc + "\\$_]+", "g"), this.nonTokenRe = new RegExp("^(?:[^" + o.packages.L + o.packages.Mn + o.packages.Mc + o.packages.Nd + o.packages.Pc + "\\$_]|\\s])+", "g"), this.getTokenizer = function () {
13131 return this.$tokenizer || (this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig), this.$tokenizer = new r(this.$highlightRules.getRules())), this.$tokenizer;
13132 }, this.lineCommentStart = "", this.blockComment = "", this.toggleCommentLines = function (e, t, n, r) {
13133 function w(e) {
13134 for (var t = n; t <= r; t++) {
13135 e(i.getLine(t), t);
13136 }
13137 }
13138
13139 var i = t.doc,
13140 s = !0,
13141 o = !0,
13142 a = Infinity,
13143 f = t.getTabSize(),
13144 l = !1;
13145
13146 if (!this.lineCommentStart) {
13147 if (!this.blockComment) return !1;
13148
13149 var c = this.blockComment.start,
13150 h = this.blockComment.end,
13151 p = new RegExp("^(\\s*)(?:" + u.escapeRegExp(c) + ")"),
13152 d = new RegExp("(?:" + u.escapeRegExp(h) + ")\\s*$"),
13153 v = function v(e, t) {
13154 if (g(e, t)) return;
13155 if (!s || /\S/.test(e)) i.insertInLine({
13156 row: t,
13157 column: e.length
13158 }, h), i.insertInLine({
13159 row: t,
13160 column: a
13161 }, c);
13162 },
13163 m = function m(e, t) {
13164 var n;
13165 (n = e.match(d)) && i.removeInLine(t, e.length - n[0].length, e.length), (n = e.match(p)) && i.removeInLine(t, n[1].length, n[0].length);
13166 },
13167 g = function g(e, n) {
13168 if (p.test(e)) return !0;
13169 var r = t.getTokens(n);
13170
13171 for (var i = 0; i < r.length; i++) {
13172 if (r[i].type === "comment") return !0;
13173 }
13174 };
13175 } else {
13176 if (Array.isArray(this.lineCommentStart)) var p = this.lineCommentStart.map(u.escapeRegExp).join("|"),
13177 c = this.lineCommentStart[0];else var p = u.escapeRegExp(this.lineCommentStart),
13178 c = this.lineCommentStart;
13179 p = new RegExp("^(\\s*)(?:" + p + ") ?"), l = t.getUseSoftTabs();
13180
13181 var m = function m(e, t) {
13182 var n = e.match(p);
13183 if (!n) return;
13184 var r = n[1].length,
13185 s = n[0].length;
13186 !b(e, r, s) && n[0][s - 1] == " " && s--, i.removeInLine(t, r, s);
13187 },
13188 y = c + " ",
13189 v = function v(e, t) {
13190 if (!s || /\S/.test(e)) b(e, a, a) ? i.insertInLine({
13191 row: t,
13192 column: a
13193 }, y) : i.insertInLine({
13194 row: t,
13195 column: a
13196 }, c);
13197 },
13198 g = function g(e, t) {
13199 return p.test(e);
13200 },
13201 b = function b(e, t, n) {
13202 var r = 0;
13203
13204 while (t-- && e.charAt(t) == " ") {
13205 r++;
13206 }
13207
13208 if (r % f != 0) return !1;
13209 var r = 0;
13210
13211 while (e.charAt(n++) == " ") {
13212 r++;
13213 }
13214
13215 return f > 2 ? r % f != f - 1 : r % f == 0;
13216 };
13217 }
13218
13219 var E = Infinity;
13220 w(function (e, t) {
13221 var n = e.search(/\S/);
13222 n !== -1 ? (n < a && (a = n), o && !g(e, t) && (o = !1)) : E > e.length && (E = e.length);
13223 }), a == Infinity && (a = E, s = !1, o = !1), l && a % f != 0 && (a = Math.floor(a / f) * f), w(o ? m : v);
13224 }, this.toggleBlockComment = function (e, t, n, r) {
13225 var i = this.blockComment;
13226 if (!i) return;
13227 !i.start && i[0] && (i = i[0]);
13228 var s = new a(t, r.row, r.column),
13229 o = s.getCurrentToken(),
13230 u = t.selection,
13231 l = t.selection.toOrientedRange(),
13232 c,
13233 h;
13234
13235 if (o && /comment/.test(o.type)) {
13236 var p, d;
13237
13238 while (o && /comment/.test(o.type)) {
13239 var v = o.value.indexOf(i.start);
13240
13241 if (v != -1) {
13242 var m = s.getCurrentTokenRow(),
13243 g = s.getCurrentTokenColumn() + v;
13244 p = new f(m, g, m, g + i.start.length);
13245 break;
13246 }
13247
13248 o = s.stepBackward();
13249 }
13250
13251 var s = new a(t, r.row, r.column),
13252 o = s.getCurrentToken();
13253
13254 while (o && /comment/.test(o.type)) {
13255 var v = o.value.indexOf(i.end);
13256
13257 if (v != -1) {
13258 var m = s.getCurrentTokenRow(),
13259 g = s.getCurrentTokenColumn() + v;
13260 d = new f(m, g, m, g + i.end.length);
13261 break;
13262 }
13263
13264 o = s.stepForward();
13265 }
13266
13267 d && t.remove(d), p && (t.remove(p), c = p.start.row, h = -i.start.length);
13268 } else h = i.start.length, c = n.start.row, t.insert(n.end, i.end), t.insert(n.start, i.start);
13269
13270 l.start.row == c && (l.start.column += h), l.end.row == c && (l.end.column += h), t.selection.fromOrientedRange(l);
13271 }, this.getNextLineIndent = function (e, t, n) {
13272 return this.$getIndent(t);
13273 }, this.checkOutdent = function (e, t, n) {
13274 return !1;
13275 }, this.autoOutdent = function (e, t, n) {}, this.$getIndent = function (e) {
13276 return e.match(/^\s*/)[0];
13277 }, this.createWorker = function (e) {
13278 return null;
13279 }, this.createModeDelegates = function (e) {
13280 this.$embeds = [], this.$modes = {};
13281
13282 for (var t in e) {
13283 e[t] && (this.$embeds.push(t), this.$modes[t] = new e[t]());
13284 }
13285
13286 var n = ["toggleBlockComment", "toggleCommentLines", "getNextLineIndent", "checkOutdent", "autoOutdent", "transformAction", "getCompletions"];
13287
13288 for (var t = 0; t < n.length; t++) {
13289 (function (e) {
13290 var r = n[t],
13291 i = e[r];
13292
13293 e[n[t]] = function () {
13294 return this.$delegator(r, arguments, i);
13295 };
13296 })(this);
13297 }
13298 }, this.$delegator = function (e, t, n) {
13299 var r = t[0];
13300 typeof r != "string" && (r = r[0]);
13301
13302 for (var i = 0; i < this.$embeds.length; i++) {
13303 if (!this.$modes[this.$embeds[i]]) continue;
13304 var s = r.split(this.$embeds[i]);
13305
13306 if (!s[0] && s[1]) {
13307 t[0] = s[1];
13308 var o = this.$modes[this.$embeds[i]];
13309 return o[e].apply(o, t);
13310 }
13311 }
13312
13313 var u = n.apply(this, t);
13314 return n ? u : undefined;
13315 }, this.transformAction = function (e, t, n, r, i) {
13316 if (this.$behaviour) {
13317 var s = this.$behaviour.getBehaviours();
13318
13319 for (var o in s) {
13320 if (s[o][t]) {
13321 var u = s[o][t].apply(this, arguments);
13322 if (u) return u;
13323 }
13324 }
13325 }
13326 }, this.getKeywords = function (e) {
13327 if (!this.completionKeywords) {
13328 var t = this.$tokenizer.rules,
13329 n = [];
13330
13331 for (var r in t) {
13332 var i = t[r];
13333
13334 for (var s = 0, o = i.length; s < o; s++) {
13335 if (typeof i[s].token == "string") /keyword|support|storage/.test(i[s].token) && n.push(i[s].regex);else if (_typeof(i[s].token) == "object") for (var u = 0, a = i[s].token.length; u < a; u++) {
13336 if (/keyword|support|storage/.test(i[s].token[u])) {
13337 var r = i[s].regex.match(/\(.+?\)/g)[u];
13338 n.push(r.substr(1, r.length - 2));
13339 }
13340 }
13341 }
13342 }
13343
13344 this.completionKeywords = n;
13345 }
13346
13347 return e ? n.concat(this.$keywordList || []) : this.$keywordList;
13348 }, this.$createKeywordList = function () {
13349 return this.$highlightRules || this.getTokenizer(), this.$keywordList = this.$highlightRules.$keywordList || [];
13350 }, this.getCompletions = function (e, t, n, r) {
13351 var i = this.$keywordList || this.$createKeywordList();
13352 return i.map(function (e) {
13353 return {
13354 name: e,
13355 value: e,
13356 score: 0,
13357 meta: "keyword"
13358 };
13359 });
13360 }, this.$id = "ace/mode/text";
13361 }).call(l.prototype), t.Mode = l;
13362 }), ace.define("ace/apply_delta", ["require", "exports", "module"], function (e, t, n) {
13363 "use strict";
13364
13365 function r(e, t) {
13366 throw console.log("Invalid Delta:", e), "Invalid Delta: " + t;
13367 }
13368
13369 function i(e, t) {
13370 return t.row >= 0 && t.row < e.length && t.column >= 0 && t.column <= e[t.row].length;
13371 }
13372
13373 function s(e, t) {
13374 t.action != "insert" && t.action != "remove" && r(t, "delta.action must be 'insert' or 'remove'"), t.lines instanceof Array || r(t, "delta.lines must be an Array"), (!t.start || !t.end) && r(t, "delta.start/end must be an present");
13375 var n = t.start;
13376 i(e, t.start) || r(t, "delta.start must be contained in document");
13377 var s = t.end;
13378 t.action == "remove" && !i(e, s) && r(t, "delta.end must contained in document for 'remove' actions");
13379 var o = s.row - n.row,
13380 u = s.column - (o == 0 ? n.column : 0);
13381 (o != t.lines.length - 1 || t.lines[o].length != u) && r(t, "delta.range must match delta lines");
13382 }
13383
13384 t.applyDelta = function (e, t, n) {
13385 var r = t.start.row,
13386 i = t.start.column,
13387 s = e[r] || "";
13388
13389 switch (t.action) {
13390 case "insert":
13391 var o = t.lines;
13392 if (o.length === 1) e[r] = s.substring(0, i) + t.lines[0] + s.substring(i);else {
13393 var u = [r, 1].concat(t.lines);
13394 e.splice.apply(e, u), e[r] = s.substring(0, i) + e[r], e[r + t.lines.length - 1] += s.substring(i);
13395 }
13396 break;
13397
13398 case "remove":
13399 var a = t.end.column,
13400 f = t.end.row;
13401 r === f ? e[r] = s.substring(0, i) + s.substring(a) : e.splice(r, f - r + 1, s.substring(0, i) + e[f].substring(a));
13402 }
13403 };
13404 }), ace.define("ace/anchor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function (e, t, n) {
13405 "use strict";
13406
13407 var r = e("./lib/oop"),
13408 i = e("./lib/event_emitter").EventEmitter,
13409 s = t.Anchor = function (e, t, n) {
13410 this.$onChange = this.onChange.bind(this), this.attach(e), typeof n == "undefined" ? this.setPosition(t.row, t.column) : this.setPosition(t, n);
13411 };
13412
13413 (function () {
13414 function e(e, t, n) {
13415 var r = n ? e.column <= t.column : e.column < t.column;
13416 return e.row < t.row || e.row == t.row && r;
13417 }
13418
13419 function t(t, n, r) {
13420 var i = t.action == "insert",
13421 s = (i ? 1 : -1) * (t.end.row - t.start.row),
13422 o = (i ? 1 : -1) * (t.end.column - t.start.column),
13423 u = t.start,
13424 a = i ? u : t.end;
13425 return e(n, u, r) ? {
13426 row: n.row,
13427 column: n.column
13428 } : e(a, n, !r) ? {
13429 row: n.row + s,
13430 column: n.column + (n.row == a.row ? o : 0)
13431 } : {
13432 row: u.row,
13433 column: u.column
13434 };
13435 }
13436
13437 r.implement(this, i), this.getPosition = function () {
13438 return this.$clipPositionToDocument(this.row, this.column);
13439 }, this.getDocument = function () {
13440 return this.document;
13441 }, this.$insertRight = !1, this.onChange = function (e) {
13442 if (e.start.row == e.end.row && e.start.row != this.row) return;
13443 if (e.start.row > this.row) return;
13444 var n = t(e, {
13445 row: this.row,
13446 column: this.column
13447 }, this.$insertRight);
13448 this.setPosition(n.row, n.column, !0);
13449 }, this.setPosition = function (e, t, n) {
13450 var r;
13451 n ? r = {
13452 row: e,
13453 column: t
13454 } : r = this.$clipPositionToDocument(e, t);
13455 if (this.row == r.row && this.column == r.column) return;
13456 var i = {
13457 row: this.row,
13458 column: this.column
13459 };
13460 this.row = r.row, this.column = r.column, this._signal("change", {
13461 old: i,
13462 value: r
13463 });
13464 }, this.detach = function () {
13465 this.document.removeEventListener("change", this.$onChange);
13466 }, this.attach = function (e) {
13467 this.document = e || this.document, this.document.on("change", this.$onChange);
13468 }, this.$clipPositionToDocument = function (e, t) {
13469 var n = {};
13470 return e >= this.document.getLength() ? (n.row = Math.max(0, this.document.getLength() - 1), n.column = this.document.getLine(n.row).length) : e < 0 ? (n.row = 0, n.column = 0) : (n.row = e, n.column = Math.min(this.document.getLine(n.row).length, Math.max(0, t))), t < 0 && (n.column = 0), n;
13471 };
13472 }).call(s.prototype);
13473 }), ace.define("ace/document", ["require", "exports", "module", "ace/lib/oop", "ace/apply_delta", "ace/lib/event_emitter", "ace/range", "ace/anchor"], function (e, t, n) {
13474 "use strict";
13475
13476 var r = e("./lib/oop"),
13477 i = e("./apply_delta").applyDelta,
13478 s = e("./lib/event_emitter").EventEmitter,
13479 o = e("./range").Range,
13480 u = e("./anchor").Anchor,
13481 a = function a(e) {
13482 this.$lines = [""], e.length === 0 ? this.$lines = [""] : Array.isArray(e) ? this.insertMergedLines({
13483 row: 0,
13484 column: 0
13485 }, e) : this.insert({
13486 row: 0,
13487 column: 0
13488 }, e);
13489 };
13490
13491 (function () {
13492 r.implement(this, s), this.setValue = function (e) {
13493 var t = this.getLength() - 1;
13494 this.remove(new o(0, 0, t, this.getLine(t).length)), this.insert({
13495 row: 0,
13496 column: 0
13497 }, e);
13498 }, this.getValue = function () {
13499 return this.getAllLines().join(this.getNewLineCharacter());
13500 }, this.createAnchor = function (e, t) {
13501 return new u(this, e, t);
13502 }, "aaa".split(/a/).length === 0 ? this.$split = function (e) {
13503 return e.replace(/\r\n|\r/g, "\n").split("\n");
13504 } : this.$split = function (e) {
13505 return e.split(/\r\n|\r|\n/);
13506 }, this.$detectNewLine = function (e) {
13507 var t = e.match(/^.*?(\r\n|\r|\n)/m);
13508 this.$autoNewLine = t ? t[1] : "\n", this._signal("changeNewLineMode");
13509 }, this.getNewLineCharacter = function () {
13510 switch (this.$newLineMode) {
13511 case "windows":
13512 return "\r\n";
13513
13514 case "unix":
13515 return "\n";
13516
13517 default:
13518 return this.$autoNewLine || "\n";
13519 }
13520 }, this.$autoNewLine = "", this.$newLineMode = "auto", this.setNewLineMode = function (e) {
13521 if (this.$newLineMode === e) return;
13522 this.$newLineMode = e, this._signal("changeNewLineMode");
13523 }, this.getNewLineMode = function () {
13524 return this.$newLineMode;
13525 }, this.isNewLine = function (e) {
13526 return e == "\r\n" || e == "\r" || e == "\n";
13527 }, this.getLine = function (e) {
13528 return this.$lines[e] || "";
13529 }, this.getLines = function (e, t) {
13530 return this.$lines.slice(e, t + 1);
13531 }, this.getAllLines = function () {
13532 return this.getLines(0, this.getLength());
13533 }, this.getLength = function () {
13534 return this.$lines.length;
13535 }, this.getTextRange = function (e) {
13536 return this.getLinesForRange(e).join(this.getNewLineCharacter());
13537 }, this.getLinesForRange = function (e) {
13538 var t;
13539 if (e.start.row === e.end.row) t = [this.getLine(e.start.row).substring(e.start.column, e.end.column)];else {
13540 t = this.getLines(e.start.row, e.end.row), t[0] = (t[0] || "").substring(e.start.column);
13541 var n = t.length - 1;
13542 e.end.row - e.start.row == n && (t[n] = t[n].substring(0, e.end.column));
13543 }
13544 return t;
13545 }, this.insertLines = function (e, t) {
13546 return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."), this.insertFullLines(e, t);
13547 }, this.removeLines = function (e, t) {
13548 return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."), this.removeFullLines(e, t);
13549 }, this.insertNewLine = function (e) {
13550 return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."), this.insertMergedLines(e, ["", ""]);
13551 }, this.insert = function (e, t) {
13552 return this.getLength() <= 1 && this.$detectNewLine(t), this.insertMergedLines(e, this.$split(t));
13553 }, this.insertInLine = function (e, t) {
13554 var n = this.clippedPos(e.row, e.column),
13555 r = this.pos(e.row, e.column + t.length);
13556 return this.applyDelta({
13557 start: n,
13558 end: r,
13559 action: "insert",
13560 lines: [t]
13561 }, !0), this.clonePos(r);
13562 }, this.clippedPos = function (e, t) {
13563 var n = this.getLength();
13564 e === undefined ? e = n : e < 0 ? e = 0 : e >= n && (e = n - 1, t = undefined);
13565 var r = this.getLine(e);
13566 return t == undefined && (t = r.length), t = Math.min(Math.max(t, 0), r.length), {
13567 row: e,
13568 column: t
13569 };
13570 }, this.clonePos = function (e) {
13571 return {
13572 row: e.row,
13573 column: e.column
13574 };
13575 }, this.pos = function (e, t) {
13576 return {
13577 row: e,
13578 column: t
13579 };
13580 }, this.$clipPosition = function (e) {
13581 var t = this.getLength();
13582 return e.row >= t ? (e.row = Math.max(0, t - 1), e.column = this.getLine(t - 1).length) : (e.row = Math.max(0, e.row), e.column = Math.min(Math.max(e.column, 0), this.getLine(e.row).length)), e;
13583 }, this.insertFullLines = function (e, t) {
13584 e = Math.min(Math.max(e, 0), this.getLength());
13585 var n = 0;
13586 e < this.getLength() ? (t = t.concat([""]), n = 0) : (t = [""].concat(t), e--, n = this.$lines[e].length), this.insertMergedLines({
13587 row: e,
13588 column: n
13589 }, t);
13590 }, this.insertMergedLines = function (e, t) {
13591 var n = this.clippedPos(e.row, e.column),
13592 r = {
13593 row: n.row + t.length - 1,
13594 column: (t.length == 1 ? n.column : 0) + t[t.length - 1].length
13595 };
13596 return this.applyDelta({
13597 start: n,
13598 end: r,
13599 action: "insert",
13600 lines: t
13601 }), this.clonePos(r);
13602 }, this.remove = function (e) {
13603 var t = this.clippedPos(e.start.row, e.start.column),
13604 n = this.clippedPos(e.end.row, e.end.column);
13605 return this.applyDelta({
13606 start: t,
13607 end: n,
13608 action: "remove",
13609 lines: this.getLinesForRange({
13610 start: t,
13611 end: n
13612 })
13613 }), this.clonePos(t);
13614 }, this.removeInLine = function (e, t, n) {
13615 var r = this.clippedPos(e, t),
13616 i = this.clippedPos(e, n);
13617 return this.applyDelta({
13618 start: r,
13619 end: i,
13620 action: "remove",
13621 lines: this.getLinesForRange({
13622 start: r,
13623 end: i
13624 })
13625 }, !0), this.clonePos(r);
13626 }, this.removeFullLines = function (e, t) {
13627 e = Math.min(Math.max(0, e), this.getLength() - 1), t = Math.min(Math.max(0, t), this.getLength() - 1);
13628 var n = t == this.getLength() - 1 && e > 0,
13629 r = t < this.getLength() - 1,
13630 i = n ? e - 1 : e,
13631 s = n ? this.getLine(i).length : 0,
13632 u = r ? t + 1 : t,
13633 a = r ? 0 : this.getLine(u).length,
13634 f = new o(i, s, u, a),
13635 l = this.$lines.slice(e, t + 1);
13636 return this.applyDelta({
13637 start: f.start,
13638 end: f.end,
13639 action: "remove",
13640 lines: this.getLinesForRange(f)
13641 }), l;
13642 }, this.removeNewLine = function (e) {
13643 e < this.getLength() - 1 && e >= 0 && this.applyDelta({
13644 start: this.pos(e, this.getLine(e).length),
13645 end: this.pos(e + 1, 0),
13646 action: "remove",
13647 lines: ["", ""]
13648 });
13649 }, this.replace = function (e, t) {
13650 e instanceof o || (e = o.fromPoints(e.start, e.end));
13651 if (t.length === 0 && e.isEmpty()) return e.start;
13652 if (t == this.getTextRange(e)) return e.end;
13653 this.remove(e);
13654 var n;
13655 return t ? n = this.insert(e.start, t) : n = e.start, n;
13656 }, this.applyDeltas = function (e) {
13657 for (var t = 0; t < e.length; t++) {
13658 this.applyDelta(e[t]);
13659 }
13660 }, this.revertDeltas = function (e) {
13661 for (var t = e.length - 1; t >= 0; t--) {
13662 this.revertDelta(e[t]);
13663 }
13664 }, this.applyDelta = function (e, t) {
13665 var n = e.action == "insert";
13666 if (n ? e.lines.length <= 1 && !e.lines[0] : !o.comparePoints(e.start, e.end)) return;
13667 n && e.lines.length > 2e4 && this.$splitAndapplyLargeDelta(e, 2e4), i(this.$lines, e, t), this._signal("change", e);
13668 }, this.$splitAndapplyLargeDelta = function (e, t) {
13669 var n = e.lines,
13670 r = n.length,
13671 i = e.start.row,
13672 s = e.start.column,
13673 o = 0,
13674 u = 0;
13675
13676 do {
13677 o = u, u += t - 1;
13678 var a = n.slice(o, u);
13679
13680 if (u > r) {
13681 e.lines = a, e.start.row = i + o, e.start.column = s;
13682 break;
13683 }
13684
13685 a.push(""), this.applyDelta({
13686 start: this.pos(i + o, s),
13687 end: this.pos(i + u, s = 0),
13688 action: e.action,
13689 lines: a
13690 }, !0);
13691 } while (!0);
13692 }, this.revertDelta = function (e) {
13693 this.applyDelta({
13694 start: this.clonePos(e.start),
13695 end: this.clonePos(e.end),
13696 action: e.action == "insert" ? "remove" : "insert",
13697 lines: e.lines.slice()
13698 });
13699 }, this.indexToPosition = function (e, t) {
13700 var n = this.$lines || this.getAllLines(),
13701 r = this.getNewLineCharacter().length;
13702
13703 for (var i = t || 0, s = n.length; i < s; i++) {
13704 e -= n[i].length + r;
13705 if (e < 0) return {
13706 row: i,
13707 column: e + n[i].length + r
13708 };
13709 }
13710
13711 return {
13712 row: s - 1,
13713 column: n[s - 1].length
13714 };
13715 }, this.positionToIndex = function (e, t) {
13716 var n = this.$lines || this.getAllLines(),
13717 r = this.getNewLineCharacter().length,
13718 i = 0,
13719 s = Math.min(e.row, n.length);
13720
13721 for (var o = t || 0; o < s; ++o) {
13722 i += n[o].length + r;
13723 }
13724
13725 return i + e.column;
13726 };
13727 }).call(a.prototype), t.Document = a;
13728 }), ace.define("ace/background_tokenizer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function (e, t, n) {
13729 "use strict";
13730
13731 var r = e("./lib/oop"),
13732 i = e("./lib/event_emitter").EventEmitter,
13733 s = function s(e, t) {
13734 this.running = !1, this.lines = [], this.states = [], this.currentLine = 0, this.tokenizer = e;
13735 var n = this;
13736
13737 this.$worker = function () {
13738 if (!n.running) return;
13739 var e = new Date(),
13740 t = n.currentLine,
13741 r = -1,
13742 i = n.doc,
13743 s = t;
13744
13745 while (n.lines[t]) {
13746 t++;
13747 }
13748
13749 var o = i.getLength(),
13750 u = 0;
13751 n.running = !1;
13752
13753 while (t < o) {
13754 n.$tokenizeRow(t), r = t;
13755
13756 do {
13757 t++;
13758 } while (n.lines[t]);
13759
13760 u++;
13761
13762 if (u % 5 === 0 && new Date() - e > 20) {
13763 n.running = setTimeout(n.$worker, 20);
13764 break;
13765 }
13766 }
13767
13768 n.currentLine = t, r == -1 && (r = t), s <= r && n.fireUpdateEvent(s, r);
13769 };
13770 };
13771
13772 (function () {
13773 r.implement(this, i), this.setTokenizer = function (e) {
13774 this.tokenizer = e, this.lines = [], this.states = [], this.start(0);
13775 }, this.setDocument = function (e) {
13776 this.doc = e, this.lines = [], this.states = [], this.stop();
13777 }, this.fireUpdateEvent = function (e, t) {
13778 var n = {
13779 first: e,
13780 last: t
13781 };
13782
13783 this._signal("update", {
13784 data: n
13785 });
13786 }, this.start = function (e) {
13787 this.currentLine = Math.min(e || 0, this.currentLine, this.doc.getLength()), this.lines.splice(this.currentLine, this.lines.length), this.states.splice(this.currentLine, this.states.length), this.stop(), this.running = setTimeout(this.$worker, 700);
13788 }, this.scheduleStart = function () {
13789 this.running || (this.running = setTimeout(this.$worker, 700));
13790 }, this.$updateOnChange = function (e) {
13791 var t = e.start.row,
13792 n = e.end.row - t;
13793 if (n === 0) this.lines[t] = null;else if (e.action == "remove") this.lines.splice(t, n + 1, null), this.states.splice(t, n + 1, null);else {
13794 var r = Array(n + 1);
13795 r.unshift(t, 1), this.lines.splice.apply(this.lines, r), this.states.splice.apply(this.states, r);
13796 }
13797 this.currentLine = Math.min(t, this.currentLine, this.doc.getLength()), this.stop();
13798 }, this.stop = function () {
13799 this.running && clearTimeout(this.running), this.running = !1;
13800 }, this.getTokens = function (e) {
13801 return this.lines[e] || this.$tokenizeRow(e);
13802 }, this.getState = function (e) {
13803 return this.currentLine == e && this.$tokenizeRow(e), this.states[e] || "start";
13804 }, this.$tokenizeRow = function (e) {
13805 var t = this.doc.getLine(e),
13806 n = this.states[e - 1],
13807 r = this.tokenizer.getLineTokens(t, n, e);
13808 return this.states[e] + "" != r.state + "" ? (this.states[e] = r.state, this.lines[e + 1] = null, this.currentLine > e + 1 && (this.currentLine = e + 1)) : this.currentLine == e && (this.currentLine = e + 1), this.lines[e] = r.tokens;
13809 };
13810 }).call(s.prototype), t.BackgroundTokenizer = s;
13811 }), ace.define("ace/search_highlight", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/range"], function (e, t, n) {
13812 "use strict";
13813
13814 var r = e("./lib/lang"),
13815 i = e("./lib/oop"),
13816 s = e("./range").Range,
13817 o = function o(e, t, n) {
13818 this.setRegexp(e), this.clazz = t, this.type = n || "text";
13819 };
13820
13821 (function () {
13822 this.MAX_RANGES = 500, this.setRegexp = function (e) {
13823 if (this.regExp + "" == e + "") return;
13824 this.regExp = e, this.cache = [];
13825 }, this.update = function (e, t, n, i) {
13826 if (!this.regExp) return;
13827 var o = i.firstRow,
13828 u = i.lastRow;
13829
13830 for (var a = o; a <= u; a++) {
13831 var f = this.cache[a];
13832 f == null && (f = r.getMatchOffsets(n.getLine(a), this.regExp), f.length > this.MAX_RANGES && (f = f.slice(0, this.MAX_RANGES)), f = f.map(function (e) {
13833 return new s(a, e.offset, a, e.offset + e.length);
13834 }), this.cache[a] = f.length ? f : "");
13835
13836 for (var l = f.length; l--;) {
13837 t.drawSingleLineMarker(e, f[l].toScreenRange(n), this.clazz, i);
13838 }
13839 }
13840 };
13841 }).call(o.prototype), t.SearchHighlight = o;
13842 }), ace.define("ace/edit_session/fold_line", ["require", "exports", "module", "ace/range"], function (e, t, n) {
13843 "use strict";
13844
13845 function i(e, t) {
13846 this.foldData = e, Array.isArray(t) ? this.folds = t : t = this.folds = [t];
13847 var n = t[t.length - 1];
13848 this.range = new r(t[0].start.row, t[0].start.column, n.end.row, n.end.column), this.start = this.range.start, this.end = this.range.end, this.folds.forEach(function (e) {
13849 e.setFoldLine(this);
13850 }, this);
13851 }
13852
13853 var r = e("../range").Range;
13854 (function () {
13855 this.shiftRow = function (e) {
13856 this.start.row += e, this.end.row += e, this.folds.forEach(function (t) {
13857 t.start.row += e, t.end.row += e;
13858 });
13859 }, this.addFold = function (e) {
13860 if (e.sameRow) {
13861 if (e.start.row < this.startRow || e.endRow > this.endRow) throw new Error("Can't add a fold to this FoldLine as it has no connection");
13862 this.folds.push(e), this.folds.sort(function (e, t) {
13863 return -e.range.compareEnd(t.start.row, t.start.column);
13864 }), this.range.compareEnd(e.start.row, e.start.column) > 0 ? (this.end.row = e.end.row, this.end.column = e.end.column) : this.range.compareStart(e.end.row, e.end.column) < 0 && (this.start.row = e.start.row, this.start.column = e.start.column);
13865 } else if (e.start.row == this.end.row) this.folds.push(e), this.end.row = e.end.row, this.end.column = e.end.column;else {
13866 if (e.end.row != this.start.row) throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");
13867 this.folds.unshift(e), this.start.row = e.start.row, this.start.column = e.start.column;
13868 }
13869
13870 e.foldLine = this;
13871 }, this.containsRow = function (e) {
13872 return e >= this.start.row && e <= this.end.row;
13873 }, this.walk = function (e, t, n) {
13874 var r = 0,
13875 i = this.folds,
13876 s,
13877 o,
13878 u,
13879 a = !0;
13880 t == null && (t = this.end.row, n = this.end.column);
13881
13882 for (var f = 0; f < i.length; f++) {
13883 s = i[f], o = s.range.compareStart(t, n);
13884
13885 if (o == -1) {
13886 e(null, t, n, r, a);
13887 return;
13888 }
13889
13890 u = e(null, s.start.row, s.start.column, r, a), u = !u && e(s.placeholder, s.start.row, s.start.column, r);
13891 if (u || o === 0) return;
13892 a = !s.sameRow, r = s.end.column;
13893 }
13894
13895 e(null, t, n, r, a);
13896 }, this.getNextFoldTo = function (e, t) {
13897 var n, r;
13898
13899 for (var i = 0; i < this.folds.length; i++) {
13900 n = this.folds[i], r = n.range.compareEnd(e, t);
13901 if (r == -1) return {
13902 fold: n,
13903 kind: "after"
13904 };
13905 if (r === 0) return {
13906 fold: n,
13907 kind: "inside"
13908 };
13909 }
13910
13911 return null;
13912 }, this.addRemoveChars = function (e, t, n) {
13913 var r = this.getNextFoldTo(e, t),
13914 i,
13915 s;
13916
13917 if (r) {
13918 i = r.fold;
13919 if (r.kind == "inside" && i.start.column != t && i.start.row != e) window.console && window.console.log(e, t, i);else if (i.start.row == e) {
13920 s = this.folds;
13921 var o = s.indexOf(i);
13922 o === 0 && (this.start.column += n);
13923
13924 for (o; o < s.length; o++) {
13925 i = s[o], i.start.column += n;
13926 if (!i.sameRow) return;
13927 i.end.column += n;
13928 }
13929
13930 this.end.column += n;
13931 }
13932 }
13933 }, this.split = function (e, t) {
13934 var n = this.getNextFoldTo(e, t);
13935 if (!n || n.kind == "inside") return null;
13936 var r = n.fold,
13937 s = this.folds,
13938 o = this.foldData,
13939 u = s.indexOf(r),
13940 a = s[u - 1];
13941 this.end.row = a.end.row, this.end.column = a.end.column, s = s.splice(u, s.length - u);
13942 var f = new i(o, s);
13943 return o.splice(o.indexOf(this) + 1, 0, f), f;
13944 }, this.merge = function (e) {
13945 var t = e.folds;
13946
13947 for (var n = 0; n < t.length; n++) {
13948 this.addFold(t[n]);
13949 }
13950
13951 var r = this.foldData;
13952 r.splice(r.indexOf(e), 1);
13953 }, this.toString = function () {
13954 var e = [this.range.toString() + ": ["];
13955 return this.folds.forEach(function (t) {
13956 e.push(" " + t.toString());
13957 }), e.push("]"), e.join("\n");
13958 }, this.idxToPosition = function (e) {
13959 var t = 0;
13960
13961 for (var n = 0; n < this.folds.length; n++) {
13962 var r = this.folds[n];
13963 e -= r.start.column - t;
13964 if (e < 0) return {
13965 row: r.start.row,
13966 column: r.start.column + e
13967 };
13968 e -= r.placeholder.length;
13969 if (e < 0) return r.start;
13970 t = r.end.column;
13971 }
13972
13973 return {
13974 row: this.end.row,
13975 column: this.end.column + e
13976 };
13977 };
13978 }).call(i.prototype), t.FoldLine = i;
13979 }), ace.define("ace/range_list", ["require", "exports", "module", "ace/range"], function (e, t, n) {
13980 "use strict";
13981
13982 var r = e("./range").Range,
13983 i = r.comparePoints,
13984 s = function s() {
13985 this.ranges = [];
13986 };
13987
13988 (function () {
13989 this.comparePoints = i, this.pointIndex = function (e, t, n) {
13990 var r = this.ranges;
13991
13992 for (var s = n || 0; s < r.length; s++) {
13993 var o = r[s],
13994 u = i(e, o.end);
13995 if (u > 0) continue;
13996 var a = i(e, o.start);
13997 return u === 0 ? t && a !== 0 ? -s - 2 : s : a > 0 || a === 0 && !t ? s : -s - 1;
13998 }
13999
14000 return -s - 1;
14001 }, this.add = function (e) {
14002 var t = !e.isEmpty(),
14003 n = this.pointIndex(e.start, t);
14004 n < 0 && (n = -n - 1);
14005 var r = this.pointIndex(e.end, t, n);
14006 return r < 0 ? r = -r - 1 : r++, this.ranges.splice(n, r - n, e);
14007 }, this.addList = function (e) {
14008 var t = [];
14009
14010 for (var n = e.length; n--;) {
14011 t.push.apply(t, this.add(e[n]));
14012 }
14013
14014 return t;
14015 }, this.substractPoint = function (e) {
14016 var t = this.pointIndex(e);
14017 if (t >= 0) return this.ranges.splice(t, 1);
14018 }, this.merge = function () {
14019 var e = [],
14020 t = this.ranges;
14021 t = t.sort(function (e, t) {
14022 return i(e.start, t.start);
14023 });
14024 var n = t[0],
14025 r;
14026
14027 for (var s = 1; s < t.length; s++) {
14028 r = n, n = t[s];
14029 var o = i(r.end, n.start);
14030 if (o < 0) continue;
14031 if (o == 0 && !r.isEmpty() && !n.isEmpty()) continue;
14032 i(r.end, n.end) < 0 && (r.end.row = n.end.row, r.end.column = n.end.column), t.splice(s, 1), e.push(n), n = r, s--;
14033 }
14034
14035 return this.ranges = t, e;
14036 }, this.contains = function (e, t) {
14037 return this.pointIndex({
14038 row: e,
14039 column: t
14040 }) >= 0;
14041 }, this.containsPoint = function (e) {
14042 return this.pointIndex(e) >= 0;
14043 }, this.rangeAtPoint = function (e) {
14044 var t = this.pointIndex(e);
14045 if (t >= 0) return this.ranges[t];
14046 }, this.clipRows = function (e, t) {
14047 var n = this.ranges;
14048 if (n[0].start.row > t || n[n.length - 1].start.row < e) return [];
14049 var r = this.pointIndex({
14050 row: e,
14051 column: 0
14052 });
14053 r < 0 && (r = -r - 1);
14054 var i = this.pointIndex({
14055 row: t,
14056 column: 0
14057 }, r);
14058 i < 0 && (i = -i - 1);
14059 var s = [];
14060
14061 for (var o = r; o < i; o++) {
14062 s.push(n[o]);
14063 }
14064
14065 return s;
14066 }, this.removeAll = function () {
14067 return this.ranges.splice(0, this.ranges.length);
14068 }, this.attach = function (e) {
14069 this.session && this.detach(), this.session = e, this.onChange = this.$onChange.bind(this), this.session.on("change", this.onChange);
14070 }, this.detach = function () {
14071 if (!this.session) return;
14072 this.session.removeListener("change", this.onChange), this.session = null;
14073 }, this.$onChange = function (e) {
14074 if (e.action == "insert") var t = e.start,
14075 n = e.end;else var n = e.start,
14076 t = e.end;
14077 var r = t.row,
14078 i = n.row,
14079 s = i - r,
14080 o = -t.column + n.column,
14081 u = this.ranges;
14082
14083 for (var a = 0, f = u.length; a < f; a++) {
14084 var l = u[a];
14085 if (l.end.row < r) continue;
14086 if (l.start.row > r) break;
14087 l.start.row == r && l.start.column >= t.column && (l.start.column != t.column || !this.$insertRight) && (l.start.column += o, l.start.row += s);
14088
14089 if (l.end.row == r && l.end.column >= t.column) {
14090 if (l.end.column == t.column && this.$insertRight) continue;
14091 l.end.column == t.column && o > 0 && a < f - 1 && l.end.column > l.start.column && l.end.column == u[a + 1].start.column && (l.end.column -= o), l.end.column += o, l.end.row += s;
14092 }
14093 }
14094
14095 if (s != 0 && a < f) for (; a < f; a++) {
14096 var l = u[a];
14097 l.start.row += s, l.end.row += s;
14098 }
14099 };
14100 }).call(s.prototype), t.RangeList = s;
14101 }), ace.define("ace/edit_session/fold", ["require", "exports", "module", "ace/range", "ace/range_list", "ace/lib/oop"], function (e, t, n) {
14102 "use strict";
14103
14104 function u(e, t) {
14105 e.row -= t.row, e.row == 0 && (e.column -= t.column);
14106 }
14107
14108 function a(e, t) {
14109 u(e.start, t), u(e.end, t);
14110 }
14111
14112 function f(e, t) {
14113 e.row == 0 && (e.column += t.column), e.row += t.row;
14114 }
14115
14116 function l(e, t) {
14117 f(e.start, t), f(e.end, t);
14118 }
14119
14120 var r = e("../range").Range,
14121 i = e("../range_list").RangeList,
14122 s = e("../lib/oop"),
14123 o = t.Fold = function (e, t) {
14124 this.foldLine = null, this.placeholder = t, this.range = e, this.start = e.start, this.end = e.end, this.sameRow = e.start.row == e.end.row, this.subFolds = this.ranges = [];
14125 };
14126
14127 s.inherits(o, i), function () {
14128 this.toString = function () {
14129 return '"' + this.placeholder + '" ' + this.range.toString();
14130 }, this.setFoldLine = function (e) {
14131 this.foldLine = e, this.subFolds.forEach(function (t) {
14132 t.setFoldLine(e);
14133 });
14134 }, this.clone = function () {
14135 var e = this.range.clone(),
14136 t = new o(e, this.placeholder);
14137 return this.subFolds.forEach(function (e) {
14138 t.subFolds.push(e.clone());
14139 }), t.collapseChildren = this.collapseChildren, t;
14140 }, this.addSubFold = function (e) {
14141 if (this.range.isEqual(e)) return;
14142 if (!this.range.containsRange(e)) throw new Error("A fold can't intersect already existing fold" + e.range + this.range);
14143 a(e, this.start);
14144 var t = e.start.row,
14145 n = e.start.column;
14146
14147 for (var r = 0, i = -1; r < this.subFolds.length; r++) {
14148 i = this.subFolds[r].range.compare(t, n);
14149 if (i != 1) break;
14150 }
14151
14152 var s = this.subFolds[r];
14153 if (i == 0) return s.addSubFold(e);
14154 var t = e.range.end.row,
14155 n = e.range.end.column;
14156
14157 for (var o = r, i = -1; o < this.subFolds.length; o++) {
14158 i = this.subFolds[o].range.compare(t, n);
14159 if (i != 1) break;
14160 }
14161
14162 var u = this.subFolds[o];
14163 if (i == 0) throw new Error("A fold can't intersect already existing fold" + e.range + this.range);
14164 var f = this.subFolds.splice(r, o - r, e);
14165 return e.setFoldLine(this.foldLine), e;
14166 }, this.restoreRange = function (e) {
14167 return l(e, this.start);
14168 };
14169 }.call(o.prototype);
14170 }), ace.define("ace/edit_session/folding", ["require", "exports", "module", "ace/range", "ace/edit_session/fold_line", "ace/edit_session/fold", "ace/token_iterator"], function (e, t, n) {
14171 "use strict";
14172
14173 function u() {
14174 this.getFoldAt = function (e, t, n) {
14175 var r = this.getFoldLine(e);
14176 if (!r) return null;
14177 var i = r.folds;
14178
14179 for (var s = 0; s < i.length; s++) {
14180 var o = i[s];
14181
14182 if (o.range.contains(e, t)) {
14183 if (n == 1 && o.range.isEnd(e, t)) continue;
14184 if (n == -1 && o.range.isStart(e, t)) continue;
14185 return o;
14186 }
14187 }
14188 }, this.getFoldsInRange = function (e) {
14189 var t = e.start,
14190 n = e.end,
14191 r = this.$foldData,
14192 i = [];
14193 t.column += 1, n.column -= 1;
14194
14195 for (var s = 0; s < r.length; s++) {
14196 var o = r[s].range.compareRange(e);
14197 if (o == 2) continue;
14198 if (o == -2) break;
14199 var u = r[s].folds;
14200
14201 for (var a = 0; a < u.length; a++) {
14202 var f = u[a];
14203 o = f.range.compareRange(e);
14204 if (o == -2) break;
14205 if (o == 2) continue;
14206 if (o == 42) break;
14207 i.push(f);
14208 }
14209 }
14210
14211 return t.column -= 1, n.column += 1, i;
14212 }, this.getFoldsInRangeList = function (e) {
14213 if (Array.isArray(e)) {
14214 var t = [];
14215 e.forEach(function (e) {
14216 t = t.concat(this.getFoldsInRange(e));
14217 }, this);
14218 } else var t = this.getFoldsInRange(e);
14219
14220 return t;
14221 }, this.getAllFolds = function () {
14222 var e = [],
14223 t = this.$foldData;
14224
14225 for (var n = 0; n < t.length; n++) {
14226 for (var r = 0; r < t[n].folds.length; r++) {
14227 e.push(t[n].folds[r]);
14228 }
14229 }
14230
14231 return e;
14232 }, this.getFoldStringAt = function (e, t, n, r) {
14233 r = r || this.getFoldLine(e);
14234 if (!r) return null;
14235 var i = {
14236 end: {
14237 column: 0
14238 }
14239 },
14240 s,
14241 o;
14242
14243 for (var u = 0; u < r.folds.length; u++) {
14244 o = r.folds[u];
14245 var a = o.range.compareEnd(e, t);
14246
14247 if (a == -1) {
14248 s = this.getLine(o.start.row).substring(i.end.column, o.start.column);
14249 break;
14250 }
14251
14252 if (a === 0) return null;
14253 i = o;
14254 }
14255
14256 return s || (s = this.getLine(o.start.row).substring(i.end.column)), n == -1 ? s.substring(0, t - i.end.column) : n == 1 ? s.substring(t - i.end.column) : s;
14257 }, this.getFoldLine = function (e, t) {
14258 var n = this.$foldData,
14259 r = 0;
14260 t && (r = n.indexOf(t)), r == -1 && (r = 0);
14261
14262 for (r; r < n.length; r++) {
14263 var i = n[r];
14264 if (i.start.row <= e && i.end.row >= e) return i;
14265 if (i.end.row > e) return null;
14266 }
14267
14268 return null;
14269 }, this.getNextFoldLine = function (e, t) {
14270 var n = this.$foldData,
14271 r = 0;
14272 t && (r = n.indexOf(t)), r == -1 && (r = 0);
14273
14274 for (r; r < n.length; r++) {
14275 var i = n[r];
14276 if (i.end.row >= e) return i;
14277 }
14278
14279 return null;
14280 }, this.getFoldedRowCount = function (e, t) {
14281 var n = this.$foldData,
14282 r = t - e + 1;
14283
14284 for (var i = 0; i < n.length; i++) {
14285 var s = n[i],
14286 o = s.end.row,
14287 u = s.start.row;
14288
14289 if (o >= t) {
14290 u < t && (u >= e ? r -= t - u : r = 0);
14291 break;
14292 }
14293
14294 o >= e && (u >= e ? r -= o - u : r -= o - e + 1);
14295 }
14296
14297 return r;
14298 }, this.$addFoldLine = function (e) {
14299 return this.$foldData.push(e), this.$foldData.sort(function (e, t) {
14300 return e.start.row - t.start.row;
14301 }), e;
14302 }, this.addFold = function (e, t) {
14303 var n = this.$foldData,
14304 r = !1,
14305 o;
14306 e instanceof s ? o = e : (o = new s(t, e), o.collapseChildren = t.collapseChildren), this.$clipRangeToDocument(o.range);
14307 var u = o.start.row,
14308 a = o.start.column,
14309 f = o.end.row,
14310 l = o.end.column;
14311
14312 if (u < f || u == f && a <= l - 2) {
14313 var c = this.getFoldAt(u, a, 1),
14314 h = this.getFoldAt(f, l, -1);
14315 if (c && h == c) return c.addSubFold(o);
14316 c && !c.range.isStart(u, a) && this.removeFold(c), h && !h.range.isEnd(f, l) && this.removeFold(h);
14317 var p = this.getFoldsInRange(o.range);
14318 p.length > 0 && (this.removeFolds(p), p.forEach(function (e) {
14319 o.addSubFold(e);
14320 }));
14321
14322 for (var d = 0; d < n.length; d++) {
14323 var v = n[d];
14324
14325 if (f == v.start.row) {
14326 v.addFold(o), r = !0;
14327 break;
14328 }
14329
14330 if (u == v.end.row) {
14331 v.addFold(o), r = !0;
14332
14333 if (!o.sameRow) {
14334 var m = n[d + 1];
14335
14336 if (m && m.start.row == f) {
14337 v.merge(m);
14338 break;
14339 }
14340 }
14341
14342 break;
14343 }
14344
14345 if (f <= v.start.row) break;
14346 }
14347
14348 return r || (v = this.$addFoldLine(new i(this.$foldData, o))), this.$useWrapMode ? this.$updateWrapData(v.start.row, v.start.row) : this.$updateRowLengthCache(v.start.row, v.start.row), this.$modified = !0, this._signal("changeFold", {
14349 data: o,
14350 action: "add"
14351 }), o;
14352 }
14353
14354 throw new Error("The range has to be at least 2 characters width");
14355 }, this.addFolds = function (e) {
14356 e.forEach(function (e) {
14357 this.addFold(e);
14358 }, this);
14359 }, this.removeFold = function (e) {
14360 var t = e.foldLine,
14361 n = t.start.row,
14362 r = t.end.row,
14363 i = this.$foldData,
14364 s = t.folds;
14365 if (s.length == 1) i.splice(i.indexOf(t), 1);else if (t.range.isEnd(e.end.row, e.end.column)) s.pop(), t.end.row = s[s.length - 1].end.row, t.end.column = s[s.length - 1].end.column;else if (t.range.isStart(e.start.row, e.start.column)) s.shift(), t.start.row = s[0].start.row, t.start.column = s[0].start.column;else if (e.sameRow) s.splice(s.indexOf(e), 1);else {
14366 var o = t.split(e.start.row, e.start.column);
14367 s = o.folds, s.shift(), o.start.row = s[0].start.row, o.start.column = s[0].start.column;
14368 }
14369 this.$updating || (this.$useWrapMode ? this.$updateWrapData(n, r) : this.$updateRowLengthCache(n, r)), this.$modified = !0, this._signal("changeFold", {
14370 data: e,
14371 action: "remove"
14372 });
14373 }, this.removeFolds = function (e) {
14374 var t = [];
14375
14376 for (var n = 0; n < e.length; n++) {
14377 t.push(e[n]);
14378 }
14379
14380 t.forEach(function (e) {
14381 this.removeFold(e);
14382 }, this), this.$modified = !0;
14383 }, this.expandFold = function (e) {
14384 this.removeFold(e), e.subFolds.forEach(function (t) {
14385 e.restoreRange(t), this.addFold(t);
14386 }, this), e.collapseChildren > 0 && this.foldAll(e.start.row + 1, e.end.row, e.collapseChildren - 1), e.subFolds = [];
14387 }, this.expandFolds = function (e) {
14388 e.forEach(function (e) {
14389 this.expandFold(e);
14390 }, this);
14391 }, this.unfold = function (e, t) {
14392 var n, i;
14393 e == null ? (n = new r(0, 0, this.getLength(), 0), t = !0) : typeof e == "number" ? n = new r(e, 0, e, this.getLine(e).length) : "row" in e ? n = r.fromPoints(e, e) : n = e, i = this.getFoldsInRangeList(n);
14394 if (t) this.removeFolds(i);else {
14395 var s = i;
14396
14397 while (s.length) {
14398 this.expandFolds(s), s = this.getFoldsInRangeList(n);
14399 }
14400 }
14401 if (i.length) return i;
14402 }, this.isRowFolded = function (e, t) {
14403 return !!this.getFoldLine(e, t);
14404 }, this.getRowFoldEnd = function (e, t) {
14405 var n = this.getFoldLine(e, t);
14406 return n ? n.end.row : e;
14407 }, this.getRowFoldStart = function (e, t) {
14408 var n = this.getFoldLine(e, t);
14409 return n ? n.start.row : e;
14410 }, this.getFoldDisplayLine = function (e, t, n, r, i) {
14411 r == null && (r = e.start.row), i == null && (i = 0), t == null && (t = e.end.row), n == null && (n = this.getLine(t).length);
14412 var s = this.doc,
14413 o = "";
14414 return e.walk(function (e, t, n, u) {
14415 if (t < r) return;
14416
14417 if (t == r) {
14418 if (n < i) return;
14419 u = Math.max(i, u);
14420 }
14421
14422 e != null ? o += e : o += s.getLine(t).substring(u, n);
14423 }, t, n), o;
14424 }, this.getDisplayLine = function (e, t, n, r) {
14425 var i = this.getFoldLine(e);
14426
14427 if (!i) {
14428 var s;
14429 return s = this.doc.getLine(e), s.substring(r || 0, t || s.length);
14430 }
14431
14432 return this.getFoldDisplayLine(i, e, t, n, r);
14433 }, this.$cloneFoldData = function () {
14434 var e = [];
14435 return e = this.$foldData.map(function (t) {
14436 var n = t.folds.map(function (e) {
14437 return e.clone();
14438 });
14439 return new i(e, n);
14440 }), e;
14441 }, this.toggleFold = function (e) {
14442 var t = this.selection,
14443 n = t.getRange(),
14444 r,
14445 i;
14446
14447 if (n.isEmpty()) {
14448 var s = n.start;
14449 r = this.getFoldAt(s.row, s.column);
14450
14451 if (r) {
14452 this.expandFold(r);
14453 return;
14454 }
14455
14456 (i = this.findMatchingBracket(s)) ? n.comparePoint(i) == 1 ? n.end = i : (n.start = i, n.start.column++, n.end.column--) : (i = this.findMatchingBracket({
14457 row: s.row,
14458 column: s.column + 1
14459 })) ? (n.comparePoint(i) == 1 ? n.end = i : n.start = i, n.start.column++) : n = this.getCommentFoldRange(s.row, s.column) || n;
14460 } else {
14461 var o = this.getFoldsInRange(n);
14462
14463 if (e && o.length) {
14464 this.expandFolds(o);
14465 return;
14466 }
14467
14468 o.length == 1 && (r = o[0]);
14469 }
14470
14471 r || (r = this.getFoldAt(n.start.row, n.start.column));
14472
14473 if (r && r.range.toString() == n.toString()) {
14474 this.expandFold(r);
14475 return;
14476 }
14477
14478 var u = "...";
14479
14480 if (!n.isMultiLine()) {
14481 u = this.getTextRange(n);
14482 if (u.length < 4) return;
14483 u = u.trim().substring(0, 2) + "..";
14484 }
14485
14486 this.addFold(u, n);
14487 }, this.getCommentFoldRange = function (e, t, n) {
14488 var i = new o(this, e, t),
14489 s = i.getCurrentToken(),
14490 u = s.type;
14491
14492 if (s && /^comment|string/.test(u)) {
14493 u = u.match(/comment|string/)[0], u == "comment" && (u += "|doc-start");
14494 var a = new RegExp(u),
14495 f = new r();
14496
14497 if (n != 1) {
14498 do {
14499 s = i.stepBackward();
14500 } while (s && a.test(s.type));
14501
14502 i.stepForward();
14503 }
14504
14505 f.start.row = i.getCurrentTokenRow(), f.start.column = i.getCurrentTokenColumn() + 2, i = new o(this, e, t);
14506
14507 if (n != -1) {
14508 var l = -1;
14509
14510 do {
14511 s = i.stepForward();
14512
14513 if (l == -1) {
14514 var c = this.getState(i.$row);
14515 a.test(c) || (l = i.$row);
14516 } else if (i.$row > l) break;
14517 } while (s && a.test(s.type));
14518
14519 s = i.stepBackward();
14520 } else s = i.getCurrentToken();
14521
14522 return f.end.row = i.getCurrentTokenRow(), f.end.column = i.getCurrentTokenColumn() + s.value.length - 2, f;
14523 }
14524 }, this.foldAll = function (e, t, n) {
14525 n == undefined && (n = 1e5);
14526 var r = this.foldWidgets;
14527 if (!r) return;
14528 t = t || this.getLength(), e = e || 0;
14529
14530 for (var i = e; i < t; i++) {
14531 r[i] == null && (r[i] = this.getFoldWidget(i));
14532 if (r[i] != "start") continue;
14533 var s = this.getFoldWidgetRange(i);
14534
14535 if (s && s.isMultiLine() && s.end.row <= t && s.start.row >= e) {
14536 i = s.end.row;
14537
14538 try {
14539 var o = this.addFold("...", s);
14540 o && (o.collapseChildren = n);
14541 } catch (u) {}
14542 }
14543 }
14544 }, this.$foldStyles = {
14545 manual: 1,
14546 markbegin: 1,
14547 markbeginend: 1
14548 }, this.$foldStyle = "markbegin", this.setFoldStyle = function (e) {
14549 if (!this.$foldStyles[e]) throw new Error("invalid fold style: " + e + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
14550 if (this.$foldStyle == e) return;
14551 this.$foldStyle = e, e == "manual" && this.unfold();
14552 var t = this.$foldMode;
14553 this.$setFolding(null), this.$setFolding(t);
14554 }, this.$setFolding = function (e) {
14555 if (this.$foldMode == e) return;
14556 this.$foldMode = e, this.off("change", this.$updateFoldWidgets), this.off("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets), this._signal("changeAnnotation");
14557
14558 if (!e || this.$foldStyle == "manual") {
14559 this.foldWidgets = null;
14560 return;
14561 }
14562
14563 this.foldWidgets = [], this.getFoldWidget = e.getFoldWidget.bind(e, this, this.$foldStyle), this.getFoldWidgetRange = e.getFoldWidgetRange.bind(e, this, this.$foldStyle), this.$updateFoldWidgets = this.updateFoldWidgets.bind(this), this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this), this.on("change", this.$updateFoldWidgets), this.on("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets);
14564 }, this.getParentFoldRangeData = function (e, t) {
14565 var n = this.foldWidgets;
14566 if (!n || t && n[e]) return {};
14567 var r = e - 1,
14568 i;
14569
14570 while (r >= 0) {
14571 var s = n[r];
14572 s == null && (s = n[r] = this.getFoldWidget(r));
14573
14574 if (s == "start") {
14575 var o = this.getFoldWidgetRange(r);
14576 i || (i = o);
14577 if (o && o.end.row >= e) break;
14578 }
14579
14580 r--;
14581 }
14582
14583 return {
14584 range: r !== -1 && o,
14585 firstRange: i
14586 };
14587 }, this.onFoldWidgetClick = function (e, t) {
14588 t = t.domEvent;
14589 var n = {
14590 children: t.shiftKey,
14591 all: t.ctrlKey || t.metaKey,
14592 siblings: t.altKey
14593 },
14594 r = this.$toggleFoldWidget(e, n);
14595
14596 if (!r) {
14597 var i = t.target || t.srcElement;
14598 i && /ace_fold-widget/.test(i.className) && (i.className += " ace_invalid");
14599 }
14600 }, this.$toggleFoldWidget = function (e, t) {
14601 if (!this.getFoldWidget) return;
14602 var n = this.getFoldWidget(e),
14603 r = this.getLine(e),
14604 i = n === "end" ? -1 : 1,
14605 s = this.getFoldAt(e, i === -1 ? 0 : r.length, i);
14606 if (s) return t.children || t.all ? this.removeFold(s) : this.expandFold(s), s;
14607 var o = this.getFoldWidgetRange(e, !0);
14608
14609 if (o && !o.isMultiLine()) {
14610 s = this.getFoldAt(o.start.row, o.start.column, 1);
14611 if (s && o.isEqual(s.range)) return this.removeFold(s), s;
14612 }
14613
14614 if (t.siblings) {
14615 var u = this.getParentFoldRangeData(e);
14616 if (u.range) var a = u.range.start.row + 1,
14617 f = u.range.end.row;
14618 this.foldAll(a, f, t.all ? 1e4 : 0);
14619 } else t.children ? (f = o ? o.end.row : this.getLength(), this.foldAll(e + 1, f, t.all ? 1e4 : 0)) : o && (t.all && (o.collapseChildren = 1e4), this.addFold("...", o));
14620
14621 return o;
14622 }, this.toggleFoldWidget = function (e) {
14623 var t = this.selection.getCursor().row;
14624 t = this.getRowFoldStart(t);
14625 var n = this.$toggleFoldWidget(t, {});
14626 if (n) return;
14627 var r = this.getParentFoldRangeData(t, !0);
14628 n = r.range || r.firstRange;
14629
14630 if (n) {
14631 t = n.start.row;
14632 var i = this.getFoldAt(t, this.getLine(t).length, 1);
14633 i ? this.removeFold(i) : this.addFold("...", n);
14634 }
14635 }, this.updateFoldWidgets = function (e) {
14636 var t = e.start.row,
14637 n = e.end.row - t;
14638 if (n === 0) this.foldWidgets[t] = null;else if (e.action == "remove") this.foldWidgets.splice(t, n + 1, null);else {
14639 var r = Array(n + 1);
14640 r.unshift(t, 1), this.foldWidgets.splice.apply(this.foldWidgets, r);
14641 }
14642 }, this.tokenizerUpdateFoldWidgets = function (e) {
14643 var t = e.data;
14644 t.first != t.last && this.foldWidgets.length > t.first && this.foldWidgets.splice(t.first, this.foldWidgets.length);
14645 };
14646 }
14647
14648 var r = e("../range").Range,
14649 i = e("./fold_line").FoldLine,
14650 s = e("./fold").Fold,
14651 o = e("../token_iterator").TokenIterator;
14652 t.Folding = u;
14653 }), ace.define("ace/edit_session/bracket_match", ["require", "exports", "module", "ace/token_iterator", "ace/range"], function (e, t, n) {
14654 "use strict";
14655
14656 function s() {
14657 this.findMatchingBracket = function (e, t) {
14658 if (e.column == 0) return null;
14659 var n = t || this.getLine(e.row).charAt(e.column - 1);
14660 if (n == "") return null;
14661 var r = n.match(/([\(\[\{])|([\)\]\}])/);
14662 return r ? r[1] ? this.$findClosingBracket(r[1], e) : this.$findOpeningBracket(r[2], e) : null;
14663 }, this.getBracketRange = function (e) {
14664 var t = this.getLine(e.row),
14665 n = !0,
14666 r,
14667 s = t.charAt(e.column - 1),
14668 o = s && s.match(/([\(\[\{])|([\)\]\}])/);
14669 o || (s = t.charAt(e.column), e = {
14670 row: e.row,
14671 column: e.column + 1
14672 }, o = s && s.match(/([\(\[\{])|([\)\]\}])/), n = !1);
14673 if (!o) return null;
14674
14675 if (o[1]) {
14676 var u = this.$findClosingBracket(o[1], e);
14677 if (!u) return null;
14678 r = i.fromPoints(e, u), n || (r.end.column++, r.start.column--), r.cursor = r.end;
14679 } else {
14680 var u = this.$findOpeningBracket(o[2], e);
14681 if (!u) return null;
14682 r = i.fromPoints(u, e), n || (r.start.column++, r.end.column--), r.cursor = r.start;
14683 }
14684
14685 return r;
14686 }, this.$brackets = {
14687 ")": "(",
14688 "(": ")",
14689 "]": "[",
14690 "[": "]",
14691 "{": "}",
14692 "}": "{"
14693 }, this.$findOpeningBracket = function (e, t, n) {
14694 var i = this.$brackets[e],
14695 s = 1,
14696 o = new r(this, t.row, t.column),
14697 u = o.getCurrentToken();
14698 u || (u = o.stepForward());
14699 if (!u) return;
14700 n || (n = new RegExp("(\\.?" + u.type.replace(".", "\\.").replace("rparen", ".paren").replace(/\b(?:end)\b/, "(?:start|begin|end)") + ")+"));
14701 var a = t.column - o.getCurrentTokenColumn() - 2,
14702 f = u.value;
14703
14704 for (;;) {
14705 while (a >= 0) {
14706 var l = f.charAt(a);
14707
14708 if (l == i) {
14709 s -= 1;
14710 if (s == 0) return {
14711 row: o.getCurrentTokenRow(),
14712 column: a + o.getCurrentTokenColumn()
14713 };
14714 } else l == e && (s += 1);
14715
14716 a -= 1;
14717 }
14718
14719 do {
14720 u = o.stepBackward();
14721 } while (u && !n.test(u.type));
14722
14723 if (u == null) break;
14724 f = u.value, a = f.length - 1;
14725 }
14726
14727 return null;
14728 }, this.$findClosingBracket = function (e, t, n) {
14729 var i = this.$brackets[e],
14730 s = 1,
14731 o = new r(this, t.row, t.column),
14732 u = o.getCurrentToken();
14733 u || (u = o.stepForward());
14734 if (!u) return;
14735 n || (n = new RegExp("(\\.?" + u.type.replace(".", "\\.").replace("lparen", ".paren").replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") + ")+"));
14736 var a = t.column - o.getCurrentTokenColumn();
14737
14738 for (;;) {
14739 var f = u.value,
14740 l = f.length;
14741
14742 while (a < l) {
14743 var c = f.charAt(a);
14744
14745 if (c == i) {
14746 s -= 1;
14747 if (s == 0) return {
14748 row: o.getCurrentTokenRow(),
14749 column: a + o.getCurrentTokenColumn()
14750 };
14751 } else c == e && (s += 1);
14752
14753 a += 1;
14754 }
14755
14756 do {
14757 u = o.stepForward();
14758 } while (u && !n.test(u.type));
14759
14760 if (u == null) break;
14761 a = 0;
14762 }
14763
14764 return null;
14765 };
14766 }
14767
14768 var r = e("../token_iterator").TokenIterator,
14769 i = e("../range").Range;
14770 t.BracketMatch = s;
14771 }), ace.define("ace/edit_session", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/config", "ace/lib/event_emitter", "ace/selection", "ace/mode/text", "ace/range", "ace/document", "ace/background_tokenizer", "ace/search_highlight", "ace/edit_session/folding", "ace/edit_session/bracket_match"], function (e, t, n) {
14772 "use strict";
14773
14774 var r = e("./lib/oop"),
14775 i = e("./lib/lang"),
14776 s = e("./config"),
14777 o = e("./lib/event_emitter").EventEmitter,
14778 u = e("./selection").Selection,
14779 a = e("./mode/text").Mode,
14780 f = e("./range").Range,
14781 l = e("./document").Document,
14782 c = e("./background_tokenizer").BackgroundTokenizer,
14783 h = e("./search_highlight").SearchHighlight,
14784 p = function p(e, t) {
14785 this.$breakpoints = [], this.$decorations = [], this.$frontMarkers = {}, this.$backMarkers = {}, this.$markerId = 1, this.$undoSelect = !0, this.$foldData = [], this.id = "session" + ++p.$uid, this.$foldData.toString = function () {
14786 return this.join("\n");
14787 }, this.on("changeFold", this.onChangeFold.bind(this)), this.$onChange = this.onChange.bind(this);
14788 if (_typeof(e) != "object" || !e.getLine) e = new l(e);
14789 this.setDocument(e), this.selection = new u(this), s.resetOptions(this), this.setMode(t), s._signal("session", this);
14790 };
14791
14792 p.$uid = 0, function () {
14793 function m(e) {
14794 return e < 4352 ? !1 : e >= 4352 && e <= 4447 || e >= 4515 && e <= 4519 || e >= 4602 && e <= 4607 || e >= 9001 && e <= 9002 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12283 || e >= 12288 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12589 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12730 || e >= 12736 && e <= 12771 || e >= 12784 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 13054 || e >= 13056 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 55216 && e <= 55238 || e >= 55243 && e <= 55291 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
14795 }
14796
14797 r.implement(this, o), this.setDocument = function (e) {
14798 this.doc && this.doc.removeListener("change", this.$onChange), this.doc = e, e.on("change", this.$onChange), this.bgTokenizer && this.bgTokenizer.setDocument(this.getDocument()), this.resetCaches();
14799 }, this.getDocument = function () {
14800 return this.doc;
14801 }, this.$resetRowCache = function (e) {
14802 if (!e) {
14803 this.$docRowCache = [], this.$screenRowCache = [];
14804 return;
14805 }
14806
14807 var t = this.$docRowCache.length,
14808 n = this.$getRowCacheIndex(this.$docRowCache, e) + 1;
14809 t > n && (this.$docRowCache.splice(n, t), this.$screenRowCache.splice(n, t));
14810 }, this.$getRowCacheIndex = function (e, t) {
14811 var n = 0,
14812 r = e.length - 1;
14813
14814 while (n <= r) {
14815 var i = n + r >> 1,
14816 s = e[i];
14817 if (t > s) n = i + 1;else {
14818 if (!(t < s)) return i;
14819 r = i - 1;
14820 }
14821 }
14822
14823 return n - 1;
14824 }, this.resetCaches = function () {
14825 this.$modified = !0, this.$wrapData = [], this.$rowLengthCache = [], this.$resetRowCache(0), this.bgTokenizer && this.bgTokenizer.start(0);
14826 }, this.onChangeFold = function (e) {
14827 var t = e.data;
14828 this.$resetRowCache(t.start.row);
14829 }, this.onChange = function (e) {
14830 this.$modified = !0, this.$resetRowCache(e.start.row);
14831 var t = this.$updateInternalDataOnChange(e);
14832 !this.$fromUndo && this.$undoManager && !e.ignore && (this.$deltasDoc.push(e), t && t.length != 0 && this.$deltasFold.push({
14833 action: "removeFolds",
14834 folds: t
14835 }), this.$informUndoManager.schedule()), this.bgTokenizer && this.bgTokenizer.$updateOnChange(e), this._signal("change", e);
14836 }, this.setValue = function (e) {
14837 this.doc.setValue(e), this.selection.moveTo(0, 0), this.$resetRowCache(0), this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [], this.setUndoManager(this.$undoManager), this.getUndoManager().reset();
14838 }, this.getValue = this.toString = function () {
14839 return this.doc.getValue();
14840 }, this.getSelection = function () {
14841 return this.selection;
14842 }, this.getState = function (e) {
14843 return this.bgTokenizer.getState(e);
14844 }, this.getTokens = function (e) {
14845 return this.bgTokenizer.getTokens(e);
14846 }, this.getTokenAt = function (e, t) {
14847 var n = this.bgTokenizer.getTokens(e),
14848 r,
14849 i = 0;
14850 if (t == null) s = n.length - 1, i = this.getLine(e).length;else for (var s = 0; s < n.length; s++) {
14851 i += n[s].value.length;
14852 if (i >= t) break;
14853 }
14854 return r = n[s], r ? (r.index = s, r.start = i - r.value.length, r) : null;
14855 }, this.setUndoManager = function (e) {
14856 this.$undoManager = e, this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [], this.$informUndoManager && this.$informUndoManager.cancel();
14857
14858 if (e) {
14859 var t = this;
14860 this.$syncInformUndoManager = function () {
14861 t.$informUndoManager.cancel(), t.$deltasFold.length && (t.$deltas.push({
14862 group: "fold",
14863 deltas: t.$deltasFold
14864 }), t.$deltasFold = []), t.$deltasDoc.length && (t.$deltas.push({
14865 group: "doc",
14866 deltas: t.$deltasDoc
14867 }), t.$deltasDoc = []), t.$deltas.length > 0 && e.execute({
14868 action: "aceupdate",
14869 args: [t.$deltas, t],
14870 merge: t.mergeUndoDeltas
14871 }), t.mergeUndoDeltas = !1, t.$deltas = [];
14872 }, this.$informUndoManager = i.delayedCall(this.$syncInformUndoManager);
14873 }
14874 }, this.markUndoGroup = function () {
14875 this.$syncInformUndoManager && this.$syncInformUndoManager();
14876 }, this.$defaultUndoManager = {
14877 undo: function undo() {},
14878 redo: function redo() {},
14879 reset: function reset() {}
14880 }, this.getUndoManager = function () {
14881 return this.$undoManager || this.$defaultUndoManager;
14882 }, this.getTabString = function () {
14883 return this.getUseSoftTabs() ? i.stringRepeat(" ", this.getTabSize()) : " ";
14884 }, this.setUseSoftTabs = function (e) {
14885 this.setOption("useSoftTabs", e);
14886 }, this.getUseSoftTabs = function () {
14887 return this.$useSoftTabs && !this.$mode.$indentWithTabs;
14888 }, this.setTabSize = function (e) {
14889 this.setOption("tabSize", e);
14890 }, this.getTabSize = function () {
14891 return this.$tabSize;
14892 }, this.isTabStop = function (e) {
14893 return this.$useSoftTabs && e.column % this.$tabSize === 0;
14894 }, this.setNavigateWithinSoftTabs = function (e) {
14895 this.setOption("navigateWithinSoftTabs", e);
14896 }, this.getNavigateWithinSoftTabs = function () {
14897 return this.$navigateWithinSoftTabs;
14898 }, this.$overwrite = !1, this.setOverwrite = function (e) {
14899 this.setOption("overwrite", e);
14900 }, this.getOverwrite = function () {
14901 return this.$overwrite;
14902 }, this.toggleOverwrite = function () {
14903 this.setOverwrite(!this.$overwrite);
14904 }, this.addGutterDecoration = function (e, t) {
14905 this.$decorations[e] || (this.$decorations[e] = ""), this.$decorations[e] += " " + t, this._signal("changeBreakpoint", {});
14906 }, this.removeGutterDecoration = function (e, t) {
14907 this.$decorations[e] = (this.$decorations[e] || "").replace(" " + t, ""), this._signal("changeBreakpoint", {});
14908 }, this.getBreakpoints = function () {
14909 return this.$breakpoints;
14910 }, this.setBreakpoints = function (e) {
14911 this.$breakpoints = [];
14912
14913 for (var t = 0; t < e.length; t++) {
14914 this.$breakpoints[e[t]] = "ace_breakpoint";
14915 }
14916
14917 this._signal("changeBreakpoint", {});
14918 }, this.clearBreakpoints = function () {
14919 this.$breakpoints = [], this._signal("changeBreakpoint", {});
14920 }, this.setBreakpoint = function (e, t) {
14921 t === undefined && (t = "ace_breakpoint"), t ? this.$breakpoints[e] = t : delete this.$breakpoints[e], this._signal("changeBreakpoint", {});
14922 }, this.clearBreakpoint = function (e) {
14923 delete this.$breakpoints[e], this._signal("changeBreakpoint", {});
14924 }, this.addMarker = function (e, t, n, r) {
14925 var i = this.$markerId++,
14926 s = {
14927 range: e,
14928 type: n || "line",
14929 renderer: typeof n == "function" ? n : null,
14930 clazz: t,
14931 inFront: !!r,
14932 id: i
14933 };
14934 return r ? (this.$frontMarkers[i] = s, this._signal("changeFrontMarker")) : (this.$backMarkers[i] = s, this._signal("changeBackMarker")), i;
14935 }, this.addDynamicMarker = function (e, t) {
14936 if (!e.update) return;
14937 var n = this.$markerId++;
14938 return e.id = n, e.inFront = !!t, t ? (this.$frontMarkers[n] = e, this._signal("changeFrontMarker")) : (this.$backMarkers[n] = e, this._signal("changeBackMarker")), e;
14939 }, this.removeMarker = function (e) {
14940 var t = this.$frontMarkers[e] || this.$backMarkers[e];
14941 if (!t) return;
14942 var n = t.inFront ? this.$frontMarkers : this.$backMarkers;
14943 t && (delete n[e], this._signal(t.inFront ? "changeFrontMarker" : "changeBackMarker"));
14944 }, this.getMarkers = function (e) {
14945 return e ? this.$frontMarkers : this.$backMarkers;
14946 }, this.highlight = function (e) {
14947 if (!this.$searchHighlight) {
14948 var t = new h(null, "ace_selected-word", "text");
14949 this.$searchHighlight = this.addDynamicMarker(t);
14950 }
14951
14952 this.$searchHighlight.setRegexp(e);
14953 }, this.highlightLines = function (e, t, n, r) {
14954 typeof t != "number" && (n = t, t = e), n || (n = "ace_step");
14955 var i = new f(e, 0, t, Infinity);
14956 return i.id = this.addMarker(i, n, "fullLine", r), i;
14957 }, this.setAnnotations = function (e) {
14958 this.$annotations = e, this._signal("changeAnnotation", {});
14959 }, this.getAnnotations = function () {
14960 return this.$annotations || [];
14961 }, this.clearAnnotations = function () {
14962 this.setAnnotations([]);
14963 }, this.$detectNewLine = function (e) {
14964 var t = e.match(/^.*?(\r?\n)/m);
14965 t ? this.$autoNewLine = t[1] : this.$autoNewLine = "\n";
14966 }, this.getWordRange = function (e, t) {
14967 var n = this.getLine(e),
14968 r = !1;
14969 t > 0 && (r = !!n.charAt(t - 1).match(this.tokenRe)), r || (r = !!n.charAt(t).match(this.tokenRe));
14970 if (r) var i = this.tokenRe;else if (/^\s+$/.test(n.slice(t - 1, t + 1))) var i = /\s/;else var i = this.nonTokenRe;
14971 var s = t;
14972
14973 if (s > 0) {
14974 do {
14975 s--;
14976 } while (s >= 0 && n.charAt(s).match(i));
14977
14978 s++;
14979 }
14980
14981 var o = t;
14982
14983 while (o < n.length && n.charAt(o).match(i)) {
14984 o++;
14985 }
14986
14987 return new f(e, s, e, o);
14988 }, this.getAWordRange = function (e, t) {
14989 var n = this.getWordRange(e, t),
14990 r = this.getLine(n.end.row);
14991
14992 while (r.charAt(n.end.column).match(/[ \t]/)) {
14993 n.end.column += 1;
14994 }
14995
14996 return n;
14997 }, this.setNewLineMode = function (e) {
14998 this.doc.setNewLineMode(e);
14999 }, this.getNewLineMode = function () {
15000 return this.doc.getNewLineMode();
15001 }, this.setUseWorker = function (e) {
15002 this.setOption("useWorker", e);
15003 }, this.getUseWorker = function () {
15004 return this.$useWorker;
15005 }, this.onReloadTokenizer = function (e) {
15006 var t = e.data;
15007 this.bgTokenizer.start(t.first), this._signal("tokenizerUpdate", e);
15008 }, this.$modes = {}, this.$mode = null, this.$modeId = null, this.setMode = function (e, t) {
15009 if (e && _typeof(e) == "object") {
15010 if (e.getTokenizer) return this.$onChangeMode(e);
15011 var n = e,
15012 r = n.path;
15013 } else r = e || "ace/mode/text";
15014
15015 this.$modes["ace/mode/text"] || (this.$modes["ace/mode/text"] = new a());
15016
15017 if (this.$modes[r] && !n) {
15018 this.$onChangeMode(this.$modes[r]), t && t();
15019 return;
15020 }
15021
15022 this.$modeId = r, s.loadModule(["mode", r], function (e) {
15023 if (this.$modeId !== r) return t && t();
15024 this.$modes[r] && !n ? this.$onChangeMode(this.$modes[r]) : e && e.Mode && (e = new e.Mode(n), n || (this.$modes[r] = e, e.$id = r), this.$onChangeMode(e)), t && t();
15025 }.bind(this)), this.$mode || this.$onChangeMode(this.$modes["ace/mode/text"], !0);
15026 }, this.$onChangeMode = function (e, t) {
15027 t || (this.$modeId = e.$id);
15028 if (this.$mode === e) return;
15029 this.$mode = e, this.$stopWorker(), this.$useWorker && this.$startWorker();
15030 var n = e.getTokenizer();
15031
15032 if (n.addEventListener !== undefined) {
15033 var r = this.onReloadTokenizer.bind(this);
15034 n.addEventListener("update", r);
15035 }
15036
15037 if (!this.bgTokenizer) {
15038 this.bgTokenizer = new c(n);
15039 var i = this;
15040 this.bgTokenizer.addEventListener("update", function (e) {
15041 i._signal("tokenizerUpdate", e);
15042 });
15043 } else this.bgTokenizer.setTokenizer(n);
15044
15045 this.bgTokenizer.setDocument(this.getDocument()), this.tokenRe = e.tokenRe, this.nonTokenRe = e.nonTokenRe, t || (e.attachToSession && e.attachToSession(this), this.$options.wrapMethod.set.call(this, this.$wrapMethod), this.$setFolding(e.foldingRules), this.bgTokenizer.start(0), this._emit("changeMode"));
15046 }, this.$stopWorker = function () {
15047 this.$worker && (this.$worker.terminate(), this.$worker = null);
15048 }, this.$startWorker = function () {
15049 try {
15050 this.$worker = this.$mode.createWorker(this);
15051 } catch (e) {
15052 s.warn("Could not load worker", e), this.$worker = null;
15053 }
15054 }, this.getMode = function () {
15055 return this.$mode;
15056 }, this.$scrollTop = 0, this.setScrollTop = function (e) {
15057 if (this.$scrollTop === e || isNaN(e)) return;
15058 this.$scrollTop = e, this._signal("changeScrollTop", e);
15059 }, this.getScrollTop = function () {
15060 return this.$scrollTop;
15061 }, this.$scrollLeft = 0, this.setScrollLeft = function (e) {
15062 if (this.$scrollLeft === e || isNaN(e)) return;
15063 this.$scrollLeft = e, this._signal("changeScrollLeft", e);
15064 }, this.getScrollLeft = function () {
15065 return this.$scrollLeft;
15066 }, this.getScreenWidth = function () {
15067 return this.$computeWidth(), this.lineWidgets ? Math.max(this.getLineWidgetMaxWidth(), this.screenWidth) : this.screenWidth;
15068 }, this.getLineWidgetMaxWidth = function () {
15069 if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth;
15070 var e = 0;
15071 return this.lineWidgets.forEach(function (t) {
15072 t && t.screenWidth > e && (e = t.screenWidth);
15073 }), this.lineWidgetWidth = e;
15074 }, this.$computeWidth = function (e) {
15075 if (this.$modified || e) {
15076 this.$modified = !1;
15077 if (this.$useWrapMode) return this.screenWidth = this.$wrapLimit;
15078 var t = this.doc.getAllLines(),
15079 n = this.$rowLengthCache,
15080 r = 0,
15081 i = 0,
15082 s = this.$foldData[i],
15083 o = s ? s.start.row : Infinity,
15084 u = t.length;
15085
15086 for (var a = 0; a < u; a++) {
15087 if (a > o) {
15088 a = s.end.row + 1;
15089 if (a >= u) break;
15090 s = this.$foldData[i++], o = s ? s.start.row : Infinity;
15091 }
15092
15093 n[a] == null && (n[a] = this.$getStringScreenWidth(t[a])[0]), n[a] > r && (r = n[a]);
15094 }
15095
15096 this.screenWidth = r;
15097 }
15098 }, this.getLine = function (e) {
15099 return this.doc.getLine(e);
15100 }, this.getLines = function (e, t) {
15101 return this.doc.getLines(e, t);
15102 }, this.getLength = function () {
15103 return this.doc.getLength();
15104 }, this.getTextRange = function (e) {
15105 return this.doc.getTextRange(e || this.selection.getRange());
15106 }, this.insert = function (e, t) {
15107 return this.doc.insert(e, t);
15108 }, this.remove = function (e) {
15109 return this.doc.remove(e);
15110 }, this.removeFullLines = function (e, t) {
15111 return this.doc.removeFullLines(e, t);
15112 }, this.undoChanges = function (e, t) {
15113 if (!e.length) return;
15114 this.$fromUndo = !0;
15115 var n = null;
15116
15117 for (var r = e.length - 1; r != -1; r--) {
15118 var i = e[r];
15119 i.group == "doc" ? (this.doc.revertDeltas(i.deltas), n = this.$getUndoSelection(i.deltas, !0, n)) : i.deltas.forEach(function (e) {
15120 this.addFolds(e.folds);
15121 }, this);
15122 }
15123
15124 return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n), n;
15125 }, this.redoChanges = function (e, t) {
15126 if (!e.length) return;
15127 this.$fromUndo = !0;
15128 var n = null;
15129
15130 for (var r = 0; r < e.length; r++) {
15131 var i = e[r];
15132 i.group == "doc" && (this.doc.applyDeltas(i.deltas), n = this.$getUndoSelection(i.deltas, !1, n));
15133 }
15134
15135 return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n), n;
15136 }, this.setUndoSelect = function (e) {
15137 this.$undoSelect = e;
15138 }, this.$getUndoSelection = function (e, t, n) {
15139 function r(e) {
15140 return t ? e.action !== "insert" : e.action === "insert";
15141 }
15142
15143 var i = e[0],
15144 s,
15145 o,
15146 u = !1;
15147 r(i) ? (s = f.fromPoints(i.start, i.end), u = !0) : (s = f.fromPoints(i.start, i.start), u = !1);
15148
15149 for (var a = 1; a < e.length; a++) {
15150 i = e[a], r(i) ? (o = i.start, s.compare(o.row, o.column) == -1 && s.setStart(o), o = i.end, s.compare(o.row, o.column) == 1 && s.setEnd(o), u = !0) : (o = i.start, s.compare(o.row, o.column) == -1 && (s = f.fromPoints(i.start, i.start)), u = !1);
15151 }
15152
15153 if (n != null) {
15154 f.comparePoints(n.start, s.start) === 0 && (n.start.column += s.end.column - s.start.column, n.end.column += s.end.column - s.start.column);
15155 var l = n.compareRange(s);
15156 l == 1 ? s.setStart(n.start) : l == -1 && s.setEnd(n.end);
15157 }
15158
15159 return s;
15160 }, this.replace = function (e, t) {
15161 return this.doc.replace(e, t);
15162 }, this.moveText = function (e, t, n) {
15163 var r = this.getTextRange(e),
15164 i = this.getFoldsInRange(e),
15165 s = f.fromPoints(t, t);
15166
15167 if (!n) {
15168 this.remove(e);
15169 var o = e.start.row - e.end.row,
15170 u = o ? -e.end.column : e.start.column - e.end.column;
15171 u && (s.start.row == e.end.row && s.start.column > e.end.column && (s.start.column += u), s.end.row == e.end.row && s.end.column > e.end.column && (s.end.column += u)), o && s.start.row >= e.end.row && (s.start.row += o, s.end.row += o);
15172 }
15173
15174 s.end = this.insert(s.start, r);
15175
15176 if (i.length) {
15177 var a = e.start,
15178 l = s.start,
15179 o = l.row - a.row,
15180 u = l.column - a.column;
15181 this.addFolds(i.map(function (e) {
15182 return e = e.clone(), e.start.row == a.row && (e.start.column += u), e.end.row == a.row && (e.end.column += u), e.start.row += o, e.end.row += o, e;
15183 }));
15184 }
15185
15186 return s;
15187 }, this.indentRows = function (e, t, n) {
15188 n = n.replace(/\t/g, this.getTabString());
15189
15190 for (var r = e; r <= t; r++) {
15191 this.doc.insertInLine({
15192 row: r,
15193 column: 0
15194 }, n);
15195 }
15196 }, this.outdentRows = function (e) {
15197 var t = e.collapseRows(),
15198 n = new f(0, 0, 0, 0),
15199 r = this.getTabSize();
15200
15201 for (var i = t.start.row; i <= t.end.row; ++i) {
15202 var s = this.getLine(i);
15203 n.start.row = i, n.end.row = i;
15204
15205 for (var o = 0; o < r; ++o) {
15206 if (s.charAt(o) != " ") break;
15207 }
15208
15209 o < r && s.charAt(o) == " " ? (n.start.column = o, n.end.column = o + 1) : (n.start.column = 0, n.end.column = o), this.remove(n);
15210 }
15211 }, this.$moveLines = function (e, t, n) {
15212 e = this.getRowFoldStart(e), t = this.getRowFoldEnd(t);
15213
15214 if (n < 0) {
15215 var r = this.getRowFoldStart(e + n);
15216 if (r < 0) return 0;
15217 var i = r - e;
15218 } else if (n > 0) {
15219 var r = this.getRowFoldEnd(t + n);
15220 if (r > this.doc.getLength() - 1) return 0;
15221 var i = r - t;
15222 } else {
15223 e = this.$clipRowToDocument(e), t = this.$clipRowToDocument(t);
15224 var i = t - e + 1;
15225 }
15226
15227 var s = new f(e, 0, t, Number.MAX_VALUE),
15228 o = this.getFoldsInRange(s).map(function (e) {
15229 return e = e.clone(), e.start.row += i, e.end.row += i, e;
15230 }),
15231 u = n == 0 ? this.doc.getLines(e, t) : this.doc.removeFullLines(e, t);
15232 return this.doc.insertFullLines(e + i, u), o.length && this.addFolds(o), i;
15233 }, this.moveLinesUp = function (e, t) {
15234 return this.$moveLines(e, t, -1);
15235 }, this.moveLinesDown = function (e, t) {
15236 return this.$moveLines(e, t, 1);
15237 }, this.duplicateLines = function (e, t) {
15238 return this.$moveLines(e, t, 0);
15239 }, this.$clipRowToDocument = function (e) {
15240 return Math.max(0, Math.min(e, this.doc.getLength() - 1));
15241 }, this.$clipColumnToRow = function (e, t) {
15242 return t < 0 ? 0 : Math.min(this.doc.getLine(e).length, t);
15243 }, this.$clipPositionToDocument = function (e, t) {
15244 t = Math.max(0, t);
15245 if (e < 0) e = 0, t = 0;else {
15246 var n = this.doc.getLength();
15247 e >= n ? (e = n - 1, t = this.doc.getLine(n - 1).length) : t = Math.min(this.doc.getLine(e).length, t);
15248 }
15249 return {
15250 row: e,
15251 column: t
15252 };
15253 }, this.$clipRangeToDocument = function (e) {
15254 e.start.row < 0 ? (e.start.row = 0, e.start.column = 0) : e.start.column = this.$clipColumnToRow(e.start.row, e.start.column);
15255 var t = this.doc.getLength() - 1;
15256 return e.end.row > t ? (e.end.row = t, e.end.column = this.doc.getLine(t).length) : e.end.column = this.$clipColumnToRow(e.end.row, e.end.column), e;
15257 }, this.$wrapLimit = 80, this.$useWrapMode = !1, this.$wrapLimitRange = {
15258 min: null,
15259 max: null
15260 }, this.setUseWrapMode = function (e) {
15261 if (e != this.$useWrapMode) {
15262 this.$useWrapMode = e, this.$modified = !0, this.$resetRowCache(0);
15263
15264 if (e) {
15265 var t = this.getLength();
15266 this.$wrapData = Array(t), this.$updateWrapData(0, t - 1);
15267 }
15268
15269 this._signal("changeWrapMode");
15270 }
15271 }, this.getUseWrapMode = function () {
15272 return this.$useWrapMode;
15273 }, this.setWrapLimitRange = function (e, t) {
15274 if (this.$wrapLimitRange.min !== e || this.$wrapLimitRange.max !== t) this.$wrapLimitRange = {
15275 min: e,
15276 max: t
15277 }, this.$modified = !0, this.$useWrapMode && this._signal("changeWrapMode");
15278 }, this.adjustWrapLimit = function (e, t) {
15279 var n = this.$wrapLimitRange;
15280 n.max < 0 && (n = {
15281 min: t,
15282 max: t
15283 });
15284 var r = this.$constrainWrapLimit(e, n.min, n.max);
15285 return r != this.$wrapLimit && r > 1 ? (this.$wrapLimit = r, this.$modified = !0, this.$useWrapMode && (this.$updateWrapData(0, this.getLength() - 1), this.$resetRowCache(0), this._signal("changeWrapLimit")), !0) : !1;
15286 }, this.$constrainWrapLimit = function (e, t, n) {
15287 return t && (e = Math.max(t, e)), n && (e = Math.min(n, e)), e;
15288 }, this.getWrapLimit = function () {
15289 return this.$wrapLimit;
15290 }, this.setWrapLimit = function (e) {
15291 this.setWrapLimitRange(e, e);
15292 }, this.getWrapLimitRange = function () {
15293 return {
15294 min: this.$wrapLimitRange.min,
15295 max: this.$wrapLimitRange.max
15296 };
15297 }, this.$updateInternalDataOnChange = function (e) {
15298 var t = this.$useWrapMode,
15299 n = e.action,
15300 r = e.start,
15301 i = e.end,
15302 s = r.row,
15303 o = i.row,
15304 u = o - s,
15305 a = null;
15306 this.$updating = !0;
15307 if (u != 0) {
15308 if (n === "remove") {
15309 this[t ? "$wrapData" : "$rowLengthCache"].splice(s, u);
15310 var f = this.$foldData;
15311 a = this.getFoldsInRange(e), this.removeFolds(a);
15312 var l = this.getFoldLine(i.row),
15313 c = 0;
15314
15315 if (l) {
15316 l.addRemoveChars(i.row, i.column, r.column - i.column), l.shiftRow(-u);
15317 var h = this.getFoldLine(s);
15318 h && h !== l && (h.merge(l), l = h), c = f.indexOf(l) + 1;
15319 }
15320
15321 for (c; c < f.length; c++) {
15322 var l = f[c];
15323 l.start.row >= i.row && l.shiftRow(-u);
15324 }
15325
15326 o = s;
15327 } else {
15328 var p = Array(u);
15329 p.unshift(s, 0);
15330 var d = t ? this.$wrapData : this.$rowLengthCache;
15331 d.splice.apply(d, p);
15332 var f = this.$foldData,
15333 l = this.getFoldLine(s),
15334 c = 0;
15335
15336 if (l) {
15337 var v = l.range.compareInside(r.row, r.column);
15338 v == 0 ? (l = l.split(r.row, r.column), l && (l.shiftRow(u), l.addRemoveChars(o, 0, i.column - r.column))) : v == -1 && (l.addRemoveChars(s, 0, i.column - r.column), l.shiftRow(u)), c = f.indexOf(l) + 1;
15339 }
15340
15341 for (c; c < f.length; c++) {
15342 var l = f[c];
15343 l.start.row >= s && l.shiftRow(u);
15344 }
15345 }
15346 } else {
15347 u = Math.abs(e.start.column - e.end.column), n === "remove" && (a = this.getFoldsInRange(e), this.removeFolds(a), u = -u);
15348 var l = this.getFoldLine(s);
15349 l && l.addRemoveChars(s, r.column, u);
15350 }
15351 return t && this.$wrapData.length != this.doc.getLength() && console.error("doc.getLength() and $wrapData.length have to be the same!"), this.$updating = !1, t ? this.$updateWrapData(s, o) : this.$updateRowLengthCache(s, o), a;
15352 }, this.$updateRowLengthCache = function (e, t, n) {
15353 this.$rowLengthCache[e] = null, this.$rowLengthCache[t] = null;
15354 }, this.$updateWrapData = function (e, t) {
15355 var r = this.doc.getAllLines(),
15356 i = this.getTabSize(),
15357 s = this.$wrapData,
15358 o = this.$wrapLimit,
15359 a,
15360 f,
15361 l = e;
15362 t = Math.min(t, r.length - 1);
15363
15364 while (l <= t) {
15365 f = this.getFoldLine(l, f), f ? (a = [], f.walk(function (e, t, i, s) {
15366 var o;
15367
15368 if (e != null) {
15369 o = this.$getDisplayTokens(e, a.length), o[0] = n;
15370
15371 for (var f = 1; f < o.length; f++) {
15372 o[f] = u;
15373 }
15374 } else o = this.$getDisplayTokens(r[t].substring(s, i), a.length);
15375
15376 a = a.concat(o);
15377 }.bind(this), f.end.row, r[f.end.row].length + 1), s[f.start.row] = this.$computeWrapSplits(a, o, i), l = f.end.row + 1) : (a = this.$getDisplayTokens(r[l]), s[l] = this.$computeWrapSplits(a, o, i), l++);
15378 }
15379 };
15380 var e = 1,
15381 t = 2,
15382 n = 3,
15383 u = 4,
15384 l = 9,
15385 p = 10,
15386 d = 11,
15387 v = 12;
15388 this.$computeWrapSplits = function (e, r, i) {
15389 function g() {
15390 var t = 0;
15391 if (m === 0) return t;
15392 if (h) for (var n = 0; n < e.length; n++) {
15393 var r = e[n];
15394 if (r == p) t += 1;else {
15395 if (r != d) {
15396 if (r == v) continue;
15397 break;
15398 }
15399
15400 t += i;
15401 }
15402 }
15403 return c && h !== !1 && (t += i), Math.min(t, m);
15404 }
15405
15406 function y(t) {
15407 var n = e.slice(a, t),
15408 r = n.length;
15409 n.join("").replace(/12/g, function () {
15410 r -= 1;
15411 }).replace(/2/g, function () {
15412 r -= 1;
15413 }), s.length || (b = g(), s.indent = b), f += r, s.push(f), a = t;
15414 }
15415
15416 if (e.length == 0) return [];
15417 var s = [],
15418 o = e.length,
15419 a = 0,
15420 f = 0,
15421 c = this.$wrapAsCode,
15422 h = this.$indentedSoftWrap,
15423 m = r <= Math.max(2 * i, 8) || h === !1 ? 0 : Math.floor(r / 2),
15424 b = 0;
15425
15426 while (o - a > r - b) {
15427 var w = a + r - b;
15428
15429 if (e[w - 1] >= p && e[w] >= p) {
15430 y(w);
15431 continue;
15432 }
15433
15434 if (e[w] == n || e[w] == u) {
15435 for (w; w != a - 1; w--) {
15436 if (e[w] == n) break;
15437 }
15438
15439 if (w > a) {
15440 y(w);
15441 continue;
15442 }
15443
15444 w = a + r;
15445
15446 for (w; w < e.length; w++) {
15447 if (e[w] != u) break;
15448 }
15449
15450 if (w == e.length) break;
15451 y(w);
15452 continue;
15453 }
15454
15455 var E = Math.max(w - (r - (r >> 2)), a - 1);
15456
15457 while (w > E && e[w] < n) {
15458 w--;
15459 }
15460
15461 if (c) {
15462 while (w > E && e[w] < n) {
15463 w--;
15464 }
15465
15466 while (w > E && e[w] == l) {
15467 w--;
15468 }
15469 } else while (w > E && e[w] < p) {
15470 w--;
15471 }
15472
15473 if (w > E) {
15474 y(++w);
15475 continue;
15476 }
15477
15478 w = a + r, e[w] == t && w--, y(w - b);
15479 }
15480
15481 return s;
15482 }, this.$getDisplayTokens = function (n, r) {
15483 var i = [],
15484 s;
15485 r = r || 0;
15486
15487 for (var o = 0; o < n.length; o++) {
15488 var u = n.charCodeAt(o);
15489
15490 if (u == 9) {
15491 s = this.getScreenTabSize(i.length + r), i.push(d);
15492
15493 for (var a = 1; a < s; a++) {
15494 i.push(v);
15495 }
15496 } else u == 32 ? i.push(p) : u > 39 && u < 48 || u > 57 && u < 64 ? i.push(l) : u >= 4352 && m(u) ? i.push(e, t) : i.push(e);
15497 }
15498
15499 return i;
15500 }, this.$getStringScreenWidth = function (e, t, n) {
15501 if (t == 0) return [0, 0];
15502 t == null && (t = Infinity), n = n || 0;
15503 var r, i;
15504
15505 for (i = 0; i < e.length; i++) {
15506 r = e.charCodeAt(i), r == 9 ? n += this.getScreenTabSize(n) : r >= 4352 && m(r) ? n += 2 : n += 1;
15507 if (n > t) break;
15508 }
15509
15510 return [n, i];
15511 }, this.lineWidgets = null, this.getRowLength = function (e) {
15512 if (this.lineWidgets) var t = this.lineWidgets[e] && this.lineWidgets[e].rowCount || 0;else t = 0;
15513 return !this.$useWrapMode || !this.$wrapData[e] ? 1 + t : this.$wrapData[e].length + 1 + t;
15514 }, this.getRowLineCount = function (e) {
15515 return !this.$useWrapMode || !this.$wrapData[e] ? 1 : this.$wrapData[e].length + 1;
15516 }, this.getRowWrapIndent = function (e) {
15517 if (this.$useWrapMode) {
15518 var t = this.screenToDocumentPosition(e, Number.MAX_VALUE),
15519 n = this.$wrapData[t.row];
15520 return n.length && n[0] < t.column ? n.indent : 0;
15521 }
15522
15523 return 0;
15524 }, this.getScreenLastRowColumn = function (e) {
15525 var t = this.screenToDocumentPosition(e, Number.MAX_VALUE);
15526 return this.documentToScreenColumn(t.row, t.column);
15527 }, this.getDocumentLastRowColumn = function (e, t) {
15528 var n = this.documentToScreenRow(e, t);
15529 return this.getScreenLastRowColumn(n);
15530 }, this.getDocumentLastRowColumnPosition = function (e, t) {
15531 var n = this.documentToScreenRow(e, t);
15532 return this.screenToDocumentPosition(n, Number.MAX_VALUE / 10);
15533 }, this.getRowSplitData = function (e) {
15534 return this.$useWrapMode ? this.$wrapData[e] : undefined;
15535 }, this.getScreenTabSize = function (e) {
15536 return this.$tabSize - e % this.$tabSize;
15537 }, this.screenToDocumentRow = function (e, t) {
15538 return this.screenToDocumentPosition(e, t).row;
15539 }, this.screenToDocumentColumn = function (e, t) {
15540 return this.screenToDocumentPosition(e, t).column;
15541 }, this.screenToDocumentPosition = function (e, t) {
15542 if (e < 0) return {
15543 row: 0,
15544 column: 0
15545 };
15546 var n,
15547 r = 0,
15548 i = 0,
15549 s,
15550 o = 0,
15551 u = 0,
15552 a = this.$screenRowCache,
15553 f = this.$getRowCacheIndex(a, e),
15554 l = a.length;
15555 if (l && f >= 0) var o = a[f],
15556 r = this.$docRowCache[f],
15557 c = e > a[l - 1];else var c = !l;
15558 var h = this.getLength() - 1,
15559 p = this.getNextFoldLine(r),
15560 d = p ? p.start.row : Infinity;
15561
15562 while (o <= e) {
15563 u = this.getRowLength(r);
15564 if (o + u > e || r >= h) break;
15565 o += u, r++, r > d && (r = p.end.row + 1, p = this.getNextFoldLine(r, p), d = p ? p.start.row : Infinity), c && (this.$docRowCache.push(r), this.$screenRowCache.push(o));
15566 }
15567
15568 if (p && p.start.row <= r) n = this.getFoldDisplayLine(p), r = p.start.row;else {
15569 if (o + u <= e || r > h) return {
15570 row: h,
15571 column: this.getLine(h).length
15572 };
15573 n = this.getLine(r), p = null;
15574 }
15575 var v = 0;
15576
15577 if (this.$useWrapMode) {
15578 var m = this.$wrapData[r];
15579
15580 if (m) {
15581 var g = Math.floor(e - o);
15582 s = m[g], g > 0 && m.length && (v = m.indent, i = m[g - 1] || m[m.length - 1], n = n.substring(i));
15583 }
15584 }
15585
15586 return i += this.$getStringScreenWidth(n, t - v)[1], this.$useWrapMode && i >= s && (i = s - 1), p ? p.idxToPosition(i) : {
15587 row: r,
15588 column: i
15589 };
15590 }, this.documentToScreenPosition = function (e, t) {
15591 if (typeof t == "undefined") var n = this.$clipPositionToDocument(e.row, e.column);else n = this.$clipPositionToDocument(e, t);
15592 e = n.row, t = n.column;
15593 var r = 0,
15594 i = null,
15595 s = null;
15596 s = this.getFoldAt(e, t, 1), s && (e = s.start.row, t = s.start.column);
15597 var o,
15598 u = 0,
15599 a = this.$docRowCache,
15600 f = this.$getRowCacheIndex(a, e),
15601 l = a.length;
15602 if (l && f >= 0) var u = a[f],
15603 r = this.$screenRowCache[f],
15604 c = e > a[l - 1];else var c = !l;
15605 var h = this.getNextFoldLine(u),
15606 p = h ? h.start.row : Infinity;
15607
15608 while (u < e) {
15609 if (u >= p) {
15610 o = h.end.row + 1;
15611 if (o > e) break;
15612 h = this.getNextFoldLine(o, h), p = h ? h.start.row : Infinity;
15613 } else o = u + 1;
15614
15615 r += this.getRowLength(u), u = o, c && (this.$docRowCache.push(u), this.$screenRowCache.push(r));
15616 }
15617
15618 var d = "";
15619 h && u >= p ? (d = this.getFoldDisplayLine(h, e, t), i = h.start.row) : (d = this.getLine(e).substring(0, t), i = e);
15620 var v = 0;
15621
15622 if (this.$useWrapMode) {
15623 var m = this.$wrapData[i];
15624
15625 if (m) {
15626 var g = 0;
15627
15628 while (d.length >= m[g]) {
15629 r++, g++;
15630 }
15631
15632 d = d.substring(m[g - 1] || 0, d.length), v = g > 0 ? m.indent : 0;
15633 }
15634 }
15635
15636 return {
15637 row: r,
15638 column: v + this.$getStringScreenWidth(d)[0]
15639 };
15640 }, this.documentToScreenColumn = function (e, t) {
15641 return this.documentToScreenPosition(e, t).column;
15642 }, this.documentToScreenRow = function (e, t) {
15643 return this.documentToScreenPosition(e, t).row;
15644 }, this.getScreenLength = function () {
15645 var e = 0,
15646 t = null;
15647
15648 if (!this.$useWrapMode) {
15649 e = this.getLength();
15650 var n = this.$foldData;
15651
15652 for (var r = 0; r < n.length; r++) {
15653 t = n[r], e -= t.end.row - t.start.row;
15654 }
15655 } else {
15656 var i = this.$wrapData.length,
15657 s = 0,
15658 r = 0,
15659 t = this.$foldData[r++],
15660 o = t ? t.start.row : Infinity;
15661
15662 while (s < i) {
15663 var u = this.$wrapData[s];
15664 e += u ? u.length + 1 : 1, s++, s > o && (s = t.end.row + 1, t = this.$foldData[r++], o = t ? t.start.row : Infinity);
15665 }
15666 }
15667
15668 return this.lineWidgets && (e += this.$getWidgetScreenLength()), e;
15669 }, this.$setFontMetrics = function (e) {
15670 if (!this.$enableVarChar) return;
15671
15672 this.$getStringScreenWidth = function (t, n, r) {
15673 if (n === 0) return [0, 0];
15674 n || (n = Infinity), r = r || 0;
15675 var i, s;
15676
15677 for (s = 0; s < t.length; s++) {
15678 i = t.charAt(s), i === " " ? r += this.getScreenTabSize(r) : r += e.getCharacterWidth(i);
15679 if (r > n) break;
15680 }
15681
15682 return [r, s];
15683 };
15684 }, this.destroy = function () {
15685 this.bgTokenizer && (this.bgTokenizer.setDocument(null), this.bgTokenizer = null), this.$stopWorker();
15686 };
15687 }.call(p.prototype), e("./edit_session/folding").Folding.call(p.prototype), e("./edit_session/bracket_match").BracketMatch.call(p.prototype), s.defineOptions(p.prototype, "session", {
15688 wrap: {
15689 set: function set(e) {
15690 !e || e == "off" ? e = !1 : e == "free" ? e = !0 : e == "printMargin" ? e = -1 : typeof e == "string" && (e = parseInt(e, 10) || !1);
15691 if (this.$wrap == e) return;
15692 this.$wrap = e;
15693 if (!e) this.setUseWrapMode(!1);else {
15694 var t = typeof e == "number" ? e : null;
15695 this.setWrapLimitRange(t, t), this.setUseWrapMode(!0);
15696 }
15697 },
15698 get: function get() {
15699 return this.getUseWrapMode() ? this.$wrap == -1 ? "printMargin" : this.getWrapLimitRange().min ? this.$wrap : "free" : "off";
15700 },
15701 handlesSet: !0
15702 },
15703 wrapMethod: {
15704 set: function set(e) {
15705 e = e == "auto" ? this.$mode.type != "text" : e != "text", e != this.$wrapAsCode && (this.$wrapAsCode = e, this.$useWrapMode && (this.$modified = !0, this.$resetRowCache(0), this.$updateWrapData(0, this.getLength() - 1)));
15706 },
15707 initialValue: "auto"
15708 },
15709 indentedSoftWrap: {
15710 initialValue: !0
15711 },
15712 firstLineNumber: {
15713 set: function set() {
15714 this._signal("changeBreakpoint");
15715 },
15716 initialValue: 1
15717 },
15718 useWorker: {
15719 set: function set(e) {
15720 this.$useWorker = e, this.$stopWorker(), e && this.$startWorker();
15721 },
15722 initialValue: !0
15723 },
15724 useSoftTabs: {
15725 initialValue: !0
15726 },
15727 tabSize: {
15728 set: function set(e) {
15729 if (isNaN(e) || this.$tabSize === e) return;
15730 this.$modified = !0, this.$rowLengthCache = [], this.$tabSize = e, this._signal("changeTabSize");
15731 },
15732 initialValue: 4,
15733 handlesSet: !0
15734 },
15735 navigateWithinSoftTabs: {
15736 initialValue: !1
15737 },
15738 overwrite: {
15739 set: function set(e) {
15740 this._signal("changeOverwrite");
15741 },
15742 initialValue: !1
15743 },
15744 newLineMode: {
15745 set: function set(e) {
15746 this.doc.setNewLineMode(e);
15747 },
15748 get: function get() {
15749 return this.doc.getNewLineMode();
15750 },
15751 handlesSet: !0
15752 },
15753 mode: {
15754 set: function set(e) {
15755 this.setMode(e);
15756 },
15757 get: function get() {
15758 return this.$modeId;
15759 }
15760 }
15761 }), t.EditSession = p;
15762 }), ace.define("ace/search", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/range"], function (e, t, n) {
15763 "use strict";
15764
15765 function u(e, t) {
15766 function n(e) {
15767 return /\w/.test(e) || t.regExp ? "\\b" : "";
15768 }
15769
15770 return n(e[0]) + e + n(e[e.length - 1]);
15771 }
15772
15773 var r = e("./lib/lang"),
15774 i = e("./lib/oop"),
15775 s = e("./range").Range,
15776 o = function o() {
15777 this.$options = {};
15778 };
15779
15780 (function () {
15781 this.set = function (e) {
15782 return i.mixin(this.$options, e), this;
15783 }, this.getOptions = function () {
15784 return r.copyObject(this.$options);
15785 }, this.setOptions = function (e) {
15786 this.$options = e;
15787 }, this.find = function (e) {
15788 var t = this.$options,
15789 n = this.$matchIterator(e, t);
15790 if (!n) return !1;
15791 var r = null;
15792 return n.forEach(function (e, n, i, o) {
15793 return r = new s(e, n, i, o), n == o && t.start && t.start.start && t.skipCurrent != 0 && r.isEqual(t.start) ? (r = null, !1) : !0;
15794 }), r;
15795 }, this.findAll = function (e) {
15796 var t = this.$options;
15797 if (!t.needle) return [];
15798 this.$assembleRegExp(t);
15799 var n = t.range,
15800 i = n ? e.getLines(n.start.row, n.end.row) : e.doc.getAllLines(),
15801 o = [],
15802 u = t.re;
15803
15804 if (t.$isMultiLine) {
15805 var a = u.length,
15806 f = i.length - a,
15807 l;
15808
15809 e: for (var c = u.offset || 0; c <= f; c++) {
15810 for (var h = 0; h < a; h++) {
15811 if (i[c + h].search(u[h]) == -1) continue e;
15812 }
15813
15814 var p = i[c],
15815 d = i[c + a - 1],
15816 v = p.length - p.match(u[0])[0].length,
15817 m = d.match(u[a - 1])[0].length;
15818 if (l && l.end.row === c && l.end.column > v) continue;
15819 o.push(l = new s(c, v, c + a - 1, m)), a > 2 && (c = c + a - 2);
15820 }
15821 } else for (var g = 0; g < i.length; g++) {
15822 var y = r.getMatchOffsets(i[g], u);
15823
15824 for (var h = 0; h < y.length; h++) {
15825 var b = y[h];
15826 o.push(new s(g, b.offset, g, b.offset + b.length));
15827 }
15828 }
15829
15830 if (n) {
15831 var w = n.start.column,
15832 E = n.start.column,
15833 g = 0,
15834 h = o.length - 1;
15835
15836 while (g < h && o[g].start.column < w && o[g].start.row == n.start.row) {
15837 g++;
15838 }
15839
15840 while (g < h && o[h].end.column > E && o[h].end.row == n.end.row) {
15841 h--;
15842 }
15843
15844 o = o.slice(g, h + 1);
15845
15846 for (g = 0, h = o.length; g < h; g++) {
15847 o[g].start.row += n.start.row, o[g].end.row += n.start.row;
15848 }
15849 }
15850
15851 return o;
15852 }, this.replace = function (e, t) {
15853 var n = this.$options,
15854 r = this.$assembleRegExp(n);
15855 if (n.$isMultiLine) return t;
15856 if (!r) return;
15857 var i = r.exec(e);
15858 if (!i || i[0].length != e.length) return null;
15859 t = e.replace(r, t);
15860
15861 if (n.preserveCase) {
15862 t = t.split("");
15863
15864 for (var s = Math.min(e.length, e.length); s--;) {
15865 var o = e[s];
15866 o && o.toLowerCase() != o ? t[s] = t[s].toUpperCase() : t[s] = t[s].toLowerCase();
15867 }
15868
15869 t = t.join("");
15870 }
15871
15872 return t;
15873 }, this.$assembleRegExp = function (e, t) {
15874 if (e.needle instanceof RegExp) return e.re = e.needle;
15875 var n = e.needle;
15876 if (!e.needle) return e.re = !1;
15877 e.regExp || (n = r.escapeRegExp(n)), e.wholeWord && (n = u(n, e));
15878 var i = e.caseSensitive ? "gm" : "gmi";
15879 e.$isMultiLine = !t && /[\n\r]/.test(n);
15880 if (e.$isMultiLine) return e.re = this.$assembleMultilineRegExp(n, i);
15881
15882 try {
15883 var s = new RegExp(n, i);
15884 } catch (o) {
15885 s = !1;
15886 }
15887
15888 return e.re = s;
15889 }, this.$assembleMultilineRegExp = function (e, t) {
15890 var n = e.replace(/\r\n|\r|\n/g, "$\n^").split("\n"),
15891 r = [];
15892
15893 for (var i = 0; i < n.length; i++) {
15894 try {
15895 r.push(new RegExp(n[i], t));
15896 } catch (s) {
15897 return !1;
15898 }
15899 }
15900
15901 return r;
15902 }, this.$matchIterator = function (e, t) {
15903 var n = this.$assembleRegExp(t);
15904 if (!n) return !1;
15905 var r = t.backwards == 1,
15906 i = t.skipCurrent != 0,
15907 s = t.range,
15908 o = t.start;
15909 o || (o = s ? s[r ? "end" : "start"] : e.selection.getRange()), o.start && (o = o[i != r ? "end" : "start"]);
15910 var u = s ? s.start.row : 0,
15911 a = s ? s.end.row : e.getLength() - 1;
15912 if (r) var f = function f(e) {
15913 var n = o.row;
15914 if (c(n, o.column, e)) return;
15915
15916 for (n--; n >= u; n--) {
15917 if (c(n, Number.MAX_VALUE, e)) return;
15918 }
15919
15920 if (t.wrap == 0) return;
15921
15922 for (n = a, u = o.row; n >= u; n--) {
15923 if (c(n, Number.MAX_VALUE, e)) return;
15924 }
15925 };else var f = function f(e) {
15926 var n = o.row;
15927 if (c(n, o.column, e)) return;
15928
15929 for (n += 1; n <= a; n++) {
15930 if (c(n, 0, e)) return;
15931 }
15932
15933 if (t.wrap == 0) return;
15934
15935 for (n = u, a = o.row; n <= a; n++) {
15936 if (c(n, 0, e)) return;
15937 }
15938 };
15939 if (t.$isMultiLine) var l = n.length,
15940 c = function c(t, i, s) {
15941 var o = r ? t - l + 1 : t;
15942 if (o < 0) return;
15943 var u = e.getLine(o),
15944 a = u.search(n[0]);
15945 if (!r && a < i || a === -1) return;
15946
15947 for (var f = 1; f < l; f++) {
15948 u = e.getLine(o + f);
15949 if (u.search(n[f]) == -1) return;
15950 }
15951
15952 var c = u.match(n[l - 1])[0].length;
15953 if (r && c > i) return;
15954 if (s(o, a, o + l - 1, c)) return !0;
15955 };else if (r) var c = function c(t, r, i) {
15956 var s = e.getLine(t),
15957 o = [],
15958 u,
15959 a = 0;
15960 n.lastIndex = 0;
15961
15962 while (u = n.exec(s)) {
15963 var f = u[0].length;
15964 a = u.index;
15965
15966 if (!f) {
15967 if (a >= s.length) break;
15968 n.lastIndex = a += 1;
15969 }
15970
15971 if (u.index + f > r) break;
15972 o.push(u.index, f);
15973 }
15974
15975 for (var l = o.length - 1; l >= 0; l -= 2) {
15976 var c = o[l - 1],
15977 f = o[l];
15978 if (i(t, c, t, c + f)) return !0;
15979 }
15980 };else var c = function c(t, r, i) {
15981 var s = e.getLine(t),
15982 o,
15983 u = r;
15984 n.lastIndex = r;
15985
15986 while (o = n.exec(s)) {
15987 var a = o[0].length;
15988 u = o.index;
15989 if (i(t, u, t, u + a)) return !0;
15990
15991 if (!a) {
15992 n.lastIndex = u += 1;
15993 if (u >= s.length) return !1;
15994 }
15995 }
15996 };
15997 return {
15998 forEach: f
15999 };
16000 };
16001 }).call(o.prototype), t.Search = o;
16002 }), ace.define("ace/keyboard/hash_handler", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function (e, t, n) {
16003 "use strict";
16004
16005 function o(e, t) {
16006 this.platform = t || (i.isMac ? "mac" : "win"), this.commands = {}, this.commandKeyBinding = {}, this.addCommands(e), this.$singleCommand = !0;
16007 }
16008
16009 function u(e, t) {
16010 o.call(this, e, t), this.$singleCommand = !1;
16011 }
16012
16013 var r = e("../lib/keys"),
16014 i = e("../lib/useragent"),
16015 s = r.KEY_MODS;
16016 u.prototype = o.prototype, function () {
16017 function e(e) {
16018 return _typeof(e) == "object" && e.bindKey && e.bindKey.position || (e.isDefault ? -100 : 0);
16019 }
16020
16021 this.addCommand = function (e) {
16022 this.commands[e.name] && this.removeCommand(e), this.commands[e.name] = e, e.bindKey && this._buildKeyHash(e);
16023 }, this.removeCommand = function (e, t) {
16024 var n = e && (typeof e == "string" ? e : e.name);
16025 e = this.commands[n], t || delete this.commands[n];
16026 var r = this.commandKeyBinding;
16027
16028 for (var i in r) {
16029 var s = r[i];
16030 if (s == e) delete r[i];else if (Array.isArray(s)) {
16031 var o = s.indexOf(e);
16032 o != -1 && (s.splice(o, 1), s.length == 1 && (r[i] = s[0]));
16033 }
16034 }
16035 }, this.bindKey = function (e, t, n) {
16036 _typeof(e) == "object" && e && (n == undefined && (n = e.position), e = e[this.platform]);
16037 if (!e) return;
16038 if (typeof t == "function") return this.addCommand({
16039 exec: t,
16040 bindKey: e,
16041 name: t.name || e
16042 });
16043 e.split("|").forEach(function (e) {
16044 var r = "";
16045
16046 if (e.indexOf(" ") != -1) {
16047 var i = e.split(/\s+/);
16048 e = i.pop(), i.forEach(function (e) {
16049 var t = this.parseKeys(e),
16050 n = s[t.hashId] + t.key;
16051 r += (r ? " " : "") + n, this._addCommandToBinding(r, "chainKeys");
16052 }, this), r += " ";
16053 }
16054
16055 var o = this.parseKeys(e),
16056 u = s[o.hashId] + o.key;
16057
16058 this._addCommandToBinding(r + u, t, n);
16059 }, this);
16060 }, this._addCommandToBinding = function (t, n, r) {
16061 var i = this.commandKeyBinding,
16062 s;
16063 if (!n) delete i[t];else if (!i[t] || this.$singleCommand) i[t] = n;else {
16064 Array.isArray(i[t]) ? (s = i[t].indexOf(n)) != -1 && i[t].splice(s, 1) : i[t] = [i[t]], typeof r != "number" && (r = e(n));
16065 var o = i[t];
16066
16067 for (s = 0; s < o.length; s++) {
16068 var u = o[s],
16069 a = e(u);
16070 if (a > r) break;
16071 }
16072
16073 o.splice(s, 0, n);
16074 }
16075 }, this.addCommands = function (e) {
16076 e && Object.keys(e).forEach(function (t) {
16077 var n = e[t];
16078 if (!n) return;
16079 if (typeof n == "string") return this.bindKey(n, t);
16080 typeof n == "function" && (n = {
16081 exec: n
16082 });
16083 if (_typeof(n) != "object") return;
16084 n.name || (n.name = t), this.addCommand(n);
16085 }, this);
16086 }, this.removeCommands = function (e) {
16087 Object.keys(e).forEach(function (t) {
16088 this.removeCommand(e[t]);
16089 }, this);
16090 }, this.bindKeys = function (e) {
16091 Object.keys(e).forEach(function (t) {
16092 this.bindKey(t, e[t]);
16093 }, this);
16094 }, this._buildKeyHash = function (e) {
16095 this.bindKey(e.bindKey, e);
16096 }, this.parseKeys = function (e) {
16097 var t = e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function (e) {
16098 return e;
16099 }),
16100 n = t.pop(),
16101 i = r[n];
16102 if (r.FUNCTION_KEYS[i]) n = r.FUNCTION_KEYS[i].toLowerCase();else {
16103 if (!t.length) return {
16104 key: n,
16105 hashId: -1
16106 };
16107 if (t.length == 1 && t[0] == "shift") return {
16108 key: n.toUpperCase(),
16109 hashId: -1
16110 };
16111 }
16112 var s = 0;
16113
16114 for (var o = t.length; o--;) {
16115 var u = r.KEY_MODS[t[o]];
16116 if (u == null) return typeof console != "undefined" && console.error("invalid modifier " + t[o] + " in " + e), !1;
16117 s |= u;
16118 }
16119
16120 return {
16121 key: n,
16122 hashId: s
16123 };
16124 }, this.findKeyCommand = function (t, n) {
16125 var r = s[t] + n;
16126 return this.commandKeyBinding[r];
16127 }, this.handleKeyboard = function (e, t, n, r) {
16128 if (r < 0) return;
16129 var i = s[t] + n,
16130 o = this.commandKeyBinding[i];
16131 e.$keyChain && (e.$keyChain += " " + i, o = this.commandKeyBinding[e.$keyChain] || o);
16132 if (o) if (o == "chainKeys" || o[o.length - 1] == "chainKeys") return e.$keyChain = e.$keyChain || i, {
16133 command: "null"
16134 };
16135 if (e.$keyChain) if (!!t && t != 4 || n.length != 1) {
16136 if (t == -1 || r > 0) e.$keyChain = "";
16137 } else e.$keyChain = e.$keyChain.slice(0, -i.length - 1);
16138 return {
16139 command: o
16140 };
16141 }, this.getStatusText = function (e, t) {
16142 return t.$keyChain || "";
16143 };
16144 }.call(o.prototype), t.HashHandler = o, t.MultiHashHandler = u;
16145 }), ace.define("ace/commands/command_manager", ["require", "exports", "module", "ace/lib/oop", "ace/keyboard/hash_handler", "ace/lib/event_emitter"], function (e, t, n) {
16146 "use strict";
16147
16148 var r = e("../lib/oop"),
16149 i = e("../keyboard/hash_handler").MultiHashHandler,
16150 s = e("../lib/event_emitter").EventEmitter,
16151 o = function o(e, t) {
16152 i.call(this, t, e), this.byName = this.commands, this.setDefaultHandler("exec", function (e) {
16153 return e.command.exec(e.editor, e.args || {});
16154 });
16155 };
16156
16157 r.inherits(o, i), function () {
16158 r.implement(this, s), this.exec = function (e, t, n) {
16159 if (Array.isArray(e)) {
16160 for (var r = e.length; r--;) {
16161 if (this.exec(e[r], t, n)) return !0;
16162 }
16163
16164 return !1;
16165 }
16166
16167 typeof e == "string" && (e = this.commands[e]);
16168 if (!e) return !1;
16169 if (t && t.$readOnly && !e.readOnly) return !1;
16170 if (e.isAvailable && !e.isAvailable(t)) return !1;
16171 var i = {
16172 editor: t,
16173 command: e,
16174 args: n
16175 };
16176 return i.returnValue = this._emit("exec", i), this._signal("afterExec", i), i.returnValue === !1 ? !1 : !0;
16177 }, this.toggleRecording = function (e) {
16178 if (this.$inReplay) return;
16179 return e && e._emit("changeStatus"), this.recording ? (this.macro.pop(), this.removeEventListener("exec", this.$addCommandToMacro), this.macro.length || (this.macro = this.oldMacro), this.recording = !1) : (this.$addCommandToMacro || (this.$addCommandToMacro = function (e) {
16180 this.macro.push([e.command, e.args]);
16181 }.bind(this)), this.oldMacro = this.macro, this.macro = [], this.on("exec", this.$addCommandToMacro), this.recording = !0);
16182 }, this.replay = function (e) {
16183 if (this.$inReplay || !this.macro) return;
16184 if (this.recording) return this.toggleRecording(e);
16185
16186 try {
16187 this.$inReplay = !0, this.macro.forEach(function (t) {
16188 typeof t == "string" ? this.exec(t, e) : this.exec(t[0], e, t[1]);
16189 }, this);
16190 } finally {
16191 this.$inReplay = !1;
16192 }
16193 }, this.trimMacro = function (e) {
16194 return e.map(function (e) {
16195 return typeof e[0] != "string" && (e[0] = e[0].name), e[1] || (e = e[0]), e;
16196 });
16197 };
16198 }.call(o.prototype), t.CommandManager = o;
16199 }), ace.define("ace/commands/default_commands", ["require", "exports", "module", "ace/lib/lang", "ace/config", "ace/range"], function (e, t, n) {
16200 "use strict";
16201
16202 function o(e, t) {
16203 return {
16204 win: e,
16205 mac: t
16206 };
16207 }
16208
16209 var r = e("../lib/lang"),
16210 i = e("../config"),
16211 s = e("../range").Range;
16212 t.commands = [{
16213 name: "showSettingsMenu",
16214 bindKey: o("Ctrl-,", "Command-,"),
16215 exec: function exec(e) {
16216 i.loadModule("ace/ext/settings_menu", function (t) {
16217 t.init(e), e.showSettingsMenu();
16218 });
16219 },
16220 readOnly: !0
16221 }, {
16222 name: "goToNextError",
16223 bindKey: o("Alt-E", "F4"),
16224 exec: function exec(e) {
16225 i.loadModule("ace/ext/error_marker", function (t) {
16226 t.showErrorMarker(e, 1);
16227 });
16228 },
16229 scrollIntoView: "animate",
16230 readOnly: !0
16231 }, {
16232 name: "goToPreviousError",
16233 bindKey: o("Alt-Shift-E", "Shift-F4"),
16234 exec: function exec(e) {
16235 i.loadModule("ace/ext/error_marker", function (t) {
16236 t.showErrorMarker(e, -1);
16237 });
16238 },
16239 scrollIntoView: "animate",
16240 readOnly: !0
16241 }, {
16242 name: "selectall",
16243 bindKey: o("Ctrl-A", "Command-A"),
16244 exec: function exec(e) {
16245 e.selectAll();
16246 },
16247 readOnly: !0
16248 }, {
16249 name: "centerselection",
16250 bindKey: o(null, "Ctrl-L"),
16251 exec: function exec(e) {
16252 e.centerSelection();
16253 },
16254 readOnly: !0
16255 }, {
16256 name: "gotoline",
16257 bindKey: o("Ctrl-L", "Command-L"),
16258 exec: function exec(e) {
16259 var t = parseInt(prompt("Enter line number:"), 10);
16260 isNaN(t) || e.gotoLine(t);
16261 },
16262 readOnly: !0
16263 }, {
16264 name: "fold",
16265 bindKey: o("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
16266 exec: function exec(e) {
16267 e.session.toggleFold(!1);
16268 },
16269 multiSelectAction: "forEach",
16270 scrollIntoView: "center",
16271 readOnly: !0
16272 }, {
16273 name: "unfold",
16274 bindKey: o("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
16275 exec: function exec(e) {
16276 e.session.toggleFold(!0);
16277 },
16278 multiSelectAction: "forEach",
16279 scrollIntoView: "center",
16280 readOnly: !0
16281 }, {
16282 name: "toggleFoldWidget",
16283 bindKey: o("F2", "F2"),
16284 exec: function exec(e) {
16285 e.session.toggleFoldWidget();
16286 },
16287 multiSelectAction: "forEach",
16288 scrollIntoView: "center",
16289 readOnly: !0
16290 }, {
16291 name: "toggleParentFoldWidget",
16292 bindKey: o("Alt-F2", "Alt-F2"),
16293 exec: function exec(e) {
16294 e.session.toggleFoldWidget(!0);
16295 },
16296 multiSelectAction: "forEach",
16297 scrollIntoView: "center",
16298 readOnly: !0
16299 }, {
16300 name: "foldall",
16301 bindKey: o(null, "Ctrl-Command-Option-0"),
16302 exec: function exec(e) {
16303 e.session.foldAll();
16304 },
16305 scrollIntoView: "center",
16306 readOnly: !0
16307 }, {
16308 name: "foldOther",
16309 bindKey: o("Alt-0", "Command-Option-0"),
16310 exec: function exec(e) {
16311 e.session.foldAll(), e.session.unfold(e.selection.getAllRanges());
16312 },
16313 scrollIntoView: "center",
16314 readOnly: !0
16315 }, {
16316 name: "unfoldall",
16317 bindKey: o("Alt-Shift-0", "Command-Option-Shift-0"),
16318 exec: function exec(e) {
16319 e.session.unfold();
16320 },
16321 scrollIntoView: "center",
16322 readOnly: !0
16323 }, {
16324 name: "findnext",
16325 bindKey: o("Ctrl-K", "Command-G"),
16326 exec: function exec(e) {
16327 e.findNext();
16328 },
16329 multiSelectAction: "forEach",
16330 scrollIntoView: "center",
16331 readOnly: !0
16332 }, {
16333 name: "findprevious",
16334 bindKey: o("Ctrl-Shift-K", "Command-Shift-G"),
16335 exec: function exec(e) {
16336 e.findPrevious();
16337 },
16338 multiSelectAction: "forEach",
16339 scrollIntoView: "center",
16340 readOnly: !0
16341 }, {
16342 name: "selectOrFindNext",
16343 bindKey: o("Alt-K", "Ctrl-G"),
16344 exec: function exec(e) {
16345 e.selection.isEmpty() ? e.selection.selectWord() : e.findNext();
16346 },
16347 readOnly: !0
16348 }, {
16349 name: "selectOrFindPrevious",
16350 bindKey: o("Alt-Shift-K", "Ctrl-Shift-G"),
16351 exec: function exec(e) {
16352 e.selection.isEmpty() ? e.selection.selectWord() : e.findPrevious();
16353 },
16354 readOnly: !0
16355 }, {
16356 name: "find",
16357 bindKey: o("Ctrl-F", "Command-F"),
16358 exec: function exec(e) {
16359 i.loadModule("ace/ext/searchbox", function (t) {
16360 t.Search(e);
16361 });
16362 },
16363 readOnly: !0
16364 }, {
16365 name: "overwrite",
16366 bindKey: "Insert",
16367 exec: function exec(e) {
16368 e.toggleOverwrite();
16369 },
16370 readOnly: !0
16371 }, {
16372 name: "selecttostart",
16373 bindKey: o("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"),
16374 exec: function exec(e) {
16375 e.getSelection().selectFileStart();
16376 },
16377 multiSelectAction: "forEach",
16378 readOnly: !0,
16379 scrollIntoView: "animate",
16380 aceCommandGroup: "fileJump"
16381 }, {
16382 name: "gotostart",
16383 bindKey: o("Ctrl-Home", "Command-Home|Command-Up"),
16384 exec: function exec(e) {
16385 e.navigateFileStart();
16386 },
16387 multiSelectAction: "forEach",
16388 readOnly: !0,
16389 scrollIntoView: "animate",
16390 aceCommandGroup: "fileJump"
16391 }, {
16392 name: "selectup",
16393 bindKey: o("Shift-Up", "Shift-Up|Ctrl-Shift-P"),
16394 exec: function exec(e) {
16395 e.getSelection().selectUp();
16396 },
16397 multiSelectAction: "forEach",
16398 scrollIntoView: "cursor",
16399 readOnly: !0
16400 }, {
16401 name: "golineup",
16402 bindKey: o("Up", "Up|Ctrl-P"),
16403 exec: function exec(e, t) {
16404 e.navigateUp(t.times);
16405 },
16406 multiSelectAction: "forEach",
16407 scrollIntoView: "cursor",
16408 readOnly: !0
16409 }, {
16410 name: "selecttoend",
16411 bindKey: o("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"),
16412 exec: function exec(e) {
16413 e.getSelection().selectFileEnd();
16414 },
16415 multiSelectAction: "forEach",
16416 readOnly: !0,
16417 scrollIntoView: "animate",
16418 aceCommandGroup: "fileJump"
16419 }, {
16420 name: "gotoend",
16421 bindKey: o("Ctrl-End", "Command-End|Command-Down"),
16422 exec: function exec(e) {
16423 e.navigateFileEnd();
16424 },
16425 multiSelectAction: "forEach",
16426 readOnly: !0,
16427 scrollIntoView: "animate",
16428 aceCommandGroup: "fileJump"
16429 }, {
16430 name: "selectdown",
16431 bindKey: o("Shift-Down", "Shift-Down|Ctrl-Shift-N"),
16432 exec: function exec(e) {
16433 e.getSelection().selectDown();
16434 },
16435 multiSelectAction: "forEach",
16436 scrollIntoView: "cursor",
16437 readOnly: !0
16438 }, {
16439 name: "golinedown",
16440 bindKey: o("Down", "Down|Ctrl-N"),
16441 exec: function exec(e, t) {
16442 e.navigateDown(t.times);
16443 },
16444 multiSelectAction: "forEach",
16445 scrollIntoView: "cursor",
16446 readOnly: !0
16447 }, {
16448 name: "selectwordleft",
16449 bindKey: o("Ctrl-Shift-Left", "Option-Shift-Left"),
16450 exec: function exec(e) {
16451 e.getSelection().selectWordLeft();
16452 },
16453 multiSelectAction: "forEach",
16454 scrollIntoView: "cursor",
16455 readOnly: !0
16456 }, {
16457 name: "gotowordleft",
16458 bindKey: o("Ctrl-Left", "Option-Left"),
16459 exec: function exec(e) {
16460 e.navigateWordLeft();
16461 },
16462 multiSelectAction: "forEach",
16463 scrollIntoView: "cursor",
16464 readOnly: !0
16465 }, {
16466 name: "selecttolinestart",
16467 bindKey: o("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"),
16468 exec: function exec(e) {
16469 e.getSelection().selectLineStart();
16470 },
16471 multiSelectAction: "forEach",
16472 scrollIntoView: "cursor",
16473 readOnly: !0
16474 }, {
16475 name: "gotolinestart",
16476 bindKey: o("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
16477 exec: function exec(e) {
16478 e.navigateLineStart();
16479 },
16480 multiSelectAction: "forEach",
16481 scrollIntoView: "cursor",
16482 readOnly: !0
16483 }, {
16484 name: "selectleft",
16485 bindKey: o("Shift-Left", "Shift-Left|Ctrl-Shift-B"),
16486 exec: function exec(e) {
16487 e.getSelection().selectLeft();
16488 },
16489 multiSelectAction: "forEach",
16490 scrollIntoView: "cursor",
16491 readOnly: !0
16492 }, {
16493 name: "gotoleft",
16494 bindKey: o("Left", "Left|Ctrl-B"),
16495 exec: function exec(e, t) {
16496 e.navigateLeft(t.times);
16497 },
16498 multiSelectAction: "forEach",
16499 scrollIntoView: "cursor",
16500 readOnly: !0
16501 }, {
16502 name: "selectwordright",
16503 bindKey: o("Ctrl-Shift-Right", "Option-Shift-Right"),
16504 exec: function exec(e) {
16505 e.getSelection().selectWordRight();
16506 },
16507 multiSelectAction: "forEach",
16508 scrollIntoView: "cursor",
16509 readOnly: !0
16510 }, {
16511 name: "gotowordright",
16512 bindKey: o("Ctrl-Right", "Option-Right"),
16513 exec: function exec(e) {
16514 e.navigateWordRight();
16515 },
16516 multiSelectAction: "forEach",
16517 scrollIntoView: "cursor",
16518 readOnly: !0
16519 }, {
16520 name: "selecttolineend",
16521 bindKey: o("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"),
16522 exec: function exec(e) {
16523 e.getSelection().selectLineEnd();
16524 },
16525 multiSelectAction: "forEach",
16526 scrollIntoView: "cursor",
16527 readOnly: !0
16528 }, {
16529 name: "gotolineend",
16530 bindKey: o("Alt-Right|End", "Command-Right|End|Ctrl-E"),
16531 exec: function exec(e) {
16532 e.navigateLineEnd();
16533 },
16534 multiSelectAction: "forEach",
16535 scrollIntoView: "cursor",
16536 readOnly: !0
16537 }, {
16538 name: "selectright",
16539 bindKey: o("Shift-Right", "Shift-Right"),
16540 exec: function exec(e) {
16541 e.getSelection().selectRight();
16542 },
16543 multiSelectAction: "forEach",
16544 scrollIntoView: "cursor",
16545 readOnly: !0
16546 }, {
16547 name: "gotoright",
16548 bindKey: o("Right", "Right|Ctrl-F"),
16549 exec: function exec(e, t) {
16550 e.navigateRight(t.times);
16551 },
16552 multiSelectAction: "forEach",
16553 scrollIntoView: "cursor",
16554 readOnly: !0
16555 }, {
16556 name: "selectpagedown",
16557 bindKey: "Shift-PageDown",
16558 exec: function exec(e) {
16559 e.selectPageDown();
16560 },
16561 readOnly: !0
16562 }, {
16563 name: "pagedown",
16564 bindKey: o(null, "Option-PageDown"),
16565 exec: function exec(e) {
16566 e.scrollPageDown();
16567 },
16568 readOnly: !0
16569 }, {
16570 name: "gotopagedown",
16571 bindKey: o("PageDown", "PageDown|Ctrl-V"),
16572 exec: function exec(e) {
16573 e.gotoPageDown();
16574 },
16575 readOnly: !0
16576 }, {
16577 name: "selectpageup",
16578 bindKey: "Shift-PageUp",
16579 exec: function exec(e) {
16580 e.selectPageUp();
16581 },
16582 readOnly: !0
16583 }, {
16584 name: "pageup",
16585 bindKey: o(null, "Option-PageUp"),
16586 exec: function exec(e) {
16587 e.scrollPageUp();
16588 },
16589 readOnly: !0
16590 }, {
16591 name: "gotopageup",
16592 bindKey: "PageUp",
16593 exec: function exec(e) {
16594 e.gotoPageUp();
16595 },
16596 readOnly: !0
16597 }, {
16598 name: "scrollup",
16599 bindKey: o("Ctrl-Up", null),
16600 exec: function exec(e) {
16601 e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight);
16602 },
16603 readOnly: !0
16604 }, {
16605 name: "scrolldown",
16606 bindKey: o("Ctrl-Down", null),
16607 exec: function exec(e) {
16608 e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight);
16609 },
16610 readOnly: !0
16611 }, {
16612 name: "selectlinestart",
16613 bindKey: "Shift-Home",
16614 exec: function exec(e) {
16615 e.getSelection().selectLineStart();
16616 },
16617 multiSelectAction: "forEach",
16618 scrollIntoView: "cursor",
16619 readOnly: !0
16620 }, {
16621 name: "selectlineend",
16622 bindKey: "Shift-End",
16623 exec: function exec(e) {
16624 e.getSelection().selectLineEnd();
16625 },
16626 multiSelectAction: "forEach",
16627 scrollIntoView: "cursor",
16628 readOnly: !0
16629 }, {
16630 name: "togglerecording",
16631 bindKey: o("Ctrl-Alt-E", "Command-Option-E"),
16632 exec: function exec(e) {
16633 e.commands.toggleRecording(e);
16634 },
16635 readOnly: !0
16636 }, {
16637 name: "replaymacro",
16638 bindKey: o("Ctrl-Shift-E", "Command-Shift-E"),
16639 exec: function exec(e) {
16640 e.commands.replay(e);
16641 },
16642 readOnly: !0
16643 }, {
16644 name: "jumptomatching",
16645 bindKey: o("Ctrl-P", "Ctrl-P"),
16646 exec: function exec(e) {
16647 e.jumpToMatching();
16648 },
16649 multiSelectAction: "forEach",
16650 scrollIntoView: "animate",
16651 readOnly: !0
16652 }, {
16653 name: "selecttomatching",
16654 bindKey: o("Ctrl-Shift-P", "Ctrl-Shift-P"),
16655 exec: function exec(e) {
16656 e.jumpToMatching(!0);
16657 },
16658 multiSelectAction: "forEach",
16659 scrollIntoView: "animate",
16660 readOnly: !0
16661 }, {
16662 name: "expandToMatching",
16663 bindKey: o("Ctrl-Shift-M", "Ctrl-Shift-M"),
16664 exec: function exec(e) {
16665 e.jumpToMatching(!0, !0);
16666 },
16667 multiSelectAction: "forEach",
16668 scrollIntoView: "animate",
16669 readOnly: !0
16670 }, {
16671 name: "passKeysToBrowser",
16672 bindKey: o(null, null),
16673 exec: function exec() {},
16674 passEvent: !0,
16675 readOnly: !0
16676 }, {
16677 name: "copy",
16678 exec: function exec(e) {},
16679 readOnly: !0
16680 }, {
16681 name: "cut",
16682 exec: function exec(e) {
16683 var t = e.getSelectionRange();
16684 e._emit("cut", t), e.selection.isEmpty() || (e.session.remove(t), e.clearSelection());
16685 },
16686 scrollIntoView: "cursor",
16687 multiSelectAction: "forEach"
16688 }, {
16689 name: "paste",
16690 exec: function exec(e, t) {
16691 e.$handlePaste(t);
16692 },
16693 scrollIntoView: "cursor"
16694 }, {
16695 name: "removeline",
16696 bindKey: o("Ctrl-D", "Command-D"),
16697 exec: function exec(e) {
16698 e.removeLines();
16699 },
16700 scrollIntoView: "cursor",
16701 multiSelectAction: "forEachLine"
16702 }, {
16703 name: "duplicateSelection",
16704 bindKey: o("Ctrl-Shift-D", "Command-Shift-D"),
16705 exec: function exec(e) {
16706 e.duplicateSelection();
16707 },
16708 scrollIntoView: "cursor",
16709 multiSelectAction: "forEach"
16710 }, {
16711 name: "sortlines",
16712 bindKey: o("Ctrl-Alt-S", "Command-Alt-S"),
16713 exec: function exec(e) {
16714 e.sortLines();
16715 },
16716 scrollIntoView: "selection",
16717 multiSelectAction: "forEachLine"
16718 }, {
16719 name: "togglecomment",
16720 bindKey: o("Ctrl-/", "Command-/"),
16721 exec: function exec(e) {
16722 e.toggleCommentLines();
16723 },
16724 multiSelectAction: "forEachLine",
16725 scrollIntoView: "selectionPart"
16726 }, {
16727 name: "toggleBlockComment",
16728 bindKey: o("Ctrl-Shift-/", "Command-Shift-/"),
16729 exec: function exec(e) {
16730 e.toggleBlockComment();
16731 },
16732 multiSelectAction: "forEach",
16733 scrollIntoView: "selectionPart"
16734 }, {
16735 name: "modifyNumberUp",
16736 bindKey: o("Ctrl-Shift-Up", "Alt-Shift-Up"),
16737 exec: function exec(e) {
16738 e.modifyNumber(1);
16739 },
16740 scrollIntoView: "cursor",
16741 multiSelectAction: "forEach"
16742 }, {
16743 name: "modifyNumberDown",
16744 bindKey: o("Ctrl-Shift-Down", "Alt-Shift-Down"),
16745 exec: function exec(e) {
16746 e.modifyNumber(-1);
16747 },
16748 scrollIntoView: "cursor",
16749 multiSelectAction: "forEach"
16750 }, {
16751 name: "replace",
16752 bindKey: o("Ctrl-H", "Command-Option-F"),
16753 exec: function exec(e) {
16754 i.loadModule("ace/ext/searchbox", function (t) {
16755 t.Search(e, !0);
16756 });
16757 }
16758 }, {
16759 name: "undo",
16760 bindKey: o("Ctrl-Z", "Command-Z"),
16761 exec: function exec(e) {
16762 e.undo();
16763 }
16764 }, {
16765 name: "redo",
16766 bindKey: o("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
16767 exec: function exec(e) {
16768 e.redo();
16769 }
16770 }, {
16771 name: "copylinesup",
16772 bindKey: o("Alt-Shift-Up", "Command-Option-Up"),
16773 exec: function exec(e) {
16774 e.copyLinesUp();
16775 },
16776 scrollIntoView: "cursor"
16777 }, {
16778 name: "movelinesup",
16779 bindKey: o("Alt-Up", "Option-Up"),
16780 exec: function exec(e) {
16781 e.moveLinesUp();
16782 },
16783 scrollIntoView: "cursor"
16784 }, {
16785 name: "copylinesdown",
16786 bindKey: o("Alt-Shift-Down", "Command-Option-Down"),
16787 exec: function exec(e) {
16788 e.copyLinesDown();
16789 },
16790 scrollIntoView: "cursor"
16791 }, {
16792 name: "movelinesdown",
16793 bindKey: o("Alt-Down", "Option-Down"),
16794 exec: function exec(e) {
16795 e.moveLinesDown();
16796 },
16797 scrollIntoView: "cursor"
16798 }, {
16799 name: "del",
16800 bindKey: o("Delete", "Delete|Ctrl-D|Shift-Delete"),
16801 exec: function exec(e) {
16802 e.remove("right");
16803 },
16804 multiSelectAction: "forEach",
16805 scrollIntoView: "cursor"
16806 }, {
16807 name: "backspace",
16808 bindKey: o("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
16809 exec: function exec(e) {
16810 e.remove("left");
16811 },
16812 multiSelectAction: "forEach",
16813 scrollIntoView: "cursor"
16814 }, {
16815 name: "cut_or_delete",
16816 bindKey: o("Shift-Delete", null),
16817 exec: function exec(e) {
16818 if (!e.selection.isEmpty()) return !1;
16819 e.remove("left");
16820 },
16821 multiSelectAction: "forEach",
16822 scrollIntoView: "cursor"
16823 }, {
16824 name: "removetolinestart",
16825 bindKey: o("Alt-Backspace", "Command-Backspace"),
16826 exec: function exec(e) {
16827 e.removeToLineStart();
16828 },
16829 multiSelectAction: "forEach",
16830 scrollIntoView: "cursor"
16831 }, {
16832 name: "removetolineend",
16833 bindKey: o("Alt-Delete", "Ctrl-K"),
16834 exec: function exec(e) {
16835 e.removeToLineEnd();
16836 },
16837 multiSelectAction: "forEach",
16838 scrollIntoView: "cursor"
16839 }, {
16840 name: "removewordleft",
16841 bindKey: o("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
16842 exec: function exec(e) {
16843 e.removeWordLeft();
16844 },
16845 multiSelectAction: "forEach",
16846 scrollIntoView: "cursor"
16847 }, {
16848 name: "removewordright",
16849 bindKey: o("Ctrl-Delete", "Alt-Delete"),
16850 exec: function exec(e) {
16851 e.removeWordRight();
16852 },
16853 multiSelectAction: "forEach",
16854 scrollIntoView: "cursor"
16855 }, {
16856 name: "outdent",
16857 bindKey: o("Shift-Tab", "Shift-Tab"),
16858 exec: function exec(e) {
16859 e.blockOutdent();
16860 },
16861 multiSelectAction: "forEach",
16862 scrollIntoView: "selectionPart"
16863 }, {
16864 name: "indent",
16865 bindKey: o("Tab", "Tab"),
16866 exec: function exec(e) {
16867 e.indent();
16868 },
16869 multiSelectAction: "forEach",
16870 scrollIntoView: "selectionPart"
16871 }, {
16872 name: "blockoutdent",
16873 bindKey: o("Ctrl-[", "Ctrl-["),
16874 exec: function exec(e) {
16875 e.blockOutdent();
16876 },
16877 multiSelectAction: "forEachLine",
16878 scrollIntoView: "selectionPart"
16879 }, {
16880 name: "blockindent",
16881 bindKey: o("Ctrl-]", "Ctrl-]"),
16882 exec: function exec(e) {
16883 e.blockIndent();
16884 },
16885 multiSelectAction: "forEachLine",
16886 scrollIntoView: "selectionPart"
16887 }, {
16888 name: "insertstring",
16889 exec: function exec(e, t) {
16890 e.insert(t);
16891 },
16892 multiSelectAction: "forEach",
16893 scrollIntoView: "cursor"
16894 }, {
16895 name: "inserttext",
16896 exec: function exec(e, t) {
16897 e.insert(r.stringRepeat(t.text || "", t.times || 1));
16898 },
16899 multiSelectAction: "forEach",
16900 scrollIntoView: "cursor"
16901 }, {
16902 name: "splitline",
16903 bindKey: o(null, "Ctrl-O"),
16904 exec: function exec(e) {
16905 e.splitLine();
16906 },
16907 multiSelectAction: "forEach",
16908 scrollIntoView: "cursor"
16909 }, {
16910 name: "transposeletters",
16911 bindKey: o("Alt-Shift-X", "Ctrl-T"),
16912 exec: function exec(e) {
16913 e.transposeLetters();
16914 },
16915 multiSelectAction: function multiSelectAction(e) {
16916 e.transposeSelections(1);
16917 },
16918 scrollIntoView: "cursor"
16919 }, {
16920 name: "touppercase",
16921 bindKey: o("Ctrl-U", "Ctrl-U"),
16922 exec: function exec(e) {
16923 e.toUpperCase();
16924 },
16925 multiSelectAction: "forEach",
16926 scrollIntoView: "cursor"
16927 }, {
16928 name: "tolowercase",
16929 bindKey: o("Ctrl-Shift-U", "Ctrl-Shift-U"),
16930 exec: function exec(e) {
16931 e.toLowerCase();
16932 },
16933 multiSelectAction: "forEach",
16934 scrollIntoView: "cursor"
16935 }, {
16936 name: "expandtoline",
16937 bindKey: o("Ctrl-Shift-L", "Command-Shift-L"),
16938 exec: function exec(e) {
16939 var t = e.selection.getRange();
16940 t.start.column = t.end.column = 0, t.end.row++, e.selection.setRange(t, !1);
16941 },
16942 multiSelectAction: "forEach",
16943 scrollIntoView: "cursor",
16944 readOnly: !0
16945 }, {
16946 name: "joinlines",
16947 bindKey: o(null, null),
16948 exec: function exec(e) {
16949 var t = e.selection.isBackwards(),
16950 n = t ? e.selection.getSelectionLead() : e.selection.getSelectionAnchor(),
16951 i = t ? e.selection.getSelectionAnchor() : e.selection.getSelectionLead(),
16952 o = e.session.doc.getLine(n.row).length,
16953 u = e.session.doc.getTextRange(e.selection.getRange()),
16954 a = u.replace(/\n\s*/, " ").length,
16955 f = e.session.doc.getLine(n.row);
16956
16957 for (var l = n.row + 1; l <= i.row + 1; l++) {
16958 var c = r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));
16959 c.length !== 0 && (c = " " + c), f += c;
16960 }
16961
16962 i.row + 1 < e.session.doc.getLength() - 1 && (f += e.session.doc.getNewLineCharacter()), e.clearSelection(), e.session.doc.replace(new s(n.row, 0, i.row + 2, 0), f), a > 0 ? (e.selection.moveCursorTo(n.row, n.column), e.selection.selectTo(n.row, n.column + a)) : (o = e.session.doc.getLine(n.row).length > o ? o + 1 : o, e.selection.moveCursorTo(n.row, o));
16963 },
16964 multiSelectAction: "forEach",
16965 readOnly: !0
16966 }, {
16967 name: "invertSelection",
16968 bindKey: o(null, null),
16969 exec: function exec(e) {
16970 var t = e.session.doc.getLength() - 1,
16971 n = e.session.doc.getLine(t).length,
16972 r = e.selection.rangeList.ranges,
16973 i = [];
16974 r.length < 1 && (r = [e.selection.getRange()]);
16975
16976 for (var o = 0; o < r.length; o++) {
16977 o == r.length - 1 && (r[o].end.row !== t || r[o].end.column !== n) && i.push(new s(r[o].end.row, r[o].end.column, t, n)), o === 0 ? (r[o].start.row !== 0 || r[o].start.column !== 0) && i.push(new s(0, 0, r[o].start.row, r[o].start.column)) : i.push(new s(r[o - 1].end.row, r[o - 1].end.column, r[o].start.row, r[o].start.column));
16978 }
16979
16980 e.exitMultiSelectMode(), e.clearSelection();
16981
16982 for (var o = 0; o < i.length; o++) {
16983 e.selection.addRange(i[o], !1);
16984 }
16985 },
16986 readOnly: !0,
16987 scrollIntoView: "none"
16988 }];
16989 }), ace.define("ace/editor", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/keyboard/textinput", "ace/mouse/mouse_handler", "ace/mouse/fold_handler", "ace/keyboard/keybinding", "ace/edit_session", "ace/search", "ace/range", "ace/lib/event_emitter", "ace/commands/command_manager", "ace/commands/default_commands", "ace/config", "ace/token_iterator"], function (e, t, n) {
16990 "use strict";
16991
16992 e("./lib/fixoldbrowsers");
16993
16994 var r = e("./lib/oop"),
16995 i = e("./lib/dom"),
16996 s = e("./lib/lang"),
16997 o = e("./lib/useragent"),
16998 u = e("./keyboard/textinput").TextInput,
16999 a = e("./mouse/mouse_handler").MouseHandler,
17000 f = e("./mouse/fold_handler").FoldHandler,
17001 l = e("./keyboard/keybinding").KeyBinding,
17002 c = e("./edit_session").EditSession,
17003 h = e("./search").Search,
17004 p = e("./range").Range,
17005 d = e("./lib/event_emitter").EventEmitter,
17006 v = e("./commands/command_manager").CommandManager,
17007 m = e("./commands/default_commands").commands,
17008 g = e("./config"),
17009 y = e("./token_iterator").TokenIterator,
17010 b = function b(e, t) {
17011 var n = e.getContainerElement();
17012 this.container = n, this.renderer = e, this.id = "editor" + ++b.$uid, this.commands = new v(o.isMac ? "mac" : "win", m), (typeof document === "undefined" ? "undefined" : _typeof(document)) == "object" && (this.textInput = new u(e.getTextAreaContainer(), this), this.renderer.textarea = this.textInput.getElement(), this.$mouseHandler = new a(this), new f(this)), this.keyBinding = new l(this), this.$blockScrolling = 0, this.$search = new h().set({
17013 wrap: !0
17014 }), this.$historyTracker = this.$historyTracker.bind(this), this.commands.on("exec", this.$historyTracker), this.$initOperationListeners(), this._$emitInputEvent = s.delayedCall(function () {
17015 this._signal("input", {}), this.session && this.session.bgTokenizer && this.session.bgTokenizer.scheduleStart();
17016 }.bind(this)), this.on("change", function (e, t) {
17017 t._$emitInputEvent.schedule(31);
17018 }), this.setSession(t || new c("")), g.resetOptions(this), g._signal("editor", this);
17019 };
17020
17021 b.$uid = 0, function () {
17022 r.implement(this, d), this.$initOperationListeners = function () {
17023 function e(e) {
17024 return e[e.length - 1];
17025 }
17026
17027 this.selections = [], this.commands.on("exec", this.startOperation.bind(this), !0), this.commands.on("afterExec", this.endOperation.bind(this), !0), this.$opResetTimer = s.delayedCall(this.endOperation.bind(this)), this.on("change", function () {
17028 this.curOp || this.startOperation(), this.curOp.docChanged = !0;
17029 }.bind(this), !0), this.on("changeSelection", function () {
17030 this.curOp || this.startOperation(), this.curOp.selectionChanged = !0;
17031 }.bind(this), !0);
17032 }, this.curOp = null, this.prevOp = {}, this.startOperation = function (e) {
17033 if (this.curOp) {
17034 if (!e || this.curOp.command) return;
17035 this.prevOp = this.curOp;
17036 }
17037
17038 e || (this.previousCommand = null, e = {}), this.$opResetTimer.schedule(), this.curOp = {
17039 command: e.command || {},
17040 args: e.args,
17041 scrollTop: this.renderer.scrollTop
17042 }, this.curOp.command.name && this.curOp.command.scrollIntoView !== undefined && this.$blockScrolling++;
17043 }, this.endOperation = function (e) {
17044 if (this.curOp) {
17045 if (e && e.returnValue === !1) return this.curOp = null;
17046
17047 this._signal("beforeEndOperation");
17048
17049 var t = this.curOp.command;
17050 t.name && this.$blockScrolling > 0 && this.$blockScrolling--;
17051 var n = t && t.scrollIntoView;
17052
17053 if (n) {
17054 switch (n) {
17055 case "center-animate":
17056 n = "animate";
17057
17058 case "center":
17059 this.renderer.scrollCursorIntoView(null, .5);
17060 break;
17061
17062 case "animate":
17063 case "cursor":
17064 this.renderer.scrollCursorIntoView();
17065 break;
17066
17067 case "selectionPart":
17068 var r = this.selection.getRange(),
17069 i = this.renderer.layerConfig;
17070 (r.start.row >= i.lastRow || r.end.row <= i.firstRow) && this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);
17071 break;
17072
17073 default:
17074 }
17075
17076 n == "animate" && this.renderer.animateScrolling(this.curOp.scrollTop);
17077 }
17078
17079 this.prevOp = this.curOp, this.curOp = null;
17080 }
17081 }, this.$mergeableCommands = ["backspace", "del", "insertstring"], this.$historyTracker = function (e) {
17082 if (!this.$mergeUndoDeltas) return;
17083 var t = this.prevOp,
17084 n = this.$mergeableCommands,
17085 r = t.command && e.command.name == t.command.name;
17086
17087 if (e.command.name == "insertstring") {
17088 var i = e.args;
17089 this.mergeNextCommand === undefined && (this.mergeNextCommand = !0), r = r && this.mergeNextCommand && (!/\s/.test(i) || /\s/.test(t.args)), this.mergeNextCommand = !0;
17090 } else r = r && n.indexOf(e.command.name) !== -1;
17091
17092 this.$mergeUndoDeltas != "always" && Date.now() - this.sequenceStartTime > 2e3 && (r = !1), r ? this.session.mergeUndoDeltas = !0 : n.indexOf(e.command.name) !== -1 && (this.sequenceStartTime = Date.now());
17093 }, this.setKeyboardHandler = function (e, t) {
17094 if (e && typeof e == "string") {
17095 this.$keybindingId = e;
17096 var n = this;
17097 g.loadModule(["keybinding", e], function (r) {
17098 n.$keybindingId == e && n.keyBinding.setKeyboardHandler(r && r.handler), t && t();
17099 });
17100 } else this.$keybindingId = null, this.keyBinding.setKeyboardHandler(e), t && t();
17101 }, this.getKeyboardHandler = function () {
17102 return this.keyBinding.getKeyboardHandler();
17103 }, this.setSession = function (e) {
17104 if (this.session == e) return;
17105 this.curOp && this.endOperation(), this.curOp = {};
17106 var t = this.session;
17107
17108 if (t) {
17109 this.session.off("change", this.$onDocumentChange), this.session.off("changeMode", this.$onChangeMode), this.session.off("tokenizerUpdate", this.$onTokenizerUpdate), this.session.off("changeTabSize", this.$onChangeTabSize), this.session.off("changeWrapLimit", this.$onChangeWrapLimit), this.session.off("changeWrapMode", this.$onChangeWrapMode), this.session.off("changeFold", this.$onChangeFold), this.session.off("changeFrontMarker", this.$onChangeFrontMarker), this.session.off("changeBackMarker", this.$onChangeBackMarker), this.session.off("changeBreakpoint", this.$onChangeBreakpoint), this.session.off("changeAnnotation", this.$onChangeAnnotation), this.session.off("changeOverwrite", this.$onCursorChange), this.session.off("changeScrollTop", this.$onScrollTopChange), this.session.off("changeScrollLeft", this.$onScrollLeftChange);
17110 var n = this.session.getSelection();
17111 n.off("changeCursor", this.$onCursorChange), n.off("changeSelection", this.$onSelectionChange);
17112 }
17113
17114 this.session = e, e ? (this.$onDocumentChange = this.onDocumentChange.bind(this), e.on("change", this.$onDocumentChange), this.renderer.setSession(e), this.$onChangeMode = this.onChangeMode.bind(this), e.on("changeMode", this.$onChangeMode), this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this), e.on("tokenizerUpdate", this.$onTokenizerUpdate), this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer), e.on("changeTabSize", this.$onChangeTabSize), this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this), e.on("changeWrapLimit", this.$onChangeWrapLimit), this.$onChangeWrapMode = this.onChangeWrapMode.bind(this), e.on("changeWrapMode", this.$onChangeWrapMode), this.$onChangeFold = this.onChangeFold.bind(this), e.on("changeFold", this.$onChangeFold), this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this), this.session.on("changeFrontMarker", this.$onChangeFrontMarker), this.$onChangeBackMarker = this.onChangeBackMarker.bind(this), this.session.on("changeBackMarker", this.$onChangeBackMarker), this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this), this.session.on("changeBreakpoint", this.$onChangeBreakpoint), this.$onChangeAnnotation = this.onChangeAnnotation.bind(this), this.session.on("changeAnnotation", this.$onChangeAnnotation), this.$onCursorChange = this.onCursorChange.bind(this), this.session.on("changeOverwrite", this.$onCursorChange), this.$onScrollTopChange = this.onScrollTopChange.bind(this), this.session.on("changeScrollTop", this.$onScrollTopChange), this.$onScrollLeftChange = this.onScrollLeftChange.bind(this), this.session.on("changeScrollLeft", this.$onScrollLeftChange), this.selection = e.getSelection(), this.selection.on("changeCursor", this.$onCursorChange), this.$onSelectionChange = this.onSelectionChange.bind(this), this.selection.on("changeSelection", this.$onSelectionChange), this.onChangeMode(), this.$blockScrolling += 1, this.onCursorChange(), this.$blockScrolling -= 1, this.onScrollTopChange(), this.onScrollLeftChange(), this.onSelectionChange(), this.onChangeFrontMarker(), this.onChangeBackMarker(), this.onChangeBreakpoint(), this.onChangeAnnotation(), this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(), this.renderer.updateFull()) : (this.selection = null, this.renderer.setSession(e)), this._signal("changeSession", {
17115 session: e,
17116 oldSession: t
17117 }), this.curOp = null, t && t._signal("changeEditor", {
17118 oldEditor: this
17119 }), e && e._signal("changeEditor", {
17120 editor: this
17121 }), e && e.bgTokenizer && e.bgTokenizer.scheduleStart();
17122 }, this.getSession = function () {
17123 return this.session;
17124 }, this.setValue = function (e, t) {
17125 return this.session.doc.setValue(e), t ? t == 1 ? this.navigateFileEnd() : t == -1 && this.navigateFileStart() : this.selectAll(), e;
17126 }, this.getValue = function () {
17127 return this.session.getValue();
17128 }, this.getSelection = function () {
17129 return this.selection;
17130 }, this.resize = function (e) {
17131 this.renderer.onResize(e);
17132 }, this.setTheme = function (e, t) {
17133 this.renderer.setTheme(e, t);
17134 }, this.getTheme = function () {
17135 return this.renderer.getTheme();
17136 }, this.setStyle = function (e) {
17137 this.renderer.setStyle(e);
17138 }, this.unsetStyle = function (e) {
17139 this.renderer.unsetStyle(e);
17140 }, this.getFontSize = function () {
17141 return this.getOption("fontSize") || i.computedStyle(this.container, "fontSize");
17142 }, this.setFontSize = function (e) {
17143 this.setOption("fontSize", e);
17144 }, this.$highlightBrackets = function () {
17145 this.session.$bracketHighlight && (this.session.removeMarker(this.session.$bracketHighlight), this.session.$bracketHighlight = null);
17146 if (this.$highlightPending) return;
17147 var e = this;
17148 this.$highlightPending = !0, setTimeout(function () {
17149 e.$highlightPending = !1;
17150 var t = e.session;
17151 if (!t || !t.bgTokenizer) return;
17152 var n = t.findMatchingBracket(e.getCursorPosition());
17153 if (n) var r = new p(n.row, n.column, n.row, n.column + 1);else if (t.$mode.getMatching) var r = t.$mode.getMatching(e.session);
17154 r && (t.$bracketHighlight = t.addMarker(r, "ace_bracket", "text"));
17155 }, 50);
17156 }, this.$highlightTags = function () {
17157 if (this.$highlightTagPending) return;
17158 var e = this;
17159 this.$highlightTagPending = !0, setTimeout(function () {
17160 e.$highlightTagPending = !1;
17161 var t = e.session;
17162 if (!t || !t.bgTokenizer) return;
17163 var n = e.getCursorPosition(),
17164 r = new y(e.session, n.row, n.column),
17165 i = r.getCurrentToken();
17166
17167 if (!i || !/\b(?:tag-open|tag-name)/.test(i.type)) {
17168 t.removeMarker(t.$tagHighlight), t.$tagHighlight = null;
17169 return;
17170 }
17171
17172 if (i.type.indexOf("tag-open") != -1) {
17173 i = r.stepForward();
17174 if (!i) return;
17175 }
17176
17177 var s = i.value,
17178 o = 0,
17179 u = r.stepBackward();
17180
17181 if (u.value == "<") {
17182 do {
17183 u = i, i = r.stepForward(), i && i.value === s && i.type.indexOf("tag-name") !== -1 && (u.value === "<" ? o++ : u.value === "</" && o--);
17184 } while (i && o >= 0);
17185 } else {
17186 do {
17187 i = u, u = r.stepBackward(), i && i.value === s && i.type.indexOf("tag-name") !== -1 && (u.value === "<" ? o++ : u.value === "</" && o--);
17188 } while (u && o <= 0);
17189
17190 r.stepForward();
17191 }
17192
17193 if (!i) {
17194 t.removeMarker(t.$tagHighlight), t.$tagHighlight = null;
17195 return;
17196 }
17197
17198 var a = r.getCurrentTokenRow(),
17199 f = r.getCurrentTokenColumn(),
17200 l = new p(a, f, a, f + i.value.length),
17201 c = t.$backMarkers[t.$tagHighlight];
17202 t.$tagHighlight && c != undefined && l.compareRange(c.range) !== 0 && (t.removeMarker(t.$tagHighlight), t.$tagHighlight = null), l && !t.$tagHighlight && (t.$tagHighlight = t.addMarker(l, "ace_bracket", "text"));
17203 }, 50);
17204 }, this.focus = function () {
17205 var e = this;
17206 setTimeout(function () {
17207 e.textInput.focus();
17208 }), this.textInput.focus();
17209 }, this.isFocused = function () {
17210 return this.textInput.isFocused();
17211 }, this.blur = function () {
17212 this.textInput.blur();
17213 }, this.onFocus = function (e) {
17214 if (this.$isFocused) return;
17215 this.$isFocused = !0, this.renderer.showCursor(), this.renderer.visualizeFocus(), this._emit("focus", e);
17216 }, this.onBlur = function (e) {
17217 if (!this.$isFocused) return;
17218 this.$isFocused = !1, this.renderer.hideCursor(), this.renderer.visualizeBlur(), this._emit("blur", e);
17219 }, this.$cursorChange = function () {
17220 this.renderer.updateCursor();
17221 }, this.onDocumentChange = function (e) {
17222 var t = this.session.$useWrapMode,
17223 n = e.start.row == e.end.row ? e.end.row : Infinity;
17224 this.renderer.updateLines(e.start.row, n, t), this._signal("change", e), this.$cursorChange(), this.$updateHighlightActiveLine();
17225 }, this.onTokenizerUpdate = function (e) {
17226 var t = e.data;
17227 this.renderer.updateLines(t.first, t.last);
17228 }, this.onScrollTopChange = function () {
17229 this.renderer.scrollToY(this.session.getScrollTop());
17230 }, this.onScrollLeftChange = function () {
17231 this.renderer.scrollToX(this.session.getScrollLeft());
17232 }, this.onCursorChange = function () {
17233 this.$cursorChange(), this.$blockScrolling || (g.warn("Automatically scrolling cursor into view after selection change", "this will be disabled in the next version", "set editor.$blockScrolling = Infinity to disable this message"), this.renderer.scrollCursorIntoView()), this.$highlightBrackets(), this.$highlightTags(), this.$updateHighlightActiveLine(), this._signal("changeSelection");
17234 }, this.$updateHighlightActiveLine = function () {
17235 var e = this.getSession(),
17236 t;
17237
17238 if (this.$highlightActiveLine) {
17239 if (this.$selectionStyle != "line" || !this.selection.isMultiLine()) t = this.getCursorPosition();
17240 this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1) && (t = !1);
17241 }
17242
17243 if (e.$highlightLineMarker && !t) e.removeMarker(e.$highlightLineMarker.id), e.$highlightLineMarker = null;else if (!e.$highlightLineMarker && t) {
17244 var n = new p(t.row, t.column, t.row, Infinity);
17245 n.id = e.addMarker(n, "ace_active-line", "screenLine"), e.$highlightLineMarker = n;
17246 } else t && (e.$highlightLineMarker.start.row = t.row, e.$highlightLineMarker.end.row = t.row, e.$highlightLineMarker.start.column = t.column, e._signal("changeBackMarker"));
17247 }, this.onSelectionChange = function (e) {
17248 var t = this.session;
17249 t.$selectionMarker && t.removeMarker(t.$selectionMarker), t.$selectionMarker = null;
17250
17251 if (!this.selection.isEmpty()) {
17252 var n = this.selection.getRange(),
17253 r = this.getSelectionStyle();
17254 t.$selectionMarker = t.addMarker(n, "ace_selection", r);
17255 } else this.$updateHighlightActiveLine();
17256
17257 var i = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
17258 this.session.highlight(i), this._signal("changeSelection");
17259 }, this.$getSelectionHighLightRegexp = function () {
17260 var e = this.session,
17261 t = this.getSelectionRange();
17262 if (t.isEmpty() || t.isMultiLine()) return;
17263 var n = t.start.column - 1,
17264 r = t.end.column + 1,
17265 i = e.getLine(t.start.row),
17266 s = i.length,
17267 o = i.substring(Math.max(n, 0), Math.min(r, s));
17268 if (n >= 0 && /^[\w\d]/.test(o) || r <= s && /[\w\d]$/.test(o)) return;
17269 o = i.substring(t.start.column, t.end.column);
17270 if (!/^[\w\d]+$/.test(o)) return;
17271 var u = this.$search.$assembleRegExp({
17272 wholeWord: !0,
17273 caseSensitive: !0,
17274 needle: o
17275 });
17276 return u;
17277 }, this.onChangeFrontMarker = function () {
17278 this.renderer.updateFrontMarkers();
17279 }, this.onChangeBackMarker = function () {
17280 this.renderer.updateBackMarkers();
17281 }, this.onChangeBreakpoint = function () {
17282 this.renderer.updateBreakpoints();
17283 }, this.onChangeAnnotation = function () {
17284 this.renderer.setAnnotations(this.session.getAnnotations());
17285 }, this.onChangeMode = function (e) {
17286 this.renderer.updateText(), this._emit("changeMode", e);
17287 }, this.onChangeWrapLimit = function () {
17288 this.renderer.updateFull();
17289 }, this.onChangeWrapMode = function () {
17290 this.renderer.onResize(!0);
17291 }, this.onChangeFold = function () {
17292 this.$updateHighlightActiveLine(), this.renderer.updateFull();
17293 }, this.getSelectedText = function () {
17294 return this.session.getTextRange(this.getSelectionRange());
17295 }, this.getCopyText = function () {
17296 var e = this.getSelectedText();
17297 return this._signal("copy", e), e;
17298 }, this.onCopy = function () {
17299 this.commands.exec("copy", this);
17300 }, this.onCut = function () {
17301 this.commands.exec("cut", this);
17302 }, this.onPaste = function (e, t) {
17303 var n = {
17304 text: e,
17305 event: t
17306 };
17307 this.commands.exec("paste", this, n);
17308 }, this.$handlePaste = function (e) {
17309 typeof e == "string" && (e = {
17310 text: e
17311 }), this._signal("paste", e);
17312 var t = e.text;
17313 if (!this.inMultiSelectMode || this.inVirtualSelectionMode) this.insert(t);else {
17314 var n = t.split(/\r\n|\r|\n/),
17315 r = this.selection.rangeList.ranges;
17316 if (n.length > r.length || n.length < 2 || !n[1]) return this.commands.exec("insertstring", this, t);
17317
17318 for (var i = r.length; i--;) {
17319 var s = r[i];
17320 s.isEmpty() || this.session.remove(s), this.session.insert(s.start, n[i]);
17321 }
17322 }
17323 }, this.execCommand = function (e, t) {
17324 return this.commands.exec(e, this, t);
17325 }, this.insert = function (e, t) {
17326 var n = this.session,
17327 r = n.getMode(),
17328 i = this.getCursorPosition();
17329
17330 if (this.getBehavioursEnabled() && !t) {
17331 var s = r.transformAction(n.getState(i.row), "insertion", this, n, e);
17332 s && (e !== s.text && (this.session.mergeUndoDeltas = !1, this.$mergeNextCommand = !1), e = s.text);
17333 }
17334
17335 e == " " && (e = this.session.getTabString());
17336
17337 if (!this.selection.isEmpty()) {
17338 var o = this.getSelectionRange();
17339 i = this.session.remove(o), this.clearSelection();
17340 } else if (this.session.getOverwrite() && e.indexOf("\n") == -1) {
17341 var o = new p.fromPoints(i, i);
17342 o.end.column += e.length, this.session.remove(o);
17343 }
17344
17345 if (e == "\n" || e == "\r\n") {
17346 var u = n.getLine(i.row);
17347
17348 if (i.column > u.search(/\S|$/)) {
17349 var a = u.substr(i.column).search(/\S|$/);
17350 n.doc.removeInLine(i.row, i.column, i.column + a);
17351 }
17352 }
17353
17354 this.clearSelection();
17355 var f = i.column,
17356 l = n.getState(i.row),
17357 u = n.getLine(i.row),
17358 c = r.checkOutdent(l, u, e),
17359 h = n.insert(i, e);
17360 s && s.selection && (s.selection.length == 2 ? this.selection.setSelectionRange(new p(i.row, f + s.selection[0], i.row, f + s.selection[1])) : this.selection.setSelectionRange(new p(i.row + s.selection[0], s.selection[1], i.row + s.selection[2], s.selection[3])));
17361
17362 if (n.getDocument().isNewLine(e)) {
17363 var d = r.getNextLineIndent(l, u.slice(0, i.column), n.getTabString());
17364 n.insert({
17365 row: i.row + 1,
17366 column: 0
17367 }, d);
17368 }
17369
17370 c && r.autoOutdent(l, n, i.row);
17371 }, this.onTextInput = function (e) {
17372 this.keyBinding.onTextInput(e);
17373 }, this.onCommandKey = function (e, t, n) {
17374 this.keyBinding.onCommandKey(e, t, n);
17375 }, this.setOverwrite = function (e) {
17376 this.session.setOverwrite(e);
17377 }, this.getOverwrite = function () {
17378 return this.session.getOverwrite();
17379 }, this.toggleOverwrite = function () {
17380 this.session.toggleOverwrite();
17381 }, this.setScrollSpeed = function (e) {
17382 this.setOption("scrollSpeed", e);
17383 }, this.getScrollSpeed = function () {
17384 return this.getOption("scrollSpeed");
17385 }, this.setDragDelay = function (e) {
17386 this.setOption("dragDelay", e);
17387 }, this.getDragDelay = function () {
17388 return this.getOption("dragDelay");
17389 }, this.setSelectionStyle = function (e) {
17390 this.setOption("selectionStyle", e);
17391 }, this.getSelectionStyle = function () {
17392 return this.getOption("selectionStyle");
17393 }, this.setHighlightActiveLine = function (e) {
17394 this.setOption("highlightActiveLine", e);
17395 }, this.getHighlightActiveLine = function () {
17396 return this.getOption("highlightActiveLine");
17397 }, this.setHighlightGutterLine = function (e) {
17398 this.setOption("highlightGutterLine", e);
17399 }, this.getHighlightGutterLine = function () {
17400 return this.getOption("highlightGutterLine");
17401 }, this.setHighlightSelectedWord = function (e) {
17402 this.setOption("highlightSelectedWord", e);
17403 }, this.getHighlightSelectedWord = function () {
17404 return this.$highlightSelectedWord;
17405 }, this.setAnimatedScroll = function (e) {
17406 this.renderer.setAnimatedScroll(e);
17407 }, this.getAnimatedScroll = function () {
17408 return this.renderer.getAnimatedScroll();
17409 }, this.setShowInvisibles = function (e) {
17410 this.renderer.setShowInvisibles(e);
17411 }, this.getShowInvisibles = function () {
17412 return this.renderer.getShowInvisibles();
17413 }, this.setDisplayIndentGuides = function (e) {
17414 this.renderer.setDisplayIndentGuides(e);
17415 }, this.getDisplayIndentGuides = function () {
17416 return this.renderer.getDisplayIndentGuides();
17417 }, this.setShowPrintMargin = function (e) {
17418 this.renderer.setShowPrintMargin(e);
17419 }, this.getShowPrintMargin = function () {
17420 return this.renderer.getShowPrintMargin();
17421 }, this.setPrintMarginColumn = function (e) {
17422 this.renderer.setPrintMarginColumn(e);
17423 }, this.getPrintMarginColumn = function () {
17424 return this.renderer.getPrintMarginColumn();
17425 }, this.setReadOnly = function (e) {
17426 this.setOption("readOnly", e);
17427 }, this.getReadOnly = function () {
17428 return this.getOption("readOnly");
17429 }, this.setBehavioursEnabled = function (e) {
17430 this.setOption("behavioursEnabled", e);
17431 }, this.getBehavioursEnabled = function () {
17432 return this.getOption("behavioursEnabled");
17433 }, this.setWrapBehavioursEnabled = function (e) {
17434 this.setOption("wrapBehavioursEnabled", e);
17435 }, this.getWrapBehavioursEnabled = function () {
17436 return this.getOption("wrapBehavioursEnabled");
17437 }, this.setShowFoldWidgets = function (e) {
17438 this.setOption("showFoldWidgets", e);
17439 }, this.getShowFoldWidgets = function () {
17440 return this.getOption("showFoldWidgets");
17441 }, this.setFadeFoldWidgets = function (e) {
17442 this.setOption("fadeFoldWidgets", e);
17443 }, this.getFadeFoldWidgets = function () {
17444 return this.getOption("fadeFoldWidgets");
17445 }, this.remove = function (e) {
17446 this.selection.isEmpty() && (e == "left" ? this.selection.selectLeft() : this.selection.selectRight());
17447 var t = this.getSelectionRange();
17448
17449 if (this.getBehavioursEnabled()) {
17450 var n = this.session,
17451 r = n.getState(t.start.row),
17452 i = n.getMode().transformAction(r, "deletion", this, n, t);
17453
17454 if (t.end.column === 0) {
17455 var s = n.getTextRange(t);
17456
17457 if (s[s.length - 1] == "\n") {
17458 var o = n.getLine(t.end.row);
17459 /^\s+$/.test(o) && (t.end.column = o.length);
17460 }
17461 }
17462
17463 i && (t = i);
17464 }
17465
17466 this.session.remove(t), this.clearSelection();
17467 }, this.removeWordRight = function () {
17468 this.selection.isEmpty() && this.selection.selectWordRight(), this.session.remove(this.getSelectionRange()), this.clearSelection();
17469 }, this.removeWordLeft = function () {
17470 this.selection.isEmpty() && this.selection.selectWordLeft(), this.session.remove(this.getSelectionRange()), this.clearSelection();
17471 }, this.removeToLineStart = function () {
17472 this.selection.isEmpty() && this.selection.selectLineStart(), this.session.remove(this.getSelectionRange()), this.clearSelection();
17473 }, this.removeToLineEnd = function () {
17474 this.selection.isEmpty() && this.selection.selectLineEnd();
17475 var e = this.getSelectionRange();
17476 e.start.column == e.end.column && e.start.row == e.end.row && (e.end.column = 0, e.end.row++), this.session.remove(e), this.clearSelection();
17477 }, this.splitLine = function () {
17478 this.selection.isEmpty() || (this.session.remove(this.getSelectionRange()), this.clearSelection());
17479 var e = this.getCursorPosition();
17480 this.insert("\n"), this.moveCursorToPosition(e);
17481 }, this.transposeLetters = function () {
17482 if (!this.selection.isEmpty()) return;
17483 var e = this.getCursorPosition(),
17484 t = e.column;
17485 if (t === 0) return;
17486 var n = this.session.getLine(e.row),
17487 r,
17488 i;
17489 t < n.length ? (r = n.charAt(t) + n.charAt(t - 1), i = new p(e.row, t - 1, e.row, t + 1)) : (r = n.charAt(t - 1) + n.charAt(t - 2), i = new p(e.row, t - 2, e.row, t)), this.session.replace(i, r), this.session.selection.moveToPosition(i.end);
17490 }, this.toLowerCase = function () {
17491 var e = this.getSelectionRange();
17492 this.selection.isEmpty() && this.selection.selectWord();
17493 var t = this.getSelectionRange(),
17494 n = this.session.getTextRange(t);
17495 this.session.replace(t, n.toLowerCase()), this.selection.setSelectionRange(e);
17496 }, this.toUpperCase = function () {
17497 var e = this.getSelectionRange();
17498 this.selection.isEmpty() && this.selection.selectWord();
17499 var t = this.getSelectionRange(),
17500 n = this.session.getTextRange(t);
17501 this.session.replace(t, n.toUpperCase()), this.selection.setSelectionRange(e);
17502 }, this.indent = function () {
17503 var e = this.session,
17504 t = this.getSelectionRange();
17505
17506 if (t.start.row < t.end.row) {
17507 var n = this.$getSelectedRows();
17508 e.indentRows(n.first, n.last, " ");
17509 return;
17510 }
17511
17512 if (t.start.column < t.end.column) {
17513 var r = e.getTextRange(t);
17514
17515 if (!/^\s+$/.test(r)) {
17516 var n = this.$getSelectedRows();
17517 e.indentRows(n.first, n.last, " ");
17518 return;
17519 }
17520 }
17521
17522 var i = e.getLine(t.start.row),
17523 o = t.start,
17524 u = e.getTabSize(),
17525 a = e.documentToScreenColumn(o.row, o.column);
17526 if (this.session.getUseSoftTabs()) var f = u - a % u,
17527 l = s.stringRepeat(" ", f);else {
17528 var f = a % u;
17529
17530 while (i[t.start.column - 1] == " " && f) {
17531 t.start.column--, f--;
17532 }
17533
17534 this.selection.setSelectionRange(t), l = " ";
17535 }
17536 return this.insert(l);
17537 }, this.blockIndent = function () {
17538 var e = this.$getSelectedRows();
17539 this.session.indentRows(e.first, e.last, " ");
17540 }, this.blockOutdent = function () {
17541 var e = this.session.getSelection();
17542 this.session.outdentRows(e.getRange());
17543 }, this.sortLines = function () {
17544 var e = this.$getSelectedRows(),
17545 t = this.session,
17546 n = [];
17547
17548 for (i = e.first; i <= e.last; i++) {
17549 n.push(t.getLine(i));
17550 }
17551
17552 n.sort(function (e, t) {
17553 return e.toLowerCase() < t.toLowerCase() ? -1 : e.toLowerCase() > t.toLowerCase() ? 1 : 0;
17554 });
17555 var r = new p(0, 0, 0, 0);
17556
17557 for (var i = e.first; i <= e.last; i++) {
17558 var s = t.getLine(i);
17559 r.start.row = i, r.end.row = i, r.end.column = s.length, t.replace(r, n[i - e.first]);
17560 }
17561 }, this.toggleCommentLines = function () {
17562 var e = this.session.getState(this.getCursorPosition().row),
17563 t = this.$getSelectedRows();
17564 this.session.getMode().toggleCommentLines(e, this.session, t.first, t.last);
17565 }, this.toggleBlockComment = function () {
17566 var e = this.getCursorPosition(),
17567 t = this.session.getState(e.row),
17568 n = this.getSelectionRange();
17569 this.session.getMode().toggleBlockComment(t, this.session, n, e);
17570 }, this.getNumberAt = function (e, t) {
17571 var n = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
17572 n.lastIndex = 0;
17573 var r = this.session.getLine(e);
17574
17575 while (n.lastIndex < t) {
17576 var i = n.exec(r);
17577
17578 if (i.index <= t && i.index + i[0].length >= t) {
17579 var s = {
17580 value: i[0],
17581 start: i.index,
17582 end: i.index + i[0].length
17583 };
17584 return s;
17585 }
17586 }
17587
17588 return null;
17589 }, this.modifyNumber = function (e) {
17590 var t = this.selection.getCursor().row,
17591 n = this.selection.getCursor().column,
17592 r = new p(t, n - 1, t, n),
17593 i = this.session.getTextRange(r);
17594
17595 if (!isNaN(parseFloat(i)) && isFinite(i)) {
17596 var s = this.getNumberAt(t, n);
17597
17598 if (s) {
17599 var o = s.value.indexOf(".") >= 0 ? s.start + s.value.indexOf(".") + 1 : s.end,
17600 u = s.start + s.value.length - o,
17601 a = parseFloat(s.value);
17602 a *= Math.pow(10, u), o !== s.end && n < o ? e *= Math.pow(10, s.end - n - 1) : e *= Math.pow(10, s.end - n), a += e, a /= Math.pow(10, u);
17603 var f = a.toFixed(u),
17604 l = new p(t, s.start, t, s.end);
17605 this.session.replace(l, f), this.moveCursorTo(t, Math.max(s.start + 1, n + f.length - s.value.length));
17606 }
17607 }
17608 }, this.removeLines = function () {
17609 var e = this.$getSelectedRows();
17610 this.session.removeFullLines(e.first, e.last), this.clearSelection();
17611 }, this.duplicateSelection = function () {
17612 var e = this.selection,
17613 t = this.session,
17614 n = e.getRange(),
17615 r = e.isBackwards();
17616
17617 if (n.isEmpty()) {
17618 var i = n.start.row;
17619 t.duplicateLines(i, i);
17620 } else {
17621 var s = r ? n.start : n.end,
17622 o = t.insert(s, t.getTextRange(n), !1);
17623 n.start = s, n.end = o, e.setSelectionRange(n, r);
17624 }
17625 }, this.moveLinesDown = function () {
17626 this.$moveLines(1, !1);
17627 }, this.moveLinesUp = function () {
17628 this.$moveLines(-1, !1);
17629 }, this.moveText = function (e, t, n) {
17630 return this.session.moveText(e, t, n);
17631 }, this.copyLinesUp = function () {
17632 this.$moveLines(-1, !0);
17633 }, this.copyLinesDown = function () {
17634 this.$moveLines(1, !0);
17635 }, this.$moveLines = function (e, t) {
17636 var n,
17637 r,
17638 i = this.selection;
17639
17640 if (!i.inMultiSelectMode || this.inVirtualSelectionMode) {
17641 var s = i.toOrientedRange();
17642 n = this.$getSelectedRows(s), r = this.session.$moveLines(n.first, n.last, t ? 0 : e), t && e == -1 && (r = 0), s.moveBy(r, 0), i.fromOrientedRange(s);
17643 } else {
17644 var o = i.rangeList.ranges;
17645 i.rangeList.detach(this.session), this.inVirtualSelectionMode = !0;
17646 var u = 0,
17647 a = 0,
17648 f = o.length;
17649
17650 for (var l = 0; l < f; l++) {
17651 var c = l;
17652 o[l].moveBy(u, 0), n = this.$getSelectedRows(o[l]);
17653 var h = n.first,
17654 p = n.last;
17655
17656 while (++l < f) {
17657 a && o[l].moveBy(a, 0);
17658 var d = this.$getSelectedRows(o[l]);
17659 if (t && d.first != p) break;
17660 if (!t && d.first > p + 1) break;
17661 p = d.last;
17662 }
17663
17664 l--, u = this.session.$moveLines(h, p, t ? 0 : e), t && e == -1 && (c = l + 1);
17665
17666 while (c <= l) {
17667 o[c].moveBy(u, 0), c++;
17668 }
17669
17670 t || (u = 0), a += u;
17671 }
17672
17673 i.fromOrientedRange(i.ranges[0]), i.rangeList.attach(this.session), this.inVirtualSelectionMode = !1;
17674 }
17675 }, this.$getSelectedRows = function (e) {
17676 return e = (e || this.getSelectionRange()).collapseRows(), {
17677 first: this.session.getRowFoldStart(e.start.row),
17678 last: this.session.getRowFoldEnd(e.end.row)
17679 };
17680 }, this.onCompositionStart = function (e) {
17681 this.renderer.showComposition(this.getCursorPosition());
17682 }, this.onCompositionUpdate = function (e) {
17683 this.renderer.setCompositionText(e);
17684 }, this.onCompositionEnd = function () {
17685 this.renderer.hideComposition();
17686 }, this.getFirstVisibleRow = function () {
17687 return this.renderer.getFirstVisibleRow();
17688 }, this.getLastVisibleRow = function () {
17689 return this.renderer.getLastVisibleRow();
17690 }, this.isRowVisible = function (e) {
17691 return e >= this.getFirstVisibleRow() && e <= this.getLastVisibleRow();
17692 }, this.isRowFullyVisible = function (e) {
17693 return e >= this.renderer.getFirstFullyVisibleRow() && e <= this.renderer.getLastFullyVisibleRow();
17694 }, this.$getVisibleRowCount = function () {
17695 return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
17696 }, this.$moveByPage = function (e, t) {
17697 var n = this.renderer,
17698 r = this.renderer.layerConfig,
17699 i = e * Math.floor(r.height / r.lineHeight);
17700 this.$blockScrolling++, t === !0 ? this.selection.$moveSelection(function () {
17701 this.moveCursorBy(i, 0);
17702 }) : t === !1 && (this.selection.moveCursorBy(i, 0), this.selection.clearSelection()), this.$blockScrolling--;
17703 var s = n.scrollTop;
17704 n.scrollBy(0, i * r.lineHeight), t != null && n.scrollCursorIntoView(null, .5), n.animateScrolling(s);
17705 }, this.selectPageDown = function () {
17706 this.$moveByPage(1, !0);
17707 }, this.selectPageUp = function () {
17708 this.$moveByPage(-1, !0);
17709 }, this.gotoPageDown = function () {
17710 this.$moveByPage(1, !1);
17711 }, this.gotoPageUp = function () {
17712 this.$moveByPage(-1, !1);
17713 }, this.scrollPageDown = function () {
17714 this.$moveByPage(1);
17715 }, this.scrollPageUp = function () {
17716 this.$moveByPage(-1);
17717 }, this.scrollToRow = function (e) {
17718 this.renderer.scrollToRow(e);
17719 }, this.scrollToLine = function (e, t, n, r) {
17720 this.renderer.scrollToLine(e, t, n, r);
17721 }, this.centerSelection = function () {
17722 var e = this.getSelectionRange(),
17723 t = {
17724 row: Math.floor(e.start.row + (e.end.row - e.start.row) / 2),
17725 column: Math.floor(e.start.column + (e.end.column - e.start.column) / 2)
17726 };
17727 this.renderer.alignCursor(t, .5);
17728 }, this.getCursorPosition = function () {
17729 return this.selection.getCursor();
17730 }, this.getCursorPositionScreen = function () {
17731 return this.session.documentToScreenPosition(this.getCursorPosition());
17732 }, this.getSelectionRange = function () {
17733 return this.selection.getRange();
17734 }, this.selectAll = function () {
17735 this.$blockScrolling += 1, this.selection.selectAll(), this.$blockScrolling -= 1;
17736 }, this.clearSelection = function () {
17737 this.selection.clearSelection();
17738 }, this.moveCursorTo = function (e, t) {
17739 this.selection.moveCursorTo(e, t);
17740 }, this.moveCursorToPosition = function (e) {
17741 this.selection.moveCursorToPosition(e);
17742 }, this.jumpToMatching = function (e, t) {
17743 var n = this.getCursorPosition(),
17744 r = new y(this.session, n.row, n.column),
17745 i = r.getCurrentToken(),
17746 s = i || r.stepForward();
17747 if (!s) return;
17748 var o,
17749 u = !1,
17750 a = {},
17751 f = n.column - s.start,
17752 l,
17753 c = {
17754 ")": "(",
17755 "(": "(",
17756 "]": "[",
17757 "[": "[",
17758 "{": "{",
17759 "}": "{"
17760 };
17761
17762 do {
17763 if (s.value.match(/[{}()\[\]]/g)) for (; f < s.value.length && !u; f++) {
17764 if (!c[s.value[f]]) continue;
17765 l = c[s.value[f]] + "." + s.type.replace("rparen", "lparen"), isNaN(a[l]) && (a[l] = 0);
17766
17767 switch (s.value[f]) {
17768 case "(":
17769 case "[":
17770 case "{":
17771 a[l]++;
17772 break;
17773
17774 case ")":
17775 case "]":
17776 case "}":
17777 a[l]--, a[l] === -1 && (o = "bracket", u = !0);
17778 }
17779 } else s && s.type.indexOf("tag-name") !== -1 && (isNaN(a[s.value]) && (a[s.value] = 0), i.value === "<" ? a[s.value]++ : i.value === "</" && a[s.value]--, a[s.value] === -1 && (o = "tag", u = !0));
17780 u || (i = s, s = r.stepForward(), f = 0);
17781 } while (s && !u);
17782
17783 if (!o) return;
17784 var h, d;
17785
17786 if (o === "bracket") {
17787 h = this.session.getBracketRange(n);
17788
17789 if (!h) {
17790 h = new p(r.getCurrentTokenRow(), r.getCurrentTokenColumn() + f - 1, r.getCurrentTokenRow(), r.getCurrentTokenColumn() + f - 1), d = h.start;
17791 if (t || d.row === n.row && Math.abs(d.column - n.column) < 2) h = this.session.getBracketRange(d);
17792 }
17793 } else if (o === "tag") {
17794 if (!s || s.type.indexOf("tag-name") === -1) return;
17795 var v = s.value;
17796 h = new p(r.getCurrentTokenRow(), r.getCurrentTokenColumn() - 2, r.getCurrentTokenRow(), r.getCurrentTokenColumn() - 2);
17797
17798 if (h.compare(n.row, n.column) === 0) {
17799 u = !1;
17800
17801 do {
17802 s = i, i = r.stepBackward(), i && (i.type.indexOf("tag-close") !== -1 && h.setEnd(r.getCurrentTokenRow(), r.getCurrentTokenColumn() + 1), s.value === v && s.type.indexOf("tag-name") !== -1 && (i.value === "<" ? a[v]++ : i.value === "</" && a[v]--, a[v] === 0 && (u = !0)));
17803 } while (i && !u);
17804 }
17805
17806 s && s.type.indexOf("tag-name") && (d = h.start, d.row == n.row && Math.abs(d.column - n.column) < 2 && (d = h.end));
17807 }
17808
17809 d = h && h.cursor || d, d && (e ? h && t ? this.selection.setRange(h) : h && h.isEqual(this.getSelectionRange()) ? this.clearSelection() : this.selection.selectTo(d.row, d.column) : this.selection.moveTo(d.row, d.column));
17810 }, this.gotoLine = function (e, t, n) {
17811 this.selection.clearSelection(), this.session.unfold({
17812 row: e - 1,
17813 column: t || 0
17814 }), this.$blockScrolling += 1, this.exitMultiSelectMode && this.exitMultiSelectMode(), this.moveCursorTo(e - 1, t || 0), this.$blockScrolling -= 1, this.isRowFullyVisible(e - 1) || this.scrollToLine(e - 1, !0, n);
17815 }, this.navigateTo = function (e, t) {
17816 this.selection.moveTo(e, t);
17817 }, this.navigateUp = function (e) {
17818 if (this.selection.isMultiLine() && !this.selection.isBackwards()) {
17819 var t = this.selection.anchor.getPosition();
17820 return this.moveCursorToPosition(t);
17821 }
17822
17823 this.selection.clearSelection(), this.selection.moveCursorBy(-e || -1, 0);
17824 }, this.navigateDown = function (e) {
17825 if (this.selection.isMultiLine() && this.selection.isBackwards()) {
17826 var t = this.selection.anchor.getPosition();
17827 return this.moveCursorToPosition(t);
17828 }
17829
17830 this.selection.clearSelection(), this.selection.moveCursorBy(e || 1, 0);
17831 }, this.navigateLeft = function (e) {
17832 if (!this.selection.isEmpty()) {
17833 var t = this.getSelectionRange().start;
17834 this.moveCursorToPosition(t);
17835 } else {
17836 e = e || 1;
17837
17838 while (e--) {
17839 this.selection.moveCursorLeft();
17840 }
17841 }
17842
17843 this.clearSelection();
17844 }, this.navigateRight = function (e) {
17845 if (!this.selection.isEmpty()) {
17846 var t = this.getSelectionRange().end;
17847 this.moveCursorToPosition(t);
17848 } else {
17849 e = e || 1;
17850
17851 while (e--) {
17852 this.selection.moveCursorRight();
17853 }
17854 }
17855
17856 this.clearSelection();
17857 }, this.navigateLineStart = function () {
17858 this.selection.moveCursorLineStart(), this.clearSelection();
17859 }, this.navigateLineEnd = function () {
17860 this.selection.moveCursorLineEnd(), this.clearSelection();
17861 }, this.navigateFileEnd = function () {
17862 this.selection.moveCursorFileEnd(), this.clearSelection();
17863 }, this.navigateFileStart = function () {
17864 this.selection.moveCursorFileStart(), this.clearSelection();
17865 }, this.navigateWordRight = function () {
17866 this.selection.moveCursorWordRight(), this.clearSelection();
17867 }, this.navigateWordLeft = function () {
17868 this.selection.moveCursorWordLeft(), this.clearSelection();
17869 }, this.replace = function (e, t) {
17870 t && this.$search.set(t);
17871 var n = this.$search.find(this.session),
17872 r = 0;
17873 return n ? (this.$tryReplace(n, e) && (r = 1), n !== null && (this.selection.setSelectionRange(n), this.renderer.scrollSelectionIntoView(n.start, n.end)), r) : r;
17874 }, this.replaceAll = function (e, t) {
17875 t && this.$search.set(t);
17876 var n = this.$search.findAll(this.session),
17877 r = 0;
17878 if (!n.length) return r;
17879 this.$blockScrolling += 1;
17880 var i = this.getSelectionRange();
17881 this.selection.moveTo(0, 0);
17882
17883 for (var s = n.length - 1; s >= 0; --s) {
17884 this.$tryReplace(n[s], e) && r++;
17885 }
17886
17887 return this.selection.setSelectionRange(i), this.$blockScrolling -= 1, r;
17888 }, this.$tryReplace = function (e, t) {
17889 var n = this.session.getTextRange(e);
17890 return t = this.$search.replace(n, t), t !== null ? (e.end = this.session.replace(e, t), e) : null;
17891 }, this.getLastSearchOptions = function () {
17892 return this.$search.getOptions();
17893 }, this.find = function (e, t, n) {
17894 t || (t = {}), typeof e == "string" || e instanceof RegExp ? t.needle = e : _typeof(e) == "object" && r.mixin(t, e);
17895 var i = this.selection.getRange();
17896 t.needle == null && (e = this.session.getTextRange(i) || this.$search.$options.needle, e || (i = this.session.getWordRange(i.start.row, i.start.column), e = this.session.getTextRange(i)), this.$search.set({
17897 needle: e
17898 })), this.$search.set(t), t.start || this.$search.set({
17899 start: i
17900 });
17901 var s = this.$search.find(this.session);
17902 if (t.preventScroll) return s;
17903 if (s) return this.revealRange(s, n), s;
17904 t.backwards ? i.start = i.end : i.end = i.start, this.selection.setRange(i);
17905 }, this.findNext = function (e, t) {
17906 this.find({
17907 skipCurrent: !0,
17908 backwards: !1
17909 }, e, t);
17910 }, this.findPrevious = function (e, t) {
17911 this.find(e, {
17912 skipCurrent: !0,
17913 backwards: !0
17914 }, t);
17915 }, this.revealRange = function (e, t) {
17916 this.$blockScrolling += 1, this.session.unfold(e), this.selection.setSelectionRange(e), this.$blockScrolling -= 1;
17917 var n = this.renderer.scrollTop;
17918 this.renderer.scrollSelectionIntoView(e.start, e.end, .5), t !== !1 && this.renderer.animateScrolling(n);
17919 }, this.undo = function () {
17920 this.$blockScrolling++, this.session.getUndoManager().undo(), this.$blockScrolling--, this.renderer.scrollCursorIntoView(null, .5);
17921 }, this.redo = function () {
17922 this.$blockScrolling++, this.session.getUndoManager().redo(), this.$blockScrolling--, this.renderer.scrollCursorIntoView(null, .5);
17923 }, this.destroy = function () {
17924 this.renderer.destroy(), this._signal("destroy", this), this.session && this.session.destroy();
17925 }, this.setAutoScrollEditorIntoView = function (e) {
17926 if (!e) return;
17927 var t,
17928 n = this,
17929 r = !1;
17930 this.$scrollAnchor || (this.$scrollAnchor = document.createElement("div"));
17931 var i = this.$scrollAnchor;
17932 i.style.cssText = "position:absolute", this.container.insertBefore(i, this.container.firstChild);
17933 var s = this.on("changeSelection", function () {
17934 r = !0;
17935 }),
17936 o = this.renderer.on("beforeRender", function () {
17937 r && (t = n.renderer.container.getBoundingClientRect());
17938 }),
17939 u = this.renderer.on("afterRender", function () {
17940 if (r && t && (n.isFocused() || n.searchBox && n.searchBox.isFocused())) {
17941 var e = n.renderer,
17942 s = e.$cursorLayer.$pixelPos,
17943 o = e.layerConfig,
17944 u = s.top - o.offset;
17945 s.top >= 0 && u + t.top < 0 ? r = !0 : s.top < o.height && s.top + t.top + o.lineHeight > window.innerHeight ? r = !1 : r = null, r != null && (i.style.top = u + "px", i.style.left = s.left + "px", i.style.height = o.lineHeight + "px", i.scrollIntoView(r)), r = t = null;
17946 }
17947 });
17948
17949 this.setAutoScrollEditorIntoView = function (e) {
17950 if (e) return;
17951 delete this.setAutoScrollEditorIntoView, this.off("changeSelection", s), this.renderer.off("afterRender", u), this.renderer.off("beforeRender", o);
17952 };
17953 }, this.$resetCursorStyle = function () {
17954 var e = this.$cursorStyle || "ace",
17955 t = this.renderer.$cursorLayer;
17956 if (!t) return;
17957 t.setSmoothBlinking(/smooth/.test(e)), t.isBlinking = !this.$readOnly && e != "wide", i.setCssClass(t.element, "ace_slim-cursors", /slim/.test(e));
17958 };
17959 }.call(b.prototype), g.defineOptions(b.prototype, "editor", {
17960 selectionStyle: {
17961 set: function set(e) {
17962 this.onSelectionChange(), this._signal("changeSelectionStyle", {
17963 data: e
17964 });
17965 },
17966 initialValue: "line"
17967 },
17968 highlightActiveLine: {
17969 set: function set() {
17970 this.$updateHighlightActiveLine();
17971 },
17972 initialValue: !0
17973 },
17974 highlightSelectedWord: {
17975 set: function set(e) {
17976 this.$onSelectionChange();
17977 },
17978 initialValue: !0
17979 },
17980 readOnly: {
17981 set: function set(e) {
17982 this.$resetCursorStyle();
17983 },
17984 initialValue: !1
17985 },
17986 cursorStyle: {
17987 set: function set(e) {
17988 this.$resetCursorStyle();
17989 },
17990 values: ["ace", "slim", "smooth", "wide"],
17991 initialValue: "ace"
17992 },
17993 mergeUndoDeltas: {
17994 values: [!1, !0, "always"],
17995 initialValue: !0
17996 },
17997 behavioursEnabled: {
17998 initialValue: !0
17999 },
18000 wrapBehavioursEnabled: {
18001 initialValue: !0
18002 },
18003 autoScrollEditorIntoView: {
18004 set: function set(e) {
18005 this.setAutoScrollEditorIntoView(e);
18006 }
18007 },
18008 keyboardHandler: {
18009 set: function set(e) {
18010 this.setKeyboardHandler(e);
18011 },
18012 get: function get() {
18013 return this.keybindingId;
18014 },
18015 handlesSet: !0
18016 },
18017 hScrollBarAlwaysVisible: "renderer",
18018 vScrollBarAlwaysVisible: "renderer",
18019 highlightGutterLine: "renderer",
18020 animatedScroll: "renderer",
18021 showInvisibles: "renderer",
18022 showPrintMargin: "renderer",
18023 printMarginColumn: "renderer",
18024 printMargin: "renderer",
18025 fadeFoldWidgets: "renderer",
18026 showFoldWidgets: "renderer",
18027 showLineNumbers: "renderer",
18028 showGutter: "renderer",
18029 displayIndentGuides: "renderer",
18030 fontSize: "renderer",
18031 fontFamily: "renderer",
18032 maxLines: "renderer",
18033 minLines: "renderer",
18034 scrollPastEnd: "renderer",
18035 fixedWidthGutter: "renderer",
18036 theme: "renderer",
18037 scrollSpeed: "$mouseHandler",
18038 dragDelay: "$mouseHandler",
18039 dragEnabled: "$mouseHandler",
18040 focusTimout: "$mouseHandler",
18041 tooltipFollowsMouse: "$mouseHandler",
18042 firstLineNumber: "session",
18043 overwrite: "session",
18044 newLineMode: "session",
18045 useWorker: "session",
18046 useSoftTabs: "session",
18047 tabSize: "session",
18048 wrap: "session",
18049 indentedSoftWrap: "session",
18050 foldStyle: "session",
18051 mode: "session"
18052 }), t.Editor = b;
18053 }), ace.define("ace/undomanager", ["require", "exports", "module"], function (e, t, n) {
18054 "use strict";
18055
18056 var r = function r() {
18057 this.reset();
18058 };
18059
18060 (function () {
18061 function e(e) {
18062 return {
18063 action: e.action,
18064 start: e.start,
18065 end: e.end,
18066 lines: e.lines.length == 1 ? null : e.lines,
18067 text: e.lines.length == 1 ? e.lines[0] : null
18068 };
18069 }
18070
18071 function t(e) {
18072 return {
18073 action: e.action,
18074 start: e.start,
18075 end: e.end,
18076 lines: e.lines || [e.text]
18077 };
18078 }
18079
18080 function n(e, t) {
18081 var n = new Array(e.length);
18082
18083 for (var r = 0; r < e.length; r++) {
18084 var i = e[r],
18085 s = {
18086 group: i.group,
18087 deltas: new Array(i.length)
18088 };
18089
18090 for (var o = 0; o < i.deltas.length; o++) {
18091 var u = i.deltas[o];
18092 s.deltas[o] = t(u);
18093 }
18094
18095 n[r] = s;
18096 }
18097
18098 return n;
18099 }
18100
18101 this.execute = function (e) {
18102 var t = e.args[0];
18103 this.$doc = e.args[1], e.merge && this.hasUndo() && (this.dirtyCounter--, t = this.$undoStack.pop().concat(t)), this.$undoStack.push(t), this.$redoStack = [], this.dirtyCounter < 0 && (this.dirtyCounter = NaN), this.dirtyCounter++;
18104 }, this.undo = function (e) {
18105 var t = this.$undoStack.pop(),
18106 n = null;
18107 return t && (n = this.$doc.undoChanges(t, e), this.$redoStack.push(t), this.dirtyCounter--), n;
18108 }, this.redo = function (e) {
18109 var t = this.$redoStack.pop(),
18110 n = null;
18111 return t && (n = this.$doc.redoChanges(this.$deserializeDeltas(t), e), this.$undoStack.push(t), this.dirtyCounter++), n;
18112 }, this.reset = function () {
18113 this.$undoStack = [], this.$redoStack = [], this.dirtyCounter = 0;
18114 }, this.hasUndo = function () {
18115 return this.$undoStack.length > 0;
18116 }, this.hasRedo = function () {
18117 return this.$redoStack.length > 0;
18118 }, this.markClean = function () {
18119 this.dirtyCounter = 0;
18120 }, this.isClean = function () {
18121 return this.dirtyCounter === 0;
18122 }, this.$serializeDeltas = function (t) {
18123 return n(t, e);
18124 }, this.$deserializeDeltas = function (e) {
18125 return n(e, t);
18126 };
18127 }).call(r.prototype), t.UndoManager = r;
18128 }), ace.define("ace/layer/gutter", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter"], function (e, t, n) {
18129 "use strict";
18130
18131 var r = e("../lib/dom"),
18132 i = e("../lib/oop"),
18133 s = e("../lib/lang"),
18134 o = e("../lib/event_emitter").EventEmitter,
18135 u = function u(e) {
18136 this.element = r.createElement("div"), this.element.className = "ace_layer ace_gutter-layer", e.appendChild(this.element), this.setShowFoldWidgets(this.$showFoldWidgets), this.gutterWidth = 0, this.$annotations = [], this.$updateAnnotations = this.$updateAnnotations.bind(this), this.$cells = [];
18137 };
18138
18139 (function () {
18140 i.implement(this, o), this.setSession = function (e) {
18141 this.session && this.session.removeEventListener("change", this.$updateAnnotations), this.session = e, e && e.on("change", this.$updateAnnotations);
18142 }, this.addGutterDecoration = function (e, t) {
18143 window.console && console.warn && console.warn("deprecated use session.addGutterDecoration"), this.session.addGutterDecoration(e, t);
18144 }, this.removeGutterDecoration = function (e, t) {
18145 window.console && console.warn && console.warn("deprecated use session.removeGutterDecoration"), this.session.removeGutterDecoration(e, t);
18146 }, this.setAnnotations = function (e) {
18147 this.$annotations = [];
18148
18149 for (var t = 0; t < e.length; t++) {
18150 var n = e[t],
18151 r = n.row,
18152 i = this.$annotations[r];
18153 i || (i = this.$annotations[r] = {
18154 text: []
18155 });
18156 var o = n.text;
18157 o = o ? s.escapeHTML(o) : n.html || "", i.text.indexOf(o) === -1 && i.text.push(o);
18158 var u = n.type;
18159 u == "error" ? i.className = " ace_error" : u == "warning" && i.className != " ace_error" ? i.className = " ace_warning" : u == "info" && !i.className && (i.className = " ace_info");
18160 }
18161 }, this.$updateAnnotations = function (e) {
18162 if (!this.$annotations.length) return;
18163 var t = e.start.row,
18164 n = e.end.row - t;
18165 if (n !== 0) if (e.action == "remove") this.$annotations.splice(t, n + 1, null);else {
18166 var r = new Array(n + 1);
18167 r.unshift(t, 1), this.$annotations.splice.apply(this.$annotations, r);
18168 }
18169 }, this.update = function (e) {
18170 var t = this.session,
18171 n = e.firstRow,
18172 i = Math.min(e.lastRow + e.gutterOffset, t.getLength() - 1),
18173 s = t.getNextFoldLine(n),
18174 o = s ? s.start.row : Infinity,
18175 u = this.$showFoldWidgets && t.foldWidgets,
18176 a = t.$breakpoints,
18177 f = t.$decorations,
18178 l = t.$firstLineNumber,
18179 c = 0,
18180 h = t.gutterRenderer || this.$renderer,
18181 p = null,
18182 d = -1,
18183 v = n;
18184
18185 for (;;) {
18186 v > o && (v = s.end.row + 1, s = t.getNextFoldLine(v, s), o = s ? s.start.row : Infinity);
18187
18188 if (v > i) {
18189 while (this.$cells.length > d + 1) {
18190 p = this.$cells.pop(), this.element.removeChild(p.element);
18191 }
18192
18193 break;
18194 }
18195
18196 p = this.$cells[++d], p || (p = {
18197 element: null,
18198 textNode: null,
18199 foldWidget: null
18200 }, p.element = r.createElement("div"), p.textNode = document.createTextNode(""), p.element.appendChild(p.textNode), this.element.appendChild(p.element), this.$cells[d] = p);
18201 var m = "ace_gutter-cell ";
18202 a[v] && (m += a[v]), f[v] && (m += f[v]), this.$annotations[v] && (m += this.$annotations[v].className), p.element.className != m && (p.element.className = m);
18203 var g = t.getRowLength(v) * e.lineHeight + "px";
18204 g != p.element.style.height && (p.element.style.height = g);
18205
18206 if (u) {
18207 var y = u[v];
18208 y == null && (y = u[v] = t.getFoldWidget(v));
18209 }
18210
18211 if (y) {
18212 p.foldWidget || (p.foldWidget = r.createElement("span"), p.element.appendChild(p.foldWidget));
18213 var m = "ace_fold-widget ace_" + y;
18214 y == "start" && v == o && v < s.end.row ? m += " ace_closed" : m += " ace_open", p.foldWidget.className != m && (p.foldWidget.className = m);
18215 var g = e.lineHeight + "px";
18216 p.foldWidget.style.height != g && (p.foldWidget.style.height = g);
18217 } else p.foldWidget && (p.element.removeChild(p.foldWidget), p.foldWidget = null);
18218
18219 var b = c = h ? h.getText(t, v) : v + l;
18220 b !== p.textNode.data && (p.textNode.data = b), v++;
18221 }
18222
18223 this.element.style.height = e.minHeight + "px";
18224 if (this.$fixedWidth || t.$useWrapMode) c = t.getLength() + l;
18225 var w = h ? h.getWidth(t, c, e) : c.toString().length * e.characterWidth,
18226 E = this.$padding || this.$computePadding();
18227 w += E.left + E.right, w !== this.gutterWidth && !isNaN(w) && (this.gutterWidth = w, this.element.style.width = Math.ceil(this.gutterWidth) + "px", this._emit("changeGutterWidth", w));
18228 }, this.$fixedWidth = !1, this.$showLineNumbers = !0, this.$renderer = "", this.setShowLineNumbers = function (e) {
18229 this.$renderer = !e && {
18230 getWidth: function getWidth() {
18231 return "";
18232 },
18233 getText: function getText() {
18234 return "";
18235 }
18236 };
18237 }, this.getShowLineNumbers = function () {
18238 return this.$showLineNumbers;
18239 }, this.$showFoldWidgets = !0, this.setShowFoldWidgets = function (e) {
18240 e ? r.addCssClass(this.element, "ace_folding-enabled") : r.removeCssClass(this.element, "ace_folding-enabled"), this.$showFoldWidgets = e, this.$padding = null;
18241 }, this.getShowFoldWidgets = function () {
18242 return this.$showFoldWidgets;
18243 }, this.$computePadding = function () {
18244 if (!this.element.firstChild) return {
18245 left: 0,
18246 right: 0
18247 };
18248 var e = r.computedStyle(this.element.firstChild);
18249 return this.$padding = {}, this.$padding.left = parseInt(e.paddingLeft) + 1 || 0, this.$padding.right = parseInt(e.paddingRight) || 0, this.$padding;
18250 }, this.getRegion = function (e) {
18251 var t = this.$padding || this.$computePadding(),
18252 n = this.element.getBoundingClientRect();
18253 if (e.x < t.left + n.left) return "markers";
18254 if (this.$showFoldWidgets && e.x > n.right - t.right) return "foldWidgets";
18255 };
18256 }).call(u.prototype), t.Gutter = u;
18257 }), ace.define("ace/layer/marker", ["require", "exports", "module", "ace/range", "ace/lib/dom"], function (e, t, n) {
18258 "use strict";
18259
18260 var r = e("../range").Range,
18261 i = e("../lib/dom"),
18262 s = function s(e) {
18263 this.element = i.createElement("div"), this.element.className = "ace_layer ace_marker-layer", e.appendChild(this.element);
18264 };
18265
18266 (function () {
18267 function e(e, t, n, r) {
18268 return (e ? 1 : 0) | (t ? 2 : 0) | (n ? 4 : 0) | (r ? 8 : 0);
18269 }
18270
18271 this.$padding = 0, this.setPadding = function (e) {
18272 this.$padding = e;
18273 }, this.setSession = function (e) {
18274 this.session = e;
18275 }, this.setMarkers = function (e) {
18276 this.markers = e;
18277 }, this.update = function (e) {
18278 if (!e) return;
18279 this.config = e;
18280 var t = [];
18281
18282 for (var n in this.markers) {
18283 var r = this.markers[n];
18284
18285 if (!r.range) {
18286 r.update(t, this, this.session, e);
18287 continue;
18288 }
18289
18290 var i = r.range.clipRows(e.firstRow, e.lastRow);
18291 if (i.isEmpty()) continue;
18292 i = i.toScreenRange(this.session);
18293
18294 if (r.renderer) {
18295 var s = this.$getTop(i.start.row, e),
18296 o = this.$padding + i.start.column * e.characterWidth;
18297 r.renderer(t, i, o, s, e);
18298 } else r.type == "fullLine" ? this.drawFullLineMarker(t, i, r.clazz, e) : r.type == "screenLine" ? this.drawScreenLineMarker(t, i, r.clazz, e) : i.isMultiLine() ? r.type == "text" ? this.drawTextMarker(t, i, r.clazz, e) : this.drawMultiLineMarker(t, i, r.clazz, e) : this.drawSingleLineMarker(t, i, r.clazz + " ace_start" + " ace_br15", e);
18299 }
18300
18301 this.element.innerHTML = t.join("");
18302 }, this.$getTop = function (e, t) {
18303 return (e - t.firstRowScreen) * t.lineHeight;
18304 }, this.drawTextMarker = function (t, n, i, s, o) {
18305 var u = this.session,
18306 a = n.start.row,
18307 f = n.end.row,
18308 l = a,
18309 c = 0,
18310 h = 0,
18311 p = u.getScreenLastRowColumn(l),
18312 d = new r(l, n.start.column, l, h);
18313
18314 for (; l <= f; l++) {
18315 d.start.row = d.end.row = l, d.start.column = l == a ? n.start.column : u.getRowWrapIndent(l), d.end.column = p, c = h, h = p, p = l + 1 < f ? u.getScreenLastRowColumn(l + 1) : l == f ? 0 : n.end.column, this.drawSingleLineMarker(t, d, i + (l == a ? " ace_start" : "") + " ace_br" + e(l == a || l == a + 1 && n.start.column, c < h, h > p, l == f), s, l == f ? 0 : 1, o);
18316 }
18317 }, this.drawMultiLineMarker = function (e, t, n, r, i) {
18318 var s = this.$padding,
18319 o = r.lineHeight,
18320 u = this.$getTop(t.start.row, r),
18321 a = s + t.start.column * r.characterWidth;
18322 i = i || "", e.push("<div class='", n, " ace_br1 ace_start' style='", "height:", o, "px;", "right:0;", "top:", u, "px;", "left:", a, "px;", i, "'></div>"), u = this.$getTop(t.end.row, r);
18323 var f = t.end.column * r.characterWidth;
18324 e.push("<div class='", n, " ace_br12' style='", "height:", o, "px;", "width:", f, "px;", "top:", u, "px;", "left:", s, "px;", i, "'></div>"), o = (t.end.row - t.start.row - 1) * r.lineHeight;
18325 if (o <= 0) return;
18326 u = this.$getTop(t.start.row + 1, r);
18327 var l = (t.start.column ? 1 : 0) | (t.end.column ? 0 : 8);
18328 e.push("<div class='", n, l ? " ace_br" + l : "", "' style='", "height:", o, "px;", "right:0;", "top:", u, "px;", "left:", s, "px;", i, "'></div>");
18329 }, this.drawSingleLineMarker = function (e, t, n, r, i, s) {
18330 var o = r.lineHeight,
18331 u = (t.end.column + (i || 0) - t.start.column) * r.characterWidth,
18332 a = this.$getTop(t.start.row, r),
18333 f = this.$padding + t.start.column * r.characterWidth;
18334 e.push("<div class='", n, "' style='", "height:", o, "px;", "width:", u, "px;", "top:", a, "px;", "left:", f, "px;", s || "", "'></div>");
18335 }, this.drawFullLineMarker = function (e, t, n, r, i) {
18336 var s = this.$getTop(t.start.row, r),
18337 o = r.lineHeight;
18338 t.start.row != t.end.row && (o += this.$getTop(t.end.row, r) - s), e.push("<div class='", n, "' style='", "height:", o, "px;", "top:", s, "px;", "left:0;right:0;", i || "", "'></div>");
18339 }, this.drawScreenLineMarker = function (e, t, n, r, i) {
18340 var s = this.$getTop(t.start.row, r),
18341 o = r.lineHeight;
18342 e.push("<div class='", n, "' style='", "height:", o, "px;", "top:", s, "px;", "left:0;right:0;", i || "", "'></div>");
18343 };
18344 }).call(s.prototype), t.Marker = s;
18345 }), ace.define("ace/layer/text", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/lib/event_emitter"], function (e, t, n) {
18346 "use strict";
18347
18348 var r = e("../lib/oop"),
18349 i = e("../lib/dom"),
18350 s = e("../lib/lang"),
18351 o = e("../lib/useragent"),
18352 u = e("../lib/event_emitter").EventEmitter,
18353 a = function a(e) {
18354 this.element = i.createElement("div"), this.element.className = "ace_layer ace_text-layer", e.appendChild(this.element), this.$updateEolChar = this.$updateEolChar.bind(this);
18355 };
18356
18357 (function () {
18358 r.implement(this, u), this.EOF_CHAR = "\xB6", this.EOL_CHAR_LF = "\xAC", this.EOL_CHAR_CRLF = "\xA4", this.EOL_CHAR = this.EOL_CHAR_LF, this.TAB_CHAR = "\u2014", this.SPACE_CHAR = "\xB7", this.$padding = 0, this.$updateEolChar = function () {
18359 var e = this.session.doc.getNewLineCharacter() == "\n" ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;
18360 if (this.EOL_CHAR != e) return this.EOL_CHAR = e, !0;
18361 }, this.setPadding = function (e) {
18362 this.$padding = e, this.element.style.padding = "0 " + e + "px";
18363 }, this.getLineHeight = function () {
18364 return this.$fontMetrics.$characterSize.height || 0;
18365 }, this.getCharacterWidth = function () {
18366 return this.$fontMetrics.$characterSize.width || 0;
18367 }, this.$setFontMetrics = function (e) {
18368 this.$fontMetrics = e, this.$fontMetrics.on("changeCharacterSize", function (e) {
18369 this._signal("changeCharacterSize", e);
18370 }.bind(this)), this.$pollSizeChanges();
18371 }, this.checkForSizeChanges = function () {
18372 this.$fontMetrics.checkForSizeChanges();
18373 }, this.$pollSizeChanges = function () {
18374 return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();
18375 }, this.setSession = function (e) {
18376 this.session = e, e && this.$computeTabString();
18377 }, this.showInvisibles = !1, this.setShowInvisibles = function (e) {
18378 return this.showInvisibles == e ? !1 : (this.showInvisibles = e, this.$computeTabString(), !0);
18379 }, this.displayIndentGuides = !0, this.setDisplayIndentGuides = function (e) {
18380 return this.displayIndentGuides == e ? !1 : (this.displayIndentGuides = e, this.$computeTabString(), !0);
18381 }, this.$tabStrings = [], this.onChangeTabSize = this.$computeTabString = function () {
18382 var e = this.session.getTabSize();
18383 this.tabSize = e;
18384 var t = this.$tabStrings = [0];
18385
18386 for (var n = 1; n < e + 1; n++) {
18387 this.showInvisibles ? t.push("<span class='ace_invisible ace_invisible_tab'>" + s.stringRepeat(this.TAB_CHAR, n) + "</span>") : t.push(s.stringRepeat(" ", n));
18388 }
18389
18390 if (this.displayIndentGuides) {
18391 this.$indentGuideRe = /\s\S| \t|\t |\s$/;
18392 var r = "ace_indent-guide",
18393 i = "",
18394 o = "";
18395
18396 if (this.showInvisibles) {
18397 r += " ace_invisible", i = " ace_invisible_space", o = " ace_invisible_tab";
18398 var u = s.stringRepeat(this.SPACE_CHAR, this.tabSize),
18399 a = s.stringRepeat(this.TAB_CHAR, this.tabSize);
18400 } else var u = s.stringRepeat(" ", this.tabSize),
18401 a = u;
18402
18403 this.$tabStrings[" "] = "<span class='" + r + i + "'>" + u + "</span>", this.$tabStrings[" "] = "<span class='" + r + o + "'>" + a + "</span>";
18404 }
18405 }, this.updateLines = function (e, t, n) {
18406 (this.config.lastRow != e.lastRow || this.config.firstRow != e.firstRow) && this.scrollLines(e), this.config = e;
18407 var r = Math.max(t, e.firstRow),
18408 i = Math.min(n, e.lastRow),
18409 s = this.element.childNodes,
18410 o = 0;
18411
18412 for (var u = e.firstRow; u < r; u++) {
18413 var a = this.session.getFoldLine(u);
18414
18415 if (a) {
18416 if (a.containsRow(r)) {
18417 r = a.start.row;
18418 break;
18419 }
18420
18421 u = a.end.row;
18422 }
18423
18424 o++;
18425 }
18426
18427 var u = r,
18428 a = this.session.getNextFoldLine(u),
18429 f = a ? a.start.row : Infinity;
18430
18431 for (;;) {
18432 u > f && (u = a.end.row + 1, a = this.session.getNextFoldLine(u, a), f = a ? a.start.row : Infinity);
18433 if (u > i) break;
18434 var l = s[o++];
18435
18436 if (l) {
18437 var c = [];
18438 this.$renderLine(c, u, !this.$useLineGroups(), u == f ? a : !1), l.style.height = e.lineHeight * this.session.getRowLength(u) + "px", l.innerHTML = c.join("");
18439 }
18440
18441 u++;
18442 }
18443 }, this.scrollLines = function (e) {
18444 var t = this.config;
18445 this.config = e;
18446 if (!t || t.lastRow < e.firstRow) return this.update(e);
18447 if (e.lastRow < t.firstRow) return this.update(e);
18448 var n = this.element;
18449 if (t.firstRow < e.firstRow) for (var r = this.session.getFoldedRowCount(t.firstRow, e.firstRow - 1); r > 0; r--) {
18450 n.removeChild(n.firstChild);
18451 }
18452 if (t.lastRow > e.lastRow) for (var r = this.session.getFoldedRowCount(e.lastRow + 1, t.lastRow); r > 0; r--) {
18453 n.removeChild(n.lastChild);
18454 }
18455
18456 if (e.firstRow < t.firstRow) {
18457 var i = this.$renderLinesFragment(e, e.firstRow, t.firstRow - 1);
18458 n.firstChild ? n.insertBefore(i, n.firstChild) : n.appendChild(i);
18459 }
18460
18461 if (e.lastRow > t.lastRow) {
18462 var i = this.$renderLinesFragment(e, t.lastRow + 1, e.lastRow);
18463 n.appendChild(i);
18464 }
18465 }, this.$renderLinesFragment = function (e, t, n) {
18466 var r = this.element.ownerDocument.createDocumentFragment(),
18467 s = t,
18468 o = this.session.getNextFoldLine(s),
18469 u = o ? o.start.row : Infinity;
18470
18471 for (;;) {
18472 s > u && (s = o.end.row + 1, o = this.session.getNextFoldLine(s, o), u = o ? o.start.row : Infinity);
18473 if (s > n) break;
18474 var a = i.createElement("div"),
18475 f = [];
18476 this.$renderLine(f, s, !1, s == u ? o : !1), a.innerHTML = f.join("");
18477 if (this.$useLineGroups()) a.className = "ace_line_group", r.appendChild(a), a.style.height = e.lineHeight * this.session.getRowLength(s) + "px";else while (a.firstChild) {
18478 r.appendChild(a.firstChild);
18479 }
18480 s++;
18481 }
18482
18483 return r;
18484 }, this.update = function (e) {
18485 this.config = e;
18486 var t = [],
18487 n = e.firstRow,
18488 r = e.lastRow,
18489 i = n,
18490 s = this.session.getNextFoldLine(i),
18491 o = s ? s.start.row : Infinity;
18492
18493 for (;;) {
18494 i > o && (i = s.end.row + 1, s = this.session.getNextFoldLine(i, s), o = s ? s.start.row : Infinity);
18495 if (i > r) break;
18496 this.$useLineGroups() && t.push("<div class='ace_line_group' style='height:", e.lineHeight * this.session.getRowLength(i), "px'>"), this.$renderLine(t, i, !1, i == o ? s : !1), this.$useLineGroups() && t.push("</div>"), i++;
18497 }
18498
18499 this.element.innerHTML = t.join("");
18500 }, this.$textToken = {
18501 text: !0,
18502 rparen: !0,
18503 lparen: !0
18504 }, this.$renderToken = function (e, t, n, r) {
18505 var i = this,
18506 o = /\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF\uFFF9-\uFFFC])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,
18507 u = function u(e, n, r, o, _u) {
18508 if (n) return i.showInvisibles ? "<span class='ace_invisible ace_invisible_space'>" + s.stringRepeat(i.SPACE_CHAR, e.length) + "</span>" : e;
18509 if (e == "&") return "&#38;";
18510 if (e == "<") return "&#60;";
18511 if (e == ">") return "&#62;";
18512
18513 if (e == " ") {
18514 var a = i.session.getScreenTabSize(t + o);
18515 return t += a - 1, i.$tabStrings[a];
18516 }
18517
18518 if (e == "\u3000") {
18519 var f = i.showInvisibles ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk",
18520 l = i.showInvisibles ? i.SPACE_CHAR : "";
18521 return t += 1, "<span class='" + f + "' style='width:" + i.config.characterWidth * 2 + "px'>" + l + "</span>";
18522 }
18523
18524 return r ? "<span class='ace_invisible ace_invisible_space ace_invalid'>" + i.SPACE_CHAR + "</span>" : (t += 1, "<span class='ace_cjk' style='width:" + i.config.characterWidth * 2 + "px'>" + e + "</span>");
18525 },
18526 a = r.replace(o, u);
18527
18528 if (!this.$textToken[n.type]) {
18529 var f = "ace_" + n.type.replace(/\./g, " ace_"),
18530 l = "";
18531 n.type == "fold" && (l = " style='width:" + n.value.length * this.config.characterWidth + "px;' "), e.push("<span class='", f, "'", l, ">", a, "</span>");
18532 } else e.push(a);
18533
18534 return t + r.length;
18535 }, this.renderIndentGuide = function (e, t, n) {
18536 var r = t.search(this.$indentGuideRe);
18537 return r <= 0 || r >= n ? t : t[0] == " " ? (r -= r % this.tabSize, e.push(s.stringRepeat(this.$tabStrings[" "], r / this.tabSize)), t.substr(r)) : t[0] == " " ? (e.push(s.stringRepeat(this.$tabStrings[" "], r)), t.substr(r)) : t;
18538 }, this.$renderWrappedLine = function (e, t, n, r) {
18539 var i = 0,
18540 o = 0,
18541 u = n[0],
18542 a = 0;
18543
18544 for (var f = 0; f < t.length; f++) {
18545 var l = t[f],
18546 c = l.value;
18547
18548 if (f == 0 && this.displayIndentGuides) {
18549 i = c.length, c = this.renderIndentGuide(e, c, u);
18550 if (!c) continue;
18551 i -= c.length;
18552 }
18553
18554 if (i + c.length < u) a = this.$renderToken(e, a, l, c), i += c.length;else {
18555 while (i + c.length >= u) {
18556 a = this.$renderToken(e, a, l, c.substring(0, u - i)), c = c.substring(u - i), i = u, r || e.push("</div>", "<div class='ace_line' style='height:", this.config.lineHeight, "px'>"), e.push(s.stringRepeat("\xA0", n.indent)), o++, a = 0, u = n[o] || Number.MAX_VALUE;
18557 }
18558
18559 c.length != 0 && (i += c.length, a = this.$renderToken(e, a, l, c));
18560 }
18561 }
18562 }, this.$renderSimpleLine = function (e, t) {
18563 var n = 0,
18564 r = t[0],
18565 i = r.value;
18566 this.displayIndentGuides && (i = this.renderIndentGuide(e, i)), i && (n = this.$renderToken(e, n, r, i));
18567
18568 for (var s = 1; s < t.length; s++) {
18569 r = t[s], i = r.value, n = this.$renderToken(e, n, r, i);
18570 }
18571 }, this.$renderLine = function (e, t, n, r) {
18572 !r && r != 0 && (r = this.session.getFoldLine(t));
18573 if (r) var i = this.$getFoldLineTokens(t, r);else var i = this.session.getTokens(t);
18574 n || e.push("<div class='ace_line' style='height:", this.config.lineHeight * (this.$useLineGroups() ? 1 : this.session.getRowLength(t)), "px'>");
18575
18576 if (i.length) {
18577 var s = this.session.getRowSplitData(t);
18578 s && s.length ? this.$renderWrappedLine(e, i, s, n) : this.$renderSimpleLine(e, i);
18579 }
18580
18581 this.showInvisibles && (r && (t = r.end.row), e.push("<span class='ace_invisible ace_invisible_eol'>", t == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "</span>")), n || e.push("</div>");
18582 }, this.$getFoldLineTokens = function (e, t) {
18583 function i(e, t, n) {
18584 var i = 0,
18585 s = 0;
18586
18587 while (s + e[i].value.length < t) {
18588 s += e[i].value.length, i++;
18589 if (i == e.length) return;
18590 }
18591
18592 if (s != t) {
18593 var o = e[i].value.substring(t - s);
18594 o.length > n - t && (o = o.substring(0, n - t)), r.push({
18595 type: e[i].type,
18596 value: o
18597 }), s = t + o.length, i += 1;
18598 }
18599
18600 while (s < n && i < e.length) {
18601 var o = e[i].value;
18602 o.length + s > n ? r.push({
18603 type: e[i].type,
18604 value: o.substring(0, n - s)
18605 }) : r.push(e[i]), s += o.length, i += 1;
18606 }
18607 }
18608
18609 var n = this.session,
18610 r = [],
18611 s = n.getTokens(e);
18612 return t.walk(function (e, t, o, u, a) {
18613 e != null ? r.push({
18614 type: "fold",
18615 value: e
18616 }) : (a && (s = n.getTokens(t)), s.length && i(s, u, o));
18617 }, t.end.row, this.session.getLine(t.end.row).length), r;
18618 }, this.$useLineGroups = function () {
18619 return this.session.getUseWrapMode();
18620 }, this.destroy = function () {
18621 clearInterval(this.$pollSizeChangesTimer), this.$measureNode && this.$measureNode.parentNode.removeChild(this.$measureNode), delete this.$measureNode;
18622 };
18623 }).call(a.prototype), t.Text = a;
18624 }), ace.define("ace/layer/cursor", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
18625 "use strict";
18626
18627 var r = e("../lib/dom"),
18628 i,
18629 s = function s(e) {
18630 this.element = r.createElement("div"), this.element.className = "ace_layer ace_cursor-layer", e.appendChild(this.element), i === undefined && (i = !("opacity" in this.element.style)), this.isVisible = !1, this.isBlinking = !0, this.blinkInterval = 1e3, this.smoothBlinking = !1, this.cursors = [], this.cursor = this.addCursor(), r.addCssClass(this.element, "ace_hidden-cursors"), this.$updateCursors = (i ? this.$updateVisibility : this.$updateOpacity).bind(this);
18631 };
18632
18633 (function () {
18634 this.$updateVisibility = function (e) {
18635 var t = this.cursors;
18636
18637 for (var n = t.length; n--;) {
18638 t[n].style.visibility = e ? "" : "hidden";
18639 }
18640 }, this.$updateOpacity = function (e) {
18641 var t = this.cursors;
18642
18643 for (var n = t.length; n--;) {
18644 t[n].style.opacity = e ? "" : "0";
18645 }
18646 }, this.$padding = 0, this.setPadding = function (e) {
18647 this.$padding = e;
18648 }, this.setSession = function (e) {
18649 this.session = e;
18650 }, this.setBlinking = function (e) {
18651 e != this.isBlinking && (this.isBlinking = e, this.restartTimer());
18652 }, this.setBlinkInterval = function (e) {
18653 e != this.blinkInterval && (this.blinkInterval = e, this.restartTimer());
18654 }, this.setSmoothBlinking = function (e) {
18655 e != this.smoothBlinking && !i && (this.smoothBlinking = e, r.setCssClass(this.element, "ace_smooth-blinking", e), this.$updateCursors(!0), this.$updateCursors = this.$updateOpacity.bind(this), this.restartTimer());
18656 }, this.addCursor = function () {
18657 var e = r.createElement("div");
18658 return e.className = "ace_cursor", this.element.appendChild(e), this.cursors.push(e), e;
18659 }, this.removeCursor = function () {
18660 if (this.cursors.length > 1) {
18661 var e = this.cursors.pop();
18662 return e.parentNode.removeChild(e), e;
18663 }
18664 }, this.hideCursor = function () {
18665 this.isVisible = !1, r.addCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
18666 }, this.showCursor = function () {
18667 this.isVisible = !0, r.removeCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
18668 }, this.restartTimer = function () {
18669 var e = this.$updateCursors;
18670 clearInterval(this.intervalId), clearTimeout(this.timeoutId), this.smoothBlinking && r.removeCssClass(this.element, "ace_smooth-blinking"), e(!0);
18671 if (!this.isBlinking || !this.blinkInterval || !this.isVisible) return;
18672 this.smoothBlinking && setTimeout(function () {
18673 r.addCssClass(this.element, "ace_smooth-blinking");
18674 }.bind(this));
18675
18676 var t = function () {
18677 this.timeoutId = setTimeout(function () {
18678 e(!1);
18679 }, .6 * this.blinkInterval);
18680 }.bind(this);
18681
18682 this.intervalId = setInterval(function () {
18683 e(!0), t();
18684 }, this.blinkInterval), t();
18685 }, this.getPixelPosition = function (e, t) {
18686 if (!this.config || !this.session) return {
18687 left: 0,
18688 top: 0
18689 };
18690 e || (e = this.session.selection.getCursor());
18691 var n = this.session.documentToScreenPosition(e),
18692 r = this.$padding + n.column * this.config.characterWidth,
18693 i = (n.row - (t ? this.config.firstRowScreen : 0)) * this.config.lineHeight;
18694 return {
18695 left: r,
18696 top: i
18697 };
18698 }, this.update = function (e) {
18699 this.config = e;
18700 var t = this.session.$selectionMarkers,
18701 n = 0,
18702 r = 0;
18703 if (t === undefined || t.length === 0) t = [{
18704 cursor: null
18705 }];
18706
18707 for (var n = 0, i = t.length; n < i; n++) {
18708 var s = this.getPixelPosition(t[n].cursor, !0);
18709 if ((s.top > e.height + e.offset || s.top < 0) && n > 1) continue;
18710 var o = (this.cursors[r++] || this.addCursor()).style;
18711 this.drawCursor ? this.drawCursor(o, s, e, t[n], this.session) : (o.left = s.left + "px", o.top = s.top + "px", o.width = e.characterWidth + "px", o.height = e.lineHeight + "px");
18712 }
18713
18714 while (this.cursors.length > r) {
18715 this.removeCursor();
18716 }
18717
18718 var u = this.session.getOverwrite();
18719 this.$setOverwrite(u), this.$pixelPos = s, this.restartTimer();
18720 }, this.drawCursor = null, this.$setOverwrite = function (e) {
18721 e != this.overwrite && (this.overwrite = e, e ? r.addCssClass(this.element, "ace_overwrite-cursors") : r.removeCssClass(this.element, "ace_overwrite-cursors"));
18722 }, this.destroy = function () {
18723 clearInterval(this.intervalId), clearTimeout(this.timeoutId);
18724 };
18725 }).call(s.prototype), t.Cursor = s;
18726 }), ace.define("ace/scrollbar", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/event", "ace/lib/event_emitter"], function (e, t, n) {
18727 "use strict";
18728
18729 var r = e("./lib/oop"),
18730 i = e("./lib/dom"),
18731 s = e("./lib/event"),
18732 o = e("./lib/event_emitter").EventEmitter,
18733 u = 32768,
18734 a = function a(e) {
18735 this.element = i.createElement("div"), this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix, this.inner = i.createElement("div"), this.inner.className = "ace_scrollbar-inner", this.element.appendChild(this.inner), e.appendChild(this.element), this.setVisible(!1), this.skipEvent = !1, s.addListener(this.element, "scroll", this.onScroll.bind(this)), s.addListener(this.element, "mousedown", s.preventDefault);
18736 };
18737
18738 (function () {
18739 r.implement(this, o), this.setVisible = function (e) {
18740 this.element.style.display = e ? "" : "none", this.isVisible = e, this.coeff = 1;
18741 };
18742 }).call(a.prototype);
18743
18744 var f = function f(e, t) {
18745 a.call(this, e), this.scrollTop = 0, this.scrollHeight = 0, t.$scrollbarWidth = this.width = i.scrollbarWidth(e.ownerDocument), this.inner.style.width = this.element.style.width = (this.width || 15) + 5 + "px", this.$minWidth = 0;
18746 };
18747
18748 r.inherits(f, a), function () {
18749 this.classSuffix = "-v", this.onScroll = function () {
18750 if (!this.skipEvent) {
18751 this.scrollTop = this.element.scrollTop;
18752
18753 if (this.coeff != 1) {
18754 var e = this.element.clientHeight / this.scrollHeight;
18755 this.scrollTop = this.scrollTop * (1 - e) / (this.coeff - e);
18756 }
18757
18758 this._emit("scroll", {
18759 data: this.scrollTop
18760 });
18761 }
18762
18763 this.skipEvent = !1;
18764 }, this.getWidth = function () {
18765 return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
18766 }, this.setHeight = function (e) {
18767 this.element.style.height = e + "px";
18768 }, this.setInnerHeight = this.setScrollHeight = function (e) {
18769 this.scrollHeight = e, e > u ? (this.coeff = u / e, e = u) : this.coeff != 1 && (this.coeff = 1), this.inner.style.height = e + "px";
18770 }, this.setScrollTop = function (e) {
18771 this.scrollTop != e && (this.skipEvent = !0, this.scrollTop = e, this.element.scrollTop = e * this.coeff);
18772 };
18773 }.call(f.prototype);
18774
18775 var l = function l(e, t) {
18776 a.call(this, e), this.scrollLeft = 0, this.height = t.$scrollbarWidth, this.inner.style.height = this.element.style.height = (this.height || 15) + 5 + "px";
18777 };
18778
18779 r.inherits(l, a), function () {
18780 this.classSuffix = "-h", this.onScroll = function () {
18781 this.skipEvent || (this.scrollLeft = this.element.scrollLeft, this._emit("scroll", {
18782 data: this.scrollLeft
18783 })), this.skipEvent = !1;
18784 }, this.getHeight = function () {
18785 return this.isVisible ? this.height : 0;
18786 }, this.setWidth = function (e) {
18787 this.element.style.width = e + "px";
18788 }, this.setInnerWidth = function (e) {
18789 this.inner.style.width = e + "px";
18790 }, this.setScrollWidth = function (e) {
18791 this.inner.style.width = e + "px";
18792 }, this.setScrollLeft = function (e) {
18793 this.scrollLeft != e && (this.skipEvent = !0, this.scrollLeft = this.element.scrollLeft = e);
18794 };
18795 }.call(l.prototype), t.ScrollBar = f, t.ScrollBarV = f, t.ScrollBarH = l, t.VScrollBar = f, t.HScrollBar = l;
18796 }), ace.define("ace/renderloop", ["require", "exports", "module", "ace/lib/event"], function (e, t, n) {
18797 "use strict";
18798
18799 var r = e("./lib/event"),
18800 i = function i(e, t) {
18801 this.onRender = e, this.pending = !1, this.changes = 0, this.window = t || window;
18802 };
18803
18804 (function () {
18805 this.schedule = function (e) {
18806 this.changes = this.changes | e;
18807
18808 if (!this.pending && this.changes) {
18809 this.pending = !0;
18810 var t = this;
18811 r.nextFrame(function () {
18812 t.pending = !1;
18813 var e;
18814
18815 while (e = t.changes) {
18816 t.changes = 0, t.onRender(e);
18817 }
18818 }, this.window);
18819 }
18820 };
18821 }).call(i.prototype), t.RenderLoop = i;
18822 }), ace.define("ace/layer/font_metrics", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/lib/event_emitter"], function (e, t, n) {
18823 var r = e("../lib/oop"),
18824 i = e("../lib/dom"),
18825 s = e("../lib/lang"),
18826 o = e("../lib/useragent"),
18827 u = e("../lib/event_emitter").EventEmitter,
18828 a = 0,
18829 f = t.FontMetrics = function (e) {
18830 this.el = i.createElement("div"), this.$setMeasureNodeStyles(this.el.style, !0), this.$main = i.createElement("div"), this.$setMeasureNodeStyles(this.$main.style), this.$measureNode = i.createElement("div"), this.$setMeasureNodeStyles(this.$measureNode.style), this.el.appendChild(this.$main), this.el.appendChild(this.$measureNode), e.appendChild(this.el), a || this.$testFractionalRect(), this.$measureNode.innerHTML = s.stringRepeat("X", a), this.$characterSize = {
18831 width: 0,
18832 height: 0
18833 }, this.checkForSizeChanges();
18834 };
18835
18836 (function () {
18837 r.implement(this, u), this.$characterSize = {
18838 width: 0,
18839 height: 0
18840 }, this.$testFractionalRect = function () {
18841 var e = i.createElement("div");
18842 this.$setMeasureNodeStyles(e.style), e.style.width = "0.2px", document.documentElement.appendChild(e);
18843 var t = e.getBoundingClientRect().width;
18844 t > 0 && t < 1 ? a = 50 : a = 100, e.parentNode.removeChild(e);
18845 }, this.$setMeasureNodeStyles = function (e, t) {
18846 e.width = e.height = "auto", e.left = e.top = "0px", e.visibility = "hidden", e.position = "absolute", e.whiteSpace = "pre", o.isIE < 8 ? e["font-family"] = "inherit" : e.font = "inherit", e.overflow = t ? "hidden" : "visible";
18847 }, this.checkForSizeChanges = function () {
18848 var e = this.$measureSizes();
18849
18850 if (e && (this.$characterSize.width !== e.width || this.$characterSize.height !== e.height)) {
18851 this.$measureNode.style.fontWeight = "bold";
18852 var t = this.$measureSizes();
18853 this.$measureNode.style.fontWeight = "", this.$characterSize = e, this.charSizes = Object.create(null), this.allowBoldFonts = t && t.width === e.width && t.height === e.height, this._emit("changeCharacterSize", {
18854 data: e
18855 });
18856 }
18857 }, this.$pollSizeChanges = function () {
18858 if (this.$pollSizeChangesTimer) return this.$pollSizeChangesTimer;
18859 var e = this;
18860 return this.$pollSizeChangesTimer = setInterval(function () {
18861 e.checkForSizeChanges();
18862 }, 500);
18863 }, this.setPolling = function (e) {
18864 e ? this.$pollSizeChanges() : this.$pollSizeChangesTimer && (clearInterval(this.$pollSizeChangesTimer), this.$pollSizeChangesTimer = 0);
18865 }, this.$measureSizes = function () {
18866 if (a === 50) {
18867 var e = null;
18868
18869 try {
18870 e = this.$measureNode.getBoundingClientRect();
18871 } catch (t) {
18872 e = {
18873 width: 0,
18874 height: 0
18875 };
18876 }
18877
18878 var n = {
18879 height: e.height,
18880 width: e.width / a
18881 };
18882 } else var n = {
18883 height: this.$measureNode.clientHeight,
18884 width: this.$measureNode.clientWidth / a
18885 };
18886
18887 return n.width === 0 || n.height === 0 ? null : n;
18888 }, this.$measureCharWidth = function (e) {
18889 this.$main.innerHTML = s.stringRepeat(e, a);
18890 var t = this.$main.getBoundingClientRect();
18891 return t.width / a;
18892 }, this.getCharacterWidth = function (e) {
18893 var t = this.charSizes[e];
18894 return t === undefined && (t = this.charSizes[e] = this.$measureCharWidth(e) / this.$characterSize.width), t;
18895 }, this.destroy = function () {
18896 clearInterval(this.$pollSizeChangesTimer), this.el && this.el.parentNode && this.el.parentNode.removeChild(this.el);
18897 };
18898 }).call(f.prototype);
18899 }), ace.define("ace/virtual_renderer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/config", "ace/lib/useragent", "ace/layer/gutter", "ace/layer/marker", "ace/layer/text", "ace/layer/cursor", "ace/scrollbar", "ace/scrollbar", "ace/renderloop", "ace/layer/font_metrics", "ace/lib/event_emitter"], function (e, t, n) {
18900 "use strict";
18901
18902 var r = e("./lib/oop"),
18903 i = e("./lib/dom"),
18904 s = e("./config"),
18905 o = e("./lib/useragent"),
18906 u = e("./layer/gutter").Gutter,
18907 a = e("./layer/marker").Marker,
18908 f = e("./layer/text").Text,
18909 l = e("./layer/cursor").Cursor,
18910 c = e("./scrollbar").HScrollBar,
18911 h = e("./scrollbar").VScrollBar,
18912 p = e("./renderloop").RenderLoop,
18913 d = e("./layer/font_metrics").FontMetrics,
18914 v = e("./lib/event_emitter").EventEmitter,
18915 m = '.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_text-input-ios {position: absolute !important;top: -100000px !important;left: -100000px !important;}';
18916 i.importCssString(m, "ace_editor.css");
18917
18918 var g = function g(e, t) {
18919 var n = this;
18920 this.container = e || i.createElement("div"), this.$keepTextAreaAtCursor = !o.isOldIE, i.addCssClass(this.container, "ace_editor"), this.setTheme(t), this.$gutter = i.createElement("div"), this.$gutter.className = "ace_gutter", this.container.appendChild(this.$gutter), this.scroller = i.createElement("div"), this.scroller.className = "ace_scroller", this.container.appendChild(this.scroller), this.content = i.createElement("div"), this.content.className = "ace_content", this.scroller.appendChild(this.content), this.$gutterLayer = new u(this.$gutter), this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)), this.$markerBack = new a(this.content);
18921 var r = this.$textLayer = new f(this.content);
18922 this.canvas = r.element, this.$markerFront = new a(this.content), this.$cursorLayer = new l(this.content), this.$horizScroll = !1, this.$vScroll = !1, this.scrollBar = this.scrollBarV = new h(this.container, this), this.scrollBarH = new c(this.container, this), this.scrollBarV.addEventListener("scroll", function (e) {
18923 n.$scrollAnimation || n.session.setScrollTop(e.data - n.scrollMargin.top);
18924 }), this.scrollBarH.addEventListener("scroll", function (e) {
18925 n.$scrollAnimation || n.session.setScrollLeft(e.data - n.scrollMargin.left);
18926 }), this.scrollTop = 0, this.scrollLeft = 0, this.cursorPos = {
18927 row: 0,
18928 column: 0
18929 }, this.$fontMetrics = new d(this.container), this.$textLayer.$setFontMetrics(this.$fontMetrics), this.$textLayer.addEventListener("changeCharacterSize", function (e) {
18930 n.updateCharacterSize(), n.onResize(!0, n.gutterWidth, n.$size.width, n.$size.height), n._signal("changeCharacterSize", e);
18931 }), this.$size = {
18932 width: 0,
18933 height: 0,
18934 scrollerHeight: 0,
18935 scrollerWidth: 0,
18936 $dirty: !0
18937 }, this.layerConfig = {
18938 width: 1,
18939 padding: 0,
18940 firstRow: 0,
18941 firstRowScreen: 0,
18942 lastRow: 0,
18943 lineHeight: 0,
18944 characterWidth: 0,
18945 minHeight: 1,
18946 maxHeight: 1,
18947 offset: 0,
18948 height: 1,
18949 gutterOffset: 1
18950 }, this.scrollMargin = {
18951 left: 0,
18952 right: 0,
18953 top: 0,
18954 bottom: 0,
18955 v: 0,
18956 h: 0
18957 }, this.$loop = new p(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView), this.$loop.schedule(this.CHANGE_FULL), this.updateCharacterSize(), this.setPadding(4), s.resetOptions(this), s._emit("renderer", this);
18958 };
18959
18960 (function () {
18961 this.CHANGE_CURSOR = 1, this.CHANGE_MARKER = 2, this.CHANGE_GUTTER = 4, this.CHANGE_SCROLL = 8, this.CHANGE_LINES = 16, this.CHANGE_TEXT = 32, this.CHANGE_SIZE = 64, this.CHANGE_MARKER_BACK = 128, this.CHANGE_MARKER_FRONT = 256, this.CHANGE_FULL = 512, this.CHANGE_H_SCROLL = 1024, r.implement(this, v), this.updateCharacterSize = function () {
18962 this.$textLayer.allowBoldFonts != this.$allowBoldFonts && (this.$allowBoldFonts = this.$textLayer.allowBoldFonts, this.setStyle("ace_nobold", !this.$allowBoldFonts)), this.layerConfig.characterWidth = this.characterWidth = this.$textLayer.getCharacterWidth(), this.layerConfig.lineHeight = this.lineHeight = this.$textLayer.getLineHeight(), this.$updatePrintMargin();
18963 }, this.setSession = function (e) {
18964 this.session && this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode), this.session = e, e && this.scrollMargin.top && e.getScrollTop() <= 0 && e.setScrollTop(-this.scrollMargin.top), this.$cursorLayer.setSession(e), this.$markerBack.setSession(e), this.$markerFront.setSession(e), this.$gutterLayer.setSession(e), this.$textLayer.setSession(e);
18965 if (!e) return;
18966 this.$loop.schedule(this.CHANGE_FULL), this.session.$setFontMetrics(this.$fontMetrics), this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null, this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this), this.onChangeNewLineMode(), this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode);
18967 }, this.updateLines = function (e, t, n) {
18968 t === undefined && (t = Infinity), this.$changedLines ? (this.$changedLines.firstRow > e && (this.$changedLines.firstRow = e), this.$changedLines.lastRow < t && (this.$changedLines.lastRow = t)) : this.$changedLines = {
18969 firstRow: e,
18970 lastRow: t
18971 };
18972
18973 if (this.$changedLines.lastRow < this.layerConfig.firstRow) {
18974 if (!n) return;
18975 this.$changedLines.lastRow = this.layerConfig.lastRow;
18976 }
18977
18978 if (this.$changedLines.firstRow > this.layerConfig.lastRow) return;
18979 this.$loop.schedule(this.CHANGE_LINES);
18980 }, this.onChangeNewLineMode = function () {
18981 this.$loop.schedule(this.CHANGE_TEXT), this.$textLayer.$updateEolChar();
18982 }, this.onChangeTabSize = function () {
18983 this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER), this.$textLayer.onChangeTabSize();
18984 }, this.updateText = function () {
18985 this.$loop.schedule(this.CHANGE_TEXT);
18986 }, this.updateFull = function (e) {
18987 e ? this.$renderChanges(this.CHANGE_FULL, !0) : this.$loop.schedule(this.CHANGE_FULL);
18988 }, this.updateFontSize = function () {
18989 this.$textLayer.checkForSizeChanges();
18990 }, this.$changes = 0, this.$updateSizeAsync = function () {
18991 this.$loop.pending ? this.$size.$dirty = !0 : this.onResize();
18992 }, this.onResize = function (e, t, n, r) {
18993 if (this.resizing > 2) return;
18994 this.resizing > 0 ? this.resizing++ : this.resizing = e ? 1 : 0;
18995 var i = this.container;
18996 r || (r = i.clientHeight || i.scrollHeight), n || (n = i.clientWidth || i.scrollWidth);
18997 var s = this.$updateCachedSize(e, t, n, r);
18998 if (!this.$size.scrollerHeight || !n && !r) return this.resizing = 0;
18999 e && (this.$gutterLayer.$padding = null), e ? this.$renderChanges(s | this.$changes, !0) : this.$loop.schedule(s | this.$changes), this.resizing && (this.resizing = 0), this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;
19000 }, this.$updateCachedSize = function (e, t, n, r) {
19001 r -= this.$extraHeight || 0;
19002 var i = 0,
19003 s = this.$size,
19004 o = {
19005 width: s.width,
19006 height: s.height,
19007 scrollerHeight: s.scrollerHeight,
19008 scrollerWidth: s.scrollerWidth
19009 };
19010 r && (e || s.height != r) && (s.height = r, i |= this.CHANGE_SIZE, s.scrollerHeight = s.height, this.$horizScroll && (s.scrollerHeight -= this.scrollBarH.getHeight()), this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px", i |= this.CHANGE_SCROLL);
19011
19012 if (n && (e || s.width != n)) {
19013 i |= this.CHANGE_SIZE, s.width = n, t == null && (t = this.$showGutter ? this.$gutter.offsetWidth : 0), this.gutterWidth = t, this.scrollBarH.element.style.left = this.scroller.style.left = t + "px", s.scrollerWidth = Math.max(0, n - t - this.scrollBarV.getWidth()), this.scrollBarH.element.style.right = this.scroller.style.right = this.scrollBarV.getWidth() + "px", this.scroller.style.bottom = this.scrollBarH.getHeight() + "px";
19014 if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || e) i |= this.CHANGE_FULL;
19015 }
19016
19017 return s.$dirty = !n || !r, i && this._signal("resize", o), i;
19018 }, this.onGutterResize = function () {
19019 var e = this.$showGutter ? this.$gutter.offsetWidth : 0;
19020 e != this.gutterWidth && (this.$changes |= this.$updateCachedSize(!0, e, this.$size.width, this.$size.height)), this.session.getUseWrapMode() && this.adjustWrapLimit() ? this.$loop.schedule(this.CHANGE_FULL) : this.$size.$dirty ? this.$loop.schedule(this.CHANGE_FULL) : (this.$computeLayerConfig(), this.$loop.schedule(this.CHANGE_MARKER));
19021 }, this.adjustWrapLimit = function () {
19022 var e = this.$size.scrollerWidth - this.$padding * 2,
19023 t = Math.floor(e / this.characterWidth);
19024 return this.session.adjustWrapLimit(t, this.$showPrintMargin && this.$printMarginColumn);
19025 }, this.setAnimatedScroll = function (e) {
19026 this.setOption("animatedScroll", e);
19027 }, this.getAnimatedScroll = function () {
19028 return this.$animatedScroll;
19029 }, this.setShowInvisibles = function (e) {
19030 this.setOption("showInvisibles", e);
19031 }, this.getShowInvisibles = function () {
19032 return this.getOption("showInvisibles");
19033 }, this.getDisplayIndentGuides = function () {
19034 return this.getOption("displayIndentGuides");
19035 }, this.setDisplayIndentGuides = function (e) {
19036 this.setOption("displayIndentGuides", e);
19037 }, this.setShowPrintMargin = function (e) {
19038 this.setOption("showPrintMargin", e);
19039 }, this.getShowPrintMargin = function () {
19040 return this.getOption("showPrintMargin");
19041 }, this.setPrintMarginColumn = function (e) {
19042 this.setOption("printMarginColumn", e);
19043 }, this.getPrintMarginColumn = function () {
19044 return this.getOption("printMarginColumn");
19045 }, this.getShowGutter = function () {
19046 return this.getOption("showGutter");
19047 }, this.setShowGutter = function (e) {
19048 return this.setOption("showGutter", e);
19049 }, this.getFadeFoldWidgets = function () {
19050 return this.getOption("fadeFoldWidgets");
19051 }, this.setFadeFoldWidgets = function (e) {
19052 this.setOption("fadeFoldWidgets", e);
19053 }, this.setHighlightGutterLine = function (e) {
19054 this.setOption("highlightGutterLine", e);
19055 }, this.getHighlightGutterLine = function () {
19056 return this.getOption("highlightGutterLine");
19057 }, this.$updateGutterLineHighlight = function () {
19058 var e = this.$cursorLayer.$pixelPos,
19059 t = this.layerConfig.lineHeight;
19060
19061 if (this.session.getUseWrapMode()) {
19062 var n = this.session.selection.getCursor();
19063 n.column = 0, e = this.$cursorLayer.getPixelPosition(n, !0), t *= this.session.getRowLength(n.row);
19064 }
19065
19066 this.$gutterLineHighlight.style.top = e.top - this.layerConfig.offset + "px", this.$gutterLineHighlight.style.height = t + "px";
19067 }, this.$updatePrintMargin = function () {
19068 if (!this.$showPrintMargin && !this.$printMarginEl) return;
19069
19070 if (!this.$printMarginEl) {
19071 var e = i.createElement("div");
19072 e.className = "ace_layer ace_print-margin-layer", this.$printMarginEl = i.createElement("div"), this.$printMarginEl.className = "ace_print-margin", e.appendChild(this.$printMarginEl), this.content.insertBefore(e, this.content.firstChild);
19073 }
19074
19075 var t = this.$printMarginEl.style;
19076 t.left = this.characterWidth * this.$printMarginColumn + this.$padding + "px", t.visibility = this.$showPrintMargin ? "visible" : "hidden", this.session && this.session.$wrap == -1 && this.adjustWrapLimit();
19077 }, this.getContainerElement = function () {
19078 return this.container;
19079 }, this.getMouseEventTarget = function () {
19080 return this.scroller;
19081 }, this.getTextAreaContainer = function () {
19082 return this.container;
19083 }, this.$moveTextAreaToCursor = function () {
19084 if (!this.$keepTextAreaAtCursor) return;
19085 var e = this.layerConfig,
19086 t = this.$cursorLayer.$pixelPos.top,
19087 n = this.$cursorLayer.$pixelPos.left;
19088 t -= e.offset;
19089 var r = this.textarea.style,
19090 i = this.lineHeight;
19091
19092 if (t < 0 || t > e.height - i) {
19093 r.top = r.left = "0";
19094 return;
19095 }
19096
19097 var s = this.characterWidth;
19098
19099 if (this.$composition) {
19100 var o = this.textarea.value.replace(/^\x01+/, "");
19101 s *= this.session.$getStringScreenWidth(o)[0] + 2, i += 2;
19102 }
19103
19104 n -= this.scrollLeft, n > this.$size.scrollerWidth - s && (n = this.$size.scrollerWidth - s), n += this.gutterWidth, r.height = i + "px", r.width = s + "px", r.left = Math.min(n, this.$size.scrollerWidth - s) + "px", r.top = Math.min(t, this.$size.height - i) + "px";
19105 }, this.getFirstVisibleRow = function () {
19106 return this.layerConfig.firstRow;
19107 }, this.getFirstFullyVisibleRow = function () {
19108 return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
19109 }, this.getLastFullyVisibleRow = function () {
19110 var e = this.layerConfig,
19111 t = e.lastRow,
19112 n = this.session.documentToScreenRow(t, 0) * e.lineHeight;
19113 return n - this.session.getScrollTop() > e.height - e.lineHeight ? t - 1 : t;
19114 }, this.getLastVisibleRow = function () {
19115 return this.layerConfig.lastRow;
19116 }, this.$padding = null, this.setPadding = function (e) {
19117 this.$padding = e, this.$textLayer.setPadding(e), this.$cursorLayer.setPadding(e), this.$markerFront.setPadding(e), this.$markerBack.setPadding(e), this.$loop.schedule(this.CHANGE_FULL), this.$updatePrintMargin();
19118 }, this.setScrollMargin = function (e, t, n, r) {
19119 var i = this.scrollMargin;
19120 i.top = e | 0, i.bottom = t | 0, i.right = r | 0, i.left = n | 0, i.v = i.top + i.bottom, i.h = i.left + i.right, i.top && this.scrollTop <= 0 && this.session && this.session.setScrollTop(-i.top), this.updateFull();
19121 }, this.getHScrollBarAlwaysVisible = function () {
19122 return this.$hScrollBarAlwaysVisible;
19123 }, this.setHScrollBarAlwaysVisible = function (e) {
19124 this.setOption("hScrollBarAlwaysVisible", e);
19125 }, this.getVScrollBarAlwaysVisible = function () {
19126 return this.$vScrollBarAlwaysVisible;
19127 }, this.setVScrollBarAlwaysVisible = function (e) {
19128 this.setOption("vScrollBarAlwaysVisible", e);
19129 }, this.$updateScrollBarV = function () {
19130 var e = this.layerConfig.maxHeight,
19131 t = this.$size.scrollerHeight;
19132 !this.$maxLines && this.$scrollPastEnd && (e -= (t - this.lineHeight) * this.$scrollPastEnd, this.scrollTop > e - t && (e = this.scrollTop + t, this.scrollBarV.scrollTop = null)), this.scrollBarV.setScrollHeight(e + this.scrollMargin.v), this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);
19133 }, this.$updateScrollBarH = function () {
19134 this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h), this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);
19135 }, this.$frozen = !1, this.freeze = function () {
19136 this.$frozen = !0;
19137 }, this.unfreeze = function () {
19138 this.$frozen = !1;
19139 }, this.$renderChanges = function (e, t) {
19140 this.$changes && (e |= this.$changes, this.$changes = 0);
19141
19142 if (!this.session || !this.container.offsetWidth || this.$frozen || !e && !t) {
19143 this.$changes |= e;
19144 return;
19145 }
19146
19147 if (this.$size.$dirty) return this.$changes |= e, this.onResize(!0);
19148 this.lineHeight || this.$textLayer.checkForSizeChanges(), this._signal("beforeRender");
19149 var n = this.layerConfig;
19150
19151 if (e & this.CHANGE_FULL || e & this.CHANGE_SIZE || e & this.CHANGE_TEXT || e & this.CHANGE_LINES || e & this.CHANGE_SCROLL || e & this.CHANGE_H_SCROLL) {
19152 e |= this.$computeLayerConfig();
19153
19154 if (n.firstRow != this.layerConfig.firstRow && n.firstRowScreen == this.layerConfig.firstRowScreen) {
19155 var r = this.scrollTop + (n.firstRow - this.layerConfig.firstRow) * this.lineHeight;
19156 r > 0 && (this.scrollTop = r, e |= this.CHANGE_SCROLL, e |= this.$computeLayerConfig());
19157 }
19158
19159 n = this.layerConfig, this.$updateScrollBarV(), e & this.CHANGE_H_SCROLL && this.$updateScrollBarH(), this.$gutterLayer.element.style.marginTop = -n.offset + "px", this.content.style.marginTop = -n.offset + "px", this.content.style.width = n.width + 2 * this.$padding + "px", this.content.style.height = n.minHeight + "px";
19160 }
19161
19162 e & this.CHANGE_H_SCROLL && (this.content.style.marginLeft = -this.scrollLeft + "px", this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left");
19163
19164 if (e & this.CHANGE_FULL) {
19165 this.$textLayer.update(n), this.$showGutter && this.$gutterLayer.update(n), this.$markerBack.update(n), this.$markerFront.update(n), this.$cursorLayer.update(n), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight(), this._signal("afterRender");
19166 return;
19167 }
19168
19169 if (e & this.CHANGE_SCROLL) {
19170 e & this.CHANGE_TEXT || e & this.CHANGE_LINES ? this.$textLayer.update(n) : this.$textLayer.scrollLines(n), this.$showGutter && this.$gutterLayer.update(n), this.$markerBack.update(n), this.$markerFront.update(n), this.$cursorLayer.update(n), this.$highlightGutterLine && this.$updateGutterLineHighlight(), this.$moveTextAreaToCursor(), this._signal("afterRender");
19171 return;
19172 }
19173
19174 e & this.CHANGE_TEXT ? (this.$textLayer.update(n), this.$showGutter && this.$gutterLayer.update(n)) : e & this.CHANGE_LINES ? (this.$updateLines() || e & this.CHANGE_GUTTER && this.$showGutter) && this.$gutterLayer.update(n) : (e & this.CHANGE_TEXT || e & this.CHANGE_GUTTER) && this.$showGutter && this.$gutterLayer.update(n), e & this.CHANGE_CURSOR && (this.$cursorLayer.update(n), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight()), e & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) && this.$markerFront.update(n), e & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) && this.$markerBack.update(n), this._signal("afterRender");
19175 }, this.$autosize = function () {
19176 var e = this.session.getScreenLength() * this.lineHeight,
19177 t = this.$maxLines * this.lineHeight,
19178 n = Math.min(t, Math.max((this.$minLines || 1) * this.lineHeight, e)) + this.scrollMargin.v + (this.$extraHeight || 0);
19179 this.$horizScroll && (n += this.scrollBarH.getHeight()), this.$maxPixelHeight && n > this.$maxPixelHeight && (n = this.$maxPixelHeight);
19180 var r = e > t;
19181
19182 if (n != this.desiredHeight || this.$size.height != this.desiredHeight || r != this.$vScroll) {
19183 r != this.$vScroll && (this.$vScroll = r, this.scrollBarV.setVisible(r));
19184 var i = this.container.clientWidth;
19185 this.container.style.height = n + "px", this.$updateCachedSize(!0, this.$gutterWidth, i, n), this.desiredHeight = n, this._signal("autosize");
19186 }
19187 }, this.$computeLayerConfig = function () {
19188 var e = this.session,
19189 t = this.$size,
19190 n = t.height <= 2 * this.lineHeight,
19191 r = this.session.getScreenLength(),
19192 i = r * this.lineHeight,
19193 s = this.$getLongestLine(),
19194 o = !n && (this.$hScrollBarAlwaysVisible || t.scrollerWidth - s - 2 * this.$padding < 0),
19195 u = this.$horizScroll !== o;
19196 u && (this.$horizScroll = o, this.scrollBarH.setVisible(o));
19197 var a = this.$vScroll;
19198 this.$maxLines && this.lineHeight > 1 && this.$autosize();
19199 var f = this.scrollTop % this.lineHeight,
19200 l = t.scrollerHeight + this.lineHeight,
19201 c = !this.$maxLines && this.$scrollPastEnd ? (t.scrollerHeight - this.lineHeight) * this.$scrollPastEnd : 0;
19202 i += c;
19203 var h = this.scrollMargin;
19204 this.session.setScrollTop(Math.max(-h.top, Math.min(this.scrollTop, i - t.scrollerHeight + h.bottom))), this.session.setScrollLeft(Math.max(-h.left, Math.min(this.scrollLeft, s + 2 * this.$padding - t.scrollerWidth + h.right)));
19205 var p = !n && (this.$vScrollBarAlwaysVisible || t.scrollerHeight - i + c < 0 || this.scrollTop > h.top),
19206 d = a !== p;
19207 d && (this.$vScroll = p, this.scrollBarV.setVisible(p));
19208 var v = Math.ceil(l / this.lineHeight) - 1,
19209 m = Math.max(0, Math.round((this.scrollTop - f) / this.lineHeight)),
19210 g = m + v,
19211 y,
19212 b,
19213 w = this.lineHeight;
19214 m = e.screenToDocumentRow(m, 0);
19215 var E = e.getFoldLine(m);
19216 E && (m = E.start.row), y = e.documentToScreenRow(m, 0), b = e.getRowLength(m) * w, g = Math.min(e.screenToDocumentRow(g, 0), e.getLength() - 1), l = t.scrollerHeight + e.getRowLength(g) * w + b, f = this.scrollTop - y * w;
19217 var S = 0;
19218 this.layerConfig.width != s && (S = this.CHANGE_H_SCROLL);
19219 if (u || d) S = this.$updateCachedSize(!0, this.gutterWidth, t.width, t.height), this._signal("scrollbarVisibilityChanged"), d && (s = this.$getLongestLine());
19220 return this.layerConfig = {
19221 width: s,
19222 padding: this.$padding,
19223 firstRow: m,
19224 firstRowScreen: y,
19225 lastRow: g,
19226 lineHeight: w,
19227 characterWidth: this.characterWidth,
19228 minHeight: l,
19229 maxHeight: i,
19230 offset: f,
19231 gutterOffset: w ? Math.max(0, Math.ceil((f + t.height - t.scrollerHeight) / w)) : 0,
19232 height: this.$size.scrollerHeight
19233 }, S;
19234 }, this.$updateLines = function () {
19235 if (!this.$changedLines) return;
19236 var e = this.$changedLines.firstRow,
19237 t = this.$changedLines.lastRow;
19238 this.$changedLines = null;
19239 var n = this.layerConfig;
19240 if (e > n.lastRow + 1) return;
19241 if (t < n.firstRow) return;
19242
19243 if (t === Infinity) {
19244 this.$showGutter && this.$gutterLayer.update(n), this.$textLayer.update(n);
19245 return;
19246 }
19247
19248 return this.$textLayer.updateLines(n, e, t), !0;
19249 }, this.$getLongestLine = function () {
19250 var e = this.session.getScreenWidth();
19251 return this.showInvisibles && !this.session.$useWrapMode && (e += 1), Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(e * this.characterWidth));
19252 }, this.updateFrontMarkers = function () {
19253 this.$markerFront.setMarkers(this.session.getMarkers(!0)), this.$loop.schedule(this.CHANGE_MARKER_FRONT);
19254 }, this.updateBackMarkers = function () {
19255 this.$markerBack.setMarkers(this.session.getMarkers()), this.$loop.schedule(this.CHANGE_MARKER_BACK);
19256 }, this.addGutterDecoration = function (e, t) {
19257 this.$gutterLayer.addGutterDecoration(e, t);
19258 }, this.removeGutterDecoration = function (e, t) {
19259 this.$gutterLayer.removeGutterDecoration(e, t);
19260 }, this.updateBreakpoints = function (e) {
19261 this.$loop.schedule(this.CHANGE_GUTTER);
19262 }, this.setAnnotations = function (e) {
19263 this.$gutterLayer.setAnnotations(e), this.$loop.schedule(this.CHANGE_GUTTER);
19264 }, this.updateCursor = function () {
19265 this.$loop.schedule(this.CHANGE_CURSOR);
19266 }, this.hideCursor = function () {
19267 this.$cursorLayer.hideCursor();
19268 }, this.showCursor = function () {
19269 this.$cursorLayer.showCursor();
19270 }, this.scrollSelectionIntoView = function (e, t, n) {
19271 this.scrollCursorIntoView(e, n), this.scrollCursorIntoView(t, n);
19272 }, this.scrollCursorIntoView = function (e, t, n) {
19273 if (this.$size.scrollerHeight === 0) return;
19274 var r = this.$cursorLayer.getPixelPosition(e),
19275 i = r.left,
19276 s = r.top,
19277 o = n && n.top || 0,
19278 u = n && n.bottom || 0,
19279 a = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;
19280 a + o > s ? (t && a + o > s + this.lineHeight && (s -= t * this.$size.scrollerHeight), s === 0 && (s = -this.scrollMargin.top), this.session.setScrollTop(s)) : a + this.$size.scrollerHeight - u < s + this.lineHeight && (t && a + this.$size.scrollerHeight - u < s - this.lineHeight && (s += t * this.$size.scrollerHeight), this.session.setScrollTop(s + this.lineHeight - this.$size.scrollerHeight));
19281 var f = this.scrollLeft;
19282 f > i ? (i < this.$padding + 2 * this.layerConfig.characterWidth && (i = -this.scrollMargin.left), this.session.setScrollLeft(i)) : f + this.$size.scrollerWidth < i + this.characterWidth ? this.session.setScrollLeft(Math.round(i + this.characterWidth - this.$size.scrollerWidth)) : f <= this.$padding && i - f < this.characterWidth && this.session.setScrollLeft(0);
19283 }, this.getScrollTop = function () {
19284 return this.session.getScrollTop();
19285 }, this.getScrollLeft = function () {
19286 return this.session.getScrollLeft();
19287 }, this.getScrollTopRow = function () {
19288 return this.scrollTop / this.lineHeight;
19289 }, this.getScrollBottomRow = function () {
19290 return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
19291 }, this.scrollToRow = function (e) {
19292 this.session.setScrollTop(e * this.lineHeight);
19293 }, this.alignCursor = function (e, t) {
19294 typeof e == "number" && (e = {
19295 row: e,
19296 column: 0
19297 });
19298 var n = this.$cursorLayer.getPixelPosition(e),
19299 r = this.$size.scrollerHeight - this.lineHeight,
19300 i = n.top - r * (t || 0);
19301 return this.session.setScrollTop(i), i;
19302 }, this.STEPS = 8, this.$calcSteps = function (e, t) {
19303 var n = 0,
19304 r = this.STEPS,
19305 i = [],
19306 s = function s(e, t, n) {
19307 return n * (Math.pow(e - 1, 3) + 1) + t;
19308 };
19309
19310 for (n = 0; n < r; ++n) {
19311 i.push(s(n / this.STEPS, e, t - e));
19312 }
19313
19314 return i;
19315 }, this.scrollToLine = function (e, t, n, r) {
19316 var i = this.$cursorLayer.getPixelPosition({
19317 row: e,
19318 column: 0
19319 }),
19320 s = i.top;
19321 t && (s -= this.$size.scrollerHeight / 2);
19322 var o = this.scrollTop;
19323 this.session.setScrollTop(s), n !== !1 && this.animateScrolling(o, r);
19324 }, this.animateScrolling = function (e, t) {
19325 var n = this.scrollTop;
19326 if (!this.$animatedScroll) return;
19327 var r = this;
19328 if (e == n) return;
19329
19330 if (this.$scrollAnimation) {
19331 var i = this.$scrollAnimation.steps;
19332
19333 if (i.length) {
19334 e = i[0];
19335 if (e == n) return;
19336 }
19337 }
19338
19339 var s = r.$calcSteps(e, n);
19340 this.$scrollAnimation = {
19341 from: e,
19342 to: n,
19343 steps: s
19344 }, clearInterval(this.$timer), r.session.setScrollTop(s.shift()), r.session.$scrollTop = n, this.$timer = setInterval(function () {
19345 s.length ? (r.session.setScrollTop(s.shift()), r.session.$scrollTop = n) : n != null ? (r.session.$scrollTop = -1, r.session.setScrollTop(n), n = null) : (r.$timer = clearInterval(r.$timer), r.$scrollAnimation = null, t && t());
19346 }, 10);
19347 }, this.scrollToY = function (e) {
19348 this.scrollTop !== e && (this.$loop.schedule(this.CHANGE_SCROLL), this.scrollTop = e);
19349 }, this.scrollToX = function (e) {
19350 this.scrollLeft !== e && (this.scrollLeft = e), this.$loop.schedule(this.CHANGE_H_SCROLL);
19351 }, this.scrollTo = function (e, t) {
19352 this.session.setScrollTop(t), this.session.setScrollLeft(t);
19353 }, this.scrollBy = function (e, t) {
19354 t && this.session.setScrollTop(this.session.getScrollTop() + t), e && this.session.setScrollLeft(this.session.getScrollLeft() + e);
19355 }, this.isScrollableBy = function (e, t) {
19356 if (t < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) return !0;
19357 if (t > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) return !0;
19358 if (e < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) return !0;
19359 if (e > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - this.layerConfig.width < -1 + this.scrollMargin.right) return !0;
19360 }, this.pixelToScreenCoordinates = function (e, t) {
19361 var n = this.scroller.getBoundingClientRect(),
19362 r = (e + this.scrollLeft - n.left - this.$padding) / this.characterWidth,
19363 i = Math.floor((t + this.scrollTop - n.top) / this.lineHeight),
19364 s = Math.round(r);
19365 return {
19366 row: i,
19367 column: s,
19368 side: r - s > 0 ? 1 : -1
19369 };
19370 }, this.screenToTextCoordinates = function (e, t) {
19371 var n = this.scroller.getBoundingClientRect(),
19372 r = Math.round((e + this.scrollLeft - n.left - this.$padding) / this.characterWidth),
19373 i = (t + this.scrollTop - n.top) / this.lineHeight;
19374 return this.session.screenToDocumentPosition(i, Math.max(r, 0));
19375 }, this.textToScreenCoordinates = function (e, t) {
19376 var n = this.scroller.getBoundingClientRect(),
19377 r = this.session.documentToScreenPosition(e, t),
19378 i = this.$padding + Math.round(r.column * this.characterWidth),
19379 s = r.row * this.lineHeight;
19380 return {
19381 pageX: n.left + i - this.scrollLeft,
19382 pageY: n.top + s - this.scrollTop
19383 };
19384 }, this.visualizeFocus = function () {
19385 i.addCssClass(this.container, "ace_focus");
19386 }, this.visualizeBlur = function () {
19387 i.removeCssClass(this.container, "ace_focus");
19388 }, this.showComposition = function (e) {
19389 this.$composition || (this.$composition = {
19390 keepTextAreaAtCursor: this.$keepTextAreaAtCursor,
19391 cssText: this.textarea.style.cssText
19392 }), this.$keepTextAreaAtCursor = !0, i.addCssClass(this.textarea, "ace_composition"), this.textarea.style.cssText = "", this.$moveTextAreaToCursor();
19393 }, this.setCompositionText = function (e) {
19394 this.$moveTextAreaToCursor();
19395 }, this.hideComposition = function () {
19396 if (!this.$composition) return;
19397 i.removeCssClass(this.textarea, "ace_composition"), this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor, this.textarea.style.cssText = this.$composition.cssText, this.$composition = null;
19398 }, this.setTheme = function (e, t) {
19399 function o(r) {
19400 if (n.$themeId != e) return t && t();
19401 if (!r || !r.cssClass) throw new Error("couldn't load module " + e + " or it didn't call define");
19402 i.importCssString(r.cssText, r.cssClass, n.container.ownerDocument), n.theme && i.removeCssClass(n.container, n.theme.cssClass);
19403 var s = "padding" in r ? r.padding : "padding" in (n.theme || {}) ? 4 : n.$padding;
19404 n.$padding && s != n.$padding && n.setPadding(s), n.$theme = r.cssClass, n.theme = r, i.addCssClass(n.container, r.cssClass), i.setCssClass(n.container, "ace_dark", r.isDark), n.$size && (n.$size.width = 0, n.$updateSizeAsync()), n._dispatchEvent("themeLoaded", {
19405 theme: r
19406 }), t && t();
19407 }
19408
19409 var n = this;
19410 this.$themeId = e, n._dispatchEvent("themeChange", {
19411 theme: e
19412 });
19413
19414 if (!e || typeof e == "string") {
19415 var r = e || this.$options.theme.initialValue;
19416 s.loadModule(["theme", r], o);
19417 } else o(e);
19418 }, this.getTheme = function () {
19419 return this.$themeId;
19420 }, this.setStyle = function (e, t) {
19421 i.setCssClass(this.container, e, t !== !1);
19422 }, this.unsetStyle = function (e) {
19423 i.removeCssClass(this.container, e);
19424 }, this.setCursorStyle = function (e) {
19425 this.scroller.style.cursor != e && (this.scroller.style.cursor = e);
19426 }, this.setMouseCursor = function (e) {
19427 this.scroller.style.cursor = e;
19428 }, this.destroy = function () {
19429 this.$textLayer.destroy(), this.$cursorLayer.destroy();
19430 };
19431 }).call(g.prototype), s.defineOptions(g.prototype, "renderer", {
19432 animatedScroll: {
19433 initialValue: !1
19434 },
19435 showInvisibles: {
19436 set: function set(e) {
19437 this.$textLayer.setShowInvisibles(e) && this.$loop.schedule(this.CHANGE_TEXT);
19438 },
19439 initialValue: !1
19440 },
19441 showPrintMargin: {
19442 set: function set() {
19443 this.$updatePrintMargin();
19444 },
19445 initialValue: !0
19446 },
19447 printMarginColumn: {
19448 set: function set() {
19449 this.$updatePrintMargin();
19450 },
19451 initialValue: 80
19452 },
19453 printMargin: {
19454 set: function set(e) {
19455 typeof e == "number" && (this.$printMarginColumn = e), this.$showPrintMargin = !!e, this.$updatePrintMargin();
19456 },
19457 get: function get() {
19458 return this.$showPrintMargin && this.$printMarginColumn;
19459 }
19460 },
19461 showGutter: {
19462 set: function set(e) {
19463 this.$gutter.style.display = e ? "block" : "none", this.$loop.schedule(this.CHANGE_FULL), this.onGutterResize();
19464 },
19465 initialValue: !0
19466 },
19467 fadeFoldWidgets: {
19468 set: function set(e) {
19469 i.setCssClass(this.$gutter, "ace_fade-fold-widgets", e);
19470 },
19471 initialValue: !1
19472 },
19473 showFoldWidgets: {
19474 set: function set(e) {
19475 this.$gutterLayer.setShowFoldWidgets(e);
19476 },
19477 initialValue: !0
19478 },
19479 showLineNumbers: {
19480 set: function set(e) {
19481 this.$gutterLayer.setShowLineNumbers(e), this.$loop.schedule(this.CHANGE_GUTTER);
19482 },
19483 initialValue: !0
19484 },
19485 displayIndentGuides: {
19486 set: function set(e) {
19487 this.$textLayer.setDisplayIndentGuides(e) && this.$loop.schedule(this.CHANGE_TEXT);
19488 },
19489 initialValue: !0
19490 },
19491 highlightGutterLine: {
19492 set: function set(e) {
19493 if (!this.$gutterLineHighlight) {
19494 this.$gutterLineHighlight = i.createElement("div"), this.$gutterLineHighlight.className = "ace_gutter-active-line", this.$gutter.appendChild(this.$gutterLineHighlight);
19495 return;
19496 }
19497
19498 this.$gutterLineHighlight.style.display = e ? "" : "none", this.$cursorLayer.$pixelPos && this.$updateGutterLineHighlight();
19499 },
19500 initialValue: !1,
19501 value: !0
19502 },
19503 hScrollBarAlwaysVisible: {
19504 set: function set(e) {
19505 (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) && this.$loop.schedule(this.CHANGE_SCROLL);
19506 },
19507 initialValue: !1
19508 },
19509 vScrollBarAlwaysVisible: {
19510 set: function set(e) {
19511 (!this.$vScrollBarAlwaysVisible || !this.$vScroll) && this.$loop.schedule(this.CHANGE_SCROLL);
19512 },
19513 initialValue: !1
19514 },
19515 fontSize: {
19516 set: function set(e) {
19517 typeof e == "number" && (e += "px"), this.container.style.fontSize = e, this.updateFontSize();
19518 },
19519 initialValue: 12
19520 },
19521 fontFamily: {
19522 set: function set(e) {
19523 this.container.style.fontFamily = e, this.updateFontSize();
19524 }
19525 },
19526 maxLines: {
19527 set: function set(e) {
19528 this.updateFull();
19529 }
19530 },
19531 minLines: {
19532 set: function set(e) {
19533 this.updateFull();
19534 }
19535 },
19536 maxPixelHeight: {
19537 set: function set(e) {
19538 this.updateFull();
19539 },
19540 initialValue: 0
19541 },
19542 scrollPastEnd: {
19543 set: function set(e) {
19544 e = +e || 0;
19545 if (this.$scrollPastEnd == e) return;
19546 this.$scrollPastEnd = e, this.$loop.schedule(this.CHANGE_SCROLL);
19547 },
19548 initialValue: 0,
19549 handlesSet: !0
19550 },
19551 fixedWidthGutter: {
19552 set: function set(e) {
19553 this.$gutterLayer.$fixedWidth = !!e, this.$loop.schedule(this.CHANGE_GUTTER);
19554 }
19555 },
19556 theme: {
19557 set: function set(e) {
19558 this.setTheme(e);
19559 },
19560 get: function get() {
19561 return this.$themeId || this.theme;
19562 },
19563 initialValue: "./theme/textmate",
19564 handlesSet: !0
19565 }
19566 }), t.VirtualRenderer = g;
19567 }), ace.define("ace/worker/worker_client", ["require", "exports", "module", "ace/lib/oop", "ace/lib/net", "ace/lib/event_emitter", "ace/config"], function (e, t, n) {
19568 "use strict";
19569
19570 function u(e) {
19571 var t = "importScripts('" + i.qualifyURL(e) + "');";
19572
19573 try {
19574 return new Blob([t], {
19575 type: "application/javascript"
19576 });
19577 } catch (n) {
19578 var r = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder,
19579 s = new r();
19580 return s.append(t), s.getBlob("application/javascript");
19581 }
19582 }
19583
19584 function a(e) {
19585 var t = u(e),
19586 n = window.URL || window.webkitURL,
19587 r = n.createObjectURL(t);
19588 return new Worker(r);
19589 }
19590
19591 var r = e("../lib/oop"),
19592 i = e("../lib/net"),
19593 s = e("../lib/event_emitter").EventEmitter,
19594 o = e("../config"),
19595 f = function f(t, n, r, i, s) {
19596 this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this), this.onMessage = this.onMessage.bind(this), e.nameToUrl && !e.toUrl && (e.toUrl = e.nameToUrl);
19597 if (o.get("packaged") || !e.toUrl) i = i || o.moduleUrl(n, "worker");else {
19598 var u = this.$normalizePath;
19599 i = i || u(e.toUrl("ace/worker/worker.js", null, "_"));
19600 var f = {};
19601 t.forEach(function (t) {
19602 f[t] = u(e.toUrl(t, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
19603 });
19604 }
19605 this.$worker = a(i), s && this.send("importScripts", s), this.$worker.postMessage({
19606 init: !0,
19607 tlns: f,
19608 module: n,
19609 classname: r
19610 }), this.callbackId = 1, this.callbacks = {}, this.$worker.onmessage = this.onMessage;
19611 };
19612
19613 (function () {
19614 r.implement(this, s), this.onMessage = function (e) {
19615 var t = e.data;
19616
19617 switch (t.type) {
19618 case "event":
19619 this._signal(t.name, {
19620 data: t.data
19621 });
19622
19623 break;
19624
19625 case "call":
19626 var n = this.callbacks[t.id];
19627 n && (n(t.data), delete this.callbacks[t.id]);
19628 break;
19629
19630 case "error":
19631 this.reportError(t.data);
19632 break;
19633
19634 case "log":
19635 window.console && console.log && console.log.apply(console, t.data);
19636 }
19637 }, this.reportError = function (e) {
19638 window.console && console.error && console.error(e);
19639 }, this.$normalizePath = function (e) {
19640 return i.qualifyURL(e);
19641 }, this.terminate = function () {
19642 this._signal("terminate", {}), this.deltaQueue = null, this.$worker.terminate(), this.$worker = null, this.$doc && this.$doc.off("change", this.changeListener), this.$doc = null;
19643 }, this.send = function (e, t) {
19644 this.$worker.postMessage({
19645 command: e,
19646 args: t
19647 });
19648 }, this.call = function (e, t, n) {
19649 if (n) {
19650 var r = this.callbackId++;
19651 this.callbacks[r] = n, t.push(r);
19652 }
19653
19654 this.send(e, t);
19655 }, this.emit = function (e, t) {
19656 try {
19657 this.$worker.postMessage({
19658 event: e,
19659 data: {
19660 data: t.data
19661 }
19662 });
19663 } catch (n) {
19664 console.error(n.stack);
19665 }
19666 }, this.attachToDocument = function (e) {
19667 this.$doc && this.terminate(), this.$doc = e, this.call("setValue", [e.getValue()]), e.on("change", this.changeListener);
19668 }, this.changeListener = function (e) {
19669 this.deltaQueue || (this.deltaQueue = [], setTimeout(this.$sendDeltaQueue, 0)), e.action == "insert" ? this.deltaQueue.push(e.start, e.lines) : this.deltaQueue.push(e.start, e.end);
19670 }, this.$sendDeltaQueue = function () {
19671 var e = this.deltaQueue;
19672 if (!e) return;
19673 this.deltaQueue = null, e.length > 50 && e.length > this.$doc.getLength() >> 1 ? this.call("setValue", [this.$doc.getValue()]) : this.emit("change", {
19674 data: e
19675 });
19676 };
19677 }).call(f.prototype);
19678
19679 var l = function l(e, t, n) {
19680 this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this), this.callbackId = 1, this.callbacks = {}, this.messageBuffer = [];
19681 var r = null,
19682 i = !1,
19683 u = Object.create(s),
19684 a = this;
19685 this.$worker = {}, this.$worker.terminate = function () {}, this.$worker.postMessage = function (e) {
19686 a.messageBuffer.push(e), r && (i ? setTimeout(f) : f());
19687 }, this.setEmitSync = function (e) {
19688 i = e;
19689 };
19690
19691 var f = function f() {
19692 var e = a.messageBuffer.shift();
19693 e.command ? r[e.command].apply(r, e.args) : e.event && u._signal(e.event, e.data);
19694 };
19695
19696 u.postMessage = function (e) {
19697 a.onMessage({
19698 data: e
19699 });
19700 }, u.callback = function (e, t) {
19701 this.postMessage({
19702 type: "call",
19703 id: t,
19704 data: e
19705 });
19706 }, u.emit = function (e, t) {
19707 this.postMessage({
19708 type: "event",
19709 name: e,
19710 data: t
19711 });
19712 }, o.loadModule(["worker", t], function (e) {
19713 r = new e[n](u);
19714
19715 while (a.messageBuffer.length) {
19716 f();
19717 }
19718 });
19719 };
19720
19721 l.prototype = f.prototype, t.UIWorkerClient = l, t.WorkerClient = f, t.createWorker = a;
19722 }), ace.define("ace/placeholder", ["require", "exports", "module", "ace/range", "ace/lib/event_emitter", "ace/lib/oop"], function (e, t, n) {
19723 "use strict";
19724
19725 var r = e("./range").Range,
19726 i = e("./lib/event_emitter").EventEmitter,
19727 s = e("./lib/oop"),
19728 o = function o(e, t, n, r, i, s) {
19729 var o = this;
19730 this.length = t, this.session = e, this.doc = e.getDocument(), this.mainClass = i, this.othersClass = s, this.$onUpdate = this.onUpdate.bind(this), this.doc.on("change", this.$onUpdate), this.$others = r, this.$onCursorChange = function () {
19731 setTimeout(function () {
19732 o.onCursorChange();
19733 });
19734 }, this.$pos = n;
19735 var u = e.getUndoManager().$undoStack || e.getUndoManager().$undostack || {
19736 length: -1
19737 };
19738 this.$undoStackDepth = u.length, this.setup(), e.selection.on("changeCursor", this.$onCursorChange);
19739 };
19740
19741 (function () {
19742 s.implement(this, i), this.setup = function () {
19743 var e = this,
19744 t = this.doc,
19745 n = this.session;
19746 this.selectionBefore = n.selection.toJSON(), n.selection.inMultiSelectMode && n.selection.toSingleRange(), this.pos = t.createAnchor(this.$pos.row, this.$pos.column);
19747 var i = this.pos;
19748 i.$insertRight = !0, i.detach(), i.markerId = n.addMarker(new r(i.row, i.column, i.row, i.column + this.length), this.mainClass, null, !1), this.others = [], this.$others.forEach(function (n) {
19749 var r = t.createAnchor(n.row, n.column);
19750 r.$insertRight = !0, r.detach(), e.others.push(r);
19751 }), n.setUndoSelect(!1);
19752 }, this.showOtherMarkers = function () {
19753 if (this.othersActive) return;
19754 var e = this.session,
19755 t = this;
19756 this.othersActive = !0, this.others.forEach(function (n) {
19757 n.markerId = e.addMarker(new r(n.row, n.column, n.row, n.column + t.length), t.othersClass, null, !1);
19758 });
19759 }, this.hideOtherMarkers = function () {
19760 if (!this.othersActive) return;
19761 this.othersActive = !1;
19762
19763 for (var e = 0; e < this.others.length; e++) {
19764 this.session.removeMarker(this.others[e].markerId);
19765 }
19766 }, this.onUpdate = function (e) {
19767 if (this.$updating) return this.updateAnchors(e);
19768 var t = e;
19769 if (t.start.row !== t.end.row) return;
19770 if (t.start.row !== this.pos.row) return;
19771 this.$updating = !0;
19772 var n = e.action === "insert" ? t.end.column - t.start.column : t.start.column - t.end.column,
19773 i = t.start.column >= this.pos.column && t.start.column <= this.pos.column + this.length + 1,
19774 s = t.start.column - this.pos.column;
19775 this.updateAnchors(e), i && (this.length += n);
19776 if (i && !this.session.$fromUndo) if (e.action === "insert") for (var o = this.others.length - 1; o >= 0; o--) {
19777 var u = this.others[o],
19778 a = {
19779 row: u.row,
19780 column: u.column + s
19781 };
19782 this.doc.insertMergedLines(a, e.lines);
19783 } else if (e.action === "remove") for (var o = this.others.length - 1; o >= 0; o--) {
19784 var u = this.others[o],
19785 a = {
19786 row: u.row,
19787 column: u.column + s
19788 };
19789 this.doc.remove(new r(a.row, a.column, a.row, a.column - n));
19790 }
19791 this.$updating = !1, this.updateMarkers();
19792 }, this.updateAnchors = function (e) {
19793 this.pos.onChange(e);
19794
19795 for (var t = this.others.length; t--;) {
19796 this.others[t].onChange(e);
19797 }
19798
19799 this.updateMarkers();
19800 }, this.updateMarkers = function () {
19801 if (this.$updating) return;
19802
19803 var e = this,
19804 t = this.session,
19805 n = function n(_n2, i) {
19806 t.removeMarker(_n2.markerId), _n2.markerId = t.addMarker(new r(_n2.row, _n2.column, _n2.row, _n2.column + e.length), i, null, !1);
19807 };
19808
19809 n(this.pos, this.mainClass);
19810
19811 for (var i = this.others.length; i--;) {
19812 n(this.others[i], this.othersClass);
19813 }
19814 }, this.onCursorChange = function (e) {
19815 if (this.$updating || !this.session) return;
19816 var t = this.session.selection.getCursor();
19817 t.row === this.pos.row && t.column >= this.pos.column && t.column <= this.pos.column + this.length ? (this.showOtherMarkers(), this._emit("cursorEnter", e)) : (this.hideOtherMarkers(), this._emit("cursorLeave", e));
19818 }, this.detach = function () {
19819 this.session.removeMarker(this.pos && this.pos.markerId), this.hideOtherMarkers(), this.doc.removeEventListener("change", this.$onUpdate), this.session.selection.removeEventListener("changeCursor", this.$onCursorChange), this.session.setUndoSelect(!0), this.session = null;
19820 }, this.cancel = function () {
19821 if (this.$undoStackDepth === -1) return;
19822 var e = this.session.getUndoManager(),
19823 t = (e.$undoStack || e.$undostack).length - this.$undoStackDepth;
19824
19825 for (var n = 0; n < t; n++) {
19826 e.undo(!0);
19827 }
19828
19829 this.selectionBefore && this.session.selection.fromJSON(this.selectionBefore);
19830 };
19831 }).call(o.prototype), t.PlaceHolder = o;
19832 }), ace.define("ace/mouse/multi_select_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function (e, t, n) {
19833 function s(e, t) {
19834 return e.row == t.row && e.column == t.column;
19835 }
19836
19837 function o(e) {
19838 var t = e.domEvent,
19839 n = t.altKey,
19840 o = t.shiftKey,
19841 u = t.ctrlKey,
19842 a = e.getAccelKey(),
19843 f = e.getButton();
19844 u && i.isMac && (f = t.button);
19845
19846 if (e.editor.inMultiSelectMode && f == 2) {
19847 e.editor.textInput.onContextMenu(e.domEvent);
19848 return;
19849 }
19850
19851 if (!u && !n && !a) {
19852 f === 0 && e.editor.inMultiSelectMode && e.editor.exitMultiSelectMode();
19853 return;
19854 }
19855
19856 if (f !== 0) return;
19857
19858 var l = e.editor,
19859 c = l.selection,
19860 h = l.inMultiSelectMode,
19861 p = e.getDocumentPosition(),
19862 d = c.getCursor(),
19863 v = e.inSelection() || c.isEmpty() && s(p, d),
19864 m = e.x,
19865 g = e.y,
19866 y = function y(e) {
19867 m = e.clientX, g = e.clientY;
19868 },
19869 b = l.session,
19870 w = l.renderer.pixelToScreenCoordinates(m, g),
19871 E = w,
19872 S;
19873
19874 if (l.$mouseHandler.$enableJumpToDef) u && n || a && n ? S = o ? "block" : "add" : n && l.$blockSelectEnabled && (S = "block");else if (a && !n) {
19875 S = "add";
19876 if (!h && o) return;
19877 } else n && l.$blockSelectEnabled && (S = "block");
19878 S && i.isMac && t.ctrlKey && l.$mouseHandler.cancelContextMenu();
19879
19880 if (S == "add") {
19881 if (!h && v) return;
19882
19883 if (!h) {
19884 var x = c.toOrientedRange();
19885 l.addSelectionMarker(x);
19886 }
19887
19888 var T = c.rangeList.rangeAtPoint(p);
19889 l.$blockScrolling++, l.inVirtualSelectionMode = !0, o && (T = null, x = c.ranges[0] || x, l.removeSelectionMarker(x)), l.once("mouseup", function () {
19890 var e = c.toOrientedRange();
19891 T && e.isEmpty() && s(T.cursor, e.cursor) ? c.substractPoint(e.cursor) : (o ? c.substractPoint(x.cursor) : x && (l.removeSelectionMarker(x), c.addRange(x)), c.addRange(e)), l.$blockScrolling--, l.inVirtualSelectionMode = !1;
19892 });
19893 } else if (S == "block") {
19894 e.stop(), l.inVirtualSelectionMode = !0;
19895
19896 var N,
19897 C = [],
19898 k = function k() {
19899 var e = l.renderer.pixelToScreenCoordinates(m, g),
19900 t = b.screenToDocumentPosition(e.row, e.column);
19901 if (s(E, e) && s(t, c.lead)) return;
19902 E = e, l.$blockScrolling++, l.selection.moveToPosition(t), l.renderer.scrollCursorIntoView(), l.removeSelectionMarkers(C), C = c.rectangularRangeBlock(E, w), l.$mouseHandler.$clickSelection && C.length == 1 && C[0].isEmpty() && (C[0] = l.$mouseHandler.$clickSelection.clone()), C.forEach(l.addSelectionMarker, l), l.updateSelectionMarkers(), l.$blockScrolling--;
19903 };
19904
19905 l.$blockScrolling++, h && !a ? c.toSingleRange() : !h && a && (N = c.toOrientedRange(), l.addSelectionMarker(N)), o ? w = b.documentToScreenPosition(c.lead) : c.moveToPosition(p), l.$blockScrolling--, E = {
19906 row: -1,
19907 column: -1
19908 };
19909
19910 var L = function L(e) {
19911 clearInterval(O), l.removeSelectionMarkers(C), C.length || (C = [c.toOrientedRange()]), l.$blockScrolling++, N && (l.removeSelectionMarker(N), c.toSingleRange(N));
19912
19913 for (var t = 0; t < C.length; t++) {
19914 c.addRange(C[t]);
19915 }
19916
19917 l.inVirtualSelectionMode = !1, l.$mouseHandler.$clickSelection = null, l.$blockScrolling--;
19918 },
19919 A = k;
19920
19921 r.capture(l.container, y, L);
19922 var O = setInterval(function () {
19923 A();
19924 }, 20);
19925 return e.preventDefault();
19926 }
19927 }
19928
19929 var r = e("../lib/event"),
19930 i = e("../lib/useragent");
19931 t.onMouseDown = o;
19932 }), ace.define("ace/commands/multi_select_commands", ["require", "exports", "module", "ace/keyboard/hash_handler"], function (e, t, n) {
19933 t.defaultCommands = [{
19934 name: "addCursorAbove",
19935 exec: function exec(e) {
19936 e.selectMoreLines(-1);
19937 },
19938 bindKey: {
19939 win: "Ctrl-Alt-Up",
19940 mac: "Ctrl-Alt-Up"
19941 },
19942 scrollIntoView: "cursor",
19943 readOnly: !0
19944 }, {
19945 name: "addCursorBelow",
19946 exec: function exec(e) {
19947 e.selectMoreLines(1);
19948 },
19949 bindKey: {
19950 win: "Ctrl-Alt-Down",
19951 mac: "Ctrl-Alt-Down"
19952 },
19953 scrollIntoView: "cursor",
19954 readOnly: !0
19955 }, {
19956 name: "addCursorAboveSkipCurrent",
19957 exec: function exec(e) {
19958 e.selectMoreLines(-1, !0);
19959 },
19960 bindKey: {
19961 win: "Ctrl-Alt-Shift-Up",
19962 mac: "Ctrl-Alt-Shift-Up"
19963 },
19964 scrollIntoView: "cursor",
19965 readOnly: !0
19966 }, {
19967 name: "addCursorBelowSkipCurrent",
19968 exec: function exec(e) {
19969 e.selectMoreLines(1, !0);
19970 },
19971 bindKey: {
19972 win: "Ctrl-Alt-Shift-Down",
19973 mac: "Ctrl-Alt-Shift-Down"
19974 },
19975 scrollIntoView: "cursor",
19976 readOnly: !0
19977 }, {
19978 name: "selectMoreBefore",
19979 exec: function exec(e) {
19980 e.selectMore(-1);
19981 },
19982 bindKey: {
19983 win: "Ctrl-Alt-Left",
19984 mac: "Ctrl-Alt-Left"
19985 },
19986 scrollIntoView: "cursor",
19987 readOnly: !0
19988 }, {
19989 name: "selectMoreAfter",
19990 exec: function exec(e) {
19991 e.selectMore(1);
19992 },
19993 bindKey: {
19994 win: "Ctrl-Alt-Right",
19995 mac: "Ctrl-Alt-Right"
19996 },
19997 scrollIntoView: "cursor",
19998 readOnly: !0
19999 }, {
20000 name: "selectNextBefore",
20001 exec: function exec(e) {
20002 e.selectMore(-1, !0);
20003 },
20004 bindKey: {
20005 win: "Ctrl-Alt-Shift-Left",
20006 mac: "Ctrl-Alt-Shift-Left"
20007 },
20008 scrollIntoView: "cursor",
20009 readOnly: !0
20010 }, {
20011 name: "selectNextAfter",
20012 exec: function exec(e) {
20013 e.selectMore(1, !0);
20014 },
20015 bindKey: {
20016 win: "Ctrl-Alt-Shift-Right",
20017 mac: "Ctrl-Alt-Shift-Right"
20018 },
20019 scrollIntoView: "cursor",
20020 readOnly: !0
20021 }, {
20022 name: "splitIntoLines",
20023 exec: function exec(e) {
20024 e.multiSelect.splitIntoLines();
20025 },
20026 bindKey: {
20027 win: "Ctrl-Alt-L",
20028 mac: "Ctrl-Alt-L"
20029 },
20030 readOnly: !0
20031 }, {
20032 name: "alignCursors",
20033 exec: function exec(e) {
20034 e.alignCursors();
20035 },
20036 bindKey: {
20037 win: "Ctrl-Alt-A",
20038 mac: "Ctrl-Alt-A"
20039 },
20040 scrollIntoView: "cursor"
20041 }, {
20042 name: "findAll",
20043 exec: function exec(e) {
20044 e.findAll();
20045 },
20046 bindKey: {
20047 win: "Ctrl-Alt-K",
20048 mac: "Ctrl-Alt-G"
20049 },
20050 scrollIntoView: "cursor",
20051 readOnly: !0
20052 }], t.multiSelectCommands = [{
20053 name: "singleSelection",
20054 bindKey: "esc",
20055 exec: function exec(e) {
20056 e.exitMultiSelectMode();
20057 },
20058 scrollIntoView: "cursor",
20059 readOnly: !0,
20060 isAvailable: function isAvailable(e) {
20061 return e && e.inMultiSelectMode;
20062 }
20063 }];
20064 var r = e("../keyboard/hash_handler").HashHandler;
20065 t.keyboardHandler = new r(t.multiSelectCommands);
20066 }), ace.define("ace/multi_select", ["require", "exports", "module", "ace/range_list", "ace/range", "ace/selection", "ace/mouse/multi_select_handler", "ace/lib/event", "ace/lib/lang", "ace/commands/multi_select_commands", "ace/search", "ace/edit_session", "ace/editor", "ace/config"], function (e, t, n) {
20067 function h(e, t, n) {
20068 return c.$options.wrap = !0, c.$options.needle = t, c.$options.backwards = n == -1, c.find(e);
20069 }
20070
20071 function v(e, t) {
20072 return e.row == t.row && e.column == t.column;
20073 }
20074
20075 function m(e) {
20076 if (e.$multiselectOnSessionChange) return;
20077 e.$onAddRange = e.$onAddRange.bind(e), e.$onRemoveRange = e.$onRemoveRange.bind(e), e.$onMultiSelect = e.$onMultiSelect.bind(e), e.$onSingleSelect = e.$onSingleSelect.bind(e), e.$multiselectOnSessionChange = t.onSessionChange.bind(e), e.$checkMultiselectChange = e.$checkMultiselectChange.bind(e), e.$multiselectOnSessionChange(e), e.on("changeSession", e.$multiselectOnSessionChange), e.on("mousedown", o), e.commands.addCommands(f.defaultCommands), g(e);
20078 }
20079
20080 function g(e) {
20081 function r(t) {
20082 n && (e.renderer.setMouseCursor(""), n = !1);
20083 }
20084
20085 var t = e.textInput.getElement(),
20086 n = !1;
20087 u.addListener(t, "keydown", function (t) {
20088 var i = t.keyCode == 18 && !(t.ctrlKey || t.shiftKey || t.metaKey);
20089 e.$blockSelectEnabled && i ? n || (e.renderer.setMouseCursor("crosshair"), n = !0) : n && r();
20090 }), u.addListener(t, "keyup", r), u.addListener(t, "blur", r);
20091 }
20092
20093 var r = e("./range_list").RangeList,
20094 i = e("./range").Range,
20095 s = e("./selection").Selection,
20096 o = e("./mouse/multi_select_handler").onMouseDown,
20097 u = e("./lib/event"),
20098 a = e("./lib/lang"),
20099 f = e("./commands/multi_select_commands");
20100 t.commands = f.defaultCommands.concat(f.multiSelectCommands);
20101 var l = e("./search").Search,
20102 c = new l(),
20103 p = e("./edit_session").EditSession;
20104 (function () {
20105 this.getSelectionMarkers = function () {
20106 return this.$selectionMarkers;
20107 };
20108 }).call(p.prototype), function () {
20109 this.ranges = null, this.rangeList = null, this.addRange = function (e, t) {
20110 if (!e) return;
20111
20112 if (!this.inMultiSelectMode && this.rangeCount === 0) {
20113 var n = this.toOrientedRange();
20114 this.rangeList.add(n), this.rangeList.add(e);
20115 if (this.rangeList.ranges.length != 2) return this.rangeList.removeAll(), t || this.fromOrientedRange(e);
20116 this.rangeList.removeAll(), this.rangeList.add(n), this.$onAddRange(n);
20117 }
20118
20119 e.cursor || (e.cursor = e.end);
20120 var r = this.rangeList.add(e);
20121 return this.$onAddRange(e), r.length && this.$onRemoveRange(r), this.rangeCount > 1 && !this.inMultiSelectMode && (this._signal("multiSelect"), this.inMultiSelectMode = !0, this.session.$undoSelect = !1, this.rangeList.attach(this.session)), t || this.fromOrientedRange(e);
20122 }, this.toSingleRange = function (e) {
20123 e = e || this.ranges[0];
20124 var t = this.rangeList.removeAll();
20125 t.length && this.$onRemoveRange(t), e && this.fromOrientedRange(e);
20126 }, this.substractPoint = function (e) {
20127 var t = this.rangeList.substractPoint(e);
20128 if (t) return this.$onRemoveRange(t), t[0];
20129 }, this.mergeOverlappingRanges = function () {
20130 var e = this.rangeList.merge();
20131 e.length ? this.$onRemoveRange(e) : this.ranges[0] && this.fromOrientedRange(this.ranges[0]);
20132 }, this.$onAddRange = function (e) {
20133 this.rangeCount = this.rangeList.ranges.length, this.ranges.unshift(e), this._signal("addRange", {
20134 range: e
20135 });
20136 }, this.$onRemoveRange = function (e) {
20137 this.rangeCount = this.rangeList.ranges.length;
20138
20139 if (this.rangeCount == 1 && this.inMultiSelectMode) {
20140 var t = this.rangeList.ranges.pop();
20141 e.push(t), this.rangeCount = 0;
20142 }
20143
20144 for (var n = e.length; n--;) {
20145 var r = this.ranges.indexOf(e[n]);
20146 this.ranges.splice(r, 1);
20147 }
20148
20149 this._signal("removeRange", {
20150 ranges: e
20151 }), this.rangeCount === 0 && this.inMultiSelectMode && (this.inMultiSelectMode = !1, this._signal("singleSelect"), this.session.$undoSelect = !0, this.rangeList.detach(this.session)), t = t || this.ranges[0], t && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
20152 }, this.$initRangeList = function () {
20153 if (this.rangeList) return;
20154 this.rangeList = new r(), this.ranges = [], this.rangeCount = 0;
20155 }, this.getAllRanges = function () {
20156 return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];
20157 }, this.splitIntoLines = function () {
20158 if (this.rangeCount > 1) {
20159 var e = this.rangeList.ranges,
20160 t = e[e.length - 1],
20161 n = i.fromPoints(e[0].start, t.end);
20162 this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
20163 } else {
20164 var n = this.getRange(),
20165 r = this.isBackwards(),
20166 s = n.start.row,
20167 o = n.end.row;
20168
20169 if (s == o) {
20170 if (r) var u = n.end,
20171 a = n.start;else var u = n.start,
20172 a = n.end;
20173 this.addRange(i.fromPoints(a, a)), this.addRange(i.fromPoints(u, u));
20174 return;
20175 }
20176
20177 var f = [],
20178 l = this.getLineRange(s, !0);
20179 l.start.column = n.start.column, f.push(l);
20180
20181 for (var c = s + 1; c < o; c++) {
20182 f.push(this.getLineRange(c, !0));
20183 }
20184
20185 l = this.getLineRange(o, !0), l.end.column = n.end.column, f.push(l), f.forEach(this.addRange, this);
20186 }
20187 }, this.toggleBlockSelection = function () {
20188 if (this.rangeCount > 1) {
20189 var e = this.rangeList.ranges,
20190 t = e[e.length - 1],
20191 n = i.fromPoints(e[0].start, t.end);
20192 this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
20193 } else {
20194 var r = this.session.documentToScreenPosition(this.selectionLead),
20195 s = this.session.documentToScreenPosition(this.selectionAnchor),
20196 o = this.rectangularRangeBlock(r, s);
20197 o.forEach(this.addRange, this);
20198 }
20199 }, this.rectangularRangeBlock = function (e, t, n) {
20200 var r = [],
20201 s = e.column < t.column;
20202 if (s) var o = e.column,
20203 u = t.column;else var o = t.column,
20204 u = e.column;
20205 var a = e.row < t.row;
20206 if (a) var f = e.row,
20207 l = t.row;else var f = t.row,
20208 l = e.row;
20209 o < 0 && (o = 0), f < 0 && (f = 0), f == l && (n = !0);
20210
20211 for (var c = f; c <= l; c++) {
20212 var h = i.fromPoints(this.session.screenToDocumentPosition(c, o), this.session.screenToDocumentPosition(c, u));
20213
20214 if (h.isEmpty()) {
20215 if (p && v(h.end, p)) break;
20216 var p = h.end;
20217 }
20218
20219 h.cursor = s ? h.start : h.end, r.push(h);
20220 }
20221
20222 a && r.reverse();
20223
20224 if (!n) {
20225 var d = r.length - 1;
20226
20227 while (r[d].isEmpty() && d > 0) {
20228 d--;
20229 }
20230
20231 if (d > 0) {
20232 var m = 0;
20233
20234 while (r[m].isEmpty()) {
20235 m++;
20236 }
20237 }
20238
20239 for (var g = d; g >= m; g--) {
20240 r[g].isEmpty() && r.splice(g, 1);
20241 }
20242 }
20243
20244 return r;
20245 };
20246 }.call(s.prototype);
20247 var d = e("./editor").Editor;
20248 (function () {
20249 this.updateSelectionMarkers = function () {
20250 this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20251 }, this.addSelectionMarker = function (e) {
20252 e.cursor || (e.cursor = e.end);
20253 var t = this.getSelectionStyle();
20254 return e.marker = this.session.addMarker(e, "ace_selection", t), this.session.$selectionMarkers.push(e), this.session.selectionMarkerCount = this.session.$selectionMarkers.length, e;
20255 }, this.removeSelectionMarker = function (e) {
20256 if (!e.marker) return;
20257 this.session.removeMarker(e.marker);
20258 var t = this.session.$selectionMarkers.indexOf(e);
20259 t != -1 && this.session.$selectionMarkers.splice(t, 1), this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
20260 }, this.removeSelectionMarkers = function (e) {
20261 var t = this.session.$selectionMarkers;
20262
20263 for (var n = e.length; n--;) {
20264 var r = e[n];
20265 if (!r.marker) continue;
20266 this.session.removeMarker(r.marker);
20267 var i = t.indexOf(r);
20268 i != -1 && t.splice(i, 1);
20269 }
20270
20271 this.session.selectionMarkerCount = t.length;
20272 }, this.$onAddRange = function (e) {
20273 this.addSelectionMarker(e.range), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20274 }, this.$onRemoveRange = function (e) {
20275 this.removeSelectionMarkers(e.ranges), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20276 }, this.$onMultiSelect = function (e) {
20277 if (this.inMultiSelectMode) return;
20278 this.inMultiSelectMode = !0, this.setStyle("ace_multiselect"), this.keyBinding.addKeyboardHandler(f.keyboardHandler), this.commands.setDefaultHandler("exec", this.$onMultiSelectExec), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20279 }, this.$onSingleSelect = function (e) {
20280 if (this.session.multiSelect.inVirtualMode) return;
20281 this.inMultiSelectMode = !1, this.unsetStyle("ace_multiselect"), this.keyBinding.removeKeyboardHandler(f.keyboardHandler), this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec), this.renderer.updateCursor(), this.renderer.updateBackMarkers(), this._emit("changeSelection");
20282 }, this.$onMultiSelectExec = function (e) {
20283 var t = e.command,
20284 n = e.editor;
20285 if (!n.multiSelect) return;
20286
20287 if (!t.multiSelectAction) {
20288 var r = t.exec(n, e.args || {});
20289 n.multiSelect.addRange(n.multiSelect.toOrientedRange()), n.multiSelect.mergeOverlappingRanges();
20290 } else t.multiSelectAction == "forEach" ? r = n.forEachSelection(t, e.args) : t.multiSelectAction == "forEachLine" ? r = n.forEachSelection(t, e.args, !0) : t.multiSelectAction == "single" ? (n.exitMultiSelectMode(), r = t.exec(n, e.args || {})) : r = t.multiSelectAction(n, e.args || {});
20291
20292 return r;
20293 }, this.forEachSelection = function (e, t, n) {
20294 if (this.inVirtualSelectionMode) return;
20295 var r = n && n.keepOrder,
20296 i = n == 1 || n && n.$byLines,
20297 o = this.session,
20298 u = this.selection,
20299 a = u.rangeList,
20300 f = (r ? u : a).ranges,
20301 l;
20302 if (!f.length) return e.exec ? e.exec(this, t || {}) : e(this, t || {});
20303 var c = u._eventRegistry;
20304 u._eventRegistry = {};
20305 var h = new s(o);
20306 this.inVirtualSelectionMode = !0;
20307
20308 for (var p = f.length; p--;) {
20309 if (i) while (p > 0 && f[p].start.row == f[p - 1].end.row) {
20310 p--;
20311 }
20312 h.fromOrientedRange(f[p]), h.index = p, this.selection = o.selection = h;
20313 var d = e.exec ? e.exec(this, t || {}) : e(this, t || {});
20314 !l && d !== undefined && (l = d), h.toOrientedRange(f[p]);
20315 }
20316
20317 h.detach(), this.selection = o.selection = u, this.inVirtualSelectionMode = !1, u._eventRegistry = c, u.mergeOverlappingRanges();
20318 var v = this.renderer.$scrollAnimation;
20319 return this.onCursorChange(), this.onSelectionChange(), v && v.from == v.to && this.renderer.animateScrolling(v.from), l;
20320 }, this.exitMultiSelectMode = function () {
20321 if (!this.inMultiSelectMode || this.inVirtualSelectionMode) return;
20322 this.multiSelect.toSingleRange();
20323 }, this.getSelectedText = function () {
20324 var e = "";
20325
20326 if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
20327 var t = this.multiSelect.rangeList.ranges,
20328 n = [];
20329
20330 for (var r = 0; r < t.length; r++) {
20331 n.push(this.session.getTextRange(t[r]));
20332 }
20333
20334 var i = this.session.getDocument().getNewLineCharacter();
20335 e = n.join(i), e.length == (n.length - 1) * i.length && (e = "");
20336 } else this.selection.isEmpty() || (e = this.session.getTextRange(this.getSelectionRange()));
20337
20338 return e;
20339 }, this.$checkMultiselectChange = function (e, t) {
20340 if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
20341 var n = this.multiSelect.ranges[0];
20342 if (this.multiSelect.isEmpty() && t == this.multiSelect.anchor) return;
20343 var r = t == this.multiSelect.anchor ? n.cursor == n.start ? n.end : n.start : n.cursor;
20344 (r.row != t.row || this.session.$clipPositionToDocument(r.row, r.column).column != t.column) && this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());
20345 }
20346 }, this.findAll = function (e, t, n) {
20347 t = t || {}, t.needle = e || t.needle;
20348
20349 if (t.needle == undefined) {
20350 var r = this.selection.isEmpty() ? this.selection.getWordRange() : this.selection.getRange();
20351 t.needle = this.session.getTextRange(r);
20352 }
20353
20354 this.$search.set(t);
20355 var i = this.$search.findAll(this.session);
20356 if (!i.length) return 0;
20357 this.$blockScrolling += 1;
20358 var s = this.multiSelect;
20359 n || s.toSingleRange(i[0]);
20360
20361 for (var o = i.length; o--;) {
20362 s.addRange(i[o], !0);
20363 }
20364
20365 return r && s.rangeList.rangeAtPoint(r.start) && s.addRange(r, !0), this.$blockScrolling -= 1, i.length;
20366 }, this.selectMoreLines = function (e, t) {
20367 var n = this.selection.toOrientedRange(),
20368 r = n.cursor == n.end,
20369 s = this.session.documentToScreenPosition(n.cursor);
20370 this.selection.$desiredColumn && (s.column = this.selection.$desiredColumn);
20371 var o = this.session.screenToDocumentPosition(s.row + e, s.column);
20372 if (!n.isEmpty()) var u = this.session.documentToScreenPosition(r ? n.end : n.start),
20373 a = this.session.screenToDocumentPosition(u.row + e, u.column);else var a = o;
20374
20375 if (r) {
20376 var f = i.fromPoints(o, a);
20377 f.cursor = f.start;
20378 } else {
20379 var f = i.fromPoints(a, o);
20380 f.cursor = f.end;
20381 }
20382
20383 f.desiredColumn = s.column;
20384 if (!this.selection.inMultiSelectMode) this.selection.addRange(n);else if (t) var l = n.cursor;
20385 this.selection.addRange(f), l && this.selection.substractPoint(l);
20386 }, this.transposeSelections = function (e) {
20387 var t = this.session,
20388 n = t.multiSelect,
20389 r = n.ranges;
20390
20391 for (var i = r.length; i--;) {
20392 var s = r[i];
20393
20394 if (s.isEmpty()) {
20395 var o = t.getWordRange(s.start.row, s.start.column);
20396 s.start.row = o.start.row, s.start.column = o.start.column, s.end.row = o.end.row, s.end.column = o.end.column;
20397 }
20398 }
20399
20400 n.mergeOverlappingRanges();
20401 var u = [];
20402
20403 for (var i = r.length; i--;) {
20404 var s = r[i];
20405 u.unshift(t.getTextRange(s));
20406 }
20407
20408 e < 0 ? u.unshift(u.pop()) : u.push(u.shift());
20409
20410 for (var i = r.length; i--;) {
20411 var s = r[i],
20412 o = s.clone();
20413 t.replace(s, u[i]), s.start.row = o.start.row, s.start.column = o.start.column;
20414 }
20415 }, this.selectMore = function (e, t, n) {
20416 var r = this.session,
20417 i = r.multiSelect,
20418 s = i.toOrientedRange();
20419
20420 if (s.isEmpty()) {
20421 s = r.getWordRange(s.start.row, s.start.column), s.cursor = e == -1 ? s.start : s.end, this.multiSelect.addRange(s);
20422 if (n) return;
20423 }
20424
20425 var o = r.getTextRange(s),
20426 u = h(r, o, e);
20427 u && (u.cursor = e == -1 ? u.start : u.end, this.$blockScrolling += 1, this.session.unfold(u), this.multiSelect.addRange(u), this.$blockScrolling -= 1, this.renderer.scrollCursorIntoView(null, .5)), t && this.multiSelect.substractPoint(s.cursor);
20428 }, this.alignCursors = function () {
20429 var e = this.session,
20430 t = e.multiSelect,
20431 n = t.ranges,
20432 r = -1,
20433 s = n.filter(function (e) {
20434 if (e.cursor.row == r) return !0;
20435 r = e.cursor.row;
20436 });
20437
20438 if (!n.length || s.length == n.length - 1) {
20439 var o = this.selection.getRange(),
20440 u = o.start.row,
20441 f = o.end.row,
20442 l = u == f;
20443
20444 if (l) {
20445 var c = this.session.getLength(),
20446 h;
20447
20448 do {
20449 h = this.session.getLine(f);
20450 } while (/[=:]/.test(h) && ++f < c);
20451
20452 do {
20453 h = this.session.getLine(u);
20454 } while (/[=:]/.test(h) && --u > 0);
20455
20456 u < 0 && (u = 0), f >= c && (f = c - 1);
20457 }
20458
20459 var p = this.session.removeFullLines(u, f);
20460 p = this.$reAlignText(p, l), this.session.insert({
20461 row: u,
20462 column: 0
20463 }, p.join("\n") + "\n"), l || (o.start.column = 0, o.end.column = p[p.length - 1].length), this.selection.setRange(o);
20464 } else {
20465 s.forEach(function (e) {
20466 t.substractPoint(e.cursor);
20467 });
20468 var d = 0,
20469 v = Infinity,
20470 m = n.map(function (t) {
20471 var n = t.cursor,
20472 r = e.getLine(n.row),
20473 i = r.substr(n.column).search(/\S/g);
20474 return i == -1 && (i = 0), n.column > d && (d = n.column), i < v && (v = i), i;
20475 });
20476 n.forEach(function (t, n) {
20477 var r = t.cursor,
20478 s = d - r.column,
20479 o = m[n] - v;
20480 s > o ? e.insert(r, a.stringRepeat(" ", s - o)) : e.remove(new i(r.row, r.column, r.row, r.column - s + o)), t.start.column = t.end.column = d, t.start.row = t.end.row = r.row, t.cursor = t.end;
20481 }), t.fromOrientedRange(n[0]), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
20482 }
20483 }, this.$reAlignText = function (e, t) {
20484 function u(e) {
20485 return a.stringRepeat(" ", e);
20486 }
20487
20488 function f(e) {
20489 return e[2] ? u(i) + e[2] + u(s - e[2].length + o) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
20490 }
20491
20492 function l(e) {
20493 return e[2] ? u(i + s - e[2].length) + e[2] + u(o, " ") + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
20494 }
20495
20496 function c(e) {
20497 return e[2] ? u(i) + e[2] + u(o) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
20498 }
20499
20500 var n = !0,
20501 r = !0,
20502 i,
20503 s,
20504 o;
20505 return e.map(function (e) {
20506 var t = e.match(/(\s*)(.*?)(\s*)([=:].*)/);
20507 return t ? i == null ? (i = t[1].length, s = t[2].length, o = t[3].length, t) : (i + s + o != t[1].length + t[2].length + t[3].length && (r = !1), i != t[1].length && (n = !1), i > t[1].length && (i = t[1].length), s < t[2].length && (s = t[2].length), o > t[3].length && (o = t[3].length), t) : [e];
20508 }).map(t ? f : n ? r ? l : f : c);
20509 };
20510 }).call(d.prototype), t.onSessionChange = function (e) {
20511 var t = e.session;
20512 t && !t.multiSelect && (t.$selectionMarkers = [], t.selection.$initRangeList(), t.multiSelect = t.selection), this.multiSelect = t && t.multiSelect;
20513 var n = e.oldSession;
20514 n && (n.multiSelect.off("addRange", this.$onAddRange), n.multiSelect.off("removeRange", this.$onRemoveRange), n.multiSelect.off("multiSelect", this.$onMultiSelect), n.multiSelect.off("singleSelect", this.$onSingleSelect), n.multiSelect.lead.off("change", this.$checkMultiselectChange), n.multiSelect.anchor.off("change", this.$checkMultiselectChange)), t && (t.multiSelect.on("addRange", this.$onAddRange), t.multiSelect.on("removeRange", this.$onRemoveRange), t.multiSelect.on("multiSelect", this.$onMultiSelect), t.multiSelect.on("singleSelect", this.$onSingleSelect), t.multiSelect.lead.on("change", this.$checkMultiselectChange), t.multiSelect.anchor.on("change", this.$checkMultiselectChange)), t && this.inMultiSelectMode != t.selection.inMultiSelectMode && (t.selection.inMultiSelectMode ? this.$onMultiSelect() : this.$onSingleSelect());
20515 }, t.MultiSelect = m, e("./config").defineOptions(d.prototype, "editor", {
20516 enableMultiselect: {
20517 set: function set(e) {
20518 m(this), e ? (this.on("changeSession", this.$multiselectOnSessionChange), this.on("mousedown", o)) : (this.off("changeSession", this.$multiselectOnSessionChange), this.off("mousedown", o));
20519 },
20520 value: !0
20521 },
20522 enableBlockSelect: {
20523 set: function set(e) {
20524 this.$blockSelectEnabled = e;
20525 },
20526 value: !0
20527 }
20528 });
20529 }), ace.define("ace/mode/folding/fold_mode", ["require", "exports", "module", "ace/range"], function (e, t, n) {
20530 "use strict";
20531
20532 var r = e("../../range").Range,
20533 i = t.FoldMode = function () {};
20534
20535 (function () {
20536 this.foldingStartMarker = null, this.foldingStopMarker = null, this.getFoldWidget = function (e, t, n) {
20537 var r = e.getLine(n);
20538 return this.foldingStartMarker.test(r) ? "start" : t == "markbeginend" && this.foldingStopMarker && this.foldingStopMarker.test(r) ? "end" : "";
20539 }, this.getFoldWidgetRange = function (e, t, n) {
20540 return null;
20541 }, this.indentationBlock = function (e, t, n) {
20542 var i = /\S/,
20543 s = e.getLine(t),
20544 o = s.search(i);
20545 if (o == -1) return;
20546 var u = n || s.length,
20547 a = e.getLength(),
20548 f = t,
20549 l = t;
20550
20551 while (++t < a) {
20552 var c = e.getLine(t).search(i);
20553 if (c == -1) continue;
20554 if (c <= o) break;
20555 l = t;
20556 }
20557
20558 if (l > f) {
20559 var h = e.getLine(l).length;
20560 return new r(f, u, l, h);
20561 }
20562 }, this.openingBracketBlock = function (e, t, n, i, s) {
20563 var o = {
20564 row: n,
20565 column: i + 1
20566 },
20567 u = e.$findClosingBracket(t, o, s);
20568 if (!u) return;
20569 var a = e.foldWidgets[u.row];
20570 return a == null && (a = e.getFoldWidget(u.row)), a == "start" && u.row > o.row && (u.row--, u.column = e.getLine(u.row).length), r.fromPoints(o, u);
20571 }, this.closingBracketBlock = function (e, t, n, i, s) {
20572 var o = {
20573 row: n,
20574 column: i
20575 },
20576 u = e.$findOpeningBracket(t, o);
20577 if (!u) return;
20578 return u.column++, o.column--, r.fromPoints(u, o);
20579 };
20580 }).call(i.prototype);
20581 }), ace.define("ace/theme/textmate", ["require", "exports", "module", "ace/lib/dom"], function (e, t, n) {
20582 "use strict";
20583
20584 t.isDark = !1, t.cssClass = "ace-tm", t.cssText = '.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';
20585 var r = e("../lib/dom");
20586 r.importCssString(t.cssText, t.cssClass);
20587 }), ace.define("ace/line_widgets", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/range"], function (e, t, n) {
20588 "use strict";
20589
20590 function o(e) {
20591 this.session = e, this.session.widgetManager = this, this.session.getRowLength = this.getRowLength, this.session.$getWidgetScreenLength = this.$getWidgetScreenLength, this.updateOnChange = this.updateOnChange.bind(this), this.renderWidgets = this.renderWidgets.bind(this), this.measureWidgets = this.measureWidgets.bind(this), this.session._changedWidgets = [], this.$onChangeEditor = this.$onChangeEditor.bind(this), this.session.on("change", this.updateOnChange), this.session.on("changeFold", this.updateOnFold), this.session.on("changeEditor", this.$onChangeEditor);
20592 }
20593
20594 var r = e("./lib/oop"),
20595 i = e("./lib/dom"),
20596 s = e("./range").Range;
20597 (function () {
20598 this.getRowLength = function (e) {
20599 var t;
20600 return this.lineWidgets ? t = this.lineWidgets[e] && this.lineWidgets[e].rowCount || 0 : t = 0, !this.$useWrapMode || !this.$wrapData[e] ? 1 + t : this.$wrapData[e].length + 1 + t;
20601 }, this.$getWidgetScreenLength = function () {
20602 var e = 0;
20603 return this.lineWidgets.forEach(function (t) {
20604 t && t.rowCount && !t.hidden && (e += t.rowCount);
20605 }), e;
20606 }, this.$onChangeEditor = function (e) {
20607 this.attach(e.editor);
20608 }, this.attach = function (e) {
20609 e && e.widgetManager && e.widgetManager != this && e.widgetManager.detach();
20610 if (this.editor == e) return;
20611 this.detach(), this.editor = e, e && (e.widgetManager = this, e.renderer.on("beforeRender", this.measureWidgets), e.renderer.on("afterRender", this.renderWidgets));
20612 }, this.detach = function (e) {
20613 var t = this.editor;
20614 if (!t) return;
20615 this.editor = null, t.widgetManager = null, t.renderer.off("beforeRender", this.measureWidgets), t.renderer.off("afterRender", this.renderWidgets);
20616 var n = this.session.lineWidgets;
20617 n && n.forEach(function (e) {
20618 e && e.el && e.el.parentNode && (e._inDocument = !1, e.el.parentNode.removeChild(e.el));
20619 });
20620 }, this.updateOnFold = function (e, t) {
20621 var n = t.lineWidgets;
20622 if (!n || !e.action) return;
20623 var r = e.data,
20624 i = r.start.row,
20625 s = r.end.row,
20626 o = e.action == "add";
20627
20628 for (var u = i + 1; u < s; u++) {
20629 n[u] && (n[u].hidden = o);
20630 }
20631
20632 n[s] && (o ? n[i] ? n[s].hidden = o : n[i] = n[s] : (n[i] == n[s] && (n[i] = undefined), n[s].hidden = o));
20633 }, this.updateOnChange = function (e) {
20634 var t = this.session.lineWidgets;
20635 if (!t) return;
20636 var n = e.start.row,
20637 r = e.end.row - n;
20638 if (r !== 0) if (e.action == "remove") {
20639 var i = t.splice(n + 1, r);
20640 i.forEach(function (e) {
20641 e && this.removeLineWidget(e);
20642 }, this), this.$updateRows();
20643 } else {
20644 var s = new Array(r);
20645 s.unshift(n, 0), t.splice.apply(t, s), this.$updateRows();
20646 }
20647 }, this.$updateRows = function () {
20648 var e = this.session.lineWidgets;
20649 if (!e) return;
20650 var t = !0;
20651 e.forEach(function (e, n) {
20652 if (e) {
20653 t = !1, e.row = n;
20654
20655 while (e.$oldWidget) {
20656 e.$oldWidget.row = n, e = e.$oldWidget;
20657 }
20658 }
20659 }), t && (this.session.lineWidgets = null);
20660 }, this.addLineWidget = function (e) {
20661 this.session.lineWidgets || (this.session.lineWidgets = new Array(this.session.getLength()));
20662 var t = this.session.lineWidgets[e.row];
20663 t && (e.$oldWidget = t, t.el && t.el.parentNode && (t.el.parentNode.removeChild(t.el), t._inDocument = !1)), this.session.lineWidgets[e.row] = e, e.session = this.session;
20664 var n = this.editor.renderer;
20665 e.html && !e.el && (e.el = i.createElement("div"), e.el.innerHTML = e.html), e.el && (i.addCssClass(e.el, "ace_lineWidgetContainer"), e.el.style.position = "absolute", e.el.style.zIndex = 5, n.container.appendChild(e.el), e._inDocument = !0), e.coverGutter || (e.el.style.zIndex = 3), e.pixelHeight == null && (e.pixelHeight = e.el.offsetHeight), e.rowCount == null && (e.rowCount = e.pixelHeight / n.layerConfig.lineHeight);
20666 var r = this.session.getFoldAt(e.row, 0);
20667 e.$fold = r;
20668
20669 if (r) {
20670 var s = this.session.lineWidgets;
20671 e.row == r.end.row && !s[r.start.row] ? s[r.start.row] = e : e.hidden = !0;
20672 }
20673
20674 return this.session._emit("changeFold", {
20675 data: {
20676 start: {
20677 row: e.row
20678 }
20679 }
20680 }), this.$updateRows(), this.renderWidgets(null, n), this.onWidgetChanged(e), e;
20681 }, this.removeLineWidget = function (e) {
20682 e._inDocument = !1, e.session = null, e.el && e.el.parentNode && e.el.parentNode.removeChild(e.el);
20683 if (e.editor && e.editor.destroy) try {
20684 e.editor.destroy();
20685 } catch (t) {}
20686
20687 if (this.session.lineWidgets) {
20688 var n = this.session.lineWidgets[e.row];
20689 if (n == e) this.session.lineWidgets[e.row] = e.$oldWidget, e.$oldWidget && this.onWidgetChanged(e.$oldWidget);else while (n) {
20690 if (n.$oldWidget == e) {
20691 n.$oldWidget = e.$oldWidget;
20692 break;
20693 }
20694
20695 n = n.$oldWidget;
20696 }
20697 }
20698
20699 this.session._emit("changeFold", {
20700 data: {
20701 start: {
20702 row: e.row
20703 }
20704 }
20705 }), this.$updateRows();
20706 }, this.getWidgetsAtRow = function (e) {
20707 var t = this.session.lineWidgets,
20708 n = t && t[e],
20709 r = [];
20710
20711 while (n) {
20712 r.push(n), n = n.$oldWidget;
20713 }
20714
20715 return r;
20716 }, this.onWidgetChanged = function (e) {
20717 this.session._changedWidgets.push(e), this.editor && this.editor.renderer.updateFull();
20718 }, this.measureWidgets = function (e, t) {
20719 var n = this.session._changedWidgets,
20720 r = t.layerConfig;
20721 if (!n || !n.length) return;
20722 var i = Infinity;
20723
20724 for (var s = 0; s < n.length; s++) {
20725 var o = n[s];
20726 if (!o || !o.el) continue;
20727 if (o.session != this.session) continue;
20728
20729 if (!o._inDocument) {
20730 if (this.session.lineWidgets[o.row] != o) continue;
20731 o._inDocument = !0, t.container.appendChild(o.el);
20732 }
20733
20734 o.h = o.el.offsetHeight, o.fixedWidth || (o.w = o.el.offsetWidth, o.screenWidth = Math.ceil(o.w / r.characterWidth));
20735 var u = o.h / r.lineHeight;
20736 o.coverLine && (u -= this.session.getRowLineCount(o.row), u < 0 && (u = 0)), o.rowCount != u && (o.rowCount = u, o.row < i && (i = o.row));
20737 }
20738
20739 i != Infinity && (this.session._emit("changeFold", {
20740 data: {
20741 start: {
20742 row: i
20743 }
20744 }
20745 }), this.session.lineWidgetWidth = null), this.session._changedWidgets = [];
20746 }, this.renderWidgets = function (e, t) {
20747 var n = t.layerConfig,
20748 r = this.session.lineWidgets;
20749 if (!r) return;
20750 var i = Math.min(this.firstRow, n.firstRow),
20751 s = Math.max(this.lastRow, n.lastRow, r.length);
20752
20753 while (i > 0 && !r[i]) {
20754 i--;
20755 }
20756
20757 this.firstRow = n.firstRow, this.lastRow = n.lastRow, t.$cursorLayer.config = n;
20758
20759 for (var o = i; o <= s; o++) {
20760 var u = r[o];
20761 if (!u || !u.el) continue;
20762
20763 if (u.hidden) {
20764 u.el.style.top = -100 - (u.pixelHeight || 0) + "px";
20765 continue;
20766 }
20767
20768 u._inDocument || (u._inDocument = !0, t.container.appendChild(u.el));
20769 var a = t.$cursorLayer.getPixelPosition({
20770 row: o,
20771 column: 0
20772 }, !0).top;
20773 u.coverLine || (a += n.lineHeight * this.session.getRowLineCount(u.row)), u.el.style.top = a - n.offset + "px";
20774 var f = u.coverGutter ? 0 : t.gutterWidth;
20775 u.fixedWidth || (f -= t.scrollLeft), u.el.style.left = f + "px", u.fullWidth && u.screenWidth && (u.el.style.minWidth = n.width + 2 * n.padding + "px"), u.fixedWidth ? u.el.style.right = t.scrollBar.getWidth() + "px" : u.el.style.right = "";
20776 }
20777 };
20778 }).call(o.prototype), t.LineWidgets = o;
20779 }), ace.define("ace/ext/error_marker", ["require", "exports", "module", "ace/line_widgets", "ace/lib/dom", "ace/range"], function (e, t, n) {
20780 "use strict";
20781
20782 function o(e, t, n) {
20783 var r = 0,
20784 i = e.length - 1;
20785
20786 while (r <= i) {
20787 var s = r + i >> 1,
20788 o = n(t, e[s]);
20789 if (o > 0) r = s + 1;else {
20790 if (!(o < 0)) return s;
20791 i = s - 1;
20792 }
20793 }
20794
20795 return -(r + 1);
20796 }
20797
20798 function u(e, t, n) {
20799 var r = e.getAnnotations().sort(s.comparePoints);
20800 if (!r.length) return;
20801 var i = o(r, {
20802 row: t,
20803 column: -1
20804 }, s.comparePoints);
20805 i < 0 && (i = -i - 1), i >= r.length ? i = n > 0 ? 0 : r.length - 1 : i === 0 && n < 0 && (i = r.length - 1);
20806 var u = r[i];
20807 if (!u || !n) return;
20808
20809 if (u.row === t) {
20810 do {
20811 u = r[i += n];
20812 } while (u && u.row === t);
20813
20814 if (!u) return r.slice();
20815 }
20816
20817 var a = [];
20818 t = u.row;
20819
20820 do {
20821 a[n < 0 ? "unshift" : "push"](u), u = r[i += n];
20822 } while (u && u.row == t);
20823
20824 return a.length && a;
20825 }
20826
20827 var r = e("../line_widgets").LineWidgets,
20828 i = e("../lib/dom"),
20829 s = e("../range").Range;
20830 t.showErrorMarker = function (e, t) {
20831 var n = e.session;
20832 n.widgetManager || (n.widgetManager = new r(n), n.widgetManager.attach(e));
20833 var s = e.getCursorPosition(),
20834 o = s.row,
20835 a = n.widgetManager.getWidgetsAtRow(o).filter(function (e) {
20836 return e.type == "errorMarker";
20837 })[0];
20838 a ? a.destroy() : o -= t;
20839 var f = u(n, o, t),
20840 l;
20841
20842 if (f) {
20843 var c = f[0];
20844 s.column = (c.pos && typeof c.column != "number" ? c.pos.sc : c.column) || 0, s.row = c.row, l = e.renderer.$gutterLayer.$annotations[s.row];
20845 } else {
20846 if (a) return;
20847 l = {
20848 text: ["Looks good!"],
20849 className: "ace_ok"
20850 };
20851 }
20852
20853 e.session.unfold(s.row), e.selection.moveToPosition(s);
20854 var h = {
20855 row: s.row,
20856 fixedWidth: !0,
20857 coverGutter: !0,
20858 el: i.createElement("div"),
20859 type: "errorMarker"
20860 },
20861 p = h.el.appendChild(i.createElement("div")),
20862 d = h.el.appendChild(i.createElement("div"));
20863 d.className = "error_widget_arrow " + l.className;
20864 var v = e.renderer.$cursorLayer.getPixelPosition(s).left;
20865 d.style.left = v + e.renderer.gutterWidth - 5 + "px", h.el.className = "error_widget_wrapper", p.className = "error_widget " + l.className, p.innerHTML = l.text.join("<br>"), p.appendChild(i.createElement("div"));
20866
20867 var m = function m(e, t, n) {
20868 if (t === 0 && (n === "esc" || n === "return")) return h.destroy(), {
20869 command: "null"
20870 };
20871 };
20872
20873 h.destroy = function () {
20874 if (e.$mouseHandler.isMousePressed) return;
20875 e.keyBinding.removeKeyboardHandler(m), n.widgetManager.removeLineWidget(h), e.off("changeSelection", h.destroy), e.off("changeSession", h.destroy), e.off("mouseup", h.destroy), e.off("change", h.destroy);
20876 }, e.keyBinding.addKeyboardHandler(m), e.on("changeSelection", h.destroy), e.on("changeSession", h.destroy), e.on("mouseup", h.destroy), e.on("change", h.destroy), e.session.widgetManager.addLineWidget(h), h.el.onmousedown = e.focus.bind(e), e.renderer.scrollCursorIntoView(null, .5, {
20877 bottom: h.el.offsetHeight
20878 });
20879 }, i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }", "");
20880 }), ace.define("ace/ace", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/lib/dom", "ace/lib/event", "ace/editor", "ace/edit_session", "ace/undomanager", "ace/virtual_renderer", "ace/worker/worker_client", "ace/keyboard/hash_handler", "ace/placeholder", "ace/multi_select", "ace/mode/folding/fold_mode", "ace/theme/textmate", "ace/ext/error_marker", "ace/config"], function (e, t, n) {
20881 "use strict";
20882
20883 e("./lib/fixoldbrowsers");
20884 var r = e("./lib/dom"),
20885 i = e("./lib/event"),
20886 s = e("./editor").Editor,
20887 o = e("./edit_session").EditSession,
20888 u = e("./undomanager").UndoManager,
20889 a = e("./virtual_renderer").VirtualRenderer;
20890 e("./worker/worker_client"), e("./keyboard/hash_handler"), e("./placeholder"), e("./multi_select"), e("./mode/folding/fold_mode"), e("./theme/textmate"), e("./ext/error_marker"), t.config = e("./config"), t.require = e, typeof define == "function" && (t.define = define), t.edit = function (e) {
20891 if (typeof e == "string") {
20892 var n = e;
20893 e = document.getElementById(n);
20894 if (!e) throw new Error("ace.edit can't find div #" + n);
20895 }
20896
20897 if (e && e.env && e.env.editor instanceof s) return e.env.editor;
20898 var o = "";
20899
20900 if (e && /input|textarea/i.test(e.tagName)) {
20901 var u = e;
20902 o = u.value, e = r.createElement("pre"), u.parentNode.replaceChild(e, u);
20903 } else e && (o = r.getInnerText(e), e.innerHTML = "");
20904
20905 var f = t.createEditSession(o),
20906 l = new s(new a(e));
20907 l.setSession(f);
20908 var c = {
20909 document: f,
20910 editor: l,
20911 onResize: l.resize.bind(l, null)
20912 };
20913 return u && (c.textarea = u), i.addListener(window, "resize", c.onResize), l.on("destroy", function () {
20914 i.removeListener(window, "resize", c.onResize), c.editor.container.env = null;
20915 }), l.container.env = l.env = c, l;
20916 }, t.createEditSession = function (e, t) {
20917 var n = new o(e, t);
20918 return n.setUndoManager(new u()), n;
20919 }, t.EditSession = o, t.UndoManager = u, t.version = "1.2.8";
20920 });
20921
20922 (function () {
20923 ace.require(["ace/ace"], function (a) {
20924 if (a) {
20925 a.config.init(true);
20926 a.define = ace.define;
20927 }
20928
20929 if (!window.ace) window.ace = a;
20930
20931 for (var key in a) {
20932 if (a.hasOwnProperty(key) && !window.ace[key]) window.ace[key] = a[key];
20933 }
20934 });
20935 })();
20936 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
20937
20938 ace.define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function (e, t, n) {
20939 "use strict";
20940
20941 var r = e("../lib/oop"),
20942 i = e("../lib/lang"),
20943 s = e("./text_highlight_rules").TextHighlightRules,
20944 o = t.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",
20945 u = t.supportFunction = "rgb|rgba|url|attr|counter|counters",
20946 a = t.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",
20947 f = t.supportConstantColor = "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|green|greenyellow|grey|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",
20948 l = t.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",
20949 c = t.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",
20950 h = t.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",
20951 p = t.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",
20952 d = function d() {
20953 var e = this.createKeywordMapper({
20954 "support.function": u,
20955 "support.constant": a,
20956 "support.type": o,
20957 "support.constant.color": f,
20958 "support.constant.fonts": l
20959 }, "text", !0);
20960 this.$rules = {
20961 start: [{
20962 include: ["strings", "url", "comments"]
20963 }, {
20964 token: "paren.lparen",
20965 regex: "\\{",
20966 next: "ruleset"
20967 }, {
20968 token: "paren.rparen",
20969 regex: "\\}"
20970 }, {
20971 token: "string",
20972 regex: "@",
20973 next: "media"
20974 }, {
20975 token: "keyword",
20976 regex: "#[a-z0-9-_]+"
20977 }, {
20978 token: "keyword",
20979 regex: "%"
20980 }, {
20981 token: "variable",
20982 regex: "\\.[a-z0-9-_]+"
20983 }, {
20984 token: "string",
20985 regex: ":[a-z0-9-_]+"
20986 }, {
20987 token: "constant.numeric",
20988 regex: c
20989 }, {
20990 token: "constant",
20991 regex: "[a-z0-9-_]+"
20992 }, {
20993 caseInsensitive: !0
20994 }],
20995 media: [{
20996 include: ["strings", "url", "comments"]
20997 }, {
20998 token: "paren.lparen",
20999 regex: "\\{",
21000 next: "start"
21001 }, {
21002 token: "paren.rparen",
21003 regex: "\\}",
21004 next: "start"
21005 }, {
21006 token: "string",
21007 regex: ";",
21008 next: "start"
21009 }, {
21010 token: "keyword",
21011 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"
21012 }],
21013 comments: [{
21014 token: "comment",
21015 regex: "\\/\\*",
21016 push: [{
21017 token: "comment",
21018 regex: "\\*\\/",
21019 next: "pop"
21020 }, {
21021 defaultToken: "comment"
21022 }]
21023 }],
21024 ruleset: [{
21025 regex: "-(webkit|ms|moz|o)-",
21026 token: "text"
21027 }, {
21028 token: "paren.rparen",
21029 regex: "\\}",
21030 next: "start"
21031 }, {
21032 include: ["strings", "url", "comments"]
21033 }, {
21034 token: ["constant.numeric", "keyword"],
21035 regex: "(" + c + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
21036 }, {
21037 token: "constant.numeric",
21038 regex: c
21039 }, {
21040 token: "constant.numeric",
21041 regex: "#[a-f0-9]{6}"
21042 }, {
21043 token: "constant.numeric",
21044 regex: "#[a-f0-9]{3}"
21045 }, {
21046 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
21047 regex: h
21048 }, {
21049 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
21050 regex: p
21051 }, {
21052 include: "url"
21053 }, {
21054 token: e,
21055 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
21056 }, {
21057 caseInsensitive: !0
21058 }],
21059 url: [{
21060 token: "support.function",
21061 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
21062 push: [{
21063 token: "support.function",
21064 regex: "\\)",
21065 next: "pop"
21066 }, {
21067 defaultToken: "string"
21068 }]
21069 }],
21070 strings: [{
21071 token: "string.start",
21072 regex: "'",
21073 push: [{
21074 token: "string.end",
21075 regex: "'|$",
21076 next: "pop"
21077 }, {
21078 include: "escapes"
21079 }, {
21080 token: "constant.language.escape",
21081 regex: /\\$/,
21082 consumeLineEnd: !0
21083 }, {
21084 defaultToken: "string"
21085 }]
21086 }, {
21087 token: "string.start",
21088 regex: '"',
21089 push: [{
21090 token: "string.end",
21091 regex: '"|$',
21092 next: "pop"
21093 }, {
21094 include: "escapes"
21095 }, {
21096 token: "constant.language.escape",
21097 regex: /\\$/,
21098 consumeLineEnd: !0
21099 }, {
21100 defaultToken: "string"
21101 }]
21102 }],
21103 escapes: [{
21104 token: "constant.language.escape",
21105 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
21106 }]
21107 }, this.normalizeRules();
21108 };
21109
21110 r.inherits(d, s), t.CssHighlightRules = d;
21111 }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
21112 "use strict";
21113
21114 var r = e("../range").Range,
21115 i = function i() {};
21116
21117 (function () {
21118 this.checkOutdent = function (e, t) {
21119 return /^\s+$/.test(e) ? /^\s*\}/.test(t) : !1;
21120 }, this.autoOutdent = function (e, t) {
21121 var n = e.getLine(t),
21122 i = n.match(/^(\s*\})/);
21123 if (!i) return 0;
21124 var s = i[1].length,
21125 o = e.findMatchingBracket({
21126 row: t,
21127 column: s
21128 });
21129 if (!o || o.row == t) return 0;
21130 var u = this.$getIndent(e.getLine(o.row));
21131 e.replace(new r(t, 0, t, s - 1), u);
21132 }, this.$getIndent = function (e) {
21133 return e.match(/^\s*/)[0];
21134 };
21135 }).call(i.prototype), t.MatchingBraceOutdent = i;
21136 }), ace.define("ace/mode/css_completions", ["require", "exports", "module"], function (e, t, n) {
21137 "use strict";
21138
21139 var r = {
21140 background: {
21141 "#$0": 1
21142 },
21143 "background-color": {
21144 "#$0": 1,
21145 transparent: 1,
21146 fixed: 1
21147 },
21148 "background-image": {
21149 "url('/$0')": 1
21150 },
21151 "background-repeat": {
21152 repeat: 1,
21153 "repeat-x": 1,
21154 "repeat-y": 1,
21155 "no-repeat": 1,
21156 inherit: 1
21157 },
21158 "background-position": {
21159 bottom: 2,
21160 center: 2,
21161 left: 2,
21162 right: 2,
21163 top: 2,
21164 inherit: 2
21165 },
21166 "background-attachment": {
21167 scroll: 1,
21168 fixed: 1
21169 },
21170 "background-size": {
21171 cover: 1,
21172 contain: 1
21173 },
21174 "background-clip": {
21175 "border-box": 1,
21176 "padding-box": 1,
21177 "content-box": 1
21178 },
21179 "background-origin": {
21180 "border-box": 1,
21181 "padding-box": 1,
21182 "content-box": 1
21183 },
21184 border: {
21185 "solid $0": 1,
21186 "dashed $0": 1,
21187 "dotted $0": 1,
21188 "#$0": 1
21189 },
21190 "border-color": {
21191 "#$0": 1
21192 },
21193 "border-style": {
21194 solid: 2,
21195 dashed: 2,
21196 dotted: 2,
21197 "double": 2,
21198 groove: 2,
21199 hidden: 2,
21200 inherit: 2,
21201 inset: 2,
21202 none: 2,
21203 outset: 2,
21204 ridged: 2
21205 },
21206 "border-collapse": {
21207 collapse: 1,
21208 separate: 1
21209 },
21210 bottom: {
21211 px: 1,
21212 em: 1,
21213 "%": 1
21214 },
21215 clear: {
21216 left: 1,
21217 right: 1,
21218 both: 1,
21219 none: 1
21220 },
21221 color: {
21222 "#$0": 1,
21223 "rgb(#$00,0,0)": 1
21224 },
21225 cursor: {
21226 "default": 1,
21227 pointer: 1,
21228 move: 1,
21229 text: 1,
21230 wait: 1,
21231 help: 1,
21232 progress: 1,
21233 "n-resize": 1,
21234 "ne-resize": 1,
21235 "e-resize": 1,
21236 "se-resize": 1,
21237 "s-resize": 1,
21238 "sw-resize": 1,
21239 "w-resize": 1,
21240 "nw-resize": 1
21241 },
21242 display: {
21243 none: 1,
21244 block: 1,
21245 inline: 1,
21246 "inline-block": 1,
21247 "table-cell": 1
21248 },
21249 "empty-cells": {
21250 show: 1,
21251 hide: 1
21252 },
21253 "float": {
21254 left: 1,
21255 right: 1,
21256 none: 1
21257 },
21258 "font-family": {
21259 Arial: 2,
21260 "Comic Sans MS": 2,
21261 Consolas: 2,
21262 "Courier New": 2,
21263 Courier: 2,
21264 Georgia: 2,
21265 Monospace: 2,
21266 "Sans-Serif": 2,
21267 "Segoe UI": 2,
21268 Tahoma: 2,
21269 "Times New Roman": 2,
21270 "Trebuchet MS": 2,
21271 Verdana: 1
21272 },
21273 "font-size": {
21274 px: 1,
21275 em: 1,
21276 "%": 1
21277 },
21278 "font-weight": {
21279 bold: 1,
21280 normal: 1
21281 },
21282 "font-style": {
21283 italic: 1,
21284 normal: 1
21285 },
21286 "font-variant": {
21287 normal: 1,
21288 "small-caps": 1
21289 },
21290 height: {
21291 px: 1,
21292 em: 1,
21293 "%": 1
21294 },
21295 left: {
21296 px: 1,
21297 em: 1,
21298 "%": 1
21299 },
21300 "letter-spacing": {
21301 normal: 1
21302 },
21303 "line-height": {
21304 normal: 1
21305 },
21306 "list-style-type": {
21307 none: 1,
21308 disc: 1,
21309 circle: 1,
21310 square: 1,
21311 decimal: 1,
21312 "decimal-leading-zero": 1,
21313 "lower-roman": 1,
21314 "upper-roman": 1,
21315 "lower-greek": 1,
21316 "lower-latin": 1,
21317 "upper-latin": 1,
21318 georgian: 1,
21319 "lower-alpha": 1,
21320 "upper-alpha": 1
21321 },
21322 margin: {
21323 px: 1,
21324 em: 1,
21325 "%": 1
21326 },
21327 "margin-right": {
21328 px: 1,
21329 em: 1,
21330 "%": 1
21331 },
21332 "margin-left": {
21333 px: 1,
21334 em: 1,
21335 "%": 1
21336 },
21337 "margin-top": {
21338 px: 1,
21339 em: 1,
21340 "%": 1
21341 },
21342 "margin-bottom": {
21343 px: 1,
21344 em: 1,
21345 "%": 1
21346 },
21347 "max-height": {
21348 px: 1,
21349 em: 1,
21350 "%": 1
21351 },
21352 "max-width": {
21353 px: 1,
21354 em: 1,
21355 "%": 1
21356 },
21357 "min-height": {
21358 px: 1,
21359 em: 1,
21360 "%": 1
21361 },
21362 "min-width": {
21363 px: 1,
21364 em: 1,
21365 "%": 1
21366 },
21367 overflow: {
21368 hidden: 1,
21369 visible: 1,
21370 auto: 1,
21371 scroll: 1
21372 },
21373 "overflow-x": {
21374 hidden: 1,
21375 visible: 1,
21376 auto: 1,
21377 scroll: 1
21378 },
21379 "overflow-y": {
21380 hidden: 1,
21381 visible: 1,
21382 auto: 1,
21383 scroll: 1
21384 },
21385 padding: {
21386 px: 1,
21387 em: 1,
21388 "%": 1
21389 },
21390 "padding-top": {
21391 px: 1,
21392 em: 1,
21393 "%": 1
21394 },
21395 "padding-right": {
21396 px: 1,
21397 em: 1,
21398 "%": 1
21399 },
21400 "padding-bottom": {
21401 px: 1,
21402 em: 1,
21403 "%": 1
21404 },
21405 "padding-left": {
21406 px: 1,
21407 em: 1,
21408 "%": 1
21409 },
21410 "page-break-after": {
21411 auto: 1,
21412 always: 1,
21413 avoid: 1,
21414 left: 1,
21415 right: 1
21416 },
21417 "page-break-before": {
21418 auto: 1,
21419 always: 1,
21420 avoid: 1,
21421 left: 1,
21422 right: 1
21423 },
21424 position: {
21425 absolute: 1,
21426 relative: 1,
21427 fixed: 1,
21428 "static": 1
21429 },
21430 right: {
21431 px: 1,
21432 em: 1,
21433 "%": 1
21434 },
21435 "table-layout": {
21436 fixed: 1,
21437 auto: 1
21438 },
21439 "text-decoration": {
21440 none: 1,
21441 underline: 1,
21442 "line-through": 1,
21443 blink: 1
21444 },
21445 "text-align": {
21446 left: 1,
21447 right: 1,
21448 center: 1,
21449 justify: 1
21450 },
21451 "text-transform": {
21452 capitalize: 1,
21453 uppercase: 1,
21454 lowercase: 1,
21455 none: 1
21456 },
21457 top: {
21458 px: 1,
21459 em: 1,
21460 "%": 1
21461 },
21462 "vertical-align": {
21463 top: 1,
21464 bottom: 1
21465 },
21466 visibility: {
21467 hidden: 1,
21468 visible: 1
21469 },
21470 "white-space": {
21471 nowrap: 1,
21472 normal: 1,
21473 pre: 1,
21474 "pre-line": 1,
21475 "pre-wrap": 1
21476 },
21477 width: {
21478 px: 1,
21479 em: 1,
21480 "%": 1
21481 },
21482 "word-spacing": {
21483 normal: 1
21484 },
21485 filter: {
21486 "alpha(opacity=$0100)": 1
21487 },
21488 "text-shadow": {
21489 "$02px 2px 2px #777": 1
21490 },
21491 "text-overflow": {
21492 "ellipsis-word": 1,
21493 clip: 1,
21494 ellipsis: 1
21495 },
21496 "-moz-border-radius": 1,
21497 "-moz-border-radius-topright": 1,
21498 "-moz-border-radius-bottomright": 1,
21499 "-moz-border-radius-topleft": 1,
21500 "-moz-border-radius-bottomleft": 1,
21501 "-webkit-border-radius": 1,
21502 "-webkit-border-top-right-radius": 1,
21503 "-webkit-border-top-left-radius": 1,
21504 "-webkit-border-bottom-right-radius": 1,
21505 "-webkit-border-bottom-left-radius": 1,
21506 "-moz-box-shadow": 1,
21507 "-webkit-box-shadow": 1,
21508 transform: {
21509 "rotate($00deg)": 1,
21510 "skew($00deg)": 1
21511 },
21512 "-moz-transform": {
21513 "rotate($00deg)": 1,
21514 "skew($00deg)": 1
21515 },
21516 "-webkit-transform": {
21517 "rotate($00deg)": 1,
21518 "skew($00deg)": 1
21519 }
21520 },
21521 i = function i() {};
21522
21523 (function () {
21524 this.completionsDefined = !1, this.defineCompletions = function () {
21525 if (document) {
21526 var e = document.createElement("c").style;
21527
21528 for (var t in e) {
21529 if (typeof e[t] != "string") continue;
21530 var n = t.replace(/[A-Z]/g, function (e) {
21531 return "-" + e.toLowerCase();
21532 });
21533 r.hasOwnProperty(n) || (r[n] = 1);
21534 }
21535 }
21536
21537 this.completionsDefined = !0;
21538 }, this.getCompletions = function (e, t, n, r) {
21539 this.completionsDefined || this.defineCompletions();
21540 var i = t.getTokenAt(n.row, n.column);
21541 if (!i) return [];
21542
21543 if (e === "ruleset") {
21544 var s = t.getLine(n.row).substr(0, n.column);
21545 return /:[^;]+$/.test(s) ? (/([\w\-]+):[^:]*$/.test(s), this.getPropertyValueCompletions(e, t, n, r)) : this.getPropertyCompletions(e, t, n, r);
21546 }
21547
21548 return [];
21549 }, this.getPropertyCompletions = function (e, t, n, i) {
21550 var s = Object.keys(r);
21551 return s.map(function (e) {
21552 return {
21553 caption: e,
21554 snippet: e + ": $0",
21555 meta: "property",
21556 score: Number.MAX_VALUE
21557 };
21558 });
21559 }, this.getPropertyValueCompletions = function (e, t, n, i) {
21560 var s = t.getLine(n.row).substr(0, n.column),
21561 o = (/([\w\-]+):[^:]*$/.exec(s) || {})[1];
21562 if (!o) return [];
21563 var u = [];
21564 return o in r && _typeof(r[o]) == "object" && (u = Object.keys(r[o])), u.map(function (e) {
21565 return {
21566 caption: e,
21567 snippet: e,
21568 meta: "property value",
21569 score: Number.MAX_VALUE
21570 };
21571 });
21572 };
21573 }).call(i.prototype), t.CssCompletions = i;
21574 }), ace.define("ace/mode/behaviour/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/mode/behaviour/cstyle", "ace/token_iterator"], function (e, t, n) {
21575 "use strict";
21576
21577 var r = e("../../lib/oop"),
21578 i = e("../behaviour").Behaviour,
21579 s = e("./cstyle").CstyleBehaviour,
21580 o = e("../../token_iterator").TokenIterator,
21581 u = function u() {
21582 this.inherit(s), this.add("colon", "insertion", function (e, t, n, r, i) {
21583 if (i === ":") {
21584 var s = n.getCursorPosition(),
21585 u = new o(r, s.row, s.column),
21586 a = u.getCurrentToken();
21587 a && a.value.match(/\s+/) && (a = u.stepBackward());
21588
21589 if (a && a.type === "support.type") {
21590 var f = r.doc.getLine(s.row),
21591 l = f.substring(s.column, s.column + 1);
21592 if (l === ":") return {
21593 text: "",
21594 selection: [1, 1]
21595 };
21596 if (!f.substring(s.column).match(/^\s*;/)) return {
21597 text: ":;",
21598 selection: [1, 1]
21599 };
21600 }
21601 }
21602 }), this.add("colon", "deletion", function (e, t, n, r, i) {
21603 var s = r.doc.getTextRange(i);
21604
21605 if (!i.isMultiLine() && s === ":") {
21606 var u = n.getCursorPosition(),
21607 a = new o(r, u.row, u.column),
21608 f = a.getCurrentToken();
21609 f && f.value.match(/\s+/) && (f = a.stepBackward());
21610
21611 if (f && f.type === "support.type") {
21612 var l = r.doc.getLine(i.start.row),
21613 c = l.substring(i.end.column, i.end.column + 1);
21614 if (c === ";") return i.end.column++, i;
21615 }
21616 }
21617 }), this.add("semicolon", "insertion", function (e, t, n, r, i) {
21618 if (i === ";") {
21619 var s = n.getCursorPosition(),
21620 o = r.doc.getLine(s.row),
21621 u = o.substring(s.column, s.column + 1);
21622 if (u === ";") return {
21623 text: "",
21624 selection: [1, 1]
21625 };
21626 }
21627 });
21628 };
21629
21630 r.inherits(u, s), t.CssBehaviour = u;
21631 }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
21632 "use strict";
21633
21634 var r = e("../../lib/oop"),
21635 i = e("../../range").Range,
21636 s = e("./fold_mode").FoldMode,
21637 o = t.FoldMode = function (e) {
21638 e && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e.end)));
21639 };
21640
21641 r.inherits(o, s), function () {
21642 this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function (e, t, n) {
21643 var r = e.getLine(n);
21644 if (this.singleLineBlockCommentRe.test(r) && !this.startRegionRe.test(r) && !this.tripleStarBlockCommentRe.test(r)) return "";
21645
21646 var i = this._getFoldWidgetBase(e, t, n);
21647
21648 return !i && this.startRegionRe.test(r) ? "start" : i;
21649 }, this.getFoldWidgetRange = function (e, t, n, r) {
21650 var i = e.getLine(n);
21651 if (this.startRegionRe.test(i)) return this.getCommentRegionBlock(e, i, n);
21652 var s = i.match(this.foldingStartMarker);
21653
21654 if (s) {
21655 var o = s.index;
21656 if (s[1]) return this.openingBracketBlock(e, s[1], n, o);
21657 var u = e.getCommentFoldRange(n, o + s[0].length, 1);
21658 return u && !u.isMultiLine() && (r ? u = this.getSectionRange(e, n) : t != "all" && (u = null)), u;
21659 }
21660
21661 if (t === "markbegin") return;
21662 var s = i.match(this.foldingStopMarker);
21663
21664 if (s) {
21665 var o = s.index + s[0].length;
21666 return s[1] ? this.closingBracketBlock(e, s[1], n, o) : e.getCommentFoldRange(n, o, -1);
21667 }
21668 }, this.getSectionRange = function (e, t) {
21669 var n = e.getLine(t),
21670 r = n.search(/\S/),
21671 s = t,
21672 o = n.length;
21673 t += 1;
21674 var u = t,
21675 a = e.getLength();
21676
21677 while (++t < a) {
21678 n = e.getLine(t);
21679 var f = n.search(/\S/);
21680 if (f === -1) continue;
21681 if (r > f) break;
21682 var l = this.getFoldWidgetRange(e, "all", t);
21683
21684 if (l) {
21685 if (l.start.row <= s) break;
21686 if (l.isMultiLine()) t = l.end.row;else if (r == f) break;
21687 }
21688
21689 u = t;
21690 }
21691
21692 return new i(s, o, u, e.getLine(u).length);
21693 }, this.getCommentRegionBlock = function (e, t, n) {
21694 var r = t.search(/\s*$/),
21695 s = e.getLength(),
21696 o = n,
21697 u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,
21698 a = 1;
21699
21700 while (++n < s) {
21701 t = e.getLine(n);
21702 var f = u.exec(t);
21703 if (!f) continue;
21704 f[1] ? a-- : a++;
21705 if (!a) break;
21706 }
21707
21708 var l = n;
21709 if (l > o) return new i(o, r, l, t.length);
21710 };
21711 }.call(o.prototype);
21712 }), ace.define("ace/mode/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/css_completions", "ace/mode/behaviour/css", "ace/mode/folding/cstyle"], function (e, t, n) {
21713 "use strict";
21714
21715 var r = e("../lib/oop"),
21716 i = e("./text").Mode,
21717 s = e("./css_highlight_rules").CssHighlightRules,
21718 o = e("./matching_brace_outdent").MatchingBraceOutdent,
21719 u = e("../worker/worker_client").WorkerClient,
21720 a = e("./css_completions").CssCompletions,
21721 f = e("./behaviour/css").CssBehaviour,
21722 l = e("./folding/cstyle").FoldMode,
21723 c = function c() {
21724 this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new f(), this.$completer = new a(), this.foldingRules = new l();
21725 };
21726
21727 r.inherits(c, i), function () {
21728 this.foldingRules = "cStyle", this.blockComment = {
21729 start: "/*",
21730 end: "*/"
21731 }, this.getNextLineIndent = function (e, t, n) {
21732 var r = this.$getIndent(t),
21733 i = this.getTokenizer().getLineTokens(t, e).tokens;
21734 if (i.length && i[i.length - 1].type == "comment") return r;
21735 var s = t.match(/^.*\{\s*$/);
21736 return s && (r += n), r;
21737 }, this.checkOutdent = function (e, t, n) {
21738 return this.$outdent.checkOutdent(t, n);
21739 }, this.autoOutdent = function (e, t, n) {
21740 this.$outdent.autoOutdent(t, n);
21741 }, this.getCompletions = function (e, t, n, r) {
21742 return this.$completer.getCompletions(e, t, n, r);
21743 }, this.createWorker = function (e) {
21744 var t = new u(["ace"], "ace/mode/css_worker", "Worker");
21745 return t.attachToDocument(e.getDocument()), t.on("annotate", function (t) {
21746 e.setAnnotations(t.data);
21747 }), t.on("terminate", function () {
21748 e.clearAnnotations();
21749 }), t;
21750 }, this.$id = "ace/mode/css";
21751 }.call(c.prototype), t.Mode = c;
21752 });
21753 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
21754
21755 ace.define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
21756 "use strict";
21757
21758 var r = e("../lib/oop"),
21759 i = e("./text_highlight_rules").TextHighlightRules,
21760 s = function s() {
21761 this.$rules = {
21762 start: [{
21763 token: "comment.doc.tag",
21764 regex: "@[\\w\\d_]+"
21765 }, s.getTagRule(), {
21766 defaultToken: "comment.doc",
21767 caseInsensitive: !0
21768 }]
21769 };
21770 };
21771
21772 r.inherits(s, i), s.getTagRule = function (e) {
21773 return {
21774 token: "comment.doc.tag.storage.type",
21775 regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
21776 };
21777 }, s.getStartRule = function (e) {
21778 return {
21779 token: "comment.doc",
21780 regex: "\\/\\*(?=\\*)",
21781 next: e
21782 };
21783 }, s.getEndRule = function (e) {
21784 return {
21785 token: "comment.doc",
21786 regex: "\\*\\/",
21787 next: e
21788 };
21789 }, t.DocCommentHighlightRules = s;
21790 }), ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
21791 "use strict";
21792
21793 function a() {
21794 var e = o.replace("\\d", "\\d\\-"),
21795 t = {
21796 onMatch: function onMatch(e, t, n) {
21797 var r = e.charAt(1) == "/" ? 2 : 1;
21798 if (r == 1) t != this.nextState ? n.unshift(this.next, this.nextState, 0) : n.unshift(this.next), n[2]++;else if (r == 2 && t == this.nextState) {
21799 n[1]--;
21800 if (!n[1] || n[1] < 0) n.shift(), n.shift();
21801 }
21802 return [{
21803 type: "meta.tag.punctuation." + (r == 1 ? "" : "end-") + "tag-open.xml",
21804 value: e.slice(0, r)
21805 }, {
21806 type: "meta.tag.tag-name.xml",
21807 value: e.substr(r)
21808 }];
21809 },
21810 regex: "</?" + e + "",
21811 next: "jsxAttributes",
21812 nextState: "jsx"
21813 };
21814 this.$rules.start.unshift(t);
21815 var n = {
21816 regex: "{",
21817 token: "paren.quasi.start",
21818 push: "start"
21819 };
21820 this.$rules.jsx = [n, t, {
21821 include: "reference"
21822 }, {
21823 defaultToken: "string"
21824 }], this.$rules.jsxAttributes = [{
21825 token: "meta.tag.punctuation.tag-close.xml",
21826 regex: "/?>",
21827 onMatch: function onMatch(e, t, n) {
21828 return t == n[0] && n.shift(), e.length == 2 && (n[0] == this.nextState && n[1]--, (!n[1] || n[1] < 0) && n.splice(0, 2)), this.next = n[0] || "start", [{
21829 type: this.token,
21830 value: e
21831 }];
21832 },
21833 nextState: "jsx"
21834 }, n, f("jsxAttributes"), {
21835 token: "entity.other.attribute-name.xml",
21836 regex: e
21837 }, {
21838 token: "keyword.operator.attribute-equals.xml",
21839 regex: "="
21840 }, {
21841 token: "text.tag-whitespace.xml",
21842 regex: "\\s+"
21843 }, {
21844 token: "string.attribute-value.xml",
21845 regex: "'",
21846 stateName: "jsx_attr_q",
21847 push: [{
21848 token: "string.attribute-value.xml",
21849 regex: "'",
21850 next: "pop"
21851 }, {
21852 include: "reference"
21853 }, {
21854 defaultToken: "string.attribute-value.xml"
21855 }]
21856 }, {
21857 token: "string.attribute-value.xml",
21858 regex: '"',
21859 stateName: "jsx_attr_qq",
21860 push: [{
21861 token: "string.attribute-value.xml",
21862 regex: '"',
21863 next: "pop"
21864 }, {
21865 include: "reference"
21866 }, {
21867 defaultToken: "string.attribute-value.xml"
21868 }]
21869 }, t], this.$rules.reference = [{
21870 token: "constant.language.escape.reference.xml",
21871 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
21872 }];
21873 }
21874
21875 function f(e) {
21876 return [{
21877 token: "comment",
21878 regex: /\/\*/,
21879 next: [i.getTagRule(), {
21880 token: "comment",
21881 regex: "\\*\\/",
21882 next: e || "pop"
21883 }, {
21884 defaultToken: "comment",
21885 caseInsensitive: !0
21886 }]
21887 }, {
21888 token: "comment",
21889 regex: "\\/\\/",
21890 next: [i.getTagRule(), {
21891 token: "comment",
21892 regex: "$|^",
21893 next: e || "pop"
21894 }, {
21895 defaultToken: "comment",
21896 caseInsensitive: !0
21897 }]
21898 }];
21899 }
21900
21901 var r = e("../lib/oop"),
21902 i = e("./doc_comment_highlight_rules").DocCommentHighlightRules,
21903 s = e("./text_highlight_rules").TextHighlightRules,
21904 o = "[a-zA-Z\\$_\xA1-\uFFFF][a-zA-Z\\d\\$_\xA1-\uFFFF]*",
21905 u = function u(e) {
21906 var t = this.createKeywordMapper({
21907 "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",
21908 keyword: "const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
21909 "storage.type": "const|let|var|function",
21910 "constant.language": "null|Infinity|NaN|undefined",
21911 "support.function": "alert",
21912 "constant.language.boolean": "true|false"
21913 }, "identifier"),
21914 n = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",
21915 r = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";
21916 this.$rules = {
21917 no_regex: [i.getStartRule("doc-start"), f("no_regex"), {
21918 token: "string",
21919 regex: "'(?=.)",
21920 next: "qstring"
21921 }, {
21922 token: "string",
21923 regex: '"(?=.)',
21924 next: "qqstring"
21925 }, {
21926 token: "constant.numeric",
21927 regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
21928 }, {
21929 token: "constant.numeric",
21930 regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
21931 }, {
21932 token: ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator"],
21933 regex: "(" + o + ")(\\.)(prototype)(\\.)(" + o + ")(\\s*)(=)",
21934 next: "function_arguments"
21935 }, {
21936 token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"],
21937 regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
21938 next: "function_arguments"
21939 }, {
21940 token: ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"],
21941 regex: "(" + o + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
21942 next: "function_arguments"
21943 }, {
21944 token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"],
21945 regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
21946 next: "function_arguments"
21947 }, {
21948 token: ["storage.type", "text", "entity.name.function", "text", "paren.lparen"],
21949 regex: "(function)(\\s+)(" + o + ")(\\s*)(\\()",
21950 next: "function_arguments"
21951 }, {
21952 token: ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen"],
21953 regex: "(" + o + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
21954 next: "function_arguments"
21955 }, {
21956 token: ["text", "text", "storage.type", "text", "paren.lparen"],
21957 regex: "(:)(\\s*)(function)(\\s*)(\\()",
21958 next: "function_arguments"
21959 }, {
21960 token: "keyword",
21961 regex: "from(?=\\s*('|\"))"
21962 }, {
21963 token: "keyword",
21964 regex: "(?:" + n + ")\\b",
21965 next: "start"
21966 }, {
21967 token: ["support.constant"],
21968 regex: /that\b/
21969 }, {
21970 token: ["storage.type", "punctuation.operator", "support.function.firebug"],
21971 regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
21972 }, {
21973 token: t,
21974 regex: o
21975 }, {
21976 token: "punctuation.operator",
21977 regex: /[.](?![.])/,
21978 next: "property"
21979 }, {
21980 token: "storage.type",
21981 regex: /=>/,
21982 next: "start"
21983 }, {
21984 token: "keyword.operator",
21985 regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
21986 next: "start"
21987 }, {
21988 token: "punctuation.operator",
21989 regex: /[?:,;.]/,
21990 next: "start"
21991 }, {
21992 token: "paren.lparen",
21993 regex: /[\[({]/,
21994 next: "start"
21995 }, {
21996 token: "paren.rparen",
21997 regex: /[\])}]/
21998 }, {
21999 token: "comment",
22000 regex: /^#!.*$/
22001 }],
22002 property: [{
22003 token: "text",
22004 regex: "\\s+"
22005 }, {
22006 token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"],
22007 regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
22008 next: "function_arguments"
22009 }, {
22010 token: "punctuation.operator",
22011 regex: /[.](?![.])/
22012 }, {
22013 token: "support.function",
22014 regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
22015 }, {
22016 token: "support.function.dom",
22017 regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
22018 }, {
22019 token: "support.constant",
22020 regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
22021 }, {
22022 token: "identifier",
22023 regex: o
22024 }, {
22025 regex: "",
22026 token: "empty",
22027 next: "no_regex"
22028 }],
22029 start: [i.getStartRule("doc-start"), f("start"), {
22030 token: "string.regexp",
22031 regex: "\\/",
22032 next: "regex"
22033 }, {
22034 token: "text",
22035 regex: "\\s+|^$",
22036 next: "start"
22037 }, {
22038 token: "empty",
22039 regex: "",
22040 next: "no_regex"
22041 }],
22042 regex: [{
22043 token: "regexp.keyword.operator",
22044 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
22045 }, {
22046 token: "string.regexp",
22047 regex: "/[sxngimy]*",
22048 next: "no_regex"
22049 }, {
22050 token: "invalid",
22051 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
22052 }, {
22053 token: "constant.language.escape",
22054 regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
22055 }, {
22056 token: "constant.language.delimiter",
22057 regex: /\|/
22058 }, {
22059 token: "constant.language.escape",
22060 regex: /\[\^?/,
22061 next: "regex_character_class"
22062 }, {
22063 token: "empty",
22064 regex: "$",
22065 next: "no_regex"
22066 }, {
22067 defaultToken: "string.regexp"
22068 }],
22069 regex_character_class: [{
22070 token: "regexp.charclass.keyword.operator",
22071 regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
22072 }, {
22073 token: "constant.language.escape",
22074 regex: "]",
22075 next: "regex"
22076 }, {
22077 token: "constant.language.escape",
22078 regex: "-"
22079 }, {
22080 token: "empty",
22081 regex: "$",
22082 next: "no_regex"
22083 }, {
22084 defaultToken: "string.regexp.charachterclass"
22085 }],
22086 function_arguments: [{
22087 token: "variable.parameter",
22088 regex: o
22089 }, {
22090 token: "punctuation.operator",
22091 regex: "[, ]+"
22092 }, {
22093 token: "punctuation.operator",
22094 regex: "$"
22095 }, {
22096 token: "empty",
22097 regex: "",
22098 next: "no_regex"
22099 }],
22100 qqstring: [{
22101 token: "constant.language.escape",
22102 regex: r
22103 }, {
22104 token: "string",
22105 regex: "\\\\$",
22106 consumeLineEnd: !0
22107 }, {
22108 token: "string",
22109 regex: '"|$',
22110 next: "no_regex"
22111 }, {
22112 defaultToken: "string"
22113 }],
22114 qstring: [{
22115 token: "constant.language.escape",
22116 regex: r
22117 }, {
22118 token: "string",
22119 regex: "\\\\$",
22120 consumeLineEnd: !0
22121 }, {
22122 token: "string",
22123 regex: "'|$",
22124 next: "no_regex"
22125 }, {
22126 defaultToken: "string"
22127 }]
22128 };
22129 if (!e || !e.noES6) this.$rules.no_regex.unshift({
22130 regex: "[{}]",
22131 onMatch: function onMatch(e, t, n) {
22132 this.next = e == "{" ? this.nextState : "";
22133 if (e == "{" && n.length) n.unshift("start", t);else if (e == "}" && n.length) {
22134 n.shift(), this.next = n.shift();
22135 if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) return "paren.quasi.end";
22136 }
22137 return e == "{" ? "paren.lparen" : "paren.rparen";
22138 },
22139 nextState: "start"
22140 }, {
22141 token: "string.quasi.start",
22142 regex: /`/,
22143 push: [{
22144 token: "constant.language.escape",
22145 regex: r
22146 }, {
22147 token: "paren.quasi.start",
22148 regex: /\${/,
22149 push: "start"
22150 }, {
22151 token: "string.quasi.end",
22152 regex: /`/,
22153 next: "pop"
22154 }, {
22155 defaultToken: "string.quasi"
22156 }]
22157 }), (!e || e.jsx != 0) && a.call(this);
22158 this.embedRules(i, "doc-", [i.getEndRule("no_regex")]), this.normalizeRules();
22159 };
22160
22161 r.inherits(u, s), t.JavaScriptHighlightRules = u;
22162 }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function (e, t, n) {
22163 "use strict";
22164
22165 var r = e("../range").Range,
22166 i = function i() {};
22167
22168 (function () {
22169 this.checkOutdent = function (e, t) {
22170 return /^\s+$/.test(e) ? /^\s*\}/.test(t) : !1;
22171 }, this.autoOutdent = function (e, t) {
22172 var n = e.getLine(t),
22173 i = n.match(/^(\s*\})/);
22174 if (!i) return 0;
22175 var s = i[1].length,
22176 o = e.findMatchingBracket({
22177 row: t,
22178 column: s
22179 });
22180 if (!o || o.row == t) return 0;
22181 var u = this.$getIndent(e.getLine(o.row));
22182 e.replace(new r(t, 0, t, s - 1), u);
22183 }, this.$getIndent = function (e) {
22184 return e.match(/^\s*/)[0];
22185 };
22186 }).call(i.prototype), t.MatchingBraceOutdent = i;
22187 }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function (e, t, n) {
22188 "use strict";
22189
22190 var r = e("../../lib/oop"),
22191 i = e("../../range").Range,
22192 s = e("./fold_mode").FoldMode,
22193 o = t.FoldMode = function (e) {
22194 e && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e.end)));
22195 };
22196
22197 r.inherits(o, s), function () {
22198 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function (e, t, n) {
22199 var r = e.getLine(n);
22200 if (this.singleLineBlockCommentRe.test(r) && !this.startRegionRe.test(r) && !this.tripleStarBlockCommentRe.test(r)) return "";
22201
22202 var i = this._getFoldWidgetBase(e, t, n);
22203
22204 return !i && this.startRegionRe.test(r) ? "start" : i;
22205 }, this.getFoldWidgetRange = function (e, t, n, r) {
22206 var i = e.getLine(n);
22207 if (this.startRegionRe.test(i)) return this.getCommentRegionBlock(e, i, n);
22208 var s = i.match(this.foldingStartMarker);
22209
22210 if (s) {
22211 var o = s.index;
22212 if (s[1]) return this.openingBracketBlock(e, s[1], n, o);
22213 var u = e.getCommentFoldRange(n, o + s[0].length, 1);
22214 return u && !u.isMultiLine() && (r ? u = this.getSectionRange(e, n) : t != "all" && (u = null)), u;
22215 }
22216
22217 if (t === "markbegin") return;
22218 var s = i.match(this.foldingStopMarker);
22219
22220 if (s) {
22221 var o = s.index + s[0].length;
22222 return s[1] ? this.closingBracketBlock(e, s[1], n, o) : e.getCommentFoldRange(n, o, -1);
22223 }
22224 }, this.getSectionRange = function (e, t) {
22225 var n = e.getLine(t),
22226 r = n.search(/\S/),
22227 s = t,
22228 o = n.length;
22229 t += 1;
22230 var u = t,
22231 a = e.getLength();
22232
22233 while (++t < a) {
22234 n = e.getLine(t);
22235 var f = n.search(/\S/);
22236 if (f === -1) continue;
22237 if (r > f) break;
22238 var l = this.getFoldWidgetRange(e, "all", t);
22239
22240 if (l) {
22241 if (l.start.row <= s) break;
22242 if (l.isMultiLine()) t = l.end.row;else if (r == f) break;
22243 }
22244
22245 u = t;
22246 }
22247
22248 return new i(s, o, u, e.getLine(u).length);
22249 }, this.getCommentRegionBlock = function (e, t, n) {
22250 var r = t.search(/\s*$/),
22251 s = e.getLength(),
22252 o = n,
22253 u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,
22254 a = 1;
22255
22256 while (++n < s) {
22257 t = e.getLine(n);
22258 var f = u.exec(t);
22259 if (!f) continue;
22260 f[1] ? a-- : a++;
22261 if (!a) break;
22262 }
22263
22264 var l = n;
22265 if (l > o) return new i(o, r, l, t.length);
22266 };
22267 }.call(o.prototype);
22268 }), ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
22269 "use strict";
22270
22271 var r = e("../lib/oop"),
22272 i = e("./text").Mode,
22273 s = e("./javascript_highlight_rules").JavaScriptHighlightRules,
22274 o = e("./matching_brace_outdent").MatchingBraceOutdent,
22275 u = e("../worker/worker_client").WorkerClient,
22276 a = e("./behaviour/cstyle").CstyleBehaviour,
22277 f = e("./folding/cstyle").FoldMode,
22278 l = function l() {
22279 this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new a(), this.foldingRules = new f();
22280 };
22281
22282 r.inherits(l, i), function () {
22283 this.lineCommentStart = "//", this.blockComment = {
22284 start: "/*",
22285 end: "*/"
22286 }, this.$quotes = {
22287 '"': '"',
22288 "'": "'",
22289 "`": "`"
22290 }, this.getNextLineIndent = function (e, t, n) {
22291 var r = this.$getIndent(t),
22292 i = this.getTokenizer().getLineTokens(t, e),
22293 s = i.tokens,
22294 o = i.state;
22295 if (s.length && s[s.length - 1].type == "comment") return r;
22296
22297 if (e == "start" || e == "no_regex") {
22298 var u = t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
22299 u && (r += n);
22300 } else if (e == "doc-start") {
22301 if (o == "start" || o == "no_regex") return "";
22302 var u = t.match(/^\s*(\/?)\*/);
22303 u && (u[1] && (r += " "), r += "* ");
22304 }
22305
22306 return r;
22307 }, this.checkOutdent = function (e, t, n) {
22308 return this.$outdent.checkOutdent(t, n);
22309 }, this.autoOutdent = function (e, t, n) {
22310 this.$outdent.autoOutdent(t, n);
22311 }, this.createWorker = function (e) {
22312 var t = new u(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
22313 return t.attachToDocument(e.getDocument()), t.on("annotate", function (t) {
22314 e.setAnnotations(t.data);
22315 }), t.on("terminate", function () {
22316 e.clearAnnotations();
22317 }), t;
22318 }, this.$id = "ace/mode/javascript";
22319 }.call(l.prototype), t.Mode = l;
22320 }), ace.define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function (e, t, n) {
22321 "use strict";
22322
22323 var r = e("../lib/oop"),
22324 i = e("../lib/lang"),
22325 s = e("./text_highlight_rules").TextHighlightRules,
22326 o = t.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|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-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",
22327 u = t.supportFunction = "rgb|rgba|url|attr|counter|counters",
22328 a = t.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",
22329 f = t.supportConstantColor = "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|green|greenyellow|grey|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",
22330 l = t.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",
22331 c = t.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",
22332 h = t.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",
22333 p = t.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",
22334 d = function d() {
22335 var e = this.createKeywordMapper({
22336 "support.function": u,
22337 "support.constant": a,
22338 "support.type": o,
22339 "support.constant.color": f,
22340 "support.constant.fonts": l
22341 }, "text", !0);
22342 this.$rules = {
22343 start: [{
22344 include: ["strings", "url", "comments"]
22345 }, {
22346 token: "paren.lparen",
22347 regex: "\\{",
22348 next: "ruleset"
22349 }, {
22350 token: "paren.rparen",
22351 regex: "\\}"
22352 }, {
22353 token: "string",
22354 regex: "@(?!viewport)",
22355 next: "media"
22356 }, {
22357 token: "keyword",
22358 regex: "#[a-z0-9-_]+"
22359 }, {
22360 token: "keyword",
22361 regex: "%"
22362 }, {
22363 token: "variable",
22364 regex: "\\.[a-z0-9-_]+"
22365 }, {
22366 token: "string",
22367 regex: ":[a-z0-9-_]+"
22368 }, {
22369 token: "constant.numeric",
22370 regex: c
22371 }, {
22372 token: "constant",
22373 regex: "[a-z0-9-_]+"
22374 }, {
22375 caseInsensitive: !0
22376 }],
22377 media: [{
22378 include: ["strings", "url", "comments"]
22379 }, {
22380 token: "paren.lparen",
22381 regex: "\\{",
22382 next: "start"
22383 }, {
22384 token: "paren.rparen",
22385 regex: "\\}",
22386 next: "start"
22387 }, {
22388 token: "string",
22389 regex: ";",
22390 next: "start"
22391 }, {
22392 token: "keyword",
22393 regex: "(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"
22394 }],
22395 comments: [{
22396 token: "comment",
22397 regex: "\\/\\*",
22398 push: [{
22399 token: "comment",
22400 regex: "\\*\\/",
22401 next: "pop"
22402 }, {
22403 defaultToken: "comment"
22404 }]
22405 }],
22406 ruleset: [{
22407 regex: "-(webkit|ms|moz|o)-",
22408 token: "text"
22409 }, {
22410 token: "punctuation.operator",
22411 regex: "[:;]"
22412 }, {
22413 token: "paren.rparen",
22414 regex: "\\}",
22415 next: "start"
22416 }, {
22417 include: ["strings", "url", "comments"]
22418 }, {
22419 token: ["constant.numeric", "keyword"],
22420 regex: "(" + c + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
22421 }, {
22422 token: "constant.numeric",
22423 regex: c
22424 }, {
22425 token: "constant.numeric",
22426 regex: "#[a-f0-9]{6}"
22427 }, {
22428 token: "constant.numeric",
22429 regex: "#[a-f0-9]{3}"
22430 }, {
22431 token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
22432 regex: h
22433 }, {
22434 token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
22435 regex: p
22436 }, {
22437 include: "url"
22438 }, {
22439 token: e,
22440 regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
22441 }, {
22442 caseInsensitive: !0
22443 }],
22444 url: [{
22445 token: "support.function",
22446 regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
22447 push: [{
22448 token: "support.function",
22449 regex: "\\)",
22450 next: "pop"
22451 }, {
22452 defaultToken: "string"
22453 }]
22454 }],
22455 strings: [{
22456 token: "string.start",
22457 regex: "'",
22458 push: [{
22459 token: "string.end",
22460 regex: "'|$",
22461 next: "pop"
22462 }, {
22463 include: "escapes"
22464 }, {
22465 token: "constant.language.escape",
22466 regex: /\\$/,
22467 consumeLineEnd: !0
22468 }, {
22469 defaultToken: "string"
22470 }]
22471 }, {
22472 token: "string.start",
22473 regex: '"',
22474 push: [{
22475 token: "string.end",
22476 regex: '"|$',
22477 next: "pop"
22478 }, {
22479 include: "escapes"
22480 }, {
22481 token: "constant.language.escape",
22482 regex: /\\$/,
22483 consumeLineEnd: !0
22484 }, {
22485 defaultToken: "string"
22486 }]
22487 }],
22488 escapes: [{
22489 token: "constant.language.escape",
22490 regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
22491 }]
22492 }, this.normalizeRules();
22493 };
22494
22495 r.inherits(d, s), t.CssHighlightRules = d;
22496 }), ace.define("ace/mode/css_completions", ["require", "exports", "module"], function (e, t, n) {
22497 "use strict";
22498
22499 var r = {
22500 background: {
22501 "#$0": 1
22502 },
22503 "background-color": {
22504 "#$0": 1,
22505 transparent: 1,
22506 fixed: 1
22507 },
22508 "background-image": {
22509 "url('/$0')": 1
22510 },
22511 "background-repeat": {
22512 repeat: 1,
22513 "repeat-x": 1,
22514 "repeat-y": 1,
22515 "no-repeat": 1,
22516 inherit: 1
22517 },
22518 "background-position": {
22519 bottom: 2,
22520 center: 2,
22521 left: 2,
22522 right: 2,
22523 top: 2,
22524 inherit: 2
22525 },
22526 "background-attachment": {
22527 scroll: 1,
22528 fixed: 1
22529 },
22530 "background-size": {
22531 cover: 1,
22532 contain: 1
22533 },
22534 "background-clip": {
22535 "border-box": 1,
22536 "padding-box": 1,
22537 "content-box": 1
22538 },
22539 "background-origin": {
22540 "border-box": 1,
22541 "padding-box": 1,
22542 "content-box": 1
22543 },
22544 border: {
22545 "solid $0": 1,
22546 "dashed $0": 1,
22547 "dotted $0": 1,
22548 "#$0": 1
22549 },
22550 "border-color": {
22551 "#$0": 1
22552 },
22553 "border-style": {
22554 solid: 2,
22555 dashed: 2,
22556 dotted: 2,
22557 "double": 2,
22558 groove: 2,
22559 hidden: 2,
22560 inherit: 2,
22561 inset: 2,
22562 none: 2,
22563 outset: 2,
22564 ridged: 2
22565 },
22566 "border-collapse": {
22567 collapse: 1,
22568 separate: 1
22569 },
22570 bottom: {
22571 px: 1,
22572 em: 1,
22573 "%": 1
22574 },
22575 clear: {
22576 left: 1,
22577 right: 1,
22578 both: 1,
22579 none: 1
22580 },
22581 color: {
22582 "#$0": 1,
22583 "rgb(#$00,0,0)": 1
22584 },
22585 cursor: {
22586 "default": 1,
22587 pointer: 1,
22588 move: 1,
22589 text: 1,
22590 wait: 1,
22591 help: 1,
22592 progress: 1,
22593 "n-resize": 1,
22594 "ne-resize": 1,
22595 "e-resize": 1,
22596 "se-resize": 1,
22597 "s-resize": 1,
22598 "sw-resize": 1,
22599 "w-resize": 1,
22600 "nw-resize": 1
22601 },
22602 display: {
22603 none: 1,
22604 block: 1,
22605 inline: 1,
22606 "inline-block": 1,
22607 "table-cell": 1
22608 },
22609 "empty-cells": {
22610 show: 1,
22611 hide: 1
22612 },
22613 "float": {
22614 left: 1,
22615 right: 1,
22616 none: 1
22617 },
22618 "font-family": {
22619 Arial: 2,
22620 "Comic Sans MS": 2,
22621 Consolas: 2,
22622 "Courier New": 2,
22623 Courier: 2,
22624 Georgia: 2,
22625 Monospace: 2,
22626 "Sans-Serif": 2,
22627 "Segoe UI": 2,
22628 Tahoma: 2,
22629 "Times New Roman": 2,
22630 "Trebuchet MS": 2,
22631 Verdana: 1
22632 },
22633 "font-size": {
22634 px: 1,
22635 em: 1,
22636 "%": 1
22637 },
22638 "font-weight": {
22639 bold: 1,
22640 normal: 1
22641 },
22642 "font-style": {
22643 italic: 1,
22644 normal: 1
22645 },
22646 "font-variant": {
22647 normal: 1,
22648 "small-caps": 1
22649 },
22650 height: {
22651 px: 1,
22652 em: 1,
22653 "%": 1
22654 },
22655 left: {
22656 px: 1,
22657 em: 1,
22658 "%": 1
22659 },
22660 "letter-spacing": {
22661 normal: 1
22662 },
22663 "line-height": {
22664 normal: 1
22665 },
22666 "list-style-type": {
22667 none: 1,
22668 disc: 1,
22669 circle: 1,
22670 square: 1,
22671 decimal: 1,
22672 "decimal-leading-zero": 1,
22673 "lower-roman": 1,
22674 "upper-roman": 1,
22675 "lower-greek": 1,
22676 "lower-latin": 1,
22677 "upper-latin": 1,
22678 georgian: 1,
22679 "lower-alpha": 1,
22680 "upper-alpha": 1
22681 },
22682 margin: {
22683 px: 1,
22684 em: 1,
22685 "%": 1
22686 },
22687 "margin-right": {
22688 px: 1,
22689 em: 1,
22690 "%": 1
22691 },
22692 "margin-left": {
22693 px: 1,
22694 em: 1,
22695 "%": 1
22696 },
22697 "margin-top": {
22698 px: 1,
22699 em: 1,
22700 "%": 1
22701 },
22702 "margin-bottom": {
22703 px: 1,
22704 em: 1,
22705 "%": 1
22706 },
22707 "max-height": {
22708 px: 1,
22709 em: 1,
22710 "%": 1
22711 },
22712 "max-width": {
22713 px: 1,
22714 em: 1,
22715 "%": 1
22716 },
22717 "min-height": {
22718 px: 1,
22719 em: 1,
22720 "%": 1
22721 },
22722 "min-width": {
22723 px: 1,
22724 em: 1,
22725 "%": 1
22726 },
22727 overflow: {
22728 hidden: 1,
22729 visible: 1,
22730 auto: 1,
22731 scroll: 1
22732 },
22733 "overflow-x": {
22734 hidden: 1,
22735 visible: 1,
22736 auto: 1,
22737 scroll: 1
22738 },
22739 "overflow-y": {
22740 hidden: 1,
22741 visible: 1,
22742 auto: 1,
22743 scroll: 1
22744 },
22745 padding: {
22746 px: 1,
22747 em: 1,
22748 "%": 1
22749 },
22750 "padding-top": {
22751 px: 1,
22752 em: 1,
22753 "%": 1
22754 },
22755 "padding-right": {
22756 px: 1,
22757 em: 1,
22758 "%": 1
22759 },
22760 "padding-bottom": {
22761 px: 1,
22762 em: 1,
22763 "%": 1
22764 },
22765 "padding-left": {
22766 px: 1,
22767 em: 1,
22768 "%": 1
22769 },
22770 "page-break-after": {
22771 auto: 1,
22772 always: 1,
22773 avoid: 1,
22774 left: 1,
22775 right: 1
22776 },
22777 "page-break-before": {
22778 auto: 1,
22779 always: 1,
22780 avoid: 1,
22781 left: 1,
22782 right: 1
22783 },
22784 position: {
22785 absolute: 1,
22786 relative: 1,
22787 fixed: 1,
22788 "static": 1
22789 },
22790 right: {
22791 px: 1,
22792 em: 1,
22793 "%": 1
22794 },
22795 "table-layout": {
22796 fixed: 1,
22797 auto: 1
22798 },
22799 "text-decoration": {
22800 none: 1,
22801 underline: 1,
22802 "line-through": 1,
22803 blink: 1
22804 },
22805 "text-align": {
22806 left: 1,
22807 right: 1,
22808 center: 1,
22809 justify: 1
22810 },
22811 "text-transform": {
22812 capitalize: 1,
22813 uppercase: 1,
22814 lowercase: 1,
22815 none: 1
22816 },
22817 top: {
22818 px: 1,
22819 em: 1,
22820 "%": 1
22821 },
22822 "vertical-align": {
22823 top: 1,
22824 bottom: 1
22825 },
22826 visibility: {
22827 hidden: 1,
22828 visible: 1
22829 },
22830 "white-space": {
22831 nowrap: 1,
22832 normal: 1,
22833 pre: 1,
22834 "pre-line": 1,
22835 "pre-wrap": 1
22836 },
22837 width: {
22838 px: 1,
22839 em: 1,
22840 "%": 1
22841 },
22842 "word-spacing": {
22843 normal: 1
22844 },
22845 filter: {
22846 "alpha(opacity=$0100)": 1
22847 },
22848 "text-shadow": {
22849 "$02px 2px 2px #777": 1
22850 },
22851 "text-overflow": {
22852 "ellipsis-word": 1,
22853 clip: 1,
22854 ellipsis: 1
22855 },
22856 "-moz-border-radius": 1,
22857 "-moz-border-radius-topright": 1,
22858 "-moz-border-radius-bottomright": 1,
22859 "-moz-border-radius-topleft": 1,
22860 "-moz-border-radius-bottomleft": 1,
22861 "-webkit-border-radius": 1,
22862 "-webkit-border-top-right-radius": 1,
22863 "-webkit-border-top-left-radius": 1,
22864 "-webkit-border-bottom-right-radius": 1,
22865 "-webkit-border-bottom-left-radius": 1,
22866 "-moz-box-shadow": 1,
22867 "-webkit-box-shadow": 1,
22868 transform: {
22869 "rotate($00deg)": 1,
22870 "skew($00deg)": 1
22871 },
22872 "-moz-transform": {
22873 "rotate($00deg)": 1,
22874 "skew($00deg)": 1
22875 },
22876 "-webkit-transform": {
22877 "rotate($00deg)": 1,
22878 "skew($00deg)": 1
22879 }
22880 },
22881 i = function i() {};
22882
22883 (function () {
22884 this.completionsDefined = !1, this.defineCompletions = function () {
22885 if (document) {
22886 var e = document.createElement("c").style;
22887
22888 for (var t in e) {
22889 if (typeof e[t] != "string") continue;
22890 var n = t.replace(/[A-Z]/g, function (e) {
22891 return "-" + e.toLowerCase();
22892 });
22893 r.hasOwnProperty(n) || (r[n] = 1);
22894 }
22895 }
22896
22897 this.completionsDefined = !0;
22898 }, this.getCompletions = function (e, t, n, r) {
22899 this.completionsDefined || this.defineCompletions();
22900 var i = t.getTokenAt(n.row, n.column);
22901 if (!i) return [];
22902
22903 if (e === "ruleset") {
22904 var s = t.getLine(n.row).substr(0, n.column);
22905 return /:[^;]+$/.test(s) ? (/([\w\-]+):[^:]*$/.test(s), this.getPropertyValueCompletions(e, t, n, r)) : this.getPropertyCompletions(e, t, n, r);
22906 }
22907
22908 return [];
22909 }, this.getPropertyCompletions = function (e, t, n, i) {
22910 var s = Object.keys(r);
22911 return s.map(function (e) {
22912 return {
22913 caption: e,
22914 snippet: e + ": $0;",
22915 meta: "property",
22916 score: 1e6
22917 };
22918 });
22919 }, this.getPropertyValueCompletions = function (e, t, n, i) {
22920 var s = t.getLine(n.row).substr(0, n.column),
22921 o = (/([\w\-]+):[^:]*$/.exec(s) || {})[1];
22922 if (!o) return [];
22923 var u = [];
22924 return o in r && _typeof(r[o]) == "object" && (u = Object.keys(r[o])), u.map(function (e) {
22925 return {
22926 caption: e,
22927 snippet: e,
22928 meta: "property value",
22929 score: 1e6
22930 };
22931 });
22932 };
22933 }).call(i.prototype), t.CssCompletions = i;
22934 }), ace.define("ace/mode/behaviour/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/mode/behaviour/cstyle", "ace/token_iterator"], function (e, t, n) {
22935 "use strict";
22936
22937 var r = e("../../lib/oop"),
22938 i = e("../behaviour").Behaviour,
22939 s = e("./cstyle").CstyleBehaviour,
22940 o = e("../../token_iterator").TokenIterator,
22941 u = function u() {
22942 this.inherit(s), this.add("colon", "insertion", function (e, t, n, r, i) {
22943 if (i === ":" && n.selection.isEmpty()) {
22944 var s = n.getCursorPosition(),
22945 u = new o(r, s.row, s.column),
22946 a = u.getCurrentToken();
22947 a && a.value.match(/\s+/) && (a = u.stepBackward());
22948
22949 if (a && a.type === "support.type") {
22950 var f = r.doc.getLine(s.row),
22951 l = f.substring(s.column, s.column + 1);
22952 if (l === ":") return {
22953 text: "",
22954 selection: [1, 1]
22955 };
22956 if (/^(\s+[^;]|\s*$)/.test(f.substring(s.column))) return {
22957 text: ":;",
22958 selection: [1, 1]
22959 };
22960 }
22961 }
22962 }), this.add("colon", "deletion", function (e, t, n, r, i) {
22963 var s = r.doc.getTextRange(i);
22964
22965 if (!i.isMultiLine() && s === ":") {
22966 var u = n.getCursorPosition(),
22967 a = new o(r, u.row, u.column),
22968 f = a.getCurrentToken();
22969 f && f.value.match(/\s+/) && (f = a.stepBackward());
22970
22971 if (f && f.type === "support.type") {
22972 var l = r.doc.getLine(i.start.row),
22973 c = l.substring(i.end.column, i.end.column + 1);
22974 if (c === ";") return i.end.column++, i;
22975 }
22976 }
22977 }), this.add("semicolon", "insertion", function (e, t, n, r, i) {
22978 if (i === ";" && n.selection.isEmpty()) {
22979 var s = n.getCursorPosition(),
22980 o = r.doc.getLine(s.row),
22981 u = o.substring(s.column, s.column + 1);
22982 if (u === ";") return {
22983 text: "",
22984 selection: [1, 1]
22985 };
22986 }
22987 }), this.add("!important", "insertion", function (e, t, n, r, i) {
22988 if (i === "!" && n.selection.isEmpty()) {
22989 var s = n.getCursorPosition(),
22990 o = r.doc.getLine(s.row);
22991 if (/^\s*(;|}|$)/.test(o.substring(s.column))) return {
22992 text: "!important",
22993 selection: [10, 10]
22994 };
22995 }
22996 });
22997 };
22998
22999 r.inherits(u, s), t.CssBehaviour = u;
23000 }), ace.define("ace/mode/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/css_completions", "ace/mode/behaviour/css", "ace/mode/folding/cstyle"], function (e, t, n) {
23001 "use strict";
23002
23003 var r = e("../lib/oop"),
23004 i = e("./text").Mode,
23005 s = e("./css_highlight_rules").CssHighlightRules,
23006 o = e("./matching_brace_outdent").MatchingBraceOutdent,
23007 u = e("../worker/worker_client").WorkerClient,
23008 a = e("./css_completions").CssCompletions,
23009 f = e("./behaviour/css").CssBehaviour,
23010 l = e("./folding/cstyle").FoldMode,
23011 c = function c() {
23012 this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new f(), this.$completer = new a(), this.foldingRules = new l();
23013 };
23014
23015 r.inherits(c, i), function () {
23016 this.foldingRules = "cStyle", this.blockComment = {
23017 start: "/*",
23018 end: "*/"
23019 }, this.getNextLineIndent = function (e, t, n) {
23020 var r = this.$getIndent(t),
23021 i = this.getTokenizer().getLineTokens(t, e).tokens;
23022 if (i.length && i[i.length - 1].type == "comment") return r;
23023 var s = t.match(/^.*\{\s*$/);
23024 return s && (r += n), r;
23025 }, this.checkOutdent = function (e, t, n) {
23026 return this.$outdent.checkOutdent(t, n);
23027 }, this.autoOutdent = function (e, t, n) {
23028 this.$outdent.autoOutdent(t, n);
23029 }, this.getCompletions = function (e, t, n, r) {
23030 return this.$completer.getCompletions(e, t, n, r);
23031 }, this.createWorker = function (e) {
23032 var t = new u(["ace"], "ace/mode/css_worker", "Worker");
23033 return t.attachToDocument(e.getDocument()), t.on("annotate", function (t) {
23034 e.setAnnotations(t.data);
23035 }), t.on("terminate", function () {
23036 e.clearAnnotations();
23037 }), t;
23038 }, this.$id = "ace/mode/css";
23039 }.call(c.prototype), t.Mode = c;
23040 }), ace.define("ace/mode/xml_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (e, t, n) {
23041 "use strict";
23042
23043 var r = e("../lib/oop"),
23044 i = e("./text_highlight_rules").TextHighlightRules,
23045 s = function s(e) {
23046 var t = "[_:a-zA-Z\xC0-\uFFFF][-_:.a-zA-Z0-9\xC0-\uFFFF]*";
23047 this.$rules = {
23048 start: [{
23049 token: "string.cdata.xml",
23050 regex: "<\\!\\[CDATA\\[",
23051 next: "cdata"
23052 }, {
23053 token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
23054 regex: "(<\\?)(" + t + ")",
23055 next: "processing_instruction"
23056 }, {
23057 token: "comment.start.xml",
23058 regex: "<\\!--",
23059 next: "comment"
23060 }, {
23061 token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
23062 regex: "(<\\!)(DOCTYPE)(?=[\\s])",
23063 next: "doctype",
23064 caseInsensitive: !0
23065 }, {
23066 include: "tag"
23067 }, {
23068 token: "text.end-tag-open.xml",
23069 regex: "</"
23070 }, {
23071 token: "text.tag-open.xml",
23072 regex: "<"
23073 }, {
23074 include: "reference"
23075 }, {
23076 defaultToken: "text.xml"
23077 }],
23078 processing_instruction: [{
23079 token: "entity.other.attribute-name.decl-attribute-name.xml",
23080 regex: t
23081 }, {
23082 token: "keyword.operator.decl-attribute-equals.xml",
23083 regex: "="
23084 }, {
23085 include: "whitespace"
23086 }, {
23087 include: "string"
23088 }, {
23089 token: "punctuation.xml-decl.xml",
23090 regex: "\\?>",
23091 next: "start"
23092 }],
23093 doctype: [{
23094 include: "whitespace"
23095 }, {
23096 include: "string"
23097 }, {
23098 token: "xml-pe.doctype.xml",
23099 regex: ">",
23100 next: "start"
23101 }, {
23102 token: "xml-pe.xml",
23103 regex: "[-_a-zA-Z0-9:]+"
23104 }, {
23105 token: "punctuation.int-subset",
23106 regex: "\\[",
23107 push: "int_subset"
23108 }],
23109 int_subset: [{
23110 token: "text.xml",
23111 regex: "\\s+"
23112 }, {
23113 token: "punctuation.int-subset.xml",
23114 regex: "]",
23115 next: "pop"
23116 }, {
23117 token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
23118 regex: "(<\\!)(" + t + ")",
23119 push: [{
23120 token: "text",
23121 regex: "\\s+"
23122 }, {
23123 token: "punctuation.markup-decl.xml",
23124 regex: ">",
23125 next: "pop"
23126 }, {
23127 include: "string"
23128 }]
23129 }],
23130 cdata: [{
23131 token: "string.cdata.xml",
23132 regex: "\\]\\]>",
23133 next: "start"
23134 }, {
23135 token: "text.xml",
23136 regex: "\\s+"
23137 }, {
23138 token: "text.xml",
23139 regex: "(?:[^\\]]|\\](?!\\]>))+"
23140 }],
23141 comment: [{
23142 token: "comment.end.xml",
23143 regex: "-->",
23144 next: "start"
23145 }, {
23146 defaultToken: "comment.xml"
23147 }],
23148 reference: [{
23149 token: "constant.language.escape.reference.xml",
23150 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
23151 }],
23152 attr_reference: [{
23153 token: "constant.language.escape.reference.attribute-value.xml",
23154 regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
23155 }],
23156 tag: [{
23157 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
23158 regex: "(?:(<)|(</))((?:" + t + ":)?" + t + ")",
23159 next: [{
23160 include: "attributes"
23161 }, {
23162 token: "meta.tag.punctuation.tag-close.xml",
23163 regex: "/?>",
23164 next: "start"
23165 }]
23166 }],
23167 tag_whitespace: [{
23168 token: "text.tag-whitespace.xml",
23169 regex: "\\s+"
23170 }],
23171 whitespace: [{
23172 token: "text.whitespace.xml",
23173 regex: "\\s+"
23174 }],
23175 string: [{
23176 token: "string.xml",
23177 regex: "'",
23178 push: [{
23179 token: "string.xml",
23180 regex: "'",
23181 next: "pop"
23182 }, {
23183 defaultToken: "string.xml"
23184 }]
23185 }, {
23186 token: "string.xml",
23187 regex: '"',
23188 push: [{
23189 token: "string.xml",
23190 regex: '"',
23191 next: "pop"
23192 }, {
23193 defaultToken: "string.xml"
23194 }]
23195 }],
23196 attributes: [{
23197 token: "entity.other.attribute-name.xml",
23198 regex: t
23199 }, {
23200 token: "keyword.operator.attribute-equals.xml",
23201 regex: "="
23202 }, {
23203 include: "tag_whitespace"
23204 }, {
23205 include: "attribute_value"
23206 }],
23207 attribute_value: [{
23208 token: "string.attribute-value.xml",
23209 regex: "'",
23210 push: [{
23211 token: "string.attribute-value.xml",
23212 regex: "'",
23213 next: "pop"
23214 }, {
23215 include: "attr_reference"
23216 }, {
23217 defaultToken: "string.attribute-value.xml"
23218 }]
23219 }, {
23220 token: "string.attribute-value.xml",
23221 regex: '"',
23222 push: [{
23223 token: "string.attribute-value.xml",
23224 regex: '"',
23225 next: "pop"
23226 }, {
23227 include: "attr_reference"
23228 }, {
23229 defaultToken: "string.attribute-value.xml"
23230 }]
23231 }]
23232 }, this.constructor === s && this.normalizeRules();
23233 };
23234
23235 (function () {
23236 this.embedTagRules = function (e, t, n) {
23237 this.$rules.tag.unshift({
23238 token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + n + ".tag-name.xml"],
23239 regex: "(<)(" + n + "(?=\\s|>|$))",
23240 next: [{
23241 include: "attributes"
23242 }, {
23243 token: "meta.tag.punctuation.tag-close.xml",
23244 regex: "/?>",
23245 next: t + "start"
23246 }]
23247 }), this.$rules[n + "-end"] = [{
23248 include: "attributes"
23249 }, {
23250 token: "meta.tag.punctuation.tag-close.xml",
23251 regex: "/?>",
23252 next: "start",
23253 onMatch: function onMatch(e, t, n) {
23254 return n.splice(0), this.token;
23255 }
23256 }], this.embedRules(e, t, [{
23257 token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + n + ".tag-name.xml"],
23258 regex: "(</)(" + n + "(?=\\s|>|$))",
23259 next: n + "-end"
23260 }, {
23261 token: "string.cdata.xml",
23262 regex: "<\\!\\[CDATA\\["
23263 }, {
23264 token: "string.cdata.xml",
23265 regex: "\\]\\]>"
23266 }]);
23267 };
23268 }).call(i.prototype), r.inherits(s, i), t.XmlHighlightRules = s;
23269 }), ace.define("ace/mode/html_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/css_highlight_rules", "ace/mode/javascript_highlight_rules", "ace/mode/xml_highlight_rules"], function (e, t, n) {
23270 "use strict";
23271
23272 var r = e("../lib/oop"),
23273 i = e("../lib/lang"),
23274 s = e("./css_highlight_rules").CssHighlightRules,
23275 o = e("./javascript_highlight_rules").JavaScriptHighlightRules,
23276 u = e("./xml_highlight_rules").XmlHighlightRules,
23277 a = i.createMap({
23278 a: "anchor",
23279 button: "form",
23280 form: "form",
23281 img: "image",
23282 input: "form",
23283 label: "form",
23284 option: "form",
23285 script: "script",
23286 select: "form",
23287 textarea: "form",
23288 style: "style",
23289 table: "table",
23290 tbody: "table",
23291 td: "table",
23292 tfoot: "table",
23293 th: "table",
23294 tr: "table"
23295 }),
23296 f = function f() {
23297 u.call(this), this.addRules({
23298 attributes: [{
23299 include: "tag_whitespace"
23300 }, {
23301 token: "entity.other.attribute-name.xml",
23302 regex: "[-_a-zA-Z0-9:.]+"
23303 }, {
23304 token: "keyword.operator.attribute-equals.xml",
23305 regex: "=",
23306 push: [{
23307 include: "tag_whitespace"
23308 }, {
23309 token: "string.unquoted.attribute-value.html",
23310 regex: "[^<>='\"`\\s]+",
23311 next: "pop"
23312 }, {
23313 token: "empty",
23314 regex: "",
23315 next: "pop"
23316 }]
23317 }, {
23318 include: "attribute_value"
23319 }],
23320 tag: [{
23321 token: function token(e, t) {
23322 var n = a[t];
23323 return ["meta.tag.punctuation." + (e == "<" ? "" : "end-") + "tag-open.xml", "meta.tag" + (n ? "." + n : "") + ".tag-name.xml"];
23324 },
23325 regex: "(</?)([-_a-zA-Z0-9:.]+)",
23326 next: "tag_stuff"
23327 }],
23328 tag_stuff: [{
23329 include: "attributes"
23330 }, {
23331 token: "meta.tag.punctuation.tag-close.xml",
23332 regex: "/?>",
23333 next: "start"
23334 }]
23335 }), this.embedTagRules(s, "css-", "style"), this.embedTagRules(new o({
23336 jsx: !1
23337 }).getRules(), "js-", "script"), this.constructor === f && this.normalizeRules();
23338 };
23339
23340 r.inherits(f, u), t.HtmlHighlightRules = f;
23341 }), ace.define("ace/mode/behaviour/xml", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function (e, t, n) {
23342 "use strict";
23343
23344 function u(e, t) {
23345 return e && e.type.lastIndexOf(t + ".xml") > -1;
23346 }
23347
23348 var r = e("../../lib/oop"),
23349 i = e("../behaviour").Behaviour,
23350 s = e("../../token_iterator").TokenIterator,
23351 o = e("../../lib/lang"),
23352 a = function a() {
23353 this.add("string_dquotes", "insertion", function (e, t, n, r, i) {
23354 if (i == '"' || i == "'") {
23355 var o = i,
23356 a = r.doc.getTextRange(n.getSelectionRange());
23357 if (a !== "" && a !== "'" && a != '"' && n.getWrapBehavioursEnabled()) return {
23358 text: o + a + o,
23359 selection: !1
23360 };
23361 var f = n.getCursorPosition(),
23362 l = r.doc.getLine(f.row),
23363 c = l.substring(f.column, f.column + 1),
23364 h = new s(r, f.row, f.column),
23365 p = h.getCurrentToken();
23366 if (c == o && (u(p, "attribute-value") || u(p, "string"))) return {
23367 text: "",
23368 selection: [1, 1]
23369 };
23370 p || (p = h.stepBackward());
23371 if (!p) return;
23372
23373 while (u(p, "tag-whitespace") || u(p, "whitespace")) {
23374 p = h.stepBackward();
23375 }
23376
23377 var d = !c || c.match(/\s/);
23378 if (u(p, "attribute-equals") && (d || c == ">") || u(p, "decl-attribute-equals") && (d || c == "?")) return {
23379 text: o + o,
23380 selection: [1, 1]
23381 };
23382 }
23383 }), this.add("string_dquotes", "deletion", function (e, t, n, r, i) {
23384 var s = r.doc.getTextRange(i);
23385
23386 if (!i.isMultiLine() && (s == '"' || s == "'")) {
23387 var o = r.doc.getLine(i.start.row),
23388 u = o.substring(i.start.column + 1, i.start.column + 2);
23389 if (u == s) return i.end.column++, i;
23390 }
23391 }), this.add("autoclosing", "insertion", function (e, t, n, r, i) {
23392 if (i == ">") {
23393 var o = n.getSelectionRange().start,
23394 a = new s(r, o.row, o.column),
23395 f = a.getCurrentToken() || a.stepBackward();
23396 if (!f || !(u(f, "tag-name") || u(f, "tag-whitespace") || u(f, "attribute-name") || u(f, "attribute-equals") || u(f, "attribute-value"))) return;
23397 if (u(f, "reference.attribute-value")) return;
23398
23399 if (u(f, "attribute-value")) {
23400 var l = a.getCurrentTokenColumn() + f.value.length;
23401 if (o.column < l) return;
23402
23403 if (o.column == l) {
23404 var c = a.stepForward();
23405 if (c && u(c, "attribute-value")) return;
23406 a.stepBackward();
23407 }
23408 }
23409
23410 if (/^\s*>/.test(r.getLine(o.row).slice(o.column))) return;
23411
23412 while (!u(f, "tag-name")) {
23413 f = a.stepBackward();
23414
23415 if (f.value == "<") {
23416 f = a.stepForward();
23417 break;
23418 }
23419 }
23420
23421 var h = a.getCurrentTokenRow(),
23422 p = a.getCurrentTokenColumn();
23423 if (u(a.stepBackward(), "end-tag-open")) return;
23424 var d = f.value;
23425 h == o.row && (d = d.substring(0, o.column - p));
23426 if (this.voidElements.hasOwnProperty(d.toLowerCase())) return;
23427 return {
23428 text: "></" + d + ">",
23429 selection: [1, 1]
23430 };
23431 }
23432 }), this.add("autoindent", "insertion", function (e, t, n, r, i) {
23433 if (i == "\n") {
23434 var o = n.getCursorPosition(),
23435 u = r.getLine(o.row),
23436 a = new s(r, o.row, o.column),
23437 f = a.getCurrentToken();
23438
23439 if (f && f.type.indexOf("tag-close") !== -1) {
23440 if (f.value == "/>") return;
23441
23442 while (f && f.type.indexOf("tag-name") === -1) {
23443 f = a.stepBackward();
23444 }
23445
23446 if (!f) return;
23447 var l = f.value,
23448 c = a.getCurrentTokenRow();
23449 f = a.stepBackward();
23450 if (!f || f.type.indexOf("end-tag") !== -1) return;
23451
23452 if (this.voidElements && !this.voidElements[l]) {
23453 var h = r.getTokenAt(o.row, o.column + 1),
23454 u = r.getLine(c),
23455 p = this.$getIndent(u),
23456 d = p + r.getTabString();
23457 return h && h.value === "</" ? {
23458 text: "\n" + d + "\n" + p,
23459 selection: [1, d.length, 1, d.length]
23460 } : {
23461 text: "\n" + d
23462 };
23463 }
23464 }
23465 }
23466 });
23467 };
23468
23469 r.inherits(a, i), t.XmlBehaviour = a;
23470 }), ace.define("ace/mode/folding/mixed", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/fold_mode"], function (e, t, n) {
23471 "use strict";
23472
23473 var r = e("../../lib/oop"),
23474 i = e("./fold_mode").FoldMode,
23475 s = t.FoldMode = function (e, t) {
23476 this.defaultMode = e, this.subModes = t;
23477 };
23478
23479 r.inherits(s, i), function () {
23480 this.$getMode = function (e) {
23481 typeof e != "string" && (e = e[0]);
23482
23483 for (var t in this.subModes) {
23484 if (e.indexOf(t) === 0) return this.subModes[t];
23485 }
23486
23487 return null;
23488 }, this.$tryMode = function (e, t, n, r) {
23489 var i = this.$getMode(e);
23490 return i ? i.getFoldWidget(t, n, r) : "";
23491 }, this.getFoldWidget = function (e, t, n) {
23492 return this.$tryMode(e.getState(n - 1), e, t, n) || this.$tryMode(e.getState(n), e, t, n) || this.defaultMode.getFoldWidget(e, t, n);
23493 }, this.getFoldWidgetRange = function (e, t, n) {
23494 var r = this.$getMode(e.getState(n - 1));
23495 if (!r || !r.getFoldWidget(e, t, n)) r = this.$getMode(e.getState(n));
23496 if (!r || !r.getFoldWidget(e, t, n)) r = this.defaultMode;
23497 return r.getFoldWidgetRange(e, t, n);
23498 };
23499 }.call(s.prototype);
23500 }), ace.define("ace/mode/folding/xml", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/range", "ace/mode/folding/fold_mode", "ace/token_iterator"], function (e, t, n) {
23501 "use strict";
23502
23503 function l(e, t) {
23504 return e.type.lastIndexOf(t + ".xml") > -1;
23505 }
23506
23507 var r = e("../../lib/oop"),
23508 i = e("../../lib/lang"),
23509 s = e("../../range").Range,
23510 o = e("./fold_mode").FoldMode,
23511 u = e("../../token_iterator").TokenIterator,
23512 a = t.FoldMode = function (e, t) {
23513 o.call(this), this.voidElements = e || {}, this.optionalEndTags = r.mixin({}, this.voidElements), t && r.mixin(this.optionalEndTags, t);
23514 };
23515
23516 r.inherits(a, o);
23517
23518 var f = function f() {
23519 this.tagName = "", this.closing = !1, this.selfClosing = !1, this.start = {
23520 row: 0,
23521 column: 0
23522 }, this.end = {
23523 row: 0,
23524 column: 0
23525 };
23526 };
23527
23528 (function () {
23529 this.getFoldWidget = function (e, t, n) {
23530 var r = this._getFirstTagInLine(e, n);
23531
23532 return r ? r.closing || !r.tagName && r.selfClosing ? t == "markbeginend" ? "end" : "" : !r.tagName || r.selfClosing || this.voidElements.hasOwnProperty(r.tagName.toLowerCase()) ? "" : this._findEndTagInLine(e, n, r.tagName, r.end.column) ? "" : "start" : this.getCommentFoldWidget(e, n);
23533 }, this.getCommentFoldWidget = function (e, t) {
23534 return /comment/.test(e.getState(t)) && /<!-/.test(e.getLine(t)) ? "start" : "";
23535 }, this._getFirstTagInLine = function (e, t) {
23536 var n = e.getTokens(t),
23537 r = new f();
23538
23539 for (var i = 0; i < n.length; i++) {
23540 var s = n[i];
23541
23542 if (l(s, "tag-open")) {
23543 r.end.column = r.start.column + s.value.length, r.closing = l(s, "end-tag-open"), s = n[++i];
23544 if (!s) return null;
23545 r.tagName = s.value, r.end.column += s.value.length;
23546
23547 for (i++; i < n.length; i++) {
23548 s = n[i], r.end.column += s.value.length;
23549
23550 if (l(s, "tag-close")) {
23551 r.selfClosing = s.value == "/>";
23552 break;
23553 }
23554 }
23555
23556 return r;
23557 }
23558
23559 if (l(s, "tag-close")) return r.selfClosing = s.value == "/>", r;
23560 r.start.column += s.value.length;
23561 }
23562
23563 return null;
23564 }, this._findEndTagInLine = function (e, t, n, r) {
23565 var i = e.getTokens(t),
23566 s = 0;
23567
23568 for (var o = 0; o < i.length; o++) {
23569 var u = i[o];
23570 s += u.value.length;
23571 if (s < r) continue;
23572
23573 if (l(u, "end-tag-open")) {
23574 u = i[o + 1];
23575 if (u && u.value == n) return !0;
23576 }
23577 }
23578
23579 return !1;
23580 }, this._readTagForward = function (e) {
23581 var t = e.getCurrentToken();
23582 if (!t) return null;
23583 var n = new f();
23584
23585 do {
23586 if (l(t, "tag-open")) n.closing = l(t, "end-tag-open"), n.start.row = e.getCurrentTokenRow(), n.start.column = e.getCurrentTokenColumn();else if (l(t, "tag-name")) n.tagName = t.value;else if (l(t, "tag-close")) return n.selfClosing = t.value == "/>", n.end.row = e.getCurrentTokenRow(), n.end.column = e.getCurrentTokenColumn() + t.value.length, e.stepForward(), n;
23587 } while (t = e.stepForward());
23588
23589 return null;
23590 }, this._readTagBackward = function (e) {
23591 var t = e.getCurrentToken();
23592 if (!t) return null;
23593 var n = new f();
23594
23595 do {
23596 if (l(t, "tag-open")) return n.closing = l(t, "end-tag-open"), n.start.row = e.getCurrentTokenRow(), n.start.column = e.getCurrentTokenColumn(), e.stepBackward(), n;
23597 l(t, "tag-name") ? n.tagName = t.value : l(t, "tag-close") && (n.selfClosing = t.value == "/>", n.end.row = e.getCurrentTokenRow(), n.end.column = e.getCurrentTokenColumn() + t.value.length);
23598 } while (t = e.stepBackward());
23599
23600 return null;
23601 }, this._pop = function (e, t) {
23602 while (e.length) {
23603 var n = e[e.length - 1];
23604 if (!t || n.tagName == t.tagName) return e.pop();
23605
23606 if (this.optionalEndTags.hasOwnProperty(n.tagName)) {
23607 e.pop();
23608 continue;
23609 }
23610
23611 return null;
23612 }
23613 }, this.getFoldWidgetRange = function (e, t, n) {
23614 var r = this._getFirstTagInLine(e, n);
23615
23616 if (!r) return this.getCommentFoldWidget(e, n) && e.getCommentFoldRange(n, e.getLine(n).length);
23617 var i = r.closing || r.selfClosing,
23618 o = [],
23619 a;
23620
23621 if (!i) {
23622 var f = new u(e, n, r.start.column),
23623 l = {
23624 row: n,
23625 column: r.start.column + r.tagName.length + 2
23626 };
23627 r.start.row == r.end.row && (l.column = r.end.column);
23628
23629 while (a = this._readTagForward(f)) {
23630 if (a.selfClosing) {
23631 if (!o.length) return a.start.column += a.tagName.length + 2, a.end.column -= 2, s.fromPoints(a.start, a.end);
23632 continue;
23633 }
23634
23635 if (a.closing) {
23636 this._pop(o, a);
23637
23638 if (o.length == 0) return s.fromPoints(l, a.start);
23639 } else o.push(a);
23640 }
23641 } else {
23642 var f = new u(e, n, r.end.column),
23643 c = {
23644 row: n,
23645 column: r.start.column
23646 };
23647
23648 while (a = this._readTagBackward(f)) {
23649 if (a.selfClosing) {
23650 if (!o.length) return a.start.column += a.tagName.length + 2, a.end.column -= 2, s.fromPoints(a.start, a.end);
23651 continue;
23652 }
23653
23654 if (!a.closing) {
23655 this._pop(o, a);
23656
23657 if (o.length == 0) return a.start.column += a.tagName.length + 2, a.start.row == a.end.row && a.start.column < a.end.column && (a.start.column = a.end.column), s.fromPoints(a.start, c);
23658 } else o.push(a);
23659 }
23660 }
23661 };
23662 }).call(a.prototype);
23663 }), ace.define("ace/mode/folding/html", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/mixed", "ace/mode/folding/xml", "ace/mode/folding/cstyle"], function (e, t, n) {
23664 "use strict";
23665
23666 var r = e("../../lib/oop"),
23667 i = e("./mixed").FoldMode,
23668 s = e("./xml").FoldMode,
23669 o = e("./cstyle").FoldMode,
23670 u = t.FoldMode = function (e, t) {
23671 i.call(this, new s(e, t), {
23672 "js-": new o(),
23673 "css-": new o()
23674 });
23675 };
23676
23677 r.inherits(u, i);
23678 }), ace.define("ace/mode/html_completions", ["require", "exports", "module", "ace/token_iterator"], function (e, t, n) {
23679 "use strict";
23680
23681 function f(e, t) {
23682 return e.type.lastIndexOf(t + ".xml") > -1;
23683 }
23684
23685 function l(e, t) {
23686 var n = new r(e, t.row, t.column),
23687 i = n.getCurrentToken();
23688
23689 while (i && !f(i, "tag-name")) {
23690 i = n.stepBackward();
23691 }
23692
23693 if (i) return i.value;
23694 }
23695
23696 function c(e, t) {
23697 var n = new r(e, t.row, t.column),
23698 i = n.getCurrentToken();
23699
23700 while (i && !f(i, "attribute-name")) {
23701 i = n.stepBackward();
23702 }
23703
23704 if (i) return i.value;
23705 }
23706
23707 var r = e("../token_iterator").TokenIterator,
23708 i = ["accesskey", "class", "contenteditable", "contextmenu", "dir", "draggable", "dropzone", "hidden", "id", "inert", "itemid", "itemprop", "itemref", "itemscope", "itemtype", "lang", "spellcheck", "style", "tabindex", "title", "translate"],
23709 s = ["onabort", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextmenu", "oncuechange", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreset", "onscroll", "onseeked", "onseeking", "onselect", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting"],
23710 o = i.concat(s),
23711 u = {
23712 a: {
23713 href: 1,
23714 target: {
23715 _blank: 1,
23716 top: 1
23717 },
23718 ping: 1,
23719 rel: {
23720 nofollow: 1,
23721 alternate: 1,
23722 author: 1,
23723 bookmark: 1,
23724 help: 1,
23725 license: 1,
23726 next: 1,
23727 noreferrer: 1,
23728 prefetch: 1,
23729 prev: 1,
23730 search: 1,
23731 tag: 1
23732 },
23733 media: 1,
23734 hreflang: 1,
23735 type: 1
23736 },
23737 abbr: {},
23738 address: {},
23739 area: {
23740 shape: 1,
23741 coords: 1,
23742 href: 1,
23743 hreflang: 1,
23744 alt: 1,
23745 target: 1,
23746 media: 1,
23747 rel: 1,
23748 ping: 1,
23749 type: 1
23750 },
23751 article: {
23752 pubdate: 1
23753 },
23754 aside: {},
23755 audio: {
23756 src: 1,
23757 autobuffer: 1,
23758 autoplay: {
23759 autoplay: 1
23760 },
23761 loop: {
23762 loop: 1
23763 },
23764 controls: {
23765 controls: 1
23766 },
23767 muted: {
23768 muted: 1
23769 },
23770 preload: {
23771 auto: 1,
23772 metadata: 1,
23773 none: 1
23774 }
23775 },
23776 b: {},
23777 base: {
23778 href: 1,
23779 target: 1
23780 },
23781 bdi: {},
23782 bdo: {},
23783 blockquote: {
23784 cite: 1
23785 },
23786 body: {
23787 onafterprint: 1,
23788 onbeforeprint: 1,
23789 onbeforeunload: 1,
23790 onhashchange: 1,
23791 onmessage: 1,
23792 onoffline: 1,
23793 onpopstate: 1,
23794 onredo: 1,
23795 onresize: 1,
23796 onstorage: 1,
23797 onundo: 1,
23798 onunload: 1
23799 },
23800 br: {},
23801 button: {
23802 autofocus: 1,
23803 disabled: {
23804 disabled: 1
23805 },
23806 form: 1,
23807 formaction: 1,
23808 formenctype: 1,
23809 formmethod: 1,
23810 formnovalidate: 1,
23811 formtarget: 1,
23812 name: 1,
23813 value: 1,
23814 type: {
23815 button: 1,
23816 submit: 1
23817 }
23818 },
23819 canvas: {
23820 width: 1,
23821 height: 1
23822 },
23823 caption: {},
23824 cite: {},
23825 code: {},
23826 col: {
23827 span: 1
23828 },
23829 colgroup: {
23830 span: 1
23831 },
23832 command: {
23833 type: 1,
23834 label: 1,
23835 icon: 1,
23836 disabled: 1,
23837 checked: 1,
23838 radiogroup: 1,
23839 command: 1
23840 },
23841 data: {},
23842 datalist: {},
23843 dd: {},
23844 del: {
23845 cite: 1,
23846 datetime: 1
23847 },
23848 details: {
23849 open: 1
23850 },
23851 dfn: {},
23852 dialog: {
23853 open: 1
23854 },
23855 div: {},
23856 dl: {},
23857 dt: {},
23858 em: {},
23859 embed: {
23860 src: 1,
23861 height: 1,
23862 width: 1,
23863 type: 1
23864 },
23865 fieldset: {
23866 disabled: 1,
23867 form: 1,
23868 name: 1
23869 },
23870 figcaption: {},
23871 figure: {},
23872 footer: {},
23873 form: {
23874 "accept-charset": 1,
23875 action: 1,
23876 autocomplete: 1,
23877 enctype: {
23878 "multipart/form-data": 1,
23879 "application/x-www-form-urlencoded": 1
23880 },
23881 method: {
23882 get: 1,
23883 post: 1
23884 },
23885 name: 1,
23886 novalidate: 1,
23887 target: {
23888 _blank: 1,
23889 top: 1
23890 }
23891 },
23892 h1: {},
23893 h2: {},
23894 h3: {},
23895 h4: {},
23896 h5: {},
23897 h6: {},
23898 head: {},
23899 header: {},
23900 hr: {},
23901 html: {
23902 manifest: 1
23903 },
23904 i: {},
23905 iframe: {
23906 name: 1,
23907 src: 1,
23908 height: 1,
23909 width: 1,
23910 sandbox: {
23911 "allow-same-origin": 1,
23912 "allow-top-navigation": 1,
23913 "allow-forms": 1,
23914 "allow-scripts": 1
23915 },
23916 seamless: {
23917 seamless: 1
23918 }
23919 },
23920 img: {
23921 alt: 1,
23922 src: 1,
23923 height: 1,
23924 width: 1,
23925 usemap: 1,
23926 ismap: 1
23927 },
23928 input: {
23929 type: {
23930 text: 1,
23931 password: 1,
23932 hidden: 1,
23933 checkbox: 1,
23934 submit: 1,
23935 radio: 1,
23936 file: 1,
23937 button: 1,
23938 reset: 1,
23939 image: 31,
23940 color: 1,
23941 date: 1,
23942 datetime: 1,
23943 "datetime-local": 1,
23944 email: 1,
23945 month: 1,
23946 number: 1,
23947 range: 1,
23948 search: 1,
23949 tel: 1,
23950 time: 1,
23951 url: 1,
23952 week: 1
23953 },
23954 accept: 1,
23955 alt: 1,
23956 autocomplete: {
23957 on: 1,
23958 off: 1
23959 },
23960 autofocus: {
23961 autofocus: 1
23962 },
23963 checked: {
23964 checked: 1
23965 },
23966 disabled: {
23967 disabled: 1
23968 },
23969 form: 1,
23970 formaction: 1,
23971 formenctype: {
23972 "application/x-www-form-urlencoded": 1,
23973 "multipart/form-data": 1,
23974 "text/plain": 1
23975 },
23976 formmethod: {
23977 get: 1,
23978 post: 1
23979 },
23980 formnovalidate: {
23981 formnovalidate: 1
23982 },
23983 formtarget: {
23984 _blank: 1,
23985 _self: 1,
23986 _parent: 1,
23987 _top: 1
23988 },
23989 height: 1,
23990 list: 1,
23991 max: 1,
23992 maxlength: 1,
23993 min: 1,
23994 multiple: {
23995 multiple: 1
23996 },
23997 name: 1,
23998 pattern: 1,
23999 placeholder: 1,
24000 readonly: {
24001 readonly: 1
24002 },
24003 required: {
24004 required: 1
24005 },
24006 size: 1,
24007 src: 1,
24008 step: 1,
24009 width: 1,
24010 files: 1,
24011 value: 1
24012 },
24013 ins: {
24014 cite: 1,
24015 datetime: 1
24016 },
24017 kbd: {},
24018 keygen: {
24019 autofocus: 1,
24020 challenge: {
24021 challenge: 1
24022 },
24023 disabled: {
24024 disabled: 1
24025 },
24026 form: 1,
24027 keytype: {
24028 rsa: 1,
24029 dsa: 1,
24030 ec: 1
24031 },
24032 name: 1
24033 },
24034 label: {
24035 form: 1,
24036 "for": 1
24037 },
24038 legend: {},
24039 li: {
24040 value: 1
24041 },
24042 link: {
24043 href: 1,
24044 hreflang: 1,
24045 rel: {
24046 stylesheet: 1,
24047 icon: 1
24048 },
24049 media: {
24050 all: 1,
24051 screen: 1,
24052 print: 1
24053 },
24054 type: {
24055 "text/css": 1,
24056 "image/png": 1,
24057 "image/jpeg": 1,
24058 "image/gif": 1
24059 },
24060 sizes: 1
24061 },
24062 main: {},
24063 map: {
24064 name: 1
24065 },
24066 mark: {},
24067 math: {},
24068 menu: {
24069 type: 1,
24070 label: 1
24071 },
24072 meta: {
24073 "http-equiv": {
24074 "content-type": 1
24075 },
24076 name: {
24077 description: 1,
24078 keywords: 1
24079 },
24080 content: {
24081 "text/html; charset=UTF-8": 1
24082 },
24083 charset: 1
24084 },
24085 meter: {
24086 value: 1,
24087 min: 1,
24088 max: 1,
24089 low: 1,
24090 high: 1,
24091 optimum: 1
24092 },
24093 nav: {},
24094 noscript: {
24095 href: 1
24096 },
24097 object: {
24098 param: 1,
24099 data: 1,
24100 type: 1,
24101 height: 1,
24102 width: 1,
24103 usemap: 1,
24104 name: 1,
24105 form: 1,
24106 classid: 1
24107 },
24108 ol: {
24109 start: 1,
24110 reversed: 1
24111 },
24112 optgroup: {
24113 disabled: 1,
24114 label: 1
24115 },
24116 option: {
24117 disabled: 1,
24118 selected: 1,
24119 label: 1,
24120 value: 1
24121 },
24122 output: {
24123 "for": 1,
24124 form: 1,
24125 name: 1
24126 },
24127 p: {},
24128 param: {
24129 name: 1,
24130 value: 1
24131 },
24132 pre: {},
24133 progress: {
24134 value: 1,
24135 max: 1
24136 },
24137 q: {
24138 cite: 1
24139 },
24140 rp: {},
24141 rt: {},
24142 ruby: {},
24143 s: {},
24144 samp: {},
24145 script: {
24146 charset: 1,
24147 type: {
24148 "text/javascript": 1
24149 },
24150 src: 1,
24151 defer: 1,
24152 async: 1
24153 },
24154 select: {
24155 autofocus: 1,
24156 disabled: 1,
24157 form: 1,
24158 multiple: {
24159 multiple: 1
24160 },
24161 name: 1,
24162 size: 1,
24163 readonly: {
24164 readonly: 1
24165 }
24166 },
24167 small: {},
24168 source: {
24169 src: 1,
24170 type: 1,
24171 media: 1
24172 },
24173 span: {},
24174 strong: {},
24175 style: {
24176 type: 1,
24177 media: {
24178 all: 1,
24179 screen: 1,
24180 print: 1
24181 },
24182 scoped: 1
24183 },
24184 sub: {},
24185 sup: {},
24186 svg: {},
24187 table: {
24188 summary: 1
24189 },
24190 tbody: {},
24191 td: {
24192 headers: 1,
24193 rowspan: 1,
24194 colspan: 1
24195 },
24196 textarea: {
24197 autofocus: {
24198 autofocus: 1
24199 },
24200 disabled: {
24201 disabled: 1
24202 },
24203 form: 1,
24204 maxlength: 1,
24205 name: 1,
24206 placeholder: 1,
24207 readonly: {
24208 readonly: 1
24209 },
24210 required: {
24211 required: 1
24212 },
24213 rows: 1,
24214 cols: 1,
24215 wrap: {
24216 on: 1,
24217 off: 1,
24218 hard: 1,
24219 soft: 1
24220 }
24221 },
24222 tfoot: {},
24223 th: {
24224 headers: 1,
24225 rowspan: 1,
24226 colspan: 1,
24227 scope: 1
24228 },
24229 thead: {},
24230 time: {
24231 datetime: 1
24232 },
24233 title: {},
24234 tr: {},
24235 track: {
24236 kind: 1,
24237 src: 1,
24238 srclang: 1,
24239 label: 1,
24240 "default": 1
24241 },
24242 section: {},
24243 summary: {},
24244 u: {},
24245 ul: {},
24246 "var": {},
24247 video: {
24248 src: 1,
24249 autobuffer: 1,
24250 autoplay: {
24251 autoplay: 1
24252 },
24253 loop: {
24254 loop: 1
24255 },
24256 controls: {
24257 controls: 1
24258 },
24259 width: 1,
24260 height: 1,
24261 poster: 1,
24262 muted: {
24263 muted: 1
24264 },
24265 preload: {
24266 auto: 1,
24267 metadata: 1,
24268 none: 1
24269 }
24270 },
24271 wbr: {}
24272 },
24273 a = Object.keys(u),
24274 h = function h() {};
24275
24276 (function () {
24277 this.getCompletions = function (e, t, n, r) {
24278 var i = t.getTokenAt(n.row, n.column);
24279 if (!i) return [];
24280 if (f(i, "tag-name") || f(i, "tag-open") || f(i, "end-tag-open")) return this.getTagCompletions(e, t, n, r);
24281 if (f(i, "tag-whitespace") || f(i, "attribute-name")) return this.getAttributeCompletions(e, t, n, r);
24282 if (f(i, "attribute-value")) return this.getAttributeValueCompletions(e, t, n, r);
24283 var s = t.getLine(n.row).substr(0, n.column);
24284 return /&[a-z]*$/i.test(s) ? this.getHTMLEntityCompletions(e, t, n, r) : [];
24285 }, this.getTagCompletions = function (e, t, n, r) {
24286 return a.map(function (e) {
24287 return {
24288 value: e,
24289 meta: "tag",
24290 score: 1e6
24291 };
24292 });
24293 }, this.getAttributeCompletions = function (e, t, n, r) {
24294 var i = l(t, n);
24295 if (!i) return [];
24296 var s = o;
24297 return i in u && (s = s.concat(Object.keys(u[i]))), s.map(function (e) {
24298 return {
24299 caption: e,
24300 snippet: e + '="$0"',
24301 meta: "attribute",
24302 score: 1e6
24303 };
24304 });
24305 }, this.getAttributeValueCompletions = function (e, t, n, r) {
24306 var i = l(t, n),
24307 s = c(t, n);
24308 if (!i) return [];
24309 var o = [];
24310 return i in u && s in u[i] && _typeof(u[i][s]) == "object" && (o = Object.keys(u[i][s])), o.map(function (e) {
24311 return {
24312 caption: e,
24313 snippet: e,
24314 meta: "attribute value",
24315 score: 1e6
24316 };
24317 });
24318 }, this.getHTMLEntityCompletions = function (e, t, n, r) {
24319 var i = ["Aacute;", "aacute;", "Acirc;", "acirc;", "acute;", "AElig;", "aelig;", "Agrave;", "agrave;", "alefsym;", "Alpha;", "alpha;", "amp;", "and;", "ang;", "Aring;", "aring;", "asymp;", "Atilde;", "atilde;", "Auml;", "auml;", "bdquo;", "Beta;", "beta;", "brvbar;", "bull;", "cap;", "Ccedil;", "ccedil;", "cedil;", "cent;", "Chi;", "chi;", "circ;", "clubs;", "cong;", "copy;", "crarr;", "cup;", "curren;", "Dagger;", "dagger;", "dArr;", "darr;", "deg;", "Delta;", "delta;", "diams;", "divide;", "Eacute;", "eacute;", "Ecirc;", "ecirc;", "Egrave;", "egrave;", "empty;", "emsp;", "ensp;", "Epsilon;", "epsilon;", "equiv;", "Eta;", "eta;", "ETH;", "eth;", "Euml;", "euml;", "euro;", "exist;", "fnof;", "forall;", "frac12;", "frac14;", "frac34;", "frasl;", "Gamma;", "gamma;", "ge;", "gt;", "hArr;", "harr;", "hearts;", "hellip;", "Iacute;", "iacute;", "Icirc;", "icirc;", "iexcl;", "Igrave;", "igrave;", "image;", "infin;", "int;", "Iota;", "iota;", "iquest;", "isin;", "Iuml;", "iuml;", "Kappa;", "kappa;", "Lambda;", "lambda;", "lang;", "laquo;", "lArr;", "larr;", "lceil;", "ldquo;", "le;", "lfloor;", "lowast;", "loz;", "lrm;", "lsaquo;", "lsquo;", "lt;", "macr;", "mdash;", "micro;", "middot;", "minus;", "Mu;", "mu;", "nabla;", "nbsp;", "ndash;", "ne;", "ni;", "not;", "notin;", "nsub;", "Ntilde;", "ntilde;", "Nu;", "nu;", "Oacute;", "oacute;", "Ocirc;", "ocirc;", "OElig;", "oelig;", "Ograve;", "ograve;", "oline;", "Omega;", "omega;", "Omicron;", "omicron;", "oplus;", "or;", "ordf;", "ordm;", "Oslash;", "oslash;", "Otilde;", "otilde;", "otimes;", "Ouml;", "ouml;", "para;", "part;", "permil;", "perp;", "Phi;", "phi;", "Pi;", "pi;", "piv;", "plusmn;", "pound;", "Prime;", "prime;", "prod;", "prop;", "Psi;", "psi;", "quot;", "radic;", "rang;", "raquo;", "rArr;", "rarr;", "rceil;", "rdquo;", "real;", "reg;", "rfloor;", "Rho;", "rho;", "rlm;", "rsaquo;", "rsquo;", "sbquo;", "Scaron;", "scaron;", "sdot;", "sect;", "shy;", "Sigma;", "sigma;", "sigmaf;", "sim;", "spades;", "sub;", "sube;", "sum;", "sup;", "sup1;", "sup2;", "sup3;", "supe;", "szlig;", "Tau;", "tau;", "there4;", "Theta;", "theta;", "thetasym;", "thinsp;", "THORN;", "thorn;", "tilde;", "times;", "trade;", "Uacute;", "uacute;", "uArr;", "uarr;", "Ucirc;", "ucirc;", "Ugrave;", "ugrave;", "uml;", "upsih;", "Upsilon;", "upsilon;", "Uuml;", "uuml;", "weierp;", "Xi;", "xi;", "Yacute;", "yacute;", "yen;", "Yuml;", "yuml;", "Zeta;", "zeta;", "zwj;", "zwnj;"];
24320 return i.map(function (e) {
24321 return {
24322 caption: e,
24323 snippet: e,
24324 meta: "html entity",
24325 score: 1e6
24326 };
24327 });
24328 };
24329 }).call(h.prototype), t.HtmlCompletions = h;
24330 }), ace.define("ace/mode/html", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text", "ace/mode/javascript", "ace/mode/css", "ace/mode/html_highlight_rules", "ace/mode/behaviour/xml", "ace/mode/folding/html", "ace/mode/html_completions", "ace/worker/worker_client"], function (e, t, n) {
24331 "use strict";
24332
24333 var r = e("../lib/oop"),
24334 i = e("../lib/lang"),
24335 s = e("./text").Mode,
24336 o = e("./javascript").Mode,
24337 u = e("./css").Mode,
24338 a = e("./html_highlight_rules").HtmlHighlightRules,
24339 f = e("./behaviour/xml").XmlBehaviour,
24340 l = e("./folding/html").FoldMode,
24341 c = e("./html_completions").HtmlCompletions,
24342 h = e("../worker/worker_client").WorkerClient,
24343 p = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"],
24344 d = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"],
24345 v = function v(e) {
24346 this.fragmentContext = e && e.fragmentContext, this.HighlightRules = a, this.$behaviour = new f(), this.$completer = new c(), this.createModeDelegates({
24347 "js-": o,
24348 "css-": u
24349 }), this.foldingRules = new l(this.voidElements, i.arrayToMap(d));
24350 };
24351
24352 r.inherits(v, s), function () {
24353 this.blockComment = {
24354 start: "<!--",
24355 end: "-->"
24356 }, this.voidElements = i.arrayToMap(p), this.getNextLineIndent = function (e, t, n) {
24357 return this.$getIndent(t);
24358 }, this.checkOutdent = function (e, t, n) {
24359 return !1;
24360 }, this.getCompletions = function (e, t, n, r) {
24361 return this.$completer.getCompletions(e, t, n, r);
24362 }, this.createWorker = function (e) {
24363 if (this.constructor != v) return;
24364 var t = new h(["ace"], "ace/mode/html_worker", "Worker");
24365 return t.attachToDocument(e.getDocument()), this.fragmentContext && t.call("setOptions", [{
24366 context: this.fragmentContext
24367 }]), t.on("error", function (t) {
24368 e.setAnnotations(t.data);
24369 }), t.on("terminate", function () {
24370 e.clearAnnotations();
24371 }), t;
24372 }, this.$id = "ace/mode/html";
24373 }.call(v.prototype), t.Mode = v;
24374 });
24375
24376 (function () {
24377 ace.require(["ace/mode/html"], function (m) {
24378 if ((typeof module === "undefined" ? "undefined" : _typeof(module)) == "object" && (typeof exports === "undefined" ? "undefined" : _typeof(exports)) == "object" && module) {
24379 module.exports = m;
24380 }
24381 });
24382 })();
24383 function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
24384
24385 var aceSui = function () {
24386 ace.require(['ace/theme/sui'], function (m) {
24387 if ('object' == (typeof module === "undefined" ? "undefined" : _typeof(module)) && 'object' == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && module) {
24388 module.exports = m;
24389 }
24390 });
24391 }();
24392
24393 ace.define('ace/theme/sui', [], function (require, exports, module) {
24394 var dom = require('../lib/dom');
24395
24396 exports.isDark = false;
24397 exports.cssClass = 'ace-sui';
24398 exports.cssText = '.ace-sui {' + 'font-family: "Source Code Pro", "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace;' + 'line-height: 18px;' + '}' + '.ace-sui .ace_editor {' + 'border: 2px solid rgb(159, 159, 159);' + '}' + '.ace-sui .ace_editor.ace_focus {' + 'border: 2px solid #327FBD;' + '}' + '.ace-sui .ace_gutter {' + 'width: 30px;' + 'background: #666666;' + 'color: #FFFFFF;' + 'overflow: hidden;' + '}' + '.ace-sui .ace_gutter-layer {' + 'width: 100%;' + 'text-align: right;' + '}' + '.ace-sui .ace_gutter-layer .ace_gutter-cell {' + 'width: 30px;' + 'padding-right: 9px;' + 'padding-left: 3px;' + 'text-align: right;' + '}' + '.ace-sui .ace_print_margin {' + 'width: 1px;' + 'background: #E8E8E8;' + '}' + '.ace-sui .ace_scroller {' + 'background-color: #F2F2F2;' + '}' + '.ace-sui .ace_text-layer {' + 'cursor: text;' + 'color: #666666;' + '}' + '.ace-sui .ace_cursor {' + 'border-left: 2px solid #000000;' + '}' + '.ace-sui .ace_cursor.ace_overwrite {' + 'border-left: 0;' + 'border-bottom: 1px solid #000000;' + '}' + '.ace-sui .ace_marker-layer .ace_selection {' + 'background: rgba(130, 139, 201, 0.5);' + '}' + '.ace-sui .ace_marker-layer .ace_step {' + 'background: rgb(198, 219, 174);' + '}' + '.ace-sui .ace_marker-layer .ace_bracket {' + 'margin: 0;' + 'border: 1px solid rgba(147, 161, 161, 0.50);' + '}' + '.ace-sui .ace_marker-layer .ace_active_line {' + 'background: #EEE8D5;' + '}' + '.ace-sui .ace_invisible {' + 'color: rgba(147, 161, 161, 0.50);' + '}' + '.ace-sui .ace_keyword {' + 'color: #859900;' + '}' + '.ace-sui .ace_keyword.ace_operator {}' + '.ace-sui .ace_constant {}' + '.ace-sui .ace_constant.ace_language {' + 'color: #B58900;' + '}' + '.ace-sui .ace_constant.ace_library {}' + '.ace-sui .ace_constant.ace_numeric {' + 'color: #D33682;' + '}' + '.ace-sui .ace_invalid {}' + '.ace-sui .ace_invalid.ace_illegal {}' + '.ace-sui .ace_invalid.ace_deprecated {}' + '.ace-sui .ace_support {}' + '.ace-sui .ace_support.ace_function {' + 'color: #268BD2;' + '}' + '.ace-sui .ace_function.ace_buildin {}' + '.ace-sui .ace_string {' + 'color: #2AA198;' + '}' + '.ace-sui .ace_string.ace_regexp {' + 'color: #D30102;' + '}' + '.ace-sui .ace_comment {' + 'color: #93A1A1;' + '}' + '.ace-sui .ace_comment.ace_doc {}' + '.ace-sui .ace_comment.ace_doc.ace_tag {}' + '.ace-sui .ace_variable {}' + '.ace-sui .ace_variable.ace_language {' + 'color: #268BD2;' + '}' + '.ace-sui .ace_xml_pe {}' + '.ace-sui .ace_collab.ace_user1 {}';
24399 dom.importCssString(exports.cssText, exports.cssClass);
24400 });