UNPKG

ace-builds

Version:
1,383 lines (1,318 loc) 899 kB
/* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * * Copyright (c) 2010, Ajax.org B.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ***** END LICENSE BLOCK ***** */ /** * Define a module along with a payload * @param module a name for the payload * @param payload a function to call with (require, exports, module) params */ (function() { var ACE_NAMESPACE = ""; var global = (function() { return this; })(); if (!global && typeof window != "undefined") global = window; // strict mode if (!ACE_NAMESPACE && typeof requirejs !== "undefined") return; var define = function(module, deps, payload) { if (typeof module !== "string") { if (define.original) define.original.apply(this, arguments); else { console.error("dropping module because define wasn\'t a string."); console.trace(); } return; } if (arguments.length == 2) payload = deps; if (!define.modules[module]) { define.payloads[module] = payload; define.modules[module] = null; } }; define.modules = {}; define.payloads = {}; /** * Get at functionality define()ed using the function above */ var _require = function(parentId, module, callback) { if (typeof module === "string") { var payload = lookup(parentId, module); if (payload != undefined) { callback && callback(); return payload; } } else if (Object.prototype.toString.call(module) === "[object Array]") { var params = []; for (var i = 0, l = module.length; i < l; ++i) { var dep = lookup(parentId, module[i]); if (dep == undefined && require.original) return; params.push(dep); } return callback && callback.apply(null, params) || true; } }; var require = function(module, callback) { var packagedModule = _require("", module, callback); if (packagedModule == undefined && require.original) return require.original.apply(this, arguments); return packagedModule; }; var normalizeModule = function(parentId, moduleName) { // normalize plugin requires if (moduleName.indexOf("!") !== -1) { var chunks = moduleName.split("!"); return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); } // normalize relative requires if (moduleName.charAt(0) == ".") { var base = parentId.split("/").slice(0, -1).join("/"); moduleName = base + "/" + moduleName; while(moduleName.indexOf(".") !== -1 && previous != moduleName) { var previous = moduleName; moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); } } return moduleName; }; /** * Internal function to lookup moduleNames and resolve them by calling the * definition function if needed. */ var lookup = function(parentId, moduleName) { moduleName = normalizeModule(parentId, moduleName); var module = define.modules[moduleName]; if (!module) { module = define.payloads[moduleName]; if (typeof module === 'function') { var exports = {}; var mod = { id: moduleName, uri: '', exports: exports, packaged: true }; var req = function(module, callback) { return _require(moduleName, module, callback); }; var returnValue = module(req, exports, mod); exports = returnValue || mod.exports; define.modules[moduleName] = exports; delete define.payloads[moduleName]; } module = define.modules[moduleName] = exports || module; } return module; }; function exportAce(ns) { var root = global; if (ns) { if (!global[ns]) global[ns] = {}; root = global[ns]; } if (!root.define || !root.define.packaged) { define.original = root.define; root.define = define; root.define.packaged = true; } if (!root.require || !root.require.packaged) { require.original = root.require; root.require = require; root.require.packaged = true; } } exportAce(ACE_NAMESPACE); })(); define("ace/lib/es6-shim",["require","exports","module"], function(require, exports, module){function defineProp(obj, name, val) { Object.defineProperty(obj, name, { value: val, enumerable: false, writable: true, configurable: true }); } if (!String.prototype.startsWith) { defineProp(String.prototype, "startsWith", function (searchString, position) { position = position || 0; return this.lastIndexOf(searchString, position) === position; }); } if (!String.prototype.endsWith) { defineProp(String.prototype, "endsWith", function (searchString, position) { var subjectString = this; if (position === undefined || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }); } if (!String.prototype.repeat) { defineProp(String.prototype, "repeat", function (count) { var result = ""; var string = this; while (count > 0) { if (count & 1) result += string; if ((count >>= 1)) string += string; } return result; }); } if (!String.prototype.includes) { defineProp(String.prototype, "includes", function (str, position) { return this.indexOf(str, position) != -1; }); } if (!Object.assign) { Object.assign = function (target) { if (target === undefined || target === null) { throw new TypeError("Cannot convert undefined or null to object"); } var output = Object(target); for (var index = 1; index < arguments.length; index++) { var source = arguments[index]; if (source !== undefined && source !== null) { Object.keys(source).forEach(function (key) { output[key] = source[key]; }); } } return output; }; } if (!Object.values) { Object.values = function (o) { return Object.keys(o).map(function (k) { return o[k]; }); }; } if (!Array.prototype.find) { defineProp(Array.prototype, "find", function (predicate) { var len = this.length; var thisArg = arguments[1]; for (var k = 0; k < len; k++) { var kValue = this[k]; if (predicate.call(thisArg, kValue, k, this)) { return kValue; } } }); } if (!Array.prototype.findIndex) { defineProp(Array.prototype, "findIndex", function (predicate) { var len = this.length; var thisArg = arguments[1]; for (var k = 0; k < len; k++) { var kValue = this[k]; if (predicate.call(thisArg, kValue, k, this)) { return k; } } }); } if (!Array.prototype.includes) { defineProp(Array.prototype, "includes", function (item, position) { return this.indexOf(item, position) != -1; }); } if (!Array.prototype.fill) { defineProp(Array.prototype, "fill", function (value) { var O = this; var len = O.length >>> 0; var start = arguments[1]; var relativeStart = start >> 0; var k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len); var end = arguments[2]; var relativeEnd = end === undefined ? len : end >> 0; var final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len); while (k < final) { O[k] = value; k++; } return O; }); } if (!Array.of) { defineProp(Array, "of", function () { return Array.prototype.slice.call(arguments); }); } }); define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"], function(require, exports, module){// vim:set ts=4 sts=4 sw=4 st: "use strict"; require("./es6-shim"); }); define("ace/lib/deep_copy",["require","exports","module"], function(require, exports, module){exports.deepCopy = function deepCopy(obj) { if (typeof obj !== "object" || !obj) return obj; var copy; if (Array.isArray(obj)) { copy = []; for (var key = 0; key < obj.length; key++) { copy[key] = deepCopy(obj[key]); } return copy; } if (Object.prototype.toString.call(obj) !== "[object Object]") return obj; copy = {}; for (var key in obj) copy[key] = deepCopy(obj[key]); return copy; }; }); define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"], function(require, exports, module){"use strict"; exports.last = function (a) { return a[a.length - 1]; }; exports.stringReverse = function (string) { return string.split("").reverse().join(""); }; exports.stringRepeat = function (string, count) { var result = ''; while (count > 0) { if (count & 1) result += string; if (count >>= 1) string += string; } return result; }; var trimBeginRegexp = /^\s\s*/; var trimEndRegexp = /\s\s*$/; exports.stringTrimLeft = function (string) { return string.replace(trimBeginRegexp, ''); }; exports.stringTrimRight = function (string) { return string.replace(trimEndRegexp, ''); }; exports.copyObject = function (obj) { var copy = {}; for (var key in obj) { copy[key] = obj[key]; } return copy; }; exports.copyArray = function (array) { var copy = []; for (var i = 0, l = array.length; i < l; i++) { if (array[i] && typeof array[i] == "object") copy[i] = this.copyObject(array[i]); else copy[i] = array[i]; } return copy; }; exports.deepCopy = require("./deep_copy").deepCopy; exports.arrayToMap = function (arr) { var map = {}; for (var i = 0; i < arr.length; i++) { map[arr[i]] = 1; } return map; }; exports.createMap = function (props) { var map = Object.create(null); for (var i in props) { map[i] = props[i]; } return map; }; exports.arrayRemove = function (array, value) { for (var i = 0; i <= array.length; i++) { if (value === array[i]) { array.splice(i, 1); } } }; exports.escapeRegExp = function (str) { return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); }; exports.escapeHTML = function (str) { return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;"); }; exports.getMatchOffsets = function (string, regExp) { var matches = []; string.replace(regExp, function (str) { matches.push({ offset: arguments[arguments.length - 2], length: str.length }); }); return matches; }; exports.deferredCall = function (fcn) { var timer = null; var callback = function () { timer = null; fcn(); }; var deferred = function (timeout) { deferred.cancel(); timer = setTimeout(callback, timeout || 0); return deferred; }; deferred.schedule = deferred; deferred.call = function () { this.cancel(); fcn(); return deferred; }; deferred.cancel = function () { clearTimeout(timer); timer = null; return deferred; }; deferred.isPending = function () { return timer; }; return deferred; }; exports.delayedCall = function (fcn, defaultTimeout) { var timer = null; var callback = function () { timer = null; fcn(); }; var _self = function (timeout) { if (timer == null) timer = setTimeout(callback, timeout || defaultTimeout); }; _self.delay = function (timeout) { timer && clearTimeout(timer); timer = setTimeout(callback, timeout || defaultTimeout); }; _self.schedule = _self; _self.call = function () { this.cancel(); fcn(); }; _self.cancel = function () { timer && clearTimeout(timer); timer = null; }; _self.isPending = function () { return timer; }; return _self; }; exports.supportsLookbehind = function () { try { new RegExp('(?<=.)'); } catch (e) { return false; } return true; }; exports.skipEmptyMatch = function (line, last, supportsUnicodeFlag) { return supportsUnicodeFlag && line.codePointAt(last) > 0xffff ? 2 : 1; }; }); define("ace/lib/useragent",["require","exports","module"], function(require, exports, module){"use strict"; exports.OS = { LINUX: "LINUX", MAC: "MAC", WINDOWS: "WINDOWS" }; exports.getOS = function () { if (exports.isMac) { return exports.OS.MAC; } else if (exports.isLinux) { return exports.OS.LINUX; } else { return exports.OS.WINDOWS; } }; var _navigator = typeof navigator == "object" ? navigator : {}; var os = (/mac|win|linux/i.exec(_navigator.platform) || ["other"])[0].toLowerCase(); var ua = _navigator.userAgent || ""; var appName = _navigator.appName || ""; exports.isWin = (os == "win"); exports.isMac = (os == "mac"); exports.isLinux = (os == "linux"); exports.isIE = (appName == "Microsoft Internet Explorer" || appName.indexOf("MSAppHost") >= 0) ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]) : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]); // for ie exports.isOldIE = exports.isIE && exports.isIE < 9; exports.isGecko = exports.isMozilla = ua.match(/ Gecko\/\d+/); exports.isOpera = typeof opera == "object" && Object.prototype.toString.call(window["opera"]) == "[object Opera]"; exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; exports.isSafari = parseFloat(ua.split(" Safari/")[1]) && !exports.isChrome || undefined; exports.isEdge = parseFloat(ua.split(" Edge/")[1]) || undefined; exports.isAIR = ua.indexOf("AdobeAIR") >= 0; exports.isAndroid = ua.indexOf("Android") >= 0; exports.isChromeOS = ua.indexOf(" CrOS ") >= 0; exports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window["MSStream"]; if (exports.isIOS) exports.isMac = true; exports.isMobile = exports.isIOS || exports.isAndroid; }); define("ace/lib/dom",["require","exports","module","ace/lib/useragent"], function(require, exports, module){"use strict"; var useragent = require("./useragent"); var XHTML_NS = "http://www.w3.org/1999/xhtml"; exports.buildDom = function buildDom(arr, parent, refs) { if (typeof arr == "string" && arr) { var txt = document.createTextNode(arr); if (parent) parent.appendChild(txt); return txt; } if (!Array.isArray(arr)) { if (arr && arr.appendChild && parent) parent.appendChild(arr); return arr; } if (typeof arr[0] != "string" || !arr[0]) { var els = []; for (var i = 0; i < arr.length; i++) { var ch = buildDom(arr[i], parent, refs); ch && els.push(ch); } return els; } var el = document.createElement(arr[0]); var options = arr[1]; var childIndex = 1; if (options && typeof options == "object" && !Array.isArray(options)) childIndex = 2; for (var i = childIndex; i < arr.length; i++) buildDom(arr[i], el, refs); if (childIndex == 2) { Object.keys(options).forEach(function (n) { var val = options[n]; if (n === "class") { el.className = Array.isArray(val) ? val.join(" ") : val; } else if (typeof val == "function" || n == "value" || n[0] == "$") { el[n] = val; } else if (n === "ref") { if (refs) refs[val] = el; } else if (n === "style") { if (typeof val == "string") el.style.cssText = val; } else if (val != null) { el.setAttribute(n, val); } }); } if (parent) parent.appendChild(el); return el; }; exports.getDocumentHead = function (doc) { if (!doc) doc = document; return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; }; exports.createElement = function (tag, ns) { return document.createElementNS ? document.createElementNS(ns || XHTML_NS, tag) : document.createElement(tag); }; exports.removeChildren = function (element) { element.innerHTML = ""; }; exports.createTextNode = function (textContent, element) { var doc = element ? element.ownerDocument : document; return doc.createTextNode(textContent); }; exports.createFragment = function (element) { var doc = element ? element.ownerDocument : document; return doc.createDocumentFragment(); }; exports.hasCssClass = function (el, name) { var classes = (el.className + "").split(/\s+/g); return classes.indexOf(name) !== -1; }; exports.addCssClass = function (el, name) { if (!exports.hasCssClass(el, name)) { el.className += " " + name; } }; exports.removeCssClass = function (el, name) { var classes = el.className.split(/\s+/g); while (true) { var index = classes.indexOf(name); if (index == -1) { break; } classes.splice(index, 1); } el.className = classes.join(" "); }; exports.toggleCssClass = function (el, name) { var classes = el.className.split(/\s+/g), add = true; while (true) { var index = classes.indexOf(name); if (index == -1) { break; } add = false; classes.splice(index, 1); } if (add) classes.push(name); el.className = classes.join(" "); return add; }; exports.setCssClass = function (node, className, include) { if (include) { exports.addCssClass(node, className); } else { exports.removeCssClass(node, className); } }; exports.hasCssString = function (id, doc) { var index = 0, sheets; doc = doc || document; if ((sheets = doc.querySelectorAll("style"))) { while (index < sheets.length) { if (sheets[index++].id === id) { return true; } } } }; exports.removeElementById = function (id, doc) { doc = doc || document; if (doc.getElementById(id)) { doc.getElementById(id).remove(); } }; var strictCSP; var cssCache = []; exports.useStrictCSP = function (value) { strictCSP = value; if (value == false) insertPendingStyles(); else if (!cssCache) cssCache = []; }; function insertPendingStyles() { var cache = cssCache; cssCache = null; cache && cache.forEach(function (item) { importCssString(item[0], item[1]); }); } function importCssString(cssText, id, target) { if (typeof document == "undefined") return; if (cssCache) { if (target) { insertPendingStyles(); } else if (target === false) { return cssCache.push([cssText, id]); } } if (strictCSP) return; var container = target; if (!target || !target.getRootNode) { container = document; } else { container = target.getRootNode(); if (!container || container == target) container = document; } var doc = container.ownerDocument || container; if (id && exports.hasCssString(id, container)) return null; if (id) cssText += "\n/*# sourceURL=ace/css/" + id + " */"; var style = exports.createElement("style"); style.appendChild(doc.createTextNode(cssText)); if (id) style.id = id; if (container == doc) container = exports.getDocumentHead(doc); container.insertBefore(style, container.firstChild); } exports.importCssString = importCssString; exports.importCssStylsheet = function (uri, doc) { exports.buildDom(["link", { rel: "stylesheet", href: uri }], exports.getDocumentHead(doc)); }; exports.scrollbarWidth = function (doc) { var inner = exports.createElement("ace_inner"); inner.style.width = "100%"; inner.style.minWidth = "0px"; inner.style.height = "200px"; inner.style.display = "block"; var outer = exports.createElement("ace_outer"); var style = outer.style; style.position = "absolute"; style.left = "-10000px"; style.overflow = "hidden"; style.width = "200px"; style.minWidth = "0px"; style.height = "150px"; style.display = "block"; outer.appendChild(inner); var body = (doc && doc.documentElement) || (document && document.documentElement); if (!body) return 0; body.appendChild(outer); var noScrollbar = inner.offsetWidth; style.overflow = "scroll"; var withScrollbar = inner.offsetWidth; if (noScrollbar === withScrollbar) { withScrollbar = outer.clientWidth; } body.removeChild(outer); return noScrollbar - withScrollbar; }; exports.computedStyle = function (element, style) { return window.getComputedStyle(element, "") || {}; }; exports.setStyle = function (styles, property, value) { if (styles[property] !== value) { styles[property] = value; } }; exports.HAS_CSS_ANIMATION = false; exports.HAS_CSS_TRANSFORMS = false; exports.HI_DPI = useragent.isWin ? typeof window !== "undefined" && window.devicePixelRatio >= 1.5 : true; if (useragent.isChromeOS) exports.HI_DPI = false; if (typeof document !== "undefined") { var div = document.createElement("div"); if (exports.HI_DPI && div.style.transform !== undefined) exports.HAS_CSS_TRANSFORMS = true; if (!useragent.isEdge && typeof div.style.animationName !== "undefined") exports.HAS_CSS_ANIMATION = true; div = null; } if (exports.HAS_CSS_TRANSFORMS) { exports.translate = function (element, tx, ty) { element.style.transform = "translate(" + Math.round(tx) + "px, " + Math.round(ty) + "px)"; }; } else { exports.translate = function (element, tx, ty) { element.style.top = Math.round(ty) + "px"; element.style.left = Math.round(tx) + "px"; }; } }); define("ace/lib/net",["require","exports","module","ace/lib/dom"], function(require, exports, module){/* * based on code from: * * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ "use strict"; var dom = require("./dom"); exports.get = function (url, callback) { var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { callback(xhr.responseText); } }; xhr.send(null); }; exports.loadScript = function (path, callback) { var head = dom.getDocumentHead(); var s = document.createElement('script'); s.src = path; head.appendChild(s); s.onload = s.onreadystatechange = function (_, isAbort) { if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { s = s.onload = s.onreadystatechange = null; if (!isAbort) callback(); } }; }; exports.qualifyURL = function (url) { var a = document.createElement('a'); a.href = url; return a.href; }; }); define("ace/lib/oop",["require","exports","module"], function(require, exports, module){"use strict"; exports.inherits = function (ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; exports.mixin = function (obj, mixin) { for (var key in mixin) { obj[key] = mixin[key]; } return obj; }; exports.implement = function (proto, mixin) { exports.mixin(proto, mixin); }; }); define("ace/lib/event_emitter",["require","exports","module"], function(require, exports, module){"use strict"; var EventEmitter = {}; var stopPropagation = function () { this.propagationStopped = true; }; var preventDefault = function () { this.defaultPrevented = true; }; EventEmitter._emit = EventEmitter._dispatchEvent = function (eventName, e) { this._eventRegistry || (this._eventRegistry = {}); this._defaultHandlers || (this._defaultHandlers = {}); var listeners = this._eventRegistry[eventName] || []; var defaultHandler = this._defaultHandlers[eventName]; if (!listeners.length && !defaultHandler) return; if (typeof e != "object" || !e) e = {}; if (!e.type) e.type = eventName; if (!e.stopPropagation) e.stopPropagation = stopPropagation; if (!e.preventDefault) e.preventDefault = preventDefault; listeners = listeners.slice(); for (var i = 0; i < listeners.length; i++) { listeners[i](e, this); if (e.propagationStopped) break; } if (defaultHandler && !e.defaultPrevented) return defaultHandler(e, this); }; EventEmitter._signal = function (eventName, e) { var listeners = (this._eventRegistry || {})[eventName]; if (!listeners) return; listeners = listeners.slice(); for (var i = 0; i < listeners.length; i++) listeners[i](e, this); }; EventEmitter.once = function (eventName, callback) { var _self = this; this.on(eventName, function newCallback() { _self.off(eventName, newCallback); callback.apply(null, arguments); }); if (!callback) { return new Promise(function (resolve) { callback = resolve; }); } }; EventEmitter.setDefaultHandler = function (eventName, callback) { var handlers = this._defaultHandlers; if (!handlers) handlers = this._defaultHandlers = { _disabled_: {} }; if (handlers[eventName]) { var old = handlers[eventName]; var disabled = handlers._disabled_[eventName]; if (!disabled) handlers._disabled_[eventName] = disabled = []; disabled.push(old); var i = disabled.indexOf(callback); if (i != -1) disabled.splice(i, 1); } handlers[eventName] = callback; }; EventEmitter.removeDefaultHandler = function (eventName, callback) { var handlers = this._defaultHandlers; if (!handlers) return; var disabled = handlers._disabled_[eventName]; if (handlers[eventName] == callback) { if (disabled) this.setDefaultHandler(eventName, disabled.pop()); } else if (disabled) { var i = disabled.indexOf(callback); if (i != -1) disabled.splice(i, 1); } }; EventEmitter.on = EventEmitter.addEventListener = function (eventName, callback, capturing) { this._eventRegistry = this._eventRegistry || {}; var listeners = this._eventRegistry[eventName]; if (!listeners) listeners = this._eventRegistry[eventName] = []; if (listeners.indexOf(callback) == -1) listeners[capturing ? "unshift" : "push"](callback); return callback; }; EventEmitter.off = EventEmitter.removeListener = EventEmitter.removeEventListener = function (eventName, callback) { this._eventRegistry = this._eventRegistry || {}; var listeners = this._eventRegistry[eventName]; if (!listeners) return; var index = listeners.indexOf(callback); if (index !== -1) listeners.splice(index, 1); }; EventEmitter.removeAllListeners = function (eventName) { if (!eventName) this._eventRegistry = this._defaultHandlers = undefined; if (this._eventRegistry) this._eventRegistry[eventName] = undefined; if (this._defaultHandlers) this._defaultHandlers[eventName] = undefined; }; exports.EventEmitter = EventEmitter; }); define("ace/lib/report_error",["require","exports","module"], function(require, exports, module){exports.reportError = function reportError(msg, data) { var e = new Error(msg); e["data"] = data; if (typeof console == "object" && console.error) console.error(e); setTimeout(function () { throw e; }); }; }); define("ace/lib/default_english_messages",["require","exports","module"], function(require, exports, module){var defaultEnglishMessages = { "autocomplete.popup.aria-roledescription": "Autocomplete suggestions", "autocomplete.popup.aria-label": "Autocomplete suggestions", "autocomplete.popup.item.aria-roledescription": "item", "autocomplete.loading": "Loading...", "editor.scroller.aria-roledescription": "editor", "editor.scroller.aria-label": "Editor content, press Enter to start editing, press Escape to exit", "editor.gutter.aria-roledescription": "editor gutter", "editor.gutter.aria-label": "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit", "error-marker.good-state": "Looks good!", "prompt.recently-used": "Recently used", "prompt.other-commands": "Other commands", "prompt.no-matching-commands": "No matching commands", "search-box.find.placeholder": "Search for", "search-box.find-all.text": "All", "search-box.replace.placeholder": "Replace with", "search-box.replace-next.text": "Replace", "search-box.replace-all.text": "All", "search-box.toggle-replace.title": "Toggle Replace mode", "search-box.toggle-regexp.title": "RegExp Search", "search-box.toggle-case.title": "CaseSensitive Search", "search-box.toggle-whole-word.title": "Whole Word Search", "search-box.toggle-in-selection.title": "Search In Selection", "search-box.search-counter": "$0 of $1", "text-input.aria-roledescription": "editor", "text-input.aria-label": "Cursor at row $0", "gutter.code-folding.range.aria-label": "Toggle code folding, rows $0 through $1", "gutter.code-folding.closed.aria-label": "Toggle code folding, rows $0 through $1", "gutter.code-folding.open.aria-label": "Toggle code folding, row $0", "gutter.code-folding.closed.title": "Unfold code", "gutter.code-folding.open.title": "Fold code", "gutter.annotation.aria-label.error": "Error, read annotations row $0", "gutter.annotation.aria-label.warning": "Warning, read annotations row $0", "gutter.annotation.aria-label.info": "Info, read annotations row $0", "inline-fold.closed.title": "Unfold code", "gutter-tooltip.aria-label.error.singular": "error", "gutter-tooltip.aria-label.error.plural": "errors", "gutter-tooltip.aria-label.warning.singular": "warning", "gutter-tooltip.aria-label.warning.plural": "warnings", "gutter-tooltip.aria-label.info.singular": "information message", "gutter-tooltip.aria-label.info.plural": "information messages", "gutter.annotation.aria-label.security": "Security finding, read annotations row $0", "gutter.annotation.aria-label.hint": "Suggestion, read annotations row $0", "gutter-tooltip.aria-label.security.singular": "security finding", "gutter-tooltip.aria-label.security.plural": "security findings", "gutter-tooltip.aria-label.hint.singular": "suggestion", "gutter-tooltip.aria-label.hint.plural": "suggestions", "editor.tooltip.disable-editing": "Editing is disabled" }; exports.defaultEnglishMessages = defaultEnglishMessages; }); define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"], function(require, exports, module){"no use strict"; var oop = require("./oop"); var EventEmitter = require("./event_emitter").EventEmitter; var reportError = require("./report_error").reportError; var defaultEnglishMessages = require("./default_english_messages").defaultEnglishMessages; var optionsProvider = { setOptions: function (optList) { Object.keys(optList).forEach(function (key) { this.setOption(key, optList[key]); }, this); }, getOptions: function (optionNames) { var result = {}; if (!optionNames) { var options = this.$options; optionNames = Object.keys(options).filter(function (key) { return !options[key].hidden; }); } else if (!Array.isArray(optionNames)) { result = optionNames; optionNames = Object.keys(result); } optionNames.forEach(function (key) { result[key] = this.getOption(key); }, this); return result; }, setOption: function (name, value) { if (this["$" + name] === value) return; var opt = this.$options[name]; if (!opt) { return warn('misspelled option "' + name + '"'); } if (opt.forwardTo) return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value); if (!opt.handlesSet) this["$" + name] = value; if (opt && opt.set) opt.set.call(this, value); }, getOption: function (name) { var opt = this.$options[name]; if (!opt) { return warn('misspelled option "' + name + '"'); } if (opt.forwardTo) return this[opt.forwardTo] && this[opt.forwardTo].getOption(name); return opt && opt.get ? opt.get.call(this) : this["$" + name]; } }; function warn(message) { if (typeof console != "undefined" && console.warn) console.warn.apply(console, arguments); } var messages; var nlsPlaceholders; var AppConfig = /** @class */ (function () { function AppConfig() { this.$defaultOptions = {}; messages = defaultEnglishMessages; nlsPlaceholders = "dollarSigns"; } AppConfig.prototype.defineOptions = function (obj, path, options) { if (!obj.$options) this.$defaultOptions[path] = obj.$options = {}; Object.keys(options).forEach(function (key) { var opt = options[key]; if (typeof opt == "string") opt = { forwardTo: opt }; opt.name || (opt.name = key); obj.$options[opt.name] = opt; if ("initialValue" in opt) obj["$" + opt.name] = opt.initialValue; }); oop.implement(obj, optionsProvider); return this; }; AppConfig.prototype.resetOptions = function (obj) { Object.keys(obj.$options).forEach(function (key) { var opt = obj.$options[key]; if ("value" in opt) obj.setOption(key, opt.value); }); }; AppConfig.prototype.setDefaultValue = function (path, name, value) { if (!path) { for (path in this.$defaultOptions) if (this.$defaultOptions[path][name]) break; if (!this.$defaultOptions[path][name]) return false; } var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {}); if (opts[name]) { if (opts.forwardTo) this.setDefaultValue(opts.forwardTo, name, value); else opts[name].value = value; } }; AppConfig.prototype.setDefaultValues = function (path, optionHash) { Object.keys(optionHash).forEach(function (key) { this.setDefaultValue(path, key, optionHash[key]); }, this); }; AppConfig.prototype.setMessages = function (value, options) { messages = value; if (options && options.placeholders) { nlsPlaceholders = options.placeholders; } }; AppConfig.prototype.nls = function (key, defaultString, params) { if (!messages[key]) { warn("No message found for the key '" + key + "' in messages with id " + messages.$id + ", trying to find a translation for the default string '" + defaultString + "'."); if (!messages[defaultString]) { warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message."); } } var translated = messages[key] || messages[defaultString] || defaultString; if (params) { if (nlsPlaceholders === "dollarSigns") { translated = translated.replace(/\$(\$|[\d]+)/g, function (_, dollarMatch) { if (dollarMatch == "$") return "$"; return params[dollarMatch]; }); } if (nlsPlaceholders === "curlyBrackets") { translated = translated.replace(/\{([^\}]+)\}/g, function (_, curlyBracketMatch) { return params[curlyBracketMatch]; }); } } return translated; }; return AppConfig; }()); AppConfig.prototype.warn = warn; AppConfig.prototype.reportError = reportError; oop.implement(AppConfig.prototype, EventEmitter); exports.AppConfig = AppConfig; }); define("ace/theme/textmate-css",["require","exports","module"], function(require, exports, module){module.exports = ".ace-tm .ace_gutter {\n background: #f0f0f0;\n color: #333;\n}\n\n.ace-tm .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n background-color: #6B72E6;\n}\n\n.ace-tm {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-tm .ace_cursor {\n color: black;\n}\n \n.ace-tm .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_constant {\n color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n background-color: rgba(255, 0, 0, 0.1);\n color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\") right repeat-y;\n}\n"; }); define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"], function(require, exports, module){"use strict"; exports.isDark = false; exports.cssClass = "ace-tm"; exports.cssText = require("./textmate-css"); exports.$id = "ace/theme/textmate"; var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass, false); }); define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"], function(require, exports, module){"no use strict"; var lang = require("./lib/lang"); var net = require("./lib/net"); var dom = require("./lib/dom"); var AppConfig = require("./lib/app_config").AppConfig; module.exports = exports = new AppConfig(); var options = { packaged: false, workerPath: null, modePath: null, themePath: null, basePath: "", suffix: ".js", $moduleUrls: {}, loadWorkerFromBlob: true, sharedPopups: false, useStrictCSP: null }; exports.get = function (key) { if (!options.hasOwnProperty(key)) throw new Error("Unknown config key: " + key); return options[key]; }; exports.set = function (key, value) { if (options.hasOwnProperty(key)) options[key] = value; else if (this.setDefaultValue("", key, value) == false) throw new Error("Unknown config key: " + key); if (key == "useStrictCSP") dom.useStrictCSP(value); }; exports.all = function () { return lang.copyObject(options); }; exports.$modes = {}; exports.moduleUrl = function (name, component) { if (options.$moduleUrls[name]) return options.$moduleUrls[name]; var parts = name.split("/"); component = component || parts[parts.length - 2] || ""; var sep = component == "snippets" ? "/" : "-"; var base = parts[parts.length - 1]; if (component == "worker" && sep == "-") { var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); base = base.replace(re, ""); } if ((!base || base == component) && parts.length > 1) base = parts[parts.length - 2]; var path = options[component + "Path"]; if (path == null) { path = options.basePath; } else if (sep == "/") { component = sep = ""; } if (path && path.slice(-1) != "/") path += "/"; return path + component + sep + base + this.get("suffix"); }; exports.setModuleUrl = function (name, subst) { return options.$moduleUrls[name] = subst; }; var loader = function (moduleName, cb) { if (moduleName === "ace/theme/textmate" || moduleName === "./theme/textmate") return cb(null, require("./theme/textmate")); if (customLoader) return customLoader(moduleName, cb); console.error("loader is not configured"); }; var customLoader; exports.setLoader = function (cb) { customLoader = cb; }; exports.dynamicModules = Object.create(null); exports.$loading = {}; exports.$loaded = {}; exports.loadModule = function (moduleId, onLoad) { var loadedModule; if (Array.isArray(moduleId)) { var moduleType = moduleId[0]; var moduleName = moduleId[1]; } else if (typeof moduleId == "string") { var moduleName = moduleId; } var load = function (module) { if (module && !exports.$loading[moduleName]) return onLoad && onLoad(module); if (!exports.$loading[moduleName]) exports.$loading[moduleName] = []; exports.$loading[moduleName].push(onLoad); if (exports.$loading[moduleName].length > 1) return; var afterLoad = function () { loader(moduleName, function (err, module) { if (module) exports.$loaded[moduleName] = module; exports._emit("load.module", { name: moduleName, module: module }); var listeners = exports.$loading[moduleName]; exports.$loading[moduleName] = null; listeners.forEach(function (onLoad) { onLoad && onLoad(module); }); }); }; if (!exports.get("packaged")) return afterLoad(); net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); reportErrorIfPathIsNotConfigured(); }; if (exports.dynamicModules[moduleName]) { exports.dynamicModules[moduleName]().then(function (module) { if (module.default) { load(module.default); } else { load(module); } }); } else { try { loadedModule = this.$require(moduleName); } catch (e) { } load(loadedModule || exports.$loaded[moduleName]); } }; exports.$require = function (moduleName) { if (typeof module["require"] == "function") { var req = "require"; return module[req](moduleName); } }; exports.setModuleLoader = function (moduleName, onLoad) { exports.dynamicModules[moduleName] = onLoad; }; var reportErrorIfPathIsNotConfigured = function () { if (!options.basePath && !options.workerPath && !options.modePath && !options.themePath && !Object.keys(options.$moduleUrls).length) { console.error("Unable to infer path to ace from script src,", "use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes", "or with webpack use ace/webpack-resolver"); reportErrorIfPathIsNotConfigured = function () { }; } }; exports.version = "1.40.1"; }); define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"], function(require, exports, module) { "use strict"; require("./lib/fixoldbrowsers"); var config = require("./config"); config.setLoader(function(moduleName, cb) { require([moduleName], function(module) { cb(null, module); }); }); var global = (function() { return this || typeof window != "undefined" && window; })(); module.exports = function(ace) { config.init = init; config.$require = require; ace.require = require; if (typeof define === "function") ace.define = define; }; init(true);function init(packaged) { if (!global || !global.document) return; config.set("packaged", packaged || require.packaged || module.packaged || (global.define && define.packaged)); var scriptOptions = {}; var scriptUrl = ""; var currentScript = (document.currentScript || document._currentScript ); // native or polyfill var currentDocument = currentScript && currentScript.ownerDocument || document; if (currentScript && currentScript.src) { scriptUrl = currentScript.src.split(/[?#]/)[0].split("/").slice(0, -1).join("/") || ""; } var scripts = currentDocument.getElementsByTagName("script"); for (var i=0; i<scripts.length; i++) { var script = scripts[i]; var src = script.src || script.getAttribute("src"); if (!src) continue; var attributes = script.attributes; for (var j=0, l=attributes.length; j < l; j++) { var attr = attributes[j]; if (attr.name.indexOf("data-ace-") === 0) { scriptOptions[deHyphenate(attr.name.replace(/^data-ace-/, ""))] = attr.value; } } var m = src.match(/^(.*