diff --git a/Gruntfile.js b/Gruntfile.js
index ab1c4f2c..dc194a6a 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -21,6 +21,7 @@ module.exports = function(grunt) {
out: "res-min/main.js",
mainConfigFile: 'res/main.js',
optimize: "uglify2",
+ inlineText: true,
uglify2: {
output: {
beautify: true,
diff --git a/bower.json b/bower.json
index a390fe4c..a62b8539 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "stackedit",
- "version": "2.0.3",
+ "version": "2.1.0",
"description": "StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.",
"dependencies": {
"bootstrap": "3.0.0",
diff --git a/cache.manifest b/cache.manifest
index 95a23d0c..f37dc56f 100644
--- a/cache.manifest
+++ b/cache.manifest
@@ -1,5 +1,5 @@
CACHE MANIFEST
-#Date Sat Sep 07 2013 23:38:12
+#Date Sat Sep 14 2013 17:58:48
CACHE:
index.html
diff --git a/package.json b/package.json
index 990f0559..ccae1c78 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stackedit",
- "version": "2.0.3",
+ "version": "2.1.0",
"description": "StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.",
"main": "res/main.js",
"directories": {
diff --git a/res-min/font/fontello.eot b/res-min/font/fontello.eot
index 8e34d484..833234c0 100644
Binary files a/res-min/font/fontello.eot and b/res-min/font/fontello.eot differ
diff --git a/res-min/font/fontello.svg b/res-min/font/fontello.svg
index 6f46b053..b4b37e74 100644
--- a/res-min/font/fontello.svg
+++ b/res-min/font/fontello.svg
@@ -186,7 +186,7 @@
-
+
@@ -286,7 +286,7 @@
-
+
diff --git a/res-min/font/fontello.ttf b/res-min/font/fontello.ttf
index 5a8e1716..285230a7 100644
Binary files a/res-min/font/fontello.ttf and b/res-min/font/fontello.ttf differ
diff --git a/res-min/font/fontello.woff b/res-min/font/fontello.woff
index 246f7c7b..0237315e 100644
Binary files a/res-min/font/fontello.woff and b/res-min/font/fontello.woff differ
diff --git a/res-min/main.js b/res-min/main.js
index cb566e3b..73a0c035 100644
--- a/res-min/main.js
+++ b/res-min/main.js
@@ -34,6 +34,184 @@
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+/*
+ * Based on code from:
+ *
+ * XRegExp 1.5.0
+ * (c) 2007-2010 Steven Levithan
+ * MIT License
+ *
+ * Provides an augmented, extensible, cross-browser implementation of regular expressions,
+ * including support for additional syntax, flags, and methods
+ */
+
+// https://github.com/kriskowal/es5-shim
+// Copyright 2009-2012 by contributors, MIT License
+
+// vim:set ts=4 sts=4 sw=4 st:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+/* ***** 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 ***** */
+
+/*! @license
+==========================================================================
+SproutCore -- JavaScript Application Framework
+copyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+SproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc.
+
+For more information about SproutCore, visit http://www.sproutcore.com
+
+
+==========================================================================
+@license */
+
+/* ***** 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 ***** */
+
+/*
+ * 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
+ */
+
+/*
+XRegExp Unicode plugin pack: Categories 1.0
+(c) 2010 Steven Levithan
+MIT License
+
+Uses the Unicode 5.2 character database
+
+This package for the XRegExp Unicode plugin enables the following Unicode categories (aka properties):
+
+L - Letter (the top-level Letter category is included in the Unicode plugin base script)
+ Ll - Lowercase letter
+ Lu - Uppercase letter
+ Lt - Titlecase letter
+ Lm - Modifier letter
+ Lo - Letter without case
+M - Mark
+ Mn - Non-spacing mark
+ Mc - Spacing combining mark
+ Me - Enclosing mark
+N - Number
+ Nd - Decimal digit
+ Nl - Letter number
+ No - Other number
+P - Punctuation
+ Pd - Dash punctuation
+ Ps - Open punctuation
+ Pe - Close punctuation
+ Pi - Initial punctuation
+ Pf - Final punctuation
+ Pc - Connector punctuation
+ Po - Other punctuation
+S - Symbol
+ Sm - Math symbol
+ Sc - Currency symbol
+ Sk - Modifier symbol
+ So - Other symbol
+Z - Separator
+ Zs - Space separator
+ Zl - Line separator
+ Zp - Paragraph separator
+C - Other
+ Cc - Control
+ Cf - Format
+ Co - Private use
+ Cs - Surrogate
+ Cn - Unassigned
+
+Example usage:
+
+ \p{N}
+ \p{Cn}
+*/
+
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
/**
@@ -204,45 +382,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-/*
-CSS Browser Selector v0.4.0 (Nov 02, 2010)
-Rafael Lima (http://rafael.adm.br)
-http://rafael.adm.br/css_browser_selector
-License: http://creativecommons.org/licenses/by/2.5/
-Contributors: http://rafael.adm.br/css_browser_selector#contributors
-
-v0.5.0 2011-08-24
-andrew relkin
-
-modified, now detects:
-any version of Firefox
-more versions of Windows (Win8, Win7, Vista, XP, Win2k)
-more versions of IE under unique conditions
-more detailed support for Opera
-if "no-js" in HTML class: removes and replaces with "js" ()
-
-identifies
- browsers: Firefox; IE; Opera; Safari; Chrome, Konqueror, Iron
- browser versions: (most importantly: ie6, ie7, ie8, ie9)
- rendering engines: Webkit; Mozilla; Gecko
- platforms/OSes: Mac; Win: Win7, Vista, XP, Win2k; FreeBSD; Linux/x11
- devices: Ipod; Ipad; Iphone; WebTV; Blackberry; Android; J2me; mobile(generic)
- enabled technology: JS
-
-*/
-
-/*! Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.1.3
- *
- * Requires: 1.2.2+
- */
-
/**
* bootstrap.js v3.0.0 by @fat and @mdo
* Copyright 2013 Twitter Inc.
@@ -680,22 +819,14 @@ function runDelayedFunction() {
void 0 !== delayedFunction && delayedFunction();
}
-function css_browser_selector(e) {
- var t = e.toLowerCase(), n = function(e) {
- return t.indexOf(e) > -1;
- }, i = "gecko", o = "webkit", r = "safari", a = "opera", s = "mobile", l = "firefox", c = document.documentElement, u = [ !/opera|webtv/i.test(t) && /msie\s(\d)/.test(t) ? "ie ie" + (/trident\/4\.0/.test(t) ? "8" : RegExp.$1) : n("firefox/") ? i + " " + l + (/firefox\/(\d+(\.?\d+)*)/.test(t) ? " " + l + RegExp.$1.replace(/\./g, "").substr(0, 2) : "") : n("gecko/") ? i : n("opera") ? a + (/version\/((\d+)(\.\d+)*)/.test(t) ? " " + a + RegExp.$2 + " " + a + RegExp.$2 + RegExp.$3.replace(".", "_").substr(0, 2) : /opera(\s|\/)(\d+)/.test(t) ? " " + a + RegExp.$2 : "") : n("konqueror") ? "konqueror" : n("blackberry") ? s + " blackberry" : n("android") ? s + " android" : n("chrome") ? o + " chrome" : n("iron") ? o + " iron" : n("applewebkit/") ? o + " " + r + (/version\/(\d+)/.test(t) ? " " + r + RegExp.$1 : "") : n("mozilla/") ? i : "", n("j2me") ? s + " j2me" : n("iphone") ? s + " iphone" : n("ipod") ? s + " ipod" : n("ipad") ? s + " ipad" : n("mac") ? "mac" : n("darwin") ? "mac" : n("webtv") ? "webtv" : n("win") ? "win" + (n("windows nt 6.2") ? " win8" : n("windows nt 6.1") ? " win7" : n("windows nt 6.0") ? " vista" : n("windows nt 5.2") || n("windows nt 5.1") ? " xp" : n("windows nt 5.0") ? " win2k" : "") : n("freebsd") ? "freebsd" : n("x11") || n("linux") ? "linux" : "", "js" ], d = u.join(" ");
- return c.className = (c.className.replace(/no-?js/g, "") + " " + d).replace(/^ /, ""),
- d;
-}
-
(function(e, t) {
function n(e) {
var t = e.length, n = rt.type(e);
return rt.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e);
}
function i(e) {
- var t = ht[e] = {};
- return rt.each(e.match(st) || [], function(e, n) {
+ var t = ft[e] = {};
+ return rt.each(e.match(at) || [], function(e, n) {
t[n] = !0;
}), t;
}
@@ -713,19 +844,19 @@ function css_browser_selector(e) {
try {
i = "true" === i ? !0 : "false" === i ? !1 : "null" === i ? null : +i + "" === i ? +i : vt.test(i) ? JSON.parse(i) : i;
} catch (r) {}
- mt.set(e, n, i);
+ gt.set(e, n, i);
} else i = t;
return i;
}
- function a() {
+ function s() {
return !0;
}
- function s() {
+ function a() {
return !1;
}
function l() {
try {
- return G.activeElement;
+ return U.activeElement;
} catch (e) {}
}
function c(e, t) {
@@ -740,7 +871,7 @@ function css_browser_selector(e) {
return e === t !== n;
});
if ("string" == typeof t) {
- if (Nt.test(t)) return rt.filter(t, e, n);
+ if (_t.test(t)) return rt.filter(t, e, n);
t = rt.filter(t, e);
}
return rt.grep(e, function(e) {
@@ -750,33 +881,33 @@ function css_browser_selector(e) {
function d(e, t) {
return rt.nodeName(e, "table") && rt.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e;
}
- function p(e) {
+ function h(e) {
return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e;
}
- function f(e) {
- var t = Ot.exec(e.type);
+ function p(e) {
+ var t = zt.exec(e.type);
return t ? e.type = t[1] : e.removeAttribute("type"), e;
}
- function h(e, t) {
- for (var n = e.length, i = 0; n > i; i++) gt.set(e[i], "globalEval", !t || gt.get(t[i], "globalEval"));
+ function f(e, t) {
+ for (var n = e.length, i = 0; n > i; i++) mt.set(e[i], "globalEval", !t || mt.get(t[i], "globalEval"));
}
- function m(e, t) {
- var n, i, o, r, a, s, l, c;
+ function g(e, t) {
+ var n, i, o, r, s, a, l, c;
if (1 === t.nodeType) {
- if (gt.hasData(e) && (r = gt.access(e), a = gt.set(t, r), c = r.events)) {
- delete a.handle, a.events = {};
+ if (mt.hasData(e) && (r = mt.access(e), s = mt.set(t, r), c = r.events)) {
+ delete s.handle, s.events = {};
for (o in c) for (n = 0, i = c[o].length; i > n; n++) rt.event.add(t, o, c[o][n]);
}
- mt.hasData(e) && (s = mt.access(e), l = rt.extend({}, s), mt.set(t, l));
+ gt.hasData(e) && (a = gt.access(e), l = rt.extend({}, a), gt.set(t, l));
}
}
- function g(e, n) {
+ function m(e, n) {
var i = e.getElementsByTagName ? e.getElementsByTagName(n || "*") : e.querySelectorAll ? e.querySelectorAll(n || "*") : [];
return n === t || n && rt.nodeName(e, n) ? rt.merge([ e ], i) : i;
}
function v(e, t) {
var n = t.nodeName.toLowerCase();
- "input" === n && Rt.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue);
+ "input" === n && It.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue);
}
function b(e, t) {
if (t in e) return t;
@@ -787,109 +918,109 @@ function css_browser_selector(e) {
function y(e, t) {
return e = t || e, "none" === rt.css(e, "display") || !rt.contains(e.ownerDocument, e);
}
- function x(t) {
+ function w(t) {
return e.getComputedStyle(t, null);
}
- function w(e, t) {
- for (var n, i, o, r = [], a = 0, s = e.length; s > a; a++) i = e[a], i.style && (r[a] = gt.get(i, "olddisplay"),
- n = i.style.display, t ? (r[a] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (r[a] = gt.access(i, "olddisplay", _(i.nodeName)))) : r[a] || (o = y(i),
- (n && "none" !== n || !o) && gt.set(i, "olddisplay", o ? n : rt.css(i, "display"))));
- for (a = 0; s > a; a++) i = e[a], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? r[a] || "" : "none"));
+ function C(e, t) {
+ for (var n, i, o, r = [], s = 0, a = e.length; a > s; s++) i = e[s], i.style && (r[s] = mt.get(i, "olddisplay"),
+ n = i.style.display, t ? (r[s] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (r[s] = mt.access(i, "olddisplay", S(i.nodeName)))) : r[s] || (o = y(i),
+ (n && "none" !== n || !o) && mt.set(i, "olddisplay", o ? n : rt.css(i, "display"))));
+ for (s = 0; a > s; s++) i = e[s], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? r[s] || "" : "none"));
return e;
}
- function C(e, t, n) {
- var i = Wt.exec(t);
+ function x(e, t, n) {
+ var i = Gt.exec(t);
return i ? Math.max(0, i[1] - (n || 0)) + (i[2] || "px") : t;
}
- function k(e, t, n, i, o) {
- for (var r = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; 4 > r; r += 2) "margin" === n && (a += rt.css(e, n + Jt[r], !0, o)),
- i ? ("content" === n && (a -= rt.css(e, "padding" + Jt[r], !0, o)), "margin" !== n && (a -= rt.css(e, "border" + Jt[r] + "Width", !0, o))) : (a += rt.css(e, "padding" + Jt[r], !0, o),
- "padding" !== n && (a += rt.css(e, "border" + Jt[r] + "Width", !0, o)));
- return a;
+ function E(e, t, n, i, o) {
+ for (var r = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, s = 0; 4 > r; r += 2) "margin" === n && (s += rt.css(e, n + Jt[r], !0, o)),
+ i ? ("content" === n && (s -= rt.css(e, "padding" + Jt[r], !0, o)), "margin" !== n && (s -= rt.css(e, "border" + Jt[r] + "Width", !0, o))) : (s += rt.css(e, "padding" + Jt[r], !0, o),
+ "padding" !== n && (s += rt.css(e, "border" + Jt[r] + "Width", !0, o)));
+ return s;
}
- function S(e, t, n) {
- var i = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, r = x(e), a = rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, r);
+ function A(e, t, n) {
+ var i = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, r = w(e), s = rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, r);
if (0 >= o || null == o) {
if (o = Ht(e, t, r), (0 > o || null == o) && (o = e.style[t]), Vt.test(o)) return o;
- i = a && (rt.support.boxSizingReliable || o === e.style[t]), o = parseFloat(o) || 0;
+ i = s && (rt.support.boxSizingReliable || o === e.style[t]), o = parseFloat(o) || 0;
}
- return o + k(e, t, n || (a ? "border" : "content"), i, r) + "px";
+ return o + E(e, t, n || (s ? "border" : "content"), i, r) + "px";
}
- function _(e) {
- var t = G, n = Kt[e];
- return n || (n = T(e, t), "none" !== n && n || (Bt = (Bt || rt("").css("cssText", "display:block !important")).appendTo(t.documentElement),
- t = (Bt[0].contentWindow || Bt[0].contentDocument).document, t.write(""),
- t.close(), n = T(e, t), Bt.detach()), Kt[e] = n), n;
+ function S(e) {
+ var t = U, n = Xt[e];
+ return n || (n = k(e, t), "none" !== n && n || (qt = (qt || rt("").css("cssText", "display:block !important")).appendTo(t.documentElement),
+ t = (qt[0].contentWindow || qt[0].contentDocument).document, t.write(""),
+ t.close(), n = k(e, t), qt.detach()), Xt[e] = n), n;
}
- function T(e, t) {
+ function k(e, t) {
var n = rt(t.createElement(e)).appendTo(t.body), i = rt.css(n[0], "display");
return n.remove(), i;
}
- function E(e, t, n, i) {
+ function F(e, t, n, i) {
var o;
if (rt.isArray(t)) rt.each(t, function(t, o) {
- n || tn.test(e) ? i(e, o) : E(e + "[" + ("object" == typeof o ? t : "") + "]", o, n, i);
- }); else if (n || "object" !== rt.type(t)) i(e, t); else for (o in t) E(e + "[" + o + "]", t[o], n, i);
+ n || tn.test(e) ? i(e, o) : F(e + "[" + ("object" == typeof o ? t : "") + "]", o, n, i);
+ }); else if (n || "object" !== rt.type(t)) i(e, t); else for (o in t) F(e + "[" + o + "]", t[o], n, i);
}
- function N(e) {
+ function _(e) {
return function(t, n) {
"string" != typeof t && (n = t, t = "*");
- var i, o = 0, r = t.toLowerCase().match(st) || [];
+ var i, o = 0, r = t.toLowerCase().match(at) || [];
if (rt.isFunction(n)) for (;i = r[o++]; ) "+" === i[0] ? (i = i.slice(1) || "*",
(e[i] = e[i] || []).unshift(n)) : (e[i] = e[i] || []).push(n);
};
}
- function I(e, t, n, i) {
- function o(s) {
+ function $(e, t, n, i) {
+ function o(a) {
var l;
- return r[s] = !0, rt.each(e[s] || [], function(e, s) {
- var c = s(t, n, i);
- return "string" != typeof c || a || r[c] ? a ? !(l = c) : void 0 : (t.dataTypes.unshift(c),
+ return r[a] = !0, rt.each(e[a] || [], function(e, a) {
+ var c = a(t, n, i);
+ return "string" != typeof c || s || r[c] ? s ? !(l = c) : void 0 : (t.dataTypes.unshift(c),
o(c), !1);
}), l;
}
- var r = {}, a = e === yn;
+ var r = {}, s = e === yn;
return o(t.dataTypes[0]) || !r["*"] && o("*");
}
- function P(e, n) {
+ function D(e, n) {
var i, o, r = rt.ajaxSettings.flatOptions || {};
for (i in n) n[i] !== t && ((r[i] ? e : o || (o = {}))[i] = n[i]);
return o && rt.extend(!0, e, o), e;
}
- function A(e, n, i) {
- for (var o, r, a, s, l = e.contents, c = e.dataTypes; "*" === c[0]; ) c.shift(),
+ function T(e, n, i) {
+ for (var o, r, s, a, l = e.contents, c = e.dataTypes; "*" === c[0]; ) c.shift(),
o === t && (o = e.mimeType || n.getResponseHeader("Content-Type"));
if (o) for (r in l) if (l[r] && l[r].test(o)) {
c.unshift(r);
break;
}
- if (c[0] in i) a = c[0]; else {
+ if (c[0] in i) s = c[0]; else {
for (r in i) {
if (!c[0] || e.converters[r + " " + c[0]]) {
- a = r;
+ s = r;
break;
}
- s || (s = r);
+ a || (a = r);
}
- a = a || s;
+ s = s || a;
}
- return a ? (a !== c[0] && c.unshift(a), i[a]) : void 0;
+ return s ? (s !== c[0] && c.unshift(s), i[s]) : void 0;
}
- function M(e, t, n, i) {
- var o, r, a, s, l, c = {}, u = e.dataTypes.slice();
- if (u[1]) for (a in e.converters) c[a.toLowerCase()] = e.converters[a];
+ function L(e, t, n, i) {
+ var o, r, s, a, l, c = {}, u = e.dataTypes.slice();
+ if (u[1]) for (s in e.converters) c[s.toLowerCase()] = e.converters[s];
for (r = u.shift(); r; ) if (e.responseFields[r] && (n[e.responseFields[r]] = t),
!l && i && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = r, r = u.shift()) if ("*" === r) r = l; else if ("*" !== l && l !== r) {
- if (a = c[l + " " + r] || c["* " + r], !a) for (o in c) if (s = o.split(" "), s[1] === r && (a = c[l + " " + s[0]] || c["* " + s[0]])) {
- a === !0 ? a = c[o] : c[o] !== !0 && (r = s[0], u.unshift(s[1]));
+ if (s = c[l + " " + r] || c["* " + r], !s) for (o in c) if (a = o.split(" "), a[1] === r && (s = c[l + " " + a[0]] || c["* " + a[0]])) {
+ s === !0 ? s = c[o] : c[o] !== !0 && (r = a[0], u.unshift(a[1]));
break;
}
- if (a !== !0) if (a && e["throws"]) t = a(t); else try {
- t = a(t);
+ if (s !== !0) if (s && e["throws"]) t = s(t); else try {
+ t = s(t);
} catch (d) {
return {
state: "parsererror",
- error: a ? d : "No conversion from " + l + " to " + r
+ error: s ? d : "No conversion from " + l + " to " + r
};
}
}
@@ -898,23 +1029,23 @@ function css_browser_selector(e) {
data: t
};
}
- function L() {
+ function B() {
return setTimeout(function() {
- Nn = t;
- }), Nn = rt.now();
+ _n = t;
+ }), _n = rt.now();
}
- function $(e, t, n) {
- for (var i, o = ($n[t] || []).concat($n["*"]), r = 0, a = o.length; a > r; r++) if (i = o[r].call(n, t, e)) return i;
+ function M(e, t, n) {
+ for (var i, o = (Mn[t] || []).concat(Mn["*"]), r = 0, s = o.length; s > r; r++) if (i = o[r].call(n, t, e)) return i;
}
- function z(e, t, n) {
- var i, o, r = 0, a = Ln.length, s = rt.Deferred().always(function() {
+ function R(e, t, n) {
+ var i, o, r = 0, s = Bn.length, a = rt.Deferred().always(function() {
delete l.elem;
}), l = function() {
if (o) return !1;
- for (var t = Nn || L(), n = Math.max(0, c.startTime + c.duration - t), i = n / c.duration || 0, r = 1 - i, a = 0, l = c.tweens.length; l > a; a++) c.tweens[a].run(r);
- return s.notifyWith(e, [ c, r, n ]), 1 > r && l ? n : (s.resolveWith(e, [ c ]),
+ for (var t = _n || B(), n = Math.max(0, c.startTime + c.duration - t), i = n / c.duration || 0, r = 1 - i, s = 0, l = c.tweens.length; l > s; s++) c.tweens[s].run(r);
+ return a.notifyWith(e, [ c, r, n ]), 1 > r && l ? n : (a.resolveWith(e, [ c ]),
!1);
- }, c = s.promise({
+ }, c = a.promise({
elem: e,
props: rt.extend({}, t),
opts: rt.extend(!0, {
@@ -922,7 +1053,7 @@ function css_browser_selector(e) {
}, n),
originalProperties: t,
originalOptions: n,
- startTime: Nn || L(),
+ startTime: _n || B(),
duration: n.duration,
tweens: [],
createTween: function(t, n) {
@@ -933,27 +1064,27 @@ function css_browser_selector(e) {
var n = 0, i = t ? c.tweens.length : 0;
if (o) return this;
for (o = !0; i > n; n++) c.tweens[n].run(1);
- return t ? s.resolveWith(e, [ c, t ]) : s.rejectWith(e, [ c, t ]), this;
+ return t ? a.resolveWith(e, [ c, t ]) : a.rejectWith(e, [ c, t ]), this;
}
}), u = c.props;
- for (R(u, c.opts.specialEasing); a > r; r++) if (i = Ln[r].call(c, e, u, c.opts)) return i;
- return rt.map(u, $, c), rt.isFunction(c.opts.start) && c.opts.start.call(e, c),
+ for (I(u, c.opts.specialEasing); s > r; r++) if (i = Bn[r].call(c, e, u, c.opts)) return i;
+ return rt.map(u, M, c), rt.isFunction(c.opts.start) && c.opts.start.call(e, c),
rt.fx.timer(rt.extend(l, {
elem: e,
anim: c,
queue: c.opts.queue
})), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always);
}
- function R(e, t) {
- var n, i, o, r, a;
+ function I(e, t) {
+ var n, i, o, r, s;
for (n in e) if (i = rt.camelCase(n), o = t[i], r = e[n], rt.isArray(r) && (o = r[1],
- r = e[n] = r[0]), n !== i && (e[i] = r, delete e[n]), a = rt.cssHooks[i], a && "expand" in a) {
- r = a.expand(r), delete e[i];
+ r = e[n] = r[0]), n !== i && (e[i] = r, delete e[n]), s = rt.cssHooks[i], s && "expand" in s) {
+ r = s.expand(r), delete e[i];
for (n in r) n in e || (e[n] = r[n], t[n] = o);
} else t[i] = o;
}
- function j(e, n, i) {
- var o, r, a, s, l, c, u = this, d = {}, p = e.style, f = e.nodeType && y(e), h = gt.get(e, "fxshow");
+ function P(e, n, i) {
+ var o, r, s, a, l, c, u = this, d = {}, h = e.style, p = e.nodeType && y(e), f = mt.get(e, "fxshow");
i.queue || (l = rt._queueHooks(e, "fx"), null == l.unqueued && (l.unqueued = 0,
c = l.empty.fire, l.empty.fire = function() {
l.unqueued || c();
@@ -961,54 +1092,54 @@ function css_browser_selector(e) {
u.always(function() {
l.unqueued--, rt.queue(e, "fx").length || l.empty.fire();
});
- })), 1 === e.nodeType && ("height" in n || "width" in n) && (i.overflow = [ p.overflow, p.overflowX, p.overflowY ],
- "inline" === rt.css(e, "display") && "none" === rt.css(e, "float") && (p.display = "inline-block")),
- i.overflow && (p.overflow = "hidden", u.always(function() {
- p.overflow = i.overflow[0], p.overflowX = i.overflow[1], p.overflowY = i.overflow[2];
+ })), 1 === e.nodeType && ("height" in n || "width" in n) && (i.overflow = [ h.overflow, h.overflowX, h.overflowY ],
+ "inline" === rt.css(e, "display") && "none" === rt.css(e, "float") && (h.display = "inline-block")),
+ i.overflow && (h.overflow = "hidden", u.always(function() {
+ h.overflow = i.overflow[0], h.overflowX = i.overflow[1], h.overflowY = i.overflow[2];
}));
- for (o in n) if (r = n[o], Pn.exec(r)) {
- if (delete n[o], a = a || "toggle" === r, r === (f ? "hide" : "show")) {
- if ("show" !== r || !h || h[o] === t) continue;
- f = !0;
+ for (o in n) if (r = n[o], Dn.exec(r)) {
+ if (delete n[o], s = s || "toggle" === r, r === (p ? "hide" : "show")) {
+ if ("show" !== r || !f || f[o] === t) continue;
+ p = !0;
}
- d[o] = h && h[o] || rt.style(e, o);
+ d[o] = f && f[o] || rt.style(e, o);
}
if (!rt.isEmptyObject(d)) {
- h ? "hidden" in h && (f = h.hidden) : h = gt.access(e, "fxshow", {}), a && (h.hidden = !f),
- f ? rt(e).show() : u.done(function() {
+ f ? "hidden" in f && (p = f.hidden) : f = mt.access(e, "fxshow", {}), s && (f.hidden = !p),
+ p ? rt(e).show() : u.done(function() {
rt(e).hide();
}), u.done(function() {
var t;
- gt.remove(e, "fxshow");
+ mt.remove(e, "fxshow");
for (t in d) rt.style(e, t, d[t]);
});
- for (o in d) s = $(f ? h[o] : 0, o, u), o in h || (h[o] = s.start, f && (s.end = s.start,
- s.start = "width" === o || "height" === o ? 1 : 0));
+ for (o in d) a = M(p ? f[o] : 0, o, u), o in f || (f[o] = a.start, p && (a.end = a.start,
+ a.start = "width" === o || "height" === o ? 1 : 0));
}
}
- function D(e, t, n, i, o) {
- return new D.prototype.init(e, t, n, i, o);
+ function N(e, t, n, i, o) {
+ return new N.prototype.init(e, t, n, i, o);
}
- function O(e, t) {
+ function z(e, t) {
var n, i = {
height: e
}, o = 0;
for (t = t ? 1 : 0; 4 > o; o += 2 - t) n = Jt[o], i["margin" + n] = i["padding" + n] = e;
return t && (i.opacity = i.width = e), i;
}
- function F(e) {
+ function O(e) {
return rt.isWindow(e) ? e : 9 === e.nodeType && e.defaultView;
}
- var q, H, B = typeof t, U = e.location, G = e.document, W = G.documentElement, V = e.jQuery, X = e.$, K = {}, Z = [], Y = "2.0.3", J = Z.concat, Q = Z.push, et = Z.slice, tt = Z.indexOf, nt = K.toString, it = K.hasOwnProperty, ot = Y.trim, rt = function(e, t) {
- return new rt.fn.init(e, t, q);
- }, at = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, st = /\S+/g, lt = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, ct = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, ut = /^-ms-/, dt = /-([\da-z])/gi, pt = function(e, t) {
+ var j, H, q = typeof t, W = e.location, U = e.document, G = U.documentElement, V = e.jQuery, K = e.$, X = {}, Y = [], Z = "2.0.3", J = Y.concat, Q = Y.push, et = Y.slice, tt = Y.indexOf, nt = X.toString, it = X.hasOwnProperty, ot = Z.trim, rt = function(e, t) {
+ return new rt.fn.init(e, t, j);
+ }, st = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, at = /\S+/g, lt = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, ct = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, ut = /^-ms-/, dt = /-([\da-z])/gi, ht = function(e, t) {
return t.toUpperCase();
- }, ft = function() {
- G.removeEventListener("DOMContentLoaded", ft, !1), e.removeEventListener("load", ft, !1),
+ }, pt = function() {
+ U.removeEventListener("DOMContentLoaded", pt, !1), e.removeEventListener("load", pt, !1),
rt.ready();
};
rt.fn = rt.prototype = {
- jquery: Y,
+ jquery: Z,
constructor: rt,
init: function(e, n, i) {
var o, r;
@@ -1017,12 +1148,12 @@ function css_browser_selector(e) {
if (o = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [ null, e, null ] : lt.exec(e),
!o || !o[1] && n) return !n || n.jquery ? (n || i).find(e) : this.constructor(n).find(e);
if (o[1]) {
- if (n = n instanceof rt ? n[0] : n, rt.merge(this, rt.parseHTML(o[1], n && n.nodeType ? n.ownerDocument || n : G, !0)),
+ if (n = n instanceof rt ? n[0] : n, rt.merge(this, rt.parseHTML(o[1], n && n.nodeType ? n.ownerDocument || n : U, !0)),
ct.test(o[1]) && rt.isPlainObject(n)) for (o in n) rt.isFunction(this[o]) ? this[o](n[o]) : this.attr(o, n[o]);
return this;
}
- return r = G.getElementById(o[2]), r && r.parentNode && (this.length = 1, this[0] = r),
- this.context = G, this.selector = e, this;
+ return r = U.getElementById(o[2]), r && r.parentNode && (this.length = 1, this[0] = r),
+ this.context = U, this.selector = e, this;
}
return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : rt.isFunction(e) ? i.ready(e) : (e.selector !== t && (this.selector = e.selector,
this.context = e.context), rt.makeArray(e, this));
@@ -1070,16 +1201,16 @@ function css_browser_selector(e) {
sort: [].sort,
splice: [].splice
}, rt.fn.init.prototype = rt.fn, rt.extend = rt.fn.extend = function() {
- var e, n, i, o, r, a, s = arguments[0] || {}, l = 1, c = arguments.length, u = !1;
- for ("boolean" == typeof s && (u = s, s = arguments[1] || {}, l = 2), "object" == typeof s || rt.isFunction(s) || (s = {}),
- c === l && (s = this, --l); c > l; l++) if (null != (e = arguments[l])) for (n in e) i = s[n],
- o = e[n], s !== o && (u && o && (rt.isPlainObject(o) || (r = rt.isArray(o))) ? (r ? (r = !1,
- a = i && rt.isArray(i) ? i : []) : a = i && rt.isPlainObject(i) ? i : {}, s[n] = rt.extend(u, a, o)) : o !== t && (s[n] = o));
- return s;
+ var e, n, i, o, r, s, a = arguments[0] || {}, l = 1, c = arguments.length, u = !1;
+ for ("boolean" == typeof a && (u = a, a = arguments[1] || {}, l = 2), "object" == typeof a || rt.isFunction(a) || (a = {}),
+ c === l && (a = this, --l); c > l; l++) if (null != (e = arguments[l])) for (n in e) i = a[n],
+ o = e[n], a !== o && (u && o && (rt.isPlainObject(o) || (r = rt.isArray(o))) ? (r ? (r = !1,
+ s = i && rt.isArray(i) ? i : []) : s = i && rt.isPlainObject(i) ? i : {}, a[n] = rt.extend(u, s, o)) : o !== t && (a[n] = o));
+ return a;
}, rt.extend({
- expando: "jQuery" + (Y + Math.random()).replace(/\D/g, ""),
+ expando: "jQuery" + (Z + Math.random()).replace(/\D/g, ""),
noConflict: function(t) {
- return e.$ === rt && (e.$ = X), t && e.jQuery === rt && (e.jQuery = V), rt;
+ return e.$ === rt && (e.$ = K), t && e.jQuery === rt && (e.jQuery = V), rt;
},
isReady: !1,
readyWait: 1,
@@ -1087,8 +1218,8 @@ function css_browser_selector(e) {
e ? rt.readyWait++ : rt.ready(!0);
},
ready: function(e) {
- (e === !0 ? --rt.readyWait : rt.isReady) || (rt.isReady = !0, e !== !0 && --rt.readyWait > 0 || (H.resolveWith(G, [ rt ]),
- rt.fn.trigger && rt(G).trigger("ready").off("ready")));
+ (e === !0 ? --rt.readyWait : rt.isReady) || (rt.isReady = !0, e !== !0 && --rt.readyWait > 0 || (H.resolveWith(U, [ rt ]),
+ rt.fn.trigger && rt(U).trigger("ready").off("ready")));
},
isFunction: function(e) {
return "function" === rt.type(e);
@@ -1101,7 +1232,7 @@ function css_browser_selector(e) {
return !isNaN(parseFloat(e)) && isFinite(e);
},
type: function(e) {
- return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? K[nt.call(e)] || "object" : typeof e;
+ return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? X[nt.call(e)] || "object" : typeof e;
},
isPlainObject: function(e) {
if ("object" !== rt.type(e) || e.nodeType || rt.isWindow(e)) return !1;
@@ -1122,7 +1253,7 @@ function css_browser_selector(e) {
},
parseHTML: function(e, t, n) {
if (!e || "string" != typeof e) return null;
- "boolean" == typeof t && (n = t, t = !1), t = t || G;
+ "boolean" == typeof t && (n = t, t = !1), t = t || U;
var i = ct.exec(e), o = !n && [];
return i ? [ t.createElement(i[1]) ] : (i = rt.buildFragment([ e ], t, o), o && rt(o).remove(),
rt.merge([], i.childNodes));
@@ -1142,21 +1273,21 @@ function css_browser_selector(e) {
noop: function() {},
globalEval: function(e) {
var t, n = eval;
- e = rt.trim(e), e && (1 === e.indexOf("use strict") ? (t = G.createElement("script"),
- t.text = e, G.head.appendChild(t).parentNode.removeChild(t)) : n(e));
+ e = rt.trim(e), e && (1 === e.indexOf("use strict") ? (t = U.createElement("script"),
+ t.text = e, U.head.appendChild(t).parentNode.removeChild(t)) : n(e));
},
camelCase: function(e) {
- return e.replace(ut, "ms-").replace(dt, pt);
+ return e.replace(ut, "ms-").replace(dt, ht);
},
nodeName: function(e, t) {
return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase();
},
each: function(e, t, i) {
- var o, r = 0, a = e.length, s = n(e);
+ var o, r = 0, s = e.length, a = n(e);
if (i) {
- if (s) for (;a > r && (o = t.apply(e[r], i), o !== !1); r++) ; else for (r in e) if (o = t.apply(e[r], i),
+ if (a) for (;s > r && (o = t.apply(e[r], i), o !== !1); r++) ; else for (r in e) if (o = t.apply(e[r], i),
o === !1) break;
- } else if (s) for (;a > r && (o = t.call(e[r], r, e[r]), o !== !1); r++) ; else for (r in e) if (o = t.call(e[r], r, e[r]),
+ } else if (a) for (;s > r && (o = t.call(e[r], r, e[r]), o !== !1); r++) ; else for (r in e) if (o = t.call(e[r], r, e[r]),
o === !1) break;
return e;
},
@@ -1177,13 +1308,13 @@ function css_browser_selector(e) {
return e.length = o, e;
},
grep: function(e, t, n) {
- var i, o = [], r = 0, a = e.length;
- for (n = !!n; a > r; r++) i = !!t(e[r], r), n !== i && o.push(e[r]);
+ var i, o = [], r = 0, s = e.length;
+ for (n = !!n; s > r; r++) i = !!t(e[r], r), n !== i && o.push(e[r]);
return o;
},
map: function(e, t, i) {
- var o, r = 0, a = e.length, s = n(e), l = [];
- if (s) for (;a > r; r++) o = t(e[r], r, i), null != o && (l[l.length] = o); else for (r in e) o = t(e[r], r, i),
+ var o, r = 0, s = e.length, a = n(e), l = [];
+ if (a) for (;s > r; r++) o = t(e[r], r, i), null != o && (l[l.length] = o); else for (r in e) o = t(e[r], r, i),
null != o && (l[l.length] = o);
return J.apply([], l);
},
@@ -1195,74 +1326,74 @@ function css_browser_selector(e) {
return e.apply(n || this, o.concat(et.call(arguments)));
}, r.guid = e.guid = e.guid || rt.guid++, r) : t;
},
- access: function(e, n, i, o, r, a, s) {
+ access: function(e, n, i, o, r, s, a) {
var l = 0, c = e.length, u = null == i;
if ("object" === rt.type(i)) {
r = !0;
- for (l in i) rt.access(e, n, l, i[l], !0, a, s);
- } else if (o !== t && (r = !0, rt.isFunction(o) || (s = !0), u && (s ? (n.call(e, o),
+ for (l in i) rt.access(e, n, l, i[l], !0, s, a);
+ } else if (o !== t && (r = !0, rt.isFunction(o) || (a = !0), u && (a ? (n.call(e, o),
n = null) : (u = n, n = function(e, t, n) {
return u.call(rt(e), n);
- })), n)) for (;c > l; l++) n(e[l], i, s ? o : o.call(e[l], l, n(e[l], i)));
- return r ? e : u ? n.call(e) : c ? n(e[0], i) : a;
+ })), n)) for (;c > l; l++) n(e[l], i, a ? o : o.call(e[l], l, n(e[l], i)));
+ return r ? e : u ? n.call(e) : c ? n(e[0], i) : s;
},
now: Date.now,
swap: function(e, t, n, i) {
- var o, r, a = {};
- for (r in t) a[r] = e.style[r], e.style[r] = t[r];
+ var o, r, s = {};
+ for (r in t) s[r] = e.style[r], e.style[r] = t[r];
o = n.apply(e, i || []);
- for (r in t) e.style[r] = a[r];
+ for (r in t) e.style[r] = s[r];
return o;
}
}), rt.ready.promise = function(t) {
- return H || (H = rt.Deferred(), "complete" === G.readyState ? setTimeout(rt.ready) : (G.addEventListener("DOMContentLoaded", ft, !1),
- e.addEventListener("load", ft, !1))), H.promise(t);
+ return H || (H = rt.Deferred(), "complete" === U.readyState ? setTimeout(rt.ready) : (U.addEventListener("DOMContentLoaded", pt, !1),
+ e.addEventListener("load", pt, !1))), H.promise(t);
}, rt.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(e, t) {
- K["[object " + t + "]"] = t.toLowerCase();
- }), q = rt(G), function(e, t) {
+ X["[object " + t + "]"] = t.toLowerCase();
+ }), j = rt(U), function(e, t) {
function n(e, t, n, i) {
- var o, r, a, s, l, c, u, d, h, m;
- if ((t ? t.ownerDocument || t : F) !== M && A(t), t = t || M, n = n || [], !e || "string" != typeof e) return n;
- if (1 !== (s = t.nodeType) && 9 !== s) return [];
- if ($ && !i) {
- if (o = yt.exec(e)) if (a = o[1]) {
- if (9 === s) {
- if (r = t.getElementById(a), !r || !r.parentNode) return n;
- if (r.id === a) return n.push(r), n;
- } else if (t.ownerDocument && (r = t.ownerDocument.getElementById(a)) && D(t, r) && r.id === a) return n.push(r),
+ var o, r, s, a, l, c, u, d, f, g;
+ if ((t ? t.ownerDocument || t : O) !== L && T(t), t = t || L, n = n || [], !e || "string" != typeof e) return n;
+ if (1 !== (a = t.nodeType) && 9 !== a) return [];
+ if (M && !i) {
+ if (o = yt.exec(e)) if (s = o[1]) {
+ if (9 === a) {
+ if (r = t.getElementById(s), !r || !r.parentNode) return n;
+ if (r.id === s) return n.push(r), n;
+ } else if (t.ownerDocument && (r = t.ownerDocument.getElementById(s)) && N(t, r) && r.id === s) return n.push(r),
n;
} else {
if (o[2]) return et.apply(n, t.getElementsByTagName(e)), n;
- if ((a = o[3]) && k.getElementsByClassName && t.getElementsByClassName) return et.apply(n, t.getElementsByClassName(a)),
+ if ((s = o[3]) && E.getElementsByClassName && t.getElementsByClassName) return et.apply(n, t.getElementsByClassName(s)),
n;
}
- if (k.qsa && (!z || !z.test(e))) {
- if (d = u = O, h = t, m = 9 === s && e, 1 === s && "object" !== t.nodeName.toLowerCase()) {
- for (c = p(e), (u = t.getAttribute("id")) ? d = u.replace(Ct, "\\$&") : t.setAttribute("id", d),
- d = "[id='" + d + "'] ", l = c.length; l--; ) c[l] = d + f(c[l]);
- h = ft.test(e) && t.parentNode || t, m = c.join(",");
+ if (E.qsa && (!R || !R.test(e))) {
+ if (d = u = z, f = t, g = 9 === a && e, 1 === a && "object" !== t.nodeName.toLowerCase()) {
+ for (c = h(e), (u = t.getAttribute("id")) ? d = u.replace(xt, "\\$&") : t.setAttribute("id", d),
+ d = "[id='" + d + "'] ", l = c.length; l--; ) c[l] = d + p(c[l]);
+ f = pt.test(e) && t.parentNode || t, g = c.join(",");
}
- if (m) try {
- return et.apply(n, h.querySelectorAll(m)), n;
- } catch (g) {} finally {
+ if (g) try {
+ return et.apply(n, f.querySelectorAll(g)), n;
+ } catch (m) {} finally {
u || t.removeAttribute("id");
}
}
}
- return w(e.replace(ut, "$1"), t, n, i);
+ return C(e.replace(ut, "$1"), t, n, i);
}
function i() {
function e(n, i) {
- return t.push(n += " ") > _.cacheLength && delete e[t.shift()], e[n] = i;
+ return t.push(n += " ") > S.cacheLength && delete e[t.shift()], e[n] = i;
}
var t = [];
return e;
}
function o(e) {
- return e[O] = !0, e;
+ return e[z] = !0, e;
}
function r(e) {
- var t = M.createElement("div");
+ var t = L.createElement("div");
try {
return !!e(t);
} catch (n) {
@@ -1271,11 +1402,11 @@ function css_browser_selector(e) {
t.parentNode && t.parentNode.removeChild(t), t = null;
}
}
- function a(e, t) {
- for (var n = e.split("|"), i = e.length; i--; ) _.attrHandle[n[i]] = t;
- }
function s(e, t) {
- var n = t && e, i = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || K) - (~e.sourceIndex || K);
+ for (var n = e.split("|"), i = e.length; i--; ) S.attrHandle[n[i]] = t;
+ }
+ function a(e, t) {
+ var n = t && e, i = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || X) - (~e.sourceIndex || X);
if (i) return i;
if (n) for (;n = n.nextSibling; ) if (n === t) return -1;
return e ? 1 : -1;
@@ -1295,158 +1426,158 @@ function css_browser_selector(e) {
function u(e) {
return o(function(t) {
return t = +t, o(function(n, i) {
- for (var o, r = e([], n.length, t), a = r.length; a--; ) n[o = r[a]] && (n[o] = !(i[o] = n[o]));
+ for (var o, r = e([], n.length, t), s = r.length; s--; ) n[o = r[s]] && (n[o] = !(i[o] = n[o]));
});
});
}
function d() {}
- function p(e, t) {
- var i, o, r, a, s, l, c, u = U[e + " "];
+ function h(e, t) {
+ var i, o, r, s, a, l, c, u = W[e + " "];
if (u) return t ? 0 : u.slice(0);
- for (s = e, l = [], c = _.preFilter; s; ) {
- (!i || (o = dt.exec(s))) && (o && (s = s.slice(o[0].length) || s), l.push(r = [])),
- i = !1, (o = pt.exec(s)) && (i = o.shift(), r.push({
+ for (a = e, l = [], c = S.preFilter; a; ) {
+ (!i || (o = dt.exec(a))) && (o && (a = a.slice(o[0].length) || a), l.push(r = [])),
+ i = !1, (o = ht.exec(a)) && (i = o.shift(), r.push({
value: i,
type: o[0].replace(ut, " ")
- }), s = s.slice(i.length));
- for (a in _.filter) !(o = vt[a].exec(s)) || c[a] && !(o = c[a](o)) || (i = o.shift(),
+ }), a = a.slice(i.length));
+ for (s in S.filter) !(o = vt[s].exec(a)) || c[s] && !(o = c[s](o)) || (i = o.shift(),
r.push({
value: i,
- type: a,
+ type: s,
matches: o
- }), s = s.slice(i.length));
+ }), a = a.slice(i.length));
if (!i) break;
}
- return t ? s.length : s ? n.error(e) : U(e, l).slice(0);
+ return t ? a.length : a ? n.error(e) : W(e, l).slice(0);
}
- function f(e) {
+ function p(e) {
for (var t = 0, n = e.length, i = ""; n > t; t++) i += e[t].value;
return i;
}
- function h(e, t, n) {
+ function f(e, t, n) {
var i = t.dir, o = n && "parentNode" === i, r = H++;
return t.first ? function(t, n, r) {
for (;t = t[i]; ) if (1 === t.nodeType || o) return e(t, n, r);
- } : function(t, n, a) {
- var s, l, c, u = q + " " + r;
- if (a) {
- for (;t = t[i]; ) if ((1 === t.nodeType || o) && e(t, n, a)) return !0;
- } else for (;t = t[i]; ) if (1 === t.nodeType || o) if (c = t[O] || (t[O] = {}),
+ } : function(t, n, s) {
+ var a, l, c, u = j + " " + r;
+ if (s) {
+ for (;t = t[i]; ) if ((1 === t.nodeType || o) && e(t, n, s)) return !0;
+ } else for (;t = t[i]; ) if (1 === t.nodeType || o) if (c = t[z] || (t[z] = {}),
(l = c[i]) && l[0] === u) {
- if ((s = l[1]) === !0 || s === S) return s === !0;
- } else if (l = c[i] = [ u ], l[1] = e(t, n, a) || S, l[1] === !0) return !0;
+ if ((a = l[1]) === !0 || a === A) return a === !0;
+ } else if (l = c[i] = [ u ], l[1] = e(t, n, s) || A, l[1] === !0) return !0;
};
}
- function m(e) {
+ function g(e) {
return e.length > 1 ? function(t, n, i) {
for (var o = e.length; o--; ) if (!e[o](t, n, i)) return !1;
return !0;
} : e[0];
}
- function g(e, t, n, i, o) {
- for (var r, a = [], s = 0, l = e.length, c = null != t; l > s; s++) (r = e[s]) && (!n || n(r, i, o)) && (a.push(r),
- c && t.push(s));
- return a;
+ function m(e, t, n, i, o) {
+ for (var r, s = [], a = 0, l = e.length, c = null != t; l > a; a++) (r = e[a]) && (!n || n(r, i, o)) && (s.push(r),
+ c && t.push(a));
+ return s;
}
- function v(e, t, n, i, r, a) {
- return i && !i[O] && (i = v(i)), r && !r[O] && (r = v(r, a)), o(function(o, a, s, l) {
- var c, u, d, p = [], f = [], h = a.length, m = o || x(t || "*", s.nodeType ? [ s ] : s, []), v = !e || !o && t ? m : g(m, p, e, s, l), b = n ? r || (o ? e : h || i) ? [] : a : v;
- if (n && n(v, b, s, l), i) for (c = g(b, f), i(c, [], s, l), u = c.length; u--; ) (d = c[u]) && (b[f[u]] = !(v[f[u]] = d));
+ function v(e, t, n, i, r, s) {
+ return i && !i[z] && (i = v(i)), r && !r[z] && (r = v(r, s)), o(function(o, s, a, l) {
+ var c, u, d, h = [], p = [], f = s.length, g = o || w(t || "*", a.nodeType ? [ a ] : a, []), v = !e || !o && t ? g : m(g, h, e, a, l), b = n ? r || (o ? e : f || i) ? [] : s : v;
+ if (n && n(v, b, a, l), i) for (c = m(b, p), i(c, [], a, l), u = c.length; u--; ) (d = c[u]) && (b[p[u]] = !(v[p[u]] = d));
if (o) {
if (r || e) {
if (r) {
for (c = [], u = b.length; u--; ) (d = b[u]) && c.push(v[u] = d);
r(null, b = [], c, l);
}
- for (u = b.length; u--; ) (d = b[u]) && (c = r ? nt.call(o, d) : p[u]) > -1 && (o[c] = !(a[c] = d));
+ for (u = b.length; u--; ) (d = b[u]) && (c = r ? nt.call(o, d) : h[u]) > -1 && (o[c] = !(s[c] = d));
}
- } else b = g(b === a ? b.splice(h, b.length) : b), r ? r(null, a, b, l) : et.apply(a, b);
+ } else b = m(b === s ? b.splice(f, b.length) : b), r ? r(null, s, b, l) : et.apply(s, b);
});
}
function b(e) {
- for (var t, n, i, o = e.length, r = _.relative[e[0].type], a = r || _.relative[" "], s = r ? 1 : 0, l = h(function(e) {
+ for (var t, n, i, o = e.length, r = S.relative[e[0].type], s = r || S.relative[" "], a = r ? 1 : 0, l = f(function(e) {
return e === t;
- }, a, !0), c = h(function(e) {
+ }, s, !0), c = f(function(e) {
return nt.call(t, e) > -1;
- }, a, !0), u = [ function(e, n, i) {
- return !r && (i || n !== I) || ((t = n).nodeType ? l(e, n, i) : c(e, n, i));
- } ]; o > s; s++) if (n = _.relative[e[s].type]) u = [ h(m(u), n) ]; else {
- if (n = _.filter[e[s].type].apply(null, e[s].matches), n[O]) {
- for (i = ++s; o > i && !_.relative[e[i].type]; i++) ;
- return v(s > 1 && m(u), s > 1 && f(e.slice(0, s - 1).concat({
- value: " " === e[s - 2].type ? "*" : ""
- })).replace(ut, "$1"), n, i > s && b(e.slice(s, i)), o > i && b(e = e.slice(i)), o > i && f(e));
+ }, s, !0), u = [ function(e, n, i) {
+ return !r && (i || n !== $) || ((t = n).nodeType ? l(e, n, i) : c(e, n, i));
+ } ]; o > a; a++) if (n = S.relative[e[a].type]) u = [ f(g(u), n) ]; else {
+ if (n = S.filter[e[a].type].apply(null, e[a].matches), n[z]) {
+ for (i = ++a; o > i && !S.relative[e[i].type]; i++) ;
+ return v(a > 1 && g(u), a > 1 && p(e.slice(0, a - 1).concat({
+ value: " " === e[a - 2].type ? "*" : ""
+ })).replace(ut, "$1"), n, i > a && b(e.slice(a, i)), o > i && b(e = e.slice(i)), o > i && p(e));
}
u.push(n);
}
- return m(u);
+ return g(u);
}
function y(e, t) {
- var i = 0, r = t.length > 0, a = e.length > 0, s = function(o, s, l, c, u) {
- var d, p, f, h = [], m = 0, v = "0", b = o && [], y = null != u, x = I, w = o || a && _.find.TAG("*", u && s.parentNode || s), C = q += null == x ? 1 : Math.random() || .1;
- for (y && (I = s !== M && s, S = i); null != (d = w[v]); v++) {
- if (a && d) {
- for (p = 0; f = e[p++]; ) if (f(d, s, l)) {
+ var i = 0, r = t.length > 0, s = e.length > 0, a = function(o, a, l, c, u) {
+ var d, h, p, f = [], g = 0, v = "0", b = o && [], y = null != u, w = $, C = o || s && S.find.TAG("*", u && a.parentNode || a), x = j += null == w ? 1 : Math.random() || .1;
+ for (y && ($ = a !== L && a, A = i); null != (d = C[v]); v++) {
+ if (s && d) {
+ for (h = 0; p = e[h++]; ) if (p(d, a, l)) {
c.push(d);
break;
}
- y && (q = C, S = ++i);
+ y && (j = x, A = ++i);
}
- r && ((d = !f && d) && m--, o && b.push(d));
+ r && ((d = !p && d) && g--, o && b.push(d));
}
- if (m += v, r && v !== m) {
- for (p = 0; f = t[p++]; ) f(b, h, s, l);
+ if (g += v, r && v !== g) {
+ for (h = 0; p = t[h++]; ) p(b, f, a, l);
if (o) {
- if (m > 0) for (;v--; ) b[v] || h[v] || (h[v] = J.call(c));
- h = g(h);
+ if (g > 0) for (;v--; ) b[v] || f[v] || (f[v] = J.call(c));
+ f = m(f);
}
- et.apply(c, h), y && !o && h.length > 0 && m + t.length > 1 && n.uniqueSort(c);
+ et.apply(c, f), y && !o && f.length > 0 && g + t.length > 1 && n.uniqueSort(c);
}
- return y && (q = C, I = x), b;
+ return y && (j = x, $ = w), b;
};
- return r ? o(s) : s;
+ return r ? o(a) : a;
}
- function x(e, t, i) {
+ function w(e, t, i) {
for (var o = 0, r = t.length; r > o; o++) n(e, t[o], i);
return i;
}
- function w(e, t, n, i) {
- var o, r, a, s, l, c = p(e);
+ function C(e, t, n, i) {
+ var o, r, s, a, l, c = h(e);
if (!i && 1 === c.length) {
- if (r = c[0] = c[0].slice(0), r.length > 2 && "ID" === (a = r[0]).type && k.getById && 9 === t.nodeType && $ && _.relative[r[1].type]) {
- if (t = (_.find.ID(a.matches[0].replace(kt, St), t) || [])[0], !t) return n;
+ if (r = c[0] = c[0].slice(0), r.length > 2 && "ID" === (s = r[0]).type && E.getById && 9 === t.nodeType && M && S.relative[r[1].type]) {
+ if (t = (S.find.ID(s.matches[0].replace(Et, At), t) || [])[0], !t) return n;
e = e.slice(r.shift().value.length);
}
- for (o = vt.needsContext.test(e) ? 0 : r.length; o-- && (a = r[o], !_.relative[s = a.type]); ) if ((l = _.find[s]) && (i = l(a.matches[0].replace(kt, St), ft.test(r[0].type) && t.parentNode || t))) {
- if (r.splice(o, 1), e = i.length && f(r), !e) return et.apply(n, i), n;
+ for (o = vt.needsContext.test(e) ? 0 : r.length; o-- && (s = r[o], !S.relative[a = s.type]); ) if ((l = S.find[a]) && (i = l(s.matches[0].replace(Et, At), pt.test(r[0].type) && t.parentNode || t))) {
+ if (r.splice(o, 1), e = i.length && p(r), !e) return et.apply(n, i), n;
break;
}
}
- return N(e, c)(i, t, !$, n, ft.test(e)), n;
+ return _(e, c)(i, t, !M, n, pt.test(e)), n;
}
- var C, k, S, _, T, E, N, I, P, A, M, L, $, z, R, j, D, O = "sizzle" + -new Date(), F = e.document, q = 0, H = 0, B = i(), U = i(), G = i(), W = !1, V = function(e, t) {
- return e === t ? (W = !0, 0) : 0;
- }, X = typeof t, K = 1 << 31, Z = {}.hasOwnProperty, Y = [], J = Y.pop, Q = Y.push, et = Y.push, tt = Y.slice, nt = Y.indexOf || function(e) {
+ var x, E, A, S, k, F, _, $, D, T, L, B, M, R, I, P, N, z = "sizzle" + -new Date(), O = e.document, j = 0, H = 0, q = i(), W = i(), U = i(), G = !1, V = function(e, t) {
+ return e === t ? (G = !0, 0) : 0;
+ }, K = typeof t, X = 1 << 31, Y = {}.hasOwnProperty, Z = [], J = Z.pop, Q = Z.push, et = Z.push, tt = Z.slice, nt = Z.indexOf || function(e) {
for (var t = 0, n = this.length; n > t; t++) if (this[t] === e) return t;
return -1;
- }, it = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", ot = "[\\x20\\t\\r\\n\\f]", at = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", st = at.replace("w", "w#"), lt = "\\[" + ot + "*(" + at + ")" + ot + "*(?:([*^$|!~]?=)" + ot + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + st + ")|)|)" + ot + "*\\]", ct = ":(" + at + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + lt.replace(3, 8) + ")*)|.*)\\)|)", ut = new RegExp("^" + ot + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ot + "+$", "g"), dt = new RegExp("^" + ot + "*," + ot + "*"), pt = new RegExp("^" + ot + "*([>+~]|" + ot + ")" + ot + "*"), ft = new RegExp(ot + "*[+~]"), ht = new RegExp("=" + ot + "*([^\\]'\"]*)" + ot + "*\\]", "g"), mt = new RegExp(ct), gt = new RegExp("^" + st + "$"), vt = {
- ID: new RegExp("^#(" + at + ")"),
- CLASS: new RegExp("^\\.(" + at + ")"),
- TAG: new RegExp("^(" + at.replace("w", "w*") + ")"),
+ }, it = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", ot = "[\\x20\\t\\r\\n\\f]", st = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", at = st.replace("w", "w#"), lt = "\\[" + ot + "*(" + st + ")" + ot + "*(?:([*^$|!~]?=)" + ot + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + at + ")|)|)" + ot + "*\\]", ct = ":(" + st + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + lt.replace(3, 8) + ")*)|.*)\\)|)", ut = new RegExp("^" + ot + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ot + "+$", "g"), dt = new RegExp("^" + ot + "*," + ot + "*"), ht = new RegExp("^" + ot + "*([>+~]|" + ot + ")" + ot + "*"), pt = new RegExp(ot + "*[+~]"), ft = new RegExp("=" + ot + "*([^\\]'\"]*)" + ot + "*\\]", "g"), gt = new RegExp(ct), mt = new RegExp("^" + at + "$"), vt = {
+ ID: new RegExp("^#(" + st + ")"),
+ CLASS: new RegExp("^\\.(" + st + ")"),
+ TAG: new RegExp("^(" + st.replace("w", "w*") + ")"),
ATTR: new RegExp("^" + lt),
PSEUDO: new RegExp("^" + ct),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ot + "*(even|odd|(([+-]|)(\\d*)n|)" + ot + "*(?:([+-]|)" + ot + "*(\\d+)|))" + ot + "*\\)|)", "i"),
bool: new RegExp("^(?:" + it + ")$", "i"),
needsContext: new RegExp("^" + ot + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ot + "*((?:-\\d)?\\d*)" + ot + "*\\)|)(?=[^-]|$)", "i")
- }, bt = /^[^{]+\{\s*\[native \w/, yt = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, xt = /^(?:input|select|textarea|button)$/i, wt = /^h\d$/i, Ct = /'|\\/g, kt = new RegExp("\\\\([\\da-f]{1,6}" + ot + "?|(" + ot + ")|.)", "ig"), St = function(e, t, n) {
+ }, bt = /^[^{]+\{\s*\[native \w/, yt = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, wt = /^(?:input|select|textarea|button)$/i, Ct = /^h\d$/i, xt = /'|\\/g, Et = new RegExp("\\\\([\\da-f]{1,6}" + ot + "?|(" + ot + ")|.)", "ig"), At = function(e, t, n) {
var i = "0x" + t - 65536;
return i !== i || n ? t : 0 > i ? String.fromCharCode(i + 65536) : String.fromCharCode(55296 | i >> 10, 56320 | 1023 & i);
};
try {
- et.apply(Y = tt.call(F.childNodes), F.childNodes), Y[F.childNodes.length].nodeType;
- } catch (_t) {
+ et.apply(Z = tt.call(O.childNodes), O.childNodes), Z[O.childNodes.length].nodeType;
+ } catch (St) {
et = {
- apply: Y.length ? function(e, t) {
+ apply: Z.length ? function(e, t) {
Q.apply(e, tt.call(t));
} : function(e, t) {
for (var n = e.length, i = 0; e[n++] = t[i++]; ) ;
@@ -1454,41 +1585,41 @@ function css_browser_selector(e) {
}
};
}
- E = n.isXML = function(e) {
+ F = n.isXML = function(e) {
var t = e && (e.ownerDocument || e).documentElement;
return t ? "HTML" !== t.nodeName : !1;
- }, k = n.support = {}, A = n.setDocument = function(e) {
- var t = e ? e.ownerDocument || e : F, n = t.defaultView;
- return t !== M && 9 === t.nodeType && t.documentElement ? (M = t, L = t.documentElement,
- $ = !E(t), n && n.attachEvent && n !== n.top && n.attachEvent("onbeforeunload", function() {
- A();
- }), k.attributes = r(function(e) {
+ }, E = n.support = {}, T = n.setDocument = function(e) {
+ var t = e ? e.ownerDocument || e : O, n = t.defaultView;
+ return t !== L && 9 === t.nodeType && t.documentElement ? (L = t, B = t.documentElement,
+ M = !F(t), n && n.attachEvent && n !== n.top && n.attachEvent("onbeforeunload", function() {
+ T();
+ }), E.attributes = r(function(e) {
return e.className = "i", !e.getAttribute("className");
- }), k.getElementsByTagName = r(function(e) {
+ }), E.getElementsByTagName = r(function(e) {
return e.appendChild(t.createComment("")), !e.getElementsByTagName("*").length;
- }), k.getElementsByClassName = r(function(e) {
+ }), E.getElementsByClassName = r(function(e) {
return e.innerHTML = "", e.firstChild.className = "i",
2 === e.getElementsByClassName("i").length;
- }), k.getById = r(function(e) {
- return L.appendChild(e).id = O, !t.getElementsByName || !t.getElementsByName(O).length;
- }), k.getById ? (_.find.ID = function(e, t) {
- if (typeof t.getElementById !== X && $) {
+ }), E.getById = r(function(e) {
+ return B.appendChild(e).id = z, !t.getElementsByName || !t.getElementsByName(z).length;
+ }), E.getById ? (S.find.ID = function(e, t) {
+ if (typeof t.getElementById !== K && M) {
var n = t.getElementById(e);
return n && n.parentNode ? [ n ] : [];
}
- }, _.filter.ID = function(e) {
- var t = e.replace(kt, St);
+ }, S.filter.ID = function(e) {
+ var t = e.replace(Et, At);
return function(e) {
return e.getAttribute("id") === t;
};
- }) : (delete _.find.ID, _.filter.ID = function(e) {
- var t = e.replace(kt, St);
+ }) : (delete S.find.ID, S.filter.ID = function(e) {
+ var t = e.replace(Et, At);
return function(e) {
- var n = typeof e.getAttributeNode !== X && e.getAttributeNode("id");
+ var n = typeof e.getAttributeNode !== K && e.getAttributeNode("id");
return n && n.value === t;
};
- }), _.find.TAG = k.getElementsByTagName ? function(e, t) {
- return typeof t.getElementsByTagName !== X ? t.getElementsByTagName(e) : void 0;
+ }), S.find.TAG = E.getElementsByTagName ? function(e, t) {
+ return typeof t.getElementsByTagName !== K ? t.getElementsByTagName(e) : void 0;
} : function(e, t) {
var n, i = [], o = 0, r = t.getElementsByTagName(e);
if ("*" === e) {
@@ -1496,72 +1627,72 @@ function css_browser_selector(e) {
return i;
}
return r;
- }, _.find.CLASS = k.getElementsByClassName && function(e, t) {
- return typeof t.getElementsByClassName !== X && $ ? t.getElementsByClassName(e) : void 0;
- }, R = [], z = [], (k.qsa = bt.test(t.querySelectorAll)) && (r(function(e) {
- e.innerHTML = "", e.querySelectorAll("[selected]").length || z.push("\\[" + ot + "*(?:value|" + it + ")"),
- e.querySelectorAll(":checked").length || z.push(":checked");
+ }, S.find.CLASS = E.getElementsByClassName && function(e, t) {
+ return typeof t.getElementsByClassName !== K && M ? t.getElementsByClassName(e) : void 0;
+ }, I = [], R = [], (E.qsa = bt.test(t.querySelectorAll)) && (r(function(e) {
+ e.innerHTML = "", e.querySelectorAll("[selected]").length || R.push("\\[" + ot + "*(?:value|" + it + ")"),
+ e.querySelectorAll(":checked").length || R.push(":checked");
}), r(function(e) {
var n = t.createElement("input");
- n.setAttribute("type", "hidden"), e.appendChild(n).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && z.push("[*^$]=" + ot + "*(?:''|\"\")"),
- e.querySelectorAll(":enabled").length || z.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"),
- z.push(",.*:");
- })), (k.matchesSelector = bt.test(j = L.webkitMatchesSelector || L.mozMatchesSelector || L.oMatchesSelector || L.msMatchesSelector)) && r(function(e) {
- k.disconnectedMatch = j.call(e, "div"), j.call(e, "[s!='']:x"), R.push("!=", ct);
- }), z = z.length && new RegExp(z.join("|")), R = R.length && new RegExp(R.join("|")),
- D = bt.test(L.contains) || L.compareDocumentPosition ? function(e, t) {
+ n.setAttribute("type", "hidden"), e.appendChild(n).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && R.push("[*^$]=" + ot + "*(?:''|\"\")"),
+ e.querySelectorAll(":enabled").length || R.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"),
+ R.push(",.*:");
+ })), (E.matchesSelector = bt.test(P = B.webkitMatchesSelector || B.mozMatchesSelector || B.oMatchesSelector || B.msMatchesSelector)) && r(function(e) {
+ E.disconnectedMatch = P.call(e, "div"), P.call(e, "[s!='']:x"), I.push("!=", ct);
+ }), R = R.length && new RegExp(R.join("|")), I = I.length && new RegExp(I.join("|")),
+ N = bt.test(B.contains) || B.compareDocumentPosition ? function(e, t) {
var n = 9 === e.nodeType ? e.documentElement : e, i = t && t.parentNode;
return e === i || !(!i || 1 !== i.nodeType || !(n.contains ? n.contains(i) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(i)));
} : function(e, t) {
if (t) for (;t = t.parentNode; ) if (t === e) return !0;
return !1;
- }, V = L.compareDocumentPosition ? function(e, n) {
- if (e === n) return W = !0, 0;
+ }, V = B.compareDocumentPosition ? function(e, n) {
+ if (e === n) return G = !0, 0;
var i = n.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(n);
- return i ? 1 & i || !k.sortDetached && n.compareDocumentPosition(e) === i ? e === t || D(F, e) ? -1 : n === t || D(F, n) ? 1 : P ? nt.call(P, e) - nt.call(P, n) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1;
+ return i ? 1 & i || !E.sortDetached && n.compareDocumentPosition(e) === i ? e === t || N(O, e) ? -1 : n === t || N(O, n) ? 1 : D ? nt.call(D, e) - nt.call(D, n) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1;
} : function(e, n) {
- var i, o = 0, r = e.parentNode, a = n.parentNode, l = [ e ], c = [ n ];
- if (e === n) return W = !0, 0;
- if (!r || !a) return e === t ? -1 : n === t ? 1 : r ? -1 : a ? 1 : P ? nt.call(P, e) - nt.call(P, n) : 0;
- if (r === a) return s(e, n);
+ var i, o = 0, r = e.parentNode, s = n.parentNode, l = [ e ], c = [ n ];
+ if (e === n) return G = !0, 0;
+ if (!r || !s) return e === t ? -1 : n === t ? 1 : r ? -1 : s ? 1 : D ? nt.call(D, e) - nt.call(D, n) : 0;
+ if (r === s) return a(e, n);
for (i = e; i = i.parentNode; ) l.unshift(i);
for (i = n; i = i.parentNode; ) c.unshift(i);
for (;l[o] === c[o]; ) o++;
- return o ? s(l[o], c[o]) : l[o] === F ? -1 : c[o] === F ? 1 : 0;
- }, t) : M;
+ return o ? a(l[o], c[o]) : l[o] === O ? -1 : c[o] === O ? 1 : 0;
+ }, t) : L;
}, n.matches = function(e, t) {
return n(e, null, null, t);
}, n.matchesSelector = function(e, t) {
- if ((e.ownerDocument || e) !== M && A(e), t = t.replace(ht, "='$1']"), !(!k.matchesSelector || !$ || R && R.test(t) || z && z.test(t))) try {
- var i = j.call(e, t);
- if (i || k.disconnectedMatch || e.document && 11 !== e.document.nodeType) return i;
+ if ((e.ownerDocument || e) !== L && T(e), t = t.replace(ft, "='$1']"), !(!E.matchesSelector || !M || I && I.test(t) || R && R.test(t))) try {
+ var i = P.call(e, t);
+ if (i || E.disconnectedMatch || e.document && 11 !== e.document.nodeType) return i;
} catch (o) {}
- return n(t, M, null, [ e ]).length > 0;
+ return n(t, L, null, [ e ]).length > 0;
}, n.contains = function(e, t) {
- return (e.ownerDocument || e) !== M && A(e), D(e, t);
+ return (e.ownerDocument || e) !== L && T(e), N(e, t);
}, n.attr = function(e, n) {
- (e.ownerDocument || e) !== M && A(e);
- var i = _.attrHandle[n.toLowerCase()], o = i && Z.call(_.attrHandle, n.toLowerCase()) ? i(e, n, !$) : t;
- return o === t ? k.attributes || !$ ? e.getAttribute(n) : (o = e.getAttributeNode(n)) && o.specified ? o.value : null : o;
+ (e.ownerDocument || e) !== L && T(e);
+ var i = S.attrHandle[n.toLowerCase()], o = i && Y.call(S.attrHandle, n.toLowerCase()) ? i(e, n, !M) : t;
+ return o === t ? E.attributes || !M ? e.getAttribute(n) : (o = e.getAttributeNode(n)) && o.specified ? o.value : null : o;
}, n.error = function(e) {
throw new Error("Syntax error, unrecognized expression: " + e);
}, n.uniqueSort = function(e) {
var t, n = [], i = 0, o = 0;
- if (W = !k.detectDuplicates, P = !k.sortStable && e.slice(0), e.sort(V), W) {
+ if (G = !E.detectDuplicates, D = !E.sortStable && e.slice(0), e.sort(V), G) {
for (;t = e[o++]; ) t === e[o] && (i = n.push(o));
for (;i--; ) e.splice(n[i], 1);
}
return e;
- }, T = n.getText = function(e) {
+ }, k = n.getText = function(e) {
var t, n = "", i = 0, o = e.nodeType;
if (o) {
if (1 === o || 9 === o || 11 === o) {
if ("string" == typeof e.textContent) return e.textContent;
- for (e = e.firstChild; e; e = e.nextSibling) n += T(e);
+ for (e = e.firstChild; e; e = e.nextSibling) n += k(e);
} else if (3 === o || 4 === o) return e.nodeValue;
- } else for (;t = e[i]; i++) n += T(t);
+ } else for (;t = e[i]; i++) n += k(t);
return n;
- }, _ = n.selectors = {
+ }, S = n.selectors = {
cacheLength: 50,
createPseudo: o,
match: vt,
@@ -1585,7 +1716,7 @@ function css_browser_selector(e) {
},
preFilter: {
ATTR: function(e) {
- return e[1] = e[1].replace(kt, St), e[3] = (e[4] || e[5] || "").replace(kt, St),
+ return e[1] = e[1].replace(Et, At), e[3] = (e[4] || e[5] || "").replace(Et, At),
"~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4);
},
CHILD: function(e) {
@@ -1595,13 +1726,13 @@ function css_browser_selector(e) {
},
PSEUDO: function(e) {
var n, i = !e[5] && e[2];
- return vt.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : i && mt.test(i) && (n = p(i, !0)) && (n = i.indexOf(")", i.length - n) - i.length) && (e[0] = e[0].slice(0, n),
+ return vt.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : i && gt.test(i) && (n = h(i, !0)) && (n = i.indexOf(")", i.length - n) - i.length) && (e[0] = e[0].slice(0, n),
e[2] = i.slice(0, n)), e.slice(0, 3));
}
},
filter: {
TAG: function(e) {
- var t = e.replace(kt, St).toLowerCase();
+ var t = e.replace(Et, At).toLowerCase();
return "*" === e ? function() {
return !0;
} : function(e) {
@@ -1609,9 +1740,9 @@ function css_browser_selector(e) {
};
},
CLASS: function(e) {
- var t = B[e + " "];
- return t || (t = new RegExp("(^|" + ot + ")" + e + "(" + ot + "|$)")) && B(e, function(e) {
- return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== X && e.getAttribute("class") || "");
+ var t = q[e + " "];
+ return t || (t = new RegExp("(^|" + ot + ")" + e + "(" + ot + "|$)")) && q(e, function(e) {
+ return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== K && e.getAttribute("class") || "");
});
},
ATTR: function(e, t, i) {
@@ -1621,35 +1752,35 @@ function css_browser_selector(e) {
};
},
CHILD: function(e, t, n, i, o) {
- var r = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), s = "of-type" === t;
+ var r = "nth" !== e.slice(0, 3), s = "last" !== e.slice(-4), a = "of-type" === t;
return 1 === i && 0 === o ? function(e) {
return !!e.parentNode;
} : function(t, n, l) {
- var c, u, d, p, f, h, m = r !== a ? "nextSibling" : "previousSibling", g = t.parentNode, v = s && t.nodeName.toLowerCase(), b = !l && !s;
- if (g) {
+ var c, u, d, h, p, f, g = r !== s ? "nextSibling" : "previousSibling", m = t.parentNode, v = a && t.nodeName.toLowerCase(), b = !l && !a;
+ if (m) {
if (r) {
- for (;m; ) {
- for (d = t; d = d[m]; ) if (s ? d.nodeName.toLowerCase() === v : 1 === d.nodeType) return !1;
- h = m = "only" === e && !h && "nextSibling";
+ for (;g; ) {
+ for (d = t; d = d[g]; ) if (a ? d.nodeName.toLowerCase() === v : 1 === d.nodeType) return !1;
+ f = g = "only" === e && !f && "nextSibling";
}
return !0;
}
- if (h = [ a ? g.firstChild : g.lastChild ], a && b) {
- for (u = g[O] || (g[O] = {}), c = u[e] || [], f = c[0] === q && c[1], p = c[0] === q && c[2],
- d = f && g.childNodes[f]; d = ++f && d && d[m] || (p = f = 0) || h.pop(); ) if (1 === d.nodeType && ++p && d === t) {
- u[e] = [ q, f, p ];
+ if (f = [ s ? m.firstChild : m.lastChild ], s && b) {
+ for (u = m[z] || (m[z] = {}), c = u[e] || [], p = c[0] === j && c[1], h = c[0] === j && c[2],
+ d = p && m.childNodes[p]; d = ++p && d && d[g] || (h = p = 0) || f.pop(); ) if (1 === d.nodeType && ++h && d === t) {
+ u[e] = [ j, p, h ];
break;
}
- } else if (b && (c = (t[O] || (t[O] = {}))[e]) && c[0] === q) p = c[1]; else for (;(d = ++f && d && d[m] || (p = f = 0) || h.pop()) && ((s ? d.nodeName.toLowerCase() !== v : 1 !== d.nodeType) || !++p || (b && ((d[O] || (d[O] = {}))[e] = [ q, p ]),
+ } else if (b && (c = (t[z] || (t[z] = {}))[e]) && c[0] === j) h = c[1]; else for (;(d = ++p && d && d[g] || (h = p = 0) || f.pop()) && ((a ? d.nodeName.toLowerCase() !== v : 1 !== d.nodeType) || !++h || (b && ((d[z] || (d[z] = {}))[e] = [ j, h ]),
d !== t)); ) ;
- return p -= o, p === i || 0 === p % i && p / i >= 0;
+ return h -= o, h === i || 0 === h % i && h / i >= 0;
}
};
},
PSEUDO: function(e, t) {
- var i, r = _.pseudos[e] || _.setFilters[e.toLowerCase()] || n.error("unsupported pseudo: " + e);
- return r[O] ? r(t) : r.length > 1 ? (i = [ e, e, "", t ], _.setFilters.hasOwnProperty(e.toLowerCase()) ? o(function(e, n) {
- for (var i, o = r(e, t), a = o.length; a--; ) i = nt.call(e, o[a]), e[i] = !(n[i] = o[a]);
+ var i, r = S.pseudos[e] || S.setFilters[e.toLowerCase()] || n.error("unsupported pseudo: " + e);
+ return r[z] ? r(t) : r.length > 1 ? (i = [ e, e, "", t ], S.setFilters.hasOwnProperty(e.toLowerCase()) ? o(function(e, n) {
+ for (var i, o = r(e, t), s = o.length; s--; ) i = nt.call(e, o[s]), e[i] = !(n[i] = o[s]);
}) : function(e) {
return r(e, 0, i);
}) : r;
@@ -1657,9 +1788,9 @@ function css_browser_selector(e) {
},
pseudos: {
not: o(function(e) {
- var t = [], n = [], i = N(e.replace(ut, "$1"));
- return i[O] ? o(function(e, t, n, o) {
- for (var r, a = i(e, null, o, []), s = e.length; s--; ) (r = a[s]) && (e[s] = !(t[s] = r));
+ var t = [], n = [], i = _(e.replace(ut, "$1"));
+ return i[z] ? o(function(e, t, n, o) {
+ for (var r, s = i(e, null, o, []), a = e.length; a--; ) (r = s[a]) && (e[a] = !(t[a] = r));
}) : function(e, o, r) {
return t[0] = e, i(t, null, r, n), !n.pop();
};
@@ -1671,14 +1802,14 @@ function css_browser_selector(e) {
}),
contains: o(function(e) {
return function(t) {
- return (t.textContent || t.innerText || T(t)).indexOf(e) > -1;
+ return (t.textContent || t.innerText || k(t)).indexOf(e) > -1;
};
}),
lang: o(function(e) {
- return gt.test(e || "") || n.error("unsupported lang: " + e), e = e.replace(kt, St).toLowerCase(),
+ return mt.test(e || "") || n.error("unsupported lang: " + e), e = e.replace(Et, At).toLowerCase(),
function(t) {
var n;
- do if (n = $ ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(),
+ do if (n = M ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(),
n === e || 0 === n.indexOf(e + "-"); while ((t = t.parentNode) && 1 === t.nodeType);
return !1;
};
@@ -1688,10 +1819,10 @@ function css_browser_selector(e) {
return n && n.slice(1) === t.id;
},
root: function(e) {
- return e === L;
+ return e === B;
},
focus: function(e) {
- return e === M.activeElement && (!M.hasFocus || M.hasFocus()) && !!(e.type || e.href || ~e.tabIndex);
+ return e === L.activeElement && (!L.hasFocus || L.hasFocus()) && !!(e.type || e.href || ~e.tabIndex);
},
enabled: function(e) {
return e.disabled === !1;
@@ -1711,13 +1842,13 @@ function css_browser_selector(e) {
return !0;
},
parent: function(e) {
- return !_.pseudos.empty(e);
+ return !S.pseudos.empty(e);
},
header: function(e) {
- return wt.test(e.nodeName);
+ return Ct.test(e.nodeName);
},
input: function(e) {
- return xt.test(e.nodeName);
+ return wt.test(e.nodeName);
},
button: function(e) {
var t = e.nodeName.toLowerCase();
@@ -1753,69 +1884,69 @@ function css_browser_selector(e) {
return e;
})
}
- }, _.pseudos.nth = _.pseudos.eq;
- for (C in {
+ }, S.pseudos.nth = S.pseudos.eq;
+ for (x in {
radio: !0,
checkbox: !0,
file: !0,
password: !0,
image: !0
- }) _.pseudos[C] = l(C);
- for (C in {
+ }) S.pseudos[x] = l(x);
+ for (x in {
submit: !0,
reset: !0
- }) _.pseudos[C] = c(C);
- d.prototype = _.filters = _.pseudos, _.setFilters = new d(), N = n.compile = function(e, t) {
- var n, i = [], o = [], r = G[e + " "];
+ }) S.pseudos[x] = c(x);
+ d.prototype = S.filters = S.pseudos, S.setFilters = new d(), _ = n.compile = function(e, t) {
+ var n, i = [], o = [], r = U[e + " "];
if (!r) {
- for (t || (t = p(e)), n = t.length; n--; ) r = b(t[n]), r[O] ? i.push(r) : o.push(r);
- r = G(e, y(o, i));
+ for (t || (t = h(e)), n = t.length; n--; ) r = b(t[n]), r[z] ? i.push(r) : o.push(r);
+ r = U(e, y(o, i));
}
return r;
- }, k.sortStable = O.split("").sort(V).join("") === O, k.detectDuplicates = W, A(),
- k.sortDetached = r(function(e) {
- return 1 & e.compareDocumentPosition(M.createElement("div"));
+ }, E.sortStable = z.split("").sort(V).join("") === z, E.detectDuplicates = G, T(),
+ E.sortDetached = r(function(e) {
+ return 1 & e.compareDocumentPosition(L.createElement("div"));
}), r(function(e) {
return e.innerHTML = "", "#" === e.firstChild.getAttribute("href");
- }) || a("type|href|height|width", function(e, t, n) {
+ }) || s("type|href|height|width", function(e, t, n) {
return n ? void 0 : e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2);
- }), k.attributes && r(function(e) {
+ }), E.attributes && r(function(e) {
return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value");
- }) || a("value", function(e, t, n) {
+ }) || s("value", function(e, t, n) {
return n || "input" !== e.nodeName.toLowerCase() ? void 0 : e.defaultValue;
}), r(function(e) {
return null == e.getAttribute("disabled");
- }) || a(it, function(e, t, n) {
+ }) || s(it, function(e, t, n) {
var i;
return n ? void 0 : (i = e.getAttributeNode(t)) && i.specified ? i.value : e[t] === !0 ? t.toLowerCase() : null;
}), rt.find = n, rt.expr = n.selectors, rt.expr[":"] = rt.expr.pseudos, rt.unique = n.uniqueSort,
rt.text = n.getText, rt.isXMLDoc = n.isXML, rt.contains = n.contains;
}(e);
- var ht = {};
+ var ft = {};
rt.Callbacks = function(e) {
- e = "string" == typeof e ? ht[e] || i(e) : rt.extend({}, e);
- var n, o, r, a, s, l, c = [], u = !e.once && [], d = function(t) {
- for (n = e.memory && t, o = !0, l = a || 0, a = 0, s = c.length, r = !0; c && s > l; l++) if (c[l].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
+ e = "string" == typeof e ? ft[e] || i(e) : rt.extend({}, e);
+ var n, o, r, s, a, l, c = [], u = !e.once && [], d = function(t) {
+ for (n = e.memory && t, o = !0, l = s || 0, s = 0, a = c.length, r = !0; c && a > l; l++) if (c[l].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
n = !1;
break;
}
- r = !1, c && (u ? u.length && d(u.shift()) : n ? c = [] : p.disable());
- }, p = {
+ r = !1, c && (u ? u.length && d(u.shift()) : n ? c = [] : h.disable());
+ }, h = {
add: function() {
if (c) {
var t = c.length;
(function i(t) {
rt.each(t, function(t, n) {
var o = rt.type(n);
- "function" === o ? e.unique && p.has(n) || c.push(n) : n && n.length && "string" !== o && i(n);
+ "function" === o ? e.unique && h.has(n) || c.push(n) : n && n.length && "string" !== o && i(n);
});
- })(arguments), r ? s = c.length : n && (a = t, d(n));
+ })(arguments), r ? a = c.length : n && (s = t, d(n));
}
return this;
},
remove: function() {
return c && rt.each(arguments, function(e, t) {
- for (var n; (n = rt.inArray(t, c, n)) > -1; ) c.splice(n, 1), r && (s >= n && s--,
+ for (var n; (n = rt.inArray(t, c, n)) > -1; ) c.splice(n, 1), r && (a >= n && a--,
l >= n && l--);
}), this;
},
@@ -1823,7 +1954,7 @@ function css_browser_selector(e) {
return e ? rt.inArray(e, c) > -1 : !(!c || !c.length);
},
empty: function() {
- return c = [], s = 0, this;
+ return c = [], a = 0, this;
},
disable: function() {
return c = u = n = t, this;
@@ -1832,7 +1963,7 @@ function css_browser_selector(e) {
return !c;
},
lock: function() {
- return u = t, n || p.disable(), this;
+ return u = t, n || h.disable(), this;
},
locked: function() {
return !u;
@@ -1842,13 +1973,13 @@ function css_browser_selector(e) {
this;
},
fire: function() {
- return p.fireWith(this, arguments), this;
+ return h.fireWith(this, arguments), this;
},
fired: function() {
return !!o;
}
};
- return p;
+ return h;
}, rt.extend({
Deferred: function(e) {
var t = [ [ "resolve", "done", rt.Callbacks("once memory"), "resolved" ], [ "reject", "fail", rt.Callbacks("once memory"), "rejected" ], [ "notify", "progress", rt.Callbacks("memory") ] ], n = "pending", i = {
@@ -1862,10 +1993,10 @@ function css_browser_selector(e) {
var e = arguments;
return rt.Deferred(function(n) {
rt.each(t, function(t, r) {
- var a = r[0], s = rt.isFunction(e[t]) && e[t];
+ var s = r[0], a = rt.isFunction(e[t]) && e[t];
o[r[1]](function() {
- var e = s && s.apply(this, arguments);
- e && rt.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === i ? n.promise() : this, s ? [ e ] : arguments);
+ var e = a && a.apply(this, arguments);
+ e && rt.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === i ? n.promise() : this, a ? [ e ] : arguments);
});
}), e = null;
}).promise();
@@ -1875,48 +2006,48 @@ function css_browser_selector(e) {
}
}, o = {};
return i.pipe = i.then, rt.each(t, function(e, r) {
- var a = r[2], s = r[3];
- i[r[1]] = a.add, s && a.add(function() {
- n = s;
+ var s = r[2], a = r[3];
+ i[r[1]] = s.add, a && s.add(function() {
+ n = a;
}, t[1 ^ e][2].disable, t[2][2].lock), o[r[0]] = function() {
return o[r[0] + "With"](this === o ? i : this, arguments), this;
- }, o[r[0] + "With"] = a.fireWith;
+ }, o[r[0] + "With"] = s.fireWith;
}), i.promise(o), e && e.call(o, o), o;
},
when: function(e) {
- var t, n, i, o = 0, r = et.call(arguments), a = r.length, s = 1 !== a || e && rt.isFunction(e.promise) ? a : 0, l = 1 === s ? e : rt.Deferred(), c = function(e, n, i) {
+ var t, n, i, o = 0, r = et.call(arguments), s = r.length, a = 1 !== s || e && rt.isFunction(e.promise) ? s : 0, l = 1 === a ? e : rt.Deferred(), c = function(e, n, i) {
return function(o) {
- n[e] = this, i[e] = arguments.length > 1 ? et.call(arguments) : o, i === t ? l.notifyWith(n, i) : --s || l.resolveWith(n, i);
+ n[e] = this, i[e] = arguments.length > 1 ? et.call(arguments) : o, i === t ? l.notifyWith(n, i) : --a || l.resolveWith(n, i);
};
};
- if (a > 1) for (t = new Array(a), n = new Array(a), i = new Array(a); a > o; o++) r[o] && rt.isFunction(r[o].promise) ? r[o].promise().done(c(o, i, r)).fail(l.reject).progress(c(o, n, t)) : --s;
- return s || l.resolveWith(i, r), l.promise();
+ if (s > 1) for (t = new Array(s), n = new Array(s), i = new Array(s); s > o; o++) r[o] && rt.isFunction(r[o].promise) ? r[o].promise().done(c(o, i, r)).fail(l.reject).progress(c(o, n, t)) : --a;
+ return a || l.resolveWith(i, r), l.promise();
}
}), rt.support = function(t) {
- var n = G.createElement("input"), i = G.createDocumentFragment(), o = G.createElement("div"), r = G.createElement("select"), a = r.appendChild(G.createElement("option"));
- return n.type ? (n.type = "checkbox", t.checkOn = "" !== n.value, t.optSelected = a.selected,
+ var n = U.createElement("input"), i = U.createDocumentFragment(), o = U.createElement("div"), r = U.createElement("select"), s = r.appendChild(U.createElement("option"));
+ return n.type ? (n.type = "checkbox", t.checkOn = "" !== n.value, t.optSelected = s.selected,
t.reliableMarginRight = !0, t.boxSizingReliable = !0, t.pixelPosition = !1, n.checked = !0,
- t.noCloneChecked = n.cloneNode(!0).checked, r.disabled = !0, t.optDisabled = !a.disabled,
- n = G.createElement("input"), n.value = "t", n.type = "radio", t.radioValue = "t" === n.value,
+ t.noCloneChecked = n.cloneNode(!0).checked, r.disabled = !0, t.optDisabled = !s.disabled,
+ n = U.createElement("input"), n.value = "t", n.type = "radio", t.radioValue = "t" === n.value,
n.setAttribute("checked", "t"), n.setAttribute("name", "t"), i.appendChild(n), t.checkClone = i.cloneNode(!0).cloneNode(!0).lastChild.checked,
t.focusinBubbles = "onfocusin" in e, o.style.backgroundClip = "content-box", o.cloneNode(!0).style.backgroundClip = "",
t.clearCloneStyle = "content-box" === o.style.backgroundClip, rt(function() {
- var n, i, r = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box", a = G.getElementsByTagName("body")[0];
- a && (n = G.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",
- a.appendChild(n).appendChild(o), o.innerHTML = "", o.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",
- rt.swap(a, null != a.style.zoom ? {
+ var n, i, r = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box", s = U.getElementsByTagName("body")[0];
+ s && (n = U.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",
+ s.appendChild(n).appendChild(o), o.innerHTML = "", o.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",
+ rt.swap(s, null != s.style.zoom ? {
zoom: 1
} : {}, function() {
t.boxSizing = 4 === o.offsetWidth;
}), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(o, null) || {}).top,
t.boxSizingReliable = "4px" === (e.getComputedStyle(o, null) || {
width: "4px"
- }).width, i = o.appendChild(G.createElement("div")), i.style.cssText = o.style.cssText = r,
+ }).width, i = o.appendChild(U.createElement("div")), i.style.cssText = o.style.cssText = r,
i.style.marginRight = i.style.width = "0", o.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(i, null) || {}).marginRight)),
- a.removeChild(n));
+ s.removeChild(n));
}), t) : t;
}({});
- var mt, gt, vt = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, bt = /([A-Z])/g;
+ var gt, mt, vt = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, bt = /([A-Z])/g;
o.uid = 1, o.accepts = function(e) {
return e.nodeType ? 1 === e.nodeType || 9 === e.nodeType : !0;
}, o.prototype = {
@@ -1950,11 +2081,11 @@ function css_browser_selector(e) {
i !== t ? i : n);
},
remove: function(e, n) {
- var i, o, r, a = this.key(e), s = this.cache[a];
- if (n === t) this.cache[a] = {}; else {
- rt.isArray(n) ? o = n.concat(n.map(rt.camelCase)) : (r = rt.camelCase(n), n in s ? o = [ n, r ] : (o = r,
- o = o in s ? [ o ] : o.match(st) || [])), i = o.length;
- for (;i--; ) delete s[o[i]];
+ var i, o, r, s = this.key(e), a = this.cache[s];
+ if (n === t) this.cache[s] = {}; else {
+ rt.isArray(n) ? o = n.concat(n.map(rt.camelCase)) : (r = rt.camelCase(n), n in a ? o = [ n, r ] : (o = r,
+ o = o in a ? [ o ] : o.match(at) || [])), i = o.length;
+ for (;i--; ) delete a[o[i]];
}
},
hasData: function(e) {
@@ -1963,72 +2094,72 @@ function css_browser_selector(e) {
discard: function(e) {
e[this.expando] && delete this.cache[e[this.expando]];
}
- }, mt = new o(), gt = new o(), rt.extend({
+ }, gt = new o(), mt = new o(), rt.extend({
acceptData: o.accepts,
hasData: function(e) {
- return mt.hasData(e) || gt.hasData(e);
+ return gt.hasData(e) || mt.hasData(e);
},
data: function(e, t, n) {
- return mt.access(e, t, n);
- },
- removeData: function(e, t) {
- mt.remove(e, t);
- },
- _data: function(e, t, n) {
return gt.access(e, t, n);
},
- _removeData: function(e, t) {
+ removeData: function(e, t) {
gt.remove(e, t);
+ },
+ _data: function(e, t, n) {
+ return mt.access(e, t, n);
+ },
+ _removeData: function(e, t) {
+ mt.remove(e, t);
}
}), rt.fn.extend({
data: function(e, n) {
- var i, o, a = this[0], s = 0, l = null;
+ var i, o, s = this[0], a = 0, l = null;
if (e === t) {
- if (this.length && (l = mt.get(a), 1 === a.nodeType && !gt.get(a, "hasDataAttrs"))) {
- for (i = a.attributes; s < i.length; s++) o = i[s].name, 0 === o.indexOf("data-") && (o = rt.camelCase(o.slice(5)),
- r(a, o, l[o]));
- gt.set(a, "hasDataAttrs", !0);
+ if (this.length && (l = gt.get(s), 1 === s.nodeType && !mt.get(s, "hasDataAttrs"))) {
+ for (i = s.attributes; a < i.length; a++) o = i[a].name, 0 === o.indexOf("data-") && (o = rt.camelCase(o.slice(5)),
+ r(s, o, l[o]));
+ mt.set(s, "hasDataAttrs", !0);
}
return l;
}
return "object" == typeof e ? this.each(function() {
- mt.set(this, e);
+ gt.set(this, e);
}) : rt.access(this, function(n) {
var i, o = rt.camelCase(e);
- if (a && n === t) {
- if (i = mt.get(a, e), i !== t) return i;
- if (i = mt.get(a, o), i !== t) return i;
- if (i = r(a, o, t), i !== t) return i;
+ if (s && n === t) {
+ if (i = gt.get(s, e), i !== t) return i;
+ if (i = gt.get(s, o), i !== t) return i;
+ if (i = r(s, o, t), i !== t) return i;
} else this.each(function() {
- var i = mt.get(this, o);
- mt.set(this, o, n), -1 !== e.indexOf("-") && i !== t && mt.set(this, e, n);
+ var i = gt.get(this, o);
+ gt.set(this, o, n), -1 !== e.indexOf("-") && i !== t && gt.set(this, e, n);
});
}, null, n, arguments.length > 1, null, !0);
},
removeData: function(e) {
return this.each(function() {
- mt.remove(this, e);
+ gt.remove(this, e);
});
}
}), rt.extend({
queue: function(e, t, n) {
var i;
- return e ? (t = (t || "fx") + "queue", i = gt.get(e, t), n && (!i || rt.isArray(n) ? i = gt.access(e, t, rt.makeArray(n)) : i.push(n)),
+ return e ? (t = (t || "fx") + "queue", i = mt.get(e, t), n && (!i || rt.isArray(n) ? i = mt.access(e, t, rt.makeArray(n)) : i.push(n)),
i || []) : void 0;
},
dequeue: function(e, t) {
t = t || "fx";
- var n = rt.queue(e, t), i = n.length, o = n.shift(), r = rt._queueHooks(e, t), a = function() {
+ var n = rt.queue(e, t), i = n.length, o = n.shift(), r = rt._queueHooks(e, t), s = function() {
rt.dequeue(e, t);
};
"inprogress" === o && (o = n.shift(), i--), o && ("fx" === t && n.unshift("inprogress"),
- delete r.stop, o.call(e, a, r)), !i && r && r.empty.fire();
+ delete r.stop, o.call(e, s, r)), !i && r && r.empty.fire();
},
_queueHooks: function(e, t) {
var n = t + "queueHooks";
- return gt.get(e, n) || gt.access(e, n, {
+ return mt.get(e, n) || mt.access(e, n, {
empty: rt.Callbacks("once memory").add(function() {
- gt.remove(e, [ t + "queue", n ]);
+ mt.remove(e, [ t + "queue", n ]);
})
});
}
@@ -2057,15 +2188,15 @@ function css_browser_selector(e) {
return this.queue(e || "fx", []);
},
promise: function(e, n) {
- var i, o = 1, r = rt.Deferred(), a = this, s = this.length, l = function() {
- --o || r.resolveWith(a, [ a ]);
+ var i, o = 1, r = rt.Deferred(), s = this, a = this.length, l = function() {
+ --o || r.resolveWith(s, [ s ]);
};
- for ("string" != typeof e && (n = e, e = t), e = e || "fx"; s--; ) i = gt.get(a[s], e + "queueHooks"),
+ for ("string" != typeof e && (n = e, e = t), e = e || "fx"; a--; ) i = mt.get(s[a], e + "queueHooks"),
i && i.empty && (o++, i.empty.add(l));
return l(), r.promise(n);
}
});
- var yt, xt, wt = /[\t\r\n\f]/g, Ct = /\r/g, kt = /^(?:input|select|textarea|button)$/i;
+ var yt, wt, Ct = /[\t\r\n\f]/g, xt = /\r/g, Et = /^(?:input|select|textarea|button)$/i;
rt.fn.extend({
attr: function(e, t) {
return rt.access(this, rt.attr, e, t, arguments.length > 1);
@@ -2084,22 +2215,22 @@ function css_browser_selector(e) {
});
},
addClass: function(e) {
- var t, n, i, o, r, a = 0, s = this.length, l = "string" == typeof e && e;
+ var t, n, i, o, r, s = 0, a = this.length, l = "string" == typeof e && e;
if (rt.isFunction(e)) return this.each(function(t) {
rt(this).addClass(e.call(this, t, this.className));
});
- if (l) for (t = (e || "").match(st) || []; s > a; a++) if (n = this[a], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(wt, " ") : " ")) {
+ if (l) for (t = (e || "").match(at) || []; a > s; s++) if (n = this[s], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(Ct, " ") : " ")) {
for (r = 0; o = t[r++]; ) i.indexOf(" " + o + " ") < 0 && (i += o + " ");
n.className = rt.trim(i);
}
return this;
},
removeClass: function(e) {
- var t, n, i, o, r, a = 0, s = this.length, l = 0 === arguments.length || "string" == typeof e && e;
+ var t, n, i, o, r, s = 0, a = this.length, l = 0 === arguments.length || "string" == typeof e && e;
if (rt.isFunction(e)) return this.each(function(t) {
rt(this).removeClass(e.call(this, t, this.className));
});
- if (l) for (t = (e || "").match(st) || []; s > a; a++) if (n = this[a], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(wt, " ") : "")) {
+ if (l) for (t = (e || "").match(at) || []; a > s; s++) if (n = this[s], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(Ct, " ") : "")) {
for (r = 0; o = t[r++]; ) for (;i.indexOf(" " + o + " ") >= 0; ) i = i.replace(" " + o + " ", " ");
n.className = e ? rt.trim(i) : "";
}
@@ -2110,12 +2241,12 @@ function css_browser_selector(e) {
return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : rt.isFunction(e) ? this.each(function(n) {
rt(this).toggleClass(e.call(this, n, this.className, t), t);
}) : this.each(function() {
- if ("string" === n) for (var t, i = 0, o = rt(this), r = e.match(st) || []; t = r[i++]; ) o.hasClass(t) ? o.removeClass(t) : o.addClass(t); else (n === B || "boolean" === n) && (this.className && gt.set(this, "__className__", this.className),
- this.className = this.className || e === !1 ? "" : gt.get(this, "__className__") || "");
+ if ("string" === n) for (var t, i = 0, o = rt(this), r = e.match(at) || []; t = r[i++]; ) o.hasClass(t) ? o.removeClass(t) : o.addClass(t); else (n === q || "boolean" === n) && (this.className && mt.set(this, "__className__", this.className),
+ this.className = this.className || e === !1 ? "" : mt.get(this, "__className__") || "");
});
},
hasClass: function(e) {
- for (var t = " " + e + " ", n = 0, i = this.length; i > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(wt, " ").indexOf(t) >= 0) return !0;
+ for (var t = " " + e + " ", n = 0, i = this.length; i > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(Ct, " ").indexOf(t) >= 0) return !0;
return !1;
},
val: function(e) {
@@ -2128,7 +2259,7 @@ function css_browser_selector(e) {
})), n = rt.valHooks[this.type] || rt.valHooks[this.nodeName.toLowerCase()], n && "set" in n && n.set(this, r, "value") !== t || (this.value = r));
});
if (r) return n = rt.valHooks[r.type] || rt.valHooks[r.nodeName.toLowerCase()],
- n && "get" in n && (i = n.get(r, "value")) !== t ? i : (i = r.value, "string" == typeof i ? i.replace(Ct, "") : null == i ? "" : i);
+ n && "get" in n && (i = n.get(r, "value")) !== t ? i : (i = r.value, "string" == typeof i ? i.replace(xt, "") : null == i ? "" : i);
}
}
}), rt.extend({
@@ -2141,29 +2272,29 @@ function css_browser_selector(e) {
},
select: {
get: function(e) {
- for (var t, n, i = e.options, o = e.selectedIndex, r = "select-one" === e.type || 0 > o, a = r ? null : [], s = r ? o + 1 : i.length, l = 0 > o ? s : r ? o : 0; s > l; l++) if (n = i[l],
+ for (var t, n, i = e.options, o = e.selectedIndex, r = "select-one" === e.type || 0 > o, s = r ? null : [], a = r ? o + 1 : i.length, l = 0 > o ? a : r ? o : 0; a > l; l++) if (n = i[l],
!(!n.selected && l !== o || (rt.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && rt.nodeName(n.parentNode, "optgroup"))) {
if (t = rt(n).val(), r) return t;
- a.push(t);
+ s.push(t);
}
- return a;
+ return s;
},
set: function(e, t) {
- for (var n, i, o = e.options, r = rt.makeArray(t), a = o.length; a--; ) i = o[a],
+ for (var n, i, o = e.options, r = rt.makeArray(t), s = o.length; s--; ) i = o[s],
(i.selected = rt.inArray(rt(i).val(), r) >= 0) && (n = !0);
return n || (e.selectedIndex = -1), r;
}
}
},
attr: function(e, n, i) {
- var o, r, a = e.nodeType;
- if (e && 3 !== a && 8 !== a && 2 !== a) return typeof e.getAttribute === B ? rt.prop(e, n, i) : (1 === a && rt.isXMLDoc(e) || (n = n.toLowerCase(),
- o = rt.attrHooks[n] || (rt.expr.match.bool.test(n) ? xt : yt)), i === t ? o && "get" in o && null !== (r = o.get(e, n)) ? r : (r = rt.find.attr(e, n),
+ var o, r, s = e.nodeType;
+ if (e && 3 !== s && 8 !== s && 2 !== s) return typeof e.getAttribute === q ? rt.prop(e, n, i) : (1 === s && rt.isXMLDoc(e) || (n = n.toLowerCase(),
+ o = rt.attrHooks[n] || (rt.expr.match.bool.test(n) ? wt : yt)), i === t ? o && "get" in o && null !== (r = o.get(e, n)) ? r : (r = rt.find.attr(e, n),
null == r ? t : r) : null !== i ? o && "set" in o && (r = o.set(e, i, n)) !== t ? r : (e.setAttribute(n, i + ""),
i) : (rt.removeAttr(e, n), void 0));
},
removeAttr: function(e, t) {
- var n, i, o = 0, r = t && t.match(st);
+ var n, i, o = 0, r = t && t.match(at);
if (r && 1 === e.nodeType) for (;n = r[o++]; ) i = rt.propFix[n] || n, rt.expr.match.bool.test(n) && (e[i] = !1),
e.removeAttribute(n);
},
@@ -2182,26 +2313,26 @@ function css_browser_selector(e) {
"class": "className"
},
prop: function(e, n, i) {
- var o, r, a, s = e.nodeType;
- if (e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !rt.isXMLDoc(e), a && (n = rt.propFix[n] || n,
+ var o, r, s, a = e.nodeType;
+ if (e && 3 !== a && 8 !== a && 2 !== a) return s = 1 !== a || !rt.isXMLDoc(e), s && (n = rt.propFix[n] || n,
r = rt.propHooks[n]), i !== t ? r && "set" in r && (o = r.set(e, i, n)) !== t ? o : e[n] = i : r && "get" in r && null !== (o = r.get(e, n)) ? o : e[n];
},
propHooks: {
tabIndex: {
get: function(e) {
- return e.hasAttribute("tabindex") || kt.test(e.nodeName) || e.href ? e.tabIndex : -1;
+ return e.hasAttribute("tabindex") || Et.test(e.nodeName) || e.href ? e.tabIndex : -1;
}
}
}
- }), xt = {
+ }), wt = {
set: function(e, t, n) {
return t === !1 ? rt.removeAttr(e, n) : e.setAttribute(n, n), n;
}
}, rt.each(rt.expr.match.bool.source.match(/\w+/g), function(e, n) {
var i = rt.expr.attrHandle[n] || rt.find.attr;
rt.expr.attrHandle[n] = function(e, n, o) {
- var r = rt.expr.attrHandle[n], a = o ? t : (rt.expr.attrHandle[n] = t) != i(e, n, o) ? n.toLowerCase() : null;
- return rt.expr.attrHandle[n] = r, a;
+ var r = rt.expr.attrHandle[n], s = o ? t : (rt.expr.attrHandle[n] = t) != i(e, n, o) ? n.toLowerCase() : null;
+ return rt.expr.attrHandle[n] = r, s;
};
}), rt.support.optSelected || (rt.propHooks.selected = {
get: function(e) {
@@ -2219,92 +2350,92 @@ function css_browser_selector(e) {
return null === e.getAttribute("value") ? "on" : e.value;
});
});
- var St = /^key/, _t = /^(?:mouse|contextmenu)|click/, Tt = /^(?:focusinfocus|focusoutblur)$/, Et = /^([^.]*)(?:\.(.+)|)$/;
+ var At = /^key/, St = /^(?:mouse|contextmenu)|click/, kt = /^(?:focusinfocus|focusoutblur)$/, Ft = /^([^.]*)(?:\.(.+)|)$/;
rt.event = {
global: {},
add: function(e, n, i, o, r) {
- var a, s, l, c, u, d, p, f, h, m, g, v = gt.get(e);
+ var s, a, l, c, u, d, h, p, f, g, m, v = mt.get(e);
if (v) {
- for (i.handler && (a = i, i = a.handler, r = a.selector), i.guid || (i.guid = rt.guid++),
- (c = v.events) || (c = v.events = {}), (s = v.handle) || (s = v.handle = function(e) {
- return typeof rt === B || e && rt.event.triggered === e.type ? t : rt.event.dispatch.apply(s.elem, arguments);
- }, s.elem = e), n = (n || "").match(st) || [ "" ], u = n.length; u--; ) l = Et.exec(n[u]) || [],
- h = g = l[1], m = (l[2] || "").split(".").sort(), h && (p = rt.event.special[h] || {},
- h = (r ? p.delegateType : p.bindType) || h, p = rt.event.special[h] || {}, d = rt.extend({
- type: h,
- origType: g,
+ for (i.handler && (s = i, i = s.handler, r = s.selector), i.guid || (i.guid = rt.guid++),
+ (c = v.events) || (c = v.events = {}), (a = v.handle) || (a = v.handle = function(e) {
+ return typeof rt === q || e && rt.event.triggered === e.type ? t : rt.event.dispatch.apply(a.elem, arguments);
+ }, a.elem = e), n = (n || "").match(at) || [ "" ], u = n.length; u--; ) l = Ft.exec(n[u]) || [],
+ f = m = l[1], g = (l[2] || "").split(".").sort(), f && (h = rt.event.special[f] || {},
+ f = (r ? h.delegateType : h.bindType) || f, h = rt.event.special[f] || {}, d = rt.extend({
+ type: f,
+ origType: m,
data: o,
handler: i,
guid: i.guid,
selector: r,
needsContext: r && rt.expr.match.needsContext.test(r),
- namespace: m.join(".")
- }, a), (f = c[h]) || (f = c[h] = [], f.delegateCount = 0, p.setup && p.setup.call(e, o, m, s) !== !1 || e.addEventListener && e.addEventListener(h, s, !1)),
- p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = i.guid)), r ? f.splice(f.delegateCount++, 0, d) : f.push(d),
- rt.event.global[h] = !0);
+ namespace: g.join(".")
+ }, s), (p = c[f]) || (p = c[f] = [], p.delegateCount = 0, h.setup && h.setup.call(e, o, g, a) !== !1 || e.addEventListener && e.addEventListener(f, a, !1)),
+ h.add && (h.add.call(e, d), d.handler.guid || (d.handler.guid = i.guid)), r ? p.splice(p.delegateCount++, 0, d) : p.push(d),
+ rt.event.global[f] = !0);
e = null;
}
},
remove: function(e, t, n, i, o) {
- var r, a, s, l, c, u, d, p, f, h, m, g = gt.hasData(e) && gt.get(e);
- if (g && (l = g.events)) {
- for (t = (t || "").match(st) || [ "" ], c = t.length; c--; ) if (s = Et.exec(t[c]) || [],
- f = m = s[1], h = (s[2] || "").split(".").sort(), f) {
- for (d = rt.event.special[f] || {}, f = (i ? d.delegateType : d.bindType) || f,
- p = l[f] || [], s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"),
- a = r = p.length; r--; ) u = p[r], !o && m !== u.origType || n && n.guid !== u.guid || s && !s.test(u.namespace) || i && i !== u.selector && ("**" !== i || !u.selector) || (p.splice(r, 1),
- u.selector && p.delegateCount--, d.remove && d.remove.call(e, u));
- a && !p.length && (d.teardown && d.teardown.call(e, h, g.handle) !== !1 || rt.removeEvent(e, f, g.handle),
- delete l[f]);
- } else for (f in l) rt.event.remove(e, f + t[c], n, i, !0);
- rt.isEmptyObject(l) && (delete g.handle, gt.remove(e, "events"));
+ var r, s, a, l, c, u, d, h, p, f, g, m = mt.hasData(e) && mt.get(e);
+ if (m && (l = m.events)) {
+ for (t = (t || "").match(at) || [ "" ], c = t.length; c--; ) if (a = Ft.exec(t[c]) || [],
+ p = g = a[1], f = (a[2] || "").split(".").sort(), p) {
+ for (d = rt.event.special[p] || {}, p = (i ? d.delegateType : d.bindType) || p,
+ h = l[p] || [], a = a[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"),
+ s = r = h.length; r--; ) u = h[r], !o && g !== u.origType || n && n.guid !== u.guid || a && !a.test(u.namespace) || i && i !== u.selector && ("**" !== i || !u.selector) || (h.splice(r, 1),
+ u.selector && h.delegateCount--, d.remove && d.remove.call(e, u));
+ s && !h.length && (d.teardown && d.teardown.call(e, f, m.handle) !== !1 || rt.removeEvent(e, p, m.handle),
+ delete l[p]);
+ } else for (p in l) rt.event.remove(e, p + t[c], n, i, !0);
+ rt.isEmptyObject(l) && (delete m.handle, mt.remove(e, "events"));
}
},
trigger: function(n, i, o, r) {
- var a, s, l, c, u, d, p, f = [ o || G ], h = it.call(n, "type") ? n.type : n, m = it.call(n, "namespace") ? n.namespace.split(".") : [];
- if (s = l = o = o || G, 3 !== o.nodeType && 8 !== o.nodeType && !Tt.test(h + rt.event.triggered) && (h.indexOf(".") >= 0 && (m = h.split("."),
- h = m.shift(), m.sort()), u = h.indexOf(":") < 0 && "on" + h, n = n[rt.expando] ? n : new rt.Event(h, "object" == typeof n && n),
- n.isTrigger = r ? 2 : 3, n.namespace = m.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null,
+ var s, a, l, c, u, d, h, p = [ o || U ], f = it.call(n, "type") ? n.type : n, g = it.call(n, "namespace") ? n.namespace.split(".") : [];
+ if (a = l = o = o || U, 3 !== o.nodeType && 8 !== o.nodeType && !kt.test(f + rt.event.triggered) && (f.indexOf(".") >= 0 && (g = f.split("."),
+ f = g.shift(), g.sort()), u = f.indexOf(":") < 0 && "on" + f, n = n[rt.expando] ? n : new rt.Event(f, "object" == typeof n && n),
+ n.isTrigger = r ? 2 : 3, n.namespace = g.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + g.join("\\.(?:.*\\.|)") + "(\\.|$)") : null,
n.result = t, n.target || (n.target = o), i = null == i ? [ n ] : rt.makeArray(i, [ n ]),
- p = rt.event.special[h] || {}, r || !p.trigger || p.trigger.apply(o, i) !== !1)) {
- if (!r && !p.noBubble && !rt.isWindow(o)) {
- for (c = p.delegateType || h, Tt.test(c + h) || (s = s.parentNode); s; s = s.parentNode) f.push(s),
- l = s;
- l === (o.ownerDocument || G) && f.push(l.defaultView || l.parentWindow || e);
+ h = rt.event.special[f] || {}, r || !h.trigger || h.trigger.apply(o, i) !== !1)) {
+ if (!r && !h.noBubble && !rt.isWindow(o)) {
+ for (c = h.delegateType || f, kt.test(c + f) || (a = a.parentNode); a; a = a.parentNode) p.push(a),
+ l = a;
+ l === (o.ownerDocument || U) && p.push(l.defaultView || l.parentWindow || e);
}
- for (a = 0; (s = f[a++]) && !n.isPropagationStopped(); ) n.type = a > 1 ? c : p.bindType || h,
- d = (gt.get(s, "events") || {})[n.type] && gt.get(s, "handle"), d && d.apply(s, i),
- d = u && s[u], d && rt.acceptData(s) && d.apply && d.apply(s, i) === !1 && n.preventDefault();
- return n.type = h, r || n.isDefaultPrevented() || p._default && p._default.apply(f.pop(), i) !== !1 || !rt.acceptData(o) || u && rt.isFunction(o[h]) && !rt.isWindow(o) && (l = o[u],
- l && (o[u] = null), rt.event.triggered = h, o[h](), rt.event.triggered = t, l && (o[u] = l)),
+ for (s = 0; (a = p[s++]) && !n.isPropagationStopped(); ) n.type = s > 1 ? c : h.bindType || f,
+ d = (mt.get(a, "events") || {})[n.type] && mt.get(a, "handle"), d && d.apply(a, i),
+ d = u && a[u], d && rt.acceptData(a) && d.apply && d.apply(a, i) === !1 && n.preventDefault();
+ return n.type = f, r || n.isDefaultPrevented() || h._default && h._default.apply(p.pop(), i) !== !1 || !rt.acceptData(o) || u && rt.isFunction(o[f]) && !rt.isWindow(o) && (l = o[u],
+ l && (o[u] = null), rt.event.triggered = f, o[f](), rt.event.triggered = t, l && (o[u] = l)),
n.result;
}
},
dispatch: function(e) {
e = rt.event.fix(e);
- var n, i, o, r, a, s = [], l = et.call(arguments), c = (gt.get(this, "events") || {})[e.type] || [], u = rt.event.special[e.type] || {};
+ var n, i, o, r, s, a = [], l = et.call(arguments), c = (mt.get(this, "events") || {})[e.type] || [], u = rt.event.special[e.type] || {};
if (l[0] = e, e.delegateTarget = this, !u.preDispatch || u.preDispatch.call(this, e) !== !1) {
- for (s = rt.event.handlers.call(this, e, c), n = 0; (r = s[n++]) && !e.isPropagationStopped(); ) for (e.currentTarget = r.elem,
- i = 0; (a = r.handlers[i++]) && !e.isImmediatePropagationStopped(); ) (!e.namespace_re || e.namespace_re.test(a.namespace)) && (e.handleObj = a,
- e.data = a.data, o = ((rt.event.special[a.origType] || {}).handle || a.handler).apply(r.elem, l),
+ for (a = rt.event.handlers.call(this, e, c), n = 0; (r = a[n++]) && !e.isPropagationStopped(); ) for (e.currentTarget = r.elem,
+ i = 0; (s = r.handlers[i++]) && !e.isImmediatePropagationStopped(); ) (!e.namespace_re || e.namespace_re.test(s.namespace)) && (e.handleObj = s,
+ e.data = s.data, o = ((rt.event.special[s.origType] || {}).handle || s.handler).apply(r.elem, l),
o !== t && (e.result = o) === !1 && (e.preventDefault(), e.stopPropagation()));
return u.postDispatch && u.postDispatch.call(this, e), e.result;
}
},
handlers: function(e, n) {
- var i, o, r, a, s = [], l = n.delegateCount, c = e.target;
+ var i, o, r, s, a = [], l = n.delegateCount, c = e.target;
if (l && c.nodeType && (!e.button || "click" !== e.type)) for (;c !== this; c = c.parentNode || this) if (c.disabled !== !0 || "click" !== e.type) {
- for (o = [], i = 0; l > i; i++) a = n[i], r = a.selector + " ", o[r] === t && (o[r] = a.needsContext ? rt(r, this).index(c) >= 0 : rt.find(r, this, null, [ c ]).length),
- o[r] && o.push(a);
- o.length && s.push({
+ for (o = [], i = 0; l > i; i++) s = n[i], r = s.selector + " ", o[r] === t && (o[r] = s.needsContext ? rt(r, this).index(c) >= 0 : rt.find(r, this, null, [ c ]).length),
+ o[r] && o.push(s);
+ o.length && a.push({
elem: c,
handlers: o
});
}
- return l < n.length && s.push({
+ return l < n.length && a.push({
elem: this,
handlers: n.slice(l)
- }), s;
+ }), a;
},
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
@@ -2318,21 +2449,21 @@ function css_browser_selector(e) {
mouseHooks: {
props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function(e, n) {
- var i, o, r, a = n.button;
- return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || G,
+ var i, o, r, s = n.button;
+ return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || U,
o = i.documentElement, r = i.body, e.pageX = n.clientX + (o && o.scrollLeft || r && r.scrollLeft || 0) - (o && o.clientLeft || r && r.clientLeft || 0),
e.pageY = n.clientY + (o && o.scrollTop || r && r.scrollTop || 0) - (o && o.clientTop || r && r.clientTop || 0)),
- e.which || a === t || (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0), e;
+ e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e;
}
},
fix: function(e) {
if (e[rt.expando]) return e;
- var t, n, i, o = e.type, r = e, a = this.fixHooks[o];
- for (a || (this.fixHooks[o] = a = _t.test(o) ? this.mouseHooks : St.test(o) ? this.keyHooks : {}),
- i = a.props ? this.props.concat(a.props) : this.props, e = new rt.Event(r), t = i.length; t--; ) n = i[t],
+ var t, n, i, o = e.type, r = e, s = this.fixHooks[o];
+ for (s || (this.fixHooks[o] = s = St.test(o) ? this.mouseHooks : At.test(o) ? this.keyHooks : {}),
+ i = s.props ? this.props.concat(s.props) : this.props, e = new rt.Event(r), t = i.length; t--; ) n = i[t],
e[n] = r[n];
- return e.target || (e.target = G), 3 === e.target.nodeType && (e.target = e.target.parentNode),
- a.filter ? a.filter(e, r) : e;
+ return e.target || (e.target = U), 3 === e.target.nodeType && (e.target = e.target.parentNode),
+ s.filter ? s.filter(e, r) : e;
},
special: {
load: {
@@ -2377,23 +2508,23 @@ function css_browser_selector(e) {
e.removeEventListener && e.removeEventListener(t, n, !1);
}, rt.Event = function(e, t) {
return this instanceof rt.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type,
- this.isDefaultPrevented = e.defaultPrevented || e.getPreventDefault && e.getPreventDefault() ? a : s) : this.type = e,
+ this.isDefaultPrevented = e.defaultPrevented || e.getPreventDefault && e.getPreventDefault() ? s : a) : this.type = e,
t && rt.extend(this, t), this.timeStamp = e && e.timeStamp || rt.now(), this[rt.expando] = !0,
void 0) : new rt.Event(e, t);
}, rt.Event.prototype = {
- isDefaultPrevented: s,
- isPropagationStopped: s,
- isImmediatePropagationStopped: s,
+ isDefaultPrevented: a,
+ isPropagationStopped: a,
+ isImmediatePropagationStopped: a,
preventDefault: function() {
var e = this.originalEvent;
- this.isDefaultPrevented = a, e && e.preventDefault && e.preventDefault();
+ this.isDefaultPrevented = s, e && e.preventDefault && e.preventDefault();
},
stopPropagation: function() {
var e = this.originalEvent;
- this.isPropagationStopped = a, e && e.stopPropagation && e.stopPropagation();
+ this.isPropagationStopped = s, e && e.stopPropagation && e.stopPropagation();
},
stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = a, this.stopPropagation();
+ this.isImmediatePropagationStopped = s, this.stopPropagation();
}
}, rt.each({
mouseenter: "mouseover",
@@ -2417,25 +2548,25 @@ function css_browser_selector(e) {
};
rt.event.special[t] = {
setup: function() {
- 0 === n++ && G.addEventListener(e, i, !0);
+ 0 === n++ && U.addEventListener(e, i, !0);
},
teardown: function() {
- 0 === --n && G.removeEventListener(e, i, !0);
+ 0 === --n && U.removeEventListener(e, i, !0);
}
};
}), rt.fn.extend({
on: function(e, n, i, o, r) {
- var a, l;
+ var s, l;
if ("object" == typeof e) {
"string" != typeof n && (i = i || n, n = t);
for (l in e) this.on(l, n, i, e[l], r);
return this;
}
if (null == i && null == o ? (o = n, i = n = t) : null == o && ("string" == typeof n ? (o = i,
- i = t) : (o = i, i = n, n = t)), o === !1) o = s; else if (!o) return this;
- return 1 === r && (a = o, o = function(e) {
- return rt().off(e), a.apply(this, arguments);
- }, o.guid = a.guid || (a.guid = rt.guid++)), this.each(function() {
+ i = t) : (o = i, i = n, n = t)), o === !1) o = a; else if (!o) return this;
+ return 1 === r && (s = o, o = function(e) {
+ return rt().off(e), s.apply(this, arguments);
+ }, o.guid = s.guid || (s.guid = rt.guid++)), this.each(function() {
rt.event.add(this, e, o, i, n);
});
},
@@ -2450,7 +2581,7 @@ function css_browser_selector(e) {
for (r in e) this.off(r, n, e[r]);
return this;
}
- return (n === !1 || "function" == typeof n) && (i = n, n = t), i === !1 && (i = s),
+ return (n === !1 || "function" == typeof n) && (i = n, n = t), i === !1 && (i = a),
this.each(function() {
rt.event.remove(this, e, i, n);
});
@@ -2465,7 +2596,7 @@ function css_browser_selector(e) {
return n ? rt.event.trigger(e, t, n, !0) : void 0;
}
});
- var Nt = /^.[^:#\[\.,]*$/, It = /^(?:parents|prev(?:Until|All))/, Pt = rt.expr.match.needsContext, At = {
+ var _t = /^.[^:#\[\.,]*$/, $t = /^(?:parents|prev(?:Until|All))/, Dt = rt.expr.match.needsContext, Tt = {
children: !0,
contents: !0,
next: !0,
@@ -2494,10 +2625,10 @@ function css_browser_selector(e) {
return this.pushStack(u(this, e || [], !1));
},
is: function(e) {
- return !!u(this, "string" == typeof e && Pt.test(e) ? rt(e) : e || [], !1).length;
+ return !!u(this, "string" == typeof e && Dt.test(e) ? rt(e) : e || [], !1).length;
},
closest: function(e, t) {
- for (var n, i = 0, o = this.length, r = [], a = Pt.test(e) || "string" != typeof e ? rt(e, t || this.context) : 0; o > i; i++) for (n = this[i]; n && n !== t; n = n.parentNode) if (n.nodeType < 11 && (a ? a.index(n) > -1 : 1 === n.nodeType && rt.find.matchesSelector(n, e))) {
+ for (var n, i = 0, o = this.length, r = [], s = Dt.test(e) || "string" != typeof e ? rt(e, t || this.context) : 0; o > i; i++) for (n = this[i]; n && n !== t; n = n.parentNode) if (n.nodeType < 11 && (s ? s.index(n) > -1 : 1 === n.nodeType && rt.find.matchesSelector(n, e))) {
n = r.push(n);
break;
}
@@ -2555,7 +2686,7 @@ function css_browser_selector(e) {
rt.fn[e] = function(n, i) {
var o = rt.map(this, t, n);
return "Until" !== e.slice(-5) && (i = n), i && "string" == typeof i && (o = rt.filter(i, o)),
- this.length > 1 && (At[e] || rt.unique(o), It.test(e) && o.reverse()), this.pushStack(o);
+ this.length > 1 && (Tt[e] || rt.unique(o), $t.test(e) && o.reverse()), this.pushStack(o);
};
}), rt.extend({
filter: function(e, t, n) {
@@ -2576,7 +2707,7 @@ function css_browser_selector(e) {
return n;
}
});
- var Mt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Lt = /<([\w:]+)/, $t = /<|?\w+;/, zt = /<(?:script|style|link)/i, Rt = /^(?:checkbox|radio)$/i, jt = /checked\s*(?:[^=]|=\s*.checked.)/i, Dt = /^$|\/(?:java|ecma)script/i, Ot = /^true\/(.*)/, Ft = /^\s*\s*$/g, qt = {
+ var Lt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Bt = /<([\w:]+)/, Mt = /<|?\w+;/, Rt = /<(?:script|style|link)/i, It = /^(?:checkbox|radio)$/i, Pt = /checked\s*(?:[^=]|=\s*.checked.)/i, Nt = /^$|\/(?:java|ecma)script/i, zt = /^true\/(.*)/, Ot = /^\s*\s*$/g, jt = {
option: [ 1, "" ],
thead: [ 1, "
" ],
_default: [ 0, "", "" ]
};
- qt.optgroup = qt.option, qt.tbody = qt.tfoot = qt.colgroup = qt.caption = qt.thead,
- qt.th = qt.td, rt.fn.extend({
+ jt.optgroup = jt.option, jt.tbody = jt.tfoot = jt.colgroup = jt.caption = jt.thead,
+ jt.th = jt.td, rt.fn.extend({
text: function(e) {
return rt.access(this, function(e) {
- return e === t ? rt.text(this) : this.empty().append((this[0] && this[0].ownerDocument || G).createTextNode(e));
+ return e === t ? rt.text(this) : this.empty().append((this[0] && this[0].ownerDocument || U).createTextNode(e));
}, null, e, arguments.length);
},
append: function() {
@@ -2618,12 +2749,12 @@ function css_browser_selector(e) {
});
},
remove: function(e, t) {
- for (var n, i = e ? rt.filter(e, this) : this, o = 0; null != (n = i[o]); o++) t || 1 !== n.nodeType || rt.cleanData(g(n)),
- n.parentNode && (t && rt.contains(n.ownerDocument, n) && h(g(n, "script")), n.parentNode.removeChild(n));
+ for (var n, i = e ? rt.filter(e, this) : this, o = 0; null != (n = i[o]); o++) t || 1 !== n.nodeType || rt.cleanData(m(n)),
+ n.parentNode && (t && rt.contains(n.ownerDocument, n) && f(m(n, "script")), n.parentNode.removeChild(n));
return this;
},
empty: function() {
- for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (rt.cleanData(g(e, !1)),
+ for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (rt.cleanData(m(e, !1)),
e.textContent = "");
return this;
},
@@ -2636,10 +2767,10 @@ function css_browser_selector(e) {
return rt.access(this, function(e) {
var n = this[0] || {}, i = 0, o = this.length;
if (e === t && 1 === n.nodeType) return n.innerHTML;
- if ("string" == typeof e && !zt.test(e) && !qt[(Lt.exec(e) || [ "", "" ])[1].toLowerCase()]) {
- e = e.replace(Mt, "<$1>$2>");
+ if ("string" == typeof e && !Rt.test(e) && !jt[(Bt.exec(e) || [ "", "" ])[1].toLowerCase()]) {
+ e = e.replace(Lt, "<$1>$2>");
try {
- for (;o > i; i++) n = this[i] || {}, 1 === n.nodeType && (rt.cleanData(g(n, !1)),
+ for (;o > i; i++) n = this[i] || {}, 1 === n.nodeType && (rt.cleanData(m(n, !1)),
n.innerHTML = e);
n = 0;
} catch (r) {}
@@ -2661,17 +2792,17 @@ function css_browser_selector(e) {
},
domManip: function(e, t, n) {
e = J.apply([], e);
- var i, o, r, a, s, l, c = 0, u = this.length, d = this, h = u - 1, m = e[0], v = rt.isFunction(m);
- if (v || !(1 >= u || "string" != typeof m || rt.support.checkClone) && jt.test(m)) return this.each(function(i) {
+ var i, o, r, s, a, l, c = 0, u = this.length, d = this, f = u - 1, g = e[0], v = rt.isFunction(g);
+ if (v || !(1 >= u || "string" != typeof g || rt.support.checkClone) && Pt.test(g)) return this.each(function(i) {
var o = d.eq(i);
- v && (e[0] = m.call(this, i, o.html())), o.domManip(e, t, n);
+ v && (e[0] = g.call(this, i, o.html())), o.domManip(e, t, n);
});
if (u && (i = rt.buildFragment(e, this[0].ownerDocument, !1, !n && this), o = i.firstChild,
1 === i.childNodes.length && (i = o), o)) {
- for (r = rt.map(g(i, "script"), p), a = r.length; u > c; c++) s = i, c !== h && (s = rt.clone(s, !0, !0),
- a && rt.merge(r, g(s, "script"))), t.call(this[c], s, c);
- if (a) for (l = r[r.length - 1].ownerDocument, rt.map(r, f), c = 0; a > c; c++) s = r[c],
- Dt.test(s.type || "") && !gt.access(s, "globalEval") && rt.contains(l, s) && (s.src ? rt._evalUrl(s.src) : rt.globalEval(s.textContent.replace(Ft, "")));
+ for (r = rt.map(m(i, "script"), h), s = r.length; u > c; c++) a = i, c !== f && (a = rt.clone(a, !0, !0),
+ s && rt.merge(r, m(a, "script"))), t.call(this[c], a, c);
+ if (s) for (l = r[r.length - 1].ownerDocument, rt.map(r, p), c = 0; s > c; c++) a = r[c],
+ Nt.test(a.type || "") && !mt.access(a, "globalEval") && rt.contains(l, a) && (a.src ? rt._evalUrl(a.src) : rt.globalEval(a.textContent.replace(Ot, "")));
}
return this;
}
@@ -2683,37 +2814,37 @@ function css_browser_selector(e) {
replaceAll: "replaceWith"
}, function(e, t) {
rt.fn[e] = function(e) {
- for (var n, i = [], o = rt(e), r = o.length - 1, a = 0; r >= a; a++) n = a === r ? this : this.clone(!0),
- rt(o[a])[t](n), Q.apply(i, n.get());
+ for (var n, i = [], o = rt(e), r = o.length - 1, s = 0; r >= s; s++) n = s === r ? this : this.clone(!0),
+ rt(o[s])[t](n), Q.apply(i, n.get());
return this.pushStack(i);
};
}), rt.extend({
clone: function(e, t, n) {
- var i, o, r, a, s = e.cloneNode(!0), l = rt.contains(e.ownerDocument, e);
- if (!(rt.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || rt.isXMLDoc(e))) for (a = g(s),
- r = g(e), i = 0, o = r.length; o > i; i++) v(r[i], a[i]);
- if (t) if (n) for (r = r || g(e), a = a || g(s), i = 0, o = r.length; o > i; i++) m(r[i], a[i]); else m(e, s);
- return a = g(s, "script"), a.length > 0 && h(a, !l && g(e, "script")), s;
+ var i, o, r, s, a = e.cloneNode(!0), l = rt.contains(e.ownerDocument, e);
+ if (!(rt.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || rt.isXMLDoc(e))) for (s = m(a),
+ r = m(e), i = 0, o = r.length; o > i; i++) v(r[i], s[i]);
+ if (t) if (n) for (r = r || m(e), s = s || m(a), i = 0, o = r.length; o > i; i++) g(r[i], s[i]); else g(e, a);
+ return s = m(a, "script"), s.length > 0 && f(s, !l && m(e, "script")), a;
},
buildFragment: function(e, t, n, i) {
- for (var o, r, a, s, l, c, u = 0, d = e.length, p = t.createDocumentFragment(), f = []; d > u; u++) if (o = e[u],
- o || 0 === o) if ("object" === rt.type(o)) rt.merge(f, o.nodeType ? [ o ] : o); else if ($t.test(o)) {
- for (r = r || p.appendChild(t.createElement("div")), a = (Lt.exec(o) || [ "", "" ])[1].toLowerCase(),
- s = qt[a] || qt._default, r.innerHTML = s[1] + o.replace(Mt, "<$1>$2>") + s[2],
- c = s[0]; c--; ) r = r.lastChild;
- rt.merge(f, r.childNodes), r = p.firstChild, r.textContent = "";
- } else f.push(t.createTextNode(o));
- for (p.textContent = "", u = 0; o = f[u++]; ) if ((!i || -1 === rt.inArray(o, i)) && (l = rt.contains(o.ownerDocument, o),
- r = g(p.appendChild(o), "script"), l && h(r), n)) for (c = 0; o = r[c++]; ) Dt.test(o.type || "") && n.push(o);
- return p;
+ for (var o, r, s, a, l, c, u = 0, d = e.length, h = t.createDocumentFragment(), p = []; d > u; u++) if (o = e[u],
+ o || 0 === o) if ("object" === rt.type(o)) rt.merge(p, o.nodeType ? [ o ] : o); else if (Mt.test(o)) {
+ for (r = r || h.appendChild(t.createElement("div")), s = (Bt.exec(o) || [ "", "" ])[1].toLowerCase(),
+ a = jt[s] || jt._default, r.innerHTML = a[1] + o.replace(Lt, "<$1>$2>") + a[2],
+ c = a[0]; c--; ) r = r.lastChild;
+ rt.merge(p, r.childNodes), r = h.firstChild, r.textContent = "";
+ } else p.push(t.createTextNode(o));
+ for (h.textContent = "", u = 0; o = p[u++]; ) if ((!i || -1 === rt.inArray(o, i)) && (l = rt.contains(o.ownerDocument, o),
+ r = m(h.appendChild(o), "script"), l && f(r), n)) for (c = 0; o = r[c++]; ) Nt.test(o.type || "") && n.push(o);
+ return h;
},
cleanData: function(e) {
- for (var n, i, r, a, s, l, c = rt.event.special, u = 0; (i = e[u]) !== t; u++) {
- if (o.accepts(i) && (s = i[gt.expando], s && (n = gt.cache[s]))) {
- if (r = Object.keys(n.events || {}), r.length) for (l = 0; (a = r[l]) !== t; l++) c[a] ? rt.event.remove(i, a) : rt.removeEvent(i, a, n.handle);
- gt.cache[s] && delete gt.cache[s];
+ for (var n, i, r, s, a, l, c = rt.event.special, u = 0; (i = e[u]) !== t; u++) {
+ if (o.accepts(i) && (a = i[mt.expando], a && (n = mt.cache[a]))) {
+ if (r = Object.keys(n.events || {}), r.length) for (l = 0; (s = r[l]) !== t; l++) c[s] ? rt.event.remove(i, s) : rt.removeEvent(i, s, n.handle);
+ mt.cache[a] && delete mt.cache[a];
}
- delete mt.cache[i[mt.expando]];
+ delete gt.cache[i[gt.expando]];
}
},
_evalUrl: function(e) {
@@ -2757,32 +2888,32 @@ function css_browser_selector(e) {
}).end();
}
});
- var Ht, Bt, Ut = /^(none|table(?!-c[ea]).+)/, Gt = /^margin/, Wt = new RegExp("^(" + at + ")(.*)$", "i"), Vt = new RegExp("^(" + at + ")(?!px)[a-z%]+$", "i"), Xt = new RegExp("^([+-])=(" + at + ")", "i"), Kt = {
+ var Ht, qt, Wt = /^(none|table(?!-c[ea]).+)/, Ut = /^margin/, Gt = new RegExp("^(" + st + ")(.*)$", "i"), Vt = new RegExp("^(" + st + ")(?!px)[a-z%]+$", "i"), Kt = new RegExp("^([+-])=(" + st + ")", "i"), Xt = {
BODY: "block"
- }, Zt = {
+ }, Yt = {
position: "absolute",
visibility: "hidden",
display: "block"
- }, Yt = {
+ }, Zt = {
letterSpacing: 0,
fontWeight: 400
}, Jt = [ "Top", "Right", "Bottom", "Left" ], Qt = [ "Webkit", "O", "Moz", "ms" ];
rt.fn.extend({
css: function(e, n) {
return rt.access(this, function(e, n, i) {
- var o, r, a = {}, s = 0;
+ var o, r, s = {}, a = 0;
if (rt.isArray(n)) {
- for (o = x(e), r = n.length; r > s; s++) a[n[s]] = rt.css(e, n[s], !1, o);
- return a;
+ for (o = w(e), r = n.length; r > a; a++) s[n[a]] = rt.css(e, n[a], !1, o);
+ return s;
}
return i !== t ? rt.style(e, n, i) : rt.css(e, n);
}, e, n, arguments.length > 1);
},
show: function() {
- return w(this, !0);
+ return C(this, !0);
},
hide: function() {
- return w(this);
+ return C(this);
},
toggle: function(e) {
return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
@@ -2817,36 +2948,36 @@ function css_browser_selector(e) {
},
style: function(e, n, i, o) {
if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
- var r, a, s, l = rt.camelCase(n), c = e.style;
- return n = rt.cssProps[l] || (rt.cssProps[l] = b(c, l)), s = rt.cssHooks[n] || rt.cssHooks[l],
- i === t ? s && "get" in s && (r = s.get(e, !1, o)) !== t ? r : c[n] : (a = typeof i,
- "string" === a && (r = Xt.exec(i)) && (i = (r[1] + 1) * r[2] + parseFloat(rt.css(e, n)),
- a = "number"), null == i || "number" === a && isNaN(i) || ("number" !== a || rt.cssNumber[l] || (i += "px"),
+ var r, s, a, l = rt.camelCase(n), c = e.style;
+ return n = rt.cssProps[l] || (rt.cssProps[l] = b(c, l)), a = rt.cssHooks[n] || rt.cssHooks[l],
+ i === t ? a && "get" in a && (r = a.get(e, !1, o)) !== t ? r : c[n] : (s = typeof i,
+ "string" === s && (r = Kt.exec(i)) && (i = (r[1] + 1) * r[2] + parseFloat(rt.css(e, n)),
+ s = "number"), null == i || "number" === s && isNaN(i) || ("number" !== s || rt.cssNumber[l] || (i += "px"),
rt.support.clearCloneStyle || "" !== i || 0 !== n.indexOf("background") || (c[n] = "inherit"),
- s && "set" in s && (i = s.set(e, i, o)) === t || (c[n] = i)), void 0);
+ a && "set" in a && (i = a.set(e, i, o)) === t || (c[n] = i)), void 0);
}
},
css: function(e, n, i, o) {
- var r, a, s, l = rt.camelCase(n);
- return n = rt.cssProps[l] || (rt.cssProps[l] = b(e.style, l)), s = rt.cssHooks[n] || rt.cssHooks[l],
- s && "get" in s && (r = s.get(e, !0, i)), r === t && (r = Ht(e, n, o)), "normal" === r && n in Yt && (r = Yt[n]),
- "" === i || i ? (a = parseFloat(r), i === !0 || rt.isNumeric(a) ? a || 0 : r) : r;
+ var r, s, a, l = rt.camelCase(n);
+ return n = rt.cssProps[l] || (rt.cssProps[l] = b(e.style, l)), a = rt.cssHooks[n] || rt.cssHooks[l],
+ a && "get" in a && (r = a.get(e, !0, i)), r === t && (r = Ht(e, n, o)), "normal" === r && n in Zt && (r = Zt[n]),
+ "" === i || i ? (s = parseFloat(r), i === !0 || rt.isNumeric(s) ? s || 0 : r) : r;
}
}), Ht = function(e, n, i) {
- var o, r, a, s = i || x(e), l = s ? s.getPropertyValue(n) || s[n] : t, c = e.style;
- return s && ("" !== l || rt.contains(e.ownerDocument, e) || (l = rt.style(e, n)),
- Vt.test(l) && Gt.test(n) && (o = c.width, r = c.minWidth, a = c.maxWidth, c.minWidth = c.maxWidth = c.width = l,
- l = s.width, c.width = o, c.minWidth = r, c.maxWidth = a)), l;
+ var o, r, s, a = i || w(e), l = a ? a.getPropertyValue(n) || a[n] : t, c = e.style;
+ return a && ("" !== l || rt.contains(e.ownerDocument, e) || (l = rt.style(e, n)),
+ Vt.test(l) && Ut.test(n) && (o = c.width, r = c.minWidth, s = c.maxWidth, c.minWidth = c.maxWidth = c.width = l,
+ l = a.width, c.width = o, c.minWidth = r, c.maxWidth = s)), l;
}, rt.each([ "height", "width" ], function(e, t) {
rt.cssHooks[t] = {
get: function(e, n, i) {
- return n ? 0 === e.offsetWidth && Ut.test(rt.css(e, "display")) ? rt.swap(e, Zt, function() {
- return S(e, t, i);
- }) : S(e, t, i) : void 0;
+ return n ? 0 === e.offsetWidth && Wt.test(rt.css(e, "display")) ? rt.swap(e, Yt, function() {
+ return A(e, t, i);
+ }) : A(e, t, i) : void 0;
},
set: function(e, n, i) {
- var o = i && x(e);
- return C(e, n, i ? k(e, t, i, rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, o), o) : 0);
+ var o = i && w(e);
+ return x(e, n, i ? E(e, t, i, rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, o), o) : 0);
}
};
}), rt(function() {
@@ -2877,7 +3008,7 @@ function css_browser_selector(e) {
for (var i = 0, o = {}, r = "string" == typeof n ? n.split(" ") : [ n ]; 4 > i; i++) o[e + Jt[i] + t] = r[i] || r[i - 2] || r[0];
return o;
}
- }, Gt.test(e) || (rt.cssHooks[e + t].set = C);
+ }, Ut.test(e) || (rt.cssHooks[e + t].set = x);
});
var en = /%20/g, tn = /\[\]$/, nn = /\r?\n/g, on = /^(?:submit|button|image|reset|file)$/i, rn = /^(?:input|select|textarea|keygen)/i;
rt.fn.extend({
@@ -2890,7 +3021,7 @@ function css_browser_selector(e) {
return e ? rt.makeArray(e) : this;
}).filter(function() {
var e = this.type;
- return this.name && !rt(this).is(":disabled") && rn.test(this.nodeName) && !on.test(e) && (this.checked || !Rt.test(e));
+ return this.name && !rt(this).is(":disabled") && rn.test(this.nodeName) && !on.test(e) && (this.checked || !It.test(e));
}).map(function(e, t) {
var n = rt(this).val();
return null == n ? null : rt.isArray(n) ? rt.map(n, function(e) {
@@ -2910,7 +3041,7 @@ function css_browser_selector(e) {
};
if (n === t && (n = rt.ajaxSettings && rt.ajaxSettings.traditional), rt.isArray(e) || e.jquery && !rt.isPlainObject(e)) rt.each(e, function() {
r(this.name, this.value);
- }); else for (i in e) E(i, e[i], n, r);
+ }); else for (i in e) F(i, e[i], n, r);
return o.join("&").replace(en, "+");
}, rt.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(e, t) {
rt.fn[t] = function(e, n) {
@@ -2933,25 +3064,25 @@ function css_browser_selector(e) {
return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n);
}
});
- var an, sn, ln = rt.now(), cn = /\?/, un = /#.*$/, dn = /([?&])_=[^&]*/, pn = /^(.*?):[ \t]*([^\r\n]*)$/gm, fn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, hn = /^(?:GET|HEAD)$/, mn = /^\/\//, gn = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, vn = rt.fn.load, bn = {}, yn = {}, xn = "*/".concat("*");
+ var sn, an, ln = rt.now(), cn = /\?/, un = /#.*$/, dn = /([?&])_=[^&]*/, hn = /^(.*?):[ \t]*([^\r\n]*)$/gm, pn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, fn = /^(?:GET|HEAD)$/, gn = /^\/\//, mn = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, vn = rt.fn.load, bn = {}, yn = {}, wn = "*/".concat("*");
try {
- sn = U.href;
- } catch (wn) {
- sn = G.createElement("a"), sn.href = "", sn = sn.href;
+ an = W.href;
+ } catch (Cn) {
+ an = U.createElement("a"), an.href = "", an = an.href;
}
- an = gn.exec(sn.toLowerCase()) || [], rt.fn.load = function(e, n, i) {
+ sn = mn.exec(an.toLowerCase()) || [], rt.fn.load = function(e, n, i) {
if ("string" != typeof e && vn) return vn.apply(this, arguments);
- var o, r, a, s = this, l = e.indexOf(" ");
+ var o, r, s, a = this, l = e.indexOf(" ");
return l >= 0 && (o = e.slice(l), e = e.slice(0, l)), rt.isFunction(n) ? (i = n,
- n = t) : n && "object" == typeof n && (r = "POST"), s.length > 0 && rt.ajax({
+ n = t) : n && "object" == typeof n && (r = "POST"), a.length > 0 && rt.ajax({
url: e,
type: r,
dataType: "html",
data: n
}).done(function(e) {
- a = arguments, s.html(o ? rt("
").append(rt.parseHTML(e)).find(o) : e);
+ s = arguments, a.html(o ? rt("
").append(rt.parseHTML(e)).find(o) : e);
}).complete(i && function(e, t) {
- s.each(i, a || [ e.responseText, t, e ]);
+ a.each(i, s || [ e.responseText, t, e ]);
}), this;
}, rt.each([ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function(e, t) {
rt.fn[t] = function(e) {
@@ -2962,15 +3093,15 @@ function css_browser_selector(e) {
lastModified: {},
etag: {},
ajaxSettings: {
- url: sn,
+ url: an,
type: "GET",
- isLocal: fn.test(an[1]),
+ isLocal: pn.test(sn[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
- "*": xn,
+ "*": wn,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
@@ -2998,84 +3129,84 @@ function css_browser_selector(e) {
}
},
ajaxSetup: function(e, t) {
- return t ? P(P(e, rt.ajaxSettings), t) : P(rt.ajaxSettings, e);
+ return t ? D(D(e, rt.ajaxSettings), t) : D(rt.ajaxSettings, e);
},
- ajaxPrefilter: N(bn),
- ajaxTransport: N(yn),
+ ajaxPrefilter: _(bn),
+ ajaxTransport: _(yn),
ajax: function(e, n) {
- function i(e, n, i, s) {
- var c, d, b, y, w, k = n;
- 2 !== x && (x = 2, l && clearTimeout(l), o = t, a = s || "", C.readyState = e > 0 ? 4 : 0,
- c = e >= 200 && 300 > e || 304 === e, i && (y = A(p, C, i)), y = M(p, y, C, c),
- c ? (p.ifModified && (w = C.getResponseHeader("Last-Modified"), w && (rt.lastModified[r] = w),
- w = C.getResponseHeader("etag"), w && (rt.etag[r] = w)), 204 === e || "HEAD" === p.type ? k = "nocontent" : 304 === e ? k = "notmodified" : (k = y.state,
- d = y.data, b = y.error, c = !b)) : (b = k, (e || !k) && (k = "error", 0 > e && (e = 0))),
- C.status = e, C.statusText = (n || k) + "", c ? m.resolveWith(f, [ d, k, C ]) : m.rejectWith(f, [ C, k, b ]),
- C.statusCode(v), v = t, u && h.trigger(c ? "ajaxSuccess" : "ajaxError", [ C, p, c ? d : b ]),
- g.fireWith(f, [ C, k ]), u && (h.trigger("ajaxComplete", [ C, p ]), --rt.active || rt.event.trigger("ajaxStop")));
+ function i(e, n, i, a) {
+ var c, d, b, y, C, E = n;
+ 2 !== w && (w = 2, l && clearTimeout(l), o = t, s = a || "", x.readyState = e > 0 ? 4 : 0,
+ c = e >= 200 && 300 > e || 304 === e, i && (y = T(h, x, i)), y = L(h, y, x, c),
+ c ? (h.ifModified && (C = x.getResponseHeader("Last-Modified"), C && (rt.lastModified[r] = C),
+ C = x.getResponseHeader("etag"), C && (rt.etag[r] = C)), 204 === e || "HEAD" === h.type ? E = "nocontent" : 304 === e ? E = "notmodified" : (E = y.state,
+ d = y.data, b = y.error, c = !b)) : (b = E, (e || !E) && (E = "error", 0 > e && (e = 0))),
+ x.status = e, x.statusText = (n || E) + "", c ? g.resolveWith(p, [ d, E, x ]) : g.rejectWith(p, [ x, E, b ]),
+ x.statusCode(v), v = t, u && f.trigger(c ? "ajaxSuccess" : "ajaxError", [ x, h, c ? d : b ]),
+ m.fireWith(p, [ x, E ]), u && (f.trigger("ajaxComplete", [ x, h ]), --rt.active || rt.event.trigger("ajaxStop")));
}
"object" == typeof e && (n = e, e = t), n = n || {};
- var o, r, a, s, l, c, u, d, p = rt.ajaxSetup({}, n), f = p.context || p, h = p.context && (f.nodeType || f.jquery) ? rt(f) : rt.event, m = rt.Deferred(), g = rt.Callbacks("once memory"), v = p.statusCode || {}, b = {}, y = {}, x = 0, w = "canceled", C = {
+ var o, r, s, a, l, c, u, d, h = rt.ajaxSetup({}, n), p = h.context || h, f = h.context && (p.nodeType || p.jquery) ? rt(p) : rt.event, g = rt.Deferred(), m = rt.Callbacks("once memory"), v = h.statusCode || {}, b = {}, y = {}, w = 0, C = "canceled", x = {
readyState: 0,
getResponseHeader: function(e) {
var t;
- if (2 === x) {
- if (!s) for (s = {}; t = pn.exec(a); ) s[t[1].toLowerCase()] = t[2];
- t = s[e.toLowerCase()];
+ if (2 === w) {
+ if (!a) for (a = {}; t = hn.exec(s); ) a[t[1].toLowerCase()] = t[2];
+ t = a[e.toLowerCase()];
}
return null == t ? null : t;
},
getAllResponseHeaders: function() {
- return 2 === x ? a : null;
+ return 2 === w ? s : null;
},
setRequestHeader: function(e, t) {
var n = e.toLowerCase();
- return x || (e = y[n] = y[n] || e, b[e] = t), this;
+ return w || (e = y[n] = y[n] || e, b[e] = t), this;
},
overrideMimeType: function(e) {
- return x || (p.mimeType = e), this;
+ return w || (h.mimeType = e), this;
},
statusCode: function(e) {
var t;
- if (e) if (2 > x) for (t in e) v[t] = [ v[t], e[t] ]; else C.always(e[C.status]);
+ if (e) if (2 > w) for (t in e) v[t] = [ v[t], e[t] ]; else x.always(e[x.status]);
return this;
},
abort: function(e) {
- var t = e || w;
+ var t = e || C;
return o && o.abort(t), i(0, t), this;
}
};
- if (m.promise(C).complete = g.add, C.success = C.done, C.error = C.fail, p.url = ((e || p.url || sn) + "").replace(un, "").replace(mn, an[1] + "//"),
- p.type = n.method || n.type || p.method || p.type, p.dataTypes = rt.trim(p.dataType || "*").toLowerCase().match(st) || [ "" ],
- null == p.crossDomain && (c = gn.exec(p.url.toLowerCase()), p.crossDomain = !(!c || c[1] === an[1] && c[2] === an[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (an[3] || ("http:" === an[1] ? "80" : "443")))),
- p.data && p.processData && "string" != typeof p.data && (p.data = rt.param(p.data, p.traditional)),
- I(bn, p, n, C), 2 === x) return C;
- u = p.global, u && 0 === rt.active++ && rt.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(),
- p.hasContent = !hn.test(p.type), r = p.url, p.hasContent || (p.data && (r = p.url += (cn.test(r) ? "&" : "?") + p.data,
- delete p.data), p.cache === !1 && (p.url = dn.test(r) ? r.replace(dn, "$1_=" + ln++) : r + (cn.test(r) ? "&" : "?") + "_=" + ln++)),
- p.ifModified && (rt.lastModified[r] && C.setRequestHeader("If-Modified-Since", rt.lastModified[r]),
- rt.etag[r] && C.setRequestHeader("If-None-Match", rt.etag[r])), (p.data && p.hasContent && p.contentType !== !1 || n.contentType) && C.setRequestHeader("Content-Type", p.contentType),
- C.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + xn + "; q=0.01" : "") : p.accepts["*"]);
- for (d in p.headers) C.setRequestHeader(d, p.headers[d]);
- if (p.beforeSend && (p.beforeSend.call(f, C, p) === !1 || 2 === x)) return C.abort();
- w = "abort";
+ if (g.promise(x).complete = m.add, x.success = x.done, x.error = x.fail, h.url = ((e || h.url || an) + "").replace(un, "").replace(gn, sn[1] + "//"),
+ h.type = n.method || n.type || h.method || h.type, h.dataTypes = rt.trim(h.dataType || "*").toLowerCase().match(at) || [ "" ],
+ null == h.crossDomain && (c = mn.exec(h.url.toLowerCase()), h.crossDomain = !(!c || c[1] === sn[1] && c[2] === sn[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (sn[3] || ("http:" === sn[1] ? "80" : "443")))),
+ h.data && h.processData && "string" != typeof h.data && (h.data = rt.param(h.data, h.traditional)),
+ $(bn, h, n, x), 2 === w) return x;
+ u = h.global, u && 0 === rt.active++ && rt.event.trigger("ajaxStart"), h.type = h.type.toUpperCase(),
+ h.hasContent = !fn.test(h.type), r = h.url, h.hasContent || (h.data && (r = h.url += (cn.test(r) ? "&" : "?") + h.data,
+ delete h.data), h.cache === !1 && (h.url = dn.test(r) ? r.replace(dn, "$1_=" + ln++) : r + (cn.test(r) ? "&" : "?") + "_=" + ln++)),
+ h.ifModified && (rt.lastModified[r] && x.setRequestHeader("If-Modified-Since", rt.lastModified[r]),
+ rt.etag[r] && x.setRequestHeader("If-None-Match", rt.etag[r])), (h.data && h.hasContent && h.contentType !== !1 || n.contentType) && x.setRequestHeader("Content-Type", h.contentType),
+ x.setRequestHeader("Accept", h.dataTypes[0] && h.accepts[h.dataTypes[0]] ? h.accepts[h.dataTypes[0]] + ("*" !== h.dataTypes[0] ? ", " + wn + "; q=0.01" : "") : h.accepts["*"]);
+ for (d in h.headers) x.setRequestHeader(d, h.headers[d]);
+ if (h.beforeSend && (h.beforeSend.call(p, x, h) === !1 || 2 === w)) return x.abort();
+ C = "abort";
for (d in {
success: 1,
error: 1,
complete: 1
- }) C[d](p[d]);
- if (o = I(yn, p, n, C)) {
- C.readyState = 1, u && h.trigger("ajaxSend", [ C, p ]), p.async && p.timeout > 0 && (l = setTimeout(function() {
- C.abort("timeout");
- }, p.timeout));
+ }) x[d](h[d]);
+ if (o = $(yn, h, n, x)) {
+ x.readyState = 1, u && f.trigger("ajaxSend", [ x, h ]), h.async && h.timeout > 0 && (l = setTimeout(function() {
+ x.abort("timeout");
+ }, h.timeout));
try {
- x = 1, o.send(b, i);
- } catch (k) {
- if (!(2 > x)) throw k;
- i(-1, k);
+ w = 1, o.send(b, i);
+ } catch (E) {
+ if (!(2 > w)) throw E;
+ i(-1, E);
}
} else i(-1, "No Transport");
- return C;
+ return x;
},
getJSON: function(e, t, n) {
return rt.get(e, t, n, "json");
@@ -3118,7 +3249,7 @@ function css_browser_selector(e) {
src: e.url
}).on("load error", n = function(e) {
t.remove(), n = null, e && o("error" === e.type ? 404 : 200, e.type);
- }), G.head.appendChild(t[0]);
+ }), U.head.appendChild(t[0]);
},
abort: function() {
n && n();
@@ -3126,95 +3257,95 @@ function css_browser_selector(e) {
};
}
});
- var Cn = [], kn = /(=)\?(?=&|$)|\?\?/;
+ var xn = [], En = /(=)\?(?=&|$)|\?\?/;
rt.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
- var e = Cn.pop() || rt.expando + "_" + ln++;
+ var e = xn.pop() || rt.expando + "_" + ln++;
return this[e] = !0, e;
}
}), rt.ajaxPrefilter("json jsonp", function(n, i, o) {
- var r, a, s, l = n.jsonp !== !1 && (kn.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && kn.test(n.data) && "data");
+ var r, s, a, l = n.jsonp !== !1 && (En.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && En.test(n.data) && "data");
return l || "jsonp" === n.dataTypes[0] ? (r = n.jsonpCallback = rt.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback,
- l ? n[l] = n[l].replace(kn, "$1" + r) : n.jsonp !== !1 && (n.url += (cn.test(n.url) ? "&" : "?") + n.jsonp + "=" + r),
+ l ? n[l] = n[l].replace(En, "$1" + r) : n.jsonp !== !1 && (n.url += (cn.test(n.url) ? "&" : "?") + n.jsonp + "=" + r),
n.converters["script json"] = function() {
- return s || rt.error(r + " was not called"), s[0];
- }, n.dataTypes[0] = "json", a = e[r], e[r] = function() {
- s = arguments;
+ return a || rt.error(r + " was not called"), a[0];
+ }, n.dataTypes[0] = "json", s = e[r], e[r] = function() {
+ a = arguments;
}, o.always(function() {
- e[r] = a, n[r] && (n.jsonpCallback = i.jsonpCallback, Cn.push(r)), s && rt.isFunction(a) && a(s[0]),
- s = a = t;
+ e[r] = s, n[r] && (n.jsonpCallback = i.jsonpCallback, xn.push(r)), a && rt.isFunction(s) && s(a[0]),
+ a = s = t;
}), "script") : void 0;
}), rt.ajaxSettings.xhr = function() {
try {
return new XMLHttpRequest();
} catch (e) {}
};
- var Sn = rt.ajaxSettings.xhr(), _n = {
+ var An = rt.ajaxSettings.xhr(), Sn = {
0: 200,
1223: 204
- }, Tn = 0, En = {};
+ }, kn = 0, Fn = {};
e.ActiveXObject && rt(e).on("unload", function() {
- for (var e in En) En[e]();
- En = t;
- }), rt.support.cors = !!Sn && "withCredentials" in Sn, rt.support.ajax = Sn = !!Sn,
+ for (var e in Fn) Fn[e]();
+ Fn = t;
+ }), rt.support.cors = !!An && "withCredentials" in An, rt.support.ajax = An = !!An,
rt.ajaxTransport(function(e) {
var n;
- return rt.support.cors || Sn && !e.crossDomain ? {
+ return rt.support.cors || An && !e.crossDomain ? {
send: function(i, o) {
- var r, a, s = e.xhr();
- if (s.open(e.type, e.url, e.async, e.username, e.password), e.xhrFields) for (r in e.xhrFields) s[r] = e.xhrFields[r];
- e.mimeType && s.overrideMimeType && s.overrideMimeType(e.mimeType), e.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
- for (r in i) s.setRequestHeader(r, i[r]);
+ var r, s, a = e.xhr();
+ if (a.open(e.type, e.url, e.async, e.username, e.password), e.xhrFields) for (r in e.xhrFields) a[r] = e.xhrFields[r];
+ e.mimeType && a.overrideMimeType && a.overrideMimeType(e.mimeType), e.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
+ for (r in i) a.setRequestHeader(r, i[r]);
n = function(e) {
return function() {
- n && (delete En[a], n = s.onload = s.onerror = null, "abort" === e ? s.abort() : "error" === e ? o(s.status || 404, s.statusText) : o(_n[s.status] || s.status, s.statusText, "string" == typeof s.responseText ? {
- text: s.responseText
- } : t, s.getAllResponseHeaders()));
+ n && (delete Fn[s], n = a.onload = a.onerror = null, "abort" === e ? a.abort() : "error" === e ? o(a.status || 404, a.statusText) : o(Sn[a.status] || a.status, a.statusText, "string" == typeof a.responseText ? {
+ text: a.responseText
+ } : t, a.getAllResponseHeaders()));
};
- }, s.onload = n(), s.onerror = n("error"), n = En[a = Tn++] = n("abort"), s.send(e.hasContent && e.data || null);
+ }, a.onload = n(), a.onerror = n("error"), n = Fn[s = kn++] = n("abort"), a.send(e.hasContent && e.data || null);
},
abort: function() {
n && n();
}
} : void 0;
});
- var Nn, In, Pn = /^(?:toggle|show|hide)$/, An = new RegExp("^(?:([+-])=|)(" + at + ")([a-z%]*)$", "i"), Mn = /queueHooks$/, Ln = [ j ], $n = {
+ var _n, $n, Dn = /^(?:toggle|show|hide)$/, Tn = new RegExp("^(?:([+-])=|)(" + st + ")([a-z%]*)$", "i"), Ln = /queueHooks$/, Bn = [ P ], Mn = {
"*": [ function(e, t) {
- var n = this.createTween(e, t), i = n.cur(), o = An.exec(t), r = o && o[3] || (rt.cssNumber[e] ? "" : "px"), a = (rt.cssNumber[e] || "px" !== r && +i) && An.exec(rt.css(n.elem, e)), s = 1, l = 20;
- if (a && a[3] !== r) {
- r = r || a[3], o = o || [], a = +i || 1;
- do s = s || ".5", a /= s, rt.style(n.elem, e, a + r); while (s !== (s = n.cur() / i) && 1 !== s && --l);
+ var n = this.createTween(e, t), i = n.cur(), o = Tn.exec(t), r = o && o[3] || (rt.cssNumber[e] ? "" : "px"), s = (rt.cssNumber[e] || "px" !== r && +i) && Tn.exec(rt.css(n.elem, e)), a = 1, l = 20;
+ if (s && s[3] !== r) {
+ r = r || s[3], o = o || [], s = +i || 1;
+ do a = a || ".5", s /= a, rt.style(n.elem, e, s + r); while (a !== (a = n.cur() / i) && 1 !== a && --l);
}
- return o && (a = n.start = +a || +i || 0, n.unit = r, n.end = o[1] ? a + (o[1] + 1) * o[2] : +o[2]),
+ return o && (s = n.start = +s || +i || 0, n.unit = r, n.end = o[1] ? s + (o[1] + 1) * o[2] : +o[2]),
n;
} ]
};
- rt.Animation = rt.extend(z, {
+ rt.Animation = rt.extend(R, {
tweener: function(e, t) {
rt.isFunction(e) ? (t = e, e = [ "*" ]) : e = e.split(" ");
- for (var n, i = 0, o = e.length; o > i; i++) n = e[i], $n[n] = $n[n] || [], $n[n].unshift(t);
+ for (var n, i = 0, o = e.length; o > i; i++) n = e[i], Mn[n] = Mn[n] || [], Mn[n].unshift(t);
},
prefilter: function(e, t) {
- t ? Ln.unshift(e) : Ln.push(e);
+ t ? Bn.unshift(e) : Bn.push(e);
}
- }), rt.Tween = D, D.prototype = {
- constructor: D,
+ }), rt.Tween = N, N.prototype = {
+ constructor: N,
init: function(e, t, n, i, o, r) {
this.elem = e, this.prop = n, this.easing = o || "swing", this.options = t, this.start = this.now = this.cur(),
this.end = i, this.unit = r || (rt.cssNumber[n] ? "" : "px");
},
cur: function() {
- var e = D.propHooks[this.prop];
- return e && e.get ? e.get(this) : D.propHooks._default.get(this);
+ var e = N.propHooks[this.prop];
+ return e && e.get ? e.get(this) : N.propHooks._default.get(this);
},
run: function(e) {
- var t, n = D.propHooks[this.prop];
+ var t, n = N.propHooks[this.prop];
return this.pos = t = this.options.duration ? rt.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e,
this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this),
- n && n.set ? n.set(this) : D.propHooks._default.set(this), this;
+ n && n.set ? n.set(this) : N.propHooks._default.set(this), this;
}
- }, D.prototype.init.prototype = D.prototype, D.propHooks = {
+ }, N.prototype.init.prototype = N.prototype, N.propHooks = {
_default: {
get: function(e) {
var t;
@@ -3225,14 +3356,14 @@ function css_browser_selector(e) {
rt.fx.step[e.prop] ? rt.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[rt.cssProps[e.prop]] || rt.cssHooks[e.prop]) ? rt.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now;
}
}
- }, D.propHooks.scrollTop = D.propHooks.scrollLeft = {
+ }, N.propHooks.scrollTop = N.propHooks.scrollLeft = {
set: function(e) {
e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now);
}
}, rt.each([ "toggle", "show", "hide" ], function(e, t) {
var n = rt.fn[t];
rt.fn[t] = function(e, i, o) {
- return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(O(t, !0), e, i, o);
+ return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(z(t, !0), e, i, o);
};
}), rt.fn.extend({
fadeTo: function(e, t, n, i) {
@@ -3241,11 +3372,11 @@ function css_browser_selector(e) {
}, e, n, i);
},
animate: function(e, t, n, i) {
- var o = rt.isEmptyObject(e), r = rt.speed(t, n, i), a = function() {
- var t = z(this, rt.extend({}, e), r);
- (o || gt.get(this, "finish")) && t.stop(!0);
+ var o = rt.isEmptyObject(e), r = rt.speed(t, n, i), s = function() {
+ var t = R(this, rt.extend({}, e), r);
+ (o || mt.get(this, "finish")) && t.stop(!0);
};
- return a.finish = a, o || r.queue === !1 ? this.each(a) : this.queue(r.queue, a);
+ return s.finish = s, o || r.queue === !1 ? this.each(s) : this.queue(r.queue, s);
},
stop: function(e, n, i) {
var o = function(e) {
@@ -3254,8 +3385,8 @@ function css_browser_selector(e) {
};
return "string" != typeof e && (i = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []),
this.each(function() {
- var t = !0, n = null != e && e + "queueHooks", r = rt.timers, a = gt.get(this);
- if (n) a[n] && a[n].stop && o(a[n]); else for (n in a) a[n] && a[n].stop && Mn.test(n) && o(a[n]);
+ var t = !0, n = null != e && e + "queueHooks", r = rt.timers, s = mt.get(this);
+ if (n) s[n] && s[n].stop && o(s[n]); else for (n in s) s[n] && s[n].stop && Ln.test(n) && o(s[n]);
for (n = r.length; n--; ) r[n].elem !== this || null != e && r[n].queue !== e || (r[n].anim.stop(i),
t = !1, r.splice(n, 1));
(t || !i) && rt.dequeue(this, e);
@@ -3263,18 +3394,18 @@ function css_browser_selector(e) {
},
finish: function(e) {
return e !== !1 && (e = e || "fx"), this.each(function() {
- var t, n = gt.get(this), i = n[e + "queue"], o = n[e + "queueHooks"], r = rt.timers, a = i ? i.length : 0;
+ var t, n = mt.get(this), i = n[e + "queue"], o = n[e + "queueHooks"], r = rt.timers, s = i ? i.length : 0;
for (n.finish = !0, rt.queue(this, e, []), o && o.stop && o.stop.call(this, !0),
t = r.length; t--; ) r[t].elem === this && r[t].queue === e && (r[t].anim.stop(!0),
r.splice(t, 1));
- for (t = 0; a > t; t++) i[t] && i[t].finish && i[t].finish.call(this);
+ for (t = 0; s > t; t++) i[t] && i[t].finish && i[t].finish.call(this);
delete n.finish;
});
}
}), rt.each({
- slideDown: O("show"),
- slideUp: O("hide"),
- slideToggle: O("toggle"),
+ slideDown: z("show"),
+ slideUp: z("hide"),
+ slideToggle: z("toggle"),
fadeIn: {
opacity: "show"
},
@@ -3305,16 +3436,16 @@ function css_browser_selector(e) {
swing: function(e) {
return .5 - Math.cos(e * Math.PI) / 2;
}
- }, rt.timers = [], rt.fx = D.prototype.init, rt.fx.tick = function() {
+ }, rt.timers = [], rt.fx = N.prototype.init, rt.fx.tick = function() {
var e, n = rt.timers, i = 0;
- for (Nn = rt.now(); i < n.length; i++) e = n[i], e() || n[i] !== e || n.splice(i--, 1);
- n.length || rt.fx.stop(), Nn = t;
+ for (_n = rt.now(); i < n.length; i++) e = n[i], e() || n[i] !== e || n.splice(i--, 1);
+ n.length || rt.fx.stop(), _n = t;
}, rt.fx.timer = function(e) {
e() && rt.timers.push(e) && rt.fx.start();
}, rt.fx.interval = 13, rt.fx.start = function() {
- In || (In = setInterval(rt.fx.tick, rt.fx.interval));
+ $n || ($n = setInterval(rt.fx.tick, rt.fx.interval));
}, rt.fx.stop = function() {
- clearInterval(In), In = null;
+ clearInterval($n), $n = null;
}, rt.fx.speeds = {
slow: 600,
fast: 200,
@@ -3330,20 +3461,20 @@ function css_browser_selector(e) {
var n, i, o = this[0], r = {
top: 0,
left: 0
- }, a = o && o.ownerDocument;
- if (a) return n = a.documentElement, rt.contains(n, o) ? (typeof o.getBoundingClientRect !== B && (r = o.getBoundingClientRect()),
- i = F(a), {
+ }, s = o && o.ownerDocument;
+ if (s) return n = s.documentElement, rt.contains(n, o) ? (typeof o.getBoundingClientRect !== q && (r = o.getBoundingClientRect()),
+ i = O(s), {
top: r.top + i.pageYOffset - n.clientTop,
left: r.left + i.pageXOffset - n.clientLeft
}) : r;
}, rt.offset = {
setOffset: function(e, t, n) {
- var i, o, r, a, s, l, c, u = rt.css(e, "position"), d = rt(e), p = {};
- "static" === u && (e.style.position = "relative"), s = d.offset(), r = rt.css(e, "top"),
+ var i, o, r, s, a, l, c, u = rt.css(e, "position"), d = rt(e), h = {};
+ "static" === u && (e.style.position = "relative"), a = d.offset(), r = rt.css(e, "top"),
l = rt.css(e, "left"), c = ("absolute" === u || "fixed" === u) && (r + l).indexOf("auto") > -1,
- c ? (i = d.position(), a = i.top, o = i.left) : (a = parseFloat(r) || 0, o = parseFloat(l) || 0),
- rt.isFunction(t) && (t = t.call(e, n, s)), null != t.top && (p.top = t.top - s.top + a),
- null != t.left && (p.left = t.left - s.left + o), "using" in t ? t.using.call(e, p) : d.css(p);
+ c ? (i = d.position(), s = i.top, o = i.left) : (s = parseFloat(r) || 0, o = parseFloat(l) || 0),
+ rt.isFunction(t) && (t = t.call(e, n, a)), null != t.top && (h.top = t.top - a.top + s),
+ null != t.left && (h.left = t.left - a.left + o), "using" in t ? t.using.call(e, h) : d.css(h);
}
}, rt.fn.extend({
position: function() {
@@ -3362,8 +3493,8 @@ function css_browser_selector(e) {
},
offsetParent: function() {
return this.map(function() {
- for (var e = this.offsetParent || W; e && !rt.nodeName(e, "html") && "static" === rt.css(e, "position"); ) e = e.offsetParent;
- return e || W;
+ for (var e = this.offsetParent || G; e && !rt.nodeName(e, "html") && "static" === rt.css(e, "position"); ) e = e.offsetParent;
+ return e || G;
});
}
}), rt.each({
@@ -3372,9 +3503,9 @@ function css_browser_selector(e) {
}, function(n, i) {
var o = "pageYOffset" === i;
rt.fn[n] = function(r) {
- return rt.access(this, function(n, r, a) {
- var s = F(n);
- return a === t ? s ? s[i] : n[r] : (s ? s.scrollTo(o ? e.pageXOffset : a, o ? a : e.pageYOffset) : n[r] = a,
+ return rt.access(this, function(n, r, s) {
+ var a = O(n);
+ return s === t ? a ? a[i] : n[r] : (a ? a.scrollTo(o ? e.pageXOffset : s, o ? s : e.pageYOffset) : n[r] = s,
void 0);
}, n, r, arguments.length, null);
};
@@ -3388,12 +3519,12 @@ function css_browser_selector(e) {
"": "outer" + e
}, function(i, o) {
rt.fn[o] = function(o, r) {
- var a = arguments.length && (i || "boolean" != typeof o), s = i || (o === !0 || r === !0 ? "margin" : "border");
+ var s = arguments.length && (i || "boolean" != typeof o), a = i || (o === !0 || r === !0 ? "margin" : "border");
return rt.access(this, function(n, i, o) {
var r;
return rt.isWindow(n) ? n.document.documentElement["client" + e] : 9 === n.nodeType ? (r = n.documentElement,
- Math.max(n.body["scroll" + e], r["scroll" + e], n.body["offset" + e], r["offset" + e], r["client" + e])) : o === t ? rt.css(n, i, s) : rt.style(n, i, o, s);
- }, n, a ? o : t, a, null);
+ Math.max(n.body["scroll" + e], r["scroll" + e], n.body["offset" + e], r["offset" + e], r["client" + e])) : o === t ? rt.css(n, i, a) : rt.style(n, i, o, a);
+ }, n, s ? o : t, s, null);
};
});
}), rt.fn.size = function() {
@@ -3402,134 +3533,134 @@ function css_browser_selector(e) {
return rt;
}), "object" == typeof e && "object" == typeof e.document && (e.jQuery = e.$ = rt);
})(window), function() {
- var e = this, t = e._, n = {}, i = Array.prototype, o = Object.prototype, r = Function.prototype, a = i.push, s = i.slice, l = i.concat, c = o.toString, u = o.hasOwnProperty, d = i.forEach, p = i.map, f = i.reduce, h = i.reduceRight, m = i.filter, g = i.every, v = i.some, b = i.indexOf, y = i.lastIndexOf, x = Array.isArray, w = Object.keys, C = r.bind, k = function(e) {
- return e instanceof k ? e : this instanceof k ? (this._wrapped = e, void 0) : new k(e);
+ var e = this, t = e._, n = {}, i = Array.prototype, o = Object.prototype, r = Function.prototype, s = i.push, a = i.slice, l = i.concat, c = o.toString, u = o.hasOwnProperty, d = i.forEach, h = i.map, p = i.reduce, f = i.reduceRight, g = i.filter, m = i.every, v = i.some, b = i.indexOf, y = i.lastIndexOf, w = Array.isArray, C = Object.keys, x = r.bind, E = function(e) {
+ return e instanceof E ? e : this instanceof E ? (this._wrapped = e, void 0) : new E(e);
};
- "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = k),
- exports._ = k) : e._ = k, k.VERSION = "1.5.1";
- var S = k.each = k.forEach = function(e, t, i) {
+ "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = E),
+ exports._ = E) : e._ = E, E.VERSION = "1.5.1";
+ var A = E.each = E.forEach = function(e, t, i) {
if (null != e) if (d && e.forEach === d) e.forEach(t, i); else if (e.length === +e.length) {
for (var o = 0, r = e.length; r > o; o++) if (t.call(i, e[o], o, e) === n) return;
- } else for (var a in e) if (k.has(e, a) && t.call(i, e[a], a, e) === n) return;
+ } else for (var s in e) if (E.has(e, s) && t.call(i, e[s], s, e) === n) return;
};
- k.map = k.collect = function(e, t, n) {
+ E.map = E.collect = function(e, t, n) {
var i = [];
- return null == e ? i : p && e.map === p ? e.map(t, n) : (S(e, function(e, o, r) {
+ return null == e ? i : h && e.map === h ? e.map(t, n) : (A(e, function(e, o, r) {
i.push(t.call(n, e, o, r));
}), i);
};
- var _ = "Reduce of empty array with no initial value";
- k.reduce = k.foldl = k.inject = function(e, t, n, i) {
+ var S = "Reduce of empty array with no initial value";
+ E.reduce = E.foldl = E.inject = function(e, t, n, i) {
var o = arguments.length > 2;
- if (null == e && (e = []), f && e.reduce === f) return i && (t = k.bind(t, i)),
+ if (null == e && (e = []), p && e.reduce === p) return i && (t = E.bind(t, i)),
o ? e.reduce(t, n) : e.reduce(t);
- if (S(e, function(e, r, a) {
- o ? n = t.call(i, n, e, r, a) : (n = e, o = !0);
- }), !o) throw new TypeError(_);
+ if (A(e, function(e, r, s) {
+ o ? n = t.call(i, n, e, r, s) : (n = e, o = !0);
+ }), !o) throw new TypeError(S);
return n;
- }, k.reduceRight = k.foldr = function(e, t, n, i) {
+ }, E.reduceRight = E.foldr = function(e, t, n, i) {
var o = arguments.length > 2;
- if (null == e && (e = []), h && e.reduceRight === h) return i && (t = k.bind(t, i)),
+ if (null == e && (e = []), f && e.reduceRight === f) return i && (t = E.bind(t, i)),
o ? e.reduceRight(t, n) : e.reduceRight(t);
var r = e.length;
if (r !== +r) {
- var a = k.keys(e);
- r = a.length;
+ var s = E.keys(e);
+ r = s.length;
}
- if (S(e, function(s, l, c) {
- l = a ? a[--r] : --r, o ? n = t.call(i, n, e[l], l, c) : (n = e[l], o = !0);
- }), !o) throw new TypeError(_);
+ if (A(e, function(a, l, c) {
+ l = s ? s[--r] : --r, o ? n = t.call(i, n, e[l], l, c) : (n = e[l], o = !0);
+ }), !o) throw new TypeError(S);
return n;
- }, k.find = k.detect = function(e, t, n) {
+ }, E.find = E.detect = function(e, t, n) {
var i;
- return T(e, function(e, o, r) {
+ return k(e, function(e, o, r) {
return t.call(n, e, o, r) ? (i = e, !0) : void 0;
}), i;
- }, k.filter = k.select = function(e, t, n) {
+ }, E.filter = E.select = function(e, t, n) {
var i = [];
- return null == e ? i : m && e.filter === m ? e.filter(t, n) : (S(e, function(e, o, r) {
+ return null == e ? i : g && e.filter === g ? e.filter(t, n) : (A(e, function(e, o, r) {
t.call(n, e, o, r) && i.push(e);
}), i);
- }, k.reject = function(e, t, n) {
- return k.filter(e, function(e, i, o) {
+ }, E.reject = function(e, t, n) {
+ return E.filter(e, function(e, i, o) {
return !t.call(n, e, i, o);
}, n);
- }, k.every = k.all = function(e, t, i) {
- t || (t = k.identity);
+ }, E.every = E.all = function(e, t, i) {
+ t || (t = E.identity);
var o = !0;
- return null == e ? o : g && e.every === g ? e.every(t, i) : (S(e, function(e, r, a) {
- return (o = o && t.call(i, e, r, a)) ? void 0 : n;
+ return null == e ? o : m && e.every === m ? e.every(t, i) : (A(e, function(e, r, s) {
+ return (o = o && t.call(i, e, r, s)) ? void 0 : n;
}), !!o);
};
- var T = k.some = k.any = function(e, t, i) {
- t || (t = k.identity);
+ var k = E.some = E.any = function(e, t, i) {
+ t || (t = E.identity);
var o = !1;
- return null == e ? o : v && e.some === v ? e.some(t, i) : (S(e, function(e, r, a) {
- return o || (o = t.call(i, e, r, a)) ? n : void 0;
+ return null == e ? o : v && e.some === v ? e.some(t, i) : (A(e, function(e, r, s) {
+ return o || (o = t.call(i, e, r, s)) ? n : void 0;
}), !!o);
};
- k.contains = k.include = function(e, t) {
- return null == e ? !1 : b && e.indexOf === b ? -1 != e.indexOf(t) : T(e, function(e) {
+ E.contains = E.include = function(e, t) {
+ return null == e ? !1 : b && e.indexOf === b ? -1 != e.indexOf(t) : k(e, function(e) {
return e === t;
});
- }, k.invoke = function(e, t) {
- var n = s.call(arguments, 2), i = k.isFunction(t);
- return k.map(e, function(e) {
+ }, E.invoke = function(e, t) {
+ var n = a.call(arguments, 2), i = E.isFunction(t);
+ return E.map(e, function(e) {
return (i ? t : e[t]).apply(e, n);
});
- }, k.pluck = function(e, t) {
- return k.map(e, function(e) {
+ }, E.pluck = function(e, t) {
+ return E.map(e, function(e) {
return e[t];
});
- }, k.where = function(e, t, n) {
- return k.isEmpty(t) ? n ? void 0 : [] : k[n ? "find" : "filter"](e, function(e) {
+ }, E.where = function(e, t, n) {
+ return E.isEmpty(t) ? n ? void 0 : [] : E[n ? "find" : "filter"](e, function(e) {
for (var n in t) if (t[n] !== e[n]) return !1;
return !0;
});
- }, k.findWhere = function(e, t) {
- return k.where(e, t, !0);
- }, k.max = function(e, t, n) {
- if (!t && k.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.max.apply(Math, e);
- if (!t && k.isEmpty(e)) return -1/0;
+ }, E.findWhere = function(e, t) {
+ return E.where(e, t, !0);
+ }, E.max = function(e, t, n) {
+ if (!t && E.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.max.apply(Math, e);
+ if (!t && E.isEmpty(e)) return -1/0;
var i = {
computed: -1/0,
value: -1/0
};
- return S(e, function(e, o, r) {
- var a = t ? t.call(n, e, o, r) : e;
- a > i.computed && (i = {
+ return A(e, function(e, o, r) {
+ var s = t ? t.call(n, e, o, r) : e;
+ s > i.computed && (i = {
value: e,
- computed: a
+ computed: s
});
}), i.value;
- }, k.min = function(e, t, n) {
- if (!t && k.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.min.apply(Math, e);
- if (!t && k.isEmpty(e)) return 1/0;
+ }, E.min = function(e, t, n) {
+ if (!t && E.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.min.apply(Math, e);
+ if (!t && E.isEmpty(e)) return 1/0;
var i = {
computed: 1/0,
value: 1/0
};
- return S(e, function(e, o, r) {
- var a = t ? t.call(n, e, o, r) : e;
- a < i.computed && (i = {
+ return A(e, function(e, o, r) {
+ var s = t ? t.call(n, e, o, r) : e;
+ s < i.computed && (i = {
value: e,
- computed: a
+ computed: s
});
}), i.value;
- }, k.shuffle = function(e) {
+ }, E.shuffle = function(e) {
var t, n = 0, i = [];
- return S(e, function(e) {
- t = k.random(n++), i[n - 1] = i[t], i[t] = e;
+ return A(e, function(e) {
+ t = E.random(n++), i[n - 1] = i[t], i[t] = e;
}), i;
};
- var E = function(e) {
- return k.isFunction(e) ? e : function(t) {
+ var F = function(e) {
+ return E.isFunction(e) ? e : function(t) {
return t[e];
};
};
- k.sortBy = function(e, t, n) {
- var i = E(t);
- return k.pluck(k.map(e, function(e, t, o) {
+ E.sortBy = function(e, t, n) {
+ var i = F(t);
+ return E.pluck(E.map(e, function(e, t, o) {
return {
value: e,
index: t,
@@ -3544,226 +3675,226 @@ function css_browser_selector(e) {
return e.index < t.index ? -1 : 1;
}), "value");
};
- var N = function(e, t, n, i) {
- var o = {}, r = E(null == t ? k.identity : t);
- return S(e, function(t, a) {
- var s = r.call(n, t, a, e);
- i(o, s, t);
+ var _ = function(e, t, n, i) {
+ var o = {}, r = F(null == t ? E.identity : t);
+ return A(e, function(t, s) {
+ var a = r.call(n, t, s, e);
+ i(o, a, t);
}), o;
};
- k.groupBy = function(e, t, n) {
- return N(e, t, n, function(e, t, n) {
- (k.has(e, t) ? e[t] : e[t] = []).push(n);
+ E.groupBy = function(e, t, n) {
+ return _(e, t, n, function(e, t, n) {
+ (E.has(e, t) ? e[t] : e[t] = []).push(n);
});
- }, k.countBy = function(e, t, n) {
- return N(e, t, n, function(e, t) {
- k.has(e, t) || (e[t] = 0), e[t]++;
+ }, E.countBy = function(e, t, n) {
+ return _(e, t, n, function(e, t) {
+ E.has(e, t) || (e[t] = 0), e[t]++;
});
- }, k.sortedIndex = function(e, t, n, i) {
- n = null == n ? k.identity : E(n);
- for (var o = n.call(i, t), r = 0, a = e.length; a > r; ) {
- var s = r + a >>> 1;
- n.call(i, e[s]) < o ? r = s + 1 : a = s;
+ }, E.sortedIndex = function(e, t, n, i) {
+ n = null == n ? E.identity : F(n);
+ for (var o = n.call(i, t), r = 0, s = e.length; s > r; ) {
+ var a = r + s >>> 1;
+ n.call(i, e[a]) < o ? r = a + 1 : s = a;
}
return r;
- }, k.toArray = function(e) {
- return e ? k.isArray(e) ? s.call(e) : e.length === +e.length ? k.map(e, k.identity) : k.values(e) : [];
- }, k.size = function(e) {
- return null == e ? 0 : e.length === +e.length ? e.length : k.keys(e).length;
- }, k.first = k.head = k.take = function(e, t, n) {
- return null == e ? void 0 : null == t || n ? e[0] : s.call(e, 0, t);
- }, k.initial = function(e, t, n) {
- return s.call(e, 0, e.length - (null == t || n ? 1 : t));
- }, k.last = function(e, t, n) {
- return null == e ? void 0 : null == t || n ? e[e.length - 1] : s.call(e, Math.max(e.length - t, 0));
- }, k.rest = k.tail = k.drop = function(e, t, n) {
- return s.call(e, null == t || n ? 1 : t);
- }, k.compact = function(e) {
- return k.filter(e, k.identity);
+ }, E.toArray = function(e) {
+ return e ? E.isArray(e) ? a.call(e) : e.length === +e.length ? E.map(e, E.identity) : E.values(e) : [];
+ }, E.size = function(e) {
+ return null == e ? 0 : e.length === +e.length ? e.length : E.keys(e).length;
+ }, E.first = E.head = E.take = function(e, t, n) {
+ return null == e ? void 0 : null == t || n ? e[0] : a.call(e, 0, t);
+ }, E.initial = function(e, t, n) {
+ return a.call(e, 0, e.length - (null == t || n ? 1 : t));
+ }, E.last = function(e, t, n) {
+ return null == e ? void 0 : null == t || n ? e[e.length - 1] : a.call(e, Math.max(e.length - t, 0));
+ }, E.rest = E.tail = E.drop = function(e, t, n) {
+ return a.call(e, null == t || n ? 1 : t);
+ }, E.compact = function(e) {
+ return E.filter(e, E.identity);
};
- var I = function(e, t, n) {
- return t && k.every(e, k.isArray) ? l.apply(n, e) : (S(e, function(e) {
- k.isArray(e) || k.isArguments(e) ? t ? a.apply(n, e) : I(e, t, n) : n.push(e);
+ var $ = function(e, t, n) {
+ return t && E.every(e, E.isArray) ? l.apply(n, e) : (A(e, function(e) {
+ E.isArray(e) || E.isArguments(e) ? t ? s.apply(n, e) : $(e, t, n) : n.push(e);
}), n);
};
- k.flatten = function(e, t) {
- return I(e, t, []);
- }, k.without = function(e) {
- return k.difference(e, s.call(arguments, 1));
- }, k.uniq = k.unique = function(e, t, n, i) {
- k.isFunction(t) && (i = n, n = t, t = !1);
- var o = n ? k.map(e, n, i) : e, r = [], a = [];
- return S(o, function(n, i) {
- (t ? i && a[a.length - 1] === n : k.contains(a, n)) || (a.push(n), r.push(e[i]));
+ E.flatten = function(e, t) {
+ return $(e, t, []);
+ }, E.without = function(e) {
+ return E.difference(e, a.call(arguments, 1));
+ }, E.uniq = E.unique = function(e, t, n, i) {
+ E.isFunction(t) && (i = n, n = t, t = !1);
+ var o = n ? E.map(e, n, i) : e, r = [], s = [];
+ return A(o, function(n, i) {
+ (t ? i && s[s.length - 1] === n : E.contains(s, n)) || (s.push(n), r.push(e[i]));
}), r;
- }, k.union = function() {
- return k.uniq(k.flatten(arguments, !0));
- }, k.intersection = function(e) {
- var t = s.call(arguments, 1);
- return k.filter(k.uniq(e), function(e) {
- return k.every(t, function(t) {
- return k.indexOf(t, e) >= 0;
+ }, E.union = function() {
+ return E.uniq(E.flatten(arguments, !0));
+ }, E.intersection = function(e) {
+ var t = a.call(arguments, 1);
+ return E.filter(E.uniq(e), function(e) {
+ return E.every(t, function(t) {
+ return E.indexOf(t, e) >= 0;
});
});
- }, k.difference = function(e) {
- var t = l.apply(i, s.call(arguments, 1));
- return k.filter(e, function(e) {
- return !k.contains(t, e);
+ }, E.difference = function(e) {
+ var t = l.apply(i, a.call(arguments, 1));
+ return E.filter(e, function(e) {
+ return !E.contains(t, e);
});
- }, k.zip = function() {
- for (var e = k.max(k.pluck(arguments, "length").concat(0)), t = new Array(e), n = 0; e > n; n++) t[n] = k.pluck(arguments, "" + n);
+ }, E.zip = function() {
+ for (var e = E.max(E.pluck(arguments, "length").concat(0)), t = new Array(e), n = 0; e > n; n++) t[n] = E.pluck(arguments, "" + n);
return t;
- }, k.object = function(e, t) {
+ }, E.object = function(e, t) {
if (null == e) return {};
for (var n = {}, i = 0, o = e.length; o > i; i++) t ? n[e[i]] = t[i] : n[e[i][0]] = e[i][1];
return n;
- }, k.indexOf = function(e, t, n) {
+ }, E.indexOf = function(e, t, n) {
if (null == e) return -1;
var i = 0, o = e.length;
if (n) {
- if ("number" != typeof n) return i = k.sortedIndex(e, t), e[i] === t ? i : -1;
+ if ("number" != typeof n) return i = E.sortedIndex(e, t), e[i] === t ? i : -1;
i = 0 > n ? Math.max(0, o + n) : n;
}
if (b && e.indexOf === b) return e.indexOf(t, n);
for (;o > i; i++) if (e[i] === t) return i;
return -1;
- }, k.lastIndexOf = function(e, t, n) {
+ }, E.lastIndexOf = function(e, t, n) {
if (null == e) return -1;
var i = null != n;
if (y && e.lastIndexOf === y) return i ? e.lastIndexOf(t, n) : e.lastIndexOf(t);
for (var o = i ? n : e.length; o--; ) if (e[o] === t) return o;
return -1;
- }, k.range = function(e, t, n) {
+ }, E.range = function(e, t, n) {
arguments.length <= 1 && (t = e || 0, e = 0), n = arguments[2] || 1;
for (var i = Math.max(Math.ceil((t - e) / n), 0), o = 0, r = new Array(i); i > o; ) r[o++] = e,
e += n;
return r;
};
- var P = function() {};
- k.bind = function(e, t) {
+ var D = function() {};
+ E.bind = function(e, t) {
var n, i;
- if (C && e.bind === C) return C.apply(e, s.call(arguments, 1));
- if (!k.isFunction(e)) throw new TypeError();
- return n = s.call(arguments, 2), i = function() {
- if (!(this instanceof i)) return e.apply(t, n.concat(s.call(arguments)));
- P.prototype = e.prototype;
- var o = new P();
- P.prototype = null;
- var r = e.apply(o, n.concat(s.call(arguments)));
+ if (x && e.bind === x) return x.apply(e, a.call(arguments, 1));
+ if (!E.isFunction(e)) throw new TypeError();
+ return n = a.call(arguments, 2), i = function() {
+ if (!(this instanceof i)) return e.apply(t, n.concat(a.call(arguments)));
+ D.prototype = e.prototype;
+ var o = new D();
+ D.prototype = null;
+ var r = e.apply(o, n.concat(a.call(arguments)));
return Object(r) === r ? r : o;
};
- }, k.partial = function(e) {
- var t = s.call(arguments, 1);
+ }, E.partial = function(e) {
+ var t = a.call(arguments, 1);
return function() {
- return e.apply(this, t.concat(s.call(arguments)));
+ return e.apply(this, t.concat(a.call(arguments)));
};
- }, k.bindAll = function(e) {
- var t = s.call(arguments, 1);
+ }, E.bindAll = function(e) {
+ var t = a.call(arguments, 1);
if (0 === t.length) throw new Error("bindAll must be passed function names");
- return S(t, function(t) {
- e[t] = k.bind(e[t], e);
+ return A(t, function(t) {
+ e[t] = E.bind(e[t], e);
}), e;
- }, k.memoize = function(e, t) {
+ }, E.memoize = function(e, t) {
var n = {};
- return t || (t = k.identity), function() {
+ return t || (t = E.identity), function() {
var i = t.apply(this, arguments);
- return k.has(n, i) ? n[i] : n[i] = e.apply(this, arguments);
+ return E.has(n, i) ? n[i] : n[i] = e.apply(this, arguments);
};
- }, k.delay = function(e, t) {
- var n = s.call(arguments, 2);
+ }, E.delay = function(e, t) {
+ var n = a.call(arguments, 2);
return setTimeout(function() {
return e.apply(null, n);
}, t);
- }, k.defer = function(e) {
- return k.delay.apply(k, [ e, 1 ].concat(s.call(arguments, 1)));
- }, k.throttle = function(e, t, n) {
- var i, o, r, a = null, s = 0;
+ }, E.defer = function(e) {
+ return E.delay.apply(E, [ e, 1 ].concat(a.call(arguments, 1)));
+ }, E.throttle = function(e, t, n) {
+ var i, o, r, s = null, a = 0;
n || (n = {});
var l = function() {
- s = n.leading === !1 ? 0 : new Date(), a = null, r = e.apply(i, o);
+ a = n.leading === !1 ? 0 : new Date(), s = null, r = e.apply(i, o);
};
return function() {
var c = new Date();
- s || n.leading !== !1 || (s = c);
- var u = t - (c - s);
- return i = this, o = arguments, 0 >= u ? (clearTimeout(a), a = null, s = c, r = e.apply(i, o)) : a || n.trailing === !1 || (a = setTimeout(l, u)),
+ a || n.leading !== !1 || (a = c);
+ var u = t - (c - a);
+ return i = this, o = arguments, 0 >= u ? (clearTimeout(s), s = null, a = c, r = e.apply(i, o)) : s || n.trailing === !1 || (s = setTimeout(l, u)),
r;
};
- }, k.debounce = function(e, t, n) {
+ }, E.debounce = function(e, t, n) {
var i, o = null;
return function() {
- var r = this, a = arguments, s = function() {
- o = null, n || (i = e.apply(r, a));
+ var r = this, s = arguments, a = function() {
+ o = null, n || (i = e.apply(r, s));
}, l = n && !o;
- return clearTimeout(o), o = setTimeout(s, t), l && (i = e.apply(r, a)), i;
+ return clearTimeout(o), o = setTimeout(a, t), l && (i = e.apply(r, s)), i;
};
- }, k.once = function(e) {
+ }, E.once = function(e) {
var t, n = !1;
return function() {
return n ? t : (n = !0, t = e.apply(this, arguments), e = null, t);
};
- }, k.wrap = function(e, t) {
+ }, E.wrap = function(e, t) {
return function() {
var n = [ e ];
- return a.apply(n, arguments), t.apply(this, n);
+ return s.apply(n, arguments), t.apply(this, n);
};
- }, k.compose = function() {
+ }, E.compose = function() {
var e = arguments;
return function() {
for (var t = arguments, n = e.length - 1; n >= 0; n--) t = [ e[n].apply(this, t) ];
return t[0];
};
- }, k.after = function(e, t) {
+ }, E.after = function(e, t) {
return function() {
return --e < 1 ? t.apply(this, arguments) : void 0;
};
- }, k.keys = w || function(e) {
+ }, E.keys = C || function(e) {
if (e !== Object(e)) throw new TypeError("Invalid object");
var t = [];
- for (var n in e) k.has(e, n) && t.push(n);
+ for (var n in e) E.has(e, n) && t.push(n);
return t;
- }, k.values = function(e) {
+ }, E.values = function(e) {
var t = [];
- for (var n in e) k.has(e, n) && t.push(e[n]);
+ for (var n in e) E.has(e, n) && t.push(e[n]);
return t;
- }, k.pairs = function(e) {
+ }, E.pairs = function(e) {
var t = [];
- for (var n in e) k.has(e, n) && t.push([ n, e[n] ]);
+ for (var n in e) E.has(e, n) && t.push([ n, e[n] ]);
return t;
- }, k.invert = function(e) {
+ }, E.invert = function(e) {
var t = {};
- for (var n in e) k.has(e, n) && (t[e[n]] = n);
+ for (var n in e) E.has(e, n) && (t[e[n]] = n);
return t;
- }, k.functions = k.methods = function(e) {
+ }, E.functions = E.methods = function(e) {
var t = [];
- for (var n in e) k.isFunction(e[n]) && t.push(n);
+ for (var n in e) E.isFunction(e[n]) && t.push(n);
return t.sort();
- }, k.extend = function(e) {
- return S(s.call(arguments, 1), function(t) {
+ }, E.extend = function(e) {
+ return A(a.call(arguments, 1), function(t) {
if (t) for (var n in t) e[n] = t[n];
}), e;
- }, k.pick = function(e) {
- var t = {}, n = l.apply(i, s.call(arguments, 1));
- return S(n, function(n) {
+ }, E.pick = function(e) {
+ var t = {}, n = l.apply(i, a.call(arguments, 1));
+ return A(n, function(n) {
n in e && (t[n] = e[n]);
}), t;
- }, k.omit = function(e) {
- var t = {}, n = l.apply(i, s.call(arguments, 1));
- for (var o in e) k.contains(n, o) || (t[o] = e[o]);
+ }, E.omit = function(e) {
+ var t = {}, n = l.apply(i, a.call(arguments, 1));
+ for (var o in e) E.contains(n, o) || (t[o] = e[o]);
return t;
- }, k.defaults = function(e) {
- return S(s.call(arguments, 1), function(t) {
+ }, E.defaults = function(e) {
+ return A(a.call(arguments, 1), function(t) {
if (t) for (var n in t) void 0 === e[n] && (e[n] = t[n]);
}), e;
- }, k.clone = function(e) {
- return k.isObject(e) ? k.isArray(e) ? e.slice() : k.extend({}, e) : e;
- }, k.tap = function(e, t) {
+ }, E.clone = function(e) {
+ return E.isObject(e) ? E.isArray(e) ? e.slice() : E.extend({}, e) : e;
+ }, E.tap = function(e, t) {
return t(e), e;
};
- var A = function(e, t, n, i) {
+ var T = function(e, t, n, i) {
if (e === t) return 0 !== e || 1 / e == 1 / t;
if (null == e || null == t) return e === t;
- e instanceof k && (e = e._wrapped), t instanceof k && (t = t._wrapped);
+ e instanceof E && (e = e._wrapped), t instanceof E && (t = t._wrapped);
var o = c.call(e);
if (o != c.call(t)) return !1;
switch (o) {
@@ -3782,65 +3913,65 @@ function css_browser_selector(e) {
}
if ("object" != typeof e || "object" != typeof t) return !1;
for (var r = n.length; r--; ) if (n[r] == e) return i[r] == t;
- var a = e.constructor, s = t.constructor;
- if (a !== s && !(k.isFunction(a) && a instanceof a && k.isFunction(s) && s instanceof s)) return !1;
+ var s = e.constructor, a = t.constructor;
+ if (s !== a && !(E.isFunction(s) && s instanceof s && E.isFunction(a) && a instanceof a)) return !1;
n.push(e), i.push(t);
var l = 0, u = !0;
if ("[object Array]" == o) {
- if (l = e.length, u = l == t.length) for (;l-- && (u = A(e[l], t[l], n, i)); ) ;
+ if (l = e.length, u = l == t.length) for (;l-- && (u = T(e[l], t[l], n, i)); ) ;
} else {
- for (var d in e) if (k.has(e, d) && (l++, !(u = k.has(t, d) && A(e[d], t[d], n, i)))) break;
+ for (var d in e) if (E.has(e, d) && (l++, !(u = E.has(t, d) && T(e[d], t[d], n, i)))) break;
if (u) {
- for (d in t) if (k.has(t, d) && !l--) break;
+ for (d in t) if (E.has(t, d) && !l--) break;
u = !l;
}
}
return n.pop(), i.pop(), u;
};
- k.isEqual = function(e, t) {
- return A(e, t, [], []);
- }, k.isEmpty = function(e) {
+ E.isEqual = function(e, t) {
+ return T(e, t, [], []);
+ }, E.isEmpty = function(e) {
if (null == e) return !0;
- if (k.isArray(e) || k.isString(e)) return 0 === e.length;
- for (var t in e) if (k.has(e, t)) return !1;
+ if (E.isArray(e) || E.isString(e)) return 0 === e.length;
+ for (var t in e) if (E.has(e, t)) return !1;
return !0;
- }, k.isElement = function(e) {
+ }, E.isElement = function(e) {
return !(!e || 1 !== e.nodeType);
- }, k.isArray = x || function(e) {
+ }, E.isArray = w || function(e) {
return "[object Array]" == c.call(e);
- }, k.isObject = function(e) {
+ }, E.isObject = function(e) {
return e === Object(e);
- }, S([ "Arguments", "Function", "String", "Number", "Date", "RegExp" ], function(e) {
- k["is" + e] = function(t) {
+ }, A([ "Arguments", "Function", "String", "Number", "Date", "RegExp" ], function(e) {
+ E["is" + e] = function(t) {
return c.call(t) == "[object " + e + "]";
};
- }), k.isArguments(arguments) || (k.isArguments = function(e) {
- return !(!e || !k.has(e, "callee"));
- }), "function" != typeof /./ && (k.isFunction = function(e) {
+ }), E.isArguments(arguments) || (E.isArguments = function(e) {
+ return !(!e || !E.has(e, "callee"));
+ }), "function" != typeof /./ && (E.isFunction = function(e) {
return "function" == typeof e;
- }), k.isFinite = function(e) {
+ }), E.isFinite = function(e) {
return isFinite(e) && !isNaN(parseFloat(e));
- }, k.isNaN = function(e) {
- return k.isNumber(e) && e != +e;
- }, k.isBoolean = function(e) {
+ }, E.isNaN = function(e) {
+ return E.isNumber(e) && e != +e;
+ }, E.isBoolean = function(e) {
return e === !0 || e === !1 || "[object Boolean]" == c.call(e);
- }, k.isNull = function(e) {
+ }, E.isNull = function(e) {
return null === e;
- }, k.isUndefined = function(e) {
+ }, E.isUndefined = function(e) {
return void 0 === e;
- }, k.has = function(e, t) {
+ }, E.has = function(e, t) {
return u.call(e, t);
- }, k.noConflict = function() {
+ }, E.noConflict = function() {
return e._ = t, this;
- }, k.identity = function(e) {
+ }, E.identity = function(e) {
return e;
- }, k.times = function(e, t, n) {
+ }, E.times = function(e, t, n) {
for (var i = Array(Math.max(0, e)), o = 0; e > o; o++) i[o] = t.call(n, o);
return i;
- }, k.random = function(e, t) {
+ }, E.random = function(e, t) {
return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1));
};
- var M = {
+ var L = {
escape: {
"&": "&",
"<": "<",
@@ -3850,40 +3981,40 @@ function css_browser_selector(e) {
"/": "/"
}
};
- M.unescape = k.invert(M.escape);
- var L = {
- escape: new RegExp("[" + k.keys(M.escape).join("") + "]", "g"),
- unescape: new RegExp("(" + k.keys(M.unescape).join("|") + ")", "g")
+ L.unescape = E.invert(L.escape);
+ var B = {
+ escape: new RegExp("[" + E.keys(L.escape).join("") + "]", "g"),
+ unescape: new RegExp("(" + E.keys(L.unescape).join("|") + ")", "g")
};
- k.each([ "escape", "unescape" ], function(e) {
- k[e] = function(t) {
- return null == t ? "" : ("" + t).replace(L[e], function(t) {
- return M[e][t];
+ E.each([ "escape", "unescape" ], function(e) {
+ E[e] = function(t) {
+ return null == t ? "" : ("" + t).replace(B[e], function(t) {
+ return L[e][t];
});
};
- }), k.result = function(e, t) {
+ }), E.result = function(e, t) {
if (null == e) return void 0;
var n = e[t];
- return k.isFunction(n) ? n.call(e) : n;
- }, k.mixin = function(e) {
- S(k.functions(e), function(t) {
- var n = k[t] = e[t];
- k.prototype[t] = function() {
+ return E.isFunction(n) ? n.call(e) : n;
+ }, E.mixin = function(e) {
+ A(E.functions(e), function(t) {
+ var n = E[t] = e[t];
+ E.prototype[t] = function() {
var e = [ this._wrapped ];
- return a.apply(e, arguments), D.call(this, n.apply(k, e));
+ return s.apply(e, arguments), N.call(this, n.apply(E, e));
};
});
};
- var $ = 0;
- k.uniqueId = function(e) {
- var t = ++$ + "";
+ var M = 0;
+ E.uniqueId = function(e) {
+ var t = ++M + "";
return e ? e + t : t;
- }, k.templateSettings = {
+ }, E.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
};
- var z = /(.)^/, R = {
+ var R = /(.)^/, I = {
"'": "'",
"\\": "\\",
"\r": "r",
@@ -3891,46 +4022,46 @@ function css_browser_selector(e) {
" ": "t",
"\u2028": "u2028",
"\u2029": "u2029"
- }, j = /\\|'|\r|\n|\t|\u2028|\u2029/g;
- k.template = function(e, t, n) {
+ }, P = /\\|'|\r|\n|\t|\u2028|\u2029/g;
+ E.template = function(e, t, n) {
var i;
- n = k.defaults({}, n, k.templateSettings);
- var o = new RegExp([ (n.escape || z).source, (n.interpolate || z).source, (n.evaluate || z).source ].join("|") + "|$", "g"), r = 0, a = "__p+='";
- e.replace(o, function(t, n, i, o, s) {
- return a += e.slice(r, s).replace(j, function(e) {
- return "\\" + R[e];
- }), n && (a += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'"), i && (a += "'+\n((__t=(" + i + "))==null?'':__t)+\n'"),
- o && (a += "';\n" + o + "\n__p+='"), r = s + t.length, t;
- }), a += "';\n", n.variable || (a = "with(obj||{}){\n" + a + "}\n"), a = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + a + "return __p;\n";
+ n = E.defaults({}, n, E.templateSettings);
+ var o = new RegExp([ (n.escape || R).source, (n.interpolate || R).source, (n.evaluate || R).source ].join("|") + "|$", "g"), r = 0, s = "__p+='";
+ e.replace(o, function(t, n, i, o, a) {
+ return s += e.slice(r, a).replace(P, function(e) {
+ return "\\" + I[e];
+ }), n && (s += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'"), i && (s += "'+\n((__t=(" + i + "))==null?'':__t)+\n'"),
+ o && (s += "';\n" + o + "\n__p+='"), r = a + t.length, t;
+ }), s += "';\n", n.variable || (s = "with(obj||{}){\n" + s + "}\n"), s = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + s + "return __p;\n";
try {
- i = new Function(n.variable || "obj", "_", a);
- } catch (s) {
- throw s.source = a, s;
+ i = new Function(n.variable || "obj", "_", s);
+ } catch (a) {
+ throw a.source = s, a;
}
- if (t) return i(t, k);
+ if (t) return i(t, E);
var l = function(e) {
- return i.call(this, e, k);
+ return i.call(this, e, E);
};
- return l.source = "function(" + (n.variable || "obj") + "){\n" + a + "}", l;
- }, k.chain = function(e) {
- return k(e).chain();
+ return l.source = "function(" + (n.variable || "obj") + "){\n" + s + "}", l;
+ }, E.chain = function(e) {
+ return E(e).chain();
};
- var D = function(e) {
- return this._chain ? k(e).chain() : e;
+ var N = function(e) {
+ return this._chain ? E(e).chain() : e;
};
- k.mixin(k), S([ "pop", "push", "reverse", "shift", "sort", "splice", "unshift" ], function(e) {
+ E.mixin(E), A([ "pop", "push", "reverse", "shift", "sort", "splice", "unshift" ], function(e) {
var t = i[e];
- k.prototype[e] = function() {
+ E.prototype[e] = function() {
var n = this._wrapped;
return t.apply(n, arguments), "shift" != e && "splice" != e || 0 !== n.length || delete n[0],
- D.call(this, n);
+ N.call(this, n);
};
- }), S([ "concat", "join", "slice" ], function(e) {
+ }), A([ "concat", "join", "slice" ], function(e) {
var t = i[e];
- k.prototype[e] = function() {
- return D.call(this, t.apply(this._wrapped, arguments));
+ E.prototype[e] = function() {
+ return N.call(this, t.apply(this._wrapped, arguments));
};
- }), k.extend(k.prototype, {
+ }), E.extend(E.prototype, {
chain: function() {
return this._chain = !0, this;
},
@@ -3947,14 +4078,14 @@ function css_browser_selector(e) {
"object" == typeof exports ? module.exports = t() : "function" == typeof define && define.amd ? define("crel", t) : e.crel = t();
}(this, function() {
function e() {
- var n, i = window.document, o = arguments, r = i.createElement(o[0]), a = o[1], s = 2, l = o.length, c = e.attrMap;
+ var n, i = window.document, o = arguments, r = i.createElement(o[0]), s = o[1], a = 2, l = o.length, c = e.attrMap;
if (1 === l) return r;
- if (("object" != typeof a || t(a)) && (--s, a = null), 1 === l - s && "string" == typeof o[s] && void 0 !== r.textContent) r.textContent = o[s]; else for (;l > s; ++s) n = o[s],
+ if (("object" != typeof s || t(s)) && (--a, s = null), 1 === l - a && "string" == typeof o[a] && void 0 !== r.textContent) r.textContent = o[a]; else for (;l > a; ++a) n = o[a],
null != n && (t(n) || (n = i.createTextNode(n)), r.appendChild(n));
- for (var u in a) if (c[u]) {
+ for (var u in s) if (c[u]) {
var d = e.attrMap[u];
- "function" == typeof d ? d(r, a[u]) : r.setAttribute(d, a[u]);
- } else r.setAttribute(u, a[u]);
+ "function" == typeof d ? d(r, s[u]) : r.setAttribute(d, s[u]);
+ } else r.setAttribute(u, s[u]);
return r;
}
var t = "object" == typeof Node ? function(e) {
@@ -3963,25 +4094,7083 @@ function css_browser_selector(e) {
return e && "object" == typeof e && "number" == typeof e.nodeType && "string" == typeof e.nodeName;
};
return e.attrMap = {}, e.isNode = t, e;
+}), define("ace/lib/regexp", [ "require", "exports", "module" ], function() {
+ function e(e) {
+ return (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.extended ? "x" : "") + (e.sticky ? "y" : "");
+ }
+ function t(e, t, n) {
+ if (Array.prototype.indexOf) return e.indexOf(t, n);
+ for (var i = n || 0; i < e.length; i++) if (e[i] === t) return i;
+ return -1;
+ }
+ var n = {
+ exec: RegExp.prototype.exec,
+ test: RegExp.prototype.test,
+ match: String.prototype.match,
+ replace: String.prototype.replace,
+ split: String.prototype.split
+ }, i = void 0 === n.exec.call(/()??/, "")[1], o = function() {
+ var e = /^/g;
+ return n.test.call(e, ""), !e.lastIndex;
+ }();
+ o && i || (RegExp.prototype.exec = function(r) {
+ var s, a, l = n.exec.apply(this, arguments);
+ if ("string" == typeof r && l) {
+ if (!i && l.length > 1 && t(l, "") > -1 && (a = RegExp(this.source, n.replace.call(e(this), "g", "")),
+ n.replace.call(r.slice(l.index), a, function() {
+ for (var e = 1; e < arguments.length - 2; e++) void 0 === arguments[e] && (l[e] = void 0);
+ })), this._xregexp && this._xregexp.captureNames) for (var c = 1; c < l.length; c++) s = this._xregexp.captureNames[c - 1],
+ s && (l[s] = l[c]);
+ !o && this.global && !l[0].length && this.lastIndex > l.index && this.lastIndex--;
+ }
+ return l;
+ }, o || (RegExp.prototype.test = function(e) {
+ var t = n.exec.call(this, e);
+ return t && this.global && !t[0].length && this.lastIndex > t.index && this.lastIndex--,
+ !!t;
+ }));
+}), define("ace/lib/es5-shim", [ "require", "exports", "module" ], function() {
+ function e() {}
+ function t(e) {
+ try {
+ return Object.defineProperty(e, "sentinel", {}), "sentinel" in e;
+ } catch (t) {}
+ }
+ function n(e) {
+ return e = +e, e !== e ? e = 0 : 0 !== e && e !== 1 / 0 && e !== -(1 / 0) && (e = (e > 0 || -1) * Math.floor(Math.abs(e))),
+ e;
+ }
+ Function.prototype.bind || (Function.prototype.bind = function(t) {
+ var n = this;
+ if ("function" != typeof n) throw new TypeError("Function.prototype.bind called on incompatible " + n);
+ var i = d.call(arguments, 1), o = function() {
+ if (this instanceof o) {
+ var e = n.apply(this, i.concat(d.call(arguments)));
+ return Object(e) === e ? e : this;
+ }
+ return n.apply(t, i.concat(d.call(arguments)));
+ };
+ return n.prototype && (e.prototype = n.prototype, o.prototype = new e(), e.prototype = null),
+ o;
+ });
+ var i, o, r, s, a, l = Function.prototype.call, c = Array.prototype, u = Object.prototype, d = c.slice, h = l.bind(u.toString), p = l.bind(u.hasOwnProperty);
+ if ((a = p(u, "__defineGetter__")) && (i = l.bind(u.__defineGetter__), o = l.bind(u.__defineSetter__),
+ r = l.bind(u.__lookupGetter__), s = l.bind(u.__lookupSetter__)), 2 != [ 1, 2 ].splice(0).length) if (function() {
+ function e(e) {
+ var t = new Array(e + 2);
+ return t[0] = t[1] = 0, t;
+ }
+ var t, n = [];
+ return n.splice.apply(n, e(20)), n.splice.apply(n, e(26)), t = n.length, n.splice(5, 0, "XXX"),
+ t + 1 == n.length, t + 1 == n.length ? !0 : void 0;
+ }()) {
+ var f = Array.prototype.splice;
+ Array.prototype.splice = function(e, t) {
+ return arguments.length ? f.apply(this, [ void 0 === e ? 0 : e, void 0 === t ? this.length - e : t ].concat(d.call(arguments, 2))) : [];
+ };
+ } else Array.prototype.splice = function(e, t) {
+ var n = this.length;
+ e > 0 ? e > n && (e = n) : void 0 == e ? e = 0 : 0 > e && (e = Math.max(n + e, 0)),
+ n > e + t || (t = n - e);
+ var i = this.slice(e, e + t), o = d.call(arguments, 2), r = o.length;
+ if (e === n) r && this.push.apply(this, o); else {
+ var s = Math.min(t, n - e), a = e + s, l = a + r - s, c = n - a, u = n - s;
+ if (a > l) for (var h = 0; c > h; ++h) this[l + h] = this[a + h]; else if (l > a) for (h = c; h--; ) this[l + h] = this[a + h];
+ if (r && e === u) this.length = u, this.push.apply(this, o); else for (this.length = u + r,
+ h = 0; r > h; ++h) this[e + h] = o[h];
+ }
+ return i;
+ };
+ Array.isArray || (Array.isArray = function(e) {
+ return "[object Array]" == h(e);
+ });
+ var g = Object("a"), m = "a" != g[0] || !(0 in g);
+ if (Array.prototype.forEach || (Array.prototype.forEach = function(e) {
+ var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = arguments[1], o = -1, r = n.length >>> 0;
+ if ("[object Function]" != h(e)) throw new TypeError();
+ for (;++o < r; ) o in n && e.call(i, n[o], o, t);
+ }), Array.prototype.map || (Array.prototype.map = function(e) {
+ var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0, o = Array(i), r = arguments[1];
+ if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
+ for (var s = 0; i > s; s++) s in n && (o[s] = e.call(r, n[s], s, t));
+ return o;
+ }), Array.prototype.filter || (Array.prototype.filter = function(e) {
+ var t, n = B(this), i = m && "[object String]" == h(this) ? this.split("") : n, o = i.length >>> 0, r = [], s = arguments[1];
+ if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
+ for (var a = 0; o > a; a++) a in i && (t = i[a], e.call(s, t, a, n) && r.push(t));
+ return r;
+ }), Array.prototype.every || (Array.prototype.every = function(e) {
+ var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0, o = arguments[1];
+ if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
+ for (var r = 0; i > r; r++) if (r in n && !e.call(o, n[r], r, t)) return !1;
+ return !0;
+ }), Array.prototype.some || (Array.prototype.some = function(e) {
+ var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0, o = arguments[1];
+ if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
+ for (var r = 0; i > r; r++) if (r in n && e.call(o, n[r], r, t)) return !0;
+ return !1;
+ }), Array.prototype.reduce || (Array.prototype.reduce = function(e) {
+ var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0;
+ if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
+ if (!i && 1 == arguments.length) throw new TypeError("reduce of empty array with no initial value");
+ var o, r = 0;
+ if (arguments.length >= 2) o = arguments[1]; else for (;;) {
+ if (r in n) {
+ o = n[r++];
+ break;
+ }
+ if (++r >= i) throw new TypeError("reduce of empty array with no initial value");
+ }
+ for (;i > r; r++) r in n && (o = e.call(void 0, o, n[r], r, t));
+ return o;
+ }), Array.prototype.reduceRight || (Array.prototype.reduceRight = function(e) {
+ var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0;
+ if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
+ if (!i && 1 == arguments.length) throw new TypeError("reduceRight of empty array with no initial value");
+ var o, r = i - 1;
+ if (arguments.length >= 2) o = arguments[1]; else for (;;) {
+ if (r in n) {
+ o = n[r--];
+ break;
+ }
+ if (--r < 0) throw new TypeError("reduceRight of empty array with no initial value");
+ }
+ do r in this && (o = e.call(void 0, o, n[r], r, t)); while (r--);
+ return o;
+ }), Array.prototype.indexOf && -1 == [ 0, 1 ].indexOf(1, 2) || (Array.prototype.indexOf = function(e) {
+ var t = m && "[object String]" == h(this) ? this.split("") : B(this), i = t.length >>> 0;
+ if (!i) return -1;
+ var o = 0;
+ for (arguments.length > 1 && (o = n(arguments[1])), o = o >= 0 ? o : Math.max(0, i + o); i > o; o++) if (o in t && t[o] === e) return o;
+ return -1;
+ }), Array.prototype.lastIndexOf && -1 == [ 0, 1 ].lastIndexOf(0, -3) || (Array.prototype.lastIndexOf = function(e) {
+ var t = m && "[object String]" == h(this) ? this.split("") : B(this), i = t.length >>> 0;
+ if (!i) return -1;
+ var o = i - 1;
+ for (arguments.length > 1 && (o = Math.min(o, n(arguments[1]))), o = o >= 0 ? o : i - Math.abs(o); o >= 0; o--) if (o in t && e === t[o]) return o;
+ return -1;
+ }), Object.getPrototypeOf || (Object.getPrototypeOf = function(e) {
+ return e.__proto__ || (e.constructor ? e.constructor.prototype : u);
+ }), !Object.getOwnPropertyDescriptor) {
+ var v = "Object.getOwnPropertyDescriptor called on a non-object: ";
+ Object.getOwnPropertyDescriptor = function(e, t) {
+ if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError(v + e);
+ if (p(e, t)) {
+ var n, i, o;
+ if (n = {
+ enumerable: !0,
+ configurable: !0
+ }, a) {
+ var l = e.__proto__;
+ e.__proto__ = u;
+ var i = r(e, t), o = s(e, t);
+ if (e.__proto__ = l, i || o) return i && (n.get = i), o && (n.set = o), n;
+ }
+ return n.value = e[t], n;
+ }
+ };
+ }
+ if (Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function(e) {
+ return Object.keys(e);
+ }), !Object.create) {
+ var b;
+ b = null === Object.prototype.__proto__ ? function() {
+ return {
+ __proto__: null
+ };
+ } : function() {
+ var e = {};
+ for (var t in e) e[t] = null;
+ return e.constructor = e.hasOwnProperty = e.propertyIsEnumerable = e.isPrototypeOf = e.toLocaleString = e.toString = e.valueOf = e.__proto__ = null,
+ e;
+ }, Object.create = function(e, t) {
+ var n;
+ if (null === e) n = b(); else {
+ if ("object" != typeof e) throw new TypeError("typeof prototype[" + typeof e + "] != 'object'");
+ var i = function() {};
+ i.prototype = e, n = new i(), n.__proto__ = e;
+ }
+ return void 0 !== t && Object.defineProperties(n, t), n;
+ };
+ }
+ if (Object.defineProperty) {
+ var y = t({}), w = "undefined" == typeof document || t(document.createElement("div"));
+ if (!y || !w) var C = Object.defineProperty;
+ }
+ if (!Object.defineProperty || C) {
+ var x = "Property description must be an object: ", E = "Object.defineProperty called on non-object: ", A = "getters & setters can not be defined on this javascript engine";
+ Object.defineProperty = function(e, t, n) {
+ if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError(E + e);
+ if ("object" != typeof n && "function" != typeof n || null === n) throw new TypeError(x + n);
+ if (C) try {
+ return C.call(Object, e, t, n);
+ } catch (l) {}
+ if (p(n, "value")) if (a && (r(e, t) || s(e, t))) {
+ var c = e.__proto__;
+ e.__proto__ = u, delete e[t], e[t] = n.value, e.__proto__ = c;
+ } else e[t] = n.value; else {
+ if (!a) throw new TypeError(A);
+ p(n, "get") && i(e, t, n.get), p(n, "set") && o(e, t, n.set);
+ }
+ return e;
+ };
+ }
+ Object.defineProperties || (Object.defineProperties = function(e, t) {
+ for (var n in t) p(t, n) && Object.defineProperty(e, n, t[n]);
+ return e;
+ }), Object.seal || (Object.seal = function(e) {
+ return e;
+ }), Object.freeze || (Object.freeze = function(e) {
+ return e;
+ });
+ try {
+ Object.freeze(function() {});
+ } catch (S) {
+ Object.freeze = function(e) {
+ return function(t) {
+ return "function" == typeof t ? t : e(t);
+ };
+ }(Object.freeze);
+ }
+ if (Object.preventExtensions || (Object.preventExtensions = function(e) {
+ return e;
+ }), Object.isSealed || (Object.isSealed = function() {
+ return !1;
+ }), Object.isFrozen || (Object.isFrozen = function() {
+ return !1;
+ }), Object.isExtensible || (Object.isExtensible = function(e) {
+ if (Object(e) === e) throw new TypeError();
+ for (var t = ""; p(e, t); ) t += "?";
+ e[t] = !0;
+ var n = p(e, t);
+ return delete e[t], n;
+ }), !Object.keys) {
+ var k = !0, F = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ], _ = F.length;
+ for (var $ in {
+ toString: null
+ }) k = !1;
+ Object.keys = function M(e) {
+ if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError("Object.keys called on a non-object");
+ var M = [];
+ for (var t in e) p(e, t) && M.push(t);
+ if (k) for (var n = 0, i = _; i > n; n++) {
+ var o = F[n];
+ p(e, o) && M.push(o);
+ }
+ return M;
+ };
+ }
+ Date.now || (Date.now = function() {
+ return new Date().getTime();
+ });
+ var D = " \n\f\r \u2028\u2029";
+ if (!String.prototype.trim || D.trim()) {
+ D = "[" + D + "]";
+ var T = new RegExp("^" + D + D + "*"), L = new RegExp(D + D + "*$");
+ String.prototype.trim = function() {
+ return String(this).replace(T, "").replace(L, "");
+ };
+ }
+ var B = function(e) {
+ if (null == e) throw new TypeError("can't convert " + e + " to object");
+ return Object(e);
+ };
+}), define("ace/lib/fixoldbrowsers", [ "require", "exports", "module", "./regexp", "./es5-shim" ], function(e) {
+ e("./regexp"), e("./es5-shim");
+}), define("ace/lib/dom", [ "require", "exports", "module" ], function(e, t) {
+ if ("undefined" != typeof document) {
+ var n = "http://www.w3.org/1999/xhtml";
+ t.getDocumentHead = function(e) {
+ return e || (e = document), e.head || e.getElementsByTagName("head")[0] || e.documentElement;
+ }, t.createElement = function(e, t) {
+ return document.createElementNS ? document.createElementNS(t || n, e) : document.createElement(e);
+ }, t.hasCssClass = function(e, t) {
+ var n = e.className.split(/\s+/g);
+ return -1 !== n.indexOf(t);
+ }, t.addCssClass = function(e, n) {
+ t.hasCssClass(e, n) || (e.className += " " + n);
+ }, t.removeCssClass = function(e, t) {
+ for (var n = e.className.split(/\s+/g); ;) {
+ var i = n.indexOf(t);
+ if (-1 == i) break;
+ n.splice(i, 1);
+ }
+ e.className = n.join(" ");
+ }, t.toggleCssClass = function(e, t) {
+ for (var n = e.className.split(/\s+/g), i = !0; ;) {
+ var o = n.indexOf(t);
+ if (-1 == o) break;
+ i = !1, n.splice(o, 1);
+ }
+ return i && n.push(t), e.className = n.join(" "), i;
+ }, t.setCssClass = function(e, n, i) {
+ i ? t.addCssClass(e, n) : t.removeCssClass(e, n);
+ }, t.hasCssString = function(e, t) {
+ var n, i = 0;
+ if (t = t || document, t.createStyleSheet && (n = t.styleSheets)) {
+ for (;i < n.length; ) if (n[i++].owningElement.id === e) return !0;
+ } else if (n = t.getElementsByTagName("style")) for (;i < n.length; ) if (n[i++].id === e) return !0;
+ return !1;
+ }, t.importCssString = function(e, i, o) {
+ if (o = o || document, i && t.hasCssString(i, o)) return null;
+ var r;
+ o.createStyleSheet ? (r = o.createStyleSheet(), r.cssText = e, i && (r.owningElement.id = i)) : (r = o.createElementNS ? o.createElementNS(n, "style") : o.createElement("style"),
+ r.appendChild(o.createTextNode(e)), i && (r.id = i), t.getDocumentHead(o).appendChild(r));
+ }, t.importCssStylsheet = function(e, n) {
+ if (n.createStyleSheet) n.createStyleSheet(e); else {
+ var i = t.createElement("link");
+ i.rel = "stylesheet", i.href = e, t.getDocumentHead(n).appendChild(i);
+ }
+ }, t.getInnerWidth = function(e) {
+ return parseInt(t.computedStyle(e, "paddingLeft"), 10) + parseInt(t.computedStyle(e, "paddingRight"), 10) + e.clientWidth;
+ }, t.getInnerHeight = function(e) {
+ return parseInt(t.computedStyle(e, "paddingTop"), 10) + parseInt(t.computedStyle(e, "paddingBottom"), 10) + e.clientHeight;
+ }, void 0 !== window.pageYOffset ? (t.getPageScrollTop = function() {
+ return window.pageYOffset;
+ }, t.getPageScrollLeft = function() {
+ return window.pageXOffset;
+ }) : (t.getPageScrollTop = function() {
+ return document.body.scrollTop;
+ }, t.getPageScrollLeft = function() {
+ return document.body.scrollLeft;
+ }), t.computedStyle = window.getComputedStyle ? function(e, t) {
+ return t ? (window.getComputedStyle(e, "") || {})[t] || "" : window.getComputedStyle(e, "") || {};
+ } : function(e, t) {
+ return t ? e.currentStyle[t] : e.currentStyle;
+ }, t.scrollbarWidth = function(e) {
+ var n = t.createElement("ace_inner");
+ n.style.width = "100%", n.style.minWidth = "0px", n.style.height = "200px", n.style.display = "block";
+ var i = t.createElement("ace_outer"), o = i.style;
+ o.position = "absolute", o.left = "-10000px", o.overflow = "hidden", o.width = "200px",
+ o.minWidth = "0px", o.height = "150px", o.display = "block", i.appendChild(n);
+ var r = e.documentElement;
+ r.appendChild(i);
+ var s = n.offsetWidth;
+ o.overflow = "scroll";
+ var a = n.offsetWidth;
+ return s == a && (a = i.clientWidth), r.removeChild(i), s - a;
+ }, t.setInnerHtml = function(e, t) {
+ var n = e.cloneNode(!1);
+ return n.innerHTML = t, e.parentNode.replaceChild(n, e), n;
+ }, "textContent" in document.documentElement ? (t.setInnerText = function(e, t) {
+ e.textContent = t;
+ }, t.getInnerText = function(e) {
+ return e.textContent;
+ }) : (t.setInnerText = function(e, t) {
+ e.innerText = t;
+ }, t.getInnerText = function(e) {
+ return e.innerText;
+ }), t.getParentWindow = function(e) {
+ return e.defaultView || e.parentWindow;
+ };
+ }
+}), define("ace/lib/oop", [ "require", "exports", "module" ], function(e, t) {
+ t.inherits = function() {
+ var e = function() {};
+ return function(t, n) {
+ e.prototype = n.prototype, t.super_ = n.prototype, t.prototype = new e(), t.prototype.constructor = t;
+ };
+ }(), t.mixin = function(e, t) {
+ for (var n in t) e[n] = t[n];
+ return e;
+ }, t.implement = function(e, n) {
+ t.mixin(e, n);
+ };
+}), define("ace/lib/keys", [ "require", "exports", "module", "./oop" ], function(e, t) {
+ var n = e("./oop"), i = function() {
+ var e = {
+ MODIFIER_KEYS: {
+ 16: "Shift",
+ 17: "Ctrl",
+ 18: "Alt",
+ 224: "Meta"
+ },
+ KEY_MODS: {
+ ctrl: 1,
+ alt: 2,
+ option: 2,
+ shift: 4,
+ meta: 8,
+ command: 8,
+ cmd: 8
+ },
+ FUNCTION_KEYS: {
+ 8: "Backspace",
+ 9: "Tab",
+ 13: "Return",
+ 19: "Pause",
+ 27: "Esc",
+ 32: "Space",
+ 33: "PageUp",
+ 34: "PageDown",
+ 35: "End",
+ 36: "Home",
+ 37: "Left",
+ 38: "Up",
+ 39: "Right",
+ 40: "Down",
+ 44: "Print",
+ 45: "Insert",
+ 46: "Delete",
+ 96: "Numpad0",
+ 97: "Numpad1",
+ 98: "Numpad2",
+ 99: "Numpad3",
+ 100: "Numpad4",
+ 101: "Numpad5",
+ 102: "Numpad6",
+ 103: "Numpad7",
+ 104: "Numpad8",
+ 105: "Numpad9",
+ 112: "F1",
+ 113: "F2",
+ 114: "F3",
+ 115: "F4",
+ 116: "F5",
+ 117: "F6",
+ 118: "F7",
+ 119: "F8",
+ 120: "F9",
+ 121: "F10",
+ 122: "F11",
+ 123: "F12",
+ 144: "Numlock",
+ 145: "Scrolllock"
+ },
+ PRINTABLE_KEYS: {
+ 32: " ",
+ 48: "0",
+ 49: "1",
+ 50: "2",
+ 51: "3",
+ 52: "4",
+ 53: "5",
+ 54: "6",
+ 55: "7",
+ 56: "8",
+ 57: "9",
+ 59: ";",
+ 61: "=",
+ 65: "a",
+ 66: "b",
+ 67: "c",
+ 68: "d",
+ 69: "e",
+ 70: "f",
+ 71: "g",
+ 72: "h",
+ 73: "i",
+ 74: "j",
+ 75: "k",
+ 76: "l",
+ 77: "m",
+ 78: "n",
+ 79: "o",
+ 80: "p",
+ 81: "q",
+ 82: "r",
+ 83: "s",
+ 84: "t",
+ 85: "u",
+ 86: "v",
+ 87: "w",
+ 88: "x",
+ 89: "y",
+ 90: "z",
+ 107: "+",
+ 109: "-",
+ 110: ".",
+ 188: ",",
+ 190: ".",
+ 191: "/",
+ 192: "`",
+ 219: "[",
+ 220: "\\",
+ 221: "]",
+ 222: "'"
+ }
+ };
+ for (var t in e.FUNCTION_KEYS) {
+ var i = e.FUNCTION_KEYS[t].toLowerCase();
+ e[i] = parseInt(t, 10);
+ }
+ return n.mixin(e, e.MODIFIER_KEYS), n.mixin(e, e.PRINTABLE_KEYS), n.mixin(e, e.FUNCTION_KEYS),
+ e.enter = e["return"], e.escape = e.esc, e.del = e["delete"], e[173] = "-", e;
+ }();
+ n.mixin(t, i), t.keyCodeToString = function(e) {
+ return (i[e] || String.fromCharCode(e)).toLowerCase();
+ };
+}), define("ace/lib/useragent", [ "require", "exports", "module" ], function(e, t) {
+ if (t.OS = {
+ LINUX: "LINUX",
+ MAC: "MAC",
+ WINDOWS: "WINDOWS"
+ }, t.getOS = function() {
+ return t.isMac ? t.OS.MAC : t.isLinux ? t.OS.LINUX : t.OS.WINDOWS;
+ }, "object" == typeof navigator) {
+ var n = (navigator.platform.match(/mac|win|linux/i) || [ "other" ])[0].toLowerCase(), i = navigator.userAgent;
+ t.isWin = "win" == n, t.isMac = "mac" == n, t.isLinux = "linux" == n, t.isIE = ("Microsoft Internet Explorer" == navigator.appName || navigator.appName.indexOf("MSAppHost") >= 0) && parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),
+ t.isOldIE = t.isIE && t.isIE < 9, t.isGecko = t.isMozilla = window.controllers && "Gecko" === window.navigator.product,
+ t.isOldGecko = t.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/) || [])[1], 10) < 4,
+ t.isOpera = window.opera && "[object Opera]" == Object.prototype.toString.call(window.opera),
+ t.isWebKit = parseFloat(i.split("WebKit/")[1]) || void 0, t.isChrome = parseFloat(i.split(" Chrome/")[1]) || void 0,
+ t.isAIR = i.indexOf("AdobeAIR") >= 0, t.isIPad = i.indexOf("iPad") >= 0, t.isTouchPad = i.indexOf("TouchPad") >= 0;
+ }
+}), define("ace/lib/event", [ "require", "exports", "module", "./keys", "./useragent", "./dom" ], function(e, t) {
+ function n(e, t, n) {
+ var s = 0;
+ if (s = !o.isOpera || "KeyboardEvent" in window || !o.isMac ? 0 | (t.ctrlKey ? 1 : 0) | (t.altKey ? 2 : 0) | (t.shiftKey ? 4 : 0) | (t.metaKey ? 8 : 0) : 0 | (t.metaKey ? 1 : 0) | (t.altKey ? 2 : 0) | (t.shiftKey ? 4 : 0) | (t.ctrlKey ? 8 : 0),
+ n in i.MODIFIER_KEYS) {
+ switch (i.MODIFIER_KEYS[n]) {
+ case "Alt":
+ s = 2;
+ break;
+
+ case "Shift":
+ s = 4;
+ break;
+
+ case "Ctrl":
+ s = 1;
+ break;
+
+ default:
+ s = 8;
+ }
+ n = 0;
+ }
+ return (!o.isMac && r[91] || r[92]) && (s |= 8), 8 & s && (91 == n || 93 == n) && (n = 0),
+ s || n in i.FUNCTION_KEYS || n in i.PRINTABLE_KEYS ? e(t, s, n) : !1;
+ }
+ var i = e("./keys"), o = e("./useragent");
+ e("./dom"), t.addListener = function(e, t, n) {
+ if (e.addEventListener) return e.addEventListener(t, n, !1);
+ if (e.attachEvent) {
+ var i = function() {
+ n(window.event);
+ };
+ n._wrapper = i, e.attachEvent("on" + t, i);
+ }
+ }, t.removeListener = function(e, t, n) {
+ return e.removeEventListener ? e.removeEventListener(t, n, !1) : (e.detachEvent && e.detachEvent("on" + t, n._wrapper || n),
+ void 0);
+ }, t.stopEvent = function(e) {
+ return t.stopPropagation(e), t.preventDefault(e), !1;
+ }, t.stopPropagation = function(e) {
+ e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0;
+ }, t.preventDefault = function(e) {
+ e.preventDefault ? e.preventDefault() : e.returnValue = !1;
+ }, t.getButton = function(e) {
+ return "dblclick" == e.type ? 0 : "contextmenu" == e.type || e.ctrlKey && o.isMac ? 2 : e.preventDefault ? e.button : {
+ 1: 0,
+ 2: 2,
+ 4: 1
+ }[e.button];
+ }, t.capture = document.documentElement.setCapture ? function(e, n, i) {
+ function o(s) {
+ n(s), r || (r = !0, i(s)), t.removeListener(e, "mousemove", n), t.removeListener(e, "mouseup", o),
+ t.removeListener(e, "losecapture", o), e.releaseCapture();
+ }
+ var r = !1;
+ t.addListener(e, "mousemove", n), t.addListener(e, "mouseup", o), t.addListener(e, "losecapture", o),
+ e.setCapture();
+ } : function(e, t, n) {
+ function i(e) {
+ t && t(e), n && n(e), document.removeEventListener("mousemove", t, !0), document.removeEventListener("mouseup", i, !0),
+ e.stopPropagation();
+ }
+ document.addEventListener("mousemove", t, !0), document.addEventListener("mouseup", i, !0);
+ }, t.addMouseWheelListener = function(e, n) {
+ var i = 8, o = function(e) {
+ void 0 !== e.wheelDelta ? void 0 !== e.wheelDeltaX ? (e.wheelX = -e.wheelDeltaX / i,
+ e.wheelY = -e.wheelDeltaY / i) : (e.wheelX = 0, e.wheelY = -e.wheelDelta / i) : e.axis && e.axis == e.HORIZONTAL_AXIS ? (e.wheelX = 5 * (e.detail || 0),
+ e.wheelY = 0) : (e.wheelX = 0, e.wheelY = 5 * (e.detail || 0)), n(e);
+ };
+ t.addListener(e, "DOMMouseScroll", o), t.addListener(e, "mousewheel", o);
+ }, t.addMultiMouseDownListener = function(e, n, i, r) {
+ var s, a, l, c = 0, u = {
+ 2: "dblclick",
+ 3: "tripleclick",
+ 4: "quadclick"
+ };
+ t.addListener(e, "mousedown", function(e) {
+ if (0 != t.getButton(e)) c = 0; else {
+ var o = Math.abs(e.clientX - s) > 5 || Math.abs(e.clientY - a) > 5;
+ (!l || o) && (c = 0), c += 1, l && clearTimeout(l), l = setTimeout(function() {
+ l = null;
+ }, n[c - 1] || 600);
+ }
+ if (1 == c && (s = e.clientX, a = e.clientY), i[r]("mousedown", e), c > 4) c = 0; else if (c > 1) return i[r](u[c], e);
+ }), o.isOldIE && t.addListener(e, "dblclick", function(e) {
+ c = 2, l && clearTimeout(l), l = setTimeout(function() {
+ l = null;
+ }, n[c - 1] || 600), i[r]("mousedown", e), i[r](u[c], e);
+ });
+ };
+ var r = Object.create(null);
+ if (t.addCommandKeyListener = function(e, i) {
+ var s = t.addListener;
+ if (o.isOldGecko || o.isOpera && !("KeyboardEvent" in window)) {
+ var a = null;
+ s(e, "keydown", function(e) {
+ a = e.keyCode;
+ }), s(e, "keypress", function(e) {
+ return n(i, e, a);
+ });
+ } else {
+ var l = null;
+ s(e, "keydown", function(e) {
+ r[e.keyCode] = !0;
+ var t = n(i, e, e.keyCode);
+ return l = e.defaultPrevented, t;
+ }), s(e, "keypress", function(e) {
+ l && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && (t.stopEvent(e), l = null);
+ }), s(e, "keyup", function(e) {
+ r[e.keyCode] = null;
+ }), s(e, "focus", function() {
+ r = Object.create(null);
+ });
+ }
+ }, window.postMessage && !o.isOldIE) {
+ var s = 1;
+ t.nextTick = function(e, n) {
+ n = n || window;
+ var i = "zero-timeout-message-" + s;
+ t.addListener(n, "message", function o(r) {
+ r.data == i && (t.stopPropagation(r), t.removeListener(n, "message", o), e());
+ }), n.postMessage(i, "*");
+ };
+ }
+ t.nextFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame,
+ t.nextFrame = t.nextFrame ? t.nextFrame.bind(window) : function(e) {
+ setTimeout(e, 17);
+ };
+}), define("ace/lib/lang", [ "require", "exports", "module" ], function(e, t) {
+ t.stringReverse = function(e) {
+ return e.split("").reverse().join("");
+ }, t.stringRepeat = function(e, t) {
+ for (var n = ""; t > 0; ) 1 & t && (n += e), (t >>= 1) && (e += e);
+ return n;
+ };
+ var n = /^\s\s*/, i = /\s\s*$/;
+ t.stringTrimLeft = function(e) {
+ return e.replace(n, "");
+ }, t.stringTrimRight = function(e) {
+ return e.replace(i, "");
+ }, t.copyObject = function(e) {
+ var t = {};
+ for (var n in e) t[n] = e[n];
+ return t;
+ }, t.copyArray = function(e) {
+ for (var t = [], n = 0, i = e.length; i > n; n++) t[n] = e[n] && "object" == typeof e[n] ? this.copyObject(e[n]) : e[n];
+ return t;
+ }, t.deepCopy = function(e) {
+ if ("object" != typeof e) return e;
+ var t = e.constructor();
+ for (var n in e) t[n] = "object" == typeof e[n] ? this.deepCopy(e[n]) : e[n];
+ return t;
+ }, t.arrayToMap = function(e) {
+ for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = 1;
+ return t;
+ }, t.createMap = function(e) {
+ var t = Object.create(null);
+ for (var n in e) t[n] = e[n];
+ return t;
+ }, t.arrayRemove = function(e, t) {
+ for (var n = 0; n <= e.length; n++) t === e[n] && e.splice(n, 1);
+ }, t.escapeRegExp = function(e) {
+ return e.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
+ }, t.escapeHTML = function(e) {
+ return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/ n ? {
+ cursor: e.start,
+ anchor: e.end
+ } : {
+ cursor: e.end,
+ anchor: e.start
+ };
+ }
+ var r = e("../lib/dom");
+ e("../lib/useragent");
+ var s = 0;
+ (function() {
+ this.onMouseDown = function(e) {
+ var t = e.inSelection(), n = e.getDocumentPosition();
+ this.mousedownEvent = e;
+ var i = this.editor, o = e.getButton();
+ if (0 !== o) {
+ var r = i.getSelectionRange(), s = r.isEmpty();
+ return s && (i.moveCursorToPosition(n), i.selection.clearSelection()), i.textInput.onContextMenu(e.domEvent),
+ void 0;
+ }
+ return !t || i.isFocused() || (i.focus(), !this.$focusTimout || this.$clickSelection || i.inMultiSelectMode) ? (!t || this.$clickSelection || e.getShiftKey() || i.inMultiSelectMode ? this.startSelect(n) : t && (this.mousedownEvent.time = new Date().getTime(),
+ this.setState("dragWait")), this.captureMouse(e), e.preventDefault()) : (this.setState("focusWait"),
+ this.captureMouse(e), e.preventDefault());
+ }, this.startSelect = function(e) {
+ e = e || this.editor.renderer.screenToTextCoordinates(this.x, this.y), this.mousedownEvent.getShiftKey() ? this.editor.selection.selectToPosition(e) : this.$clickSelection || (this.editor.moveCursorToPosition(e),
+ this.editor.selection.clearSelection()), this.setState("select");
+ }, this.select = function() {
+ var e, t = this.editor, n = t.renderer.screenToTextCoordinates(this.x, this.y);
+ if (this.$clickSelection) {
+ var i = this.$clickSelection.comparePoint(n);
+ if (-1 == i) e = this.$clickSelection.end; else if (1 == i) e = this.$clickSelection.start; else {
+ var r = o(this.$clickSelection, n);
+ n = r.cursor, e = r.anchor;
+ }
+ t.selection.setSelectionAnchor(e.row, e.column);
+ }
+ t.selection.selectToPosition(n), t.renderer.scrollCursorIntoView();
+ }, this.extendSelectionBy = function(e) {
+ var t, n = this.editor, i = n.renderer.screenToTextCoordinates(this.x, this.y), r = n.selection[e](i.row, i.column);
+ if (this.$clickSelection) {
+ var s = this.$clickSelection.comparePoint(r.start), a = this.$clickSelection.comparePoint(r.end);
+ if (-1 == s && 0 >= a) t = this.$clickSelection.end, (r.end.row != i.row || r.end.column != i.column) && (i = r.start); else if (1 == a && s >= 0) t = this.$clickSelection.start,
+ (r.start.row != i.row || r.start.column != i.column) && (i = r.end); else if (-1 == s && 1 == a) i = r.end,
+ t = r.start; else {
+ var l = o(this.$clickSelection, i);
+ i = l.cursor, t = l.anchor;
+ }
+ n.selection.setSelectionAnchor(t.row, t.column);
+ }
+ n.selection.selectToPosition(i), n.renderer.scrollCursorIntoView();
+ }, this.startDrag = function() {
+ var e = this.editor;
+ this.setState("drag"), this.dragRange = e.getSelectionRange();
+ var t = e.getSelectionStyle();
+ this.dragSelectionMarker = e.session.addMarker(this.dragRange, "ace_selection", t),
+ e.clearSelection(), r.addCssClass(e.container, "ace_dragging"), this.$dragKeybinding || (this.$dragKeybinding = {
+ handleKeyboard: function(e, t, n) {
+ return "esc" == n ? {
+ command: this.command
+ } : void 0;
+ },
+ command: {
+ exec: function(e) {
+ var t = e.$mouseHandler;
+ t.dragCursor = null, t.dragEnd(), t.startSelect();
+ }
+ }
+ }), e.keyBinding.addKeyboardHandler(this.$dragKeybinding);
+ }, this.focusWait = function() {
+ var e = i(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y), t = new Date().getTime();
+ (e > s || t - this.mousedownEvent.time > this.$focusTimout) && this.startSelect(this.mousedownEvent.getDocumentPosition());
+ }, this.dragWait = function() {
+ var e = i(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y), t = new Date().getTime(), n = this.editor;
+ e > s ? this.startSelect(this.mousedownEvent.getDocumentPosition()) : t - this.mousedownEvent.time > n.$mouseHandler.$dragDelay && this.startDrag();
+ }, this.dragWaitEnd = function(e) {
+ this.mousedownEvent.domEvent = e, this.startSelect();
+ }, this.drag = function() {
+ var e = this.editor;
+ this.dragCursor = e.renderer.screenToTextCoordinates(this.x, this.y), e.moveCursorToPosition(this.dragCursor),
+ e.renderer.scrollCursorIntoView();
+ }, this.dragEnd = function(e) {
+ var t = this.editor, n = this.dragCursor, i = this.dragRange;
+ if (r.removeCssClass(t.container, "ace_dragging"), t.session.removeMarker(this.dragSelectionMarker),
+ t.keyBinding.removeKeyboardHandler(this.$dragKeybinding), n) {
+ if (t.clearSelection(), e && (e.ctrlKey || e.altKey)) {
+ var o = t.session, s = i;
+ s.end = o.insert(n, o.getTextRange(i)), s.start = n;
+ } else {
+ if (i.contains(n.row, n.column)) return;
+ var s = t.moveText(i, n);
+ }
+ s && t.selection.setSelectionRange(s);
+ }
+ }, this.onDoubleClick = function(e) {
+ var t = e.getDocumentPosition(), n = this.editor, i = n.session, o = i.getBracketRange(t);
+ return o ? (o.isEmpty() && (o.start.column--, o.end.column++), this.$clickSelection = o,
+ this.setState("select"), void 0) : (this.$clickSelection = n.selection.getWordRange(t.row, t.column),
+ this.setState("selectByWords"), void 0);
+ }, this.onTripleClick = function(e) {
+ var t = e.getDocumentPosition(), n = this.editor;
+ this.setState("selectByLines"), this.$clickSelection = n.selection.getLineRange(t.row);
+ }, this.onQuadClick = function() {
+ var e = this.editor;
+ e.selectAll(), this.$clickSelection = e.getSelectionRange(), this.setState("null");
+ }, this.onMouseWheel = function(e) {
+ if (!e.getShiftKey() && !e.getAccelKey()) {
+ var t = e.domEvent.timeStamp, n = t - (this.$lastScrollTime || 0), i = this.editor, o = i.renderer.isScrollableBy(e.wheelX * e.speed, e.wheelY * e.speed);
+ return o || 200 > n ? (this.$lastScrollTime = t, i.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed),
+ e.stop()) : void 0;
+ }
+ };
+ }).call(n.prototype), t.DefaultHandlers = n;
+}), define("ace/mouse/default_gutter_handler", [ "require", "exports", "module", "../lib/dom", "../lib/event" ], function(e, t) {
+ function n(e) {
+ function t() {
+ d = i.createElement("div"), d.className = "ace_gutter-tooltip", d.style.display = "none",
+ a.container.appendChild(d);
+ }
+ function n() {
+ d || t();
+ var e = u.getDocumentPosition().row, n = l.$annotations[e];
+ if (!n) return r();
+ var i = a.session.getLength();
+ if (e == i) {
+ var o = a.renderer.pixelToScreenCoordinates(0, u.y).row, c = u.$pos;
+ if (o > a.session.documentToScreenRow(c.row, c.column)) return r();
+ }
+ h != n && (h = n.text.join(" "), d.style.display = "block", d.innerHTML = h,
+ a.on("mousewheel", r), s(u));
+ }
+ function r() {
+ c && (c = clearTimeout(c)), h && (d.style.display = "none", h = null, a.removeEventListener("mousewheel", r));
+ }
+ function s(e) {
+ var t = a.renderer.$gutter.getBoundingClientRect();
+ d.style.left = e.x + 15 + "px", e.y + 3 * a.renderer.lineHeight + 15 < t.bottom ? (d.style.bottom = "",
+ d.style.top = e.y + 15 + "px") : (d.style.top = "", d.style.bottom = t.bottom - e.y + 5 + "px");
+ }
+ var a = e.editor, l = a.renderer.$gutterLayer;
+ e.editor.setDefaultHandler("guttermousedown", function(t) {
+ if (a.isFocused()) {
+ var n = l.getRegion(t);
+ if ("foldWidgets" != n) {
+ var i = t.getDocumentPosition().row, o = a.session.selection;
+ if (t.getShiftKey()) o.selectTo(i, 0); else {
+ if (2 == t.domEvent.detail) return a.selectAll(), t.preventDefault();
+ e.$clickSelection = a.selection.getLineRange(i);
+ }
+ return e.captureMouse(t, "selectByLines"), t.preventDefault();
+ }
+ }
+ });
+ var c, u, d, h;
+ e.editor.setDefaultHandler("guttermousemove", function(t) {
+ var o = t.domEvent.target || t.domEvent.srcElement;
+ return i.hasCssClass(o, "ace_fold-widget") ? r() : (h && s(t), u = t, c || (c = setTimeout(function() {
+ c = null, u && !e.isMousePressed ? n() : r();
+ }, 50)), void 0);
+ }), o.addListener(a.renderer.$gutter, "mouseout", function() {
+ u = null, h && !c && (c = setTimeout(function() {
+ c = null, r();
+ }, 50));
+ });
+ }
+ var i = e("../lib/dom"), o = e("../lib/event");
+ t.GutterHandler = n;
+}), define("ace/mouse/mouse_event", [ "require", "exports", "module", "../lib/event", "../lib/useragent" ], function(e, t) {
+ var n = e("../lib/event"), i = e("../lib/useragent"), o = t.MouseEvent = function(e, t) {
+ 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;
+ };
+ (function() {
+ this.stopPropagation = function() {
+ n.stopPropagation(this.domEvent), this.propagationStopped = !0;
+ }, this.preventDefault = function() {
+ n.preventDefault(this.domEvent), this.defaultPrevented = !0;
+ }, this.stop = function() {
+ this.stopPropagation(), this.preventDefault();
+ }, this.getDocumentPosition = function() {
+ return this.$pos ? this.$pos : (this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY),
+ this.$pos);
+ }, this.inSelection = function() {
+ if (null !== this.$inSelection) return this.$inSelection;
+ var e = this.editor;
+ if (e.getReadOnly()) this.$inSelection = !1; else {
+ var t = e.getSelectionRange();
+ if (t.isEmpty()) this.$inSelection = !1; else {
+ var n = this.getDocumentPosition();
+ this.$inSelection = t.contains(n.row, n.column);
+ }
+ }
+ return this.$inSelection;
+ }, this.getButton = function() {
+ return n.getButton(this.domEvent);
+ }, this.getShiftKey = function() {
+ return this.domEvent.shiftKey;
+ }, this.getAccelKey = i.isMac ? function() {
+ return this.domEvent.metaKey;
+ } : function() {
+ return this.domEvent.ctrlKey;
+ };
+ }).call(o.prototype);
+}), define("ace/mouse/dragdrop", [ "require", "exports", "module", "../lib/event" ], function(e, t) {
+ var n = e("../lib/event"), i = function(e) {
+ function t() {
+ c = d.selection.toOrientedRange(), r = d.session.addMarker(c, "ace_selection", d.getSelectionStyle()),
+ d.clearSelection(), clearInterval(l), l = setInterval(f, 20), h = 0, n.addListener(document, "mousemove", o);
+ }
+ function i() {
+ clearInterval(l), d.session.removeMarker(r), r = null, d.selection.fromOrientedRange(c),
+ h = 0, n.removeListener(document, "mousemove", o);
+ }
+ function o() {
+ null == g && (g = setTimeout(function() {
+ null != g && r && i();
+ }, 20));
+ }
+ var r, s, a, l, c, u, d = e.editor, h = 0, p = d.container;
+ n.addListener(p, "dragenter", function(e) {
+ if (!d.getReadOnly()) {
+ var i = e.dataTransfer.types;
+ if (!i || -1 !== Array.prototype.indexOf.call(i, "text/plain")) return r || t(),
+ h++, n.preventDefault(e);
+ }
+ }), n.addListener(p, "dragover", function(e) {
+ if (!d.getReadOnly()) {
+ var t = e.dataTransfer.types;
+ if (!t || -1 !== Array.prototype.indexOf.call(t, "text/plain")) return null !== g && (g = null),
+ s = e.clientX, a = e.clientY, n.preventDefault(e);
+ }
+ });
+ var f = function() {
+ u = d.renderer.screenToTextCoordinates(s, a), d.moveCursorToPosition(u), d.renderer.scrollCursorIntoView();
+ };
+ n.addListener(p, "dragleave", function(e) {
+ return h--, 0 >= h && r ? (i(), n.preventDefault(e)) : void 0;
+ }), n.addListener(p, "drop", function(e) {
+ return r ? (c.end = d.session.insert(u, e.dataTransfer.getData("Text")), c.start = u,
+ i(), d.focus(), n.preventDefault(e)) : void 0;
+ });
+ var g = null;
+ };
+ t.DragdropHandler = i;
+}), define("ace/lib/net", [ "require", "exports", "module", "./dom" ], function(e, t) {
+ var n = e("./dom");
+ t.get = function(e, t) {
+ var n = new XMLHttpRequest();
+ n.open("GET", e, !0), n.onreadystatechange = function() {
+ 4 === n.readyState && t(n.responseText);
+ }, n.send(null);
+ }, t.loadScript = function(e, t) {
+ var i = n.getDocumentHead(), o = document.createElement("script");
+ o.src = e, i.appendChild(o), o.onload = o.onreadystatechange = function(e, n) {
+ (n || !o.readyState || "loaded" == o.readyState || "complete" == o.readyState) && (o = o.onload = o.onreadystatechange = null,
+ n || t());
+ };
+ };
+}), define("ace/lib/event_emitter", [ "require", "exports", "module" ], function(e, t) {
+ var n = {}, i = function() {
+ this.propagationStopped = !0;
+ }, o = function() {
+ this.defaultPrevented = !0;
+ };
+ n._emit = n._dispatchEvent = function(e, t) {
+ this._eventRegistry || (this._eventRegistry = {}), this._defaultHandlers || (this._defaultHandlers = {});
+ var n = this._eventRegistry[e] || [], r = this._defaultHandlers[e];
+ if (n.length || r) {
+ "object" == typeof t && t || (t = {}), t.type || (t.type = e), t.stopPropagation || (t.stopPropagation = i),
+ t.preventDefault || (t.preventDefault = o);
+ for (var s = 0; s < n.length && (n[s](t, this), !t.propagationStopped); s++) ;
+ return r && !t.defaultPrevented ? r(t, this) : void 0;
+ }
+ }, n._signal = function(e, t) {
+ var n = (this._eventRegistry || {})[e];
+ if (n) for (var i = 0; i < n.length; i++) n[i](t, this);
+ }, n.once = function(e, t) {
+ var n = this;
+ t && this.addEventListener(e, function i() {
+ n.removeEventListener(e, i), t.apply(null, arguments);
+ });
+ }, n.setDefaultHandler = function(e, t) {
+ var n = this._defaultHandlers;
+ if (n || (n = this._defaultHandlers = {
+ _disabled_: {}
+ }), n[e]) {
+ var i = n[e], o = n._disabled_[e];
+ o || (n._disabled_[e] = o = []), o.push(i);
+ var r = o.indexOf(t);
+ -1 != r && o.splice(r, 1);
+ }
+ n[e] = t;
+ }, n.removeDefaultHandler = function(e, t) {
+ var n = this._defaultHandlers;
+ if (n) {
+ var i = n._disabled_[e];
+ if (n[e] == t) n[e], i && this.setDefaultHandler(e, i.pop()); else if (i) {
+ var o = i.indexOf(t);
+ -1 != o && i.splice(o, 1);
+ }
+ }
+ }, n.on = n.addEventListener = function(e, t, n) {
+ this._eventRegistry = this._eventRegistry || {};
+ var i = this._eventRegistry[e];
+ return i || (i = this._eventRegistry[e] = []), -1 == i.indexOf(t) && i[n ? "unshift" : "push"](t),
+ t;
+ }, n.off = n.removeListener = n.removeEventListener = function(e, t) {
+ this._eventRegistry = this._eventRegistry || {};
+ var n = this._eventRegistry[e];
+ if (n) {
+ var i = n.indexOf(t);
+ -1 !== i && n.splice(i, 1);
+ }
+ }, n.removeAllListeners = function(e) {
+ this._eventRegistry && (this._eventRegistry[e] = []);
+ }, t.EventEmitter = n;
+}), define("ace/config", [ "require", "exports", "module", "./lib/lang", "./lib/oop", "./lib/net", "./lib/event_emitter" ], function(e, t, n) {
+ "no use strict";
+ function i(e) {
+ return e.replace(/-(.)/g, function(e, t) {
+ return t.toUpperCase();
+ });
+ }
+ var o = e("./lib/lang"), r = e("./lib/oop"), s = e("./lib/net"), a = e("./lib/event_emitter").EventEmitter, l = function() {
+ return this;
+ }(), c = {
+ packaged: !1,
+ workerPath: null,
+ modePath: null,
+ themePath: null,
+ basePath: "",
+ suffix: ".js",
+ $moduleUrls: {}
+ };
+ t.get = function(e) {
+ if (!c.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
+ return c[e];
+ }, t.set = function(e, t) {
+ if (!c.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
+ c[e] = t;
+ }, t.all = function() {
+ return o.copyObject(c);
+ }, r.implement(t, a), t.moduleUrl = function(e, t) {
+ if (c.$moduleUrls[e]) return c.$moduleUrls[e];
+ var n = e.split("/");
+ t = t || n[n.length - 2] || "";
+ var i = n[n.length - 1].replace(t, "").replace(/(^[\-_])|([\-_]$)/, "");
+ !i && n.length > 1 && (i = n[n.length - 2]);
+ var o = c[t + "Path"];
+ return null == o && (o = c.basePath), o && "/" != o.slice(-1) && (o += "/"), o + t + "-" + i + this.get("suffix");
+ }, t.setModuleUrl = function(e, t) {
+ return c.$moduleUrls[e] = t;
+ }, t.$loading = {}, t.loadModule = function(n, i) {
+ var o, r;
+ Array.isArray(n) && (r = n[0], n = n[1]);
+ try {
+ o = e(n);
+ } catch (a) {}
+ if (o && !t.$loading[n]) return i && i(o);
+ if (t.$loading[n] || (t.$loading[n] = []), t.$loading[n].push(i), !(t.$loading[n].length > 1)) {
+ var l = function() {
+ e([ n ], function(e) {
+ t._emit("load.module", {
+ name: n,
+ module: e
+ });
+ var i = t.$loading[n];
+ t.$loading[n] = null, i.forEach(function(t) {
+ t && t(e);
+ });
+ });
+ };
+ return t.get("packaged") ? (s.loadScript(t.moduleUrl(n, r), l), void 0) : l();
+ }
+ }, t.init = function() {
+ if (c.packaged = e.packaged || n.packaged || l.define && define.packaged, !l.document) return "";
+ for (var o = {}, r = "", s = document.getElementsByTagName("script"), a = 0; a < s.length; a++) {
+ var u = s[a], d = u.src || u.getAttribute("src");
+ if (d) {
+ for (var h = u.attributes, p = 0, f = h.length; f > p; p++) {
+ var g = h[p];
+ 0 === g.name.indexOf("data-ace-") && (o[i(g.name.replace(/^data-ace-/, ""))] = g.value);
+ }
+ var m = d.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);
+ m && (r = m[1]);
+ }
+ }
+ r && (o.base = o.base || r, o.packaged = !0), o.basePath = o.base, o.workerPath = o.workerPath || o.base,
+ o.modePath = o.modePath || o.base, o.themePath = o.themePath || o.base, delete o.base;
+ for (var v in o) "undefined" != typeof o[v] && t.set(v, o[v]);
+ };
+ var u = {
+ setOptions: function(e) {
+ Object.keys(e).forEach(function(t) {
+ this.setOption(t, e[t]);
+ }, this);
+ },
+ getOptions: function(e) {
+ var t = {};
+ return e ? Array.isArray(e) || (t = e, e = Object.keys(t)) : e = Object.keys(this.$options),
+ e.forEach(function(e) {
+ t[e] = this.getOption(e);
+ }, this), t;
+ },
+ setOption: function(e, t) {
+ if (this["$" + e] !== t) {
+ var n = this.$options[e];
+ if (!n) return void 0;
+ if (n.forwardTo) return this[n.forwardTo] && this[n.forwardTo].setOption(e, t);
+ n.handlesSet || (this["$" + e] = t), n && n.set && n.set.call(this, t);
+ }
+ },
+ getOption: function(e) {
+ var t = this.$options[e];
+ return t ? t.forwardTo ? this[t.forwardTo] && this[t.forwardTo].getOption(e) : t && t.get ? t.get.call(this) : this["$" + e] : void 0;
+ }
+ }, d = {};
+ t.defineOptions = function(e, t, n) {
+ return e.$options || (d[t] = e.$options = {}), Object.keys(n).forEach(function(t) {
+ var i = n[t];
+ "string" == typeof i && (i = {
+ forwardTo: i
+ }), i.name || (i.name = t), e.$options[i.name] = i, "initialValue" in i && (e["$" + i.name] = i.initialValue);
+ }), r.implement(e, u), this;
+ }, t.resetOptions = function(e) {
+ Object.keys(e.$options).forEach(function(t) {
+ var n = e.$options[t];
+ "value" in n && e.setOption(t, n.value);
+ });
+ }, t.setDefaultValue = function(e, n, i) {
+ var o = d[e] || (d[e] = {});
+ o[n] && (o.forwardTo ? t.setDefaultValue(o.forwardTo, n, i) : o[n].value = i);
+ }, t.setDefaultValues = function(e, n) {
+ Object.keys(n).forEach(function(i) {
+ t.setDefaultValue(e, i, n[i]);
+ });
+ };
+}), define("ace/mouse/mouse_handler", [ "require", "exports", "module", "../lib/event", "../lib/useragent", "./default_handlers", "./default_gutter_handler", "./mouse_event", "./dragdrop", "../config" ], function(e, t) {
+ var n = e("../lib/event"), i = e("../lib/useragent"), o = e("./default_handlers").DefaultHandlers, r = e("./default_gutter_handler").GutterHandler, s = e("./mouse_event").MouseEvent, a = e("./dragdrop").DragdropHandler, l = e("../config"), c = function(e) {
+ this.editor = e, new o(this), new r(this), new a(this), n.addListener(e.container, "mousedown", function(t) {
+ return e.focus(), n.preventDefault(t);
+ });
+ var t = e.renderer.getMouseEventTarget();
+ n.addListener(t, "click", this.onMouseEvent.bind(this, "click")), n.addListener(t, "mousemove", this.onMouseMove.bind(this, "mousemove")),
+ n.addMultiMouseDownListener(t, [ 300, 300, 250 ], this, "onMouseEvent"), n.addMouseWheelListener(e.container, this.onMouseWheel.bind(this, "mousewheel"));
+ var i = e.renderer.$gutter;
+ n.addListener(i, "mousedown", this.onMouseEvent.bind(this, "guttermousedown")),
+ n.addListener(i, "click", this.onMouseEvent.bind(this, "gutterclick")), n.addListener(i, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick")),
+ n.addListener(i, "mousemove", this.onMouseEvent.bind(this, "guttermousemove"));
+ };
+ (function() {
+ this.onMouseEvent = function(e, t) {
+ this.editor._emit(e, new s(t, this.editor));
+ }, this.onMouseMove = function(e, t) {
+ var n = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
+ n && n.length && this.editor._emit(e, new s(t, this.editor));
+ }, this.onMouseWheel = function(e, t) {
+ var n = new s(t, this.editor);
+ n.speed = 2 * this.$scrollSpeed, n.wheelX = t.wheelX, n.wheelY = t.wheelY, this.editor._emit(e, n);
+ }, this.setState = function(e) {
+ this.state = e;
+ }, this.captureMouse = function(e, t) {
+ t && this.setState(t), this.x = e.x, this.y = e.y, this.isMousePressed = !0;
+ var o = this.editor.renderer;
+ o.$keepTextAreaAtCursor && (o.$keepTextAreaAtCursor = null);
+ var r = this, s = function(e) {
+ r.x = e.clientX, r.y = e.clientY;
+ }, a = function(e) {
+ clearInterval(c), l(), r[r.state + "End"] && r[r.state + "End"](e), r.$clickSelection = null,
+ null == o.$keepTextAreaAtCursor && (o.$keepTextAreaAtCursor = !0, o.$moveTextAreaToCursor()),
+ r.isMousePressed = !1, r.onMouseEvent("mouseup", e);
+ }, l = function() {
+ r[r.state] && r[r.state]();
+ };
+ if (i.isOldIE && "dblclick" == e.domEvent.type) return setTimeout(function() {
+ a(e.domEvent);
+ });
+ n.capture(this.editor.container, s, a);
+ var c = setInterval(l, 20);
+ };
+ }).call(c.prototype), l.defineOptions(c.prototype, "mouseHandler", {
+ scrollSpeed: {
+ initialValue: 2
+ },
+ dragDelay: {
+ initialValue: 150
+ },
+ focusTimout: {
+ initialValue: 0
+ }
+ }), t.MouseHandler = c;
+}), define("ace/mouse/fold_handler", [ "require", "exports", "module" ], function(e, t) {
+ function n(e) {
+ e.on("click", function(t) {
+ var n = t.getDocumentPosition(), i = e.session, o = i.getFoldAt(n.row, n.column, 1);
+ o && (t.getAccelKey() ? i.removeFold(o) : i.expandFold(o), t.stop());
+ }), e.on("gutterclick", function(t) {
+ var n = e.renderer.$gutterLayer.getRegion(t);
+ if ("foldWidgets" == n) {
+ var i = t.getDocumentPosition().row, o = e.session;
+ o.foldWidgets && o.foldWidgets[i] && e.session.onFoldWidgetClick(i, t), e.isFocused() || e.focus(),
+ t.stop();
+ }
+ }), e.on("gutterdblclick", function(t) {
+ var n = e.renderer.$gutterLayer.getRegion(t);
+ if ("foldWidgets" == n) {
+ var i = t.getDocumentPosition().row, o = e.session, r = o.getParentFoldRangeData(i, !0), s = r.range || r.firstRange;
+ if (s) {
+ var i = s.start.row, a = o.getFoldAt(i, o.getLine(i).length, 1);
+ a ? o.removeFold(a) : (o.addFold("...", s), e.renderer.scrollCursorIntoView({
+ row: s.start.row,
+ column: 0
+ }));
+ }
+ t.stop();
+ }
+ });
+ }
+ t.FoldHandler = n;
+}), define("ace/keyboard/keybinding", [ "require", "exports", "module", "../lib/keys", "../lib/event" ], function(e, t) {
+ var n = e("../lib/keys"), i = e("../lib/event"), o = function(e) {
+ this.$editor = e, this.$data = {}, this.$handlers = [], this.setDefaultHandler(e.commands);
+ };
+ (function() {
+ this.setDefaultHandler = function(e) {
+ this.removeKeyboardHandler(this.$defaultHandler), this.$defaultHandler = e, this.addKeyboardHandler(e, 0),
+ this.$data = {
+ editor: this.$editor
+ };
+ }, this.setKeyboardHandler = function(e) {
+ var t = this.$handlers;
+ if (t[t.length - 1] != e) {
+ for (;t[t.length - 1] && t[t.length - 1] != this.$defaultHandler; ) this.removeKeyboardHandler(t[t.length - 1]);
+ this.addKeyboardHandler(e, 1);
+ }
+ }, this.addKeyboardHandler = function(e, t) {
+ if (e) {
+ var n = this.$handlers.indexOf(e);
+ -1 != n && this.$handlers.splice(n, 1), void 0 == t ? this.$handlers.push(e) : this.$handlers.splice(t, 0, e),
+ -1 == n && e.attach && e.attach(this.$editor);
+ }
+ }, this.removeKeyboardHandler = function(e) {
+ var t = this.$handlers.indexOf(e);
+ return -1 == t ? !1 : (this.$handlers.splice(t, 1), e.detach && e.detach(this.$editor),
+ !0);
+ }, this.getKeyboardHandler = function() {
+ return this.$handlers[this.$handlers.length - 1];
+ }, this.$callKeyboardHandlers = function(e, t, n, o) {
+ for (var r, s = !1, a = this.$editor.commands, l = this.$handlers.length; l-- && (r = this.$handlers[l].handleKeyboard(this.$data, e, t, n, o),
+ !(r && r.command && (s = "null" == r.command ? !0 : a.exec(r.command, this.$editor, r.args, o),
+ s && o && -1 != e && 1 != r.passEvent && i.stopEvent(o), s))); ) ;
+ return s;
+ }, this.onCommandKey = function(e, t, i) {
+ var o = n.keyCodeToString(i);
+ this.$callKeyboardHandlers(t, o, i, e);
+ }, this.onTextInput = function(e) {
+ var t = this.$callKeyboardHandlers(-1, e);
+ t || this.$editor.commands.exec("insertstring", this.$editor, e);
+ };
+ }).call(o.prototype), t.KeyBinding = o;
+}), define("ace/range", [ "require", "exports", "module" ], function(e, t) {
+ var n = function(e, t) {
+ return e.row - t.row || e.column - t.column;
+ }, i = function(e, t, n, i) {
+ this.start = {
+ row: e,
+ column: t
+ }, this.end = {
+ row: n,
+ column: i
+ };
+ };
+ (function() {
+ this.isEqual = function(e) {
+ 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;
+ }, this.toString = function() {
+ return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]";
+ }, this.contains = function(e, t) {
+ return 0 == this.compare(e, t);
+ }, this.compareRange = function(e) {
+ var t, n = e.end, i = e.start;
+ return t = this.compare(n.row, n.column), 1 == t ? (t = this.compare(i.row, i.column),
+ 1 == t ? 2 : 0 == t ? 1 : 0) : -1 == t ? -2 : (t = this.compare(i.row, i.column),
+ -1 == t ? -1 : 1 == t ? 42 : 0);
+ }, this.comparePoint = function(e) {
+ return this.compare(e.row, e.column);
+ }, this.containsRange = function(e) {
+ return 0 == this.comparePoint(e.start) && 0 == this.comparePoint(e.end);
+ }, this.intersects = function(e) {
+ var t = this.compareRange(e);
+ return -1 == t || 0 == t || 1 == t;
+ }, this.isEnd = function(e, t) {
+ return this.end.row == e && this.end.column == t;
+ }, this.isStart = function(e, t) {
+ return this.start.row == e && this.start.column == t;
+ }, this.setStart = function(e, t) {
+ "object" == typeof e ? (this.start.column = e.column, this.start.row = e.row) : (this.start.row = e,
+ this.start.column = t);
+ }, this.setEnd = function(e, t) {
+ "object" == typeof e ? (this.end.column = e.column, this.end.row = e.row) : (this.end.row = e,
+ this.end.column = t);
+ }, this.inside = function(e, t) {
+ return 0 == this.compare(e, t) ? this.isEnd(e, t) || this.isStart(e, t) ? !1 : !0 : !1;
+ }, this.insideStart = function(e, t) {
+ return 0 == this.compare(e, t) ? this.isEnd(e, t) ? !1 : !0 : !1;
+ }, this.insideEnd = function(e, t) {
+ return 0 == this.compare(e, t) ? this.isStart(e, t) ? !1 : !0 : !1;
+ }, this.compare = function(e, t) {
+ return this.isMultiLine() || e !== this.start.row ? 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 : t < this.start.column ? -1 : t > this.end.column ? 1 : 0;
+ }, this.compareStart = function(e, t) {
+ return this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
+ }, this.compareEnd = function(e, t) {
+ return this.end.row == e && this.end.column == t ? 1 : this.compare(e, t);
+ }, this.compareInside = function(e, t) {
+ return this.end.row == e && this.end.column == t ? 1 : this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
+ }, this.clipRows = function(e, t) {
+ if (this.end.row > t) var n = {
+ row: t + 1,
+ column: 0
+ }; else if (this.end.row < e) var n = {
+ row: e,
+ column: 0
+ };
+ if (this.start.row > t) var o = {
+ row: t + 1,
+ column: 0
+ }; else if (this.start.row < e) var o = {
+ row: e,
+ column: 0
+ };
+ return i.fromPoints(o || this.start, n || this.end);
+ }, this.extend = function(e, t) {
+ var n = this.compare(e, t);
+ if (0 == n) return this;
+ if (-1 == n) var o = {
+ row: e,
+ column: t
+ }; else var r = {
+ row: e,
+ column: t
+ };
+ return i.fromPoints(o || this.start, r || this.end);
+ }, this.isEmpty = function() {
+ return this.start.row === this.end.row && this.start.column === this.end.column;
+ }, this.isMultiLine = function() {
+ return this.start.row !== this.end.row;
+ }, this.clone = function() {
+ return i.fromPoints(this.start, this.end);
+ }, this.collapseRows = function() {
+ return 0 == this.end.column ? 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);
+ }, this.toScreenRange = function(e) {
+ var t = e.documentToScreenPosition(this.start), n = e.documentToScreenPosition(this.end);
+ return new i(t.row, t.column, n.row, n.column);
+ }, this.moveBy = function(e, t) {
+ this.start.row += e, this.start.column += t, this.end.row += e, this.end.column += t;
+ };
+ }).call(i.prototype), i.fromPoints = function(e, t) {
+ return new i(e.row, e.column, t.row, t.column);
+ }, i.comparePoints = n, i.comparePoints = function(e, t) {
+ return e.row - t.row || e.column - t.column;
+ }, t.Range = i;
+}), define("ace/selection", [ "require", "exports", "module", "./lib/oop", "./lib/lang", "./lib/event_emitter", "./range" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/lang"), o = e("./lib/event_emitter").EventEmitter, r = e("./range").Range, s = function(e) {
+ 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);
+ var t = this;
+ this.lead.on("change", function(e) {
+ t._emit("changeCursor"), t.$isEmpty || t._emit("changeSelection"), t.$keepDesiredColumnOnChange || e.old.column == e.value.column || (t.$desiredColumn = null);
+ }), this.selectionAnchor.on("change", function() {
+ t.$isEmpty || t._emit("changeSelection");
+ });
+ };
+ (function() {
+ n.implement(this, o), this.isEmpty = function() {
+ return this.$isEmpty || this.anchor.row == this.lead.row && this.anchor.column == this.lead.column;
+ }, this.isMultiLine = function() {
+ return this.isEmpty() ? !1 : this.getRange().isMultiLine();
+ }, this.getCursor = function() {
+ return this.lead.getPosition();
+ }, this.setSelectionAnchor = function(e, t) {
+ this.anchor.setPosition(e, t), this.$isEmpty && (this.$isEmpty = !1, this._emit("changeSelection"));
+ }, this.getSelectionAnchor = function() {
+ return this.$isEmpty ? this.getSelectionLead() : this.anchor.getPosition();
+ }, this.getSelectionLead = function() {
+ return this.lead.getPosition();
+ }, this.shiftSelection = function(e) {
+ if (this.$isEmpty) return this.moveCursorTo(this.lead.row, this.lead.column + e),
+ void 0;
+ var t = this.getSelectionAnchor(), n = this.getSelectionLead(), i = this.isBackwards();
+ i && 0 === t.column || this.setSelectionAnchor(t.row, t.column + e), (i || 0 !== n.column) && this.$moveSelection(function() {
+ this.moveCursorTo(n.row, n.column + e);
+ });
+ }, this.isBackwards = function() {
+ var e = this.anchor, t = this.lead;
+ return e.row > t.row || e.row == t.row && e.column > t.column;
+ }, this.getRange = function() {
+ var e = this.anchor, t = this.lead;
+ return this.isEmpty() ? r.fromPoints(t, t) : this.isBackwards() ? r.fromPoints(t, e) : r.fromPoints(e, t);
+ }, this.clearSelection = function() {
+ this.$isEmpty || (this.$isEmpty = !0, this._emit("changeSelection"));
+ }, this.selectAll = function() {
+ var e = this.doc.getLength() - 1;
+ this.setSelectionAnchor(0, 0), this.moveCursorTo(e, this.doc.getLine(e).length);
+ }, this.setRange = this.setSelectionRange = function(e, t) {
+ 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.$desiredColumn = null;
+ }, this.$moveSelection = function(e) {
+ var t = this.lead;
+ this.$isEmpty && this.setSelectionAnchor(t.row, t.column), e.call(this);
+ }, this.selectTo = function(e, t) {
+ this.$moveSelection(function() {
+ this.moveCursorTo(e, t);
+ });
+ }, this.selectToPosition = function(e) {
+ this.$moveSelection(function() {
+ this.moveCursorToPosition(e);
+ });
+ }, this.selectUp = function() {
+ this.$moveSelection(this.moveCursorUp);
+ }, this.selectDown = function() {
+ this.$moveSelection(this.moveCursorDown);
+ }, this.selectRight = function() {
+ this.$moveSelection(this.moveCursorRight);
+ }, this.selectLeft = function() {
+ this.$moveSelection(this.moveCursorLeft);
+ }, this.selectLineStart = function() {
+ this.$moveSelection(this.moveCursorLineStart);
+ }, this.selectLineEnd = function() {
+ this.$moveSelection(this.moveCursorLineEnd);
+ }, this.selectFileEnd = function() {
+ this.$moveSelection(this.moveCursorFileEnd);
+ }, this.selectFileStart = function() {
+ this.$moveSelection(this.moveCursorFileStart);
+ }, this.selectWordRight = function() {
+ this.$moveSelection(this.moveCursorWordRight);
+ }, this.selectWordLeft = function() {
+ this.$moveSelection(this.moveCursorWordLeft);
+ }, this.getWordRange = function(e, t) {
+ if ("undefined" == typeof t) {
+ var n = e || this.lead;
+ e = n.row, t = n.column;
+ }
+ return this.session.getWordRange(e, t);
+ }, this.selectWord = function() {
+ this.setSelectionRange(this.getWordRange());
+ }, this.selectAWord = function() {
+ var e = this.getCursor(), t = this.session.getAWordRange(e.row, e.column);
+ this.setSelectionRange(t);
+ }, this.getLineRange = function(e, t) {
+ var n, i = "number" == typeof e ? e : this.lead.row, o = this.session.getFoldLine(i);
+ return o ? (i = o.start.row, n = o.end.row) : n = i, t ? new r(i, 0, n, this.session.getLine(n).length) : new r(i, 0, n + 1, 0);
+ }, this.selectLine = function() {
+ this.setSelectionRange(this.getLineRange());
+ }, this.moveCursorUp = function() {
+ this.moveCursorBy(-1, 0);
+ }, this.moveCursorDown = function() {
+ this.moveCursorBy(1, 0);
+ }, this.moveCursorLeft = function() {
+ var e, t = this.lead.getPosition();
+ if (e = this.session.getFoldAt(t.row, t.column, -1)) this.moveCursorTo(e.start.row, e.start.column); else if (0 == t.column) t.row > 0 && this.moveCursorTo(t.row - 1, this.doc.getLine(t.row - 1).length); else {
+ var n = this.session.getTabSize();
+ this.session.isTabStop(t) && this.doc.getLine(t.row).slice(t.column - n, t.column).split(" ").length - 1 == n ? this.moveCursorBy(0, -n) : this.moveCursorBy(0, -1);
+ }
+ }, this.moveCursorRight = function() {
+ var e, t = this.lead.getPosition();
+ if (e = this.session.getFoldAt(t.row, t.column, 1)) this.moveCursorTo(e.end.row, e.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 {
+ var n = this.session.getTabSize(), t = this.lead;
+ this.session.isTabStop(t) && this.doc.getLine(t.row).slice(t.column, t.column + n).split(" ").length - 1 == n ? this.moveCursorBy(0, n) : this.moveCursorBy(0, 1);
+ }
+ }, this.moveCursorLineStart = function() {
+ var e = this.lead.row, t = this.lead.column, n = this.session.documentToScreenRow(e, t), i = this.session.screenToDocumentPosition(n, 0), o = this.session.getDisplayLine(e, null, i.row, i.column), r = o.match(/^\s*/);
+ r[0].length == t || this.session.$useEmacsStyleLineStart || (i.column += r[0].length),
+ this.moveCursorToPosition(i);
+ }, this.moveCursorLineEnd = function() {
+ var e = this.lead, t = this.session.getDocumentLastRowColumnPosition(e.row, e.column);
+ if (this.lead.column == t.column) {
+ var n = this.session.getLine(t.row);
+ if (t.column == n.length) {
+ var i = n.search(/\s+$/);
+ i > 0 && (t.column = i);
+ }
+ }
+ this.moveCursorTo(t.row, t.column);
+ }, this.moveCursorFileEnd = function() {
+ var e = this.doc.getLength() - 1, t = this.doc.getLine(e).length;
+ this.moveCursorTo(e, t);
+ }, this.moveCursorFileStart = function() {
+ this.moveCursorTo(0, 0);
+ }, this.moveCursorLongWordRight = function() {
+ var e, t = this.lead.row, n = this.lead.column, i = this.doc.getLine(t), o = i.substring(n);
+ this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0;
+ var r = this.session.getFoldAt(t, n, 1);
+ return r ? (this.moveCursorTo(r.end.row, r.end.column), void 0) : ((e = this.session.nonTokenRe.exec(o)) && (n += this.session.nonTokenRe.lastIndex,
+ this.session.nonTokenRe.lastIndex = 0, o = i.substring(n)), n >= i.length ? (this.moveCursorTo(t, i.length),
+ this.moveCursorRight(), t < this.doc.getLength() - 1 && this.moveCursorWordRight(),
+ void 0) : ((e = this.session.tokenRe.exec(o)) && (n += this.session.tokenRe.lastIndex,
+ this.session.tokenRe.lastIndex = 0), this.moveCursorTo(t, n), void 0));
+ }, this.moveCursorLongWordLeft = function() {
+ var e, t = this.lead.row, n = this.lead.column;
+ if (e = this.session.getFoldAt(t, n, -1)) return this.moveCursorTo(e.start.row, e.start.column),
+ void 0;
+ var o = this.session.getFoldStringAt(t, n, -1);
+ null == o && (o = this.doc.getLine(t).substring(0, n));
+ var r, s = i.stringReverse(o);
+ return this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0,
+ (r = this.session.nonTokenRe.exec(s)) && (n -= this.session.nonTokenRe.lastIndex,
+ s = s.slice(this.session.nonTokenRe.lastIndex), this.session.nonTokenRe.lastIndex = 0),
+ 0 >= n ? (this.moveCursorTo(t, 0), this.moveCursorLeft(), t > 0 && this.moveCursorWordLeft(),
+ void 0) : ((r = this.session.tokenRe.exec(s)) && (n -= this.session.tokenRe.lastIndex,
+ this.session.tokenRe.lastIndex = 0), this.moveCursorTo(t, n), void 0);
+ }, this.$shortWordEndIndex = function(e) {
+ var t, n, i = 0, o = /\s/, r = this.session.tokenRe;
+ if (r.lastIndex = 0, t = this.session.tokenRe.exec(e)) i = this.session.tokenRe.lastIndex; else {
+ for (;(n = e[i]) && o.test(n); ) i++;
+ if (1 >= i) for (r.lastIndex = 0; (n = e[i]) && !r.test(n); ) if (r.lastIndex = 0,
+ i++, o.test(n)) {
+ if (i > 2) {
+ i--;
+ break;
+ }
+ for (;(n = e[i]) && o.test(n); ) i++;
+ if (i > 2) break;
+ }
+ }
+ return r.lastIndex = 0, i;
+ }, this.moveCursorShortWordRight = function() {
+ var e = this.lead.row, t = this.lead.column, n = this.doc.getLine(e), i = n.substring(t), o = this.session.getFoldAt(e, t, 1);
+ if (o) return this.moveCursorTo(o.end.row, o.end.column);
+ if (t == n.length) {
+ var r = this.doc.getLength();
+ do e++, i = this.doc.getLine(e); while (r > e && /^\s*$/.test(i));
+ /^\s+/.test(i) || (i = ""), t = 0;
+ }
+ var s = this.$shortWordEndIndex(i);
+ this.moveCursorTo(e, t + s);
+ }, this.moveCursorShortWordLeft = function() {
+ var e, t = this.lead.row, n = this.lead.column;
+ if (e = this.session.getFoldAt(t, n, -1)) return this.moveCursorTo(e.start.row, e.start.column);
+ var o = this.session.getLine(t).substring(0, n);
+ if (0 == n) {
+ do t--, o = this.doc.getLine(t); while (t > 0 && /^\s*$/.test(o));
+ n = o.length, /\s+$/.test(o) || (o = "");
+ }
+ var r = i.stringReverse(o), s = this.$shortWordEndIndex(r);
+ return this.moveCursorTo(t, n - s);
+ }, this.moveCursorWordRight = function() {
+ this.session.$selectLongWords ? this.moveCursorLongWordRight() : this.moveCursorShortWordRight();
+ }, this.moveCursorWordLeft = function() {
+ this.session.$selectLongWords ? this.moveCursorLongWordLeft() : this.moveCursorShortWordLeft();
+ }, this.moveCursorBy = function(e, t) {
+ var n = this.session.documentToScreenPosition(this.lead.row, this.lead.column);
+ 0 === t && (this.$desiredColumn ? n.column = this.$desiredColumn : this.$desiredColumn = n.column);
+ var i = this.session.screenToDocumentPosition(n.row + e, n.column);
+ this.moveCursorTo(i.row, i.column + t, 0 === t);
+ }, this.moveCursorToPosition = function(e) {
+ this.moveCursorTo(e.row, e.column);
+ }, this.moveCursorTo = function(e, t, n) {
+ var i = this.session.getFoldAt(e, t, 1);
+ i && (e = i.start.row, t = i.start.column), this.$keepDesiredColumnOnChange = !0,
+ this.lead.setPosition(e, t), this.$keepDesiredColumnOnChange = !1, n || (this.$desiredColumn = null);
+ }, this.moveCursorToScreen = function(e, t, n) {
+ var i = this.session.screenToDocumentPosition(e, t);
+ this.moveCursorTo(i.row, i.column, n);
+ }, this.detach = function() {
+ this.lead.detach(), this.anchor.detach(), this.session = this.doc = null;
+ }, this.fromOrientedRange = function(e) {
+ this.setSelectionRange(e, e.cursor == e.start), this.$desiredColumn = e.desiredColumn || this.$desiredColumn;
+ }, this.toOrientedRange = function(e) {
+ var t = this.getRange();
+ 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;
+ };
+ }).call(s.prototype), t.Selection = s;
+}), define("ace/tokenizer", [ "require", "exports", "module" ], function(e, t) {
+ var n = 1e3, i = function(e) {
+ this.states = e, this.regExps = {}, this.matchMappings = {};
+ for (var t in this.states) {
+ for (var n = this.states[t], i = [], o = 0, r = this.matchMappings[t] = {
+ defaultToken: "text"
+ }, s = "g", a = [], l = 0; l < n.length; l++) {
+ var c = n[l];
+ if (c.defaultToken && (r.defaultToken = c.defaultToken), c.caseInsensitive && (s = "gi"),
+ null != c.regex) {
+ c.regex instanceof RegExp && (c.regex = c.regex.toString().slice(1, -1));
+ var u = c.regex, d = new RegExp("(?:(" + u + ")|(.))").exec("a").length - 2;
+ if (Array.isArray(c.token)) if (1 == c.token.length || 1 == d) c.token = c.token[0]; else {
+ if (d - 1 != c.token.length) throw new Error("number of classes and regexp groups in '" + c.token + "'\n'" + c.regex + "' doesn't match\n" + (d - 1) + "!=" + c.token.length);
+ c.tokenArray = c.token, c.token = null, c.onMatch = this.$arrayTokens;
+ } else "function" != typeof c.token || c.onMatch || (c.onMatch = d > 1 ? this.$applyToken : c.token);
+ d > 1 && (/\\\d/.test(c.regex) ? u = c.regex.replace(/\\([0-9]+)/g, function(e, t) {
+ return "\\" + (parseInt(t, 10) + o + 1);
+ }) : (d = 1, u = this.removeCapturingGroups(c.regex)), c.splitRegex || "string" == typeof c.token || a.push(c)),
+ r[o] = l, o += d, i.push(u), c.onMatch || (c.onMatch = null), c.__proto__ = null;
+ }
+ }
+ a.forEach(function(e) {
+ e.splitRegex = this.createSplitterRegexp(e.regex, s);
+ }, this), this.regExps[t] = new RegExp("(" + i.join(")|(") + ")|($)", s);
+ }
+ };
+ (function() {
+ this.$applyToken = function(e) {
+ var t = this.splitRegex.exec(e).slice(1), n = this.token.apply(this, t);
+ if ("string" == typeof n) return [ {
+ type: n,
+ value: e
+ } ];
+ for (var i = [], o = 0, r = n.length; r > o; o++) t[o] && (i[i.length] = {
+ type: n[o],
+ value: t[o]
+ });
+ return i;
+ }, this.$arrayTokens = function(e) {
+ if (!e) return [];
+ var t = this.splitRegex.exec(e);
+ if (!t) return "text";
+ for (var n = [], i = this.tokenArray, o = 0, r = i.length; r > o; o++) t[o + 1] && (n[n.length] = {
+ type: i[o],
+ value: t[o + 1]
+ });
+ return n;
+ }, this.removeCapturingGroups = function(e) {
+ var t = e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, function(e, t) {
+ return t ? "(?:" : e;
+ });
+ return t;
+ }, this.createSplitterRegexp = function(e, t) {
+ if (-1 != e.indexOf("(?=")) {
+ var n = 0, i = !1, o = {};
+ e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function(e, t, r, s, a, l) {
+ return i ? i = "]" != a : a ? i = !0 : s ? (n == o.stack && (o.end = l + 1, o.stack = -1),
+ n--) : r && (n++, 1 != r.length && (o.stack = n, o.start = l)), e;
+ }), null != o.end && /^\)*$/.test(e.substr(o.end)) && (e = e.substring(0, o.start) + e.substr(o.end));
+ }
+ return new RegExp(e, (t || "").replace("g", ""));
+ }, this.getLineTokens = function(e, t) {
+ if (t && "string" != typeof t) {
+ var i = t.slice(0);
+ t = i[0];
+ } else var i = [];
+ var o = t || "start", r = this.states[o], s = this.matchMappings[o], a = this.regExps[o];
+ a.lastIndex = 0;
+ for (var l, c = [], u = 0, d = {
+ type: null,
+ value: ""
+ }; l = a.exec(e); ) {
+ var h = s.defaultToken, p = null, f = l[0], g = a.lastIndex;
+ if (g - f.length > u) {
+ var m = e.substring(u, g - f.length);
+ d.type == h ? d.value += m : (d.type && c.push(d), d = {
+ type: h,
+ value: m
+ });
+ }
+ for (var v = 0; v < l.length - 2; v++) if (void 0 !== l[v + 1]) {
+ p = r[s[v]], h = p.onMatch ? p.onMatch(f, o, i) : p.token, p.next && (o = "string" == typeof p.next ? p.next : p.next(o, i),
+ r = this.states[o], r || (window.console && console.error && console.error(o, "doesn't exist"),
+ o = "start", r = this.states[o]), s = this.matchMappings[o], u = g, a = this.regExps[o],
+ a.lastIndex = g);
+ break;
+ }
+ if (f) if ("string" == typeof h) p && p.merge === !1 || d.type !== h ? (d.type && c.push(d),
+ d = {
+ type: h,
+ value: f
+ }) : d.value += f; else if (h) {
+ d.type && c.push(d), d = {
+ type: null,
+ value: ""
+ };
+ for (var v = 0; v < h.length; v++) c.push(h[v]);
+ }
+ if (u == e.length) break;
+ if (u = g, c.length > n) {
+ for (;u < e.length; ) d.type && c.push(d), d = {
+ value: e.substring(u, u += 2e3),
+ type: "overflow"
+ };
+ o = "start", i = [];
+ break;
+ }
+ }
+ return d.type && c.push(d), {
+ tokens: c,
+ state: i.length ? i : o
+ };
+ };
+ }).call(i.prototype), t.Tokenizer = i;
+}), define("ace/mode/text_highlight_rules", [ "require", "exports", "module", "../lib/lang" ], function(e, t) {
+ var n = e("../lib/lang"), i = function() {
+ this.$rules = {
+ start: [ {
+ token: "empty_line",
+ regex: "^$"
+ }, {
+ defaultToken: "text"
+ } ]
+ };
+ };
+ (function() {
+ this.addRules = function(e, t) {
+ for (var n in e) {
+ for (var i = e[n], o = 0; o < i.length; o++) {
+ var r = i[o];
+ r.next && ("string" != typeof r.next ? r.nextState = t + r.nextState : r.next = t + r.next);
+ }
+ this.$rules[t + n] = i;
+ }
+ }, this.getRules = function() {
+ return this.$rules;
+ }, this.embedRules = function(e, t, i, o, r) {
+ var s = new e().getRules();
+ if (o) for (var a = 0; a < o.length; a++) o[a] = t + o[a]; else {
+ o = [];
+ for (var l in s) o.push(t + l);
+ }
+ if (this.addRules(s, t), i) for (var c = Array.prototype[r ? "push" : "unshift"], a = 0; a < o.length; a++) c.apply(this.$rules[o[a]], n.deepCopy(i));
+ this.$embeds || (this.$embeds = []), this.$embeds.push(t);
+ }, this.getEmbeds = function() {
+ return this.$embeds;
+ };
+ var e = function(e, t) {
+ return "start" != e && t.unshift(this.nextState, e), this.nextState;
+ }, t = function(e, t) {
+ return t[0] !== e ? "start" : (t.shift(), t.shift());
+ };
+ this.normalizeRules = function() {
+ function n(r) {
+ var s = o[r];
+ s.processed = !0;
+ for (var a = 0; a < s.length; a++) {
+ var l = s[a];
+ !l.regex && l.start && (l.regex = l.start, l.next || (l.next = []), l.next.push({
+ defaultToken: l.token
+ }, {
+ token: l.token + ".end",
+ regex: l.end || l.start,
+ next: "pop"
+ }), l.token = l.token + ".start", l.push = !0);
+ var c = l.next || l.push;
+ if (c && Array.isArray(c)) {
+ var u = l.stateName;
+ u || (u = l.token, "string" != typeof u && (u = u[0] || ""), o[u] && (u += i++)),
+ o[u] = c, l.next = u, n(u);
+ } else "pop" == c && (l.next = t);
+ if (l.push && (l.nextState = l.next || l.push, l.next = e, delete l.push), l.rules) for (var d in l.rules) o[d] ? o[d].push && o[d].push.apply(o[d], l.rules[d]) : o[d] = l.rules[d];
+ if (l.include || "string" == typeof l) var h = l.include || l, p = o[h]; else Array.isArray(l) && (p = l);
+ if (p) {
+ var f = [ a, 1 ].concat(p);
+ l.noEscape && (f = f.filter(function(e) {
+ return !e.next;
+ })), s.splice.apply(s, f), a--, p = null;
+ }
+ l.keywordMap && (l.token = this.createKeywordMapper(l.keywordMap, l.defaultToken || "text", l.caseInsensitive),
+ delete l.defaultToken);
+ }
+ }
+ var i = 0, o = this.$rules;
+ Object.keys(o).forEach(n, this);
+ }, this.createKeywordMapper = function(e, t, n, i) {
+ var o = Object.create(null);
+ return Object.keys(e).forEach(function(t) {
+ var r = e[t];
+ n && (r = r.toLowerCase());
+ for (var s = r.split(i || "|"), a = s.length; a--; ) o[s[a]] = t;
+ }), e = null, n ? function(e) {
+ return o[e.toLowerCase()] || t;
+ } : function(e) {
+ return o[e] || t;
+ };
+ }, this.getKeywords = function() {
+ return this.$keywords;
+ };
+ }).call(i.prototype), t.TextHighlightRules = i;
+}), define("ace/mode/behaviour", [ "require", "exports", "module" ], function(e, t) {
+ var n = function() {
+ this.$behaviours = {};
+ };
+ (function() {
+ this.add = function(e, t, n) {
+ switch (void 0) {
+ case this.$behaviours:
+ this.$behaviours = {};
+
+ case this.$behaviours[e]:
+ this.$behaviours[e] = {};
+ }
+ this.$behaviours[e][t] = n;
+ }, this.addBehaviours = function(e) {
+ for (var t in e) for (var n in e[t]) this.add(t, n, e[t][n]);
+ }, this.remove = function(e) {
+ this.$behaviours && this.$behaviours[e] && delete this.$behaviours[e];
+ }, this.inherit = function(e, t) {
+ if ("function" == typeof e) var n = new e().getBehaviours(t); else var n = e.getBehaviours(t);
+ this.addBehaviours(n);
+ }, this.getBehaviours = function(e) {
+ if (e) {
+ for (var t = {}, n = 0; n < e.length; n++) this.$behaviours[e[n]] && (t[e[n]] = this.$behaviours[e[n]]);
+ return t;
+ }
+ return this.$behaviours;
+ };
+ }).call(n.prototype), t.Behaviour = n;
+}), define("ace/unicode", [ "require", "exports", "module" ], function(e, t) {
+ function n(e) {
+ var n = /\w{4}/g;
+ for (var i in e) t.packages[i] = e[i].replace(n, "\\u$&");
+ }
+ t.packages = {}, n({
+ 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",
+ 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",
+ 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",
+ Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
+ Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",
+ 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",
+ 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",
+ 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",
+ 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",
+ Me: "0488048906DE20DD-20E020E2-20E4A670-A672",
+ 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",
+ 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",
+ Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
+ No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",
+ 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",
+ Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",
+ Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
+ Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
+ Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
+ Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
+ Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
+ 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",
+ 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",
+ 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",
+ Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
+ Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",
+ 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",
+ Z: "002000A01680180E2000-200A20282029202F205F3000",
+ Zs: "002000A01680180E2000-200A202F205F3000",
+ Zl: "2028",
+ Zp: "2029",
+ 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",
+ Cc: "0000-001F007F-009F",
+ Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
+ Co: "E000-F8FF",
+ Cs: "D800-DFFF",
+ 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"
+ });
+}), define("ace/token_iterator", [ "require", "exports", "module" ], function(e, t) {
+ var n = function(e, t, n) {
+ this.$session = e, this.$row = t, this.$rowTokens = e.getTokens(t);
+ var i = e.getTokenAt(t, n);
+ this.$tokenIndex = i ? i.index : -1;
+ };
+ (function() {
+ this.stepBackward = function() {
+ for (this.$tokenIndex -= 1; this.$tokenIndex < 0; ) {
+ if (this.$row -= 1, this.$row < 0) return this.$row = 0, null;
+ this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = this.$rowTokens.length - 1;
+ }
+ return this.$rowTokens[this.$tokenIndex];
+ }, this.stepForward = function() {
+ this.$tokenIndex += 1;
+ for (var e; this.$tokenIndex >= this.$rowTokens.length; ) {
+ if (this.$row += 1, e || (e = this.$session.getLength()), this.$row >= e) return this.$row = e - 1,
+ null;
+ this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = 0;
+ }
+ return this.$rowTokens[this.$tokenIndex];
+ }, this.getCurrentToken = function() {
+ return this.$rowTokens[this.$tokenIndex];
+ }, this.getCurrentTokenRow = function() {
+ return this.$row;
+ }, this.getCurrentTokenColumn = function() {
+ var e = this.$rowTokens, t = this.$tokenIndex, n = e[t].start;
+ if (void 0 !== n) return n;
+ for (n = 0; t > 0; ) t -= 1, n += e[t].value.length;
+ return n;
+ };
+ }).call(n.prototype), t.TokenIterator = n;
+}), define("ace/mode/text", [ "require", "exports", "module", "../tokenizer", "./text_highlight_rules", "./behaviour", "../unicode", "../lib/lang", "../token_iterator", "../range" ], function(e, t) {
+ var n = e("../tokenizer").Tokenizer, i = e("./text_highlight_rules").TextHighlightRules, o = e("./behaviour").Behaviour, r = e("../unicode"), s = e("../lib/lang"), a = e("../token_iterator").TokenIterator, l = e("../range").Range, c = function() {
+ this.$tokenizer = new n(new i().getRules()), this.$behaviour = new o();
+ };
+ (function() {
+ this.tokenRe = new RegExp("^[" + r.packages.L + r.packages.Mn + r.packages.Mc + r.packages.Nd + r.packages.Pc + "\\$_]+", "g"),
+ this.nonTokenRe = new RegExp("^(?:[^" + r.packages.L + r.packages.Mn + r.packages.Mc + r.packages.Nd + r.packages.Pc + "\\$_]|s])+", "g"),
+ this.getTokenizer = function() {
+ return this.$tokenizer;
+ }, this.lineCommentStart = "", this.blockComment = "", this.toggleCommentLines = function(e, t, n, i) {
+ function o(e) {
+ for (var t = n; i >= t; t++) e(r.getLine(t), t);
+ }
+ var r = t.doc, a = !0, l = !0, c = 1/0, u = t.getTabSize(), d = !1;
+ if (this.lineCommentStart) {
+ if (Array.isArray(this.lineCommentStart)) var h = this.lineCommentStart.map(s.escapeRegExp).join("|"), p = this.lineCommentStart[0]; else var h = s.escapeRegExp(this.lineCommentStart), p = this.lineCommentStart;
+ h = new RegExp("^(\\s*)(?:" + h + ") ?"), d = t.getUseSoftTabs();
+ var f = function(e, t) {
+ var n = e.match(h);
+ if (n) {
+ var i = n[1].length, o = n[0].length;
+ b(e, i, o) || " " != n[0][o - 1] || o--, r.removeInLine(t, i, o);
+ }
+ }, g = p + " ", m = function(e, t) {
+ (!a || /\S/.test(e)) && (b(e, c, c) ? r.insertInLine({
+ row: t,
+ column: c
+ }, g) : r.insertInLine({
+ row: t,
+ column: c
+ }, p));
+ }, v = function(e) {
+ return h.test(e);
+ }, b = function(e, t, n) {
+ for (var i = 0; t-- && " " == e.charAt(t); ) i++;
+ if (0 != i % u) return !1;
+ for (var i = 0; " " == e.charAt(n++); ) i++;
+ return u > 2 ? i % u != u - 1 : 0 == i % u;
+ };
+ } else {
+ if (!this.blockComment) return !1;
+ var p = this.blockComment.start, y = this.blockComment.end, h = new RegExp("^(\\s*)(?:" + s.escapeRegExp(p) + ")"), w = new RegExp("(?:" + s.escapeRegExp(y) + ")\\s*$"), m = function(e, t) {
+ v(e, t) || (!a || /\S/.test(e)) && (r.insertInLine({
+ row: t,
+ column: e.length
+ }, y), r.insertInLine({
+ row: t,
+ column: c
+ }, p));
+ }, f = function(e, t) {
+ var n;
+ (n = e.match(w)) && r.removeInLine(t, e.length - n[0].length, e.length), (n = e.match(h)) && r.removeInLine(t, n[1].length, n[0].length);
+ }, v = function(e, n) {
+ if (h.test(e)) return !0;
+ for (var i = t.getTokens(n), o = 0; o < i.length; o++) if ("comment" === i[o].type) return !0;
+ };
+ }
+ var C = 1/0;
+ o(function(e, t) {
+ var n = e.search(/\S/);
+ -1 !== n ? (c > n && (c = n), l && !v(e, t) && (l = !1)) : C > e.length && (C = e.length);
+ }), 1/0 == c && (c = C, a = !1, l = !1), d && 0 != c % u && (c = Math.floor(c / u) * u),
+ o(l ? f : m);
+ }, this.toggleBlockComment = function(e, t, n, i) {
+ var o = this.blockComment;
+ if (o) {
+ !o.start && o[0] && (o = o[0]);
+ var r = new a(t, i.row, i.column), s = r.getCurrentToken();
+ t.selection;
+ var c, u, d = t.selection.toOrientedRange();
+ if (s && /comment/.test(s.type)) {
+ for (var h, p; s && /comment/.test(s.type); ) {
+ var f = s.value.indexOf(o.start);
+ if (-1 != f) {
+ var g = r.getCurrentTokenRow(), m = r.getCurrentTokenColumn() + f;
+ h = new l(g, m, g, m + o.start.length);
+ break;
+ }
+ s = r.stepBackward();
+ }
+ for (var r = new a(t, i.row, i.column), s = r.getCurrentToken(); s && /comment/.test(s.type); ) {
+ var f = s.value.indexOf(o.end);
+ if (-1 != f) {
+ var g = r.getCurrentTokenRow(), m = r.getCurrentTokenColumn() + f;
+ p = new l(g, m, g, m + o.end.length);
+ break;
+ }
+ s = r.stepForward();
+ }
+ p && t.remove(p), h && (t.remove(h), c = h.start.row, u = -o.start.length);
+ } else u = o.start.length, c = n.start.row, t.insert(n.end, o.end), t.insert(n.start, o.start);
+ d.start.row == c && (d.start.column += u), d.end.row == c && (d.end.column += u),
+ t.selection.fromOrientedRange(d);
+ }
+ }, this.getNextLineIndent = function(e, t) {
+ return this.$getIndent(t);
+ }, this.checkOutdent = function() {
+ return !1;
+ }, this.autoOutdent = function() {}, this.$getIndent = function(e) {
+ return e.match(/^\s*/)[0];
+ }, this.createWorker = function() {
+ return null;
+ }, this.createModeDelegates = function(e) {
+ if (this.$embeds) {
+ this.$modes = {};
+ for (var t = 0; t < this.$embeds.length; t++) e[this.$embeds[t]] && (this.$modes[this.$embeds[t]] = new e[this.$embeds[t]]());
+ for (var n = [ "toggleCommentLines", "getNextLineIndent", "checkOutdent", "autoOutdent", "transformAction" ], t = 0; t < n.length; t++) (function(e) {
+ var i = n[t], o = e[i];
+ e[n[t]] = function() {
+ return this.$delegator(i, arguments, o);
+ };
+ })(this);
+ }
+ }, this.$delegator = function(e, t, n) {
+ var i = t[0];
+ "string" != typeof i && (i = i[0]);
+ for (var o = 0; o < this.$embeds.length; o++) if (this.$modes[this.$embeds[o]]) {
+ var r = i.split(this.$embeds[o]);
+ if (!r[0] && r[1]) {
+ t[0] = r[1];
+ var s = this.$modes[this.$embeds[o]];
+ return s[e].apply(s, t);
+ }
+ }
+ var a = n.apply(this, t);
+ return n ? a : void 0;
+ }, this.transformAction = function(e, t) {
+ if (this.$behaviour) {
+ var n = this.$behaviour.getBehaviours();
+ for (var i in n) if (n[i][t]) {
+ var o = n[i][t].apply(this, arguments);
+ if (o) return o;
+ }
+ }
+ };
+ }).call(c.prototype), t.Mode = c;
+}), define("ace/anchor", [ "require", "exports", "module", "./lib/oop", "./lib/event_emitter" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/event_emitter").EventEmitter, o = t.Anchor = function(e, t, n) {
+ this.document = e, "undefined" == typeof n ? this.setPosition(t.row, t.column) : this.setPosition(t, n),
+ this.$onChange = this.onChange.bind(this), e.on("change", this.$onChange);
+ };
+ (function() {
+ n.implement(this, i), this.getPosition = function() {
+ return this.$clipPositionToDocument(this.row, this.column);
+ }, this.getDocument = function() {
+ return this.document;
+ }, this.onChange = function(e) {
+ var t = e.data, n = t.range;
+ if (!(n.start.row == n.end.row && n.start.row != this.row || n.start.row > this.row || n.start.row == this.row && n.start.column > this.column)) {
+ var i = this.row, o = this.column, r = n.start, s = n.end;
+ "insertText" === t.action ? r.row === i && r.column <= o ? r.row === s.row ? o += s.column - r.column : (o -= r.column,
+ i += s.row - r.row) : r.row !== s.row && r.row < i && (i += s.row - r.row) : "insertLines" === t.action ? r.row <= i && (i += s.row - r.row) : "removeText" === t.action ? r.row === i && r.column < o ? o = s.column >= o ? r.column : Math.max(0, o - (s.column - r.column)) : r.row !== s.row && r.row < i ? (s.row === i && (o = Math.max(0, o - s.column) + r.column),
+ i -= s.row - r.row) : s.row === i && (i -= s.row - r.row, o = Math.max(0, o - s.column) + r.column) : "removeLines" == t.action && r.row <= i && (s.row <= i ? i -= s.row - r.row : (i = r.row,
+ o = 0)), this.setPosition(i, o, !0);
+ }
+ }, this.setPosition = function(e, t, n) {
+ var i;
+ if (i = n ? {
+ row: e,
+ column: t
+ } : this.$clipPositionToDocument(e, t), this.row != i.row || this.column != i.column) {
+ var o = {
+ row: this.row,
+ column: this.column
+ };
+ this.row = i.row, this.column = i.column, this._emit("change", {
+ old: o,
+ value: i
+ });
+ }
+ }, this.detach = function() {
+ this.document.removeEventListener("change", this.$onChange);
+ }, this.$clipPositionToDocument = function(e, t) {
+ var n = {};
+ return e >= this.document.getLength() ? (n.row = Math.max(0, this.document.getLength() - 1),
+ n.column = this.document.getLine(n.row).length) : 0 > e ? (n.row = 0, n.column = 0) : (n.row = e,
+ n.column = Math.min(this.document.getLine(n.row).length, Math.max(0, t))), 0 > t && (n.column = 0),
+ n;
+ };
+ }).call(o.prototype);
+}), define("ace/document", [ "require", "exports", "module", "./lib/oop", "./lib/event_emitter", "./range", "./anchor" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/event_emitter").EventEmitter, o = e("./range").Range, r = e("./anchor").Anchor, s = function(e) {
+ this.$lines = [], 0 == e.length ? this.$lines = [ "" ] : Array.isArray(e) ? this._insertLines(0, e) : this.insert({
+ row: 0,
+ column: 0
+ }, e);
+ };
+ (function() {
+ n.implement(this, i), this.setValue = function(e) {
+ var t = this.getLength();
+ this.remove(new o(0, 0, t, this.getLine(t - 1).length)), this.insert({
+ row: 0,
+ column: 0
+ }, e);
+ }, this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ }, this.createAnchor = function(e, t) {
+ return new r(this, e, t);
+ }, this.$split = 0 == "aaa".split(/a/).length ? function(e) {
+ return e.replace(/\r\n|\r/g, "\n").split("\n");
+ } : function(e) {
+ return e.split(/\r\n|\r|\n/);
+ }, this.$detectNewLine = function(e) {
+ var t = e.match(/^.*?(\r\n|\r|\n)/m);
+ this.$autoNewLine = t ? t[1] : "\n";
+ }, this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ default:
+ return this.$autoNewLine;
+ }
+ }, this.$autoNewLine = "\n", this.$newLineMode = "auto", this.setNewLineMode = function(e) {
+ this.$newLineMode !== e && (this.$newLineMode = e);
+ }, this.getNewLineMode = function() {
+ return this.$newLineMode;
+ }, this.isNewLine = function(e) {
+ return "\r\n" == e || "\r" == e || "\n" == e;
+ }, this.getLine = function(e) {
+ return this.$lines[e] || "";
+ }, this.getLines = function(e, t) {
+ return this.$lines.slice(e, t + 1);
+ }, this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ }, this.getLength = function() {
+ return this.$lines.length;
+ }, this.getTextRange = function(e) {
+ if (e.start.row == e.end.row) return this.$lines[e.start.row].substring(e.start.column, e.end.column);
+ var t = this.getLines(e.start.row, e.end.row);
+ t[0] = (t[0] || "").substring(e.start.column);
+ var n = t.length - 1;
+ return e.end.row - e.start.row == n && (t[n] = t[n].substring(0, e.end.column)),
+ t.join(this.getNewLineCharacter());
+ }, this.$clipPosition = function(e) {
+ var t = this.getLength();
+ return e.row >= t ? (e.row = Math.max(0, t - 1), e.column = this.getLine(t - 1).length) : e.row < 0 && (e.row = 0),
+ e;
+ }, this.insert = function(e, t) {
+ if (!t || 0 === t.length) return e;
+ e = this.$clipPosition(e), this.getLength() <= 1 && this.$detectNewLine(t);
+ var n = this.$split(t), i = n.splice(0, 1)[0], o = 0 == n.length ? null : n.splice(n.length - 1, 1)[0];
+ return e = this.insertInLine(e, i), null !== o && (e = this.insertNewLine(e), e = this._insertLines(e.row, n),
+ e = this.insertInLine(e, o || "")), e;
+ }, this.insertLines = function(e, t) {
+ return e >= this.getLength() ? this.insert({
+ row: e,
+ column: 0
+ }, "\n" + t.join("\n")) : this._insertLines(Math.max(e, 0), t);
+ }, this._insertLines = function(e, t) {
+ if (0 == t.length) return {
+ row: e,
+ column: 0
+ };
+ if (t.length > 65535) {
+ var n = this._insertLines(e, t.slice(65535));
+ t = t.slice(0, 65535);
+ }
+ var i = [ e, 0 ];
+ i.push.apply(i, t), this.$lines.splice.apply(this.$lines, i);
+ var r = new o(e, 0, e + t.length, 0), s = {
+ action: "insertLines",
+ range: r,
+ lines: t
+ };
+ return this._emit("change", {
+ data: s
+ }), n || r.end;
+ }, this.insertNewLine = function(e) {
+ e = this.$clipPosition(e);
+ var t = this.$lines[e.row] || "";
+ this.$lines[e.row] = t.substring(0, e.column), this.$lines.splice(e.row + 1, 0, t.substring(e.column, t.length));
+ var n = {
+ row: e.row + 1,
+ column: 0
+ }, i = {
+ action: "insertText",
+ range: o.fromPoints(e, n),
+ text: this.getNewLineCharacter()
+ };
+ return this._emit("change", {
+ data: i
+ }), n;
+ }, this.insertInLine = function(e, t) {
+ if (0 == t.length) return e;
+ var n = this.$lines[e.row] || "";
+ this.$lines[e.row] = n.substring(0, e.column) + t + n.substring(e.column);
+ var i = {
+ row: e.row,
+ column: e.column + t.length
+ }, r = {
+ action: "insertText",
+ range: o.fromPoints(e, i),
+ text: t
+ };
+ return this._emit("change", {
+ data: r
+ }), i;
+ }, this.remove = function(e) {
+ if (e.start = this.$clipPosition(e.start), e.end = this.$clipPosition(e.end), e.isEmpty()) return e.start;
+ var t = e.start.row, n = e.end.row;
+ if (e.isMultiLine()) {
+ var i = 0 == e.start.column ? t : t + 1, o = n - 1;
+ e.end.column > 0 && this.removeInLine(n, 0, e.end.column), o >= i && this._removeLines(i, o),
+ i != t && (this.removeInLine(t, e.start.column, this.getLine(t).length), this.removeNewLine(e.start.row));
+ } else this.removeInLine(t, e.start.column, e.end.column);
+ return e.start;
+ }, this.removeInLine = function(e, t, n) {
+ if (t != n) {
+ var i = new o(e, t, e, n), r = this.getLine(e), s = r.substring(t, n), a = r.substring(0, t) + r.substring(n, r.length);
+ this.$lines.splice(e, 1, a);
+ var l = {
+ action: "removeText",
+ range: i,
+ text: s
+ };
+ return this._emit("change", {
+ data: l
+ }), i.start;
+ }
+ }, this.removeLines = function(e, t) {
+ return 0 > e || t >= this.getLength() ? this.remove(new o(e, 0, t + 1, 0)) : this._removeLines(e, t);
+ }, this._removeLines = function(e, t) {
+ var n = new o(e, 0, t + 1, 0), i = this.$lines.splice(e, t - e + 1), r = {
+ action: "removeLines",
+ range: n,
+ nl: this.getNewLineCharacter(),
+ lines: i
+ };
+ return this._emit("change", {
+ data: r
+ }), i;
+ }, this.removeNewLine = function(e) {
+ var t = this.getLine(e), n = this.getLine(e + 1), i = new o(e, t.length, e + 1, 0), r = t + n;
+ this.$lines.splice(e, 2, r);
+ var s = {
+ action: "removeText",
+ range: i,
+ text: this.getNewLineCharacter()
+ };
+ this._emit("change", {
+ data: s
+ });
+ }, this.replace = function(e, t) {
+ if (0 == t.length && e.isEmpty()) return e.start;
+ if (t == this.getTextRange(e)) return e.end;
+ if (this.remove(e), t) var n = this.insert(e.start, t); else n = e.start;
+ return n;
+ }, this.applyDeltas = function(e) {
+ for (var t = 0; t < e.length; t++) {
+ var n = e[t], i = o.fromPoints(n.range.start, n.range.end);
+ "insertLines" == n.action ? this.insertLines(i.start.row, n.lines) : "insertText" == n.action ? this.insert(i.start, n.text) : "removeLines" == n.action ? this._removeLines(i.start.row, i.end.row - 1) : "removeText" == n.action && this.remove(i);
+ }
+ }, this.revertDeltas = function(e) {
+ for (var t = e.length - 1; t >= 0; t--) {
+ var n = e[t], i = o.fromPoints(n.range.start, n.range.end);
+ "insertLines" == n.action ? this._removeLines(i.start.row, i.end.row - 1) : "insertText" == n.action ? this.remove(i) : "removeLines" == n.action ? this._insertLines(i.start.row, n.lines) : "removeText" == n.action && this.insert(i.start, n.text);
+ }
+ }, this.indexToPosition = function(e, t) {
+ for (var n = this.$lines || this.getAllLines(), i = this.getNewLineCharacter().length, o = t || 0, r = n.length; r > o; o++) if (e -= n[o].length + i,
+ 0 > e) return {
+ row: o,
+ column: e + n[o].length + i
+ };
+ return {
+ row: r - 1,
+ column: n[r - 1].length
+ };
+ }, this.positionToIndex = function(e, t) {
+ for (var n = this.$lines || this.getAllLines(), i = this.getNewLineCharacter().length, o = 0, r = Math.min(e.row, n.length), s = t || 0; r > s; ++s) o += n[s].length + i;
+ return o + e.column;
+ };
+ }).call(s.prototype), t.Document = s;
+}), define("ace/background_tokenizer", [ "require", "exports", "module", "./lib/oop", "./lib/event_emitter" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/event_emitter").EventEmitter, o = function(e) {
+ this.running = !1, this.lines = [], this.states = [], this.currentLine = 0, this.tokenizer = e;
+ var t = this;
+ this.$worker = function() {
+ if (t.running) {
+ for (var e = new Date(), n = t.currentLine, i = t.doc, o = 0, r = i.getLength(); t.currentLine < r; ) {
+ for (t.$tokenizeRow(t.currentLine); t.lines[t.currentLine]; ) t.currentLine++;
+ if (o++, 0 == o % 5 && new Date() - e > 20) return t.fireUpdateEvent(n, t.currentLine - 1),
+ t.running = setTimeout(t.$worker, 20), void 0;
+ }
+ t.running = !1, t.fireUpdateEvent(n, r - 1);
+ }
+ };
+ };
+ (function() {
+ n.implement(this, i), this.setTokenizer = function(e) {
+ this.tokenizer = e, this.lines = [], this.states = [], this.start(0);
+ }, this.setDocument = function(e) {
+ this.doc = e, this.lines = [], this.states = [], this.stop();
+ }, this.fireUpdateEvent = function(e, t) {
+ var n = {
+ first: e,
+ last: t
+ };
+ this._emit("update", {
+ data: n
+ });
+ }, this.start = function(e) {
+ 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);
+ }, this.$updateOnChange = function(e) {
+ var t = e.range, n = t.start.row, i = t.end.row - n;
+ if (0 === i) this.lines[n] = null; else if ("removeText" == e.action || "removeLines" == e.action) this.lines.splice(n, i + 1, null),
+ this.states.splice(n, i + 1, null); else {
+ var o = Array(i + 1);
+ o.unshift(n, 1), this.lines.splice.apply(this.lines, o), this.states.splice.apply(this.states, o);
+ }
+ this.currentLine = Math.min(n, this.currentLine, this.doc.getLength()), this.stop(),
+ this.running = setTimeout(this.$worker, 700);
+ }, this.stop = function() {
+ this.running && clearTimeout(this.running), this.running = !1;
+ }, this.getTokens = function(e) {
+ return this.lines[e] || this.$tokenizeRow(e);
+ }, this.getState = function(e) {
+ return this.currentLine == e && this.$tokenizeRow(e), this.states[e] || "start";
+ }, this.$tokenizeRow = function(e) {
+ var t = this.doc.getLine(e), n = this.states[e - 1], i = this.tokenizer.getLineTokens(t, n, e);
+ return this.states[e] + "" != i.state + "" ? (this.states[e] = i.state, this.lines[e + 1] = null,
+ this.currentLine > e + 1 && (this.currentLine = e + 1)) : this.currentLine == e && (this.currentLine = e + 1),
+ this.lines[e] = i.tokens;
+ };
+ }).call(o.prototype), t.BackgroundTokenizer = o;
+}), define("ace/search_highlight", [ "require", "exports", "module", "./lib/lang", "./lib/oop", "./range" ], function(e, t) {
+ var n = e("./lib/lang");
+ e("./lib/oop");
+ var i = e("./range").Range, o = function(e, t, n) {
+ this.setRegexp(e), this.clazz = t, this.type = n || "text";
+ };
+ (function() {
+ this.MAX_RANGES = 500, this.setRegexp = function(e) {
+ this.regExp + "" != e + "" && (this.regExp = e, this.cache = []);
+ }, this.update = function(e, t, o, r) {
+ if (this.regExp) for (var s = r.firstRow, a = r.lastRow, l = s; a >= l; l++) {
+ var c = this.cache[l];
+ null == c && (c = n.getMatchOffsets(o.getLine(l), this.regExp), c.length > this.MAX_RANGES && (c = c.slice(0, this.MAX_RANGES)),
+ c = c.map(function(e) {
+ return new i(l, e.offset, l, e.offset + e.length);
+ }), this.cache[l] = c.length ? c : "");
+ for (var u = c.length; u--; ) t.drawSingleLineMarker(e, c[u].toScreenRange(o), this.clazz, r);
+ }
+ };
+ }).call(o.prototype), t.SearchHighlight = o;
+}), define("ace/edit_session/fold_line", [ "require", "exports", "module", "../range" ], function(e, t) {
+ function n(e, t) {
+ this.foldData = e, Array.isArray(t) ? this.folds = t : t = this.folds = [ t ];
+ var n = t[t.length - 1];
+ this.range = new i(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) {
+ e.setFoldLine(this);
+ }, this);
+ }
+ var i = e("../range").Range;
+ (function() {
+ this.shiftRow = function(e) {
+ this.start.row += e, this.end.row += e, this.folds.forEach(function(t) {
+ t.start.row += e, t.end.row += e;
+ });
+ }, this.addFold = function(e) {
+ if (e.sameRow) {
+ if (e.start.row < this.startRow || e.endRow > this.endRow) throw "Can't add a fold to this FoldLine as it has no connection";
+ this.folds.push(e), this.folds.sort(function(e, t) {
+ return -e.range.compareEnd(t.start.row, t.start.column);
+ }), 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);
+ } 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 {
+ if (e.end.row != this.start.row) throw "Trying to add fold to FoldRow that doesn't have a matching row";
+ this.folds.unshift(e), this.start.row = e.start.row, this.start.column = e.start.column;
+ }
+ e.foldLine = this;
+ }, this.containsRow = function(e) {
+ return e >= this.start.row && e <= this.end.row;
+ }, this.walk = function(e, t, n) {
+ var i, o, r, s = 0, a = this.folds, l = !0;
+ null == t && (t = this.end.row, n = this.end.column);
+ for (var c = 0; c < a.length; c++) {
+ if (i = a[c], o = i.range.compareStart(t, n), -1 == o) return e(null, t, n, s, l),
+ void 0;
+ if (r = e(null, i.start.row, i.start.column, s, l), r = !r && e(i.placeholder, i.start.row, i.start.column, s),
+ r || 0 == o) return;
+ l = !i.sameRow, s = i.end.column;
+ }
+ e(null, t, n, s, l);
+ }, this.getNextFoldTo = function(e, t) {
+ for (var n, i, o = 0; o < this.folds.length; o++) {
+ if (n = this.folds[o], i = n.range.compareEnd(e, t), -1 == i) return {
+ fold: n,
+ kind: "after"
+ };
+ if (0 == i) return {
+ fold: n,
+ kind: "inside"
+ };
+ }
+ return null;
+ }, this.addRemoveChars = function(e, t, n) {
+ var i, o, r = this.getNextFoldTo(e, t);
+ if (r) if (i = r.fold, "inside" == r.kind && i.start.column != t && i.start.row != e) window.console && window.console.log(e, t, i); else if (i.start.row == e) {
+ o = this.folds;
+ var s = o.indexOf(i);
+ for (0 == s && (this.start.column += n), s; s < o.length; s++) {
+ if (i = o[s], i.start.column += n, !i.sameRow) return;
+ i.end.column += n;
+ }
+ this.end.column += n;
+ }
+ }, this.split = function(e, t) {
+ var i = this.getNextFoldTo(e, t).fold, o = this.folds, r = this.foldData;
+ if (!i) return null;
+ var s = o.indexOf(i), a = o[s - 1];
+ this.end.row = a.end.row, this.end.column = a.end.column, o = o.splice(s, o.length - s);
+ var l = new n(r, o);
+ return r.splice(r.indexOf(this) + 1, 0, l), l;
+ }, this.merge = function(e) {
+ for (var t = e.folds, n = 0; n < t.length; n++) this.addFold(t[n]);
+ var i = this.foldData;
+ i.splice(i.indexOf(e), 1);
+ }, this.toString = function() {
+ var e = [ this.range.toString() + ": [" ];
+ return this.folds.forEach(function(t) {
+ e.push(" " + t.toString());
+ }), e.push("]"), e.join("\n");
+ }, this.idxToPosition = function(e) {
+ for (var t, n = 0, i = 0; i < this.folds.length; i++) {
+ var t = this.folds[i];
+ if (e -= t.start.column - n, 0 > e) return {
+ row: t.start.row,
+ column: t.start.column + e
+ };
+ if (e -= t.placeholder.length, 0 > e) return t.start;
+ n = t.end.column;
+ }
+ return {
+ row: this.end.row,
+ column: this.end.column + e
+ };
+ };
+ }).call(n.prototype), t.FoldLine = n;
+}), define("ace/range_list", [ "require", "exports", "module", "./range" ], function(e, t) {
+ var n = e("./range").Range, i = n.comparePoints, o = function() {
+ this.ranges = [];
+ };
+ (function() {
+ this.comparePoints = i, this.pointIndex = function(e, t, n) {
+ for (var o = this.ranges, r = n || 0; r < o.length; r++) {
+ var s = o[r], a = i(e, s.end);
+ if (!(a > 0)) {
+ var l = i(e, s.start);
+ return 0 === a ? t && 0 !== l ? -r - 2 : r : l > 0 || 0 === l && !t ? r : -r - 1;
+ }
+ }
+ return -r - 1;
+ }, this.add = function(e) {
+ var t = !e.isEmpty(), n = this.pointIndex(e.start, t);
+ 0 > n && (n = -n - 1);
+ var i = this.pointIndex(e.end, t, n);
+ return 0 > i ? i = -i - 1 : i++, this.ranges.splice(n, i - n, e);
+ }, this.addList = function(e) {
+ for (var t = [], n = e.length; n--; ) t.push.call(t, this.add(e[n]));
+ return t;
+ }, this.substractPoint = function(e) {
+ var t = this.pointIndex(e);
+ return t >= 0 ? this.ranges.splice(t, 1) : void 0;
+ }, this.merge = function() {
+ var e = [], t = this.ranges;
+ t = t.sort(function(e, t) {
+ return i(e.start, t.start);
+ });
+ for (var n, o = t[0], r = 1; r < t.length; r++) {
+ n = o, o = t[r];
+ var s = i(n.end, o.start);
+ 0 > s || (0 != s || n.isEmpty() || o.isEmpty()) && (i(n.end, o.end) < 0 && (n.end.row = o.end.row,
+ n.end.column = o.end.column), t.splice(r, 1), e.push(o), o = n, r--);
+ }
+ return this.ranges = t, e;
+ }, this.contains = function(e, t) {
+ return this.pointIndex({
+ row: e,
+ column: t
+ }) >= 0;
+ }, this.containsPoint = function(e) {
+ return this.pointIndex(e) >= 0;
+ }, this.rangeAtPoint = function(e) {
+ var t = this.pointIndex(e);
+ return t >= 0 ? this.ranges[t] : void 0;
+ }, this.clipRows = function(e, t) {
+ var n = this.ranges;
+ if (n[0].start.row > t || n[n.length - 1].start.row < e) return [];
+ var i = this.pointIndex({
+ row: e,
+ column: 0
+ });
+ 0 > i && (i = -i - 1);
+ var o = this.pointIndex({
+ row: t,
+ column: 0
+ }, i);
+ 0 > o && (o = -o - 1);
+ for (var r = [], s = i; o > s; s++) r.push(n[s]);
+ return r;
+ }, this.removeAll = function() {
+ return this.ranges.splice(0, this.ranges.length);
+ }, this.attach = function(e) {
+ this.session && this.detach(), this.session = e, this.onChange = this.$onChange.bind(this),
+ this.session.on("change", this.onChange);
+ }, this.detach = function() {
+ this.session && (this.session.removeListener("change", this.onChange), this.session = null);
+ }, this.$onChange = function(e) {
+ var t = e.data.range;
+ if ("i" == e.data.action[0]) var n = t.start, i = t.end; else var i = t.start, n = t.end;
+ for (var o = n.row, r = i.row, s = r - o, a = -n.column + i.column, l = this.ranges, c = 0, u = l.length; u > c; c++) {
+ var d = l[c];
+ if (!(d.end.row < o)) {
+ if (d.start.row > o) break;
+ d.start.row == o && d.start.column >= n.column && (d.start.column += a, d.start.row += s),
+ d.end.row == o && d.end.column >= n.column && (d.end.column == n.column && a > 0 && u - 1 > c && d.end.column > d.start.column && d.end.column == l[c + 1].start.column && (d.end.column -= a),
+ d.end.column += a, d.end.row += s);
+ }
+ }
+ if (0 != s && u > c) for (;u > c; c++) {
+ var d = l[c];
+ d.start.row += s, d.end.row += s;
+ }
+ };
+ }).call(o.prototype), t.RangeList = o;
+}), define("ace/edit_session/fold", [ "require", "exports", "module", "../range", "../range_list", "../lib/oop" ], function(e, t) {
+ function n(e, t) {
+ e.row -= t.row, 0 == e.row && (e.column -= t.column);
+ }
+ function i(e, t) {
+ n(e.start, t), n(e.end, t);
+ }
+ function o(e, t) {
+ 0 == e.row && (e.column += t.column), e.row += t.row;
+ }
+ function r(e, t) {
+ o(e.start, t), o(e.end, t);
+ }
+ e("../range").Range;
+ var s = e("../range_list").RangeList, a = e("../lib/oop"), l = t.Fold = function(e, t) {
+ 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 = [];
+ };
+ a.inherits(l, s), function() {
+ this.toString = function() {
+ return '"' + this.placeholder + '" ' + this.range.toString();
+ }, this.setFoldLine = function(e) {
+ this.foldLine = e, this.subFolds.forEach(function(t) {
+ t.setFoldLine(e);
+ });
+ }, this.clone = function() {
+ var e = this.range.clone(), t = new l(e, this.placeholder);
+ return this.subFolds.forEach(function(e) {
+ t.subFolds.push(e.clone());
+ }), t.collapseChildren = this.collapseChildren, t;
+ }, this.addSubFold = function(e) {
+ if (!this.range.isEqual(e)) {
+ if (!this.range.containsRange(e)) throw "A fold can't intersect already existing fold" + e.range + this.range;
+ i(e, this.start);
+ for (var t = e.start.row, n = e.start.column, o = 0, r = -1; o < this.subFolds.length && (r = this.subFolds[o].range.compare(t, n),
+ 1 == r); o++) ;
+ var s = this.subFolds[o];
+ if (0 == r) return s.addSubFold(e);
+ for (var t = e.range.end.row, n = e.range.end.column, a = o, r = -1; a < this.subFolds.length && (r = this.subFolds[a].range.compare(t, n),
+ 1 == r); a++) ;
+ if (this.subFolds[a], 0 == r) throw "A fold can't intersect already existing fold" + e.range + this.range;
+ return this.subFolds.splice(o, a - o, e), e.setFoldLine(this.foldLine), e;
+ }
+ }, this.restoreRange = function(e) {
+ return r(e, this.start);
+ };
+ }.call(l.prototype);
+}), define("ace/edit_session/folding", [ "require", "exports", "module", "../range", "./fold_line", "./fold", "../token_iterator" ], function(e, t) {
+ function n() {
+ this.getFoldAt = function(e, t, n) {
+ var i = this.getFoldLine(e);
+ if (!i) return null;
+ for (var o = i.folds, r = 0; r < o.length; r++) {
+ var s = o[r];
+ if (s.range.contains(e, t)) {
+ if (1 == n && s.range.isEnd(e, t)) continue;
+ if (-1 == n && s.range.isStart(e, t)) continue;
+ return s;
+ }
+ }
+ }, this.getFoldsInRange = function(e) {
+ var t = e.start, n = e.end, i = this.$foldData, o = [];
+ t.column += 1, n.column -= 1;
+ for (var r = 0; r < i.length; r++) {
+ var s = i[r].range.compareRange(e);
+ if (2 != s) {
+ if (-2 == s) break;
+ for (var a = i[r].folds, l = 0; l < a.length; l++) {
+ var c = a[l];
+ if (s = c.range.compareRange(e), -2 == s) break;
+ if (2 != s) {
+ if (42 == s) break;
+ o.push(c);
+ }
+ }
+ }
+ }
+ return t.column -= 1, n.column += 1, o;
+ }, this.getAllFolds = function() {
+ function e(e) {
+ t.push(e);
+ }
+ for (var t = [], n = this.$foldData, i = 0; i < n.length; i++) for (var o = 0; o < n[i].folds.length; o++) e(n[i].folds[o]);
+ return t;
+ }, this.getFoldStringAt = function(e, t, n, i) {
+ if (i = i || this.getFoldLine(e), !i) return null;
+ for (var o, r, s = {
+ end: {
+ column: 0
+ }
+ }, a = 0; a < i.folds.length; a++) {
+ r = i.folds[a];
+ var l = r.range.compareEnd(e, t);
+ if (-1 == l) {
+ o = this.getLine(r.start.row).substring(s.end.column, r.start.column);
+ break;
+ }
+ if (0 === l) return null;
+ s = r;
+ }
+ return o || (o = this.getLine(r.start.row).substring(s.end.column)), -1 == n ? o.substring(0, t - s.end.column) : 1 == n ? o.substring(t - s.end.column) : o;
+ }, this.getFoldLine = function(e, t) {
+ var n = this.$foldData, i = 0;
+ for (t && (i = n.indexOf(t)), -1 == i && (i = 0), i; i < n.length; i++) {
+ var o = n[i];
+ if (o.start.row <= e && o.end.row >= e) return o;
+ if (o.end.row > e) return null;
+ }
+ return null;
+ }, this.getNextFoldLine = function(e, t) {
+ var n = this.$foldData, i = 0;
+ for (t && (i = n.indexOf(t)), -1 == i && (i = 0), i; i < n.length; i++) {
+ var o = n[i];
+ if (o.end.row >= e) return o;
+ }
+ return null;
+ }, this.getFoldedRowCount = function(e, t) {
+ for (var n = this.$foldData, i = t - e + 1, o = 0; o < n.length; o++) {
+ var r = n[o], s = r.end.row, a = r.start.row;
+ if (s >= t) {
+ t > a && (a >= e ? i -= t - a : i = 0);
+ break;
+ }
+ s >= e && (i -= a >= e ? s - a : s - e + 1);
+ }
+ return i;
+ }, this.$addFoldLine = function(e) {
+ return this.$foldData.push(e), this.$foldData.sort(function(e, t) {
+ return e.start.row - t.start.row;
+ }), e;
+ }, this.addFold = function(e, t) {
+ var n, i = this.$foldData, s = !1;
+ e instanceof r ? n = e : (n = new r(t, e), n.collapseChildren = t.collapseChildren),
+ this.$clipRangeToDocument(n.range);
+ var a = n.start.row, l = n.start.column, c = n.end.row, u = n.end.column;
+ if (a == c && 2 > u - l) throw "The range has to be at least 2 characters width";
+ var d = this.getFoldAt(a, l, 1), h = this.getFoldAt(c, u, -1);
+ if (d && h == d) return d.addSubFold(n);
+ if (d && !d.range.isStart(a, l) || h && !h.range.isEnd(c, u)) throw "A fold can't intersect already existing fold" + n.range + d.range;
+ var p = this.getFoldsInRange(n.range);
+ p.length > 0 && (this.removeFolds(p), p.forEach(function(e) {
+ n.addSubFold(e);
+ }));
+ for (var f = 0; f < i.length; f++) {
+ var g = i[f];
+ if (c == g.start.row) {
+ g.addFold(n), s = !0;
+ break;
+ }
+ if (a == g.end.row) {
+ if (g.addFold(n), s = !0, !n.sameRow) {
+ var m = i[f + 1];
+ if (m && m.start.row == c) {
+ g.merge(m);
+ break;
+ }
+ }
+ break;
+ }
+ if (c <= g.start.row) break;
+ }
+ return s || (g = this.$addFoldLine(new o(this.$foldData, n))), this.$useWrapMode ? this.$updateWrapData(g.start.row, g.start.row) : this.$updateRowLengthCache(g.start.row, g.start.row),
+ this.$modified = !0, this._emit("changeFold", {
+ data: n,
+ action: "add"
+ }), n;
+ }, this.addFolds = function(e) {
+ e.forEach(function(e) {
+ this.addFold(e);
+ }, this);
+ }, this.removeFold = function(e) {
+ var t = e.foldLine, n = t.start.row, i = t.end.row, o = this.$foldData, r = t.folds;
+ if (1 == r.length) o.splice(o.indexOf(t), 1); else if (t.range.isEnd(e.end.row, e.end.column)) r.pop(),
+ t.end.row = r[r.length - 1].end.row, t.end.column = r[r.length - 1].end.column; else if (t.range.isStart(e.start.row, e.start.column)) r.shift(),
+ t.start.row = r[0].start.row, t.start.column = r[0].start.column; else if (e.sameRow) r.splice(r.indexOf(e), 1); else {
+ var s = t.split(e.start.row, e.start.column);
+ r = s.folds, r.shift(), s.start.row = r[0].start.row, s.start.column = r[0].start.column;
+ }
+ this.$updating || (this.$useWrapMode ? this.$updateWrapData(n, i) : this.$updateRowLengthCache(n, i)),
+ this.$modified = !0, this._emit("changeFold", {
+ data: e,
+ action: "remove"
+ });
+ }, this.removeFolds = function(e) {
+ for (var t = [], n = 0; n < e.length; n++) t.push(e[n]);
+ t.forEach(function(e) {
+ this.removeFold(e);
+ }, this), this.$modified = !0;
+ }, this.expandFold = function(e) {
+ this.removeFold(e), e.subFolds.forEach(function(t) {
+ e.restoreRange(t), this.addFold(t);
+ }, this), e.collapseChildren > 0 && this.foldAll(e.start.row + 1, e.end.row, e.collapseChildren - 1),
+ e.subFolds = [];
+ }, this.expandFolds = function(e) {
+ e.forEach(function(e) {
+ this.expandFold(e);
+ }, this);
+ }, this.unfold = function(e, t) {
+ var n, o;
+ if (null == e ? (n = new i(0, 0, this.getLength(), 0), t = !0) : n = "number" == typeof e ? new i(e, 0, e, this.getLine(e).length) : "row" in e ? i.fromPoints(e, e) : e,
+ o = this.getFoldsInRange(n), t) this.removeFolds(o); else for (;o.length; ) this.expandFolds(o),
+ o = this.getFoldsInRange(n);
+ }, this.isRowFolded = function(e, t) {
+ return !!this.getFoldLine(e, t);
+ }, this.getRowFoldEnd = function(e, t) {
+ var n = this.getFoldLine(e, t);
+ return n ? n.end.row : e;
+ }, this.getRowFoldStart = function(e, t) {
+ var n = this.getFoldLine(e, t);
+ return n ? n.start.row : e;
+ }, this.getFoldDisplayLine = function(e, t, n, i, o) {
+ null == i && (i = e.start.row, o = 0), null == t && (t = e.end.row, n = this.getLine(t).length);
+ var r = this.doc, s = "";
+ return e.walk(function(e, t, n, a) {
+ if (!(i > t)) {
+ if (t == i) {
+ if (o > n) return;
+ a = Math.max(o, a);
+ }
+ s += null != e ? e : r.getLine(t).substring(a, n);
+ }
+ }, t, n), s;
+ }, this.getDisplayLine = function(e, t, n, i) {
+ var o = this.getFoldLine(e);
+ if (o) return this.getFoldDisplayLine(o, e, t, n, i);
+ var r;
+ return r = this.doc.getLine(e), r.substring(i || 0, t || r.length);
+ }, this.$cloneFoldData = function() {
+ var e = [];
+ return e = this.$foldData.map(function(t) {
+ var n = t.folds.map(function(e) {
+ return e.clone();
+ });
+ return new o(e, n);
+ });
+ }, this.toggleFold = function(e) {
+ var t, n, i = this.selection, o = i.getRange();
+ if (o.isEmpty()) {
+ var r = o.start;
+ if (t = this.getFoldAt(r.row, r.column)) return this.expandFold(t), void 0;
+ (n = this.findMatchingBracket(r)) ? 1 == o.comparePoint(n) ? o.end = n : (o.start = n,
+ o.start.column++, o.end.column--) : (n = this.findMatchingBracket({
+ row: r.row,
+ column: r.column + 1
+ })) ? (1 == o.comparePoint(n) ? o.end = n : o.start = n, o.start.column++) : o = this.getCommentFoldRange(r.row, r.column) || o;
+ } else {
+ var s = this.getFoldsInRange(o);
+ if (e && s.length) return this.expandFolds(s), void 0;
+ 1 == s.length && (t = s[0]);
+ }
+ if (t || (t = this.getFoldAt(o.start.row, o.start.column)), t && t.range.toString() == o.toString()) return this.expandFold(t),
+ void 0;
+ var a = "...";
+ if (!o.isMultiLine()) {
+ if (a = this.getTextRange(o), a.length < 4) return;
+ a = a.trim().substring(0, 2) + "..";
+ }
+ this.addFold(a, o);
+ }, this.getCommentFoldRange = function(e, t, n) {
+ var o = new s(this, e, t), r = o.getCurrentToken();
+ if (r && /^comment|string/.test(r.type)) {
+ var a = new i(), l = new RegExp(r.type.replace(/\..*/, "\\."));
+ if (1 != n) {
+ do r = o.stepBackward(); while (r && l.test(r.type));
+ o.stepForward();
+ }
+ if (a.start.row = o.getCurrentTokenRow(), a.start.column = o.getCurrentTokenColumn() + 2,
+ o = new s(this, e, t), -1 != n) {
+ do r = o.stepForward(); while (r && l.test(r.type));
+ r = o.stepBackward();
+ } else r = o.getCurrentToken();
+ return a.end.row = o.getCurrentTokenRow(), a.end.column = o.getCurrentTokenColumn() + r.value.length - 2,
+ a;
+ }
+ }, this.foldAll = function(e, t, n) {
+ void 0 == n && (n = 1e5);
+ var i = this.foldWidgets;
+ t = t || this.getLength();
+ for (var o = e || 0; t > o; o++) if (null == i[o] && (i[o] = this.getFoldWidget(o)),
+ "start" == i[o]) {
+ var r = this.getFoldWidgetRange(o);
+ if (r && r.end.row <= t) try {
+ var s = this.addFold("...", r);
+ s.collapseChildren = n;
+ } catch (a) {}
+ o = r.end.row;
+ }
+ }, this.$foldStyles = {
+ manual: 1,
+ markbegin: 1,
+ markbeginend: 1
+ }, this.$foldStyle = "markbegin", this.setFoldStyle = function(e) {
+ if (!this.$foldStyles[e]) throw new Error("invalid fold style: " + e + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
+ if (this.$foldStyle != e) {
+ this.$foldStyle = e, "manual" == e && this.unfold();
+ var t = this.$foldMode;
+ this.$setFolding(null), this.$setFolding(t);
+ }
+ }, this.$setFolding = function(e) {
+ if (this.$foldMode != e) {
+ if (this.$foldMode = e, this.removeListener("change", this.$updateFoldWidgets),
+ this._emit("changeAnnotation"), !e || "manual" == this.$foldStyle) return this.foldWidgets = null,
+ void 0;
+ 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.on("change", this.$updateFoldWidgets);
+ }
+ }, this.getParentFoldRangeData = function(e, t) {
+ var n = this.foldWidgets;
+ if (!n || t && n[e]) return {};
+ for (var i, o = e - 1; o >= 0; ) {
+ var r = n[o];
+ if (null == r && (r = n[o] = this.getFoldWidget(o)), "start" == r) {
+ var s = this.getFoldWidgetRange(o);
+ if (i || (i = s), s && s.end.row >= e) break;
+ }
+ o--;
+ }
+ return {
+ range: -1 !== o && s,
+ firstRange: i
+ };
+ }, this.onFoldWidgetClick = function(e, t) {
+ var n = this.getFoldWidget(e), i = this.getLine(e);
+ t = t.domEvent;
+ var o = t.shiftKey, r = t.ctrlKey || t.metaKey, s = t.altKey, a = "end" === n ? -1 : 1, l = this.getFoldAt(e, -1 === a ? 0 : i.length, a);
+ if (l) return o || r ? this.removeFold(l) : this.expandFold(l), void 0;
+ var c = this.getFoldWidgetRange(e);
+ if (c && !c.isMultiLine() && (l = this.getFoldAt(c.start.row, c.start.column, 1),
+ l && c.isEqual(l.range))) return this.removeFold(l), void 0;
+ if (s) {
+ var u = this.getParentFoldRangeData(e);
+ if (u.range) var d = u.range.start.row + 1, h = u.range.end.row;
+ this.foldAll(d, h, r ? 1e4 : 0);
+ } else if (o) {
+ var h = c ? c.end.row : this.getLength();
+ this.foldAll(e + 1, c.end.row, r ? 1e4 : 0);
+ } else c && (r && (c.collapseChildren = 1e4), this.addFold("...", c));
+ c || ((t.target || t.srcElement).className += " ace_invalid");
+ }, this.updateFoldWidgets = function(e) {
+ var t = e.data, n = t.range, i = n.start.row, o = n.end.row - i;
+ if (0 === o) this.foldWidgets[i] = null; else if ("removeText" == t.action || "removeLines" == t.action) this.foldWidgets.splice(i, o + 1, null); else {
+ var r = Array(o + 1);
+ r.unshift(i, 1), this.foldWidgets.splice.apply(this.foldWidgets, r);
+ }
+ };
+ }
+ var i = e("../range").Range, o = e("./fold_line").FoldLine, r = e("./fold").Fold, s = e("../token_iterator").TokenIterator;
+ t.Folding = n;
+}), define("ace/edit_session/bracket_match", [ "require", "exports", "module", "../token_iterator", "../range" ], function(e, t) {
+ function n() {
+ this.findMatchingBracket = function(e, t) {
+ if (0 == e.column) return null;
+ var n = t || this.getLine(e.row).charAt(e.column - 1);
+ if ("" == n) return null;
+ var i = n.match(/([\(\[\{])|([\)\]\}])/);
+ return i ? i[1] ? this.$findClosingBracket(i[1], e) : this.$findOpeningBracket(i[2], e) : null;
+ }, this.getBracketRange = function(e) {
+ var t, n = this.getLine(e.row), i = !0, r = n.charAt(e.column - 1), s = r && r.match(/([\(\[\{])|([\)\]\}])/);
+ if (s || (r = n.charAt(e.column), e = {
+ row: e.row,
+ column: e.column + 1
+ }, s = r && r.match(/([\(\[\{])|([\)\]\}])/), i = !1), !s) return null;
+ if (s[1]) {
+ var a = this.$findClosingBracket(s[1], e);
+ if (!a) return null;
+ t = o.fromPoints(e, a), i || (t.end.column++, t.start.column--), t.cursor = t.end;
+ } else {
+ var a = this.$findOpeningBracket(s[2], e);
+ if (!a) return null;
+ t = o.fromPoints(a, e), i || (t.start.column++, t.end.column--), t.cursor = t.start;
+ }
+ return t;
+ }, this.$brackets = {
+ ")": "(",
+ "(": ")",
+ "]": "[",
+ "[": "]",
+ "{": "}",
+ "}": "{"
+ }, this.$findOpeningBracket = function(e, t, n) {
+ var o = this.$brackets[e], r = 1, s = new i(this, t.row, t.column), a = s.getCurrentToken();
+ if (a || (a = s.stepForward()), a) {
+ n || (n = new RegExp("(\\.?" + a.type.replace(".", "\\.").replace("rparen", ".paren") + ")+"));
+ for (var l = t.column - s.getCurrentTokenColumn() - 2, c = a.value; ;) {
+ for (;l >= 0; ) {
+ var u = c.charAt(l);
+ if (u == o) {
+ if (r -= 1, 0 == r) return {
+ row: s.getCurrentTokenRow(),
+ column: l + s.getCurrentTokenColumn()
+ };
+ } else u == e && (r += 1);
+ l -= 1;
+ }
+ do a = s.stepBackward(); while (a && !n.test(a.type));
+ if (null == a) break;
+ c = a.value, l = c.length - 1;
+ }
+ return null;
+ }
+ }, this.$findClosingBracket = function(e, t, n) {
+ var o = this.$brackets[e], r = 1, s = new i(this, t.row, t.column), a = s.getCurrentToken();
+ if (a || (a = s.stepForward()), a) {
+ n || (n = new RegExp("(\\.?" + a.type.replace(".", "\\.").replace("lparen", ".paren") + ")+"));
+ for (var l = t.column - s.getCurrentTokenColumn(); ;) {
+ for (var c = a.value, u = c.length; u > l; ) {
+ var d = c.charAt(l);
+ if (d == o) {
+ if (r -= 1, 0 == r) return {
+ row: s.getCurrentTokenRow(),
+ column: l + s.getCurrentTokenColumn()
+ };
+ } else d == e && (r += 1);
+ l += 1;
+ }
+ do a = s.stepForward(); while (a && !n.test(a.type));
+ if (null == a) break;
+ l = 0;
+ }
+ return null;
+ }
+ };
+ }
+ var i = e("../token_iterator").TokenIterator, o = e("../range").Range;
+ t.BracketMatch = n;
+}), define("ace/edit_session", [ "require", "exports", "module", "./lib/oop", "./lib/lang", "./config", "./lib/event_emitter", "./selection", "./mode/text", "./range", "./document", "./background_tokenizer", "./search_highlight", "./edit_session/folding", "./edit_session/bracket_match" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/lang"), o = e("./config"), r = e("./lib/event_emitter").EventEmitter, s = e("./selection").Selection, a = e("./mode/text").Mode, l = e("./range").Range, c = e("./document").Document, u = e("./background_tokenizer").BackgroundTokenizer, d = e("./search_highlight").SearchHighlight, h = function(e, t) {
+ this.$breakpoints = [], this.$decorations = [], this.$frontMarkers = {}, this.$backMarkers = {},
+ this.$markerId = 1, this.$undoSelect = !0, this.$foldData = [], this.$foldData.toString = function() {
+ return this.join("\n");
+ }, this.on("changeFold", this.onChangeFold.bind(this)), this.$onChange = this.onChange.bind(this),
+ "object" == typeof e && e.getLine || (e = new c(e)), this.setDocument(e), this.selection = new s(this),
+ o.resetOptions(this), this.setMode(t), o._emit("session", this);
+ };
+ (function() {
+ function t(e) {
+ return 4352 > e ? !1 : e >= 4352 && 4447 >= e || e >= 4515 && 4519 >= e || e >= 4602 && 4607 >= e || e >= 9001 && 9002 >= e || e >= 11904 && 11929 >= e || e >= 11931 && 12019 >= e || e >= 12032 && 12245 >= e || e >= 12272 && 12283 >= e || e >= 12288 && 12350 >= e || e >= 12353 && 12438 >= e || e >= 12441 && 12543 >= e || e >= 12549 && 12589 >= e || e >= 12593 && 12686 >= e || e >= 12688 && 12730 >= e || e >= 12736 && 12771 >= e || e >= 12784 && 12830 >= e || e >= 12832 && 12871 >= e || e >= 12880 && 13054 >= e || e >= 13056 && 19903 >= e || e >= 19968 && 42124 >= e || e >= 42128 && 42182 >= e || e >= 43360 && 43388 >= e || e >= 44032 && 55203 >= e || e >= 55216 && 55238 >= e || e >= 55243 && 55291 >= e || e >= 63744 && 64255 >= e || e >= 65040 && 65049 >= e || e >= 65072 && 65106 >= e || e >= 65108 && 65126 >= e || e >= 65128 && 65131 >= e || e >= 65281 && 65376 >= e || e >= 65504 && 65510 >= e;
+ }
+ n.implement(this, r), this.setDocument = function(e) {
+ 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();
+ }, this.getDocument = function() {
+ return this.doc;
+ }, this.$resetRowCache = function(e) {
+ if (!e) return this.$docRowCache = [], this.$screenRowCache = [], void 0;
+ var t = this.$docRowCache.length, n = this.$getRowCacheIndex(this.$docRowCache, e) + 1;
+ t > n && (this.$docRowCache.splice(n, t), this.$screenRowCache.splice(n, t));
+ }, this.$getRowCacheIndex = function(e, t) {
+ for (var n = 0, i = e.length - 1; i >= n; ) {
+ var o = n + i >> 1, r = e[o];
+ if (t > r) n = o + 1; else {
+ if (!(r > t)) return o;
+ i = o - 1;
+ }
+ }
+ return n - 1;
+ }, this.resetCaches = function() {
+ this.$modified = !0, this.$wrapData = [], this.$rowLengthCache = [], this.$resetRowCache(0),
+ this.bgTokenizer && this.bgTokenizer.start(0);
+ }, this.onChangeFold = function(e) {
+ var t = e.data;
+ this.$resetRowCache(t.start.row);
+ }, this.onChange = function(e) {
+ var t = e.data;
+ this.$modified = !0, this.$resetRowCache(t.range.start.row);
+ var n = this.$updateInternalDataOnChange(e);
+ this.$fromUndo || !this.$undoManager || t.ignore || (this.$deltasDoc.push(t), n && 0 != n.length && this.$deltasFold.push({
+ action: "removeFolds",
+ folds: n
+ }), this.$informUndoManager.schedule()), this.bgTokenizer.$updateOnChange(t), this._emit("change", e);
+ }, this.setValue = function(e) {
+ this.doc.setValue(e), this.selection.moveCursorTo(0, 0), this.selection.clearSelection(),
+ this.$resetRowCache(0), this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [],
+ this.getUndoManager().reset();
+ }, this.getValue = this.toString = function() {
+ return this.doc.getValue();
+ }, this.getSelection = function() {
+ return this.selection;
+ }, this.getState = function(e) {
+ return this.bgTokenizer.getState(e);
+ }, this.getTokens = function(e) {
+ return this.bgTokenizer.getTokens(e);
+ }, this.getTokenAt = function(e, t) {
+ var n, i = this.bgTokenizer.getTokens(e), o = 0;
+ if (null == t) r = i.length - 1, o = this.getLine(e).length; else for (var r = 0; r < i.length && (o += i[r].value.length,
+ !(o >= t)); r++) ;
+ return (n = i[r]) ? (n.index = r, n.start = o - n.value.length, n) : null;
+ }, this.setUndoManager = function(e) {
+ if (this.$undoManager = e, this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [],
+ this.$informUndoManager && this.$informUndoManager.cancel(), e) {
+ var t = this;
+ this.$syncInformUndoManager = function() {
+ t.$informUndoManager.cancel(), t.$deltasFold.length && (t.$deltas.push({
+ group: "fold",
+ deltas: t.$deltasFold
+ }), t.$deltasFold = []), t.$deltasDoc.length && (t.$deltas.push({
+ group: "doc",
+ deltas: t.$deltasDoc
+ }), t.$deltasDoc = []), t.$deltas.length > 0 && e.execute({
+ action: "aceupdate",
+ args: [ t.$deltas, t ]
+ }), t.$deltas = [];
+ }, this.$informUndoManager = i.delayedCall(this.$syncInformUndoManager);
+ }
+ }, this.markUndoGroup = function() {
+ this.$syncInformUndoManager && this.$syncInformUndoManager();
+ }, this.$defaultUndoManager = {
+ undo: function() {},
+ redo: function() {},
+ reset: function() {}
+ }, this.getUndoManager = function() {
+ return this.$undoManager || this.$defaultUndoManager;
+ }, this.getTabString = function() {
+ return this.getUseSoftTabs() ? i.stringRepeat(" ", this.getTabSize()) : " ";
+ }, this.setUseSoftTabs = function(e) {
+ this.setOption("useSoftTabs", e);
+ }, this.getUseSoftTabs = function() {
+ return this.$useSoftTabs;
+ }, this.setTabSize = function(e) {
+ this.setOption("tabSize", e);
+ }, this.getTabSize = function() {
+ return this.$tabSize;
+ }, this.isTabStop = function(e) {
+ return this.$useSoftTabs && 0 == e.column % this.$tabSize;
+ }, this.$overwrite = !1, this.setOverwrite = function(e) {
+ this.setOption("overwrite", e);
+ }, this.getOverwrite = function() {
+ return this.$overwrite;
+ }, this.toggleOverwrite = function() {
+ this.setOverwrite(!this.$overwrite);
+ }, this.addGutterDecoration = function(e, t) {
+ this.$decorations[e] || (this.$decorations[e] = ""), this.$decorations[e] += " " + t,
+ this._emit("changeBreakpoint", {});
+ }, this.removeGutterDecoration = function(e, t) {
+ this.$decorations[e] = (this.$decorations[e] || "").replace(" " + t, ""), this._emit("changeBreakpoint", {});
+ }, this.getBreakpoints = function() {
+ return this.$breakpoints;
+ }, this.setBreakpoints = function(e) {
+ this.$breakpoints = [];
+ for (var t = 0; t < e.length; t++) this.$breakpoints[e[t]] = "ace_breakpoint";
+ this._emit("changeBreakpoint", {});
+ }, this.clearBreakpoints = function() {
+ this.$breakpoints = [], this._emit("changeBreakpoint", {});
+ }, this.setBreakpoint = function(e, t) {
+ void 0 === t && (t = "ace_breakpoint"), t ? this.$breakpoints[e] = t : delete this.$breakpoints[e],
+ this._emit("changeBreakpoint", {});
+ }, this.clearBreakpoint = function(e) {
+ delete this.$breakpoints[e], this._emit("changeBreakpoint", {});
+ }, this.addMarker = function(e, t, n, i) {
+ var o = this.$markerId++, r = {
+ range: e,
+ type: n || "line",
+ renderer: "function" == typeof n ? n : null,
+ clazz: t,
+ inFront: !!i,
+ id: o
+ };
+ return i ? (this.$frontMarkers[o] = r, this._emit("changeFrontMarker")) : (this.$backMarkers[o] = r,
+ this._emit("changeBackMarker")), o;
+ }, this.addDynamicMarker = function(e, t) {
+ if (e.update) {
+ var n = this.$markerId++;
+ return e.id = n, e.inFront = !!t, t ? (this.$frontMarkers[n] = e, this._emit("changeFrontMarker")) : (this.$backMarkers[n] = e,
+ this._emit("changeBackMarker")), e;
+ }
+ }, this.removeMarker = function(e) {
+ var t = this.$frontMarkers[e] || this.$backMarkers[e];
+ if (t) {
+ var n = t.inFront ? this.$frontMarkers : this.$backMarkers;
+ t && (delete n[e], this._emit(t.inFront ? "changeFrontMarker" : "changeBackMarker"));
+ }
+ }, this.getMarkers = function(e) {
+ return e ? this.$frontMarkers : this.$backMarkers;
+ }, this.highlight = function(e) {
+ if (!this.$searchHighlight) {
+ var t = new d(null, "ace_selected-word", "text");
+ this.$searchHighlight = this.addDynamicMarker(t);
+ }
+ this.$searchHighlight.setRegexp(e);
+ }, this.highlightLines = function(e, t, n, i) {
+ "number" != typeof t && (n = t, t = e), n || (n = "ace_step");
+ var o = new l(e, 0, t, 1/0);
+ return o.id = this.addMarker(o, n, "fullLine", i), o;
+ }, this.setAnnotations = function(e) {
+ this.$annotations = e, this._emit("changeAnnotation", {});
+ }, this.getAnnotations = function() {
+ return this.$annotations || [];
+ }, this.clearAnnotations = function() {
+ this.setAnnotations([]);
+ }, this.$detectNewLine = function(e) {
+ var t = e.match(/^.*?(\r?\n)/m);
+ this.$autoNewLine = t ? t[1] : "\n";
+ }, this.getWordRange = function(e, t) {
+ var n = this.getLine(e), i = !1;
+ if (t > 0 && (i = !!n.charAt(t - 1).match(this.tokenRe)), i || (i = !!n.charAt(t).match(this.tokenRe)),
+ i) var o = this.tokenRe; else if (/^\s+$/.test(n.slice(t - 1, t + 1))) var o = /\s/; else var o = this.nonTokenRe;
+ var r = t;
+ if (r > 0) {
+ do r--; while (r >= 0 && n.charAt(r).match(o));
+ r++;
+ }
+ for (var s = t; s < n.length && n.charAt(s).match(o); ) s++;
+ return new l(e, r, e, s);
+ }, this.getAWordRange = function(e, t) {
+ for (var n = this.getWordRange(e, t), i = this.getLine(n.end.row); i.charAt(n.end.column).match(/[ \t]/); ) n.end.column += 1;
+ return n;
+ }, this.setNewLineMode = function(e) {
+ this.doc.setNewLineMode(e);
+ }, this.getNewLineMode = function() {
+ return this.doc.getNewLineMode();
+ }, this.setUseWorker = function(e) {
+ this.setOption("useWorker", e);
+ }, this.getUseWorker = function() {
+ return this.$useWorker;
+ }, this.onReloadTokenizer = function(e) {
+ var t = e.data;
+ this.bgTokenizer.start(t.first), this._emit("tokenizerUpdate", e);
+ }, this.$modes = {}, this.$mode = null, this.$modeId = null, this.setMode = function(e) {
+ if (e && "object" == typeof e) {
+ if (e.getTokenizer) return this.$onChangeMode(e);
+ var t = e, n = t.path;
+ } else n = e || "ace/mode/text";
+ return this.$modes["ace/mode/text"] || (this.$modes["ace/mode/text"] = new a()),
+ this.$modes[n] && !t ? this.$onChangeMode(this.$modes[n]) : (this.$modeId = n, o.loadModule([ "mode", n ], function(e) {
+ return this.$modeId === n ? this.$modes[n] && !t ? this.$onChangeMode(this.$modes[n]) : (e && e.Mode && (e = new e.Mode(t),
+ t || (this.$modes[n] = e, e.$id = n), this.$onChangeMode(e)), void 0) : void 0;
+ }.bind(this)), this.$mode || this.$onChangeMode(this.$modes["ace/mode/text"], !0),
+ void 0);
+ }, this.$onChangeMode = function(e, t) {
+ if (this.$mode !== e) {
+ this.$mode = e, this.$stopWorker(), this.$useWorker && this.$startWorker();
+ var n = e.getTokenizer();
+ if (void 0 !== n.addEventListener) {
+ var i = this.onReloadTokenizer.bind(this);
+ n.addEventListener("update", i);
+ }
+ if (this.bgTokenizer) this.bgTokenizer.setTokenizer(n); else {
+ this.bgTokenizer = new u(n);
+ var o = this;
+ this.bgTokenizer.addEventListener("update", function(e) {
+ o._emit("tokenizerUpdate", e);
+ });
+ }
+ this.bgTokenizer.setDocument(this.getDocument()), this.tokenRe = e.tokenRe, this.nonTokenRe = e.nonTokenRe,
+ t || (this.$modeId = e.$id, this.$setFolding(e.foldingRules), this._emit("changeMode"),
+ this.bgTokenizer.start(0));
+ }
+ }, this.$stopWorker = function() {
+ this.$worker && this.$worker.terminate(), this.$worker = null;
+ }, this.$startWorker = function() {
+ if ("undefined" == typeof Worker || e.noWorker) this.$worker = null; else try {
+ this.$worker = this.$mode.createWorker(this);
+ } catch (t) {
+ console.log("Could not load worker"), console.log(t), this.$worker = null;
+ }
+ }, this.getMode = function() {
+ return this.$mode;
+ }, this.$scrollTop = 0, this.setScrollTop = function(e) {
+ e = Math.round(Math.max(0, e)), this.$scrollTop === e || isNaN(e) || (this.$scrollTop = e,
+ this._signal("changeScrollTop", e));
+ }, this.getScrollTop = function() {
+ return this.$scrollTop;
+ }, this.$scrollLeft = 0, this.setScrollLeft = function(e) {
+ e = Math.round(Math.max(0, e)), this.$scrollLeft === e || isNaN(e) || (this.$scrollLeft = e,
+ this._signal("changeScrollLeft", e));
+ }, this.getScrollLeft = function() {
+ return this.$scrollLeft;
+ }, this.getScreenWidth = function() {
+ return this.$computeWidth(), this.screenWidth;
+ }, this.$computeWidth = function(e) {
+ if (this.$modified || e) {
+ if (this.$modified = !1, this.$useWrapMode) return this.screenWidth = this.$wrapLimit;
+ for (var t = this.doc.getAllLines(), n = this.$rowLengthCache, i = 0, o = 0, r = this.$foldData[o], s = r ? r.start.row : 1/0, a = t.length, l = 0; a > l; l++) {
+ if (l > s) {
+ if (l = r.end.row + 1, l >= a) break;
+ r = this.$foldData[o++], s = r ? r.start.row : 1/0;
+ }
+ null == n[l] && (n[l] = this.$getStringScreenWidth(t[l])[0]), n[l] > i && (i = n[l]);
+ }
+ this.screenWidth = i;
+ }
+ }, this.getLine = function(e) {
+ return this.doc.getLine(e);
+ }, this.getLines = function(e, t) {
+ return this.doc.getLines(e, t);
+ }, this.getLength = function() {
+ return this.doc.getLength();
+ }, this.getTextRange = function(e) {
+ return this.doc.getTextRange(e || this.selection.getRange());
+ }, this.insert = function(e, t) {
+ return this.doc.insert(e, t);
+ }, this.remove = function(e) {
+ return this.doc.remove(e);
+ }, this.undoChanges = function(e, t) {
+ if (e.length) {
+ this.$fromUndo = !0;
+ for (var n = null, i = e.length - 1; -1 != i; i--) {
+ var o = e[i];
+ "doc" == o.group ? (this.doc.revertDeltas(o.deltas), n = this.$getUndoSelection(o.deltas, !0, n)) : o.deltas.forEach(function(e) {
+ this.addFolds(e.folds);
+ }, this);
+ }
+ return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n),
+ n;
+ }
+ }, this.redoChanges = function(e, t) {
+ if (e.length) {
+ this.$fromUndo = !0;
+ for (var n = null, i = 0; i < e.length; i++) {
+ var o = e[i];
+ "doc" == o.group && (this.doc.applyDeltas(o.deltas), n = this.$getUndoSelection(o.deltas, !1, n));
+ }
+ return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n),
+ n;
+ }
+ }, this.setUndoSelect = function(e) {
+ this.$undoSelect = e;
+ }, this.$getUndoSelection = function(e, t, n) {
+ function i(e) {
+ var n = "insertText" === e.action || "insertLines" === e.action;
+ return t ? !n : n;
+ }
+ var o, r, s = e[0], a = !1;
+ i(s) ? (o = s.range.clone(), a = !0) : (o = l.fromPoints(s.range.start, s.range.start),
+ a = !1);
+ for (var c = 1; c < e.length; c++) s = e[c], i(s) ? (r = s.range.start, -1 == o.compare(r.row, r.column) && o.setStart(s.range.start),
+ r = s.range.end, 1 == o.compare(r.row, r.column) && o.setEnd(s.range.end), a = !0) : (r = s.range.start,
+ -1 == o.compare(r.row, r.column) && (o = l.fromPoints(s.range.start, s.range.start)),
+ a = !1);
+ if (null != n) {
+ var u = n.compareRange(o);
+ 1 == u ? o.setStart(n.start) : -1 == u && o.setEnd(n.end);
+ }
+ return o;
+ }, this.replace = function(e, t) {
+ return this.doc.replace(e, t);
+ }, this.moveText = function(e, t, n) {
+ var i = this.getTextRange(e), o = this.getFoldsInRange(e), r = l.fromPoints(t, t);
+ if (!n) {
+ this.remove(e);
+ var s = e.start.row - e.end.row, a = s ? -e.end.column : e.start.column - e.end.column;
+ a && (r.start.row == e.end.row && r.start.column > e.end.column && (r.start.column += a),
+ r.end.row == e.end.row && r.end.column > e.end.column && (r.end.column += a)), s && r.start.row >= e.end.row && (r.start.row += s,
+ r.end.row += s);
+ }
+ if (this.insert(r.start, i), o.length) {
+ var c = e.start, u = r.start, s = u.row - c.row, a = u.column - c.column;
+ this.addFolds(o.map(function(e) {
+ return e = e.clone(), e.start.row == c.row && (e.start.column += a), e.end.row == c.row && (e.end.column += a),
+ e.start.row += s, e.end.row += s, e;
+ }));
+ }
+ return r;
+ }, this.indentRows = function(e, t, n) {
+ n = n.replace(/\t/g, this.getTabString());
+ for (var i = e; t >= i; i++) this.insert({
+ row: i,
+ column: 0
+ }, n);
+ }, this.outdentRows = function(e) {
+ for (var t = e.collapseRows(), n = new l(0, 0, 0, 0), i = this.getTabSize(), o = t.start.row; o <= t.end.row; ++o) {
+ var r = this.getLine(o);
+ n.start.row = o, n.end.row = o;
+ for (var s = 0; i > s && " " == r.charAt(s); ++s) ;
+ i > s && " " == r.charAt(s) ? (n.start.column = s, n.end.column = s + 1) : (n.start.column = 0,
+ n.end.column = s), this.remove(n);
+ }
+ }, this.$moveLines = function(e, t, n) {
+ if (e = this.getRowFoldStart(e), t = this.getRowFoldEnd(t), 0 > n) {
+ var i = this.getRowFoldStart(e + n);
+ if (0 > i) return 0;
+ var o = i - e;
+ } else if (n > 0) {
+ var i = this.getRowFoldEnd(t + n);
+ if (i > this.doc.getLength() - 1) return 0;
+ var o = i - t;
+ } else {
+ e = this.$clipRowToDocument(e), t = this.$clipRowToDocument(t);
+ var o = t - e + 1;
+ }
+ var r = new l(e, 0, t, Number.MAX_VALUE), s = this.getFoldsInRange(r).map(function(e) {
+ return e = e.clone(), e.start.row += o, e.end.row += o, e;
+ }), a = 0 == n ? this.doc.getLines(e, t) : this.doc.removeLines(e, t);
+ return this.doc.insertLines(e + o, a), s.length && this.addFolds(s), o;
+ }, this.moveLinesUp = function(e, t) {
+ return this.$moveLines(e, t, -1);
+ }, this.moveLinesDown = function(e, t) {
+ return this.$moveLines(e, t, 1);
+ }, this.duplicateLines = function(e, t) {
+ return this.$moveLines(e, t, 0);
+ }, this.$clipRowToDocument = function(e) {
+ return Math.max(0, Math.min(e, this.doc.getLength() - 1));
+ }, this.$clipColumnToRow = function(e, t) {
+ return 0 > t ? 0 : Math.min(this.doc.getLine(e).length, t);
+ }, this.$clipPositionToDocument = function(e, t) {
+ if (t = Math.max(0, t), 0 > e) e = 0, t = 0; else {
+ var n = this.doc.getLength();
+ e >= n ? (e = n - 1, t = this.doc.getLine(n - 1).length) : t = Math.min(this.doc.getLine(e).length, t);
+ }
+ return {
+ row: e,
+ column: t
+ };
+ }, this.$clipRangeToDocument = function(e) {
+ e.start.row < 0 ? (e.start.row = 0, e.start.column = 0) : e.start.column = this.$clipColumnToRow(e.start.row, e.start.column);
+ var t = this.doc.getLength() - 1;
+ 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;
+ }, this.$wrapLimit = 80, this.$useWrapMode = !1, this.$wrapLimitRange = {
+ min: null,
+ max: null
+ }, this.setUseWrapMode = function(e) {
+ if (e != this.$useWrapMode) {
+ if (this.$useWrapMode = e, this.$modified = !0, this.$resetRowCache(0), e) {
+ var t = this.getLength();
+ this.$wrapData = [];
+ for (var n = 0; t > n; n++) this.$wrapData.push([]);
+ this.$updateWrapData(0, t - 1);
+ }
+ this._emit("changeWrapMode");
+ }
+ }, this.getUseWrapMode = function() {
+ return this.$useWrapMode;
+ }, this.setWrapLimitRange = function(e, t) {
+ (this.$wrapLimitRange.min !== e || this.$wrapLimitRange.max !== t) && (this.$wrapLimitRange.min = e,
+ this.$wrapLimitRange.max = t, this.$modified = !0, this._emit("changeWrapMode"));
+ }, this.adjustWrapLimit = function(e, t) {
+ var n = this.$wrapLimitRange;
+ n.max < 0 && (n = {
+ min: t,
+ max: t
+ });
+ var i = this.$constrainWrapLimit(e, n.min, n.max);
+ return i != this.$wrapLimit && i > 1 ? (this.$wrapLimit = i, this.$modified = !0,
+ this.$useWrapMode && (this.$updateWrapData(0, this.getLength() - 1), this.$resetRowCache(0),
+ this._emit("changeWrapLimit")), !0) : !1;
+ }, this.$constrainWrapLimit = function(e, t, n) {
+ return t && (e = Math.max(t, e)), n && (e = Math.min(n, e)), e;
+ }, this.getWrapLimit = function() {
+ return this.$wrapLimit;
+ }, this.setWrapLimit = function(e) {
+ this.setWrapLimitRange(e, e);
+ }, this.getWrapLimitRange = function() {
+ return {
+ min: this.$wrapLimitRange.min,
+ max: this.$wrapLimitRange.max
+ };
+ }, this.$updateInternalDataOnChange = function(e) {
+ var t, n = this.$useWrapMode, i = e.data.action, o = e.data.range.start.row, r = e.data.range.end.row, s = e.data.range.start, a = e.data.range.end, l = null;
+ if (-1 != i.indexOf("Lines") ? (r = "insertLines" == i ? o + e.data.lines.length : o,
+ t = e.data.lines ? e.data.lines.length : r - o) : t = r - o, this.$updating = !0,
+ 0 != t) if (-1 != i.indexOf("remove")) {
+ this[n ? "$wrapData" : "$rowLengthCache"].splice(o, t);
+ var c = this.$foldData;
+ l = this.getFoldsInRange(e.data.range), this.removeFolds(l);
+ var u = this.getFoldLine(a.row), d = 0;
+ if (u) {
+ u.addRemoveChars(a.row, a.column, s.column - a.column), u.shiftRow(-t);
+ var h = this.getFoldLine(o);
+ h && h !== u && (h.merge(u), u = h), d = c.indexOf(u) + 1;
+ }
+ for (d; d < c.length; d++) {
+ var u = c[d];
+ u.start.row >= a.row && u.shiftRow(-t);
+ }
+ r = o;
+ } else {
+ var p;
+ if (n) {
+ p = [ o, 0 ];
+ for (var f = 0; t > f; f++) p.push([]);
+ this.$wrapData.splice.apply(this.$wrapData, p);
+ } else p = Array(t), p.unshift(o, 0), this.$rowLengthCache.splice.apply(this.$rowLengthCache, p);
+ var c = this.$foldData, u = this.getFoldLine(o), d = 0;
+ if (u) {
+ var g = u.range.compareInside(s.row, s.column);
+ 0 == g ? (u = u.split(s.row, s.column), u.shiftRow(t), u.addRemoveChars(r, 0, a.column - s.column)) : -1 == g && (u.addRemoveChars(o, 0, a.column - s.column),
+ u.shiftRow(t)), d = c.indexOf(u) + 1;
+ }
+ for (d; d < c.length; d++) {
+ var u = c[d];
+ u.start.row >= o && u.shiftRow(t);
+ }
+ } else {
+ t = Math.abs(e.data.range.start.column - e.data.range.end.column), -1 != i.indexOf("remove") && (l = this.getFoldsInRange(e.data.range),
+ this.removeFolds(l), t = -t);
+ var u = this.getFoldLine(o);
+ u && u.addRemoveChars(o, s.column, t);
+ }
+ return n && this.$wrapData.length != this.doc.getLength() && console.error("doc.getLength() and $wrapData.length have to be the same!"),
+ this.$updating = !1, n ? this.$updateWrapData(o, r) : this.$updateRowLengthCache(o, r),
+ l;
+ }, this.$updateRowLengthCache = function(e, t) {
+ this.$rowLengthCache[e] = null, this.$rowLengthCache[t] = null;
+ }, this.$updateWrapData = function(e, t) {
+ var n, o, r = this.doc.getAllLines(), s = this.getTabSize(), a = this.$wrapData, l = this.$wrapLimit, c = e;
+ for (t = Math.min(t, r.length - 1); t >= c; ) if (o = this.getFoldLine(c, o)) {
+ for (n = [], o.walk(function(e, t, i, o) {
+ var s;
+ if (null != e) {
+ s = this.$getDisplayTokens(e, n.length), s[0] = h;
+ for (var a = 1; a < s.length; a++) s[a] = p;
+ } else s = this.$getDisplayTokens(r[t].substring(o, i), n.length);
+ n = n.concat(s);
+ }.bind(this), o.end.row, r[o.end.row].length + 1); 0 != n.length && n[n.length - 1] >= g; ) n.pop();
+ a[o.start.row] = this.$computeWrapSplits(n, l, s), c = o.end.row + 1;
+ } else n = this.$getDisplayTokens(i.stringTrimRight(r[c])), a[c] = this.$computeWrapSplits(n, l, s),
+ c++;
+ };
+ var s = 1, c = 2, h = 3, p = 4, f = 9, g = 10, m = 11, v = 12;
+ this.$computeWrapSplits = function(e, t) {
+ function n(t) {
+ var n = e.slice(r, t), o = n.length;
+ n.join("").replace(/12/g, function() {
+ o -= 1;
+ }).replace(/2/g, function() {
+ o -= 1;
+ }), s += o, i.push(s), r = t;
+ }
+ if (0 == e.length) return [];
+ for (var i = [], o = e.length, r = 0, s = 0; o - r > t; ) {
+ var a = r + t;
+ if (e[a] >= g) {
+ for (;e[a] >= g; ) a++;
+ n(a);
+ } else if (e[a] != h && e[a] != p) {
+ for (var l = Math.max(a - 10, r - 1); a > l && e[a] < h; ) a--;
+ for (;a > l && e[a] == f; ) a--;
+ a > l ? n(++a) : (a = r + t, n(a));
+ } else {
+ for (a; a != r - 1 && e[a] != h; a--) ;
+ if (a > r) {
+ n(a);
+ continue;
+ }
+ for (a = r + t; a < e.length && e[a] == p; a++) ;
+ if (a == e.length) break;
+ n(a);
+ }
+ }
+ return i;
+ }, this.$getDisplayTokens = function(e, n) {
+ var i, o = [];
+ n = n || 0;
+ for (var r = 0; r < e.length; r++) {
+ var a = e.charCodeAt(r);
+ if (9 == a) {
+ i = this.getScreenTabSize(o.length + n), o.push(m);
+ for (var l = 1; i > l; l++) o.push(v);
+ } else 32 == a ? o.push(g) : a > 39 && 48 > a || a > 57 && 64 > a ? o.push(f) : a >= 4352 && t(a) ? o.push(s, c) : o.push(s);
+ }
+ return o;
+ }, this.$getStringScreenWidth = function(e, n, i) {
+ if (0 == n) return [ 0, 0 ];
+ null == n && (n = 1/0), i = i || 0;
+ var o, r;
+ for (r = 0; r < e.length && (o = e.charCodeAt(r), i += 9 == o ? this.getScreenTabSize(i) : o >= 4352 && t(o) ? 2 : 1,
+ !(i > n)); r++) ;
+ return [ i, r ];
+ }, this.getRowLength = function(e) {
+ return this.$useWrapMode && this.$wrapData[e] ? this.$wrapData[e].length + 1 : 1;
+ }, this.getScreenLastRowColumn = function(e) {
+ var t = this.screenToDocumentPosition(e, Number.MAX_VALUE);
+ return this.documentToScreenColumn(t.row, t.column);
+ }, this.getDocumentLastRowColumn = function(e, t) {
+ var n = this.documentToScreenRow(e, t);
+ return this.getScreenLastRowColumn(n);
+ }, this.getDocumentLastRowColumnPosition = function(e, t) {
+ var n = this.documentToScreenRow(e, t);
+ return this.screenToDocumentPosition(n, Number.MAX_VALUE / 10);
+ }, this.getRowSplitData = function(e) {
+ return this.$useWrapMode ? this.$wrapData[e] : void 0;
+ }, this.getScreenTabSize = function(e) {
+ return this.$tabSize - e % this.$tabSize;
+ }, this.screenToDocumentRow = function(e, t) {
+ return this.screenToDocumentPosition(e, t).row;
+ }, this.screenToDocumentColumn = function(e, t) {
+ return this.screenToDocumentPosition(e, t).column;
+ }, this.screenToDocumentPosition = function(e, t) {
+ if (0 > e) return {
+ row: 0,
+ column: 0
+ };
+ var n, i, o = 0, r = 0, s = 0, a = 0, l = this.$screenRowCache, c = this.$getRowCacheIndex(l, e), u = l.length;
+ if (u && c >= 0) var s = l[c], o = this.$docRowCache[c], d = e > l[u - 1]; else var d = !u;
+ for (var h = this.getLength() - 1, p = this.getNextFoldLine(o), f = p ? p.start.row : 1/0; e >= s && (a = this.getRowLength(o),
+ !(s + a - 1 >= e || o >= h)); ) s += a, o++, o > f && (o = p.end.row + 1, p = this.getNextFoldLine(o, p),
+ f = p ? p.start.row : 1/0), d && (this.$docRowCache.push(o), this.$screenRowCache.push(s));
+ if (p && p.start.row <= o) n = this.getFoldDisplayLine(p), o = p.start.row; else {
+ if (e >= s + a || o > h) return {
+ row: h,
+ column: this.getLine(h).length
+ };
+ n = this.getLine(o), p = null;
+ }
+ if (this.$useWrapMode) {
+ var g = this.$wrapData[o];
+ g && (i = g[e - s], e > s && g.length && (r = g[e - s - 1] || g[g.length - 1], n = n.substring(r)));
+ }
+ return r += this.$getStringScreenWidth(n, t)[1], this.$useWrapMode && r >= i && (r = i - 1),
+ p ? p.idxToPosition(r) : {
+ row: o,
+ column: r
+ };
+ }, this.documentToScreenPosition = function(e, t) {
+ if ("undefined" == typeof t) var n = this.$clipPositionToDocument(e.row, e.column); else n = this.$clipPositionToDocument(e, t);
+ e = n.row, t = n.column;
+ var i = 0, o = null, r = null;
+ r = this.getFoldAt(e, t, 1), r && (e = r.start.row, t = r.start.column);
+ var s, a = 0, l = this.$docRowCache, c = this.$getRowCacheIndex(l, e), u = l.length;
+ if (u && c >= 0) var a = l[c], i = this.$screenRowCache[c], d = e > l[u - 1]; else var d = !u;
+ for (var h = this.getNextFoldLine(a), p = h ? h.start.row : 1/0; e > a; ) {
+ if (a >= p) {
+ if (s = h.end.row + 1, s > e) break;
+ h = this.getNextFoldLine(s, h), p = h ? h.start.row : 1/0;
+ } else s = a + 1;
+ i += this.getRowLength(a), a = s, d && (this.$docRowCache.push(a), this.$screenRowCache.push(i));
+ }
+ var f = "";
+ if (h && a >= p ? (f = this.getFoldDisplayLine(h, e, t), o = h.start.row) : (f = this.getLine(e).substring(0, t),
+ o = e), this.$useWrapMode) {
+ for (var g = this.$wrapData[o], m = 0; f.length >= g[m]; ) i++, m++;
+ f = f.substring(g[m - 1] || 0, f.length);
+ }
+ return {
+ row: i,
+ column: this.$getStringScreenWidth(f)[0]
+ };
+ }, this.documentToScreenColumn = function(e, t) {
+ return this.documentToScreenPosition(e, t).column;
+ }, this.documentToScreenRow = function(e, t) {
+ return this.documentToScreenPosition(e, t).row;
+ }, this.getScreenLength = function() {
+ var e = 0, t = null;
+ if (this.$useWrapMode) for (var n = this.$wrapData.length, i = 0, o = 0, t = this.$foldData[o++], r = t ? t.start.row : 1/0; n > i; ) e += this.$wrapData[i].length + 1,
+ i++, i > r && (i = t.end.row + 1, t = this.$foldData[o++], r = t ? t.start.row : 1/0); else {
+ e = this.getLength();
+ for (var s = this.$foldData, o = 0; o < s.length; o++) t = s[o], e -= t.end.row - t.start.row;
+ }
+ return e;
+ };
+ }).call(h.prototype), e("./edit_session/folding").Folding.call(h.prototype), e("./edit_session/bracket_match").BracketMatch.call(h.prototype),
+ o.defineOptions(h.prototype, "session", {
+ wrap: {
+ set: function(e) {
+ if (e && "off" != e ? "free" == e ? e = !0 : "printMargin" == e ? e = -1 : "string" == typeof e && (e = parseInt(e, 10) || !1) : e = !1,
+ this.$wrap != e) {
+ if (e) {
+ var t = "number" == typeof e ? e : null;
+ this.setWrapLimitRange(t, t), this.setUseWrapMode(!0);
+ } else this.setUseWrapMode(!1);
+ this.$wrap = e;
+ }
+ },
+ get: function() {
+ return this.getUseWrapMode() ? this.getWrapLimitRange().min || "free" : "off";
+ },
+ handlesSet: !0
+ },
+ firstLineNumber: {
+ set: function() {
+ this._emit("changeBreakpoint");
+ },
+ initialValue: 1
+ },
+ useWorker: {
+ set: function(e) {
+ this.$useWorker = e, this.$stopWorker(), e && this.$startWorker();
+ },
+ initialValue: !0
+ },
+ useSoftTabs: {
+ initialValue: !0
+ },
+ tabSize: {
+ set: function(e) {
+ isNaN(e) || this.$tabSize === e || (this.$modified = !0, this.$rowLengthCache = [],
+ this.$tabSize = e, this._emit("changeTabSize"));
+ },
+ initialValue: 4,
+ handlesSet: !0
+ },
+ overwrite: {
+ set: function() {
+ this._emit("changeOverwrite");
+ },
+ initialValue: !1
+ },
+ newLineMode: {
+ set: function(e) {
+ this.doc.setNewLineMode(e);
+ },
+ get: function() {
+ return this.doc.getNewLineMode();
+ },
+ handlesSet: !0
+ }
+ }), t.EditSession = h;
+}), define("ace/search", [ "require", "exports", "module", "./lib/lang", "./lib/oop", "./range" ], function(e, t) {
+ var n = e("./lib/lang"), i = e("./lib/oop"), o = e("./range").Range, r = function() {
+ this.$options = {};
+ };
+ (function() {
+ this.set = function(e) {
+ return i.mixin(this.$options, e), this;
+ }, this.getOptions = function() {
+ return n.copyObject(this.$options);
+ }, this.setOptions = function(e) {
+ this.$options = e;
+ }, this.find = function(e) {
+ var t = this.$matchIterator(e, this.$options);
+ if (!t) return !1;
+ var n = null;
+ return t.forEach(function(e, t, i) {
+ if (e.start) n = e; else {
+ var r = e.offset + (i || 0);
+ n = new o(t, r, t, r + e.length);
+ }
+ return !0;
+ }), n;
+ }, this.findAll = function(e) {
+ var t = this.$options;
+ if (!t.needle) return [];
+ this.$assembleRegExp(t);
+ var i = t.range, r = i ? e.getLines(i.start.row, i.end.row) : e.doc.getAllLines(), s = [], a = t.re;
+ if (t.$isMultiLine) for (var l = a.length, c = r.length - l, u = a.offset || 0; c >= u; u++) {
+ for (var d = 0; l > d && -1 != r[u + d].search(a[d]); d++) ;
+ var h = r[u], p = r[u + l - 1], f = h.match(a[0])[0].length, g = p.match(a[l - 1])[0].length;
+ s.push(new o(u, h.length - f, u + l - 1, g));
+ } else for (var m = 0; m < r.length; m++) for (var v = n.getMatchOffsets(r[m], a), d = 0; d < v.length; d++) {
+ var b = v[d];
+ s.push(new o(m, b.offset, m, b.offset + b.length));
+ }
+ if (i) {
+ for (var y = i.start.column, w = i.start.column, m = 0, d = s.length - 1; d > m && s[m].start.column < y && s[m].start.row == i.start.row; ) m++;
+ for (;d > m && s[d].end.column > w && s[d].end.row == i.end.row; ) d--;
+ for (s = s.slice(m, d + 1), m = 0, d = s.length; d > m; m++) s[m].start.row += i.start.row,
+ s[m].end.row += i.start.row;
+ }
+ return s;
+ }, this.replace = function(e, t) {
+ var n = this.$options, i = this.$assembleRegExp(n);
+ if (n.$isMultiLine) return t;
+ if (i) {
+ var o = i.exec(e);
+ if (!o || o[0].length != e.length) return null;
+ if (t = e.replace(i, t), n.preserveCase) {
+ t = t.split("");
+ for (var r = Math.min(e.length, e.length); r--; ) {
+ var s = e[r];
+ t[r] = s && s.toLowerCase() != s ? t[r].toUpperCase() : t[r].toLowerCase();
+ }
+ t = t.join("");
+ }
+ return t;
+ }
+ }, this.$matchIterator = function(e, t) {
+ var i = this.$assembleRegExp(t);
+ if (!i) return !1;
+ var r, s = this, a = t.backwards;
+ if (t.$isMultiLine) var l = i.length, c = function(t, n, s) {
+ var a = t.search(i[0]);
+ if (-1 != a) {
+ for (var c = 1; l > c; c++) if (t = e.getLine(n + c), -1 == t.search(i[c])) return;
+ var u = t.match(i[l - 1])[0].length, d = new o(n, a, n + l - 1, u);
+ return 1 == i.offset ? (d.start.row--, d.start.column = Number.MAX_VALUE) : s && (d.start.column += s),
+ r(d) ? !0 : void 0;
+ }
+ }; else if (a) var c = function(e, t, o) {
+ for (var s = n.getMatchOffsets(e, i), a = s.length - 1; a >= 0; a--) if (r(s[a], t, o)) return !0;
+ }; else var c = function(e, t, o) {
+ for (var s = n.getMatchOffsets(e, i), a = 0; a < s.length; a++) if (r(s[a], t, o)) return !0;
+ };
+ return {
+ forEach: function(n) {
+ r = n, s.$lineIterator(e, t).forEach(c);
+ }
+ };
+ }, this.$assembleRegExp = function(e, t) {
+ if (e.needle instanceof RegExp) return e.re = e.needle;
+ var i = e.needle;
+ if (!e.needle) return e.re = !1;
+ e.regExp || (i = n.escapeRegExp(i)), e.wholeWord && (i = "\\b" + i + "\\b");
+ var o = e.caseSensitive ? "g" : "gi";
+ if (e.$isMultiLine = !t && /[\n\r]/.test(i), e.$isMultiLine) return e.re = this.$assembleMultilineRegExp(i, o);
+ try {
+ var r = new RegExp(i, o);
+ } catch (s) {
+ r = !1;
+ }
+ return e.re = r;
+ }, this.$assembleMultilineRegExp = function(e, t) {
+ for (var n = e.replace(/\r\n|\r|\n/g, "$\n^").split("\n"), i = [], o = 0; o < n.length; o++) try {
+ i.push(new RegExp(n[o], t));
+ } catch (r) {
+ return !1;
+ }
+ return "" == n[0] ? (i.shift(), i.offset = 1) : i.offset = 0, i;
+ }, this.$lineIterator = function(e, t) {
+ var n = 1 == t.backwards, i = 0 != t.skipCurrent, o = t.range, r = t.start;
+ r || (r = o ? o[n ? "end" : "start"] : e.selection.getRange()), r.start && (r = r[i != n ? "end" : "start"]);
+ var s = o ? o.start.row : 0, a = o ? o.end.row : e.getLength() - 1, l = n ? function(n) {
+ var i = r.row, o = e.getLine(i).substring(0, r.column);
+ if (!n(o, i)) {
+ for (i--; i >= s; i--) if (n(e.getLine(i), i)) return;
+ if (0 != t.wrap) for (i = a, s = r.row; i >= s; i--) if (n(e.getLine(i), i)) return;
+ }
+ } : function(n) {
+ var i = r.row, o = e.getLine(i).substr(r.column);
+ if (!n(o, i, r.column)) {
+ for (i += 1; a >= i; i++) if (n(e.getLine(i), i)) return;
+ if (0 != t.wrap) for (i = s, a = r.row; a >= i; i++) if (n(e.getLine(i), i)) return;
+ }
+ };
+ return {
+ forEach: l
+ };
+ };
+ }).call(r.prototype), t.Search = r;
+}), define("ace/keyboard/hash_handler", [ "require", "exports", "module", "../lib/keys", "../lib/useragent" ], function(e, t) {
+ function n(e, t) {
+ this.platform = t || (o.isMac ? "mac" : "win"), this.commands = {}, this.commmandKeyBinding = {},
+ this.addCommands(e);
+ }
+ var i = e("../lib/keys"), o = e("../lib/useragent");
+ (function() {
+ this.addCommand = function(e) {
+ this.commands[e.name] && this.removeCommand(e), this.commands[e.name] = e, e.bindKey && this._buildKeyHash(e);
+ }, this.removeCommand = function(e) {
+ var t = "string" == typeof e ? e : e.name;
+ e = this.commands[t], delete this.commands[t];
+ var n = this.commmandKeyBinding;
+ for (var i in n) for (var o in n[i]) n[i][o] == e && delete n[i][o];
+ }, this.bindKey = function(e, t) {
+ if (e) {
+ if ("function" == typeof t) return this.addCommand({
+ exec: t,
+ bindKey: e,
+ name: t.name || e
+ }), void 0;
+ var n = this.commmandKeyBinding;
+ e.split("|").forEach(function(e) {
+ var i = this.parseKeys(e, t), o = i.hashId;
+ (n[o] || (n[o] = {}))[i.key] = t;
+ }, this);
+ }
+ }, this.addCommands = function(e) {
+ e && Object.keys(e).forEach(function(t) {
+ var n = e[t];
+ return "string" == typeof n ? this.bindKey(n, t) : ("function" == typeof n && (n = {
+ exec: n
+ }), n.name || (n.name = t), this.addCommand(n), void 0);
+ }, this);
+ }, this.removeCommands = function(e) {
+ Object.keys(e).forEach(function(t) {
+ this.removeCommand(e[t]);
+ }, this);
+ }, this.bindKeys = function(e) {
+ Object.keys(e).forEach(function(t) {
+ this.bindKey(t, e[t]);
+ }, this);
+ }, this._buildKeyHash = function(e) {
+ var t = e.bindKey;
+ if (t) {
+ var n = "string" == typeof t ? t : t[this.platform];
+ this.bindKey(n, e);
+ }
+ }, this.parseKeys = function(e) {
+ -1 != e.indexOf(" ") && (e = e.split(/\s+/).pop());
+ var t = e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e) {
+ return e;
+ }), n = t.pop(), o = i[n];
+ if (i.FUNCTION_KEYS[o]) n = i.FUNCTION_KEYS[o].toLowerCase(); else {
+ if (!t.length) return {
+ key: n,
+ hashId: -1
+ };
+ if (1 == t.length && "shift" == t[0]) return {
+ key: n.toUpperCase(),
+ hashId: -1
+ };
+ }
+ for (var r = 0, s = t.length; s--; ) {
+ var a = i.KEY_MODS[t[s]];
+ if (null == a) return "undefined" != typeof console && console.error("invalid modifier " + t[s] + " in " + e),
+ !1;
+ r |= a;
+ }
+ return {
+ key: n,
+ hashId: r
+ };
+ }, this.findKeyCommand = function(e, t) {
+ var n = this.commmandKeyBinding;
+ return n[e] && n[e][t];
+ }, this.handleKeyboard = function(e, t, n) {
+ return {
+ command: this.findKeyCommand(t, n)
+ };
+ };
+ }).call(n.prototype), t.HashHandler = n;
+}), define("ace/commands/command_manager", [ "require", "exports", "module", "../lib/oop", "../keyboard/hash_handler", "../lib/event_emitter" ], function(e, t) {
+ var n = e("../lib/oop"), i = e("../keyboard/hash_handler").HashHandler, o = e("../lib/event_emitter").EventEmitter, r = function(e, t) {
+ this.platform = e, this.commands = this.byName = {}, this.commmandKeyBinding = {},
+ this.addCommands(t), this.setDefaultHandler("exec", function(e) {
+ return e.command.exec(e.editor, e.args || {});
+ });
+ };
+ n.inherits(r, i), function() {
+ n.implement(this, o), this.exec = function(e, t, n) {
+ if ("string" == typeof e && (e = this.commands[e]), !e) return !1;
+ if (t && t.$readOnly && !e.readOnly) return !1;
+ var i = {
+ editor: t,
+ command: e,
+ args: n
+ }, o = this._emit("exec", i);
+ return this._signal("afterExec", i), o === !1 ? !1 : !0;
+ }, this.toggleRecording = function(e) {
+ return this.$inReplay ? void 0 : (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) {
+ this.macro.push([ e.command, e.args ]);
+ }.bind(this)), this.oldMacro = this.macro, this.macro = [], this.on("exec", this.$addCommandToMacro),
+ this.recording = !0));
+ }, this.replay = function(e) {
+ if (!this.$inReplay && this.macro) {
+ if (this.recording) return this.toggleRecording(e);
+ try {
+ this.$inReplay = !0, this.macro.forEach(function(t) {
+ "string" == typeof t ? this.exec(t, e) : this.exec(t[0], e, t[1]);
+ }, this);
+ } finally {
+ this.$inReplay = !1;
+ }
+ }
+ }, this.trimMacro = function(e) {
+ return e.map(function(e) {
+ return "string" != typeof e[0] && (e[0] = e[0].name), e[1] || (e = e[0]), e;
+ });
+ };
+ }.call(r.prototype), t.CommandManager = r;
+}), define("libs/ace_commands", [ "require", "exports", "module", "ace/lib/lang", "ace/config" ], function(e, t) {
+ function n(e, t) {
+ return {
+ win: e,
+ mac: t
+ };
+ }
+ var i = e("ace/lib/lang"), o = e("ace/config");
+ t.commands = [ {
+ name: "selectall",
+ bindKey: n("Ctrl-A", "Command-A"),
+ exec: function(e) {
+ e.selectAll();
+ },
+ readOnly: !0
+ }, {
+ name: "find",
+ bindKey: n("Ctrl-F", "Command-F"),
+ exec: function(e) {
+ o.loadModule("ace/ext/searchbox", function(t) {
+ t.Search(e);
+ });
+ },
+ readOnly: !0
+ }, {
+ name: "overwrite",
+ bindKey: "Insert",
+ exec: function(e) {
+ e.toggleOverwrite();
+ },
+ readOnly: !0
+ }, {
+ name: "selecttostart",
+ bindKey: n("Ctrl-Shift-Home", "Command-Shift-Up"),
+ exec: function(e) {
+ e.getSelection().selectFileStart();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotostart",
+ bindKey: n("Ctrl-Home", "Command-Home|Command-Up"),
+ exec: function(e) {
+ e.navigateFileStart();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectup",
+ bindKey: n("Shift-Up", "Shift-Up"),
+ exec: function(e) {
+ e.getSelection().selectUp();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "golineup",
+ bindKey: n("Up", "Up|Ctrl-P"),
+ exec: function(e, t) {
+ e.navigateUp(t.times);
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selecttoend",
+ bindKey: n("Ctrl-Shift-End", "Command-Shift-Down"),
+ exec: function(e) {
+ e.getSelection().selectFileEnd();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotoend",
+ bindKey: n("Ctrl-End", "Command-End|Command-Down"),
+ exec: function(e) {
+ e.navigateFileEnd();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectdown",
+ bindKey: n("Shift-Down", "Shift-Down"),
+ exec: function(e) {
+ e.getSelection().selectDown();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "golinedown",
+ bindKey: n("Down", "Down|Ctrl-N"),
+ exec: function(e, t) {
+ e.navigateDown(t.times);
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectwordleft",
+ bindKey: n("Ctrl-Shift-Left", "Option-Shift-Left"),
+ exec: function(e) {
+ e.getSelection().selectWordLeft();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotowordleft",
+ bindKey: n("Ctrl-Left", "Option-Left"),
+ exec: function(e) {
+ e.navigateWordLeft();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selecttolinestart",
+ bindKey: n("Alt-Shift-Left", "Command-Shift-Left"),
+ exec: function(e) {
+ e.getSelection().selectLineStart();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotolinestart",
+ bindKey: n("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
+ exec: function(e) {
+ e.navigateLineStart();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectleft",
+ bindKey: n("Shift-Left", "Shift-Left"),
+ exec: function(e) {
+ e.getSelection().selectLeft();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotoleft",
+ bindKey: n("Left", "Left|Ctrl-B"),
+ exec: function(e, t) {
+ e.navigateLeft(t.times);
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectwordright",
+ bindKey: n("Ctrl-Shift-Right", "Option-Shift-Right"),
+ exec: function(e) {
+ e.getSelection().selectWordRight();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotowordright",
+ bindKey: n("Ctrl-Right", "Option-Right"),
+ exec: function(e) {
+ e.navigateWordRight();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selecttolineend",
+ bindKey: n("Alt-Shift-Right", "Command-Shift-Right"),
+ exec: function(e) {
+ e.getSelection().selectLineEnd();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotolineend",
+ bindKey: n("Alt-Right|End", "Command-Right|End|Ctrl-E"),
+ exec: function(e) {
+ e.navigateLineEnd();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectright",
+ bindKey: n("Shift-Right", "Shift-Right"),
+ exec: function(e) {
+ e.getSelection().selectRight();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "gotoright",
+ bindKey: n("Right", "Right|Ctrl-F"),
+ exec: function(e, t) {
+ e.navigateRight(t.times);
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectpagedown",
+ bindKey: "Shift-PageDown",
+ exec: function(e) {
+ e.selectPageDown();
+ },
+ readOnly: !0
+ }, {
+ name: "pagedown",
+ bindKey: n(null, "Option-PageDown"),
+ exec: function(e) {
+ e.scrollPageDown();
+ },
+ readOnly: !0
+ }, {
+ name: "gotopagedown",
+ bindKey: n("PageDown", "PageDown|Ctrl-V"),
+ exec: function(e) {
+ e.gotoPageDown();
+ },
+ readOnly: !0
+ }, {
+ name: "selectpageup",
+ bindKey: "Shift-PageUp",
+ exec: function(e) {
+ e.selectPageUp();
+ },
+ readOnly: !0
+ }, {
+ name: "pageup",
+ bindKey: n(null, "Option-PageUp"),
+ exec: function(e) {
+ e.scrollPageUp();
+ },
+ readOnly: !0
+ }, {
+ name: "gotopageup",
+ bindKey: "PageUp",
+ exec: function(e) {
+ e.gotoPageUp();
+ },
+ readOnly: !0
+ }, {
+ name: "scrollup",
+ bindKey: n("Ctrl-Up", null),
+ exec: function(e) {
+ e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight);
+ },
+ readOnly: !0
+ }, {
+ name: "scrolldown",
+ bindKey: n("Ctrl-Down", null),
+ exec: function(e) {
+ e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight);
+ },
+ readOnly: !0
+ }, {
+ name: "selectlinestart",
+ bindKey: "Shift-Home",
+ exec: function(e) {
+ e.getSelection().selectLineStart();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selectlineend",
+ bindKey: "Shift-End",
+ exec: function(e) {
+ e.getSelection().selectLineEnd();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "togglerecording",
+ bindKey: n("Ctrl-Alt-E", "Command-Option-E"),
+ exec: function(e) {
+ e.commands.toggleRecording(e);
+ },
+ readOnly: !0
+ }, {
+ name: "replaymacro",
+ bindKey: n("Ctrl-Shift-E", "Command-Shift-E"),
+ exec: function(e) {
+ e.commands.replay(e);
+ },
+ readOnly: !0
+ }, {
+ name: "jumptomatching",
+ bindKey: n("Ctrl-P", "Ctrl-Shift-P"),
+ exec: function(e) {
+ e.jumpToMatching();
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "selecttomatching",
+ bindKey: n("Ctrl-Shift-P", null),
+ exec: function(e) {
+ e.jumpToMatching(!0);
+ },
+ multiSelectAction: "forEach",
+ readOnly: !0
+ }, {
+ name: "cut",
+ exec: function(e) {
+ var t = e.getSelectionRange();
+ e._emit("cut", t), e.selection.isEmpty() || (e.session.remove(t), e.clearSelection());
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "removeline",
+ bindKey: n("Ctrl-D", "Command-D"),
+ exec: function(e) {
+ e.removeLines();
+ },
+ multiSelectAction: "forEachLine"
+ }, {
+ name: "duplicateSelection",
+ bindKey: n("Ctrl-Shift-D", "Command-Shift-D"),
+ exec: function(e) {
+ e.duplicateSelection();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "sortlines",
+ bindKey: n("Ctrl-Alt-S", "Command-Alt-S"),
+ exec: function(e) {
+ e.sortLines();
+ },
+ multiSelectAction: "forEachLine"
+ }, {
+ name: "togglecomment",
+ bindKey: n("Ctrl-/", "Command-/"),
+ exec: function(e) {
+ e.toggleCommentLines();
+ },
+ multiSelectAction: "forEachLine"
+ }, {
+ name: "toggleBlockComment",
+ bindKey: n("Ctrl-Shift-/", "Command-Shift-/"),
+ exec: function(e) {
+ e.toggleBlockComment();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "modifyNumberUp",
+ bindKey: n("Ctrl-Shift-Up", "Alt-Shift-Up"),
+ exec: function(e) {
+ e.modifyNumber(1);
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "modifyNumberDown",
+ bindKey: n("Ctrl-Shift-Down", "Alt-Shift-Down"),
+ exec: function(e) {
+ e.modifyNumber(-1);
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "replace",
+ bindKey: n("Ctrl-H", "Command-Option-F"),
+ exec: function(e) {
+ o.loadModule("ace/ext/searchbox", function(t) {
+ t.Search(e, !0);
+ });
+ }
+ }, {
+ name: "undo",
+ bindKey: n("Ctrl-Z", "Command-Z"),
+ exec: function(e) {
+ e.undo();
+ }
+ }, {
+ name: "redo",
+ bindKey: n("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
+ exec: function(e) {
+ e.redo();
+ }
+ }, {
+ name: "copylinesup",
+ bindKey: n("Alt-Shift-Up", "Command-Option-Up"),
+ exec: function(e) {
+ e.copyLinesUp();
+ }
+ }, {
+ name: "movelinesup",
+ bindKey: n("Alt-Up", "Option-Up"),
+ exec: function(e) {
+ e.moveLinesUp();
+ }
+ }, {
+ name: "copylinesdown",
+ bindKey: n("Alt-Shift-Down", "Command-Option-Down"),
+ exec: function(e) {
+ e.copyLinesDown();
+ }
+ }, {
+ name: "movelinesdown",
+ bindKey: n("Alt-Down", "Option-Down"),
+ exec: function(e) {
+ e.moveLinesDown();
+ }
+ }, {
+ name: "del",
+ bindKey: n("Delete", "Delete|Ctrl-D"),
+ exec: function(e) {
+ e.remove("right");
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "backspace",
+ bindKey: n("Command-Backspace|Option-Backspace|Shift-Backspace|Backspace", "Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
+ exec: function(e) {
+ e.remove("left");
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "removetolinestart",
+ bindKey: n("Alt-Backspace", "Command-Backspace"),
+ exec: function(e) {
+ e.removeToLineStart();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "removetolineend",
+ bindKey: n("Alt-Delete", "Ctrl-K"),
+ exec: function(e) {
+ e.removeToLineEnd();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "removewordleft",
+ bindKey: n("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
+ exec: function(e) {
+ e.removeWordLeft();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "removewordright",
+ bindKey: n("Ctrl-Delete", "Alt-Delete"),
+ exec: function(e) {
+ e.removeWordRight();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "outdent",
+ bindKey: n("Shift-Tab", "Shift-Tab"),
+ exec: function(e) {
+ e.blockOutdent();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "indent",
+ bindKey: n("Tab", "Tab"),
+ exec: function(e) {
+ e.indent();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "insertstring",
+ exec: function(e, t) {
+ e.insert(t);
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "inserttext",
+ exec: function(e, t) {
+ e.insert(i.stringRepeat(t.text || "", t.times || 1));
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "splitline",
+ bindKey: n(null, "Ctrl-O"),
+ exec: function(e) {
+ e.splitLine();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "transposeletters",
+ bindKey: n("Ctrl-T", "Ctrl-T"),
+ exec: function(e) {
+ e.transposeLetters();
+ },
+ multiSelectAction: function(e) {
+ e.transposeSelections(1);
+ }
+ }, {
+ name: "touppercase",
+ bindKey: n("Ctrl-U", "Ctrl-U"),
+ exec: function(e) {
+ e.toUpperCase();
+ },
+ multiSelectAction: "forEach"
+ }, {
+ name: "tolowercase",
+ bindKey: n("Ctrl-Shift-U", "Ctrl-Shift-U"),
+ exec: function(e) {
+ e.toLowerCase();
+ },
+ multiSelectAction: "forEach"
+ } ];
+}), define("ace/editor", [ "require", "exports", "module", "./lib/fixoldbrowsers", "./lib/oop", "./lib/dom", "./lib/lang", "./lib/useragent", "./keyboard/textinput", "./mouse/mouse_handler", "./mouse/fold_handler", "./keyboard/keybinding", "./edit_session", "./search", "./range", "./lib/event_emitter", "./commands/command_manager", "./commands/default_commands", "./config" ], function(e, t) {
+ e("./lib/fixoldbrowsers");
+ var n = e("./lib/oop"), i = e("./lib/dom"), o = e("./lib/lang"), r = e("./lib/useragent"), s = e("./keyboard/textinput").TextInput, a = e("./mouse/mouse_handler").MouseHandler, l = e("./mouse/fold_handler").FoldHandler, c = e("./keyboard/keybinding").KeyBinding, u = e("./edit_session").EditSession, d = e("./search").Search, h = e("./range").Range, p = e("./lib/event_emitter").EventEmitter, f = e("./commands/command_manager").CommandManager, g = e("./commands/default_commands").commands, m = e("./config"), v = function(e, t) {
+ var n = e.getContainerElement();
+ this.container = n, this.renderer = e, this.commands = new f(r.isMac ? "mac" : "win", g),
+ this.textInput = new s(e.getTextAreaContainer(), this), this.renderer.textarea = this.textInput.getElement(),
+ this.keyBinding = new c(this), this.$mouseHandler = new a(this), new l(this), this.$blockScrolling = 0,
+ this.$search = new d().set({
+ wrap: !0
+ }), this.setSession(t || new u("")), m.resetOptions(this), m._emit("editor", this);
+ };
+ (function() {
+ n.implement(this, p), this.setKeyboardHandler = function(e) {
+ if (e) if ("string" == typeof e) {
+ this.$keybindingId = e;
+ var t = this;
+ m.loadModule([ "keybinding", e ], function(n) {
+ t.$keybindingId == e && t.keyBinding.setKeyboardHandler(n && n.handler);
+ });
+ } else delete this.$keybindingId, this.keyBinding.setKeyboardHandler(e); else this.keyBinding.setKeyboardHandler(null);
+ }, this.getKeyboardHandler = function() {
+ return this.keyBinding.getKeyboardHandler();
+ }, this.setSession = function(e) {
+ if (this.session != e) {
+ if (this.session) {
+ var t = this.session;
+ this.session.removeEventListener("change", this.$onDocumentChange), this.session.removeEventListener("changeMode", this.$onChangeMode),
+ this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate), this.session.removeEventListener("changeTabSize", this.$onChangeTabSize),
+ this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit), this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode),
+ this.session.removeEventListener("onChangeFold", this.$onChangeFold), this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker),
+ this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker),
+ this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint),
+ this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation),
+ this.session.removeEventListener("changeOverwrite", this.$onCursorChange), this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange),
+ this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange);
+ var n = this.session.getSelection();
+ n.removeEventListener("changeCursor", this.$onCursorChange), n.removeEventListener("changeSelection", this.$onSelectionChange);
+ }
+ this.session = e, this.$onDocumentChange = this.onDocumentChange.bind(this), e.addEventListener("change", this.$onDocumentChange),
+ this.renderer.setSession(e), this.$onChangeMode = this.onChangeMode.bind(this),
+ e.addEventListener("changeMode", this.$onChangeMode), this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this),
+ e.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate), this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer),
+ e.addEventListener("changeTabSize", this.$onChangeTabSize), this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this),
+ e.addEventListener("changeWrapLimit", this.$onChangeWrapLimit), this.$onChangeWrapMode = this.onChangeWrapMode.bind(this),
+ e.addEventListener("changeWrapMode", this.$onChangeWrapMode), this.$onChangeFold = this.onChangeFold.bind(this),
+ e.addEventListener("changeFold", this.$onChangeFold), this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this),
+ this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker), this.$onChangeBackMarker = this.onChangeBackMarker.bind(this),
+ this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker), this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this),
+ this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint), this.$onChangeAnnotation = this.onChangeAnnotation.bind(this),
+ this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation), this.$onCursorChange = this.onCursorChange.bind(this),
+ this.session.addEventListener("changeOverwrite", this.$onCursorChange), this.$onScrollTopChange = this.onScrollTopChange.bind(this),
+ this.session.addEventListener("changeScrollTop", this.$onScrollTopChange), this.$onScrollLeftChange = this.onScrollLeftChange.bind(this),
+ this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange), this.selection = e.getSelection(),
+ this.selection.addEventListener("changeCursor", this.$onCursorChange), this.$onSelectionChange = this.onSelectionChange.bind(this),
+ this.selection.addEventListener("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._emit("changeSession", {
+ session: e,
+ oldSession: t
+ });
+ }
+ }, this.getSession = function() {
+ return this.session;
+ }, this.setValue = function(e, t) {
+ return this.session.doc.setValue(e), t ? 1 == t ? this.navigateFileEnd() : -1 == t && this.navigateFileStart() : this.selectAll(),
+ e;
+ }, this.getValue = function() {
+ return this.session.getValue();
+ }, this.getSelection = function() {
+ return this.selection;
+ }, this.resize = function(e) {
+ this.renderer.onResize(e);
+ }, this.setTheme = function(e) {
+ this.renderer.setTheme(e);
+ }, this.getTheme = function() {
+ return this.renderer.getTheme();
+ }, this.setStyle = function(e) {
+ this.renderer.setStyle(e);
+ }, this.unsetStyle = function(e) {
+ this.renderer.unsetStyle(e);
+ }, this.getFontSize = function() {
+ return this.getOption("fontSize") || i.computedStyle(this.container, "fontSize");
+ }, this.setFontSize = function(e) {
+ this.setOption("fontSize", e);
+ }, this.$highlightBrackets = function() {
+ if (this.session.$bracketHighlight && (this.session.removeMarker(this.session.$bracketHighlight),
+ this.session.$bracketHighlight = null), !this.$highlightPending) {
+ var e = this;
+ this.$highlightPending = !0, setTimeout(function() {
+ e.$highlightPending = !1;
+ var t = e.session.findMatchingBracket(e.getCursorPosition());
+ if (t) var n = new h(t.row, t.column, t.row, t.column + 1); else if (e.session.$mode.getMatching) var n = e.session.$mode.getMatching(e.session);
+ n && (e.session.$bracketHighlight = e.session.addMarker(n, "ace_bracket", "text"));
+ }, 50);
+ }
+ }, this.focus = function() {
+ var e = this;
+ setTimeout(function() {
+ e.textInput.focus();
+ }), this.textInput.focus();
+ }, this.isFocused = function() {
+ return this.textInput.isFocused();
+ }, this.blur = function() {
+ this.textInput.blur();
+ }, this.onFocus = function() {
+ this.$isFocused || (this.$isFocused = !0, this.renderer.showCursor(), this.renderer.visualizeFocus(),
+ this._emit("focus"));
+ }, this.onBlur = function() {
+ this.$isFocused && (this.$isFocused = !1, this.renderer.hideCursor(), this.renderer.visualizeBlur(),
+ this._emit("blur"));
+ }, this.$cursorChange = function() {
+ this.renderer.updateCursor();
+ }, this.onDocumentChange = function(e) {
+ var t, n = e.data, i = n.range;
+ t = i.start.row == i.end.row && "insertLines" != n.action && "removeLines" != n.action ? i.end.row : 1/0,
+ this.renderer.updateLines(i.start.row, t), this._emit("change", e), this.$cursorChange();
+ }, this.onTokenizerUpdate = function(e) {
+ var t = e.data;
+ this.renderer.updateLines(t.first, t.last);
+ }, this.onScrollTopChange = function() {
+ this.renderer.scrollToY(this.session.getScrollTop());
+ }, this.onScrollLeftChange = function() {
+ this.renderer.scrollToX(this.session.getScrollLeft());
+ }, this.onCursorChange = function() {
+ this.$cursorChange(), this.$blockScrolling || this.renderer.scrollCursorIntoView(),
+ this.$highlightBrackets(), this.$updateHighlightActiveLine(), this._emit("changeSelection");
+ }, this.$updateHighlightActiveLine = function() {
+ var e, t = this.getSession();
+ if (this.$highlightActiveLine && ("line" == this.$selectionStyle && this.selection.isMultiLine() || (e = this.getCursorPosition())),
+ t.$highlightLineMarker && !e) t.removeMarker(t.$highlightLineMarker.id), t.$highlightLineMarker = null; else if (!t.$highlightLineMarker && e) {
+ var n = new h(e.row, e.column, e.row, 1/0);
+ n.id = t.addMarker(n, "ace_active-line", "screenLine"), t.$highlightLineMarker = n;
+ } else e && (t.$highlightLineMarker.start.row = e.row, t.$highlightLineMarker.end.row = e.row,
+ t.$highlightLineMarker.start.column = e.column, t._emit("changeBackMarker"));
+ }, this.onSelectionChange = function() {
+ var e = this.session;
+ if (e.$selectionMarker && e.removeMarker(e.$selectionMarker), e.$selectionMarker = null,
+ this.selection.isEmpty()) this.$updateHighlightActiveLine(); else {
+ var t = this.selection.getRange(), n = this.getSelectionStyle();
+ e.$selectionMarker = e.addMarker(t, "ace_selection", n);
+ }
+ var i = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
+ this.session.highlight(i), this._emit("changeSelection");
+ }, this.$getSelectionHighLightRegexp = function() {
+ var e = this.session, t = this.getSelectionRange();
+ if (!t.isEmpty() && !t.isMultiLine()) {
+ var n = t.start.column - 1, i = t.end.column + 1, o = e.getLine(t.start.row), r = o.length, s = o.substring(Math.max(n, 0), Math.min(i, r));
+ if (!(n >= 0 && /^[\w\d]/.test(s) || r >= i && /[\w\d]$/.test(s)) && (s = o.substring(t.start.column, t.end.column),
+ /^[\w\d]+$/.test(s))) {
+ var a = this.$search.$assembleRegExp({
+ wholeWord: !0,
+ caseSensitive: !0,
+ needle: s
+ });
+ return a;
+ }
+ }
+ }, this.onChangeFrontMarker = function() {
+ this.renderer.updateFrontMarkers();
+ }, this.onChangeBackMarker = function() {
+ this.renderer.updateBackMarkers();
+ }, this.onChangeBreakpoint = function() {
+ this.renderer.updateBreakpoints();
+ }, this.onChangeAnnotation = function() {
+ this.renderer.setAnnotations(this.session.getAnnotations());
+ }, this.onChangeMode = function(e) {
+ this.renderer.updateText(), this._emit("changeMode", e);
+ }, this.onChangeWrapLimit = function() {
+ this.renderer.updateFull();
+ }, this.onChangeWrapMode = function() {
+ this.renderer.onResize(!0);
+ }, this.onChangeFold = function() {
+ this.$updateHighlightActiveLine(), this.renderer.updateFull();
+ }, this.getCopyText = function() {
+ var e = "";
+ return this.selection.isEmpty() || (e = this.session.getTextRange(this.getSelectionRange())),
+ this._emit("copy", e), e;
+ }, this.onCopy = function() {
+ this.commands.exec("copy", this);
+ }, this.onCut = function() {
+ this.commands.exec("cut", this);
+ }, this.onPaste = function(e) {
+ this.$readOnly || (this._emit("paste", e), this.insert(e));
+ }, this.execCommand = function(e, t) {
+ this.commands.exec(e, this, t);
+ }, this.insert = function(e) {
+ var t = this.session, n = t.getMode(), i = this.getCursorPosition();
+ if (this.getBehavioursEnabled()) {
+ var o = n.transformAction(t.getState(i.row), "insertion", this, t, e);
+ o && (e = o.text);
+ }
+ if (e = e.replace(" ", this.session.getTabString()), this.selection.isEmpty()) {
+ if (this.session.getOverwrite()) {
+ var r = new h.fromPoints(i, i);
+ r.end.column += e.length, this.session.remove(r);
+ }
+ } else i = this.session.remove(this.getSelectionRange()), this.clearSelection();
+ this.clearSelection();
+ var s = i.column, a = t.getState(i.row), l = t.getLine(i.row), c = n.checkOutdent(a, l, e), u = t.insert(i, e);
+ if (o && o.selection && (2 == o.selection.length ? this.selection.setSelectionRange(new h(i.row, s + o.selection[0], i.row, s + o.selection[1])) : this.selection.setSelectionRange(new h(i.row + o.selection[0], o.selection[1], i.row + o.selection[2], o.selection[3]))),
+ t.getDocument().isNewLine(e)) {
+ var d = n.getNextLineIndent(a, l.slice(0, i.column), t.getTabString());
+ this.moveCursorTo(i.row + 1, 0);
+ for (var p = t.getTabSize(), f = Number.MAX_VALUE, g = i.row + 1; g <= u.row; ++g) {
+ var m = 0;
+ l = t.getLine(g);
+ for (var v = 0; v < l.length; ++v) if (" " == l.charAt(v)) m += p; else {
+ if (" " != l.charAt(v)) break;
+ m += 1;
+ }
+ /[^\s]/.test(l) && (f = Math.min(m, f));
+ }
+ for (var g = i.row + 1; g <= u.row; ++g) {
+ var b = f;
+ l = t.getLine(g);
+ for (var v = 0; v < l.length && b > 0; ++v) " " == l.charAt(v) ? b -= p : " " == l.charAt(v) && (b -= 1);
+ t.remove(new h(g, 0, g, v));
+ }
+ t.indentRows(i.row + 1, u.row, d);
+ }
+ c && n.autoOutdent(a, t, i.row);
+ }, this.onTextInput = function(e) {
+ this.keyBinding.onTextInput(e);
+ }, this.onCommandKey = function(e, t, n) {
+ this.keyBinding.onCommandKey(e, t, n);
+ }, this.setOverwrite = function(e) {
+ this.session.setOverwrite(e);
+ }, this.getOverwrite = function() {
+ return this.session.getOverwrite();
+ }, this.toggleOverwrite = function() {
+ this.session.toggleOverwrite();
+ }, this.setScrollSpeed = function(e) {
+ this.setOption("scrollSpeed", e);
+ }, this.getScrollSpeed = function() {
+ return this.getOption("scrollSpeed");
+ }, this.setDragDelay = function(e) {
+ this.setOption("dragDelay", e);
+ }, this.getDragDelay = function() {
+ return this.getOption("dragDelay");
+ }, this.setSelectionStyle = function(e) {
+ this.setOption("selectionStyle", e);
+ }, this.getSelectionStyle = function() {
+ return this.getOption("selectionStyle");
+ }, this.setHighlightActiveLine = function(e) {
+ this.setOption("highlightActiveLine", e);
+ }, this.getHighlightActiveLine = function() {
+ return this.getOption("highlightActiveLine");
+ }, this.setHighlightGutterLine = function(e) {
+ this.setOption("highlightGutterLine", e);
+ }, this.getHighlightGutterLine = function() {
+ return this.getOption("highlightGutterLine");
+ }, this.setHighlightSelectedWord = function(e) {
+ this.setOption("highlightSelectedWord", e);
+ }, this.getHighlightSelectedWord = function() {
+ return this.$highlightSelectedWord;
+ }, this.setAnimatedScroll = function(e) {
+ this.renderer.setAnimatedScroll(e);
+ }, this.getAnimatedScroll = function() {
+ return this.renderer.getAnimatedScroll();
+ }, this.setShowInvisibles = function(e) {
+ this.renderer.setShowInvisibles(e);
+ }, this.getShowInvisibles = function() {
+ return this.renderer.getShowInvisibles();
+ }, this.setDisplayIndentGuides = function(e) {
+ this.renderer.setDisplayIndentGuides(e);
+ }, this.getDisplayIndentGuides = function() {
+ return this.renderer.getDisplayIndentGuides();
+ }, this.setShowPrintMargin = function(e) {
+ this.renderer.setShowPrintMargin(e);
+ }, this.getShowPrintMargin = function() {
+ return this.renderer.getShowPrintMargin();
+ }, this.setPrintMarginColumn = function(e) {
+ this.renderer.setPrintMarginColumn(e);
+ }, this.getPrintMarginColumn = function() {
+ return this.renderer.getPrintMarginColumn();
+ }, this.setReadOnly = function(e) {
+ this.setOption("readOnly", e);
+ }, this.getReadOnly = function() {
+ return this.getOption("readOnly");
+ }, this.setBehavioursEnabled = function(e) {
+ this.setOption("behavioursEnabled", e);
+ }, this.getBehavioursEnabled = function() {
+ return this.getOption("behavioursEnabled");
+ }, this.setWrapBehavioursEnabled = function(e) {
+ this.setOption("wrapBehavioursEnabled", e);
+ }, this.getWrapBehavioursEnabled = function() {
+ return this.getOption("wrapBehavioursEnabled");
+ }, this.setShowFoldWidgets = function(e) {
+ this.setOption("showFoldWidgets", e);
+ }, this.getShowFoldWidgets = function() {
+ return this.getOption("showFoldWidgets");
+ }, this.setFadeFoldWidgets = function(e) {
+ this.setOption("fadeFoldWidgets", e);
+ }, this.getFadeFoldWidgets = function() {
+ return this.getOption("fadeFoldWidgets");
+ }, this.remove = function(e) {
+ this.selection.isEmpty() && ("left" == e ? this.selection.selectLeft() : this.selection.selectRight());
+ var t = this.getSelectionRange();
+ if (this.getBehavioursEnabled()) {
+ var n = this.session, i = n.getState(t.start.row), o = n.getMode().transformAction(i, "deletion", this, n, t);
+ o && (t = o);
+ }
+ this.session.remove(t), this.clearSelection();
+ }, this.removeWordRight = function() {
+ this.selection.isEmpty() && this.selection.selectWordRight(), this.session.remove(this.getSelectionRange()),
+ this.clearSelection();
+ }, this.removeWordLeft = function() {
+ this.selection.isEmpty() && this.selection.selectWordLeft(), this.session.remove(this.getSelectionRange()),
+ this.clearSelection();
+ }, this.removeToLineStart = function() {
+ this.selection.isEmpty() && this.selection.selectLineStart(), this.session.remove(this.getSelectionRange()),
+ this.clearSelection();
+ }, this.removeToLineEnd = function() {
+ this.selection.isEmpty() && this.selection.selectLineEnd();
+ var e = this.getSelectionRange();
+ 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();
+ }, this.splitLine = function() {
+ this.selection.isEmpty() || (this.session.remove(this.getSelectionRange()), this.clearSelection());
+ var e = this.getCursorPosition();
+ this.insert("\n"), this.moveCursorToPosition(e);
+ }, this.transposeLetters = function() {
+ if (this.selection.isEmpty()) {
+ var e = this.getCursorPosition(), t = e.column;
+ if (0 !== t) {
+ var n, i, o = this.session.getLine(e.row);
+ t < o.length ? (n = o.charAt(t) + o.charAt(t - 1), i = new h(e.row, t - 1, e.row, t + 1)) : (n = o.charAt(t - 1) + o.charAt(t - 2),
+ i = new h(e.row, t - 2, e.row, t)), this.session.replace(i, n);
+ }
+ }
+ }, this.toLowerCase = function() {
+ var e = this.getSelectionRange();
+ this.selection.isEmpty() && this.selection.selectWord();
+ var t = this.getSelectionRange(), n = this.session.getTextRange(t);
+ this.session.replace(t, n.toLowerCase()), this.selection.setSelectionRange(e);
+ }, this.toUpperCase = function() {
+ var e = this.getSelectionRange();
+ this.selection.isEmpty() && this.selection.selectWord();
+ var t = this.getSelectionRange(), n = this.session.getTextRange(t);
+ this.session.replace(t, n.toUpperCase()), this.selection.setSelectionRange(e);
+ }, this.indent = function() {
+ var e = this.session, t = this.getSelectionRange();
+ if (!(t.start.row < t.end.row || t.start.column < t.end.column)) {
+ var n;
+ if (this.session.getUseSoftTabs()) {
+ var i = e.getTabSize(), r = this.getCursorPosition(), s = e.documentToScreenColumn(r.row, r.column), a = i - s % i;
+ n = o.stringRepeat(" ", a);
+ } else n = " ";
+ return this.insert(n);
+ }
+ var l = this.$getSelectedRows();
+ e.indentRows(l.first, l.last, " ");
+ }, this.blockIndent = function() {
+ var e = this.$getSelectedRows();
+ this.session.indentRows(e.first, e.last, " ");
+ }, this.blockOutdent = function() {
+ var e = this.session.getSelection();
+ this.session.outdentRows(e.getRange());
+ }, this.sortLines = function() {
+ var e = this.$getSelectedRows(), t = this.session, n = [];
+ for (o = e.first; o <= e.last; o++) n.push(t.getLine(o));
+ n.sort(function(e, t) {
+ return e.toLowerCase() < t.toLowerCase() ? -1 : e.toLowerCase() > t.toLowerCase() ? 1 : 0;
+ });
+ for (var i = new h(0, 0, 0, 0), o = e.first; o <= e.last; o++) {
+ var r = t.getLine(o);
+ i.start.row = o, i.end.row = o, i.end.column = r.length, t.replace(i, n[o - e.first]);
+ }
+ }, this.toggleCommentLines = function() {
+ var e = this.session.getState(this.getCursorPosition().row), t = this.$getSelectedRows();
+ this.session.getMode().toggleCommentLines(e, this.session, t.first, t.last);
+ }, this.toggleBlockComment = function() {
+ var e = this.getCursorPosition(), t = this.session.getState(e.row), n = this.getSelectionRange();
+ this.session.getMode().toggleBlockComment(t, this.session, n, e);
+ }, this.getNumberAt = function(e, t) {
+ var n = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
+ n.lastIndex = 0;
+ for (var i = this.session.getLine(e); n.lastIndex < t; ) {
+ var o = n.exec(i);
+ if (o.index <= t && o.index + o[0].length >= t) {
+ var r = {
+ value: o[0],
+ start: o.index,
+ end: o.index + o[0].length
+ };
+ return r;
+ }
+ }
+ return null;
+ }, this.modifyNumber = function(e) {
+ var t = this.selection.getCursor().row, n = this.selection.getCursor().column, i = new h(t, n - 1, t, n), o = this.session.getTextRange(i);
+ if (!isNaN(parseFloat(o)) && isFinite(o)) {
+ var r = this.getNumberAt(t, n);
+ if (r) {
+ var s = r.value.indexOf(".") >= 0 ? r.start + r.value.indexOf(".") + 1 : r.end, a = r.start + r.value.length - s, l = parseFloat(r.value);
+ l *= Math.pow(10, a), e *= s !== r.end && s > n ? Math.pow(10, r.end - n - 1) : Math.pow(10, r.end - n),
+ l += e, l /= Math.pow(10, a);
+ var c = l.toFixed(a), u = new h(t, r.start, t, r.end);
+ this.session.replace(u, c), this.moveCursorTo(t, Math.max(r.start + 1, n + c.length - r.value.length));
+ }
+ }
+ }, this.removeLines = function() {
+ var e, t = this.$getSelectedRows();
+ e = 0 === t.first || t.last + 1 < this.session.getLength() ? new h(t.first, 0, t.last + 1, 0) : new h(t.first - 1, this.session.getLine(t.first - 1).length, t.last, this.session.getLine(t.last).length),
+ this.session.remove(e), this.clearSelection();
+ }, this.duplicateSelection = function() {
+ var e = this.selection, t = this.session, n = e.getRange(), i = e.isBackwards();
+ if (n.isEmpty()) {
+ var o = n.start.row;
+ t.duplicateLines(o, o);
+ } else {
+ var r = i ? n.start : n.end, s = t.insert(r, t.getTextRange(n), !1);
+ n.start = r, n.end = s, e.setSelectionRange(n, i);
+ }
+ }, this.moveLinesDown = function() {
+ this.$moveLines(function(e, t) {
+ return this.session.moveLinesDown(e, t);
+ });
+ }, this.moveLinesUp = function() {
+ this.$moveLines(function(e, t) {
+ return this.session.moveLinesUp(e, t);
+ });
+ }, this.moveText = function(e, t) {
+ return this.session.moveText(e, t);
+ }, this.copyLinesUp = function() {
+ this.$moveLines(function(e, t) {
+ return this.session.duplicateLines(e, t), 0;
+ });
+ }, this.copyLinesDown = function() {
+ this.$moveLines(function(e, t) {
+ return this.session.duplicateLines(e, t);
+ });
+ }, this.$moveLines = function(e) {
+ var t = this.selection;
+ if (!t.inMultiSelectMode || this.inVirtualSelectionMode) {
+ var n = t.toOrientedRange(), i = this.$getSelectedRows(n), o = e.call(this, i.first, i.last);
+ n.moveBy(o, 0), t.fromOrientedRange(n);
+ } else {
+ var r = t.rangeList.ranges;
+ t.rangeList.detach(this.session);
+ for (var s = r.length; s--; ) {
+ for (var a = s, i = r[s].collapseRows(), l = i.end.row, c = i.start.row; s--; ) {
+ var i = r[s].collapseRows();
+ if (!(c - i.end.row <= 1)) break;
+ c = i.end.row;
+ }
+ s++;
+ for (var o = e.call(this, c, l); a >= s; ) r[a].moveBy(o, 0), a--;
+ }
+ t.fromOrientedRange(t.ranges[0]), t.rangeList.attach(this.session);
+ }
+ }, this.$getSelectedRows = function() {
+ var e = this.getSelectionRange().collapseRows();
+ return {
+ first: e.start.row,
+ last: e.end.row
+ };
+ }, this.onCompositionStart = function() {
+ this.renderer.showComposition(this.getCursorPosition());
+ }, this.onCompositionUpdate = function(e) {
+ this.renderer.setCompositionText(e);
+ }, this.onCompositionEnd = function() {
+ this.renderer.hideComposition();
+ }, this.getFirstVisibleRow = function() {
+ return this.renderer.getFirstVisibleRow();
+ }, this.getLastVisibleRow = function() {
+ return this.renderer.getLastVisibleRow();
+ }, this.isRowVisible = function(e) {
+ return e >= this.getFirstVisibleRow() && e <= this.getLastVisibleRow();
+ }, this.isRowFullyVisible = function(e) {
+ return e >= this.renderer.getFirstFullyVisibleRow() && e <= this.renderer.getLastFullyVisibleRow();
+ }, this.$getVisibleRowCount = function() {
+ return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
+ }, this.$moveByPage = function(e, t) {
+ var n = this.renderer, i = this.renderer.layerConfig, o = e * Math.floor(i.height / i.lineHeight);
+ this.$blockScrolling++, 1 == t ? this.selection.$moveSelection(function() {
+ this.moveCursorBy(o, 0);
+ }) : 0 == t && (this.selection.moveCursorBy(o, 0), this.selection.clearSelection()),
+ this.$blockScrolling--;
+ var r = n.scrollTop;
+ n.scrollBy(0, o * i.lineHeight), null != t && n.scrollCursorIntoView(null, .5),
+ n.animateScrolling(r);
+ }, this.selectPageDown = function() {
+ this.$moveByPage(1, !0);
+ }, this.selectPageUp = function() {
+ this.$moveByPage(-1, !0);
+ }, this.gotoPageDown = function() {
+ this.$moveByPage(1, !1);
+ }, this.gotoPageUp = function() {
+ this.$moveByPage(-1, !1);
+ }, this.scrollPageDown = function() {
+ this.$moveByPage(1);
+ }, this.scrollPageUp = function() {
+ this.$moveByPage(-1);
+ }, this.scrollToRow = function(e) {
+ this.renderer.scrollToRow(e);
+ }, this.scrollToLine = function(e, t, n, i) {
+ this.renderer.scrollToLine(e, t, n, i);
+ }, this.centerSelection = function() {
+ var e = this.getSelectionRange(), t = {
+ row: Math.floor(e.start.row + (e.end.row - e.start.row) / 2),
+ column: Math.floor(e.start.column + (e.end.column - e.start.column) / 2)
+ };
+ this.renderer.alignCursor(t, .5);
+ }, this.getCursorPosition = function() {
+ return this.selection.getCursor();
+ }, this.getCursorPositionScreen = function() {
+ return this.session.documentToScreenPosition(this.getCursorPosition());
+ }, this.getSelectionRange = function() {
+ return this.selection.getRange();
+ }, this.selectAll = function() {
+ this.$blockScrolling += 1, this.selection.selectAll(), this.$blockScrolling -= 1;
+ }, this.clearSelection = function() {
+ this.selection.clearSelection();
+ }, this.moveCursorTo = function(e, t) {
+ this.selection.moveCursorTo(e, t);
+ }, this.moveCursorToPosition = function(e) {
+ this.selection.moveCursorToPosition(e);
+ }, this.jumpToMatching = function(e) {
+ var t = this.getCursorPosition(), n = this.session.getBracketRange(t);
+ if (!n) {
+ if (n = this.find({
+ needle: /[{}()\[\]]/g,
+ preventScroll: !0,
+ start: {
+ row: t.row,
+ column: t.column - 1
+ }
+ }), !n) return;
+ var i = n.start;
+ i.row == t.row && Math.abs(i.column - t.column) < 2 && (n = this.session.getBracketRange(i));
+ }
+ i = n && n.cursor || i, i && (e ? n && n.isEqual(this.getSelectionRange()) ? this.clearSelection() : this.selection.selectTo(i.row, i.column) : (this.clearSelection(),
+ this.moveCursorTo(i.row, i.column)));
+ }, this.gotoLine = function(e, t, n) {
+ this.selection.clearSelection(), this.session.unfold({
+ row: e - 1,
+ column: t || 0
+ }), 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);
+ }, this.navigateTo = function(e, t) {
+ this.clearSelection(), this.moveCursorTo(e, t);
+ }, this.navigateUp = function(e) {
+ if (this.selection.isMultiLine() && !this.selection.isBackwards()) {
+ var t = this.selection.anchor.getPosition();
+ return this.moveCursorToPosition(t);
+ }
+ this.selection.clearSelection(), e = e || 1, this.selection.moveCursorBy(-e, 0);
+ }, this.navigateDown = function(e) {
+ if (this.selection.isMultiLine() && this.selection.isBackwards()) {
+ var t = this.selection.anchor.getPosition();
+ return this.moveCursorToPosition(t);
+ }
+ this.selection.clearSelection(), e = e || 1, this.selection.moveCursorBy(e, 0);
+ }, this.navigateLeft = function(e) {
+ if (this.selection.isEmpty()) for (e = e || 1; e--; ) this.selection.moveCursorLeft(); else {
+ var t = this.getSelectionRange().start;
+ this.moveCursorToPosition(t);
+ }
+ this.clearSelection();
+ }, this.navigateRight = function(e) {
+ if (this.selection.isEmpty()) for (e = e || 1; e--; ) this.selection.moveCursorRight(); else {
+ var t = this.getSelectionRange().end;
+ this.moveCursorToPosition(t);
+ }
+ this.clearSelection();
+ }, this.navigateLineStart = function() {
+ this.selection.moveCursorLineStart(), this.clearSelection();
+ }, this.navigateLineEnd = function() {
+ this.selection.moveCursorLineEnd(), this.clearSelection();
+ }, this.navigateFileEnd = function() {
+ var e = this.renderer.scrollTop;
+ this.selection.moveCursorFileEnd(), this.clearSelection(), this.renderer.animateScrolling(e);
+ }, this.navigateFileStart = function() {
+ var e = this.renderer.scrollTop;
+ this.selection.moveCursorFileStart(), this.clearSelection(), this.renderer.animateScrolling(e);
+ }, this.navigateWordRight = function() {
+ this.selection.moveCursorWordRight(), this.clearSelection();
+ }, this.navigateWordLeft = function() {
+ this.selection.moveCursorWordLeft(), this.clearSelection();
+ }, this.replace = function(e, t) {
+ t && this.$search.set(t);
+ var n = this.$search.find(this.session), i = 0;
+ return n ? (this.$tryReplace(n, e) && (i = 1), null !== n && (this.selection.setSelectionRange(n),
+ this.renderer.scrollSelectionIntoView(n.start, n.end)), i) : i;
+ }, this.replaceAll = function(e, t) {
+ t && this.$search.set(t);
+ var n = this.$search.findAll(this.session), i = 0;
+ if (!n.length) return i;
+ this.$blockScrolling += 1;
+ var o = this.getSelectionRange();
+ this.clearSelection(), this.selection.moveCursorTo(0, 0);
+ for (var r = n.length - 1; r >= 0; --r) this.$tryReplace(n[r], e) && i++;
+ return this.selection.setSelectionRange(o), this.$blockScrolling -= 1, i;
+ }, this.$tryReplace = function(e, t) {
+ var n = this.session.getTextRange(e);
+ return t = this.$search.replace(n, t), null !== t ? (e.end = this.session.replace(e, t),
+ e) : null;
+ }, this.getLastSearchOptions = function() {
+ return this.$search.getOptions();
+ }, this.find = function(e, t, i) {
+ t || (t = {}), "string" == typeof e || e instanceof RegExp ? t.needle = e : "object" == typeof e && n.mixin(t, e);
+ var o = this.selection.getRange();
+ null == t.needle && (e = this.session.getTextRange(o) || this.$search.$options.needle,
+ e || (o = this.session.getWordRange(o.start.row, o.start.column), e = this.session.getTextRange(o)),
+ this.$search.set({
+ needle: e
+ })), this.$search.set(t), t.start || this.$search.set({
+ start: o
+ });
+ var r = this.$search.find(this.session);
+ return t.preventScroll ? r : r ? (this.revealRange(r, i), r) : (t.backwards ? o.start = o.end : o.end = o.start,
+ this.selection.setRange(o), void 0);
+ }, this.findNext = function(e, t) {
+ this.find({
+ skipCurrent: !0,
+ backwards: !1
+ }, e, t);
+ }, this.findPrevious = function(e, t) {
+ this.find(e, {
+ skipCurrent: !0,
+ backwards: !0
+ }, t);
+ }, this.revealRange = function(e, t) {
+ this.$blockScrolling += 1, this.session.unfold(e), this.selection.setSelectionRange(e),
+ this.$blockScrolling -= 1;
+ var n = this.renderer.scrollTop;
+ this.renderer.scrollSelectionIntoView(e.start, e.end, .5), 0 != t && this.renderer.animateScrolling(n);
+ }, this.undo = function() {
+ this.$blockScrolling++, this.session.getUndoManager().undo(), this.$blockScrolling--,
+ this.renderer.scrollCursorIntoView(null, .5);
+ }, this.redo = function() {
+ this.$blockScrolling++, this.session.getUndoManager().redo(), this.$blockScrolling--,
+ this.renderer.scrollCursorIntoView(null, .5);
+ }, this.destroy = function() {
+ this.renderer.destroy(), this._emit("destroy", this);
+ }, this.setAutoScrollEditorIntoView = function(e) {
+ if (e !== !1) {
+ var t, n = this, i = !1;
+ this.$scrollAnchor || (this.$scrollAnchor = document.createElement("div"));
+ var o = this.$scrollAnchor;
+ o.style.cssText = "position:absolute", this.container.insertBefore(o, this.container.firstChild);
+ var r = this.on("changeSelection", function() {
+ i = !0;
+ }), s = this.renderer.on("beforeRender", function() {
+ i && (t = n.renderer.container.getBoundingClientRect());
+ }), a = this.renderer.on("afterRender", function() {
+ if (i && t && n.isFocused()) {
+ var e = n.renderer, r = e.$cursorLayer.$pixelPos, s = e.layerConfig, a = r.top - s.offset;
+ i = r.top >= 0 && a + t.top < 0 ? !0 : r.top < s.height && r.top + t.top + s.lineHeight > window.innerHeight ? !1 : null,
+ null != i && (o.style.top = a + "px", o.style.left = r.left + "px", o.style.height = s.lineHeight + "px",
+ o.scrollIntoView(i)), i = t = null;
+ }
+ });
+ this.setAutoScrollEditorIntoView = function(e) {
+ e !== !0 && (delete this.setAutoScrollEditorIntoView, this.removeEventListener("changeSelection", r),
+ this.renderer.removeEventListener("afterRender", a), this.renderer.removeEventListener("beforeRender", s));
+ };
+ }
+ }, this.$resetCursorStyle = function() {
+ var e = this.$cursorStyle || "ace", t = this.renderer.$cursorLayer;
+ t && (t.setSmoothBlinking("smooth" == e), t.isBlinking = !this.$readOnly && "wide" != e);
+ };
+ }).call(v.prototype), m.defineOptions(v.prototype, "editor", {
+ selectionStyle: {
+ set: function(e) {
+ this.onSelectionChange(), this._emit("changeSelectionStyle", {
+ data: e
+ });
+ },
+ initialValue: "line"
+ },
+ highlightActiveLine: {
+ set: function() {
+ this.$updateHighlightActiveLine();
+ },
+ initialValue: !0
+ },
+ highlightSelectedWord: {
+ set: function() {
+ this.$onSelectionChange();
+ },
+ initialValue: !0
+ },
+ readOnly: {
+ set: function() {
+ this.$resetCursorStyle();
+ },
+ initialValue: !1
+ },
+ cursorStyle: {
+ set: function() {
+ this.$resetCursorStyle();
+ },
+ values: [ "ace", "slim", "smooth", "wide" ],
+ initialValue: "ace"
+ },
+ behavioursEnabled: {
+ initialValue: !0
+ },
+ wrapBehavioursEnabled: {
+ initialValue: !0
+ },
+ hScrollBarAlwaysVisible: "renderer",
+ highlightGutterLine: "renderer",
+ animatedScroll: "renderer",
+ showInvisibles: "renderer",
+ showPrintMargin: "renderer",
+ printMarginColumn: "renderer",
+ printMargin: "renderer",
+ fadeFoldWidgets: "renderer",
+ showFoldWidgets: "renderer",
+ showGutter: "renderer",
+ displayIndentGuides: "renderer",
+ fontSize: "renderer",
+ fontFamily: "renderer",
+ scrollSpeed: "$mouseHandler",
+ dragDelay: "$mouseHandler",
+ focusTimout: "$mouseHandler",
+ firstLineNumber: "session",
+ overwrite: "session",
+ newLineMode: "session",
+ useWorker: "session",
+ useSoftTabs: "session",
+ tabSize: "session",
+ wrap: "session",
+ foldStyle: "session"
+ }), t.Editor = v;
+}), define("ace/undomanager", [ "require", "exports", "module" ], function(e, t) {
+ var n = function() {
+ this.reset();
+ };
+ (function() {
+ this.execute = function(e) {
+ var t = e.args[0];
+ this.$doc = e.args[1], this.$undoStack.push(t), this.$redoStack = [], this.dirtyCounter < 0 && (this.dirtyCounter = 0/0),
+ this.dirtyCounter++;
+ }, this.undo = function(e) {
+ var t = this.$undoStack.pop(), n = null;
+ return t && (n = this.$doc.undoChanges(t, e), this.$redoStack.push(t), this.dirtyCounter--),
+ n;
+ }, this.redo = function(e) {
+ var t = this.$redoStack.pop(), n = null;
+ return t && (n = this.$doc.redoChanges(t, e), this.$undoStack.push(t), this.dirtyCounter++),
+ n;
+ }, this.reset = function() {
+ this.$undoStack = [], this.$redoStack = [], this.dirtyCounter = 0;
+ }, this.hasUndo = function() {
+ return this.$undoStack.length > 0;
+ }, this.hasRedo = function() {
+ return this.$redoStack.length > 0;
+ }, this.markClean = function() {
+ this.dirtyCounter = 0;
+ }, this.isClean = function() {
+ return 0 === this.dirtyCounter;
+ };
+ }).call(n.prototype), t.UndoManager = n;
+}), define("ace/layer/gutter", [ "require", "exports", "module", "../lib/dom", "../lib/oop", "../lib/lang", "../lib/event_emitter" ], function(e, t) {
+ var n = e("../lib/dom"), i = e("../lib/oop"), o = e("../lib/lang"), r = e("../lib/event_emitter").EventEmitter, s = function(e) {
+ this.element = n.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);
+ };
+ (function() {
+ i.implement(this, r), this.setSession = function(e) {
+ this.session && this.session.removeEventListener("change", this.$updateAnnotations),
+ this.session = e, e.on("change", this.$updateAnnotations);
+ }, this.addGutterDecoration = function(e, t) {
+ window.console && console.warn && console.warn("deprecated use session.addGutterDecoration"),
+ this.session.addGutterDecoration(e, t);
+ }, this.removeGutterDecoration = function(e, t) {
+ window.console && console.warn && console.warn("deprecated use session.removeGutterDecoration"),
+ this.session.removeGutterDecoration(e, t);
+ }, this.setAnnotations = function(e) {
+ this.$annotations = [];
+ for (var t, n, i = 0; i < e.length; i++) {
+ var r = e[i], n = r.row, t = this.$annotations[n];
+ t || (t = this.$annotations[n] = {
+ text: []
+ });
+ var s = r.text;
+ s = s ? o.escapeHTML(s) : r.html || "", -1 === t.text.indexOf(s) && t.text.push(s);
+ var a = r.type;
+ "error" == a ? t.className = " ace_error" : "warning" == a && " ace_error" != t.className ? t.className = " ace_warning" : "info" != a || t.className || (t.className = " ace_info");
+ }
+ }, this.$updateAnnotations = function(e) {
+ if (this.$annotations.length) {
+ var t = e.data, n = t.range, i = n.start.row, o = n.end.row - i;
+ if (0 === o) ; else if ("removeText" == t.action || "removeLines" == t.action) this.$annotations.splice(i, o + 1, null); else {
+ var r = Array(o + 1);
+ r.unshift(i, 1), this.$annotations.splice.apply(this.$annotations, r);
+ }
+ }
+ }, this.update = function(e) {
+ for (var t = {
+ className: ""
+ }, i = [], o = e.firstRow, r = e.lastRow, s = this.session.getNextFoldLine(o), a = s ? s.start.row : 1/0, l = this.$showFoldWidgets && this.session.foldWidgets, c = this.session.$breakpoints, u = this.session.$decorations, d = this.session.$firstLineNumber, h = 0; ;) {
+ if (o > a && (o = s.end.row + 1, s = this.session.getNextFoldLine(o, s), a = s ? s.start.row : 1/0),
+ o > r) break;
+ var p = this.$annotations[o] || t;
+ if (i.push("
", h = o + d),
+ l) {
+ var f = l[o];
+ null == f && (f = l[o] = this.session.getFoldWidget(o)), f && i.push("");
+ }
+ i.push("
"), o++;
+ }
+ this.element = n.setInnerHtml(this.element, i.join("")), this.element.style.height = e.minHeight + "px",
+ this.session.$useWrapMode && (h = this.session.getLength());
+ var g = ("" + h).length * e.characterWidth, m = this.$padding || this.$computePadding();
+ g += m.left + m.right, g !== this.gutterWidth && (this.gutterWidth = g, this.element.style.width = Math.ceil(this.gutterWidth) + "px",
+ this._emit("changeGutterWidth", g));
+ }, this.$showFoldWidgets = !0, this.setShowFoldWidgets = function(e) {
+ e ? n.addCssClass(this.element, "ace_folding-enabled") : n.removeCssClass(this.element, "ace_folding-enabled"),
+ this.$showFoldWidgets = e, this.$padding = null;
+ }, this.getShowFoldWidgets = function() {
+ return this.$showFoldWidgets;
+ }, this.$computePadding = function() {
+ if (!this.element.firstChild) return {
+ left: 0,
+ right: 0
+ };
+ var e = n.computedStyle(this.element.firstChild);
+ return this.$padding = {}, this.$padding.left = parseInt(e.paddingLeft) + 1, this.$padding.right = parseInt(e.paddingRight),
+ this.$padding;
+ }, this.getRegion = function(e) {
+ var t = this.$padding || this.$computePadding(), n = this.element.getBoundingClientRect();
+ return e.x < t.left + n.left ? "markers" : this.$showFoldWidgets && e.x > n.right - t.right ? "foldWidgets" : void 0;
+ };
+ }).call(s.prototype), t.Gutter = s;
+}), define("ace/layer/marker", [ "require", "exports", "module", "../range", "../lib/dom" ], function(e, t) {
+ var n = e("../range").Range, i = e("../lib/dom"), o = function(e) {
+ this.element = i.createElement("div"), this.element.className = "ace_layer ace_marker-layer",
+ e.appendChild(this.element);
+ };
+ (function() {
+ this.$padding = 0, this.setPadding = function(e) {
+ this.$padding = e;
+ }, this.setSession = function(e) {
+ this.session = e;
+ }, this.setMarkers = function(e) {
+ this.markers = e;
+ }, this.update = function(e) {
+ var e = e || this.config;
+ if (e) {
+ this.config = e;
+ var t = [];
+ for (var n in this.markers) {
+ var o = this.markers[n];
+ if (o.range) {
+ var r = o.range.clipRows(e.firstRow, e.lastRow);
+ if (!r.isEmpty()) if (r = r.toScreenRange(this.session), o.renderer) {
+ var s = this.$getTop(r.start.row, e), a = this.$padding + r.start.column * e.characterWidth;
+ o.renderer(t, r, a, s, e);
+ } else "fullLine" == o.type ? this.drawFullLineMarker(t, r, o.clazz, e) : "screenLine" == o.type ? this.drawScreenLineMarker(t, r, o.clazz, e) : r.isMultiLine() ? "text" == o.type ? this.drawTextMarker(t, r, o.clazz, e) : this.drawMultiLineMarker(t, r, o.clazz, e) : this.drawSingleLineMarker(t, r, o.clazz + " ace_start", e);
+ } else o.update(t, this, this.session, e);
+ }
+ this.element = i.setInnerHtml(this.element, t.join(""));
+ }
+ }, this.$getTop = function(e, t) {
+ return (e - t.firstRowScreen) * t.lineHeight;
+ }, this.drawTextMarker = function(e, t, i, o, r) {
+ var s = t.start.row, a = new n(s, t.start.column, s, this.session.getScreenLastRowColumn(s));
+ for (this.drawSingleLineMarker(e, a, i + " ace_start", o, 1, r), s = t.end.row,
+ a = new n(s, 0, s, t.end.column), this.drawSingleLineMarker(e, a, i, o, 0, r), s = t.start.row + 1; s < t.end.row; s++) a.start.row = s,
+ a.end.row = s, a.end.column = this.session.getScreenLastRowColumn(s), this.drawSingleLineMarker(e, a, i, o, 1, r);
+ }, this.drawMultiLineMarker = function(e, t, n, i, o) {
+ var r = this.$padding, s = i.lineHeight, a = this.$getTop(t.start.row, i), l = r + t.start.column * i.characterWidth;
+ o = o || "", e.push(""),
+ a = this.$getTop(t.end.row, i);
+ var c = t.end.column * i.characterWidth;
+ e.push(""),
+ s = (t.end.row - t.start.row - 1) * i.lineHeight, 0 > s || (a = this.$getTop(t.start.row + 1, i),
+ e.push(""));
+ }, this.drawSingleLineMarker = function(e, t, n, i, o, r) {
+ var s = i.lineHeight, a = (t.end.column + (o || 0) - t.start.column) * i.characterWidth, l = this.$getTop(t.start.row, i), c = this.$padding + t.start.column * i.characterWidth;
+ e.push("");
+ }, this.drawFullLineMarker = function(e, t, n, i, o) {
+ var r = this.$getTop(t.start.row, i), s = i.lineHeight;
+ t.start.row != t.end.row && (s += this.$getTop(t.end.row, i) - r), e.push("");
+ }, this.drawScreenLineMarker = function(e, t, n, i, o) {
+ var r = this.$getTop(t.start.row, i), s = i.lineHeight;
+ e.push("");
+ };
+ }).call(o.prototype), t.Marker = o;
+}), define("ace/layer/text", [ "require", "exports", "module", "../lib/oop", "../lib/dom", "../lib/lang", "../lib/useragent", "../lib/event_emitter" ], function(e, t) {
+ var n = e("../lib/oop"), i = e("../lib/dom"), o = e("../lib/lang"), r = e("../lib/useragent"), s = e("../lib/event_emitter").EventEmitter, a = function(e) {
+ this.element = i.createElement("div"), this.element.className = "ace_layer ace_text-layer",
+ e.appendChild(this.element), this.$characterSize = {
+ width: 0,
+ height: 0
+ }, this.checkForSizeChanges(), this.$pollSizeChanges();
+ };
+ (function() {
+ n.implement(this, s), this.EOF_CHAR = "¶", this.EOL_CHAR = "¬", this.TAB_CHAR = "→",
+ this.SPACE_CHAR = "·", this.$padding = 0, this.setPadding = function(e) {
+ this.$padding = e, this.element.style.padding = "0 " + e + "px";
+ }, this.getLineHeight = function() {
+ return this.$characterSize.height || 1;
+ }, this.getCharacterWidth = function() {
+ return this.$characterSize.width || 1;
+ }, this.checkForSizeChanges = function() {
+ var e = this.$measureSizes();
+ if (e && (this.$characterSize.width !== e.width || this.$characterSize.height !== e.height)) {
+ this.$measureNode.style.fontWeight = "bold";
+ var t = this.$measureSizes();
+ this.$measureNode.style.fontWeight = "", this.$characterSize = e, this.allowBoldFonts = t && t.width === e.width && t.height === e.height,
+ this._emit("changeCharacterSize", {
+ data: e
+ });
+ }
+ }, this.$pollSizeChanges = function() {
+ var e = this;
+ this.$pollSizeChangesTimer = setInterval(function() {
+ e.checkForSizeChanges();
+ }, 500);
+ }, this.$fontStyles = {
+ fontFamily: 1,
+ fontSize: 1,
+ fontWeight: 1,
+ fontStyle: 1,
+ lineHeight: 1
+ }, this.$measureSizes = r.isIE || r.isOldGecko ? function() {
+ var e = 1e3;
+ if (!this.$measureNode) {
+ var t = this.$measureNode = i.createElement("div"), n = t.style;
+ if (n.width = n.height = "auto", n.left = n.top = 40 * -e + "px", n.visibility = "hidden",
+ n.position = "fixed", n.overflow = "visible", n.whiteSpace = "nowrap", t.innerHTML = o.stringRepeat("Xy", e),
+ this.element.ownerDocument.body) this.element.ownerDocument.body.appendChild(t); else {
+ for (var r = this.element.parentNode; !i.hasCssClass(r, "ace_editor"); ) r = r.parentNode;
+ r.appendChild(t);
+ }
+ }
+ if (!this.element.offsetWidth) return null;
+ var n = this.$measureNode.style, s = i.computedStyle(this.element);
+ for (var a in this.$fontStyles) n[a] = s[a];
+ var l = {
+ height: this.$measureNode.offsetHeight,
+ width: this.$measureNode.offsetWidth / (2 * e)
+ };
+ return 0 == l.width || 0 == l.height ? null : l;
+ } : function() {
+ if (!this.$measureNode) {
+ var e = this.$measureNode = i.createElement("div"), t = e.style;
+ t.width = t.height = "auto", t.left = t.top = "-100px", t.visibility = "hidden",
+ t.position = "fixed", t.overflow = "visible", t.whiteSpace = "nowrap", e.innerHTML = "X";
+ for (var n = this.element.parentNode; n && !i.hasCssClass(n, "ace_editor"); ) n = n.parentNode;
+ if (!n) return this.$measureNode = null;
+ n.appendChild(e);
+ }
+ var o = this.$measureNode.getBoundingClientRect(), r = {
+ height: o.height,
+ width: o.width
+ };
+ return 0 == r.width || 0 == r.height ? null : r;
+ }, this.setSession = function(e) {
+ this.session = e, this.$computeTabString();
+ }, this.showInvisibles = !1, this.setShowInvisibles = function(e) {
+ return this.showInvisibles == e ? !1 : (this.showInvisibles = e, this.$computeTabString(),
+ !0);
+ }, this.displayIndentGuides = !0, this.setDisplayIndentGuides = function(e) {
+ return this.displayIndentGuides == e ? !1 : (this.displayIndentGuides = e, this.$computeTabString(),
+ !0);
+ }, this.$tabStrings = [], this.onChangeTabSize = this.$computeTabString = function() {
+ var e = this.session.getTabSize();
+ this.tabSize = e;
+ for (var t = this.$tabStrings = [ 0 ], n = 1; e + 1 > n; n++) this.showInvisibles ? t.push("" + this.TAB_CHAR + o.stringRepeat(" ", n - 1) + "") : t.push(o.stringRepeat(" ", n));
+ if (this.displayIndentGuides) {
+ this.$indentGuideRe = /\s\S| \t|\t |\s$/;
+ var i = "ace_indent-guide";
+ if (this.showInvisibles) {
+ i += " ace_invisible";
+ var r = o.stringRepeat(this.SPACE_CHAR, this.tabSize), s = this.TAB_CHAR + o.stringRepeat(" ", this.tabSize - 1);
+ } else var r = o.stringRepeat(" ", this.tabSize), s = r;
+ this.$tabStrings[" "] = "" + r + "", this.$tabStrings[" "] = "" + s + "";
+ }
+ }, this.updateLines = function(e, t, n) {
+ (this.config.lastRow != e.lastRow || this.config.firstRow != e.firstRow) && this.scrollLines(e),
+ this.config = e;
+ for (var o = Math.max(t, e.firstRow), r = Math.min(n, e.lastRow), s = this.element.childNodes, a = 0, l = e.firstRow; o > l; l++) {
+ var c = this.session.getFoldLine(l);
+ if (c) {
+ if (c.containsRow(o)) {
+ o = c.start.row;
+ break;
+ }
+ l = c.end.row;
+ }
+ a++;
+ }
+ for (var l = o, c = this.session.getNextFoldLine(l), u = c ? c.start.row : 1/0; ;) {
+ if (l > u && (l = c.end.row + 1, c = this.session.getNextFoldLine(l, c), u = c ? c.start.row : 1/0),
+ l > r) break;
+ var d = s[a++];
+ if (d) {
+ var h = [];
+ this.$renderLine(h, l, !this.$useLineGroups(), l == u ? c : !1), i.setInnerHtml(d, h.join(""));
+ }
+ l++;
+ }
+ }, this.scrollLines = function(e) {
+ var t = this.config;
+ if (this.config = e, !t || t.lastRow < e.firstRow) return this.update(e);
+ if (e.lastRow < t.firstRow) return this.update(e);
+ var n = this.element;
+ if (t.firstRow < e.firstRow) for (var i = this.session.getFoldedRowCount(t.firstRow, e.firstRow - 1); i > 0; i--) n.removeChild(n.firstChild);
+ if (t.lastRow > e.lastRow) for (var i = this.session.getFoldedRowCount(e.lastRow + 1, t.lastRow); i > 0; i--) n.removeChild(n.lastChild);
+ if (e.firstRow < t.firstRow) {
+ var o = this.$renderLinesFragment(e, e.firstRow, t.firstRow - 1);
+ n.firstChild ? n.insertBefore(o, n.firstChild) : n.appendChild(o);
+ }
+ if (e.lastRow > t.lastRow) {
+ var o = this.$renderLinesFragment(e, t.lastRow + 1, e.lastRow);
+ n.appendChild(o);
+ }
+ }, this.$renderLinesFragment = function(e, t, n) {
+ for (var o = this.element.ownerDocument.createDocumentFragment(), r = t, s = this.session.getNextFoldLine(r), a = s ? s.start.row : 1/0; ;) {
+ if (r > a && (r = s.end.row + 1, s = this.session.getNextFoldLine(r, s), a = s ? s.start.row : 1/0),
+ r > n) break;
+ var l = i.createElement("div"), c = [];
+ if (this.$renderLine(c, r, !1, r == a ? s : !1), l.innerHTML = c.join(""), this.$useLineGroups()) l.className = "ace_line_group",
+ o.appendChild(l); else for (var u = l.childNodes; u.length; ) o.appendChild(u[0]);
+ r++;
+ }
+ return o;
+ }, this.update = function(e) {
+ this.config = e;
+ for (var t = [], n = e.firstRow, o = e.lastRow, r = n, s = this.session.getNextFoldLine(r), a = s ? s.start.row : 1/0; ;) {
+ if (r > a && (r = s.end.row + 1, s = this.session.getNextFoldLine(r, s), a = s ? s.start.row : 1/0),
+ r > o) break;
+ this.$useLineGroups() && t.push("
"), this.$renderLine(t, r, !1, r == a ? s : !1),
+ this.$useLineGroups() && t.push("
"), r++;
+ }
+ this.element = i.setInnerHtml(this.element, t.join(""));
+ }, this.$textToken = {
+ text: !0,
+ rparen: !0,
+ lparen: !0
+ }, this.$renderToken = function(e, t, n, i) {
+ var r = this, s = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\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, a = function(e, n, i, s) {
+ if (n) return r.showInvisibles ? "" + o.stringRepeat(r.SPACE_CHAR, e.length) + "" : o.stringRepeat(" ", e.length);
+ if ("&" == e) return "&";
+ if ("<" == e) return "<";
+ if (" " == e) {
+ var a = r.session.getScreenTabSize(t + s);
+ return t += a - 1, r.$tabStrings[a];
+ }
+ if (" " == e) {
+ var l = r.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk", c = r.showInvisibles ? r.SPACE_CHAR : "";
+ return t += 1, "" + c + "";
+ }
+ return i ? "" + r.SPACE_CHAR + "" : (t += 1,
+ "" + e + "");
+ }, l = i.replace(s, a);
+ if (this.$textToken[n.type]) e.push(l); else {
+ var c = "ace_" + n.type.replace(/\./g, " ace_"), u = "";
+ "fold" == n.type && (u = " style='width:" + n.value.length * this.config.characterWidth + "px;' "),
+ e.push("", l, "");
+ }
+ return t + i.length;
+ }, this.renderIndentGuide = function(e, t) {
+ var n = t.search(this.$indentGuideRe);
+ return 0 >= n ? t : " " == t[0] ? (n -= n % this.tabSize, e.push(o.stringRepeat(this.$tabStrings[" "], n / this.tabSize)),
+ t.substr(n)) : " " == t[0] ? (e.push(o.stringRepeat(this.$tabStrings[" "], n)),
+ t.substr(n)) : t;
+ }, this.$renderWrappedLine = function(e, t, n, i) {
+ for (var o = 0, r = 0, s = n[0], a = 0, l = 0; l < t.length; l++) {
+ var c = t[l], u = c.value;
+ if (0 == l && this.displayIndentGuides) {
+ if (o = u.length, u = this.renderIndentGuide(e, u), !u) continue;
+ o -= u.length;
+ }
+ if (o + u.length < s) a = this.$renderToken(e, a, c, u), o += u.length; else {
+ for (;o + u.length >= s; ) a = this.$renderToken(e, a, c, u.substring(0, s - o)),
+ u = u.substring(s - o), o = s, i || e.push("
", "
"),
+ r++, a = 0, s = n[r] || Number.MAX_VALUE;
+ 0 != u.length && (o += u.length, a = this.$renderToken(e, a, c, u));
+ }
+ }
+ }, this.$renderSimpleLine = function(e, t) {
+ var n = 0, i = t[0], o = i.value;
+ this.displayIndentGuides && (o = this.renderIndentGuide(e, o)), o && (n = this.$renderToken(e, n, i, o));
+ for (var r = 1; r < t.length; r++) i = t[r], o = i.value, n = this.$renderToken(e, n, i, o);
+ }, this.$renderLine = function(e, t, n, i) {
+ if (i || 0 == i || (i = this.session.getFoldLine(t)), i) var o = this.$getFoldLineTokens(t, i); else var o = this.session.getTokens(t);
+ if (n || e.push("
"),
+ o.length) {
+ var r = this.session.getRowSplitData(t);
+ r && r.length ? this.$renderWrappedLine(e, o, r, n) : this.$renderSimpleLine(e, o);
+ }
+ this.showInvisibles && (i && (t = i.end.row), e.push("", t == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "")),
+ n || e.push("
");
+ }, this.$getFoldLineTokens = function(e, t) {
+ function n(e, t, n) {
+ for (var i = 0, r = 0; r + e[i].value.length < t; ) if (r += e[i].value.length,
+ i++, i == e.length) return;
+ if (r != t) {
+ var s = e[i].value.substring(t - r);
+ s.length > n - t && (s = s.substring(0, n - t)), o.push({
+ type: e[i].type,
+ value: s
+ }), r = t + s.length, i += 1;
+ }
+ for (;n > r && i < e.length; ) {
+ var s = e[i].value;
+ s.length + r > n ? o.push({
+ type: e[i].type,
+ value: s.substring(0, n - r)
+ }) : o.push(e[i]), r += s.length, i += 1;
+ }
+ }
+ var i = this.session, o = [], r = i.getTokens(e);
+ return t.walk(function(e, t, s, a, l) {
+ null != e ? o.push({
+ type: "fold",
+ value: e
+ }) : (l && (r = i.getTokens(t)), r.length && n(r, a, s));
+ }, t.end.row, this.session.getLine(t.end.row).length), o;
+ }, this.$useLineGroups = function() {
+ return this.session.getUseWrapMode();
+ }, this.destroy = function() {
+ clearInterval(this.$pollSizeChangesTimer), this.$measureNode && this.$measureNode.parentNode.removeChild(this.$measureNode),
+ delete this.$measureNode;
+ };
+ }).call(a.prototype), t.Text = a;
+}), define("ace/layer/cursor", [ "require", "exports", "module", "../lib/dom" ], function(e, t) {
+ var n = e("../lib/dom"), i = function(e) {
+ this.element = n.createElement("div"), this.element.className = "ace_layer ace_cursor-layer",
+ e.appendChild(this.element), this.isVisible = !1, this.isBlinking = !0, this.blinkInterval = 1e3,
+ this.smoothBlinking = !1, this.cursors = [], this.cursor = this.addCursor(), n.addCssClass(this.element, "ace_hidden-cursors");
+ };
+ (function() {
+ this.$padding = 0, this.setPadding = function(e) {
+ this.$padding = e;
+ }, this.setSession = function(e) {
+ this.session = e;
+ }, this.setBlinking = function(e) {
+ e != this.isBlinking && (this.isBlinking = e, this.restartTimer());
+ }, this.setBlinkInterval = function(e) {
+ e != this.blinkInterval && (this.blinkInterval = e, this.restartTimer());
+ }, this.setSmoothBlinking = function(e) {
+ e != this.smoothBlinking && (this.smoothBlinking = e, e ? n.addCssClass(this.element, "ace_smooth-blinking") : n.removeCssClass(this.element, "ace_smooth-blinking"),
+ this.restartTimer());
+ }, this.addCursor = function() {
+ var e = n.createElement("div");
+ return e.className = "ace_cursor", this.element.appendChild(e), this.cursors.push(e),
+ e;
+ }, this.removeCursor = function() {
+ if (this.cursors.length > 1) {
+ var e = this.cursors.pop();
+ return e.parentNode.removeChild(e), e;
+ }
+ }, this.hideCursor = function() {
+ this.isVisible = !1, n.addCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
+ }, this.showCursor = function() {
+ this.isVisible = !0, n.removeCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
+ }, this.restartTimer = function() {
+ clearInterval(this.intervalId), clearTimeout(this.timeoutId), this.smoothBlinking && n.removeCssClass(this.element, "ace_smooth-blinking");
+ for (var e = this.cursors.length; e--; ) this.cursors[e].style.opacity = "";
+ if (this.isBlinking && this.blinkInterval && this.isVisible) {
+ this.smoothBlinking && setTimeout(function() {
+ n.addCssClass(this.element, "ace_smooth-blinking");
+ }.bind(this));
+ var t = function() {
+ this.timeoutId = setTimeout(function() {
+ for (var e = this.cursors.length; e--; ) this.cursors[e].style.opacity = 0;
+ }.bind(this), .6 * this.blinkInterval);
+ }.bind(this);
+ this.intervalId = setInterval(function() {
+ for (var e = this.cursors.length; e--; ) this.cursors[e].style.opacity = "";
+ t();
+ }.bind(this), this.blinkInterval), t();
+ }
+ }, this.getPixelPosition = function(e, t) {
+ if (!this.config || !this.session) return {
+ left: 0,
+ top: 0
+ };
+ e || (e = this.session.selection.getCursor());
+ var n = this.session.documentToScreenPosition(e), i = this.$padding + n.column * this.config.characterWidth, o = (n.row - (t ? this.config.firstRowScreen : 0)) * this.config.lineHeight;
+ return {
+ left: i,
+ top: o
+ };
+ }, this.update = function(e) {
+ this.config = e;
+ var t = this.session.$selectionMarkers, n = 0, i = 0;
+ (void 0 === t || 0 === t.length) && (t = [ {
+ cursor: null
+ } ]);
+ for (var n = 0, o = t.length; o > n; n++) {
+ var r = this.getPixelPosition(t[n].cursor, !0);
+ if (!((r.top > e.height + e.offset || r.top < -e.offset) && n > 1)) {
+ var s = (this.cursors[i++] || this.addCursor()).style;
+ s.left = r.left + "px", s.top = r.top + "px", s.width = e.characterWidth + "px",
+ s.height = e.lineHeight + "px";
+ }
+ }
+ for (;this.cursors.length > i; ) this.removeCursor();
+ var a = this.session.getOverwrite();
+ this.$setOverwrite(a), this.$pixelPos = r, this.restartTimer();
+ }, this.$setOverwrite = function(e) {
+ e != this.overwrite && (this.overwrite = e, e ? n.addCssClass(this.element, "ace_overwrite-cursors") : n.removeCssClass(this.element, "ace_overwrite-cursors"));
+ }, this.destroy = function() {
+ clearInterval(this.intervalId), clearTimeout(this.timeoutId);
+ };
+ }).call(i.prototype), t.Cursor = i;
+}), define("ace/scrollbar", [ "require", "exports", "module", "./lib/oop", "./lib/dom", "./lib/event", "./lib/event_emitter" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/dom"), o = e("./lib/event"), r = e("./lib/event_emitter").EventEmitter, s = function(e) {
+ this.element = i.createElement("div"), this.element.className = "ace_scrollbar",
+ this.inner = i.createElement("div"), this.inner.className = "ace_scrollbar-inner",
+ this.element.appendChild(this.inner), e.appendChild(this.element), this.width = i.scrollbarWidth(e.ownerDocument),
+ this.element.style.width = (this.width || 15) + 5 + "px", o.addListener(this.element, "scroll", this.onScroll.bind(this));
+ };
+ (function() {
+ n.implement(this, r), this.onScroll = function() {
+ this.skipEvent || (this.scrollTop = this.element.scrollTop, this._emit("scroll", {
+ data: this.scrollTop
+ })), this.skipEvent = !1;
+ }, this.getWidth = function() {
+ return this.width;
+ }, this.setHeight = function(e) {
+ this.element.style.height = e + "px";
+ }, this.setInnerHeight = function(e) {
+ this.inner.style.height = e + "px";
+ }, this.setScrollTop = function(e) {
+ this.scrollTop != e && (this.skipEvent = !0, this.scrollTop = this.element.scrollTop = e);
+ };
+ }).call(s.prototype), t.ScrollBar = s;
+}), define("ace/renderloop", [ "require", "exports", "module", "./lib/event" ], function(e, t) {
+ var n = e("./lib/event"), i = function(e, t) {
+ this.onRender = e, this.pending = !1, this.changes = 0, this.window = t || window;
+ };
+ (function() {
+ this.schedule = function(e) {
+ if (this.changes = this.changes | e, !this.pending) {
+ this.pending = !0;
+ var t = this;
+ n.nextFrame(function() {
+ t.pending = !1;
+ for (var e; e = t.changes; ) t.changes = 0, t.onRender(e);
+ }, this.window);
+ }
+ };
+ }).call(i.prototype), t.RenderLoop = i;
+}), function() {
+ define("libs/ace_text", [ "require", "exports", "module" ], function(e, t) {
+ t.load = function(e, t, n) {
+ n("", "utf8");
+ };
+ });
+}(), define("ace/virtual_renderer", [ "require", "exports", "module", "./lib/oop", "./lib/dom", "./lib/event", "./lib/useragent", "./config", "./layer/gutter", "./layer/marker", "./layer/text", "./layer/cursor", "./scrollbar", "./renderloop", "./lib/event_emitter", "./requirejs/text!./css/editor.css" ], function(e, t) {
+ var n = e("./lib/oop"), i = e("./lib/dom"), o = e("./lib/event"), r = e("./lib/useragent"), s = e("./config"), a = e("./layer/gutter").Gutter, l = e("./layer/marker").Marker, c = e("./layer/text").Text, u = e("./layer/cursor").Cursor, d = e("./scrollbar").ScrollBar, h = e("./renderloop").RenderLoop, p = e("./lib/event_emitter").EventEmitter, f = e("./requirejs/text!./css/editor.css");
+ i.importCssString(f, "ace_editor");
+ var g = function(e, t) {
+ var n = this;
+ this.container = e || i.createElement("div"), this.$keepTextAreaAtCursor = !r.isIE,
+ 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 a(this.$gutter), this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)),
+ this.$markerBack = new l(this.content);
+ var p = this.$textLayer = new c(this.content);
+ this.canvas = p.element, this.$markerFront = new l(this.content), this.$cursorLayer = new u(this.content),
+ this.$horizScroll = !1, this.scrollBar = new d(this.container), this.scrollBar.addEventListener("scroll", function(e) {
+ n.$scrollAnimation || n.session.setScrollTop(e.data);
+ }), this.scrollTop = 0, this.scrollLeft = 0, o.addListener(this.scroller, "scroll", function() {
+ var e = n.scroller.scrollLeft;
+ n.scrollLeft = e, n.session.setScrollLeft(e);
+ }), this.cursorPos = {
+ row: 0,
+ column: 0
+ }, this.$textLayer.addEventListener("changeCharacterSize", function() {
+ n.updateCharacterSize(), n.onResize(!0);
+ }), this.$size = {
+ width: 0,
+ height: 0,
+ scrollerHeight: 0,
+ scrollerWidth: 0
+ }, this.layerConfig = {
+ width: 1,
+ padding: 0,
+ firstRow: 0,
+ firstRowScreen: 0,
+ lastRow: 0,
+ lineHeight: 1,
+ characterWidth: 1,
+ minHeight: 1,
+ maxHeight: 1,
+ offset: 0,
+ height: 1
+ }, this.$loop = new h(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);
+ };
+ (function() {
+ 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,
+ n.implement(this, p), this.updateCharacterSize = function() {
+ this.$textLayer.allowBoldFonts != this.$allowBoldFonts && (this.$allowBoldFonts = this.$textLayer.allowBoldFonts,
+ this.setStyle("ace_nobold", !this.$allowBoldFonts)), this.characterWidth = this.$textLayer.getCharacterWidth(),
+ this.lineHeight = this.$textLayer.getLineHeight(), this.$updatePrintMargin();
+ }, this.setSession = function(e) {
+ this.session = e, this.scroller.className = "ace_scroller", this.$cursorLayer.setSession(e),
+ this.$markerBack.setSession(e), this.$markerFront.setSession(e), this.$gutterLayer.setSession(e),
+ this.$textLayer.setSession(e), this.$loop.schedule(this.CHANGE_FULL);
+ }, this.updateLines = function(e, t) {
+ void 0 === t && (t = 1/0), this.$changedLines ? (this.$changedLines.firstRow > e && (this.$changedLines.firstRow = e),
+ this.$changedLines.lastRow < t && (this.$changedLines.lastRow = t)) : this.$changedLines = {
+ firstRow: e,
+ lastRow: t
+ }, this.$changedLines.firstRow > this.layerConfig.lastRow || this.$changedLines.lastRow < this.layerConfig.firstRow || this.$loop.schedule(this.CHANGE_LINES);
+ }, this.onChangeTabSize = function() {
+ this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER), this.$textLayer.onChangeTabSize();
+ }, this.updateText = function() {
+ this.$loop.schedule(this.CHANGE_TEXT);
+ }, this.updateFull = function(e) {
+ e ? this.$renderChanges(this.CHANGE_FULL, !0) : this.$loop.schedule(this.CHANGE_FULL);
+ }, this.updateFontSize = function() {
+ this.$textLayer.checkForSizeChanges();
+ }, this.onResize = function(e, t, n, o) {
+ var r = 0, s = this.$size;
+ if (!(this.resizing > 2)) {
+ if (this.resizing > 1 ? this.resizing++ : this.resizing = e ? 1 : 0, o || (o = i.getInnerHeight(this.container)),
+ o && (e || s.height != o) && (s.height = o, r = this.CHANGE_SIZE, s.scrollerHeight = this.scroller.clientHeight,
+ (e || !s.scrollerHeight) && (s.scrollerHeight = s.height, this.$horizScroll && (s.scrollerHeight -= this.scrollBar.getWidth())),
+ this.scrollBar.setHeight(s.scrollerHeight), this.session && (this.session.setScrollTop(this.getScrollTop()),
+ r |= this.CHANGE_FULL)), n || (n = i.getInnerWidth(this.container)), n && (e || this.resizing > 1 || s.width != n)) {
+ r = this.CHANGE_SIZE, s.width = n;
+ var t = this.$showGutter ? this.$gutter.offsetWidth : 0;
+ this.scroller.style.left = t + "px", s.scrollerWidth = Math.max(0, n - t - this.scrollBar.getWidth()),
+ this.scroller.style.right = this.scrollBar.getWidth() + "px", (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || e) && (r |= this.CHANGE_FULL);
+ }
+ this.$size.scrollerHeight && (e ? this.$renderChanges(r, !0) : this.$loop.schedule(r),
+ e && (this.$gutterLayer.$padding = null), e && delete this.resizing);
+ }
+ }, this.onGutterResize = function() {
+ var e = this.$size.width, t = this.$showGutter ? this.$gutter.offsetWidth : 0;
+ this.scroller.style.left = t + "px", this.$size.scrollerWidth = Math.max(0, e - t - this.scrollBar.getWidth()),
+ this.session.getUseWrapMode() && this.adjustWrapLimit() ? this.$loop.schedule(this.CHANGE_FULL) : this.$loop.schedule(this.CHANGE_MARKER);
+ }, this.adjustWrapLimit = function() {
+ var e = this.$size.scrollerWidth - 2 * this.$padding, t = Math.floor(e / this.characterWidth);
+ return this.session.adjustWrapLimit(t, this.$showPrintMargin && this.$printMarginColumn);
+ }, this.setAnimatedScroll = function(e) {
+ this.setOption("animatedScroll", e);
+ }, this.getAnimatedScroll = function() {
+ return this.$animatedScroll;
+ }, this.setShowInvisibles = function(e) {
+ this.setOption("showInvisibles", e);
+ }, this.getShowInvisibles = function() {
+ return this.getOption("showInvisibles");
+ }, this.getDisplayIndentGuides = function() {
+ return this.getOption("displayIndentGuides");
+ }, this.setDisplayIndentGuides = function(e) {
+ this.setOption("displayIndentGuides", e);
+ }, this.setShowPrintMargin = function(e) {
+ this.setOption("showPrintMargin", e);
+ }, this.getShowPrintMargin = function() {
+ return this.getOption("showPrintMargin");
+ }, this.setPrintMarginColumn = function(e) {
+ this.setOption("printMarginColumn", e);
+ }, this.getPrintMarginColumn = function() {
+ return this.getOption("printMarginColumn");
+ }, this.getShowGutter = function() {
+ return this.getOption("showGutter");
+ }, this.setShowGutter = function(e) {
+ return this.setOption("showGutter", e);
+ }, this.getFadeFoldWidgets = function() {
+ return this.getOption("fadeFoldWidgets");
+ }, this.setFadeFoldWidgets = function(e) {
+ this.setOption("fadeFoldWidgets", e);
+ }, this.setHighlightGutterLine = function(e) {
+ this.setOption("highlightGutterLine", e);
+ }, this.getHighlightGutterLine = function() {
+ return this.getOption("highlightGutterLine");
+ }, this.$updateGutterLineHighlight = function() {
+ var e = this.$cursorLayer.$pixelPos, t = this.layerConfig.lineHeight;
+ if (this.session.getUseWrapMode()) {
+ var n = this.session.selection.getCursor();
+ n.column = 0, e = this.$cursorLayer.getPixelPosition(n, !0), t *= this.session.getRowLength(n.row);
+ }
+ this.$gutterLineHighlight.style.top = e.top - this.layerConfig.offset + "px", this.$gutterLineHighlight.style.height = t + "px";
+ }, this.$updatePrintMargin = function() {
+ if (this.$showPrintMargin || this.$printMarginEl) {
+ if (!this.$printMarginEl) {
+ var e = i.createElement("div");
+ 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);
+ }
+ var t = this.$printMarginEl.style;
+ t.left = this.characterWidth * this.$printMarginColumn + this.$padding + "px", t.visibility = this.$showPrintMargin ? "visible" : "hidden",
+ this.session && -1 == this.session.$wrap && this.adjustWrapLimit();
+ }
+ }, this.getContainerElement = function() {
+ return this.container;
+ }, this.getMouseEventTarget = function() {
+ return this.content;
+ }, this.getTextAreaContainer = function() {
+ return this.container;
+ }, this.$moveTextAreaToCursor = function() {
+ if (this.$keepTextAreaAtCursor) {
+ var e = this.layerConfig, t = this.$cursorLayer.$pixelPos.top, n = this.$cursorLayer.$pixelPos.left;
+ t -= e.offset;
+ var i = this.lineHeight;
+ if (!(0 > t || t > e.height - i)) {
+ var o = this.characterWidth;
+ if (this.$composition) {
+ var r = this.textarea.value.replace(/^\x01+/, "");
+ o *= this.session.$getStringScreenWidth(r)[0] + 2, i += 2, t -= 1;
+ }
+ n -= this.scrollLeft, n > this.$size.scrollerWidth - o && (n = this.$size.scrollerWidth - o),
+ n -= this.scrollBar.width, this.textarea.style.height = i + "px", this.textarea.style.width = o + "px",
+ this.textarea.style.right = Math.max(0, this.$size.scrollerWidth - n - o) + "px",
+ this.textarea.style.bottom = Math.max(0, this.$size.height - t - i) + "px";
+ }
+ }
+ }, this.getFirstVisibleRow = function() {
+ return this.layerConfig.firstRow;
+ }, this.getFirstFullyVisibleRow = function() {
+ return this.layerConfig.firstRow + (0 === this.layerConfig.offset ? 0 : 1);
+ }, this.getLastFullyVisibleRow = function() {
+ var e = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
+ return this.layerConfig.firstRow - 1 + e;
+ }, this.getLastVisibleRow = function() {
+ return this.layerConfig.lastRow;
+ }, this.$padding = null, this.setPadding = function(e) {
+ 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();
+ }, this.getHScrollBarAlwaysVisible = function() {
+ return this.$hScrollBarAlwaysVisible;
+ }, this.setHScrollBarAlwaysVisible = function(e) {
+ this.setOption("hScrollBarAlwaysVisible", e);
+ }, this.$updateScrollBar = function() {
+ this.scrollBar.setInnerHeight(this.layerConfig.maxHeight), this.scrollBar.setScrollTop(this.scrollTop);
+ }, this.$renderChanges = function(e, t) {
+ if (t || e && this.session && this.container.offsetWidth) {
+ if (this._signal("beforeRender"), (e & this.CHANGE_FULL || e & this.CHANGE_SIZE || e & this.CHANGE_TEXT || e & this.CHANGE_LINES || e & this.CHANGE_SCROLL) && this.$computeLayerConfig(),
+ e & this.CHANGE_H_SCROLL) {
+ this.scroller.scrollLeft = this.scrollLeft;
+ var n = this.scroller.scrollLeft;
+ this.scrollLeft = n, this.session.setScrollLeft(n), this.scroller.className = 0 == this.scrollLeft ? "ace_scroller" : "ace_scroller ace_scroll-left";
+ }
+ if (e & this.CHANGE_FULL) return this.$textLayer.checkForSizeChanges(), this.$updateScrollBar(),
+ this.$textLayer.update(this.layerConfig), this.$showGutter && this.$gutterLayer.update(this.layerConfig),
+ this.$markerBack.update(this.layerConfig), this.$markerFront.update(this.layerConfig),
+ this.$cursorLayer.update(this.layerConfig), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight(),
+ this._signal("afterRender"), void 0;
+ if (e & this.CHANGE_SCROLL) return e & this.CHANGE_TEXT || e & this.CHANGE_LINES ? this.$textLayer.update(this.layerConfig) : this.$textLayer.scrollLines(this.layerConfig),
+ this.$showGutter && this.$gutterLayer.update(this.layerConfig), this.$markerBack.update(this.layerConfig),
+ this.$markerFront.update(this.layerConfig), this.$cursorLayer.update(this.layerConfig),
+ this.$highlightGutterLine && this.$updateGutterLineHighlight(), this.$moveTextAreaToCursor(),
+ this.$updateScrollBar(), this._signal("afterRender"), void 0;
+ e & this.CHANGE_TEXT ? (this.$textLayer.update(this.layerConfig), this.$showGutter && this.$gutterLayer.update(this.layerConfig)) : e & this.CHANGE_LINES ? (this.$updateLines() || e & this.CHANGE_GUTTER && this.$showGutter) && this.$gutterLayer.update(this.layerConfig) : (e & this.CHANGE_TEXT || e & this.CHANGE_GUTTER) && this.$showGutter && this.$gutterLayer.update(this.layerConfig),
+ e & this.CHANGE_CURSOR && (this.$cursorLayer.update(this.layerConfig), this.$moveTextAreaToCursor(),
+ this.$highlightGutterLine && this.$updateGutterLineHighlight()), e & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) && this.$markerFront.update(this.layerConfig),
+ e & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) && this.$markerBack.update(this.layerConfig),
+ e & this.CHANGE_SIZE && this.$updateScrollBar(), this._signal("afterRender");
+ }
+ }, this.$computeLayerConfig = function() {
+ if (!this.$size.scrollerHeight) return this.onResize(!0);
+ var e = this.session, t = this.scrollTop % this.lineHeight, n = this.$size.scrollerHeight + this.lineHeight, i = this.$getLongestLine(), o = this.$hScrollBarAlwaysVisible || this.$size.scrollerWidth - i < 0, r = this.$horizScroll !== o;
+ this.$horizScroll = o, r && (this.scroller.style.overflowX = o ? "scroll" : "hidden",
+ o || this.session.setScrollLeft(0));
+ var s = this.session.getScreenLength() * this.lineHeight;
+ this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, s - this.$size.scrollerHeight)));
+ var a, l, c = Math.ceil(n / this.lineHeight) - 1, u = Math.max(0, Math.round((this.scrollTop - t) / this.lineHeight)), d = u + c, h = this.lineHeight;
+ u = e.screenToDocumentRow(u, 0);
+ var p = e.getFoldLine(u);
+ p && (u = p.start.row), a = e.documentToScreenRow(u, 0), l = e.getRowLength(u) * h,
+ d = Math.min(e.screenToDocumentRow(d, 0), e.getLength() - 1), n = this.$size.scrollerHeight + e.getRowLength(d) * h + l,
+ t = this.scrollTop - a * h, this.layerConfig = {
+ width: i,
+ padding: this.$padding,
+ firstRow: u,
+ firstRowScreen: a,
+ lastRow: d,
+ lineHeight: h,
+ characterWidth: this.characterWidth,
+ minHeight: n,
+ maxHeight: s,
+ offset: t,
+ height: this.$size.scrollerHeight
+ }, this.$gutterLayer.element.style.marginTop = -t + "px", this.content.style.marginTop = -t + "px",
+ this.content.style.width = i + 2 * this.$padding + "px", this.content.style.height = n + "px",
+ r && this.onResize(!0);
+ }, this.$updateLines = function() {
+ var e = this.$changedLines.firstRow, t = this.$changedLines.lastRow;
+ this.$changedLines = null;
+ var n = this.layerConfig;
+ return e > n.lastRow + 1 || t < n.firstRow ? void 0 : 1/0 === t ? (this.$showGutter && this.$gutterLayer.update(n),
+ this.$textLayer.update(n), void 0) : (this.$textLayer.updateLines(n, e, t), !0);
+ }, this.$getLongestLine = function() {
+ var e = this.session.getScreenWidth();
+ return this.$textLayer.showInvisibles && (e += 1), Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(e * this.characterWidth));
+ }, this.updateFrontMarkers = function() {
+ this.$markerFront.setMarkers(this.session.getMarkers(!0)), this.$loop.schedule(this.CHANGE_MARKER_FRONT);
+ }, this.updateBackMarkers = function() {
+ this.$markerBack.setMarkers(this.session.getMarkers()), this.$loop.schedule(this.CHANGE_MARKER_BACK);
+ }, this.addGutterDecoration = function(e, t) {
+ this.$gutterLayer.addGutterDecoration(e, t);
+ }, this.removeGutterDecoration = function(e, t) {
+ this.$gutterLayer.removeGutterDecoration(e, t);
+ }, this.updateBreakpoints = function() {
+ this.$loop.schedule(this.CHANGE_GUTTER);
+ }, this.setAnnotations = function(e) {
+ this.$gutterLayer.setAnnotations(e), this.$loop.schedule(this.CHANGE_GUTTER);
+ }, this.updateCursor = function() {
+ this.$loop.schedule(this.CHANGE_CURSOR);
+ }, this.hideCursor = function() {
+ this.$cursorLayer.hideCursor();
+ }, this.showCursor = function() {
+ this.$cursorLayer.showCursor();
+ }, this.scrollSelectionIntoView = function(e, t, n) {
+ this.scrollCursorIntoView(e, n), this.scrollCursorIntoView(t, n);
+ }, this.scrollCursorIntoView = function(e, t) {
+ if (0 !== this.$size.scrollerHeight) {
+ var n = this.$cursorLayer.getPixelPosition(e), i = n.left, o = n.top;
+ this.scrollTop > o ? (t && (o -= t * this.$size.scrollerHeight), this.session.setScrollTop(o)) : this.scrollTop + this.$size.scrollerHeight < o + this.lineHeight && (t && (o += t * this.$size.scrollerHeight),
+ this.session.setScrollTop(o + this.lineHeight - this.$size.scrollerHeight));
+ var r = this.scrollLeft;
+ r > i ? (i < this.$padding + 2 * this.layerConfig.characterWidth && (i = 0), this.session.setScrollLeft(i)) : r + this.$size.scrollerWidth < i + this.characterWidth && this.session.setScrollLeft(Math.round(i + this.characterWidth - this.$size.scrollerWidth));
+ }
+ }, this.getScrollTop = function() {
+ return this.session.getScrollTop();
+ }, this.getScrollLeft = function() {
+ return this.session.getScrollLeft();
+ }, this.getScrollTopRow = function() {
+ return this.scrollTop / this.lineHeight;
+ }, this.getScrollBottomRow = function() {
+ return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
+ }, this.scrollToRow = function(e) {
+ this.session.setScrollTop(e * this.lineHeight);
+ }, this.alignCursor = function(e, t) {
+ "number" == typeof e && (e = {
+ row: e,
+ column: 0
+ });
+ var n = this.$cursorLayer.getPixelPosition(e), i = this.$size.scrollerHeight - this.lineHeight, o = n.top - i * (t || 0);
+ return this.session.setScrollTop(o), o;
+ }, this.STEPS = 8, this.$calcSteps = function(e, t) {
+ var n = 0, i = this.STEPS, o = [], r = function(e, t, n) {
+ return n * (Math.pow(e - 1, 3) + 1) + t;
+ };
+ for (n = 0; i > n; ++n) o.push(r(n / this.STEPS, e, t - e));
+ return o;
+ }, this.scrollToLine = function(e, t, n, i) {
+ var o = this.$cursorLayer.getPixelPosition({
+ row: e,
+ column: 0
+ }), r = o.top;
+ t && (r -= this.$size.scrollerHeight / 2);
+ var s = this.scrollTop;
+ this.session.setScrollTop(r), n !== !1 && this.animateScrolling(s, i);
+ }, this.animateScrolling = function(e, t) {
+ var n = this.scrollTop;
+ if (this.$animatedScroll) {
+ var i = this, o = i.$calcSteps(e, n);
+ this.$scrollAnimation = {
+ from: e,
+ to: n
+ }, clearInterval(this.$timer), i.session.setScrollTop(o.shift()), this.$timer = setInterval(function() {
+ o.length ? (i.session.setScrollTop(o.shift()), i.session.$scrollTop = n) : null != n ? (i.session.$scrollTop = -1,
+ i.session.setScrollTop(n), n = null) : (i.$timer = clearInterval(i.$timer), i.$scrollAnimation = null,
+ t && t());
+ }, 10);
+ }
+ }, this.scrollToY = function(e) {
+ this.scrollTop !== e && (this.$loop.schedule(this.CHANGE_SCROLL), this.scrollTop = e);
+ }, this.scrollToX = function(e) {
+ 0 > e && (e = 0), this.scrollLeft !== e && (this.scrollLeft = e), this.$loop.schedule(this.CHANGE_H_SCROLL);
+ }, this.scrollBy = function(e, t) {
+ t && this.session.setScrollTop(this.session.getScrollTop() + t), e && this.session.setScrollLeft(this.session.getScrollLeft() + e);
+ }, this.isScrollableBy = function(e, t) {
+ return 0 > t && this.session.getScrollTop() >= 1 ? !0 : t > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 ? !0 : void 0;
+ }, this.pixelToScreenCoordinates = function(e, t) {
+ var n = this.scroller.getBoundingClientRect(), i = (e + this.scrollLeft - n.left - this.$padding) / this.characterWidth, o = Math.floor((t + this.scrollTop - n.top) / this.lineHeight), r = Math.round(i);
+ return {
+ row: o,
+ column: r,
+ side: i - r > 0 ? 1 : -1
+ };
+ }, this.screenToTextCoordinates = function(e, t) {
+ var n = this.scroller.getBoundingClientRect(), i = Math.round((e + this.scrollLeft - n.left - this.$padding) / this.characterWidth), o = Math.floor((t + this.scrollTop - n.top) / this.lineHeight);
+ return this.session.screenToDocumentPosition(o, Math.max(i, 0));
+ }, this.textToScreenCoordinates = function(e, t) {
+ var n = this.scroller.getBoundingClientRect(), i = this.session.documentToScreenPosition(e, t), o = this.$padding + Math.round(i.column * this.characterWidth), r = i.row * this.lineHeight;
+ return {
+ pageX: n.left + o - this.scrollLeft,
+ pageY: n.top + r - this.scrollTop
+ };
+ }, this.visualizeFocus = function() {
+ i.addCssClass(this.container, "ace_focus");
+ }, this.visualizeBlur = function() {
+ i.removeCssClass(this.container, "ace_focus");
+ }, this.showComposition = function() {
+ this.$composition || (this.$composition = {
+ keepTextAreaAtCursor: this.$keepTextAreaAtCursor,
+ cssText: this.textarea.style.cssText
+ }), this.$keepTextAreaAtCursor = !0, i.addCssClass(this.textarea, "ace_composition"),
+ this.textarea.style.cssText = "", this.$moveTextAreaToCursor();
+ }, this.setCompositionText = function() {
+ this.$moveTextAreaToCursor();
+ }, this.hideComposition = function() {
+ this.$composition && (i.removeCssClass(this.textarea, "ace_composition"), this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor,
+ this.textarea.style.cssText = this.$composition.cssText, this.$composition = null);
+ }, this.setTheme = function(e) {
+ function t(t) {
+ if (n.$themeValue == e && t.cssClass) {
+ i.importCssString(t.cssText, t.cssClass, n.container.ownerDocument), n.theme && i.removeCssClass(n.container, n.theme.cssClass),
+ n.$theme = t.cssClass, n.theme = t, i.addCssClass(n.container, t.cssClass), i.setCssClass(n.container, "ace_dark", t.isDark);
+ var o = t.padding || 4;
+ n.$padding && o != n.$padding && n.setPadding(o), n.$size && (n.$size.width = 0,
+ n.onResize()), n._dispatchEvent("themeLoaded", {
+ theme: t
+ });
+ }
+ }
+ var n = this;
+ if (this.$themeValue = e, n._dispatchEvent("themeChange", {
+ theme: e
+ }), e && "string" != typeof e) t(e); else {
+ var o = e || "ace/theme/textmate";
+ s.loadModule([ "theme", o ], t);
+ }
+ }, this.getTheme = function() {
+ return this.$themeValue;
+ }, this.setStyle = function(e, t) {
+ i.setCssClass(this.container, e, 0 != t);
+ }, this.unsetStyle = function(e) {
+ i.removeCssClass(this.container, e);
+ }, this.destroy = function() {
+ this.$textLayer.destroy(), this.$cursorLayer.destroy();
+ };
+ }).call(g.prototype), s.defineOptions(g.prototype, "renderer", {
+ animatedScroll: {
+ initialValue: !1
+ },
+ showInvisibles: {
+ set: function(e) {
+ this.$textLayer.setShowInvisibles(e) && this.$loop.schedule(this.CHANGE_TEXT);
+ },
+ initialValue: !1
+ },
+ showPrintMargin: {
+ set: function() {
+ this.$updatePrintMargin();
+ },
+ initialValue: !0
+ },
+ printMarginColumn: {
+ set: function() {
+ this.$updatePrintMargin();
+ },
+ initialValue: 80
+ },
+ printMargin: {
+ set: function(e) {
+ "number" == typeof e && (this.$printMarginColumn = e), this.$showPrintMargin = !!e,
+ this.$updatePrintMargin();
+ },
+ get: function() {
+ return this.$showPrintMargin && this.$printMarginColumn;
+ }
+ },
+ showGutter: {
+ set: function(e) {
+ this.$gutter.style.display = e ? "block" : "none", this.onGutterResize();
+ },
+ initialValue: !0
+ },
+ fadeFoldWidgets: {
+ set: function(e) {
+ i.setCssClass(this.$gutter, "ace_fade-fold-widgets", e);
+ },
+ initialValue: !1
+ },
+ showFoldWidgets: {
+ set: function(e) {
+ this.$gutterLayer.setShowFoldWidgets(e);
+ },
+ initialValue: !0
+ },
+ displayIndentGuides: {
+ set: function(e) {
+ this.$textLayer.setDisplayIndentGuides(e) && this.$loop.schedule(this.CHANGE_TEXT);
+ },
+ initialValue: !0
+ },
+ highlightGutterLine: {
+ set: function(e) {
+ return this.$gutterLineHighlight ? (this.$gutterLineHighlight.style.display = e ? "" : "none",
+ this.$cursorLayer.$pixelPos && this.$updateGutterLineHighlight(), void 0) : (this.$gutterLineHighlight = i.createElement("div"),
+ this.$gutterLineHighlight.className = "ace_gutter-active-line", this.$gutter.appendChild(this.$gutterLineHighlight),
+ void 0);
+ },
+ initialValue: !1,
+ value: !0
+ },
+ hScrollBarAlwaysVisible: {
+ set: function(e) {
+ this.$hScrollBarAlwaysVisible = e, this.$hScrollBarAlwaysVisible && this.$horizScroll || this.$loop.schedule(this.CHANGE_SCROLL);
+ },
+ initialValue: !1
+ },
+ fontSize: {
+ set: function(e) {
+ "number" == typeof e && (e += "px"), this.container.style.fontSize = e, this.updateFontSize();
+ },
+ initialValue: 12
+ },
+ fontFamily: {
+ set: function(e) {
+ this.container.style.fontFamily = e, this.updateFontSize();
+ }
+ }
+ }), t.VirtualRenderer = g;
+}), define("ace/mouse/multi_select_handler", [ "require", "exports", "module", "../lib/event" ], function(e, t) {
+ function n(e, t) {
+ return e.row == t.row && e.column == t.column;
+ }
+ function i(e) {
+ var t = e.domEvent, i = t.altKey, r = t.shiftKey, s = e.getAccelKey(), a = e.getButton();
+ if (e.editor.inMultiSelectMode && 2 == a) return e.editor.textInput.onContextMenu(e.domEvent),
+ void 0;
+ if (!s && !i) return 0 == a && e.editor.inMultiSelectMode && e.editor.exitMultiSelectMode(),
+ void 0;
+ var l = e.editor, c = l.selection, u = l.inMultiSelectMode, d = e.getDocumentPosition(), h = c.getCursor(), p = e.inSelection() || c.isEmpty() && n(d, h), f = e.x, g = e.y, m = function(e) {
+ f = e.clientX, g = e.clientY;
+ }, v = function() {
+ var e = l.renderer.pixelToScreenCoordinates(f, g), t = b.screenToDocumentPosition(e.row, e.column);
+ n(w, e) && n(t, c.selectionLead) || (w = e, l.selection.moveCursorToPosition(t),
+ l.selection.clearSelection(), l.renderer.scrollCursorIntoView(), l.removeSelectionMarkers(C),
+ C = c.rectangularRangeBlock(w, y), C.forEach(l.addSelectionMarker, l), l.updateSelectionMarkers());
+ }, b = l.session, y = l.renderer.pixelToScreenCoordinates(f, g), w = y;
+ if (!s || r || i || 0 != a) {
+ if (i && 0 == a) {
+ e.stop(), u && !s ? c.toSingleRange() : !u && s && c.addRange();
+ var C = [];
+ r ? (y = b.documentToScreenPosition(c.lead), v()) : (c.moveCursorToPosition(d),
+ c.clearSelection());
+ var x = function() {
+ clearInterval(A), l.removeSelectionMarkers(C);
+ for (var e = 0; e < C.length; e++) c.addRange(C[e]);
+ }, E = v;
+ o.capture(l.container, m, x);
+ var A = setInterval(function() {
+ E();
+ }, 20);
+ return e.preventDefault();
+ }
+ } else {
+ if (!u && p) return;
+ if (!u) {
+ var S = c.toOrientedRange();
+ l.addSelectionMarker(S);
+ }
+ var k = c.rangeList.rangeAtPoint(d);
+ l.once("mouseup", function() {
+ var e = c.toOrientedRange();
+ k && e.isEmpty() && n(k.cursor, e.cursor) ? c.substractPoint(e.cursor) : (S && (l.removeSelectionMarker(S),
+ c.addRange(S)), c.addRange(e));
+ });
+ }
+ }
+ var o = e("../lib/event");
+ t.onMouseDown = i;
+}), define("ace/commands/multi_select_commands", [ "require", "exports", "module", "../keyboard/hash_handler" ], function(e, t) {
+ t.defaultCommands = [ {
+ name: "addCursorAbove",
+ exec: function(e) {
+ e.selectMoreLines(-1);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Up",
+ mac: "Ctrl-Alt-Up"
+ },
+ readonly: !0
+ }, {
+ name: "addCursorBelow",
+ exec: function(e) {
+ e.selectMoreLines(1);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Down",
+ mac: "Ctrl-Alt-Down"
+ },
+ readonly: !0
+ }, {
+ name: "addCursorAboveSkipCurrent",
+ exec: function(e) {
+ e.selectMoreLines(-1, !0);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Shift-Up",
+ mac: "Ctrl-Alt-Shift-Up"
+ },
+ readonly: !0
+ }, {
+ name: "addCursorBelowSkipCurrent",
+ exec: function(e) {
+ e.selectMoreLines(1, !0);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Shift-Down",
+ mac: "Ctrl-Alt-Shift-Down"
+ },
+ readonly: !0
+ }, {
+ name: "selectMoreBefore",
+ exec: function(e) {
+ e.selectMore(-1);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Left",
+ mac: "Ctrl-Alt-Left"
+ },
+ readonly: !0
+ }, {
+ name: "selectMoreAfter",
+ exec: function(e) {
+ e.selectMore(1);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Right",
+ mac: "Ctrl-Alt-Right"
+ },
+ readonly: !0
+ }, {
+ name: "selectNextBefore",
+ exec: function(e) {
+ e.selectMore(-1, !0);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Shift-Left",
+ mac: "Ctrl-Alt-Shift-Left"
+ },
+ readonly: !0
+ }, {
+ name: "selectNextAfter",
+ exec: function(e) {
+ e.selectMore(1, !0);
+ },
+ bindKey: {
+ win: "Ctrl-Alt-Shift-Right",
+ mac: "Ctrl-Alt-Shift-Right"
+ },
+ readonly: !0
+ }, {
+ name: "splitIntoLines",
+ exec: function(e) {
+ e.multiSelect.splitIntoLines();
+ },
+ bindKey: {
+ win: "Ctrl-Alt-L",
+ mac: "Ctrl-Alt-L"
+ },
+ readonly: !0
+ }, {
+ name: "alignCursors",
+ exec: function(e) {
+ e.alignCursors();
+ },
+ bindKey: {
+ win: "Ctrl-Alt-A",
+ mac: "Ctrl-Alt-A"
+ }
+ } ], t.multiSelectCommands = [ {
+ name: "singleSelection",
+ bindKey: "esc",
+ exec: function(e) {
+ e.exitMultiSelectMode();
+ },
+ readonly: !0,
+ isAvailable: function(e) {
+ return e && e.inMultiSelectMode;
+ }
+ } ];
+ var n = e("../keyboard/hash_handler").HashHandler;
+ t.keyboardHandler = new n(t.multiSelectCommands);
+}), define("ace/multi_select", [ "require", "exports", "module", "./range_list", "./range", "./selection", "./mouse/multi_select_handler", "./lib/event", "./lib/lang", "./commands/multi_select_commands", "./search", "./edit_session", "./editor" ], function(e, t) {
+ function n(e, t, n) {
+ return f.$options.wrap = !0, f.$options.needle = t, f.$options.backwards = -1 == n,
+ f.find(e);
+ }
+ function i(e, t) {
+ return e.row == t.row && e.column == t.column;
+ }
+ function o(e) {
+ e.$onAddRange = e.$onAddRange.bind(e), e.$onRemoveRange = e.$onRemoveRange.bind(e),
+ e.$onMultiSelect = e.$onMultiSelect.bind(e), e.$onSingleSelect = e.$onSingleSelect.bind(e),
+ t.onSessionChange.call(e, e), e.on("changeSession", t.onSessionChange.bind(e)),
+ e.on("mousedown", c), e.commands.addCommands(h.defaultCommands), r(e);
+ }
+ function r(e) {
+ function t() {
+ i && (o.style.cursor = "", i = !1);
+ }
+ var n = e.textInput.getElement(), i = !1, o = e.renderer.content;
+ u.addListener(n, "keydown", function(e) {
+ 18 != e.keyCode || e.ctrlKey || e.shiftKey || e.metaKey ? i && (o.style.cursor = "") : i || (o.style.cursor = "crosshair",
+ i = !0);
+ }), u.addListener(n, "keyup", t), u.addListener(n, "blur", t);
+ }
+ var s = e("./range_list").RangeList, a = e("./range").Range, l = e("./selection").Selection, c = e("./mouse/multi_select_handler").onMouseDown, u = e("./lib/event"), d = e("./lib/lang"), h = e("./commands/multi_select_commands");
+ t.commands = h.defaultCommands.concat(h.multiSelectCommands);
+ var p = e("./search").Search, f = new p(), g = e("./edit_session").EditSession;
+ (function() {
+ this.getSelectionMarkers = function() {
+ return this.$selectionMarkers;
+ };
+ }).call(g.prototype), function() {
+ this.ranges = null, this.rangeList = null, this.addRange = function(e, t) {
+ if (e) {
+ if (!this.inMultiSelectMode && 0 == this.rangeCount) {
+ var n = this.toOrientedRange();
+ if (this.rangeList.add(n), this.rangeList.add(e), 2 != this.rangeList.ranges.length) return this.rangeList.removeAll(),
+ t || this.fromOrientedRange(e);
+ this.rangeList.removeAll(), this.rangeList.add(n), this.$onAddRange(n);
+ }
+ e.cursor || (e.cursor = e.end);
+ var i = this.rangeList.add(e);
+ return this.$onAddRange(e), i.length && this.$onRemoveRange(i), this.rangeCount > 1 && !this.inMultiSelectMode && (this._emit("multiSelect"),
+ this.inMultiSelectMode = !0, this.session.$undoSelect = !1, this.rangeList.attach(this.session)),
+ t || this.fromOrientedRange(e);
+ }
+ }, this.toSingleRange = function(e) {
+ e = e || this.ranges[0];
+ var t = this.rangeList.removeAll();
+ t.length && this.$onRemoveRange(t), e && this.fromOrientedRange(e);
+ }, this.substractPoint = function(e) {
+ var t = this.rangeList.substractPoint(e);
+ return t ? (this.$onRemoveRange(t), t[0]) : void 0;
+ }, this.mergeOverlappingRanges = function() {
+ var e = this.rangeList.merge();
+ e.length ? this.$onRemoveRange(e) : this.ranges[0] && this.fromOrientedRange(this.ranges[0]);
+ }, this.$onAddRange = function(e) {
+ this.rangeCount = this.rangeList.ranges.length, this.ranges.unshift(e), this._emit("addRange", {
+ range: e
+ });
+ }, this.$onRemoveRange = function(e) {
+ if (this.rangeCount = this.rangeList.ranges.length, 1 == this.rangeCount && this.inMultiSelectMode) {
+ var t = this.rangeList.ranges.pop();
+ e.push(t), this.rangeCount = 0;
+ }
+ for (var n = e.length; n--; ) {
+ var i = this.ranges.indexOf(e[n]);
+ this.ranges.splice(i, 1);
+ }
+ this._emit("removeRange", {
+ ranges: e
+ }), 0 == this.rangeCount && this.inMultiSelectMode && (this.inMultiSelectMode = !1,
+ this._emit("singleSelect"), this.session.$undoSelect = !0, this.rangeList.detach(this.session)),
+ t = t || this.ranges[0], t && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
+ }, this.$initRangeList = function() {
+ this.rangeList || (this.rangeList = new s(), this.ranges = [], this.rangeCount = 0);
+ }, this.getAllRanges = function() {
+ return this.rangeList.ranges.concat();
+ }, this.splitIntoLines = function() {
+ if (this.rangeCount > 1) {
+ var e = this.rangeList.ranges, t = e[e.length - 1], n = a.fromPoints(e[0].start, t.end);
+ this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
+ } else {
+ var n = this.getRange(), i = this.isBackwards(), o = n.start.row, r = n.end.row;
+ if (o == r) {
+ if (i) var s = n.end, l = n.start; else var s = n.start, l = n.end;
+ return this.addRange(a.fromPoints(l, l)), this.addRange(a.fromPoints(s, s)), void 0;
+ }
+ var c = [], u = this.getLineRange(o, !0);
+ u.start.column = n.start.column, c.push(u);
+ for (var d = o + 1; r > d; d++) c.push(this.getLineRange(d, !0));
+ u = this.getLineRange(r, !0), u.end.column = n.end.column, c.push(u), c.forEach(this.addRange, this);
+ }
+ }, this.toggleBlockSelection = function() {
+ if (this.rangeCount > 1) {
+ var e = this.rangeList.ranges, t = e[e.length - 1], n = a.fromPoints(e[0].start, t.end);
+ this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
+ } else {
+ var i = this.session.documentToScreenPosition(this.selectionLead), o = this.session.documentToScreenPosition(this.selectionAnchor), r = this.rectangularRangeBlock(i, o);
+ r.forEach(this.addRange, this);
+ }
+ }, this.rectangularRangeBlock = function(e, t, n) {
+ var o = [], r = e.column < t.column;
+ if (r) var s = e.column, l = t.column; else var s = t.column, l = e.column;
+ var c = e.row < t.row;
+ if (c) var u = e.row, d = t.row; else var u = t.row, d = e.row;
+ 0 > s && (s = 0), 0 > u && (u = 0), u == d && (n = !0);
+ for (var h = u; d >= h; h++) {
+ var p = a.fromPoints(this.session.screenToDocumentPosition(h, s), this.session.screenToDocumentPosition(h, l));
+ if (p.isEmpty()) {
+ if (f && i(p.end, f)) break;
+ var f = p.end;
+ }
+ p.cursor = r ? p.start : p.end, o.push(p);
+ }
+ if (c && o.reverse(), !n) {
+ for (var g = o.length - 1; o[g].isEmpty() && g > 0; ) g--;
+ if (g > 0) for (var m = 0; o[m].isEmpty(); ) m++;
+ for (var v = g; v >= m; v--) o[v].isEmpty() && o.splice(v, 1);
+ }
+ return o;
+ };
+ }.call(l.prototype);
+ var m = e("./editor").Editor;
+ (function() {
+ this.updateSelectionMarkers = function() {
+ this.renderer.updateCursor(), this.renderer.updateBackMarkers();
+ }, this.addSelectionMarker = function(e) {
+ e.cursor || (e.cursor = e.end);
+ var t = this.getSelectionStyle();
+ return e.marker = this.session.addMarker(e, "ace_selection", t), this.session.$selectionMarkers.push(e),
+ this.session.selectionMarkerCount = this.session.$selectionMarkers.length, e;
+ }, this.removeSelectionMarker = function(e) {
+ if (e.marker) {
+ this.session.removeMarker(e.marker);
+ var t = this.session.$selectionMarkers.indexOf(e);
+ -1 != t && this.session.$selectionMarkers.splice(t, 1), this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
+ }
+ }, this.removeSelectionMarkers = function(e) {
+ for (var t = this.session.$selectionMarkers, n = e.length; n--; ) {
+ var i = e[n];
+ if (i.marker) {
+ this.session.removeMarker(i.marker);
+ var o = t.indexOf(i);
+ -1 != o && t.splice(o, 1);
+ }
+ }
+ this.session.selectionMarkerCount = t.length;
+ }, this.$onAddRange = function(e) {
+ this.addSelectionMarker(e.range), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
+ }, this.$onRemoveRange = function(e) {
+ this.removeSelectionMarkers(e.ranges), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
+ }, this.$onMultiSelect = function() {
+ this.inMultiSelectMode || (this.inMultiSelectMode = !0, this.setStyle("ace_multiselect"),
+ this.keyBinding.addKeyboardHandler(h.keyboardHandler), this.commands.setDefaultHandler("exec", this.$onMultiSelectExec),
+ this.renderer.updateCursor(), this.renderer.updateBackMarkers());
+ }, this.$onSingleSelect = function() {
+ this.session.multiSelect.inVirtualMode || (this.inMultiSelectMode = !1, this.unsetStyle("ace_multiselect"),
+ this.keyBinding.removeKeyboardHandler(h.keyboardHandler), this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec),
+ this.renderer.updateCursor(), this.renderer.updateBackMarkers());
+ }, this.$onMultiSelectExec = function(e) {
+ var t = e.command, n = e.editor;
+ if (n.multiSelect) {
+ if (t.multiSelectAction) "forEach" == t.multiSelectAction ? i = n.forEachSelection(t, e.args) : "forEachLine" == t.multiSelectAction ? i = n.forEachSelection(t, e.args, !0) : "single" == t.multiSelectAction ? (n.exitMultiSelectMode(),
+ i = t.exec(n, e.args || {})) : i = t.multiSelectAction(n, e.args || {}); else {
+ var i = t.exec(n, e.args || {});
+ n.multiSelect.addRange(n.multiSelect.toOrientedRange()), n.multiSelect.mergeOverlappingRanges();
+ }
+ return i;
+ }
+ }, this.forEachSelection = function(e, t, n) {
+ if (!this.inVirtualSelectionMode) {
+ var i, o = this.session, r = this.selection, s = r.rangeList, a = r._eventRegistry;
+ r._eventRegistry = {};
+ var c = new l(o);
+ this.inVirtualSelectionMode = !0;
+ for (var u = s.ranges.length; u--; ) {
+ if (n) for (;u > 0 && s.ranges[u].start.row == s.ranges[u - 1].end.row; ) u--;
+ c.fromOrientedRange(s.ranges[u]), this.selection = o.selection = c;
+ var d = e.exec(this, t || {});
+ void 0 == !i && (i = d), c.toOrientedRange(s.ranges[u]);
+ }
+ c.detach(), this.selection = o.selection = r, this.inVirtualSelectionMode = !1,
+ r._eventRegistry = a, r.mergeOverlappingRanges();
+ var h = this.renderer.$scrollAnimation;
+ return this.onCursorChange(), this.onSelectionChange(), h && h.from == h.to && this.renderer.animateScrolling(h.from),
+ i;
+ }
+ }, this.exitMultiSelectMode = function() {
+ this.inMultiSelectMode && !this.inVirtualSelectionMode && this.multiSelect.toSingleRange();
+ }, this.getCopyText = function() {
+ var e = "";
+ if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
+ for (var t = this.multiSelect.rangeList.ranges, n = [], i = 0; i < t.length; i++) n.push(this.session.getTextRange(t[i]));
+ var o = this.session.getDocument().getNewLineCharacter();
+ e = n.join(o), e.length == (n.length - 1) * o.length && (e = "");
+ } else this.selection.isEmpty() || (e = this.session.getTextRange(this.getSelectionRange()));
+ return this._signal("copy", e), e;
+ }, this.onPaste = function(e) {
+ if (!this.$readOnly) {
+ if (this._signal("paste", e), !this.inMultiSelectMode || this.inVirtualSelectionMode) return this.insert(e);
+ var t = e.split(/\r\n|\r|\n/), n = this.selection.rangeList.ranges;
+ if (t.length > n.length || t.length < 2 || !t[1]) return this.commands.exec("insertstring", this, e);
+ for (var i = n.length; i--; ) {
+ var o = n[i];
+ o.isEmpty() || this.session.remove(o), this.session.insert(o.start, t[i]);
+ }
+ }
+ }, this.findAll = function(e, t, n) {
+ t = t || {}, t.needle = e || t.needle, this.$search.set(t);
+ var i = this.$search.findAll(this.session);
+ if (!i.length) return 0;
+ this.$blockScrolling += 1;
+ var o = this.multiSelect;
+ n || o.toSingleRange(i[0]);
+ for (var r = i.length; r--; ) o.addRange(i[r], !0);
+ return this.$blockScrolling -= 1, i.length;
+ }, this.selectMoreLines = function(e, t) {
+ var n = this.selection.toOrientedRange(), i = n.cursor == n.end, o = this.session.documentToScreenPosition(n.cursor);
+ this.selection.$desiredColumn && (o.column = this.selection.$desiredColumn);
+ var r = this.session.screenToDocumentPosition(o.row + e, o.column);
+ if (n.isEmpty()) var s = r; else var l = this.session.documentToScreenPosition(i ? n.end : n.start), s = this.session.screenToDocumentPosition(l.row + e, l.column);
+ if (i) {
+ var c = a.fromPoints(r, s);
+ c.cursor = c.start;
+ } else {
+ var c = a.fromPoints(s, r);
+ c.cursor = c.end;
+ }
+ if (c.desiredColumn = o.column, this.selection.inMultiSelectMode) {
+ if (t) var u = n.cursor;
+ } else this.selection.addRange(n);
+ this.selection.addRange(c), u && this.selection.substractPoint(u);
+ }, this.transposeSelections = function(e) {
+ for (var t = this.session, n = t.multiSelect, i = n.ranges, o = i.length; o--; ) {
+ var r = i[o];
+ if (r.isEmpty()) {
+ var s = t.getWordRange(r.start.row, r.start.column);
+ r.start.row = s.start.row, r.start.column = s.start.column, r.end.row = s.end.row,
+ r.end.column = s.end.column;
+ }
+ }
+ n.mergeOverlappingRanges();
+ for (var a = [], o = i.length; o--; ) {
+ var r = i[o];
+ a.unshift(t.getTextRange(r));
+ }
+ 0 > e ? a.unshift(a.pop()) : a.push(a.shift());
+ for (var o = i.length; o--; ) {
+ var r = i[o], s = r.clone();
+ t.replace(r, a[o]), r.start.row = s.start.row, r.start.column = s.start.column;
+ }
+ }, this.selectMore = function(e, t) {
+ var i = this.session, o = i.multiSelect, r = o.toOrientedRange();
+ if (r.isEmpty()) {
+ var r = i.getWordRange(r.start.row, r.start.column);
+ r.cursor = r.end, this.multiSelect.addRange(r);
+ }
+ var s = i.getTextRange(r), a = n(i, s, e);
+ a && (a.cursor = -1 == e ? a.start : a.end, this.multiSelect.addRange(a)), t && this.multiSelect.substractPoint(r.cursor);
+ }, this.alignCursors = function() {
+ var e = this.session, t = e.multiSelect, n = t.ranges;
+ if (n.length) {
+ var i = -1, o = n.filter(function(e) {
+ return e.cursor.row == i ? !0 : (i = e.cursor.row, void 0);
+ });
+ t.$onRemoveRange(o);
+ var r = 0, s = 1/0, l = n.map(function(t) {
+ var n = t.cursor, i = e.getLine(n.row), o = i.substr(n.column).search(/\S/g);
+ return -1 == o && (o = 0), n.column > r && (r = n.column), s > o && (s = o), o;
+ });
+ n.forEach(function(t, n) {
+ var i = t.cursor, o = r - i.column, c = l[n] - s;
+ o > c ? e.insert(i, d.stringRepeat(" ", o - c)) : e.remove(new a(i.row, i.column, i.row, i.column - o + c)),
+ t.start.column = t.end.column = r, t.start.row = t.end.row = i.row, t.cursor = t.end;
+ }), t.fromOrientedRange(n[0]), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
+ } else {
+ var c = this.selection.getRange(), u = c.start.row, h = c.end.row, p = this.session.doc.removeLines(u, h);
+ p = this.$reAlignText(p), this.session.doc.insertLines(u, p), c.start.column = 0,
+ c.end.column = p[p.length - 1].length, this.selection.setRange(c);
+ }
+ }, this.$reAlignText = function(e) {
+ function t(e) {
+ return d.stringRepeat(" ", e);
+ }
+ function n(e) {
+ return e[2] ? t(r) + e[2] + t(s - e[2].length + a) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
+ }
+ function i(e) {
+ return e[2] ? t(r + s - e[2].length) + e[2] + t(a, " ") + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
+ }
+ function o(e) {
+ return e[2] ? t(r) + e[2] + t(a) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
+ }
+ var r, s, a, l = !0, c = !0;
+ return e.map(function(e) {
+ var t = e.match(/(\s*)(.*?)(\s*)([=:].*)/);
+ return t ? null == r ? (r = t[1].length, s = t[2].length, a = t[3].length, t) : (r + s + a != t[1].length + t[2].length + t[3].length && (c = !1),
+ r != t[1].length && (l = !1), r > t[1].length && (r = t[1].length), s < t[2].length && (s = t[2].length),
+ a > t[3].length && (a = t[3].length), t) : [ e ];
+ }).map(l ? c ? i : n : o);
+ };
+ }).call(m.prototype), t.onSessionChange = function(e) {
+ var t = e.session;
+ t.multiSelect || (t.$selectionMarkers = [], t.selection.$initRangeList(), t.multiSelect = t.selection),
+ this.multiSelect = t.multiSelect;
+ var n = e.oldSession;
+ n && (n.multiSelect.removeEventListener("addRange", this.$onAddRange), n.multiSelect.removeEventListener("removeRange", this.$onRemoveRange),
+ n.multiSelect.removeEventListener("multiSelect", this.$onMultiSelect), n.multiSelect.removeEventListener("singleSelect", this.$onSingleSelect)),
+ t.multiSelect.on("addRange", this.$onAddRange), t.multiSelect.on("removeRange", this.$onRemoveRange),
+ t.multiSelect.on("multiSelect", this.$onMultiSelect), t.multiSelect.on("singleSelect", this.$onSingleSelect),
+ this.inMultiSelectMode != t.selection.inMultiSelectMode && (t.selection.inMultiSelectMode ? this.$onMultiSelect() : this.$onSingleSelect());
+ }, t.MultiSelect = o;
+}), define("ace/worker/worker_client", [ "require", "exports", "module", "../lib/oop", "../lib/event_emitter", "../config" ], function(e, t) {
+ var n = e("../lib/oop"), i = e("../lib/event_emitter").EventEmitter, o = e("../config"), r = function(t, n, i) {
+ this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this),
+ this.onMessage = this.onMessage.bind(this), this.onError = this.onError.bind(this),
+ e.nameToUrl && !e.toUrl && (e.toUrl = e.nameToUrl);
+ var r;
+ if (o.get("packaged") || !e.toUrl) r = o.moduleUrl(n, "worker"); else {
+ var s = this.$normalizePath;
+ r = s(e.toUrl("ace/worker/worker.js", null, "_"));
+ var a = {};
+ t.forEach(function(t) {
+ a[t] = s(e.toUrl(t, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
+ });
+ }
+ this.$worker = new Worker(r), this.$worker.postMessage({
+ init: !0,
+ tlns: a,
+ module: n,
+ classname: i
+ }), this.callbackId = 1, this.callbacks = {}, this.$worker.onerror = this.onError,
+ this.$worker.onmessage = this.onMessage;
+ };
+ (function() {
+ n.implement(this, i), this.onError = function(e) {
+ throw window.console && console.log && console.log(e), e;
+ }, this.onMessage = function(e) {
+ var t = e.data;
+ switch (t.type) {
+ case "log":
+ window.console && console.log && console.log.apply(console, t.data);
+ break;
+
+ case "event":
+ this._emit(t.name, {
+ data: t.data
+ });
+ break;
+
+ case "call":
+ var n = this.callbacks[t.id];
+ n && (n(t.data), delete this.callbacks[t.id]);
+ }
+ }, this.$normalizePath = function(e) {
+ return location.host ? (e = e.replace(/^[a-z]+:\/\/[^\/]+/, ""), e = location.protocol + "//" + location.host + ("/" == e.charAt(0) ? "" : location.pathname.replace(/\/[^\/]*$/, "")) + "/" + e.replace(/^[\/]+/, "")) : e;
+ }, this.terminate = function() {
+ this._emit("terminate", {}), this.$worker.terminate(), this.$worker = null, this.$doc.removeEventListener("change", this.changeListener),
+ this.$doc = null;
+ }, this.send = function(e, t) {
+ this.$worker.postMessage({
+ command: e,
+ args: t
+ });
+ }, this.call = function(e, t, n) {
+ if (n) {
+ var i = this.callbackId++;
+ this.callbacks[i] = n, t.push(i);
+ }
+ this.send(e, t);
+ }, this.emit = function(e, t) {
+ try {
+ this.$worker.postMessage({
+ event: e,
+ data: {
+ data: t.data
+ }
+ });
+ } catch (n) {}
+ }, this.attachToDocument = function(e) {
+ this.$doc && this.terminate(), this.$doc = e, this.call("setValue", [ e.getValue() ]),
+ e.on("change", this.changeListener);
+ }, this.changeListener = function(e) {
+ this.deltaQueue ? this.deltaQueue.push(e.data) : (this.deltaQueue = [ e.data ],
+ setTimeout(this.$sendDeltaQueue, 1));
+ }, this.$sendDeltaQueue = function() {
+ var e = this.deltaQueue;
+ e && (this.deltaQueue = null, e.length > 20 && e.length > this.$doc.getLength() >> 1 ? this.call("setValue", [ this.$doc.getValue() ]) : this.emit("change", {
+ data: e
+ }));
+ };
+ }).call(r.prototype);
+ var s = function(e, t, n) {
+ this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this),
+ this.callbackId = 1, this.callbacks = {}, this.messageBuffer = [];
+ var r = null, s = Object.create(i), a = this;
+ this.$worker = {}, this.$worker.terminate = function() {}, this.$worker.postMessage = function(e) {
+ a.messageBuffer.push(e), r && setTimeout(l);
+ };
+ var l = function() {
+ var e = a.messageBuffer.shift();
+ e.command ? r[e.command].apply(r, e.args) : e.event && s._emit(e.event, e.data);
+ };
+ s.postMessage = function(e) {
+ a.onMessage({
+ data: e
+ });
+ }, s.callback = function(e, t) {
+ this.postMessage({
+ type: "call",
+ id: t,
+ data: e
+ });
+ }, s.emit = function(e, t) {
+ this.postMessage({
+ type: "event",
+ name: e,
+ data: t
+ });
+ }, o.loadModule([ "worker", t ], function(e) {
+ for (r = new e[n](s); a.messageBuffer.length; ) l();
+ });
+ };
+ s.prototype = r.prototype, t.UIWorkerClient = s, t.WorkerClient = r;
+}), define("ace/placeholder", [ "require", "exports", "module", "./range", "./lib/event_emitter", "./lib/oop" ], function(e, t) {
+ var n = e("./range").Range, i = e("./lib/event_emitter").EventEmitter, o = e("./lib/oop"), r = function(e, t, n, i, o, r) {
+ var s = this;
+ this.length = t, this.session = e, this.doc = e.getDocument(), this.mainClass = o,
+ this.othersClass = r, this.$onUpdate = this.onUpdate.bind(this), this.doc.on("change", this.$onUpdate),
+ this.$others = i, this.$onCursorChange = function() {
+ setTimeout(function() {
+ s.onCursorChange();
+ });
+ }, this.$pos = n;
+ var a = e.getUndoManager().$undoStack || e.getUndoManager().$undostack || {
+ length: -1
+ };
+ this.$undoStackDepth = a.length, this.setup(), e.selection.on("changeCursor", this.$onCursorChange);
+ };
+ (function() {
+ o.implement(this, i), this.setup = function() {
+ var e = this, t = this.doc, i = this.session, o = this.$pos;
+ this.pos = t.createAnchor(o.row, o.column), this.markerId = i.addMarker(new n(o.row, o.column, o.row, o.column + this.length), this.mainClass, null, !1),
+ this.pos.on("change", function(t) {
+ i.removeMarker(e.markerId), e.markerId = i.addMarker(new n(t.value.row, t.value.column, t.value.row, t.value.column + e.length), e.mainClass, null, !1);
+ }), this.others = [], this.$others.forEach(function(n) {
+ var i = t.createAnchor(n.row, n.column);
+ e.others.push(i);
+ }), i.setUndoSelect(!1);
+ }, this.showOtherMarkers = function() {
+ if (!this.othersActive) {
+ var e = this.session, t = this;
+ this.othersActive = !0, this.others.forEach(function(i) {
+ i.markerId = e.addMarker(new n(i.row, i.column, i.row, i.column + t.length), t.othersClass, null, !1),
+ i.on("change", function(o) {
+ e.removeMarker(i.markerId), i.markerId = e.addMarker(new n(o.value.row, o.value.column, o.value.row, o.value.column + t.length), t.othersClass, null, !1);
+ });
+ });
+ }
+ }, this.hideOtherMarkers = function() {
+ if (this.othersActive) {
+ this.othersActive = !1;
+ for (var e = 0; e < this.others.length; e++) this.session.removeMarker(this.others[e].markerId);
+ }
+ }, this.onUpdate = function(e) {
+ var t = e.data, i = t.range;
+ if (i.start.row === i.end.row && i.start.row === this.pos.row && !this.$updating) {
+ this.$updating = !0;
+ var o = "insertText" === t.action ? i.end.column - i.start.column : i.start.column - i.end.column;
+ if (i.start.column >= this.pos.column && i.start.column <= this.pos.column + this.length + 1) {
+ var r = i.start.column - this.pos.column;
+ if (this.length += o, !this.session.$fromUndo) {
+ if ("insertText" === t.action) for (var s = this.others.length - 1; s >= 0; s--) {
+ var a = this.others[s], l = {
+ row: a.row,
+ column: a.column + r
+ };
+ a.row === i.start.row && i.start.column < a.column && (l.column += o), this.doc.insert(l, t.text);
+ } else if ("removeText" === t.action) for (var s = this.others.length - 1; s >= 0; s--) {
+ var a = this.others[s], l = {
+ row: a.row,
+ column: a.column + r
+ };
+ a.row === i.start.row && i.start.column < a.column && (l.column += o), this.doc.remove(new n(l.row, l.column, l.row, l.column - o));
+ }
+ i.start.column === this.pos.column && "insertText" === t.action ? setTimeout(function() {
+ this.pos.setPosition(this.pos.row, this.pos.column - o);
+ for (var e = 0; e < this.others.length; e++) {
+ var t = this.others[e], n = {
+ row: t.row,
+ column: t.column - o
+ };
+ t.row === i.start.row && i.start.column < t.column && (n.column += o), t.setPosition(n.row, n.column);
+ }
+ }.bind(this), 0) : i.start.column === this.pos.column && "removeText" === t.action && setTimeout(function() {
+ for (var e = 0; e < this.others.length; e++) {
+ var t = this.others[e];
+ t.row === i.start.row && i.start.column < t.column && t.setPosition(t.row, t.column - o);
+ }
+ }.bind(this), 0);
+ }
+ this.pos._emit("change", {
+ value: this.pos
+ });
+ for (var s = 0; s < this.others.length; s++) this.others[s]._emit("change", {
+ value: this.others[s]
+ });
+ }
+ this.$updating = !1;
+ }
+ }, this.onCursorChange = function(e) {
+ if (!this.$updating) {
+ var t = this.session.selection.getCursor();
+ 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));
+ }
+ }, this.detach = function() {
+ this.session.removeMarker(this.markerId), this.hideOtherMarkers(), this.doc.removeEventListener("change", this.$onUpdate),
+ this.session.selection.removeEventListener("changeCursor", this.$onCursorChange),
+ this.pos.detach();
+ for (var e = 0; e < this.others.length; e++) this.others[e].detach();
+ this.session.setUndoSelect(!0);
+ }, this.cancel = function() {
+ if (-1 === this.$undoStackDepth) throw Error("Canceling placeholders only supported with undo manager attached to session.");
+ for (var e = this.session.getUndoManager(), t = (e.$undoStack || e.$undostack).length - this.$undoStackDepth, n = 0; t > n; n++) e.undo(!0);
+ };
+ }).call(r.prototype), t.PlaceHolder = r;
+}), define("ace/mode/folding/fold_mode", [ "require", "exports", "module", "../../range" ], function(e, t) {
+ var n = e("../../range").Range, i = t.FoldMode = function() {};
+ (function() {
+ this.foldingStartMarker = null, this.foldingStopMarker = null, this.getFoldWidget = function(e, t, n) {
+ var i = e.getLine(n);
+ return this.foldingStartMarker.test(i) ? "start" : "markbeginend" == t && this.foldingStopMarker && this.foldingStopMarker.test(i) ? "end" : "";
+ }, this.getFoldWidgetRange = function() {
+ return null;
+ }, this.indentationBlock = function(e, t, i) {
+ var o = /\S/, r = e.getLine(t), s = r.search(o);
+ if (-1 != s) {
+ for (var a = i || r.length, l = e.getLength(), c = t, u = t; ++t < l; ) {
+ var d = e.getLine(t).search(o);
+ if (-1 != d) {
+ if (s >= d) break;
+ u = t;
+ }
+ }
+ if (u > c) {
+ var h = e.getLine(u).length;
+ return new n(c, a, u, h);
+ }
+ }
+ }, this.openingBracketBlock = function(e, t, i, o, r) {
+ var s = {
+ row: i,
+ column: o + 1
+ }, a = e.$findClosingBracket(t, s, r);
+ if (a) {
+ var l = e.foldWidgets[a.row];
+ return null == l && (l = this.getFoldWidget(e, a.row)), "start" == l && a.row > s.row && (a.row--,
+ a.column = e.getLine(a.row).length), n.fromPoints(s, a);
+ }
+ }, this.closingBracketBlock = function(e, t, i, o) {
+ var r = {
+ row: i,
+ column: o
+ }, s = e.$findOpeningBracket(t, r);
+ return s ? (s.column++, r.column--, n.fromPoints(s, r)) : void 0;
+ };
+ }).call(i.prototype);
+}), define("ace/theme/textmate", [ "require", "exports", "module", "../requirejs/text!./textmate.css", "../lib/dom" ], function(e, t) {
+ t.isDark = !1, t.cssClass = "ace-tm", t.cssText = e("../requirejs/text!./textmate.css");
+ var n = e("../lib/dom");
+ n.importCssString(t.cssText, t.cssClass);
+}), define("ace/ace", [ "require", "exports", "module", "./lib/fixoldbrowsers", "./lib/dom", "./lib/event", "./editor", "./edit_session", "./undomanager", "./virtual_renderer", "./multi_select", "./worker/worker_client", "./keyboard/hash_handler", "./placeholder", "./mode/folding/fold_mode", "./theme/textmate", "./config" ], function(e, t) {
+ e("./lib/fixoldbrowsers");
+ var n = e("./lib/dom"), i = e("./lib/event"), o = e("./editor").Editor, r = e("./edit_session").EditSession, s = e("./undomanager").UndoManager, a = e("./virtual_renderer").VirtualRenderer, l = e("./multi_select").MultiSelect;
+ e("./worker/worker_client"), e("./keyboard/hash_handler"), e("./placeholder"), e("./mode/folding/fold_mode"),
+ e("./theme/textmate"), t.config = e("./config"), t.require = e, t.edit = function(e) {
+ if ("string" == typeof e) {
+ var r = e, e = document.getElementById(r);
+ if (!e) throw "ace.edit can't find div #" + r;
+ }
+ if (e.env && e.env.editor instanceof o) return e.env.editor;
+ var s = t.createEditSession(n.getInnerText(e));
+ e.innerHTML = "";
+ var c = new o(new a(e));
+ new l(c), c.setSession(s);
+ var u = {
+ document: s,
+ editor: c,
+ onResize: c.resize.bind(c, null)
+ };
+ return i.addListener(window, "resize", u.onResize), c.on("destroy", function() {
+ i.removeListener(window, "resize", u.onResize);
+ }), e.env = c.env = u, c;
+ }, t.createEditSession = function(e, t) {
+ var n = new r(e, t);
+ return n.setUndoManager(new s()), n;
+ }, t.EditSession = r, t.UndoManager = s;
+}), define("ace", [ "ace/ace" ], function(e) {
+ return e;
});
var saveAs = saveAs || navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator) || function(e) {
var t = e.document, n = function() {
return e.URL || e.webkitURL || e;
- }, i = e.URL || e.webkitURL || e, o = t.createElementNS("http://www.w3.org/1999/xhtml", "a"), r = !e.externalHost && "download" in o, a = function(n) {
+ }, i = e.URL || e.webkitURL || e, o = t.createElementNS("http://www.w3.org/1999/xhtml", "a"), r = !e.externalHost && "download" in o, s = function(n) {
var i = t.createEvent("MouseEvents");
i.initMouseEvent("click", !0, !1, e, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), n.dispatchEvent(i);
- }, s = e.webkitRequestFileSystem, l = e.requestFileSystem || s || e.mozRequestFileSystem, c = function(t) {
+ }, a = e.webkitRequestFileSystem, l = e.requestFileSystem || a || e.mozRequestFileSystem, c = function(t) {
(e.setImmediate || e.setTimeout)(function() {
throw t;
}, 0);
- }, u = "application/octet-stream", d = 0, p = [], f = function() {
- for (var e = p.length; e--; ) {
- var t = p[e];
+ }, u = "application/octet-stream", d = 0, h = [], p = function() {
+ for (var e = h.length; e--; ) {
+ var t = h[e];
"string" == typeof t ? i.revokeObjectURL(t) : t.remove();
}
- p.length = 0;
- }, h = function(e, t, n) {
+ h.length = 0;
+ }, f = function(e, t, n) {
t = [].concat(t);
for (var i = t.length; i--; ) {
var o = e["on" + t[i]];
@@ -3991,61 +11180,61 @@ var saveAs = saveAs || navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.
c(r);
}
}
- }, m = function(t, i) {
- var c, f, m, g = this, v = t.type, b = !1, y = function() {
+ }, g = function(t, i) {
+ var c, p, g, m = this, v = t.type, b = !1, y = function() {
var e = n().createObjectURL(t);
- return p.push(e), e;
- }, x = function() {
- h(g, "writestart progress write writeend".split(" "));
+ return h.push(e), e;
}, w = function() {
- (b || !c) && (c = y(t)), f ? f.location.href = c : window.open(c, "_blank"), g.readyState = g.DONE,
- x();
- }, C = function(e) {
+ f(m, "writestart progress write writeend".split(" "));
+ }, C = function() {
+ (b || !c) && (c = y(t)), p ? p.location.href = c : window.open(c, "_blank"), m.readyState = m.DONE,
+ w();
+ }, x = function(e) {
return function() {
- return g.readyState !== g.DONE ? e.apply(this, arguments) : void 0;
+ return m.readyState !== m.DONE ? e.apply(this, arguments) : void 0;
};
- }, k = {
+ }, E = {
create: !0,
exclusive: !1
};
- return g.readyState = g.INIT, i || (i = "download"), r ? (c = y(t), o.href = c,
- o.download = i, a(o), g.readyState = g.DONE, x(), void 0) : (e.chrome && v && v !== u && (m = t.slice || t.webkitSlice,
- t = m.call(t, 0, t.size, u), b = !0), s && "download" !== i && (i += ".download"),
- (v === u || s) && (f = e), l ? (d += t.size, l(e.TEMPORARY, d, C(function(e) {
- e.root.getDirectory("saved", k, C(function(e) {
+ return m.readyState = m.INIT, i || (i = "download"), r ? (c = y(t), o.href = c,
+ o.download = i, s(o), m.readyState = m.DONE, w(), void 0) : (e.chrome && v && v !== u && (g = t.slice || t.webkitSlice,
+ t = g.call(t, 0, t.size, u), b = !0), a && "download" !== i && (i += ".download"),
+ (v === u || a) && (p = e), l ? (d += t.size, l(e.TEMPORARY, d, x(function(e) {
+ e.root.getDirectory("saved", E, x(function(e) {
var n = function() {
- e.getFile(i, k, C(function(e) {
- e.createWriter(C(function(n) {
+ e.getFile(i, E, x(function(e) {
+ e.createWriter(x(function(n) {
n.onwriteend = function(t) {
- f.location.href = e.toURL(), p.push(e), g.readyState = g.DONE, h(g, "writeend", t);
+ p.location.href = e.toURL(), h.push(e), m.readyState = m.DONE, f(m, "writeend", t);
}, n.onerror = function() {
var e = n.error;
- e.code !== e.ABORT_ERR && w();
+ e.code !== e.ABORT_ERR && C();
}, "writestart progress write abort".split(" ").forEach(function(e) {
- n["on" + e] = g["on" + e];
- }), n.write(t), g.abort = function() {
- n.abort(), g.readyState = g.DONE;
- }, g.readyState = g.WRITING;
- }), w);
- }), w);
+ n["on" + e] = m["on" + e];
+ }), n.write(t), m.abort = function() {
+ n.abort(), m.readyState = m.DONE;
+ }, m.readyState = m.WRITING;
+ }), C);
+ }), C);
};
e.getFile(i, {
create: !1
- }, C(function(e) {
+ }, x(function(e) {
e.remove(), n();
- }), C(function(e) {
- e.code === e.NOT_FOUND_ERR ? n() : w();
+ }), x(function(e) {
+ e.code === e.NOT_FOUND_ERR ? n() : C();
}));
- }), w);
- }), w), void 0) : (w(), void 0));
- }, g = m.prototype, v = function(e, t) {
- return new m(e, t);
+ }), C);
+ }), C), void 0) : (C(), void 0));
+ }, m = g.prototype, v = function(e, t) {
+ return new g(e, t);
};
- return g.abort = function() {
+ return m.abort = function() {
var e = this;
- e.readyState = e.DONE, h(e, "abort");
- }, g.readyState = g.INIT = 0, g.WRITING = 1, g.DONE = 2, g.error = g.onwritestart = g.onprogress = g.onwrite = g.onabort = g.onerror = g.onwriteend = null,
- e.addEventListener("unload", f, !1), v;
+ e.readyState = e.DONE, f(e, "abort");
+ }, m.readyState = m.INIT = 0, m.WRITING = 1, m.DONE = 2, m.error = m.onwritestart = m.onprogress = m.onwrite = m.onabort = m.onerror = m.onwriteend = null,
+ e.addEventListener("unload", p, !1), v;
}(self);
define("FileSaver", function() {}), "undefined" != typeof module && module.exports && (module.exports = printStackTrace),
@@ -4088,10 +11277,10 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
return e.stack.replace(/(?:\n@:0)?\s+$/m, "").replace(/^[\(@]/gm, "{anonymous}()@").split("\n");
},
opera11: function(e) {
- for (var t = "{anonymous}", n = /^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/, i = e.stacktrace.split("\n"), o = [], r = 0, a = i.length; a > r; r += 2) {
- var s = n.exec(i[r]);
- if (s) {
- var l = s[4] + ":" + s[1] + ":" + s[2], c = s[3] || "global code";
+ for (var t = "{anonymous}", n = /^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/, i = e.stacktrace.split("\n"), o = [], r = 0, s = i.length; s > r; r += 2) {
+ var a = n.exec(i[r]);
+ if (a) {
+ var l = a[4] + ":" + a[1] + ":" + a[2], c = a[3] || "global code";
c = c.replace(//, "$1").replace(//, t),
o.push(c + "@" + l + " -- " + i[r + 1].replace(/^\s+/, ""));
}
@@ -4100,33 +11289,33 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
},
opera10b: function(e) {
for (var t = /^(.*)@(.+):(\d+)$/, n = e.stacktrace.split("\n"), i = [], o = 0, r = n.length; r > o; o++) {
- var a = t.exec(n[o]);
- if (a) {
- var s = a[1] ? a[1] + "()" : "global code";
- i.push(s + "@" + a[2] + ":" + a[3]);
+ var s = t.exec(n[o]);
+ if (s) {
+ var a = s[1] ? s[1] + "()" : "global code";
+ i.push(a + "@" + s[2] + ":" + s[3]);
}
}
return i;
},
opera10a: function(e) {
- for (var t = "{anonymous}", n = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, i = e.stacktrace.split("\n"), o = [], r = 0, a = i.length; a > r; r += 2) {
- var s = n.exec(i[r]);
- if (s) {
- var l = s[3] || t;
- o.push(l + "()@" + s[2] + ":" + s[1] + " -- " + i[r + 1].replace(/^\s+/, ""));
+ for (var t = "{anonymous}", n = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, i = e.stacktrace.split("\n"), o = [], r = 0, s = i.length; s > r; r += 2) {
+ var a = n.exec(i[r]);
+ if (a) {
+ var l = a[3] || t;
+ o.push(l + "()@" + a[2] + ":" + a[1] + " -- " + i[r + 1].replace(/^\s+/, ""));
}
}
return o;
},
opera9: function(e) {
- for (var t = "{anonymous}", n = /Line (\d+).*script (?:in )?(\S+)/i, i = e.message.split("\n"), o = [], r = 2, a = i.length; a > r; r += 2) {
- var s = n.exec(i[r]);
- s && o.push(t + "()@" + s[2] + ":" + s[1] + " -- " + i[r + 1].replace(/^\s+/, ""));
+ for (var t = "{anonymous}", n = /Line (\d+).*script (?:in )?(\S+)/i, i = e.message.split("\n"), o = [], r = 2, s = i.length; s > r; r += 2) {
+ var a = n.exec(i[r]);
+ a && o.push(t + "()@" + a[2] + ":" + a[1] + " -- " + i[r + 1].replace(/^\s+/, ""));
}
return o;
},
other: function(e) {
- for (var t, n, i = "{anonymous}", o = /function\s*([\w\-$]+)?\s*\(/i, r = [], a = 10; e && e.arguments && r.length < a; ) t = o.test(e.toString()) ? RegExp.$1 || i : i,
+ for (var t, n, i = "{anonymous}", o = /function\s*([\w\-$]+)?\s*\(/i, r = [], s = 10; e && e.arguments && r.length < s; ) t = o.test(e.toString()) ? RegExp.$1 || i : i,
n = Array.prototype.slice.call(e.arguments || []), r[r.length] = t + "(" + this.stringifyArguments(n) + ")",
e = e.caller;
return r;
@@ -4170,11 +11359,11 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
for (var t = 0; t < e.length; ++t) {
var n = /\{anonymous\}\(.*\)@(.*)/, i = /^(.*?)(?::(\d+))(?::(\d+))?(?: -- .+)?$/, o = e[t], r = n.exec(o);
if (r) {
- var a = i.exec(r[1]);
- if (a) {
- var s = a[1], l = a[2], c = a[3] || 0;
- if (s && this.isSameDomain(s) && l) {
- var u = this.guessAnonymousFunction(s, l, c);
+ var s = i.exec(r[1]);
+ if (s) {
+ var a = s[1], l = s[2], c = s[3] || 0;
+ if (a && this.isSameDomain(a) && l) {
+ var u = this.guessAnonymousFunction(a, l, c);
e[t] = o.replace("{anonymous}", u);
}
}
@@ -4192,11 +11381,11 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
return n;
},
findFunctionName: function(e, t) {
- for (var n, i, o, r = /function\s+([^(]*?)\s*\(([^)]*)\)/, a = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/, s = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/, l = "", c = Math.min(t, 20), u = 0; c > u; ++u) if (n = e[t - u - 1],
+ for (var n, i, o, r = /function\s+([^(]*?)\s*\(([^)]*)\)/, s = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/, a = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/, l = "", c = Math.min(t, 20), u = 0; c > u; ++u) if (n = e[t - u - 1],
o = n.indexOf("//"), o >= 0 && (n = n.substr(0, o)), n) {
- if (l = n + l, i = a.exec(l), i && i[1]) return i[1];
+ if (l = n + l, i = s.exec(l), i && i[1]) return i[1];
if (i = r.exec(l), i && i[1]) return i[1];
- if (i = s.exec(l), i && i[1]) return i[1];
+ if (i = a.exec(l), i && i[1]) return i[1];
}
return "(?)";
}
@@ -4228,7 +11417,7 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
}, utils.getInputIntValue = function(e, t, n, i) {
e = jqElt(e);
var o = utils.getInputTextValue(e, t);
- return void 0 === o ? void 0 : (o = parseInt(o), 0/0 === o || void 0 !== n && n > o || void 0 !== i && o > i ? (inputError(e, t),
+ return void 0 === o ? void 0 : (o = parseInt(o), isNaN(o) || void 0 !== n && n > o || void 0 !== i && o > i ? (inputError(e, t),
void 0) : o);
}, utils.getInputRegExpValue = function(e, t) {
e = jqElt(e);
@@ -4332,16 +11521,16 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
var t, n, i = [], o = 0;
for (e = encodeURI(e), t = e.length; t > o; ) n = e[o], o += 1, "%" !== n ? i.push(n.charCodeAt(0)) : (n = e[o] + e[o + 1],
i.push(parseInt(n, 16)), o += 2);
- var r, a, s = "=", l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = [], u = i.length - i.length % 3;
- for (r = 0; u > r; r += 3) a = i[r] << 16 | i[r + 1] << 8 | i[r + 2], c.push(l.charAt(a >> 18)),
- c.push(l.charAt(63 & a >> 12)), c.push(l.charAt(63 & a >> 6)), c.push(l.charAt(63 & a));
+ var r, s, a = "=", l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = [], u = i.length - i.length % 3;
+ for (r = 0; u > r; r += 3) s = i[r] << 16 | i[r + 1] << 8 | i[r + 2], c.push(l.charAt(s >> 18)),
+ c.push(l.charAt(63 & s >> 12)), c.push(l.charAt(63 & s >> 6)), c.push(l.charAt(63 & s));
switch (i.length - u) {
case 1:
- a = i[r] << 16, c.push(l.charAt(a >> 18) + l.charAt(63 & a >> 12) + s + s);
+ s = i[r] << 16, c.push(l.charAt(s >> 18) + l.charAt(63 & s >> 12) + a + a);
break;
case 2:
- a = i[r] << 16 | i[r + 1] << 8, c.push(l.charAt(a >> 18) + l.charAt(63 & a >> 12) + l.charAt(63 & a >> 6) + s);
+ s = i[r] << 16 | i[r + 1] << 8, c.push(l.charAt(s >> 18) + l.charAt(63 & s >> 12) + l.charAt(63 & s >> 6) + a);
}
return c.join("");
};
@@ -4353,7 +11542,7 @@ printStackTrace.implementation = function() {}, printStackTrace.implementation.p
}, utils;
});
-var VERSION = "2.0.3", MAIN_URL = "http://benweet.github.io/stackedit/", GOOGLE_ANALYTICS_ACCOUNT_ID = "UA-39556145-1", GOOGLE_API_KEY = "AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw", GOOGLE_SCOPES = [ "https://www.googleapis.com/auth/drive.install", "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/blogger", "https://picasaweb.google.com/data/" ], GOOGLE_DRIVE_APP_ID = "241271498917", DROPBOX_APP_KEY = "lq6mwopab8wskas", DROPBOX_APP_SECRET = "851fgnucpezy84t", BITLY_ACCESS_TOKEN = "317e033bfd48cf31155a68a536b1860013b09c4c", DEFAULT_FILE_TITLE = "Title", DEFAULT_FOLDER_NAME = "New folder", GDRIVE_DEFAULT_FILE_TITLE = "New Markdown document", CHECK_ONLINE_PERIOD = 12e4, AJAX_TIMEOUT = 3e4, ASYNC_TASK_DEFAULT_TIMEOUT = 6e4, ASYNC_TASK_LONG_TIMEOUT = 18e4, SYNC_PERIOD = 18e4, USER_IDLE_THRESHOLD = 3e5, IMPORT_FILE_MAX_CONTENT_SIZE = 1e5, IMPORT_IMG_MAX_CONTENT_SIZE = 1e7, TEMPORARY_FILE_INDEX = "file.tempIndex", WELCOME_DOCUMENT_TITLE = "Welcome document", DOWNLOAD_PROXY_URL = "http://stackedit-download-proxy.herokuapp.com/", PICASA_PROXY_URL = "http://stackedit-picasa-proxy.herokuapp.com/", WORDPRESS_CLIENT_ID = "3185", WORDPRESS_PROXY_URL = "http://stackedit-wordpress-proxy.herokuapp.com/", SSH_PROXY_URL = "http://stackedit-ssh-proxy.herokuapp.com/", delayedFunction = void 0, BASE_URL = "http://localhost/stackedit/", GOOGLE_CLIENT_ID = "241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com", GITHUB_CLIENT_ID = "e47fef6055344579799d", GATEKEEPER_URL = "http://stackedit-gatekeeper-localhost.herokuapp.com/", TUMBLR_PROXY_URL = "http://stackedit-tumblr-proxy-local.herokuapp.com/";
+var VERSION = "2.1.0", MAIN_URL = "http://benweet.github.io/stackedit/", GOOGLE_ANALYTICS_ACCOUNT_ID = "UA-39556145-1", GOOGLE_API_KEY = "AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw", GOOGLE_SCOPES = [ "https://www.googleapis.com/auth/drive.install", "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/blogger", "https://picasaweb.google.com/data/" ], GOOGLE_DRIVE_APP_ID = "241271498917", DROPBOX_APP_KEY = "lq6mwopab8wskas", DROPBOX_APP_SECRET = "851fgnucpezy84t", BITLY_ACCESS_TOKEN = "317e033bfd48cf31155a68a536b1860013b09c4c", DEFAULT_FILE_TITLE = "Title", DEFAULT_FOLDER_NAME = "New folder", GDRIVE_DEFAULT_FILE_TITLE = "New Markdown document", EDITOR_DEFAULT_PADDING = 12, CHECK_ONLINE_PERIOD = 12e4, AJAX_TIMEOUT = 3e4, ASYNC_TASK_DEFAULT_TIMEOUT = 6e4, ASYNC_TASK_LONG_TIMEOUT = 18e4, SYNC_PERIOD = 18e4, USER_IDLE_THRESHOLD = 3e5, IMPORT_FILE_MAX_CONTENT_SIZE = 1e5, IMPORT_IMG_MAX_CONTENT_SIZE = 1e7, TEMPORARY_FILE_INDEX = "file.tempIndex", WELCOME_DOCUMENT_TITLE = "Welcome document", DOWNLOAD_PROXY_URL = "http://stackedit-download-proxy.herokuapp.com/", PICASA_PROXY_URL = "http://stackedit-picasa-proxy.herokuapp.com/", WORDPRESS_CLIENT_ID = "3185", WORDPRESS_PROXY_URL = "http://stackedit-wordpress-proxy.herokuapp.com/", SSH_PROXY_URL = "http://stackedit-ssh-proxy.herokuapp.com/", delayedFunction = void 0, BASE_URL = "http://localhost/stackedit/", GOOGLE_CLIENT_ID = "241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com", GITHUB_CLIENT_ID = "e47fef6055344579799d", GATEKEEPER_URL = "http://stackedit-gatekeeper-localhost.herokuapp.com/", TUMBLR_PROXY_URL = "http://stackedit-tumblr-proxy-local.herokuapp.com/";
0 === location.hostname.indexOf("benweet.github.io") && (BASE_URL = MAIN_URL, GOOGLE_CLIENT_ID = "241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",
GITHUB_CLIENT_ID = "fa0d09514da8377ee32e", GATEKEEPER_URL = "http://stackedit-gatekeeper.herokuapp.com/",
@@ -4372,8 +11561,9 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
var t = {
layoutOrientation: "horizontal",
lazyRendering: !0,
- editorFontFamily: "Courier New, Courier, monospace",
- editorFontSize: 14,
+ editorFontFamily: 'Menlo, Consolas, "Courier New", Courier, monospace',
+ editorFontSize: 12,
+ editorMaxWidth: 960,
defaultContent: "\n\n\n> Written with [StackEdit](" + MAIN_URL + ").",
commitMsg: "Published with " + MAIN_URL,
template: [ "\n", "\n", "\n", '\n', "<%= documentTitle %>\n", '\n', '\n', "\n", '
<%= documentHTML %>
\n', "" ].join(""),
@@ -4385,17 +11575,18 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
} catch (n) {}
return t;
}), define("classes/Extension", [], function() {
- function e(e, t, n, i) {
- this.extensionId = e, this.extensionName = t, this.isOptional = n, this.disableInViewer = i;
+ function e(e, t, n, i, o) {
+ this.extensionId = e, this.extensionName = t, this.isOptional = n, this.disableInViewer = i,
+ this.disableInLight = o;
}
return e;
}), define("text", [ "module" ], function(e) {
- var t, n, i, o, r, a = [ "Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0" ], s = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, l = /]*>\s*([\s\S]+)\s*<\/body>/im, c = "undefined" != typeof location && location.href, u = c && location.protocol && location.protocol.replace(/\:/, ""), d = c && location.hostname, p = c && (location.port || void 0), f = {}, h = e.config && e.config() || {};
+ var t, n, i, o, r, s = [ "Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0" ], a = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, l = /]*>\s*([\s\S]+)\s*<\/body>/im, c = "undefined" != typeof location && location.href, u = c && location.protocol && location.protocol.replace(/\:/, ""), d = c && location.hostname, h = c && (location.port || void 0), p = {}, f = e.config && e.config() || {};
return t = {
version: "2.0.10",
strip: function(e) {
if (e) {
- e = e.replace(s, "");
+ e = e.replace(a, "");
var t = e.match(l);
t && (e = t[1]);
} else e = "";
@@ -4404,24 +11595,24 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
jsEscape: function(e) {
return e.replace(/(['\\])/g, "\\$1").replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n").replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r").replace(/[\u2028]/g, "\\u2028").replace(/[\u2029]/g, "\\u2029");
},
- createXhr: h.createXhr || function() {
+ createXhr: f.createXhr || function() {
var e, t, n;
if ("undefined" != typeof XMLHttpRequest) return new XMLHttpRequest();
if ("undefined" != typeof ActiveXObject) for (t = 0; 3 > t; t += 1) {
- n = a[t];
+ n = s[t];
try {
e = new ActiveXObject(n);
} catch (i) {}
if (e) {
- a = [ n ];
+ s = [ n ];
break;
}
}
return e;
},
parseName: function(e) {
- var t, n, i, o = !1, r = e.indexOf("."), a = 0 === e.indexOf("./") || 0 === e.indexOf("../");
- return -1 !== r && (!a || r > 1) ? (t = e.substring(0, r), n = e.substring(r + 1, e.length)) : t = e,
+ var t, n, i, o = !1, r = e.indexOf("."), s = 0 === e.indexOf("./") || 0 === e.indexOf("../");
+ return -1 !== r && (!s || r > 1) ? (t = e.substring(0, r), n = e.substring(r + 1, e.length)) : t = e,
i = n || t, r = i.indexOf("!"), -1 !== r && (o = "strip" === i.substring(r + 1),
i = i.substring(0, r), n ? n = i : t = i), {
moduleName: t,
@@ -4431,32 +11622,32 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
},
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
useXhr: function(e, n, i, o) {
- var r, a, s, l = t.xdRegExp.exec(e);
- return l ? (r = l[2], a = l[3], a = a.split(":"), s = a[1], a = a[0], !(r && r !== n || a && a.toLowerCase() !== i.toLowerCase() || (s || a) && s !== o)) : !0;
+ var r, s, a, l = t.xdRegExp.exec(e);
+ return l ? (r = l[2], s = l[3], s = s.split(":"), a = s[1], s = s[0], !(r && r !== n || s && s.toLowerCase() !== i.toLowerCase() || (a || s) && a !== o)) : !0;
},
finishLoad: function(e, n, i, o) {
- i = n ? t.strip(i) : i, h.isBuild && (f[e] = i), o(i);
+ i = n ? t.strip(i) : i, f.isBuild && (p[e] = i), o(i);
},
load: function(e, n, i, o) {
if (o.isBuild && !o.inlineText) return i(), void 0;
- h.isBuild = o.isBuild;
- var r = t.parseName(e), a = r.moduleName + (r.ext ? "." + r.ext : ""), s = n.toUrl(a), l = h.useXhr || t.useXhr;
- return 0 === s.indexOf("empty:") ? (i(), void 0) : (!c || l(s, u, d, p) ? t.get(s, function(n) {
+ f.isBuild = o.isBuild;
+ var r = t.parseName(e), s = r.moduleName + (r.ext ? "." + r.ext : ""), a = n.toUrl(s), l = f.useXhr || t.useXhr;
+ return 0 === a.indexOf("empty:") ? (i(), void 0) : (!c || l(a, u, d, h) ? t.get(a, function(n) {
t.finishLoad(e, r.strip, n, i);
}, function(e) {
i.error && i.error(e);
- }) : n([ a ], function(e) {
+ }) : n([ s ], function(e) {
t.finishLoad(r.moduleName + "." + r.ext, r.strip, e, i);
}), void 0);
},
write: function(e, n, i) {
- if (f.hasOwnProperty(n)) {
- var o = t.jsEscape(f[n]);
+ if (p.hasOwnProperty(n)) {
+ var o = t.jsEscape(p[n]);
i.asModule(e + "!" + n, "define(function () { return '" + o + "';});\n");
}
},
writeFile: function(e, n, i, o, r) {
- var a = t.parseName(n), s = a.ext ? "." + a.ext : "", l = a.moduleName + s, c = i.toUrl(a.moduleName + s) + ".js";
+ var s = t.parseName(n), a = s.ext ? "." + s.ext : "", l = s.moduleName + a, c = i.toUrl(s.moduleName + a) + ".js";
t.load(l, i, function() {
var n = function(e) {
return o(c, e);
@@ -4466,7 +11657,7 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
}, t.write(e, l, n, r);
}, r);
}
- }, "node" === h.env || !h.env && "undefined" != typeof process && process.versions && process.versions.node && !process.versions["node-webkit"] ? (n = require.nodeRequire("fs"),
+ }, "node" === f.env || !f.env && "undefined" != typeof process && process.versions && process.versions.node && !process.versions["node-webkit"] ? (n = require.nodeRequire("fs"),
t.get = function(e, t, i) {
try {
var o = n.readFileSync(e, "utf8");
@@ -4474,36 +11665,36 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
} catch (r) {
i(r);
}
- }) : "xhr" === h.env || !h.env && t.createXhr() ? t.get = function(e, n, i, o) {
- var r, a = t.createXhr();
- if (a.open("GET", e, !0), o) for (r in o) o.hasOwnProperty(r) && a.setRequestHeader(r.toLowerCase(), o[r]);
- h.onXhr && h.onXhr(a, e), a.onreadystatechange = function() {
+ }) : "xhr" === f.env || !f.env && t.createXhr() ? t.get = function(e, n, i, o) {
+ var r, s = t.createXhr();
+ if (s.open("GET", e, !0), o) for (r in o) o.hasOwnProperty(r) && s.setRequestHeader(r.toLowerCase(), o[r]);
+ f.onXhr && f.onXhr(s, e), s.onreadystatechange = function() {
var t, o;
- 4 === a.readyState && (t = a.status, t > 399 && 600 > t ? (o = new Error(e + " HTTP status: " + t),
- o.xhr = a, i(o)) : n(a.responseText), h.onXhrComplete && h.onXhrComplete(a, e));
- }, a.send(null);
- } : "rhino" === h.env || !h.env && "undefined" != typeof Packages && "undefined" != typeof java ? t.get = function(e, t) {
- var n, i, o = "utf-8", r = new java.io.File(e), a = java.lang.System.getProperty("line.separator"), s = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r), o)), l = "";
+ 4 === s.readyState && (t = s.status, t > 399 && 600 > t ? (o = new Error(e + " HTTP status: " + t),
+ o.xhr = s, i(o)) : n(s.responseText), f.onXhrComplete && f.onXhrComplete(s, e));
+ }, s.send(null);
+ } : "rhino" === f.env || !f.env && "undefined" != typeof Packages && "undefined" != typeof java ? t.get = function(e, t) {
+ var n, i, o = "utf-8", r = new java.io.File(e), s = java.lang.System.getProperty("line.separator"), a = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r), o)), l = "";
try {
- for (n = new java.lang.StringBuffer(), i = s.readLine(), i && i.length() && 65279 === i.charAt(0) && (i = i.substring(1)),
- null !== i && n.append(i); null !== (i = s.readLine()); ) n.append(a), n.append(i);
+ for (n = new java.lang.StringBuffer(), i = a.readLine(), i && i.length() && 65279 === i.charAt(0) && (i = i.substring(1)),
+ null !== i && n.append(i); null !== (i = a.readLine()); ) n.append(s), n.append(i);
l = String(n.toString());
} finally {
- s.close();
+ a.close();
}
t(l);
- } : ("xpconnect" === h.env || !h.env && "undefined" != typeof Components && Components.classes && Components.interfaces) && (i = Components.classes,
+ } : ("xpconnect" === f.env || !f.env && "undefined" != typeof Components && Components.classes && Components.interfaces) && (i = Components.classes,
o = Components.interfaces, Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),
r = "@mozilla.org/windows-registry-key;1" in i, t.get = function(e, t) {
- var n, a, s, l = {};
- r && (e = e.replace(/\//g, "\\")), s = new FileUtils.File(e);
+ var n, s, a, l = {};
+ r && (e = e.replace(/\//g, "\\")), a = new FileUtils.File(e);
try {
n = i["@mozilla.org/network/file-input-stream;1"].createInstance(o.nsIFileInputStream),
- n.init(s, 1, 0, !1), a = i["@mozilla.org/intl/converter-input-stream;1"].createInstance(o.nsIConverterInputStream),
- a.init(n, "utf-8", n.available(), o.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),
- a.readString(n.available(), l), a.close(), n.close(), t(l.value);
+ n.init(a, 1, 0, !1), s = i["@mozilla.org/intl/converter-input-stream;1"].createInstance(o.nsIConverterInputStream),
+ s.init(n, "utf-8", n.available(), o.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),
+ s.readString(n.available(), l), s.close(), n.close(), t(l.value);
} catch (c) {
- throw new Error((s && s.path || "") + ": " + c);
+ throw new Error((a && a.path || "") + ": " + c);
}
}), t;
}), define("text!html/settingsExtensionsAccordion.html", [], function() {
@@ -4512,8 +11703,8 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
return "
Renders modified sections only.
\n
\n NOTE: Document sections are based on title elements (h1, h2...). Therefore if\n your document does not contain any title, performance will not be increased.\n
";
}), define("extensions/partialRendering", [ "underscore", "crel", "classes/Extension", "text!html/partialRenderingSettingsBlock.html" ], function(e, t, n, i) {
function o(t, n) {
- if (p = [], d = [], f = void 0, h === !0 || u != n) return h = !1, u = n, d = c,
- c = t, p = t, void 0;
+ if (h = [], d = [], p = void 0, f === !0 || u != n) return f = !1, u = n, d = c,
+ c = t, h = t, void 0;
var i = c.length;
e.some(c, function(e, n) {
return n >= t.length || e.text != t[n].text ? (i = n, !0) : void 0;
@@ -4523,9 +11714,9 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
return n >= t.length || e.text != t[t.length - n - 1].text ? (o = -n, !0) : void 0;
});
var r = c.slice(0, i);
- p = t.slice(i, t.length + o);
- var a = c.slice(c.length + o, c.length);
- f = e.first(a), d = c.slice(i, c.length + o), c = r.concat(p).concat(a);
+ h = t.slice(i, t.length + o);
+ var s = c.slice(c.length + o, c.length);
+ p = e.first(s), d = c.slice(i, c.length + o), c = r.concat(h).concat(s);
}
function r() {
e.each(d, function(e) {
@@ -4533,43 +11724,43 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
b.removeChild(t);
});
var n = document.getElementById("wmd-preview"), i = n.firstChild, o = document.createDocumentFragment();
- e.each(p, function(n) {
+ e.each(h, function(n) {
for (var r = t("div", {
id: "wmd-preview-section-" + n.id,
"class": "wmd-preview-section preview-content"
- }), a = !0; i; ) {
- var s = i.nextSibling;
- if (a === !1 && /(^| )wmd-title($| )/.test(i.className)) break;
- a = !1, "DIV" == i.tagName && "footnotes" == i.className ? e.each(i.querySelectorAll("ol > li"), function(e) {
+ }), s = !0; i; ) {
+ var a = i.nextSibling;
+ if (s === !1 && /(^| )wmd-title($| )/.test(i.className)) break;
+ s = !1, "DIV" == i.tagName && "footnotes" == i.className ? e.each(i.querySelectorAll("ol > li"), function(e) {
var t = e.id.substring(3);
y[t] = e;
- }) : r.appendChild(i), i = s;
+ }) : r.appendChild(i), i = a;
}
o.appendChild(r);
}), n.innerHTML = "";
var r = v;
- void 0 !== f && (r = document.getElementById("wmd-preview-section-" + f.id)), b.insertBefore(o, r),
+ void 0 !== p && (r = document.getElementById("wmd-preview-section-" + p.id)), b.insertBefore(o, r),
v.innerHTML = "";
- var a = [];
- if (g === !0) {
- var s = t("ol");
+ var s = [];
+ if (m === !0) {
+ var a = t("ol");
e.each(b.querySelectorAll("a.footnote"), function(e, t) {
e.textContent = t + 1;
var n = e.id.substring(6);
- a.push(n), s.appendChild(y[n].cloneNode(!0));
- }), a.length > 0 && v.appendChild(t("div", {
+ s.push(n), a.appendChild(y[n].cloneNode(!0));
+ }), s.length > 0 && v.appendChild(t("div", {
"class": "footnotes"
- }, t("hr"), s)), y = e.pick(y, a);
+ }, t("hr"), a)), y = e.pick(y, s);
}
}
- var a = new n("partialRendering", "Partial Rendering", !0);
- a.settingsBlock = i;
- var s = void 0, l = 0, c = [], u = void 0, d = [], p = [], f = void 0, h = !1, m = !1, g = !1;
- a.onSectionsCreated = function(t) {
+ var s = new n("partialRendering", "Partial Rendering", !0);
+ s.settingsBlock = i;
+ var a = void 0, l = 0, c = [], u = void 0, d = [], h = [], p = void 0, f = !1, g = !1, m = !1;
+ s.onSectionsCreated = function(t) {
var n = [], i = "";
- g = !1, e.each(t, function(e) {
- e += "\n\n", m && (e = e.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g, function(e, t) {
- return t ? (g = !0, i += e, "") : e;
+ m = !1, e.each(t, function(e) {
+ e += "\n\n", g && (e = e.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g, function(e, t) {
+ return t ? (m = !0, i += e, "") : e;
})), e = e.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(e, t) {
return t ? (i += e, "") : e;
}), /\S/.test(e) && n.push({
@@ -4579,33 +11770,42 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
}), o(n, i);
};
var v = void 0, b = void 0, y = {};
- return a.onEditorConfigure = function(t) {
- s = t.getConverter(), s.hooks.chain("preConversion", function() {
- var t = e.map(p, function(e) {
+ return s.onPagedownConfigure = function(t) {
+ a = t.getConverter(), a.hooks.chain("preConversion", function() {
+ var t = e.map(h, function(e) {
return e.text;
});
return t.push(u + "\n\n"), t.join("");
}), t.hooks.chain("onPreviewRefresh", function() {
r();
});
- }, a.onReady = function() {
+ }, s.onReady = function() {
v = t("div", {
id: "wmd-preview-section-footnotes",
"class": "preview-content"
}), b = document.getElementById("preview-contents"), b.appendChild(v);
- }, a.onFileSelected = function() {
- h = !0;
- }, a.onFileOpen = function() {
- s.extraExtensions && (m = e.some(s.extraExtensions, function(e) {
+ }, s.onFileSelected = function() {
+ f = !0;
+ }, s.onFileOpen = function() {
+ a.extraExtensions && (g = e.some(a.extraExtensions, function(e) {
return "footnotes" == e;
}));
- }, a;
-}), define("classes/FileDescriptor", [ "underscore", "utils" ], function(e, t) {
- function n(e, t, n, i) {
- this.fileIndex = e, this._title = t || localStorage[e + ".title"], this._editorScrollTop = parseInt(localStorage[e + ".editorScrollTop"]) || 0,
- this._editorStart = parseInt(localStorage[e + ".editorStart"]) || 0, this._editorEnd = parseInt(localStorage[e + ".editorEnd"]) || 0,
- this._previewScrollTop = parseInt(localStorage[e + ".previewScrollTop"]) || 0, this._selectTime = parseInt(localStorage[e + ".selectTime"]) || 0,
- this.syncLocations = n || {}, this.publishLocations = i || {}, Object.defineProperty(this, "title", {
+ }, s;
+}), define("classes/FileDescriptor", [ "underscore", "utils", "ace/range" ], function(e, t, n) {
+ function i(t, n, i, r) {
+ this.fileIndex = t, this._title = n || localStorage[t + ".title"], this._editorScrollTop = parseInt(localStorage[t + ".editorScrollTop"]) || 0,
+ this._editorSelectRange = function() {
+ try {
+ var n = localStorage[t + ".editorSelectRange"].split(";");
+ return n = e.map(n, function(e) {
+ return parseInt(e);
+ }), new o(n[0], n[1], n[2], n[3]);
+ } catch (i) {
+ return new o(0, 0, 0, 0);
+ }
+ }(), this._editorEnd = parseInt(localStorage[t + ".editorEnd"]) || 0, this._previewScrollTop = parseInt(localStorage[t + ".previewScrollTop"]) || 0,
+ this._selectTime = parseInt(localStorage[t + ".selectTime"]) || 0, this.syncLocations = i || {},
+ this.publishLocations = r || {}, Object.defineProperty(this, "title", {
get: function() {
return this._title;
},
@@ -4626,19 +11826,12 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
set: function(e) {
this._editorScrollTop = e, localStorage[this.fileIndex + ".editorScrollTop"] = e;
}
- }), Object.defineProperty(this, "editorStart", {
+ }), Object.defineProperty(this, "editorSelectRange", {
get: function() {
- return this._editorStart;
+ return this._editorSelectRange;
},
set: function(e) {
- this._editorStart = e, localStorage[this.fileIndex + ".editorStart"] = e;
- }
- }), Object.defineProperty(this, "editorEnd", {
- get: function() {
- return this._editorEnd;
- },
- set: function(e) {
- this._editorEnd = e, localStorage[this.fileIndex + ".editorEnd"] = e;
+ this._editorSelectRange = e, localStorage[this.fileIndex + ".editorSelectRange"] = [ e.start.row, e.start.column, e.end.row, e.end.column ].join(";");
}
}), Object.defineProperty(this, "previewScrollTop", {
get: function() {
@@ -4656,19 +11849,20 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
}
});
}
- return n.prototype.addSyncLocation = function(e) {
+ var o = n.Range;
+ return i.prototype.addSyncLocation = function(e) {
t.storeAttributes(e), t.appendIndexToArray(this.fileIndex + ".sync", e.syncIndex),
this.syncLocations[e.syncIndex] = e;
- }, n.prototype.removeSyncLocation = function(e) {
+ }, i.prototype.removeSyncLocation = function(e) {
t.removeIndexFromArray(this.fileIndex + ".sync", e.syncIndex), delete this.syncLocations[e.syncIndex],
localStorage.removeItem(e.syncIndex);
- }, n.prototype.addPublishLocation = function(e) {
+ }, i.prototype.addPublishLocation = function(e) {
t.storeAttributes(e), t.appendIndexToArray(this.fileIndex + ".publish", e.publishIndex),
this.publishLocations[e.publishIndex] = e;
- }, n.prototype.removePublishLocation = function(e) {
+ }, i.prototype.removePublishLocation = function(e) {
t.removeIndexFromArray(this.fileIndex + ".publish", e.publishIndex), delete this.publishLocations[e.publishIndex],
localStorage.removeItem(e.publishIndex);
- }, n.prototype.composeTitle = function() {
+ }, i.prototype.composeTitle = function() {
var t = [], n = e.values(this.syncLocations), i = e.values(this.publishLocations), o = n.concat(i);
return e.chain(o).sortBy(function(e) {
return e.provider.providerId;
@@ -4676,7 +11870,7 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
var n = "icon-provider-" + e.provider.providerId;
e.isRealtime === !0 && (n += " realtime"), t.push('');
}), t.push(" "), t.push(this.title), t.join("");
- }, n;
+ }, i;
}), define("storage", [ "underscore", "utils" ], function(e, t) {
var n = t.retrieveIndexArray("file.list"), i = localStorage.version;
if (void 0 === i && (localStorage.removeItem("sync.queue"), localStorage.removeItem("sync.current"),
@@ -4691,13 +11885,13 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
o && (localStorage["gdrive.lastChangeId"] = o, localStorage.removeItem("sync.gdrive.lastChangeId"));
var r = localStorage["sync.dropbox.lastChangeId"];
r && (localStorage["dropbox.lastChangeId"] = r, localStorage.removeItem("sync.dropbox.lastChangeId"));
- var a = "gdrive", s = "dropbox", l = "sync." + a + ".", c = "sync." + s + ".";
+ var s = "gdrive", a = "dropbox", l = "sync." + s + ".", c = "sync." + a + ".";
e.each(n, function(n) {
var i = t.retrieveIndexArray(n + ".sync");
e.each(i, function(e) {
var t = {};
- 0 === e.indexOf(l) ? (t.provider = a, t.id = e.substring(l.length), t.etag = localStorage[e + ".etag"],
- t.contentCRC = localStorage[e + ".contentCRC"], t.titleCRC = localStorage[e + ".titleCRC"]) : 0 === e.indexOf(c) && (t.provider = s,
+ 0 === e.indexOf(l) ? (t.provider = s, t.id = e.substring(l.length), t.etag = localStorage[e + ".etag"],
+ t.contentCRC = localStorage[e + ".contentCRC"], t.titleCRC = localStorage[e + ".titleCRC"]) : 0 === e.indexOf(c) && (t.provider = a,
t.path = decodeURIComponent(e.substring(c.length)), t.version = localStorage[e + ".version"],
t.contentCRC = localStorage[e + ".contentCRC"]), localStorage[e] = JSON.stringify(t),
localStorage.removeItem(e + ".etag"), localStorage.removeItem(e + ".version"), localStorage.removeItem(e + ".contentCRC"),
@@ -4727,7 +11921,10 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
"v7" == i && (e.each(e.keys(localStorage), function(t) {
var n = t.match(/(file\.\S+\.)\S+/);
n && (e.has(localStorage, n[1] + "title") || localStorage.removeItem(t));
- }), i = "v8"), localStorage.version = i;
+ }), i = "v8"), "v8" == i && (e.each(e.keys(localStorage), function(e) {
+ var t = e.match(/file\.\S+\.(editorEnd|editorStart)/);
+ t && localStorage.removeItem(e);
+ }), i = "v9"), localStorage.version = i;
}), define("fileSystem", [ "underscore", "utils", "classes/FileDescriptor", "storage" ], function(e, t, n) {
var i = {};
return e.each(t.retrieveIndexArray("file.list"), function(e) {
@@ -4783,24 +11980,24 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
function r() {
n.currentTime - u > 18e4 && (_gaq.push([ "_trackPageview" ]), u = n.currentTime);
}
- var a = new i("googleAnalytics", "Google Analytics", !0);
- a.settingsBlock = "
Sends anonymous statistics about usage and errors to help improve StackEdit.
";
- var s = !1, l = !1;
+ var s = new i("googleAnalytics", "Google Analytics", !0);
+ s.settingsBlock = "
Sends anonymous statistics about usage and errors to help improve StackEdit.
" ].join(""), d = void 0, p = void 0, f = void 0, h = void 0, m = void 0, g = void 0, v = void 0, b = function() {
- var n = t.chain(a).sortBy(m).reduce(function(e, n) {
- return e + t.template(u, {
+ var u = void 0;
+ l.onFileMgrCreated = function(e) {
+ u = e;
+ };
+ var d = [ '
' ].join(""), b = !1, y = void 0, x = void 0, w = [], C = [], k = void 0, S = void 0, _ = void 0, T = void 0, E = void 0, N = void 0, I = function() {
+ var f = [ '', '', '', '', '
" ].join(""), i = t.chain(k).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
- return e + t.template(m, {
+ return e + t.template(g, {
fileDesc: n
});
}, "").value();
@@ -5609,34 +12808,34 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
var i = t.chain(e.fileList).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
- return e + t.template(m, {
+ return e + t.template(g, {
fileDesc: n
});
}, "").value();
- i = i && '
' + i + "
", n += t.template(h, {
+ i = i && '
' + i + "
", n += t.template(f, {
folderDesc: e,
fileListHtml: i,
id: e.folderIndex.replace(".", "")
});
- }), x.innerHTML = n, t.each(x.querySelectorAll(".button-delete"), function(t) {
+ }), w.innerHTML = n, t.each(w.querySelectorAll(".button-delete"), function(t) {
var n = e(t);
n.click(function(e) {
e.stopPropagation();
- var t = n.parent(), i = r[t.data("folderIndex")], o = a[t.data("fileIndex")];
- w = [], C = [], i ? (C.push(i), w = i.fileList) : o && w.push(o), l();
+ var t = n.parent(), i = r[t.data("folderIndex")], o = s[t.data("fileIndex")];
+ C = [], x = [], i ? (x.push(i), C = i.fileList) : o && C.push(o), l();
});
- }), t.each(x.querySelectorAll(".button-rename"), function(t) {
+ }), t.each(w.querySelectorAll(".button-rename"), function(t) {
var n = e(t);
n.click(function(e) {
e.stopPropagation();
- var t = n.parent(), i = void 0, o = r[t.data("folderIndex")], s = a[t.data("fileIndex")];
- o ? i = o.name : s && (i = s.title), t.find(".name").addClass("hide"), t.find(".input-rename").removeClass("hide").val(i)[0].select();
+ var t = n.parent(), i = void 0, o = r[t.data("folderIndex")], a = s[t.data("fileIndex")];
+ o ? i = o.name : a && (i = a.title), t.find(".name").addClass("hide"), t.find(".input-rename").removeClass("hide").val(i)[0].select();
});
- }), t.each(x.querySelectorAll(".input-rename"), function(t) {
+ }), t.each(w.querySelectorAll(".input-rename"), function(t) {
function n() {
- var t = i.parent(), n = e.trim(i.val()), o = r[t.data("folderIndex")], s = a[t.data("fileIndex")];
- n && o && n != o.name ? (o.name = n, f.onFoldersChanged()) : n && s && n != s.title ? (s.title = n,
- f.onTitleChanged(s)) : (i.addClass("hide"), t.find(".name").removeClass("hide"));
+ var t = i.parent(), n = e.trim(i.val()), o = r[t.data("folderIndex")], a = s[t.data("fileIndex")];
+ n && o && n != o.name ? (o.name = n, p.onFoldersChanged()) : n && a && n != a.title ? (a.title = n,
+ p.onTitleChanged(a)) : (i.addClass("hide"), t.find(".name").removeClass("hide"));
}
var i = e(t);
i.blur(function() {
@@ -5645,7 +12844,7 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
13 == e.keyCode && (n(), e.stopPropagation()), 27 == e.keyCode && (i.val(""), n(),
e.stopPropagation());
});
- }), t.each(x.querySelectorAll(".folder .checkbox"), function(t) {
+ }), t.each(w.querySelectorAll(".folder .checkbox"), function(t) {
var n = e(t);
n.click(function(e) {
e.stopPropagation();
@@ -5653,61 +12852,61 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
var e = n.parent().next().find("[type=checkbox]");
this.checked ? e.prop("checked", !0).prop("disabled", !0) : e.prop("checked", !1).prop("disabled", !1);
});
- }), e(x.querySelectorAll("[type=checkbox]")).change(u);
+ }), e(w.querySelectorAll("[type=checkbox]")).change(u);
}
};
- return d.onFileCreated = I, d.onFileDeleted = I, d.onTitleChanged = I, d.onSyncExportSuccess = I,
- d.onSyncRemoved = I, d.onNewPublishSuccess = I, d.onPublishRemoved = I, d.onFoldersChanged = I,
+ return d.onFileCreated = $, d.onFileDeleted = $, d.onTitleChanged = $, d.onSyncExportSuccess = $,
+ d.onSyncRemoved = $, d.onNewPublishSuccess = $, d.onPublishRemoved = $, d.onFoldersChanged = $,
d.onReady = function() {
- y = document.querySelector(".modal-document-manager"), x = y.querySelector(".list-group.document-list"),
- E = e(y.querySelectorAll(".document-count")), N = e(y.querySelectorAll(".folder-count")),
- k = y.querySelector(".list-group.selected-document-list");
+ y = document.querySelector(".modal-document-manager"), w = y.querySelector(".list-group.document-list"),
+ F = e(y.querySelectorAll(".document-count")), _ = e(y.querySelectorAll(".folder-count")),
+ E = y.querySelector(".list-group.selected-document-list");
var i = y.querySelector(".list-group.select-folder-list");
e(y).on("show.bs.modal", function() {
- b = !0, I();
+ b = !0, $();
}).on("hide.bs.modal", function() {
b = !1;
}), e(y.querySelectorAll(".action-create-folder")).click(function() {
var i = void 0;
do i = "folder." + n.randomString(); while (t.has(r, i));
localStorage[i + ".name"] = DEFAULT_FOLDER_NAME;
- var a = new o(i, DEFAULT_FOLDER_NAME);
- n.appendIndexToArray("folder.list", i), r[i] = a, f.onFoldersChanged();
- var s = e(y.querySelector('[data-folder-index="' + i + '"] .button-rename')).click();
- y.scrollTop += s.offset().top - 50;
+ var s = new o(i, DEFAULT_FOLDER_NAME);
+ n.appendIndexToArray("folder.list", i), r[i] = s, p.onFoldersChanged();
+ var a = e(y.querySelector('[data-folder-index="' + i + '"] .button-rename')).click();
+ y.scrollTop += a.offset().top - 50;
}), e(y.querySelectorAll(".action-select-all")).click(function() {
- e(x.querySelectorAll('input[type="checkbox"]')).prop("checked", !0).change();
+ e(w.querySelectorAll('input[type="checkbox"]')).prop("checked", !0).change();
}), e(y.querySelectorAll(".action-unselect-all")).click(function() {
- e(x.querySelectorAll('input[type="checkbox"]')).prop("checked", !1).change();
+ e(w.querySelectorAll('input[type="checkbox"]')).prop("checked", !1).change();
});
- var a = e(y.querySelectorAll(".action-delete-items")).click(function() {
- _.hasClass("disabled") || (s(), l());
+ var s = e(y.querySelectorAll(".action-delete-items")).click(function() {
+ S.hasClass("disabled") || (a(), l());
});
- _ = a.parent(), e(y.querySelectorAll(".action-delete-items-confirm")).click(function() {
+ S = s.parent(), e(y.querySelectorAll(".action-delete-items-confirm")).click(function() {
c(), e(y.querySelectorAll(".document-list")).removeClass("hide"), e(y.querySelectorAll(".confirm-delete, .selected-document-list")).addClass("hide");
});
var u = e(y.querySelectorAll(".action-move-items")).click(function() {
- if (!S.hasClass("disabled")) {
- s();
- var n = [ '', '
Shows notification messages in the bottom-right corner of the\n screen.
\n
\n
\n \n
\n ms\n
\n
\n
';
}), define("extensions/notifications", [ "jquery", "underscore", "utils", "classes/Extension", "jgrowl", "text!html/notificationsSettingsBlock.html" ], function(e, t, n, i, o, r) {
- function a() {
+ function s() {
c === !1 && (o.defaults.life = l.config.timeout, o.defaults.closer = !1, o.defaults.closeTemplate = "",
o.defaults.position = "bottom-right", c = !0);
}
- function s(e, n, i) {
- if (logger.info(e), a(), e) {
+ function a(e, n, i) {
+ if (logger.info(e), s(), e) {
var r = e.indexOf("|");
(-1 === r || (e = e.substring(0, r))) && (i = i || {}, n = n || "icon-info-circled",
o(" " + t.escape(e).replace(/\n/g, " "), i));
@@ -5863,31 +13062,31 @@ define("config", function() {}), define("settings", [ "underscore", "config" ],
};
var c = !1;
return l.onMessage = function(e) {
- s(e);
+ a(e);
}, l.onError = function(e) {
- logger.error(e), t.isString(e) ? s(e, "icon-attention") : t.isObject(e) && s(e.message, "icon-attention");
+ logger.error(e), t.isString(e) ? a(e, "icon-attention") : t.isObject(e) && a(e.message, "icon-attention");
}, l.onOfflineChanged = function(t) {
- t === !0 ? s("You are offline.", "icon-attention-circled msg-offline", {
+ t === !0 ? a("You are offline.", "icon-attention-circled msg-offline", {
sticky: !0,
close: function() {
- s("You are back online!", "icon-signal");
+ a("You are back online!", "icon-signal");
}
}) : e(".msg-offline").parents(".jGrowl-notification").trigger("jGrowl.beforeClose");
}, l.onSyncImportSuccess = function(e, n) {
var i = t.map(e, function(e) {
return e.title;
}).join(", ");
- s(i + " imported successfully from " + n.providerName + ".");
+ a(i + " imported successfully from " + n.providerName + ".");
}, l.onSyncExportSuccess = function(e, t) {
- s('"' + e.title + '" will now be synchronized on ' + t.provider.providerName + ".");
+ a('"' + e.title + '" will now be synchronized on ' + t.provider.providerName + ".");
}, l.onSyncRemoved = function(e, t) {
- s(t.provider.providerName + " synchronized location has been removed.");
+ a(t.provider.providerName + " synchronized location has been removed.");
}, l.onPublishSuccess = function(e) {
- s('"' + e.title + '" successfully published.');
+ a('"' + e.title + '" successfully published.');
}, l.onNewPublishSuccess = function(e, t) {
- s('"' + e.title + '" is now published on ' + t.provider.providerName + ".");
+ a('"' + e.title + '" is now published on ' + t.provider.providerName + ".");
}, l.onPublishRemoved = function(e, t) {
- s(t.provider.providerName + " publish location has been removed.");
+ a(t.provider.providerName + " publish location has been removed.");
}, l;
}), define("text!html/markdownExtraSettingsBlock.html", [], function() {
return '
Adds extra features to the original Markdown syntax.
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n \n
\n
\n
\nMore info';
@@ -5934,7 +13133,7 @@ function() {
}, Markdown.Converter = function() {
function e(e) {
return e = e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(e, t, n, i, o, r) {
- return t = t.toLowerCase(), $.set(t, k(n)), o ? i : (r && z.set(t, r.replace(/"/g, """)),
+ return t = t.toLowerCase(), M.set(t, E(n)), o ? i : (r && R.set(t, r.replace(/"/g, """)),
"");
});
}
@@ -5946,25 +13145,25 @@ function() {
}
function o(e, t) {
var n = t;
- return n = n.replace(/^\n+/, ""), n = n.replace(/\n+$/g, ""), n = "\n\n~K" + (R.push(n) - 1) + "K\n\n";
+ return n = n.replace(/^\n+/, ""), n = n.replace(/\n+$/g, ""), n = "\n\n~K" + (I.push(n) - 1) + "K\n\n";
}
function r(e, n) {
- e = L.preBlockGamut(e, D), e = f(e);
+ e = B.preBlockGamut(e, N), e = p(e);
var i = "\n";
return e = e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, i), e = e.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm, i),
- e = e.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, i), e = h(e), e = g(e), e = w(e),
- e = L.postBlockGamut(e, D), e = t(e), e = C(e, n);
- }
- function a(e) {
- return e = L.preSpanGamut(e), e = b(e), e = s(e), e = S(e), e = u(e), e = l(e),
- e = T(e), e = e.replace(/~P/g, "://"), e = k(e), e = x(e), e = e.replace(/ +\n/g, " \n"),
- e = L.postSpanGamut(e);
+ e = e.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, i), e = f(e), e = m(e), e = C(e),
+ e = B.postBlockGamut(e, N), e = t(e), e = x(e, n);
}
function s(e) {
+ return e = B.preSpanGamut(e), e = b(e), e = a(e), e = A(e), e = u(e), e = l(e),
+ e = k(e), e = e.replace(/~P/g, "://"), e = E(e), e = w(e), e = e.replace(/ +\n/g, " \n"),
+ e = B.postSpanGamut(e);
+ }
+ function a(e) {
var t = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;
return e = e.replace(t, function(e) {
var t = e.replace(/(.)<\/?code>(?=.)/g, "$1`");
- return t = A(t, "!" == e.charAt(1) ? "\\`*_/" : "\\`*_");
+ return t = T(t, "!" == e.charAt(1) ? "\\`*_/" : "\\`*_");
});
}
function l(e) {
@@ -5972,74 +13171,74 @@ function() {
e = e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()((?:\([^)]*\)|[^()\s])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, c),
e = e.replace(/(\[([^\[\]]+)\])()()()()()/g, c);
}
- function c(e, t, n, i, o, r, a, s) {
- void 0 == s && (s = "");
- var l = t, c = n.replace(/:\/\//g, "~P"), u = i.toLowerCase(), p = o, f = s;
- if ("" == p) if ("" == u && (u = c.toLowerCase().replace(/ ?\n/g, " ")), p = "#" + u,
- void 0 != $.get(u)) p = $.get(u), void 0 != z.get(u) && (f = z.get(u)); else {
+ function c(e, t, n, i, o, r, s, a) {
+ void 0 == a && (a = "");
+ var l = t, c = n.replace(/:\/\//g, "~P"), u = i.toLowerCase(), h = o, p = a;
+ if ("" == h) if ("" == u && (u = c.toLowerCase().replace(/ ?\n/g, " ")), h = "#" + u,
+ void 0 != M.get(u)) h = M.get(u), void 0 != R.get(u) && (p = R.get(u)); else {
if (!(l.search(/\(\s*\)$/m) > -1)) return l;
- p = "";
+ h = "";
}
- p = P(p), p = A(p, "*_");
- var h = '" + c + "";
+ h = D(h), h = T(h, "*_");
+ var f = '" + c + "";
}
function u(e) {
- return e = e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, p), e = e.replace(/(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, p);
+ return e = e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, h), e = e.replace(/(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, h);
}
function d(e) {
return e.replace(/>/g, ">").replace(/";
+ c = T(d(c), "*_[]()"), h = T(h, "*_");
+ var f = '";
}
- function f(e) {
+ function p(e) {
return e = e.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm, function(e, t) {
- return '
\n\n";
}), e = e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm, function(e, t, n) {
var i = t.length;
- return "' + a(n) + "\n\n";
+ return "' + s(n) + "\n\n";
});
}
- function h(e, t) {
+ function f(e, t) {
e += "~0";
var n = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
- return j ? e = e.replace(n, function(e, n, i) {
- var o = n, r = i.search(/[*+-]/g) > -1 ? "ul" : "ol", a = m(o, r, t);
- return a = a.replace(/\s+$/, ""), a = "<" + r + ">" + a + "" + r + ">\n";
+ return P ? e = e.replace(n, function(e, n, i) {
+ var o = n, r = i.search(/[*+-]/g) > -1 ? "ul" : "ol", s = g(o, r, t);
+ return s = s.replace(/\s+$/, ""), s = "<" + r + ">" + s + "" + r + ">\n";
}) : (n = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,
e = e.replace(n, function(e, t, n, i) {
- var o = t, r = n, a = i.search(/[*+-]/g) > -1 ? "ul" : "ol", s = m(r, a);
- return s = o + "<" + a + ">\n" + s + "" + a + ">\n";
+ var o = t, r = n, s = i.search(/[*+-]/g) > -1 ? "ul" : "ol", a = g(r, s);
+ return a = o + "<" + s + ">\n" + a + "" + s + ">\n";
})), e = e.replace(/~0/, "");
}
- function m(e, t, n) {
- j++, e = e.replace(/\n{2,}$/, "\n"), e += "~0";
- var i = O[t], o = new RegExp("(^[ \\t]*)(" + i + ")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1(" + i + ")[ \\t]+))", "gm"), s = !1;
+ function g(e, t, n) {
+ P++, e = e.replace(/\n{2,}$/, "\n"), e += "~0";
+ var i = z[t], o = new RegExp("(^[ \\t]*)(" + i + ")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1(" + i + ")[ \\t]+))", "gm"), a = !1;
return e = e.replace(o, function(e, t, i, o) {
var l = o, c = /\n\n$/.test(l), u = c || l.search(/\n{2,}/) > -1;
- return u || s ? l = r(N(l), !0) : (l = h(N(l), !0), l = l.replace(/\n$/, ""), n || (l = a(l))),
- s = c, "
" + l + "
\n";
- }), e = e.replace(/~0/g, ""), j--, e;
+ return u || a ? l = r(_(l), !0) : (l = f(_(l), !0), l = l.replace(/\n$/, ""), n || (l = s(l))),
+ a = c, "
" + l + "
\n";
+ }), e = e.replace(/~0/g, ""), P--, e;
}
- function g(e) {
+ function m(e) {
return e += "~0", e = e.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g, function(e, t, n) {
var i = t, o = n;
- return i = y(N(i)), i = I(i), i = i.replace(/^\n+/g, ""), i = i.replace(/\n+$/g, ""),
+ return i = y(_(i)), i = $(i), i = i.replace(/^\n+/g, ""), i = i.replace(/\n+$/g, ""),
i = "
" + i + "\n
", "\n\n" + i + "\n\n" + o;
}), e = e.replace(/~0/, "");
}
function v(e) {
- return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (R.push(e) - 1) + "K\n\n";
+ return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (I.push(e) - 1) + "K\n\n";
}
function b(e) {
return e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, t, n, i) {
@@ -6050,13 +13249,13 @@ function() {
}
function y(e) {
return e = e.replace(/&/g, "&"), e = e.replace(//g, ">"),
- e = A(e, "*_{}[]\\", !1);
+ e = T(e, "*_{}[]\\", !1);
}
- function x(e) {
+ function w(e) {
return e = e.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g, "$1$3$4"),
e = e.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g, "$1$3$4");
}
- function w(e) {
+ function C(e) {
return e = e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm, function(e, t) {
var n = t;
return n = n.replace(/^[ \t]*>[ \t]?/gm, "~0"), n = n.replace(/~0/g, ""), n = n.replace(/^[ \t]+$/gm, ""),
@@ -6066,101 +13265,101 @@ function() {
}), v("
\n" + n + "\n
");
});
}
- function C(e, t) {
+ function x(e, t) {
e = e.replace(/^\n+/g, ""), e = e.replace(/\n+$/g, "");
- for (var n = e.split(/\n{2,}/g), i = [], o = /~K(\d+)K/, r = n.length, s = 0; r > s; s++) {
- var l = n[s];
- o.test(l) ? i.push(l) : /\S/.test(l) && (l = a(l), l = l.replace(/^([ \t]*)/g, "
"),
+ for (var n = e.split(/\n{2,}/g), i = [], o = /~K(\d+)K/, r = n.length, a = 0; r > a; a++) {
+ var l = n[a];
+ o.test(l) ? i.push(l) : /\S/.test(l) && (l = s(l), l = l.replace(/^([ \t]*)/g, "
"),
l += "
", i.push(l));
}
if (!t) {
r = i.length;
- for (var s = 0; r > s; s++) for (var c = !0; c; ) c = !1, i[s] = i[s].replace(/~K(\d+)K/g, function(e, t) {
- return c = !0, R[t];
+ for (var a = 0; r > a; a++) for (var c = !0; c; ) c = !1, i[a] = i[a].replace(/~K(\d+)K/g, function(e, t) {
+ return c = !0, I[t];
});
}
return i.join("\n\n");
}
- function k(e) {
+ function E(e) {
return e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"), e = e.replace(/<(?![a-z\/?!]|~D)/gi, "<");
}
- function S(e) {
- return e = e.replace(/\\(\\)/g, M), e = e.replace(/\\([`*_{}\[\]()>#+-.!])/g, M);
+ function A(e) {
+ return e = e.replace(/\\(\\)/g, L), e = e.replace(/\\([`*_{}\[\]()>#+-.!])/g, L);
}
- function _(e, t, n, i) {
+ function S(e, t, n, i) {
if (t) return e;
if (")" !== i.charAt(i.length - 1)) return "<" + n + i + ">";
- for (var o = i.match(/[()]/g), r = 0, a = 0; a < o.length; a++) "(" === o[a] ? 0 >= r ? r = 1 : r++ : r--;
- var s = "";
+ for (var o = i.match(/[()]/g), r = 0, s = 0; s < o.length; s++) "(" === o[s] ? 0 >= r ? r = 1 : r++ : r--;
+ var a = "";
if (0 > r) {
var l = new RegExp("\\){1," + -r + "}$");
i = i.replace(l, function(e) {
- return s = e, "";
+ return a = e, "";
});
}
- if (s) {
+ if (a) {
var c = i.charAt(i.length - 1);
- B.test(c) || (s = c + s, i = i.substr(0, i.length - 1));
+ q.test(c) || (a = c + a, i = i.substr(0, i.length - 1));
}
- return "<" + n + i + ">" + s;
+ return "<" + n + i + ">" + a;
}
- function T(e) {
- e = e.replace(H, _);
+ function k(e) {
+ e = e.replace(H, S);
var t = function(e, t) {
- return '' + L.plainLinkText(t) + "";
+ return '' + B.plainLinkText(t) + "";
};
return e = e.replace(/<((https?|ftp):[^'">\s]+)>/gi, t);
}
- function E(e) {
+ function F(e) {
return e = e.replace(/~E(\d+)E/g, function(e, t) {
var n = parseInt(t);
return String.fromCharCode(n);
});
}
- function N(e) {
+ function _(e) {
return e = e.replace(/^(\t|[ ]{1,4})/gm, "~0"), e = e.replace(/~0/g, "");
}
- function I(e) {
+ function $(e) {
if (!/\t/.test(e)) return e;
var t, n = [ " ", " ", " ", " " ], i = 0;
return e.replace(/[\n\t]/g, function(e, o) {
return "\n" === e ? (i = o + 1, e) : (t = (o - i) % 4, i = o + 1, n[t]);
});
}
- function P(e) {
- return e ? (e.length, e.replace(U, function(e) {
+ function D(e) {
+ return e ? (e.length, e.replace(W, function(e) {
return "~D" == e ? "%24" : ":" == e ? ":" : "%" + e.charCodeAt(0).toString(16);
})) : "";
}
- function A(e, t, n) {
+ function T(e, t, n) {
var i = "([" + t.replace(/([\[\]\\])/g, "\\$1") + "])";
n && (i = "\\\\" + i);
var o = new RegExp(i, "g");
- return e = e.replace(o, M);
+ return e = e.replace(o, L);
}
- function M(e, t) {
+ function L(e, t) {
var n = t.charCodeAt(0);
return "~E" + n + "E";
}
- var L = this.hooks = new n();
- L.addNoop("plainLinkText"), L.addNoop("preConversion"), L.addNoop("postNormalization"),
- L.addNoop("preBlockGamut"), L.addNoop("postBlockGamut"), L.addNoop("preSpanGamut"),
- L.addNoop("postSpanGamut"), L.addNoop("postConversion");
- var $, z, R, j;
+ var B = this.hooks = new n();
+ B.addNoop("plainLinkText"), B.addNoop("preConversion"), B.addNoop("postNormalization"),
+ B.addNoop("preBlockGamut"), B.addNoop("postBlockGamut"), B.addNoop("preSpanGamut"),
+ B.addNoop("postSpanGamut"), B.addNoop("postConversion");
+ var M, R, I, P;
this.makeHtml = function(n) {
- if ($) throw new Error("Recursive call to converter.makeHtml");
- return $ = new i(), z = new i(), R = [], j = 0, n = L.preConversion(n), n = n.replace(/~/g, "~T"),
+ if (M) throw new Error("Recursive call to converter.makeHtml");
+ return M = new i(), R = new i(), I = [], P = 0, n = B.preConversion(n), n = n.replace(/~/g, "~T"),
n = n.replace(/\$/g, "~D"), n = n.replace(/\r\n/g, "\n"), n = n.replace(/\r/g, "\n"),
- n = "\n\n" + n + "\n\n", n = I(n), n = n.replace(/^[ \t]+$/gm, ""), n = L.postNormalization(n),
- n = t(n), n = e(n), n = r(n), n = E(n), n = n.replace(/~D/g, "$$"), n = n.replace(/~T/g, "~"),
- n = L.postConversion(n), R = z = $ = null, n;
+ n = "\n\n" + n + "\n\n", n = $(n), n = n.replace(/^[ \t]+$/gm, ""), n = B.postNormalization(n),
+ n = t(n), n = e(n), n = r(n), n = F(n), n = n.replace(/~D/g, "$$"), n = n.replace(/~T/g, "~"),
+ n = B.postConversion(n), I = R = M = null, n;
};
- var D = function(e) {
+ var N = function(e) {
return r(e);
- }, O = {
+ }, z = {
ol: "\\d+[.]",
ul: "[*+-]"
- }, F = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]", q = "[-A-Z0-9+&@#/%=~_|[\\])]", H = new RegExp('(="|<)?\\b(https?|ftp)(://' + F + "*" + q + ")(?=$|\\W)", "gi"), B = new RegExp(q, "i"), U = /(?:["'*()[\]:]|~D)/g;
+ }, O = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]", j = "[-A-Z0-9+&@#/%=~_|[\\])]", H = new RegExp('(="|<)?\\b(https?|ftp)(://' + O + "*" + j + ")(?=$|\\W)", "gi"), q = new RegExp(j, "i"), W = /(?:["'*()[\]:]|~D)/g;
};
}(), define("libs/Markdown.Converter", function() {}), window.PR_SHOULD_USE_CONTINUATION = !0;
@@ -6180,13 +13379,13 @@ var prettyPrintOne, prettyPrint;
return "\\" === t || "-" === t || "]" === t || "^" === t ? "\\" + t : t;
}
function i(e) {
- var i = e.substring(1, e.length - 1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]", "g")), o = [], r = "^" === i[0], a = [ "[" ];
- r && a.push("^");
- for (var s = r ? 1 : 0, l = i.length; l > s; ++s) {
- var c = i[s];
- if (/\\[bdsw]/i.test(c)) a.push(c); else {
+ var i = e.substring(1, e.length - 1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]", "g")), o = [], r = "^" === i[0], s = [ "[" ];
+ r && s.push("^");
+ for (var a = r ? 1 : 0, l = i.length; l > a; ++a) {
+ var c = i[a];
+ if (/\\[bdsw]/i.test(c)) s.push(c); else {
var u, d = t(c);
- l > s + 2 && "-" === i[s + 1] ? (u = t(i[s + 2]), s += 2) : u = d, o.push([ d, u ]),
+ l > a + 2 && "-" === i[a + 1] ? (u = t(i[a + 2]), a += 2) : u = d, o.push([ d, u ]),
65 > u || d > 122 || (65 > u || d > 90 || o.push([ 32 | Math.max(65, d), 32 | Math.min(u, 90) ]),
97 > u || d > 122 || o.push([ -33 & Math.max(97, d), -33 & Math.min(u, 122) ]));
}
@@ -6194,46 +13393,46 @@ var prettyPrintOne, prettyPrint;
o.sort(function(e, t) {
return e[0] - t[0] || t[1] - e[1];
});
- for (var p = [], f = [], s = 0; s < o.length; ++s) {
- var h = o[s];
- h[0] <= f[1] + 1 ? f[1] = Math.max(f[1], h[1]) : p.push(f = h);
+ for (var h = [], p = [], a = 0; a < o.length; ++a) {
+ var f = o[a];
+ f[0] <= p[1] + 1 ? p[1] = Math.max(p[1], f[1]) : h.push(p = f);
}
- for (var s = 0; s < p.length; ++s) {
- var h = p[s];
- a.push(n(h[0])), h[1] > h[0] && (h[1] + 1 > h[0] && a.push("-"), a.push(n(h[1])));
+ for (var a = 0; a < h.length; ++a) {
+ var f = h[a];
+ s.push(n(f[0])), f[1] > f[0] && (f[1] + 1 > f[0] && s.push("-"), s.push(n(f[1])));
}
- return a.push("]"), a.join("");
+ return s.push("]"), s.join("");
}
function o(e) {
- for (var t = e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", "g")), o = t.length, s = [], l = 0, c = 0; o > l; ++l) {
+ for (var t = e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", "g")), o = t.length, a = [], l = 0, c = 0; o > l; ++l) {
var u = t[l];
if ("(" === u) ++c; else if ("\\" === u.charAt(0)) {
var d = +u.substring(1);
- d && (c >= d ? s[d] = -1 : t[l] = n(d));
+ d && (c >= d ? a[d] = -1 : t[l] = n(d));
}
}
- for (var l = 1; l < s.length; ++l) -1 === s[l] && (s[l] = ++r);
+ for (var l = 1; l < a.length; ++l) -1 === a[l] && (a[l] = ++r);
for (var l = 0, c = 0; o > l; ++l) {
var u = t[l];
- if ("(" === u) ++c, s[c] || (t[l] = "(?:"); else if ("\\" === u.charAt(0)) {
+ if ("(" === u) ++c, a[c] || (t[l] = "(?:"); else if ("\\" === u.charAt(0)) {
var d = +u.substring(1);
- d && c >= d && (t[l] = "\\" + s[d]);
+ d && c >= d && (t[l] = "\\" + a[d]);
}
}
for (var l = 0; o > l; ++l) "^" === t[l] && "^" !== t[l + 1] && (t[l] = "");
- if (e.ignoreCase && a) for (var l = 0; o > l; ++l) {
- var u = t[l], p = u.charAt(0);
- u.length >= 2 && "[" === p ? t[l] = i(u) : "\\" !== p && (t[l] = u.replace(/[a-zA-Z]/g, function(e) {
+ if (e.ignoreCase && s) for (var l = 0; o > l; ++l) {
+ var u = t[l], h = u.charAt(0);
+ u.length >= 2 && "[" === h ? t[l] = i(u) : "\\" !== h && (t[l] = u.replace(/[a-zA-Z]/g, function(e) {
var t = e.charCodeAt(0);
return "[" + String.fromCharCode(-33 & t, 32 | t) + "]";
}));
}
return t.join("");
}
- for (var r = 0, a = !1, s = !1, l = 0, c = e.length; c > l; ++l) {
+ for (var r = 0, s = !1, a = !1, l = 0, c = e.length; c > l; ++l) {
var u = e[l];
- if (u.ignoreCase) s = !0; else if (/[a-z]/i.test(u.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ""))) {
- a = !0, s = !1;
+ if (u.ignoreCase) a = !0; else if (/[a-z]/i.test(u.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ""))) {
+ s = !0, a = !1;
break;
}
}
@@ -6244,12 +13443,12 @@ var prettyPrintOne, prettyPrint;
v: 11,
f: 12,
r: 13
- }, p = [], l = 0, c = e.length; c > l; ++l) {
+ }, h = [], l = 0, c = e.length; c > l; ++l) {
var u = e[l];
if (u.global || u.multiline) throw new Error("" + u);
- p.push("(?:" + o(u) + ")");
+ h.push("(?:" + o(u) + ")");
}
- return new RegExp(p.join("|"), s ? "gi" : "g");
+ return new RegExp(h.join("|"), a ? "gi" : "g");
}
function t(e, t) {
function n(e) {
@@ -6258,20 +13457,20 @@ var prettyPrintOne, prettyPrint;
if (i.test(e.className)) return;
for (var l = e.firstChild; l; l = l.nextSibling) n(l);
var c = e.nodeName.toLowerCase();
- ("br" === c || "li" === c) && (o[s] = "\n", a[s << 1] = r++, a[1 | s++ << 1] = e);
+ ("br" === c || "li" === c) && (o[a] = "\n", s[a << 1] = r++, s[1 | a++ << 1] = e);
break;
case 3:
case 4:
var u = e.nodeValue;
u.length && (u = t ? u.replace(/\r\n?/g, "\n") : u.replace(/[ \t\r\n]+/g, " "),
- o[s] = u, a[s << 1] = r, r += u.length, a[1 | s++ << 1] = e);
+ o[a] = u, s[a << 1] = r, r += u.length, s[1 | a++ << 1] = e);
}
}
- var i = /(?:^|\s)nocode(?:\s|$)/, o = [], r = 0, a = [], s = 0;
+ var i = /(?:^|\s)nocode(?:\s|$)/, o = [], r = 0, s = [], a = 0;
return n(e), {
sourceCode: o.join("").replace(/\n$/, ""),
- spans: a
+ spans: s
};
}
function n(e, t, n, i) {
@@ -6293,63 +13492,63 @@ var prettyPrintOne, prettyPrint;
function o(t, i) {
var o, r = {};
(function() {
- for (var n = t.concat(i), a = [], s = {}, l = 0, c = n.length; c > l; ++l) {
+ for (var n = t.concat(i), s = [], a = {}, l = 0, c = n.length; c > l; ++l) {
var u = n[l], d = u[3];
- if (d) for (var p = d.length; --p >= 0; ) r[d.charAt(p)] = u;
- var f = u[1], h = "" + f;
- s.hasOwnProperty(h) || (a.push(f), s[h] = null);
+ if (d) for (var h = d.length; --h >= 0; ) r[d.charAt(h)] = u;
+ var p = u[1], f = "" + p;
+ a.hasOwnProperty(f) || (s.push(p), a[f] = null);
}
- a.push(/[\0-\uffff]/), o = e(a);
+ s.push(/[\0-\uffff]/), o = e(s);
})();
- var a = i.length, s = function(e) {
- for (var t = e.sourceCode, l = e.basePos, u = [ l, $ ], d = 0, p = t.match(o) || [], f = {}, h = 0, m = p.length; m > h; ++h) {
- var g, v = p[h], b = f[v], y = void 0;
- if ("string" == typeof b) g = !1; else {
- var x = r[v.charAt(0)];
- if (x) y = v.match(x[1]), b = x[0]; else {
- for (var w = 0; a > w; ++w) if (x = i[w], y = v.match(x[1])) {
- b = x[0];
+ var s = i.length, a = function(e) {
+ for (var t = e.sourceCode, l = e.basePos, u = [ l, M ], d = 0, h = t.match(o) || [], p = {}, f = 0, g = h.length; g > f; ++f) {
+ var m, v = h[f], b = p[v], y = void 0;
+ if ("string" == typeof b) m = !1; else {
+ var w = r[v.charAt(0)];
+ if (w) y = v.match(w[1]), b = w[0]; else {
+ for (var C = 0; s > C; ++C) if (w = i[C], y = v.match(w[1])) {
+ b = w[0];
break;
}
- y || (b = $);
+ y || (b = M);
}
- g = b.length >= 5 && "lang-" === b.substring(0, 5), !g || y && "string" == typeof y[1] || (g = !1,
- b = j), g || (f[v] = b);
+ m = b.length >= 5 && "lang-" === b.substring(0, 5), !m || y && "string" == typeof y[1] || (m = !1,
+ b = P), m || (p[v] = b);
}
- var C = d;
- if (d += v.length, g) {
- var k = y[1], S = v.indexOf(k), _ = S + k.length;
- y[2] && (_ = v.length - y[2].length, S = _ - k.length);
- var T = b.substring(5);
- n(l + C, v.substring(0, S), s, u), n(l + C + S, k, c(T, k), u), n(l + C + _, v.substring(_), s, u);
- } else u.push(l + C, b);
+ var x = d;
+ if (d += v.length, m) {
+ var E = y[1], A = v.indexOf(E), S = A + E.length;
+ y[2] && (S = v.length - y[2].length, A = S - E.length);
+ var k = b.substring(5);
+ n(l + x, v.substring(0, A), a, u), n(l + x + A, E, c(k, E), u), n(l + x + S, v.substring(S), a, u);
+ } else u.push(l + x, b);
}
e.decorations = u;
};
- return s;
+ return a;
}
function r(e) {
var t = [], n = [];
- e.tripleQuotedStrings ? t.push([ N, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, "'\"" ]) : e.multiLineStrings ? t.push([ N, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, "'\"`" ]) : t.push([ N, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, "\"'" ]),
- e.verbatimStrings && n.push([ N, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null ]);
+ e.tripleQuotedStrings ? t.push([ _, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, "'\"" ]) : e.multiLineStrings ? t.push([ _, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, "'\"`" ]) : t.push([ _, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, "\"'" ]),
+ e.verbatimStrings && n.push([ _, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null ]);
var i = e.hashComments;
- if (i && (e.cStyleComments ? (i > 1 ? t.push([ P, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, "#" ]) : t.push([ P, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/, null, "#" ]),
- n.push([ N, /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/, null ])) : t.push([ P, /^#[^\r\n]*/, null, "#" ])),
- e.cStyleComments && (n.push([ P, /^\/\/[^\r\n]*/, null ]), n.push([ P, /^\/\*[\s\S]*?(?:\*\/|$)/, null ])),
+ if (i && (e.cStyleComments ? (i > 1 ? t.push([ D, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, "#" ]) : t.push([ D, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/, null, "#" ]),
+ n.push([ _, /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/, null ])) : t.push([ D, /^#[^\r\n]*/, null, "#" ])),
+ e.cStyleComments && (n.push([ D, /^\/\/[^\r\n]*/, null ]), n.push([ D, /^\/\*[\s\S]*?(?:\*\/|$)/, null ])),
e.regexLiterals) {
var r = "/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/";
- n.push([ "lang-regex", new RegExp("^" + q + "(" + r + ")") ]);
+ n.push([ "lang-regex", new RegExp("^" + j + "(" + r + ")") ]);
}
- var a = e.types;
- a && n.push([ A, a ]);
- var s = ("" + e.keywords).replace(/^ | $/g, "");
- s.length && n.push([ I, new RegExp("^(?:" + s.replace(/[\s,]+/g, "|") + ")\\b"), null ]),
- t.push([ $, /^\s+/, null, " \r\n " ]);
+ var s = e.types;
+ s && n.push([ T, s ]);
+ var a = ("" + e.keywords).replace(/^ | $/g, "");
+ a.length && n.push([ $, new RegExp("^(?:" + a.replace(/[\s,]+/g, "|") + ")\\b"), null ]),
+ t.push([ M, /^\s+/, null, " \r\n " ]);
var l = /^.[^\s\w\.$@\'\"\`\/\\]*/;
- return n.push([ M, /^@[a-z_$][a-z_$@0-9]*/i, null ], [ A, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null ], [ $, /^[a-z_$][a-z_$@0-9]*/i, null ], [ M, new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*", "i"), null, "0123456789" ], [ $, /^\\[\s\S]?/, null ], [ L, l, null ]),
+ return n.push([ L, /^@[a-z_$][a-z_$@0-9]*/i, null ], [ T, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null ], [ M, /^[a-z_$][a-z_$@0-9]*/i, null ], [ L, new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*", "i"), null, "0123456789" ], [ M, /^\\[\s\S]?/, null ], [ B, l, null ]),
o(t, n);
}
- function a(e, t, n) {
+ function s(e, t, n) {
function i(e) {
switch (e.nodeType) {
case 1:
@@ -6360,14 +13559,14 @@ var prettyPrintOne, prettyPrint;
case 3:
case 4:
if (n) {
- var l = e.nodeValue, c = l.match(a);
+ var l = e.nodeValue, c = l.match(s);
if (c) {
var u = l.substring(0, c.index);
e.nodeValue = u;
var d = l.substring(c.index + c[0].length);
if (d) {
- var p = e.parentNode;
- p.insertBefore(s.createTextNode(d), e.nextSibling);
+ var h = e.parentNode;
+ h.insertBefore(a.createTextNode(d), e.nextSibling);
}
o(e), u || e.parentNode.removeChild(e);
}
@@ -6378,9 +13577,9 @@ var prettyPrintOne, prettyPrint;
function t(e, n) {
var i = n ? e.cloneNode(!1) : e, o = e.parentNode;
if (o) {
- var r = t(o, 1), a = e.nextSibling;
+ var r = t(o, 1), s = e.nextSibling;
r.appendChild(i);
- for (var s = a; s; s = a) a = s.nextSibling, r.appendChild(s);
+ for (var a = s; a; a = s) s = a.nextSibling, r.appendChild(a);
}
return i;
}
@@ -6388,43 +13587,43 @@ var prettyPrintOne, prettyPrint;
for (var n, i = t(e.nextSibling, 0); (n = i.parentNode) && 1 === n.nodeType; ) i = n;
c.push(i);
}
- for (var r = /(?:^|\s)nocode(?:\s|$)/, a = /\r\n?|\n/, s = e.ownerDocument, l = s.createElement("li"); e.firstChild; ) l.appendChild(e.firstChild);
+ for (var r = /(?:^|\s)nocode(?:\s|$)/, s = /\r\n?|\n/, a = e.ownerDocument, l = a.createElement("li"); e.firstChild; ) l.appendChild(e.firstChild);
for (var c = [ l ], u = 0; u < c.length; ++u) i(c[u]);
t === (0 | t) && c[0].setAttribute("value", t);
- var d = s.createElement("ol");
+ var d = a.createElement("ol");
d.className = "linenums";
- for (var p = Math.max(0, 0 | t - 1) || 0, u = 0, f = c.length; f > u; ++u) l = c[u],
- l.className = "L" + (u + p) % 10, l.firstChild || l.appendChild(s.createTextNode(" ")),
+ for (var h = Math.max(0, 0 | t - 1) || 0, u = 0, p = c.length; p > u; ++u) l = c[u],
+ l.className = "L" + (u + h) % 10, l.firstChild || l.appendChild(a.createTextNode(" ")),
d.appendChild(l);
e.appendChild(d);
}
- function s(e) {
+ function a(e) {
var t = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
t = t && +t[1] <= 8;
- var n = /\n/g, i = e.sourceCode, o = i.length, r = 0, a = e.spans, s = a.length, l = 0, c = e.decorations, u = c.length, d = 0;
+ var n = /\n/g, i = e.sourceCode, o = i.length, r = 0, s = e.spans, a = s.length, l = 0, c = e.decorations, u = c.length, d = 0;
c[u] = o;
- var p, f;
- for (f = p = 0; u > f; ) c[f] !== c[f + 2] ? (c[p++] = c[f++], c[p++] = c[f++]) : f += 2;
- for (u = p, f = p = 0; u > f; ) {
- for (var h = c[f], m = c[f + 1], g = f + 2; u >= g + 2 && c[g + 1] === m; ) g += 2;
- c[p++] = h, c[p++] = m, f = g;
+ var h, p;
+ for (p = h = 0; u > p; ) c[p] !== c[p + 2] ? (c[h++] = c[p++], c[h++] = c[p++]) : p += 2;
+ for (u = h, p = h = 0; u > p; ) {
+ for (var f = c[p], g = c[p + 1], m = p + 2; u >= m + 2 && c[m + 1] === g; ) m += 2;
+ c[h++] = f, c[h++] = g, p = m;
}
- u = c.length = p;
+ u = c.length = h;
var v, b = e.sourceNode;
b && (v = b.style.display, b.style.display = "none");
try {
- for (;s > l; ) {
- a[l];
- var y, x = a[l + 2] || o, w = c[d + 2] || o, g = Math.min(x, w), C = a[l + 1];
- if (1 !== C.nodeType && (y = i.substring(r, g))) {
- t && (y = y.replace(n, "\r")), C.nodeValue = y;
- var k = C.ownerDocument, S = k.createElement("span");
- S.className = c[d + 1];
- var _ = C.parentNode;
- _.replaceChild(S, C), S.appendChild(C), x > r && (a[l + 1] = C = k.createTextNode(i.substring(g, x)),
- _.insertBefore(C, S.nextSibling));
+ for (;a > l; ) {
+ s[l];
+ var y, w = s[l + 2] || o, C = c[d + 2] || o, m = Math.min(w, C), x = s[l + 1];
+ if (1 !== x.nodeType && (y = i.substring(r, m))) {
+ t && (y = y.replace(n, "\r")), x.nodeValue = y;
+ var E = x.ownerDocument, A = E.createElement("span");
+ A.className = c[d + 1];
+ var S = x.parentNode;
+ S.replaceChild(A, x), A.appendChild(x), w > r && (s[l + 1] = x = E.createTextNode(i.substring(m, w)),
+ S.insertBefore(x, A.nextSibling));
}
- r = g, r >= x && (l += 2), r >= w && (d += 2);
+ r = m, r >= w && (l += 2), r >= C && (d += 2);
}
} finally {
b && (b.style.display = v);
@@ -6433,25 +13632,25 @@ var prettyPrintOne, prettyPrint;
function l(e, t) {
for (var n = t.length; --n >= 0; ) {
var i = t[n];
- U.hasOwnProperty(i) ? f.console && console.warn("cannot override language handler %s", i) : U[i] = e;
+ W.hasOwnProperty(i) ? p.console && console.warn("cannot override language handler %s", i) : W[i] = e;
}
}
function c(e, t) {
- return e && U.hasOwnProperty(e) || (e = /^\s* l; ++l) r.push(o[s][l]);
+ for (var o = [ t("pre"), t("code"), t("xmp") ], r = [], a = 0; a < o.length; ++a) for (var l = 0, c = o[a].length; c > l; ++l) r.push(o[a][l]);
o = null;
var d = Date;
d.now || (d = {
@@ -6504,23 +13703,23 @@ var prettyPrintOne, prettyPrint;
return +new Date();
}
});
- var p, h = 0, m = /\blang(?:uage)?-([\w.]+)(?!\S)/, g = /\bprettyprint\b/, v = /\bprettyprinted\b/, b = /pre|xmp/i, y = /^code$/i, x = /^(?:pre|code|xmp)$/i;
+ var h, f = 0, g = /\blang(?:uage)?-([\w.]+)(?!\S)/, m = /\bprettyprint\b/, v = /\bprettyprinted\b/, b = /pre|xmp/i, y = /^code$/i, w = /^(?:pre|code|xmp)$/i;
n();
}
- var f = window, h = [ "break,continue,do,else,for,if,return,while" ], m = [ h, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile" ], g = [ m, "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof" ], v = [ g, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where" ], b = [ g, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient" ], y = [ b, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where" ], x = "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes", w = [ g, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN" ], C = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", k = [ h, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None" ], S = [ h, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END" ], _ = [ h, "case,done,elif,esac,eval,fi,function,in,local,set,then,until" ], T = [ v, y, w, C + k, S, _ ], E = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, N = "str", I = "kwd", P = "com", A = "typ", M = "lit", L = "pun", $ = "pln", z = "tag", R = "dec", j = "src", D = "atn", O = "atv", F = "nocode", q = "(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*", H = /\S/, B = r({
- keywords: T,
+ var p = window, f = [ "break,continue,do,else,for,if,return,while" ], g = [ f, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile" ], m = [ g, "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof" ], v = [ m, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where" ], b = [ m, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient" ], y = [ b, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where" ], w = "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes", C = [ m, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN" ], x = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", E = [ f, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None" ], A = [ f, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END" ], S = [ f, "case,done,elif,esac,eval,fi,function,in,local,set,then,until" ], k = [ v, y, C, x + E, A, S ], F = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, _ = "str", $ = "kwd", D = "com", T = "typ", L = "lit", B = "pun", M = "pln", R = "tag", I = "dec", P = "src", N = "atn", z = "atv", O = "nocode", j = "(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*", H = /\S/, q = r({
+ keywords: k,
hashComments: !0,
cStyleComments: !0,
multiLineStrings: !0,
regexLiterals: !0
- }), U = {};
- l(B, [ "default-code" ]), l(o([], [ [ $, /^[^]+/ ], [ R, /^]*(?:>|$)/ ], [ P, /^<\!--[\s\S]*?(?:-\->|$)/ ], [ "lang-", /^<\?([\s\S]+?)(?:\?>|$)/ ], [ "lang-", /^<%([\s\S]+?)(?:%>|$)/ ], [ L, /^(?:<[%?]|[%?]>)/ ], [ "lang-", /^]*>([\s\S]+?)<\/xmp\b[^>]*>/i ], [ "lang-js", /^\n```\n\n> **NOTE:** You can find more information:\n>\n> - about **Markdown** syntax [here][2],\n> - about **Markdown Extra** extension [here][3],\n> - about **Prettify** syntax highlighting [here][4].\n> - about **Highlight.js** syntax highlighting [here][5].\n\n [^stackedit]: StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.\n\n\n [1]: http://math.stackexchange.com/\n [2]: http://daringfireball.net/projects/markdown/syntax "Markdown"\n [3]: https://github.com/jmcmanus/pagedown-extra "Pagedown Extra"\n [4]: https://code.google.com/p/google-code-prettify/\n [5]: http://softwaremaniacs.org/soft/highlight/en/';
-}), define("fileMgr", [ "jquery", "underscore", "core", "utils", "settings", "eventMgr", "fileSystem", "classes/FileDescriptor", "text!../WELCOME.md" ], function(e, t, n, i, o, r, a, s, l) {
+}), define("fileMgr", [ "jquery", "underscore", "core", "utils", "settings", "eventMgr", "fileSystem", "classes/FileDescriptor", "text!../WELCOME.md" ], function(e, t, n, i, o, r, s, a, l) {
var c = {};
- return c.currentFile = void 0, c.selectFile = function(i) {
+ c.currentFile = void 0, c.selectFile = function(i) {
if (i = i || c.currentFile, void 0 === i) {
- var o = t.size(a);
- i = 0 === o ? c.createFile(WELCOME_DOCUMENT_TITLE, l) : t.max(a, function(e) {
+ var o = t.size(s);
+ i = 0 === o ? c.createFile(WELCOME_DOCUMENT_TITLE, l) : t.max(s, function(e) {
return e.selectTime || 0;
});
}
@@ -15719,23 +23054,23 @@ function(e) {
}, c.createFile = function(e, n, l, c) {
if (n = void 0 !== n ? n : o.defaultContent, !e) {
e = DEFAULT_FILE_TITLE;
- for (var u = 2; t.some(a, function(t) {
+ for (var u = 2; t.some(s, function(t) {
return t.title == e;
}); ) e = DEFAULT_FILE_TITLE + u++;
}
var d = TEMPORARY_FILE_INDEX;
- if (!c) do d = "file." + i.randomString(); while (t.has(a, d));
+ if (!c) do d = "file." + i.randomString(); while (t.has(s, d));
l = l || {};
- var p = t.reduce(l, function(e, t) {
+ var h = t.reduce(l, function(e, t) {
return i.storeAttributes(t), e + t.syncIndex + ";";
}, ";");
- localStorage[d + ".title"] = e, localStorage[d + ".content"] = n, localStorage[d + ".sync"] = p,
+ localStorage[d + ".title"] = e, localStorage[d + ".content"] = n, localStorage[d + ".sync"] = h,
localStorage[d + ".publish"] = ";";
- var f = new s(d, e, l);
- return c || (i.appendIndexToArray("file.list", d), a[d] = f, r.onFileCreated(f)),
- f;
+ var p = new a(d, e, l);
+ return c || (i.appendIndexToArray("file.list", d), s[d] = p, r.onFileCreated(p)),
+ p;
}, c.deleteFile = function(e) {
- e = e || c.currentFile, i.removeIndexFromArray("file.list", e.fileIndex), delete a[e.fileIndex],
+ e = e || c.currentFile, i.removeIndexFromArray("file.list", e.fileIndex), delete s[e.fileIndex],
c.currentFile === e && (c.currentFile = void 0, c.selectFile()), t.each(e.syncLocations, function(e) {
localStorage.removeItem(e.syncIndex);
}), t.each(e.publishLocations, function(e) {
@@ -15746,48 +23081,51 @@ function(e) {
localStorage.removeItem(e.fileIndex + ".editorEnd"), localStorage.removeItem(e.fileIndex + ".editorScrollTop"),
localStorage.removeItem(e.fileIndex + ".previewScrollTop"), r.onFileDeleted(e);
}, c.getFileFromSyncIndex = function(e) {
- return t.find(a, function(n) {
+ return t.find(s, function(n) {
return t.has(n.syncLocations, e);
});
}, c.getSyncAttributes = function(e) {
var t = c.getFileFromSyncIndex(e);
return t && t.syncLocations[e];
}, c.getFileFromPublishIndex = function(e) {
- return t.find(a, function(n) {
+ return t.find(s, function(n) {
return t.has(n.publishLocations, e);
});
- }, r.addListener("onReady", function() {
+ };
+ var u = void 0;
+ return r.addListener("onAceCreated", function(e) {
+ u = e;
+ }), r.addListener("onReady", function() {
function n() {
- a.addClass("hide"), o.removeClass("hide");
- var t = e.trim(a.val()), n = c.currentFile;
- t && t != n.title && (n.title = t, r.onTitleChanged(n)), a.val(n.title), i.focus();
+ o.addClass("hide"), i.removeClass("hide");
+ var t = e.trim(o.val()), n = c.currentFile;
+ t && t != n.title && (n.title = t, r.onTitleChanged(n)), o.val(n.title), u && u.focus() || $editorElt.focus();
}
- var i = e("#wmd-input");
- c.selectFile();
- var o = e(".file-title-navbar"), a = e(".input-file-title");
+ $editorElt = e("#wmd-input"), c.selectFile();
+ var i = e(".file-title-navbar"), o = e(".input-file-title");
e(".action-create-file").click(function() {
var e = c.createFile();
- c.selectFile(e);
- var t = i.focus().get(0);
- t.setSelectionRange && t.setSelectionRange(0, 0), o.click();
+ c.selectFile(e), i.click();
}), e(".action-remove-file").click(function() {
c.deleteFile();
- }), o.click(function() {
+ }), i.click(function() {
if (viewerMode !== !0) {
- o.addClass("hide");
- var e = a.removeClass("hide");
+ i.addClass("hide");
+ var e = o.removeClass("hide");
t.defer(function() {
e.focus().get(0).select();
});
}
- }), a.blur(function() {
+ }), o.blur(function() {
n();
}).keyup(function(e) {
- 13 == e.keyCode && n(), 27 == e.keyCode && (a.val(""), n());
+ 13 == e.keyCode && n(), 27 == e.keyCode && (o.val(""), n());
}), e(".action-open-stackedit").click(function() {
window.location.href = ".";
}), e(".action-edit-document").click(function() {
- var e = i.val(), t = c.currentFile.title, n = c.createFile(t, e);
+ var e = $editorElt.val();
+ void 0 !== u && (e = u.getValue());
+ var t = c.currentFile.title, n = c.createFile(t, e);
c.selectFile(n), window.location.href = ".";
}), e(".action-welcome-file").click(function() {
var e = c.createFile(WELCOME_DOCUMENT_TITLE, l);
@@ -15806,13 +23144,13 @@ function(e) {
}
function o() {
if (d !== !1) {
- if (l === !0) return s + u.timeout < t.currentTime && u.error(new Error("A timeout occurred.")),
+ if (l === !0) return a + u.timeout < t.currentTime && u.error(new Error("A timeout occurred.")),
void 0;
if (void 0 === u) {
- if (0 === a.length) return;
- u = a.shift(), s = t.currentTime, c === !1 && (c = !0, n.onAsyncRunning(!0));
+ if (0 === s.length) return;
+ u = s.shift(), a = t.currentTime, c === !1 && (c = !0, n.onAsyncRunning(!0));
}
- s <= t.currentTime && (l = !0, u.chain());
+ a <= t.currentTime && (l = !0, u.chain());
}
}
function r(t, i, r) {
@@ -15821,10 +23159,10 @@ function(e) {
e(r);
});
} finally {
- t.finished = !0, u === t && (u = void 0, l = !1), 0 === a.length ? (c = !1, n.onAsyncRunning(!1)) : o();
+ t.finished = !0, u === t && (u = void 0, l = !1), 0 === s.length ? (c = !1, n.onAsyncRunning(!1)) : o();
}
}
- var a = [];
+ var s = [];
i.prototype.onRun = function(e) {
this.runCallbacks.push(e);
}, i.prototype.onSuccess = function(e) {
@@ -15832,9 +23170,9 @@ function(e) {
}, i.prototype.onError = function(e) {
this.errorCallbacks.push(e);
};
- var s = 0;
+ var a = 0;
i.prototype.chain = function(e) {
- if (s = t.currentTime, t.logStackTrace(), this.finished !== !0) {
+ if (a = t.currentTime, t.logStackTrace(), this.finished !== !0) {
if (void 0 === this.queue && (this.queue = this.runCallbacks.slice()), void 0 !== e) return e(),
void 0;
if (0 === this.queue.length) return r(this, this.successCallbacks), void 0;
@@ -15851,10 +23189,10 @@ function(e) {
if (n = n || 5, this.queue = void 0, this.retryCounter >= n) return this.error(e),
void 0;
var i = 1e3 * Math.pow(2, this.retryCounter++);
- s = t.currentTime + i, l = !1, o();
+ a = t.currentTime + i, l = !1, o();
}
}, i.prototype.enqueue = function() {
- a.push(this), o();
+ s.push(this), o();
};
var c = !1, u = void 0, d = !1;
return n.addListener("onUserActive", function() {
@@ -15863,7 +23201,7 @@ function(e) {
}), define("helpers/dropboxHelper", [ "jquery", "underscore", "core", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(t) {
t.onRun(function() {
- return p === !0 ? (c = void 0, t.error(new Error("Operation not available in offline mode.|stopPublish")),
+ return h === !0 ? (c = void 0, t.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : void 0 !== c ? (t.chain(), void 0) : (e.ajax({
url: "lib/dropbox.min.js",
dataType: "script",
@@ -15881,11 +23219,11 @@ function(e) {
status: e.status,
responseText: e.statusText
};
- s(n, t);
+ a(n, t);
}), void 0);
});
}
- function a(e) {
+ function s(e) {
e.onRun(function() {
function t() {
n === !1 && (i.onMessage("Please make sure the Dropbox authorization popup is not blocked by your browser."),
@@ -15902,7 +23240,7 @@ function(e) {
e.chain(t);
});
}
- function s(e, i) {
+ function a(e, i) {
var o = !0;
if (e) if (logger.error(e), "string" == typeof e) o = e; else {
if (o = "Dropbox error (" + e.status + ": " + e.responseText + ").", 401 === e.status || 403 === e.status) return u = !1,
@@ -15916,30 +23254,30 @@ function(e) {
}
function l(t) {
t.onRun(function() {
- return f === !0 ? (t.chain(), void 0) : (e.ajax({
+ return p === !0 ? (t.chain(), void 0) : (e.ajax({
url: "https://www.dropbox.com/static/api/1/dropbox.js",
dataType: "script",
timeout: AJAX_TIMEOUT
}).done(function() {
- f = !0, t.chain();
+ p = !0, t.chain();
}).fail(function(e) {
var n = {
status: e.status,
responseText: e.statusText
};
- s(n, t);
+ a(n, t);
}), void 0);
});
}
- var c = void 0, u = !1, d = {}, p = !1;
+ var c = void 0, u = !1, d = {}, h = !1;
i.addListener("onOfflineChanged", function(e) {
- p = e;
+ h = e;
}), d.upload = function(e, t, n) {
var i = void 0, l = new o();
- r(l), a(l), l.onRun(function() {
+ r(l), s(l), l.onRun(function() {
c.writeFile(e, t, function(t, n) {
return t ? (400 === t.status && (t = 'Could not upload document into path "' + e + '".'),
- s(t, l), void 0) : (i = n, l.chain(), void 0);
+ a(t, l), void 0) : (i = n, l.chain(), void 0);
});
}), l.onSuccess(function() {
n(void 0, i);
@@ -15948,10 +23286,10 @@ function(e) {
}), l.enqueue();
}, d.checkChanges = function(e, t) {
var n = [], i = e || 0, l = new o();
- r(l), a(l), l.onRun(function() {
+ r(l), s(l), l.onRun(function() {
function e() {
c.pullChanges(i, function(t, o) {
- return t ? (s(t, l), void 0) : (i = o.cursor(), void 0 !== o.changes && (n = n.concat(o.changes)),
+ return t ? (a(t, l), void 0) : (i = o.cursor(), void 0 !== o.changes && (n = n.concat(o.changes)),
o.shouldPullAgain ? l.chain(e) : l.chain(), void 0);
});
}
@@ -15963,12 +23301,12 @@ function(e) {
}), l.enqueue();
}, d.downloadMetadata = function(e, t) {
var n = [], i = new o();
- r(i), a(i), i.onRun(function() {
+ r(i), s(i), i.onRun(function() {
function t() {
if (0 === e.length) return i.chain(), void 0;
var o = e[0];
c.stat(o, function(o, r) {
- return r ? (n.push(r), e.shift(), i.chain(t), void 0) : (s(o, i), void 0);
+ return r ? (n.push(r), e.shift(), i.chain(t), void 0) : (a(o, i), void 0);
});
}
i.chain(t);
@@ -15979,14 +23317,14 @@ function(e) {
}), i.enqueue();
}, d.downloadContent = function(e, t) {
var n = [], i = new o();
- r(i), a(i), i.onRun(function() {
+ r(i), s(i), i.onRun(function() {
function t() {
if (0 === e.length) return i.chain(), void 0;
var o = e[0];
n.push(o);
var r = void 0;
return o.isFile === !0 ? r = o : void 0 !== o.wasRemoved && (r = o.stat), r ? (c.readFile(r.path, function(n, o) {
- return o ? (r.content = o, e.shift(), i.chain(t), void 0) : (s(n, i), void 0);
+ return o ? (r.content = o, e.shift(), i.chain(t), void 0) : (a(n, i), void 0);
}), void 0) : (e.shift(), i.chain(t), void 0);
}
i.chain(t);
@@ -15996,7 +23334,7 @@ function(e) {
t(e);
}), i.enqueue();
};
- var f = !1;
+ var p = !1;
return d.picker = function(e) {
var t = [], n = new o();
n.timeout = ASYNC_TASK_LONG_TIMEOUT, r(n), l(n), n.onRun(function() {
@@ -16017,16 +23355,16 @@ function(e) {
}), n.enqueue();
}, d;
}), define("providers/dropboxProvider", [ "underscore", "utils", "classes/Provider", "eventMgr", "fileMgr", "helpers/dropboxHelper" ], function(e, t, n, i, o, r) {
- function a(e) {
+ function s(e) {
return void 0 === e ? void 0 : e.match(/^[^\\<>:"\|?\*]+$/) ? 0 !== e.indexOf("/") ? "/" + e : e : (i.onError('"' + e + '" contains invalid characters.'),
void 0);
}
- function s(e) {
+ function a(e) {
return "sync." + u + "." + encodeURIComponent(e.toLowerCase());
}
function l(e, n, i) {
var o = {};
- return o.provider = d, o.path = e, o.version = n, o.contentCRC = t.crc32(i), o.syncIndex = s(e),
+ return o.provider = d, o.path = e, o.version = n, o.contentCRC = t.crc32(i), o.syncIndex = a(e),
o;
}
function c(t) {
@@ -16050,7 +23388,7 @@ function(e) {
if (!t && 0 !== n.length) {
var r = [];
e.each(n, function(e) {
- var t = s(e), n = o.getFileFromSyncIndex(t);
+ var t = a(e), n = o.getFileFromSyncIndex(t);
return void 0 !== n ? (i.onError('"' + n.title + '" was already imported.'), void 0) : (r.push(e),
void 0);
}), c(r);
@@ -16058,11 +23396,11 @@ function(e) {
});
}, d.exportFile = function(e, n, c, u) {
var d = t.getInputTextValue("#input-sync-export-dropbox-path", e);
- if (d = a(d), void 0 === d) return u(!0), void 0;
- var p = s(d), f = o.getFileFromSyncIndex(p);
- if (void 0 !== f) {
- var h = f.title;
- return i.onError('File path is already synchronized with "' + h + '".'), u(!0),
+ if (d = s(d), void 0 === d) return u(!0), void 0;
+ var h = a(d), p = o.getFileFromSyncIndex(h);
+ if (void 0 !== p) {
+ var f = p.title;
+ return i.onError('File path is already synchronized with "' + f + '".'), u(!0),
void 0;
}
r.upload(d, c, function(e, t) {
@@ -16070,39 +23408,39 @@ function(e) {
var n = l(t.path, t.versionTag, c);
u(void 0, n);
});
- }, d.syncUp = function(e, t, n, i, o, a) {
- var s = o.contentCRC;
- return t == s ? (a(void 0, !1), void 0) : (r.upload(o.path, e, function(e, n) {
- return e ? (a(e, !0), void 0) : (o.version = n.versionTag, o.contentCRC = t, a(void 0, !0),
+ }, d.syncUp = function(e, t, n, i, o, s) {
+ var a = o.contentCRC;
+ return t == a ? (s(void 0, !1), void 0) : (r.upload(o.path, e, function(e, n) {
+ return e ? (s(e, !0), void 0) : (o.version = n.versionTag, o.contentCRC = t, s(void 0, !0),
void 0);
}), void 0);
}, d.syncDown = function(n) {
- var a = localStorage[u + ".lastChangeId"];
- r.checkChanges(a, function(a, l, c) {
- if (a) return n(a), void 0;
+ var s = localStorage[u + ".lastChangeId"];
+ r.checkChanges(s, function(s, l, c) {
+ if (s) return n(s), void 0;
var d = [];
e.each(l, function(e) {
- var t = s(e.path), n = o.getSyncAttributes(t);
+ var t = a(e.path), n = o.getSyncAttributes(t);
return void 0 !== n ? (e.syncAttributes = n, e.wasRemoved === !0 ? (d.push(e), void 0) : (n.version != e.stat.versionTag && d.push(e),
void 0)) : void 0;
- }), r.downloadContent(d, function(r, a) {
- return r ? (n(r), void 0) : (e.each(a, function(e) {
- var n = e.syncAttributes, r = n.syncIndex, a = o.getFileFromSyncIndex(r);
- if (void 0 !== a) {
- var s = a.title;
- if (e.wasRemoved === !0) return i.onError('"' + s + '" has been removed from Dropbox.'),
- a.removeSyncLocation(n), i.onSyncRemoved(a, n), void 0;
- var l = a.content, c = n.contentCRC != t.crc32(l), u = e.stat, d = t.crc32(u.content), p = n.contentCRC != d, f = l != u.content;
- f === !0 && c === !0 && p === !0 && (o.createFile(s + " (backup)", l), i.onMessage('Conflict detected on "' + s + '". A backup has been created locally.')),
- f && p === !0 && (a.content = u.content, i.onContentChanged(a), i.onMessage('"' + s + '" has been updated from Dropbox.'),
- o.currentFile === a && o.selectFile()), n.version = u.versionTag, n.contentCRC = d,
+ }), r.downloadContent(d, function(r, s) {
+ return r ? (n(r), void 0) : (e.each(s, function(e) {
+ var n = e.syncAttributes, r = n.syncIndex, s = o.getFileFromSyncIndex(r);
+ if (void 0 !== s) {
+ var a = s.title;
+ if (e.wasRemoved === !0) return i.onError('"' + a + '" has been removed from Dropbox.'),
+ s.removeSyncLocation(n), i.onSyncRemoved(s, n), void 0;
+ var l = s.content, c = n.contentCRC != t.crc32(l), u = e.stat, d = t.crc32(u.content), h = n.contentCRC != d, p = l != u.content;
+ p === !0 && c === !0 && h === !0 && (o.createFile(a + " (backup)", l), i.onMessage('Conflict detected on "' + a + '". A backup has been created locally.')),
+ p && h === !0 && (s.content = u.content, i.onContentChanged(s), i.onMessage('"' + a + '" has been updated from Dropbox.'),
+ o.currentFile === s && o.selectFile()), n.version = u.versionTag, n.contentCRC = d,
t.storeAttributes(n);
}
}), localStorage[u + ".lastChangeId"] = c, n(), void 0);
});
});
}, d.publish = function(e, t, n, i) {
- var o = a(e.path);
+ var o = s(e.path);
return void 0 === o ? (i(!0), void 0) : (r.upload(o, n, i), void 0);
}, d.newPublishAttributes = function(e) {
var n = {};
@@ -16111,7 +23449,7 @@ function(e) {
}), define("helpers/googleHelper", [ "jquery", "core", "utils", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(t) {
t.onRun(function() {
- return p === !0 ? (c = !1, t.error(new Error("Operation not available in offline mode.|stopPublish")),
+ return h === !0 ? (c = !1, t.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : c === !0 ? (t.chain(), void 0) : (delayedFunction = function() {
gapi.load("client,drive-realtime", function() {
c = !0, t.chain();
@@ -16125,11 +23463,11 @@ function(e) {
code: e.status,
message: e.statusText
};
- s(n, t);
+ a(n, t);
}), void 0);
});
}
- function a(e) {
+ function s(e) {
e.onRun(function() {
function t() {
n === !1 && (i.onMessage("Please make sure the Google authorization popup is not blocked by your browser."),
@@ -16149,7 +23487,7 @@ function(e) {
e.chain(t);
});
}
- function s(e, n) {
+ function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Google error (" + e.code + ": " + e.message + ").", e.code >= 500 && e.code < 600) return n.retry(new Error(i)),
@@ -16162,7 +23500,7 @@ function(e) {
}
function l(t) {
t.onRun(function() {
- return f === !0 ? (t.chain(), void 0) : (e.ajax({
+ return p === !0 ? (t.chain(), void 0) : (e.ajax({
url: "//www.google.com/jsapi",
data: {
key: GOOGLE_API_KEY
@@ -16174,27 +23512,27 @@ function(e) {
callback: function() {
t.chain();
}
- }), f = !0;
+ }), p = !0;
}).fail(function(e) {
var n = {
code: e.status,
message: e.statusText
};
- s(n, t);
+ a(n, t);
}), void 0);
});
}
- var c = !1, u = !1, d = {}, p = !1;
+ var c = !1, u = !1, d = {}, h = !1;
i.addListener("onOfflineChanged", function(e) {
- p = e;
+ h = e;
}), d.forceAuthenticate = function() {
u = !1;
var e = new o();
- r(e), a(e), e.enqueue();
+ r(e), s(e), e.enqueue();
}, d.upload = function(e, t, i, l, c, u) {
- var d = void 0, p = new o();
- r(p), a(p), p.onRun(function() {
- var o = "-------314159265358979323846", r = "\r\n--" + o + "\r\n", a = "\r\n--" + o + "--", c = "text/x-markdown", u = {
+ var d = void 0, h = new o();
+ r(h), s(h), h.onRun(function() {
+ var o = "-------314159265358979323846", r = "\r\n--" + o + "\r\n", s = "\r\n--" + o + "--", c = "text/x-markdown", u = {
title: i,
mimeType: c
};
@@ -16202,33 +23540,33 @@ function(e) {
kind: "drive#fileLink",
id: t
} ]);
- var f = "/upload/drive/v2/files", h = "POST";
- e && (f += "/" + e, h = "PUT");
- var m = {
+ var p = "/upload/drive/v2/files", f = "POST";
+ e && (p += "/" + e, f = "PUT");
+ var g = {
"Content-Type": 'multipart/mixed; boundary="' + o + '"'
- }, g = n.encodeBase64(l), v = [ r, "Content-Type: application/json\r\n\r\n", JSON.stringify(u), r, "Content-Type: ", c, "\r\n", "Content-Transfer-Encoding: base64\r\n", "\r\n", g, a ].join(""), b = gapi.client.request({
- path: f,
- method: h,
+ }, m = n.encodeBase64(l), v = [ r, "Content-Type: application/json\r\n\r\n", JSON.stringify(u), r, "Content-Type: ", c, "\r\n", "Content-Transfer-Encoding: base64\r\n", "\r\n", m, s ].join(""), b = gapi.client.request({
+ path: p,
+ method: f,
params: {
uploadType: "multipart"
},
- headers: m,
+ headers: g,
body: v
});
b.execute(function(t) {
- if (t && t.id) return d = t, d.content = l, p.chain(), void 0;
+ if (t && t.id) return d = t, d.content = l, h.chain(), void 0;
var n = t.error;
void 0 !== n && void 0 !== e && (404 === n.code ? n = 'File ID "' + e + '" not found on Google Drive.|removePublish' : 412 === n.code && (localStorage.removeItem("gdrive.lastChangeId"),
- n = 'Conflict on file ID "' + e + '". Please restart the synchronization.')), s(n, p);
+ n = 'Conflict on file ID "' + e + '". Please restart the synchronization.')), a(n, h);
});
- }), p.onSuccess(function() {
+ }), h.onSuccess(function() {
u(void 0, d);
- }), p.onError(function(e) {
+ }), h.onError(function(e) {
u(e);
- }), p.enqueue();
+ }), h.enqueue();
}, d.rename = function(e, t, n) {
var i = void 0, l = new o();
- r(l), a(l), l.onRun(function() {
+ r(l), s(l), l.onRun(function() {
var n = {
title: t
}, o = gapi.client.drive.files.patch({
@@ -16239,7 +23577,7 @@ function(e) {
if (t && t.id) return i = t, l.chain(), void 0;
var n = t.error;
void 0 !== n && void 0 !== e && 404 === n.code && (n = 'File ID "' + e + '" not found on Google Drive.|removePublish'),
- s(n, l);
+ a(n, l);
});
}), l.onSuccess(function() {
n(void 0, i);
@@ -16248,7 +23586,7 @@ function(e) {
}), l.enqueue();
}, d.createRealtimeFile = function(e, t, n) {
var i = void 0, l = new o();
- r(l), a(l), l.onRun(function() {
+ r(l), s(l), l.onRun(function() {
var n = {
title: t,
mimeType: "application/vnd.google-apps.drive-sdk"
@@ -16261,7 +23599,7 @@ function(e) {
resource: n
});
o.execute(function(e) {
- return e && e.id ? (i = e, l.chain(), void 0) : (s(e.error, l), void 0);
+ return e && e.id ? (i = e, l.chain(), void 0) : (a(e.error, l), void 0);
});
}), l.onSuccess(function() {
n(void 0, i);
@@ -16270,7 +23608,7 @@ function(e) {
}), l.enqueue();
}, d.uploadImg = function(t, n, i, l) {
var c = void 0, u = new o();
- r(u), a(u), u.onRun(function() {
+ r(u), s(u), u.onRun(function() {
var o = {
Slug: t
};
@@ -16291,7 +23629,7 @@ function(e) {
code: e.status,
message: e.statusText
};
- 200 == t.code && (t.message = e.responseText), s(t, u);
+ 200 == t.code && (t.message = e.responseText), a(t, u);
});
}), u.onSuccess(function() {
l(void 0, c);
@@ -16300,7 +23638,7 @@ function(e) {
}), u.enqueue();
}, d.checkChanges = function(e, t) {
var n = [], i = e || 0, l = new o();
- r(l), a(l), l.onRun(function() {
+ r(l), s(l), l.onRun(function() {
function e() {
var o = void 0;
o = void 0 === t ? gapi.client.drive.changes.list({
@@ -16309,7 +23647,7 @@ function(e) {
pageToken: t
}), o.execute(function(o) {
return o && o.largestChangeId ? (i = o.largestChangeId, t = o.nextPageToken, void 0 !== o.items && (n = n.concat(o.items)),
- void 0 !== t ? l.chain(e) : l.chain(), void 0) : (s(o.error, l), void 0);
+ void 0 !== t ? l.chain(e) : l.chain(), void 0) : (a(o.error, l), void 0);
});
}
var t = void 0;
@@ -16321,7 +23659,7 @@ function(e) {
}), l.enqueue();
}, d.downloadMetadata = function(t, n, i) {
var l = [], c = new o();
- r(c), i || a(c), c.onRun(function() {
+ r(c), i || s(c), c.onRun(function() {
function n() {
if (0 === t.length) return c.chain(), void 0;
var i = t[0], o = {}, r = gapi.auth.getToken();
@@ -16340,7 +23678,7 @@ function(e) {
code: e.status,
message: e.statusText
};
- 404 === t.code && (t = 'File ID "' + i + '" not found on Google Drive.'), s(t, c);
+ 404 === t.code && (t = 'File ID "' + i + '" not found on Google Drive.'), a(t, c);
});
}
c.chain(n);
@@ -16351,7 +23689,7 @@ function(e) {
}), c.enqueue();
}, d.downloadContent = function(t, n, i) {
var l = [], c = new o();
- c.timeout = ASYNC_TASK_LONG_TIMEOUT, r(c), i || a(c), c.onRun(function() {
+ c.timeout = ASYNC_TASK_LONG_TIMEOUT, r(c), i || s(c), c.onRun(function() {
function n() {
if (0 === t.length) return c.chain(), void 0;
var i = t[0];
@@ -16361,8 +23699,8 @@ function(e) {
c.chain(n), void 0;
if (0 === o.mimeType.indexOf("application/vnd.google-apps.drive-sdk")) return o.content = "",
o.isRealtime = !0, t.shift(), c.chain(n), void 0;
- var r = {}, a = gapi.auth.getToken();
- a && (r.Authorization = "Bearer " + a.access_token), e.ajax({
+ var r = {}, s = gapi.auth.getToken();
+ s && (r.Authorization = "Bearer " + s.access_token), e.ajax({
url: o.downloadUrl,
headers: r,
data: {
@@ -16377,7 +23715,7 @@ function(e) {
code: e.status,
message: e.statusText
};
- s(t, c);
+ a(t, c);
});
}
c.chain(n);
@@ -16387,10 +23725,10 @@ function(e) {
n(e);
}), c.enqueue();
}, d.loadRealtime = function(e, t, n, i) {
- var s = void 0, l = new o();
- r(l), a(l), l.onRun(function() {
+ var a = void 0, l = new o();
+ r(l), s(l), l.onRun(function() {
gapi.drive.realtime.load(e, function(e) {
- s = e, l.chain();
+ a = e, l.chain();
}, function(e) {
var n = e.createString(t);
e.getRoot().set("content", n);
@@ -16398,17 +23736,17 @@ function(e) {
i(e), l.error(new Error(e.message));
});
}), l.onSuccess(function() {
- n(void 0, s);
+ n(void 0, a);
}), l.onError(function(e) {
n(e);
}), l.enqueue();
};
- var f = !1;
+ var p = !1;
return d.picker = function(t, i) {
- function a() {
+ function s() {
void 0 !== c && (c.setVisible(!1), e(".modal-backdrop, .picker").remove());
}
- var s = [], c = void 0, u = new o();
+ var a = [], c = void 0, u = new o();
u.timeout = ASYNC_TASK_LONG_TIMEOUT, r(u), l(u), u.onRun(function() {
var t = new google.picker.PickerBuilder();
if (t.setAppId(GOOGLE_DRIVE_APP_ID), "doc" == i) {
@@ -16422,19 +23760,19 @@ function(e) {
t.enableFeature(google.picker.Feature.NAV_HIDDEN), t.addView(o);
} else "img" == i && (t.addView(google.picker.ViewId.PHOTOS), t.addView(google.picker.ViewId.PHOTO_UPLOAD));
t.setCallback(function(e) {
- (e.action == google.picker.Action.PICKED || e.action == google.picker.Action.CANCEL) && (e.action == google.picker.Action.PICKED && (s = e.docs),
- a(), u.chain());
+ (e.action == google.picker.Action.PICKED || e.action == google.picker.Action.CANCEL) && (e.action == google.picker.Action.PICKED && (a = e.docs),
+ s(), u.chain());
}), c = t.build(), e(n.createBackdrop()).click(function() {
- a(), u.chain();
+ s(), u.chain();
}), c.setVisible(!0);
}), u.onSuccess(function() {
- t(void 0, s);
+ t(void 0, a);
}), u.onError(function(e) {
- a(), t(e);
+ s(), t(e);
}), u.enqueue();
}, d.uploadBlogger = function(t, n, i, l, c, u, d) {
- var p = new o();
- r(p), a(p), p.onRun(function() {
+ var h = new o();
+ r(h), s(h), h.onRun(function() {
function o() {
var t = "https://www.googleapis.com/blogger/v3/blogs/" + n + "/posts/", o = {
kind: "blogger#post",
@@ -16448,70 +23786,70 @@ function(e) {
void 0 !== i && (t += i, o.id = i, r = "PUT"), e.ajax({
url: t,
data: JSON.stringify(o),
- headers: a,
+ headers: s,
type: r,
contentType: "application/json",
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
- i = e.id, p.chain();
+ i = e.id, h.chain();
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && void 0 !== i && (t = "Post " + i + " not found on Blogger.|removePublish"),
- s(t, p);
+ a(t, h);
});
}
function r() {
- return void 0 !== n ? (p.chain(o), void 0) : (e.ajax({
+ return void 0 !== n ? (h.chain(o), void 0) : (e.ajax({
url: "https://www.googleapis.com/blogger/v3/blogs/byurl",
data: {
url: t
},
- headers: a,
+ headers: s,
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
- n = e.id, p.chain(o);
+ n = e.id, h.chain(o);
}).fail(function(e) {
var n = {
code: e.status,
message: e.statusText
};
404 === n.code && (n = 'Blog "' + t + '" not found on Blogger.|removePublish'),
- s(n, p);
+ a(n, h);
}), void 0);
}
- var a = {}, d = gapi.auth.getToken();
- d && (a.Authorization = "Bearer " + d.access_token), p.chain(r);
- }), p.onSuccess(function() {
+ var s = {}, d = gapi.auth.getToken();
+ d && (s.Authorization = "Bearer " + d.access_token), h.chain(r);
+ }), h.onSuccess(function() {
d(void 0, n, i);
- }), p.onError(function(e) {
+ }), h.onError(function(e) {
d(e);
- }), p.enqueue();
+ }), h.enqueue();
}, d;
-}), define("providers/gdriveProvider", [ "underscore", "utils", "classes/Provider", "settings", "eventMgr", "fileMgr", "helpers/googleHelper" ], function(e, t, n, i, o, r, a) {
- function s(e) {
+}), define("providers/gdriveProvider", [ "underscore", "utils", "classes/Provider", "settings", "eventMgr", "fileMgr", "helpers/googleHelper" ], function(e, t, n, i, o, r, s) {
+ function a(e) {
return "sync." + u + "." + e;
}
function l(e, n, i, o) {
var r = {};
return r.provider = d, r.id = e, r.etag = n, r.contentCRC = t.crc32(i), r.titleCRC = t.crc32(o),
- r.syncIndex = s(e), r;
+ r.syncIndex = a(e), r;
}
function c(t) {
- a.downloadMetadata(t, function(t, n) {
- t || a.downloadContent(n, function(t, n) {
+ s.downloadMetadata(t, function(t, n) {
+ t || s.downloadContent(n, function(t, n) {
if (!t) {
- var i = [], a = void 0;
+ var i = [], s = void 0;
e.each(n, function(e) {
var t = l(e.id, e.etag, e.content, e.title);
t.isRealtime = e.isRealtime;
var n = {};
- n[t.syncIndex] = t, a = r.createFile(e.title, e.content, n), i.push(a);
- }), void 0 !== a && (o.onSyncImportSuccess(i, d), r.selectFile(a));
+ n[t.syncIndex] = t, s = r.createFile(e.title, e.content, n), i.push(s);
+ }), void 0 !== s && (o.onSyncImportSuccess(i, d), r.selectFile(s));
}
});
});
@@ -16519,11 +23857,11 @@ function(e) {
var u = "gdrive", d = new n(u, "Google Drive");
d.defaultPublishFormat = "template", d.exportPreferencesInputIds = [ "gdrive-parentid", "gdrive-realtime" ],
d.importFiles = function() {
- a.picker(function(t, n) {
+ s.picker(function(t, n) {
if (!t && 0 !== n.length) {
var i = [];
e.each(n, function(e) {
- var t = s(e.id), n = r.getFileFromSyncIndex(t);
+ var t = a(e.id), n = r.getFileFromSyncIndex(t);
return void 0 !== n ? (o.onError('"' + n.title + '" was already imported.'), void 0) : (i.push(e.id),
void 0);
}), c(i);
@@ -16532,65 +23870,63 @@ function(e) {
}, d.exportFile = function(e, n, i, c) {
var u = t.getInputTextValue("#input-sync-export-gdrive-fileid");
if (u) {
- var d = s(u), p = r.getFileFromSyncIndex(d);
- if (void 0 !== p) return o.onError('File ID is already synchronized with "' + p.title + '".'),
+ var d = a(u), h = r.getFileFromSyncIndex(d);
+ if (void 0 !== h) return o.onError('File ID is already synchronized with "' + h.title + '".'),
c(!0), void 0;
}
- var f = t.getInputTextValue("#input-sync-export-gdrive-parentid");
- a.upload(u, f, n, i, void 0, function(e, t) {
+ var p = t.getInputTextValue("#input-sync-export-gdrive-parentid");
+ s.upload(u, p, n, i, void 0, function(e, t) {
if (e) return c(e), void 0;
var o = l(t.id, t.etag, i, n);
c(void 0, o);
});
}, d.exportRealtimeFile = function(e, n, i, o) {
var r = t.getInputTextValue("#input-sync-export-gdrive-parentid");
- a.createRealtimeFile(r, n, function(e, t) {
+ s.createRealtimeFile(r, n, function(e, t) {
if (e) return o(e), void 0;
var r = l(t.id, t.etag, i, n);
o(void 0, r);
});
}, d.syncUp = function(e, t, n, i, o, r) {
- return t == o.contentCRC && i == o.titleCRC ? (r(void 0, !1), void 0) : (a.upload(o.id, void 0, n, e, o.etag, function(e, n) {
+ return t == o.contentCRC && i == o.titleCRC ? (r(void 0, !1), void 0) : (s.upload(o.id, void 0, n, e, o.etag, function(e, n) {
return e ? (r(e, !0), void 0) : (o.etag = n.etag, o.contentCRC = t, o.titleCRC = i,
r(void 0, !0), void 0);
}), void 0);
}, d.syncUpRealtime = function(e, t, n, i, o, r) {
- var s = !1;
- return t != o.contentCRC && (o.contentCRC = t, s = !0), i == o.titleCRC ? (r(void 0, s),
- void 0) : (a.rename(o.id, n, function(e, t) {
+ return i == o.titleCRC ? (r(void 0, !1), void 0) : (s.rename(o.id, n, function(e, t) {
return e ? (r(e, !0), void 0) : (o.etag = t.etag, o.titleCRC = i, r(void 0, !0),
void 0);
}), void 0);
}, d.syncDown = function(n) {
var i = parseInt(localStorage[u + ".lastChangeId"]);
- a.checkChanges(i, function(i, l, c) {
+ s.checkChanges(i, function(i, l, c) {
if (i) return n(i), void 0;
- var p = [];
+ var h = [];
e.each(l, function(e) {
- var t = s(e.fileId), n = r.getSyncAttributes(t);
- return void 0 !== n ? (e.syncAttributes = n, e.deleted === !0 ? (p.push(e), void 0) : (n.etag != e.file.etag && p.push(e),
+ var t = a(e.fileId), n = r.getSyncAttributes(t);
+ return void 0 !== n ? (e.syncAttributes = n, e.deleted === !0 ? (h.push(e), void 0) : (n.etag != e.file.etag && h.push(e),
void 0)) : void 0;
- }), a.downloadContent(p, function(i, a) {
- return i ? (n(i), void 0) : (e.each(a, function(e) {
- var n = e.syncAttributes, i = n.syncIndex, a = r.getFileFromSyncIndex(i);
- if (void 0 !== a) {
- var s = a.title;
- if (e.deleted === !0) return o.onError('"' + s + '" has been removed from Google Drive.'),
- a.removeSyncLocation(n), o.onSyncRemoved(a, n), n.isRealtime === !0 && r.currentFile === a && d.stopRealtimeSync(),
+ }), s.downloadContent(h, function(i, s) {
+ return i ? (n(i), void 0) : (e.each(s, function(e) {
+ var n = e.syncAttributes, i = n.syncIndex, s = r.getFileFromSyncIndex(i);
+ if (void 0 !== s) {
+ var a = s.title;
+ if (e.deleted === !0) return o.onError('"' + a + '" has been removed from Google Drive.'),
+ s.removeSyncLocation(n), o.onSyncRemoved(s, n), n.isRealtime === !0 && r.currentFile === s && d.stopRealtimeSync(),
void 0;
- var l = n.titleCRC != t.crc32(s), c = a.content, u = n.contentCRC != t.crc32(c), p = e.file, f = t.crc32(p.title), h = n.titleCRC != f, m = s != p.title, g = t.crc32(p.content), v = n.contentCRC != g, b = c != p.content;
- (m === !0 && l === !0 && h === !0 || !n.isRealtime && b === !0 && u === !0 && v === !0) && (r.createFile(s + " (backup)", c),
- o.onMessage('Conflict detected on "' + s + '". A backup has been created locally.')),
- m && h === !0 && (a.title = p.title, o.onTitleChanged(a), o.onMessage('"' + s + '" has been renamed to "' + p.title + '" on Google Drive.')),
- !n.isRealtime && b && v === !0 && (a.content = p.content, o.onContentChanged(a),
- o.onMessage('"' + p.title + '" has been updated from Google Drive.'), r.currentFile === a && r.selectFile()),
- n.etag = p.etag, n.isRealtime || (n.contentCRC = g), n.titleCRC = f, t.storeAttributes(n);
+ var l = n.titleCRC != t.crc32(a), c = s.content, u = n.contentCRC != t.crc32(c), h = e.file, p = t.crc32(h.title), f = n.titleCRC != p, g = a != h.title, m = t.crc32(h.content), v = n.contentCRC != m, b = c != h.content;
+ (g === !0 && l === !0 && f === !0 || !n.isRealtime && b === !0 && u === !0 && v === !0) && (r.createFile(a + " (backup)", c),
+ o.onMessage('Conflict detected on "' + a + '". A backup has been created locally.')),
+ g && f === !0 && (s.title = h.title, o.onTitleChanged(s), o.onMessage('"' + a + '" has been renamed to "' + h.title + '" on Google Drive.')),
+ !n.isRealtime && b && v === !0 && (s.content = h.content, o.onContentChanged(s),
+ o.onMessage('"' + h.title + '" has been updated from Google Drive.'), r.currentFile === s && r.selectFile()),
+ n.etag = h.etag, n.isRealtime || (n.contentCRC = m), n.titleCRC = p, t.storeAttributes(n);
}
}), localStorage[u + ".lastChangeId"] = c, n(), void 0);
});
});
}, d.publish = function(e, t, n, i) {
- a.upload(e.id, void 0, e.fileName || t, n, void 0, function(t, n) {
+ s.upload(e.id, void 0, e.fileName || t, n, void 0, function(t, n) {
return t ? (i(t), void 0) : (e.id = n.id, i(), void 0);
});
}, d.newPublishAttributes = function(e) {
@@ -16598,56 +23934,78 @@ function(e) {
return n.id = t.getInputTextValue("#input-publish-gdrive-fileid"), n.fileName = t.getInputTextValue("#input-publish-gdrive-filename"),
e.isPropagationStopped() ? void 0 : n;
};
- var p = void 0;
- o.addListener("onEditorConfigure", function(e) {
- p = e;
+ var h = void 0;
+ o.addListener("onPagedownConfigure", function(e) {
+ h = e;
});
- var f = void 0, h = void 0, m = void 0, g = void 0;
+ var p = void 0, f = void 0, g = void 0, m = void 0, v = void 0, b = void 0, y = void 0, w = !0;
+ o.addListener("onAceCreated", function(e) {
+ y = e, y.session.on("change", function() {
+ void 0 !== g && g.setText(y.getValue());
+ });
+ });
+ var C = require("ace/range").Range;
return d.startRealtimeSync = function(n, i) {
- a.loadRealtime(i.id, n.content, function(a, s) {
+ s.loadRealtime(i.id, n.content, function(s, a) {
function l() {
- i.contentCRC = t.crc32(v.getText()), t.storeAttributes(i);
+ i.contentCRC = t.crc32(g.getText()), t.storeAttributes(i);
}
- function c(e) {
- e.isLocal === !1 && (logger.log("Google Drive realtime document updated from server"),
- l(), b());
- }
- function u() {
- p.uiManager.setButtonState(p.uiManager.buttons.undo, d.canUndo), p.uiManager.setButtonState(p.uiManager.buttons.redo, d.canRedo);
- }
- if (!a && s) {
- if (r.currentFile !== n) return s.close(), void 0;
- logger.log("Starting Google Drive realtime synchronization"), f = s;
- var d = f.getModel(), v = d.getRoot().get("content"), b = e.debounce(p.refreshPreview, 100);
- v.addEventListener(gapi.drive.realtime.EventType.TEXT_INSERTED, c), v.addEventListener(gapi.drive.realtime.EventType.TEXT_DELETED, c),
- f.addEventListener(gapi.drive.realtime.EventType.DOCUMENT_SAVE_STATE_CHANGED, function(e) {
+ if (!s && a) {
+ if (r.currentFile !== n) return a.close(), void 0;
+ logger.log("Starting Google Drive realtime synchronization"), p = a;
+ var c = p.getModel();
+ g = c.getRoot().get("content");
+ var u = e.debounce(h.refreshPreview, 100);
+ g.addEventListener(gapi.drive.realtime.EventType.TEXT_INSERTED, function(e) {
+ if (void 0 !== y && (w === !1 || e.isLocal === !1)) {
+ var t = y.session.doc.indexToPosition(e.index);
+ y.session.insert(t, e.text), w = !0;
+ }
+ e.isLocal === !1 && (logger.log("Google Drive realtime document updated from server"),
+ l(), void 0 === y && u());
+ }), g.addEventListener(gapi.drive.realtime.EventType.TEXT_DELETED, function(e) {
+ if (void 0 !== y && (w === !1 || e.isLocal === !1)) {
+ var t = function(e, t) {
+ return new C(e.row, e.column, t.row, t.column);
+ }(y.session.doc.indexToPosition(e.index), y.session.doc.indexToPosition(e.index + e.text.length));
+ y.session.remove(t), w = !0;
+ }
+ e.isLocal === !1 && (logger.log("Google Drive realtime document updated from server"),
+ l(), void 0 === y && u());
+ }), p.addEventListener(gapi.drive.realtime.EventType.DOCUMENT_SAVE_STATE_CHANGED, function(e) {
e.isPending === !1 && e.isSaving === !1 && (logger.log("Google Drive realtime document successfully saved on server"),
l());
});
- var y = n.content, x = i.contentCRC != t.crc32(y), w = v.getText(), C = t.crc32(w), k = i.contentCRC != C, S = y != w;
- S === !0 && x === !0 && (k === !0 ? (r.createFile(n.title + " (backup)", y), o.onMessage('Conflict detected on "' + n.title + '". A backup has been created locally.')) : v.setText(y)),
- h = gapi.drive.realtime.databinding.bindString(v, document.getElementById("wmd-input")),
- k === !0 && (logger.log("Google Drive realtime document updated from server"), l(),
- b()), m = p.uiManager.buttons.undo.execute, g = p.uiManager.buttons.redo.execute,
- p.uiManager.buttons.undo.execute = function() {
- d.canUndo && d.undo();
- }, p.uiManager.buttons.redo.execute = function() {
- d.canRedo && d.redo();
- }, d.addEventListener(gapi.drive.realtime.EventType.UNDO_REDO_STATE_CHANGED, u),
- u();
+ var d = n.content, x = i.contentCRC != t.crc32(d), E = g.getText(), A = t.crc32(E), S = i.contentCRC != A, k = d != E;
+ k === !0 && x === !0 && (S === !0 ? (r.createFile(n.title + " (backup)", d), o.onMessage('Conflict detected on "' + n.title + '". A backup has been created locally.')) : g.setText(d)),
+ void 0 === y && (f = gapi.drive.realtime.databinding.bindString(g, document.getElementById("wmd-input"))),
+ S === !0 && (logger.log("Google Drive realtime document updated from server"), void 0 !== y && y.setValue(E, -1),
+ l(), void 0 === y && u()), void 0 !== y && (m = h.uiManager.buttons.undo.execute,
+ v = h.uiManager.buttons.redo.execute, b = h.uiManager.setUndoRedoButtonStates, h.uiManager.buttons.undo.execute = function() {
+ c.canUndo && (w = !1, c.undo());
+ }, h.uiManager.buttons.redo.execute = function() {
+ c.canRedo && (w = !1, c.redo());
+ }, h.uiManager.setUndoRedoButtonStates = function() {
+ setTimeout(function() {
+ h.uiManager.setButtonState(h.uiManager.buttons.undo, c.canUndo), h.uiManager.setButtonState(h.uiManager.buttons.redo, c.canRedo);
+ }, 50);
+ }, h.uiManager.setUndoRedoButtonStates(), c.addEventListener(gapi.drive.realtime.EventType.UNDO_REDO_STATE_CHANGED, function() {
+ h.uiManager.setUndoRedoButtonStates();
+ }));
}
}, function(e) {
- console.error(e), "token_refresh_required" == e.type ? a.forceAuthenticate() : "not_found" == e.type ? (o.onError('"' + n.title + '" has been removed from Google Drive.'),
+ console.error(e), "token_refresh_required" == e.type ? s.forceAuthenticate() : "not_found" == e.type ? (o.onError('"' + n.title + '" has been removed from Google Drive.'),
n.removeSyncLocation(i), o.onSyncRemoved(n, i), d.stopRealtimeSync()) : e.isFatal && (o.onError("An error has forced real time synchronization to stop."),
d.stopRealtimeSync());
});
}, d.stopRealtimeSync = function() {
- logger.log("Stopping Google Drive realtime synchronization"), void 0 !== h && (h.unbind(),
- h = void 0), void 0 !== f && (f.close(), f = void 0), p.uiManager.buttons.undo.execute = m,
- p.uiManager.buttons.redo.execute = g, p.uiManager.setUndoRedoButtonStates();
+ logger.log("Stopping Google Drive realtime synchronization"), void 0 !== g && (g = void 0),
+ void 0 !== f && (f.unbind(), f = void 0), void 0 !== p && (p.close(), p = void 0),
+ void 0 !== y && (h.uiManager.buttons.undo.execute = m, h.uiManager.buttons.redo.execute = v,
+ h.uiManager.setUndoRedoButtonStates = b, h.uiManager.setUndoRedoButtonStates());
}, o.addListener("onReady", function() {
$(".export-gdrive-choose-folder").click(function() {
- a.picker(function(e, n) {
+ s.picker(function(e, n) {
e || 0 === n.length || ($(".modal-upload-gdrive").modal(), t.setInputValue("#input-sync-export-gdrive-parentid", n[0].id));
}, "folder");
});
@@ -16655,62 +24013,62 @@ function(e) {
$("#input-sync-export-gdrive-realtime").change(function() {
d.prop("disabled", n.prop("checked"));
});
- var p = t.retrieveIgnoreError(u + ".state");
- if (void 0 !== p) if (localStorage.removeItem(u + ".state"), "create" == p.action) a.upload(void 0, p.folderId, GDRIVE_DEFAULT_FILE_TITLE, i.defaultContent, void 0, function(e, t) {
+ var h = t.retrieveIgnoreError(u + ".state");
+ if (void 0 !== h) if (localStorage.removeItem(u + ".state"), "create" == h.action) s.upload(void 0, h.folderId, GDRIVE_DEFAULT_FILE_TITLE, i.defaultContent, void 0, function(e, t) {
if (!e) {
var n = l(t.id, t.etag, t.content, t.title), i = {};
i[n.syncIndex] = n;
- var a = r.createFile(t.title, t.content, i);
- r.selectFile(a), o.onMessage('"' + t.title + '" created successfully on Google Drive.');
+ var s = r.createFile(t.title, t.content, i);
+ r.selectFile(s), o.onMessage('"' + t.title + '" created successfully on Google Drive.');
}
- }); else if ("open" == p.action) {
- var f = [];
- e.each(p.ids, function(e) {
- var t = s(e), n = r.getFileFromSyncIndex(t);
- void 0 !== n ? r.selectFile(n) : f.push(e);
- }), c(f);
+ }); else if ("open" == h.action) {
+ var p = [];
+ e.each(h.ids, function(e) {
+ var t = a(e), n = r.getFileFromSyncIndex(t);
+ void 0 !== n ? r.selectFile(n) : p.push(e);
+ }), c(p);
}
}), d;
-}), define("synchronizer", [ "jquery", "underscore", "utils", "eventMgr", "fileSystem", "fileMgr", "classes/Provider", "providers/dropboxProvider", "providers/gdriveProvider" ], function(e, t, n, i, o, r, a) {
- function s(e) {
+}), define("synchronizer", [ "jquery", "underscore", "utils", "eventMgr", "fileSystem", "fileMgr", "classes/Provider", "providers/dropboxProvider", "providers/gdriveProvider" ], function(e, t, n, i, o, r, s) {
+ function a(e) {
if (0 === b.length) return l(e), void 0;
var t = b.pop(), i = t.provider.syncUp;
- t.isRealtime === !0 && (i = t.provider.syncUpRealtime), i(y, x, w, C, t, function(i, o) {
- return o === !0 && (S = !0), i ? (e(i), void 0) : (o && n.storeAttributes(t), s(e),
+ t.isRealtime === !0 && (i = t.provider.syncUpRealtime), i(y, w, C, x, t, function(i, o) {
+ return o === !0 && (A = !0), i ? (e(i), void 0) : (o && n.storeAttributes(t), a(e),
void 0);
});
}
function l(e) {
- if (0 === k.length) return c(e), void 0;
- var i = k.pop();
+ if (0 === E.length) return c(e), void 0;
+ var i = E.pop();
return b = t.values(i.syncLocations), 0 === b.length ? (l(e), void 0) : (y = i.content,
- x = n.crc32(y), w = i.title, C = n.crc32(w), s(e), void 0);
+ w = n.crc32(y), C = i.title, x = n.crc32(C), a(e), void 0);
}
function c(e) {
- S === !0 ? (S = !1, k = t.values(o), l(e)) : e();
+ A === !0 ? (A = !1, E = t.values(o), l(e)) : e();
}
function u(e) {
- if (0 === _.length) return e(), void 0;
- var t = _.pop();
- return g.hasSync(t) ? (t.syncDown(function(t) {
+ if (0 === S.length) return e(), void 0;
+ var t = S.pop();
+ return m.hasSync(t) ? (t.syncDown(function(t) {
return t ? (e(t), void 0) : (u(e), void 0);
}), void 0) : (u(e), void 0);
}
function d(e) {
- _ = t.values(v), u(e);
+ S = t.values(v), u(e);
+ }
+ function h(e) {
+ _ = t.some(e.syncLocations, function(e) {
+ return $ = e, e.isRealtime;
+ }) ? e : void 0, f();
}
function p(e) {
- N = t.some(e.syncLocations, function(e) {
- return I = e, e.isRealtime;
- }) ? e : void 0, h();
+ e === !1 ? (D = !0, f()) : (m.tryStopRealtimeSync(), D = !1);
}
- function f(e) {
- e === !1 ? (P = !0, h()) : (g.tryStopRealtimeSync(), P = !1);
+ function f() {
+ void 0 !== _ && D === !0 && $.provider.startRealtimeSync(_, $);
}
- function h() {
- void 0 !== N && P === !0 && I.provider.startRealtimeSync(N, I);
- }
- function m(i) {
+ function g(i) {
n.resetModalInputs();
var o = n.retrieveIgnoreError(i.providerId + ".exportPreferences");
o && t.each(i.exportPreferencesInputIds, function(e) {
@@ -16718,8 +24076,8 @@ function(e) {
t.isBoolean(i) ? n.setInputChecked("#input-sync-export-" + e, i) : n.setInputValue("#input-sync-export-" + e, i);
}), e(".modal-upload-" + i.providerId).modal();
}
- var g = {}, v = t.chain(arguments).map(function(e) {
- return e instanceof a && [ e.providerId, e ];
+ var m = {}, v = t.chain(arguments).map(function(e) {
+ return e instanceof s && [ e.providerId, e ];
}).compact().object().value();
t.each(o, function(e) {
t.each(n.retrieveIndexArray(e.fileIndex + ".sync"), function(t) {
@@ -16729,56 +24087,56 @@ function(e) {
var r = v[o.provider];
if (!r) throw new Error("Invalid provider ID: " + o.provider);
o.provider = r, e.syncLocations[t] = o;
- } catch (a) {
- i.onError(a), n.removeIndexFromArray(e.fileIndex + ".sync", t), localStorage.removeItem(t);
+ } catch (s) {
+ i.onError(s), n.removeIndexFromArray(e.fileIndex + ".sync", t), localStorage.removeItem(t);
}
});
- }), g.hasSync = function(e) {
+ }), m.hasSync = function(e) {
return t.some(o, function(n) {
return t.some(n.syncLocations, function(t) {
return void 0 === e || t.provider === e;
});
});
};
- var b = [], y = void 0, x = void 0, w = void 0, C = void 0, k = [], S = !1, _ = [], T = !1;
+ var b = [], y = void 0, w = void 0, C = void 0, x = void 0, E = [], A = !1, S = [], k = !1;
i.addListener("onOfflineChanged", function(e) {
- T = e;
+ k = e;
});
- var E = !1;
- g.sync = function() {
+ var F = !1;
+ m.sync = function() {
function e(e) {
- return void 0 !== e ? (E = !1, i.onSyncRunning(!1), !0) : !1;
+ return void 0 !== e ? (F = !1, i.onSyncRunning(!1), !0) : !1;
}
- return E === !0 || T === !0 ? !1 : (E = !0, i.onSyncRunning(!0), S = !0, d(function(t) {
+ return F === !0 || k === !0 ? !1 : (F = !0, i.onSyncRunning(!0), A = !0, d(function(t) {
e(t) || c(function(t) {
- e(t) || (E = !1, i.onSyncRunning(!1), i.onSyncSuccess());
+ e(t) || (F = !1, i.onSyncRunning(!1), i.onSyncSuccess());
});
}), !0);
};
- var N = void 0, I = void 0, P = !0;
- return g.tryStopRealtimeSync = function() {
- void 0 !== N && P === !0 && I.provider.stopRealtimeSync();
- }, viewerMode === !1 && (i.addListener("onFileOpen", p), i.addListener("onFileClosed", g.tryStopRealtimeSync),
- i.addListener("onOfflineChanged", f)), i.addListener("onReady", function() {
+ var _ = void 0, $ = void 0, D = !0;
+ return m.tryStopRealtimeSync = function() {
+ void 0 !== _ && D === !0 && $.provider.stopRealtimeSync();
+ }, viewerMode === !1 && (i.addListener("onFileOpen", h), i.addListener("onFileClosed", m.tryStopRealtimeSync),
+ i.addListener("onOfflineChanged", p)), i.addListener("onReady", function() {
t.each(v, function(o) {
e(".action-sync-import-" + o.providerId).click(function(e) {
o.importFiles(e);
}), e(".action-sync-export-dialog-" + o.providerId).click(function() {
- m(o);
+ g(o);
}), e(".action-sync-export-" + o.providerId).click(function(e) {
- var a = n.getInputChecked("#input-sync-export-" + o.providerId + "-realtime"), s = r.currentFile;
- if (a) {
- if (t.size(s.syncLocations) > 0) return i.onError("Real time collaborative document can't be synchronized with multiple locations"),
+ var s = n.getInputChecked("#input-sync-export-" + o.providerId + "-realtime"), a = r.currentFile;
+ if (s) {
+ if (t.size(a.syncLocations) > 0) return i.onError("Real time collaborative document can't be synchronized with multiple locations"),
void 0;
- o.exportRealtimeFile(e, s.title, s.content, function(e, t) {
- e || (t.isRealtime = !0, s.addSyncLocation(t), i.onSyncExportSuccess(s, t), N = s,
- I = t, h());
+ o.exportRealtimeFile(e, a.title, a.content, function(e, t) {
+ e || (t.isRealtime = !0, a.addSyncLocation(t), i.onSyncExportSuccess(a, t), _ = a,
+ $ = t, f());
});
} else {
- if (t.size(s.syncLocations) > 0 && t.first(t.values(s.syncLocations)).isRealtime) return i.onError("Real time collaborative document can't be synchronized with multiple locations"),
+ if (t.size(a.syncLocations) > 0 && t.first(t.values(a.syncLocations)).isRealtime) return i.onError("Real time collaborative document can't be synchronized with multiple locations"),
void 0;
- o.exportFile(e, s.title, s.content, function(e, t) {
- e || (s.addSyncLocation(t), i.onSyncExportSuccess(s, t));
+ o.exportFile(e, a.title, a.content, function(e, t) {
+ e || (a.addSyncLocation(t), i.onSyncExportSuccess(a, t));
});
}
var l = {};
@@ -16788,33 +24146,33 @@ function(e) {
}), localStorage[o.providerId + ".exportPreferences"] = JSON.stringify(l);
});
});
- }), i.onSynchronizerCreated(g), g;
+ }), i.onSynchronizerCreated(m), m;
}), define("providers/downloadProvider", [ "jquery", "eventMgr", "utils", "fileMgr", "classes/Provider", "classes/AsyncTask" ], function(e, t, n, i, o, r) {
- var a = new o("download");
- return a.sharingAttributes = [ "url" ], a.importPublic = function(t, n) {
- var i = void 0, o = void 0, a = new r();
- a.onRun(function() {
+ var s = new o("download");
+ return s.sharingAttributes = [ "url" ], s.importPublic = function(t, n) {
+ var i = void 0, o = void 0, s = new r();
+ s.onRun(function() {
var n = t.url, r = n.lastIndexOf("/");
- return -1 === r ? (a.error(new Error("Invalid URL parameter.")), void 0) : (i = n.substring(r + 1),
+ return -1 === r ? (s.error(new Error("Invalid URL parameter.")), void 0) : (i = n.substring(r + 1),
e.ajax({
url: DOWNLOAD_PROXY_URL + "download?url=" + n,
type: "GET",
dataType: "text",
timeout: AJAX_TIMEOUT
}).done(function(e) {
- o = e, a.chain();
+ o = e, s.chain();
}).fail(function() {
- a.error(new Error("Unable to access URL " + n));
+ s.error(new Error("Unable to access URL " + n));
}), void 0);
- }), a.onSuccess(function() {
+ }), s.onSuccess(function() {
n(void 0, i, o);
- }), a.onError(function(e) {
+ }), s.onError(function(e) {
n(e);
- }), a.enqueue();
+ }), s.enqueue();
}, t.addListener("onReady", function() {
e(".action-import-url").click(function(e) {
var t = n.getInputTextValue("#input-import-url", e);
- t && a.importPublic({
+ t && s.importPublic({
url: t
}, function(e, t, n) {
if (!e) {
@@ -16823,7 +24181,7 @@ function(e) {
}
});
});
- }), a;
+ }), s;
}), define("helpers/githubHelper", [ "jquery", "core", "utils", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(t) {
t.onRun(function() {
@@ -16839,24 +24197,24 @@ function(e) {
error: e.status,
message: e.statusText
};
- s(n, t);
+ a(n, t);
}), void 0);
});
}
- function a(t) {
+ function s(t) {
var o = void 0, r = void 0;
t.onRun(function() {
- function a() {
+ function s() {
localStorage.removeItem("githubCode"), o = n.popupWindow("github-oauth-client.html?client_id=" + GITHUB_CLIENT_ID, "stackedit-github-oauth", 960, 600),
o.focus(), r = setInterval(function() {
if (o.closed === !0) {
if (clearInterval(r), o = void 0, r = void 0, d = localStorage.githubCode, void 0 === d) return t.error(new Error(u)),
void 0;
- localStorage.removeItem("githubCode"), t.chain(s);
+ localStorage.removeItem("githubCode"), t.chain(a);
}
}, 500);
}
- function s() {
+ function a() {
e.getJSON(GATEKEEPER_URL + "authenticate/" + d, function(e) {
void 0 !== e.token ? (l = e.token, localStorage.githubToken = l, c = new Github({
token: l,
@@ -16874,12 +24232,12 @@ function(e) {
var u = "Failed to retrieve a token from GitHub.";
t.timeout = ASYNC_TASK_LONG_TIMEOUT;
var d = void 0;
- t.chain(a);
+ t.chain(s);
}), t.onError(function() {
void 0 !== r && clearInterval(r), void 0 !== o && o.close();
});
}
- function s(e, n) {
+ function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Could not publish on GitHub.", 401 === e.error || 403 === e.error) return c = void 0,
@@ -16893,29 +24251,29 @@ function(e) {
return i.addListener("onOfflineChanged", function(e) {
d = e;
}), u.upload = function(e, t, n, i, l, u, d) {
- var p = new o();
- r(p), a(p), p.onRun(function() {
+ var h = new o();
+ r(h), s(h), h.onRun(function() {
function o() {
var e = c.getUser();
e.show(void 0, function(e, n) {
- return e ? (s(e, p), void 0) : (t = n.login, p.chain(r), void 0);
+ return e ? (a(e, h), void 0) : (t = n.login, h.chain(r), void 0);
});
}
function r() {
var o = c.getRepo(t, e);
o.write(n, i, l, u, function(e) {
- return e ? (s(e, p), void 0) : (p.chain(), void 0);
+ return e ? (a(e, h), void 0) : (h.chain(), void 0);
});
}
- t ? p.chain(r) : p.chain(o);
- }), p.onSuccess(function() {
+ t ? h.chain(r) : h.chain(o);
+ }), h.onSuccess(function() {
d();
- }), p.onError(function(e) {
+ }), h.onError(function(e) {
d(e);
- }), p.enqueue();
+ }), h.enqueue();
}, u.uploadGist = function(e, t, n, i, l, u) {
var d = new o();
- r(d), a(d), d.onRun(function() {
+ r(d), s(d), d.onRun(function() {
var o = c.getGist(e), r = {};
r[t] = {
content: l
@@ -16925,7 +24283,7 @@ function(e) {
files: r
}, function(t, n) {
return t ? (404 === t.error && void 0 !== e && (t = "Gist " + e + " not found on GitHub.|removePublish"),
- s(t, d), void 0) : (e = n.id, d.chain(), void 0);
+ a(t, d), void 0) : (e = n.id, d.chain(), void 0);
});
}), d.onSuccess(function() {
u(void 0, e);
@@ -16935,18 +24293,18 @@ function(e) {
}, u.downloadGist = function(e, t, n) {
var i = new o();
r(i);
- var a = void 0, s = void 0;
+ var s = void 0, a = void 0;
i.onRun(function() {
var n = new Github({}), o = n.getGist(e);
o.read(function(n, o) {
if (n) return i.error(new Error("Error trying to access Gist " + e + ".")), void 0;
- a = o.description;
+ s = o.description;
var r = o.files[t];
return void 0 === r ? (i.error(new Error("Gist " + e + ' does not contain "' + t + '".')),
- void 0) : (s = r.content, i.chain(), void 0);
+ void 0) : (a = r.content, i.chain(), void 0);
});
}), i.onSuccess(function() {
- n(void 0, a, s);
+ n(void 0, s, a);
}), i.onError(function(e) {
n(e);
}), i.enqueue();
@@ -16965,24 +24323,24 @@ function(e) {
}, i.importPublic = function(e, t) {
n.downloadGist(e.gistId, e.filename, t);
}, i;
-}), define("sharing", [ "jquery", "underscore", "utils", "eventMgr", "fileMgr", "classes/AsyncTask", "classes/Provider", "providers/downloadProvider", "providers/gistProvider" ], function(e, t, n, i, o, r, a) {
- var s = {}, l = t.chain(arguments).map(function(e) {
- return e instanceof a && [ e.providerId, e ];
+}), define("sharing", [ "jquery", "underscore", "utils", "eventMgr", "fileMgr", "classes/AsyncTask", "classes/Provider", "providers/downloadProvider", "providers/gistProvider" ], function(e, t, n, i, o, r, s) {
+ var a = {}, l = t.chain(arguments).map(function(e) {
+ return e instanceof s && [ e.providerId, e ];
}).compact().object().value(), c = !1;
return i.addListener("onOfflineChanged", function(e) {
c = e;
- }), s.createLink = function(n, o) {
- function a() {
+ }), a.createLink = function(n, o) {
+ function s() {
o();
}
- var s = l[n.provider.providerId];
- if (void 0 !== n.sharingLink || void 0 === s || "markdown" != n.format) return o(),
+ var a = l[n.provider.providerId];
+ if (void 0 !== n.sharingLink || void 0 === a || "markdown" != n.format) return o(),
void 0;
var u = new r(), d = void 0;
u.onRun(function() {
if (c === !0) return u.chain(), void 0;
- var o = [ MAIN_URL, "viewer.html?provider=", s.providerId ];
- t.each(s.sharingAttributes, function(e) {
+ var o = [ MAIN_URL, "viewer.html?provider=", a.providerId ];
+ t.each(a.sharingAttributes, function(e) {
o.push("&"), o.push(e), o.push("="), o.push(encodeURIComponent(n[e]));
}), o = o.join(""), e.getJSON("https://api-ssl.bitly.com/v3/shorten", {
access_token: BITLY_ACCESS_TOKEN,
@@ -16991,19 +24349,19 @@ function(e) {
e.data ? (d = e.data.url, n.sharingLink = d) : (i.onError("An error occured while creating sharing link."),
n.sharingLink = o), u.chain();
});
- }), u.onSuccess(a), u.onError(a), u.enqueue();
+ }), u.onSuccess(s), u.onError(s), u.enqueue();
}, i.addListener("onReady", function() {
if (viewerMode !== !1) {
var i = n.getURLParameter("provider");
void 0 === i && (i = "download");
var r = l[i];
if (void 0 !== r) {
- var a = {};
+ var s = {};
t.each(r.sharingAttributes, function(e) {
var t = n.getURLParameter(e);
- return t ? (a[e] = t, void 0) : (a = void 0, void 0);
- }), void 0 !== a && (e("#preview-contents, .navbar .file-title-navbar").hide(),
- r.importPublic(a, function(t, n, i) {
+ return t ? (s[e] = t, void 0) : (s = void 0, void 0);
+ }), void 0 !== s && (e("#preview-contents, .navbar .file-title-navbar").hide(),
+ r.importPublic(s, function(t, n, i) {
if (e("#preview-contents, .navbar .file-title-navbar").show(), !t) {
var r = o.createFile(n, i, void 0, !0);
o.selectFile(r);
@@ -17011,7 +24369,7 @@ function(e) {
}));
}
}
- }), s;
+ }), a;
}), define("providers/bloggerProvider", [ "underscore", "utils", "classes/Provider", "helpers/googleHelper" ], function(e, t, n, i) {
var o = new n("blogger", "Blogger");
return o.defaultPublishFormat = "html", o.publishPreferencesInputIds = [ "blogger-url" ],
@@ -17032,8 +24390,8 @@ function(e) {
var o = new t("github", "GitHub");
return o.publishPreferencesInputIds = [ "github-reponame", "github-username", "github-branch" ],
o.publish = function(e, t, o, r) {
- var a = n.commitMsg;
- i.upload(e.repository, e.username, e.branch, e.path, o, a, r);
+ var s = n.commitMsg;
+ i.upload(e.repository, e.username, e.branch, e.path, o, s, r);
}, o.newPublishAttributes = function(t) {
var n = {};
return n.repository = e.getInputTextValue("#input-publish-github-reponame", t),
@@ -17047,21 +24405,21 @@ function(e) {
void 0) : (e.chain(), void 0);
});
}
- function a(e, n) {
+ function s(e, n) {
var i = void 0;
e && (logger.error(e), "string" == typeof e ? i = "SSH error: " + e + "." : (i = "Could not publish on SSH server.",
e.code <= 0 && (t.setOffline(), i = "|stopPublish"))), n.error(new Error(i));
}
- var s = {}, l = !1;
+ var a = {}, l = !1;
return n.addListener("onOfflineChanged", function(e) {
l = e;
- }), s.upload = function(t, n, s, l, c, u, d, p) {
- var f = new o();
- r(f), f.onRun(function() {
+ }), a.upload = function(t, n, a, l, c, u, d, h) {
+ var p = new o();
+ r(p), p.onRun(function() {
var o = i.sshProxy + "upload", r = {
host: t,
port: n,
- username: s,
+ username: a,
password: l,
path: c,
title: u,
@@ -17074,20 +24432,20 @@ function(e) {
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
- return void 0 === e.error ? (f.chain(), void 0) : (a(e.error, f), void 0);
+ return void 0 === e.error ? (p.chain(), void 0) : (s(e.error, p), void 0);
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
- a(t, f);
+ s(t, p);
});
- }), f.onSuccess(function() {
- p();
- }), f.onError(function(e) {
- p(e);
- }), f.enqueue();
- }, s;
+ }), p.onSuccess(function() {
+ h();
+ }), p.onError(function(e) {
+ h(e);
+ }), p.enqueue();
+ }, a;
}), define("providers/sshProvider", [ "utils", "classes/Provider", "helpers/sshHelper" ], function(e, t, n) {
var i = new t("ssh", "SSH server");
return i.publishPreferencesInputIds = [ "ssh-host", "ssh-port", "ssh-username", "ssh-password" ],
@@ -17107,26 +24465,26 @@ function(e) {
void 0) : (e.chain(), void 0);
});
}
- function a(t) {
+ function s(t) {
var o = void 0, r = void 0;
t.onRun(function() {
- function a() {
+ function s() {
e.getJSON(TUMBLR_PROXY_URL + "request_token", function(e) {
- void 0 !== e.oauth_token ? (p = e, t.chain(s)) : t.error(new Error(d));
+ void 0 !== e.oauth_token ? (h = e, t.chain(a)) : t.error(new Error(d));
});
}
- function s() {
- localStorage.removeItem("tumblrVerifier"), o = n.popupWindow("tumblr-oauth-client.html?oauth_token=" + p.oauth_token, "stackedit-tumblr-oauth", 800, 600),
+ function a() {
+ localStorage.removeItem("tumblrVerifier"), o = n.popupWindow("tumblr-oauth-client.html?oauth_token=" + h.oauth_token, "stackedit-tumblr-oauth", 800, 600),
o.focus(), r = setInterval(function() {
if (o.closed === !0) {
- if (clearInterval(r), o = void 0, r = void 0, p.oauth_verifier = localStorage.tumblrVerifier,
- void 0 === p.oauth_verifier) return t.error(new Error(d)), void 0;
+ if (clearInterval(r), o = void 0, r = void 0, h.oauth_verifier = localStorage.tumblrVerifier,
+ void 0 === h.oauth_verifier) return t.error(new Error(d)), void 0;
localStorage.removeItem("tumblrVerifier"), t.chain(c);
}
}, 500);
}
function c() {
- e.getJSON(TUMBLR_PROXY_URL + "access_token", p, function(e) {
+ e.getJSON(TUMBLR_PROXY_URL + "access_token", h, function(e) {
void 0 !== e.access_token && void 0 !== e.access_token_secret ? (localStorage.tumblrOauthParams = JSON.stringify(e),
l = e, t.chain()) : t.error(new Error(d));
});
@@ -17137,13 +24495,13 @@ function(e) {
i.onMessage("Please make sure the Tumblr authorization popup is not blocked by your browser.");
var d = "Failed to retrieve a token from Tumblr.";
t.timeout = ASYNC_TASK_LONG_TIMEOUT;
- var p = void 0;
- t.chain(a);
+ var h = void 0;
+ t.chain(s);
}), t.onError(function() {
void 0 !== r && clearInterval(r), void 0 !== o && o.close();
});
}
- function s(e, n) {
+ function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Could not publish on Tumblr.", 401 === e.code || 403 === e.code) return l = void 0,
@@ -17156,9 +24514,9 @@ function(e) {
var l = void 0, c = {}, u = !1;
return i.addListener("onOfflineChanged", function(e) {
u = e;
- }), c.upload = function(t, n, i, c, u, d, p) {
- var f = new o();
- r(f), a(f), f.onRun(function() {
+ }), c.upload = function(t, n, i, c, u, d, h) {
+ var p = new o();
+ r(p), s(p), p.onRun(function() {
var o = e.extend({
blog_hostname: t,
post_id: n,
@@ -17174,20 +24532,20 @@ function(e) {
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
- n = e.id, f.chain();
+ n = e.id, p.chain();
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && void 0 !== n && (t = "Post " + n + " not found on Tumblr.|removePublish"),
- s(t, f);
+ a(t, p);
});
- }), f.onSuccess(function() {
- p(void 0, n);
- }), f.onError(function(e) {
- p(e);
- }), f.enqueue();
+ }), p.onSuccess(function() {
+ h(void 0, n);
+ }), p.onError(function(e) {
+ h(e);
+ }), p.enqueue();
}, c;
}), define("providers/tumblrProvider", [ "utils", "classes/Provider", "helpers/tumblrHelper" ], function(e, t, n) {
var i = new t("tumblr", "Tumblr");
@@ -17208,20 +24566,20 @@ function(e) {
void 0) : (e.chain(), void 0);
});
}
- function a(t) {
+ function s(t) {
var o = void 0, r = void 0;
t.onRun(function() {
- function a() {
+ function s() {
localStorage.removeItem("wordpressCode"), o = n.popupWindow("wordpress-oauth-client.html?client_id=" + WORDPRESS_CLIENT_ID, "stackedit-wordpress-oauth", 960, 600),
o.focus(), r = setInterval(function() {
if (o.closed === !0) {
if (clearInterval(r), o = void 0, r = void 0, u = localStorage.wordpressCode, void 0 === u) return t.error(new Error(c)),
void 0;
- localStorage.removeItem("wordpressCode"), t.chain(s);
+ localStorage.removeItem("wordpressCode"), t.chain(a);
}
}, 500);
}
- function s() {
+ function a() {
e.getJSON(WORDPRESS_PROXY_URL + "authenticate/" + u, function(e) {
void 0 !== e.token ? (l = e.token, localStorage.wordpressToken = l, t.chain()) : t.error(new Error(c));
});
@@ -17231,12 +24589,12 @@ function(e) {
var c = "Failed to retrieve a token from Wordpress.";
t.timeout = ASYNC_TASK_LONG_TIMEOUT;
var u = void 0;
- t.chain(a);
+ t.chain(s);
}), t.onError(function() {
void 0 !== r && clearInterval(r), void 0 !== o && o.close();
});
}
- function s(e, n) {
+ function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Could not publish on WordPress.", 400 === e.code && "invalid_token" == e.message || 401 === e.code || 403 === e.code) return localStorage.removeItem("wordpressToken"),
@@ -17250,8 +24608,8 @@ function(e) {
return i.addListener("onOfflineChanged", function(e) {
u = e;
}), c.upload = function(t, n, i, c, u, d) {
- var p = new o();
- r(p), a(p), p.onRun(function() {
+ var h = new o();
+ r(h), s(h), h.onRun(function() {
var o = WORDPRESS_PROXY_URL + "post", r = {
token: l,
site: t,
@@ -17267,25 +24625,25 @@ function(e) {
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
- if (e.body.ID) return n = e.body.ID, p.chain(), void 0;
+ if (e.body.ID) return n = e.body.ID, h.chain(), void 0;
var i = {
code: e.code,
message: e.body.error
};
404 === i.code && ("unknown_blog" == i.message ? i = 'Site "' + t + '" not found on WordPress.|removePublish' : "unknown_post" == i.message && (i = "Post " + n + " not found on WordPress.|removePublish")),
- s(i, p);
+ a(i, h);
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
- s(t, p);
+ a(t, h);
});
- }), p.onSuccess(function() {
+ }), h.onSuccess(function() {
d(void 0, n);
- }), p.onError(function(e) {
+ }), h.onError(function(e) {
d(e);
- }), p.enqueue();
+ }), h.enqueue();
}, c;
}), define("providers/wordpressProvider", [ "utils", "classes/Provider", "helpers/wordpressHelper" ], function(e, t, n) {
var i = new t("wordpress", "WordPress");
@@ -17300,15 +24658,15 @@ function(e) {
n.postId = e.getInputTextValue("#input-publish-postid"), n.tags = e.getInputTextValue("#input-publish-tags"),
t.isPropagationStopped() ? void 0 : n;
}, i;
-}), define("publisher", [ "jquery", "underscore", "utils", "settings", "eventMgr", "fileSystem", "fileMgr", "sharing", "classes/Provider", "providers/bloggerProvider", "providers/dropboxProvider", "providers/gistProvider", "providers/githubProvider", "providers/gdriveProvider", "providers/sshProvider", "providers/tumblrProvider", "providers/wordpressProvider" ], function(e, t, n, i, o, r, a, s, l) {
+}), define("publisher", [ "jquery", "underscore", "utils", "settings", "eventMgr", "fileSystem", "fileMgr", "sharing", "classes/Provider", "providers/bloggerProvider", "providers/dropboxProvider", "providers/gistProvider", "providers/githubProvider", "providers/gdriveProvider", "providers/sshProvider", "providers/tumblrProvider", "providers/wordpressProvider" ], function(e, t, n, i, o, r, s, a, l) {
function c(e, t, i) {
return void 0 === t.format && (t.format = n.getInputRadio("radio-publish-format"),
"template" == t.format && n.getInputChecked("#checkbox-publish-custom-template") && (t.customTmpl = n.getInputValue("#textarea-publish-custom-template"))),
- "markdown" == t.format ? e.content : "html" == t.format ? i : h.applyTemplate(e, t, i);
+ "markdown" == t.format ? e.content : "html" == t.format ? i : f.applyTemplate(e, t, i);
}
function u(e, t) {
- if (0 === g.length) return e(t), void 0;
- var n = g.pop(), i = c(v, n, b);
+ if (0 === m.length) return e(t), void 0;
+ var n = m.pop(), i = c(v, n, b);
n.provider.publish(n, v.title, i, function(i) {
if (void 0 !== i) {
var r = i.toString();
@@ -17323,25 +24681,25 @@ function(e) {
do r = "publish." + n.randomString(); while (t.has(localStorage, r));
i.publishIndex = r, e.addPublishLocation(i), o.onNewPublishSuccess(e, i);
}
- function p(o) {
+ function h(o) {
var r = o.defaultPublishFormat || "markdown";
- C = o, e(".publish-provider-name").text(o.providerName), e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-" + o.providerId).show(),
+ x = o, e(".publish-provider-name").text(o.providerName), e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-" + o.providerId).show(),
n.resetModalInputs(), n.setInputRadio("radio-publish-format", r), n.setInputChecked("#checkbox-publish-custom-template", !1),
n.setInputValue("#textarea-publish-custom-template", i.template);
- var a = n.retrieveIgnoreError(o.providerId + ".publishPreferences");
- a && (t.each(o.publishPreferencesInputIds, function(e) {
- var i = a[e];
+ var s = n.retrieveIgnoreError(o.providerId + ".publishPreferences");
+ s && (t.each(o.publishPreferencesInputIds, function(e) {
+ var i = s[e];
t.isBoolean(i) ? n.setInputChecked("#input-publish-" + e, i) : n.setInputValue("#input-publish-" + e, i);
- }), n.setInputRadio("radio-publish-format", a.format), n.setInputChecked("#checkbox-publish-custom-template", void 0 !== a.customTmpl),
- n.setInputValue("#textarea-publish-custom-template", a.customTmpl || i.template)),
+ }), n.setInputRadio("radio-publish-format", s.format), n.setInputChecked("#checkbox-publish-custom-template", void 0 !== s.customTmpl),
+ n.setInputValue("#textarea-publish-custom-template", s.customTmpl || i.template)),
e(".modal-publish").modal();
}
- function f(e) {
- var n = C, i = n.newPublishAttributes(e);
+ function p(e) {
+ var n = x, i = n.newPublishAttributes(e);
if (void 0 !== i) {
- var o = a.currentFile, r = y, l = c(o, i, r);
+ var o = s.currentFile, r = y, l = c(o, i, r);
n.publish(i, o.title, l, function(e) {
- void 0 === e && (i.provider = n, s.createLink(i, function() {
+ void 0 === e && (i.provider = n, a.createLink(i, function() {
d(o, i);
}));
});
@@ -17352,7 +24710,7 @@ function(e) {
}), u.format = i.format, u.customTmpl = i.customTmpl, localStorage[n.providerId + ".publishPreferences"] = JSON.stringify(u);
}
}
- var h = {}, m = t.chain(arguments).map(function(e) {
+ var f = {}, g = t.chain(arguments).map(function(e) {
return e instanceof l && [ e.providerId, e ];
}).compact().object().value();
t.each(r, function(e) {
@@ -17360,80 +24718,80 @@ function(e) {
try {
var i = JSON.parse(localStorage[t]);
i.publishIndex = t;
- var r = m[i.provider];
+ var r = g[i.provider];
if (!r) throw new Error("Invalid provider ID: " + i.provider);
i.provider = r, e.publishLocations[t] = i;
- } catch (a) {
- o.onError(a), n.removeIndexFromArray(e.fileIndex + ".publish", t), localStorage.removeItem(t);
+ } catch (s) {
+ o.onError(s), n.removeIndexFromArray(e.fileIndex + ".publish", t), localStorage.removeItem(t);
}
});
- }), h.applyTemplate = function(e, n, r) {
+ }), f.applyTemplate = function(e, n, r) {
try {
- var a = n && n.customTmpl || i.template;
- return t.template(a, {
+ var s = n && n.customTmpl || i.template;
+ return t.template(s, {
documentTitle: e.title,
documentMarkdown: e.content,
documentHTML: r,
publishAttributes: n
});
- } catch (s) {
- return o.onError(s), s.message;
+ } catch (a) {
+ return o.onError(a), a.message;
}
};
- var g = [], v = void 0, b = void 0, y = void 0;
+ var m = [], v = void 0, b = void 0, y = void 0;
o.addListener("onPreviewFinished", function(e) {
y = e;
});
- var x = !1;
- o.addListener("onOfflineChanged", function(e) {
- x = e;
- });
var w = !1;
- h.publish = function() {
- w !== !0 && x !== !0 && (w = !0, o.onPublishRunning(!0), v = a.currentFile, b = y,
- g = t.values(v.publishLocations), u(function(e) {
- w = !1, o.onPublishRunning(!1), void 0 === e && o.onPublishSuccess(v);
+ o.addListener("onOfflineChanged", function(e) {
+ w = e;
+ });
+ var C = !1;
+ f.publish = function() {
+ C !== !0 && w !== !0 && (C = !0, o.onPublishRunning(!0), v = s.currentFile, b = y,
+ m = t.values(v.publishLocations), u(function(e) {
+ C = !1, o.onPublishRunning(!1), void 0 === e && o.onPublishSuccess(v);
}));
};
- var C = void 0, k = [ "